@indigina/ui-kit 1.1.300 → 1.1.301

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.
@@ -31,7 +31,7 @@ import * as i1$8 from '@progress/kendo-angular-indicators';
31
31
  import { IndicatorsModule, KENDO_INDICATORS } from '@progress/kendo-angular-indicators';
32
32
  import * as i1$9 from '@progress/kendo-angular-upload';
33
33
  import { UploadModule } from '@progress/kendo-angular-upload';
34
- import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
34
+ import { takeUntilDestroyed, toSignal, toObservable } from '@angular/core/rxjs-interop';
35
35
  import initials from 'initials';
36
36
  import * as i1$a from '@progress/kendo-angular-layout';
37
37
  import { KENDO_LAYOUT, TileLayoutModule } from '@progress/kendo-angular-layout';
@@ -9425,19 +9425,35 @@ class KitMobileMenuComponent {
9425
9425
  this.navListFooter = contentChild('navListFooter', ...(ngDevMode ? [{ debugName: "navListFooter" }] : []));
9426
9426
  this.kitSvgIcon = KitSvgIcon;
9427
9427
  this.selectedItem = this.store.selectSignal(KitMobileMenuState.selectedItem);
9428
+ this.displayedItems = combineLatest([
9429
+ this.store.select(KIT_USER_PERMISSIONS_STATE_TOKEN),
9430
+ toObservable(this.kitMobileMenuItems),
9431
+ ]).pipe(tap(([permissions]) => !Object.keys(permissions).length && this.store.dispatch(new FetchUserPermissions())), map(([permissions]) => this.filterMenuItemsByPermissions(permissions)));
9428
9432
  }
9429
9433
  setSelectedItem(item) {
9430
9434
  this.store.dispatch(new SetSelectedMobileMenuItem(item));
9431
9435
  }
