morya-ui 0.2.3 → 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 (180) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/FlyoutSubmenu-BC_cl17_.js +49 -0
  3. package/dist/ScrollBody-CXFNhBvq.js +68 -0
  4. package/dist/accordion/style.css +625 -583
  5. package/dist/auto-complete/style.css +625 -583
  6. package/dist/avatar/style.css +625 -583
  7. package/dist/badge/style.css +625 -583
  8. package/dist/block-ui/style.css +625 -583
  9. package/dist/breadcrumb/style.css +625 -583
  10. package/dist/button/style.css +625 -583
  11. package/dist/card/style.css +625 -583
  12. package/dist/carousel/style.css +625 -583
  13. package/dist/cascade-select/style.css +625 -583
  14. package/dist/checkbox/style.css +625 -583
  15. package/dist/chip/style.css +625 -583
  16. package/dist/command-menu/style.css +625 -583
  17. package/dist/components/ContextMenu/ContextMenu.vue.d.ts.map +1 -1
  18. package/dist/components/ContextMenu/ContextMenuNodes.vue.d.ts.map +1 -1
  19. package/dist/components/ContextMenu/styles.css +33 -4
  20. package/dist/components/Dropdown/Dropdown.vue.d.ts +2 -2
  21. package/dist/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
  22. package/dist/components/Dropdown/DropdownNodes.vue.d.ts +2 -2
  23. package/dist/components/Dropdown/DropdownNodes.vue.d.ts.map +1 -1
  24. package/dist/components/Dropdown/styles.css +11 -0
  25. package/dist/components/Gallery/Gallery.vue.d.ts +2 -2
  26. package/dist/components/Gallery/Gallery.vue.d.ts.map +1 -1
  27. package/dist/components/Gallery/styles.css +5 -1
  28. package/dist/components/Layout/Layout.vue.d.ts +3 -3
  29. package/dist/components/Layout/Layout.vue.d.ts.map +1 -1
  30. package/dist/components/Layout/LayoutContent.vue.d.ts +2 -2
  31. package/dist/components/Layout/LayoutContent.vue.d.ts.map +1 -1
  32. package/dist/components/Layout/LayoutScrollContext.vue.d.ts +20 -0
  33. package/dist/components/Layout/LayoutScrollContext.vue.d.ts.map +1 -0
  34. package/dist/components/Layout/LayoutScrollRegion.vue.d.ts +34 -0
  35. package/dist/components/Layout/LayoutScrollRegion.vue.d.ts.map +1 -0
  36. package/dist/components/Layout/LayoutSider.vue.d.ts +2 -2
  37. package/dist/components/Layout/LayoutSider.vue.d.ts.map +1 -1
  38. package/dist/components/Layout/composables/useLayoutScroll.d.ts +4 -1
  39. package/dist/components/Layout/composables/useLayoutScroll.d.ts.map +1 -1
  40. package/dist/components/Layout/styles.css +31 -13
  41. package/dist/components/Menu/Menu.vue.d.ts.map +1 -1
  42. package/dist/components/Menu/styles.css +10 -0
  43. package/dist/components/Menubar/Menubar.vue.d.ts +2 -2
  44. package/dist/components/Menubar/Menubar.vue.d.ts.map +1 -1
  45. package/dist/components/Menubar/styles.css +14 -0
  46. package/dist/components/OrderList/OrderList.vue.d.ts +4 -4
  47. package/dist/components/OrderList/OrderList.vue.d.ts.map +1 -1
  48. package/dist/components/PickList/PickList.vue.d.ts +7 -7
  49. package/dist/components/PickList/PickList.vue.d.ts.map +1 -1
  50. package/dist/components/ScrollTop/ScrollTop.vue.d.ts.map +1 -1
  51. package/dist/components/Tabs/Tabs.vue.d.ts +3 -3
  52. package/dist/components/Tabs/Tabs.vue.d.ts.map +1 -1
  53. package/dist/components/Tabs/styles.css +72 -77
  54. package/dist/components/Terminal/Terminal.vue.d.ts.map +1 -1
  55. package/dist/components/Terminal/styles.css +6 -2
  56. package/dist/components/TieredMenu/TieredMenu.vue.d.ts.map +1 -1
  57. package/dist/components/TieredMenu/styles.css +33 -4
  58. package/dist/components/Timeline/Timeline.vue.d.ts +35 -10
  59. package/dist/components/Timeline/Timeline.vue.d.ts.map +1 -1
  60. package/dist/components/Timeline/styles.css +159 -156
  61. package/dist/components/TreeSelect/TreeSelect.vue.d.ts.map +1 -1
  62. package/dist/components/TreeSelect/styles.css +15 -0
  63. package/dist/components/TreeTable/TreeTable.vue.d.ts +2 -2
  64. package/dist/components/TreeTable/TreeTable.vue.d.ts.map +1 -1
  65. package/dist/components/TreeTable/styles.css +64 -61
  66. package/dist/components/VirtualScroller/VirtualScroller.vue.d.ts +2 -2
  67. package/dist/components/VirtualScroller/VirtualScroller.vue.d.ts.map +1 -1
  68. package/dist/components/VirtualScroller/styles.css +20 -17
  69. package/dist/config-provider/style.css +625 -583
  70. package/dist/confirm-dialog/style.css +625 -583
  71. package/dist/confirm-popup/style.css +625 -583
  72. package/dist/context-menu/index.js +131 -89
  73. package/dist/context-menu/style.css +781 -587
  74. package/dist/context-menu/style.js +1 -0
  75. package/dist/data-view/style.css +625 -583
  76. package/dist/date-picker/style.css +625 -583
  77. package/dist/dialog/style.css +625 -583
  78. package/dist/divider/style.css +625 -583
  79. package/dist/dock/style.css +625 -583
  80. package/dist/drawer/style.css +625 -583
  81. package/dist/dropdown/index.js +162 -122
  82. package/dist/dropdown/style.css +759 -583
  83. package/dist/dropdown/style.js +1 -0
  84. package/dist/fieldset/style.css +625 -583
  85. package/dist/file-upload/style.css +625 -583
  86. package/dist/flex/style.css +625 -583
  87. package/dist/float-label/style.css +625 -583
  88. package/dist/fluid/style.css +625 -583
  89. package/dist/form/style.css +625 -583
  90. package/dist/gallery/index.js +76 -67
  91. package/dist/gallery/style.css +753 -584
  92. package/dist/gallery/style.js +1 -0
  93. package/dist/grid/style.css +625 -583
  94. package/dist/icon/style.css +625 -583
  95. package/dist/icon-field/style.css +625 -583
  96. package/dist/index.js +1925 -1474
  97. package/dist/inplace/style.css +625 -583
  98. package/dist/input/style.css +625 -583
  99. package/dist/input-color/style.css +625 -583
  100. package/dist/input-group/style.css +625 -583
  101. package/dist/input-number/style.css +625 -583
  102. package/dist/input-otp/style.css +625 -583
  103. package/dist/input-password/style.css +625 -583
  104. package/dist/input-tags/style.css +625 -583
  105. package/dist/knob/style.css +625 -583
  106. package/dist/label/style.css +625 -583
  107. package/dist/layout/index.js +230 -136
  108. package/dist/layout/style.css +779 -596
  109. package/dist/layout/style.js +1 -0
  110. package/dist/listbox/style.css +625 -583
  111. package/dist/mega-menu/style.css +625 -583
  112. package/dist/menu/index.js +233 -216
  113. package/dist/menu/style.css +758 -583
  114. package/dist/menu/style.js +1 -0
  115. package/dist/menubar/index.js +77 -68
  116. package/dist/menubar/style.css +762 -583
  117. package/dist/menubar/style.js +1 -0
  118. package/dist/message/style.css +625 -583
  119. package/dist/meter-group/style.css +625 -583
  120. package/dist/order-list/index.js +66 -58
  121. package/dist/order-list/style.css +625 -583
  122. package/dist/page/style.css +625 -583
  123. package/dist/pagination/style.css +625 -583
  124. package/dist/panel/style.css +625 -583
  125. package/dist/pick-list/index.js +97 -84
  126. package/dist/pick-list/style.css +625 -583
  127. package/dist/popover/style.css +625 -583
  128. package/dist/progress-bar/style.css +625 -583
  129. package/dist/progress-spinner/style.css +625 -583
  130. package/dist/radio/style.css +625 -583
  131. package/dist/rating/style.css +625 -583
  132. package/dist/scroll-top/index.js +23 -13
  133. package/dist/scroll-top/style.css +748 -583
  134. package/dist/scroll-top/style.js +1 -0
  135. package/dist/scrollbar/style.css +625 -583
  136. package/dist/select/style.css +625 -583
  137. package/dist/select-button/style.css +625 -583
  138. package/dist/shared/FlyoutSubmenu.vue.d.ts +32 -0
  139. package/dist/shared/FlyoutSubmenu.vue.d.ts.map +1 -0
  140. package/dist/shared/ScrollBody.vue.d.ts +39 -0
  141. package/dist/shared/ScrollBody.vue.d.ts.map +1 -0
  142. package/dist/sidebar/style.css +625 -583
  143. package/dist/skeleton/style.css +625 -583
  144. package/dist/slider/style.css +625 -583
  145. package/dist/space/style.css +625 -583
  146. package/dist/speed-dial/style.css +625 -583
  147. package/dist/split-button/style.css +625 -583
  148. package/dist/splitter/style.css +625 -583
  149. package/dist/stepper/style.css +625 -583
  150. package/dist/styles/base.css +625 -583
  151. package/dist/styles.css +1 -1
  152. package/dist/switch/style.css +625 -583
  153. package/dist/table/style.css +625 -583
  154. package/dist/tabs/index.js +92 -81
  155. package/dist/tabs/style.css +818 -658
  156. package/dist/tabs/style.js +1 -0
  157. package/dist/tag/style.css +625 -583
  158. package/dist/terminal/index.js +47 -40
  159. package/dist/terminal/style.css +631 -585
  160. package/dist/textarea/style.css +625 -583
  161. package/dist/tiered-menu/index.js +130 -84
  162. package/dist/tiered-menu/style.css +781 -587
  163. package/dist/tiered-menu/style.js +1 -0
  164. package/dist/timeline/index.js +82 -37
  165. package/dist/timeline/style.css +907 -739
  166. package/dist/timeline/style.js +1 -0
  167. package/dist/toast/style.css +625 -583
  168. package/dist/toggle-button/style.css +625 -583
  169. package/dist/toolbar/style.css +625 -583
  170. package/dist/tooltip/style.css +625 -583
  171. package/dist/tree/style.css +625 -583
  172. package/dist/tree-select/index.js +202 -193
  173. package/dist/tree-select/style.css +763 -583
  174. package/dist/tree-select/style.js +1 -0
  175. package/dist/tree-table/index.js +57 -50
  176. package/dist/tree-table/style.css +689 -644
  177. package/dist/virtual-scroller/index.js +38 -34
  178. package/dist/virtual-scroller/style.css +775 -607
  179. package/dist/virtual-scroller/style.js +1 -0
  180. package/package.json +1 -1
