@pepperi-addons/ngx-lib 0.3.15-beta.20 → 0.3.15-beta.21

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.
Files changed (41) hide show
  1. package/bundles/pepperi-addons-ngx-lib-query-builder.umd.js +22 -11
  2. package/bundles/pepperi-addons-ngx-lib-query-builder.umd.js.map +1 -1
  3. package/bundles/pepperi-addons-ngx-lib-smart-filters.umd.js +76 -40
  4. package/bundles/pepperi-addons-ngx-lib-smart-filters.umd.js.map +1 -1
  5. package/bundles/pepperi-addons-ngx-lib.umd.js +46 -0
  6. package/bundles/pepperi-addons-ngx-lib.umd.js.map +1 -1
  7. package/core/common/pipes/date-ago.pipe.d.ts +8 -0
  8. package/core/common/pipes/public-api.d.ts +1 -0
  9. package/esm2015/core/common/pipes/date-ago.pipe.js +45 -0
  10. package/esm2015/core/common/pipes/public-api.js +2 -1
  11. package/esm2015/ngx-lib.module.js +3 -1
  12. package/esm2015/query-builder/common/model/legacy.js +1 -1
  13. package/esm2015/query-builder/common/model/operator.js +19 -8
  14. package/esm2015/query-builder/common/model/type-map.js +3 -3
  15. package/esm2015/query-builder/query-builder-item/query-builder-item.component.js +2 -2
  16. package/esm2015/smart-filters/common/model/operator.js +21 -32
  17. package/esm2015/smart-filters/common/model/type.js +1 -1
  18. package/esm2015/smart-filters/date-filter/date-filter.component.js +12 -4
  19. package/esm2015/smart-filters/multi-select-filter/multi-select-filter.component.js +44 -6
  20. package/esm2015/smart-filters/smart-filters.component.js +2 -2
  21. package/esm2015/smart-filters/text-filter/text-filter.component.js +2 -2
  22. package/fesm2015/pepperi-addons-ngx-lib-query-builder.js +21 -10
  23. package/fesm2015/pepperi-addons-ngx-lib-query-builder.js.map +1 -1
  24. package/fesm2015/pepperi-addons-ngx-lib-smart-filters.js +75 -40
  25. package/fesm2015/pepperi-addons-ngx-lib-smart-filters.js.map +1 -1
  26. package/fesm2015/pepperi-addons-ngx-lib.js +45 -1
  27. package/fesm2015/pepperi-addons-ngx-lib.js.map +1 -1
  28. package/package.json +1 -1
  29. package/pepperi-addons-ngx-lib.metadata.json +1 -1
  30. package/query-builder/common/model/legacy.d.ts +1 -1
  31. package/query-builder/common/model/type-map.d.ts +2 -2
  32. package/query-builder/pepperi-addons-ngx-lib-query-builder.metadata.json +1 -1
  33. package/smart-filters/boolean-filter/boolean-filter.component.d.ts +0 -1
  34. package/smart-filters/common/model/operator.d.ts +2 -1
  35. package/smart-filters/common/model/type.d.ts +1 -1
  36. package/smart-filters/date-filter/date-filter.component.d.ts +3 -1
  37. package/smart-filters/multi-select-filter/multi-select-filter.component.d.ts +14 -0
  38. package/smart-filters/number-filter/number-filter.component.d.ts +2 -1
  39. package/smart-filters/pepperi-addons-ngx-lib-smart-filters.metadata.json +1 -1
  40. package/smart-filters/text-filter/text-filter.component.d.ts +0 -1
  41. package/src/assets/i18n/en.ngx-lib.json +16 -1
@@ -591,6 +591,50 @@
591
591
  { type: i0.Pipe, args: [{ name: 'pepToNumber' },] }
592
592
  ];
593
593
 
594
+ var DateAgoPipe = /** @class */ (function () {
595
+ function DateAgoPipe(translateService) {
596
+ this.translateService = translateService;
597
+ }
598
+ DateAgoPipe.prototype.getCounterTranslation = function (counter, key) {
599
+ var intervalText = this.translateService.get("DATE_AGO." + key.toUpperCase()) || key;
600
+ var agoText = this.translateService.get(counter === 1 ? 'DATE_AGO.SINGULAR' : 'DATE_AGO.PLURAL') || counter === 1 ? ' ago' : 's ago';
601
+ return "" + intervalText + agoText;
602
+ };
603
+ DateAgoPipe.prototype.transform = function (value, args) {
604
+ if (value) {
605
+ var seconds = Math.floor((+new Date() - +new Date(value)) / 1000);
606
+ if (seconds < 29) // less than 30 seconds ago will show as 'Just now'
607
+ return this.translateService.get('DATE_AGO.JUST_NOW') || 'Just now';
608
+ var intervals = {
609
+ 'year': 31536000,
610
+ 'month': 2592000,
611
+ 'week': 604800,
612
+ 'day': 86400,
613
+ 'hour': 3600,
614
+ 'minute': 60,
615
+ 'second': 1
616
+ };
617
+ var counter = void 0;
618
+ for (var i in intervals) {
619
+ counter = Math.floor(seconds / intervals[i]);
620
+ if (counter > 0) {
621
+ this.getCounterTranslation(counter, i);
622
+ }
623
+ }
624
+ }
625
+ return value;
626
+ };
627
+ return DateAgoPipe;
628
+ }());
629
+ DateAgoPipe.decorators = [
630
+ { type: i0.Pipe, args: [{
631
+ name: 'dateAgo'
632
+ },] }
633
+ ];
634
+ DateAgoPipe.ctorParameters = function () { return [
635
+ { type: i1.TranslateService }
636
+ ]; };
637
+
594
638
  var PepInputAutoWidthDirective = /** @class */ (function () {
595
639
  function PepInputAutoWidthDirective(renderer, el) {
596
640
  this.renderer = renderer;
@@ -4881,6 +4925,7 @@
4881
4925
  PepSafePipe,
4882
4926
  PepSplitUppercasePipe,
4883
4927
  PepToNumberPipe,
4928
+ DateAgoPipe
4884
4929
  ];
4885
4930
  var utilitiesList = [
4886
4931
  PepInputAutoWidthDirective,
@@ -4938,6 +4983,7 @@
4938
4983
 
4939
4984
  exports.DEFAULT_HORIZONTAL_ALIGNMENT = DEFAULT_HORIZONTAL_ALIGNMENT;
4940
4985
  exports.DEFAULT_VERTICAL_ALIGNMENT = DEFAULT_VERTICAL_ALIGNMENT;
4986
+ exports.DateAgoPipe = DateAgoPipe;
4941
4987
  exports.FieldLayout = FieldLayout;
4942
4988
  exports.KeyValuePair = KeyValuePair;
4943
4989
  exports.ObjectSingleData = ObjectSingleData;