9436
+ filterMenuItemsByPermissions(permissions) {
9437
+ if (!Object.keys(permissions).length) {
9438
+ return [];
9439
+ }
9440
+ return this.kitMobileMenuItems()
9441
+ .map(item => ({
9442
+ ...item,
9443
+ links: item.links.filter(link => !link.permissions || kitHasPermission(link.permissions, permissions)),
9444
+ }))
9445
+ .filter(item => item.links.length > 0);
9446
+ }
9432
9447
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: KitMobileMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
9433
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.3", type: KitMobileMenuComponent, isStandalone: true, selector: "kit-mobile-menu", inputs: { kitMobileMenuItems: { classPropertyName: "kitMobileMenuItems", publicName: "kitMobileMenuItems", isSignal: true, isRequired: true, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "categoryItem", first: true, predicate: ["categoryItem"], descendants: true, isSignal: true }, { propertyName: "linkItem", first: true, predicate: ["linkItem"], descendants: true, isSignal: true }, { propertyName: "navListFooter", first: true, predicate: ["navListFooter"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"mobile-menu\"\n [ngClass]=\"theme()\">\n @if (!selectedItem()) {\n <div class=\"mobile-menu-category-list\">\n @for (item of kitMobileMenuItems(); track item.key) {\n <div class=\"mobile-menu-category-item-wrapper\"\n (click)=\"setSelectedItem(item)\">\n <ng-container *ngTemplateOutlet=\"categoryItem(); context: { $implicit: item }\" />\n </div>\n }\n </div>\n } @else {\n <div class=\"mobile-menu-nav-list\">\n @for (item of selectedItem()?.links; track item) {\n <ng-container *ngTemplateOutlet=\"linkItem(); context: { $implicit: item, key: selectedItem()?.key }\" />\n }\n </div>\n\n <div class=\"mobile-menu-nav-list-footer\">\n <ng-container *ngTemplateOutlet=\"navListFooter(); context: { key: selectedItem()?.key }\" />\n </div>\n }\n</div>\n", styles: [".mobile-menu-category-list{display:grid;gap:25px;grid-template-columns:1fr 1fr;justify-content:center}.mobile-menu-category-item-wrapper{display:flex;flex-direction:column}.mobile-menu-nav-list{border:1px solid var(--ui-kit-color-grey-11);border-radius:15px;padding:25px;background-color:var(--ui-kit-color-white)}.mobile-menu-nav-list-footer{position:absolute;bottom:0;margin:25px 0;width:calc(100% - 50px)}.mobile-menu.dark .mobile-menu-nav-list{background-color:var(--ui-kit-color-navy)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
9448
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.3", type: KitMobileMenuComponent, isStandalone: true, selector: "kit-mobile-menu", inputs: { kitMobileMenuItems: { classPropertyName: "kitMobileMenuItems", publicName: "kitMobileMenuItems", isSignal: true, isRequired: true, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "categoryItem", first: true, predicate: ["categoryItem"], descendants: true, isSignal: true }, { propertyName: "linkItem", first: true, predicate: ["linkItem"], descendants: true, isSignal: true }, { propertyName: "navListFooter", first: true, predicate: ["navListFooter"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"mobile-menu\"\n [ngClass]=\"theme()\">\n @if (!selectedItem()) {\n <div class=\"mobile-menu-category-list\">\n @for (item of displayedItems | async; track item.key) {\n <div class=\"mobile-menu-category-item-wrapper\"\n (click)=\"setSelectedItem(item)\">\n <ng-container *ngTemplateOutlet=\"categoryItem(); context: { $implicit: item }\" />\n </div>\n }\n </div>\n } @else {\n <div class=\"mobile-menu-nav-list\">\n @for (item of selectedItem()?.links; track item) {\n <ng-container *ngTemplateOutlet=\"linkItem(); context: { $implicit: item, key: selectedItem()?.key }\" />\n }\n </div>\n\n <div class=\"mobile-menu-nav-list-footer\">\n <ng-container *ngTemplateOutlet=\"navListFooter(); context: { key: selectedItem()?.key }\" />\n </div>\n }\n</div>\n", styles: [".mobile-menu-category-list{display:grid;gap:25px;grid-template-columns:1fr 1fr;justify-content:center}.mobile-menu-category-item-wrapper{display:flex;flex-direction:column}.mobile-menu-nav-list{border:1px solid var(--ui-kit-color-grey-11);border-radius:15px;padding:25px;background-color:var(--ui-kit-color-white)}.mobile-menu-nav-list-footer{position:absolute;bottom:0;margin:25px 0;width:calc(100% - 50px)}.mobile-menu.dark .mobile-menu-nav-list{background-color:var(--ui-kit-color-navy)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
9434
9449
  }
9435
9450
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: KitMobileMenuComponent, decorators: [{
9436
9451
  type: Component,
9437
9452
  args: [{ selector: 'kit-mobile-menu', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
9438
9453
  NgTemplateOutlet,
9439
9454
  NgClass,
9440
- ], template: "<div class=\"mobile-menu\"\n [ngClass]=\"theme()\">\n @if (!selectedItem()) {\n <div class=\"mobile-menu-category-list\">\n @for (item of kitMobileMenuItems(); track item.key) {\n <div class=\"mobile-menu-category-item-wrapper\"\n (click)=\"setSelectedItem(item)\">\n <ng-container *ngTemplateOutlet=\"categoryItem(); context: { $implicit: item }\" />\n </div>\n }\n </div>\n } @else {\n <div class=\"mobile-menu-nav-list\">\n @for (item of selectedItem()?.links; track item) {\n <ng-container *ngTemplateOutlet=\"linkItem(); context: { $implicit: item, key: selectedItem()?.key }\" />\n }\n </div>\n\n <div class=\"mobile-menu-nav-list-footer\">\n <ng-container *ngTemplateOutlet=\"navListFooter(); context: { key: selectedItem()?.key }\" />\n </div>\n }\n</div>\n", styles: [".mobile-menu-category-list{display:grid;gap:25px;grid-template-columns:1fr 1fr;justify-content:center}.mobile-menu-category-item-wrapper{display:flex;flex-direction:column}.mobile-menu-nav-list{border:1px solid var(--ui-kit-color-grey-11);border-radius:15px;padding:25px;background-color:var(--ui-kit-color-white)}.mobile-menu-nav-list-footer{position:absolute;bottom:0;margin:25px 0;width:calc(100% - 50px)}.mobile-menu.dark .mobile-menu-nav-list{background-color:var(--ui-kit-color-navy)}\n"] }]
9455
+ AsyncPipe,
9456
+ ], template: "<div class=\"mobile-menu\"\n [ngClass]=\"theme()\">\n @if (!selectedItem()) {\n <div class=\"mobile-menu-category-list\">\n @for (item of displayedItems | async; track item.key) {\n <div class=\"mobile-menu-category-item-wrapper\"\n (click)=\"setSelectedItem(item)\">\n <ng-container *ngTemplateOutlet=\"categoryItem(); context: { $implicit: item }\" />\n </div>\n }\n </div>\n } @else {\n <div class=\"mobile-menu-nav-list\">\n @for (item of selectedItem()?.links; track item) {\n <ng-container *ngTemplateOutlet=\"linkItem(); context: { $implicit: item, key: selectedItem()?.key }\" />\n }\n </div>\n\n <div class=\"mobile-menu-nav-list-footer\">\n <ng-container *ngTemplateOutlet=\"navListFooter(); context: { key: selectedItem()?.key }\" />\n </div>\n }\n</div>\n", styles: [".mobile-menu-category-list{display:grid;gap:25px;grid-template-columns:1fr 1fr;justify-content:center}.mobile-menu-category-item-wrapper{display:flex;flex-direction:column}.mobile-menu-nav-list{border:1px solid var(--ui-kit-color-grey-11);border-radius:15px;padding:25px;background-color:var(--ui-kit-color-white)}.mobile-menu-nav-list-footer{position:absolute;bottom:0;margin:25px 0;width:calc(100% - 50px)}.mobile-menu.dark .mobile-menu-nav-list{background-color:var(--ui-kit-color-navy)}\n"] }]
9441
9457
  }] });
9442
9458
 
9443
9459
  class KitThemeService {