morya-ui 0.2.2 → 0.2.4

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 (209) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/Card-BQfmv5Iw.js +62 -0
  3. package/dist/FlyoutSubmenu-BC_cl17_.js +49 -0
  4. package/dist/ScrollBody-CXFNhBvq.js +68 -0
  5. package/dist/accordion/style.css +625 -583
  6. package/dist/auto-complete/style.css +625 -583
  7. package/dist/avatar/style.css +625 -583
  8. package/dist/badge/style.css +625 -583
  9. package/dist/block-ui/style.css +625 -583
  10. package/dist/breadcrumb/style.css +625 -583
  11. package/dist/button/style.css +625 -583
  12. package/dist/card/index.js +2 -62
  13. package/dist/card/style.css +625 -583
  14. package/dist/carousel/style.css +625 -583
  15. package/dist/cascade-select/style.css +625 -583
  16. package/dist/checkbox/style.css +625 -583
  17. package/dist/chip/style.css +625 -583
  18. package/dist/command-menu/style.css +625 -583
  19. package/dist/components/ContextMenu/ContextMenu.vue.d.ts.map +1 -1
  20. package/dist/components/ContextMenu/ContextMenuNodes.vue.d.ts.map +1 -1
  21. package/dist/components/ContextMenu/styles.css +33 -4
  22. package/dist/components/Dropdown/Dropdown.vue.d.ts +2 -2
  23. package/dist/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
  24. package/dist/components/Dropdown/DropdownNodes.vue.d.ts +2 -2
  25. package/dist/components/Dropdown/DropdownNodes.vue.d.ts.map +1 -1
  26. package/dist/components/Dropdown/styles.css +11 -0
  27. package/dist/components/Gallery/Gallery.vue.d.ts +2 -2
  28. package/dist/components/Gallery/Gallery.vue.d.ts.map +1 -1
  29. package/dist/components/Gallery/styles.css +5 -1
  30. package/dist/components/Layout/Layout.vue.d.ts +4 -3
  31. package/dist/components/Layout/Layout.vue.d.ts.map +1 -1
  32. package/dist/components/Layout/LayoutContent.vue.d.ts +2 -2
  33. package/dist/components/Layout/LayoutContent.vue.d.ts.map +1 -1
  34. package/dist/components/Layout/LayoutScrollContext.vue.d.ts +20 -0
  35. package/dist/components/Layout/LayoutScrollContext.vue.d.ts.map +1 -0
  36. package/dist/components/Layout/LayoutScrollRegion.vue.d.ts +34 -0
  37. package/dist/components/Layout/LayoutScrollRegion.vue.d.ts.map +1 -0
  38. package/dist/components/Layout/LayoutSider.vue.d.ts +2 -2
  39. package/dist/components/Layout/LayoutSider.vue.d.ts.map +1 -1
  40. package/dist/components/Layout/composables/useLayoutScroll.d.ts +4 -1
  41. package/dist/components/Layout/composables/useLayoutScroll.d.ts.map +1 -1
  42. package/dist/components/Layout/styles.css +35 -13
  43. package/dist/components/Layout/types.d.ts +2 -0
  44. package/dist/components/Layout/types.d.ts.map +1 -1
  45. package/dist/components/Menu/Menu.vue.d.ts.map +1 -1
  46. package/dist/components/Menu/styles.css +10 -0
  47. package/dist/components/Menubar/Menubar.vue.d.ts +2 -2
  48. package/dist/components/Menubar/Menubar.vue.d.ts.map +1 -1
  49. package/dist/components/Menubar/styles.css +14 -0
  50. package/dist/components/OrderList/OrderList.vue.d.ts +4 -4
  51. package/dist/components/OrderList/OrderList.vue.d.ts.map +1 -1
  52. package/dist/components/Page/PageContent.vue.d.ts +19 -0
  53. package/dist/components/Page/PageContent.vue.d.ts.map +1 -0
  54. package/dist/components/Page/PageFilters.vue.d.ts +16 -0
  55. package/dist/components/Page/PageFilters.vue.d.ts.map +1 -0
  56. package/dist/components/Page/PageHeader.vue.d.ts +22 -0
  57. package/dist/components/Page/PageHeader.vue.d.ts.map +1 -0
  58. package/dist/components/Page/PagePlaceholder.vue.d.ts +20 -0
  59. package/dist/components/Page/PagePlaceholder.vue.d.ts.map +1 -0
  60. package/dist/components/Page/PageSection.vue.d.ts +19 -0
  61. package/dist/components/Page/PageSection.vue.d.ts.map +1 -0
  62. package/dist/components/Page/PageStat.vue.d.ts +18 -0
  63. package/dist/components/Page/PageStat.vue.d.ts.map +1 -0
  64. package/dist/components/Page/PageToolbar.vue.d.ts +20 -0
  65. package/dist/components/Page/PageToolbar.vue.d.ts.map +1 -0
  66. package/dist/components/Page/index.d.ts +9 -0
  67. package/dist/components/Page/index.d.ts.map +1 -0
  68. package/dist/components/Page/styles.css +193 -0
  69. package/dist/components/Page/types.d.ts +54 -0
  70. package/dist/components/Page/types.d.ts.map +1 -0
  71. package/dist/components/PickList/PickList.vue.d.ts +7 -7
  72. package/dist/components/PickList/PickList.vue.d.ts.map +1 -1
  73. package/dist/components/ScrollTop/ScrollTop.vue.d.ts.map +1 -1
  74. package/dist/components/Tabs/Tabs.vue.d.ts +3 -3
  75. package/dist/components/Tabs/Tabs.vue.d.ts.map +1 -1
  76. package/dist/components/Tabs/styles.css +72 -77
  77. package/dist/components/Terminal/Terminal.vue.d.ts.map +1 -1
  78. package/dist/components/Terminal/styles.css +6 -2
  79. package/dist/components/TieredMenu/TieredMenu.vue.d.ts.map +1 -1
  80. package/dist/components/TieredMenu/styles.css +33 -4
  81. package/dist/components/Timeline/Timeline.vue.d.ts +35 -10
  82. package/dist/components/Timeline/Timeline.vue.d.ts.map +1 -1
  83. package/dist/components/Timeline/styles.css +159 -156
  84. package/dist/components/TreeSelect/TreeSelect.vue.d.ts.map +1 -1
  85. package/dist/components/TreeSelect/styles.css +15 -0
  86. package/dist/components/TreeTable/TreeTable.vue.d.ts +2 -2
  87. package/dist/components/TreeTable/TreeTable.vue.d.ts.map +1 -1
  88. package/dist/components/TreeTable/styles.css +64 -61
  89. package/dist/components/VirtualScroller/VirtualScroller.vue.d.ts +2 -2
  90. package/dist/components/VirtualScroller/VirtualScroller.vue.d.ts.map +1 -1
  91. package/dist/components/VirtualScroller/styles.css +20 -17
  92. package/dist/config-provider/style.css +625 -583
  93. package/dist/confirm-dialog/style.css +625 -583
  94. package/dist/confirm-popup/style.css +625 -583
  95. package/dist/context-menu/index.js +131 -89
  96. package/dist/context-menu/style.css +781 -587
  97. package/dist/context-menu/style.js +1 -0
  98. package/dist/data-view/style.css +625 -583
  99. package/dist/date-picker/style.css +625 -583
  100. package/dist/dialog/style.css +625 -583
  101. package/dist/divider/style.css +625 -583
  102. package/dist/dock/style.css +625 -583
  103. package/dist/drawer/style.css +625 -583
  104. package/dist/dropdown/index.js +162 -122
  105. package/dist/dropdown/style.css +759 -583
  106. package/dist/dropdown/style.js +1 -0
  107. package/dist/fieldset/style.css +625 -583
  108. package/dist/file-upload/style.css +625 -583
  109. package/dist/flex/style.css +625 -583
  110. package/dist/float-label/style.css +625 -583
  111. package/dist/fluid/style.css +625 -583
  112. package/dist/form/style.css +625 -583
  113. package/dist/gallery/index.js +76 -67
  114. package/dist/gallery/style.css +753 -584
  115. package/dist/gallery/style.js +1 -0
  116. package/dist/grid/style.css +625 -583
  117. package/dist/icon/style.css +625 -583
  118. package/dist/icon-field/style.css +625 -583
  119. package/dist/index.d.ts +8 -0
  120. package/dist/index.d.ts.map +1 -1
  121. package/dist/index.js +2366 -1745
  122. package/dist/inplace/style.css +625 -583
  123. package/dist/input/style.css +625 -583
  124. package/dist/input-color/style.css +625 -583
  125. package/dist/input-group/style.css +625 -583
  126. package/dist/input-number/style.css +625 -583
  127. package/dist/input-otp/style.css +625 -583
  128. package/dist/input-password/style.css +625 -583
  129. package/dist/input-tags/style.css +625 -583
  130. package/dist/knob/style.css +625 -583
  131. package/dist/label/style.css +625 -583
  132. package/dist/layout/index.js +235 -136
  133. package/dist/layout/style.css +783 -596
  134. package/dist/layout/style.js +1 -0
  135. package/dist/listbox/style.css +625 -583
  136. package/dist/mega-menu/style.css +625 -583
  137. package/dist/menu/index.js +233 -216
  138. package/dist/menu/style.css +758 -583
  139. package/dist/menu/style.js +1 -0
  140. package/dist/menubar/index.js +77 -68
  141. package/dist/menubar/style.css +762 -583
  142. package/dist/menubar/style.js +1 -0
  143. package/dist/message/style.css +625 -583
  144. package/dist/meter-group/style.css +625 -583
  145. package/dist/order-list/index.js +66 -58
  146. package/dist/order-list/style.css +625 -583
  147. package/dist/page/index.js +176 -0
  148. package/dist/page/style.css +1199 -0
  149. package/dist/page/style.js +5 -0
  150. package/dist/pagination/style.css +625 -583
  151. package/dist/panel/style.css +625 -583
  152. package/dist/pick-list/index.js +97 -84
  153. package/dist/pick-list/style.css +625 -583
  154. package/dist/popover/style.css +625 -583
  155. package/dist/progress-bar/style.css +625 -583
  156. package/dist/progress-spinner/style.css +625 -583
  157. package/dist/radio/style.css +625 -583
  158. package/dist/rating/style.css +625 -583
  159. package/dist/resolver-map.d.ts.map +1 -1
  160. package/dist/resolver.js +7 -0
  161. package/dist/scroll-top/index.js +23 -13
  162. package/dist/scroll-top/style.css +748 -583
  163. package/dist/scroll-top/style.js +1 -0
  164. package/dist/scrollbar/style.css +625 -583
  165. package/dist/select/style.css +625 -583
  166. package/dist/select-button/style.css +625 -583
  167. package/dist/shared/FlyoutSubmenu.vue.d.ts +32 -0
  168. package/dist/shared/FlyoutSubmenu.vue.d.ts.map +1 -0
  169. package/dist/shared/ScrollBody.vue.d.ts +39 -0
  170. package/dist/shared/ScrollBody.vue.d.ts.map +1 -0
  171. package/dist/sidebar/style.css +625 -583
  172. package/dist/skeleton/style.css +625 -583
  173. package/dist/slider/style.css +625 -583
  174. package/dist/space/style.css +625 -583
  175. package/dist/speed-dial/style.css +625 -583
  176. package/dist/split-button/style.css +625 -583
  177. package/dist/splitter/style.css +625 -583
  178. package/dist/stepper/style.css +625 -583
  179. package/dist/styles/base.css +625 -583
  180. package/dist/styles.css +1 -1
  181. package/dist/switch/style.css +625 -583
  182. package/dist/table/style.css +625 -583
  183. package/dist/tabs/index.js +92 -81
  184. package/dist/tabs/style.css +818 -658
  185. package/dist/tabs/style.js +1 -0
  186. package/dist/tag/style.css +625 -583
  187. package/dist/terminal/index.js +47 -40
  188. package/dist/terminal/style.css +631 -585
  189. package/dist/textarea/style.css +625 -583
  190. package/dist/tiered-menu/index.js +130 -84
  191. package/dist/tiered-menu/style.css +781 -587
  192. package/dist/tiered-menu/style.js +1 -0
  193. package/dist/timeline/index.js +82 -37
  194. package/dist/timeline/style.css +907 -739
  195. package/dist/timeline/style.js +1 -0
  196. package/dist/toast/style.css +625 -583
  197. package/dist/toggle-button/style.css +625 -583
  198. package/dist/toolbar/style.css +625 -583
  199. package/dist/tooltip/style.css +625 -583
  200. package/dist/tree/style.css +625 -583
  201. package/dist/tree-select/index.js +202 -193
  202. package/dist/tree-select/style.css +763 -583
  203. package/dist/tree-select/style.js +1 -0
  204. package/dist/tree-table/index.js +57 -50
  205. package/dist/tree-table/style.css +689 -644
  206. package/dist/virtual-scroller/index.js +38 -34
  207. package/dist/virtual-scroller/style.css +775 -607
  208. package/dist/virtual-scroller/style.js +1 -0
  209. package/package.json +8 -1
