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
@@ -25,28 +25,38 @@ var v = [
25
25
  allowBare: { type: Boolean },
26
26
  disabled: { type: Boolean },
27
27
  label: { default: "Shortcut" },
28
- placeholder: { default: "Not set" }
28
+ placeholder: { default: "Not set" },
29
+ labels: {}
29
30
  }, {
30
31
  modelValue: { default: "" },
31
32
  modelModifiers: {}
32
33
  }),
33
34
  emits: /*@__PURE__*/ u(["conflict"], ["update:modelValue"]),
34
35
  setup(l, { expose: u, emit: C }) {
35
- let w = l, T = _(l, "modelValue"), E = C, D = g(), O = p(!1), k = p(""), A = p(""), j = p(""), M = p(), N = (e) => Array.isArray(w.taken) ? w.taken.includes(e) ? "" : void 0 : w.taken?.[e], P = i(() => O.value ? k.value : T.value), F = i(() => P.value ? r(P.value) : []);
36
- function I() {
37
- w.disabled || (O.value = !0, k.value = "", A.value = "", j.value = "Recording. Press the keys you want. Escape cancels, Backspace clears.");
36
+ let w = l, T = i(() => ({
37
+ button: (e, t) => `${e}: ${t || "not set"}. Press Enter to change.`,
38
+ pressKeys: "Press keys…",
39
+ recording: "Recording. Press the keys you want. Escape cancels, Backspace clears.",
40
+ set: (e) => `Set to ${e}`,
41
+ needsModifier: (e) => `Add Ctrl, Alt or Meta to ${e}`,
42
+ usedBy: (e, t) => `${e} is already used by ${t}`,
43
+ taken: (e) => `${e} is already taken`,
44
+ ...w.labels
45
+ })), E = _(l, "modelValue"), D = C, O = g(), k = p(!1), A = p(""), j = p(""), M = p(""), N = p(), P = (e) => Array.isArray(w.taken) ? w.taken.includes(e) ? "" : void 0 : w.taken?.[e], F = i(() => k.value ? A.value : E.value), I = i(() => F.value ? r(F.value) : []);
46
+ function L() {
47
+ w.disabled || (k.value = !0, A.value = "", j.value = "", M.value = T.value.recording);
38
48
  }
39
- function L(e = "") {
40
- O.value = !1, k.value = "", j.value = e;
49
+ function R(e = "") {
50
+ k.value = !1, A.value = "", M.value = e;
41
51
  }
42
- let R = (e) => !w.allowBare && !/^(Ctrl|Alt|Meta)\+/.test(e.replace(/Shift\+/, "")) && !/^F\d{1,2}$/.test(e.split("+").at(-1));
43
- function z(e) {
44
- if (!O.value) {
45
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), I());
52
+ let z = (e) => !w.allowBare && !/^(Ctrl|Alt|Meta)\+/.test(e.replace(/Shift\+/, "")) && !/^F\d{1,2}$/.test(e.split("+").at(-1));
53
+ function B(e) {
54
+ if (!k.value) {
55
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), L());
46
56
  return;
47
57
  }
48
58
  if (e.preventDefault(), e.stopPropagation(), t(e)) {
49
- k.value = [
59
+ A.value = [
50
60
  e.ctrlKey && "Ctrl",
51
61
  e.altKey && "Alt",
52
62
  e.shiftKey && "Shift",
@@ -55,22 +65,22 @@ var v = [
55
65
  return;
56
66
  }
57
67
  let r = !e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey;
58
- if (r && e.key === "Escape") return L("Cancelled");
59
- if (r && (e.key === "Backspace" || e.key === "Delete")) return T.value = "", A.value = "", L("Cleared");
68
+ if (r && e.key === "Escape") return R("Cancelled");
69
+ if (r && (e.key === "Backspace" || e.key === "Delete")) return E.value = "", j.value = "", R("Cleared");
60
70
  let i = n(e);
61
- if (R(i)) {
62
- k.value = i, A.value = `Add Ctrl, Alt or Meta to ${i}`, j.value = A.value;
71
+ if (z(i)) {
72
+ A.value = i, j.value = T.value.needsModifier(i), M.value = j.value;
63
73
  return;
64
74
  }
65
- let a = N(i);
66
- if (a !== void 0 && i !== T.value) {
67
- k.value = i, A.value = a ? `${i} is already used by ${a}` : `${i} is already taken`, j.value = A.value, E("conflict", i, a || void 0);
75
+ let a = P(i);
76
+ if (a !== void 0 && i !== E.value) {
77
+ A.value = i, j.value = a ? T.value.usedBy(i, a) : T.value.taken(i), M.value = j.value, D("conflict", i, a || void 0);
68
78
  return;
69
79
  }
70
- T.value = i, A.value = "", L(`Set to ${i}`);
80
+ E.value = i, j.value = "", R(T.value.set(i));
71
81
  }
72
- function B(e) {
73
- O.value && t(e) && !A.value && (k.value = [
82
+ function V(e) {
83
+ k.value && t(e) && !j.value && (A.value = [
74
84
  e.ctrlKey && "Ctrl",
75
85
  e.altKey && "Alt",
76
86
  e.shiftKey && "Shift",
@@ -78,37 +88,37 @@ var v = [
78
88
  ].filter(Boolean).join("+"));
79
89
  }
80
90
  return u({
81
- start: I,
82
- focus: () => M.value?.focus()
91
+ start: L,
92
+ focus: () => N.value?.focus()
83
93
  }), (t, n) => (f(), s("div", { class: d(["bless-shortcut", {
84
- "bless-shortcut--rec": O.value,
85
- "bless-shortcut--bad": !!A.value
94
+ "bless-shortcut--rec": k.value,
95
+ "bless-shortcut--bad": !!j.value
86
96
  }]) }, [
87
97
  c("button", {
88
- id: h(D),
98
+ id: h(O),
89
99
  ref_key: "btn",
90
- ref: M,
100
+ ref: N,
91
101
  type: "button",
92
102
  class: "bless-shortcut__btn",
93
103
  disabled: l.disabled,
94
- "aria-label": `${l.label}: ${T.value || "not set"}. Press Enter to change.`,
95
- "aria-describedby": A.value ? `${h(D)}-err` : void 0,
96
- "aria-invalid": !!A.value || void 0,
97
- onClick: n[0] ||= (e) => O.value ? L() : I(),
98
- onKeydown: z,
99
- onKeyup: B,
100
- onBlur: n[1] ||= (e) => O.value && L()
101
- }, [O.value && !F.value.length ? (f(), s("span", y, "Press keys…")) : F.value.length ? (f(), a(e, {
104
+ "aria-label": T.value.button(l.label, E.value),
105
+ "aria-describedby": j.value ? `${h(O)}-err` : void 0,
106
+ "aria-invalid": !!j.value || void 0,
107
+ onClick: n[0] ||= (e) => k.value ? R() : L(),
108
+ onKeydown: B,
109
+ onKeyup: V,
110
+ onBlur: n[1] ||= (e) => k.value && R()
111
+ }, [k.value && !I.value.length ? (f(), s("span", y, m(T.value.pressKeys), 1)) : I.value.length ? (f(), a(e, {
102
112
  key: 1,
103
- keys: F.value
113
+ keys: I.value
104
114
  }, null, 8, ["keys"])) : (f(), s("span", b, m(l.placeholder), 1))], 40, v),
105
- A.value ? (f(), s("p", {
115
+ j.value ? (f(), s("p", {
106
116
  key: 0,
107
- id: `${h(D)}-err`,
117
+ id: `${h(O)}-err`,
108
118
  class: "bless-shortcut__error",
109
119
  role: "alert"
110
- }, m(A.value), 9, x)) : o("", !0),
111
- c("span", S, m(j.value), 1)
120
+ }, m(j.value), 9, x)) : o("", !0),
121
+ c("span", S, m(M.value), 1)
112
122
  ], 2));
113
123
  }
114
124
  });
@@ -37,8 +37,8 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
37
37
  type: "image/png" | "image/jpeg" | "image/webp";
38
38
  hint: string;
39
39
  height: number;
40
- lineWidth: number;
41
40
  clearLabel: string;
41
+ lineWidth: number;
42
42
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
43
43
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
44
44
  declare const _default: typeof __VLS_export;
@@ -4,6 +4,11 @@ type __VLS_Props = {
4
4
  /** how close counts, as a fraction of the track (0.03 = 3%) */
5
5
  tolerance?: number;
6
6
  label?: string;
7
+ /** what is announced when the piece lands or misses */
8
+ labels?: Partial<{
9
+ verified: string;
10
+ failed: string;
11
+ }>;
7
12
  };
8
13
  declare function reset(): void;
9
14
  type __VLS_ModelProps = {
@@ -1,19 +1,20 @@
1
- import { createElementBlock as e, createElementVNode as t, defineComponent as n, mergeModels as r, normalizeClass as i, normalizeStyle as a, onBeforeUnmount as o, onMounted as s, openBlock as c, ref as l, toDisplayString as u, unref as d, useId as f, useModel as p } from "vue";
1
+ import { computed as e, createElementBlock as t, createElementVNode as n, defineComponent as r, mergeModels as i, normalizeClass as a, normalizeStyle as o, onBeforeUnmount as s, onMounted as c, openBlock as l, ref as u, toDisplayString as d, unref as f, useId as p, useModel as m } from "vue";
2
2
  //#region src/components/BlessSliderCaptcha.vue?vue&type=script&setup=true&lang.ts
3
- var m = ["id"], h = [
3
+ var h = ["id"], g = [
4
4
  "aria-labelledby",
5
5
  "aria-valuenow",
6
6
  "aria-disabled"
7
- ], g = { "aria-hidden": "true" }, _ = {
7
+ ], _ = { "aria-hidden": "true" }, v = {
8
8
  class: "bless-captcha__live",
9
9
  "aria-live": "polite"
10
- }, v = .16, y = /*@__PURE__*/ n({
10
+ }, y = .16, b = /*@__PURE__*/ r({
11
11
  name: "BlessSliderCaptcha",
12
12
  __name: "BlessSliderCaptcha",
13
- props: /*@__PURE__*/ r({
13
+ props: /*@__PURE__*/ i({
14
14
  src: {},
15
15
  tolerance: { default: .03 },
16
- label: { default: "Slide the piece into the gap" }
16
+ label: { default: "Slide the piece into the gap" },
17
+ labels: {}
17
18
  }, {
18
19
  verified: {
19
20
  type: Boolean,
@@ -21,121 +22,125 @@ var m = ["id"], h = [
21
22
  },
22
23
  verifiedModifiers: {}
23
24
  }),
24
- emits: /*@__PURE__*/ r(["verify", "fail"], ["update:verified"]),
25
- setup(n, { expose: r, emit: y }) {
26
- let b = n, x = p(n, "verified"), S = y, C = f(), w = l(), T = l(), E = l(), D = l(320), O = () => Math.round(D.value / 2), k = l(0), A = l({
25
+ emits: /*@__PURE__*/ i(["verify", "fail"], ["update:verified"]),
26
+ setup(r, { expose: i, emit: b }) {
27
+ let x = r, S = e(() => ({
28
+ verified: "Verified",
29
+ failed: "Not quite, try again",
30
+ ...x.labels
31
+ })), C = m(r, "verified"), w = b, T = p(), E = u(), D = u(), O = u(), k = u(320), A = () => Math.round(k.value / 2), j = u(0), M = u({
27
32
  at: .6,
28
33
  y: .3
29
- }), j = l(!1), M = l(!1), N = l(""), P = 0;
30
- function F() {
31
- A.value = {
34
+ }), N = u(!1), P = u(!1), F = u(""), I = 0;
35
+ function L() {
36
+ M.value = {
32
37
  at: .35 + Math.random() * .55,
33
38
  y: .1 + Math.random() * .5
34
39
  };
35
40
  }
36
- let I;
37
- s(() => {
38
- F();
39
- let e = w.value;
40
- e && (D.value = e.clientWidth || 320, typeof ResizeObserver < "u" && (I = new ResizeObserver(() => D.value = e.clientWidth || 320), I.observe(e)));
41
- }), o(() => I?.disconnect());
42
- let L = () => D.value * v, R = () => A.value.at * D.value * .84, z = () => A.value.y * (O() - L()), B = () => b.src ? {
43
- backgroundImage: `url(${b.src})`,
44
- backgroundSize: `${D.value}px ${O()}px`
41
+ let R;
42
+ c(() => {
43
+ L();
44
+ let e = E.value;
45
+ e && (k.value = e.clientWidth || 320, typeof ResizeObserver < "u" && (R = new ResizeObserver(() => k.value = e.clientWidth || 320), R.observe(e)));
46
+ }), s(() => R?.disconnect());
47
+ let z = () => k.value * y, B = () => M.value.at * k.value * .84, V = () => M.value.y * (A() - z()), H = () => x.src ? {
48
+ backgroundImage: `url(${x.src})`,
49
+ backgroundSize: `${k.value}px ${A()}px`
45
50
  } : {};
46
- function V() {
47
- x.value || (Math.abs(k.value - A.value.at) <= b.tolerance ? (x.value = !0, k.value = A.value.at, N.value = "Verified", S("verify", { ms: Math.round(performance.now() - P) })) : (M.value = !0, N.value = "Not quite, try again", S("fail"), k.value = 0, F(), setTimeout(() => M.value = !1, 400)));
51
+ function U() {
52
+ C.value || (Math.abs(j.value - M.value.at) <= x.tolerance ? (C.value = !0, j.value = M.value.at, F.value = S.value.verified, w("verify", { ms: Math.round(performance.now() - I) })) : (P.value = !0, F.value = S.value.failed, w("fail"), j.value = 0, L(), setTimeout(() => P.value = !1, 400)));
48
53
  }
49
- function H() {
50
- x.value = !1, M.value = !1, k.value = 0, N.value = "", F();
54
+ function W() {
55
+ C.value = !1, P.value = !1, j.value = 0, F.value = "", L();
51
56
  }
52
- r({ reset: H });
53
- let U = {
57
+ i({ reset: W });
58
+ let G = {
54
59
  x: 0,
55
60
  f: 0
56
61
  };
57
- function W(e) {
58
- x.value || e.button || (e.currentTarget.setPointerCapture?.(e.pointerId), U = {
62
+ function K(e) {
63
+ C.value || e.button || (e.currentTarget.setPointerCapture?.(e.pointerId), G = {
59
64
  x: e.clientX,
60
- f: k.value
61
- }, j.value = !0, (!P || k.value === 0) && (P = performance.now()));
65
+ f: j.value
66
+ }, N.value = !0, (!I || j.value === 0) && (I = performance.now()));
62
67
  }
63
- function G(e) {
64
- if (!j.value) return;
65
- let t = T.value?.clientWidth || 0, n = E.value?.offsetWidth || 0, r = t && n ? t - n : (w.value?.clientWidth || D.value) - L();
66
- k.value = Math.min(1, Math.max(0, U.f + (e.clientX - U.x) / r));
68
+ function q(e) {
69
+ if (!N.value) return;
70
+ let t = D.value?.clientWidth || 0, n = O.value?.offsetWidth || 0, r = t && n ? t - n : (E.value?.clientWidth || k.value) - z();
71
+ j.value = Math.min(1, Math.max(0, G.f + (e.clientX - G.x) / r));
67
72
  }
68
- function K() {
69
- j.value && (j.value = !1, V());
73
+ function J() {
74
+ N.value && (N.value = !1, U());
70
75
  }
71
- function q(e) {
72
- if (x.value) return;
76
+ function Y(e) {
77
+ if (C.value) return;
73
78
  let t = e.shiftKey ? .1 : .01;
74
- e.key === "ArrowRight" || e.key === "ArrowLeft" ? (e.preventDefault(), k.value || (P = performance.now()), k.value = Math.min(1, Math.max(0, k.value + (e.key === "ArrowRight" ? t : -t)))) : (e.key === "Enter" || e.key === " ") && (e.preventDefault(), V());
79
+ e.key === "ArrowRight" || e.key === "ArrowLeft" ? (e.preventDefault(), j.value || (I = performance.now()), j.value = Math.min(1, Math.max(0, j.value + (e.key === "ArrowRight" ? t : -t)))) : (e.key === "Enter" || e.key === " ") && (e.preventDefault(), U());
75
80
  }
76
- return (r, o) => (c(), e("div", { class: i(["bless-captcha", {
77
- "bless-captcha--ok": x.value,
78
- "bless-captcha--fail": M.value
81
+ return (e, i) => (l(), t("div", { class: a(["bless-captcha", {
82
+ "bless-captcha--ok": C.value,
83
+ "bless-captcha--fail": P.value
79
84
  }]) }, [
80
- t("div", {
85
+ n("div", {
81
86
  ref_key: "stage",
82
- ref: w,
87
+ ref: E,
83
88
  class: "bless-captcha__stage",
84
- style: a({
85
- height: `${O()}px`,
86
- ...B()
89
+ style: o({
90
+ height: `${A()}px`,
91
+ ...H()
87
92
  }),
88
93
  "aria-hidden": "true"
89
- }, [t("span", {
94
+ }, [n("span", {
90
95
  class: "bless-captcha__gap",
91
- style: a({
92
- width: `${L()}px`,
93
- height: `${L()}px`,
94
- left: `${R()}px`,
95
- top: `${z()}px`
96
+ style: o({
97
+ width: `${z()}px`,
98
+ height: `${z()}px`,
99
+ left: `${B()}px`,
100
+ top: `${V()}px`
96
101
  })
97
- }, null, 4), t("span", {
98
- class: i(["bless-captcha__piece", { "bless-captcha__piece--drag": j.value }]),
99
- style: a({
100
- width: `${L()}px`,
101
- height: `${L()}px`,
102
- top: `${z()}px`,
103
- left: `${k.value * (D.value - L())}px`,
104
- ...B(),
105
- backgroundPosition: `-${R()}px -${z()}px`
102
+ }, null, 4), n("span", {
103
+ class: a(["bless-captcha__piece", { "bless-captcha__piece--drag": N.value }]),
104
+ style: o({
105
+ width: `${z()}px`,
106
+ height: `${z()}px`,
107
+ top: `${V()}px`,
108
+ left: `${j.value * (k.value - z())}px`,
109
+ ...H(),
110
+ backgroundPosition: `-${B()}px -${V()}px`
106
111
  })
107
112
  }, null, 6)], 4),
108
- t("div", {
113
+ n("div", {
109
114
  ref_key: "track",
110
- ref: T,
115
+ ref: D,
111
116
  class: "bless-captcha__track"
112
- }, [t("span", {
113
- id: `${d(C)}-l`,
117
+ }, [n("span", {
118
+ id: `${f(T)}-l`,
114
119
  class: "bless-captcha__label"
115
- }, u(x.value ? "Verified" : n.label), 9, m), t("button", {
120
+ }, d(C.value ? S.value.verified : r.label), 9, h), n("button", {
116
121
  ref_key: "handleEl",
117
- ref: E,
122
+ ref: O,
118
123
  type: "button",
119
- class: i(["bless-captcha__handle", { "bless-captcha__handle--drag": j.value }]),
124
+ class: a(["bless-captcha__handle", { "bless-captcha__handle--drag": N.value }]),
120
125
  role: "slider",
121
- "aria-labelledby": `${d(C)}-l`,
126
+ "aria-labelledby": `${f(T)}-l`,
122
127
  "aria-valuemin": "0",
123
128
  "aria-valuemax": "100",
124
- "aria-valuenow": Math.round(k.value * 100),
125
- "aria-disabled": x.value || void 0,
126
- style: a({
127
- left: `${k.value * 100}%`,
128
- translate: `${-k.value * 100}% 0`
129
+ "aria-valuenow": Math.round(j.value * 100),
130
+ "aria-disabled": C.value || void 0,
131
+ style: o({
132
+ left: `${j.value * 100}%`,
133
+ translate: `${-j.value * 100}% 0`
129
134
  }),
130
- onPointerdown: W,
131
- onPointermove: G,
132
- onPointerup: K,
133
- onPointercancel: K,
134
- onKeydown: q
135
- }, [t("span", g, u(x.value ? "✓" : "→"), 1)], 46, h)], 512),
136
- t("span", _, u(N.value), 1)
135
+ onPointerdown: K,
136
+ onPointermove: q,
137
+ onPointerup: J,
138
+ onPointercancel: J,
139
+ onKeydown: Y
140
+ }, [n("span", _, d(C.value ? "✓" : "→"), 1)], 46, g)], 512),
141
+ n("span", v, d(F.value), 1)
137
142
  ], 2));
138
143
  }
139
144
  });
140
145
  //#endregion
141
- export { y as default };
146
+ export { b as default };
@@ -1 +1 @@
1
- .bless-sortable{font-family:var(--bless-font-sans);font-size:var(--bless-text-sm);color:var(--bless-color-text);position:relative}.bless-sortable__list{gap:var(--bless-space-2);margin:0;padding:0;list-style:none;display:grid}.bless-sortable__list--grid{grid-template-columns:repeat(var(--bless-sortable-cols), minmax(0, 1fr))}.bless-sortable__item{align-items:center;gap:var(--bless-space-2);padding:var(--bless-space-2) var(--bless-space-3);border:var(--bless-border-width) solid var(--bless-color-border);background:var(--bless-color-bg);display:flex}.bless-sortable__item--drag{opacity:.4}.bless-sortable__item--held{border-color:var(--bless-color-accent)}.bless-sortable__item--before{box-shadow:inset 0 2px 0 var(--bless-color-accent)}.bless-sortable__item--after{box-shadow:inset 0 -2px 0 var(--bless-color-accent)}.bless-sortable__list--grid .bless-sortable__item--before{box-shadow:inset 2px 0 0 var(--bless-color-accent)}.bless-sortable__list--grid .bless-sortable__item--after,[dir=rtl] .bless-sortable__list--grid .bless-sortable__item--before{box-shadow:inset -2px 0 0 var(--bless-color-accent)}[dir=rtl] .bless-sortable__list--grid .bless-sortable__item--after{box-shadow:inset 2px 0 0 var(--bless-color-accent)}.bless-sortable__grip{padding:var(--bless-space-1) var(--bless-space-2);color:var(--bless-color-text-muted);font:inherit;letter-spacing:-3px;cursor:grab;touch-action:none;background:0 0;border:0;flex:none}.bless-sortable__grip:active{cursor:grabbing}.bless-sortable__grip:focus-visible{outline:2px solid var(--bless-color-accent)}.bless-sortable__body{flex:1;min-width:0}.bless-sortable__live{clip-path:inset(50%);width:1px;height:1px;position:absolute;overflow:hidden}
1
+ .bless-sortable{font-family:var(--bless-font-sans);font-size:var(--bless-text-sm);color:var(--bless-color-text);position:relative}.bless-sortable--group{min-height:3rem}.bless-sortable--receiving{outline:2px dashed var(--bless-color-accent);outline-offset:-2px}.bless-sortable__list{gap:var(--bless-space-2);margin:0;padding:0;list-style:none;display:grid}.bless-sortable__list--grid{grid-template-columns:repeat(var(--bless-sortable-cols), minmax(0, 1fr))}.bless-sortable__item{align-items:center;gap:var(--bless-space-2);padding:var(--bless-space-2) var(--bless-space-3);border:var(--bless-border-width) solid var(--bless-color-border);background:var(--bless-color-bg);display:flex}.bless-sortable__item--drag{opacity:.4}.bless-sortable__item--held{border-color:var(--bless-color-accent)}.bless-sortable__item--before{box-shadow:inset 0 2px 0 var(--bless-color-accent)}.bless-sortable__item--after{box-shadow:inset 0 -2px 0 var(--bless-color-accent)}.bless-sortable__list--grid .bless-sortable__item--before{box-shadow:inset 2px 0 0 var(--bless-color-accent)}.bless-sortable__list--grid .bless-sortable__item--after,[dir=rtl] .bless-sortable__list--grid .bless-sortable__item--before{box-shadow:inset -2px 0 0 var(--bless-color-accent)}[dir=rtl] .bless-sortable__list--grid .bless-sortable__item--after{box-shadow:inset 2px 0 0 var(--bless-color-accent)}.bless-sortable__grip{padding:var(--bless-space-1) var(--bless-space-2);color:var(--bless-color-text-muted);font:inherit;letter-spacing:-3px;cursor:grab;touch-action:none;background:0 0;border:0;flex:none}.bless-sortable__grip:active{cursor:grabbing}.bless-sortable__grip:focus-visible{outline:2px solid var(--bless-color-accent)}.bless-sortable__body{flex:1;min-width:0}.bless-sortable__live{clip-path:inset(50%);width:1px;height:1px;position:absolute;overflow:hidden}
@@ -4,11 +4,29 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
4
4
  label?: string;
5
5
  /** lay the items out in this many equal columns (a grid); 1 is a list */
6
6
  columns?: number;
7
+ /**
8
+ * lists that share a group name take each other's items: drag across, or hold an item and
9
+ * press Alt with ← / → to send it to the neighbouring list. Bind each list's own `v-model`.
10
+ */
11
+ group?: string;
12
+ /** screen-reader wording; each message that carries numbers is a function of them */
13
+ labels?: Partial<{
14
+ grip: (index: number) => string;
15
+ grabbed: (index: number, total: number) => string;
16
+ moved: (position: number, total: number) => string;
17
+ sent: (list: string, position: number, total: number) => string;
18
+ dropped: (position: number, total: number) => string;
19
+ cancelled: string;
20
+ hint: string;
21
+ groupHint: string;
22
+ roleDescription: string;
23
+ }>;
7
24
  } & {
8
25
  modelValue?: T[];
9
26
  }) & {
10
27
  "onUpdate:modelValue"?: ((value: T[]) => any) | undefined;
11
28
  onMove?: ((from: number, to: number) => any) | undefined;
29
+ onTransfer?: ((item: T, from: number, to: number) => any) | undefined;
12
30
  }> & (typeof globalThis extends {
13
31
  __VLS_PROPS_FALLBACK: infer P;
14
32
  } ? P : {});
@@ -20,7 +38,7 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
20
38
  index: number;
21
39
  }) => any;
22
40
  };
23
- emit: ((evt: "move", from: number, to: number) => void) & ((event: "update:modelValue", value: T[]) => void);
41
+ emit: (((evt: "move", from: number, to: number) => void) & ((evt: "transfer", item: T, from: number, to: number) => void)) & ((event: "update:modelValue", value: T[]) => void);
24
42
  }>) => import('vue').VNode & {
25
43
  __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
26
44
  };