@m2s2/vue-lib 2.5.2 → 2.6.0
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.
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +58 -57
- package/dist/{index16.cjs → index17.cjs} +1 -1
- package/dist/{index16.mjs → index17.mjs} +1 -1
- package/dist/{index22.cjs → index23.cjs} +1 -1
- package/dist/{index22.mjs → index23.mjs} +1 -1
- package/dist/{index24.cjs → index25.cjs} +1 -1
- package/dist/{index24.mjs → index25.mjs} +1 -1
- package/dist/index27.cjs +2 -0
- package/dist/index27.mjs +363 -0
- package/dist/{index28.cjs → index29.cjs} +1 -1
- package/dist/{index28.mjs → index29.mjs} +1 -1
- package/dist/{index30.cjs → index31.cjs} +1 -1
- package/dist/{index30.mjs → index31.mjs} +1 -1
- package/dist/index35.cjs +1 -1
- package/dist/index35.mjs +40 -9
- package/dist/index36.cjs +1 -1
- package/dist/index36.mjs +9 -85
- package/dist/index37.cjs +1 -0
- package/dist/index37.mjs +87 -0
- package/dist/index39.cjs +1 -1
- package/dist/index39.mjs +30 -9
- package/dist/index40.cjs +1 -1
- package/dist/index40.mjs +9 -26
- package/dist/index41.cjs +1 -0
- package/dist/index41.mjs +28 -0
- package/dist/index43.cjs +1 -1
- package/dist/index43.mjs +30 -9
- package/dist/index44.cjs +1 -1
- package/dist/index44.mjs +9 -34
- package/dist/index45.cjs +1 -1
- package/dist/index45.mjs +34 -9
- package/dist/index46.cjs +1 -1
- package/dist/index46.mjs +9 -49
- package/dist/index47.cjs +1 -0
- package/dist/index47.mjs +51 -0
- package/dist/index51.cjs +1 -1
- package/dist/index51.mjs +27 -3
- package/dist/index52.cjs +1 -1
- package/dist/index52.mjs +1 -1
- package/dist/index53.cjs +1 -1
- package/dist/index53.mjs +1 -1
- package/dist/index54.cjs +1 -1
- package/dist/index54.mjs +1 -1
- package/dist/index55.cjs +1 -1
- package/dist/index55.mjs +1 -1
- package/dist/index56.cjs +1 -1
- package/dist/index56.mjs +1 -1
- package/dist/index57.cjs +1 -1
- package/dist/index57.mjs +1 -1
- package/dist/index58.cjs +1 -1
- package/dist/index58.mjs +1 -1
- package/dist/index59.cjs +1 -1
- package/dist/index59.mjs +1 -1
- package/dist/index60.cjs +1 -1
- package/dist/index60.mjs +1 -1
- package/dist/index61.cjs +1 -1
- package/dist/index61.mjs +1 -1
- package/dist/index62.cjs +1 -1
- package/dist/index62.mjs +1 -1
- package/dist/index63.cjs +1 -1
- package/dist/index63.mjs +1 -1
- package/dist/index64.cjs +1 -1
- package/dist/index64.mjs +1 -1
- package/dist/index65.cjs +1 -1
- package/dist/index65.mjs +1 -1
- package/dist/index66.cjs +1 -1
- package/dist/index66.mjs +1 -1
- package/dist/index67.cjs +1 -1
- package/dist/index67.mjs +3 -2
- package/dist/index68.cjs +1 -1
- package/dist/index68.mjs +2 -3
- package/dist/index69.cjs +1 -1
- package/dist/index69.mjs +3 -2
- package/dist/index70.cjs +1 -1
- package/dist/index70.mjs +2 -3
- package/dist/index71.cjs +1 -1
- package/dist/index71.mjs +3 -2
- package/dist/index72.cjs +1 -1
- package/dist/index72.mjs +1 -1
- package/dist/index73.cjs +1 -1
- package/dist/index73.mjs +2 -3
- package/dist/index74.cjs +1 -1
- package/dist/index74.mjs +1 -1
- package/dist/index75.cjs +1 -1
- package/dist/index75.mjs +3 -51
- package/dist/index76.cjs +1 -59
- package/dist/index76.mjs +51 -1150
- package/dist/index77.cjs +1 -1
- package/dist/index77.mjs +5 -21
- package/dist/index78.cjs +59 -5
- package/dist/index78.mjs +1150 -19
- package/dist/index79.cjs +1 -1
- package/dist/index79.mjs +21 -5
- package/dist/index80.cjs +5 -1
- package/dist/index80.mjs +19 -4
- package/dist/index81.cjs +1 -1
- package/dist/index81.mjs +4 -2
- package/dist/index82.cjs +1 -0
- package/dist/index82.mjs +4 -0
- package/dist/vue-lib/src/components/BlogEditor/BlogEditor.vue.d.ts +9 -0
- package/dist/vue-lib/src/components/BlogEditor/BlogEditor.vue.d.ts.map +1 -1
- package/dist/vue-lib/src/index.d.ts +1 -0
- package/dist/vue-lib/src/index.d.ts.map +1 -1
- package/dist/vue-lib.css +1 -1
- package/package.json +1 -1
- package/dist/index26.cjs +0 -2
- package/dist/index26.mjs +0 -321
- package/dist/index34.cjs +0 -1
- package/dist/index34.mjs +0 -42
- package/dist/index38.cjs +0 -1
- package/dist/index38.mjs +0 -32
- package/dist/index42.cjs +0 -1
- package/dist/index42.mjs +0 -32
- package/dist/index50.cjs +0 -1
- package/dist/index50.mjs +0 -29
- /package/dist/{index10.cjs → index11.cjs} +0 -0
- /package/dist/{index10.mjs → index11.mjs} +0 -0
- /package/dist/{index12.cjs → index13.cjs} +0 -0
- /package/dist/{index12.mjs → index13.mjs} +0 -0
- /package/dist/{index14.cjs → index15.cjs} +0 -0
- /package/dist/{index14.mjs → index15.mjs} +0 -0
- /package/dist/{index18.cjs → index19.cjs} +0 -0
- /package/dist/{index18.mjs → index19.mjs} +0 -0
- /package/dist/{index20.cjs → index21.cjs} +0 -0
- /package/dist/{index20.mjs → index21.mjs} +0 -0
- /package/dist/{index2.cjs → index3.cjs} +0 -0
- /package/dist/{index2.mjs → index3.mjs} +0 -0
- /package/dist/{index32.cjs → index33.cjs} +0 -0
- /package/dist/{index32.mjs → index33.mjs} +0 -0
- /package/dist/{index48.cjs → index49.cjs} +0 -0
- /package/dist/{index48.mjs → index49.mjs} +0 -0
- /package/dist/{index4.cjs → index5.cjs} +0 -0
- /package/dist/{index4.mjs → index5.mjs} +0 -0
- /package/dist/{index6.cjs → index7.cjs} +0 -0
- /package/dist/{index6.mjs → index7.mjs} +0 -0
- /package/dist/{index8.cjs → index9.cjs} +0 -0
- /package/dist/{index8.mjs → index9.mjs} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),b=require("./
|
|
1
|
+
"use strict";const e=require("vue"),b=require("./index77.cjs"),d={key:0,class:"sub-form"},m=["disabled"],v=["disabled"],p=["disabled"],k={key:0,class:"sub-feedback sub-feedback--error"},g={key:1,class:"sub-success"},f={key:1,class:"sub-auth"},y=["disabled"],h={key:0,class:"sub-feedback sub-feedback--success"},B=["disabled"],E={key:2,class:"sub-feedback sub-feedback--error"},_=e.defineComponent({__name:"SubscribeForm",props:{mode:{default:"anon"},subscribeAnon:{type:Function,default:void 0},subscribeAuth:{type:Function,default:void 0},unsubscribeAuth:{type:Function,default:void 0}},setup(c){const u=c,n=e.ref(""),l=e.ref(""),t=e.ref("idle"),o=e.ref(!1),r=e.computed(()=>b.validateEmail(n.value));async function a(){if(t.value!=="submitting")if(u.mode==="auth")if(o.value){if(!u.unsubscribeAuth)return;t.value="submitting";try{await u.unsubscribeAuth(),o.value=!1,t.value="idle"}catch{t.value="error"}}else{if(!u.subscribeAuth)return;t.value="submitting";try{await u.subscribeAuth(),o.value=!0,t.value="done"}catch{t.value="error"}}else{if(!r.value||!u.subscribeAnon)return;t.value="submitting";try{await u.subscribeAnon(n.value.trim(),l.value.trim()),t.value="done"}catch{t.value="error"}}}return(V,s)=>c.mode==="anon"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.value!=="done"?(e.openBlock(),e.createElementBlock("div",d,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=i=>l.value=i),class:"sub-input",type:"text",placeholder:"Your name (optional)",disabled:t.value==="submitting"},null,8,m),[[e.vModelText,l.value]]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":s[1]||(s[1]=i=>n.value=i),class:"sub-input",type:"email",placeholder:"your@email.com",disabled:t.value==="submitting"},null,8,v),[[e.vModelText,n.value]]),e.createElementVNode("button",{class:"sub-btn",disabled:!r.value||t.value==="submitting",onClick:a},e.toDisplayString(t.value==="submitting"?"Submitting…":"Subscribe"),9,p),t.value==="error"?(e.openBlock(),e.createElementBlock("p",k," Something went wrong — please try again. ")):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",g,[...s[2]||(s[2]=[e.createElementVNode("span",{class:"sub-success-icon"},"✓",-1),e.createElementVNode("p",{class:"sub-success-text"}," Check your email to confirm your subscription. ",-1)])]))],64)):(e.openBlock(),e.createElementBlock("div",f,[o.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s[3]||(s[3]=e.createElementVNode("span",{class:"sub-subscribed-label"},"✓ Subscribed to blog updates",-1)),e.createElementVNode("button",{class:"sub-btn sub-btn--unsub",disabled:t.value==="submitting",onClick:a},e.toDisplayString(t.value==="submitting"?"Unsubscribing…":"Unsubscribe"),9,B)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("button",{class:"sub-btn",disabled:t.value==="submitting",onClick:a},e.toDisplayString(t.value==="submitting"?"Subscribing…":"Subscribe to Blog Updates"),9,y),t.value==="done"?(e.openBlock(),e.createElementBlock("p",h," You're subscribed! ")):e.createCommentVNode("",!0)],64)),t.value==="error"?(e.openBlock(),e.createElementBlock("p",E," Something went wrong — please try again. ")):e.createCommentVNode("",!0)]))}});module.exports=_;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as h, ref as o, computed as k, openBlock as s, createElementBlock as t, Fragment as d, withDirectives as g, createElementVNode as i, vModelText as y, toDisplayString as m, createCommentVNode as v } from "vue";
|
|
2
|
-
import { validateEmail as _ } from "./
|
|
2
|
+
import { validateEmail as _ } from "./index77.mjs";
|
|
3
3
|
const A = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "sub-form"
|
package/dist/index35.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const e=require("vue"),u=require("./index33.cjs");;/* empty css */const i=require("./index36.cjs"),c=e.defineComponent({__name:"DialogProvider",setup(s){const t=e.ref(null);function o(r){return new Promise(n=>{t.value={data:r,resolve:n}})}function a(r,n){return o({title:r,message:n,actions:[{label:"Cancel",value:!1,variant:"secondary"},{label:"Confirm",value:!0,variant:"primary"}]})}function l(r){var n;(n=t.value)==null||n.resolve(r),t.value=null}return e.provide(i.DIALOG_KEY,{dialog:o,confirm:a}),(r,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.renderSlot(r.$slots,"default"),t.value?(e.openBlock(),e.createBlock(u,{key:0,data:t.value.data,open:!0,onAction:l,onClose:n[0]||(n[0]=v=>l(null))},null,8,["data"])):e.createCommentVNode("",!0)],64))}});module.exports=c;
|
package/dist/index35.mjs
CHANGED
|
@@ -1,11 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { defineComponent as u, ref as i, provide as m, openBlock as a, createElementBlock as c, Fragment as s, renderSlot as f, createBlock as v, createCommentVNode as p } from "vue";
|
|
2
|
+
import d from "./index33.mjs";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { DIALOG_KEY as _ } from "./index36.mjs";
|
|
5
|
+
const b = /* @__PURE__ */ u({
|
|
6
|
+
__name: "DialogProvider",
|
|
7
|
+
setup(C) {
|
|
8
|
+
const o = i(null);
|
|
9
|
+
function r(n) {
|
|
10
|
+
return new Promise((e) => {
|
|
11
|
+
o.value = { data: n, resolve: e };
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function l(n, e) {
|
|
15
|
+
return r({
|
|
16
|
+
title: n,
|
|
17
|
+
message: e,
|
|
18
|
+
actions: [
|
|
19
|
+
{ label: "Cancel", value: !1, variant: "secondary" },
|
|
20
|
+
{ label: "Confirm", value: !0, variant: "primary" }
|
|
21
|
+
]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function t(n) {
|
|
25
|
+
var e;
|
|
26
|
+
(e = o.value) == null || e.resolve(n), o.value = null;
|
|
27
|
+
}
|
|
28
|
+
return m(_, { dialog: r, confirm: l }), (n, e) => (a(), c(s, null, [
|
|
29
|
+
f(n.$slots, "default"),
|
|
30
|
+
o.value ? (a(), v(d, {
|
|
31
|
+
key: 0,
|
|
32
|
+
data: o.value.data,
|
|
33
|
+
open: !0,
|
|
34
|
+
onAction: t,
|
|
35
|
+
onClose: e[0] || (e[0] = (k) => t(null))
|
|
36
|
+
}, null, 8, ["data"])) : p("", !0)
|
|
37
|
+
], 64));
|
|
38
|
+
}
|
|
39
|
+
});
|
|
8
40
|
export {
|
|
9
|
-
|
|
10
|
-
e as useDialog
|
|
41
|
+
b as default
|
|
11
42
|
};
|
package/dist/index36.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),o=Symbol("dialog");function i(){const e=t.inject(o);if(!e)throw new Error("useDialog must be used within a <DialogProvider>");return e}exports.DIALOG_KEY=o;exports.useDialog=i;
|
package/dist/index36.mjs
CHANGED
|
@@ -1,87 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}, A = { class: "panel-body" }, D = {
|
|
9
|
-
key: 0,
|
|
10
|
-
class: "panel-message"
|
|
11
|
-
}, F = {
|
|
12
|
-
key: 0,
|
|
13
|
-
class: "panel-footer"
|
|
14
|
-
}, L = ["onClick"], j = /* @__PURE__ */ C({
|
|
15
|
-
__name: "Panel",
|
|
16
|
-
props: {
|
|
17
|
-
data: {},
|
|
18
|
-
open: { type: Boolean }
|
|
19
|
-
},
|
|
20
|
-
emits: ["action", "close"],
|
|
21
|
-
setup(e, { emit: b }) {
|
|
22
|
-
const c = e, d = b, r = () => c.data.side ?? "right";
|
|
23
|
-
function p(s) {
|
|
24
|
-
d("action", s.value);
|
|
25
|
-
}
|
|
26
|
-
function v() {
|
|
27
|
-
c.data.modal || d("close");
|
|
28
|
-
}
|
|
29
|
-
return (s, m) => (t(), g($, { to: "body" }, [
|
|
30
|
-
h(y, { name: "panel-overlay-fade" }, {
|
|
31
|
-
default: k(() => [
|
|
32
|
-
e.open ? (t(), a("div", {
|
|
33
|
-
key: 0,
|
|
34
|
-
class: "m2s2-panel-overlay",
|
|
35
|
-
onClick: w(v, ["self"])
|
|
36
|
-
})) : l("", !0)
|
|
37
|
-
]),
|
|
38
|
-
_: 1
|
|
39
|
-
}),
|
|
40
|
-
h(y, {
|
|
41
|
-
name: `panel-slide-${r()}`
|
|
42
|
-
}, {
|
|
43
|
-
default: k(() => {
|
|
44
|
-
var u;
|
|
45
|
-
return [
|
|
46
|
-
e.open ? (t(), a("div", {
|
|
47
|
-
key: 0,
|
|
48
|
-
class: f(["m2s2-panel-content", `m2s2-panel-content--${r()}`]),
|
|
49
|
-
style: B(e.data.width ? { "--panel-width": e.data.width } : {}),
|
|
50
|
-
role: "dialog",
|
|
51
|
-
"aria-modal": !0,
|
|
52
|
-
"aria-labelledby": "panel-title"
|
|
53
|
-
}, [
|
|
54
|
-
o("div", x, [
|
|
55
|
-
o("div", z, [
|
|
56
|
-
o("h2", E, i(e.data.title), 1),
|
|
57
|
-
e.data.subtitle ? (t(), a("p", T, i(e.data.subtitle), 1)) : l("", !0)
|
|
58
|
-
]),
|
|
59
|
-
e.data.modal ? l("", !0) : (t(), a("button", {
|
|
60
|
-
key: 0,
|
|
61
|
-
class: "panel-close",
|
|
62
|
-
"aria-label": "Close",
|
|
63
|
-
onClick: m[0] || (m[0] = (n) => d("close"))
|
|
64
|
-
}, " ✕ "))
|
|
65
|
-
]),
|
|
66
|
-
o("div", A, [
|
|
67
|
-
e.data.message && !s.$slots.default ? (t(), a("p", D, i(e.data.message), 1)) : l("", !0),
|
|
68
|
-
N(s.$slots, "default")
|
|
69
|
-
]),
|
|
70
|
-
(u = e.data.actions) != null && u.length ? (t(), a("div", F, [
|
|
71
|
-
(t(!0), a(S, null, V(e.data.actions, (n) => (t(), a("button", {
|
|
72
|
-
key: n.label,
|
|
73
|
-
class: f(["panel-btn", `panel-btn--${n.variant ?? "secondary"}`]),
|
|
74
|
-
onClick: (M) => p(n)
|
|
75
|
-
}, i(n.label), 11, L))), 128))
|
|
76
|
-
])) : l("", !0)
|
|
77
|
-
], 6)) : l("", !0)
|
|
78
|
-
];
|
|
79
|
-
}),
|
|
80
|
-
_: 3
|
|
81
|
-
}, 8, ["name"])
|
|
82
|
-
]));
|
|
83
|
-
}
|
|
84
|
-
});
|
|
1
|
+
import { inject as i } from "vue";
|
|
2
|
+
const r = Symbol("dialog");
|
|
3
|
+
function e() {
|
|
4
|
+
const o = i(r);
|
|
5
|
+
if (!o) throw new Error("useDialog must be used within a <DialogProvider>");
|
|
6
|
+
return o;
|
|
7
|
+
}
|
|
85
8
|
export {
|
|
86
|
-
|
|
9
|
+
r as DIALOG_KEY,
|
|
10
|
+
e as useDialog
|
|
87
11
|
};
|
package/dist/index37.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),k={class:"panel-header"},u={class:"panel-header-text"},p={id:"panel-title",class:"panel-title"},y={key:0,class:"panel-subtitle"},B={class:"panel-body"},h={key:0,class:"panel-message"},C={key:0,class:"panel-footer"},b=["onClick"],f=e.defineComponent({__name:"Panel",props:{data:{},open:{type:Boolean}},emits:["action","close"],setup(t,{emit:d}){const o=t,n=d,s=()=>o.data.side??"right";function r(l){n("action",l.value)}function m(){o.data.modal||n("close")}return(l,c)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"panel-overlay-fade"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"m2s2-panel-overlay",onClick:e.withModifiers(m,["self"])})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:`panel-slide-${s()}`},{default:e.withCtx(()=>{var i;return[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["m2s2-panel-content",`m2s2-panel-content--${s()}`]),style:e.normalizeStyle(t.data.width?{"--panel-width":t.data.width}:{}),role:"dialog","aria-modal":!0,"aria-labelledby":"panel-title"},[e.createElementVNode("div",k,[e.createElementVNode("div",u,[e.createElementVNode("h2",p,e.toDisplayString(t.data.title),1),t.data.subtitle?(e.openBlock(),e.createElementBlock("p",y,e.toDisplayString(t.data.subtitle),1)):e.createCommentVNode("",!0)]),t.data.modal?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"panel-close","aria-label":"Close",onClick:c[0]||(c[0]=a=>n("close"))}," ✕ "))]),e.createElementVNode("div",B,[t.data.message&&!l.$slots.default?(e.openBlock(),e.createElementBlock("p",h,e.toDisplayString(t.data.message),1)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"default")]),(i=t.data.actions)!=null&&i.length?(e.openBlock(),e.createElementBlock("div",C,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data.actions,a=>(e.openBlock(),e.createElementBlock("button",{key:a.label,class:e.normalizeClass(["panel-btn",`panel-btn--${a.variant??"secondary"}`]),onClick:v=>r(a)},e.toDisplayString(a.label),11,b))),128))])):e.createCommentVNode("",!0)],6)):e.createCommentVNode("",!0)]}),_:3},8,["name"])]))}});module.exports=f;
|
package/dist/index37.mjs
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { defineComponent as C, openBlock as t, createBlock as g, Teleport as $, createVNode as h, Transition as y, withCtx as k, createElementBlock as a, withModifiers as w, createCommentVNode as l, normalizeStyle as B, normalizeClass as f, createElementVNode as o, toDisplayString as i, renderSlot as N, Fragment as S, renderList as V } from "vue";
|
|
2
|
+
const x = { class: "panel-header" }, z = { class: "panel-header-text" }, E = {
|
|
3
|
+
id: "panel-title",
|
|
4
|
+
class: "panel-title"
|
|
5
|
+
}, T = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "panel-subtitle"
|
|
8
|
+
}, A = { class: "panel-body" }, D = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "panel-message"
|
|
11
|
+
}, F = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "panel-footer"
|
|
14
|
+
}, L = ["onClick"], j = /* @__PURE__ */ C({
|
|
15
|
+
__name: "Panel",
|
|
16
|
+
props: {
|
|
17
|
+
data: {},
|
|
18
|
+
open: { type: Boolean }
|
|
19
|
+
},
|
|
20
|
+
emits: ["action", "close"],
|
|
21
|
+
setup(e, { emit: b }) {
|
|
22
|
+
const c = e, d = b, r = () => c.data.side ?? "right";
|
|
23
|
+
function p(s) {
|
|
24
|
+
d("action", s.value);
|
|
25
|
+
}
|
|
26
|
+
function v() {
|
|
27
|
+
c.data.modal || d("close");
|
|
28
|
+
}
|
|
29
|
+
return (s, m) => (t(), g($, { to: "body" }, [
|
|
30
|
+
h(y, { name: "panel-overlay-fade" }, {
|
|
31
|
+
default: k(() => [
|
|
32
|
+
e.open ? (t(), a("div", {
|
|
33
|
+
key: 0,
|
|
34
|
+
class: "m2s2-panel-overlay",
|
|
35
|
+
onClick: w(v, ["self"])
|
|
36
|
+
})) : l("", !0)
|
|
37
|
+
]),
|
|
38
|
+
_: 1
|
|
39
|
+
}),
|
|
40
|
+
h(y, {
|
|
41
|
+
name: `panel-slide-${r()}`
|
|
42
|
+
}, {
|
|
43
|
+
default: k(() => {
|
|
44
|
+
var u;
|
|
45
|
+
return [
|
|
46
|
+
e.open ? (t(), a("div", {
|
|
47
|
+
key: 0,
|
|
48
|
+
class: f(["m2s2-panel-content", `m2s2-panel-content--${r()}`]),
|
|
49
|
+
style: B(e.data.width ? { "--panel-width": e.data.width } : {}),
|
|
50
|
+
role: "dialog",
|
|
51
|
+
"aria-modal": !0,
|
|
52
|
+
"aria-labelledby": "panel-title"
|
|
53
|
+
}, [
|
|
54
|
+
o("div", x, [
|
|
55
|
+
o("div", z, [
|
|
56
|
+
o("h2", E, i(e.data.title), 1),
|
|
57
|
+
e.data.subtitle ? (t(), a("p", T, i(e.data.subtitle), 1)) : l("", !0)
|
|
58
|
+
]),
|
|
59
|
+
e.data.modal ? l("", !0) : (t(), a("button", {
|
|
60
|
+
key: 0,
|
|
61
|
+
class: "panel-close",
|
|
62
|
+
"aria-label": "Close",
|
|
63
|
+
onClick: m[0] || (m[0] = (n) => d("close"))
|
|
64
|
+
}, " ✕ "))
|
|
65
|
+
]),
|
|
66
|
+
o("div", A, [
|
|
67
|
+
e.data.message && !s.$slots.default ? (t(), a("p", D, i(e.data.message), 1)) : l("", !0),
|
|
68
|
+
N(s.$slots, "default")
|
|
69
|
+
]),
|
|
70
|
+
(u = e.data.actions) != null && u.length ? (t(), a("div", F, [
|
|
71
|
+
(t(!0), a(S, null, V(e.data.actions, (n) => (t(), a("button", {
|
|
72
|
+
key: n.label,
|
|
73
|
+
class: f(["panel-btn", `panel-btn--${n.variant ?? "secondary"}`]),
|
|
74
|
+
onClick: (M) => p(n)
|
|
75
|
+
}, i(n.label), 11, L))), 128))
|
|
76
|
+
])) : l("", !0)
|
|
77
|
+
], 6)) : l("", !0)
|
|
78
|
+
];
|
|
79
|
+
}),
|
|
80
|
+
_: 3
|
|
81
|
+
}, 8, ["name"])
|
|
82
|
+
]));
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
export {
|
|
86
|
+
j as default
|
|
87
|
+
};
|
package/dist/index39.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const e=require("vue"),u=require("./index37.cjs");;/* empty css */const a=require("./index40.cjs"),s=e.defineComponent({__name:"PanelProvider",setup(c){const t=e.ref(null);function o(r){return new Promise(n=>{t.value={data:r,resolve:n}})}function l(r){var n;(n=t.value)==null||n.resolve(r),t.value=null}return e.provide(a.PANEL_KEY,{panel:o}),(r,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.renderSlot(r.$slots,"default"),t.value?(e.openBlock(),e.createBlock(u,{key:0,data:t.value.data,open:!0,onAction:l,onClose:n[0]||(n[0]=i=>l(null))},null,8,["data"])):e.createCommentVNode("",!0)],64))}});module.exports=s;
|
package/dist/index39.mjs
CHANGED
|
@@ -1,11 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
10
|
-
o as usePanel
|
|
31
|
+
$ as default
|
|
11
32
|
};
|
package/dist/index40.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
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 {
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
9
|
+
r as PANEL_KEY,
|
|
10
|
+
o as usePanel
|
|
28
11
|
};
|
package/dist/index41.cjs
ADDED
|
@@ -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;
|
package/dist/index41.mjs
ADDED
|
@@ -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";
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
10
|
-
m as useTheme
|
|
31
|
+
_ as default
|
|
11
32
|
};
|
package/dist/index44.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
9
|
+
r as THEME_KEY,
|
|
10
|
+
m as useTheme
|
|
36
11
|
};
|
package/dist/index45.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
10
|
-
e as useAuth
|
|
35
|
+
A as default
|
|
11
36
|
};
|
package/dist/index46.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
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;
|