@stemy/ngx-utils 12.2.5 → 12.2.7

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/stemy-ngx-utils.umd.js +105 -41
  2. package/bundles/stemy-ngx-utils.umd.js.map +1 -1
  3. package/esm2015/ngx-utils/directives/async-method.base.js +11 -2
  4. package/esm2015/ngx-utils/ngx-utils.module.js +7 -1
  5. package/esm2015/ngx-utils/pipes/pop.pipe.js +12 -0
  6. package/esm2015/ngx-utils/pipes/shift.pipe.js +12 -0
  7. package/esm2015/ngx-utils/pipes/split.pipe.js +12 -0
  8. package/esm2015/ngx-utils/utils/date.utils.js +8 -7
  9. package/esm2015/public_api.js +5 -1
  10. package/esm2015/stemy-ngx-utils.js +1 -2
  11. package/esm2020/ngx-utils/components/unordered-list/unordered-list.component.mjs +3 -3
  12. package/esm2020/ngx-utils/ngx-utils.imports.mjs +7 -1
  13. package/esm2020/ngx-utils/ngx-utils.module.mjs +31 -28
  14. package/esm2020/ngx-utils/pipes/pop.pipe.mjs +16 -0
  15. package/esm2020/ngx-utils/pipes/shift.pipe.mjs +16 -0
  16. package/esm2020/ngx-utils/pipes/split.pipe.mjs +16 -0
  17. package/esm2020/ngx-utils/plugins/resize-event.plugin.mjs +4 -4
  18. package/esm2020/ngx-utils/services/config.service.mjs +6 -5
  19. package/esm2020/ngx-utils/services/formatter.service.mjs +3 -2
  20. package/esm2020/ngx-utils/utils/array.utils.mjs +8 -1
  21. package/esm2020/ngx-utils/utils/date.utils.mjs +5 -5
  22. package/esm2020/ngx-utils/utils/file-system.mjs +6 -1
  23. package/esm2020/ngx-utils/utils/math.utils.mjs +31 -2
  24. package/esm2020/ngx-utils/utils/object.utils.mjs +36 -25
  25. package/esm2020/public_api.mjs +4 -1
  26. package/fesm2015/stemy-ngx-utils.js +86 -40
  27. package/fesm2015/stemy-ngx-utils.js.map +1 -1
  28. package/fesm2015/stemy-ngx-utils.mjs +142 -42
  29. package/fesm2015/stemy-ngx-utils.mjs.map +1 -1
  30. package/fesm2020/stemy-ngx-utils.mjs +141 -42
  31. package/fesm2020/stemy-ngx-utils.mjs.map +1 -1
  32. package/ngx-utils/directives/async-method.base.d.ts +2 -2
  33. package/ngx-utils/ngx-utils.module.d.ts +1 -1
  34. package/ngx-utils/pipes/pop.pipe.d.ts +4 -0
  35. package/ngx-utils/pipes/shift.pipe.d.ts +4 -0
  36. package/ngx-utils/pipes/split.pipe.d.ts +4 -0
  37. package/ngx-utils/utils/date.utils.d.ts +1 -1
  38. package/package.json +1 -1
  39. package/public_api.d.ts +4 -0
  40. package/stemy-ngx-utils.d.ts +0 -1
  41. package/stemy-ngx-utils.metadata.json +1 -1
