json-rules-filter 1.0.22 → 1.0.23

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "json-rules-filter",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "description": "para crear reglas avanzadas de filtrado sobre datasets JSON de forma dinámica y visual.",
5
5
  "main": "src/jquery.jsonRulesFilter.js",
6
6
  "scripts": {
@@ -33,12 +33,13 @@
33
33
  nEquals: "Igual a", nDifference: "Diferente de", nGreatherThan: "Mayor que",
34
34
  nGreatherThanOrEquals: "Mayor o igual que", nLowerThan: "Menor que", nLowerThanOrEquals: "Menor o igual que"
35
35
  },
36
- searchLabel:{
36
+ searchLabel: {
37
37
  string: "Texto",
38
38
  number: "Número"
39
39
  }
40
40
  },
41
- title: { text: "Reglas de filtrado", className: "fs-6 fw-semibold"},
41
+ scrollY: false,
42
+ title: { text: "Reglas de filtrado", className: "fs-6 fw-semibold" },
42
43
  buttons: {
43
44
  reset: { text: "Resetear", className: "fw-semibold link-danger link-offset-2 link-underline link-underline-opacity-0" },
44
45
  dropdown: { text: "Añadir regla", className: "btn btn-secondary" },
@@ -144,7 +145,7 @@
144
145
  <p class="${this.bs(this.settings.title.className)}">${this.settings.title.text}</p>
145
146
  <p><a class="${this.bs(this.settings.buttons.reset.className)} remove-rules-containers" href="#">${this.settings.buttons.reset.text}</a></p>
146
147
  </div>
147
- <div class="py-2" id="container-rules-filters"></div>
148
+ <div class="py-2 container-rules-filters"></div>
148
149
  <div class="mt-2">
149
150
  <div class="d-flex justify-content-start dropdown">
150
151
  <button ${this.settings.bsVersion === 5 ? `data-bs-popper-config='{"strategy":"fixed"}'` : ''} class="${this.bs(this.settings.buttons.dropdown.className)} dropdown-toggle" type="button" ${toggleAttr}>
@@ -159,6 +160,17 @@
159
160
  </div>
160
161
  </div>`;
161
162
  this.$contenedor.append(template);
163
+ if (this.settings.scrollY !== false) {
164
+ const maxHeight = typeof this.settings.scrollY === 'number' ?
165
+ this.settings.scrollY + 'px' :
166
+ this.settings.scrollY;
167
+
168
+ this.$contenedor.find(".container-rules-filters").css({
169
+ "max-height": maxHeight,
170
+ "overflow-y": "auto",
171
+ "overflow-x": "hidden"
172
+ })
173
+ }
162
174
  },
163
175
 
164
176
  // Event delegation and listeners
@@ -213,14 +225,14 @@
213
225
 
214
226
  // Resets rule container and re-runs filtering (show all)
215
227
  reset: function () {
216
- $("#container-rules-filters").empty();
228
+ $(".container-rules-filters").empty();
217
229
  this.applyRules();
218
230
  },
219
231
 
220
232
  // Adds a new rule row dynamically
221
233
  addRuleRow: function (type, dataField, name) {
222
234
  const self = this;
223
- const $container = this.$contenedor.find("#container-rules-filters");
235
+ const $container = this.$contenedor.find(".container-rules-filters");
224
236
 
225
237
  // Generate unique ID for the new row based on the last element
226
238
  let id_select = 0;