@@ -2,40 +2,38 @@ import { r as e } from "../useComponentAttrs-BTYEe61P.js";
2
2
  import { t } from "../Icon-DfpIfo2L.js";
3
3
  import { n, t as r } from "../overlay-oR-5MDuE.js";
4
4
  import { t as i } from "../overlayPlacement-Cd20JTD_.js";
5
- import { t as a } from "../icon-xUOyawgJ.js";
6
- import { t as o } from "../key-CaQYVkjh.js";
7
- import { c as s } from "../config-CI8_WBbE.js";
8
- import { n as c } from "../locale-DYGhxekd.js";
5
+ import { t as a } from "../Scrollbar-DoNZvgX2.js";
6
+ import { t as o } from "../icon-xUOyawgJ.js";
7
+ import { t as s } from "../key-CaQYVkjh.js";
8
+ import { t as c } from "../FlyoutSubmenu-BC_cl17_.js";
9
+ import { c as l } from "../config-CI8_WBbE.js";
10
+ import { n as u } from "../locale-DYGhxekd.js";
9
11
  import "./style.js";
10
- import { Fragment as l, Teleport as u, Transition as d, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as g, createSlots as _, createTextVNode as v, createVNode as y, defineComponent as b, mergeProps as ee, nextTick as x, normalizeClass as S, normalizeStyle as C, onBeforeUnmount as te, openBlock as w, ref as T, renderList as E, renderSlot as D, toDisplayString as O, unref as k, useAttrs as A, watch as ne, withCtx as j } from "vue";
12
+ import { Fragment as d, Teleport as f, Transition as p, computed as m, createBlock as h, createCommentVNode as g, createElementBlock as _, createElementVNode as v, createSlots as y, createTextVNode as b, createVNode as x, defineComponent as S, mergeProps as C, nextTick as w, normalizeClass as T, normalizeStyle as E, onBeforeUnmount as D, openBlock as O, ref as k, renderList as A, renderSlot as j, toDisplayString as M, unref as N, useAttrs as ee, watch as te, withCtx as P } from "vue";
11
13
  //#region src/components/Dropdown/DropdownNodes.vue?vue&type=script&setup=true&lang.ts
