morya-ui 0.3.0 → 0.3.1

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 (205) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/{Button-B5X_R4Md.js → Button-smoDleh0.js} +1 -1
  3. package/dist/Icon-od9Ob-Ay.js +393 -0
  4. package/dist/Loading-BSsRs6v9.js +420 -0
  5. package/dist/{Pagination-CVrH8Ypi.js → Pagination-DrXmzcEy.js} +1 -1
  6. package/dist/accordion/style.css +4 -0
  7. package/dist/auto-complete/index.js +1 -1
  8. package/dist/auto-complete/style.css +18 -6
  9. package/dist/avatar/index.js +1 -1
  10. package/dist/avatar/style.css +4 -0
  11. package/dist/badge/style.css +4 -0
  12. package/dist/block-ui/style.css +4 -0
  13. package/dist/breadcrumb/style.css +4 -0
  14. package/dist/button/index.js +1 -1
  15. package/dist/button/style.css +4 -0
  16. package/dist/card/style.css +4 -0
  17. package/dist/carousel/index.js +72 -64
  18. package/dist/carousel/style.css +31 -10
  19. package/dist/cascade-select/index.js +1 -1
  20. package/dist/cascade-select/style.css +18 -6
  21. package/dist/checkbox/style.css +4 -0
  22. package/dist/chip/index.js +1 -1
  23. package/dist/chip/style.css +4 -0
  24. package/dist/command-menu/index.js +2 -2
  25. package/dist/command-menu/style.css +4 -0
  26. package/dist/components/Carousel/Carousel.vue.d.ts.map +1 -1
  27. package/dist/components/Carousel/styles.css +27 -10
  28. package/dist/components/DataView/DataView.vue.d.ts +7 -7
  29. package/dist/components/DataView/DataView.vue.d.ts.map +1 -1
  30. package/dist/components/DataView/styles.css +0 -20
  31. package/dist/components/Dropdown/Dropdown.vue.d.ts +2 -2
  32. package/dist/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
  33. package/dist/components/Dropdown/DropdownNodes.vue.d.ts +8 -9
  34. package/dist/components/Dropdown/DropdownNodes.vue.d.ts.map +1 -1
  35. package/dist/components/Dropdown/styles.css +24 -5
  36. package/dist/components/Icon/Icon.vue.d.ts.map +1 -1
  37. package/dist/components/Icon/icon-categories.d.ts.map +1 -1
  38. package/dist/components/Icon/icons-types.d.ts +4 -2
  39. package/dist/components/Icon/icons-types.d.ts.map +1 -1
  40. package/dist/components/Icon/icons.d.ts +250 -561
  41. package/dist/components/Icon/icons.d.ts.map +1 -1
  42. package/dist/components/Icon/index.d.ts +2 -2
  43. package/dist/components/Icon/index.d.ts.map +1 -1
  44. package/dist/components/Layout/styles.css +5 -2
  45. package/dist/components/Menu/styles.css +6 -0
  46. package/dist/components/Menubar/Menubar.vue.d.ts.map +1 -1
  47. package/dist/components/Menubar/styles.css +4 -0
  48. package/dist/components/Scrollbar/Scrollbar.vue.d.ts +1 -1
  49. package/dist/components/Select/Select.vue.d.ts +9 -5
  50. package/dist/components/Select/Select.vue.d.ts.map +1 -1
  51. package/dist/components/Select/styles.css +30 -1
  52. package/dist/components/Select/types.d.ts +11 -1
  53. package/dist/components/Select/types.d.ts.map +1 -1
  54. package/dist/components/Slider/styles.css +9 -0
  55. package/dist/components/SplitButton/styles.css +5 -0
  56. package/dist/components/Table/Table.vue.d.ts +26 -26
  57. package/dist/components/Table/Table.vue.d.ts.map +1 -1
  58. package/dist/components/Table/TableLoadingLine.vue.d.ts.map +1 -1
  59. package/dist/components/Table/styles.css +58 -38
  60. package/dist/components/TreeSelect/TreeSelect.vue.d.ts.map +1 -1
  61. package/dist/components/TreeSelect/styles.css +1 -1
  62. package/dist/config-provider/style.css +4 -0
  63. package/dist/confirm-dialog/index.js +2 -2
  64. package/dist/confirm-dialog/style.css +4 -0
  65. package/dist/confirm-popup/index.js +2 -2
  66. package/dist/confirm-popup/style.css +4 -0
  67. package/dist/context-menu/index.js +2 -2
  68. package/dist/context-menu/style.css +4 -0
  69. package/dist/data-view/index.js +47 -47
  70. package/dist/data-view/style.css +399 -106
  71. package/dist/data-view/style.js +1 -1
  72. package/dist/date-picker/index.js +1 -1
  73. package/dist/date-picker/style.css +4 -0
  74. package/dist/dialog/index.js +2 -2
  75. package/dist/dialog/style.css +4 -0
  76. package/dist/divider/style.css +4 -0
  77. package/dist/dock/index.js +2 -2
  78. package/dist/dock/style.css +4 -0
  79. package/dist/drawer/index.js +1 -1
  80. package/dist/drawer/style.css +4 -0
  81. package/dist/dropdown/index.js +110 -91
  82. package/dist/dropdown/style.css +28 -5
  83. package/dist/empty/index.js +1 -1
  84. package/dist/empty/style.css +4 -0
  85. package/dist/fieldset/index.js +1 -1
  86. package/dist/fieldset/style.css +4 -0
  87. package/dist/file-upload/index.js +1 -1
  88. package/dist/file-upload/style.css +4 -0
  89. package/dist/flex/style.css +4 -0
  90. package/dist/float-label/style.css +4 -0
  91. package/dist/fluid/style.css +4 -0
  92. package/dist/form/style.css +4 -0
  93. package/dist/gallery/index.js +1 -1
  94. package/dist/gallery/style.css +4 -0
  95. package/dist/grid/style.css +4 -0
  96. package/dist/icon/index.js +93 -39
  97. package/dist/icon/style.css +4 -0
  98. package/dist/icon-COrt_N8A.js +18 -0
  99. package/dist/icon-field/style.css +4 -0
  100. package/dist/index.js +2733 -2801
  101. package/dist/inplace/style.css +4 -0
  102. package/dist/input/index.js +1 -1
  103. package/dist/input/style.css +4 -0
  104. package/dist/input-color/style.css +4 -0
  105. package/dist/input-group/style.css +4 -0
  106. package/dist/input-number/index.js +1 -1
  107. package/dist/input-number/style.css +4 -0
  108. package/dist/input-otp/style.css +4 -0
  109. package/dist/input-password/index.js +1 -1
  110. package/dist/input-password/style.css +4 -0
  111. package/dist/input-tags/index.js +1 -1
  112. package/dist/input-tags/style.css +4 -0
  113. package/dist/knob/style.css +4 -0
  114. package/dist/label/style.css +4 -0
  115. package/dist/layout/index.js +1 -1
  116. package/dist/layout/style.css +9 -2
  117. package/dist/listbox/style.css +4 -0
  118. package/dist/loading/index.js +32 -446
  119. package/dist/loading/style.css +4 -0
  120. package/dist/mega-menu/index.js +2 -2
  121. package/dist/mega-menu/style.css +4 -0
  122. package/dist/menu/index.js +2 -2
  123. package/dist/menu/style.css +10 -0
  124. package/dist/menubar/index.js +6 -3
  125. package/dist/menubar/style.css +8 -0
  126. package/dist/message/index.js +1 -1
  127. package/dist/message/style.css +4 -0
  128. package/dist/meter-group/style.css +4 -0
  129. package/dist/order-list/index.js +1 -1
  130. package/dist/order-list/style.css +4 -0
  131. package/dist/page/index.js +1 -1
  132. package/dist/page/style.css +4 -0
  133. package/dist/pagination/index.js +1 -1
  134. package/dist/pagination/style.css +4 -0
  135. package/dist/panel/index.js +1 -1
  136. package/dist/panel/style.css +4 -0
  137. package/dist/pick-list/index.js +1 -1
  138. package/dist/pick-list/style.css +4 -0
  139. package/dist/popover/style.css +4 -0
  140. package/dist/progress-bar/style.css +4 -0
  141. package/dist/progress-spinner/index.js +105 -2
  142. package/dist/progress-spinner/style.css +4 -0
  143. package/dist/radio/style.css +4 -0
  144. package/dist/rating/index.js +1 -1
  145. package/dist/rating/style.css +4 -0
  146. package/dist/result/index.js +1 -1
  147. package/dist/result/style.css +4 -0
  148. package/dist/scroll-top/index.js +1 -1
  149. package/dist/scroll-top/style.css +4 -0
  150. package/dist/scrollbar/style.css +4 -0
  151. package/dist/select/index.js +284 -217
  152. package/dist/select/style.css +48 -7
  153. package/dist/select-button/style.css +4 -0
  154. package/dist/shared/menu/icon.d.ts.map +1 -1
  155. package/dist/shared/styles/select-overlay.css +14 -6
  156. package/dist/sidebar/index.js +2 -2
  157. package/dist/sidebar/style.css +4 -0
  158. package/dist/skeleton/style.css +4 -0
  159. package/dist/slider/style.css +13 -0
  160. package/dist/space/style.css +4 -0
  161. package/dist/speed-dial/index.js +2 -2
  162. package/dist/speed-dial/style.css +4 -0
  163. package/dist/split-button/index.js +1 -1
  164. package/dist/split-button/style.css +9 -0
  165. package/dist/splitter/style.css +4 -0
  166. package/dist/status/index.js +1 -1
  167. package/dist/status/style.css +4 -0
  168. package/dist/stepper/index.js +1 -1
  169. package/dist/stepper/style.css +4 -0
  170. package/dist/styles/base.css +4 -0
  171. package/dist/styles.css +1 -1
  172. package/dist/switch/style.css +4 -0
  173. package/dist/table/index.js +344 -338
  174. package/dist/table/style.css +457 -124
  175. package/dist/table/style.js +1 -1
  176. package/dist/tabs/index.js +1 -1
  177. package/dist/tabs/style.css +4 -0
  178. package/dist/tag/index.js +1 -1
  179. package/dist/tag/style.css +4 -0
  180. package/dist/terminal/style.css +4 -0
  181. package/dist/textarea/index.js +1 -1
  182. package/dist/textarea/style.css +4 -0
  183. package/dist/tiered-menu/index.js +1 -1
  184. package/dist/tiered-menu/style.css +4 -0
  185. package/dist/timeline/index.js +1 -1
  186. package/dist/timeline/style.css +4 -0
  187. package/dist/toast/index.js +1 -1
  188. package/dist/toast/style.css +4 -0
  189. package/dist/toggle-button/index.js +2 -2
  190. package/dist/toggle-button/style.css +4 -0
  191. package/dist/toolbar/style.css +4 -0
  192. package/dist/tooltip/style.css +4 -0
  193. package/dist/tree/index.js +1 -1
  194. package/dist/tree/style.css +4 -0
  195. package/dist/tree-select/index.js +2 -1
  196. package/dist/tree-select/style.css +19 -7
  197. package/dist/tree-table/index.js +1 -1
  198. package/dist/tree-table/style.css +4 -0
  199. package/dist/virtual-scroller/style.css +4 -0
  200. package/package.json +1 -1
  201. package/dist/Icon-lcN1rS87.js +0 -610
  202. package/dist/ProgressSpinner-BeWVF6Jv.js +0 -105
  203. package/dist/components/Icon/icons-tabler.d.ts +0 -77
  204. package/dist/components/Icon/icons-tabler.d.ts.map +0 -1
  205. package/dist/icon-DWXkh-RM.js +0 -27
