@wolkabout/commons 0.0.20 → 0.0.23

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.
@@ -4281,46 +4281,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
4281
4281
  }], ctorParameters: () => [{ type: SimpleDateTimePipe }], propDecorators: { timeSeries: [{ type: i0.Input, args: [{ isSignal: true, alias: "timeSeries", required: true }] }], desiredTimeFrame: [{ type: i0.Input, args: [{ isSignal: true, alias: "desiredTimeFrame", required: false }] }], primaryColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "primaryColor", required: false }] }] } });
4282
4282
 
4283
4283
  class CardLabeledValueComponent {
4284
- permission;
4285
- set permissions(permissions) {
4286
- this.permissions$.next(permissions ?? []);
4287
- }
4288
- set useAssetPermissions(useAssetPermissions) {
4289
- this.useAssetPermissions$.next(useAssetPermissions);
4290
- }
4291
- label = '';
4292
- editFunction;
4293
- icon = 'edit';
4294
- tooltip = '';
4295
- permissions$ = new BehaviorSubject([]);
4296
- useAssetPermissions$ = new BehaviorSubject(undefined);
4297
- hasPermission$ = this.permissions$.pipe(combineLatestWith(this.useAssetPermissions$), switchMap(([permissions, useAssetPermissions]) => useAssetPermissions
4298
- ? this.permission.hasAnyGlobalOrAssetPermission(permissions)
4299
- : this.permission.hasAnyPermission(permissions)));
4300
- hasPermission = toSignal(this.hasPermission$);
4301
- constructor(permission) {
4302
- this.permission = permission;
4303
- }
4304
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CardLabeledValueComponent, deps: [{ token: PermissionsService }], target: i0.ɵɵFactoryTarget.Component });
4305
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: CardLabeledValueComponent, isStandalone: true, selector: "app-card-labeled-value", inputs: { permissions: "permissions", useAssetPermissions: "useAssetPermissions", label: "label", editFunction: "editFunction", icon: "icon", tooltip: "tooltip" }, ngImport: i0, template: "<mat-card\r\n [ngClass]=\"{'cursor-pointer hover:bg-hover-color': editFunction && hasPermission() }\"\r\n [matTooltipDisabled]=\"!hasPermission()\" (click)=\"editFunction && hasPermission() ? editFunction() : null\"\r\n [matTooltip]=\"tooltip | translate\"\r\n matTooltipPosition=\"above\"\r\n class=\"h-full min-h-22\"\r\n>\r\n <div class=\"flex items-center justify-between p-4 gap-x-4 h-full\">\r\n <div class=\"flex flex-col w-full h-fit max-h-full overflow-hidden\">\r\n <div class=\"font-semibold\">{{ label | translate }}</div>\r\n <div class=\"text-mat-sys-primary flex h-fit max-h-full\">\r\n <ng-content/>\r\n </div>\r\n </div>\r\n @if (editFunction && hasPermission()) {\r\n <button mat-icon-button [ngClass]=\"icon === 'delete' ? 'text-mat-sys-on-error-container' : 'text-mat-sys-primary'\" (click)=\"editFunction(); $event.stopPropagation()\">\r\n <mat-icon>{{ icon }}</mat-icon>\r\n </button>\r\n }\r\n </div>\r\n</mat-card>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: i2.MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: i3.MatCheckboxModule }, { kind: "ngmodule", type: i4.MatToolbarModule }, { kind: "ngmodule", type: i5.MatMenuModule }, { kind: "ngmodule", type: i6.MatFormFieldModule }, { kind: "ngmodule", type: i7.MatTooltipModule }, { kind: "directive", type: i7.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: i8.MatSidenavModule }, { kind: "ngmodule", type: i9.MatTabsModule }, { kind: "ngmodule", type: i10.MatTableModule }, { kind: "ngmodule", type: i11.MatIconModule }, { kind: "component", type: i11.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: i12.MatCardModule }, { kind: "component", type: i12.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "ngmodule", type: i13.MatSelectModule }, { kind: "ngmodule", type: i14.MatDialogModule }, { kind: "ngmodule", type: i15.MatSortModule }, { kind: "ngmodule", type: i16.MatRadioModule }, { kind: "ngmodule", type: i17.MatRippleModule }, { kind: "ngmodule", type: i18.MatDividerModule }, { kind: "ngmodule", type: i19.MatInputModule }, { kind: "ngmodule", type: i20.MatProgressBarModule }, { kind: "ngmodule", type: i21.MatProgressSpinnerModule }, { kind: "ngmodule", type: i22.MatTreeModule }, { kind: "ngmodule", type: i23.MatExpansionModule }, { kind: "ngmodule", type: i24.MatDatepickerModule }, { kind: "ngmodule", type: i25.MatAutocompleteModule }, { kind: "ngmodule", type: i26.MatChipsModule }, { kind: "ngmodule", type: i27.MatGridListModule }, { kind: "ngmodule", type: i28.MatPaginatorModule }, { kind: "ngmodule", type: i29.MatSliderModule }, { kind: "ngmodule", type: i1$1.TranslateModule }, { kind: "ngmodule", type: i30.ReactiveFormsModule }, { kind: "ngmodule", type: i31.CommonModule }, { kind: "directive", type: i31.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: i32.DragDropModule }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
4284
+ permissionService = inject(PermissionsService);
4285
+ permissions = input(...(ngDevMode ? [undefined, { debugName: "permissions" }] : []));
4286
+ useAssetPermissions = input(false, ...(ngDevMode ? [{ debugName: "useAssetPermissions" }] : []));
4287
+ label = input.required(...(ngDevMode ? [{ debugName: "label" }] : []));
4288
+ icon = input(...(ngDevMode ? [undefined, { debugName: "icon" }] : []));
4289
+ tooltip = input(...(ngDevMode ? [undefined, { debugName: "tooltip" }] : []));
4290
+ editFunction = input(...(ngDevMode ? [undefined, { debugName: "editFunction" }] : []));
4291
+ permissionFunction = computed(() => {
4292
+ const requiredPermissions = this.permissions();
4293
+ if (!requiredPermissions) {
4294
+ return of(true);
4295
+ }
4296
+ return this.useAssetPermissions()
4297
+ ? this.permissionService.hasAnyGlobalOrAssetPermission(requiredPermissions)
4298
+ : this.permissionService.hasAnyPermission(requiredPermissions);
4299
+ }, ...(ngDevMode ? [{ debugName: "permissionFunction" }] : []));
4300
+ hasPermission = toSignal(this.permissionFunction());
4301
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CardLabeledValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4302
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: CardLabeledValueComponent, isStandalone: true, selector: "app-card-labeled-value", inputs: { permissions: { classPropertyName: "permissions", publicName: "permissions", isSignal: true, isRequired: false, transformFunction: null }, useAssetPermissions: { classPropertyName: "useAssetPermissions", publicName: "useAssetPermissions", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, editFunction: { classPropertyName: "editFunction", publicName: "editFunction", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mat-card\r\n [ngClass]=\"{'cursor-pointer hover:bg-hover-color': editFunction() && hasPermission() }\"\r\n [matTooltipDisabled]=\"!hasPermission()\" (click)=\"editFunction() && hasPermission() ? editFunction()!() : null\"\r\n [matTooltip]=\"tooltip() | translate\"\r\n matTooltipPosition=\"above\"\r\n class=\"h-full min-h-22\"\r\n>\r\n <div class=\"flex items-center justify-between p-4 gap-x-4 h-full\">\r\n <div class=\"flex flex-col w-full h-fit max-h-full overflow-hidden\">\r\n <div class=\"font-semibold\">{{ label() | translate }}</div>\r\n <div class=\"text-mat-sys-primary flex h-fit max-h-full\">\r\n <ng-content/>\r\n </div>\r\n </div>\r\n @if (editFunction() && hasPermission()) {\r\n <button mat-icon-button [ngClass]=\"icon() === 'delete' ? 'text-mat-sys-on-error-container' : 'text-mat-sys-primary'\" (click)=\"editFunction(); $event.stopPropagation()\">\r\n <mat-icon>{{ icon }}</mat-icon>\r\n </button>\r\n }\r\n </div>\r\n</mat-card>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: i2.MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: i3.MatCheckboxModule }, { kind: "ngmodule", type: i4.MatToolbarModule }, { kind: "ngmodule", type: i5.MatMenuModule }, { kind: "ngmodule", type: i6.MatFormFieldModule }, { kind: "ngmodule", type: i7.MatTooltipModule }, { kind: "directive", type: i7.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: i8.MatSidenavModule }, { kind: "ngmodule", type: i9.MatTabsModule }, { kind: "ngmodule", type: i10.MatTableModule }, { kind: "ngmodule", type: i11.MatIconModule }, { kind: "component", type: i11.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: i12.MatCardModule }, { kind: "component", type: i12.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "ngmodule", type: i13.MatSelectModule }, { kind: "ngmodule", type: i14.MatDialogModule }, { kind: "ngmodule", type: i15.MatSortModule }, { kind: "ngmodule", type: i16.MatRadioModule }, { kind: "ngmodule", type: i17.MatRippleModule }, { kind: "ngmodule", type: i18.MatDividerModule }, { kind: "ngmodule", type: i19.MatInputModule }, { kind: "ngmodule", type: i20.MatProgressBarModule }, { kind: "ngmodule", type: i21.MatProgressSpinnerModule }, { kind: "ngmodule", type: i22.MatTreeModule }, { kind: "ngmodule", type: i23.MatExpansionModule }, { kind: "ngmodule", type: i24.MatDatepickerModule }, { kind: "ngmodule", type: i25.MatAutocompleteModule }, { kind: "ngmodule", type: i26.MatChipsModule }, { kind: "ngmodule", type: i27.MatGridListModule }, { kind: "ngmodule", type: i28.MatPaginatorModule }, { kind: "ngmodule", type: i29.MatSliderModule }, { kind: "ngmodule", type: i1$1.TranslateModule }, { kind: "ngmodule", type: i30.ReactiveFormsModule }, { kind: "ngmodule", type: i31.CommonModule }, { kind: "directive", type: i31.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: i32.DragDropModule }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
4306
4303
  }
4307
4304
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CardLabeledValueComponent, decorators: [{
4308
4305
  type: Component,
4309
- args: [{ selector: 'app-card-labeled-value', imports: [shared], template: "<mat-card\r\n [ngClass]=\"{'cursor-pointer hover:bg-hover-color': editFunction && hasPermission() }\"\r\n [matTooltipDisabled]=\"!hasPermission()\" (click)=\"editFunction && hasPermission() ? editFunction() : null\"\r\n [matTooltip]=\"tooltip | translate\"\r\n matTooltipPosition=\"above\"\r\n class=\"h-full min-h-22\"\r\n>\r\n <div class=\"flex items-center justify-between p-4 gap-x-4 h-full\">\r\n <div class=\"flex flex-col w-full h-fit max-h-full overflow-hidden\">\r\n <div class=\"font-semibold\">{{ label | translate }}</div>\r\n <div class=\"text-mat-sys-primary flex h-fit max-h-full\">\r\n <ng-content/>\r\n </div>\r\n </div>\r\n @if (editFunction && hasPermission()) {\r\n <button mat-icon-button [ngClass]=\"icon === 'delete' ? 'text-mat-sys-on-error-container' : 'text-mat-sys-primary'\" (click)=\"editFunction(); $event.stopPropagation()\">\r\n <mat-icon>{{ icon }}</mat-icon>\r\n </button>\r\n }\r\n </div>\r\n</mat-card>\r\n" }]
4310
- }], ctorParameters: () => [{ type: PermissionsService }], propDecorators: { permissions: [{
4311
- type: Input
4312
- }], useAssetPermissions: [{
4313
- type: Input
4314
- }], label: [{
4315
- type: Input,
4316
- args: [{ required: true }]
4317
- }], editFunction: [{
4318
- type: Input
4319
- }], icon: [{
4320
- type: Input
4321
- }], tooltip: [{
4322
- type: Input
4323
- }] } });
4306
+ args: [{ selector: 'app-card-labeled-value', imports: [shared], template: "<mat-card\r\n [ngClass]=\"{'cursor-pointer hover:bg-hover-color': editFunction() && hasPermission() }\"\r\n [matTooltipDisabled]=\"!hasPermission()\" (click)=\"editFunction() && hasPermission() ? editFunction()!() : null\"\r\n [matTooltip]=\"tooltip() | translate\"\r\n matTooltipPosition=\"above\"\r\n class=\"h-full min-h-22\"\r\n>\r\n <div class=\"flex items-center justify-between p-4 gap-x-4 h-full\">\r\n <div class=\"flex flex-col w-full h-fit max-h-full overflow-hidden\">\r\n <div class=\"font-semibold\">{{ label() | translate }}</div>\r\n <div class=\"text-mat-sys-primary flex h-fit max-h-full\">\r\n <ng-content/>\r\n </div>\r\n </div>\r\n @if (editFunction() && hasPermission()) {\r\n <button mat-icon-button [ngClass]=\"icon() === 'delete' ? 'text-mat-sys-on-error-container' : 'text-mat-sys-primary'\" (click)=\"editFunction(); $event.stopPropagation()\">\r\n <mat-icon>{{ icon }}</mat-icon>\r\n </button>\r\n }\r\n </div>\r\n</mat-card>\r\n" }]
4307
+ }], propDecorators: { permissions: [{ type: i0.Input, args: [{ isSignal: true, alias: "permissions", required: false }] }], useAssetPermissions: [{ type: i0.Input, args: [{ isSignal: true, alias: "useAssetPermissions", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], editFunction: [{ type: i0.Input, args: [{ isSignal: true, alias: "editFunction", required: false }] }] } });
4324
4308
 
4325
4309
  class ConfirmationDialogComponent {
4326
4310
  data;