json-rules-filter 1.0.22 → 1.0.24

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.24",
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,19 @@
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
+ "margin-right": "-10px",
173
+ "padding-right":"10px"
174
+ })
175
+ }
162
176
  },
163
177
 
164
178
  // Event delegation and listeners
@@ -213,14 +227,14 @@
213
227
 
214
228
  // Resets rule container and re-runs filtering (show all)
215
229
  reset: function () {
216
- $("#container-rules-filters").empty();
230
+ $(".container-rules-filters").empty();
217
231
  this.applyRules();
218
232
  },
219
233
 
220
234
  // Adds a new rule row dynamically
221
235
  addRuleRow: function (type, dataField, name) {
222
236
  const self = this;
223
- const $container = this.$contenedor.find("#container-rules-filters");
237
+ const $container = this.$contenedor.find(".container-rules-filters");
224
238
 
225
239
  // Generate unique ID for the new row based on the last element
226
240
  let id_select = 0;