@@ -1,462 +1,48 @@
1
- import { a as e } from "../useComponentAttrs-e-5QAjdw.js";
2
- import { i as t } from "../types-DGuu4Eg4.js";
3
- import { t as n } from "../usePauseOffscreen-BIikV_gj.js";
4
- import { n as r, t as i } from "../useMotionTransition-Bxnnb_9u.js";
5
- import { n as a } from "../overlay-oR-5MDuE.js";
6
- import { i as o } from "../content-h8POj44-.js";
7
- import { t as s } from "../overlayHost-78CGtMgR.js";
8
- import { c, i as l, l as u, t as d } from "../config-CapALqt3.js";
9
- import { n as f } from "../locale-Bzm2nbEp.js";
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "../Loading-BSsRs6v9.js";
10
2
  import "./style.js";
11
- import { Fragment as p, Teleport as m, Transition as h, computed as g, createBlock as _, createCommentVNode as v, createElementBlock as y, createElementVNode as b, createStaticVNode as x, createVNode as S, defineComponent as C, h as w, mergeProps as T, normalizeClass as ee, normalizeStyle as E, onBeforeUnmount as D, openBlock as O, reactive as k, ref as A, render as j, renderList as M, renderSlot as N, toDisplayString as P, toValue as F, unref as I, useAttrs as te, useSlots as ne, watch as L, withCtx as R } from "vue";
12
- //#region src/components/Loading/types.ts
13
- var z = [
14
- "circular",
15
- "aurora",
16
- "bounce",
17
- "wave",
18
- "pulse",
19
- "stardust"
20
- ], B = new Set(z);
21
- function V(e) {
22
- return typeof e == "string" && B.has(e);
23
- }
24
- function H(e) {
25
- return V(e) ? e : "circular";
26
- }
27
- //#endregion
28
- //#region src/components/Loading/LoadingIndicator.vue?vue&type=script&setup=true&lang.ts
29
- var U = ["aria-label"], W = {
30
- class: "m-loading-indicator__graphic",
31
- "aria-hidden": "true"
32
- }, re = {
33
- key: 0,
34
- class: "m-loading-aurora"
35
- }, ie = {
36
- key: 1,
37
- class: "m-loading-bounce"
38
- }, ae = {
39
- key: 2,
40
- class: "m-loading-wave"
41
- }, oe = {
42
- key: 3,
43
- class: "m-loading-pulse"
44
- }, se = {
45
- key: 4,
46
- class: "m-loading-stardust"
47
- }, ce = {
48
- key: 5,
49
- class: "m-loading-circular"
50
- }, le = {
51
- key: 0,
52
- class: "m-loading-indicator__tip"
53
- }, G = /* @__PURE__ */ C({
54
- name: "MLoadingIndicator",
55
- __name: "LoadingIndicator",
56
- props: {
57
- effect: {},
58
- text: {},
59
- ariaLabel: {},
60
- size: {}
61
- },
62
- setup(e) {
63
- let r = e, i = f(), a = A(null), { pauseAttrs: o } = n(a, !0), s = l("Loading"), c = g(() => H(r.effect ?? s.value.effect)), u = g(() => r.size ?? s.value.size), d = g(() => {
64
- let e = t(u.value);
65
- return {
66
- "m-loading-indicator--small": e === "small",
67
- "m-loading-indicator--large": e === "large"
68
- };
69
- }), m = g(() => r.ariaLabel ?? (r.text ? void 0 : i.value.loading));
70
- return (t, n) => (O(), y("div", T({
71
- ref_key: "rootRef",
72
- ref: a
73
- }, I(o), {
74
- class: ["m-loading-indicator", d.value],
75
- role: "status",
76
- "aria-live": "polite",
77
- "aria-label": m.value
78
- }), [b("div", W, [c.value === "aurora" ? (O(), y("div", re, [...n[0] ||= [b("div", { class: "m-loading-aurora__ring" }, null, -1), b("div", { class: "m-loading-aurora__glow" }, null, -1)]])) : c.value === "bounce" ? (O(), y("div", ie, [...n[1] ||= [
79
- b("span", { class: "m-loading-bounce__ball" }, null, -1),
80
- b("span", { class: "m-loading-bounce__ball" }, null, -1),
81
- b("span", { class: "m-loading-bounce__ball" }, null, -1)
82
- ]])) : c.value === "wave" ? (O(), y("div", ae, [...n[2] ||= [x("<span class=\"m-loading-wave__bar\"></span><span class=\"m-loading-wave__bar\"></span><span class=\"m-loading-wave__bar\"></span><span class=\"m-loading-wave__bar\"></span><span class=\"m-loading-wave__bar\"></span>", 5)]])) : c.value === "pulse" ? (O(), y("div", oe, [...n[3] ||= [
83
- b("span", { class: "m-loading-pulse__ring" }, null, -1),
84
- b("span", { class: "m-loading-pulse__ring" }, null, -1),
85
- b("span", { class: "m-loading-pulse__ring" }, null, -1),
86
- b("span", { class: "m-loading-pulse__ring" }, null, -1)
87
- ]])) : c.value === "stardust" ? (O(), y("div", se, [(O(), y(p, null, M(8, (e) => b("span", {
88
- key: e,
89
- class: "m-loading-stardust__dot",
90
- style: E({ "--i": String(e - 1) })
91
- }, null, 4)), 64))])) : (O(), y("div", ce, [...n[4] ||= [b("svg", {
92
- class: "m-loading-circular__svg",
93
- viewBox: "0 0 50 50"
94
- }, [b("circle", {
95
- class: "m-loading-circular__path",
96
- cx: "25",
97
- cy: "25",
98
- r: "20",
99
- fill: "none"
100
- })], -1)]]))]), e.text ? (O(), y("p", le, P(e.text), 1)) : v("", !0)], 16, U));
101
- }
102
- });
103
- //#endregion
104
- //#region src/components/Loading/loading.ts
105
- function ue(e) {
106
- let t = e ?? s();
107
- if (!t) return;
108
- let n = t.provides?.[d];
109
- return n == null ? t.config.globalProperties.$m : F(n);
110
- }
111
- function de(e) {
112
- let t = ue(e);
113
- return r({
114
- rolePreset: t?.motion?.transitions?.overlay,
115
- componentDefault: u(t?.componentDefaults, "Loading", "transition"),
116
- fallback: "loading"
117
- });
118
- }
119
- var K = /* @__PURE__ */ new Set(), q = null, J = 0, Y = "";
120
- function X() {
121
- typeof document > "u" || (J === 0 && (Y = document.body.style.overflow), J += 1, document.body.style.overflow = "hidden");
122
- }
123
- function Z() {
124
- typeof document > "u" || (J = Math.max(0, J - 1), J === 0 && (document.body.style.overflow = Y));
125
- }
126
- function fe(e) {
127
- if (typeof document > "u") throw Error("[MLoading] service is only available in the browser");
128
- if (!e || e === document.body) return document.body;
129
- if (typeof e == "string") {
130
- let t = document.querySelector(e);
131
- if (!(t instanceof HTMLElement)) throw TypeError(`[MLoading] target not found: ${e}`);
132
- return t;
133
- }
134
- return e;
135
- }
136
- function pe(e) {
137
- let t = 0;
138
- return () => {
139
- t ||= requestAnimationFrame(() => {
140
- t = 0, e();
141
- });
142
- };
143
- }
144
- function me(e) {
145
- let t = k({
146
- visible: !e.delay,
147
- text: e.text ?? "",
148
- effect: e.effect,
149
- background: e.background,
150
- customClass: e.customClass,
151
- size: e.size,
152
- fullscreen: !!e.fullscreen,
153
- body: !!e.body && !e.fullscreen,
154
- spinner: e.spinner,
155
- top: 0,
156
- left: 0,
157
- width: 0,
158
- height: 0
159
- });
160
- t.fullscreen && q && q.destroy();
161
- let n = document.createElement("div");
162
- (t.fullscreen || t.body ? document.body : e.target).appendChild(n);
163
- let r = !1;
164
- if (!t.fullscreen && !t.body) {
165
- let t = getComputedStyle(e.target).position;
166
- (!t || t === "static") && (e.target.classList.add("m-loading-parent--relative"), r = !0);
167
- }
168
- e.target.setAttribute("aria-busy", "true");
169
- let i = !1;
170
- function a(e) {
171
- if (e && !i) {
172
- X(), i = !0;
173
- return;
174
- }
175
- !e && i && (Z(), i = !1);
176
- }
177
- t.visible && a(!!e.lock);
178
- function c() {
179
- if (!t.body) return;
180
- let n = e.target.getBoundingClientRect();
181
- t.top = n.top, t.left = n.left, t.width = n.width, t.height = n.height;
182
- }
183
- let l = pe(c), u = null;
184
- t.body && (c(), window.addEventListener("scroll", l, !0), window.addEventListener("resize", l), typeof ResizeObserver < "u" && (u = new ResizeObserver(l), u.observe(e.target)));
185
- let d = null;
186
- e.delay && e.delay > 0 && (d = setTimeout(() => {
187
- d = null, t.visible = !0, a(!!e.lock);
188
- }, e.delay));
189
- let f = null, p = !1, m = !1, g = null;
190
- function _() {
191
- m || (m = !0, p = !0, d !== null && (clearTimeout(d), d = null), f !== null && (clearTimeout(f), f = null), a(!1), t.body && (window.removeEventListener("scroll", l, !0), window.removeEventListener("resize", l), u?.disconnect(), u = null), r && e.target.classList.remove("m-loading-parent--relative"), e.target.getAttribute("aria-busy") === "true" && e.target.removeAttribute("aria-busy"), j(null, n), n.remove(), g && (K.delete(g), q === g && (q = null)));
192
- }
193
- let v = C({
194
- name: "MLoadingMask",
195
- setup() {
196
- let n = de(e.appContext);
197
- return () => w(h, {
198
- name: n,
199
- css: n !== void 0,
200
- appear: !0,
201
- duration: {
202
- enter: 180,
203
- leave: 130
204
- },
205
- onAfterLeave: () => _()
206
- }, { default: () => {
207
- if (!t.visible) return null;
208
- let e = [
209
- "m-loading-mask",
210
- t.fullscreen ? "m-loading-mask--fullscreen" : void 0,
211
- t.body ? "m-loading-mask--body" : void 0,
212
- t.customClass || void 0
213
- ].filter((e) => !!e), n = {};
214
- t.background && (n.background = t.background), t.body && (n.top = `${t.top}px`, n.left = `${t.left}px`, n.width = `${t.width}px`, n.height = `${t.height}px`);
215
- let r = t.spinner ? o(t.spinner) : w(G, {
216
- effect: t.effect,
217
- size: t.size,
218
- text: t.text || void 0
219
- });
220
- return w("div", {
221
- class: e,
222
- style: n
223
- }, [r]);
224
- } });
225
- }
226
- });
227
- g = {
228
- fullscreen: t.fullscreen,
229
- destroy: _,
230
- close() {
231
- if (!p) {
232
- if (p = !0, d !== null) {
233
- clearTimeout(d), d = null, _();
234
- return;
235
- }
236
- if (!t.visible) {
237
- _();
238
- return;
239
- }
240
- t.visible = !1, f = setTimeout(_, 200);
241
- }
242
- }
243
- }, K.add(g), t.fullscreen && (q = g);
244
- let y = w(v);
245
- return y.appContext = e.appContext ?? s(), j(y, n), {
246
- close: () => g.close(),
247
- destroy: () => _(),
248
- setText(e) {
249
- m || (t.text = e);
250
- },
251
- update(e) {
252
- m || (e.text !== void 0 && (t.text = e.text), e.effect !== void 0 && (t.effect = e.effect), e.background !== void 0 && (t.background = e.background), e.customClass !== void 0 && (t.customClass = e.customClass), e.size !== void 0 && (t.size = e.size), e.spinner !== void 0 && (t.spinner = e.spinner), e.lock !== void 0 && t.visible && a(e.lock));
253
- }
254
- };
255
- }
256
- function he() {
257
- return {
258
- close() {},
259
- setText() {},
260
- destroy() {}
261
- };
262
- }
263
- function ge(e = {}) {
264
- if (typeof document > "u") return he();
265
- let t = e.fullscreen ?? (e.target == null && !e.body), n = me({
266
- target: t ? document.body : fe(e.target ?? document.body),
267
- fullscreen: t,
268
- body: !!e.body && !t,
269
- lock: e.lock,
270
- text: e.text,
271
- effect: e.effect,
272
- background: e.background,
273
- customClass: e.customClass,
274
- size: e.size,
275
- delay: e.delay,
276
- spinner: e.spinner
277
- });
278
- return {
279
- close: () => n.close(),
280
- setText: (e) => n.setText(e),
281
- destroy: () => n.destroy()
282
- };
283
- }
284
- var _e = { service: ge }, ve = ["aria-busy"], ye = ["inert"], be = /* @__PURE__ */ C({
285
- name: "MLoading",
286
- inheritAttrs: !1,
287
- __name: "Loading",
288
- props: {
289
- pt: {},
290
- loading: {
291
- type: Boolean,
292
- default: !0
293
- },
294
- effect: {},
295
- text: {},
296
- ariaLabel: {},
297
- size: {},
298
- background: {},
299
- customClass: {},
300
- fullscreen: {
301
- type: Boolean,
302
- default: !1
303
- },
304
- lock: {
305
- type: Boolean,
306
- default: !1
307
- },
308
- delay: { default: 0 },
309
- transition: {
310
- type: [String, Boolean],
311
- default: void 0
312
- }
313
- },
314
- setup(t) {
315
- let n = t, r = te(), o = ne(), { rootAttrs: s } = e(r, () => n.pt), u = l("Loading"), d = c(), { transitionName: f, transitionCss: x } = i({
316
- role: "overlay",
317
- local: () => n.transition,
318
- componentName: "Loading",
319
- fallback: "loading"
320
- }), C = g(() => !!o.default), w = g(() => C.value || n.fullscreen), k = g(() => H(n.effect ?? u.value.effect)), j = g(() => n.size ?? u.value.size), M = g(() => n.delay ?? u.value.delay ?? 0), P = g(() => n.background ? { background: n.background } : void 0), F = g(() => a(n.fullscreen ? {
321
- teleport: !0,
322
- appendTo: "body"
323
- } : { teleport: !1 }, d.value.appendTo)), z = A(n.loading && M.value <= 0), B = null;
324
- function V() {
325
- B !== null && (clearTimeout(B), B = null);
326
- }
327
- L(() => [
328
- n.loading,
329
- M.value,
330
- w.value
331
- ], ([e, t]) => {
332
- if (V(), !e || !w.value) {
333
- z.value = !1;
334
- return;
335
- }
336
- if (!t) {
337
- z.value = !0;
338
- return;
339
- }
340
- z.value = !1, B = setTimeout(() => {
341
- z.value = !0, B = null;
342
- }, t);
343
- }, { immediate: !0 });
344
- let U = g(() => n.lock && z.value && w.value), W = !1;
345
- return L(U, (e) => {
346
- if (e && !W) {
347
- X(), W = !0;
348
- return;
349
- }
350
- !e && W && (Z(), W = !1);
351
- }, { immediate: !0 }), D(() => {
352
- V(), W &&= (Z(), !1);
353
- }), (e, n) => w.value ? (O(), y(p, { key: 0 }, [C.value ? (O(), y("div", T({ key: 0 }, I(s), {
354
- class: ["m-loading", { "m-loading--active": z.value }],
355
- "aria-busy": z.value || void 0
356
- }), [b("div", {
357
- class: "m-loading__content",
358
- inert: z.value || void 0
359
- }, [N(e.$slots, "default")], 8, ye), (O(), _(m, {
360
- to: F.value.to,
361
- disabled: F.value.disabled
362
- }, [S(h, {
363
- name: I(f),
364
- css: I(x)
365
- }, {
366
- default: R(() => [z.value ? (O(), y("div", {
367
- key: 0,
368
- class: ee(["m-loading-mask", [{ "m-loading-mask--fullscreen": t.fullscreen }, t.customClass]]),
369
- style: E(P.value)
370
- }, [N(e.$slots, "indicator", {}, () => [S(G, {
371
- effect: k.value,
372
- size: j.value,
373
- text: t.text,
374
- "aria-label": t.ariaLabel
375
- }, null, 8, [
376
- "effect",
377
- "size",
378
- "text",
379
- "aria-label"
380
- ])])], 6)) : v("", !0)]),
381
- _: 3
382
- }, 8, ["name", "css"])], 8, ["to", "disabled"]))], 16, ve)) : (O(), _(m, {
383
- key: 1,
384
- to: F.value.to,
385
- disabled: F.value.disabled
386
- }, [S(h, {
387
- name: I(f),
388
- css: I(x)
389
- }, {
390
- default: R(() => [z.value ? (O(), y("div", T({ key: 0 }, I(s), {
391
- class: ["m-loading-mask m-loading-mask--fullscreen", t.customClass],
392
- style: P.value,
393
- role: "presentation",
394
- "aria-busy": "true"
395
- }), [N(e.$slots, "indicator", {}, () => [S(G, {
396
- effect: k.value,
397
- size: j.value,
398
- text: t.text,
399
- "aria-label": t.ariaLabel
400
- }, null, 8, [
401
- "effect",
402
- "size",
403
- "text",
404
- "aria-label"
405
- ])])], 16)) : v("", !0)]),
406
- _: 3
407
- }, 8, ["name", "css"])], 8, ["to", "disabled"]))], 64)) : (O(), _(G, T({ key: 1 }, I(s), {
408
- effect: k.value,
409
- size: j.value,
410
- text: t.text,
411
- "aria-label": t.ariaLabel
412
- }), null, 16, [
413
- "effect",
414
- "size",
415
- "text",
416
- "aria-label"
417
- ]));
418
- }
419
- }), Q = /* @__PURE__ */ new WeakMap();
420
- function $(e, ...t) {
3
+ import { onBeforeUnmount as o } from "vue";
4
+ //#region src/components/Loading/directive.ts
5
+ var s = /* @__PURE__ */ new WeakMap();
6
+ function c(e, ...t) {
421
7
  for (let n of t) {
422
8
  let t = e.getAttribute(n);
423
9
  if (t != null) return t;
424
10
  }
425
11
  }
426
- function xe(e) {
427
- return V(e) ? e : void 0;
12
+ function l(t) {
13
+ return e(t) ? t : void 0;
428
14
  }
429
- function Se(e, t) {
430
- let n = t.value, r = n && typeof n == "object" ? n : void 0, i = typeof n == "boolean" ? n : r ? r.loading !== !1 : !!n, a = !!(t.modifiers.fullscreen || r?.fullscreen), o = !!(t.modifiers.body || r?.body) && !a, s = xe(r?.effect ?? $(e, "m-loading-effect")), c = r?.size, l = $(e, "m-loading-delay"), u = r?.delay ?? (l == null ? void 0 : Number(l));
15
+ function u(e, t) {
16
+ let n = t.value, r = n && typeof n == "object" ? n : void 0, i = typeof n == "boolean" ? n : r ? r.loading !== !1 : !!n, a = !!(t.modifiers.fullscreen || r?.fullscreen), o = !!(t.modifiers.body || r?.body) && !a, s = l(r?.effect ?? c(e, "m-loading-effect")), u = r?.size, d = c(e, "m-loading-delay"), f = r?.delay ?? (d == null ? void 0 : Number(d));
431
17
  return {
432
18
  visible: i,
433
- text: r?.text ?? $(e, "m-loading-text"),
19
+ text: r?.text ?? c(e, "m-loading-text"),
434
20
  effect: s,
435
- background: r?.background ?? $(e, "m-loading-background"),
436
- customClass: r?.customClass ?? $(e, "m-loading-custom-class"),
437
- size: typeof c == "string" ? c : void 0,
21
+ background: r?.background ?? c(e, "m-loading-background"),
22
+ customClass: r?.customClass ?? c(e, "m-loading-custom-class"),
23
+ size: typeof u == "string" ? u : void 0,
438
24
  fullscreen: a,
439
25
  lock: !!(t.modifiers.lock || r?.lock),
440
26
  body: o,
441
- delay: Number.isFinite(u) ? u : void 0,
27
+ delay: Number.isFinite(f) ? f : void 0,
442
28
  spinner: r?.spinner,
443
29
  mode: `${a}:${o}`
444
30
  };
445
31
  }
446
- function Ce(e, t) {
447
- let n = Se(e, t), r = Q.get(e);
32
+ function d(e, t) {
33
+ let n = u(e, t), r = s.get(e);
448
34
  if (!n.visible) {
449
35
  if (!r) return;
450
- Q.delete(e), r.instance.close();
36
+ s.delete(e), r.instance.close();
451
37
  return;
452
38
  }
453
39
  if (r && r.mode === n.mode) {
454
40
  r.instance.update(n);
455
41
  return;
456
42
  }
457
- r?.instance.destroy(), Q.set(e, {
43
+ r?.instance.destroy(), s.set(e, {
458
44
  mode: n.mode,
459
- instance: me({
45
+ instance: i({
460
46
  target: e,
461
47
  text: n.text,
462
48
  effect: n.effect,
@@ -472,35 +58,35 @@ function Ce(e, t) {
472
58
  })
473
59
  });
474
60
  }
475
- var we = {
476
- mounted: Ce,
477
- updated: Ce,
61
+ var f = {
62
+ mounted: d,
63
+ updated: d,
478
64
  unmounted(e) {
479
- let t = Q.get(e);
480
- t && (Q.delete(e), t.instance.destroy());
65
+ let t = s.get(e);
66
+ t && (s.delete(e), t.instance.destroy());
481
67
  }
482
68
  };
483
69
  //#endregion
484
70
  //#region src/components/Loading/useLoading.ts
485
- function Te(e = {}) {
71
+ function p(e = {}) {
486
72
  let t = null;
487
- function n() {
73
+ function r() {
488
74
  t?.close(), t = null;
489
75
  }
490
- return D(() => {
76
+ return o(() => {
491
77
  t?.destroy(), t = null;
492
78
  }), {
493
- open(r = {}) {
494
- return n(), t = _e.service({
79
+ open(i = {}) {
80
+ return r(), t = n.service({
495
81
  ...e,
496
- ...r
82
+ ...i
497
83
  }), t;
498
84
  },
499
- close: n,
85
+ close: r,
500
86
  setText(e) {
501
87
  t?.setText(e);
502
88
  }
503
89
  };
504
90
  }
505
91
  //#endregion
506
- export { z as LOADING_EFFECTS, be as MLoading, V as isLoadingEffect, _e as loading, H as normalizeLoadingEffect, Te as useLoading, we as vLoading };
92
+ export { t as LOADING_EFFECTS, a as MLoading, e as isLoadingEffect, n as loading, r as normalizeLoadingEffect, p as useLoading, f as vLoading };
@@ -529,9 +529,13 @@
529
529
  border-radius: var(--m-radius-md);
530
530
  box-shadow: var(--m-shadow-md);
531
531
  max-height: var(--m-dropdown-submenu-max-height);
532
+ max-width: calc(100vw - 2 * var(--m-space-4));
532
533
  min-width: 10rem;
533
534
  overflow: hidden;
534
535
  padding: var(--m-space-1);
536
+ /* Same as .m-dropdown__menu: size to content instead of being clamped
537
+ by the space left of the anchor in the viewport. */
538
+ width: max-content;
535
539
  }
536
540
 
537
541
  .m-dropdown__submenu--teleported {
@@ -1,11 +1,11 @@
1
1
  import { a as e } from "../useComponentAttrs-e-5QAjdw.js";
2
- import { t } from "../Icon-lcN1rS87.js";
2
+ import { t } from "../Icon-od9Ob-Ay.js";
3
3
  import { t as n } from "../useMotionTransition-Bxnnb_9u.js";
4
4
  import { n as r, t as ee } from "../overlay-oR-5MDuE.js";
5
5
  import { t as te } from "../overlayPlacement-Cd20JTD_.js";
6
6
  import { t as i } from "../useFloatingViewportSync-DZdJ7W8n.js";
7
7
  import { t as a } from "../useMenuKeyboard-BedmYE4W.js";
8
- import { t as ne } from "../icon-DWXkh-RM.js";
8
+ import { t as ne } from "../icon-COrt_N8A.js";
9
9
  import { c as re } from "../config-CapALqt3.js";
10
10
  import { n as ie } from "../locale-Bzm2nbEp.js";
11
11
  import "./style.js";
@@ -529,9 +529,13 @@
529
529
  border-radius: var(--m-radius-md);
530
530
  box-shadow: var(--m-shadow-md);
531
531
  max-height: var(--m-dropdown-submenu-max-height);
532
+ max-width: calc(100vw - 2 * var(--m-space-4));
532
533
  min-width: 10rem;
533
534
  overflow: hidden;
534
535
  padding: var(--m-space-1);
536
+ /* Same as .m-dropdown__menu: size to content instead of being clamped
537
+ by the space left of the anchor in the viewport. */
538
+ width: max-content;
535
539
  }
536
540
 
537
541
  .m-dropdown__submenu--teleported {
@@ -1,12 +1,12 @@
1
1
  import { a as e } from "../useComponentAttrs-e-5QAjdw.js";
2
- import { t } from "../Icon-lcN1rS87.js";
2
+ import { t } from "../Icon-od9Ob-Ay.js";
3
3
  import { t as n } from "../useMotionTransition-Bxnnb_9u.js";
4
4
  import { n as r, t as i } from "../overlay-oR-5MDuE.js";
5
5
  import { t as a } from "../overlayPlacement-Cd20JTD_.js";
6
6
  import { t as o } from "../useFloatingViewportSync-DZdJ7W8n.js";
7
7
  import { t as s } from "../useMenuKeyboard-BedmYE4W.js";
8
8
  import { t as c } from "../Scrollbar-DTeJ8P5b.js";
9
- import { t as ee } from "../icon-DWXkh-RM.js";
9
+ import { t as ee } from "../icon-COrt_N8A.js";
10
10
  import { t as l } from "../key-CaQYVkjh.js";
11
11
  import { t as u } from "../lastPointer-CRxcUqdd.js";
12
12
  import { t as d } from "../Popover-BQ07q4VV.js";
@@ -529,9 +529,13 @@
529
529
  border-radius: var(--m-radius-md);
530
530
  box-shadow: var(--m-shadow-md);
531
531
  max-height: var(--m-dropdown-submenu-max-height);
532
+ max-width: calc(100vw - 2 * var(--m-space-4));
532
533
  min-width: 10rem;
533
534
  overflow: hidden;
534
535
  padding: var(--m-space-1);
536
+ /* Same as .m-dropdown__menu: size to content instead of being clamped
537
+ by the space left of the anchor in the viewport. */
538
+ width: max-content;
535
539
  }
536
540
 
537
541
  .m-dropdown__submenu--teleported {
@@ -1671,9 +1675,13 @@
1671
1675
  display: flex;
1672
1676
  flex-direction: column;
1673
1677
  max-height: var(--m-menu-popup-max-height);
1678
+ max-width: calc(100vw - 2 * var(--m-space-4));
1674
1679
  overflow: hidden;
1675
1680
  padding: var(--m-space-1) 0 var(--m-space-2);
1676
1681
  position: absolute;
1682
+ /* Grow with the content: shrink-to-fit would clamp to the anchor width
1683
+ (the containing block) when not teleported. */
1684
+ width: max-content;
1677
1685
  z-index: var(--m-z-popper);
1678
1686
  }
1679
1687
 
@@ -1693,6 +1701,8 @@
1693
1701
 
1694
1702
  .m-menu-popup .m-menu--popup:not(.m-menu--teleported) {
1695
1703
  left: 0;
1704
+ /* Keep the in-place popup at least as wide as its anchor. */
1705
+ min-width: 100%;
1696
1706
  top: calc(100% + var(--m-space-2));
1697
1707
  }
1698
1708
 
@@ -1,12 +1,12 @@
1
1
  import { a as e } from "../useComponentAttrs-e-5QAjdw.js";
2
- import { t } from "../Icon-lcN1rS87.js";
2
+ import { t } from "../Icon-od9Ob-Ay.js";
3
3
  import { t as n } from "../useMotionTransition-Bxnnb_9u.js";
4
4
  import { n as ee, t as te } from "../overlay-oR-5MDuE.js";
5
5
  import { t as ne } from "../overlayPlacement-Cd20JTD_.js";
6
6
  import { t as re } from "../useFloatingViewportSync-DZdJ7W8n.js";
7
7
  import { t as r } from "../useMenuKeyboard-BedmYE4W.js";
8
8
  import { t as ie } from "../Scrollbar-DTeJ8P5b.js";
9
- import { t as ae } from "../icon-DWXkh-RM.js";
9
+ import { t as ae } from "../icon-COrt_N8A.js";
10
10
  import { c as oe } from "../config-CapALqt3.js";
11
11
  import { n as i } from "../locale-Bzm2nbEp.js";
12
12
  import "./style.js";
@@ -74,7 +74,10 @@ var he = ["aria-label"], ge = {
74
74
  let e = P.value[M.value];
75
75
  if (!e) return;
76
76
  let t = e.getBoundingClientRect();
77
- F.value = ne(t, "bottom-start", { gap: 4 });
77
+ F.value = ne(t, "bottom-start", {
78
+ gap: 4,
79
+ minWidth: "var(--m-menu-min-width, 12rem)"
80
+ });
78
81
  }
79
82
  function z(e) {
80
83
  return e.key ?? e.label;
@@ -529,9 +529,13 @@
529
529
  border-radius: var(--m-radius-md);
530
530
  box-shadow: var(--m-shadow-md);
531
531
  max-height: var(--m-dropdown-submenu-max-height);
532
+ max-width: calc(100vw - 2 * var(--m-space-4));
532
533
  min-width: 10rem;
533
534
  overflow: hidden;
534
535
  padding: var(--m-space-1);
536
+ /* Same as .m-dropdown__menu: size to content instead of being clamped
537
+ by the space left of the anchor in the viewport. */
538
+ width: max-content;
535
539
  }
536
540
 
537
541
  .m-dropdown__submenu--teleported {
@@ -1466,11 +1470,15 @@
1466
1470
  gap: var(--m-menubar-item-gap);
1467
1471
  left: 0;
1468
1472
  max-height: var(--m-menubar-submenu-max-height);
1473
+ max-width: calc(100vw - 2 * var(--m-space-4));
1469
1474
  min-width: var(--m-menubar-menu-min-width);
1470
1475
  overflow: hidden;
1471
1476
  padding: var(--m-space-1);
1472
1477
  position: absolute;
1473
1478
  top: calc(100% + var(--m-space-1));
1479
+ /* Grow with the content: shrink-to-fit would clamp to the trigger item
1480
+ width (the containing block) when not teleported. */
1481
+ width: max-content;
1474
1482
  z-index: var(--m-z-popper);
1475
1483
  }
1476
1484