mhz-ui 1.0.20 → 1.0.21
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/UiRange/UiRange.js +2 -1
- package/dist/UiSearch/UiSearch.d.ts +16 -24
- package/dist/UiSearch/UiSearch.js +95 -84
- package/dist/UiSelect/UiSelect.js +20 -15
- package/dist/UiSlider/UiSlider.js +26 -23
- package/dist/UiSpoiler/UiSpoiler.js +30 -27
- package/dist/UiTable/UiTable.js +61 -56
- package/dist/UiUpload/UiUpload.css +1 -1
- package/dist/UiUpload/UiUpload.d.ts +0 -9
- package/dist/UiUpload/UiUpload.js +100 -87
- package/package.json +14 -14
package/dist/UiRange/UiRange.js
CHANGED
|
@@ -994,7 +994,8 @@ const wr = /* @__PURE__ */ hr({
|
|
|
994
994
|
"onUpdate:modelValue": Y[0] || (Y[0] = (vt) => k("update:modelValue", vt)),
|
|
995
995
|
min: g.min,
|
|
996
996
|
max: g.max,
|
|
997
|
-
tooltipPosition: "bottom"
|
|
997
|
+
tooltipPosition: "bottom",
|
|
998
|
+
"data-test": "ui-range"
|
|
998
999
|
}, null, 8, ["modelValue", "min", "max"])
|
|
999
1000
|
], 2));
|
|
1000
1001
|
}
|
|
@@ -1,24 +1,26 @@
|
|
|
1
|
+
interface ISearchScheme {
|
|
2
|
+
type: string;
|
|
3
|
+
labels: string[];
|
|
4
|
+
url: string;
|
|
5
|
+
}
|
|
6
|
+
interface ISearchResult {
|
|
7
|
+
[key: string]: {
|
|
8
|
+
_id?: string;
|
|
9
|
+
}[] | {
|
|
10
|
+
[key: string]: string;
|
|
11
|
+
}[] | undefined;
|
|
12
|
+
}
|
|
1
13
|
declare const _default: import("vue").DefineComponent<{
|
|
2
14
|
modelValue: {
|
|
3
15
|
type: import("vue").PropType<string>;
|
|
4
16
|
required: true;
|
|
5
17
|
};
|
|
6
18
|
searchScheme: {
|
|
7
|
-
type: import("vue").PropType<
|
|
8
|
-
type: string;
|
|
9
|
-
labels: string[];
|
|
10
|
-
url: string;
|
|
11
|
-
}[]>;
|
|
19
|
+
type: import("vue").PropType<ISearchScheme[]>;
|
|
12
20
|
required: true;
|
|
13
21
|
};
|
|
14
22
|
results: {
|
|
15
|
-
type: import("vue").PropType<
|
|
16
|
-
[key: string]: {
|
|
17
|
-
_id?: string | undefined;
|
|
18
|
-
}[] | {
|
|
19
|
-
[key: string]: string;
|
|
20
|
-
}[] | undefined;
|
|
21
|
-
}>;
|
|
23
|
+
type: import("vue").PropType<ISearchResult>;
|
|
22
24
|
};
|
|
23
25
|
isSuccess: {
|
|
24
26
|
type: import("vue").PropType<boolean>;
|
|
@@ -30,21 +32,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
30
32
|
required: true;
|
|
31
33
|
};
|
|
32
34
|
searchScheme: {
|
|
33
|
-
type: import("vue").PropType<
|
|
34
|
-
type: string;
|
|
35
|
-
labels: string[];
|
|
36
|
-
url: string;
|
|
37
|
-
}[]>;
|
|
35
|
+
type: import("vue").PropType<ISearchScheme[]>;
|
|
38
36
|
required: true;
|
|
39
37
|
};
|
|
40
38
|
results: {
|
|
41
|
-
type: import("vue").PropType<
|
|
42
|
-
[key: string]: {
|
|
43
|
-
_id?: string | undefined;
|
|
44
|
-
}[] | {
|
|
45
|
-
[key: string]: string;
|
|
46
|
-
}[] | undefined;
|
|
47
|
-
}>;
|
|
39
|
+
type: import("vue").PropType<ISearchResult>;
|
|
48
40
|
};
|
|
49
41
|
isSuccess: {
|
|
50
42
|
type: import("vue").PropType<boolean>;
|
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
import "./UiSearch.css";
|
|
2
|
-
import { openBlock as n, createElementBlock as
|
|
3
|
-
import { RouterLink as
|
|
4
|
-
import { o as
|
|
5
|
-
import
|
|
6
|
-
import { _ as
|
|
7
|
-
const
|
|
2
|
+
import { openBlock as n, createElementBlock as s, createElementVNode as O, defineComponent as R, ref as N, computed as I, normalizeClass as g, createVNode as T, withKeys as b, unref as V, Fragment as d, createTextVNode as w, toDisplayString as S, createCommentVNode as h, renderList as E, createBlock as B, resolveDynamicComponent as L, withCtx as U } from "vue";
|
|
3
|
+
import { RouterLink as $ } from "vue-router";
|
|
4
|
+
import { o as M } from "../index-e9b7d99f.js";
|
|
5
|
+
import D from "../UiInput/UiInput.js";
|
|
6
|
+
import { _ as Z } from "../_plugin-vue_export-helper-dad06003.js";
|
|
7
|
+
const q = {
|
|
8
8
|
trailing: !0
|
|
9
9
|
};
|
|
10
|
-
function F(m,
|
|
11
|
-
if (e = { ...
|
|
10
|
+
function F(m, r = 25, e = {}) {
|
|
11
|
+
if (e = { ...q, ...e }, !Number.isFinite(r))
|
|
12
12
|
throw new TypeError("Expected `wait` to be a finite number");
|
|
13
|
-
let
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
16
|
-
const
|
|
17
|
-
return
|
|
13
|
+
let u, c, y = [], o, a;
|
|
14
|
+
const f = (l, i) => (o = K(m, l, i), o.finally(() => {
|
|
15
|
+
if (o = null, e.trailing && a && !c) {
|
|
16
|
+
const _ = f(l, a);
|
|
17
|
+
return a = null, _;
|
|
18
18
|
}
|
|
19
|
-
}),
|
|
20
|
-
return function(...
|
|
21
|
-
return
|
|
22
|
-
const
|
|
19
|
+
}), o);
|
|
20
|
+
return function(...l) {
|
|
21
|
+
return o ? (e.trailing && (a = l), o) : new Promise((i) => {
|
|
22
|
+
const _ = !c && e.leading;
|
|
23
23
|
clearTimeout(c), c = setTimeout(() => {
|
|
24
24
|
c = null;
|
|
25
|
-
const
|
|
26
|
-
for (const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
25
|
+
const t = e.leading ? u : f(this, l);
|
|
26
|
+
for (const k of y)
|
|
27
|
+
k(t);
|
|
28
|
+
y = [];
|
|
29
|
+
}, r), _ ? (u = f(this, l), i(u)) : y.push(i);
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
async function K(m,
|
|
34
|
-
return await m.apply(
|
|
33
|
+
async function K(m, r, e) {
|
|
34
|
+
return await m.apply(r, e);
|
|
35
35
|
}
|
|
36
|
-
const
|
|
36
|
+
const P = {
|
|
37
37
|
xmlns: "http://www.w3.org/2000/svg",
|
|
38
38
|
width: "16",
|
|
39
39
|
height: "16",
|
|
40
40
|
fill: "none"
|
|
41
|
-
},
|
|
41
|
+
}, A = /* @__PURE__ */ O("path", {
|
|
42
42
|
fill: "#dfdfdf",
|
|
43
43
|
d: "M13.5 15.338a.5.5 0 1 0 .737-.676l-.736.676Zm.737-.676-1.398-1.523-.737.676 1.399 1.523.736-.676ZM13.5 7.628c0 3.394-2.695 6.129-6 6.129v1c3.875 0 7-3.201 7-7.129h-1Zm-6 6.129c-3.305 0-6-2.735-6-6.129h-1c0 3.928 3.125 7.129 7 7.129v-1Zm-6-6.129c0-3.393 2.695-6.128 6-6.128v-1C3.625.5.5 3.7.5 7.628h1Zm6-6.128c3.305 0 6 2.735 6 6.128h1C14.5 3.701 11.375.5 7.5.5v1Z"
|
|
44
|
-
}, null, -1),
|
|
45
|
-
|
|
44
|
+
}, null, -1), Y = [
|
|
45
|
+
A
|
|
46
46
|
];
|
|
47
|
-
function j(m,
|
|
48
|
-
return n(),
|
|
47
|
+
function j(m, r) {
|
|
48
|
+
return n(), s("svg", P, Y);
|
|
49
49
|
}
|
|
50
|
-
const x = { render: j }, z = /* @__PURE__ */
|
|
50
|
+
const x = { render: j }, z = "Please enter 3 or more symbols", G = "Loading...", H = "No results", J = 300, Q = /* @__PURE__ */ R({
|
|
51
51
|
__name: "UiSearch",
|
|
52
52
|
props: {
|
|
53
53
|
modelValue: {},
|
|
@@ -56,66 +56,77 @@ const x = { render: j }, z = /* @__PURE__ */ $({
|
|
|
56
56
|
isSuccess: { type: Boolean }
|
|
57
57
|
},
|
|
58
58
|
emits: ["update:modelValue"],
|
|
59
|
-
setup(m, { emit:
|
|
60
|
-
const e = m,
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
async function
|
|
59
|
+
setup(m, { emit: r }) {
|
|
60
|
+
const e = m, u = N(!1), c = F(async (t) => {
|
|
61
|
+
r("update:modelValue", t);
|
|
62
|
+
}, J);
|
|
63
|
+
async function y(t) {
|
|
64
64
|
await c(t);
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
|
|
66
|
+
function o() {
|
|
67
|
+
u.value = !0;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
|
|
69
|
+
function a() {
|
|
70
|
+
u.value = !1;
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
function f() {
|
|
73
|
+
a(), r("update:modelValue", "");
|
|
74
|
+
}
|
|
75
|
+
const l = I(() => e.results ? Object.values(e.results).reduce((t, k) => t + (k ? k.length : 0), 0) : !1), i = N();
|
|
76
|
+
M(i, () => {
|
|
77
|
+
a();
|
|
75
78
|
});
|
|
76
|
-
const
|
|
77
|
-
return (t,
|
|
78
|
-
class:
|
|
79
|
+
const _ = I(() => window.IS_STORYBOOK ? "a" : $);
|
|
80
|
+
return (t, k) => (n(), s("div", {
|
|
81
|
+
class: g(t.$style.container),
|
|
79
82
|
ref_key: "containerElement",
|
|
80
|
-
ref:
|
|
83
|
+
ref: i
|
|
81
84
|
}, [
|
|
82
|
-
|
|
85
|
+
T(D, {
|
|
83
86
|
modelValue: e.modelValue,
|
|
84
|
-
"onUpdate:modelValue":
|
|
85
|
-
|
|
87
|
+
"onUpdate:modelValue": y,
|
|
88
|
+
onClick: o,
|
|
89
|
+
onKeyup: b(a, ["esc"]),
|
|
90
|
+
appendIcon: V(x),
|
|
86
91
|
placeholder: "Search",
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
a.value && e.modelValue.length ? (n(), l("div", {
|
|
92
|
+
"data-test": "ui-search"
|
|
93
|
+
}, null, 8, ["modelValue", "onKeyup", "appendIcon"]),
|
|
94
|
+
u.value && e.modelValue.length ? (n(), s("div", {
|
|
91
95
|
key: 0,
|
|
92
|
-
class:
|
|
96
|
+
class: g(t.$style.results),
|
|
97
|
+
"data-test": "ui-search-results"
|
|
93
98
|
}, [
|
|
94
|
-
e.modelValue.length < 3 ? (n(),
|
|
95
|
-
|
|
99
|
+
e.modelValue.length < 3 ? (n(), s(d, { key: 0 }, [
|
|
100
|
+
w(S(V(z)), 1)
|
|
96
101
|
], 64)) : h("", !0),
|
|
97
|
-
e.modelValue.length > 2 && !e.isSuccess ? (n(),
|
|
98
|
-
|
|
102
|
+
e.modelValue.length > 2 && !e.isSuccess ? (n(), s(d, { key: 1 }, [
|
|
103
|
+
w(S(V(G)), 1)
|
|
99
104
|
], 64)) : h("", !0),
|
|
100
|
-
e.modelValue.length > 2 && !
|
|
101
|
-
|
|
105
|
+
e.modelValue.length > 2 && !l.value && e.isSuccess ? (n(), s(d, { key: 2 }, [
|
|
106
|
+
w(S(V(H)), 1)
|
|
102
107
|
], 64)) : h("", !0),
|
|
103
|
-
e.modelValue.length > 2 &&
|
|
104
|
-
key:
|
|
105
|
-
class:
|
|
108
|
+
e.modelValue.length > 2 && l.value && e.isSuccess ? (n(!0), s(d, { key: 3 }, E(e.searchScheme, (p) => (n(), s("div", {
|
|
109
|
+
key: p.type,
|
|
110
|
+
class: g(t.$style.resultsInner),
|
|
111
|
+
"data-test": "ui-search-result"
|
|
106
112
|
}, [
|
|
107
|
-
t.results?.[
|
|
108
|
-
|
|
109
|
-
class:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
t.results?.[p.type]?.length ? (n(), s(d, { key: 0 }, [
|
|
114
|
+
O("div", {
|
|
115
|
+
class: g(t.$style.type),
|
|
116
|
+
"data-test": "ui-search-result-type"
|
|
117
|
+
}, S(p.type) + ":", 3),
|
|
118
|
+
(n(!0), s(d, null, E(t.results[p.type], (v) => (n(), B(L(_.value), {
|
|
119
|
+
key: v._id,
|
|
120
|
+
to: `${p.url}/${v._id}`,
|
|
121
|
+
onClick: f,
|
|
122
|
+
class: g(t.$style.link),
|
|
123
|
+
"data-test": "ui-search-result-link"
|
|
116
124
|
}, {
|
|
117
125
|
default: U(() => [
|
|
118
|
-
(n(!0),
|
|
126
|
+
(n(!0), s(d, null, E(p.labels, (C) => (n(), s("span", {
|
|
127
|
+
key: C,
|
|
128
|
+
"data-test": "ui-search-result-label"
|
|
129
|
+
}, S(v[C]), 1))), 128))
|
|
119
130
|
]),
|
|
120
131
|
_: 2
|
|
121
132
|
}, 1032, ["to", "class"]))), 128))
|
|
@@ -124,15 +135,15 @@ const x = { render: j }, z = /* @__PURE__ */ $({
|
|
|
124
135
|
], 2)) : h("", !0)
|
|
125
136
|
], 2));
|
|
126
137
|
}
|
|
127
|
-
}),
|
|
128
|
-
container:
|
|
129
|
-
results:
|
|
130
|
-
resultsInner:
|
|
131
|
-
type:
|
|
132
|
-
link:
|
|
133
|
-
},
|
|
134
|
-
$style:
|
|
135
|
-
},
|
|
138
|
+
}), W = "_container_nqol5_1", X = "_results_nqol5_6", ee = "_resultsInner_nqol5_22", te = "_type_nqol5_31", ne = "_link_nqol5_36", se = {
|
|
139
|
+
container: W,
|
|
140
|
+
results: X,
|
|
141
|
+
resultsInner: ee,
|
|
142
|
+
type: te,
|
|
143
|
+
link: ne
|
|
144
|
+
}, le = {
|
|
145
|
+
$style: se
|
|
146
|
+
}, ie = /* @__PURE__ */ Z(Q, [["__cssModules", le]]);
|
|
136
147
|
export {
|
|
137
|
-
|
|
148
|
+
ie as default
|
|
138
149
|
};
|
|
@@ -44,17 +44,17 @@ const A = { render: x }, G = ["onClick", "onKeydown", "onMouseenter", "data-curr
|
|
|
44
44
|
},
|
|
45
45
|
emits: ["update:modelValue", "reachedBottom"],
|
|
46
46
|
setup(y, { emit: m }) {
|
|
47
|
-
const t = y,
|
|
47
|
+
const t = y, f = a(""), $ = E(() => typeof t.options?.[0] == "object"), g = E(() => {
|
|
48
48
|
if (!t.options)
|
|
49
49
|
return [];
|
|
50
50
|
let e = t.options;
|
|
51
|
-
return $.value || (e = t.options.map((o) => ({ _id: o, title: o }))), t.isFilter ? e.filter((o) => o.title.toLowerCase().includes(
|
|
52
|
-
}), i = a(!1), r = a(),
|
|
51
|
+
return $.value || (e = t.options.map((o) => ({ _id: o, title: o }))), t.isFilter ? e.filter((o) => o.title.toLowerCase().includes(f.value.toLowerCase())) : e;
|
|
52
|
+
}), i = a(!1), r = a(), v = a(), w = a([]);
|
|
53
53
|
function _(e) {
|
|
54
54
|
e < 0 || e === g.value.length || t.isFilter || w.value[e]?.focus();
|
|
55
55
|
}
|
|
56
56
|
function c() {
|
|
57
|
-
r.value?.removeEventListener("scroll", C, !0),
|
|
57
|
+
r.value?.removeEventListener("scroll", C, !0), f.value = "", i.value = !1;
|
|
58
58
|
}
|
|
59
59
|
function V() {
|
|
60
60
|
i.value = !0, t.isFilter || setTimeout(() => {
|
|
@@ -65,9 +65,9 @@ const A = { render: x }, G = ["onClick", "onKeydown", "onMouseenter", "data-curr
|
|
|
65
65
|
m("update:modelValue", $.value ? e : e._id), c();
|
|
66
66
|
}
|
|
67
67
|
function C() {
|
|
68
|
-
if (!r.value || !
|
|
68
|
+
if (!r.value || !v.value)
|
|
69
69
|
return;
|
|
70
|
-
r.value.getBoundingClientRect().y -
|
|
70
|
+
r.value.getBoundingClientRect().y - v.value.getBoundingClientRect().y - v.value.scrollHeight + r.value.getBoundingClientRect().height > -100 && m("reachedBottom");
|
|
71
71
|
}
|
|
72
72
|
const F = a();
|
|
73
73
|
return U(F, () => {
|
|
@@ -82,29 +82,32 @@ const A = { render: x }, G = ["onClick", "onKeydown", "onMouseenter", "data-curr
|
|
|
82
82
|
onToggle: o[0] || (o[0] = (n) => i.value ? c() : V()),
|
|
83
83
|
mode: "select",
|
|
84
84
|
placeholder: "Choose variant",
|
|
85
|
-
appendIcon: i.value ? j(A) : j(D)
|
|
85
|
+
appendIcon: i.value ? j(A) : j(D),
|
|
86
|
+
"data-test": "ui-select-input"
|
|
86
87
|
}, null, 8, ["modelValue", "appendIcon"]),
|
|
87
88
|
t.isFilter && i.value ? (l(), s("div", {
|
|
88
89
|
key: 0,
|
|
89
90
|
class: d(e.$style.filter)
|
|
90
91
|
}, [
|
|
91
92
|
b(B, {
|
|
92
|
-
modelValue:
|
|
93
|
-
"onUpdate:modelValue": o[1] || (o[1] = (n) =>
|
|
93
|
+
modelValue: f.value,
|
|
94
|
+
"onUpdate:modelValue": o[1] || (o[1] = (n) => f.value = n),
|
|
94
95
|
placeholder: "Filter Variants",
|
|
95
|
-
isFocus: ""
|
|
96
|
+
isFocus: "",
|
|
97
|
+
"data-test": "ui-select-input-filter"
|
|
96
98
|
}, null, 8, ["modelValue"])
|
|
97
99
|
], 2)) : O("", !0),
|
|
98
100
|
i.value ? (l(), s("div", {
|
|
99
101
|
key: 1,
|
|
100
102
|
class: d(e.$style.options),
|
|
101
103
|
ref_key: "optionsElement",
|
|
102
|
-
ref: r
|
|
104
|
+
ref: r,
|
|
105
|
+
"data-test": "ui-select-options"
|
|
103
106
|
}, [
|
|
104
107
|
g.value.length ? (l(), s("div", {
|
|
105
108
|
key: 0,
|
|
106
109
|
ref_key: "optionsInnerElement",
|
|
107
|
-
ref:
|
|
110
|
+
ref: v
|
|
108
111
|
}, [
|
|
109
112
|
(l(!0), s(S, null, M(g.value, (n, h) => (l(), s("div", {
|
|
110
113
|
key: `${n}-${h}`,
|
|
@@ -122,14 +125,16 @@ const A = { render: x }, G = ["onClick", "onKeydown", "onMouseenter", "data-curr
|
|
|
122
125
|
ref_for: !0,
|
|
123
126
|
ref_key: "optionElement",
|
|
124
127
|
ref: w,
|
|
125
|
-
"data-current": typeof t.modelValue == "string" ? t.modelValue === n._id : t.modelValue?._id === n._id
|
|
128
|
+
"data-current": typeof t.modelValue == "string" ? t.modelValue === n._id : t.modelValue?._id === n._id,
|
|
129
|
+
"data-test": "ui-select-option"
|
|
126
130
|
}, N(n.title), 43, G))), 128))
|
|
127
131
|
], 512)) : (l(), s("div", {
|
|
128
132
|
key: 1,
|
|
129
133
|
onClick: c,
|
|
130
134
|
class: d(e.$style.option),
|
|
131
|
-
tabindex: "0"
|
|
132
|
-
|
|
135
|
+
tabindex: "0",
|
|
136
|
+
"data-test": "ui-select-no-results"
|
|
137
|
+
}, " No results ", 2))
|
|
133
138
|
], 2)) : O("", !0)
|
|
134
139
|
], 2));
|
|
135
140
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./UiSlider.css";
|
|
2
|
-
import { defineComponent as u, ref as
|
|
2
|
+
import { defineComponent as u, ref as d, openBlock as i, createElementBlock as c, normalizeClass as l, createElementVNode as a, Fragment as m, renderList as _ } from "vue";
|
|
3
3
|
import { _ as h } from "../_plugin-vue_export-helper-dad06003.js";
|
|
4
|
-
const p = ["onClick", "data-active"],
|
|
4
|
+
const p = ["onClick", "data-active"], b = ["src", "alt"], v = ["src", "alt", "data-slide"], $ = /* @__PURE__ */ u({
|
|
5
5
|
__name: "UiSlider",
|
|
6
6
|
props: {
|
|
7
7
|
thumbs: {},
|
|
@@ -9,37 +9,40 @@ const p = ["onClick", "data-active"], $ = ["src", "alt"], b = ["src", "alt"], v
|
|
|
9
9
|
path: {}
|
|
10
10
|
},
|
|
11
11
|
setup(r) {
|
|
12
|
-
const s = r, t =
|
|
13
|
-
return (e, B) => (
|
|
14
|
-
class:
|
|
12
|
+
const s = r, t = d(0);
|
|
13
|
+
return (e, B) => (i(), c("div", {
|
|
14
|
+
class: l(e.$style.container)
|
|
15
15
|
}, [
|
|
16
|
-
|
|
17
|
-
class:
|
|
16
|
+
a("div", {
|
|
17
|
+
class: l(e.$style.thumbs)
|
|
18
18
|
}, [
|
|
19
|
-
(
|
|
20
|
-
key:
|
|
21
|
-
onClick: (E) => t.value =
|
|
19
|
+
(i(!0), c(m, null, _(s.thumbs, (o, n) => (i(), c("button", {
|
|
20
|
+
key: o,
|
|
21
|
+
onClick: (E) => t.value = n,
|
|
22
22
|
type: "button",
|
|
23
|
-
class:
|
|
24
|
-
"data-active": t.value ===
|
|
23
|
+
class: l(e.$style.thumb),
|
|
24
|
+
"data-active": t.value === n,
|
|
25
|
+
"data-test": "ui-slider-thumb"
|
|
25
26
|
}, [
|
|
26
|
-
|
|
27
|
-
src: s.path ? `${s.path}${
|
|
27
|
+
a("img", {
|
|
28
|
+
src: s.path ? `${s.path}${o}` : o,
|
|
28
29
|
width: "64",
|
|
29
30
|
height: "64",
|
|
30
|
-
alt: `
|
|
31
|
+
alt: `thumb-${n}`,
|
|
31
32
|
crossorigin: "anonymous"
|
|
32
|
-
}, null, 8,
|
|
33
|
+
}, null, 8, b)
|
|
33
34
|
], 10, p))), 128))
|
|
34
35
|
], 2),
|
|
35
|
-
|
|
36
|
-
class:
|
|
36
|
+
a("div", {
|
|
37
|
+
class: l(e.$style.slide)
|
|
37
38
|
}, [
|
|
38
|
-
|
|
39
|
+
a("img", {
|
|
39
40
|
src: s.path ? `${s.path}${s.slides[t.value]}` : s.slides[t.value],
|
|
40
|
-
alt: `
|
|
41
|
-
crossorigin: "anonymous"
|
|
42
|
-
|
|
41
|
+
alt: `slide-${t.value}`,
|
|
42
|
+
crossorigin: "anonymous",
|
|
43
|
+
"data-slide": t.value,
|
|
44
|
+
"data-test": "ui-slider-slide"
|
|
45
|
+
}, null, 8, v)
|
|
43
46
|
], 2)
|
|
44
47
|
], 2));
|
|
45
48
|
}
|
|
@@ -50,7 +53,7 @@ const p = ["onClick", "data-active"], $ = ["src", "alt"], b = ["src", "alt"], v
|
|
|
50
53
|
slide: g
|
|
51
54
|
}, S = {
|
|
52
55
|
$style: C
|
|
53
|
-
}, w = /* @__PURE__ */ h(
|
|
56
|
+
}, w = /* @__PURE__ */ h($, [["__cssModules", S]]);
|
|
54
57
|
export {
|
|
55
58
|
w as default
|
|
56
59
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import "./UiSpoiler.css";
|
|
2
|
-
import { openBlock as r, createElementBlock as
|
|
2
|
+
import { openBlock as r, createElementBlock as a, createElementVNode as o, defineComponent as c, normalizeClass as e, createVNode as d, unref as p, toDisplayString as u, withDirectives as _, renderSlot as m, vShow as h } from "vue";
|
|
3
3
|
import { _ as y } from "../_plugin-vue_export-helper-dad06003.js";
|
|
4
|
-
const
|
|
4
|
+
const b = {
|
|
5
5
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6
6
|
width: "16",
|
|
7
7
|
height: "16",
|
|
8
8
|
fill: "none"
|
|
9
|
-
},
|
|
9
|
+
}, f = /* @__PURE__ */ o("path", {
|
|
10
10
|
stroke: "currentColor",
|
|
11
11
|
"stroke-linecap": "round",
|
|
12
12
|
"stroke-linejoin": "round",
|
|
13
13
|
d: "m1 5 7.17 6L15 5"
|
|
14
|
-
}, null, -1),
|
|
15
|
-
|
|
14
|
+
}, null, -1), k = [
|
|
15
|
+
f
|
|
16
16
|
];
|
|
17
|
-
function
|
|
18
|
-
return r(),
|
|
17
|
+
function w(s, n) {
|
|
18
|
+
return r(), a("svg", b, k);
|
|
19
19
|
}
|
|
20
|
-
const
|
|
20
|
+
const $ = { render: w }, v = /* @__PURE__ */ c({
|
|
21
21
|
__name: "UiSpoiler",
|
|
22
22
|
props: {
|
|
23
23
|
modelValue: { type: Boolean },
|
|
@@ -25,35 +25,38 @@ const b = { render: $ }, v = /* @__PURE__ */ a({
|
|
|
25
25
|
},
|
|
26
26
|
emits: ["update:modelValue"],
|
|
27
27
|
setup(s, { emit: n }) {
|
|
28
|
-
const
|
|
29
|
-
return (
|
|
30
|
-
class: t
|
|
28
|
+
const l = s;
|
|
29
|
+
return (t, i) => (r(), a("div", {
|
|
30
|
+
class: e(t.$style.container)
|
|
31
31
|
}, [
|
|
32
|
-
|
|
33
|
-
onClick: i[0] || (i[0] = (E) => n("update:modelValue", !
|
|
34
|
-
class: t
|
|
35
|
-
type: "button"
|
|
32
|
+
o("button", {
|
|
33
|
+
onClick: i[0] || (i[0] = (E) => n("update:modelValue", !l.modelValue)),
|
|
34
|
+
class: e(t.$style.titleBlock),
|
|
35
|
+
type: "button",
|
|
36
|
+
"data-test": "ui-spoiler-button"
|
|
36
37
|
}, [
|
|
37
|
-
|
|
38
|
-
class: t
|
|
38
|
+
o("div", {
|
|
39
|
+
class: e(t.$style.title)
|
|
39
40
|
}, [
|
|
40
|
-
d(p(
|
|
41
|
-
"data-expanded":
|
|
42
|
-
class: t
|
|
41
|
+
d(p($), {
|
|
42
|
+
"data-expanded": l.modelValue,
|
|
43
|
+
class: e(t.$style.icon),
|
|
43
44
|
width: "16",
|
|
44
45
|
height: "16"
|
|
45
46
|
}, null, 8, ["data-expanded", "class"]),
|
|
46
|
-
|
|
47
|
-
class: t
|
|
48
|
-
|
|
47
|
+
o("span", {
|
|
48
|
+
class: e(t.$style.titleText),
|
|
49
|
+
"data-test": "ui-spoiler-button-title"
|
|
50
|
+
}, u(l.title), 3)
|
|
49
51
|
], 2)
|
|
50
52
|
], 2),
|
|
51
|
-
|
|
52
|
-
class: t
|
|
53
|
+
_(o("div", {
|
|
54
|
+
class: e(t.$style.spoiler),
|
|
55
|
+
"data-test": "ui-spoiler"
|
|
53
56
|
}, [
|
|
54
|
-
m(
|
|
57
|
+
m(t.$slots, "default")
|
|
55
58
|
], 2), [
|
|
56
|
-
[h,
|
|
59
|
+
[h, l.modelValue]
|
|
57
60
|
])
|
|
58
61
|
], 2));
|
|
59
62
|
}
|
package/dist/UiTable/UiTable.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./UiTable.css";
|
|
2
|
-
import { defineComponent as g, ref as i, onMounted as v, onBeforeUnmount as f, openBlock as o, createElementBlock as n, normalizeClass as
|
|
3
|
-
import { _ as
|
|
4
|
-
const
|
|
2
|
+
import { defineComponent as g, ref as i, onMounted as v, onBeforeUnmount as f, openBlock as o, createElementBlock as n, normalizeClass as l, createCommentVNode as m, createElementVNode as a, Fragment as k, renderList as h, toDisplayString as z, renderSlot as V } from "vue";
|
|
3
|
+
import { _ as w } from "../_plugin-vue_export-helper-dad06003.js";
|
|
4
|
+
const B = ["data-loading"], $ = { "data-test": "ui-table-header-title" }, S = ["onClick", "data-current"], C = ["data-current", "data-loading"], L = ["data-current", "data-loading"], M = /* @__PURE__ */ g({
|
|
5
5
|
__name: "UiTable",
|
|
6
6
|
props: {
|
|
7
7
|
headers: {},
|
|
@@ -10,86 +10,91 @@ const V = ["data-loading"], $ = ["onClick"], S = ["data-current", "data-loading"
|
|
|
10
10
|
},
|
|
11
11
|
emits: ["update:modelValue", "reset"],
|
|
12
12
|
setup(y, { emit: u }) {
|
|
13
|
-
const
|
|
14
|
-
function
|
|
15
|
-
if (r.value &&
|
|
16
|
-
const e = Number(getComputedStyle(r.value).width.slice(0, -2)),
|
|
17
|
-
|
|
13
|
+
const t = y, r = i(), d = i(), b = i(!1);
|
|
14
|
+
function c() {
|
|
15
|
+
if (r.value && d.value) {
|
|
16
|
+
const e = Number(getComputedStyle(r.value).width.slice(0, -2)), _ = Number(getComputedStyle(d.value).width.slice(0, -2));
|
|
17
|
+
b.value = _ > e;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
function p(e) {
|
|
21
|
-
|
|
21
|
+
t.modelValue?.value === e ? u("update:modelValue", { value: e, isAsc: !t.modelValue.isAsc }) : u("reset", e);
|
|
22
22
|
}
|
|
23
23
|
return v(() => {
|
|
24
|
-
|
|
24
|
+
c(), window.addEventListener("resize", c, !0);
|
|
25
25
|
}), f(() => {
|
|
26
|
-
window.removeEventListener("resize",
|
|
27
|
-
}), (e,
|
|
28
|
-
class:
|
|
26
|
+
window.removeEventListener("resize", c, !0);
|
|
27
|
+
}), (e, _) => (o(), n("div", {
|
|
28
|
+
class: l(e.$style.tableBlock),
|
|
29
29
|
ref_key: "tableBlock",
|
|
30
30
|
ref: r
|
|
31
31
|
}, [
|
|
32
|
-
|
|
32
|
+
b.value ? (o(), n("div", {
|
|
33
33
|
key: 0,
|
|
34
|
-
class:
|
|
34
|
+
class: l(e.$style.scrollMessage)
|
|
35
35
|
}, "Table is scrollable →", 2)) : m("", !0),
|
|
36
|
-
|
|
37
|
-
class:
|
|
36
|
+
a("table", {
|
|
37
|
+
class: l(e.$style.table),
|
|
38
38
|
cellpadding: "8",
|
|
39
39
|
cellspacing: "0",
|
|
40
40
|
border: 0,
|
|
41
41
|
ref_key: "table",
|
|
42
|
-
ref:
|
|
42
|
+
ref: d
|
|
43
43
|
}, [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
(o(!0), n(k, null,
|
|
47
|
-
key:
|
|
48
|
-
class:
|
|
44
|
+
a("thead", null, [
|
|
45
|
+
a("tr", null, [
|
|
46
|
+
(o(!0), n(k, null, h(t.headers, (s) => (o(), n("th", {
|
|
47
|
+
key: s.value,
|
|
48
|
+
class: l(e.$style.th),
|
|
49
|
+
"data-test": "ui-table-header"
|
|
49
50
|
}, [
|
|
50
|
-
|
|
51
|
-
class:
|
|
52
|
-
"data-loading":
|
|
51
|
+
a("label", {
|
|
52
|
+
class: l(e.$style.label),
|
|
53
|
+
"data-loading": t.isLoading
|
|
53
54
|
}, [
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
a("span", $, z(s.title), 1),
|
|
56
|
+
s.value ? (o(), n("button", {
|
|
56
57
|
key: 0,
|
|
58
|
+
onClick: (G) => p(s.value),
|
|
59
|
+
class: l(e.$style.sort),
|
|
57
60
|
type: "button",
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
"data-current": t.modelValue?.value === s.value,
|
|
62
|
+
"data-test": "ui-table-header-sort"
|
|
60
63
|
}, [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"data-loading":
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
class:
|
|
69
|
-
"data-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
64
|
+
a("span", {
|
|
65
|
+
class: l(e.$style.arrow),
|
|
66
|
+
"data-current": t.modelValue?.isAsc && t.modelValue?.value === s.value,
|
|
67
|
+
"data-loading": t.isLoading,
|
|
68
|
+
"data-test": "ui-table-header-sort-asc"
|
|
69
|
+
}, " ↑ ", 10, C),
|
|
70
|
+
a("span", {
|
|
71
|
+
class: l(e.$style.arrow),
|
|
72
|
+
"data-current": !t.modelValue?.isAsc && t.modelValue?.value === s.value,
|
|
73
|
+
"data-loading": t.isLoading,
|
|
74
|
+
"data-test": "ui-table-header-sort-desc"
|
|
75
|
+
}, " ↓ ", 10, L)
|
|
76
|
+
], 10, S)) : m("", !0)
|
|
77
|
+
], 10, B)
|
|
73
78
|
], 2))), 128))
|
|
74
79
|
])
|
|
75
80
|
]),
|
|
76
|
-
|
|
77
|
-
|
|
81
|
+
a("tbody", null, [
|
|
82
|
+
V(e.$slots, "default")
|
|
78
83
|
])
|
|
79
84
|
], 2)
|
|
80
85
|
], 2));
|
|
81
86
|
}
|
|
82
|
-
}),
|
|
83
|
-
tableBlock:
|
|
84
|
-
scrollMessage:
|
|
85
|
-
table:
|
|
86
|
-
th:
|
|
87
|
-
label:
|
|
88
|
-
sort:
|
|
89
|
-
arrow:
|
|
90
|
-
},
|
|
91
|
-
$style:
|
|
92
|
-
},
|
|
87
|
+
}), A = "_tableBlock_szy89_1", E = "_scrollMessage_szy89_6", N = "_table_szy89_1", T = "_th_szy89_27", U = "_label_szy89_39", D = "_sort_szy89_57", F = "_arrow_szy89_69", j = {
|
|
88
|
+
tableBlock: A,
|
|
89
|
+
scrollMessage: E,
|
|
90
|
+
table: N,
|
|
91
|
+
th: T,
|
|
92
|
+
label: U,
|
|
93
|
+
sort: D,
|
|
94
|
+
arrow: F
|
|
95
|
+
}, q = {
|
|
96
|
+
$style: j
|
|
97
|
+
}, J = /* @__PURE__ */ w(M, [["__cssModules", q]]);
|
|
93
98
|
export {
|
|
94
|
-
|
|
99
|
+
J as default
|
|
95
100
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._container_1acec_1{display:flex;gap:16px}._upload_1acec_6{display:flex;flex-direction:column;gap:4px}._addButton_1acec_12{display:flex;flex-direction:column;gap:8px;min-width:200px}._text_1acec_19{font-size:.75rem}._text_1acec_19[data-error=true]{color:var(--color-error)}._input_1acec_26{display:none}._name_1acec_30{flex:1;max-width:136px;overflow:hidden;font-size:.875rem;text-overflow:ellipsis}._file_1acec_38{display:flex;gap:8px;align-items:center}._error_1acec_44{color:var(--color-error)}._uploadButton_1acec_48[data-label=true]{margin-top:28px}
|
|
@@ -3,10 +3,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3
3
|
type: import("vue").PropType<string>;
|
|
4
4
|
default: undefined;
|
|
5
5
|
};
|
|
6
|
-
layout: {
|
|
7
|
-
type: import("vue").PropType<"primary" | "secondary">;
|
|
8
|
-
default: string;
|
|
9
|
-
};
|
|
10
6
|
isDisabled: {
|
|
11
7
|
type: import("vue").PropType<boolean>;
|
|
12
8
|
};
|
|
@@ -37,10 +33,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
37
33
|
type: import("vue").PropType<string>;
|
|
38
34
|
default: undefined;
|
|
39
35
|
};
|
|
40
|
-
layout: {
|
|
41
|
-
type: import("vue").PropType<"primary" | "secondary">;
|
|
42
|
-
default: string;
|
|
43
|
-
};
|
|
44
36
|
isDisabled: {
|
|
45
37
|
type: import("vue").PropType<boolean>;
|
|
46
38
|
};
|
|
@@ -72,7 +64,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
72
64
|
onUpload?: ((...args: any[]) => any) | undefined;
|
|
73
65
|
}, {
|
|
74
66
|
label: string;
|
|
75
|
-
layout: "primary" | "secondary";
|
|
76
67
|
error: string | boolean;
|
|
77
68
|
extensions: string[];
|
|
78
69
|
file: File;
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import "./UiUpload.css";
|
|
2
|
-
import { openBlock as
|
|
2
|
+
import { openBlock as n, createElementBlock as o, createStaticVNode as z, defineComponent as I, ref as $, computed as M, normalizeClass as i, createElementVNode as s, toDisplayString as u, createCommentVNode as c, createVNode as p, unref as k, withCtx as f, createTextVNode as r, Fragment as B, renderList as D, withDirectives as F, vShow as N } from "vue";
|
|
3
3
|
import _ from "../UiButton/UiButton.js";
|
|
4
|
-
import { _ as
|
|
5
|
-
const
|
|
4
|
+
import { _ as U } from "../_plugin-vue_export-helper-dad06003.js";
|
|
5
|
+
const v = 10 * 1024 * 1024;
|
|
6
|
+
new File([""], "file1.png");
|
|
7
|
+
new File([""], "file2.png");
|
|
8
|
+
const V = {
|
|
6
9
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
10
|
width: "16",
|
|
8
11
|
height: "16",
|
|
9
12
|
fill: "none"
|
|
10
|
-
},
|
|
11
|
-
|
|
13
|
+
}, x = /* @__PURE__ */ z('<g fill="currentColor" fill-rule="evenodd" clip-path="url(#a)" clip-rule="evenodd"><path d="M12.219 0h.875C14.719.313 15.688 1.281 16 2.906v.875a3.576 3.576 0 0 1-.766 1.719l-4.546 4.547c-1.024.792-2.149.98-3.376.562a3.552 3.552 0 0 1-1.234-.828c-.247-.498-.117-.857.39-1.078a.979.979 0 0 1 .438.031c.2.169.408.325.625.47.727.375 1.435.344 2.125-.095 1.525-1.494 3.041-2.999 4.547-4.515.619-.881.598-1.746-.062-2.594-.858-.79-1.77-.857-2.735-.203a143.12 143.12 0 0 1-2.531 2.5c-.48.2-.819.06-1.016-.422a.8.8 0 0 1 .094-.563L10.531.735A3.614 3.614 0 0 1 12.22 0Z"></path><path d="M3.781 16h-.875C1.281 15.687.312 14.719 0 13.094v-.875c.101-.64.356-1.213.766-1.719l4.171-4.172c1.105-.844 2.303-1 3.594-.469.307.151.588.339.844.563a.75.75 0 0 1 .266.797c-.182.406-.49.546-.922.422l-.688-.5c-.71-.342-1.398-.3-2.062.125-1.4 1.369-2.791 2.749-4.172 4.14-.627.9-.595 1.774.094 2.625.792.72 1.652.808 2.578.266l2.281-2.219c.586-.212.93-.014 1.031.594a.708.708 0 0 1-.11.39c-.723.725-1.447 1.448-2.171 2.172A3.576 3.576 0 0 1 3.781 16Z"></path></g><defs><clipPath id="a"><path fill="currentColor" d="M0 0h16v16H0z"></path></clipPath></defs>', 2), E = [
|
|
14
|
+
x
|
|
12
15
|
];
|
|
13
|
-
function
|
|
14
|
-
return
|
|
16
|
+
function L(m, d) {
|
|
17
|
+
return n(), o("svg", V, E);
|
|
15
18
|
}
|
|
16
|
-
const
|
|
19
|
+
const R = { render: L }, j = { key: 0 }, q = { "data-test": "ui-upload-label" }, A = ["data-error"], Z = ["accept", "multiple"], P = ["data-label"], H = /* @__PURE__ */ I({
|
|
17
20
|
__name: "UiUpload",
|
|
18
21
|
props: {
|
|
19
|
-
layout: { default: "secondary" },
|
|
20
22
|
label: { default: void 0 },
|
|
21
23
|
file: { default: void 0 },
|
|
22
24
|
files: { default: () => [] },
|
|
@@ -27,136 +29,147 @@ const F = { render: A }, I = { key: 0 }, q = ["data-error"], E = ["accept", "mul
|
|
|
27
29
|
isSingle: { type: Boolean }
|
|
28
30
|
},
|
|
29
31
|
emits: ["add", "remove", "upload"],
|
|
30
|
-
setup(
|
|
31
|
-
const e =
|
|
32
|
-
function
|
|
33
|
-
|
|
32
|
+
setup(m, { emit: d }) {
|
|
33
|
+
const e = m, y = $(), g = $(0), C = M(() => e.extensions.map((t) => `.${t}`).join());
|
|
34
|
+
function S() {
|
|
35
|
+
y?.value?.click?.();
|
|
34
36
|
}
|
|
35
37
|
async function h(t) {
|
|
36
|
-
|
|
38
|
+
d("remove", t), g.value++;
|
|
37
39
|
}
|
|
38
|
-
function
|
|
40
|
+
function b(t) {
|
|
39
41
|
if (e.isSingle) {
|
|
40
42
|
const l = t.files?.[0];
|
|
41
|
-
l?.size && l.size <
|
|
43
|
+
l?.size && l.size < v && d("add", l);
|
|
42
44
|
} else {
|
|
43
45
|
const l = t.files;
|
|
44
46
|
if (l === null)
|
|
45
47
|
return;
|
|
46
|
-
for (let
|
|
47
|
-
l[
|
|
48
|
+
for (let a = 0; a < l.length; a++)
|
|
49
|
+
l[a].size && l[a].size < v && d("add", l[a]);
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
|
-
return (t, l) => (
|
|
51
|
-
class:
|
|
52
|
+
return (t, l) => (n(), o("div", {
|
|
53
|
+
class: i(t.$style.container)
|
|
52
54
|
}, [
|
|
53
|
-
|
|
54
|
-
class:
|
|
55
|
+
s("div", {
|
|
56
|
+
class: i(t.$style.upload)
|
|
55
57
|
}, [
|
|
56
|
-
e.label ? (
|
|
57
|
-
|
|
58
|
-
e.isRequired ? (
|
|
58
|
+
e.label ? (n(), o("div", j, [
|
|
59
|
+
s("span", q, u(e.label), 1),
|
|
60
|
+
e.isRequired ? (n(), o("span", {
|
|
59
61
|
key: 0,
|
|
60
|
-
class:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
class: i(t.$style.error),
|
|
63
|
+
"data-test": "ui-upload-required"
|
|
64
|
+
}, "*", 2)) : c("", !0)
|
|
65
|
+
])) : c("", !0),
|
|
66
|
+
s("div", {
|
|
67
|
+
class: i(t.$style.addButton)
|
|
65
68
|
}, [
|
|
66
69
|
p(_, {
|
|
67
|
-
|
|
70
|
+
onClick: S,
|
|
71
|
+
layout: "secondary",
|
|
68
72
|
isDisabled: e.isDisabled || e.isSingle && e.files.length >= 1 || e.isSingle && !!e.file,
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
icon: k(R),
|
|
74
|
+
"data-test": "ui-upload-add"
|
|
71
75
|
}, {
|
|
72
76
|
default: f(() => [
|
|
73
|
-
|
|
74
|
-
e.isSingle ?
|
|
75
|
-
|
|
77
|
+
r(" Add file"),
|
|
78
|
+
e.isSingle ? c("", !0) : (n(), o(B, { key: 0 }, [
|
|
79
|
+
r("s")
|
|
76
80
|
], 64))
|
|
77
81
|
]),
|
|
78
82
|
_: 1
|
|
79
|
-
}, 8, ["
|
|
80
|
-
|
|
81
|
-
class:
|
|
82
|
-
"data-error": !!e.error
|
|
83
|
-
|
|
83
|
+
}, 8, ["isDisabled", "icon"]),
|
|
84
|
+
s("div", {
|
|
85
|
+
class: i(t.$style.text),
|
|
86
|
+
"data-error": !!e.error,
|
|
87
|
+
"data-test": "ui-upload-text"
|
|
88
|
+
}, " Size up to " + u(k(v) / (1024 * 1024)) + " Mb, " + u(e.extensions.join(", ")) + ". ", 11, A)
|
|
84
89
|
], 2),
|
|
85
|
-
(
|
|
86
|
-
ref_key: "input",
|
|
87
|
-
ref: v,
|
|
88
|
-
class: o(t.$style.input),
|
|
89
|
-
key: m.value,
|
|
90
|
+
(n(), o("input", {
|
|
90
91
|
type: "file",
|
|
91
|
-
|
|
92
|
+
onInput: l[0] || (l[0] = (a) => b(a.target)),
|
|
93
|
+
ref_key: "input",
|
|
94
|
+
ref: y,
|
|
95
|
+
class: i(t.$style.input),
|
|
96
|
+
key: g.value,
|
|
97
|
+
accept: C.value,
|
|
92
98
|
multiple: !e.isSingle,
|
|
93
|
-
|
|
94
|
-
}, null, 42,
|
|
95
|
-
e.files?.length && !e.file ? (
|
|
96
|
-
key: `${
|
|
97
|
-
class:
|
|
99
|
+
"data-test": "ui-upload-input"
|
|
100
|
+
}, null, 42, Z)),
|
|
101
|
+
e.files?.length && !e.file ? (n(!0), o(B, { key: 1 }, D(t.files, (a, w) => (n(), o("div", {
|
|
102
|
+
key: `${a}-${w}`,
|
|
103
|
+
class: i(t.$style.file),
|
|
104
|
+
"data-test": "ui-upload-file"
|
|
98
105
|
}, [
|
|
99
|
-
|
|
100
|
-
class:
|
|
101
|
-
|
|
106
|
+
s("div", {
|
|
107
|
+
class: i(t.$style.name),
|
|
108
|
+
"data-test": "ui-upload-file-name"
|
|
109
|
+
}, u(a.name), 3),
|
|
102
110
|
p(_, {
|
|
103
|
-
onClick: (
|
|
104
|
-
layout: "plain"
|
|
111
|
+
onClick: (le) => h(a),
|
|
112
|
+
layout: "plain",
|
|
113
|
+
"data-test": "ui-upload-file-remove"
|
|
105
114
|
}, {
|
|
106
115
|
default: f(() => [
|
|
107
|
-
|
|
116
|
+
r("Remove")
|
|
108
117
|
]),
|
|
109
118
|
_: 2
|
|
110
119
|
}, 1032, ["onClick"])
|
|
111
|
-
], 2))), 128)) :
|
|
112
|
-
e.isSingle && e.file ? (
|
|
120
|
+
], 2))), 128)) : c("", !0),
|
|
121
|
+
e.isSingle && e.file ? (n(), o("div", {
|
|
113
122
|
key: 2,
|
|
114
|
-
class:
|
|
123
|
+
class: i(t.$style.file),
|
|
124
|
+
"data-test": "ui-upload-file-single"
|
|
115
125
|
}, [
|
|
116
|
-
|
|
117
|
-
class:
|
|
118
|
-
|
|
126
|
+
s("div", {
|
|
127
|
+
class: i(t.$style.name),
|
|
128
|
+
"data-test": "ui-upload-file-name-single"
|
|
129
|
+
}, u(e.file.name), 3),
|
|
119
130
|
p(_, {
|
|
120
|
-
onClick: l[1] || (l[1] = (
|
|
121
|
-
layout: "plain"
|
|
131
|
+
onClick: l[1] || (l[1] = (a) => h(e.file)),
|
|
132
|
+
layout: "plain",
|
|
133
|
+
"data-test": "ui-upload-file-remove-single"
|
|
122
134
|
}, {
|
|
123
135
|
default: f(() => [
|
|
124
|
-
|
|
136
|
+
r("Remove")
|
|
125
137
|
]),
|
|
126
138
|
_: 1
|
|
127
139
|
})
|
|
128
|
-
], 2)) :
|
|
140
|
+
], 2)) : c("", !0)
|
|
129
141
|
], 2),
|
|
130
|
-
|
|
131
|
-
class:
|
|
142
|
+
F(s("div", {
|
|
143
|
+
class: i(t.$style.uploadButton),
|
|
132
144
|
"data-label": !!e.label
|
|
133
145
|
}, [
|
|
134
146
|
p(_, {
|
|
135
|
-
onClick: l[2] || (l[2] = (
|
|
147
|
+
onClick: l[2] || (l[2] = (a) => d("upload")),
|
|
148
|
+
"data-test": "ui-upload"
|
|
136
149
|
}, {
|
|
137
150
|
default: f(() => [
|
|
138
|
-
|
|
151
|
+
r("Upload")
|
|
139
152
|
]),
|
|
140
153
|
_: 1
|
|
141
154
|
})
|
|
142
|
-
], 10,
|
|
143
|
-
[
|
|
155
|
+
], 10, P), [
|
|
156
|
+
[N, e.isSingle && e.file || !!e.files.length]
|
|
144
157
|
])
|
|
145
158
|
], 2));
|
|
146
159
|
}
|
|
147
|
-
}),
|
|
148
|
-
container:
|
|
149
|
-
upload:
|
|
150
|
-
addButton:
|
|
151
|
-
text:
|
|
152
|
-
input:
|
|
153
|
-
name:
|
|
154
|
-
|
|
155
|
-
error:
|
|
156
|
-
uploadButton:
|
|
157
|
-
},
|
|
158
|
-
$style:
|
|
159
|
-
}, oe = /* @__PURE__ */
|
|
160
|
+
}), K = "_container_1acec_1", G = "_upload_1acec_6", J = "_addButton_1acec_12", O = "_text_1acec_19", Q = "_input_1acec_26", T = "_name_1acec_30", W = "_file_1acec_38", X = "_error_1acec_44", Y = "_uploadButton_1acec_48", ee = {
|
|
161
|
+
container: K,
|
|
162
|
+
upload: G,
|
|
163
|
+
addButton: J,
|
|
164
|
+
text: O,
|
|
165
|
+
input: Q,
|
|
166
|
+
name: T,
|
|
167
|
+
file: W,
|
|
168
|
+
error: X,
|
|
169
|
+
uploadButton: Y
|
|
170
|
+
}, te = {
|
|
171
|
+
$style: ee
|
|
172
|
+
}, oe = /* @__PURE__ */ U(H, [["__cssModules", te]]);
|
|
160
173
|
export {
|
|
161
174
|
oe as default
|
|
162
175
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mhz-ui",
|
|
3
3
|
"description": "mhz-ui",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.21",
|
|
5
5
|
"author": "Alexandr Dergunov <dergunovs@mail.ru> (https://github.com/dergunovs)",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -35,34 +35,34 @@
|
|
|
35
35
|
"vue-router": "4.2.5"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@storybook/addon-essentials": "7.4.
|
|
39
|
-
"@storybook/addon-interactions": "7.4.
|
|
40
|
-
"@storybook/addon-links": "7.4.
|
|
41
|
-
"@storybook/blocks": "7.4.
|
|
42
|
-
"@storybook/core-events": "7.4.
|
|
43
|
-
"@storybook/preview-api": "7.4.
|
|
44
|
-
"@storybook/vue3": "7.4.
|
|
45
|
-
"@storybook/vue3-vite": "7.4.
|
|
46
|
-
"@types/node": "20.6.
|
|
38
|
+
"@storybook/addon-essentials": "7.4.4",
|
|
39
|
+
"@storybook/addon-interactions": "7.4.4",
|
|
40
|
+
"@storybook/addon-links": "7.4.4",
|
|
41
|
+
"@storybook/blocks": "7.4.4",
|
|
42
|
+
"@storybook/core-events": "7.4.4",
|
|
43
|
+
"@storybook/preview-api": "7.4.4",
|
|
44
|
+
"@storybook/vue3": "7.4.4",
|
|
45
|
+
"@storybook/vue3-vite": "7.4.4",
|
|
46
|
+
"@types/node": "20.6.4",
|
|
47
47
|
"@typescript-eslint/eslint-plugin": "6.7.2",
|
|
48
48
|
"@typescript-eslint/parser": "6.7.2",
|
|
49
49
|
"@vitejs/plugin-vue": "4.3.4",
|
|
50
50
|
"@vitest/coverage-v8": "0.34.5",
|
|
51
51
|
"@vue/test-utils": "2.4.1",
|
|
52
|
-
"eslint": "8.
|
|
52
|
+
"eslint": "8.50.0",
|
|
53
53
|
"eslint-config-prettier": "9.0.0",
|
|
54
|
-
"eslint-import-resolver-typescript": "3.6.
|
|
54
|
+
"eslint-import-resolver-typescript": "3.6.1",
|
|
55
55
|
"eslint-plugin-import": "2.28.1",
|
|
56
56
|
"eslint-plugin-prettier": "5.0.0",
|
|
57
57
|
"eslint-plugin-vue": "9.17.0",
|
|
58
|
-
"happy-dom": "12.1.
|
|
58
|
+
"happy-dom": "12.1.6",
|
|
59
59
|
"postcss-html": "1.5.0",
|
|
60
60
|
"postcss-scss": "4.0.8",
|
|
61
61
|
"prettier": "3.0.3",
|
|
62
62
|
"react": "18.2.0",
|
|
63
63
|
"react-dom": "18.2.0",
|
|
64
64
|
"sass": "1.68.0",
|
|
65
|
-
"storybook": "7.4.
|
|
65
|
+
"storybook": "7.4.4",
|
|
66
66
|
"stylelint": "15.10.3",
|
|
67
67
|
"stylelint-config-recess-order": "4.3.0",
|
|
68
68
|
"stylelint-config-recommended-scss": "13.0.0",
|