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,98 +1,77 @@
1
1
  import "./UiTable.css";
2
- import { defineComponent as y, ref as d, onMounted as w, onBeforeUnmount as k, createElementBlock as o, openBlock as n, normalizeClass as a, createCommentVNode as _, createElementVNode as s, toDisplayString as p, unref as V, Fragment as $, renderList as S, renderSlot as B } from "vue";
3
- import { M as h } from "../index-DajWja1y.js";
4
- import { _ as M } from "../_plugin-vue_export-helper-CHgC5LLL.js";
5
- const E = ["data-loading"], C = ["onClick", "data-current"], L = ["data-current", "data-loading"], z = ["data-current", "data-loading"], A = /* @__PURE__ */ y({
6
- __name: "UiTable",
7
- props: {
8
- headers: {},
9
- modelValue: { default: void 0 },
10
- isLoading: { type: Boolean },
11
- lang: { default: "ru" }
12
- },
13
- emits: ["update:modelValue", "reset"],
14
- setup(f, { emit: g }) {
15
- const l = f, b = g, r = d(), c = d(), m = d(!1);
16
- function u() {
17
- if (r.value && c.value) {
18
- const e = Number(getComputedStyle(r.value).width.slice(0, -2)), i = Number(getComputedStyle(c.value).width.slice(0, -2));
19
- m.value = i - 2 > e;
20
- }
21
- }
22
- function v(e) {
23
- l.modelValue?.value === e ? b("update:modelValue", { value: e, isAsc: !l.modelValue?.isAsc }) : b("reset", e);
24
- }
25
- return w(() => {
26
- u(), window.addEventListener("resize", u, !0);
27
- }), k(() => {
28
- window.removeEventListener("resize", u, !0);
29
- }), (e, i) => (n(), o("div", {
30
- class: a(e.$style.tableBlock),
31
- ref_key: "tableBlock",
32
- ref: r
33
- }, [
34
- m.value ? (n(), o("div", {
35
- key: 0,
36
- class: a(e.$style.scrollMessage)
37
- }, p(V(h)[l.lang].tableIsScrollable), 3)) : _("", !0),
38
- s("table", {
39
- class: a(e.$style.table),
40
- cellpadding: "8",
41
- cellspacing: "0",
42
- border: 0,
43
- ref_key: "table",
44
- ref: c
45
- }, [
46
- s("thead", null, [
47
- s("tr", null, [
48
- (n(!0), o($, null, S(l.headers, (t) => (n(), o("th", {
49
- key: `${t.value}${t.title}`,
50
- class: a(e.$style.th)
51
- }, [
52
- s("label", {
53
- class: a(e.$style.label),
54
- "data-loading": l.isLoading
55
- }, [
56
- s("span", null, p(t.title), 1),
57
- t.value ? (n(), o("button", {
58
- key: 0,
59
- onClick: (H) => v(t.value),
60
- class: a(e.$style.sort),
61
- type: "button",
62
- "data-current": l.modelValue?.value === t.value
63
- }, [
64
- s("span", {
65
- class: a(e.$style.arrow),
66
- "data-current": l.modelValue?.isAsc && l.modelValue?.value === t.value,
67
- "data-loading": l.isLoading
68
- }, "", 10, L),
69
- s("span", {
70
- class: a(e.$style.arrow),
71
- "data-current": !l.modelValue?.isAsc && l.modelValue?.value === t.value,
72
- "data-loading": l.isLoading
73
- }, "", 10, z)
74
- ], 10, C)) : _("", !0)
75
- ], 10, E)
76
- ], 2))), 128))
77
- ])
78
- ]),
79
- s("tbody", null, [
80
- B(e.$slots, "default")
81
- ])
82
- ], 2)
83
- ], 2));
84
- }
85
- }), N = "_tableBlock_nw50b_1", T = "_scrollMessage_nw50b_6", U = "_table_nw50b_1", q = "_th_nw50b_27", D = "_label_nw50b_39", F = "_sort_nw50b_55", G = "_arrow_nw50b_63", I = {
86
- tableBlock: N,
87
- scrollMessage: T,
88
- table: U,
89
- th: q,
90
- label: D,
91
- sort: F,
92
- arrow: G
93
- }, j = {
94
- $style: I
95
- }, P = /* @__PURE__ */ M(A, [["__cssModules", j]]);
96
- export {
97
- P as default
98
- };
2
+ import { t as _plugin_vue_export_helper_default } from "../_plugin-vue_export-helper-Bt71PsSa.js";
3
+ import { t as MESSAGES } from "../locales-DIKIa9I3.js";
4
+ import { Fragment, createCommentVNode, createElementBlock, createElementVNode, defineComponent, normalizeClass, onBeforeUnmount, onMounted, openBlock, ref, renderList, renderSlot, toDisplayString, unref } from "vue";
5
+ var _hoisted_1 = ["data-loading"], _hoisted_2 = ["onClick", "data-current"], _hoisted_3 = ["data-current", "data-loading"], _hoisted_4 = ["data-current", "data-loading"], UiTable_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
6
+ __name: "UiTable",
7
+ props: {
8
+ headers: {},
9
+ modelValue: { default: void 0 },
10
+ isLoading: { type: Boolean },
11
+ lang: { default: "ru" }
12
+ },
13
+ emits: ["update:modelValue", "reset"],
14
+ setup(e, { emit: n }) {
15
+ let r = e, i = n, a = ref(), o = ref(), s = ref(!1);
16
+ function c() {
17
+ if (a.value && o.value) {
18
+ let e = Number(getComputedStyle(a.value).width.slice(0, -2));
19
+ s.value = Number(getComputedStyle(o.value).width.slice(0, -2)) - 2 > e;
20
+ }
21
+ }
22
+ function l(e) {
23
+ r.modelValue?.value === e ? i("update:modelValue", {
24
+ value: e,
25
+ isAsc: !r.modelValue?.isAsc
26
+ }) : i("reset", e);
27
+ }
28
+ return onMounted(() => {
29
+ c(), window.addEventListener("resize", c, !0);
30
+ }), onBeforeUnmount(() => {
31
+ window.removeEventListener("resize", c, !0);
32
+ }), (e, n) => (openBlock(), createElementBlock("div", {
33
+ class: normalizeClass(e.$style.tableBlock),
34
+ ref_key: "tableBlock",
35
+ ref: a
36
+ }, [s.value ? (openBlock(), createElementBlock("div", {
37
+ key: 0,
38
+ class: normalizeClass(e.$style.scrollMessage)
39
+ }, toDisplayString(unref(MESSAGES)[r.lang].tableIsScrollable), 3)) : createCommentVNode("", !0), createElementVNode("table", {
40
+ class: normalizeClass(e.$style.table),
41
+ cellpadding: "8",
42
+ cellspacing: "0",
43
+ border: 0,
44
+ ref_key: "table",
45
+ ref: o
46
+ }, [createElementVNode("thead", null, [createElementVNode("tr", null, [(openBlock(!0), createElementBlock(Fragment, null, renderList(r.headers, (t) => (openBlock(), createElementBlock("th", {
47
+ key: `${t.value}${t.title}`,
48
+ class: normalizeClass(e.$style.th)
49
+ }, [createElementVNode("label", {
50
+ class: normalizeClass(e.$style.label),
51
+ "data-loading": r.isLoading
52
+ }, [createElementVNode("span", null, toDisplayString(t.title), 1), t.value ? (openBlock(), createElementBlock("button", {
53
+ key: 0,
54
+ onClick: (e) => l(t.value),
55
+ class: normalizeClass(e.$style.sort),
56
+ type: "button",
57
+ "data-current": r.modelValue?.value === t.value
58
+ }, [createElementVNode("span", {
59
+ class: normalizeClass(e.$style.arrow),
60
+ "data-current": r.modelValue?.isAsc && r.modelValue?.value === t.value,
61
+ "data-loading": r.isLoading
62
+ }, "", 10, _hoisted_3), createElementVNode("span", {
63
+ class: normalizeClass(e.$style.arrow),
64
+ "data-current": !r.modelValue?.isAsc && r.modelValue?.value === t.value,
65
+ "data-loading": r.isLoading
66
+ }, "", 10, _hoisted_4)], 10, _hoisted_2)) : createCommentVNode("", !0)], 10, _hoisted_1)], 2))), 128))])]), createElementVNode("tbody", null, [renderSlot(e.$slots, "default")])], 2)], 2));
67
+ }
68
+ }), [["__cssModules", { $style: {
69
+ tableBlock: "_tableBlock_nw50b_1",
70
+ scrollMessage: "_scrollMessage_nw50b_6",
71
+ table: "_table_nw50b_1",
72
+ th: "_th_nw50b_27",
73
+ label: "_label_nw50b_39",
74
+ sort: "_sort_nw50b_55",
75
+ arrow: "_arrow_nw50b_63"
76
+ } }]]);
77
+ export { UiTable_default as default };
@@ -1 +1 @@
1
- ._tabs_fwq3m_1{display:flex;flex-wrap:wrap;border-bottom:2px solid var(--color-primary)}._tab_fwq3m_1{padding:14px 8px;font-size:.875rem;color:var(--color-black);cursor:pointer;background-color:var(--color-gray-light);border:0}._tab_fwq3m_1:hover{background-color:var(--color-gray)}._tab_fwq3m_1:first-child{border-top-left-radius:8px}._tab_fwq3m_1:last-child{border-top-right-radius:8px}._tab_fwq3m_1[data-active=true]{color:var(--color-white);background-color:var(--color-primary)}@media(max-width:960px){._tabs_fwq3m_1{width:100%}._tab_fwq3m_1{flex-grow:1;padding:14px 5px}}.dark ._tabs_fwq3m_1{border-bottom:2px solid var(--color-primary-dark)}.dark ._tab_fwq3m_1{background-color:var(--color-gray-dark)}.dark ._tab_fwq3m_1[data-active=true]{background-color:var(--color-primary-dark)}
1
+ ._tabs_fwq3m_1{border-bottom:2px solid var(--color-primary);flex-wrap:wrap;display:flex}._tab_fwq3m_1{color:var(--color-black);cursor:pointer;background-color:var(--color-gray-light);border:0;padding:14px 8px;font-size:.875rem}._tab_fwq3m_1:hover{background-color:var(--color-gray)}._tab_fwq3m_1:first-child{border-top-left-radius:8px}._tab_fwq3m_1:last-child{border-top-right-radius:8px}._tab_fwq3m_1[data-active=true]{color:var(--color-white);background-color:var(--color-primary)}@media (max-width:960px){._tabs_fwq3m_1{width:100%}._tab_fwq3m_1{flex-grow:1;padding:14px 5px}}.dark ._tabs_fwq3m_1{border-bottom:2px solid var(--color-primary-dark)}.dark ._tab_fwq3m_1{background-color:var(--color-gray-dark)}.dark ._tab_fwq3m_1[data-active=true]{background-color:var(--color-primary-dark)}
@@ -1,33 +1,25 @@
1
1
  import "./UiTabs.css";
