@react-querybuilder/bootstrap 8.8.3 → 8.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/react-querybuilder_bootstrap.cjs.development.d.ts +2662 -0
- package/dist/cjs/react-querybuilder_bootstrap.cjs.development.js +163 -293
- package/dist/cjs/react-querybuilder_bootstrap.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_bootstrap.cjs.production.d.ts +2662 -0
- package/dist/cjs/react-querybuilder_bootstrap.cjs.production.js +1 -1
- package/dist/cjs/react-querybuilder_bootstrap.cjs.production.js.map +1 -1
- package/dist/react-querybuilder_bootstrap.d.mts +2662 -0
- package/dist/react-querybuilder_bootstrap.legacy-esm.d.ts +2662 -0
- package/dist/react-querybuilder_bootstrap.legacy-esm.js +196 -203
- package/dist/react-querybuilder_bootstrap.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_bootstrap.mjs +142 -261
- package/dist/react-querybuilder_bootstrap.mjs.map +1 -1
- package/dist/react-querybuilder_bootstrap.production.d.mts +2662 -0
- package/dist/react-querybuilder_bootstrap.production.mjs +1 -1
- package/dist/react-querybuilder_bootstrap.production.mjs.map +1 -1
- package/package.json +12 -12
- package/dist/types/BootstrapNotToggle.d.ts +0 -6
- package/dist/types/BootstrapValueEditor.d.ts +0 -6
- package/dist/types/index.d.ts +0 -19
- package/dist/types-esm/BootstrapNotToggle.d.mts +0 -6
- package/dist/types-esm/BootstrapValueEditor.d.mts +0 -6
- package/dist/types-esm/index.d.mts +0 -19
|
@@ -1,217 +1,210 @@
|
|
|
1
|
-
// src/index.tsx
|
|
2
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
3
|
-
import { getCompatContextProvider } from "react-querybuilder";
|
|
4
|
-
|
|
5
|
-
// ../../utils/react-compiler/react-compiler-runtime.ts
|
|
6
1
|
import * as React from "react";
|
|
7
|
-
var $empty = Symbol["for"]("react.memo_cache_sentinel");
|
|
8
|
-
function c(size) {
|
|
9
|
-
return React.useMemo(
|
|
10
|
-
function() {
|
|
11
|
-
var $ = new Array(size);
|
|
12
|
-
for (var ii = 0; ii < size; ii++) {
|
|
13
|
-
$[ii] = $empty;
|
|
14
|
-
}
|
|
15
|
-
$[$empty] = true;
|
|
16
|
-
return $;
|
|
17
|
-
},
|
|
18
|
-
// oxlint-disable-next-line exhaustive-deps
|
|
19
|
-
[]
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// src/BootstrapNotToggle.tsx
|
|
24
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
25
2
|
import { useId } from "react";
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
$[3] = id;
|
|
47
|
-
$[4] = label;
|
|
48
|
-
$[5] = t1;
|
|
49
|
-
$[6] = t2;
|
|
50
|
-
$[7] = t3;
|
|
51
|
-
$[8] = title;
|
|
52
|
-
$[9] = t4;
|
|
53
|
-
} else {
|
|
54
|
-
t4 = $[9];
|
|
55
|
-
}
|
|
56
|
-
return t4;
|
|
3
|
+
import { ValueEditor, getCompatContextProvider, standardClassnames, useValueEditor } from "react-querybuilder";
|
|
4
|
+
|
|
5
|
+
//#region src/BootstrapNotToggle.tsx
|
|
6
|
+
/**
|
|
7
|
+
* @group Components
|
|
8
|
+
*/
|
|
9
|
+
const BootstrapNotToggle = ({ className, handleOnChange, title, label, checked, disabled }) => {
|
|
10
|
+
const id = useId();
|
|
11
|
+
return /* @__PURE__ */ React.createElement("div", { className: `form-check-inline form-switch ${className}` }, /* @__PURE__ */ React.createElement("input", {
|
|
12
|
+
id,
|
|
13
|
+
className: "form-check-input",
|
|
14
|
+
type: "checkbox",
|
|
15
|
+
onChange: (e) => handleOnChange(e.target.checked),
|
|
16
|
+
checked: !!checked,
|
|
17
|
+
disabled
|
|
18
|
+
}), /* @__PURE__ */ React.createElement("label", {
|
|
19
|
+
title,
|
|
20
|
+
htmlFor: id,
|
|
21
|
+
className: "form-check-label"
|
|
22
|
+
}, label));
|
|
57
23
|
};
|
|
58
24
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
function
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
var _n = 0, F = function F2() {
|
|
69
|
-
};
|
|
70
|
-
return { s: F, n: function n() {
|
|
71
|
-
return _n >= r.length ? { done: true } : { done: false, value: r[_n++] };
|
|
72
|
-
}, e: function e2(r2) {
|
|
73
|
-
throw r2;
|
|
74
|
-
}, f: F };
|
|
75
|
-
}
|
|
76
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
77
|
-
}
|
|
78
|
-
var o, a = true, u = false;
|
|
79
|
-
return { s: function s() {
|
|
80
|
-
t = t.call(r);
|
|
81
|
-
}, n: function n() {
|
|
82
|
-
var r2 = t.next();
|
|
83
|
-
return a = r2.done, r2;
|
|
84
|
-
}, e: function e2(r2) {
|
|
85
|
-
u = true, o = r2;
|
|
86
|
-
}, f: function f() {
|
|
87
|
-
try {
|
|
88
|
-
a || null == t["return"] || t["return"]();
|
|
89
|
-
} finally {
|
|
90
|
-
if (u) throw o;
|
|
91
|
-
}
|
|
92
|
-
} };
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region \0@oxc-project+runtime@0.89.0/helpers/typeof.js
|
|
27
|
+
function _typeof(o) {
|
|
28
|
+
"@babel/helpers - typeof";
|
|
29
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
30
|
+
return typeof o$1;
|
|
31
|
+
} : function(o$1) {
|
|
32
|
+
return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
|
|
33
|
+
}, _typeof(o);
|
|
93
34
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region \0@oxc-project+runtime@0.89.0/helpers/toPrimitive.js
|
|
38
|
+
function toPrimitive(t, r) {
|
|
39
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
40
|
+
var e = t[Symbol.toPrimitive];
|
|
41
|
+
if (void 0 !== e) {
|
|
42
|
+
var i = e.call(t, r || "default");
|
|
43
|
+
if ("object" != _typeof(i)) return i;
|
|
44
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
45
|
+
}
|
|
46
|
+
return ("string" === r ? String : Number)(t);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region \0@oxc-project+runtime@0.89.0/helpers/toPropertyKey.js
|
|
51
|
+
function toPropertyKey(t) {
|
|
52
|
+
var i = toPrimitive(t, "string");
|
|
53
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
100
54
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region \0@oxc-project+runtime@0.89.0/helpers/defineProperty.js
|
|
58
|
+
function _defineProperty(e, r, t) {
|
|
59
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
60
|
+
value: t,
|
|
61
|
+
enumerable: !0,
|
|
62
|
+
configurable: !0,
|
|
63
|
+
writable: !0
|
|
64
|
+
}) : e[r] = t, e;
|
|
105
65
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
var
|
|
111
|
-
|
|
112
|
-
var
|
|
113
|
-
|
|
66
|
+
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region \0@oxc-project+runtime@0.89.0/helpers/objectSpread2.js
|
|
69
|
+
function ownKeys(e, r) {
|
|
70
|
+
var t = Object.keys(e);
|
|
71
|
+
if (Object.getOwnPropertySymbols) {
|
|
72
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
73
|
+
r && (o = o.filter(function(r$1) {
|
|
74
|
+
return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
|
|
75
|
+
})), t.push.apply(t, o);
|
|
76
|
+
}
|
|
77
|
+
return t;
|
|
78
|
+
}
|
|
79
|
+
function _objectSpread2(e) {
|
|
80
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
81
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
82
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {
|
|
83
|
+
_defineProperty(e, r$1, t[r$1]);
|
|
84
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
|
|
85
|
+
Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return e;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/BootstrapValueEditor.tsx
|
|
93
|
+
const RadioButton = (props) => {
|
|
94
|
+
const id = React.useId();
|
|
95
|
+
return /* @__PURE__ */ React.createElement("div", { className: "form-check form-check-inline" }, /* @__PURE__ */ React.createElement("input", {
|
|
96
|
+
className: "form-check-input",
|
|
97
|
+
type: "radio",
|
|
98
|
+
id,
|
|
99
|
+
value: props.name,
|
|
100
|
+
checked: props.checked,
|
|
101
|
+
disabled: props.disabled,
|
|
102
|
+
onChange: (e) => props.handleOnChange(e.target.value)
|
|
103
|
+
}), /* @__PURE__ */ React.createElement("label", {
|
|
104
|
+
className: "form-check-label",
|
|
105
|
+
htmlFor: id
|
|
106
|
+
}, props.label));
|
|
114
107
|
};
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
108
|
+
/**
|
|
109
|
+
* @group Components
|
|
110
|
+
*/
|
|
111
|
+
const BootstrapValueEditor = (props) => {
|
|
112
|
+
const { valueListItemClassName } = useValueEditor(props);
|
|
113
|
+
if (props.operator === "null" || props.operator === "notNull") return null;
|
|
114
|
+
if ((props.operator === "between" || props.operator === "notBetween") && (props.type === "select" || props.type === "text")) {
|
|
115
|
+
const listItemClasses = props.type === "text" ? "form-control form-control-sm" : "form-select form-select-sm";
|
|
116
|
+
return /* @__PURE__ */ React.createElement(ValueEditor, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
117
|
+
skipHook: true,
|
|
118
|
+
schema: _objectSpread2(_objectSpread2({}, props.schema), {}, { classNames: _objectSpread2(_objectSpread2({}, props.schema.classNames), {}, { valueListItem: `${valueListItemClassName} ${listItemClasses}` }) })
|
|
119
|
+
}));
|
|
120
|
+
}
|
|
121
|
+
switch (props.type) {
|
|
122
|
+
case "select":
|
|
123
|
+
case "multiselect": return /* @__PURE__ */ React.createElement(ValueEditor, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
124
|
+
skipHook: true,
|
|
125
|
+
className: `${props.className} form-select form-select-sm`
|
|
126
|
+
}));
|
|
127
|
+
case "switch": return /* @__PURE__ */ React.createElement("span", { className: `${props.className} custom-control custom-switch` }, /* @__PURE__ */ React.createElement("input", {
|
|
128
|
+
type: "checkbox",
|
|
129
|
+
className: "form-check-input custom-control-input",
|
|
130
|
+
title: props.title,
|
|
131
|
+
disabled: props.disabled,
|
|
132
|
+
onChange: (e) => props.handleOnChange(e.target.checked),
|
|
133
|
+
checked: !!props.value
|
|
134
|
+
}));
|
|
135
|
+
case "checkbox": return /* @__PURE__ */ React.createElement(ValueEditor, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
136
|
+
skipHook: true,
|
|
137
|
+
className: `${props.className} form-check-input`
|
|
138
|
+
}));
|
|
139
|
+
case "radio":
|
|
140
|
+
var _props$values;
|
|
141
|
+
return /* @__PURE__ */ React.createElement("span", {
|
|
142
|
+
title: props.title,
|
|
143
|
+
className: standardClassnames.value
|
|
144
|
+
}, (_props$values = props.values) === null || _props$values === void 0 ? void 0 : _props$values.map((v) => /* @__PURE__ */ React.createElement(RadioButton, {
|
|
145
|
+
key: v.name,
|
|
146
|
+
name: v.name,
|
|
147
|
+
disabled: props.disabled,
|
|
148
|
+
checked: props.value === v.name,
|
|
149
|
+
handleOnChange: props.handleOnChange,
|
|
150
|
+
label: v.label
|
|
151
|
+
})));
|
|
152
|
+
}
|
|
153
|
+
return /* @__PURE__ */ React.createElement(ValueEditor, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
154
|
+
skipHook: true,
|
|
155
|
+
className: `${props.className} form-control form-control-sm`
|
|
156
|
+
}));
|
|
131
157
|
};
|
|
132
|
-
|
|
133
|
-
|
|
158
|
+
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/index.tsx
|
|
161
|
+
/**
|
|
162
|
+
* @group Props
|
|
163
|
+
*/
|
|
164
|
+
const bootstrapControlElements = {
|
|
165
|
+
notToggle: BootstrapNotToggle,
|
|
166
|
+
valueEditor: BootstrapValueEditor
|
|
134
167
|
};
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
if ($[2] !== id || $[3] !== props.checked || $[4] !== props.disabled || $[5] !== props.label || $[6] !== props.name || $[7] !== t0) {
|
|
150
|
-
t1 = jsxs2("div", { className: "form-check form-check-inline", children: [jsx2("input", { className: "form-check-input", type: "radio", id, value: props.name, checked: props.checked, disabled: props.disabled, onChange: t0 }), jsx2("label", { className: "form-check-label", htmlFor: id, children: props.label })] });
|
|
151
|
-
$[2] = id;
|
|
152
|
-
$[3] = props.checked;
|
|
153
|
-
$[4] = props.disabled;
|
|
154
|
-
$[5] = props.label;
|
|
155
|
-
$[6] = props.name;
|
|
156
|
-
$[7] = t0;
|
|
157
|
-
$[8] = t1;
|
|
158
|
-
} else {
|
|
159
|
-
t1 = $[8];
|
|
160
|
-
}
|
|
161
|
-
return t1;
|
|
168
|
+
/**
|
|
169
|
+
* @group Props
|
|
170
|
+
*/
|
|
171
|
+
const bootstrapControlClassnames = {
|
|
172
|
+
actionElement: "btn btn-sm",
|
|
173
|
+
addGroup: "btn-secondary",
|
|
174
|
+
addRule: "btn-primary",
|
|
175
|
+
cloneGroup: "btn-secondary",
|
|
176
|
+
cloneRule: "btn-secondary",
|
|
177
|
+
lockGroup: "btn-secondary",
|
|
178
|
+
lockRule: "btn-secondary",
|
|
179
|
+
removeGroup: "btn-danger",
|
|
180
|
+
removeRule: "btn-danger",
|
|
181
|
+
valueSelector: "form-select form-select-sm"
|
|
162
182
|
};
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
return /* @__PURE__ */ jsx2("span", { className: "".concat(props.className, " custom-control custom-switch"), children: /* @__PURE__ */ jsx2("input", { type: "checkbox", className: "form-check-input custom-control-input", title: props.title, disabled: props.disabled, onChange: function onChange(e) {
|
|
179
|
-
return props.handleOnChange(e.target.checked);
|
|
180
|
-
}, checked: !!props.value }) });
|
|
181
|
-
case "checkbox":
|
|
182
|
-
return /* @__PURE__ */ jsx2(ValueEditor, __spreadProps(__spreadValues({}, props), { skipHook: true, className: "".concat(props.className, " form-check-input") }));
|
|
183
|
-
case "radio":
|
|
184
|
-
return /* @__PURE__ */ jsx2("span", { title: props.title, className: standardClassnames.value, children: (_a = props.values) == null ? void 0 : _a.map(function(v) {
|
|
185
|
-
return /* @__PURE__ */ jsx2(RadioButton, { name: v.name, disabled: props.disabled, checked: props.value === v.name, handleOnChange: props.handleOnChange, label: v.label }, v.name);
|
|
186
|
-
}) });
|
|
187
|
-
}
|
|
188
|
-
return /* @__PURE__ */ jsx2(ValueEditor, __spreadProps(__spreadValues({}, props), { skipHook: true, className: "".concat(props.className, " form-control form-control-sm") }));
|
|
183
|
+
/**
|
|
184
|
+
* @group Props
|
|
185
|
+
*/
|
|
186
|
+
const bootstrapTranslations = {
|
|
187
|
+
removeGroup: { label: /* @__PURE__ */ React.createElement("i", { className: "bi bi-x" }) },
|
|
188
|
+
removeRule: { label: /* @__PURE__ */ React.createElement("i", { className: "bi bi-x" }) },
|
|
189
|
+
cloneRule: { label: /* @__PURE__ */ React.createElement("i", { className: "bi bi-copy" }) },
|
|
190
|
+
cloneRuleGroup: { label: /* @__PURE__ */ React.createElement("i", { className: "bi bi-copy" }) },
|
|
191
|
+
dragHandle: { label: /* @__PURE__ */ React.createElement("i", { className: "bi bi-grip-vertical" }) },
|
|
192
|
+
lockGroup: { label: /* @__PURE__ */ React.createElement("i", { className: "bi bi-unlock" }) },
|
|
193
|
+
lockRule: { label: /* @__PURE__ */ React.createElement("i", { className: "bi bi-unlock" }) },
|
|
194
|
+
lockGroupDisabled: { label: /* @__PURE__ */ React.createElement("i", { className: "bi bi-lock" }) },
|
|
195
|
+
lockRuleDisabled: { label: /* @__PURE__ */ React.createElement("i", { className: "bi bi-lock" }) },
|
|
196
|
+
shiftActionUp: { label: /* @__PURE__ */ React.createElement("i", { className: "bi bi-chevron-compact-up" }) },
|
|
197
|
+
shiftActionDown: { label: /* @__PURE__ */ React.createElement("i", { className: "bi bi-chevron-compact-down" }) }
|
|
189
198
|
};
|
|
199
|
+
/**
|
|
200
|
+
* @group Components
|
|
201
|
+
*/
|
|
202
|
+
const QueryBuilderBootstrap = getCompatContextProvider({
|
|
203
|
+
controlClassnames: bootstrapControlClassnames,
|
|
204
|
+
controlElements: bootstrapControlElements,
|
|
205
|
+
translations: bootstrapTranslations
|
|
206
|
+
});
|
|
190
207
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
var bootstrapControlClassnames = {
|
|
194
|
-
actionElement: "btn btn-sm",
|
|
195
|
-
addGroup: "btn-secondary",
|
|
196
|
-
addRule: "btn-primary",
|
|
197
|
-
cloneGroup: "btn-secondary",
|
|
198
|
-
cloneRule: "btn-secondary",
|
|
199
|
-
lockGroup: "btn-secondary",
|
|
200
|
-
lockRule: "btn-secondary",
|
|
201
|
-
removeGroup: "btn-danger",
|
|
202
|
-
removeRule: "btn-danger",
|
|
203
|
-
// BootstrapValueEditor adds its own classnames
|
|
204
|
-
// value: '',
|
|
205
|
-
valueSelector: "form-select form-select-sm"
|
|
206
|
-
};
|
|
207
|
-
var bootstrapTranslations = { removeGroup: { label: /* @__PURE__ */ jsx3("i", { className: "bi bi-x" }) }, removeRule: { label: /* @__PURE__ */ jsx3("i", { className: "bi bi-x" }) }, cloneRule: { label: /* @__PURE__ */ jsx3("i", { className: "bi bi-copy" }) }, cloneRuleGroup: { label: /* @__PURE__ */ jsx3("i", { className: "bi bi-copy" }) }, dragHandle: { label: /* @__PURE__ */ jsx3("i", { className: "bi bi-grip-vertical" }) }, lockGroup: { label: /* @__PURE__ */ jsx3("i", { className: "bi bi-unlock" }) }, lockRule: { label: /* @__PURE__ */ jsx3("i", { className: "bi bi-unlock" }) }, lockGroupDisabled: { label: /* @__PURE__ */ jsx3("i", { className: "bi bi-lock" }) }, lockRuleDisabled: { label: /* @__PURE__ */ jsx3("i", { className: "bi bi-lock" }) }, shiftActionUp: { label: /* @__PURE__ */ jsx3("i", { className: "bi bi-chevron-compact-up" }) }, shiftActionDown: { label: /* @__PURE__ */ jsx3("i", { className: "bi bi-chevron-compact-down" }) } };
|
|
208
|
-
var QueryBuilderBootstrap = getCompatContextProvider({ controlClassnames: bootstrapControlClassnames, controlElements: bootstrapControlElements, translations: bootstrapTranslations });
|
|
209
|
-
export {
|
|
210
|
-
BootstrapNotToggle,
|
|
211
|
-
BootstrapValueEditor,
|
|
212
|
-
QueryBuilderBootstrap,
|
|
213
|
-
bootstrapControlClassnames,
|
|
214
|
-
bootstrapControlElements,
|
|
215
|
-
bootstrapTranslations
|
|
216
|
-
};
|
|
208
|
+
//#endregion
|
|
209
|
+
export { BootstrapNotToggle, BootstrapValueEditor, QueryBuilderBootstrap, bootstrapControlClassnames, bootstrapControlElements, bootstrapTranslations };
|
|
217
210
|
//# sourceMappingURL=react-querybuilder_bootstrap.legacy-esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.tsx","../../../utils/react-compiler/react-compiler-runtime.ts","../src/BootstrapNotToggle.tsx","../src/BootstrapValueEditor.tsx"],"sourcesContent":["import{jsx}from\"react/jsx-runtime\";import{getCompatContextProvider}from\"react-querybuilder\";import{BootstrapNotToggle}from\"./BootstrapNotToggle\";import{BootstrapValueEditor}from\"./BootstrapValueEditor\";export*from\"./BootstrapNotToggle\";export*from\"./BootstrapValueEditor\";export var bootstrapControlElements={notToggle:BootstrapNotToggle,valueEditor:BootstrapValueEditor};export var bootstrapControlClassnames={actionElement:\"btn btn-sm\",addGroup:\"btn-secondary\",addRule:\"btn-primary\",cloneGroup:\"btn-secondary\",cloneRule:\"btn-secondary\",lockGroup:\"btn-secondary\",lockRule:\"btn-secondary\",removeGroup:\"btn-danger\",removeRule:\"btn-danger\",// BootstrapValueEditor adds its own classnames\n// value: '',\nvalueSelector:\"form-select form-select-sm\"};export var bootstrapTranslations={removeGroup:{label:/* @__PURE__ */jsx(\"i\",{className:\"bi bi-x\"})},removeRule:{label:/* @__PURE__ */jsx(\"i\",{className:\"bi bi-x\"})},cloneRule:{label:/* @__PURE__ */jsx(\"i\",{className:\"bi bi-copy\"})},cloneRuleGroup:{label:/* @__PURE__ */jsx(\"i\",{className:\"bi bi-copy\"})},dragHandle:{label:/* @__PURE__ */jsx(\"i\",{className:\"bi bi-grip-vertical\"})},lockGroup:{label:/* @__PURE__ */jsx(\"i\",{className:\"bi bi-unlock\"})},lockRule:{label:/* @__PURE__ */jsx(\"i\",{className:\"bi bi-unlock\"})},lockGroupDisabled:{label:/* @__PURE__ */jsx(\"i\",{className:\"bi bi-lock\"})},lockRuleDisabled:{label:/* @__PURE__ */jsx(\"i\",{className:\"bi bi-lock\"})},shiftActionUp:{label:/* @__PURE__ */jsx(\"i\",{className:\"bi bi-chevron-compact-up\"})},shiftActionDown:{label:/* @__PURE__ */jsx(\"i\",{className:\"bi bi-chevron-compact-down\"})}};export var QueryBuilderBootstrap=getCompatContextProvider({controlClassnames:bootstrapControlClassnames,controlElements:bootstrapControlElements,translations:bootstrapTranslations});","import*as React from\"react\";var $empty=Symbol[\"for\"](\"react.memo_cache_sentinel\");export function c(size){return React.useMemo(function(){var $=new Array(size);for(var ii=0;ii<size;ii++){$[ii]=$empty;}$[$empty]=true;return $;},// oxlint-disable-next-line exhaustive-deps\n[]);}","import{c as _c}from\"react-compiler-runtime\";import{jsx,jsxs}from\"react/jsx-runtime\";import{useId}from\"react\";export var BootstrapNotToggle=function BootstrapNotToggle(t0){var $=_c(10);var className=t0.className,handleOnChange=t0.handleOnChange,title=t0.title,label=t0.label,checked=t0.checked,disabled=t0.disabled;var id=useId();var t1=\"form-check-inline form-switch \".concat(className);var t2;if($[0]!==handleOnChange){t2=function t2(e){return handleOnChange(e.target.checked);};$[0]=handleOnChange;$[1]=t2;}else{t2=$[1];}var t3=!!checked;var t4;if($[2]!==disabled||$[3]!==id||$[4]!==label||$[5]!==t1||$[6]!==t2||$[7]!==t3||$[8]!==title){t4=jsxs(\"div\",{className:t1,children:[jsx(\"input\",{id:id,className:\"form-check-input\",type:\"checkbox\",onChange:t2,checked:t3,disabled:disabled}),jsx(\"label\",{title:title,htmlFor:id,className:\"form-check-label\",children:label})]});$[2]=disabled;$[3]=id;$[4]=label;$[5]=t1;$[6]=t2;$[7]=t3;$[8]=title;$[9]=t4;}else{t4=$[9];}return t4;};","function _createForOfIteratorHelper(r,e){var t=\"undefined\"!=typeof Symbol&&r[Symbol.iterator]||r[\"@@iterator\"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&\"number\"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]};},e:function e(r){throw r;},f:F};}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t[\"return\"]||t[\"return\"]();}finally{if(u)throw o;}}};}function _unsupportedIterableToArray(r,a){if(r){if(\"string\"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return\"Object\"===t&&r.constructor&&(t=r.constructor.name),\"Map\"===t||\"Set\"===t?Array.from(r):\"Arguments\"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}import{c as _c}from\"react-compiler-runtime\";var __defProp=Object.defineProperty;var __defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty;var __propIsEnum=Object.prototype.propertyIsEnumerable;var __defNormalProp=function __defNormalProp(obj,key,value){return key in obj?__defProp(obj,key,{enumerable:true,configurable:true,writable:true,value:value}):obj[key]=value;};var __spreadValues=function __spreadValues(a,b){for(var prop in b||(b={}))if(__hasOwnProp.call(b,prop))__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols){var _iterator=_createForOfIteratorHelper(__getOwnPropSymbols(b)),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var prop=_step.value;if(__propIsEnum.call(b,prop))__defNormalProp(a,prop,b[prop]);}}catch(err){_iterator.e(err);}finally{_iterator.f();}}return a;};var __spreadProps=function __spreadProps(a,b){return __defProps(a,__getOwnPropDescs(b));};import{jsx,jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{standardClassnames,useValueEditor,ValueEditor}from\"react-querybuilder\";var RadioButton=function RadioButton(props){var $=_c(9);var id=React.useId();var t0;if($[0]!==props){t0=function t0(e){return props.handleOnChange(e.target.value);};$[0]=props;$[1]=t0;}else{t0=$[1];}var t1;if($[2]!==id||$[3]!==props.checked||$[4]!==props.disabled||$[5]!==props.label||$[6]!==props.name||$[7]!==t0){t1=jsxs(\"div\",{className:\"form-check form-check-inline\",children:[jsx(\"input\",{className:\"form-check-input\",type:\"radio\",id:id,value:props.name,checked:props.checked,disabled:props.disabled,onChange:t0}),jsx(\"label\",{className:\"form-check-label\",htmlFor:id,children:props.label})]});$[2]=id;$[3]=props.checked;$[4]=props.disabled;$[5]=props.label;$[6]=props.name;$[7]=t0;$[8]=t1;}else{t1=$[8];}return t1;};export var BootstrapValueEditor=function BootstrapValueEditor(props){var _a;var _useValueEditor=useValueEditor(props),valueListItemClassName=_useValueEditor.valueListItemClassName;if(props.operator===\"null\"||props.operator===\"notNull\"){return null;}if((props.operator===\"between\"||props.operator===\"notBetween\")&&(props.type===\"select\"||props.type===\"text\")){var listItemClasses=props.type===\"text\"?\"form-control form-control-sm\":\"form-select form-select-sm\";return/* @__PURE__ */jsx(ValueEditor,__spreadProps(__spreadValues({},props),{skipHook:true,schema:__spreadProps(__spreadValues({},props.schema),{classNames:__spreadProps(__spreadValues({},props.schema.classNames),{valueListItem:\"\".concat(valueListItemClassName,\" \").concat(listItemClasses)})})}));}switch(props.type){case\"select\":case\"multiselect\":return/* @__PURE__ */jsx(ValueEditor,__spreadProps(__spreadValues({},props),{skipHook:true,className:\"\".concat(props.className,\" form-select form-select-sm\")}));case\"switch\":return/* @__PURE__ */jsx(\"span\",{className:\"\".concat(props.className,\" custom-control custom-switch\"),children:/* @__PURE__ */jsx(\"input\",{type:\"checkbox\",className:\"form-check-input custom-control-input\",title:props.title,disabled:props.disabled,onChange:function onChange(e){return props.handleOnChange(e.target.checked);},checked:!!props.value})});case\"checkbox\":return/* @__PURE__ */jsx(ValueEditor,__spreadProps(__spreadValues({},props),{skipHook:true,className:\"\".concat(props.className,\" form-check-input\")}));case\"radio\":return/* @__PURE__ */jsx(\"span\",{title:props.title,className:standardClassnames.value,children:(_a=props.values)==null?void 0:_a.map(function(v){return/* @__PURE__ */jsx(RadioButton,{name:v.name,disabled:props.disabled,checked:props.value===v.name,handleOnChange:props.handleOnChange,label:v.label},v.name);})});}return/* @__PURE__ */jsx(ValueEditor,__spreadProps(__spreadValues({},props),{skipHook:true,className:\"\".concat(props.className,\" form-control form-control-sm\")}));};"],"mappings":";AAAA,SAAO,OAAAA,YAAQ;AAAoB,SAAO,gCAA6B;;;ACAvE,YAAU,WAAU;AAAQ,IAAI,SAAO,OAAO,KAAK,EAAE,2BAA2B;AAAS,SAAS,EAAE,MAAK;AAAC,SAAa;AAAA,IAAQ,WAAU;AAAC,UAAI,IAAE,IAAI,MAAM,IAAI;AAAE,eAAQ,KAAG,GAAE,KAAG,MAAK,MAAK;AAAC,UAAE,EAAE,IAAE;AAAA,MAAO;AAAC,QAAE,MAAM,IAAE;AAAK,aAAO;AAAA,IAAE;AAAA;AAAA,IACjO,CAAC;AAAA,EAAC;AAAE;;;ACDwC,SAAO,KAAI,YAAS;AAAoB,SAAO,aAAU;AAAe,IAAI,qBAAmB,SAASC,oBAAmB,IAAG;AAAC,MAAI,IAAE,EAAG,EAAE;AAAE,MA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AW,EAAC,OAAqB,gBAAAA,KAAI,KAAI,EAAC,WAAU,sBAAqB,CAAC,EAAC,GAAE,WAAU,EAAC,OAAqB,gBAAAA,KAAI,KAAI,EAAC,WAAU,eAAc,CAAC,EAAC,GAAE,UAAS,EAAC,OAAqB,gBAAAA,KAAI,KAAI,EAAC,WAAU,eAAc,CAAC,EAAC,GAAE,mBAAkB,EAAC,OAAqB,gBAAAA,KAAI,KAAI,EAAC,WAAU,aAAY,CAAC,EAAC,GAAE,kBAAiB,EAAC,OAAqB,gBAAAA,KAAI,KAAI,EAAC,WAAU,aAAY,CAAC,EAAC,GAAE,eAAc,EAAC,OAAqB,gBAAAA,KAAI,KAAI,EAAC,WAAU,2BAA0B,CAAC,EAAC,GAAE,iBAAgB,EAAC,OAAqB,gBAAAA,KAAI,KAAI,EAAC,WAAU,6BAA4B,CAAC,EAAC,EAAC;AAAS,IAAI,wBAAsB,yBAAyB,EAAC,mBAAkB,4BAA2B,iBAAgB,0BAAyB,cAAa,sBAAqB,CAAC;","names":["jsx","BootstrapNotToggle","t2","jsx","jsxs","React","F","e","r","__defNormalProp","__spreadValues","__spreadProps","RadioButton","t0","BootstrapValueEditor","jsx"]}
|
|
1
|
+
{"version":3,"file":"react-querybuilder_bootstrap.legacy-esm.js","names":["bootstrapControlElements: ControlElementsProp<FullField, string>","bootstrapControlClassnames: Partial<Classnames>","bootstrapTranslations: Partial<Translations>","QueryBuilderBootstrap: QueryBuilderContextProvider"],"sources":["../src/BootstrapNotToggle.tsx","../src/BootstrapValueEditor.tsx","../src/index.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useId } from 'react';\nimport type { NotToggleProps } from 'react-querybuilder';\n\n/**\n * @group Components\n */\nexport const BootstrapNotToggle = ({\n className,\n handleOnChange,\n title,\n label,\n checked,\n disabled,\n}: NotToggleProps): React.JSX.Element => {\n const id = useId();\n\n return (\n <div className={`form-check-inline form-switch ${className}`}>\n <input\n id={id}\n className=\"form-check-input\"\n type=\"checkbox\"\n onChange={e => handleOnChange(e.target.checked)}\n checked={!!checked}\n disabled={disabled}\n />\n <label title={title} htmlFor={id} className=\"form-check-label\">\n {label}\n </label>\n </div>\n );\n};\n","import * as React from 'react';\nimport type { ValueEditorProps } from 'react-querybuilder';\nimport { standardClassnames, useValueEditor, ValueEditor } from 'react-querybuilder';\n\n// Extracted from callback so we can use `useId`\nconst RadioButton = (props: {\n name: string;\n disabled?: boolean;\n checked: boolean;\n handleOnChange: (v: string) => void;\n label: string;\n}) => {\n const id = React.useId();\n return (\n <div className=\"form-check form-check-inline\">\n <input\n className=\"form-check-input\"\n type=\"radio\"\n id={id}\n value={props.name}\n checked={props.checked}\n disabled={props.disabled}\n onChange={e => props.handleOnChange(e.target.value)}\n />\n <label className=\"form-check-label\" htmlFor={id}>\n {props.label}\n </label>\n </div>\n );\n};\n\n/**\n * @group Components\n */\nexport const BootstrapValueEditor = (props: ValueEditorProps): React.JSX.Element | null => {\n const { valueListItemClassName } = useValueEditor(props);\n\n if (props.operator === 'null' || props.operator === 'notNull') {\n return null;\n }\n\n if (\n (props.operator === 'between' || props.operator === 'notBetween') &&\n (props.type === 'select' || props.type === 'text')\n ) {\n const listItemClasses =\n props.type === 'text' ? 'form-control form-control-sm' : 'form-select form-select-sm';\n return (\n <ValueEditor\n {...props}\n skipHook\n schema={{\n ...props.schema,\n classNames: {\n ...props.schema.classNames,\n valueListItem: `${valueListItemClassName} ${listItemClasses}`,\n },\n }}\n />\n );\n }\n\n switch (props.type) {\n case 'select':\n case 'multiselect':\n return (\n <ValueEditor\n {...props}\n skipHook\n className={`${props.className} form-select form-select-sm`}\n />\n );\n\n case 'switch':\n return (\n <span className={`${props.className} custom-control custom-switch`}>\n <input\n type=\"checkbox\"\n className=\"form-check-input custom-control-input\"\n title={props.title}\n disabled={props.disabled}\n onChange={e => props.handleOnChange(e.target.checked)}\n checked={!!props.value}\n />\n </span>\n );\n\n case 'checkbox':\n return <ValueEditor {...props} skipHook className={`${props.className} form-check-input`} />;\n\n case 'radio':\n return (\n <span title={props.title} className={standardClassnames.value}>\n {props.values?.map(v => (\n <RadioButton\n key={v.name}\n name={v.name}\n disabled={props.disabled}\n checked={props.value === v.name}\n handleOnChange={props.handleOnChange}\n label={v.label}\n />\n ))}\n </span>\n );\n }\n\n return (\n <ValueEditor\n {...props}\n skipHook\n className={`${props.className} form-control form-control-sm`}\n />\n );\n};\n","import * as React from 'react';\nimport type {\n Classnames,\n ControlElementsProp,\n FullField,\n QueryBuilderContextProvider,\n Translations,\n} from 'react-querybuilder';\nimport { getCompatContextProvider } from 'react-querybuilder';\nimport { BootstrapNotToggle } from './BootstrapNotToggle';\nimport { BootstrapValueEditor } from './BootstrapValueEditor';\n\nexport * from './BootstrapNotToggle';\nexport * from './BootstrapValueEditor';\n\n/**\n * @group Props\n */\nexport const bootstrapControlElements: ControlElementsProp<FullField, string> = {\n notToggle: BootstrapNotToggle,\n valueEditor: BootstrapValueEditor,\n};\n\n/**\n * @group Props\n */\nexport const bootstrapControlClassnames: Partial<Classnames> = {\n actionElement: 'btn btn-sm',\n addGroup: 'btn-secondary',\n addRule: 'btn-primary',\n cloneGroup: 'btn-secondary',\n cloneRule: 'btn-secondary',\n lockGroup: 'btn-secondary',\n lockRule: 'btn-secondary',\n removeGroup: 'btn-danger',\n removeRule: 'btn-danger',\n // BootstrapValueEditor adds its own classnames\n // value: '',\n valueSelector: 'form-select form-select-sm',\n};\n\n/**\n * @group Props\n */\nexport const bootstrapTranslations: Partial<Translations> = {\n removeGroup: { label: <i className=\"bi bi-x\" /> },\n removeRule: { label: <i className=\"bi bi-x\" /> },\n cloneRule: { label: <i className=\"bi bi-copy\" /> },\n cloneRuleGroup: { label: <i className=\"bi bi-copy\" /> },\n dragHandle: { label: <i className=\"bi bi-grip-vertical\" /> },\n lockGroup: { label: <i className=\"bi bi-unlock\" /> },\n lockRule: { label: <i className=\"bi bi-unlock\" /> },\n lockGroupDisabled: { label: <i className=\"bi bi-lock\" /> },\n lockRuleDisabled: { label: <i className=\"bi bi-lock\" /> },\n shiftActionUp: { label: <i className=\"bi bi-chevron-compact-up\" /> },\n shiftActionDown: { label: <i className=\"bi bi-chevron-compact-down\" /> },\n};\n\n/**\n * @group Components\n */\nexport const QueryBuilderBootstrap: QueryBuilderContextProvider = getCompatContextProvider({\n controlClassnames: bootstrapControlClassnames,\n controlElements: bootstrapControlElements,\n translations: bootstrapTranslations,\n});\n"],"mappings":";;;;;;;;AAOA,MAAa,sBAAsB,EACjC,WACA,gBACA,OACA,OACA,SACA,eACuC;CACvC,MAAM,KAAK,OAAO;AAElB,QACE,oCAAC,SAAI,WAAW,iCAAiC,eAC/C,oCAAC;EACK;EACJ,WAAU;EACV,MAAK;EACL,WAAU,MAAK,eAAe,EAAE,OAAO,QAAQ;EAC/C,SAAS,CAAC,CAAC;EACD;GACV,EACF,oCAAC;EAAa;EAAO,SAAS;EAAI,WAAU;IACzC,MACK,CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzBV,MAAM,eAAe,UAMf;CACJ,MAAM,KAAK,MAAM,OAAO;AACxB,QACE,oCAAC,SAAI,WAAU,kCACb,oCAAC;EACC,WAAU;EACV,MAAK;EACD;EACJ,OAAO,MAAM;EACb,SAAS,MAAM;EACf,UAAU,MAAM;EAChB,WAAU,MAAK,MAAM,eAAe,EAAE,OAAO,MAAM;GACnD,EACF,oCAAC;EAAM,WAAU;EAAmB,SAAS;IAC1C,MAAM,MACD,CACJ;;;;;AAOV,MAAa,wBAAwB,UAAsD;CACzF,MAAM,EAAE,2BAA2B,eAAe,MAAM;AAExD,KAAI,MAAM,aAAa,UAAU,MAAM,aAAa,UAClD,QAAO;AAGT,MACG,MAAM,aAAa,aAAa,MAAM,aAAa,kBACnD,MAAM,SAAS,YAAY,MAAM,SAAS,SAC3C;EACA,MAAM,kBACJ,MAAM,SAAS,SAAS,iCAAiC;AAC3D,SACE,oCAAC,+CACK;GACJ;GACA,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