@studio-west/component-sw 0.13.11 → 0.13.16
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/LICENSE +201 -21
- package/README.md +159 -54
- package/dist/{SwButton-BfG2InPf.js → SwButton-DBj7jzhd.js} +1 -1
- package/dist/{SwDatePicker-BfuFsZeg.js → SwDatePicker-BwgaZLnR.js} +47 -47
- package/dist/{SwDropdown-BTADCvrN.js → SwDropdown-D5nIZEAM.js} +40 -23
- package/dist/SwDropdownItem-09XdzVHh.js +43 -0
- package/dist/{SwFile-D8wkf69j.js → SwFile-BTNWhEX-.js} +2 -2
- package/dist/SwFormItem-SuqNvXBQ.js +59 -0
- package/dist/SwGide-BScP5PoP.js +134 -0
- package/dist/{SwIcon-C4RHAbK1.js → SwIcon-Ce_Lj65y.js} +2 -2
- package/dist/{SwInput-0Eph7P-m.js → SwInput-D5cZvb4H.js} +2 -2
- package/dist/{SwMessage-WHO6knac.js → SwMessage-BRYFF_qT.js} +9 -5
- package/dist/{SwSelect-DwxIlRFI.js → SwSelect-Bo9kUY7P.js} +617 -494
- package/dist/SwSlider-Cl9pwY6h.js +197 -0
- package/dist/component-sw.css +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.js +91 -67
- package/dist/{utils-DwvFrrWs.js → utils-qzwUfWRX.js} +17 -2
- package/package.json +4 -1
- package/types/components.d.ts +0 -2
- package/types/index.d.ts +8 -2
- package/dist/SwDropdownItem-BBDMECgR.js +0 -40
- package/dist/SwDropdownNew-BuCIN-iv.js +0 -107
- package/dist/SwFormItem-DgFaNwe9.js +0 -24
- package/dist/SwGide-Da6Nv8Dd.js +0 -129
- package/dist/SwSlider-DkgJH6Bh.js +0 -179
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e,
|
|
1
|
+
import { a as e, o as t } from "./utils-qzwUfWRX.js";
|
|
2
2
|
import { Fragment as n, computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, normalizeClass as c, openBlock as l, ref as u, renderList as d, renderSlot as f, toDisplayString as p, unref as m, withModifiers as h } from "vue";
|
|
3
3
|
//#region src/components/SwDatePicker.vue
|
|
4
4
|
var ee = { class: "sw-data-picker" }, g = {
|
|
@@ -56,7 +56,7 @@ var ee = { class: "sw-data-picker" }, g = {
|
|
|
56
56
|
let n = new Date(2024, t);
|
|
57
57
|
return new Intl.DateTimeFormat(W.value, { month: "long" }).format(n);
|
|
58
58
|
})), q = u(Math.floor(F.value / 10) * 10), J = r(() => Array.from({ length: 12 }, (e, t) => q.value + t - 1));
|
|
59
|
-
A.data?.startDate ? (N.value = new Date(
|
|
59
|
+
A.data?.startDate ? (N.value = new Date(e(A.data.startDate)), F.value = N.value.getFullYear(), I.value = N.value.getMonth()) : A.data?.firstDate && (F.value = new Date(e(A.data.firstDate)).getFullYear(), I.value = new Date(e(A.data.firstDate)).getMonth(), z.value = new Date(F.value, I.value + 1, 1).getMonth()), A.data?.endDate && A.range === "range" && (P.value = new Date(e(A.data.endDate)), L.value = P.value.getFullYear(), R.value = P.value.getMonth());
|
|
60
60
|
let Y = () => {
|
|
61
61
|
B.value = [], V.value = 0;
|
|
62
62
|
let e = new Date(F.value, I.value, 0);
|
|
@@ -101,38 +101,38 @@ var ee = { class: "sw-data-picker" }, g = {
|
|
|
101
101
|
e(t?.weekend ?? t?.holidays, "weekend"), e(t?.preholiday ?? t?.preholidays, "preholiday"), e(t?.holiday, "holiday"), e(t?.nowork, "nowork");
|
|
102
102
|
}, pe = () => {
|
|
103
103
|
if (!A.limitation || A.limitation.length < 2) return !1;
|
|
104
|
-
let
|
|
105
|
-
if (
|
|
106
|
-
let n = [...
|
|
107
|
-
for (let
|
|
108
|
-
let r = new Date(
|
|
109
|
-
if (new Date(
|
|
104
|
+
let t = A.limitation.filter((e) => e.startDate && e.endDate);
|
|
105
|
+
if (t.length < 2) return !1;
|
|
106
|
+
let n = [...t].sort((t, n) => new Date(e(t.startDate)).getTime() - new Date(e(n.startDate)).getTime());
|
|
107
|
+
for (let t = 1; t < n.length; t++) {
|
|
108
|
+
let r = new Date(e(n[t - 1].endDate));
|
|
109
|
+
if (new Date(e(n[t].startDate)) <= r) return console.warn("Warning: Диапазоны пересекаются:", n[t - 1], n[t]), !0;
|
|
110
110
|
}
|
|
111
111
|
return !1;
|
|
112
|
-
}, X = (
|
|
112
|
+
}, X = (t, n, r) => {
|
|
113
113
|
if (!A.limitation || A.limitation.length === 0 || r == null) return !0;
|
|
114
|
-
let i = new Date(
|
|
115
|
-
for (let
|
|
116
|
-
let { startDate: n, endDate: r } =
|
|
114
|
+
let i = new Date(t, n, r).getTime();
|
|
115
|
+
for (let t of A.limitation) {
|
|
116
|
+
let { startDate: n, endDate: r } = t;
|
|
117
117
|
if (!n && r) {
|
|
118
|
-
if (i <= new Date(
|
|
118
|
+
if (i <= new Date(e(r)).getTime()) return !1;
|
|
119
119
|
continue;
|
|
120
120
|
}
|
|
121
121
|
if (n && !r) {
|
|
122
|
-
if (i >= new Date(
|
|
122
|
+
if (i >= new Date(e(n)).getTime()) return !1;
|
|
123
123
|
continue;
|
|
124
124
|
}
|
|
125
125
|
if (n && r) {
|
|
126
|
-
let
|
|
127
|
-
if (
|
|
128
|
-
if (i >=
|
|
129
|
-
} else if (i >=
|
|
126
|
+
let t = new Date(e(n)).getTime(), a = new Date(e(r)).getTime();
|
|
127
|
+
if (t <= a) {
|
|
128
|
+
if (i >= t && i <= a) return !1;
|
|
129
|
+
} else if (i >= t || i <= a) return !1;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
return !0;
|
|
133
|
-
}, Z = (
|
|
134
|
-
if (!X(
|
|
135
|
-
let r =
|
|
133
|
+
}, Z = (e, n) => {
|
|
134
|
+
if (!X(e.year, e.month, e.day)) return;
|
|
135
|
+
let r = t(new Date(e.year, e.month, e.day), "{dd}.{m}.{Y}");
|
|
136
136
|
if (A.range === "range") if (U.value !== -1) me(), H.value = n, B.value[n].class[1] = "active";
|
|
137
137
|
else if (H.value !== -1) {
|
|
138
138
|
let [e, t] = [Math.min(H.value, n), Math.max(H.value, n)];
|
|
@@ -148,21 +148,21 @@ var ee = { class: "sw-data-picker" }, g = {
|
|
|
148
148
|
});
|
|
149
149
|
}, me = () => {
|
|
150
150
|
B.value.forEach((e) => e.class[1] = ""), H.value = -1, U.value = -1;
|
|
151
|
-
}, he = (
|
|
152
|
-
let i =
|
|
153
|
-
if (n >=
|
|
154
|
-
for (let
|
|
151
|
+
}, he = (e, n, r) => {
|
|
152
|
+
let i = t(new Date(B.value[e].year, B.value[e].month, B.value[e].day), "{dd}.{m}.{Y}");
|
|
153
|
+
if (n >= e) {
|
|
154
|
+
for (let t = e + 1; t < n; t++) B.value[t].class[1] = "select";
|
|
155
155
|
j("input", {
|
|
156
156
|
dateStart: i,
|
|
157
157
|
dateEnd: r,
|
|
158
|
-
count: Q(
|
|
158
|
+
count: Q(e, n)
|
|
159
159
|
});
|
|
160
160
|
} else {
|
|
161
|
-
for (let
|
|
161
|
+
for (let t = n + 1; t < e; t++) B.value[t].class[1] = "select";
|
|
162
162
|
j("input", {
|
|
163
163
|
dateStart: r,
|
|
164
164
|
dateEnd: i,
|
|
165
|
-
count: Q(n,
|
|
165
|
+
count: Q(n, e)
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
168
|
B.value[n].class[1] = "active";
|
|
@@ -181,37 +181,37 @@ var ee = { class: "sw-data-picker" }, g = {
|
|
|
181
181
|
B.value[U.value].class[1] = "active";
|
|
182
182
|
for (let e = H.value + 1; e < U.value; e++) B.value[e].class[1] = "select";
|
|
183
183
|
}
|
|
184
|
-
return (
|
|
184
|
+
return (e, r) => (l(), a("div", ee, [o("div", null, [
|
|
185
185
|
A.range === "decades" || M.value === 3 ? (l(), a("p", g, [
|
|
186
186
|
o("span", null, [o("button", { onClick: r[0] ||= h((e) => {
|
|
187
187
|
q.value -= 10, $(F.value, I.value);
|
|
188
|
-
}, ["prevent"]) }, [f(
|
|
188
|
+
}, ["prevent"]) }, [f(e.$slots, "double-arrow", {}, () => [r[16] ||= s("«", -1)])])]),
|
|
189
189
|
o("span", _, p(J.value[0]) + " - " + p(J.value[11]), 1),
|
|
190
190
|
o("span", null, [o("button", {
|
|
191
191
|
class: "sw-revers",
|
|
192
192
|
onClick: r[1] ||= h((e) => {
|
|
193
193
|
q.value += 10, $(F.value, I.value);
|
|
194
194
|
}, ["prevent"])
|
|
195
|
-
}, [f(
|
|
195
|
+
}, [f(e.$slots, "double-arrow", {}, () => [r[17] ||= s("«", -1)])])])
|
|
196
196
|
])) : (l(), a("p", v, [
|
|
197
|
-
o("span", null, [o("button", { onClick: r[2] ||= h((e) => $(F.value - 1, I.value), ["prevent"]) }, [f(
|
|
197
|
+
o("span", null, [o("button", { onClick: r[2] ||= h((e) => $(F.value - 1, I.value), ["prevent"]) }, [f(e.$slots, "double-arrow", {}, () => [r[18] ||= s("«", -1)])]), o("button", { onClick: r[3] ||= h((e) => {
|
|
198
198
|
M.value = 0, $(F.value, I.value - 1);
|
|
199
|
-
}, ["prevent"]) }, [f(
|
|
200
|
-
o("span", y, [o("button", { onClick: r[4] ||= h((e) => M.value = 3, ["prevent"]) }, p(F.value), 1), o("button", { onClick: r[5] ||= h((e) => M.value = 1, ["prevent"]) }, p(m(
|
|
199
|
+
}, ["prevent"]) }, [f(e.$slots, "arrow", {}, () => [r[19] ||= s("‹", -1)])])]),
|
|
200
|
+
o("span", y, [o("button", { onClick: r[4] ||= h((e) => M.value = 3, ["prevent"]) }, p(F.value), 1), o("button", { onClick: r[5] ||= h((e) => M.value = 1, ["prevent"]) }, p(m(t)(N.value.setMonth(I.value), "{F}")), 1)]),
|
|
201
201
|
o("span", null, [o("button", {
|
|
202
202
|
class: "sw-revers",
|
|
203
203
|
onClick: r[6] ||= h((e) => {
|
|
204
204
|
M.value = 0, $(F.value, I.value + 1);
|
|
205
205
|
}, ["prevent"])
|
|
206
|
-
}, [f(
|
|
206
|
+
}, [f(e.$slots, "arrow", {}, () => [r[20] ||= s("‹", -1)])]), o("button", {
|
|
207
207
|
class: "sw-revers",
|
|
208
208
|
onClick: r[7] ||= h((e) => $(F.value + 1, I.value), ["prevent"])
|
|
209
|
-
}, [f(
|
|
209
|
+
}, [f(e.$slots, "double-arrow", {}, () => [r[21] ||= s("«", -1)])])])
|
|
210
210
|
])),
|
|
211
|
-
A.range === "year" || A.range === "decades" || M.value === 1 || M.value === 3 ? i("", !0) : (l(), a("div", b, [(l(), a(n, null, d(7, (
|
|
211
|
+
A.range === "year" || A.range === "decades" || M.value === 1 || M.value === 3 ? i("", !0) : (l(), a("div", b, [(l(), a(n, null, d(7, (e, n) => o("button", {
|
|
212
212
|
key: n,
|
|
213
213
|
class: "disabled"
|
|
214
|
-
}, p(m(
|
|
214
|
+
}, p(m(t)(new Date(1970, 1, e + m(G)), "{D}")), 1)), 64))])),
|
|
215
215
|
M.value !== 3 && A.range === "year" || M.value === 1 ? (l(), a("div", x, [(l(!0), a(n, null, d(K.value, (e, t) => (l(), a("button", {
|
|
216
216
|
key: t,
|
|
217
217
|
onClick: h((e) => {
|
|
@@ -235,33 +235,33 @@ var ee = { class: "sw-data-picker" }, g = {
|
|
|
235
235
|
A.range === "decades" || M.value === 4 ? (l(), a("p", ie, [
|
|
236
236
|
o("span", null, [o("button", { onClick: r[8] ||= h((e) => {
|
|
237
237
|
q.value -= 10, $(F.value, I.value);
|
|
238
|
-
}, ["prevent"]) }, [f(
|
|
238
|
+
}, ["prevent"]) }, [f(e.$slots, "double-arrow", {}, () => [r[22] ||= s("«", -1)])])]),
|
|
239
239
|
o("span", ae, p(J.value[0]) + " - " + p(J.value[11]), 1),
|
|
240
240
|
o("span", null, [o("button", {
|
|
241
241
|
class: "sw-revers",
|
|
242
242
|
onClick: r[9] ||= h((e) => {
|
|
243
243
|
q.value += 10, $(F.value, I.value);
|
|
244
244
|
}, ["prevent"])
|
|
245
|
-
}, [f(
|
|
245
|
+
}, [f(e.$slots, "double-arrow", {}, () => [r[23] ||= s("«", -1)])])])
|
|
246
246
|
])) : (l(), a("p", oe, [
|
|
247
|
-
o("span", null, [o("button", { onClick: r[10] ||= h((e) => $(F.value - 1, I.value), ["prevent"]) }, [f(
|
|
247
|
+
o("span", null, [o("button", { onClick: r[10] ||= h((e) => $(F.value - 1, I.value), ["prevent"]) }, [f(e.$slots, "double-arrow", {}, () => [r[24] ||= s("«", -1)])]), o("button", { onClick: r[11] ||= h((e) => {
|
|
248
248
|
M.value = 0, $(F.value, I.value - 1);
|
|
249
|
-
}, ["prevent"]) }, [f(
|
|
250
|
-
o("span", se, [o("button", { onClick: r[12] ||= h((e) => M.value = 4, ["prevent"]) }, p(new Date(F.value, I.value + 1).getFullYear()), 1), o("button", { onClick: r[13] ||= h((e) => M.value = 2, ["prevent"]) }, p(m(
|
|
249
|
+
}, ["prevent"]) }, [f(e.$slots, "arrow", {}, () => [r[25] ||= s("‹", -1)])])]),
|
|
250
|
+
o("span", se, [o("button", { onClick: r[12] ||= h((e) => M.value = 4, ["prevent"]) }, p(new Date(F.value, I.value + 1).getFullYear()), 1), o("button", { onClick: r[13] ||= h((e) => M.value = 2, ["prevent"]) }, p(m(t)(N.value.setMonth(I.value + 1), "{F}")), 1)]),
|
|
251
251
|
o("span", null, [o("button", {
|
|
252
252
|
class: "sw-revers",
|
|
253
253
|
onClick: r[14] ||= h((e) => {
|
|
254
254
|
M.value = 0, $(F.value, I.value + 1);
|
|
255
255
|
}, ["prevent"])
|
|
256
|
-
}, [f(
|
|
256
|
+
}, [f(e.$slots, "arrow", {}, () => [r[26] ||= s("‹", -1)])]), o("button", {
|
|
257
257
|
class: "sw-revers",
|
|
258
258
|
onClick: r[15] ||= h((e) => $(F.value + 1, I.value), ["prevent"])
|
|
259
|
-
}, [f(
|
|
259
|
+
}, [f(e.$slots, "double-arrow", {}, () => [r[27] ||= s("«", -1)])])])
|
|
260
260
|
])),
|
|
261
|
-
M.value === 2 || M.value === 4 ? i("", !0) : (l(), a("div", ce, [(l(), a(n, null, d(7, (
|
|
261
|
+
M.value === 2 || M.value === 4 ? i("", !0) : (l(), a("div", ce, [(l(), a(n, null, d(7, (e, n) => o("button", {
|
|
262
262
|
key: n,
|
|
263
263
|
class: "disabled"
|
|
264
|
-
}, p(m(
|
|
264
|
+
}, p(m(t)(new Date(1970, 1, e + m(G)), "{D}")), 1)), 64))])),
|
|
265
265
|
M.value === 2 ? (l(), a("div", le, [(l(!0), a(n, null, d(K.value, (e, t) => (l(), a("button", {
|
|
266
266
|
key: t,
|
|
267
267
|
onClick: h((e) => {
|
|
@@ -33,15 +33,15 @@ var _ = ["id"], v = {
|
|
|
33
33
|
}),
|
|
34
34
|
emits: ["update:modelValue"],
|
|
35
35
|
setup(a, { expose: v }) {
|
|
36
|
-
let y = a, b = m(a, "modelValue"), x = d(null), S = d(null), C = d({}), w = Math.ceil(Math.random() * 1e3),
|
|
36
|
+
let y = a, b = m(a, "modelValue"), x = d(null), S = d(null), C = d({}), w = d(""), T = Math.ceil(Math.random() * 1e3), E = d(0), D = t(() => {
|
|
37
37
|
let e = ["sw-dropdown"];
|
|
38
38
|
return y.size.length > 0 && e.push("sw-" + y.size), y.type.length > 0 && e.push("sw-" + y.type), e;
|
|
39
|
-
}),
|
|
40
|
-
b.value &&
|
|
39
|
+
}), O = new ResizeObserver(() => {
|
|
40
|
+
b.value && E.value++, E.value > 99 && (E.value = 1);
|
|
41
41
|
});
|
|
42
42
|
h(() => {
|
|
43
43
|
if (!b.value || !S.value || !x.value) return;
|
|
44
|
-
|
|
44
|
+
E.value < 2 && O.observe(S.value);
|
|
45
45
|
let e = window.pageYOffset || document.documentElement.scrollTop, t = window.pageXOffset || document.documentElement.scrollLeft;
|
|
46
46
|
document.body.style.position = "fixed", document.body.style.top = `-${e}px`, document.body.style.left = `-${t}px`, document.body.style.position = "", document.body.style.top = "", document.body.style.left = "", document.documentElement.scrollTop = e, document.documentElement.scrollLeft = t;
|
|
47
47
|
let n = x.value.getBoundingClientRect(), r = window.innerWidth, i = window.innerHeight, a = S.value.offsetHeight, o = S.value.offsetWidth, s = n.left + n.width / 2 + t, c = n.top + n.height / 2 + e, l = n.height / 2 + 8, [u, d] = y.placement.split("-", 2);
|
|
@@ -67,44 +67,61 @@ var _ = ["id"], v = {
|
|
|
67
67
|
s = 8 < s + n.width / 2 - o ? s - o + n.width / 2 : s - n.width / 2;
|
|
68
68
|
break;
|
|
69
69
|
}
|
|
70
|
-
s < 0 && (s = 0), c < 0 && (c = 0)
|
|
70
|
+
s < 0 && (s = 0), c < 0 && (c = 0);
|
|
71
|
+
let f = n.left + n.width / 2 + t, p = n.top + n.height / 2 + e, m = s + o / 2 - f, h = c + a / 2 - p, g;
|
|
72
|
+
g = Math.abs(h) >= Math.abs(m) ? h > 0 ? "top" : "bottom" : m > 0 ? "left" : "right";
|
|
73
|
+
let _ = g === "top" || g === "bottom" ? Math.max(12, Math.min(o - 12, f - s)) : Math.max(12, Math.min(a - 12, p - c));
|
|
74
|
+
w.value = `arrow-${g}`;
|
|
75
|
+
let v = 0;
|
|
76
|
+
for (let e = x.value; e && e !== document.documentElement; e = e.parentElement) {
|
|
77
|
+
let t = getComputedStyle(e).zIndex;
|
|
78
|
+
if (t === "auto") continue;
|
|
79
|
+
let n = Number.parseInt(t, 10);
|
|
80
|
+
if (!Number.isNaN(n)) {
|
|
81
|
+
v = n;
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
C.value = {
|
|
71
86
|
position: "absolute",
|
|
72
87
|
top: `${c}px`,
|
|
73
88
|
left: `${s}px`,
|
|
74
|
-
maxWidth: y.maxWidth > 0 ? `${y.maxWidth}px` : ""
|
|
89
|
+
maxWidth: y.maxWidth > 0 ? `${y.maxWidth}px` : "",
|
|
90
|
+
"--sw-dropdown-arrow": `${_}px`,
|
|
91
|
+
"--sw-z-index": String(v)
|
|
75
92
|
};
|
|
76
93
|
}, { flush: "post" });
|
|
77
|
-
let
|
|
94
|
+
let k = () => {
|
|
78
95
|
y.trigger === "click" && (b.value = !b.value);
|
|
79
|
-
}, k = () => {
|
|
80
|
-
y.trigger === "hover" && (b.value = !b.value);
|
|
81
96
|
}, A = () => {
|
|
82
|
-
y.trigger === "
|
|
97
|
+
y.trigger === "hover" && (b.value = !b.value);
|
|
83
98
|
}, j = () => {
|
|
84
|
-
|
|
99
|
+
y.trigger === "context" && (b.value = !b.value);
|
|
100
|
+
}, M = () => {
|
|
101
|
+
b.value && E.value++, E.value > 99 && (E.value = 1);
|
|
85
102
|
};
|
|
86
|
-
v({ handleResize:
|
|
87
|
-
let
|
|
88
|
-
y.trigger !== "none" && !e.target.closest(`[id="${
|
|
103
|
+
v({ handleResize: M });
|
|
104
|
+
let N = (e) => {
|
|
105
|
+
y.trigger !== "none" && !e.target.closest(`[id="${T}"]`) && x.value && !x.value.contains(e.target) && (b.value = !1);
|
|
89
106
|
};
|
|
90
107
|
return c(() => {
|
|
91
|
-
window.addEventListener("resize",
|
|
108
|
+
window.addEventListener("resize", M), document.documentElement.ontouchstart === void 0 ? document.documentElement.addEventListener("click", N, !0) : document.documentElement.addEventListener("touchstart", N, !0), window.onscrollend === void 0 ? window.addEventListener("scroll", M) : window.addEventListener("scrollend", M);
|
|
92
109
|
}), l(() => {
|
|
93
|
-
|
|
110
|
+
O.disconnect(), window.removeEventListener("resize", M), document.documentElement.ontouchstart === void 0 ? document.documentElement.removeEventListener("click", N) : document.documentElement.removeEventListener("touchstart", N), window.onscrollend === void 0 ? window.removeEventListener("scroll", M) : window.removeEventListener("scrollend", M);
|
|
94
111
|
}), (t, a) => (u(), i("div", {
|
|
95
|
-
class: o(
|
|
96
|
-
onClick: a[0] ||= (e) =>
|
|
97
|
-
onMouseover: a[1] ||= g((e) =>
|
|
98
|
-
onMouseleave: a[2] ||= g((e) =>
|
|
99
|
-
onContextmenu: a[3] ||= g((e) =>
|
|
112
|
+
class: o(D.value),
|
|
113
|
+
onClick: a[0] ||= (e) => k(),
|
|
114
|
+
onMouseover: a[1] ||= g((e) => A(), ["stop"]),
|
|
115
|
+
onMouseleave: a[2] ||= g((e) => A(), ["stop"]),
|
|
116
|
+
onContextmenu: a[3] ||= g((e) => j(), ["stop"]),
|
|
100
117
|
ref_key: "dropdownRef",
|
|
101
118
|
ref: x
|
|
102
119
|
}, [f(t.$slots, "default"), (u(), n(e, { to: "body" }, [b.value ? (u(), i("ul", {
|
|
103
120
|
key: 0,
|
|
104
121
|
ref_key: "popupRef",
|
|
105
122
|
ref: S,
|
|
106
|
-
id: p(
|
|
107
|
-
class: o(["sw-dropdown-popup", y.class]),
|
|
123
|
+
id: p(T),
|
|
124
|
+
class: o(["sw-dropdown-popup", [y.class, w.value]]),
|
|
108
125
|
style: s(C.value),
|
|
109
126
|
tabindex: "-1"
|
|
110
127
|
}, [f(t.$slots, "dropdown")], 14, _)) : r("", !0)]))], 34));
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { n as e } from "./SwIcon-Ce_Lj65y.js";
|
|
2
|
+
import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, normalizeClass as o, openBlock as s, renderSlot as c } from "vue";
|
|
3
|
+
//#region src/components/SwDropdownItem.vue
|
|
4
|
+
var l = {
|
|
5
|
+
class: "lead",
|
|
6
|
+
"aria-hidden": "true"
|
|
7
|
+
}, u = { class: "text" }, d = {
|
|
8
|
+
__name: "SwDropdownItem",
|
|
9
|
+
props: {
|
|
10
|
+
class: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: ""
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: ""
|
|
17
|
+
},
|
|
18
|
+
type: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: ""
|
|
21
|
+
},
|
|
22
|
+
before: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ""
|
|
25
|
+
},
|
|
26
|
+
iconBefore: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ""
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
setup(d) {
|
|
32
|
+
let f = d, p = t(() => f.before || f.iconBefore), m = t(() => {
|
|
33
|
+
let e = ["sw-dropdown-item"];
|
|
34
|
+
return f.size.length > 0 && e.push("sw-" + f.size), f.type.length > 0 && e.push("sw-" + f.type), f.class.length > 0 && e.push(f.class), e;
|
|
35
|
+
});
|
|
36
|
+
return (t, d) => (s(), i("li", { class: o(m.value) }, [a("span", l, [p.value.length > 0 ? (s(), n(e, {
|
|
37
|
+
key: 0,
|
|
38
|
+
"icon-class": p.value
|
|
39
|
+
}, null, 8, ["icon-class"])) : r("", !0)]), a("span", u, [c(t.$slots, "default")])], 2));
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { d as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e } from "./SwIcon-
|
|
2
|
-
import { t } from "./SwButton-
|
|
1
|
+
import { n as e } from "./SwIcon-Ce_Lj65y.js";
|
|
2
|
+
import { t } from "./SwButton-DBj7jzhd.js";
|
|
3
3
|
import { Fragment as n, computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, mergeModels as l, nextTick as u, normalizeClass as d, normalizeStyle as f, onUnmounted as p, openBlock as m, ref as h, renderList as g, renderSlot as _, toDisplayString as v, unref as y, useModel as ee, watch as te, withCtx as b, withModifiers as ne } from "vue";
|
|
4
4
|
//#region src/utils/mediaCrop.ts
|
|
5
5
|
function re(e, t, n, r) {
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { computed as e, createCommentVNode as t, createElementBlock as n, createTextVNode as r, normalizeClass as i, openBlock as a, renderSlot as o, toDisplayString as s, unref as c, useSlots as l } from "vue";
|
|
2
|
+
//#region src/components/SwFormItem.vue
|
|
3
|
+
var u = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "label"
|
|
6
|
+
}, d = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "text"
|
|
9
|
+
}, f = {
|
|
10
|
+
__name: "SwFormItem",
|
|
11
|
+
props: {
|
|
12
|
+
class: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: ""
|
|
15
|
+
},
|
|
16
|
+
label: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: ""
|
|
19
|
+
},
|
|
20
|
+
type: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "",
|
|
23
|
+
validator: (e) => [
|
|
24
|
+
"",
|
|
25
|
+
"primary",
|
|
26
|
+
"success",
|
|
27
|
+
"info",
|
|
28
|
+
"warning",
|
|
29
|
+
"danger",
|
|
30
|
+
"error"
|
|
31
|
+
].includes(e)
|
|
32
|
+
},
|
|
33
|
+
justify: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: "",
|
|
36
|
+
validator: (e) => [
|
|
37
|
+
"",
|
|
38
|
+
"start",
|
|
39
|
+
"end",
|
|
40
|
+
"around",
|
|
41
|
+
"center"
|
|
42
|
+
].includes(e)
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
setup(f) {
|
|
46
|
+
let p = l(), m = f, h = e(() => {
|
|
47
|
+
let e = ["sw-form-item"];
|
|
48
|
+
return m.justify.length > 0 && e.push(`sw-${m.justify}`), m.type.length > 0 && e.push(`sw-${m.type === "error" ? "danger" : m.type}`), m.class.length > 0 && e.push(m.class), e;
|
|
49
|
+
});
|
|
50
|
+
return (e, l) => (a(), n("div", { class: i(h.value) }, [
|
|
51
|
+
o(e.$slots, "before"),
|
|
52
|
+
m.label.length > 0 || c(p).label ? (a(), n("span", u, [o(e.$slots, "label", {}, () => [r(s(m.label), 1)])])) : t("", !0),
|
|
53
|
+
c(p).default ? (a(), n("span", d, [o(e.$slots, "default")])) : t("", !0),
|
|
54
|
+
o(e.$slots, "after")
|
|
55
|
+
], 2));
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
//#endregion
|
|
59
|
+
export { f as default };
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { i as e } from "./utils-qzwUfWRX.js";
|
|
2
|
+
import { n as t } from "./SwIcon-Ce_Lj65y.js";
|
|
3
|
+
import { t as n } from "./SwButton-DBj7jzhd.js";
|
|
4
|
+
import r from "./SwDropdown-D5nIZEAM.js";
|
|
5
|
+
import { computed as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, mergeModels as l, normalizeClass as u, onMounted as d, openBlock as f, ref as p, renderSlot as m, toDisplayString as h, useModel as g, watchEffect as _, withCtx as v } from "vue";
|
|
6
|
+
//#region src/components/SwGide.vue
|
|
7
|
+
var y = ["src"], b = {
|
|
8
|
+
__name: "SwGide",
|
|
9
|
+
props: /*@__PURE__*/ l({
|
|
10
|
+
steps: {
|
|
11
|
+
type: Array,
|
|
12
|
+
default: () => []
|
|
13
|
+
},
|
|
14
|
+
after: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: ""
|
|
17
|
+
},
|
|
18
|
+
iconClose: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: ""
|
|
21
|
+
},
|
|
22
|
+
maxWidth: {
|
|
23
|
+
type: Number,
|
|
24
|
+
default: 250
|
|
25
|
+
}
|
|
26
|
+
}, {
|
|
27
|
+
modelValue: {
|
|
28
|
+
type: Number,
|
|
29
|
+
default: 0
|
|
30
|
+
},
|
|
31
|
+
modelModifiers: {}
|
|
32
|
+
}),
|
|
33
|
+
emits: /*@__PURE__*/ l(["close"], ["update:modelValue"]),
|
|
34
|
+
setup(l, { emit: b }) {
|
|
35
|
+
let x = p(null), S = p(!0), C = p(null), w = g(l, "modelValue"), T = b, E = l, D = i(() => E.after || E.iconClose), O = () => T("close"), k = () => {
|
|
36
|
+
if (!x.value) return;
|
|
37
|
+
let t = Math.min(e(x.value), 9980);
|
|
38
|
+
x.value.style.setProperty("--sw-z-index", String(t));
|
|
39
|
+
}, A = (e) => {
|
|
40
|
+
let t = w.value + e;
|
|
41
|
+
t < 0 ? w.value = 0 : t >= E.steps.length ? O() : w.value = t;
|
|
42
|
+
}, j = !1, M = (e) => {
|
|
43
|
+
let t = e.getBoundingClientRect(), n = window.innerHeight;
|
|
44
|
+
t.top < 5 ? (j = !0, document.documentElement.scrollTop += t.top - 5) : t.bottom > n - 5 && (j = !0, document.documentElement.scrollTop += t.bottom - n + 5);
|
|
45
|
+
}, N = () => {
|
|
46
|
+
if (!C.value || !x.value) return;
|
|
47
|
+
let e = C.value.getBoundingClientRect(), t = window.pageYOffset || document.documentElement.scrollTop, n = window.pageXOffset || document.documentElement.scrollLeft;
|
|
48
|
+
x.value.style.gridTemplateRows = `${e.top + t - 5}px ${e.height + 10}px 1fr`, x.value.style.gridTemplateColumns = `${e.left + n - 5}px ${e.width + 10}px 1fr`, x.value.style.height = document.documentElement.scrollHeight + "px";
|
|
49
|
+
};
|
|
50
|
+
return _((e) => {
|
|
51
|
+
if (!x.value) return;
|
|
52
|
+
let t = E.steps[w.value]?.tag;
|
|
53
|
+
if (!t || !t.trim()) {
|
|
54
|
+
x.value.style.gridTemplateRows = "40% 0 1fr", x.value.style.gridTemplateColumns = "1fr 0 1fr", x.value.style.height = document.documentElement.scrollHeight + "px", k();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (C.value = document.querySelector(t), !C.value) {
|
|
58
|
+
console.warn(`[SwGuide] Элемент не найден: ${t}`);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
M(C.value);
|
|
62
|
+
let n = () => {
|
|
63
|
+
if (j) {
|
|
64
|
+
j = !1;
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
N();
|
|
68
|
+
};
|
|
69
|
+
k(), N();
|
|
70
|
+
let r = new ResizeObserver(N);
|
|
71
|
+
r.observe(C.value), window.addEventListener("resize", n), window.addEventListener("scroll", n, { passive: !0 }), e(() => {
|
|
72
|
+
r.disconnect(), window.removeEventListener("resize", n), window.removeEventListener("scroll", n);
|
|
73
|
+
});
|
|
74
|
+
}), d(() => window.onload = () => C.value = document.querySelector(E.steps[w.value]?.tag)), (e, i) => (f(), a("div", {
|
|
75
|
+
class: "sw-gide",
|
|
76
|
+
ref_key: "swGide",
|
|
77
|
+
ref: x
|
|
78
|
+
}, [
|
|
79
|
+
i[6] ||= o("div", { class: "overlay0" }, null, -1),
|
|
80
|
+
i[7] ||= o("div", { class: "overlay1" }, null, -1),
|
|
81
|
+
c(r, {
|
|
82
|
+
class: "gide",
|
|
83
|
+
trigger: "none",
|
|
84
|
+
placement: E.steps[w.value].placement,
|
|
85
|
+
modelValue: S.value,
|
|
86
|
+
"onUpdate:modelValue": i[2] ||= (e) => S.value = e,
|
|
87
|
+
maxWidth: E.maxWidth
|
|
88
|
+
}, {
|
|
89
|
+
dropdown: v(() => [
|
|
90
|
+
o("header", null, [m(e.$slots, "header", {}, () => [s(h(E.steps[w.value].header) + " ", 1), c(n, {
|
|
91
|
+
type: "primary",
|
|
92
|
+
link: "",
|
|
93
|
+
onClick: O
|
|
94
|
+
}, {
|
|
95
|
+
default: v(() => [c(t, { "icon-class": D.value }, null, 8, ["icon-class"])]),
|
|
96
|
+
_: 1
|
|
97
|
+
})])]),
|
|
98
|
+
m(e.$slots, "default", {}, () => [o("div", null, h(E.steps[w.value].text), 1), o("img", {
|
|
99
|
+
class: u(/left/.test(E.steps[w.value]?.placement) ? "reflect" : null),
|
|
100
|
+
src: E.steps[w.value].img
|
|
101
|
+
}, null, 10, y)]),
|
|
102
|
+
o("footer", null, [m(e.$slots, "footer", {}, () => [c(n, {
|
|
103
|
+
type: w.value === 0 ? "info" : "warning",
|
|
104
|
+
text: "",
|
|
105
|
+
link: "",
|
|
106
|
+
onClick: i[0] ||= (e) => A(-1)
|
|
107
|
+
}, {
|
|
108
|
+
default: v(() => [m(e.$slots, "arrow", {}, () => [i[3] ||= s("‹", -1)])]),
|
|
109
|
+
_: 3
|
|
110
|
+
}, 8, ["type"]), c(n, {
|
|
111
|
+
type: "success",
|
|
112
|
+
onClick: i[1] ||= (e) => A(1),
|
|
113
|
+
text: "",
|
|
114
|
+
link: "",
|
|
115
|
+
class: "sw-revers"
|
|
116
|
+
}, {
|
|
117
|
+
default: v(() => [m(e.$slots, "arrow", {}, () => [i[4] ||= s("‹", -1)])]),
|
|
118
|
+
_: 3
|
|
119
|
+
})])])
|
|
120
|
+
]),
|
|
121
|
+
default: v(() => [i[5] ||= o("div", { class: "hole" }, null, -1)]),
|
|
122
|
+
_: 3
|
|
123
|
+
}, 8, [
|
|
124
|
+
"placement",
|
|
125
|
+
"modelValue",
|
|
126
|
+
"maxWidth"
|
|
127
|
+
]),
|
|
128
|
+
i[8] ||= o("div", { class: "overlay2" }, null, -1),
|
|
129
|
+
i[9] ||= o("div", { class: "overlay3" }, null, -1)
|
|
130
|
+
], 512));
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
//#endregion
|
|
134
|
+
export { b as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as e } from "./utils-
|
|
2
|
-
import { t } from "./SwSelect-
|
|
1
|
+
import { r as e } from "./utils-qzwUfWRX.js";
|
|
2
|
+
import { t } from "./SwSelect-Bo9kUY7P.js";
|
|
3
3
|
import { computed as n, createElementBlock as r, createElementVNode as i, mergeProps as a, openBlock as o, unref as s } from "vue";
|
|
4
4
|
//#region src/components/SwIcon.vue
|
|
5
5
|
var c = /* @__PURE__ */ t({ default: () => u }), l = ["href"], u = /*@__PURE__*/ Object.assign({ inheritAttrs: !1 }, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e } from "./utils-
|
|
2
|
-
import { n as t } from "./SwIcon-
|
|
1
|
+
import { n as e } from "./utils-qzwUfWRX.js";
|
|
2
|
+
import { n as t } from "./SwIcon-Ce_Lj65y.js";
|
|
3
3
|
import { computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, defineComponent as c, mergeModels as l, mergeProps as u, normalizeClass as d, openBlock as f, ref as p, renderSlot as m, toDisplayString as h, useModel as g, vModelDynamic as _, watch as v, withDirectives as y } from "vue";
|
|
4
4
|
//#region src/components/SwInput.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var b = ["for"], x = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e } from "./SwIcon-
|
|
2
|
-
import { t } from "./SwButton-
|
|
1
|
+
import { n as e } from "./SwIcon-Ce_Lj65y.js";
|
|
2
|
+
import { t } from "./SwButton-DBj7jzhd.js";
|
|
3
3
|
import { computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, mergeModels as c, nextTick as l, normalizeClass as u, onUnmounted as d, openBlock as f, ref as p, renderSlot as m, toDisplayString as h, unref as g, useModel as _, useSlots as v, watch as y, withCtx as b } from "vue";
|
|
4
4
|
//#region src/components/SwMessage.vue
|
|
5
5
|
var x = { key: 0 }, S = {
|
|
@@ -27,16 +27,20 @@ var x = { key: 0 }, S = {
|
|
|
27
27
|
}),
|
|
28
28
|
emits: ["update:modelValue"],
|
|
29
29
|
setup(c) {
|
|
30
|
-
let S = _(c, "modelValue"), C = c, w = n(() => C.after || C.iconAfter), T = p(null), E = v(), D = (
|
|
30
|
+
let S = _(c, "modelValue"), C = c, w = n(() => C.after || C.iconAfter), T = p(null), E = v(), D = p(""), O = () => {
|
|
31
|
+
D.value = document.body.style.overflow, document.body.style.overflow = "hidden";
|
|
32
|
+
}, k = () => {
|
|
33
|
+
document.body.style.overflow = D.value;
|
|
34
|
+
}, A = (e) => {
|
|
31
35
|
if (T.value && S.value) {
|
|
32
36
|
let t = T.value.getBoundingClientRect();
|
|
33
37
|
e.clientX >= t.left && e.clientX <= t.right && e.clientY >= t.top && e.clientY <= t.bottom || (S.value = !1);
|
|
34
38
|
}
|
|
35
39
|
};
|
|
36
40
|
return y(() => S.value, (e) => {
|
|
37
|
-
e ? (T.value.showModal(), l(), window.addEventListener("click",
|
|
41
|
+
e ? (T.value.showModal(), O(), l(), window.addEventListener("click", A, !0)) : (T.value.close(), k(), window.removeEventListener("click", A));
|
|
38
42
|
}), d(() => {
|
|
39
|
-
window.removeEventListener("click",
|
|
43
|
+
k(), window.removeEventListener("click", A);
|
|
40
44
|
}), (n, c) => (f(), i("dialog", {
|
|
41
45
|
class: u("sw-message " + C.class),
|
|
42
46
|
ref_key: "messageRef",
|