morya-ui 0.4.5 → 0.5.1
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/CHANGELOG.md +41 -2
- package/dist/{Input-D2bee2LU.js → Input-BErawS7K.js} +1 -5
- package/dist/InputNumber-DjbXtTzR.js +245 -0
- package/dist/{Pagination-DpNOb0CS.js → Pagination-B8WYoL2a.js} +1 -1
- package/dist/{Popover-Bnz7KNZq.js → Popover-zQChu00_.js} +6 -1
- package/dist/{Select-q4X2ff_M.js → Select-BaFKBeIh.js} +2 -2
- package/dist/{Textarea-DsFOAtPd.js → Textarea-WCEgpzbq.js} +1 -5
- package/dist/accordion/style.css +6 -15
- package/dist/affix/style.css +6 -15
- package/dist/alert/style.css +6 -15
- package/dist/anchor/style.css +6 -15
- package/dist/auto-complete/style.css +6 -15
- package/dist/avatar/style.css +6 -15
- package/dist/badge/style.css +6 -15
- package/dist/block-ui/style.css +6 -15
- package/dist/breadcrumb/style.css +6 -15
- package/dist/button/style.css +6 -15
- package/dist/calendar/index.js +1 -1
- package/dist/calendar/style.css +6 -15
- package/dist/card/style.css +6 -15
- package/dist/carousel/style.css +6 -15
- package/dist/cascade-select/style.css +6 -15
- package/dist/checkbox/style.css +6 -15
- package/dist/chip/style.css +6 -15
- package/dist/color-picker/index.js +676 -0
- package/dist/{input-color → color-picker}/style.css +1406 -83
- package/dist/color-picker/style.js +8 -0
- package/dist/command-menu/index.js +73 -66
- package/dist/command-menu/style.css +6 -15
- package/dist/components/ColorPicker/ColorPicker.vue.d.ts +41 -0
- package/dist/components/ColorPicker/ColorPicker.vue.d.ts.map +1 -0
- package/dist/components/ColorPicker/colorUtils.d.ts +23 -0
- package/dist/components/ColorPicker/colorUtils.d.ts.map +1 -0
- package/dist/components/ColorPicker/gradientUtils.d.ts +9 -0
- package/dist/components/ColorPicker/gradientUtils.d.ts.map +1 -0
- package/dist/components/ColorPicker/index.d.ts +3 -0
- package/dist/components/ColorPicker/index.d.ts.map +1 -0
- package/dist/components/ColorPicker/styles.css +405 -0
- package/dist/components/ColorPicker/types.d.ts +60 -0
- package/dist/components/ColorPicker/types.d.ts.map +1 -0
- package/dist/components/CommandMenu/CommandMenu.vue.d.ts.map +1 -1
- package/dist/components/ContextMenu/ContextMenuNodes.vue.d.ts.map +1 -1
- package/dist/components/ContextMenu/styles.css +1 -1
- package/dist/components/Dock/Dock.vue.d.ts.map +1 -1
- package/dist/components/Dropdown/DropdownNodes.vue.d.ts.map +1 -1
- package/dist/components/Dropdown/styles.css +1 -1
- package/dist/components/Input/Input.vue.d.ts +0 -1
- package/dist/components/Input/Input.vue.d.ts.map +1 -1
- package/dist/components/Input/types.d.ts +0 -2
- package/dist/components/Input/types.d.ts.map +1 -1
- package/dist/components/InputNumber/styles.css +28 -10
- package/dist/components/InputPassword/InputPassword.vue.d.ts +0 -1
- package/dist/components/InputPassword/InputPassword.vue.d.ts.map +1 -1
- package/dist/components/InputPassword/types.d.ts +0 -2
- package/dist/components/InputPassword/types.d.ts.map +1 -1
- package/dist/components/MegaMenu/MegaMenu.vue.d.ts.map +1 -1
- package/dist/components/Mentions/Mentions.vue.d.ts +0 -1
- package/dist/components/Mentions/Mentions.vue.d.ts.map +1 -1
- package/dist/components/Mentions/types.d.ts +0 -2
- package/dist/components/Mentions/types.d.ts.map +1 -1
- package/dist/components/Menu/Menu.vue.d.ts.map +1 -1
- package/dist/components/Menu/MenuNodes.vue.d.ts.map +1 -1
- package/dist/components/Menu/styles.css +45 -3
- package/dist/components/Menu/types.d.ts +3 -1
- package/dist/components/Menu/types.d.ts.map +1 -1
- package/dist/components/Menubar/Menubar.vue.d.ts +2 -2
- package/dist/components/Menubar/Menubar.vue.d.ts.map +1 -1
- package/dist/components/Menubar/styles.css +1 -1
- package/dist/components/Popover/Popover.vue.d.ts.map +1 -1
- package/dist/components/Rating/Rating.vue.d.ts +1 -1
- package/dist/components/Rating/types.d.ts +2 -2
- package/dist/components/Rating/types.d.ts.map +1 -1
- package/dist/components/Select/Select.vue.d.ts +1 -1
- package/dist/components/Select/types.d.ts +1 -1
- package/dist/components/Select/types.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/SpeedDial/SpeedDial.vue.d.ts +3 -3
- package/dist/components/SpeedDial/SpeedDial.vue.d.ts.map +1 -1
- package/dist/components/SplitButton/SplitButton.vue.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.vue.d.ts +0 -1
- package/dist/components/Textarea/Textarea.vue.d.ts.map +1 -1
- package/dist/components/Textarea/types.d.ts +0 -2
- package/dist/components/Textarea/types.d.ts.map +1 -1
- package/dist/components/TieredMenu/styles.css +2 -2
- package/dist/components/Tooltip/styles.css +15 -2
- package/dist/config-provider/style.css +6 -15
- package/dist/confirm-dialog/style.css +6 -15
- package/dist/confirm-popup/style.css +6 -15
- package/dist/context-menu/index.js +92 -84
- package/dist/context-menu/style.css +7 -16
- package/dist/data-view/index.js +1 -1
- package/dist/data-view/style.css +6 -15
- package/dist/date-picker/style.css +6 -15
- package/dist/descriptions/style.css +6 -15
- package/dist/dialog/style.css +6 -15
- package/dist/divider/style.css +6 -15
- package/dist/dock/index.js +21 -18
- package/dist/dock/style.css +6 -15
- package/dist/drawer/style.css +6 -15
- package/dist/dropdown/index.js +103 -95
- package/dist/dropdown/style.css +7 -16
- package/dist/empty/style.css +6 -15
- package/dist/fieldset/style.css +6 -15
- package/dist/file-upload/style.css +6 -15
- package/dist/flex/style.css +6 -15
- package/dist/float-label/style.css +6 -15
- package/dist/fluid/style.css +6 -15
- package/dist/form/style.css +6 -15
- package/dist/gallery/style.css +6 -15
- package/dist/grid/style.css +6 -15
- package/dist/icon/style.css +6 -15
- package/dist/{icon-H8prbteT.js → icon-CUrSaD8r.js} +4 -1
- package/dist/icon-field/style.css +6 -15
- package/dist/image/style.css +6 -15
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4047 -3420
- package/dist/inplace/style.css +6 -15
- package/dist/input/index.js +1 -1
- package/dist/input/style.css +6 -15
- package/dist/input-group/style.css +6 -15
- package/dist/input-number/index.js +2 -245
- package/dist/input-number/style.css +34 -25
- package/dist/input-otp/style.css +6 -15
- package/dist/input-password/index.js +1 -5
- package/dist/input-password/style.css +6 -15
- package/dist/input-tags/style.css +6 -15
- package/dist/knob/style.css +6 -15
- package/dist/label/style.css +6 -15
- package/dist/layout/style.css +6 -15
- package/dist/list/index.js +1 -1
- package/dist/list/style.css +6 -15
- package/dist/listbox/style.css +6 -15
- package/dist/loading/style.css +6 -15
- package/dist/mega-menu/index.js +94 -87
- package/dist/mega-menu/style.css +6 -15
- package/dist/mentions/index.js +35 -39
- package/dist/mentions/style.css +6 -15
- package/dist/menu/index.js +235 -213
- package/dist/menu/style.css +66 -20
- package/dist/menubar/index.js +107 -99
- package/dist/menubar/style.css +7 -16
- package/dist/message/style.css +6 -15
- package/dist/meter-group/style.css +6 -15
- package/dist/order-list/style.css +6 -15
- package/dist/page/style.css +6 -15
- package/dist/pagination/index.js +1 -1
- package/dist/pagination/style.css +6 -15
- package/dist/panel/style.css +6 -15
- package/dist/pick-list/style.css +6 -15
- package/dist/popover/index.js +1 -1
- package/dist/popover/style.css +6 -15
- package/dist/progress-bar/style.css +6 -15
- package/dist/progress-spinner/style.css +6 -15
- package/dist/qr-code/style.css +6 -15
- package/dist/radio/style.css +6 -15
- package/dist/rating/index.js +2 -2
- package/dist/rating/style.css +6 -15
- package/dist/resolver.js +1 -1
- package/dist/result/style.css +6 -15
- package/dist/scroll-top/style.css +6 -15
- package/dist/scrollbar/style.css +6 -15
- package/dist/segmented/style.css +6 -15
- package/dist/select/index.js +1 -1
- package/dist/select/style.css +6 -15
- package/dist/select-button/style.css +6 -15
- package/dist/shared/menu/icon.d.ts +3 -0
- package/dist/shared/menu/icon.d.ts.map +1 -1
- package/dist/shared/menu/index.d.ts +2 -2
- package/dist/shared/menu/index.d.ts.map +1 -1
- package/dist/shared/menu/types.d.ts +3 -1
- package/dist/shared/menu/types.d.ts.map +1 -1
- package/dist/sidebar/index.js +37 -29
- package/dist/sidebar/style.css +6 -15
- package/dist/skeleton/style.css +6 -15
- package/dist/slider/style.css +6 -15
- package/dist/space/style.css +6 -15
- package/dist/speed-dial/index.js +101 -94
- package/dist/speed-dial/style.css +6 -15
- package/dist/split-button/index.js +3 -3
- package/dist/split-button/style.css +6 -15
- package/dist/splitter/style.css +6 -15
- package/dist/statistic/style.css +6 -15
- package/dist/status/style.css +6 -15
- package/dist/stepper/style.css +6 -15
- package/dist/styles/base.css +6 -15
- package/dist/styles.css +1 -1
- package/dist/switch/style.css +6 -15
- package/dist/table/index.js +3 -3
- package/dist/table/style.css +6 -15
- package/dist/tabs/style.css +6 -15
- package/dist/tag/style.css +6 -15
- package/dist/terminal/style.css +6 -15
- package/dist/textarea/index.js +1 -1
- package/dist/textarea/style.css +6 -15
- package/dist/tiered-menu/style.css +8 -17
- package/dist/time-picker/style.css +6 -15
- package/dist/timeline/style.css +6 -15
- package/dist/toast/style.css +6 -15
- package/dist/toggle-button/index.js +1 -1
- package/dist/toggle-button/style.css +6 -15
- package/dist/toolbar/style.css +6 -15
- package/dist/tooltip/style.css +21 -17
- package/dist/tour/style.css +6 -15
- package/dist/tree/style.css +6 -15
- package/dist/tree-select/style.css +6 -15
- package/dist/typography/index.js +1 -1
- package/dist/typography/style.css +6 -15
- package/dist/virtual-scroller/style.css +6 -15
- package/dist/watermark/style.css +6 -15
- package/package.json +8 -8
- package/dist/components/InputColor/InputColor.vue.d.ts +0 -24
- package/dist/components/InputColor/InputColor.vue.d.ts.map +0 -1
- package/dist/components/InputColor/index.d.ts +0 -3
- package/dist/components/InputColor/index.d.ts.map +0 -1
- package/dist/components/InputColor/styles.css +0 -139
- package/dist/components/InputColor/types.d.ts +0 -19
- package/dist/components/InputColor/types.d.ts.map +0 -1
- package/dist/input-color/index.js +0 -118
- package/dist/input-color/style.js +0 -3
package/dist/loading/style.css
CHANGED
|
@@ -405,7 +405,7 @@
|
|
|
405
405
|
|
|
406
406
|
:root {
|
|
407
407
|
/* Shared minimum width for menu-like panels (select/orderlist/picklist) */
|
|
408
|
-
--m-menu-min-width: 12rem;
|
|
408
|
+
--m-overlay-menu-min-width: 12rem;
|
|
409
409
|
}
|
|
410
410
|
|
|
411
411
|
.m-button,
|
|
@@ -463,7 +463,7 @@
|
|
|
463
463
|
.m-progress-spinner,
|
|
464
464
|
.m-cascadeselect,
|
|
465
465
|
.m-treeselect,
|
|
466
|
-
.m-
|
|
466
|
+
.m-colorpicker,
|
|
467
467
|
.m-inputtags,
|
|
468
468
|
.m-label,
|
|
469
469
|
.m-speeddial,
|
|
@@ -489,8 +489,7 @@
|
|
|
489
489
|
.m-password__input:disabled,
|
|
490
490
|
.m-inputnumber__input:disabled,
|
|
491
491
|
.m-inputotp__input:disabled,
|
|
492
|
-
.m-
|
|
493
|
-
.m-inputcolor__swatch:disabled,
|
|
492
|
+
.m-colorpicker__trigger:disabled,
|
|
494
493
|
.m-inputtags--disabled {
|
|
495
494
|
background-color: var(--m-color-bg-disabled);
|
|
496
495
|
color: var(--m-color-text-disabled);
|
|
@@ -513,8 +512,7 @@
|
|
|
513
512
|
.m-textarea::placeholder,
|
|
514
513
|
.m-password__input::placeholder,
|
|
515
514
|
.m-inputnumber__input::placeholder,
|
|
516
|
-
.m-inputtags__input::placeholder
|
|
517
|
-
.m-inputcolor__text::placeholder {
|
|
515
|
+
.m-inputtags__input::placeholder {
|
|
518
516
|
color: var(--m-color-text-muted);
|
|
519
517
|
opacity: 1;
|
|
520
518
|
}
|
|
@@ -858,9 +856,7 @@
|
|
|
858
856
|
font-family: var(--m-font-sans);
|
|
859
857
|
gap: var(--m-space-2);
|
|
860
858
|
max-width: 100%;
|
|
861
|
-
min-width: var(--m-menu-min-width);
|
|
862
859
|
position: relative;
|
|
863
|
-
width: fit-content;
|
|
864
860
|
}
|
|
865
861
|
|
|
866
862
|
.m-textarea-field--fluid,
|
|
@@ -1051,7 +1047,7 @@
|
|
|
1051
1047
|
flex: 1;
|
|
1052
1048
|
max-height: 16rem;
|
|
1053
1049
|
min-height: 12rem;
|
|
1054
|
-
min-width: var(--m-menu-min-width);
|
|
1050
|
+
min-width: var(--m-overlay-menu-min-width);
|
|
1055
1051
|
}
|
|
1056
1052
|
|
|
1057
1053
|
.m-orderlist__list,
|
|
@@ -1119,7 +1115,6 @@
|
|
|
1119
1115
|
.m-cascadeselect__trigger:hover:not(:disabled):not(:focus):not(:focus-visible),
|
|
1120
1116
|
.m-treeselect:not(.m-treeselect--open)
|
|
1121
1117
|
.m-treeselect__trigger:hover:not(:disabled):not(:focus):not(:focus-visible),
|
|
1122
|
-
.m-inputcolor__text:hover:not(:disabled):not(:focus),
|
|
1123
1118
|
.m-inputtags:hover:not(.m-inputtags--disabled):not(:focus-within),
|
|
1124
1119
|
.m-togglebutton:hover:not(:disabled):not(.m-togglebutton--checked):not(:focus-visible),
|
|
1125
1120
|
.m-inplace__display:hover:not(:focus-visible) {
|
|
@@ -1134,8 +1129,6 @@
|
|
|
1134
1129
|
.m-treeselect--open .m-treeselect__trigger,
|
|
1135
1130
|
.m-treeselect__trigger:focus,
|
|
1136
1131
|
.m-treeselect__trigger:focus-visible,
|
|
1137
|
-
.m-inputcolor__text:focus,
|
|
1138
|
-
.m-inputcolor__text:focus-visible,
|
|
1139
1132
|
.m-inputtags:focus-within,
|
|
1140
1133
|
.m-togglebutton:focus-visible,
|
|
1141
1134
|
.m-selectbutton__button:focus-visible,
|
|
@@ -1150,9 +1143,7 @@
|
|
|
1150
1143
|
|
|
1151
1144
|
.m-inputotp--invalid .m-inputotp__input:focus,
|
|
1152
1145
|
.m-inputotp--invalid .m-inputotp__input:focus-visible,
|
|
1153
|
-
.m-inputtags--invalid:focus-within
|
|
1154
|
-
.m-inputcolor--invalid .m-inputcolor__text:focus,
|
|
1155
|
-
.m-inputcolor--invalid .m-inputcolor__text:focus-visible {
|
|
1146
|
+
.m-inputtags--invalid:focus-within {
|
|
1156
1147
|
border-color: var(--m-color-danger);
|
|
1157
1148
|
box-shadow: var(--m-focus-shadow-danger);
|
|
1158
1149
|
}
|
package/dist/mega-menu/index.js
CHANGED
|
@@ -2,31 +2,31 @@ import { a as e } from "../useComponentAttrs-e-5QAjdw.js";
|
|
|
2
2
|
import { n as t, t as n } from "../overlay-oR-5MDuE.js";
|
|
3
3
|
import { t as r } from "../overlayPlacement-qwEJPVS4.js";
|
|
4
4
|
import { t as ee } from "../useFloatingViewportSync-wLLKIGUA.js";
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
5
|
+
import { t as i } from "../useMotionTransition-DohkfWRB.js";
|
|
6
|
+
import { t as te } from "../Icon-CmHjx7W8.js";
|
|
7
7
|
import { t as a } from "../useMenuKeyboard-BedmYE4W.js";
|
|
8
|
-
import { t as
|
|
9
|
-
import { l as
|
|
10
|
-
import { n as
|
|
8
|
+
import { n as o, t as s } from "../icon-CUrSaD8r.js";
|
|
9
|
+
import { l as ne } from "../config-Cd20zAyW.js";
|
|
10
|
+
import { n as re } from "../locale-BcxMPufl.js";
|
|
11
11
|
import "./style.js";
|
|
12
|
-
import { Fragment as
|
|
12
|
+
import { Fragment as c, Teleport as ie, Transition as ae, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as oe, createVNode as se, defineComponent as m, mergeProps as ce, nextTick as h, normalizeClass as g, normalizeStyle as le, onBeforeUnmount as ue, onMounted as de, openBlock as _, ref as v, renderList as y, resolveDynamicComponent as fe, toDisplayString as b, unref as x, useAttrs as pe, watch as S, withCtx as me, withModifiers as C } from "vue";
|
|
13
13
|
//#region src/components/MegaMenu/MegaMenu.vue?vue&type=script&setup=true&lang.ts
|
|
14
|
-
var
|
|
14
|
+
var he = ["aria-label"], ge = [
|
|
15
15
|
"disabled",
|
|
16
16
|
"tabindex",
|
|
17
17
|
"aria-expanded",
|
|
18
18
|
"aria-haspopup",
|
|
19
19
|
"onClick",
|
|
20
20
|
"onFocus"
|
|
21
|
-
],
|
|
21
|
+
], _e = {
|
|
22
22
|
key: 0,
|
|
23
23
|
class: "m-megamenu__icon",
|
|
24
24
|
"aria-hidden": "true"
|
|
25
|
-
},
|
|
25
|
+
}, ve = [
|
|
26
26
|
"disabled",
|
|
27
27
|
"tabindex",
|
|
28
28
|
"onClick"
|
|
29
|
-
],
|
|
29
|
+
], w = /* @__PURE__ */ m({
|
|
30
30
|
inheritAttrs: !1,
|
|
31
31
|
__name: "MegaMenu",
|
|
32
32
|
props: {
|
|
@@ -44,34 +44,40 @@ var de = ["aria-label"], fe = [
|
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
emits: ["update:selectedKey", "select"],
|
|
47
|
-
setup(
|
|
48
|
-
let
|
|
47
|
+
setup(m, { emit: w }) {
|
|
48
|
+
let T = m, E = w, ye = pe(), { rootAttrs: be } = e(ye, () => T.pt), D = ne(), { transitionName: O, transitionCss: k } = i({
|
|
49
49
|
role: "popup",
|
|
50
|
-
local: () =>
|
|
50
|
+
local: () => T.transition,
|
|
51
51
|
componentName: "MegaMenu",
|
|
52
52
|
fallback: "scale-fade"
|
|
53
|
-
}),
|
|
54
|
-
function
|
|
55
|
-
|
|
53
|
+
}), A = re(), j = v(null), M = v(null), N = v([]), P = v({}), F = l(() => t(T, D.value.appendTo)), I = l(() => n(T, D.value.appendTo));
|
|
54
|
+
function xe(e, t) {
|
|
55
|
+
N.value[t] = e instanceof HTMLElement ? e : null;
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
if (!
|
|
59
|
-
let e =
|
|
57
|
+
function L() {
|
|
58
|
+
if (!I.value || j.value == null) return;
|
|
59
|
+
let e = N.value[j.value];
|
|
60
60
|
if (!e) return;
|
|
61
61
|
let t = e.getBoundingClientRect();
|
|
62
|
-
|
|
62
|
+
P.value = r(t, "bottom-start", { gap: 4 });
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function R(e) {
|
|
65
65
|
return e.key ?? e.label;
|
|
66
66
|
}
|
|
67
|
+
function z(e) {
|
|
68
|
+
return !!(T.selectedKey && R(e) === T.selectedKey);
|
|
69
|
+
}
|
|
67
70
|
function B(e) {
|
|
68
|
-
return
|
|
71
|
+
return typeof e.icon == "string" ? s(e.icon) : void 0;
|
|
69
72
|
}
|
|
70
73
|
function V(e) {
|
|
71
|
-
return
|
|
74
|
+
return o(e.icon);
|
|
75
|
+
}
|
|
76
|
+
function Se(e) {
|
|
77
|
+
return !!(B(e) || V(e));
|
|
72
78
|
}
|
|
73
79
|
function H(e) {
|
|
74
|
-
e.disabled || (e.command?.(),
|
|
80
|
+
e.disabled || (e.command?.(), E("update:selectedKey", R(e)), E("select", e));
|
|
75
81
|
}
|
|
76
82
|
function U(e, t) {
|
|
77
83
|
if (!t.disabled) {
|
|
@@ -79,64 +85,64 @@ var de = ["aria-label"], fe = [
|
|
|
79
85
|
H(t), Y();
|
|
80
86
|
return;
|
|
81
87
|
}
|
|
82
|
-
|
|
88
|
+
j.value = j.value === e ? null : e, j.value != null && h(() => L());
|
|
83
89
|
}
|
|
84
90
|
}
|
|
85
|
-
let W =
|
|
86
|
-
itemCount: () =>
|
|
87
|
-
isItemDisabled: (e) => !!
|
|
91
|
+
let W = l(() => j.value == null ? [] : (T.model[j.value]?.items ?? []).flat()), G = a({
|
|
92
|
+
itemCount: () => T.model.length,
|
|
93
|
+
isItemDisabled: (e) => !!T.model[e]?.disabled,
|
|
88
94
|
orientation: "horizontal",
|
|
89
95
|
initialActiveIndex: 0,
|
|
90
96
|
onActivate: (e) => {
|
|
91
|
-
let t =
|
|
97
|
+
let t = T.model[e];
|
|
92
98
|
t && U(e, t);
|
|
93
99
|
}
|
|
94
100
|
}), K = a({
|
|
95
101
|
itemCount: () => W.value.length,
|
|
96
102
|
isItemDisabled: (e) => !!W.value[e]?.disabled,
|
|
97
|
-
enabled: () =>
|
|
103
|
+
enabled: () => j.value != null,
|
|
98
104
|
onActivate: (e) => {
|
|
99
105
|
let t = W.value[e];
|
|
100
106
|
t && Q(t);
|
|
101
107
|
}
|
|
102
108
|
});
|
|
103
109
|
function q(e) {
|
|
104
|
-
|
|
110
|
+
N.value[e]?.focus({ preventScroll: !0 });
|
|
105
111
|
}
|
|
106
|
-
function
|
|
107
|
-
return
|
|
112
|
+
function Ce() {
|
|
113
|
+
return M.value?.querySelector(".m-megamenu__panel") || document.querySelector(".m-megamenu__panel--teleported");
|
|
108
114
|
}
|
|
109
115
|
function J() {
|
|
110
116
|
let e = K.activeIndex.value;
|
|
111
|
-
e < 0 ||
|
|
117
|
+
e < 0 || Ce()?.querySelectorAll(".m-megamenu__link")[e]?.focus({ preventScroll: !0 });
|
|
112
118
|
}
|
|
113
|
-
function
|
|
114
|
-
let n =
|
|
119
|
+
function we(e, t) {
|
|
120
|
+
let n = j.value == null ? [] : T.model[j.value]?.items ?? [], r = t;
|
|
115
121
|
for (let t = 0; t < e; t++) r += n[t]?.length ?? 0;
|
|
116
122
|
return K.tabindexFor(r);
|
|
117
123
|
}
|
|
118
124
|
function Y(e = !1) {
|
|
119
|
-
let t =
|
|
120
|
-
|
|
125
|
+
let t = j.value;
|
|
126
|
+
j.value = null, K.reset(), e && t != null && q(t);
|
|
121
127
|
}
|
|
122
128
|
function X(e, t = !1) {
|
|
123
|
-
|
|
124
|
-
|
|
129
|
+
j.value = e, G.setActive(e), h(() => {
|
|
130
|
+
L(), t && (K.moveFirst(), J());
|
|
125
131
|
});
|
|
126
132
|
}
|
|
127
133
|
function Z(e) {
|
|
128
134
|
G.move(e);
|
|
129
|
-
let t = G.activeIndex.value, n =
|
|
130
|
-
|
|
135
|
+
let t = G.activeIndex.value, n = T.model[t];
|
|
136
|
+
j.value != null && (n?.items?.length ? X(t, !0) : Y()), q(t);
|
|
131
137
|
}
|
|
132
|
-
function
|
|
138
|
+
function Te(e) {
|
|
133
139
|
if (e.key === "Escape") {
|
|
134
|
-
|
|
140
|
+
j.value != null && (e.preventDefault(), Y(!0));
|
|
135
141
|
return;
|
|
136
142
|
}
|
|
137
143
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
138
144
|
e.preventDefault();
|
|
139
|
-
let t = G.activeIndex.value, n =
|
|
145
|
+
let t = G.activeIndex.value, n = T.model[t];
|
|
140
146
|
n?.items?.length && !n.disabled && X(t, !0);
|
|
141
147
|
return;
|
|
142
148
|
}
|
|
@@ -146,7 +152,7 @@ var de = ["aria-label"], fe = [
|
|
|
146
152
|
}
|
|
147
153
|
G.onKeydown(e);
|
|
148
154
|
}
|
|
149
|
-
function
|
|
155
|
+
function Ee(e) {
|
|
150
156
|
if (e.stopPropagation(), e.key === "Escape") {
|
|
151
157
|
e.preventDefault(), Y(!0);
|
|
152
158
|
return;
|
|
@@ -160,71 +166,72 @@ var de = ["aria-label"], fe = [
|
|
|
160
166
|
function Q(e) {
|
|
161
167
|
e.disabled || (H(e), Y(!0));
|
|
162
168
|
}
|
|
163
|
-
|
|
164
|
-
e >= 0 &&
|
|
165
|
-
}),
|
|
166
|
-
|
|
169
|
+
S(G.activeIndex, (e) => {
|
|
170
|
+
e >= 0 && j.value == null && q(e);
|
|
171
|
+
}), S(K.activeIndex, () => {
|
|
172
|
+
j.value != null && J();
|
|
167
173
|
});
|
|
168
174
|
function $(e) {
|
|
169
175
|
let t = e.target;
|
|
170
|
-
|
|
176
|
+
M.value?.contains(t) || document.querySelector(".m-megamenu__panel--teleported")?.contains(t) || Y();
|
|
171
177
|
}
|
|
172
|
-
function
|
|
173
|
-
|
|
178
|
+
function De() {
|
|
179
|
+
j.value != null && L();
|
|
174
180
|
}
|
|
175
|
-
return ee(() =>
|
|
181
|
+
return ee(() => j.value != null && I.value, De), de(() => document.addEventListener("click", $)), ue(() => {
|
|
176
182
|
document.removeEventListener("click", $);
|
|
177
|
-
}), (e, t) => (
|
|
183
|
+
}), (e, t) => (_(), f("nav", ce(x(be), {
|
|
178
184
|
ref_key: "root",
|
|
179
|
-
ref:
|
|
185
|
+
ref: M,
|
|
180
186
|
class: "m-megamenu",
|
|
181
|
-
"aria-label":
|
|
182
|
-
onKeydown:
|
|
183
|
-
}), [(
|
|
187
|
+
"aria-label": x(A).megaMenu,
|
|
188
|
+
onKeydown: Te
|
|
189
|
+
}), [(_(!0), f(c, null, y(m.model, (e, t) => (_(), f("div", {
|
|
184
190
|
key: `${e.label}-${t}`,
|
|
185
|
-
class:
|
|
186
|
-
}, [
|
|
191
|
+
class: g(["m-megamenu__item", { "m-megamenu__item--open": j.value === t }])
|
|
192
|
+
}, [p("button", {
|
|
187
193
|
ref_for: !0,
|
|
188
|
-
ref: (e) =>
|
|
194
|
+
ref: (e) => xe(e, t),
|
|
189
195
|
type: "button",
|
|
190
|
-
class:
|
|
196
|
+
class: g(["m-megamenu__trigger", { "m-megamenu__trigger--selected": z(e) }]),
|
|
191
197
|
disabled: e.disabled,
|
|
192
|
-
tabindex:
|
|
193
|
-
"aria-expanded": e.items?.length ?
|
|
198
|
+
tabindex: x(G).tabindexFor(t),
|
|
199
|
+
"aria-expanded": e.items?.length ? j.value === t : void 0,
|
|
194
200
|
"aria-haspopup": e.items?.length ? "menu" : void 0,
|
|
195
|
-
onClick:
|
|
196
|
-
onFocus: (e) =>
|
|
197
|
-
}, [
|
|
198
|
-
|
|
201
|
+
onClick: C((n) => U(t, e), ["stop"]),
|
|
202
|
+
onFocus: (e) => x(G).setActive(t)
|
|
203
|
+
}, [Se(e) ? (_(), f("span", _e, [B(e) ? (_(), u(te, {
|
|
204
|
+
key: 0,
|
|
205
|
+
name: B(e),
|
|
199
206
|
size: "sm"
|
|
200
|
-
}, null, 8, ["name"])])) :
|
|
201
|
-
to:
|
|
202
|
-
disabled:
|
|
203
|
-
}, [
|
|
204
|
-
name:
|
|
205
|
-
css:
|
|
207
|
+
}, null, 8, ["name"])) : V(e) ? (_(), u(fe(V(e)), { key: 1 })) : d("", !0)])) : d("", !0), oe(" " + b(e.label), 1)], 42, ge), (_(), u(ie, {
|
|
208
|
+
to: F.value.to,
|
|
209
|
+
disabled: F.value.disabled
|
|
210
|
+
}, [se(ae, {
|
|
211
|
+
name: x(O),
|
|
212
|
+
css: x(k)
|
|
206
213
|
}, {
|
|
207
|
-
default:
|
|
214
|
+
default: me(() => [e.items?.length && j.value === t ? (_(), f("div", {
|
|
208
215
|
key: 0,
|
|
209
|
-
class:
|
|
210
|
-
style:
|
|
216
|
+
class: g(["m-megamenu__panel", { "m-megamenu__panel--teleported": I.value }]),
|
|
217
|
+
style: le(I.value ? P.value : void 0),
|
|
211
218
|
role: "menu",
|
|
212
|
-
onKeydown:
|
|
213
|
-
}, [(
|
|
219
|
+
onKeydown: Ee
|
|
220
|
+
}, [(_(!0), f(c, null, y(e.items, (e, t) => (_(), f("div", {
|
|
214
221
|
key: t,
|
|
215
222
|
class: "m-megamenu__column"
|
|
216
|
-
}, [(
|
|
223
|
+
}, [(_(!0), f(c, null, y(e, (e, n) => (_(), f("button", {
|
|
217
224
|
key: `${e.label}-${n}`,
|
|
218
225
|
type: "button",
|
|
219
|
-
class:
|
|
226
|
+
class: g(["m-megamenu__link", { "m-megamenu__link--selected": z(e) }]),
|
|
220
227
|
role: "menuitem",
|
|
221
228
|
disabled: e.disabled,
|
|
222
|
-
tabindex:
|
|
223
|
-
onClick:
|
|
224
|
-
},
|
|
229
|
+
tabindex: we(t, n),
|
|
230
|
+
onClick: C((t) => Q(e), ["stop"])
|
|
231
|
+
}, b(e.label), 11, ve))), 128))]))), 128))], 38)) : d("", !0)]),
|
|
225
232
|
_: 2
|
|
226
|
-
}, 1032, ["name", "css"])], 8, ["to", "disabled"]))], 2))), 128))], 16,
|
|
233
|
+
}, 1032, ["name", "css"])], 8, ["to", "disabled"]))], 2))), 128))], 16, he));
|
|
227
234
|
}
|
|
228
235
|
});
|
|
229
236
|
//#endregion
|
|
230
|
-
export {
|
|
237
|
+
export { w as MMegaMenu };
|
package/dist/mega-menu/style.css
CHANGED
|
@@ -405,7 +405,7 @@
|
|
|
405
405
|
|
|
406
406
|
:root {
|
|
407
407
|
/* Shared minimum width for menu-like panels (select/orderlist/picklist) */
|
|
408
|
-
--m-menu-min-width: 12rem;
|
|
408
|
+
--m-overlay-menu-min-width: 12rem;
|
|
409
409
|
}
|
|
410
410
|
|
|
411
411
|
.m-button,
|
|
@@ -463,7 +463,7 @@
|
|
|
463
463
|
.m-progress-spinner,
|
|
464
464
|
.m-cascadeselect,
|
|
465
465
|
.m-treeselect,
|
|
466
|
-
.m-
|
|
466
|
+
.m-colorpicker,
|
|
467
467
|
.m-inputtags,
|
|
468
468
|
.m-label,
|
|
469
469
|
.m-speeddial,
|
|
@@ -489,8 +489,7 @@
|
|
|
489
489
|
.m-password__input:disabled,
|
|
490
490
|
.m-inputnumber__input:disabled,
|
|
491
491
|
.m-inputotp__input:disabled,
|
|
492
|
-
.m-
|
|
493
|
-
.m-inputcolor__swatch:disabled,
|
|
492
|
+
.m-colorpicker__trigger:disabled,
|
|
494
493
|
.m-inputtags--disabled {
|
|
495
494
|
background-color: var(--m-color-bg-disabled);
|
|
496
495
|
color: var(--m-color-text-disabled);
|
|
@@ -513,8 +512,7 @@
|
|
|
513
512
|
.m-textarea::placeholder,
|
|
514
513
|
.m-password__input::placeholder,
|
|
515
514
|
.m-inputnumber__input::placeholder,
|
|
516
|
-
.m-inputtags__input::placeholder
|
|
517
|
-
.m-inputcolor__text::placeholder {
|
|
515
|
+
.m-inputtags__input::placeholder {
|
|
518
516
|
color: var(--m-color-text-muted);
|
|
519
517
|
opacity: 1;
|
|
520
518
|
}
|
|
@@ -858,9 +856,7 @@
|
|
|
858
856
|
font-family: var(--m-font-sans);
|
|
859
857
|
gap: var(--m-space-2);
|
|
860
858
|
max-width: 100%;
|
|
861
|
-
min-width: var(--m-menu-min-width);
|
|
862
859
|
position: relative;
|
|
863
|
-
width: fit-content;
|
|
864
860
|
}
|
|
865
861
|
|
|
866
862
|
.m-textarea-field--fluid,
|
|
@@ -1051,7 +1047,7 @@
|
|
|
1051
1047
|
flex: 1;
|
|
1052
1048
|
max-height: 16rem;
|
|
1053
1049
|
min-height: 12rem;
|
|
1054
|
-
min-width: var(--m-menu-min-width);
|
|
1050
|
+
min-width: var(--m-overlay-menu-min-width);
|
|
1055
1051
|
}
|
|
1056
1052
|
|
|
1057
1053
|
.m-orderlist__list,
|
|
@@ -1119,7 +1115,6 @@
|
|
|
1119
1115
|
.m-cascadeselect__trigger:hover:not(:disabled):not(:focus):not(:focus-visible),
|
|
1120
1116
|
.m-treeselect:not(.m-treeselect--open)
|
|
1121
1117
|
.m-treeselect__trigger:hover:not(:disabled):not(:focus):not(:focus-visible),
|
|
1122
|
-
.m-inputcolor__text:hover:not(:disabled):not(:focus),
|
|
1123
1118
|
.m-inputtags:hover:not(.m-inputtags--disabled):not(:focus-within),
|
|
1124
1119
|
.m-togglebutton:hover:not(:disabled):not(.m-togglebutton--checked):not(:focus-visible),
|
|
1125
1120
|
.m-inplace__display:hover:not(:focus-visible) {
|
|
@@ -1134,8 +1129,6 @@
|
|
|
1134
1129
|
.m-treeselect--open .m-treeselect__trigger,
|
|
1135
1130
|
.m-treeselect__trigger:focus,
|
|
1136
1131
|
.m-treeselect__trigger:focus-visible,
|
|
1137
|
-
.m-inputcolor__text:focus,
|
|
1138
|
-
.m-inputcolor__text:focus-visible,
|
|
1139
1132
|
.m-inputtags:focus-within,
|
|
1140
1133
|
.m-togglebutton:focus-visible,
|
|
1141
1134
|
.m-selectbutton__button:focus-visible,
|
|
@@ -1150,9 +1143,7 @@
|
|
|
1150
1143
|
|
|
1151
1144
|
.m-inputotp--invalid .m-inputotp__input:focus,
|
|
1152
1145
|
.m-inputotp--invalid .m-inputotp__input:focus-visible,
|
|
1153
|
-
.m-inputtags--invalid:focus-within
|
|
1154
|
-
.m-inputcolor--invalid .m-inputcolor__text:focus,
|
|
1155
|
-
.m-inputcolor--invalid .m-inputcolor__text:focus-visible {
|
|
1146
|
+
.m-inputtags--invalid:focus-within {
|
|
1156
1147
|
border-color: var(--m-color-danger);
|
|
1157
1148
|
box-shadow: var(--m-focus-shadow-danger);
|
|
1158
1149
|
}
|