ngx-edu-sharing-ui 9.1.1 → 9.1.2

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.
Files changed (50) hide show
  1. package/esm2022/lib/actionbar/actionbar.component.mjs +31 -16
  2. package/esm2022/lib/directives/icon.directive.mjs +24 -7
  3. package/esm2022/lib/dropdown/dropdown.component.mjs +15 -8
  4. package/esm2022/lib/edu-sharing-ui.module.mjs +5 -1
  5. package/esm2022/lib/list-items/list-text/list-text.component.mjs +3 -5
  6. package/esm2022/lib/mds/mds-helper.service.mjs +167 -0
  7. package/esm2022/lib/mds/mds.module.mjs +16 -0
  8. package/esm2022/lib/node-entries/drag-preview/drag-preview.component.mjs +3 -3
  9. package/esm2022/lib/node-entries/entries-model.mjs +1 -1
  10. package/esm2022/lib/node-entries/node-entries-card/node-entries-card.component.mjs +6 -4
  11. package/esm2022/lib/node-entries/node-entries-card-small/node-entries-card-small.component.mjs +2 -2
  12. package/esm2022/lib/node-entries/node-entries-global-options/node-entries-global-options.component.mjs +7 -3
  13. package/esm2022/lib/node-entries/node-entries-table/node-entries-table.component.mjs +5 -3
  14. package/esm2022/lib/node-entries/node-entries-wrapper.component.mjs +8 -3
  15. package/esm2022/lib/node-entries/option-button/option-button.component.mjs +7 -5
  16. package/esm2022/lib/pipes/file-size.pipe.mjs +6 -5
  17. package/esm2022/lib/pipes/node-title.pipe.mjs +7 -1
  18. package/esm2022/lib/pipes/option-tooltip.pipe.mjs +3 -3
  19. package/esm2022/lib/services/abstract/options-helper.service.mjs +1 -1
  20. package/esm2022/lib/services/node-helper.service.mjs +5 -2
  21. package/esm2022/lib/services/options-helper-data.service.mjs +2 -2
  22. package/esm2022/lib/services/ui.service.mjs +16 -1
  23. package/esm2022/lib/translations/translation-loader.mjs +12 -9
  24. package/esm2022/lib/translations/translations.service.mjs +24 -6
  25. package/esm2022/lib/types/option-item.mjs +6 -1
  26. package/esm2022/module.mjs +3 -1
  27. package/fesm2022/ngx-edu-sharing-ui.mjs +387 -110
  28. package/fesm2022/ngx-edu-sharing-ui.mjs.map +1 -1
  29. package/lib/actionbar/actionbar.component.d.ts +13 -3
  30. package/lib/directives/icon.directive.d.ts +5 -3
  31. package/lib/dropdown/dropdown.component.d.ts +6 -3
  32. package/lib/edu-sharing-ui.module.d.ts +7 -6
  33. package/lib/list-items/list-text/list-text.component.d.ts +1 -1
  34. package/lib/list-items/list-widget.d.ts +1 -1
  35. package/lib/mds/mds-helper.service.d.ts +37 -0
  36. package/lib/mds/mds.module.d.ts +6 -0
  37. package/lib/node-entries/entries-model.d.ts +1 -1
  38. package/lib/node-entries/node-entries-card/node-entries-card.component.d.ts +1 -1
  39. package/lib/node-entries/node-entries-global-options/node-entries-global-options.component.d.ts +1 -0
  40. package/lib/node-entries/option-button/option-button.component.d.ts +2 -1
  41. package/lib/pipes/node-title.pipe.d.ts +2 -1
  42. package/lib/pipes/option-tooltip.pipe.d.ts +1 -1
  43. package/lib/services/abstract/options-helper.service.d.ts +1 -1
  44. package/lib/services/node-helper.service.d.ts +2 -2
  45. package/lib/services/options-helper-data.service.d.ts +3 -3
  46. package/lib/services/ui.service.d.ts +7 -1
  47. package/lib/translations/translations.service.d.ts +5 -2
  48. package/lib/types/option-item.d.ts +7 -2
  49. package/module.d.ts +2 -0
  50. package/package.json +1 -1
