@mintplayer/web-components 2.1.1 → 2.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/a11y/index.mjs +26 -2
- package/a11y/src/dismiss-stack.d.ts +25 -0
- package/a11y/src/error-text.d.ts +41 -0
- package/a11y/src/focus-restore.d.ts +116 -0
- package/a11y/src/focus-trap.d.ts +69 -0
- package/a11y/src/form-associated.d.ts +48 -0
- package/a11y/src/host-aria.d.ts +154 -0
- package/a11y/src/index.d.ts +16 -0
- package/a11y/src/inert-regions.d.ts +52 -0
- package/a11y/src/live-announcer.d.ts +8 -0
- package/a11y/src/roving-focus.d.ts +118 -0
- package/a11y/src/testing/expect-idref-resolves.d.ts +31 -0
- package/a11y/src/testing/index.d.ts +1 -0
- package/accordion/index.d.ts +1 -0
- package/accordion/index.mjs +549 -0
- package/accordion/src/components/index.d.ts +3 -0
- package/accordion/src/components/mp-accordion-tab.d.ts +30 -0
- package/accordion/src/components/mp-accordion.d.ts +66 -0
- package/accordion/src/index.d.ts +3 -0
- package/accordion/src/styles/index.d.ts +1 -0
- package/calendar/index.mjs +1 -1
- package/calendar/src/mp-calendar.element.d.ts +2 -0
- package/carousel/index.d.ts +1 -0
- package/carousel/index.mjs +994 -0
- package/carousel/src/components/index.d.ts +1 -0
- package/carousel/src/components/mp-carousel.d.ts +58 -0
- package/carousel/src/index.d.ts +3 -0
- package/carousel/src/styles/index.d.ts +1 -0
- package/carousel/src/types/carousel.d.ts +10 -0
- package/carousel/src/types/index.d.ts +1 -0
- package/checkbox/index.mjs +1 -1
- package/checkbox/src/components/mp-checkbox.d.ts +59 -1
- package/chunks/focus-restore-DxuP1Oe2.mjs +94 -0
- package/chunks/focus-trap-DTOLJ5bb.mjs +121 -0
- package/chunks/form-associated-axmc5sY0.mjs +58 -0
- package/chunks/host-aria-WSGs7SPQ.mjs +152 -0
- package/chunks/inert-regions-DXCnn1LN.mjs +48 -0
- package/chunks/invalid-feedback.styles-he0JYrJm.mjs +11 -0
- package/chunks/{live-announcer-CZDTKulf.mjs → live-announcer-Bi0orG4n.mjs} +9 -9
- package/chunks/{mp-calendar.element-UC68iDbi.mjs → mp-calendar.element-u6uS31_j.mjs} +136 -105
- package/chunks/mp-checkbox-Ph2mMRGz.mjs +312 -0
- package/chunks/{mp-datatable-Bfw0KGkV.mjs → mp-datatable-BwTlh9A_.mjs} +265 -103
- package/chunks/{mp-pagination-BGxsawFL.mjs → mp-pagination-Dea75mD4.mjs} +25 -22
- package/chunks/mp-radio-BjW1HNSc.mjs +300 -0
- package/chunks/{mp-select-BDS1-YGn.mjs → mp-select-Ctu-v1-p.mjs} +163 -40
- package/chunks/{mp-splitter-C8cGCmac.mjs → mp-splitter-LszuRDbR.mjs} +53 -46
- package/chunks/{mp-tab-page-D1b4x-y2.mjs → mp-tab-page-CaCzX1ym.mjs} +46 -45
- package/chunks/{mp-timepicker.element-BwEiwX92.mjs → mp-timepicker.element-Bz393NDQ.mjs} +93 -86
- package/chunks/{mp-toggle-button-dLZNDUVz.mjs → mp-toggle-button-Kz6sIgBJ.mjs} +131 -37
- package/chunks/{mp-treeview-C48F63xb.mjs → mp-treeview-tkWu28iF.mjs} +67 -43
- package/chunks/overlay-controller-DPt13i8p.mjs +314 -0
- package/chunks/roving-focus-CrL9982a.mjs +129 -0
- package/code-snippet/index.mjs +21 -13
- package/code-snippet/src/mp-code-snippet.element.d.ts +6 -0
- package/datatable/index.mjs +1 -1
- package/datatable/src/components/mp-datatable.d.ts +50 -0
- package/datatable/src/types/index.d.ts +2 -0
- package/datatable/src/types/labels.d.ts +30 -0
- package/datepicker/index.mjs +45 -22
- package/datepicker/src/mp-datepicker.element.d.ts +30 -0
- package/datetime-picker/index.mjs +15 -9
- package/dock/index.mjs +365 -209
- package/dock/src/components/mint-dock-manager.element.d.ts +63 -3
- package/dropdown-menu/index.mjs +135 -90
- package/dropdown-menu/src/components/mp-dropdown-menu.d.ts +12 -3
- package/file-manager/index.mjs +279 -214
- package/file-manager/src/components/mp-file-manager.d.ts +22 -0
- package/file-manager/src/types/messages.d.ts +9 -0
- package/multi-range/index.mjs +26 -10
- package/multi-range/src/mint-multi-range.element.d.ts +7 -0
- package/navbar/index.mjs +53 -39
- package/navbar/src/components/mp-navbar.d.ts +1 -0
- package/otp-input/index.mjs +82 -48
- package/otp-input/src/mint-otp-input.element.d.ts +31 -3
- package/overlay/index.mjs +2 -258
- package/overlay/src/overlay-controller.d.ts +64 -4
- package/package.json +21 -1
- package/pagination/index.mjs +1 -1
- package/query-builder/index.mjs +117 -87
- package/query-builder/src/model/messages.d.ts +9 -0
- package/radio/index.mjs +2 -160
- package/radio/src/components/mp-radio.d.ts +58 -3
- package/radio-group/index.d.ts +1 -0
- package/radio-group/index.mjs +145 -0
- package/radio-group/src/components/mp-radio-group.d.ts +52 -0
- package/radio-group/src/index.d.ts +1 -0
- package/radio-group/src/styles/radio-group.styles.d.ts +2 -0
- package/ribbon/index.mjs +316 -304
- package/ribbon/src/mp-ribbon.element.d.ts +16 -0
- package/scheduler/index.mjs +219 -132
- package/scheduler/src/components/mp-scheduler.d.ts +3 -0
- package/scheduler/src/views/base-view.d.ts +23 -0
- package/select/index.mjs +1 -1
- package/select/src/components/mp-select.d.ts +60 -3
- package/shell/index.mjs +142 -31
- package/shell/src/components/mp-shell.d.ts +1 -0
- package/signature-pad/index.d.ts +1 -0
- package/signature-pad/index.mjs +230 -0
- package/signature-pad/src/index.d.ts +2 -0
- package/signature-pad/src/mp-signature-pad.element.d.ts +143 -0
- package/signature-pad/src/mp-signature-pad.element.template.d.ts +2 -0
- package/signature-pad/src/types/signature.d.ts +12 -0
- package/splitter/index.mjs +1 -1
- package/splitter/src/components/mp-splitter.d.ts +7 -0
- package/splitter/src/index.d.ts +1 -1
- package/swiper-core/index.d.ts +1 -0
- package/swiper-core/index.mjs +184 -0
- package/swiper-core/src/index-machine.d.ts +59 -0
- package/swiper-core/src/index.d.ts +4 -0
- package/swiper-core/src/keymap.d.ts +2 -0
- package/swiper-core/src/models/index.d.ts +1 -0
- package/swiper-core/src/models/types.d.ts +99 -0
- package/swiper-core/src/pointer-arbiter.d.ts +45 -0
- package/tab-control/index.mjs +1 -1
- package/tile-manager/index.mjs +110 -93
- package/timeline/index.mjs +138 -54
- package/timeline/src/components/mp-timeline.d.ts +15 -0
- package/timepicker/index.mjs +1 -1
- package/timepicker/src/mp-time-list.element.d.ts +13 -4
- package/timepicker/src/mp-timepicker.element.d.ts +29 -0
- package/toggle-button/index.mjs +1 -1
- package/toggle-button/src/components/mp-toggle-button.d.ts +32 -1
- package/tree-select/index.mjs +233 -121
- package/tree-select/src/components/mp-tree-select.d.ts +37 -0
- package/treeview/index.mjs +1 -1
- package/treeview/src/components/mp-treeview.d.ts +10 -1
- package/chunks/mp-checkbox-BokLL7BS.mjs +0 -211
- package/dropdown/src/styles/dropdown.styles.d.ts +0 -2
package/query-builder/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { html as d, unsafeCSS as
|
|
2
|
-
import { createContext as
|
|
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-
|
|
5
|
-
import "../chunks/mp-checkbox-
|
|
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:
|
|
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
|
|
238
|
+
function T(o) {
|
|
239
239
|
if (o == null) return o;
|
|
240
|
-
if (Array.isArray(o)) return o.map(
|
|
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] =
|
|
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
|
|
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 =
|
|
278
|
+
const n = E(r, e);
|
|
279
279
|
if (n) return n;
|
|
280
280
|
}
|
|
281
281
|
} else if (o.kind === "subquery")
|
|
282
|
-
return
|
|
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
|
|
448
|
+
return P(o, e, s, n);
|
|
440
449
|
}
|
|
441
|
-
function
|
|
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) =>
|
|
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 = () =>
|
|
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(
|
|
519
|
+
return `[${e.map(M).join(", ")}]`;
|
|
511
520
|
if (t === "array" && Array.isArray(e))
|
|
512
|
-
return `[${e.map(
|
|
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
|
|
526
|
+
return M(e);
|
|
518
527
|
}
|
|
519
|
-
function
|
|
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 =
|
|
616
|
+
const F = A(
|
|
608
617
|
Symbol("mp-query-builder.editorRegistry")
|
|
609
|
-
),
|
|
618
|
+
), C = A(
|
|
610
619
|
Symbol("mp-query-builder.disabled")
|
|
611
|
-
), q =
|
|
620
|
+
), q = A(
|
|
612
621
|
Symbol("mp-query-builder.messages")
|
|
613
|
-
), B =
|
|
622
|
+
), B = A(
|
|
614
623
|
Symbol("mp-query-builder.maxDepth")
|
|
615
624
|
);
|
|
616
|
-
function
|
|
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 =
|
|
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,
|
|
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(
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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
|
|
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:
|
|
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
|
-
|
|
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: (
|
|
1674
|
+
onChange: (z) => {
|
|
1666
1675
|
this.dispatchEvent(new CustomEvent("condition-value-change", {
|
|
1667
|
-
detail: { id: t.id, value:
|
|
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
|
|
1699
|
-
title
|
|
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
|
|
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
|
|
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
|
|
1736
|
-
title
|
|
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 =
|
|
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
|
|
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",
|
|
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
|
|
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
|
|
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:
|
|
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 = [
|
|
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=${
|
|
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
|
|
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
|
|
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() :
|
|
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 =
|
|
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
|
|
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:
|
|
3211
|
+
context: C,
|
|
3185
3212
|
subscribe: !0
|
|
3186
3213
|
}), this._disabledProvider = new k(this, {
|
|
3187
|
-
context:
|
|
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
|
|
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 =
|
|
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
|
|
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((
|
|
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
|
|
3528
|
+
aria-label=${r.entity}
|
|
3500
3529
|
>
|
|
3501
|
-
${this.schema.map((
|
|
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
|
|
3506
|
-
<span class="qb-toolbar-label"
|
|
3507
|
-
${t.map((
|
|
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=${
|
|
3511
|
-
?checked=${this.selectedFields.includes(
|
|
3539
|
+
value=${n.name}
|
|
3540
|
+
?checked=${this.selectedFields.includes(n.name)}
|
|
3512
3541
|
?disabled=${this.disabled}
|
|
3513
|
-
@change=${(
|
|
3514
|
-
aria-label=${
|
|
3515
|
-
>${
|
|
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
|
|
3526
|
-
<span class="qb-toolbar-label"
|
|
3527
|
-
${this.sortBy.map((
|
|
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=${
|
|
3562
|
+
.value=${r.field}
|
|
3533
3563
|
?disabled=${this.disabled}
|
|
3534
|
-
@change=${(
|
|
3535
|
-
aria-label=${`Sort ${
|
|
3564
|
+
@change=${(s) => this._onSortFieldChange(n, s)}
|
|
3565
|
+
aria-label=${`Sort ${n + 1} field`}
|
|
3536
3566
|
>
|
|
3537
|
-
${e.map((
|
|
3538
|
-
${e.some((
|
|
3539
|
-
<option value=${
|
|
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=${
|
|
3575
|
+
.value=${r.direction}
|
|
3546
3576
|
?disabled=${this.disabled}
|
|
3547
|
-
@change=${(
|
|
3548
|
-
aria-label=${`Sort ${
|
|
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(
|
|
3558
|
-
aria-label=${`Remove sort ${
|
|
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
|
-
|
|
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
|
-
|
|
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;
|