@nubisco/ui 5.17.0 → 5.18.1
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/dist/{BarChart-BmDXIaf6.cjs → BarChart-B3B7wH20.cjs} +1 -1
- package/dist/{BarChart-CmYyd4IV.js → BarChart-DUy6vE_i.js} +4 -4
- package/dist/{BlueprintControls-CVQkxcMU.js → BlueprintControls-CuOAdppD.js} +1 -1
- package/dist/{BlueprintControls-IU6Dc5yv.cjs → BlueprintControls-LCIgk-cb.cjs} +1 -1
- package/dist/Board-6D49Yld8.js +524 -0
- package/dist/Board-Cp8XfgZm.cjs +1 -0
- package/dist/{Confirm-CLrRlOE6.cjs → Confirm-Br9VOB2-.cjs} +1 -1
- package/dist/{Confirm-DsB9n0sk.js → Confirm-DztLfQzB.js} +2 -2
- package/dist/{DataTable-D6hXgtDH.js → DataTable-8VaU0T7V.js} +1 -1
- package/dist/{DataTable-BJKfz59R.cjs → DataTable-Mq7v4Dyk.cjs} +1 -1
- package/dist/{FileUploader-CufMlD5X.cjs → FileUploader-DPIAWehF.cjs} +1 -1
- package/dist/{FileUploader-B2A1T1vb.js → FileUploader-OJJIlvmH.js} +1 -1
- package/dist/{GanttChart-Cekazr75.cjs → GanttChart-C6uVsNrq.cjs} +1 -1
- package/dist/{GanttChart-B6Np07RJ.js → GanttChart-asYYkfjM.js} +3 -3
- package/dist/{InterpolationChart-BF00hyiY.js → InterpolationChart-CdbT0AvE.js} +3 -3
- package/dist/{InterpolationChart-D_QPQOIS.cjs → InterpolationChart-w1GgDSDT.cjs} +1 -1
- package/dist/{LineChart-D21jFHa1.js → LineChart-BgnDKI8u.js} +4 -4
- package/dist/{LineChart-CgBvFTwd.cjs → LineChart-CmBBttxc.cjs} +1 -1
- package/dist/{Modal-BdjhNfG0.js → Modal-BvZulLj2.js} +1 -1
- package/dist/{Modal-eRotJIL5.cjs → Modal-Xa9TIGNi.cjs} +1 -1
- package/dist/{NotificationCenter-RIzKsxUf.cjs → NotificationCenter-B12PMiat.cjs} +1 -1
- package/dist/{NotificationCenter-BWNFq7Y_.js → NotificationCenter-B2kJXtA9.js} +1 -1
- package/dist/{Pagination-D69J9sA1.cjs → Pagination-Di4RPomA.cjs} +1 -1
- package/dist/{Pagination-CH2A6T3n.js → Pagination-JW-O2kLk.js} +1 -1
- package/dist/{PieChart-DajsvhAV.cjs → PieChart-CUckdHre.cjs} +1 -1
- package/dist/{PieChart-ByOhOTXU.js → PieChart-CpkjCb1W.js} +3 -3
- package/dist/{TableOfContents-BfR2Zyrv.cjs → TableOfContents-C6Qnq6aS.cjs} +1 -1
- package/dist/{TableOfContents-C6zgmnCg.js → TableOfContents-DwnnMxv5.js} +1 -1
- package/dist/{Tabs-BCCI2jAd.cjs → Tabs-B5crovQe.cjs} +1 -1
- package/dist/{Tabs-CxqDD--r.js → Tabs-DRrq4YCX.js} +1 -1
- package/dist/{Walkthrough-CDeBRQZb.cjs → Walkthrough-DRx76ziA.cjs} +1 -1
- package/dist/{Walkthrough-B_zZaq4y.js → Walkthrough-vAJctcje.js} +1 -1
- package/dist/all.cjs +1 -1
- package/dist/all.mjs +32 -32
- package/dist/component-styles.json +2 -0
- package/dist/components/Avatar.cjs +1 -1
- package/dist/components/Avatar.mjs +1 -1
- package/dist/components/Badge.cjs +1 -1
- package/dist/components/Badge.mjs +1 -1
- package/dist/components/Banner.cjs +1 -1
- package/dist/components/Banner.mjs +1 -1
- package/dist/components/BlueprintControls.cjs +1 -1
- package/dist/components/BlueprintControls.mjs +1 -1
- package/dist/components/Board.cjs +1 -1
- package/dist/components/Board.d.ts +28 -0
- package/dist/components/Board.mjs +1 -1
- package/dist/components/Board.vue.d.ts +13 -1
- package/dist/components/Board.vue.d.ts.map +1 -1
- package/dist/components/Breadcrumbs.cjs +1 -1
- package/dist/components/Breadcrumbs.mjs +1 -1
- package/dist/components/Button.cjs +1 -1
- package/dist/components/Button.mjs +1 -1
- package/dist/components/Calendar.cjs +1 -1
- package/dist/components/Calendar.mjs +1 -1
- package/dist/components/Charts/BarChart.cjs +1 -1
- package/dist/components/Charts/BarChart.mjs +1 -1
- package/dist/components/Charts/GanttChart.cjs +1 -1
- package/dist/components/Charts/GanttChart.mjs +1 -1
- package/dist/components/Charts/InterpolationChart.cjs +1 -1
- package/dist/components/Charts/InterpolationChart.mjs +1 -1
- package/dist/components/Charts/LineChart.cjs +1 -1
- package/dist/components/Charts/LineChart.mjs +1 -1
- package/dist/components/Charts/PieChart.cjs +1 -1
- package/dist/components/Charts/PieChart.mjs +1 -1
- package/dist/components/Confirm.cjs +1 -1
- package/dist/components/Confirm.mjs +1 -1
- package/dist/components/DataTable.cjs +1 -1
- package/dist/components/DataTable.mjs +1 -1
- package/dist/components/DatePicker.vue.d.ts +1 -1
- package/dist/components/FileUploader.cjs +1 -1
- package/dist/components/FileUploader.mjs +1 -1
- package/dist/components/Modal.cjs +1 -1
- package/dist/components/Modal.mjs +1 -1
- package/dist/components/NotificationCenter.cjs +1 -1
- package/dist/components/NotificationCenter.mjs +1 -1
- package/dist/components/NotificationCenter.vue.d.ts +1 -1
- package/dist/components/NotificationCenterItem.vue.d.ts +1 -1
- package/dist/components/NumberInput.vue.d.ts +1 -1
- package/dist/components/Pagination.cjs +1 -1
- package/dist/components/Pagination.mjs +1 -1
- package/dist/components/Select.vue.d.ts +1 -1
- package/dist/components/TableOfContents.cjs +1 -1
- package/dist/components/TableOfContents.mjs +1 -1
- package/dist/components/Tabs.cjs +1 -1
- package/dist/components/Tabs.mjs +1 -1
- package/dist/components/TextInput.vue.d.ts +1 -1
- package/dist/components/Walkthrough.cjs +1 -1
- package/dist/components/Walkthrough.mjs +1 -1
- package/dist/composables/useConfirm.composable.cjs +1 -1
- package/dist/composables/useConfirm.composable.mjs +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +24 -24
- package/dist/main.d.ts +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/styles/Board.css +1 -1
- package/dist/ui.css +1 -1
- package/package.json +1 -1
- package/dist/Board-6TUivitd.cjs +0 -1
- package/dist/Board-nLi96Obf.js +0 -420
- /package/dist/{Avatar-BmB57kGg.cjs → Avatar-CLL3i8dn.cjs} +0 -0
- /package/dist/{Avatar-ap4X6_kE.js → Avatar-uYRUtK1R.js} +0 -0
- /package/dist/{Badge-B1xoanmq.cjs → Badge-ouVFB318.cjs} +0 -0
- /package/dist/{Badge-CxBslbIp.js → Badge-wDtZdOfk.js} +0 -0
- /package/dist/{Banner-DzySrOrs.cjs → Banner-CtaMbfyG.cjs} +0 -0
- /package/dist/{Banner-D61pK-1n.js → Banner-DKMPZuXR.js} +0 -0
- /package/dist/{Breadcrumbs-BT3EvjKk.js → Breadcrumbs-BXsbR60g.js} +0 -0
- /package/dist/{Breadcrumbs-H9PvTXK0.cjs → Breadcrumbs-CPucjD0z.cjs} +0 -0
- /package/dist/{Button-CV2mm5ZB.js → Button-BAfC7ySK.js} +0 -0
- /package/dist/{Button-S8xZ0EGV.cjs → Button-BZn2lmMA.cjs} +0 -0
- /package/dist/{Calendar-DiYrR5ss.cjs → Calendar-D3ExPJ2t.cjs} +0 -0
- /package/dist/{Calendar-Bu8yA7-h.js → Calendar-DCoZLEcA.js} +0 -0
- /package/dist/{ChartLegend-ywCoTUbO.js → ChartLegend-B_Y9TNfO.js} +0 -0
- /package/dist/{ChartLegend-O2SYdHsd.cjs → ChartLegend-k-7LH8-7.cjs} +0 -0
- /package/dist/{palette-CS95-prq.js → palette-BVXsOJol.js} +0 -0
- /package/dist/{palette-BW0RLn76.cjs → palette-CP7R55wd.cjs} +0 -0
- /package/dist/{scales-BjSg0Ayo.js → scales-CsGzsNm7.js} +0 -0
- /package/dist/{scales-VtK6oMP0.cjs → scales-DJ_hCmZX.cjs} +0 -0
- /package/dist/{useChartSize-CBOK3yq5.js → useChartSize-6K6L_Xnm.js} +0 -0
- /package/dist/{useChartSize-BPqvq1te.cjs → useChartSize-DGUae61E.cjs} +0 -0
package/dist/Board-nLi96Obf.js
DELETED
|
@@ -1,420 +0,0 @@
|
|
|
1
|
-
import { useStableId as e } from "./composables/useStableId.composable.mjs";
|
|
2
|
-
import { useSurfaceLayer as t } from "./composables/useSurfaceLayer.composable.mjs";
|
|
3
|
-
import { Fragment as n, computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, defineComponent as c, mergeProps as l, nextTick as u, normalizeClass as d, normalizeStyle as f, openBlock as p, ref as m, renderList as h, renderSlot as g, toDisplayString as _, unref as v, withModifiers as y } from "vue";
|
|
4
|
-
//#region src/components/Board.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var b = [
|
|
6
|
-
"draggable",
|
|
7
|
-
"onDragstart",
|
|
8
|
-
"onDragover"
|
|
9
|
-
], ee = { class: "nb-board__col-title" }, te = { class: "nb-board__col-count" }, ne = ["onClick"], re = ["aria-label"], ie = { class: "nb-board__lane-label" }, ae = { class: "nb-board__lane-count" }, oe = ["onDragover", "onDrop"], se = ["aria-label"], ce = [
|
|
10
|
-
"data-item-id",
|
|
11
|
-
"aria-label",
|
|
12
|
-
"aria-describedby",
|
|
13
|
-
"onDragstart",
|
|
14
|
-
"onDragover",
|
|
15
|
-
"onKeydown",
|
|
16
|
-
"onBlur"
|
|
17
|
-
], le = {
|
|
18
|
-
key: 0,
|
|
19
|
-
class: "nb-board__empty-cell",
|
|
20
|
-
"aria-hidden": "true"
|
|
21
|
-
}, ue = {
|
|
22
|
-
key: 0,
|
|
23
|
-
class: "nb-board__cell-footer"
|
|
24
|
-
}, de = ["id"], fe = {
|
|
25
|
-
class: "nb-board__sr",
|
|
26
|
-
"aria-live": "assertive"
|
|
27
|
-
}, x = .5, S = 44, C = /* @__PURE__ */ c({
|
|
28
|
-
__name: "Board",
|
|
29
|
-
props: {
|
|
30
|
-
columns: {},
|
|
31
|
-
items: {},
|
|
32
|
-
lanes: { default: void 0 },
|
|
33
|
-
reorderableColumns: {
|
|
34
|
-
type: Boolean,
|
|
35
|
-
default: !1
|
|
36
|
-
},
|
|
37
|
-
nestable: {
|
|
38
|
-
type: Boolean,
|
|
39
|
-
default: !1
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
emits: [
|
|
43
|
-
"move",
|
|
44
|
-
"nest",
|
|
45
|
-
"column-move"
|
|
46
|
-
],
|
|
47
|
-
setup(c, { emit: C }) {
|
|
48
|
-
let w = c, { layerProps: pe } = t(), T = C, E = e({}), D = m(null), O = r(() => ({ gridTemplateColumns: `repeat(${w.columns.length}, var(--nb-board-column-track, minmax(200px, 1fr)))` })), me = r(() => w.lanes && w.lanes.length > 0 ? w.lanes : [null]);
|
|
49
|
-
function k(e) {
|
|
50
|
-
return e ? e.id ?? null : null;
|
|
51
|
-
}
|
|
52
|
-
function A(e) {
|
|
53
|
-
return e ? M(e.id) : "__flat__";
|
|
54
|
-
}
|
|
55
|
-
function j(e) {
|
|
56
|
-
return w.items.filter((t) => t.columnId === e).length;
|
|
57
|
-
}
|
|
58
|
-
function M(e) {
|
|
59
|
-
return e ?? "__none__";
|
|
60
|
-
}
|
|
61
|
-
function he(e) {
|
|
62
|
-
return w.lanes ? w.items.filter((t) => (t.laneId ?? null) === e).length : 0;
|
|
63
|
-
}
|
|
64
|
-
function N(e, t) {
|
|
65
|
-
return !w.lanes || w.lanes.length === 0 ? w.items.filter((e) => e.columnId === t) : w.items.filter((n) => n.columnId === t && (n.laneId ?? null) === e);
|
|
66
|
-
}
|
|
67
|
-
function P(e) {
|
|
68
|
-
return w.columns.find((t) => t.id === e);
|
|
69
|
-
}
|
|
70
|
-
let F = m(/* @__PURE__ */ new Set());
|
|
71
|
-
function I(e) {
|
|
72
|
-
let t = M(e), n = new Set(F.value);
|
|
73
|
-
n.has(t) ? n.delete(t) : n.add(t), F.value = n;
|
|
74
|
-
}
|
|
75
|
-
function L(e) {
|
|
76
|
-
return F.value.has(M(e));
|
|
77
|
-
}
|
|
78
|
-
function R(e) {
|
|
79
|
-
let t = e.label ?? e.name ?? e.title;
|
|
80
|
-
return typeof t == "string" ? t : `Item ${e.id}`;
|
|
81
|
-
}
|
|
82
|
-
function z(e, t) {
|
|
83
|
-
return e ? `${t.label}, ${e.label}` : t.label;
|
|
84
|
-
}
|
|
85
|
-
function ge(e, t) {
|
|
86
|
-
return z(e, t);
|
|
87
|
-
}
|
|
88
|
-
function B(e, t, n) {
|
|
89
|
-
let r = N(k(t), n.id), i = r.findIndex((t) => t.id === e.id), a = `${R(e)}, ${i + 1} of ${r.length} in ${z(t, n)}`;
|
|
90
|
-
return q.value?.item.id === e.id ? `${a}, picked up` : a;
|
|
91
|
-
}
|
|
92
|
-
let V = m("");
|
|
93
|
-
function H(e, t, n, r) {
|
|
94
|
-
let i = N(t, n).filter((t) => t.id !== e.item.id), a = Math.max(0, Math.min(r, i.length));
|
|
95
|
-
return e.fromColumnId === n && e.fromLaneId === t && a === N(t, n).findIndex((t) => t.id === e.item.id) ? !1 : (T("move", {
|
|
96
|
-
itemId: e.item.id,
|
|
97
|
-
fromColumnId: e.fromColumnId,
|
|
98
|
-
toColumnId: n,
|
|
99
|
-
fromLaneId: e.fromLaneId,
|
|
100
|
-
toLaneId: t,
|
|
101
|
-
toIndex: a,
|
|
102
|
-
beforeItemId: i[a - 1]?.id ?? null,
|
|
103
|
-
afterItemId: i[a]?.id ?? null
|
|
104
|
-
}), !0);
|
|
105
|
-
}
|
|
106
|
-
let U = m(null), W = m(null), G = m(null);
|
|
107
|
-
function _e(e, t, n) {
|
|
108
|
-
q.value = null, U.value = {
|
|
109
|
-
item: e,
|
|
110
|
-
fromLaneId: k(t),
|
|
111
|
-
fromColumnId: n
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
function ve(e, t, n, r, i) {
|
|
115
|
-
if (!U.value) return;
|
|
116
|
-
let a = e.currentTarget.getBoundingClientRect();
|
|
117
|
-
if (w.nestable && a.height >= S) {
|
|
118
|
-
let r = (e.clientY - a.top) / a.height, o = (1 - x) / 2;
|
|
119
|
-
if (r > o && r < 1 - o && i.id !== U.value.item.id) {
|
|
120
|
-
G.value = {
|
|
121
|
-
laneId: k(t),
|
|
122
|
-
colId: n,
|
|
123
|
-
itemId: i.id
|
|
124
|
-
}, W.value = null;
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
G.value = null;
|
|
129
|
-
let o = e.clientY >= a.top + a.height / 2;
|
|
130
|
-
W.value = {
|
|
131
|
-
laneId: k(t),
|
|
132
|
-
colId: n,
|
|
133
|
-
index: r + (o ? 1 : 0)
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
function ye(e, t) {
|
|
137
|
-
if (!U.value) return;
|
|
138
|
-
let n = k(e);
|
|
139
|
-
W.value = {
|
|
140
|
-
laneId: n,
|
|
141
|
-
colId: t,
|
|
142
|
-
index: N(n, t).length
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
function be() {
|
|
146
|
-
W.value = null, G.value = null;
|
|
147
|
-
}
|
|
148
|
-
function xe() {
|
|
149
|
-
U.value = null, W.value = null, G.value = null;
|
|
150
|
-
}
|
|
151
|
-
function Se(e, t) {
|
|
152
|
-
return K(e, t) !== null;
|
|
153
|
-
}
|
|
154
|
-
function K(e, t) {
|
|
155
|
-
let n = k(e), r = W.value;
|
|
156
|
-
if (U.value && r && r.laneId === n && r.colId === t) return r.index;
|
|
157
|
-
let i = q.value;
|
|
158
|
-
if (i && i.laneId === n && i.colId === t) {
|
|
159
|
-
let e = N(n, t).findIndex((e) => e.id === i.item.id);
|
|
160
|
-
return e !== -1 && e <= i.index ? i.index + 1 : i.index;
|
|
161
|
-
}
|
|
162
|
-
return null;
|
|
163
|
-
}
|
|
164
|
-
function Ce(e, t, n) {
|
|
165
|
-
let r = G.value;
|
|
166
|
-
return r !== null && r.laneId === k(e) && r.colId === t && r.itemId === n.id;
|
|
167
|
-
}
|
|
168
|
-
function we(e, t, n) {
|
|
169
|
-
return n === N(k(e), t).length - 1 && K(e, t) === n + 1;
|
|
170
|
-
}
|
|
171
|
-
function Te(e, t) {
|
|
172
|
-
if (Z.value !== null) return;
|
|
173
|
-
let n = W.value, r = G.value;
|
|
174
|
-
W.value = null, G.value = null;
|
|
175
|
-
let i = U.value;
|
|
176
|
-
if (U.value = null, !i) return;
|
|
177
|
-
if (r) {
|
|
178
|
-
T("nest", {
|
|
179
|
-
itemId: i.item.id,
|
|
180
|
-
ontoItemId: r.itemId,
|
|
181
|
-
fromColumnId: i.fromColumnId,
|
|
182
|
-
...w.lanes ? { fromLaneId: i.fromLaneId } : {}
|
|
183
|
-
}), V.value = `${R(i.item)} dropped onto ${R(w.items.find((e) => e.id === r.itemId) ?? i.item)}`;
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
let a = k(e), o = N(a, t), s = n && n.laneId === a && n.colId === t ? n.index : o.length, c = o.findIndex((e) => e.id === i.item.id);
|
|
187
|
-
H(i, a, t, c !== -1 && c < s ? s - 1 : s);
|
|
188
|
-
}
|
|
189
|
-
let q = m(null);
|
|
190
|
-
function Ee(e, t, n, r) {
|
|
191
|
-
let i = k(n);
|
|
192
|
-
if (e.key === "Escape") {
|
|
193
|
-
if (!q.value) return;
|
|
194
|
-
e.preventDefault(), q.value = null, V.value = "Move cancelled";
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
if (e.key === " " || e.key === "Enter") {
|
|
198
|
-
if (e.preventDefault(), q.value?.item.id !== t.id) {
|
|
199
|
-
De(t, i, r);
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
if (w.nestable && e.shiftKey && Y()) {
|
|
203
|
-
Ae();
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
je();
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
[
|
|
210
|
-
"ArrowUp",
|
|
211
|
-
"ArrowDown",
|
|
212
|
-
"ArrowLeft",
|
|
213
|
-
"ArrowRight"
|
|
214
|
-
].includes(e.key) && (e.preventDefault(), q.value?.item.id === t.id ? ke(e.key) : Me(e.key, t, i, r));
|
|
215
|
-
}
|
|
216
|
-
function De(e, t, n) {
|
|
217
|
-
q.value = {
|
|
218
|
-
item: e,
|
|
219
|
-
fromLaneId: t,
|
|
220
|
-
fromColumnId: n,
|
|
221
|
-
laneId: t,
|
|
222
|
-
colId: n,
|
|
223
|
-
index: N(t, n).findIndex((t) => t.id === e.id)
|
|
224
|
-
}, V.value = `${R(e)} picked up, ${J()}`;
|
|
225
|
-
}
|
|
226
|
-
function J() {
|
|
227
|
-
let e = q.value;
|
|
228
|
-
if (!e) return "";
|
|
229
|
-
let t = N(e.laneId, e.colId).filter((t) => t.id !== e.item.id), n = P(e.colId), r = w.lanes?.find((t) => (t.id ?? null) === e.laneId) ?? null, i = n ? z(r, n) : e.colId;
|
|
230
|
-
return `position ${e.index + 1} of ${t.length + 1} in ${i}`;
|
|
231
|
-
}
|
|
232
|
-
function Oe() {
|
|
233
|
-
return !w.lanes || w.lanes.length === 0 ? [null] : w.lanes.filter((e) => !L(e.id)).map((e) => e.id ?? null);
|
|
234
|
-
}
|
|
235
|
-
function ke(e) {
|
|
236
|
-
let t = q.value;
|
|
237
|
-
if (!t) return;
|
|
238
|
-
let n = N(t.laneId, t.colId).filter((e) => e.id !== t.item.id);
|
|
239
|
-
if (e === "ArrowUp" || e === "ArrowDown") {
|
|
240
|
-
let r = e === "ArrowUp" ? -1 : 1, i = t.index + r;
|
|
241
|
-
if (i >= 0 && i <= n.length) t.index = i;
|
|
242
|
-
else {
|
|
243
|
-
let e = Oe(), n = e.indexOf(t.laneId), i = n + r;
|
|
244
|
-
if (n === -1 || i < 0 || i >= e.length) return;
|
|
245
|
-
let a = e[i];
|
|
246
|
-
t.laneId = a, t.index = r === 1 ? 0 : N(a, t.colId).filter((e) => e.id !== t.item.id).length;
|
|
247
|
-
}
|
|
248
|
-
} else {
|
|
249
|
-
let n = e === "ArrowLeft" ? -1 : 1, r = w.columns.findIndex((e) => e.id === t.colId), i = w.columns[r + n];
|
|
250
|
-
if (r === -1 || !i) return;
|
|
251
|
-
t.colId = i.id;
|
|
252
|
-
let a = N(t.laneId, t.colId).filter((e) => e.id !== t.item.id);
|
|
253
|
-
t.index = Math.min(t.index, a.length);
|
|
254
|
-
}
|
|
255
|
-
V.value = `${R(t.item)}, ${J()}`;
|
|
256
|
-
}
|
|
257
|
-
function Y() {
|
|
258
|
-
let e = q.value;
|
|
259
|
-
if (!e) return null;
|
|
260
|
-
let t = N(e.laneId, e.colId).filter((t) => t.id !== e.item.id);
|
|
261
|
-
return t.length === 0 ? null : t[Math.min(e.index, t.length - 1)] ?? null;
|
|
262
|
-
}
|
|
263
|
-
function Ae() {
|
|
264
|
-
let e = q.value, t = Y();
|
|
265
|
-
!e || !t || (q.value = null, T("nest", {
|
|
266
|
-
itemId: e.item.id,
|
|
267
|
-
ontoItemId: t.id,
|
|
268
|
-
fromColumnId: e.fromColumnId,
|
|
269
|
-
...w.lanes ? { fromLaneId: e.fromLaneId } : {}
|
|
270
|
-
}), V.value = `${R(e.item)} dropped onto ${R(t)}`);
|
|
271
|
-
}
|
|
272
|
-
function je() {
|
|
273
|
-
let e = q.value;
|
|
274
|
-
if (!e) return;
|
|
275
|
-
q.value = null;
|
|
276
|
-
let t = H({
|
|
277
|
-
item: e.item,
|
|
278
|
-
fromLaneId: e.fromLaneId,
|
|
279
|
-
fromColumnId: e.fromColumnId
|
|
280
|
-
}, e.laneId, e.colId, e.index), n = P(e.colId), r = w.lanes?.find((t) => (t.id ?? null) === e.laneId) ?? null, i = n ? z(r, n) : e.colId;
|
|
281
|
-
V.value = t ? `${R(e.item)} dropped, position ${e.index + 1} in ${i}` : `${R(e.item)} dropped`, Ne(e.item.id);
|
|
282
|
-
}
|
|
283
|
-
function Me(e, t, n, r) {
|
|
284
|
-
let i = N(n, r), a = i.findIndex((e) => e.id === t.id);
|
|
285
|
-
if (e === "ArrowUp" || e === "ArrowDown") {
|
|
286
|
-
let t = a + (e === "ArrowDown" ? 1 : -1);
|
|
287
|
-
t >= 0 && t < i.length && X(i[t].id);
|
|
288
|
-
} else {
|
|
289
|
-
let t = w.columns.findIndex((e) => e.id === r), i = w.columns[t + (e === "ArrowRight" ? 1 : -1)];
|
|
290
|
-
if (t === -1 || !i) return;
|
|
291
|
-
let o = N(n, i.id);
|
|
292
|
-
if (o.length === 0) return;
|
|
293
|
-
X(o[Math.min(a, o.length - 1)].id);
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
function X(e) {
|
|
297
|
-
let t = D.value?.querySelectorAll("[data-item-id]");
|
|
298
|
-
if (t) {
|
|
299
|
-
for (let n of t) if (n.dataset.itemId === e) {
|
|
300
|
-
n.focus();
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
async function Ne(e) {
|
|
306
|
-
await u(), await u(), X(e);
|
|
307
|
-
}
|
|
308
|
-
function Pe(e) {
|
|
309
|
-
q.value?.item.id === e.id && (q.value = null);
|
|
310
|
-
}
|
|
311
|
-
let Z = m(null), Q = m(null);
|
|
312
|
-
function Fe(e, t) {
|
|
313
|
-
if (!w.reorderableColumns) {
|
|
314
|
-
t.preventDefault();
|
|
315
|
-
return;
|
|
316
|
-
}
|
|
317
|
-
Z.value = e, Q.value = e;
|
|
318
|
-
}
|
|
319
|
-
function Ie(e, t) {
|
|
320
|
-
if (Z.value === null) return;
|
|
321
|
-
t.preventDefault();
|
|
322
|
-
let n = t.currentTarget.getBoundingClientRect();
|
|
323
|
-
Q.value = t.clientX < n.left + n.width / 2 ? e : e + 1;
|
|
324
|
-
}
|
|
325
|
-
function Le(e) {
|
|
326
|
-
let t = Z.value, n = Q.value;
|
|
327
|
-
if ($(), t === null || n === null) return;
|
|
328
|
-
e.preventDefault();
|
|
329
|
-
let r = n > t ? n - 1 : n;
|
|
330
|
-
r !== t && T("column-move", {
|
|
331
|
-
columnId: w.columns[t].id,
|
|
332
|
-
toIndex: r
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
function $() {
|
|
336
|
-
Z.value = null, Q.value = null;
|
|
337
|
-
}
|
|
338
|
-
return (e, t) => (p(), a("div", l({
|
|
339
|
-
ref_key: "boardRef",
|
|
340
|
-
ref: D,
|
|
341
|
-
class: "nb-board"
|
|
342
|
-
}, v(pe)), [
|
|
343
|
-
o("div", {
|
|
344
|
-
class: "nb-board__grid",
|
|
345
|
-
style: f(O.value)
|
|
346
|
-
}, [(p(!0), a(n, null, h(c.columns, (t, n) => (p(), a("div", {
|
|
347
|
-
key: t.id,
|
|
348
|
-
class: d(["nb-board__col-header", {
|
|
349
|
-
"nb-board__col-header--reorderable": c.reorderableColumns,
|
|
350
|
-
"nb-board__col-header--dragging": Z.value === n,
|
|
351
|
-
"nb-board__col-header--drop-before": Q.value === n,
|
|
352
|
-
"nb-board__col-header--drop-after": Q.value === n + 1 && n === c.columns.length - 1
|
|
353
|
-
}]),
|
|
354
|
-
style: f(t.color ? { borderTopColor: t.color } : void 0),
|
|
355
|
-
draggable: c.reorderableColumns || void 0,
|
|
356
|
-
onDragstart: (e) => Fe(n, e),
|
|
357
|
-
onDragover: (e) => Ie(n, e),
|
|
358
|
-
onDrop: Le,
|
|
359
|
-
onDragend: $
|
|
360
|
-
}, [g(e.$slots, "column-header", {
|
|
361
|
-
column: t,
|
|
362
|
-
count: j(t.id)
|
|
363
|
-
}, () => [o("span", ee, _(t.label), 1), o("span", te, _(j(t.id)), 1)])], 46, b))), 128)), (p(!0), a(n, null, h(me.value, (t) => (p(), a(n, { key: A(t) }, [t ? (p(), a("div", {
|
|
364
|
-
key: 0,
|
|
365
|
-
class: "nb-board__lane-header",
|
|
366
|
-
onClick: (e) => I(t.id)
|
|
367
|
-
}, [
|
|
368
|
-
o("button", {
|
|
369
|
-
class: "nb-board__collapse-btn",
|
|
370
|
-
"aria-label": L(t.id) ? "Expand" : "Collapse"
|
|
371
|
-
}, _(L(t.id) ? "▶" : "▼"), 9, re),
|
|
372
|
-
g(e.$slots, "lane-header", { lane: t }, () => [o("span", ie, _(t.label), 1)]),
|
|
373
|
-
o("span", ae, _(he(t.id)), 1)
|
|
374
|
-
], 8, ne)) : i("", !0), !t || !L(t.id) ? (p(!0), a(n, { key: 1 }, h(c.columns, (r) => (p(), a("div", {
|
|
375
|
-
key: A(t) + "-" + r.id,
|
|
376
|
-
class: d(["nb-board__cell", { "nb-board__cell--drag-over": Se(t, r.id) }]),
|
|
377
|
-
onDragover: y((e) => ye(t, r.id), ["prevent"]),
|
|
378
|
-
onDragleave: be,
|
|
379
|
-
onDrop: y((e) => Te(t, r.id), ["prevent"])
|
|
380
|
-
}, [o("div", {
|
|
381
|
-
class: "nb-board__cell-items",
|
|
382
|
-
role: "list",
|
|
383
|
-
"aria-label": ge(t, r)
|
|
384
|
-
}, [(p(!0), a(n, null, h(N(k(t), r.id), (n, i) => (p(), a("div", {
|
|
385
|
-
key: n.id,
|
|
386
|
-
class: d(["nb-board__card", {
|
|
387
|
-
"nb-board__card--lifted": q.value?.item.id === n.id,
|
|
388
|
-
"nb-board__card--drop-before": K(t, r.id) === i,
|
|
389
|
-
"nb-board__card--drop-after": we(t, r.id, i),
|
|
390
|
-
"nb-board__card--drop-into": Ce(t, r.id, n)
|
|
391
|
-
}]),
|
|
392
|
-
role: "listitem",
|
|
393
|
-
tabindex: "0",
|
|
394
|
-
"data-item-id": n.id,
|
|
395
|
-
"aria-label": B(n, t, r),
|
|
396
|
-
"aria-describedby": `${v(E)}-hint`,
|
|
397
|
-
draggable: "true",
|
|
398
|
-
onDragstart: (e) => _e(n, t, r.id),
|
|
399
|
-
onDragover: y((e) => ve(e, t, r.id, i, n), ["prevent", "stop"]),
|
|
400
|
-
onDragend: xe,
|
|
401
|
-
onKeydown: (e) => Ee(e, n, t, r.id),
|
|
402
|
-
onBlur: (e) => Pe(n)
|
|
403
|
-
}, [g(e.$slots, "card", {
|
|
404
|
-
item: n,
|
|
405
|
-
column: r,
|
|
406
|
-
lane: t ?? void 0
|
|
407
|
-
})], 42, ce))), 128)), N(k(t), r.id).length === 0 ? (p(), a("div", le)) : i("", !0)], 8, se), e.$slots["column-footer"] ? (p(), a("div", ue, [g(e.$slots, "column-footer", {
|
|
408
|
-
column: r,
|
|
409
|
-
lane: t ?? void 0
|
|
410
|
-
})])) : i("", !0)], 42, oe))), 128)) : i("", !0)], 64))), 128))], 4),
|
|
411
|
-
o("span", {
|
|
412
|
-
id: `${v(E)}-hint`,
|
|
413
|
-
class: "nb-board__sr"
|
|
414
|
-
}, [t[0] ||= s(" Press Space or Enter to pick up, arrow keys to move, Space or Enter to drop, Escape to cancel.", -1), c.nestable ? (p(), a(n, { key: 0 }, [s(" Shift with Space or Enter drops onto the card below instead, putting this one inside it.")], 64)) : i("", !0)], 8, de),
|
|
415
|
-
o("span", fe, _(V.value), 1)
|
|
416
|
-
], 16));
|
|
417
|
-
}
|
|
418
|
-
});
|
|
419
|
-
//#endregion
|
|
420
|
-
export { C as t };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|