@osovitny/anatoly 2.14.20 → 2.14.21

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,6 +18,7 @@ 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';
21
22
  import * as i1$5 from '@angular/forms';
22
23
  import { FormControl, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
23
24
  import * as i1$6 from 'angular-froala-wysiwyg';
@@ -1650,6 +1651,159 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
1650
1651
  type: Injectable
1651
1652
  }], ctorParameters: function () { return [{ type: i1.Router }]; } });
1652
1653
 
1654
+ /*
1655
+ <file>
1656
+ Project:
1657
+ @osovitny/anatoly
1658
+
1659
+ Authors:
1660
+ Vadim Osovitny
1661
+ Anatoly Osovitny
1662
+
1663
+ Created:
1664
+ 8 Aug 2022
1665
+
1666
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1667
+ </file>
1668
+ */
1669
+ class DOM {
1670
+ //Private
1671
+ static dir(elem, dir, until = null, selector = null) {
1672
+ let matched = [];
1673
+ let truncate = until !== undefined && until != null;
1674
+ while ((elem = elem[dir]) && elem.nodeType !== 9) {
1675
+ if (elem.nodeType === 1) {
1676
+ /*
1677
+ if (truncate && jQuery(elem).is(until)) {
1678
+ break;
1679
+ }
1680
+ */
1681
+ if (selector) {
1682
+ let className = selector.replace('.', '');
1683
+ if (elem.classList.contains(className)) {
1684
+ matched.push(elem);
1685
+ }
1686
+ }
1687
+ else {
1688
+ matched.push(elem);
1689
+ }
1690
+ }
1691
+ }
1692
+ return matched;
1693
+ }
1694
+ //Public
1695
+ static first(elements) {
1696
+ if (!elements || elements.length == 0) {
1697
+ return null;
1698
+ }
1699
+ return elements[0];
1700
+ }
1701
+ static any(elements) {
1702
+ if (!elements || elements.length == 0) {
1703
+ return false;
1704
+ }
1705
+ return true;
1706
+ }
1707
+ static parent(elem) {
1708
+ let parentElement = elem.parentElement;
1709
+ let parentNode = elem.parentNode;
1710
+ return parentNode && parentNode.nodeType !== 11 ? parentElement : null;
1711
+ }
1712
+ static parents(elem, selector = null) {
1713
+ return this.dir(elem, "parentNode", null, selector);
1714
+ }
1715
+ static findInDocument(selector) {
1716
+ let parent = $$1(document);
1717
+ return $$1(parent).find(selector).get();
1718
+ }
1719
+ static find(elem, selector) {
1720
+ return $$1(elem).find(selector).get();
1721
+ }
1722
+ static remove(nodes) {
1723
+ if (nodes == null) {
1724
+ return;
1725
+ }
1726
+ if (!Array.isArray(nodes)) {
1727
+ if (nodes.parentNode) {
1728
+ nodes.parentNode.removeChild(nodes);
1729
+ }
1730
+ return;
1731
+ }
1732
+ if (nodes.length == 0) {
1733
+ return;
1734
+ }
1735
+ let node;
1736
+ let i = 0;
1737
+ for (; (node = nodes[i]) != null; i++) {
1738
+ if (node.parentNode) {
1739
+ node.parentNode.removeChild(node);
1740
+ }
1741
+ }
1742
+ }
1743
+ static findAndRemove(element, selector) {
1744
+ this.remove(this.find(element, selector));
1745
+ }
1746
+ static show(elem) {
1747
+ $$1(elem).show();
1748
+ }
1749
+ static hide(elem) {
1750
+ $$1(elem).hide();
1751
+ }
1752
+ static each(selector, action) {
1753
+ let parent = $$1(document);
1754
+ let elems = DOM.find(parent, selector);
1755
+ for (let i = 0; i < elems.length; i++) {
1756
+ let elem = elems[i];
1757
+ action(elem);
1758
+ }
1759
+ }
1760
+ //Css
1761
+ /*
1762
+ public static addClass(e: Element, className: string): Element {
1763
+ const class = e.getAttribute('class');
1764
+ if (class === null || class === '') {
1765
+ e.setAttribute('class', className);
1766
+ } else if (!DOM.hasClass(e, className)) {
1767
+ e.setAttribute('class', `${class} ${className}`);
1768
+ }
1769
+
1770
+ return e;
1771
+ }
1772
+
1773
+ public static removeClass(e: Element, className: string): Element {
1774
+ const class = e.getAttribute('class')
1775
+ if (class !== null && class !== '') {
1776
+ if (class === className) {
1777
+ e.setAttribute('class', '');
1778
+ } else {
1779
+ const result = class
1780
+ .split(' ')
1781
+ .filter((s: any) => s !== className)
1782
+ .join(' ');
1783
+ e.setAttribute('class', result);
1784
+ }
1785
+ }
1786
+
1787
+ return e;
1788
+ }
1789
+
1790
+ public static hasClass(e: Element, className: string): boolean {
1791
+ const class = e.getAttribute('class') || '';
1792
+ const r = new RegExp(`\\b${className}\\b`, '');
1793
+ return r.test(class);
1794
+ }
1795
+ */
1796
+ static addClass(elem, classNames) {
1797
+ $$1(elem).addClass(classNames);
1798
+ }
1799
+ static removeClass(elem, classNames) {
1800
+ $$1(elem).removeClass(classNames);
1801
+ }
1802
+ static hasClass(elem, className) {
1803
+ $$1(elem).hasClass(className);
1804
+ }
1805
+ }
1806
+
1653
1807
  /*
1654
1808
  <file>
1655
1809
  Project:
@@ -4287,5 +4441,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
4287
4441
  * Generated bundle index. Do not edit.
4288
4442
  */
