@m2s2/vue-lib 2.4.1 → 2.5.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.
- package/dist/index14.cjs +1 -1
- package/dist/index14.mjs +1 -1
- package/dist/index16.cjs +1 -1
- package/dist/index16.mjs +1 -1
- package/dist/index2.cjs +1 -1
- package/dist/index2.mjs +12 -12
- package/dist/index24.cjs +1 -1
- package/dist/index24.mjs +20 -26
- package/dist/index26.cjs +2 -6
- package/dist/index26.mjs +214 -176
- package/dist/index28.cjs +1 -1
- package/dist/index28.mjs +33 -32
- package/dist/index30.cjs +1 -1
- package/dist/index30.mjs +29 -28
- package/dist/index32.cjs +1 -1
- package/dist/index32.mjs +1 -1
- package/dist/index36.cjs +1 -1
- package/dist/index36.mjs +1 -1
- package/dist/index40.cjs +1 -1
- package/dist/index40.mjs +4 -4
- package/dist/index46.cjs +1 -1
- package/dist/index46.mjs +2 -2
- package/dist/index75.cjs +1 -1
- package/dist/index75.mjs +4 -51
- package/dist/index76.cjs +1 -59
- package/dist/index76.mjs +18 -1146
- package/dist/index77.cjs +1 -1
- package/dist/index77.mjs +6 -2
- package/dist/index78.cjs +59 -0
- package/dist/index78.mjs +1152 -0
- package/dist/index79.cjs +5 -0
- package/dist/index79.mjs +21 -0
- package/dist/index8.cjs +1 -1
- package/dist/index8.mjs +5 -5
- package/dist/index80.cjs +1 -0
- package/dist/index80.mjs +53 -0
- package/dist/index81.cjs +1 -0
- package/dist/index81.mjs +4 -0
- package/dist/storybook-shared/src/globals.d.ts +2 -0
- package/dist/storybook-shared/src/globals.d.ts.map +1 -1
- package/dist/vue-lib/src/BrandConfigurator.vue.d.ts.map +1 -1
- package/dist/vue-lib/src/Welcome.vue.d.ts.map +1 -1
- package/dist/vue-lib/src/components/BlogEditor/BlogEditor.vue.d.ts +4 -1
- package/dist/vue-lib/src/components/BlogEditor/BlogEditor.vue.d.ts.map +1 -1
- package/dist/vue-lib/src/components/Chat/Chat.vue.d.ts +2 -0
- package/dist/vue-lib/src/components/Chat/Chat.vue.d.ts.map +1 -1
- package/dist/vue-lib/src/components/CtaSection/CtaSection.vue.d.ts.map +1 -1
- package/dist/vue-lib/src/components/DataTable/DataTable.vue.d.ts.map +1 -1
- package/dist/vue-lib/src/components/Dialog/Dialog.vue.d.ts.map +1 -1
- package/dist/vue-lib/src/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
- package/dist/vue-lib/src/components/Dropdown/DropdownItem.vue.d.ts.map +1 -1
- package/dist/vue-lib/src/components/Footer/Footer.vue.d.ts.map +1 -1
- package/dist/vue-lib/src/components/Footer/SocialIcon.vue.d.ts.map +1 -1
- package/dist/vue-lib/src/components/LoadingButton/LoadingButton.vue.d.ts +1 -0
- package/dist/vue-lib/src/components/LoadingButton/LoadingButton.vue.d.ts.map +1 -1
- package/dist/vue-lib/src/components/Navbar/Navbar.vue.d.ts.map +1 -1
- package/dist/vue-lib/src/components/PageHeader/PageHeader.vue.d.ts.map +1 -1
- package/dist/vue-lib/src/components/Panel/Panel.vue.d.ts.map +1 -1
- package/dist/vue-lib/src/components/ProcessSteps/ProcessSteps.vue.d.ts.map +1 -1
- package/dist/vue-lib/src/components/SectionHeader/SectionHeader.vue.d.ts.map +1 -1
- package/dist/vue-lib/src/components/StatRow/StatRow.vue.d.ts.map +1 -1
- package/dist/vue-lib/src/components/StatusBadge/StatusBadge.vue.d.ts +1 -0
- package/dist/vue-lib/src/components/StatusBadge/StatusBadge.vue.d.ts.map +1 -1
- package/dist/vue-lib/src/components/SubscribeForm/SubscribeForm.vue.d.ts +3 -0
- package/dist/vue-lib/src/components/SubscribeForm/SubscribeForm.vue.d.ts.map +1 -1
- package/dist/vue-lib/src/components/cards/BlogCard/BlogCard.vue.d.ts.map +1 -1
- package/dist/vue-lib/src/components/cards/FeatureCard/FeatureCard.vue.d.ts.map +1 -1
- package/dist/vue-lib.css +1 -1
- package/package.json +10 -7
package/dist/index26.mjs
CHANGED
|
@@ -1,283 +1,321 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { marked as
|
|
3
|
-
|
|
1
|
+
import { defineComponent as ge, ref as i, watch as fe, computed as L, openBlock as c, createElementBlock as m, createElementVNode as l, createTextVNode as g, withDirectives as d, vModelText as v, Fragment as te, renderList as ae, toDisplayString as V, createCommentVNode as _e, unref as ye } from "vue";
|
|
2
|
+
import { marked as we } from "./index78.mjs";
|
|
3
|
+
import { todayAsIsoDate as xe, generateSlug as se, calcReadingTime as ie } from "./index76.mjs";
|
|
4
|
+
import { BLOG_EDITOR_TOOLBAR as Pe } from "./index79.mjs";
|
|
5
|
+
const ke = { class: "be-root" }, Te = { class: "be-meta" }, Ce = { class: "be-field be-field--full" }, Ie = ["value"], Ue = { class: "be-field" }, Se = { class: "be-field" }, he = { class: "be-field be-field--full" }, Ve = { class: "be-field be-field--full" }, Ee = { class: "be-field" }, De = { class: "be-tags" }, Le = ["aria-label", "onClick"], Re = { class: "be-field" }, Be = { class: "be-field be-field--cover" }, Oe = { class: "be-cover" }, Ae = ["src"], Fe = { class: "be-cover__pick" }, Me = { class: "be-field" }, $e = { class: "be-field" }, He = { class: "be-field be-field--narrow-pair" }, Ne = { class: "be-editor" }, qe = {
|
|
4
6
|
class: "be-toolbar",
|
|
5
7
|
role: "toolbar",
|
|
6
8
|
"aria-label": "Formatting"
|
|
7
|
-
},
|
|
9
|
+
}, Ge = ["title", "onClick"], Ke = { class: "be-panes" }, We = { class: "be-pane be-pane--write" }, je = ["value"], ze = { class: "be-pane be-pane--preview" }, Je = ["innerHTML"], Qe = { class: "be-footer" }, Xe = { class: "be-footer__meta" }, Ye = ["disabled"], al = /* @__PURE__ */ ge({
|
|
8
10
|
__name: "BlogEditor",
|
|
9
11
|
props: {
|
|
10
|
-
initialPost: {},
|
|
11
|
-
coverImageUrl: {}
|
|
12
|
+
initialPost: { default: void 0 },
|
|
13
|
+
coverImageUrl: { default: void 0 }
|
|
12
14
|
},
|
|
13
15
|
emits: ["publish", "coverImageSelected"],
|
|
14
|
-
setup(
|
|
15
|
-
var
|
|
16
|
-
const n = G,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
{ label: "Italic", icon: "I", wrap: ["*", "*"] },
|
|
21
|
-
{ label: "Inline code", icon: "`", wrap: ["`", "`"] },
|
|
22
|
-
{ label: "Code block", icon: "{ }", block: "\n```\n\n```\n" },
|
|
23
|
-
{ label: "Blockquote", icon: "❝", prefix: "> " },
|
|
24
|
-
{ label: "Link", icon: "⇗", wrap: ["[", "](url)"] },
|
|
25
|
-
{ label: "Image", icon: "⬚", block: `
|
|
26
|
-
` },
|
|
27
|
-
{ label: "Bullet list", icon: "•–", prefix: "- " },
|
|
28
|
-
{ label: "Numbered list", icon: "1.", prefix: "1. " },
|
|
29
|
-
{ label: "Divider", icon: "—", block: `
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
` }
|
|
33
|
-
];
|
|
34
|
-
function X() {
|
|
35
|
-
return (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
36
|
-
}
|
|
37
|
-
function B(t) {
|
|
38
|
-
return t.toLowerCase().replace(/[^a-z0-9\s-]/g, "").trim().replace(/\s+/g, "-").replace(/-+/g, "-");
|
|
39
|
-
}
|
|
40
|
-
function L(t) {
|
|
41
|
-
const e = t.trim().split(/\s+/).filter(Boolean).length;
|
|
42
|
-
return Math.max(1, Math.ceil(e / 200));
|
|
43
|
-
}
|
|
44
|
-
const c = s(((H = n.initialPost) == null ? void 0 : H.title) ?? ""), p = s(((R = n.initialPost) == null ? void 0 : R.slug) ?? ""), h = s(((M = n.initialPost) == null ? void 0 : M.date) ?? X()), g = s(((F = n.initialPost) == null ? void 0 : F.summary) ?? ""), k = s(((N = n.initialPost) == null ? void 0 : N.excerpt) ?? ""), o = s([...((O = n.initialPost) == null ? void 0 : O.tags) ?? []]), d = s((($ = n.initialPost) == null ? void 0 : $.readingTime) ?? 1), i = s(((q = n.initialPost) == null ? void 0 : q.content) ?? ""), y = s((A = n.initialPost) == null ? void 0 : A.coverImage), f = s(""), T = s(!!n.initialPost), V = s(null);
|
|
45
|
-
ie(() => n.initialPost, (t) => {
|
|
46
|
-
t && (c.value = t.title, p.value = t.slug, h.value = t.date, g.value = t.summary, k.value = t.excerpt ?? "", o.value = [...t.tags], d.value = t.readingTime ?? 1, i.value = t.content, y.value = t.coverImage, T.value = !0);
|
|
16
|
+
setup(ne, { emit: oe }) {
|
|
17
|
+
var A, F, M, $, H, N, q, G, K, W, j, z, J, Q, X, Y, Z;
|
|
18
|
+
const s = ne, R = oe, b = i(((A = s.initialPost) == null ? void 0 : A.title) ?? ""), f = i(((F = s.initialPost) == null ? void 0 : F.slug) ?? ""), x = i(((M = s.initialPost) == null ? void 0 : M.date) ?? xe()), _ = i((($ = s.initialPost) == null ? void 0 : $.summary) ?? ""), P = i(((H = s.initialPost) == null ? void 0 : H.excerpt) ?? ""), n = i([...((N = s.initialPost) == null ? void 0 : N.tags) ?? []]), p = i(((q = s.initialPost) == null ? void 0 : q.readingTime) ?? 1), r = i(((G = s.initialPost) == null ? void 0 : G.content) ?? ""), k = i((K = s.initialPost) == null ? void 0 : K.coverImage), y = i(""), E = i(!!s.initialPost), B = i(null), T = i(((j = (W = s.initialPost) == null ? void 0 : W.series) == null ? void 0 : j.id) ?? ""), C = i(((J = (z = s.initialPost) == null ? void 0 : z.series) == null ? void 0 : J.title) ?? ""), I = i(((X = (Q = s.initialPost) == null ? void 0 : Q.series) == null ? void 0 : X.part) ?? 1), U = i(((Z = (Y = s.initialPost) == null ? void 0 : Y.series) == null ? void 0 : Z.total) ?? 1);
|
|
19
|
+
fe(() => s.initialPost, (a) => {
|
|
20
|
+
var e, t, o, u;
|
|
21
|
+
a && (b.value = a.title, f.value = a.slug, x.value = a.date, _.value = a.summary, P.value = a.excerpt ?? "", n.value = [...a.tags], p.value = a.readingTime ?? 1, r.value = a.content, k.value = a.coverImage, T.value = ((e = a.series) == null ? void 0 : e.id) ?? "", C.value = ((t = a.series) == null ? void 0 : t.title) ?? "", I.value = ((o = a.series) == null ? void 0 : o.part) ?? 1, U.value = ((u = a.series) == null ? void 0 : u.total) ?? 1, E.value = !0);
|
|
47
22
|
});
|
|
48
|
-
const
|
|
49
|
-
function
|
|
50
|
-
|
|
23
|
+
const ue = L(() => we.parse(r.value)), O = L(() => b.value.trim().length > 0 && _.value.trim().length > 0 && r.value.trim().length > 0), D = L(() => k.value ?? s.coverImageUrl);
|
|
24
|
+
function re(a) {
|
|
25
|
+
b.value = a.target.value, E.value || (f.value = se(b.value)), p.value = ie(r.value);
|
|
51
26
|
}
|
|
52
|
-
function
|
|
53
|
-
|
|
27
|
+
function de(a) {
|
|
28
|
+
r.value = a.target.value, p.value = ie(r.value);
|
|
54
29
|
}
|
|
55
|
-
function
|
|
56
|
-
if (
|
|
57
|
-
|
|
58
|
-
const e =
|
|
59
|
-
e && !
|
|
30
|
+
function ve(a) {
|
|
31
|
+
if (a.key === "Enter" || a.key === ",") {
|
|
32
|
+
a.preventDefault();
|
|
33
|
+
const e = y.value.trim().replace(/,/g, "").toLowerCase();
|
|
34
|
+
e && !n.value.includes(e) && (n.value = [...n.value, e]), y.value = "";
|
|
60
35
|
}
|
|
61
|
-
|
|
36
|
+
a.key === "Backspace" && !y.value && n.value.length && (n.value = n.value.slice(0, -1));
|
|
62
37
|
}
|
|
63
|
-
function
|
|
64
|
-
|
|
38
|
+
function be(a) {
|
|
39
|
+
n.value = n.value.filter((e) => e !== a);
|
|
65
40
|
}
|
|
66
|
-
function
|
|
67
|
-
var
|
|
68
|
-
const e = (
|
|
41
|
+
function pe(a) {
|
|
42
|
+
var o;
|
|
43
|
+
const e = (o = a.target.files) == null ? void 0 : o[0];
|
|
69
44
|
if (!e) return;
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
},
|
|
45
|
+
R("coverImageSelected", e);
|
|
46
|
+
const t = new FileReader();
|
|
47
|
+
t.onload = () => {
|
|
48
|
+
k.value = t.result;
|
|
49
|
+
}, t.readAsDataURL(e);
|
|
75
50
|
}
|
|
76
|
-
function
|
|
77
|
-
const e =
|
|
51
|
+
function ce(a) {
|
|
52
|
+
const e = B.value;
|
|
78
53
|
if (!e) return;
|
|
79
|
-
const
|
|
80
|
-
let
|
|
81
|
-
if (
|
|
82
|
-
const [
|
|
83
|
-
|
|
84
|
-
} else if (
|
|
85
|
-
const
|
|
86
|
-
`,
|
|
87
|
-
|
|
88
|
-
} else if (
|
|
89
|
-
|
|
54
|
+
const t = e.selectionStart, o = e.selectionEnd, u = r.value;
|
|
55
|
+
let S, h;
|
|
56
|
+
if (a.wrap) {
|
|
57
|
+
const [w, ee] = a.wrap, le = u.slice(t, o) || "text";
|
|
58
|
+
S = u.slice(0, t) + w + le + ee + u.slice(o), h = t + w.length + le.length + ee.length;
|
|
59
|
+
} else if (a.prefix) {
|
|
60
|
+
const w = u.lastIndexOf(`
|
|
61
|
+
`, t - 1) + 1;
|
|
62
|
+
S = u.slice(0, w) + a.prefix + u.slice(w), h = t + a.prefix.length;
|
|
63
|
+
} else if (a.block)
|
|
64
|
+
S = u.slice(0, t) + a.block + u.slice(o), h = t + a.block.length;
|
|
90
65
|
else
|
|
91
66
|
return;
|
|
92
|
-
|
|
93
|
-
e.selectionStart = e.selectionEnd =
|
|
67
|
+
r.value = S, setTimeout(() => {
|
|
68
|
+
e.selectionStart = e.selectionEnd = h, e.focus();
|
|
94
69
|
}, 0);
|
|
95
70
|
}
|
|
96
|
-
function
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
71
|
+
function me() {
|
|
72
|
+
if (!O.value) return;
|
|
73
|
+
const a = T.value.trim();
|
|
74
|
+
R("publish", {
|
|
75
|
+
title: b.value,
|
|
76
|
+
slug: f.value || se(b.value),
|
|
77
|
+
date: x.value,
|
|
78
|
+
summary: _.value,
|
|
79
|
+
excerpt: P.value || void 0,
|
|
80
|
+
tags: n.value,
|
|
81
|
+
readingTime: p.value,
|
|
82
|
+
content: r.value,
|
|
83
|
+
coverImage: s.coverImageUrl ?? k.value,
|
|
84
|
+
series: a ? { id: a, title: C.value.trim() || a, part: I.value, total: U.value } : void 0
|
|
107
85
|
});
|
|
108
86
|
}
|
|
109
|
-
return (
|
|
110
|
-
l("section",
|
|
111
|
-
l("div",
|
|
112
|
-
e[
|
|
113
|
-
|
|
87
|
+
return (a, e) => (c(), m("div", ke, [
|
|
88
|
+
l("section", Te, [
|
|
89
|
+
l("div", Ce, [
|
|
90
|
+
e[11] || (e[11] = l("label", { class: "be-label" }, [
|
|
91
|
+
g("Title "),
|
|
114
92
|
l("span", { class: "be-required" }, "*")
|
|
115
93
|
], -1)),
|
|
116
94
|
l("input", {
|
|
117
95
|
class: "be-input",
|
|
118
96
|
type: "text",
|
|
119
|
-
value:
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}, null, 40,
|
|
97
|
+
value: b.value,
|
|
98
|
+
placeholder: "Post title…",
|
|
99
|
+
onInput: re
|
|
100
|
+
}, null, 40, Ie)
|
|
123
101
|
]),
|
|
124
|
-
l("div",
|
|
125
|
-
e[
|
|
126
|
-
|
|
102
|
+
l("div", Ue, [
|
|
103
|
+
e[12] || (e[12] = l("label", { class: "be-label" }, "Slug", -1)),
|
|
104
|
+
d(l("input", {
|
|
105
|
+
"onUpdate:modelValue": e[0] || (e[0] = (t) => f.value = t),
|
|
127
106
|
class: "be-input",
|
|
128
107
|
type: "text",
|
|
129
|
-
|
|
130
|
-
onInput: e[1] || (e[1] = (
|
|
131
|
-
placeholder: "post-slug"
|
|
108
|
+
placeholder: "post-slug",
|
|
109
|
+
onInput: e[1] || (e[1] = (t) => E.value = !0)
|
|
132
110
|
}, null, 544), [
|
|
133
|
-
[
|
|
111
|
+
[v, f.value]
|
|
134
112
|
])
|
|
135
113
|
]),
|
|
136
|
-
l("div",
|
|
137
|
-
e[
|
|
138
|
-
|
|
114
|
+
l("div", Se, [
|
|
115
|
+
e[13] || (e[13] = l("label", { class: "be-label" }, "Date", -1)),
|
|
116
|
+
d(l("input", {
|
|
117
|
+
"onUpdate:modelValue": e[2] || (e[2] = (t) => x.value = t),
|
|
139
118
|
class: "be-input",
|
|
140
|
-
type: "date"
|
|
141
|
-
"onUpdate:modelValue": e[2] || (e[2] = (a) => h.value = a)
|
|
119
|
+
type: "date"
|
|
142
120
|
}, null, 512), [
|
|
143
|
-
[
|
|
121
|
+
[v, x.value]
|
|
144
122
|
])
|
|
145
123
|
]),
|
|
146
|
-
l("div",
|
|
147
|
-
e[
|
|
148
|
-
|
|
124
|
+
l("div", he, [
|
|
125
|
+
e[14] || (e[14] = l("label", { class: "be-label" }, [
|
|
126
|
+
g("Summary "),
|
|
149
127
|
l("span", { class: "be-required" }, "*")
|
|
150
128
|
], -1)),
|
|
151
|
-
|
|
129
|
+
d(l("textarea", {
|
|
130
|
+
"onUpdate:modelValue": e[3] || (e[3] = (t) => _.value = t),
|
|
152
131
|
class: "be-input be-input--textarea",
|
|
153
132
|
rows: "2",
|
|
154
|
-
"onUpdate:modelValue": e[3] || (e[3] = (a) => g.value = a),
|
|
155
133
|
placeholder: "Short description shown in blog listings…"
|
|
156
134
|
}, null, 512), [
|
|
157
|
-
[
|
|
135
|
+
[v, _.value]
|
|
158
136
|
])
|
|
159
137
|
]),
|
|
160
|
-
l("div",
|
|
161
|
-
e[
|
|
162
|
-
|
|
138
|
+
l("div", Ve, [
|
|
139
|
+
e[15] || (e[15] = l("label", { class: "be-label" }, [
|
|
140
|
+
g("Excerpt "),
|
|
163
141
|
l("span", { class: "be-optional" }, "(optional)")
|
|
164
142
|
], -1)),
|
|
165
|
-
|
|
143
|
+
d(l("textarea", {
|
|
144
|
+
"onUpdate:modelValue": e[4] || (e[4] = (t) => P.value = t),
|
|
166
145
|
class: "be-input be-input--textarea",
|
|
167
146
|
rows: "2",
|
|
168
|
-
"onUpdate:modelValue": e[4] || (e[4] = (a) => k.value = a),
|
|
169
147
|
placeholder: "Longer teaser for social previews…"
|
|
170
148
|
}, null, 512), [
|
|
171
|
-
[
|
|
149
|
+
[v, P.value]
|
|
172
150
|
])
|
|
173
151
|
]),
|
|
174
|
-
l("div",
|
|
175
|
-
e[
|
|
176
|
-
l("div",
|
|
177
|
-
(
|
|
178
|
-
key:
|
|
152
|
+
l("div", Ee, [
|
|
153
|
+
e[16] || (e[16] = l("label", { class: "be-label" }, "Tags", -1)),
|
|
154
|
+
l("div", De, [
|
|
155
|
+
(c(!0), m(te, null, ae(n.value, (t) => (c(), m("span", {
|
|
156
|
+
key: t,
|
|
179
157
|
class: "be-tag"
|
|
180
158
|
}, [
|
|
181
|
-
|
|
159
|
+
g(V(t) + " ", 1),
|
|
182
160
|
l("button", {
|
|
183
161
|
type: "button",
|
|
184
162
|
class: "be-tag__remove",
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}, "×", 8,
|
|
163
|
+
"aria-label": `Remove tag ${t}`,
|
|
164
|
+
onClick: (o) => be(t)
|
|
165
|
+
}, "×", 8, Le)
|
|
188
166
|
]))), 128)),
|
|
189
|
-
|
|
167
|
+
d(l("input", {
|
|
168
|
+
"onUpdate:modelValue": e[5] || (e[5] = (t) => y.value = t),
|
|
190
169
|
class: "be-tag-input",
|
|
191
170
|
type: "text",
|
|
192
|
-
|
|
193
|
-
onKeydown:
|
|
194
|
-
placeholder: "Add tag, press Enter…"
|
|
171
|
+
placeholder: "Add tag, press Enter…",
|
|
172
|
+
onKeydown: ve
|
|
195
173
|
}, null, 544), [
|
|
196
|
-
[
|
|
174
|
+
[v, y.value]
|
|
197
175
|
])
|
|
198
176
|
])
|
|
199
177
|
]),
|
|
200
|
-
l("div",
|
|
201
|
-
e[
|
|
202
|
-
|
|
178
|
+
l("div", Re, [
|
|
179
|
+
e[17] || (e[17] = l("label", { class: "be-label" }, "Reading time (min)", -1)),
|
|
180
|
+
d(l("input", {
|
|
181
|
+
"onUpdate:modelValue": e[6] || (e[6] = (t) => p.value = t),
|
|
203
182
|
class: "be-input be-input--narrow",
|
|
204
183
|
type: "number",
|
|
205
|
-
min: "1"
|
|
206
|
-
"onUpdate:modelValue": e[6] || (e[6] = (a) => d.value = a)
|
|
184
|
+
min: "1"
|
|
207
185
|
}, null, 512), [
|
|
208
186
|
[
|
|
209
|
-
|
|
210
|
-
|
|
187
|
+
v,
|
|
188
|
+
p.value,
|
|
211
189
|
void 0,
|
|
212
190
|
{ number: !0 }
|
|
213
191
|
]
|
|
214
192
|
])
|
|
215
193
|
]),
|
|
216
|
-
l("div",
|
|
217
|
-
e[
|
|
218
|
-
l("div",
|
|
219
|
-
|
|
194
|
+
l("div", Be, [
|
|
195
|
+
e[18] || (e[18] = l("label", { class: "be-label" }, "Cover Image", -1)),
|
|
196
|
+
l("div", Oe, [
|
|
197
|
+
D.value ? (c(), m("img", {
|
|
220
198
|
key: 0,
|
|
221
199
|
class: "be-cover__preview",
|
|
222
|
-
src:
|
|
200
|
+
src: D.value,
|
|
223
201
|
alt: "Cover preview"
|
|
224
|
-
}, null, 8,
|
|
225
|
-
l("label",
|
|
226
|
-
|
|
202
|
+
}, null, 8, Ae)) : _e("", !0),
|
|
203
|
+
l("label", Fe, [
|
|
204
|
+
g(V(D.value ? "Replace" : "Choose image") + " ", 1),
|
|
227
205
|
l("input", {
|
|
228
206
|
type: "file",
|
|
229
207
|
accept: "image/*",
|
|
230
|
-
|
|
231
|
-
|
|
208
|
+
hidden: "",
|
|
209
|
+
onChange: pe
|
|
232
210
|
}, null, 32)
|
|
233
211
|
])
|
|
234
212
|
])
|
|
213
|
+
]),
|
|
214
|
+
e[23] || (e[23] = l("div", { class: "be-field-group-label" }, [
|
|
215
|
+
g(" Series "),
|
|
216
|
+
l("span", { class: "be-optional" }, "(optional)")
|
|
217
|
+
], -1)),
|
|
218
|
+
l("div", Me, [
|
|
219
|
+
e[19] || (e[19] = l("label", { class: "be-label" }, "Series ID", -1)),
|
|
220
|
+
d(l("input", {
|
|
221
|
+
"onUpdate:modelValue": e[7] || (e[7] = (t) => T.value = t),
|
|
222
|
+
class: "be-input",
|
|
223
|
+
type: "text",
|
|
224
|
+
placeholder: "e.g. go-backend"
|
|
225
|
+
}, null, 512), [
|
|
226
|
+
[v, T.value]
|
|
227
|
+
])
|
|
228
|
+
]),
|
|
229
|
+
l("div", $e, [
|
|
230
|
+
e[20] || (e[20] = l("label", { class: "be-label" }, "Series Title", -1)),
|
|
231
|
+
d(l("input", {
|
|
232
|
+
"onUpdate:modelValue": e[8] || (e[8] = (t) => C.value = t),
|
|
233
|
+
class: "be-input",
|
|
234
|
+
type: "text",
|
|
235
|
+
placeholder: "e.g. Go Backend Series"
|
|
236
|
+
}, null, 512), [
|
|
237
|
+
[v, C.value]
|
|
238
|
+
])
|
|
239
|
+
]),
|
|
240
|
+
l("div", He, [
|
|
241
|
+
l("div", null, [
|
|
242
|
+
e[21] || (e[21] = l("label", { class: "be-label" }, "Part", -1)),
|
|
243
|
+
d(l("input", {
|
|
244
|
+
"onUpdate:modelValue": e[9] || (e[9] = (t) => I.value = t),
|
|
245
|
+
class: "be-input be-input--narrow",
|
|
246
|
+
type: "number",
|
|
247
|
+
min: "1"
|
|
248
|
+
}, null, 512), [
|
|
249
|
+
[
|
|
250
|
+
v,
|
|
251
|
+
I.value,
|
|
252
|
+
void 0,
|
|
253
|
+
{ number: !0 }
|
|
254
|
+
]
|
|
255
|
+
])
|
|
256
|
+
]),
|
|
257
|
+
l("div", null, [
|
|
258
|
+
e[22] || (e[22] = l("label", { class: "be-label" }, "Total Parts", -1)),
|
|
259
|
+
d(l("input", {
|
|
260
|
+
"onUpdate:modelValue": e[10] || (e[10] = (t) => U.value = t),
|
|
261
|
+
class: "be-input be-input--narrow",
|
|
262
|
+
type: "number",
|
|
263
|
+
min: "1"
|
|
264
|
+
}, null, 512), [
|
|
265
|
+
[
|
|
266
|
+
v,
|
|
267
|
+
U.value,
|
|
268
|
+
void 0,
|
|
269
|
+
{ number: !0 }
|
|
270
|
+
]
|
|
271
|
+
])
|
|
272
|
+
])
|
|
235
273
|
])
|
|
236
274
|
]),
|
|
237
|
-
l("section",
|
|
238
|
-
l("div",
|
|
239
|
-
(
|
|
240
|
-
key:
|
|
275
|
+
l("section", Ne, [
|
|
276
|
+
l("div", qe, [
|
|
277
|
+
(c(!0), m(te, null, ae(ye(Pe), (t) => (c(), m("button", {
|
|
278
|
+
key: t.label,
|
|
241
279
|
type: "button",
|
|
242
280
|
class: "be-toolbar__btn",
|
|
243
|
-
title:
|
|
244
|
-
onClick: (
|
|
245
|
-
},
|
|
281
|
+
title: t.label,
|
|
282
|
+
onClick: (o) => ce(t)
|
|
283
|
+
}, V(t.icon), 9, Ge))), 128))
|
|
246
284
|
]),
|
|
247
|
-
l("div",
|
|
248
|
-
l("div",
|
|
249
|
-
e[
|
|
285
|
+
l("div", Ke, [
|
|
286
|
+
l("div", We, [
|
|
287
|
+
e[24] || (e[24] = l("div", { class: "be-pane__label" }, " Markdown ", -1)),
|
|
250
288
|
l("textarea", {
|
|
251
289
|
ref_key: "textareaEl",
|
|
252
|
-
ref:
|
|
290
|
+
ref: B,
|
|
253
291
|
class: "be-pane__textarea",
|
|
254
|
-
value:
|
|
255
|
-
onInput: ee,
|
|
292
|
+
value: r.value,
|
|
256
293
|
placeholder: "Write your post in markdown…",
|
|
257
|
-
spellcheck: "true"
|
|
258
|
-
|
|
294
|
+
spellcheck: "true",
|
|
295
|
+
onInput: de
|
|
296
|
+
}, null, 40, je)
|
|
259
297
|
]),
|
|
260
|
-
l("div",
|
|
261
|
-
e[
|
|
298
|
+
l("div", ze, [
|
|
299
|
+
e[25] || (e[25] = l("div", { class: "be-pane__label" }, " Preview ", -1)),
|
|
262
300
|
l("div", {
|
|
263
301
|
class: "be-pane__preview prose",
|
|
264
|
-
innerHTML:
|
|
265
|
-
}, null, 8,
|
|
302
|
+
innerHTML: ue.value
|
|
303
|
+
}, null, 8, Je)
|
|
266
304
|
])
|
|
267
305
|
])
|
|
268
306
|
]),
|
|
269
|
-
l("footer",
|
|
270
|
-
l("span",
|
|
307
|
+
l("footer", Qe, [
|
|
308
|
+
l("span", Xe, "~" + V(p.value) + " min read", 1),
|
|
271
309
|
l("button", {
|
|
272
310
|
type: "button",
|
|
273
311
|
class: "be-publish",
|
|
274
|
-
disabled: !
|
|
275
|
-
onClick:
|
|
276
|
-
}, " Publish Post ", 8,
|
|
312
|
+
disabled: !O.value,
|
|
313
|
+
onClick: me
|
|
314
|
+
}, " Publish Post ", 8, Ye)
|
|
277
315
|
])
|
|
278
316
|
]));
|
|
279
317
|
}
|
|
280
318
|
});
|
|
281
319
|
export {
|
|
282
|
-
|
|
320
|
+
al as default
|
|
283
321
|
};
|
package/dist/index28.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),h={class:"table-panel"},
|
|
1
|
+
"use strict";const e=require("vue"),h=require("./index75.cjs"),f={class:"table-panel"},g={key:0,class:"dt-empty"},y={class:"dt-toolbar"},C=["placeholder","value"],v={class:"dt-pills"},B=["onClick"],E={class:"dt-count"},p={key:0,class:"dt-col-panel"},b=["checked","onChange"],V={class:"dt-scroll"},N=e.defineComponent({__name:"DataTable",props:{columnDefs:{default:()=>[]},colVisibility:{default:()=>({})},statuses:{default:()=>[]},statusFilter:{default:"all"},statusLabels:{default:()=>({})},searchValue:{default:""},searchPlaceholder:{default:"Search…"},totalCount:{default:0},filteredCount:{default:0},emptyMessage:{default:"No data yet."}},emits:["searchChange","statusChange","colToggle"],setup(t,{emit:u}){const i=t,c=u,a=e.ref(!1),s=e.ref(null);function d(o){return h.getStatusLabel(o,i.statusLabels)}function r(o){var n;(n=s.value)!=null&&n.contains(o.target)||(a.value=!1,document.removeEventListener("click",r))}function m(){a.value=!a.value,a.value&&setTimeout(()=>document.addEventListener("click",r),0)}return(o,n)=>(e.openBlock(),e.createElementBlock("div",f,[t.totalCount===0?(e.openBlock(),e.createElementBlock("p",g,e.toDisplayString(t.emptyMessage),1)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",y,[t.statuses.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("input",{class:"dt-search",type:"search",placeholder:t.searchPlaceholder,value:t.searchValue,onInput:n[0]||(n[0]=l=>c("searchChange",l.target.value))},null,40,C),e.createElementVNode("div",v,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.statuses,l=>(e.openBlock(),e.createElementBlock("button",{key:l,class:e.normalizeClass(["dt-pill",{"dt-pill--active":t.statusFilter===l}]),onClick:k=>c("statusChange",l)},e.toDisplayString(d(l)),11,B))),128))]),e.createElementVNode("span",E,e.toDisplayString(t.filteredCount)+" of "+e.toDisplayString(t.totalCount),1)],64)):e.createCommentVNode("",!0),t.columnDefs.length>0?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"colWrapRef",ref:s,class:"dt-col-wrap"},[e.createElementVNode("button",{class:"dt-col-btn",onClick:m}," ⚙ Columns "),a.value?(e.openBlock(),e.createElementBlock("div",p,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columnDefs,l=>(e.openBlock(),e.createElementBlock("label",{key:l.key,class:"dt-col-check"},[e.createElementVNode("input",{type:"checkbox",checked:t.colVisibility[l.key]??!0,onChange:k=>c("colToggle",l.key)},null,40,b),e.createTextVNode(" "+e.toDisplayString(l.label),1)]))),128))])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",V,[e.renderSlot(o.$slots,"default")])],64))]))}});module.exports=N;
|
package/dist/index28.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as p, ref as m, openBlock as l, createElementBlock as a, toDisplayString as u, Fragment as i, createElementVNode as s, renderList as k, normalizeClass as L, createCommentVNode as r, createTextVNode as V, renderSlot as D } from "vue";
|
|
2
|
+
import { getStatusLabel as S } from "./index75.mjs";
|
|
2
3
|
const T = { class: "table-panel" }, E = {
|
|
3
4
|
key: 0,
|
|
4
5
|
class: "dt-empty"
|
|
5
|
-
}, N = { class: "dt-toolbar" },
|
|
6
|
+
}, N = { class: "dt-toolbar" }, $ = ["placeholder", "value"], x = { class: "dt-pills" }, F = ["onClick"], w = { class: "dt-count" }, B = {
|
|
6
7
|
key: 0,
|
|
7
8
|
class: "dt-col-panel"
|
|
8
|
-
},
|
|
9
|
+
}, M = ["checked", "onChange"], P = { class: "dt-scroll" }, z = /* @__PURE__ */ p({
|
|
9
10
|
__name: "DataTable",
|
|
10
11
|
props: {
|
|
11
12
|
columnDefs: { default: () => [] },
|
|
@@ -21,36 +22,36 @@ const T = { class: "table-panel" }, E = {
|
|
|
21
22
|
},
|
|
22
23
|
emits: ["searchChange", "statusChange", "colToggle"],
|
|
23
24
|
setup(e, { emit: g }) {
|
|
24
|
-
const v = e,
|
|
25
|
-
function C(
|
|
26
|
-
return
|
|
25
|
+
const v = e, d = g, n = m(!1), h = m(null);
|
|
26
|
+
function C(o) {
|
|
27
|
+
return S(o, v.statusLabels);
|
|
27
28
|
}
|
|
28
|
-
function f(
|
|
29
|
+
function f(o) {
|
|
29
30
|
var c;
|
|
30
|
-
(c = h.value) != null && c.contains(
|
|
31
|
+
(c = h.value) != null && c.contains(o.target) || (n.value = !1, document.removeEventListener("click", f));
|
|
31
32
|
}
|
|
32
33
|
function y() {
|
|
33
|
-
|
|
34
|
+
n.value = !n.value, n.value && setTimeout(() => document.addEventListener("click", f), 0);
|
|
34
35
|
}
|
|
35
|
-
return (
|
|
36
|
-
e.totalCount === 0 ? (l(), a("p", E, u(e.emptyMessage), 1)) : (l(), a(
|
|
37
|
-
|
|
38
|
-
e.statuses.length > 0 ? (l(), a(
|
|
39
|
-
|
|
36
|
+
return (o, c) => (l(), a("div", T, [
|
|
37
|
+
e.totalCount === 0 ? (l(), a("p", E, u(e.emptyMessage), 1)) : (l(), a(i, { key: 1 }, [
|
|
38
|
+
s("div", N, [
|
|
39
|
+
e.statuses.length > 0 ? (l(), a(i, { key: 0 }, [
|
|
40
|
+
s("input", {
|
|
40
41
|
class: "dt-search",
|
|
41
42
|
type: "search",
|
|
42
43
|
placeholder: e.searchPlaceholder,
|
|
43
44
|
value: e.searchValue,
|
|
44
|
-
onInput: c[0] || (c[0] = (t) =>
|
|
45
|
-
}, null, 40,
|
|
46
|
-
|
|
47
|
-
(l(!0), a(
|
|
45
|
+
onInput: c[0] || (c[0] = (t) => d("searchChange", t.target.value))
|
|
46
|
+
}, null, 40, $),
|
|
47
|
+
s("div", x, [
|
|
48
|
+
(l(!0), a(i, null, k(e.statuses, (t) => (l(), a("button", {
|
|
48
49
|
key: t,
|
|
49
|
-
class:
|
|
50
|
-
onClick: (b) =>
|
|
50
|
+
class: L(["dt-pill", { "dt-pill--active": e.statusFilter === t }]),
|
|
51
|
+
onClick: (b) => d("statusChange", t)
|
|
51
52
|
}, u(C(t)), 11, F))), 128))
|
|
52
53
|
]),
|
|
53
|
-
|
|
54
|
+
s("span", w, u(e.filteredCount) + " of " + u(e.totalCount), 1)
|
|
54
55
|
], 64)) : r("", !0),
|
|
55
56
|
e.columnDefs.length > 0 ? (l(), a("div", {
|
|
56
57
|
key: 1,
|
|
@@ -58,32 +59,32 @@ const T = { class: "table-panel" }, E = {
|
|
|
58
59
|
ref: h,
|
|
59
60
|
class: "dt-col-wrap"
|
|
60
61
|
}, [
|
|
61
|
-
|
|
62
|
+
s("button", {
|
|
62
63
|
class: "dt-col-btn",
|
|
63
64
|
onClick: y
|
|
64
|
-
}, "⚙ Columns"),
|
|
65
|
-
|
|
66
|
-
(l(!0), a(
|
|
65
|
+
}, " ⚙ Columns "),
|
|
66
|
+
n.value ? (l(), a("div", B, [
|
|
67
|
+
(l(!0), a(i, null, k(e.columnDefs, (t) => (l(), a("label", {
|
|
67
68
|
key: t.key,
|
|
68
69
|
class: "dt-col-check"
|
|
69
70
|
}, [
|
|
70
|
-
|
|
71
|
+
s("input", {
|
|
71
72
|
type: "checkbox",
|
|
72
73
|
checked: e.colVisibility[t.key] ?? !0,
|
|
73
|
-
onChange: (b) =>
|
|
74
|
-
}, null, 40,
|
|
75
|
-
|
|
74
|
+
onChange: (b) => d("colToggle", t.key)
|
|
75
|
+
}, null, 40, M),
|
|
76
|
+
V(" " + u(t.label), 1)
|
|
76
77
|
]))), 128))
|
|
77
78
|
])) : r("", !0)
|
|
78
79
|
], 512)) : r("", !0)
|
|
79
80
|
]),
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
s("div", P, [
|
|
82
|
+
D(o.$slots, "default")
|
|
82
83
|
])
|
|
83
84
|
], 64))
|
|
84
85
|
]));
|
|
85
86
|
}
|
|
86
87
|
});
|
|
87
88
|
export {
|
|
88
|
-
|
|
89
|
+
z as default
|
|
89
90
|
};
|