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 +1 @@
1
- ._container_7y6o9_1{position:relative;width:320px}._results_7y6o9_6{position:absolute;z-index:2;display:flex;flex-direction:column;gap:8px;width:100%;max-height:320px;padding:16px;margin-top:8px;overflow-y:auto;background-color:var(--color-white);border-radius:16px;box-shadow:0 0 16px -8px var(--color-black-transparent)}._resultsInner_7y6o9_22{display:flex;flex-direction:column;gap:4px}._resultsInner_7y6o9_22:empty{display:none}._type_7y6o9_31{font-weight:700;text-transform:capitalize}._link_7y6o9_36{display:flex;gap:4px;text-decoration:none;cursor:pointer}@media(max-width:1260px){._container_7y6o9_1{width:280px}}@media(max-width:1260px){._container_7y6o9_1{width:100%}}.dark ._results_7y6o9_6{background-color:var(--color-gray-dark)}.dark ._link_7y6o9_36{color:var(--color-black)}.dark ._link_7y6o9_36:hover{color:var(--color-gray-dark-extra)}
1
+ ._container_7y6o9_1{width:320px;position:relative}._results_7y6o9_6{z-index:2;background-color:var(--color-white);width:100%;max-height:320px;box-shadow:0 0 16px -8px var(--color-black-transparent);border-radius:16px;flex-direction:column;gap:8px;margin-top:8px;padding:16px;display:flex;position:absolute;overflow-y:auto}._resultsInner_7y6o9_22{flex-direction:column;gap:4px;display:flex}._resultsInner_7y6o9_22:empty{display:none}._type_7y6o9_31{text-transform:capitalize;font-weight:700}._link_7y6o9_36{cursor:pointer;gap:4px;text-decoration:none;display:flex}@media (max-width:1260px){._container_7y6o9_1{width:100%}}.dark ._results_7y6o9_6{background-color:var(--color-gray-dark)}.dark ._link_7y6o9_36{color:var(--color-black)}.dark ._link_7y6o9_36:hover{color:var(--color-gray-dark-extra)}
@@ -1,148 +1,123 @@
1
1
  import "./UiSearch.css";