2
- import { defineComponent as i, createElementBlock as e, openBlock as s, normalizeClass as l, Fragment as u, renderList as m, toDisplayString as _ } from "vue";
3
- import { _ as d } from "../_plugin-vue_export-helper-CHgC5LLL.js";
4
- const p = ["onClick", "data-active"], b = /* @__PURE__ */ i({
5
- __name: "UiTabs",
6
- props: {
7
- tabs: {},
8
- modelValue: {}
9
- },
10
- emits: ["update:modelValue"],
11
- setup(n, { emit: c }) {
12
- const a = n, r = c;
13
- return (o, C) => (s(), e("div", {
14
- class: l(o.$style.tabs)
15
- }, [
16
- (s(!0), e(u, null, m(a.tabs, (t) => (s(), e("button", {
17
- key: t.value,
18
- onClick: (V) => r("update:modelValue", t.value),
19
- class: l(o.$style.tab),
20
- type: "button",
21
- "data-active": a.modelValue === t.value
22
- }, _(t.title), 11, p))), 128))
23
- ], 2));
24
- }
25
- }), f = "_tabs_fwq3m_1", v = "_tab_fwq3m_1", y = {
26
- tabs: f,
27
- tab: v
28
- }, k = {
29
- $style: y
30
- }, h = /* @__PURE__ */ d(b, [["__cssModules", k]]);
31
- export {
32
- h as default
33
- };
2
+ import { t as _plugin_vue_export_helper_default } from "../_plugin-vue_export-helper-Bt71PsSa.js";
3
+ import { Fragment, createElementBlock, defineComponent, normalizeClass, openBlock, renderList, toDisplayString } from "vue";
4
+ var _hoisted_1 = ["onClick", "data-active"], UiTabs_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
5
+ __name: "UiTabs",
6
+ props: {
7
+ tabs: {},
8
+ modelValue: {}
9
+ },
10
+ emits: ["update:modelValue"],
11
+ setup(e, { emit: n }) {
12
+ let r = e, i = n;
13
+ return (e, n) => (openBlock(), createElementBlock("div", { class: normalizeClass(e.$style.tabs) }, [(openBlock(!0), createElementBlock(Fragment, null, renderList(r.tabs, (t) => (openBlock(), createElementBlock("button", {
14
+ key: t.value,
15
+ onClick: (e) => i("update:modelValue", t.value),
16
+ class: normalizeClass(e.$style.tab),
17
+ type: "button",
18
+ "data-active": r.modelValue === t.value
19
+ }, toDisplayString(t.title), 11, _hoisted_1))), 128))], 2));
20
+ }
21
+ }), [["__cssModules", { $style: {
22
+ tabs: "_tabs_fwq3m_1",
23
+ tab: "_tab_fwq3m_1"
24
+ } }]]);
25
+ export { UiTabs_default as default };
@@ -1 +1 @@
1
- ._textarea_15hzv_1{width:100%;padding:16px;font-size:1rem;line-height:1.4;resize:none;outline:none;border:1px solid var(--color-gray);border-radius:16px}._textarea_15hzv_1:hover{border:1px solid var(--color-gray-dark-extra)}._textarea_15hzv_1:focus{border:1px solid var(--color-primary)}._textarea_15hzv_1:disabled{color:var(--color-gray-dark-extra);background:var(--color-gray-light-extra);border-color:var(--color-transparent)}._textarea_15hzv_1::placeholder{color:var(--color-gray-dark-extra)}.dark ._textarea_15hzv_1{background-color:var(--color-gray-dark);border:1px solid var(--color-gray-dark-extra)}
1
+ ._textarea_15hzv_1{resize:none;border:1px solid var(--color-gray);border-radius:16px;outline:none;width:100%;padding:16px;font-size:1rem;line-height:1.4}._textarea_15hzv_1:hover{border:1px solid var(--color-gray-dark-extra)}._textarea_15hzv_1:focus{border:1px solid var(--color-primary)}._textarea_15hzv_1:disabled{color:var(--color-gray-dark-extra);background:var(--color-gray-light-extra);border-color:var(--color-transparent)}._textarea_15hzv_1::placeholder{color:var(--color-gray-dark-extra)}.dark ._textarea_15hzv_1{background-color:var(--color-gray-dark);border:1px solid var(--color-gray-dark-extra)}
@@ -1,32 +1,26 @@
1
1
  import "./UiTextarea.css";
