@m2s2/vue-lib 2.5.1 → 2.5.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.
Files changed (132) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.mjs +58 -57
  3. package/dist/{index16.cjs → index17.cjs} +1 -1
  4. package/dist/{index16.mjs → index17.mjs} +1 -1
  5. package/dist/{index22.cjs → index23.cjs} +1 -1
  6. package/dist/{index22.mjs → index23.mjs} +1 -1
  7. package/dist/{index24.cjs → index25.cjs} +1 -1
  8. package/dist/{index24.mjs → index25.mjs} +1 -1
  9. package/dist/{index26.cjs → index27.cjs} +1 -1
  10. package/dist/{index26.mjs → index27.mjs} +2 -2
  11. package/dist/{index28.cjs → index29.cjs} +1 -1
  12. package/dist/{index28.mjs → index29.mjs} +1 -1
  13. package/dist/{index30.cjs → index31.cjs} +1 -1
  14. package/dist/{index30.mjs → index31.mjs} +1 -1
  15. package/dist/index35.cjs +1 -1
  16. package/dist/index35.mjs +40 -9
  17. package/dist/index36.cjs +1 -1
  18. package/dist/index36.mjs +9 -85
  19. package/dist/index37.cjs +1 -0
  20. package/dist/index37.mjs +87 -0
  21. package/dist/index39.cjs +1 -1
  22. package/dist/index39.mjs +30 -9
  23. package/dist/index40.cjs +1 -1
  24. package/dist/index40.mjs +9 -26
  25. package/dist/index41.cjs +1 -0
  26. package/dist/index41.mjs +28 -0
  27. package/dist/index43.cjs +1 -1
  28. package/dist/index43.mjs +30 -9
  29. package/dist/index44.cjs +1 -1
  30. package/dist/index44.mjs +9 -34
  31. package/dist/index45.cjs +1 -1
  32. package/dist/index45.mjs +34 -9
  33. package/dist/index46.cjs +1 -1
  34. package/dist/index46.mjs +9 -49
  35. package/dist/index47.cjs +1 -0
  36. package/dist/index47.mjs +51 -0
  37. package/dist/index51.cjs +1 -1
  38. package/dist/index51.mjs +27 -3
  39. package/dist/index52.cjs +1 -1
  40. package/dist/index52.mjs +1 -1
  41. package/dist/index53.cjs +1 -1
  42. package/dist/index53.mjs +1 -1
  43. package/dist/index54.cjs +1 -1
  44. package/dist/index54.mjs +1 -1
  45. package/dist/index55.cjs +1 -1
  46. package/dist/index55.mjs +1 -1
  47. package/dist/index56.cjs +1 -1
  48. package/dist/index56.mjs +1 -1
  49. package/dist/index57.cjs +1 -1
  50. package/dist/index57.mjs +1 -1
  51. package/dist/index58.cjs +1 -1
  52. package/dist/index58.mjs +1 -1
  53. package/dist/index59.cjs +1 -1
  54. package/dist/index59.mjs +1 -1
  55. package/dist/index60.cjs +1 -1
  56. package/dist/index60.mjs +1 -1
  57. package/dist/index61.cjs +1 -1
  58. package/dist/index61.mjs +1 -1
  59. package/dist/index62.cjs +1 -1
  60. package/dist/index62.mjs +1 -1
  61. package/dist/index63.cjs +1 -1
  62. package/dist/index63.mjs +1 -1
  63. package/dist/index64.cjs +1 -1
  64. package/dist/index64.mjs +1 -1
  65. package/dist/index65.cjs +1 -1
  66. package/dist/index65.mjs +1 -1
  67. package/dist/index66.cjs +1 -1
  68. package/dist/index66.mjs +1 -1
  69. package/dist/index67.cjs +1 -1
  70. package/dist/index67.mjs +3 -2
  71. package/dist/index68.cjs +1 -1
  72. package/dist/index68.mjs +2 -3
  73. package/dist/index69.cjs +1 -1
  74. package/dist/index69.mjs +3 -2
  75. package/dist/index70.cjs +1 -1
  76. package/dist/index70.mjs +2 -3
  77. package/dist/index71.cjs +1 -1
  78. package/dist/index71.mjs +3 -2
  79. package/dist/index72.cjs +1 -1
  80. package/dist/index72.mjs +1 -1
  81. package/dist/index73.cjs +1 -1
  82. package/dist/index73.mjs +2 -3
  83. package/dist/index74.cjs +1 -1
  84. package/dist/index74.mjs +1 -1
  85. package/dist/index75.cjs +1 -1
  86. package/dist/index75.mjs +3 -4
  87. package/dist/index76.cjs +1 -1
  88. package/dist/index76.mjs +51 -22
  89. package/dist/index77.cjs +59 -1
  90. package/dist/index77.mjs +1149 -5
  91. package/dist/index78.cjs +1 -59
  92. package/dist/index78.mjs +18 -1146
  93. package/dist/index80.cjs +1 -1
  94. package/dist/index80.mjs +4 -51
  95. package/dist/index81.cjs +1 -1
  96. package/dist/index81.mjs +6 -2
  97. package/dist/index82.cjs +1 -0
  98. package/dist/index82.mjs +4 -0
  99. package/dist/vue-lib/src/index.d.ts +1 -0
  100. package/dist/vue-lib/src/index.d.ts.map +1 -1
  101. package/dist/vue-lib.css +1 -1
  102. package/package.json +4 -1
  103. package/dist/index34.cjs +0 -1
  104. package/dist/index34.mjs +0 -42
  105. package/dist/index38.cjs +0 -1
  106. package/dist/index38.mjs +0 -32
  107. package/dist/index42.cjs +0 -1
  108. package/dist/index42.mjs +0 -32
  109. package/dist/index50.cjs +0 -1
  110. package/dist/index50.mjs +0 -29
  111. /package/dist/{index10.cjs → index11.cjs} +0 -0
  112. /package/dist/{index10.mjs → index11.mjs} +0 -0
  113. /package/dist/{index12.cjs → index13.cjs} +0 -0
  114. /package/dist/{index12.mjs → index13.mjs} +0 -0
  115. /package/dist/{index14.cjs → index15.cjs} +0 -0
  116. /package/dist/{index14.mjs → index15.mjs} +0 -0
  117. /package/dist/{index18.cjs → index19.cjs} +0 -0
  118. /package/dist/{index18.mjs → index19.mjs} +0 -0
  119. /package/dist/{index20.cjs → index21.cjs} +0 -0
  120. /package/dist/{index20.mjs → index21.mjs} +0 -0
  121. /package/dist/{index2.cjs → index3.cjs} +0 -0
  122. /package/dist/{index2.mjs → index3.mjs} +0 -0
  123. /package/dist/{index32.cjs → index33.cjs} +0 -0
  124. /package/dist/{index32.mjs → index33.mjs} +0 -0
  125. /package/dist/{index48.cjs → index49.cjs} +0 -0
  126. /package/dist/{index48.mjs → index49.mjs} +0 -0
  127. /package/dist/{index4.cjs → index5.cjs} +0 -0
  128. /package/dist/{index4.mjs → index5.mjs} +0 -0
  129. /package/dist/{index6.cjs → index7.cjs} +0 -0
  130. /package/dist/{index6.mjs → index7.mjs} +0 -0
  131. /package/dist/{index8.cjs → index9.cjs} +0 -0
  132. /package/dist/{index8.mjs → index9.mjs} +0 -0
