@meshmakers/octo-ui 3.3.590 → 3.3.600

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,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, Component, Injectable, EventEmitter, Output, Input, ElementRef, forwardRef, ViewChild, signal, computed, makeEnvironmentProviders } from '@angular/core';
2
+ import { inject, Component, Injectable, EventEmitter, Output, Input, ElementRef, forwardRef, ViewChild, signal, computed, HostListener, makeEnvironmentProviders } from '@angular/core';
3
3
  import { AttributeSelectorService, AttributeValueTypeDto as AttributeValueTypeDto$1, CkTypeAttributeService, CkTypeSelectorService, GetEntitiesByCkTypeDtoGQL, RuntimeEntitySelectDataSource, RuntimeEntityDialogDataSource, SearchFilterTypesDto, SortOrdersDto, FieldFilterOperatorsDto, provideOctoServices } from '@meshmakers/octo-services';
4
4
  import { WindowStateService, EntitySelectInputComponent, DataSourceTyped, HierarchyDataSourceBase, NotificationDisplayService, provideMmSharedUi } from '@meshmakers/shared-ui';
5
5
  import { provideMmSharedAuth } from '@meshmakers/shared-auth';
@@ -10,14 +10,14 @@ import { FormsModule, FormControl, ReactiveFormsModule, NG_VALUE_ACCESSOR, NG_VA
10
10
  import * as i3 from '@progress/kendo-angular-grid';
11
11
  import { GridModule } from '@progress/kendo-angular-grid';
12
12
  import * as i4 from '@progress/kendo-angular-buttons';
13
- import { ButtonsModule, ButtonModule } from '@progress/kendo-angular-buttons';
13
+ import { ButtonsModule, ButtonModule, ButtonComponent } from '@progress/kendo-angular-buttons';
14
14
  import * as i5 from '@progress/kendo-angular-inputs';
15
15
  import { InputsModule } from '@progress/kendo-angular-inputs';
16
16
  import * as i3$1 from '@progress/kendo-angular-dropdowns';
17
17
  import { DropDownListModule, DropDownsModule, AutoCompleteModule } from '@progress/kendo-angular-dropdowns';
18
18
  import * as i5$1 from '@progress/kendo-angular-icons';
19
- import { IconsModule, SVGIconModule } from '@progress/kendo-angular-icons';
20
- import { searchIcon, sortAscSmallIcon, sortDescSmallIcon, chevronRightIcon, chevronDownIcon, downloadIcon, fileIcon, folderIcon, calendarIcon, checkboxCheckedIcon, listUnorderedIcon, filterClearIcon, arrowRightIcon, arrowLeftIcon, chevronDoubleRightIcon, chevronDoubleLeftIcon, arrowUpIcon, arrowDownIcon, pencilIcon, trashIcon, plusIcon, minusIcon, dollarIcon, copyIcon } from '@progress/kendo-svg-icons';
19
+ import { IconsModule, SVGIconModule, SVGIconComponent } from '@progress/kendo-angular-icons';
20
+ import { searchIcon, sortAscSmallIcon, sortDescSmallIcon, chevronRightIcon, chevronDownIcon, downloadIcon, fileIcon, folderIcon, calendarIcon, checkboxCheckedIcon, listUnorderedIcon, filterClearIcon, arrowRightIcon, arrowLeftIcon, chevronDoubleRightIcon, chevronDoubleLeftIcon, arrowUpIcon, arrowDownIcon, pencilIcon, trashIcon, plusIcon, minusIcon, dollarIcon, copyIcon, arrowRotateCwIcon } from '@progress/kendo-svg-icons';
21
21
  import { WindowRef, WindowModule, WindowService, WindowCloseResult } from '@progress/kendo-angular-dialog';
22
22
  import { Subject, firstValueFrom, of, forkJoin, Subscription } from 'rxjs';
23
23
  import { debounceTime, distinctUntilChanged, switchMap, map, tap, catchError } from 'rxjs/operators';
@@ -25,7 +25,7 @@ import { LoaderModule } from '@progress/kendo-angular-indicators';
25
25
  import { isCompositeFilterDescriptor } from '@progress/kendo-data-query';
26
26
  import * as i6 from '@progress/kendo-angular-dateinputs';
27
27
  import { DateInputsModule } from '@progress/kendo-angular-dateinputs';
28
- import { PopupModule } from '@progress/kendo-angular-popup';
28
+ import { PopupModule, PopupComponent } from '@progress/kendo-angular-popup';
29
29
  import { IntlModule } from '@progress/kendo-angular-intl';
30
30
 
31
31
  class AttributeSortSelectorDialogComponent {
@@ -5235,6 +5235,159 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
5235
5235
  type: Input
5236
5236
  }] } });
