@wolkabout/commons 0.0.54 → 0.0.57

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wolkabout/commons",
3
- "version": "0.0.54",
3
+ "version": "0.0.57",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "21.2.0",
6
6
  "@angular/common": "21.2.0",
@@ -90,6 +90,7 @@ interface Authority {
90
90
  contextName: string;
91
91
  mainContext: boolean;
92
92
  active: boolean;
93
+ favorite: boolean;
93
94
  accessToken: string;
94
95
  roleNames: string[];
95
96
  permissions: string[];
@@ -99,6 +100,12 @@ interface Authentication {
99
100
  authorities: Authority[];
100
101
  refreshToken: string;
101
102
  }
103
+ /**
104
+ * Checks if the user can edit something based on the context.
105
+ * The main context (context with ID 1) is special and can expose its assets to other contexts.
106
+ * The asset should be editable only if the user (using its authority) and the asset are in the same context.
107
+ * The isMainContext is a bit simplified parameter because only the main context can share its assets, and we only care if it is in the main tenant, or any other.
108
+ */
102
109
  declare function isContextAccessible(authority: Authority, isMainContext: boolean): boolean;
103
110
 
104
111
  interface ImportError {
@@ -157,7 +164,9 @@ declare class AuthenticationService {
157
164
  private _authenticationTokens;
158
165
  constructor();
159
166
  setAuthentication(authentication: Authentication): void;
167
+ setAuthorityFavorite(contextId: number, favorite: boolean): void;
160
168
  updateUserName(firstName: string, lastName: string): void;
169
+ private sortAuthorities;
161
170
  private initiateAuthenticatedState;
162
171
  selectAuthority(authority: Authority): void;
163
172
  logout(): void;
@@ -355,12 +364,6 @@ declare class MessageTooltipDirective implements OnDestroy {
355
364
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MessageTooltipDirective, "[appMessageTooltip]", never, { "tooltipTemplate": { "alias": "appMessageTooltip"; "required": false; }; }, {}, never, never, true, never>;
356
365
  }
357
366
 
358
- declare class NgTemplateContentDirective {
359
- template: TemplateRef<any>;
360
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgTemplateContentDirective, never>;
361
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgTemplateContentDirective, "[appNgTemplateContent]", never, {}, {}, never, never, true, never>;
362
- }
363
-
364
367
  declare class OverflowClassDirective implements AfterViewInit, AfterViewChecked {
365
368
  private el;
366
369
  overflowClass: string | null;
@@ -587,10 +590,12 @@ declare class AutocompleteComponent<ItemType> implements ControlValueAccessor, O
587
590
  dataFunction: (query: string) => Observable<ItemType[] | null>;
588
591
  displayFunction: (item: ItemType) => string;
589
592
  outlineBackground: boolean;
593
+ hideRequiredMarker: boolean;
590
594
  dropdownTemplate?: TemplateRef<unknown>;
591
595
  autocompleteTrigger?: MatAutocompleteTrigger;
592
596
  protected readonly Object: ObjectConstructor;
593
597
  disabled: boolean;
598
+ hasValue: _angular_core.WritableSignal<boolean>;
594
599
  formControl: FormControl<string | ItemType>;
595
600
  data$: Observable<ItemType[] | null>;
596
601
  loading$: Observable<boolean>;
@@ -608,7 +613,7 @@ declare class AutocompleteComponent<ItemType> implements ControlValueAccessor, O
608
613
  private scrollEvent;
609
614
  ngOnDestroy(): void;
610
615
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AutocompleteComponent<any>, [{ optional: true; self: true; }]>;
611
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<AutocompleteComponent<any>, "app-autocomplete", never, { "name": { "alias": "name"; "required": false; }; "dataFunction": { "alias": "dataFunction"; "required": false; }; "displayFunction": { "alias": "displayFunction"; "required": false; }; "outlineBackground": { "alias": "outlineBackground"; "required": false; }; }, {}, ["dropdownTemplate"], never, true, never>;
616
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<AutocompleteComponent<any>, "app-autocomplete", never, { "name": { "alias": "name"; "required": false; }; "dataFunction": { "alias": "dataFunction"; "required": false; }; "displayFunction": { "alias": "displayFunction"; "required": false; }; "outlineBackground": { "alias": "outlineBackground"; "required": false; }; "hideRequiredMarker": { "alias": "hideRequiredMarker"; "required": false; }; }, {}, ["dropdownTemplate"], never, true, never>;
612
617
  }
613
618
 
614
619
  declare class AutocompleteChipsComponent<ItemType> implements OnInit, ControlValueAccessor, OnDestroy {
@@ -686,7 +691,7 @@ declare class CardLabeledValueComponent {
686
691
  tooltip: _angular_core.InputSignal<string | undefined>;
687
692
  editFunction: _angular_core.InputSignal<(() => void) | undefined>;
688
693
  permissionFunction: _angular_core.Signal<rxjs.Observable<boolean>>;
689
- hasPermission: _angular_core.Signal<boolean | undefined>;
694
+ hasPermission: _angular_core.Signal<boolean>;
690
695
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CardLabeledValueComponent, never>;
691
696
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<CardLabeledValueComponent, "app-card-labeled-value", never, { "permissions": { "alias": "permissions"; "required": false; "isSignal": true; }; "useAssetPermissions": { "alias": "useAssetPermissions"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "tooltip": { "alias": "tooltip"; "required": false; "isSignal": true; }; "editFunction": { "alias": "editFunction"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
692
697
  }
@@ -1052,7 +1057,7 @@ declare class NestedListViewComponent<ItemType> {
1052
1057
  children: _angular_core.WritableSignal<NestedListItem<ItemType>[]>;
1053
1058
  filteredChildren: _angular_core.Signal<NestedListItem<ItemType>[]>;
1054
1059
  itemSelected: _angular_core.OutputEmitterRef<ItemType | null>;
1055
- itemTemplate: _angular_core.InputSignal<TemplateRef<any> | null>;
1060
+ itemTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
1056
1061
  constructor(destroyRef: DestroyRef, dialog: MatDialog);
1057
1062
  private initiateState;
1058
1063
  selectBreadcrumb(item: NestedListItem<ItemType>): void;
@@ -1063,7 +1068,7 @@ declare class NestedListViewComponent<ItemType> {
1063
1068
  isAsyncIcon(item: NestedListItem<ItemType>): LoadedIcon | null;
1064
1069
  isSvgIcon(item: NestedListItem<ItemType>): SvgIcon | null;
1065
1070
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NestedListViewComponent<any>, never>;
1066
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<NestedListViewComponent<any>, "app-nested-list-view", never, { "dataSource": { "alias": "dataSource"; "required": true; "isSignal": true; }; "dataControl": { "alias": "dataControl"; "required": true; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "disableThresholdId": { "alias": "disableThresholdId"; "required": false; "isSignal": true; }; "hideDetails": { "alias": "hideDetails"; "required": false; "isSignal": true; }; "isColoredInput": { "alias": "isColoredInput"; "required": false; "isSignal": true; }; "searchActions": { "alias": "searchActions"; "required": false; "isSignal": true; }; "selectionConfirmationAction": { "alias": "selectionConfirmationAction"; "required": false; "isSignal": true; }; "hideSearch": { "alias": "hideSearch"; "required": false; "isSignal": true; }; "rootButtonText": { "alias": "rootButtonText"; "required": false; "isSignal": true; }; "enableDrag": { "alias": "enableDrag"; "required": false; "isSignal": true; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; "isSignal": true; }; }, { "dragging": "dragging"; "itemSelected": "itemSelected"; }, never, ["[app-no-items-message]", "[app-actions]", "[app-details]"], true, never>;
1071
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NestedListViewComponent<any>, "app-nested-list-view", never, { "dataSource": { "alias": "dataSource"; "required": true; "isSignal": true; }; "dataControl": { "alias": "dataControl"; "required": true; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "disableThresholdId": { "alias": "disableThresholdId"; "required": false; "isSignal": true; }; "hideDetails": { "alias": "hideDetails"; "required": false; "isSignal": true; }; "isColoredInput": { "alias": "isColoredInput"; "required": false; "isSignal": true; }; "searchActions": { "alias": "searchActions"; "required": false; "isSignal": true; }; "selectionConfirmationAction": { "alias": "selectionConfirmationAction"; "required": false; "isSignal": true; }; "hideSearch": { "alias": "hideSearch"; "required": false; "isSignal": true; }; "rootButtonText": { "alias": "rootButtonText"; "required": false; "isSignal": true; }; "enableDrag": { "alias": "enableDrag"; "required": false; "isSignal": true; }; }, { "dragging": "dragging"; "itemSelected": "itemSelected"; }, ["itemTemplate"], ["[app-no-items-message]", "[app-actions]", "[app-details]"], true, never>;
1067
1072
  }
1068
1073
 
1069
1074
  declare class PdfViewerComponent {
@@ -1158,7 +1163,7 @@ declare class StandardListViewComponent<ItemType> {
1158
1163
  items: _angular_core.WritableSignal<StandardListItem<ItemType>[]>;
1159
1164
  filteredItems: _angular_core.Signal<StandardListItem<ItemType>[]>;
1160
1165
  itemSelected: _angular_core.OutputEmitterRef<ItemType | null>;
1161
- content: _angular_core.Signal<NgTemplateContentDirective | undefined>;
1166
+ itemTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
1162
1167
  constructor(destroyRef: DestroyRef);
1163
1168
  selectItem(item: StandardListItem<ItemType>): void;
1164
1169
  selectEmpty(): void;
@@ -1166,7 +1171,7 @@ declare class StandardListViewComponent<ItemType> {
1166
1171
  isSvgIcon(item: StandardListItem<ItemType>): SvgIcon | null;
1167
1172
  loadMore(): void;
1168
1173
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<StandardListViewComponent<any>, never>;
1169
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<StandardListViewComponent<any>, "app-standard-list-view", never, { "dataSource": { "alias": "dataSource"; "required": true; "isSignal": true; }; "dataControl": { "alias": "dataControl"; "required": true; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "isColoredInput": { "alias": "isColoredInput"; "required": false; "isSignal": true; }; "hideSearch": { "alias": "hideSearch"; "required": false; "isSignal": true; }; "hideDetails": { "alias": "hideDetails"; "required": false; "isSignal": true; }; "hidePadding": { "alias": "hidePadding"; "required": false; "isSignal": true; }; }, { "itemSelected": "itemSelected"; }, ["content"], ["[app-no-items-message]", "[app-actions]", "[app-details]"], true, never>;
1174
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<StandardListViewComponent<any>, "app-standard-list-view", never, { "dataSource": { "alias": "dataSource"; "required": true; "isSignal": true; }; "dataControl": { "alias": "dataControl"; "required": true; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "isColoredInput": { "alias": "isColoredInput"; "required": false; "isSignal": true; }; "hideSearch": { "alias": "hideSearch"; "required": false; "isSignal": true; }; "hideDetails": { "alias": "hideDetails"; "required": false; "isSignal": true; }; "hidePadding": { "alias": "hidePadding"; "required": false; "isSignal": true; }; }, { "itemSelected": "itemSelected"; }, ["itemTemplate"], ["[app-no-items-message]", "[app-actions]", "[app-details]"], true, never>;
1170
1175
  }
1171
1176
 
1172
1177
  declare const LAST_ACTIVE_TAB_KEY = "WOLK_LAST_ACTIVE_TAB";
@@ -1532,5 +1537,5 @@ declare class ValueInputVectorComponent implements ControlValueAccessor, Validat
1532
1537
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ValueInputVectorComponent, "app-value-input-vector", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "showErrorInTooltip": { "alias": "showErrorInTooltip"; "required": false; "isSignal": true; }; "validators": { "alias": "validators"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1533
1538
  }
1534
1539
 
1535
- export { AUTHENTICATION_CLIENT, AssetManager, AuthenticationService, AutocompleteChipsComponent, AutocompleteComponent, BasicTimeSeriesGraphComponent, COLORS, CUSTOM_PERIOD, CardLabeledValueComponent, ConfirmationDialogComponent, DEFAULT_LOCALE, DEFAULT_TIMEZONES, DEFAULT_TIME_ZONE, DataType, DateRangeInputComponent, DateTimeFormFieldComponent, DragDropFileUploadComponent, DurationPipe, FeatureRegistry, GoogleMapComponent, ImageDisplayComponent, ImagePreviewComponent, LAST_ACTIVE_TAB_KEY, LOCALES, LabeledValueComponent, LoadedIconComponent, LoadingIndicatorDirective, LocalSortTableComponent, Locale, LocalizedNumberPipe, LocalizedNumericInputDirective, MILLISECONDS_IN_DAY, MapsLoaderService, MasterDetailsViewComponent, MessageTooltipDirective, MissingTranslationHelper, NestedListDataControl, NestedListDataSource, NestedListViewComponent, NgTemplateContentDirective, NotificationService, OverflowClassDirective, PdfViewerComponent, PeriodErrorStateMatcher, PermissionsService, RELATIVE_TIME_PERIODS, RelativeTimePeriod, RequiresAllGlobalOrAssetPermissionsDirective, RequiresAllPermissionDirective, RequiresGlobalOrAsserPermissionDirective, RequiresPermissionDirective, ScrollIntoViewDirective, SharedModule, SimpleDatePipe, SimpleDateTimePipe, SimpleTimePipe, SortPipe, StandardListDataControl, StandardListDataSource, StandardListViewComponent, TIMEZONES, TabulatedChipViewComponent, TabulatedViewComponent, TenantPropertiesService, ThemeService, TreeComponent, TreeNodeComponent, USERS_TIME_ZONE, ValueDisplayComponent, ValueInputBooleanComponent, ValueInputColorComponent, ValueInputComponent, ValueInputDateComponent, ValueInputDurationComponent, ValueInputEnumComponent, ValueInputHexadecimalComponent, ValueInputLinkComponent, ValueInputLocationComponent, ValueInputNumericComponent, ValueInputStringComponent, ValueInputVectorComponent, angularComponents, arrayToObject, chartThemeDark, chartThemeLight, daysAway, determineMagnitude, determineMinMaxValues, endOfPeriod, equalsByValue, fileSizeValidator, flatMap, flatten, format, formatDuration, generateRandomString, globalPermissionGuard, groupBy, hoursAway, isContextAccessible, lookUpPathPart, lookUpQueryParam, parseDateRangeInputPeriod, parseTimeInput, saveFile, scale, shared, startOfMonth, startOfPeriod, startOfTheDay, startOfWeek, startOfYear, toDate, toEndOfMonth, toEndOfYear, toJsDate, toOffset, toStartOfMonth, toStartOfTheDay, toStartOfWeek, toStartOfYear, toTime, uniqueBy, uniqueFrom, validateAssetName, validateTypeAssetName };
1540
+ export { AUTHENTICATION_CLIENT, AssetManager, AuthenticationService, AutocompleteChipsComponent, AutocompleteComponent, BasicTimeSeriesGraphComponent, COLORS, CUSTOM_PERIOD, CardLabeledValueComponent, ConfirmationDialogComponent, DEFAULT_LOCALE, DEFAULT_TIMEZONES, DEFAULT_TIME_ZONE, DataType, DateRangeInputComponent, DateTimeFormFieldComponent, DragDropFileUploadComponent, DurationPipe, FeatureRegistry, GoogleMapComponent, ImageDisplayComponent, ImagePreviewComponent, LAST_ACTIVE_TAB_KEY, LOCALES, LabeledValueComponent, LoadedIconComponent, LoadingIndicatorDirective, LocalSortTableComponent, Locale, LocalizedNumberPipe, LocalizedNumericInputDirective, MILLISECONDS_IN_DAY, MapsLoaderService, MasterDetailsViewComponent, MessageTooltipDirective, MissingTranslationHelper, NestedListDataControl, NestedListDataSource, NestedListViewComponent, NotificationService, OverflowClassDirective, PdfViewerComponent, PeriodErrorStateMatcher, PermissionsService, RELATIVE_TIME_PERIODS, RelativeTimePeriod, RequiresAllGlobalOrAssetPermissionsDirective, RequiresAllPermissionDirective, RequiresGlobalOrAsserPermissionDirective, RequiresPermissionDirective, ScrollIntoViewDirective, SharedModule, SimpleDatePipe, SimpleDateTimePipe, SimpleTimePipe, SortPipe, StandardListDataControl, StandardListDataSource, StandardListViewComponent, TIMEZONES, TabulatedChipViewComponent, TabulatedViewComponent, TenantPropertiesService, ThemeService, TreeComponent, TreeNodeComponent, USERS_TIME_ZONE, ValueDisplayComponent, ValueInputBooleanComponent, ValueInputColorComponent, ValueInputComponent, ValueInputDateComponent, ValueInputDurationComponent, ValueInputEnumComponent, ValueInputHexadecimalComponent, ValueInputLinkComponent, ValueInputLocationComponent, ValueInputNumericComponent, ValueInputStringComponent, ValueInputVectorComponent, angularComponents, arrayToObject, chartThemeDark, chartThemeLight, daysAway, determineMagnitude, determineMinMaxValues, endOfPeriod, equalsByValue, fileSizeValidator, flatMap, flatten, format, formatDuration, generateRandomString, globalPermissionGuard, groupBy, hoursAway, isContextAccessible, lookUpPathPart, lookUpQueryParam, parseDateRangeInputPeriod, parseTimeInput, saveFile, scale, shared, startOfMonth, startOfPeriod, startOfTheDay, startOfWeek, startOfYear, toDate, toEndOfMonth, toEndOfYear, toJsDate, toOffset, toStartOfMonth, toStartOfTheDay, toStartOfWeek, toStartOfYear, toTime, uniqueBy, uniqueFrom, validateAssetName, validateTypeAssetName };
1536
1541
  export type { Authentication, AuthenticationClient, Authority, Color, ConfirmationData, DateRangeValues, ExternalFeature, Feature, ImportError, LoadedIcon, MapItem, MasterDetailDisplayRatio, NestedListItem, PartialUpdate, RelativeTimePeriodWithCustom, SearchAction, SortDirection$1 as SortDirection, StandardListItem, SvgIcon, Tab, Theme, TimeSeries, TimeSeriesData, TreeNode, User, ValueInputValidationConditions };