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.
- package/dist/UiBreadcrumbs/UiBreadcrumbs.css +1 -1
- package/dist/UiBreadcrumbs/UiBreadcrumbs.js +61 -63
- package/dist/UiButton/UiButton.css +1 -1
- package/dist/UiButton/UiButton.js +2 -41
- package/dist/UiButton-DkJNVTgF.js +45 -0
- package/dist/UiButtongroup/UiButtongroup.css +1 -1
- package/dist/UiButtongroup/UiButtongroup.js +50 -60
- package/dist/UiCalendar/UiCalendar.css +1 -1
- package/dist/UiCalendar/UiCalendar.js +128 -157
- package/dist/UiChart/UiChart.css +1 -1
- package/dist/UiChart/UiChart.js +7573 -8093
- package/dist/UiCheckbox/UiCheckbox.css +1 -1
- package/dist/UiCheckbox/UiCheckbox.js +116 -105
- package/dist/UiChip/UiChip.css +1 -1
- package/dist/UiChip/UiChip.js +48 -56
- package/dist/UiClose/UiClose.css +1 -1
- package/dist/UiClose/UiClose.js +2 -33
- package/dist/UiClose-BQmeCbRi.js +22 -0
- package/dist/UiEditor/UiEditor.css +1 -1
- package/dist/UiEditor/UiEditor.js +13012 -16496
- package/dist/UiField/UiField.css +1 -1
- package/dist/UiField/UiField.js +29 -42
- package/dist/UiFlex/UiFlex.css +1 -1
- package/dist/UiFlex/UiFlex.js +42 -43
- package/dist/UiInput/UiInput.css +1 -1
- package/dist/UiInput/UiInput.js +2 -125
- package/dist/UiInput-DHFttLTG.js +133 -0
- package/dist/UiModal/UiModal.css +1 -1
- package/dist/UiModal/UiModal.js +74 -106
- package/dist/UiPagination/UiPagination.css +1 -1
- package/dist/UiPagination/UiPagination.js +50 -58
- package/dist/UiRange/UiRange.css +1 -1
- package/dist/UiRange/UiRange.js +1384 -918
- package/dist/UiSearch/UiSearch.css +1 -1
- package/dist/UiSearch/UiSearch.js +118 -143
- package/dist/UiSelect/UiSelect.css +1 -1
- package/dist/UiSelect/UiSelect.js +167 -171
- package/dist/UiSlider/UiSlider.css +1 -1
- package/dist/UiSlider/UiSlider.js +41 -56
- package/dist/UiSpoiler/UiSpoiler.css +1 -1
- package/dist/UiSpoiler/UiSpoiler.js +51 -79
- package/dist/UiTable/UiTable.css +1 -1
- package/dist/UiTable/UiTable.js +76 -97
- package/dist/UiTabs/UiTabs.css +1 -1
- package/dist/UiTabs/UiTabs.js +24 -32
- package/dist/UiTextarea/UiTextarea.css +1 -1
- package/dist/UiTextarea/UiTextarea.js +25 -31
- package/dist/UiUpload/UiUpload.css +1 -1
- package/dist/UiUpload/UiUpload.js +123 -166
- package/dist/_plugin-vue_export-helper-Bt71PsSa.js +6 -0
- package/dist/dist-CLA-k87a.js +109 -0
- package/dist/locales-DIKIa9I3.js +29 -0
- package/dist/stubs/stubs.js +13 -15
- package/dist/toast/toast.css +1 -1
- package/dist/toast/toast.js +43 -41
- package/package.json +29 -29
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/index-DajWja1y.js +0 -31
- package/dist/index-Dvnq-rTV.js +0 -109
package/dist/UiTable/UiTable.js
CHANGED
|
@@ -1,98 +1,77 @@
|
|
|
1
1
|
import "./UiTable.css";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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 };
|
package/dist/UiTabs/UiTabs.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
._tabs_fwq3m_1{
|
|
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)}
|
package/dist/UiTabs/UiTabs.js
CHANGED
|
@@ -1,33 +1,25 @@
|
|
|
1
1
|
import "./UiTabs.css";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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{
|
|
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 {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}),
|
|
26
|
-
|
|
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
|
|
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 {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
|
13
|
-
|
|
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
|
-
|
|
18
|
-
new File([""], "file1.png");
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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 };
|