@ptbdynamic/plinth 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +258 -2
- package/package.json +99 -4
- package/packages/css/dist/avatar.css +122 -0
- package/packages/css/dist/badge.css +76 -0
- package/packages/css/dist/button.css +273 -0
- package/packages/css/dist/callout.css +143 -0
- package/packages/css/dist/code-block.css +283 -0
- package/packages/css/dist/confirm-dialog.css +183 -0
- package/packages/css/dist/data-table.css +470 -0
- package/packages/css/dist/dialog.css +113 -0
- package/packages/css/dist/drawer.css +156 -0
- package/packages/css/dist/fonts/geist/LICENSE +93 -0
- package/packages/css/dist/fonts/geist/geist-cyrillic-ext-wght-normal.woff2 +0 -0
- package/packages/css/dist/fonts/geist/geist-cyrillic-wght-normal.woff2 +0 -0
- package/packages/css/dist/fonts/geist/geist-latin-ext-wght-normal.woff2 +0 -0
- package/packages/css/dist/fonts/geist/geist-latin-wght-normal.woff2 +0 -0
- package/packages/css/dist/fonts/geist/geist-vietnamese-wght-normal.woff2 +0 -0
- package/packages/css/dist/fonts/geist-mono/LICENSE +93 -0
- package/packages/css/dist/fonts/geist-mono/geist-mono-cyrillic-ext-wght-normal.woff2 +0 -0
- package/packages/css/dist/fonts/geist-mono/geist-mono-cyrillic-wght-normal.woff2 +0 -0
- package/packages/css/dist/fonts/geist-mono/geist-mono-latin-ext-wght-normal.woff2 +0 -0
- package/packages/css/dist/fonts/geist-mono/geist-mono-latin-wght-normal.woff2 +0 -0
- package/packages/css/dist/fonts/geist-mono/geist-mono-symbols2-wght-normal.woff2 +0 -0
- package/packages/css/dist/fonts/geist-mono/geist-mono-vietnamese-wght-normal.woff2 +0 -0
- package/packages/css/dist/fonts/index.css +109 -0
- package/packages/css/dist/header.css +110 -0
- package/packages/css/dist/icon.css +51 -0
- package/packages/css/dist/list-card.css +76 -0
- package/packages/css/dist/list-row.css +164 -0
- package/packages/css/dist/menu-sheet.css +84 -0
- package/packages/css/dist/menu.css +245 -0
- package/packages/css/dist/modal.css +367 -0
- package/packages/css/dist/page-header.css +124 -0
- package/packages/css/dist/pill-row.css +197 -0
- package/packages/css/dist/plinth.css +4446 -0
- package/packages/css/dist/section-menu.css +226 -0
- package/packages/css/dist/sheet.css +239 -0
- package/packages/css/dist/text-field.css +230 -0
- package/packages/css/dist/textarea.css +169 -0
- package/packages/css/dist/tokens.css +413 -0
- package/packages/react/dist/PlinthAvatar.d.ts +17 -0
- package/packages/react/dist/PlinthBadge.d.ts +7 -0
- package/packages/react/dist/PlinthButton.d.ts +29 -0
- package/packages/react/dist/PlinthCallout.d.ts +16 -0
- package/packages/react/dist/PlinthCodeBlock.d.ts +24 -0
- package/packages/react/dist/PlinthConfirmDialog.d.ts +38 -0
- package/packages/react/dist/PlinthDataTable.d.ts +11 -0
- package/packages/react/dist/PlinthDataTableCell.d.ts +15 -0
- package/packages/react/dist/PlinthDataTableColumn.d.ts +13 -0
- package/packages/react/dist/PlinthDataTableEmpty.d.ts +9 -0
- package/packages/react/dist/PlinthDataTableRow.d.ts +9 -0
- package/packages/react/dist/PlinthDataTableSort.d.ts +4 -0
- package/packages/react/dist/PlinthDialog.d.ts +26 -0
- package/packages/react/dist/PlinthDrawer.d.ts +29 -0
- package/packages/react/dist/PlinthIcon.d.ts +10 -0
- package/packages/react/dist/PlinthIconButton.d.ts +26 -0
- package/packages/react/dist/PlinthListCard.d.ts +14 -0
- package/packages/react/dist/PlinthListRow.d.ts +29 -0
- package/packages/react/dist/PlinthMenu.d.ts +12 -0
- package/packages/react/dist/PlinthMenuGroup.d.ts +9 -0
- package/packages/react/dist/PlinthMenuItem.d.ts +26 -0
- package/packages/react/dist/PlinthMenuSeparator.d.ts +4 -0
- package/packages/react/dist/PlinthMenuSheet.d.ts +24 -0
- package/packages/react/dist/PlinthPageHeader.d.ts +17 -0
- package/packages/react/dist/PlinthPill.d.ts +17 -0
- package/packages/react/dist/PlinthPillRow.d.ts +13 -0
- package/packages/react/dist/PlinthSectionMenu.d.ts +11 -0
- package/packages/react/dist/PlinthSectionMenuItem.d.ts +20 -0
- package/packages/react/dist/PlinthSheet.d.ts +26 -0
- package/packages/react/dist/PlinthTextField.d.ts +24 -0
- package/packages/react/dist/PlinthTextarea.d.ts +24 -0
- package/packages/react/dist/avatar.d.ts +12 -0
- package/packages/react/dist/button.d.ts +21 -0
- package/packages/react/dist/callout.d.ts +19 -0
- package/packages/react/dist/code-block.d.ts +16 -0
- package/packages/react/dist/confirm-dialog.d.ts +23 -0
- package/packages/react/dist/data-table.d.ts +15 -0
- package/packages/react/dist/dialog.d.ts +10 -0
- package/packages/react/dist/drawer.d.ts +20 -0
- package/packages/react/dist/heading.d.ts +5 -0
- package/packages/react/dist/icon.d.ts +5 -0
- package/packages/react/dist/index.d.ts +49 -0
- package/packages/react/dist/index.js +1326 -0
- package/packages/react/dist/list-row.d.ts +5 -0
- package/packages/react/dist/markup.d.ts +9 -0
- package/packages/react/dist/menu.d.ts +7 -0
- package/packages/react/dist/page-header.d.ts +5 -0
- package/packages/react/dist/sheet.d.ts +12 -0
- package/packages/react/dist/size.d.ts +13 -0
- package/packages/react/dist/swipe.d.ts +15 -0
- package/packages/react/dist/text-field.d.ts +10 -0
- package/packages/react/dist/tones.d.ts +5 -0
- package/packages/tokens/dist/index.d.ts +230 -0
- package/packages/tokens/dist/index.js +4091 -0
- package/packages/tokens/dist/tailwind-theme.css +80 -0
- package/packages/tokens/dist/tokens.css +413 -0
- package/packages/tokens/dist/tokens.json +3875 -0
- package/packages/vue/dist/PlinthAvatar.vue.d.ts +24 -0
- package/packages/vue/dist/PlinthBadge.vue.d.ts +21 -0
- package/packages/vue/dist/PlinthButton.vue.d.ts +42 -0
- package/packages/vue/dist/PlinthCallout.vue.d.ts +31 -0
- package/packages/vue/dist/PlinthCodeBlock.vue.d.ts +49 -0
- package/packages/vue/dist/PlinthConfirmDialog.vue.d.ts +51 -0
- package/packages/vue/dist/PlinthDataTable.vue.d.ts +21 -0
- package/packages/vue/dist/PlinthDataTableCell.vue.d.ts +29 -0
- package/packages/vue/dist/PlinthDataTableColumn.vue.d.ts +26 -0
- package/packages/vue/dist/PlinthDataTableEmpty.vue.d.ts +19 -0
- package/packages/vue/dist/PlinthDataTableRow.vue.d.ts +19 -0
- package/packages/vue/dist/PlinthDataTableSort.vue.d.ts +13 -0
- package/packages/vue/dist/PlinthDialog.vue.d.ts +45 -0
- package/packages/vue/dist/PlinthDrawer.vue.d.ts +48 -0
- package/packages/vue/dist/PlinthIcon.vue.d.ts +23 -0
- package/packages/vue/dist/PlinthIconButton.vue.d.ts +37 -0
- package/packages/vue/dist/PlinthListCard.vue.d.ts +26 -0
- package/packages/vue/dist/PlinthListRow.vue.d.ts +38 -0
- package/packages/vue/dist/PlinthMenu.vue.d.ts +24 -0
- package/packages/vue/dist/PlinthMenuGroup.vue.d.ts +17 -0
- package/packages/vue/dist/PlinthMenuItem.vue.d.ts +34 -0
- package/packages/vue/dist/PlinthMenuSeparator.vue.d.ts +3 -0
- package/packages/vue/dist/PlinthMenuSheet.vue.d.ts +48 -0
- package/packages/vue/dist/PlinthPageHeader.vue.d.ts +27 -0
- package/packages/vue/dist/PlinthPill.vue.d.ts +28 -0
- package/packages/vue/dist/PlinthPillRow.vue.d.ts +22 -0
- package/packages/vue/dist/PlinthSectionMenu.vue.d.ts +22 -0
- package/packages/vue/dist/PlinthSectionMenuItem.vue.d.ts +28 -0
- package/packages/vue/dist/PlinthSheet.vue.d.ts +45 -0
- package/packages/vue/dist/PlinthTextField.vue.d.ts +51 -0
- package/packages/vue/dist/PlinthTextarea.vue.d.ts +42 -0
- package/packages/vue/dist/avatar.d.ts +12 -0
- package/packages/vue/dist/button.d.ts +5 -0
- package/packages/vue/dist/callout.d.ts +19 -0
- package/packages/vue/dist/code-block.d.ts +16 -0
- package/packages/vue/dist/confirm-dialog.d.ts +23 -0
- package/packages/vue/dist/data-table.d.ts +15 -0
- package/packages/vue/dist/dialog.d.ts +10 -0
- package/packages/vue/dist/drawer.d.ts +20 -0
- package/packages/vue/dist/heading.d.ts +5 -0
- package/packages/vue/dist/icon.d.ts +5 -0
- package/packages/vue/dist/index.d.ts +53 -0
- package/packages/vue/dist/index.js +1732 -0
- package/packages/vue/dist/list-row.d.ts +5 -0
- package/packages/vue/dist/menu.d.ts +8 -0
- package/packages/vue/dist/page-header.d.ts +5 -0
- package/packages/vue/dist/sheet.d.ts +12 -0
- package/packages/vue/dist/size.d.ts +13 -0
- package/packages/vue/dist/slots.d.ts +3 -0
- package/packages/vue/dist/swipe.d.ts +12 -0
- package/packages/vue/dist/text-field.d.ts +10 -0
- package/packages/vue/dist/tones.d.ts +5 -0
|
@@ -0,0 +1,1732 @@
|
|
|
1
|
+
import { Comment as e, Fragment as t, Static as n, Text as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, inject as f, mergeModels as p, mergeProps as m, normalizeClass as h, onBeforeUnmount as g, onMounted as _, openBlock as v, provide as y, ref as b, renderList as x, renderSlot as S, resolveDynamicComponent as C, toDisplayString as w, unref as T, useAttrs as E, useId as D, useModel as O, useSlots as k, warn as A, watchEffect as ee, withCtx as j } from "vue";
|
|
2
|
+
//#region src/size.ts
|
|
3
|
+
var te = [
|
|
4
|
+
"xs",
|
|
5
|
+
"sm",
|
|
6
|
+
"md",
|
|
7
|
+
"lg",
|
|
8
|
+
"xl"
|
|
9
|
+
], M = [
|
|
10
|
+
"sm",
|
|
11
|
+
"md",
|
|
12
|
+
"lg"
|
|
13
|
+
];
|
|
14
|
+
function N(e, t, n) {
|
|
15
|
+
return t.includes(e) ? e : n;
|
|
16
|
+
}
|
|
17
|
+
function P(e) {
|
|
18
|
+
return e === "xs" || e === "sm" ? "sm" : "md";
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/avatar.ts
|
|
22
|
+
var ne = [
|
|
23
|
+
"sm",
|
|
24
|
+
"md",
|
|
25
|
+
"lg",
|
|
26
|
+
"xl"
|
|
27
|
+
];
|
|
28
|
+
function re(e) {
|
|
29
|
+
return N(e, ne, "md");
|
|
30
|
+
}
|
|
31
|
+
function ie(e) {
|
|
32
|
+
let t = e.trim().split(/\s+/).filter(Boolean);
|
|
33
|
+
return t.length === 0 ? "" : ([...t[0]][0] + (t.length > 1 ? [...t.at(-1)][0] : "")).toUpperCase();
|
|
34
|
+
}
|
|
35
|
+
var ae = "<svg class=\"plinth-avatar-glyph\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" aria-hidden=\"true\"><circle cx=\"12\" cy=\"9\" r=\"4\"></circle><path d=\"M4.5 20a7.5 7.5 0 0 1 15 0\"></path></svg>", F = [
|
|
36
|
+
"neutral",
|
|
37
|
+
"success",
|
|
38
|
+
"warning",
|
|
39
|
+
"danger"
|
|
40
|
+
];
|
|
41
|
+
function oe(e) {
|
|
42
|
+
return F.includes(e) ? e : F[0];
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/PlinthAvatar.vue?vue&type=script&setup=true&lang.ts
|
|
46
|
+
var se = [
|
|
47
|
+
"data-size",
|
|
48
|
+
"role",
|
|
49
|
+
"aria-label",
|
|
50
|
+
"aria-hidden"
|
|
51
|
+
], ce = ["src"], le = {
|
|
52
|
+
key: 1,
|
|
53
|
+
class: "plinth-avatar-initials",
|
|
54
|
+
"aria-hidden": "true"
|
|
55
|
+
}, ue = {
|
|
56
|
+
key: 2,
|
|
57
|
+
class: "plinth-avatar-glyph",
|
|
58
|
+
viewBox: "0 0 24 24",
|
|
59
|
+
fill: "none",
|
|
60
|
+
stroke: "currentColor",
|
|
61
|
+
"stroke-width": "1.5",
|
|
62
|
+
"stroke-linecap": "round",
|
|
63
|
+
"aria-hidden": "true"
|
|
64
|
+
}, de = ["data-tone"], I = /* @__PURE__ */ d({
|
|
65
|
+
__name: "PlinthAvatar",
|
|
66
|
+
props: {
|
|
67
|
+
name: { default: "" },
|
|
68
|
+
src: { default: void 0 },
|
|
69
|
+
initials: { default: void 0 },
|
|
70
|
+
size: { default: "md" },
|
|
71
|
+
status: { default: void 0 },
|
|
72
|
+
statusLabel: { default: void 0 },
|
|
73
|
+
decorative: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: !1
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
setup(e) {
|
|
79
|
+
let t = e, n = i(() => re(t.size)), r = i(() => t.status ? oe(t.status) : void 0), a = i(() => {
|
|
80
|
+
if (!t.decorative) return r.value && t.statusLabel ? `${t.name}, ${t.statusLabel}` : t.name;
|
|
81
|
+
}), l = i(() => t.initials ?? ie(t.name));
|
|
82
|
+
return ee(() => {
|
|
83
|
+
t.decorative || (t.name.trim() || A("PlinthAvatar needs a name, or decorative when the name is shown next to it."), t.status && !t.statusLabel && A("PlinthAvatar needs a statusLabel with a status: colour alone does not say what it means."));
|
|
84
|
+
}), (t, i) => (v(), s("span", {
|
|
85
|
+
class: "plinth-avatar",
|
|
86
|
+
"data-size": n.value,
|
|
87
|
+
role: a.value === void 0 ? void 0 : "img",
|
|
88
|
+
"aria-label": a.value,
|
|
89
|
+
"aria-hidden": e.decorative ? "true" : void 0
|
|
90
|
+
}, [e.src ? (v(), s("img", {
|
|
91
|
+
key: 0,
|
|
92
|
+
class: "plinth-avatar-image",
|
|
93
|
+
src: e.src,
|
|
94
|
+
alt: ""
|
|
95
|
+
}, null, 8, ce)) : l.value ? (v(), s("span", le, w(l.value), 1)) : (v(), s("svg", ue, [...i[0] ||= [c("circle", {
|
|
96
|
+
cx: "12",
|
|
97
|
+
cy: "9",
|
|
98
|
+
r: "4"
|
|
99
|
+
}, null, -1), c("path", { d: "M4.5 20a7.5 7.5 0 0 1 15 0" }, null, -1)]])), r.value ? (v(), s("span", {
|
|
100
|
+
key: 3,
|
|
101
|
+
class: "plinth-avatar-status",
|
|
102
|
+
"data-tone": r.value,
|
|
103
|
+
"aria-hidden": "true"
|
|
104
|
+
}, null, 8, de)) : o("", !0)], 8, se));
|
|
105
|
+
}
|
|
106
|
+
}), fe = ["data-tone"], pe = {
|
|
107
|
+
key: 0,
|
|
108
|
+
class: "plinth-badge-dot",
|
|
109
|
+
"aria-hidden": "true"
|
|
110
|
+
}, me = { class: "plinth-badge-label" }, he = /* @__PURE__ */ d({
|
|
111
|
+
__name: "PlinthBadge",
|
|
112
|
+
props: {
|
|
113
|
+
tone: { default: "neutral" },
|
|
114
|
+
dot: {
|
|
115
|
+
type: Boolean,
|
|
116
|
+
default: !1
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
setup(e) {
|
|
120
|
+
let t = e, n = i(() => oe(t.tone));
|
|
121
|
+
return (t, r) => (v(), s("span", {
|
|
122
|
+
class: "plinth-badge",
|
|
123
|
+
"data-tone": n.value
|
|
124
|
+
}, [e.dot ? (v(), s("span", pe)) : o("", !0), c("span", me, [S(t.$slots, "default")])], 8, fe));
|
|
125
|
+
}
|
|
126
|
+
}), ge = [
|
|
127
|
+
"primary",
|
|
128
|
+
"accent",
|
|
129
|
+
"secondary",
|
|
130
|
+
"ghost",
|
|
131
|
+
"danger",
|
|
132
|
+
"danger-ghost"
|
|
133
|
+
];
|
|
134
|
+
function _e(e) {
|
|
135
|
+
return ge.includes(e) ? e : "primary";
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/PlinthButton.vue?vue&type=script&setup=true&lang.ts
|
|
139
|
+
var ve = [
|
|
140
|
+
"href",
|
|
141
|
+
"data-variant",
|
|
142
|
+
"data-size",
|
|
143
|
+
"role",
|
|
144
|
+
"aria-busy",
|
|
145
|
+
"aria-disabled"
|
|
146
|
+
], ye = {
|
|
147
|
+
key: 0,
|
|
148
|
+
class: "plinth-button-spinner",
|
|
149
|
+
"aria-hidden": "true"
|
|
150
|
+
}, be = ["data-size", "data-mirror"], xe = { class: "plinth-button-label" }, Se = ["data-size", "data-mirror"], Ce = [
|
|
151
|
+
"data-variant",
|
|
152
|
+
"data-size",
|
|
153
|
+
"disabled",
|
|
154
|
+
"aria-busy",
|
|
155
|
+
"aria-disabled"
|
|
156
|
+
], we = {
|
|
157
|
+
key: 0,
|
|
158
|
+
class: "plinth-button-spinner",
|
|
159
|
+
"aria-hidden": "true"
|
|
160
|
+
}, Te = ["data-size", "data-mirror"], Ee = { class: "plinth-button-label" }, De = ["data-size", "data-mirror"], L = /* @__PURE__ */ d({
|
|
161
|
+
__name: "PlinthButton",
|
|
162
|
+
props: {
|
|
163
|
+
variant: { default: "primary" },
|
|
164
|
+
size: { default: "md" },
|
|
165
|
+
href: { default: void 0 },
|
|
166
|
+
disabled: {
|
|
167
|
+
type: Boolean,
|
|
168
|
+
default: !1
|
|
169
|
+
},
|
|
170
|
+
busy: {
|
|
171
|
+
type: Boolean,
|
|
172
|
+
default: !1
|
|
173
|
+
},
|
|
174
|
+
mirrorIcon: {
|
|
175
|
+
type: Boolean,
|
|
176
|
+
default: !1
|
|
177
|
+
},
|
|
178
|
+
mirrorTrailing: {
|
|
179
|
+
type: Boolean,
|
|
180
|
+
default: !1
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
setup(e) {
|
|
184
|
+
let t = e, n = i(() => _e(t.variant)), r = i(() => N(t.size, M, "md")), a = i(() => P(r.value)), l = i(() => t.busy && !t.disabled);
|
|
185
|
+
return (t, i) => e.href ? (v(), s("a", {
|
|
186
|
+
key: 0,
|
|
187
|
+
class: "plinth-button",
|
|
188
|
+
href: e.disabled ? void 0 : e.href,
|
|
189
|
+
"data-variant": n.value,
|
|
190
|
+
"data-size": r.value,
|
|
191
|
+
role: e.disabled ? "link" : void 0,
|
|
192
|
+
"aria-busy": l.value ? "true" : void 0,
|
|
193
|
+
"aria-disabled": l.value || e.disabled ? "true" : void 0
|
|
194
|
+
}, [
|
|
195
|
+
l.value ? (v(), s("span", ye)) : t.$slots.icon ? (v(), s("span", {
|
|
196
|
+
key: 1,
|
|
197
|
+
class: "plinth-icon",
|
|
198
|
+
"data-size": a.value,
|
|
199
|
+
"data-mirror": e.mirrorIcon ? "" : void 0,
|
|
200
|
+
"aria-hidden": "true"
|
|
201
|
+
}, [S(t.$slots, "icon")], 8, be)) : o("", !0),
|
|
202
|
+
c("span", xe, [S(t.$slots, "default")]),
|
|
203
|
+
t.$slots.trailing ? (v(), s("span", {
|
|
204
|
+
key: 2,
|
|
205
|
+
class: "plinth-icon",
|
|
206
|
+
"data-size": a.value,
|
|
207
|
+
"data-mirror": e.mirrorTrailing ? "" : void 0,
|
|
208
|
+
"aria-hidden": "true"
|
|
209
|
+
}, [S(t.$slots, "trailing")], 8, Se)) : o("", !0)
|
|
210
|
+
], 8, ve)) : (v(), s("button", {
|
|
211
|
+
key: 1,
|
|
212
|
+
type: "button",
|
|
213
|
+
class: "plinth-button",
|
|
214
|
+
"data-variant": n.value,
|
|
215
|
+
"data-size": r.value,
|
|
216
|
+
disabled: e.disabled || void 0,
|
|
217
|
+
"aria-busy": l.value ? "true" : void 0,
|
|
218
|
+
"aria-disabled": l.value ? "true" : void 0
|
|
219
|
+
}, [
|
|
220
|
+
l.value ? (v(), s("span", we)) : t.$slots.icon ? (v(), s("span", {
|
|
221
|
+
key: 1,
|
|
222
|
+
class: "plinth-icon",
|
|
223
|
+
"data-size": a.value,
|
|
224
|
+
"data-mirror": e.mirrorIcon ? "" : void 0,
|
|
225
|
+
"aria-hidden": "true"
|
|
226
|
+
}, [S(t.$slots, "icon")], 8, Te)) : o("", !0),
|
|
227
|
+
c("span", Ee, [S(t.$slots, "default")]),
|
|
228
|
+
t.$slots.trailing ? (v(), s("span", {
|
|
229
|
+
key: 2,
|
|
230
|
+
class: "plinth-icon",
|
|
231
|
+
"data-size": a.value,
|
|
232
|
+
"data-mirror": e.mirrorTrailing ? "" : void 0,
|
|
233
|
+
"aria-hidden": "true"
|
|
234
|
+
}, [S(t.$slots, "trailing")], 8, De)) : o("", !0)
|
|
235
|
+
], 8, Ce));
|
|
236
|
+
}
|
|
237
|
+
}), Oe = [
|
|
238
|
+
"neutral",
|
|
239
|
+
"info",
|
|
240
|
+
"success",
|
|
241
|
+
"warning",
|
|
242
|
+
"danger"
|
|
243
|
+
];
|
|
244
|
+
function ke(e) {
|
|
245
|
+
return Oe.includes(e) ? e : "neutral";
|
|
246
|
+
}
|
|
247
|
+
var Ae = [
|
|
248
|
+
"note",
|
|
249
|
+
"status",
|
|
250
|
+
"alert"
|
|
251
|
+
];
|
|
252
|
+
function je(e) {
|
|
253
|
+
return Ae.includes(e) ? e : "note";
|
|
254
|
+
}
|
|
255
|
+
var R = (e) => `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${e}</svg>`, Me = {
|
|
256
|
+
neutral: R("<rect x=\"5\" y=\"4\" width=\"14\" height=\"16\" rx=\"2\"></rect><path d=\"M9 9h6M9 13h6M9 17h3\"></path>"),
|
|
257
|
+
info: R("<circle cx=\"12\" cy=\"12\" r=\"9\"></circle><path d=\"M12 11v5M12 7.5v.01\"></path>"),
|
|
258
|
+
success: R("<circle cx=\"12\" cy=\"12\" r=\"9\"></circle><path d=\"M8 12.5l2.5 2.5L16 9.5\"></path>"),
|
|
259
|
+
warning: R("<path d=\"M10.3 4.3L2.6 18a2 2 0 0 0 1.7 3h15.4a2 2 0 0 0 1.7-3L13.7 4.3a2 2 0 0 0-3.4 0z\"></path><path d=\"M12 9.5v4M12 17v.01\"></path>"),
|
|
260
|
+
danger: R("<path d=\"M8.5 3h7L21 8.5v7L15.5 21h-7L3 15.5v-7z\"></path><path d=\"M12 7.5v5M12 16v.01\"></path>")
|
|
261
|
+
}, z = (i) => (i ?? []).some((i) => i.type === e ? !1 : i.type === r || i.type === n ? String(i.children).trim() !== "" : i.type !== t || z(i.children)), Ne = ["data-tone", "role"], Pe = {
|
|
262
|
+
key: 0,
|
|
263
|
+
class: "plinth-icon plinth-callout-icon",
|
|
264
|
+
"data-size": "md",
|
|
265
|
+
"aria-hidden": "true"
|
|
266
|
+
}, Fe = ["innerHTML"], Ie = { class: "plinth-callout-body" }, Le = {
|
|
267
|
+
key: 0,
|
|
268
|
+
class: "plinth-callout-title"
|
|
269
|
+
}, Re = {
|
|
270
|
+
key: 1,
|
|
271
|
+
class: "plinth-callout-text"
|
|
272
|
+
}, ze = {
|
|
273
|
+
key: 2,
|
|
274
|
+
class: "plinth-callout-actions"
|
|
275
|
+
}, Be = /* @__PURE__ */ d({
|
|
276
|
+
__name: "PlinthCallout",
|
|
277
|
+
props: {
|
|
278
|
+
tone: { default: "neutral" },
|
|
279
|
+
role: { default: "note" },
|
|
280
|
+
title: { default: void 0 }
|
|
281
|
+
},
|
|
282
|
+
setup(e) {
|
|
283
|
+
let t = e, n = k(), r = i(() => ke(t.tone)), a = i(() => je(t.role));
|
|
284
|
+
return (t, i) => (v(), s("div", {
|
|
285
|
+
class: "plinth-callout",
|
|
286
|
+
"data-tone": r.value,
|
|
287
|
+
role: a.value
|
|
288
|
+
}, [T(z)(T(n).icon?.()) ? (v(), s("span", Pe, [S(t.$slots, "icon")])) : (v(), s("span", {
|
|
289
|
+
key: 1,
|
|
290
|
+
class: "plinth-icon plinth-callout-icon",
|
|
291
|
+
"data-size": "md",
|
|
292
|
+
"aria-hidden": "true",
|
|
293
|
+
innerHTML: T(Me)[r.value]
|
|
294
|
+
}, null, 8, Fe)), c("div", Ie, [
|
|
295
|
+
e.title?.trim() || T(z)(T(n).title?.()) ? (v(), s("p", Le, [S(t.$slots, "title", {}, () => [l(w(e.title), 1)])])) : o("", !0),
|
|
296
|
+
T(z)(T(n).default?.()) ? (v(), s("div", Re, [S(t.$slots, "default")])) : o("", !0),
|
|
297
|
+
T(z)(T(n).actions?.()) ? (v(), s("div", ze, [S(t.$slots, "actions")])) : o("", !0)
|
|
298
|
+
])], 8, Ne));
|
|
299
|
+
}
|
|
300
|
+
}), B = (e) => e.slice(0, 6), Ve = (e, t) => Math.max(0, e.findIndex((e) => e.label === t));
|
|
301
|
+
function He(e) {
|
|
302
|
+
let t = e.closest(".plinth-code-block"), n = [...t?.querySelectorAll(".plinth-code-block-tab-input") ?? []], r = Math.max(0, n.findIndex((e) => e.checked));
|
|
303
|
+
return t?.querySelectorAll(".plinth-code-block-code")[r]?.textContent ?? "";
|
|
304
|
+
}
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region src/PlinthCodeBlock.vue?vue&type=script&setup=true&lang.ts
|
|
307
|
+
var Ue = ["id"], We = { class: "plinth-code-block-header" }, Ge = {
|
|
308
|
+
key: 0,
|
|
309
|
+
class: "plinth-code-block-label"
|
|
310
|
+
}, Ke = {
|
|
311
|
+
key: 1,
|
|
312
|
+
class: "plinth-code-block-label"
|
|
313
|
+
}, qe = ["aria-label"], Je = ["name", "checked"], Ye = { class: "plinth-code-block-tab-label" }, Xe = {
|
|
314
|
+
class: "plinth-code-block-status",
|
|
315
|
+
role: "status"
|
|
316
|
+
}, Ze = {
|
|
317
|
+
key: 0,
|
|
318
|
+
class: "plinth-code-block-code",
|
|
319
|
+
dir: "ltr",
|
|
320
|
+
tabindex: "0"
|
|
321
|
+
}, Qe = ["innerHTML"], $e = {
|
|
322
|
+
key: 1,
|
|
323
|
+
class: "plinth-code-block-code",
|
|
324
|
+
dir: "ltr",
|
|
325
|
+
tabindex: "0"
|
|
326
|
+
}, et = {
|
|
327
|
+
key: 1,
|
|
328
|
+
class: "plinth-code-block-code",
|
|
329
|
+
dir: "ltr",
|
|
330
|
+
tabindex: "0"
|
|
331
|
+
}, tt = ["innerHTML"], nt = {
|
|
332
|
+
key: 2,
|
|
333
|
+
class: "plinth-code-block-code",
|
|
334
|
+
dir: "ltr",
|
|
335
|
+
tabindex: "0"
|
|
336
|
+
}, V = /* @__PURE__ */ d({
|
|
337
|
+
__name: "PlinthCodeBlock",
|
|
338
|
+
props: {
|
|
339
|
+
id: { default: void 0 },
|
|
340
|
+
label: { default: void 0 },
|
|
341
|
+
html: { default: void 0 },
|
|
342
|
+
tabs: { default: () => [] },
|
|
343
|
+
selected: { default: void 0 },
|
|
344
|
+
tabsLabel: { default: "Language" },
|
|
345
|
+
copy: {
|
|
346
|
+
type: Boolean,
|
|
347
|
+
default: !0
|
|
348
|
+
},
|
|
349
|
+
copyLabel: { default: "Copy" },
|
|
350
|
+
copiedLabel: { default: "Copied" }
|
|
351
|
+
},
|
|
352
|
+
emits: ["copied"],
|
|
353
|
+
setup(e, { emit: n }) {
|
|
354
|
+
let r = e, a = n, d = k(), f = D(), p = i(() => r.id?.trim() || void 0), m = i(() => `${p.value ?? `plinth-code-block-${f}`}-language`), h = i(() => B(r.tabs)), y = Ve(B(r.tabs), r.selected), C = b(!1), E = b(!1), O;
|
|
355
|
+
_(() => {
|
|
356
|
+
C.value = !!navigator.clipboard;
|
|
357
|
+
}), g(() => clearTimeout(O));
|
|
358
|
+
async function A(e) {
|
|
359
|
+
let t = He(e.currentTarget);
|
|
360
|
+
try {
|
|
361
|
+
await navigator.clipboard.writeText(t);
|
|
362
|
+
} catch {
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
E.value = !0, clearTimeout(O), O = setTimeout(() => E.value = !1, 2e3), a("copied", t);
|
|
366
|
+
}
|
|
367
|
+
return (n, r) => (v(), s("div", {
|
|
368
|
+
id: p.value,
|
|
369
|
+
class: "plinth-code-block"
|
|
370
|
+
}, [c("div", We, [
|
|
371
|
+
T(z)(T(d).label?.()) ? (v(), s("span", Ge, [S(n.$slots, "label")])) : e.label?.trim() ? (v(), s("span", Ke, w(e.label), 1)) : o("", !0),
|
|
372
|
+
h.value.length ? (v(), s("div", {
|
|
373
|
+
key: 2,
|
|
374
|
+
class: "plinth-code-block-tabs",
|
|
375
|
+
role: "radiogroup",
|
|
376
|
+
"aria-label": e.tabsLabel
|
|
377
|
+
}, [(v(!0), s(t, null, x(h.value, (e, t) => (v(), s("label", {
|
|
378
|
+
key: t,
|
|
379
|
+
class: "plinth-code-block-tab"
|
|
380
|
+
}, [c("input", {
|
|
381
|
+
type: "radio",
|
|
382
|
+
class: "plinth-code-block-tab-input",
|
|
383
|
+
name: m.value,
|
|
384
|
+
checked: t === T(y)
|
|
385
|
+
}, null, 8, Je), c("span", Ye, w(e.label), 1)]))), 128))], 8, qe)) : o("", !0),
|
|
386
|
+
e.copy ? (v(), s(t, { key: 3 }, [u(L, {
|
|
387
|
+
class: "plinth-code-block-copy",
|
|
388
|
+
variant: "ghost",
|
|
389
|
+
size: "sm",
|
|
390
|
+
hidden: !C.value,
|
|
391
|
+
onClick: A
|
|
392
|
+
}, {
|
|
393
|
+
default: j(() => [l(w(E.value ? e.copiedLabel : e.copyLabel), 1)]),
|
|
394
|
+
_: 1
|
|
395
|
+
}, 8, ["hidden"]), c("span", Xe, w(E.value ? e.copiedLabel : ""), 1)], 64)) : o("", !0)
|
|
396
|
+
]), h.value.length ? (v(!0), s(t, { key: 0 }, x(h.value, (e, n) => (v(), s(t, { key: n }, [e.html === void 0 ? (v(), s("pre", $e, [c("code", null, w(e.code), 1)])) : (v(), s("pre", Ze, [c("code", { innerHTML: e.html }, null, 8, Qe)]))], 64))), 128)) : e.html === void 0 ? (v(), s("pre", nt, [c("code", null, [S(n.$slots, "default")])])) : (v(), s("pre", et, [c("code", { innerHTML: e.html }, null, 8, tt)]))], 8, Ue));
|
|
397
|
+
}
|
|
398
|
+
}), H = [
|
|
399
|
+
"simple",
|
|
400
|
+
"type",
|
|
401
|
+
"password"
|
|
402
|
+
];
|
|
403
|
+
function U(e) {
|
|
404
|
+
return H.includes(e) ? e : "simple";
|
|
405
|
+
}
|
|
406
|
+
var rt = ["neutral", "danger"];
|
|
407
|
+
function it(e) {
|
|
408
|
+
return rt.includes(e) ? e : "neutral";
|
|
409
|
+
}
|
|
410
|
+
var at = {
|
|
411
|
+
type: "Type :phrase to confirm",
|
|
412
|
+
password: "Password"
|
|
413
|
+
}, ot = (e) => e.replace(/[\\^$.*+?()[\]{}|/]/g, "\\$&"), st = [
|
|
414
|
+
"start",
|
|
415
|
+
"end",
|
|
416
|
+
"top",
|
|
417
|
+
"bottom"
|
|
418
|
+
];
|
|
419
|
+
function ct(e) {
|
|
420
|
+
return W(e) ?? "end";
|
|
421
|
+
}
|
|
422
|
+
function W(e) {
|
|
423
|
+
return st.includes(e) ? e : void 0;
|
|
424
|
+
}
|
|
425
|
+
var G = "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6 6l12 12M18 6L6 18\"></path></svg>", lt = ["center", "bottom"];
|
|
426
|
+
function K(e) {
|
|
427
|
+
return lt.includes(e) ? e : "center";
|
|
428
|
+
}
|
|
429
|
+
var ut = G, dt = [
|
|
430
|
+
"id",
|
|
431
|
+
"data-side-phone",
|
|
432
|
+
"aria-labelledby",
|
|
433
|
+
"aria-describedby"
|
|
434
|
+
], ft = {
|
|
435
|
+
method: "dialog",
|
|
436
|
+
class: "plinth-confirm-dialog-form"
|
|
437
|
+
}, pt = { class: "plinth-dialog-header" }, mt = ["id"], ht = { class: "plinth-dialog-body" }, gt = ["id"], _t = {
|
|
438
|
+
key: 0,
|
|
439
|
+
class: "plinth-confirm-dialog-field"
|
|
440
|
+
}, vt = ["for"], yt = { key: 0 }, bt = [
|
|
441
|
+
"id",
|
|
442
|
+
"pattern",
|
|
443
|
+
"aria-invalid",
|
|
444
|
+
"aria-describedby"
|
|
445
|
+
], xt = [
|
|
446
|
+
"id",
|
|
447
|
+
"aria-invalid",
|
|
448
|
+
"aria-describedby"
|
|
449
|
+
], St = ["id"], Ct = { class: "plinth-dialog-footer" }, wt = /* @__PURE__ */ d({
|
|
450
|
+
__name: "PlinthConfirmDialog",
|
|
451
|
+
props: {
|
|
452
|
+
id: { default: void 0 },
|
|
453
|
+
title: {},
|
|
454
|
+
message: {},
|
|
455
|
+
kind: { default: "simple" },
|
|
456
|
+
phrase: { default: void 0 },
|
|
457
|
+
fieldLabel: { default: void 0 },
|
|
458
|
+
confirmLabel: { default: "Confirm" },
|
|
459
|
+
cancelLabel: { default: "Cancel" },
|
|
460
|
+
tone: { default: "neutral" },
|
|
461
|
+
error: { default: void 0 },
|
|
462
|
+
busy: {
|
|
463
|
+
type: Boolean,
|
|
464
|
+
default: !1
|
|
465
|
+
},
|
|
466
|
+
sidePhone: { default: "center" }
|
|
467
|
+
},
|
|
468
|
+
emits: ["close"],
|
|
469
|
+
setup(e, { expose: n, emit: r }) {
|
|
470
|
+
let a = e, d = r;
|
|
471
|
+
if (!a.title?.trim()) throw Error("<PlinthConfirmDialog> needs a title: it is the dialog's accessible name.");
|
|
472
|
+
if (!a.message?.trim()) throw Error("<PlinthConfirmDialog> needs a message: it is the dialog's accessible description.");
|
|
473
|
+
let f = i(() => U(a.kind));
|
|
474
|
+
if (f.value === "type" && !a.phrase?.trim()) throw Error("<PlinthConfirmDialog kind=\"type\"> needs a phrase: it is what the person types.");
|
|
475
|
+
let p = D(), m = i(() => a.id?.trim() || `plinth-confirm-dialog-${p}`), h = i(() => K(a.sidePhone)), g = i(() => a.phrase?.trim() ?? ""), _ = i(() => f.value !== "simple" && !!a.error?.trim()), y = i(() => {
|
|
476
|
+
let e = a.fieldLabel?.trim() || at[f.value];
|
|
477
|
+
return f.value === "type" ? e.split(":phrase") : [e];
|
|
478
|
+
}), S = b();
|
|
479
|
+
return n({
|
|
480
|
+
showModal: () => S.value?.showModal(),
|
|
481
|
+
close: (e) => S.value?.close(e)
|
|
482
|
+
}), (n, r) => (v(), s("dialog", {
|
|
483
|
+
id: m.value,
|
|
484
|
+
ref_key: "dialog",
|
|
485
|
+
ref: S,
|
|
486
|
+
class: "plinth-dialog plinth-confirm-dialog",
|
|
487
|
+
role: "alertdialog",
|
|
488
|
+
"data-side-phone": h.value === "center" ? void 0 : h.value,
|
|
489
|
+
closedby: "closerequest",
|
|
490
|
+
"aria-labelledby": `${m.value}-title`,
|
|
491
|
+
"aria-describedby": `${m.value}-message`,
|
|
492
|
+
onClose: r[0] ||= (e) => d("close", e)
|
|
493
|
+
}, [c("form", ft, [
|
|
494
|
+
c("div", pt, [c("h2", {
|
|
495
|
+
id: `${m.value}-title`,
|
|
496
|
+
class: "plinth-dialog-title"
|
|
497
|
+
}, w(e.title), 9, mt)]),
|
|
498
|
+
c("div", ht, [
|
|
499
|
+
c("p", {
|
|
500
|
+
id: `${m.value}-message`,
|
|
501
|
+
class: "plinth-confirm-dialog-message"
|
|
502
|
+
}, w(e.message), 9, gt),
|
|
503
|
+
f.value === "simple" ? o("", !0) : (v(), s("div", _t, [c("label", {
|
|
504
|
+
for: `${m.value}-field`,
|
|
505
|
+
class: "plinth-confirm-dialog-label"
|
|
506
|
+
}, [(v(!0), s(t, null, x(y.value, (e, n) => (v(), s(t, { key: n }, [n > 0 ? (v(), s("strong", yt, w(g.value), 1)) : o("", !0), l(w(e), 1)], 64))), 128))], 8, vt), f.value === "type" ? (v(), s("input", {
|
|
507
|
+
key: 0,
|
|
508
|
+
id: `${m.value}-field`,
|
|
509
|
+
class: "plinth-confirm-dialog-input",
|
|
510
|
+
type: "text",
|
|
511
|
+
name: "confirmation",
|
|
512
|
+
required: "",
|
|
513
|
+
pattern: T(ot)(g.value),
|
|
514
|
+
autocomplete: "off",
|
|
515
|
+
autocapitalize: "none",
|
|
516
|
+
spellcheck: "false",
|
|
517
|
+
"aria-invalid": _.value ? "true" : void 0,
|
|
518
|
+
"aria-describedby": _.value ? `${m.value}-error` : void 0
|
|
519
|
+
}, null, 8, bt)) : (v(), s("input", {
|
|
520
|
+
key: 1,
|
|
521
|
+
id: `${m.value}-field`,
|
|
522
|
+
class: "plinth-confirm-dialog-input",
|
|
523
|
+
type: "password",
|
|
524
|
+
name: "password",
|
|
525
|
+
required: "",
|
|
526
|
+
autocomplete: "current-password",
|
|
527
|
+
"aria-invalid": _.value ? "true" : void 0,
|
|
528
|
+
"aria-describedby": _.value ? `${m.value}-error` : void 0
|
|
529
|
+
}, null, 8, xt))])),
|
|
530
|
+
_.value ? (v(), s("p", {
|
|
531
|
+
key: 1,
|
|
532
|
+
id: `${m.value}-error`,
|
|
533
|
+
class: "plinth-confirm-dialog-error",
|
|
534
|
+
role: "alert"
|
|
535
|
+
}, w(e.error), 9, St)) : o("", !0)
|
|
536
|
+
]),
|
|
537
|
+
c("div", Ct, [u(L, {
|
|
538
|
+
variant: "secondary",
|
|
539
|
+
commandfor: m.value,
|
|
540
|
+
command: "close",
|
|
541
|
+
value: "cancel"
|
|
542
|
+
}, {
|
|
543
|
+
default: j(() => [l(w(e.cancelLabel), 1)]),
|
|
544
|
+
_: 1
|
|
545
|
+
}, 8, ["commandfor"]), u(L, {
|
|
546
|
+
class: "plinth-confirm-dialog-confirm",
|
|
547
|
+
type: "submit",
|
|
548
|
+
value: "confirm",
|
|
549
|
+
variant: T(it)(e.tone) === "danger" ? "danger" : "primary",
|
|
550
|
+
busy: e.busy
|
|
551
|
+
}, {
|
|
552
|
+
default: j(() => [l(w(e.confirmLabel), 1)]),
|
|
553
|
+
_: 1
|
|
554
|
+
}, 8, ["variant", "busy"])])
|
|
555
|
+
])], 40, dt));
|
|
556
|
+
}
|
|
557
|
+
}), Tt = {
|
|
558
|
+
class: "plinth-data-table",
|
|
559
|
+
role: "table"
|
|
560
|
+
}, Et = {
|
|
561
|
+
key: 0,
|
|
562
|
+
class: "plinth-data-table-caption"
|
|
563
|
+
}, Dt = {
|
|
564
|
+
class: "plinth-data-table-head",
|
|
565
|
+
role: "rowgroup"
|
|
566
|
+
}, Ot = {
|
|
567
|
+
class: "plinth-data-table-head-row",
|
|
568
|
+
role: "row"
|
|
569
|
+
}, kt = {
|
|
570
|
+
class: "plinth-data-table-body",
|
|
571
|
+
role: "rowgroup"
|
|
572
|
+
}, At = /* @__PURE__ */ d({
|
|
573
|
+
__name: "PlinthDataTable",
|
|
574
|
+
props: { caption: { default: void 0 } },
|
|
575
|
+
setup(e) {
|
|
576
|
+
return (t, n) => (v(), s("table", Tt, [
|
|
577
|
+
e.caption?.trim() ? (v(), s("caption", Et, w(e.caption), 1)) : o("", !0),
|
|
578
|
+
c("thead", Dt, [c("tr", Ot, [S(t.$slots, "head")])]),
|
|
579
|
+
c("tbody", kt, [S(t.$slots, "default")])
|
|
580
|
+
]));
|
|
581
|
+
}
|
|
582
|
+
}), jt = [
|
|
583
|
+
"none",
|
|
584
|
+
"ascending",
|
|
585
|
+
"descending"
|
|
586
|
+
];
|
|
587
|
+
function Mt(e) {
|
|
588
|
+
return jt.includes(e) ? e : "none";
|
|
589
|
+
}
|
|
590
|
+
var Nt = [
|
|
591
|
+
"field",
|
|
592
|
+
"title",
|
|
593
|
+
"actions"
|
|
594
|
+
];
|
|
595
|
+
function Pt(e) {
|
|
596
|
+
return Nt.includes(e) ? e : "field";
|
|
597
|
+
}
|
|
598
|
+
var Ft = "<span class=\"plinth-icon plinth-data-table-sort-icon\" data-size=\"sm\" aria-hidden=\"true\"><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path class=\"plinth-data-table-sort-up\" d=\"M8 9l4-4 4 4\"></path><path class=\"plinth-data-table-sort-down\" d=\"M8 15l4 4 4-4\"></path></svg></span>", It = [
|
|
599
|
+
"data-kind",
|
|
600
|
+
"data-numeric",
|
|
601
|
+
"data-phone"
|
|
602
|
+
], Lt = {
|
|
603
|
+
key: 0,
|
|
604
|
+
class: "plinth-data-table-label",
|
|
605
|
+
"aria-hidden": "true"
|
|
606
|
+
}, Rt = { class: "plinth-data-table-value" }, zt = /* @__PURE__ */ d({
|
|
607
|
+
__name: "PlinthDataTableCell",
|
|
608
|
+
props: {
|
|
609
|
+
label: { default: void 0 },
|
|
610
|
+
kind: { default: "field" },
|
|
611
|
+
numeric: {
|
|
612
|
+
type: Boolean,
|
|
613
|
+
default: !1
|
|
614
|
+
},
|
|
615
|
+
hideOnPhone: {
|
|
616
|
+
type: Boolean,
|
|
617
|
+
default: !1
|
|
618
|
+
}
|
|
619
|
+
},
|
|
620
|
+
setup(e) {
|
|
621
|
+
let t = e, n = i(() => Pt(t.kind));
|
|
622
|
+
return (t, r) => (v(), s("td", {
|
|
623
|
+
class: "plinth-data-table-cell",
|
|
624
|
+
role: "cell",
|
|
625
|
+
"data-kind": n.value,
|
|
626
|
+
"data-numeric": e.numeric ? "" : void 0,
|
|
627
|
+
"data-phone": e.hideOnPhone ? "hidden" : void 0
|
|
628
|
+
}, [e.label?.trim() ? (v(), s("span", Lt, w(e.label), 1)) : o("", !0), c("span", Rt, [S(t.$slots, "default")])], 8, It));
|
|
629
|
+
}
|
|
630
|
+
}), Bt = [
|
|
631
|
+
"aria-sort",
|
|
632
|
+
"data-numeric",
|
|
633
|
+
"data-phone"
|
|
634
|
+
], Vt = /* @__PURE__ */ d({
|
|
635
|
+
__name: "PlinthDataTableColumn",
|
|
636
|
+
props: {
|
|
637
|
+
sort: { default: void 0 },
|
|
638
|
+
numeric: {
|
|
639
|
+
type: Boolean,
|
|
640
|
+
default: !1
|
|
641
|
+
},
|
|
642
|
+
hideOnPhone: {
|
|
643
|
+
type: Boolean,
|
|
644
|
+
default: !1
|
|
645
|
+
}
|
|
646
|
+
},
|
|
647
|
+
setup(e) {
|
|
648
|
+
let t = e, n = i(() => t.sort?.trim() ? Mt(t.sort) : void 0);
|
|
649
|
+
return (t, r) => (v(), s("th", {
|
|
650
|
+
class: "plinth-data-table-column",
|
|
651
|
+
role: "columnheader",
|
|
652
|
+
scope: "col",
|
|
653
|
+
"aria-sort": n.value,
|
|
654
|
+
"data-numeric": e.numeric ? "" : void 0,
|
|
655
|
+
"data-phone": e.hideOnPhone ? "hidden" : void 0
|
|
656
|
+
}, [S(t.$slots, "default")], 8, Bt));
|
|
657
|
+
}
|
|
658
|
+
}), Ht = {
|
|
659
|
+
class: "plinth-data-table-empty",
|
|
660
|
+
role: "row"
|
|
661
|
+
}, Ut = ["colspan"], Wt = /* @__PURE__ */ d({
|
|
662
|
+
__name: "PlinthDataTableEmpty",
|
|
663
|
+
props: { columns: { default: 1 } },
|
|
664
|
+
setup(e) {
|
|
665
|
+
let t = e, n = /^\s*[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?\s*$/, r = i(() => {
|
|
666
|
+
let e = typeof t.columns == "number" ? t.columns : String(t.columns), r = typeof e == "number" || n.test(e) ? Number(e) : NaN;
|
|
667
|
+
return Number.isFinite(r) ? Math.max(1, Math.trunc(r)) : 1;
|
|
668
|
+
});
|
|
669
|
+
return (e, t) => (v(), s("tr", Ht, [c("td", {
|
|
670
|
+
class: "plinth-data-table-empty-cell",
|
|
671
|
+
role: "cell",
|
|
672
|
+
colspan: r.value
|
|
673
|
+
}, [S(e.$slots, "default")], 8, Ut)]));
|
|
674
|
+
}
|
|
675
|
+
}), Gt = ["aria-selected"], Kt = /* @__PURE__ */ d({
|
|
676
|
+
__name: "PlinthDataTableRow",
|
|
677
|
+
props: { selected: {
|
|
678
|
+
type: Boolean,
|
|
679
|
+
default: void 0
|
|
680
|
+
} },
|
|
681
|
+
setup(e) {
|
|
682
|
+
return (t, n) => (v(), s("tr", {
|
|
683
|
+
class: "plinth-data-table-row",
|
|
684
|
+
role: "row",
|
|
685
|
+
"aria-selected": e.selected === void 0 ? void 0 : e.selected ? "true" : "false"
|
|
686
|
+
}, [S(t.$slots, "default")], 8, Gt));
|
|
687
|
+
}
|
|
688
|
+
}), qt = {
|
|
689
|
+
type: "button",
|
|
690
|
+
class: "plinth-data-table-sort"
|
|
691
|
+
}, Jt = { class: "plinth-data-table-sort-label" }, Yt = /* @__PURE__ */ d({
|
|
692
|
+
__name: "PlinthDataTableSort",
|
|
693
|
+
setup(e) {
|
|
694
|
+
return (e, t) => (v(), s("button", qt, [c("span", Jt, [S(e.$slots, "default")]), t[0] ||= c("span", {
|
|
695
|
+
class: "plinth-icon plinth-data-table-sort-icon",
|
|
696
|
+
"data-size": "sm",
|
|
697
|
+
"aria-hidden": "true"
|
|
698
|
+
}, [c("svg", {
|
|
699
|
+
viewBox: "0 0 24 24",
|
|
700
|
+
fill: "none",
|
|
701
|
+
stroke: "currentColor",
|
|
702
|
+
"stroke-width": "2",
|
|
703
|
+
"stroke-linecap": "round",
|
|
704
|
+
"stroke-linejoin": "round"
|
|
705
|
+
}, [c("path", {
|
|
706
|
+
class: "plinth-data-table-sort-up",
|
|
707
|
+
d: "M8 9l4-4 4 4"
|
|
708
|
+
}), c("path", {
|
|
709
|
+
class: "plinth-data-table-sort-down",
|
|
710
|
+
d: "M8 15l4 4 4-4"
|
|
711
|
+
})])], -1)]));
|
|
712
|
+
}
|
|
713
|
+
}), Xt = [
|
|
714
|
+
"href",
|
|
715
|
+
"data-variant",
|
|
716
|
+
"data-size",
|
|
717
|
+
"aria-label",
|
|
718
|
+
"role",
|
|
719
|
+
"aria-busy",
|
|
720
|
+
"aria-disabled"
|
|
721
|
+
], Zt = {
|
|
722
|
+
key: 0,
|
|
723
|
+
class: "plinth-button-spinner",
|
|
724
|
+
"aria-hidden": "true"
|
|
725
|
+
}, Qt = ["data-size", "data-mirror"], $t = [
|
|
726
|
+
"data-variant",
|
|
727
|
+
"data-size",
|
|
728
|
+
"aria-label",
|
|
729
|
+
"aria-pressed",
|
|
730
|
+
"disabled",
|
|
731
|
+
"aria-busy",
|
|
732
|
+
"aria-disabled"
|
|
733
|
+
], en = {
|
|
734
|
+
key: 0,
|
|
735
|
+
class: "plinth-button-spinner",
|
|
736
|
+
"aria-hidden": "true"
|
|
737
|
+
}, tn = ["data-size", "data-mirror"], q = /* @__PURE__ */ d({
|
|
738
|
+
inheritAttrs: !1,
|
|
739
|
+
__name: "PlinthIconButton",
|
|
740
|
+
props: {
|
|
741
|
+
label: {},
|
|
742
|
+
variant: { default: "ghost" },
|
|
743
|
+
size: { default: "md" },
|
|
744
|
+
href: { default: void 0 },
|
|
745
|
+
disabled: {
|
|
746
|
+
type: Boolean,
|
|
747
|
+
default: !1
|
|
748
|
+
},
|
|
749
|
+
busy: {
|
|
750
|
+
type: Boolean,
|
|
751
|
+
default: !1
|
|
752
|
+
},
|
|
753
|
+
pressed: {
|
|
754
|
+
type: [Boolean, null],
|
|
755
|
+
default: null
|
|
756
|
+
},
|
|
757
|
+
mirror: {
|
|
758
|
+
type: Boolean,
|
|
759
|
+
default: !1
|
|
760
|
+
}
|
|
761
|
+
},
|
|
762
|
+
setup(e) {
|
|
763
|
+
let t = e, n = E(), r = i(() => _e(t.variant)), a = i(() => N(t.size, M, "md")), o = i(() => P(a.value)), c = i(() => t.busy && !t.disabled), l = i(() => t.label || n["aria-label"]), u = i(() => Object.fromEntries(Object.entries(n).filter(([e]) => e !== "aria-label")));
|
|
764
|
+
return (t, n) => e.href ? (v(), s("a", m({
|
|
765
|
+
key: 0,
|
|
766
|
+
class: "plinth-button plinth-icon-button",
|
|
767
|
+
href: e.disabled ? void 0 : e.href,
|
|
768
|
+
"data-variant": r.value,
|
|
769
|
+
"data-size": a.value,
|
|
770
|
+
"aria-label": l.value,
|
|
771
|
+
role: e.disabled ? "link" : void 0,
|
|
772
|
+
"aria-busy": c.value ? "true" : void 0,
|
|
773
|
+
"aria-disabled": c.value || e.disabled ? "true" : void 0
|
|
774
|
+
}, u.value), [c.value ? (v(), s("span", Zt)) : (v(), s("span", {
|
|
775
|
+
key: 1,
|
|
776
|
+
class: "plinth-icon",
|
|
777
|
+
"data-size": o.value,
|
|
778
|
+
"data-mirror": e.mirror ? "" : void 0,
|
|
779
|
+
"aria-hidden": "true"
|
|
780
|
+
}, [S(t.$slots, "default")], 8, Qt))], 16, Xt)) : (v(), s("button", m({
|
|
781
|
+
key: 1,
|
|
782
|
+
type: "button",
|
|
783
|
+
class: "plinth-button plinth-icon-button",
|
|
784
|
+
"data-variant": r.value,
|
|
785
|
+
"data-size": a.value,
|
|
786
|
+
"aria-label": l.value,
|
|
787
|
+
"aria-pressed": e.pressed === null ? void 0 : e.pressed ? "true" : "false",
|
|
788
|
+
disabled: e.disabled || void 0,
|
|
789
|
+
"aria-busy": c.value ? "true" : void 0,
|
|
790
|
+
"aria-disabled": c.value ? "true" : void 0
|
|
791
|
+
}, u.value), [c.value ? (v(), s("span", en)) : (v(), s("span", {
|
|
792
|
+
key: 1,
|
|
793
|
+
class: "plinth-icon",
|
|
794
|
+
"data-size": o.value,
|
|
795
|
+
"data-mirror": e.mirror ? "" : void 0,
|
|
796
|
+
"aria-hidden": "true"
|
|
797
|
+
}, [S(t.$slots, "default")], 8, tn))], 16, $t));
|
|
798
|
+
}
|
|
799
|
+
});
|
|
800
|
+
//#endregion
|
|
801
|
+
//#region src/swipe.ts
|
|
802
|
+
function nn(e) {
|
|
803
|
+
let t = e.firstElementChild, n = () => getComputedStyle(e).scrollSnapType.startsWith("y"), r = () => {
|
|
804
|
+
e.requestClose ? e.requestClose() : e.close(), e.open && (e.scrollTop = 0);
|
|
805
|
+
}, i = () => {
|
|
806
|
+
let i = t.getBoundingClientRect().top >= e.getBoundingClientRect().bottom - 1;
|
|
807
|
+
e.open && n() && i && r();
|
|
808
|
+
}, a = (t) => {
|
|
809
|
+
t.target === e && n() && e.getAttribute("closedby") === "any" && r();
|
|
810
|
+
}, o = (r) => {
|
|
811
|
+
let [i, a] = t.children, o = {
|
|
812
|
+
peek: i,
|
|
813
|
+
half: a
|
|
814
|
+
}[e.dataset.snap ?? ""];
|
|
815
|
+
if (r.newState !== "open" || !o || !n()) return;
|
|
816
|
+
let s = parseFloat(getComputedStyle(o).scrollMarginBlockStart);
|
|
817
|
+
e.scrollTop += o.getBoundingClientRect().top - e.getBoundingClientRect().top - s;
|
|
818
|
+
}, s = "onscrollend" in window ? "scrollend" : "scroll";
|
|
819
|
+
return e.addEventListener(s, i), e.addEventListener("click", a), e.addEventListener("toggle", o), () => {
|
|
820
|
+
e.removeEventListener(s, i), e.removeEventListener("click", a), e.removeEventListener("toggle", o);
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
function J(e) {
|
|
824
|
+
let t;
|
|
825
|
+
_(() => {
|
|
826
|
+
t = e.value ? nn(e.value) : void 0;
|
|
827
|
+
}), g(() => t?.());
|
|
828
|
+
}
|
|
829
|
+
//#endregion
|
|
830
|
+
//#region src/PlinthDialog.vue?vue&type=script&setup=true&lang.ts
|
|
831
|
+
var rn = [
|
|
832
|
+
"id",
|
|
833
|
+
"role",
|
|
834
|
+
"data-side-phone",
|
|
835
|
+
"closedby",
|
|
836
|
+
"aria-labelledby",
|
|
837
|
+
"aria-describedby"
|
|
838
|
+
], an = { class: "plinth-dialog-panel" }, on = {
|
|
839
|
+
key: 0,
|
|
840
|
+
class: "plinth-dialog-handle",
|
|
841
|
+
"aria-hidden": "true"
|
|
842
|
+
}, sn = { class: "plinth-dialog-header" }, cn = ["id"], ln = ["id"], un = { class: "plinth-dialog-body" }, dn = {
|
|
843
|
+
key: 1,
|
|
844
|
+
class: "plinth-dialog-footer"
|
|
845
|
+
}, fn = /* @__PURE__ */ d({
|
|
846
|
+
__name: "PlinthDialog",
|
|
847
|
+
props: {
|
|
848
|
+
id: { default: void 0 },
|
|
849
|
+
title: {},
|
|
850
|
+
description: { default: void 0 },
|
|
851
|
+
closeLabel: { default: "Close" },
|
|
852
|
+
dismissible: {
|
|
853
|
+
type: Boolean,
|
|
854
|
+
default: !0
|
|
855
|
+
},
|
|
856
|
+
sidePhone: { default: "center" }
|
|
857
|
+
},
|
|
858
|
+
emits: ["close"],
|
|
859
|
+
setup(e, { expose: t, emit: n }) {
|
|
860
|
+
let r = e, l = n;
|
|
861
|
+
if (!r.title?.trim()) throw Error("<PlinthDialog> needs a title: it is the dialog's accessible name.");
|
|
862
|
+
let u = k(), d = D(), f = i(() => r.id?.trim() || `plinth-dialog-${d}`), p = i(() => K(r.sidePhone)), m = i(() => !!r.description?.trim()), h = b();
|
|
863
|
+
return J(h), t({
|
|
864
|
+
showModal: () => h.value?.showModal(),
|
|
865
|
+
close: () => h.value?.close()
|
|
866
|
+
}), (t, n) => (v(), s("dialog", {
|
|
867
|
+
id: f.value,
|
|
868
|
+
ref_key: "dialog",
|
|
869
|
+
ref: h,
|
|
870
|
+
class: "plinth-dialog",
|
|
871
|
+
role: e.dismissible ? void 0 : "alertdialog",
|
|
872
|
+
"data-side-phone": p.value === "center" ? void 0 : p.value,
|
|
873
|
+
closedby: e.dismissible ? "any" : "closerequest",
|
|
874
|
+
"aria-labelledby": `${f.value}-title`,
|
|
875
|
+
"aria-describedby": m.value ? `${f.value}-description` : void 0,
|
|
876
|
+
onClose: n[0] ||= (e) => l("close", e)
|
|
877
|
+
}, [c("div", an, [
|
|
878
|
+
e.dismissible && p.value === "bottom" ? (v(), s("div", on)) : o("", !0),
|
|
879
|
+
c("div", sn, [
|
|
880
|
+
c("h2", {
|
|
881
|
+
id: `${f.value}-title`,
|
|
882
|
+
class: "plinth-dialog-title"
|
|
883
|
+
}, w(e.title), 9, cn),
|
|
884
|
+
m.value ? (v(), s("p", {
|
|
885
|
+
key: 0,
|
|
886
|
+
id: `${f.value}-description`,
|
|
887
|
+
class: "plinth-dialog-description"
|
|
888
|
+
}, w(e.description), 9, ln)) : o("", !0),
|
|
889
|
+
e.dismissible ? (v(), a(q, {
|
|
890
|
+
key: 1,
|
|
891
|
+
class: "plinth-dialog-close",
|
|
892
|
+
label: e.closeLabel,
|
|
893
|
+
variant: "ghost",
|
|
894
|
+
commandfor: f.value,
|
|
895
|
+
command: "close"
|
|
896
|
+
}, {
|
|
897
|
+
default: j(() => [...n[1] ||= [c("svg", {
|
|
898
|
+
viewBox: "0 0 24 24",
|
|
899
|
+
fill: "none",
|
|
900
|
+
stroke: "currentColor",
|
|
901
|
+
"stroke-width": "2",
|
|
902
|
+
"stroke-linecap": "round",
|
|
903
|
+
"stroke-linejoin": "round"
|
|
904
|
+
}, [c("path", { d: "M6 6l12 12M18 6L6 18" })], -1)]]),
|
|
905
|
+
_: 1
|
|
906
|
+
}, 8, ["label", "commandfor"])) : o("", !0)
|
|
907
|
+
]),
|
|
908
|
+
c("div", un, [S(t.$slots, "default")]),
|
|
909
|
+
T(z)(T(u).footer?.()) ? (v(), s("div", dn, [S(t.$slots, "footer")])) : o("", !0)
|
|
910
|
+
])], 40, rn));
|
|
911
|
+
}
|
|
912
|
+
}), pn = ["dialog", "sheet"];
|
|
913
|
+
function mn(e) {
|
|
914
|
+
return pn.includes(e) ? e : "dialog";
|
|
915
|
+
}
|
|
916
|
+
var hn = [
|
|
917
|
+
"peek",
|
|
918
|
+
"half",
|
|
919
|
+
"full"
|
|
920
|
+
];
|
|
921
|
+
function gn(e) {
|
|
922
|
+
let t = typeof e == "string" ? e.split(/\s+/) : e ?? [];
|
|
923
|
+
return hn.filter((e) => t.includes(e));
|
|
924
|
+
}
|
|
925
|
+
function _n(e, t) {
|
|
926
|
+
return t.includes(e) ? e : t.at(-1);
|
|
927
|
+
}
|
|
928
|
+
var vn = G, yn = [
|
|
929
|
+
"id",
|
|
930
|
+
"data-desktop",
|
|
931
|
+
"data-snap-points",
|
|
932
|
+
"data-snap",
|
|
933
|
+
"aria-labelledby",
|
|
934
|
+
"aria-describedby"
|
|
935
|
+
], bn = { class: "plinth-drawer-panel" }, xn = { class: "plinth-drawer-header" }, Sn = ["id"], Cn = ["id"], wn = { class: "plinth-drawer-body" }, Tn = {
|
|
936
|
+
key: 0,
|
|
937
|
+
class: "plinth-drawer-footer"
|
|
938
|
+
}, En = /* @__PURE__ */ d({
|
|
939
|
+
__name: "PlinthDrawer",
|
|
940
|
+
props: {
|
|
941
|
+
id: { default: void 0 },
|
|
942
|
+
title: {},
|
|
943
|
+
description: { default: void 0 },
|
|
944
|
+
closeLabel: { default: "Close" },
|
|
945
|
+
desktop: { default: "dialog" },
|
|
946
|
+
snapPoints: { default: void 0 },
|
|
947
|
+
snap: { default: void 0 }
|
|
948
|
+
},
|
|
949
|
+
emits: ["close"],
|
|
950
|
+
setup(e, { expose: t, emit: n }) {
|
|
951
|
+
let r = e, a = n;
|
|
952
|
+
if (!r.title?.trim()) throw Error("<PlinthDrawer> needs a title: it is the drawer's accessible name.");
|
|
953
|
+
let l = k(), d = D(), f = i(() => r.id?.trim() || `plinth-drawer-${d}`), p = i(() => gn(r.snapPoints)), m = i(() => !!r.description?.trim()), h = b();
|
|
954
|
+
return J(h), t({
|
|
955
|
+
showModal: () => h.value?.showModal(),
|
|
956
|
+
close: () => h.value?.close()
|
|
957
|
+
}), (t, n) => (v(), s("dialog", {
|
|
958
|
+
id: f.value,
|
|
959
|
+
ref_key: "dialog",
|
|
960
|
+
ref: h,
|
|
961
|
+
class: "plinth-drawer",
|
|
962
|
+
"data-desktop": T(mn)(e.desktop),
|
|
963
|
+
"data-snap-points": p.value.length ? p.value.join(" ") : void 0,
|
|
964
|
+
"data-snap": T(_n)(e.snap, p.value),
|
|
965
|
+
closedby: "any",
|
|
966
|
+
"aria-labelledby": `${f.value}-title`,
|
|
967
|
+
"aria-describedby": m.value ? `${f.value}-description` : void 0,
|
|
968
|
+
onClose: n[0] ||= (e) => a("close", e)
|
|
969
|
+
}, [c("div", bn, [
|
|
970
|
+
n[2] ||= c("div", {
|
|
971
|
+
class: "plinth-drawer-handle",
|
|
972
|
+
"aria-hidden": "true"
|
|
973
|
+
}, null, -1),
|
|
974
|
+
c("div", xn, [
|
|
975
|
+
c("h2", {
|
|
976
|
+
id: `${f.value}-title`,
|
|
977
|
+
class: "plinth-drawer-title"
|
|
978
|
+
}, w(e.title), 9, Sn),
|
|
979
|
+
m.value ? (v(), s("p", {
|
|
980
|
+
key: 0,
|
|
981
|
+
id: `${f.value}-description`,
|
|
982
|
+
class: "plinth-drawer-description"
|
|
983
|
+
}, w(e.description), 9, Cn)) : o("", !0),
|
|
984
|
+
u(q, {
|
|
985
|
+
class: "plinth-drawer-close",
|
|
986
|
+
label: e.closeLabel,
|
|
987
|
+
variant: "ghost",
|
|
988
|
+
commandfor: f.value,
|
|
989
|
+
command: "close"
|
|
990
|
+
}, {
|
|
991
|
+
default: j(() => [...n[1] ||= [c("svg", {
|
|
992
|
+
viewBox: "0 0 24 24",
|
|
993
|
+
fill: "none",
|
|
994
|
+
stroke: "currentColor",
|
|
995
|
+
"stroke-width": "2",
|
|
996
|
+
"stroke-linecap": "round",
|
|
997
|
+
"stroke-linejoin": "round"
|
|
998
|
+
}, [c("path", { d: "M6 6l12 12M18 6L6 18" })], -1)]]),
|
|
999
|
+
_: 1
|
|
1000
|
+
}, 8, ["label", "commandfor"])
|
|
1001
|
+
]),
|
|
1002
|
+
c("div", wn, [S(t.$slots, "default")]),
|
|
1003
|
+
T(z)(T(l).footer?.()) ? (v(), s("div", Tn, [S(t.$slots, "footer")])) : o("", !0)
|
|
1004
|
+
])], 40, yn));
|
|
1005
|
+
}
|
|
1006
|
+
}), Dn = [
|
|
1007
|
+
"sm",
|
|
1008
|
+
"md",
|
|
1009
|
+
"lg"
|
|
1010
|
+
];
|
|
1011
|
+
function On(e) {
|
|
1012
|
+
return N(e, Dn, "md");
|
|
1013
|
+
}
|
|
1014
|
+
//#endregion
|
|
1015
|
+
//#region src/PlinthIcon.vue?vue&type=script&setup=true&lang.ts
|
|
1016
|
+
var kn = [
|
|
1017
|
+
"data-size",
|
|
1018
|
+
"data-mirror",
|
|
1019
|
+
"role",
|
|
1020
|
+
"aria-label",
|
|
1021
|
+
"aria-hidden"
|
|
1022
|
+
], An = /* @__PURE__ */ d({
|
|
1023
|
+
inheritAttrs: !1,
|
|
1024
|
+
__name: "PlinthIcon",
|
|
1025
|
+
props: {
|
|
1026
|
+
size: { default: "md" },
|
|
1027
|
+
label: { default: void 0 },
|
|
1028
|
+
mirror: {
|
|
1029
|
+
type: Boolean,
|
|
1030
|
+
default: !1
|
|
1031
|
+
}
|
|
1032
|
+
},
|
|
1033
|
+
setup(e) {
|
|
1034
|
+
let t = e, n = E(), r = i(() => On(t.size)), a = i(() => {
|
|
1035
|
+
let e = t.label ?? n["aria-label"];
|
|
1036
|
+
return e?.trim() ? e : void 0;
|
|
1037
|
+
}), o = i(() => Object.fromEntries(Object.entries(n).filter(([e]) => e !== "aria-label")));
|
|
1038
|
+
return (t, n) => (v(), s("span", m({
|
|
1039
|
+
class: "plinth-icon",
|
|
1040
|
+
"data-size": r.value,
|
|
1041
|
+
"data-mirror": e.mirror ? "" : void 0,
|
|
1042
|
+
role: a.value ? "img" : void 0,
|
|
1043
|
+
"aria-label": a.value,
|
|
1044
|
+
"aria-hidden": a.value ? void 0 : "true"
|
|
1045
|
+
}, o.value), [S(t.$slots, "default")], 16, kn));
|
|
1046
|
+
}
|
|
1047
|
+
}), jn = [
|
|
1048
|
+
"h2",
|
|
1049
|
+
"h3",
|
|
1050
|
+
"h4",
|
|
1051
|
+
"h5",
|
|
1052
|
+
"h6"
|
|
1053
|
+
];
|
|
1054
|
+
function Mn(e) {
|
|
1055
|
+
return jn.includes(e) ? e : "h2";
|
|
1056
|
+
}
|
|
1057
|
+
//#endregion
|
|
1058
|
+
//#region src/PlinthListCard.vue?vue&type=script&setup=true&lang.ts
|
|
1059
|
+
var Nn = { class: "plinth-list-card" }, Pn = {
|
|
1060
|
+
class: "plinth-list-card-list",
|
|
1061
|
+
role: "list"
|
|
1062
|
+
}, Fn = {
|
|
1063
|
+
key: 1,
|
|
1064
|
+
class: "plinth-list-card-footer"
|
|
1065
|
+
}, In = /* @__PURE__ */ d({
|
|
1066
|
+
__name: "PlinthListCard",
|
|
1067
|
+
props: {
|
|
1068
|
+
heading: { default: void 0 },
|
|
1069
|
+
headingLevel: { default: "h2" },
|
|
1070
|
+
footer: { default: void 0 }
|
|
1071
|
+
},
|
|
1072
|
+
setup(e) {
|
|
1073
|
+
let t = e, n = i(() => Mn(t.headingLevel));
|
|
1074
|
+
return (t, r) => (v(), s("div", Nn, [
|
|
1075
|
+
e.heading?.trim() ? (v(), a(C(n.value), {
|
|
1076
|
+
key: 0,
|
|
1077
|
+
class: "plinth-list-card-heading"
|
|
1078
|
+
}, {
|
|
1079
|
+
default: j(() => [l(w(e.heading), 1)]),
|
|
1080
|
+
_: 1
|
|
1081
|
+
})) : o("", !0),
|
|
1082
|
+
c("ul", Pn, [S(t.$slots, "default")]),
|
|
1083
|
+
e.footer?.trim() ? (v(), s("p", Fn, w(e.footer), 1)) : o("", !0)
|
|
1084
|
+
]));
|
|
1085
|
+
}
|
|
1086
|
+
}), Ln = {
|
|
1087
|
+
key: 0,
|
|
1088
|
+
class: "plinth-list-row-leading"
|
|
1089
|
+
}, Rn = { class: "plinth-list-row-content" }, zn = { class: "plinth-list-row-title" }, Bn = {
|
|
1090
|
+
key: 0,
|
|
1091
|
+
class: "plinth-list-row-description"
|
|
1092
|
+
}, Vn = {
|
|
1093
|
+
key: 1,
|
|
1094
|
+
class: "plinth-list-row-trailing"
|
|
1095
|
+
}, Hn = {
|
|
1096
|
+
key: 0,
|
|
1097
|
+
class: "plinth-icon plinth-list-row-chevron",
|
|
1098
|
+
"data-size": "sm",
|
|
1099
|
+
"data-mirror": "",
|
|
1100
|
+
"aria-hidden": "true"
|
|
1101
|
+
}, Y = /* @__PURE__ */ d({
|
|
1102
|
+
__name: "PlinthListRow",
|
|
1103
|
+
props: {
|
|
1104
|
+
description: { default: void 0 },
|
|
1105
|
+
chevron: {
|
|
1106
|
+
type: Boolean,
|
|
1107
|
+
default: !1
|
|
1108
|
+
},
|
|
1109
|
+
href: { default: void 0 },
|
|
1110
|
+
button: {
|
|
1111
|
+
type: Boolean,
|
|
1112
|
+
default: !1
|
|
1113
|
+
},
|
|
1114
|
+
current: {
|
|
1115
|
+
type: Boolean,
|
|
1116
|
+
default: !1
|
|
1117
|
+
},
|
|
1118
|
+
disabled: {
|
|
1119
|
+
type: Boolean,
|
|
1120
|
+
default: !1
|
|
1121
|
+
}
|
|
1122
|
+
},
|
|
1123
|
+
setup(e) {
|
|
1124
|
+
let t = e, n = i(() => t.href ? "a" : t.button ? "button" : "div");
|
|
1125
|
+
return (t, r) => (v(), a(C(n.value), {
|
|
1126
|
+
class: "plinth-list-row",
|
|
1127
|
+
type: n.value === "button" ? "button" : void 0,
|
|
1128
|
+
href: n.value === "a" && !e.disabled ? e.href : void 0,
|
|
1129
|
+
"aria-current": e.current && n.value !== "button" ? "page" : void 0,
|
|
1130
|
+
disabled: n.value === "button" && e.disabled ? !0 : void 0,
|
|
1131
|
+
role: n.value === "a" && e.disabled ? "link" : void 0,
|
|
1132
|
+
"aria-disabled": n.value === "a" && e.disabled ? "true" : void 0
|
|
1133
|
+
}, {
|
|
1134
|
+
default: j(() => [
|
|
1135
|
+
t.$slots.leading ? (v(), s("span", Ln, [S(t.$slots, "leading")])) : o("", !0),
|
|
1136
|
+
c("span", Rn, [c("span", zn, [S(t.$slots, "default")]), e.description ? (v(), s("span", Bn, w(e.description), 1)) : o("", !0)]),
|
|
1137
|
+
t.$slots.trailing || e.chevron ? (v(), s("span", Vn, [S(t.$slots, "trailing"), e.chevron ? (v(), s("span", Hn, [...r[0] ||= [c("svg", {
|
|
1138
|
+
viewBox: "0 0 24 24",
|
|
1139
|
+
fill: "none",
|
|
1140
|
+
stroke: "currentColor",
|
|
1141
|
+
"stroke-width": "2",
|
|
1142
|
+
"stroke-linecap": "round",
|
|
1143
|
+
"stroke-linejoin": "round"
|
|
1144
|
+
}, [c("path", { d: "M9 6l6 6-6 6" })], -1)]])) : o("", !0)])) : o("", !0)
|
|
1145
|
+
]),
|
|
1146
|
+
_: 3
|
|
1147
|
+
}, 8, [
|
|
1148
|
+
"type",
|
|
1149
|
+
"href",
|
|
1150
|
+
"aria-current",
|
|
1151
|
+
"disabled",
|
|
1152
|
+
"role",
|
|
1153
|
+
"aria-disabled"
|
|
1154
|
+
]));
|
|
1155
|
+
}
|
|
1156
|
+
}), Un = ["neutral", "danger"];
|
|
1157
|
+
function Wn(e) {
|
|
1158
|
+
return Un.includes(e) ? e : "neutral";
|
|
1159
|
+
}
|
|
1160
|
+
var X = Symbol("plinth-menu-id"), Gn = ["id"], Kn = /* @__PURE__ */ d({
|
|
1161
|
+
__name: "PlinthMenu",
|
|
1162
|
+
props: { id: {} },
|
|
1163
|
+
setup(e, { expose: t }) {
|
|
1164
|
+
let n = e;
|
|
1165
|
+
if (!n.id?.trim()) throw Error("<PlinthMenu> needs an id: its button names it in popovertarget.");
|
|
1166
|
+
let r = i(() => n.id.trim());
|
|
1167
|
+
y(X, r);
|
|
1168
|
+
let a = b();
|
|
1169
|
+
return t({
|
|
1170
|
+
showPopover: (e) => a.value?.showPopover(e),
|
|
1171
|
+
hidePopover: () => a.value?.hidePopover()
|
|
1172
|
+
}), (e, t) => (v(), s("div", {
|
|
1173
|
+
id: r.value,
|
|
1174
|
+
ref_key: "menu",
|
|
1175
|
+
ref: a,
|
|
1176
|
+
class: "plinth-menu",
|
|
1177
|
+
popover: "auto"
|
|
1178
|
+
}, [S(e.$slots, "default")], 8, Gn));
|
|
1179
|
+
}
|
|
1180
|
+
}), qn = ["aria-label"], Jn = {
|
|
1181
|
+
key: 0,
|
|
1182
|
+
class: "plinth-menu-heading",
|
|
1183
|
+
"aria-hidden": "true"
|
|
1184
|
+
}, Yn = /* @__PURE__ */ d({
|
|
1185
|
+
__name: "PlinthMenuGroup",
|
|
1186
|
+
props: { label: {} },
|
|
1187
|
+
setup(e) {
|
|
1188
|
+
return (t, n) => (v(), s("div", {
|
|
1189
|
+
class: "plinth-menu-group",
|
|
1190
|
+
role: "group",
|
|
1191
|
+
"aria-label": e.label?.trim() ? e.label : void 0
|
|
1192
|
+
}, [e.label?.trim() ? (v(), s("div", Jn, w(e.label), 1)) : o("", !0), S(t.$slots, "default")], 8, qn));
|
|
1193
|
+
}
|
|
1194
|
+
}), Xn = {
|
|
1195
|
+
key: 0,
|
|
1196
|
+
class: "plinth-menu-icon",
|
|
1197
|
+
"aria-hidden": "true"
|
|
1198
|
+
}, Zn = { class: "plinth-menu-label" }, Qn = {
|
|
1199
|
+
key: 1,
|
|
1200
|
+
class: "plinth-menu-shortcut",
|
|
1201
|
+
"aria-hidden": "true"
|
|
1202
|
+
}, $n = /* @__PURE__ */ d({
|
|
1203
|
+
__name: "PlinthMenuItem",
|
|
1204
|
+
props: {
|
|
1205
|
+
href: { default: void 0 },
|
|
1206
|
+
tone: { default: "neutral" },
|
|
1207
|
+
shortcut: { default: void 0 },
|
|
1208
|
+
disabled: {
|
|
1209
|
+
type: Boolean,
|
|
1210
|
+
default: !1
|
|
1211
|
+
},
|
|
1212
|
+
menu: { default: void 0 }
|
|
1213
|
+
},
|
|
1214
|
+
setup(e) {
|
|
1215
|
+
let t = e, n = k(), r = f(X, void 0), l = i(() => t.href?.trim() ? "a" : "button"), u = i(() => l.value === "button" ? t.menu?.trim() || r?.value : void 0), d = i(() => Wn(t.tone));
|
|
1216
|
+
return (t, r) => (v(), a(C(l.value), {
|
|
1217
|
+
class: "plinth-menu-item",
|
|
1218
|
+
type: l.value === "button" ? "button" : void 0,
|
|
1219
|
+
href: l.value === "a" && !e.disabled ? e.href : void 0,
|
|
1220
|
+
commandfor: u.value || void 0,
|
|
1221
|
+
command: u.value ? "hide-popover" : void 0,
|
|
1222
|
+
"data-tone": d.value === "danger" ? "danger" : void 0,
|
|
1223
|
+
disabled: l.value === "button" && e.disabled ? !0 : void 0,
|
|
1224
|
+
role: l.value === "a" && e.disabled ? "link" : void 0,
|
|
1225
|
+
"aria-disabled": l.value === "a" && e.disabled ? "true" : void 0
|
|
1226
|
+
}, {
|
|
1227
|
+
default: j(() => [
|
|
1228
|
+
T(z)(T(n).icon?.()) ? (v(), s("span", Xn, [S(t.$slots, "icon")])) : o("", !0),
|
|
1229
|
+
c("span", Zn, [S(t.$slots, "default")]),
|
|
1230
|
+
e.shortcut?.trim() ? (v(), s("kbd", Qn, w(e.shortcut), 1)) : o("", !0)
|
|
1231
|
+
]),
|
|
1232
|
+
_: 3
|
|
1233
|
+
}, 8, [
|
|
1234
|
+
"type",
|
|
1235
|
+
"href",
|
|
1236
|
+
"commandfor",
|
|
1237
|
+
"command",
|
|
1238
|
+
"data-tone",
|
|
1239
|
+
"disabled",
|
|
1240
|
+
"role",
|
|
1241
|
+
"aria-disabled"
|
|
1242
|
+
]));
|
|
1243
|
+
}
|
|
1244
|
+
}), er = { class: "plinth-menu-separator" }, tr = /* @__PURE__ */ d({
|
|
1245
|
+
__name: "PlinthMenuSeparator",
|
|
1246
|
+
setup(e) {
|
|
1247
|
+
return (e, t) => (v(), s("hr", er));
|
|
1248
|
+
}
|
|
1249
|
+
}), nr = [
|
|
1250
|
+
"id",
|
|
1251
|
+
"data-side",
|
|
1252
|
+
"data-side-phone",
|
|
1253
|
+
"aria-labelledby",
|
|
1254
|
+
"aria-describedby"
|
|
1255
|
+
], rr = { class: "plinth-sheet-panel" }, ir = {
|
|
1256
|
+
key: 0,
|
|
1257
|
+
class: "plinth-sheet-handle",
|
|
1258
|
+
"aria-hidden": "true"
|
|
1259
|
+
}, ar = { class: "plinth-sheet-header" }, or = ["id"], sr = ["id"], cr = { class: "plinth-sheet-body" }, lr = {
|
|
1260
|
+
key: 1,
|
|
1261
|
+
class: "plinth-sheet-footer"
|
|
1262
|
+
}, Z = /* @__PURE__ */ d({
|
|
1263
|
+
__name: "PlinthSheet",
|
|
1264
|
+
props: {
|
|
1265
|
+
id: { default: void 0 },
|
|
1266
|
+
title: {},
|
|
1267
|
+
description: { default: void 0 },
|
|
1268
|
+
closeLabel: { default: "Close" },
|
|
1269
|
+
side: { default: "end" },
|
|
1270
|
+
sidePhone: { default: void 0 }
|
|
1271
|
+
},
|
|
1272
|
+
emits: ["close"],
|
|
1273
|
+
setup(e, { expose: t, emit: n }) {
|
|
1274
|
+
let r = e, a = n;
|
|
1275
|
+
if (!r.title?.trim()) throw Error("<PlinthSheet> needs a title: it is the sheet's accessible name.");
|
|
1276
|
+
let l = k(), d = D(), f = i(() => r.id?.trim() || `plinth-sheet-${d}`), p = i(() => ct(r.side)), m = i(() => W(r.sidePhone)), h = i(() => !!r.description?.trim()), g = b(), _ = i(() => (m.value ?? p.value) === "bottom");
|
|
1277
|
+
return J(g), t({
|
|
1278
|
+
showModal: () => g.value?.showModal(),
|
|
1279
|
+
close: () => g.value?.close()
|
|
1280
|
+
}), (t, n) => (v(), s("dialog", {
|
|
1281
|
+
id: f.value,
|
|
1282
|
+
ref_key: "dialog",
|
|
1283
|
+
ref: g,
|
|
1284
|
+
class: "plinth-sheet",
|
|
1285
|
+
"data-side": p.value,
|
|
1286
|
+
"data-side-phone": m.value,
|
|
1287
|
+
closedby: "any",
|
|
1288
|
+
"aria-labelledby": `${f.value}-title`,
|
|
1289
|
+
"aria-describedby": h.value ? `${f.value}-description` : void 0,
|
|
1290
|
+
onClose: n[0] ||= (e) => a("close", e)
|
|
1291
|
+
}, [c("div", rr, [
|
|
1292
|
+
_.value ? (v(), s("div", ir)) : o("", !0),
|
|
1293
|
+
c("div", ar, [
|
|
1294
|
+
c("h2", {
|
|
1295
|
+
id: `${f.value}-title`,
|
|
1296
|
+
class: "plinth-sheet-title"
|
|
1297
|
+
}, w(e.title), 9, or),
|
|
1298
|
+
h.value ? (v(), s("p", {
|
|
1299
|
+
key: 0,
|
|
1300
|
+
id: `${f.value}-description`,
|
|
1301
|
+
class: "plinth-sheet-description"
|
|
1302
|
+
}, w(e.description), 9, sr)) : o("", !0),
|
|
1303
|
+
u(q, {
|
|
1304
|
+
class: "plinth-sheet-close",
|
|
1305
|
+
label: e.closeLabel,
|
|
1306
|
+
variant: "ghost",
|
|
1307
|
+
commandfor: f.value,
|
|
1308
|
+
command: "close"
|
|
1309
|
+
}, {
|
|
1310
|
+
default: j(() => [...n[1] ||= [c("svg", {
|
|
1311
|
+
viewBox: "0 0 24 24",
|
|
1312
|
+
fill: "none",
|
|
1313
|
+
stroke: "currentColor",
|
|
1314
|
+
"stroke-width": "2",
|
|
1315
|
+
"stroke-linecap": "round",
|
|
1316
|
+
"stroke-linejoin": "round"
|
|
1317
|
+
}, [c("path", { d: "M6 6l12 12M18 6L6 18" })], -1)]]),
|
|
1318
|
+
_: 1
|
|
1319
|
+
}, 8, ["label", "commandfor"])
|
|
1320
|
+
]),
|
|
1321
|
+
c("div", cr, [S(t.$slots, "default")]),
|
|
1322
|
+
T(z)(T(l).footer?.()) ? (v(), s("div", lr, [S(t.$slots, "footer")])) : o("", !0)
|
|
1323
|
+
])], 40, nr));
|
|
1324
|
+
}
|
|
1325
|
+
}), ur = ["aria-labelledby"], dr = {
|
|
1326
|
+
key: 1,
|
|
1327
|
+
class: "plinth-menu-sheet-account"
|
|
1328
|
+
}, fr = /* @__PURE__ */ d({
|
|
1329
|
+
__name: "PlinthMenuSheet",
|
|
1330
|
+
props: {
|
|
1331
|
+
id: { default: void 0 },
|
|
1332
|
+
title: { default: "Menu" },
|
|
1333
|
+
closeLabel: { default: "Close" },
|
|
1334
|
+
userName: { default: void 0 },
|
|
1335
|
+
userDetail: { default: void 0 },
|
|
1336
|
+
userSrc: { default: void 0 },
|
|
1337
|
+
userHref: { default: void 0 }
|
|
1338
|
+
},
|
|
1339
|
+
emits: ["close"],
|
|
1340
|
+
setup(e, { expose: t, emit: n }) {
|
|
1341
|
+
let r = e, d = n, f = k(), p = D(), m = i(() => r.id?.trim() || `plinth-menu-sheet-${p}`), h = i(() => !!r.userName?.trim()), g = i(() => r.userHref?.trim() ? r.userHref : void 0), _ = i(() => r.userSrc?.trim() ? r.userSrc : void 0), y = i(() => r.userDetail?.trim() ? r.userDetail : void 0), x = b();
|
|
1342
|
+
return t({
|
|
1343
|
+
showModal: () => x.value?.showModal(),
|
|
1344
|
+
close: () => x.value?.close()
|
|
1345
|
+
}), (t, n) => (v(), a(Z, {
|
|
1346
|
+
id: m.value,
|
|
1347
|
+
ref_key: "sheet",
|
|
1348
|
+
ref: x,
|
|
1349
|
+
class: "plinth-menu-sheet",
|
|
1350
|
+
title: e.title,
|
|
1351
|
+
"close-label": e.closeLabel,
|
|
1352
|
+
side: "end",
|
|
1353
|
+
"side-phone": "bottom",
|
|
1354
|
+
onClose: n[0] ||= (e) => d("close", e)
|
|
1355
|
+
}, {
|
|
1356
|
+
default: j(() => [
|
|
1357
|
+
h.value ? (v(), a(Y, {
|
|
1358
|
+
key: 0,
|
|
1359
|
+
class: "plinth-menu-sheet-user",
|
|
1360
|
+
description: y.value,
|
|
1361
|
+
href: g.value,
|
|
1362
|
+
chevron: !!g.value
|
|
1363
|
+
}, {
|
|
1364
|
+
leading: j(() => [u(I, {
|
|
1365
|
+
name: e.userName,
|
|
1366
|
+
src: _.value,
|
|
1367
|
+
size: "lg",
|
|
1368
|
+
decorative: ""
|
|
1369
|
+
}, null, 8, ["name", "src"])]),
|
|
1370
|
+
default: j(() => [l(w(e.userName), 1)]),
|
|
1371
|
+
_: 1
|
|
1372
|
+
}, 8, [
|
|
1373
|
+
"description",
|
|
1374
|
+
"href",
|
|
1375
|
+
"chevron"
|
|
1376
|
+
])) : o("", !0),
|
|
1377
|
+
c("nav", {
|
|
1378
|
+
class: "plinth-menu-sheet-nav",
|
|
1379
|
+
"aria-labelledby": `${m.value}-title`
|
|
1380
|
+
}, [S(t.$slots, "default")], 8, ur),
|
|
1381
|
+
T(z)(T(f).account?.()) ? (v(), s("div", dr, [S(t.$slots, "account")])) : o("", !0)
|
|
1382
|
+
]),
|
|
1383
|
+
_: 3
|
|
1384
|
+
}, 8, [
|
|
1385
|
+
"id",
|
|
1386
|
+
"title",
|
|
1387
|
+
"close-label"
|
|
1388
|
+
]));
|
|
1389
|
+
}
|
|
1390
|
+
}), pr = [
|
|
1391
|
+
"h1",
|
|
1392
|
+
"h2",
|
|
1393
|
+
"h3",
|
|
1394
|
+
"h4",
|
|
1395
|
+
"h5",
|
|
1396
|
+
"h6"
|
|
1397
|
+
];
|
|
1398
|
+
function Q(e) {
|
|
1399
|
+
return pr.includes(e) ? e : "h1";
|
|
1400
|
+
}
|
|
1401
|
+
//#endregion
|
|
1402
|
+
//#region src/PlinthPageHeader.vue?vue&type=script&setup=true&lang.ts
|
|
1403
|
+
var mr = ["data-top"], hr = {
|
|
1404
|
+
key: 0,
|
|
1405
|
+
class: "plinth-page-header-leading"
|
|
1406
|
+
}, gr = {
|
|
1407
|
+
key: 1,
|
|
1408
|
+
class: "plinth-page-header-actions"
|
|
1409
|
+
}, _r = /* @__PURE__ */ d({
|
|
1410
|
+
__name: "PlinthPageHeader",
|
|
1411
|
+
props: {
|
|
1412
|
+
heading: {},
|
|
1413
|
+
level: { default: "h1" },
|
|
1414
|
+
top: {
|
|
1415
|
+
type: Boolean,
|
|
1416
|
+
default: !1
|
|
1417
|
+
}
|
|
1418
|
+
},
|
|
1419
|
+
setup(e) {
|
|
1420
|
+
let t = e;
|
|
1421
|
+
if (!t.heading?.trim()) throw Error("<PlinthPageHeader> needs a heading: it is the page's heading.");
|
|
1422
|
+
let n = i(() => Q(t.level)), r = k();
|
|
1423
|
+
return (t, i) => (v(), s("header", {
|
|
1424
|
+
class: "plinth-page-header",
|
|
1425
|
+
"data-top": e.top ? "" : void 0
|
|
1426
|
+
}, [
|
|
1427
|
+
T(z)(T(r).leading?.()) ? (v(), s("div", hr, [S(t.$slots, "leading")])) : o("", !0),
|
|
1428
|
+
(v(), a(C(n.value), { class: "plinth-page-header-heading" }, {
|
|
1429
|
+
default: j(() => [l(w(e.heading), 1)]),
|
|
1430
|
+
_: 1
|
|
1431
|
+
})),
|
|
1432
|
+
T(z)(T(r).actions?.()) ? (v(), s("div", gr, [S(t.$slots, "actions")])) : o("", !0)
|
|
1433
|
+
], 8, mr));
|
|
1434
|
+
}
|
|
1435
|
+
}), vr = { class: "plinth-pill-label" }, yr = {
|
|
1436
|
+
key: 0,
|
|
1437
|
+
class: "plinth-pill-count"
|
|
1438
|
+
}, br = /* @__PURE__ */ d({
|
|
1439
|
+
__name: "PlinthPill",
|
|
1440
|
+
props: {
|
|
1441
|
+
count: { default: void 0 },
|
|
1442
|
+
href: { default: void 0 },
|
|
1443
|
+
selected: {
|
|
1444
|
+
type: Boolean,
|
|
1445
|
+
default: !1
|
|
1446
|
+
},
|
|
1447
|
+
disabled: {
|
|
1448
|
+
type: Boolean,
|
|
1449
|
+
default: !1
|
|
1450
|
+
}
|
|
1451
|
+
},
|
|
1452
|
+
setup(e) {
|
|
1453
|
+
let t = e, n = i(() => t.href ? "a" : "button"), r = i(() => t.count != null && String(t.count).trim() !== "");
|
|
1454
|
+
return (t, i) => (v(), a(C(n.value), {
|
|
1455
|
+
class: "plinth-pill",
|
|
1456
|
+
type: n.value === "button" ? "button" : void 0,
|
|
1457
|
+
href: n.value === "a" && !e.disabled ? e.href : void 0,
|
|
1458
|
+
"aria-pressed": n.value === "button" ? String(e.selected) : void 0,
|
|
1459
|
+
"aria-current": n.value === "a" && e.selected ? "page" : void 0,
|
|
1460
|
+
disabled: n.value === "button" && e.disabled ? !0 : void 0,
|
|
1461
|
+
role: n.value === "a" && e.disabled ? "link" : void 0,
|
|
1462
|
+
"aria-disabled": n.value === "a" && e.disabled ? "true" : void 0
|
|
1463
|
+
}, {
|
|
1464
|
+
default: j(() => [c("span", vr, [S(t.$slots, "default")]), r.value ? (v(), s("span", yr, w(e.count), 1)) : o("", !0)]),
|
|
1465
|
+
_: 3
|
|
1466
|
+
}, 8, [
|
|
1467
|
+
"type",
|
|
1468
|
+
"href",
|
|
1469
|
+
"aria-pressed",
|
|
1470
|
+
"aria-current",
|
|
1471
|
+
"disabled",
|
|
1472
|
+
"role",
|
|
1473
|
+
"aria-disabled"
|
|
1474
|
+
]));
|
|
1475
|
+
}
|
|
1476
|
+
}), xr = /* @__PURE__ */ d({
|
|
1477
|
+
__name: "PlinthPillRow",
|
|
1478
|
+
props: {
|
|
1479
|
+
label: { default: void 0 },
|
|
1480
|
+
nav: {
|
|
1481
|
+
type: Boolean,
|
|
1482
|
+
default: !1
|
|
1483
|
+
}
|
|
1484
|
+
},
|
|
1485
|
+
setup(e) {
|
|
1486
|
+
return (t, n) => (v(), a(C(e.nav ? "nav" : "div"), {
|
|
1487
|
+
class: "plinth-pill-row",
|
|
1488
|
+
role: e.nav ? void 0 : "group",
|
|
1489
|
+
"aria-label": e.label || void 0
|
|
1490
|
+
}, {
|
|
1491
|
+
default: j(() => [S(t.$slots, "default")]),
|
|
1492
|
+
_: 3
|
|
1493
|
+
}, 8, ["role", "aria-label"]));
|
|
1494
|
+
}
|
|
1495
|
+
}), Sr = /* @__PURE__ */ d({
|
|
1496
|
+
__name: "PlinthSectionMenu",
|
|
1497
|
+
props: {
|
|
1498
|
+
label: { default: void 0 },
|
|
1499
|
+
nav: {
|
|
1500
|
+
type: Boolean,
|
|
1501
|
+
default: !0
|
|
1502
|
+
}
|
|
1503
|
+
},
|
|
1504
|
+
setup(e) {
|
|
1505
|
+
return (t, n) => (v(), a(C(e.nav ? "nav" : "div"), {
|
|
1506
|
+
class: "plinth-section-menu",
|
|
1507
|
+
role: e.nav ? void 0 : "group",
|
|
1508
|
+
"aria-label": e.label?.trim() ? e.label : void 0
|
|
1509
|
+
}, {
|
|
1510
|
+
default: j(() => [S(t.$slots, "default")]),
|
|
1511
|
+
_: 3
|
|
1512
|
+
}, 8, ["role", "aria-label"]));
|
|
1513
|
+
}
|
|
1514
|
+
}), Cr = { class: "plinth-section-menu-label" }, wr = {
|
|
1515
|
+
key: 0,
|
|
1516
|
+
class: "plinth-section-menu-count"
|
|
1517
|
+
}, Tr = /* @__PURE__ */ d({
|
|
1518
|
+
__name: "PlinthSectionMenuItem",
|
|
1519
|
+
props: {
|
|
1520
|
+
count: { default: void 0 },
|
|
1521
|
+
href: { default: void 0 },
|
|
1522
|
+
current: {
|
|
1523
|
+
type: Boolean,
|
|
1524
|
+
default: !1
|
|
1525
|
+
},
|
|
1526
|
+
disabled: {
|
|
1527
|
+
type: Boolean,
|
|
1528
|
+
default: !1
|
|
1529
|
+
}
|
|
1530
|
+
},
|
|
1531
|
+
setup(e) {
|
|
1532
|
+
let t = e, n = i(() => t.href?.trim() ? "a" : "button"), r = i(() => t.count != null && String(t.count).trim() !== "");
|
|
1533
|
+
return (t, i) => (v(), a(C(n.value), {
|
|
1534
|
+
class: "plinth-section-menu-item",
|
|
1535
|
+
type: n.value === "button" ? "button" : void 0,
|
|
1536
|
+
href: n.value === "a" && !e.disabled ? e.href : void 0,
|
|
1537
|
+
"aria-pressed": n.value === "button" ? String(e.current) : void 0,
|
|
1538
|
+
"aria-current": n.value === "a" && e.current ? "page" : void 0,
|
|
1539
|
+
disabled: n.value === "button" && e.disabled ? !0 : void 0,
|
|
1540
|
+
role: n.value === "a" && e.disabled ? "link" : void 0,
|
|
1541
|
+
"aria-disabled": n.value === "a" && e.disabled ? "true" : void 0
|
|
1542
|
+
}, {
|
|
1543
|
+
default: j(() => [c("span", Cr, [S(t.$slots, "default")]), r.value ? (v(), s("span", wr, w(e.count), 1)) : o("", !0)]),
|
|
1544
|
+
_: 3
|
|
1545
|
+
}, 8, [
|
|
1546
|
+
"type",
|
|
1547
|
+
"href",
|
|
1548
|
+
"aria-pressed",
|
|
1549
|
+
"aria-current",
|
|
1550
|
+
"disabled",
|
|
1551
|
+
"role",
|
|
1552
|
+
"aria-disabled"
|
|
1553
|
+
]));
|
|
1554
|
+
}
|
|
1555
|
+
}), Er = ["sm", "md"];
|
|
1556
|
+
function Dr(e) {
|
|
1557
|
+
return N(e, Er, "md");
|
|
1558
|
+
}
|
|
1559
|
+
function $(e, t, n) {
|
|
1560
|
+
let r = [t?.trim() ? `${e}-description` : "", n?.trim() ? `${e}-error` : ""].filter(Boolean);
|
|
1561
|
+
return r.length ? r.join(" ") : void 0;
|
|
1562
|
+
}
|
|
1563
|
+
//#endregion
|
|
1564
|
+
//#region src/PlinthTextarea.vue?vue&type=script&setup=true&lang.ts
|
|
1565
|
+
var Or = ["data-label"], kr = ["for"], Ar = [
|
|
1566
|
+
"id",
|
|
1567
|
+
"rows",
|
|
1568
|
+
"data-grow",
|
|
1569
|
+
"value",
|
|
1570
|
+
"disabled",
|
|
1571
|
+
"readonly",
|
|
1572
|
+
"aria-describedby",
|
|
1573
|
+
"aria-invalid"
|
|
1574
|
+
], jr = ["id"], Mr = ["id"], Nr = /* @__PURE__ */ d({
|
|
1575
|
+
inheritAttrs: !1,
|
|
1576
|
+
__name: "PlinthTextarea",
|
|
1577
|
+
props: /*@__PURE__*/ p({
|
|
1578
|
+
label: {},
|
|
1579
|
+
hideLabel: {
|
|
1580
|
+
type: Boolean,
|
|
1581
|
+
default: !1
|
|
1582
|
+
},
|
|
1583
|
+
id: { default: void 0 },
|
|
1584
|
+
rows: { default: 3 },
|
|
1585
|
+
grow: {
|
|
1586
|
+
type: Boolean,
|
|
1587
|
+
default: !1
|
|
1588
|
+
},
|
|
1589
|
+
maxRows: { default: 8 },
|
|
1590
|
+
description: { default: void 0 },
|
|
1591
|
+
error: { default: void 0 },
|
|
1592
|
+
disabled: {
|
|
1593
|
+
type: Boolean,
|
|
1594
|
+
default: !1
|
|
1595
|
+
},
|
|
1596
|
+
readonly: {
|
|
1597
|
+
type: Boolean,
|
|
1598
|
+
default: !1
|
|
1599
|
+
}
|
|
1600
|
+
}, {
|
|
1601
|
+
modelValue: {},
|
|
1602
|
+
modelModifiers: {}
|
|
1603
|
+
}),
|
|
1604
|
+
emits: ["update:modelValue"],
|
|
1605
|
+
setup(e) {
|
|
1606
|
+
let t = e, n = O(e, "modelValue");
|
|
1607
|
+
if (!t.label?.trim()) throw Error("<PlinthTextarea> needs a label: it is the field's accessible name.");
|
|
1608
|
+
let r = E(), a = D(), l = i(() => t.id?.trim() || `plinth-textarea-${a}`), u = i(() => !!t.description?.trim()), d = i(() => !!t.error?.trim()), f = i(() => $(l.value, t.description, t.error)), p = i(() => m(t.grow ? { style: `--plinth-textarea-rows: ${t.rows}; --plinth-textarea-max-rows: ${Math.max(t.maxRows, t.rows)}` } : {}, Object.fromEntries(Object.entries(r).filter(([e]) => e !== "class"))));
|
|
1609
|
+
function g(e) {
|
|
1610
|
+
n.value = e.target.value;
|
|
1611
|
+
}
|
|
1612
|
+
return (t, i) => (v(), s("div", {
|
|
1613
|
+
class: h(["plinth-textarea", T(r).class]),
|
|
1614
|
+
"data-label": e.hideLabel ? "hidden" : void 0
|
|
1615
|
+
}, [
|
|
1616
|
+
c("label", {
|
|
1617
|
+
class: "plinth-textarea-label",
|
|
1618
|
+
for: l.value
|
|
1619
|
+
}, w(e.label), 9, kr),
|
|
1620
|
+
c("textarea", m({
|
|
1621
|
+
id: l.value,
|
|
1622
|
+
class: "plinth-textarea-input",
|
|
1623
|
+
rows: e.rows,
|
|
1624
|
+
"data-grow": e.grow ? "" : void 0,
|
|
1625
|
+
value: n.value,
|
|
1626
|
+
disabled: e.disabled || void 0,
|
|
1627
|
+
readonly: e.readonly || void 0,
|
|
1628
|
+
"aria-describedby": f.value,
|
|
1629
|
+
"aria-invalid": d.value ? "true" : void 0
|
|
1630
|
+
}, p.value, { onInput: g }), null, 16, Ar),
|
|
1631
|
+
u.value ? (v(), s("p", {
|
|
1632
|
+
key: 0,
|
|
1633
|
+
id: `${l.value}-description`,
|
|
1634
|
+
class: "plinth-textarea-description"
|
|
1635
|
+
}, w(e.description), 9, jr)) : o("", !0),
|
|
1636
|
+
d.value ? (v(), s("p", {
|
|
1637
|
+
key: 1,
|
|
1638
|
+
id: `${l.value}-error`,
|
|
1639
|
+
class: "plinth-textarea-error"
|
|
1640
|
+
}, w(e.error), 9, Mr)) : o("", !0)
|
|
1641
|
+
], 10, Or));
|
|
1642
|
+
}
|
|
1643
|
+
}), Pr = ["data-size", "data-label"], Fr = ["for"], Ir = { class: "plinth-text-field-control" }, Lr = {
|
|
1644
|
+
key: 0,
|
|
1645
|
+
class: "plinth-icon",
|
|
1646
|
+
"data-size": "sm",
|
|
1647
|
+
"aria-hidden": "true"
|
|
1648
|
+
}, Rr = [
|
|
1649
|
+
"id",
|
|
1650
|
+
"type",
|
|
1651
|
+
"value",
|
|
1652
|
+
"disabled",
|
|
1653
|
+
"readonly",
|
|
1654
|
+
"aria-describedby",
|
|
1655
|
+
"aria-invalid"
|
|
1656
|
+
], zr = {
|
|
1657
|
+
key: 1,
|
|
1658
|
+
class: "plinth-text-field-trailing"
|
|
1659
|
+
}, Br = ["id"], Vr = ["id"], Hr = /* @__PURE__ */ d({
|
|
1660
|
+
inheritAttrs: !1,
|
|
1661
|
+
__name: "PlinthTextField",
|
|
1662
|
+
props: /*@__PURE__*/ p({
|
|
1663
|
+
label: {},
|
|
1664
|
+
hideLabel: {
|
|
1665
|
+
type: Boolean,
|
|
1666
|
+
default: !1
|
|
1667
|
+
},
|
|
1668
|
+
id: { default: void 0 },
|
|
1669
|
+
type: { default: "text" },
|
|
1670
|
+
size: { default: "md" },
|
|
1671
|
+
description: { default: void 0 },
|
|
1672
|
+
error: { default: void 0 },
|
|
1673
|
+
disabled: {
|
|
1674
|
+
type: Boolean,
|
|
1675
|
+
default: !1
|
|
1676
|
+
},
|
|
1677
|
+
readonly: {
|
|
1678
|
+
type: Boolean,
|
|
1679
|
+
default: !1
|
|
1680
|
+
}
|
|
1681
|
+
}, {
|
|
1682
|
+
modelValue: {},
|
|
1683
|
+
modelModifiers: {}
|
|
1684
|
+
}),
|
|
1685
|
+
emits: ["update:modelValue"],
|
|
1686
|
+
setup(e) {
|
|
1687
|
+
let t = e, n = O(e, "modelValue");
|
|
1688
|
+
if (!t.label?.trim()) throw Error("<PlinthTextField> needs a label: it is the field's accessible name.");
|
|
1689
|
+
let r = E(), a = k(), l = D(), u = i(() => t.id?.trim() || `plinth-text-field-${l}`), d = i(() => Dr(t.size)), f = i(() => !!t.description?.trim()), p = i(() => !!t.error?.trim()), g = i(() => $(u.value, t.description, t.error)), _ = i(() => Object.fromEntries(Object.entries(r).filter(([e]) => e !== "class")));
|
|
1690
|
+
function y(e) {
|
|
1691
|
+
n.value = e.target.value;
|
|
1692
|
+
}
|
|
1693
|
+
return (t, i) => (v(), s("div", {
|
|
1694
|
+
class: h(["plinth-text-field", T(r).class]),
|
|
1695
|
+
"data-size": d.value,
|
|
1696
|
+
"data-label": e.hideLabel ? "hidden" : void 0
|
|
1697
|
+
}, [
|
|
1698
|
+
c("label", {
|
|
1699
|
+
class: "plinth-text-field-label",
|
|
1700
|
+
for: u.value
|
|
1701
|
+
}, w(e.label), 9, Fr),
|
|
1702
|
+
c("div", Ir, [
|
|
1703
|
+
T(z)(T(a).icon?.()) ? (v(), s("span", Lr, [S(t.$slots, "icon")])) : o("", !0),
|
|
1704
|
+
c("input", m({
|
|
1705
|
+
id: u.value,
|
|
1706
|
+
type: e.type,
|
|
1707
|
+
class: "plinth-text-field-input",
|
|
1708
|
+
value: n.value,
|
|
1709
|
+
disabled: e.disabled || void 0,
|
|
1710
|
+
readonly: e.readonly || void 0,
|
|
1711
|
+
"aria-describedby": g.value,
|
|
1712
|
+
"aria-invalid": p.value ? "true" : void 0
|
|
1713
|
+
}, _.value, { onInput: y }), null, 16, Rr),
|
|
1714
|
+
T(z)(T(a).trailing?.()) ? (v(), s("span", zr, [S(t.$slots, "trailing")])) : o("", !0)
|
|
1715
|
+
]),
|
|
1716
|
+
f.value ? (v(), s("p", {
|
|
1717
|
+
key: 0,
|
|
1718
|
+
id: `${u.value}-description`,
|
|
1719
|
+
class: "plinth-text-field-description"
|
|
1720
|
+
}, w(e.description), 9, Br)) : o("", !0),
|
|
1721
|
+
p.value ? (v(), s("p", {
|
|
1722
|
+
key: 1,
|
|
1723
|
+
id: `${u.value}-error`,
|
|
1724
|
+
class: "plinth-text-field-error"
|
|
1725
|
+
}, w(e.error), 9, Vr)) : o("", !0)
|
|
1726
|
+
], 10, Pr));
|
|
1727
|
+
}
|
|
1728
|
+
}), Ur = "<span class=\"plinth-icon plinth-list-row-chevron\" data-size=\"sm\" data-mirror aria-hidden=\"true\"><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M9 6l6 6-6 6\"></path></svg></span>", Wr = { install(e) {
|
|
1729
|
+
e.component("PlinthAvatar", I), e.component("PlinthBadge", he), e.component("PlinthButton", L), e.component("PlinthCallout", Be), e.component("PlinthCodeBlock", V), e.component("PlinthConfirmDialog", wt), e.component("PlinthDataTable", At), e.component("PlinthDataTableCell", zt), e.component("PlinthDataTableColumn", Vt), e.component("PlinthDataTableEmpty", Wt), e.component("PlinthDataTableRow", Kt), e.component("PlinthDataTableSort", Yt), e.component("PlinthDialog", fn), e.component("PlinthDrawer", En), e.component("PlinthIcon", An), e.component("PlinthIconButton", q), e.component("PlinthListCard", In), e.component("PlinthListRow", Y), e.component("PlinthMenu", Kn), e.component("PlinthMenuGroup", Yn), e.component("PlinthMenuItem", $n), e.component("PlinthMenuSeparator", tr), e.component("PlinthMenuSheet", fr), e.component("PlinthPageHeader", _r), e.component("PlinthPill", br), e.component("PlinthPillRow", xr), e.component("PlinthSectionMenu", Sr), e.component("PlinthSectionMenuItem", Tr), e.component("PlinthSheet", Z), e.component("PlinthTextarea", Nr), e.component("PlinthTextField", Hr);
|
|
1730
|
+
} };
|
|
1731
|
+
//#endregion
|
|
1732
|
+
export { Wr as Plinth, I as PlinthAvatar, he as PlinthBadge, L as PlinthButton, Be as PlinthCallout, V as PlinthCodeBlock, wt as PlinthConfirmDialog, At as PlinthDataTable, zt as PlinthDataTableCell, Vt as PlinthDataTableColumn, Wt as PlinthDataTableEmpty, Kt as PlinthDataTableRow, Yt as PlinthDataTableSort, fn as PlinthDialog, En as PlinthDrawer, An as PlinthIcon, q as PlinthIconButton, In as PlinthListCard, Y as PlinthListRow, Kn as PlinthMenu, Yn as PlinthMenuGroup, $n as PlinthMenuItem, tr as PlinthMenuSeparator, fr as PlinthMenuSheet, _r as PlinthPageHeader, br as PlinthPill, xr as PlinthPillRow, Sr as PlinthSectionMenu, Tr as PlinthSectionMenuItem, Z as PlinthSheet, Hr as PlinthTextField, Nr as PlinthTextarea, ae as avatarGlyph, ne as avatarSizes, ge as buttonVariants, Me as calloutIcons, je as calloutRole, Ae as calloutRoles, ke as calloutTone, Oe as calloutTones, at as confirmDialogFieldLabels, U as confirmDialogKind, H as confirmDialogKinds, ot as confirmDialogPattern, it as confirmDialogTone, rt as confirmDialogTones, M as controlSizes, Pt as dataTableCellKind, Nt as dataTableCellKinds, Mt as dataTableSort, Ft as dataTableSortIcon, jt as dataTableSorts, ut as dialogCloseIcon, K as dialogSidePhone, lt as dialogSidePhones, vn as drawerCloseIcon, mn as drawerDesktop, pn as drawerDesktops, _n as drawerSnap, gn as drawerSnapPoints, hn as drawerSnaps, $ as fieldDescribedBy, Mn as headingLevel, jn as headingLevels, P as iconSizeFor, Dn as iconSizes, ie as initialsFrom, Ur as listRowChevron, X as menuIdKey, Wn as menuItemTone, Un as menuItemTones, Q as pageHeaderLevel, pr as pageHeaderLevels, N as resolveSize, G as sheetCloseIcon, ct as sheetSide, W as sheetSidePhone, st as sheetSides, te as sizes, nn as swipeToClose, Dr as textFieldSize, Er as textFieldSizes, F as tones, J as useSwipeToClose };
|