package/dist/index39.mjs CHANGED
@@ -1,11 +1,32 @@
1
- import { inject as n } from "vue";
2
- const r = Symbol("panel");
3
- function o() {
4
- const e = n(r);
5
- if (!e) throw new Error("usePanel must be used within a <PanelProvider>");
6
- return e;
7
- }
1
+ import { defineComponent as a, ref as u, provide as m, openBlock as r, createElementBlock as i, Fragment as c, renderSlot as p, createBlock as s, createCommentVNode as f } from "vue";
2
+ import d from "./index37.mjs";
3
+ /* empty css */
4
+ import { PANEL_KEY as v } from "./index40.mjs";
5
+ const $ = /* @__PURE__ */ a({
6
+ __name: "PanelProvider",
7
+ setup(_) {
8
+ const n = u(null);
9
+ function l(o) {
10
+ return new Promise((e) => {
11
+ n.value = { data: o, resolve: e };
12
+ });
13
+ }
14
+ function t(o) {
15
+ var e;
16
+ (e = n.value) == null || e.resolve(o), n.value = null;
17
+ }
18
+ return m(v, { panel: l }), (o, e) => (r(), i(c, null, [
19
+ p(o.$slots, "default"),
20
+ n.value ? (r(), s(d, {
21
+ key: 0,
22
+ data: n.value.data,
23
+ open: !0,
24
+ onAction: t,
25
+ onClose: e[0] || (e[0] = (k) => t(null))
26
+ }, null, 8, ["data"])) : f("", !0)
27
+ ], 64));
28
+ }
29
+ });
8
30
  export {
9
- r as PANEL_KEY,
10
- o as usePanel
31
+ $ as default
11
32
  };
