@osovitny/anatoly 2.15.6 → 2.15.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.
@@ -1,3 +1,4 @@
1
+ import js_beautify from 'js-beautify';
1
2
  import * as i0 from '@angular/core';
2
3
  import { Injectable, Pipe, APP_INITIALIZER, Injector, NgModule, Inject, Component, Input, EventEmitter, Output, ViewEncapsulation, Directive, ViewChild, HostBinding, HostListener, Optional, SkipSelf } from '@angular/core';
3
4
  import * as i1 from '@angular/router';
@@ -19,7 +20,6 @@ import { v4 } from 'uuid';
19
20
  import * as i1$2 from 'ngx-toastr';
20
21
  import { ToastrModule } from 'ngx-toastr';
21
22
  import * as i1$4 from '@angular/platform-browser';
22
- import js_beautify from 'js-beautify';
23
23
  import * as i1$6 from '@fortawesome/angular-fontawesome';
24
24
  import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
25
25
  import * as i1$7 from '@progress/kendo-angular-pager';
@@ -76,6 +76,143 @@ const Urls = {
76
76
  notificationsSocketUrl: '/hubs/notifications'
77
77
  };
78
78
 
79
+ /*
80
+ <file>
81
+ Project:
82
+ @osovitny/anatoly
83
+
84
+ Authors:
85
+ Vadim Osovitny vadim@osovitny.com
86
+ Anatoly Osovitny anatoly@osovitny.com
87
+
88
+ Created:
89
+ 29 June 2020
90
+
91
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
92
+ </file>
93
+ */
94
+ class Convert {
95
+ static pad(number) {
96
+ if (number < 10) {
97
+ return '0' + number;
98
+ }
99
+ return number;
100
+ }
101
+ static toLocalizedDateTime(value) {
102
+ if (value) {
103
+ return new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate(), value.getHours(), value.getMinutes(), value.getSeconds(), value.getMilliseconds()));
104
+ }
105
+ return null;
106
+ }
107
+ static enumToString(enumeration, value) {
108
+ for (let k in enumeration)
109
+ if (enumeration[k] == value)
110
+ return k;
111
+ return null;
112
+ }
113
+ static enumToArray(enumeration, notIncludes) {
114
+ const notIncludeFiler = (value) => {
115
+ if (isNaN(Number(value))) {
116
+ return false;
117
+ }
118
+ if (notIncludes) {
119
+ for (let i in notIncludes) {
120
+ if (notIncludes[i] == value)
121
+ return false;
122
+ }
123
+ }
124
+ return true;
125
+ };
126
+ return Object.keys(enumeration)
127
+ .filter(notIncludeFiler)
128
+ .map(key => ({
129
+ value: key,
130
+ text: enumeration[key]
131
+ }));
132
+ }
133
+ static stringToArray(str, separator = ',') {
134
+ if (str) {
135
+ return str.split(separator).filter(element => element);
136
+ }
137
+ return [];
138
+ }
139
+ static stringToIntArray(str, separator = ',') {
140
+ if (str) {
141
+ return str.split(separator).filter(element => element).map(value => parseInt(value));
142
+ }
143
+ return [];
144
+ }
145
+ static company2String(comp) {
146
+ let company = JSON.parse(comp);
147
+ if (company) {
148
+ return `${company.name} ${company.phone} ${company.email} ${company.websiteUrl}`;
149
+ }
150
+ }
151
+ static address2String(adr) {
152
+ let address = JSON.parse(adr);
153
+ return `${address.street} ${address.street2} ${address.city} ${address.stateOrRegion} ${address.zipcode} ${address.country}`;
154
+ }
155
+ static dateToString(date) {
156
+ return date.getFullYear() +
157
+ '-' + this.pad(date.getMonth() + 1) +
158
+ '-' + this.pad(date.getDate()) +
159
+ ' ' + this.pad(date.getHours()) +
160
+ ':' + this.pad(date.getMinutes()) +
161
+ ':' + this.pad(date.getSeconds());
162
+ }
163
+ static utcDateToLocalDate(d) {
164
+ let date = new Date(d);
165
+ return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds()));
166
+ }
167
+ static stringToBoolean(value) {
168
+ switch (value.toLowerCase().trim()) {
169
+ case "true":
170
+ case "yes":
171
+ case "1":
172
+ return true;
173
+ case "false":
174
+ case "no":
175
+ case "0":
176
+ case null:
177
+ return false;
178
+ default:
179
+ return Boolean(value);
180
+ }
181
+ }
182
+ }
183
+
184
+ /*
185
+ <file>
186
+ Project:
187
+ @osovitny/anatoly
188
+
189
+ Authors:
190
+ Vadim Osovitny vadim@osovitny.com
191
+ Anatoly Osovitny anatoly@osovitny.com
192
+
193
+ Created:
194
+ 10 Sep 2022
195
+
196
+ Code:
197
+ https://www.npmjs.com/package/js-beautify
198
+ https://beautifier.io
199
+
200
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
201
+ </file>
202
+ */
203
+ class XmlFormatter {
204
+ static toPrettyXML(s, options) {
205
+ if (!options) {
206
+ options = {
207
+ indent_size: 2,
208
+ indent_char: " ",
209
+ wrap_line_length: 110
210
+ };
211
+ }
212
+ return js_beautify.html(s, options);
213
+ }
214
+ }
215
+
79
216
  /*
80
217
  <file>
81
218
  Project:
@@ -333,111 +470,6 @@ AnatolyHttpInterceptor.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: A
333
470
  type: Injectable
334
471
  }], function () { return [{ type: LoadingService }, { type: LoggingService }]; }, null); })();
335
472
 
336
- /*
337
- <file>
338
- Project:
339
- @osovitny/anatoly
340
-
341
- Authors:
342
- Vadim Osovitny vadim@osovitny.com
343
- Anatoly Osovitny anatoly@osovitny.com
344
-
345
- Created:
346
- 29 June 2020
347
-
348
- Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
349
- </file>
350
- */
351
- class Convert {
352
- static pad(number) {
353
- if (number < 10) {
354
- return '0' + number;
355
- }
356
- return number;
357
- }
358
- static toLocalizedDateTime(value) {
359
- if (value) {
360
- return new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate(), value.getHours(), value.getMinutes(), value.getSeconds(), value.getMilliseconds()));
361
- }
362
- return null;
363
- }
364
- static enumToString(enumeration, value) {
365
- for (let k in enumeration)
366
- if (enumeration[k] == value)
367
- return k;
368
- return null;
369
- }
370
- static enumToArray(enumeration, notIncludes) {
371
- const notIncludeFiler = (value) => {
372
- if (isNaN(Number(value))) {
373
- return false;
374
- }
375
- if (notIncludes) {
376
- for (let i in notIncludes) {
377
- if (notIncludes[i] == value)
378
- return false;
379
- }
380
- }
381
- return true;
382
- };
383
- return Object.keys(enumeration)
384
- .filter(notIncludeFiler)
385
- .map(key => ({
386
- value: key,
387
- text: enumeration[key]
388
- }));
389
- }
390
- static stringToArray(str, separator = ',') {
391
- if (str) {
392
- return str.split(separator).filter(element => element);
393
- }
394
- return [];
395
- }
396
- static stringToIntArray(str, separator = ',') {
397
- if (str) {
398
- return str.split(separator).filter(element => element).map(value => parseInt(value));
399
- }
400
- return [];
401
- }
402
- static company2String(comp) {
403
- let company = JSON.parse(comp);
404
- if (company) {
405
- return `${company.name} ${company.phone} ${company.email} ${company.websiteUrl}`;
406
- }
407
- }
408
- static address2String(adr) {
409
- let address = JSON.parse(adr);
410
- return `${address.street} ${address.street2} ${address.city} ${address.stateOrRegion} ${address.zipcode} ${address.country}`;
411
- }
412
- static dateToString(date) {
413
- return date.getFullYear() +
414
- '-' + this.pad(date.getMonth() + 1) +
415
- '-' + this.pad(date.getDate()) +
416
- ' ' + this.pad(date.getHours()) +
417
- ':' + this.pad(date.getMinutes()) +
418
- ':' + this.pad(date.getSeconds());
419
- }
420
- static utcDateToLocalDate(d) {
421
- let date = new Date(d);
422
- return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds()));
423
- }
424
- static stringToBoolean(value) {
425
- switch (value.toLowerCase().trim()) {
426
- case "true":
427
- case "yes":
428
- case "1":
429
- return true;
430
- case "false":
431
- case "no":
432
- case "0":
433
- case null:
434
- return false;
435
- default:
436
- return Boolean(value);
437
- }
438
- }
439
- }
440
-
441
473
  /*
442
474
  <file>
443
475
  Project:
@@ -1226,6 +1258,56 @@ NotificationService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: Noti
1226
1258
  args: [{ providedIn: 'root' }]
1227
1259
  }], function () { return [{ type: i1$2.ToastrService }]; }, null); })();
1228
1260
 
1261
+ /*
1262
+ <file>
1263
+ Project:
1264
+ @osovitny/anatoly
1265
+
1266
+ Authors:
1267
+ Vadim Osovitny vadim@osovitny.com
1268
+ Anatoly Osovitny anatoly@osovitny.com
1269
+
1270
+ Created:
1271
+ 17 Apr 2023
1272
+
1273
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1274
+ </file>
1275
+ */
1276
+ class Stopwatch {
1277
+ constructor(name) {
1278
+ this.name = name;
1279
+ this.startTime = 0;
1280
+ this.stopTime = 0;
1281
+ this.running = false;
1282
+ this.performance = !!window.performance;
1283
+ console.log(this.name + ' started.');
1284
+ }
1285
+ currentTime() {
1286
+ return this.performance ? window.performance.now() : new Date().getTime();
1287
+ }
1288
+ start() {
1289
+ this.startTime = this.currentTime();
1290
+ this.running = true;
1291
+ }
1292
+ stop() {
1293
+ this.stopTime = this.currentTime();
1294
+ this.running = false;
1295
+ }
1296
+ getElapsedMilliseconds() {
1297
+ if (this.running) {
1298
+ this.stopTime = this.currentTime();
1299
+ }
1300
+ return this.stopTime - this.startTime;
1301
+ }
1302
+ getElapsedSeconds() {
1303
+ return this.getElapsedMilliseconds() / 1000;
1304
+ }
1305
+ printElapsedAsMilliseconds() {
1306
+ let elapsed = this.getElapsedMilliseconds();
1307
+ console.log(`${this.name} stopped. Execution time: ${elapsed} ms`);
1308
+ }
1309
+ }
1310
+
1229
1311
  /*
1230
1312
  <file>
1231
1313
  Project:
@@ -1692,38 +1774,6 @@ GoogleAnalyticsService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: G
1692
1774
  type: Injectable
1693
1775
  }], function () { return [{ type: i1.Router }]; }, null); })();
1694
1776
 
1695
- /*
1696
- <file>
1697
- Project:
1698
- @osovitny/anatoly
1699
-
1700
- Authors:
1701
- Vadim Osovitny vadim@osovitny.com
1702
- Anatoly Osovitny anatoly@osovitny.com
1703
-
1704
- Created:
1705
- 10 Sep 2022
1706
-
1707
- Code:
1708
- https://www.npmjs.com/package/js-beautify
1709
- https://beautifier.io
1710
-
1711
- Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1712
- </file>
1713
- */
1714
- class XmlFormatter {
1715
- static toPrettyXML(s, options) {
1716
- if (!options) {
1717
- options = {
1718
- indent_size: 2,
1719
- indent_char: " ",
1720
- wrap_line_length: 110
1721
- };
1722
- }
1723
- return js_beautify.html(s, options);
1724
- }
1725
- }
1726
-
1727
1777
  /*
1728
1778
  <file>
1729
1779
  Project:
@@ -1997,6 +2047,9 @@ class Utils {
1997
2047
  static generateRandom(start, end) {
1998
2048
  return Math.floor(Math.random() * (end - start + 1)) + start;
1999
2049
  }
2050
+ static isObjectNullOrEmpty(obj) {
2051
+ return !obj || Object.keys(obj).length == 0;
2052
+ }
2000
2053
  }
2001
2054
 
2002
2055
  /*
@@ -4397,14 +4450,14 @@ ContactUsDialog.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ContactUsDi
4397
4450
  } if (rf & 2) {
4398
4451
  let _t;
4399
4452
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.contactUsForm = _t.first);
4400
- } }, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["title", "Contact Us", 3, "width", "close", 4, "ngIf"], ["title", "Contact Us", 3, "width", "close"], [1, "k-content", "k-window-content", "k-dialog-content"], [3, "showActionButtons", "submit"], ["contactusform", ""], [1, "k-actions"], [1, "d-flex", "justify-content-end"], ["type", "button", 1, "btn", "btn-success", 3, "click"], ["type", "button", 1, "btn", "btn-danger", 3, "click"]], template: function ContactUsDialog_Template(rf, ctx) { if (rf & 1) {
4453
+ } }, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["title", "Contact Us", 3, "width", "close", 4, "ngIf"], ["title", "Contact Us", 3, "width", "close"], [1, "k-content", "k-window-content", "k-dialog-content"], [3, "showActionButtons", "submit"], ["contactusform", ""], [1, "k-actions"], [1, "d-flex", "justify-content-end"], ["type", "button", 1, "btn", "btn-sm", "btn-success", 3, "click"], ["type", "button", 1, "btn", "btn-sm", "btn-danger", 3, "click"]], template: function ContactUsDialog_Template(rf, ctx) { if (rf & 1) {
4401
4454
  i0.ɵɵtemplate(0, ContactUsDialog_kendo_dialog_0_Template, 10, 2, "kendo-dialog", 0);
4402
4455
  } if (rf & 2) {
4403
4456
  i0.ɵɵproperty("ngIf", ctx.isOpen);
4404
4457
  } }, dependencies: [i1$5.NgIf, i2$1.DialogComponent, i2$1.DialogActionsComponent, ContactUsForm], encapsulation: 2 });
4405
4458
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ContactUsDialog, [{
4406
4459
  type: Component,
4407
- args: [{ selector: 'anatoly-contactus-dialog', template: "<kendo-dialog (close)='onClose()' *ngIf='isOpen' [width]='700' title='Contact Us'>\r\n <div class=\"k-content k-window-content k-dialog-content\">\r\n <anatoly-forms-contactus-form #contactusform [showActionButtons]='false' (submit)='onSubmit()'>\r\n </anatoly-forms-contactus-form>\r\n </div>\r\n <kendo-dialog-actions class=\"k-actions\">\r\n <div class=\"d-flex justify-content-end\">\r\n <button (click)='onSubmitFire()' class='btn btn-success' type='button'>Submit</button>\r\n <button (click)='onClose()' class='btn btn-danger' type='button'>Cancel </button>\r\n </div>\r\n </kendo-dialog-actions>\r\n</kendo-dialog>\r\n" }]
4460
+ args: [{ selector: 'anatoly-contactus-dialog', template: "<kendo-dialog (close)='onClose()' *ngIf='isOpen' [width]='700' title='Contact Us'>\r\n <div class=\"k-content k-window-content k-dialog-content\">\r\n <anatoly-forms-contactus-form #contactusform [showActionButtons]='false' (submit)='onSubmit()'>\r\n </anatoly-forms-contactus-form>\r\n </div>\r\n <kendo-dialog-actions class=\"k-actions\">\r\n <div class=\"d-flex justify-content-end\">\r\n <button (click)='onSubmitFire()' class='btn btn-sm btn-success' type='button'>Submit</button>\r\n <button (click)='onClose()' class='btn btn-sm btn-danger' type='button'>Cancel </button>\r\n </div>\r\n </kendo-dialog-actions>\r\n</kendo-dialog>" }]
4408
4461
  }], function () { return []; }, { contactUsForm: [{
4409
4462
  type: ViewChild,
4410
4463
  args: ['contactusform']
@@ -5664,5 +5717,5 @@ AnatolyModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModu
5664
5717
  * Generated bundle index. Do not edit.
5665
5718
  */