5237
5237
 
5238
+ class TenantSwitcherComponent {
5239
+ currentTenantId = null;
5240
+ allowedTenants = [];
5241
+ isDenied = false;
5242
+ tenantSelected = new EventEmitter();
5243
+ refreshRequested = new EventEmitter();
5244
+ refreshIcon = arrowRotateCwIcon;
5245
+ isRefreshing = false;
5246
+ anchor = null;
5247
+ popup = null;
5248
+ showPopup = false;
5249
+ onKeydown(event) {
5250
+ if (event.code === 'Escape') {
5251
+ this.showPopup = false;
5252
+ }
5253
+ }
5254
+ onDocumentClick(event) {
5255
+ if (!this.contains(event.target)) {
5256
+ this.showPopup = false;
5257
+ }
5258
+ }
5259
+ onToggle() {
5260
+ if (!this.isDenied) {
5261
+ this.showPopup = !this.showPopup;
5262
+ }
5263
+ }
5264
+ onSelectTenant(tenantId) {
5265
+ if (tenantId !== this.currentTenantId) {
5266
+ this.tenantSelected.emit(tenantId);
5267
+ }
5268
+ this.showPopup = false;
5269
+ }
5270
+ onRefresh(event) {
5271
+ event.stopPropagation();
5272
+ if (!this.isRefreshing) {
5273
+ this.isRefreshing = true;
5274
+ this.refreshRequested.emit();
5275
+ // Reset spinning after a short delay to give visual feedback
5276
+ setTimeout(() => this.isRefreshing = false, 1500);
5277
+ }
5278
+ }
5279
+ contains(target) {
5280
+ return ((this.anchor?.nativeElement.contains(target) ?? false) ||
5281
+ (this.popup?.nativeElement.contains(target) ?? false));
5282
+ }
5283
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: TenantSwitcherComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
5284
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: TenantSwitcherComponent, isStandalone: true, selector: "mm-tenant-switcher", inputs: { currentTenantId: "currentTenantId", allowedTenants: "allowedTenants", isDenied: "isDenied" }, outputs: { tenantSelected: "tenantSelected", refreshRequested: "refreshRequested" }, host: { listeners: { "document:keydown": "onKeydown($event)", "document:click": "onDocumentClick($event)" } }, viewQueries: [{ propertyName: "anchor", first: true, predicate: ["badgeEl"], descendants: true, read: ElementRef }, { propertyName: "popup", first: true, predicate: ["popupContent"], descendants: true, read: ElementRef }], ngImport: i0, template: `
5285
+ @if (currentTenantId) {
5286
+ <div #badgeEl class="tenant-badge" [class.denied]="isDenied" (click)="onToggle()">
5287
+ <span class="tenant-icon">{{ isDenied ? '\u26A0' : '\u25C6' }}</span>
5288
+ <span class="tenant-name">{{ currentTenantId }}</span>
5289
+ @if (isDenied) {
5290
+ <span class="denied-label">NO ACCESS</span>
5291
+ }
5292
+ </div>
5293
+
5294
+ @if (showPopup && !isDenied) {
5295
+ <kendo-popup #popupContent [anchor]="badgeEl"
5296
+ (anchorViewportLeave)="showPopup = false">
5297
+ <div class="tenant-popup">
5298
+ <div class="tenant-popup-header">
5299
+ <span>Switch Tenant</span>
5300
+ <button kendoButton fillMode="flat" size="small" class="refresh-btn"
5301
+ [disabled]="isRefreshing"
5302
+ title="Refresh tenant list"
5303
+ (click)="onRefresh($event)">
5304
+ <kendo-svgicon [icon]="refreshIcon" size="small"
5305
+ [class.spinning]="isRefreshing"></kendo-svgicon>
5306
+ </button>
5307
+ </div>
5308
+ <ul class="tenant-list">
5309
+ @for (tenant of allowedTenants; track tenant) {
5310
+ <li class="tenant-list-item" [class.active]="tenant === currentTenantId"
5311
+ (click)="onSelectTenant(tenant)">
5312
+ <span class="tenant-list-icon">&#9670;</span>
5313
+ <span>{{ tenant }}</span>
5314
+ </li>
5315
+ }
5316
+ </ul>
5317
+ </div>
5318
+ </kendo-popup>
5319
+ }
5320
+ }
5321
+ `, isInline: true, styles: [":host{display:inline-flex;align-items:center}.tenant-badge{display:flex;align-items:center;gap:8px;padding:6px 14px;background:var(--mm-tenant-switcher-bg, var(--kendo-color-surface, transparent));border:1px solid var(--mm-tenant-switcher-border, var(--kendo-color-border, #dee2e6));border-radius:var(--mm-tenant-switcher-radius, 4px 16px 16px 4px);box-shadow:var(--mm-tenant-switcher-shadow, none);cursor:pointer;transition:all .2s ease}.tenant-badge:hover{background:var(--mm-tenant-switcher-bg-hover, var(--kendo-color-base-hover, rgba(0, 0, 0, .04)));box-shadow:var(--mm-tenant-switcher-shadow-hover, var(--mm-tenant-switcher-shadow, none))}.tenant-icon{font-size:.7rem;color:var(--mm-tenant-switcher-accent, var(--kendo-color-primary, #ff6358));animation:var(--mm-tenant-switcher-icon-animation, none)}.tenant-name{font-family:var(--mm-tenant-switcher-font, inherit);font-size:.85rem;font-weight:600;letter-spacing:1px;color:var(--mm-tenant-switcher-accent, var(--kendo-color-primary, #ff6358));text-transform:uppercase;text-shadow:var(--mm-tenant-switcher-text-shadow, none)}.denied{background:var(--mm-tenant-switcher-denied-bg, var(--mm-tenant-switcher-bg, var(--kendo-color-surface, transparent)));border-color:var(--mm-tenant-switcher-denied-border, var(--kendo-color-error, #d9534f));box-shadow:var(--mm-tenant-switcher-denied-shadow, none)}.denied .tenant-icon,.denied .tenant-name{color:var(--mm-tenant-switcher-denied-accent, var(--kendo-color-error, #d9534f));text-shadow:var(--mm-tenant-switcher-denied-text-shadow, none)}.denied-label{font-family:var(--mm-tenant-switcher-font, inherit);font-size:.55rem;font-weight:700;letter-spacing:1px;color:var(--mm-tenant-switcher-denied-accent, var(--kendo-color-error, #d9534f));background:var(--mm-tenant-switcher-denied-label-bg, color-mix(in srgb, var(--kendo-color-error, #d9534f) 15%, transparent));padding:2px 6px;border-radius:3px}.tenant-popup{min-width:220px;padding:8px 0;background:var(--kendo-color-surface, #fff);border:1px solid var(--kendo-color-border, #dee2e6);border-radius:4px}.tenant-popup-header{display:flex;align-items:center;justify-content:space-between;padding:8px 16px;font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:var(--kendo-color-subtle, #666);border-bottom:1px solid var(--kendo-color-border, #dee2e6);margin-bottom:4px}.refresh-btn{padding:2px;min-width:unset}.spinning{animation:spin .8s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.tenant-list{list-style:none;margin:0;padding:0}.tenant-list-item{display:flex;align-items:center;gap:10px;padding:8px 16px;cursor:pointer;font-size:.85rem;transition:background .15s ease}.tenant-list-item:hover{background:var(--kendo-color-base-hover, rgba(0, 0, 0, .04))}.tenant-list-item.active{color:var(--kendo-color-primary, #ff6358);font-weight:600}.tenant-list-icon{font-size:.5rem;color:var(--kendo-color-subtle, #666)}.tenant-list-item.active .tenant-list-icon{color:var(--kendo-color-primary, #ff6358)}@keyframes mm-icon-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.7;transform:scale(1.1)}}\n"], dependencies: [{ kind: "component", type: PopupComponent, selector: "kendo-popup", inputs: ["animate", "anchor", "anchorAlign", "collision", "popupAlign", "copyAnchorStyles", "popupClass", "positionMode", "offset", "margin"], outputs: ["anchorViewportLeave", "close", "open", "positionChange"], exportAs: ["kendo-popup"] }, { kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "component", type: SVGIconComponent, selector: "kendo-svg-icon, kendo-svgicon", inputs: ["icon"], exportAs: ["kendoSVGIcon"] }] });
5322
+ }
5323
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: TenantSwitcherComponent, decorators: [{
5324
+ type: Component,
5325
+ args: [{ selector: 'mm-tenant-switcher', standalone: true, imports: [
5326
+ PopupComponent,
5327
+ ButtonComponent,
5328
+ SVGIconComponent
5329
+ ], template: `
5330
+ @if (currentTenantId) {
5331
+ <div #badgeEl class="tenant-badge" [class.denied]="isDenied" (click)="onToggle()">
5332
+ <span class="tenant-icon">{{ isDenied ? '\u26A0' : '\u25C6' }}</span>
5333
+ <span class="tenant-name">{{ currentTenantId }}</span>
5334
+ @if (isDenied) {
5335
+ <span class="denied-label">NO ACCESS</span>
5336
+ }
5337
+ </div>
5338
+
5339
+ @if (showPopup && !isDenied) {
5340
+ <kendo-popup #popupContent [anchor]="badgeEl"
5341
+ (anchorViewportLeave)="showPopup = false">
5342
+ <div class="tenant-popup">
5343
+ <div class="tenant-popup-header">
5344
+ <span>Switch Tenant</span>
5345
+ <button kendoButton fillMode="flat" size="small" class="refresh-btn"
5346
+ [disabled]="isRefreshing"
5347
+ title="Refresh tenant list"
5348
+ (click)="onRefresh($event)">
5349
+ <kendo-svgicon [icon]="refreshIcon" size="small"
5350
+ [class.spinning]="isRefreshing"></kendo-svgicon>
5351
+ </button>
5352
+ </div>
5353
+ <ul class="tenant-list">
5354
+ @for (tenant of allowedTenants; track tenant) {
5355
+ <li class="tenant-list-item" [class.active]="tenant === currentTenantId"
5356
+ (click)="onSelectTenant(tenant)">
5357
+ <span class="tenant-list-icon">&#9670;</span>
5358
+ <span>{{ tenant }}</span>
5359
+ </li>
5360
+ }
5361
+ </ul>
5362
+ </div>
5363
+ </kendo-popup>
5364
+ }
5365
+ }
5366
+ `, styles: [":host{display:inline-flex;align-items:center}.tenant-badge{display:flex;align-items:center;gap:8px;padding:6px 14px;background:var(--mm-tenant-switcher-bg, var(--kendo-color-surface, transparent));border:1px solid var(--mm-tenant-switcher-border, var(--kendo-color-border, #dee2e6));border-radius:var(--mm-tenant-switcher-radius, 4px 16px 16px 4px);box-shadow:var(--mm-tenant-switcher-shadow, none);cursor:pointer;transition:all .2s ease}.tenant-badge:hover{background:var(--mm-tenant-switcher-bg-hover, var(--kendo-color-base-hover, rgba(0, 0, 0, .04)));box-shadow:var(--mm-tenant-switcher-shadow-hover, var(--mm-tenant-switcher-shadow, none))}.tenant-icon{font-size:.7rem;color:var(--mm-tenant-switcher-accent, var(--kendo-color-primary, #ff6358));animation:var(--mm-tenant-switcher-icon-animation, none)}.tenant-name{font-family:var(--mm-tenant-switcher-font, inherit);font-size:.85rem;font-weight:600;letter-spacing:1px;color:var(--mm-tenant-switcher-accent, var(--kendo-color-primary, #ff6358));text-transform:uppercase;text-shadow:var(--mm-tenant-switcher-text-shadow, none)}.denied{background:var(--mm-tenant-switcher-denied-bg, var(--mm-tenant-switcher-bg, var(--kendo-color-surface, transparent)));border-color:var(--mm-tenant-switcher-denied-border, var(--kendo-color-error, #d9534f));box-shadow:var(--mm-tenant-switcher-denied-shadow, none)}.denied .tenant-icon,.denied .tenant-name{color:var(--mm-tenant-switcher-denied-accent, var(--kendo-color-error, #d9534f));text-shadow:var(--mm-tenant-switcher-denied-text-shadow, none)}.denied-label{font-family:var(--mm-tenant-switcher-font, inherit);font-size:.55rem;font-weight:700;letter-spacing:1px;color:var(--mm-tenant-switcher-denied-accent, var(--kendo-color-error, #d9534f));background:var(--mm-tenant-switcher-denied-label-bg, color-mix(in srgb, var(--kendo-color-error, #d9534f) 15%, transparent));padding:2px 6px;border-radius:3px}.tenant-popup{min-width:220px;padding:8px 0;background:var(--kendo-color-surface, #fff);border:1px solid var(--kendo-color-border, #dee2e6);border-radius:4px}.tenant-popup-header{display:flex;align-items:center;justify-content:space-between;padding:8px 16px;font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:var(--kendo-color-subtle, #666);border-bottom:1px solid var(--kendo-color-border, #dee2e6);margin-bottom:4px}.refresh-btn{padding:2px;min-width:unset}.spinning{animation:spin .8s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.tenant-list{list-style:none;margin:0;padding:0}.tenant-list-item{display:flex;align-items:center;gap:10px;padding:8px 16px;cursor:pointer;font-size:.85rem;transition:background .15s ease}.tenant-list-item:hover{background:var(--kendo-color-base-hover, rgba(0, 0, 0, .04))}.tenant-list-item.active{color:var(--kendo-color-primary, #ff6358);font-weight:600}.tenant-list-icon{font-size:.5rem;color:var(--kendo-color-subtle, #666)}.tenant-list-item.active .tenant-list-icon{color:var(--kendo-color-primary, #ff6358)}@keyframes mm-icon-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.7;transform:scale(1.1)}}\n"] }]
5367
+ }], propDecorators: { currentTenantId: [{
5368
+ type: Input
5369
+ }], allowedTenants: [{
5370
+ type: Input
5371
+ }], isDenied: [{
5372
+ type: Input
5373
+ }], tenantSelected: [{
5374
+ type: Output
5375
+ }], refreshRequested: [{
5376
+ type: Output
5377
+ }], anchor: [{
5378
+ type: ViewChild,
5379
+ args: ['badgeEl', { read: ElementRef }]
5380
+ }], popup: [{
5381
+ type: ViewChild,
5382
+ args: ['popupContent', { read: ElementRef }]
5383
+ }], onKeydown: [{
5384
+ type: HostListener,
5385
+ args: ['document:keydown', ['$event']]
5386
+ }], onDocumentClick: [{
5387
+ type: HostListener,
5388
+ args: ['document:click', ['$event']]
5389
+ }] } });
5390
+
5238
5391
  /*
5239
5392
  * Public API Surface of octo-ui
5240
5393
  */
