@studio-west/component-sw 0.10.9 → 0.10.11
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 +10 -0
- package/dist/{SwDatePicker-DPL2xnfr.js → SwDatePicker-D25T1Ubw.js} +100 -103
- package/dist/{SwDropdownItem-CKexOhlx.js → SwDropdownItem-DFIqJmpS.js} +1 -1
- package/dist/{SwGide-D0cE663C.js → SwGide-Ch5TIda2.js} +24 -31
- package/dist/SwInput-Bn7eL-Ur.js +89 -0
- package/dist/SwMessage-5_BqCfqv.js +57 -0
- package/dist/SwSlider-CQgfTwD_.js +140 -0
- package/dist/SwTable-BKZ5idCi.js +149 -0
- package/dist/{index-C4bjIOWO.js → index-DeMssusd.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +5 -9
- package/dist/SwInput-DW08IfrK.js +0 -91
- package/dist/SwMessage-DGaPcMYb.js +0 -60
- package/dist/SwSlider-t6njKr4X.js +0 -142
- package/dist/SwTable-BLrFhlyO.js +0 -152
package/README.md
CHANGED
|
@@ -62,6 +62,16 @@ import { Library } from '@studio-west/component-sw';
|
|
|
62
62
|
import '@studio-west/component-sw/dist/component-sw.css';
|
|
63
63
|
|
|
64
64
|
app.use(Library)
|
|
65
|
+
```
|
|
66
|
+
### Локальное подключение / Local add:
|
|
67
|
+
```js
|
|
68
|
+
import { components } from '@studio-west/component-sw';
|
|
69
|
+
import '@studio-west/component-sw/dist/component-sw.css';
|
|
70
|
+
const {
|
|
71
|
+
SwSlider,
|
|
72
|
+
SwInput
|
|
73
|
+
} = components;
|
|
74
|
+
|
|
65
75
|
```
|
|
66
76
|
Установка в ручную светлой и темной темы - добавление к тегу `html` классов `dark` или `light` / Installation in a manual light and dark theme - adding to the tag `html` classes` dark` or `light`
|
|
67
77
|
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { ref as D, computed as
|
|
2
|
-
import { p as $, a as B } from "./index-
|
|
3
|
-
const
|
|
1
|
+
import { ref as D, computed as Q, createElementBlock as r, openBlock as v, createElementVNode as o, createCommentVNode as j, withModifiers as c, renderSlot as w, createTextVNode as k, toDisplayString as f, unref as F, Fragment as b, renderList as S, normalizeClass as A } from "vue";
|
|
2
|
+
import { p as $, a as B } from "./index-DeMssusd.js";
|
|
3
|
+
const te = { class: "sw-data-picker" }, ae = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "month_year"
|
|
6
|
-
},
|
|
6
|
+
}, le = { class: "text" }, ne = {
|
|
7
7
|
key: 1,
|
|
8
8
|
class: "month_year"
|
|
9
|
-
},
|
|
9
|
+
}, se = { class: "text" }, oe = {
|
|
10
10
|
key: 2,
|
|
11
11
|
class: "week"
|
|
12
|
-
},
|
|
12
|
+
}, ue = {
|
|
13
13
|
key: 3,
|
|
14
14
|
class: "year"
|
|
15
|
-
},
|
|
15
|
+
}, re = ["onClick"], ve = {
|
|
16
16
|
key: 4,
|
|
17
17
|
class: "year"
|
|
18
|
-
},
|
|
18
|
+
}, ie = ["onClick"], de = {
|
|
19
19
|
key: 5,
|
|
20
20
|
class: "month"
|
|
21
|
-
},
|
|
21
|
+
}, ce = ["onClick"], ge = { key: 0 }, pe = {
|
|
22
22
|
key: 0,
|
|
23
23
|
class: "month_year"
|
|
24
|
-
},
|
|
24
|
+
}, fe = { class: "text" }, De = {
|
|
25
25
|
key: 1,
|
|
26
26
|
class: "month_year"
|
|
27
|
-
},
|
|
27
|
+
}, me = { class: "text" }, we = {
|
|
28
28
|
key: 2,
|
|
29
29
|
class: "week"
|
|
30
|
-
},
|
|
30
|
+
}, ke = {
|
|
31
31
|
key: 3,
|
|
32
32
|
class: "year"
|
|
33
|
-
},
|
|
33
|
+
}, ye = ["onClick"], he = {
|
|
34
34
|
key: 4,
|
|
35
35
|
class: "year"
|
|
36
|
-
},
|
|
36
|
+
}, be = ["onClick"], $e = {
|
|
37
37
|
key: 5,
|
|
38
38
|
class: "month"
|
|
39
|
-
},
|
|
39
|
+
}, Ce = ["onClick"], Se = {
|
|
40
40
|
__name: "SwDatePicker",
|
|
41
41
|
props: {
|
|
42
42
|
data: Object,
|
|
@@ -50,18 +50,17 @@ const oe = { class: "sw-data-picker" }, ue = {
|
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
emits: ["input"],
|
|
53
|
-
setup(
|
|
54
|
-
|
|
55
|
-
const s = ee, L = te, d = D(5), C = D(/* @__PURE__ */ new Date()), z = D(/* @__PURE__ */ new Date()), u = D((/* @__PURE__ */ new Date()).getFullYear()), n = D((/* @__PURE__ */ new Date()).getMonth()), q = D((/* @__PURE__ */ new Date()).getFullYear()), x = D((/* @__PURE__ */ new Date()).getMonth()), O = D(new Date(u.value, n.value + 1, 1).getMonth()), i = D([]), V = D(0), m = D(-1), F = D(-1), G = D(navigator.language || "ru"), E = /en|zh|ja|he/.test(G.value) ? 0 : 1, H = K(() => Array.from({ length: 12 }, (a, e) => {
|
|
53
|
+
setup(U, { emit: X }) {
|
|
54
|
+
const s = U, L = X, d = D(5), C = D(/* @__PURE__ */ new Date()), z = D(/* @__PURE__ */ new Date()), u = D((/* @__PURE__ */ new Date()).getFullYear()), n = D((/* @__PURE__ */ new Date()).getMonth()), W = D((/* @__PURE__ */ new Date()).getFullYear()), q = D((/* @__PURE__ */ new Date()).getMonth()), O = D(new Date(u.value, n.value + 1, 1).getMonth()), i = D([]), V = D(0), m = D(-1), M = D(-1), x = D(navigator.language || "ru"), I = /en|zh|ja|he/.test(x.value) ? 0 : 1, G = Q(() => Array.from({ length: 12 }, (a, e) => {
|
|
56
55
|
const t = new Date(2024, e);
|
|
57
|
-
return new Intl.DateTimeFormat(
|
|
58
|
-
})),
|
|
59
|
-
|
|
60
|
-
const
|
|
56
|
+
return new Intl.DateTimeFormat(x.value, { month: "long" }).format(t);
|
|
57
|
+
})), Y = D(Math.floor(u.value / 10) * 10), N = Q(() => Array.from({ length: 12 }, (a, e) => Y.value + e - 1));
|
|
58
|
+
s.data?.startDate && (C.value = new Date($(s.data.startDate)), u.value = C.value.getFullYear(), n.value = C.value.getMonth()), s.data?.endDate && s.range === "range" && (z.value = new Date($(s.data.endDate)), W.value = z.value.getFullYear(), q.value = z.value.getMonth());
|
|
59
|
+
const H = () => {
|
|
61
60
|
i.value = [], V.value = 0;
|
|
62
61
|
const a = new Date(u.value, n.value, 0);
|
|
63
|
-
for (let t = a.getDate() - a.getDay() +
|
|
64
|
-
a.getDay() !== 6 +
|
|
62
|
+
for (let t = a.getDate() - a.getDay() + I; t <= a.getDate(); t++)
|
|
63
|
+
a.getDay() !== 6 + I && (i.value.push({ day: t, month: a.getMonth(), year: a.getFullYear(), class: [] }), V.value++);
|
|
65
64
|
const e = new Date(u.value, n.value + 1, 0).getDate();
|
|
66
65
|
for (let t = 1; t <= e; t++)
|
|
67
66
|
i.value.push({ day: t, month: n.value, year: u.value, class: [] }), V.value++;
|
|
@@ -70,18 +69,17 @@ const oe = { class: "sw-data-picker" }, ue = {
|
|
|
70
69
|
for (let g = 1; g <= l; g++)
|
|
71
70
|
i.value.push({ day: g, month: t.getMonth(), year: t.getFullYear(), class: [] });
|
|
72
71
|
}
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
N !== -1 && (i.value[N].class[0] = l);
|
|
72
|
+
Z();
|
|
73
|
+
}, Z = () => {
|
|
74
|
+
if (!s.data?.holiday) return;
|
|
75
|
+
const a = (e, t) => {
|
|
76
|
+
e.forEach((l) => {
|
|
77
|
+
const [g, y, T] = l.split("-").map(Number), h = i.value.findIndex((E) => E.year === g && E.month + 1 === y && E.day === T);
|
|
78
|
+
h !== -1 && (i.value[h].class[0] = t);
|
|
81
79
|
});
|
|
82
80
|
};
|
|
83
81
|
a(s.data.holiday.preholidays, "preholiday"), a(s.data.holiday.holidays, "weekend"), a(s.data.holiday.holiday, "holiday"), a(s.data.holiday.nowork, "nowork");
|
|
84
|
-
},
|
|
82
|
+
}, _ = () => {
|
|
85
83
|
if (!s.limitation || s.limitation.length < 2) return !1;
|
|
86
84
|
const a = [...s.limitation].sort(
|
|
87
85
|
(e, t) => new Date($(e.startDate)).getTime() - new Date($(t.startDate)).getTime()
|
|
@@ -96,61 +94,60 @@ const oe = { class: "sw-data-picker" }, ue = {
|
|
|
96
94
|
if (!s.limitation || s.limitation.length === 0) return !0;
|
|
97
95
|
const l = new Date(a, e, t).getTime();
|
|
98
96
|
for (let g of s.limitation) {
|
|
99
|
-
const { startDate:
|
|
100
|
-
if (!
|
|
101
|
-
const
|
|
102
|
-
if (l <=
|
|
97
|
+
const { startDate: y, endDate: T } = g;
|
|
98
|
+
if (!y && T) {
|
|
99
|
+
const h = new Date($(T)).getTime();
|
|
100
|
+
if (l <= h) return !1;
|
|
103
101
|
}
|
|
104
|
-
if (
|
|
105
|
-
const
|
|
106
|
-
if (l >=
|
|
102
|
+
if (y && !T) {
|
|
103
|
+
const h = new Date($(y)).getTime();
|
|
104
|
+
if (l >= h) return !1;
|
|
107
105
|
}
|
|
108
|
-
if (
|
|
109
|
-
const
|
|
110
|
-
if (
|
|
111
|
-
if (l >=
|
|
112
|
-
} else if (l >=
|
|
106
|
+
if (y && T) {
|
|
107
|
+
const h = new Date($(y)).getTime(), E = new Date($(T)).getTime();
|
|
108
|
+
if (h <= E) {
|
|
109
|
+
if (l >= h && l <= E) return !1;
|
|
110
|
+
} else if (l >= h || l <= E) return !1;
|
|
113
111
|
}
|
|
114
112
|
}
|
|
115
113
|
return !0;
|
|
116
114
|
}, R = (a, e) => {
|
|
117
115
|
const t = B(new Date(a.year, a.month, a.day), "{dd}.{m}.{Y}");
|
|
118
|
-
s.range === "range" ?
|
|
119
|
-
},
|
|
120
|
-
i.value.forEach((a) => a.class[1] = ""), m.value = -1,
|
|
121
|
-
},
|
|
116
|
+
s.range === "range" ? M.value !== -1 ? (K(), m.value = e, i.value[e].class[1] = "active") : m.value !== -1 ? (M.value = e, ee(m.value, M.value, t)) : (m.value = e, i.value[e].class[1] = "active") : (m.value !== -1 && (i.value[m.value].class[1] = ""), m.value = e, i.value[e].class[1] = "active", L("input", { dateStart: t, count: 1 }));
|
|
117
|
+
}, K = () => {
|
|
118
|
+
i.value.forEach((a) => a.class[1] = ""), m.value = -1, M.value = -1;
|
|
119
|
+
}, ee = (a, e, t) => {
|
|
122
120
|
let l = B(new Date(i.value[a].year, i.value[a].month, i.value[a].day), "{dd}.{m}.{Y}");
|
|
123
121
|
if (e >= a) {
|
|
124
122
|
for (let g = a + 1; g < e; g++)
|
|
125
123
|
i.value[g].class[1] = "select";
|
|
126
|
-
L("input", { dateStart: l, dateEnd: t, count:
|
|
124
|
+
L("input", { dateStart: l, dateEnd: t, count: J(a, e) });
|
|
127
125
|
} else {
|
|
128
126
|
for (let g = e + 1; g < a; g++)
|
|
129
127
|
i.value[g].class[1] = "select";
|
|
130
|
-
L("input", { dateStart: t, dateEnd: l, count:
|
|
128
|
+
L("input", { dateStart: t, dateEnd: l, count: J(e, a) });
|
|
131
129
|
}
|
|
132
130
|
i.value[e].class[1] = "active";
|
|
133
|
-
},
|
|
134
|
-
var h;
|
|
131
|
+
}, J = (a, e) => {
|
|
135
132
|
let t = Math.abs(a - e) + 1, [l, g] = [Math.min(a, e), Math.max(a, e)];
|
|
136
133
|
for (let y = l; y <= g; y++)
|
|
137
|
-
|
|
134
|
+
i.value[y]?.class[0] === "holiday" && t--;
|
|
138
135
|
return t;
|
|
139
136
|
}, p = (a, e) => {
|
|
140
|
-
P(a, e) && (C.value = new Date(a, e, 1), u.value = C.value.getFullYear(), n.value = C.value.getMonth(), O.value = new Date(a, e + 1, 1).getMonth(), (s.range === "year" || s.range === "decades") && d.value === 0 ? R({ year: a, month: e, day: 1 }, 8) :
|
|
137
|
+
P(a, e) && (C.value = new Date(a, e, 1), u.value = C.value.getFullYear(), n.value = C.value.getMonth(), O.value = new Date(a, e + 1, 1).getMonth(), (s.range === "year" || s.range === "decades") && d.value === 0 ? R({ year: a, month: e, day: 1 }, 8) : H());
|
|
141
138
|
};
|
|
142
|
-
if (
|
|
143
|
-
i.value[
|
|
144
|
-
for (let a = m.value + 1; a <
|
|
139
|
+
if (H(), _(), s.data?.startDate && (m.value = i.value.findIndex((a) => a.day === C.value.getDate() && a.month === n.value && a.year === u.value), m.value !== -1 && (i.value[m.value].class[1] = "active")), s.data?.endDate && s.range === "range" && (M.value = i.value.findIndex((a) => a.day === z.value.getDate() && a.month === q.value && a.year === W.value), M.value !== -1)) {
|
|
140
|
+
i.value[M.value].class[1] = "active";
|
|
141
|
+
for (let a = m.value + 1; a < M.value; a++)
|
|
145
142
|
i.value[a].class[1] = "select";
|
|
146
143
|
}
|
|
147
|
-
return (a, e) => (v(), r("div",
|
|
144
|
+
return (a, e) => (v(), r("div", te, [
|
|
148
145
|
o("div", null, [
|
|
149
|
-
s.range === "decades" || d.value === 3 ? (v(), r("p",
|
|
146
|
+
s.range === "decades" || d.value === 3 ? (v(), r("p", ae, [
|
|
150
147
|
o("span", null, [
|
|
151
148
|
o("button", {
|
|
152
149
|
onClick: e[0] || (e[0] = c((t) => {
|
|
153
|
-
|
|
150
|
+
Y.value -= 10, p(u.value, n.value);
|
|
154
151
|
}, ["prevent"]))
|
|
155
152
|
}, [
|
|
156
153
|
w(a.$slots, "double-arrow", {}, () => [
|
|
@@ -158,12 +155,12 @@ const oe = { class: "sw-data-picker" }, ue = {
|
|
|
158
155
|
])
|
|
159
156
|
])
|
|
160
157
|
]),
|
|
161
|
-
o("span",
|
|
158
|
+
o("span", le, f(N.value[0]) + " - " + f(N.value[11]), 1),
|
|
162
159
|
o("span", null, [
|
|
163
160
|
o("button", {
|
|
164
161
|
class: "sw-revers",
|
|
165
162
|
onClick: e[1] || (e[1] = c((t) => {
|
|
166
|
-
|
|
163
|
+
Y.value += 10, p(u.value, n.value);
|
|
167
164
|
}, ["prevent"]))
|
|
168
165
|
}, [
|
|
169
166
|
w(a.$slots, "double-arrow", {}, () => [
|
|
@@ -171,7 +168,7 @@ const oe = { class: "sw-data-picker" }, ue = {
|
|
|
171
168
|
])
|
|
172
169
|
])
|
|
173
170
|
])
|
|
174
|
-
])) : (v(), r("p",
|
|
171
|
+
])) : (v(), r("p", ne, [
|
|
175
172
|
o("span", null, [
|
|
176
173
|
o("button", {
|
|
177
174
|
onClick: e[2] || (e[2] = c((t) => p(u.value - 1, n.value), ["prevent"]))
|
|
@@ -190,13 +187,13 @@ const oe = { class: "sw-data-picker" }, ue = {
|
|
|
190
187
|
])
|
|
191
188
|
])
|
|
192
189
|
]),
|
|
193
|
-
o("span",
|
|
190
|
+
o("span", se, [
|
|
194
191
|
o("button", {
|
|
195
192
|
onClick: e[4] || (e[4] = c((t) => d.value = 3, ["prevent"]))
|
|
196
193
|
}, f(u.value), 1),
|
|
197
194
|
o("button", {
|
|
198
195
|
onClick: e[5] || (e[5] = c((t) => d.value = 1, ["prevent"]))
|
|
199
|
-
}, f(
|
|
196
|
+
}, f(F(B)(C.value.setMonth(n.value), "{F}")), 1)
|
|
200
197
|
]),
|
|
201
198
|
o("span", null, [
|
|
202
199
|
o("button", {
|
|
@@ -219,46 +216,46 @@ const oe = { class: "sw-data-picker" }, ue = {
|
|
|
219
216
|
])
|
|
220
217
|
])
|
|
221
218
|
])),
|
|
222
|
-
s.range === "year" || s.range === "decades" || d.value === 1 || d.value === 3 ? j("", !0) : (v(), r("div",
|
|
223
|
-
(v(), r(b, null,
|
|
219
|
+
s.range === "year" || s.range === "decades" || d.value === 1 || d.value === 3 ? j("", !0) : (v(), r("div", oe, [
|
|
220
|
+
(v(), r(b, null, S(7, (t, l) => o("button", {
|
|
224
221
|
key: l,
|
|
225
222
|
class: "disabled"
|
|
226
|
-
}, f(
|
|
223
|
+
}, f(F(B)(new Date(1970, 1, t + F(I)), "{D}")), 1)), 64))
|
|
227
224
|
])),
|
|
228
|
-
d.value !== 3 && s.range === "year" || d.value === 1 ? (v(), r("div",
|
|
229
|
-
(v(!0), r(b, null,
|
|
225
|
+
d.value !== 3 && s.range === "year" || d.value === 1 ? (v(), r("div", ue, [
|
|
226
|
+
(v(!0), r(b, null, S(G.value, (t, l) => (v(), r("button", {
|
|
230
227
|
key: l,
|
|
231
228
|
onClick: c((g) => {
|
|
232
229
|
d.value = 0, p(u.value, l);
|
|
233
230
|
}, ["prevent"]),
|
|
234
231
|
class: A(l === n.value ? "active" : "")
|
|
235
|
-
}, f(t), 11,
|
|
236
|
-
])) : s.range === "decades" || d.value === 3 ? (v(), r("div",
|
|
237
|
-
(v(!0), r(b, null,
|
|
232
|
+
}, f(t), 11, re))), 128))
|
|
233
|
+
])) : s.range === "decades" || d.value === 3 ? (v(), r("div", ve, [
|
|
234
|
+
(v(!0), r(b, null, S(N.value, (t, l) => (v(), r("button", {
|
|
238
235
|
key: l,
|
|
239
236
|
onClick: c((g) => {
|
|
240
237
|
d.value = s.range === "year" ? 1 : 0, p(t, n.value);
|
|
241
238
|
}, ["prevent"]),
|
|
242
|
-
class: A(
|
|
243
|
-
}, f(t), 11,
|
|
244
|
-
])) : (v(), r("div",
|
|
245
|
-
(v(!0), r(b, null,
|
|
246
|
-
l < V.value + (7 - new Date(u.value, n.value + 1, 1).getDay() +
|
|
239
|
+
class: A(Y.value + l - 1 === u.value ? "active" : "")
|
|
240
|
+
}, f(t), 11, ie))), 128))
|
|
241
|
+
])) : (v(), r("div", de, [
|
|
242
|
+
(v(!0), r(b, null, S(i.value, (t, l) => (v(), r(b, { key: l }, [
|
|
243
|
+
l < V.value + (7 - new Date(u.value, n.value + 1, 1).getDay() + F(I)) % 7 ? (v(), r("button", {
|
|
247
244
|
key: 0,
|
|
248
245
|
class: A(t.month === n.value && P(t.year, t.month, t.day) ? t.class : "disabled"),
|
|
249
246
|
onClick: c(() => {
|
|
250
247
|
t.month === n.value && R(t, l);
|
|
251
248
|
}, ["prevent"])
|
|
252
|
-
}, f(t.day), 11,
|
|
249
|
+
}, f(t.day), 11, ce)) : j("", !0)
|
|
253
250
|
], 64))), 128))
|
|
254
251
|
]))
|
|
255
252
|
]),
|
|
256
|
-
s.range === "range" ? (v(), r("div",
|
|
257
|
-
s.range === "decades" || d.value === 4 ? (v(), r("p",
|
|
253
|
+
s.range === "range" ? (v(), r("div", ge, [
|
|
254
|
+
s.range === "decades" || d.value === 4 ? (v(), r("p", pe, [
|
|
258
255
|
o("span", null, [
|
|
259
256
|
o("button", {
|
|
260
257
|
onClick: e[8] || (e[8] = c((t) => {
|
|
261
|
-
|
|
258
|
+
Y.value -= 10, p(u.value, n.value);
|
|
262
259
|
}, ["prevent"]))
|
|
263
260
|
}, [
|
|
264
261
|
w(a.$slots, "double-arrow", {}, () => [
|
|
@@ -266,12 +263,12 @@ const oe = { class: "sw-data-picker" }, ue = {
|
|
|
266
263
|
])
|
|
267
264
|
])
|
|
268
265
|
]),
|
|
269
|
-
o("span",
|
|
266
|
+
o("span", fe, f(N.value[0]) + " - " + f(N.value[11]), 1),
|
|
270
267
|
o("span", null, [
|
|
271
268
|
o("button", {
|
|
272
269
|
class: "sw-revers",
|
|
273
270
|
onClick: e[9] || (e[9] = c((t) => {
|
|
274
|
-
|
|
271
|
+
Y.value += 10, p(u.value, n.value);
|
|
275
272
|
}, ["prevent"]))
|
|
276
273
|
}, [
|
|
277
274
|
w(a.$slots, "double-arrow", {}, () => [
|
|
@@ -279,7 +276,7 @@ const oe = { class: "sw-data-picker" }, ue = {
|
|
|
279
276
|
])
|
|
280
277
|
])
|
|
281
278
|
])
|
|
282
|
-
])) : (v(), r("p",
|
|
279
|
+
])) : (v(), r("p", De, [
|
|
283
280
|
o("span", null, [
|
|
284
281
|
o("button", {
|
|
285
282
|
onClick: e[10] || (e[10] = c((t) => p(u.value - 1, n.value), ["prevent"]))
|
|
@@ -298,13 +295,13 @@ const oe = { class: "sw-data-picker" }, ue = {
|
|
|
298
295
|
])
|
|
299
296
|
])
|
|
300
297
|
]),
|
|
301
|
-
o("span",
|
|
298
|
+
o("span", me, [
|
|
302
299
|
o("button", {
|
|
303
300
|
onClick: e[12] || (e[12] = c((t) => d.value = 4, ["prevent"]))
|
|
304
301
|
}, f(new Date(u.value, n.value + 1).getFullYear()), 1),
|
|
305
302
|
o("button", {
|
|
306
303
|
onClick: e[13] || (e[13] = c((t) => d.value = 2, ["prevent"]))
|
|
307
|
-
}, f(
|
|
304
|
+
}, f(F(B)(C.value.setMonth(n.value + 1), "{F}")), 1)
|
|
308
305
|
]),
|
|
309
306
|
o("span", null, [
|
|
310
307
|
o("button", {
|
|
@@ -327,37 +324,37 @@ const oe = { class: "sw-data-picker" }, ue = {
|
|
|
327
324
|
])
|
|
328
325
|
])
|
|
329
326
|
])),
|
|
330
|
-
d.value === 2 || d.value === 4 ? j("", !0) : (v(), r("div",
|
|
331
|
-
(v(), r(b, null,
|
|
327
|
+
d.value === 2 || d.value === 4 ? j("", !0) : (v(), r("div", we, [
|
|
328
|
+
(v(), r(b, null, S(7, (t, l) => o("button", {
|
|
332
329
|
key: l,
|
|
333
330
|
class: "disabled"
|
|
334
|
-
}, f(
|
|
331
|
+
}, f(F(B)(new Date(1970, 1, t + F(I)), "{D}")), 1)), 64))
|
|
335
332
|
])),
|
|
336
|
-
d.value === 2 ? (v(), r("div",
|
|
337
|
-
(v(!0), r(b, null,
|
|
333
|
+
d.value === 2 ? (v(), r("div", ke, [
|
|
334
|
+
(v(!0), r(b, null, S(G.value, (t, l) => (v(), r("button", {
|
|
338
335
|
key: l,
|
|
339
336
|
onClick: c((g) => {
|
|
340
337
|
d.value = 0, p(u.value, l - 1);
|
|
341
338
|
}, ["prevent"]),
|
|
342
339
|
class: A(l === (n.value + 1) % 12 ? "active" : "")
|
|
343
|
-
}, f(t), 11,
|
|
344
|
-
])) : d.value === 4 ? (v(), r("div",
|
|
345
|
-
(v(!0), r(b, null,
|
|
340
|
+
}, f(t), 11, ye))), 128))
|
|
341
|
+
])) : d.value === 4 ? (v(), r("div", he, [
|
|
342
|
+
(v(!0), r(b, null, S(N.value, (t, l) => (v(), r("button", {
|
|
346
343
|
key: l,
|
|
347
344
|
onClick: c((g) => {
|
|
348
345
|
d.value = 0, p(t, n.value);
|
|
349
346
|
}, ["prevent"]),
|
|
350
|
-
class: A(
|
|
351
|
-
}, f(t), 11,
|
|
352
|
-
])) : (v(), r("div",
|
|
353
|
-
(v(!0), r(b, null,
|
|
354
|
-
l >= V.value - (7 + new Date(u.value, n.value + 1, 1).getDay() -
|
|
347
|
+
class: A(Y.value + l - 1 === u.value ? "active" : "")
|
|
348
|
+
}, f(t), 11, be))), 128))
|
|
349
|
+
])) : (v(), r("div", $e, [
|
|
350
|
+
(v(!0), r(b, null, S(i.value, (t, l) => (v(), r(b, { key: l }, [
|
|
351
|
+
l >= V.value - (7 + new Date(u.value, n.value + 1, 1).getDay() - F(I)) % 7 ? (v(), r("button", {
|
|
355
352
|
key: 0,
|
|
356
353
|
class: A(t.month === O.value && P(t.year, t.month, t.day) ? t.class : "disabled"),
|
|
357
354
|
onClick: c(() => {
|
|
358
355
|
t.month === O.value && R(t, l);
|
|
359
356
|
}, ["prevent"])
|
|
360
|
-
}, f(t.day), 11,
|
|
357
|
+
}, f(t.day), 11, Ce)) : j("", !0)
|
|
361
358
|
], 64))), 128))
|
|
362
359
|
]))
|
|
363
360
|
])) : j("", !0)
|
|
@@ -365,5 +362,5 @@ const oe = { class: "sw-data-picker" }, ue = {
|
|
|
365
362
|
}
|
|
366
363
|
};
|
|
367
364
|
export {
|
|
368
|
-
|
|
365
|
+
Se as default
|
|
369
366
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed as o, createElementBlock as r, openBlock as l, normalizeClass as c, createBlock as a, createCommentVNode as i, renderSlot as p } from "vue";
|
|
2
|
-
import { _ as u } from "./index-
|
|
2
|
+
import { _ as u } from "./index-DeMssusd.js";
|
|
3
3
|
const y = {
|
|
4
4
|
__name: "SwDropdownItem",
|
|
5
5
|
props: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { mergeModels as
|
|
2
|
-
import
|
|
1
|
+
import { mergeModels as E, ref as c, useModel as V, watchEffect as b, onMounted as L, createElementBlock as N, openBlock as R, createElementVNode as r, createVNode as u, withCtx as a, renderSlot as d, createTextVNode as v, toDisplayString as k, normalizeClass as z } from "vue";
|
|
2
|
+
import M from "./SwDropdown-DQGTnnKw.js";
|
|
3
3
|
import f from "./SwButton-85-tKHA7.js";
|
|
4
|
-
import { _ as
|
|
5
|
-
const
|
|
4
|
+
import { _ as h } from "./index-DeMssusd.js";
|
|
5
|
+
const B = ["src"], q = {
|
|
6
6
|
__name: "SwGide",
|
|
7
|
-
props: /* @__PURE__ */
|
|
7
|
+
props: /* @__PURE__ */ E({
|
|
8
8
|
steps: { type: Array, default: () => [] },
|
|
9
9
|
iconClose: { type: String, default: "" },
|
|
10
10
|
maxWidth: { type: Number, default: 250 }
|
|
@@ -12,14 +12,14 @@ const G = ["src"], A = {
|
|
|
12
12
|
modelValue: { type: Number, default: 0 },
|
|
13
13
|
modelModifiers: {}
|
|
14
14
|
}),
|
|
15
|
-
emits: /* @__PURE__ */
|
|
16
|
-
setup(w, { emit:
|
|
17
|
-
const n = c(null), g = c(!0), i = c(null), o =
|
|
15
|
+
emits: /* @__PURE__ */ E(["close"], ["update:modelValue"]),
|
|
16
|
+
setup(w, { emit: C }) {
|
|
17
|
+
const n = c(null), g = c(!0), i = c(null), o = V(w, "modelValue"), S = C, s = w, y = () => S("close"), x = (t) => {
|
|
18
18
|
const e = o.value + t;
|
|
19
19
|
e < 0 ? o.value = 0 : e >= s.steps.length ? y() : o.value = e;
|
|
20
20
|
};
|
|
21
21
|
let m = !1;
|
|
22
|
-
const
|
|
22
|
+
const T = (t) => {
|
|
23
23
|
const e = t.getBoundingClientRect(), l = window.innerHeight;
|
|
24
24
|
e.top < 5 ? (m = !0, document.documentElement.scrollTop += e.top - 5) : e.bottom > l - 5 && (m = !0, document.documentElement.scrollTop += e.bottom - l + 5);
|
|
25
25
|
}, p = () => {
|
|
@@ -27,10 +27,9 @@ const G = ["src"], A = {
|
|
|
27
27
|
const t = i.value.getBoundingClientRect(), e = window.pageYOffset || document.documentElement.scrollTop, l = window.pageXOffset || document.documentElement.scrollLeft;
|
|
28
28
|
n.value.style.gridTemplateRows = `${t.top + e - 5}px ${t.height + 10}px 1fr`, n.value.style.gridTemplateColumns = `${t.left + l - 5}px ${t.width + 10}px 1fr`, n.value.style.height = document.documentElement.scrollHeight + "px";
|
|
29
29
|
};
|
|
30
|
-
return
|
|
31
|
-
var E;
|
|
30
|
+
return b((t) => {
|
|
32
31
|
if (!n.value) return;
|
|
33
|
-
const e =
|
|
32
|
+
const e = s.steps[o.value]?.tag;
|
|
34
33
|
if (!e || !e.trim()) {
|
|
35
34
|
n.value.style.gridTemplateRows = "40% 0 1fr", n.value.style.gridTemplateColumns = "1fr 0 1fr", n.value.style.height = document.documentElement.scrollHeight + "px";
|
|
36
35
|
return;
|
|
@@ -39,7 +38,7 @@ const G = ["src"], A = {
|
|
|
39
38
|
console.warn(`[SwGuide] Элемент не найден: ${e}`);
|
|
40
39
|
return;
|
|
41
40
|
}
|
|
42
|
-
|
|
41
|
+
T(i.value);
|
|
43
42
|
const l = () => {
|
|
44
43
|
if (m) {
|
|
45
44
|
m = !1;
|
|
@@ -52,17 +51,14 @@ const G = ["src"], A = {
|
|
|
52
51
|
$.observe(i.value), window.addEventListener("resize", l), window.addEventListener("scroll", l, { passive: !0 }), t(() => {
|
|
53
52
|
$.disconnect(), window.removeEventListener("resize", l), window.removeEventListener("scroll", l);
|
|
54
53
|
});
|
|
55
|
-
}),
|
|
56
|
-
var t;
|
|
57
|
-
return i.value = document.querySelector((t = s.steps[o.value]) == null ? void 0 : t.tag);
|
|
58
|
-
}), (t, e) => (z(), R("div", {
|
|
54
|
+
}), L(() => window.onload = () => i.value = document.querySelector(s.steps[o.value]?.tag)), (t, e) => (R(), N("div", {
|
|
59
55
|
class: "sw-gide",
|
|
60
56
|
ref_key: "swGide",
|
|
61
57
|
ref: n
|
|
62
58
|
}, [
|
|
63
59
|
e[6] || (e[6] = r("div", { class: "overlay0" }, null, -1)),
|
|
64
60
|
e[7] || (e[7] = r("div", { class: "overlay1" }, null, -1)),
|
|
65
|
-
u(
|
|
61
|
+
u(M, {
|
|
66
62
|
class: "gide",
|
|
67
63
|
trigger: "none",
|
|
68
64
|
placement: s.steps[o.value].placement,
|
|
@@ -73,14 +69,14 @@ const G = ["src"], A = {
|
|
|
73
69
|
dropdown: a(() => [
|
|
74
70
|
r("header", null, [
|
|
75
71
|
d(t.$slots, "header", {}, () => [
|
|
76
|
-
v(
|
|
72
|
+
v(k(s.steps[o.value].header) + " ", 1),
|
|
77
73
|
u(f, {
|
|
78
74
|
type: "primary",
|
|
79
75
|
link: "",
|
|
80
76
|
onClick: y
|
|
81
77
|
}, {
|
|
82
78
|
default: a(() => [
|
|
83
|
-
u(
|
|
79
|
+
u(h, {
|
|
84
80
|
"icon-class": s.iconClose
|
|
85
81
|
}, null, 8, ["icon-class"])
|
|
86
82
|
]),
|
|
@@ -88,16 +84,13 @@ const G = ["src"], A = {
|
|
|
88
84
|
})
|
|
89
85
|
])
|
|
90
86
|
]),
|
|
91
|
-
d(t.$slots, "default", {}, () =>
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}, null, 10, G)
|
|
99
|
-
];
|
|
100
|
-
}),
|
|
87
|
+
d(t.$slots, "default", {}, () => [
|
|
88
|
+
r("div", null, k(s.steps[o.value].text), 1),
|
|
89
|
+
r("img", {
|
|
90
|
+
class: z(/left/.test(s.steps[o.value]?.placement) ? "reflect" : null),
|
|
91
|
+
src: s.steps[o.value].img
|
|
92
|
+
}, null, 10, B)
|
|
93
|
+
]),
|
|
101
94
|
r("footer", null, [
|
|
102
95
|
d(t.$slots, "footer", {}, () => [
|
|
103
96
|
u(f, {
|
|
@@ -141,5 +134,5 @@ const G = ["src"], A = {
|
|
|
141
134
|
}
|
|
142
135
|
};
|
|
143
136
|
export {
|
|
144
|
-
|
|
137
|
+
q as default
|
|
145
138
|
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { mergeModels as i, useModel as x, ref as k, computed as _, watch as z, createElementBlock as r, openBlock as a, normalizeClass as q, createBlock as f, renderSlot as p, createCommentVNode as c, withDirectives as N, createTextVNode as V, toDisplayString as w, createElementVNode as B, mergeProps as M, vModelDynamic as C } from "vue";
|
|
2
|
+
import { f as $, _ as d } from "./index-DeMssusd.js";
|
|
3
|
+
const D = ["for"], I = {
|
|
4
|
+
key: 0,
|
|
5
|
+
title: "Это поле обязательно для заполнения."
|
|
6
|
+
}, E = ["required", "placeholder", "type", "id", "name", "size", "maxlength", "minlength", "autofocus"], F = {
|
|
7
|
+
__name: "SwInput",
|
|
8
|
+
props: /* @__PURE__ */ i({
|
|
9
|
+
before: { type: String, default: "" },
|
|
10
|
+
after: { type: String, default: "" },
|
|
11
|
+
placeholder: { type: String, default: "" },
|
|
12
|
+
label: { type: String, default: "" },
|
|
13
|
+
name: { type: String, required: !0 },
|
|
14
|
+
class: { type: String, default: "" },
|
|
15
|
+
size: { type: String, default: "" },
|
|
16
|
+
type: { type: String, default: "text" },
|
|
17
|
+
inputMode: { type: String, default: "text" },
|
|
18
|
+
required: { type: Boolean, default: !1 },
|
|
19
|
+
maxlength: { type: Number, default: 128 },
|
|
20
|
+
minlength: { type: Number, default: 1 },
|
|
21
|
+
inputSize: { type: Number, default: 60 }
|
|
22
|
+
}, {
|
|
23
|
+
modelValue: {},
|
|
24
|
+
modelModifiers: {}
|
|
25
|
+
}),
|
|
26
|
+
emits: /* @__PURE__ */ i(["suffix", "prefix", "focusInput"], ["update:modelValue"]),
|
|
27
|
+
setup(s, { emit: m }) {
|
|
28
|
+
const l = x(s, "modelValue"), e = s, n = k(null), u = m, g = (t) => {
|
|
29
|
+
u("focusInput"), t.target.setSelectionRange(l.value.length, l.value.length), n.value !== null && (n.value.style.top = "-.6em");
|
|
30
|
+
}, h = (t) => {
|
|
31
|
+
l.value?.length === 0 && n.value !== null && n.value.removeAttribute("style");
|
|
32
|
+
};
|
|
33
|
+
l.value?.length > 0 && n.value !== null && (n.value.style.top = "-.6em");
|
|
34
|
+
const y = () => {
|
|
35
|
+
u("suffix");
|
|
36
|
+
}, v = () => {
|
|
37
|
+
u("prefix");
|
|
38
|
+
}, b = _(
|
|
39
|
+
() => {
|
|
40
|
+
let t = ["sw-input"];
|
|
41
|
+
return e.size.length > 0 && t.push("sw-" + e.size), e.class.length > 0 && t.push(e.class), t;
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
return z(l, (t, o) => {
|
|
45
|
+
e.type === "phone" && (l.value = $(t, o));
|
|
46
|
+
}), (t, o) => (a(), r("div", {
|
|
47
|
+
class: q(b.value)
|
|
48
|
+
}, [
|
|
49
|
+
e.before.length > 0 ? (a(), f(d, {
|
|
50
|
+
key: 0,
|
|
51
|
+
"icon-class": e.before,
|
|
52
|
+
onClick: v
|
|
53
|
+
}, null, 8, ["icon-class"])) : p(t.$slots, "prefix", { key: 1 }),
|
|
54
|
+
e.label.length > 0 ? (a(), r("label", {
|
|
55
|
+
key: 2,
|
|
56
|
+
for: e.name,
|
|
57
|
+
ref_key: "lab",
|
|
58
|
+
ref: n
|
|
59
|
+
}, [
|
|
60
|
+
V(w(e.label), 1),
|
|
61
|
+
e.required ? (a(), r("span", I, "*")) : c("", !0)
|
|
62
|
+
], 8, D)) : c("", !0),
|
|
63
|
+
N(B("input", M({
|
|
64
|
+
"onUpdate:modelValue": o[0] || (o[0] = (S) => l.value = S),
|
|
65
|
+
required: e.required,
|
|
66
|
+
placeholder: e.required && e.label.length === 0 ? e.placeholder + "*" : e.placeholder,
|
|
67
|
+
type: e.type,
|
|
68
|
+
id: e.name,
|
|
69
|
+
name: e.name,
|
|
70
|
+
size: e.inputSize,
|
|
71
|
+
onFocus: g,
|
|
72
|
+
onBlur: h,
|
|
73
|
+
maxlength: e.maxlength,
|
|
74
|
+
minlength: e.minlength,
|
|
75
|
+
autofocus: e.autofocus
|
|
76
|
+
}, t.$attrs), null, 16, E), [
|
|
77
|
+
[C, l.value]
|
|
78
|
+
]),
|
|
79
|
+
e.after.length > 0 ? (a(), f(d, {
|
|
80
|
+
key: 3,
|
|
81
|
+
"icon-class": e.after,
|
|
82
|
+
onClick: y
|
|
83
|
+
}, null, 8, ["icon-class"])) : p(t.$slots, "suffix", { key: 4 })
|
|
84
|
+
], 2));
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
export {
|
|
88
|
+
F as default
|
|
89
|
+
};
|