@@ -4,27 +4,28 @@ import { t as n } from "../useMId-BXFYayPP.js";
4
4
  import { n as r, t as i } from "../overlay-oR-5MDuE.js";
5
5
  import { t as ee } from "../overlayPlacement-Cd20JTD_.js";
6
6
  import { t as te } from "../useMenuKeyboard-BedmYE4W.js";
7
+ import { t as ne } from "../Scrollbar-DoNZvgX2.js";
7
8
  import { t as a } from "../Checkbox-BjtAYUUD.js";
8
- import { t as ne } from "../useFieldFeedback-C5qIqYMK.js";
9
- import { a as re, i as o, n as ie, o as ae, r as s, s as oe } from "../checkStrategy-CZzuUKDI.js";
10
- import { c as se, o as ce } from "../config-CI8_WBbE.js";
11
- import { n as le } from "../locale-DYGhxekd.js";
9
+ import { t as re } from "../useFieldFeedback-C5qIqYMK.js";
10
+ import { a as ie, i as ae, n as oe, o as se, r as o, s as ce } from "../checkStrategy-CZzuUKDI.js";
11
+ import { c as le, o as ue } from "../config-CI8_WBbE.js";
12
+ import { n as de } from "../locale-DYGhxekd.js";
12
13
  import "./style.js";
