adverich-kun-ui 0.1.136 → 0.1.137
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.
|
@@ -1,58 +1,59 @@
|
|
|
1
|
-
import { toRefs as
|
|
2
|
-
import
|
|
3
|
-
import me from "./
|
|
4
|
-
import ue from "./
|
|
5
|
-
import fe from "
|
|
6
|
-
import ge from "
|
|
7
|
-
import he from "
|
|
8
|
-
import ye from "
|
|
9
|
-
import be from "../composables/
|
|
10
|
-
import ve from "../composables/
|
|
11
|
-
import Ce from "../composables/
|
|
12
|
-
import we from "../composables/
|
|
13
|
-
|
|
1
|
+
import { toRefs as le, ref as oe, watch as ae, computed as B, createElementBlock as a, openBlock as l, mergeProps as b, createCommentVNode as c, createElementVNode as V, renderSlot as i, createBlock as v, unref as s, normalizeClass as j, withDirectives as re, vModelText as ie, normalizeProps as n, guardReactiveProps as u, Fragment as x, createVNode as C, createSlots as ne, renderList as de, withCtx as pe, isRef as ce } from "vue";
|
|
2
|
+
import { isMobile as z } from "../../../../utils/_platform.js";
|
|
3
|
+
import me from "./KunTableHeaders.vue.js";
|
|
4
|
+
import ue from "./KunTableFooter.vue.js";
|
|
5
|
+
import fe from "./KunTableRows.vue.js";
|
|
6
|
+
import ge from "../../../KunBtn/src/components/KunBtn.vue.js";
|
|
7
|
+
import he from "./KunTableFilter.vue.js";
|
|
8
|
+
import ye from "../../../KunCard/src/components/KunCard.vue.js";
|
|
9
|
+
import be from "../composables/useExpand.js";
|
|
10
|
+
import ve from "../composables/useOptions.js";
|
|
11
|
+
import Ce from "../composables/useSelect.js";
|
|
12
|
+
import we from "../composables/useFilter.js";
|
|
13
|
+
import ke from "../composables/KunTableProps.js";
|
|
14
|
+
const Pe = ["placeholder"], Se = { key: 0 }, $e = { key: 5 }, Fe = ["colspan"], Te = { key: 6 }, Ae = {
|
|
14
15
|
key: 1,
|
|
15
16
|
class: "sticky bottom-0 z-10"
|
|
16
|
-
},
|
|
17
|
+
}, Ee = "overflow-auto h-full w-full flex flex-col border border-slate-200 dark:border-slate-800 rounded", Be = "table-auto w-full h-full text-sm text-left", He = {
|
|
17
18
|
__name: "KunTable",
|
|
18
|
-
props:
|
|
19
|
+
props: ke(),
|
|
19
20
|
emits: ["update:page", "update:itemsPerPage", "update:sortBy", "update:selectedItems"],
|
|
20
|
-
setup(
|
|
21
|
-
const w =
|
|
22
|
-
headers:
|
|
21
|
+
setup(N, { emit: R }) {
|
|
22
|
+
const w = R, d = N, f = le(d), {
|
|
23
|
+
headers: h,
|
|
23
24
|
showExpand: k,
|
|
24
25
|
showSelect: P,
|
|
25
|
-
rowClass:
|
|
26
|
-
hideDefaultFooter:
|
|
27
|
-
hideDefaultHeader:
|
|
28
|
-
tableClass:
|
|
29
|
-
wrapperClass:
|
|
30
|
-
pageOptions:
|
|
31
|
-
items:
|
|
26
|
+
rowClass: U,
|
|
27
|
+
hideDefaultFooter: D,
|
|
28
|
+
hideDefaultHeader: I,
|
|
29
|
+
tableClass: L,
|
|
30
|
+
wrapperClass: M,
|
|
31
|
+
pageOptions: O,
|
|
32
|
+
items: W,
|
|
32
33
|
searchable: S,
|
|
33
|
-
debounceTime:
|
|
34
|
-
} = f,
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
debounceTime: H
|
|
35
|
+
} = f, y = oe(""), { filteredItems: K, setSearch: Q, modalFilter: m, applyColumnFilters: q, clearFilters: G, appliedFilters: J } = we(f, H);
|
|
36
|
+
ae(y, (e) => {
|
|
37
|
+
Q(e);
|
|
37
38
|
});
|
|
38
|
-
const { options:
|
|
39
|
-
items:
|
|
40
|
-
headers:
|
|
41
|
-
page:
|
|
42
|
-
itemsPerPage:
|
|
39
|
+
const { options: r, paginatedItems: g, updateSort: X } = ve(f, w, K), { isSelected: $, toggleSelect: F, toggleSelectAll: Y, allSelected: Z } = Ce(f, w), { isExpanded: T, toggleExpand: A } = be(), p = B(() => ({
|
|
40
|
+
items: g.value,
|
|
41
|
+
headers: h.value,
|
|
42
|
+
page: r.page,
|
|
43
|
+
itemsPerPage: r.itemsPerPage,
|
|
43
44
|
toggleSelect: F,
|
|
44
45
|
isSelected: $,
|
|
45
46
|
toggleExpand: A,
|
|
46
47
|
isExpanded: T,
|
|
47
|
-
sortBy:
|
|
48
|
+
sortBy: r.sortBy,
|
|
48
49
|
hasActions: d.hasActions
|
|
49
|
-
})),
|
|
50
|
+
})), _ = [Ee, M.value], ee = [Be, L.value], se = B(() => {
|
|
50
51
|
var t;
|
|
51
52
|
let e = ((t = d.headers) == null ? void 0 : t.length) || 0;
|
|
52
53
|
return d.showSelect && (e += 1), d.showExpand && (e += 1), d.hasActions && (e += 1), e;
|
|
53
54
|
});
|
|
54
|
-
return (e, t) => (l(),
|
|
55
|
-
s(S) || e.filterable ? (l(),
|
|
55
|
+
return (e, t) => (l(), a("div", b({ class: _ }, e.$attrs, { style: { "user-select": "text" } }), [
|
|
56
|
+
s(S) || e.filterable ? (l(), a("div", {
|
|
56
57
|
key: 0,
|
|
57
58
|
class: j(["py-2 px-4 bg-slate-200 dark:bg-slate-800", {
|
|
58
59
|
"justify-start flex": e.searchPosition === "start",
|
|
@@ -60,106 +61,106 @@ const ke = ["placeholder"], Pe = { key: 0 }, Se = { key: 4 }, $e = ["colspan"],
|
|
|
60
61
|
"justify-end flex": e.searchPosition === "end"
|
|
61
62
|
}])
|
|
62
63
|
}, [
|
|
63
|
-
e.filterable ? (l(), v(
|
|
64
|
+
e.filterable ? (l(), v(ge, {
|
|
64
65
|
key: 0,
|
|
65
66
|
onClick: t[0] || (t[0] = (o) => m.value = !0),
|
|
66
67
|
text: "Filtrar",
|
|
67
68
|
bgColor: "bg-slate-300 dark:bg-slate-700"
|
|
68
69
|
})) : c("", !0),
|
|
69
|
-
s(S) ?
|
|
70
|
+
s(S) ? re((l(), a("input", {
|
|
70
71
|
key: 1,
|
|
71
|
-
"onUpdate:modelValue": t[1] || (t[1] = (o) =>
|
|
72
|
+
"onUpdate:modelValue": t[1] || (t[1] = (o) => y.value = o),
|
|
72
73
|
type: "text",
|
|
73
74
|
placeholder: e.searchPlaceholder,
|
|
74
75
|
class: "border mx-2 px-3 py-1 rounded w-full max-w-sm text-sm"
|
|
75
|
-
}, null, 8,
|
|
76
|
-
[
|
|
76
|
+
}, null, 8, Pe)), [
|
|
77
|
+
[ie, y.value]
|
|
77
78
|
]) : c("", !0)
|
|
78
79
|
], 2)) : c("", !0),
|
|
79
80
|
V("table", {
|
|
80
|
-
class: j(
|
|
81
|
+
class: j(ee)
|
|
81
82
|
}, [
|
|
82
|
-
e.$slots.colgroup ? (l(),
|
|
83
|
-
|
|
83
|
+
e.$slots.colgroup ? (l(), a("colgroup", Se, [
|
|
84
|
+
i(e.$slots, "colgroup", n(u(p.value)))
|
|
84
85
|
])) : c("", !0),
|
|
85
|
-
s(
|
|
86
|
+
s(I) ? i(e.$slots, "thead", n(b({ key: 2 }, p.value))) : (l(), v(me, {
|
|
86
87
|
key: 1,
|
|
87
|
-
headers: s(
|
|
88
|
-
"sort-by": s(
|
|
88
|
+
headers: s(h),
|
|
89
|
+
"sort-by": s(r).sortBy,
|
|
89
90
|
"show-select": s(P),
|
|
90
91
|
"show-expand": s(k),
|
|
91
|
-
"all-selected": s(
|
|
92
|
+
"all-selected": s(Z),
|
|
92
93
|
"thead-class": e.theadClass,
|
|
93
94
|
"tr-class": e.trClass,
|
|
94
95
|
"th-class": e.thClass,
|
|
95
96
|
"has-actions": e.hasActions,
|
|
96
97
|
"action-label": e.actionLabel,
|
|
97
|
-
onSort: s(
|
|
98
|
-
onToggleSelectAll: s(
|
|
98
|
+
onSort: s(X),
|
|
99
|
+
onToggleSelectAll: s(Y)
|
|
99
100
|
}, null, 8, ["headers", "sort-by", "show-select", "show-expand", "all-selected", "thead-class", "tr-class", "th-class", "has-actions", "action-label", "onSort", "onToggleSelectAll"])),
|
|
100
|
-
s(
|
|
101
|
-
|
|
102
|
-
C(
|
|
103
|
-
items: s(
|
|
101
|
+
s(g).length && !s(z) ? (l(), a(x, { key: 3 }, [
|
|
102
|
+
i(e.$slots, "body.prepend", n(u(p.value))),
|
|
103
|
+
C(fe, {
|
|
104
|
+
items: s(g),
|
|
104
105
|
"is-selected": s($),
|
|
105
106
|
"is-expanded": s(T),
|
|
106
107
|
"tbody-class": e.tbodyClass,
|
|
107
|
-
"row-class": s(
|
|
108
|
+
"row-class": s(U),
|
|
108
109
|
"tr-class": e.trClass,
|
|
109
110
|
"td-class": e.tdClass,
|
|
110
111
|
"selected-class": e.selectedClass,
|
|
111
112
|
"striped-class": e.stripedClass,
|
|
112
113
|
"show-select": s(P),
|
|
113
114
|
"show-expand": s(k),
|
|
114
|
-
headers: s(
|
|
115
|
+
headers: s(h),
|
|
115
116
|
"has-actions": e.hasActions,
|
|
116
117
|
"action-loading-map": e.actionLoadingMap,
|
|
117
118
|
onToggleExpand: s(A),
|
|
118
119
|
onToggleSelect: s(F)
|
|
119
120
|
}, ne({ _: 2 }, [
|
|
120
|
-
|
|
121
|
+
de(e.$slots, (o, E) => ({
|
|
121
122
|
name: E,
|
|
122
|
-
fn:
|
|
123
|
-
|
|
123
|
+
fn: pe((te) => [
|
|
124
|
+
i(e.$slots, E, n(u(te)))
|
|
124
125
|
])
|
|
125
126
|
}))
|
|
126
127
|
]), 1032, ["items", "is-selected", "is-expanded", "tbody-class", "row-class", "tr-class", "td-class", "selected-class", "striped-class", "show-select", "show-expand", "headers", "has-actions", "action-loading-map", "onToggleExpand", "onToggleSelect"]),
|
|
127
|
-
|
|
128
|
-
], 64)) : (l(),
|
|
129
|
-
V("td", { colspan:
|
|
130
|
-
C(
|
|
128
|
+
i(e.$slots, "body.append", n(u(p.value)))
|
|
129
|
+
], 64)) : s(g).length && s(z) ? (l(), a(x, { key: 4 }, [], 64)) : (l(), a("tr", $e, [
|
|
130
|
+
V("td", { colspan: se.value }, [
|
|
131
|
+
C(ye, {
|
|
131
132
|
class: "h-full flex justify-center items-center",
|
|
132
133
|
title: "No hay elementos disponibles",
|
|
133
134
|
titleSize: "text-4xl"
|
|
134
135
|
})
|
|
135
|
-
], 8,
|
|
136
|
+
], 8, Fe)
|
|
136
137
|
])),
|
|
137
|
-
e.$slots.tfoot ? (l(),
|
|
138
|
-
|
|
138
|
+
e.$slots.tfoot ? (l(), a("tfoot", Te, [
|
|
139
|
+
i(e.$slots, "tfoot", n(u(p.value)))
|
|
139
140
|
])) : c("", !0)
|
|
140
141
|
]),
|
|
141
|
-
s(
|
|
142
|
-
C(
|
|
143
|
-
"items-length": s(
|
|
144
|
-
"items-per-page": s(
|
|
145
|
-
"current-page": s(
|
|
146
|
-
"page-options": s(
|
|
147
|
-
"onUpdate:itemsPerPage": t[2] || (t[2] = (o) => s(
|
|
148
|
-
"onUpdate:page": t[3] || (t[3] = (o) => s(
|
|
142
|
+
s(D) ? i(e.$slots, "footer", n(b({ key: 2 }, p.value))) : (l(), a("div", Ae, [
|
|
143
|
+
C(ue, {
|
|
144
|
+
"items-length": s(W).length,
|
|
145
|
+
"items-per-page": s(r).itemsPerPage,
|
|
146
|
+
"current-page": s(r).page,
|
|
147
|
+
"page-options": s(O),
|
|
148
|
+
"onUpdate:itemsPerPage": t[2] || (t[2] = (o) => s(r).itemsPerPage = o),
|
|
149
|
+
"onUpdate:page": t[3] || (t[3] = (o) => s(r).page = o)
|
|
149
150
|
}, null, 8, ["items-length", "items-per-page", "current-page", "page-options"])
|
|
150
151
|
])),
|
|
151
|
-
e.filterable && s(m) ? (l(), v(
|
|
152
|
+
e.filterable && s(m) ? (l(), v(he, {
|
|
152
153
|
key: 3,
|
|
153
154
|
filters: e.filters,
|
|
154
155
|
modelValue: s(m),
|
|
155
|
-
"onUpdate:modelValue": t[4] || (t[4] = (o) =>
|
|
156
|
-
onApplyFilters: s(
|
|
157
|
-
onClearFilters: s(
|
|
158
|
-
activeFilters: s(
|
|
156
|
+
"onUpdate:modelValue": t[4] || (t[4] = (o) => ce(m) ? m.value = o : null),
|
|
157
|
+
onApplyFilters: s(q),
|
|
158
|
+
onClearFilters: s(G),
|
|
159
|
+
activeFilters: s(J).byColumn
|
|
159
160
|
}, null, 8, ["filters", "modelValue", "onApplyFilters", "onClearFilters", "activeFilters"])) : c("", !0)
|
|
160
161
|
], 16));
|
|
161
162
|
}
|
|
162
163
|
};
|
|
163
164
|
export {
|
|
164
|
-
|
|
165
|
+
He as default
|
|
165
166
|
};
|
package/dist/index.js
CHANGED
|
@@ -16,32 +16,33 @@ import $ from "./components/KunChip/src/components/KunChip.vue.js";
|
|
|
16
16
|
import d from "./components/KunCol/src/components/KunCol.vue.js";
|
|
17
17
|
import L from "./components/KunContainer/src/components/KunContainer.vue.js";
|
|
18
18
|
import C from "./components/KunCurrency/src/components/KunCurrency.vue.js";
|
|
19
|
-
import I from "./components/
|
|
20
|
-
import b from "./components/
|
|
21
|
-
import A from "./components/
|
|
22
|
-
import T from "./components/
|
|
23
|
-
import S from "./components/
|
|
24
|
-
import F from "./components/
|
|
25
|
-
import x from "./components/
|
|
19
|
+
import I from "./components/KunDialog/src/components/KunDialog.vue.js";
|
|
20
|
+
import b from "./components/KunDivider/src/components/KunDivider.vue.js";
|
|
21
|
+
import A from "./components/KunForm/src/components/KunForm.vue.js";
|
|
22
|
+
import T from "./components/KunIcon/src/components/KunIcon.vue.js";
|
|
23
|
+
import S from "./components/KunList/src/components/KunList.vue.js";
|
|
24
|
+
import F from "./components/KunListGroup/src/components/KunListGroup.vue.js";
|
|
25
|
+
import x from "./components/KunListImg/src/components/KunListImg.vue.js";
|
|
26
|
+
import g from "./components/KunListItem/src/components/KunListItem.vue.js";
|
|
26
27
|
import M from "./components/KunListItemAction/src/components/KunListItemAction.vue.js";
|
|
27
28
|
import h from "./components/KunListItemAvatar/src/components/KunListItemAvatar.vue.js";
|
|
28
29
|
import v from "./components/KunListItemSubtitle/src/components/KunListItemSubtitle.vue.js";
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
30
|
+
import w from "./components/KunListItemTitle/src/components/KunListItemTitle.vue.js";
|
|
31
|
+
import B from "./components/KunListItemText/src/components/KunListItemText.vue.js";
|
|
32
|
+
import D from "./components/KunListSubheader/src/components/KunListSubheader.vue.js";
|
|
32
33
|
import y from "./components/kunMenu/src/components/kunMenu.vue.js";
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
34
|
+
import G from "./components/KunModalFooter/src/components/KunModalFooter.vue.js";
|
|
35
|
+
import R from "./components/KunModalFooter/src/components/KunMultipleModalFooter.vue.js";
|
|
36
|
+
import j from "./components/KunNumberField/src/components/KunNumberField.vue.js";
|
|
37
|
+
import k from "./components/KunLoaderCircular/src/components/KunLoaderCircular.vue.js";
|
|
38
|
+
import q from "./components/KunRow/src/components/KunRow.vue.js";
|
|
39
|
+
import z from "./components/KunSlider/src/components/KunSlider.vue.js";
|
|
40
|
+
import N from "./components/KunSpacer/src/components/KunSpacer.vue.js";
|
|
41
|
+
import E from "./components/KunSwitch/src/components/KunSwitch.vue.js";
|
|
42
|
+
import H from "./components/KunTable/src/components/KunTable.vue.js";
|
|
43
|
+
import J from "./components/KunTextField/src/components/KunTextField.vue.js";
|
|
44
|
+
import O from "./components/KunToolbar/src/components/KunToolbar.vue.js";
|
|
45
|
+
import P from "./components/KunTooltip/src/components/KunTooltip.vue.js";
|
|
45
46
|
const n = {
|
|
46
47
|
KunAlert: o,
|
|
47
48
|
KunAppbar: i,
|
|
@@ -54,40 +55,41 @@ const n = {
|
|
|
54
55
|
KunCardActions: _,
|
|
55
56
|
KunCardItem: e,
|
|
56
57
|
KunCardSubtitle: p,
|
|
57
|
-
KunListItemTitle:
|
|
58
|
+
KunListItemTitle: w,
|
|
58
59
|
KunCardText: c,
|
|
59
60
|
KunCardTitle: l,
|
|
60
61
|
KunChip: $,
|
|
61
62
|
KunCol: d,
|
|
62
63
|
KunContainer: L,
|
|
63
64
|
KunCurrency: C,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
KunDialog: I,
|
|
66
|
+
KunDivider: b,
|
|
67
|
+
KunForm: A,
|
|
68
|
+
KunIcon: T,
|
|
69
|
+
KunList: S,
|
|
70
|
+
KunListGroup: F,
|
|
71
|
+
KunListImg: x,
|
|
72
|
+
KunListItem: g,
|
|
71
73
|
KunListItemAction: M,
|
|
72
74
|
KunListItemAvatar: h,
|
|
73
75
|
KunListItemSubtitle: v,
|
|
74
|
-
KunListItemText:
|
|
75
|
-
KunListSubheader:
|
|
76
|
+
KunListItemText: B,
|
|
77
|
+
KunListSubheader: D,
|
|
76
78
|
KunMenu: y,
|
|
77
|
-
KunModalFooter:
|
|
78
|
-
KunMultipleModalFooter:
|
|
79
|
-
KunNumberField:
|
|
80
|
-
KunLoaderCircular:
|
|
81
|
-
KunRow:
|
|
82
|
-
KunSlider:
|
|
83
|
-
KunSpacer:
|
|
84
|
-
KunSwitch:
|
|
85
|
-
KunTable:
|
|
86
|
-
KunTextField:
|
|
87
|
-
KunToolbar:
|
|
88
|
-
KunTooltip:
|
|
79
|
+
KunModalFooter: G,
|
|
80
|
+
KunMultipleModalFooter: R,
|
|
81
|
+
KunNumberField: j,
|
|
82
|
+
KunLoaderCircular: k,
|
|
83
|
+
KunRow: q,
|
|
84
|
+
KunSlider: z,
|
|
85
|
+
KunSpacer: N,
|
|
86
|
+
KunSwitch: E,
|
|
87
|
+
KunTable: H,
|
|
88
|
+
KunTextField: J,
|
|
89
|
+
KunToolbar: O,
|
|
90
|
+
KunTooltip: P
|
|
89
91
|
};
|
|
90
|
-
function
|
|
92
|
+
function km(r) {
|
|
91
93
|
for (const m in n)
|
|
92
94
|
r.component(m, n[m]);
|
|
93
95
|
}
|
|
@@ -109,30 +111,31 @@ export {
|
|
|
109
111
|
d as KunCol,
|
|
110
112
|
L as KunContainer,
|
|
111
113
|
C as KunCurrency,
|
|
112
|
-
I as
|
|
113
|
-
b as
|
|
114
|
-
A as
|
|
115
|
-
T as
|
|
116
|
-
S as
|
|
117
|
-
F as
|
|
118
|
-
x as
|
|
114
|
+
I as KunDialog,
|
|
115
|
+
b as KunDivider,
|
|
116
|
+
A as KunForm,
|
|
117
|
+
T as KunIcon,
|
|
118
|
+
S as KunList,
|
|
119
|
+
F as KunListGroup,
|
|
120
|
+
x as KunListImg,
|
|
121
|
+
g as KunListItem,
|
|
119
122
|
M as KunListItemAction,
|
|
120
123
|
h as KunListItemAvatar,
|
|
121
124
|
v as KunListItemSubtitle,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
B as KunListItemText,
|
|
126
|
+
w as KunListItemTitle,
|
|
127
|
+
D as KunListSubheader,
|
|
128
|
+
k as KunLoaderCircular,
|
|
126
129
|
y as KunMenu,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
130
|
+
G as KunModalFooter,
|
|
131
|
+
R as KunMultipleModalFooter,
|
|
132
|
+
q as KunRow,
|
|
133
|
+
z as KunSlider,
|
|
134
|
+
N as KunSpacer,
|
|
135
|
+
E as KunSwitch,
|
|
136
|
+
H as KunTable,
|
|
137
|
+
J as KunTextField,
|
|
138
|
+
O as KunToolbar,
|
|
139
|
+
P as KunTooltip,
|
|
140
|
+
km as install
|
|
138
141
|
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { computed as i, ref as w } from "vue";
|
|
2
|
+
function m() {
|
|
3
|
+
var s, t, a, u, v;
|
|
4
|
+
const l = window.navigator.userAgent;
|
|
5
|
+
let d = "Unknown OS", o = "Unknown Version";
|
|
6
|
+
return /Mac/.test(l) ? (d = "Mac OS", o = (t = (s = l.match(/Mac OS X (\d+[\._]\d+[\._]\d+)/)) == null ? void 0 : s[1]) == null ? void 0 : t.replace(/_/g, ".")) : /iPhone|iPad|iPod/.test(l) ? (d = "iOS", o = ((a = l.match(/OS (\d+)[._](\d+)[._]?(\d+)?/)) == null ? void 0 : a.slice(1, 4).join(".")) || "Unknown") : /Windows/.test(l) ? (d = "Windows", o = (u = l.match(/Windows NT (\d+\.\d+)/)) == null ? void 0 : u[1]) : /Android/.test(l) ? (d = "Android", o = (v = l.match(/Android (\d+\.\d+)/)) == null ? void 0 : v[1]) : /Linux/.test(l) && (d = "Linux"), { os: d, osVersion: o };
|
|
7
|
+
}
|
|
8
|
+
const e = w(window.innerWidth), x = w(window.innerHeight), r = m(), h = i(
|
|
9
|
+
() => r.os === "iOS" || r.os === "Android" || x.value > e.value
|
|
10
|
+
), n = {
|
|
11
|
+
xs: 475,
|
|
12
|
+
sm: 640,
|
|
13
|
+
md: 768,
|
|
14
|
+
lg: 1024,
|
|
15
|
+
xl: 1280,
|
|
16
|
+
xxl: 1536
|
|
17
|
+
};
|
|
18
|
+
i(() => e.value < n.sm);
|
|
19
|
+
i(() => e.value >= n.sm && e.value < n.md);
|
|
20
|
+
i(() => e.value >= n.md && e.value < n.lg);
|
|
21
|
+
i(() => e.value >= n.lg && e.value < n.xl);
|
|
22
|
+
i(() => e.value >= n.xl && e.value < n.xxl);
|
|
23
|
+
i(() => e.value >= n.xxl);
|
|
24
|
+
i(() => e.value >= n.xs);
|
|
25
|
+
i(() => e.value >= n.sm);
|
|
26
|
+
i(() => e.value >= n.md);
|
|
27
|
+
i(() => e.value >= n.lg);
|
|
28
|
+
i(() => e.value >= n.xl);
|
|
29
|
+
i(() => e.value >= n.xxl);
|
|
30
|
+
i(() => e.value < n.sm);
|
|
31
|
+
i(() => e.value < n.md);
|
|
32
|
+
i(() => e.value < n.lg);
|
|
33
|
+
i(() => e.value < n.xl);
|
|
34
|
+
i(() => e.value < n.xxl);
|
|
35
|
+
i(() => e.value < n.xxl);
|
|
36
|
+
function c() {
|
|
37
|
+
e.value = window.innerWidth, x.value = window.innerHeight;
|
|
38
|
+
}
|
|
39
|
+
window.addEventListener("resize", c);
|
|
40
|
+
window.addEventListener("beforeunload", () => {
|
|
41
|
+
window.removeEventListener("resize", c);
|
|
42
|
+
});
|
|
43
|
+
export {
|
|
44
|
+
h as isMobile,
|
|
45
|
+
r as kunOS,
|
|
46
|
+
x as screenHeight,
|
|
47
|
+
e as screenWidth
|
|
48
|
+
};
|