@mintplayer/web-components 2.2.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/a11y/index.mjs +26 -2
  2. package/a11y/src/dismiss-stack.d.ts +25 -0
  3. package/a11y/src/error-text.d.ts +41 -0
  4. package/a11y/src/focus-restore.d.ts +116 -0
  5. package/a11y/src/focus-trap.d.ts +69 -0
  6. package/a11y/src/form-associated.d.ts +48 -0
  7. package/a11y/src/host-aria.d.ts +154 -0
  8. package/a11y/src/index.d.ts +16 -0
  9. package/a11y/src/inert-regions.d.ts +52 -0
  10. package/a11y/src/live-announcer.d.ts +8 -0
  11. package/a11y/src/roving-focus.d.ts +118 -0
  12. package/a11y/src/testing/expect-idref-resolves.d.ts +31 -0
  13. package/a11y/src/testing/index.d.ts +1 -0
  14. package/accordion/index.mjs +180 -174
  15. package/accordion/src/components/mp-accordion.d.ts +18 -13
  16. package/calendar/index.mjs +1 -1
  17. package/calendar/src/mp-calendar.element.d.ts +2 -0
  18. package/carousel/index.mjs +211 -164
  19. package/carousel/src/components/mp-carousel.d.ts +1 -0
  20. package/checkbox/index.mjs +1 -1
  21. package/checkbox/src/components/mp-checkbox.d.ts +59 -1
  22. package/chunks/color-CpFtrIoX.mjs +899 -0
  23. package/chunks/focus-restore-DxuP1Oe2.mjs +94 -0
  24. package/chunks/focus-trap-DTOLJ5bb.mjs +121 -0
  25. package/chunks/form-associated-axmc5sY0.mjs +58 -0
  26. package/chunks/host-aria-WSGs7SPQ.mjs +152 -0
  27. package/chunks/inert-regions-DXCnn1LN.mjs +48 -0
  28. package/chunks/invalid-feedback.styles-he0JYrJm.mjs +11 -0
  29. package/chunks/{live-announcer-CZDTKulf.mjs → live-announcer-Bi0orG4n.mjs} +9 -9
  30. package/chunks/{mp-calendar.element-UC68iDbi.mjs → mp-calendar.element-u6uS31_j.mjs} +136 -105
  31. package/chunks/mp-checkbox-Ph2mMRGz.mjs +312 -0
  32. package/chunks/{mp-datatable-Bfw0KGkV.mjs → mp-datatable-BwTlh9A_.mjs} +265 -103
  33. package/chunks/{mp-pagination-BGxsawFL.mjs → mp-pagination-Dea75mD4.mjs} +25 -22
  34. package/chunks/mp-radio-BjW1HNSc.mjs +300 -0
  35. package/chunks/{mp-select-BDS1-YGn.mjs → mp-select-Ctu-v1-p.mjs} +163 -40
  36. package/chunks/{mp-splitter-C8cGCmac.mjs → mp-splitter-LszuRDbR.mjs} +53 -46
  37. package/chunks/{mp-tab-page-D1b4x-y2.mjs → mp-tab-page-CaCzX1ym.mjs} +46 -45
  38. package/chunks/{mp-timepicker.element-BwEiwX92.mjs → mp-timepicker.element-Bz393NDQ.mjs} +93 -86
  39. package/chunks/{mp-toggle-button-dLZNDUVz.mjs → mp-toggle-button-Kz6sIgBJ.mjs} +131 -37
  40. package/chunks/{mp-treeview-C48F63xb.mjs → mp-treeview-tkWu28iF.mjs} +67 -43
  41. package/chunks/overlay-controller-DPt13i8p.mjs +314 -0
  42. package/chunks/roving-focus-CrL9982a.mjs +129 -0
  43. package/code-snippet/index.mjs +21 -13
  44. package/code-snippet/src/mp-code-snippet.element.d.ts +6 -0
  45. package/datatable/index.mjs +1 -1
  46. package/datatable/src/components/mp-datatable.d.ts +50 -0
  47. package/datatable/src/types/index.d.ts +2 -0
  48. package/datatable/src/types/labels.d.ts +30 -0
  49. package/datepicker/index.mjs +45 -22
  50. package/datepicker/src/mp-datepicker.element.d.ts +30 -0
  51. package/datetime-picker/index.mjs +15 -9
  52. package/dock/index.mjs +365 -209
  53. package/dock/src/components/mint-dock-manager.element.d.ts +63 -3
  54. package/dropdown-menu/index.mjs +135 -90
  55. package/dropdown-menu/src/components/mp-dropdown-menu.d.ts +12 -3
  56. package/file-manager/index.mjs +279 -214
  57. package/file-manager/src/components/mp-file-manager.d.ts +22 -0
  58. package/file-manager/src/types/messages.d.ts +9 -0
  59. package/multi-range/index.mjs +26 -10
  60. package/multi-range/src/mint-multi-range.element.d.ts +7 -0
  61. package/navbar/index.mjs +53 -39
  62. package/navbar/src/components/mp-navbar.d.ts +1 -0
  63. package/otp-input/index.mjs +82 -48
  64. package/otp-input/src/mint-otp-input.element.d.ts +31 -3
  65. package/overlay/index.mjs +2 -258
  66. package/overlay/src/overlay-controller.d.ts +64 -4
  67. package/package.json +9 -1
  68. package/pagination/index.mjs +1 -1
  69. package/query-builder/index.mjs +117 -87
  70. package/query-builder/src/model/messages.d.ts +9 -0
  71. package/radio/index.mjs +2 -160
  72. package/radio/src/components/mp-radio.d.ts +58 -3
  73. package/radio-group/index.d.ts +1 -0
  74. package/radio-group/index.mjs +145 -0
  75. package/radio-group/src/components/mp-radio-group.d.ts +52 -0
  76. package/radio-group/src/index.d.ts +1 -0
  77. package/radio-group/src/styles/radio-group.styles.d.ts +2 -0
  78. package/ribbon/index.mjs +316 -304
  79. package/ribbon/src/mp-ribbon.element.d.ts +16 -0
  80. package/scheduler/index.mjs +892 -493
  81. package/scheduler/src/components/mp-scheduler.d.ts +30 -0
  82. package/scheduler/src/input/input-handler.d.ts +2 -0
  83. package/scheduler/src/views/base-view.d.ts +43 -6
  84. package/scheduler/src/views/timeline-view.d.ts +6 -0
  85. package/scheduler-core/index.mjs +73 -70
  86. package/scheduler-core/src/models/index.d.ts +1 -0
  87. package/scheduler-core/src/models/messages.d.ts +69 -0
  88. package/scheduler-core/src/models/options.d.ts +4 -0
  89. package/select/index.mjs +1 -1
  90. package/select/src/components/mp-select.d.ts +60 -3
  91. package/shell/index.mjs +142 -31
  92. package/shell/src/components/mp-shell.d.ts +1 -0
  93. package/signature-pad/index.d.ts +1 -0
  94. package/signature-pad/index.mjs +230 -0
  95. package/signature-pad/src/index.d.ts +2 -0
  96. package/signature-pad/src/mp-signature-pad.element.d.ts +143 -0
  97. package/signature-pad/src/mp-signature-pad.element.template.d.ts +2 -0
  98. package/signature-pad/src/types/signature.d.ts +12 -0
  99. package/splitter/index.mjs +1 -1
  100. package/splitter/src/components/mp-splitter.d.ts +7 -0
  101. package/tab-control/index.mjs +1 -1
  102. package/tile-manager/index.mjs +110 -93
  103. package/timeline/index.mjs +138 -54
  104. package/timeline/src/components/mp-timeline.d.ts +15 -0
  105. package/timepicker/index.mjs +1 -1
  106. package/timepicker/src/mp-time-list.element.d.ts +13 -4
  107. package/timepicker/src/mp-timepicker.element.d.ts +29 -0
  108. package/toggle-button/index.mjs +1 -1
  109. package/toggle-button/src/components/mp-toggle-button.d.ts +32 -1
  110. package/tree-select/index.mjs +233 -121
  111. package/tree-select/src/components/mp-tree-select.d.ts +37 -0
  112. package/treeview/index.mjs +1 -1
  113. package/treeview/src/components/mp-treeview.d.ts +10 -1
  114. package/chunks/color-CyamnJnn.mjs +0 -847
  115. package/chunks/mp-checkbox-BokLL7BS.mjs +0 -211
