blessing-ui 0.2.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.
Files changed (133) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +137 -125
  3. package/dist/blessing-ui.css +38 -2
  4. package/dist/components/BlessAnnotator.css +1 -0
  5. package/dist/components/BlessAnnotator.js +6 -0
  6. package/dist/components/BlessAnnotator.vue.d.ts +71 -0
  7. package/dist/components/BlessAnnotator.vue_vue_type_script_setup_true_lang.js +264 -0
  8. package/dist/components/BlessAttachment.vue.d.ts +4 -1
  9. package/dist/components/BlessAttachment.vue_vue_type_script_setup_true_lang.js +3 -2
  10. package/dist/components/BlessCalendar.vue.d.ts +4 -0
  11. package/dist/components/BlessCalendar.vue_vue_type_script_setup_true_lang.js +65 -60
  12. package/dist/components/BlessCarousel.vue.d.ts +3 -0
  13. package/dist/components/BlessCarousel.vue_vue_type_script_setup_true_lang.js +10 -9
  14. package/dist/components/BlessCoachmark.css +1 -0
  15. package/dist/components/BlessCoachmark.js +6 -0
  16. package/dist/components/BlessCoachmark.vue.d.ts +40 -0
  17. package/dist/components/BlessCoachmark.vue_vue_type_script_setup_true_lang.js +74 -0
  18. package/dist/components/BlessCodeBlock.vue.d.ts +10 -0
  19. package/dist/components/BlessCodeBlock.vue_vue_type_script_setup_true_lang.js +39 -33
  20. package/dist/components/BlessCombobox.vue.d.ts +2 -0
  21. package/dist/components/BlessCombobox.vue_vue_type_script_setup_true_lang.js +3 -2
  22. package/dist/components/BlessCommand.css +1 -1
  23. package/dist/components/BlessCommand.vue.d.ts +26 -0
  24. package/dist/components/BlessCommand.vue_vue_type_script_setup_true_lang.js +137 -70
  25. package/dist/components/BlessConfetti.css +1 -0
  26. package/dist/components/BlessConfetti.js +6 -0
  27. package/dist/components/BlessConfetti.vue.d.ts +40 -0
  28. package/dist/components/BlessConfetti.vue_vue_type_script_setup_true_lang.js +77 -0
  29. package/dist/components/BlessCropper.vue.d.ts +16 -0
  30. package/dist/components/BlessCropper.vue_vue_type_script_setup_true_lang.js +47 -39
  31. package/dist/components/BlessDataTable.vue.d.ts +6 -0
  32. package/dist/components/BlessDataTable.vue_vue_type_script_setup_true_lang.js +56 -42
  33. package/dist/components/BlessDataView.vue.d.ts +7 -0
  34. package/dist/components/BlessDataView.vue_vue_type_script_setup_true_lang.js +38 -31
  35. package/dist/components/BlessDatePicker.vue.d.ts +3 -0
  36. package/dist/components/BlessDatePicker.vue_vue_type_script_setup_true_lang.js +46 -45
  37. package/dist/components/BlessDock.css +1 -0
  38. package/dist/components/BlessDock.js +6 -0
  39. package/dist/components/BlessDock.vue.d.ts +55 -0
  40. package/dist/components/BlessDock.vue_vue_type_script_setup_true_lang.js +100 -0
  41. package/dist/components/BlessEditor.vue.d.ts +2 -0
  42. package/dist/components/BlessEditor.vue_vue_type_script_setup_true_lang.js +23 -22
  43. package/dist/components/BlessFileInput.vue.d.ts +2 -0
  44. package/dist/components/BlessFileInput.vue_vue_type_script_setup_true_lang.js +3 -2
  45. package/dist/components/BlessFormula.css +1 -0
  46. package/dist/components/BlessFormula.js +6 -0
  47. package/dist/components/BlessFormula.vue.d.ts +53 -0
  48. package/dist/components/BlessFormula.vue_vue_type_script_setup_true_lang.js +111 -0
  49. package/dist/components/BlessGantt.vue.d.ts +12 -0
  50. package/dist/components/BlessGantt.vue_vue_type_script_setup_true_lang.js +74 -68
  51. package/dist/components/BlessInfiniteCanvas.css +1 -0
  52. package/dist/components/BlessInfiniteCanvas.js +6 -0
  53. package/dist/components/BlessInfiniteCanvas.vue.d.ts +91 -0
  54. package/dist/components/BlessInfiniteCanvas.vue_vue_type_script_setup_true_lang.js +232 -0
  55. package/dist/components/BlessInputNumber.vue.d.ts +5 -0
  56. package/dist/components/BlessInputNumber.vue_vue_type_script_setup_true_lang.js +39 -34
  57. package/dist/components/BlessKanban.vue.d.ts +12 -0
  58. package/dist/components/BlessKanban.vue_vue_type_script_setup_true_lang.js +127 -97
  59. package/dist/components/BlessLoadingBar.vue.d.ts +2 -0
  60. package/dist/components/BlessLoadingBar.vue_vue_type_script_setup_true_lang.js +8 -3
  61. package/dist/components/BlessMarquee.vue.d.ts +4 -0
  62. package/dist/components/BlessMarquee.vue_vue_type_script_setup_true_lang.js +32 -27
  63. package/dist/components/BlessNodeGraph.css +1 -0
  64. package/dist/components/BlessNodeGraph.js +6 -0
  65. package/dist/components/BlessNodeGraph.vue.d.ts +110 -0
  66. package/dist/components/BlessNodeGraph.vue_vue_type_script_setup_true_lang.js +321 -0
  67. package/dist/components/BlessOnboardingChecklist.css +1 -0
  68. package/dist/components/BlessOnboardingChecklist.js +6 -0
  69. package/dist/components/BlessOnboardingChecklist.vue.d.ts +72 -0
  70. package/dist/components/BlessOnboardingChecklist.vue_vue_type_script_setup_true_lang.js +157 -0
  71. package/dist/components/BlessOrderList.vue.d.ts +5 -0
  72. package/dist/components/BlessOrderList.vue_vue_type_script_setup_true_lang.js +62 -56
  73. package/dist/components/BlessPagination.vue.d.ts +2 -0
  74. package/dist/components/BlessPagination.vue_vue_type_script_setup_true_lang.js +2 -1
  75. package/dist/components/BlessPickList.vue.d.ts +5 -0
  76. package/dist/components/BlessPickList.vue_vue_type_script_setup_true_lang.js +55 -49
  77. package/dist/components/BlessRangeCalendar.css +1 -0
  78. package/dist/components/BlessRangeCalendar.js +6 -0
  79. package/dist/components/BlessRangeCalendar.vue.d.ts +51 -0
  80. package/dist/components/BlessRangeCalendar.vue_vue_type_script_setup_true_lang.js +217 -0
  81. package/dist/components/BlessScheduler.css +1 -0
  82. package/dist/components/BlessScheduler.js +6 -0
  83. package/dist/components/BlessScheduler.vue.d.ts +95 -0
  84. package/dist/components/BlessScheduler.vue_vue_type_script_setup_true_lang.js +347 -0
  85. package/dist/components/BlessShortcutRecorder.vue.d.ts +10 -0
  86. package/dist/components/BlessShortcutRecorder.vue_vue_type_script_setup_true_lang.js +50 -40
  87. package/dist/components/BlessSignaturePad.vue.d.ts +1 -1
  88. package/dist/components/BlessSliderCaptcha.vue.d.ts +5 -0
  89. package/dist/components/BlessSliderCaptcha.vue_vue_type_script_setup_true_lang.js +89 -84
  90. package/dist/components/BlessSortable.css +1 -1
  91. package/dist/components/BlessSortable.vue.d.ts +19 -1
  92. package/dist/components/BlessSortable.vue_vue_type_script_setup_true_lang.js +103 -55
  93. package/dist/components/BlessSparkline.css +1 -0
  94. package/dist/components/BlessSparkline.js +6 -0
  95. package/dist/components/BlessSparkline.vue.d.ts +28 -0
  96. package/dist/components/BlessSparkline.vue_vue_type_script_setup_true_lang.js +107 -0
  97. package/dist/components/BlessSteps.vue.d.ts +2 -0
  98. package/dist/components/BlessSteps.vue_vue_type_script_setup_true_lang.js +3 -2
  99. package/dist/components/BlessSwipeDeck.vue.d.ts +1 -1
  100. package/dist/components/BlessSwipeDeck.vue_vue_type_script_setup_true_lang.js +2 -1
  101. package/dist/components/BlessTimer.vue.d.ts +18 -0
  102. package/dist/components/BlessTimer.vue_vue_type_script_setup_true_lang.js +52 -43
  103. package/dist/components/BlessTour.vue.d.ts +1 -0
  104. package/dist/components/BlessTour.vue_vue_type_script_setup_true_lang.js +48 -42
  105. package/dist/components/BlessTreemap.css +1 -0
  106. package/dist/components/BlessTreemap.js +6 -0
  107. package/dist/components/BlessTreemap.vue.d.ts +46 -0
  108. package/dist/components/BlessTreemap.vue_vue_type_script_setup_true_lang.js +137 -0
  109. package/dist/components/BlessUploader.vue.d.ts +11 -0
  110. package/dist/components/BlessUploader.vue_vue_type_script_setup_true_lang.js +80 -69
  111. package/dist/composables/annotate.d.ts +35 -0
  112. package/dist/composables/annotate.js +33 -0
  113. package/dist/composables/canvasView.d.ts +21 -0
  114. package/dist/composables/canvasView.js +23 -0
  115. package/dist/composables/confetti.d.ts +32 -0
  116. package/dist/composables/confetti.js +23 -0
  117. package/dist/composables/dayBlocks.d.ts +11 -0
  118. package/dist/composables/dayBlocks.js +26 -0
  119. package/dist/composables/formula.d.ts +28 -0
  120. package/dist/composables/formula.js +161 -0
  121. package/dist/composables/graph.d.ts +19 -0
  122. package/dist/composables/graph.js +16 -0
  123. package/dist/composables/schedule.d.ts +27 -0
  124. package/dist/composables/schedule.js +54 -0
  125. package/dist/composables/treemap.d.ts +23 -0
  126. package/dist/composables/treemap.js +77 -0
  127. package/dist/composables/useAutoScroll.d.ts +15 -0
  128. package/dist/composables/useAutoScroll.js +32 -0
  129. package/dist/composables/useSortable.d.ts +42 -2
  130. package/dist/composables/useSortable.js +87 -14
  131. package/dist/index.d.ts +25 -1
  132. package/dist/index.js +78 -63
  133. package/package.json +4 -2
