@mintplayer/web-components 1.0.0 → 1.1.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 +2 -56
- package/calendar/index.mjs +2 -363
- package/checkbox/index.mjs +4 -0
- package/checkbox/src/components/index.d.ts +2 -0
- package/checkbox/src/components/mp-checkbox.d.ts +69 -0
- package/checkbox/src/index.d.ts +2 -0
- package/chunks/color-C4VT0EL7.mjs +847 -0
- package/chunks/form-check.styles-jBlHetYX.mjs +151 -0
- package/chunks/live-announcer-CZDTKulf.mjs +58 -0
- package/chunks/mp-calendar.element-UC68iDbi.mjs +365 -0
- package/chunks/mp-checkbox-BokLL7BS.mjs +211 -0
- package/chunks/mp-datatable-CpAu8JJD.mjs +750 -0
- package/chunks/mp-pagination-BGxsawFL.mjs +326 -0
- package/chunks/mp-select-BDS1-YGn.mjs +254 -0
- package/chunks/mp-splitter-C8cGCmac.mjs +633 -0
- package/chunks/mp-tab-page-D1b4x-y2.mjs +414 -0
- package/chunks/mp-timepicker.element-BwEiwX92.mjs +428 -0
- package/chunks/mp-toggle-button-dLZNDUVz.mjs +534 -0
- package/chunks/mp-treeview-Bfq4_IVW.mjs +474 -0
- package/code-snippet/index.mjs +16 -13
- package/datatable/index.mjs +7 -0
- package/datatable/src/components/index.d.ts +2 -0
- package/datatable/src/components/mp-datatable.d.ts +156 -0
- package/datatable/src/index.d.ts +6 -0
- package/datatable/src/sort/compute-next-sort.d.ts +18 -0
- package/datatable/src/sort/index.d.ts +3 -0
- package/datatable/src/sort/sort-rows.d.ts +6 -0
- package/datatable/src/styles/datatable.styles.d.ts +2 -0
- package/datatable/src/styles/index.d.ts +1 -0
- package/datatable/src/types/column-def.d.ts +30 -0
- package/datatable/src/types/index.d.ts +1 -0
- package/datepicker/index.mjs +240 -0
- package/datepicker/src/index.d.ts +1 -0
- package/datepicker/src/mp-datepicker.element.d.ts +94 -0
- package/datepicker/src/mp-datepicker.element.template.d.ts +2 -0
- package/datetime-picker/index.mjs +427 -0
- package/datetime-picker/src/index.d.ts +1 -0
- package/datetime-picker/src/mp-datetime-picker.element.d.ts +174 -0
- package/datetime-picker/src/mp-datetime-picker.element.template.d.ts +2 -0
- package/dock/index.mjs +2402 -0
- package/dock/src/components/index.d.ts +1 -0
- package/dock/src/components/mint-dock-manager.element.d.ts +313 -0
- package/dock/src/components/mint-dock-manager.element.template.d.ts +2 -0
- package/dock/src/index.d.ts +2 -0
- package/dock/src/types/dock-layout.d.ts +65 -0
- package/dock/src/types/index.d.ts +1 -0
- package/file-manager/index.mjs +1263 -0
- package/file-manager/src/components/index.d.ts +2 -0
- package/file-manager/src/components/mp-file-manager.d.ts +320 -0
- package/file-manager/src/index.d.ts +5 -0
- package/file-manager/src/styles/file-manager.styles.d.ts +2 -0
- package/file-manager/src/styles/index.d.ts +1 -0
- package/file-manager/src/types/file-system-node.d.ts +24 -0
- package/file-manager/src/types/index.d.ts +3 -0
- package/file-manager/src/types/messages.d.ts +43 -0
- package/multi-range/index.mjs +407 -0
- package/multi-range/src/index.d.ts +2 -0
- package/multi-range/src/mint-multi-range.element.d.ts +124 -0
- package/multi-range/src/mint-multi-range.element.template.d.ts +2 -0
- package/multi-range/src/types/multi-range-orientation.d.ts +1 -0
- package/otp-input/index.mjs +362 -0
- package/otp-input/src/index.d.ts +4 -0
- package/otp-input/src/mint-otp-input.element.d.ts +134 -0
- package/otp-input/src/mint-otp-input.element.template.d.ts +2 -0
- package/otp-input/src/types/otp-input-case.d.ts +1 -0
- package/otp-input/src/types/otp-input-size.d.ts +1 -0
- package/otp-input/src/types/otp-input-type.d.ts +1 -0
- package/overlay/index.mjs +260 -0
- package/overlay/src/index.d.ts +2 -0
- package/overlay/src/overlay-controller.d.ts +205 -0
- package/package.json +1 -1
- package/pagination/index.mjs +5 -0
- package/pagination/src/components/index.d.ts +2 -0
- package/pagination/src/components/mp-pagination.d.ts +95 -0
- package/pagination/src/index.d.ts +2 -0
- package/pagination/src/styles/index.d.ts +1 -0
- package/pagination/src/styles/pagination.styles.d.ts +2 -0
- package/query-builder/index.mjs +3720 -0
- package/query-builder/src/context.d.ts +14 -0
- package/query-builder/src/dnd/drag-controller.d.ts +69 -0
- package/query-builder/src/index.d.ts +23 -0
- package/query-builder/src/model/default-tree.d.ts +7 -0
- package/query-builder/src/model/editor.d.ts +15 -0
- package/query-builder/src/model/errors.d.ts +6 -0
- package/query-builder/src/model/expression.d.ts +22 -0
- package/query-builder/src/model/field-def.d.ts +17 -0
- package/query-builder/src/model/messages.d.ts +17 -0
- package/query-builder/src/model/operator-overrides.d.ts +21 -0
- package/query-builder/src/model/operators.d.ts +8 -0
- package/query-builder/src/model/saved-query.d.ts +6 -0
- package/query-builder/src/model/sort.d.ts +9 -0
- package/query-builder/src/model/tree-ops.d.ts +56 -0
- package/query-builder/src/mp-query-builder.element.d.ts +158 -0
- package/query-builder/src/mp-query-builder.element.template.d.ts +2 -0
- package/query-builder/src/mp-query-condition.element.d.ts +44 -0
- package/query-builder/src/mp-query-condition.element.template.d.ts +2 -0
- package/query-builder/src/mp-query-group.element.d.ts +52 -0
- package/query-builder/src/mp-query-group.element.template.d.ts +2 -0
- package/query-builder/src/mp-query-subquery.element.d.ts +37 -0
- package/query-builder/src/mp-query-subquery.element.template.d.ts +2 -0
- package/query-builder/src/preview/render-expression.d.ts +23 -0
- package/query-builder/src/value-editors/builtin-editors.d.ts +6 -0
- package/query-builder/src/visitor/visit-tree.d.ts +29 -0
- package/query-builder/src/visitor/visitor-types.d.ts +15 -0
- package/radio/index.mjs +162 -0
- package/radio/src/components/index.d.ts +2 -0
- package/radio/src/components/mp-radio.d.ts +63 -0
- package/radio/src/index.d.ts +2 -0
- package/ribbon/index.mjs +3151 -0
- package/ribbon/src/index.d.ts +10 -0
- package/ribbon/src/items/index.d.ts +15 -0
- package/ribbon/src/items/mp-ribbon-button.element.d.ts +10 -0
- package/ribbon/src/items/mp-ribbon-checkbox.element.d.ts +11 -0
- package/ribbon/src/items/mp-ribbon-color-picker.element.d.ts +12 -0
- package/ribbon/src/items/mp-ribbon-combobox.element.d.ts +19 -0
- package/ribbon/src/items/mp-ribbon-dropdown-button.element.d.ts +16 -0
- package/ribbon/src/items/mp-ribbon-gallery-item.element.d.ts +15 -0
- package/ribbon/src/items/mp-ribbon-gallery.element.d.ts +11 -0
- package/ribbon/src/items/mp-ribbon-group-button.element.d.ts +18 -0
- package/ribbon/src/items/mp-ribbon-item-base.d.ts +68 -0
- package/ribbon/src/items/mp-ribbon-menu-item.element.d.ts +13 -0
- package/ribbon/src/items/mp-ribbon-menu-separator.element.d.ts +6 -0
- package/ribbon/src/items/mp-ribbon-split-button.element.d.ts +23 -0
- package/ribbon/src/items/mp-ribbon-template-item.element.d.ts +12 -0
- package/ribbon/src/items/mp-ribbon-toggle-button.element.d.ts +12 -0
- package/ribbon/src/mp-quick-access-toolbar.element.d.ts +35 -0
- package/ribbon/src/mp-ribbon-contextual-tab-set.element.d.ts +18 -0
- package/ribbon/src/mp-ribbon-group.element.d.ts +59 -0
- package/ribbon/src/mp-ribbon-tab.element.d.ts +72 -0
- package/ribbon/src/mp-ribbon.element.d.ts +211 -0
- package/ribbon/src/types/ribbon.types.d.ts +4 -0
- package/scheduler/index.mjs +3567 -0
- package/scheduler/src/components/mp-scheduler.d.ts +238 -0
- package/scheduler/src/drag/drag-manager.d.ts +90 -0
- package/scheduler/src/drag/drag-preview.d.ts +42 -0
- package/scheduler/src/drag/drag-state-machine.d.ts +102 -0
- package/scheduler/src/drag/drag-types.d.ts +104 -0
- package/scheduler/src/drag/index.d.ts +4 -0
- package/scheduler/src/events/event-types.d.ts +58 -0
- package/scheduler/src/events/index.d.ts +2 -0
- package/scheduler/src/events/scheduler-event-emitter.d.ts +52 -0
- package/scheduler/src/index.d.ts +6 -0
- package/scheduler/src/input/index.d.ts +2 -0
- package/scheduler/src/input/input-handler.d.ts +105 -0
- package/scheduler/src/input/pointer-event.d.ts +39 -0
- package/scheduler/src/state/scheduler-state.d.ts +189 -0
- package/scheduler/src/styles/scheduler.styles.d.ts +2 -0
- package/scheduler/src/views/base-view.d.ts +87 -0
- package/scheduler/src/views/day-view.d.ts +25 -0
- package/scheduler/src/views/index.d.ts +6 -0
- package/scheduler/src/views/month-view.d.ts +27 -0
- package/scheduler/src/views/timeline-view.d.ts +23 -0
- package/scheduler/src/views/week-view.d.ts +28 -0
- package/scheduler/src/views/year-view.d.ts +25 -0
- package/scheduler-core/index.mjs +174 -0
- package/scheduler-core/src/index.d.ts +3 -0
- package/scheduler-core/src/models/drag-state.d.ts +43 -0
- package/scheduler-core/src/models/event.d.ts +111 -0
- package/scheduler-core/src/models/events.d.ts +108 -0
- package/scheduler-core/src/models/index.d.ts +7 -0
- package/scheduler-core/src/models/options.d.ts +88 -0
- package/scheduler-core/src/models/resource.d.ts +58 -0
- package/scheduler-core/src/models/time-slot.d.ts +31 -0
- package/scheduler-core/src/models/types.d.ts +20 -0
- package/scheduler-core/src/services/date.service.d.ts +140 -0
- package/scheduler-core/src/services/index.d.ts +4 -0
- package/scheduler-core/src/services/position.service.d.ts +35 -0
- package/scheduler-core/src/services/resource.service.d.ts +83 -0
- package/scheduler-core/src/services/timeline.service.d.ts +103 -0
- package/scheduler-core/src/utils/color.d.ts +24 -0
- package/scheduler-core/src/utils/dom.d.ts +54 -0
- package/scheduler-core/src/utils/id.d.ts +16 -0
- package/scheduler-core/src/utils/index.d.ts +3 -0
- package/select/index.mjs +4 -0
- package/select/src/components/index.d.ts +2 -0
- package/select/src/components/mp-select.d.ts +82 -0
- package/select/src/index.d.ts +2 -0
- package/splitter/index.mjs +10 -0
- package/splitter/src/components/index.d.ts +2 -0
- package/splitter/src/components/mp-splitter.d.ts +109 -0
- package/splitter/src/index.d.ts +11 -0
- package/splitter/src/input/index.d.ts +4 -0
- package/splitter/src/input/input-handler.d.ts +36 -0
- package/splitter/src/input/pointer-event.d.ts +9 -0
- package/splitter/src/managers/index.d.ts +2 -0
- package/splitter/src/managers/resize-manager.d.ts +13 -0
- package/splitter/src/state/index.d.ts +2 -0
- package/splitter/src/state/splitter-state.d.ts +24 -0
- package/splitter/src/styles/index.d.ts +1 -0
- package/splitter/src/styles/splitter.styles.d.ts +2 -0
- package/splitter/src/types/direction.d.ts +1 -0
- package/splitter/src/types/index.d.ts +5 -0
- package/splitter/src/types/panel-info.d.ts +6 -0
- package/splitter/src/types/point.d.ts +4 -0
- package/splitter/src/types/resize-operation.d.ts +13 -0
- package/tab-control/index.mjs +6 -0
- package/tab-control/src/components/index.d.ts +3 -0
- package/tab-control/src/components/mp-tab-control.d.ts +50 -0
- package/tab-control/src/components/mp-tab-page.d.ts +35 -0
- package/tab-control/src/index.d.ts +4 -0
- package/tab-control/src/styles/index.d.ts +1 -0
- package/tab-control/src/styles/tab-control.styles.d.ts +2 -0
- package/tab-control/src/types/index.d.ts +1 -0
- package/tab-control/src/types/tabs-position.d.ts +1 -0
- package/tile-manager/index.mjs +867 -0
- package/tile-manager/src/components/index.d.ts +2 -0
- package/tile-manager/src/components/mint-tile-manager.element.d.ts +204 -0
- package/tile-manager/src/components/mint-tile-manager.element.template.d.ts +2 -0
- package/tile-manager/src/index.d.ts +4 -0
- package/tile-manager/src/types/grid-rect.d.ts +12 -0
- package/tile-manager/src/types/index.d.ts +3 -0
- package/tile-manager/src/types/tile-layout-snapshot.d.ts +15 -0
- package/tile-manager/src/types/tile-position.d.ts +10 -0
- package/tile-manager/src/utils/index.d.ts +1 -0
- package/tile-manager/src/utils/pack.d.ts +24 -0
- package/timepicker/index.mjs +5 -0
- package/timepicker/src/index.d.ts +2 -0
- package/timepicker/src/mp-time-list.element.d.ts +76 -0
- package/timepicker/src/mp-time-list.element.template.d.ts +2 -0
- package/timepicker/src/mp-timepicker.element.d.ts +87 -0
- package/timepicker/src/mp-timepicker.element.template.d.ts +2 -0
- package/toggle-button/index.mjs +5 -0
- package/toggle-button/src/components/index.d.ts +2 -0
- package/toggle-button/src/components/mp-toggle-button.d.ts +50 -0
- package/toggle-button/src/index.d.ts +3 -0
- package/toggle-button/src/styles/index.d.ts +1 -0
- package/toggle-button/src/styles/toggle-button.styles.d.ts +2 -0
- package/treeview/index.mjs +5 -0
- package/treeview/src/components/index.d.ts +2 -0
- package/treeview/src/components/mp-treeview.d.ts +113 -0
- package/treeview/src/index.d.ts +4 -0
- package/treeview/src/styles/index.d.ts +1 -0
- package/treeview/src/styles/treeview.styles.d.ts +2 -0
- package/treeview/src/types/index.d.ts +1 -0
- package/treeview/src/types/tree-node.d.ts +14 -0
- package/custom-elements.json +0 -1774
|
@@ -0,0 +1,3720 @@
|
|
|
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";
|
|
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";
|
|
6
|
+
const j = {
|
|
7
|
+
string: [
|
|
8
|
+
"equals",
|
|
9
|
+
"not-equals",
|
|
10
|
+
"contains",
|
|
11
|
+
"does-not-contain",
|
|
12
|
+
"starts-with",
|
|
13
|
+
"ends-with",
|
|
14
|
+
"is-null",
|
|
15
|
+
"is-not-null",
|
|
16
|
+
"in",
|
|
17
|
+
"not-in"
|
|
18
|
+
],
|
|
19
|
+
number: [
|
|
20
|
+
"equals",
|
|
21
|
+
"not-equals",
|
|
22
|
+
"lt",
|
|
23
|
+
"lte",
|
|
24
|
+
"gt",
|
|
25
|
+
"gte",
|
|
26
|
+
"between",
|
|
27
|
+
"not-between",
|
|
28
|
+
"is-null",
|
|
29
|
+
"is-not-null",
|
|
30
|
+
"in",
|
|
31
|
+
"not-in"
|
|
32
|
+
],
|
|
33
|
+
integer: [
|
|
34
|
+
"equals",
|
|
35
|
+
"not-equals",
|
|
36
|
+
"lt",
|
|
37
|
+
"lte",
|
|
38
|
+
"gt",
|
|
39
|
+
"gte",
|
|
40
|
+
"between",
|
|
41
|
+
"not-between",
|
|
42
|
+
"is-null",
|
|
43
|
+
"is-not-null",
|
|
44
|
+
"in",
|
|
45
|
+
"not-in"
|
|
46
|
+
],
|
|
47
|
+
date: [
|
|
48
|
+
"equals",
|
|
49
|
+
"not-equals",
|
|
50
|
+
"lt",
|
|
51
|
+
"lte",
|
|
52
|
+
"gt",
|
|
53
|
+
"gte",
|
|
54
|
+
"between",
|
|
55
|
+
"not-between",
|
|
56
|
+
"is-null",
|
|
57
|
+
"is-not-null",
|
|
58
|
+
"today",
|
|
59
|
+
"yesterday",
|
|
60
|
+
"this-week",
|
|
61
|
+
"last-week",
|
|
62
|
+
"next-week",
|
|
63
|
+
"this-month",
|
|
64
|
+
"last-month",
|
|
65
|
+
"next-month",
|
|
66
|
+
"this-year",
|
|
67
|
+
"last-year",
|
|
68
|
+
"next-year",
|
|
69
|
+
"last-n-days",
|
|
70
|
+
"next-n-days",
|
|
71
|
+
"year-to-date"
|
|
72
|
+
],
|
|
73
|
+
datetime: [
|
|
74
|
+
"equals",
|
|
75
|
+
"not-equals",
|
|
76
|
+
"lt",
|
|
77
|
+
"lte",
|
|
78
|
+
"gt",
|
|
79
|
+
"gte",
|
|
80
|
+
"between",
|
|
81
|
+
"not-between",
|
|
82
|
+
"is-null",
|
|
83
|
+
"is-not-null",
|
|
84
|
+
"today",
|
|
85
|
+
"yesterday",
|
|
86
|
+
"this-week",
|
|
87
|
+
"last-week",
|
|
88
|
+
"next-week",
|
|
89
|
+
"this-month",
|
|
90
|
+
"last-month",
|
|
91
|
+
"next-month",
|
|
92
|
+
"this-year",
|
|
93
|
+
"last-year",
|
|
94
|
+
"next-year",
|
|
95
|
+
"last-n-days",
|
|
96
|
+
"next-n-days",
|
|
97
|
+
"year-to-date"
|
|
98
|
+
],
|
|
99
|
+
boolean: ["is-true", "is-false", "is-null", "is-not-null"],
|
|
100
|
+
enum: ["equals", "not-equals", "in", "not-in", "is-null", "is-not-null"],
|
|
101
|
+
relation: ["in", "not-in"],
|
|
102
|
+
array: ["any-of", "all-of", "none-of", "is-empty", "is-not-empty"]
|
|
103
|
+
}, re = /* @__PURE__ */ new Set([
|
|
104
|
+
"is-null",
|
|
105
|
+
"is-not-null",
|
|
106
|
+
"is-true",
|
|
107
|
+
"is-false",
|
|
108
|
+
"is-empty",
|
|
109
|
+
"is-not-empty",
|
|
110
|
+
"today",
|
|
111
|
+
"yesterday",
|
|
112
|
+
"this-week",
|
|
113
|
+
"last-week",
|
|
114
|
+
"next-week",
|
|
115
|
+
"this-month",
|
|
116
|
+
"last-month",
|
|
117
|
+
"next-month",
|
|
118
|
+
"this-year",
|
|
119
|
+
"last-year",
|
|
120
|
+
"next-year",
|
|
121
|
+
"year-to-date"
|
|
122
|
+
]), oe = /* @__PURE__ */ new Set(["between", "not-between"]), ne = /* @__PURE__ */ new Set([
|
|
123
|
+
"in",
|
|
124
|
+
"not-in",
|
|
125
|
+
"any-of",
|
|
126
|
+
"all-of",
|
|
127
|
+
"none-of"
|
|
128
|
+
]), se = /* @__PURE__ */ new Set(["last-n-days", "next-n-days"]);
|
|
129
|
+
function g(o) {
|
|
130
|
+
return re.has(o) ? "null" : oe.has(o) ? "tuple" : ne.has(o) ? "array" : se.has(o) ? "n-input" : "scalar";
|
|
131
|
+
}
|
|
132
|
+
function x(o) {
|
|
133
|
+
switch (g(o)) {
|
|
134
|
+
case "null":
|
|
135
|
+
return null;
|
|
136
|
+
case "tuple":
|
|
137
|
+
return [null, null];
|
|
138
|
+
case "array":
|
|
139
|
+
return [];
|
|
140
|
+
case "n-input":
|
|
141
|
+
return { n: 1 };
|
|
142
|
+
case "scalar":
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function y(o, e = j) {
|
|
147
|
+
return e[o] ?? [];
|
|
148
|
+
}
|
|
149
|
+
function Ge(o, e, t = j) {
|
|
150
|
+
const r = {
|
|
151
|
+
sanitized: {},
|
|
152
|
+
warnings: []
|
|
153
|
+
};
|
|
154
|
+
if (!e) return r;
|
|
155
|
+
const n = /* @__PURE__ */ new Map();
|
|
156
|
+
for (const s of o)
|
|
157
|
+
for (const b of s.fields)
|
|
158
|
+
n.has(b.name) || n.set(b.name, { entity: s.name, type: b.type });
|
|
159
|
+
for (const [s, b] of Object.entries(e)) {
|
|
160
|
+
const i = b ?? [], a = n.get(s);
|
|
161
|
+
if (!a) {
|
|
162
|
+
r.warnings.push(
|
|
163
|
+
`[operatorOverrides] Unknown field "${s}" — no entity in schema declares it. Override ignored.`
|
|
164
|
+
);
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
const l = new Set(y(a.type, t)), c = [], h = [];
|
|
168
|
+
for (const f of i)
|
|
169
|
+
l.has(f) ? c.push(f) : h.push(f);
|
|
170
|
+
h.length > 0 && r.warnings.push(
|
|
171
|
+
`[operatorOverrides] Field "${s}" (${a.entity}.${s}, type=${a.type}) has operator(s) [${h.join(", ")}] not in the catalog for that type. Stripping.`
|
|
172
|
+
), c.length === 0 && i.length > 0 && r.warnings.push(
|
|
173
|
+
`[operatorOverrides] Field "${s}" has no valid operators after intersection — empty operator dropdown.`
|
|
174
|
+
), r.sanitized[s] = c;
|
|
175
|
+
}
|
|
176
|
+
return r;
|
|
177
|
+
}
|
|
178
|
+
function be() {
|
|
179
|
+
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
180
|
+
return crypto.randomUUID();
|
|
181
|
+
const o = new Uint8Array(16);
|
|
182
|
+
if (typeof crypto < "u" && typeof crypto.getRandomValues == "function")
|
|
183
|
+
crypto.getRandomValues(o);
|
|
184
|
+
else
|
|
185
|
+
for (let t = 0; t < 16; t++) o[t] = Math.floor(Math.random() * 256);
|
|
186
|
+
o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128;
|
|
187
|
+
const e = Array.from(o, (t) => t.toString(16).padStart(2, "0"));
|
|
188
|
+
return `${e.slice(0, 4).join("")}-${e.slice(4, 6).join("")}-${e.slice(6, 8).join("")}-${e.slice(8, 10).join("")}-${e.slice(10, 16).join("")}`;
|
|
189
|
+
}
|
|
190
|
+
function $() {
|
|
191
|
+
return be();
|
|
192
|
+
}
|
|
193
|
+
function I(o = "and") {
|
|
194
|
+
return { kind: "group", id: $(), logic: o, children: [] };
|
|
195
|
+
}
|
|
196
|
+
function ie(o) {
|
|
197
|
+
const e = o.fields.find((r) => r.type !== "relation") ?? o.fields[0];
|
|
198
|
+
if (!e)
|
|
199
|
+
return { kind: "condition", id: $(), field: "", operator: "equals", value: null };
|
|
200
|
+
const t = y(e.type)[0] ?? "equals";
|
|
201
|
+
return {
|
|
202
|
+
kind: "condition",
|
|
203
|
+
id: $(),
|
|
204
|
+
field: e.name,
|
|
205
|
+
operator: t,
|
|
206
|
+
value: x(t)
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
function ae(o) {
|
|
210
|
+
const e = o.fields.find((t) => t.type === "relation" && t.targetEntity);
|
|
211
|
+
return e ? {
|
|
212
|
+
kind: "subquery",
|
|
213
|
+
id: $(),
|
|
214
|
+
field: e.name,
|
|
215
|
+
operator: "in",
|
|
216
|
+
subQuery: I("and")
|
|
217
|
+
} : null;
|
|
218
|
+
}
|
|
219
|
+
function Q(o) {
|
|
220
|
+
switch (o.kind) {
|
|
221
|
+
case "group":
|
|
222
|
+
return {
|
|
223
|
+
...o,
|
|
224
|
+
children: o.children.map((e) => Q(e))
|
|
225
|
+
};
|
|
226
|
+
case "condition":
|
|
227
|
+
return {
|
|
228
|
+
...o,
|
|
229
|
+
value: M(o.value)
|
|
230
|
+
};
|
|
231
|
+
case "subquery":
|
|
232
|
+
return {
|
|
233
|
+
...o,
|
|
234
|
+
subQuery: Q(o.subQuery)
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
function M(o) {
|
|
239
|
+
if (o == null) return o;
|
|
240
|
+
if (Array.isArray(o)) return o.map(M);
|
|
241
|
+
if (typeof o == "object") {
|
|
242
|
+
const e = {};
|
|
243
|
+
for (const [t, r] of Object.entries(o))
|
|
244
|
+
e[t] = M(r);
|
|
245
|
+
return e;
|
|
246
|
+
}
|
|
247
|
+
return o;
|
|
248
|
+
}
|
|
249
|
+
function v(o, e) {
|
|
250
|
+
const t = e(o);
|
|
251
|
+
if (t === null) return null;
|
|
252
|
+
if (t.kind === "group") {
|
|
253
|
+
const r = t.children.map((n) => v(n, e)).filter((n) => n !== null);
|
|
254
|
+
return { ...t, children: r };
|
|
255
|
+
}
|
|
256
|
+
if (t.kind === "subquery") {
|
|
257
|
+
const r = v(t.subQuery, e);
|
|
258
|
+
return r !== null && r.kind === "group" ? { ...t, subQuery: r } : { ...t, subQuery: I("and") };
|
|
259
|
+
}
|
|
260
|
+
return t;
|
|
261
|
+
}
|
|
262
|
+
function _(o, e) {
|
|
263
|
+
if (o.id === e) return o;
|
|
264
|
+
if (o.kind === "group")
|
|
265
|
+
for (const t of o.children) {
|
|
266
|
+
const r = _(t, e);
|
|
267
|
+
if (r) return r;
|
|
268
|
+
}
|
|
269
|
+
else if (o.kind === "subquery")
|
|
270
|
+
return _(o.subQuery, e);
|
|
271
|
+
return null;
|
|
272
|
+
}
|
|
273
|
+
function P(o, e) {
|
|
274
|
+
if (o.kind === "group") {
|
|
275
|
+
const t = o.children.findIndex((r) => r.id === e);
|
|
276
|
+
if (t >= 0) return { parent: o, index: t };
|
|
277
|
+
for (const r of o.children) {
|
|
278
|
+
const n = P(r, e);
|
|
279
|
+
if (n) return n;
|
|
280
|
+
}
|
|
281
|
+
} else if (o.kind === "subquery")
|
|
282
|
+
return P(o.subQuery, e);
|
|
283
|
+
return null;
|
|
284
|
+
}
|
|
285
|
+
function V(o) {
|
|
286
|
+
const e = /* @__PURE__ */ new Set(), t = (r) => {
|
|
287
|
+
e.add(r.id), r.kind === "group" ? r.children.forEach(t) : r.kind === "subquery" && t(r.subQuery);
|
|
288
|
+
};
|
|
289
|
+
return t(o), e;
|
|
290
|
+
}
|
|
291
|
+
function L(o, e, t) {
|
|
292
|
+
return v(o, (r) => r.kind === "group" && r.id === e ? { ...r, children: [...r.children, t] } : r) ?? o;
|
|
293
|
+
}
|
|
294
|
+
function de(o, e, t) {
|
|
295
|
+
return L(o, e, ie(t));
|
|
296
|
+
}
|
|
297
|
+
function le(o, e, t = "and") {
|
|
298
|
+
return L(o, e, I(t));
|
|
299
|
+
}
|
|
300
|
+
function ce(o, e, t) {
|
|
301
|
+
const r = ae(t);
|
|
302
|
+
return r ? L(o, e, r) : o;
|
|
303
|
+
}
|
|
304
|
+
function X(o, e) {
|
|
305
|
+
return v(o, (r) => r.id === e ? null : r) ?? o;
|
|
306
|
+
}
|
|
307
|
+
function ue(o, e, t) {
|
|
308
|
+
return v(o, (r) => r.kind === "group" && r.id === e ? { ...r, logic: t } : r) ?? o;
|
|
309
|
+
}
|
|
310
|
+
function fe(o, e, t) {
|
|
311
|
+
return v(o, (r) => {
|
|
312
|
+
if ((r.kind === "condition" || r.kind === "subquery") && r.id === e) {
|
|
313
|
+
if (r.kind === "subquery") {
|
|
314
|
+
const s = { ...r };
|
|
315
|
+
return t.field !== void 0 && (s.field = t.field), t.operator !== void 0 && (t.operator === "in" || t.operator === "not-in") && (s.operator = t.operator), s;
|
|
316
|
+
}
|
|
317
|
+
const n = { ...r };
|
|
318
|
+
return t.field !== void 0 && (n.field = t.field), t.operator !== void 0 && (n.operator = t.operator), t.value !== void 0 && (n.value = t.value), n;
|
|
319
|
+
}
|
|
320
|
+
return r;
|
|
321
|
+
}) ?? o;
|
|
322
|
+
}
|
|
323
|
+
function he(o, e, t) {
|
|
324
|
+
return v(o, (r) => {
|
|
325
|
+
if (r.kind === "condition" && r.id === e) {
|
|
326
|
+
const n = y(t.type), s = n.includes(r.operator) ? r.operator : n[0] ?? "equals", b = n.includes(r.operator) && g(r.operator) === g(s) ? r.value : x(s);
|
|
327
|
+
return { ...r, field: t.name, operator: s, value: b };
|
|
328
|
+
}
|
|
329
|
+
return r;
|
|
330
|
+
}) ?? o;
|
|
331
|
+
}
|
|
332
|
+
function ge(o, e, t) {
|
|
333
|
+
return v(o, (r) => {
|
|
334
|
+
if (r.kind === "condition" && r.id === e) {
|
|
335
|
+
const s = g(r.operator) === g(t) ? r.value : x(t);
|
|
336
|
+
return { ...r, operator: t, value: s };
|
|
337
|
+
}
|
|
338
|
+
return r;
|
|
339
|
+
}) ?? o;
|
|
340
|
+
}
|
|
341
|
+
function H(o, e, t, r, n) {
|
|
342
|
+
if (e === t) return o;
|
|
343
|
+
const s = _(o, e);
|
|
344
|
+
if (!s) return o;
|
|
345
|
+
const b = _(o, t);
|
|
346
|
+
if (!b || b.kind !== "group" || V(s).has(t)) return o;
|
|
347
|
+
const a = n ? Y(s, n) : s, l = X(o, e);
|
|
348
|
+
return v(l, (c) => {
|
|
349
|
+
if (c.kind === "group" && c.id === t) {
|
|
350
|
+
const h = [...c.children], f = Math.max(0, Math.min(r, h.length));
|
|
351
|
+
return h.splice(f, 0, a), { ...c, children: h };
|
|
352
|
+
}
|
|
353
|
+
return c;
|
|
354
|
+
}) ?? l;
|
|
355
|
+
}
|
|
356
|
+
function Y(o, e) {
|
|
357
|
+
const t = e.fields.find((r) => r.type !== "relation");
|
|
358
|
+
if (o.kind === "condition") {
|
|
359
|
+
const r = e.fields.find((s) => s.name === o.field);
|
|
360
|
+
if (r && r.type !== "relation") {
|
|
361
|
+
const s = y(r.type), b = s.includes(o.operator) ? o.operator : s[0] ?? "equals", i = s.includes(o.operator) && g(o.operator) === g(b) ? o.value : x(b);
|
|
362
|
+
return { ...o, operator: b, value: i };
|
|
363
|
+
}
|
|
364
|
+
if (!t) return o;
|
|
365
|
+
const n = y(t.type)[0] ?? "equals";
|
|
366
|
+
return {
|
|
367
|
+
...o,
|
|
368
|
+
field: t.name,
|
|
369
|
+
operator: n,
|
|
370
|
+
value: x(n)
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
return o.kind === "group" ? { ...o, children: o.children.map((r) => Y(r, e)) } : o;
|
|
374
|
+
}
|
|
375
|
+
class K extends Error {
|
|
376
|
+
constructor(e, t) {
|
|
377
|
+
super(`Query tree depth ${e} exceeds maxDepth ${t}.`), this.depth = e, this.maxDepth = t, this.name = "MaxDepthExceededError";
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
const m = {
|
|
381
|
+
addCondition: "Add condition",
|
|
382
|
+
addGroup: "Add group",
|
|
383
|
+
addSubquery: "Add sub-query",
|
|
384
|
+
removeRow: "Remove",
|
|
385
|
+
removeGroup: "Remove group",
|
|
386
|
+
logicAnd: "AND",
|
|
387
|
+
logicOr: "OR",
|
|
388
|
+
saveCurrentAs: "Save current as…",
|
|
389
|
+
loadQuery: "Load",
|
|
390
|
+
deleteQuery: "Delete",
|
|
391
|
+
treeTooDeep: "Tree too deep",
|
|
392
|
+
dropHerePlaceholder: "Drop here",
|
|
393
|
+
operators: {
|
|
394
|
+
equals: "=",
|
|
395
|
+
"not-equals": "≠",
|
|
396
|
+
contains: "contains",
|
|
397
|
+
"does-not-contain": "does not contain",
|
|
398
|
+
"starts-with": "starts with",
|
|
399
|
+
"ends-with": "ends with",
|
|
400
|
+
lt: "<",
|
|
401
|
+
lte: "≤",
|
|
402
|
+
gt: ">",
|
|
403
|
+
gte: "≥",
|
|
404
|
+
between: "between",
|
|
405
|
+
"not-between": "not between",
|
|
406
|
+
in: "in",
|
|
407
|
+
"not-in": "not in",
|
|
408
|
+
"is-null": "is null",
|
|
409
|
+
"is-not-null": "is not null",
|
|
410
|
+
"is-true": "is true",
|
|
411
|
+
"is-false": "is false",
|
|
412
|
+
today: "is today",
|
|
413
|
+
yesterday: "is yesterday",
|
|
414
|
+
"this-week": "is this week",
|
|
415
|
+
"last-week": "is last week",
|
|
416
|
+
"next-week": "is next week",
|
|
417
|
+
"this-month": "is this month",
|
|
418
|
+
"last-month": "is last month",
|
|
419
|
+
"next-month": "is next month",
|
|
420
|
+
"this-year": "is this year",
|
|
421
|
+
"last-year": "is last year",
|
|
422
|
+
"next-year": "is next year",
|
|
423
|
+
"last-n-days": "is in the last N days",
|
|
424
|
+
"next-n-days": "is in the next N days",
|
|
425
|
+
"year-to-date": "is year-to-date",
|
|
426
|
+
"any-of": "any of",
|
|
427
|
+
"all-of": "all of",
|
|
428
|
+
"none-of": "none of",
|
|
429
|
+
"is-empty": "is empty",
|
|
430
|
+
"is-not-empty": "is not empty"
|
|
431
|
+
}
|
|
432
|
+
}, pe = 32;
|
|
433
|
+
function je(o, e, t, r = {}) {
|
|
434
|
+
const n = r.maxDepth ?? pe, s = {
|
|
435
|
+
schema: t.schema,
|
|
436
|
+
currentEntity: t.rootEntity,
|
|
437
|
+
depth: 0
|
|
438
|
+
};
|
|
439
|
+
return T(o, e, s, n);
|
|
440
|
+
}
|
|
441
|
+
function T(o, e, t, r) {
|
|
442
|
+
if (t.depth > r) throw new K(t.depth, r);
|
|
443
|
+
switch (o.kind) {
|
|
444
|
+
case "condition":
|
|
445
|
+
return e.condition(o, t);
|
|
446
|
+
case "group": {
|
|
447
|
+
const n = { ...t, depth: t.depth + 1 }, s = o.children.map((b) => T(b, e, n, r));
|
|
448
|
+
return e.group(o, s, t);
|
|
449
|
+
}
|
|
450
|
+
case "subquery": {
|
|
451
|
+
const n = t.schema.find((l) => l.name === t.currentEntity);
|
|
452
|
+
if (!n) throw new Error(`visitTree: schema has no entity "${t.currentEntity}".`);
|
|
453
|
+
const s = n.fields.find((l) => l.name === o.field);
|
|
454
|
+
if (!s) throw new Error(`visitTree: entity "${t.currentEntity}" has no field "${o.field}".`);
|
|
455
|
+
if (s.type !== "relation" || !s.targetEntity)
|
|
456
|
+
throw new Error(`visitTree: field "${o.field}" is not a relation.`);
|
|
457
|
+
const b = s.targetEntity;
|
|
458
|
+
if (!t.schema.some((l) => l.name === b))
|
|
459
|
+
throw new Error(`visitTree: relation target "${b}" missing from schema.`);
|
|
460
|
+
const i = {
|
|
461
|
+
...t,
|
|
462
|
+
currentEntity: b,
|
|
463
|
+
depth: t.depth + 1
|
|
464
|
+
}, a = () => T(o.subQuery, e, i, r);
|
|
465
|
+
return e.subquery(o, t, a);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
const me = 32;
|
|
470
|
+
function ve(o, e, t = {}) {
|
|
471
|
+
const r = ye(t.messages), n = t.maxDepth ?? me, s = t.rootEntity ?? e[0]?.name ?? "";
|
|
472
|
+
return N(o, e, s, r, 0, n);
|
|
473
|
+
}
|
|
474
|
+
function ye(o) {
|
|
475
|
+
return {
|
|
476
|
+
...m,
|
|
477
|
+
...o ?? {},
|
|
478
|
+
operators: { ...m.operators, ...o?.operators ?? {} }
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
function N(o, e, t, r, n, s) {
|
|
482
|
+
if (n > s) throw new K(n, s);
|
|
483
|
+
switch (o.kind) {
|
|
484
|
+
case "group":
|
|
485
|
+
return we(o, e, t, r, n, s);
|
|
486
|
+
case "condition":
|
|
487
|
+
return xe(o, e, t, r);
|
|
488
|
+
case "subquery":
|
|
489
|
+
return _e(o, e, t, r, n, s);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
function we(o, e, t, r, n, s) {
|
|
493
|
+
if (o.children.length === 0)
|
|
494
|
+
return o.logic === "and" ? "TRUE" : "FALSE";
|
|
495
|
+
const b = o.logic === "and" ? ` ${r.logicAnd} ` : ` ${r.logicOr} `;
|
|
496
|
+
return `(${o.children.map((a) => N(a, e, t, r, n + 1, s)).join(b)})`;
|
|
497
|
+
}
|
|
498
|
+
function xe(o, e, t, r) {
|
|
499
|
+
const s = W(e, t, o.field)?.label ?? o.field, b = r.operators[o.operator] ?? o.operator, i = qe(o.operator, o.value);
|
|
500
|
+
return i === "" ? `${s} ${b}` : `${s} ${b} ${i}`;
|
|
501
|
+
}
|
|
502
|
+
function _e(o, e, t, r, n, s) {
|
|
503
|
+
const b = W(e, t, o.field), i = b?.label ?? o.field, a = r.operators[o.operator] ?? o.operator, l = b?.targetEntity ?? "", c = N(o.subQuery, e, l, r, n + 1, s);
|
|
504
|
+
return `${i} ${a} ${c}`;
|
|
505
|
+
}
|
|
506
|
+
function qe(o, e) {
|
|
507
|
+
const t = g(o);
|
|
508
|
+
if (t === "null") return "";
|
|
509
|
+
if (t === "tuple" && Array.isArray(e))
|
|
510
|
+
return `[${e.map(z).join(", ")}]`;
|
|
511
|
+
if (t === "array" && Array.isArray(e))
|
|
512
|
+
return `[${e.map(z).join(", ")}]`;
|
|
513
|
+
if (t === "n-input" && typeof e == "object" && e !== null) {
|
|
514
|
+
const r = e.n;
|
|
515
|
+
return typeof r == "number" ? String(r) : JSON.stringify(e);
|
|
516
|
+
}
|
|
517
|
+
return z(e);
|
|
518
|
+
}
|
|
519
|
+
function z(o) {
|
|
520
|
+
return o == null ? "?" : typeof o == "string" ? `"${o}"` : o instanceof Date ? o.toISOString() : String(o);
|
|
521
|
+
}
|
|
522
|
+
function W(o, e, t) {
|
|
523
|
+
return o.find((r) => r.name === e)?.fields.find((r) => r.name === t);
|
|
524
|
+
}
|
|
525
|
+
const ke = 99999;
|
|
526
|
+
class $e {
|
|
527
|
+
constructor() {
|
|
528
|
+
this._source = null, this._ghost = null, this._lastTarget = null, this._offsetX = 0, this._offsetY = 0;
|
|
529
|
+
}
|
|
530
|
+
isActive() {
|
|
531
|
+
return this._source !== null;
|
|
532
|
+
}
|
|
533
|
+
source() {
|
|
534
|
+
return this._source;
|
|
535
|
+
}
|
|
536
|
+
currentTarget() {
|
|
537
|
+
return this._lastTarget;
|
|
538
|
+
}
|
|
539
|
+
start(e, t) {
|
|
540
|
+
if (typeof document > "u") return;
|
|
541
|
+
this._source = e;
|
|
542
|
+
const r = e.rowElement.getBoundingClientRect();
|
|
543
|
+
this._offsetX = t.clientX - r.left, this._offsetY = t.clientY - r.top;
|
|
544
|
+
const n = e.rowElement.cloneNode(!0);
|
|
545
|
+
n.style.position = "fixed", n.style.top = `${r.top}px`, n.style.left = `${r.left}px`, n.style.width = `${r.width}px`, n.style.pointerEvents = "none", n.style.zIndex = String(ke), n.style.opacity = "0.85", n.classList.add("qb-drag-ghost"), document.body.appendChild(n), this._ghost = n;
|
|
546
|
+
}
|
|
547
|
+
move(e) {
|
|
548
|
+
if (!this._source || !this._ghost) return;
|
|
549
|
+
this._ghost.style.top = `${e.clientY - this._offsetY}px`, this._ghost.style.left = `${e.clientX - this._offsetX}px`;
|
|
550
|
+
const t = this.resolveDropTarget(e.clientX, e.clientY);
|
|
551
|
+
this._lastTarget = t;
|
|
552
|
+
}
|
|
553
|
+
end(e) {
|
|
554
|
+
const t = this._lastTarget;
|
|
555
|
+
return this.cleanup(), t;
|
|
556
|
+
}
|
|
557
|
+
cancel() {
|
|
558
|
+
this.cleanup();
|
|
559
|
+
}
|
|
560
|
+
cleanup() {
|
|
561
|
+
this._ghost && typeof document < "u" && this._ghost.remove(), this._ghost = null, this._source = null, this._lastTarget = null, this._offsetX = 0, this._offsetY = 0;
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Walks `document.elementsFromPoint(x, y)` (composed path; cross-browser
|
|
565
|
+
* supported in Chromium / Firefox / modern WebKit) and returns the first
|
|
566
|
+
* `[data-drop-slot]` ancestor whose data-parent-id is NOT in the source's
|
|
567
|
+
* descendant set.
|
|
568
|
+
*
|
|
569
|
+
* For older WebKit which doesn't implement `elementsFromPoint`, callers
|
|
570
|
+
* can extend the resolver with a shadow-DOM walker (FR-38 fallback) —
|
|
571
|
+
* not implemented here since we target evergreen browsers.
|
|
572
|
+
*/
|
|
573
|
+
resolveDropTarget(e, t) {
|
|
574
|
+
if (typeof document > "u") return null;
|
|
575
|
+
const r = this._source;
|
|
576
|
+
if (!r) return null;
|
|
577
|
+
const n = document.elementsFromPoint;
|
|
578
|
+
let s = [];
|
|
579
|
+
if (typeof n == "function")
|
|
580
|
+
s = n.call(document, e, t) ?? [];
|
|
581
|
+
else {
|
|
582
|
+
const i = document.elementFromPoint(e, t);
|
|
583
|
+
i && (s = [i]);
|
|
584
|
+
}
|
|
585
|
+
const b = Ee(s, e, t);
|
|
586
|
+
for (const i of b) {
|
|
587
|
+
const a = i.closest("[data-drop-slot]");
|
|
588
|
+
if (!a) continue;
|
|
589
|
+
const l = a.dataset.parentId, c = a.dataset.index, h = a.dataset.qbRoot;
|
|
590
|
+
if (!(!l || !c || !h) && !r.descendantIds.has(l))
|
|
591
|
+
return { parentId: l, index: Number(c), qbRoot: h };
|
|
592
|
+
}
|
|
593
|
+
return null;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
function Ee(o, e, t) {
|
|
597
|
+
const r = [...o], n = /* @__PURE__ */ new Set();
|
|
598
|
+
for (const s of o) {
|
|
599
|
+
const b = s.shadowRoot;
|
|
600
|
+
if (!b || n.has(b)) continue;
|
|
601
|
+
n.add(b);
|
|
602
|
+
const i = b.elementFromPoint(e, t);
|
|
603
|
+
i && r.push(i);
|
|
604
|
+
}
|
|
605
|
+
return r;
|
|
606
|
+
}
|
|
607
|
+
const F = R(
|
|
608
|
+
Symbol("mp-query-builder.editorRegistry")
|
|
609
|
+
), E = R(
|
|
610
|
+
Symbol("mp-query-builder.disabled")
|
|
611
|
+
), q = R(
|
|
612
|
+
Symbol("mp-query-builder.messages")
|
|
613
|
+
), B = R(
|
|
614
|
+
Symbol("mp-query-builder.maxDepth")
|
|
615
|
+
);
|
|
616
|
+
function C(o, e, t, r, n = {}) {
|
|
617
|
+
const s = document.createElement("input");
|
|
618
|
+
s.type = o, s.className = "form-control form-control-sm qb-editor-input", s.value = e, r && (s.disabled = !0);
|
|
619
|
+
for (const [i, a] of Object.entries(n))
|
|
620
|
+
a !== void 0 && s.setAttribute(i, a);
|
|
621
|
+
const b = () => t(s.value);
|
|
622
|
+
return s.addEventListener("input", b), s.addEventListener("change", b), s;
|
|
623
|
+
}
|
|
624
|
+
function J(o, e) {
|
|
625
|
+
return o == null ? "" : e === "date" && o instanceof Date ? o.toISOString().slice(0, 10) : e === "datetime" && o instanceof Date ? o.toISOString().slice(0, 16) : typeof o == "string" && (e === "date" || e === "datetime") ? e === "date" ? o.slice(0, 10) : o.slice(0, 16) : String(o);
|
|
626
|
+
}
|
|
627
|
+
function Z(o, e) {
|
|
628
|
+
if (o === "") return null;
|
|
629
|
+
switch (e) {
|
|
630
|
+
case "number":
|
|
631
|
+
return Number(o);
|
|
632
|
+
case "integer":
|
|
633
|
+
return Number.parseInt(o, 10);
|
|
634
|
+
case "date":
|
|
635
|
+
case "datetime":
|
|
636
|
+
return o;
|
|
637
|
+
// Keep as ISO string; backend parses.
|
|
638
|
+
default:
|
|
639
|
+
return o;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
function w(o) {
|
|
643
|
+
return (e) => {
|
|
644
|
+
const t = o === "string" ? "text" : o === "date" ? "date" : o === "datetime" ? "datetime-local" : "number", r = {};
|
|
645
|
+
o === "integer" && (r.step = "1"), o === "number" && (r.step = "any");
|
|
646
|
+
const n = J(e.value, o), s = C(
|
|
647
|
+
t,
|
|
648
|
+
n,
|
|
649
|
+
(b) => e.onChange(Z(b, o)),
|
|
650
|
+
e.disabled,
|
|
651
|
+
r
|
|
652
|
+
);
|
|
653
|
+
return s.setAttribute("aria-label", e.field.label), { element: s };
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
function U(o) {
|
|
657
|
+
return (e) => {
|
|
658
|
+
const t = document.createElement("span");
|
|
659
|
+
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) => {
|
|
661
|
+
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);
|
|
663
|
+
}, b = (f) => J(f, o), i = o === "date" ? "date" : o === "datetime" ? "datetime-local" : "number", a = {};
|
|
664
|
+
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);
|
|
666
|
+
l.setAttribute("aria-label", `${e.field.label} (from)`), c.setAttribute("aria-label", `${e.field.label} (to)`);
|
|
667
|
+
const h = document.createElement("span");
|
|
668
|
+
return h.textContent = " … ", h.className = "qb-editor-tuple-sep", t.append(l, h, c), { element: t };
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
function Ce() {
|
|
672
|
+
return (o) => {
|
|
673
|
+
const e = typeof o.value == "object" && o.value !== null ? String(o.value.n ?? 1) : "1", t = C(
|
|
674
|
+
"number",
|
|
675
|
+
e,
|
|
676
|
+
(r) => {
|
|
677
|
+
const n = Math.max(1, Number.parseInt(r, 10) || 1);
|
|
678
|
+
o.onChange({ n });
|
|
679
|
+
},
|
|
680
|
+
o.disabled,
|
|
681
|
+
{ min: "1", step: "1" }
|
|
682
|
+
);
|
|
683
|
+
return t.classList.add("qb-editor-n-input"), t.setAttribute("aria-label", `${o.field.label} — number of days`), { element: t };
|
|
684
|
+
};
|
|
685
|
+
}
|
|
686
|
+
function De(o) {
|
|
687
|
+
return (e) => {
|
|
688
|
+
const t = document.createElement("select");
|
|
689
|
+
t.className = "form-select form-select-sm qb-editor-select", t.setAttribute("aria-label", e.field.label), e.disabled && (t.disabled = !0);
|
|
690
|
+
const r = document.createElement("option");
|
|
691
|
+
r.value = "", r.textContent = "—", t.appendChild(r);
|
|
692
|
+
for (const n of o) {
|
|
693
|
+
const s = document.createElement("option");
|
|
694
|
+
s.value = String(n.value), s.textContent = n.label, e.value === n.value && (s.selected = !0), t.appendChild(s);
|
|
695
|
+
}
|
|
696
|
+
return t.addEventListener("change", () => {
|
|
697
|
+
if (t.value === "") {
|
|
698
|
+
e.onChange(null);
|
|
699
|
+
return;
|
|
700
|
+
}
|
|
701
|
+
const n = o.find((s) => String(s.value) === t.value);
|
|
702
|
+
e.onChange(n?.value ?? t.value);
|
|
703
|
+
}), { element: t };
|
|
704
|
+
};
|
|
705
|
+
}
|
|
706
|
+
function Se(o) {
|
|
707
|
+
return (e) => {
|
|
708
|
+
const t = document.createElement("select");
|
|
709
|
+
t.className = "form-select form-select-sm qb-editor-multiselect", t.multiple = !0, t.setAttribute("aria-label", e.field.label), e.disabled && (t.disabled = !0);
|
|
710
|
+
const r = Array.isArray(e.value) ? e.value : [];
|
|
711
|
+
for (const n of o) {
|
|
712
|
+
const s = document.createElement("option");
|
|
713
|
+
s.value = String(n.value), s.textContent = n.label, r.includes(n.value) && (s.selected = !0), t.appendChild(s);
|
|
714
|
+
}
|
|
715
|
+
return t.addEventListener("change", () => {
|
|
716
|
+
const n = Array.from(t.selectedOptions).map((s) => o.find((i) => String(i.value) === s.value)?.value ?? s.value);
|
|
717
|
+
e.onChange(n);
|
|
718
|
+
}), { element: t };
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
function G(o) {
|
|
722
|
+
return (e) => {
|
|
723
|
+
const t = document.createElement("span");
|
|
724
|
+
return t.className = "qb-editor-chip-input", (() => {
|
|
725
|
+
t.innerHTML = "";
|
|
726
|
+
const n = Array.isArray(e.value) ? e.value : [];
|
|
727
|
+
for (let b = 0; b < n.length; b++) {
|
|
728
|
+
const i = n[b], a = document.createElement("span");
|
|
729
|
+
a.className = "qb-editor-chip", a.textContent = String(i);
|
|
730
|
+
const l = document.createElement("button");
|
|
731
|
+
l.type = "button", l.className = "qb-editor-chip-remove", l.setAttribute("aria-label", `Remove ${String(i)}`), l.textContent = "×", e.disabled && (l.disabled = !0), l.addEventListener("click", () => {
|
|
732
|
+
const c = (Array.isArray(e.value) ? e.value : []).filter((h, f) => f !== b);
|
|
733
|
+
e.onChange(c);
|
|
734
|
+
}), a.appendChild(l), t.appendChild(a);
|
|
735
|
+
}
|
|
736
|
+
const s = document.createElement("input");
|
|
737
|
+
s.type = "text", s.className = "form-control form-control-sm qb-editor-chip-add", s.placeholder = "+ add", s.size = 8, s.setAttribute("aria-label", `${e.field.label} — add value`), e.disabled && (s.disabled = !0), s.addEventListener("keydown", (b) => {
|
|
738
|
+
if (b.key === "Enter" && s.value.trim() !== "") {
|
|
739
|
+
b.preventDefault();
|
|
740
|
+
const i = o(s.value.trim()), a = [...Array.isArray(e.value) ? e.value : [], i];
|
|
741
|
+
s.value = "", e.onChange(a);
|
|
742
|
+
}
|
|
743
|
+
}), t.appendChild(s);
|
|
744
|
+
})(), {
|
|
745
|
+
element: t,
|
|
746
|
+
dispose: () => {
|
|
747
|
+
}
|
|
748
|
+
};
|
|
749
|
+
};
|
|
750
|
+
}
|
|
751
|
+
function Re(o, e) {
|
|
752
|
+
const t = g(e);
|
|
753
|
+
if (t === "null") return null;
|
|
754
|
+
if (t === "n-input") return Ce();
|
|
755
|
+
if (t === "tuple") {
|
|
756
|
+
const r = o.type;
|
|
757
|
+
return U(r === "number" || r === "integer" || r === "date" || r === "datetime" ? r : "number");
|
|
758
|
+
}
|
|
759
|
+
return t === "array" ? o.options && o.options.length > 0 ? Se(o.options) : o.type === "number" || o.type === "integer" ? G(
|
|
760
|
+
(r) => o.type === "integer" ? Number.parseInt(r, 10) : Number(r)
|
|
761
|
+
) : G((r) => r) : o.type === "enum" && o.options && o.options.length > 0 ? De(o.options) : o.type === "string" ? w("string") : o.type === "number" ? w("number") : o.type === "integer" ? w("integer") : o.type === "date" ? w("date") : o.type === "datetime" ? w("datetime") : null;
|
|
762
|
+
}
|
|
763
|
+
d`<!-- Rendered dynamically by render(). Codegen-wc emits styles from the
|
|
764
|
+
sibling .scss; the template export is intentionally unused. -->`;
|
|
765
|
+
const Ae = D(`.btn {
|
|
766
|
+
--bs-btn-padding-x: 0.75rem;
|
|
767
|
+
--bs-btn-padding-y: 0.375rem;
|
|
768
|
+
--bs-btn-font-family: ;
|
|
769
|
+
--bs-btn-font-size: 1rem;
|
|
770
|
+
--bs-btn-font-weight: 400;
|
|
771
|
+
--bs-btn-line-height: 1.5;
|
|
772
|
+
--bs-btn-color: var(--bs-body-color);
|
|
773
|
+
--bs-btn-bg: transparent;
|
|
774
|
+
--bs-btn-border-width: var(--bs-border-width);
|
|
775
|
+
--bs-btn-border-color: transparent;
|
|
776
|
+
--bs-btn-border-radius: var(--bs-border-radius);
|
|
777
|
+
--bs-btn-hover-border-color: transparent;
|
|
778
|
+
--bs-btn-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);
|
|
779
|
+
--bs-btn-disabled-opacity: 0.65;
|
|
780
|
+
--bs-btn-focus-box-shadow: 0 0 0 0.25rem rgba(var(--bs-btn-focus-shadow-rgb), .5);
|
|
781
|
+
display: inline-block;
|
|
782
|
+
padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x);
|
|
783
|
+
font-family: var(--bs-btn-font-family);
|
|
784
|
+
font-size: var(--bs-btn-font-size);
|
|
785
|
+
font-weight: var(--bs-btn-font-weight);
|
|
786
|
+
line-height: var(--bs-btn-line-height);
|
|
787
|
+
color: var(--bs-btn-color);
|
|
788
|
+
text-align: center;
|
|
789
|
+
text-decoration: none;
|
|
790
|
+
vertical-align: middle;
|
|
791
|
+
cursor: pointer;
|
|
792
|
+
user-select: none;
|
|
793
|
+
border: var(--bs-btn-border-width) solid var(--bs-btn-border-color);
|
|
794
|
+
border-radius: var(--bs-btn-border-radius);
|
|
795
|
+
background-color: var(--bs-btn-bg);
|
|
796
|
+
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
797
|
+
}
|
|
798
|
+
@media (prefers-reduced-motion: reduce) {
|
|
799
|
+
.btn {
|
|
800
|
+
transition: none;
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
.btn:hover {
|
|
804
|
+
color: var(--bs-btn-hover-color);
|
|
805
|
+
background-color: var(--bs-btn-hover-bg);
|
|
806
|
+
border-color: var(--bs-btn-hover-border-color);
|
|
807
|
+
}
|
|
808
|
+
.btn-check + .btn:hover {
|
|
809
|
+
color: var(--bs-btn-color);
|
|
810
|
+
background-color: var(--bs-btn-bg);
|
|
811
|
+
border-color: var(--bs-btn-border-color);
|
|
812
|
+
}
|
|
813
|
+
.btn:focus-visible {
|
|
814
|
+
color: var(--bs-btn-hover-color);
|
|
815
|
+
background-color: var(--bs-btn-hover-bg);
|
|
816
|
+
border-color: var(--bs-btn-hover-border-color);
|
|
817
|
+
outline: 0;
|
|
818
|
+
box-shadow: var(--bs-btn-focus-box-shadow);
|
|
819
|
+
}
|
|
820
|
+
.btn-check:focus-visible + .btn {
|
|
821
|
+
border-color: var(--bs-btn-hover-border-color);
|
|
822
|
+
outline: 0;
|
|
823
|
+
box-shadow: var(--bs-btn-focus-box-shadow);
|
|
824
|
+
}
|
|
825
|
+
.btn-check:checked + .btn, :not(.btn-check) + .btn:active, .btn:first-child:active, .btn.active, .btn.show {
|
|
826
|
+
color: var(--bs-btn-active-color);
|
|
827
|
+
background-color: var(--bs-btn-active-bg);
|
|
828
|
+
border-color: var(--bs-btn-active-border-color);
|
|
829
|
+
}
|
|
830
|
+
.btn-check:checked + .btn:focus-visible, :not(.btn-check) + .btn:active:focus-visible, .btn:first-child:active:focus-visible, .btn.active:focus-visible, .btn.show:focus-visible {
|
|
831
|
+
box-shadow: var(--bs-btn-focus-box-shadow);
|
|
832
|
+
}
|
|
833
|
+
.btn-check:checked:focus-visible + .btn {
|
|
834
|
+
box-shadow: var(--bs-btn-focus-box-shadow);
|
|
835
|
+
}
|
|
836
|
+
.btn:disabled, .btn.disabled, fieldset:disabled .btn {
|
|
837
|
+
color: var(--bs-btn-disabled-color);
|
|
838
|
+
pointer-events: none;
|
|
839
|
+
background-color: var(--bs-btn-disabled-bg);
|
|
840
|
+
border-color: var(--bs-btn-disabled-border-color);
|
|
841
|
+
opacity: var(--bs-btn-disabled-opacity);
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
.btn-primary {
|
|
845
|
+
--bs-btn-color: #fff;
|
|
846
|
+
--bs-btn-bg: #0d6efd;
|
|
847
|
+
--bs-btn-border-color: #0d6efd;
|
|
848
|
+
--bs-btn-hover-color: #fff;
|
|
849
|
+
--bs-btn-hover-bg: rgb(11.05, 93.5, 215.05);
|
|
850
|
+
--bs-btn-hover-border-color: rgb(10.4, 88, 202.4);
|
|
851
|
+
--bs-btn-focus-shadow-rgb: 49, 132, 253;
|
|
852
|
+
--bs-btn-active-color: #fff;
|
|
853
|
+
--bs-btn-active-bg: rgb(10.4, 88, 202.4);
|
|
854
|
+
--bs-btn-active-border-color: rgb(9.75, 82.5, 189.75);
|
|
855
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
856
|
+
--bs-btn-disabled-color: #fff;
|
|
857
|
+
--bs-btn-disabled-bg: #0d6efd;
|
|
858
|
+
--bs-btn-disabled-border-color: #0d6efd;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
.btn-secondary {
|
|
862
|
+
--bs-btn-color: #fff;
|
|
863
|
+
--bs-btn-bg: #6c757d;
|
|
864
|
+
--bs-btn-border-color: #6c757d;
|
|
865
|
+
--bs-btn-hover-color: #fff;
|
|
866
|
+
--bs-btn-hover-bg: rgb(91.8, 99.45, 106.25);
|
|
867
|
+
--bs-btn-hover-border-color: rgb(86.4, 93.6, 100);
|
|
868
|
+
--bs-btn-focus-shadow-rgb: 130, 138, 145;
|
|
869
|
+
--bs-btn-active-color: #fff;
|
|
870
|
+
--bs-btn-active-bg: rgb(86.4, 93.6, 100);
|
|
871
|
+
--bs-btn-active-border-color: rgb(81, 87.75, 93.75);
|
|
872
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
873
|
+
--bs-btn-disabled-color: #fff;
|
|
874
|
+
--bs-btn-disabled-bg: #6c757d;
|
|
875
|
+
--bs-btn-disabled-border-color: #6c757d;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
.btn-success {
|
|
879
|
+
--bs-btn-color: #fff;
|
|
880
|
+
--bs-btn-bg: #198754;
|
|
881
|
+
--bs-btn-border-color: #198754;
|
|
882
|
+
--bs-btn-hover-color: #fff;
|
|
883
|
+
--bs-btn-hover-bg: rgb(21.25, 114.75, 71.4);
|
|
884
|
+
--bs-btn-hover-border-color: rgb(20, 108, 67.2);
|
|
885
|
+
--bs-btn-focus-shadow-rgb: 60, 153, 110;
|
|
886
|
+
--bs-btn-active-color: #fff;
|
|
887
|
+
--bs-btn-active-bg: rgb(20, 108, 67.2);
|
|
888
|
+
--bs-btn-active-border-color: rgb(18.75, 101.25, 63);
|
|
889
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
890
|
+
--bs-btn-disabled-color: #fff;
|
|
891
|
+
--bs-btn-disabled-bg: #198754;
|
|
892
|
+
--bs-btn-disabled-border-color: #198754;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
.btn-info {
|
|
896
|
+
--bs-btn-color: #000;
|
|
897
|
+
--bs-btn-bg: #0dcaf0;
|
|
898
|
+
--bs-btn-border-color: #0dcaf0;
|
|
899
|
+
--bs-btn-hover-color: #000;
|
|
900
|
+
--bs-btn-hover-bg: rgb(49.3, 209.95, 242.25);
|
|
901
|
+
--bs-btn-hover-border-color: rgb(37.2, 207.3, 241.5);
|
|
902
|
+
--bs-btn-focus-shadow-rgb: 11, 172, 204;
|
|
903
|
+
--bs-btn-active-color: #000;
|
|
904
|
+
--bs-btn-active-bg: rgb(61.4, 212.6, 243);
|
|
905
|
+
--bs-btn-active-border-color: rgb(37.2, 207.3, 241.5);
|
|
906
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
907
|
+
--bs-btn-disabled-color: #000;
|
|
908
|
+
--bs-btn-disabled-bg: #0dcaf0;
|
|
909
|
+
--bs-btn-disabled-border-color: #0dcaf0;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
.btn-warning {
|
|
913
|
+
--bs-btn-color: #000;
|
|
914
|
+
--bs-btn-bg: #ffc107;
|
|
915
|
+
--bs-btn-border-color: #ffc107;
|
|
916
|
+
--bs-btn-hover-color: #000;
|
|
917
|
+
--bs-btn-hover-bg: rgb(255, 202.3, 44.2);
|
|
918
|
+
--bs-btn-hover-border-color: rgb(255, 199.2, 31.8);
|
|
919
|
+
--bs-btn-focus-shadow-rgb: 217, 164, 6;
|
|
920
|
+
--bs-btn-active-color: #000;
|
|
921
|
+
--bs-btn-active-bg: rgb(255, 205.4, 56.6);
|
|
922
|
+
--bs-btn-active-border-color: rgb(255, 199.2, 31.8);
|
|
923
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
924
|
+
--bs-btn-disabled-color: #000;
|
|
925
|
+
--bs-btn-disabled-bg: #ffc107;
|
|
926
|
+
--bs-btn-disabled-border-color: #ffc107;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
.btn-danger {
|
|
930
|
+
--bs-btn-color: #fff;
|
|
931
|
+
--bs-btn-bg: #dc3545;
|
|
932
|
+
--bs-btn-border-color: #dc3545;
|
|
933
|
+
--bs-btn-hover-color: #fff;
|
|
934
|
+
--bs-btn-hover-bg: rgb(187, 45.05, 58.65);
|
|
935
|
+
--bs-btn-hover-border-color: rgb(176, 42.4, 55.2);
|
|
936
|
+
--bs-btn-focus-shadow-rgb: 225, 83, 97;
|
|
937
|
+
--bs-btn-active-color: #fff;
|
|
938
|
+
--bs-btn-active-bg: rgb(176, 42.4, 55.2);
|
|
939
|
+
--bs-btn-active-border-color: rgb(165, 39.75, 51.75);
|
|
940
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
941
|
+
--bs-btn-disabled-color: #fff;
|
|
942
|
+
--bs-btn-disabled-bg: #dc3545;
|
|
943
|
+
--bs-btn-disabled-border-color: #dc3545;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
.btn-light {
|
|
947
|
+
--bs-btn-color: #000;
|
|
948
|
+
--bs-btn-bg: #f8f9fa;
|
|
949
|
+
--bs-btn-border-color: #f8f9fa;
|
|
950
|
+
--bs-btn-hover-color: #000;
|
|
951
|
+
--bs-btn-hover-bg: rgb(210.8, 211.65, 212.5);
|
|
952
|
+
--bs-btn-hover-border-color: rgb(198.4, 199.2, 200);
|
|
953
|
+
--bs-btn-focus-shadow-rgb: 211, 212, 213;
|
|
954
|
+
--bs-btn-active-color: #000;
|
|
955
|
+
--bs-btn-active-bg: rgb(198.4, 199.2, 200);
|
|
956
|
+
--bs-btn-active-border-color: rgb(186, 186.75, 187.5);
|
|
957
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
958
|
+
--bs-btn-disabled-color: #000;
|
|
959
|
+
--bs-btn-disabled-bg: #f8f9fa;
|
|
960
|
+
--bs-btn-disabled-border-color: #f8f9fa;
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
.btn-dark {
|
|
964
|
+
--bs-btn-color: #fff;
|
|
965
|
+
--bs-btn-bg: #212529;
|
|
966
|
+
--bs-btn-border-color: #212529;
|
|
967
|
+
--bs-btn-hover-color: #fff;
|
|
968
|
+
--bs-btn-hover-bg: rgb(66.3, 69.7, 73.1);
|
|
969
|
+
--bs-btn-hover-border-color: rgb(55.2, 58.8, 62.4);
|
|
970
|
+
--bs-btn-focus-shadow-rgb: 66, 70, 73;
|
|
971
|
+
--bs-btn-active-color: #fff;
|
|
972
|
+
--bs-btn-active-bg: rgb(77.4, 80.6, 83.8);
|
|
973
|
+
--bs-btn-active-border-color: rgb(55.2, 58.8, 62.4);
|
|
974
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
975
|
+
--bs-btn-disabled-color: #fff;
|
|
976
|
+
--bs-btn-disabled-bg: #212529;
|
|
977
|
+
--bs-btn-disabled-border-color: #212529;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
.btn-outline-primary {
|
|
981
|
+
--bs-btn-color: #0d6efd;
|
|
982
|
+
--bs-btn-border-color: #0d6efd;
|
|
983
|
+
--bs-btn-hover-color: #fff;
|
|
984
|
+
--bs-btn-hover-bg: #0d6efd;
|
|
985
|
+
--bs-btn-hover-border-color: #0d6efd;
|
|
986
|
+
--bs-btn-focus-shadow-rgb: 13, 110, 253;
|
|
987
|
+
--bs-btn-active-color: #fff;
|
|
988
|
+
--bs-btn-active-bg: #0d6efd;
|
|
989
|
+
--bs-btn-active-border-color: #0d6efd;
|
|
990
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
991
|
+
--bs-btn-disabled-color: #0d6efd;
|
|
992
|
+
--bs-btn-disabled-bg: transparent;
|
|
993
|
+
--bs-btn-disabled-border-color: #0d6efd;
|
|
994
|
+
--bs-gradient: none;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
.btn-outline-secondary {
|
|
998
|
+
--bs-btn-color: #6c757d;
|
|
999
|
+
--bs-btn-border-color: #6c757d;
|
|
1000
|
+
--bs-btn-hover-color: #fff;
|
|
1001
|
+
--bs-btn-hover-bg: #6c757d;
|
|
1002
|
+
--bs-btn-hover-border-color: #6c757d;
|
|
1003
|
+
--bs-btn-focus-shadow-rgb: 108, 117, 125;
|
|
1004
|
+
--bs-btn-active-color: #fff;
|
|
1005
|
+
--bs-btn-active-bg: #6c757d;
|
|
1006
|
+
--bs-btn-active-border-color: #6c757d;
|
|
1007
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
1008
|
+
--bs-btn-disabled-color: #6c757d;
|
|
1009
|
+
--bs-btn-disabled-bg: transparent;
|
|
1010
|
+
--bs-btn-disabled-border-color: #6c757d;
|
|
1011
|
+
--bs-gradient: none;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
.btn-outline-success {
|
|
1015
|
+
--bs-btn-color: #198754;
|
|
1016
|
+
--bs-btn-border-color: #198754;
|
|
1017
|
+
--bs-btn-hover-color: #fff;
|
|
1018
|
+
--bs-btn-hover-bg: #198754;
|
|
1019
|
+
--bs-btn-hover-border-color: #198754;
|
|
1020
|
+
--bs-btn-focus-shadow-rgb: 25, 135, 84;
|
|
1021
|
+
--bs-btn-active-color: #fff;
|
|
1022
|
+
--bs-btn-active-bg: #198754;
|
|
1023
|
+
--bs-btn-active-border-color: #198754;
|
|
1024
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
1025
|
+
--bs-btn-disabled-color: #198754;
|
|
1026
|
+
--bs-btn-disabled-bg: transparent;
|
|
1027
|
+
--bs-btn-disabled-border-color: #198754;
|
|
1028
|
+
--bs-gradient: none;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
.btn-outline-info {
|
|
1032
|
+
--bs-btn-color: #0dcaf0;
|
|
1033
|
+
--bs-btn-border-color: #0dcaf0;
|
|
1034
|
+
--bs-btn-hover-color: #000;
|
|
1035
|
+
--bs-btn-hover-bg: #0dcaf0;
|
|
1036
|
+
--bs-btn-hover-border-color: #0dcaf0;
|
|
1037
|
+
--bs-btn-focus-shadow-rgb: 13, 202, 240;
|
|
1038
|
+
--bs-btn-active-color: #000;
|
|
1039
|
+
--bs-btn-active-bg: #0dcaf0;
|
|
1040
|
+
--bs-btn-active-border-color: #0dcaf0;
|
|
1041
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
1042
|
+
--bs-btn-disabled-color: #0dcaf0;
|
|
1043
|
+
--bs-btn-disabled-bg: transparent;
|
|
1044
|
+
--bs-btn-disabled-border-color: #0dcaf0;
|
|
1045
|
+
--bs-gradient: none;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
.btn-outline-warning {
|
|
1049
|
+
--bs-btn-color: #ffc107;
|
|
1050
|
+
--bs-btn-border-color: #ffc107;
|
|
1051
|
+
--bs-btn-hover-color: #000;
|
|
1052
|
+
--bs-btn-hover-bg: #ffc107;
|
|
1053
|
+
--bs-btn-hover-border-color: #ffc107;
|
|
1054
|
+
--bs-btn-focus-shadow-rgb: 255, 193, 7;
|
|
1055
|
+
--bs-btn-active-color: #000;
|
|
1056
|
+
--bs-btn-active-bg: #ffc107;
|
|
1057
|
+
--bs-btn-active-border-color: #ffc107;
|
|
1058
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
1059
|
+
--bs-btn-disabled-color: #ffc107;
|
|
1060
|
+
--bs-btn-disabled-bg: transparent;
|
|
1061
|
+
--bs-btn-disabled-border-color: #ffc107;
|
|
1062
|
+
--bs-gradient: none;
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
.btn-outline-danger {
|
|
1066
|
+
--bs-btn-color: #dc3545;
|
|
1067
|
+
--bs-btn-border-color: #dc3545;
|
|
1068
|
+
--bs-btn-hover-color: #fff;
|
|
1069
|
+
--bs-btn-hover-bg: #dc3545;
|
|
1070
|
+
--bs-btn-hover-border-color: #dc3545;
|
|
1071
|
+
--bs-btn-focus-shadow-rgb: 220, 53, 69;
|
|
1072
|
+
--bs-btn-active-color: #fff;
|
|
1073
|
+
--bs-btn-active-bg: #dc3545;
|
|
1074
|
+
--bs-btn-active-border-color: #dc3545;
|
|
1075
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
1076
|
+
--bs-btn-disabled-color: #dc3545;
|
|
1077
|
+
--bs-btn-disabled-bg: transparent;
|
|
1078
|
+
--bs-btn-disabled-border-color: #dc3545;
|
|
1079
|
+
--bs-gradient: none;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
.btn-outline-light {
|
|
1083
|
+
--bs-btn-color: #f8f9fa;
|
|
1084
|
+
--bs-btn-border-color: #f8f9fa;
|
|
1085
|
+
--bs-btn-hover-color: #000;
|
|
1086
|
+
--bs-btn-hover-bg: #f8f9fa;
|
|
1087
|
+
--bs-btn-hover-border-color: #f8f9fa;
|
|
1088
|
+
--bs-btn-focus-shadow-rgb: 248, 249, 250;
|
|
1089
|
+
--bs-btn-active-color: #000;
|
|
1090
|
+
--bs-btn-active-bg: #f8f9fa;
|
|
1091
|
+
--bs-btn-active-border-color: #f8f9fa;
|
|
1092
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
1093
|
+
--bs-btn-disabled-color: #f8f9fa;
|
|
1094
|
+
--bs-btn-disabled-bg: transparent;
|
|
1095
|
+
--bs-btn-disabled-border-color: #f8f9fa;
|
|
1096
|
+
--bs-gradient: none;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
.btn-outline-dark {
|
|
1100
|
+
--bs-btn-color: #212529;
|
|
1101
|
+
--bs-btn-border-color: #212529;
|
|
1102
|
+
--bs-btn-hover-color: #fff;
|
|
1103
|
+
--bs-btn-hover-bg: #212529;
|
|
1104
|
+
--bs-btn-hover-border-color: #212529;
|
|
1105
|
+
--bs-btn-focus-shadow-rgb: 33, 37, 41;
|
|
1106
|
+
--bs-btn-active-color: #fff;
|
|
1107
|
+
--bs-btn-active-bg: #212529;
|
|
1108
|
+
--bs-btn-active-border-color: #212529;
|
|
1109
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
1110
|
+
--bs-btn-disabled-color: #212529;
|
|
1111
|
+
--bs-btn-disabled-bg: transparent;
|
|
1112
|
+
--bs-btn-disabled-border-color: #212529;
|
|
1113
|
+
--bs-gradient: none;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
.btn-link {
|
|
1117
|
+
--bs-btn-font-weight: 400;
|
|
1118
|
+
--bs-btn-color: var(--bs-link-color);
|
|
1119
|
+
--bs-btn-bg: transparent;
|
|
1120
|
+
--bs-btn-border-color: transparent;
|
|
1121
|
+
--bs-btn-hover-color: var(--bs-link-hover-color);
|
|
1122
|
+
--bs-btn-hover-border-color: transparent;
|
|
1123
|
+
--bs-btn-active-color: var(--bs-link-hover-color);
|
|
1124
|
+
--bs-btn-active-border-color: transparent;
|
|
1125
|
+
--bs-btn-disabled-color: #6c757d;
|
|
1126
|
+
--bs-btn-disabled-border-color: transparent;
|
|
1127
|
+
--bs-btn-box-shadow: 0 0 0 #000;
|
|
1128
|
+
--bs-btn-focus-shadow-rgb: 49, 132, 253;
|
|
1129
|
+
text-decoration: underline;
|
|
1130
|
+
}
|
|
1131
|
+
.btn-link:focus-visible {
|
|
1132
|
+
color: var(--bs-btn-color);
|
|
1133
|
+
}
|
|
1134
|
+
.btn-link:hover {
|
|
1135
|
+
color: var(--bs-btn-hover-color);
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
.btn-lg {
|
|
1139
|
+
--bs-btn-padding-y: 0.5rem;
|
|
1140
|
+
--bs-btn-padding-x: 1rem;
|
|
1141
|
+
--bs-btn-font-size: 1.25rem;
|
|
1142
|
+
--bs-btn-border-radius: var(--bs-border-radius-lg);
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
.btn-sm {
|
|
1146
|
+
--bs-btn-padding-y: 0.25rem;
|
|
1147
|
+
--bs-btn-padding-x: 0.5rem;
|
|
1148
|
+
--bs-btn-font-size: 0.875rem;
|
|
1149
|
+
--bs-btn-border-radius: var(--bs-border-radius-sm);
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
.form-control {
|
|
1153
|
+
display: block;
|
|
1154
|
+
width: 100%;
|
|
1155
|
+
padding: 0.375rem 0.75rem;
|
|
1156
|
+
font-size: 1rem;
|
|
1157
|
+
font-weight: 400;
|
|
1158
|
+
line-height: 1.5;
|
|
1159
|
+
color: var(--bs-body-color);
|
|
1160
|
+
appearance: none;
|
|
1161
|
+
background-color: var(--bs-body-bg);
|
|
1162
|
+
background-clip: padding-box;
|
|
1163
|
+
border: var(--bs-border-width) solid var(--bs-border-color);
|
|
1164
|
+
border-radius: var(--bs-border-radius);
|
|
1165
|
+
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
1166
|
+
}
|
|
1167
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1168
|
+
.form-control {
|
|
1169
|
+
transition: none;
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
.form-control[type=file] {
|
|
1173
|
+
overflow: hidden;
|
|
1174
|
+
}
|
|
1175
|
+
.form-control[type=file]:not(:disabled):not([readonly]) {
|
|
1176
|
+
cursor: pointer;
|
|
1177
|
+
}
|
|
1178
|
+
.form-control:focus {
|
|
1179
|
+
color: var(--bs-body-color);
|
|
1180
|
+
background-color: var(--bs-body-bg);
|
|
1181
|
+
border-color: rgb(134, 182.5, 254);
|
|
1182
|
+
outline: 0;
|
|
1183
|
+
box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
|
|
1184
|
+
}
|
|
1185
|
+
.form-control::-webkit-date-and-time-value {
|
|
1186
|
+
min-width: 85px;
|
|
1187
|
+
height: 1.5em;
|
|
1188
|
+
margin: 0;
|
|
1189
|
+
}
|
|
1190
|
+
.form-control::-webkit-datetime-edit {
|
|
1191
|
+
display: block;
|
|
1192
|
+
padding: 0;
|
|
1193
|
+
}
|
|
1194
|
+
.form-control::placeholder {
|
|
1195
|
+
color: var(--bs-secondary-color);
|
|
1196
|
+
opacity: 1;
|
|
1197
|
+
}
|
|
1198
|
+
.form-control:disabled {
|
|
1199
|
+
background-color: var(--bs-secondary-bg);
|
|
1200
|
+
opacity: 1;
|
|
1201
|
+
}
|
|
1202
|
+
.form-control::file-selector-button {
|
|
1203
|
+
padding: 0.375rem 0.75rem;
|
|
1204
|
+
margin: -0.375rem -0.75rem;
|
|
1205
|
+
margin-inline-end: 0.75rem;
|
|
1206
|
+
color: var(--bs-body-color);
|
|
1207
|
+
background-color: var(--bs-tertiary-bg);
|
|
1208
|
+
pointer-events: none;
|
|
1209
|
+
border-color: inherit;
|
|
1210
|
+
border-style: solid;
|
|
1211
|
+
border-width: 0;
|
|
1212
|
+
border-inline-end-width: var(--bs-border-width);
|
|
1213
|
+
border-radius: 0;
|
|
1214
|
+
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
1215
|
+
}
|
|
1216
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1217
|
+
.form-control::file-selector-button {
|
|
1218
|
+
transition: none;
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
.form-control:hover:not(:disabled):not([readonly])::file-selector-button {
|
|
1222
|
+
background-color: var(--bs-secondary-bg);
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
.form-control-plaintext {
|
|
1226
|
+
display: block;
|
|
1227
|
+
width: 100%;
|
|
1228
|
+
padding: 0.375rem 0;
|
|
1229
|
+
margin-bottom: 0;
|
|
1230
|
+
line-height: 1.5;
|
|
1231
|
+
color: var(--bs-body-color);
|
|
1232
|
+
background-color: transparent;
|
|
1233
|
+
border: solid transparent;
|
|
1234
|
+
border-width: var(--bs-border-width) 0;
|
|
1235
|
+
}
|
|
1236
|
+
.form-control-plaintext:focus {
|
|
1237
|
+
outline: 0;
|
|
1238
|
+
}
|
|
1239
|
+
.form-control-plaintext.form-control-sm, .form-control-plaintext.form-control-lg {
|
|
1240
|
+
padding-right: 0;
|
|
1241
|
+
padding-left: 0;
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
.form-control-sm {
|
|
1245
|
+
min-height: calc(1.5em + 0.5rem + calc(var(--bs-border-width) * 2));
|
|
1246
|
+
padding: 0.25rem 0.5rem;
|
|
1247
|
+
font-size: 0.875rem;
|
|
1248
|
+
border-radius: var(--bs-border-radius-sm);
|
|
1249
|
+
}
|
|
1250
|
+
.form-control-sm::file-selector-button {
|
|
1251
|
+
padding: 0.25rem 0.5rem;
|
|
1252
|
+
margin: -0.25rem -0.5rem;
|
|
1253
|
+
margin-inline-end: 0.5rem;
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
.form-control-lg {
|
|
1257
|
+
min-height: calc(1.5em + 1rem + calc(var(--bs-border-width) * 2));
|
|
1258
|
+
padding: 0.5rem 1rem;
|
|
1259
|
+
font-size: 1.25rem;
|
|
1260
|
+
border-radius: var(--bs-border-radius-lg);
|
|
1261
|
+
}
|
|
1262
|
+
.form-control-lg::file-selector-button {
|
|
1263
|
+
padding: 0.5rem 1rem;
|
|
1264
|
+
margin: -0.5rem -1rem;
|
|
1265
|
+
margin-inline-end: 1rem;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
textarea.form-control {
|
|
1269
|
+
min-height: calc(1.5em + 0.75rem + calc(var(--bs-border-width) * 2));
|
|
1270
|
+
}
|
|
1271
|
+
textarea.form-control-sm {
|
|
1272
|
+
min-height: calc(1.5em + 0.5rem + calc(var(--bs-border-width) * 2));
|
|
1273
|
+
}
|
|
1274
|
+
textarea.form-control-lg {
|
|
1275
|
+
min-height: calc(1.5em + 1rem + calc(var(--bs-border-width) * 2));
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
.form-control-color {
|
|
1279
|
+
width: 3rem;
|
|
1280
|
+
height: calc(1.5em + 0.75rem + calc(var(--bs-border-width) * 2));
|
|
1281
|
+
padding: 0.375rem;
|
|
1282
|
+
}
|
|
1283
|
+
.form-control-color:not(:disabled):not([readonly]) {
|
|
1284
|
+
cursor: pointer;
|
|
1285
|
+
}
|
|
1286
|
+
.form-control-color::-moz-color-swatch {
|
|
1287
|
+
border: 0 !important;
|
|
1288
|
+
border-radius: var(--bs-border-radius);
|
|
1289
|
+
}
|
|
1290
|
+
.form-control-color::-webkit-color-swatch {
|
|
1291
|
+
border: 0 !important;
|
|
1292
|
+
border-radius: var(--bs-border-radius);
|
|
1293
|
+
}
|
|
1294
|
+
.form-control-color.form-control-sm {
|
|
1295
|
+
height: calc(1.5em + 0.5rem + calc(var(--bs-border-width) * 2));
|
|
1296
|
+
}
|
|
1297
|
+
.form-control-color.form-control-lg {
|
|
1298
|
+
height: calc(1.5em + 1rem + calc(var(--bs-border-width) * 2));
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
.form-select {
|
|
1302
|
+
--bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
|
|
1303
|
+
display: block;
|
|
1304
|
+
width: 100%;
|
|
1305
|
+
padding: 0.375rem 2.25rem 0.375rem 0.75rem;
|
|
1306
|
+
font-size: 1rem;
|
|
1307
|
+
font-weight: 400;
|
|
1308
|
+
line-height: 1.5;
|
|
1309
|
+
color: var(--bs-body-color);
|
|
1310
|
+
appearance: none;
|
|
1311
|
+
background-color: var(--bs-body-bg);
|
|
1312
|
+
background-image: var(--bs-form-select-bg-img), var(--bs-form-select-bg-icon, none);
|
|
1313
|
+
background-repeat: no-repeat;
|
|
1314
|
+
background-position: right 0.75rem center;
|
|
1315
|
+
background-size: 16px 12px;
|
|
1316
|
+
border: var(--bs-border-width) solid var(--bs-border-color);
|
|
1317
|
+
border-radius: var(--bs-border-radius);
|
|
1318
|
+
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
1319
|
+
}
|
|
1320
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1321
|
+
.form-select {
|
|
1322
|
+
transition: none;
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
.form-select:focus {
|
|
1326
|
+
border-color: rgb(134, 182.5, 254);
|
|
1327
|
+
outline: 0;
|
|
1328
|
+
box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
|
|
1329
|
+
}
|
|
1330
|
+
.form-select[multiple], .form-select[size]:not([size="1"]) {
|
|
1331
|
+
padding-right: 0.75rem;
|
|
1332
|
+
background-image: none;
|
|
1333
|
+
}
|
|
1334
|
+
.form-select:disabled {
|
|
1335
|
+
background-color: var(--bs-secondary-bg);
|
|
1336
|
+
}
|
|
1337
|
+
.form-select:-moz-focusring {
|
|
1338
|
+
color: transparent;
|
|
1339
|
+
text-shadow: 0 0 0 var(--bs-body-color);
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
.form-select-sm {
|
|
1343
|
+
padding-top: 0.25rem;
|
|
1344
|
+
padding-bottom: 0.25rem;
|
|
1345
|
+
padding-left: 0.5rem;
|
|
1346
|
+
font-size: 0.875rem;
|
|
1347
|
+
border-radius: var(--bs-border-radius-sm);
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
.form-select-lg {
|
|
1351
|
+
padding-top: 0.5rem;
|
|
1352
|
+
padding-bottom: 0.5rem;
|
|
1353
|
+
padding-left: 1rem;
|
|
1354
|
+
font-size: 1.25rem;
|
|
1355
|
+
border-radius: var(--bs-border-radius-lg);
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
[data-bs-theme=dark] .form-select {
|
|
1359
|
+
--bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
:host {
|
|
1363
|
+
display: block;
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
.qb-condition {
|
|
1367
|
+
display: flex;
|
|
1368
|
+
align-items: center;
|
|
1369
|
+
gap: 0.5rem;
|
|
1370
|
+
padding: 0.25rem 0;
|
|
1371
|
+
font-size: 0.875rem;
|
|
1372
|
+
flex-wrap: wrap;
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
.qb-field-select,
|
|
1376
|
+
.qb-operator-select {
|
|
1377
|
+
display: inline-block;
|
|
1378
|
+
width: auto;
|
|
1379
|
+
min-width: 8rem;
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
.qb-remove {
|
|
1383
|
+
flex: 0 0 auto;
|
|
1384
|
+
margin-left: auto;
|
|
1385
|
+
padding: 0 0.5rem;
|
|
1386
|
+
line-height: 1;
|
|
1387
|
+
font-size: 1rem;
|
|
1388
|
+
color: var(--bs-danger, #dc3545);
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
.qb-drag-handle {
|
|
1392
|
+
flex: 0 0 auto;
|
|
1393
|
+
display: inline-flex;
|
|
1394
|
+
align-items: center;
|
|
1395
|
+
justify-content: center;
|
|
1396
|
+
width: 1rem;
|
|
1397
|
+
height: 1.25rem;
|
|
1398
|
+
padding: 0;
|
|
1399
|
+
background: transparent;
|
|
1400
|
+
border: 0;
|
|
1401
|
+
color: var(--bs-secondary-color, #6c757d);
|
|
1402
|
+
cursor: grab;
|
|
1403
|
+
font-size: 1rem;
|
|
1404
|
+
line-height: 1;
|
|
1405
|
+
touch-action: none;
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
.qb-drag-handle:active {
|
|
1409
|
+
cursor: grabbing;
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
.qb-drag-handle:disabled {
|
|
1413
|
+
cursor: not-allowed;
|
|
1414
|
+
opacity: 0.5;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
.qb-field {
|
|
1418
|
+
font-weight: 600;
|
|
1419
|
+
color: var(--bs-body-color, currentColor);
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
.qb-operator {
|
|
1423
|
+
color: var(--bs-secondary-color, #6c757d);
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
.qb-value {
|
|
1427
|
+
color: var(--bs-primary-text-emphasis, #084298);
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
.qb-value-list {
|
|
1431
|
+
display: inline-flex;
|
|
1432
|
+
gap: 0.25rem;
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
.qb-value-pill {
|
|
1436
|
+
display: inline-block;
|
|
1437
|
+
padding: 0 0.375rem;
|
|
1438
|
+
background: var(--bs-info-bg-subtle, #cff4fc);
|
|
1439
|
+
color: var(--bs-info-text-emphasis, #055160);
|
|
1440
|
+
border-radius: var(--bs-border-radius-sm, 0.25rem);
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
.qb-missing {
|
|
1444
|
+
color: var(--bs-danger-text-emphasis, #842029);
|
|
1445
|
+
font-style: italic;
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
.qb-editor-input {
|
|
1449
|
+
display: inline-block;
|
|
1450
|
+
width: auto;
|
|
1451
|
+
min-width: 6rem;
|
|
1452
|
+
vertical-align: middle;
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
.qb-editor-n-input {
|
|
1456
|
+
min-width: 4rem;
|
|
1457
|
+
max-width: 6rem;
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
.qb-editor-select,
|
|
1461
|
+
.qb-editor-multiselect {
|
|
1462
|
+
display: inline-block;
|
|
1463
|
+
width: auto;
|
|
1464
|
+
min-width: 8rem;
|
|
1465
|
+
vertical-align: middle;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
.qb-editor-tuple {
|
|
1469
|
+
display: inline-flex;
|
|
1470
|
+
align-items: center;
|
|
1471
|
+
gap: 0.25rem;
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
.qb-editor-tuple-sep {
|
|
1475
|
+
color: var(--bs-secondary-color, #6c757d);
|
|
1476
|
+
font-size: 0.875rem;
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
.qb-editor-chip-input {
|
|
1480
|
+
display: inline-flex;
|
|
1481
|
+
flex-wrap: wrap;
|
|
1482
|
+
align-items: center;
|
|
1483
|
+
gap: 0.25rem;
|
|
1484
|
+
padding: 0.125rem;
|
|
1485
|
+
border: 1px solid var(--bs-border-color, #dee2e6);
|
|
1486
|
+
border-radius: var(--bs-border-radius-sm, 0.25rem);
|
|
1487
|
+
background: var(--bs-body-bg, transparent);
|
|
1488
|
+
min-height: 1.75rem;
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
.qb-editor-chip {
|
|
1492
|
+
display: inline-flex;
|
|
1493
|
+
align-items: center;
|
|
1494
|
+
gap: 0.25rem;
|
|
1495
|
+
padding: 0 0.375rem;
|
|
1496
|
+
background: var(--bs-info-bg-subtle, #cff4fc);
|
|
1497
|
+
color: var(--bs-info-text-emphasis, #055160);
|
|
1498
|
+
border-radius: var(--bs-border-radius-sm, 0.25rem);
|
|
1499
|
+
font-size: 0.75rem;
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
.qb-editor-chip-remove {
|
|
1503
|
+
background: transparent;
|
|
1504
|
+
border: 0;
|
|
1505
|
+
padding: 0 0.125rem;
|
|
1506
|
+
color: inherit;
|
|
1507
|
+
cursor: pointer;
|
|
1508
|
+
line-height: 1;
|
|
1509
|
+
font-size: 0.875rem;
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
.qb-editor-chip-remove:disabled {
|
|
1513
|
+
cursor: not-allowed;
|
|
1514
|
+
opacity: 0.5;
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
.qb-editor-chip-add {
|
|
1518
|
+
display: inline-block;
|
|
1519
|
+
width: auto;
|
|
1520
|
+
border: 0;
|
|
1521
|
+
padding: 0 0.25rem;
|
|
1522
|
+
font-size: 0.875rem;
|
|
1523
|
+
background: transparent;
|
|
1524
|
+
min-width: 4rem;
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
.qb-editor-chip-add:focus {
|
|
1528
|
+
outline: none;
|
|
1529
|
+
box-shadow: none;
|
|
1530
|
+
}`);
|
|
1531
|
+
class ze extends S {
|
|
1532
|
+
constructor() {
|
|
1533
|
+
super(...arguments), this.node = null, this.schema = [], this.currentEntity = "", this._messagesConsumer = new p(this, {
|
|
1534
|
+
context: q,
|
|
1535
|
+
subscribe: !0
|
|
1536
|
+
}), this._disabledConsumer = new p(this, {
|
|
1537
|
+
context: E,
|
|
1538
|
+
subscribe: !0
|
|
1539
|
+
}), this._registryConsumer = new p(this, {
|
|
1540
|
+
context: F,
|
|
1541
|
+
subscribe: !0
|
|
1542
|
+
}), this._editorMount = ee(), this._currentHandle = null, this._editorKey = "", this._registryTokens = /* @__PURE__ */ new WeakMap(), this._nextRegistryToken = 1, this._onFieldChange = (e) => {
|
|
1543
|
+
const t = e.target, r = this.node;
|
|
1544
|
+
r && this.dispatchEvent(new CustomEvent("condition-field-change", {
|
|
1545
|
+
detail: { id: r.id, field: t.value },
|
|
1546
|
+
bubbles: !0,
|
|
1547
|
+
composed: !0
|
|
1548
|
+
}));
|
|
1549
|
+
}, this._onOperatorChange = (e) => {
|
|
1550
|
+
const t = e.target, r = this.node;
|
|
1551
|
+
r && this.dispatchEvent(new CustomEvent("condition-operator-change", {
|
|
1552
|
+
detail: { id: r.id, operator: t.value },
|
|
1553
|
+
bubbles: !0,
|
|
1554
|
+
composed: !0
|
|
1555
|
+
}));
|
|
1556
|
+
}, this._onRemove = () => {
|
|
1557
|
+
const e = this.node;
|
|
1558
|
+
e && this.dispatchEvent(new CustomEvent("node-remove", {
|
|
1559
|
+
detail: { id: e.id },
|
|
1560
|
+
bubbles: !0,
|
|
1561
|
+
composed: !0
|
|
1562
|
+
}));
|
|
1563
|
+
}, this._onRowKeyDown = (e) => {
|
|
1564
|
+
if (!e.altKey || e.key !== "ArrowUp" && e.key !== "ArrowDown") return;
|
|
1565
|
+
const t = this.node;
|
|
1566
|
+
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", {
|
|
1569
|
+
detail: { id: t.id, direction: e.key === "ArrowUp" ? "up" : "down" },
|
|
1570
|
+
bubbles: !0,
|
|
1571
|
+
composed: !0
|
|
1572
|
+
})));
|
|
1573
|
+
}, this._onDragPointerDown = (e) => {
|
|
1574
|
+
if (this.isDisabled()) return;
|
|
1575
|
+
const t = this.node;
|
|
1576
|
+
if (!t) return;
|
|
1577
|
+
const r = this.shadowRoot?.querySelector(".qb-condition");
|
|
1578
|
+
r && this.dispatchEvent(new CustomEvent("qb-drag-start", {
|
|
1579
|
+
detail: {
|
|
1580
|
+
id: t.id,
|
|
1581
|
+
pointerId: e.pointerId,
|
|
1582
|
+
clientX: e.clientX,
|
|
1583
|
+
clientY: e.clientY,
|
|
1584
|
+
rowElement: r
|
|
1585
|
+
},
|
|
1586
|
+
bubbles: !0,
|
|
1587
|
+
composed: !0
|
|
1588
|
+
}));
|
|
1589
|
+
};
|
|
1590
|
+
}
|
|
1591
|
+
static {
|
|
1592
|
+
this.styles = [Ae];
|
|
1593
|
+
}
|
|
1594
|
+
static {
|
|
1595
|
+
this.properties = {
|
|
1596
|
+
node: { attribute: !1 },
|
|
1597
|
+
schema: { attribute: !1 },
|
|
1598
|
+
currentEntity: { attribute: !1 }
|
|
1599
|
+
};
|
|
1600
|
+
}
|
|
1601
|
+
_registryIdentityToken(e) {
|
|
1602
|
+
if (!e) return 0;
|
|
1603
|
+
const t = this._registryTokens.get(e);
|
|
1604
|
+
if (t !== void 0) return t;
|
|
1605
|
+
const r = this._nextRegistryToken++;
|
|
1606
|
+
return this._registryTokens.set(e, r), r;
|
|
1607
|
+
}
|
|
1608
|
+
disconnectedCallback() {
|
|
1609
|
+
super.disconnectedCallback(), this._disposeEditor();
|
|
1610
|
+
}
|
|
1611
|
+
_disposeEditor() {
|
|
1612
|
+
const e = this._currentHandle;
|
|
1613
|
+
if (e) {
|
|
1614
|
+
try {
|
|
1615
|
+
e.dispose?.();
|
|
1616
|
+
} catch {
|
|
1617
|
+
}
|
|
1618
|
+
e.element.remove(), this._currentHandle = null;
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
resolveField(e) {
|
|
1622
|
+
return this.schema.find((t) => t.name === this.currentEntity)?.fields.find((t) => t.name === e);
|
|
1623
|
+
}
|
|
1624
|
+
messages() {
|
|
1625
|
+
const e = this._messagesConsumer.value ?? {};
|
|
1626
|
+
return {
|
|
1627
|
+
...m,
|
|
1628
|
+
...e,
|
|
1629
|
+
operators: { ...m.operators, ...e.operators ?? {} }
|
|
1630
|
+
};
|
|
1631
|
+
}
|
|
1632
|
+
isDisabled() {
|
|
1633
|
+
return this._disabledConsumer.value ?? !1;
|
|
1634
|
+
}
|
|
1635
|
+
updated(e) {
|
|
1636
|
+
this._refreshEditor();
|
|
1637
|
+
}
|
|
1638
|
+
_refreshEditor() {
|
|
1639
|
+
const e = this._editorMount.value;
|
|
1640
|
+
if (!e) return;
|
|
1641
|
+
const t = this.node;
|
|
1642
|
+
if (!t) {
|
|
1643
|
+
this._disposeEditor();
|
|
1644
|
+
return;
|
|
1645
|
+
}
|
|
1646
|
+
const r = this.resolveField(t.field);
|
|
1647
|
+
if (!r) {
|
|
1648
|
+
this._disposeEditor();
|
|
1649
|
+
return;
|
|
1650
|
+
}
|
|
1651
|
+
if (g(t.operator) === "null") {
|
|
1652
|
+
this._disposeEditor();
|
|
1653
|
+
return;
|
|
1654
|
+
}
|
|
1655
|
+
const s = this.isDisabled(), b = this._registryConsumer.value, i = b?.[r.name], a = i ? `r${this._registryIdentityToken(b)}` : "b", l = `${r.name}|${t.operator}|${s ? "1" : "0"}|${a}`;
|
|
1656
|
+
if (this._currentHandle && l === this._editorKey) return;
|
|
1657
|
+
this._disposeEditor();
|
|
1658
|
+
const c = i ?? Re(r, t.operator);
|
|
1659
|
+
if (!c) return;
|
|
1660
|
+
const h = {
|
|
1661
|
+
field: r,
|
|
1662
|
+
operator: t.operator,
|
|
1663
|
+
value: t.value,
|
|
1664
|
+
disabled: s,
|
|
1665
|
+
onChange: (A) => {
|
|
1666
|
+
this.dispatchEvent(new CustomEvent("condition-value-change", {
|
|
1667
|
+
detail: { id: t.id, value: A },
|
|
1668
|
+
bubbles: !0,
|
|
1669
|
+
composed: !0
|
|
1670
|
+
}));
|
|
1671
|
+
}
|
|
1672
|
+
}, f = c(h);
|
|
1673
|
+
e.appendChild(f.element), this._currentHandle = f, this._editorKey = l;
|
|
1674
|
+
}
|
|
1675
|
+
_availableFields() {
|
|
1676
|
+
return this.schema.find((e) => e.name === this.currentEntity)?.fields.filter((e) => e.type !== "relation") ?? [];
|
|
1677
|
+
}
|
|
1678
|
+
_availableOperators(e) {
|
|
1679
|
+
return e ? y(e.type) : [];
|
|
1680
|
+
}
|
|
1681
|
+
render() {
|
|
1682
|
+
const e = this.node;
|
|
1683
|
+
if (!e) return u;
|
|
1684
|
+
const t = this.resolveField(e.field), r = this.messages(), n = g(e.operator), s = this.isDisabled(), b = this._availableFields(), i = this._availableOperators(t);
|
|
1685
|
+
return d`
|
|
1686
|
+
<div
|
|
1687
|
+
class="qb-condition"
|
|
1688
|
+
part="condition"
|
|
1689
|
+
tabindex="0"
|
|
1690
|
+
data-row-id=${e.id}
|
|
1691
|
+
@keydown=${this._onRowKeyDown}
|
|
1692
|
+
>
|
|
1693
|
+
<button
|
|
1694
|
+
type="button"
|
|
1695
|
+
class="qb-drag-handle"
|
|
1696
|
+
part="drag-handle"
|
|
1697
|
+
?disabled=${s}
|
|
1698
|
+
aria-label="Drag or use Alt+Up/Down to reorder"
|
|
1699
|
+
title="Drag or use Alt+Up/Down to reorder"
|
|
1700
|
+
@pointerdown=${this._onDragPointerDown}
|
|
1701
|
+
>⋮</button>
|
|
1702
|
+
<mp-select
|
|
1703
|
+
class="qb-field-select"
|
|
1704
|
+
size="sm"
|
|
1705
|
+
part="field-select"
|
|
1706
|
+
.value=${e.field}
|
|
1707
|
+
?disabled=${s}
|
|
1708
|
+
@change=${this._onFieldChange}
|
|
1709
|
+
aria-label="Field"
|
|
1710
|
+
>
|
|
1711
|
+
${b.map((a) => d`<option value=${a.name}>${a.label}</option>`)}
|
|
1712
|
+
${t ? u : d`<option value=${e.field}>(${e.field})</option>`}
|
|
1713
|
+
</mp-select>
|
|
1714
|
+
<mp-select
|
|
1715
|
+
class="qb-operator-select"
|
|
1716
|
+
size="sm"
|
|
1717
|
+
part="operator-select"
|
|
1718
|
+
.value=${e.operator}
|
|
1719
|
+
?disabled=${s || !t}
|
|
1720
|
+
@change=${this._onOperatorChange}
|
|
1721
|
+
aria-label="Operator"
|
|
1722
|
+
>
|
|
1723
|
+
${i.map((a) => d`
|
|
1724
|
+
<option value=${a}>${r.operators[a] ?? a}</option>
|
|
1725
|
+
`)}
|
|
1726
|
+
${i.includes(e.operator) ? u : d`<option value=${e.operator}>${e.operator}</option>`}
|
|
1727
|
+
</mp-select>
|
|
1728
|
+
${n === "null" ? u : d`<span class="qb-value" part="value" ${te(this._editorMount)}></span>`}
|
|
1729
|
+
<button
|
|
1730
|
+
type="button"
|
|
1731
|
+
class="btn btn-sm btn-link qb-remove"
|
|
1732
|
+
part="remove"
|
|
1733
|
+
?disabled=${s}
|
|
1734
|
+
@click=${this._onRemove}
|
|
1735
|
+
aria-label="Remove condition"
|
|
1736
|
+
title="Remove"
|
|
1737
|
+
>×</button>
|
|
1738
|
+
</div>
|
|
1739
|
+
`;
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
typeof customElements < "u" && !customElements.get("mp-query-condition") && customElements.define("mp-query-condition", ze);
|
|
1743
|
+
d`<!-- Rendered dynamically by render(). Codegen-wc emits styles from the
|
|
1744
|
+
sibling .scss; the template export is intentionally unused. -->`;
|
|
1745
|
+
const Me = D(`:host {
|
|
1746
|
+
display: block;
|
|
1747
|
+
margin: 0.25rem 0;
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
.qb-subquery {
|
|
1751
|
+
border: 1px dashed var(--bs-border-color, #dee2e6);
|
|
1752
|
+
border-radius: var(--bs-border-radius, 0.375rem);
|
|
1753
|
+
padding: 0.5rem;
|
|
1754
|
+
background: var(--bs-tertiary-bg, #f8f9fa);
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
.qb-subquery-header {
|
|
1758
|
+
display: flex;
|
|
1759
|
+
align-items: center;
|
|
1760
|
+
gap: 0.5rem;
|
|
1761
|
+
font-size: 0.875rem;
|
|
1762
|
+
margin-bottom: 0.5rem;
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
.qb-subquery-field {
|
|
1766
|
+
font-weight: 600;
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
.qb-subquery-operator {
|
|
1770
|
+
color: var(--bs-secondary-color, #6c757d);
|
|
1771
|
+
text-transform: lowercase;
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1774
|
+
.qb-subquery-target {
|
|
1775
|
+
font-style: italic;
|
|
1776
|
+
color: var(--bs-secondary-color, #6c757d);
|
|
1777
|
+
}`);
|
|
1778
|
+
class Pe extends S {
|
|
1779
|
+
constructor() {
|
|
1780
|
+
super(...arguments), this.node = null, this.schema = [], this.currentEntity = "", this.depth = 0, this.qbRoot = "", this.isDragging = !1, this._messagesConsumer = new p(this, {
|
|
1781
|
+
context: q,
|
|
1782
|
+
subscribe: !0
|
|
1783
|
+
}), this._onHeaderKeyDown = (e) => {
|
|
1784
|
+
if (!e.altKey || e.key !== "ArrowUp" && e.key !== "ArrowDown") return;
|
|
1785
|
+
const t = this.node;
|
|
1786
|
+
if (!t) return;
|
|
1787
|
+
const r = this.shadowRoot?.querySelector(".qb-subquery-header");
|
|
1788
|
+
e.composedPath()[0] === r && (e.preventDefault(), this.dispatchEvent(new CustomEvent("qb-keyboard-move", {
|
|
1789
|
+
detail: { id: t.id, direction: e.key === "ArrowUp" ? "up" : "down" },
|
|
1790
|
+
bubbles: !0,
|
|
1791
|
+
composed: !0
|
|
1792
|
+
})));
|
|
1793
|
+
};
|
|
1794
|
+
}
|
|
1795
|
+
static {
|
|
1796
|
+
this.styles = [Me];
|
|
1797
|
+
}
|
|
1798
|
+
static {
|
|
1799
|
+
this.properties = {
|
|
1800
|
+
node: { attribute: !1 },
|
|
1801
|
+
schema: { attribute: !1 },
|
|
1802
|
+
currentEntity: { attribute: !1 },
|
|
1803
|
+
depth: { attribute: !1 },
|
|
1804
|
+
qbRoot: { attribute: !1 },
|
|
1805
|
+
isDragging: { attribute: !1 }
|
|
1806
|
+
};
|
|
1807
|
+
}
|
|
1808
|
+
resolveField(e) {
|
|
1809
|
+
return this.schema.find((t) => t.name === this.currentEntity)?.fields.find((t) => t.name === e);
|
|
1810
|
+
}
|
|
1811
|
+
messages() {
|
|
1812
|
+
const e = this._messagesConsumer.value ?? {};
|
|
1813
|
+
return {
|
|
1814
|
+
...m,
|
|
1815
|
+
...e,
|
|
1816
|
+
operators: { ...m.operators, ...e.operators ?? {} }
|
|
1817
|
+
};
|
|
1818
|
+
}
|
|
1819
|
+
render() {
|
|
1820
|
+
const e = this.node;
|
|
1821
|
+
if (!e) return u;
|
|
1822
|
+
const t = this.resolveField(e.field), r = this.messages(), n = t?.label ?? e.field, s = r.operators[e.operator] ?? e.operator, b = t?.targetEntity ?? "";
|
|
1823
|
+
return d`
|
|
1824
|
+
<div class="qb-subquery" part="subquery" data-row-id=${e.id}>
|
|
1825
|
+
<div
|
|
1826
|
+
class="qb-subquery-header"
|
|
1827
|
+
part="subquery-header"
|
|
1828
|
+
tabindex="0"
|
|
1829
|
+
@keydown=${this._onHeaderKeyDown}
|
|
1830
|
+
>
|
|
1831
|
+
<span class="qb-subquery-field">${n}</span>
|
|
1832
|
+
<span class="qb-subquery-operator">${s}</span>
|
|
1833
|
+
${b ? d`<span class="qb-subquery-target">(${b})</span>` : u}
|
|
1834
|
+
</div>
|
|
1835
|
+
<mp-query-builder
|
|
1836
|
+
.query=${e.subQuery}
|
|
1837
|
+
.schema=${this.schema}
|
|
1838
|
+
.rootEntity=${b}
|
|
1839
|
+
.depth=${this.depth + 1}
|
|
1840
|
+
part="subquery-builder"
|
|
1841
|
+
></mp-query-builder>
|
|
1842
|
+
</div>
|
|
1843
|
+
`;
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
typeof customElements < "u" && !customElements.get("mp-query-subquery") && customElements.define("mp-query-subquery", Pe);
|
|
1847
|
+
d`<!-- Rendered dynamically by render(). Codegen-wc emits styles from the
|
|
1848
|
+
sibling .scss; the template export is intentionally unused. -->`;
|
|
1849
|
+
const Te = D(`.btn {
|
|
1850
|
+
--bs-btn-padding-x: 0.75rem;
|
|
1851
|
+
--bs-btn-padding-y: 0.375rem;
|
|
1852
|
+
--bs-btn-font-family: ;
|
|
1853
|
+
--bs-btn-font-size: 1rem;
|
|
1854
|
+
--bs-btn-font-weight: 400;
|
|
1855
|
+
--bs-btn-line-height: 1.5;
|
|
1856
|
+
--bs-btn-color: var(--bs-body-color);
|
|
1857
|
+
--bs-btn-bg: transparent;
|
|
1858
|
+
--bs-btn-border-width: var(--bs-border-width);
|
|
1859
|
+
--bs-btn-border-color: transparent;
|
|
1860
|
+
--bs-btn-border-radius: var(--bs-border-radius);
|
|
1861
|
+
--bs-btn-hover-border-color: transparent;
|
|
1862
|
+
--bs-btn-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);
|
|
1863
|
+
--bs-btn-disabled-opacity: 0.65;
|
|
1864
|
+
--bs-btn-focus-box-shadow: 0 0 0 0.25rem rgba(var(--bs-btn-focus-shadow-rgb), .5);
|
|
1865
|
+
display: inline-block;
|
|
1866
|
+
padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x);
|
|
1867
|
+
font-family: var(--bs-btn-font-family);
|
|
1868
|
+
font-size: var(--bs-btn-font-size);
|
|
1869
|
+
font-weight: var(--bs-btn-font-weight);
|
|
1870
|
+
line-height: var(--bs-btn-line-height);
|
|
1871
|
+
color: var(--bs-btn-color);
|
|
1872
|
+
text-align: center;
|
|
1873
|
+
text-decoration: none;
|
|
1874
|
+
vertical-align: middle;
|
|
1875
|
+
cursor: pointer;
|
|
1876
|
+
user-select: none;
|
|
1877
|
+
border: var(--bs-btn-border-width) solid var(--bs-btn-border-color);
|
|
1878
|
+
border-radius: var(--bs-btn-border-radius);
|
|
1879
|
+
background-color: var(--bs-btn-bg);
|
|
1880
|
+
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
1881
|
+
}
|
|
1882
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1883
|
+
.btn {
|
|
1884
|
+
transition: none;
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
.btn:hover {
|
|
1888
|
+
color: var(--bs-btn-hover-color);
|
|
1889
|
+
background-color: var(--bs-btn-hover-bg);
|
|
1890
|
+
border-color: var(--bs-btn-hover-border-color);
|
|
1891
|
+
}
|
|
1892
|
+
.btn-check + .btn:hover {
|
|
1893
|
+
color: var(--bs-btn-color);
|
|
1894
|
+
background-color: var(--bs-btn-bg);
|
|
1895
|
+
border-color: var(--bs-btn-border-color);
|
|
1896
|
+
}
|
|
1897
|
+
.btn:focus-visible {
|
|
1898
|
+
color: var(--bs-btn-hover-color);
|
|
1899
|
+
background-color: var(--bs-btn-hover-bg);
|
|
1900
|
+
border-color: var(--bs-btn-hover-border-color);
|
|
1901
|
+
outline: 0;
|
|
1902
|
+
box-shadow: var(--bs-btn-focus-box-shadow);
|
|
1903
|
+
}
|
|
1904
|
+
.btn-check:focus-visible + .btn {
|
|
1905
|
+
border-color: var(--bs-btn-hover-border-color);
|
|
1906
|
+
outline: 0;
|
|
1907
|
+
box-shadow: var(--bs-btn-focus-box-shadow);
|
|
1908
|
+
}
|
|
1909
|
+
.btn-check:checked + .btn, :not(.btn-check) + .btn:active, .btn:first-child:active, .btn.active, .btn.show {
|
|
1910
|
+
color: var(--bs-btn-active-color);
|
|
1911
|
+
background-color: var(--bs-btn-active-bg);
|
|
1912
|
+
border-color: var(--bs-btn-active-border-color);
|
|
1913
|
+
}
|
|
1914
|
+
.btn-check:checked + .btn:focus-visible, :not(.btn-check) + .btn:active:focus-visible, .btn:first-child:active:focus-visible, .btn.active:focus-visible, .btn.show:focus-visible {
|
|
1915
|
+
box-shadow: var(--bs-btn-focus-box-shadow);
|
|
1916
|
+
}
|
|
1917
|
+
.btn-check:checked:focus-visible + .btn {
|
|
1918
|
+
box-shadow: var(--bs-btn-focus-box-shadow);
|
|
1919
|
+
}
|
|
1920
|
+
.btn:disabled, .btn.disabled, fieldset:disabled .btn {
|
|
1921
|
+
color: var(--bs-btn-disabled-color);
|
|
1922
|
+
pointer-events: none;
|
|
1923
|
+
background-color: var(--bs-btn-disabled-bg);
|
|
1924
|
+
border-color: var(--bs-btn-disabled-border-color);
|
|
1925
|
+
opacity: var(--bs-btn-disabled-opacity);
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
.btn-primary {
|
|
1929
|
+
--bs-btn-color: #fff;
|
|
1930
|
+
--bs-btn-bg: #0d6efd;
|
|
1931
|
+
--bs-btn-border-color: #0d6efd;
|
|
1932
|
+
--bs-btn-hover-color: #fff;
|
|
1933
|
+
--bs-btn-hover-bg: rgb(11.05, 93.5, 215.05);
|
|
1934
|
+
--bs-btn-hover-border-color: rgb(10.4, 88, 202.4);
|
|
1935
|
+
--bs-btn-focus-shadow-rgb: 49, 132, 253;
|
|
1936
|
+
--bs-btn-active-color: #fff;
|
|
1937
|
+
--bs-btn-active-bg: rgb(10.4, 88, 202.4);
|
|
1938
|
+
--bs-btn-active-border-color: rgb(9.75, 82.5, 189.75);
|
|
1939
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
1940
|
+
--bs-btn-disabled-color: #fff;
|
|
1941
|
+
--bs-btn-disabled-bg: #0d6efd;
|
|
1942
|
+
--bs-btn-disabled-border-color: #0d6efd;
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
.btn-secondary {
|
|
1946
|
+
--bs-btn-color: #fff;
|
|
1947
|
+
--bs-btn-bg: #6c757d;
|
|
1948
|
+
--bs-btn-border-color: #6c757d;
|
|
1949
|
+
--bs-btn-hover-color: #fff;
|
|
1950
|
+
--bs-btn-hover-bg: rgb(91.8, 99.45, 106.25);
|
|
1951
|
+
--bs-btn-hover-border-color: rgb(86.4, 93.6, 100);
|
|
1952
|
+
--bs-btn-focus-shadow-rgb: 130, 138, 145;
|
|
1953
|
+
--bs-btn-active-color: #fff;
|
|
1954
|
+
--bs-btn-active-bg: rgb(86.4, 93.6, 100);
|
|
1955
|
+
--bs-btn-active-border-color: rgb(81, 87.75, 93.75);
|
|
1956
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
1957
|
+
--bs-btn-disabled-color: #fff;
|
|
1958
|
+
--bs-btn-disabled-bg: #6c757d;
|
|
1959
|
+
--bs-btn-disabled-border-color: #6c757d;
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
.btn-success {
|
|
1963
|
+
--bs-btn-color: #fff;
|
|
1964
|
+
--bs-btn-bg: #198754;
|
|
1965
|
+
--bs-btn-border-color: #198754;
|
|
1966
|
+
--bs-btn-hover-color: #fff;
|
|
1967
|
+
--bs-btn-hover-bg: rgb(21.25, 114.75, 71.4);
|
|
1968
|
+
--bs-btn-hover-border-color: rgb(20, 108, 67.2);
|
|
1969
|
+
--bs-btn-focus-shadow-rgb: 60, 153, 110;
|
|
1970
|
+
--bs-btn-active-color: #fff;
|
|
1971
|
+
--bs-btn-active-bg: rgb(20, 108, 67.2);
|
|
1972
|
+
--bs-btn-active-border-color: rgb(18.75, 101.25, 63);
|
|
1973
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
1974
|
+
--bs-btn-disabled-color: #fff;
|
|
1975
|
+
--bs-btn-disabled-bg: #198754;
|
|
1976
|
+
--bs-btn-disabled-border-color: #198754;
|
|
1977
|
+
}
|
|
1978
|
+
|
|
1979
|
+
.btn-info {
|
|
1980
|
+
--bs-btn-color: #000;
|
|
1981
|
+
--bs-btn-bg: #0dcaf0;
|
|
1982
|
+
--bs-btn-border-color: #0dcaf0;
|
|
1983
|
+
--bs-btn-hover-color: #000;
|
|
1984
|
+
--bs-btn-hover-bg: rgb(49.3, 209.95, 242.25);
|
|
1985
|
+
--bs-btn-hover-border-color: rgb(37.2, 207.3, 241.5);
|
|
1986
|
+
--bs-btn-focus-shadow-rgb: 11, 172, 204;
|
|
1987
|
+
--bs-btn-active-color: #000;
|
|
1988
|
+
--bs-btn-active-bg: rgb(61.4, 212.6, 243);
|
|
1989
|
+
--bs-btn-active-border-color: rgb(37.2, 207.3, 241.5);
|
|
1990
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
1991
|
+
--bs-btn-disabled-color: #000;
|
|
1992
|
+
--bs-btn-disabled-bg: #0dcaf0;
|
|
1993
|
+
--bs-btn-disabled-border-color: #0dcaf0;
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
.btn-warning {
|
|
1997
|
+
--bs-btn-color: #000;
|
|
1998
|
+
--bs-btn-bg: #ffc107;
|
|
1999
|
+
--bs-btn-border-color: #ffc107;
|
|
2000
|
+
--bs-btn-hover-color: #000;
|
|
2001
|
+
--bs-btn-hover-bg: rgb(255, 202.3, 44.2);
|
|
2002
|
+
--bs-btn-hover-border-color: rgb(255, 199.2, 31.8);
|
|
2003
|
+
--bs-btn-focus-shadow-rgb: 217, 164, 6;
|
|
2004
|
+
--bs-btn-active-color: #000;
|
|
2005
|
+
--bs-btn-active-bg: rgb(255, 205.4, 56.6);
|
|
2006
|
+
--bs-btn-active-border-color: rgb(255, 199.2, 31.8);
|
|
2007
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2008
|
+
--bs-btn-disabled-color: #000;
|
|
2009
|
+
--bs-btn-disabled-bg: #ffc107;
|
|
2010
|
+
--bs-btn-disabled-border-color: #ffc107;
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2013
|
+
.btn-danger {
|
|
2014
|
+
--bs-btn-color: #fff;
|
|
2015
|
+
--bs-btn-bg: #dc3545;
|
|
2016
|
+
--bs-btn-border-color: #dc3545;
|
|
2017
|
+
--bs-btn-hover-color: #fff;
|
|
2018
|
+
--bs-btn-hover-bg: rgb(187, 45.05, 58.65);
|
|
2019
|
+
--bs-btn-hover-border-color: rgb(176, 42.4, 55.2);
|
|
2020
|
+
--bs-btn-focus-shadow-rgb: 225, 83, 97;
|
|
2021
|
+
--bs-btn-active-color: #fff;
|
|
2022
|
+
--bs-btn-active-bg: rgb(176, 42.4, 55.2);
|
|
2023
|
+
--bs-btn-active-border-color: rgb(165, 39.75, 51.75);
|
|
2024
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2025
|
+
--bs-btn-disabled-color: #fff;
|
|
2026
|
+
--bs-btn-disabled-bg: #dc3545;
|
|
2027
|
+
--bs-btn-disabled-border-color: #dc3545;
|
|
2028
|
+
}
|
|
2029
|
+
|
|
2030
|
+
.btn-light {
|
|
2031
|
+
--bs-btn-color: #000;
|
|
2032
|
+
--bs-btn-bg: #f8f9fa;
|
|
2033
|
+
--bs-btn-border-color: #f8f9fa;
|
|
2034
|
+
--bs-btn-hover-color: #000;
|
|
2035
|
+
--bs-btn-hover-bg: rgb(210.8, 211.65, 212.5);
|
|
2036
|
+
--bs-btn-hover-border-color: rgb(198.4, 199.2, 200);
|
|
2037
|
+
--bs-btn-focus-shadow-rgb: 211, 212, 213;
|
|
2038
|
+
--bs-btn-active-color: #000;
|
|
2039
|
+
--bs-btn-active-bg: rgb(198.4, 199.2, 200);
|
|
2040
|
+
--bs-btn-active-border-color: rgb(186, 186.75, 187.5);
|
|
2041
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2042
|
+
--bs-btn-disabled-color: #000;
|
|
2043
|
+
--bs-btn-disabled-bg: #f8f9fa;
|
|
2044
|
+
--bs-btn-disabled-border-color: #f8f9fa;
|
|
2045
|
+
}
|
|
2046
|
+
|
|
2047
|
+
.btn-dark {
|
|
2048
|
+
--bs-btn-color: #fff;
|
|
2049
|
+
--bs-btn-bg: #212529;
|
|
2050
|
+
--bs-btn-border-color: #212529;
|
|
2051
|
+
--bs-btn-hover-color: #fff;
|
|
2052
|
+
--bs-btn-hover-bg: rgb(66.3, 69.7, 73.1);
|
|
2053
|
+
--bs-btn-hover-border-color: rgb(55.2, 58.8, 62.4);
|
|
2054
|
+
--bs-btn-focus-shadow-rgb: 66, 70, 73;
|
|
2055
|
+
--bs-btn-active-color: #fff;
|
|
2056
|
+
--bs-btn-active-bg: rgb(77.4, 80.6, 83.8);
|
|
2057
|
+
--bs-btn-active-border-color: rgb(55.2, 58.8, 62.4);
|
|
2058
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2059
|
+
--bs-btn-disabled-color: #fff;
|
|
2060
|
+
--bs-btn-disabled-bg: #212529;
|
|
2061
|
+
--bs-btn-disabled-border-color: #212529;
|
|
2062
|
+
}
|
|
2063
|
+
|
|
2064
|
+
.btn-outline-primary {
|
|
2065
|
+
--bs-btn-color: #0d6efd;
|
|
2066
|
+
--bs-btn-border-color: #0d6efd;
|
|
2067
|
+
--bs-btn-hover-color: #fff;
|
|
2068
|
+
--bs-btn-hover-bg: #0d6efd;
|
|
2069
|
+
--bs-btn-hover-border-color: #0d6efd;
|
|
2070
|
+
--bs-btn-focus-shadow-rgb: 13, 110, 253;
|
|
2071
|
+
--bs-btn-active-color: #fff;
|
|
2072
|
+
--bs-btn-active-bg: #0d6efd;
|
|
2073
|
+
--bs-btn-active-border-color: #0d6efd;
|
|
2074
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2075
|
+
--bs-btn-disabled-color: #0d6efd;
|
|
2076
|
+
--bs-btn-disabled-bg: transparent;
|
|
2077
|
+
--bs-btn-disabled-border-color: #0d6efd;
|
|
2078
|
+
--bs-gradient: none;
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
.btn-outline-secondary {
|
|
2082
|
+
--bs-btn-color: #6c757d;
|
|
2083
|
+
--bs-btn-border-color: #6c757d;
|
|
2084
|
+
--bs-btn-hover-color: #fff;
|
|
2085
|
+
--bs-btn-hover-bg: #6c757d;
|
|
2086
|
+
--bs-btn-hover-border-color: #6c757d;
|
|
2087
|
+
--bs-btn-focus-shadow-rgb: 108, 117, 125;
|
|
2088
|
+
--bs-btn-active-color: #fff;
|
|
2089
|
+
--bs-btn-active-bg: #6c757d;
|
|
2090
|
+
--bs-btn-active-border-color: #6c757d;
|
|
2091
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2092
|
+
--bs-btn-disabled-color: #6c757d;
|
|
2093
|
+
--bs-btn-disabled-bg: transparent;
|
|
2094
|
+
--bs-btn-disabled-border-color: #6c757d;
|
|
2095
|
+
--bs-gradient: none;
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2098
|
+
.btn-outline-success {
|
|
2099
|
+
--bs-btn-color: #198754;
|
|
2100
|
+
--bs-btn-border-color: #198754;
|
|
2101
|
+
--bs-btn-hover-color: #fff;
|
|
2102
|
+
--bs-btn-hover-bg: #198754;
|
|
2103
|
+
--bs-btn-hover-border-color: #198754;
|
|
2104
|
+
--bs-btn-focus-shadow-rgb: 25, 135, 84;
|
|
2105
|
+
--bs-btn-active-color: #fff;
|
|
2106
|
+
--bs-btn-active-bg: #198754;
|
|
2107
|
+
--bs-btn-active-border-color: #198754;
|
|
2108
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2109
|
+
--bs-btn-disabled-color: #198754;
|
|
2110
|
+
--bs-btn-disabled-bg: transparent;
|
|
2111
|
+
--bs-btn-disabled-border-color: #198754;
|
|
2112
|
+
--bs-gradient: none;
|
|
2113
|
+
}
|
|
2114
|
+
|
|
2115
|
+
.btn-outline-info {
|
|
2116
|
+
--bs-btn-color: #0dcaf0;
|
|
2117
|
+
--bs-btn-border-color: #0dcaf0;
|
|
2118
|
+
--bs-btn-hover-color: #000;
|
|
2119
|
+
--bs-btn-hover-bg: #0dcaf0;
|
|
2120
|
+
--bs-btn-hover-border-color: #0dcaf0;
|
|
2121
|
+
--bs-btn-focus-shadow-rgb: 13, 202, 240;
|
|
2122
|
+
--bs-btn-active-color: #000;
|
|
2123
|
+
--bs-btn-active-bg: #0dcaf0;
|
|
2124
|
+
--bs-btn-active-border-color: #0dcaf0;
|
|
2125
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2126
|
+
--bs-btn-disabled-color: #0dcaf0;
|
|
2127
|
+
--bs-btn-disabled-bg: transparent;
|
|
2128
|
+
--bs-btn-disabled-border-color: #0dcaf0;
|
|
2129
|
+
--bs-gradient: none;
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
.btn-outline-warning {
|
|
2133
|
+
--bs-btn-color: #ffc107;
|
|
2134
|
+
--bs-btn-border-color: #ffc107;
|
|
2135
|
+
--bs-btn-hover-color: #000;
|
|
2136
|
+
--bs-btn-hover-bg: #ffc107;
|
|
2137
|
+
--bs-btn-hover-border-color: #ffc107;
|
|
2138
|
+
--bs-btn-focus-shadow-rgb: 255, 193, 7;
|
|
2139
|
+
--bs-btn-active-color: #000;
|
|
2140
|
+
--bs-btn-active-bg: #ffc107;
|
|
2141
|
+
--bs-btn-active-border-color: #ffc107;
|
|
2142
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2143
|
+
--bs-btn-disabled-color: #ffc107;
|
|
2144
|
+
--bs-btn-disabled-bg: transparent;
|
|
2145
|
+
--bs-btn-disabled-border-color: #ffc107;
|
|
2146
|
+
--bs-gradient: none;
|
|
2147
|
+
}
|
|
2148
|
+
|
|
2149
|
+
.btn-outline-danger {
|
|
2150
|
+
--bs-btn-color: #dc3545;
|
|
2151
|
+
--bs-btn-border-color: #dc3545;
|
|
2152
|
+
--bs-btn-hover-color: #fff;
|
|
2153
|
+
--bs-btn-hover-bg: #dc3545;
|
|
2154
|
+
--bs-btn-hover-border-color: #dc3545;
|
|
2155
|
+
--bs-btn-focus-shadow-rgb: 220, 53, 69;
|
|
2156
|
+
--bs-btn-active-color: #fff;
|
|
2157
|
+
--bs-btn-active-bg: #dc3545;
|
|
2158
|
+
--bs-btn-active-border-color: #dc3545;
|
|
2159
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2160
|
+
--bs-btn-disabled-color: #dc3545;
|
|
2161
|
+
--bs-btn-disabled-bg: transparent;
|
|
2162
|
+
--bs-btn-disabled-border-color: #dc3545;
|
|
2163
|
+
--bs-gradient: none;
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
.btn-outline-light {
|
|
2167
|
+
--bs-btn-color: #f8f9fa;
|
|
2168
|
+
--bs-btn-border-color: #f8f9fa;
|
|
2169
|
+
--bs-btn-hover-color: #000;
|
|
2170
|
+
--bs-btn-hover-bg: #f8f9fa;
|
|
2171
|
+
--bs-btn-hover-border-color: #f8f9fa;
|
|
2172
|
+
--bs-btn-focus-shadow-rgb: 248, 249, 250;
|
|
2173
|
+
--bs-btn-active-color: #000;
|
|
2174
|
+
--bs-btn-active-bg: #f8f9fa;
|
|
2175
|
+
--bs-btn-active-border-color: #f8f9fa;
|
|
2176
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2177
|
+
--bs-btn-disabled-color: #f8f9fa;
|
|
2178
|
+
--bs-btn-disabled-bg: transparent;
|
|
2179
|
+
--bs-btn-disabled-border-color: #f8f9fa;
|
|
2180
|
+
--bs-gradient: none;
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
.btn-outline-dark {
|
|
2184
|
+
--bs-btn-color: #212529;
|
|
2185
|
+
--bs-btn-border-color: #212529;
|
|
2186
|
+
--bs-btn-hover-color: #fff;
|
|
2187
|
+
--bs-btn-hover-bg: #212529;
|
|
2188
|
+
--bs-btn-hover-border-color: #212529;
|
|
2189
|
+
--bs-btn-focus-shadow-rgb: 33, 37, 41;
|
|
2190
|
+
--bs-btn-active-color: #fff;
|
|
2191
|
+
--bs-btn-active-bg: #212529;
|
|
2192
|
+
--bs-btn-active-border-color: #212529;
|
|
2193
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2194
|
+
--bs-btn-disabled-color: #212529;
|
|
2195
|
+
--bs-btn-disabled-bg: transparent;
|
|
2196
|
+
--bs-btn-disabled-border-color: #212529;
|
|
2197
|
+
--bs-gradient: none;
|
|
2198
|
+
}
|
|
2199
|
+
|
|
2200
|
+
.btn-link {
|
|
2201
|
+
--bs-btn-font-weight: 400;
|
|
2202
|
+
--bs-btn-color: var(--bs-link-color);
|
|
2203
|
+
--bs-btn-bg: transparent;
|
|
2204
|
+
--bs-btn-border-color: transparent;
|
|
2205
|
+
--bs-btn-hover-color: var(--bs-link-hover-color);
|
|
2206
|
+
--bs-btn-hover-border-color: transparent;
|
|
2207
|
+
--bs-btn-active-color: var(--bs-link-hover-color);
|
|
2208
|
+
--bs-btn-active-border-color: transparent;
|
|
2209
|
+
--bs-btn-disabled-color: #6c757d;
|
|
2210
|
+
--bs-btn-disabled-border-color: transparent;
|
|
2211
|
+
--bs-btn-box-shadow: 0 0 0 #000;
|
|
2212
|
+
--bs-btn-focus-shadow-rgb: 49, 132, 253;
|
|
2213
|
+
text-decoration: underline;
|
|
2214
|
+
}
|
|
2215
|
+
.btn-link:focus-visible {
|
|
2216
|
+
color: var(--bs-btn-color);
|
|
2217
|
+
}
|
|
2218
|
+
.btn-link:hover {
|
|
2219
|
+
color: var(--bs-btn-hover-color);
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2222
|
+
.btn-lg {
|
|
2223
|
+
--bs-btn-padding-y: 0.5rem;
|
|
2224
|
+
--bs-btn-padding-x: 1rem;
|
|
2225
|
+
--bs-btn-font-size: 1.25rem;
|
|
2226
|
+
--bs-btn-border-radius: var(--bs-border-radius-lg);
|
|
2227
|
+
}
|
|
2228
|
+
|
|
2229
|
+
.btn-sm {
|
|
2230
|
+
--bs-btn-padding-y: 0.25rem;
|
|
2231
|
+
--bs-btn-padding-x: 0.5rem;
|
|
2232
|
+
--bs-btn-font-size: 0.875rem;
|
|
2233
|
+
--bs-btn-border-radius: var(--bs-border-radius-sm);
|
|
2234
|
+
}
|
|
2235
|
+
|
|
2236
|
+
:host {
|
|
2237
|
+
display: block;
|
|
2238
|
+
margin: 0.25rem 0;
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
.qb-group {
|
|
2242
|
+
border-left: 3px solid var(--bs-border-color, #dee2e6);
|
|
2243
|
+
padding-left: 0.5rem;
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
.qb-group-header {
|
|
2247
|
+
display: flex;
|
|
2248
|
+
align-items: center;
|
|
2249
|
+
gap: 0.5rem;
|
|
2250
|
+
font-size: 0.875rem;
|
|
2251
|
+
margin-bottom: 0.25rem;
|
|
2252
|
+
flex-wrap: wrap;
|
|
2253
|
+
}
|
|
2254
|
+
|
|
2255
|
+
.qb-group-actions {
|
|
2256
|
+
display: inline-flex;
|
|
2257
|
+
align-items: center;
|
|
2258
|
+
gap: 0.25rem;
|
|
2259
|
+
margin-left: auto;
|
|
2260
|
+
}
|
|
2261
|
+
|
|
2262
|
+
.qb-logic-btn {
|
|
2263
|
+
font-size: 0.75rem;
|
|
2264
|
+
text-transform: uppercase;
|
|
2265
|
+
letter-spacing: 0.05em;
|
|
2266
|
+
padding: 0.125rem 0.5rem;
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
.qb-remove-group {
|
|
2270
|
+
padding: 0 0.5rem;
|
|
2271
|
+
line-height: 1;
|
|
2272
|
+
font-size: 1rem;
|
|
2273
|
+
color: var(--bs-danger, #dc3545);
|
|
2274
|
+
}
|
|
2275
|
+
|
|
2276
|
+
.qb-children {
|
|
2277
|
+
display: flex;
|
|
2278
|
+
flex-direction: column;
|
|
2279
|
+
gap: 0.125rem;
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
.qb-empty {
|
|
2283
|
+
color: var(--bs-secondary-color, #6c757d);
|
|
2284
|
+
font-style: italic;
|
|
2285
|
+
font-size: 0.875rem;
|
|
2286
|
+
padding: 0.25rem 0;
|
|
2287
|
+
}
|
|
2288
|
+
|
|
2289
|
+
.qb-drop-slot {
|
|
2290
|
+
display: block;
|
|
2291
|
+
height: 0.25rem;
|
|
2292
|
+
margin: 0.0625rem 0;
|
|
2293
|
+
border-radius: 2px;
|
|
2294
|
+
background: transparent;
|
|
2295
|
+
transition: background 0.1s ease-in-out, height 0.1s ease-in-out;
|
|
2296
|
+
}
|
|
2297
|
+
|
|
2298
|
+
.qb-drop-slot:hover {
|
|
2299
|
+
background: var(--bs-primary, #0d6efd);
|
|
2300
|
+
height: 0.375rem;
|
|
2301
|
+
}
|
|
2302
|
+
|
|
2303
|
+
.qb-drop-slot-placeholder {
|
|
2304
|
+
height: 2rem;
|
|
2305
|
+
display: flex;
|
|
2306
|
+
align-items: center;
|
|
2307
|
+
justify-content: center;
|
|
2308
|
+
color: var(--bs-secondary-color, #6c757d);
|
|
2309
|
+
font-style: italic;
|
|
2310
|
+
border: 2px dashed var(--bs-border-color, #dee2e6);
|
|
2311
|
+
background: var(--bs-tertiary-bg, #f8f9fa);
|
|
2312
|
+
}`);
|
|
2313
|
+
class Fe extends S {
|
|
2314
|
+
constructor() {
|
|
2315
|
+
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
|
+
context: q,
|
|
2317
|
+
subscribe: !0
|
|
2318
|
+
}), this._disabledConsumer = new p(this, {
|
|
2319
|
+
context: E,
|
|
2320
|
+
subscribe: !0
|
|
2321
|
+
}), this._onLogicChange = (e) => {
|
|
2322
|
+
const t = this.node;
|
|
2323
|
+
!t || t.logic === e || this._emit("group-logic-change", { id: t.id, logic: e });
|
|
2324
|
+
}, this._onAddCondition = () => {
|
|
2325
|
+
this.node && this._emit("add-condition", { groupId: this.node.id });
|
|
2326
|
+
}, this._onAddGroup = () => {
|
|
2327
|
+
this.node && this._emit("add-group", { groupId: this.node.id });
|
|
2328
|
+
}, this._onAddSubquery = () => {
|
|
2329
|
+
this.node && this._emit("add-subquery", { groupId: this.node.id });
|
|
2330
|
+
}, this._onRemove = () => {
|
|
2331
|
+
this.node && this._emit("node-remove", { id: this.node.id });
|
|
2332
|
+
};
|
|
2333
|
+
}
|
|
2334
|
+
static {
|
|
2335
|
+
this.styles = [Te];
|
|
2336
|
+
}
|
|
2337
|
+
static {
|
|
2338
|
+
this.properties = {
|
|
2339
|
+
node: { attribute: !1 },
|
|
2340
|
+
schema: { attribute: !1 },
|
|
2341
|
+
currentEntity: { attribute: !1 },
|
|
2342
|
+
depth: { attribute: !1 },
|
|
2343
|
+
isRoot: { attribute: !1 },
|
|
2344
|
+
qbRoot: { attribute: !1 },
|
|
2345
|
+
isDragging: { attribute: !1 }
|
|
2346
|
+
};
|
|
2347
|
+
}
|
|
2348
|
+
isDisabled() {
|
|
2349
|
+
return this._disabledConsumer.value ?? !1;
|
|
2350
|
+
}
|
|
2351
|
+
_hasRelation() {
|
|
2352
|
+
return (this.schema.find((e) => e.name === this.currentEntity)?.fields ?? []).some((e) => e.type === "relation" && !!e.targetEntity);
|
|
2353
|
+
}
|
|
2354
|
+
_emit(e, t) {
|
|
2355
|
+
this.dispatchEvent(new CustomEvent(e, { detail: t, bubbles: !0, composed: !0 }));
|
|
2356
|
+
}
|
|
2357
|
+
messages() {
|
|
2358
|
+
const e = this._messagesConsumer.value ?? {};
|
|
2359
|
+
return {
|
|
2360
|
+
...m,
|
|
2361
|
+
...e,
|
|
2362
|
+
operators: { ...m.operators, ...e.operators ?? {} }
|
|
2363
|
+
};
|
|
2364
|
+
}
|
|
2365
|
+
renderChild(e) {
|
|
2366
|
+
switch (e.kind) {
|
|
2367
|
+
case "group":
|
|
2368
|
+
return d`<mp-query-group
|
|
2369
|
+
.node=${e}
|
|
2370
|
+
.schema=${this.schema}
|
|
2371
|
+
.currentEntity=${this.currentEntity}
|
|
2372
|
+
.depth=${this.depth + 1}
|
|
2373
|
+
.qbRoot=${this.qbRoot}
|
|
2374
|
+
.isDragging=${this.isDragging}
|
|
2375
|
+
part="child-group"
|
|
2376
|
+
></mp-query-group>`;
|
|
2377
|
+
case "condition":
|
|
2378
|
+
return d`<mp-query-condition
|
|
2379
|
+
.node=${e}
|
|
2380
|
+
.schema=${this.schema}
|
|
2381
|
+
.currentEntity=${this.currentEntity}
|
|
2382
|
+
part="child-condition"
|
|
2383
|
+
></mp-query-condition>`;
|
|
2384
|
+
case "subquery":
|
|
2385
|
+
return d`<mp-query-subquery
|
|
2386
|
+
.node=${e}
|
|
2387
|
+
.schema=${this.schema}
|
|
2388
|
+
.currentEntity=${this.currentEntity}
|
|
2389
|
+
.depth=${this.depth + 1}
|
|
2390
|
+
.qbRoot=${this.qbRoot}
|
|
2391
|
+
.isDragging=${this.isDragging}
|
|
2392
|
+
part="child-subquery"
|
|
2393
|
+
></mp-query-subquery>`;
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
renderDropSlot(e) {
|
|
2397
|
+
return !this.isDragging || !this.node ? u : d`<div
|
|
2398
|
+
class="qb-drop-slot"
|
|
2399
|
+
data-drop-slot
|
|
2400
|
+
data-parent-id=${this.node.id}
|
|
2401
|
+
data-index=${String(e)}
|
|
2402
|
+
data-qb-root=${this.qbRoot}
|
|
2403
|
+
part="drop-slot"
|
|
2404
|
+
aria-hidden="true"
|
|
2405
|
+
></div>`;
|
|
2406
|
+
}
|
|
2407
|
+
_renderChildrenWithSlots(e) {
|
|
2408
|
+
const t = [];
|
|
2409
|
+
this.isDragging && t.push(this.renderDropSlot(0));
|
|
2410
|
+
for (let r = 0; r < e.length; r++)
|
|
2411
|
+
t.push(this.renderChild(e[r])), this.isDragging && t.push(this.renderDropSlot(r + 1));
|
|
2412
|
+
return t;
|
|
2413
|
+
}
|
|
2414
|
+
_dropPlaceholder() {
|
|
2415
|
+
return d`<div
|
|
2416
|
+
class="qb-drop-slot qb-drop-slot-placeholder"
|
|
2417
|
+
data-drop-slot
|
|
2418
|
+
data-parent-id=${this.node?.id ?? ""}
|
|
2419
|
+
data-index="0"
|
|
2420
|
+
data-qb-root=${this.qbRoot}
|
|
2421
|
+
aria-hidden="true"
|
|
2422
|
+
>Drop here</div>`;
|
|
2423
|
+
}
|
|
2424
|
+
render() {
|
|
2425
|
+
const e = this.node;
|
|
2426
|
+
if (!e) return u;
|
|
2427
|
+
const t = this.messages(), r = this.isDisabled(), n = this._hasRelation();
|
|
2428
|
+
return d`
|
|
2429
|
+
<div
|
|
2430
|
+
class="qb-group"
|
|
2431
|
+
role="group"
|
|
2432
|
+
aria-label=${e.logic === "and" ? "AND group" : "OR group"}
|
|
2433
|
+
part="group"
|
|
2434
|
+
>
|
|
2435
|
+
<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">
|
|
2437
|
+
<button
|
|
2438
|
+
type="button"
|
|
2439
|
+
class="btn ${e.logic === "and" ? "btn-primary" : "btn-outline-primary"} qb-logic-btn"
|
|
2440
|
+
?disabled=${r}
|
|
2441
|
+
@click=${() => this._onLogicChange("and")}
|
|
2442
|
+
aria-pressed=${e.logic === "and"}
|
|
2443
|
+
>${t.logicAnd}</button>
|
|
2444
|
+
<button
|
|
2445
|
+
type="button"
|
|
2446
|
+
class="btn ${e.logic === "or" ? "btn-primary" : "btn-outline-primary"} qb-logic-btn"
|
|
2447
|
+
?disabled=${r}
|
|
2448
|
+
@click=${() => this._onLogicChange("or")}
|
|
2449
|
+
aria-pressed=${e.logic === "or"}
|
|
2450
|
+
>${t.logicOr}</button>
|
|
2451
|
+
</span>
|
|
2452
|
+
<span class="qb-group-actions">
|
|
2453
|
+
<button
|
|
2454
|
+
type="button"
|
|
2455
|
+
class="btn btn-sm btn-outline-secondary qb-add-condition"
|
|
2456
|
+
part="add-condition"
|
|
2457
|
+
?disabled=${r}
|
|
2458
|
+
@click=${this._onAddCondition}
|
|
2459
|
+
>+ ${t.addCondition}</button>
|
|
2460
|
+
<button
|
|
2461
|
+
type="button"
|
|
2462
|
+
class="btn btn-sm btn-outline-secondary qb-add-group"
|
|
2463
|
+
part="add-group"
|
|
2464
|
+
?disabled=${r}
|
|
2465
|
+
@click=${this._onAddGroup}
|
|
2466
|
+
>+ ${t.addGroup}</button>
|
|
2467
|
+
${n ? d`<button
|
|
2468
|
+
type="button"
|
|
2469
|
+
class="btn btn-sm btn-outline-secondary qb-add-subquery"
|
|
2470
|
+
part="add-subquery"
|
|
2471
|
+
?disabled=${r}
|
|
2472
|
+
@click=${this._onAddSubquery}
|
|
2473
|
+
>+ ${t.addSubquery}</button>` : u}
|
|
2474
|
+
${this.isRoot ? u : d`<button
|
|
2475
|
+
type="button"
|
|
2476
|
+
class="btn btn-sm btn-link qb-remove-group"
|
|
2477
|
+
part="remove-group"
|
|
2478
|
+
?disabled=${r}
|
|
2479
|
+
@click=${this._onRemove}
|
|
2480
|
+
aria-label="Remove group"
|
|
2481
|
+
title=${t.removeGroup}
|
|
2482
|
+
>×</button>`}
|
|
2483
|
+
</span>
|
|
2484
|
+
</div>
|
|
2485
|
+
<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)}
|
|
2487
|
+
</div>
|
|
2488
|
+
</div>
|
|
2489
|
+
`;
|
|
2490
|
+
}
|
|
2491
|
+
}
|
|
2492
|
+
typeof customElements < "u" && !customElements.get("mp-query-group") && customElements.define("mp-query-group", Fe);
|
|
2493
|
+
d`<!-- Rendered dynamically by render(). Codegen-wc emits styles from the
|
|
2494
|
+
sibling .scss; the template export is intentionally unused. -->`;
|
|
2495
|
+
const Ie = D(`.btn {
|
|
2496
|
+
--bs-btn-padding-x: 0.75rem;
|
|
2497
|
+
--bs-btn-padding-y: 0.375rem;
|
|
2498
|
+
--bs-btn-font-family: ;
|
|
2499
|
+
--bs-btn-font-size: 1rem;
|
|
2500
|
+
--bs-btn-font-weight: 400;
|
|
2501
|
+
--bs-btn-line-height: 1.5;
|
|
2502
|
+
--bs-btn-color: var(--bs-body-color);
|
|
2503
|
+
--bs-btn-bg: transparent;
|
|
2504
|
+
--bs-btn-border-width: var(--bs-border-width);
|
|
2505
|
+
--bs-btn-border-color: transparent;
|
|
2506
|
+
--bs-btn-border-radius: var(--bs-border-radius);
|
|
2507
|
+
--bs-btn-hover-border-color: transparent;
|
|
2508
|
+
--bs-btn-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);
|
|
2509
|
+
--bs-btn-disabled-opacity: 0.65;
|
|
2510
|
+
--bs-btn-focus-box-shadow: 0 0 0 0.25rem rgba(var(--bs-btn-focus-shadow-rgb), .5);
|
|
2511
|
+
display: inline-block;
|
|
2512
|
+
padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x);
|
|
2513
|
+
font-family: var(--bs-btn-font-family);
|
|
2514
|
+
font-size: var(--bs-btn-font-size);
|
|
2515
|
+
font-weight: var(--bs-btn-font-weight);
|
|
2516
|
+
line-height: var(--bs-btn-line-height);
|
|
2517
|
+
color: var(--bs-btn-color);
|
|
2518
|
+
text-align: center;
|
|
2519
|
+
text-decoration: none;
|
|
2520
|
+
vertical-align: middle;
|
|
2521
|
+
cursor: pointer;
|
|
2522
|
+
user-select: none;
|
|
2523
|
+
border: var(--bs-btn-border-width) solid var(--bs-btn-border-color);
|
|
2524
|
+
border-radius: var(--bs-btn-border-radius);
|
|
2525
|
+
background-color: var(--bs-btn-bg);
|
|
2526
|
+
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
2527
|
+
}
|
|
2528
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2529
|
+
.btn {
|
|
2530
|
+
transition: none;
|
|
2531
|
+
}
|
|
2532
|
+
}
|
|
2533
|
+
.btn:hover {
|
|
2534
|
+
color: var(--bs-btn-hover-color);
|
|
2535
|
+
background-color: var(--bs-btn-hover-bg);
|
|
2536
|
+
border-color: var(--bs-btn-hover-border-color);
|
|
2537
|
+
}
|
|
2538
|
+
.btn-check + .btn:hover {
|
|
2539
|
+
color: var(--bs-btn-color);
|
|
2540
|
+
background-color: var(--bs-btn-bg);
|
|
2541
|
+
border-color: var(--bs-btn-border-color);
|
|
2542
|
+
}
|
|
2543
|
+
.btn:focus-visible {
|
|
2544
|
+
color: var(--bs-btn-hover-color);
|
|
2545
|
+
background-color: var(--bs-btn-hover-bg);
|
|
2546
|
+
border-color: var(--bs-btn-hover-border-color);
|
|
2547
|
+
outline: 0;
|
|
2548
|
+
box-shadow: var(--bs-btn-focus-box-shadow);
|
|
2549
|
+
}
|
|
2550
|
+
.btn-check:focus-visible + .btn {
|
|
2551
|
+
border-color: var(--bs-btn-hover-border-color);
|
|
2552
|
+
outline: 0;
|
|
2553
|
+
box-shadow: var(--bs-btn-focus-box-shadow);
|
|
2554
|
+
}
|
|
2555
|
+
.btn-check:checked + .btn, :not(.btn-check) + .btn:active, .btn:first-child:active, .btn.active, .btn.show {
|
|
2556
|
+
color: var(--bs-btn-active-color);
|
|
2557
|
+
background-color: var(--bs-btn-active-bg);
|
|
2558
|
+
border-color: var(--bs-btn-active-border-color);
|
|
2559
|
+
}
|
|
2560
|
+
.btn-check:checked + .btn:focus-visible, :not(.btn-check) + .btn:active:focus-visible, .btn:first-child:active:focus-visible, .btn.active:focus-visible, .btn.show:focus-visible {
|
|
2561
|
+
box-shadow: var(--bs-btn-focus-box-shadow);
|
|
2562
|
+
}
|
|
2563
|
+
.btn-check:checked:focus-visible + .btn {
|
|
2564
|
+
box-shadow: var(--bs-btn-focus-box-shadow);
|
|
2565
|
+
}
|
|
2566
|
+
.btn:disabled, .btn.disabled, fieldset:disabled .btn {
|
|
2567
|
+
color: var(--bs-btn-disabled-color);
|
|
2568
|
+
pointer-events: none;
|
|
2569
|
+
background-color: var(--bs-btn-disabled-bg);
|
|
2570
|
+
border-color: var(--bs-btn-disabled-border-color);
|
|
2571
|
+
opacity: var(--bs-btn-disabled-opacity);
|
|
2572
|
+
}
|
|
2573
|
+
|
|
2574
|
+
.btn-primary {
|
|
2575
|
+
--bs-btn-color: #fff;
|
|
2576
|
+
--bs-btn-bg: #0d6efd;
|
|
2577
|
+
--bs-btn-border-color: #0d6efd;
|
|
2578
|
+
--bs-btn-hover-color: #fff;
|
|
2579
|
+
--bs-btn-hover-bg: rgb(11.05, 93.5, 215.05);
|
|
2580
|
+
--bs-btn-hover-border-color: rgb(10.4, 88, 202.4);
|
|
2581
|
+
--bs-btn-focus-shadow-rgb: 49, 132, 253;
|
|
2582
|
+
--bs-btn-active-color: #fff;
|
|
2583
|
+
--bs-btn-active-bg: rgb(10.4, 88, 202.4);
|
|
2584
|
+
--bs-btn-active-border-color: rgb(9.75, 82.5, 189.75);
|
|
2585
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2586
|
+
--bs-btn-disabled-color: #fff;
|
|
2587
|
+
--bs-btn-disabled-bg: #0d6efd;
|
|
2588
|
+
--bs-btn-disabled-border-color: #0d6efd;
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2591
|
+
.btn-secondary {
|
|
2592
|
+
--bs-btn-color: #fff;
|
|
2593
|
+
--bs-btn-bg: #6c757d;
|
|
2594
|
+
--bs-btn-border-color: #6c757d;
|
|
2595
|
+
--bs-btn-hover-color: #fff;
|
|
2596
|
+
--bs-btn-hover-bg: rgb(91.8, 99.45, 106.25);
|
|
2597
|
+
--bs-btn-hover-border-color: rgb(86.4, 93.6, 100);
|
|
2598
|
+
--bs-btn-focus-shadow-rgb: 130, 138, 145;
|
|
2599
|
+
--bs-btn-active-color: #fff;
|
|
2600
|
+
--bs-btn-active-bg: rgb(86.4, 93.6, 100);
|
|
2601
|
+
--bs-btn-active-border-color: rgb(81, 87.75, 93.75);
|
|
2602
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2603
|
+
--bs-btn-disabled-color: #fff;
|
|
2604
|
+
--bs-btn-disabled-bg: #6c757d;
|
|
2605
|
+
--bs-btn-disabled-border-color: #6c757d;
|
|
2606
|
+
}
|
|
2607
|
+
|
|
2608
|
+
.btn-success {
|
|
2609
|
+
--bs-btn-color: #fff;
|
|
2610
|
+
--bs-btn-bg: #198754;
|
|
2611
|
+
--bs-btn-border-color: #198754;
|
|
2612
|
+
--bs-btn-hover-color: #fff;
|
|
2613
|
+
--bs-btn-hover-bg: rgb(21.25, 114.75, 71.4);
|
|
2614
|
+
--bs-btn-hover-border-color: rgb(20, 108, 67.2);
|
|
2615
|
+
--bs-btn-focus-shadow-rgb: 60, 153, 110;
|
|
2616
|
+
--bs-btn-active-color: #fff;
|
|
2617
|
+
--bs-btn-active-bg: rgb(20, 108, 67.2);
|
|
2618
|
+
--bs-btn-active-border-color: rgb(18.75, 101.25, 63);
|
|
2619
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2620
|
+
--bs-btn-disabled-color: #fff;
|
|
2621
|
+
--bs-btn-disabled-bg: #198754;
|
|
2622
|
+
--bs-btn-disabled-border-color: #198754;
|
|
2623
|
+
}
|
|
2624
|
+
|
|
2625
|
+
.btn-info {
|
|
2626
|
+
--bs-btn-color: #000;
|
|
2627
|
+
--bs-btn-bg: #0dcaf0;
|
|
2628
|
+
--bs-btn-border-color: #0dcaf0;
|
|
2629
|
+
--bs-btn-hover-color: #000;
|
|
2630
|
+
--bs-btn-hover-bg: rgb(49.3, 209.95, 242.25);
|
|
2631
|
+
--bs-btn-hover-border-color: rgb(37.2, 207.3, 241.5);
|
|
2632
|
+
--bs-btn-focus-shadow-rgb: 11, 172, 204;
|
|
2633
|
+
--bs-btn-active-color: #000;
|
|
2634
|
+
--bs-btn-active-bg: rgb(61.4, 212.6, 243);
|
|
2635
|
+
--bs-btn-active-border-color: rgb(37.2, 207.3, 241.5);
|
|
2636
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2637
|
+
--bs-btn-disabled-color: #000;
|
|
2638
|
+
--bs-btn-disabled-bg: #0dcaf0;
|
|
2639
|
+
--bs-btn-disabled-border-color: #0dcaf0;
|
|
2640
|
+
}
|
|
2641
|
+
|
|
2642
|
+
.btn-warning {
|
|
2643
|
+
--bs-btn-color: #000;
|
|
2644
|
+
--bs-btn-bg: #ffc107;
|
|
2645
|
+
--bs-btn-border-color: #ffc107;
|
|
2646
|
+
--bs-btn-hover-color: #000;
|
|
2647
|
+
--bs-btn-hover-bg: rgb(255, 202.3, 44.2);
|
|
2648
|
+
--bs-btn-hover-border-color: rgb(255, 199.2, 31.8);
|
|
2649
|
+
--bs-btn-focus-shadow-rgb: 217, 164, 6;
|
|
2650
|
+
--bs-btn-active-color: #000;
|
|
2651
|
+
--bs-btn-active-bg: rgb(255, 205.4, 56.6);
|
|
2652
|
+
--bs-btn-active-border-color: rgb(255, 199.2, 31.8);
|
|
2653
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2654
|
+
--bs-btn-disabled-color: #000;
|
|
2655
|
+
--bs-btn-disabled-bg: #ffc107;
|
|
2656
|
+
--bs-btn-disabled-border-color: #ffc107;
|
|
2657
|
+
}
|
|
2658
|
+
|
|
2659
|
+
.btn-danger {
|
|
2660
|
+
--bs-btn-color: #fff;
|
|
2661
|
+
--bs-btn-bg: #dc3545;
|
|
2662
|
+
--bs-btn-border-color: #dc3545;
|
|
2663
|
+
--bs-btn-hover-color: #fff;
|
|
2664
|
+
--bs-btn-hover-bg: rgb(187, 45.05, 58.65);
|
|
2665
|
+
--bs-btn-hover-border-color: rgb(176, 42.4, 55.2);
|
|
2666
|
+
--bs-btn-focus-shadow-rgb: 225, 83, 97;
|
|
2667
|
+
--bs-btn-active-color: #fff;
|
|
2668
|
+
--bs-btn-active-bg: rgb(176, 42.4, 55.2);
|
|
2669
|
+
--bs-btn-active-border-color: rgb(165, 39.75, 51.75);
|
|
2670
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2671
|
+
--bs-btn-disabled-color: #fff;
|
|
2672
|
+
--bs-btn-disabled-bg: #dc3545;
|
|
2673
|
+
--bs-btn-disabled-border-color: #dc3545;
|
|
2674
|
+
}
|
|
2675
|
+
|
|
2676
|
+
.btn-light {
|
|
2677
|
+
--bs-btn-color: #000;
|
|
2678
|
+
--bs-btn-bg: #f8f9fa;
|
|
2679
|
+
--bs-btn-border-color: #f8f9fa;
|
|
2680
|
+
--bs-btn-hover-color: #000;
|
|
2681
|
+
--bs-btn-hover-bg: rgb(210.8, 211.65, 212.5);
|
|
2682
|
+
--bs-btn-hover-border-color: rgb(198.4, 199.2, 200);
|
|
2683
|
+
--bs-btn-focus-shadow-rgb: 211, 212, 213;
|
|
2684
|
+
--bs-btn-active-color: #000;
|
|
2685
|
+
--bs-btn-active-bg: rgb(198.4, 199.2, 200);
|
|
2686
|
+
--bs-btn-active-border-color: rgb(186, 186.75, 187.5);
|
|
2687
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2688
|
+
--bs-btn-disabled-color: #000;
|
|
2689
|
+
--bs-btn-disabled-bg: #f8f9fa;
|
|
2690
|
+
--bs-btn-disabled-border-color: #f8f9fa;
|
|
2691
|
+
}
|
|
2692
|
+
|
|
2693
|
+
.btn-dark {
|
|
2694
|
+
--bs-btn-color: #fff;
|
|
2695
|
+
--bs-btn-bg: #212529;
|
|
2696
|
+
--bs-btn-border-color: #212529;
|
|
2697
|
+
--bs-btn-hover-color: #fff;
|
|
2698
|
+
--bs-btn-hover-bg: rgb(66.3, 69.7, 73.1);
|
|
2699
|
+
--bs-btn-hover-border-color: rgb(55.2, 58.8, 62.4);
|
|
2700
|
+
--bs-btn-focus-shadow-rgb: 66, 70, 73;
|
|
2701
|
+
--bs-btn-active-color: #fff;
|
|
2702
|
+
--bs-btn-active-bg: rgb(77.4, 80.6, 83.8);
|
|
2703
|
+
--bs-btn-active-border-color: rgb(55.2, 58.8, 62.4);
|
|
2704
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2705
|
+
--bs-btn-disabled-color: #fff;
|
|
2706
|
+
--bs-btn-disabled-bg: #212529;
|
|
2707
|
+
--bs-btn-disabled-border-color: #212529;
|
|
2708
|
+
}
|
|
2709
|
+
|
|
2710
|
+
.btn-outline-primary {
|
|
2711
|
+
--bs-btn-color: #0d6efd;
|
|
2712
|
+
--bs-btn-border-color: #0d6efd;
|
|
2713
|
+
--bs-btn-hover-color: #fff;
|
|
2714
|
+
--bs-btn-hover-bg: #0d6efd;
|
|
2715
|
+
--bs-btn-hover-border-color: #0d6efd;
|
|
2716
|
+
--bs-btn-focus-shadow-rgb: 13, 110, 253;
|
|
2717
|
+
--bs-btn-active-color: #fff;
|
|
2718
|
+
--bs-btn-active-bg: #0d6efd;
|
|
2719
|
+
--bs-btn-active-border-color: #0d6efd;
|
|
2720
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2721
|
+
--bs-btn-disabled-color: #0d6efd;
|
|
2722
|
+
--bs-btn-disabled-bg: transparent;
|
|
2723
|
+
--bs-btn-disabled-border-color: #0d6efd;
|
|
2724
|
+
--bs-gradient: none;
|
|
2725
|
+
}
|
|
2726
|
+
|
|
2727
|
+
.btn-outline-secondary {
|
|
2728
|
+
--bs-btn-color: #6c757d;
|
|
2729
|
+
--bs-btn-border-color: #6c757d;
|
|
2730
|
+
--bs-btn-hover-color: #fff;
|
|
2731
|
+
--bs-btn-hover-bg: #6c757d;
|
|
2732
|
+
--bs-btn-hover-border-color: #6c757d;
|
|
2733
|
+
--bs-btn-focus-shadow-rgb: 108, 117, 125;
|
|
2734
|
+
--bs-btn-active-color: #fff;
|
|
2735
|
+
--bs-btn-active-bg: #6c757d;
|
|
2736
|
+
--bs-btn-active-border-color: #6c757d;
|
|
2737
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2738
|
+
--bs-btn-disabled-color: #6c757d;
|
|
2739
|
+
--bs-btn-disabled-bg: transparent;
|
|
2740
|
+
--bs-btn-disabled-border-color: #6c757d;
|
|
2741
|
+
--bs-gradient: none;
|
|
2742
|
+
}
|
|
2743
|
+
|
|
2744
|
+
.btn-outline-success {
|
|
2745
|
+
--bs-btn-color: #198754;
|
|
2746
|
+
--bs-btn-border-color: #198754;
|
|
2747
|
+
--bs-btn-hover-color: #fff;
|
|
2748
|
+
--bs-btn-hover-bg: #198754;
|
|
2749
|
+
--bs-btn-hover-border-color: #198754;
|
|
2750
|
+
--bs-btn-focus-shadow-rgb: 25, 135, 84;
|
|
2751
|
+
--bs-btn-active-color: #fff;
|
|
2752
|
+
--bs-btn-active-bg: #198754;
|
|
2753
|
+
--bs-btn-active-border-color: #198754;
|
|
2754
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2755
|
+
--bs-btn-disabled-color: #198754;
|
|
2756
|
+
--bs-btn-disabled-bg: transparent;
|
|
2757
|
+
--bs-btn-disabled-border-color: #198754;
|
|
2758
|
+
--bs-gradient: none;
|
|
2759
|
+
}
|
|
2760
|
+
|
|
2761
|
+
.btn-outline-info {
|
|
2762
|
+
--bs-btn-color: #0dcaf0;
|
|
2763
|
+
--bs-btn-border-color: #0dcaf0;
|
|
2764
|
+
--bs-btn-hover-color: #000;
|
|
2765
|
+
--bs-btn-hover-bg: #0dcaf0;
|
|
2766
|
+
--bs-btn-hover-border-color: #0dcaf0;
|
|
2767
|
+
--bs-btn-focus-shadow-rgb: 13, 202, 240;
|
|
2768
|
+
--bs-btn-active-color: #000;
|
|
2769
|
+
--bs-btn-active-bg: #0dcaf0;
|
|
2770
|
+
--bs-btn-active-border-color: #0dcaf0;
|
|
2771
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2772
|
+
--bs-btn-disabled-color: #0dcaf0;
|
|
2773
|
+
--bs-btn-disabled-bg: transparent;
|
|
2774
|
+
--bs-btn-disabled-border-color: #0dcaf0;
|
|
2775
|
+
--bs-gradient: none;
|
|
2776
|
+
}
|
|
2777
|
+
|
|
2778
|
+
.btn-outline-warning {
|
|
2779
|
+
--bs-btn-color: #ffc107;
|
|
2780
|
+
--bs-btn-border-color: #ffc107;
|
|
2781
|
+
--bs-btn-hover-color: #000;
|
|
2782
|
+
--bs-btn-hover-bg: #ffc107;
|
|
2783
|
+
--bs-btn-hover-border-color: #ffc107;
|
|
2784
|
+
--bs-btn-focus-shadow-rgb: 255, 193, 7;
|
|
2785
|
+
--bs-btn-active-color: #000;
|
|
2786
|
+
--bs-btn-active-bg: #ffc107;
|
|
2787
|
+
--bs-btn-active-border-color: #ffc107;
|
|
2788
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2789
|
+
--bs-btn-disabled-color: #ffc107;
|
|
2790
|
+
--bs-btn-disabled-bg: transparent;
|
|
2791
|
+
--bs-btn-disabled-border-color: #ffc107;
|
|
2792
|
+
--bs-gradient: none;
|
|
2793
|
+
}
|
|
2794
|
+
|
|
2795
|
+
.btn-outline-danger {
|
|
2796
|
+
--bs-btn-color: #dc3545;
|
|
2797
|
+
--bs-btn-border-color: #dc3545;
|
|
2798
|
+
--bs-btn-hover-color: #fff;
|
|
2799
|
+
--bs-btn-hover-bg: #dc3545;
|
|
2800
|
+
--bs-btn-hover-border-color: #dc3545;
|
|
2801
|
+
--bs-btn-focus-shadow-rgb: 220, 53, 69;
|
|
2802
|
+
--bs-btn-active-color: #fff;
|
|
2803
|
+
--bs-btn-active-bg: #dc3545;
|
|
2804
|
+
--bs-btn-active-border-color: #dc3545;
|
|
2805
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2806
|
+
--bs-btn-disabled-color: #dc3545;
|
|
2807
|
+
--bs-btn-disabled-bg: transparent;
|
|
2808
|
+
--bs-btn-disabled-border-color: #dc3545;
|
|
2809
|
+
--bs-gradient: none;
|
|
2810
|
+
}
|
|
2811
|
+
|
|
2812
|
+
.btn-outline-light {
|
|
2813
|
+
--bs-btn-color: #f8f9fa;
|
|
2814
|
+
--bs-btn-border-color: #f8f9fa;
|
|
2815
|
+
--bs-btn-hover-color: #000;
|
|
2816
|
+
--bs-btn-hover-bg: #f8f9fa;
|
|
2817
|
+
--bs-btn-hover-border-color: #f8f9fa;
|
|
2818
|
+
--bs-btn-focus-shadow-rgb: 248, 249, 250;
|
|
2819
|
+
--bs-btn-active-color: #000;
|
|
2820
|
+
--bs-btn-active-bg: #f8f9fa;
|
|
2821
|
+
--bs-btn-active-border-color: #f8f9fa;
|
|
2822
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2823
|
+
--bs-btn-disabled-color: #f8f9fa;
|
|
2824
|
+
--bs-btn-disabled-bg: transparent;
|
|
2825
|
+
--bs-btn-disabled-border-color: #f8f9fa;
|
|
2826
|
+
--bs-gradient: none;
|
|
2827
|
+
}
|
|
2828
|
+
|
|
2829
|
+
.btn-outline-dark {
|
|
2830
|
+
--bs-btn-color: #212529;
|
|
2831
|
+
--bs-btn-border-color: #212529;
|
|
2832
|
+
--bs-btn-hover-color: #fff;
|
|
2833
|
+
--bs-btn-hover-bg: #212529;
|
|
2834
|
+
--bs-btn-hover-border-color: #212529;
|
|
2835
|
+
--bs-btn-focus-shadow-rgb: 33, 37, 41;
|
|
2836
|
+
--bs-btn-active-color: #fff;
|
|
2837
|
+
--bs-btn-active-bg: #212529;
|
|
2838
|
+
--bs-btn-active-border-color: #212529;
|
|
2839
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
2840
|
+
--bs-btn-disabled-color: #212529;
|
|
2841
|
+
--bs-btn-disabled-bg: transparent;
|
|
2842
|
+
--bs-btn-disabled-border-color: #212529;
|
|
2843
|
+
--bs-gradient: none;
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2846
|
+
.btn-link {
|
|
2847
|
+
--bs-btn-font-weight: 400;
|
|
2848
|
+
--bs-btn-color: var(--bs-link-color);
|
|
2849
|
+
--bs-btn-bg: transparent;
|
|
2850
|
+
--bs-btn-border-color: transparent;
|
|
2851
|
+
--bs-btn-hover-color: var(--bs-link-hover-color);
|
|
2852
|
+
--bs-btn-hover-border-color: transparent;
|
|
2853
|
+
--bs-btn-active-color: var(--bs-link-hover-color);
|
|
2854
|
+
--bs-btn-active-border-color: transparent;
|
|
2855
|
+
--bs-btn-disabled-color: #6c757d;
|
|
2856
|
+
--bs-btn-disabled-border-color: transparent;
|
|
2857
|
+
--bs-btn-box-shadow: 0 0 0 #000;
|
|
2858
|
+
--bs-btn-focus-shadow-rgb: 49, 132, 253;
|
|
2859
|
+
text-decoration: underline;
|
|
2860
|
+
}
|
|
2861
|
+
.btn-link:focus-visible {
|
|
2862
|
+
color: var(--bs-btn-color);
|
|
2863
|
+
}
|
|
2864
|
+
.btn-link:hover {
|
|
2865
|
+
color: var(--bs-btn-hover-color);
|
|
2866
|
+
}
|
|
2867
|
+
|
|
2868
|
+
.btn-lg {
|
|
2869
|
+
--bs-btn-padding-y: 0.5rem;
|
|
2870
|
+
--bs-btn-padding-x: 1rem;
|
|
2871
|
+
--bs-btn-font-size: 1.25rem;
|
|
2872
|
+
--bs-btn-border-radius: var(--bs-border-radius-lg);
|
|
2873
|
+
}
|
|
2874
|
+
|
|
2875
|
+
.btn-sm {
|
|
2876
|
+
--bs-btn-padding-y: 0.25rem;
|
|
2877
|
+
--bs-btn-padding-x: 0.5rem;
|
|
2878
|
+
--bs-btn-font-size: 0.875rem;
|
|
2879
|
+
--bs-btn-border-radius: var(--bs-border-radius-sm);
|
|
2880
|
+
}
|
|
2881
|
+
|
|
2882
|
+
.form-control {
|
|
2883
|
+
display: block;
|
|
2884
|
+
width: 100%;
|
|
2885
|
+
padding: 0.375rem 0.75rem;
|
|
2886
|
+
font-size: 1rem;
|
|
2887
|
+
font-weight: 400;
|
|
2888
|
+
line-height: 1.5;
|
|
2889
|
+
color: var(--bs-body-color);
|
|
2890
|
+
appearance: none;
|
|
2891
|
+
background-color: var(--bs-body-bg);
|
|
2892
|
+
background-clip: padding-box;
|
|
2893
|
+
border: var(--bs-border-width) solid var(--bs-border-color);
|
|
2894
|
+
border-radius: var(--bs-border-radius);
|
|
2895
|
+
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
2896
|
+
}
|
|
2897
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2898
|
+
.form-control {
|
|
2899
|
+
transition: none;
|
|
2900
|
+
}
|
|
2901
|
+
}
|
|
2902
|
+
.form-control[type=file] {
|
|
2903
|
+
overflow: hidden;
|
|
2904
|
+
}
|
|
2905
|
+
.form-control[type=file]:not(:disabled):not([readonly]) {
|
|
2906
|
+
cursor: pointer;
|
|
2907
|
+
}
|
|
2908
|
+
.form-control:focus {
|
|
2909
|
+
color: var(--bs-body-color);
|
|
2910
|
+
background-color: var(--bs-body-bg);
|
|
2911
|
+
border-color: rgb(134, 182.5, 254);
|
|
2912
|
+
outline: 0;
|
|
2913
|
+
box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
|
|
2914
|
+
}
|
|
2915
|
+
.form-control::-webkit-date-and-time-value {
|
|
2916
|
+
min-width: 85px;
|
|
2917
|
+
height: 1.5em;
|
|
2918
|
+
margin: 0;
|
|
2919
|
+
}
|
|
2920
|
+
.form-control::-webkit-datetime-edit {
|
|
2921
|
+
display: block;
|
|
2922
|
+
padding: 0;
|
|
2923
|
+
}
|
|
2924
|
+
.form-control::placeholder {
|
|
2925
|
+
color: var(--bs-secondary-color);
|
|
2926
|
+
opacity: 1;
|
|
2927
|
+
}
|
|
2928
|
+
.form-control:disabled {
|
|
2929
|
+
background-color: var(--bs-secondary-bg);
|
|
2930
|
+
opacity: 1;
|
|
2931
|
+
}
|
|
2932
|
+
.form-control::file-selector-button {
|
|
2933
|
+
padding: 0.375rem 0.75rem;
|
|
2934
|
+
margin: -0.375rem -0.75rem;
|
|
2935
|
+
margin-inline-end: 0.75rem;
|
|
2936
|
+
color: var(--bs-body-color);
|
|
2937
|
+
background-color: var(--bs-tertiary-bg);
|
|
2938
|
+
pointer-events: none;
|
|
2939
|
+
border-color: inherit;
|
|
2940
|
+
border-style: solid;
|
|
2941
|
+
border-width: 0;
|
|
2942
|
+
border-inline-end-width: var(--bs-border-width);
|
|
2943
|
+
border-radius: 0;
|
|
2944
|
+
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
2945
|
+
}
|
|
2946
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2947
|
+
.form-control::file-selector-button {
|
|
2948
|
+
transition: none;
|
|
2949
|
+
}
|
|
2950
|
+
}
|
|
2951
|
+
.form-control:hover:not(:disabled):not([readonly])::file-selector-button {
|
|
2952
|
+
background-color: var(--bs-secondary-bg);
|
|
2953
|
+
}
|
|
2954
|
+
|
|
2955
|
+
.form-control-plaintext {
|
|
2956
|
+
display: block;
|
|
2957
|
+
width: 100%;
|
|
2958
|
+
padding: 0.375rem 0;
|
|
2959
|
+
margin-bottom: 0;
|
|
2960
|
+
line-height: 1.5;
|
|
2961
|
+
color: var(--bs-body-color);
|
|
2962
|
+
background-color: transparent;
|
|
2963
|
+
border: solid transparent;
|
|
2964
|
+
border-width: var(--bs-border-width) 0;
|
|
2965
|
+
}
|
|
2966
|
+
.form-control-plaintext:focus {
|
|
2967
|
+
outline: 0;
|
|
2968
|
+
}
|
|
2969
|
+
.form-control-plaintext.form-control-sm, .form-control-plaintext.form-control-lg {
|
|
2970
|
+
padding-right: 0;
|
|
2971
|
+
padding-left: 0;
|
|
2972
|
+
}
|
|
2973
|
+
|
|
2974
|
+
.form-control-sm {
|
|
2975
|
+
min-height: calc(1.5em + 0.5rem + calc(var(--bs-border-width) * 2));
|
|
2976
|
+
padding: 0.25rem 0.5rem;
|
|
2977
|
+
font-size: 0.875rem;
|
|
2978
|
+
border-radius: var(--bs-border-radius-sm);
|
|
2979
|
+
}
|
|
2980
|
+
.form-control-sm::file-selector-button {
|
|
2981
|
+
padding: 0.25rem 0.5rem;
|
|
2982
|
+
margin: -0.25rem -0.5rem;
|
|
2983
|
+
margin-inline-end: 0.5rem;
|
|
2984
|
+
}
|
|
2985
|
+
|
|
2986
|
+
.form-control-lg {
|
|
2987
|
+
min-height: calc(1.5em + 1rem + calc(var(--bs-border-width) * 2));
|
|
2988
|
+
padding: 0.5rem 1rem;
|
|
2989
|
+
font-size: 1.25rem;
|
|
2990
|
+
border-radius: var(--bs-border-radius-lg);
|
|
2991
|
+
}
|
|
2992
|
+
.form-control-lg::file-selector-button {
|
|
2993
|
+
padding: 0.5rem 1rem;
|
|
2994
|
+
margin: -0.5rem -1rem;
|
|
2995
|
+
margin-inline-end: 1rem;
|
|
2996
|
+
}
|
|
2997
|
+
|
|
2998
|
+
textarea.form-control {
|
|
2999
|
+
min-height: calc(1.5em + 0.75rem + calc(var(--bs-border-width) * 2));
|
|
3000
|
+
}
|
|
3001
|
+
textarea.form-control-sm {
|
|
3002
|
+
min-height: calc(1.5em + 0.5rem + calc(var(--bs-border-width) * 2));
|
|
3003
|
+
}
|
|
3004
|
+
textarea.form-control-lg {
|
|
3005
|
+
min-height: calc(1.5em + 1rem + calc(var(--bs-border-width) * 2));
|
|
3006
|
+
}
|
|
3007
|
+
|
|
3008
|
+
.form-control-color {
|
|
3009
|
+
width: 3rem;
|
|
3010
|
+
height: calc(1.5em + 0.75rem + calc(var(--bs-border-width) * 2));
|
|
3011
|
+
padding: 0.375rem;
|
|
3012
|
+
}
|
|
3013
|
+
.form-control-color:not(:disabled):not([readonly]) {
|
|
3014
|
+
cursor: pointer;
|
|
3015
|
+
}
|
|
3016
|
+
.form-control-color::-moz-color-swatch {
|
|
3017
|
+
border: 0 !important;
|
|
3018
|
+
border-radius: var(--bs-border-radius);
|
|
3019
|
+
}
|
|
3020
|
+
.form-control-color::-webkit-color-swatch {
|
|
3021
|
+
border: 0 !important;
|
|
3022
|
+
border-radius: var(--bs-border-radius);
|
|
3023
|
+
}
|
|
3024
|
+
.form-control-color.form-control-sm {
|
|
3025
|
+
height: calc(1.5em + 0.5rem + calc(var(--bs-border-width) * 2));
|
|
3026
|
+
}
|
|
3027
|
+
.form-control-color.form-control-lg {
|
|
3028
|
+
height: calc(1.5em + 1rem + calc(var(--bs-border-width) * 2));
|
|
3029
|
+
}
|
|
3030
|
+
|
|
3031
|
+
:host {
|
|
3032
|
+
display: block;
|
|
3033
|
+
font-family: var(--bs-body-font-family, system-ui);
|
|
3034
|
+
font-size: var(--bs-body-font-size, 1rem);
|
|
3035
|
+
color: var(--bs-body-color, currentColor);
|
|
3036
|
+
}
|
|
3037
|
+
|
|
3038
|
+
.qb-root {
|
|
3039
|
+
border: 1px solid var(--bs-border-color, #dee2e6);
|
|
3040
|
+
border-radius: var(--bs-border-radius, 0.375rem);
|
|
3041
|
+
padding: 0.5rem;
|
|
3042
|
+
background: var(--bs-body-bg, transparent);
|
|
3043
|
+
}
|
|
3044
|
+
|
|
3045
|
+
.qb-toolbar {
|
|
3046
|
+
display: flex;
|
|
3047
|
+
flex-wrap: wrap;
|
|
3048
|
+
gap: 0.75rem;
|
|
3049
|
+
align-items: center;
|
|
3050
|
+
margin-bottom: 0.5rem;
|
|
3051
|
+
padding: 0.5rem;
|
|
3052
|
+
background: var(--bs-tertiary-bg, #f8f9fa);
|
|
3053
|
+
border: 1px solid var(--bs-border-color, #dee2e6);
|
|
3054
|
+
border-radius: var(--bs-border-radius-sm, 0.25rem);
|
|
3055
|
+
}
|
|
3056
|
+
|
|
3057
|
+
.qb-toolbar-label {
|
|
3058
|
+
display: inline-flex;
|
|
3059
|
+
align-items: center;
|
|
3060
|
+
gap: 0.375rem;
|
|
3061
|
+
font-size: 0.875rem;
|
|
3062
|
+
font-weight: 500;
|
|
3063
|
+
margin: 0;
|
|
3064
|
+
}
|
|
3065
|
+
|
|
3066
|
+
.qb-entity-picker {
|
|
3067
|
+
width: auto;
|
|
3068
|
+
min-width: 8rem;
|
|
3069
|
+
}
|
|
3070
|
+
|
|
3071
|
+
.qb-toolbar-section {
|
|
3072
|
+
display: inline-flex;
|
|
3073
|
+
flex-wrap: wrap;
|
|
3074
|
+
gap: 0.5rem;
|
|
3075
|
+
align-items: center;
|
|
3076
|
+
}
|
|
3077
|
+
|
|
3078
|
+
.qb-field-checkbox {
|
|
3079
|
+
display: inline-flex;
|
|
3080
|
+
align-items: center;
|
|
3081
|
+
gap: 0.25rem;
|
|
3082
|
+
font-size: 0.875rem;
|
|
3083
|
+
font-weight: 400;
|
|
3084
|
+
margin: 0;
|
|
3085
|
+
cursor: pointer;
|
|
3086
|
+
}
|
|
3087
|
+
.qb-field-checkbox input[type=checkbox] {
|
|
3088
|
+
margin: 0;
|
|
3089
|
+
}
|
|
3090
|
+
|
|
3091
|
+
.qb-sort-row {
|
|
3092
|
+
display: inline-flex;
|
|
3093
|
+
align-items: center;
|
|
3094
|
+
gap: 0.25rem;
|
|
3095
|
+
font-size: 0.875rem;
|
|
3096
|
+
}
|
|
3097
|
+
.qb-sort-row .qb-sort-field,
|
|
3098
|
+
.qb-sort-row .qb-sort-direction {
|
|
3099
|
+
width: auto;
|
|
3100
|
+
}
|
|
3101
|
+
.qb-sort-row .qb-sort-field {
|
|
3102
|
+
min-width: 6rem;
|
|
3103
|
+
}
|
|
3104
|
+
.qb-sort-row .qb-sort-direction {
|
|
3105
|
+
min-width: 4.5rem;
|
|
3106
|
+
}
|
|
3107
|
+
.qb-sort-row .qb-sort-remove {
|
|
3108
|
+
padding: 0 0.375rem;
|
|
3109
|
+
line-height: 1;
|
|
3110
|
+
color: var(--bs-danger, #dc3545);
|
|
3111
|
+
}
|
|
3112
|
+
|
|
3113
|
+
.qb-too-deep {
|
|
3114
|
+
padding: 0.5rem;
|
|
3115
|
+
color: var(--bs-warning-text-emphasis, #997404);
|
|
3116
|
+
background: var(--bs-warning-bg-subtle, #fff3cd);
|
|
3117
|
+
border: 1px solid var(--bs-warning-border-subtle, #ffe69c);
|
|
3118
|
+
border-radius: var(--bs-border-radius, 0.375rem);
|
|
3119
|
+
font-style: italic;
|
|
3120
|
+
}
|
|
3121
|
+
|
|
3122
|
+
.qb-saved {
|
|
3123
|
+
display: flex;
|
|
3124
|
+
flex-wrap: wrap;
|
|
3125
|
+
gap: 0.5rem;
|
|
3126
|
+
align-items: center;
|
|
3127
|
+
margin-bottom: 0.5rem;
|
|
3128
|
+
padding: 0.5rem;
|
|
3129
|
+
background: var(--bs-tertiary-bg, #f8f9fa);
|
|
3130
|
+
border: 1px solid var(--bs-border-color, #dee2e6);
|
|
3131
|
+
border-radius: var(--bs-border-radius-sm, 0.25rem);
|
|
3132
|
+
}
|
|
3133
|
+
|
|
3134
|
+
.qb-saved-list {
|
|
3135
|
+
display: flex;
|
|
3136
|
+
flex-wrap: wrap;
|
|
3137
|
+
gap: 0.5rem;
|
|
3138
|
+
}
|
|
3139
|
+
|
|
3140
|
+
.qb-saved-row {
|
|
3141
|
+
display: inline-flex;
|
|
3142
|
+
align-items: center;
|
|
3143
|
+
gap: 0.125rem;
|
|
3144
|
+
}
|
|
3145
|
+
|
|
3146
|
+
.qb-saved-new {
|
|
3147
|
+
display: inline-flex;
|
|
3148
|
+
align-items: center;
|
|
3149
|
+
gap: 0.25rem;
|
|
3150
|
+
margin-left: auto;
|
|
3151
|
+
}
|
|
3152
|
+
|
|
3153
|
+
.qb-saved-empty {
|
|
3154
|
+
color: var(--bs-secondary-color, #6c757d);
|
|
3155
|
+
font-style: italic;
|
|
3156
|
+
font-size: 0.875rem;
|
|
3157
|
+
}
|
|
3158
|
+
|
|
3159
|
+
.qb-preview {
|
|
3160
|
+
margin: 0 0 0.5rem;
|
|
3161
|
+
padding: 0.5rem;
|
|
3162
|
+
background: var(--bs-secondary-bg, #f8f9fa);
|
|
3163
|
+
border: 1px solid var(--bs-border-color, #dee2e6);
|
|
3164
|
+
border-radius: var(--bs-border-radius-sm, 0.25rem);
|
|
3165
|
+
font-family: var(--bs-font-monospace, monospace);
|
|
3166
|
+
font-size: 0.8125rem;
|
|
3167
|
+
color: var(--bs-body-color, currentColor);
|
|
3168
|
+
white-space: pre-wrap;
|
|
3169
|
+
word-break: break-word;
|
|
3170
|
+
}`), Le = 32;
|
|
3171
|
+
class Ne extends S {
|
|
3172
|
+
constructor() {
|
|
3173
|
+
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, {
|
|
3174
|
+
context: F,
|
|
3175
|
+
subscribe: !0
|
|
3176
|
+
}), this._registryProvider = new k(this, {
|
|
3177
|
+
context: F,
|
|
3178
|
+
initialValue: void 0
|
|
3179
|
+
}), this._disabledConsumer = new p(this, {
|
|
3180
|
+
context: E,
|
|
3181
|
+
subscribe: !0
|
|
3182
|
+
}), this._disabledProvider = new k(this, {
|
|
3183
|
+
context: E,
|
|
3184
|
+
initialValue: void 0
|
|
3185
|
+
}), this._messagesConsumer = new p(this, {
|
|
3186
|
+
context: q,
|
|
3187
|
+
subscribe: !0
|
|
3188
|
+
}), this._messagesProvider = new k(this, {
|
|
3189
|
+
context: q,
|
|
3190
|
+
initialValue: void 0
|
|
3191
|
+
}), this._maxDepthConsumer = new p(this, {
|
|
3192
|
+
context: B,
|
|
3193
|
+
subscribe: !0
|
|
3194
|
+
}), this._maxDepthProvider = new k(this, {
|
|
3195
|
+
context: B,
|
|
3196
|
+
initialValue: void 0
|
|
3197
|
+
}), this._lastMessagesOwn = void 0, this._lastMessagesConsumed = void 0, this._lastEffMessages = void 0, this._onConditionFieldChange = (e) => {
|
|
3198
|
+
if (!this._handlesEvents()) return;
|
|
3199
|
+
e.stopPropagation();
|
|
3200
|
+
const { id: t, field: r } = e.detail, n = this.query;
|
|
3201
|
+
if (!n) return;
|
|
3202
|
+
const b = this._resolveEntityForNode(t)?.fields.find((i) => i.name === r);
|
|
3203
|
+
b && this._mutate(he(n, t, b));
|
|
3204
|
+
}, this._onConditionOperatorChange = (e) => {
|
|
3205
|
+
if (!this._handlesEvents()) return;
|
|
3206
|
+
e.stopPropagation();
|
|
3207
|
+
const { id: t, operator: r } = e.detail, n = this.query;
|
|
3208
|
+
n && this._mutate(ge(n, t, r));
|
|
3209
|
+
}, this._onConditionValueChange = (e) => {
|
|
3210
|
+
if (!this._handlesEvents()) return;
|
|
3211
|
+
e.stopPropagation();
|
|
3212
|
+
const { id: t, value: r } = e.detail, n = this.query;
|
|
3213
|
+
n && this._mutate(fe(n, t, { value: r }));
|
|
3214
|
+
}, this._onGroupLogicChange = (e) => {
|
|
3215
|
+
if (!this._handlesEvents()) return;
|
|
3216
|
+
e.stopPropagation();
|
|
3217
|
+
const { id: t, logic: r } = e.detail, n = this.query;
|
|
3218
|
+
n && this._mutate(ue(n, t, r));
|
|
3219
|
+
}, this._onAddCondition = (e) => {
|
|
3220
|
+
if (!this._handlesEvents()) return;
|
|
3221
|
+
e.stopPropagation();
|
|
3222
|
+
const { groupId: t } = e.detail, r = this.query;
|
|
3223
|
+
if (!r) return;
|
|
3224
|
+
const n = this._resolveEntityForNode(t);
|
|
3225
|
+
n && this._mutate(de(r, t, n));
|
|
3226
|
+
}, this._onAddGroup = (e) => {
|
|
3227
|
+
if (!this._handlesEvents()) return;
|
|
3228
|
+
e.stopPropagation();
|
|
3229
|
+
const { groupId: t } = e.detail, r = this.query;
|
|
3230
|
+
r && this._mutate(le(r, t, "and"));
|
|
3231
|
+
}, this._onAddSubquery = (e) => {
|
|
3232
|
+
if (!this._handlesEvents()) return;
|
|
3233
|
+
e.stopPropagation();
|
|
3234
|
+
const { groupId: t } = e.detail, r = this.query;
|
|
3235
|
+
if (!r) return;
|
|
3236
|
+
const n = this._resolveEntityForNode(t);
|
|
3237
|
+
n && this._mutate(ce(r, t, n));
|
|
3238
|
+
}, this._onNodeRemove = (e) => {
|
|
3239
|
+
if (!this._handlesEvents()) return;
|
|
3240
|
+
e.stopPropagation();
|
|
3241
|
+
const { id: t } = e.detail, r = this.query;
|
|
3242
|
+
r && r.id !== t && this._mutate(X(r, t));
|
|
3243
|
+
}, this._pendingRefocusId = null, this._onKeyboardMove = (e) => {
|
|
3244
|
+
if (!this._handlesEvents()) return;
|
|
3245
|
+
e.stopPropagation();
|
|
3246
|
+
const { id: t, direction: r } = e.detail, n = this.query;
|
|
3247
|
+
if (!n) return;
|
|
3248
|
+
const s = P(n, t);
|
|
3249
|
+
if (!s) return;
|
|
3250
|
+
const b = r === "up" ? s.index - 1 : s.index + 1;
|
|
3251
|
+
b < 0 || b >= s.parent.children.length || (this._pendingRefocusId = t, this._mutate(H(n, t, s.parent.id, b)));
|
|
3252
|
+
}, this._onDragStart = (e) => {
|
|
3253
|
+
if (!this._handlesEvents()) return;
|
|
3254
|
+
e.stopPropagation();
|
|
3255
|
+
const t = e.detail, r = this.query;
|
|
3256
|
+
if (!r) return;
|
|
3257
|
+
const n = _(r, t.id);
|
|
3258
|
+
if (!n) return;
|
|
3259
|
+
const s = V(n);
|
|
3260
|
+
this._drag.start(
|
|
3261
|
+
{
|
|
3262
|
+
id: t.id,
|
|
3263
|
+
descendantIds: s,
|
|
3264
|
+
qbRoot: this._qbRootId,
|
|
3265
|
+
rowElement: t.rowElement
|
|
3266
|
+
},
|
|
3267
|
+
new PointerEvent("pointerdown", { pointerId: t.pointerId, clientX: t.clientX, clientY: t.clientY })
|
|
3268
|
+
), this._isDragging = !0, typeof window < "u" && (this._pointerMoveHandler = (b) => this._drag.move(b), this._pointerUpHandler = (b) => this._finishDrag(b), this._pointerCancelHandler = () => this._cancelDrag(), window.addEventListener("pointermove", this._pointerMoveHandler), window.addEventListener("pointerup", this._pointerUpHandler), window.addEventListener("pointercancel", this._pointerCancelHandler));
|
|
3269
|
+
}, this._onSaveDraftInput = (e) => {
|
|
3270
|
+
this._saveDraftName = e.target.value;
|
|
3271
|
+
}, this._onSaveQuery = () => {
|
|
3272
|
+
const e = this._saveDraftName.trim();
|
|
3273
|
+
if (!e) return;
|
|
3274
|
+
const t = this.query;
|
|
3275
|
+
t && (this.dispatchEvent(new CustomEvent("save-query", {
|
|
3276
|
+
detail: { name: e, tree: t },
|
|
3277
|
+
bubbles: !1
|
|
3278
|
+
})), this._saveDraftName = "");
|
|
3279
|
+
}, this._onLoadQuery = (e) => {
|
|
3280
|
+
this.dispatchEvent(new CustomEvent("load-query", {
|
|
3281
|
+
detail: { name: e },
|
|
3282
|
+
bubbles: !1
|
|
3283
|
+
}));
|
|
3284
|
+
}, this._onDeleteQuery = (e) => {
|
|
3285
|
+
this.dispatchEvent(new CustomEvent("delete-query", {
|
|
3286
|
+
detail: { name: e },
|
|
3287
|
+
bubbles: !1
|
|
3288
|
+
}));
|
|
3289
|
+
}, this._onRootEntityChange = (e) => {
|
|
3290
|
+
const t = e.target.value;
|
|
3291
|
+
t !== this.rootEntity && (this.rootEntity = t, this.dispatchEvent(new CustomEvent("root-entity-change", {
|
|
3292
|
+
detail: { rootEntity: t },
|
|
3293
|
+
bubbles: !1,
|
|
3294
|
+
composed: !1
|
|
3295
|
+
})));
|
|
3296
|
+
};
|
|
3297
|
+
}
|
|
3298
|
+
static {
|
|
3299
|
+
this.styles = [Ie];
|
|
3300
|
+
}
|
|
3301
|
+
static {
|
|
3302
|
+
this.properties = {
|
|
3303
|
+
query: { attribute: !1 },
|
|
3304
|
+
schema: { attribute: !1 },
|
|
3305
|
+
rootEntity: { attribute: "root-entity", type: String, reflect: !0 },
|
|
3306
|
+
multiEntityPickerEnabled: { attribute: "multi-entity-picker-enabled", type: Boolean, reflect: !0 },
|
|
3307
|
+
selectedFields: { attribute: !1 },
|
|
3308
|
+
sortBy: { attribute: !1 },
|
|
3309
|
+
disabled: { attribute: "disabled", type: Boolean, reflect: !0 },
|
|
3310
|
+
editorRegistry: { attribute: !1 },
|
|
3311
|
+
messages: { attribute: !1 },
|
|
3312
|
+
maxDepth: { attribute: "max-depth", type: Number, reflect: !0 },
|
|
3313
|
+
showPreview: { attribute: "show-preview", type: Boolean, reflect: !0 },
|
|
3314
|
+
showSavedQueries: { attribute: "show-saved-queries", type: Boolean, reflect: !0 },
|
|
3315
|
+
savedQueries: { attribute: !1 },
|
|
3316
|
+
depth: { attribute: !1 },
|
|
3317
|
+
_isDragging: { state: !0 },
|
|
3318
|
+
_saveDraftName: { state: !0 }
|
|
3319
|
+
};
|
|
3320
|
+
}
|
|
3321
|
+
willUpdate(e) {
|
|
3322
|
+
const t = this.editorRegistry ?? this._registryConsumer.value;
|
|
3323
|
+
this._registryProvider.setValue(t);
|
|
3324
|
+
const r = (this._disabledConsumer.value ?? !1) || (this.disabled ?? !1);
|
|
3325
|
+
this._disabledProvider.setValue(r);
|
|
3326
|
+
const n = this.messages, s = this._messagesConsumer.value;
|
|
3327
|
+
let b;
|
|
3328
|
+
this._lastEffMessages !== void 0 && this._lastMessagesOwn === n && this._lastMessagesConsumed === s ? b = this._lastEffMessages : (b = { ...s ?? {}, ...n ?? {} }, this._lastMessagesOwn = n, this._lastMessagesConsumed = s, this._lastEffMessages = b), this._messagesProvider.setValue(b);
|
|
3329
|
+
const a = this._maxDepthConsumer.value ?? this.maxDepth;
|
|
3330
|
+
this._maxDepthProvider.setValue(a);
|
|
3331
|
+
}
|
|
3332
|
+
updated(e) {
|
|
3333
|
+
if (this._pendingRefocusId === null) return;
|
|
3334
|
+
const t = this._pendingRefocusId;
|
|
3335
|
+
this._pendingRefocusId = null, queueMicrotask(() => this._focusRowById(t));
|
|
3336
|
+
}
|
|
3337
|
+
_focusRowById(e) {
|
|
3338
|
+
const t = (n) => {
|
|
3339
|
+
const s = n.querySelector(`[data-row-id="${e}"]`);
|
|
3340
|
+
if (s)
|
|
3341
|
+
return s.querySelector(".qb-subquery-header") ?? s;
|
|
3342
|
+
for (const b of Array.from(n.querySelectorAll("*")))
|
|
3343
|
+
if (b.shadowRoot) {
|
|
3344
|
+
const i = t(b.shadowRoot);
|
|
3345
|
+
if (i) return i;
|
|
3346
|
+
}
|
|
3347
|
+
return null;
|
|
3348
|
+
};
|
|
3349
|
+
(this.shadowRoot ? t(this.shadowRoot) : null)?.focus();
|
|
3350
|
+
}
|
|
3351
|
+
/**
|
|
3352
|
+
* Effective max-depth used for the render check. The OUTER builder's
|
|
3353
|
+
* configured maxDepth flows in via context; if absent, we fall back to
|
|
3354
|
+
* this WC's own `maxDepth` property (which defaults to 32).
|
|
3355
|
+
*/
|
|
3356
|
+
effectiveMaxDepth() {
|
|
3357
|
+
return this._maxDepthConsumer.value ?? this.maxDepth;
|
|
3358
|
+
}
|
|
3359
|
+
_entitySchemaForCurrentRoot() {
|
|
3360
|
+
return this.schema.find((e) => e.name === this.rootEntity) ?? null;
|
|
3361
|
+
}
|
|
3362
|
+
// Walk the entire tree (incl. sub-query bodies) to find the entity context
|
|
3363
|
+
// that contains a given node id. Falls back to rootEntity.
|
|
3364
|
+
_resolveEntityForNode(e) {
|
|
3365
|
+
const t = this._entitySchemaForCurrentRoot();
|
|
3366
|
+
if (!t) return null;
|
|
3367
|
+
const r = this.query;
|
|
3368
|
+
if (!r) return t;
|
|
3369
|
+
const n = { entity: t }, s = (b, i) => {
|
|
3370
|
+
if (b.id === e)
|
|
3371
|
+
return n.entity = i, !0;
|
|
3372
|
+
if (b.kind === "group") {
|
|
3373
|
+
for (const a of b.children)
|
|
3374
|
+
if (s(a, i)) return !0;
|
|
3375
|
+
} else if (b.kind === "subquery") {
|
|
3376
|
+
const a = i.fields.find((c) => c.name === b.field), l = a?.targetEntity ? this.schema.find((c) => c.name === a.targetEntity) ?? i : i;
|
|
3377
|
+
if (s(b.subQuery, l)) return !0;
|
|
3378
|
+
}
|
|
3379
|
+
return !1;
|
|
3380
|
+
};
|
|
3381
|
+
return s(r, t), n.entity;
|
|
3382
|
+
}
|
|
3383
|
+
_mutate(e) {
|
|
3384
|
+
this.query = e, this.dispatchEvent(new CustomEvent("query-change", {
|
|
3385
|
+
detail: { tree: e },
|
|
3386
|
+
// M7 will consolidate and re-dispatch externally; for now expose
|
|
3387
|
+
// to outside listeners on the root builder only.
|
|
3388
|
+
bubbles: !1,
|
|
3389
|
+
composed: !1
|
|
3390
|
+
}));
|
|
3391
|
+
}
|
|
3392
|
+
// Inner sub-query builders (depth > 0) skip their handlers so events bubble
|
|
3393
|
+
// up to the outermost root, which owns the canonical tree.
|
|
3394
|
+
_handlesEvents() {
|
|
3395
|
+
return this.depth === 0;
|
|
3396
|
+
}
|
|
3397
|
+
_finishDrag(e) {
|
|
3398
|
+
const t = this._drag.end(e);
|
|
3399
|
+
this._teardownDragListeners(), this._isDragging = !1, t && this._applyDrop(t);
|
|
3400
|
+
}
|
|
3401
|
+
_cancelDrag() {
|
|
3402
|
+
this._drag.cancel(), this._teardownDragListeners(), this._isDragging = !1;
|
|
3403
|
+
}
|
|
3404
|
+
_teardownDragListeners() {
|
|
3405
|
+
typeof window > "u" || (this._pointerMoveHandler && window.removeEventListener("pointermove", this._pointerMoveHandler), this._pointerUpHandler && window.removeEventListener("pointerup", this._pointerUpHandler), this._pointerCancelHandler && window.removeEventListener("pointercancel", this._pointerCancelHandler), this._pointerMoveHandler = null, this._pointerUpHandler = null, this._pointerCancelHandler = null);
|
|
3406
|
+
}
|
|
3407
|
+
_applyDrop(e) {
|
|
3408
|
+
const t = this.query, r = this._drag.source();
|
|
3409
|
+
if (!t || !r) return;
|
|
3410
|
+
const n = e.qbRoot !== r.qbRoot ? this._schemaForGroup(e.parentId) : void 0, s = H(t, r.id, e.parentId, e.index, n);
|
|
3411
|
+
this._mutate(s);
|
|
3412
|
+
}
|
|
3413
|
+
_schemaForGroup(e) {
|
|
3414
|
+
const t = this.query;
|
|
3415
|
+
if (!t) return;
|
|
3416
|
+
const r = this._entitySchemaForCurrentRoot();
|
|
3417
|
+
if (!r) return;
|
|
3418
|
+
const n = { schema: r }, s = (b, i) => {
|
|
3419
|
+
if (b.id === e)
|
|
3420
|
+
return n.schema = i, !0;
|
|
3421
|
+
if (b.kind === "group") {
|
|
3422
|
+
for (const a of b.children) if (s(a, i)) return !0;
|
|
3423
|
+
} else if (b.kind === "subquery") {
|
|
3424
|
+
const a = i.fields.find((c) => c.name === b.field), l = a?.targetEntity ? this.schema.find((c) => c.name === a.targetEntity) ?? i : i;
|
|
3425
|
+
if (s(b.subQuery, l)) return !0;
|
|
3426
|
+
}
|
|
3427
|
+
return !1;
|
|
3428
|
+
};
|
|
3429
|
+
return s(t, r), n.schema;
|
|
3430
|
+
}
|
|
3431
|
+
disconnectedCallback() {
|
|
3432
|
+
super.disconnectedCallback(), this._teardownDragListeners(), this._drag.cancel();
|
|
3433
|
+
}
|
|
3434
|
+
_renderSavedPicker(e) {
|
|
3435
|
+
return d`
|
|
3436
|
+
<div class="qb-saved" part="saved-picker">
|
|
3437
|
+
<div class="qb-saved-list" part="saved-list">
|
|
3438
|
+
${this.savedQueries.length === 0 ? d`<span class="qb-saved-empty">No saved queries</span>` : this.savedQueries.map((t) => d`
|
|
3439
|
+
<span class="qb-saved-row" part="saved-row" data-name=${t.name}>
|
|
3440
|
+
<button
|
|
3441
|
+
type="button"
|
|
3442
|
+
class="btn btn-sm btn-outline-primary qb-saved-load"
|
|
3443
|
+
@click=${() => this._onLoadQuery(t.name)}
|
|
3444
|
+
>${e.loadQuery}: ${t.name}</button>
|
|
3445
|
+
<button
|
|
3446
|
+
type="button"
|
|
3447
|
+
class="btn btn-sm btn-outline-danger qb-saved-delete"
|
|
3448
|
+
aria-label=${`Delete ${t.name}`}
|
|
3449
|
+
@click=${() => this._onDeleteQuery(t.name)}
|
|
3450
|
+
>${e.deleteQuery}</button>
|
|
3451
|
+
</span>
|
|
3452
|
+
`)}
|
|
3453
|
+
</div>
|
|
3454
|
+
<span class="qb-saved-new" part="saved-new">
|
|
3455
|
+
<input
|
|
3456
|
+
type="text"
|
|
3457
|
+
class="form-control form-control-sm qb-saved-name"
|
|
3458
|
+
placeholder=${e.saveCurrentAs}
|
|
3459
|
+
.value=${this._saveDraftName}
|
|
3460
|
+
@input=${this._onSaveDraftInput}
|
|
3461
|
+
aria-label="Name for saved query"
|
|
3462
|
+
/>
|
|
3463
|
+
<button
|
|
3464
|
+
type="button"
|
|
3465
|
+
class="btn btn-sm btn-primary qb-saved-save"
|
|
3466
|
+
?disabled=${this._saveDraftName.trim() === ""}
|
|
3467
|
+
@click=${this._onSaveQuery}
|
|
3468
|
+
>💾 ${e.saveCurrentAs}</button>
|
|
3469
|
+
</span>
|
|
3470
|
+
</div>
|
|
3471
|
+
`;
|
|
3472
|
+
}
|
|
3473
|
+
/**
|
|
3474
|
+
* Toolbar render. Only emits when `depth === 0` (sub-query builders have
|
|
3475
|
+
* no toolbar of their own — they inherit the outer one) AND
|
|
3476
|
+
* `multiEntityPickerEnabled` is true AND `schema.length > 1`. Future
|
|
3477
|
+
* Phase-2 widgets (field projection, sort-by) hang off this same toolbar.
|
|
3478
|
+
*/
|
|
3479
|
+
_renderToolbar() {
|
|
3480
|
+
if (this.depth !== 0) return u;
|
|
3481
|
+
if (!this.multiEntityPickerEnabled) return u;
|
|
3482
|
+
if (this.schema.length < 2) return u;
|
|
3483
|
+
const t = this.schema.find((r) => r.name === this.rootEntity)?.fields.filter((r) => r.type !== "relation") ?? [];
|
|
3484
|
+
return d`
|
|
3485
|
+
<div class="qb-toolbar" part="toolbar">
|
|
3486
|
+
<label class="qb-toolbar-label">
|
|
3487
|
+
Entity:
|
|
3488
|
+
<mp-select
|
|
3489
|
+
class="qb-entity-picker"
|
|
3490
|
+
size="sm"
|
|
3491
|
+
part="entity-picker"
|
|
3492
|
+
.value=${this.rootEntity}
|
|
3493
|
+
?disabled=${this.disabled}
|
|
3494
|
+
@change=${this._onRootEntityChange}
|
|
3495
|
+
aria-label="Entity"
|
|
3496
|
+
>
|
|
3497
|
+
${this.schema.map((r) => d`<option value=${r.name}>${r.label}</option>`)}
|
|
3498
|
+
</mp-select>
|
|
3499
|
+
</label>
|
|
3500
|
+
${t.length > 0 ? d`
|
|
3501
|
+
<span class="qb-toolbar-section qb-field-projection" part="field-projection" role="group" aria-label="Columns">
|
|
3502
|
+
<span class="qb-toolbar-label">Columns:</span>
|
|
3503
|
+
${t.map((r) => d`
|
|
3504
|
+
<mp-checkbox
|
|
3505
|
+
class="qb-field-checkbox"
|
|
3506
|
+
value=${r.name}
|
|
3507
|
+
?checked=${this.selectedFields.includes(r.name)}
|
|
3508
|
+
?disabled=${this.disabled}
|
|
3509
|
+
@change=${(n) => this._onFieldProjectionToggle(r.name, n)}
|
|
3510
|
+
aria-label=${r.label}
|
|
3511
|
+
>${r.label}</mp-checkbox>
|
|
3512
|
+
`)}
|
|
3513
|
+
</span>
|
|
3514
|
+
` : u}
|
|
3515
|
+
${t.length > 0 ? this._renderSortBy(t) : u}
|
|
3516
|
+
</div>
|
|
3517
|
+
`;
|
|
3518
|
+
}
|
|
3519
|
+
_renderSortBy(e) {
|
|
3520
|
+
return d`
|
|
3521
|
+
<span class="qb-toolbar-section qb-sort-by" part="sort-by" role="group" aria-label="Sort by">
|
|
3522
|
+
<span class="qb-toolbar-label">Sort by:</span>
|
|
3523
|
+
${this.sortBy.map((t, r) => d`
|
|
3524
|
+
<span class="qb-sort-row" part="sort-row">
|
|
3525
|
+
<mp-select
|
|
3526
|
+
class="qb-sort-field"
|
|
3527
|
+
size="sm"
|
|
3528
|
+
.value=${t.field}
|
|
3529
|
+
?disabled=${this.disabled}
|
|
3530
|
+
@change=${(n) => this._onSortFieldChange(r, n)}
|
|
3531
|
+
aria-label=${`Sort ${r + 1} field`}
|
|
3532
|
+
>
|
|
3533
|
+
${e.map((n) => d`<option value=${n.name}>${n.label}</option>`)}
|
|
3534
|
+
${e.some((n) => n.name === t.field) ? u : d`
|
|
3535
|
+
<option value=${t.field}>(${t.field})</option>
|
|
3536
|
+
`}
|
|
3537
|
+
</mp-select>
|
|
3538
|
+
<mp-select
|
|
3539
|
+
class="qb-sort-direction"
|
|
3540
|
+
size="sm"
|
|
3541
|
+
.value=${t.direction}
|
|
3542
|
+
?disabled=${this.disabled}
|
|
3543
|
+
@change=${(n) => this._onSortDirectionChange(r, n)}
|
|
3544
|
+
aria-label=${`Sort ${r + 1} direction`}
|
|
3545
|
+
>
|
|
3546
|
+
<option value="asc">Asc</option>
|
|
3547
|
+
<option value="desc">Desc</option>
|
|
3548
|
+
</mp-select>
|
|
3549
|
+
<button
|
|
3550
|
+
type="button"
|
|
3551
|
+
class="btn btn-sm btn-link qb-sort-remove"
|
|
3552
|
+
?disabled=${this.disabled}
|
|
3553
|
+
@click=${() => this._onSortRemove(r)}
|
|
3554
|
+
aria-label=${`Remove sort ${r + 1}`}
|
|
3555
|
+
title="Remove this sort"
|
|
3556
|
+
>×</button>
|
|
3557
|
+
</span>
|
|
3558
|
+
`)}
|
|
3559
|
+
<button
|
|
3560
|
+
type="button"
|
|
3561
|
+
class="btn btn-sm btn-outline-secondary qb-sort-add"
|
|
3562
|
+
part="sort-add"
|
|
3563
|
+
?disabled=${this.disabled || e.length === 0}
|
|
3564
|
+
@click=${() => this._onSortAdd(e)}
|
|
3565
|
+
>+ Add sort</button>
|
|
3566
|
+
</span>
|
|
3567
|
+
`;
|
|
3568
|
+
}
|
|
3569
|
+
_emitSortBy(e) {
|
|
3570
|
+
this.sortBy = e, this.dispatchEvent(new CustomEvent("sort-by-change", {
|
|
3571
|
+
detail: { sortBy: e },
|
|
3572
|
+
bubbles: !1,
|
|
3573
|
+
composed: !1
|
|
3574
|
+
}));
|
|
3575
|
+
}
|
|
3576
|
+
_onSortFieldChange(e, t) {
|
|
3577
|
+
const r = t.target.value, n = this.sortBy.map((s, b) => b === e ? { ...s, field: r } : s);
|
|
3578
|
+
this._emitSortBy(n);
|
|
3579
|
+
}
|
|
3580
|
+
_onSortDirectionChange(e, t) {
|
|
3581
|
+
const r = t.target.value, n = this.sortBy.map((s, b) => b === e ? { ...s, direction: r } : s);
|
|
3582
|
+
this._emitSortBy(n);
|
|
3583
|
+
}
|
|
3584
|
+
_onSortRemove(e) {
|
|
3585
|
+
const t = this.sortBy.filter((r, n) => n !== e);
|
|
3586
|
+
this._emitSortBy(t);
|
|
3587
|
+
}
|
|
3588
|
+
_onSortAdd(e) {
|
|
3589
|
+
const t = e[0];
|
|
3590
|
+
if (!t) return;
|
|
3591
|
+
const r = new Set(this.sortBy.map((s) => s.field)), n = e.find((s) => !r.has(s.name)) ?? t;
|
|
3592
|
+
this._emitSortBy([...this.sortBy, { field: n.name, direction: "asc" }]);
|
|
3593
|
+
}
|
|
3594
|
+
_onFieldProjectionToggle(e, t) {
|
|
3595
|
+
const r = t.target.checked, n = new Set(this.selectedFields);
|
|
3596
|
+
r ? n.add(e) : n.delete(e);
|
|
3597
|
+
const s = Array.from(n);
|
|
3598
|
+
this.selectedFields = s, this.dispatchEvent(new CustomEvent("selected-fields-change", {
|
|
3599
|
+
detail: { selectedFields: s },
|
|
3600
|
+
bubbles: !1,
|
|
3601
|
+
composed: !1
|
|
3602
|
+
}));
|
|
3603
|
+
}
|
|
3604
|
+
render() {
|
|
3605
|
+
if (this.depth > this.effectiveMaxDepth())
|
|
3606
|
+
return d`<div class="qb-too-deep" role="alert">Tree too deep</div>`;
|
|
3607
|
+
const e = this.query;
|
|
3608
|
+
return e ? d`
|
|
3609
|
+
<div
|
|
3610
|
+
class="qb-root"
|
|
3611
|
+
part="root"
|
|
3612
|
+
data-qb-root=${this._qbRootId}
|
|
3613
|
+
@condition-field-change=${this._onConditionFieldChange}
|
|
3614
|
+
@condition-operator-change=${this._onConditionOperatorChange}
|
|
3615
|
+
@condition-value-change=${this._onConditionValueChange}
|
|
3616
|
+
@group-logic-change=${this._onGroupLogicChange}
|
|
3617
|
+
@add-condition=${this._onAddCondition}
|
|
3618
|
+
@add-group=${this._onAddGroup}
|
|
3619
|
+
@add-subquery=${this._onAddSubquery}
|
|
3620
|
+
@node-remove=${this._onNodeRemove}
|
|
3621
|
+
@qb-drag-start=${this._onDragStart}
|
|
3622
|
+
@qb-keyboard-move=${this._onKeyboardMove}
|
|
3623
|
+
>
|
|
3624
|
+
${this._renderToolbar()}
|
|
3625
|
+
${this.showSavedQueries && this.depth === 0 ? this._renderSavedPicker(this._messages()) : u}
|
|
3626
|
+
${this.showPreview && this.depth === 0 ? d`<pre class="qb-preview" part="preview">${this._renderPreview(e)}</pre>` : u}
|
|
3627
|
+
${this.renderTreeRoot(e)}
|
|
3628
|
+
</div>
|
|
3629
|
+
` : u;
|
|
3630
|
+
}
|
|
3631
|
+
_messages() {
|
|
3632
|
+
const e = this._messagesConsumer.value ?? {};
|
|
3633
|
+
return {
|
|
3634
|
+
...m,
|
|
3635
|
+
...e,
|
|
3636
|
+
...this.messages ?? {},
|
|
3637
|
+
operators: {
|
|
3638
|
+
...m.operators,
|
|
3639
|
+
...e.operators ?? {},
|
|
3640
|
+
...this.messages?.operators ?? {}
|
|
3641
|
+
}
|
|
3642
|
+
};
|
|
3643
|
+
}
|
|
3644
|
+
_renderPreview(e) {
|
|
3645
|
+
try {
|
|
3646
|
+
const t = {
|
|
3647
|
+
...this._messagesConsumer.value ?? {},
|
|
3648
|
+
...this.messages ?? {}
|
|
3649
|
+
};
|
|
3650
|
+
return ve(e, this.schema, {
|
|
3651
|
+
messages: t,
|
|
3652
|
+
rootEntity: this.rootEntity,
|
|
3653
|
+
maxDepth: this.effectiveMaxDepth()
|
|
3654
|
+
});
|
|
3655
|
+
} catch (t) {
|
|
3656
|
+
return t instanceof Error ? t.message : String(t);
|
|
3657
|
+
}
|
|
3658
|
+
}
|
|
3659
|
+
renderTreeRoot(e) {
|
|
3660
|
+
return e.kind === "group" ? d`<mp-query-group
|
|
3661
|
+
.node=${e}
|
|
3662
|
+
.schema=${this.schema}
|
|
3663
|
+
.currentEntity=${this.rootEntity}
|
|
3664
|
+
.depth=${this.depth}
|
|
3665
|
+
.isRoot=${!0}
|
|
3666
|
+
.qbRoot=${this._qbRootId}
|
|
3667
|
+
.isDragging=${this._isDragging}
|
|
3668
|
+
></mp-query-group>` : d`<mp-query-group
|
|
3669
|
+
.node=${{
|
|
3670
|
+
kind: "group",
|
|
3671
|
+
id: "synthetic-root",
|
|
3672
|
+
logic: "and",
|
|
3673
|
+
children: [e]
|
|
3674
|
+
}}
|
|
3675
|
+
.schema=${this.schema}
|
|
3676
|
+
.currentEntity=${this.rootEntity}
|
|
3677
|
+
.depth=${this.depth}
|
|
3678
|
+
.isRoot=${!0}
|
|
3679
|
+
.qbRoot=${this._qbRootId}
|
|
3680
|
+
.isDragging=${this._isDragging}
|
|
3681
|
+
></mp-query-group>`;
|
|
3682
|
+
}
|
|
3683
|
+
}
|
|
3684
|
+
typeof customElements < "u" && !customElements.get("mp-query-builder") && customElements.define("mp-query-builder", Ne);
|
|
3685
|
+
export {
|
|
3686
|
+
m as DEFAULT_MESSAGES,
|
|
3687
|
+
j as DEFAULT_OPERATOR_CATALOG,
|
|
3688
|
+
K as MaxDepthExceededError,
|
|
3689
|
+
Ne as MpQueryBuilderElement,
|
|
3690
|
+
ze as MpQueryConditionElement,
|
|
3691
|
+
Fe as MpQueryGroupElement,
|
|
3692
|
+
Pe as MpQuerySubqueryElement,
|
|
3693
|
+
L as addChild,
|
|
3694
|
+
de as addEmptyConditionTo,
|
|
3695
|
+
le as addEmptyGroupTo,
|
|
3696
|
+
ce as addEmptySubqueryTo,
|
|
3697
|
+
he as changeConditionField,
|
|
3698
|
+
ge as changeConditionOperator,
|
|
3699
|
+
Q as cloneTree,
|
|
3700
|
+
V as collectDescendantIds,
|
|
3701
|
+
x as defaultValueFor,
|
|
3702
|
+
E as disabledContext,
|
|
3703
|
+
F as editorRegistryContext,
|
|
3704
|
+
ie as emptyCondition,
|
|
3705
|
+
I as emptyGroup,
|
|
3706
|
+
ae as emptySubquery,
|
|
3707
|
+
_ as findNodeById,
|
|
3708
|
+
v as mapTree,
|
|
3709
|
+
q as messagesContext,
|
|
3710
|
+
H as moveNode,
|
|
3711
|
+
$ as newId,
|
|
3712
|
+
y as operatorsForType,
|
|
3713
|
+
X as removeNode,
|
|
3714
|
+
ve as renderExpression,
|
|
3715
|
+
ue as setGroupLogic,
|
|
3716
|
+
fe as updateCondition,
|
|
3717
|
+
Ge as validateOperatorOverrides,
|
|
3718
|
+
g as valueShapeFor,
|
|
3719
|
+
je as visitTree
|
|
3720
|
+
};
|