@@ -2,6 +2,8 @@ import { OnChanges, SimpleChanges } from '@angular/core';
2
2
  import { TranslateService } from '@ngx-translate/core';
3
3
  import { OptionItem } from '../types/option-item';
4
4
  import { UIService } from '../services/ui.service';
5
+ import { TooltipPosition } from '@angular/material/tooltip';
6
+ import { BehaviorSubject } from 'rxjs';
5
7
  import * as i0 from "@angular/core";
6
8
  export declare class ActionbarComponent implements OnChanges {
7
9
  private uiService;
@@ -47,13 +49,21 @@ export declare class ActionbarComponent implements OnChanges {
47
49
  * Should disabled ("greyed out") options be shown or hidden?
48
50
  */
49
51
  showDisabled: boolean;
52
+ /**
53
+ * the position of the mat tooltips
54
+ */
55
+ tooltipPosition: TooltipPosition;
50
56
  /**
51
57
  * Set the options, see @OptionItem
52
58
  */
53
59
  set options(options: OptionItem[]);
60
+ /**
61
+ * breakpoint width at which point the mobile display count is used
62
+ */
63
+ mobileBreakpoint: number;
54
64
  optionsIn: OptionItem[];
55
- optionsAlways: OptionItem[];
56
- optionsMenu: OptionItem[];
65
+ optionsAlways$: BehaviorSubject<OptionItem[]>;
66
+ optionsMenu$: BehaviorSubject<OptionItem[]>;
57
67
  optionsToggle: OptionItem[];
58
68
  constructor(uiService: UIService, translate: TranslateService);
59
69
  private prepareOptions;
@@ -70,5 +80,5 @@ export declare class ActionbarComponent implements OnChanges {
70
80
  shouldHighlight(optionIndex: number, option: OptionItem): boolean;
71
81
  ngOnChanges(changes: SimpleChanges): void;
72
82
  static ɵfac: i0.ɵɵFactoryDeclaration<ActionbarComponent, never>;
73
- static ɵcmp: i0.ɵɵComponentDeclaration<ActionbarComponent, "es-actionbar", never, { "numberOfAlwaysVisibleOptions": { "alias": "numberOfAlwaysVisibleOptions"; "required": false; }; "numberOfAlwaysVisibleOptionsMobile": { "alias": "numberOfAlwaysVisibleOptionsMobile"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "dropdownPosition": { "alias": "dropdownPosition"; "required": false; }; "backgroundType": { "alias": "backgroundType"; "required": false; }; "style": { "alias": "style"; "required": false; }; "highlight": { "alias": "highlight"; "required": false; }; "showDisabled": { "alias": "showDisabled"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, {}, never, never, false, never>;
83
+ static ɵcmp: i0.ɵɵComponentDeclaration<ActionbarComponent, "es-actionbar", never, { "numberOfAlwaysVisibleOptions": { "alias": "numberOfAlwaysVisibleOptions"; "required": false; }; "numberOfAlwaysVisibleOptionsMobile": { "alias": "numberOfAlwaysVisibleOptionsMobile"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "dropdownPosition": { "alias": "dropdownPosition"; "required": false; }; "backgroundType": { "alias": "backgroundType"; "required": false; }; "style": { "alias": "style"; "required": false; }; "highlight": { "alias": "highlight"; "required": false; }; "showDisabled": { "alias": "showDisabled"; "required": false; }; "tooltipPosition": { "alias": "tooltipPosition"; "required": false; }; "options": { "alias": "options"; "required": false; }; "mobileBreakpoint": { "alias": "mobileBreakpoint"; "required": false; }; }, {}, never, never, false, never>;
74
84
  }
@@ -1,4 +1,4 @@
1
- import { ElementRef, OnDestroy, OnInit } from '@angular/core';
1
+ import { ElementRef, OnDestroy, OnInit, Renderer2 } from '@angular/core';
2
2
  import { TranslateService } from '@ngx-translate/core';
3
3
  import { ConfigService } from 'ngx-edu-sharing-api';
4
4
  import * as i0 from "@angular/core";
@@ -17,12 +17,14 @@ import * as i0 from "@angular/core";
17
17
  export declare class IconDirective implements OnInit, OnDestroy {
18
18
  private element;
19
19
  private translate;
20
+ private renderer;
20
21
  private config;
21
22
  private originalId$;
22
23
  private _id;
23
24
  private _aria;
24
25
  private altTextSpan;
25
26
  private isReady;
27
+ private svg;
26
28
  /**
27
29
  * An alt text to show to screen readers.
28
30
  *
@@ -34,13 +36,13 @@ export declare class IconDirective implements OnInit, OnDestroy {
34
36
  /** If true, an alt text (see above) will be set based on the icon. */
35
37
  set aria(aria: boolean);
36
38
  set esIcon(id: string);
37
- constructor(element: ElementRef<HTMLElement>, translate: TranslateService, config: ConfigService);
39
+ constructor(element: ElementRef<HTMLElement>, translate: TranslateService, renderer: Renderer2, config: ConfigService);
38
40
  ngOnInit(): Promise<void>;
39
41
  ngOnDestroy(): void;
40
42
  private setIcon;
41
43
  private updateAria;
42
44
  private setAltText;
43
45
  private insertAltTextSpan;
44
- static ɵfac: i0.ɵɵFactoryDeclaration<IconDirective, [null, null, { optional: true; }]>;
46
+ static ɵfac: i0.ɵɵFactoryDeclaration<IconDirective, [null, null, null, { optional: true; }]>;
45
47
  static ɵdir: i0.ɵɵDirectiveDeclaration<IconDirective, "i[esIcon], i.material-icons", never, { "altText": { "alias": "altText"; "required": false; }; "aria": { "alias": "aria"; "required": false; }; "esIcon": { "alias": "esIcon"; "required": false; }; }, {}, never, never, false, never>;
46
48
  }
@@ -1,17 +1,20 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
1
2
  import { MatMenu, MatMenuTrigger } from '@angular/material/menu';
2
3
  import { OptionItem } from '../types/option-item';
3
4
  import { UIService } from '../services/ui.service';
5
+ import { BehaviorSubject } from 'rxjs';
4
6
  import * as i0 from "@angular/core";
5
7
  /**
6
8
  * The dropdown is one base component of the action bar (showing more actions),
7
9
  * but can also be used standalone.
8
10
  */
9
- export declare class DropdownComponent {
11
+ export declare class DropdownComponent implements OnChanges {
10
12
  private ui;
11
13
  menu: MatMenu;
12
14
  menuTrigger: MatMenuTrigger;
13
15
  position: 'left' | 'right';
14
- set options(options: OptionItem[]);
16
+ options: OptionItem[];
17
+ options$: BehaviorSubject<OptionItem[]>;
15
18
  /**
16
19
  * The object that should be returned via the option's callback.
17
20
  *
@@ -29,8 +32,8 @@ export declare class DropdownComponent {
29
32
  * taken out of the host container by angular.
30
33
  */
31
34
  menuClass: string;
32
- _options: OptionItem[];
33
35
  constructor(ui: UIService);
36
+ ngOnChanges(changes?: SimpleChanges): void;
34
37
  click(option: OptionItem): void;
35
38
  isNewGroup(i: number): boolean;
36
39
  /** Whether there are any enabled options so we can open the menu. */
@@ -6,14 +6,15 @@ import * as i2 from "@ngx-translate/core";
6
6
  import * as i3 from "./common/edu-sharing-ui-common.module";
7
7
  import * as i4 from "./list-items/list-items.module";
8
8
  import * as i5 from "./node-entries/node-entries.module";
9
- import * as i6 from "@angular/material/tooltip";
10
- import * as i7 from "./pipes/node-image-size.pipe";
11
- import * as i8 from "./pipes/format-date.pipe";
12
- import * as i9 from "./node-entries/list-item-label.pipe";
13
- import * as i10 from "./sort-dropdown/sort-dropdown.component";
9
+ import * as i6 from "./mds/mds.module";
10
+ import * as i7 from "@angular/material/tooltip";
11
+ import * as i8 from "./pipes/node-image-size.pipe";
12
+ import * as i9 from "./pipes/format-date.pipe";
13
+ import * as i10 from "./node-entries/list-item-label.pipe";
14
+ import * as i11 from "./sort-dropdown/sort-dropdown.component";
14
15
  export declare class EduSharingUiModule {
15
16
  static forRoot(config: EduSharingUiConfigurationParams): ModuleWithProviders<EduSharingUiModule>;
16
17
  static ɵfac: i0.ɵɵFactoryDeclaration<EduSharingUiModule, never>;
17
- static ɵmod: i0.ɵɵNgModuleDeclaration<EduSharingUiModule, never, [typeof i1.CommonModule, typeof i2.TranslateModule, typeof i3.EduSharingUiCommonModule, typeof i4.ListItemsModule, typeof i5.NodeEntriesModule], [typeof i1.CommonModule, typeof i6.MatTooltipModule, typeof i2.TranslateModule, typeof i3.EduSharingUiCommonModule, typeof i4.ListItemsModule, typeof i5.NodeEntriesModule, typeof i7.NodeImageSizePipe, typeof i8.FormatDatePipe, typeof i4.ListItemsModule, typeof i9.ListItemLabelPipe, typeof i10.SortDropdownComponent]>;
18
+ static ɵmod: i0.ɵɵNgModuleDeclaration<EduSharingUiModule, never, [typeof i1.CommonModule, typeof i2.TranslateModule, typeof i3.EduSharingUiCommonModule, typeof i4.ListItemsModule, typeof i5.NodeEntriesModule], [typeof i1.CommonModule, typeof i6.MdsModule, typeof i7.MatTooltipModule, typeof i2.TranslateModule, typeof i3.EduSharingUiCommonModule, typeof i4.ListItemsModule, typeof i5.NodeEntriesModule, typeof i8.NodeImageSizePipe, typeof i9.FormatDatePipe, typeof i4.ListItemsModule, typeof i10.ListItemLabelPipe, typeof i11.SortDropdownComponent]>;
18
19
  static ɵinj: i0.ɵɵInjectorDeclaration<EduSharingUiModule>;
19
20
  }
@@ -17,7 +17,7 @@ export declare class ListTextComponent extends ListWidget implements OnInit {
17
17
  constructor(nodeHelper: NodeHelperService, mds: MdsService, changeDetectorRef: ChangeDetectorRef);
18
18
  ngOnChanges(changes: SimpleChanges): Promise<void>;
19
19
  ngOnInit(): Promise<void>;
20
- getNode(): Node | Constants.Person | Constants.Group | Constants.Statistics;
20
+ getNode(): Node | Constants.Group | Constants.Person | Constants.Statistics;
21
21
  isUserProfileAttribute(attribute: string): boolean;
22
22
  getWorkflowStatus(): import("ngx-edu-sharing-ui").WorkflowDefinition;
23
23
  getI18n(item: ListItem): string;
@@ -7,7 +7,7 @@ import * as i0 from "@angular/core";
7
7
  export declare class ListWidget {
8
8
  get node(): Node | ProposalNode | Group | Person | Statistics;
9
9
  set node(value: Node | ProposalNode | Group | Person | Statistics);
10
- protected readonly nodeSubject: BehaviorSubject<Node | ProposalNode | Person | Group | Statistics>;
10
+ protected readonly nodeSubject: BehaviorSubject<Node | Group | ProposalNode | Person | Statistics>;
11
11
  get item(): ListItem;
12
12
  set item(value: ListItem);
13
13
  protected readonly itemSubject: BehaviorSubject<ListItem>;
@@ -0,0 +1,37 @@
1
+ import { TranslateService } from '@ngx-translate/core';
2
+ import { AuthenticationService, MdsDefinition, MdsSort, MdsWidget } from 'ngx-edu-sharing-api';
3
+ import { ListItem } from '../types/list-item';
4
+ import * as i0 from "@angular/core";
5
+ export declare class MdsHelperService {
6
+ private authentication;
7
+ static getSortInfo(mdsSet: MdsDefinition, name: string): MdsSort;
8
+ static getColumns(translate: TranslateService, mdsSet: any, name: string): ListItem[];
9
+ /**
10
+ * Finds the appropriate widget with the id, but will not check any widget conditions
11
+ * @param cid
12
+ * @param template
13
+ * @param widgets
14
+ */
15
+ static getWidget(cid: string, template: string | undefined | null, widgets: MdsWidget[]): MdsWidget;
16
+ constructor(authentication: AuthenticationService);
17
+ /**
18
+ * Same as getWidget, but will also check the widget conditions
19
+ * @param connector
20
+ * @param properties
21
+ * @param id
22
+ * @param template
23
+ * @param widgets
24
+ */
25
+ getWidgetWithCondition(properties: any, id: string, template: string, widgets: any): Promise<any>;
26
+ isWidgetConditionTrue(widget: any, properties: any): Promise<boolean>;
27
+ /**
28
+ * Find a template by id in the given mds
29
+ */
30
+ static findTemplate(mds: MdsDefinition, id: string): import("ngx-edu-sharing-api").MdsView;
31
+ /**
32
+ * Returns all widgets used by the given template
33
+ */
34
+ static getUsedWidgets(mds: MdsDefinition, template?: string): any[];
35
+ static ɵfac: i0.ɵɵFactoryDeclaration<MdsHelperService, never>;
36
+ static ɵprov: i0.ɵɵInjectableDeclaration<MdsHelperService>;
37
+ }
@@ -0,0 +1,6 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class MdsModule {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<MdsModule, never>;
4
+ static ɵmod: i0.ɵɵNgModuleDeclaration<MdsModule, never, never, never>;
5
+ static ɵinj: i0.ɵɵInjectorDeclaration<MdsModule>;
6
+ }
@@ -5,7 +5,7 @@ import { ListItem, ListItemSort } from '../types/list-item';
5
5
  import { CanDrop, DragData, DropAction } from '../types/drag-drop';
6
6
  import { Node, GenericAuthority } from 'ngx-edu-sharing-api';
7
7
  import { ActionbarComponent } from '../actionbar/actionbar.component';
8
- export type NodeRoot = 'MY_FILES' | 'SHARED_FILES' | 'MY_SHARED_FILES' | 'TO_ME_SHARED_FILES' | 'WORKFLOW_RECEIVE' | 'RECYCLE' | 'ALL_FILES';
8
+ export type NodeRoot = 'MY_FILES' | 'COLLECTION_HOME' | 'SHARED_FILES' | 'MY_SHARED_FILES' | 'TO_ME_SHARED_FILES' | 'WORKFLOW_RECEIVE' | 'RECYCLE' | 'ALL_FILES';
9
9
  export declare enum NodeEntriesDisplayType {
10
10
  Table = 0,
11
11
  Grid = 1,
@@ -35,7 +35,7 @@ export declare class NodeEntriesCardComponent<T extends Node> implements OnChang
35
35
  ngOnChanges(changes: SimpleChanges): void;
36
36
  getTextColor(): "#000" | "#fff";
37
37
  optionsOnCard(): import("../../types/option-item").OptionItem[];
38
- openContextmenu(event: MouseEvent | Event): void;
38
+ openContextmenu(event: MouseEvent | Event, node: T): void;
39
39
  getVisibleColumns(): import("ngx-edu-sharing-ui").ListItem[];
40
40
  openMenu(node: T): Promise<void>;
41
41
  ngOnInit(): Promise<void>;
@@ -7,6 +7,7 @@ export declare class NodeEntriesGlobalOptionsComponent<T extends Node> {
7
7
  readonly NodeEntriesDisplayType: typeof NodeEntriesDisplayType;
8
8
  displayType: NodeEntriesDisplayType;
9
9
  constructor(entriesService: NodeEntriesService<T>);
10
+ getEnabledOptions(): import("rxjs").Observable<import("ngx-edu-sharing-ui").OptionItem[]>;
10
11
  static ɵfac: i0.ɵɵFactoryDeclaration<NodeEntriesGlobalOptionsComponent<any>, never>;
11
12
  static ɵcmp: i0.ɵɵComponentDeclaration<NodeEntriesGlobalOptionsComponent<any>, "es-node-entries-global-options", never, { "displayType": { "alias": "displayType"; "required": false; }; }, {}, never, never, false, never>;
12
13
  }
@@ -6,8 +6,9 @@ export declare class OptionButtonComponent implements OnChanges {
6
6
  option: OptionItem;
7
7
  node: Node;
8
8
  isShown: boolean;
9
+ isEnabled: boolean;
9
10
  ngOnChanges(changes: SimpleChanges): Promise<void>;
10
- optionIsValid(optionItem: OptionItem, node: Node): boolean;
11
+ optionIsValid(optionItem: OptionItem, node: Node): Promise<boolean>;
11
12
  private optionIsShown;
12
13
  click(option: OptionItem, node: Node): Promise<void>;
13
14
  static ɵfac: i0.ɵɵFactoryDeclaration<OptionButtonComponent, never>;
@@ -1,10 +1,11 @@
1
1
  import { PipeTransform } from '@angular/core';
2
2
  import { TranslateService } from '@ngx-translate/core';
3
3
  import { Node } from 'ngx-edu-sharing-api';
4
+ import { NodeRoot } from '../node-entries/entries-model';
4
5
  import * as i0 from "@angular/core";
5
6
  export declare class NodeTitlePipe implements PipeTransform {
6
7
  private translate;
7
- transform(node: Node, args?: string[]): string;
8
+ transform(node: Node | NodeRoot | 'HOME', args?: string[]): string;
8
9
  constructor(translate: TranslateService);
9
10
  static ɵfac: i0.ɵɵFactoryDeclaration<NodeTitlePipe, never>;
10
11
  static ɵpipe: i0.ɵɵPipeDeclaration<NodeTitlePipe, "nodeTitle", false>;
@@ -5,7 +5,7 @@ import * as i0 from "@angular/core";
5
5
  export declare class OptionTooltipPipe implements PipeTransform {
6
6
  private translate;
7
7
  constructor(translate: TranslateService);
8
- transform(option: OptionItem, args?: string[]): string;
8
+ transform(option: OptionItem, args?: string[]): Promise<string>;
9
9
  getKeyInfo(option: OptionItem): string;
10
10
  static ɵfac: i0.ɵɵFactoryDeclaration<OptionTooltipPipe, never>;
11
11
  static ɵpipe: i0.ɵɵPipeDeclaration<OptionTooltipPipe, "optionTooltip", false>;
@@ -5,6 +5,6 @@ export declare abstract class OptionsHelperService {
5
5
  abstract wrapOptionCallbacks(data: OptionData): OptionData;
6
6
  abstract refreshComponents(components: OptionsHelperComponents, data: OptionData, refreshListOptions: boolean): Promise<void>;
7
7
  abstract getAvailableOptions(target: Target, objects: Node[], components: OptionsHelperComponents, data: OptionData): Promise<OptionItem[]>;
8
- abstract pasteNode(components: OptionsHelperComponents, data: OptionData, nodes: Node[]): void;
8
+ abstract pasteNode(components: OptionsHelperComponents, data: OptionData, addVirutalNodes: boolean, nodes: Node[]): void;
9
9
  abstract filterOptions(options: OptionItem[], target: Target, data: OptionData, objects: Node[] | any): Promise<OptionItem[]>;
10
10
  }
@@ -1,4 +1,4 @@
1
- import { ApiHelpersService, ConfigService, NetworkService, Node } from 'ngx-edu-sharing-api';
1
+ import { ApiHelpersService, ConfigService, User, NetworkService, Node } from 'ngx-edu-sharing-api';
2
2
  import { TranslateService } from '@ngx-translate/core';
3
3
  import * as Workflow from '../types/workflow';
4
4
  import { RepoUrlService } from './repo-url.service';
@@ -49,7 +49,7 @@ export declare class NodeHelperService {
49
49
  getWorkflowStatus(node: Node, useFromConfig?: boolean): Workflow.WorkflowDefinitionStatus;
50
50
  getDefaultWorkflowStatus(useFromConfig?: boolean): Workflow.WorkflowDefinitionStatus;
51
51
  getWorkflows(): Workflow.WorkflowDefinition[];
52
- copyDataToNode<T extends Node>(target: T, source: T): void;
52
+ copyDataToNode<T extends Node | User>(target: T, source: T): void;
53
53
  isNodeCollection(node: Node): boolean;
54
54
  getSourceIconPath(src: string): string;
55
55
  getNodeLink(mode: 'routerLink' | 'queryParams', node: Node): string | Params;
@@ -1,6 +1,6 @@
1
- import { DropdownComponent } from '../dropdown/dropdown.component';
2
- import { ActionbarComponent } from '../actionbar/actionbar.component';
3
- import { ListEventInterface, NodeEntriesDataType, NodeEntriesDisplayType } from '../node-entries/entries-model';
1
+ import type { DropdownComponent } from '../dropdown/dropdown.component';
2
+ import type { ActionbarComponent } from '../actionbar/actionbar.component';
3
+ import type { ListEventInterface, NodeEntriesDataType, NodeEntriesDisplayType } from '../node-entries/entries-model';
4
4
  import { EventEmitter, NgZone, OnDestroy } from '@angular/core';
5
5
  import { AuthenticationService, NetworkService, Node, UserService } from 'ngx-edu-sharing-api';
6
6
  import { CustomOptions, OptionItem, Scope, Target } from '../types/option-item';
@@ -1,6 +1,6 @@
1
1
  import { ComponentFactoryResolver, ComponentRef, Injector, NgZone, Type, ViewContainerRef } from '@angular/core';
2
2
  import * as rxjs from 'rxjs';
3
- import { Observable } from 'rxjs';
3
+ import { BehaviorSubject, Observable } from 'rxjs';
4
4
  import { OptionItem } from '../types/option-item';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class UIService {
@@ -25,6 +25,12 @@ export declare class UIService {
25
25
  isMobile(): boolean;
26
26
  static evaluateMediaQuery(type: string, value: number): boolean;
27
27
  filterValidOptions(options: OptionItem[]): OptionItem[];
28
+ /**
29
+ * helper that updates the "isEnabled" flag on all options for the given, selected node
30
+ * can be used by dropdown or action menus to update the state for the current element
31
+ * @param options
32
+ */
33
+ updateOptionEnabledState(options: BehaviorSubject<OptionItem[]>, object?: Node | any): Promise<void>;
28
34
  filterToggleOptions(options: OptionItem[], toggle: boolean): OptionItem[];
29
35
  /**
30
36
  * dynamically inject an angular component into a regular html dom element
@@ -1,3 +1,4 @@
1
+ import { ApplicationRef } from '@angular/core';
1
2
  import { ActivatedRoute } from '@angular/router';
2
3
  import { TranslateService } from '@ngx-translate/core';
3
4
  import { Observable } from 'rxjs';
@@ -9,10 +10,12 @@ export declare class TranslationsService {
9
10
  private route;
10
11
  private storage;
11
12
  private translate;
13
+ private sessionStorage;
14
+ private ref;
12
15
  private appService;
13
16
  private language;
14
17
  private languageLoaded;
15
- constructor(config: ConfigService, route: ActivatedRoute, storage: SessionStorageService, translate: TranslateService, appService: AppService);
18
+ constructor(config: ConfigService, route: ActivatedRoute, storage: SessionStorageService, translate: TranslateService, sessionStorage: SessionStorageService, ref: ApplicationRef, appService: AppService);
16
19
  /**
17
20
  * Determines and configures the language to use and triggers loading of translations with
18
21
  * ngx-translate.
@@ -25,6 +28,6 @@ export declare class TranslationsService {
25
28
  /** Same as `translate.currentLang`. */
26
29
  getLanguage(): string;
27
30
  getISOLanguage(): string;
28
- static ɵfac: i0.ɵɵFactoryDeclaration<TranslationsService, [null, null, null, null, { optional: true; }]>;
31
+ static ɵfac: i0.ɵɵFactoryDeclaration<TranslationsService, [null, null, null, null, null, null, { optional: true; }]>;
29
32
  static ɵprov: i0.ɵɵInjectableDeclaration<TranslationsService>;
30
33
  }
@@ -48,6 +48,11 @@ export declare class OptionItem {
48
48
  * @type {boolean}
49
49
  */
50
50
  onlyMobile: boolean;
51
+ /**
52
+ * custom aria-label
53
+ * @type {string}
54
+ */
55
+ ariaLabel: string;
51
56
  /**
52
57
  * If true, only displayed on a desktop device (based on the navigator agent)
53
58
  * @type {boolean}
@@ -89,12 +94,12 @@ export declare class OptionItem {
89
94
  * Is handled by optionsHelper and may not be used otherwise
90
95
  * Please use @customEnabledCallback instead
91
96
  */
92
- enabledCallback: (node?: Node | any) => boolean;
97
+ enabledCallback: (node?: Node | any) => Promise<boolean>;
93
98
  /**
94
99
  * A function called with the node as param which should return true or false if the option should be enabled or not
95
100
  * Will be called by the optionsHelper
96
101
  */
97
- customEnabledCallback: (nodes?: Node[] | any[]) => boolean;
102
+ customEnabledCallback: (nodes?: Node[] | any[]) => Promise<boolean>;
98
103
  /**
99
104
  * Optional: A callback that is called when the user clicks on the option when it's currently disabled (greyed out)
100
105
  */
package/module.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './lib/actionbar/actionbar.component';
2
2
  export * from './lib/common/edu-sharing-ui-common.module';
3
+ export * from './lib/mds/mds.module';
3
4
  export * from './lib/directives/border-box-observer.directive';
4
5
  export * from './lib/directives/check-text-overflow.directive';
5
6
  export * from './lib/directives/drag-nodes/drag-nodes';
@@ -76,3 +77,4 @@ export * from './lib/util/isNumeric';
76
77
  export * from './lib/util/rest-helper';
77
78
  export * from './lib/util/ui-animation';
78
79
  export * from './lib/util/ui-constants';
80
+ export * from './lib/mds/mds-helper.service';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-edu-sharing-ui",
3
- "version": "9.1.1",
3
+ "version": "9.1.2",
4
4
  "license": "GNU GPL v2",
5
5
  "description": "Angular components for Edu-Sharing UX parts",
6
6
  "peerDependencies": {