morya-ui 0.3.0 → 0.3.2
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 +64 -0
- package/dist/Button-dMqRmoYa.js +222 -0
- package/dist/{Card-Dsmnzong.js → Card-B1CB9Trm.js} +3 -5
- package/dist/Empty-C5tndBOm.js +147 -0
- package/dist/Icon-od9Ob-Ay.js +393 -0
- package/dist/Loading-BSsRs6v9.js +420 -0
- package/dist/Pagination-CqpC5EAs.js +166 -0
- package/dist/Select-CKGrSoaC.js +572 -0
- package/dist/Skeleton-DCYdXAH2.js +59 -0
- package/dist/accordion/style.css +20 -71
- package/dist/auto-complete/index.js +118 -120
- package/dist/auto-complete/style.css +24 -88
- package/dist/avatar/index.js +1 -1
- package/dist/avatar/style.css +10 -67
- package/dist/badge/style.css +10 -68
- package/dist/block-ui/style.css +10 -68
- package/dist/breadcrumb/style.css +10 -61
- package/dist/button/index.js +1 -1
- package/dist/button/style.css +72 -78
- package/dist/card/index.js +1 -1
- package/dist/card/style.css +30 -67
- package/dist/carousel/index.js +72 -64
- package/dist/carousel/style.css +36 -82
- package/dist/cascade-select/index.js +1 -1
- package/dist/cascade-select/style.css +24 -81
- package/dist/checkbox/style.css +10 -61
- package/dist/chip/index.js +1 -1
- package/dist/chip/style.css +10 -67
- package/dist/command-menu/index.js +37 -39
- package/dist/command-menu/style.css +10 -75
- package/dist/components/Accordion/styles.css +10 -10
- package/dist/components/AutoComplete/AutoComplete.vue.d.ts.map +1 -1
- package/dist/components/AutoComplete/styles.css +0 -7
- package/dist/components/Badge/styles.css +0 -7
- package/dist/components/BlockUI/styles.css +0 -7
- package/dist/components/Button/Button.vue.d.ts +2 -0
- package/dist/components/Button/Button.vue.d.ts.map +1 -1
- package/dist/components/Button/styles.css +62 -11
- package/dist/components/Button/types.d.ts +4 -0
- package/dist/components/Button/types.d.ts.map +1 -1
- package/dist/components/Card/Card.vue.d.ts +2 -2
- package/dist/components/Card/Card.vue.d.ts.map +1 -1
- package/dist/components/Card/index.d.ts +1 -1
- package/dist/components/Card/index.d.ts.map +1 -1
- package/dist/components/Card/styles.css +20 -6
- package/dist/components/Card/types.d.ts +4 -2
- package/dist/components/Card/types.d.ts.map +1 -1
- package/dist/components/Carousel/Carousel.vue.d.ts.map +1 -1
- package/dist/components/Carousel/styles.css +26 -15
- package/dist/components/CommandMenu/CommandMenu.vue.d.ts.map +1 -1
- package/dist/components/ConfigProvider/ConfigProvider.vue.d.ts +2 -2
- package/dist/components/DataView/DataView.vue.d.ts +7 -7
- package/dist/components/DataView/DataView.vue.d.ts.map +1 -1
- package/dist/components/DataView/styles.css +0 -20
- package/dist/components/Dialog/styles.css +3 -46
- package/dist/components/Dock/styles.css +0 -10
- package/dist/components/Drawer/styles.css +2 -51
- package/dist/components/Dropdown/Dropdown.vue.d.ts +2 -2
- package/dist/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
- package/dist/components/Dropdown/DropdownNodes.vue.d.ts +8 -9
- package/dist/components/Dropdown/DropdownNodes.vue.d.ts.map +1 -1
- package/dist/components/Dropdown/styles.css +24 -5
- package/dist/components/Fieldset/styles.css +0 -7
- package/dist/components/FileUpload/FileUpload.vue.d.ts.map +1 -1
- package/dist/components/FileUpload/fileUtils.d.ts +8 -0
- package/dist/components/FileUpload/fileUtils.d.ts.map +1 -0
- package/dist/components/Gallery/styles.css +0 -8
- package/dist/components/Icon/Icon.vue.d.ts.map +1 -1
- package/dist/components/Icon/icon-categories.d.ts.map +1 -1
- package/dist/components/Icon/icons-types.d.ts +4 -2
- package/dist/components/Icon/icons-types.d.ts.map +1 -1
- package/dist/components/Icon/icons.d.ts +250 -561
- package/dist/components/Icon/icons.d.ts.map +1 -1
- package/dist/components/Icon/index.d.ts +2 -2
- package/dist/components/Icon/index.d.ts.map +1 -1
- package/dist/components/Icon/styles.css +0 -6
- package/dist/components/Knob/styles.css +0 -6
- package/dist/components/Layout/styles.css +5 -14
- package/dist/components/Listbox/Listbox.vue.d.ts.map +1 -1
- package/dist/components/Loading/styles.css +0 -16
- package/dist/components/Menu/Menu.vue.d.ts.map +1 -1
- package/dist/components/Menu/styles.css +6 -7
- package/dist/components/Menubar/Menubar.vue.d.ts.map +1 -1
- package/dist/components/Menubar/styles.css +4 -0
- package/dist/components/Message/styles.css +0 -13
- package/dist/components/Page/PageContent.vue.d.ts +2 -1
- package/dist/components/Page/PageContent.vue.d.ts.map +1 -1
- package/dist/components/Page/PageFilterChips.vue.d.ts +16 -0
- package/dist/components/Page/PageFilterChips.vue.d.ts.map +1 -0
- package/dist/components/Page/PageFilters.vue.d.ts +15 -3
- package/dist/components/Page/PageFilters.vue.d.ts.map +1 -1
- package/dist/components/Page/PageHeader.vue.d.ts +8 -4
- package/dist/components/Page/PageHeader.vue.d.ts.map +1 -1
- package/dist/components/Page/PagePlaceholder.vue.d.ts +6 -2
- package/dist/components/Page/PagePlaceholder.vue.d.ts.map +1 -1
- package/dist/components/Page/PageSection.vue.d.ts +8 -2
- package/dist/components/Page/PageSection.vue.d.ts.map +1 -1
- package/dist/components/Page/PageStat.vue.d.ts +8 -3
- package/dist/components/Page/PageStat.vue.d.ts.map +1 -1
- package/dist/components/Page/index.d.ts +2 -1
- package/dist/components/Page/index.d.ts.map +1 -1
- package/dist/components/Page/styles.css +239 -44
- package/dist/components/Page/types.d.ts +40 -0
- package/dist/components/Page/types.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.vue.d.ts.map +1 -1
- package/dist/components/Pagination/styles.css +7 -10
- package/dist/components/Pagination/types.d.ts +1 -1
- package/dist/components/Pagination/types.d.ts.map +1 -1
- package/dist/components/Panel/styles.css +0 -7
- package/dist/components/Popover/styles.css +20 -17
- package/dist/components/ProgressBar/styles.css +0 -9
- package/dist/components/ProgressSpinner/styles.css +0 -7
- package/dist/components/ScrollTop/styles.css +0 -7
- package/dist/components/Scrollbar/Scrollbar.vue.d.ts +1 -1
- package/dist/components/Scrollbar/styles.css +0 -8
- package/dist/components/Select/Select.vue.d.ts +10 -8
- package/dist/components/Select/Select.vue.d.ts.map +1 -1
- package/dist/components/Select/selectOptions.d.ts +46 -0
- package/dist/components/Select/selectOptions.d.ts.map +1 -0
- package/dist/components/Select/styles.css +35 -8
- package/dist/components/Select/types.d.ts +11 -1
- package/dist/components/Select/types.d.ts.map +1 -1
- package/dist/components/Sidebar/styles.css +0 -6
- package/dist/components/Skeleton/styles.css +0 -6
- package/dist/components/Slider/styles.css +9 -0
- package/dist/components/SplitButton/styles.css +5 -0
- package/dist/components/Status/styles.css +0 -7
- package/dist/components/Switch/styles.css +0 -7
- package/dist/components/Table/Table.vue.d.ts +26 -26
- package/dist/components/Table/Table.vue.d.ts.map +1 -1
- package/dist/components/Table/TableLoadingLine.vue.d.ts.map +1 -1
- package/dist/components/Table/hooks/useExpandableRow.d.ts.map +1 -1
- package/dist/components/Table/hooks/useTotalItems.d.ts.map +1 -1
- package/dist/components/Table/styles.css +61 -44
- package/dist/components/Table/tableQuery.d.ts +30 -0
- package/dist/components/Table/tableQuery.d.ts.map +1 -0
- package/dist/components/Tree/Tree.vue.d.ts.map +1 -1
- package/dist/components/Tree/treeQuery.d.ts +31 -0
- package/dist/components/Tree/treeQuery.d.ts.map +1 -0
- package/dist/components/TreeSelect/TreeSelect.vue.d.ts.map +1 -1
- package/dist/components/TreeSelect/styles.css +1 -1
- package/dist/config-provider/index.js +1 -1
- package/dist/config-provider/style.css +72 -72
- package/dist/confirm-dialog/index.js +2 -2
- package/dist/confirm-dialog/style.css +75 -124
- package/dist/confirm-popup/index.js +2 -2
- package/dist/confirm-popup/style.css +72 -78
- package/dist/context-menu/index.js +2 -2
- package/dist/context-menu/style.css +10 -75
- package/dist/data-view/index.js +47 -47
- package/dist/data-view/style.css +393 -174
- package/dist/data-view/style.js +1 -1
- package/dist/date-picker/index.js +1 -1
- package/dist/date-picker/style.css +10 -67
- package/dist/dialog/index.js +2 -2
- package/dist/dialog/style.css +75 -124
- package/dist/divider/style.css +10 -61
- package/dist/dock/index.js +2 -2
- package/dist/dock/style.css +10 -77
- package/dist/drawer/index.js +1 -1
- package/dist/drawer/style.css +12 -118
- package/dist/dropdown/index.js +110 -91
- package/dist/dropdown/style.css +34 -80
- package/dist/empty/index.js +5 -150
- package/dist/empty/style.css +10 -67
- package/dist/fieldset/index.js +1 -1
- package/dist/fieldset/style.css +10 -74
- package/dist/file-upload/index.js +148 -146
- package/dist/file-upload/style.css +10 -67
- package/dist/filterByQuery-Bczaxzih.js +17 -0
- package/dist/flex/style.css +10 -61
- package/dist/float-label/style.css +10 -61
- package/dist/fluid/style.css +10 -61
- package/dist/form/style.css +10 -61
- package/dist/gallery/index.js +1 -1
- package/dist/gallery/style.css +10 -83
- package/dist/grid/style.css +10 -61
- package/dist/icon/index.js +93 -39
- package/dist/icon/style.css +10 -67
- package/dist/icon-COrt_N8A.js +18 -0
- package/dist/icon-field/style.css +10 -61
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5400 -5145
- package/dist/inplace/style.css +10 -61
- package/dist/input/index.js +1 -1
- package/dist/input/style.css +10 -67
- package/dist/input-color/style.css +10 -61
- package/dist/input-group/style.css +10 -61
- package/dist/input-number/index.js +1 -1
- package/dist/input-number/style.css +10 -67
- package/dist/input-otp/style.css +10 -61
- package/dist/input-password/index.js +1 -1
- package/dist/input-password/style.css +10 -67
- package/dist/input-tags/index.js +1 -1
- package/dist/input-tags/style.css +10 -67
- package/dist/knob/style.css +10 -67
- package/dist/label/style.css +10 -61
- package/dist/layout/index.js +1 -1
- package/dist/layout/style.css +15 -89
- package/dist/listbox/index.js +30 -32
- package/dist/listbox/style.css +10 -69
- package/dist/loading/index.js +32 -446
- package/dist/loading/style.css +10 -77
- package/dist/mega-menu/index.js +2 -2
- package/dist/mega-menu/style.css +10 -67
- package/dist/menu/index.js +265 -255
- package/dist/menu/style.css +36 -99
- package/dist/menubar/index.js +6 -3
- package/dist/menubar/style.css +14 -75
- package/dist/message/index.js +1 -1
- package/dist/message/style.css +10 -80
- package/dist/meter-group/style.css +10 -61
- package/dist/order-list/index.js +1 -1
- package/dist/order-list/style.css +10 -67
- package/dist/page/index.js +229 -70
- package/dist/page/style.css +1186 -113
- package/dist/page/style.js +3 -0
- package/dist/pagination/index.js +1 -1
- package/dist/pagination/style.css +210 -77
- package/dist/pagination/style.js +1 -0
- package/dist/panel/index.js +1 -1
- package/dist/panel/style.css +10 -74
- package/dist/pick-list/index.js +1 -1
- package/dist/pick-list/style.css +10 -67
- package/dist/popover/style.css +30 -78
- package/dist/progress-bar/style.css +10 -70
- package/dist/progress-spinner/index.js +105 -2
- package/dist/progress-spinner/style.css +10 -68
- package/dist/radio/style.css +10 -61
- package/dist/rating/index.js +1 -1
- package/dist/rating/style.css +10 -67
- package/dist/resolver-map.d.ts.map +1 -1
- package/dist/resolver.js +1 -0
- package/dist/result/index.js +1 -1
- package/dist/result/style.css +10 -67
- package/dist/scroll-top/index.js +1 -1
- package/dist/scroll-top/style.css +10 -82
- package/dist/scrollbar/style.css +10 -69
- package/dist/select/index.js +2 -478
- package/dist/select/style.css +59 -89
- package/dist/select-button/style.css +10 -61
- package/dist/shared/config.d.ts +2 -2
- package/dist/shared/filterByQuery.d.ts +14 -0
- package/dist/shared/filterByQuery.d.ts.map +1 -0
- package/dist/shared/menu/expand.d.ts +38 -0
- package/dist/shared/menu/expand.d.ts.map +1 -0
- package/dist/shared/menu/icon.d.ts.map +1 -1
- package/dist/shared/menu/index.d.ts +2 -0
- package/dist/shared/menu/index.d.ts.map +1 -1
- package/dist/shared/styles/select-overlay.css +14 -6
- package/dist/sidebar/index.js +2 -2
- package/dist/sidebar/style.css +10 -73
- package/dist/skeleton/index.js +2 -59
- package/dist/skeleton/style.css +10 -67
- package/dist/slider/style.css +19 -61
- package/dist/space/style.css +10 -61
- package/dist/speed-dial/index.js +2 -2
- package/dist/speed-dial/style.css +10 -67
- package/dist/split-button/index.js +1 -1
- package/dist/split-button/style.css +77 -78
- package/dist/splitter/style.css +10 -61
- package/dist/status/index.js +1 -1
- package/dist/status/style.css +10 -74
- package/dist/stepper/index.js +1 -1
- package/dist/stepper/style.css +10 -67
- package/dist/styles/base.css +5 -50
- package/dist/styles.css +1 -1
- package/dist/switch/style.css +10 -68
- package/dist/table/index.js +409 -373
- package/dist/table/style.css +457 -215
- package/dist/table/style.js +1 -1
- package/dist/tabs/index.js +1 -1
- package/dist/tabs/style.css +10 -75
- package/dist/tag/index.js +1 -1
- package/dist/tag/style.css +10 -67
- package/dist/terminal/style.css +10 -61
- package/dist/textarea/index.js +1 -1
- package/dist/textarea/style.css +10 -67
- package/dist/theme/styles.css +5 -11
- package/dist/theme/useMotion.d.ts +5 -1
- package/dist/theme/useMotion.d.ts.map +1 -1
- package/dist/tiered-menu/index.js +1 -1
- package/dist/tiered-menu/style.css +10 -75
- package/dist/timeline/index.js +1 -1
- package/dist/timeline/style.css +10 -75
- package/dist/toast/index.js +1 -1
- package/dist/toast/style.css +10 -67
- package/dist/toggle-button/index.js +2 -2
- package/dist/toggle-button/style.css +10 -67
- package/dist/toolbar/style.css +10 -61
- package/dist/tooltip/style.css +10 -61
- package/dist/tree/index.js +159 -173
- package/dist/tree/style.css +10 -67
- package/dist/tree-select/index.js +200 -213
- package/dist/tree-select/style.css +25 -82
- package/dist/tree-table/index.js +1 -1
- package/dist/tree-table/style.css +10 -67
- package/dist/treeQuery-CnHkyYOA.js +107 -0
- package/dist/virtual-scroller/style.css +10 -69
- package/package.json +1 -1
- package/dist/Button-B5X_R4Md.js +0 -156
- package/dist/Icon-lcN1rS87.js +0 -610
- package/dist/Pagination-CVrH8Ypi.js +0 -158
- package/dist/ProgressSpinner-BeWVF6Jv.js +0 -105
- package/dist/checkStrategy-CZzuUKDI.js +0 -63
- package/dist/components/Icon/icons-tabler.d.ts +0 -77
- package/dist/components/Icon/icons-tabler.d.ts.map +0 -1
- package/dist/icon-DWXkh-RM.js +0 -27
package/dist/menu/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { a as e } from "../useComponentAttrs-e-5QAjdw.js";
|
|
2
|
-
import { t } from "../Icon-
|
|
2
|
+
import { t } from "../Icon-od9Ob-Ay.js";
|
|
3
3
|
import { t as n } from "../useMotionTransition-Bxnnb_9u.js";
|
|
4
4
|
import { n as r, t as i } from "../overlay-oR-5MDuE.js";
|
|
5
5
|
import { t as a } from "../overlayPlacement-Cd20JTD_.js";
|
|
6
6
|
import { t as o } from "../useFloatingViewportSync-DZdJ7W8n.js";
|
|
7
7
|
import { t as s } from "../useMenuKeyboard-BedmYE4W.js";
|
|
8
8
|
import { t as c } from "../Scrollbar-DTeJ8P5b.js";
|
|
9
|
-
import { t as ee } from "../icon-
|
|
9
|
+
import { t as ee } from "../icon-COrt_N8A.js";
|
|
10
10
|
import { t as l } from "../key-CaQYVkjh.js";
|
|
11
11
|
import { t as u } from "../lastPointer-CRxcUqdd.js";
|
|
12
12
|
import { t as d } from "../Popover-BQ07q4VV.js";
|
|
13
13
|
import { t as f } from "../Tooltip-D5DO0B3z.js";
|
|
14
14
|
import { c as te } from "../config-CapALqt3.js";
|
|
15
15
|
import "./style.js";
|
|
16
|
-
import { Fragment as p, Teleport as ne, Transition as
|
|
16
|
+
import { Fragment as p, Teleport as ne, Transition as re, computed as m, createBlock as h, createCommentVNode as g, createElementBlock as _, createElementVNode as v, createVNode as y, defineComponent as b, getCurrentInstance as x, inject as ie, mergeProps as S, nextTick as C, normalizeClass as w, normalizeStyle as T, onBeforeUnmount as ae, openBlock as E, provide as D, reactive as oe, ref as O, renderList as k, renderSlot as A, resolveDynamicComponent as j, toDisplayString as M, unref as N, useAttrs as se, useSlots as ce, watch as P, withCtx as F } from "vue";
|
|
17
17
|
//#region src/shared/menu/tree.ts
|
|
18
18
|
function I(e, t, n = "item") {
|
|
19
19
|
return l(e, t, n);
|
|
@@ -34,17 +34,17 @@ function L(e, t, n = "item") {
|
|
|
34
34
|
function le(e, t, n, r = "item") {
|
|
35
35
|
return e.items?.length ? I(e, n, r) === t || L(e.items, t, `${r}-${n}`) !== null : !1;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function R(e, t = "item") {
|
|
38
38
|
let n = [];
|
|
39
39
|
for (let r = 0; r < e.length; r++) {
|
|
40
40
|
let i = e[r];
|
|
41
41
|
if (i.separator || !i.items?.length) continue;
|
|
42
42
|
let a = I(i, r, t);
|
|
43
|
-
n.push(a), n.push(...
|
|
43
|
+
n.push(a), n.push(...R(i.items, `${t}-${r}`));
|
|
44
44
|
}
|
|
45
45
|
return n;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function ue(e, t = "item") {
|
|
48
48
|
let n = [];
|
|
49
49
|
for (let r = 0; r < e.length; r++) {
|
|
50
50
|
let i = e[r];
|
|
@@ -53,41 +53,79 @@ function de(e, t = "item") {
|
|
|
53
53
|
return n;
|
|
54
54
|
}
|
|
55
55
|
//#endregion
|
|
56
|
+
//#region src/shared/menu/expand.ts
|
|
57
|
+
function de(e, t = {}) {
|
|
58
|
+
return t.defaultExpandAll ? R(e) : t.defaultExpandedKeys?.length ? [...t.defaultExpandedKeys] : t.selectedKey ? L(e, t.selectedKey) ?? [] : [];
|
|
59
|
+
}
|
|
60
|
+
function fe(e, t, n = {}) {
|
|
61
|
+
let r = [...e], i = r.indexOf(t);
|
|
62
|
+
if (i >= 0) return r.splice(i, 1), r;
|
|
63
|
+
let a = n.topLevelKeys ?? [];
|
|
64
|
+
if (n.accordion && a.includes(t)) {
|
|
65
|
+
for (let e of [...r]) if (a.includes(e) && e !== t) {
|
|
66
|
+
let t = r.indexOf(e);
|
|
67
|
+
t >= 0 && r.splice(t, 1);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return r.push(t), r;
|
|
71
|
+
}
|
|
72
|
+
function pe(e, t, n = {}) {
|
|
73
|
+
if (!t.length) return e;
|
|
74
|
+
let r = /* @__PURE__ */ new Set([...e, ...t]);
|
|
75
|
+
if (n.accordion) for (let e of n.topLevelKeys ?? []) r.has(e) && !t.includes(e) && r.delete(e);
|
|
76
|
+
return Array.from(r);
|
|
77
|
+
}
|
|
78
|
+
function me(e, t) {
|
|
79
|
+
let n = [], r = (e, i, a) => {
|
|
80
|
+
e.forEach((e, o) => {
|
|
81
|
+
if (e.separator) return;
|
|
82
|
+
let s = I(e, o, i), c = !!e.items?.length;
|
|
83
|
+
n.push({
|
|
84
|
+
item: e,
|
|
85
|
+
key: s,
|
|
86
|
+
parentKey: a,
|
|
87
|
+
hasChildren: c
|
|
88
|
+
}), c && !t.excludeChildren && t.isExpanded(s) && r(e.items, `${i}-${o}`, s);
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
return r(e, t.prefix ?? "item", null), n;
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
56
94
|
//#region src/components/Menu/context.ts
|
|
57
|
-
var
|
|
95
|
+
var he = Symbol("muMenu");
|
|
58
96
|
//#endregion
|
|
59
97
|
//#region src/shared/optionalRouter.ts
|
|
60
|
-
function
|
|
98
|
+
function z(e) {
|
|
61
99
|
return !!(e && typeof e == "object" && "resolve" in e && "push" in e);
|
|
62
100
|
}
|
|
63
|
-
function
|
|
64
|
-
let e =
|
|
101
|
+
function B() {
|
|
102
|
+
let e = x();
|
|
65
103
|
if (!e) return !1;
|
|
66
104
|
let t = e.appContext.provides;
|
|
67
|
-
for (let e of Reflect.ownKeys(t)) if (
|
|
105
|
+
for (let e of Reflect.ownKeys(t)) if (z(t[e])) return !0;
|
|
68
106
|
let n = e;
|
|
69
107
|
for (; n;) {
|
|
70
108
|
let e = n.provides;
|
|
71
109
|
if (e) {
|
|
72
|
-
for (let t of Reflect.ownKeys(e)) if (
|
|
110
|
+
for (let t of Reflect.ownKeys(e)) if (z(e[t])) return !0;
|
|
73
111
|
}
|
|
74
112
|
n = n.parent;
|
|
75
113
|
}
|
|
76
114
|
return !!e.appContext.components.RouterLink;
|
|
77
115
|
}
|
|
78
|
-
function
|
|
79
|
-
let e =
|
|
80
|
-
return !e || !
|
|
116
|
+
function V() {
|
|
117
|
+
let e = x();
|
|
118
|
+
return !e || !B() ? null : e.appContext.components.RouterLink ?? null;
|
|
81
119
|
}
|
|
82
|
-
function
|
|
120
|
+
function ge(e) {
|
|
83
121
|
return typeof e == "string" ? e : typeof e.path == "string" ? e.path : typeof e.href == "string" ? e.href : "#";
|
|
84
122
|
}
|
|
85
|
-
function
|
|
123
|
+
function _e(e) {
|
|
86
124
|
return typeof e == "string" ? /^(?:[a-z][a-z\d+\-.]*:)?\/\//i.test(e) || e.startsWith("mailto:") || e.startsWith("tel:") : !1;
|
|
87
125
|
}
|
|
88
126
|
//#endregion
|
|
89
127
|
//#region src/components/Menu/MenuCollapsedTooltip.vue
|
|
90
|
-
var
|
|
128
|
+
var H = /* @__PURE__ */ b({
|
|
91
129
|
__name: "MenuCollapsedTooltip",
|
|
92
130
|
props: {
|
|
93
131
|
label: {},
|
|
@@ -101,57 +139,57 @@ var V = /* @__PURE__ */ x({
|
|
|
101
139
|
}
|
|
102
140
|
},
|
|
103
141
|
setup(e) {
|
|
104
|
-
let t = e, n =
|
|
105
|
-
return (t, r) => n.value ? (
|
|
142
|
+
let t = e, n = m(() => t.active && !!t.label && !t.suspended);
|
|
143
|
+
return (t, r) => n.value ? (E(), h(f, {
|
|
106
144
|
key: 0,
|
|
107
145
|
content: e.label,
|
|
108
146
|
placement: "right",
|
|
109
147
|
"show-delay": 200,
|
|
110
148
|
"hide-delay": 0
|
|
111
149
|
}, {
|
|
112
|
-
default: F(() => [
|
|
150
|
+
default: F(() => [A(t.$slots, "default")]),
|
|
113
151
|
_: 3
|
|
114
|
-
}, 8, ["content"])) :
|
|
152
|
+
}, 8, ["content"])) : A(t.$slots, "default", {}, void 0, void 0, 1);
|
|
115
153
|
}
|
|
116
|
-
}),
|
|
154
|
+
}), U = {
|
|
117
155
|
key: 0,
|
|
118
156
|
class: "m-menu__separator",
|
|
119
157
|
role: "separator"
|
|
120
|
-
},
|
|
158
|
+
}, W = [
|
|
121
159
|
"tabindex",
|
|
122
160
|
"data-m-menu-key",
|
|
123
161
|
"aria-label",
|
|
124
162
|
"aria-expanded"
|
|
125
|
-
],
|
|
163
|
+
], G = {
|
|
126
164
|
key: 0,
|
|
127
165
|
class: "m-menu__icon",
|
|
128
166
|
"aria-hidden": "true"
|
|
129
|
-
},
|
|
167
|
+
}, ve = { class: "m-menu__label" }, ye = {
|
|
130
168
|
key: 1,
|
|
131
169
|
class: "m-menu__arrow",
|
|
132
170
|
"aria-hidden": "true"
|
|
133
|
-
},
|
|
171
|
+
}, be = {
|
|
134
172
|
class: "m-menu m-menu--flyout",
|
|
135
173
|
role: "menu"
|
|
136
|
-
},
|
|
174
|
+
}, xe = [
|
|
137
175
|
"tabindex",
|
|
138
176
|
"data-m-menu-key",
|
|
139
177
|
"aria-expanded",
|
|
140
178
|
"aria-disabled",
|
|
141
179
|
"onClick"
|
|
142
|
-
],
|
|
180
|
+
], K = {
|
|
143
181
|
key: 0,
|
|
144
182
|
class: "m-menu__icon",
|
|
145
183
|
"aria-hidden": "true"
|
|
146
|
-
},
|
|
184
|
+
}, Se = { class: "m-menu__label" }, q = {
|
|
147
185
|
key: 0,
|
|
148
186
|
class: "m-menu__submenu",
|
|
149
187
|
role: "group"
|
|
150
|
-
}, J = { class: "m-menu__submenu-inner" },
|
|
188
|
+
}, J = { class: "m-menu__submenu-inner" }, Ce = {
|
|
151
189
|
key: 0,
|
|
152
190
|
class: "m-menu__icon",
|
|
153
191
|
"aria-hidden": "true"
|
|
154
|
-
},
|
|
192
|
+
}, we = { class: "m-menu__label" }, Y = /* @__PURE__ */ b({
|
|
155
193
|
__name: "MenuNodes",
|
|
156
194
|
props: {
|
|
157
195
|
items: {},
|
|
@@ -160,9 +198,9 @@ var V = /* @__PURE__ */ x({
|
|
|
160
198
|
flyout: { type: Boolean }
|
|
161
199
|
},
|
|
162
200
|
setup(e) {
|
|
163
|
-
let n = e, r =
|
|
201
|
+
let n = e, r = ie(he);
|
|
164
202
|
if (!r) throw Error("MenuNodes must be used inside MMenu");
|
|
165
|
-
let i = r, a =
|
|
203
|
+
let i = r, a = V(), o = m(() => i.collapsed.value && !n.flyout), s = m(() => i.mode === "horizontal"), c = m(() => (o.value || s.value) && !n.flyout);
|
|
166
204
|
function l(e, t) {
|
|
167
205
|
i.setFlyoutOpen(e, t);
|
|
168
206
|
}
|
|
@@ -182,10 +220,10 @@ var V = /* @__PURE__ */ x({
|
|
|
182
220
|
function ne(e, t) {
|
|
183
221
|
e.disabled || c.value || i.toggleExpand(u(e, t));
|
|
184
222
|
}
|
|
185
|
-
function
|
|
223
|
+
function b(e, t) {
|
|
186
224
|
return i.isExpanded(u(e, t));
|
|
187
225
|
}
|
|
188
|
-
function
|
|
226
|
+
function x(e, t) {
|
|
189
227
|
let r = f(e);
|
|
190
228
|
return {
|
|
191
229
|
"m-menu__item-content--selected": i.isSelected(e, t, n.prefix),
|
|
@@ -196,76 +234,76 @@ var V = /* @__PURE__ */ x({
|
|
|
196
234
|
"m-menu__item-content--active": i.activeKey.value === u(e, t)
|
|
197
235
|
};
|
|
198
236
|
}
|
|
199
|
-
function
|
|
237
|
+
function S(e, t) {
|
|
200
238
|
return n.flyout ? 0 : i.tabindexForKey(u(e, t));
|
|
201
239
|
}
|
|
202
|
-
function
|
|
240
|
+
function C(e) {
|
|
203
241
|
if (!(s.value || n.flyout)) return i.paddingStyle(e);
|
|
204
242
|
}
|
|
205
|
-
function
|
|
206
|
-
return
|
|
243
|
+
function ae(e, t) {
|
|
244
|
+
return b(e, t);
|
|
207
245
|
}
|
|
208
|
-
function
|
|
209
|
-
return !!(e.to && a && !
|
|
246
|
+
function D(e) {
|
|
247
|
+
return !!(e.to && a && !_e(e.to));
|
|
210
248
|
}
|
|
211
|
-
function
|
|
212
|
-
if (!(!e.to ||
|
|
249
|
+
function oe(e) {
|
|
250
|
+
if (!(!e.to || D(e))) return ge(e.to);
|
|
213
251
|
}
|
|
214
|
-
function
|
|
215
|
-
if (!(!
|
|
252
|
+
function O(e) {
|
|
253
|
+
if (!(!D(e) || !e.to)) return e.to;
|
|
216
254
|
}
|
|
217
|
-
function
|
|
255
|
+
function A(e) {
|
|
218
256
|
return o.value && !!e.label;
|
|
219
257
|
}
|
|
220
|
-
function
|
|
258
|
+
function se(e, t) {
|
|
221
259
|
return !!i.flyoutOpen[u(e, t)];
|
|
222
260
|
}
|
|
223
|
-
return (n, r) => (
|
|
261
|
+
return (n, r) => (E(!0), _(p, null, k(e.items, (n, r) => (E(), _(p, { key: u(n, r) }, [n.separator ? (E(), _("div", U)) : n.items?.length ? (E(), _("div", {
|
|
224
262
|
key: 1,
|
|
225
|
-
class:
|
|
263
|
+
class: w(["m-menu__item m-menu__item--submenu", { "m-menu__item--horizontal": s.value }]),
|
|
226
264
|
role: "none"
|
|
227
|
-
}, [c.value ? (
|
|
265
|
+
}, [c.value ? (E(), h(d, {
|
|
228
266
|
key: 0,
|
|
229
267
|
class: "m-menu__collapsed-popover",
|
|
230
|
-
"model-value": !!
|
|
268
|
+
"model-value": !!N(i).flyoutOpen[u(n, r)],
|
|
231
269
|
trigger: s.value ? "click" : "hover",
|
|
232
270
|
placement: s.value ? "bottom-start" : "right-start",
|
|
233
271
|
"show-delay": s.value ? 0 : 50,
|
|
234
272
|
"hide-delay": s.value ? 0 : 80,
|
|
235
273
|
"onUpdate:modelValue": (e) => l(u(n, r), e)
|
|
236
274
|
}, {
|
|
237
|
-
default: F(() => [
|
|
275
|
+
default: F(() => [y(H, {
|
|
238
276
|
label: n.label,
|
|
239
|
-
active:
|
|
240
|
-
suspended:
|
|
277
|
+
active: A(n),
|
|
278
|
+
suspended: se(n, r)
|
|
241
279
|
}, {
|
|
242
|
-
default: F(() => [
|
|
243
|
-
class:
|
|
244
|
-
style:
|
|
280
|
+
default: F(() => [v("div", {
|
|
281
|
+
class: w(["m-menu__item-content", x(n, r)]),
|
|
282
|
+
style: T(C(e.depth)),
|
|
245
283
|
role: "menuitem",
|
|
246
|
-
tabindex:
|
|
284
|
+
tabindex: S(n, r),
|
|
247
285
|
"data-m-menu-key": e.flyout ? void 0 : u(n, r),
|
|
248
286
|
"aria-label": n.label,
|
|
249
287
|
"aria-haspopup": "menu",
|
|
250
|
-
"aria-expanded": s.value ? !!
|
|
288
|
+
"aria-expanded": s.value ? !!N(i).flyoutOpen[u(n, r)] : void 0
|
|
251
289
|
}, [
|
|
252
|
-
f(n) ? (
|
|
290
|
+
f(n) ? (E(), _("span", G, [y(t, {
|
|
253
291
|
name: f(n),
|
|
254
292
|
size: "sm"
|
|
255
|
-
}, null, 8, ["name"])])) :
|
|
256
|
-
|
|
257
|
-
s.value ? (
|
|
293
|
+
}, null, 8, ["name"])])) : g("", !0),
|
|
294
|
+
v("span", ve, M(n.label), 1),
|
|
295
|
+
s.value ? (E(), _("span", ye, [y(t, {
|
|
258
296
|
name: "chevron-down",
|
|
259
297
|
size: "sm"
|
|
260
|
-
})])) :
|
|
261
|
-
], 14,
|
|
298
|
+
})])) : g("", !0)
|
|
299
|
+
], 14, W)]),
|
|
262
300
|
_: 2
|
|
263
301
|
}, 1032, [
|
|
264
302
|
"label",
|
|
265
303
|
"active",
|
|
266
304
|
"suspended"
|
|
267
305
|
])]),
|
|
268
|
-
content: F(() => [
|
|
306
|
+
content: F(() => [v("div", be, [y(Y, {
|
|
269
307
|
items: n.items,
|
|
270
308
|
depth: 0,
|
|
271
309
|
prefix: `${e.prefix}-${r}`,
|
|
@@ -279,31 +317,31 @@ var V = /* @__PURE__ */ x({
|
|
|
279
317
|
"show-delay",
|
|
280
318
|
"hide-delay",
|
|
281
319
|
"onUpdate:modelValue"
|
|
282
|
-
])) : (
|
|
283
|
-
class:
|
|
284
|
-
style:
|
|
320
|
+
])) : (E(), _(p, { key: 1 }, [v("div", {
|
|
321
|
+
class: w(["m-menu__item-content", x(n, r)]),
|
|
322
|
+
style: T(C(e.depth)),
|
|
285
323
|
role: "menuitem",
|
|
286
|
-
tabindex:
|
|
324
|
+
tabindex: S(n, r),
|
|
287
325
|
"data-m-menu-key": e.flyout ? void 0 : u(n, r),
|
|
288
326
|
"aria-haspopup": "menu",
|
|
289
|
-
"aria-expanded":
|
|
327
|
+
"aria-expanded": b(n, r),
|
|
290
328
|
"aria-disabled": n.disabled || void 0,
|
|
291
329
|
onClick: (e) => ne(n, r)
|
|
292
330
|
}, [
|
|
293
|
-
f(n) ? (
|
|
331
|
+
f(n) ? (E(), _("span", K, [y(t, {
|
|
294
332
|
name: f(n),
|
|
295
333
|
size: "sm"
|
|
296
|
-
}, null, 8, ["name"])])) :
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
class:
|
|
334
|
+
}, null, 8, ["name"])])) : g("", !0),
|
|
335
|
+
v("span", Se, M(n.label), 1),
|
|
336
|
+
v("span", {
|
|
337
|
+
class: w(["m-menu__arrow", { "m-menu__arrow--expanded": ae(n, r) }]),
|
|
300
338
|
"aria-hidden": "true"
|
|
301
|
-
}, [
|
|
339
|
+
}, [y(t, {
|
|
302
340
|
name: "chevron-right",
|
|
303
341
|
size: "sm"
|
|
304
342
|
})], 2)
|
|
305
|
-
], 14,
|
|
306
|
-
default: F(() => [
|
|
343
|
+
], 14, xe), y(re, { name: "m-menu-expand" }, {
|
|
344
|
+
default: F(() => [b(n, r) ? (E(), _("div", q, [v("div", J, [y(Y, {
|
|
307
345
|
items: n.items,
|
|
308
346
|
depth: e.depth + 1,
|
|
309
347
|
prefix: `${e.prefix}-${r}`
|
|
@@ -311,32 +349,32 @@ var V = /* @__PURE__ */ x({
|
|
|
311
349
|
"items",
|
|
312
350
|
"depth",
|
|
313
351
|
"prefix"
|
|
314
|
-
])])])) :
|
|
352
|
+
])])])) : g("", !0)]),
|
|
315
353
|
_: 2
|
|
316
|
-
}, 1024)], 64))], 2)) : (
|
|
354
|
+
}, 1024)], 64))], 2)) : (E(), _("div", {
|
|
317
355
|
key: 2,
|
|
318
|
-
class:
|
|
356
|
+
class: w(["m-menu__item", { "m-menu__item--horizontal": s.value }]),
|
|
319
357
|
role: "none"
|
|
320
|
-
}, [
|
|
358
|
+
}, [y(H, {
|
|
321
359
|
label: n.label,
|
|
322
|
-
active:
|
|
360
|
+
active: A(n)
|
|
323
361
|
}, {
|
|
324
|
-
default: F(() => [(
|
|
325
|
-
class:
|
|
326
|
-
style:
|
|
362
|
+
default: F(() => [(E(), h(j(D(n) ? N(a) : oe(n) ? "a" : "div"), {
|
|
363
|
+
class: w(["m-menu__item-content", x(n, r)]),
|
|
364
|
+
style: T(C(e.depth)),
|
|
327
365
|
role: "menuitem",
|
|
328
|
-
tabindex:
|
|
366
|
+
tabindex: S(n, r),
|
|
329
367
|
"data-m-menu-key": e.flyout ? void 0 : u(n, r),
|
|
330
368
|
"aria-disabled": n.disabled || void 0,
|
|
331
|
-
"aria-current":
|
|
332
|
-
href:
|
|
333
|
-
to:
|
|
369
|
+
"aria-current": N(i).isSelected(n, r, e.prefix) ? "page" : void 0,
|
|
370
|
+
href: oe(n),
|
|
371
|
+
to: O(n),
|
|
334
372
|
onClick: (e) => te(n, e)
|
|
335
373
|
}, {
|
|
336
|
-
default: F(() => [f(n) ? (
|
|
374
|
+
default: F(() => [f(n) ? (E(), _("span", Ce, [y(t, {
|
|
337
375
|
name: f(n),
|
|
338
376
|
size: "sm"
|
|
339
|
-
}, null, 8, ["name"])])) :
|
|
377
|
+
}, null, 8, ["name"])])) : g("", !0), v("span", we, M(n.label), 1)]),
|
|
340
378
|
_: 2
|
|
341
379
|
}, 1032, [
|
|
342
380
|
"class",
|
|
@@ -352,7 +390,7 @@ var V = /* @__PURE__ */ x({
|
|
|
352
390
|
_: 2
|
|
353
391
|
}, 1032, ["label", "active"])], 2))], 64))), 128));
|
|
354
392
|
}
|
|
355
|
-
}),
|
|
393
|
+
}), Te = /* @__PURE__ */ b({
|
|
356
394
|
inheritAttrs: !1,
|
|
357
395
|
__name: "Menu",
|
|
358
396
|
props: {
|
|
@@ -411,20 +449,20 @@ var V = /* @__PURE__ */ x({
|
|
|
411
449
|
"select"
|
|
412
450
|
],
|
|
413
451
|
setup(t, { emit: ee }) {
|
|
414
|
-
let l = t, d = ee, f =
|
|
452
|
+
let l = t, d = ee, f = se(), { rootAttrs: p } = e(f, () => l.pt), b = ce(), x = te(), { transitionName: ie, transitionCss: k } = n({
|
|
415
453
|
role: "popup",
|
|
416
454
|
local: () => l.transition,
|
|
417
455
|
componentName: "Menu",
|
|
418
456
|
fallback: "scale-fade"
|
|
419
|
-
}),
|
|
457
|
+
}), j = O(null), M = O(null), R = O({}), z = m(() => !!b.default?.()?.length), B = m(() => r(l.popup ? l : { teleport: !1 }, x.value.appendTo)), V = m(() => l.popup && i(l, x.value.appendTo)), ge = m(() => l.embedded ?? !l.popup), _e = m(() => l.selectedKey), H = O([]), U = oe({});
|
|
420
458
|
function W(e, t) {
|
|
421
459
|
U[e] = t;
|
|
422
460
|
}
|
|
423
461
|
function G() {
|
|
424
462
|
for (let e of Object.keys(U)) U[e] = !1;
|
|
425
463
|
}
|
|
426
|
-
function
|
|
427
|
-
let e =
|
|
464
|
+
function ve() {
|
|
465
|
+
let e = M.value?.getBoundingClientRect();
|
|
428
466
|
if (e && (e.width > 0 || e.height > 0)) return e;
|
|
429
467
|
let { x: t, y: n } = u();
|
|
430
468
|
return {
|
|
@@ -436,159 +474,131 @@ var V = /* @__PURE__ */ x({
|
|
|
436
474
|
height: 0
|
|
437
475
|
};
|
|
438
476
|
}
|
|
439
|
-
function
|
|
440
|
-
!l.popup || !l.modelValue || !
|
|
477
|
+
function ye() {
|
|
478
|
+
!l.popup || !l.modelValue || !V.value || (R.value = a(ve(), l.placement, { minWidth: "10rem" }));
|
|
441
479
|
}
|
|
442
|
-
function
|
|
443
|
-
l.modelValue &&
|
|
480
|
+
function be() {
|
|
481
|
+
l.modelValue && ye();
|
|
444
482
|
}
|
|
445
|
-
function
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
H.value = [...l.defaultExpandedKeys];
|
|
452
|
-
return;
|
|
453
|
-
}
|
|
454
|
-
if (l.selectedKey) {
|
|
455
|
-
let e = L(l.model, l.selectedKey);
|
|
456
|
-
H.value = e ?? [];
|
|
457
|
-
return;
|
|
458
|
-
}
|
|
459
|
-
H.value = [];
|
|
483
|
+
function xe() {
|
|
484
|
+
H.value = de(l.model, {
|
|
485
|
+
defaultExpandAll: l.defaultExpandAll,
|
|
486
|
+
defaultExpandedKeys: l.defaultExpandedKeys,
|
|
487
|
+
selectedKey: l.selectedKey
|
|
488
|
+
});
|
|
460
489
|
}
|
|
461
|
-
|
|
462
|
-
let K =
|
|
490
|
+
xe();
|
|
491
|
+
let K = m({
|
|
463
492
|
get: () => l.expandedKeys ?? H.value,
|
|
464
493
|
set: (e) => {
|
|
465
494
|
H.value = e, d("update:expandedKeys", e);
|
|
466
495
|
}
|
|
467
|
-
}),
|
|
468
|
-
function
|
|
496
|
+
}), Se = m(() => ue(l.model));
|
|
497
|
+
function q(e) {
|
|
469
498
|
return K.value.includes(e);
|
|
470
499
|
}
|
|
471
|
-
function
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
for (let n of [...t]) if (q.value.includes(n) && n !== e) {
|
|
477
|
-
let e = t.indexOf(n);
|
|
478
|
-
e >= 0 && t.splice(e, 1);
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
t.push(e);
|
|
482
|
-
}
|
|
483
|
-
K.value = t;
|
|
500
|
+
function J(e) {
|
|
501
|
+
K.value = fe(K.value, e, {
|
|
502
|
+
accordion: l.accordion,
|
|
503
|
+
topLevelKeys: Se.value
|
|
504
|
+
});
|
|
484
505
|
}
|
|
485
|
-
function
|
|
506
|
+
function Ce(e) {
|
|
486
507
|
if (!e) return;
|
|
487
508
|
let t = L(l.model, e);
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
509
|
+
t?.length && (K.value = pe(K.value, t, {
|
|
510
|
+
accordion: l.accordion,
|
|
511
|
+
topLevelKeys: Se.value
|
|
512
|
+
}));
|
|
492
513
|
}
|
|
493
|
-
|
|
494
|
-
function
|
|
514
|
+
P(() => l.selectedKey, Ce);
|
|
515
|
+
function we(e, t, n) {
|
|
495
516
|
return I(e, t, n);
|
|
496
517
|
}
|
|
497
|
-
function
|
|
498
|
-
let r =
|
|
518
|
+
function Te(e, t, n) {
|
|
519
|
+
let r = we(e, t, n);
|
|
499
520
|
return !!(l.selectedKey && r === l.selectedKey);
|
|
500
521
|
}
|
|
501
|
-
function
|
|
522
|
+
function Ee(e, t, n) {
|
|
502
523
|
return l.selectedKey ? le(e, l.selectedKey, t, n) : !1;
|
|
503
524
|
}
|
|
504
|
-
function
|
|
525
|
+
function De(e) {
|
|
505
526
|
if (l.mode !== "horizontal" && l.collapsed) return Math.max(0, l.collapsedWidth / 2 - 10);
|
|
506
527
|
}
|
|
507
|
-
function
|
|
528
|
+
function Oe(e) {
|
|
508
529
|
if (l.mode === "horizontal") return { paddingInlineStart: `${l.rootIndent}px` };
|
|
509
530
|
if (l.collapsed) {
|
|
510
|
-
let t =
|
|
531
|
+
let t = De(e);
|
|
511
532
|
return t == null ? void 0 : { paddingInlineStart: `${t}px` };
|
|
512
533
|
}
|
|
513
534
|
return { paddingInlineStart: `calc(var(--m-menu-root-indent) + ${e} * var(--m-menu-indent))` };
|
|
514
535
|
}
|
|
515
|
-
function
|
|
536
|
+
function ke(e) {
|
|
516
537
|
if (e.disabled || e.separator) return;
|
|
517
538
|
e.command?.();
|
|
518
539
|
let t = e.key ?? e.label ?? null;
|
|
519
|
-
d("update:selectedKey", t), d("select", e), l.popup && (d("update:modelValue", !1),
|
|
520
|
-
}
|
|
521
|
-
function
|
|
522
|
-
(
|
|
523
|
-
}
|
|
524
|
-
let
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
item: r,
|
|
531
|
-
key: s,
|
|
532
|
-
parentKey: a,
|
|
533
|
-
hasChildren: c
|
|
534
|
-
}), c && !e && J(s) && n(r.items, `${i}-${o}`, s);
|
|
535
|
-
});
|
|
536
|
-
};
|
|
537
|
-
return n(l.model, "item", null), t;
|
|
538
|
-
}), Q = s({
|
|
539
|
-
itemCount: () => Z.value.length,
|
|
540
|
-
isItemDisabled: (e) => !!Z.value[e]?.item.disabled,
|
|
540
|
+
d("update:selectedKey", t), d("select", e), l.popup && (d("update:modelValue", !1), Ae()), l.mode === "horizontal" && G();
|
|
541
|
+
}
|
|
542
|
+
function Ae() {
|
|
543
|
+
(M.value?.querySelector("button, [tabindex]") ?? M.value)?.focus({ preventScroll: !0 });
|
|
544
|
+
}
|
|
545
|
+
let X = m(() => me(l.model, {
|
|
546
|
+
isExpanded: q,
|
|
547
|
+
excludeChildren: l.collapsed || l.mode === "horizontal"
|
|
548
|
+
})), Z = s({
|
|
549
|
+
itemCount: () => X.value.length,
|
|
550
|
+
isItemDisabled: (e) => !!X.value[e]?.item.disabled,
|
|
541
551
|
orientation: () => l.mode === "horizontal" ? "horizontal" : "vertical",
|
|
542
552
|
onActivate: (e) => {
|
|
543
|
-
let t =
|
|
553
|
+
let t = X.value[e];
|
|
544
554
|
if (t) {
|
|
545
555
|
if (t.hasChildren) {
|
|
546
556
|
if (l.collapsed || l.mode === "horizontal") {
|
|
547
557
|
let e = !U[t.key];
|
|
548
558
|
G(), W(t.key, e);
|
|
549
|
-
} else
|
|
559
|
+
} else J(t.key);
|
|
550
560
|
return;
|
|
551
561
|
}
|
|
552
|
-
|
|
562
|
+
ke(t.item);
|
|
553
563
|
}
|
|
554
564
|
},
|
|
555
565
|
onEscape: () => {
|
|
556
566
|
l.popup ? d("update:modelValue", !1) : G();
|
|
557
567
|
},
|
|
558
|
-
returnFocusTo: () => l.popup ?
|
|
559
|
-
}),
|
|
560
|
-
function
|
|
561
|
-
let t =
|
|
562
|
-
return t == null ?
|
|
563
|
-
}
|
|
564
|
-
function
|
|
565
|
-
if (e == null || !
|
|
566
|
-
let t =
|
|
568
|
+
returnFocusTo: () => l.popup ? M.value?.querySelector("button, [tabindex]") ?? M.value : null
|
|
569
|
+
}), je = m(() => X.value[Z.activeIndex.value]?.key ?? null);
|
|
570
|
+
function Me(e) {
|
|
571
|
+
let t = je.value;
|
|
572
|
+
return t == null ? X.value.find((e) => !e.item.disabled)?.key === e ? 0 : -1 : e === t ? 0 : -1;
|
|
573
|
+
}
|
|
574
|
+
function Ne(e) {
|
|
575
|
+
if (e == null || !j.value) return;
|
|
576
|
+
let t = j.value.querySelectorAll("[data-m-menu-key]");
|
|
567
577
|
for (let n of t) if (n.dataset.mMenuKey === e) {
|
|
568
578
|
n.focus({ preventScroll: !0 });
|
|
569
579
|
return;
|
|
570
580
|
}
|
|
571
581
|
}
|
|
572
|
-
function
|
|
573
|
-
let t =
|
|
582
|
+
function Pe(e) {
|
|
583
|
+
let t = X.value[Z.activeIndex.value];
|
|
574
584
|
if (l.mode !== "horizontal") {
|
|
575
585
|
if (e.key === "ArrowRight") {
|
|
576
586
|
if (e.preventDefault(), !t) return;
|
|
577
587
|
if (t.hasChildren && !l.collapsed) {
|
|
578
|
-
if (!
|
|
588
|
+
if (!q(t.key)) J(t.key);
|
|
579
589
|
else {
|
|
580
|
-
let e =
|
|
581
|
-
e >= 0 &&
|
|
590
|
+
let e = X.value.findIndex((e) => e.parentKey === t.key);
|
|
591
|
+
e >= 0 && Z.setActive(e);
|
|
582
592
|
}
|
|
583
593
|
}
|
|
584
594
|
return;
|
|
585
595
|
}
|
|
586
596
|
if (e.key === "ArrowLeft") {
|
|
587
597
|
if (e.preventDefault(), !t) return;
|
|
588
|
-
if (t.hasChildren && !l.collapsed &&
|
|
598
|
+
if (t.hasChildren && !l.collapsed && q(t.key)) J(t.key);
|
|
589
599
|
else if (t.parentKey != null) {
|
|
590
|
-
let e =
|
|
591
|
-
e >= 0 &&
|
|
600
|
+
let e = X.value.findIndex((e) => e.key === t.parentKey);
|
|
601
|
+
e >= 0 && Z.setActive(e);
|
|
592
602
|
}
|
|
593
603
|
return;
|
|
594
604
|
}
|
|
@@ -596,13 +606,13 @@ var V = /* @__PURE__ */ x({
|
|
|
596
606
|
e.preventDefault(), t?.hasChildren && (G(), W(t.key, !0));
|
|
597
607
|
return;
|
|
598
608
|
}
|
|
599
|
-
|
|
609
|
+
Z.onKeydown(e);
|
|
600
610
|
}
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
}),
|
|
604
|
-
collapsed:
|
|
605
|
-
selectedKey:
|
|
611
|
+
P(Z.activeIndex, () => {
|
|
612
|
+
C(() => Ne(je.value));
|
|
613
|
+
}), D(he, {
|
|
614
|
+
collapsed: m(() => l.collapsed),
|
|
615
|
+
selectedKey: _e,
|
|
606
616
|
expandedKeys: K,
|
|
607
617
|
accordion: l.accordion,
|
|
608
618
|
indent: l.indent,
|
|
@@ -611,117 +621,117 @@ var V = /* @__PURE__ */ x({
|
|
|
611
621
|
inverted: l.inverted,
|
|
612
622
|
flyoutOpen: U,
|
|
613
623
|
setFlyoutOpen: W,
|
|
614
|
-
toggleExpand:
|
|
615
|
-
isExpanded:
|
|
616
|
-
activate:
|
|
617
|
-
resolveKey:
|
|
618
|
-
isSelected:
|
|
619
|
-
isChildActive:
|
|
620
|
-
paddingStyle:
|
|
621
|
-
activeKey:
|
|
622
|
-
tabindexForKey:
|
|
624
|
+
toggleExpand: J,
|
|
625
|
+
isExpanded: q,
|
|
626
|
+
activate: ke,
|
|
627
|
+
resolveKey: we,
|
|
628
|
+
isSelected: Te,
|
|
629
|
+
isChildActive: Ee,
|
|
630
|
+
paddingStyle: Oe,
|
|
631
|
+
activeKey: je,
|
|
632
|
+
tabindexForKey: Me
|
|
623
633
|
});
|
|
624
|
-
function
|
|
634
|
+
function Fe(e) {
|
|
625
635
|
if (!l.popup || !l.modelValue) return;
|
|
626
636
|
let t = e.target;
|
|
627
|
-
|
|
637
|
+
j.value?.contains(t) || M.value?.contains(t) || d("update:modelValue", !1);
|
|
628
638
|
}
|
|
629
|
-
|
|
630
|
-
l.popup && (e ? (
|
|
631
|
-
}, { immediate: !0 }), o(() => !!(l.popup && l.modelValue &&
|
|
632
|
-
document.removeEventListener("click",
|
|
639
|
+
P(() => l.modelValue, (e) => {
|
|
640
|
+
l.popup && (e ? (C(ye), document.addEventListener("click", Fe)) : document.removeEventListener("click", Fe));
|
|
641
|
+
}, { immediate: !0 }), o(() => !!(l.popup && l.modelValue && V.value), be), ae(() => {
|
|
642
|
+
document.removeEventListener("click", Fe);
|
|
633
643
|
});
|
|
634
|
-
let
|
|
644
|
+
let Q = m(() => ["m-menu", {
|
|
635
645
|
"m-menu--popup": l.popup,
|
|
636
|
-
"m-menu--teleported":
|
|
646
|
+
"m-menu--teleported": V.value,
|
|
637
647
|
"m-menu--collapsed": l.collapsed,
|
|
638
|
-
"m-menu--embedded":
|
|
648
|
+
"m-menu--embedded": ge.value,
|
|
639
649
|
"m-menu--horizontal": l.mode === "horizontal",
|
|
640
650
|
"m-menu--inverted": l.inverted
|
|
641
|
-
}]), $ =
|
|
651
|
+
}]), $ = m(() => ({
|
|
642
652
|
"--m-menu-indent": `${l.indent / 16}rem`,
|
|
643
653
|
"--m-menu-root-indent": `${l.rootIndent / 16}rem`
|
|
644
|
-
})),
|
|
654
|
+
})), Ie = m(() => V.value ? {
|
|
645
655
|
...$.value,
|
|
646
656
|
...R.value
|
|
647
657
|
} : $.value);
|
|
648
|
-
return (e, n) => t.popup ?
|
|
658
|
+
return (e, n) => t.popup ? z.value ? (E(), _("div", S({ key: 1 }, N(p), { class: "m-menu-popup" }), [v("div", {
|
|
649
659
|
ref_key: "triggerEl",
|
|
650
|
-
ref:
|
|
660
|
+
ref: M,
|
|
651
661
|
class: "m-menu-popup__anchor"
|
|
652
|
-
}, [
|
|
653
|
-
to:
|
|
654
|
-
disabled:
|
|
655
|
-
}, [
|
|
656
|
-
name:
|
|
657
|
-
css:
|
|
662
|
+
}, [A(e.$slots, "default")], 512), (E(), h(ne, {
|
|
663
|
+
to: B.value.to,
|
|
664
|
+
disabled: B.value.disabled
|
|
665
|
+
}, [y(re, {
|
|
666
|
+
name: N(ie),
|
|
667
|
+
css: N(k)
|
|
658
668
|
}, {
|
|
659
|
-
default: F(() => [t.modelValue ? (
|
|
669
|
+
default: F(() => [t.modelValue ? (E(), _("div", {
|
|
660
670
|
key: 0,
|
|
661
671
|
ref_key: "root",
|
|
662
|
-
ref:
|
|
663
|
-
class:
|
|
664
|
-
style:
|
|
672
|
+
ref: j,
|
|
673
|
+
class: w(Q.value),
|
|
674
|
+
style: T(V.value ? Ie.value : $.value),
|
|
665
675
|
role: "menu",
|
|
666
|
-
onKeydown:
|
|
667
|
-
}, [
|
|
676
|
+
onKeydown: Pe
|
|
677
|
+
}, [y(c, {
|
|
668
678
|
class: "m-menu__scroll",
|
|
669
679
|
"fit-content": "",
|
|
670
680
|
"wrap-class": "m-menu__scroll-wrap",
|
|
671
681
|
"view-class": "m-menu__scroll-view"
|
|
672
682
|
}, {
|
|
673
|
-
default: F(() => [
|
|
683
|
+
default: F(() => [y(Y, {
|
|
674
684
|
items: t.model,
|
|
675
685
|
depth: 0,
|
|
676
686
|
prefix: "item"
|
|
677
687
|
}, null, 8, ["items"])]),
|
|
678
688
|
_: 1
|
|
679
|
-
})], 38)) :
|
|
689
|
+
})], 38)) : g("", !0)]),
|
|
680
690
|
_: 1
|
|
681
|
-
}, 8, ["name", "css"])], 8, ["to", "disabled"]))], 16)) : (
|
|
691
|
+
}, 8, ["name", "css"])], 8, ["to", "disabled"]))], 16)) : (E(), h(ne, {
|
|
682
692
|
key: 2,
|
|
683
|
-
to:
|
|
684
|
-
disabled:
|
|
685
|
-
}, [
|
|
686
|
-
name:
|
|
687
|
-
css:
|
|
693
|
+
to: B.value.to,
|
|
694
|
+
disabled: B.value.disabled
|
|
695
|
+
}, [y(re, {
|
|
696
|
+
name: N(ie),
|
|
697
|
+
css: N(k)
|
|
688
698
|
}, {
|
|
689
|
-
default: F(() => [t.modelValue ? (
|
|
699
|
+
default: F(() => [t.modelValue ? (E(), _("div", S({
|
|
690
700
|
key: 0,
|
|
691
701
|
ref_key: "root",
|
|
692
|
-
ref:
|
|
693
|
-
},
|
|
694
|
-
class:
|
|
695
|
-
style:
|
|
702
|
+
ref: j
|
|
703
|
+
}, N(p), {
|
|
704
|
+
class: Q.value,
|
|
705
|
+
style: V.value ? {
|
|
696
706
|
...$.value,
|
|
697
707
|
...R.value
|
|
698
708
|
} : $.value,
|
|
699
709
|
role: "menu",
|
|
700
|
-
onKeydown:
|
|
701
|
-
}), [
|
|
710
|
+
onKeydown: Pe
|
|
711
|
+
}), [y(c, {
|
|
702
712
|
class: "m-menu__scroll",
|
|
703
713
|
"fit-content": "",
|
|
704
714
|
"wrap-class": "m-menu__scroll-wrap",
|
|
705
715
|
"view-class": "m-menu__scroll-view"
|
|
706
716
|
}, {
|
|
707
|
-
default: F(() => [
|
|
717
|
+
default: F(() => [y(Y, {
|
|
708
718
|
items: t.model,
|
|
709
719
|
depth: 0,
|
|
710
720
|
prefix: "item"
|
|
711
721
|
}, null, 8, ["items"])]),
|
|
712
722
|
_: 1
|
|
713
|
-
})], 16)) :
|
|
723
|
+
})], 16)) : g("", !0)]),
|
|
714
724
|
_: 1
|
|
715
|
-
}, 8, ["name", "css"])], 8, ["to", "disabled"])) : (
|
|
725
|
+
}, 8, ["name", "css"])], 8, ["to", "disabled"])) : (E(), _("div", S({
|
|
716
726
|
key: 0,
|
|
717
727
|
ref_key: "root",
|
|
718
|
-
ref:
|
|
719
|
-
},
|
|
720
|
-
class:
|
|
728
|
+
ref: j
|
|
729
|
+
}, N(p), {
|
|
730
|
+
class: Q.value,
|
|
721
731
|
style: $.value,
|
|
722
732
|
role: "menu",
|
|
723
|
-
onKeydown:
|
|
724
|
-
}), [
|
|
733
|
+
onKeydown: Pe
|
|
734
|
+
}), [y(Y, {
|
|
725
735
|
items: t.model,
|
|
726
736
|
depth: 0,
|
|
727
737
|
prefix: "item"
|
|
@@ -729,4 +739,4 @@ var V = /* @__PURE__ */ x({
|
|
|
729
739
|
}
|
|
730
740
|
});
|
|
731
741
|
//#endregion
|
|
732
|
-
export {
|
|
742
|
+
export { Te as MMenu };
|