@m3ui-vue/m3ui-vue 0.6.2 → 0.6.3

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.
@@ -1,4 +1,6 @@
1
- type __VLS_Props = {
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
2
4
  modelValue: boolean;
3
5
  title?: string;
4
6
  icon?: string;
@@ -15,20 +17,28 @@ type __VLS_Props = {
15
17
  x?: number;
16
18
  y?: number;
17
19
  resetPosition?: boolean;
18
- };
19
- declare var __VLS_1: {}, __VLS_8: {}, __VLS_20: {};
20
- type __VLS_Slots = {} & {
21
- header?: (props: typeof __VLS_1) => any;
22
- } & {
23
- actions?: (props: typeof __VLS_8) => any;
24
- } & {
25
- default?: (props: typeof __VLS_20) => any;
26
- };
27
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
28
21
  "update:modelValue": (value: boolean) => any;
29
22
  close: () => any;
30
23
  minimize: () => any;
31
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
24
+ }, string, import("vue").PublicProps, Readonly<{
25
+ modelValue: boolean;
26
+ title?: string;
27
+ icon?: string;
28
+ width?: string;
29
+ height?: string;
30
+ minWidth?: number;
31
+ minHeight?: number;
32
+ maxWidth?: number;
33
+ maxHeight?: number;
34
+ resizable?: boolean;
35
+ draggable?: boolean;
36
+ closable?: boolean;
37
+ minimizable?: boolean;
38
+ x?: number;
39
+ y?: number;
40
+ resetPosition?: boolean;
41
+ }> & Readonly<{
32
42
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
33
43
  onClose?: (() => any) | undefined;
34
44
  onMinimize?: (() => any) | undefined;
@@ -44,10 +54,13 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
44
54
  draggable: boolean;
45
55
  resizable: boolean;
46
56
  resetPosition: boolean;
47
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
48
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
49
- declare const _default: typeof __VLS_export;
50
- export default _default;
57
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
58
+ header?: (props: {}) => any;
59
+ } & {
60
+ actions?: (props: {}) => any;
61
+ } & {
62
+ default?: (props: {}) => any;
63
+ }>;
51
64
  type __VLS_WithSlots<T, S> = T & {
52
65
  new (): {
53
66
  $slots: S;
package/dist/m3ui.js CHANGED
@@ -13043,7 +13043,7 @@ var Af = /*#__PURE__*/ p(Df, [["render", kf]]), jf = ["disabled"], Mf = ["disabl
13043
13043
  C("div", gg, [C("span", _g, [T(q(d.value.length.toLocaleString()) + " filas ", 1), p.value.end - p.value.start < d.value.length ? (R(), S(m, { key: 0 }, [T(" · mostrando " + q(p.value.start + 1) + "–" + q(p.value.end), 1)], 64)) : x("", !0)])])
13044
13044
  ]));
13045
13045
  }
