@v1nt1248/3nclient-lib 0.3.38 → 0.3.40
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/src/components/ui3n-menu/types.d.ts +5 -0
- package/dist/src/components/ui3n-menu/ui3n-menu.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/ui3n-components.js +40 -36
- package/package.json +1 -1
- package/src/components/ui3n-autocomplete/ui3n-autocomplete.vue +1 -0
- package/src/components/ui3n-menu/types.ts +5 -0
- package/src/components/ui3n-menu/ui3n-menu.vue +13 -5
- package/src/components/ui3n-selector/ui3n-selector.vue +1 -2
package/dist/ui3n-components.js
CHANGED
|
@@ -3037,6 +3037,7 @@ var ii = ["id"], ai = /* @__PURE__ */ k(/* @__PURE__ */ B({
|
|
|
3037
3037
|
__name: "ui3n-menu",
|
|
3038
3038
|
props: {
|
|
3039
3039
|
id: {},
|
|
3040
|
+
width: { default: "max-content" },
|
|
3040
3041
|
modelValue: { type: Boolean },
|
|
3041
3042
|
triggerElement: {},
|
|
3042
3043
|
positionStrategy: { default: "absolute" },
|
|
@@ -3104,14 +3105,14 @@ var ii = ["id"], ai = /* @__PURE__ */ k(/* @__PURE__ */ B({
|
|
|
3104
3105
|
return {
|
|
3105
3106
|
...f.value,
|
|
3106
3107
|
"--ui3n-menu-zIndex": String(r.zIndex),
|
|
3107
|
-
...e && { "--ui3n-menu-border-radius": e },
|
|
3108
|
+
...e && { "--ui3n-menu-content-border-radius": e },
|
|
3108
3109
|
...r.contentStyles || {}
|
|
3109
3110
|
};
|
|
3110
|
-
});
|
|
3111
|
-
function
|
|
3111
|
+
}), g = P(() => ({ width: isNaN(Number(r.width)) ? String(r.width) : `${r.width}px` }));
|
|
3112
|
+
function _(e) {
|
|
3112
3113
|
e.preventDefault();
|
|
3113
3114
|
}
|
|
3114
|
-
function
|
|
3115
|
+
function v(e) {
|
|
3115
3116
|
if (!e) return document.body;
|
|
3116
3117
|
let t = e.parentElement;
|
|
3117
3118
|
for (; t && t !== document.body && t !== document.documentElement;) {
|
|
@@ -3121,37 +3122,37 @@ var ii = ["id"], ai = /* @__PURE__ */ k(/* @__PURE__ */ B({
|
|
|
3121
3122
|
}
|
|
3122
3123
|
return document.body;
|
|
3123
3124
|
}
|
|
3124
|
-
function
|
|
3125
|
+
function y() {
|
|
3125
3126
|
if (!r.lockScroll) return;
|
|
3126
|
-
let e =
|
|
3127
|
+
let e = v(u.value);
|
|
3127
3128
|
if (e) {
|
|
3128
3129
|
let t = Number(e.dataset.scrollLocksCount || "0");
|
|
3129
|
-
t === 0 ? (e.dataset.scrollLocksCount = "1", e.dataset.originalOverscroll = e.style.overscrollBehaviorY || "", e.style.overscrollBehaviorY = "contain", e === document.body ? (document.addEventListener("wheel",
|
|
3130
|
+
t === 0 ? (e.dataset.scrollLocksCount = "1", e.dataset.originalOverscroll = e.style.overscrollBehaviorY || "", e.style.overscrollBehaviorY = "contain", e === document.body ? (document.addEventListener("wheel", _, { passive: !1 }), document.addEventListener("touchmove", _, { passive: !1 })) : (e.addEventListener("wheel", _, { passive: !1 }), e.addEventListener("touchmove", _, { passive: !1 }))) : e.dataset.scrollLocksCount = String(t + 1);
|
|
3130
3131
|
}
|
|
3131
3132
|
}
|
|
3132
|
-
function
|
|
3133
|
-
let e =
|
|
3133
|
+
function b() {
|
|
3134
|
+
let e = v(u.value);
|
|
3134
3135
|
if (!e) return;
|
|
3135
3136
|
let t = Number(e.dataset.scrollLocksCount || "0");
|
|
3136
3137
|
if (t > 0) {
|
|
3137
3138
|
let n = t - 1;
|
|
3138
3139
|
if (n === 0) {
|
|
3139
3140
|
let t = e.dataset.originalOverscroll;
|
|
3140
|
-
t ? e.style.overscrollBehaviorY = t : e.style.removeProperty("overscroll-behavior-y"), e === document.body ? (document.removeEventListener("wheel",
|
|
3141
|
+
t ? e.style.overscrollBehaviorY = t : e.style.removeProperty("overscroll-behavior-y"), e === document.body ? (document.removeEventListener("wheel", _), document.removeEventListener("touchmove", _)) : (e.removeEventListener("wheel", _), e.removeEventListener("touchmove", _)), delete e.dataset.scrollLocksCount, delete e.dataset.originalOverscroll;
|
|
3141
3142
|
} else e.dataset.scrollLocksCount = String(n);
|
|
3142
3143
|
}
|
|
3143
3144
|
}
|
|
3144
|
-
function
|
|
3145
|
+
function x() {
|
|
3145
3146
|
r.disabled || (s.value = !s.value, s.value ? i("open") : i("close"), i("update:modelValue", s.value));
|
|
3146
3147
|
}
|
|
3147
|
-
function
|
|
3148
|
+
function S() {
|
|
3148
3149
|
s.value = !1, i("close"), i("update:modelValue", s.value);
|
|
3149
3150
|
}
|
|
3150
|
-
function
|
|
3151
|
+
function C(e) {
|
|
3151
3152
|
u.value?.contains(e.target) || (i("click-outside"), r.closeOnClickOutside && (s.value = !1, i("close"), i("update:modelValue", s.value)));
|
|
3152
3153
|
}
|
|
3153
3154
|
return X(() => s.value, (e) => {
|
|
3154
|
-
e ?
|
|
3155
|
+
e ? y() : b();
|
|
3155
3156
|
}), X(() => r.modelValue, (e) => {
|
|
3156
3157
|
e !== void 0 && s.value !== e && (s.value = e, i(e ? "open" : "close"));
|
|
3157
3158
|
}, { immediate: !0 }), X(() => r.triggerElement, (e) => {
|
|
@@ -3159,7 +3160,7 @@ var ii = ["id"], ai = /* @__PURE__ */ k(/* @__PURE__ */ B({
|
|
|
3159
3160
|
}), X([() => r.offsetX, () => r.offsetY], ([e, t], [n, r]) => {
|
|
3160
3161
|
(e !== n || t !== r) && m();
|
|
3161
3162
|
}), me(() => {
|
|
3162
|
-
|
|
3163
|
+
b();
|
|
3163
3164
|
}), t({
|
|
3164
3165
|
isPositioned: p,
|
|
3165
3166
|
update: m
|
|
@@ -3167,23 +3168,24 @@ var ii = ["id"], ai = /* @__PURE__ */ k(/* @__PURE__ */ B({
|
|
|
3167
3168
|
ref: "menu-element",
|
|
3168
3169
|
id: e.id,
|
|
3169
3170
|
class: V(t.$style.ui3nMenu),
|
|
3171
|
+
style: H(g.value),
|
|
3170
3172
|
onClick: n[0] ||= (e) => i("click", e)
|
|
3171
3173
|
}, [R("div", {
|
|
3172
3174
|
ref: "menu-trigger-element",
|
|
3173
3175
|
class: V([t.$style.ui3nMenuTrigger, e.disabled && t.$style.ui3nMenuTriggerDisabled]),
|
|
3174
|
-
onClick: $(
|
|
3176
|
+
onClick: $(x, ["stop"])
|
|
3175
3177
|
}, [q(t.$slots, "default")], 2), s.value ? we((W(), L("div", ue({
|
|
3176
3178
|
key: 0,
|
|
3177
3179
|
ref: "menu-content-element",
|
|
3178
3180
|
style: h.value,
|
|
3179
3181
|
class: t.$style.ui3nMenuContent
|
|
3180
|
-
}, ve(e.closeOnClick ? { click:
|
|
3182
|
+
}, ve(e.closeOnClick ? { click: S } : {}, !0)), [q(t.$slots, "menu")], 16)), [[Y(Dn), C]]) : I("", !0)], 14, oi));
|
|
3181
3183
|
}
|
|
3182
3184
|
}), [["__cssModules", { $style: {
|
|
3183
|
-
ui3nMenu: "
|
|
3184
|
-
ui3nMenuTrigger: "
|
|
3185
|
-
ui3nMenuTriggerDisabled: "
|
|
3186
|
-
ui3nMenuContent: "
|
|
3185
|
+
ui3nMenu: "_ui3nMenu_sjqaw_3",
|
|
3186
|
+
ui3nMenuTrigger: "_ui3nMenuTrigger_sjqaw_10",
|
|
3187
|
+
ui3nMenuTriggerDisabled: "_ui3nMenuTriggerDisabled_sjqaw_14",
|
|
3188
|
+
ui3nMenuContent: "_ui3nMenuContent_sjqaw_19"
|
|
3187
3189
|
} }]]), ci = ["id"], li = ["onClick"], ui = /* @__PURE__ */ k(/* @__PURE__ */ B({
|
|
3188
3190
|
__name: "ui3n-list",
|
|
3189
3191
|
props: {
|
|
@@ -4584,6 +4586,7 @@ var ii = ["id"], ai = /* @__PURE__ */ k(/* @__PURE__ */ B({
|
|
|
4584
4586
|
}, null, 8, Ji))], 2)) : I("", !0), z(si, {
|
|
4585
4587
|
modelValue: u.value,
|
|
4586
4588
|
"onUpdate:modelValue": n[8] ||= (e) => u.value = e,
|
|
4589
|
+
width: "100%",
|
|
4587
4590
|
"lock-scroll": e.lockScroll,
|
|
4588
4591
|
"offset-x": 2,
|
|
4589
4592
|
"offset-y": 4,
|
|
@@ -5026,6 +5029,7 @@ var ii = ["id"], ai = /* @__PURE__ */ k(/* @__PURE__ */ B({
|
|
|
5026
5029
|
z(si, {
|
|
5027
5030
|
modelValue: l.value,
|
|
5028
5031
|
"onUpdate:modelValue": n[6] ||= (e) => l.value = e,
|
|
5032
|
+
width: "100%",
|
|
5029
5033
|
"offset-x": -3,
|
|
5030
5034
|
"offset-y": 4,
|
|
5031
5035
|
"position-autoupdate": "",
|
|
@@ -5115,21 +5119,21 @@ var ii = ["id"], ai = /* @__PURE__ */ k(/* @__PURE__ */ B({
|
|
|
5115
5119
|
], 10, aa));
|
|
5116
5120
|
}
|
|
5117
5121
|
}), [["__cssModules", { $style: {
|
|
5118
|
-
ui3nSelector: "
|
|
5119
|
-
label: "
|
|
5120
|
-
menu: "
|
|
5121
|
-
trigger: "
|
|
5122
|
-
placeholder: "
|
|
5123
|
-
triggerDisabled: "
|
|
5124
|
-
menuIcon: "
|
|
5125
|
-
clearable: "
|
|
5126
|
-
clearBtn: "
|
|
5127
|
-
triggerFocused: "
|
|
5128
|
-
body: "
|
|
5129
|
-
noData: "
|
|
5130
|
-
item: "
|
|
5131
|
-
itemSelected: "
|
|
5132
|
-
itemDisabled: "
|
|
5122
|
+
ui3nSelector: "_ui3nSelector_1mwql_3",
|
|
5123
|
+
label: "_label_1mwql_18",
|
|
5124
|
+
menu: "_menu_1mwql_28",
|
|
5125
|
+
trigger: "_trigger_1mwql_36",
|
|
5126
|
+
placeholder: "_placeholder_1mwql_56",
|
|
5127
|
+
triggerDisabled: "_triggerDisabled_1mwql_60",
|
|
5128
|
+
menuIcon: "_menuIcon_1mwql_66",
|
|
5129
|
+
clearable: "_clearable_1mwql_71",
|
|
5130
|
+
clearBtn: "_clearBtn_1mwql_74",
|
|
5131
|
+
triggerFocused: "_triggerFocused_1mwql_79",
|
|
5132
|
+
body: "_body_1mwql_84",
|
|
5133
|
+
noData: "_noData_1mwql_93",
|
|
5134
|
+
item: "_item_1mwql_105",
|
|
5135
|
+
itemSelected: "_itemSelected_1mwql_119",
|
|
5136
|
+
itemDisabled: "_itemDisabled_1mwql_123"
|
|
5133
5137
|
} }]]), ua = /* @__PURE__ */ k(/* @__PURE__ */ B({
|
|
5134
5138
|
__name: "ui3n-mobile-menu",
|
|
5135
5139
|
props: {
|
package/package.json
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
closeOnClick: true,
|
|
17
17
|
closeOnClickOutside: true,
|
|
18
18
|
disabled: false,
|
|
19
|
+
width: 'max-content',
|
|
19
20
|
});
|
|
20
21
|
const emits = defineEmits<Ui3nMenuEmits>();
|
|
21
22
|
defineSlots<Ui3nMenuSlots>();
|
|
@@ -74,22 +75,29 @@
|
|
|
74
75
|
});
|
|
75
76
|
|
|
76
77
|
const contentStylesComputed = computed(() => {
|
|
77
|
-
let
|
|
78
|
+
let contentBorderRadiusStr = '';
|
|
78
79
|
if (typeof props.contentBorderRadius === 'number') {
|
|
79
|
-
|
|
80
|
+
contentBorderRadiusStr = `${props.contentBorderRadius}px`;
|
|
80
81
|
} else if (Array.isArray(props.contentBorderRadius)) {
|
|
81
82
|
const [tl, tr, br, bl] = props.contentBorderRadius;
|
|
82
|
-
|
|
83
|
+
contentBorderRadiusStr = `${tl}px ${tr}px ${br}px ${bl}px`;
|
|
83
84
|
}
|
|
84
85
|
|
|
85
86
|
return {
|
|
86
87
|
...floatingStyles.value,
|
|
87
88
|
'--ui3n-menu-zIndex': String(props.zIndex),
|
|
88
|
-
...(
|
|
89
|
+
...(contentBorderRadiusStr && { '--ui3n-menu-content-border-radius': contentBorderRadiusStr }),
|
|
89
90
|
...(props.contentStyles || {}),
|
|
90
91
|
};
|
|
91
92
|
});
|
|
92
93
|
|
|
94
|
+
const rootStyles = computed(() => {
|
|
95
|
+
const numericWidth = !isNaN(Number(props.width));
|
|
96
|
+
const widthStr = numericWidth ? `${props.width}px` : String(props.width);
|
|
97
|
+
|
|
98
|
+
return { width: widthStr };
|
|
99
|
+
});
|
|
100
|
+
|
|
93
101
|
function preventScrollEvent(e: Event) {
|
|
94
102
|
e.preventDefault();
|
|
95
103
|
}
|
|
@@ -262,6 +270,7 @@
|
|
|
262
270
|
ref="menu-element"
|
|
263
271
|
:id="id"
|
|
264
272
|
:class="$style.ui3nMenu"
|
|
273
|
+
:style="rootStyles"
|
|
265
274
|
@click="emits('click', $event)"
|
|
266
275
|
>
|
|
267
276
|
<div
|
|
@@ -292,7 +301,6 @@
|
|
|
292
301
|
--ui3n-menu-content-bg: var(--color-bg-control-secondary-default);
|
|
293
302
|
|
|
294
303
|
position: relative;
|
|
295
|
-
width: max-content;
|
|
296
304
|
display: inline-block;
|
|
297
305
|
overflow: visible;
|
|
298
306
|
}
|
|
@@ -259,6 +259,7 @@
|
|
|
259
259
|
|
|
260
260
|
<ui3n-menu
|
|
261
261
|
v-model="isMenuOpen"
|
|
262
|
+
width="100%"
|
|
262
263
|
:offset-x="-3"
|
|
263
264
|
:offset-y="4"
|
|
264
265
|
position-autoupdate
|
|
@@ -399,8 +400,6 @@
|
|
|
399
400
|
}
|
|
400
401
|
|
|
401
402
|
.menu {
|
|
402
|
-
width: 100%;
|
|
403
|
-
max-width: 100% !important;
|
|
404
403
|
border-radius: var(--ui3n-selector-border-radius);
|
|
405
404
|
|
|
406
405
|
& > div {
|