@stemy/ngx-utils 12.2.6 → 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 (34) hide show
  1. package/bundles/stemy-ngx-utils.umd.js +56 -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/utils/date.utils.js +8 -7
  5. package/esm2015/public_api.js +2 -1
  6. package/esm2015/stemy-ngx-utils.js +1 -2
  7. package/esm2020/ngx-utils/components/unordered-list/unordered-list.component.mjs +3 -3
  8. package/esm2020/ngx-utils/ngx-utils.imports.mjs +7 -1
  9. package/esm2020/ngx-utils/ngx-utils.module.mjs +31 -28
  10. package/esm2020/ngx-utils/pipes/pop.pipe.mjs +16 -0
  11. package/esm2020/ngx-utils/pipes/shift.pipe.mjs +16 -0
  12. package/esm2020/ngx-utils/pipes/split.pipe.mjs +16 -0
  13. package/esm2020/ngx-utils/plugins/resize-event.plugin.mjs +4 -4
  14. package/esm2020/ngx-utils/services/config.service.mjs +6 -5
  15. package/esm2020/ngx-utils/services/formatter.service.mjs +3 -2
  16. package/esm2020/ngx-utils/utils/array.utils.mjs +8 -1
  17. package/esm2020/ngx-utils/utils/date.utils.mjs +5 -5
  18. package/esm2020/ngx-utils/utils/file-system.mjs +6 -1
  19. package/esm2020/ngx-utils/utils/math.utils.mjs +31 -2
  20. package/esm2020/ngx-utils/utils/object.utils.mjs +36 -25
  21. package/esm2020/public_api.mjs +4 -1
  22. package/fesm2015/stemy-ngx-utils.js +50 -40
  23. package/fesm2015/stemy-ngx-utils.js.map +1 -1
  24. package/fesm2015/stemy-ngx-utils.mjs +142 -42
  25. package/fesm2015/stemy-ngx-utils.mjs.map +1 -1
  26. package/fesm2020/stemy-ngx-utils.mjs +141 -42
  27. package/fesm2020/stemy-ngx-utils.mjs.map +1 -1
  28. package/ngx-utils/directives/async-method.base.d.ts +2 -2
  29. package/ngx-utils/ngx-utils.module.d.ts +1 -1
  30. package/ngx-utils/utils/date.utils.d.ts +1 -1
  31. package/package.json +1 -1
  32. package/public_api.d.ts +1 -0
  33. package/stemy-ngx-utils.d.ts +0 -1
  34. 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
  }
@@ -4969,6 +4975,9 @@
4969
4975
  enumerable: false,
4970
4976
  configurable: true
4971
4977
  });
4978
+ AsyncMethodBase.prototype.getMethod = function () {
4979
+ return null;
4980
+ };
4972
4981
  AsyncMethodBase.prototype.click = function () {
4973
4982
  if (this.disabled)
4974
4983
  return;
@@ -5002,6 +5011,12 @@
5002
5011
  };
5003
5012
  return AsyncMethodBase;
5004
5013
  }());
5014
+ AsyncMethodBase.decorators = [
5015
+ { type: core.Injectable }
5016
+ ];
5017
+ AsyncMethodBase.ctorParameters = function () { return [
5018
+ { type: undefined }
5019
+ ]; };
5005
5020
  AsyncMethodBase.propDecorators = {
5006
5021
  disabled: [{ type: core.Input }],
5007
5022
  context: [{ type: core.Input }],
@@ -5535,6 +5550,41 @@
5535
5550
  updateSticky: [{ type: core.HostListener, args: ["window:resize",] }, { type: core.HostListener, args: ["window:scroll",] }]
5536
5551
  };
5537
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
+
5538
5588
  var UnorderedListItemDirective = /** @class */ (function () {
5539
5589
  function UnorderedListItemDirective(elementRef, renderer, viewContainer) {
5540
5590
  this.elementRef = elementRef;
@@ -5928,41 +5978,6 @@
5928
5978
  boundaryLinks: [{ type: core.Input }]
5929
5979
  };
5930
5980
 
5931
- var StickyClassDirective = /** @class */ (function () {
5932
- function StickyClassDirective(events, element, renderer) {
5933
- this.events = events;
5934
- this.element = element;
5935
- this.renderer = renderer;
5936
- }
5937
- StickyClassDirective.prototype.ngOnInit = function () {
5938
- var _this = this;
5939
- this.stickyUpdated = this.events.stickyUpdated.subscribe(function () {
5940
- if (_this.events.isSticky) {
5941
- _this.renderer.addClass(_this.element.nativeElement, _this.stickyClass || "sticky-sibling");
5942
- return;
5943
- }
5944
- _this.renderer.removeClass(_this.element.nativeElement, _this.stickyClass || "sticky-sibling");
5945
- });
5946
- };
5947
- StickyClassDirective.prototype.ngOnDestroy = function () {
5948
- this.stickyUpdated.unsubscribe();
5949
- };
5950
- return StickyClassDirective;
5951
- }());
5952
- StickyClassDirective.decorators = [
5953
- { type: core.Directive, args: [{
5954
- selector: "[stickyClass]"
5955
- },] }
5956
- ];
5957
- StickyClassDirective.ctorParameters = function () { return [
5958
- { type: EventsService },
5959
- { type: core.ElementRef },
5960
- { type: core.Renderer2 }
5961
- ]; };
5962
- StickyClassDirective.propDecorators = {
5963
- stickyClass: [{ type: core.Input }]
5964
- };
5965
-
5966
5981
  // --- Pipes ---
5967
5982
  var pipes = [
5968
5983
  ChunkPipe,
@@ -6225,6 +6240,7 @@
6225
6240
  exports.StateService = StateService;
6226
6241
  exports.StaticAuthService = StaticAuthService;
6227
6242
  exports.StaticLanguageService = StaticLanguageService;
6243
+ exports.StickyClassDirective = StickyClassDirective;
6228
6244
  exports.StickyDirective = StickyDirective;
6229
6245
  exports.StorageService = StorageService;
6230
6246
  exports.StringUtils = StringUtils;
@@ -6246,7 +6262,6 @@
6246
6262
  exports["ɵc"] = components;
6247
6263
  exports["ɵd"] = providers;
6248
6264
  exports["ɵe"] = loadConfig;
6249
- exports["ɵf"] = StickyClassDirective;
6250
6265
 
6251
6266
  Object.defineProperty(exports, '__esModule', { value: true });
6252
6267