2
- import { defineComponent as i, createElementBlock as u, openBlock as d, normalizeClass as m } from "vue";
3
- import { _ as p } from "../_plugin-vue_export-helper-CHgC5LLL.js";
4
- const c = ["value", "disabled"], _ = /* @__PURE__ */ i({
5
- __name: "UiTextarea",
6
- props: {
7
- modelValue: {},
8
- isDisabled: { type: Boolean }
9
- },
10
- emits: ["update:modelValue"],
11
- setup(s, { emit: o }) {
12
- const t = s, l = o;
13
- function n(e) {
14
- l("update:modelValue", e.value);
15
- }
16
- return (e, a) => (d(), u("textarea", {
17
- value: t.modelValue,
18
- onInput: a[0] || (a[0] = (r) => n(r.target)),
19
- disabled: t.isDisabled,
20
- class: m(e.$style.textarea),
21
- rows: "5",
22
- "aria-label": "textarea"
23
- }, null, 42, c));
24
- }
25
- }), x = "_textarea_15hzv_1", f = {
26
- textarea: x
27
- }, b = {
28
- $style: f
29
- }, V = /* @__PURE__ */ p(_, [["__cssModules", b]]);
30
- export {
31
- V as default
32
- };
2
+ import { t as _plugin_vue_export_helper_default } from "../_plugin-vue_export-helper-Bt71PsSa.js";
3
+ import { createElementBlock, defineComponent, normalizeClass, openBlock } from "vue";
4
+ var _hoisted_1 = ["value", "disabled"], UiTextarea_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
5
+ __name: "UiTextarea",
6
+ props: {
7
+ modelValue: {},
8
+ isDisabled: { type: Boolean }
9
+ },
10
+ emits: ["update:modelValue"],
11
+ setup(e, { emit: t }) {
12
+ let n = e, r = t;
13
+ function i(e) {
14
+ r("update:modelValue", e.value);
15
+ }
16
+ return (e, t) => (openBlock(), createElementBlock("textarea", {
17
+ value: n.modelValue,
18
+ onInput: t[0] ||= (e) => i(e.target),
19
+ disabled: n.isDisabled,
20
+ class: normalizeClass(e.$style.textarea),
21
+ rows: "5",
22
+ "aria-label": "textarea"
23
+ }, null, 42, _hoisted_1));
24
+ }
25
+ }), [["__cssModules", { $style: { textarea: "_textarea_15hzv_1" } }]]);
26
+ export { UiTextarea_default as default };
@@ -1 +1 @@
1
- ._container_10je3_1{display:flex;gap:16px}._upload_10je3_6{display:flex;flex-direction:column;gap:4px}._addButton_10je3_12{display:flex;flex-direction:column;gap:8px;min-width:200px}._text_10je3_19{font-size:.75rem}._text_10je3_19[data-error=true]{color:var(--color-error)}._input_10je3_26{display:none}._name_10je3_30{flex:1;max-width:136px;overflow:hidden;text-overflow:ellipsis;font-size:.875rem}._file_10je3_38{display:flex;gap:8px;align-items:center}._error_10je3_44{color:var(--color-error)}._uploadButton_10je3_48[data-label=true]{margin-top:28px}.dark ._label_10je3_52,.dark ._text_10je3_19,.dark ._name_10je3_30{color:var(--color-white)}
1
+ ._container_10je3_1{gap:16px;display:flex}._upload_10je3_6{flex-direction:column;gap:4px;display:flex}._addButton_10je3_12{flex-direction:column;gap:8px;min-width:200px;display:flex}._text_10je3_19{font-size:.75rem}._text_10je3_19[data-error=true]{color:var(--color-error)}._input_10je3_26{display:none}._name_10je3_30{text-overflow:ellipsis;flex:1;max-width:136px;font-size:.875rem;overflow:hidden}._file_10je3_38{align-items:center;gap:8px;display:flex}._error_10je3_44{color:var(--color-error)}._uploadButton_10je3_48[data-label=true]{margin-top:28px}.dark ._label_10je3_52,.dark ._text_10je3_19,.dark ._name_10je3_30{color:var(--color-white)}
@@ -1,169 +1,126 @@
1
1
  import "./UiUpload.css";
