mhz-ui 1.0.114 → 1.0.115
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/UiSelect/UiSelect.d.ts +3 -2
- package/dist/UiSelect/UiSelect.js +34 -31
- package/package.json +9 -9
|
@@ -8,12 +8,13 @@ interface IProps {
|
|
|
8
8
|
isFilter?: boolean;
|
|
9
9
|
isDisabled?: boolean;
|
|
10
10
|
lang?: 'ru';
|
|
11
|
+
isAllowUndefined?: boolean;
|
|
11
12
|
}
|
|
12
13
|
declare const _default: import('vue').DefineComponent<IProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
|
-
"update:modelValue": (value: string | number | IOption) => any;
|
|
14
|
+
"update:modelValue": (value: string | number | IOption | undefined) => any;
|
|
14
15
|
reachedBottom: () => any;
|
|
15
16
|
}, string, import('vue').PublicProps, Readonly<IProps> & Readonly<{
|
|
16
|
-
"onUpdate:modelValue"?: ((value: string | number | IOption) => any) | undefined;
|
|
17
|
+
"onUpdate:modelValue"?: ((value: string | number | IOption | undefined) => any) | undefined;
|
|
17
18
|
onReachedBottom?: (() => any) | undefined;
|
|
18
19
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
19
20
|
containerElement: HTMLDivElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./UiSelect.css";
|
|
2
|
-
import { openBlock as l, createElementBlock as s, createElementVNode as
|
|
3
|
-
import { o as
|
|
2
|
+
import { openBlock as l, createElementBlock as s, createElementVNode as U, defineComponent as R, ref as d, computed as p, normalizeClass as m, createVNode as B, unref as O, createCommentVNode as I, Fragment as S, renderList as M, withKeys as f, toDisplayString as L } from "vue";
|
|
3
|
+
import { o as N } from "../index-B0XPXFAj.js";
|
|
4
4
|
import T from "../UiInput/UiInput.js";
|
|
5
5
|
import { _ as x } from "../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const K = {
|
|
@@ -9,9 +9,9 @@ const K = {
|
|
|
9
9
|
height: "16",
|
|
10
10
|
fill: "none"
|
|
11
11
|
};
|
|
12
|
-
function
|
|
12
|
+
function A(h, i) {
|
|
13
13
|
return l(), s("svg", K, i[0] || (i[0] = [
|
|
14
|
-
|
|
14
|
+
U("path", {
|
|
15
15
|
stroke: "#1F1F1F",
|
|
16
16
|
"stroke-linecap": "round",
|
|
17
17
|
"stroke-linejoin": "round",
|
|
@@ -19,15 +19,15 @@ function P(h, i) {
|
|
|
19
19
|
}, null, -1)
|
|
20
20
|
]));
|
|
21
21
|
}
|
|
22
|
-
const
|
|
22
|
+
const P = { render: A }, H = {
|
|
23
23
|
xmlns: "http://www.w3.org/2000/svg",
|
|
24
24
|
width: "16",
|
|
25
25
|
height: "16",
|
|
26
26
|
fill: "none"
|
|
27
27
|
};
|
|
28
|
-
function
|
|
29
|
-
return l(), s("svg",
|
|
30
|
-
|
|
28
|
+
function Q(h, i) {
|
|
29
|
+
return l(), s("svg", H, i[0] || (i[0] = [
|
|
30
|
+
U("path", {
|
|
31
31
|
stroke: "#1F1F1F",
|
|
32
32
|
"stroke-linecap": "round",
|
|
33
33
|
"stroke-linejoin": "round",
|
|
@@ -35,21 +35,24 @@ function q(h, i) {
|
|
|
35
35
|
}, null, -1)
|
|
36
36
|
]));
|
|
37
37
|
}
|
|
38
|
-
const
|
|
38
|
+
const q = { render: Q }, G = ["onClick", "onKeydown", "onMouseenter", "data-current"], J = /* @__PURE__ */ R({
|
|
39
39
|
__name: "UiSelect",
|
|
40
40
|
props: {
|
|
41
41
|
modelValue: {},
|
|
42
42
|
options: {},
|
|
43
43
|
isFilter: { type: Boolean },
|
|
44
44
|
isDisabled: { type: Boolean },
|
|
45
|
-
lang: {}
|
|
45
|
+
lang: {},
|
|
46
|
+
isAllowUndefined: { type: Boolean }
|
|
46
47
|
},
|
|
47
48
|
emits: ["update:modelValue", "reachedBottom"],
|
|
48
49
|
setup(h, { emit: i }) {
|
|
49
|
-
const e = h,
|
|
50
|
+
const e = h, V = i, v = d(""), j = p(() => e.lang === "ru" ? "Выбрать" : "Choose variant"), z = p(() => e.lang === "ru" ? "Фильтровать" : "Filter Variants"), D = p(() => e.lang === "ru" ? "Нет результатов" : "No results"), $ = p(() => typeof e.options?.[0] == "object"), k = p(() => {
|
|
50
51
|
if (!e.options) return [];
|
|
51
52
|
let t = e.options;
|
|
52
|
-
|
|
53
|
+
$.value || (t = e.options.map((o) => ({ _id: o, title: o })));
|
|
54
|
+
const n = e.isFilter ? t.filter((o) => o.title.toLowerCase().includes(v.value.toLowerCase())) : t;
|
|
55
|
+
return e.isAllowUndefined ? [{ _id: void 0, title: e.lang === "ru" ? "Убрать" : "Remove" }, ...n] : n;
|
|
53
56
|
}), r = d(!1), u = d(), g = d(), b = d([]);
|
|
54
57
|
function y(t) {
|
|
55
58
|
t < 0 || t === k.value.length || e.isFilter || b.value[t]?.focus();
|
|
@@ -62,17 +65,17 @@ const A = { render: q }, G = ["onClick", "onKeydown", "onMouseenter", "data-curr
|
|
|
62
65
|
u.value?.scrollTo(0, 0), y(0), u.value?.addEventListener("scroll", F, !0);
|
|
63
66
|
}, 100));
|
|
64
67
|
}
|
|
65
|
-
function
|
|
66
|
-
|
|
68
|
+
function w(t) {
|
|
69
|
+
V("update:modelValue", $.value ? t : t._id), c();
|
|
67
70
|
}
|
|
68
71
|
function F() {
|
|
69
72
|
if (!u.value || !g.value) return;
|
|
70
|
-
u.value.getBoundingClientRect().y - g.value.getBoundingClientRect().y - g.value.scrollHeight + u.value.getBoundingClientRect().height > -100 &&
|
|
73
|
+
u.value.getBoundingClientRect().y - g.value.getBoundingClientRect().y - g.value.scrollHeight + u.value.getBoundingClientRect().height > -100 && V("reachedBottom");
|
|
71
74
|
}
|
|
72
75
|
const E = d();
|
|
73
|
-
return
|
|
76
|
+
return N(E, () => {
|
|
74
77
|
c();
|
|
75
|
-
}), (t,
|
|
78
|
+
}), (t, n) => (l(), s("div", {
|
|
76
79
|
class: m(t.$style.container),
|
|
77
80
|
ref_key: "containerElement",
|
|
78
81
|
ref: E
|
|
@@ -80,10 +83,10 @@ const A = { render: q }, G = ["onClick", "onKeydown", "onMouseenter", "data-curr
|
|
|
80
83
|
B(T, {
|
|
81
84
|
modelValue: typeof e.modelValue == "string" || typeof e.modelValue == "number" ? e.modelValue : e.modelValue?.title,
|
|
82
85
|
disabled: e.isDisabled,
|
|
83
|
-
onToggle:
|
|
86
|
+
onToggle: n[0] || (n[0] = (o) => r.value ? c() : C()),
|
|
84
87
|
mode: "select",
|
|
85
|
-
placeholder:
|
|
86
|
-
appendIcon: r.value ? O(
|
|
88
|
+
placeholder: j.value,
|
|
89
|
+
appendIcon: r.value ? O(q) : O(P)
|
|
87
90
|
}, null, 8, ["modelValue", "disabled", "placeholder", "appendIcon"]),
|
|
88
91
|
e.isFilter && r.value ? (l(), s("div", {
|
|
89
92
|
key: 0,
|
|
@@ -91,9 +94,9 @@ const A = { render: q }, G = ["onClick", "onKeydown", "onMouseenter", "data-curr
|
|
|
91
94
|
}, [
|
|
92
95
|
B(T, {
|
|
93
96
|
modelValue: v.value,
|
|
94
|
-
"onUpdate:modelValue":
|
|
97
|
+
"onUpdate:modelValue": n[1] || (n[1] = (o) => v.value = o),
|
|
95
98
|
disabled: e.isDisabled,
|
|
96
|
-
placeholder:
|
|
99
|
+
placeholder: z.value,
|
|
97
100
|
isFocus: ""
|
|
98
101
|
}, null, 8, ["modelValue", "disabled", "placeholder"])
|
|
99
102
|
], 2)) : I("", !0),
|
|
@@ -108,15 +111,15 @@ const A = { render: q }, G = ["onClick", "onKeydown", "onMouseenter", "data-curr
|
|
|
108
111
|
ref_key: "optionsInnerElement",
|
|
109
112
|
ref: g
|
|
110
113
|
}, [
|
|
111
|
-
(l(!0), s(
|
|
112
|
-
key: `${
|
|
113
|
-
onClick: (a) =>
|
|
114
|
+
(l(!0), s(S, null, M(k.value, (o, _) => (l(), s("div", {
|
|
115
|
+
key: `${o}-${_}`,
|
|
116
|
+
onClick: (a) => w(o),
|
|
114
117
|
onKeydown: [
|
|
115
|
-
f((a) =>
|
|
116
|
-
f((a) =>
|
|
118
|
+
f((a) => w(o), ["enter"]),
|
|
119
|
+
f((a) => w(o), ["space"]),
|
|
117
120
|
f((a) => y(_ - 1), ["up"]),
|
|
118
121
|
f((a) => y(_ + 1), ["down"]),
|
|
119
|
-
|
|
122
|
+
n[2] || (n[2] = f((a) => r.value ? c() : C(), ["esc"]))
|
|
120
123
|
],
|
|
121
124
|
onMouseenter: (a) => y(_),
|
|
122
125
|
class: m(t.$style.option),
|
|
@@ -124,14 +127,14 @@ const A = { render: q }, G = ["onClick", "onKeydown", "onMouseenter", "data-curr
|
|
|
124
127
|
ref_for: !0,
|
|
125
128
|
ref_key: "optionElement",
|
|
126
129
|
ref: b,
|
|
127
|
-
"data-current": typeof e.modelValue == "string" || typeof e.modelValue == "number" ? e.modelValue ===
|
|
128
|
-
}, L(
|
|
130
|
+
"data-current": typeof e.modelValue == "string" || typeof e.modelValue == "number" ? e.modelValue === o._id : e.modelValue?._id === o._id
|
|
131
|
+
}, L(o.title), 43, G))), 128))
|
|
129
132
|
], 512)) : (l(), s("div", {
|
|
130
133
|
key: 1,
|
|
131
134
|
onClick: c,
|
|
132
135
|
class: m(t.$style.option),
|
|
133
136
|
tabindex: "0"
|
|
134
|
-
}, L(
|
|
137
|
+
}, L(D.value), 3))
|
|
135
138
|
], 2)) : I("", !0)
|
|
136
139
|
], 2));
|
|
137
140
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mhz-ui",
|
|
3
3
|
"description": "9000 Mhz ui kit",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.115",
|
|
5
5
|
"author": "Alexandr Dergunov <dergunovs@mail.ru> (https://github.com/dergunovs)",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -48,30 +48,30 @@
|
|
|
48
48
|
"@storybook/preview-api": "8.4.7",
|
|
49
49
|
"@storybook/vue3": "8.4.7",
|
|
50
50
|
"@storybook/vue3-vite": "8.4.7",
|
|
51
|
-
"@types/node": "22.10.
|
|
51
|
+
"@types/node": "22.10.6",
|
|
52
52
|
"@vitejs/plugin-vue": "5.2.1",
|
|
53
53
|
"@vitest/coverage-v8": "3.0.0-beta.4",
|
|
54
54
|
"@vue/test-utils": "2.4.6",
|
|
55
55
|
"eslint": "9.18.0",
|
|
56
|
-
"eslint-config-prettier": "
|
|
56
|
+
"eslint-config-prettier": "10.0.1",
|
|
57
57
|
"eslint-import-resolver-typescript": "3.7.0",
|
|
58
58
|
"eslint-plugin-import-x": "4.6.1",
|
|
59
|
-
"eslint-plugin-prettier": "5.2.
|
|
59
|
+
"eslint-plugin-prettier": "5.2.2",
|
|
60
60
|
"eslint-plugin-vue": "9.32.0",
|
|
61
61
|
"globals": "15.14.0",
|
|
62
|
-
"happy-dom": "16.
|
|
63
|
-
"postcss-html": "1.
|
|
62
|
+
"happy-dom": "16.6.0",
|
|
63
|
+
"postcss-html": "1.8.0",
|
|
64
64
|
"postcss-scss": "4.0.9",
|
|
65
65
|
"prettier": "3.4.2",
|
|
66
|
-
"sass-embedded": "1.83.
|
|
66
|
+
"sass-embedded": "1.83.4",
|
|
67
67
|
"storybook": "8.4.7",
|
|
68
|
-
"stylelint": "16.
|
|
68
|
+
"stylelint": "16.13.2",
|
|
69
69
|
"stylelint-config-recess-order": "5.1.1",
|
|
70
70
|
"stylelint-config-recommended-scss": "14.1.0",
|
|
71
71
|
"stylelint-config-recommended-vue": "1.5.0",
|
|
72
72
|
"stylelint-prettier": "5.0.2",
|
|
73
73
|
"typescript": "5.7.3",
|
|
74
|
-
"typescript-eslint": "8.
|
|
74
|
+
"typescript-eslint": "8.20.0",
|
|
75
75
|
"vite": "6.0.7",
|
|
76
76
|
"vite-plugin-dts": "4.5.0",
|
|
77
77
|
"vite-plugin-static-copy": "2.2.0",
|