@webority/ui-elements 0.35.2 → 0.36.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/dist/{WuiTree-Ds-8tNgs.js → WuiTree-DXP7pGeI.js} +1 -1
- package/dist/elements/kanban.js +1 -1
- package/dist/elements/tree.js +1 -1
- package/dist/{kanban-BeVAItir.js → kanban-BIiEMkTK.js} +47 -34
- package/dist/ui-calendar.global.js +1 -1
- package/dist/ui-calendar.js +50 -49
- package/dist/ui-elements.global.js +53 -53
- package/dist/ui-elements.js +3 -3
- package/dist/{wuiHttp-m0yQadwQ.js → wuiHttp-oeHs7X_c.js} +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./elementBase-Bg1xpvup.js";
|
|
2
|
-
import { c as t } from "./wuiHttp-
|
|
2
|
+
import { c as t } from "./wuiHttp-oeHs7X_c.js";
|
|
3
3
|
import { n, t as r } from "./formMirror-jGf5M4gk.js";
|
|
4
4
|
import { t as i } from "./iconGlyphs.g-Cpg1BUHm.js";
|
|
5
5
|
import { t as a } from "./listboxKeyNav-zts_8d5e.js";
|
package/dist/elements/kanban.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as e } from "../elementBase-Bg1xpvup.js";
|
|
2
|
-
import { a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "../kanban-
|
|
2
|
+
import { a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "../kanban-BIiEMkTK.js";
|
|
3
3
|
//#region src/elements/kanban.js
|
|
4
4
|
e("wui-kanban", n);
|
|
5
5
|
//#endregion
|
package/dist/elements/tree.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./elementBase-Bg1xpvup.js";
|
|
2
2
|
import { m as t, s as n, t as r } from "./formatters-DusKbTyV.js";
|
|
3
|
-
import { c as i, o as a } from "./wuiHttp-
|
|
3
|
+
import { c as i, o as a } from "./wuiHttp-oeHs7X_c.js";
|
|
4
4
|
//#region src/remoteModal.js
|
|
5
5
|
var o = "wui-remote-modal", s = "wui-modal-fullscreen", c = Object.freeze({
|
|
6
6
|
sm: 380,
|
|
@@ -350,7 +350,7 @@ var _e = Object.freeze([
|
|
|
350
350
|
server: "Something went wrong on our side, so the card went back. Try again in a moment.",
|
|
351
351
|
network: "Could not reach the server, so the card went back. Check your connection and try again."
|
|
352
352
|
})
|
|
353
|
-
}), B = "[data-wui-column]", V = "[data-wui-body]", H = "[data-wui-card]",
|
|
353
|
+
}), B = "[data-wui-column]", V = "[data-wui-body]", H = "[data-wui-card]", xe = "[data-wui-count]", Se = "[data-wui-summary]", Ce = "[data-wui-empty]", we = "[data-wui-drop-note]", Te = "[data-wui-live]", Ee = "[data-wui-help]", U = "[data-wui-switch]", De = "[data-wui-scroller]", Oe = "[data-wui-collapse]", ke = "[data-wui-more]", Ae = "data-wui-visible-limit", W = "data-wui-overflow", je = "input, select, textarea, [contenteditable=\"\"], [contenteditable=\"true\"], [data-wui-no-drag]", G = 48, K = 16, q = (e) => e.getAttribute("data-wui-column"), J = (e) => e.getAttribute("data-wui-card"), Y = (e) => e.hidden || e.hasAttribute("hidden"), Me = (e) => Y(e) || e.hasAttribute(W);
|
|
354
354
|
function Ne(e) {
|
|
355
355
|
if (e == null || e === "") return null;
|
|
356
356
|
let t = typeof e == "number" ? e : Number(e);
|
|
@@ -460,24 +460,24 @@ var $ = (e, t) => {
|
|
|
460
460
|
this._refreshQueued = !1;
|
|
461
461
|
let e = this._summaryFormat();
|
|
462
462
|
for (let n of this._columns()) {
|
|
463
|
-
let r = q(n), i = Ne(n.getAttribute(
|
|
463
|
+
let r = q(n), i = Ne(n.getAttribute(Ae)), a = [], o = [];
|
|
464
464
|
for (let e of this._cardsIn(n)) {
|
|
465
465
|
if (this._filter && (e.hidden = this._filter(e) === !1), Y(e)) {
|
|
466
|
-
e.removeAttribute(
|
|
466
|
+
e.removeAttribute(W);
|
|
467
467
|
continue;
|
|
468
468
|
}
|
|
469
469
|
a.push(e), o.push(e.getAttribute("data-wui-value"));
|
|
470
470
|
}
|
|
471
471
|
let s = this._expanded.has(r), c = Pe(a.map(J), i, s, this._revealed);
|
|
472
|
-
for (let e of a) e.toggleAttribute(
|
|
472
|
+
for (let e of a) e.toggleAttribute(W, c.has(J(e)));
|
|
473
473
|
let l = String(a.length);
|
|
474
474
|
for (let e of this._countsOf(n)) e.textContent !== l && (e.textContent = l);
|
|
475
|
-
let u = n.querySelector(
|
|
475
|
+
let u = n.querySelector(Ce);
|
|
476
476
|
if (u && (u.hidden = a.length > 0), e) {
|
|
477
|
-
let r = n.querySelector(
|
|
477
|
+
let r = n.querySelector(Se);
|
|
478
478
|
r && (r.textContent = t(Le(o), e));
|
|
479
479
|
}
|
|
480
|
-
let d = n.querySelector(
|
|
480
|
+
let d = n.querySelector(ke);
|
|
481
481
|
if (d) {
|
|
482
482
|
d.hidden = i == null || (s ? a.length <= i : c.size === 0), d.setAttribute("aria-expanded", s ? "true" : "false");
|
|
483
483
|
let e = s ? z.fewer : z.more(c.size);
|
|
@@ -520,11 +520,11 @@ var $ = (e, t) => {
|
|
|
520
520
|
return this._allCards().find((t) => J(t) === e) || null;
|
|
521
521
|
}
|
|
522
522
|
_countsOf(e) {
|
|
523
|
-
let t = q(e), n = [...this.querySelectorAll(
|
|
524
|
-
return [...e.querySelectorAll(
|
|
523
|
+
let t = q(e), n = [...this.querySelectorAll(U)].filter((e) => e.getAttribute("data-wui-switch") === t);
|
|
524
|
+
return [...e.querySelectorAll(xe), ...n.flatMap((e) => [...e.querySelectorAll(xe)])];
|
|
525
525
|
}
|
|
526
526
|
_scroller() {
|
|
527
|
-
return this.querySelector(
|
|
527
|
+
return this.querySelector(De);
|
|
528
528
|
}
|
|
529
529
|
_summaryFormat() {
|
|
530
530
|
let e = this.getAttribute("summary-format");
|
|
@@ -536,11 +536,11 @@ var $ = (e, t) => {
|
|
|
536
536
|
}));
|
|
537
537
|
}
|
|
538
538
|
_prepareCard(e) {
|
|
539
|
-
let t = this.querySelector(
|
|
539
|
+
let t = this.querySelector(Ee);
|
|
540
540
|
t?.id && !e.hasAttribute("aria-describedby") && e.setAttribute("aria-describedby", t.id), e.hasAttribute("tabindex") || (e.tabIndex = 0);
|
|
541
541
|
}
|
|
542
542
|
_announce(e) {
|
|
543
|
-
let t = this.querySelector(
|
|
543
|
+
let t = this.querySelector(Te);
|
|
544
544
|
!t || !e || (t.textContent = "", t.textContent = e);
|
|
545
545
|
}
|
|
546
546
|
_fire(e, t, n = !1) {
|
|
@@ -590,7 +590,7 @@ var $ = (e, t) => {
|
|
|
590
590
|
for (let i of this._columns()) {
|
|
591
591
|
let a = q(i), o = this._check(e, t, a);
|
|
592
592
|
r.set(a, o), i.setAttribute("data-wui-drop", o.source ? "source" : o.ok ? "ok" : "refused");
|
|
593
|
-
let s = i.querySelector(
|
|
593
|
+
let s = i.querySelector(we);
|
|
594
594
|
s && !o.source && (s.textContent = o.ok ? z.dropHere(n, this._titleOf(i)) : o.reason, s.hidden = !1);
|
|
595
595
|
}
|
|
596
596
|
return r;
|
|
@@ -598,7 +598,7 @@ var $ = (e, t) => {
|
|
|
598
598
|
_clearTargets() {
|
|
599
599
|
for (let e of this._columns()) {
|
|
600
600
|
e.removeAttribute("data-wui-drop"), e.removeAttribute("data-wui-over"), e.removeAttribute("data-wui-target");
|
|
601
|
-
let t = e.querySelector(
|
|
601
|
+
let t = e.querySelector(we);
|
|
602
602
|
t && (t.hidden = !0, t.textContent = "");
|
|
603
603
|
}
|
|
604
604
|
}
|
|
@@ -616,7 +616,7 @@ var $ = (e, t) => {
|
|
|
616
616
|
}, f = e.contains(document.activeElement);
|
|
617
617
|
if (this._controlled()) return this._fire("wui:kanban:move", d), this._announce(z.moved(s, this._titleOf(o))), f && this._refocusSoon(d.key), !0;
|
|
618
618
|
if (!this._fire("wui:kanban:move", d, !0)) return !1;
|
|
619
|
-
let p = o.hasAttribute(
|
|
619
|
+
let p = o.hasAttribute(Ae) && !this._revealed.has(d.key);
|
|
620
620
|
p && this._revealed.add(d.key);
|
|
621
621
|
let m = {
|
|
622
622
|
parent: e.parentNode,
|
|
@@ -624,7 +624,7 @@ var $ = (e, t) => {
|
|
|
624
624
|
column: r,
|
|
625
625
|
revealed: p
|
|
626
626
|
};
|
|
627
|
-
this._bodyOf(o).insertBefore(e, l[u] || null), f &&
|
|
627
|
+
this._bodyOf(o).insertBefore(e, l[u] || null), f && this._focusMoved(e), this.refresh();
|
|
628
628
|
let h = o.getAttribute("data-wui-step");
|
|
629
629
|
if (h) return this._runStep(e, d, m, h, o.getAttribute("data-wui-step-size"));
|
|
630
630
|
let g = this.getAttribute("move-url");
|
|
@@ -716,17 +716,23 @@ var $ = (e, t) => {
|
|
|
716
716
|
let r = t.contains(document.activeElement);
|
|
717
717
|
t.dispatchEvent(new CustomEvent("wui:teardown", { bubbles: !0 })), t.hidden && (e.hidden = !0), t.replaceWith(e), this._prepareCard(e), r && e.focus(), n ??= e;
|
|
718
718
|
}
|
|
719
|
-
for (let e of t.content.querySelectorAll("template[data-wui-kanban-summary]")) this._columnByKey(e.getAttribute("data-wui-kanban-summary"))?.querySelector(
|
|
719
|
+
for (let e of t.content.querySelectorAll("template[data-wui-kanban-summary]")) this._columnByKey(e.getAttribute("data-wui-kanban-summary"))?.querySelector(Se)?.replaceChildren(e.content.cloneNode(!0));
|
|
720
720
|
return this.refresh(), window.WUI?.refresh?.(), n;
|
|
721
721
|
}
|
|
722
722
|
_refocusSoon(e) {
|
|
723
|
-
let t = () =>
|
|
723
|
+
let t = () => {
|
|
724
|
+
let t = this._cardByKey(e);
|
|
725
|
+
t && this._focusMoved(t);
|
|
726
|
+
};
|
|
724
727
|
typeof requestAnimationFrame == "function" ? requestAnimationFrame(t) : setTimeout(t, 0);
|
|
725
728
|
}
|
|
729
|
+
_focusMoved(e) {
|
|
730
|
+
e.focus({ preventScroll: !0 }), e.scrollIntoView?.({ block: "nearest" });
|
|
731
|
+
}
|
|
726
732
|
_pointerDown(e) {
|
|
727
733
|
if (e.button !== 0 || e.isPrimary === !1 || this._drag || this._kbd) return;
|
|
728
734
|
let t = e.target.closest?.(H);
|
|
729
|
-
if (!t || !this.contains(t) || e.target.closest(
|
|
735
|
+
if (!t || !this.contains(t) || e.target.closest(je)) return;
|
|
730
736
|
let n = {
|
|
731
737
|
card: t,
|
|
732
738
|
id: e.pointerId,
|
|
@@ -778,7 +784,7 @@ var $ = (e, t) => {
|
|
|
778
784
|
let n = this._drag;
|
|
779
785
|
n.x = e, n.y = t, n.ghost.style.transform = `translate(${e - n.dx}px, ${t - n.dy}px)`;
|
|
780
786
|
let r = this._columnAt(e, t);
|
|
781
|
-
r !== n.over && (n.over?.removeAttribute("data-wui-over"), r?.setAttribute("data-wui-over", ""), n.over = r), this._autoScroll(e, t);
|
|
787
|
+
r !== n.over && (n.over?.removeAttribute("data-wui-over"), r?.setAttribute("data-wui-over", ""), n.over = r), this._autoScroll(e, t, r);
|
|
782
788
|
}
|
|
783
789
|
_columnAt(e, t) {
|
|
784
790
|
for (let n of this._columns()) {
|
|
@@ -794,14 +800,21 @@ var $ = (e, t) => {
|
|
|
794
800
|
}), r = this._cardsIn(e).filter((e) => e !== this._drag?.card);
|
|
795
801
|
return n ? r.indexOf(n) : r.length;
|
|
796
802
|
}
|
|
797
|
-
_autoScroll(e, t) {
|
|
798
|
-
let
|
|
799
|
-
if (
|
|
800
|
-
let t =
|
|
801
|
-
t.width > 0 && (e < t.left +
|
|
803
|
+
_autoScroll(e, t, n) {
|
|
804
|
+
let r = this._scroller();
|
|
805
|
+
if (r) {
|
|
806
|
+
let t = r.getBoundingClientRect();
|
|
807
|
+
t.width > 0 && (e < t.left + G ? r.scrollBy?.({ left: -16 }) : e > t.right - G && r.scrollBy?.({ left: K }));
|
|
802
808
|
}
|
|
803
|
-
|
|
804
|
-
|
|
809
|
+
if (n && this._scrollColumn(n, t)) return;
|
|
810
|
+
let i = window.innerHeight || 0;
|
|
811
|
+
i > 0 && (t < G ? window.scrollBy?.({ top: -16 }) : t > i - G && window.scrollBy?.({ top: K }));
|
|
812
|
+
}
|
|
813
|
+
_scrollColumn(e, t) {
|
|
814
|
+
let n = this._bodyOf(e);
|
|
815
|
+
if (!n || e.hasAttribute("data-collapsed") || n.scrollHeight <= n.clientHeight) return !1;
|
|
816
|
+
let r = n.getBoundingClientRect();
|
|
817
|
+
return t < r.top + G && n.scrollTop > 0 ? (n.scrollBy?.({ top: -16 }), !0) : t > r.bottom - G && n.scrollTop + n.clientHeight < n.scrollHeight - 1 ? (n.scrollBy?.({ top: K }), !0) : !1;
|
|
805
818
|
}
|
|
806
819
|
_endPointer(e) {
|
|
807
820
|
let t = this._press, n = this._drag;
|
|
@@ -830,18 +843,18 @@ var $ = (e, t) => {
|
|
|
830
843
|
e.preventDefault(), e.stopPropagation(), this._suppressClick = !1;
|
|
831
844
|
return;
|
|
832
845
|
}
|
|
833
|
-
let t = e.target.closest?.(
|
|
846
|
+
let t = e.target.closest?.(Oe);
|
|
834
847
|
if (t && this.contains(t)) {
|
|
835
848
|
let e = t.closest(B);
|
|
836
849
|
e && this._setCollapsed(e, !e.hasAttribute("data-collapsed"), !0);
|
|
837
850
|
return;
|
|
838
851
|
}
|
|
839
|
-
let n = e.target.closest?.(
|
|
852
|
+
let n = e.target.closest?.(ke);
|
|
840
853
|
if (n && this.contains(n)) {
|
|
841
854
|
this._controlled() || this._toggleMore(n.closest(B));
|
|
842
855
|
return;
|
|
843
856
|
}
|
|
844
|
-
let r = e.target.closest?.(
|
|
857
|
+
let r = e.target.closest?.(U);
|
|
845
858
|
r && this.contains(r) && this._showColumn(r.getAttribute("data-wui-switch"));
|
|
846
859
|
}
|
|
847
860
|
_keyDown(e) {
|
|
@@ -935,7 +948,7 @@ var $ = (e, t) => {
|
|
|
935
948
|
let r = q(e);
|
|
936
949
|
e.toggleAttribute("data-collapsed", t);
|
|
937
950
|
let i = this._titleOf(e);
|
|
938
|
-
for (let n of e.querySelectorAll(
|
|
951
|
+
for (let n of e.querySelectorAll(Oe)) n.setAttribute("aria-expanded", t ? "false" : "true"), n.setAttribute("aria-label", t ? z.expand(i) : z.collapse(i));
|
|
939
952
|
n && (Fe(this.getAttribute("board-id"), r, t), this._fire("wui:kanban:collapse", {
|
|
940
953
|
column: r,
|
|
941
954
|
collapsed: t
|
|
@@ -952,7 +965,7 @@ var $ = (e, t) => {
|
|
|
952
965
|
return typeof matchMedia == "function" && matchMedia("(max-width: 767.98px)").matches;
|
|
953
966
|
}
|
|
954
967
|
_showColumn(e, t = !0) {
|
|
955
|
-
for (let t of this.querySelectorAll(
|
|
968
|
+
for (let t of this.querySelectorAll(U)) t.getAttribute("data-wui-switch") === e ? t.setAttribute("aria-current", "true") : t.removeAttribute("aria-current");
|
|
956
969
|
let n = this._columnByKey(e), r = this._scroller();
|
|
957
970
|
if (!n || !r || !t && !this._isPhone()) return;
|
|
958
971
|
let i = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
@@ -965,7 +978,7 @@ var $ = (e, t) => {
|
|
|
965
978
|
let e = this._scroller();
|
|
966
979
|
if (!e || !this._isPhone()) return;
|
|
967
980
|
let t = e.clientWidth || 1, n = this._columns()[Math.round(e.scrollLeft / t)];
|
|
968
|
-
if (n) for (let e of this.querySelectorAll(
|
|
981
|
+
if (n) for (let e of this.querySelectorAll(U)) e.getAttribute("data-wui-switch") === q(n) ? e.setAttribute("aria-current", "true") : e.removeAttribute("aria-current");
|
|
969
982
|
}
|
|
970
983
|
};
|
|
971
984
|
//#endregion
|