mhz-ui 1.2.49 → 1.2.50
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 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._container_kayn8_1{width:100%;overflow:hidden;border:1px solid var(--color-gray);border-radius:8px}._container_kayn8_1 ._titleBar_kayn8_7{display:flex;align-items:center;justify-content:space-between;height:40px;padding:8px;font-weight:700;background-color:var(--color-gray-light-extra);border-bottom:1px solid var(--color-gray);border-top-left-radius:8px;border-top-right-radius:8px}._container_kayn8_1 ._titleBar_kayn8_7 ._navButton_kayn8_19{padding:0 8px;font-size:1.25rem;cursor:pointer;background:none;border:none}._container_kayn8_1 ._headings_kayn8_26{display:grid;grid-template-columns:repeat(7,1fr);height:37px;border-bottom:1px solid var(--color-gray)}._container_kayn8_1 ._headings_kayn8_26 ._weekday_kayn8_32{display:flex;align-items:center;justify-content:center;text-transform:capitalize}._container_kayn8_1 ._body_kayn8_38{display:grid;grid-template-columns:repeat(7,1fr);grid-auto-rows:minmax(72px,auto);gap:0}._container_kayn8_1 ._cell_kayn8_44{display:flex;flex-direction:column;gap:2px;align-items:center;justify-content:flex-start;min-height:72px;padding:2px;background-color:var(--color-white);box-shadow:0 0 0 .2px var(--color-gray) inset}._container_kayn8_1 ._cell_kayn8_44._today_kayn8_55 ._cellDate_kayn8_55{font-weight:700}._container_kayn8_1 ._cell_kayn8_44._outOfRange_kayn8_58{cursor:not-allowed}._container_kayn8_1 ._cell_kayn8_44._outOfRange_kayn8_58 ._cellDate_kayn8_55{color:var(--color-gray)}._container_kayn8_1 ._cellDate_kayn8_55{display:flex;align-items:center;justify-content:center}._container_kayn8_1 ._cellEvents_kayn8_69{display:flex;flex-direction:column;gap:4px;align-items:center;justify-content:flex-start;max-height:calc(100% - 24px);padding-bottom:6px}._container_kayn8_1 ._event_kayn8_78{display:flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;cursor:pointer;-webkit-user-select:none;user-select:none;border:none;border-radius:12px;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}._container_kayn8_1 ._title_kayn8_7{display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:1.125rem;font-weight:700;line-height:1;color:var(--color-gray-light)}.dark ._container_kayn8_1{border-color:var(--color-gray-dark-extra)}.dark ._container_kayn8_1 ._header_kayn8_108{color:var(--color-white);background-color:var(--color-primary-dark);border-bottom-color:var(--color-gray-dark-extra)}.dark ._container_kayn8_1 ._header_kayn8_108 ._titleBar_kayn8_7{background-color:var(--color-primary-dark);border-bottom-color:var(--color-gray-dark-extra)}.dark ._container_kayn8_1 ._header_kayn8_108 ._navButton_kayn8_19{color:var(--color-gray-dark)}.dark ._container_kayn8_1 ._header_kayn8_108 ._headings_kayn8_26{color:var(--color-white);background-color:var(--color-black);border-right:1px solid var(--color-gray-dark-extra);border-bottom:none;border-left:1px solid var(--color-gray-dark-extra)}.dark ._container_kayn8_1 ._cell_kayn8_44{background-color:var(--color-black);box-shadow:0 0 0 .2px var(--color-gray-dark) inset}.dark ._container_kayn8_1 ._cell_kayn8_44 ._cellDate_kayn8_55{color:var(--color-white)}.dark ._container_kayn8_1 ._cell_kayn8_44._outOfRange_kayn8_58 ._cellDate_kayn8_55{color:var(--color-gray-dark)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./UiCalendar.css";
|
|
2
|
-
import { defineComponent as L, ref as z, computed as
|
|
2
|
+
import { defineComponent as L, ref as z, computed as d, onBeforeMount as A, createElementBlock as c, openBlock as u, normalizeClass as a, createElementVNode as l, toDisplayString as i, Fragment as h, renderList as k, withModifiers as H, normalizeStyle as N } from "vue";
|
|
3
3
|
import { _ as P } from "../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
4
|
const V = ["onClick"], W = ["onClick"], j = /* @__PURE__ */ L({
|
|
5
5
|
__name: "UiCalendar",
|
|
@@ -10,57 +10,57 @@ const V = ["onClick"], W = ["onClick"], j = /* @__PURE__ */ L({
|
|
|
10
10
|
},
|
|
11
11
|
emits: ["update", "eventClick", "chooseDate"],
|
|
12
12
|
setup(C, { emit: B }) {
|
|
13
|
-
const
|
|
13
|
+
const y = C, D = B, s = z(/* @__PURE__ */ new Date()), m = d(() => {
|
|
14
14
|
const e = /* @__PURE__ */ new Date();
|
|
15
15
|
return e.setHours(0, 0, 0, 0), e;
|
|
16
|
-
}),
|
|
16
|
+
}), p = d(() => new Date(s.value.getFullYear(), s.value.getMonth(), 1)), O = d(() => {
|
|
17
17
|
const e = { month: "long", year: "numeric" };
|
|
18
|
-
let t =
|
|
19
|
-
return t.length > 0 && (t = t.charAt(0).toUpperCase() + t.slice(1)),
|
|
20
|
-
}), b =
|
|
21
|
-
const e = new Date(
|
|
18
|
+
let t = p.value.toLocaleDateString(y.lang, e);
|
|
19
|
+
return t.length > 0 && (t = t.charAt(0).toUpperCase() + t.slice(1)), y.lang === "ru" && (t = t.replace(/ г\.$/, "")), t;
|
|
20
|
+
}), b = d(() => {
|
|
21
|
+
const e = new Date(p.value);
|
|
22
22
|
e.setDate(1);
|
|
23
23
|
const t = (e.getDay() + 6) % 7;
|
|
24
24
|
return e.setDate(e.getDate() - t), Array.from({ length: 7 }, (n, r) => {
|
|
25
25
|
const o = new Date(e);
|
|
26
|
-
return o.setDate(e.getDate() + r), o.toLocaleDateString(
|
|
26
|
+
return o.setDate(e.getDate() + r), o.toLocaleDateString(y.lang, { weekday: "short" });
|
|
27
27
|
});
|
|
28
|
-
}), g =
|
|
28
|
+
}), g = d(() => {
|
|
29
29
|
const e = new Date(s.value.getFullYear(), s.value.getMonth(), 1), t = new Date(s.value.getFullYear(), s.value.getMonth() + 1, 0), n = (e.getDay() + 6) % 7, r = new Date(e);
|
|
30
30
|
r.setDate(e.getDate() - n);
|
|
31
|
-
const o = (7 - t.getDay()) % 7,
|
|
32
|
-
|
|
33
|
-
const U = Math.floor((
|
|
34
|
-
for (let
|
|
31
|
+
const o = (7 - t.getDay()) % 7, _ = new Date(t);
|
|
32
|
+
_.setDate(t.getDate() + o);
|
|
33
|
+
const U = Math.floor((_.getTime() - r.getTime()) / (1e3 * 60 * 60 * 24)) + 1, M = [];
|
|
34
|
+
for (let f = 0; f < U; f++) {
|
|
35
35
|
const $ = new Date(r);
|
|
36
|
-
$.setDate(r.getDate() +
|
|
36
|
+
$.setDate(r.getDate() + f), M.push($);
|
|
37
37
|
}
|
|
38
38
|
return M;
|
|
39
|
-
}),
|
|
39
|
+
}), v = () => {
|
|
40
40
|
const e = { dateFrom: g.value[0], dateTo: g.value.at(-1) };
|
|
41
|
-
|
|
42
|
-
}, F = (e) =>
|
|
41
|
+
D("update", e);
|
|
42
|
+
}, F = (e) => y.events.filter((t) => {
|
|
43
43
|
if (!t.start) return !1;
|
|
44
44
|
const n = new Date(t.start);
|
|
45
45
|
return n.getDate() === e.getDate() && n.getMonth() === e.getMonth() && n.getFullYear() === e.getFullYear();
|
|
46
|
-
}), E = (e) => e.toDateString() ===
|
|
47
|
-
if (
|
|
46
|
+
}), E = (e) => e.toDateString() === m.value.toDateString(), w = (e) => {
|
|
47
|
+
if (y.isDisablePastDates) {
|
|
48
48
|
const t = new Date(e);
|
|
49
|
-
if (t.setHours(0, 0, 0, 0), t <
|
|
49
|
+
if (t.setHours(0, 0, 0, 0), t < m.value) return !0;
|
|
50
50
|
}
|
|
51
51
|
return !1;
|
|
52
52
|
}, Y = () => {
|
|
53
|
-
s.value = new Date(s.value.getFullYear(), s.value.getMonth() - 1, 1),
|
|
53
|
+
s.value = new Date(s.value.getFullYear(), s.value.getMonth() - 1, 1), v();
|
|
54
54
|
}, S = () => {
|
|
55
|
-
s.value = new Date(s.value.getFullYear(), s.value.getMonth() + 1, 1),
|
|
55
|
+
s.value = new Date(s.value.getFullYear(), s.value.getMonth() + 1, 1), v();
|
|
56
56
|
}, R = (e) => {
|
|
57
|
-
|
|
57
|
+
D("eventClick", e);
|
|
58
58
|
}, T = (e) => {
|
|
59
|
-
w(e) ||
|
|
59
|
+
w(e) || D("chooseDate", e);
|
|
60
60
|
};
|
|
61
61
|
return A(() => {
|
|
62
|
-
|
|
63
|
-
}), (e, t) => (
|
|
62
|
+
v();
|
|
63
|
+
}), (e, t) => (u(), c("div", {
|
|
64
64
|
class: a(e.$style.container)
|
|
65
65
|
}, [
|
|
66
66
|
l("div", {
|
|
@@ -73,53 +73,53 @@ const V = ["onClick"], W = ["onClick"], j = /* @__PURE__ */ L({
|
|
|
73
73
|
onClick: Y,
|
|
74
74
|
class: a(e.$style.navButton),
|
|
75
75
|
type: "button"
|
|
76
|
-
},
|
|
77
|
-
l("span", null,
|
|
76
|
+
}, i("<"), 2),
|
|
77
|
+
l("span", null, i(O.value), 1),
|
|
78
78
|
l("button", {
|
|
79
79
|
onClick: S,
|
|
80
80
|
class: a(e.$style.navButton),
|
|
81
81
|
type: "button"
|
|
82
|
-
},
|
|
82
|
+
}, i(">"), 2)
|
|
83
83
|
], 2),
|
|
84
84
|
l("div", {
|
|
85
85
|
class: a(e.$style.headings)
|
|
86
86
|
}, [
|
|
87
|
-
(
|
|
87
|
+
(u(!0), c(h, null, k(b.value, (n) => (u(), c("div", {
|
|
88
88
|
key: n,
|
|
89
89
|
class: a(e.$style.weekday)
|
|
90
|
-
},
|
|
90
|
+
}, i(n), 3))), 128))
|
|
91
91
|
], 2)
|
|
92
92
|
], 2),
|
|
93
93
|
l("div", {
|
|
94
94
|
class: a(e.$style.body)
|
|
95
95
|
}, [
|
|
96
|
-
(
|
|
96
|
+
(u(!0), c(h, null, k(g.value, (n, r) => (u(), c("div", {
|
|
97
97
|
key: r,
|
|
98
98
|
class: a([e.$style.cell, { [e.$style.today]: E(n), [e.$style.outOfRange]: w(n) }]),
|
|
99
99
|
onClick: (o) => T(n)
|
|
100
100
|
}, [
|
|
101
101
|
l("div", {
|
|
102
102
|
class: a(e.$style.cellDate)
|
|
103
|
-
},
|
|
103
|
+
}, i(n.getDate()), 3),
|
|
104
104
|
l("div", {
|
|
105
105
|
class: a(e.$style.cellEvents)
|
|
106
106
|
}, [
|
|
107
|
-
(
|
|
107
|
+
(u(!0), c(h, null, k(F(n), (o) => (u(), c("div", {
|
|
108
108
|
key: o.id,
|
|
109
109
|
class: a(e.$style.event),
|
|
110
110
|
style: N({ background: o.color }),
|
|
111
|
-
onClick: H((
|
|
111
|
+
onClick: H((_) => R(o), ["stop"])
|
|
112
112
|
}, [
|
|
113
113
|
l("div", {
|
|
114
114
|
class: a(e.$style.title)
|
|
115
|
-
},
|
|
115
|
+
}, i(o.title), 3)
|
|
116
116
|
], 14, W))), 128))
|
|
117
117
|
], 2)
|
|
118
118
|
], 10, V))), 128))
|
|
119
119
|
], 2)
|
|
120
120
|
], 2));
|
|
121
121
|
}
|
|
122
|
-
}), q = "
|
|
122
|
+
}), q = "_container_kayn8_1", G = "_titleBar_kayn8_7", I = "_navButton_kayn8_19", J = "_headings_kayn8_26", K = "_weekday_kayn8_32", Q = "_body_kayn8_38", X = "_cell_kayn8_44", Z = "_today_kayn8_55", x = "_cellDate_kayn8_55", ee = "_outOfRange_kayn8_58", te = "_cellEvents_kayn8_69", ne = "_event_kayn8_78", ae = "_title_kayn8_7", se = "_header_kayn8_108", oe = {
|
|
123
123
|
container: q,
|
|
124
124
|
titleBar: G,
|
|
125
125
|
navButton: I,
|
|
@@ -136,7 +136,7 @@ const V = ["onClick"], W = ["onClick"], j = /* @__PURE__ */ L({
|
|
|
136
136
|
header: se
|
|
137
137
|
}, le = {
|
|
138
138
|
$style: oe
|
|
139
|
-
},
|
|
139
|
+
}, ue = /* @__PURE__ */ P(j, [["__cssModules", le]]);
|
|
140
140
|
export {
|
|
141
|
-
|
|
141
|
+
ue as default
|
|
142
142
|
};
|