mhz-ui 1.3.21 → 1.3.23

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.
Files changed (59) hide show
  1. package/dist/UiBreadcrumbs/UiBreadcrumbs.css +1 -1
  2. package/dist/UiBreadcrumbs/UiBreadcrumbs.js +61 -63
  3. package/dist/UiButton/UiButton.css +1 -1
  4. package/dist/UiButton/UiButton.js +2 -41
  5. package/dist/UiButton-DkJNVTgF.js +45 -0
  6. package/dist/UiButtongroup/UiButtongroup.css +1 -1
  7. package/dist/UiButtongroup/UiButtongroup.js +50 -60
  8. package/dist/UiCalendar/UiCalendar.css +1 -1
  9. package/dist/UiCalendar/UiCalendar.js +128 -157
  10. package/dist/UiChart/UiChart.css +1 -1
  11. package/dist/UiChart/UiChart.js +7573 -8093
  12. package/dist/UiCheckbox/UiCheckbox.css +1 -1
  13. package/dist/UiCheckbox/UiCheckbox.js +116 -105
  14. package/dist/UiChip/UiChip.css +1 -1
  15. package/dist/UiChip/UiChip.js +48 -56
  16. package/dist/UiClose/UiClose.css +1 -1
  17. package/dist/UiClose/UiClose.js +2 -33
  18. package/dist/UiClose-BQmeCbRi.js +22 -0
  19. package/dist/UiEditor/UiEditor.css +1 -1
  20. package/dist/UiEditor/UiEditor.js +13012 -16496
  21. package/dist/UiField/UiField.css +1 -1
  22. package/dist/UiField/UiField.js +29 -42
  23. package/dist/UiFlex/UiFlex.css +1 -1
  24. package/dist/UiFlex/UiFlex.js +42 -43
  25. package/dist/UiInput/UiInput.css +1 -1
  26. package/dist/UiInput/UiInput.js +2 -125
  27. package/dist/UiInput-DHFttLTG.js +133 -0
  28. package/dist/UiModal/UiModal.css +1 -1
  29. package/dist/UiModal/UiModal.js +74 -106
  30. package/dist/UiPagination/UiPagination.css +1 -1
  31. package/dist/UiPagination/UiPagination.js +50 -58
  32. package/dist/UiRange/UiRange.css +1 -1
  33. package/dist/UiRange/UiRange.js +1384 -918
  34. package/dist/UiSearch/UiSearch.css +1 -1
  35. package/dist/UiSearch/UiSearch.js +118 -143
  36. package/dist/UiSelect/UiSelect.css +1 -1
  37. package/dist/UiSelect/UiSelect.js +167 -171
  38. package/dist/UiSlider/UiSlider.css +1 -1
  39. package/dist/UiSlider/UiSlider.js +41 -56
  40. package/dist/UiSpoiler/UiSpoiler.css +1 -1
  41. package/dist/UiSpoiler/UiSpoiler.js +51 -79
  42. package/dist/UiTable/UiTable.css +1 -1
  43. package/dist/UiTable/UiTable.js +76 -97
  44. package/dist/UiTabs/UiTabs.css +1 -1
  45. package/dist/UiTabs/UiTabs.js +24 -32
  46. package/dist/UiTextarea/UiTextarea.css +1 -1
  47. package/dist/UiTextarea/UiTextarea.js +25 -31
  48. package/dist/UiUpload/UiUpload.css +1 -1
  49. package/dist/UiUpload/UiUpload.js +123 -166
  50. package/dist/_plugin-vue_export-helper-Bt71PsSa.js +6 -0
  51. package/dist/dist-CLA-k87a.js +109 -0
  52. package/dist/locales-DIKIa9I3.js +29 -0
  53. package/dist/stubs/stubs.js +13 -15
  54. package/dist/toast/toast.css +1 -1
  55. package/dist/toast/toast.js +43 -41
  56. package/package.json +29 -29
  57. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  58. package/dist/index-DajWja1y.js +0 -31
  59. package/dist/index-Dvnq-rTV.js +0 -109
@@ -1,158 +1,129 @@
1
1
  import "./UiCalendar.css";