@@ -5258,5 +5411,5 @@ function provideOctoUi() {
5258
5411
  * Generated bundle index. Do not edit.
5259
5412
  */
5260
5413
 
5261
- export { AttributeSelectorDialogComponent, AttributeSelectorDialogService, AttributeSortSelectorDialogComponent, AttributeSortSelectorDialogService, AttributeValueTypeDto, CkTypeSelectorDialogComponent, CkTypeSelectorDialogService, CkTypeSelectorInputComponent, DefaultPropertyCategory, EntityIdInfoComponent, FieldFilterEditorComponent, OctoGraphQlDataSource, OctoGraphQlHierarchyDataSource, OctoLoaderComponent, PropertyConverterService, PropertyDisplayMode, PropertyGridComponent, PropertyValueDisplayComponent, RuntimeEntityVariableDialogComponent, RuntimeEntityVariableDialogService, provideOctoUi };
5414
+ export { AttributeSelectorDialogComponent, AttributeSelectorDialogService, AttributeSortSelectorDialogComponent, AttributeSortSelectorDialogService, AttributeValueTypeDto, CkTypeSelectorDialogComponent, CkTypeSelectorDialogService, CkTypeSelectorInputComponent, DefaultPropertyCategory, EntityIdInfoComponent, FieldFilterEditorComponent, OctoGraphQlDataSource, OctoGraphQlHierarchyDataSource, OctoLoaderComponent, PropertyConverterService, PropertyDisplayMode, PropertyGridComponent, PropertyValueDisplayComponent, RuntimeEntityVariableDialogComponent, RuntimeEntityVariableDialogService, TenantSwitcherComponent, provideOctoUi };
5262
5415
  //# sourceMappingURL=meshmakers-octo-ui.mjs.map