13
- import { Fragment as c, Teleport as ue, Transition as de, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineComponent as g, mergeProps as fe, nextTick as pe, normalizeClass as _, normalizeStyle as me, onBeforeUnmount as he, openBlock as v, ref as y, renderList as b, renderSlot as ge, resolveDynamicComponent as x, toDisplayString as S, unref as C, useAttrs as _e, useSlots as ve, vModelText as ye, watch as be, withCtx as xe, withDirectives as Se, withModifiers as w } from "vue";
14
+ import { Fragment as s, Teleport as fe, Transition as pe, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, mergeProps as me, nextTick as he, normalizeClass as g, normalizeStyle as ge, onBeforeUnmount as _e, openBlock as _, ref as v, renderList as y, renderSlot as ve, resolveDynamicComponent as b, toDisplayString as x, unref as S, useAttrs as ye, useSlots as be, vModelText as xe, watch as Se, withCtx as Ce, withDirectives as we, withModifiers as C } from "vue";
14
15
  //#region src/components/TreeSelect/TreeSelectNodeItem.vue?vue&type=script&setup=true&lang.ts
15
- var Ce = [
16
+ var w = [
16
17
  "aria-expanded",
17
18
  "aria-level",
18
19
  "aria-disabled",
19
20
  "aria-selected",
20
21
  "aria-checked"
21
- ], T = ["aria-label"], E = {
22
+ ], T = ["aria-label"], Te = {
22
23
  key: 1,
23
24
  class: "m-treeselect__toggler-spacer"
24
- }, D = ["disabled", "tabindex"], O = {
25
+ }, E = ["disabled", "tabindex"], D = {
25
26
  key: 0,
26
27
  role: "group"
27
- }, k = /* @__PURE__ */ g({
28
+ }, O = /* @__PURE__ */ h({
28
29
  __name: "TreeSelectNodeItem",
29
30
  props: {
30
31
  node: {},
@@ -42,47 +43,47 @@ var Ce = [
42
43
  "check"
43
44
  ],
44
45
  setup(e) {
45
- let n = le();
46
- return (r, i) => (v(), f("li", {
47
- class: _(["m-treeselect__node", { "m-treeselect__node--active": e.node.key === e.activeKey }]),
46
+ let n = de();
47
+ return (r, i) => (_(), d("li", {
48
+ class: g(["m-treeselect__node", { "m-treeselect__node--active": e.node.key === e.activeKey }]),
48
49
  role: "treeitem",
49
50
  "aria-expanded": e.node.children?.length ? !!e.expanded[e.node.key] : void 0,
50
51
  "aria-level": e.depth + 1,
51
52
  "aria-disabled": e.node.disabled || void 0,
52
53
  "aria-selected": e.showCheckbox ? void 0 : e.selectedKeys.includes(e.node.key),
53
54
  "aria-checked": e.showCheckbox ? !!e.checkedKeys[e.node.key] : void 0
54
- }, [p("div", {
55
+ }, [f("div", {
55
56
  class: "m-treeselect__row",
56
- style: me({ paddingLeft: `${e.depth * .75}rem` })
57
+ style: ge({ paddingLeft: `${e.depth * .75}rem` })
57
58
  }, [
58
- e.node.children?.length ? (v(), f("button", {
59
+ e.node.children?.length ? (_(), d("button", {
59
60
  key: 0,
60
61
  type: "button",
61
62
  class: "m-treeselect__toggler",
62
63
  tabindex: "-1",
63
- "aria-label": e.expanded[e.node.key] ? C(n).collapse : C(n).expand,
64
- onClick: i[0] ||= w((t) => r.$emit("toggle", e.node.key), ["stop"])
65
- }, [h(t, {
64
+ "aria-label": e.expanded[e.node.key] ? S(n).collapse : S(n).expand,
65
+ onClick: i[0] ||= C((t) => r.$emit("toggle", e.node.key), ["stop"])
66
+ }, [m(t, {
66
67
  name: e.expanded[e.node.key] ? "chevron-down" : "chevron-right",
67
68
  size: "sm"
68
- }, null, 8, ["name"])], 8, T)) : (v(), f("span", E)),
69
- e.showCheckbox ? (v(), u(a, {
69
+ }, null, 8, ["name"])], 8, T)) : (_(), d("span", Te)),
70
+ e.showCheckbox ? (_(), l(a, {
70
71
  key: 2,
71
72
  class: "m-treeselect__checkbox",
72
73
  tabindex: "-1",
73
74
  "model-value": !!e.checkedKeys[e.node.key],
74
75
  disabled: e.node.disabled,
75
76
  "onUpdate:modelValue": i[1] ||= (t) => r.$emit("check", e.node),
76
- onClick: i[2] ||= w(() => {}, ["stop"])
77
- }, null, 8, ["model-value", "disabled"])) : d("", !0),
78
- p("button", {
77
+ onClick: i[2] ||= C(() => {}, ["stop"])
78
+ }, null, 8, ["model-value", "disabled"])) : u("", !0),
79
+ f("button", {
79
80
  type: "button",
80
- class: _(["m-treeselect__option", { "m-treeselect__option--selected": e.selectedKeys.includes(e.node.key) }]),
81
+ class: g(["m-treeselect__option", { "m-treeselect__option--selected": e.selectedKeys.includes(e.node.key) }]),
81
82
  disabled: e.node.disabled,
82
83
  tabindex: e.node.key === e.activeKey ? 0 : -1,
83
84
  onClick: i[3] ||= (t) => r.$emit("select", e.node)
84
- }, [e.renderOption ? (v(), u(x(() => e.renderOption?.(e.node)), { key: 0 })) : (v(), f(c, { key: 1 }, [m(S(e.node.label), 1)], 64))], 10, D)
85
- ], 4), e.node.children?.length && e.expanded[e.node.key] ? (v(), f("ul", O, [(v(!0), f(c, null, b(e.node.children, (t) => (v(), u(k, {
85
+ }, [e.renderOption ? (_(), l(b(() => e.renderOption?.(e.node)), { key: 0 })) : (_(), d(s, { key: 1 }, [p(x(e.node.label), 1)], 64))], 10, E)
86
+ ], 4), e.node.children?.length && e.expanded[e.node.key] ? (_(), d("ul", D, [(_(!0), d(s, null, y(e.node.children, (t) => (_(), l(O, {
86
87
  key: t.key,
87
88
  node: t,
88
89
  depth: e.depth + 1,
@@ -104,9 +105,9 @@ var Ce = [
104
105
  "show-checkbox",
105
106
  "active-key",
106
107
  "render-option"
107
- ]))), 128))])) : d("", !0)], 10, Ce));
108
+ ]))), 128))])) : u("", !0)], 10, w));
108
109
  }
109
- }), we = ["for"], Te = [
110
+ }), Ee = ["for"], De = [
110
111
  "id",
111
112
  "tabindex",
112
113
  "aria-disabled",
@@ -114,20 +115,20 @@ var Ce = [
114
115
  "aria-controls",
115
116
  "aria-invalid",
116
117
  "aria-describedby"
117
- ], Ee = {
118
+ ], Oe = {
118
119
  key: 0,
119
120
  class: "m-treeselect__tags"
120
- }, De = { class: "m-select__tag-label" }, Oe = [
121
+ }, ke = { class: "m-select__tag-label" }, Ae = [
121
122
  "aria-label",
122
123
  "disabled",
123
124
  "onClick"
124
- ], ke = {
125
+ ], je = {
125
126
  key: 0,
126
127
  class: "m-select__tag m-select__tag--more"
127
- }, Ae = { class: "m-select__suffix" }, je = ["aria-label"], Me = ["id"], Ne = ["placeholder"], Pe = {
128
+ }, Me = { class: "m-select__suffix" }, Ne = ["aria-label"], Pe = ["id"], Fe = ["placeholder"], Ie = {
128
129
  class: "m-treeselect__tree",
129
130
  role: "tree"
130
- }, Fe = ["id", "role"], A = /* @__PURE__ */ g({
131
+ }, Le = ["id", "role"], k = /* @__PURE__ */ h({
131
132
  inheritAttrs: !1,
132
133
  __name: "TreeSelect",
133
134
  props: {
@@ -184,31 +185,31 @@ var Ce = [
184
185
  name: {}
185
186
  },
186
187
  emits: ["update:modelValue", "clear"],
187
- setup(a, { emit: m }) {
188
- let g = a, x = m, Ce = _e(), { rootAttrs: T, controlAttrs: E } = e(Ce, () => g.pt, { controlKey: "control" }), D = ve(), O = se(), A = le(), Ie = ce("TreeSelect", () => g.size), Le = n("m-treeselect"), j = l(() => g.id ?? Le), { isInvalid: M, feedbackText: N, feedbackIsError: P } = ne(g), F = y(!1), I = y(""), L = y(null), R = y(null), z = y(null), Re = y({}), B = y({}), ze = l(() => r(g, O.value.appendTo)), V = l(() => i(g, O.value.appendTo)), H = l(() => g.multiple || g.selectionMode === "multiple" || g.checkable), U = l(() => Array.isArray(g.modelValue) ? g.modelValue : typeof g.modelValue == "string" && g.modelValue ? [g.modelValue] : []), Be = l(() => {
188
+ setup(a, { emit: p }) {
189
+ let h = a, b = p, w = ye(), { rootAttrs: T, controlAttrs: Te } = e(w, () => h.pt, { controlKey: "control" }), E = be(), D = le(), k = de(), Re = ue("TreeSelect", () => h.size), ze = n("m-treeselect"), A = c(() => h.id ?? ze), { isInvalid: j, feedbackText: M, feedbackIsError: Be } = re(h), N = v(!1), P = v(""), F = v(null), I = v(null), L = v(null), Ve = v({}), R = v({}), He = c(() => r(h, D.value.appendTo)), z = c(() => i(h, D.value.appendTo)), B = c(() => h.multiple || h.selectionMode === "multiple" || h.checkable), V = c(() => Array.isArray(h.modelValue) ? h.modelValue : typeof h.modelValue == "string" && h.modelValue ? [h.modelValue] : []), Ue = c(() => {
189
190
  let e = {};
190
- for (let t of U.value) e[t] = !0;
191
+ for (let t of V.value) e[t] = !0;
191
192
  return e;
192
- }), Ve = l(() => ie(g.options, Be.value, g.checkStrategy, g.checkStrictly)), He = l(() => {
193
- let e = U.value[0];
194
- if (!e || H.value) return g.placeholder ?? A.value.selectPlaceholder;
195
- if (g.showPath) {
196
- let t = o(g.options, e);
197
- return t.length ? t.join(g.separator) : e;
193
+ }), H = c(() => oe(h.options, Ue.value, h.checkStrategy, h.checkStrictly)), We = c(() => {
194
+ let e = V.value[0];
195
+ if (!e || B.value) return h.placeholder ?? k.value.selectPlaceholder;
196
+ if (h.showPath) {
197
+ let t = ae(h.options, e);
198
+ return t.length ? t.join(h.separator) : e;
198
199
  }
199
- return s(g.options, e)?.label ?? g.placeholder ?? A.value.selectPlaceholder;
200
- }), Ue = l(() => {
201
- let e = U.value[0];
202
- return e && !H.value ? s(g.options, e) : void 0;
203
- }), We = l(() => D.option ? (e) => D.option?.({ option: e }) : void 0), W = l(() => U.value.map((e) => ({
200
+ return o(h.options, e)?.label ?? h.placeholder ?? k.value.selectPlaceholder;
201
+ }), U = c(() => {
202
+ let e = V.value[0];
203
+ return e && !B.value ? o(h.options, e) : void 0;
204
+ }), Ge = c(() => E.option ? (e) => E.option?.({ option: e }) : void 0), W = c(() => V.value.map((e) => ({
204
205
  key: e,
205
- label: g.showPath ? o(g.options, e).join(g.separator) : s(g.options, e)?.label ?? e
206
- }))), Ge = l(() => {
207
- let e = g.maxTagCount;
206
+ label: h.showPath ? ae(h.options, e).join(h.separator) : o(h.options, e)?.label ?? e
207
+ }))), Ke = c(() => {
208
+ let e = h.maxTagCount;
208
209
  return e == null || e < 0 || W.value.length <= e ? W.value : W.value.slice(0, e);
209
- }), G = l(() => Math.max(0, W.value.length - Ge.value.length)), Ke = l(() => g.clearable && U.value.length > 0 && !g.disabled), qe = l(() => {
210
- let e = I.value.trim().toLowerCase();
211
- if (!e) return g.options;
210
+ }), G = c(() => Math.max(0, W.value.length - Ke.value.length)), qe = c(() => h.clearable && V.value.length > 0 && !h.disabled), Je = c(() => {
211
+ let e = P.value.trim().toLowerCase();
212
+ if (!e) return h.options;
212
213
  let t = (n) => {
213
214
  let r = n.label.toLowerCase().includes(e), i = (n.children ?? []).map(t).filter((e) => e != null);
214
215
  return r || i.length ? {
@@ -216,62 +217,62 @@ var Ce = [
216
217
  children: i.length ? i : n.children
217
218
  } : null;
218
219
  };
219
- return g.options.map(t).filter((e) => e != null);
220
- }), K = l(() => {
220
+ return h.options.map(t).filter((e) => e != null);
221
+ }), K = c(() => {
221
222
  let e = [], t = (n, r) => {
222
223
  for (let i of n) e.push({
223
224
  node: i,
224
225
  parentKey: r
225
- }), i.children?.length && B.value[i.key] && t(i.children, i.key);
226
+ }), i.children?.length && R.value[i.key] && t(i.children, i.key);
226
227
  };
227
- return t(qe.value, null), e;
228
- }), Je = n("m-treeselect-panel"), q = te({
228
+ return t(Je.value, null), e;
229
+ }), Ye = n("m-treeselect-panel"), q = te({
229
230
  itemCount: () => K.value.length,
230
231
  isItemDisabled: (e) => !!K.value[e]?.node.disabled,
231
- enabled: F,
232
+ enabled: N,
232
233
  onActivate: (e) => {
233
234
  let t = K.value[e];
234
- t && nt(t.node);
235
+ t && rt(t.node);
235
236
  },
236
237
  onEscape: () => {
237
- F.value = !1;
238
+ N.value = !1;
238
239
  },
239
- returnFocusTo: R
240
- }), Ye = l(() => K.value[q.activeIndex.value]?.node.key ?? null);
241
- function Xe() {
240
+ returnFocusTo: I
241
+ }), Xe = c(() => K.value[q.activeIndex.value]?.node.key ?? null);
242
+ function Ze() {
242
243
  let e = q.activeIndex.value;
243
244
  if (e < 0) return;
244
- let t = z.value?.querySelectorAll(".m-treeselect__option")?.[e];
245
+ let t = L.value?.querySelectorAll(".m-treeselect__option")?.[e];
245
246
  t && document.activeElement !== t && t.focus({ preventScroll: !0 }), t?.scrollIntoView({ block: "nearest" });
246
247
  }
247
- function Ze() {
248
- if (!V.value || !R.value) return;
249
- let e = R.value.getBoundingClientRect();
250
- Re.value = ee(e, "bottom-start", { minWidth: `${e.width}px` });
251
- }
252
248
  function Qe() {
253
- F.value = !0, pe(() => {
254
- Ze();
255
- let e = K.value.findIndex((e) => U.value.includes(e.node.key));
256
- e >= 0 ? q.setActive(e) : q.moveFirst(), g.filterable ? z.value?.querySelector(".m-treeselect__filter")?.focus() : Xe();
257
- });
249
+ if (!z.value || !I.value) return;
250
+ let e = I.value.getBoundingClientRect();
251
+ Ve.value = ee(e, "bottom-start", { minWidth: `${e.width}px` });
258
252
  }
259
253
  function $e() {
260
- if (!g.disabled) {
261
- if (F.value) {
262
- F.value = !1;
254
+ N.value = !0, he(() => {
255
+ Qe();
256
+ let e = K.value.findIndex((e) => V.value.includes(e.node.key));
257
+ e >= 0 ? q.setActive(e) : q.moveFirst(), h.filterable ? L.value?.querySelector(".m-treeselect__filter")?.focus() : Ze();
258
+ });
259
+ }
260
+ function et() {
261
+ if (!h.disabled) {
262
+ if (N.value) {
263
+ N.value = !1;
263
264
  return;
264
265
  }
265
- Qe();
266
+ $e();
266
267
  }
267
268
  }
268
269
  function J(e) {
269
- if (!F.value) return;
270
+ if (!N.value) return;
270
271
  let t = K.value, n = t[q.activeIndex.value];
271
272
  if (e.key === "ArrowRight") {
272
273
  if (e.preventDefault(), !n) return;
273
274
  if (n.node.children?.length) {
274
- if (!B.value[n.node.key]) Y(n.node.key);
275
+ if (!R.value[n.node.key]) Y(n.node.key);
275
276
  else {
276
277
  let e = t.findIndex((e) => e.parentKey === n.node.key);
277
278
  e >= 0 && q.setActive(e);
@@ -281,7 +282,7 @@ var Ce = [
281
282
  }
282
283
  if (e.key === "ArrowLeft") {
283
284
  if (e.preventDefault(), !n) return;
284
- if (n.node.children?.length && B.value[n.node.key]) Y(n.node.key);
285
+ if (n.node.children?.length && R.value[n.node.key]) Y(n.node.key);
285
286
  else if (n.parentKey != null) {
286
287
  let e = t.findIndex((e) => e.node.key === n.parentKey);
287
288
  e >= 0 && q.setActive(e);
@@ -290,16 +291,16 @@ var Ce = [
290
291
  }
291
292
  q.onKeydown(e);
292
293
  }
293
- function et(e) {
294
- if (!g.disabled) {
295
- if (!F.value) {
296
- e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), Qe()) : e.key === "Enter" && (e.preventDefault(), $e());
294
+ function tt(e) {
295
+ if (!h.disabled) {
296
+ if (!N.value) {
297
+ e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), $e()) : e.key === "Enter" && (e.preventDefault(), et());
297
298
  return;
298
299
  }
299
300
  J(e);
300
301
  }
301
302
  }
302
- function tt(e) {
303
+ function nt(e) {
303
304
  [
304
305
  "ArrowUp",
305
306
  "ArrowDown",
@@ -307,177 +308,185 @@ var Ce = [
307
308
  "Escape"
308
309
  ].includes(e.key) && J(e);
309
310
  }
310
- be(q.activeIndex, () => {
311
- if (F.value && !g.filterable) Xe();
312
- else if (F.value) {
311
+ Se(q.activeIndex, () => {
312
+ if (N.value && !h.filterable) Ze();
313
+ else if (N.value) {
313
314
  let e = q.activeIndex.value;
314
- z.value?.querySelectorAll(".m-treeselect__option")[e]?.scrollIntoView({ block: "nearest" });
315
+ L.value?.querySelectorAll(".m-treeselect__option")[e]?.scrollIntoView({ block: "nearest" });
315
316
  }
316
317
  });
317
318
  function Y(e) {
318
- B.value = {
319
- ...B.value,
320
- [e]: !B.value[e]
319
+ R.value = {
320
+ ...R.value,
321
+ [e]: !R.value[e]
321
322
  };
322
323
  }
323
324
  function X(e) {
324
- H.value ? x("update:modelValue", e) : x("update:modelValue", e[0] ?? null);
325
+ B.value ? b("update:modelValue", e) : b("update:modelValue", e[0] ?? null);
325
326
  }
326
- function nt(e) {
327
+ function rt(e) {
327
328
  if (!e.disabled) {
328
- if (g.checkable) {
329
- rt(e);
329
+ if (h.checkable) {
330
+ it(e);
330
331
  return;
331
332
  }
332
- if (!H.value) {
333
- x("update:modelValue", e.key === g.modelValue ? null : e.key), F.value = !1, R.value?.focus({ preventScroll: !0 });
333
+ if (!B.value) {
334
+ b("update:modelValue", e.key === h.modelValue ? null : e.key), N.value = !1, I.value?.focus({ preventScroll: !0 });
334
335
  return;
335
336
  }
336
- X(U.value.includes(e.key) ? U.value.filter((t) => t !== e.key) : [...U.value, e.key]);
337
+ X(V.value.includes(e.key) ? V.value.filter((t) => t !== e.key) : [...V.value, e.key]);
337
338
  }
338
339
  }
339
- function rt(e) {
340
+ function it(e) {
340
341
  if (e.disabled) return;
341
- let t = { ...Ve.value }, n = !t[e.key];
342
- g.checkStrictly ? n ? t[e.key] = !0 : delete t[e.key] : (ae(e, n, t), oe(g.options, t));
343
- let r = re(g.options, t, g.checkStrategy, g.checkStrictly);
342
+ let t = { ...H.value }, n = !t[e.key];
343
+ h.checkStrictly ? n ? t[e.key] = !0 : delete t[e.key] : (se(e, n, t), ce(h.options, t));
344
+ let r = ie(h.options, t, h.checkStrategy, h.checkStrictly);
344
345
  X(Object.keys(r).filter((e) => r[e]));
345
346
  }
346
- function it(e) {
347
- X(U.value.filter((t) => t !== e));
348
- }
349
347
  function at(e) {
350
- e.stopPropagation(), x("update:modelValue", H.value ? [] : null), x("clear");
348
+ X(V.value.filter((t) => t !== e));
349
+ }
350
+ function ot(e) {
351
+ e.stopPropagation(), b("update:modelValue", B.value ? [] : null), b("clear");
351
352
  }
352
353
  function Z(e) {
353
354
  let t = e.target;
354
- L.value?.contains(t) || z.value?.contains(t) || (F.value = !1);
355
+ F.value?.contains(t) || L.value?.contains(t) || (N.value = !1);
355
356
  }
356
357
  function Q(e) {
357
358
  let t = e.target;
358
- L.value?.contains(t) || z.value?.contains(t) || (F.value = !1);
359
+ F.value?.contains(t) || L.value?.contains(t) || (N.value = !1);
359
360
  }
360
361
  function $() {
361
- F.value && Ze();
362
+ N.value && Qe();
362
363
  }
363
- return be(F, (e) => {
364
- e ? (document.addEventListener("click", Z), document.addEventListener("focusin", Q), V.value && (window.addEventListener("resize", $), window.addEventListener("scroll", $, !0))) : (I.value = "", q.reset(), document.removeEventListener("click", Z), document.removeEventListener("focusin", Q), window.removeEventListener("resize", $), window.removeEventListener("scroll", $, !0));
365
- }), he(() => {
364
+ return Se(N, (e) => {
365
+ e ? (document.addEventListener("click", Z), document.addEventListener("focusin", Q), z.value && (window.addEventListener("resize", $), window.addEventListener("scroll", $, !0))) : (P.value = "", q.reset(), document.removeEventListener("click", Z), document.removeEventListener("focusin", Q), window.removeEventListener("resize", $), window.removeEventListener("scroll", $, !0));
366
+ }), _e(() => {
366
367
  document.removeEventListener("click", Z), document.removeEventListener("focusin", Q), window.removeEventListener("resize", $), window.removeEventListener("scroll", $, !0);
367
- }), (e, n) => (v(), f("div", fe({
368
+ }), (e, n) => (_(), d("div", me({
368
369
  ref_key: "root",
369
- ref: L
370
- }, C(T), { class: "m-select-field" }), [
371
- a.label ? (v(), f("label", {
370
+ ref: F
371
+ }, S(T), { class: "m-select-field" }), [
372
+ a.label ? (_(), d("label", {
372
373
  key: 0,
373
374
  class: "m-select-field__label",
374
- for: j.value
375
- }, S(a.label), 9, we)) : d("", !0),
376
- p("div", { class: _(["m-treeselect", [`m-treeselect--${C(Ie)}`, {
375
+ for: A.value
376
+ }, x(a.label), 9, Ee)) : u("", !0),
377
+ f("div", { class: g(["m-treeselect", [`m-treeselect--${S(Re)}`, {
377
378
  "m-treeselect--disabled": a.disabled,
378
- "m-treeselect--open": F.value,
379
- "m-treeselect--multiple": H.value,
380
- "m-treeselect--invalid": C(M)
381
- }]]) }, [p("div", { class: _(["m-treeselect__control m-select__control", {
382
- "m-select__control--clearable": Ke.value,
383
- "m-select__control--open": F.value
384
- }]) }, [p("div", fe(C(E), {
385
- id: j.value,
379
+ "m-treeselect--open": N.value,
380
+ "m-treeselect--multiple": B.value,
381
+ "m-treeselect--invalid": S(j)
382
+ }]]) }, [f("div", { class: g(["m-treeselect__control m-select__control", {
383
+ "m-select__control--clearable": qe.value,
384
+ "m-select__control--open": N.value
385
+ }]) }, [f("div", me(S(Te), {
386
+ id: A.value,
386
387
  ref_key: "trigger",
387
- ref: R,
388
+ ref: I,
388
389
  class: "m-treeselect__trigger",
389
390
  role: "combobox",
390
391
  tabindex: a.disabled ? -1 : 0,
391
392
  "aria-disabled": a.disabled || void 0,
392
- "aria-expanded": F.value,
393
- "aria-controls": F.value ? C(Je) : void 0,
394
- "aria-invalid": C(M) || void 0,
395
- "aria-describedby": C(N) ? `${j.value}-help` : void 0,
393
+ "aria-expanded": N.value,
394
+ "aria-controls": N.value ? S(Ye) : void 0,
395
+ "aria-invalid": S(j) || void 0,
396
+ "aria-describedby": S(M) ? `${A.value}-help` : void 0,
396
397
  "aria-haspopup": "tree",
397
- onClick: $e,
398
- onKeydown: et
399
- }), [H.value && W.value.length ? (v(), f("div", Ee, [(v(!0), f(c, null, b(Ge.value, (e) => (v(), f("span", {
398
+ onClick: et,
399
+ onKeydown: tt
400
+ }), [B.value && W.value.length ? (_(), d("div", Oe, [(_(!0), d(s, null, y(Ke.value, (e) => (_(), d("span", {
400
401
  key: e.key,
401
402
  class: "m-select__tag"
402
- }, [p("span", De, S(e.label), 1), p("button", {
403
+ }, [f("span", ke, x(e.label), 1), f("button", {
403
404
  type: "button",
404
405
  class: "m-select__tag-remove",
405
- "aria-label": C(A).removeTag,
406
+ "aria-label": S(k).removeTag,
406
407
  disabled: a.disabled,
407
- onClick: w((t) => it(e.key), ["stop"])
408
- }, [h(t, {
408
+ onClick: C((t) => at(e.key), ["stop"])
409
+ }, [m(t, {
409
410
  name: "close",
410
411
  size: "sm"
411
- })], 8, Oe)]))), 128)), G.value ? (v(), f("span", ke, S(G.value > 0 ? `+${G.value}` : ""), 1)) : d("", !0)])) : C(D).value && Ue.value ? ge(e.$slots, "value", { option: Ue.value }, void 0, void 0, 2) : (v(), f("span", {
412
+ })], 8, Ae)]))), 128)), G.value ? (_(), d("span", je, x(G.value > 0 ? `+${G.value}` : ""), 1)) : u("", !0)])) : S(E).value && U.value ? ve(e.$slots, "value", { option: U.value }, void 0, void 0, 2) : (_(), d("span", {
412
413
  key: 1,
413
- class: _(["m-treeselect__label", { "m-treeselect__label--placeholder": !U.value.length }])
414
- }, S(He.value), 3))], 16, Te), p("div", Ae, [Ke.value ? (v(), f("button", {
414
+ class: g(["m-treeselect__label", { "m-treeselect__label--placeholder": !V.value.length }])
415
+ }, x(We.value), 3))], 16, De), f("div", Me, [qe.value ? (_(), d("button", {
415
416
  key: 0,
416
417
  class: "m-select__clear",
417
418
  type: "button",
418
- "aria-label": C(A).clear,
419
- onClick: at
420
- }, [h(t, {
419
+ "aria-label": S(k).clear,
420
+ onClick: ot
421
+ }, [m(t, {
421
422
  name: "close",
422
423
  class: "m-control-affix-icon"
423
- })], 8, je)) : d("", !0), p("span", {
424
- class: _(["m-select__indicator", { "m-select__indicator--open": F.value }]),
424
+ })], 8, Ne)) : u("", !0), f("span", {
425
+ class: g(["m-select__indicator", { "m-select__indicator--open": N.value }]),
425
426
  "aria-hidden": "true"
426
- }, [h(t, {
427
+ }, [m(t, {
427
428
  name: "chevron-down",
428
429
  class: "m-control-affix-icon"
429
- })], 2)])], 2), (v(), u(ue, {
430
- to: ze.value.to,
431
- disabled: ze.value.disabled
432
- }, [h(de, { name: "m-scale-fade" }, {
433
- default: xe(() => [F.value ? (v(), f("div", {
430
+ })], 2)])], 2), (_(), l(fe, {
431
+ to: He.value.to,
432
+ disabled: He.value.disabled
433
+ }, [m(pe, { name: "m-scale-fade" }, {
434
+ default: Ce(() => [N.value ? (_(), d("div", {
434
435
  key: 0,
435
- id: C(Je),
436
+ id: S(Ye),
436
437
  ref_key: "panel",
437
- ref: z,
438
- class: _(["m-treeselect__panel", { "m-treeselect__panel--teleported": V.value }]),
439
- style: me(V.value ? Re.value : void 0),
438
+ ref: L,
439
+ class: g(["m-treeselect__panel", { "m-treeselect__panel--teleported": z.value }]),
440
+ style: ge(z.value ? Ve.value : void 0),
440
441
  onKeydown: J
441
- }, [a.filterable ? Se((v(), f("input", {
442
+ }, [a.filterable ? we((_(), d("input", {
442
443
  key: 0,
443
- "onUpdate:modelValue": n[0] ||= (e) => I.value = e,
444
+ "onUpdate:modelValue": n[0] ||= (e) => P.value = e,
444
445
  class: "m-treeselect__filter",
445
446
  type: "search",
446
- placeholder: C(A).searchPlaceholder,
447
- onClick: n[1] ||= w(() => {}, ["stop"]),
448
- onKeydown: tt
449
- }, null, 40, Ne)), [[ye, I.value]]) : d("", !0), p("ul", Pe, [(v(!0), f(c, null, b(qe.value, (e) => (v(), u(k, {
450
- key: e.key,
451
- node: e,
452
- depth: 0,
453
- "selected-keys": U.value,
454
- "checked-keys": Ve.value,
455
- expanded: B.value,
456
- "show-checkbox": a.checkable,
457
- "active-key": Ye.value,
458
- "render-option": We.value,
459
- onToggle: Y,
460
- onSelect: nt,
461
- onCheck: rt
462
- }, null, 8, [
463
- "node",
464
- "selected-keys",
465
- "checked-keys",
466
- "expanded",
467
- "show-checkbox",
468
- "active-key",
469
- "render-option"
470
- ]))), 128))])], 46, Me)) : d("", !0)]),
447
+ placeholder: S(k).searchPlaceholder,
448
+ onClick: n[1] ||= C(() => {}, ["stop"]),
449
+ onKeydown: nt
450
+ }, null, 40, Fe)), [[xe, P.value]]) : u("", !0), m(ne, {
451
+ class: "m-treeselect__tree-scroll",
452
+ "fit-content": "",
453
+ "wrap-class": "m-treeselect__tree-wrap",
454
+ "view-class": "m-treeselect__tree-view"
455
+ }, {
456
+ default: Ce(() => [f("ul", Ie, [(_(!0), d(s, null, y(Je.value, (e) => (_(), l(O, {
457
+ key: e.key,
458
+ node: e,
459
+ depth: 0,
460
+ "selected-keys": V.value,
461
+ "checked-keys": H.value,
462
+ expanded: R.value,
463
+ "show-checkbox": a.checkable,
464
+ "active-key": Xe.value,
465
+ "render-option": Ge.value,
466
+ onToggle: Y,
467
+ onSelect: rt,
468
+ onCheck: it
469
+ }, null, 8, [
470
+ "node",
471
+ "selected-keys",
472
+ "checked-keys",
473
+ "expanded",
474
+ "show-checkbox",
475
+ "active-key",
476
+ "render-option"
477
+ ]))), 128))])]),
478
+ _: 1
479
+ })], 46, Pe)) : u("", !0)]),
471
480
  _: 1
472
481
  })], 8, ["to", "disabled"]))], 2),
473
- C(N) ? (v(), f("span", {
482
+ S(M) ? (_(), d("span", {
474
483
  key: 1,
475
- id: `${j.value}-help`,
476
- class: _(["m-select-field__help", { "m-select-field__help--invalid": C(P) }]),
477
- role: C(P) ? "alert" : void 0
478
- }, S(C(N)), 11, Fe)) : d("", !0)
484
+ id: `${A.value}-help`,
485
+ class: g(["m-select-field__help", { "m-select-field__help--invalid": S(Be) }]),
486
+ role: S(Be) ? "alert" : void 0
487
+ }, x(S(M)), 11, Le)) : u("", !0)
479
488
  ], 16));
480
489
  }
481
490
  });
482
491
  //#endregion
483
- export { A as MTreeSelect };
492
+ export { k as MTreeSelect };