blessing-ui 0.1.0 → 0.3.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/CHANGELOG.md +69 -0
- package/README.md +139 -105
- package/dist/blessing-ui.css +97 -1
- package/dist/components/BlessAnnotator.css +1 -0
- package/dist/components/BlessAnnotator.js +6 -0
- package/dist/components/BlessAnnotator.vue.d.ts +71 -0
- package/dist/components/BlessAnnotator.vue_vue_type_script_setup_true_lang.js +264 -0
- package/dist/components/BlessAttachment.vue.d.ts +4 -1
- package/dist/components/BlessAttachment.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/BlessCalendar.vue.d.ts +4 -0
- package/dist/components/BlessCalendar.vue_vue_type_script_setup_true_lang.js +65 -60
- package/dist/components/BlessCarousel.vue.d.ts +3 -0
- package/dist/components/BlessCarousel.vue_vue_type_script_setup_true_lang.js +10 -9
- package/dist/components/BlessCoachmark.css +1 -0
- package/dist/components/BlessCoachmark.js +6 -0
- package/dist/components/BlessCoachmark.vue.d.ts +40 -0
- package/dist/components/BlessCoachmark.vue_vue_type_script_setup_true_lang.js +74 -0
- package/dist/components/BlessCodeBlock.css +1 -0
- package/dist/components/BlessCodeBlock.js +6 -0
- package/dist/components/BlessCodeBlock.vue.d.ts +72 -0
- package/dist/components/BlessCodeBlock.vue_vue_type_script_setup_true_lang.js +140 -0
- package/dist/components/BlessCombobox.vue.d.ts +2 -0
- package/dist/components/BlessCombobox.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/BlessCommand.css +1 -1
- package/dist/components/BlessCommand.vue.d.ts +26 -0
- package/dist/components/BlessCommand.vue_vue_type_script_setup_true_lang.js +137 -70
- package/dist/components/BlessConfetti.css +1 -0
- package/dist/components/BlessConfetti.js +6 -0
- package/dist/components/BlessConfetti.vue.d.ts +40 -0
- package/dist/components/BlessConfetti.vue_vue_type_script_setup_true_lang.js +77 -0
- package/dist/components/BlessCountUp.css +1 -0
- package/dist/components/BlessCountUp.js +6 -0
- package/dist/components/BlessCountUp.vue.d.ts +18 -0
- package/dist/components/BlessCountUp.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/components/BlessCropper.css +1 -0
- package/dist/components/BlessCropper.js +6 -0
- package/dist/components/BlessCropper.vue.d.ts +70 -0
- package/dist/components/BlessCropper.vue_vue_type_script_setup_true_lang.js +220 -0
- package/dist/components/BlessDataTable.vue.d.ts +6 -0
- package/dist/components/BlessDataTable.vue_vue_type_script_setup_true_lang.js +56 -42
- package/dist/components/BlessDataView.vue.d.ts +7 -0
- package/dist/components/BlessDataView.vue_vue_type_script_setup_true_lang.js +38 -31
- package/dist/components/BlessDatePicker.vue.d.ts +3 -0
- package/dist/components/BlessDatePicker.vue_vue_type_script_setup_true_lang.js +46 -45
- package/dist/components/BlessDiff.css +1 -0
- package/dist/components/BlessDiff.js +6 -0
- package/dist/components/BlessDiff.vue.d.ts +22 -0
- package/dist/components/BlessDiff.vue_vue_type_script_setup_true_lang.js +148 -0
- package/dist/components/BlessDock.css +1 -0
- package/dist/components/BlessDock.js +6 -0
- package/dist/components/BlessDock.vue.d.ts +55 -0
- package/dist/components/BlessDock.vue_vue_type_script_setup_true_lang.js +100 -0
- package/dist/components/BlessEditor.vue.d.ts +2 -0
- package/dist/components/BlessEditor.vue_vue_type_script_setup_true_lang.js +23 -22
- package/dist/components/BlessFileInput.vue.d.ts +2 -0
- package/dist/components/BlessFileInput.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/BlessFormula.css +1 -0
- package/dist/components/BlessFormula.js +6 -0
- package/dist/components/BlessFormula.vue.d.ts +53 -0
- package/dist/components/BlessFormula.vue_vue_type_script_setup_true_lang.js +111 -0
- package/dist/components/BlessGantt.css +1 -0
- package/dist/components/BlessGantt.js +6 -0
- package/dist/components/BlessGantt.vue.d.ts +81 -0
- package/dist/components/BlessGantt.vue_vue_type_script_setup_true_lang.js +276 -0
- package/dist/components/BlessGauge.css +1 -0
- package/dist/components/BlessGauge.js +6 -0
- package/dist/components/BlessGauge.vue.d.ts +36 -0
- package/dist/components/BlessGauge.vue_vue_type_script_setup_true_lang.js +100 -0
- package/dist/components/BlessHeatmapCalendar.css +1 -0
- package/dist/components/BlessHeatmapCalendar.js +6 -0
- package/dist/components/BlessHeatmapCalendar.vue.d.ts +38 -0
- package/dist/components/BlessHeatmapCalendar.vue_vue_type_script_setup_true_lang.js +146 -0
- package/dist/components/BlessHotspots.css +1 -0
- package/dist/components/BlessHotspots.js +6 -0
- package/dist/components/BlessHotspots.vue.d.ts +49 -0
- package/dist/components/BlessHotspots.vue_vue_type_script_setup_true_lang.js +127 -0
- package/dist/components/BlessInfiniteCanvas.css +1 -0
- package/dist/components/BlessInfiniteCanvas.js +6 -0
- package/dist/components/BlessInfiniteCanvas.vue.d.ts +91 -0
- package/dist/components/BlessInfiniteCanvas.vue_vue_type_script_setup_true_lang.js +232 -0
- package/dist/components/BlessInputNumber.vue.d.ts +5 -0
- package/dist/components/BlessInputNumber.vue_vue_type_script_setup_true_lang.js +39 -34
- package/dist/components/BlessKanban.css +1 -0
- package/dist/components/BlessKanban.js +6 -0
- package/dist/components/BlessKanban.vue.d.ts +67 -0
- package/dist/components/BlessKanban.vue_vue_type_script_setup_true_lang.js +195 -0
- package/dist/components/BlessLoadingBar.vue.d.ts +2 -0
- package/dist/components/BlessLoadingBar.vue_vue_type_script_setup_true_lang.js +8 -3
- package/dist/components/BlessLoupe.css +1 -0
- package/dist/components/BlessLoupe.js +6 -0
- package/dist/components/BlessLoupe.vue.d.ts +16 -0
- package/dist/components/BlessLoupe.vue_vue_type_script_setup_true_lang.js +93 -0
- package/dist/components/BlessMarquee.css +1 -0
- package/dist/components/BlessMarquee.js +6 -0
- package/dist/components/BlessMarquee.vue.d.ts +44 -0
- package/dist/components/BlessMarquee.vue_vue_type_script_setup_true_lang.js +69 -0
- package/dist/components/BlessMasonry.css +1 -0
- package/dist/components/BlessMasonry.js +6 -0
- package/dist/components/BlessMasonry.vue.d.ts +33 -0
- package/dist/components/BlessMasonry.vue_vue_type_script_setup_true_lang.js +79 -0
- package/dist/components/BlessMention.css +1 -0
- package/dist/components/BlessMention.js +6 -0
- package/dist/components/BlessMention.vue.d.ts +32 -0
- package/dist/components/BlessMention.vue_vue_type_script_setup_true_lang.js +116 -0
- package/dist/components/BlessNodeGraph.css +1 -0
- package/dist/components/BlessNodeGraph.js +6 -0
- package/dist/components/BlessNodeGraph.vue.d.ts +110 -0
- package/dist/components/BlessNodeGraph.vue_vue_type_script_setup_true_lang.js +321 -0
- package/dist/components/BlessOnboardingChecklist.css +1 -0
- package/dist/components/BlessOnboardingChecklist.js +6 -0
- package/dist/components/BlessOnboardingChecklist.vue.d.ts +72 -0
- package/dist/components/BlessOnboardingChecklist.vue_vue_type_script_setup_true_lang.js +157 -0
- package/dist/components/BlessOrderList.vue.d.ts +5 -0
- package/dist/components/BlessOrderList.vue_vue_type_script_setup_true_lang.js +62 -56
- package/dist/components/BlessPagination.vue.d.ts +2 -0
- package/dist/components/BlessPagination.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/BlessPickList.vue.d.ts +5 -0
- package/dist/components/BlessPickList.vue_vue_type_script_setup_true_lang.js +55 -49
- package/dist/components/BlessRadialMenu.css +1 -0
- package/dist/components/BlessRadialMenu.js +6 -0
- package/dist/components/BlessRadialMenu.vue.d.ts +45 -0
- package/dist/components/BlessRadialMenu.vue_vue_type_script_setup_true_lang.js +146 -0
- package/dist/components/BlessRangeCalendar.css +1 -0
- package/dist/components/BlessRangeCalendar.js +6 -0
- package/dist/components/BlessRangeCalendar.vue.d.ts +51 -0
- package/dist/components/BlessRangeCalendar.vue_vue_type_script_setup_true_lang.js +217 -0
- package/dist/components/BlessScheduler.css +1 -0
- package/dist/components/BlessScheduler.js +6 -0
- package/dist/components/BlessScheduler.vue.d.ts +95 -0
- package/dist/components/BlessScheduler.vue_vue_type_script_setup_true_lang.js +347 -0
- package/dist/components/BlessShortcutRecorder.css +1 -0
- package/dist/components/BlessShortcutRecorder.js +6 -0
- package/dist/components/BlessShortcutRecorder.vue.d.ts +39 -0
- package/dist/components/BlessShortcutRecorder.vue_vue_type_script_setup_true_lang.js +126 -0
- package/dist/components/BlessSignaturePad.vue.d.ts +1 -1
- package/dist/components/BlessSliderCaptcha.css +1 -0
- package/dist/components/BlessSliderCaptcha.js +6 -0
- package/dist/components/BlessSliderCaptcha.vue.d.ts +38 -0
- package/dist/components/BlessSliderCaptcha.vue_vue_type_script_setup_true_lang.js +146 -0
- package/dist/components/BlessSortable.css +1 -0
- package/dist/components/BlessSortable.js +6 -0
- package/dist/components/BlessSortable.vue.d.ts +51 -0
- package/dist/components/BlessSortable.vue_vue_type_script_setup_true_lang.js +135 -0
- package/dist/components/BlessSparkline.css +1 -0
- package/dist/components/BlessSparkline.js +6 -0
- package/dist/components/BlessSparkline.vue.d.ts +28 -0
- package/dist/components/BlessSparkline.vue_vue_type_script_setup_true_lang.js +107 -0
- package/dist/components/BlessSplitView.css +1 -0
- package/dist/components/BlessSplitView.js +6 -0
- package/dist/components/BlessSplitView.vue.d.ts +61 -0
- package/dist/components/BlessSplitView.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/components/BlessSteps.vue.d.ts +2 -0
- package/dist/components/BlessSteps.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/BlessSwipeDeck.css +1 -0
- package/dist/components/BlessSwipeDeck.js +6 -0
- package/dist/components/BlessSwipeDeck.vue.d.ts +46 -0
- package/dist/components/BlessSwipeDeck.vue_vue_type_script_setup_true_lang.js +200 -0
- package/dist/components/BlessTimer.css +1 -0
- package/dist/components/BlessTimer.js +6 -0
- package/dist/components/BlessTimer.vue.d.ts +74 -0
- package/dist/components/BlessTimer.vue_vue_type_script_setup_true_lang.js +139 -0
- package/dist/components/BlessTour.vue.d.ts +1 -0
- package/dist/components/BlessTour.vue_vue_type_script_setup_true_lang.js +48 -42
- package/dist/components/BlessTreemap.css +1 -0
- package/dist/components/BlessTreemap.js +6 -0
- package/dist/components/BlessTreemap.vue.d.ts +46 -0
- package/dist/components/BlessTreemap.vue_vue_type_script_setup_true_lang.js +137 -0
- package/dist/components/BlessUploader.vue.d.ts +11 -0
- package/dist/components/BlessUploader.vue_vue_type_script_setup_true_lang.js +80 -69
- package/dist/composables/annotate.d.ts +35 -0
- package/dist/composables/annotate.js +33 -0
- package/dist/composables/canvasView.d.ts +21 -0
- package/dist/composables/canvasView.js +23 -0
- package/dist/composables/confetti.d.ts +32 -0
- package/dist/composables/confetti.js +23 -0
- package/dist/composables/cropBox.d.ts +22 -0
- package/dist/composables/cropBox.js +39 -0
- package/dist/composables/dayBlocks.d.ts +11 -0
- package/dist/composables/dayBlocks.js +26 -0
- package/dist/composables/diffLines.d.ts +10 -0
- package/dist/composables/diffLines.js +55 -0
- package/dist/composables/formula.d.ts +28 -0
- package/dist/composables/formula.js +161 -0
- package/dist/composables/graph.d.ts +19 -0
- package/dist/composables/graph.js +16 -0
- package/dist/composables/radial.d.ts +15 -0
- package/dist/composables/radial.js +22 -0
- package/dist/composables/schedule.d.ts +27 -0
- package/dist/composables/schedule.js +54 -0
- package/dist/composables/shortcut.d.ts +12 -0
- package/dist/composables/shortcut.js +35 -0
- package/dist/composables/treemap.d.ts +23 -0
- package/dist/composables/treemap.js +77 -0
- package/dist/composables/useAutoScroll.d.ts +15 -0
- package/dist/composables/useAutoScroll.js +32 -0
- package/dist/composables/useSortable.d.ts +58 -0
- package/dist/composables/useSortable.js +107 -0
- package/dist/index.d.ts +62 -1
- package/dist/index.js +93 -53
- package/package.json +22 -18
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import e from "./BlessButton.js";
|
|
2
|
+
import { boxFrom as t, isBox as n, moveRegion as r, nextId as i, resizeRegion as a } from "../composables/annotate.js";
|
|
3
|
+
import { Fragment as o, computed as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, mergeModels as m, nextTick as h, normalizeClass as g, normalizeStyle as _, openBlock as v, ref as y, renderList as b, toDisplayString as x, unref as S, useId as C, useModel as w, withCtx as T } from "vue";
|
|
4
|
+
//#region src/components/BlessAnnotator.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var E = { class: "bless-annot" }, D = ["aria-label"], O = ["aria-label"], k = ["src", "alt"], A = [
|
|
6
|
+
"data-region",
|
|
7
|
+
"aria-pressed",
|
|
8
|
+
"aria-label",
|
|
9
|
+
"tabindex",
|
|
10
|
+
"onPointerdown",
|
|
11
|
+
"onKeydown",
|
|
12
|
+
"onFocus"
|
|
13
|
+
], ee = {
|
|
14
|
+
class: "bless-annot__num",
|
|
15
|
+
"aria-hidden": "true"
|
|
16
|
+
}, te = ["onPointerdown"], ne = {
|
|
17
|
+
key: 1,
|
|
18
|
+
class: "bless-annot__edit"
|
|
19
|
+
}, re = { class: "bless-annot__field" }, ie = ["value"], ae = ["aria-label"], j = ["aria-pressed", "onClick"], M = {
|
|
20
|
+
class: "bless-annot__live",
|
|
21
|
+
"aria-live": "polite"
|
|
22
|
+
}, N = /*@__PURE__*/ p({
|
|
23
|
+
name: "BlessAnnotator",
|
|
24
|
+
__name: "BlessAnnotator",
|
|
25
|
+
props: /*@__PURE__*/ m({
|
|
26
|
+
src: {},
|
|
27
|
+
alt: { default: "" },
|
|
28
|
+
editable: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: !0
|
|
31
|
+
},
|
|
32
|
+
label: { default: "Annotated image" },
|
|
33
|
+
labels: {}
|
|
34
|
+
}, {
|
|
35
|
+
modelValue: { default: () => [] },
|
|
36
|
+
modelModifiers: {},
|
|
37
|
+
selected: { default: null },
|
|
38
|
+
selectedModifiers: {},
|
|
39
|
+
tool: { default: "box" },
|
|
40
|
+
toolModifiers: {}
|
|
41
|
+
}),
|
|
42
|
+
emits: [
|
|
43
|
+
"update:modelValue",
|
|
44
|
+
"update:selected",
|
|
45
|
+
"update:tool"
|
|
46
|
+
],
|
|
47
|
+
setup(p) {
|
|
48
|
+
let m = p, N = w(p, "modelValue"), P = w(p, "selected"), F = w(p, "tool"), I = s(() => ({
|
|
49
|
+
tools: "Tools",
|
|
50
|
+
select: "Select",
|
|
51
|
+
box: "Box",
|
|
52
|
+
pin: "Pin",
|
|
53
|
+
add: "Add at centre",
|
|
54
|
+
remove: "Remove",
|
|
55
|
+
name: "Name",
|
|
56
|
+
regions: "Marks",
|
|
57
|
+
regionName: (e, t, n) => `${e === "box" ? I.value.box : I.value.pin} ${t}${n ? `: ${n}` : ""}`,
|
|
58
|
+
added: (e) => `${e} added`,
|
|
59
|
+
removed: (e) => `${e} removed`,
|
|
60
|
+
moved: (e, t) => `${e}% across, ${t}% down`,
|
|
61
|
+
hint: "Arrow keys move the mark, Alt with arrows resizes a box, Delete removes it.",
|
|
62
|
+
...m.labels
|
|
63
|
+
})), L = `${C()}-hint`, R = y(), z = y(), B = y(""), V = (e) => I.value.regionName(n(e) ? "box" : "pin", N.value.indexOf(e) + 1, e.label), H = s(() => N.value.find((e) => e.id === P.value)), U = (e) => `${e * 100}%`, W = (e) => ({
|
|
64
|
+
left: U(e.x),
|
|
65
|
+
top: U(e.y),
|
|
66
|
+
...n(e) ? {
|
|
67
|
+
width: U(e.w),
|
|
68
|
+
height: U(e.h)
|
|
69
|
+
} : {}
|
|
70
|
+
}), G = (e) => {
|
|
71
|
+
let t = R.value.getBoundingClientRect();
|
|
72
|
+
return {
|
|
73
|
+
x: Math.min(1, Math.max(0, (e.clientX - t.left) / (t.width || 1))),
|
|
74
|
+
y: Math.min(1, Math.max(0, (e.clientY - t.top) / (t.height || 1)))
|
|
75
|
+
};
|
|
76
|
+
}, K = (e) => N.value = N.value.map((t) => t.id === e.id ? e : t);
|
|
77
|
+
function q(e) {
|
|
78
|
+
let t = {
|
|
79
|
+
id: i(N.value),
|
|
80
|
+
label: "",
|
|
81
|
+
...e
|
|
82
|
+
}, r = [...N.value, t];
|
|
83
|
+
N.value = r, P.value = t.id, B.value = I.value.added(I.value.regionName(n(t) ? "box" : "pin", r.length, "")), h(() => z.value?.focus());
|
|
84
|
+
}
|
|
85
|
+
function oe() {
|
|
86
|
+
F.value === "pin" ? q({
|
|
87
|
+
x: .5,
|
|
88
|
+
y: .5
|
|
89
|
+
}) : q({
|
|
90
|
+
x: .35,
|
|
91
|
+
y: .35,
|
|
92
|
+
w: .3,
|
|
93
|
+
h: .3
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function J(e) {
|
|
97
|
+
let t = V(e), n = N.value.indexOf(e), r = N.value.filter((t) => t !== e);
|
|
98
|
+
N.value = r, P.value = r[Math.min(n, r.length - 1)]?.id ?? null, B.value = I.value.removed(t), h(() => P.value ? Y(P.value) : R.value?.focus());
|
|
99
|
+
}
|
|
100
|
+
let Y = (e) => R.value?.querySelector(`[data-region="${CSS.escape(e)}"]`)?.focus(), X = null, Z = y(null);
|
|
101
|
+
function se(e) {
|
|
102
|
+
if (e.button || e.target.closest("[data-region]") || (P.value = null, !m.editable || F.value === "select")) return;
|
|
103
|
+
let n = G(e);
|
|
104
|
+
if (F.value === "pin") return q({
|
|
105
|
+
x: n.x,
|
|
106
|
+
y: n.y
|
|
107
|
+
});
|
|
108
|
+
R.value.setPointerCapture?.(e.pointerId), X = {
|
|
109
|
+
kind: "draw",
|
|
110
|
+
from: n
|
|
111
|
+
}, Z.value = t(n, n);
|
|
112
|
+
}
|
|
113
|
+
function Q(e, t, n) {
|
|
114
|
+
t.button || (t.stopPropagation(), P.value = e.id, m.editable && (R.value.setPointerCapture?.(t.pointerId), X = {
|
|
115
|
+
kind: n,
|
|
116
|
+
r: e,
|
|
117
|
+
from: G(t)
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
function ce(e) {
|
|
121
|
+
if (!X) return;
|
|
122
|
+
let n = G(e);
|
|
123
|
+
X.kind === "draw" ? Z.value = t(X.from, n) : X.kind === "move" ? K(r(X.r, n.x - X.from.x, n.y - X.from.y)) : K(a(X.r, n.x - X.from.x, n.y - X.from.y));
|
|
124
|
+
}
|
|
125
|
+
function $() {
|
|
126
|
+
let e = Z.value, t = X;
|
|
127
|
+
X = null, Z.value = null, t?.kind === "draw" && e && e.w >= .02 && e.h >= .02 && q(e);
|
|
128
|
+
}
|
|
129
|
+
function le(e, t) {
|
|
130
|
+
if (t.target.closest("input")) return;
|
|
131
|
+
let n = {
|
|
132
|
+
ArrowLeft: [-1, 0],
|
|
133
|
+
ArrowRight: [1, 0],
|
|
134
|
+
ArrowUp: [0, -1],
|
|
135
|
+
ArrowDown: [0, 1]
|
|
136
|
+
}[t.key];
|
|
137
|
+
if (n && m.editable) {
|
|
138
|
+
t.preventDefault();
|
|
139
|
+
let i = t.shiftKey ? .05 : .01, o = t.altKey ? a(e, n[0] * i, n[1] * i) : r(e, n[0] * i, n[1] * i);
|
|
140
|
+
K(o), B.value = I.value.moved(Math.round(o.x * 100), Math.round(o.y * 100));
|
|
141
|
+
} else (t.key === "Delete" || t.key === "Backspace") && m.editable ? (t.preventDefault(), J(e)) : (t.key === "Enter" || t.key === " ") && (t.preventDefault(), P.value = e.id, h(() => z.value?.focus()));
|
|
142
|
+
}
|
|
143
|
+
let ue = s(() => P.value ?? N.value[0]?.id), de = (e) => H.value && K({
|
|
144
|
+
...H.value,
|
|
145
|
+
label: e
|
|
146
|
+
});
|
|
147
|
+
return (t, r) => (v(), l("div", E, [
|
|
148
|
+
p.editable ? (v(), l("div", {
|
|
149
|
+
key: 0,
|
|
150
|
+
class: "bless-annot__bar",
|
|
151
|
+
role: "toolbar",
|
|
152
|
+
"aria-label": I.value.tools
|
|
153
|
+
}, [
|
|
154
|
+
(v(), l(o, null, b([
|
|
155
|
+
"select",
|
|
156
|
+
"box",
|
|
157
|
+
"pin"
|
|
158
|
+
], (t) => f(e, {
|
|
159
|
+
key: t,
|
|
160
|
+
size: "sm",
|
|
161
|
+
variant: F.value === t ? "solid" : "outline",
|
|
162
|
+
"aria-pressed": F.value === t,
|
|
163
|
+
onClick: (e) => F.value = t
|
|
164
|
+
}, {
|
|
165
|
+
default: T(() => [d(x(I.value[t]), 1)]),
|
|
166
|
+
_: 2
|
|
167
|
+
}, 1032, [
|
|
168
|
+
"variant",
|
|
169
|
+
"aria-pressed",
|
|
170
|
+
"onClick"
|
|
171
|
+
])), 64)),
|
|
172
|
+
f(e, {
|
|
173
|
+
size: "sm",
|
|
174
|
+
variant: "ghost",
|
|
175
|
+
onClick: oe
|
|
176
|
+
}, {
|
|
177
|
+
default: T(() => [d(x(I.value.add), 1)]),
|
|
178
|
+
_: 1
|
|
179
|
+
}),
|
|
180
|
+
f(e, {
|
|
181
|
+
size: "sm",
|
|
182
|
+
variant: "ghost",
|
|
183
|
+
disabled: !H.value,
|
|
184
|
+
onClick: r[0] ||= (e) => H.value && J(H.value)
|
|
185
|
+
}, {
|
|
186
|
+
default: T(() => [d(x(I.value.remove), 1)]),
|
|
187
|
+
_: 1
|
|
188
|
+
}, 8, ["disabled"])
|
|
189
|
+
], 8, D)) : c("", !0),
|
|
190
|
+
u("div", {
|
|
191
|
+
ref_key: "stage",
|
|
192
|
+
ref: R,
|
|
193
|
+
class: g(["bless-annot__stage", [`bless-annot__stage--${F.value}`, { "bless-annot__stage--ro": !p.editable }]]),
|
|
194
|
+
role: "group",
|
|
195
|
+
"aria-label": p.label,
|
|
196
|
+
"aria-describedby": L,
|
|
197
|
+
tabindex: "-1",
|
|
198
|
+
onPointerdown: se,
|
|
199
|
+
onPointermove: ce,
|
|
200
|
+
onPointerup: $,
|
|
201
|
+
onPointercancel: $
|
|
202
|
+
}, [
|
|
203
|
+
u("img", {
|
|
204
|
+
class: "bless-annot__img",
|
|
205
|
+
src: p.src,
|
|
206
|
+
alt: p.alt,
|
|
207
|
+
draggable: "false"
|
|
208
|
+
}, null, 8, k),
|
|
209
|
+
(v(!0), l(o, null, b(N.value, (e, t) => (v(), l("div", {
|
|
210
|
+
key: e.id,
|
|
211
|
+
class: g(["bless-annot__mark", [S(n)(e) ? "bless-annot__mark--box" : "bless-annot__mark--pin", { "bless-annot__mark--sel": P.value === e.id }]]),
|
|
212
|
+
style: _(W(e)),
|
|
213
|
+
"data-region": e.id,
|
|
214
|
+
role: "button",
|
|
215
|
+
"aria-pressed": P.value === e.id,
|
|
216
|
+
"aria-label": V(e),
|
|
217
|
+
tabindex: ue.value === e.id ? 0 : -1,
|
|
218
|
+
onPointerdown: (t) => Q(e, t, "move"),
|
|
219
|
+
onKeydown: (t) => le(e, t),
|
|
220
|
+
onFocus: (t) => P.value = e.id
|
|
221
|
+
}, [u("span", ee, x(t + 1), 1), p.editable && S(n)(e) && P.value === e.id ? (v(), l("span", {
|
|
222
|
+
key: 0,
|
|
223
|
+
class: "bless-annot__handle",
|
|
224
|
+
"aria-hidden": "true",
|
|
225
|
+
onPointerdown: (t) => Q(e, t, "size")
|
|
226
|
+
}, null, 40, te)) : c("", !0)], 46, A))), 128)),
|
|
227
|
+
Z.value ? (v(), l("div", {
|
|
228
|
+
key: 0,
|
|
229
|
+
class: "bless-annot__mark bless-annot__mark--box bless-annot__mark--draft",
|
|
230
|
+
style: _(W({
|
|
231
|
+
id: "",
|
|
232
|
+
label: "",
|
|
233
|
+
...Z.value
|
|
234
|
+
}))
|
|
235
|
+
}, null, 4)) : c("", !0)
|
|
236
|
+
], 42, O),
|
|
237
|
+
H.value && p.editable ? (v(), l("div", ne, [u("label", re, [u("span", null, x(I.value.name), 1), u("input", {
|
|
238
|
+
ref_key: "nameInput",
|
|
239
|
+
ref: z,
|
|
240
|
+
class: "bless-annot__input",
|
|
241
|
+
type: "text",
|
|
242
|
+
value: H.value.label,
|
|
243
|
+
onInput: r[1] ||= (e) => de(e.target.value)
|
|
244
|
+
}, null, 40, ie)])])) : c("", !0),
|
|
245
|
+
N.value.length ? (v(), l("ol", {
|
|
246
|
+
key: 2,
|
|
247
|
+
class: "bless-annot__list",
|
|
248
|
+
"aria-label": I.value.regions
|
|
249
|
+
}, [(v(!0), l(o, null, b(N.value, (e) => (v(), l("li", { key: e.id }, [u("button", {
|
|
250
|
+
type: "button",
|
|
251
|
+
class: "bless-annot__item",
|
|
252
|
+
"aria-pressed": P.value === e.id,
|
|
253
|
+
onClick: (t) => (P.value = e.id, Y(e.id))
|
|
254
|
+
}, x(V(e)), 9, j)]))), 128))], 8, ae)) : c("", !0),
|
|
255
|
+
u("span", {
|
|
256
|
+
id: L,
|
|
257
|
+
hidden: ""
|
|
258
|
+
}, x(I.value.hint), 1),
|
|
259
|
+
u("span", M, x(B.value), 1)
|
|
260
|
+
]));
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
//#endregion
|
|
264
|
+
export { N as default };
|
|
@@ -12,6 +12,8 @@ type __VLS_Props = {
|
|
|
12
12
|
size?: "sm" | "md";
|
|
13
13
|
removable?: boolean;
|
|
14
14
|
removeLabel?: string;
|
|
15
|
+
/** shown for `state="error"` */
|
|
16
|
+
errorText?: string;
|
|
15
17
|
};
|
|
16
18
|
declare var __VLS_1: {}, __VLS_8: {}, __VLS_15: {};
|
|
17
19
|
type __VLS_Slots = {} & {
|
|
@@ -27,8 +29,9 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
27
29
|
onRemove?: (() => any) | undefined;
|
|
28
30
|
}>, {
|
|
29
31
|
size: "sm" | "md";
|
|
30
|
-
state: "idle" | "uploading" | "error";
|
|
31
32
|
removeLabel: string;
|
|
33
|
+
state: "idle" | "uploading" | "error";
|
|
34
|
+
errorText: string;
|
|
32
35
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
33
36
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
34
37
|
declare const _default: typeof __VLS_export;
|
|
@@ -26,7 +26,8 @@ var p = ["aria-busy"], m = { class: "bless-attachment__media" }, h = ["src"], g
|
|
|
26
26
|
progress: {},
|
|
27
27
|
size: { default: "md" },
|
|
28
28
|
removable: { type: Boolean },
|
|
29
|
-
removeLabel: { default: "Remove" }
|
|
29
|
+
removeLabel: { default: "Remove" },
|
|
30
|
+
errorText: { default: "Upload failed" }
|
|
30
31
|
},
|
|
31
32
|
emits: ["remove"],
|
|
32
33
|
setup(c, { emit: C }) {
|
|
@@ -56,7 +57,7 @@ var p = ["aria-busy"], m = { class: "bless-attachment__media" }, h = ["src"], g
|
|
|
56
57
|
href: c.href,
|
|
57
58
|
class: "bless-attachment__name bless-attachment__link"
|
|
58
59
|
}, f(c.name), 9, v)) : (u(), a("span", y, f(c.name), 1)),
|
|
59
|
-
c.description || c.state === "error" ? (u(), a("span", b, [d(n.$slots, "description", {}, () => [s(f(c.state === "error" ?
|
|
60
|
+
c.description || c.state === "error" ? (u(), a("span", b, [d(n.$slots, "description", {}, () => [s(f(c.state === "error" ? c.errorText : c.description), 1)])])) : i("", !0),
|
|
60
61
|
c.state === "uploading" && c.progress != null ? (u(), r(t, {
|
|
61
62
|
key: 3,
|
|
62
63
|
value: c.progress,
|
|
@@ -9,6 +9,10 @@ type __VLS_Props = {
|
|
|
9
9
|
disabledDates?: (iso: string) => boolean;
|
|
10
10
|
/** month shown initially (YYYY-MM); defaults to model or today */
|
|
11
11
|
month?: string;
|
|
12
|
+
labels?: Partial<{
|
|
13
|
+
prev: string;
|
|
14
|
+
next: string;
|
|
15
|
+
}>;
|
|
12
16
|
};
|
|
13
17
|
type __VLS_ModelProps = {
|
|
14
18
|
modelValue?: string | [string, string] | undefined;
|
|
@@ -2,16 +2,16 @@ import { logicalKey as e } from "../composables/rtl.js";
|
|
|
2
2
|
import { addDays as t, addMonths as n, fromISO as r, isoToday as i, toISO as a } from "../composables/date.js";
|
|
3
3
|
import { Fragment as o, computed as s, createElementBlock as c, createElementVNode as l, defineComponent as u, mergeModels as d, normalizeClass as f, onMounted as p, openBlock as m, ref as h, renderList as g, toDisplayString as _, unref as v, useId as y, useModel as b, watch as x } from "vue";
|
|
4
4
|
//#region src/components/BlessCalendar.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var S = ["aria-label"], C = { class: "bless-calendar__head" }, w = {
|
|
5
|
+
var S = ["aria-label"], C = { class: "bless-calendar__head" }, w = ["aria-label"], T = {
|
|
6
6
|
class: "bless-calendar__month",
|
|
7
7
|
"aria-live": "polite"
|
|
8
|
-
},
|
|
8
|
+
}, E = ["aria-label"], D = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "bless-calendar__grid bless-calendar__grid--pending"
|
|
11
|
-
},
|
|
11
|
+
}, O = {
|
|
12
12
|
role: "row",
|
|
13
13
|
class: "bless-calendar__row bless-calendar__row--head"
|
|
14
|
-
},
|
|
14
|
+
}, k = [
|
|
15
15
|
"id",
|
|
16
16
|
"tabindex",
|
|
17
17
|
"aria-selected",
|
|
@@ -20,7 +20,7 @@ var S = ["aria-label"], C = { class: "bless-calendar__head" }, w = {
|
|
|
20
20
|
"onClick",
|
|
21
21
|
"onMouseenter",
|
|
22
22
|
"onFocus"
|
|
23
|
-
],
|
|
23
|
+
], A = /*@__PURE__*/ u({
|
|
24
24
|
name: "BlessCalendar",
|
|
25
25
|
__name: "BlessCalendar",
|
|
26
26
|
props: /*@__PURE__*/ d({
|
|
@@ -30,25 +30,30 @@ var S = ["aria-label"], C = { class: "bless-calendar__head" }, w = {
|
|
|
30
30
|
weekStart: { default: 1 },
|
|
31
31
|
locale: { default: "ja-JP" },
|
|
32
32
|
disabledDates: {},
|
|
33
|
-
month: {}
|
|
33
|
+
month: {},
|
|
34
|
+
labels: {}
|
|
34
35
|
}, {
|
|
35
36
|
modelValue: {},
|
|
36
37
|
modelModifiers: {}
|
|
37
38
|
}),
|
|
38
39
|
emits: ["update:modelValue"],
|
|
39
40
|
setup(u) {
|
|
40
|
-
let d = u,
|
|
41
|
+
let d = u, A = s(() => ({
|
|
42
|
+
prev: "Previous month",
|
|
43
|
+
next: "Next month",
|
|
44
|
+
...d.labels
|
|
45
|
+
})), j = b(u, "modelValue"), M = y(), N = s(() => Array.isArray(j.value) ? j.value[0] : j.value), P = d.month ? `${d.month}-01` : N.value, F = h(""), I = h(!!P), L = h(r(P ?? i())), R = h(N.value ?? P ?? i());
|
|
41
46
|
p(() => {
|
|
42
|
-
|
|
47
|
+
F.value = i(), P || (L.value = r(F.value), R.value = F.value, I.value = !0);
|
|
43
48
|
});
|
|
44
|
-
let
|
|
49
|
+
let z = h(), B = h(), V = s(() => new Intl.DateTimeFormat(d.locale, {
|
|
45
50
|
year: "numeric",
|
|
46
51
|
month: "long"
|
|
47
|
-
}).format(
|
|
52
|
+
}).format(L.value)), H = s(() => new Intl.DateTimeFormat(d.locale, { dateStyle: "full" })), U = s(() => {
|
|
48
53
|
let e = new Intl.DateTimeFormat(d.locale, { weekday: "short" }), n = new Date(2024, 0, 7 + d.weekStart);
|
|
49
54
|
return Array.from({ length: 7 }, (r, i) => e.format(t(n, i)));
|
|
50
|
-
}),
|
|
51
|
-
let e =
|
|
55
|
+
}), W = s(() => {
|
|
56
|
+
let e = L.value.getFullYear(), t = L.value.getMonth(), n = (new Date(e, t, 1).getDay() - d.weekStart + 7) % 7, r = [];
|
|
52
57
|
for (let i = -n; r.length < 42; i++) {
|
|
53
58
|
let n = new Date(e, t, 1 + i);
|
|
54
59
|
r.push({
|
|
@@ -58,63 +63,63 @@ var S = ["aria-label"], C = { class: "bless-calendar__head" }, w = {
|
|
|
58
63
|
});
|
|
59
64
|
}
|
|
60
65
|
return r;
|
|
61
|
-
}),
|
|
66
|
+
}), G = (e) => d.min && e < d.min || d.max && e > d.max || !!d.disabledDates?.(e), K = s(() => {
|
|
62
67
|
if (!d.range) return null;
|
|
63
|
-
if (
|
|
64
|
-
let e =
|
|
65
|
-
return e <
|
|
68
|
+
if (B.value) {
|
|
69
|
+
let e = z.value ?? R.value;
|
|
70
|
+
return e < B.value ? [e, B.value] : [B.value, e];
|
|
66
71
|
}
|
|
67
|
-
return Array.isArray(
|
|
68
|
-
}),
|
|
69
|
-
function
|
|
70
|
-
if (!
|
|
71
|
-
if (
|
|
72
|
-
|
|
72
|
+
return Array.isArray(j.value) ? j.value : null;
|
|
73
|
+
}), q = (e) => d.range ? K.value?.[0] === e || K.value?.[1] === e : j.value === e, J = (e) => !!K.value && e > K.value[0] && e < K.value[1];
|
|
74
|
+
function Y(e) {
|
|
75
|
+
if (!G(e)) {
|
|
76
|
+
if (R.value = e, !d.range) return void (j.value = e);
|
|
77
|
+
B.value ? (j.value = e < B.value ? [e, B.value] : [B.value, e], B.value = void 0) : B.value = e;
|
|
73
78
|
}
|
|
74
79
|
}
|
|
75
|
-
function
|
|
76
|
-
let n = r(
|
|
77
|
-
n = t(n, e),
|
|
80
|
+
function X(e) {
|
|
81
|
+
let n = r(R.value);
|
|
82
|
+
n = t(n, e), R.value = a(n), (n.getMonth() !== L.value.getMonth() || n.getFullYear() !== L.value.getFullYear()) && (L.value = new Date(n.getFullYear(), n.getMonth(), 1)), requestAnimationFrame(() => document.getElementById(`${M}-${R.value}`)?.focus());
|
|
78
83
|
}
|
|
79
|
-
function
|
|
84
|
+
function Z(t) {
|
|
80
85
|
let n = {
|
|
81
86
|
ArrowLeft: -1,
|
|
82
87
|
ArrowRight: 1,
|
|
83
88
|
ArrowUp: -7,
|
|
84
89
|
ArrowDown: 7
|
|
85
90
|
};
|
|
86
|
-
t.key in n ? (t.preventDefault(),
|
|
91
|
+
t.key in n ? (t.preventDefault(), X(n[e(t)])) : t.key === "PageUp" ? (t.preventDefault(), Q(t.shiftKey ? -12 : -1, !0)) : t.key === "PageDown" ? (t.preventDefault(), Q(t.shiftKey ? 12 : 1, !0)) : t.key === "Home" ? (t.preventDefault(), X(-((r(R.value).getDay() - d.weekStart + 7) % 7))) : t.key === "End" ? (t.preventDefault(), X(6 - (r(R.value).getDay() - d.weekStart + 7) % 7)) : (t.key === "Enter" || t.key === " ") && (t.preventDefault(), Y(R.value));
|
|
87
92
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
93
|
+
function Q(e, t = !1) {
|
|
94
|
+
L.value = n(L.value, e), t && requestAnimationFrame(() => document.getElementById(`${M}-${R.value}`)?.focus());
|
|
90
95
|
}
|
|
91
|
-
return x(
|
|
92
|
-
let t = r(
|
|
93
|
-
(t.getFullYear() !== e.getFullYear() || t.getMonth() !== e.getMonth()) && (
|
|
96
|
+
return x(N, (e) => e && (L.value = n(r(e), 0))), x(L, (e) => {
|
|
97
|
+
let t = r(R.value);
|
|
98
|
+
(t.getFullYear() !== e.getFullYear() || t.getMonth() !== e.getMonth()) && (R.value = a(new Date(e.getFullYear(), e.getMonth(), Math.min(t.getDate(), 28))));
|
|
94
99
|
}, { immediate: !0 }), (e, t) => (m(), c("div", {
|
|
95
100
|
class: "bless-calendar",
|
|
96
101
|
role: "group",
|
|
97
|
-
"aria-label":
|
|
102
|
+
"aria-label": I.value ? V.value : void 0
|
|
98
103
|
}, [l("div", C, [
|
|
99
104
|
l("button", {
|
|
100
105
|
type: "button",
|
|
101
106
|
class: "bless-calendar__nav",
|
|
102
|
-
"aria-label":
|
|
103
|
-
onClick: t[0] ||= (e) =>
|
|
104
|
-
}, [...t[3] ||= [l("span", { "aria-hidden": "true" }, "‹", -1)]]),
|
|
105
|
-
l("span",
|
|
107
|
+
"aria-label": A.value.prev,
|
|
108
|
+
onClick: t[0] ||= (e) => Q(-1)
|
|
109
|
+
}, [...t[3] ||= [l("span", { "aria-hidden": "true" }, "‹", -1)]], 8, w),
|
|
110
|
+
l("span", T, _(I.value ? V.value : ""), 1),
|
|
106
111
|
l("button", {
|
|
107
112
|
type: "button",
|
|
108
113
|
class: "bless-calendar__nav",
|
|
109
|
-
"aria-label":
|
|
110
|
-
onClick: t[1] ||= (e) =>
|
|
111
|
-
}, [...t[4] ||= [l("span", { "aria-hidden": "true" }, "›", -1)]])
|
|
112
|
-
]),
|
|
114
|
+
"aria-label": A.value.next,
|
|
115
|
+
onClick: t[1] ||= (e) => Q(1)
|
|
116
|
+
}, [...t[4] ||= [l("span", { "aria-hidden": "true" }, "›", -1)]], 8, E)
|
|
117
|
+
]), I.value ? (m(), c("div", {
|
|
113
118
|
key: 1,
|
|
114
119
|
class: "bless-calendar__grid",
|
|
115
120
|
role: "grid",
|
|
116
|
-
onKeydown:
|
|
117
|
-
}, [l("div",
|
|
121
|
+
onKeydown: Z
|
|
122
|
+
}, [l("div", O, [(m(!0), c(o, null, g(U.value, (e) => (m(), c("span", {
|
|
118
123
|
key: e,
|
|
119
124
|
role: "columnheader",
|
|
120
125
|
class: "bless-calendar__dow"
|
|
@@ -122,29 +127,29 @@ var S = ["aria-label"], C = { class: "bless-calendar__head" }, w = {
|
|
|
122
127
|
key: e,
|
|
123
128
|
role: "row",
|
|
124
129
|
class: "bless-calendar__row"
|
|
125
|
-
}, [(m(!0), c(o, null, g(
|
|
130
|
+
}, [(m(!0), c(o, null, g(W.value.slice((e - 1) * 7, e * 7), (e) => (m(), c("button", {
|
|
126
131
|
key: e.iso,
|
|
127
|
-
id: `${v(
|
|
132
|
+
id: `${v(M)}-${e.iso}`,
|
|
128
133
|
type: "button",
|
|
129
134
|
role: "gridcell",
|
|
130
135
|
class: f(["bless-calendar__day", {
|
|
131
136
|
"bless-calendar__day--outside": e.outside,
|
|
132
|
-
"bless-calendar__day--today": e.iso ===
|
|
133
|
-
"bless-calendar__day--selected":
|
|
134
|
-
"bless-calendar__day--in-range":
|
|
135
|
-
"bless-calendar__day--start":
|
|
136
|
-
"bless-calendar__day--end":
|
|
137
|
+
"bless-calendar__day--today": e.iso === F.value,
|
|
138
|
+
"bless-calendar__day--selected": q(e.iso),
|
|
139
|
+
"bless-calendar__day--in-range": J(e.iso),
|
|
140
|
+
"bless-calendar__day--start": K.value?.[0] === e.iso,
|
|
141
|
+
"bless-calendar__day--end": K.value?.[1] === e.iso
|
|
137
142
|
}]),
|
|
138
|
-
tabindex: e.iso ===
|
|
139
|
-
"aria-selected":
|
|
140
|
-
"aria-disabled":
|
|
141
|
-
"aria-label":
|
|
142
|
-
onClick: (t) =>
|
|
143
|
-
onMouseenter: (t) =>
|
|
144
|
-
onMouseleave: t[2] ||= (e) =>
|
|
145
|
-
onFocus: (t) =>
|
|
146
|
-
}, _(e.date.getDate()), 43,
|
|
143
|
+
tabindex: e.iso === R.value ? 0 : -1,
|
|
144
|
+
"aria-selected": q(e.iso) || void 0,
|
|
145
|
+
"aria-disabled": G(e.iso) || void 0,
|
|
146
|
+
"aria-label": H.value.format(e.date),
|
|
147
|
+
onClick: (t) => Y(e.iso),
|
|
148
|
+
onMouseenter: (t) => z.value = e.iso,
|
|
149
|
+
onMouseleave: t[2] ||= (e) => z.value = void 0,
|
|
150
|
+
onFocus: (t) => R.value = e.iso
|
|
151
|
+
}, _(e.date.getDate()), 43, k))), 128))])), 64))], 32)) : (m(), c("div", D))], 8, S));
|
|
147
152
|
}
|
|
148
153
|
});
|
|
149
154
|
//#endregion
|
|
150
|
-
export {
|
|
155
|
+
export { A as default };
|
|
@@ -12,6 +12,8 @@ type __VLS_Props = {
|
|
|
12
12
|
nextLabel?: string;
|
|
13
13
|
/** the autoplay button's name; its pressed state says whether it's paused */
|
|
14
14
|
pauseLabel?: string;
|
|
15
|
+
/** accessible name of the slide dots */
|
|
16
|
+
dotsLabel?: string;
|
|
15
17
|
};
|
|
16
18
|
declare function go(i: number, smooth?: boolean): void;
|
|
17
19
|
type __VLS_ModelProps = {
|
|
@@ -41,6 +43,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
|
41
43
|
dots: boolean;
|
|
42
44
|
arrows: boolean;
|
|
43
45
|
pauseLabel: string;
|
|
46
|
+
dotsLabel: string;
|
|
44
47
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
45
48
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
46
49
|
declare const _default: typeof __VLS_export;
|
|
@@ -2,12 +2,7 @@ import { reducedMotion as e, scrollBehavior as t } from "../composables/useMedia
|
|
|
2
2
|
import { logicalKey as n } from "../composables/rtl.js";
|
|
3
3
|
import { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, defineComponent as c, mergeModels as l, normalizeClass as u, normalizeStyle as d, onBeforeUnmount as f, onMounted as p, openBlock as m, ref as h, renderList as g, renderSlot as _, toDisplayString as v, useModel as y, watch as b } from "vue";
|
|
4
4
|
//#region src/components/BlessCarousel.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var x = ["aria-label"], S = ["aria-label", "aria-disabled"], C = ["aria-label", "aria-disabled"], w =
|
|
6
|
-
key: 1,
|
|
7
|
-
class: "bless-carousel__dots",
|
|
8
|
-
role: "group",
|
|
9
|
-
"aria-label": "Slides"
|
|
10
|
-
}, T = [
|
|
5
|
+
var x = ["aria-label"], S = ["aria-label", "aria-disabled"], C = ["aria-label", "aria-disabled"], w = ["aria-label"], T = [
|
|
11
6
|
"aria-current",
|
|
12
7
|
"aria-label",
|
|
13
8
|
"onClick"
|
|
@@ -33,7 +28,8 @@ var x = ["aria-label"], S = ["aria-label", "aria-disabled"], C = ["aria-label",
|
|
|
33
28
|
label: { default: "Carousel" },
|
|
34
29
|
prevLabel: { default: "Previous slide" },
|
|
35
30
|
nextLabel: { default: "Next slide" },
|
|
36
|
-
pauseLabel: { default: "Pause slides" }
|
|
31
|
+
pauseLabel: { default: "Pause slides" },
|
|
32
|
+
dotsLabel: { default: "Slides" }
|
|
37
33
|
}, {
|
|
38
34
|
modelValue: { default: 0 },
|
|
39
35
|
modelModifiers: {}
|
|
@@ -120,14 +116,19 @@ var x = ["aria-label"], S = ["aria-label", "aria-disabled"], C = ["aria-label",
|
|
|
120
116
|
"aria-disabled": !R.value || void 0,
|
|
121
117
|
onClick: t[1] ||= (e) => R.value && V(A.value + 1)
|
|
122
118
|
}, [...t[3] ||= [s("span", { "aria-hidden": "true" }, "›", -1)]], 8, C)], 64)) : a("", !0),
|
|
123
|
-
c.dots && I.value > 1 ? (m(), o("div",
|
|
119
|
+
c.dots && I.value > 1 ? (m(), o("div", {
|
|
120
|
+
key: 1,
|
|
121
|
+
class: "bless-carousel__dots",
|
|
122
|
+
role: "group",
|
|
123
|
+
"aria-label": c.dotsLabel
|
|
124
|
+
}, [(m(!0), o(r, null, g(I.value, (e) => (m(), o("button", {
|
|
124
125
|
key: e,
|
|
125
126
|
type: "button",
|
|
126
127
|
class: u(["bless-carousel__dot", { "bless-carousel__dot--active": e - 1 === A.value }]),
|
|
127
128
|
"aria-current": e - 1 === A.value || void 0,
|
|
128
129
|
"aria-label": `Slide ${e}`,
|
|
129
130
|
onClick: (t) => V(e - 1)
|
|
130
|
-
}, null, 10, T))), 128))])) : a("", !0),
|
|
131
|
+
}, null, 10, T))), 128))], 8, w)) : a("", !0),
|
|
131
132
|
c.autoplay > 0 ? (m(), o("button", {
|
|
132
133
|
key: 2,
|
|
133
134
|
type: "button",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.bless-coachmark{display:inline-flex;position:relative}.bless-coachmark__dot{background:var(--bless-color-badge);cursor:pointer;border:0;width:12px;height:12px;padding:0;position:absolute}.bless-coachmark__dot:before{content:"";position:absolute;inset:-10px}.bless-coachmark__dot:after{content:"";border:2px solid var(--bless-color-badge);animation:bless-coachmark-pulse 1.8s var(--bless-ease-out) infinite;position:absolute;inset:-4px}.bless-coachmark__dot:focus-visible{outline:2px solid var(--bless-color-accent);outline-offset:3px}.bless-coachmark__dot--top-end{top:-4px;inset-inline-end:-4px}.bless-coachmark__dot--top-start{top:-4px;inset-inline-start:-4px}.bless-coachmark__dot--bottom-end{bottom:-4px;inset-inline-end:-4px}.bless-coachmark__dot--bottom-start{bottom:-4px;inset-inline-start:-4px}.bless-coachmark__bubble{z-index:2;gap:var(--bless-space-2);width:max-content;max-width:220px;padding:var(--bless-space-3);background:var(--bless-color-bg);border:var(--bless-border-width) solid var(--bless-color-accent);box-shadow:var(--bless-shadow-plate);font-family:var(--bless-font-sans);font-size:var(--bless-text-sm);color:var(--bless-color-text);display:grid;position:absolute}.bless-coachmark__bubble--top-end,.bless-coachmark__bubble--top-start{top:calc(100% + 12px)}.bless-coachmark__bubble--bottom-end,.bless-coachmark__bubble--bottom-start{bottom:calc(100% + 12px)}.bless-coachmark__bubble--top-end,.bless-coachmark__bubble--bottom-end{inset-inline-end:0}.bless-coachmark__bubble--top-start,.bless-coachmark__bubble--bottom-start{inset-inline-start:0}@keyframes bless-coachmark-pulse{0%{opacity:.9;transform:scale(.6)}to{opacity:0;transform:scale(1.6)}}@media (prefers-reduced-motion:reduce){.bless-coachmark__dot:after{opacity:.5;animation:none;transform:none}}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** what is new, said in the bubble and to screen readers */
|
|
3
|
+
text: string;
|
|
4
|
+
/** remembers a dismissal under this key (localStorage), so it shows once; omit to show until `dismissed` is set */
|
|
5
|
+
id?: string;
|
|
6
|
+
/** which corner of the wrapped element the dot sits on */
|
|
7
|
+
placement?: "top-end" | "top-start" | "bottom-end" | "bottom-start";
|
|
8
|
+
/** using the wrapped element (a click inside it) counts as seen */
|
|
9
|
+
dismissOnUse?: boolean;
|
|
10
|
+
labels?: Partial<{
|
|
11
|
+
dot: (text: string) => string;
|
|
12
|
+
ok: string;
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_ModelProps = {
|
|
16
|
+
"dismissed"?: boolean;
|
|
17
|
+
};
|
|
18
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
19
|
+
declare var __VLS_1: {};
|
|
20
|
+
type __VLS_Slots = {} & {
|
|
21
|
+
default?: (props: typeof __VLS_1) => any;
|
|
22
|
+
};
|
|
23
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
24
|
+
dismiss: () => any;
|
|
25
|
+
"update:dismissed": (value: boolean) => any;
|
|
26
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
27
|
+
onDismiss?: (() => any) | undefined;
|
|
28
|
+
"onUpdate:dismissed"?: ((value: boolean) => any) | undefined;
|
|
29
|
+
}>, {
|
|
30
|
+
placement: "top-end" | "top-start" | "bottom-end" | "bottom-start";
|
|
31
|
+
dismissOnUse: boolean;
|
|
32
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
33
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
34
|
+
declare const _default: typeof __VLS_export;
|
|
35
|
+
export default _default;
|
|
36
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
37
|
+
new (): {
|
|
38
|
+
$slots: S;
|
|
39
|
+
};
|
|
40
|
+
};
|