@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.
@@ -1,311 +1,181 @@
1
- "use strict";
1
+ //#region rolldown:runtime
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
8
  var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/index.tsx
31
- var src_exports = {};
32
- __export(src_exports, {
33
- BootstrapNotToggle: () => BootstrapNotToggle,
34
- BootstrapValueEditor: () => BootstrapValueEditor,
35
- QueryBuilderBootstrap: () => QueryBuilderBootstrap,
36
- bootstrapControlClassnames: () => bootstrapControlClassnames,
37
- bootstrapControlElements: () => bootstrapControlElements,
38
- bootstrapTranslations: () => bootstrapTranslations
39
- });
40
- module.exports = __toCommonJS(src_exports);
41
- var import_jsx_runtime3 = require("react/jsx-runtime");
42
- var import_react_querybuilder2 = require("react-querybuilder");
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
43
22
 
44
- // ../../utils/react-compiler/react-compiler-runtime.ts
45
- var React = __toESM(require("react"));
46
- var $empty = Symbol["for"]("react.memo_cache_sentinel");
47
- function c(size) {
48
- return React.useMemo(
49
- function() {
50
- var $ = new Array(size);
51
- for (var ii = 0; ii < size; ii++) {
52
- $[ii] = $empty;
53
- }
54
- $[$empty] = true;
55
- return $;
56
- },
57
- // oxlint-disable-next-line exhaustive-deps
58
- []
59
- );
60
- }
23
+ //#endregion
24
+ let react = require("react");
25
+ react = __toESM(react);
26
+ let react_querybuilder = require("react-querybuilder");
27
+ react_querybuilder = __toESM(react_querybuilder);
61
28
 
