mhz-ui 1.1.26 → 1.1.28
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
interface IOption {
|
|
2
2
|
_id?: string;
|
|
3
3
|
title: string;
|
|
4
|
+
title_en?: string;
|
|
4
5
|
}
|
|
5
6
|
interface IProps {
|
|
6
7
|
modelValue?: string | number | IOption | null;
|
|
@@ -8,6 +9,7 @@ interface IProps {
|
|
|
8
9
|
isFilter?: boolean;
|
|
9
10
|
isDisabled?: boolean;
|
|
10
11
|
lang?: string;
|
|
12
|
+
isLocaleField?: boolean;
|
|
11
13
|
isClearable?: boolean;
|
|
12
14
|
}
|
|
13
15
|
declare const _default: import('vue').DefineComponent<IProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./UiSelect.css";
|
|
2
|
-
import { createElementBlock as
|
|
2
|
+
import { createElementBlock as n, openBlock as s, createElementVNode as w, defineComponent as M, ref as c, computed as m, normalizeClass as u, createCommentVNode as b, createVNode as O, unref as I, Fragment as N, renderList as R, withKeys as v, toDisplayString as z } from "vue";
|
|
3
3
|
import { o as U } from "../index-CVBkjluR.js";
|
|
4
4
|
import T from "../UiInput/UiInput.js";
|
|
5
5
|
import { _ as K } from "../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
@@ -10,7 +10,7 @@ const P = {
|
|
|
10
10
|
fill: "none"
|
|
11
11
|
};
|
|
12
12
|
function x(k, i) {
|
|
13
|
-
return s(),
|
|
13
|
+
return s(), n("svg", P, i[0] || (i[0] = [
|
|
14
14
|
w("path", {
|
|
15
15
|
stroke: "#1F1F1F",
|
|
16
16
|
"stroke-linecap": "round",
|
|
@@ -26,7 +26,7 @@ const H = { render: x }, Q = {
|
|
|
26
26
|
fill: "none"
|
|
27
27
|
};
|
|
28
28
|
function q(k, i) {
|
|
29
|
-
return s(),
|
|
29
|
+
return s(), n("svg", Q, i[0] || (i[0] = [
|
|
30
30
|
w("path", {
|
|
31
31
|
stroke: "#1F1F1F",
|
|
32
32
|
"stroke-linecap": "round",
|
|
@@ -43,13 +43,14 @@ const A = { render: q }, G = ["onClick", "onKeydown", "onMouseenter", "data-curr
|
|
|
43
43
|
isFilter: { type: Boolean },
|
|
44
44
|
isDisabled: { type: Boolean },
|
|
45
45
|
lang: {},
|
|
46
|
+
isLocaleField: { type: Boolean },
|
|
46
47
|
isClearable: { type: Boolean }
|
|
47
48
|
},
|
|
48
49
|
emits: ["update:modelValue", "reachedBottom"],
|
|
49
50
|
setup(k, { emit: i }) {
|
|
50
51
|
const e = k, h = i, f = c(""), j = m(() => e.lang === "en" ? "Choose variant" : "Выбрать"), D = m(() => e.lang === "en" ? "Filter Variants" : "Фильтровать"), S = m(() => e.lang === "en" ? "No results" : "Нет результатов"), C = m(() => typeof e.options?.[0] == "object"), V = m(() => {
|
|
51
52
|
if (!e.options) return [];
|
|
52
|
-
let t = e.options;
|
|
53
|
+
let t = e.isLocaleField ? e.options.map((o) => ({ _id: o._id, title: o.title_en })) : [...e.options];
|
|
53
54
|
return C.value || (t = e.options.map((o) => ({ _id: o, title: o }))), e.isFilter ? t.filter((o) => o.title.toLowerCase().includes(f.value.toLowerCase())) : t;
|
|
54
55
|
}), r = c(!1), a = c(), y = c(), F = c([]);
|
|
55
56
|
function _(t) {
|
|
@@ -70,61 +71,61 @@ const A = { render: q }, G = ["onClick", "onKeydown", "onMouseenter", "data-curr
|
|
|
70
71
|
if (!a.value || !y.value) return;
|
|
71
72
|
a.value.getBoundingClientRect().y - y.value.getBoundingClientRect().y - y.value.scrollHeight + a.value.getBoundingClientRect().height > -100 && h("reachedBottom");
|
|
72
73
|
}
|
|
73
|
-
const
|
|
74
|
-
return U(
|
|
74
|
+
const L = c();
|
|
75
|
+
return U(L, () => {
|
|
75
76
|
p();
|
|
76
|
-
}), (t, o) => (s(),
|
|
77
|
+
}), (t, o) => (s(), n("div", {
|
|
77
78
|
class: u(t.$style.container),
|
|
78
79
|
ref_key: "containerElement",
|
|
79
|
-
ref:
|
|
80
|
+
ref: L
|
|
80
81
|
}, [
|
|
81
82
|
w("div", {
|
|
82
83
|
class: u(t.$style.input)
|
|
83
84
|
}, [
|
|
84
|
-
|
|
85
|
+
O(T, {
|
|
85
86
|
modelValue: typeof e.modelValue == "string" || typeof e.modelValue == "number" ? e.modelValue : e.modelValue?.title,
|
|
86
87
|
disabled: e.isDisabled,
|
|
87
|
-
onToggle: o[0] || (o[0] = (
|
|
88
|
+
onToggle: o[0] || (o[0] = (l) => r.value ? p() : E()),
|
|
88
89
|
mode: "select",
|
|
89
90
|
placeholder: j.value,
|
|
90
|
-
appendIcon: r.value ?
|
|
91
|
+
appendIcon: r.value ? I(A) : I(H)
|
|
91
92
|
}, null, 8, ["modelValue", "disabled", "placeholder", "appendIcon"]),
|
|
92
|
-
e.isFilter && r.value ? (s(),
|
|
93
|
+
e.isFilter && r.value ? (s(), n("div", {
|
|
93
94
|
key: 0,
|
|
94
95
|
class: u(t.$style.filter)
|
|
95
96
|
}, [
|
|
96
|
-
|
|
97
|
+
O(T, {
|
|
97
98
|
modelValue: f.value,
|
|
98
|
-
"onUpdate:modelValue": o[1] || (o[1] = (
|
|
99
|
+
"onUpdate:modelValue": o[1] || (o[1] = (l) => f.value = l),
|
|
99
100
|
disabled: e.isDisabled,
|
|
100
101
|
placeholder: D.value,
|
|
101
102
|
isFocus: ""
|
|
102
103
|
}, null, 8, ["modelValue", "disabled", "placeholder"])
|
|
103
104
|
], 2)) : b("", !0),
|
|
104
|
-
e.isClearable && e.modelValue ? (s(),
|
|
105
|
+
e.isClearable && e.modelValue ? (s(), n("button", {
|
|
105
106
|
key: 1,
|
|
106
|
-
onClick: o[2] || (o[2] = (
|
|
107
|
+
onClick: o[2] || (o[2] = (l) => h("update:modelValue", void 0)),
|
|
107
108
|
type: "button",
|
|
108
109
|
class: u(t.$style.clear)
|
|
109
110
|
}, " × ", 2)) : b("", !0)
|
|
110
111
|
], 2),
|
|
111
|
-
r.value ? (s(),
|
|
112
|
+
r.value ? (s(), n("div", {
|
|
112
113
|
key: 0,
|
|
113
114
|
class: u(t.$style.options),
|
|
114
115
|
ref_key: "optionsElement",
|
|
115
116
|
ref: a
|
|
116
117
|
}, [
|
|
117
|
-
V.value.length ? (s(),
|
|
118
|
+
V.value.length ? (s(), n("div", {
|
|
118
119
|
key: 0,
|
|
119
120
|
ref_key: "optionsInnerElement",
|
|
120
121
|
ref: y
|
|
121
122
|
}, [
|
|
122
|
-
(s(!0),
|
|
123
|
-
key: `${
|
|
124
|
-
onClick: (d) => $(
|
|
123
|
+
(s(!0), n(N, null, R(V.value, (l, g) => (s(), n("div", {
|
|
124
|
+
key: `${l}-${g}`,
|
|
125
|
+
onClick: (d) => $(l),
|
|
125
126
|
onKeydown: [
|
|
126
|
-
v((d) => $(
|
|
127
|
-
v((d) => $(
|
|
127
|
+
v((d) => $(l), ["enter"]),
|
|
128
|
+
v((d) => $(l), ["space"]),
|
|
128
129
|
v((d) => _(g - 1), ["up"]),
|
|
129
130
|
v((d) => _(g + 1), ["down"]),
|
|
130
131
|
o[3] || (o[3] = v((d) => r.value ? p() : E(), ["esc"]))
|
|
@@ -135,14 +136,14 @@ const A = { render: q }, G = ["onClick", "onKeydown", "onMouseenter", "data-curr
|
|
|
135
136
|
ref_for: !0,
|
|
136
137
|
ref_key: "optionElement",
|
|
137
138
|
ref: F,
|
|
138
|
-
"data-current": typeof e.modelValue == "string" || typeof e.modelValue == "number" ? e.modelValue ===
|
|
139
|
-
},
|
|
140
|
-
], 512)) : (s(),
|
|
139
|
+
"data-current": typeof e.modelValue == "string" || typeof e.modelValue == "number" ? e.modelValue === l._id : e.modelValue?._id === l._id
|
|
140
|
+
}, z(l.title), 43, G))), 128))
|
|
141
|
+
], 512)) : (s(), n("div", {
|
|
141
142
|
key: 1,
|
|
142
143
|
onClick: p,
|
|
143
144
|
class: u(t.$style.option),
|
|
144
145
|
tabindex: "0"
|
|
145
|
-
},
|
|
146
|
+
}, z(S.value), 3))
|
|
146
147
|
], 2)) : b("", !0)
|
|
147
148
|
], 2));
|
|
148
149
|
}
|
|
@@ -153,9 +154,9 @@ const A = { render: q }, G = ["onClick", "onKeydown", "onMouseenter", "data-curr
|
|
|
153
154
|
filter: Z,
|
|
154
155
|
options: ee,
|
|
155
156
|
option: te
|
|
156
|
-
},
|
|
157
|
+
}, le = {
|
|
157
158
|
$style: oe
|
|
158
|
-
}, ae = /* @__PURE__ */ K(J, [["__cssModules",
|
|
159
|
+
}, ae = /* @__PURE__ */ K(J, [["__cssModules", le]]);
|
|
159
160
|
export {
|
|
160
161
|
ae as default
|
|
161
162
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mhz-ui",
|
|
3
3
|
"description": "Mhz ui kit",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.28",
|
|
5
5
|
"author": "Alexandr Dergunov <dergunovs@mail.ru> (https://github.com/dergunovs)",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"@tiptap/starter-kit": "2.11.7",
|
|
30
30
|
"@tiptap/vue-3": "2.11.7",
|
|
31
31
|
"@vueform/slider": "2.1.10",
|
|
32
|
-
"@vueuse/core": "13.
|
|
33
|
-
"@vueuse/integrations": "13.
|
|
32
|
+
"@vueuse/core": "13.1.0",
|
|
33
|
+
"@vueuse/integrations": "13.1.0",
|
|
34
34
|
"chart.js": "4.4.8",
|
|
35
35
|
"mhz-helpers": "*",
|
|
36
36
|
"perfect-debounce": "1.0.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@vitest/coverage-istanbul": "3.1.1",
|
|
55
55
|
"@vue/test-utils": "2.4.6",
|
|
56
56
|
"eslint": "9.24.0",
|
|
57
|
-
"eslint-config-prettier": "10.1.
|
|
57
|
+
"eslint-config-prettier": "10.1.2",
|
|
58
58
|
"eslint-import-resolver-typescript": "4.3.2",
|
|
59
59
|
"eslint-plugin-import-x": "4.10.2",
|
|
60
60
|
"eslint-plugin-prettier": "5.2.6",
|
|
@@ -72,14 +72,14 @@
|
|
|
72
72
|
"stylelint-config-recommended-vue": "1.6.0",
|
|
73
73
|
"stylelint-prettier": "5.0.3",
|
|
74
74
|
"typescript": "5.8.3",
|
|
75
|
-
"typescript-eslint": "8.29.
|
|
76
|
-
"vite": "6.2.
|
|
75
|
+
"typescript-eslint": "8.29.1",
|
|
76
|
+
"vite": "6.2.6",
|
|
77
77
|
"vite-plugin-dts": "4.5.3",
|
|
78
|
-
"vite-plugin-static-copy": "2.3.
|
|
78
|
+
"vite-plugin-static-copy": "2.3.1",
|
|
79
79
|
"vite-svg-loader": "5.1.0",
|
|
80
80
|
"vitest": "3.1.1",
|
|
81
81
|
"vue-eslint-parser": "10.1.3",
|
|
82
|
-
"vue-linters-config": "0.3.
|
|
82
|
+
"vue-linters-config": "0.3.14",
|
|
83
83
|
"vue-tsc": "2.2.8"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|