5666
5719
 
5667
- export { AddressComponent, Alerts, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyModule, AnatolyUIModule, AppContextService, AppCoreSettings, BaseApiService, BaseComponent, BaseDialog, BaseEditComponent, BaseGoService, BaseGridEditService, BaseGridReadService, BaseHtmlEditorComponent, BaseList, BasePage, BasePagedPage, BuyAccessButtonComponent, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CheckIconComponent, CompanyComponent, ContactUsDialog, ContactUsForm, Convert, Copy2ClipboardComponent, CoreApiService, DOM, DatapagerComponent, DefaultEditorOptions, DigitalMarketingService, EmailsApiService, FileSizePipe, FormValidationSummaryComponent, FormsHtmlEditorComponent, FroalaEditorModuleWithProviders, FroalaViewModuleWithProviders, GlobalErrorHandler, GoogleAnalyticsService, Guid, HoveringDirective, HtmlEditorComponent, IdleService, InjectorInstance, ItemValidationSummaryComponent, LoadingComponent, LoadingService, LocalStorageService, LocalizationInjectorInstance, LocalizationModule, LocalizationService, LocalizationSettingsModule, LocalizePipe, LoggingService, NativeElementDirective, NodataComponent, NotificationService, NotificationsApiService, PageSpinnerComponent, ReplaceTextPipe, SafeHtmlPipe, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, Subs, SubscribePlanButtonComponent, TimezoneDropdownlist, TranslateModuleAtRoot, UrlSlugComponent, Urls, Utils, ValidationSummaryComponent, XmlFormatter, customTranslateLoaderFactory, localizationInitializerFactory, throwIfAlreadyLoaded };
5720
+ export { AddressComponent, Alerts, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyModule, AnatolyUIModule, AppContextService, AppCoreSettings, BaseApiService, BaseComponent, BaseDialog, BaseEditComponent, BaseGoService, BaseGridEditService, BaseGridReadService, BaseHtmlEditorComponent, BaseList, BasePage, BasePagedPage, BuyAccessButtonComponent, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CheckIconComponent, CompanyComponent, ContactUsDialog, ContactUsForm, Convert, Copy2ClipboardComponent, CoreApiService, DOM, DatapagerComponent, DefaultEditorOptions, DigitalMarketingService, EmailsApiService, FileSizePipe, FormValidationSummaryComponent, FormsHtmlEditorComponent, FroalaEditorModuleWithProviders, FroalaViewModuleWithProviders, GlobalErrorHandler, GoogleAnalyticsService, Guid, HoveringDirective, HtmlEditorComponent, IdleService, InjectorInstance, ItemValidationSummaryComponent, LoadingComponent, LoadingService, LocalStorageService, LocalizationInjectorInstance, LocalizationModule, LocalizationService, LocalizationSettingsModule, LocalizePipe, LoggingService, NativeElementDirective, NodataComponent, NotificationService, NotificationsApiService, PageSpinnerComponent, ReplaceTextPipe, SafeHtmlPipe, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, Stopwatch, Subs, SubscribePlanButtonComponent, TimezoneDropdownlist, TranslateModuleAtRoot, UrlSlugComponent, Urls, Utils, ValidationSummaryComponent, XmlFormatter, customTranslateLoaderFactory, localizationInitializerFactory, throwIfAlreadyLoaded };
5668
5721
  //# sourceMappingURL=osovitny-anatoly.mjs.map