2
- import { createElementBlock as o, openBlock as s, createStaticVNode as M, defineComponent as z, ref as b, computed as I, normalizeClass as n, createElementVNode as r, withDirectives as D, createCommentVNode as d, toDisplayString as a, createVNode as m, unref as u, withCtx as v, createTextVNode as p, Fragment as B, renderList as E, vShow as F } from "vue";
3
- import y from "../UiButton/UiButton.js";
4
- import { M as g } from "../index-DajWja1y.js";
5
- import { _ as N } from "../_plugin-vue_export-helper-CHgC5LLL.js";
6
- const V = {
7
- xmlns: "http://www.w3.org/2000/svg",
8
- width: "16",
9
- height: "16",
10
- fill: "none"
2
+ import { t as _plugin_vue_export_helper_default } from "../_plugin-vue_export-helper-Bt71PsSa.js";
3
+ import { t as UiButton_default } from "../UiButton-DkJNVTgF.js";
4
+ import { t as MESSAGES } from "../locales-DIKIa9I3.js";
5
+ import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createStaticVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, renderList, toDisplayString, unref, vShow, withCtx, withDirectives } from "vue";
6
+ var _hoisted_1$1 = {
7
+ xmlns: "http://www.w3.org/2000/svg",
8
+ width: "16",
9
+ height: "16",
10
+ fill: "none"
11
11
  };