@@ -4,6 +4,10 @@
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.stemy = global.stemy || {}, global.stemy["ngx-utils"] = {}), global.ng.core, null, global.moment, global.rxjs.operators, global.rxjs, global.invokable, global.ng.router, global.ng.common, global["ngx-device-detector"], global.ng.common.http, global.ng.platformBrowser, global["resize-detector"], global.ng.forms));
5
5
  })(this, (function (exports, core, reflectMetadata, moment, operators, rxjs, invokable, router, common, ngxDeviceDetector, http, platformBrowser, resizeDetector, forms) { 'use strict';
6
6
 
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
+
9
+ var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
10
+
7
11
  /*! *****************************************************************************
8
12
  Copyright (c) Microsoft Corporation.
9
13
 
@@ -860,21 +864,23 @@
860
864
  function DateUtils() {
861
865
  }
862
866
  DateUtils.isHoliday = function (date) {
863
- return moment.utc(date).isoWeekday() > 5;
867
+ return moment__default["default"](date).isoWeekday() > 5;
864
868
  };
865
869
  DateUtils.isBusinessDay = function (date) {
866
- return moment.utc(date).isoWeekday() < 6;
870
+ return moment__default["default"](date).isoWeekday() < 6;
867
871
  };
868
872
  DateUtils.add = function (date, amount, unit) {
869
- return moment.utc(date).add(amount, unit).toDate();
873
+ return moment__default["default"](date).add(amount, unit).toDate();
870
874
  };
871
- DateUtils.businessAdd = function (date, amount, unit) {
875
+ DateUtils.businessAdd = function (date, amount, unit, freeDays) {
876
+ if (freeDays === void 0) { freeDays = []; }
872
877
  var signal = amount < 0 ? -1 : 1;
878
+ var freeMoments = freeDays.map(function (d) { return moment__default["default"](d); });
873
879
  var remaining = Math.abs(amount);
874
880
  var day = date;
875
881
  while (remaining) {
876
882
  day = DateUtils.add(day, signal, unit);
877
- if (DateUtils.isBusinessDay(day)) {
883
+ if (DateUtils.isBusinessDay(day) && !freeMoments.some(function (m) { return m.isSame(day, "day"); })) {
878
884
  remaining--;
879
885
  }
880
886
  }
@@ -4653,6 +4659,20 @@
4653
4659
  },] }
4654
4660
  ];
4655
4661
 
4662
+ var PopPipe = /** @class */ (function () {
4663
+ function PopPipe() {
4664
+ }
4665
+ PopPipe.prototype.transform = function (value) {
4666
+ return !Array.isArray(value) ? null : Array.from(value).pop();
4667
+ };
4668
+ return PopPipe;
4669
+ }());
4670
+ PopPipe.decorators = [
4671
+ { type: core.Pipe, args: [{
4672
+ name: "pop"
4673
+ },] }
4674
+ ];
4675
+
4656
4676
  function defaultReducer(result) {
4657
4677
  return result;
4658
4678
  }
@@ -4799,6 +4819,35 @@
4799
4819
  { type: platformBrowser.DomSanitizer }
4800
4820
  ]; };
4801
4821
 
4822
+ var ShiftPipe = /** @class */ (function () {
4823
+ function ShiftPipe() {
4824
+ }
4825
+ ShiftPipe.prototype.transform = function (value) {
4826
+ return !Array.isArray(value) ? null : Array.from(value).shift();
4827
+ };
4828
+ return ShiftPipe;
4829
+ }());
4830
+ ShiftPipe.decorators = [
4831
+ { type: core.Pipe, args: [{
4832
+ name: "shift"
4833
+ },] }
4834
+ ];
4835
+
4836
+ var SplitPipe = /** @class */ (function () {
4837
+ function SplitPipe() {
4838
+ }
4839
+ SplitPipe.prototype.transform = function (value, separator) {
4840
+ if (separator === void 0) { separator = "."; }
4841
+ return ("" + value).split(separator);
4842
+ };
4843
+ return SplitPipe;
4844
+ }());
4845
+ SplitPipe.decorators = [
4846
+ { type: core.Pipe, args: [{
4847
+ name: "split"
4848
+ },] }
4849
+ ];
4850
+
4802
4851
  var TranslatePipe = /** @class */ (function () {
4803
4852
  function TranslatePipe(cdr, language) {
4804
4853
  this.cdr = cdr;
@@ -4926,6 +4975,9 @@
4926
4975
  enumerable: false,
4927
4976
  configurable: true
4928
4977
  });
4978
+ AsyncMethodBase.prototype.getMethod = function () {
4979
+ return null;
4980
+ };
4929
4981
  AsyncMethodBase.prototype.click = function () {
4930
4982
  if (this.disabled)
4931
4983
  return;
@@ -4959,6 +5011,12 @@
4959
5011
  };
4960
5012
  return AsyncMethodBase;
4961
5013
  }());
5014
+ AsyncMethodBase.decorators = [
5015
+ { type: core.Injectable }
5016
+ ];
5017
+ AsyncMethodBase.ctorParameters = function () { return [
5018
+ { type: undefined }
5019
+ ]; };
4962
5020
  AsyncMethodBase.propDecorators = {
4963
5021
  disabled: [{ type: core.Input }],
4964
5022
  context: [{ type: core.Input }],
@@ -5492,6 +5550,41 @@
5492
5550
  updateSticky: [{ type: core.HostListener, args: ["window:resize",] }, { type: core.HostListener, args: ["window:scroll",] }]
5493
5551
  };
5494
5552
 