2
- import { createElementBlock as r, openBlock as o, createElementVNode as M, defineComponent as N, ref as I, computed as T, normalizeClass as S, createVNode as $, createCommentVNode as g, unref as V, withKeys as z, Fragment as p, createTextVNode as w, toDisplayString as v, renderList as C, createBlock as B, resolveDynamicComponent as O, withCtx as R } from "vue";
3
- import { RouterLink as U } from "vue-router";
4
- import { o as D } from "../index-Dvnq-rTV.js";
5
- import F from "../UiInput/UiInput.js";
6
- import { M as E } from "../index-DajWja1y.js";
7
- import { _ as L } from "../_plugin-vue_export-helper-CHgC5LLL.js";
8
- const P = { trailing: !0 };
9
- function x(d, a = 25, e = {}) {
10
- if (e = {
11
- ...P,
12
- ...e
13
- }, !Number.isFinite(a)) throw new TypeError("Expected `wait` to be a finite number");
14
- let y, n, f = [], c, l;
15
- const h = (s, t) => (c = A(d, s, t), c.finally(() => {
16
- if (c = null, e.trailing && l && !n) {
17
- const i = h(s, l);
18
- return l = null, i;
19
- }
20
- }), c), m = function(...s) {
21
- return e.trailing && (l = s), c || new Promise((t) => {
22
- const i = !n && e.leading;
23
- clearTimeout(n), n = setTimeout(() => {
24
- n = null;
25
- const u = e.leading ? y : h(this, s);
26
- l = null;
27
- for (const k of f) k(u);
28
- f = [];
29
- }, a), i ? (y = h(this, s), t(y)) : f.push(t);
30
- });
31
- }, _ = (s) => {
32
- s && (clearTimeout(s), n = null);
33
- };
34
- return m.isPending = () => !!n, m.cancel = () => {
35
- _(n), f = [], l = null;
36
- }, m.flush = () => {
37
- if (_(n), !l || c) return;
38
- const s = l;
39
- return l = null, h(this, s);
40
- }, m;
2
+ import { t as _plugin_vue_export_helper_default } from "../_plugin-vue_export-helper-Bt71PsSa.js";
3
+ import { t as UiInput_default } from "../UiInput-DHFttLTG.js";
4
+ import { t as MESSAGES } from "../locales-DIKIa9I3.js";
5
+ import { t as onClickOutside } from "../dist-CLA-k87a.js";
6
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, renderList, resolveDynamicComponent, toDisplayString, unref, withCtx, withKeys } from "vue";
7
+ import { RouterLink } from "vue-router";
8
+ var DEBOUNCE_DEFAULTS = { trailing: !0 };
9
+ function debounce(e, t = 25, n = {}) {
10
+ if (n = {
11
+ ...DEBOUNCE_DEFAULTS,
12
+ ...n
13
+ }, !Number.isFinite(t)) throw TypeError("Expected `wait` to be a finite number");
14
+ let r, i, a = [], o, s, c = (t, r) => (o = _applyPromised(e, t, r), o.finally(() => {
15
+ if (o = null, n.trailing && s && !i) {
16
+ let e = c(t, s);
17
+ return s = null, e;
18
+ }
19
+ }), o), l = function(...e) {
20
+ return n.trailing && (s = e), o || new Promise((o) => {
21
+ let l = !i && n.leading;
22
+ clearTimeout(i), i = setTimeout(() => {
23
+ i = null;
24
+ let t = n.leading ? r : c(this, e);
25
+ s = null;
26
+ for (let e of a) e(t);
27
+ a = [];
28
+ }, t), l ? (r = c(this, e), o(r)) : a.push(o);
29
+ });
30
+ }, u = (e) => {
31
+ e && (clearTimeout(e), i = null);
32
+ };
33
+ return l.isPending = () => !!i, l.cancel = () => {
34
+ u(i), a = [], s = null;
35
+ }, l.flush = () => {
36
+ if (u(i), !s || o) return;
37
+ let e = s;
38
+ return s = null, c(this, e);
39
+ }, l;
41
40
  }
