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.
Files changed (309) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/dist/Button-dMqRmoYa.js +222 -0
  3. package/dist/{Card-Dsmnzong.js → Card-B1CB9Trm.js} +3 -5
  4. package/dist/Empty-C5tndBOm.js +147 -0
  5. package/dist/Icon-od9Ob-Ay.js +393 -0
  6. package/dist/Loading-BSsRs6v9.js +420 -0
  7. package/dist/Pagination-CqpC5EAs.js +166 -0
  8. package/dist/Select-CKGrSoaC.js +572 -0
  9. package/dist/Skeleton-DCYdXAH2.js +59 -0
  10. package/dist/accordion/style.css +20 -71
  11. package/dist/auto-complete/index.js +118 -120
  12. package/dist/auto-complete/style.css +24 -88
  13. package/dist/avatar/index.js +1 -1
  14. package/dist/avatar/style.css +10 -67
  15. package/dist/badge/style.css +10 -68
  16. package/dist/block-ui/style.css +10 -68
  17. package/dist/breadcrumb/style.css +10 -61
  18. package/dist/button/index.js +1 -1
  19. package/dist/button/style.css +72 -78
  20. package/dist/card/index.js +1 -1
  21. package/dist/card/style.css +30 -67
  22. package/dist/carousel/index.js +72 -64
  23. package/dist/carousel/style.css +36 -82
  24. package/dist/cascade-select/index.js +1 -1
  25. package/dist/cascade-select/style.css +24 -81
  26. package/dist/checkbox/style.css +10 -61
  27. package/dist/chip/index.js +1 -1
  28. package/dist/chip/style.css +10 -67
  29. package/dist/command-menu/index.js +37 -39
  30. package/dist/command-menu/style.css +10 -75
  31. package/dist/components/Accordion/styles.css +10 -10
  32. package/dist/components/AutoComplete/AutoComplete.vue.d.ts.map +1 -1
  33. package/dist/components/AutoComplete/styles.css +0 -7
  34. package/dist/components/Badge/styles.css +0 -7
  35. package/dist/components/BlockUI/styles.css +0 -7
  36. package/dist/components/Button/Button.vue.d.ts +2 -0
  37. package/dist/components/Button/Button.vue.d.ts.map +1 -1
  38. package/dist/components/Button/styles.css +62 -11
  39. package/dist/components/Button/types.d.ts +4 -0
  40. package/dist/components/Button/types.d.ts.map +1 -1
  41. package/dist/components/Card/Card.vue.d.ts +2 -2
  42. package/dist/components/Card/Card.vue.d.ts.map +1 -1
  43. package/dist/components/Card/index.d.ts +1 -1
  44. package/dist/components/Card/index.d.ts.map +1 -1
  45. package/dist/components/Card/styles.css +20 -6
  46. package/dist/components/Card/types.d.ts +4 -2
  47. package/dist/components/Card/types.d.ts.map +1 -1
  48. package/dist/components/Carousel/Carousel.vue.d.ts.map +1 -1
  49. package/dist/components/Carousel/styles.css +26 -15
  50. package/dist/components/CommandMenu/CommandMenu.vue.d.ts.map +1 -1
  51. package/dist/components/ConfigProvider/ConfigProvider.vue.d.ts +2 -2
  52. package/dist/components/DataView/DataView.vue.d.ts +7 -7
  53. package/dist/components/DataView/DataView.vue.d.ts.map +1 -1
  54. package/dist/components/DataView/styles.css +0 -20
  55. package/dist/components/Dialog/styles.css +3 -46
  56. package/dist/components/Dock/styles.css +0 -10
  57. package/dist/components/Drawer/styles.css +2 -51
  58. package/dist/components/Dropdown/Dropdown.vue.d.ts +2 -2
  59. package/dist/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
  60. package/dist/components/Dropdown/DropdownNodes.vue.d.ts +8 -9
  61. package/dist/components/Dropdown/DropdownNodes.vue.d.ts.map +1 -1
  62. package/dist/components/Dropdown/styles.css +24 -5
  63. package/dist/components/Fieldset/styles.css +0 -7
  64. package/dist/components/FileUpload/FileUpload.vue.d.ts.map +1 -1
  65. package/dist/components/FileUpload/fileUtils.d.ts +8 -0
  66. package/dist/components/FileUpload/fileUtils.d.ts.map +1 -0
  67. package/dist/components/Gallery/styles.css +0 -8
  68. package/dist/components/Icon/Icon.vue.d.ts.map +1 -1
  69. package/dist/components/Icon/icon-categories.d.ts.map +1 -1
  70. package/dist/components/Icon/icons-types.d.ts +4 -2
  71. package/dist/components/Icon/icons-types.d.ts.map +1 -1
  72. package/dist/components/Icon/icons.d.ts +250 -561
  73. package/dist/components/Icon/icons.d.ts.map +1 -1
  74. package/dist/components/Icon/index.d.ts +2 -2
  75. package/dist/components/Icon/index.d.ts.map +1 -1
  76. package/dist/components/Icon/styles.css +0 -6
  77. package/dist/components/Knob/styles.css +0 -6
  78. package/dist/components/Layout/styles.css +5 -14
  79. package/dist/components/Listbox/Listbox.vue.d.ts.map +1 -1
  80. package/dist/components/Loading/styles.css +0 -16
  81. package/dist/components/Menu/Menu.vue.d.ts.map +1 -1
  82. package/dist/components/Menu/styles.css +6 -7
  83. package/dist/components/Menubar/Menubar.vue.d.ts.map +1 -1
  84. package/dist/components/Menubar/styles.css +4 -0
  85. package/dist/components/Message/styles.css +0 -13
  86. package/dist/components/Page/PageContent.vue.d.ts +2 -1
  87. package/dist/components/Page/PageContent.vue.d.ts.map +1 -1
  88. package/dist/components/Page/PageFilterChips.vue.d.ts +16 -0
  89. package/dist/components/Page/PageFilterChips.vue.d.ts.map +1 -0
  90. package/dist/components/Page/PageFilters.vue.d.ts +15 -3
  91. package/dist/components/Page/PageFilters.vue.d.ts.map +1 -1
  92. package/dist/components/Page/PageHeader.vue.d.ts +8 -4
  93. package/dist/components/Page/PageHeader.vue.d.ts.map +1 -1
  94. package/dist/components/Page/PagePlaceholder.vue.d.ts +6 -2
  95. package/dist/components/Page/PagePlaceholder.vue.d.ts.map +1 -1
  96. package/dist/components/Page/PageSection.vue.d.ts +8 -2
  97. package/dist/components/Page/PageSection.vue.d.ts.map +1 -1
  98. package/dist/components/Page/PageStat.vue.d.ts +8 -3
  99. package/dist/components/Page/PageStat.vue.d.ts.map +1 -1
  100. package/dist/components/Page/index.d.ts +2 -1
  101. package/dist/components/Page/index.d.ts.map +1 -1
  102. package/dist/components/Page/styles.css +239 -44
  103. package/dist/components/Page/types.d.ts +40 -0
  104. package/dist/components/Page/types.d.ts.map +1 -1
  105. package/dist/components/Pagination/Pagination.vue.d.ts.map +1 -1
  106. package/dist/components/Pagination/styles.css +7 -10
  107. package/dist/components/Pagination/types.d.ts +1 -1
  108. package/dist/components/Pagination/types.d.ts.map +1 -1
  109. package/dist/components/Panel/styles.css +0 -7
  110. package/dist/components/Popover/styles.css +20 -17
  111. package/dist/components/ProgressBar/styles.css +0 -9
  112. package/dist/components/ProgressSpinner/styles.css +0 -7
  113. package/dist/components/ScrollTop/styles.css +0 -7
  114. package/dist/components/Scrollbar/Scrollbar.vue.d.ts +1 -1
  115. package/dist/components/Scrollbar/styles.css +0 -8
  116. package/dist/components/Select/Select.vue.d.ts +10 -8
  117. package/dist/components/Select/Select.vue.d.ts.map +1 -1
  118. package/dist/components/Select/selectOptions.d.ts +46 -0
  119. package/dist/components/Select/selectOptions.d.ts.map +1 -0
  120. package/dist/components/Select/styles.css +35 -8
  121. package/dist/components/Select/types.d.ts +11 -1
  122. package/dist/components/Select/types.d.ts.map +1 -1
  123. package/dist/components/Sidebar/styles.css +0 -6
  124. package/dist/components/Skeleton/styles.css +0 -6
  125. package/dist/components/Slider/styles.css +9 -0
  126. package/dist/components/SplitButton/styles.css +5 -0
  127. package/dist/components/Status/styles.css +0 -7
  128. package/dist/components/Switch/styles.css +0 -7
  129. package/dist/components/Table/Table.vue.d.ts +26 -26
  130. package/dist/components/Table/Table.vue.d.ts.map +1 -1
  131. package/dist/components/Table/TableLoadingLine.vue.d.ts.map +1 -1
  132. package/dist/components/Table/hooks/useExpandableRow.d.ts.map +1 -1
  133. package/dist/components/Table/hooks/useTotalItems.d.ts.map +1 -1
  134. package/dist/components/Table/styles.css +61 -44
  135. package/dist/components/Table/tableQuery.d.ts +30 -0
  136. package/dist/components/Table/tableQuery.d.ts.map +1 -0
  137. package/dist/components/Tree/Tree.vue.d.ts.map +1 -1
  138. package/dist/components/Tree/treeQuery.d.ts +31 -0
  139. package/dist/components/Tree/treeQuery.d.ts.map +1 -0
  140. package/dist/components/TreeSelect/TreeSelect.vue.d.ts.map +1 -1
  141. package/dist/components/TreeSelect/styles.css +1 -1
  142. package/dist/config-provider/index.js +1 -1
  143. package/dist/config-provider/style.css +72 -72
  144. package/dist/confirm-dialog/index.js +2 -2
  145. package/dist/confirm-dialog/style.css +75 -124
  146. package/dist/confirm-popup/index.js +2 -2
  147. package/dist/confirm-popup/style.css +72 -78
  148. package/dist/context-menu/index.js +2 -2
  149. package/dist/context-menu/style.css +10 -75
  150. package/dist/data-view/index.js +47 -47
  151. package/dist/data-view/style.css +393 -174
  152. package/dist/data-view/style.js +1 -1
  153. package/dist/date-picker/index.js +1 -1
  154. package/dist/date-picker/style.css +10 -67
  155. package/dist/dialog/index.js +2 -2
  156. package/dist/dialog/style.css +75 -124
  157. package/dist/divider/style.css +10 -61
  158. package/dist/dock/index.js +2 -2
  159. package/dist/dock/style.css +10 -77
  160. package/dist/drawer/index.js +1 -1
  161. package/dist/drawer/style.css +12 -118
  162. package/dist/dropdown/index.js +110 -91
  163. package/dist/dropdown/style.css +34 -80
  164. package/dist/empty/index.js +5 -150
  165. package/dist/empty/style.css +10 -67
  166. package/dist/fieldset/index.js +1 -1
  167. package/dist/fieldset/style.css +10 -74
  168. package/dist/file-upload/index.js +148 -146
  169. package/dist/file-upload/style.css +10 -67
  170. package/dist/filterByQuery-Bczaxzih.js +17 -0
  171. package/dist/flex/style.css +10 -61
  172. package/dist/float-label/style.css +10 -61
  173. package/dist/fluid/style.css +10 -61
  174. package/dist/form/style.css +10 -61
  175. package/dist/gallery/index.js +1 -1
  176. package/dist/gallery/style.css +10 -83
  177. package/dist/grid/style.css +10 -61
  178. package/dist/icon/index.js +93 -39
  179. package/dist/icon/style.css +10 -67
  180. package/dist/icon-COrt_N8A.js +18 -0
  181. package/dist/icon-field/style.css +10 -61
  182. package/dist/index.d.ts +3 -2
  183. package/dist/index.d.ts.map +1 -1
  184. package/dist/index.js +5400 -5145
  185. package/dist/inplace/style.css +10 -61
  186. package/dist/input/index.js +1 -1
  187. package/dist/input/style.css +10 -67
  188. package/dist/input-color/style.css +10 -61
  189. package/dist/input-group/style.css +10 -61
  190. package/dist/input-number/index.js +1 -1
  191. package/dist/input-number/style.css +10 -67
  192. package/dist/input-otp/style.css +10 -61
  193. package/dist/input-password/index.js +1 -1
  194. package/dist/input-password/style.css +10 -67
  195. package/dist/input-tags/index.js +1 -1
  196. package/dist/input-tags/style.css +10 -67
  197. package/dist/knob/style.css +10 -67
  198. package/dist/label/style.css +10 -61
  199. package/dist/layout/index.js +1 -1
  200. package/dist/layout/style.css +15 -89
  201. package/dist/listbox/index.js +30 -32
  202. package/dist/listbox/style.css +10 -69
  203. package/dist/loading/index.js +32 -446
  204. package/dist/loading/style.css +10 -77
  205. package/dist/mega-menu/index.js +2 -2
  206. package/dist/mega-menu/style.css +10 -67
  207. package/dist/menu/index.js +265 -255
  208. package/dist/menu/style.css +36 -99
  209. package/dist/menubar/index.js +6 -3
  210. package/dist/menubar/style.css +14 -75
  211. package/dist/message/index.js +1 -1
  212. package/dist/message/style.css +10 -80
  213. package/dist/meter-group/style.css +10 -61
  214. package/dist/order-list/index.js +1 -1
  215. package/dist/order-list/style.css +10 -67
  216. package/dist/page/index.js +229 -70
  217. package/dist/page/style.css +1186 -113
  218. package/dist/page/style.js +3 -0
  219. package/dist/pagination/index.js +1 -1
  220. package/dist/pagination/style.css +210 -77
  221. package/dist/pagination/style.js +1 -0
  222. package/dist/panel/index.js +1 -1
  223. package/dist/panel/style.css +10 -74
  224. package/dist/pick-list/index.js +1 -1
  225. package/dist/pick-list/style.css +10 -67
  226. package/dist/popover/style.css +30 -78
  227. package/dist/progress-bar/style.css +10 -70
  228. package/dist/progress-spinner/index.js +105 -2
  229. package/dist/progress-spinner/style.css +10 -68
  230. package/dist/radio/style.css +10 -61
  231. package/dist/rating/index.js +1 -1
  232. package/dist/rating/style.css +10 -67
  233. package/dist/resolver-map.d.ts.map +1 -1
  234. package/dist/resolver.js +1 -0
  235. package/dist/result/index.js +1 -1
  236. package/dist/result/style.css +10 -67
  237. package/dist/scroll-top/index.js +1 -1
  238. package/dist/scroll-top/style.css +10 -82
  239. package/dist/scrollbar/style.css +10 -69
  240. package/dist/select/index.js +2 -478
  241. package/dist/select/style.css +59 -89
  242. package/dist/select-button/style.css +10 -61
  243. package/dist/shared/config.d.ts +2 -2
  244. package/dist/shared/filterByQuery.d.ts +14 -0
  245. package/dist/shared/filterByQuery.d.ts.map +1 -0
  246. package/dist/shared/menu/expand.d.ts +38 -0
  247. package/dist/shared/menu/expand.d.ts.map +1 -0
  248. package/dist/shared/menu/icon.d.ts.map +1 -1
  249. package/dist/shared/menu/index.d.ts +2 -0
  250. package/dist/shared/menu/index.d.ts.map +1 -1
  251. package/dist/shared/styles/select-overlay.css +14 -6
  252. package/dist/sidebar/index.js +2 -2
  253. package/dist/sidebar/style.css +10 -73
  254. package/dist/skeleton/index.js +2 -59
  255. package/dist/skeleton/style.css +10 -67
  256. package/dist/slider/style.css +19 -61
  257. package/dist/space/style.css +10 -61
  258. package/dist/speed-dial/index.js +2 -2
  259. package/dist/speed-dial/style.css +10 -67
  260. package/dist/split-button/index.js +1 -1
  261. package/dist/split-button/style.css +77 -78
  262. package/dist/splitter/style.css +10 -61
  263. package/dist/status/index.js +1 -1
  264. package/dist/status/style.css +10 -74
  265. package/dist/stepper/index.js +1 -1
  266. package/dist/stepper/style.css +10 -67
  267. package/dist/styles/base.css +5 -50
  268. package/dist/styles.css +1 -1
  269. package/dist/switch/style.css +10 -68
  270. package/dist/table/index.js +409 -373
  271. package/dist/table/style.css +457 -215
  272. package/dist/table/style.js +1 -1
  273. package/dist/tabs/index.js +1 -1
  274. package/dist/tabs/style.css +10 -75
  275. package/dist/tag/index.js +1 -1
  276. package/dist/tag/style.css +10 -67
  277. package/dist/terminal/style.css +10 -61
  278. package/dist/textarea/index.js +1 -1
  279. package/dist/textarea/style.css +10 -67
  280. package/dist/theme/styles.css +5 -11
  281. package/dist/theme/useMotion.d.ts +5 -1
  282. package/dist/theme/useMotion.d.ts.map +1 -1
  283. package/dist/tiered-menu/index.js +1 -1
  284. package/dist/tiered-menu/style.css +10 -75
  285. package/dist/timeline/index.js +1 -1
  286. package/dist/timeline/style.css +10 -75
  287. package/dist/toast/index.js +1 -1
  288. package/dist/toast/style.css +10 -67
  289. package/dist/toggle-button/index.js +2 -2
  290. package/dist/toggle-button/style.css +10 -67
  291. package/dist/toolbar/style.css +10 -61
  292. package/dist/tooltip/style.css +10 -61
  293. package/dist/tree/index.js +159 -173
  294. package/dist/tree/style.css +10 -67
  295. package/dist/tree-select/index.js +200 -213
  296. package/dist/tree-select/style.css +25 -82
  297. package/dist/tree-table/index.js +1 -1
  298. package/dist/tree-table/style.css +10 -67
  299. package/dist/treeQuery-CnHkyYOA.js +107 -0
  300. package/dist/virtual-scroller/style.css +10 -69
  301. package/package.json +1 -1
  302. package/dist/Button-B5X_R4Md.js +0 -156
  303. package/dist/Icon-lcN1rS87.js +0 -610
  304. package/dist/Pagination-CVrH8Ypi.js +0 -158
  305. package/dist/ProgressSpinner-BeWVF6Jv.js +0 -105
  306. package/dist/checkStrategy-CZzuUKDI.js +0 -63
  307. package/dist/components/Icon/icons-tabler.d.ts +0 -77
  308. package/dist/components/Icon/icons-tabler.d.ts.map +0 -1
  309. package/dist/icon-DWXkh-RM.js +0 -27
