@pilotdev/pilot-web-sdk 23.0.0-alpha.1 → 24.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.json +31 -0
- package/README.md +24 -5
- package/ng-package.json +6 -6
- package/package.json +13 -13
- package/src/lib/contexts/context.ts +38 -0
- package/src/lib/contexts/document-annotations-list-context.ts +21 -0
- package/src/lib/contexts/index.ts +3 -0
- package/src/lib/contexts/render-context.ts +28 -0
- package/src/lib/data/access.ts +40 -0
- package/src/lib/data/annotations.ts +20 -0
- package/src/lib/data/attribute.ts +33 -0
- package/src/lib/data/data-object.ts +78 -0
- package/src/lib/data/file.ts +25 -0
- package/src/lib/data/files-snapshot.ts +9 -0
- package/src/lib/data/index.ts +12 -0
- package/src/lib/data/modifier.ts +31 -0
- package/src/lib/data/object-builder.ts +111 -0
- package/src/lib/data/organisation-unit.ts +20 -0
- package/src/lib/data/person.ts +17 -0
- package/src/lib/data/relation.ts +10 -0
- package/src/lib/data/subscriptionType.ts +5 -0
- package/src/lib/idata.plugin.ts +1 -1
- package/src/lib/injectable/index.ts +4 -1
- package/src/lib/injectable/modifier-provider.ts +11 -0
- package/src/lib/injectable/objects-repository.ts +74 -0
- package/src/lib/injectable/render-context-provider.ts +11 -0
- package/src/lib/injectable/repository-events.ts +33 -0
- package/src/lib/menu/checkable-menu.builder.ts +14 -14
- package/src/lib/menu/index.ts +4 -4
- package/src/lib/menu/menu-item.builder.ts +44 -44
- package/src/lib/menu/menu.builder.ts +78 -78
- package/src/lib/menu/menu.ts +23 -23
- package/src/lib/toolbar/index.ts +6 -6
- package/src/lib/toolbar/toolbar-item-submenu.handler.ts +11 -3
- package/src/lib/toolbar/toolbar-item.builder.ts +44 -44
- package/src/lib/toolbar/toolbar-menu-item.builder.ts +15 -15
- package/src/lib/toolbar/toolbar-toggle-item.builder.ts +14 -14
- package/src/lib/toolbar/toolbar.builder.ts +103 -103
- package/src/lib/toolbar/toolbar.ts +30 -30
- package/src/lib/tools/attribute-permission.info.ts +51 -0
- package/src/lib/tools/guid.ts +63 -0
- package/src/lib/tools/index.ts +3 -0
- package/src/lib/tools/utils.ts +8 -0
- package/src/public-api.ts +10 -8
- package/tsconfig.lib.json +15 -14
- package/tsconfig.lib.prod.json +10 -10
- package/src/lib/context.ts +0 -25
- package/src/lib/injectable/objects.repository.ts +0 -7
@@ -0,0 +1,74 @@
|
|
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
|
+
|
@@ -0,0 +1,33 @@
|
|
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 +1,15 @@
|
|
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
|
-
}
|
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
15
|
}
|
package/src/lib/menu/index.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
export * from './menu';
|
3
|
-
export * from './checkable-menu.builder';
|
4
|
-
export * from './menu-item.builder';
|
1
|
+
|
2
|
+
export * from './menu';
|
3
|
+
export * from './checkable-menu.builder';
|
4
|
+
export * from './menu-item.builder';
|
5
5
|
export * from './menu.builder';
|
@@ -1,45 +1,45 @@
|
|
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
|
-
}
|
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
45
|
}
|
@@ -1,79 +1,79 @@
|
|
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
|
-
}
|
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
79
|
}
|
package/src/lib/menu/menu.ts
CHANGED
@@ -1,24 +1,24 @@
|
|
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
|
-
}
|
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
24
|
}
|
package/src/lib/toolbar/index.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
|
2
|
-
export * from './toolbar';
|
3
|
-
export * from './toolbar-item.builder';
|
4
|
-
export * from './toolbar-item-submenu.handler';
|
5
|
-
export * from './toolbar-menu-item.builder';
|
6
|
-
export * from './toolbar-toggle-item.builder';
|
1
|
+
|
2
|
+
export * from './toolbar';
|
3
|
+
export * from './toolbar-item.builder';
|
4
|
+
export * from './toolbar-item-submenu.handler';
|
5
|
+
export * from './toolbar-menu-item.builder';
|
6
|
+
export * from './toolbar-toggle-item.builder';
|
7
7
|
export * from './toolbar.builder';
|
@@ -1,4 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
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
|
+
}
|
4
12
|
}
|
@@ -1,45 +1,45 @@
|
|
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
|
-
}
|
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
45
|
}
|
@@ -1,16 +1,16 @@
|
|
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
|
-
}
|
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
16
|
}
|
@@ -1,15 +1,15 @@
|
|
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
|
-
}
|
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
15
|
}
|