42
- async function A(d, a, e) {
43
- return await d.apply(a, e);
41
+ async function _applyPromised(e, t, n) {
42
+ return await e.apply(t, n);
44
43
  }
45
- const K = {
46
- xmlns: "http://www.w3.org/2000/svg",
47
- width: "16",
48
- height: "16",
49
- fill: "none"
44
+ var _hoisted_1 = {
45
+ xmlns: "http://www.w3.org/2000/svg",
46
+ width: "16",
47
+ height: "16",
48
+ fill: "none"
50
49
  };
51
- function j(d, a) {
52
- return o(), r("svg", K, [...a[0] || (a[0] = [
53
- M("path", {
54
- fill: "#bbb",
55
- d: "M13.5 15.338a.5.5 0 1 0 .737-.676zm.737-.676-1.398-1.523-.737.676 1.399 1.523zM13.5 7.628c0 3.394-2.695 6.129-6 6.129v1c3.875 0 7-3.201 7-7.129zm-6 6.129c-3.305 0-6-2.735-6-6.129h-1c0 3.928 3.125 7.129 7 7.129zm-6-6.129c0-3.393 2.695-6.128 6-6.128v-1C3.625.5.5 3.7.5 7.628zm6-6.128c3.305 0 6 2.735 6 6.128h1C14.5 3.701 11.375.5 7.5.5z"
56
- }, null, -1)
57
- ])]);
50
+ function render(e, t) {
51
+ return openBlock(), createElementBlock("svg", _hoisted_1, [...t[0] ||= [createElementVNode("path", {
52
+ fill: "#bbb",
53
+ d: "M13.5 15.338a.5.5 0 1 0 .737-.676zm.737-.676-1.398-1.523-.737.676 1.399 1.523zM13.5 7.628c0 3.394-2.695 6.129-6 6.129v1c3.875 0 7-3.201 7-7.129zm-6 6.129c-3.305 0-6-2.735-6-6.129h-1c0 3.928 3.125 7.129 7 7.129zm-6-6.129c0-3.393 2.695-6.128 6-6.128v-1C3.625.5.5 3.7.5 7.628zm6-6.128c3.305 0 6 2.735 6 6.128h1C14.5 3.701 11.375.5 7.5.5z"
54
+ }, null, -1)]]);
58
55
  }
59
- const G = { render: j }, Y = 300, q = /* @__PURE__ */ N({
60
- __name: "UiSearch",
61
- props: {
62
- modelValue: {},
63
- searchScheme: {},
64
- results: { default: void 0 },
65
- isSuccess: { type: Boolean },
66
- lang: { default: "ru" }
67
- },
68
- emits: ["update:modelValue"],
69
- setup(d, { emit: a }) {
70
- const e = d, y = a, n = I(!1), f = x(async (t) => {
71
- y("update:modelValue", t);
72
- }, Y);
73
- function c() {
74
- n.value = !0;
75
- }
76
- function l() {
77
- n.value = !1;
78
- }
79
- function h() {
80
- l(), y("update:modelValue", "");
81
- }
82
- const m = T(() => e.results ? Object.values(e.results).reduce((t, i) => t + (i ? i.length : 0), 0) : !1), _ = I();
83
- D(_, () => {
84
- l();
85
- });
86
- const s = T(() => window.IS_STORYBOOK ? "a" : U);
87
- return (t, i) => (o(), r("div", {
88
- class: S(t.$style.container),
89
- ref_key: "containerElement",
90
- ref: _
91
- }, [
92
- $(F, {
93
- modelValue: e.modelValue,
94
- "onUpdate:modelValue": i[0] || (i[0] = async (u) => await V(f)(u.toString())),
95
- onClick: c,
96
- onKeyup: z(l, ["esc"]),
97
- appendIcon: V(G),
98
- placeholder: "Search"
99
- }, null, 8, ["modelValue", "appendIcon"]),
100
- n.value && e.modelValue.length > 0 ? (o(), r("div", {
101
- key: 0,
102
- class: S(t.$style.results)
103
- }, [
104
- e.modelValue.length < 3 ? (o(), r(p, { key: 0 }, [
105
- w(v(V(E)[e.lang].enterMoreSymbols), 1)
106
- ], 64)) : g("", !0),
107
- e.modelValue.length > 2 && !e.isSuccess ? (o(), r(p, { key: 1 }, [
108
- w(v(V(E)[e.lang].loading), 1)
109
- ], 64)) : g("", !0),
110
- e.modelValue.length > 2 && !m.value && e.isSuccess ? (o(), r(p, { key: 2 }, [
111
- w(v(V(E)[e.lang].noResults), 1)
112
- ], 64)) : g("", !0),
113
- e.modelValue.length > 2 && m.value && e.isSuccess ? (o(!0), r(p, { key: 3 }, C(e.searchScheme, (u) => (o(), r("div", {
114
- key: u.type,
115
- class: S(t.$style.resultsInner)
116
- }, [
117
- d.results?.[u.type]?.length ? (o(), r(p, { key: 0 }, [
118
- M("div", {
119
- class: S(t.$style.type)
120
- }, v(u.type) + ":", 3),
121
- (o(!0), r(p, null, C(d.results[u.type], (k) => (o(), B(O(s.value), {
122
- key: k._id,
123
- to: `${u.url}/${k._id}`,
124
- onClick: h,
125
- class: S(t.$style.link)
126
- }, {
127
- default: R(() => [
128
- (o(!0), r(p, null, C(u.labels, (b) => (o(), r("span", { key: b }, v(k[b]), 1))), 128))
129
- ]),
130
- _: 2
131
- }, 1032, ["to", "class"]))), 128))
132
- ], 64)) : g("", !0)
133
- ], 2))), 128)) : g("", !0)
134
- ], 2)) : g("", !0)
135
- ], 2));
136
- }
137
- }), H = "_container_7y6o9_1", J = "_results_7y6o9_6", Q = "_resultsInner_7y6o9_22", W = "_type_7y6o9_31", X = "_link_7y6o9_36", Z = {
138
- container: H,
139
- results: J,
140
- resultsInner: Q,
141
- type: W,
142
- link: X
143
- }, ee = {
144
- $style: Z
145
- }, ue = /* @__PURE__ */ L(q, [["__cssModules", ee]]);
146
- export {
147
- ue as default
148
- };
56
+ var search_default = { render }, UiSearch_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
57
+ __name: "UiSearch",
58
+ props: {
59
+ modelValue: {},
60
+ searchScheme: {},
61
+ results: { default: void 0 },
62
+ isSuccess: { type: Boolean },
63
+ lang: { default: "ru" }
64
+ },
65
+ emits: ["update:modelValue"],
66
+ setup(e, { emit: d }) {
67
+ let f = e, p = d, m = ref(!1), h = debounce(async (e) => {
68
+ p("update:modelValue", e);
69
+ }, 300);
70
+ function g() {
71
+ m.value = !0;
72
+ }
73
+ function _() {
74
+ m.value = !1;
75
+ }
76
+ function v() {
77
+ _(), p("update:modelValue", "");
78
+ }
79
+ let y = computed(() => f.results ? Object.values(f.results).reduce((e, t) => e + (t ? t.length : 0), 0) : !1), b = ref();
80
+ onClickOutside(b, () => {
81
+ _();
82
+ });
83
+ let x = computed(() => window.IS_STORYBOOK ? "a" : RouterLink);
84
+ return (r, a) => (openBlock(), createElementBlock("div", {
85
+ class: normalizeClass(r.$style.container),
86
+ ref_key: "containerElement",
87
+ ref: b
88
+ }, [createVNode(UiInput_default, {
89
+ modelValue: f.modelValue,
90
+ "onUpdate:modelValue": a[0] ||= async (e) => await unref(h)(e.toString()),
91
+ onClick: g,
92
+ onKeyup: withKeys(_, ["esc"]),
93
+ appendIcon: unref(search_default),
94
+ placeholder: "Search"
95
+ }, null, 8, ["modelValue", "appendIcon"]), m.value && f.modelValue.length > 0 ? (openBlock(), createElementBlock("div", {
96
+ key: 0,
97
+ class: normalizeClass(r.$style.results)
98
+ }, [
99
+ f.modelValue.length < 3 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(unref(MESSAGES)[f.lang].enterMoreSymbols), 1)], 64)) : createCommentVNode("", !0),
100
+ f.modelValue.length > 2 && !f.isSuccess ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(unref(MESSAGES)[f.lang].loading), 1)], 64)) : createCommentVNode("", !0),
101
+ f.modelValue.length > 2 && !y.value && f.isSuccess ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [createTextVNode(toDisplayString(unref(MESSAGES)[f.lang].noResults), 1)], 64)) : createCommentVNode("", !0),
102
+ f.modelValue.length > 2 && y.value && f.isSuccess ? (openBlock(!0), createElementBlock(Fragment, { key: 3 }, renderList(f.searchScheme, (t) => (openBlock(), createElementBlock("div", {
103
+ key: t.type,
104
+ class: normalizeClass(r.$style.resultsInner)
105
+ }, [e.results?.[t.type]?.length ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("div", { class: normalizeClass(r.$style.type) }, toDisplayString(t.type) + ":", 3), (openBlock(!0), createElementBlock(Fragment, null, renderList(e.results[t.type], (e) => (openBlock(), createBlock(resolveDynamicComponent(x.value), {
106
+ key: e._id,
107
+ to: `${t.url}/${e._id}`,
108
+ onClick: v,
109
+ class: normalizeClass(r.$style.link)
110
+ }, {
111
+ default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(t.labels, (t) => (openBlock(), createElementBlock("span", { key: t }, toDisplayString(e[t]), 1))), 128))]),
112
+ _: 2
113
+ }, 1032, ["to", "class"]))), 128))], 64)) : createCommentVNode("", !0)], 2))), 128)) : createCommentVNode("", !0)
114
+ ], 2)) : createCommentVNode("", !0)], 2));
115
+ }
116
+ }), [["__cssModules", { $style: {
117
+ container: "_container_7y6o9_1",
118
+ results: "_results_7y6o9_6",
119
+ resultsInner: "_resultsInner_7y6o9_22",
120
+ type: "_type_7y6o9_31",
121
+ link: "_link_7y6o9_36"
122
+ } }]]);
123
+ export { UiSearch_default as default };
@@ -1 +1 @@
1
- ._container_1m448_1{position:relative}._container_1m448_1:disabled{color:var(--color-gray-dark-extra);background:var(--color-gray-light-extra);border-color:var(--color-transparent)}._input_1m448_10{display:flex;gap:8px;align-items:center}._clear_1m448_16{width:28px;height:28px;font-size:1rem;font-weight:700;color:var(--color-white);cursor:pointer;background-color:var(--color-gray-dark);border:none;border-radius:50%}._clear_1m448_16:hover{background-color:var(--color-gray-dark-extra)}._options_1m448_31{position:absolute;z-index:2;display:flex;flex-direction:column;min-width:100%;max-height:200px;margin-top:8px;overflow-y:auto;background-color:var(--color-white);border:1px solid var(--color-gray);border-radius:16px}._options_1m448_31._optionsUp_1m448_44{bottom:100%;margin-top:0;margin-bottom:8px}._option_1m448_31{display:flex;flex-shrink:0;align-items:center;height:40px;padding:0 16px;color:var(--color-black);cursor:pointer;outline:none}._option_1m448_31:hover,._option_1m448_31:focus{color:var(--color-white);background-color:var(--color-primary)}._option_1m448_31[data-current=true]{color:var(--color-black);background-color:var(--color-gray-light)}._option_1m448_31[data-current=true]:hover,._option_1m448_31[data-current=true]:focus{background-color:var(--color-gray)}.dark ._options_1m448_31{background-color:var(--color-gray-dark);border:1px solid var(--color-gray-dark-extra)}.dark ._options_1m448_31 [data-current=true]{background-color:var(--color-gray-dark-extra)}
1
+ ._container_1m448_1{position:relative}._container_1m448_1:disabled{color:var(--color-gray-dark-extra);background:var(--color-gray-light-extra);border-color:var(--color-transparent)}._input_1m448_10{align-items:center;gap:8px;display:flex}._clear_1m448_16{width:28px;height:28px;color:var(--color-white);cursor:pointer;background-color:var(--color-gray-dark);border:none;border-radius:50%;font-size:1rem;font-weight:700}._clear_1m448_16:hover{background-color:var(--color-gray-dark-extra)}._options_1m448_31{z-index:2;background-color:var(--color-white);border:1px solid var(--color-gray);border-radius:16px;flex-direction:column;min-width:100%;max-height:200px;margin-top:8px;display:flex;position:absolute;overflow-y:auto}._options_1m448_31._optionsUp_1m448_44{margin-top:0;margin-bottom:8px;bottom:100%}._option_1m448_31{height:40px;color:var(--color-black);cursor:pointer;outline:none;flex-shrink:0;align-items:center;padding:0 16px;display:flex}._option_1m448_31:hover,._option_1m448_31:focus{color:var(--color-white);background-color:var(--color-primary)}._option_1m448_31[data-current=true]{color:var(--color-black);background-color:var(--color-gray-light)}._option_1m448_31[data-current=true]:hover,._option_1m448_31[data-current=true]:focus{background-color:var(--color-gray)}.dark ._options_1m448_31{background-color:var(--color-gray-dark);border:1px solid var(--color-gray-dark-extra)}.dark ._options_1m448_31 [data-current=true]{background-color:var(--color-gray-dark-extra)}