zek 14.2.55 → 14.2.58
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/esm2020/lib/components/base.component.mjs +7 -5
- package/esm2020/lib/utils/date-helper.mjs +19 -3
- package/esm2020/lib/utils/html-helper.mjs +1 -1
- package/esm2020/lib/utils/index.mjs +2 -1
- package/esm2020/lib/utils/url-helper.mjs +26 -0
- package/fesm2015/zek.mjs +51 -7
- package/fesm2015/zek.mjs.map +1 -1
- package/fesm2020/zek.mjs +51 -7
- package/fesm2020/zek.mjs.map +1 -1
- package/lib/components/base.component.d.ts +2 -2
- package/lib/utils/date-helper.d.ts +2 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/url-helper.d.ts +5 -0
- package/package.json +1 -1
package/fesm2020/zek.mjs
CHANGED
|
@@ -574,10 +574,18 @@ class DateHelper {
|
|
|
574
574
|
return date;
|
|
575
575
|
}
|
|
576
576
|
;
|
|
577
|
+
static addHours(v, hours) {
|
|
578
|
+
if (!hours)
|
|
579
|
+
return v;
|
|
580
|
+
let date = new Date(v);
|
|
581
|
+
//todo need to check if this line needs --> date = new Date(date.getTime());
|
|
582
|
+
date.setHours(date.getHours() + hours);
|
|
583
|
+
return date;
|
|
584
|
+
}
|
|
577
585
|
static addMinutes(v, minutes) {
|
|
578
586
|
if (!minutes)
|
|
579
587
|
return v;
|
|
580
|
-
let date = v;
|
|
588
|
+
let date = new Date(v);
|
|
581
589
|
//todo need to check if this line needs --> date = new Date(date.getTime());
|
|
582
590
|
date.setMinutes(date.getMinutes() + minutes);
|
|
583
591
|
return date;
|
|
@@ -628,13 +636,21 @@ class DateHelper {
|
|
|
628
636
|
return Math.floor(timeDiff / 86400000); //86400000 = (1000 * 60 * 60 * 24) = 1000 millisecond * 60second * 60minute * 24hour
|
|
629
637
|
}
|
|
630
638
|
;
|
|
639
|
+
static subtractHours(value, date) {
|
|
640
|
+
if (!date)
|
|
641
|
+
return null;
|
|
642
|
+
date = this.toDate(date);
|
|
643
|
+
let timeDiff = date.getTime() - value.getTime();
|
|
644
|
+
return Math.floor((timeDiff % 86400000) / 3600000);
|
|
645
|
+
}
|
|
646
|
+
;
|
|
631
647
|
static subtractMinutes(value, date) {
|
|
632
648
|
if (!date)
|
|
633
649
|
return null;
|
|
634
650
|
date = this.toDate(date);
|
|
635
651
|
let timeDiff = date.getTime() - value.getTime();
|
|
652
|
+
//
|
|
636
653
|
return Math.floor(((timeDiff % 86400000) % 3600000) / 60000);
|
|
637
|
-
;
|
|
638
654
|
}
|
|
639
655
|
;
|
|
640
656
|
// 1 2 3 4 5 6 7 8 9 10 11
|
|
@@ -1065,6 +1081,32 @@ var firstBy = (function () {
|
|
|
1065
1081
|
return tb;
|
|
1066
1082
|
})();
|
|
1067
1083
|
|
|
1084
|
+
class UrlHelper {
|
|
1085
|
+
static getController(url) {
|
|
1086
|
+
return url.substring(0, url.lastIndexOf('/') + 1);
|
|
1087
|
+
}
|
|
1088
|
+
static getAction(url) {
|
|
1089
|
+
let action = url.substring(url.lastIndexOf('/') + 1);
|
|
1090
|
+
let i = action.indexOf(';');
|
|
1091
|
+
return i === -1 ? action : action.substring(0, i);
|
|
1092
|
+
}
|
|
1093
|
+
static getNoParam(url) {
|
|
1094
|
+
let i1 = url.indexOf('?');
|
|
1095
|
+
let i2 = url.indexOf(';');
|
|
1096
|
+
if (i1 !== -1) {
|
|
1097
|
+
if (i2 !== -1) {
|
|
1098
|
+
let min = i1 < i2 ? i1 : i2;
|
|
1099
|
+
return url.substring(0, min);
|
|
1100
|
+
}
|
|
1101
|
+
return url.substring(0, i1);
|
|
1102
|
+
}
|
|
1103
|
+
if (i2 !== -1) {
|
|
1104
|
+
return url.substring(0, i2);
|
|
1105
|
+
}
|
|
1106
|
+
return url;
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1068
1110
|
class AuthService {
|
|
1069
1111
|
constructor() {
|
|
1070
1112
|
this.subject = new BehaviorSubject(false); //todo check if need BehaviorSubject
|
|
@@ -1788,7 +1830,7 @@ class BaseComponent extends CoreComponent {
|
|
|
1788
1830
|
this.route = route;
|
|
1789
1831
|
this.router = router;
|
|
1790
1832
|
this._readOnly = false;
|
|
1791
|
-
this.
|
|
1833
|
+
this._url = null;
|
|
1792
1834
|
}
|
|
1793
1835
|
get readOnly() {
|
|
1794
1836
|
return this._readOnly;
|
|
@@ -1796,12 +1838,14 @@ class BaseComponent extends CoreComponent {
|
|
|
1796
1838
|
set readOnly(v) {
|
|
1797
1839
|
this._readOnly = Convert.toBoolean(v);
|
|
1798
1840
|
}
|
|
1841
|
+
get url() {
|
|
1842
|
+
if (!this._url)
|
|
1843
|
+
this._url = this.router.url.split(';')[0];
|
|
1844
|
+
return this._url;
|
|
1845
|
+
}
|
|
1799
1846
|
getParam(name) {
|
|
1800
1847
|
return this.route.snapshot.paramMap.get(name);
|
|
1801
1848
|
}
|
|
1802
|
-
getAction() {
|
|
1803
|
-
return this.url.substr(this.url.lastIndexOf('/') + 1);
|
|
1804
|
-
}
|
|
1805
1849
|
navigateReturnUrl() {
|
|
1806
1850
|
const returnUrl = this.route.snapshot.paramMap.get('returnUrl');
|
|
1807
1851
|
if (returnUrl) {
|
|
@@ -6479,5 +6523,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
6479
6523
|
* Generated bundle index. Do not edit.
|
|
6480
6524
|
*/
|
|
6481
6525
|
|
|
6482
|
-
export { API_BASE_URL, AgeModule, AgePipe, Alert, AlertComponent, AlertModule, AlertService, AlertType, AppBaseModule, ApproveModalComponent, ArrayHelper, AuthGuardService, AuthService, AutoCompleteDirective, AutoCompleteModule, Base64Helper, BaseAlert, BaseComponent, BaseService, BitwiseHelper, BootstrapHelper, ButtonBrowseComponent, ButtonBrowseModalBaseComponent, ButtonBrowseModalToolbarComponent, ButtonBrowseModule, CallbackModule, CallbackPipe, CardComponent, CardModule, Color, ComponentType, Convert, CoreComponent, CoreUiComponent, CrudService, CssHelper, CustomHttpParamEncoder, DATE_FORMAT, DateAgoModule, DateAgoPipe, DateHelper, DateValueAccessor, DatepickerModule, DeleteModalComponent, DisapproveModalComponent, EditBase, EditBaseComponent, EditComponent, EditFormComponent, EditToolbarComponent, EditToolbarModule, FieldValidatorComponent, FileBase, FileBytes, FileHelper, FileModule, FileSizePipe, FileString, FileViewerComponent, FileViewerModule, FilterBase, FilterHelper, FilterModalComponent, Gender, GridToolbarBarComponent, GridToolbarComponent, GridToolbarModule, HtmlHelper, HttpErrorHandler, KeyPair, KeyPairChecked, KeyPairEx, KeyPairRequired, LANGUAGE, ListBase, ListBaseComponent, ListToolbarComponent, ListToolbarModule, LoadingComponent, LoadingModule, MathHelper, ModalComponent, ModalModule, Month, ObjectHelper, OverlapHelper, PageTitleComponent, PageTitleModule, PagedList, PagedListBase, Pager, PagerBase, PagerComponent, PagerHelper, PagerModule, PasswordComponent, PasswordModule, PeriodRelation, PrintType, ProgressModule, RECAPTCHA_SITE_KEY, RadioComponent, RadioModule, RandomHelper, RangeValidator, ReCaptchaService, ReadOnlyDirective, ReadOnlyModule, RecaptchaModule, RestoreModalComponent, SafeModule, SafePipe, Select2Component, Select2Module, Select2MultipleComponent, Select2MultipleModule, SortButtonGroupComponent, SortDirective, SortModule, StorageHelper, StringHelper, SubmitModalComponent, SumComponent, TimeHelper, TimeModule, TimePipe, TimerService, Toast, ToastComponent, Tree, ValidEventArgs, ValidationComponent, ValidatorModule, Validators, ValidatorsModule, WebApiClient, WebApiModule, WizardComponent, WizardComponent2, WizardModule, ZekProgress, ZekSelectModule, ZekSelectMultiple, firstBy, handler, nullValidator, rangeValidator };
|
|
6526
|
+
export { API_BASE_URL, AgeModule, AgePipe, Alert, AlertComponent, AlertModule, AlertService, AlertType, AppBaseModule, ApproveModalComponent, ArrayHelper, AuthGuardService, AuthService, AutoCompleteDirective, AutoCompleteModule, Base64Helper, BaseAlert, BaseComponent, BaseService, BitwiseHelper, BootstrapHelper, ButtonBrowseComponent, ButtonBrowseModalBaseComponent, ButtonBrowseModalToolbarComponent, ButtonBrowseModule, CallbackModule, CallbackPipe, CardComponent, CardModule, Color, ComponentType, Convert, CoreComponent, CoreUiComponent, CrudService, CssHelper, CustomHttpParamEncoder, DATE_FORMAT, DateAgoModule, DateAgoPipe, DateHelper, DateValueAccessor, DatepickerModule, DeleteModalComponent, DisapproveModalComponent, EditBase, EditBaseComponent, EditComponent, EditFormComponent, EditToolbarComponent, EditToolbarModule, FieldValidatorComponent, FileBase, FileBytes, FileHelper, FileModule, FileSizePipe, FileString, FileViewerComponent, FileViewerModule, FilterBase, FilterHelper, FilterModalComponent, Gender, GridToolbarBarComponent, GridToolbarComponent, GridToolbarModule, HtmlHelper, HttpErrorHandler, KeyPair, KeyPairChecked, KeyPairEx, KeyPairRequired, LANGUAGE, ListBase, ListBaseComponent, ListToolbarComponent, ListToolbarModule, LoadingComponent, LoadingModule, MathHelper, ModalComponent, ModalModule, Month, ObjectHelper, OverlapHelper, PageTitleComponent, PageTitleModule, PagedList, PagedListBase, Pager, PagerBase, PagerComponent, PagerHelper, PagerModule, PasswordComponent, PasswordModule, PeriodRelation, PrintType, ProgressModule, RECAPTCHA_SITE_KEY, RadioComponent, RadioModule, RandomHelper, RangeValidator, ReCaptchaService, ReadOnlyDirective, ReadOnlyModule, RecaptchaModule, RestoreModalComponent, SafeModule, SafePipe, Select2Component, Select2Module, Select2MultipleComponent, Select2MultipleModule, SortButtonGroupComponent, SortDirective, SortModule, StorageHelper, StringHelper, SubmitModalComponent, SumComponent, TimeHelper, TimeModule, TimePipe, TimerService, Toast, ToastComponent, Tree, UrlHelper, ValidEventArgs, ValidationComponent, ValidatorModule, Validators, ValidatorsModule, WebApiClient, WebApiModule, WizardComponent, WizardComponent2, WizardModule, ZekProgress, ZekSelectModule, ZekSelectMultiple, firstBy, handler, nullValidator, rangeValidator };
|
|
6483
6527
|
//# sourceMappingURL=zek.mjs.map
|