@@ -1,8 +1,8 @@
1
- import { html as d, unsafeCSS as D, LitElement as S, nothing as u } from "lit";
2
- import { createContext as R, ContextConsumer as p, ContextProvider as k } from "@lit/context";
1
+ import { html as d, unsafeCSS as S, LitElement as R, nothing as u } from "lit";
2
+ import { createContext as A, ContextConsumer as p, ContextProvider as k } from "@lit/context";
3
3
  import { createRef as ee, ref as te } from "lit/directives/ref.js";
4
- import "../chunks/mp-select-BDS1-YGn.mjs";
5
- import "../chunks/mp-checkbox-BokLL7BS.mjs";
4
+ import "../chunks/mp-select-Ctu-v1-p.mjs";
5
+ import "../chunks/mp-checkbox-Ph2mMRGz.mjs";
6
6
  const j = {
7
7
  string: [
8
8
  "equals",
@@ -226,7 +226,7 @@ function Q(o) {
226
226
  case "condition":
227
227
  return {
228
228
  ...o,
229
- value: M(o.value)
229
+ value: T(o.value)
230
230
  };
231
231
  case "subquery":
232
232
  return {
@@ -235,13 +235,13 @@ function Q(o) {
235
235
  };
236
236
  }
237
237
  }
238
- function M(o) {
238
+ function T(o) {
239
239
  if (o == null) return o;
240
- if (Array.isArray(o)) return o.map(M);
240
+ if (Array.isArray(o)) return o.map(T);
241
241
  if (typeof o == "object") {
242
242
  const e = {};
243
243
  for (const [t, r] of Object.entries(o))
244
- e[t] = M(r);
244
+ e[t] = T(r);
245
245
  return e;
246
246
  }
247
247
  return o;
@@ -270,16 +270,16 @@ function _(o, e) {
270
270
  return _(o.subQuery, e);
271
271
  return null;
272
272
  }
273
- function P(o, e) {
273
+ function E(o, e) {
274
274
  if (o.kind === "group") {
275
275
  const t = o.children.findIndex((r) => r.id === e);
276
276
  if (t >= 0) return { parent: o, index: t };
277
277
  for (const r of o.children) {
278
- const n = P(r, e);
278
+ const n = E(r, e);
279
279
  if (n) return n;
280
280
  }
281
281
  } else if (o.kind === "subquery")
282
- return P(o.subQuery, e);
282
+ return E(o.subQuery, e);
283
283
  return null;
284
284
  }
285
285
  function V(o) {
@@ -390,6 +390,15 @@ const m = {
390
390
  deleteQuery: "Delete",
391
391
  treeTooDeep: "Tree too deep",
392
392
  dropHerePlaceholder: "Drop here",
393
+ emptyGroup: "(empty group)",
394
+ savedQueryName: "Name for saved query",
395
+ entity: "Entity",
396
+ columns: "Columns",
397
+ sortBy: "Sort by",
398
+ reorderHint: "Drag or use Alt+Up/Down to reorder",
399
+ field: "Field",
400
+ operator: "Operator",
401
+ groupLogic: "Group logic",
393
402
  operators: {
394
403
  equals: "=",
395
404
  "not-equals": "≠",
@@ -436,15 +445,15 @@ function je(o, e, t, r = {}) {
436
445
  currentEntity: t.rootEntity,
437
446
  depth: 0
438
447
  };
439
- return T(o, e, s, n);
448
+ return P(o, e, s, n);
440
449
  }
441
- function T(o, e, t, r) {
450
+ function P(o, e, t, r) {
442
451
  if (t.depth > r) throw new K(t.depth, r);
443
452
  switch (o.kind) {
444
453
  case "condition":
445
454
  return e.condition(o, t);
446
455
  case "group": {
447
- const n = { ...t, depth: t.depth + 1 }, s = o.children.map((b) => T(b, e, n, r));
456
+ const n = { ...t, depth: t.depth + 1 }, s = o.children.map((b) => P(b, e, n, r));
448
457
  return e.group(o, s, t);
449
458
  }
450
459
  case "subquery": {
@@ -461,7 +470,7 @@ function T(o, e, t, r) {
461
470
  ...t,
462
471
  currentEntity: b,
463
472
  depth: t.depth + 1
464
- }, a = () => T(o.subQuery, e, i, r);
473
+ }, a = () => P(o.subQuery, e, i, r);
465
474
  return e.subquery(o, t, a);
466
475
  }
467
476
  }
@@ -507,16 +516,16 @@ function qe(o, e) {
507
516
  const t = g(o);
508
517
  if (t === "null") return "";
509
518
  if (t === "tuple" && Array.isArray(e))
510
- return `[${e.map(z).join(", ")}]`;
519
+ return `[${e.map(M).join(", ")}]`;
511
520
  if (t === "array" && Array.isArray(e))
512
- return `[${e.map(z).join(", ")}]`;
521
+ return `[${e.map(M).join(", ")}]`;
513
522
  if (t === "n-input" && typeof e == "object" && e !== null) {
514
523
  const r = e.n;
515
524
  return typeof r == "number" ? String(r) : JSON.stringify(e);
516
525
  }
517
- return z(e);
526
+ return M(e);
518
527
  }
519
- function z(o) {
528
+ function M(o) {
520
529
  return o == null ? "?" : typeof o == "string" ? `"${o}"` : o instanceof Date ? o.toISOString() : String(o);
521
530
  }
522
531
  function W(o, e, t) {
@@ -604,16 +613,16 @@ function Ee(o, e, t) {
604
613
  }
605
614
  return r;
606
615
  }
607
- const F = R(
616
+ const F = A(
608
617
  Symbol("mp-query-builder.editorRegistry")
609
- ), E = R(
618
+ ), C = A(
610
619
  Symbol("mp-query-builder.disabled")
611
- ), q = R(
620
+ ), q = A(
612
621
  Symbol("mp-query-builder.messages")
613
- ), B = R(
622
+ ), B = A(
614
623
  Symbol("mp-query-builder.maxDepth")
615
624
  );
616
- function C(o, e, t, r, n = {}) {
625
+ function D(o, e, t, r, n = {}) {
617
626
  const s = document.createElement("input");
618
627
  s.type = o, s.className = "form-control form-control-sm qb-editor-input", s.value = e, r && (s.disabled = !0);
619
628
  for (const [i, a] of Object.entries(n))
@@ -643,7 +652,7 @@ function w(o) {
643
652
  return (e) => {
644
653
  const t = o === "string" ? "text" : o === "date" ? "date" : o === "datetime" ? "datetime-local" : "number", r = {};
645
654
  o === "integer" && (r.step = "1"), o === "number" && (r.step = "any");
646
- const n = J(e.value, o), s = C(
655
+ const n = J(e.value, o), s = D(
647
656
  t,
648
657
  n,
649
658
  (b) => e.onChange(Z(b, o)),
@@ -657,12 +666,12 @@ function U(o) {
657
666
  return (e) => {
658
667
  const t = document.createElement("span");
659
668
  t.className = "qb-editor-tuple";
660
- const [r, n] = Array.isArray(e.value) ? [e.value[0] ?? null, e.value[1] ?? null] : [null, null], s = (f, A) => {
669
+ const [r, n] = Array.isArray(e.value) ? [e.value[0] ?? null, e.value[1] ?? null] : [null, null], s = (f, z) => {
661
670
  const O = Array.isArray(e.value) ? [e.value[0] ?? null, e.value[1] ?? null] : [null, null];
662
- O[f] = Z(A, o), e.onChange(O);
671
+ O[f] = Z(z, o), e.onChange(O);
663
672
  }, b = (f) => J(f, o), i = o === "date" ? "date" : o === "datetime" ? "datetime-local" : "number", a = {};
664
673
  o === "integer" && (a.step = "1"), o === "number" && (a.step = "any");
665
- const l = C(i, b(r), (f) => s(0, f), e.disabled, a), c = C(i, b(n), (f) => s(1, f), e.disabled, a);
674
+ const l = D(i, b(r), (f) => s(0, f), e.disabled, a), c = D(i, b(n), (f) => s(1, f), e.disabled, a);
666
675
  l.setAttribute("aria-label", `${e.field.label} (from)`), c.setAttribute("aria-label", `${e.field.label} (to)`);
667
676
  const h = document.createElement("span");
668
677
  return h.textContent = " … ", h.className = "qb-editor-tuple-sep", t.append(l, h, c), { element: t };
@@ -670,7 +679,7 @@ function U(o) {
670
679
  }
671
680
  function Ce() {
672
681
  return (o) => {
673
- const e = typeof o.value == "object" && o.value !== null ? String(o.value.n ?? 1) : "1", t = C(
682
+ const e = typeof o.value == "object" && o.value !== null ? String(o.value.n ?? 1) : "1", t = D(
674
683
  "number",
675
684
  e,
676
685
  (r) => {
@@ -762,7 +771,7 @@ function Re(o, e) {
762
771
  }
763
772
  d`<!-- Rendered dynamically by render(). Codegen-wc emits styles from the
764
773
  sibling .scss; the template export is intentionally unused. -->`;
765
- const Ae = D(`.btn {
774
+ const Ae = S(`.btn {
766
775
  --bs-btn-padding-x: 0.75rem;
767
776
  --bs-btn-padding-y: 0.375rem;
768
777
  --bs-btn-font-family: ;
@@ -1528,13 +1537,13 @@ textarea.form-control-lg {
1528
1537
  outline: none;
1529
1538
  box-shadow: none;
1530
1539
  }`);
1531
- class ze extends S {
1540
+ class ze extends R {
1532
1541
  constructor() {
1533
1542
  super(...arguments), this.node = null, this.schema = [], this.currentEntity = "", this._messagesConsumer = new p(this, {
1534
1543
  context: q,
1535
1544
  subscribe: !0
1536
1545
  }), this._disabledConsumer = new p(this, {
1537
- context: E,
1546
+ context: C,
1538
1547
  subscribe: !0
1539
1548
  }), this._registryConsumer = new p(this, {
1540
1549
  context: F,
@@ -1564,8 +1573,8 @@ class ze extends S {
1564
1573
  if (!e.altKey || e.key !== "ArrowUp" && e.key !== "ArrowDown") return;
1565
1574
  const t = this.node;
1566
1575
  if (!t || this.isDisabled()) return;
1567
- const r = this.shadowRoot?.querySelector(".qb-condition");
1568
- e.composedPath()[0] === r && (e.preventDefault(), this.dispatchEvent(new CustomEvent("qb-keyboard-move", {
1576
+ const r = this.shadowRoot?.querySelector(".qb-condition"), n = e.composedPath()[0], s = n instanceof HTMLElement && n.classList.contains("qb-drag-handle");
1577
+ n !== r && !s || (e.preventDefault(), this.dispatchEvent(new CustomEvent("qb-keyboard-move", {
1569
1578
  detail: { id: t.id, direction: e.key === "ArrowUp" ? "up" : "down" },
1570
1579
  bubbles: !0,
1571
1580
  composed: !0
@@ -1662,9 +1671,9 @@ class ze extends S {
1662
1671
  operator: t.operator,
1663
1672
  value: t.value,
1664
1673
  disabled: s,
1665
- onChange: (A) => {
1674
+ onChange: (z) => {
1666
1675
  this.dispatchEvent(new CustomEvent("condition-value-change", {
1667
- detail: { id: t.id, value: A },
1676
+ detail: { id: t.id, value: z },
1668
1677
  bubbles: !0,
1669
1678
  composed: !0
1670
1679
  }));
@@ -1687,6 +1696,11 @@ class ze extends S {
1687
1696
  class="qb-condition"
1688
1697
  part="condition"
1689
1698
  tabindex="0"
1699
+ role="group"
1700
+ aria-label=${// The row is a tab stop (Alt+Up/Down reorder) — without a role and
1701
+ // name a blind user lands on silence. The name tracks the row's
1702
+ // current field + operator, re-derived every render (§11a).
1703
+ `${t?.label ?? e.field} ${r.operators[e.operator] ?? e.operator}`}
1690
1704
  data-row-id=${e.id}
1691
1705
  @keydown=${this._onRowKeyDown}
1692
1706
  >
@@ -1695,8 +1709,8 @@ class ze extends S {
1695
1709
  class="qb-drag-handle"
1696
1710
  part="drag-handle"
1697
1711
  ?disabled=${s}
1698
- aria-label="Drag or use Alt+Up/Down to reorder"
1699
- title="Drag or use Alt+Up/Down to reorder"
1712
+ aria-label=${r.reorderHint}
1713
+ title=${r.reorderHint}
1700
1714
  @pointerdown=${this._onDragPointerDown}
1701
1715
  >⋮</button>
1702
1716
  <mp-select
@@ -1706,7 +1720,7 @@ class ze extends S {
1706
1720
  .value=${e.field}
1707
1721
  ?disabled=${s}
1708
1722
  @change=${this._onFieldChange}
1709
- aria-label="Field"
1723
+ aria-label=${r.field}
1710
1724
  >
1711
1725
  ${b.map((a) => d`<option value=${a.name}>${a.label}</option>`)}
1712
1726
  ${t ? u : d`<option value=${e.field}>(${e.field})</option>`}
@@ -1718,7 +1732,7 @@ class ze extends S {
1718
1732
  .value=${e.operator}
1719
1733
  ?disabled=${s || !t}
1720
1734
  @change=${this._onOperatorChange}
1721
- aria-label="Operator"
1735
+ aria-label=${r.operator}
1722
1736
  >
1723
1737
  ${i.map((a) => d`
1724
1738
  <option value=${a}>${r.operators[a] ?? a}</option>
@@ -1732,8 +1746,8 @@ class ze extends S {
1732
1746
  part="remove"
1733
1747
  ?disabled=${s}
1734
1748
  @click=${this._onRemove}
1735
- aria-label="Remove condition"
1736
- title="Remove"
1749
+ aria-label=${r.removeRow}
1750
+ title=${r.removeRow}
1737
1751
  >×</button>
1738
1752
  </div>
1739
1753
  `;
@@ -1742,7 +1756,7 @@ class ze extends S {
1742
1756
  typeof customElements < "u" && !customElements.get("mp-query-condition") && customElements.define("mp-query-condition", ze);
1743
1757
  d`<!-- Rendered dynamically by render(). Codegen-wc emits styles from the
1744
1758
  sibling .scss; the template export is intentionally unused. -->`;
1745
- const Me = D(`:host {
1759
+ const Me = S(`:host {
1746
1760
  display: block;
1747
1761
  margin: 0.25rem 0;
1748
1762
  }
@@ -1775,7 +1789,7 @@ const Me = D(`:host {
1775
1789
  font-style: italic;
1776
1790
  color: var(--bs-secondary-color, #6c757d);
1777
1791
  }`);
1778
- class Pe extends S {
1792
+ class Te extends R {
1779
1793
  constructor() {
1780
1794
  super(...arguments), this.node = null, this.schema = [], this.currentEntity = "", this.depth = 0, this.qbRoot = "", this.isDragging = !1, this._messagesConsumer = new p(this, {
1781
1795
  context: q,
@@ -1826,6 +1840,10 @@ class Pe extends S {
1826
1840
  class="qb-subquery-header"
1827
1841
  part="subquery-header"
1828
1842
  tabindex="0"
1843
+ role="group"
1844
+ aria-label=${// Focusable reorder stop — role + a name mirroring the visible
1845
+ // field/operator/target text, re-derived every render (§11a).
1846
+ `${n} ${s}${b ? ` ${b}` : ""}`}
1829
1847
  @keydown=${this._onHeaderKeyDown}
1830
1848
  >
1831
1849
  <span class="qb-subquery-field">${n}</span>
@@ -1843,10 +1861,10 @@ class Pe extends S {
1843
1861
  `;
1844
1862
  }
1845
1863
  }
1846
- typeof customElements < "u" && !customElements.get("mp-query-subquery") && customElements.define("mp-query-subquery", Pe);
1864
+ typeof customElements < "u" && !customElements.get("mp-query-subquery") && customElements.define("mp-query-subquery", Te);
1847
1865
  d`<!-- Rendered dynamically by render(). Codegen-wc emits styles from the
1848
1866
  sibling .scss; the template export is intentionally unused. -->`;
1849
- const Te = D(`.btn {
1867
+ const Pe = S(`.btn {
1850
1868
  --bs-btn-padding-x: 0.75rem;
1851
1869
  --bs-btn-padding-y: 0.375rem;
1852
1870
  --bs-btn-font-family: ;
@@ -2309,14 +2327,20 @@ const Te = D(`.btn {
2309
2327
  font-style: italic;
2310
2328
  border: 2px dashed var(--bs-border-color, #dee2e6);
2311
2329
  background: var(--bs-tertiary-bg, #f8f9fa);
2330
+ }
2331
+
2332
+ @media (prefers-reduced-motion: reduce) {
2333
+ * {
2334
+ transition-duration: 0.01ms !important;
2335
+ }
2312
2336
  }`);
2313
- class Fe extends S {
2337
+ class Fe extends R {
2314
2338
  constructor() {
2315
2339
  super(...arguments), this.node = null, this.schema = [], this.currentEntity = "", this.depth = 0, this.isRoot = !1, this.qbRoot = "", this.isDragging = !1, this._messagesConsumer = new p(this, {
2316
2340
  context: q,
2317
2341
  subscribe: !0
2318
2342
  }), this._disabledConsumer = new p(this, {
2319
- context: E,
2343
+ context: C,
2320
2344
  subscribe: !0
2321
2345
  }), this._onLogicChange = (e) => {
2322
2346
  const t = this.node;
@@ -2332,7 +2356,7 @@ class Fe extends S {
2332
2356
  };
2333
2357
  }
2334
2358
  static {
2335
- this.styles = [Te];
2359
+ this.styles = [Pe];
2336
2360
  }
2337
2361
  static {
2338
2362
  this.properties = {
@@ -2429,11 +2453,14 @@ class Fe extends S {
2429
2453
  <div
2430
2454
  class="qb-group"
2431
2455
  role="group"
2432
- aria-label=${e.logic === "and" ? "AND group" : "OR group"}
2456
+ aria-label=${// Depth rides in the NAME: aria-level is not an allowed attribute
2457
+ // on role=group (axe aria-allowed-attr, serious) — it belongs to
2458
+ // treeitem/row/heading.
2459
+ `${e.logic === "and" ? "AND" : "OR"} group${this.depth > 0 ? `, level ${this.depth + 1}` : ""}`}
2433
2460
  part="group"
2434
2461
  >
2435
2462
  <div class="qb-group-header" part="group-header">
2436
- <span class="qb-logic-toggle btn-group btn-group-sm" role="group" aria-label="Group logic">
2463
+ <span class="qb-logic-toggle btn-group btn-group-sm" role="group" aria-label=${t.groupLogic}>
2437
2464
  <button
2438
2465
  type="button"
2439
2466
  class="btn ${e.logic === "and" ? "btn-primary" : "btn-outline-primary"} qb-logic-btn"
@@ -2477,13 +2504,13 @@ class Fe extends S {
2477
2504
  part="remove-group"
2478
2505
  ?disabled=${r}
2479
2506
  @click=${this._onRemove}
2480
- aria-label="Remove group"
2507
+ aria-label=${t.removeGroup}
2481
2508
  title=${t.removeGroup}
2482
2509
  >×</button>`}
2483
2510
  </span>
2484
2511
  </div>
2485
2512
  <div class="qb-children" part="children">
2486
- ${e.children.length === 0 ? d`<div class="qb-empty">${this.isDragging ? this._dropPlaceholder() : "(empty group)"}</div>` : this._renderChildrenWithSlots(e.children)}
2513
+ ${e.children.length === 0 ? d`<div class="qb-empty">${this.isDragging ? this._dropPlaceholder() : t.emptyGroup}</div>` : this._renderChildrenWithSlots(e.children)}
2487
2514
  </div>
2488
2515
  </div>
2489
2516
  `;
@@ -2492,7 +2519,7 @@ class Fe extends S {
2492
2519
  typeof customElements < "u" && !customElements.get("mp-query-group") && customElements.define("mp-query-group", Fe);
2493
2520
  d`<!-- Rendered dynamically by render(). Codegen-wc emits styles from the
2494
2521
  sibling .scss; the template export is intentionally unused. -->`;
2495
- const Ie = D(`.btn {
2522
+ const Ie = S(`.btn {
2496
2523
  --bs-btn-padding-x: 0.75rem;
2497
2524
  --bs-btn-padding-y: 0.375rem;
2498
2525
  --bs-btn-font-family: ;
@@ -3172,7 +3199,7 @@ textarea.form-control-lg {
3172
3199
  white-space: pre-wrap;
3173
3200
  word-break: break-word;
3174
3201
  }`), Le = 32;
3175
- class Ne extends S {
3202
+ class Ne extends R {
3176
3203
  constructor() {
3177
3204
  super(...arguments), this.query = null, this.schema = [], this.rootEntity = "", this.multiEntityPickerEnabled = !1, this.selectedFields = [], this.sortBy = [], this.disabled = !1, this.editorRegistry = void 0, this.messages = void 0, this.maxDepth = Le, this.showPreview = !1, this.showSavedQueries = !1, this.savedQueries = [], this._saveDraftName = "", this.depth = 0, this._qbRootId = `qb-${Math.random().toString(36).slice(2, 10)}`, this._isDragging = !1, this._drag = new $e(), this._pointerMoveHandler = null, this._pointerUpHandler = null, this._pointerCancelHandler = null, this._registryConsumer = new p(this, {
3178
3205
  context: F,
@@ -3181,10 +3208,10 @@ class Ne extends S {
3181
3208
  context: F,
3182
3209
  initialValue: void 0
3183
3210
  }), this._disabledConsumer = new p(this, {
3184
- context: E,
3211
+ context: C,
3185
3212
  subscribe: !0
3186
3213
  }), this._disabledProvider = new k(this, {
3187
- context: E,
3214
+ context: C,
3188
3215
  initialValue: void 0
3189
3216
  }), this._messagesConsumer = new p(this, {
3190
3217
  context: q,
@@ -3243,13 +3270,15 @@ class Ne extends S {
3243
3270
  if (!this._handlesEvents()) return;
3244
3271
  e.stopPropagation();
3245
3272
  const { id: t } = e.detail, r = this.query;
3246
- r && r.id !== t && this._mutate(X(r, t));
3273
+ if (!r || r.id === t) return;
3274
+ const n = E(r, t);
3275
+ this._pendingRefocusId = n?.parent.id ?? r.id, this._mutate(X(r, t));
3247
3276
  }, this._pendingRefocusId = null, this._onKeyboardMove = (e) => {
3248
3277
  if (!this._handlesEvents()) return;
3249
3278
  e.stopPropagation();
3250
3279
  const { id: t, direction: r } = e.detail, n = this.query;
3251
3280
  if (!n) return;
3252
- const s = P(n, t);
3281
+ const s = E(n, t);
3253
3282
  if (!s) return;
3254
3283
  const b = r === "up" ? s.index - 1 : s.index + 1;
3255
3284
  b < 0 || b >= s.parent.children.length || (this._pendingRefocusId = t, this._mutate(H(n, t, s.parent.id, b)));
@@ -3462,7 +3491,7 @@ class Ne extends S {
3462
3491
  placeholder=${e.saveCurrentAs}
3463
3492
  .value=${this._saveDraftName}
3464
3493
  @input=${this._onSaveDraftInput}
3465
- aria-label="Name for saved query"
3494
+ aria-label=${e.savedQueryName}
3466
3495
  />
3467
3496
  <button
3468
3497
  type="button"
@@ -3484,7 +3513,7 @@ class Ne extends S {
3484
3513
  if (this.depth !== 0) return u;
3485
3514
  if (!this.multiEntityPickerEnabled) return u;
3486
3515
  if (this.schema.length < 2) return u;
3487
- const t = this.schema.find((r) => r.name === this.rootEntity)?.fields.filter((r) => r.type !== "relation") ?? [];
3516
+ const t = this.schema.find((n) => n.name === this.rootEntity)?.fields.filter((n) => n.type !== "relation") ?? [], r = this._messages();
3488
3517
  return d`
3489
3518
  <div class="qb-toolbar" part="toolbar">
3490
3519
  <label class="qb-toolbar-label">
@@ -3496,23 +3525,23 @@ class Ne extends S {
3496
3525
  .value=${this.rootEntity}
3497
3526
  ?disabled=${this.disabled}
3498
3527
  @change=${this._onRootEntityChange}
3499
- aria-label="Entity"
3528
+ aria-label=${r.entity}
3500
3529
  >
3501
- ${this.schema.map((r) => d`<option value=${r.name}>${r.label}</option>`)}
3530
+ ${this.schema.map((n) => d`<option value=${n.name}>${n.label}</option>`)}
3502
3531
  </mp-select>
3503
3532
  </label>
3504
3533
  ${t.length > 0 ? d`
3505
- <span class="qb-toolbar-section qb-field-projection" part="field-projection" role="group" aria-label="Columns">
3506
- <span class="qb-toolbar-label">Columns:</span>
3507
- ${t.map((r) => d`
3534
+ <span class="qb-toolbar-section qb-field-projection" part="field-projection" role="group" aria-label=${r.columns}>
3535
+ <span class="qb-toolbar-label">${r.columns}:</span>
3536
+ ${t.map((n) => d`
3508
3537
  <mp-checkbox
3509
3538
  class="qb-field-checkbox"
3510
- value=${r.name}
3511
- ?checked=${this.selectedFields.includes(r.name)}
3539
+ value=${n.name}
3540
+ ?checked=${this.selectedFields.includes(n.name)}
3512
3541
  ?disabled=${this.disabled}
3513
- @change=${(n) => this._onFieldProjectionToggle(r.name, n)}
3514
- aria-label=${r.label}
3515
- >${r.label}</mp-checkbox>
3542
+ @change=${(s) => this._onFieldProjectionToggle(n.name, s)}
3543
+ aria-label=${n.label}
3544
+ >${n.label}</mp-checkbox>
3516
3545
  `)}
3517
3546
  </span>
3518
3547
  ` : u}
@@ -3521,31 +3550,32 @@ class Ne extends S {
3521
3550
  `;
3522
3551
  }
3523
3552
  _renderSortBy(e) {
3553
+ const t = this._messages();
3524
3554
  return d`
3525
- <span class="qb-toolbar-section qb-sort-by" part="sort-by" role="group" aria-label="Sort by">
3526
- <span class="qb-toolbar-label">Sort by:</span>
3527
- ${this.sortBy.map((t, r) => d`
3555
+ <span class="qb-toolbar-section qb-sort-by" part="sort-by" role="group" aria-label=${t.sortBy}>
3556
+ <span class="qb-toolbar-label">${t.sortBy}:</span>
3557
+ ${this.sortBy.map((r, n) => d`
3528
3558
  <span class="qb-sort-row" part="sort-row">
3529
3559
  <mp-select
3530
3560
  class="qb-sort-field"
3531
3561
  size="sm"
3532
- .value=${t.field}
3562
+ .value=${r.field}
3533
3563
  ?disabled=${this.disabled}
3534
- @change=${(n) => this._onSortFieldChange(r, n)}
3535
- aria-label=${`Sort ${r + 1} field`}
3564
+ @change=${(s) => this._onSortFieldChange(n, s)}
3565
+ aria-label=${`Sort ${n + 1} field`}
3536
3566
  >
3537
- ${e.map((n) => d`<option value=${n.name}>${n.label}</option>`)}
3538
- ${e.some((n) => n.name === t.field) ? u : d`
3539
- <option value=${t.field}>(${t.field})</option>
3567
+ ${e.map((s) => d`<option value=${s.name}>${s.label}</option>`)}
3568
+ ${e.some((s) => s.name === r.field) ? u : d`
3569
+ <option value=${r.field}>(${r.field})</option>
3540
3570
  `}
3541
3571
  </mp-select>
3542
3572
  <mp-select
3543
3573
  class="qb-sort-direction"
3544
3574
  size="sm"
3545
- .value=${t.direction}
3575
+ .value=${r.direction}
3546
3576
  ?disabled=${this.disabled}
3547
- @change=${(n) => this._onSortDirectionChange(r, n)}
3548
- aria-label=${`Sort ${r + 1} direction`}
3577
+ @change=${(s) => this._onSortDirectionChange(n, s)}
3578
+ aria-label=${`Sort ${n + 1} direction`}
3549
3579
  >
3550
3580
  <option value="asc">Asc</option>
3551
3581
  <option value="desc">Desc</option>
@@ -3554,8 +3584,8 @@ class Ne extends S {
3554
3584
  type="button"
3555
3585
  class="btn btn-sm btn-link qb-sort-remove"
3556
3586
  ?disabled=${this.disabled}
3557
- @click=${() => this._onSortRemove(r)}
3558
- aria-label=${`Remove sort ${r + 1}`}
3587
+ @click=${() => this._onSortRemove(n)}
3588
+ aria-label=${`Remove sort ${n + 1}`}
3559
3589
  title="Remove this sort"
3560
3590
  >×</button>
3561
3591
  </span>
@@ -3693,7 +3723,7 @@ export {
3693
3723
  Ne as MpQueryBuilderElement,
3694
3724
  ze as MpQueryConditionElement,
3695
3725
  Fe as MpQueryGroupElement,
3696
- Pe as MpQuerySubqueryElement,
3726
+ Te as MpQuerySubqueryElement,
3697
3727
  L as addChild,
3698
3728
  de as addEmptyConditionTo,
3699
3729
  le as addEmptyGroupTo,
@@ -3703,7 +3733,7 @@ export {
3703
3733
  Q as cloneTree,
3704
3734
  V as collectDescendantIds,
3705
3735
  x as defaultValueFor,
3706
- E as disabledContext,
3736
+ C as disabledContext,
3707
3737
  F as editorRegistryContext,
3708
3738
  ie as emptyCondition,
3709
3739
  I as emptyGroup,
@@ -12,6 +12,15 @@ export interface QueryBuilderMessages {
12
12
  deleteQuery: string;
13
13
  treeTooDeep: string;
14
14
  dropHerePlaceholder: string;
15
+ emptyGroup: string;
16
+ savedQueryName: string;
17
+ entity: string;
18
+ columns: string;
19
+ sortBy: string;
20
+ reorderHint: string;
21
+ field: string;
22
+ operator: string;
23
+ groupLogic: string;
15
24
  operators: Partial<Record<Operator, string>>;
16
25
  }
17
26
  export declare const DEFAULT_MESSAGES: QueryBuilderMessages;