@pilotdev/pilot-web-sdk 24.4.0 → 24.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. package/esm2020/lib/contexts/context.mjs +29 -0
  2. package/esm2020/lib/contexts/document-annotations-list-context.mjs +15 -0
  3. package/esm2020/lib/contexts/index.mjs +4 -0
  4. package/esm2020/lib/contexts/render-context.mjs +22 -0
  5. package/esm2020/lib/data/access.mjs +26 -0
  6. package/esm2020/lib/data/annotations.mjs +2 -0
  7. package/esm2020/lib/data/attribute.mjs +17 -0
  8. package/esm2020/lib/data/data-object.mjs +19 -0
  9. package/esm2020/lib/data/file.mjs +2 -0
  10. package/esm2020/lib/data/files-snapshot.mjs +2 -0
  11. package/esm2020/lib/data/index.mjs +13 -0
  12. package/esm2020/lib/data/modifier.mjs +2 -0
  13. package/esm2020/lib/data/object-builder.mjs +2 -0
  14. package/esm2020/lib/data/organisation-unit.mjs +7 -0
  15. package/esm2020/lib/data/person.mjs +2 -0
  16. package/esm2020/lib/data/relation.mjs +2 -0
  17. package/esm2020/lib/data/subscriptionType.mjs +6 -0
  18. package/esm2020/lib/idata.plugin.mjs +2 -0
  19. package/esm2020/lib/injectable/index.mjs +5 -0
  20. package/esm2020/lib/injectable/modifier-provider.mjs +2 -0
  21. package/esm2020/lib/injectable/objects-repository.mjs +2 -0
  22. package/esm2020/lib/injectable/render-context-provider.mjs +2 -0
  23. package/esm2020/lib/injectable/repository-events.mjs +2 -0
  24. package/esm2020/lib/menu/checkable-menu.builder.mjs +14 -0
  25. package/esm2020/lib/menu/index.mjs +5 -0
  26. package/esm2020/lib/menu/menu-item.builder.mjs +39 -0
  27. package/esm2020/lib/menu/menu.builder.mjs +68 -0
  28. package/esm2020/lib/menu/menu.mjs +22 -0
  29. package/esm2020/lib/toolbar/index.mjs +7 -0
  30. package/esm2020/lib/toolbar/toolbar-item-submenu.handler.mjs +11 -0
  31. package/esm2020/lib/toolbar/toolbar-item.builder.mjs +41 -0
  32. package/esm2020/lib/toolbar/toolbar-menu-item.builder.mjs +15 -0
  33. package/esm2020/lib/toolbar/toolbar-toggle-item.builder.mjs +14 -0
  34. package/esm2020/lib/toolbar/toolbar.builder.mjs +88 -0
  35. package/esm2020/lib/toolbar/toolbar.mjs +27 -0
  36. package/esm2020/lib/tools/attribute-permission.info.mjs +41 -0
  37. package/esm2020/lib/tools/guid.mjs +53 -0
  38. package/esm2020/lib/tools/index.mjs +4 -0
  39. package/esm2020/lib/tools/utils.mjs +8 -0
  40. package/esm2020/pilotdev-pilot-web-sdk.mjs +5 -0
  41. package/esm2020/public-api.mjs +11 -0
  42. package/fesm2015/pilotdev-pilot-web-sdk.mjs +588 -0
  43. package/fesm2015/pilotdev-pilot-web-sdk.mjs.map +1 -0
  44. package/fesm2020/pilotdev-pilot-web-sdk.mjs +588 -0
  45. package/fesm2020/pilotdev-pilot-web-sdk.mjs.map +1 -0
  46. package/index.d.ts +5 -0
  47. package/lib/contexts/context.d.ts +22 -0
  48. package/lib/contexts/document-annotations-list-context.d.ts +12 -0
  49. package/{src/lib/contexts/index.ts → lib/contexts/index.d.ts} +1 -1
  50. package/lib/contexts/render-context.d.ts +17 -0
  51. package/lib/data/access.d.ts +35 -0
  52. package/lib/data/annotations.d.ts +15 -0
  53. package/lib/data/attribute.d.ts +30 -0
  54. package/lib/data/data-object.d.ts +74 -0
  55. package/lib/data/file.d.ts +23 -0
  56. package/lib/data/files-snapshot.d.ts +8 -0
  57. package/{src/lib/data/index.ts → lib/data/index.d.ts} +2 -2
  58. package/lib/data/modifier.d.ts +30 -0
  59. package/lib/data/object-builder.d.ts +110 -0
  60. package/lib/data/organisation-unit.d.ts +18 -0
  61. package/lib/data/person.d.ts +17 -0
  62. package/lib/data/relation.d.ts +8 -0
  63. package/lib/data/subscriptionType.d.ts +4 -0
  64. package/lib/idata.plugin.d.ts +2 -0
  65. package/{src/lib/injectable/index.ts → lib/injectable/index.d.ts} +2 -2
  66. package/{src/lib/injectable/modifier-provider.ts → lib/injectable/modifier-provider.d.ts} +5 -6
  67. package/lib/injectable/objects-repository.d.ts +72 -0
  68. package/lib/injectable/render-context-provider.d.ts +10 -0
  69. package/lib/injectable/repository-events.d.ts +31 -0
  70. package/lib/menu/checkable-menu.builder.d.ts +11 -0
  71. package/{src/lib/menu/index.ts → lib/menu/index.d.ts} +1 -2
  72. package/lib/menu/menu-item.builder.d.ts +27 -0
  73. package/lib/menu/menu.builder.d.ts +49 -0
  74. package/lib/menu/menu.d.ts +18 -0
  75. package/{src/lib/toolbar/index.ts → lib/toolbar/index.d.ts} +1 -2
  76. package/lib/toolbar/toolbar-item-submenu.handler.d.ts +9 -0
  77. package/lib/toolbar/toolbar-item.builder.d.ts +28 -0
  78. package/lib/toolbar/toolbar-menu-item.builder.d.ts +13 -0
  79. package/lib/toolbar/toolbar-toggle-item.builder.d.ts +11 -0
  80. package/lib/toolbar/toolbar.builder.d.ts +65 -0
  81. package/lib/toolbar/toolbar.d.ts +19 -0
  82. package/lib/tools/attribute-permission.info.d.ts +8 -0
  83. package/lib/tools/guid.d.ts +7 -0
  84. package/lib/tools/index.d.ts +3 -0
  85. package/lib/tools/utils.d.ts +3 -0
  86. package/package.json +22 -3
  87. package/{src/public-api.ts → public-api.d.ts} +1 -4
  88. package/.eslintrc.json +0 -31
  89. package/ng-package.json +0 -7
  90. package/src/lib/contexts/context.ts +0 -38
  91. package/src/lib/contexts/document-annotations-list-context.ts +0 -21
  92. package/src/lib/contexts/render-context.ts +0 -28
  93. package/src/lib/data/access.ts +0 -40
  94. package/src/lib/data/annotations.ts +0 -20
  95. package/src/lib/data/attribute.ts +0 -33
  96. package/src/lib/data/data-object.ts +0 -78
  97. package/src/lib/data/file.ts +0 -25
  98. package/src/lib/data/files-snapshot.ts +0 -9
  99. package/src/lib/data/modifier.ts +0 -31
  100. package/src/lib/data/object-builder.ts +0 -111
  101. package/src/lib/data/organisation-unit.ts +0 -20
  102. package/src/lib/data/person.ts +0 -17
  103. package/src/lib/data/relation.ts +0 -10
  104. package/src/lib/data/subscriptionType.ts +0 -5
  105. package/src/lib/idata.plugin.ts +0 -2
  106. package/src/lib/injectable/objects-repository.ts +0 -74
  107. package/src/lib/injectable/render-context-provider.ts +0 -11
  108. package/src/lib/injectable/repository-events.ts +0 -33
  109. package/src/lib/menu/checkable-menu.builder.ts +0 -15
  110. package/src/lib/menu/menu-item.builder.ts +0 -45
  111. package/src/lib/menu/menu.builder.ts +0 -79
  112. package/src/lib/menu/menu.ts +0 -24
  113. package/src/lib/toolbar/toolbar-item-submenu.handler.ts +0 -12
  114. package/src/lib/toolbar/toolbar-item.builder.ts +0 -45
  115. package/src/lib/toolbar/toolbar-menu-item.builder.ts +0 -16
  116. package/src/lib/toolbar/toolbar-toggle-item.builder.ts +0 -15
  117. package/src/lib/toolbar/toolbar.builder.ts +0 -104
  118. package/src/lib/toolbar/toolbar.ts +0 -31
  119. package/src/lib/tools/attribute-permission.info.ts +0 -51
  120. package/src/lib/tools/guid.ts +0 -63
  121. package/src/lib/tools/index.ts +0 -3
  122. package/src/lib/tools/utils.ts +0 -8
  123. package/tsconfig.lib.json +0 -15
  124. package/tsconfig.lib.prod.json +0 -10