package/dist/index40.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),o=["disabled","aria-busy"],l={key:0,class:"m2s2-btn-spinner","aria-hidden":"true"},i=e.defineComponent({inheritAttrs:!1,__name:"LoadingButton",props:{loading:{type:Boolean,default:!1},loadingText:{default:void 0}},setup(t){const n=e.useAttrs();return(a,s)=>(e.openBlock(),e.createElementBlock("button",e.mergeProps(e.unref(n),{disabled:t.loading||e.unref(n).disabled,"aria-busy":t.loading}),[t.loading?(e.openBlock(),e.createElementBlock("span",l)):e.createCommentVNode("",!0),!t.loading||!t.loadingText?e.renderSlot(a.$slots,"default",{key:1}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(t.loadingText),1)],64))],16,o))}});module.exports=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),n=Symbol("panel");function r(){const e=t.inject(n);if(!e)throw new Error("usePanel must be used within a <PanelProvider>");return e}exports.PANEL_KEY=n;exports.usePanel=r;
package/dist/index40.mjs CHANGED
@@ -1,28 +1,11 @@
1
- import { defineComponent as i, useAttrs as l, openBlock as t, createElementBlock as a, mergeProps as s, unref as o, createCommentVNode as r, renderSlot as u, Fragment as c, createTextVNode as g, toDisplayString as m } from "vue";
2
- const f = ["disabled", "aria-busy"], b = {
3
- key: 0,
4
- class: "m2s2-btn-spinner",
5
- "aria-hidden": "true"
6
- }, k = /* @__PURE__ */ i({
7
- inheritAttrs: !1,
8
- __name: "LoadingButton",
9
- props: {
10
- loading: { type: Boolean, default: !1 },
11
- loadingText: { default: void 0 }
12
- },
13
- setup(e) {
14
- const n = l();
15
- return (d, y) => (t(), a("button", s(o(n), {
16
- disabled: e.loading || o(n).disabled,
17
- "aria-busy": e.loading
18
- }), [
19
- e.loading ? (t(), a("span", b)) : r("", !0),
20
- !e.loading || !e.loadingText ? u(d.$slots, "default", { key: 1 }) : (t(), a(c, { key: 2 }, [
21
- g(m(e.loadingText), 1)
22
- ], 64))
23
- ], 16, f));
24
- }
25
- });
1
+ import { inject as n } from "vue";
2
+ const r = Symbol("panel");
3
+ function o() {
4
+ const e = n(r);
5
+ if (!e) throw new Error("usePanel must be used within a <PanelProvider>");
6
+ return e;
7
+ }
26
8
  export {
27
- k as default
9
+ r as PANEL_KEY,
10
+ o as usePanel
28
11
  };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),o=["disabled","aria-busy"],l={key:0,class:"m2s2-btn-spinner","aria-hidden":"true"},i=e.defineComponent({inheritAttrs:!1,__name:"LoadingButton",props:{loading:{type:Boolean,default:!1},loadingText:{default:void 0}},setup(t){const n=e.useAttrs();return(a,s)=>(e.openBlock(),e.createElementBlock("button",e.mergeProps(e.unref(n),{disabled:t.loading||e.unref(n).disabled,"aria-busy":t.loading}),[t.loading?(e.openBlock(),e.createElementBlock("span",l)):e.createCommentVNode("",!0),!t.loading||!t.loadingText?e.renderSlot(a.$slots,"default",{key:1}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(t.loadingText),1)],64))],16,o))}});module.exports=i;
