json-rules-filter 1.0.12 → 1.0.14
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/package.json +1 -1
- package/src/jquery.jsonRulesFilter.js +10 -12
package/package.json
CHANGED
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
|
|
55
55
|
// ---- Compatibility helper bs5/bs4 ------
|
|
56
56
|
bs: function(classes) {
|
|
57
|
-
if (this.settings.
|
|
57
|
+
if (this.settings.bsVersion === 5) return classes;
|
|
58
58
|
|
|
59
59
|
const map = {
|
|
60
60
|
'fs-6':'',
|
|
@@ -117,11 +117,11 @@
|
|
|
117
117
|
render: function () {
|
|
118
118
|
const self = this;
|
|
119
119
|
// Atributo de toggle dinámico
|
|
120
|
-
const toggleAttr = this.settings.
|
|
120
|
+
const toggleAttr = this.settings.bsVersion === 4 ? 'data-toggle="dropdown"' : 'data-bs-toggle="dropdown"';
|
|
121
121
|
|
|
122
122
|
// Ajuste de Gutters para BS4 (usamos form-row en lugar de row g-2 si es BS4)
|
|
123
|
-
const rowClass = this.settings.
|
|
124
|
-
const colClass = this.settings.
|
|
123
|
+
const rowClass = this.settings.bsVersion === 4 ? 'form-row' : 'row g-2';
|
|
124
|
+
const colClass = this.settings.bsVersion === 4 ? 'col-6' : 'col-6';
|
|
125
125
|
|
|
126
126
|
let columnasHtml = `<div class="${rowClass}">`;
|
|
127
127
|
this.settings.filters.forEach((col, index) => {
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
<div class="py-2" id="container-rules-filters"></div>
|
|
145
145
|
<div class="mt-2">
|
|
146
146
|
<div class="d-flex justify-content-start dropdown">
|
|
147
|
-
<button class="${this.bs(this.settings.buttons.dropdown.className)} dropdown-toggle" type="button" ${toggleAttr}>
|
|
147
|
+
<button ${this.settings.bsVersion === 4?`data-bs-popper-config='{"strategy":"fixed"}'` :''} class="${this.bs(this.settings.buttons.dropdown.className)} dropdown-toggle" type="button" ${toggleAttr}>
|
|
148
148
|
${this.settings.buttons.dropdown.text}
|
|
149
149
|
</button>
|
|
150
150
|
<div class="dropdown-menu p-2 dropdown-rules-columns" style="min-width: 300px;">
|
|
@@ -158,13 +158,11 @@
|
|
|
158
158
|
this.$contenedor.append(template);
|
|
159
159
|
const $dropdown = this.$contenedor.find('.dropdown-toggle');
|
|
160
160
|
|
|
161
|
-
if (this.settings.
|
|
162
|
-
|
|
163
|
-
} else {
|
|
164
|
-
//BS5
|
|
161
|
+
if (this.settings.bsVersion === 4) {
|
|
162
|
+
//BS4
|
|
165
163
|
$dropdown.dropdown({
|
|
166
164
|
popperConfig: {
|
|
167
|
-
|
|
165
|
+
positionFixed: true
|
|
168
166
|
}
|
|
169
167
|
});
|
|
170
168
|
}
|
|
@@ -210,8 +208,8 @@
|
|
|
210
208
|
if (last_container.length > 0) { id_select = last_container.data("id") + 1; }
|
|
211
209
|
|
|
212
210
|
// Usar 'form-group' y 'font-weight-bold' si es BS4
|
|
213
|
-
const labelClass = this.settings.
|
|
214
|
-
const rowClass = this.settings.
|
|
211
|
+
const labelClass = this.settings.bsVersion === 4 ? 'font-weight-bold' : 'form-label fw-bold';
|
|
212
|
+
const rowClass = this.settings.bsVersion === 4 ? 'form-row' : 'row';
|
|
215
213
|
|
|
216
214
|
// Define search input template (hidden for 'select' type)
|
|
217
215
|
const searchInput = `
|