@@ -1,111 +0,0 @@
1
- import { AttributeType } from "./attribute";
2
- import { IAnnotationContainer } from "./annotations";
3
- import { IAccessRecord } from "./access";
4
- import { IRelation } from "./relation";
5
-
6
- /**
7
- * Fluent interface that enables you to modify the associated object
8
- */
9
- export interface IObjectBuilder {
10
- /**
11
- * Sets the string attribute value
12
- *
13
- * @param name Attribute name
14
- * @param value Attribute value
15
- * @returns Self
16
- */
17
- setAttribute(name: string, value: any, type: AttributeType): IObjectBuilder;
18
- /**
19
- * Adds access record to an object
20
- *
21
- * @param record Access record
22
- * @returns Self
23
- */
24
- setAccess(record: IAccessRecord): IObjectBuilder;
25
- /**
26
- * Removes access record
27
- *
28
- * @param record Access record
29
- * @returns Self
30
- */
31
- removeAccess(record: IAccessRecord): IObjectBuilder;
32
- /**
33
- * Adds a relation
34
- *
35
- * @param relation Relation
36
- * @returns Self
37
- */
38
- addRelation(relation: IRelation): IObjectBuilder;
39
- /**
40
- * Removes relation
41
- *
42
- * @param relationId Relation id
43
- * @returns Self
44
- */
45
- removeRelation(relationId: string): IObjectBuilder;
46
- /**
47
- * Sets new type. It is recommended to use this method only for recovering permanently deleted objects. In other cases, this can lead to system malfunction.
48
- *
49
- * @param typeId Type id
50
- * @returns Self
51
- */
52
- setTypeId(typeId: number): IObjectBuilder;
53
- /**
54
- * Sets new parent
55
- *
56
- * @param parentId Parent id
57
- * @returns Self
58
- */
59
- setParentId(parentId: string): IObjectBuilder;
60
- /**
61
- * Adds file snapshot
62
- *
63
- * @param reason Reason
64
- * @returns Self
65
- */
66
- createSnapshot(reason: string): IObjectBuilder;
67
- /**
68
- * Makes file snapshot actual
69
- *
70
- * @param version Version of file snapshot to make actual
71
- * @param reason Reason
72
- * @returns Self
73
- */
74
- createSnapshotFrom(version: string, reason: string): IObjectBuilder;
75
- /**
76
- * Sets permanently deleted flag
77
- *
78
- * @param isDeleted Value
79
- * @returns Self
80
- */
81
- setIsDeleted(isDeleted: boolean): IObjectBuilder;
82
- /**
83
- * Set flag in recycle bin
84
- *
85
- * @param isInRecycleBin Value
86
- * @returns Self
87
- */
88
- setIsInRecycleBin(isInRecycleBin: boolean): IObjectBuilder;
89
- /**
90
- * Sets frozen flag
91
- *
92
- * @param isFreezed Value
93
- * @returns Self
94
- */
95
- setIsFreezed(isFreezed: boolean): IObjectBuilder;
96
- /**
97
- * Sets object's secret info
98
- *
99
- * @param isSecret Value
100
- * @returns Self
101
- */
102
- setIsSecret(isSecret: boolean): IObjectBuilder;
103
- /**
104
- * Adds or changes a annotation
105
- *
106
- * @param container Annotation container
107
- * @param attrbutes Annotation attributes
108
- * @returns Self
109
- */
110
- addAnnotationContainer(container: IAnnotationContainer, attrbutes: any): IObjectBuilder;
111
- }
@@ -1,20 +0,0 @@
1
-
2
- export interface IOrganizationUnit {
3
- get id(): number;
4
- get title(): string;
5
- get kind(): OrgUnitKind;
6
- get children(): number[];
7
- get isDeleted(): boolean;
8
- get isBoss(): boolean;
9
- get version(): number;
10
- get person(): number;
11
- get vicePersons(): number[];
12
- get isCanceled(): boolean;
13
- get groupPersons(): number[];
14
- }
15
-
16
- export enum OrgUnitKind {
17
- Department = 0,
18
- Position = 1,
19
- Group = 2
20
- }
@@ -1,17 +0,0 @@
1
- export interface IPerson {
2
- get id(): number;
3
- get login(): string;
4
- get isInactive(): boolean;
5
- get displayName(): string;
6
- get positions(): number[];
7
- get groups(): number[];
8
- get bossOf(): number[];
9
- get allOrgUnits(): number[];
10
- get comment(): string;
11
- get email(): string;
12
- get sid(): string;
13
- get uidDn(): string;
14
- get isDeleted(): boolean;
15
- get isAdmin(): boolean;
16
- get version(): number;
17
- }
@@ -1,10 +0,0 @@
1
- import { getErrorString } from "@microsoft/signalr/dist/esm/Utils";
2
- import { RelationType } from "./data-object";
3
-
4
- export interface IRelation {
5
- get id(): string;
6
- get targetId(): string;
7
- get type(): RelationType;
8
- get name(): string;
9
- get versionId(): string;
10
- }
@@ -1,5 +0,0 @@
1
-
2
- export enum SubscriptionType {
3
- Shallow,
4
- Deep
5
- }
@@ -1,2 +0,0 @@
1
-
2
- export interface IDataPlugin {}
@@ -1,74 +0,0 @@
1
- import { Observable } from "rxjs";
2
- import { AccessLevel } from "../data/access";
3
- import { IDataObject, IPerson, IType, IOrganizationUnit } from "../data";
4
-
5
- /**
6
- * Represents the repository that provides access to objects, types, organisation units and people
7
- */
8
- export interface IObjectsRepository {
9
- /**
10
- * Get objects with specified ids
11
- *
12
- * @param ids Ids of objects to subsribe
13
- * @returns
14
- */
15
- getObjects(ids: string[]): Observable<IDataObject[]>;
16
- /**
17
- * Get object's access for the person
18
- *
19
- * @param objectId Object id
20
- * @param personId Person Id
21
- * @returns Cold Observable
22
- */
23
- getCurrentAccess(objectId: string, personId: number): Observable<AccessLevel>
24
- /**
25
- * Gets the person with specified id
26
- *
27
- * @param id Person id
28
- * @returns Person
29
- */
30
- getPerson(id: number): IPerson;
31
- /**
32
- * Gets the current person
33
- *
34
- * @returns Person
35
- */
36
- getCurrentPerson(): IPerson
37
- /**
38
- * Gets all the people registred in database
39
- *
40
- * @returns Person[]
41
- */
42
- getPeople(): IPerson[]
43
- /**
44
- * Gets type by identifier
45
- *
46
- * @returns Type
47
- */
48
- getType(id: number): IType
49
- /**
50
- * Gets type by name
51
- *
52
- * @returns Type
53
- */
54
- getTypeByName(name: string): IType
55
- /**
56
- * Gets all the types registered in database
57
- *
58
- * @returns Type[]
59
- */
60
- getTypes(): IType[];
61
- /**
62
- * Gets organisation unit by identifier
63
- *
64
- * @returns OrganisationUnit
65
- */
66
- getOrganisationUnit(id: number): IOrganizationUnit;
67
- /**
68
- * Get all the organisation units registered in database
69
- *
70
- * @returns OrganisationUnit
71
- */
72
- getOrganisationUnits(): IOrganizationUnit[];
73
- }
74
-
@@ -1,11 +0,0 @@
1
- import { RenderContext } from "../contexts/render-context";
2
-
3
- /**
4
- * Provides render context
5
- */
6
- export interface IRenderContextProvider {
7
- /**
8
- *
9
- */
10
- getRenderContext(): RenderContext;
11
- }
@@ -1,33 +0,0 @@
1
- import { Observable } from "rxjs";
2
- import { IDataObject, IPerson, IType, IOrganizationUnit } from "../data";
3
-
4
-
5
- /**
6
- * Notifies on change events
7
- */
8
- export interface IRepositoryEvents {
9
- /**
10
- * Subsribes to changes in objects with specified identifiers
11
- *
12
- * @returns Hot observable
13
- */
14
- subscribeObjects(ids: string[]): Observable<IDataObject>;
15
- /**
16
- * Subsribes to changes in people
17
- *
18
- * @returns Hot observable
19
- */
20
- subscribePeople(): Observable<IPerson>
21
- /**
22
- * Subsribes to changes in types
23
- *
24
- * @returns Hot observable
25
- */
26
- subscribeTypes(): Observable<IType>
27
- /**
28
- * Subsribes to changes in organisation units
29
- *
30
- * @returns Hot observable
31
- */
32
- subscribeOrganisationUnits(): Observable<IOrganizationUnit>
33
- }
@@ -1,15 +0,0 @@
1
- import { IMenuItemBuilder } from "./menu-item.builder";
2
-
3
- /**
4
- *
5
- */
6
- export abstract class ICheckableMenuItemBuilder extends IMenuItemBuilder {
7
-
8
- /**
9
- *
10
- * @param value
11
- */
12
- withIsChecked(value: boolean): ICheckableMenuItemBuilder {
13
- throw new Error("Method 'withIsChecked(value: boolean)' must be implemented.");
14
- }
15
- }
@@ -1,45 +0,0 @@
1
- import { IMenuBuilder } from "./menu.builder";
2
-
3
- /**
4
- * Represents a menu item and enables to set parametres to it
5
- */
6
- export abstract class IMenuItemBuilder {
7
-
8
- constructor() {
9
- if (this.constructor == IMenuItemBuilder) {
10
- throw new Error("Abstract classes can't be instantiated.");
11
- }
12
- }
13
-
14
- /**
15
- * Item's name to be displayed
16
- * @param header value
17
- */
18
- withHeader(header: string): IMenuItemBuilder {
19
- throw new Error("Method 'withHeader(header: string)' must be implemented.");
20
- }
21
-
22
- /**
23
- * Item's icon
24
- * @param name Icon name
25
- * @param iconSvg Url of icon or base64 string
26
- */
27
- withIcon(name: string, iconSvg: string): IMenuItemBuilder {
28
- throw new Error("Method 'withIcon(name: string, iconSvg: string)' must be implemented.");
29
- }
30
-
31
- /**
32
- * Enabled the item
33
- * @param value value
34
- */
35
- withIsEnabled(value: boolean): IMenuItemBuilder {
36
- throw new Error("Method 'withIsEnabled(value: boolean)' must be implemented.");
37
- }
38
-
39
- /**
40
- * Item's submenu
41
- */
42
- withSubmenu(): IMenuBuilder {
43
- throw new Error("Method 'withSubmenu()' must be implemented.");
44
- }
45
- }
@@ -1,79 +0,0 @@
1
- import { ICheckableMenuItemBuilder } from "./checkable-menu.builder";
2
- import { IMenuItemBuilder } from "./menu-item.builder";
3
-
4
- /**
5
- * Represents a menu and enables to add new items to it
6
- */
7
- export abstract class IMenuBuilder {
8
-
9
- constructor() {
10
- if (this.constructor == IMenuBuilder) {
11
- throw new Error("Abstract classes can't be instantiated.");
12
- }
13
- }
14
-
15
- /**
16
- * Gets the list of existing items of associated menu or subitems of an item
17
- * @returns Existing menu item names
18
- */
19
- get itemNames(): string[] {
20
- throw new Error("Getter 'itemNames()' must be implemented.");
21
- }
22
-
23
- /**
24
- * Gets count of menu items
25
- */
26
- get count(): number {
27
- throw new Error("Getter 'count()' must be implemented.");
28
- }
29
-
30
- /**
31
- * Adds a new separator to the associated menu
32
- * @param index The index to put the new item at
33
- */
34
- addSeparator(index: number): void {
35
- throw new Error("Method 'addSeparator(index: number)' must be implemented.");
36
- }
37
-
38
- /**
39
- * Adds a new item to the associated menu
40
- * @param name Item's internal name
41
- * @param index The index to put the new item at
42
- */
43
- addItem(name: string, index: number): IMenuItemBuilder {
44
- throw new Error("Method 'addItem(name: string, index: number)' must be implemented.");
45
- }
46
-
47
- /**
48
- * Adds a new checkable item to the associated menu
49
- * @param name Item's internal name
50
- * @param index The index to put the new item at
51
- */
52
- addCheckableItem(name: string, index: number): ICheckableMenuItemBuilder {
53
- throw new Error("Method 'addCheckableItem(name: string, index: number)' must be implemented.");
54
- }
55
-
56
- /**
57
- * Replaces the item to the associated menu
58
- * @param name Item's internal name
59
- */
60
- replaceItem(name: string): IMenuItemBuilder {
61
- throw new Error("Method 'replaceItem(name: string)' must be implemented.");
62
- }
63
-
64
- /**
65
- * Removes the item with the specified name
66
- * @param name Item's internal name
67
- */
68
- removeItem(name: string): void {
69
- throw new Error("Method 'removeItem(name: string)' must be implemented.");
70
- }
71
-
72
- /**
73
- * Gets the item
74
- * @param name Item's internal name
75
- */
76
- getItem(name: string): IMenuBuilder {
77
- throw new Error("Method 'getItem(name: string)' must be implemented.");
78
- }
79
- }
@@ -1,24 +0,0 @@
1
- import { IMenuBuilder } from "./menu.builder";
2
-
3
- /**
4
- * Interface that allows to add new items to the menu and context menus
5
- */
6
- export abstract class IMenu<TMenuContext> {
7
- /**
8
- * The method is called just before the menu is shown
9
- * @param builder The menu builder object of associated menu
10
- * @param context Context
11
- */
12
- build(builder: IMenuBuilder, context: TMenuContext): void {
13
- throw new Error("Method 'build(builder: IMenuBuilder, context: TMenuContext)' must be implemented.");
14
- }
15
-
16
- /**
17
- *
18
- * @param name
19
- * @param context
20
- */
21
- onMenuItemClick(name: string, context: TMenuContext): void {
22
- throw new Error("Method 'onMenuItemClick(name: string, context: TMenuContext)' must be implemented.");
23
- }
24
- }
@@ -1,12 +0,0 @@
1
- import { IToolbarBuilder } from "./toolbar.builder";
2
-
3
- export abstract class IToolbarItemSubmenuHandler {
4
- /**
5
- * Build a submenu
6
- * @param builder - toolbar builder
7
- * @returns
8
- */
9
- onSubmenuRequested(builder: IToolbarBuilder): void {
10
- throw new Error("Method 'onSubmenuRequested(builder: IToolbarBuilder)' must be implemented.");
11
- }
12
- }
@@ -1,45 +0,0 @@
1
- /**
2
- * Represents a toolbar button and enables to set parametres to it
3
- */
4
- export abstract class IToolbarButtonItemBuilder {
5
-
6
- constructor() {
7
- if (this.constructor == IToolbarButtonItemBuilder) {
8
- throw new Error("Abstract classes can't be instantiated.");
9
- }
10
- }
11
-
12
- /**
13
- * Item's name to be displayed
14
- * @param header - value
15
- * @returns instance of IToolbarButtonItemBuilder
16
- */
17
- withHeader(header: string): IToolbarButtonItemBuilder {
18
- throw new Error("Method 'withHeader(header: string)' must be implemented.");
19
- }
20
-
21
- /**
22
- * Item's icon in SVG format
23
- * @param name - icon name
24
- * @param svg - url icon or base64 string
25
- */
26
- withIcon(name: string, svg: string): IToolbarButtonItemBuilder {
27
- throw new Error("Method 'withIcon(name: string, svg: string)' must be implemented.");
28
- }
29
-
30
- /**
31
- * Enabled the item
32
- * @param value - value
33
- */
34
- withIsEnabled(value: boolean): IToolbarButtonItemBuilder {
35
- throw new Error("Method 'withIsEnabled(value: boolean)' must be implemented.");
36
- }
37
-
38
- /**
39
- * Item's hint
40
- * @param hint - value
41
- */
42
- withHint(hint: string): IToolbarButtonItemBuilder {
43
- throw new Error("Method 'withHint(hint: string)' must be implemented.");
44
- }
45
- }
@@ -1,16 +0,0 @@
1
- import { IToolbarButtonItemBuilder } from "./toolbar-item.builder";
2
- import { IToolbarItemSubmenuHandler } from "./toolbar-item-submenu.handler";
3
-
4
- /**
5
- * Represents a toolbar menu button and enables to set parametres to it
6
- */
7
- export abstract class IToolbarMenuButtonItemBuilder extends IToolbarButtonItemBuilder {
8
- /**
9
- * Build a dropdown menu
10
- * @param itemSubmenuHandler - toolbar submenu handler
11
- * @returns The toolbar button menu builder
12
- */
13
- withMenu(itemSubmenuHandler: IToolbarItemSubmenuHandler): IToolbarMenuButtonItemBuilder {
14
- throw new Error("Method 'withMenu(itemSubmenuHandler: IToolbarItemSubmenuHandler)' must be implemented.");
15
- }
16
- }
@@ -1,15 +0,0 @@
1
- import { IToolbarButtonItemBuilder } from "./toolbar-item.builder";
2
-
3
- /**
4
- * Represents a toolbar toggle button and enables to set parametres to it
5
- */
6
- export abstract class IToolbarToggleButtonItemBuilder extends IToolbarButtonItemBuilder {
7
-
8
- /**
9
- *
10
- * @param value
11
- */
12
- withIsChecked(value: boolean): IToolbarToggleButtonItemBuilder {
13
- throw new Error("Method 'withIsChecked(value: boolean)' must be implemented.");
14
- }
15
- }
@@ -1,104 +0,0 @@
1
- import { IToolbarButtonItemBuilder } from "./toolbar-item.builder";
2
- import { IToolbarItemSubmenuHandler } from "./toolbar-item-submenu.handler";
3
- import { IToolbarMenuButtonItemBuilder } from "./toolbar-menu-item.builder";
4
- import { IToolbarToggleButtonItemBuilder } from "./toolbar-toggle-item.builder";
5
-
6
- export abstract class IToolbarBuilder {
7
-
8
- constructor() {
9
- if (this.constructor == IToolbarBuilder) {
10
- throw new Error("Abstract classes can't be instantiated.");
11
- }
12
- }
13
-
14
- /**
15
- * Adds a new separator to the associated toolbar
16
- * @param index - The index to put the new item at
17
- */
18
- addSeparator(index: number): void {
19
- throw new Error("Method 'addSeparator(index: number)' must be implemented.");
20
- }
21
-
22
- /**
23
- * Adds a new button to the associated toolbar
24
- * @param name - Internal item's name
25
- * @param index - The index to put the new item at
26
- */
27
- addButtonItem(name: string, index: number): IToolbarButtonItemBuilder {
28
- throw new Error("Method 'addButtonItem(name: string, index: number)' must be implemented.");
29
- }
30
-
31
- /**
32
- * Adds a new menu button to the associated toolbar
33
- * @param name - Internal item's name
34
- * @param index - The index to put the new item at
35
- */
36
- addMenuButtonItem(name: string, index: number): IToolbarMenuButtonItemBuilder {
37
- throw new Error("Method 'addMenuButtonItem(name: string, index: number)' must be implemented.");
38
- }
39
-
40
- /**
41
- * Adds a new toggle button to the associated toolbar
42
- * @param name - Internal item's name
43
- * @param index - The index to put the new item at
44
- */
45
- addToggleButtonItem(name: string, index: number): IToolbarToggleButtonItemBuilder {
46
- throw new Error("Method 'addToggleButtonItem(name: string, index: number)' must be implemented.");
47
- }
48
-
49
- /**
50
- * Replaces the item from the associated toolbar on button
51
- * @param name - The name of toolbar button to replace
52
- */
53
- replaceButtonItem(name: string): IToolbarButtonItemBuilder {
54
- throw new Error("Method 'replaceButtonItem(name: string)' must be implemented.");
55
- }
56
-
57
- /**
58
- * Replace the item from the associated toolbar on menu button
59
- * @param name - The name of toolbar menu button to replace
60
- */
61
- replaceMenuButtonItem(name: string): IToolbarMenuButtonItemBuilder {
62
- throw new Error("Method 'replaceMenuButtonItem(name: string)' must be implemented.");
63
- }
64
-
65
- /**
66
- * Enables to set parametres to menu button item submenu
67
- * @param name - Item's internal name
68
- * @param itemSubmenuHandler - The toolbar button menu builder
69
- */
70
- handleMenuButtonItemSubmenu(name: string, itemSubmenuHandler: IToolbarItemSubmenuHandler): void {
71
- throw new Error("Method 'handleMenuButtonItemSubmenu(name: string, itemSubmenuHandler: IToolbarItemSubmenuHandler)' must be implemented.");
72
- }
73
-
74
- /**
75
- * Replaces the item from the associated toolbar on toggle button
76
- * @param name - The name of toolbar toggle button to replace
77
- */
78
- replaceToggleButtonItem(name: string): IToolbarToggleButtonItemBuilder {
79
- throw new Error("Method 'replaceToggleButtonItem(name: string)' must be implemented.");
80
- }
81
-
82
- /**
83
- * Gets the list of existing item names of associated toolbar
84
- * @returns - Existing toolbar item names
85
- */
86
- get itemNames(): string[] {
87
- throw new Error("Getter 'itemNames()' must be implemented.");
88
- }
89
-
90
- /**
91
- * Gets count of toolbar items
92
- */
93
- get count(): number {
94
- throw new Error("Getter 'count()' must be implemented.");
95
- }
96
-
97
- /**
98
- * Removes specified item
99
- * @param itemName - Item's internal name
100
- */
101
- removeItem(itemName: string): void {
102
- throw new Error("Method 'removeItem(name: string)' must be implemented.");
103
- }
104
- }
@@ -1,31 +0,0 @@
1
- import { IToolbarBuilder } from "./toolbar.builder";
2
-
3
- /**
4
- * Interface that allows to add new items to the toolbar
5
- */
6
- export abstract class IToolbar<TToolbarContext> {
7
-
8
- constructor() {
9
- if (this.constructor == IToolbar<TToolbarContext>) {
10
- throw new Error("Abstract classes can't be instantiated.");
11
- }
12
- }
13
-
14
- /**
15
- * The method is called just before the toolbar is created
16
- * @param builder - the toolbar builder object of associated toolbar
17
- * @param context - context
18
- */
19
- build(builder: IToolbarBuilder, context: TToolbarContext): void {
20
- throw new Error("Method 'build(builder: IToolbarBuilder, context: TToolbarContext)' must be implemented.");
21
- }
22
-
23
- /**
24
- *
25
- * @param name
26
- * @param context
27
- */
28
- onToolbarItemClick(name: string, context: TToolbarContext): void {
29
- throw new Error("Method 'onToolbarItemClick(name: string, context: TToolbarContext)' must be implemented.");
30
- }
31
- }