@@ -0,0 +1,28 @@
1
+ import { defineComponent as i, useAttrs as l, openBlock as t, createElementBlock as a, mergeProps as s, unref as o, createCommentVNode as r, renderSlot as u, Fragment as c, createTextVNode as g, toDisplayString as m } from "vue";
2
+ const f = ["disabled", "aria-busy"], b = {
3
+ key: 0,
4
+ class: "m2s2-btn-spinner",
5
+ "aria-hidden": "true"
6
+ }, k = /* @__PURE__ */ i({
7
+ inheritAttrs: !1,
8
+ __name: "LoadingButton",
9
+ props: {
10
+ loading: { type: Boolean, default: !1 },
11
+ loadingText: { default: void 0 }
12
+ },
13
+ setup(e) {
14
+ const n = l();
15
+ return (d, y) => (t(), a("button", s(o(n), {
16
+ disabled: e.loading || o(n).disabled,
17
+ "aria-busy": e.loading
18
+ }), [
19
+ e.loading ? (t(), a("span", b)) : r("", !0),
20
+ !e.loading || !e.loadingText ? u(d.$slots, "default", { key: 1 }) : (t(), a(c, { key: 2 }, [
21
+ g(m(e.loadingText), 1)
22
+ ], 64))
23
+ ], 16, f));
24
+ }
25
+ });
26
+ export {
27
+ k as default
28
+ };
package/dist/index43.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),t=Symbol("theme");function o(){const e=r.inject(t);if(!e)throw new Error("useTheme must be used within a <ThemeProvider>");return e}exports.THEME_KEY=t;exports.useTheme=o;
1
+ "use strict";const t=require("vue"),c=require("./index44.cjs"),u="m2s2-theme",d=t.defineComponent({__name:"ThemeProvider",props:{defaultTheme:{default:"auto"}},setup(r){const n=r;function m(){return localStorage.getItem(u)??n.defaultTheme}function a(e){e==="auto"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}const o=t.ref(n.defaultTheme);t.onMounted(()=>{o.value=m()}),t.watch(o,e=>{localStorage.setItem(u,e),a(e)},{immediate:!1});function s(e){o.value=e}return t.provide(c.THEME_KEY,{get theme(){return o.value},setTheme:s}),(e,l)=>t.renderSlot(e.$slots,"default")}});module.exports=d;
package/dist/index43.mjs CHANGED
@@ -1,11 +1,32 @@
1
- import { inject as t } from "vue";
2
- const r = Symbol("theme");
3
- function m() {
4
- const e = t(r);
5
- if (!e) throw new Error("useTheme must be used within a <ThemeProvider>");
6
- return e;
7
- }
1
+ import { defineComponent as d, ref as l, onMounted as c, watch as s, provide as f, renderSlot as i } from "vue";
2
+ import { THEME_KEY as h } from "./index44.mjs";
3
+ const m = "m2s2-theme", _ = /* @__PURE__ */ d({
4
+ __name: "ThemeProvider",
5
+ props: {
6
+ defaultTheme: { default: "auto" }
7
+ },
8
+ setup(a) {
9
+ const o = a;
10
+ function n() {
11
+ return localStorage.getItem(m) ?? o.defaultTheme;
12
+ }
13
+ function r(e) {
14
+ e === "auto" ? document.documentElement.removeAttribute("data-theme") : document.documentElement.setAttribute("data-theme", e);
15
+ }
16
+ const t = l(o.defaultTheme);
17
+ c(() => {
18
+ t.value = n();
19
+ }), s(t, (e) => {
20
+ localStorage.setItem(m, e), r(e);
21
+ }, { immediate: !1 });
22
+ function u(e) {
23
+ t.value = e;
24
+ }
25
+ return f(h, { get theme() {
26
+ return t.value;
27
+ }, setTheme: u }), (e, p) => i(e.$slots, "default");
28
+ }
29
+ });
8
30
  export {
9
- r as THEME_KEY,
10
- m as useTheme
31
+ _ as default
11
32
  };
package/dist/index44.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),v=require("./index45.cjs"),d=e.defineComponent({__name:"AuthProvider",props:{provider:{}},setup(i){const u=i,r=e.ref(void 0),t=e.ref(!1),a=e.ref(!0);let o;e.onMounted(async()=>{const n=await u.provider.getCurrentUser();r.value=n,t.value=!!n,a.value=!1,o=u.provider.subscribeToAuthState(s=>{t.value=s,s||(r.value=void 0)})}),e.onUnmounted(()=>o==null?void 0:o());async function l(){await u.provider.signOut(),r.value=void 0,t.value=!1}return e.provide(v.AUTH_KEY,{get user(){return r.value},get loggedIn(){return t.value},get loading(){return a.value},signOut:l}),(n,s)=>e.renderSlot(n.$slots,"default")}});module.exports=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),t=Symbol("theme");function o(){const e=r.inject(t);if(!e)throw new Error("useTheme must be used within a <ThemeProvider>");return e}exports.THEME_KEY=t;exports.useTheme=o;
package/dist/index44.mjs CHANGED
@@ -1,36 +1,11 @@
1
- import { defineComponent as v, ref as a, onMounted as d, onUnmounted as p, provide as f, renderSlot as g } from "vue";
2
- import { AUTH_KEY as c } from "./index45.mjs";
3
- const A = /* @__PURE__ */ v({
4
- __name: "AuthProvider",
5
- props: {
6
- provider: {}
7
- },
8
- setup(l) {
9
- const n = l, e = a(void 0), r = a(!1), s = a(!0);
10
- let o;
11
- d(async () => {
12
- const t = await n.provider.getCurrentUser();
13
- e.value = t, r.value = !!t, s.value = !1, o = n.provider.subscribeToAuthState((u) => {
14
- r.value = u, u || (e.value = void 0);
15
- });
16
- }), p(() => o == null ? void 0 : o());
17
- async function i() {
18
- await n.provider.signOut(), e.value = void 0, r.value = !1;
19
- }
20
- return f(c, {
21
- get user() {
22
- return e.value;
23
- },
24
- get loggedIn() {
25
- return r.value;
26
- },
27
- get loading() {
28
- return s.value;
29
- },
30
- signOut: i
31
- }), (t, u) => g(t.$slots, "default");
32
- }
33
- });
1
+ import { inject as t } from "vue";
2
+ const r = Symbol("theme");
3
+ function m() {
4
+ const e = t(r);
5
+ if (!e) throw new Error("useTheme must be used within a <ThemeProvider>");
6
+ return e;
7
+ }
34
8
  export {
35
- A as default
9
+ r as THEME_KEY,
10
+ m as useTheme
36
11
  };