5553
+ var StickyClassDirective = /** @class */ (function () {
5554
+ function StickyClassDirective(events, element, renderer) {
5555
+ this.events = events;
5556
+ this.element = element;
5557
+ this.renderer = renderer;
5558
+ }
5559
+ StickyClassDirective.prototype.ngOnInit = function () {
5560
+ var _this = this;
5561
+ this.stickyUpdated = this.events.stickyUpdated.subscribe(function () {
5562
+ if (_this.events.isSticky) {
5563
+ _this.renderer.addClass(_this.element.nativeElement, _this.stickyClass || "sticky-sibling");
5564
+ return;
5565
+ }
5566
+ _this.renderer.removeClass(_this.element.nativeElement, _this.stickyClass || "sticky-sibling");
5567
+ });
5568
+ };
5569
+ StickyClassDirective.prototype.ngOnDestroy = function () {
5570
+ this.stickyUpdated.unsubscribe();
5571
+ };
5572
+ return StickyClassDirective;
5573
+ }());
5574
+ StickyClassDirective.decorators = [
5575
+ { type: core.Directive, args: [{
5576
+ selector: "[stickyClass]"
5577
+ },] }
5578
+ ];
5579
+ StickyClassDirective.ctorParameters = function () { return [
5580
+ { type: EventsService },
5581
+ { type: core.ElementRef },
5582
+ { type: core.Renderer2 }
5583
+ ]; };
5584
+ StickyClassDirective.propDecorators = {
5585
+ stickyClass: [{ type: core.Input }]
5586
+ };
5587
+
5495
5588
  var UnorderedListItemDirective = /** @class */ (function () {
5496
5589
  function UnorderedListItemDirective(elementRef, renderer, viewContainer) {
5497
5590
  this.elementRef = elementRef;
@@ -5885,41 +5978,6 @@
5885
5978
  boundaryLinks: [{ type: core.Input }]
5886
5979
  };
5887
5980
 
5888
- var StickyClassDirective = /** @class */ (function () {
5889
- function StickyClassDirective(events, element, renderer) {
5890
- this.events = events;
5891
- this.element = element;
5892
- this.renderer = renderer;
5893
- }
5894
- StickyClassDirective.prototype.ngOnInit = function () {
5895
- var _this = this;
5896
- this.stickyUpdated = this.events.stickyUpdated.subscribe(function () {
5897
- if (_this.events.isSticky) {
5898
- _this.renderer.addClass(_this.element.nativeElement, _this.stickyClass || "sticky-sibling");
5899
- return;
5900
- }
5901
- _this.renderer.removeClass(_this.element.nativeElement, _this.stickyClass || "sticky-sibling");
5902
- });
5903
- };
5904
- StickyClassDirective.prototype.ngOnDestroy = function () {
5905
- this.stickyUpdated.unsubscribe();
5906
- };
5907
- return StickyClassDirective;
5908
- }());
5909
- StickyClassDirective.decorators = [
5910
- { type: core.Directive, args: [{
5911
- selector: "[stickyClass]"
5912
- },] }
5913
- ];
5914
- StickyClassDirective.ctorParameters = function () { return [
5915
- { type: EventsService },
5916
- { type: core.ElementRef },
5917
- { type: core.Renderer2 }
5918
- ]; };
5919
- StickyClassDirective.propDecorators = {
5920
- stickyClass: [{ type: core.Input }]
5921
- };
5922
-
5923
5981
  // --- Pipes ---
5924
5982
  var pipes = [
5925
5983
  ChunkPipe,
@@ -5938,12 +5996,15 @@
5938
5996
  MapPipe,
5939
5997
  MaxPipe,
5940
5998
  MinPipe,
5999
+ PopPipe,
5941
6000
  ReducePipe,
5942
6001
  RemapPipe,
5943
6002
  ReplacePipe,
5944
6003
  ReversePipe,
5945
6004
  RoundPipe,
5946
6005
  SafeHtmlPipe,
6006
+ ShiftPipe,
6007
+ SplitPipe,
5947
6008
  TranslatePipe,
5948
6009
  ValuesPipe
5949
6010
  ];
@@ -6157,6 +6218,7 @@
6157
6218
  exports.PaginationItemDirective = PaginationItemDirective;
6158
6219
  exports.PaginationMenuComponent = PaginationMenuComponent;
6159
6220
  exports.Point = Point;
6221
+ exports.PopPipe = PopPipe;
6160
6222
  exports.PromiseService = PromiseService;
6161
6223
  exports.ROOT_ELEMENT = ROOT_ELEMENT;
6162
6224
  exports.Rect = Rect;
@@ -6173,9 +6235,12 @@
6173
6235
  exports.SafeHtmlPipe = SafeHtmlPipe;
6174
6236
  exports.ScrollEventPlugin = ScrollEventPlugin;
6175
6237
  exports.SetUtils = SetUtils;
6238
+ exports.ShiftPipe = ShiftPipe;
6239
+ exports.SplitPipe = SplitPipe;
6176
6240
  exports.StateService = StateService;
6177
6241
  exports.StaticAuthService = StaticAuthService;
6178
6242
  exports.StaticLanguageService = StaticLanguageService;
6243
+ exports.StickyClassDirective = StickyClassDirective;
6179
6244
  exports.StickyDirective = StickyDirective;
6180
6245
  exports.StorageService = StorageService;
6181
6246
  exports.StringUtils = StringUtils;
@@ -6197,7 +6262,6 @@
6197
6262
  exports["ɵc"] = components;
6198
6263
  exports["ɵd"] = providers;
6199
6264
  exports["ɵe"] = loadConfig;
6200
- exports["ɵf"] = StickyClassDirective;
6201
6265
 
6202
6266
  Object.defineProperty(exports, '__esModule', { value: true });
6203
6267