2
- import { defineComponent as U, ref as H, computed as D, onBeforeMount as L, createElementBlock as c, openBlock as u, normalizeClass as a, createElementVNode as l, toDisplayString as d, Fragment as h, renderList as w, withModifiers as P, normalizeStyle as z } from "vue";
3
- import { _ as A } from "../_plugin-vue_export-helper-CHgC5LLL.js";
4
- const N = ["onClick", "data-choose"], V = ["onClick"], W = /* @__PURE__ */ U({
5
- __name: "UiCalendar",
6
- props: {
7
- isDisablePastDates: { type: Boolean },
8
- events: { default: () => [] },
9
- lang: { default: "ru" }
10
- },
11
- emits: ["update", "eventClick", "chooseDate"],
12
- setup(C, { emit: q }) {
13
- const i = C, y = q, s = H(/* @__PURE__ */ new Date()), m = D(() => {
14
- const e = /* @__PURE__ */ new Date();
15
- return e.setHours(0, 0, 0, 0), e;
16
- }), p = D(() => new Date(s.value.getFullYear(), s.value.getMonth(), 1)), B = D(() => {
17
- const e = { month: "long", year: "numeric" };
18
- let t = p.value.toLocaleDateString(i.lang, e);
19
- return t.length > 0 && (t = t.charAt(0).toUpperCase() + t.slice(1)), i.lang === "ru" && (t = t.replace(/ г\.$/, "")), t;
20
- }), b = D(() => {
21
- const e = new Date(p.value);
22
- e.setDate(1);
23
- const t = (e.getDay() + 6) % 7;
24
- return e.setDate(e.getDate() - t), Array.from({ length: 7 }, (n, r) => {
25
- const o = new Date(e);
26
- return o.setDate(e.getDate() + r), o.toLocaleDateString(i.lang, { weekday: "short" });
27
- });
28
- }), g = D(() => {
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
- r.setDate(e.getDate() - n);
31
- const o = (7 - t.getDay()) % 7, f = new Date(t);
32
- f.setDate(t.getDate() + o);
33
- const T = Math.floor((f.getTime() - r.getTime()) / (1e3 * 60 * 60 * 24)) + 1, M = [];
34
- for (let _ = 0; _ < T; _++) {
35
- const $ = new Date(r);
36
- $.setDate(r.getDate() + _), M.push($);
37
- }
38
- return M;
39
- });
40
- function v() {
41
- const e = {
42
- dateFrom: g.value[0],
43
- dateTo: new Date(g.value.at(-1)?.setHours(23, 59, 59))
44
- };
45
- y("update", e);
46
- }
47
- function O(e) {
48
- return i.events.filter((t) => {
49
- if (!t.start) return !1;
50
- const n = new Date(t.start);
51
- return n.getDate() === e.getDate() && n.getMonth() === e.getMonth() && n.getFullYear() === e.getFullYear();
52
- });
53
- }
54
- function F(e) {
55
- return e.toDateString() === m.value.toDateString();
56
- }
57
- function k(e) {
58
- if (i.isDisablePastDates) {
59
- const t = new Date(e);
60
- if (t.setHours(0, 0, 0, 0), t < m.value) return !0;
61
- }
62
- return !1;
63
- }
64
- function E() {
65
- s.value = new Date(s.value.getFullYear(), s.value.getMonth() - 1, 1), v();
66
- }
67
- function Y() {
68
- s.value = new Date(s.value.getFullYear(), s.value.getMonth() + 1, 1), v();
69
- }
70
- function S(e) {
71
- y("eventClick", e);
72
- }
73
- function R(e) {
74
- k(e) || y("chooseDate", e);
75
- }
76
- return L(() => {
77
- v();
78
- }), (e, t) => (u(), c("div", {
79
- class: a(e.$style.container)
80
- }, [
81
- l("div", {
82
- class: a(e.$style.header)
83
- }, [
84
- l("div", {
85
- class: a(e.$style.titleBar)
86
- }, [
87
- l("button", {
88
- onClick: E,
89
- class: a(e.$style.navButton),
90
- type: "button"
91
- }, d("<"), 2),
92
- l("span", null, d(B.value), 1),
93
- l("button", {
94
- onClick: Y,
95
- class: a(e.$style.navButton),
96
- type: "button"
97
- }, d(">"), 2)
98
- ], 2),
99
- l("div", {
100
- class: a(e.$style.headings)
101
- }, [
102
- (u(!0), c(h, null, w(b.value, (n) => (u(), c("div", {
103
- key: n,
104
- class: a(e.$style.weekday)
105
- }, d(n), 3))), 128))
106
- ], 2)
107
- ], 2),
108
- l("div", {
109
- class: a(e.$style.body)
110
- }, [
111
- (u(!0), c(h, null, w(g.value, (n, r) => (u(), c("div", {
112
- key: r,
113
- class: a([e.$style.cell, { [e.$style.today]: F(n), [e.$style.outOfRange]: k(n) }]),
114
- onClick: (o) => R(n),
115
- "data-choose": i.isDisablePastDates
116
- }, [
117
- l("div", {
118
- class: a(e.$style.cellDate)
119
- }, d(n.getDate()), 3),
120
- l("div", {
121
- class: a(e.$style.cellEvents)
122
- }, [
123
- (u(!0), c(h, null, w(O(n), (o) => (u(), c("div", {
124
- key: o.id,
125
- class: a(e.$style.event),
126
- style: z({ background: o.color }),
127
- onClick: P((f) => S(o), ["stop"])
128
- }, [
129
- l("div", {
130
- class: a(e.$style.title)
131
- }, d(o.title), 3)
132
- ], 14, V))), 128))
133
- ], 2)
134
- ], 10, N))), 128))
135
- ], 2)
136
- ], 2));
137
- }
138
- }), j = "_container_6dq6w_1", G = "_titleBar_6dq6w_7", I = "_navButton_6dq6w_19", J = "_headings_6dq6w_26", K = "_weekday_6dq6w_32", Q = "_body_6dq6w_38", X = "_cell_6dq6w_44", Z = "_today_6dq6w_55", x = "_cellDate_6dq6w_55", ee = "_outOfRange_6dq6w_61", te = "_cellEvents_6dq6w_72", ne = "_event_6dq6w_81", ae = "_title_6dq6w_7", se = "_header_6dq6w_111", oe = {
139
- container: j,
140
- titleBar: G,
141
- navButton: I,
142
- headings: J,
143
- weekday: K,
144
- body: Q,
145
- cell: X,
146
- today: Z,
147
- cellDate: x,
148
- outOfRange: ee,
149
- cellEvents: te,
150
- event: ne,
151
- title: ae,
152
- header: se
153
- }, le = {
154
- $style: oe
155
- }, ue = /* @__PURE__ */ A(W, [["__cssModules", le]]);
156
- export {
157
- ue as default
158
- };
2
+ import { t as _plugin_vue_export_helper_default } from "../_plugin-vue_export-helper-Bt71PsSa.js";
3
+ import { Fragment, computed, createElementBlock, createElementVNode, defineComponent, normalizeClass, normalizeStyle, onBeforeMount, openBlock, ref, renderList, toDisplayString, withModifiers } from "vue";
4
+ var _hoisted_1 = ["onClick", "data-choose"], _hoisted_2 = ["onClick"], UiCalendar_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
5
+ __name: "UiCalendar",
6
+ props: {
7
+ isDisablePastDates: { type: Boolean },
8
+ events: { default: () => [] },
9
+ lang: { default: "ru" }
10
+ },
11
+ emits: [
12
+ "update",
13
+ "eventClick",
14
+ "chooseDate"
15
+ ],
16
+ setup(e, { emit: a }) {
17
+ let c = e, l = a, u = ref(/* @__PURE__ */ new Date()), d = computed(() => {
18
+ let e = /* @__PURE__ */ new Date();
19
+ return e.setHours(0, 0, 0, 0), e;
20
+ }), f = computed(() => new Date(u.value.getFullYear(), u.value.getMonth(), 1)), p = computed(() => {
21
+ let e = f.value.toLocaleDateString(c.lang, {
22
+ month: "long",
23
+ year: "numeric"
24
+ });
25
+ return e.length > 0 && (e = e.charAt(0).toUpperCase() + e.slice(1)), c.lang === "ru" && (e = e.replace(/ г\.$/, "")), e;
26
+ }), m = computed(() => {
27
+ let e = new Date(f.value);
28
+ e.setDate(1);
29
+ let t = (e.getDay() + 6) % 7;
30
+ return e.setDate(e.getDate() - t), Array.from({ length: 7 }, (t, n) => {
31
+ let r = new Date(e);
32
+ return r.setDate(e.getDate() + n), r.toLocaleDateString(c.lang, { weekday: "short" });
33
+ });
34
+ }), h = computed(() => {
35
+ let e = new Date(u.value.getFullYear(), u.value.getMonth(), 1), t = new Date(u.value.getFullYear(), u.value.getMonth() + 1, 0), n = (e.getDay() + 6) % 7, r = new Date(e);
36
+ r.setDate(e.getDate() - n);
37
+ let i = (7 - t.getDay()) % 7, a = new Date(t);
38
+ a.setDate(t.getDate() + i);
39
+ let o = Math.floor((a.getTime() - r.getTime()) / (1e3 * 60 * 60 * 24)) + 1, s = [];
40
+ for (let e = 0; e < o; e++) {
41
+ let t = new Date(r);
42
+ t.setDate(r.getDate() + e), s.push(t);
43
+ }
44
+ return s;
45
+ });
46
+ function g() {
47
+ l("update", {
48
+ dateFrom: h.value[0],
49
+ dateTo: new Date(h.value.at(-1)?.setHours(23, 59, 59))
50
+ });
51
+ }
52
+ function _(e) {
53
+ return c.events.filter((t) => {
54
+ if (!t.start) return !1;
55
+ let n = new Date(t.start);
56
+ return n.getDate() === e.getDate() && n.getMonth() === e.getMonth() && n.getFullYear() === e.getFullYear();
57
+ });
58
+ }
59
+ function v(e) {
60
+ return e.toDateString() === d.value.toDateString();
61
+ }
62
+ function y(e) {
63
+ if (c.isDisablePastDates) {
64
+ let t = new Date(e);
65
+ if (t.setHours(0, 0, 0, 0), t < d.value) return !0;
66
+ }
67
+ return !1;
68
+ }
69
+ function b() {
70
+ u.value = new Date(u.value.getFullYear(), u.value.getMonth() - 1, 1), g();
71
+ }
72
+ function x() {
73
+ u.value = new Date(u.value.getFullYear(), u.value.getMonth() + 1, 1), g();
74
+ }
75
+ function S(e) {
76
+ l("eventClick", e);
77
+ }
78
+ function C(e) {
79
+ y(e) || l("chooseDate", e);
80
+ }
81
+ return onBeforeMount(() => {
82
+ g();
83
+ }), (e, n) => (openBlock(), createElementBlock("div", { class: normalizeClass(e.$style.container) }, [createElementVNode("div", { class: normalizeClass(e.$style.header) }, [createElementVNode("div", { class: normalizeClass(e.$style.titleBar) }, [
84
+ createElementVNode("button", {
85
+ onClick: b,
86
+ class: normalizeClass(e.$style.navButton),
87
+ type: "button"
88
+ }, toDisplayString("<"), 2),
89
+ createElementVNode("span", null, toDisplayString(p.value), 1),
90
+ createElementVNode("button", {
91
+ onClick: x,
92
+ class: normalizeClass(e.$style.navButton),
93
+ type: "button"
94
+ }, toDisplayString(">"), 2)
95
+ ], 2), createElementVNode("div", { class: normalizeClass(e.$style.headings) }, [(openBlock(!0), createElementBlock(Fragment, null, renderList(m.value, (t) => (openBlock(), createElementBlock("div", {
96
+ key: t,
97
+ class: normalizeClass(e.$style.weekday)
98
+ }, toDisplayString(t), 3))), 128))], 2)], 2), createElementVNode("div", { class: normalizeClass(e.$style.body) }, [(openBlock(!0), createElementBlock(Fragment, null, renderList(h.value, (n, a) => (openBlock(), createElementBlock("div", {
99
+ key: a,
100
+ class: normalizeClass([e.$style.cell, {
101
+ [e.$style.today]: v(n),
102
+ [e.$style.outOfRange]: y(n)
103
+ }]),
104
+ onClick: (e) => C(n),
105
+ "data-choose": c.isDisablePastDates
106
+ }, [createElementVNode("div", { class: normalizeClass(e.$style.cellDate) }, toDisplayString(n.getDate()), 3), createElementVNode("div", { class: normalizeClass(e.$style.cellEvents) }, [(openBlock(!0), createElementBlock(Fragment, null, renderList(_(n), (t) => (openBlock(), createElementBlock("div", {
107
+ key: t.id,
108
+ class: normalizeClass(e.$style.event),
109
+ style: normalizeStyle({ background: t.color }),
110
+ onClick: withModifiers((e) => S(t), ["stop"])
111
+ }, [createElementVNode("div", { class: normalizeClass(e.$style.title) }, toDisplayString(t.title), 3)], 14, _hoisted_2))), 128))], 2)], 10, _hoisted_1))), 128))], 2)], 2));
112
+ }
113
+ }), [["__cssModules", { $style: {
114
+ container: "_container_6dq6w_1",
115
+ titleBar: "_titleBar_6dq6w_7",
116
+ navButton: "_navButton_6dq6w_19",
117
+ headings: "_headings_6dq6w_26",
118
+ weekday: "_weekday_6dq6w_32",
119
+ body: "_body_6dq6w_38",
120
+ cell: "_cell_6dq6w_44",
121
+ today: "_today_6dq6w_55",
122
+ cellDate: "_cellDate_6dq6w_55",
123
+ outOfRange: "_outOfRange_6dq6w_61",
124
+ cellEvents: "_cellEvents_6dq6w_72",
125
+ event: "_event_6dq6w_81",
126
+ title: "_title_6dq6w_7",
127
+ header: "_header_6dq6w_111"
128
+ } }]]);
129
+ export { UiCalendar_default as default };
@@ -1 +1 @@
1
- ._chart_1y3cy_1{display:flex;flex-direction:column;gap:16px;width:100%}._title_1y3cy_8{font-size:1.5rem}.dark ._title_1y3cy_8{color:var(--color-white)}
1
+ ._chart_1y3cy_1{flex-direction:column;gap:16px;width:100%;display:flex}._title_1y3cy_8{font-size:1.5rem}.dark ._title_1y3cy_8{color:var(--color-white)}