@stemy/ngx-utils 12.2.6 → 12.2.8
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/bundles/stemy-ngx-utils.umd.js +61 -46
- package/bundles/stemy-ngx-utils.umd.js.map +1 -1
- package/esm2015/ngx-utils/directives/async-method.base.js +14 -2
- package/esm2015/ngx-utils/directives/async-method.directive.js +2 -9
- package/esm2015/ngx-utils/ngx-utils.module.js +3 -1
- package/esm2015/ngx-utils/utils/date.utils.js +8 -7
- package/esm2015/public_api.js +2 -1
- package/esm2015/stemy-ngx-utils.js +1 -2
- package/esm2020/ngx-utils/components/unordered-list/unordered-list.component.mjs +3 -3
- package/esm2020/ngx-utils/ngx-utils.imports.mjs +7 -1
- package/esm2020/ngx-utils/ngx-utils.module.mjs +31 -28
- package/esm2020/ngx-utils/pipes/pop.pipe.mjs +16 -0
- package/esm2020/ngx-utils/pipes/shift.pipe.mjs +16 -0
- package/esm2020/ngx-utils/pipes/split.pipe.mjs +16 -0
- package/esm2020/ngx-utils/plugins/resize-event.plugin.mjs +4 -4
- package/esm2020/ngx-utils/services/config.service.mjs +6 -5
- package/esm2020/ngx-utils/services/formatter.service.mjs +3 -2
- package/esm2020/ngx-utils/utils/array.utils.mjs +8 -1
- package/esm2020/ngx-utils/utils/date.utils.mjs +5 -5
- package/esm2020/ngx-utils/utils/file-system.mjs +6 -1
- package/esm2020/ngx-utils/utils/math.utils.mjs +31 -2
- package/esm2020/ngx-utils/utils/object.utils.mjs +36 -25
- package/esm2020/public_api.mjs +4 -1
- package/fesm2015/stemy-ngx-utils.js +54 -47
- package/fesm2015/stemy-ngx-utils.js.map +1 -1
- package/fesm2015/stemy-ngx-utils.mjs +142 -42
- package/fesm2015/stemy-ngx-utils.mjs.map +1 -1
- package/fesm2020/stemy-ngx-utils.mjs +141 -42
- package/fesm2020/stemy-ngx-utils.mjs.map +1 -1
- package/ngx-utils/directives/async-method.base.d.ts +4 -4
- package/ngx-utils/directives/async-method.directive.d.ts +1 -2
- package/ngx-utils/ngx-utils.module.d.ts +2 -2
- package/ngx-utils/utils/date.utils.d.ts +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +1 -0
- package/stemy-ngx-utils.d.ts +0 -1
- 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
|
|
867
|
+
return moment__default["default"](date).isoWeekday() > 5;
|
|
864
868
|
};
|
|
865
869
|
DateUtils.isBusinessDay = function (date) {
|
|
866
|
-
return
|
|
870
|
+
return moment__default["default"](date).isoWeekday() < 6;
|
|
867
871
|
};
|
|
868
872
|
DateUtils.add = function (date, amount, unit) {
|
|
869
|
-
return
|
|
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,14 @@
|
|
|
5002
5011
|
};
|
|
5003
5012
|
return AsyncMethodBase;
|
|
5004
5013
|
}());
|
|
5014
|
+
AsyncMethodBase.decorators = [
|
|
5015
|
+
{ type: core.Directive, args: [{
|
|
5016
|
+
selector: "[_abstract_asyncMethodBase]"
|
|
5017
|
+
},] }
|
|
5018
|
+
];
|
|
5019
|
+
AsyncMethodBase.ctorParameters = function () { return [
|
|
5020
|
+
{ type: undefined, decorators: [{ type: core.Inject, args: [TOASTER_SERVICE,] }] }
|
|
5021
|
+
]; };
|
|
5005
5022
|
AsyncMethodBase.propDecorators = {
|
|
5006
5023
|
disabled: [{ type: core.Input }],
|
|
5007
5024
|
context: [{ type: core.Input }],
|
|
@@ -5014,8 +5031,8 @@
|
|
|
5014
5031
|
|
|
5015
5032
|
var AsyncMethodDirective = /** @class */ (function (_super) {
|
|
5016
5033
|
__extends(AsyncMethodDirective, _super);
|
|
5017
|
-
function AsyncMethodDirective(
|
|
5018
|
-
return _super.
|
|
5034
|
+
function AsyncMethodDirective() {
|
|
5035
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
5019
5036
|
}
|
|
5020
5037
|
AsyncMethodDirective.prototype.getMethod = function () {
|
|
5021
5038
|
return this.method;
|
|
@@ -5028,9 +5045,6 @@
|
|
|
5028
5045
|
exportAs: "async-method"
|
|
5029
5046
|
},] }
|
|
5030
5047
|
];
|
|
5031
|
-
AsyncMethodDirective.ctorParameters = function () { return [
|
|
5032
|
-
{ type: undefined, decorators: [{ type: core.Inject, args: [TOASTER_SERVICE,] }] }
|
|
5033
|
-
]; };
|
|
5034
5048
|
AsyncMethodDirective.propDecorators = {
|
|
5035
5049
|
method: [{ type: core.Input, args: ["async-method",] }]
|
|
5036
5050
|
};
|
|
@@ -5535,6 +5549,41 @@
|
|
|
5535
5549
|
updateSticky: [{ type: core.HostListener, args: ["window:resize",] }, { type: core.HostListener, args: ["window:scroll",] }]
|
|
5536
5550
|
};
|
|
5537
5551
|
|
|
5552
|
+
var StickyClassDirective = /** @class */ (function () {
|
|
5553
|
+
function StickyClassDirective(events, element, renderer) {
|
|
5554
|
+
this.events = events;
|
|
5555
|
+
this.element = element;
|
|
5556
|
+
this.renderer = renderer;
|
|
5557
|
+
}
|
|
5558
|
+
StickyClassDirective.prototype.ngOnInit = function () {
|
|
5559
|
+
var _this = this;
|
|
5560
|
+
this.stickyUpdated = this.events.stickyUpdated.subscribe(function () {
|
|
5561
|
+
if (_this.events.isSticky) {
|
|
5562
|
+
_this.renderer.addClass(_this.element.nativeElement, _this.stickyClass || "sticky-sibling");
|
|
5563
|
+
return;
|
|
5564
|
+
}
|
|
5565
|
+
_this.renderer.removeClass(_this.element.nativeElement, _this.stickyClass || "sticky-sibling");
|
|
5566
|
+
});
|
|
5567
|
+
};
|
|
5568
|
+
StickyClassDirective.prototype.ngOnDestroy = function () {
|
|
5569
|
+
this.stickyUpdated.unsubscribe();
|
|
5570
|
+
};
|
|
5571
|
+
return StickyClassDirective;
|
|
5572
|
+
}());
|
|
5573
|
+
StickyClassDirective.decorators = [
|
|
5574
|
+
{ type: core.Directive, args: [{
|
|
5575
|
+
selector: "[stickyClass]"
|
|
5576
|
+
},] }
|
|
5577
|
+
];
|
|
5578
|
+
StickyClassDirective.ctorParameters = function () { return [
|
|
5579
|
+
{ type: EventsService },
|
|
5580
|
+
{ type: core.ElementRef },
|
|
5581
|
+
{ type: core.Renderer2 }
|
|
5582
|
+
]; };
|
|
5583
|
+
StickyClassDirective.propDecorators = {
|
|
5584
|
+
stickyClass: [{ type: core.Input }]
|
|
5585
|
+
};
|
|
5586
|
+
|
|
5538
5587
|
var UnorderedListItemDirective = /** @class */ (function () {
|
|
5539
5588
|
function UnorderedListItemDirective(elementRef, renderer, viewContainer) {
|
|
5540
5589
|
this.elementRef = elementRef;
|
|
@@ -5928,41 +5977,6 @@
|
|
|
5928
5977
|
boundaryLinks: [{ type: core.Input }]
|
|
5929
5978
|
};
|
|
5930
5979
|
|
|
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
5980
|
// --- Pipes ---
|
|
5967
5981
|
var pipes = [
|
|
5968
5982
|
ChunkPipe,
|
|
@@ -5995,6 +6009,7 @@
|
|
|
5995
6009
|
];
|
|
5996
6010
|
// --- Directives ---
|
|
5997
6011
|
var directives = [
|
|
6012
|
+
AsyncMethodBase,
|
|
5998
6013
|
AsyncMethodDirective,
|
|
5999
6014
|
BackgroundDirective,
|
|
6000
6015
|
DynamicTableTemplateDirective,
|
|
@@ -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
|
|