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