12
- var M = {
14
+ var F = {
13
15
  key: 0,
14
16
  class: "m-dropdown__separator",
15
17
  role: "separator"
16
- }, N = {
18
+ }, I = {
17
19
  key: 1,
18
20
  class: "m-dropdown__group"
19
- }, P = { class: "m-dropdown__group-label" }, F = ["onMouseenter"], I = ["disabled"], L = {
21
+ }, L = { class: "m-dropdown__group-label" }, R = ["onMouseenter"], z = ["disabled"], B = {
20
22
  key: 0,
21
23
  class: "m-dropdown__icon",
22
24
  "aria-hidden": "true"
23
- }, R = {
25
+ }, V = {
24
26
  class: "m-dropdown__caret",
25
27
  "aria-hidden": "true"
26
- }, z = {
27
- key: 0,
28
- class: "m-dropdown__submenu",
29
- role: "menu"
30
- }, B = [
28
+ }, H = [
31
29
  "disabled",
32
30
  "onMouseenter",
33
31
  "onClick"
34
- ], V = {
32
+ ], U = {
35
33
  key: 0,
36
34
  class: "m-dropdown__icon",
37
35
  "aria-hidden": "true"
38
- }, H = /* @__PURE__ */ b({
36
+ }, W = /* @__PURE__ */ S({
39
37
  __name: "DropdownNodes",
40
38
  props: {
41
39
  items: {},
@@ -43,71 +41,105 @@ var M = {
43
41
  },
44
42
  emits: ["select", "highlight"],
45
43
  setup(e, { emit: n }) {
46
- let r = n, i = T(null);
47
- function s(e) {
44
+ let r = n, i = k(null), l = k(null), u;
45
+ function f() {
46
+ u && clearTimeout(u), u = void 0;
47
+ }
48
+ function p() {
49
+ f(), u = setTimeout(() => {
50
+ i.value = null, l.value = null;
51
+ }, 150);
52
+ }
53
+ function m(e) {
48
54
  return e.separator || e.type === "divider";
49
55
  }
50
- function c(e) {
56
+ function y(e) {
51
57
  return e.type === "group";
52
58
  }
53
- function u(e, t) {
54
- return o(e, t, "dd");
59
+ function S(e, t) {
60
+ return s(e, t, "dd");
61
+ }
62
+ function C(e) {
63
+ return o(e.icon);
55
64
  }
56
- function d(e) {
57
- return a(e.icon);
65
+ function w(e, t, n) {
66
+ if (e.disabled || m(e) || y(e) || (f(), r("highlight", e.value), !e.items?.length)) return;
67
+ i.value = S(e, t);
68
+ let a = n.currentTarget;
69
+ l.value = a?.querySelector(".m-dropdown__item--parent") ?? a;
58
70
  }
59
- function f(e, t) {
60
- e.disabled || s(e) || c(e) || (r("highlight", e.value), e.items?.length && (i.value = u(e, t)));
71
+ function E() {
72
+ p();
61
73
  }
62
- function _() {
63
- i.value = null;
74
+ function D() {
75
+ f();
64
76
  }
65
- return (n, r) => (w(!0), h(l, null, E(e.items, (a, o) => (w(), h(l, { key: u(a, o) }, [s(a) ? (w(), h("div", M)) : c(a) ? (w(), h("div", N, [g("div", P, O(a.label), 1), a.items?.length ? (w(), p(H, {
77
+ function N() {
78
+ p();
79
+ }
80
+ return (n, r) => (O(!0), _(d, null, A(e.items, (o, s) => (O(), _(d, { key: S(o, s) }, [m(o) ? (O(), _("div", F)) : y(o) ? (O(), _("div", I, [v("div", L, M(o.label), 1), o.items?.length ? (O(), h(W, {
66
81
  key: 0,
67
- items: a.items,
82
+ items: o.items,
68
83
  "highlighted-value": e.highlightedValue,
69
84
  onSelect: r[0] ||= (e) => n.$emit("select", e),
70
85
  onHighlight: r[1] ||= (e) => n.$emit("highlight", e)
71
- }, null, 8, ["items", "highlighted-value"])) : m("", !0)])) : a.items?.length ? (w(), h("div", {
86
+ }, null, 8, ["items", "highlighted-value"])) : g("", !0)])) : o.items?.length ? (O(), _("div", {
72
87
  key: 2,
73
88
  class: "m-dropdown__submenu-wrap",
74
- onMouseenter: (e) => f(a, o),
75
- onMouseleave: _
76
- }, [g("button", {
89
+ onMouseenter: (e) => w(o, s, e),
90
+ onMouseleave: E
91
+ }, [v("button", {
77
92
  type: "button",
78
- class: S(["m-dropdown__item m-dropdown__item--parent", { "m-dropdown__item--highlighted": e.highlightedValue === a.value }]),
93
+ class: T(["m-dropdown__item m-dropdown__item--parent", { "m-dropdown__item--highlighted": e.highlightedValue === o.value }]),
79
94
  role: "menuitem",
80
- disabled: a.disabled,
95
+ disabled: o.disabled,
81
96
  "aria-haspopup": !0
82
97
  }, [
83
- d(a) ? (w(), h("span", L, [y(t, {
84
- name: d(a),
98
+ C(o) ? (O(), _("span", B, [x(t, {
99
+ name: C(o),
85
100
  size: "sm"
86
- }, null, 8, ["name"])])) : m("", !0),
87
- D(n.$slots, "item", { item: a }, () => [v(O(a.label), 1)]),
88
- g("span", R, [y(t, {
101
+ }, null, 8, ["name"])])) : g("", !0),
102
+ j(n.$slots, "item", { item: o }, () => [b(M(o.label), 1)]),
103
+ v("span", V, [x(t, {
89
104
  name: "chevron-right",
90
105
  size: "sm"
91
106
  })])
92
- ], 10, I), i.value === u(a, o) ? (w(), h("div", z, [y(H, {
93
- items: a.items,
94
- "highlighted-value": e.highlightedValue,
95
- onSelect: r[2] ||= (e) => n.$emit("select", e),
96
- onHighlight: r[3] ||= (e) => n.$emit("highlight", e)
97
- }, null, 8, ["items", "highlighted-value"])])) : m("", !0)], 40, F)) : (w(), h("button", {
107
+ ], 10, z), x(c, {
108
+ open: i.value === S(o, s),
109
+ anchor: i.value === S(o, s) ? l.value : null,
110
+ "panel-class": "m-dropdown__submenu",
111
+ onEnter: D,
112
+ onLeave: N
113
+ }, {
114
+ default: P(() => [x(a, {
115
+ class: "m-dropdown__submenu-scroll",
116
+ "fit-content": "",
117
+ "wrap-class": "m-dropdown__submenu-wrap-inner",
118
+ "view-class": "m-dropdown__submenu-view"
119
+ }, {
120
+ default: P(() => [x(W, {
121
+ items: o.items,
122
+ "highlighted-value": e.highlightedValue,
123
+ onSelect: r[2] ||= (e) => n.$emit("select", e),
124
+ onHighlight: r[3] ||= (e) => n.$emit("highlight", e)
125
+ }, null, 8, ["items", "highlighted-value"])]),
126
+ _: 2
127
+ }, 1024)]),
128
+ _: 2
129
+ }, 1032, ["open", "anchor"])], 40, R)) : (O(), _("button", {
98
130
  key: 3,
99
131
  type: "button",
100
- class: S(["m-dropdown__item", { "m-dropdown__item--highlighted": e.highlightedValue === a.value }]),
132
+ class: T(["m-dropdown__item", { "m-dropdown__item--highlighted": e.highlightedValue === o.value }]),
101
133
  role: "menuitem",
102
- disabled: a.disabled,
103
- onMouseenter: (e) => !a.disabled && n.$emit("highlight", a.value),
104
- onClick: (e) => n.$emit("select", a)
105
- }, [d(a) ? (w(), h("span", V, [y(t, {
106
- name: d(a),
134
+ disabled: o.disabled,
135
+ onMouseenter: (e) => !o.disabled && n.$emit("highlight", o.value),
136
+ onClick: (e) => n.$emit("select", o)
137
+ }, [C(o) ? (O(), _("span", U, [x(t, {
138
+ name: C(o),
107
139
  size: "sm"
108
- }, null, 8, ["name"])])) : m("", !0), D(n.$slots, "item", { item: a }, () => [v(O(a.label), 1)])], 42, B))], 64))), 128));
140
+ }, null, 8, ["name"])])) : g("", !0), j(n.$slots, "item", { item: o }, () => [b(M(o.label), 1)])], 42, H))], 64))), 128));
109
141
  }
110
- }), re = ["aria-expanded"], U = /* @__PURE__ */ b({
142
+ }), ne = ["aria-expanded"], G = /* @__PURE__ */ S({
111
143
  inheritAttrs: !1,
112
144
  __name: "Dropdown",
113
145
  props: {
@@ -132,115 +164,123 @@ var M = {
132
164
  pt: {}
133
165
  },
134
166
  emits: ["update:modelValue", "select"],
135
- setup(t, { emit: a }) {
136
- let o = t, l = a, b = A(), { rootAttrs: E } = e(b, () => o.pt), M = s(), N = c(), P = T(null), F = T(null), I = T(null), L = T({}), R = T(-1), z = f(() => o.items.filter((e) => !e.disabled && !e.separator && e.type !== "divider" && e.type !== "group" && !e.items?.length && e.value != null)), B = f(() => z.value[R.value]?.value), V, U, W = f(() => n(o, M.value.appendTo)), G = f(() => r(o, M.value.appendTo));
137
- function ie() {
138
- R.value = z.value.length ? 0 : -1;
167
+ setup(t, { emit: o }) {
168
+ let s = t, c = o, d = ee(), { rootAttrs: S } = e(d, () => s.pt), A = l(), F = u(), I = k(null), L = k(null), R = k(null), z = k({}), B = k(-1), V = m(() => s.items.filter((e) => !e.disabled && !e.separator && e.type !== "divider" && e.type !== "group" && !e.items?.length && e.value != null)), H = m(() => V.value[B.value]?.value), U, G, K = m(() => n(s, A.value.appendTo)), q = m(() => r(s, A.value.appendTo));
169
+ function re() {
170
+ B.value = V.value.length ? 0 : -1;
139
171
  }
140
- function K() {
141
- if (!G.value || !F.value) return;
142
- let e = F.value.getBoundingClientRect();
143
- L.value = i(e, o.placement === "bottom-end" ? "bottom-end" : "bottom-start", { minWidth: `${e.width}px` });
172
+ function J() {
173
+ if (!q.value || !L.value) return;
174
+ let e = L.value.getBoundingClientRect();
175
+ z.value = i(e, s.placement === "bottom-end" ? "bottom-end" : "bottom-start", { minWidth: `${e.width}px` });
144
176
  }
145
- function q(e) {
146
- l("update:modelValue", e), e && (ie(), x(() => {
147
- K(), I.value?.focus({ preventScroll: !0 });
177
+ function Y(e) {
178
+ c("update:modelValue", e), e && (re(), w(() => {
179
+ J(), R.value?.focus({ preventScroll: !0 });
148
180
  }));
149
181
  }
150
- function J() {
151
- q(!o.modelValue);
182
+ function ie() {
183
+ Y(!s.modelValue);
152
184
  }
153
- function Y() {
154
- o.modelValue && K();
185
+ function X() {
186
+ s.modelValue && J();
155
187
  }
156
- function X(e) {
157
- e.disabled || e.separator || e.type === "divider" || e.type === "group" || (e.command?.(), l("select", e), o.closeOnSelect && q(!1));
188
+ function Z(e) {
189
+ e.disabled || e.separator || e.type === "divider" || e.type === "group" || (e.command?.(), c("select", e), s.closeOnSelect && Y(!1));
158
190
  }
159
- function Z() {
160
- V && clearTimeout(V), U && clearTimeout(U), V = void 0, U = void 0;
191
+ function Q() {
192
+ U && clearTimeout(U), G && clearTimeout(G), U = void 0, G = void 0;
161
193
  }
162
194
  function ae() {
163
- o.trigger === "hover" && (Z(), V = setTimeout(q, o.showDelay, !0));
195
+ s.trigger === "hover" && (Q(), U = setTimeout(Y, s.showDelay, !0));
164
196
  }
165
197
  function oe() {
166
- o.trigger === "hover" && (Z(), U = setTimeout(q, o.hideDelay, !1));
167
- }
168
- function Q() {
169
- o.trigger === "hover" && Z();
198
+ s.trigger === "hover" && (Q(), G = setTimeout(Y, s.hideDelay, !1));
170
199
  }
171
200
  function se() {
172
- o.trigger === "hover" && (Z(), U = setTimeout(q, o.hideDelay, !1));
201
+ s.trigger === "hover" && Q();
202
+ }
203
+ function ce() {
204
+ s.trigger === "hover" && (Q(), G = setTimeout(Y, s.hideDelay, !1));
173
205
  }
174
- function ce(e) {
175
- if (o.modelValue) {
206
+ function le(e) {
207
+ if (s.modelValue) {
176
208
  if (e.key === "Escape") {
177
- e.preventDefault(), q(!1), F.value?.focus({ preventScroll: !0 });
209
+ e.preventDefault(), Y(!1), L.value?.focus({ preventScroll: !0 });
178
210
  return;
179
211
  }
180
212
  if (e.key === "ArrowDown" || e.key === "ArrowUp") {
181
213
  e.preventDefault();
182
- let t = e.key === "ArrowDown" ? 1 : -1, n = z.value.length;
183
- n && (R.value = (R.value + t + n) % n);
214
+ let t = e.key === "ArrowDown" ? 1 : -1, n = V.value.length;
215
+ n && (B.value = (B.value + t + n) % n);
184
216
  }
185
- if (e.key === "Home" && (e.preventDefault(), R.value = 0), e.key === "End" && (e.preventDefault(), R.value = z.value.length - 1), e.key === "Enter" || e.key === " ") {
186
- let t = z.value[R.value];
187
- R.value >= 0 && t && (e.preventDefault(), X(t));
217
+ if (e.key === "Home" && (e.preventDefault(), B.value = 0), e.key === "End" && (e.preventDefault(), B.value = V.value.length - 1), e.key === "Enter" || e.key === " ") {
218
+ let t = V.value[B.value];
219
+ B.value >= 0 && t && (e.preventDefault(), Z(t));
188
220
  }
189
221
  }
190
222
  }
191
- function le(e) {
192
- (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") && (e.preventDefault(), o.modelValue || q(!0));
223
+ function ue(e) {
224
+ (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") && (e.preventDefault(), s.modelValue || Y(!0));
193
225
  }
194
226
  function $(e) {
195
- o.modelValue && P.value && !P.value.contains(e.target) && !I.value?.contains(e.target) && q(!1);
227
+ s.modelValue && I.value && !I.value.contains(e.target) && !R.value?.contains(e.target) && Y(!1);
196
228
  }
197
- return ne(() => o.modelValue, (e) => {
198
- e ? (document.addEventListener("click", $), G.value && (window.addEventListener("resize", Y), window.addEventListener("scroll", Y, !0))) : (document.removeEventListener("click", $), window.removeEventListener("resize", Y), window.removeEventListener("scroll", Y, !0));
199
- }, { immediate: !0 }), te(() => {
200
- document.removeEventListener("click", $), window.removeEventListener("resize", Y), window.removeEventListener("scroll", Y, !0), Z();
201
- }), (e, n) => (w(), h("div", ee({
229
+ return te(() => s.modelValue, (e) => {
230
+ e ? (document.addEventListener("click", $), q.value && (window.addEventListener("resize", X), window.addEventListener("scroll", X, !0))) : (document.removeEventListener("click", $), window.removeEventListener("resize", X), window.removeEventListener("scroll", X, !0));
231
+ }, { immediate: !0 }), D(() => {
232
+ document.removeEventListener("click", $), window.removeEventListener("resize", X), window.removeEventListener("scroll", X, !0), Q();
233
+ }), (e, n) => (O(), _("div", C({
202
234
  ref_key: "root",
203
- ref: P
204
- }, k(E), { class: "m-dropdown" }), [g("span", {
235
+ ref: I
236
+ }, N(S), { class: "m-dropdown" }), [v("span", {
205
237
  ref_key: "trigger",
206
- ref: F,
238
+ ref: L,
207
239
  class: "m-dropdown__trigger",
208
240
  role: "button",
209
241
  tabindex: "0",
210
242
  "aria-expanded": t.modelValue,
211
243
  "aria-haspopup": "menu",
212
- onClick: n[0] ||= (e) => o.trigger === "click" && J(),
244
+ onClick: n[0] ||= (e) => s.trigger === "click" && ie(),
213
245
  onMouseenter: ae,
214
246
  onMouseleave: oe,
215
- onKeydown: le
216
- }, [D(e.$slots, "trigger", {}, () => [v(O(k(N).openMenu), 1)])], 40, re), (w(), p(u, {
217
- to: W.value.to,
218
- disabled: W.value.disabled
219
- }, [y(d, { name: "m-scale-fade" }, {
220
- default: j(() => [t.modelValue ? (w(), h("div", {
247
+ onKeydown: ue
248
+ }, [j(e.$slots, "trigger", {}, () => [b(M(N(F).openMenu), 1)])], 40, ne), (O(), h(f, {
249
+ to: K.value.to,
250
+ disabled: K.value.disabled
251
+ }, [x(p, { name: "m-scale-fade" }, {
252
+ default: P(() => [t.modelValue ? (O(), _("div", {
221
253
  key: 0,
222
254
  ref_key: "menu",
223
- ref: I,
224
- class: S(["m-dropdown__menu", [`m-dropdown__menu--${t.placement}`, { "m-dropdown__menu--teleported": G.value }]]),
225
- style: C(G.value ? L.value : void 0),
255
+ ref: R,
256
+ class: T(["m-dropdown__menu", [`m-dropdown__menu--${t.placement}`, { "m-dropdown__menu--teleported": q.value }]]),
257
+ style: E(q.value ? z.value : void 0),
226
258
  role: "menu",
227
259
  tabindex: "-1",
228
- onKeydown: ce,
229
- onMouseenter: Q,
230
- onMouseleave: se
231
- }, [y(H, {
232
- items: t.items,
233
- "highlighted-value": B.value,
234
- onSelect: X,
235
- onHighlight: n[1] ||= (e) => R.value = z.value.findIndex((t) => t.value === e)
236
- }, _({ _: 2 }, [e.$slots.item ? {
237
- name: "item",
238
- fn: j(({ item: t }) => [D(e.$slots, "item", { item: t })]),
239
- key: "0"
240
- } : void 0]), 1032, ["items", "highlighted-value"])], 38)) : m("", !0)]),
260
+ onKeydown: le,
261
+ onMouseenter: se,
262
+ onMouseleave: ce
263
+ }, [x(a, {
264
+ class: "m-dropdown__scroll",
265
+ "fit-content": "",
266
+ "wrap-class": "m-dropdown__scroll-wrap",
267
+ "view-class": "m-dropdown__scroll-view"
268
+ }, {
269
+ default: P(() => [x(W, {
270
+ items: t.items,
271
+ "highlighted-value": H.value,
272
+ onSelect: Z,
273
+ onHighlight: n[1] ||= (e) => B.value = V.value.findIndex((t) => t.value === e)
274
+ }, y({ _: 2 }, [e.$slots.item ? {
275
+ name: "item",
276
+ fn: P(({ item: t }) => [j(e.$slots, "item", { item: t })]),
277
+ key: "0"
278
+ } : void 0]), 1032, ["items", "highlighted-value"])]),
279
+ _: 3
280
+ })], 38)) : g("", !0)]),
241
281
  _: 3
242
282
  })], 8, ["to", "disabled"]))], 16));
243
283
  }
244
284
  });
245
285
  //#endregion
246
- export { U as MDropdown };
286
+ export { G as MDropdown };