62
- // src/BootstrapNotToggle.tsx
63
- var import_jsx_runtime = require("react/jsx-runtime");
64
- var import_react = require("react");
65
- var BootstrapNotToggle = function BootstrapNotToggle2(t0) {
66
- var $ = c(10);
67
- var className = t0.className, handleOnChange = t0.handleOnChange, title = t0.title, label = t0.label, checked = t0.checked, disabled = t0.disabled;
68
- var id = (0, import_react.useId)();
69
- var t1 = "form-check-inline form-switch ".concat(className);
70
- var t2;
71
- if ($[0] !== handleOnChange) {
72
- t2 = function t22(e) {
73
- return handleOnChange(e.target.checked);
74
- };
75
- $[0] = handleOnChange;
76
- $[1] = t2;
77
- } else {
78
- t2 = $[1];
79
- }
80
- var t3 = !!checked;
81
- var t4;
82
- if ($[2] !== disabled || $[3] !== id || $[4] !== label || $[5] !== t1 || $[6] !== t2 || $[7] !== t3 || $[8] !== title) {
83
- t4 = (0, import_jsx_runtime.jsxs)("div", { className: t1, children: [(0, import_jsx_runtime.jsx)("input", { id, className: "form-check-input", type: "checkbox", onChange: t2, checked: t3, disabled }), (0, import_jsx_runtime.jsx)("label", { title, htmlFor: id, className: "form-check-label", children: label })] });
84
- $[2] = disabled;
85
- $[3] = id;
86
- $[4] = label;
87
- $[5] = t1;
88
- $[6] = t2;
89
- $[7] = t3;
90
- $[8] = title;
91
- $[9] = t4;
92
- } else {
93
- t4 = $[9];
94
- }
95
- return t4;
29
+ //#region src/BootstrapNotToggle.tsx
30
+ /**
31
+ * @group Components
32
+ */
33
+ const BootstrapNotToggle = ({ className, handleOnChange, title, label, checked, disabled }) => {
34
+ const id = (0, react.useId)();
35
+ return /* @__PURE__ */ react.createElement("div", { className: `form-check-inline form-switch ${className}` }, /* @__PURE__ */ react.createElement("input", {
36
+ id,
37
+ className: "form-check-input",
38
+ type: "checkbox",
39
+ onChange: (e) => handleOnChange(e.target.checked),
40
+ checked: !!checked,
41
+ disabled
42
+ }), /* @__PURE__ */ react.createElement("label", {
43
+ title,
44
+ htmlFor: id,
45
+ className: "form-check-label"
46
+ }, label));
96
47
  };
97
48
 
98
- // src/BootstrapValueEditor.tsx
99
- var import_jsx_runtime2 = require("react/jsx-runtime");
100
- var React2 = __toESM(require("react"));
101
- var import_react_querybuilder = require("react-querybuilder");
102
- function _typeof(o) {
103
- "@babel/helpers - typeof";
104
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
105
- return typeof o2;
106
- } : function(o2) {
107
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
108
- }, _typeof(o);
109
- }
110
- function ownKeys(e, r) {
111
- var t = Object.keys(e);
112
- if (Object.getOwnPropertySymbols) {
113
- var o = Object.getOwnPropertySymbols(e);
114
- r && (o = o.filter(function(r2) {
115
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
116
- })), t.push.apply(t, o);
117
- }
118
- return t;
119
- }
120
- function _objectSpread(e) {
121
- for (var r = 1; r < arguments.length; r++) {
122
- var t = null != arguments[r] ? arguments[r] : {};
123
- r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
124
- _defineProperty(e, r2, t[r2]);
125
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
126
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
127
- });
128
- }
129
- return e;
130
- }
131
- function _defineProperty(e, r, t) {
132
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e;
133
- }
134
- function _toPropertyKey(t) {
135
- var i = _toPrimitive(t, "string");
136
- return "symbol" == _typeof(i) ? i : i + "";
137
- }
138
- function _toPrimitive(t, r) {
139
- if ("object" != _typeof(t) || !t) return t;
140
- var e = t[Symbol.toPrimitive];
141
- if (void 0 !== e) {
142
- var i = e.call(t, r || "default");
143
- if ("object" != _typeof(i)) return i;
144
- throw new TypeError("@@toPrimitive must return a primitive value.");
145
- }
146
- return ("string" === r ? String : Number)(t);
147
- }
148
- var RadioButton = function RadioButton2(props) {
149
- var $ = c(9);
150
- var id = React2.useId();
151
- var t0;
152
- if ($[0] !== props) {
153
- t0 = function t02(e) {
154
- return props.handleOnChange(e.target.value);
155
- };
156
- $[0] = props;
157
- $[1] = t0;
158
- } else {
159
- t0 = $[1];
160
- }
161
- var t1;
162
- if ($[2] !== id || $[3] !== props.checked || $[4] !== props.disabled || $[5] !== props.label || $[6] !== props.name || $[7] !== t0) {
163
- t1 = (0, import_jsx_runtime2.jsxs)("div", { className: "form-check form-check-inline", children: [(0, import_jsx_runtime2.jsx)("input", { className: "form-check-input", type: "radio", id, value: props.name, checked: props.checked, disabled: props.disabled, onChange: t0 }), (0, import_jsx_runtime2.jsx)("label", { className: "form-check-label", htmlFor: id, children: props.label })] });
164
- $[2] = id;
165
- $[3] = props.checked;
166
- $[4] = props.disabled;
167
- $[5] = props.label;
168
- $[6] = props.name;
169
- $[7] = t0;
170
- $[8] = t1;
171
- } else {
172
- t1 = $[8];
173
- }
174
- return t1;
49
+ //#endregion
50
+ //#region src/BootstrapValueEditor.tsx
51
+ const RadioButton = (props) => {
52
+ const id = react.useId();
53
+ return /* @__PURE__ */ react.createElement("div", { className: "form-check form-check-inline" }, /* @__PURE__ */ react.createElement("input", {
54
+ className: "form-check-input",
55
+ type: "radio",
56
+ id,
57
+ value: props.name,
58
+ checked: props.checked,
59
+ disabled: props.disabled,
60
+ onChange: (e) => props.handleOnChange(e.target.value)
61
+ }), /* @__PURE__ */ react.createElement("label", {
62
+ className: "form-check-label",
63
+ htmlFor: id
64
+ }, props.label));
175
65
  };
176
- var BootstrapValueEditor = function BootstrapValueEditor2(props) {
177
- var $ = c(26);
178
- var _useValueEditor = (0, import_react_querybuilder.useValueEditor)(props), valueListItemClassName = _useValueEditor.valueListItemClassName;
179
- if (props.operator === "null" || props.operator === "notNull") {
180
- return null;
181
- }
182
- if ((props.operator === "between" || props.operator === "notBetween") && (props.type === "select" || props.type === "text")) {
183
- var listItemClasses = props.type === "text" ? "form-control form-control-sm" : "form-select form-select-sm";
184
- var _t = "".concat(valueListItemClassName, " ").concat(listItemClasses);
185
- var _t2;
186
- if ($[0] !== props || $[1] !== _t) {
187
- _t2 = (0, import_jsx_runtime2.jsx)(import_react_querybuilder.ValueEditor, _objectSpread(_objectSpread({}, props), {}, { skipHook: true, schema: _objectSpread(_objectSpread({}, props.schema), {}, { classNames: _objectSpread(_objectSpread({}, props.schema.classNames), {}, { valueListItem: _t }) }) }));
188
- $[0] = props;
189
- $[1] = _t;
190
- $[2] = _t2;
191
- } else {
192
- _t2 = $[2];
193
- }
194
- return _t2;
195
- }
196
- switch (props.type) {
197
- case "select": {
198
- }
199
- case "multiselect": {
200
- var _t3 = "".concat(props.className, " form-select form-select-sm");
201
- var _t4;
202
- if ($[3] !== props || $[4] !== _t3) {
203
- _t4 = (0, import_jsx_runtime2.jsx)(import_react_querybuilder.ValueEditor, _objectSpread(_objectSpread({}, props), {}, { skipHook: true, className: _t3 }));
204
- $[3] = props;
205
- $[4] = _t3;
206
- $[5] = _t4;
207
- } else {
208
- _t4 = $[5];
209
- }
210
- return _t4;
211
- }
212
- case "switch": {
213
- var _t5 = "".concat(props.className, " custom-control custom-switch");
214
- var _t6;
215
- if ($[6] !== props) {
216
- _t6 = function _t62(e) {
217
- return props.handleOnChange(e.target.checked);
218
- };
219
- $[6] = props;
220
- $[7] = _t6;
221
- } else {
222
- _t6 = $[7];
223
- }
224
- var t2 = !!props.value;
225
- var t3;
226
- if ($[8] !== props.disabled || $[9] !== props.title || $[10] !== _t5 || $[11] !== _t6 || $[12] !== t2) {
227
- t3 = (0, import_jsx_runtime2.jsx)("span", { className: _t5, children: (0, import_jsx_runtime2.jsx)("input", { type: "checkbox", className: "form-check-input custom-control-input", title: props.title, disabled: props.disabled, onChange: _t6, checked: t2 }) });
228
- $[8] = props.disabled;
229
- $[9] = props.title;
230
- $[10] = _t5;
231
- $[11] = _t6;
232
- $[12] = t2;
233
- $[13] = t3;
234
- } else {
235
- t3 = $[13];
236
- }
237
- return t3;
238
- }
239
- case "checkbox": {
240
- var _t7 = "".concat(props.className, " form-check-input");
241
- var _t8;
242
- if ($[14] !== props || $[15] !== _t7) {
243
- _t8 = (0, import_jsx_runtime2.jsx)(import_react_querybuilder.ValueEditor, _objectSpread(_objectSpread({}, props), {}, { skipHook: true, className: _t7 }));
244
- $[14] = props;
245
- $[15] = _t7;
246
- $[16] = _t8;
247
- } else {
248
- _t8 = $[16];
249
- }
250
- return _t8;
251
- }
252
- case "radio": {
253
- var _t9;
254
- if ($[17] !== props.disabled || $[18] !== props.handleOnChange || $[19] !== props.title || $[20] !== props.value || $[21] !== props.values) {
255
- var _props$values;
256
- _t9 = (0, import_jsx_runtime2.jsx)("span", { title: props.title, className: import_react_querybuilder.standardClassnames.value, children: (_props$values = props.values) === null || _props$values === void 0 ? void 0 : _props$values.map(function(v) {
257
- return (0, import_jsx_runtime2.jsx)(RadioButton, { name: v.name, disabled: props.disabled, checked: props.value === v.name, handleOnChange: props.handleOnChange, label: v.label }, v.name);
258
- }) });
259
- $[17] = props.disabled;
260
- $[18] = props.handleOnChange;
261
- $[19] = props.title;
262
- $[20] = props.value;
263
- $[21] = props.values;
264
- $[22] = _t9;
265
- } else {
266
- _t9 = $[22];
267
- }
268
- return _t9;
269
- }
270
- }
271
- var t0 = "".concat(props.className, " form-control form-control-sm");
272
- var t1;
273
- if ($[23] !== props || $[24] !== t0) {
274
- t1 = (0, import_jsx_runtime2.jsx)(import_react_querybuilder.ValueEditor, _objectSpread(_objectSpread({}, props), {}, { skipHook: true, className: t0 }));
275
- $[23] = props;
276
- $[24] = t0;
277
- $[25] = t1;
278
- } else {
279
- t1 = $[25];
280
- }
281
- return t1;
66
+ /**
67
+ * @group Components
68
+ */
69
+ const BootstrapValueEditor = (props) => {
70
+ const { valueListItemClassName } = (0, react_querybuilder.useValueEditor)(props);
71
+ if (props.operator === "null" || props.operator === "notNull") return null;
72
+ if ((props.operator === "between" || props.operator === "notBetween") && (props.type === "select" || props.type === "text")) {
73
+ const listItemClasses = props.type === "text" ? "form-control form-control-sm" : "form-select form-select-sm";
74
+ return /* @__PURE__ */ react.createElement(react_querybuilder.ValueEditor, {
75
+ ...props,
76
+ skipHook: true,
77
+ schema: {
78
+ ...props.schema,
79
+ classNames: {
80
+ ...props.schema.classNames,
81
+ valueListItem: `${valueListItemClassName} ${listItemClasses}`
82
+ }
83
+ }
84
+ });
85
+ }
86
+ switch (props.type) {
87
+ case "select":
88
+ case "multiselect": return /* @__PURE__ */ react.createElement(react_querybuilder.ValueEditor, {
89
+ ...props,
90
+ skipHook: true,
91
+ className: `${props.className} form-select form-select-sm`
92
+ });
93
+ case "switch": return /* @__PURE__ */ react.createElement("span", { className: `${props.className} custom-control custom-switch` }, /* @__PURE__ */ react.createElement("input", {
94
+ type: "checkbox",
95
+ className: "form-check-input custom-control-input",
96
+ title: props.title,
97
+ disabled: props.disabled,
98
+ onChange: (e) => props.handleOnChange(e.target.checked),
99
+ checked: !!props.value
100
+ }));
101
+ case "checkbox": return /* @__PURE__ */ react.createElement(react_querybuilder.ValueEditor, {
102
+ ...props,
103
+ skipHook: true,
104
+ className: `${props.className} form-check-input`
105
+ });
106
+ case "radio": return /* @__PURE__ */ react.createElement("span", {
107
+ title: props.title,
108
+ className: react_querybuilder.standardClassnames.value
109
+ }, props.values?.map((v) => /* @__PURE__ */ react.createElement(RadioButton, {
110
+ key: v.name,
111
+ name: v.name,
112
+ disabled: props.disabled,
113
+ checked: props.value === v.name,
114
+ handleOnChange: props.handleOnChange,
115
+ label: v.label
116
+ })));
117
+ }
118
+ return /* @__PURE__ */ react.createElement(react_querybuilder.ValueEditor, {
119
+ ...props,
120
+ skipHook: true,
121
+ className: `${props.className} form-control form-control-sm`
122
+ });
282
123
  };
283
124
 
284
- // src/index.tsx
285
- var bootstrapControlElements = { notToggle: BootstrapNotToggle, valueEditor: BootstrapValueEditor };
286
- var bootstrapControlClassnames = {
287
- actionElement: "btn btn-sm",
288
- addGroup: "btn-secondary",
289
- addRule: "btn-primary",
290
- cloneGroup: "btn-secondary",
291
- cloneRule: "btn-secondary",
292
- lockGroup: "btn-secondary",
293
- lockRule: "btn-secondary",
294
- removeGroup: "btn-danger",
295
- removeRule: "btn-danger",
296
- // BootstrapValueEditor adds its own classnames
297
- // value: '',
298
- valueSelector: "form-select form-select-sm"
125
+ //#endregion
126
+ //#region src/index.tsx
127
+ /**
128
+ * @group Props
129
+ */
130
+ const bootstrapControlElements = {
131
+ notToggle: BootstrapNotToggle,
132
+ valueEditor: BootstrapValueEditor
299
133
  };
300
- var bootstrapTranslations = { removeGroup: { label: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "bi bi-x" }) }, removeRule: { label: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "bi bi-x" }) }, cloneRule: { label: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "bi bi-copy" }) }, cloneRuleGroup: { label: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "bi bi-copy" }) }, dragHandle: { label: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "bi bi-grip-vertical" }) }, lockGroup: { label: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "bi bi-unlock" }) }, lockRule: { label: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "bi bi-unlock" }) }, lockGroupDisabled: { label: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "bi bi-lock" }) }, lockRuleDisabled: { label: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "bi bi-lock" }) }, shiftActionUp: { label: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "bi bi-chevron-compact-up" }) }, shiftActionDown: { label: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "bi bi-chevron-compact-down" }) } };
301
- var QueryBuilderBootstrap = (0, import_react_querybuilder2.getCompatContextProvider)({ controlClassnames: bootstrapControlClassnames, controlElements: bootstrapControlElements, translations: bootstrapTranslations });
302
- // Annotate the CommonJS export names for ESM import in node:
303
- 0 && (module.exports = {
304
- BootstrapNotToggle,
305
- BootstrapValueEditor,
306
- QueryBuilderBootstrap,
307
- bootstrapControlClassnames,
308
- bootstrapControlElements,
309
- bootstrapTranslations
134
+ /**
135
+ * @group Props
136
+ */
137
+ const bootstrapControlClassnames = {
138
+ actionElement: "btn btn-sm",
139
+ addGroup: "btn-secondary",
140
+ addRule: "btn-primary",
141
+ cloneGroup: "btn-secondary",
142
+ cloneRule: "btn-secondary",
143
+ lockGroup: "btn-secondary",
144
+ lockRule: "btn-secondary",
145
+ removeGroup: "btn-danger",
146
+ removeRule: "btn-danger",
147
+ valueSelector: "form-select form-select-sm"
148
+ };
149
+ /**
150
+ * @group Props
151
+ */
152
+ const bootstrapTranslations = {
153
+ removeGroup: { label: /* @__PURE__ */ react.createElement("i", { className: "bi bi-x" }) },
154
+ removeRule: { label: /* @__PURE__ */ react.createElement("i", { className: "bi bi-x" }) },
155
+ cloneRule: { label: /* @__PURE__ */ react.createElement("i", { className: "bi bi-copy" }) },
156
+ cloneRuleGroup: { label: /* @__PURE__ */ react.createElement("i", { className: "bi bi-copy" }) },
157
+ dragHandle: { label: /* @__PURE__ */ react.createElement("i", { className: "bi bi-grip-vertical" }) },
158
+ lockGroup: { label: /* @__PURE__ */ react.createElement("i", { className: "bi bi-unlock" }) },
159
+ lockRule: { label: /* @__PURE__ */ react.createElement("i", { className: "bi bi-unlock" }) },
160
+ lockGroupDisabled: { label: /* @__PURE__ */ react.createElement("i", { className: "bi bi-lock" }) },
161
+ lockRuleDisabled: { label: /* @__PURE__ */ react.createElement("i", { className: "bi bi-lock" }) },
162
+ shiftActionUp: { label: /* @__PURE__ */ react.createElement("i", { className: "bi bi-chevron-compact-up" }) },
163
+ shiftActionDown: { label: /* @__PURE__ */ react.createElement("i", { className: "bi bi-chevron-compact-down" }) }
164
+ };
165
+ /**
166
+ * @group Components
167
+ */
168
+ const QueryBuilderBootstrap = (0, react_querybuilder.getCompatContextProvider)({
169
+ controlClassnames: bootstrapControlClassnames,
170
+ controlElements: bootstrapControlElements,
171
+ translations: bootstrapTranslations
310
172
  });
173
+
174
+ //#endregion
175
+ exports.BootstrapNotToggle = BootstrapNotToggle;
176
+ exports.BootstrapValueEditor = BootstrapValueEditor;
177
+ exports.QueryBuilderBootstrap = QueryBuilderBootstrap;
178
+ exports.bootstrapControlClassnames = bootstrapControlClassnames;
179
+ exports.bootstrapControlElements = bootstrapControlElements;
180
+ exports.bootstrapTranslations = bootstrapTranslations;
311
181
  //# sourceMappingURL=react-querybuilder_bootstrap.cjs.development.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 _typeof(o){\"@babel/helpers - typeof\";return _typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&\"function\"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?\"symbol\":typeof o;},_typeof(o);}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _toPropertyKey(t){var i=_toPrimitive(t,\"string\");return\"symbol\"==_typeof(i)?i:i+\"\";}function _toPrimitive(t,r){if(\"object\"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||\"default\");if(\"object\"!=_typeof(i))return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return(\"string\"===r?String:Number)(t);}import{c as _c}from\"react-compiler-runtime\";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 $=_c(26);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\";var _t=\"\".concat(valueListItemClassName,\" \").concat(listItemClasses);var _t2;if($[0]!==props||$[1]!==_t){_t2=jsx(ValueEditor,_objectSpread(_objectSpread({},props),{},{skipHook:true,schema:_objectSpread(_objectSpread({},props.schema),{},{classNames:_objectSpread(_objectSpread({},props.schema.classNames),{},{valueListItem:_t})})}));$[0]=props;$[1]=_t;$[2]=_t2;}else{_t2=$[2];}return _t2;}switch(props.type){case\"select\":{}case\"multiselect\":{var _t3=\"\".concat(props.className,\" form-select form-select-sm\");var _t4;if($[3]!==props||$[4]!==_t3){_t4=jsx(ValueEditor,_objectSpread(_objectSpread({},props),{},{skipHook:true,className:_t3}));$[3]=props;$[4]=_t3;$[5]=_t4;}else{_t4=$[5];}return _t4;}case\"switch\":{var _t5=\"\".concat(props.className,\" custom-control custom-switch\");var _t6;if($[6]!==props){_t6=function _t6(e){return props.handleOnChange(e.target.checked);};$[6]=props;$[7]=_t6;}else{_t6=$[7];}var t2=!!props.value;var t3;if($[8]!==props.disabled||$[9]!==props.title||$[10]!==_t5||$[11]!==_t6||$[12]!==t2){t3=jsx(\"span\",{className:_t5,children:jsx(\"input\",{type:\"checkbox\",className:\"form-check-input custom-control-input\",title:props.title,disabled:props.disabled,onChange:_t6,checked:t2})});$[8]=props.disabled;$[9]=props.title;$[10]=_t5;$[11]=_t6;$[12]=t2;$[13]=t3;}else{t3=$[13];}return t3;}case\"checkbox\":{var _t7=\"\".concat(props.className,\" form-check-input\");var _t8;if($[14]!==props||$[15]!==_t7){_t8=jsx(ValueEditor,_objectSpread(_objectSpread({},props),{},{skipHook:true,className:_t7}));$[14]=props;$[15]=_t7;$[16]=_t8;}else{_t8=$[16];}return _t8;}case\"radio\":{var _t9;if($[17]!==props.disabled||$[18]!==props.handleOnChange||$[19]!==props.title||$[20]!==props.value||$[21]!==props.values){var _props$values;_t9=jsx(\"span\",{title:props.title,className:standardClassnames.value,children:(_props$values=props.values)===null||_props$values===void 0?void 0:_props$values.map(function(v){return jsx(RadioButton,{name:v.name,disabled:props.disabled,checked:props.value===v.name,handleOnChange:props.handleOnChange,label:v.label},v.name);})});$[17]=props.disabled;$[18]=props.handleOnChange;$[19]=props.title;$[20]=props.value;$[21]=props.values;$[22]=_t9;}else{_t9=$[22];}return _t9;}}var t0=\"\".concat(props.className,\" form-control form-control-sm\");var t1;if($[23]!==props||$[24]!==t0){t1=jsx(ValueEditor,_objectSpread(_objectSpread({},props),{},{skipHook:true,className:t0}));$[23]=props;$[24]=t0;$[25]=t1;}else{t1=$[25];}return t1;};"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,sBAAe;AAAoB,IAAAC,6BAAoC;;;ACAvE,YAAoB;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,yBAAoB;AAAoB,mBAAiB;AAAe,IAAI,qBAAmB,SAASC,oBAAmB,IAAG;AAAC,MAAI,IAAE,EAAG,EAAE;AAAE,MAAI,YAAU,GAAG,WAAU,iBAAe,GAAG,gBAAe,QAAM,GAAG,OAAM,QAAM,GAAG,OAAM,UAAQ,GAAG,SAAQ,WAAS,GAAG;AAAS,MAAI,SAA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AI,KAAI,EAAC,WAAU,aAAY,CAAC,EAAC,GAAE,kBAAiB,EAAC,OAAqB,6CAAI,KAAI,EAAC,WAAU,aAAY,CAAC,EAAC,GAAE,eAAc,EAAC,OAAqB,6CAAI,KAAI,EAAC,WAAU,2BAA0B,CAAC,EAAC,GAAE,iBAAgB,EAAC,OAAqB,6CAAI,KAAI,EAAC,WAAU,6BAA4B,CAAC,EAAC,EAAC;AAAS,IAAI,4BAAsB,qDAAyB,EAAC,mBAAkB,4BAA2B,iBAAgB,0BAAyB,cAAa,sBAAqB,CAAC;","names":["import_jsx_runtime","import_react_querybuilder","BootstrapNotToggle","t2","import_jsx_runtime","React","o","r","RadioButton","t0","BootstrapValueEditor","_t6"]}
1
+ {"version":3,"file":"react-querybuilder_bootstrap.cjs.development.js","names":["React","ValueEditor","standardClassnames","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":";;;;;;;;;;;;;;;;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