@osovitny/anatoly 2.16.6 → 2.16.7
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/esm2022/lib/core/core.module.mjs +17 -15
- package/esm2022/lib/core/index.mjs +6 -3
- package/esm2022/lib/core/models/appcontext.service.mjs +17 -0
- package/esm2022/lib/core/services/appcontext.service.mjs +3 -2
- package/esm2022/lib/core/services/starter.service.mjs +76 -0
- package/fesm2022/osovitny-anatoly.mjs +270 -184
- package/fesm2022/osovitny-anatoly.mjs.map +1 -1
- package/lib/core/index.d.ts +4 -2
- package/lib/core/models/appcontext.service.d.ts +6 -0
- package/lib/core/services/starter.service.d.ts +11 -0
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import { NavigationEnd, NavigationStart, NavigationCancel, NavigationError, Rout
|
|
|
6
6
|
import * as i1$3 from '@angular/common/http';
|
|
7
7
|
import { HttpResponse, HttpClient } from '@angular/common/http';
|
|
8
8
|
import { tap, map } from 'rxjs/operators';
|
|
9
|
-
import { BehaviorSubject, Subject, timer, merge, fromEvent } from 'rxjs';
|
|
9
|
+
import { BehaviorSubject, Subject, timer, merge, fromEvent, of, forkJoin } from 'rxjs';
|
|
10
10
|
import { isValid, format, formatDistance, formatDistanceToNow } from 'date-fns';
|
|
11
11
|
import { utcToZonedTime } from 'date-fns-tz';
|
|
12
12
|
import enUS from 'date-fns/locale/en-US';
|
|
@@ -889,6 +889,22 @@ class GlobalErrorHandler {
|
|
|
889
889
|
type: Injectable
|
|
890
890
|
}], function () { return [{ type: i0.Injector }]; }, null); })();
|
|
891
891
|
|
|
892
|
+
/*
|
|
893
|
+
<file>
|
|
894
|
+
Project:
|
|
895
|
+
@osovitny/anatoly
|
|
896
|
+
|
|
897
|
+
Authors:
|
|
898
|
+
Vadim Osovitny vadim@osovitny.com
|
|
899
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
900
|
+
|
|
901
|
+
Created:
|
|
902
|
+
11 Nov 2023
|
|
903
|
+
|
|
904
|
+
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
905
|
+
</file>
|
|
906
|
+
*/
|
|
907
|
+
|
|
892
908
|
/*
|
|
893
909
|
<file>
|
|
894
910
|
Project:
|
|
@@ -1534,7 +1550,7 @@ class AppContextService extends BaseApiService {
|
|
|
1534
1550
|
this.http = http;
|
|
1535
1551
|
this.localStorage = localStorage;
|
|
1536
1552
|
this.sessionStorage = sessionStorage;
|
|
1537
|
-
this.baseUrl =
|
|
1553
|
+
this.baseUrl = `${AppCoreSettings.apiUrl}/appContext`;
|
|
1538
1554
|
}
|
|
1539
1555
|
//Session
|
|
1540
1556
|
getCurrentFromSession() {
|
|
@@ -1649,84 +1665,6 @@ class AppContextService extends BaseApiService {
|
|
|
1649
1665
|
type: Injectable
|
|
1650
1666
|
}], function () { return [{ type: i1$3.HttpClient }, { type: LocalStorageService }, { type: SessionStorageService }]; }, null); })();
|
|
1651
1667
|
|
|
1652
|
-
/*
|
|
1653
|
-
<file>
|
|
1654
|
-
Project:
|
|
1655
|
-
@osovitny/anatoly
|
|
1656
|
-
|
|
1657
|
-
Authors:
|
|
1658
|
-
Vadim Osovitny vadim@osovitny.com
|
|
1659
|
-
Anatoly Osovitny anatoly@osovitny.com
|
|
1660
|
-
|
|
1661
|
-
Created:
|
|
1662
|
-
26 Jun 2020
|
|
1663
|
-
|
|
1664
|
-
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
1665
|
-
</file>
|
|
1666
|
-
*/
|
|
1667
|
-
//Node
|
|
1668
|
-
class IdleService {
|
|
1669
|
-
idle$;
|
|
1670
|
-
timer$;
|
|
1671
|
-
idleSubscription;
|
|
1672
|
-
//Dates/Timeouts
|
|
1673
|
-
startDate;
|
|
1674
|
-
timeOutSeconds;
|
|
1675
|
-
timeOutMilliSeconds;
|
|
1676
|
-
expired$ = new Subject();
|
|
1677
|
-
//Private
|
|
1678
|
-
resetTimeCounters(timeOutSeconds) {
|
|
1679
|
-
this.timeOutSeconds = timeOutSeconds;
|
|
1680
|
-
this.timeOutMilliSeconds = timeOutSeconds * 1000;
|
|
1681
|
-
this.startDate = new Date();
|
|
1682
|
-
}
|
|
1683
|
-
startTimer() {
|
|
1684
|
-
this.timer$ = timer(this.timeOutMilliSeconds, 1 * 1000).subscribe({
|
|
1685
|
-
next: (data) => {
|
|
1686
|
-
let nowDate = new Date();
|
|
1687
|
-
let exiredDate = new Date(this.startDate.getTime() + this.timeOutMilliSeconds);
|
|
1688
|
-
if (nowDate.getTime() >= exiredDate.getTime()) {
|
|
1689
|
-
//console.log("nowDate: " + nowDate);
|
|
1690
|
-
//console.log("exiredDate: " + exiredDate);
|
|
1691
|
-
this.expired$.next(true);
|
|
1692
|
-
}
|
|
1693
|
-
}
|
|
1694
|
-
});
|
|
1695
|
-
}
|
|
1696
|
-
resetTimer() {
|
|
1697
|
-
this.startDate = new Date();
|
|
1698
|
-
}
|
|
1699
|
-
//Public
|
|
1700
|
-
startWatching(timeOutSeconds) {
|
|
1701
|
-
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'));
|
|
1702
|
-
this.resetTimeCounters(timeOutSeconds);
|
|
1703
|
-
this.idleSubscription = this.idle$.subscribe({
|
|
1704
|
-
next: (data) => {
|
|
1705
|
-
this.resetTimer();
|
|
1706
|
-
}
|
|
1707
|
-
});
|
|
1708
|
-
this.startTimer();
|
|
1709
|
-
return this.expired$;
|
|
1710
|
-
}
|
|
1711
|
-
stopWatching() {
|
|
1712
|
-
this.timer$.unsubscribe();
|
|
1713
|
-
this.idleSubscription.unsubscribe();
|
|
1714
|
-
}
|
|
1715
|
-
restartIdleTimer(timeOutSeconds) {
|
|
1716
|
-
this.timer$.unsubscribe();
|
|
1717
|
-
this.resetTimeCounters(timeOutSeconds);
|
|
1718
|
-
this.startTimer();
|
|
1719
|
-
}
|
|
1720
|
-
static ɵfac = function IdleService_Factory(t) { return new (t || IdleService)(); };
|
|
1721
|
-
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: IdleService, factory: IdleService.ɵfac, providedIn: 'root' });
|
|
1722
|
-
}
|
|
1723
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IdleService, [{
|
|
1724
|
-
type: Injectable,
|
|
1725
|
-
args: [{
|
|
1726
|
-
providedIn: 'root'
|
|
1727
|
-
}]
|
|
1728
|
-
}], null, null); })();
|
|
1729
|
-
|
|
1730
1668
|
/*
|
|
1731
1669
|
<file>
|
|
1732
1670
|
Project:
|
|
@@ -1846,6 +1784,247 @@ class GoogleAnalyticsService {
|
|
|
1846
1784
|
type: Injectable
|
|
1847
1785
|
}], function () { return [{ type: i1.Router }]; }, null); })();
|
|
1848
1786
|
|
|
1787
|
+
/*
|
|
1788
|
+
<file>
|
|
1789
|
+
Project:
|
|
1790
|
+
@osovitny/anatoly
|
|
1791
|
+
|
|
1792
|
+
Authors:
|
|
1793
|
+
Vadim Osovitny vadim@osovitny.com
|
|
1794
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
1795
|
+
|
|
1796
|
+
Created:
|
|
1797
|
+
26 Jun 2020
|
|
1798
|
+
|
|
1799
|
+
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
1800
|
+
</file>
|
|
1801
|
+
*/
|
|
1802
|
+
//Node
|
|
1803
|
+
class IdleService {
|
|
1804
|
+
idle$;
|
|
1805
|
+
timer$;
|
|
1806
|
+
idleSubscription;
|
|
1807
|
+
//Dates/Timeouts
|
|
1808
|
+
startDate;
|
|
1809
|
+
timeOutSeconds;
|
|
1810
|
+
timeOutMilliSeconds;
|
|
1811
|
+
expired$ = new Subject();
|
|
1812
|
+
//Private
|
|
1813
|
+
resetTimeCounters(timeOutSeconds) {
|
|
1814
|
+
this.timeOutSeconds = timeOutSeconds;
|
|
1815
|
+
this.timeOutMilliSeconds = timeOutSeconds * 1000;
|
|
1816
|
+
this.startDate = new Date();
|
|
1817
|
+
}
|
|
1818
|
+
startTimer() {
|
|
1819
|
+
this.timer$ = timer(this.timeOutMilliSeconds, 1 * 1000).subscribe({
|
|
1820
|
+
next: (data) => {
|
|
1821
|
+
let nowDate = new Date();
|
|
1822
|
+
let exiredDate = new Date(this.startDate.getTime() + this.timeOutMilliSeconds);
|
|
1823
|
+
if (nowDate.getTime() >= exiredDate.getTime()) {
|
|
1824
|
+
//console.log("nowDate: " + nowDate);
|
|
1825
|
+
//console.log("exiredDate: " + exiredDate);
|
|
1826
|
+
this.expired$.next(true);
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
});
|
|
1830
|
+
}
|
|
1831
|
+
resetTimer() {
|
|
1832
|
+
this.startDate = new Date();
|
|
1833
|
+
}
|
|
1834
|
+
//Public
|
|
1835
|
+
startWatching(timeOutSeconds) {
|
|
1836
|
+
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'));
|
|
1837
|
+
this.resetTimeCounters(timeOutSeconds);
|
|
1838
|
+
this.idleSubscription = this.idle$.subscribe({
|
|
1839
|
+
next: (data) => {
|
|
1840
|
+
this.resetTimer();
|
|
1841
|
+
}
|
|
1842
|
+
});
|
|
1843
|
+
this.startTimer();
|
|
1844
|
+
return this.expired$;
|
|
1845
|
+
}
|
|
1846
|
+
stopWatching() {
|
|
1847
|
+
this.timer$.unsubscribe();
|
|
1848
|
+
this.idleSubscription.unsubscribe();
|
|
1849
|
+
}
|
|
1850
|
+
restartIdleTimer(timeOutSeconds) {
|
|
1851
|
+
this.timer$.unsubscribe();
|
|
1852
|
+
this.resetTimeCounters(timeOutSeconds);
|
|
1853
|
+
this.startTimer();
|
|
1854
|
+
}
|
|
1855
|
+
static ɵfac = function IdleService_Factory(t) { return new (t || IdleService)(); };
|
|
1856
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: IdleService, factory: IdleService.ɵfac, providedIn: 'root' });
|
|
1857
|
+
}
|
|
1858
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IdleService, [{
|
|
1859
|
+
type: Injectable,
|
|
1860
|
+
args: [{
|
|
1861
|
+
providedIn: 'root'
|
|
1862
|
+
}]
|
|
1863
|
+
}], null, null); })();
|
|
1864
|
+
|
|
1865
|
+
/*
|
|
1866
|
+
<file>
|
|
1867
|
+
Project:
|
|
1868
|
+
@osovitny/anatoly
|
|
1869
|
+
|
|
1870
|
+
Authors:
|
|
1871
|
+
Vadim Osovitny vadim@osovitny.com
|
|
1872
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
1873
|
+
|
|
1874
|
+
Created:
|
|
1875
|
+
19 March 2020
|
|
1876
|
+
|
|
1877
|
+
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
1878
|
+
</file>
|
|
1879
|
+
*/
|
|
1880
|
+
class Utils {
|
|
1881
|
+
static idExistsInQS() {
|
|
1882
|
+
let id = Utils.getValueByNameInQS("id");
|
|
1883
|
+
if (id)
|
|
1884
|
+
return true;
|
|
1885
|
+
return false;
|
|
1886
|
+
}
|
|
1887
|
+
static getValueByNameInQS(name) {
|
|
1888
|
+
return Utils.getValueByName(location.search, name);
|
|
1889
|
+
}
|
|
1890
|
+
static getValueByName(url, name) {
|
|
1891
|
+
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
|
|
1892
|
+
// tslint:disable-next-line:one-variable-per-declaration
|
|
1893
|
+
const regex = new RegExp('[\\?&]' + name + '=([^&#]*)'), results = regex.exec(url);
|
|
1894
|
+
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
|
|
1895
|
+
}
|
|
1896
|
+
static copyToClipBoard(event, val) {
|
|
1897
|
+
event.preventDefault();
|
|
1898
|
+
const selBox = document.createElement('textarea');
|
|
1899
|
+
selBox.style.position = 'fixed';
|
|
1900
|
+
selBox.style.left = '0';
|
|
1901
|
+
selBox.style.top = '0';
|
|
1902
|
+
selBox.style.opacity = '0';
|
|
1903
|
+
selBox.value = val;
|
|
1904
|
+
document.body.appendChild(selBox);
|
|
1905
|
+
selBox.focus();
|
|
1906
|
+
selBox.select();
|
|
1907
|
+
document.execCommand('copy');
|
|
1908
|
+
document.body.removeChild(selBox);
|
|
1909
|
+
}
|
|
1910
|
+
static downloadFile(name, url) {
|
|
1911
|
+
const link = document.createElement('a');
|
|
1912
|
+
link.download = name;
|
|
1913
|
+
link.href = url;
|
|
1914
|
+
link.click();
|
|
1915
|
+
}
|
|
1916
|
+
static downloadBlobFile(value, fileName) {
|
|
1917
|
+
const nav = window.navigator;
|
|
1918
|
+
if (nav.msSaveOrOpenBlob) {
|
|
1919
|
+
nav.msSaveOrOpenBlob(value, fileName);
|
|
1920
|
+
}
|
|
1921
|
+
else {
|
|
1922
|
+
const downloadURL = window.URL.createObjectURL(value);
|
|
1923
|
+
Utils.downloadFile(fileName, downloadURL);
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
1926
|
+
/*
|
|
1927
|
+
Author:
|
|
1928
|
+
https://medium.com/@mhagemann/the-ultimate-way-to-slugify-a-url-string-in-javascript-b8e4a0d849e1
|
|
1929
|
+
*/
|
|
1930
|
+
static slugify(text, prefix = '', postfix = '') {
|
|
1931
|
+
const a = 'àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;';
|
|
1932
|
+
const b = 'aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------';
|
|
1933
|
+
const p = new RegExp(a.split('').join('|'), 'g');
|
|
1934
|
+
/*
|
|
1935
|
+
https://css-tricks.com/snippets/javascript/strip-html-tags-in-javascript/
|
|
1936
|
+
https://stackoverflow.com/questions/822452/strip-html-from-text-javascript
|
|
1937
|
+
*/
|
|
1938
|
+
text = text.replace(/(<([^>]+)>)/gi, '');
|
|
1939
|
+
let result = text
|
|
1940
|
+
.toString()
|
|
1941
|
+
.toLowerCase()
|
|
1942
|
+
.replace(/\s+/g, '-') // Replace spaces with -
|
|
1943
|
+
.replace(p, c => b.charAt(a.indexOf(c))) // Replace special characters
|
|
1944
|
+
.replace(/&/g, '-and-') // Replace & with 'and'
|
|
1945
|
+
.replace(/[^\w\-]+/g, '') // Remove all non-word characters
|
|
1946
|
+
.replace(/\-\-+/g, '-') // Replace multiple - with single -
|
|
1947
|
+
.replace(/^-+/, '') // Trim - from start of text
|
|
1948
|
+
.replace(/-+$/, ''); // Trim - from end of text
|
|
1949
|
+
return prefix + result + postfix;
|
|
1950
|
+
}
|
|
1951
|
+
static generateRandom(start, end) {
|
|
1952
|
+
return Math.floor(Math.random() * (end - start + 1)) + start;
|
|
1953
|
+
}
|
|
1954
|
+
static isObjectNullOrEmpty(obj) {
|
|
1955
|
+
return !obj || Object.keys(obj).length == 0;
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
/*
|
|
1960
|
+
<file>
|
|
1961
|
+
Project:
|
|
1962
|
+
@osovitny/anatoly
|
|
1963
|
+
|
|
1964
|
+
Authors:
|
|
1965
|
+
Vadim Osovitny vadim@osovitny.com
|
|
1966
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
1967
|
+
|
|
1968
|
+
Created:
|
|
1969
|
+
15 Nov 2023
|
|
1970
|
+
|
|
1971
|
+
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
1972
|
+
</file>
|
|
1973
|
+
*/
|
|
1974
|
+
class StarterService extends BaseApiService {
|
|
1975
|
+
http;
|
|
1976
|
+
appContext;
|
|
1977
|
+
constructor(http, appContext) {
|
|
1978
|
+
super(http);
|
|
1979
|
+
this.http = http;
|
|
1980
|
+
this.appContext = appContext;
|
|
1981
|
+
}
|
|
1982
|
+
applicationStarting() {
|
|
1983
|
+
let context = this.appContext.current;
|
|
1984
|
+
if (!Utils.isObjectNullOrEmpty(context)) {
|
|
1985
|
+
this.appContext.init(context);
|
|
1986
|
+
return of(context);
|
|
1987
|
+
}
|
|
1988
|
+
//Log
|
|
1989
|
+
let stopwatch = new Stopwatch("applicationStarting");
|
|
1990
|
+
stopwatch.start();
|
|
1991
|
+
this.baseUrl = `${AppCoreSettings.apiUrl}/appContext`;
|
|
1992
|
+
return this.get('applicationStarting').pipe(map(data => {
|
|
1993
|
+
//Log
|
|
1994
|
+
stopwatch.stop();
|
|
1995
|
+
stopwatch.printElapsedAsMilliseconds();
|
|
1996
|
+
this.appContext.init(data);
|
|
1997
|
+
}));
|
|
1998
|
+
}
|
|
1999
|
+
ensureApplicationStarted() {
|
|
2000
|
+
//1. Application Starting
|
|
2001
|
+
let applicationStarting$ = this.applicationStarting();
|
|
2002
|
+
//2. Load json files
|
|
2003
|
+
let jsonFiles$ = this.appContext.loadRequiredJsonFiles();
|
|
2004
|
+
//3. Load required items, like settings
|
|
2005
|
+
let requiredItems$ = this.appContext.loadRequiredItems();
|
|
2006
|
+
//Tasks to execute
|
|
2007
|
+
let parallelTasks = [];
|
|
2008
|
+
if (jsonFiles$)
|
|
2009
|
+
parallelTasks.push(jsonFiles$);
|
|
2010
|
+
if (requiredItems$)
|
|
2011
|
+
parallelTasks.push(requiredItems$);
|
|
2012
|
+
let parallelTasks$ = merge(...parallelTasks);
|
|
2013
|
+
let tasks$ = forkJoin([applicationStarting$, parallelTasks$]);
|
|
2014
|
+
//VadimOS:
|
|
2015
|
+
//concat is NOT wokring here, no idea why. Just executing first task
|
|
2016
|
+
//let tasks$ = concat(applicationStarting$, parallelTasks$);
|
|
2017
|
+
//Log
|
|
2018
|
+
let stopwatch = new Stopwatch("ensureApplicationStarted");
|
|
2019
|
+
stopwatch.start();
|
|
2020
|
+
return tasks$.pipe(map(() => {
|
|
2021
|
+
//Log
|
|
2022
|
+
stopwatch.stop();
|
|
2023
|
+
stopwatch.printElapsedAsMilliseconds();
|
|
2024
|
+
}));
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
|
|
1849
2028
|
/*
|
|
1850
2029
|
<file>
|
|
1851
2030
|
Project:
|
|
@@ -2053,100 +2232,6 @@ class Subs {
|
|
|
2053
2232
|
}
|
|
2054
2233
|
}
|
|
2055
2234
|
|
|
2056
|
-
/*
|
|
2057
|
-
<file>
|
|
2058
|
-
Project:
|
|
2059
|
-
@osovitny/anatoly
|
|
2060
|
-
|
|
2061
|
-
Authors:
|
|
2062
|
-
Vadim Osovitny vadim@osovitny.com
|
|
2063
|
-
Anatoly Osovitny anatoly@osovitny.com
|
|
2064
|
-
|
|
2065
|
-
Created:
|
|
2066
|
-
19 March 2020
|
|
2067
|
-
|
|
2068
|
-
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
2069
|
-
</file>
|
|
2070
|
-
*/
|
|
2071
|
-
class Utils {
|
|
2072
|
-
static idExistsInQS() {
|
|
2073
|
-
let id = Utils.getValueByNameInQS("id");
|
|
2074
|
-
if (id)
|
|
2075
|
-
return true;
|
|
2076
|
-
return false;
|
|
2077
|
-
}
|
|
2078
|
-
static getValueByNameInQS(name) {
|
|
2079
|
-
return Utils.getValueByName(location.search, name);
|
|
2080
|
-
}
|
|
2081
|
-
static getValueByName(url, name) {
|
|
2082
|
-
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
|
|
2083
|
-
// tslint:disable-next-line:one-variable-per-declaration
|
|
2084
|
-
const regex = new RegExp('[\\?&]' + name + '=([^&#]*)'), results = regex.exec(url);
|
|
2085
|
-
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
|
|
2086
|
-
}
|
|
2087
|
-
static copyToClipBoard(event, val) {
|
|
2088
|
-
event.preventDefault();
|
|
2089
|
-
const selBox = document.createElement('textarea');
|
|
2090
|
-
selBox.style.position = 'fixed';
|
|
2091
|
-
selBox.style.left = '0';
|
|
2092
|
-
selBox.style.top = '0';
|
|
2093
|
-
selBox.style.opacity = '0';
|
|
2094
|
-
selBox.value = val;
|
|
2095
|
-
document.body.appendChild(selBox);
|
|
2096
|
-
selBox.focus();
|
|
2097
|
-
selBox.select();
|
|
2098
|
-
document.execCommand('copy');
|
|
2099
|
-
document.body.removeChild(selBox);
|
|
2100
|
-
}
|
|
2101
|
-
static downloadFile(name, url) {
|
|
2102
|
-
const link = document.createElement('a');
|
|
2103
|
-
link.download = name;
|
|
2104
|
-
link.href = url;
|
|
2105
|
-
link.click();
|
|
2106
|
-
}
|
|
2107
|
-
static downloadBlobFile(value, fileName) {
|
|
2108
|
-
const nav = window.navigator;
|
|
2109
|
-
if (nav.msSaveOrOpenBlob) {
|
|
2110
|
-
nav.msSaveOrOpenBlob(value, fileName);
|
|
2111
|
-
}
|
|
2112
|
-
else {
|
|
2113
|
-
const downloadURL = window.URL.createObjectURL(value);
|
|
2114
|
-
Utils.downloadFile(fileName, downloadURL);
|
|
2115
|
-
}
|
|
2116
|
-
}
|
|
2117
|
-
/*
|
|
2118
|
-
Author:
|
|
2119
|
-
https://medium.com/@mhagemann/the-ultimate-way-to-slugify-a-url-string-in-javascript-b8e4a0d849e1
|
|
2120
|
-
*/
|
|
2121
|
-
static slugify(text, prefix = '', postfix = '') {
|
|
2122
|
-
const a = 'àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;';
|
|
2123
|
-
const b = 'aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------';
|
|
2124
|
-
const p = new RegExp(a.split('').join('|'), 'g');
|
|
2125
|
-
/*
|
|
2126
|
-
https://css-tricks.com/snippets/javascript/strip-html-tags-in-javascript/
|
|
2127
|
-
https://stackoverflow.com/questions/822452/strip-html-from-text-javascript
|
|
2128
|
-
*/
|
|
2129
|
-
text = text.replace(/(<([^>]+)>)/gi, '');
|
|
2130
|
-
let result = text
|
|
2131
|
-
.toString()
|
|
2132
|
-
.toLowerCase()
|
|
2133
|
-
.replace(/\s+/g, '-') // Replace spaces with -
|
|
2134
|
-
.replace(p, c => b.charAt(a.indexOf(c))) // Replace special characters
|
|
2135
|
-
.replace(/&/g, '-and-') // Replace & with 'and'
|
|
2136
|
-
.replace(/[^\w\-]+/g, '') // Remove all non-word characters
|
|
2137
|
-
.replace(/\-\-+/g, '-') // Replace multiple - with single -
|
|
2138
|
-
.replace(/^-+/, '') // Trim - from start of text
|
|
2139
|
-
.replace(/-+$/, ''); // Trim - from end of text
|
|
2140
|
-
return prefix + result + postfix;
|
|
2141
|
-
}
|
|
2142
|
-
static generateRandom(start, end) {
|
|
2143
|
-
return Math.floor(Math.random() * (end - start + 1)) + start;
|
|
2144
|
-
}
|
|
2145
|
-
static isObjectNullOrEmpty(obj) {
|
|
2146
|
-
return !obj || Object.keys(obj).length == 0;
|
|
2147
|
-
}
|
|
2148
|
-
}
|
|
2149
|
-
|
|
2150
2235
|
/*
|
|
2151
2236
|
<file>
|
|
2152
2237
|
Project:
|
|
@@ -5454,6 +5539,7 @@ class SafeHtmlPipe {
|
|
|
5454
5539
|
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
5455
5540
|
</file>
|
|
5456
5541
|
*/
|
|
5542
|
+
//Node
|
|
5457
5543
|
let InjectorInstance;
|
|
5458
5544
|
class AnatolyCoreModule {
|
|
5459
5545
|
injector;
|
|
@@ -5464,14 +5550,14 @@ class AnatolyCoreModule {
|
|
|
5464
5550
|
static ɵfac = function AnatolyCoreModule_Factory(t) { return new (t || AnatolyCoreModule)(i0.ɵɵinject(i0.Injector), i0.ɵɵinject(AnatolyCoreModule, 12)); };
|
|
5465
5551
|
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AnatolyCoreModule });
|
|
5466
5552
|
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
|
|
5467
|
-
LoggingService,
|
|
5468
|
-
NotificationService,
|
|
5469
5553
|
AppContextService,
|
|
5470
|
-
LoadingService,
|
|
5471
5554
|
DigitalMarketingService,
|
|
5472
5555
|
GoogleAnalyticsService,
|
|
5556
|
+
LoadingService,
|
|
5473
5557
|
LocalStorageService,
|
|
5474
|
-
SessionStorageService
|
|
5558
|
+
SessionStorageService,
|
|
5559
|
+
LoggingService,
|
|
5560
|
+
NotificationService
|
|
5475
5561
|
], imports: [CommonModule,
|
|
5476
5562
|
ToastrModule.forRoot(),
|
|
5477
5563
|
LocalizationSettingsModule,
|
|
@@ -5492,15 +5578,15 @@ class AnatolyCoreModule {
|
|
|
5492
5578
|
LocalizationModule,
|
|
5493
5579
|
],
|
|
5494
5580
|
providers: [
|
|
5495
|
-
LoggingService,
|
|
5496
|
-
NotificationService,
|
|
5497
5581
|
AppContextService,
|
|
5498
|
-
LoadingService,
|
|
5499
5582
|
DigitalMarketingService,
|
|
5500
5583
|
GoogleAnalyticsService,
|
|
5584
|
+
LoadingService,
|
|
5501
5585
|
LocalStorageService,
|
|
5502
|
-
SessionStorageService
|
|
5503
|
-
|
|
5586
|
+
SessionStorageService,
|
|
5587
|
+
LoggingService,
|
|
5588
|
+
NotificationService
|
|
5589
|
+
]
|
|
5504
5590
|
}]
|
|
5505
5591
|
}], function () { return [{ type: i0.Injector }, { type: AnatolyCoreModule, decorators: [{
|
|
5506
5592
|
type: Optional
|
|
@@ -5895,5 +5981,5 @@ class AnatolyModule {
|
|
|
5895
5981
|
* Generated bundle index. Do not edit.
|
|
5896
5982
|
*/
|
|
5897
5983
|
|
|
5898
|
-
export { AddressComponent, Alerts, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyModule, AnatolyUIModule, AppContextService, AppCoreSettings, AppName, BaseApiService, BaseComponent, BaseDialog, BaseEditComponent, BaseGoService, BaseGridEditService, BaseGridReadService, BaseHtmlEditorComponent, BaseList, BasePage, BasePagedPage, Browser, BuyAccessButtonComponent, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CheckIconComponent, CompanyComponent, ContactUsDialog, ContactUsForm, Convert, Copy2ClipboardComponent, CoreApiService, DOM, DatapagerComponent, DefaultEditorOptions, DigitalMarketingService, EmailsApiService, FileSizePipe, FormValidationSummaryComponent, FormsHtmlEditorComponent, 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 };
|
|
5984
|
+
export { AddressComponent, Alerts, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyModule, AnatolyUIModule, AppContextService, AppCoreSettings, AppName, BaseApiService, BaseComponent, BaseDialog, BaseEditComponent, BaseGoService, BaseGridEditService, BaseGridReadService, BaseHtmlEditorComponent, BaseList, BasePage, BasePagedPage, Browser, BuyAccessButtonComponent, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CheckIconComponent, CompanyComponent, ContactUsDialog, ContactUsForm, Convert, Copy2ClipboardComponent, CoreApiService, DOM, DatapagerComponent, DefaultEditorOptions, DigitalMarketingService, EmailsApiService, FileSizePipe, FormValidationSummaryComponent, FormsHtmlEditorComponent, 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, StarterService, Stopwatch, Subs, SubscribePlanButtonComponent, TimezoneDropdownlist, TranslateModuleAtRoot, UrlSlugComponent, Urls, Utils, ValidationSummaryComponent, XmlFormatter, customTranslateLoaderFactory, localizationInitializerFactory, throwIfAlreadyLoaded };
|
|
5899
5985
|
//# sourceMappingURL=osovitny-anatoly.mjs.map
|