admins-components 9.0.27 → 9.0.29
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/README.md +4 -22
- package/dist/admins-components.js +53 -52
- package/dist/admins-components100.js +79 -249
- package/dist/admins-components100.js.map +1 -1
- package/dist/admins-components101.js +112 -26
- package/dist/admins-components101.js.map +1 -1
- package/dist/admins-components102.js +45 -26
- package/dist/admins-components102.js.map +1 -1
- package/dist/admins-components103.js +102 -168
- package/dist/admins-components103.js.map +1 -1
- package/dist/admins-components104.js +17 -65
- package/dist/admins-components104.js.map +1 -1
- package/dist/admins-components105.js +6 -66
- package/dist/admins-components105.js.map +1 -1
- package/dist/admins-components106.js +247 -25
- package/dist/admins-components106.js.map +1 -1
- package/dist/admins-components107.js +27 -16
- package/dist/admins-components107.js.map +1 -1
- package/dist/admins-components108.js +26 -25
- package/dist/admins-components108.js.map +1 -1
- package/dist/admins-components109.js +171 -8
- package/dist/admins-components109.js.map +1 -1
- package/dist/admins-components110.js +67 -3
- package/dist/admins-components110.js.map +1 -1
- package/dist/admins-components111.js +67 -3
- package/dist/admins-components111.js.map +1 -1
- package/dist/admins-components112.js +30 -3
- package/dist/admins-components112.js.map +1 -1
- package/dist/admins-components113.js +15 -20
- package/dist/admins-components113.js.map +1 -1
- package/dist/admins-components114.js +27 -14
- package/dist/admins-components114.js.map +1 -1
- package/dist/admins-components115.js +8 -7
- package/dist/admins-components115.js.map +1 -1
- package/dist/admins-components116.js +4 -13
- package/dist/admins-components116.js.map +1 -1
- package/dist/admins-components117.js +3 -26
- package/dist/admins-components117.js.map +1 -1
- package/dist/admins-components118.js +3 -83
- package/dist/admins-components118.js.map +1 -1
- package/dist/admins-components119.js +19 -9
- package/dist/admins-components119.js.map +1 -1
- package/dist/admins-components120.js +14 -5
- package/dist/admins-components120.js.map +1 -1
- package/dist/admins-components121.js +7 -7
- package/dist/admins-components121.js.map +1 -1
- package/dist/admins-components122.js +12 -6
- package/dist/admins-components122.js.map +1 -1
- package/dist/admins-components123.js +25 -5
- package/dist/admins-components123.js.map +1 -1
- package/dist/admins-components124.js +82 -14
- package/dist/admins-components124.js.map +1 -1
- package/dist/admins-components125.js +10 -12
- package/dist/admins-components125.js.map +1 -1
- package/dist/admins-components126.js +5 -30
- package/dist/admins-components126.js.map +1 -1
- package/dist/admins-components127.js +7 -3
- package/dist/admins-components127.js.map +1 -1
- package/dist/admins-components128.js +7 -29
- package/dist/admins-components128.js.map +1 -1
- package/dist/admins-components129.js +3 -2
- package/dist/admins-components129.js.map +1 -1
- package/dist/admins-components130.js +12 -2
- package/dist/admins-components130.js.map +1 -1
- package/dist/admins-components131.js +12 -7
- package/dist/admins-components131.js.map +1 -1
- package/dist/admins-components132.js +30 -74
- package/dist/admins-components132.js.map +1 -1
- package/dist/admins-components133.js +4 -29
- package/dist/admins-components133.js.map +1 -1
- package/dist/admins-components134.js +27 -57
- package/dist/admins-components134.js.map +1 -1
- package/dist/admins-components135.js +5 -24
- package/dist/admins-components135.js.map +1 -1
- package/dist/admins-components136.js +5 -50
- package/dist/admins-components136.js.map +1 -1
- package/dist/admins-components137.js +7 -30
- package/dist/admins-components137.js.map +1 -1
- package/dist/admins-components138.js +74 -3
- package/dist/admins-components138.js.map +1 -1
- package/dist/admins-components139.js +27 -177
- package/dist/admins-components139.js.map +1 -1
- package/dist/admins-components140.js +58 -45
- package/dist/admins-components140.js.map +1 -1
- package/dist/admins-components141.js +23 -36
- package/dist/admins-components141.js.map +1 -1
- package/dist/admins-components142.js +46 -42
- package/dist/admins-components142.js.map +1 -1
- package/dist/admins-components143.js +28 -138
- package/dist/admins-components143.js.map +1 -1
- package/dist/admins-components144.js +3 -58
- package/dist/admins-components144.js.map +1 -1
- package/dist/admins-components145.js +178 -6
- package/dist/admins-components145.js.map +1 -1
- package/dist/admins-components146.js +45 -5
- package/dist/admins-components146.js.map +1 -1
- package/dist/admins-components147.js +37 -76
- package/dist/admins-components147.js.map +1 -1
- package/dist/admins-components148.js +45 -28
- package/dist/admins-components148.js.map +1 -1
- package/dist/admins-components149.js +129 -1919
- package/dist/admins-components149.js.map +1 -1
- package/dist/admins-components15.js +8 -42
- package/dist/admins-components15.js.map +1 -1
- package/dist/admins-components150.js +54 -24807
- package/dist/admins-components150.js.map +1 -1
- package/dist/admins-components151.js +6 -8
- package/dist/admins-components151.js.map +1 -1
- package/dist/admins-components152.js +6 -7
- package/dist/admins-components152.js.map +1 -0
- package/dist/admins-components153.js +76 -142
- package/dist/admins-components153.js.map +1 -1
- package/dist/admins-components154.js +28 -8
- package/dist/admins-components154.js.map +1 -1
- package/dist/admins-components155.js +1930 -8
- package/dist/admins-components155.js.map +1 -1
- package/dist/admins-components156.js +24812 -0
- package/dist/admins-components156.js.map +1 -0
- package/dist/admins-components157.js +8 -167
- package/dist/admins-components157.js.map +1 -1
- package/dist/admins-components158.js +7 -51
- package/dist/admins-components159.js +141 -8
- package/dist/admins-components159.js.map +1 -1
- package/dist/admins-components16.js +89 -4
- package/dist/admins-components16.js.map +1 -1
- package/dist/admins-components160.js +8 -49
- package/dist/admins-components160.js.map +1 -1
- package/dist/admins-components161.js +9 -6
- package/dist/admins-components161.js.map +1 -1
- package/dist/admins-components163.js +160 -50
- package/dist/admins-components163.js.map +1 -1
- package/dist/admins-components164.js +34 -42
- package/dist/admins-components164.js.map +1 -1
- package/dist/admins-components165.js +3 -3
- package/dist/admins-components165.js.map +1 -1
- package/dist/admins-components166.js +18 -20
- package/dist/admins-components166.js.map +1 -1
- package/dist/admins-components167.js +6 -9
- package/dist/admins-components167.js.map +1 -1
- package/dist/{admins-components162.js → admins-components168.js} +3 -3
- package/dist/{admins-components162.js.map → admins-components168.js.map} +1 -1
- package/dist/admins-components169.js +51 -51
- package/dist/admins-components169.js.map +1 -1
- package/dist/admins-components17.js +4 -94
- package/dist/admins-components17.js.map +1 -1
- package/dist/admins-components170.js +60 -0
- package/dist/admins-components170.js.map +1 -0
- package/dist/admins-components171.js +10 -0
- package/dist/admins-components171.js.map +1 -0
- package/dist/admins-components172.js +53 -0
- package/dist/admins-components172.js.map +1 -0
- package/dist/admins-components173.js +10 -0
- package/dist/admins-components173.js.map +1 -0
- package/dist/admins-components175.js +59 -0
- package/dist/admins-components175.js.map +1 -0
- package/dist/admins-components18.js +37 -239
- package/dist/admins-components18.js.map +1 -1
- package/dist/admins-components19.js +1 -2
- package/dist/admins-components19.js.map +1 -1
- package/dist/admins-components20.js +91 -179
- package/dist/admins-components20.js.map +1 -1
- package/dist/admins-components21.js +245 -0
- package/dist/admins-components21.js.map +1 -0
- package/dist/admins-components22.js +3 -4
- package/dist/admins-components22.js.map +1 -1
- package/dist/admins-components23.js +172 -68
- package/dist/admins-components23.js.map +1 -1
- package/dist/admins-components25.js +6 -58
- package/dist/admins-components25.js.map +1 -1
- package/dist/admins-components26.js +79 -0
- package/dist/{admins-components24.js.map → admins-components26.js.map} +1 -1
- package/dist/admins-components27.js +3 -3
- package/dist/admins-components27.js.map +1 -1
- package/dist/admins-components28.js +50 -64
- package/dist/admins-components28.js.map +1 -1
- package/dist/admins-components29.js +75 -0
- package/dist/admins-components29.js.map +1 -0
- package/dist/admins-components31.js +6 -39
- package/dist/admins-components31.js.map +1 -1
- package/dist/admins-components32.js +66 -0
- package/dist/admins-components32.js.map +1 -0
- package/dist/admins-components34.js +6 -36
- package/dist/admins-components34.js.map +1 -1
- package/dist/admins-components35.js +39 -4
- package/dist/admins-components35.js.map +1 -1
- package/dist/{admins-components33.js → admins-components37.js} +1 -1
- package/dist/{admins-components33.js.map → admins-components37.js.map} +1 -1
- package/dist/admins-components38.js +36 -6
- package/dist/admins-components38.js.map +1 -1
- package/dist/admins-components39.js +4 -146
- package/dist/admins-components39.js.map +1 -1
- package/dist/{admins-components36.js.map → admins-components40.js.map} +1 -1
- package/dist/admins-components42.js +6 -124
- package/dist/admins-components42.js.map +1 -1
- package/dist/admins-components43.js +146 -4
- package/dist/admins-components43.js.map +1 -1
- package/dist/admins-components45.js +4 -2
- package/dist/admins-components45.js.map +1 -1
- package/dist/admins-components46.js +120 -15
- package/dist/admins-components46.js.map +1 -1
- package/dist/admins-components47.js +5 -0
- package/dist/admins-components47.js.map +1 -0
- package/dist/admins-components48.js +179 -6
- package/dist/admins-components48.js.map +1 -1
- package/dist/admins-components49.js +4 -54
- package/dist/admins-components49.js.map +1 -1
- package/dist/admins-components50.js +15 -89
- package/dist/admins-components50.js.map +1 -1
- package/dist/admins-components52.js +2 -2
- package/dist/admins-components52.js.map +1 -1
- package/dist/admins-components53.js +52 -23
- package/dist/admins-components53.js.map +1 -1
- package/dist/admins-components54.js +93 -9
- package/dist/admins-components54.js.map +1 -1
- package/dist/admins-components56.js +6 -73
- package/dist/admins-components56.js.map +1 -1
- package/dist/admins-components57.js +24 -65
- package/dist/admins-components57.js.map +1 -1
- package/dist/admins-components58.js +9 -4
- package/dist/admins-components58.js.map +1 -1
- package/dist/admins-components59.js +19 -138
- package/dist/admins-components59.js.map +1 -1
- package/dist/admins-components60.js +74 -0
- package/dist/admins-components60.js.map +1 -0
- package/dist/admins-components61.js +66 -7
- package/dist/admins-components61.js.map +1 -1
- package/dist/admins-components62.js +4 -170
- package/dist/admins-components62.js.map +1 -1
- package/dist/admins-components63.js +140 -0
- package/dist/admins-components63.js.map +1 -0
- package/dist/admins-components65.js +7 -7
- package/dist/admins-components65.js.map +1 -1
- package/dist/admins-components66.js +155 -259
- package/dist/admins-components66.js.map +1 -1
- package/dist/admins-components68.js +3 -2
- package/dist/admins-components68.js.map +1 -1
- package/dist/admins-components69.js +6 -119
- package/dist/admins-components69.js.map +1 -1
- package/dist/admins-components70.js +280 -0
- package/dist/admins-components70.js.map +1 -0
- package/dist/admins-components72.js +6 -59
- package/dist/admins-components72.js.map +1 -1
- package/dist/admins-components73.js +110 -207
- package/dist/admins-components73.js.map +1 -1
- package/dist/admins-components75.js +2 -2
- package/dist/admins-components75.js.map +1 -1
- package/dist/admins-components76.js +58 -7
- package/dist/admins-components76.js.map +1 -1
- package/dist/admins-components77.js +220 -51
- package/dist/admins-components77.js.map +1 -1
- package/dist/admins-components79.js +7 -0
- package/dist/admins-components79.js.map +1 -0
- package/dist/admins-components80.js +52 -6
- package/dist/admins-components80.js.map +1 -1
- package/dist/admins-components81.js +246 -32
- package/dist/admins-components81.js.map +1 -1
- package/dist/admins-components83.js +2 -2
- package/dist/admins-components83.js.map +1 -1
- package/dist/admins-components84.js +31 -192
- package/dist/admins-components84.js.map +1 -1
- package/dist/admins-components86.js +2 -2
- package/dist/admins-components86.js.map +1 -1
- package/dist/admins-components87.js +195 -184
- package/dist/admins-components87.js.map +1 -1
- package/dist/admins-components89.js +2 -2
- package/dist/admins-components89.js.map +1 -1
- package/dist/admins-components90.js +16 -3
- package/dist/admins-components90.js.map +1 -1
- package/dist/admins-components91.js +77 -16
- package/dist/admins-components91.js.map +1 -1
- package/dist/admins-components93.js +6 -52
- package/dist/admins-components93.js.map +1 -1
- package/dist/admins-components94.js +195 -81
- package/dist/admins-components94.js.map +1 -1
- package/dist/admins-components96.js +6 -47
- package/dist/admins-components96.js.map +1 -1
- package/dist/admins-components97.js +3 -106
- package/dist/admins-components97.js.map +1 -1
- package/dist/admins-components98.js +3 -20
- package/dist/admins-components98.js.map +1 -1
- package/dist/admins-components99.js +51 -6
- package/dist/admins-components99.js.map +1 -1
- package/dist/main.css +1 -1
- package/dist/main.css.map +1 -1
- package/dist/src/components/Checkbox.vue.d.ts +11 -1
- package/dist/src/components/TextInput.vue.d.ts +33 -0
- package/dist/src/components/data-table/DataFilters.vue.d.ts +7 -14
- package/dist/src/components/data-table/DataList.vue.d.ts +10 -7
- package/dist/src/components/data-table/DataSearch.vue.d.ts +26 -0
- package/dist/src/composables/useSwipeToClose.d.ts +50 -0
- package/dist/src/index.d.ts +5 -1
- package/dist/src/styles/components/data-table/data-cards.scss_vue_type_style_index_0_src_true_lang.css +1 -1
- package/dist/src/styles/components/data-table/data-list.scss_vue_type_style_index_0_src_true_lang.css +1 -1
- package/dist/src/styles/components/data-table/data-paginator.scss_vue_type_style_index_0_src_true_lang.css +1 -1
- package/dist/src/styles/components/data-table/data-search.scss_vue_type_style_index_0_src_true_lang.css +1 -0
- package/dist/src/styles/components/data-table/data-table.scss_vue_type_style_index_0_src_true_lang.css +1 -1
- package/dist/src/styles/components/dropdown-select.scss_vue_type_style_index_0_src_true_lang.css +1 -1
- package/dist/src/styles/components/image-picker.scss_vue_type_style_index_0_src_true_lang.css +1 -1
- package/dist/src/styles/components/sidebar.scss_vue_type_style_index_0_src_true_lang.css +1 -1
- package/dist/src/types/data-list.d.ts +0 -1
- package/package.json +1 -1
- package/dist/admins-components158.js.map +0 -1
- package/dist/admins-components24.js +0 -7
- package/dist/admins-components30.js +0 -7
- package/dist/admins-components30.js.map +0 -1
- package/dist/admins-components41.js +0 -7
- package/dist/admins-components41.js.map +0 -1
- package/dist/admins-components44.js +0 -180
- package/dist/admins-components44.js.map +0 -1
- package/dist/admins-components55.js +0 -20
- package/dist/admins-components55.js.map +0 -1
- package/dist/admins-components64.js +0 -8
- package/dist/admins-components64.js.map +0 -1
- package/dist/admins-components71.js +0 -7
- package/dist/admins-components71.js.map +0 -1
- package/dist/admins-components78.js +0 -276
- package/dist/admins-components78.js.map +0 -1
- package/dist/admins-components92.js +0 -4
- package/dist/admins-components92.js.map +0 -1
- package/dist/admins-components95.js +0 -114
- package/dist/admins-components95.js.map +0 -1
- /package/dist/{admins-components36.js → admins-components40.js} +0 -0
|
@@ -1,66 +1,52 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
key: 1,
|
|
12
|
-
class: "hc-slot hc-slot--right"
|
|
13
|
-
}, C = {
|
|
14
|
-
icon: void 0,
|
|
15
|
-
showBackButton: !1,
|
|
16
|
-
toolbars: () => []
|
|
17
|
-
}, w = /* @__PURE__ */ s({
|
|
18
|
-
__name: "HeaderComponent",
|
|
19
|
-
props: /* @__PURE__ */ c({
|
|
20
|
-
title: {},
|
|
21
|
-
icon: {},
|
|
22
|
-
showBackButton: { type: Boolean },
|
|
23
|
-
toolbars: {}
|
|
24
|
-
}, { ...C }),
|
|
25
|
-
emits: ["back"],
|
|
26
|
-
setup(s, { emit: c }) {
|
|
27
|
-
let C = s, w = c, T = n(() => {
|
|
28
|
-
let e = {
|
|
29
|
-
left: 0,
|
|
30
|
-
center: 1,
|
|
31
|
-
right: 2
|
|
32
|
-
};
|
|
33
|
-
return [...C.toolbars].sort((t, n) => e[t.align] - e[n.align]);
|
|
34
|
-
});
|
|
35
|
-
return (n, c) => (d(), a("div", h, [o("header", g, [
|
|
36
|
-
o("div", _, [
|
|
37
|
-
s.showBackButton ? (d(), r(e, {
|
|
38
|
-
key: 0,
|
|
39
|
-
class: "hc-back-btn",
|
|
40
|
-
icon: "fa-solid fa-chevron-left",
|
|
41
|
-
"aria-label": "Vissza",
|
|
42
|
-
onClick: c[0] ||= (e) => w("back")
|
|
43
|
-
})) : i("", !0),
|
|
44
|
-
o("div", v, [s.icon ? (d(), a("i", {
|
|
45
|
-
key: 0,
|
|
46
|
-
class: u([s.icon, "hc-title-icon"])
|
|
47
|
-
}, null, 2)) : i("", !0), o("h1", y, m(s.title), 1)]),
|
|
48
|
-
n.$slots.left ? (d(), a("div", b, [p(n.$slots, "left")])) : i("", !0),
|
|
49
|
-
(d(!0), a(t, null, f(T.value.filter((e) => e.align === "left"), (n, i) => (d(), a("div", {
|
|
50
|
-
key: `l-${i}`,
|
|
51
|
-
class: "hc-buttons hc-buttons--left"
|
|
52
|
-
}, [(d(!0), a(t, null, f(n.buttons, (t, n) => (d(), r(e, l({ key: n }, { ref_for: !0 }, t), null, 16))), 128))]))), 128))
|
|
53
|
-
]),
|
|
54
|
-
n.$slots.center || T.value.some((e) => e.align === "center") ? (d(), a("div", x, [p(n.$slots, "center"), (d(!0), a(t, null, f(T.value.filter((e) => e.align === "center"), (n, i) => (d(), a("div", {
|
|
55
|
-
key: `c-${i}`,
|
|
56
|
-
class: "hc-buttons"
|
|
57
|
-
}, [(d(!0), a(t, null, f(n.buttons, (t, n) => (d(), r(e, l({ key: n }, { ref_for: !0 }, t), null, 16))), 128))]))), 128))])) : i("", !0),
|
|
58
|
-
n.$slots.right || T.value.some((e) => e.align === "right") ? (d(), a("div", S, [p(n.$slots, "right"), (d(!0), a(t, null, f(T.value.filter((e) => e.align === "right"), (n, i) => (d(), a("div", {
|
|
59
|
-
key: `r-${i}`,
|
|
60
|
-
class: "hc-buttons"
|
|
61
|
-
}, [(d(!0), a(t, null, f(n.buttons, (t, n) => (d(), r(e, l({ key: n }, { ref_for: !0 }, t), null, 16))), 128))]))), 128))])) : i("", !0)
|
|
62
|
-
])]));
|
|
1
|
+
import { computed as e, onBeforeUnmount as t, onMounted as n, ref as r } from "vue";
|
|
2
|
+
//#region src/composables/useSwipeToClose.ts
|
|
3
|
+
function i(i, a) {
|
|
4
|
+
let { position: o, onClose: s, distanceThreshold: c = .35, velocityThreshold: l = .4, verticalRatio: u = .7, closeDirections: d = "away" } = a, f = r(!1), p = r(0), m = 0, h = 0, g = 0, _ = null, v = 0, y = e(() => o.value === "left" || o.value === "right");
|
|
5
|
+
function b(e) {
|
|
6
|
+
if (!y.value || e.touches.length !== 1) return;
|
|
7
|
+
let t = e.touches[0];
|
|
8
|
+
if (!t) return;
|
|
9
|
+
let n = i.value;
|
|
10
|
+
n && (m = t.clientX, h = t.clientY, g = performance.now(), v = n.offsetWidth, f.value = !0, p.value = 0, _ = t.identifier);
|
|
63
11
|
}
|
|
64
|
-
|
|
12
|
+
function x(e) {
|
|
13
|
+
if (!f.value || _ === null) return;
|
|
14
|
+
let t = Array.from(e.touches).find((e) => e.identifier === _);
|
|
15
|
+
if (!t) return;
|
|
16
|
+
let n = t.clientX - m, r = t.clientY - h;
|
|
17
|
+
if (Math.abs(r) > Math.abs(n) * u && Math.abs(r) > 10) {
|
|
18
|
+
f.value = !1, p.value = 0;
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
o.value === "left" ? p.value = d === "both" ? n : Math.min(0, n) : p.value = d === "both" ? n : Math.max(0, n), e.cancelable && e.preventDefault();
|
|
22
|
+
}
|
|
23
|
+
function S(e) {
|
|
24
|
+
if (!f.value) return;
|
|
25
|
+
let t = Array.from(e.changedTouches).find((e) => e.identifier === _) ?? e.changedTouches[0], n = t ? t.clientX - m : 0, r = Math.max(1, performance.now() - g), i = Math.abs(n) / r, a = Math.abs(n) / Math.max(v, 1) >= c || i >= l, u = o.value === "left" && n < 0 || o.value === "right" && n > 0;
|
|
26
|
+
a && (d === "both" || u) && s(), f.value = !1, _ = null, p.value = 0;
|
|
27
|
+
}
|
|
28
|
+
function C() {
|
|
29
|
+
f.value = !1, _ = null, p.value = 0;
|
|
30
|
+
}
|
|
31
|
+
let w = e(() => {
|
|
32
|
+
if (!(!f.value || p.value === 0)) return {
|
|
33
|
+
transform: `translateX(${p.value}px)`,
|
|
34
|
+
transition: "none"
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
return n(() => {
|
|
38
|
+
document.addEventListener("touchmove", x, { passive: !1 });
|
|
39
|
+
}), t(() => {
|
|
40
|
+
document.removeEventListener("touchmove", x);
|
|
41
|
+
}), {
|
|
42
|
+
isDragging: f,
|
|
43
|
+
panelStyle: w,
|
|
44
|
+
touchHandlers: {
|
|
45
|
+
onTouchstart: b,
|
|
46
|
+
onTouchend: S,
|
|
47
|
+
onTouchcancel: C
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
65
51
|
//#endregion
|
|
66
|
-
export {
|
|
52
|
+
export { i as useSwipeToClose };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components28.js","names":[
|
|
1
|
+
{"version":3,"file":"admins-components28.js","names":[],"sources":["../src/composables/useSwipeToClose.ts"],"sourcesContent":["import { computed, onBeforeUnmount, onMounted, ref } from 'vue'\nimport type { Ref } from 'vue'\n\nexport interface UseSwipeToCloseOptions {\n /**\n * The panel's anchor position. The composable only attempts to close on\n * horizontal positions ('left' / 'right').\n */\n position: Ref<'left' | 'right' | 'top' | 'bottom'>\n /** Called when the user completes a qualifying swipe-to-close gesture. */\n onClose: () => void\n /**\n * Fraction of the panel width that must be covered by the swipe to trigger\n * a close. Defaults to 0.35 (35%).\n */\n distanceThreshold?: number\n /**\n * Horizontal velocity (px/ms) above which a shorter swipe still closes.\n * Defaults to 0.4.\n */\n velocityThreshold?: number\n /**\n * Vertical-movement ratio above which the gesture is treated as a scroll\n * and ignored. Defaults to 0.7 (vertical must be ≤ 70% of horizontal).\n */\n verticalRatio?: number\n /**\n * Which swipe directions count as a close gesture.\n *\n * - `'away'` (default): only swipes toward the anchored edge close the\n * panel (left-positioned panel closes on left swipe, right-positioned\n * on right swipe).\n * - `'both'`: swipes in either horizontal direction close the panel.\n *\n * Swipes against the anchored edge are visually constrained so the panel\n * doesn't get pushed past its anchor.\n */\n closeDirections?: 'away' | 'both'\n}\n\nexport interface UseSwipeToCloseReturn {\n /** Whether a swipe is currently in progress. */\n isDragging: Ref<boolean>\n /** Inline style to apply to the panel element (transform + transition). */\n panelStyle: Ref<Record<string, string> | undefined>\n /** Handlers to bind to the panel element's touch events. */\n touchHandlers: {\n onTouchstart: (e: TouchEvent) => void\n onTouchend: (e: TouchEvent) => void\n onTouchcancel: () => void\n }\n}\n\nexport function useSwipeToClose(\n panelRef: Ref<HTMLElement | null>,\n options: UseSwipeToCloseOptions,\n): UseSwipeToCloseReturn {\n const {\n position,\n onClose,\n distanceThreshold = 0.35,\n velocityThreshold = 0.4,\n verticalRatio = 0.7,\n closeDirections = 'away',\n } = options\n\n const isDragging = ref(false)\n const dragOffset = ref(0)\n\n let startX = 0\n let startY = 0\n let startTime = 0\n let trackingPointer: number | null = null\n let panelWidth = 0\n\n const isHorizontal = computed(\n () => position.value === 'left' || position.value === 'right',\n )\n\n function onTouchStart(e: TouchEvent) {\n if (!isHorizontal.value || e.touches.length !== 1) return\n const touch = e.touches[0]\n if (!touch) return\n const panel = panelRef.value\n if (!panel) return\n\n startX = touch.clientX\n startY = touch.clientY\n startTime = performance.now()\n panelWidth = panel.offsetWidth\n isDragging.value = true\n dragOffset.value = 0\n trackingPointer = touch.identifier\n }\n\n function onTouchMove(e: TouchEvent) {\n if (!isDragging.value || trackingPointer === null) return\n const touch = Array.from(e.touches).find((t) => t.identifier === trackingPointer)\n if (!touch) return\n\n const dx = touch.clientX - startX\n const dy = touch.clientY - startY\n\n // Vertical-dominant gesture: let the browser scroll the panel content.\n if (Math.abs(dy) > Math.abs(dx) * verticalRatio && Math.abs(dy) > 10) {\n isDragging.value = false\n dragOffset.value = 0\n return\n }\n\n // The panel can't be dragged past its anchor: the edge closest to the\n // panel's position acts as a wall. When closeDirections === 'away' the\n // inward direction (away from the anchor) is also clamped at 0 so the\n // gesture mirrors a \"dismiss\" only toward the screen edge.\n if (position.value === 'left') {\n dragOffset.value = closeDirections === 'both' ? dx : Math.min(0, dx)\n } else {\n dragOffset.value = closeDirections === 'both' ? dx : Math.max(0, dx)\n }\n\n if (e.cancelable) e.preventDefault()\n }\n\n function onTouchEnd(e: TouchEvent) {\n if (!isDragging.value) return\n\n const touch =\n Array.from(e.changedTouches).find((t) => t.identifier === trackingPointer) ??\n e.changedTouches[0]\n\n const dx = touch ? touch.clientX - startX : 0\n const dt = Math.max(1, performance.now() - startTime)\n const velocity = Math.abs(dx) / dt\n const distanceRatio = Math.abs(dx) / Math.max(panelWidth, 1)\n\n const shouldClose =\n distanceRatio >= distanceThreshold || velocity >= velocityThreshold\n const swipedTowardEdge =\n (position.value === 'left' && dx < 0) || (position.value === 'right' && dx > 0)\n\n if (shouldClose && (closeDirections === 'both' || swipedTowardEdge)) {\n onClose()\n }\n\n isDragging.value = false\n trackingPointer = null\n dragOffset.value = 0\n }\n\n function onTouchCancel() {\n isDragging.value = false\n trackingPointer = null\n dragOffset.value = 0\n }\n\n const panelStyle = computed<Record<string, string> | undefined>(() => {\n if (!isDragging.value || dragOffset.value === 0) return undefined\n return {\n transform: `translateX(${dragOffset.value}px)`,\n transition: 'none',\n }\n })\n\n onMounted(() => {\n // Non-passive so we can preventDefault and stop the page from scrolling\n // horizontally while the panel is being dragged.\n document.addEventListener('touchmove', onTouchMove, { passive: false })\n })\n\n onBeforeUnmount(() => {\n document.removeEventListener('touchmove', onTouchMove)\n })\n\n return {\n isDragging,\n panelStyle,\n touchHandlers: {\n onTouchstart: onTouchStart,\n onTouchend: onTouchEnd,\n onTouchcancel: onTouchCancel,\n },\n }\n}\n"],"mappings":";;AAqDA,SAAgB,EACd,GACA,GACuB;CACvB,IAAM,EACJ,aACA,YACA,uBAAoB,KACpB,uBAAoB,IACpB,mBAAgB,IAChB,qBAAkB,WAChB,GAEE,IAAa,EAAI,EAAK,GACtB,IAAa,EAAI,CAAC,GAEpB,IAAS,GACT,IAAS,GACT,IAAY,GACZ,IAAiC,MACjC,IAAa,GAEX,IAAe,QACb,EAAS,UAAU,UAAU,EAAS,UAAU,OACxD;CAEA,SAAS,EAAa,GAAe;EACnC,IAAI,CAAC,EAAa,SAAS,EAAE,QAAQ,WAAW,GAAG;EACnD,IAAM,IAAQ,EAAE,QAAQ;EACxB,IAAI,CAAC,GAAO;EACZ,IAAM,IAAQ,EAAS;EAClB,MAEL,IAAS,EAAM,SACf,IAAS,EAAM,SACf,IAAY,YAAY,IAAI,GAC5B,IAAa,EAAM,aACnB,EAAW,QAAQ,IACnB,EAAW,QAAQ,GACnB,IAAkB,EAAM;CAC1B;CAEA,SAAS,EAAY,GAAe;EAClC,IAAI,CAAC,EAAW,SAAS,MAAoB,MAAM;EACnD,IAAM,IAAQ,MAAM,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,EAAE,eAAe,CAAe;EAChF,IAAI,CAAC,GAAO;EAEZ,IAAM,IAAK,EAAM,UAAU,GACrB,IAAK,EAAM,UAAU;EAG3B,IAAI,KAAK,IAAI,CAAE,IAAI,KAAK,IAAI,CAAE,IAAI,KAAiB,KAAK,IAAI,CAAE,IAAI,IAAI;GAEpE,AADA,EAAW,QAAQ,IACnB,EAAW,QAAQ;GACnB;EACF;EAYA,AANI,EAAS,UAAU,SACrB,EAAW,QAAQ,MAAoB,SAAS,IAAK,KAAK,IAAI,GAAG,CAAE,IAEnE,EAAW,QAAQ,MAAoB,SAAS,IAAK,KAAK,IAAI,GAAG,CAAE,GAGjE,EAAE,cAAY,EAAE,eAAe;CACrC;CAEA,SAAS,EAAW,GAAe;EACjC,IAAI,CAAC,EAAW,OAAO;EAEvB,IAAM,IACJ,MAAM,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,EAAE,eAAe,CAAe,KACzE,EAAE,eAAe,IAEb,IAAK,IAAQ,EAAM,UAAU,IAAS,GACtC,IAAK,KAAK,IAAI,GAAG,YAAY,IAAI,IAAI,CAAS,GAC9C,IAAW,KAAK,IAAI,CAAE,IAAI,GAG1B,IAFgB,KAAK,IAAI,CAAE,IAAI,KAAK,IAAI,GAAY,CAAC,KAGxC,KAAqB,KAAY,GAC9C,IACH,EAAS,UAAU,UAAU,IAAK,KAAO,EAAS,UAAU,WAAW,IAAK;EAQ/E,AANI,MAAgB,MAAoB,UAAU,MAChD,EAAQ,GAGV,EAAW,QAAQ,IACnB,IAAkB,MAClB,EAAW,QAAQ;CACrB;CAEA,SAAS,IAAgB;EAGvB,AAFA,EAAW,QAAQ,IACnB,IAAkB,MAClB,EAAW,QAAQ;CACrB;CAEA,IAAM,IAAa,QAAmD;EAChE,OAAC,EAAW,SAAS,EAAW,UAAU,IAC9C,OAAO;GACL,WAAW,cAAc,EAAW,MAAM;GAC1C,YAAY;EACd;CACF,CAAC;CAYD,OAVA,QAAgB;EAGd,SAAS,iBAAiB,aAAa,GAAa,EAAE,SAAS,GAAM,CAAC;CACxE,CAAC,GAED,QAAsB;EACpB,SAAS,oBAAoB,aAAa,CAAW;CACvD,CAAC,GAEM;EACL;EACA;EACA,eAAe;GACb,cAAc;GACd,YAAY;GACZ,eAAe;EACjB;CACF;AACF"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import e from "./admins-components6.js";
|
|
2
|
+
import { useSwipeToClose as t } from "./admins-components28.js";
|
|
3
|
+
import { Teleport as n, Transition as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, mergeDefaults as u, normalizeClass as d, normalizeStyle as f, onBeforeUnmount as p, onMounted as m, openBlock as h, ref as g, renderSlot as _, toDisplayString as v, toRef as y, unref as b, withCtx as x, withModifiers as S } from "vue";
|
|
4
|
+
//#region src/components/Sidebar.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var C = { class: "ac-component" }, w = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "sb-header"
|
|
8
|
+
}, T = { class: "sb-title" }, E = { class: "sb-content c-scroll" }, D = {
|
|
9
|
+
open: !1,
|
|
10
|
+
position: "left",
|
|
11
|
+
hasHeader: !0,
|
|
12
|
+
withBackdrop: !0
|
|
13
|
+
}, O = /* @__PURE__ */ l({
|
|
14
|
+
__name: "Sidebar",
|
|
15
|
+
props: /* @__PURE__ */ u({
|
|
16
|
+
open: { type: Boolean },
|
|
17
|
+
position: {},
|
|
18
|
+
title: {},
|
|
19
|
+
hasHeader: { type: Boolean },
|
|
20
|
+
withBackdrop: { type: Boolean }
|
|
21
|
+
}, { ...D }),
|
|
22
|
+
emits: ["close"],
|
|
23
|
+
setup(l, { emit: u }) {
|
|
24
|
+
let D = l, O = u;
|
|
25
|
+
function k() {
|
|
26
|
+
O("close");
|
|
27
|
+
}
|
|
28
|
+
function A() {
|
|
29
|
+
k();
|
|
30
|
+
}
|
|
31
|
+
function j(e) {
|
|
32
|
+
e.key === "Escape" && k();
|
|
33
|
+
}
|
|
34
|
+
let M = g(null), { isDragging: N, panelStyle: P, touchHandlers: F } = t(M, {
|
|
35
|
+
position: y(D, "position"),
|
|
36
|
+
onClose: k,
|
|
37
|
+
closeDirections: "both"
|
|
38
|
+
});
|
|
39
|
+
return m(() => {
|
|
40
|
+
document.addEventListener("keydown", j);
|
|
41
|
+
}), p(() => {
|
|
42
|
+
document.removeEventListener("keydown", j);
|
|
43
|
+
}), (t, u) => (h(), i(n, { to: "body" }, [s("div", C, [c(r, { name: "sb-fade" }, {
|
|
44
|
+
default: x(() => [l.open && l.withBackdrop ? (h(), o("div", {
|
|
45
|
+
key: 0,
|
|
46
|
+
class: "sb-backdrop",
|
|
47
|
+
onClick: S(A, ["self"])
|
|
48
|
+
})) : a("", !0)]),
|
|
49
|
+
_: 1
|
|
50
|
+
}), c(r, { name: `sb-slide-${l.position}` }, {
|
|
51
|
+
default: x(() => [l.open ? (h(), o("div", {
|
|
52
|
+
key: 0,
|
|
53
|
+
ref_key: "panelRef",
|
|
54
|
+
ref: M,
|
|
55
|
+
class: d(["sb-panel", [`sb-panel--${l.position}`, { "sb-panel--dragging": b(N) }]]),
|
|
56
|
+
style: f(b(P)),
|
|
57
|
+
onTouchstart: u[2] ||= (...e) => b(F).onTouchstart && b(F).onTouchstart(...e),
|
|
58
|
+
onTouchend: u[3] ||= (...e) => b(F).onTouchend && b(F).onTouchend(...e),
|
|
59
|
+
onTouchcancel: u[4] ||= (...e) => b(F).onTouchcancel && b(F).onTouchcancel(...e)
|
|
60
|
+
}, [l.hasHeader ? (h(), o("div", w, [s("span", T, v(l.title ?? ""), 1), c(e, {
|
|
61
|
+
class: "sb-close",
|
|
62
|
+
icon: "fa-solid fa-xmark",
|
|
63
|
+
onClick: u[0] ||= (e) => k()
|
|
64
|
+
})])) : (h(), i(e, {
|
|
65
|
+
key: 1,
|
|
66
|
+
class: "sb-close sb-close--absolute",
|
|
67
|
+
icon: "fa-solid fa-xmark",
|
|
68
|
+
onClick: u[1] ||= (e) => k()
|
|
69
|
+
})), s("div", E, [_(t.$slots, "default")])], 38)) : a("", !0)]),
|
|
70
|
+
_: 3
|
|
71
|
+
}, 8, ["name"])])]));
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
//#endregion
|
|
75
|
+
export { O as default, D as sidebarDefaults };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admins-components29.js","names":[],"sources":["../src/components/Sidebar.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type SidebarPosition = 'top' | 'bottom' | 'left' | 'right'\n\nexport interface SidebarProps {\n open?: boolean\n position?: SidebarPosition\n title?: string\n hasHeader?: boolean\n withBackdrop?: boolean\n}\n\nexport const sidebarDefaults = {\n open: false,\n position: 'left' as SidebarPosition,\n hasHeader: true,\n withBackdrop: true,\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { onBeforeUnmount, onMounted, ref, toRef } from 'vue'\nimport Button from '@/components/Button.vue'\nimport { useSwipeToClose } from '@/composables/useSwipeToClose'\n\nconst props = withDefaults(defineProps<SidebarProps>(), {\n ...sidebarDefaults,\n})\n\nconst emit = defineEmits<{\n close: []\n}>()\n\nfunction close() {\n emit('close')\n}\n\nfunction onBackdropClick() {\n close()\n}\n\nfunction onKeydown(e: KeyboardEvent) {\n if (e.key === 'Escape') close()\n}\n\nconst panelRef = ref<HTMLElement | null>(null)\nconst { isDragging, panelStyle, touchHandlers } = useSwipeToClose(panelRef, {\n position: toRef(props, 'position'),\n onClose: close,\n closeDirections: 'both',\n})\n\nonMounted(() => {\n document.addEventListener('keydown', onKeydown)\n})\n\nonBeforeUnmount(() => {\n document.removeEventListener('keydown', onKeydown)\n})\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div class=\"ac-component\">\n <Transition name=\"sb-fade\">\n <div v-if=\"open && withBackdrop\" class=\"sb-backdrop\" @click.self=\"onBackdropClick\"></div>\n </Transition>\n <Transition :name=\"`sb-slide-${position}`\">\n <div\n v-if=\"open\"\n ref=\"panelRef\"\n class=\"sb-panel\"\n :class=\"[`sb-panel--${position}`, { 'sb-panel--dragging': isDragging }]\"\n :style=\"panelStyle\"\n @touchstart=\"touchHandlers.onTouchstart\"\n @touchend=\"touchHandlers.onTouchend\"\n @touchcancel=\"touchHandlers.onTouchcancel\"\n >\n <div v-if=\"hasHeader\" class=\"sb-header\">\n <span class=\"sb-title\">{{ title ?? '' }}</span>\n <Button class=\"sb-close\" icon=\"fa-solid fa-xmark\" @click=\"close()\" />\n </div>\n <Button\n v-else\n class=\"sb-close sb-close--absolute\"\n icon=\"fa-solid fa-xmark\"\n @click=\"close()\"\n />\n <div class=\"sb-content c-scroll\">\n <slot />\n </div>\n </div>\n </Transition>\n </div>\n </Teleport>\n</template>\n\n<style lang=\"scss\" src=\"@/styles/components/sidebar.scss\"></style>\n"],"mappings":";;;;;;;oEAWa,IAAkB;CAC7B,MAAM;CACN,UAAU;CACV,WAAW;CACX,cAAc;AAChB;;;;;;;;;;;EAQA,IAAM,IAAQ,GAIR,IAAO;EAIb,SAAS,IAAQ;GACf,EAAK,OAAO;EACd;EAEA,SAAS,IAAkB;GACzB,EAAM;EACR;EAEA,SAAS,EAAU,GAAkB;GACnC,AAAI,EAAE,QAAQ,YAAU,EAAM;EAChC;EAEA,IAAM,IAAW,EAAwB,IAAI,GACvC,EAAE,eAAY,eAAY,qBAAkB,EAAgB,GAAU;GAC1E,UAAU,EAAM,GAAO,UAAU;GACjC,SAAS;GACT,iBAAiB;EACnB,CAAC;SAED,QAAgB;GACd,SAAS,iBAAiB,WAAW,CAAS;EAChD,CAAC,GAED,QAAsB;GACpB,SAAS,oBAAoB,WAAW,CAAS;EACnD,CAAC,mBAIC,EAgCW,GAAA,EAhCD,IAAG,OAAM,GAAA,CACjB,EA8BM,OA9BN,GA8BM,CA7BJ,EAEa,GAAA,EAFD,MAAK,UAAS,GAAA;oBACiE,CAA9E,EAAA,QAAQ,EAAA,gBAAA,EAAA,GAAnB,EAAyF,OAAA;;IAAxD,OAAM;IAAe,SAAK,EAAO,GAAe,CAAA,MAAA,CAAA;;;MAEnF,EAyBa,GAAA,EAzBA,MAAI,YAAc,EAAA,WAAA,GAAA;oBAwBvB,CAtBE,EAAA,QAAA,EAAA,GADR,EAuBM,OAAA;;aArBA;IAAJ,KAAI;IACJ,OAAK,EAAA,CAAC,YAAU,CAAA,aACM,EAAA,YAAQ,EAAA,sBAA4B,EAAA,CAAA,EAAU,CAAA,CAAA,CAAA;IACnE,OAAK,EAAE,EAAA,CAAA,CAAU;IACjB,cAAU,AAAA,EAAA,QAAA,GAAA,MAAE,EAAA,CAAA,EAAc,gBAAd,EAAA,CAAA,EAAc,aAAY,GAAA,CAAA;IACtC,YAAQ,AAAA,EAAA,QAAA,GAAA,MAAE,EAAA,CAAA,EAAc,cAAd,EAAA,CAAA,EAAc,WAAU,GAAA,CAAA;IAClC,eAAW,AAAA,EAAA,QAAA,GAAA,MAAE,EAAA,CAAA,EAAc,iBAAd,EAAA,CAAA,EAAc,cAAa,GAAA,CAAA;OAE9B,EAAA,aAAA,EAAA,GAAX,EAGM,OAHN,GAGM,CAFJ,EAA+C,QAA/C,GAA+C,EAArB,EAAA,SAAK,EAAA,GAAA,CAAA,GAC/B,EAAqE,GAAA;IAA7D,OAAM;IAAW,MAAK;IAAqB,SAAK,AAAA,EAAA,QAAA,MAAE,EAAK;iBAEjE,EAKE,GAAA;;IAHA,OAAM;IACN,MAAK;IACJ,SAAK,AAAA,EAAA,QAAA,MAAE,EAAK;QAEf,EAEM,OAFN,GAEM,CADJ,EAAQ,EAAA,QAAA,SAAA,CAAA,CAAA,CAAA,GAAA,EAAA,KAAA,EAAA,IAAA,EAAA,CAAA,CAAA"}
|
|
@@ -1,40 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}, m = { class: "c-modal-title" }, h = { class: "c-modal-body c-scroll" }, g = {
|
|
7
|
-
key: 1,
|
|
8
|
-
class: "c-modal-footer"
|
|
9
|
-
}, _ = /* @__PURE__ */ a({
|
|
10
|
-
__name: "Modal",
|
|
11
|
-
props: { title: {} },
|
|
12
|
-
emits: ["close"],
|
|
13
|
-
setup(a, { emit: _ }) {
|
|
14
|
-
let v = _;
|
|
15
|
-
function y(e) {
|
|
16
|
-
e.target === e.currentTarget && v("close");
|
|
17
|
-
}
|
|
18
|
-
function b(e) {
|
|
19
|
-
e.key === "Escape" && v("close");
|
|
20
|
-
}
|
|
21
|
-
return o(() => {
|
|
22
|
-
document.addEventListener("keydown", b);
|
|
23
|
-
}), s(() => {
|
|
24
|
-
document.removeEventListener("keydown", b);
|
|
25
|
-
}), (o, s) => (c(), t(e, { to: "body" }, [i("div", d, [i("div", {
|
|
26
|
-
class: "c-modal-backdrop",
|
|
27
|
-
onMousedown: y
|
|
28
|
-
}, [i("div", f, [
|
|
29
|
-
a.title ? (c(), r("div", p, [i("h3", m, u(a.title), 1), i("button", {
|
|
30
|
-
type: "button",
|
|
31
|
-
class: "c-modal-close",
|
|
32
|
-
onClick: s[0] ||= (e) => v("close")
|
|
33
|
-
}, [...s[1] ||= [i("i", { class: "fa-solid fa-xmark" }, null, -1)]])])) : n("", !0),
|
|
34
|
-
i("div", h, [l(o.$slots, "default")]),
|
|
35
|
-
o.$slots.footer ? (c(), r("div", g, [l(o.$slots, "footer")])) : n("", !0)
|
|
36
|
-
])], 32)])]));
|
|
37
|
-
}
|
|
38
|
-
});
|
|
1
|
+
import './src/styles/components/sidebar.scss_vue_type_style_index_0_src_true_lang.css';
|
|
2
|
+
import e from "./admins-components29.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/components/Sidebar.vue
|
|
5
|
+
var t = e;
|
|
39
6
|
//#endregion
|
|
40
|
-
export {
|
|
7
|
+
export { t as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components31.js","names":[
|
|
1
|
+
{"version":3,"file":"admins-components31.js","names":[],"sources":["../src/components/Sidebar.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type SidebarPosition = 'top' | 'bottom' | 'left' | 'right'\n\nexport interface SidebarProps {\n open?: boolean\n position?: SidebarPosition\n title?: string\n hasHeader?: boolean\n withBackdrop?: boolean\n}\n\nexport const sidebarDefaults = {\n open: false,\n position: 'left' as SidebarPosition,\n hasHeader: true,\n withBackdrop: true,\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { onBeforeUnmount, onMounted, ref, toRef } from 'vue'\nimport Button from '@/components/Button.vue'\nimport { useSwipeToClose } from '@/composables/useSwipeToClose'\n\nconst props = withDefaults(defineProps<SidebarProps>(), {\n ...sidebarDefaults,\n})\n\nconst emit = defineEmits<{\n close: []\n}>()\n\nfunction close() {\n emit('close')\n}\n\nfunction onBackdropClick() {\n close()\n}\n\nfunction onKeydown(e: KeyboardEvent) {\n if (e.key === 'Escape') close()\n}\n\nconst panelRef = ref<HTMLElement | null>(null)\nconst { isDragging, panelStyle, touchHandlers } = useSwipeToClose(panelRef, {\n position: toRef(props, 'position'),\n onClose: close,\n closeDirections: 'both',\n})\n\nonMounted(() => {\n document.addEventListener('keydown', onKeydown)\n})\n\nonBeforeUnmount(() => {\n document.removeEventListener('keydown', onKeydown)\n})\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div class=\"ac-component\">\n <Transition name=\"sb-fade\">\n <div v-if=\"open && withBackdrop\" class=\"sb-backdrop\" @click.self=\"onBackdropClick\"></div>\n </Transition>\n <Transition :name=\"`sb-slide-${position}`\">\n <div\n v-if=\"open\"\n ref=\"panelRef\"\n class=\"sb-panel\"\n :class=\"[`sb-panel--${position}`, { 'sb-panel--dragging': isDragging }]\"\n :style=\"panelStyle\"\n @touchstart=\"touchHandlers.onTouchstart\"\n @touchend=\"touchHandlers.onTouchend\"\n @touchcancel=\"touchHandlers.onTouchcancel\"\n >\n <div v-if=\"hasHeader\" class=\"sb-header\">\n <span class=\"sb-title\">{{ title ?? '' }}</span>\n <Button class=\"sb-close\" icon=\"fa-solid fa-xmark\" @click=\"close()\" />\n </div>\n <Button\n v-else\n class=\"sb-close sb-close--absolute\"\n icon=\"fa-solid fa-xmark\"\n @click=\"close()\"\n />\n <div class=\"sb-content c-scroll\">\n <slot />\n </div>\n </div>\n </Transition>\n </div>\n </Teleport>\n</template>\n\n<style lang=\"scss\" src=\"@/styles/components/sidebar.scss\"></style>\n"],"mappings":""}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import e from "./admins-components6.js";
|
|
2
|
+
import { Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, defineComponent as s, mergeDefaults as c, mergeProps as l, normalizeClass as u, openBlock as d, renderList as f, renderSlot as p, toDisplayString as m } from "vue";
|
|
3
|
+
//#region src/components/HeaderComponent.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var h = { class: "ac-component" }, g = { class: "hc-header" }, _ = { class: "hc-left" }, v = { class: "hc-title-group" }, y = { class: "hc-title" }, b = {
|
|
5
|
+
key: 1,
|
|
6
|
+
class: "hc-slot hc-slot--left"
|
|
7
|
+
}, x = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "hc-slot hc-slot--center"
|
|
10
|
+
}, S = {
|
|
11
|
+
key: 1,
|
|
12
|
+
class: "hc-slot hc-slot--right"
|
|
13
|
+
}, C = {
|
|
14
|
+
icon: void 0,
|
|
15
|
+
showBackButton: !1,
|
|
16
|
+
toolbars: () => []
|
|
17
|
+
}, w = /* @__PURE__ */ s({
|
|
18
|
+
__name: "HeaderComponent",
|
|
19
|
+
props: /* @__PURE__ */ c({
|
|
20
|
+
title: {},
|
|
21
|
+
icon: {},
|
|
22
|
+
showBackButton: { type: Boolean },
|
|
23
|
+
toolbars: {}
|
|
24
|
+
}, { ...C }),
|
|
25
|
+
emits: ["back"],
|
|
26
|
+
setup(s, { emit: c }) {
|
|
27
|
+
let C = s, w = c, T = n(() => {
|
|
28
|
+
let e = {
|
|
29
|
+
left: 0,
|
|
30
|
+
center: 1,
|
|
31
|
+
right: 2
|
|
32
|
+
};
|
|
33
|
+
return [...C.toolbars].sort((t, n) => e[t.align] - e[n.align]);
|
|
34
|
+
});
|
|
35
|
+
return (n, c) => (d(), a("div", h, [o("header", g, [
|
|
36
|
+
o("div", _, [
|
|
37
|
+
s.showBackButton ? (d(), r(e, {
|
|
38
|
+
key: 0,
|
|
39
|
+
class: "hc-back-btn",
|
|
40
|
+
icon: "fa-solid fa-chevron-left",
|
|
41
|
+
"aria-label": "Vissza",
|
|
42
|
+
onClick: c[0] ||= (e) => w("back")
|
|
43
|
+
})) : i("", !0),
|
|
44
|
+
o("div", v, [s.icon ? (d(), a("i", {
|
|
45
|
+
key: 0,
|
|
46
|
+
class: u([s.icon, "hc-title-icon"])
|
|
47
|
+
}, null, 2)) : i("", !0), o("h1", y, m(s.title), 1)]),
|
|
48
|
+
n.$slots.left ? (d(), a("div", b, [p(n.$slots, "left")])) : i("", !0),
|
|
49
|
+
(d(!0), a(t, null, f(T.value.filter((e) => e.align === "left"), (n, i) => (d(), a("div", {
|
|
50
|
+
key: `l-${i}`,
|
|
51
|
+
class: "hc-buttons hc-buttons--left"
|
|
52
|
+
}, [(d(!0), a(t, null, f(n.buttons, (t, n) => (d(), r(e, l({ key: n }, { ref_for: !0 }, t), null, 16))), 128))]))), 128))
|
|
53
|
+
]),
|
|
54
|
+
n.$slots.center || T.value.some((e) => e.align === "center") ? (d(), a("div", x, [p(n.$slots, "center"), (d(!0), a(t, null, f(T.value.filter((e) => e.align === "center"), (n, i) => (d(), a("div", {
|
|
55
|
+
key: `c-${i}`,
|
|
56
|
+
class: "hc-buttons"
|
|
57
|
+
}, [(d(!0), a(t, null, f(n.buttons, (t, n) => (d(), r(e, l({ key: n }, { ref_for: !0 }, t), null, 16))), 128))]))), 128))])) : i("", !0),
|
|
58
|
+
n.$slots.right || T.value.some((e) => e.align === "right") ? (d(), a("div", S, [p(n.$slots, "right"), (d(!0), a(t, null, f(T.value.filter((e) => e.align === "right"), (n, i) => (d(), a("div", {
|
|
59
|
+
key: `r-${i}`,
|
|
60
|
+
class: "hc-buttons"
|
|
61
|
+
}, [(d(!0), a(t, null, f(n.buttons, (t, n) => (d(), r(e, l({ key: n }, { ref_for: !0 }, t), null, 16))), 128))]))), 128))])) : i("", !0)
|
|
62
|
+
])]));
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
//#endregion
|
|
66
|
+
export { w as default, C as headerComponentDefaults };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admins-components32.js","names":["$slots"],"sources":["../src/components/HeaderComponent.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { ButtonProps } from '@/components/Button.vue'\nimport type { HorizontalAlignment } from '@/types/types'\n\nexport interface HeaderToolbar {\n align: HorizontalAlignment\n buttons: ButtonProps[]\n}\n\nexport interface HeaderComponentProps {\n title: string\n icon?: string\n showBackButton?: boolean\n toolbars?: HeaderToolbar[]\n}\n\nexport const headerComponentDefaults = {\n icon: undefined,\n showBackButton: false,\n toolbars: () => [],\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport Button from '@/components/Button.vue'\n\nconst props = withDefaults(defineProps<HeaderComponentProps>(), {\n ...headerComponentDefaults,\n})\n\nconst emit = defineEmits<{ back: [] }>()\n\nconst sortedToolbars = computed(() => {\n const order: Record<HorizontalAlignment, number> = { left: 0, center: 1, right: 2 }\n return [...props.toolbars].sort((a, b) => order[a.align] - order[b.align])\n})\n</script>\n\n<template>\n <div class=\"ac-component\">\n <header class=\"hc-header\">\n <div class=\"hc-left\">\n <Button\n v-if=\"showBackButton\"\n class=\"hc-back-btn\"\n icon=\"fa-solid fa-chevron-left\"\n aria-label=\"Vissza\"\n @click=\"emit('back')\"\n />\n\n <div class=\"hc-title-group\">\n <i v-if=\"icon\" :class=\"icon\" class=\"hc-title-icon\"></i>\n <h1 class=\"hc-title\">{{ title }}</h1>\n </div>\n\n <div v-if=\"$slots.left\" class=\"hc-slot hc-slot--left\">\n <slot name=\"left\" />\n </div>\n\n <div\n v-for=\"(toolbar, ti) in sortedToolbars.filter((t) => t.align === 'left')\"\n :key=\"`l-${ti}`\"\n class=\"hc-buttons hc-buttons--left\"\n >\n <Button v-for=\"(btn, i) in toolbar.buttons\" :key=\"i\" v-bind=\"btn\" />\n </div>\n </div>\n\n <div\n v-if=\"$slots.center || sortedToolbars.some((t) => t.align === 'center')\"\n class=\"hc-slot hc-slot--center\"\n >\n <slot name=\"center\" />\n <div\n v-for=\"(toolbar, ti) in sortedToolbars.filter((t) => t.align === 'center')\"\n :key=\"`c-${ti}`\"\n class=\"hc-buttons\"\n >\n <Button v-for=\"(btn, i) in toolbar.buttons\" :key=\"i\" v-bind=\"btn\" />\n </div>\n </div>\n\n <div\n v-if=\"$slots.right || sortedToolbars.some((t) => t.align === 'right')\"\n class=\"hc-slot hc-slot--right\"\n >\n <slot name=\"right\" />\n <div\n v-for=\"(toolbar, ti) in sortedToolbars.filter((t) => t.align === 'right')\"\n :key=\"`r-${ti}`\"\n class=\"hc-buttons\"\n >\n <Button v-for=\"(btn, i) in toolbar.buttons\" :key=\"i\" v-bind=\"btn\" />\n </div>\n </div>\n </header>\n </div>\n</template>\n<style lang=\"scss\" src=\"@/styles/components/header.scss\"></style>\n"],"mappings":";;;;;;;;;;;;GAgBa,IAA0B;CACrC,MAAM,KAAA;CACN,gBAAgB;CAChB,gBAAgB,CAAC;AACnB;;;;;;;;;;EAOA,IAAM,IAAQ,GAIR,IAAO,GAEP,IAAiB,QAAe;GACpC,IAAM,IAA6C;IAAE,MAAM;IAAG,QAAQ;IAAG,OAAO;GAAE;GAClF,OAAO,CAAC,GAAG,EAAM,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAM,EAAE,SAAS,EAAM,EAAE,MAAM;EAC3E,CAAC;yBAIC,EAyDM,OAzDN,GAyDM,CAxDJ,EAuDS,UAvDT,GAuDS;GAtDP,EAyBM,OAzBN,GAyBM;IAvBI,EAAA,kBAAA,EAAA,GADR,EAME,GAAA;;KAJA,OAAM;KACN,MAAK;KACL,cAAW;KACV,SAAK,AAAA,EAAA,QAAA,MAAE,EAAI,MAAA;;IAGd,EAGM,OAHN,GAGM,CAFK,EAAA,QAAA,EAAA,GAAT,EAAuD,KAAA;;KAAvC,OAAK,EAAA,CAAE,EAAA,MAAY,eAAe,CAAA;8BAClD,EAAqC,MAArC,GAAqC,EAAb,EAAA,KAAK,GAAA,CAAA,CAAA,CAAA;IAGpBA,EAAAA,OAAO,QAAA,EAAA,GAAlB,EAEM,OAFN,GAEM,CADJ,EAAoB,EAAA,QAAA,MAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA;YAGtB,EAMM,GAAA,MAAA,EALoB,EAAA,MAAe,QAAQ,MAAM,EAAE,UAAK,MAAA,IAApD,GAAS,YADnB,EAMM,OAAA;KAJH,KAAG,KAAO;KACX,OAAM;gBAEN,EAAoE,GAAA,MAAA,EAAzC,EAAQ,UAAnB,GAAK,YAArB,EAAoE,GAApE,EAAoE,EAAvB,KAAK,EAAC,GAAA,EAAA,SAAA,GAAA,GAAU,CAAG,GAAA,MAAA,EAAA;;GAK5DA,EAAAA,OAAO,UAAU,EAAA,MAAe,MAAM,MAAM,EAAE,UAAK,QAAA,KAAA,EAAA,GAD3D,EAYM,OAZN,GAYM,CARJ,EAAsB,EAAA,QAAA,QAAA,IAAA,EAAA,EAAA,GACtB,EAMM,GAAA,MAAA,EALoB,EAAA,MAAe,QAAQ,MAAM,EAAE,UAAK,QAAA,IAApD,GAAS,YADnB,EAMM,OAAA;IAJH,KAAG,KAAO;IACX,OAAM;eAEN,EAAoE,GAAA,MAAA,EAAzC,EAAQ,UAAnB,GAAK,YAArB,EAAoE,GAApE,EAAoE,EAAvB,KAAK,EAAC,GAAA,EAAA,SAAA,GAAA,GAAU,CAAG,GAAA,MAAA,EAAA;GAK5DA,EAAAA,OAAO,SAAS,EAAA,MAAe,MAAM,MAAM,EAAE,UAAK,OAAA,KAAA,EAAA,GAD1D,EAYM,OAZN,GAYM,CARJ,EAAqB,EAAA,QAAA,OAAA,IAAA,EAAA,EAAA,GACrB,EAMM,GAAA,MAAA,EALoB,EAAA,MAAe,QAAQ,MAAM,EAAE,UAAK,OAAA,IAApD,GAAS,YADnB,EAMM,OAAA;IAJH,KAAG,KAAO;IACX,OAAM;eAEN,EAAoE,GAAA,MAAA,EAAzC,EAAQ,UAAnB,GAAK,YAArB,EAAoE,GAApE,EAAoE,EAAvB,KAAK,EAAC,GAAA,EAAA,SAAA,GAAA,GAAU,CAAG,GAAA,MAAA,EAAA"}
|
|
@@ -1,37 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
//#region src/components/
|
|
5
|
-
var
|
|
6
|
-
__name: "ConfirmModal",
|
|
7
|
-
props: {
|
|
8
|
-
title: {},
|
|
9
|
-
message: {},
|
|
10
|
-
confirmLabel: { default: "Confirm" },
|
|
11
|
-
cancelLabel: { default: "Cancel" },
|
|
12
|
-
type: { default: "normal" }
|
|
13
|
-
},
|
|
14
|
-
emits: ["confirm", "cancel"],
|
|
15
|
-
setup(a, { emit: u }) {
|
|
16
|
-
let d = u;
|
|
17
|
-
return (u, f) => (o(), n(t, {
|
|
18
|
-
title: a.title,
|
|
19
|
-
onClose: f[2] ||= (e) => d("cancel")
|
|
20
|
-
}, {
|
|
21
|
-
footer: c(() => [i(e, {
|
|
22
|
-
label: a.cancelLabel,
|
|
23
|
-
type: "normal",
|
|
24
|
-
outline: "",
|
|
25
|
-
onClick: f[0] ||= (e) => d("cancel")
|
|
26
|
-
}, null, 8, ["label"]), i(e, {
|
|
27
|
-
label: a.confirmLabel,
|
|
28
|
-
type: a.type,
|
|
29
|
-
onClick: f[1] ||= (e) => d("confirm")
|
|
30
|
-
}, null, 8, ["label", "type"])]),
|
|
31
|
-
default: c(() => [r("p", l, s(a.message), 1)]),
|
|
32
|
-
_: 1
|
|
33
|
-
}, 8, ["title"]));
|
|
34
|
-
}
|
|
35
|
-
});
|
|
1
|
+
import './src/styles/components/header.scss_vue_type_style_index_0_src_true_lang.css';
|
|
2
|
+
import e from "./admins-components32.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/components/HeaderComponent.vue
|
|
5
|
+
var t = e;
|
|
36
6
|
//#endregion
|
|
37
|
-
export {
|
|
7
|
+
export { t as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components34.js","names":[],"sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"admins-components34.js","names":[],"sources":["../src/components/HeaderComponent.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { ButtonProps } from '@/components/Button.vue'\nimport type { HorizontalAlignment } from '@/types/types'\n\nexport interface HeaderToolbar {\n align: HorizontalAlignment\n buttons: ButtonProps[]\n}\n\nexport interface HeaderComponentProps {\n title: string\n icon?: string\n showBackButton?: boolean\n toolbars?: HeaderToolbar[]\n}\n\nexport const headerComponentDefaults = {\n icon: undefined,\n showBackButton: false,\n toolbars: () => [],\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport Button from '@/components/Button.vue'\n\nconst props = withDefaults(defineProps<HeaderComponentProps>(), {\n ...headerComponentDefaults,\n})\n\nconst emit = defineEmits<{ back: [] }>()\n\nconst sortedToolbars = computed(() => {\n const order: Record<HorizontalAlignment, number> = { left: 0, center: 1, right: 2 }\n return [...props.toolbars].sort((a, b) => order[a.align] - order[b.align])\n})\n</script>\n\n<template>\n <div class=\"ac-component\">\n <header class=\"hc-header\">\n <div class=\"hc-left\">\n <Button\n v-if=\"showBackButton\"\n class=\"hc-back-btn\"\n icon=\"fa-solid fa-chevron-left\"\n aria-label=\"Vissza\"\n @click=\"emit('back')\"\n />\n\n <div class=\"hc-title-group\">\n <i v-if=\"icon\" :class=\"icon\" class=\"hc-title-icon\"></i>\n <h1 class=\"hc-title\">{{ title }}</h1>\n </div>\n\n <div v-if=\"$slots.left\" class=\"hc-slot hc-slot--left\">\n <slot name=\"left\" />\n </div>\n\n <div\n v-for=\"(toolbar, ti) in sortedToolbars.filter((t) => t.align === 'left')\"\n :key=\"`l-${ti}`\"\n class=\"hc-buttons hc-buttons--left\"\n >\n <Button v-for=\"(btn, i) in toolbar.buttons\" :key=\"i\" v-bind=\"btn\" />\n </div>\n </div>\n\n <div\n v-if=\"$slots.center || sortedToolbars.some((t) => t.align === 'center')\"\n class=\"hc-slot hc-slot--center\"\n >\n <slot name=\"center\" />\n <div\n v-for=\"(toolbar, ti) in sortedToolbars.filter((t) => t.align === 'center')\"\n :key=\"`c-${ti}`\"\n class=\"hc-buttons\"\n >\n <Button v-for=\"(btn, i) in toolbar.buttons\" :key=\"i\" v-bind=\"btn\" />\n </div>\n </div>\n\n <div\n v-if=\"$slots.right || sortedToolbars.some((t) => t.align === 'right')\"\n class=\"hc-slot hc-slot--right\"\n >\n <slot name=\"right\" />\n <div\n v-for=\"(toolbar, ti) in sortedToolbars.filter((t) => t.align === 'right')\"\n :key=\"`r-${ti}`\"\n class=\"hc-buttons\"\n >\n <Button v-for=\"(btn, i) in toolbar.buttons\" :key=\"i\" v-bind=\"btn\" />\n </div>\n </div>\n </header>\n </div>\n</template>\n<style lang=\"scss\" src=\"@/styles/components/header.scss\"></style>\n"],"mappings":""}
|
|
@@ -1,5 +1,40 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
//#region src/components/
|
|
3
|
-
var
|
|
1
|
+
import { Teleport as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, onMounted as o, onUnmounted as s, openBlock as c, renderSlot as l, toDisplayString as u } from "vue";
|
|
2
|
+
//#region src/components/Modal.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var d = { class: "ac-component" }, f = { class: "c-modal" }, p = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "c-modal-header"
|
|
6
|
+
}, m = { class: "c-modal-title" }, h = { class: "c-modal-body c-scroll" }, g = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "c-modal-footer"
|
|
9
|
+
}, _ = /* @__PURE__ */ a({
|
|
10
|
+
__name: "Modal",
|
|
11
|
+
props: { title: {} },
|
|
12
|
+
emits: ["close"],
|
|
13
|
+
setup(a, { emit: _ }) {
|
|
14
|
+
let v = _;
|
|
15
|
+
function y(e) {
|
|
16
|
+
e.target === e.currentTarget && v("close");
|
|
17
|
+
}
|
|
18
|
+
function b(e) {
|
|
19
|
+
e.key === "Escape" && v("close");
|
|
20
|
+
}
|
|
21
|
+
return o(() => {
|
|
22
|
+
document.addEventListener("keydown", b);
|
|
23
|
+
}), s(() => {
|
|
24
|
+
document.removeEventListener("keydown", b);
|
|
25
|
+
}), (o, s) => (c(), t(e, { to: "body" }, [i("div", d, [i("div", {
|
|
26
|
+
class: "c-modal-backdrop",
|
|
27
|
+
onMousedown: y
|
|
28
|
+
}, [i("div", f, [
|
|
29
|
+
a.title ? (c(), r("div", p, [i("h3", m, u(a.title), 1), i("button", {
|
|
30
|
+
type: "button",
|
|
31
|
+
class: "c-modal-close",
|
|
32
|
+
onClick: s[0] ||= (e) => v("close")
|
|
33
|
+
}, [...s[1] ||= [i("i", { class: "fa-solid fa-xmark" }, null, -1)]])])) : n("", !0),
|
|
34
|
+
i("div", h, [l(o.$slots, "default")]),
|
|
35
|
+
o.$slots.footer ? (c(), r("div", g, [l(o.$slots, "footer")])) : n("", !0)
|
|
36
|
+
])], 32)])]));
|
|
37
|
+
}
|
|
38
|
+
});
|
|
4
39
|
//#endregion
|
|
5
|
-
export {
|
|
40
|
+
export { _ as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components35.js","names":[],"sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"admins-components35.js","names":["$slots"],"sources":["../src/components/Modal.vue"],"sourcesContent":["<script lang=\"ts\">\nexport interface ModalProps {\n title?: string\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { onMounted, onUnmounted } from 'vue'\n\ndefineProps<ModalProps>()\n\nconst emit = defineEmits<{\n close: []\n}>()\n\nfunction onBackdropClick(e: MouseEvent) {\n if (e.target === e.currentTarget) {\n emit('close')\n }\n}\n\nfunction onKeydown(e: KeyboardEvent) {\n if (e.key === 'Escape') {\n emit('close')\n }\n}\n\nonMounted(() => {\n document.addEventListener('keydown', onKeydown)\n})\n\nonUnmounted(() => {\n document.removeEventListener('keydown', onKeydown)\n})\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div class=\"ac-component\">\n <div class=\"c-modal-backdrop\" @mousedown=\"onBackdropClick\">\n <div class=\"c-modal\">\n <div class=\"c-modal-header\" v-if=\"title\">\n <h3 class=\"c-modal-title\">{{ title }}</h3>\n <button type=\"button\" class=\"c-modal-close\" @click=\"emit('close')\">\n <i class=\"fa-solid fa-xmark\"></i>\n </button>\n </div>\n <div class=\"c-modal-body c-scroll\">\n <slot />\n </div>\n <div v-if=\"$slots.footer\" class=\"c-modal-footer\">\n <slot name=\"footer\" />\n </div>\n </div>\n </div>\n </div>\n </Teleport>\n</template>\n\n<style lang=\"scss\" src=\"@/styles/components/modal.scss\"></style>\n"],"mappings":";;;;;;;;;;;;;EAWA,IAAM,IAAO;EAIb,SAAS,EAAgB,GAAe;GACtC,AAAI,EAAE,WAAW,EAAE,iBACjB,EAAK,OAAO;EAEhB;EAEA,SAAS,EAAU,GAAkB;GACnC,AAAI,EAAE,QAAQ,YACZ,EAAK,OAAO;EAEhB;SAEA,QAAgB;GACd,SAAS,iBAAiB,WAAW,CAAS;EAChD,CAAC,GAED,QAAkB;GAChB,SAAS,oBAAoB,WAAW,CAAS;EACnD,CAAC,mBAIC,EAmBW,GAAA,EAnBD,IAAG,OAAM,GAAA,CACjB,EAiBM,OAjBN,GAiBM,CAhBJ,EAeM,OAAA;GAfD,OAAM;GAAoB,aAAW;MACxC,EAaM,OAbN,GAaM;GAZ8B,EAAA,SAAA,EAAA,GAAlC,EAKM,OALN,GAKM,CAJJ,EAA0C,MAA1C,GAA0C,EAAb,EAAA,KAAK,GAAA,CAAA,GAClC,EAES,UAAA;IAFD,MAAK;IAAS,OAAM;IAAiB,SAAK,AAAA,EAAA,QAAA,MAAE,EAAI,OAAA;oBACtD,EAAiC,KAAA,EAA9B,OAAM,oBAAmB,GAAA,MAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA;GAGhC,EAEM,OAFN,GAEM,CADJ,EAAQ,EAAA,QAAA,SAAA,CAAA,CAAA;GAECA,EAAAA,OAAO,UAAA,EAAA,GAAlB,EAEM,OAFN,GAEM,CADJ,EAAsB,EAAA,QAAA,QAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-
|
|
1
|
+
{"version":3,"file":"admins-components37.js","names":[],"sources":["../src/components/Modal.vue"],"sourcesContent":["<script lang=\"ts\">\nexport interface ModalProps {\n title?: string\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { onMounted, onUnmounted } from 'vue'\n\ndefineProps<ModalProps>()\n\nconst emit = defineEmits<{\n close: []\n}>()\n\nfunction onBackdropClick(e: MouseEvent) {\n if (e.target === e.currentTarget) {\n emit('close')\n }\n}\n\nfunction onKeydown(e: KeyboardEvent) {\n if (e.key === 'Escape') {\n emit('close')\n }\n}\n\nonMounted(() => {\n document.addEventListener('keydown', onKeydown)\n})\n\nonUnmounted(() => {\n document.removeEventListener('keydown', onKeydown)\n})\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div class=\"ac-component\">\n <div class=\"c-modal-backdrop\" @mousedown=\"onBackdropClick\">\n <div class=\"c-modal\">\n <div class=\"c-modal-header\" v-if=\"title\">\n <h3 class=\"c-modal-title\">{{ title }}</h3>\n <button type=\"button\" class=\"c-modal-close\" @click=\"emit('close')\">\n <i class=\"fa-solid fa-xmark\"></i>\n </button>\n </div>\n <div class=\"c-modal-body c-scroll\">\n <slot />\n </div>\n <div v-if=\"$slots.footer\" class=\"c-modal-footer\">\n <slot name=\"footer\" />\n </div>\n </div>\n </div>\n </div>\n </Teleport>\n</template>\n\n<style lang=\"scss\" src=\"@/styles/components/modal.scss\"></style>\n"],"mappings":""}
|
|
@@ -1,7 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
//#region src/components/
|
|
5
|
-
var
|
|
1
|
+
import e from "./admins-components6.js";
|
|
2
|
+
import t from "./admins-components37.js";
|
|
3
|
+
import { createBlock as n, createElementVNode as r, createVNode as i, defineComponent as a, openBlock as o, toDisplayString as s, withCtx as c } from "vue";
|
|
4
|
+
//#region src/components/ConfirmModal.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var l = { class: "c-confirm-modal-message" }, u = /* @__PURE__ */ a({
|
|
6
|
+
__name: "ConfirmModal",
|
|
7
|
+
props: {
|
|
8
|
+
title: {},
|
|
9
|
+
message: {},
|
|
10
|
+
confirmLabel: { default: "Confirm" },
|
|
11
|
+
cancelLabel: { default: "Cancel" },
|
|
12
|
+
type: { default: "normal" }
|
|
13
|
+
},
|
|
14
|
+
emits: ["confirm", "cancel"],
|
|
15
|
+
setup(a, { emit: u }) {
|
|
16
|
+
let d = u;
|
|
17
|
+
return (u, f) => (o(), n(t, {
|
|
18
|
+
title: a.title,
|
|
19
|
+
onClose: f[2] ||= (e) => d("cancel")
|
|
20
|
+
}, {
|
|
21
|
+
footer: c(() => [i(e, {
|
|
22
|
+
label: a.cancelLabel,
|
|
23
|
+
type: "normal",
|
|
24
|
+
outline: "",
|
|
25
|
+
onClick: f[0] ||= (e) => d("cancel")
|
|
26
|
+
}, null, 8, ["label"]), i(e, {
|
|
27
|
+
label: a.confirmLabel,
|
|
28
|
+
type: a.type,
|
|
29
|
+
onClick: f[1] ||= (e) => d("confirm")
|
|
30
|
+
}, null, 8, ["label", "type"])]),
|
|
31
|
+
default: c(() => [r("p", l, s(a.message), 1)]),
|
|
32
|
+
_: 1
|
|
33
|
+
}, 8, ["title"]));
|
|
34
|
+
}
|
|
35
|
+
});
|
|
6
36
|
//#endregion
|
|
7
|
-
export {
|
|
37
|
+
export { u as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components38.js","names":[],"sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"admins-components38.js","names":[],"sources":["../src/components/ConfirmModal.vue"],"sourcesContent":["<script lang=\"ts\">\nexport interface ConfirmModalProps {\n title: string\n message: string\n confirmLabel?: string\n cancelLabel?: string\n type?: ButtonType\n}\n</script>\n\n<script setup lang=\"ts\">\nimport Modal from '@/components/Modal.vue'\nimport Button, { type ButtonType } from '@/components/Button.vue'\n\nwithDefaults(defineProps<ConfirmModalProps>(), {\n confirmLabel: 'Confirm',\n cancelLabel: 'Cancel',\n type: 'normal',\n})\n\nconst emit = defineEmits<{\n confirm: []\n cancel: []\n}>()\n</script>\n\n<template>\n <Modal :title=\"title\" @close=\"emit('cancel')\">\n <p class=\"c-confirm-modal-message\">{{ message }}</p>\n <template #footer>\n <Button :label=\"cancelLabel\" type=\"normal\" outline @click=\"emit('cancel')\" />\n <Button :label=\"confirmLabel\" :type=\"type\" @click=\"emit('confirm')\" />\n </template>\n </Modal>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;EAoBA,IAAM,IAAO;yBAOX,EAMQ,GAAA;GANA,OAAO,EAAA;GAAQ,SAAK,AAAA,EAAA,QAAA,MAAE,EAAI,QAAA;;GAErB,QAAM,QAC8D,CAA7E,EAA6E,GAAA;IAApE,OAAO,EAAA;IAAa,MAAK;IAAS,SAAA;IAAS,SAAK,AAAA,EAAA,QAAA,MAAE,EAAI,QAAA;2BAC/D,EAAsE,GAAA;IAA7D,OAAO,EAAA;IAAe,MAAM,EAAA;IAAO,SAAK,AAAA,EAAA,QAAA,MAAE,EAAI,SAAA;;oBAHL,CAApD,EAAoD,KAApD,GAAoD,EAAd,EAAA,OAAO,GAAA,CAAA,CAAA,CAAA"}
|