package/dist/index45.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("vue"),e=Symbol("auth");function r(){const t=u.inject(e);if(!t)throw new Error("useAuth must be used within an <AuthProvider>");return t}exports.AUTH_KEY=e;exports.useAuth=r;
1
+ "use strict";const e=require("vue"),v=require("./index46.cjs"),d=e.defineComponent({__name:"AuthProvider",props:{provider:{}},setup(i){const u=i,r=e.ref(void 0),t=e.ref(!1),a=e.ref(!0);let o;e.onMounted(async()=>{const n=await u.provider.getCurrentUser();r.value=n,t.value=!!n,a.value=!1,o=u.provider.subscribeToAuthState(s=>{t.value=s,s||(r.value=void 0)})}),e.onUnmounted(()=>o==null?void 0:o());async function l(){await u.provider.signOut(),r.value=void 0,t.value=!1}return e.provide(v.AUTH_KEY,{get user(){return r.value},get loggedIn(){return t.value},get loading(){return a.value},signOut:l}),(n,s)=>e.renderSlot(n.$slots,"default")}});module.exports=d;
package/dist/index45.mjs CHANGED
@@ -1,11 +1,36 @@
1
- import { inject as r } from "vue";
2
- const o = Symbol("auth");
3
- function e() {
4
- const t = r(o);
5
- if (!t) throw new Error("useAuth must be used within an <AuthProvider>");
6
- return t;
7
- }
1
+ import { defineComponent as v, ref as a, onMounted as d, onUnmounted as p, provide as f, renderSlot as g } from "vue";
2
+ import { AUTH_KEY as c } from "./index46.mjs";
3
+ const A = /* @__PURE__ */ v({
4
+ __name: "AuthProvider",
5
+ props: {
6
+ provider: {}
7
+ },
8
+ setup(l) {
9
+ const n = l, e = a(void 0), r = a(!1), s = a(!0);
10
+ let o;
11
+ d(async () => {
12
+ const t = await n.provider.getCurrentUser();
13
+ e.value = t, r.value = !!t, s.value = !1, o = n.provider.subscribeToAuthState((u) => {
14
+ r.value = u, u || (e.value = void 0);
15
+ });
16
+ }), p(() => o == null ? void 0 : o());
17
+ async function i() {
18
+ await n.provider.signOut(), e.value = void 0, r.value = !1;
19
+ }
20
+ return f(c, {
21
+ get user() {
22
+ return e.value;
23
+ },
24
+ get loggedIn() {
25
+ return r.value;
26
+ },
27
+ get loading() {
28
+ return s.value;
29
+ },
30
+ signOut: i
31
+ }), (t, u) => g(t.$slots, "default");
32
+ }
33
+ });
8
34
  export {
9
- o as AUTH_KEY,
10
- e as useAuth
35
+ A as default
11
36
  };