4289
4443
 
4290
- export { AddressComponent, Alerts, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyUIModule, AppContextService, AppCoreSettings, BaseApiService, BaseComponent, BaseDialog, BaseEditComponent, BaseGoService, BaseGridEditService, BaseGridReadService, BaseHtmlEditorComponent, BillingApiService, BuyAccessButtonComponent, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CompanyComponent, ContactUsDialog, ContactUsForm, ContextInitState, Convert, CoreApiService, DefaultEditorOptions, DigitalMarketingService, EmailsApiService, FileSizePipe, FormValidationSummaryComponent, FormsHtmlEditorComponent, FroalaEditorModuleWithProviders, FroalaViewModuleWithProviders, GlobalErrorHandler, GoogleAnalyticsService, Guid, 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, UpgradePlanButtonComponent, UrlSlugComponent, Urls, Utils, ValidationSummaryComponent, customTranslateLoaderFactory, localizationInitializerFactory, throwIfAlreadyLoaded };
4444
+ export { AddressComponent, Alerts, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyUIModule, AppContextService, AppCoreSettings, BaseApiService, BaseComponent, BaseDialog, BaseEditComponent, BaseGoService, BaseGridEditService, BaseGridReadService, BaseHtmlEditorComponent, BillingApiService, BuyAccessButtonComponent, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CompanyComponent, ContactUsDialog, ContactUsForm, ContextInitState, Convert, CoreApiService, DOM, DefaultEditorOptions, DigitalMarketingService, EmailsApiService, FileSizePipe, FormValidationSummaryComponent, FormsHtmlEditorComponent, FroalaEditorModuleWithProviders, FroalaViewModuleWithProviders, GlobalErrorHandler, GoogleAnalyticsService, Guid, 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, UpgradePlanButtonComponent, UrlSlugComponent, Urls, Utils, ValidationSummaryComponent, customTranslateLoaderFactory, localizationInitializerFactory, throwIfAlreadyLoaded };
4291
4445
  //# sourceMappingURL=osovitny-anatoly.mjs.map