backend-plus 2.0.0-rc.17 → 2.0.0-rc.18

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.
@@ -183,20 +183,15 @@ myOwn.i18n.messages.es=changing(myOwn.i18n.messages.es, {
183
183
  /** @param {string} text */
184
184
  function regex4search(text){
185
185
  return new RegExp(
186
- text.trim().replace(/[.*+?^${}()|[\]\\]/g, "\\$&")
186
+ text.toString().trim().replace(/[.*+?^${}()|[\]\\]/g, "\\$&")
187
187
  // .replace(/"/g,"\\b")
188
188
  .replace(/[ñÑ]/g,'(?:gn|nn?i?|[ñÑ])')
189
- .replace(/[cCçÇ]/g,'[cçÇ]')
190
- .replace(/[áÁàÀäÄãÃ]/gi,'[AáÁàÀäÄãÃ]')
191
- .replace(/[éÉèÈëË]/gi,'[EéÉèÈëË]')
192
- .replace(/[íÍìÌïÏ]/gi,'[IíÍìÌïÏ]')
193
- .replace(/[óÓòÒöÖõÕ]/gi,'[OóÓòÒöÖõÕ]')
194
- .replace(/[úÚùÙüÜ]/gi,'[UúÚùÙüÜ]')
195
- .replace(/a/gi,'[AáÁàÀäÄãÃ]')
196
- .replace(/e/gi,'[EéÉèÈëË]')
197
- .replace(/i/gi,'[IíÍìÌïÏ]')
198
- .replace(/o/gi,'[OóÓòÒöÖõÕ]')
199
- .replace(/u/gi,'[UúÚùÙüÜ]')
189
+ .replace(/[cCçÇ]/g,'[cCçÇ]')
190
+ .replace(/[AáÁàÀäÄãÃ]/gi,'[AáÁàÀäÄãÃ]')
191
+ .replace(/[EéÉèÈëË]/gi,'[EéÉèÈëË]')
192
+ .replace(/[IíÍìÌïÏ]/gi,'[IíÍìÌïÏ]')
193
+ .replace(/[OóÓòÒöÖõÕ]/gi,'[OóÓòÒöÖõÕ]')
194
+ .replace(/[UúÚùÙüÜ]/gi,'[UúÚùÙüÜ]')
200
195
  // .replace(/\s+/g,'.*\\s+.*') mas estricto, exige el espacio
201
196
  .replace(/\s+/g,'.*')
202
197
  , 'i');
@@ -212,9 +207,9 @@ myOwn.comparatorParameterNull={
212
207
  '!=\u2205':true,
213
208
  }
214
209
  myOwn.comparator={
215
- '=':function(valueToCheck,condition){return valueToCheck == condition;},
216
- '~':function(valueToCheck,condition){return condition==null || regex4search(condition.toString()).test(valueToCheck);},
217
- '!~':function(valueToCheck,condition){return condition==null || !regex4search(condition.toString()).test(valueToCheck);},
210
+ '=':function(valueToCheck,condition){return sameValue(valueToCheck,condition);},
211
+ '~': function(valueToCheck,condition){return condition==null || condition instanceof Date ? Math.abs(condition-valueToCheck) <= 1000*60*60*24 : regex4search(condition).test(valueToCheck);},
212
+ '!~':function(valueToCheck,condition){return condition==null || condition instanceof Date ? Math.abs(condition-valueToCheck) > 1000*60*60*24 :!regex4search(condition).test(valueToCheck);},
218
213
  '/R/i':function(valueToCheck,condition){return condition==null || RegExp(condition,'i').test(valueToCheck);},
219
214
  '\u2205':function(valueToCheck,condition){return valueToCheck == null;},//\u2205 = conjunto vacío
220
215
  '!=\u2205':function(valueToCheck,condition){return valueToCheck != null;},//\u2205 = conjunto vacío
@@ -1005,7 +1000,7 @@ myOwn.DataColumnGrid.prototype.thFilter = function thFilter(depot, iColumn){
1005
1000
  var grid = this.grid;
1006
1001
  var fieldDef = this.fieldDef;
1007
1002
  var fieldName=fieldDef.name;
1008
- depot.rowSymbols[fieldDef.name]=depot.rowSymbols[fieldDef.name]||'~';
1003
+ depot.rowSymbols[fieldDef.name]=depot.rowSymbols[fieldDef.name]||(fieldDef.typeName == 'text' ? '~' : '=');
1009
1004
  var filterImage=my.path.img+my.comparator.traductor[depot.rowSymbols[fieldDef.name]]+'.png';
1010
1005
  var th=html.td(this.cellAttributes({class:"autoFilter", "typed-controls-direct-input":true},{skipMandatory:true})).create();
1011
1006
  var symbolFilter=th;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "backend-plus",
3
3
  "description": "Backend for the anti Pareto rule",
4
- "version": "2.0.0-rc.17",
4
+ "version": "2.0.0-rc.18",
5
5
  "author": "Codenautas <codenautas@googlegroups.com>",
6
6
  "license": "MIT",
7
7
  "repository": "codenautas/backend-plus",