blessing-ui 0.1.0 → 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/CHANGELOG.md +38 -0
- package/README.md +65 -43
- package/dist/blessing-ui.css +60 -0
- package/dist/components/BlessCodeBlock.css +1 -0
- package/dist/components/BlessCodeBlock.js +6 -0
- package/dist/components/BlessCodeBlock.vue.d.ts +62 -0
- package/dist/components/BlessCodeBlock.vue_vue_type_script_setup_true_lang.js +134 -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 +54 -0
- package/dist/components/BlessCropper.vue_vue_type_script_setup_true_lang.js +212 -0
- 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/BlessGantt.css +1 -0
- package/dist/components/BlessGantt.js +6 -0
- package/dist/components/BlessGantt.vue.d.ts +69 -0
- package/dist/components/BlessGantt.vue_vue_type_script_setup_true_lang.js +270 -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/BlessKanban.css +1 -0
- package/dist/components/BlessKanban.js +6 -0
- package/dist/components/BlessKanban.vue.d.ts +55 -0
- package/dist/components/BlessKanban.vue_vue_type_script_setup_true_lang.js +165 -0
- 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 +40 -0
- package/dist/components/BlessMarquee.vue_vue_type_script_setup_true_lang.js +64 -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/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/BlessShortcutRecorder.css +1 -0
- package/dist/components/BlessShortcutRecorder.js +6 -0
- package/dist/components/BlessShortcutRecorder.vue.d.ts +29 -0
- package/dist/components/BlessShortcutRecorder.vue_vue_type_script_setup_true_lang.js +116 -0
- package/dist/components/BlessSliderCaptcha.css +1 -0
- package/dist/components/BlessSliderCaptcha.js +6 -0
- package/dist/components/BlessSliderCaptcha.vue.d.ts +33 -0
- package/dist/components/BlessSliderCaptcha.vue_vue_type_script_setup_true_lang.js +141 -0
- package/dist/components/BlessSortable.css +1 -0
- package/dist/components/BlessSortable.js +6 -0
- package/dist/components/BlessSortable.vue.d.ts +33 -0
- package/dist/components/BlessSortable.vue_vue_type_script_setup_true_lang.js +87 -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/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 +199 -0
- package/dist/components/BlessTimer.css +1 -0
- package/dist/components/BlessTimer.js +6 -0
- package/dist/components/BlessTimer.vue.d.ts +56 -0
- package/dist/components/BlessTimer.vue_vue_type_script_setup_true_lang.js +130 -0
- package/dist/composables/cropBox.d.ts +22 -0
- package/dist/composables/cropBox.js +39 -0
- package/dist/composables/diffLines.d.ts +10 -0
- package/dist/composables/diffLines.js +55 -0
- package/dist/composables/radial.d.ts +15 -0
- package/dist/composables/radial.js +22 -0
- package/dist/composables/shortcut.d.ts +12 -0
- package/dist/composables/shortcut.js +35 -0
- package/dist/composables/useSortable.d.ts +18 -0
- package/dist/composables/useSortable.js +34 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +78 -53
- package/package.json +20 -18
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { diffLines as e } from "../composables/diffLines.js";
|
|
2
|
+
import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, ref as l, renderList as u, toDisplayString as d } from "vue";
|
|
3
|
+
//#region src/components/BlessDiff.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var f = { class: "bless-diff__head" }, p = { class: "bless-diff__title" }, m = { class: "bless-diff__count" }, h = { class: "bless-diff__plus" }, g = { class: "bless-diff__minus" }, _ = { class: "bless-diff__sr" }, v = ["aria-label"], y = { class: "bless-diff__table" }, b = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "bless-diff__cols"
|
|
7
|
+
}, x = {
|
|
8
|
+
key: 0,
|
|
9
|
+
"aria-hidden": "true"
|
|
10
|
+
}, S = { scope: "col" }, C = {
|
|
11
|
+
key: 1,
|
|
12
|
+
"aria-hidden": "true"
|
|
13
|
+
}, w = { scope: "col" }, T = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "bless-diff__fold"
|
|
16
|
+
}, E = ["colspan"], D = ["onClick"], O = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "bless-diff__no",
|
|
19
|
+
"aria-hidden": "true"
|
|
20
|
+
}, k = {
|
|
21
|
+
key: 1,
|
|
22
|
+
class: "bless-diff__no",
|
|
23
|
+
"aria-hidden": "true"
|
|
24
|
+
}, A = ["aria-label"], j = { class: "bless-diff__text" }, M = {
|
|
25
|
+
key: 2,
|
|
26
|
+
class: "bless-diff__row"
|
|
27
|
+
}, N = {
|
|
28
|
+
key: 0,
|
|
29
|
+
class: "bless-diff__no",
|
|
30
|
+
"aria-hidden": "true"
|
|
31
|
+
}, P = ["aria-label"], F = /*@__PURE__*/ o({
|
|
32
|
+
name: "BlessDiff",
|
|
33
|
+
__name: "BlessDiff",
|
|
34
|
+
props: {
|
|
35
|
+
a: {},
|
|
36
|
+
b: {},
|
|
37
|
+
mode: { default: "inline" },
|
|
38
|
+
context: {},
|
|
39
|
+
lineNumbers: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: !0
|
|
42
|
+
},
|
|
43
|
+
labelA: { default: "Before" },
|
|
44
|
+
labelB: { default: "After" },
|
|
45
|
+
label: { default: "Changes" }
|
|
46
|
+
},
|
|
47
|
+
setup(o) {
|
|
48
|
+
let F = o, I = n(() => e(F.a, F.b)), L = n(() => I.value.filter((e) => e.type === "add").length), R = n(() => I.value.filter((e) => e.type === "del").length), z = l(/* @__PURE__ */ new Set()), B = n(() => {
|
|
49
|
+
let e = F.context;
|
|
50
|
+
if (e == null) return I.value.map((e) => ({
|
|
51
|
+
row: e,
|
|
52
|
+
hide: !1,
|
|
53
|
+
id: -1
|
|
54
|
+
}));
|
|
55
|
+
let t = I.value.map((e) => ({
|
|
56
|
+
row: e,
|
|
57
|
+
hide: !1,
|
|
58
|
+
id: -1
|
|
59
|
+
})), n = 0, r = 0;
|
|
60
|
+
for (; n < t.length;) {
|
|
61
|
+
if (t[n].row.type !== "same") {
|
|
62
|
+
n++;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
let i = n;
|
|
66
|
+
for (; i < t.length && t[i].row.type === "same";) i++;
|
|
67
|
+
let a = n === 0 ? n : n + e, o = i === t.length ? i : i - e;
|
|
68
|
+
if (o - a > 1 && !z.value.has(r)) for (let e = a; e < o; e++) t[e].hide = !0, t[e].id = r;
|
|
69
|
+
r++, n = i;
|
|
70
|
+
}
|
|
71
|
+
return t;
|
|
72
|
+
}), V = n(() => {
|
|
73
|
+
let e = [], t = /* @__PURE__ */ new Set(), n = {
|
|
74
|
+
del: [],
|
|
75
|
+
add: []
|
|
76
|
+
}, r = () => {
|
|
77
|
+
if (F.mode === "inline") for (let t of [...n.del, ...n.add]) e.push({
|
|
78
|
+
kind: "row",
|
|
79
|
+
row: t
|
|
80
|
+
});
|
|
81
|
+
else {
|
|
82
|
+
let t = Math.max(n.del.length, n.add.length);
|
|
83
|
+
for (let r = 0; r < t; r++) e.push({
|
|
84
|
+
kind: "pair",
|
|
85
|
+
left: n.del[r],
|
|
86
|
+
right: n.add[r]
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
n.del = [], n.add = [];
|
|
90
|
+
};
|
|
91
|
+
for (let { row: i, hide: a, id: o } of B.value) a ? (r(), t.has(o) || (t.add(o), e.push({
|
|
92
|
+
kind: "fold",
|
|
93
|
+
id: o,
|
|
94
|
+
count: B.value.filter((e) => e.id === o && e.hide).length
|
|
95
|
+
}))) : i.type === "del" ? n.del.push(i) : i.type === "add" ? n.add.push(i) : (r(), e.push(F.mode === "inline" ? {
|
|
96
|
+
kind: "row",
|
|
97
|
+
row: i
|
|
98
|
+
} : {
|
|
99
|
+
kind: "pair",
|
|
100
|
+
left: i,
|
|
101
|
+
right: i
|
|
102
|
+
}));
|
|
103
|
+
return r(), e;
|
|
104
|
+
}), H = {
|
|
105
|
+
same: "",
|
|
106
|
+
add: "+",
|
|
107
|
+
del: "−"
|
|
108
|
+
}, U = {
|
|
109
|
+
same: "",
|
|
110
|
+
add: "added",
|
|
111
|
+
del: "removed"
|
|
112
|
+
}, W = (e) => z.value = new Set(z.value).add(e), G = n(() => (F.mode, 4));
|
|
113
|
+
return (e, n) => (c(), i("figure", { class: s(["bless-diff", `bless-diff--${o.mode}`]) }, [a("figcaption", f, [a("span", p, d(o.label), 1), a("span", m, [
|
|
114
|
+
a("span", h, "+" + d(L.value), 1),
|
|
115
|
+
a("span", g, "−" + d(R.value), 1),
|
|
116
|
+
a("span", _, d(L.value) + " lines added, " + d(R.value) + " removed", 1)
|
|
117
|
+
])]), a("div", {
|
|
118
|
+
class: "bless-diff__scroll",
|
|
119
|
+
tabindex: "0",
|
|
120
|
+
role: "region",
|
|
121
|
+
"aria-label": o.label
|
|
122
|
+
}, [a("table", y, [o.mode === "split" ? (c(), i("thead", b, [a("tr", null, [
|
|
123
|
+
o.lineNumbers ? (c(), i("th", x)) : r("", !0),
|
|
124
|
+
a("th", S, d(o.labelA), 1),
|
|
125
|
+
o.lineNumbers ? (c(), i("th", C)) : r("", !0),
|
|
126
|
+
a("th", w, d(o.labelB), 1)
|
|
127
|
+
])])) : r("", !0), a("tbody", null, [(c(!0), i(t, null, u(V.value, (e, n) => (c(), i(t, { key: n }, [e.kind === "fold" ? (c(), i("tr", T, [a("td", { colspan: G.value }, [a("button", {
|
|
128
|
+
type: "button",
|
|
129
|
+
onClick: (t) => W(e.id)
|
|
130
|
+
}, d(e.count) + " unchanged " + d(e.count === 1 ? "line" : "lines"), 9, D)], 8, E)])) : e.kind === "row" ? (c(), i("tr", {
|
|
131
|
+
key: 1,
|
|
132
|
+
class: s(`bless-diff__row bless-diff__row--${e.row.type}`)
|
|
133
|
+
}, [
|
|
134
|
+
o.lineNumbers ? (c(), i("td", O, d(e.row.a), 1)) : r("", !0),
|
|
135
|
+
o.lineNumbers ? (c(), i("td", k, d(e.row.b), 1)) : r("", !0),
|
|
136
|
+
a("td", {
|
|
137
|
+
class: "bless-diff__sign",
|
|
138
|
+
"aria-label": U[e.row.type] || void 0
|
|
139
|
+
}, d(H[e.row.type]), 9, A),
|
|
140
|
+
a("td", j, d(e.row.text), 1)
|
|
141
|
+
], 2)) : (c(), i("tr", M, [(c(!0), i(t, null, u([e.left, e.right], (e, n) => (c(), i(t, { key: n }, [o.lineNumbers ? (c(), i("td", N, d(n ? e?.b : e?.a), 1)) : r("", !0), a("td", {
|
|
142
|
+
class: s(["bless-diff__text", e && e.type !== "same" ? `bless-diff__cell--${e.type}` : e ? "" : "bless-diff__cell--empty"]),
|
|
143
|
+
"aria-label": e && e.type !== "same" ? `${U[e.type]}: ${e.text}` : void 0
|
|
144
|
+
}, d(e?.text), 11, P)], 64))), 128))]))], 64))), 128))])])], 8, v)], 2));
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
//#endregion
|
|
148
|
+
export { F as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.bless-gantt{min-width:0;max-width:100%;font-family:var(--bless-font-sans);font-size:var(--bless-text-sm);color:var(--bless-color-text);position:relative}.bless-gantt__scroll{border:var(--bless-border-width) solid var(--bless-color-border);overflow:auto}.bless-gantt__body{width:max-content;min-width:100%;display:flex}.bless-gantt__labels{z-index:2;width:var(--bless-gantt-label);background:var(--bless-color-bg);border-inline-end:var(--bless-border-width) solid var(--bless-color-border);flex:none;position:sticky;inset-inline-start:0}.bless-gantt__label{box-sizing:border-box;padding:0 var(--bless-space-3);white-space:nowrap;text-overflow:ellipsis;border-top:var(--bless-border-width) solid var(--bless-color-border);align-items:center;display:flex;overflow:hidden}.bless-gantt__plot{flex:none;position:relative}.bless-gantt__head{height:56px;color:var(--bless-color-text-muted);font-size:var(--bless-text-xs)}.bless-gantt__months{height:28px;position:relative}.bless-gantt__month{box-sizing:border-box;padding:var(--bless-space-2) var(--bless-space-2) 0;white-space:nowrap;border-inline-start:var(--bless-border-width) solid var(--bless-color-border);height:100%;position:absolute;top:0;overflow:hidden}.bless-gantt__days{height:28px;display:flex}.bless-gantt__day{box-sizing:border-box;padding-top:var(--bless-space-2);text-align:center;font-variant-numeric:tabular-nums;flex:none}.bless-gantt__day--weekend{background:var(--bless-color-surface)}.bless-gantt__rows{border-top:var(--bless-border-width) solid var(--bless-color-border);background-image:linear-gradient(to right, var(--bless-color-border) 1px, transparent 1px);position:relative}.bless-gantt__today{background:var(--bless-color-accent);pointer-events:none;width:2px;position:absolute;inset-block:0}.bless-gantt__bar{box-sizing:border-box;border:var(--bless-border-width) solid var(--bless-color-text);background:var(--bless-color-bg);cursor:pointer;padding:0;position:absolute;overflow:hidden}.bless-gantt__done{background:var(--bless-color-text);height:100%;display:block}.bless-gantt__arrows{pointer-events:none;color:var(--bless-color-text);position:absolute;inset:0}.bless-gantt__arrows>path{fill:none;stroke:currentColor;stroke-width:1.5px}.bless-gantt__bar--edit{cursor:grab;touch-action:none}.bless-gantt__bar--drag{cursor:grabbing;opacity:.85}.bless-gantt__grip{cursor:ew-resize;background:color-mix(in srgb, var(--bless-color-text) 25%, transparent);width:8px;position:absolute;inset-block:0}.bless-gantt__grip--start{inset-inline-start:0}.bless-gantt__grip--end{inset-inline-end:0}.bless-gantt__live{clip-path:inset(50%);width:1px;height:1px;position:absolute;overflow:hidden}.bless-gantt__bar:focus-visible{outline:2px solid var(--bless-color-accent);outline-offset:2px}.bless-gantt__bar--on{border-color:var(--bless-color-accent);outline:2px solid var(--bless-color-accent)}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export interface BlessGanttTask {
|
|
2
|
+
id: string | number;
|
|
3
|
+
label: string;
|
|
4
|
+
/** ISO dates, `YYYY-MM-DD`; the task covers both days */
|
|
5
|
+
start: string;
|
|
6
|
+
end: string;
|
|
7
|
+
/** 0 to 100 */
|
|
8
|
+
progress?: number;
|
|
9
|
+
/** ids of tasks that must finish first; an arrow runs from each to this one */
|
|
10
|
+
after?: (string | number)[];
|
|
11
|
+
}
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
declare const __VLS_export: import('vue').DefineComponent<{
|
|
15
|
+
/** width of one day in px; under 12 the day numbers are left out */
|
|
16
|
+
dayWidth?: number;
|
|
17
|
+
rowHeight?: number;
|
|
18
|
+
/** first and last day shown; defaults to the span of the tasks */
|
|
19
|
+
from?: string;
|
|
20
|
+
to?: string;
|
|
21
|
+
locale?: string;
|
|
22
|
+
/** width of the label column in px */
|
|
23
|
+
labelWidth?: number;
|
|
24
|
+
/** drag a bar to move it and its ends to resize it; Alt + arrows from the keyboard */
|
|
25
|
+
editable?: boolean;
|
|
26
|
+
label?: string;
|
|
27
|
+
} & {
|
|
28
|
+
/** the schedule; with `editable`, moves and resizes come back through here */
|
|
29
|
+
tasks: BlessGanttTask[];
|
|
30
|
+
selected?: BlessGanttTask["id"] | null;
|
|
31
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
32
|
+
select: (task: BlessGanttTask) => any;
|
|
33
|
+
change: (task: BlessGanttTask, dates: {
|
|
34
|
+
start: string;
|
|
35
|
+
end: string;
|
|
36
|
+
}) => any;
|
|
37
|
+
"update:selected": (value: string | number | null) => any;
|
|
38
|
+
"update:tasks": (value: BlessGanttTask[]) => any;
|
|
39
|
+
}, string, import('vue').PublicProps, Readonly<{
|
|
40
|
+
/** width of one day in px; under 12 the day numbers are left out */
|
|
41
|
+
dayWidth?: number;
|
|
42
|
+
rowHeight?: number;
|
|
43
|
+
/** first and last day shown; defaults to the span of the tasks */
|
|
44
|
+
from?: string;
|
|
45
|
+
to?: string;
|
|
46
|
+
locale?: string;
|
|
47
|
+
/** width of the label column in px */
|
|
48
|
+
labelWidth?: number;
|
|
49
|
+
/** drag a bar to move it and its ends to resize it; Alt + arrows from the keyboard */
|
|
50
|
+
editable?: boolean;
|
|
51
|
+
label?: string;
|
|
52
|
+
} & {
|
|
53
|
+
/** the schedule; with `editable`, moves and resizes come back through here */
|
|
54
|
+
tasks: BlessGanttTask[];
|
|
55
|
+
selected?: BlessGanttTask["id"] | null;
|
|
56
|
+
}> & Readonly<{
|
|
57
|
+
onSelect?: ((task: BlessGanttTask) => any) | undefined;
|
|
58
|
+
onChange?: ((task: BlessGanttTask, dates: {
|
|
59
|
+
start: string;
|
|
60
|
+
end: string;
|
|
61
|
+
}) => any) | undefined;
|
|
62
|
+
"onUpdate:selected"?: ((value: string | number | null) => any) | undefined;
|
|
63
|
+
"onUpdate:tasks"?: ((value: BlessGanttTask[]) => any) | undefined;
|
|
64
|
+
}>, {
|
|
65
|
+
label: string;
|
|
66
|
+
dayWidth: number;
|
|
67
|
+
rowHeight: number;
|
|
68
|
+
labelWidth: number;
|
|
69
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { isoToday as e } from "../composables/date.js";
|
|
2
|
+
import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, defineComponent as o, mergeModels as s, normalizeClass as c, normalizeStyle as l, openBlock as u, ref as d, renderList as f, toDisplayString as p, useModel as m } from "vue";
|
|
3
|
+
//#region src/components/BlessGantt.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var h = ["aria-label"], g = { class: "bless-gantt__scroll" }, ee = { class: "bless-gantt__labels" }, te = ["title"], _ = {
|
|
5
|
+
class: "bless-gantt__head",
|
|
6
|
+
"aria-hidden": "true"
|
|
7
|
+
}, ne = { class: "bless-gantt__months" }, v = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "bless-gantt__days"
|
|
10
|
+
}, re = ["width", "height"], y = ["d"], b = [
|
|
11
|
+
"tabindex",
|
|
12
|
+
"aria-label",
|
|
13
|
+
"aria-pressed",
|
|
14
|
+
"onClick",
|
|
15
|
+
"onFocus",
|
|
16
|
+
"onKeydown",
|
|
17
|
+
"onPointerdown"
|
|
18
|
+
], x = ["onPointerdown"], ie = ["onPointerdown"], S = {
|
|
19
|
+
class: "bless-gantt__live",
|
|
20
|
+
"aria-live": "polite"
|
|
21
|
+
}, C = /*@__PURE__*/ o({
|
|
22
|
+
name: "BlessGantt",
|
|
23
|
+
__name: "BlessGantt",
|
|
24
|
+
props: /*@__PURE__*/ s({
|
|
25
|
+
dayWidth: { default: 28 },
|
|
26
|
+
rowHeight: { default: 36 },
|
|
27
|
+
from: {},
|
|
28
|
+
to: {},
|
|
29
|
+
locale: {},
|
|
30
|
+
labelWidth: { default: 160 },
|
|
31
|
+
editable: { type: Boolean },
|
|
32
|
+
label: { default: "Schedule" }
|
|
33
|
+
}, {
|
|
34
|
+
tasks: { required: !0 },
|
|
35
|
+
tasksModifiers: {},
|
|
36
|
+
selected: { default: null },
|
|
37
|
+
selectedModifiers: {}
|
|
38
|
+
}),
|
|
39
|
+
emits: /*@__PURE__*/ s(["select", "change"], ["update:tasks", "update:selected"]),
|
|
40
|
+
setup(o, { emit: s }) {
|
|
41
|
+
let C = o, w = m(o, "tasks"), T = m(o, "selected"), E = s, D = 864e5, O = (e) => {
|
|
42
|
+
let [t, n, r] = e.split("-").map(Number);
|
|
43
|
+
return Date.UTC(t, (n ?? 1) - 1, r ?? 1) / D;
|
|
44
|
+
}, k = (e) => /* @__PURE__ */ new Date(e * D), A = (e) => k(e).toISOString().slice(0, 10), j = d(null), M = (e) => {
|
|
45
|
+
let t = O(e.start), n = O(e.end), r = j.value;
|
|
46
|
+
return r && r.id === e.id && (r.mode === "move" ? (t = r.s + r.delta, n = r.e + r.delta) : r.mode === "start" ? t = Math.min(r.s + r.delta, r.e) : n = Math.max(r.e + r.delta, r.s)), {
|
|
47
|
+
s: t,
|
|
48
|
+
e: n
|
|
49
|
+
};
|
|
50
|
+
}, N = n(() => C.from ? O(C.from) : Math.min(...w.value.map((e) => M(e).s), O(e()))), P = n(() => C.to ? O(C.to) : Math.max(...w.value.map((e) => M(e).e), N.value)), F = n(() => Math.max(1, P.value - N.value + 1)), I = n(() => F.value * C.dayWidth), L = (e) => new Intl.DateTimeFormat(C.locale, {
|
|
51
|
+
...e,
|
|
52
|
+
timeZone: "UTC"
|
|
53
|
+
}), R = n(() => L({
|
|
54
|
+
month: "long",
|
|
55
|
+
year: "numeric"
|
|
56
|
+
})), z = n(() => L({
|
|
57
|
+
month: "short",
|
|
58
|
+
day: "numeric"
|
|
59
|
+
})), ae = n(() => {
|
|
60
|
+
let e = [];
|
|
61
|
+
for (let t = 0; t < F.value; t++) {
|
|
62
|
+
let n = k(N.value + t);
|
|
63
|
+
(!e.length || n.getUTCDate() === 1) && e.push({
|
|
64
|
+
text: R.value.format(n),
|
|
65
|
+
left: t * C.dayWidth,
|
|
66
|
+
width: 0
|
|
67
|
+
}), e.at(-1).width += C.dayWidth;
|
|
68
|
+
}
|
|
69
|
+
return e;
|
|
70
|
+
}), B = n(() => C.dayWidth < 12 ? [] : Array.from({ length: F.value }, (e, t) => {
|
|
71
|
+
let n = k(N.value + t), r = n.getUTCDay();
|
|
72
|
+
return {
|
|
73
|
+
n: n.getUTCDate(),
|
|
74
|
+
weekend: r === 0 || r === 6
|
|
75
|
+
};
|
|
76
|
+
})), V = (e) => {
|
|
77
|
+
let t = M(e), n = Math.max(t.s, N.value), r = Math.min(t.e, P.value);
|
|
78
|
+
return {
|
|
79
|
+
left: `${(n - N.value) * C.dayWidth}px`,
|
|
80
|
+
width: `${Math.max(1, r - n + 1) * C.dayWidth}px`
|
|
81
|
+
};
|
|
82
|
+
}, H = n(() => {
|
|
83
|
+
let t = O(e());
|
|
84
|
+
return t >= N.value && t <= P.value ? (t - N.value + .5) * C.dayWidth : null;
|
|
85
|
+
}), U = (e) => Math.min(100, Math.max(0, e.progress ?? 0)), oe = (e) => {
|
|
86
|
+
let t = M(e), n = (e.after ?? []).map((e) => w.value.find((t) => t.id === e)?.label).filter(Boolean);
|
|
87
|
+
return `${e.label}: ${z.value.format(k(t.s))} to ${z.value.format(k(t.e))}` + (e.progress == null ? "" : `, ${U(e)}% done`) + (n.length ? `, after ${n.join(" and ")}` : "");
|
|
88
|
+
}, W = n(() => {
|
|
89
|
+
let e = [], t = C.rowHeight;
|
|
90
|
+
return w.value.forEach((n, r) => {
|
|
91
|
+
for (let i of n.after ?? []) {
|
|
92
|
+
let a = w.value.findIndex((e) => e.id === i);
|
|
93
|
+
if (a < 0) continue;
|
|
94
|
+
let o = V(w.value[a]), s = V(n), c = parseFloat(o.left) + parseFloat(o.width), l = parseFloat(s.left), u = a * t + t / 2, d = r * t + t / 2, f = u + (d > u ? t / 2 : -t / 2);
|
|
95
|
+
e.push(l >= c + 12 ? `M${c} ${u}H${c + 6}V${d}H${l - 1}` : `M${c} ${u}H${c + 6}V${f}H${l - 8}V${d}H${l - 1}`);
|
|
96
|
+
}
|
|
97
|
+
}), e;
|
|
98
|
+
}), G = d(""), K = !1;
|
|
99
|
+
function q(e, t, n) {
|
|
100
|
+
C.editable && !n.button && (n.stopPropagation(), n.currentTarget.setPointerCapture?.(n.pointerId), j.value = {
|
|
101
|
+
id: e.id,
|
|
102
|
+
mode: t,
|
|
103
|
+
x0: n.clientX,
|
|
104
|
+
s: O(e.start),
|
|
105
|
+
e: O(e.end),
|
|
106
|
+
delta: 0
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function J(e) {
|
|
110
|
+
let t = j.value;
|
|
111
|
+
t && (t.delta = Math.round((e.clientX - t.x0) / C.dayWidth));
|
|
112
|
+
}
|
|
113
|
+
function Y() {
|
|
114
|
+
let e = j.value;
|
|
115
|
+
if (!e || (j.value = null, K = e.delta !== 0, e.delta === 0)) return;
|
|
116
|
+
let t = w.value.find((t) => t.id === e.id), n = e.mode === "move" ? {
|
|
117
|
+
s: e.s + e.delta,
|
|
118
|
+
e: e.e + e.delta
|
|
119
|
+
} : e.mode === "start" ? {
|
|
120
|
+
s: Math.min(e.s + e.delta, e.e),
|
|
121
|
+
e: e.e
|
|
122
|
+
} : {
|
|
123
|
+
s: e.s,
|
|
124
|
+
e: Math.max(e.e + e.delta, e.s)
|
|
125
|
+
};
|
|
126
|
+
X(t, n.s, n.e);
|
|
127
|
+
}
|
|
128
|
+
function X(e, t, n) {
|
|
129
|
+
let r = {
|
|
130
|
+
start: A(t),
|
|
131
|
+
end: A(n)
|
|
132
|
+
};
|
|
133
|
+
w.value = w.value.map((t) => t.id === e.id ? {
|
|
134
|
+
...t,
|
|
135
|
+
...r
|
|
136
|
+
} : t), E("change", {
|
|
137
|
+
...e,
|
|
138
|
+
...r
|
|
139
|
+
}, r), G.value = `${e.label}: ${z.value.format(k(t))} to ${z.value.format(k(n))}`;
|
|
140
|
+
}
|
|
141
|
+
let Z = d(), Q = d(0);
|
|
142
|
+
function se(e, t) {
|
|
143
|
+
let n = t.key === "ArrowDown" ? e + 1 : t.key === "ArrowUp" ? e - 1 : t.key === "Home" ? 0 : t.key === "End" ? w.value.length - 1 : null;
|
|
144
|
+
if (n != null) {
|
|
145
|
+
t.preventDefault();
|
|
146
|
+
let e = Math.min(w.value.length - 1, Math.max(0, n));
|
|
147
|
+
Q.value = e, Z.value?.querySelectorAll(".bless-gantt__bar")[e]?.focus();
|
|
148
|
+
} else if (C.editable && t.altKey && (t.key === "ArrowLeft" || t.key === "ArrowRight")) {
|
|
149
|
+
t.preventDefault();
|
|
150
|
+
let n = w.value[e], r = t.key === "ArrowRight" ? 1 : -1;
|
|
151
|
+
t.shiftKey ? X(n, O(n.start), Math.max(O(n.start), O(n.end) + r)) : X(n, O(n.start) + r, O(n.end) + r);
|
|
152
|
+
} else (t.key === "Enter" || t.key === " ") && (t.preventDefault(), $(w.value[e]));
|
|
153
|
+
}
|
|
154
|
+
function $(e) {
|
|
155
|
+
if (K) return void (K = !1);
|
|
156
|
+
T.value = T.value === e.id ? null : e.id, E("select", e);
|
|
157
|
+
}
|
|
158
|
+
return (e, n) => (u(), i("div", {
|
|
159
|
+
ref_key: "root",
|
|
160
|
+
ref: Z,
|
|
161
|
+
class: "bless-gantt",
|
|
162
|
+
role: "group",
|
|
163
|
+
"aria-label": o.label
|
|
164
|
+
}, [a("div", g, [a("div", {
|
|
165
|
+
class: "bless-gantt__body",
|
|
166
|
+
style: l({ "--bless-gantt-label": `${o.labelWidth}px` })
|
|
167
|
+
}, [a("div", ee, [n[0] ||= a("div", {
|
|
168
|
+
class: "bless-gantt__corner",
|
|
169
|
+
style: { height: "56px" }
|
|
170
|
+
}, null, -1), (u(!0), i(t, null, f(w.value, (e) => (u(), i("div", {
|
|
171
|
+
key: e.id,
|
|
172
|
+
class: "bless-gantt__label",
|
|
173
|
+
style: l({ height: `${o.rowHeight}px` }),
|
|
174
|
+
title: e.label
|
|
175
|
+
}, p(e.label), 13, te))), 128))]), a("div", {
|
|
176
|
+
class: "bless-gantt__plot",
|
|
177
|
+
style: l({ width: `${I.value}px` })
|
|
178
|
+
}, [a("div", _, [a("div", ne, [(u(!0), i(t, null, f(ae.value, (e) => (u(), i("span", {
|
|
179
|
+
key: e.left,
|
|
180
|
+
class: "bless-gantt__month",
|
|
181
|
+
style: l({
|
|
182
|
+
left: `${e.left}px`,
|
|
183
|
+
width: `${e.width}px`
|
|
184
|
+
})
|
|
185
|
+
}, p(e.text), 5))), 128))]), B.value.length ? (u(), i("div", v, [(u(!0), i(t, null, f(B.value, (e, t) => (u(), i("span", {
|
|
186
|
+
key: t,
|
|
187
|
+
class: c(["bless-gantt__day", { "bless-gantt__day--weekend": e.weekend }]),
|
|
188
|
+
style: l({ width: `${o.dayWidth}px` })
|
|
189
|
+
}, p(e.n), 7))), 128))])) : r("", !0)]), a("div", {
|
|
190
|
+
class: "bless-gantt__rows",
|
|
191
|
+
style: l({
|
|
192
|
+
height: `${w.value.length * o.rowHeight}px`,
|
|
193
|
+
backgroundSize: `${o.dayWidth}px 100%`
|
|
194
|
+
})
|
|
195
|
+
}, [
|
|
196
|
+
H.value == null ? r("", !0) : (u(), i("span", {
|
|
197
|
+
key: 0,
|
|
198
|
+
class: "bless-gantt__today",
|
|
199
|
+
"aria-hidden": "true",
|
|
200
|
+
style: l({ left: `${H.value}px` })
|
|
201
|
+
}, null, 4)),
|
|
202
|
+
W.value.length ? (u(), i("svg", {
|
|
203
|
+
key: 1,
|
|
204
|
+
class: "bless-gantt__arrows",
|
|
205
|
+
width: I.value,
|
|
206
|
+
height: w.value.length * o.rowHeight,
|
|
207
|
+
"aria-hidden": "true"
|
|
208
|
+
}, [n[1] ||= a("defs", null, [a("marker", {
|
|
209
|
+
id: "bless-gantt-head",
|
|
210
|
+
viewBox: "0 0 8 8",
|
|
211
|
+
refX: "7",
|
|
212
|
+
refY: "4",
|
|
213
|
+
markerWidth: "7",
|
|
214
|
+
markerHeight: "7",
|
|
215
|
+
orient: "auto"
|
|
216
|
+
}, [a("path", {
|
|
217
|
+
d: "M0 0L8 4L0 8z",
|
|
218
|
+
fill: "currentColor"
|
|
219
|
+
})])], -1), (u(!0), i(t, null, f(W.value, (e, t) => (u(), i("path", {
|
|
220
|
+
key: t,
|
|
221
|
+
d: e,
|
|
222
|
+
"marker-end": "url(#bless-gantt-head)"
|
|
223
|
+
}, null, 8, y))), 128))], 8, re)) : r("", !0),
|
|
224
|
+
(u(!0), i(t, null, f(w.value, (e, n) => (u(), i("button", {
|
|
225
|
+
key: e.id,
|
|
226
|
+
type: "button",
|
|
227
|
+
class: c(["bless-gantt__bar", {
|
|
228
|
+
"bless-gantt__bar--on": T.value === e.id,
|
|
229
|
+
"bless-gantt__bar--edit": o.editable,
|
|
230
|
+
"bless-gantt__bar--drag": j.value?.id === e.id
|
|
231
|
+
}]),
|
|
232
|
+
style: l({
|
|
233
|
+
...V(e),
|
|
234
|
+
top: `${n * o.rowHeight + 6}px`,
|
|
235
|
+
height: `${o.rowHeight - 12}px`
|
|
236
|
+
}),
|
|
237
|
+
tabindex: n === Q.value ? 0 : -1,
|
|
238
|
+
"aria-label": oe(e),
|
|
239
|
+
"aria-pressed": T.value === e.id,
|
|
240
|
+
onClick: (t) => (Q.value = n, $(e)),
|
|
241
|
+
onFocus: (e) => Q.value = n,
|
|
242
|
+
onKeydown: (e) => se(n, e),
|
|
243
|
+
onPointerdown: (t) => q(e, "move", t),
|
|
244
|
+
onPointermove: J,
|
|
245
|
+
onPointerup: Y,
|
|
246
|
+
onPointercancel: Y
|
|
247
|
+
}, [o.editable ? (u(), i(t, { key: 0 }, [a("span", {
|
|
248
|
+
class: "bless-gantt__grip bless-gantt__grip--start",
|
|
249
|
+
"aria-hidden": "true",
|
|
250
|
+
onPointerdown: (t) => q(e, "start", t),
|
|
251
|
+
onPointermove: J,
|
|
252
|
+
onPointerup: Y,
|
|
253
|
+
onPointercancel: Y
|
|
254
|
+
}, null, 40, x), a("span", {
|
|
255
|
+
class: "bless-gantt__grip bless-gantt__grip--end",
|
|
256
|
+
"aria-hidden": "true",
|
|
257
|
+
onPointerdown: (t) => q(e, "end", t),
|
|
258
|
+
onPointermove: J,
|
|
259
|
+
onPointerup: Y,
|
|
260
|
+
onPointercancel: Y
|
|
261
|
+
}, null, 40, ie)], 64)) : r("", !0), e.progress == null ? r("", !0) : (u(), i("span", {
|
|
262
|
+
key: 1,
|
|
263
|
+
class: "bless-gantt__done",
|
|
264
|
+
style: l({ width: `${U(e)}%` })
|
|
265
|
+
}, null, 4))], 46, b))), 128))
|
|
266
|
+
], 4)], 4)], 4)]), a("span", S, p(G.value), 1)], 8, h));
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
//#endregion
|
|
270
|
+
export { C as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.bless-gauge{align-items:center;gap:var(--bless-space-1);width:100%;max-width:240px;font-family:var(--bless-font-sans);color:var(--bless-color-text);flex-direction:column;display:inline-flex}.bless-gauge--linear{align-items:stretch;max-width:320px}.bless-gauge__svg{width:100%;height:auto;overflow:visible}.bless-gauge__track,.bless-gauge__band{fill:none;stroke-width:14px}.bless-gauge__track{stroke:var(--bless-color-border)}.bless-gauge__band{opacity:.85}.bless-gauge__needle{stroke:var(--bless-color-text);stroke-width:5px;stroke-linecap:butt}.bless-gauge__bar{background:var(--bless-color-border);height:14px;position:relative}.bless-gauge__seg{opacity:.85;position:absolute;inset-block:0}.bless-gauge__mark{background:var(--bless-color-text);outline:1px solid var(--bless-color-bg);width:4px;position:absolute;inset-block:-4px;translate:-50%}.bless-gauge__read{flex-direction:column;align-items:center;line-height:1.2;display:flex}.bless-gauge--arc .bless-gauge__read{margin-top:calc(var(--bless-space-8) * -1)}.bless-gauge__value{font-size:var(--bless-text-xl);font-variant-numeric:tabular-nums}.bless-gauge__label{font-size:var(--bless-text-xs);color:var(--bless-color-text-muted)}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface BlessGaugeZone {
|
|
2
|
+
/** the zone runs up to this value; zones are sorted by it */
|
|
3
|
+
to: number;
|
|
4
|
+
/** a token name (`success`, `warning`, `danger`, `chart-1`…) or any CSS colour */
|
|
5
|
+
color?: string;
|
|
6
|
+
/** said after the value when the needle is in this zone: "Normal", "Too hot" */
|
|
7
|
+
label?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
11
|
+
declare const __VLS_export: import('vue').DefineComponent<{
|
|
12
|
+
value: number;
|
|
13
|
+
min?: number;
|
|
14
|
+
max?: number;
|
|
15
|
+
zones?: BlessGaugeZone[];
|
|
16
|
+
variant?: "arc" | "linear";
|
|
17
|
+
/** what is measured: names the meter for screen readers and shows under the number */
|
|
18
|
+
label?: string;
|
|
19
|
+
/** text for the value, e.g. `(v) => v + " °C"` */
|
|
20
|
+
format?: (v: number) => string;
|
|
21
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
22
|
+
value: number;
|
|
23
|
+
min?: number;
|
|
24
|
+
max?: number;
|
|
25
|
+
zones?: BlessGaugeZone[];
|
|
26
|
+
variant?: "arc" | "linear";
|
|
27
|
+
/** what is measured: names the meter for screen readers and shows under the number */
|
|
28
|
+
label?: string;
|
|
29
|
+
/** text for the value, e.g. `(v) => v + " °C"` */
|
|
30
|
+
format?: (v: number) => string;
|
|
31
|
+
}> & Readonly<{}>, {
|
|
32
|
+
label: string;
|
|
33
|
+
variant: "arc" | "linear";
|
|
34
|
+
min: number;
|
|
35
|
+
max: number;
|
|
36
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Fragment as e, computed as t, createElementBlock as n, createElementVNode as r, defineComponent as i, normalizeClass as a, normalizeStyle as o, openBlock as s, renderList as c, toDisplayString as l } from "vue";
|
|
2
|
+
//#region src/components/BlessGauge.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var u = [
|
|
4
|
+
"aria-label",
|
|
5
|
+
"aria-valuemin",
|
|
6
|
+
"aria-valuemax",
|
|
7
|
+
"aria-valuenow",
|
|
8
|
+
"aria-valuetext"
|
|
9
|
+
], d = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "bless-gauge__svg",
|
|
12
|
+
viewBox: "0 0 200 118",
|
|
13
|
+
"aria-hidden": "true"
|
|
14
|
+
}, f = ["d"], p = ["d"], m = [
|
|
15
|
+
"x1",
|
|
16
|
+
"y1",
|
|
17
|
+
"x2",
|
|
18
|
+
"y2"
|
|
19
|
+
], h = {
|
|
20
|
+
key: 1,
|
|
21
|
+
class: "bless-gauge__bar",
|
|
22
|
+
"aria-hidden": "true"
|
|
23
|
+
}, g = { class: "bless-gauge__read" }, _ = { class: "bless-gauge__value" }, v = { class: "bless-gauge__label" }, y = /*@__PURE__*/ i({
|
|
24
|
+
name: "BlessGauge",
|
|
25
|
+
__name: "BlessGauge",
|
|
26
|
+
props: {
|
|
27
|
+
value: {},
|
|
28
|
+
min: { default: 0 },
|
|
29
|
+
max: { default: 100 },
|
|
30
|
+
zones: {},
|
|
31
|
+
variant: { default: "arc" },
|
|
32
|
+
label: { default: "Gauge" },
|
|
33
|
+
format: {}
|
|
34
|
+
},
|
|
35
|
+
setup(i) {
|
|
36
|
+
let y = i, b = t(() => y.max - y.min || 1), x = (e) => Math.min(1, Math.max(0, (e - y.min) / b.value)), S = t(() => x(y.value)), C = t(() => (y.format ?? String)(y.value)), w = (e) => e ? /^[a-z0-9-]+$/i.test(e) ? `var(--bless-color-${e})` : e : "currentColor", T = t(() => {
|
|
37
|
+
let e = [...y.zones ?? []].sort((e, t) => e.to - t.to), t = 0;
|
|
38
|
+
return e.map((e) => {
|
|
39
|
+
let n = x(e.to), r = {
|
|
40
|
+
from: t,
|
|
41
|
+
to: n,
|
|
42
|
+
color: w(e.color)
|
|
43
|
+
};
|
|
44
|
+
return t = n, r;
|
|
45
|
+
});
|
|
46
|
+
}), E = t(() => {
|
|
47
|
+
let e = [...y.zones ?? []].sort((e, t) => e.to - t.to);
|
|
48
|
+
return e.find((e) => y.value <= e.to) ?? e.at(-1);
|
|
49
|
+
}), D = (e, t = 80) => ({
|
|
50
|
+
x: +(100 - t * Math.cos(e * Math.PI)).toFixed(2),
|
|
51
|
+
y: +(100 - t * Math.sin(e * Math.PI)).toFixed(2)
|
|
52
|
+
}), O = (e, t) => {
|
|
53
|
+
let n = D(e), r = D(t);
|
|
54
|
+
return `M${n.x} ${n.y}A80 80 0 0 1 ${r.x} ${r.y}`;
|
|
55
|
+
}, k = t(() => ({
|
|
56
|
+
a: D(S.value, 58),
|
|
57
|
+
b: D(S.value, 90)
|
|
58
|
+
}));
|
|
59
|
+
return (t, y) => (s(), n("div", {
|
|
60
|
+
class: a(["bless-gauge", `bless-gauge--${i.variant}`]),
|
|
61
|
+
role: "meter",
|
|
62
|
+
"aria-label": i.label,
|
|
63
|
+
"aria-valuemin": i.min,
|
|
64
|
+
"aria-valuemax": i.max,
|
|
65
|
+
"aria-valuenow": Math.min(i.max, Math.max(i.min, i.value)),
|
|
66
|
+
"aria-valuetext": E.value?.label ? `${C.value}, ${E.value.label}` : C.value
|
|
67
|
+
}, [i.variant === "arc" ? (s(), n("svg", d, [
|
|
68
|
+
r("path", {
|
|
69
|
+
class: "bless-gauge__track",
|
|
70
|
+
d: O(0, 1)
|
|
71
|
+
}, null, 8, f),
|
|
72
|
+
(s(!0), n(e, null, c(T.value, (e, t) => (s(), n("path", {
|
|
73
|
+
key: t,
|
|
74
|
+
class: "bless-gauge__band",
|
|
75
|
+
d: O(e.from, e.to),
|
|
76
|
+
style: o({ stroke: e.color })
|
|
77
|
+
}, null, 12, p))), 128)),
|
|
78
|
+
r("line", {
|
|
79
|
+
class: "bless-gauge__needle",
|
|
80
|
+
x1: k.value.a.x,
|
|
81
|
+
y1: k.value.a.y,
|
|
82
|
+
x2: k.value.b.x,
|
|
83
|
+
y2: k.value.b.y
|
|
84
|
+
}, null, 8, m)
|
|
85
|
+
])) : (s(), n("div", h, [(s(!0), n(e, null, c(T.value, (e, t) => (s(), n("span", {
|
|
86
|
+
key: t,
|
|
87
|
+
class: "bless-gauge__seg",
|
|
88
|
+
style: o({
|
|
89
|
+
left: `${e.from * 100}%`,
|
|
90
|
+
width: `${(e.to - e.from) * 100}%`,
|
|
91
|
+
background: e.color
|
|
92
|
+
})
|
|
93
|
+
}, null, 4))), 128)), r("span", {
|
|
94
|
+
class: "bless-gauge__mark",
|
|
95
|
+
style: o({ left: `${S.value * 100}%` })
|
|
96
|
+
}, null, 4)])), r("div", g, [r("strong", _, l(C.value), 1), r("span", v, l(i.label), 1)])], 10, u));
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
//#endregion
|
|
100
|
+
export { y as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.bless-heat{font-family:var(--bless-font-sans);font-size:var(--bless-text-xs);color:var(--bless-color-text-muted)}.bless-heat__scroll{padding-bottom:var(--bless-space-1);overflow-x:auto}.bless-heat__grid{--bless-heat-size:12px;grid-template-columns:auto repeat(var(--bless-heat-weeks), var(--bless-heat-size));grid-template-rows:auto repeat(7, var(--bless-heat-size));align-items:center;gap:3px;width:max-content;display:grid}.bless-heat__month,.bless-heat__weekday{white-space:nowrap;line-height:1}.bless-heat__weekday{padding-inline-end:var(--bless-space-2)}.bless-heat__cell{width:var(--bless-heat-size,12px);height:var(--bless-heat-size,12px);border:var(--bless-border-width) solid var(--bless-color-border);background:color-mix(in srgb, var(--bless-color-text) calc(var(--bless-heat-l) * 85%), var(--bless-color-surface));cursor:pointer;padding:0;display:block}.bless-heat__cell:focus-visible,.bless-heat__cell--on{outline:2px solid var(--bless-color-accent);outline-offset:1px}.bless-heat__swatch{cursor:default;display:inline-block}.bless-heat__foot{justify-content:space-between;align-items:center;gap:var(--bless-space-2);margin-top:var(--bless-space-2);flex-wrap:wrap;display:flex}.bless-heat__legend{align-items:center;gap:3px;display:inline-flex}.bless-heat__legend .bless-heat__cell{--bless-heat-size:12px}
|