12
- function A(_, c) {
13
- return s(), o("svg", V, [...c[0] || (c[0] = [
14
- M('<g fill="currentColor" fill-rule="evenodd" clip-path="url(#a)" clip-rule="evenodd"><path d="M12.219 0h.875Q15.532.469 16 2.906v.875a3.6 3.6 0 0 1-.766 1.719l-4.546 4.547q-1.536 1.189-3.376.562a3.55 3.55 0 0 1-1.234-.828q-.37-.747.39-1.078a1 1 0 0 1 .438.031q.3.253.625.47 1.09.563 2.125-.095 2.288-2.241 4.547-4.515.928-1.322-.062-2.594-1.287-1.184-2.735-.203a143 143 0 0 1-2.531 2.5q-.72.3-1.016-.422a.8.8 0 0 1 .094-.562L10.531.733A3.6 3.6 0 0 1 12.22 0"></path><path d="M3.781 16h-.875Q.47 15.532 0 13.094v-.875q.151-.96.766-1.719l4.172-4.172Q6.594 5.062 8.53 5.86q.46.227.844.563a.75.75 0 0 1 .266.797q-.274.609-.922.422l-.688-.5q-1.065-.513-2.062.125-2.1 2.053-4.172 4.14-.94 1.35.094 2.625 1.189 1.08 2.578.266l2.281-2.219q.88-.318 1.031.594a.7.7 0 0 1-.11.39Q6.587 14.15 5.5 15.235A3.6 3.6 0 0 1 3.781 16"></path></g><defs><clipPath id="a"><path fill="currentColor" d="M0 0h16v16H0z"></path></clipPath></defs>', 2)
15
- ])]);
12
+ function render(e, t) {
13
+ return openBlock(), createElementBlock("svg", _hoisted_1$1, [...t[0] ||= [createStaticVNode("<g fill=\"currentColor\" fill-rule=\"evenodd\" clip-path=\"url(#a)\" clip-rule=\"evenodd\"><path d=\"M12.219 0h.875Q15.532.469 16 2.906v.875a3.6 3.6 0 0 1-.766 1.719l-4.546 4.547q-1.536 1.189-3.376.562a3.55 3.55 0 0 1-1.234-.828q-.37-.747.39-1.078a1 1 0 0 1 .438.031q.3.253.625.47 1.09.563 2.125-.095 2.288-2.241 4.547-4.515.928-1.322-.062-2.594-1.287-1.184-2.735-.203a143 143 0 0 1-2.531 2.5q-.72.3-1.016-.422a.8.8 0 0 1 .094-.562L10.531.733A3.6 3.6 0 0 1 12.22 0\"></path><path d=\"M3.781 16h-.875Q.47 15.532 0 13.094v-.875q.151-.96.766-1.719l4.172-4.172Q6.594 5.062 8.53 5.86q.46.227.844.563a.75.75 0 0 1 .266.797q-.274.609-.922.422l-.688-.5q-1.065-.513-2.062.125-2.1 2.053-4.172 4.14-.94 1.35.094 2.625 1.189 1.08 2.578.266l2.281-2.219q.88-.318 1.031.594a.7.7 0 0 1-.11.39Q6.587 14.15 5.5 15.235A3.6 3.6 0 0 1 3.781 16\"></path></g><defs><clipPath id=\"a\"><path fill=\"currentColor\" d=\"M0 0h16v16H0z\"></path></clipPath></defs>", 2)]]);
16
14
  }
17
- const L = { render: A }, h = 10 * 1024 * 1024;
18
- new File([""], "file1.png");
19
- new File([""], "file2.png");
20
- const Q = ["data-error"], U = ["accept", "multiple"], x = ["data-label"], P = /* @__PURE__ */ z({
21
- __name: "UiUpload",
22
- props: {
23
- label: { default: void 0 },
24
- file: { default: void 0 },
25
- files: { default: () => [] },
26
- extensions: { default: () => ["jpg", "png"] },
27
- error: { type: [String, Boolean], default: void 0 },
28
- isDisabled: { type: Boolean },
29
- isRequired: { type: Boolean },
30
- isSingle: { type: Boolean },
31
- lang: { default: "ru" }
32
- },
33
- emits: ["add", "remove", "upload"],
34
- setup(_, { emit: c }) {
35
- const e = _, f = c, $ = b(), k = b(0), j = I(() => e.extensions.map((l) => `.${l}`).join(","));
36
- function C() {
37
- $?.value?.click?.();
38
- }
39
- async function S(l) {
40
- l && (f("remove", l), k.value++);
41
- }
42
- function q(l) {
43
- if (e.isSingle) {
44
- const t = l.files?.[0];
45
- t?.size && t.size < h && f("add", t);
46
- } else {
47
- const t = l.files;
48
- if (t === null) return;
49
- for (const i of t)
50
- i.size > 0 && i.size < h && f("add", i);
51
- }
52
- }
53
- return (l, t) => (s(), o("div", {
54
- class: n(l.$style.container)
55
- }, [
56
- r("div", {
57
- class: n(l.$style.upload)
58
- }, [
59
- e.label ? (s(), o("div", {
60
- key: 0,
61
- class: n(l.$style.label)
62
- }, [
63
- r("span", null, a(e.label), 1),
64
- e.isRequired ? (s(), o("span", {
65
- key: 0,
66
- class: n(l.$style.error)
67
- }, "*", 2)) : d("", !0)
68
- ], 2)) : d("", !0),
69
- r("div", {
70
- class: n(l.$style.addButton)
71
- }, [
72
- m(y, {
73
- onClick: C,
74
- layout: "secondary",
75
- isDisabled: e.isDisabled || e.isSingle && e.files.length > 0 || e.isSingle && !!e.file,
76
- icon: u(L)
77
- }, {
78
- default: v(() => [
79
- t[3] || (t[3] = p(" Add file", -1)),
80
- e.isSingle ? d("", !0) : (s(), o(B, { key: 0 }, [
81
- p("s")
82
- ], 64))
83
- ]),
84
- _: 1
85
- }, 8, ["isDisabled", "icon"]),
86
- r("div", {
87
- class: n(l.$style.text),
88
- "data-error": !!e.error
89
- }, " Size up to " + a(u(h) / (1024 * 1024)) + " Mb, " + a(e.extensions.join(", ")) + ". ", 11, Q)
90
- ], 2),
91
- (s(), o("input", {
92
- type: "file",
93
- onInput: t[0] || (t[0] = (i) => q(i.target)),
94
- ref_key: "input",
95
- ref: $,
96
- class: n(l.$style.input),
97
- key: k.value,
98
- accept: j.value,
99
- multiple: !e.isSingle
100
- }, null, 42, U)),
101
- e.files?.length && !e.file ? (s(!0), o(B, { key: 1 }, E(_.files, (i, w) => (s(), o("div", {
102
- key: `${i}-${w}`,
103
- class: n(l.$style.file)
104
- }, [
105
- r("div", {
106
- class: n(l.$style.name)
107
- }, a(i.name), 3),
108
- m(y, {
109
- onClick: (le) => S(i),
110
- layout: "plain"
111
- }, {
112
- default: v(() => [
113
- p(a(u(g)[e.lang].remove), 1)
114
- ]),
115
- _: 1
116
- }, 8, ["onClick"])
117
- ], 2))), 128)) : d("", !0),
118
- e.isSingle && e.file ? (s(), o("div", {
119
- key: 2,
120
- class: n(l.$style.file)
121
- }, [
122
- r("div", {
123
- class: n(l.$style.name)
124
- }, a(e.file.name), 3),
125
- m(y, {
126
- onClick: t[1] || (t[1] = (i) => S(e.file)),
127
- layout: "plain"
128
- }, {
129
- default: v(() => [
130
- p(a(u(g)[e.lang].remove), 1)
131
- ]),
132
- _: 1
133
- })
134
- ], 2)) : d("", !0)
135
- ], 2),
136
- D(r("div", {
137
- class: n(l.$style.uploadButton),
138
- "data-label": !!e.label
139
- }, [
140
- m(y, {
141
- onClick: t[2] || (t[2] = (i) => f("upload"))
142
- }, {
143
- default: v(() => [
144
- p(a(u(g)[e.lang].upload), 1)
145
- ]),
146
- _: 1
147
- })
148
- ], 10, x), [
149
- [F, e.isSingle && e.file || e.files.length > 0]
150
- ])
151
- ], 2));
152
- }
153
- }), R = "_container_10je3_1", G = "_upload_10je3_6", H = "_addButton_10je3_12", K = "_text_10je3_19", Z = "_input_10je3_26", J = "_name_10je3_30", O = "_file_10je3_38", T = "_error_10je3_44", W = "_uploadButton_10je3_48", X = "_label_10je3_52", Y = {
154
- container: R,
155
- upload: G,
156
- addButton: H,
157
- text: K,
158
- input: Z,
159
- name: J,
160
- file: O,
161
- error: T,
162
- uploadButton: W,
163
- label: X
164
- }, ee = {
165
- $style: Y
166
- }, se = /* @__PURE__ */ N(P, [["__cssModules", ee]]);
167
- export {
168
- se as default
169
- };
15
+ var upload_default = { render };
16
+ new File([""], "file1.png"), new File([""], "file2.png");
17
+ var _hoisted_1 = ["data-error"], _hoisted_2 = ["accept", "multiple"], _hoisted_3 = ["data-label"], UiUpload_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
18
+ __name: "UiUpload",
19
+ props: {
20
+ label: { default: void 0 },
21
+ file: { default: void 0 },
22
+ files: { default: () => [] },
23
+ extensions: { default: () => ["jpg", "png"] },
24
+ error: {
25
+ type: [String, Boolean],
26
+ default: void 0
27
+ },
28
+ isDisabled: { type: Boolean },
29
+ isRequired: { type: Boolean },
30
+ isSingle: { type: Boolean },
31
+ lang: { default: "ru" }
32
+ },
33
+ emits: [
34
+ "add",
35
+ "remove",
36
+ "upload"
37
+ ],
38
+ setup(e, { emit: i }) {
39
+ let a = e, o = i, s = ref(), c = ref(0), l = computed(() => a.extensions.map((e) => `.${e}`).join(","));
40
+ function u() {
41
+ s?.value?.click?.();
42
+ }
43
+ async function d(e) {
44
+ e && (o("remove", e), c.value++);
45
+ }
46
+ function f(e) {
47
+ if (a.isSingle) {
48
+ let t = e.files?.[0];
49
+ t?.size && t.size < 10485760 && o("add", t);
50
+ } else {
51
+ let t = e.files;
52
+ if (t === null) return;
53
+ for (let e of t) e.size > 0 && e.size < 10485760 && o("add", e);
54
+ }
55
+ }
56
+ return (r, i) => (openBlock(), createElementBlock("div", { class: normalizeClass(r.$style.container) }, [createElementVNode("div", { class: normalizeClass(r.$style.upload) }, [
57
+ a.label ? (openBlock(), createElementBlock("div", {
58
+ key: 0,
59
+ class: normalizeClass(r.$style.label)
60
+ }, [createElementVNode("span", null, toDisplayString(a.label), 1), a.isRequired ? (openBlock(), createElementBlock("span", {
61
+ key: 0,
62
+ class: normalizeClass(r.$style.error)
63
+ }, "*", 2)) : createCommentVNode("", !0)], 2)) : createCommentVNode("", !0),
64
+ createElementVNode("div", { class: normalizeClass(r.$style.addButton) }, [createVNode(UiButton_default, {
65
+ onClick: u,
66
+ layout: "secondary",
67
+ isDisabled: a.isDisabled || a.isSingle && a.files.length > 0 || a.isSingle && !!a.file,
68
+ icon: unref(upload_default)
69
+ }, {
70
+ default: withCtx(() => [i[3] ||= createTextVNode(" Add file", -1), a.isSingle ? createCommentVNode("", !0) : (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode("s")], 64))]),
71
+ _: 1
72
+ }, 8, ["isDisabled", "icon"]), createElementVNode("div", {
73
+ class: normalizeClass(r.$style.text),
74
+ "data-error": !!a.error
75
+ }, " Size up to " + toDisplayString(unref(10485760) / (1024 * 1024)) + " Mb, " + toDisplayString(a.extensions.join(", ")) + ". ", 11, _hoisted_1)], 2),
76
+ (openBlock(), createElementBlock("input", {
77
+ type: "file",
78
+ onInput: i[0] ||= (e) => f(e.target),
79
+ ref_key: "input",
80
+ ref: s,
81
+ class: normalizeClass(r.$style.input),
82
+ key: c.value,
83
+ accept: l.value,
84
+ multiple: !a.isSingle
85
+ }, null, 42, _hoisted_2)),
86
+ a.files?.length && !a.file ? (openBlock(!0), createElementBlock(Fragment, { key: 1 }, renderList(e.files, (e, n) => (openBlock(), createElementBlock("div", {
87
+ key: `${e}-${n}`,
88
+ class: normalizeClass(r.$style.file)
89
+ }, [createElementVNode("div", { class: normalizeClass(r.$style.name) }, toDisplayString(e.name), 3), createVNode(UiButton_default, {
90
+ onClick: (t) => d(e),
91
+ layout: "plain"
92
+ }, {
93
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(MESSAGES)[a.lang].remove), 1)]),
94
+ _: 1
95
+ }, 8, ["onClick"])], 2))), 128)) : createCommentVNode("", !0),
96
+ a.isSingle && a.file ? (openBlock(), createElementBlock("div", {
97
+ key: 2,
98
+ class: normalizeClass(r.$style.file)
99
+ }, [createElementVNode("div", { class: normalizeClass(r.$style.name) }, toDisplayString(a.file.name), 3), createVNode(UiButton_default, {
100
+ onClick: i[1] ||= (e) => d(a.file),
101
+ layout: "plain"
102
+ }, {
103
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(MESSAGES)[a.lang].remove), 1)]),
104
+ _: 1
105
+ })], 2)) : createCommentVNode("", !0)
106
+ ], 2), withDirectives(createElementVNode("div", {
107
+ class: normalizeClass(r.$style.uploadButton),
108
+ "data-label": !!a.label
109
+ }, [createVNode(UiButton_default, { onClick: i[2] ||= (e) => o("upload") }, {
110
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(MESSAGES)[a.lang].upload), 1)]),
111
+ _: 1
112
+ })], 10, _hoisted_3), [[vShow, a.isSingle && a.file || a.files.length > 0]])], 2));
113
+ }
114
+ }), [["__cssModules", { $style: {
115
+ container: "_container_10je3_1",
116
+ upload: "_upload_10je3_6",
117
+ addButton: "_addButton_10je3_12",
118
+ text: "_text_10je3_19",
119
+ input: "_input_10je3_26",
120
+ name: "_name_10je3_30",
121
+ file: "_file_10je3_38",
122
+ error: "_error_10je3_44",
123
+ uploadButton: "_uploadButton_10je3_48",
124
+ label: "_label_10je3_52"
125
+ } }]]);
126
+ export { UiUpload_default as default };
@@ -0,0 +1,6 @@
1
+ var _plugin_vue_export_helper_default = (e, t) => {
2
+ let n = e.__vccOpts || e;
3
+ for (let [e, r] of t) n[e] = r;
4
+ return n;
5
+ };
6
+ export { _plugin_vue_export_helper_default as t };