@@ -1,19 +1,19 @@
1
1
  import { a as e } from "../useComponentAttrs-e-5QAjdw.js";
2
- import { t } from "../Icon-lcN1rS87.js";
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-DWXkh-RM.js";
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 m, computed as h, createBlock as g, createCommentVNode as _, createElementBlock as v, createElementVNode as y, createVNode as b, defineComponent as x, getCurrentInstance as S, inject as C, mergeProps as w, nextTick as T, normalizeClass as E, normalizeStyle as D, onBeforeUnmount as re, openBlock as O, provide as k, reactive as ie, ref as A, renderList as ae, renderSlot as j, resolveDynamicComponent as M, toDisplayString as N, unref as P, useAttrs as oe, useSlots as se, watch as ce, withCtx as F } from "vue";
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 ue(e, t = "item") {
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(...ue(i.items, `${t}-${r}`));
43
+ n.push(a), n.push(...R(i.items, `${t}-${r}`));
44
44
  }
45
45
  return n;
46
46
  }
47
- function de(e, t = "item") {
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 fe = Symbol("muMenu");
95
+ var he = Symbol("muMenu");
58
96
  //#endregion
59
97
  //#region src/shared/optionalRouter.ts
60
- function R(e) {
98
+ function z(e) {
61
99
  return !!(e && typeof e == "object" && "resolve" in e && "push" in e);
62
100
  }
63
- function pe() {
64
- let e = S();
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 (R(t[e])) return !0;
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 (R(e[t])) return !0;
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 z() {
79
- let e = S();
80
- return !e || !pe() ? null : e.appContext.components.RouterLink ?? null;
116
+ function V() {
117
+ let e = x();
118
+ return !e || !B() ? null : e.appContext.components.RouterLink ?? null;
81
119
  }
82
- function B(e) {
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 me(e) {
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 V = /* @__PURE__ */ x({
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 = h(() => t.active && !!t.label && !t.suspended);
105
- return (t, r) => n.value ? (O(), g(f, {
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(() => [j(t.$slots, "default")]),
150
+ default: F(() => [A(t.$slots, "default")]),
113
151
  _: 3
114
- }, 8, ["content"])) : j(t.$slots, "default", {}, void 0, void 0, 1);
152
+ }, 8, ["content"])) : A(t.$slots, "default", {}, void 0, void 0, 1);
115
153
  }
116
- }), H = {
154
+ }), U = {
117
155
  key: 0,
118
156
  class: "m-menu__separator",
119
157
  role: "separator"
120
- }, U = [
158
+ }, W = [
121
159
  "tabindex",
122
160
  "data-m-menu-key",
123
161
  "aria-label",
124
162
  "aria-expanded"
125
- ], W = {
163
+ ], G = {
126
164
  key: 0,
127
165
  class: "m-menu__icon",
128
166
  "aria-hidden": "true"
129
- }, G = { class: "m-menu__label" }, he = {
167
+ }, ve = { class: "m-menu__label" }, ye = {
130
168
  key: 1,
131
169
  class: "m-menu__arrow",
132
170
  "aria-hidden": "true"
133
- }, ge = {
171
+ }, be = {
134
172
  class: "m-menu m-menu--flyout",
135
173
  role: "menu"
136
- }, _e = [
174
+ }, xe = [
137
175
  "tabindex",
138
176
  "data-m-menu-key",
139
177
  "aria-expanded",
140
178
  "aria-disabled",
141
179
  "onClick"
142
- ], ve = {
180
+ ], K = {
143
181
  key: 0,
144
182
  class: "m-menu__icon",
145
183
  "aria-hidden": "true"
146
- }, K = { class: "m-menu__label" }, q = {
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" }, Y = {
188
+ }, J = { class: "m-menu__submenu-inner" }, Ce = {
151
189
  key: 0,
152
190
  class: "m-menu__icon",
153
191
  "aria-hidden": "true"
154
- }, ye = { class: "m-menu__label" }, X = /* @__PURE__ */ x({
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 = C(fe);
201
+ let n = e, r = ie(he);
164
202
  if (!r) throw Error("MenuNodes must be used inside MMenu");
165
- let i = r, a = z(), o = h(() => i.collapsed.value && !n.flyout), s = h(() => i.mode === "horizontal"), c = h(() => (o.value || s.value) && !n.flyout);
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 x(e, t) {
223
+ function b(e, t) {
186
224
  return i.isExpanded(u(e, t));
187
225
  }
188
- function S(e, t) {
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 w(e, t) {
237
+ function S(e, t) {
200
238
  return n.flyout ? 0 : i.tabindexForKey(u(e, t));
201
239
  }
202
- function T(e) {
240
+ function C(e) {
203
241
  if (!(s.value || n.flyout)) return i.paddingStyle(e);
204
242
  }
205
- function re(e, t) {
206
- return x(e, t);
243
+ function ae(e, t) {
244
+ return b(e, t);
207
245
  }
208
- function k(e) {
209
- return !!(e.to && a && !me(e.to));
246
+ function D(e) {
247
+ return !!(e.to && a && !_e(e.to));
210
248
  }
211
- function ie(e) {
212
- if (!(!e.to || k(e))) return B(e.to);
249
+ function oe(e) {
250
+ if (!(!e.to || D(e))) return ge(e.to);
213
251
  }
214
- function A(e) {
215
- if (!(!k(e) || !e.to)) return e.to;
252
+ function O(e) {
253
+ if (!(!D(e) || !e.to)) return e.to;
216
254
  }
217
- function j(e) {
255
+ function A(e) {
218
256
  return o.value && !!e.label;
219
257
  }
220
- function oe(e, t) {
258
+ function se(e, t) {
221
259
  return !!i.flyoutOpen[u(e, t)];
222
260
  }
223
- return (n, r) => (O(!0), v(p, null, ae(e.items, (n, r) => (O(), v(p, { key: u(n, r) }, [n.separator ? (O(), v("div", H)) : n.items?.length ? (O(), v("div", {
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: E(["m-menu__item m-menu__item--submenu", { "m-menu__item--horizontal": s.value }]),
263
+ class: w(["m-menu__item m-menu__item--submenu", { "m-menu__item--horizontal": s.value }]),
226
264
  role: "none"
227
- }, [c.value ? (O(), g(d, {
265
+ }, [c.value ? (E(), h(d, {
228
266
  key: 0,
229
267
  class: "m-menu__collapsed-popover",
230
- "model-value": !!P(i).flyoutOpen[u(n, r)],
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(() => [b(V, {
275
+ default: F(() => [y(H, {
238
276
  label: n.label,
239
- active: j(n),
240
- suspended: oe(n, r)
277
+ active: A(n),
278
+ suspended: se(n, r)
241
279
  }, {
242
- default: F(() => [y("div", {
243
- class: E(["m-menu__item-content", S(n, r)]),
244
- style: D(T(e.depth)),
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: w(n, r),
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 ? !!P(i).flyoutOpen[u(n, r)] : void 0
288
+ "aria-expanded": s.value ? !!N(i).flyoutOpen[u(n, r)] : void 0
251
289
  }, [
252
- f(n) ? (O(), v("span", W, [b(t, {
290
+ f(n) ? (E(), _("span", G, [y(t, {
253
291
  name: f(n),
254
292
  size: "sm"
255
- }, null, 8, ["name"])])) : _("", !0),
256
- y("span", G, N(n.label), 1),
257
- s.value ? (O(), v("span", he, [b(t, {
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
- })])) : _("", !0)
261
- ], 14, U)]),
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(() => [y("div", ge, [b(X, {
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
- ])) : (O(), v(p, { key: 1 }, [y("div", {
283
- class: E(["m-menu__item-content", S(n, r)]),
284
- style: D(T(e.depth)),
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: w(n, r),
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": x(n, r),
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) ? (O(), v("span", ve, [b(t, {
331
+ f(n) ? (E(), _("span", K, [y(t, {
294
332
  name: f(n),
295
333
  size: "sm"
296
- }, null, 8, ["name"])])) : _("", !0),
297
- y("span", K, N(n.label), 1),
298
- y("span", {
299
- class: E(["m-menu__arrow", { "m-menu__arrow--expanded": re(n, r) }]),
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
- }, [b(t, {
339
+ }, [y(t, {
302
340
  name: "chevron-right",
303
341
  size: "sm"
304
342
  })], 2)
305
- ], 14, _e), b(m, { name: "m-menu-expand" }, {
306
- default: F(() => [x(n, r) ? (O(), v("div", q, [y("div", J, [b(X, {
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
- ])])])) : _("", !0)]),
352
+ ])])])) : g("", !0)]),
315
353
  _: 2
316
- }, 1024)], 64))], 2)) : (O(), v("div", {
354
+ }, 1024)], 64))], 2)) : (E(), _("div", {
317
355
  key: 2,
318
- class: E(["m-menu__item", { "m-menu__item--horizontal": s.value }]),
356
+ class: w(["m-menu__item", { "m-menu__item--horizontal": s.value }]),
319
357
  role: "none"
320
- }, [b(V, {
358
+ }, [y(H, {
321
359
  label: n.label,
322
- active: j(n)
360
+ active: A(n)
323
361
  }, {
324
- default: F(() => [(O(), g(M(k(n) ? P(a) : ie(n) ? "a" : "div"), {
325
- class: E(["m-menu__item-content", S(n, r)]),
326
- style: D(T(e.depth)),
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: w(n, r),
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": P(i).isSelected(n, r, e.prefix) ? "page" : void 0,
332
- href: ie(n),
333
- to: A(n),
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) ? (O(), v("span", Y, [b(t, {
374
+ default: F(() => [f(n) ? (E(), _("span", Ce, [y(t, {
337
375
  name: f(n),
338
376
  size: "sm"
339
- }, null, 8, ["name"])])) : _("", !0), y("span", ye, N(n.label), 1)]),
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
- }), be = /* @__PURE__ */ x({
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 = oe(), { rootAttrs: p } = e(f, () => l.pt), x = se(), S = te(), { transitionName: C, transitionCss: ae } = n({
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
- }), M = A(null), N = A(null), R = A({}), pe = h(() => !!x.default?.()?.length), z = h(() => r(l.popup ? l : { teleport: !1 }, S.value.appendTo)), B = h(() => l.popup && i(l, S.value.appendTo)), me = h(() => l.embedded ?? !l.popup), V = h(() => l.selectedKey), H = A([]), U = ie({});
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 he() {
427
- let e = N.value?.getBoundingClientRect();
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 ge() {
440
- !l.popup || !l.modelValue || !B.value || (R.value = a(he(), l.placement, { minWidth: "10rem" }));
477
+ function ye() {
478
+ !l.popup || !l.modelValue || !V.value || (R.value = a(ve(), l.placement, { minWidth: "10rem" }));
441
479
  }
442
- function _e() {
443
- l.modelValue && ge();
480
+ function be() {
481
+ l.modelValue && ye();
444
482
  }
445
- function ve() {
446
- if (l.defaultExpandAll) {
447
- H.value = ue(l.model);
448
- return;
449
- }
450
- if (l.defaultExpandedKeys.length) {
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
- ve();
462
- let K = h({
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
- }), q = h(() => de(l.model));
468
- function J(e) {
496
+ }), Se = m(() => ue(l.model));
497
+ function q(e) {
469
498
  return K.value.includes(e);
470
499
  }
471
- function Y(e) {
472
- let t = [...K.value], n = t.indexOf(e);
473
- if (n >= 0) t.splice(n, 1);
474
- else {
475
- if (l.accordion && q.value.includes(e)) {
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 ye(e) {
506
+ function Ce(e) {
486
507
  if (!e) return;
487
508
  let t = L(l.model, e);
488
- if (!t?.length) return;
489
- let n = /* @__PURE__ */ new Set([...K.value, ...t]);
490
- if (l.accordion) for (let e of q.value) n.has(e) && !t.includes(e) && n.delete(e);
491
- K.value = Array.from(n);
509
+ t?.length && (K.value = pe(K.value, t, {
510
+ accordion: l.accordion,
511
+ topLevelKeys: Se.value
512
+ }));
492
513
  }
493
- ce(() => l.selectedKey, ye);
494
- function be(e, t, n) {
514
+ P(() => l.selectedKey, Ce);
515
+ function we(e, t, n) {
495
516
  return I(e, t, n);
496
517
  }
497
- function xe(e, t, n) {
498
- let r = be(e, t, n);
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 Se(e, t, n) {
522
+ function Ee(e, t, n) {
502
523
  return l.selectedKey ? le(e, l.selectedKey, t, n) : !1;
503
524
  }
504
- function Ce(e) {
525
+ function De(e) {
505
526
  if (l.mode !== "horizontal" && l.collapsed) return Math.max(0, l.collapsedWidth / 2 - 10);
506
527
  }
507
- function we(e) {
528
+ function Oe(e) {
508
529
  if (l.mode === "horizontal") return { paddingInlineStart: `${l.rootIndent}px` };
509
530
  if (l.collapsed) {
510
- let t = Ce(e);
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 Te(e) {
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), Ee()), l.mode === "horizontal" && G();
520
- }
521
- function Ee() {
522
- (N.value?.querySelector("button, [tabindex]") ?? N.value)?.focus({ preventScroll: !0 });
523
- }
524
- let Z = h(() => {
525
- let e = l.collapsed || l.mode === "horizontal", t = [], n = (r, i, a) => {
526
- r.forEach((r, o) => {
527
- if (r.separator) return;
528
- let s = I(r, o, i), c = !!r.items?.length;
529
- t.push({
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 = Z.value[e];
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 Y(t.key);
559
+ } else J(t.key);
550
560
  return;
551
561
  }
552
- Te(t.item);
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 ? N.value?.querySelector("button, [tabindex]") ?? N.value : null
559
- }), De = h(() => Z.value[Q.activeIndex.value]?.key ?? null);
560
- function Oe(e) {
561
- let t = De.value;
562
- return t == null ? Z.value.find((e) => !e.item.disabled)?.key === e ? 0 : -1 : e === t ? 0 : -1;
563
- }
564
- function ke(e) {
565
- if (e == null || !M.value) return;
566
- let t = M.value.querySelectorAll("[data-m-menu-key]");
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 Ae(e) {
573
- let t = Z.value[Q.activeIndex.value];
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 (!J(t.key)) Y(t.key);
588
+ if (!q(t.key)) J(t.key);
579
589
  else {
580
- let e = Z.value.findIndex((e) => e.parentKey === t.key);
581
- e >= 0 && Q.setActive(e);
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 && J(t.key)) Y(t.key);
598
+ if (t.hasChildren && !l.collapsed && q(t.key)) J(t.key);
589
599
  else if (t.parentKey != null) {
590
- let e = Z.value.findIndex((e) => e.key === t.parentKey);
591
- e >= 0 && Q.setActive(e);
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
- Q.onKeydown(e);
609
+ Z.onKeydown(e);
600
610
  }
601
- ce(Q.activeIndex, () => {
602
- T(() => ke(De.value));
603
- }), k(fe, {
604
- collapsed: h(() => l.collapsed),
605
- selectedKey: V,
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: Y,
615
- isExpanded: J,
616
- activate: Te,
617
- resolveKey: be,
618
- isSelected: xe,
619
- isChildActive: Se,
620
- paddingStyle: we,
621
- activeKey: De,
622
- tabindexForKey: Oe
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 je(e) {
634
+ function Fe(e) {
625
635
  if (!l.popup || !l.modelValue) return;
626
636
  let t = e.target;
627
- M.value?.contains(t) || N.value?.contains(t) || d("update:modelValue", !1);
637
+ j.value?.contains(t) || M.value?.contains(t) || d("update:modelValue", !1);
628
638
  }
629
- ce(() => l.modelValue, (e) => {
630
- l.popup && (e ? (T(ge), document.addEventListener("click", je)) : document.removeEventListener("click", je));
631
- }, { immediate: !0 }), o(() => !!(l.popup && l.modelValue && B.value), _e), re(() => {
632
- document.removeEventListener("click", je);
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 Me = h(() => ["m-menu", {
644
+ let Q = m(() => ["m-menu", {
635
645
  "m-menu--popup": l.popup,
636
- "m-menu--teleported": B.value,
646
+ "m-menu--teleported": V.value,
637
647
  "m-menu--collapsed": l.collapsed,
638
- "m-menu--embedded": me.value,
648
+ "m-menu--embedded": ge.value,
639
649
  "m-menu--horizontal": l.mode === "horizontal",
640
650
  "m-menu--inverted": l.inverted
641
- }]), $ = h(() => ({
651
+ }]), $ = m(() => ({
642
652
  "--m-menu-indent": `${l.indent / 16}rem`,
643
653
  "--m-menu-root-indent": `${l.rootIndent / 16}rem`
644
- })), Ne = h(() => B.value ? {
654
+ })), Ie = m(() => V.value ? {
645
655
  ...$.value,
646
656
  ...R.value
647
657
  } : $.value);
648
- return (e, n) => t.popup ? pe.value ? (O(), v("div", w({ key: 1 }, P(p), { class: "m-menu-popup" }), [y("div", {
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: N,
660
+ ref: M,
651
661
  class: "m-menu-popup__anchor"
652
- }, [j(e.$slots, "default")], 512), (O(), g(ne, {
653
- to: z.value.to,
654
- disabled: z.value.disabled
655
- }, [b(m, {
656
- name: P(C),
657
- css: P(ae)
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 ? (O(), v("div", {
669
+ default: F(() => [t.modelValue ? (E(), _("div", {
660
670
  key: 0,
661
671
  ref_key: "root",
662
- ref: M,
663
- class: E(Me.value),
664
- style: D(B.value ? Ne.value : $.value),
672
+ ref: j,
673
+ class: w(Q.value),
674
+ style: T(V.value ? Ie.value : $.value),
665
675
  role: "menu",
666
- onKeydown: Ae
667
- }, [b(c, {
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(() => [b(X, {
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)) : _("", !0)]),
689
+ })], 38)) : g("", !0)]),
680
690
  _: 1
681
- }, 8, ["name", "css"])], 8, ["to", "disabled"]))], 16)) : (O(), g(ne, {
691
+ }, 8, ["name", "css"])], 8, ["to", "disabled"]))], 16)) : (E(), h(ne, {
682
692
  key: 2,
683
- to: z.value.to,
684
- disabled: z.value.disabled
685
- }, [b(m, {
686
- name: P(C),
687
- css: P(ae)
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 ? (O(), v("div", w({
699
+ default: F(() => [t.modelValue ? (E(), _("div", S({
690
700
  key: 0,
691
701
  ref_key: "root",
692
- ref: M
693
- }, P(p), {
694
- class: Me.value,
695
- style: B.value ? {
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: Ae
701
- }), [b(c, {
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(() => [b(X, {
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)) : _("", !0)]),
723
+ })], 16)) : g("", !0)]),
714
724
  _: 1
715
- }, 8, ["name", "css"])], 8, ["to", "disabled"])) : (O(), v("div", w({
725
+ }, 8, ["name", "css"])], 8, ["to", "disabled"])) : (E(), _("div", S({
716
726
  key: 0,
717
727
  ref_key: "root",
718
- ref: M
719
- }, P(p), {
720
- class: Me.value,
728
+ ref: j
729
+ }, N(p), {
730
+ class: Q.value,
721
731
  style: $.value,
722
732
  role: "menu",
723
- onKeydown: Ae
724
- }), [b(X, {
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 { be as MMenu };
742
+ export { Te as MMenu };