@@ -1,165 +1,195 @@
1
1
  import { logicalKey as e } from "../composables/rtl.js";
2
- import { Fragment as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, defineComponent as o, mergeModels as s, nextTick as c, normalizeClass as l, openBlock as u, ref as d, renderList as f, renderSlot as p, toDisplayString as m, useId as h, useModel as g } from "vue";
2
+ import { useAutoScroll as t } from "../composables/useAutoScroll.js";
3
+ import { Fragment as n, computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, defineComponent as c, mergeModels as l, nextTick as u, normalizeClass as d, onBeforeUnmount as f, openBlock as p, ref as m, renderList as h, renderSlot as g, toDisplayString as _, useId as v, useModel as y } from "vue";
3
4
  //#region src/components/BlessKanban.vue?vue&type=script&setup=true&lang.ts
4
- var _ = ["aria-label"], v = ["data-kanban-col", "aria-label"], y = { class: "bless-kanban__head" }, b = { class: "bless-kanban__title" }, x = { class: "bless-kanban__count" }, S = [
5
+ var b = ["aria-label"], x = ["data-kanban-col", "aria-label"], S = { class: "bless-kanban__head" }, C = { class: "bless-kanban__title" }, w = { class: "bless-kanban__count" }, T = [
5
6
  "data-grip",
6
7
  "aria-label",
8
+ "aria-roledescription",
7
9
  "aria-pressed",
8
10
  "onPointerdown",
9
11
  "onKeydown"
10
- ], C = { class: "bless-kanban__body" }, w = {
12
+ ], E = { class: "bless-kanban__body" }, D = {
11
13
  class: "bless-kanban__live",
12
14
  "aria-live": "polite"
13
- }, T = /*@__PURE__*/ o({
15
+ }, O = /*@__PURE__*/ c({
14
16
  name: "BlessKanban",
15
17
  __name: "BlessKanban",
16
- props: /*@__PURE__*/ s({
18
+ props: /*@__PURE__*/ l({
17
19
  rowKey: { type: Function },
18
- label: {}
20
+ label: {},
21
+ labels: {}
19
22
  }, {
20
23
  modelValue: { default: () => [] },
21
24
  modelModifiers: {}
22
25
  }),
23
- emits: /*@__PURE__*/ s(["move"], ["update:modelValue"]),
24
- setup(o, { emit: s }) {
25
- let T = g(o, "modelValue"), E = s, D = d(), O = d(""), k = `${h()}-hint`, A = d(null), j = d(null), M = d(null), N = [], P = {
26
+ emits: /*@__PURE__*/ l(["move"], ["update:modelValue"]),
27
+ setup(c, { emit: l }) {
28
+ let O = c, k = r(() => ({
29
+ card: (e, t) => `Move card ${e} of ${t}`,
30
+ moved: (e, t, n) => `Moved to ${e}, position ${t} of ${n}`,
31
+ position: (e, t, n) => `${e}, position ${t} of ${n}`,
32
+ dropped: (e, t) => `Dropped in ${e}, position ${t}`,
33
+ full: (e) => `${e} is full`,
34
+ grabbed: "Grabbed. Up and down move it in the column, left and right to another column, Space drops it, Escape cancels.",
35
+ cancelled: "Cancelled, order restored",
36
+ hint: "Press Space to grab a card. Up and down move it in its column, left and right to another column. Space drops it, Escape cancels.",
37
+ roleDescription: "sortable card",
38
+ ...O.labels
39
+ })), A = y(c, "modelValue"), j = l, M = m(), N = m(""), P = `${v()}-hint`, F = m(null), I = m(null), L = m(null), R = [], z = {
26
40
  col: 0,
27
41
  index: 0
28
- }, F = (e, t) => {
29
- let n = T.value[e];
42
+ }, B = (e, t) => {
43
+ let n = A.value[e];
30
44
  return e !== t && n.limit != null && n.items.length >= n.limit;
31
45
  };
32
- function I(e, t, n, r) {
33
- let i = T.value.map((e) => ({
46
+ function V(e, t, n, r) {
47
+ let i = A.value.map((e) => ({
34
48
  ...e,
35
49
  items: e.items.slice()
36
50
  })), [a] = i[e].items.splice(t, 1);
37
- i[n].items.splice(r, 0, a), T.value = i, E("move", a, {
38
- column: T.value[e].id,
51
+ i[n].items.splice(r, 0, a), A.value = i, j("move", a, {
52
+ column: A.value[e].id,
39
53
  index: t
40
54
  }, {
41
- column: T.value[n].id,
55
+ column: A.value[n].id,
42
56
  index: r
43
57
  });
44
58
  }
45
- function L(e, t) {
59
+ function H(e, t) {
46
60
  for (let n of document.elementsFromPoint(e, t)) {
47
61
  let e = n.closest?.("[data-kanban-col]");
48
- if (e && D.value?.contains(e)) return e;
62
+ if (e && M.value?.contains(e)) return e;
49
63
  }
50
64
  return null;
51
65
  }
52
- function R(e) {
53
- if (!A.value) return;
54
- let t = L(e.clientX, e.clientY);
55
- if (!t) return void (j.value = null);
56
- let n = Number(t.dataset.kanbanCol);
57
- if (F(n, A.value.col)) return void (j.value = null);
58
- let r = Array.from(t.querySelectorAll("[data-kanban-card]")).filter((t) => {
59
- let n = t.getBoundingClientRect();
60
- return n.top + n.height / 2 < e.clientY;
66
+ let U = {
67
+ x: 0,
68
+ y: 0
69
+ }, W = t(() => M.value, () => K(U.x, U.y));
70
+ f(W.stop);
71
+ function G(e) {
72
+ U = {
73
+ x: e.clientX,
74
+ y: e.clientY
75
+ }, W.point(e.clientX, e.clientY), K(e.clientX, e.clientY);
76
+ }
77
+ function K(e, t) {
78
+ if (!F.value) return;
79
+ let n = H(e, t);
80
+ if (!n) return void (I.value = null);
81
+ let r = Number(n.dataset.kanbanCol);
82
+ if (B(r, F.value.col)) return void (I.value = null);
83
+ let i = Array.from(n.querySelectorAll("[data-kanban-card]")).filter((e) => {
84
+ let n = e.getBoundingClientRect();
85
+ return n.top + n.height / 2 < t;
61
86
  }).length;
62
- j.value = {
63
- col: n,
64
- index: r
87
+ I.value = {
88
+ col: r,
89
+ index: i
65
90
  };
66
91
  }
67
- function z(e, t, n) {
68
- n.button || (n.currentTarget.setPointerCapture?.(n.pointerId), A.value = {
92
+ function q(e, t, n) {
93
+ n.button || (n.currentTarget.setPointerCapture?.(n.pointerId), F.value = {
69
94
  col: e,
70
95
  index: t
71
- }, j.value = {
96
+ }, I.value = {
72
97
  col: e,
73
98
  index: t
74
- });
99
+ }, U = {
100
+ x: n.clientX,
101
+ y: n.clientY
102
+ }, W.point(n.clientX, n.clientY), W.start());
75
103
  }
76
- function B() {
77
- let e = A.value, t = j.value;
78
- if (A.value = j.value = null, !e || !t) return;
104
+ function J() {
105
+ let e = F.value, t = I.value;
106
+ if (W.stop(), F.value = I.value = null, !e || !t) return;
79
107
  let n = t.col === e.col && t.index > e.index ? t.index - 1 : t.index;
80
- (t.col !== e.col || n !== e.index) && (I(e.col, e.index, t.col, n), O.value = `Moved to ${T.value[t.col].title}, position ${n + 1} of ${T.value[t.col].items.length}`);
108
+ (t.col !== e.col || n !== e.index) && (V(e.col, e.index, t.col, n), N.value = k.value.moved(A.value[t.col].title, n + 1, A.value[t.col].items.length));
81
109
  }
82
- let V = () => A.value = j.value = null, H = (e, t) => c(() => D.value?.querySelector(`[data-grip="${e}:${t}"]`)?.focus());
83
- function U(e, t, n, r) {
84
- let i = T.value.length;
110
+ let Y = () => {
111
+ W.stop(), F.value = I.value = null;
112
+ }, X = (e, t) => u(() => M.value?.querySelector(`[data-grip="${e}:${t}"]`)?.focus());
113
+ function Z(e, t, n, r) {
114
+ let i = A.value.length;
85
115
  if (n < 0 || n >= i) return;
86
- if (F(n, e)) {
87
- O.value = `${T.value[n].title} is full`;
116
+ if (B(n, e)) {
117
+ N.value = k.value.full(A.value[n].title);
88
118
  return;
89
119
  }
90
- let a = T.value[n].items.length - +(n === e);
91
- r = Math.min(Math.max(r, 0), a), (n !== e || r !== t) && (I(e, t, n, r), M.value = {
120
+ let a = A.value[n].items.length - +(n === e);
121
+ r = Math.min(Math.max(r, 0), a), (n !== e || r !== t) && (V(e, t, n, r), L.value = {
92
122
  col: n,
93
123
  index: r
94
- }, O.value = `${T.value[n].title}, position ${r + 1} of ${T.value[n].items.length}`, H(n, r));
124
+ }, N.value = k.value.position(A.value[n].title, r + 1, A.value[n].items.length), X(n, r));
95
125
  }
96
- function W(t, n, r) {
97
- let i = e(r), a = M.value;
98
- r.key === " " || r.key === "Enter" ? (r.preventDefault(), a ? (M.value = null, O.value = `Dropped in ${T.value[t].title}, position ${n + 1}`) : (M.value = {
126
+ function Q(t, n, r) {
127
+ let i = e(r), a = L.value;
128
+ r.key === " " || r.key === "Enter" ? (r.preventDefault(), a ? (L.value = null, N.value = k.value.dropped(A.value[t].title, n + 1)) : (L.value = {
99
129
  col: t,
100
130
  index: n
101
- }, P = {
131
+ }, z = {
102
132
  col: t,
103
133
  index: n
104
- }, N = T.value.map((e) => ({
134
+ }, R = A.value.map((e) => ({
105
135
  ...e,
106
136
  items: e.items.slice()
107
- })), O.value = "Grabbed. Up and down move it in the column, left and right to another column, Space drops it, Escape cancels.")) : r.key === "Escape" && a ? (r.preventDefault(), T.value = N, M.value = null, O.value = "Cancelled, order restored", H(P.col, P.index)) : a && (i === "ArrowUp" ? (r.preventDefault(), U(t, n, t, n - 1)) : i === "ArrowDown" ? (r.preventDefault(), U(t, n, t, n + 1)) : i === "ArrowLeft" ? (r.preventDefault(), U(t, n, t - 1, n)) : i === "ArrowRight" && (r.preventDefault(), U(t, n, t + 1, n)));
137
+ })), N.value = k.value.grabbed)) : r.key === "Escape" && a ? (r.preventDefault(), A.value = R, L.value = null, N.value = k.value.cancelled, X(z.col, z.index)) : a && (i === "ArrowUp" ? (r.preventDefault(), Z(t, n, t, n - 1)) : i === "ArrowDown" ? (r.preventDefault(), Z(t, n, t, n + 1)) : i === "ArrowLeft" ? (r.preventDefault(), Z(t, n, t - 1, n)) : i === "ArrowRight" && (r.preventDefault(), Z(t, n, t + 1, n)));
108
138
  }
109
- let G = () => requestAnimationFrame(() => {
110
- M.value && !D.value?.contains(document.activeElement) && (M.value = null);
111
- }), K = (e, t) => {
112
- let n = j.value;
113
- return !n || n.col !== e || !A.value ? null : n.index === t ? "before" : null;
114
- }, q = (e) => j.value?.col === e && A.value && j.value.index >= T.value[e].items.length;
115
- return (e, s) => (u(), r("div", {
139
+ let ee = () => requestAnimationFrame(() => {
140
+ L.value && !M.value?.contains(document.activeElement) && (L.value = null);
141
+ }), $ = (e, t) => {
142
+ let n = I.value;
143
+ return !n || n.col !== e || !F.value ? null : n.index === t ? "before" : null;
144
+ }, te = (e) => I.value?.col === e && F.value && I.value.index >= A.value[e].items.length;
145
+ return (e, t) => (p(), a("div", {
116
146
  ref_key: "root",
117
- ref: D,
147
+ ref: M,
118
148
  class: "bless-kanban",
119
149
  role: "group",
120
- "aria-label": o.label ?? "Board"
150
+ "aria-label": c.label ?? "Board"
121
151
  }, [
122
- (u(!0), r(t, null, f(T.value, (c, d) => (u(), r("section", {
123
- key: c.id,
124
- class: l(["bless-kanban__col", { "bless-kanban__col--full": c.limit != null && c.items.length >= c.limit }]),
125
- "data-kanban-col": d,
126
- "aria-label": c.title
127
- }, [i("header", y, [p(e.$slots, "header", { column: c }, () => [i("h3", b, m(c.title), 1)]), i("span", x, [a(m(c.items.length), 1), c.limit == null ? n("", !0) : (u(), r(t, { key: 0 }, [a(" / " + m(c.limit), 1)], 64))])]), i("ul", {
128
- class: l(["bless-kanban__list", { "bless-kanban__list--end": q(d) }]),
152
+ (p(!0), a(n, null, h(A.value, (r, l) => (p(), a("section", {
153
+ key: r.id,
154
+ class: d(["bless-kanban__col", { "bless-kanban__col--full": r.limit != null && r.items.length >= r.limit }]),
155
+ "data-kanban-col": l,
156
+ "aria-label": r.title
157
+ }, [o("header", S, [g(e.$slots, "header", { column: r }, () => [o("h3", C, _(r.title), 1)]), o("span", w, [s(_(r.items.length), 1), r.limit == null ? i("", !0) : (p(), a(n, { key: 0 }, [s(" / " + _(r.limit), 1)], 64))])]), o("ul", {
158
+ class: d(["bless-kanban__list", { "bless-kanban__list--end": te(l) }]),
129
159
  role: "list"
130
- }, [(u(!0), r(t, null, f(c.items, (t, n) => (u(), r("li", {
131
- key: o.rowKey ? o.rowKey(t) : n,
160
+ }, [(p(!0), a(n, null, h(r.items, (n, i) => (p(), a("li", {
161
+ key: c.rowKey ? c.rowKey(n) : i,
132
162
  "data-kanban-card": "",
133
- class: l(["bless-kanban__card", [{
134
- "bless-kanban__card--drag": A.value?.col === d && A.value.index === n,
135
- "bless-kanban__card--held": M.value?.col === d && M.value.index === n
136
- }, K(d, n) && `bless-kanban__card--${K(d, n)}`]])
137
- }, [i("button", {
163
+ class: d(["bless-kanban__card", [{
164
+ "bless-kanban__card--drag": F.value?.col === l && F.value.index === i,
165
+ "bless-kanban__card--held": L.value?.col === l && L.value.index === i
166
+ }, $(l, i) && `bless-kanban__card--${$(l, i)}`]])
167
+ }, [o("button", {
138
168
  type: "button",
139
169
  class: "bless-kanban__grip",
140
- "data-grip": `${d}:${n}`,
141
- "aria-label": `Move card ${n + 1} of ${c.title}`,
142
- "aria-roledescription": "sortable card",
143
- "aria-pressed": M.value?.col === d && M.value.index === n,
144
- "aria-describedby": k,
145
- onPointerdown: (e) => z(d, n, e),
146
- onPointermove: R,
147
- onPointerup: B,
148
- onPointercancel: V,
149
- onKeydown: (e) => W(d, n, e),
150
- onBlur: G
151
- }, [...s[0] ||= [i("span", { "aria-hidden": "true" }, "⋮⋮", -1)]], 40, S), i("div", C, [p(e.$slots, "card", {
152
- item: t,
153
- column: c,
154
- index: n
155
- }, () => [a(m(t), 1)])])], 2))), 128))], 2)], 10, v))), 128)),
156
- i("span", {
157
- id: k,
170
+ "data-grip": `${l}:${i}`,
171
+ "aria-label": k.value.card(i + 1, r.title),
172
+ "aria-roledescription": k.value.roleDescription,
173
+ "aria-pressed": L.value?.col === l && L.value.index === i,
174
+ "aria-describedby": P,
175
+ onPointerdown: (e) => q(l, i, e),
176
+ onPointermove: G,
177
+ onPointerup: J,
178
+ onPointercancel: Y,
179
+ onKeydown: (e) => Q(l, i, e),
180
+ onBlur: ee
181
+ }, [...t[0] ||= [o("span", { "aria-hidden": "true" }, "⋮⋮", -1)]], 40, T), o("div", E, [g(e.$slots, "card", {
182
+ item: n,
183
+ column: r,
184
+ index: i
185
+ }, () => [s(_(n), 1)])])], 2))), 128))], 2)], 10, x))), 128)),
186
+ o("span", {
187
+ id: P,
158
188
  hidden: ""
159
- }, "Press Space to grab a card. Up and down move it in its column, left and right to another column. Space drops it, Escape cancels."),
160
- i("span", w, m(O.value), 1)
161
- ], 8, _));
189
+ }, _(k.value.hint), 1),
190
+ o("span", D, _(N.value), 1)
191
+ ], 8, b));
162
192
  }
163
193
  });
164
194
  //#endregion
165
- export { T as default };
195
+ export { O as default };
@@ -2,9 +2,11 @@ type __VLS_Props = {
2
2
  height?: string;
3
3
  position?: "top" | "bottom";
4
4
  color?: "accent" | "text";
5
+ label?: string;
5
6
  };
6
7
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
7
8
  color: "accent" | "text";
9
+ label: string;
8
10
  position: "top" | "bottom";
9
11
  height: string;
10
12
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -1,13 +1,18 @@
1
1
  import { loadingBarState as e, useLoadingBar as t } from "../composables/useLoadingBar.js";
2
2
  import { createElementBlock as n, createElementVNode as r, defineComponent as i, normalizeClass as a, normalizeStyle as o, openBlock as s, unref as c } from "vue";
3
3
  //#region src/components/BlessLoadingBar.vue?vue&type=script&setup=true&lang.ts
4
- var l = ["aria-valuenow", "aria-hidden"], u = /*@__PURE__*/ i({
4
+ var l = [
5
+ "aria-valuenow",
6
+ "aria-label",
7
+ "aria-hidden"
8
+ ], u = /*@__PURE__*/ i({
5
9
  name: "BlessLoadingBar",
6
10
  __name: "BlessLoadingBar",
7
11
  props: {
8
12
  height: { default: "3px" },
9
13
  position: { default: "top" },
10
- color: { default: "accent" }
14
+ color: { default: "accent" },
15
+ label: { default: "Loading" }
11
16
  },
12
17
  setup(i) {
13
18
  return t(), (t, u) => (s(), n("div", {
@@ -24,7 +29,7 @@ var l = ["aria-valuenow", "aria-hidden"], u = /*@__PURE__*/ i({
24
29
  "aria-valuenow": c(e).active ? Math.round(c(e).progress) : void 0,
25
30
  "aria-valuemin": "0",
26
31
  "aria-valuemax": "100",
27
- "aria-label": "Loading",
32
+ "aria-label": i.label,
28
33
  "aria-hidden": c(e).active ? void 0 : "true"
29
34
  }, [...u[0] ||= [r("span", { class: "bless-loadingbar__bar" }, null, -1)]], 14, l));
30
35
  }
@@ -8,6 +8,10 @@ type __VLS_Props = {
8
8
  /** show the Pause button (needed when it moves for more than five seconds, WCAG 2.2.2) */
9
9
  controls?: boolean;
10
10
  label?: string;
11
+ labels?: Partial<{
12
+ play: string;
13
+ pause: string;
14
+ }>;
11
15
  };
12
16
  type __VLS_ModelProps = {
13
17
  /** true while paused by the button */
@@ -1,14 +1,14 @@
1
1
  import { reducedMotion as e } from "../composables/useMedia.js";
2
- import { createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, mergeModels as a, normalizeClass as o, normalizeStyle as s, onBeforeUnmount as c, onMounted as l, openBlock as u, ref as d, renderSlot as f, toDisplayString as p, useModel as m } from "vue";
2
+ import { computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, mergeModels as o, normalizeClass as s, normalizeStyle as c, onBeforeUnmount as l, onMounted as u, openBlock as d, ref as f, renderSlot as p, toDisplayString as m, useModel as h } from "vue";
3
3
  //#region src/components/BlessMarquee.vue?vue&type=script&setup=true&lang.ts
4
- var h = ["aria-label"], g = { class: "bless-marquee__viewport" }, _ = { class: "bless-marquee__track" }, v = {
4
+ var g = ["aria-label"], _ = { class: "bless-marquee__viewport" }, v = { class: "bless-marquee__track" }, y = {
5
5
  class: "bless-marquee__run",
6
6
  "aria-hidden": "true",
7
7
  inert: ""
8
- }, y = ["aria-pressed"], b = /*@__PURE__*/ i({
8
+ }, b = ["aria-pressed"], x = /*@__PURE__*/ a({
9
9
  name: "BlessMarquee",
10
10
  __name: "BlessMarquee",
11
- props: /*@__PURE__*/ a({
11
+ props: /*@__PURE__*/ o({
12
12
  speed: { default: 40 },
13
13
  reverse: { type: Boolean },
14
14
  pauseOnHover: {
@@ -19,7 +19,8 @@ var h = ["aria-label"], g = { class: "bless-marquee__viewport" }, _ = { class: "
19
19
  type: Boolean,
20
20
  default: !0
21
21
  },
22
- label: { default: "Scrolling items" }
22
+ label: { default: "Scrolling items" },
23
+ labels: {}
23
24
  }, {
24
25
  paused: {
25
26
  type: Boolean,
@@ -28,37 +29,41 @@ var h = ["aria-label"], g = { class: "bless-marquee__viewport" }, _ = { class: "
28
29
  pausedModifiers: {}
29
30
  }),
30
31
  emits: ["update:paused"],
31
- setup(i) {
32
- let a = i, b = m(i, "paused"), x = d(), S = d(!1), C = d(20), w;
33
- function T() {
34
- let e = x.value?.scrollWidth ?? 0;
35
- C.value = e && a.speed > 0 ? e / a.speed : 20;
32
+ setup(a) {
33
+ let o = a, x = t(() => ({
34
+ play: "Play",
35
+ pause: "Pause",
36
+ ...o.labels
37
+ })), S = h(a, "paused"), C = f(), w = f(!1), T = f(20), E;
38
+ function D() {
39
+ let e = C.value?.scrollWidth ?? 0;
40
+ T.value = e && o.speed > 0 ? e / o.speed : 20;
36
41
  }
37
- return l(() => {
38
- S.value = e(), T(), typeof ResizeObserver < "u" && x.value && (w = new ResizeObserver(T), w.observe(x.value));
39
- }), c(() => w?.disconnect()), (e, a) => (u(), n("div", {
40
- class: o(["bless-marquee", {
41
- "bless-marquee--paused": b.value,
42
- "bless-marquee--hover": i.pauseOnHover,
43
- "bless-marquee--still": S.value,
44
- "bless-marquee--reverse": i.reverse
42
+ return u(() => {
43
+ w.value = e(), D(), typeof ResizeObserver < "u" && C.value && (E = new ResizeObserver(D), E.observe(C.value));
44
+ }), l(() => E?.disconnect()), (e, t) => (d(), r("div", {
45
+ class: s(["bless-marquee", {
46
+ "bless-marquee--paused": S.value,
47
+ "bless-marquee--hover": a.pauseOnHover,
48
+ "bless-marquee--still": w.value,
49
+ "bless-marquee--reverse": a.reverse
45
50
  }]),
46
51
  role: "group",
47
52
  "aria-roledescription": "marquee",
48
- "aria-label": i.label,
49
- style: s({ "--bless-marquee-time": `${C.value}s` })
50
- }, [r("div", g, [r("div", _, [r("div", {
53
+ "aria-label": a.label,
54
+ style: c({ "--bless-marquee-time": `${T.value}s` })
55
+ }, [i("div", _, [i("div", v, [i("div", {
51
56
  ref_key: "run",
52
- ref: x,
57
+ ref: C,
53
58
  class: "bless-marquee__run"
54
- }, [f(e.$slots, "default")], 512), r("div", v, [f(e.$slots, "default")])])]), i.controls && !S.value ? (u(), n("button", {
59
+ }, [p(e.$slots, "default")], 512), i("div", y, [p(e.$slots, "default")])])]), a.controls && !w.value ? (d(), r("button", {
55
60
  key: 0,
56
61
  type: "button",
57
62
  class: "bless-marquee__btn",
58
- "aria-pressed": b.value,
59
- onClick: a[0] ||= (e) => b.value = !b.value
60
- }, p(b.value ? "Play" : "Pause"), 9, y)) : t("", !0)], 14, h));
63
+ "aria-pressed": S.value,
64
+ onClick: t[0] ||= (e) => S.value = !S.value
65
+ }, m(S.value ? x.value.play : x.value.pause), 9, b)) : n("", !0)], 14, g));
61
66
  }
62
67
  });
63
68
  //#endregion
64
- export { b as default };
69
+ export { x as default };
@@ -0,0 +1 @@
1
+ .bless-graph{flex-direction:column;width:100%;display:flex;position:relative}.bless-graph>.bless-canvas{flex:1}.bless-graph__edges{pointer-events:none;width:1px;height:1px;position:absolute;top:0;left:0;overflow:visible}.bless-graph__edge{fill:none;stroke:var(--bless-color-text-muted);stroke-width:2px}.bless-graph__edge--sel{stroke:var(--bless-color-accent);stroke-width:3px}.bless-graph__edge--preview{stroke:var(--bless-color-accent);stroke-dasharray:6 4}.bless-graph__arrow{fill:var(--bless-color-text-muted)}.bless-graph__edge-hit{fill:none;stroke:#0000;stroke-width:14px;pointer-events:stroke;cursor:pointer}.bless-graph__node{box-sizing:border-box;padding:0 var(--bless-space-3);background:var(--bless-color-bg);border:var(--bless-border-width) solid var(--bless-color-border);cursor:grab;touch-action:none;justify-content:center;align-items:center;display:flex;position:absolute}.bless-graph__node:focus-visible{outline:2px solid var(--bless-color-accent);outline-offset:2px}.bless-graph__node--sel{border-color:var(--bless-color-accent)}.bless-graph__node--target{outline:2px dashed var(--bless-color-accent);outline-offset:2px}.bless-graph__node--drag{cursor:grabbing}.bless-graph__label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.bless-graph__port{background:var(--bless-color-surface);border:var(--bless-border-width) solid var(--bless-color-text-muted);width:12px;height:12px;margin-top:-6px;position:absolute;top:50%}.bless-graph__port--in{left:-7px}.bless-graph__port--out{cursor:crosshair;touch-action:none;right:-7px}.bless-graph__port--out:hover{border-color:var(--bless-color-accent)}.bless-graph__live{clip-path:inset(50%);width:1px;height:1px;position:absolute;overflow:hidden}
@@ -0,0 +1,6 @@
1
+ import "./BlessNodeGraph.css";
2
+ import e from "./BlessNodeGraph.vue_vue_type_script_setup_true_lang.js";
3
+ //#region src/components/BlessNodeGraph.vue
4
+ var t = e;
5
+ //#endregion
6
+ export { t as default };
@@ -0,0 +1,110 @@
1
+ import { CanvasView } from './BlessInfiniteCanvas.vue';
2
+ import { GraphEdge as Edge } from '../composables/graph';
3
+ export interface BlessGraphNode {
4
+ id: string;
5
+ x: number;
6
+ y: number;
7
+ label: string;
8
+ }
9
+ export type { GraphEdge as BlessGraphEdge } from '../composables/graph';
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
12
+ declare const __VLS_export: __VLS_WithSlots<import('vue').DefineComponent<{
13
+ /** size used for ports and links; put content that fits it in the `#node` slot */
14
+ nodeWidth?: number;
15
+ nodeHeight?: number;
16
+ /** snap dragged nodes to this grid, px; 0 is free */
17
+ snap?: number;
18
+ /** refuse a link that would close a loop */
19
+ acyclic?: boolean;
20
+ /** off: nodes can be selected and the view moved, nothing is dragged, linked or removed */
21
+ editable?: boolean;
22
+ grid?: boolean;
23
+ controls?: boolean;
24
+ minZoom?: number;
25
+ maxZoom?: number;
26
+ label?: string;
27
+ labels?: Partial<{
28
+ node: (label: string, to: string[], from: string[]) => string;
29
+ linkFrom: (from: string) => string;
30
+ linkTo: (from: string, to: string, exists: boolean) => string;
31
+ linked: (from: string, to: string) => string;
32
+ unlinked: (from: string, to: string) => string;
33
+ refused: (from: string, to: string, why: "self" | "exists" | "cycle") => string;
34
+ cancelled: string;
35
+ removed: (label: string) => string;
36
+ hint: string;
37
+ }>;
38
+ } & {
39
+ nodes?: BlessGraphNode[];
40
+ edges?: Edge[];
41
+ selected?: string | null;
42
+ view?: CanvasView;
43
+ }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
44
+ disconnect: (edge: Edge) => any;
45
+ remove: (id: string) => any;
46
+ "update:selected": (value: string | null) => any;
47
+ move: (id: string, x: number, y: number) => any;
48
+ "update:view": (value: CanvasView) => any;
49
+ "update:nodes": (value: BlessGraphNode[]) => any;
50
+ "update:edges": (value: Edge[]) => any;
51
+ connect: (edge: Edge) => any;
52
+ }, string, import('vue').PublicProps, Readonly<{
53
+ /** size used for ports and links; put content that fits it in the `#node` slot */
54
+ nodeWidth?: number;
55
+ nodeHeight?: number;
56
+ /** snap dragged nodes to this grid, px; 0 is free */
57
+ snap?: number;
58
+ /** refuse a link that would close a loop */
59
+ acyclic?: boolean;
60
+ /** off: nodes can be selected and the view moved, nothing is dragged, linked or removed */
61
+ editable?: boolean;
62
+ grid?: boolean;
63
+ controls?: boolean;
64
+ minZoom?: number;
65
+ maxZoom?: number;
66
+ label?: string;
67
+ labels?: Partial<{
68
+ node: (label: string, to: string[], from: string[]) => string;
69
+ linkFrom: (from: string) => string;
70
+ linkTo: (from: string, to: string, exists: boolean) => string;
71
+ linked: (from: string, to: string) => string;
72
+ unlinked: (from: string, to: string) => string;
73
+ refused: (from: string, to: string, why: "self" | "exists" | "cycle") => string;
74
+ cancelled: string;
75
+ removed: (label: string) => string;
76
+ hint: string;
77
+ }>;
78
+ } & {
79
+ nodes?: BlessGraphNode[];
80
+ edges?: Edge[];
81
+ selected?: string | null;
82
+ view?: CanvasView;
83
+ }> & Readonly<{
84
+ onDisconnect?: ((edge: Edge) => any) | undefined;
85
+ onRemove?: ((id: string) => any) | undefined;
86
+ "onUpdate:selected"?: ((value: string | null) => any) | undefined;
87
+ onMove?: ((id: string, x: number, y: number) => any) | undefined;
88
+ "onUpdate:view"?: ((value: CanvasView) => any) | undefined;
89
+ "onUpdate:nodes"?: ((value: BlessGraphNode[]) => any) | undefined;
90
+ "onUpdate:edges"?: ((value: Edge[]) => any) | undefined;
91
+ onConnect?: ((edge: Edge) => any) | undefined;
92
+ }>, {
93
+ label: string;
94
+ grid: boolean;
95
+ controls: boolean;
96
+ editable: boolean;
97
+ nodeWidth: number;
98
+ nodeHeight: number;
99
+ snap: number;
100
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
101
+ node?: (props: {
102
+ node: BlessGraphNode;
103
+ selected: boolean;
104
+ }) => any;
105
+ }>;
106
+ type __VLS_WithSlots<T, S> = T & {
107
+ new (): {
108
+ $slots: S;
109
+ };
110
+ };