@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.
@@ -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
- resolve(null);
689
- }, () => {
690
- resolve(null);
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((data) => {
1441
- this.dataReceived(data);
1442
- }, (e) => {
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((res) => {
1503
- let nowDate = new Date();
1504
- let exiredDate = new Date(this.startDate.getTime() + this.timeOutMilliSeconds);
1505
- if (nowDate.getTime() >= exiredDate.getTime()) {
1506
- //console.log("nowDate: " + nowDate);
1507
- //console.log("exiredDate: " + exiredDate);
1508
- this.expired$.next(true);
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((res) => {
1520
- this.resetTimer();
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(event => {
1634
- if (event instanceof NavigationEnd) {
1635
- if (window.ga) {
1636
- window.ga('set', 'page', event.urlAfterRedirects);
1637
- window.ga('send', 'pageview');
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 = $$1(document);
1717
- return $$1(parent).find(selector).get();
1726
+ let parent = $(document);
1727
+ return $(parent).find(selector).get();
1718
1728
  }
1719
1729
  static find(elem, selector) {
1720
- return $$1(elem).find(selector).get();
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
- $$1(elem).show();
1757
+ $(elem).show();
1748
1758
  }
1749
1759
  static hide(elem) {
1750
- $$1(elem).hide();
1760
+ $(elem).hide();
1751
1761
  }
1752
1762
  static each(selector, action) {
1753
- let parent = $$1(document);
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
- $$1(elem).addClass(classNames);
1807
+ $(elem).addClass(classNames);
1798
1808
  }
1799
1809
  static removeClass(elem, classNames) {
1800
- $$1(elem).removeClass(classNames);
1810
+ $(elem).removeClass(classNames);
1801
1811
  }
1802
1812
  static hasClass(elem, className) {
1803
- $$1(elem).hasClass(className);
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(data => {
1973
- super.next(data);
1974
- if (success)
1975
- success();
1976
- }, e => {
1977
- if (error)
1978
- error(e);
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
- this.read();
2027
- }, () => {
2028
- this.read();
2029
- if (sucess)
2030
- sucess();
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
- this.read();
2038
- if (sucess)
2039
- sucess();
2040
- }, () => {
2041
- this.read();
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(data => {
2136
- if (success)
2137
- success(data);
2138
- }, e => {
2139
- if (error)
2140
- error(e);
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(data => done(data));
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(data => done(data));
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(data => done(data));
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((state) => {
3131
- this.show = state;
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.router.events.subscribe(event => {
3181
- if (event instanceof NavigationStart) {
3182
- this.isSpinnerVisible = true;
3183
- }
3184
- else if (event instanceof NavigationEnd || event instanceof NavigationCancel || event instanceof NavigationError) {
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(value => {
3820
- if (this.firstValue) {
3821
- this.firstValue = false;
3822
- return;
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(value => {
3827
- this.hrefGo = value;
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