@feitio/react 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.
- package/README.md +5 -3
- package/dist/Kanban.d.ts +40 -0
- package/dist/KanbanCard.d.ts +17 -0
- package/dist/actions/wire.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1125 -173
- package/package.json +4 -4
- package/src/Kanban.tsx +145 -0
- package/src/KanbanCard.tsx +54 -0
- package/src/actions/wire.ts +6 -0
- package/src/index.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -240,6 +240,613 @@ function forms(window2, root = window2.document) {
|
|
|
240
240
|
wireForms(window2, root);
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
+
// ../vanilla/src/kanban/calculations/kanban-rules.ts
|
|
244
|
+
function targetsOf(attribute) {
|
|
245
|
+
return (attribute ?? "").split(/\s+/).filter(Boolean);
|
|
246
|
+
}
|
|
247
|
+
function canMove(targets, from, to) {
|
|
248
|
+
return to !== from && targets.includes(to);
|
|
249
|
+
}
|
|
250
|
+
function minimapScale(mapWidth, scrollWidth) {
|
|
251
|
+
return scrollWidth > 0 ? mapWidth / scrollWidth : 0;
|
|
252
|
+
}
|
|
253
|
+
function minimapScroll(x, scale, clientWidth) {
|
|
254
|
+
return scale > 0 ? Math.max(0, x / scale - clientWidth / 2) : 0;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// ../vanilla/src/kanban/calculations/kanban-motion.ts
|
|
258
|
+
var FLY = { stiffness: 170, damping: 14 };
|
|
259
|
+
var SETTLE = { stiffness: 230, damping: 24 };
|
|
260
|
+
var HOP = { stiffness: 320, damping: 11 };
|
|
261
|
+
function springCurve(spring, maxFrames = 240) {
|
|
262
|
+
let x = 0;
|
|
263
|
+
let v = 0;
|
|
264
|
+
const out = [0];
|
|
265
|
+
const dt = 1 / 60;
|
|
266
|
+
for (let i = 0;i < maxFrames; i++) {
|
|
267
|
+
v += (-spring.stiffness * (x - 1) - spring.damping * v) * dt;
|
|
268
|
+
x += v * dt;
|
|
269
|
+
out.push(x);
|
|
270
|
+
if (Math.abs(x - 1) < 0.002 && Math.abs(v) < 0.01)
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
out[out.length - 1] = 1;
|
|
274
|
+
return out;
|
|
275
|
+
}
|
|
276
|
+
function curveDuration(curve) {
|
|
277
|
+
return curve.length * 1000 / 60;
|
|
278
|
+
}
|
|
279
|
+
function followStep(state, targetX, targetY) {
|
|
280
|
+
const vx = (state.vx + (targetX - state.x) * 0.3) * 0.62;
|
|
281
|
+
const vy = (state.vy + (targetY - state.y) * 0.3) * 0.62;
|
|
282
|
+
const lean = Math.max(-14, Math.min(14, vx * 1.2));
|
|
283
|
+
return {
|
|
284
|
+
x: state.x + vx,
|
|
285
|
+
y: state.y + vy,
|
|
286
|
+
vx,
|
|
287
|
+
vy,
|
|
288
|
+
tilt: state.tilt + (lean - state.tilt) * 0.18
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
function flightTilt(dx) {
|
|
292
|
+
return Math.max(-9, Math.min(9, dx / 35));
|
|
293
|
+
}
|
|
294
|
+
function edgesVisible(scrollLeft, clientWidth, scrollWidth) {
|
|
295
|
+
return { start: scrollLeft > 8, end: scrollLeft + clientWidth < scrollWidth - 8 };
|
|
296
|
+
}
|
|
297
|
+
function autoScrollSpeed(pointerX, left, right, zone = 90, max = 16) {
|
|
298
|
+
if (pointerX < left + zone)
|
|
299
|
+
return -((left + zone - pointerX) / zone) * max;
|
|
300
|
+
if (pointerX > right - zone)
|
|
301
|
+
return (pointerX - (right - zone)) / zone * max;
|
|
302
|
+
return 0;
|
|
303
|
+
}
|
|
304
|
+
function insertionIndex(middles, y) {
|
|
305
|
+
const i = middles.findIndex((m) => y < m);
|
|
306
|
+
return i === -1 ? middles.length : i;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// ../vanilla/src/kanban/actions/kanban-flip.ts
|
|
310
|
+
function keyOf(el) {
|
|
311
|
+
if (el.classList.contains("feitio-kanban-card"))
|
|
312
|
+
return el.dataset.id ? `card:${el.dataset.id}` : undefined;
|
|
313
|
+
const col = el.closest(".col");
|
|
314
|
+
return col ? `add:${col.dataset.col}` : undefined;
|
|
315
|
+
}
|
|
316
|
+
function pieces(board) {
|
|
317
|
+
return [
|
|
318
|
+
...board.querySelectorAll(".col > .feitio-kanban-card:not(.draft), .col > .add")
|
|
319
|
+
];
|
|
320
|
+
}
|
|
321
|
+
function snapshot(board, moving) {
|
|
322
|
+
const rects = new Map;
|
|
323
|
+
const clones = new Map;
|
|
324
|
+
for (const el of pieces(board)) {
|
|
325
|
+
const key = keyOf(el);
|
|
326
|
+
const r = el.getBoundingClientRect();
|
|
327
|
+
if (key && r.width)
|
|
328
|
+
rects.set(key, { left: r.left, top: r.top, width: r.width });
|
|
329
|
+
if (key && moving && key === `card:${moving}`)
|
|
330
|
+
clones.set(key, el.cloneNode(true));
|
|
331
|
+
}
|
|
332
|
+
const widths = new Map;
|
|
333
|
+
for (const col of board.querySelectorAll(".col")) {
|
|
334
|
+
const w = col.getBoundingClientRect().width;
|
|
335
|
+
if (w)
|
|
336
|
+
widths.set(col.dataset.col ?? "", w);
|
|
337
|
+
}
|
|
338
|
+
return { rects, widths, clones };
|
|
339
|
+
}
|
|
340
|
+
function play(el, spring, frame) {
|
|
341
|
+
if (typeof el.animate !== "function")
|
|
342
|
+
return;
|
|
343
|
+
const curve = springCurve(spring);
|
|
344
|
+
return el.animate(curve.map(frame), { duration: curveDuration(curve), easing: "linear" });
|
|
345
|
+
}
|
|
346
|
+
function reduced(window2) {
|
|
347
|
+
return window2.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false;
|
|
348
|
+
}
|
|
349
|
+
function animateFrom(window2, board, before, motion) {
|
|
350
|
+
if (reduced(window2))
|
|
351
|
+
return;
|
|
352
|
+
const after = new Map;
|
|
353
|
+
for (const el of pieces(board)) {
|
|
354
|
+
const key = keyOf(el);
|
|
355
|
+
const r = el.getBoundingClientRect();
|
|
356
|
+
if (key && r.width)
|
|
357
|
+
after.set(key, [el, r]);
|
|
358
|
+
}
|
|
359
|
+
for (const col of board.querySelectorAll(".col")) {
|
|
360
|
+
const w0 = before.widths.get(col.dataset.col ?? "");
|
|
361
|
+
const w1 = col.getBoundingClientRect().width;
|
|
362
|
+
if (!w0 || !w1 || Math.abs(w0 - w1) < 1)
|
|
363
|
+
continue;
|
|
364
|
+
play(col, SETTLE, (p) => ({
|
|
365
|
+
flexBasis: `${w0 + (w1 - w0) * p}px`,
|
|
366
|
+
flexGrow: 0,
|
|
367
|
+
flexShrink: 0
|
|
368
|
+
}));
|
|
369
|
+
}
|
|
370
|
+
const mover = motion.id ? `card:${motion.id}` : undefined;
|
|
371
|
+
for (const [key, [el, r1]] of after) {
|
|
372
|
+
const isMover = key === mover;
|
|
373
|
+
let r0 = before.rects.get(key);
|
|
374
|
+
if (isMover && motion.from)
|
|
375
|
+
r0 = { left: motion.from.x, top: motion.from.y };
|
|
376
|
+
if (!r0) {
|
|
377
|
+
if (isMover)
|
|
378
|
+
play(el, FLY, (p) => ({
|
|
379
|
+
transform: `translateY(${-24 * (1 - p)}px) scale(${1 + 0.08 * (1 - p)})`,
|
|
380
|
+
opacity: Math.min(1, p * 2)
|
|
381
|
+
}));
|
|
382
|
+
continue;
|
|
383
|
+
}
|
|
384
|
+
const dx = r0.left - r1.left;
|
|
385
|
+
const dy = r0.top - r1.top;
|
|
386
|
+
if (Math.abs(dx) < 1 && Math.abs(dy) < 1)
|
|
387
|
+
continue;
|
|
388
|
+
if (!isMover) {
|
|
389
|
+
play(el, SETTLE, (p) => ({ transform: `translate(${dx * (1 - p)}px, ${dy * (1 - p)}px)` }));
|
|
390
|
+
continue;
|
|
391
|
+
}
|
|
392
|
+
const tilt = motion.from ? motion.from.tilt : flightTilt(dx);
|
|
393
|
+
const lift = motion.from ? 0.04 : 0.06;
|
|
394
|
+
el.style.zIndex = "5";
|
|
395
|
+
const run = play(el, FLY, (p) => ({
|
|
396
|
+
transform: `translate(${dx * (1 - p)}px, ${dy * (1 - p)}px) rotate(${tilt * (1 - p)}deg) scale(${1 + lift * Math.max(0, 1 - p)})`
|
|
397
|
+
}));
|
|
398
|
+
if (run)
|
|
399
|
+
run.onfinish = () => el.style.removeProperty("z-index");
|
|
400
|
+
}
|
|
401
|
+
if (!mover)
|
|
402
|
+
return;
|
|
403
|
+
const landed = after.get(mover);
|
|
404
|
+
const cols = board.querySelector(".cols");
|
|
405
|
+
if (landed && !motion.from && cols) {
|
|
406
|
+
const r = landed[1];
|
|
407
|
+
const box = cols.getBoundingClientRect();
|
|
408
|
+
if (r.right > box.right - 72)
|
|
409
|
+
cols.scrollBy({ left: r.right - box.right + 72, behavior: "smooth" });
|
|
410
|
+
else if (r.left < box.left + 72)
|
|
411
|
+
cols.scrollBy({ left: r.left - box.left - 72, behavior: "smooth" });
|
|
412
|
+
}
|
|
413
|
+
const r0 = before.rects.get(mover);
|
|
414
|
+
const clone = before.clones.get(mover);
|
|
415
|
+
const tab = board.querySelector(`.tabs [data-col="${motion.to}"]`);
|
|
416
|
+
if (landed || !r0 || !clone || !tab || typeof tab.animate !== "function")
|
|
417
|
+
return;
|
|
418
|
+
const tr = tab.getBoundingClientRect();
|
|
419
|
+
const ghost = window2.document.createElement("div");
|
|
420
|
+
ghost.className = "feitio-kanban-ghost";
|
|
421
|
+
ghost.setAttribute("aria-hidden", "true");
|
|
422
|
+
Object.assign(ghost.style, { left: `${r0.left}px`, top: `${r0.top}px`, width: `${r0.width}px` });
|
|
423
|
+
clone.removeAttribute("id");
|
|
424
|
+
ghost.append(clone);
|
|
425
|
+
window2.document.body.append(ghost);
|
|
426
|
+
const dx = tr.left + tr.width / 2 - (r0.left + r0.width / 2);
|
|
427
|
+
const dy = tr.top + tr.height / 2 - (r0.top + clone.getBoundingClientRect().height / 2);
|
|
428
|
+
const flight = ghost.animate([
|
|
429
|
+
{ transform: "translate(0, 0) scale(1) rotate(0deg)", opacity: 1 },
|
|
430
|
+
{
|
|
431
|
+
transform: `translate(${dx * 0.35}px, ${dy * 0.35 - 30}px) scale(0.7) rotate(-5deg)`,
|
|
432
|
+
opacity: 1,
|
|
433
|
+
offset: 0.45
|
|
434
|
+
},
|
|
435
|
+
{ transform: `translate(${dx}px, ${dy}px) scale(0.08) rotate(-14deg)`, opacity: 0.2 }
|
|
436
|
+
], { duration: 560, easing: "cubic-bezier(0.45, 0, 0.8, 0.4)" });
|
|
437
|
+
flight.onfinish = () => {
|
|
438
|
+
ghost.remove();
|
|
439
|
+
play(tab, HOP, (p) => ({ transform: `scale(${1 + 0.4 * (1 - p)})` }));
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
// ../vanilla/src/kanban/actions/sync-kanban.ts
|
|
444
|
+
function setText(el, text) {
|
|
445
|
+
if (el && el.textContent !== text)
|
|
446
|
+
el.textContent = text;
|
|
447
|
+
}
|
|
448
|
+
function syncKanban(board) {
|
|
449
|
+
for (const col of board.querySelectorAll(".col")) {
|
|
450
|
+
const n = col.querySelectorAll(":scope > .feitio-kanban-card:not(.draft)").length;
|
|
451
|
+
const id = col.dataset.col ?? "";
|
|
452
|
+
if (col.hasAttribute("data-empty") !== (n === 0))
|
|
453
|
+
col.toggleAttribute("data-empty", n === 0);
|
|
454
|
+
setText(col.querySelector(".col-head .n"), String(n));
|
|
455
|
+
const empty = col.querySelector(":scope > .empty");
|
|
456
|
+
if (empty && empty.hidden !== n > 0)
|
|
457
|
+
empty.hidden = n > 0;
|
|
458
|
+
const tab = board.querySelector(`.tabs [data-col="${id}"]`);
|
|
459
|
+
if (!tab)
|
|
460
|
+
continue;
|
|
461
|
+
if (tab.hasAttribute("data-has") !== n > 0)
|
|
462
|
+
tab.toggleAttribute("data-has", n > 0);
|
|
463
|
+
setText(tab.querySelector(".n"), String(n));
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
function chooseStage(board, id) {
|
|
467
|
+
for (const col of board.querySelectorAll(".col")) {
|
|
468
|
+
const on = col.dataset.col === id;
|
|
469
|
+
if (col.hasAttribute("data-current") !== on)
|
|
470
|
+
col.toggleAttribute("data-current", on);
|
|
471
|
+
}
|
|
472
|
+
for (const tab of board.querySelectorAll(".tabs [data-col]")) {
|
|
473
|
+
tab.setAttribute("aria-pressed", String(tab.dataset.col === id));
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// ../vanilla/src/kanban/actions/move-card.ts
|
|
478
|
+
function moveCard(window2, board, card, to, index, before, from) {
|
|
479
|
+
const fromCol = card.closest(".col")?.dataset.col ?? "";
|
|
480
|
+
const id = card.dataset.id ?? "";
|
|
481
|
+
const target = board.querySelector(`.col[data-col="${to}"]`);
|
|
482
|
+
if (!target || !canMove(targetsOf(card.dataset.to), fromCol, to))
|
|
483
|
+
return false;
|
|
484
|
+
const cards = [
|
|
485
|
+
...target.querySelectorAll(":scope > .feitio-kanban-card:not(.draft)")
|
|
486
|
+
];
|
|
487
|
+
const place = index === undefined ? cards.length : Math.min(index, cards.length);
|
|
488
|
+
const picture = before ?? snapshot(board, id);
|
|
489
|
+
if (!picture.clones.size) {
|
|
490
|
+
const own = snapshot(board, id).clones;
|
|
491
|
+
for (const [k, v] of own)
|
|
492
|
+
picture.clones.set(k, v);
|
|
493
|
+
}
|
|
494
|
+
const detail = { card, id, from: fromCol, to, index: place };
|
|
495
|
+
const event = new CustomEvent("feitio-kanban-move", {
|
|
496
|
+
bubbles: true,
|
|
497
|
+
cancelable: true,
|
|
498
|
+
detail
|
|
499
|
+
});
|
|
500
|
+
const done = () => {
|
|
501
|
+
syncKanban(board);
|
|
502
|
+
animateFrom(window2, board, picture, { id, to, from });
|
|
503
|
+
};
|
|
504
|
+
if (board.dispatchEvent(event)) {
|
|
505
|
+
const ref = cards[place] ?? target.querySelector(":scope > .add");
|
|
506
|
+
target.insertBefore(card, ref);
|
|
507
|
+
syncKanban(board);
|
|
508
|
+
window2.requestAnimationFrame(done);
|
|
509
|
+
} else {
|
|
510
|
+
window2.requestAnimationFrame(() => window2.requestAnimationFrame(done));
|
|
511
|
+
}
|
|
512
|
+
return true;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
// ../vanilla/src/kanban/actions/wire-create.ts
|
|
516
|
+
var drafts = 0;
|
|
517
|
+
function wireCreate(window2, board) {
|
|
518
|
+
const doc = window2.document;
|
|
519
|
+
board.addEventListener("click", (event) => {
|
|
520
|
+
const add = event.target.closest(".col > .add");
|
|
521
|
+
if (!add || !board.contains(add))
|
|
522
|
+
return;
|
|
523
|
+
const col = add.parentElement;
|
|
524
|
+
const id = `${board.id || "kanban"}-new-${++drafts}`;
|
|
525
|
+
const form = doc.createElement("form");
|
|
526
|
+
form.className = "feitio-kanban-card draft feitio-place";
|
|
527
|
+
const label = doc.createElement("label");
|
|
528
|
+
label.htmlFor = id;
|
|
529
|
+
label.textContent = add.dataset.field ?? "";
|
|
530
|
+
const field = doc.createElement("textarea");
|
|
531
|
+
field.className = "feitio-textarea";
|
|
532
|
+
field.id = id;
|
|
533
|
+
field.required = true;
|
|
534
|
+
field.rows = 2;
|
|
535
|
+
const actions = doc.createElement("div");
|
|
536
|
+
actions.className = "actions";
|
|
537
|
+
const save = doc.createElement("button");
|
|
538
|
+
save.type = "submit";
|
|
539
|
+
save.className = "feitio-button";
|
|
540
|
+
save.dataset.variant = "primary";
|
|
541
|
+
save.dataset.size = "small";
|
|
542
|
+
save.textContent = add.dataset.save ?? "Save";
|
|
543
|
+
const cancel = doc.createElement("button");
|
|
544
|
+
cancel.type = "button";
|
|
545
|
+
cancel.className = "feitio-button";
|
|
546
|
+
cancel.dataset.size = "small";
|
|
547
|
+
cancel.textContent = add.dataset.cancel ?? "Cancel";
|
|
548
|
+
actions.append(save, cancel);
|
|
549
|
+
form.append(label, field, actions);
|
|
550
|
+
add.hidden = true;
|
|
551
|
+
col.insertBefore(form, add);
|
|
552
|
+
field.focus();
|
|
553
|
+
const close = () => {
|
|
554
|
+
form.remove();
|
|
555
|
+
add.hidden = false;
|
|
556
|
+
add.focus();
|
|
557
|
+
};
|
|
558
|
+
cancel.addEventListener("click", close);
|
|
559
|
+
form.addEventListener("keydown", (e) => {
|
|
560
|
+
if (e.key === "Escape")
|
|
561
|
+
close();
|
|
562
|
+
});
|
|
563
|
+
form.addEventListener("submit", (e) => {
|
|
564
|
+
e.preventDefault();
|
|
565
|
+
const text = field.value.trim();
|
|
566
|
+
if (!text)
|
|
567
|
+
return field.focus();
|
|
568
|
+
const before = snapshot(board);
|
|
569
|
+
const known = new Set([...col.querySelectorAll(":scope > .feitio-kanban-card")].map((c) => c.dataset.id));
|
|
570
|
+
const detail = { column: col.dataset.col ?? "", element: col, text };
|
|
571
|
+
board.dispatchEvent(new CustomEvent("feitio-kanban-create", { bubbles: true, detail }));
|
|
572
|
+
close();
|
|
573
|
+
window2.requestAnimationFrame(() => {
|
|
574
|
+
syncKanban(board);
|
|
575
|
+
const fresh = [
|
|
576
|
+
...col.querySelectorAll(":scope > .feitio-kanban-card:not(.draft)")
|
|
577
|
+
].find((c) => !known.has(c.dataset.id));
|
|
578
|
+
animateFrom(window2, board, before, { id: fresh?.dataset.id });
|
|
579
|
+
});
|
|
580
|
+
});
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
// ../vanilla/src/kanban/actions/wire-drag.ts
|
|
585
|
+
function wireDrag(window2, board) {
|
|
586
|
+
const doc = window2.document;
|
|
587
|
+
const cols = () => board.querySelector(".cols");
|
|
588
|
+
board.addEventListener("pointerdown", (event) => {
|
|
589
|
+
const card = event.target.closest(".col > .feitio-kanban-card");
|
|
590
|
+
if (!card || !board.contains(card) || card.classList.contains("draft"))
|
|
591
|
+
return;
|
|
592
|
+
if (event.button !== 0 || event.pointerType === "touch")
|
|
593
|
+
return;
|
|
594
|
+
if (event.target.closest("button, a, input, textarea, select, label"))
|
|
595
|
+
return;
|
|
596
|
+
if (!targetsOf(card.dataset.to).length)
|
|
597
|
+
return;
|
|
598
|
+
const row = cols();
|
|
599
|
+
if (!row || window2.getComputedStyle(row).display !== "flex")
|
|
600
|
+
return;
|
|
601
|
+
event.preventDefault();
|
|
602
|
+
const sx = event.clientX;
|
|
603
|
+
const sy = event.clientY;
|
|
604
|
+
let held;
|
|
605
|
+
const stop = () => {
|
|
606
|
+
window2.removeEventListener("pointermove", onMove);
|
|
607
|
+
window2.removeEventListener("pointerup", onUp);
|
|
608
|
+
window2.removeEventListener("keydown", onKey);
|
|
609
|
+
};
|
|
610
|
+
const onMove = (e) => {
|
|
611
|
+
if (!held) {
|
|
612
|
+
if (Math.hypot(e.clientX - sx, e.clientY - sy) < 5)
|
|
613
|
+
return;
|
|
614
|
+
held = lift(e, card);
|
|
615
|
+
}
|
|
616
|
+
held.px = e.clientX;
|
|
617
|
+
held.py = e.clientY;
|
|
618
|
+
hover(held);
|
|
619
|
+
};
|
|
620
|
+
const onUp = () => {
|
|
621
|
+
stop();
|
|
622
|
+
if (held)
|
|
623
|
+
letGo(held, false);
|
|
624
|
+
};
|
|
625
|
+
const onKey = (e) => {
|
|
626
|
+
if (e.key !== "Escape" || !held)
|
|
627
|
+
return;
|
|
628
|
+
stop();
|
|
629
|
+
letGo(held, true);
|
|
630
|
+
};
|
|
631
|
+
window2.addEventListener("pointermove", onMove);
|
|
632
|
+
window2.addEventListener("pointerup", onUp);
|
|
633
|
+
window2.addEventListener("keydown", onKey);
|
|
634
|
+
});
|
|
635
|
+
function lift(event, card) {
|
|
636
|
+
const r = card.getBoundingClientRect();
|
|
637
|
+
const ghost = doc.createElement("div");
|
|
638
|
+
ghost.className = "feitio-kanban-ghost";
|
|
639
|
+
ghost.dataset.motion = "direct";
|
|
640
|
+
ghost.setAttribute("aria-hidden", "true");
|
|
641
|
+
ghost.style.width = `${r.width}px`;
|
|
642
|
+
const copy = card.cloneNode(true);
|
|
643
|
+
copy.removeAttribute("id");
|
|
644
|
+
ghost.append(copy);
|
|
645
|
+
doc.body.append(ghost);
|
|
646
|
+
const slot = doc.createElement("div");
|
|
647
|
+
slot.className = "slot";
|
|
648
|
+
slot.style.blockSize = `${r.height}px`;
|
|
649
|
+
const home = card.closest(".col");
|
|
650
|
+
const homeNext = card.nextSibling;
|
|
651
|
+
card.replaceWith(slot);
|
|
652
|
+
doc.documentElement.setAttribute("data-kanban-dragging", "");
|
|
653
|
+
board.setAttribute("data-dragging", "");
|
|
654
|
+
const targets = targetsOf(card.dataset.to);
|
|
655
|
+
for (const col of board.querySelectorAll(".col")) {
|
|
656
|
+
if (col !== home && !targets.includes(col.dataset.col ?? ""))
|
|
657
|
+
col.setAttribute("data-blocked", "");
|
|
658
|
+
}
|
|
659
|
+
const held = {
|
|
660
|
+
card,
|
|
661
|
+
ghost,
|
|
662
|
+
slot,
|
|
663
|
+
home,
|
|
664
|
+
homeNext,
|
|
665
|
+
offX: event.clientX - r.left,
|
|
666
|
+
offY: event.clientY - r.top,
|
|
667
|
+
x: r.left,
|
|
668
|
+
y: r.top,
|
|
669
|
+
vx: 0,
|
|
670
|
+
vy: 0,
|
|
671
|
+
tilt: 0,
|
|
672
|
+
px: event.clientX,
|
|
673
|
+
py: event.clientY,
|
|
674
|
+
running: true
|
|
675
|
+
};
|
|
676
|
+
follow(held);
|
|
677
|
+
return held;
|
|
678
|
+
}
|
|
679
|
+
function follow(held) {
|
|
680
|
+
if (!held.running)
|
|
681
|
+
return;
|
|
682
|
+
const tx = held.px - held.offX;
|
|
683
|
+
const ty = held.py - held.offY;
|
|
684
|
+
if (reduced(window2))
|
|
685
|
+
Object.assign(held, { x: tx, y: ty, vx: 0, vy: 0, tilt: 0 });
|
|
686
|
+
else
|
|
687
|
+
Object.assign(held, followStep(held, tx, ty));
|
|
688
|
+
held.ghost.style.transform = `translate(${held.x}px, ${held.y}px) rotate(${held.tilt}deg) scale(1.04)`;
|
|
689
|
+
const row = cols();
|
|
690
|
+
if (row) {
|
|
691
|
+
const r = row.getBoundingClientRect();
|
|
692
|
+
const v = autoScrollSpeed(held.px, r.left, r.right);
|
|
693
|
+
if (v) {
|
|
694
|
+
row.scrollLeft += v;
|
|
695
|
+
hover(held);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
window2.requestAnimationFrame(() => follow(held));
|
|
699
|
+
}
|
|
700
|
+
function hover(held) {
|
|
701
|
+
const under = doc.elementFromPoint(held.px, held.py)?.closest(".col");
|
|
702
|
+
const ok = Boolean(under && board.contains(under) && under !== held.home && !under.hasAttribute("data-blocked"));
|
|
703
|
+
const dest = ok && under ? under : held.home;
|
|
704
|
+
let before;
|
|
705
|
+
if (ok) {
|
|
706
|
+
const cards = [
|
|
707
|
+
...dest.querySelectorAll(":scope > .feitio-kanban-card:not(.draft)")
|
|
708
|
+
];
|
|
709
|
+
const i = insertionIndex(cards.map((c) => {
|
|
710
|
+
const r = c.getBoundingClientRect();
|
|
711
|
+
return r.top + r.height / 2;
|
|
712
|
+
}), held.py);
|
|
713
|
+
before = cards[i] ?? dest.querySelector(":scope > .add");
|
|
714
|
+
} else {
|
|
715
|
+
before = held.homeNext && held.homeNext.parentNode === held.home ? held.homeNext : held.home.querySelector(":scope > .add");
|
|
716
|
+
}
|
|
717
|
+
for (const col of board.querySelectorAll(".col"))
|
|
718
|
+
col.toggleAttribute("data-over", ok && col === under);
|
|
719
|
+
if (held.slot.parentNode === dest && held.slot.nextSibling === before)
|
|
720
|
+
return;
|
|
721
|
+
const moving = [
|
|
722
|
+
...board.querySelectorAll(".col > .feitio-kanban-card, .col > .add")
|
|
723
|
+
];
|
|
724
|
+
const first = new Map(moving.map((m) => [m, m.getBoundingClientRect()]));
|
|
725
|
+
const widths = new Map([...board.querySelectorAll(".col")].map((c) => [
|
|
726
|
+
c,
|
|
727
|
+
c.getBoundingClientRect().width
|
|
728
|
+
]));
|
|
729
|
+
if (held.opened && held.opened !== dest) {
|
|
730
|
+
held.opened.setAttribute("data-empty", "");
|
|
731
|
+
held.opened = undefined;
|
|
732
|
+
}
|
|
733
|
+
if (dest !== held.home && dest.hasAttribute("data-empty")) {
|
|
734
|
+
dest.removeAttribute("data-empty");
|
|
735
|
+
held.opened = dest;
|
|
736
|
+
}
|
|
737
|
+
dest.insertBefore(held.slot, before);
|
|
738
|
+
if (reduced(window2))
|
|
739
|
+
return;
|
|
740
|
+
for (const [col, w0] of widths) {
|
|
741
|
+
const w1 = col.getBoundingClientRect().width;
|
|
742
|
+
if (Math.abs(w1 - w0) > 1)
|
|
743
|
+
play(col, SETTLE, (p) => ({
|
|
744
|
+
flexBasis: `${w0 + (w1 - w0) * p}px`,
|
|
745
|
+
flexGrow: 0,
|
|
746
|
+
flexShrink: 0
|
|
747
|
+
}));
|
|
748
|
+
}
|
|
749
|
+
for (const m of moving) {
|
|
750
|
+
const a = first.get(m);
|
|
751
|
+
const b = m.getBoundingClientRect();
|
|
752
|
+
const dx = a.left - b.left;
|
|
753
|
+
const dy = a.top - b.top;
|
|
754
|
+
if (Math.abs(dx) > 0.5 || Math.abs(dy) > 0.5)
|
|
755
|
+
play(m, SETTLE, (p) => ({ transform: `translate(${dx * (1 - p)}px, ${dy * (1 - p)}px)` }));
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
function letGo(held, cancel) {
|
|
759
|
+
held.running = false;
|
|
760
|
+
doc.documentElement.removeAttribute("data-kanban-dragging");
|
|
761
|
+
board.removeAttribute("data-dragging");
|
|
762
|
+
for (const col of board.querySelectorAll(".col")) {
|
|
763
|
+
col.removeAttribute("data-blocked");
|
|
764
|
+
col.removeAttribute("data-over");
|
|
765
|
+
}
|
|
766
|
+
const dest = held.slot.closest(".col");
|
|
767
|
+
const index = [
|
|
768
|
+
...dest.querySelectorAll(":scope > .feitio-kanban-card:not(.draft), :scope > .slot")
|
|
769
|
+
].indexOf(held.slot);
|
|
770
|
+
const id = held.card.dataset.id ?? "";
|
|
771
|
+
const before = snapshot(board);
|
|
772
|
+
const from = { x: held.x, y: held.y, tilt: held.tilt };
|
|
773
|
+
held.ghost.remove();
|
|
774
|
+
held.home.insertBefore(held.card, held.homeNext && held.homeNext.parentNode === held.home ? held.homeNext : null);
|
|
775
|
+
held.slot.remove();
|
|
776
|
+
if (held.opened)
|
|
777
|
+
held.opened.setAttribute("data-empty", "");
|
|
778
|
+
if (!cancel && dest !== held.home && moveCard(window2, board, held.card, dest.dataset.col ?? "", index, before, from))
|
|
779
|
+
return;
|
|
780
|
+
window2.requestAnimationFrame(() => animateFrom(window2, board, before, { id, from }));
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
// ../vanilla/src/kanban/actions/wire-minimap.ts
|
|
785
|
+
var WIDTH = 176;
|
|
786
|
+
function wireMinimap(window2, board) {
|
|
787
|
+
const map = board.querySelector(":scope > .minimap");
|
|
788
|
+
const cols = board.querySelector(".cols");
|
|
789
|
+
if (!map || !cols)
|
|
790
|
+
return () => {};
|
|
791
|
+
let scale = 0;
|
|
792
|
+
const pad = 4;
|
|
793
|
+
const place = () => {
|
|
794
|
+
const view = map.querySelector(".view");
|
|
795
|
+
if (!view)
|
|
796
|
+
return;
|
|
797
|
+
view.style.insetInlineStart = `${pad + cols.scrollLeft * scale}px`;
|
|
798
|
+
view.style.inlineSize = `${cols.clientWidth * scale}px`;
|
|
799
|
+
};
|
|
800
|
+
const build = () => {
|
|
801
|
+
const wide = window2.getComputedStyle(cols).display === "flex";
|
|
802
|
+
const over = wide && cols.scrollWidth > cols.clientWidth + 8;
|
|
803
|
+
map.hidden = !over;
|
|
804
|
+
if (!over)
|
|
805
|
+
return;
|
|
806
|
+
scale = minimapScale(WIDTH, cols.scrollWidth);
|
|
807
|
+
map.replaceChildren();
|
|
808
|
+
for (const col of cols.querySelectorAll(".col")) {
|
|
809
|
+
const m = window2.document.createElement("div");
|
|
810
|
+
m.className = "m-col";
|
|
811
|
+
m.style.inlineSize = `${Math.max(6, col.offsetWidth * scale)}px`;
|
|
812
|
+
if (col.hasAttribute("data-empty"))
|
|
813
|
+
m.dataset.empty = "";
|
|
814
|
+
for (const _ of col.querySelectorAll(":scope > .feitio-kanban-card:not(.draft)")) {
|
|
815
|
+
const c = window2.document.createElement("i");
|
|
816
|
+
c.className = "m-card";
|
|
817
|
+
m.append(c);
|
|
818
|
+
}
|
|
819
|
+
map.append(m);
|
|
820
|
+
}
|
|
821
|
+
const view = window2.document.createElement("span");
|
|
822
|
+
view.className = "view";
|
|
823
|
+
map.append(view);
|
|
824
|
+
place();
|
|
825
|
+
};
|
|
826
|
+
const go = (event) => {
|
|
827
|
+
const r = map.getBoundingClientRect();
|
|
828
|
+
cols.scrollLeft = minimapScroll(event.clientX - r.left - pad, scale, cols.clientWidth);
|
|
829
|
+
};
|
|
830
|
+
let dragging = false;
|
|
831
|
+
map.addEventListener("pointerdown", (event) => {
|
|
832
|
+
dragging = true;
|
|
833
|
+
map.setPointerCapture?.(event.pointerId);
|
|
834
|
+
go(event);
|
|
835
|
+
});
|
|
836
|
+
map.addEventListener("pointermove", (event) => {
|
|
837
|
+
if (dragging)
|
|
838
|
+
go(event);
|
|
839
|
+
});
|
|
840
|
+
map.addEventListener("pointerup", () => {
|
|
841
|
+
dragging = false;
|
|
842
|
+
});
|
|
843
|
+
cols.addEventListener("scroll", place, { passive: true });
|
|
844
|
+
if (typeof ResizeObserver === "function")
|
|
845
|
+
new ResizeObserver(build).observe(cols);
|
|
846
|
+
build();
|
|
847
|
+
return build;
|
|
848
|
+
}
|
|
849
|
+
|
|
243
850
|
// ../vanilla/src/menu/calculations/menu-focus.ts
|
|
244
851
|
function nextMenuIndex(key, current, count) {
|
|
245
852
|
if (count === 0)
|
|
@@ -265,14 +872,167 @@ function menuPosition(button, menu, viewport, gap) {
|
|
|
265
872
|
return { left, top };
|
|
266
873
|
}
|
|
267
874
|
|
|
268
|
-
// ../vanilla/src/
|
|
875
|
+
// ../vanilla/src/kanban/actions/wire-move-menu.ts
|
|
876
|
+
function wireMoveMenu(window2, board) {
|
|
877
|
+
const doc = window2.document;
|
|
878
|
+
let list;
|
|
879
|
+
let opener;
|
|
880
|
+
const make = () => {
|
|
881
|
+
const ul = doc.createElement("ul");
|
|
882
|
+
ul.className = "feitio-menu-list feitio-kanban-menu";
|
|
883
|
+
ul.id = `${board.id || "kanban"}-move`;
|
|
884
|
+
ul.setAttribute("popover", "auto");
|
|
885
|
+
doc.body.append(ul);
|
|
886
|
+
ul.addEventListener("toggle", (event) => {
|
|
887
|
+
if (event.newState === "closed")
|
|
888
|
+
opener?.setAttribute("aria-expanded", "false");
|
|
889
|
+
});
|
|
890
|
+
ul.addEventListener("keydown", (event) => {
|
|
891
|
+
const all = items();
|
|
892
|
+
const next = nextMenuIndex(event.key, all.indexOf(doc.activeElement), all.length);
|
|
893
|
+
if (next === undefined)
|
|
894
|
+
return;
|
|
895
|
+
event.preventDefault();
|
|
896
|
+
all[next]?.focus();
|
|
897
|
+
});
|
|
898
|
+
return ul;
|
|
899
|
+
};
|
|
900
|
+
const items = () => [...list?.querySelectorAll("button") ?? []];
|
|
901
|
+
board.addEventListener("click", (event) => {
|
|
902
|
+
const button = event.target.closest(".feitio-kanban-card > .move");
|
|
903
|
+
if (!button || !board.contains(button))
|
|
904
|
+
return;
|
|
905
|
+
const card = button.parentElement;
|
|
906
|
+
opener = button;
|
|
907
|
+
list ??= make();
|
|
908
|
+
const menu = list;
|
|
909
|
+
menu.replaceChildren();
|
|
910
|
+
const head = doc.createElement("li");
|
|
911
|
+
head.className = "head";
|
|
912
|
+
head.setAttribute("role", "presentation");
|
|
913
|
+
head.textContent = board.dataset.moveLabel ?? "Move to";
|
|
914
|
+
menu.append(head);
|
|
915
|
+
for (const to of targetsOf(card.dataset.to)) {
|
|
916
|
+
const title = board.querySelector(`.col[data-col="${to}"] .col-head h3`)?.textContent?.trim();
|
|
917
|
+
if (!title)
|
|
918
|
+
continue;
|
|
919
|
+
const li = doc.createElement("li");
|
|
920
|
+
const choice = doc.createElement("button");
|
|
921
|
+
choice.type = "button";
|
|
922
|
+
choice.textContent = title;
|
|
923
|
+
choice.addEventListener("click", () => {
|
|
924
|
+
menu.hidePopover?.();
|
|
925
|
+
if (moveCard(window2, board, card, to))
|
|
926
|
+
window2.requestAnimationFrame(() => card.querySelector(":scope > .move")?.focus({ preventScroll: true }));
|
|
927
|
+
});
|
|
928
|
+
li.append(choice);
|
|
929
|
+
menu.append(li);
|
|
930
|
+
}
|
|
931
|
+
menu.showPopover?.();
|
|
932
|
+
button.setAttribute("aria-expanded", "true");
|
|
933
|
+
const place = menuPosition(button.getBoundingClientRect(), menu.getBoundingClientRect(), { width: window2.innerWidth, height: window2.innerHeight }, 8);
|
|
934
|
+
menu.style.left = `${place.left}px`;
|
|
935
|
+
menu.style.top = `${place.top}px`;
|
|
936
|
+
items()[0]?.focus();
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
// ../vanilla/src/kanban/actions/wire-scroll-row.ts
|
|
941
|
+
function wireScrollRow(box) {
|
|
942
|
+
const row = box.querySelector(":scope > .tabs, :scope > .cols");
|
|
943
|
+
const start = box.querySelector(":scope > .edge.start");
|
|
944
|
+
const end = box.querySelector(":scope > .edge.end");
|
|
945
|
+
if (!row)
|
|
946
|
+
return;
|
|
947
|
+
const sync = () => {
|
|
948
|
+
const seen = edgesVisible(row.scrollLeft, row.clientWidth, row.scrollWidth);
|
|
949
|
+
start?.toggleAttribute("data-visible", seen.start);
|
|
950
|
+
end?.toggleAttribute("data-visible", seen.end);
|
|
951
|
+
};
|
|
952
|
+
row.addEventListener("scroll", sync, { passive: true });
|
|
953
|
+
if (typeof ResizeObserver === "function")
|
|
954
|
+
new ResizeObserver(sync).observe(row);
|
|
955
|
+
sync();
|
|
956
|
+
if (!row.classList.contains("tabs"))
|
|
957
|
+
return;
|
|
958
|
+
row.addEventListener("wheel", (event) => {
|
|
959
|
+
if (row.scrollWidth <= row.clientWidth || Math.abs(event.deltaX) > Math.abs(event.deltaY))
|
|
960
|
+
return;
|
|
961
|
+
event.preventDefault();
|
|
962
|
+
row.scrollLeft += event.deltaY;
|
|
963
|
+
}, { passive: false });
|
|
964
|
+
let down;
|
|
965
|
+
row.addEventListener("pointerdown", (event) => {
|
|
966
|
+
if (event.pointerType === "mouse")
|
|
967
|
+
down = { x: event.clientX, scroll: row.scrollLeft, moved: false, id: event.pointerId };
|
|
968
|
+
});
|
|
969
|
+
row.addEventListener("pointermove", (event) => {
|
|
970
|
+
if (!down)
|
|
971
|
+
return;
|
|
972
|
+
const d = event.clientX - down.x;
|
|
973
|
+
if (!down.moved && Math.abs(d) > 4) {
|
|
974
|
+
down.moved = true;
|
|
975
|
+
row.setPointerCapture?.(down.id);
|
|
976
|
+
}
|
|
977
|
+
if (down.moved)
|
|
978
|
+
row.scrollLeft = down.scroll - d;
|
|
979
|
+
});
|
|
980
|
+
row.addEventListener("pointerup", () => {
|
|
981
|
+
if (down?.moved)
|
|
982
|
+
row.addEventListener("click", (e) => {
|
|
983
|
+
e.stopPropagation();
|
|
984
|
+
e.preventDefault();
|
|
985
|
+
}, { capture: true, once: true });
|
|
986
|
+
down = undefined;
|
|
987
|
+
});
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
// ../vanilla/src/kanban/actions/wire-kanbans.ts
|
|
269
991
|
var wired2 = new WeakSet;
|
|
992
|
+
function wireKanbans(window2, root) {
|
|
993
|
+
const self = root.matches?.(".feitio-kanban") ? [root] : [];
|
|
994
|
+
const boards = [...self, ...root.querySelectorAll(".feitio-kanban")];
|
|
995
|
+
for (const board of boards) {
|
|
996
|
+
if (wired2.has(board))
|
|
997
|
+
continue;
|
|
998
|
+
wired2.add(board);
|
|
999
|
+
board.querySelector(".tabs")?.addEventListener("click", (event) => {
|
|
1000
|
+
const tab = event.target.closest("[data-col]");
|
|
1001
|
+
if (tab?.dataset.col)
|
|
1002
|
+
chooseStage(board, tab.dataset.col);
|
|
1003
|
+
});
|
|
1004
|
+
for (const box of board.querySelectorAll(":scope > .feitio-kanban-scroll"))
|
|
1005
|
+
wireScrollRow(box);
|
|
1006
|
+
const rebuild = wireMinimap(window2, board);
|
|
1007
|
+
wireMoveMenu(window2, board);
|
|
1008
|
+
wireDrag(window2, board);
|
|
1009
|
+
wireCreate(window2, board);
|
|
1010
|
+
board.addEventListener("feitio-kanban-move", () => window2.requestAnimationFrame(rebuild));
|
|
1011
|
+
board.addEventListener("feitio-kanban-create", () => window2.requestAnimationFrame(rebuild));
|
|
1012
|
+
syncKanban(board);
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
// ../vanilla/src/kanban/index.ts
|
|
1017
|
+
function kanbans(window2, root = window2.document) {
|
|
1018
|
+
wireKanbans(window2, root);
|
|
1019
|
+
return {
|
|
1020
|
+
move: (card, to, index) => {
|
|
1021
|
+
const board = card.closest(".feitio-kanban");
|
|
1022
|
+
return board ? moveCard(window2, board, card, to, index) : false;
|
|
1023
|
+
},
|
|
1024
|
+
sync: syncKanban
|
|
1025
|
+
};
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
// ../vanilla/src/menu/actions/wire-menus.ts
|
|
1029
|
+
var wired3 = new WeakSet;
|
|
270
1030
|
function wireMenus(window2, root) {
|
|
271
1031
|
for (const list of root.querySelectorAll(".feitio-menu-list[popover]")) {
|
|
272
1032
|
const button = root.querySelector(`[popovertarget="${list.id}"]`);
|
|
273
|
-
if (!button ||
|
|
1033
|
+
if (!button || wired3.has(list))
|
|
274
1034
|
continue;
|
|
275
|
-
|
|
1035
|
+
wired3.add(list);
|
|
276
1036
|
const items = () => [...list.querySelectorAll("a, button")];
|
|
277
1037
|
list.addEventListener("toggle", (event) => {
|
|
278
1038
|
const open = event.newState === "open";
|
|
@@ -450,7 +1210,7 @@ function showNotice(host, notice) {
|
|
|
450
1210
|
}
|
|
451
1211
|
|
|
452
1212
|
// ../vanilla/src/notice/actions/wire-notices.ts
|
|
453
|
-
var
|
|
1213
|
+
var wired4 = new WeakSet;
|
|
454
1214
|
function wireNotices(host, root) {
|
|
455
1215
|
const own = "matches" in root && root.matches(".feitio-notice");
|
|
456
1216
|
const notices = [
|
|
@@ -467,9 +1227,9 @@ function wireNotices(host, root) {
|
|
|
467
1227
|
}
|
|
468
1228
|
}, { threshold: 0.9 }) : undefined;
|
|
469
1229
|
for (const notice of notices) {
|
|
470
|
-
if (
|
|
1230
|
+
if (wired4.has(notice))
|
|
471
1231
|
continue;
|
|
472
|
-
|
|
1232
|
+
wired4.add(notice);
|
|
473
1233
|
notice.querySelector(".close")?.addEventListener("click", () => closeNotice(host, notice));
|
|
474
1234
|
if (!notice.dataset.timeout || notice.hidden)
|
|
475
1235
|
continue;
|
|
@@ -520,6 +1280,9 @@ function wireNotice(element) {
|
|
|
520
1280
|
function wireScroll(element) {
|
|
521
1281
|
scrolls(window, element.parentElement ?? element);
|
|
522
1282
|
}
|
|
1283
|
+
function wireKanban(element) {
|
|
1284
|
+
kanbans(window, element);
|
|
1285
|
+
}
|
|
523
1286
|
|
|
524
1287
|
// src/Nav.tsx
|
|
525
1288
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
@@ -1527,25 +2290,212 @@ function Inline({ gap = 3, justify, as: Tag = "div", children }) {
|
|
|
1527
2290
|
children
|
|
1528
2291
|
});
|
|
1529
2292
|
}
|
|
2293
|
+
// src/Kanban.tsx
|
|
2294
|
+
import { Children, useEffect as useEffect3, useRef as useRef3 } from "react";
|
|
2295
|
+
import { jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2296
|
+
function Kanban({
|
|
2297
|
+
id,
|
|
2298
|
+
label,
|
|
2299
|
+
columns,
|
|
2300
|
+
cards = {},
|
|
2301
|
+
current,
|
|
2302
|
+
moveLabel = "Mover para",
|
|
2303
|
+
onMove,
|
|
2304
|
+
onCreate,
|
|
2305
|
+
sprite
|
|
2306
|
+
}) {
|
|
2307
|
+
const ref = useRef3(null);
|
|
2308
|
+
useElementBehavior(ref, "kanban", wireKanban);
|
|
2309
|
+
const handlers = useRef3({ onMove, onCreate });
|
|
2310
|
+
handlers.current = { onMove, onCreate };
|
|
2311
|
+
useEffect3(() => {
|
|
2312
|
+
const board = ref.current;
|
|
2313
|
+
if (!board)
|
|
2314
|
+
return;
|
|
2315
|
+
const move = (event) => {
|
|
2316
|
+
const { onMove: handle } = handlers.current;
|
|
2317
|
+
if (!handle)
|
|
2318
|
+
return;
|
|
2319
|
+
event.preventDefault();
|
|
2320
|
+
const { id: card, from, to, index } = event.detail;
|
|
2321
|
+
handle({ id: card, from, to, index });
|
|
2322
|
+
};
|
|
2323
|
+
const create = (event) => {
|
|
2324
|
+
const { column, text } = event.detail;
|
|
2325
|
+
handlers.current.onCreate?.(column, text);
|
|
2326
|
+
};
|
|
2327
|
+
board.addEventListener("feitio-kanban-move", move);
|
|
2328
|
+
board.addEventListener("feitio-kanban-create", create);
|
|
2329
|
+
return () => {
|
|
2330
|
+
board.removeEventListener("feitio-kanban-move", move);
|
|
2331
|
+
board.removeEventListener("feitio-kanban-create", create);
|
|
2332
|
+
};
|
|
2333
|
+
}, []);
|
|
2334
|
+
const shown = current ?? columns[0]?.id;
|
|
2335
|
+
const rendered = columns.map((c) => ({ ...c, n: Children.toArray(cards[c.id]).length }));
|
|
2336
|
+
return /* @__PURE__ */ jsxs21("div", {
|
|
2337
|
+
className: "feitio-kanban",
|
|
2338
|
+
id,
|
|
2339
|
+
"data-move-label": moveLabel,
|
|
2340
|
+
ref,
|
|
2341
|
+
children: [
|
|
2342
|
+
/* @__PURE__ */ jsxs21("div", {
|
|
2343
|
+
className: "feitio-kanban-scroll tabs-scroll",
|
|
2344
|
+
children: [
|
|
2345
|
+
/* @__PURE__ */ jsx30("span", {
|
|
2346
|
+
className: "edge start",
|
|
2347
|
+
"aria-hidden": "true"
|
|
2348
|
+
}),
|
|
2349
|
+
/* @__PURE__ */ jsx30("div", {
|
|
2350
|
+
className: "tabs",
|
|
2351
|
+
role: "group",
|
|
2352
|
+
"aria-label": label,
|
|
2353
|
+
children: rendered.map((c) => /* @__PURE__ */ jsxs21("button", {
|
|
2354
|
+
type: "button",
|
|
2355
|
+
"data-col": c.id,
|
|
2356
|
+
"aria-pressed": c.id === shown ? "true" : "false",
|
|
2357
|
+
"data-has": c.n ? "" : undefined,
|
|
2358
|
+
children: [
|
|
2359
|
+
c.title,
|
|
2360
|
+
" ",
|
|
2361
|
+
/* @__PURE__ */ jsx30("span", {
|
|
2362
|
+
className: "n",
|
|
2363
|
+
children: c.n
|
|
2364
|
+
})
|
|
2365
|
+
]
|
|
2366
|
+
}, c.id))
|
|
2367
|
+
}),
|
|
2368
|
+
/* @__PURE__ */ jsx30("span", {
|
|
2369
|
+
className: "edge end",
|
|
2370
|
+
"aria-hidden": "true"
|
|
2371
|
+
})
|
|
2372
|
+
]
|
|
2373
|
+
}),
|
|
2374
|
+
/* @__PURE__ */ jsxs21("div", {
|
|
2375
|
+
className: "feitio-kanban-scroll",
|
|
2376
|
+
children: [
|
|
2377
|
+
/* @__PURE__ */ jsx30("span", {
|
|
2378
|
+
className: "edge start",
|
|
2379
|
+
"aria-hidden": "true"
|
|
2380
|
+
}),
|
|
2381
|
+
/* @__PURE__ */ jsx30("div", {
|
|
2382
|
+
className: "cols",
|
|
2383
|
+
children: rendered.map((c) => /* @__PURE__ */ jsxs21("div", {
|
|
2384
|
+
className: "col",
|
|
2385
|
+
role: "group",
|
|
2386
|
+
"data-col": c.id,
|
|
2387
|
+
"aria-labelledby": `${id}-${c.id}`,
|
|
2388
|
+
"data-current": c.id === shown ? "" : undefined,
|
|
2389
|
+
"data-empty": c.n ? undefined : "",
|
|
2390
|
+
children: [
|
|
2391
|
+
/* @__PURE__ */ jsxs21("div", {
|
|
2392
|
+
className: "col-head",
|
|
2393
|
+
children: [
|
|
2394
|
+
/* @__PURE__ */ jsx30("h3", {
|
|
2395
|
+
id: `${id}-${c.id}`,
|
|
2396
|
+
children: c.title
|
|
2397
|
+
}),
|
|
2398
|
+
/* @__PURE__ */ jsx30("span", {
|
|
2399
|
+
className: "n",
|
|
2400
|
+
children: c.n
|
|
2401
|
+
})
|
|
2402
|
+
]
|
|
2403
|
+
}),
|
|
2404
|
+
c.empty && /* @__PURE__ */ jsx30("p", {
|
|
2405
|
+
className: "empty",
|
|
2406
|
+
hidden: c.n > 0,
|
|
2407
|
+
children: c.empty
|
|
2408
|
+
}),
|
|
2409
|
+
cards[c.id],
|
|
2410
|
+
c.create && /* @__PURE__ */ jsxs21("button", {
|
|
2411
|
+
type: "button",
|
|
2412
|
+
className: "add",
|
|
2413
|
+
"data-field": c.create.field,
|
|
2414
|
+
"data-save": c.create.save ?? "Salvar",
|
|
2415
|
+
"data-cancel": c.create.cancel ?? "Cancelar",
|
|
2416
|
+
children: [
|
|
2417
|
+
/* @__PURE__ */ jsx30(Icon, {
|
|
2418
|
+
name: "plus",
|
|
2419
|
+
sprite
|
|
2420
|
+
}),
|
|
2421
|
+
c.create.label
|
|
2422
|
+
]
|
|
2423
|
+
})
|
|
2424
|
+
]
|
|
2425
|
+
}, c.id))
|
|
2426
|
+
}),
|
|
2427
|
+
/* @__PURE__ */ jsx30("span", {
|
|
2428
|
+
className: "edge end",
|
|
2429
|
+
"aria-hidden": "true"
|
|
2430
|
+
})
|
|
2431
|
+
]
|
|
2432
|
+
}),
|
|
2433
|
+
/* @__PURE__ */ jsx30("div", {
|
|
2434
|
+
className: "minimap",
|
|
2435
|
+
"aria-hidden": "true",
|
|
2436
|
+
hidden: true
|
|
2437
|
+
})
|
|
2438
|
+
]
|
|
2439
|
+
});
|
|
2440
|
+
}
|
|
2441
|
+
// src/KanbanCard.tsx
|
|
2442
|
+
import { jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2443
|
+
function KanbanCard({
|
|
2444
|
+
id,
|
|
2445
|
+
name,
|
|
2446
|
+
to = [],
|
|
2447
|
+
moveLabel = "Mover",
|
|
2448
|
+
fixedLabel = "fixo",
|
|
2449
|
+
sprite,
|
|
2450
|
+
children
|
|
2451
|
+
}) {
|
|
2452
|
+
return /* @__PURE__ */ jsxs22("article", {
|
|
2453
|
+
className: "feitio-kanban-card",
|
|
2454
|
+
"data-id": id,
|
|
2455
|
+
"data-to": to.length ? to.join(" ") : undefined,
|
|
2456
|
+
"aria-label": name,
|
|
2457
|
+
children: [
|
|
2458
|
+
children,
|
|
2459
|
+
to.length ? /* @__PURE__ */ jsxs22("button", {
|
|
2460
|
+
type: "button",
|
|
2461
|
+
className: "feitio-button move",
|
|
2462
|
+
"data-size": "small",
|
|
2463
|
+
"aria-label": `${moveLabel}: ${name}`,
|
|
2464
|
+
"aria-haspopup": "true",
|
|
2465
|
+
"aria-expanded": "false",
|
|
2466
|
+
children: [
|
|
2467
|
+
moveLabel,
|
|
2468
|
+
/* @__PURE__ */ jsx31(Icon, {
|
|
2469
|
+
name: "chevron-down",
|
|
2470
|
+
sprite
|
|
2471
|
+
})
|
|
2472
|
+
]
|
|
2473
|
+
}) : /* @__PURE__ */ jsx31("span", {
|
|
2474
|
+
className: "fixed",
|
|
2475
|
+
children: fixedLabel
|
|
2476
|
+
})
|
|
2477
|
+
]
|
|
2478
|
+
});
|
|
2479
|
+
}
|
|
1530
2480
|
// src/Kbd.tsx
|
|
1531
|
-
import { jsx as
|
|
2481
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1532
2482
|
function Kbd({ children }) {
|
|
1533
|
-
return /* @__PURE__ */
|
|
2483
|
+
return /* @__PURE__ */ jsx32("kbd", {
|
|
1534
2484
|
className: "feitio-kbd",
|
|
1535
2485
|
children
|
|
1536
2486
|
});
|
|
1537
2487
|
}
|
|
1538
2488
|
// src/Label.tsx
|
|
1539
|
-
import { jsx as
|
|
2489
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1540
2490
|
function Label({ htmlFor, children }) {
|
|
1541
|
-
return /* @__PURE__ */
|
|
2491
|
+
return /* @__PURE__ */ jsx33("label", {
|
|
1542
2492
|
className: "feitio-label",
|
|
1543
2493
|
htmlFor,
|
|
1544
2494
|
children
|
|
1545
2495
|
});
|
|
1546
2496
|
}
|
|
1547
2497
|
// src/Link.tsx
|
|
1548
|
-
import { jsx as
|
|
2498
|
+
import { jsx as jsx34, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1549
2499
|
function Link({
|
|
1550
2500
|
href,
|
|
1551
2501
|
newTab = false,
|
|
@@ -1553,18 +2503,18 @@ function Link({
|
|
|
1553
2503
|
sprite,
|
|
1554
2504
|
children
|
|
1555
2505
|
}) {
|
|
1556
|
-
return /* @__PURE__ */
|
|
2506
|
+
return /* @__PURE__ */ jsxs23("a", {
|
|
1557
2507
|
className: "feitio-link",
|
|
1558
2508
|
href,
|
|
1559
2509
|
target: newTab ? "_blank" : undefined,
|
|
1560
2510
|
rel: newTab ? "noopener" : undefined,
|
|
1561
2511
|
children: [
|
|
1562
2512
|
children,
|
|
1563
|
-
newTab && /* @__PURE__ */
|
|
2513
|
+
newTab && /* @__PURE__ */ jsx34(Icon, {
|
|
1564
2514
|
name: "new-tab",
|
|
1565
2515
|
sprite
|
|
1566
2516
|
}),
|
|
1567
|
-
newTab && /* @__PURE__ */
|
|
2517
|
+
newTab && /* @__PURE__ */ jsxs23("span", {
|
|
1568
2518
|
className: "feitio-visually-hidden",
|
|
1569
2519
|
children: [
|
|
1570
2520
|
" ",
|
|
@@ -1575,38 +2525,38 @@ function Link({
|
|
|
1575
2525
|
});
|
|
1576
2526
|
}
|
|
1577
2527
|
// src/LinkCard.tsx
|
|
1578
|
-
import { jsx as
|
|
2528
|
+
import { jsx as jsx35, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1579
2529
|
function LinkCard({ href, title, sprite, children }) {
|
|
1580
|
-
return /* @__PURE__ */
|
|
2530
|
+
return /* @__PURE__ */ jsxs24("a", {
|
|
1581
2531
|
className: "feitio-link-card",
|
|
1582
2532
|
href,
|
|
1583
2533
|
children: [
|
|
1584
|
-
/* @__PURE__ */
|
|
2534
|
+
/* @__PURE__ */ jsxs24("strong", {
|
|
1585
2535
|
children: [
|
|
1586
2536
|
title,
|
|
1587
|
-
/* @__PURE__ */
|
|
2537
|
+
/* @__PURE__ */ jsx35(Icon, {
|
|
1588
2538
|
name: "chevron-right",
|
|
1589
2539
|
sprite
|
|
1590
2540
|
})
|
|
1591
2541
|
]
|
|
1592
2542
|
}),
|
|
1593
|
-
/* @__PURE__ */
|
|
2543
|
+
/* @__PURE__ */ jsx35("span", {
|
|
1594
2544
|
children
|
|
1595
2545
|
})
|
|
1596
2546
|
]
|
|
1597
2547
|
});
|
|
1598
2548
|
}
|
|
1599
2549
|
// src/Menu.tsx
|
|
1600
|
-
import { useRef as
|
|
1601
|
-
import { jsx as
|
|
2550
|
+
import { useRef as useRef4 } from "react";
|
|
2551
|
+
import { jsx as jsx36, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
1602
2552
|
function Menu({ label, hint, items, id, size, sprite }) {
|
|
1603
|
-
const ref =
|
|
2553
|
+
const ref = useRef4(null);
|
|
1604
2554
|
useElementBehavior(ref, "menu", wireMenu);
|
|
1605
|
-
return /* @__PURE__ */
|
|
2555
|
+
return /* @__PURE__ */ jsxs25("span", {
|
|
1606
2556
|
className: "feitio-menu",
|
|
1607
2557
|
ref,
|
|
1608
2558
|
children: [
|
|
1609
|
-
/* @__PURE__ */
|
|
2559
|
+
/* @__PURE__ */ jsxs25("button", {
|
|
1610
2560
|
type: "button",
|
|
1611
2561
|
className: "feitio-button",
|
|
1612
2562
|
"data-size": size,
|
|
@@ -1615,38 +2565,38 @@ function Menu({ label, hint, items, id, size, sprite }) {
|
|
|
1615
2565
|
"aria-expanded": "false",
|
|
1616
2566
|
children: [
|
|
1617
2567
|
label,
|
|
1618
|
-
hint && /* @__PURE__ */
|
|
2568
|
+
hint && /* @__PURE__ */ jsx36("span", {
|
|
1619
2569
|
className: "feitio-visually-hidden",
|
|
1620
2570
|
children: hint
|
|
1621
2571
|
}),
|
|
1622
|
-
/* @__PURE__ */
|
|
2572
|
+
/* @__PURE__ */ jsx36(Icon, {
|
|
1623
2573
|
name: "chevron-down",
|
|
1624
2574
|
sprite
|
|
1625
2575
|
})
|
|
1626
2576
|
]
|
|
1627
2577
|
}),
|
|
1628
|
-
/* @__PURE__ */
|
|
2578
|
+
/* @__PURE__ */ jsx36("ul", {
|
|
1629
2579
|
className: "feitio-menu-list",
|
|
1630
2580
|
id: `${id}-list`,
|
|
1631
2581
|
popover: "",
|
|
1632
|
-
children: items.map((item) => item.href ? /* @__PURE__ */
|
|
1633
|
-
children: /* @__PURE__ */
|
|
2582
|
+
children: items.map((item) => item.href ? /* @__PURE__ */ jsx36("li", {
|
|
2583
|
+
children: /* @__PURE__ */ jsxs25("a", {
|
|
1634
2584
|
href: item.href,
|
|
1635
2585
|
lang: item.lang,
|
|
1636
2586
|
hrefLang: item.hreflang,
|
|
1637
2587
|
"aria-current": item.current ? "true" : undefined,
|
|
1638
2588
|
children: [
|
|
1639
|
-
item.current && /* @__PURE__ */
|
|
2589
|
+
item.current && /* @__PURE__ */ jsx36(Icon, {
|
|
1640
2590
|
name: "check",
|
|
1641
2591
|
sprite
|
|
1642
2592
|
}),
|
|
1643
|
-
/* @__PURE__ */
|
|
2593
|
+
/* @__PURE__ */ jsx36("span", {
|
|
1644
2594
|
children: item.text
|
|
1645
2595
|
})
|
|
1646
2596
|
]
|
|
1647
2597
|
})
|
|
1648
|
-
}, item.text) : /* @__PURE__ */
|
|
1649
|
-
children: /* @__PURE__ */
|
|
2598
|
+
}, item.text) : /* @__PURE__ */ jsx36("li", {
|
|
2599
|
+
children: /* @__PURE__ */ jsx36("button", {
|
|
1650
2600
|
type: "button",
|
|
1651
2601
|
onClick: item.onSelect,
|
|
1652
2602
|
children: item.text
|
|
@@ -1657,8 +2607,8 @@ function Menu({ label, hint, items, id, size, sprite }) {
|
|
|
1657
2607
|
});
|
|
1658
2608
|
}
|
|
1659
2609
|
// src/Notice.tsx
|
|
1660
|
-
import { useImperativeHandle, useRef as
|
|
1661
|
-
import { jsx as
|
|
2610
|
+
import { useImperativeHandle, useRef as useRef5 } from "react";
|
|
2611
|
+
import { jsx as jsx37, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
1662
2612
|
var icons = { ok: "check", warn: "warn", error: "close", info: "info" };
|
|
1663
2613
|
var ring = "M12 3.2C17.2 3 21 7 20.8 12.2C20.6 17.2 16.8 20.9 11.8 20.8C6.9 20.7 3.1 16.8 3.2 11.8C3.3 7 6.9 3.4 12.6 3.5";
|
|
1664
2614
|
function Notice({
|
|
@@ -1674,12 +2624,12 @@ function Notice({
|
|
|
1674
2624
|
ref,
|
|
1675
2625
|
children
|
|
1676
2626
|
}) {
|
|
1677
|
-
const own =
|
|
2627
|
+
const own = useRef5(null);
|
|
1678
2628
|
useImperativeHandle(ref, () => own.current, []);
|
|
1679
2629
|
useElementBehavior(own, "notice", wireNotice);
|
|
1680
2630
|
const hasTools = close || Boolean(timeout);
|
|
1681
2631
|
const text = children !== undefined && children !== null && children !== false;
|
|
1682
|
-
return /* @__PURE__ */
|
|
2632
|
+
return /* @__PURE__ */ jsxs26("div", {
|
|
1683
2633
|
className: "feitio-notice",
|
|
1684
2634
|
"data-status": status,
|
|
1685
2635
|
id,
|
|
@@ -1688,33 +2638,33 @@ function Notice({
|
|
|
1688
2638
|
hidden,
|
|
1689
2639
|
ref: own,
|
|
1690
2640
|
children: [
|
|
1691
|
-
/* @__PURE__ */
|
|
2641
|
+
/* @__PURE__ */ jsx37(Icon, {
|
|
1692
2642
|
name: icons[status ?? "info"],
|
|
1693
2643
|
sprite
|
|
1694
2644
|
}),
|
|
1695
|
-
/* @__PURE__ */
|
|
2645
|
+
/* @__PURE__ */ jsx37("strong", {
|
|
1696
2646
|
children: title
|
|
1697
2647
|
}),
|
|
1698
|
-
text && /* @__PURE__ */
|
|
2648
|
+
text && /* @__PURE__ */ jsx37("p", {
|
|
1699
2649
|
children
|
|
1700
2650
|
}),
|
|
1701
|
-
hasTools && /* @__PURE__ */
|
|
2651
|
+
hasTools && /* @__PURE__ */ jsx37("span", {
|
|
1702
2652
|
className: "tools",
|
|
1703
|
-
children: /* @__PURE__ */
|
|
2653
|
+
children: /* @__PURE__ */ jsxs26("button", {
|
|
1704
2654
|
type: "button",
|
|
1705
2655
|
className: "close",
|
|
1706
2656
|
"aria-label": closeLabel,
|
|
1707
2657
|
children: [
|
|
1708
|
-
Boolean(timeout) && /* @__PURE__ */
|
|
2658
|
+
Boolean(timeout) && /* @__PURE__ */ jsx37("svg", {
|
|
1709
2659
|
className: "ring",
|
|
1710
2660
|
viewBox: "0 0 24 24",
|
|
1711
2661
|
"aria-hidden": "true",
|
|
1712
|
-
children: /* @__PURE__ */
|
|
2662
|
+
children: /* @__PURE__ */ jsx37("path", {
|
|
1713
2663
|
pathLength: 100,
|
|
1714
2664
|
d: ring
|
|
1715
2665
|
})
|
|
1716
2666
|
}),
|
|
1717
|
-
/* @__PURE__ */
|
|
2667
|
+
/* @__PURE__ */ jsx37(Icon, {
|
|
1718
2668
|
name: "close",
|
|
1719
2669
|
sprite
|
|
1720
2670
|
})
|
|
@@ -1739,7 +2689,7 @@ function paginationEntries(current, total) {
|
|
|
1739
2689
|
}
|
|
1740
2690
|
|
|
1741
2691
|
// src/Pagination.tsx
|
|
1742
|
-
import { jsx as
|
|
2692
|
+
import { jsx as jsx38, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
1743
2693
|
function defaultPageLabel(page) {
|
|
1744
2694
|
return `Página ${page}`;
|
|
1745
2695
|
}
|
|
@@ -1755,19 +2705,19 @@ function Pagination({
|
|
|
1755
2705
|
pageLabel = defaultPageLabel,
|
|
1756
2706
|
sprite
|
|
1757
2707
|
}) {
|
|
1758
|
-
return /* @__PURE__ */
|
|
2708
|
+
return /* @__PURE__ */ jsxs27("nav", {
|
|
1759
2709
|
className: "feitio-pagination",
|
|
1760
2710
|
"aria-label": label,
|
|
1761
2711
|
children: [
|
|
1762
|
-
/* @__PURE__ */
|
|
2712
|
+
/* @__PURE__ */ jsxs27("ul", {
|
|
1763
2713
|
children: [
|
|
1764
|
-
current > 1 && /* @__PURE__ */
|
|
1765
|
-
children: /* @__PURE__ */
|
|
2714
|
+
current > 1 && /* @__PURE__ */ jsx38("li", {
|
|
2715
|
+
children: /* @__PURE__ */ jsxs27("a", {
|
|
1766
2716
|
className: "step prev",
|
|
1767
2717
|
href: href(current - 1),
|
|
1768
2718
|
rel: "prev",
|
|
1769
2719
|
children: [
|
|
1770
|
-
/* @__PURE__ */
|
|
2720
|
+
/* @__PURE__ */ jsx38(Icon, {
|
|
1771
2721
|
name: "chevron-right",
|
|
1772
2722
|
sprite
|
|
1773
2723
|
}),
|
|
@@ -1775,30 +2725,30 @@ function Pagination({
|
|
|
1775
2725
|
]
|
|
1776
2726
|
})
|
|
1777
2727
|
}),
|
|
1778
|
-
paginationEntries(current, total).map((entry) => entry.kind === "gap" ? /* @__PURE__ */
|
|
1779
|
-
children: /* @__PURE__ */
|
|
2728
|
+
paginationEntries(current, total).map((entry) => entry.kind === "gap" ? /* @__PURE__ */ jsx38("li", {
|
|
2729
|
+
children: /* @__PURE__ */ jsx38("span", {
|
|
1780
2730
|
className: "gap",
|
|
1781
2731
|
"aria-hidden": "true",
|
|
1782
2732
|
children: "…"
|
|
1783
2733
|
})
|
|
1784
|
-
}, `gap-${entry.after}`) : /* @__PURE__ */
|
|
1785
|
-
children: entry.page === current ? /* @__PURE__ */
|
|
2734
|
+
}, `gap-${entry.after}`) : /* @__PURE__ */ jsx38("li", {
|
|
2735
|
+
children: entry.page === current ? /* @__PURE__ */ jsx38("span", {
|
|
1786
2736
|
"aria-current": "page",
|
|
1787
2737
|
children: entry.page
|
|
1788
|
-
}) : /* @__PURE__ */
|
|
2738
|
+
}) : /* @__PURE__ */ jsx38("a", {
|
|
1789
2739
|
href: href(entry.page),
|
|
1790
2740
|
"aria-label": pageLabel(entry.page),
|
|
1791
2741
|
children: entry.page
|
|
1792
2742
|
})
|
|
1793
2743
|
}, entry.page)),
|
|
1794
|
-
current < total && /* @__PURE__ */
|
|
1795
|
-
children: /* @__PURE__ */
|
|
2744
|
+
current < total && /* @__PURE__ */ jsx38("li", {
|
|
2745
|
+
children: /* @__PURE__ */ jsxs27("a", {
|
|
1796
2746
|
className: "step",
|
|
1797
2747
|
href: href(current + 1),
|
|
1798
2748
|
rel: "next",
|
|
1799
2749
|
children: [
|
|
1800
2750
|
nextLabel,
|
|
1801
|
-
/* @__PURE__ */
|
|
2751
|
+
/* @__PURE__ */ jsx38(Icon, {
|
|
1802
2752
|
name: "chevron-right",
|
|
1803
2753
|
sprite
|
|
1804
2754
|
})
|
|
@@ -1807,25 +2757,25 @@ function Pagination({
|
|
|
1807
2757
|
})
|
|
1808
2758
|
]
|
|
1809
2759
|
}),
|
|
1810
|
-
(count || perPage) && /* @__PURE__ */
|
|
2760
|
+
(count || perPage) && /* @__PURE__ */ jsxs27("div", {
|
|
1811
2761
|
className: "meta",
|
|
1812
2762
|
children: [
|
|
1813
|
-
count && /* @__PURE__ */
|
|
2763
|
+
count && /* @__PURE__ */ jsx38("p", {
|
|
1814
2764
|
className: "count",
|
|
1815
2765
|
children: count
|
|
1816
2766
|
}),
|
|
1817
|
-
perPage && /* @__PURE__ */
|
|
2767
|
+
perPage && /* @__PURE__ */ jsxs27("div", {
|
|
1818
2768
|
className: "per-page",
|
|
1819
2769
|
role: "group",
|
|
1820
2770
|
"aria-label": perPage.label,
|
|
1821
2771
|
children: [
|
|
1822
|
-
/* @__PURE__ */
|
|
2772
|
+
/* @__PURE__ */ jsx38("span", {
|
|
1823
2773
|
children: perPage.label
|
|
1824
2774
|
}),
|
|
1825
|
-
perPage.options.map((n) => n === perPage.current ? /* @__PURE__ */
|
|
2775
|
+
perPage.options.map((n) => n === perPage.current ? /* @__PURE__ */ jsx38("span", {
|
|
1826
2776
|
"aria-current": "true",
|
|
1827
2777
|
children: n
|
|
1828
|
-
}, n) : /* @__PURE__ */
|
|
2778
|
+
}, n) : /* @__PURE__ */ jsx38("a", {
|
|
1829
2779
|
href: perPage.href(n),
|
|
1830
2780
|
children: n
|
|
1831
2781
|
}, n))
|
|
@@ -1837,7 +2787,7 @@ function Pagination({
|
|
|
1837
2787
|
});
|
|
1838
2788
|
}
|
|
1839
2789
|
// src/Radios.tsx
|
|
1840
|
-
import { jsx as
|
|
2790
|
+
import { jsx as jsx39, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
1841
2791
|
function Radios({
|
|
1842
2792
|
legend,
|
|
1843
2793
|
name,
|
|
@@ -1847,21 +2797,21 @@ function Radios({
|
|
|
1847
2797
|
layout = "stack",
|
|
1848
2798
|
onChange
|
|
1849
2799
|
}) {
|
|
1850
|
-
return /* @__PURE__ */
|
|
2800
|
+
return /* @__PURE__ */ jsxs28("fieldset", {
|
|
1851
2801
|
className: "feitio-fieldset",
|
|
1852
2802
|
disabled,
|
|
1853
2803
|
children: [
|
|
1854
|
-
/* @__PURE__ */
|
|
2804
|
+
/* @__PURE__ */ jsx39("legend", {
|
|
1855
2805
|
className: "feitio-label",
|
|
1856
2806
|
children: legend
|
|
1857
2807
|
}),
|
|
1858
|
-
/* @__PURE__ */
|
|
2808
|
+
/* @__PURE__ */ jsx39("div", {
|
|
1859
2809
|
className: "feitio-choices",
|
|
1860
2810
|
"data-layout": layout === "inline" ? "inline" : undefined,
|
|
1861
|
-
children: options.map((o) => /* @__PURE__ */
|
|
2811
|
+
children: options.map((o) => /* @__PURE__ */ jsxs28("label", {
|
|
1862
2812
|
className: "feitio-choice",
|
|
1863
2813
|
children: [
|
|
1864
|
-
/* @__PURE__ */
|
|
2814
|
+
/* @__PURE__ */ jsx39("input", {
|
|
1865
2815
|
type: "radio",
|
|
1866
2816
|
name,
|
|
1867
2817
|
value: o,
|
|
@@ -1876,19 +2826,19 @@ function Radios({
|
|
|
1876
2826
|
});
|
|
1877
2827
|
}
|
|
1878
2828
|
// src/ScrollFade.tsx
|
|
1879
|
-
import { useRef as
|
|
1880
|
-
import { jsx as
|
|
2829
|
+
import { useRef as useRef6 } from "react";
|
|
2830
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
1881
2831
|
function ScrollFade() {
|
|
1882
|
-
const ref =
|
|
2832
|
+
const ref = useRef6(null);
|
|
1883
2833
|
useElementBehavior(ref, "scroll", wireScroll);
|
|
1884
|
-
return /* @__PURE__ */
|
|
2834
|
+
return /* @__PURE__ */ jsx40("span", {
|
|
1885
2835
|
className: "feitio-scroll-fade",
|
|
1886
2836
|
"aria-hidden": "true",
|
|
1887
2837
|
ref
|
|
1888
2838
|
});
|
|
1889
2839
|
}
|
|
1890
2840
|
// src/Search.tsx
|
|
1891
|
-
import { jsx as
|
|
2841
|
+
import { jsx as jsx41, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
1892
2842
|
function Search({
|
|
1893
2843
|
id,
|
|
1894
2844
|
title,
|
|
@@ -1898,44 +2848,44 @@ function Search({
|
|
|
1898
2848
|
sprite,
|
|
1899
2849
|
children
|
|
1900
2850
|
}) {
|
|
1901
|
-
return /* @__PURE__ */
|
|
2851
|
+
return /* @__PURE__ */ jsx41("dialog", {
|
|
1902
2852
|
className: "feitio-dialog search-dialog",
|
|
1903
2853
|
id,
|
|
1904
2854
|
"aria-labelledby": `${id}-t`,
|
|
1905
|
-
children: /* @__PURE__ */
|
|
2855
|
+
children: /* @__PURE__ */ jsxs29("form", {
|
|
1906
2856
|
method: "dialog",
|
|
1907
2857
|
children: [
|
|
1908
|
-
/* @__PURE__ */
|
|
2858
|
+
/* @__PURE__ */ jsx41("h2", {
|
|
1909
2859
|
id: `${id}-t`,
|
|
1910
2860
|
className: "feitio-visually-hidden",
|
|
1911
2861
|
children: title
|
|
1912
2862
|
}),
|
|
1913
|
-
/* @__PURE__ */
|
|
2863
|
+
/* @__PURE__ */ jsxs29("div", {
|
|
1914
2864
|
className: "search-head",
|
|
1915
2865
|
children: [
|
|
1916
|
-
/* @__PURE__ */
|
|
2866
|
+
/* @__PURE__ */ jsx41(Icon, {
|
|
1917
2867
|
name: "search",
|
|
1918
2868
|
sprite
|
|
1919
2869
|
}),
|
|
1920
|
-
/* @__PURE__ */
|
|
2870
|
+
/* @__PURE__ */ jsx41("label", {
|
|
1921
2871
|
className: "feitio-visually-hidden",
|
|
1922
2872
|
htmlFor: `${id}-field`,
|
|
1923
2873
|
children: title
|
|
1924
2874
|
}),
|
|
1925
|
-
/* @__PURE__ */
|
|
2875
|
+
/* @__PURE__ */ jsx41("input", {
|
|
1926
2876
|
className: "search-field",
|
|
1927
2877
|
id: `${id}-field`,
|
|
1928
2878
|
type: "search",
|
|
1929
2879
|
autoComplete: "off",
|
|
1930
2880
|
placeholder
|
|
1931
2881
|
}),
|
|
1932
|
-
/* @__PURE__ */
|
|
2882
|
+
/* @__PURE__ */ jsxs29("button", {
|
|
1933
2883
|
type: "submit",
|
|
1934
2884
|
className: "feitio-button close",
|
|
1935
2885
|
"data-size": "small",
|
|
1936
2886
|
value: "close",
|
|
1937
2887
|
children: [
|
|
1938
|
-
/* @__PURE__ */
|
|
2888
|
+
/* @__PURE__ */ jsx41(Icon, {
|
|
1939
2889
|
name: "close",
|
|
1940
2890
|
sprite
|
|
1941
2891
|
}),
|
|
@@ -1944,16 +2894,16 @@ function Search({
|
|
|
1944
2894
|
})
|
|
1945
2895
|
]
|
|
1946
2896
|
}),
|
|
1947
|
-
/* @__PURE__ */
|
|
2897
|
+
/* @__PURE__ */ jsx41("ul", {
|
|
1948
2898
|
className: "results",
|
|
1949
2899
|
children
|
|
1950
2900
|
}),
|
|
1951
|
-
keys && /* @__PURE__ */
|
|
2901
|
+
keys && /* @__PURE__ */ jsxs29("p", {
|
|
1952
2902
|
className: "foot",
|
|
1953
2903
|
children: [
|
|
1954
|
-
/* @__PURE__ */
|
|
2904
|
+
/* @__PURE__ */ jsxs29("span", {
|
|
1955
2905
|
children: [
|
|
1956
|
-
/* @__PURE__ */
|
|
2906
|
+
/* @__PURE__ */ jsx41("kbd", {
|
|
1957
2907
|
className: "feitio-kbd",
|
|
1958
2908
|
children: "↵"
|
|
1959
2909
|
}),
|
|
@@ -1961,13 +2911,13 @@ function Search({
|
|
|
1961
2911
|
keys.open
|
|
1962
2912
|
]
|
|
1963
2913
|
}),
|
|
1964
|
-
/* @__PURE__ */
|
|
2914
|
+
/* @__PURE__ */ jsxs29("span", {
|
|
1965
2915
|
children: [
|
|
1966
|
-
/* @__PURE__ */
|
|
2916
|
+
/* @__PURE__ */ jsx41("kbd", {
|
|
1967
2917
|
className: "feitio-kbd",
|
|
1968
2918
|
children: "↑"
|
|
1969
2919
|
}),
|
|
1970
|
-
/* @__PURE__ */
|
|
2920
|
+
/* @__PURE__ */ jsx41("kbd", {
|
|
1971
2921
|
className: "feitio-kbd",
|
|
1972
2922
|
children: "↓"
|
|
1973
2923
|
}),
|
|
@@ -1975,9 +2925,9 @@ function Search({
|
|
|
1975
2925
|
keys.choose
|
|
1976
2926
|
]
|
|
1977
2927
|
}),
|
|
1978
|
-
/* @__PURE__ */
|
|
2928
|
+
/* @__PURE__ */ jsxs29("span", {
|
|
1979
2929
|
children: [
|
|
1980
|
-
/* @__PURE__ */
|
|
2930
|
+
/* @__PURE__ */ jsx41("kbd", {
|
|
1981
2931
|
className: "feitio-kbd",
|
|
1982
2932
|
children: "Esc"
|
|
1983
2933
|
}),
|
|
@@ -1992,7 +2942,7 @@ function Search({
|
|
|
1992
2942
|
});
|
|
1993
2943
|
}
|
|
1994
2944
|
// src/SegmentedControl.tsx
|
|
1995
|
-
import { jsx as
|
|
2945
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
1996
2946
|
function SegmentedControl({
|
|
1997
2947
|
label,
|
|
1998
2948
|
options,
|
|
@@ -2001,11 +2951,11 @@ function SegmentedControl({
|
|
|
2001
2951
|
}) {
|
|
2002
2952
|
usePageBehavior("feitioForms", wireForms2);
|
|
2003
2953
|
const current = value ?? options[0];
|
|
2004
|
-
return /* @__PURE__ */
|
|
2954
|
+
return /* @__PURE__ */ jsx42("div", {
|
|
2005
2955
|
className: "feitio-segmented",
|
|
2006
2956
|
role: "group",
|
|
2007
2957
|
"aria-label": label,
|
|
2008
|
-
children: options.map((o) => /* @__PURE__ */
|
|
2958
|
+
children: options.map((o) => /* @__PURE__ */ jsx42("button", {
|
|
2009
2959
|
type: "button",
|
|
2010
2960
|
"aria-pressed": o === current ? "true" : "false",
|
|
2011
2961
|
onClick: onChange && (() => onChange(o)),
|
|
@@ -2014,7 +2964,7 @@ function SegmentedControl({
|
|
|
2014
2964
|
});
|
|
2015
2965
|
}
|
|
2016
2966
|
// src/Select.tsx
|
|
2017
|
-
import { jsx as
|
|
2967
|
+
import { jsx as jsx43, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2018
2968
|
function Select({
|
|
2019
2969
|
id,
|
|
2020
2970
|
options,
|
|
@@ -2027,10 +2977,10 @@ function Select({
|
|
|
2027
2977
|
sprite,
|
|
2028
2978
|
onChange
|
|
2029
2979
|
}) {
|
|
2030
|
-
return /* @__PURE__ */
|
|
2980
|
+
return /* @__PURE__ */ jsxs30("span", {
|
|
2031
2981
|
className: "feitio-select",
|
|
2032
2982
|
children: [
|
|
2033
|
-
/* @__PURE__ */
|
|
2983
|
+
/* @__PURE__ */ jsxs30("select", {
|
|
2034
2984
|
id,
|
|
2035
2985
|
name,
|
|
2036
2986
|
disabled,
|
|
@@ -2039,16 +2989,16 @@ function Select({
|
|
|
2039
2989
|
defaultValue: value,
|
|
2040
2990
|
onChange: onChange && ((event) => onChange(event.target.value)),
|
|
2041
2991
|
children: [
|
|
2042
|
-
empty && /* @__PURE__ */
|
|
2992
|
+
empty && /* @__PURE__ */ jsx43("option", {
|
|
2043
2993
|
value: "",
|
|
2044
2994
|
children: empty
|
|
2045
2995
|
}),
|
|
2046
|
-
options.map((o) => /* @__PURE__ */
|
|
2996
|
+
options.map((o) => /* @__PURE__ */ jsx43("option", {
|
|
2047
2997
|
children: o
|
|
2048
2998
|
}, o))
|
|
2049
2999
|
]
|
|
2050
3000
|
}),
|
|
2051
|
-
/* @__PURE__ */
|
|
3001
|
+
/* @__PURE__ */ jsx43(Icon, {
|
|
2052
3002
|
name: "chevron-down",
|
|
2053
3003
|
sprite
|
|
2054
3004
|
})
|
|
@@ -2056,21 +3006,21 @@ function Select({
|
|
|
2056
3006
|
});
|
|
2057
3007
|
}
|
|
2058
3008
|
// src/SkipLink.tsx
|
|
2059
|
-
import { jsx as
|
|
3009
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
2060
3010
|
function SkipLink({
|
|
2061
3011
|
href = "#content",
|
|
2062
3012
|
children
|
|
2063
3013
|
}) {
|
|
2064
|
-
return /* @__PURE__ */
|
|
3014
|
+
return /* @__PURE__ */ jsx44("a", {
|
|
2065
3015
|
className: "feitio-skip-link",
|
|
2066
3016
|
href,
|
|
2067
3017
|
children
|
|
2068
3018
|
});
|
|
2069
3019
|
}
|
|
2070
3020
|
// src/Stack.tsx
|
|
2071
|
-
import { jsx as
|
|
3021
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
2072
3022
|
function Stack({ gap = 4, align, as: Tag = "div", children }) {
|
|
2073
|
-
return /* @__PURE__ */
|
|
3023
|
+
return /* @__PURE__ */ jsx45(Tag, {
|
|
2074
3024
|
className: "feitio-stack",
|
|
2075
3025
|
"data-gap": gap,
|
|
2076
3026
|
"data-align": align,
|
|
@@ -2078,7 +3028,7 @@ function Stack({ gap = 4, align, as: Tag = "div", children }) {
|
|
|
2078
3028
|
});
|
|
2079
3029
|
}
|
|
2080
3030
|
// src/StatusOverlay.tsx
|
|
2081
|
-
import { jsx as
|
|
3031
|
+
import { jsx as jsx46, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2082
3032
|
function StatusOverlay({
|
|
2083
3033
|
state,
|
|
2084
3034
|
label = "",
|
|
@@ -2086,54 +3036,54 @@ function StatusOverlay({
|
|
|
2086
3036
|
ref,
|
|
2087
3037
|
children
|
|
2088
3038
|
}) {
|
|
2089
|
-
return /* @__PURE__ */
|
|
3039
|
+
return /* @__PURE__ */ jsxs31(Tag, {
|
|
2090
3040
|
className: "feitio-status-host",
|
|
2091
3041
|
"data-state": state,
|
|
2092
3042
|
ref,
|
|
2093
3043
|
children: [
|
|
2094
3044
|
children,
|
|
2095
|
-
/* @__PURE__ */
|
|
3045
|
+
/* @__PURE__ */ jsxs31("div", {
|
|
2096
3046
|
className: "feitio-status",
|
|
2097
3047
|
role: "status",
|
|
2098
3048
|
children: [
|
|
2099
|
-
/* @__PURE__ */
|
|
3049
|
+
/* @__PURE__ */ jsxs31("svg", {
|
|
2100
3050
|
viewBox: "0 0 48 48",
|
|
2101
3051
|
"aria-hidden": "true",
|
|
2102
3052
|
children: [
|
|
2103
|
-
/* @__PURE__ */
|
|
3053
|
+
/* @__PURE__ */ jsxs31("g", {
|
|
2104
3054
|
className: "loading",
|
|
2105
3055
|
children: [
|
|
2106
|
-
/* @__PURE__ */
|
|
3056
|
+
/* @__PURE__ */ jsx46("path", {
|
|
2107
3057
|
pathLength: 1,
|
|
2108
3058
|
d: "M24 7 C34 6.5 41.5 14 41 24 C40.6 33 33 41 24 41.2"
|
|
2109
3059
|
}),
|
|
2110
|
-
/* @__PURE__ */
|
|
3060
|
+
/* @__PURE__ */ jsx46("path", {
|
|
2111
3061
|
pathLength: 1,
|
|
2112
3062
|
d: "M25.5 41 C14.5 41.6 6.8 33.5 7.2 23.6 C7.6 14 14.6 7.4 23 6.4"
|
|
2113
3063
|
})
|
|
2114
3064
|
]
|
|
2115
3065
|
}),
|
|
2116
|
-
/* @__PURE__ */
|
|
3066
|
+
/* @__PURE__ */ jsxs31("g", {
|
|
2117
3067
|
className: "ok",
|
|
2118
3068
|
children: [
|
|
2119
|
-
/* @__PURE__ */
|
|
3069
|
+
/* @__PURE__ */ jsx46("path", {
|
|
2120
3070
|
pathLength: 1,
|
|
2121
3071
|
d: "M13 25 L21 33.5"
|
|
2122
3072
|
}),
|
|
2123
|
-
/* @__PURE__ */
|
|
3073
|
+
/* @__PURE__ */ jsx46("path", {
|
|
2124
3074
|
pathLength: 1,
|
|
2125
3075
|
d: "M19.5 34 L36 14.5"
|
|
2126
3076
|
})
|
|
2127
3077
|
]
|
|
2128
3078
|
}),
|
|
2129
|
-
/* @__PURE__ */
|
|
3079
|
+
/* @__PURE__ */ jsxs31("g", {
|
|
2130
3080
|
className: "error",
|
|
2131
3081
|
children: [
|
|
2132
|
-
/* @__PURE__ */
|
|
3082
|
+
/* @__PURE__ */ jsx46("path", {
|
|
2133
3083
|
pathLength: 1,
|
|
2134
3084
|
d: "M15 15 L33.5 33"
|
|
2135
3085
|
}),
|
|
2136
|
-
/* @__PURE__ */
|
|
3086
|
+
/* @__PURE__ */ jsx46("path", {
|
|
2137
3087
|
pathLength: 1,
|
|
2138
3088
|
d: "M33 14.5 L15.5 33.5"
|
|
2139
3089
|
})
|
|
@@ -2141,7 +3091,7 @@ function StatusOverlay({
|
|
|
2141
3091
|
})
|
|
2142
3092
|
]
|
|
2143
3093
|
}),
|
|
2144
|
-
/* @__PURE__ */
|
|
3094
|
+
/* @__PURE__ */ jsx46("span", {
|
|
2145
3095
|
className: "label",
|
|
2146
3096
|
children: label
|
|
2147
3097
|
})
|
|
@@ -2151,26 +3101,26 @@ function StatusOverlay({
|
|
|
2151
3101
|
});
|
|
2152
3102
|
}
|
|
2153
3103
|
// src/SummaryList.tsx
|
|
2154
|
-
import { jsx as
|
|
3104
|
+
import { jsx as jsx47, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2155
3105
|
function SummaryList({ rows }) {
|
|
2156
|
-
return /* @__PURE__ */
|
|
3106
|
+
return /* @__PURE__ */ jsx47("dl", {
|
|
2157
3107
|
className: "feitio-summary-list",
|
|
2158
|
-
children: rows.map((r) => /* @__PURE__ */
|
|
3108
|
+
children: rows.map((r) => /* @__PURE__ */ jsxs32("div", {
|
|
2159
3109
|
children: [
|
|
2160
|
-
/* @__PURE__ */
|
|
3110
|
+
/* @__PURE__ */ jsx47("dt", {
|
|
2161
3111
|
children: r.key
|
|
2162
3112
|
}),
|
|
2163
|
-
/* @__PURE__ */
|
|
3113
|
+
/* @__PURE__ */ jsx47("dd", {
|
|
2164
3114
|
children: r.value
|
|
2165
3115
|
}),
|
|
2166
|
-
r.change && /* @__PURE__ */
|
|
3116
|
+
r.change && /* @__PURE__ */ jsx47("dd", {
|
|
2167
3117
|
className: "change",
|
|
2168
|
-
children: /* @__PURE__ */
|
|
3118
|
+
children: /* @__PURE__ */ jsxs32("a", {
|
|
2169
3119
|
className: "feitio-link",
|
|
2170
3120
|
href: r.change.href,
|
|
2171
3121
|
children: [
|
|
2172
3122
|
r.change.label,
|
|
2173
|
-
/* @__PURE__ */
|
|
3123
|
+
/* @__PURE__ */ jsxs32("span", {
|
|
2174
3124
|
className: "feitio-visually-hidden",
|
|
2175
3125
|
children: [
|
|
2176
3126
|
" ",
|
|
@@ -2185,15 +3135,15 @@ function SummaryList({ rows }) {
|
|
|
2185
3135
|
});
|
|
2186
3136
|
}
|
|
2187
3137
|
// src/Swatch.tsx
|
|
2188
|
-
import { jsx as
|
|
3138
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
2189
3139
|
function Swatch({ role }) {
|
|
2190
|
-
return /* @__PURE__ */
|
|
3140
|
+
return /* @__PURE__ */ jsx48("span", {
|
|
2191
3141
|
className: "feitio-swatch",
|
|
2192
3142
|
style: { "--swatch": `var(--feitio-color-${role})` }
|
|
2193
3143
|
});
|
|
2194
3144
|
}
|
|
2195
3145
|
// src/Switch.tsx
|
|
2196
|
-
import { jsx as
|
|
3146
|
+
import { jsx as jsx49, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2197
3147
|
function Switch({
|
|
2198
3148
|
label,
|
|
2199
3149
|
on = false,
|
|
@@ -2204,12 +3154,12 @@ function Switch({
|
|
|
2204
3154
|
onChange
|
|
2205
3155
|
}) {
|
|
2206
3156
|
usePageBehavior("feitioForms", wireForms2);
|
|
2207
|
-
return /* @__PURE__ */
|
|
3157
|
+
return /* @__PURE__ */ jsxs33("label", {
|
|
2208
3158
|
className: "feitio-switch",
|
|
2209
3159
|
"data-on": onLabel,
|
|
2210
3160
|
"data-off": offLabel,
|
|
2211
3161
|
children: [
|
|
2212
|
-
/* @__PURE__ */
|
|
3162
|
+
/* @__PURE__ */ jsx49("input", {
|
|
2213
3163
|
type: "checkbox",
|
|
2214
3164
|
role: "switch",
|
|
2215
3165
|
name,
|
|
@@ -2218,7 +3168,7 @@ function Switch({
|
|
|
2218
3168
|
onChange: onChange && ((event) => onChange(event.target.checked))
|
|
2219
3169
|
}),
|
|
2220
3170
|
label,
|
|
2221
|
-
/* @__PURE__ */
|
|
3171
|
+
/* @__PURE__ */ jsx49("span", {
|
|
2222
3172
|
className: "state",
|
|
2223
3173
|
children: on ? onLabel : offLabel
|
|
2224
3174
|
})
|
|
@@ -2226,46 +3176,46 @@ function Switch({
|
|
|
2226
3176
|
});
|
|
2227
3177
|
}
|
|
2228
3178
|
// src/Table.tsx
|
|
2229
|
-
import { jsx as
|
|
3179
|
+
import { jsx as jsx50, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
2230
3180
|
function Table({ id, caption, columns, rows, compact }) {
|
|
2231
3181
|
const cap = `${id}-cap`;
|
|
2232
|
-
return /* @__PURE__ */
|
|
3182
|
+
return /* @__PURE__ */ jsx50("div", {
|
|
2233
3183
|
"data-density": compact ? "compact" : undefined,
|
|
2234
3184
|
style: { inlineSize: "100%" },
|
|
2235
|
-
children: /* @__PURE__ */
|
|
3185
|
+
children: /* @__PURE__ */ jsx50("div", {
|
|
2236
3186
|
className: "feitio-table-scroll",
|
|
2237
3187
|
tabIndex: 0,
|
|
2238
3188
|
role: "region",
|
|
2239
3189
|
"aria-labelledby": caption ? cap : undefined,
|
|
2240
3190
|
"aria-label": caption ? undefined : columns[0]?.label,
|
|
2241
|
-
children: /* @__PURE__ */
|
|
3191
|
+
children: /* @__PURE__ */ jsxs34("table", {
|
|
2242
3192
|
className: "feitio-table",
|
|
2243
3193
|
children: [
|
|
2244
|
-
caption && /* @__PURE__ */
|
|
3194
|
+
caption && /* @__PURE__ */ jsx50("caption", {
|
|
2245
3195
|
id: cap,
|
|
2246
3196
|
children: caption
|
|
2247
3197
|
}),
|
|
2248
|
-
/* @__PURE__ */
|
|
2249
|
-
children: /* @__PURE__ */
|
|
2250
|
-
children: columns.map((c) => /* @__PURE__ */
|
|
3198
|
+
/* @__PURE__ */ jsx50("thead", {
|
|
3199
|
+
children: /* @__PURE__ */ jsx50("tr", {
|
|
3200
|
+
children: columns.map((c) => /* @__PURE__ */ jsx50("th", {
|
|
2251
3201
|
scope: "col",
|
|
2252
3202
|
"data-align": c.align,
|
|
2253
|
-
children: c.hidden ? /* @__PURE__ */
|
|
3203
|
+
children: c.hidden ? /* @__PURE__ */ jsx50("span", {
|
|
2254
3204
|
className: "feitio-visually-hidden",
|
|
2255
3205
|
children: c.label
|
|
2256
3206
|
}) : c.label
|
|
2257
3207
|
}, c.label))
|
|
2258
3208
|
})
|
|
2259
3209
|
}),
|
|
2260
|
-
/* @__PURE__ */
|
|
2261
|
-
children: rows.map((r, n) => /* @__PURE__ */
|
|
2262
|
-
children: r.map((cell, i) => i === 0 ? /* @__PURE__ */
|
|
3210
|
+
/* @__PURE__ */ jsx50("tbody", {
|
|
3211
|
+
children: rows.map((r, n) => /* @__PURE__ */ jsx50("tr", {
|
|
3212
|
+
children: r.map((cell, i) => i === 0 ? /* @__PURE__ */ jsx50("td", {
|
|
2263
3213
|
className: "title",
|
|
2264
3214
|
children: cell
|
|
2265
|
-
}, i) : columns[i]?.hidden ? /* @__PURE__ */
|
|
3215
|
+
}, i) : columns[i]?.hidden ? /* @__PURE__ */ jsx50("td", {
|
|
2266
3216
|
className: "actions",
|
|
2267
3217
|
children: cell
|
|
2268
|
-
}, i) : /* @__PURE__ */
|
|
3218
|
+
}, i) : /* @__PURE__ */ jsx50("td", {
|
|
2269
3219
|
"data-align": columns[i]?.align,
|
|
2270
3220
|
"data-label": columns[i]?.label,
|
|
2271
3221
|
children: cell
|
|
@@ -2278,15 +3228,15 @@ function Table({ id, caption, columns, rows, compact }) {
|
|
|
2278
3228
|
});
|
|
2279
3229
|
}
|
|
2280
3230
|
// src/Tag.tsx
|
|
2281
|
-
import { jsx as
|
|
3231
|
+
import { jsx as jsx51, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
2282
3232
|
var icons2 = { ok: "check", warn: "warn", error: "close", info: "info" };
|
|
2283
3233
|
function Tag({ status, size, sprite, children }) {
|
|
2284
|
-
return /* @__PURE__ */
|
|
3234
|
+
return /* @__PURE__ */ jsxs35("span", {
|
|
2285
3235
|
className: "feitio-tag",
|
|
2286
3236
|
"data-status": status,
|
|
2287
3237
|
"data-size": size,
|
|
2288
3238
|
children: [
|
|
2289
|
-
size !== "small" && /* @__PURE__ */
|
|
3239
|
+
size !== "small" && /* @__PURE__ */ jsx51(Icon, {
|
|
2290
3240
|
name: icons2[status ?? "info"],
|
|
2291
3241
|
sprite
|
|
2292
3242
|
}),
|
|
@@ -2295,26 +3245,26 @@ function Tag({ status, size, sprite, children }) {
|
|
|
2295
3245
|
});
|
|
2296
3246
|
}
|
|
2297
3247
|
// src/TaskList.tsx
|
|
2298
|
-
import { jsx as
|
|
3248
|
+
import { jsx as jsx52, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
2299
3249
|
function TaskList({ items, sprite }) {
|
|
2300
|
-
return /* @__PURE__ */
|
|
3250
|
+
return /* @__PURE__ */ jsx52("ul", {
|
|
2301
3251
|
className: "feitio-task-list",
|
|
2302
|
-
children: items.map((i) => /* @__PURE__ */
|
|
3252
|
+
children: items.map((i) => /* @__PURE__ */ jsxs36("li", {
|
|
2303
3253
|
children: [
|
|
2304
|
-
/* @__PURE__ */
|
|
3254
|
+
/* @__PURE__ */ jsxs36("span", {
|
|
2305
3255
|
className: "name",
|
|
2306
3256
|
children: [
|
|
2307
|
-
/* @__PURE__ */
|
|
3257
|
+
/* @__PURE__ */ jsx52("a", {
|
|
2308
3258
|
className: "feitio-link",
|
|
2309
3259
|
href: i.href,
|
|
2310
3260
|
children: i.name
|
|
2311
3261
|
}),
|
|
2312
|
-
i.detail && /* @__PURE__ */
|
|
3262
|
+
i.detail && /* @__PURE__ */ jsx52("small", {
|
|
2313
3263
|
children: i.detail
|
|
2314
3264
|
})
|
|
2315
3265
|
]
|
|
2316
3266
|
}),
|
|
2317
|
-
/* @__PURE__ */
|
|
3267
|
+
/* @__PURE__ */ jsx52(Tag, {
|
|
2318
3268
|
status: i.status,
|
|
2319
3269
|
sprite,
|
|
2320
3270
|
children: i.word
|
|
@@ -2324,22 +3274,22 @@ function TaskList({ items, sprite }) {
|
|
|
2324
3274
|
});
|
|
2325
3275
|
}
|
|
2326
3276
|
// src/Text.tsx
|
|
2327
|
-
import { jsx as
|
|
3277
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
2328
3278
|
function Text({ children }) {
|
|
2329
|
-
return /* @__PURE__ */
|
|
3279
|
+
return /* @__PURE__ */ jsx53("p", {
|
|
2330
3280
|
className: "feitio-text",
|
|
2331
3281
|
children
|
|
2332
3282
|
});
|
|
2333
3283
|
}
|
|
2334
3284
|
// src/Textarea.tsx
|
|
2335
|
-
import { jsx as
|
|
3285
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
2336
3286
|
function Textarea({
|
|
2337
3287
|
invalid,
|
|
2338
3288
|
describedBy,
|
|
2339
3289
|
className,
|
|
2340
3290
|
...rest
|
|
2341
3291
|
}) {
|
|
2342
|
-
return /* @__PURE__ */
|
|
3292
|
+
return /* @__PURE__ */ jsx54("textarea", {
|
|
2343
3293
|
...rest,
|
|
2344
3294
|
className: classNames("feitio-textarea", className),
|
|
2345
3295
|
"aria-invalid": invalid ? "true" : undefined,
|
|
@@ -2347,7 +3297,7 @@ function Textarea({
|
|
|
2347
3297
|
});
|
|
2348
3298
|
}
|
|
2349
3299
|
// src/TextInput.tsx
|
|
2350
|
-
import { jsx as
|
|
3300
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
2351
3301
|
function TextInput({
|
|
2352
3302
|
invalid,
|
|
2353
3303
|
describedBy,
|
|
@@ -2355,7 +3305,7 @@ function TextInput({
|
|
|
2355
3305
|
className,
|
|
2356
3306
|
...rest
|
|
2357
3307
|
}) {
|
|
2358
|
-
return /* @__PURE__ */
|
|
3308
|
+
return /* @__PURE__ */ jsx55("input", {
|
|
2359
3309
|
...rest,
|
|
2360
3310
|
className: classNames("feitio-input", className),
|
|
2361
3311
|
"aria-invalid": invalid ? "true" : undefined,
|
|
@@ -2364,7 +3314,7 @@ function TextInput({
|
|
|
2364
3314
|
});
|
|
2365
3315
|
}
|
|
2366
3316
|
// src/TimeInput.tsx
|
|
2367
|
-
import { jsx as
|
|
3317
|
+
import { jsx as jsx56, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
2368
3318
|
function TimeInput({
|
|
2369
3319
|
hour = "09",
|
|
2370
3320
|
minute = "00",
|
|
@@ -2377,11 +3327,11 @@ function TimeInput({
|
|
|
2377
3327
|
disabled
|
|
2378
3328
|
}) {
|
|
2379
3329
|
usePageBehavior("feitioForms", wireForms2);
|
|
2380
|
-
return /* @__PURE__ */
|
|
3330
|
+
return /* @__PURE__ */ jsxs37("div", {
|
|
2381
3331
|
className: "feitio-time-field",
|
|
2382
3332
|
"data-hour-cycle": cycle,
|
|
2383
3333
|
children: [
|
|
2384
|
-
/* @__PURE__ */
|
|
3334
|
+
/* @__PURE__ */ jsx56("input", {
|
|
2385
3335
|
className: "seg",
|
|
2386
3336
|
inputMode: "numeric",
|
|
2387
3337
|
maxLength: 2,
|
|
@@ -2390,12 +3340,12 @@ function TimeInput({
|
|
|
2390
3340
|
"aria-invalid": invalid ? "true" : undefined,
|
|
2391
3341
|
disabled
|
|
2392
3342
|
}),
|
|
2393
|
-
/* @__PURE__ */
|
|
3343
|
+
/* @__PURE__ */ jsx56("span", {
|
|
2394
3344
|
className: "sep",
|
|
2395
3345
|
"aria-hidden": "true",
|
|
2396
3346
|
children: ":"
|
|
2397
3347
|
}),
|
|
2398
|
-
/* @__PURE__ */
|
|
3348
|
+
/* @__PURE__ */ jsx56("input", {
|
|
2399
3349
|
className: "seg",
|
|
2400
3350
|
inputMode: "numeric",
|
|
2401
3351
|
maxLength: 2,
|
|
@@ -2403,7 +3353,7 @@ function TimeInput({
|
|
|
2403
3353
|
"aria-label": minuteLabel,
|
|
2404
3354
|
disabled
|
|
2405
3355
|
}),
|
|
2406
|
-
cycle === "12" && /* @__PURE__ */
|
|
3356
|
+
cycle === "12" && /* @__PURE__ */ jsx56("button", {
|
|
2407
3357
|
type: "button",
|
|
2408
3358
|
className: "period",
|
|
2409
3359
|
"aria-label": periodLabel,
|
|
@@ -2414,9 +3364,9 @@ function TimeInput({
|
|
|
2414
3364
|
});
|
|
2415
3365
|
}
|
|
2416
3366
|
// src/VisuallyHidden.tsx
|
|
2417
|
-
import { jsx as
|
|
3367
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
2418
3368
|
function VisuallyHidden({ children }) {
|
|
2419
|
-
return /* @__PURE__ */
|
|
3369
|
+
return /* @__PURE__ */ jsx57("span", {
|
|
2420
3370
|
className: "feitio-visually-hidden",
|
|
2421
3371
|
children
|
|
2422
3372
|
});
|
|
@@ -2450,6 +3400,8 @@ export {
|
|
|
2450
3400
|
Hint,
|
|
2451
3401
|
Icon,
|
|
2452
3402
|
Inline,
|
|
3403
|
+
Kanban,
|
|
3404
|
+
KanbanCard,
|
|
2453
3405
|
Kbd,
|
|
2454
3406
|
Label,
|
|
2455
3407
|
Link,
|