package/dist/index46.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),d=require("./index48.cjs");;/* empty css */const i=["aria-expanded"],c=e.defineComponent({__name:"Dropdown",props:{items:{},align:{default:"left"}},setup(s){const n=e.ref(!1),r=e.ref(null);function u(o){r.value&&!r.value.contains(o.target)&&(n.value=!1)}function a(o){o.key==="Escape"&&(n.value=!1)}return e.onMounted(()=>{document.addEventListener("mousedown",u),document.addEventListener("keydown",a)}),e.onUnmounted(()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",a)}),(o,t)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"root",ref:r,class:"m2s2-dropdown"},[e.createElementVNode("div",{class:"m2s2-dropdown__trigger","aria-haspopup":"menu","aria-expanded":n.value,onClick:t[0]||(t[0]=l=>n.value=!n.value)},[e.renderSlot(o.$slots,"default")],8,i),n.value?(e.openBlock(),e.createElementBlock("ul",{key:0,class:e.normalizeClass(["m2s2-dropdown__menu",`m2s2-dropdown__menu--${s.align}`]),role:"menu"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.items,l=>(e.openBlock(),e.createBlock(d,{key:l.id,item:l,onSelect:t[1]||(t[1]=m=>n.value=!1)},null,8,["item"]))),128))],2)):e.createCommentVNode("",!0)],512))}});module.exports=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("vue"),e=Symbol("auth");function r(){const t=u.inject(e);if(!t)throw new Error("useAuth must be used within an <AuthProvider>");return t}exports.AUTH_KEY=e;exports.useAuth=r;
package/dist/index46.mjs CHANGED
@@ -1,51 +1,11 @@
1
- import { defineComponent as i, ref as m, onMounted as c, onUnmounted as f, openBlock as t, createElementBlock as l, createElementVNode as p, renderSlot as v, normalizeClass as k, Fragment as _, renderList as w, createBlock as E, createCommentVNode as g } from "vue";
2
- import y from "./index48.mjs";
3
- /* empty css */
4
- const L = ["aria-expanded"], N = /* @__PURE__ */ i({
5
- __name: "Dropdown",
6
- props: {
7
- items: {},
8
- align: { default: "left" }
9
- },
10
- setup(s) {
11
- const e = m(!1), r = m(null);
12
- function d(n) {
13
- r.value && !r.value.contains(n.target) && (e.value = !1);
14
- }
15
- function u(n) {
16
- n.key === "Escape" && (e.value = !1);
17
- }
18
- return c(() => {
19
- document.addEventListener("mousedown", d), document.addEventListener("keydown", u);
20
- }), f(() => {
21
- document.removeEventListener("mousedown", d), document.removeEventListener("keydown", u);
22
- }), (n, o) => (t(), l("div", {
23
- ref_key: "root",
24
- ref: r,
25
- class: "m2s2-dropdown"
26
- }, [
27
- p("div", {
28
- class: "m2s2-dropdown__trigger",
29
- "aria-haspopup": "menu",
30
- "aria-expanded": e.value,
31
- onClick: o[0] || (o[0] = (a) => e.value = !e.value)
32
- }, [
33
- v(n.$slots, "default")
34
- ], 8, L),
35
- e.value ? (t(), l("ul", {
36
- key: 0,
37
- class: k(["m2s2-dropdown__menu", `m2s2-dropdown__menu--${s.align}`]),
38
- role: "menu"
39
- }, [
40
- (t(!0), l(_, null, w(s.items, (a) => (t(), E(y, {
41
- key: a.id,
42
- item: a,
43
- onSelect: o[1] || (o[1] = ($) => e.value = !1)
44
- }, null, 8, ["item"]))), 128))
45
- ], 2)) : g("", !0)
46
- ], 512));
47
- }
48
- });
1
+ import { inject as r } from "vue";
2
+ const o = Symbol("auth");
3
+ function e() {
4
+ const t = r(o);
5
+ if (!t) throw new Error("useAuth must be used within an <AuthProvider>");
6
+ return t;
7
+ }
49
8
  export {
50
- N as default
9
+ o as AUTH_KEY,
10
+ e as useAuth
51
11
  };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),d=require("./index49.cjs");;/* empty css */const i=["aria-expanded"],c=e.defineComponent({__name:"Dropdown",props:{items:{},align:{default:"left"}},setup(s){const n=e.ref(!1),r=e.ref(null);function u(o){r.value&&!r.value.contains(o.target)&&(n.value=!1)}function a(o){o.key==="Escape"&&(n.value=!1)}return e.onMounted(()=>{document.addEventListener("mousedown",u),document.addEventListener("keydown",a)}),e.onUnmounted(()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",a)}),(o,t)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"root",ref:r,class:"m2s2-dropdown"},[e.createElementVNode("div",{class:"m2s2-dropdown__trigger","aria-haspopup":"menu","aria-expanded":n.value,onClick:t[0]||(t[0]=l=>n.value=!n.value)},[e.renderSlot(o.$slots,"default")],8,i),n.value?(e.openBlock(),e.createElementBlock("ul",{key:0,class:e.normalizeClass(["m2s2-dropdown__menu",`m2s2-dropdown__menu--${s.align}`]),role:"menu"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.items,l=>(e.openBlock(),e.createBlock(d,{key:l.id,item:l,onSelect:t[1]||(t[1]=m=>n.value=!1)},null,8,["item"]))),128))],2)):e.createCommentVNode("",!0)],512))}});module.exports=c;
@@ -0,0 +1,51 @@
1
+ import { defineComponent as i, ref as m, onMounted as c, onUnmounted as f, openBlock as t, createElementBlock as l, createElementVNode as p, renderSlot as v, normalizeClass as k, Fragment as _, renderList as w, createBlock as E, createCommentVNode as g } from "vue";
2
+ import y from "./index49.mjs";
3
+ /* empty css */
4
+ const L = ["aria-expanded"], N = /* @__PURE__ */ i({
5
+ __name: "Dropdown",
6
+ props: {
7
+ items: {},
8
+ align: { default: "left" }
9
+ },
10
+ setup(s) {
11
+ const e = m(!1), r = m(null);
12
+ function d(n) {
13
+ r.value && !r.value.contains(n.target) && (e.value = !1);
14
+ }
15
+ function u(n) {
16
+ n.key === "Escape" && (e.value = !1);
17
+ }
18
+ return c(() => {
19
+ document.addEventListener("mousedown", d), document.addEventListener("keydown", u);
20
+ }), f(() => {
21
+ document.removeEventListener("mousedown", d), document.removeEventListener("keydown", u);
22
+ }), (n, o) => (t(), l("div", {
23
+ ref_key: "root",
24
+ ref: r,
25
+ class: "m2s2-dropdown"
26
+ }, [
27
+ p("div", {
28
+ class: "m2s2-dropdown__trigger",
29
+ "aria-haspopup": "menu",
30
+ "aria-expanded": e.value,
31
+ onClick: o[0] || (o[0] = (a) => e.value = !e.value)
32
+ }, [
33
+ v(n.$slots, "default")
34
+ ], 8, L),
35
+ e.value ? (t(), l("ul", {
36
+ key: 0,
37
+ class: k(["m2s2-dropdown__menu", `m2s2-dropdown__menu--${s.align}`]),
38
+ role: "menu"
39
+ }, [
40
+ (t(!0), l(_, null, w(s.items, (a) => (t(), E(y, {
41
+ key: a.id,
42
+ item: a,
43
+ onSelect: o[1] || (o[1] = ($) => e.value = !1)
44
+ }, null, 8, ["item"]))), 128))
45
+ ], 2)) : g("", !0)
46
+ ], 512));
47
+ }
48
+ });
49
+ export {
50
+ N as default
51
+ };
package/dist/index51.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./index2.cjs");;/* empty css */module.exports=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("vue"),l=require("./index44.cjs"),a=require("./index35.cjs"),m=require("./index39.cjs"),d=require("./index43.cjs"),n="m2s2-theme";function i(e){typeof document>"u"||(e==="auto"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e))}function s(e={}){return{install(t){const c=(typeof localStorage<"u"?localStorage.getItem(n):null)??e.defaultTheme??"auto",r=u.ref(c);i(r.value),u.watch(r,o=>{typeof localStorage<"u"&&localStorage.setItem(n,o),i(o)}),t.provide(l.THEME_KEY,{get theme(){return r.value},setTheme(o){r.value=o}}),t.component("M2S2ThemeProvider",d),t.component("M2S2DialogProvider",a),t.component("M2S2PanelProvider",m)}}}exports.createM2S2=s;
package/dist/index51.mjs CHANGED
@@ -1,5 +1,29 @@
1
- import o from "./index2.mjs";
2
- /* empty css */
1
+ import { ref as i, watch as c } from "vue";
2
+ import { THEME_KEY as l } from "./index44.mjs";
3
+ import u from "./index35.mjs";
4
+ import f from "./index39.mjs";
5
+ import d from "./index43.mjs";
6
+ const n = "m2s2-theme";
7
+ function r(e) {
8
+ typeof document > "u" || (e === "auto" ? document.documentElement.removeAttribute("data-theme") : document.documentElement.setAttribute("data-theme", e));
9
+ }
10
+ function _(e = {}) {
11
+ return {
12
+ install(t) {
13
+ const a = (typeof localStorage < "u" ? localStorage.getItem(n) : null) ?? e.defaultTheme ?? "auto", o = i(a);
14
+ r(o.value), c(o, (m) => {
15
+ typeof localStorage < "u" && localStorage.setItem(n, m), r(m);
16
+ }), t.provide(l, {
17
+ get theme() {
18
+ return o.value;
19
+ },
20
+ setTheme(m) {
21
+ o.value = m;
22
+ }
23
+ }), t.component("M2S2ThemeProvider", d), t.component("M2S2DialogProvider", u), t.component("M2S2PanelProvider", f);
24
+ }
25
+ };
26
+ }
3
27
  export {
4
- o as default
28
+ _ as createM2S2
5
29
  };
package/dist/index52.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./index4.cjs");;/* empty css */module.exports=e;
1
+ "use strict";const e=require("./index3.cjs");;/* empty css */module.exports=e;
package/dist/index52.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index4.mjs";
1
+ import o from "./index3.mjs";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index53.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./index6.cjs");;/* empty css */module.exports=e;
1
+ "use strict";const e=require("./index5.cjs");;/* empty css */module.exports=e;
package/dist/index53.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index6.mjs";
1
+ import o from "./index5.mjs";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index54.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./index8.cjs");;/* empty css */module.exports=e;
1
+ "use strict";const e=require("./index7.cjs");;/* empty css */module.exports=e;
package/dist/index54.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index8.mjs";
1
+ import o from "./index7.mjs";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index55.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./index10.cjs");;/* empty css */module.exports=e;
1
+ "use strict";const e=require("./index9.cjs");;/* empty css */module.exports=e;
package/dist/index55.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index10.mjs";
1
+ import o from "./index9.mjs";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index56.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./index12.cjs");;/* empty css */module.exports=e;
1
+ "use strict";const e=require("./index11.cjs");;/* empty css */module.exports=e;
package/dist/index56.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index12.mjs";
1
+ import o from "./index11.mjs";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index57.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./index14.cjs");;/* empty css */module.exports=e;
1
+ "use strict";const e=require("./index13.cjs");;/* empty css */module.exports=e;
package/dist/index57.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index14.mjs";
1
+ import o from "./index13.mjs";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index58.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./index16.cjs");;/* empty css */module.exports=e;
1
+ "use strict";const e=require("./index15.cjs");;/* empty css */module.exports=e;
package/dist/index58.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index16.mjs";
1
+ import o from "./index15.mjs";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index59.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./index18.cjs");;/* empty css */module.exports=e;
1
+ "use strict";const e=require("./index17.cjs");;/* empty css */module.exports=e;
package/dist/index59.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index18.mjs";
1
+ import o from "./index17.mjs";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index60.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./index20.cjs");;/* empty css */module.exports=e;
1
+ "use strict";const e=require("./index19.cjs");;/* empty css */module.exports=e;
package/dist/index60.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index20.mjs";
1
+ import o from "./index19.mjs";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index61.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./index22.cjs");;/* empty css */module.exports=e;
1
+ "use strict";const e=require("./index21.cjs");;/* empty css */module.exports=e;
package/dist/index61.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index22.mjs";
1
+ import o from "./index21.mjs";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index62.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./index24.cjs");;/* empty css */module.exports=e;
1
+ "use strict";const e=require("./index23.cjs");;/* empty css */module.exports=e;
package/dist/index62.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index24.mjs";
1
+ import o from "./index23.mjs";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index63.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./index26.cjs");;/* empty css */module.exports=e;
1
+ "use strict";const e=require("./index25.cjs");;/* empty css */module.exports=e;
package/dist/index63.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index26.mjs";
1
+ import o from "./index25.mjs";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index64.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./index28.cjs");;/* empty css */module.exports=e;
1
+ "use strict";const e=require("./index27.cjs");;/* empty css */module.exports=e;
package/dist/index64.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index28.mjs";
1
+ import o from "./index27.mjs";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index65.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./index30.cjs");;/* empty css */module.exports=e;
1
+ "use strict";const e=require("./index29.cjs");;/* empty css */module.exports=e;
package/dist/index65.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index30.mjs";
1
+ import o from "./index29.mjs";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index66.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./index32.cjs");;/* empty css */module.exports=e;
1
+ "use strict";const e=require("./index31.cjs");;/* empty css */module.exports=e;
package/dist/index66.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index32.mjs";
1
+ import o from "./index31.mjs";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index67.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./index34.cjs");module.exports=e;
1
+ "use strict";const e=require("./index33.cjs");;/* empty css */module.exports=e;