13046
- }), yg = { class: "text-title-small font-medium text-on-surface truncate flex-1" }, bg = { class: "flex-1 overflow-auto" }, xg = ["onMousedown", "onTouchstart"], Sg = /* @__PURE__ */ D({
13046
+ }), yg = { class: "text-title-small font-medium text-on-surface truncate flex-1" }, bg = { class: "flex-1 overflow-auto" }, xg = ["onMousedown", "onTouchstart"], Sg = 10, Cg = /* @__PURE__ */ D({
13047
13047
  __name: "MWindow",
13048
13048
  props: {
13049
13049
  modelValue: { type: Boolean },
@@ -13084,17 +13084,17 @@ var Af = /*#__PURE__*/ p(Df, [["render", kf]]), jf = ["disabled"], Mf = ["disabl
13084
13084
  "minimize"
13085
13085
  ],
13086
13086
  setup(e, { emit: t }) {
13087
- let n = e, i = t, a = V(n.x), o = V(n.y), s = V(parseInt(n.width) || 400), c = V(parseInt(n.height) || 300), l = V(!1), u = V(100), d = 100, f = V(null), p = !1, h = 0, g = 0, _ = 0, y = 0, w = !1, T = "se", D = 0, O = 0, k = 0, A = 0, j = 0, F = 0, z = v(() => ({
13087
+ let n = e, i = t, a = V(n.x), o = V(n.y), s = V(parseInt(n.width) || 400), c = V(parseInt(n.height) || 300), l = V(!1), u = V(Sg), d = V(null), f = !1, p = 0, h = 0, g = 0, _ = 0, y = !1, w = "se", T = 0, D = 0, O = 0, k = 0, A = 0, j = 0, F = v(() => ({
13088
13088
  left: `${a.value}px`,
13089
13089
  top: `${o.value}px`,
13090
13090
  width: `${s.value}px`,
13091
13091
  height: l.value ? "auto" : `${c.value}px`,
13092
13092
  zIndex: u.value
13093
13093
  }));
13094
- function B() {
13095
- d++, u.value = d;
13094
+ function z() {
13095
+ Sg++, u.value = Sg;
13096
13096
  }
13097
- function W(e) {
13097
+ function B(e) {
13098
13098
  if ("touches" in e) {
13099
13099
  let t = e.touches[0] ?? e.changedTouches[0];
13100
13100
  return {
@@ -13107,73 +13107,73 @@ var Af = /*#__PURE__*/ p(Df, [["render", kf]]), jf = ["disabled"], Mf = ["disabl
13107
13107
  y: e.clientY
13108
13108
  };
13109
13109
  }
13110
- function G() {
13111
- document.addEventListener("mousemove", X), document.addEventListener("mouseup", ee), document.addEventListener("touchmove", X, { passive: !1 }), document.addEventListener("touchend", ee);
13110
+ function W() {
13111
+ document.addEventListener("mousemove", Y), document.addEventListener("mouseup", X), document.addEventListener("touchmove", Y, { passive: !1 }), document.addEventListener("touchend", X);
13112
13112
  }
13113
- function K() {
13114
- document.removeEventListener("mousemove", X), document.removeEventListener("mouseup", ee), document.removeEventListener("touchmove", X), document.removeEventListener("touchend", ee);
13113
+ function G() {
13114
+ document.removeEventListener("mousemove", Y), document.removeEventListener("mouseup", X), document.removeEventListener("touchmove", Y), document.removeEventListener("touchend", X);
13115
13115
  }
13116
- function J(e) {
13116
+ function K(e) {
13117
13117
  if (!n.draggable || e.target.closest("button")) return;
13118
13118
  e.preventDefault();
13119
- let { x: t, y: r } = W(e);
13120
- p = !0, h = t, g = r, _ = a.value, y = o.value, B(), G();
13119
+ let { x: t, y: r } = B(e);
13120
+ f = !0, p = t, h = r, g = a.value, _ = o.value, z(), W();
13121
13121
  }
13122
- function Y(e, t) {
13122
+ function J(e, t) {
13123
13123
  if (!n.resizable) return;
13124
13124
  e.preventDefault(), e.stopPropagation();
13125
- let { x: r, y: i } = W(e);
13126
- w = !0, T = t, D = r, O = i, k = s.value, A = c.value, j = a.value, F = o.value, B(), G();
13125
+ let { x: r, y: i } = B(e);
13126
+ y = !0, w = t, T = r, D = i, O = s.value, k = c.value, A = a.value, j = o.value, z(), W();
13127
13127
  }
13128
- function X(e) {
13128
+ function Y(e) {
13129
13129
  e.preventDefault();
13130
- let { x: t, y: r } = W(e);
13131
- if (p) {
13132
- let e = t - h, n = r - g, i = f.value?.parentElement, u = i ? i.clientWidth - s.value : Infinity, d = i ? i.clientHeight - (l.value ? 40 : c.value) : Infinity;
13133
- a.value = Math.max(0, Math.min(u, _ + e)), o.value = Math.max(0, Math.min(d, y + n));
13130
+ let { x: t, y: r } = B(e);
13131
+ if (f) {
13132
+ let e = t - p, n = r - h, i = d.value?.parentElement, u = i ? i.clientWidth - s.value : Infinity, f = i ? i.clientHeight - (l.value ? 40 : c.value) : Infinity;
13133
+ a.value = Math.max(0, Math.min(u, g + e)), o.value = Math.max(0, Math.min(f, _ + n));
13134
13134
  }
13135
- if (w) {
13136
- let e = t - D, i = r - O, o = T, l = f.value?.parentElement, u = l ? l.clientWidth : Infinity, d = l ? l.clientHeight : Infinity, p = (e) => Math.min(n.maxWidth ?? Infinity, Math.max(n.minWidth, e)), m = (e) => Math.min(n.maxHeight ?? Infinity, Math.max(n.minHeight, e));
13137
- if (o.includes("e") && (s.value = Math.min(u - j, p(k + e))), o.includes("w")) {
13138
- let t = Math.min(j + k, p(k - e));
13139
- a.value = Math.max(0, j + (k - t)), s.value = t;
13135
+ if (y) {
13136
+ let e = t - T, i = r - D, o = w, l = d.value?.parentElement, u = l ? l.clientWidth : Infinity, f = l ? l.clientHeight : Infinity, p = (e) => Math.min(n.maxWidth ?? Infinity, Math.max(n.minWidth, e)), m = (e) => Math.min(n.maxHeight ?? Infinity, Math.max(n.minHeight, e));
13137
+ if (o.includes("e") && (s.value = Math.min(u - A, p(O + e))), o.includes("w")) {
13138
+ let t = Math.min(A + O, p(O - e));
13139
+ a.value = Math.max(0, A + (O - t)), s.value = t;
13140
13140
  }
13141
- o.includes("s") && (c.value = Math.min(d - F, m(A + i)));
13141
+ o.includes("s") && (c.value = Math.min(f - j, m(k + i)));
13142
13142
  }
13143
13143
  }
13144
+ function X() {
13145
+ f = !1, y = !1, G();
13146
+ }
13144
13147
  function ee() {
13145
- p = !1, w = !1, K();
13148
+ i("update:modelValue", !1), i("close"), n.resetPosition && (a.value = n.x, o.value = n.y, s.value = parseInt(n.width) || 400, c.value = parseInt(n.height) || 300, l.value = !1);
13146
13149
  }
13147
13150
  function te() {
13148
- i("update:modelValue", !1), i("close"), n.resetPosition && (a.value = n.x, o.value = n.y, s.value = parseInt(n.width) || 400, c.value = parseInt(n.height) || 300, l.value = !1);
13151
+ l.value = !l.value, i("minimize");
13149
13152
  }
13150
13153
  function re() {
13151
- l.value = !l.value, i("minimize");
13154
+ z();
13152
13155
  }
13153
13156
  function Q() {
13154
- B();
13155
- }
13156
- function ae() {
13157
- let e = f.value?.parentElement;
13157
+ let e = d.value?.parentElement;
13158
13158
  if (!e) return;
13159
13159
  let t = e.clientWidth, r = e.clientHeight;
13160
13160
  s.value > t && (s.value = Math.max(n.minWidth, t)), c.value > r && (c.value = Math.max(n.minHeight, r)), a.value + s.value > t && (a.value = Math.max(0, t - s.value)), o.value + c.value > r && (o.value = Math.max(0, r - c.value));
13161
13161
  }
13162
- let $ = null;
13162
+ let ae = null;
13163
13163
  I(() => {
13164
- ae();
13165
- let e = f.value?.parentElement;
13166
- e && ($ = new ResizeObserver(ae), $.observe(e));
13164
+ Q();
13165
+ let e = d.value?.parentElement;
13166
+ e && (ae = new ResizeObserver(Q), ae.observe(e));
13167
13167
  }), Z(() => n.x, (e) => {
13168
13168
  a.value = e;
13169
13169
  }), Z(() => n.y, (e) => {
13170
13170
  o.value = e;
13171
13171
  }), Z(() => n.modelValue, (e) => {
13172
- e && M(ae);
13172
+ e && M(Q);
13173
13173
  }), L(() => {
13174
- K(), $?.disconnect();
13174
+ G(), ae?.disconnect();
13175
13175
  });
13176
- let oe = [
13176
+ let $ = [
13177
13177
  {
13178
13178
  dir: "s",
13179
13179
  class: "bottom-0 left-[20px] right-[20px] h-[8px]",
@@ -13203,15 +13203,15 @@ var Af = /*#__PURE__*/ p(Df, [["render", kf]]), jf = ["disabled"], Mf = ["disabl
13203
13203
  return (t, n) => e.modelValue ? (R(), S("div", {
13204
13204
  key: 0,
13205
13205
  ref_key: "windowRef",
13206
- ref: f,
13206
+ ref: d,
13207
13207
  class: "absolute flex flex-col rounded-xl bg-surface shadow-elevation-3 overflow-hidden",
13208
- style: P(z.value),
13209
- onMousedown: Q
13208
+ style: P(F.value),
13209
+ onMousedown: re
13210
13210
  }, [
13211
13211
  C("div", {
13212
13212
  class: N(["flex items-center gap-2 px-4 h-10 bg-surface-container select-none shrink-0", { "cursor-move": e.draggable }]),
13213
- onMousedown: J,
13214
- onTouchstart: J
13213
+ onMousedown: K,
13214
+ onTouchstart: K
13215
13215
  }, [
13216
13216
  U(t.$slots, "header", {}, () => [e.icon ? (R(), b(r, {
13217
13217
  key: 0,
@@ -13223,7 +13223,7 @@ var Af = /*#__PURE__*/ p(Df, [["render", kf]]), jf = ["disabled"], Mf = ["disabl
13223
13223
  e.minimizable ? (R(), S("button", {
13224
13224
  key: 0,
13225
13225
  class: "text-on-surface-variant hover:bg-on-surface/8 rounded-full w-7 h-7 flex items-center justify-center transition-colors",
13226
- onClick: re
13226
+ onClick: te
13227
13227
  }, [E(r, {
13228
13228
  name: l.value ? "open_in_full" : "minimize",
13229
13229
  size: 16
@@ -13231,23 +13231,23 @@ var Af = /*#__PURE__*/ p(Df, [["render", kf]]), jf = ["disabled"], Mf = ["disabl
13231
13231
  e.closable ? (R(), S("button", {
13232
13232
  key: 1,
13233
13233
  class: "text-on-surface-variant hover:bg-error/12 hover:text-error rounded-full w-7 h-7 flex items-center justify-center transition-colors",
13234
- onClick: te
13234
+ onClick: ee
13235
13235
  }, [E(r, {
13236
13236
  name: "close",
13237
13237
  size: 16
13238
13238
  })])) : x("", !0)
13239
13239
  ], 34),
13240
13240
  ie(C("div", bg, [U(t.$slots, "default")], 512), [[ne, !l.value]]),
13241
- e.resizable && !l.value ? (R(), S(m, { key: 0 }, H(oe, (e) => C("div", {
13241
+ e.resizable && !l.value ? (R(), S(m, { key: 0 }, H($, (e) => C("div", {
13242
13242
  key: e.dir,
13243
13243
  class: N(["absolute", [e.class, e.cursor]]),
13244
- onMousedown: (t) => Y(t, e.dir),
13245
- onTouchstart: (t) => Y(t, e.dir)
13244
+ onMousedown: (t) => J(t, e.dir),
13245
+ onTouchstart: (t) => J(t, e.dir)
13246
13246
  }, null, 42, xg)), 64)) : x("", !0)
13247
13247
  ], 36)) : x("", !0);
13248
13248
  }
13249
13249
  });
13250
13250
  //#endregion
13251
- export { yt as MAbsolute, Tt as MAlert, Yt as MAppBar, $t as MAppLayout, en as MAspectRatio, Gt as MAutocomplete, tn as MAvatar, an as MBadge, gn as MBar, Sn as MBottomSheet, Cn as MBox, En as MBreadcrumbs, i as MButton, An as MButtonGroup, Hn as MCalendar, Yn as MCard, nr as MCarousel, rr as MCenter, or as MChatBubble, lr as MCheckbox, dr as MChip, Ku as MCircleProgressBar, Sr as MColorPicker, Pr as MColorPickerModal, Jr as MCommandPalette, Xr as MConfirmDialog, Zr as MContainer, Qr as MContextMenu, $r as MCopyButton, ki as MDataTable, Bi as MDatePicker, ea as MDatePickerModal, fa as MDateRangePicker, Oa as MDateRangePickerModal, o as MDialog, Ma as MDivider, Ra as MDragDropList, Ba as MEmoji, Ka as MEmojiButton, eo as MEmojiSelector, to as MEmptyState, co as MExpansionPanel, lo as MExportButton, ho as MFab, jo as MFileUpload, Mo as MFixed, Ro as MFlex, Lo as MFooter, zo as MFullscreen, Bo as MGrid, Ko as MHotkeys, r as MIcon, l as MIconButton, Xo as MInfiniteScroll, as as MJsonViewer, hs as MKanban, vs as MKbd, Os as MLightbox, ks as MList, Us as MListItem, Ws as MListSubheader, Js as MLoadingOverlay, oc as MMaskField, Ys as MMasonry, c as MMenu, $s as MMenuDivider, f as MMenuItem, kc as MMultiAutocomplete, el as MMultiSelect, rl as MNavigationBar, Kl as MNavigationDrawer, Xl as MNavigationRail, dl as MNumberField, Ql as MOverlay, eu as MPageProgress, ni as MPagination, ru as MPasswordMeter, du as MPinInput, Du as MProgressBar, Zu as MRadio, ed as MRadioGroup, nd as MRating, od as MRelative, cd as MRelativeTime, ld as MResponsive, gd as MResult, Md as MScheduler, Nd as MScrollable, Rd as MSection, Vd as MSegmentedButton, of as MSelect, df as MShader, _f as MSideSheet, yf as MSignaturePad, xf as MSkeleton, Ef as MSlider, Se as MSnackbar, Af as MSpacer, s as MSpinner, Pf as MSplitButton, Ff as MSplitter, Qf as MSpotlightSearch, $f as MStack, cp as MStatCard, wp as MStepper, Tp as MSticky, Dp as MSubtitle, Ms as MSwitch, Yp as MTable, um as MTabs, rm as MTagInput, Ep as MText, u as MTextField, Pm as MTimePicker, Qm as MTimePickerModal, Sm as MTimeline, $m as MTitle, oh as MToolbar, rh as MTooltip, uh as MTopAppBar, vh as MTour, Vh as MTransferList, Zh as MTree, cg as MTreeTable, vg as MVirtualTable, Sg as MWindow, Ha as allEmojis, fe as createM3UI, e as defaultLocale, Va as emojiCategories, oe as palettes, Ua as randomEmoji, le as useColorPalette, d as useDebounce, He as useDevice, a as useFieldBg, t as useLocale, lt as useNotification, vt as usePageProgress, ge as useTheme, Le as useToast };
13251
+ export { yt as MAbsolute, Tt as MAlert, Yt as MAppBar, $t as MAppLayout, en as MAspectRatio, Gt as MAutocomplete, tn as MAvatar, an as MBadge, gn as MBar, Sn as MBottomSheet, Cn as MBox, En as MBreadcrumbs, i as MButton, An as MButtonGroup, Hn as MCalendar, Yn as MCard, nr as MCarousel, rr as MCenter, or as MChatBubble, lr as MCheckbox, dr as MChip, Ku as MCircleProgressBar, Sr as MColorPicker, Pr as MColorPickerModal, Jr as MCommandPalette, Xr as MConfirmDialog, Zr as MContainer, Qr as MContextMenu, $r as MCopyButton, ki as MDataTable, Bi as MDatePicker, ea as MDatePickerModal, fa as MDateRangePicker, Oa as MDateRangePickerModal, o as MDialog, Ma as MDivider, Ra as MDragDropList, Ba as MEmoji, Ka as MEmojiButton, eo as MEmojiSelector, to as MEmptyState, co as MExpansionPanel, lo as MExportButton, ho as MFab, jo as MFileUpload, Mo as MFixed, Ro as MFlex, Lo as MFooter, zo as MFullscreen, Bo as MGrid, Ko as MHotkeys, r as MIcon, l as MIconButton, Xo as MInfiniteScroll, as as MJsonViewer, hs as MKanban, vs as MKbd, Os as MLightbox, ks as MList, Us as MListItem, Ws as MListSubheader, Js as MLoadingOverlay, oc as MMaskField, Ys as MMasonry, c as MMenu, $s as MMenuDivider, f as MMenuItem, kc as MMultiAutocomplete, el as MMultiSelect, rl as MNavigationBar, Kl as MNavigationDrawer, Xl as MNavigationRail, dl as MNumberField, Ql as MOverlay, eu as MPageProgress, ni as MPagination, ru as MPasswordMeter, du as MPinInput, Du as MProgressBar, Zu as MRadio, ed as MRadioGroup, nd as MRating, od as MRelative, cd as MRelativeTime, ld as MResponsive, gd as MResult, Md as MScheduler, Nd as MScrollable, Rd as MSection, Vd as MSegmentedButton, of as MSelect, df as MShader, _f as MSideSheet, yf as MSignaturePad, xf as MSkeleton, Ef as MSlider, Se as MSnackbar, Af as MSpacer, s as MSpinner, Pf as MSplitButton, Ff as MSplitter, Qf as MSpotlightSearch, $f as MStack, cp as MStatCard, wp as MStepper, Tp as MSticky, Dp as MSubtitle, Ms as MSwitch, Yp as MTable, um as MTabs, rm as MTagInput, Ep as MText, u as MTextField, Pm as MTimePicker, Qm as MTimePickerModal, Sm as MTimeline, $m as MTitle, oh as MToolbar, rh as MTooltip, uh as MTopAppBar, vh as MTour, Vh as MTransferList, Zh as MTree, cg as MTreeTable, vg as MVirtualTable, Cg as MWindow, Ha as allEmojis, fe as createM3UI, e as defaultLocale, Va as emojiCategories, oe as palettes, Ua as randomEmoji, le as useColorPalette, d as useDebounce, He as useDevice, a as useFieldBg, t as useLocale, lt as useNotification, vt as usePageProgress, ge as useTheme, Le as useToast };
13252
13252
 
13253
13253
  //# sourceMappingURL=m3ui.js.map