@wolkabout/commons 0.1.11 → 0.2.1

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.1.11",
3
+ "version": "0.2.1",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "21.2.0",
6
6
  "@angular/common": "21.2.0",
@@ -884,6 +884,7 @@ interface MapItem {
884
884
  declare class GoogleMapComponent {
885
885
  private translateService;
886
886
  private simpleDateTimePipe;
887
+ private readonly ZOOM_BASE;
887
888
  map: _angular_core.Signal<GoogleMap>;
888
889
  googleMapId: _angular_core.InputSignal<string>;
889
890
  darkTheme: _angular_core.InputSignal<boolean>;
@@ -891,13 +892,17 @@ declare class GoogleMapComponent {
891
892
  pinColor: _angular_core.InputSignal<string>;
892
893
  markerClicked: _angular_core.OutputEmitterRef<MapItem>;
893
894
  zoom: _angular_core.WritableSignal<number>;
895
+ canZoomIn: _angular_core.Signal<boolean>;
896
+ canZoomOut: _angular_core.Signal<boolean>;
897
+ zoomPercentage: _angular_core.Signal<number>;
894
898
  mapOptions: _angular_core.Signal<google.maps.MapOptions>;
895
899
  clusterer: _angular_core.Signal<MarkerClusterer>;
896
900
  markers: _angular_core.Signal<google.maps.marker.AdvancedMarkerElement[]>;
897
901
  mapBounds: google.maps.LatLngBounds;
898
902
  constructor(translateService: TranslateService, simpleDateTimePipe: SimpleDateTimePipe);
899
- changeZoom(number: number): void;
900
- fitBounds(): void;
903
+ syncZoom(): void;
904
+ changeZoom(delta: number): void;
905
+ fitToMarkers(): void;
901
906
  private openDetails;
902
907
  private createMarker;
903
908
  addJitter(mapItems: MapItem[]): MapItem[];
@@ -1096,6 +1101,36 @@ declare class NestedListDataControl<ItemType> {
1096
1101
  persist(id: string | null): void;
1097
1102
  }
1098
1103
 
1104
+ interface StandardListItem<ItemType> {
1105
+ id: string;
1106
+ name: string;
1107
+ icon: string | number | LoadedIcon | SvgIcon;
1108
+ rightIcon?: string | number | LoadedIcon | SvgIcon;
1109
+ data: ItemType;
1110
+ }
1111
+ declare abstract class StandardListDataSource<ItemType> {
1112
+ page: number;
1113
+ isPaged: boolean;
1114
+ isLastPage: boolean;
1115
+ /**
1116
+ * Loads the initial data from the backend.
1117
+ */
1118
+ abstract loadData(): Observable<ItemType[]>;
1119
+ /**
1120
+ * Sets the id of the item that should be selected as soon as the data loads.
1121
+ */
1122
+ abstract initialSelection(): string[] | string | null;
1123
+ /**
1124
+ * Generalized the item and prepares it for display.
1125
+ */
1126
+ abstract prepareItem(item: ItemType): StandardListItem<ItemType>;
1127
+ sortingFunction(item1: StandardListItem<ItemType>, item2: StandardListItem<ItemType>): number;
1128
+ /**
1129
+ * If isPaged is set to true, implement this method, gets next page from the backend.
1130
+ */
1131
+ nextPage(): Observable<ItemType[]>;
1132
+ }
1133
+
1099
1134
  interface SearchAction {
1100
1135
  name: string;
1101
1136
  icon: SvgIcon;
@@ -1107,6 +1142,8 @@ interface SearchAction {
1107
1142
  }
1108
1143
  declare class NestedListViewComponent<ItemType> {
1109
1144
  private destroyRef;
1145
+ onKeyDown(event: KeyboardEvent): void;
1146
+ onKeyUp(event: KeyboardEvent): void;
1110
1147
  dataSource: _angular_core.InputSignal<NestedListDataSource<ItemType>>;
1111
1148
  dataControl: _angular_core.InputSignal<NestedListDataControl<ItemType>>;
1112
1149
  width: _angular_core.InputSignal<"quarter" | "full" | "third" | "half">;
@@ -1115,11 +1152,15 @@ declare class NestedListViewComponent<ItemType> {
1115
1152
  searchActions: _angular_core.InputSignal<SearchAction[]>;
1116
1153
  defaultSearchAction: _angular_core.Signal<SearchAction | undefined>;
1117
1154
  otherSearchActions: _angular_core.Signal<SearchAction[]>;
1155
+ enableMultiSelect: _angular_core.InputSignal<boolean>;
1156
+ ctrlPressed: _angular_core.WritableSignal<boolean>;
1157
+ shiftPressed: _angular_core.WritableSignal<boolean>;
1118
1158
  widthClass: _angular_core.Signal<"w-full" | "w-1/4" | "w-1/3" | "w-1/2">;
1119
1159
  selectionConfirmationAction: _angular_core.InputSignal<() => Observable<boolean>>;
1120
1160
  loadingBreadcrumbs: _angular_core.WritableSignal<boolean>;
1121
1161
  loadingChildren: _angular_core.WritableSignal<boolean>;
1122
1162
  selectedItem: _angular_core.WritableSignal<NestedListItem<ItemType> | null>;
1163
+ selectedItems: _angular_core.WritableSignal<NestedListItem<ItemType>[]>;
1123
1164
  hideSearch: _angular_core.InputSignal<boolean>;
1124
1165
  nameSearchControl: FormControl<string | null>;
1125
1166
  searchTerm: _angular_core.Signal<string | null | undefined>;
@@ -1133,6 +1174,7 @@ declare class NestedListViewComponent<ItemType> {
1133
1174
  children: _angular_core.WritableSignal<NestedListItem<ItemType>[]>;
1134
1175
  filteredChildren: _angular_core.Signal<NestedListItem<ItemType>[]>;
1135
1176
  itemSelected: _angular_core.OutputEmitterRef<ItemType | null>;
1177
+ itemsSelected: _angular_core.OutputEmitterRef<ItemType[]>;
1136
1178
  private countsMap;
1137
1179
  private readonly currentScopes;
1138
1180
  constructor(destroyRef: DestroyRef);
@@ -1144,9 +1186,12 @@ declare class NestedListViewComponent<ItemType> {
1144
1186
  shouldDisableBreadcrumbClick(item: NestedListItem<ItemType>): boolean | "" | null | undefined;
1145
1187
  private buildCountsMap;
1146
1188
  private adjustCount;
1189
+ toggleSelectAll(): void;
1190
+ isChildSelected(item: StandardListItem<ItemType>): boolean;
1191
+ isBreadcrumbSelected(item: StandardListItem<ItemType>): boolean;
1147
1192
  private refreshCount;
1148
1193
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NestedListViewComponent<any>, never>;
1149
- 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; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "disableThresholdId": { "alias": "disableThresholdId"; "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"; }, never, ["[app-no-items-message]", "[app-actions]", "[app-details]"], true, never>;
1194
+ 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; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "disableThresholdId": { "alias": "disableThresholdId"; "required": false; "isSignal": true; }; "isColoredInput": { "alias": "isColoredInput"; "required": false; "isSignal": true; }; "searchActions": { "alias": "searchActions"; "required": false; "isSignal": true; }; "enableMultiSelect": { "alias": "enableMultiSelect"; "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"; "itemsSelected": "itemsSelected"; }, never, ["[app-no-items-message]", "[app-actions]", "[app-details]", "[app-bulk-actions]"], true, never>;
1150
1195
  }
1151
1196
 
1152
1197
  declare class PdfViewerComponent {
@@ -1158,36 +1203,6 @@ declare class PdfViewerComponent {
1158
1203
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<PdfViewerComponent, "app-pdf-viewer", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
1159
1204
  }
1160
1205
 
1161
- interface StandardListItem<ItemType> {
1162
- id: string;
1163
- name: string;
1164
- icon: string | number | LoadedIcon | SvgIcon;
1165
- rightIcon?: string | number | LoadedIcon | SvgIcon;
1166
- data: ItemType;
1167
- }
1168
- declare abstract class StandardListDataSource<ItemType> {
1169
- page: number;
1170
- isPaged: boolean;
1171
- isLastPage: boolean;
1172
- /**
1173
- * Loads the initial data from the backend.
1174
- */
1175
- abstract loadData(): Observable<ItemType[]>;
1176
- /**
1177
- * Sets the id of the item that should be selected as soon as the data loads.
1178
- */
1179
- abstract initialSelection(): string[] | string | null;
1180
- /**
1181
- * Generalized the item and prepares it for display.
1182
- */
1183
- abstract prepareItem(item: ItemType): StandardListItem<ItemType>;
1184
- sortingFunction(item1: StandardListItem<ItemType>, item2: StandardListItem<ItemType>): number;
1185
- /**
1186
- * If isPaged is set to true, implement this method, gets next page from the backend.
1187
- */
1188
- nextPage(): Observable<ItemType[]>;
1189
- }
1190
-
1191
1206
  interface PartialUpdate<ItemType> {
1192
1207
  id: string;
1193
1208
  update: (oldItem: ItemType) => ItemType;
@@ -1203,10 +1218,10 @@ declare class StandardListDataControl<ItemType> {
1203
1218
  constructor(storageKey?: string);
1204
1219
  readonly selectItem: (id: string) => void;
1205
1220
  readonly deselectItem: () => void;
1206
- readonly updateItem: (item: ItemType) => void;
1221
+ readonly updateItem: (item: ItemType | ItemType[]) => void;
1207
1222
  readonly updateItemPartially: (id: string, update: (oldItem: ItemType) => ItemType) => void;
1208
1223
  readonly addItem: (item: ItemType) => void;
1209
- readonly removeItem: (id: string) => void;
1224
+ readonly removeItem: (id: string | string[]) => void;
1210
1225
  /**
1211
1226
  * Internal event hook. Do not use outside the Standard List Component
1212
1227
  */
@@ -1214,7 +1229,7 @@ declare class StandardListDataControl<ItemType> {
1214
1229
  /**
1215
1230
  * Internal event hook. Do not use outside of the Standard List Component
1216
1231
  */
1217
- get itemUpdated$(): Observable<ItemType>;
1232
+ get itemUpdated$(): Observable<ItemType[]>;
1218
1233
  /**
1219
1234
  * Internal event hook. Do not use outside of the Standard List Component
1220
1235
  */
@@ -1226,7 +1241,7 @@ declare class StandardListDataControl<ItemType> {
1226
1241
  /**
1227
1242
  * Internal event hook. Do not use outside the Standard List Component
1228
1243
  */
1229
- get itemRemoved$(): Observable<string>;
1244
+ get itemRemoved$(): Observable<string[]>;
1230
1245
  /**
1231
1246
  * Internal event hook. Do not use outside the Standard List Component
1232
1247
  */
@@ -1234,13 +1249,18 @@ declare class StandardListDataControl<ItemType> {
1234
1249
  }
1235
1250
 
1236
1251
  declare class StandardListViewComponent<ItemType> {
1252
+ onKeyDown(event: KeyboardEvent): void;
1253
+ onKeyUp(event: KeyboardEvent): void;
1237
1254
  dataSource: _angular_core.InputSignal<StandardListDataSource<ItemType>>;
1238
1255
  dataControl: _angular_core.InputSignal<StandardListDataControl<ItemType>>;
1239
1256
  position: _angular_core.InputSignal<"inner" | "outer">;
1240
1257
  isColoredInput: _angular_core.InputSignal<boolean>;
1258
+ enableMultiSelect: _angular_core.InputSignal<boolean>;
1259
+ ctrlPressed: _angular_core.WritableSignal<boolean>;
1260
+ shiftPressed: _angular_core.WritableSignal<boolean>;
1241
1261
  loadingData: _angular_core.WritableSignal<boolean>;
1242
1262
  loadingPage: _angular_core.WritableSignal<boolean>;
1243
- selectedItem: _angular_core.WritableSignal<StandardListItem<ItemType> | null>;
1263
+ selectedItems: _angular_core.WritableSignal<StandardListItem<ItemType>[]>;
1244
1264
  hideSearch: _angular_core.InputSignal<boolean>;
1245
1265
  hideDetails: _angular_core.InputSignal<boolean>;
1246
1266
  hidePadding: _angular_core.InputSignal<boolean>;
@@ -1250,13 +1270,16 @@ declare class StandardListViewComponent<ItemType> {
1250
1270
  items: _angular_core.WritableSignal<StandardListItem<ItemType>[]>;
1251
1271
  filteredItems: _angular_core.Signal<StandardListItem<ItemType>[]>;
1252
1272
  itemSelected: _angular_core.OutputEmitterRef<ItemType | null>;
1273
+ itemsSelected: _angular_core.OutputEmitterRef<ItemType[]>;
1253
1274
  itemTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
1254
1275
  constructor(destroyRef: DestroyRef);
1255
- selectItem(item: StandardListItem<ItemType>): void;
1276
+ selectItems(item: StandardListItem<ItemType>): void;
1256
1277
  selectEmpty(): void;
1278
+ isSelected(item: StandardListItem<ItemType>): boolean;
1279
+ toggleSelectAll(): void;
1257
1280
  loadMore(): void;
1258
1281
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<StandardListViewComponent<any>, never>;
1259
- 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>;
1282
+ 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; }; "enableMultiSelect": { "alias": "enableMultiSelect"; "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"; "itemsSelected": "itemsSelected"; }, ["itemTemplate"], ["[app-no-items-message]", "[app-actions]", "[app-details]", "[app-bulk-actions]"], true, never>;
1260
1283
  }
1261
1284
 
1262
1285
  declare const LAST_ACTIVE_TAB_KEY = "WOLK_LAST_ACTIVE_TAB";