@smartsoft001-mobilems/angular 2.15.0 → 2.17.0
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.
|
@@ -8,8 +8,8 @@ import * as moment from 'moment';
|
|
|
8
8
|
import { lastValueFrom, combineLatest, firstValueFrom, Subject, of, throwError } from 'rxjs';
|
|
9
9
|
import { map, filter, catchError } from 'rxjs/operators';
|
|
10
10
|
import * as i1 from '@angular/common';
|
|
11
|
-
import { isPlatformBrowser, CommonModule, DOCUMENT } from '@angular/common';
|
|
12
|
-
import { Router, ActivatedRoute, NavigationEnd, RouterOutlet, RouterModule } from '@angular/router';
|
|
11
|
+
import { isPlatformBrowser, CommonModule, DOCUMENT, NgClass, NgTemplateOutlet } from '@angular/common';
|
|
12
|
+
import { Router, ActivatedRoute, NavigationEnd, RouterOutlet, RouterLink, RouterLinkActive, RouterModule } from '@angular/router';
|
|
13
13
|
import { TranslateService } from '@ngx-translate/core';
|
|
14
14
|
import { CrudService, CrudFacade } from '@smartsoft001/crud-shell-angular';
|
|
15
15
|
import * as _ from 'lodash';
|
|
@@ -1080,7 +1080,7 @@ class ConfigsFacade {
|
|
|
1080
1080
|
});
|
|
1081
1081
|
}
|
|
1082
1082
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: ConfigsFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1083
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: ConfigsFacade }); }
|
|
1083
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: ConfigsFacade, providedIn: 'root' }); }
|
|
1084
1084
|
}
|
|
1085
1085
|
__decorate([
|
|
1086
1086
|
ReduxAction(),
|
|
@@ -1095,7 +1095,10 @@ __decorate([
|
|
|
1095
1095
|
__metadata("design:returntype", Promise)
|
|
1096
1096
|
], ConfigsFacade.prototype, "init", null);
|
|
1097
1097
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: ConfigsFacade, decorators: [{
|
|
1098
|
-
type: Injectable
|
|
1098
|
+
type: Injectable,
|
|
1099
|
+
args: [{
|
|
1100
|
+
providedIn: 'root',
|
|
1101
|
+
}]
|
|
1099
1102
|
}], propDecorators: { getPage: [], init: [] } });
|
|
1100
1103
|
|
|
1101
1104
|
class AppComponent extends AppBaseComponent {
|
|
@@ -1612,6 +1615,71 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImpor
|
|
|
1612
1615
|
args: [{ selector: 'smart-mobilems-header', standalone: true, imports: [], template: `` }]
|
|
1613
1616
|
}] });
|
|
1614
1617
|
|
|
1618
|
+
class MenuComponent {
|
|
1619
|
+
constructor() {
|
|
1620
|
+
this.configsFacade = inject(ConfigsFacade);
|
|
1621
|
+
this.router = inject(Router);
|
|
1622
|
+
this.platformId = inject(PLATFORM_ID);
|
|
1623
|
+
this.menuItems = input([], ...(ngDevMode ? [{ debugName: "menuItems" }] : []));
|
|
1624
|
+
this.searchEnabled = input(false, ...(ngDevMode ? [{ debugName: "searchEnabled" }] : []));
|
|
1625
|
+
this.config = computed(() => this.configsFacade.data, ...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
1626
|
+
this.menuConfig = computed(() => {
|
|
1627
|
+
const config = this.config();
|
|
1628
|
+
return config?.theme ?? {};
|
|
1629
|
+
}, ...(ngDevMode ? [{ debugName: "menuConfig" }] : []));
|
|
1630
|
+
this.mobileBreakpoint = computed(() => {
|
|
1631
|
+
return this.menuConfig()?.menu?.mobileBreakpoint ?? 960;
|
|
1632
|
+
}, ...(ngDevMode ? [{ debugName: "mobileBreakpoint" }] : []));
|
|
1633
|
+
this.isMobileMenu = computed(() => {
|
|
1634
|
+
if (!isPlatformBrowser(this.platformId)) {
|
|
1635
|
+
return false;
|
|
1636
|
+
}
|
|
1637
|
+
return (typeof window !== 'undefined' &&
|
|
1638
|
+
window.innerWidth <= this.mobileBreakpoint());
|
|
1639
|
+
}, ...(ngDevMode ? [{ debugName: "isMobileMenu" }] : []));
|
|
1640
|
+
this._menuOpenState = false;
|
|
1641
|
+
}
|
|
1642
|
+
toggleMenu() {
|
|
1643
|
+
this._menuOpenState = !this._menuOpenState;
|
|
1644
|
+
}
|
|
1645
|
+
closeMenu() {
|
|
1646
|
+
this._menuOpenState = false;
|
|
1647
|
+
}
|
|
1648
|
+
isOpened() {
|
|
1649
|
+
return this._menuOpenState;
|
|
1650
|
+
}
|
|
1651
|
+
isRouteActive(route) {
|
|
1652
|
+
return this.router.isActive(route, {
|
|
1653
|
+
paths: 'exact',
|
|
1654
|
+
queryParams: 'exact',
|
|
1655
|
+
fragment: 'ignored',
|
|
1656
|
+
matrixParams: 'ignored',
|
|
1657
|
+
});
|
|
1658
|
+
}
|
|
1659
|
+
getMenuItemTitle(item) {
|
|
1660
|
+
if (item.title) {
|
|
1661
|
+
return item.title;
|
|
1662
|
+
}
|
|
1663
|
+
return this.isRouteActive(item.route)
|
|
1664
|
+
? `${item.label} (active)`
|
|
1665
|
+
: item.label;
|
|
1666
|
+
}
|
|
1667
|
+
getMenuItemAriaLabel(item) {
|
|
1668
|
+
if (item.ariaLabel) {
|
|
1669
|
+
return item.ariaLabel;
|
|
1670
|
+
}
|
|
1671
|
+
return this.isRouteActive(item.route)
|
|
1672
|
+
? `${item.label} - Current page`
|
|
1673
|
+
: item.label;
|
|
1674
|
+
}
|
|
1675
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: MenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1676
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.0", type: MenuComponent, isStandalone: true, selector: "smart-mobilems-menu", inputs: { menuItems: { classPropertyName: "menuItems", publicName: "menuItems", isSignal: true, isRequired: false, transformFunction: null }, searchEnabled: { classPropertyName: "searchEnabled", publicName: "searchEnabled", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (!searchEnabled()) {\n <h2 class=\"smart-sr-only\">Main Menu</h2>\n\n @if (isMobileMenu()) {\n <div\n class=\"smart-w-full smart-flex smart-flex-row smart-justify-end smart-items-stretch smart-py-[1.2rem]\"\n [ngClass]=\"isOpened() ? '' : ''\"\n role=\"navigation\"\n attr.aria-label=\"Main Menu\"\n >\n <button\n class=\"smart-h-[3.6rem] smart-relative smart-bg-transparent smart-border-0 smart-left-0 smart-flex smart-flex-row smart-items-center smart-text-[1.8rem] smart-font-bold smart-cursor-pointer\"\n (click)=\"toggleMenu()\"\n attr.aria-expanded=\"{{ isOpened() }}\"\n attr.aria-label=\"{{ isOpened() ? 'Close menu' : 'Open menu' }}\"\n >\n @if (!isOpened()) {\n <span\n class=\"smart-text-[3rem] smart-text-black smart-mr-[0.6rem] smart-material-icons\"\n >menu</span\n >\n } @else {\n <span\n class=\"smart-text-[3rem] smart-text-black smart-mr-[0.6rem] smart-material-icons\"\n >close</span\n >\n }\n </button>\n </div>\n }\n\n @if (!isMobileMenu()) {\n <div\n class=\"smart-w-full smart-flex smart-flex-row smart-justify-end smart-h-full smart-p-0\"\n role=\"navigation\"\n attr.aria-label=\"Main Menu\"\n >\n <div role=\"menubar\">\n <ng-container *ngTemplateOutlet=\"menuTemplate\"></ng-container>\n </div>\n </div>\n }\n\n @if (isMobileMenu() && isOpened()) {\n <div\n class=\"smart-w-full smart-flex smart-flex-row smart-justify-center smart-h-full smart-p-0 smart-border smart-border-[#f3f3f3] smart-bg-[#fefefe] smart-mb-[2.4rem] smart-shadow-[0_0.6rem_1.2rem_#efefef] smart-p-[1.2rem]\"\n >\n <div role=\"navigation\" aria-label=\"Main\">\n <ng-container *ngTemplateOutlet=\"menuTemplate\"></ng-container>\n </div>\n </div>\n }\n}\n\n<ng-template #menuTemplate>\n <ul\n id=\"main-menu\"\n role=\"menu\"\n class=\"smart-h-full smart-w-full smart-flex smart-flex-row smart-justify-end smart-items-stretch smart-flex-nowrap smart-list-none smart-p-0 smart-m-0 smart-gap-x-[0.3rem]\"\n [ngClass]=\"\n isMobileMenu()\n ? 'smart-flex-wrap smart-justify-center smart-p-[1.2rem] smart-m-0'\n : ''\n \"\n >\n @for (item of menuItems(); track item.route) {\n <li\n class=\"smart-inline-flex smart-relative smart-w-auto smart-m-0\"\n [ngClass]=\"isMobileMenu() ? 'smart-w-full smart-max-w-full' : ''\"\n >\n <a\n class=\"smart-flex smart-items-center smart-flex-nowrap smart-text-black smart-transition-[border] smart-ease-in-out smart-duration-500 smart-border-b-[0.6rem] smart-border-b-transparent smart-cursor-pointer smart-justify-center smart-h-full smart-w-full smart-py-[1.2rem] smart-px-[1.8rem] smart-text-[1.6rem] smart-font-medium smart-whitespace-nowrap smart-m-0 smart-no-underline hover:smart-text-black hover:smart-bg-transparent hover:smart-border-b-[0.6rem] hover:smart-border-b-black\"\n role=\"menuitem\"\n [routerLink]=\"[item.route]\"\n routerLinkActive=\"smart-cursor-default smart-text-black smart-bg-transparent smart-border-b-[0.6rem] smart-border-b-black\"\n (click)=\"closeMenu()\"\n [attr.title]=\"getMenuItemTitle(item)\"\n [attr.aria-label]=\"getMenuItemAriaLabel(item)\"\n >\n @if (item.icon) {\n <span\n class=\"smart-text-[2.2rem] smart-mr-[0.4rem] smart-material-icons\"\n >{{ item.icon }}</span\n >\n }\n <span class=\"smart-inline-block\">{{ item.label }}</span>\n </a>\n </li>\n }\n </ul>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }] }); }
|
|
1677
|
+
}
|
|
1678
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: MenuComponent, decorators: [{
|
|
1679
|
+
type: Component,
|
|
1680
|
+
args: [{ selector: 'smart-mobilems-menu', standalone: true, imports: [NgClass, NgTemplateOutlet, RouterLink, RouterLinkActive], template: "@if (!searchEnabled()) {\n <h2 class=\"smart-sr-only\">Main Menu</h2>\n\n @if (isMobileMenu()) {\n <div\n class=\"smart-w-full smart-flex smart-flex-row smart-justify-end smart-items-stretch smart-py-[1.2rem]\"\n [ngClass]=\"isOpened() ? '' : ''\"\n role=\"navigation\"\n attr.aria-label=\"Main Menu\"\n >\n <button\n class=\"smart-h-[3.6rem] smart-relative smart-bg-transparent smart-border-0 smart-left-0 smart-flex smart-flex-row smart-items-center smart-text-[1.8rem] smart-font-bold smart-cursor-pointer\"\n (click)=\"toggleMenu()\"\n attr.aria-expanded=\"{{ isOpened() }}\"\n attr.aria-label=\"{{ isOpened() ? 'Close menu' : 'Open menu' }}\"\n >\n @if (!isOpened()) {\n <span\n class=\"smart-text-[3rem] smart-text-black smart-mr-[0.6rem] smart-material-icons\"\n >menu</span\n >\n } @else {\n <span\n class=\"smart-text-[3rem] smart-text-black smart-mr-[0.6rem] smart-material-icons\"\n >close</span\n >\n }\n </button>\n </div>\n }\n\n @if (!isMobileMenu()) {\n <div\n class=\"smart-w-full smart-flex smart-flex-row smart-justify-end smart-h-full smart-p-0\"\n role=\"navigation\"\n attr.aria-label=\"Main Menu\"\n >\n <div role=\"menubar\">\n <ng-container *ngTemplateOutlet=\"menuTemplate\"></ng-container>\n </div>\n </div>\n }\n\n @if (isMobileMenu() && isOpened()) {\n <div\n class=\"smart-w-full smart-flex smart-flex-row smart-justify-center smart-h-full smart-p-0 smart-border smart-border-[#f3f3f3] smart-bg-[#fefefe] smart-mb-[2.4rem] smart-shadow-[0_0.6rem_1.2rem_#efefef] smart-p-[1.2rem]\"\n >\n <div role=\"navigation\" aria-label=\"Main\">\n <ng-container *ngTemplateOutlet=\"menuTemplate\"></ng-container>\n </div>\n </div>\n }\n}\n\n<ng-template #menuTemplate>\n <ul\n id=\"main-menu\"\n role=\"menu\"\n class=\"smart-h-full smart-w-full smart-flex smart-flex-row smart-justify-end smart-items-stretch smart-flex-nowrap smart-list-none smart-p-0 smart-m-0 smart-gap-x-[0.3rem]\"\n [ngClass]=\"\n isMobileMenu()\n ? 'smart-flex-wrap smart-justify-center smart-p-[1.2rem] smart-m-0'\n : ''\n \"\n >\n @for (item of menuItems(); track item.route) {\n <li\n class=\"smart-inline-flex smart-relative smart-w-auto smart-m-0\"\n [ngClass]=\"isMobileMenu() ? 'smart-w-full smart-max-w-full' : ''\"\n >\n <a\n class=\"smart-flex smart-items-center smart-flex-nowrap smart-text-black smart-transition-[border] smart-ease-in-out smart-duration-500 smart-border-b-[0.6rem] smart-border-b-transparent smart-cursor-pointer smart-justify-center smart-h-full smart-w-full smart-py-[1.2rem] smart-px-[1.8rem] smart-text-[1.6rem] smart-font-medium smart-whitespace-nowrap smart-m-0 smart-no-underline hover:smart-text-black hover:smart-bg-transparent hover:smart-border-b-[0.6rem] hover:smart-border-b-black\"\n role=\"menuitem\"\n [routerLink]=\"[item.route]\"\n routerLinkActive=\"smart-cursor-default smart-text-black smart-bg-transparent smart-border-b-[0.6rem] smart-border-b-black\"\n (click)=\"closeMenu()\"\n [attr.title]=\"getMenuItemTitle(item)\"\n [attr.aria-label]=\"getMenuItemAriaLabel(item)\"\n >\n @if (item.icon) {\n <span\n class=\"smart-text-[2.2rem] smart-mr-[0.4rem] smart-material-icons\"\n >{{ item.icon }}</span\n >\n }\n <span class=\"smart-inline-block\">{{ item.label }}</span>\n </a>\n </li>\n }\n </ul>\n</ng-template>\n" }]
|
|
1681
|
+
}] });
|
|
1682
|
+
|
|
1615
1683
|
const COMPONENTS = [AppComponent];
|
|
1616
1684
|
|
|
1617
1685
|
/**
|
|
@@ -1861,5 +1929,5 @@ const unauthorizedGuard = () => {
|
|
|
1861
1929
|
* Generated bundle index. Do not edit.
|
|
1862
1930
|
*/
|
|
1863
1931
|
|
|
1864
|
-
export { AppComponent, AuthStorageService, COMPONENTS, ConfigsFacade, ConfigsService, ContrastService, CrudBaseService, DIRECTIVES, DictionaryService, FileUrlService, FiltersBaseComponent, FiltersContext, FooterComponent, GameType, GlobalService, HeaderComponent, HoverDirective, ImageBox, ListMode, MetaService, ModalContainerComponent, ModalRef, ModalService, PageComponent, SERVICES, ScrollTopComponent, ScrollableDirective, SeoService, SettingsService, SharedConfig, SharedModule, StyleService, TRANSLATE_DATA_PL, TranslationService, WcagService, authenticationGuard, environment, setTranslationsAndLang, unauthorizedGuard };
|
|
1932
|
+
export { AppComponent, AuthStorageService, COMPONENTS, ConfigsFacade, ConfigsService, ContrastService, CrudBaseService, DIRECTIVES, DictionaryService, FileUrlService, FiltersBaseComponent, FiltersContext, FooterComponent, GameType, GlobalService, HeaderComponent, HoverDirective, ImageBox, ListMode, MenuComponent, MetaService, ModalContainerComponent, ModalRef, ModalService, PageComponent, SERVICES, ScrollTopComponent, ScrollableDirective, SeoService, SettingsService, SharedConfig, SharedModule, StyleService, TRANSLATE_DATA_PL, TranslationService, WcagService, authenticationGuard, environment, setTranslationsAndLang, unauthorizedGuard };
|
|
1865
1933
|
//# sourceMappingURL=smartsoft001-mobilems-angular.mjs.map
|