@osovitny/anatoly 2.14.39 → 2.14.41
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/core/dom.mjs +1 -2
- package/esm2020/lib/core/localization/localizationSettings.module.mjs +10 -6
- package/esm2020/lib/core/services/appcontext.service.mjs +5 -4
- package/esm2020/lib/core/services/google-analytics.service.mjs +8 -6
- package/esm2020/lib/core/services/idle.service.mjs +14 -10
- package/esm2020/lib/core/subs.mjs +1 -1
- package/esm2020/lib/data/base/grid/base-grid-edit.service.mjs +21 -14
- package/esm2020/lib/data/base/grid/base-grid-read.service.mjs +11 -8
- package/esm2020/lib/data/services/core-api.service.mjs +19 -4
- package/esm2020/lib/data/services/emails-api.service.mjs +10 -7
- package/esm2020/lib/ui/components/spinners/loading/loading.component.mjs +5 -3
- package/esm2020/lib/ui/components/spinners/pagespinner/pagespinner.component.mjs +13 -10
- package/esm2020/lib/ui/forms/components/urlslug/urlslug.component.mjs +12 -8
- package/fesm2015/osovitny-anatoly.mjs +126 -79
- package/fesm2015/osovitny-anatoly.mjs.map +1 -1
- package/fesm2020/osovitny-anatoly.mjs +126 -79
- package/fesm2020/osovitny-anatoly.mjs.map +1 -1
- package/lib/ui/components/spinners/pagespinner/pagespinner.component.d.ts +2 -2
- package/package.json +1 -1
|
@@ -18,7 +18,6 @@ import Swal from 'sweetalert2';
|
|
|
18
18
|
import { v4 } from 'uuid';
|
|
19
19
|
import * as i1$2 from 'ngx-toastr';
|
|
20
20
|
import * as i1$4 from '@angular/platform-browser';
|
|
21
|
-
import * as $$1 from 'jquery';
|
|
22
21
|
import * as i1$6 from '@angular/forms';
|
|
23
22
|
import { FormControl, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
24
23
|
import * as i1$7 from 'angular-froala-wysiwyg';
|
|
@@ -683,11 +682,15 @@ function localizationInitializerFactory(translate, localizationService, injector
|
|
|
683
682
|
let locationInitialized = injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
|
|
684
683
|
locationInitialized.then(() => {
|
|
685
684
|
let languageToSet = localizationService.configureTranslationSettings(translate);
|
|
686
|
-
translate.use(languageToSet).subscribe(
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
685
|
+
translate.use(languageToSet).subscribe({
|
|
686
|
+
next: (data) => {
|
|
687
|
+
},
|
|
688
|
+
error: (e) => {
|
|
689
|
+
resolve(null);
|
|
690
|
+
},
|
|
691
|
+
complete: () => {
|
|
692
|
+
resolve(null);
|
|
693
|
+
}
|
|
691
694
|
});
|
|
692
695
|
});
|
|
693
696
|
});
|
|
@@ -1437,9 +1440,10 @@ class AppContextService extends BaseApiService {
|
|
|
1437
1440
|
}
|
|
1438
1441
|
let now = new Date();
|
|
1439
1442
|
console.log('Requesting a new AppContext at ' + now);
|
|
1440
|
-
this.subscription = this.get('getCurrentContext', null).subscribe(
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
+
this.subscription = this.get('getCurrentContext', null).subscribe({
|
|
1444
|
+
next: (data) => {
|
|
1445
|
+
this.dataReceived(data);
|
|
1446
|
+
}
|
|
1443
1447
|
});
|
|
1444
1448
|
}
|
|
1445
1449
|
updateCurrent(success = null) {
|
|
@@ -1499,13 +1503,15 @@ class IdleService {
|
|
|
1499
1503
|
this.startDate = new Date();
|
|
1500
1504
|
}
|
|
1501
1505
|
startTimer() {
|
|
1502
|
-
this.timer$ = timer(this.timeOutMilliSeconds, 1 * 1000).subscribe(
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1506
|
+
this.timer$ = timer(this.timeOutMilliSeconds, 1 * 1000).subscribe({
|
|
1507
|
+
next: (data) => {
|
|
1508
|
+
let nowDate = new Date();
|
|
1509
|
+
let exiredDate = new Date(this.startDate.getTime() + this.timeOutMilliSeconds);
|
|
1510
|
+
if (nowDate.getTime() >= exiredDate.getTime()) {
|
|
1511
|
+
//console.log("nowDate: " + nowDate);
|
|
1512
|
+
//console.log("exiredDate: " + exiredDate);
|
|
1513
|
+
this.expired$.next(true);
|
|
1514
|
+
}
|
|
1509
1515
|
}
|
|
1510
1516
|
});
|
|
1511
1517
|
}
|
|
@@ -1516,8 +1522,10 @@ class IdleService {
|
|
|
1516
1522
|
startWatching(timeOutSeconds) {
|
|
1517
1523
|
this.idle$ = merge(fromEvent(document, 'mousemove'), fromEvent(document, 'click'), fromEvent(document, 'mousedown'), fromEvent(document, 'keypress'), fromEvent(document, 'DOMMouseScroll'), fromEvent(document, 'mousewheel'), fromEvent(document, 'touchmove'), fromEvent(document, 'MSPointerMove'), fromEvent(window, 'mousemove'), fromEvent(window, 'resize'));
|
|
1518
1524
|
this.resetTimeCounters(timeOutSeconds);
|
|
1519
|
-
this.idleSubscription = this.idle$.subscribe(
|
|
1520
|
-
|
|
1525
|
+
this.idleSubscription = this.idle$.subscribe({
|
|
1526
|
+
next: (data) => {
|
|
1527
|
+
this.resetTimer();
|
|
1528
|
+
}
|
|
1521
1529
|
});
|
|
1522
1530
|
this.startTimer();
|
|
1523
1531
|
return this.expired$;
|
|
@@ -1630,11 +1638,13 @@ class GoogleAnalyticsService {
|
|
|
1630
1638
|
*/
|
|
1631
1639
|
}
|
|
1632
1640
|
subscribe() {
|
|
1633
|
-
this.subscription = this.router.events.subscribe(
|
|
1634
|
-
|
|
1635
|
-
if (
|
|
1636
|
-
window.ga
|
|
1637
|
-
|
|
1641
|
+
this.subscription = this.router.events.subscribe({
|
|
1642
|
+
next: (event) => {
|
|
1643
|
+
if (event instanceof NavigationEnd) {
|
|
1644
|
+
if (window.ga) {
|
|
1645
|
+
window.ga('set', 'page', event.urlAfterRedirects);
|
|
1646
|
+
window.ga('send', 'pageview');
|
|
1647
|
+
}
|
|
1638
1648
|
}
|
|
1639
1649
|
}
|
|
1640
1650
|
});
|
|
@@ -1713,11 +1723,11 @@ class DOM {
|
|
|
1713
1723
|
return this.dir(elem, "parentNode", null, selector);
|
|
1714
1724
|
}
|
|
1715
1725
|
static findInDocument(selector) {
|
|
1716
|
-
let parent =
|
|
1717
|
-
return
|
|
1726
|
+
let parent = $(document);
|
|
1727
|
+
return $(parent).find(selector).get();
|
|
1718
1728
|
}
|
|
1719
1729
|
static find(elem, selector) {
|
|
1720
|
-
return
|
|
1730
|
+
return $(elem).find(selector).get();
|
|
1721
1731
|
}
|
|
1722
1732
|
static remove(nodes) {
|
|
1723
1733
|
if (nodes == null) {
|
|
@@ -1744,13 +1754,13 @@ class DOM {
|
|
|
1744
1754
|
this.remove(this.find(element, selector));
|
|
1745
1755
|
}
|
|
1746
1756
|
static show(elem) {
|
|
1747
|
-
|
|
1757
|
+
$(elem).show();
|
|
1748
1758
|
}
|
|
1749
1759
|
static hide(elem) {
|
|
1750
|
-
|
|
1760
|
+
$(elem).hide();
|
|
1751
1761
|
}
|
|
1752
1762
|
static each(selector, action) {
|
|
1753
|
-
let parent =
|
|
1763
|
+
let parent = $(document);
|
|
1754
1764
|
let elems = DOM.find(parent, selector);
|
|
1755
1765
|
for (let i = 0; i < elems.length; i++) {
|
|
1756
1766
|
let elem = elems[i];
|
|
@@ -1794,13 +1804,13 @@ class DOM {
|
|
|
1794
1804
|
}
|
|
1795
1805
|
*/
|
|
1796
1806
|
static addClass(elem, classNames) {
|
|
1797
|
-
|
|
1807
|
+
$(elem).addClass(classNames);
|
|
1798
1808
|
}
|
|
1799
1809
|
static removeClass(elem, classNames) {
|
|
1800
|
-
|
|
1810
|
+
$(elem).removeClass(classNames);
|
|
1801
1811
|
}
|
|
1802
1812
|
static hasClass(elem, className) {
|
|
1803
|
-
|
|
1813
|
+
$(elem).hasClass(className);
|
|
1804
1814
|
}
|
|
1805
1815
|
}
|
|
1806
1816
|
|
|
@@ -1969,13 +1979,16 @@ class BaseGridReadService extends BehaviorSubject {
|
|
|
1969
1979
|
url = this.baseReadUrl + `${this.serializeParams(params)}`;
|
|
1970
1980
|
this.savedReadParams = params;
|
|
1971
1981
|
}
|
|
1972
|
-
this.http.get(url).pipe(map(res => res)).subscribe(
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
success
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1982
|
+
this.http.get(url).pipe(map(res => res)).subscribe({
|
|
1983
|
+
next: (data) => {
|
|
1984
|
+
super.next(data);
|
|
1985
|
+
if (success)
|
|
1986
|
+
success();
|
|
1987
|
+
},
|
|
1988
|
+
error: (e) => {
|
|
1989
|
+
if (error)
|
|
1990
|
+
error(e);
|
|
1991
|
+
}
|
|
1979
1992
|
});
|
|
1980
1993
|
}
|
|
1981
1994
|
}
|
|
@@ -2021,24 +2034,31 @@ class BaseGridEditService extends BaseGridReadService {
|
|
|
2021
2034
|
save(data, isNew, sucess) {
|
|
2022
2035
|
const action = isNew ? 'add' : 'update';
|
|
2023
2036
|
this.reset();
|
|
2024
|
-
this.post(action, data).subscribe(
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2037
|
+
this.post(action, data).subscribe({
|
|
2038
|
+
next: (data) => {
|
|
2039
|
+
},
|
|
2040
|
+
error: (e) => {
|
|
2041
|
+
this.read();
|
|
2042
|
+
},
|
|
2043
|
+
complete: () => {
|
|
2044
|
+
this.read();
|
|
2045
|
+
if (sucess)
|
|
2046
|
+
sucess();
|
|
2047
|
+
}
|
|
2031
2048
|
});
|
|
2032
2049
|
}
|
|
2033
2050
|
delete(data, sucess) {
|
|
2034
2051
|
this.reset();
|
|
2035
2052
|
const url = `${this.baseUrl}/delete${this.serializeParams(data)}`;
|
|
2036
|
-
return this.http.delete(url).subscribe(
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
sucess
|
|
2040
|
-
|
|
2041
|
-
|
|
2053
|
+
return this.http.delete(url).subscribe({
|
|
2054
|
+
next: (data) => {
|
|
2055
|
+
this.read();
|
|
2056
|
+
if (sucess)
|
|
2057
|
+
sucess();
|
|
2058
|
+
},
|
|
2059
|
+
error: (e) => {
|
|
2060
|
+
this.read();
|
|
2061
|
+
}
|
|
2042
2062
|
});
|
|
2043
2063
|
}
|
|
2044
2064
|
post(action, data) {
|
|
@@ -2132,12 +2152,15 @@ class EmailsApiService extends BaseApiService {
|
|
|
2132
2152
|
this.baseUrl = Consts.emailsApiPath;
|
|
2133
2153
|
}
|
|
2134
2154
|
sendContactUs(captcha, name, email, topic, subject, message, success, error) {
|
|
2135
|
-
return this.post('sendContactUs', { captcha, name, email, topic, subject, message }).subscribe(
|
|
2136
|
-
|
|
2137
|
-
success
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2155
|
+
return this.post('sendContactUs', { captcha, name, email, topic, subject, message }).subscribe({
|
|
2156
|
+
next: (data) => {
|
|
2157
|
+
if (success)
|
|
2158
|
+
success(data);
|
|
2159
|
+
},
|
|
2160
|
+
error: (e) => {
|
|
2161
|
+
if (error)
|
|
2162
|
+
error(e);
|
|
2163
|
+
}
|
|
2141
2164
|
});
|
|
2142
2165
|
}
|
|
2143
2166
|
}
|
|
@@ -2169,13 +2192,28 @@ class CoreApiService extends BaseApiService {
|
|
|
2169
2192
|
this.baseUrl = Consts.coreApiPath;
|
|
2170
2193
|
}
|
|
2171
2194
|
getTimezonesJsonFile(done) {
|
|
2172
|
-
this.getExternalJsonFile('anatoly', 'timezones.json').subscribe(
|
|
2195
|
+
this.getExternalJsonFile('anatoly', 'timezones.json').subscribe({
|
|
2196
|
+
next: (data) => {
|
|
2197
|
+
if (done)
|
|
2198
|
+
done(data);
|
|
2199
|
+
}
|
|
2200
|
+
});
|
|
2173
2201
|
}
|
|
2174
2202
|
getUSStatesJsonFile(done) {
|
|
2175
|
-
this.getExternalJsonFile('anatoly', 'usStates.json').subscribe(
|
|
2203
|
+
this.getExternalJsonFile('anatoly', 'usStates.json').subscribe({
|
|
2204
|
+
next: (data) => {
|
|
2205
|
+
if (done)
|
|
2206
|
+
done(data);
|
|
2207
|
+
}
|
|
2208
|
+
});
|
|
2176
2209
|
}
|
|
2177
2210
|
getCountriesJsonFile(done) {
|
|
2178
|
-
this.getExternalJsonFile('anatoly', 'countries.json').subscribe(
|
|
2211
|
+
this.getExternalJsonFile('anatoly', 'countries.json').subscribe({
|
|
2212
|
+
next: (data) => {
|
|
2213
|
+
if (done)
|
|
2214
|
+
done(data);
|
|
2215
|
+
}
|
|
2216
|
+
});
|
|
2179
2217
|
}
|
|
2180
2218
|
}
|
|
2181
2219
|
CoreApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: CoreApiService, deps: [{ token: i1$3.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -3127,8 +3165,10 @@ class LoadingComponent {
|
|
|
3127
3165
|
this.show = false;
|
|
3128
3166
|
}
|
|
3129
3167
|
ngOnInit() {
|
|
3130
|
-
this.subs.sink = this.loadingService.subscribe(
|
|
3131
|
-
|
|
3168
|
+
this.subs.sink = this.loadingService.subscribe({
|
|
3169
|
+
next: (data) => {
|
|
3170
|
+
this.show = data;
|
|
3171
|
+
}
|
|
3132
3172
|
});
|
|
3133
3173
|
}
|
|
3134
3174
|
ngOnDestroy() {
|
|
@@ -3173,19 +3213,22 @@ class PageSpinnerComponent {
|
|
|
3173
3213
|
constructor(router, document) {
|
|
3174
3214
|
this.router = router;
|
|
3175
3215
|
this.document = document;
|
|
3176
|
-
this.backgroundColor = '#2196f3';
|
|
3177
|
-
this.spinner = Spinkit.skLine;
|
|
3178
3216
|
this.isSpinnerVisible = true;
|
|
3179
3217
|
this.Spinkit = Spinkit;
|
|
3180
|
-
this.
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3218
|
+
this.backgroundColor = '#2196f3';
|
|
3219
|
+
this.spinner = Spinkit.skLine;
|
|
3220
|
+
this.router.events.subscribe({
|
|
3221
|
+
next: (event) => {
|
|
3222
|
+
if (event instanceof NavigationStart) {
|
|
3223
|
+
this.isSpinnerVisible = true;
|
|
3224
|
+
}
|
|
3225
|
+
else if (event instanceof NavigationEnd || event instanceof NavigationCancel || event instanceof NavigationError) {
|
|
3226
|
+
this.isSpinnerVisible = false;
|
|
3227
|
+
}
|
|
3228
|
+
},
|
|
3229
|
+
error: (e) => {
|
|
3185
3230
|
this.isSpinnerVisible = false;
|
|
3186
3231
|
}
|
|
3187
|
-
}, () => {
|
|
3188
|
-
this.isSpinnerVisible = false;
|
|
3189
3232
|
});
|
|
3190
3233
|
}
|
|
3191
3234
|
ngOnDestroy() {
|
|
@@ -3816,15 +3859,19 @@ class UrlSlugComponent extends BaseEditComponent {
|
|
|
3816
3859
|
this.setFormValue(this.controlName, event.urlSlug);
|
|
3817
3860
|
}
|
|
3818
3861
|
startWatching() {
|
|
3819
|
-
this.subs.sink = this.formGroup.get(this.watchedControlName).valueChanges.subscribe(
|
|
3820
|
-
|
|
3821
|
-
this.firstValue
|
|
3822
|
-
|
|
3862
|
+
this.subs.sink = this.formGroup.get(this.watchedControlName).valueChanges.subscribe({
|
|
3863
|
+
next: (value) => {
|
|
3864
|
+
if (this.firstValue) {
|
|
3865
|
+
this.firstValue = false;
|
|
3866
|
+
return;
|
|
3867
|
+
}
|
|
3868
|
+
this.generateUrlSlug(value);
|
|
3823
3869
|
}
|
|
3824
|
-
this.generateUrlSlug(value);
|
|
3825
3870
|
});
|
|
3826
|
-
this.subs.sink = this.formGroup.get(this.controlName).valueChanges.subscribe(
|
|
3827
|
-
|
|
3871
|
+
this.subs.sink = this.formGroup.get(this.controlName).valueChanges.subscribe({
|
|
3872
|
+
next: (value) => {
|
|
3873
|
+
this.hrefGo = value;
|
|
3874
|
+
}
|
|
3828
3875
|
});
|
|
3829
3876
|
}
|
|
3830
3877
|
//Events
|