@pilotdev/pilot-web-sdk 23.0.0-alpha.2 → 24.4.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -5
- package/esm2020/lib/contexts/context.mjs +29 -0
- package/esm2020/lib/contexts/document-annotations-list-context.mjs +15 -0
- package/esm2020/lib/contexts/index.mjs +4 -0
- package/esm2020/lib/contexts/render-context.mjs +22 -0
- package/esm2020/lib/data/access.mjs +26 -0
- package/esm2020/lib/data/annotations.mjs +2 -0
- package/esm2020/lib/data/attribute.mjs +17 -0
- package/esm2020/lib/data/data-object.mjs +19 -0
- package/esm2020/lib/data/file.mjs +2 -0
- package/esm2020/lib/data/files-snapshot.mjs +2 -0
- package/esm2020/lib/data/index.mjs +13 -0
- package/esm2020/lib/data/modifier.mjs +2 -0
- package/esm2020/lib/data/object-builder.mjs +2 -0
- package/esm2020/lib/data/organisation-unit.mjs +7 -0
- package/esm2020/lib/data/person.mjs +2 -0
- package/esm2020/lib/data/relation.mjs +2 -0
- package/esm2020/lib/data/subscriptionType.mjs +6 -0
- package/esm2020/lib/idata.plugin.mjs +2 -2
- package/esm2020/lib/injectable/index.mjs +5 -2
- package/esm2020/lib/injectable/modifier-provider.mjs +2 -0
- package/esm2020/lib/injectable/objects-repository.mjs +2 -0
- package/esm2020/lib/injectable/render-context-provider.mjs +2 -0
- package/esm2020/lib/injectable/repository-events.mjs +2 -0
- package/esm2020/lib/menu/checkable-menu.builder.mjs +14 -14
- package/esm2020/lib/menu/index.mjs +5 -5
- package/esm2020/lib/menu/menu-item.builder.mjs +39 -39
- package/esm2020/lib/menu/menu.builder.mjs +68 -68
- package/esm2020/lib/menu/menu.mjs +22 -22
- package/esm2020/lib/toolbar/index.mjs +7 -7
- package/esm2020/lib/toolbar/toolbar-item-submenu.handler.mjs +11 -3
- package/esm2020/lib/toolbar/toolbar-item.builder.mjs +41 -41
- package/esm2020/lib/toolbar/toolbar-menu-item.builder.mjs +15 -15
- package/esm2020/lib/toolbar/toolbar-toggle-item.builder.mjs +14 -14
- package/esm2020/lib/toolbar/toolbar.builder.mjs +88 -88
- package/esm2020/lib/toolbar/toolbar.mjs +27 -27
- package/esm2020/lib/tools/attribute-permission.info.mjs +41 -0
- package/esm2020/lib/tools/guid.mjs +53 -0
- package/esm2020/lib/tools/index.mjs +4 -0
- package/esm2020/lib/tools/utils.mjs +8 -0
- package/esm2020/pilotdev-pilot-web-sdk.mjs +4 -4
- package/esm2020/public-api.mjs +11 -9
- package/fesm2015/pilotdev-pilot-web-sdk.mjs +561 -322
- package/fesm2015/pilotdev-pilot-web-sdk.mjs.map +1 -1
- package/fesm2020/pilotdev-pilot-web-sdk.mjs +561 -322
- package/fesm2020/pilotdev-pilot-web-sdk.mjs.map +1 -1
- package/index.d.ts +5 -5
- package/lib/contexts/context.d.ts +22 -0
- package/lib/contexts/document-annotations-list-context.d.ts +12 -0
- package/lib/contexts/index.d.ts +3 -0
- package/lib/contexts/render-context.d.ts +17 -0
- package/lib/data/access.d.ts +35 -0
- package/lib/data/annotations.d.ts +15 -0
- package/lib/data/attribute.d.ts +30 -0
- package/lib/data/data-object.d.ts +74 -0
- package/lib/data/file.d.ts +23 -0
- package/lib/data/files-snapshot.d.ts +8 -0
- package/lib/data/index.d.ts +12 -0
- package/lib/data/modifier.d.ts +30 -0
- package/lib/data/object-builder.d.ts +110 -0
- package/lib/data/organisation-unit.d.ts +18 -0
- package/lib/data/person.d.ts +17 -0
- package/lib/data/relation.d.ts +8 -0
- package/lib/data/subscriptionType.d.ts +4 -0
- package/lib/idata.plugin.d.ts +2 -2
- package/lib/injectable/index.d.ts +4 -1
- package/lib/injectable/modifier-provider.d.ts +10 -0
- package/lib/injectable/objects-repository.d.ts +72 -0
- package/lib/injectable/render-context-provider.d.ts +10 -0
- package/lib/injectable/repository-events.d.ts +31 -0
- package/lib/menu/checkable-menu.builder.d.ts +11 -11
- package/lib/menu/index.d.ts +4 -4
- package/lib/menu/menu-item.builder.d.ts +27 -27
- package/lib/menu/menu.builder.d.ts +49 -49
- package/lib/menu/menu.d.ts +18 -18
- package/lib/toolbar/index.d.ts +6 -6
- package/lib/toolbar/toolbar-item-submenu.handler.d.ts +9 -2
- package/lib/toolbar/toolbar-item.builder.d.ts +28 -28
- package/lib/toolbar/toolbar-menu-item.builder.d.ts +13 -13
- package/lib/toolbar/toolbar-toggle-item.builder.d.ts +11 -11
- package/lib/toolbar/toolbar.builder.d.ts +65 -65
- package/lib/toolbar/toolbar.d.ts +19 -19
- package/lib/tools/attribute-permission.info.d.ts +8 -0
- package/lib/tools/guid.d.ts +7 -0
- package/lib/tools/index.d.ts +3 -0
- package/lib/tools/utils.d.ts +3 -0
- package/package.json +5 -5
- package/public-api.d.ts +7 -5
- package/esm2020/lib/context.mjs +0 -11
- package/esm2020/lib/injectable/objects.repository.mjs +0 -2
- package/lib/context.d.ts +0 -18
- package/lib/injectable/objects.repository.d.ts +0 -5
@@ -1,22 +1,22 @@
|
|
1
|
-
/**
|
2
|
-
* Interface that allows to add new items to the menu and context menus
|
3
|
-
*/
|
4
|
-
export class IMenu {
|
5
|
-
/**
|
6
|
-
* The method is called just before the menu is shown
|
7
|
-
* @param builder The menu builder object of associated menu
|
8
|
-
* @param context Context
|
9
|
-
*/
|
10
|
-
build(builder, context) {
|
11
|
-
throw new Error("Method 'build(builder: IMenuBuilder, context: TMenuContext)' must be implemented.");
|
12
|
-
}
|
13
|
-
/**
|
14
|
-
*
|
15
|
-
* @param name
|
16
|
-
* @param context
|
17
|
-
*/
|
18
|
-
onMenuItemClick(name, context) {
|
19
|
-
throw new Error("Method 'onMenuItemClick(name: string, context: TMenuContext)' must be implemented.");
|
20
|
-
}
|
21
|
-
}
|
22
|
-
//# sourceMappingURL=data:application/json;base64,
|
1
|
+
/**
|
2
|
+
* Interface that allows to add new items to the menu and context menus
|
3
|
+
*/
|
4
|
+
export class IMenu {
|
5
|
+
/**
|
6
|
+
* The method is called just before the menu is shown
|
7
|
+
* @param builder The menu builder object of associated menu
|
8
|
+
* @param context Context
|
9
|
+
*/
|
10
|
+
build(builder, context) {
|
11
|
+
throw new Error("Method 'build(builder: IMenuBuilder, context: TMenuContext)' must be implemented.");
|
12
|
+
}
|
13
|
+
/**
|
14
|
+
*
|
15
|
+
* @param name
|
16
|
+
* @param context
|
17
|
+
*/
|
18
|
+
onMenuItemClick(name, context) {
|
19
|
+
throw new Error("Method 'onMenuItemClick(name: string, context: TMenuContext)' must be implemented.");
|
20
|
+
}
|
21
|
+
}
|
22
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVudS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3BpbG90LXdlYi1zZGsvc3JjL2xpYi9tZW51L21lbnUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUE7O0dBRUc7QUFDSCxNQUFNLE9BQWdCLEtBQUs7SUFDekI7Ozs7T0FJRztJQUNILEtBQUssQ0FBQyxPQUFxQixFQUFFLE9BQXFCO1FBQ2hELE1BQU0sSUFBSSxLQUFLLENBQUMsbUZBQW1GLENBQUMsQ0FBQztJQUN2RyxDQUFDO0lBRUQ7Ozs7T0FJRztJQUNILGVBQWUsQ0FBQyxJQUFZLEVBQUUsT0FBcUI7UUFDakQsTUFBTSxJQUFJLEtBQUssQ0FBQyxvRkFBb0YsQ0FBQyxDQUFDO0lBQ3hHLENBQUM7Q0FDRiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IElNZW51QnVpbGRlciB9IGZyb20gXCIuL21lbnUuYnVpbGRlclwiO1xuXG4vKipcbiAqIEludGVyZmFjZSB0aGF0IGFsbG93cyB0byBhZGQgbmV3IGl0ZW1zIHRvIHRoZSBtZW51IGFuZCBjb250ZXh0IG1lbnVzXG4gKi9cbmV4cG9ydCBhYnN0cmFjdCBjbGFzcyBJTWVudTxUTWVudUNvbnRleHQ+IHtcbiAgLyoqXG4gICAqIFRoZSBtZXRob2QgaXMgY2FsbGVkIGp1c3QgYmVmb3JlIHRoZSBtZW51IGlzIHNob3duXG4gICAqIEBwYXJhbSBidWlsZGVyIFRoZSBtZW51IGJ1aWxkZXIgb2JqZWN0IG9mIGFzc29jaWF0ZWQgbWVudVxuICAgKiBAcGFyYW0gY29udGV4dCBDb250ZXh0XG4gICAqL1xuICBidWlsZChidWlsZGVyOiBJTWVudUJ1aWxkZXIsIGNvbnRleHQ6IFRNZW51Q29udGV4dCk6IHZvaWQge1xuICAgIHRocm93IG5ldyBFcnJvcihcIk1ldGhvZCAnYnVpbGQoYnVpbGRlcjogSU1lbnVCdWlsZGVyLCBjb250ZXh0OiBUTWVudUNvbnRleHQpJyBtdXN0IGJlIGltcGxlbWVudGVkLlwiKTtcbiAgfVxuICBcbiAgLyoqXG4gICAqIFxuICAgKiBAcGFyYW0gbmFtZSBcbiAgICogQHBhcmFtIGNvbnRleHQgXG4gICAqL1xuICBvbk1lbnVJdGVtQ2xpY2sobmFtZTogc3RyaW5nLCBjb250ZXh0OiBUTWVudUNvbnRleHQpOiB2b2lkIHtcbiAgICB0aHJvdyBuZXcgRXJyb3IoXCJNZXRob2QgJ29uTWVudUl0ZW1DbGljayhuYW1lOiBzdHJpbmcsIGNvbnRleHQ6IFRNZW51Q29udGV4dCknIG11c3QgYmUgaW1wbGVtZW50ZWQuXCIpO1xuICB9XG59Il19
|
@@ -1,7 +1,7 @@
|
|
1
|
-
export * from './toolbar';
|
2
|
-
export * from './toolbar-item.builder';
|
3
|
-
export * from './toolbar-item-submenu.handler';
|
4
|
-
export * from './toolbar-menu-item.builder';
|
5
|
-
export * from './toolbar-toggle-item.builder';
|
6
|
-
export * from './toolbar.builder';
|
7
|
-
//# sourceMappingURL=data:application/json;base64,
|
1
|
+
export * from './toolbar';
|
2
|
+
export * from './toolbar-item.builder';
|
3
|
+
export * from './toolbar-item-submenu.handler';
|
4
|
+
export * from './toolbar-menu-item.builder';
|
5
|
+
export * from './toolbar-toggle-item.builder';
|
6
|
+
export * from './toolbar.builder';
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9waWxvdC13ZWItc2RrL3NyYy9saWIvdG9vbGJhci9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxjQUFjLFdBQVcsQ0FBQztBQUMxQixjQUFjLHdCQUF3QixDQUFDO0FBQ3ZDLGNBQWMsZ0NBQWdDLENBQUM7QUFDL0MsY0FBYyw2QkFBNkIsQ0FBQztBQUM1QyxjQUFjLCtCQUErQixDQUFDO0FBQzlDLGNBQWMsbUJBQW1CLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJcbmV4cG9ydCAqIGZyb20gJy4vdG9vbGJhcic7XG5leHBvcnQgKiBmcm9tICcuL3Rvb2xiYXItaXRlbS5idWlsZGVyJztcbmV4cG9ydCAqIGZyb20gJy4vdG9vbGJhci1pdGVtLXN1Ym1lbnUuaGFuZGxlcic7XG5leHBvcnQgKiBmcm9tICcuL3Rvb2xiYXItbWVudS1pdGVtLmJ1aWxkZXInO1xuZXhwb3J0ICogZnJvbSAnLi90b29sYmFyLXRvZ2dsZS1pdGVtLmJ1aWxkZXInO1xuZXhwb3J0ICogZnJvbSAnLi90b29sYmFyLmJ1aWxkZXInOyJdfQ==
|
@@ -1,3 +1,11 @@
|
|
1
|
-
export class IToolbarItemSubmenuHandler {
|
2
|
-
|
3
|
-
|
1
|
+
export class IToolbarItemSubmenuHandler {
|
2
|
+
/**
|
3
|
+
* Build a submenu
|
4
|
+
* @param builder - toolbar builder
|
5
|
+
* @returns
|
6
|
+
*/
|
7
|
+
onSubmenuRequested(builder) {
|
8
|
+
throw new Error("Method 'onSubmenuRequested(builder: IToolbarBuilder)' must be implemented.");
|
9
|
+
}
|
10
|
+
}
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbGJhci1pdGVtLXN1Ym1lbnUuaGFuZGxlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3BpbG90LXdlYi1zZGsvc3JjL2xpYi90b29sYmFyL3Rvb2xiYXItaXRlbS1zdWJtZW51LmhhbmRsZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsTUFBTSxPQUFnQiwwQkFBMEI7SUFDN0M7Ozs7TUFJRTtJQUNELGtCQUFrQixDQUFDLE9BQXdCO1FBQ3pDLE1BQU0sSUFBSSxLQUFLLENBQUMsNEVBQTRFLENBQUMsQ0FBQztJQUNsRyxDQUFDO0NBQ0YiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBJVG9vbGJhckJ1aWxkZXIgfSBmcm9tIFwiLi90b29sYmFyLmJ1aWxkZXJcIjtcblxuZXhwb3J0IGFic3RyYWN0IGNsYXNzIElUb29sYmFySXRlbVN1Ym1lbnVIYW5kbGVyIHtcbiAgIC8qKlxuICAgKiBCdWlsZCBhIHN1Ym1lbnVcbiAgICogQHBhcmFtIGJ1aWxkZXIgLSB0b29sYmFyIGJ1aWxkZXJcbiAgICogQHJldHVybnNcbiAgICovXG4gICAgb25TdWJtZW51UmVxdWVzdGVkKGJ1aWxkZXI6IElUb29sYmFyQnVpbGRlcik6IHZvaWQge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKFwiTWV0aG9kICdvblN1Ym1lbnVSZXF1ZXN0ZWQoYnVpbGRlcjogSVRvb2xiYXJCdWlsZGVyKScgbXVzdCBiZSBpbXBsZW1lbnRlZC5cIik7XG4gIH1cbn0iXX0=
|
@@ -1,41 +1,41 @@
|
|
1
|
-
/**
|
2
|
-
* Represents a toolbar button and enables to set parametres to it
|
3
|
-
*/
|
4
|
-
export class IToolbarButtonItemBuilder {
|
5
|
-
constructor() {
|
6
|
-
if (this.constructor == IToolbarButtonItemBuilder) {
|
7
|
-
throw new Error("Abstract classes can't be instantiated.");
|
8
|
-
}
|
9
|
-
}
|
10
|
-
/**
|
11
|
-
* Item's name to be displayed
|
12
|
-
* @param header - value
|
13
|
-
* @returns instance of IToolbarButtonItemBuilder
|
14
|
-
*/
|
15
|
-
withHeader(header) {
|
16
|
-
throw new Error("Method 'withHeader(header: string)' must be implemented.");
|
17
|
-
}
|
18
|
-
/**
|
19
|
-
* Item's icon in SVG format
|
20
|
-
* @param name - icon name
|
21
|
-
* @param svg - url icon or base64 string
|
22
|
-
*/
|
23
|
-
withIcon(name, svg) {
|
24
|
-
throw new Error("Method 'withIcon(name: string, svg: string)' must be implemented.");
|
25
|
-
}
|
26
|
-
/**
|
27
|
-
* Enabled the item
|
28
|
-
* @param value - value
|
29
|
-
*/
|
30
|
-
withIsEnabled(value) {
|
31
|
-
throw new Error("Method 'withIsEnabled(value: boolean)' must be implemented.");
|
32
|
-
}
|
33
|
-
/**
|
34
|
-
* Item's hint
|
35
|
-
* @param hint - value
|
36
|
-
*/
|
37
|
-
withHint(hint) {
|
38
|
-
throw new Error("Method 'withHint(hint: string)' must be implemented.");
|
39
|
-
}
|
40
|
-
}
|
41
|
-
//# sourceMappingURL=data:application/json;base64,
|
1
|
+
/**
|
2
|
+
* Represents a toolbar button and enables to set parametres to it
|
3
|
+
*/
|
4
|
+
export class IToolbarButtonItemBuilder {
|
5
|
+
constructor() {
|
6
|
+
if (this.constructor == IToolbarButtonItemBuilder) {
|
7
|
+
throw new Error("Abstract classes can't be instantiated.");
|
8
|
+
}
|
9
|
+
}
|
10
|
+
/**
|
11
|
+
* Item's name to be displayed
|
12
|
+
* @param header - value
|
13
|
+
* @returns instance of IToolbarButtonItemBuilder
|
14
|
+
*/
|
15
|
+
withHeader(header) {
|
16
|
+
throw new Error("Method 'withHeader(header: string)' must be implemented.");
|
17
|
+
}
|
18
|
+
/**
|
19
|
+
* Item's icon in SVG format
|
20
|
+
* @param name - icon name
|
21
|
+
* @param svg - url icon or base64 string
|
22
|
+
*/
|
23
|
+
withIcon(name, svg) {
|
24
|
+
throw new Error("Method 'withIcon(name: string, svg: string)' must be implemented.");
|
25
|
+
}
|
26
|
+
/**
|
27
|
+
* Enabled the item
|
28
|
+
* @param value - value
|
29
|
+
*/
|
30
|
+
withIsEnabled(value) {
|
31
|
+
throw new Error("Method 'withIsEnabled(value: boolean)' must be implemented.");
|
32
|
+
}
|
33
|
+
/**
|
34
|
+
* Item's hint
|
35
|
+
* @param hint - value
|
36
|
+
*/
|
37
|
+
withHint(hint) {
|
38
|
+
throw new Error("Method 'withHint(hint: string)' must be implemented.");
|
39
|
+
}
|
40
|
+
}
|
41
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbGJhci1pdGVtLmJ1aWxkZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9waWxvdC13ZWItc2RrL3NyYy9saWIvdG9vbGJhci90b29sYmFyLWl0ZW0uYnVpbGRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUNILE1BQU0sT0FBZ0IseUJBQXlCO0lBRTdDO1FBQ0UsSUFBSSxJQUFJLENBQUMsV0FBVyxJQUFJLHlCQUF5QixFQUFFO1lBQ2pELE1BQU0sSUFBSSxLQUFLLENBQUMseUNBQXlDLENBQUMsQ0FBQztTQUM1RDtJQUNILENBQUM7SUFFRDs7OztPQUlHO0lBQ0gsVUFBVSxDQUFDLE1BQWM7UUFDdkIsTUFBTSxJQUFJLEtBQUssQ0FBQywwREFBMEQsQ0FBQyxDQUFDO0lBQzlFLENBQUM7SUFFRDs7OztPQUlHO0lBQ0gsUUFBUSxDQUFDLElBQVksRUFBRSxHQUFXO1FBQ2hDLE1BQU0sSUFBSSxLQUFLLENBQUMsbUVBQW1FLENBQUMsQ0FBQztJQUN2RixDQ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biBTVkcgZm9ybWF0XG4gICAqIEBwYXJhbSBuYW1lIC0gaWNvbiBuYW1lXG4gICAqIEBwYXJhbSBzdmcgLSB1cmwgaWNvbiBvciBiYXNlNjQgc3RyaW5nXG4gICAqL1xuICB3aXRoSWNvbihuYW1lOiBzdHJpbmcsIHN2Zzogc3RyaW5nKTogSVRvb2xiYXJCdXR0b25JdGVtQnVpbGRlciB7XG4gICAgdGhyb3cgbmV3IEVycm9yKFwiTWV0aG9kICd3aXRoSWNvbihuYW1lOiBzdHJpbmcsIHN2Zzogc3RyaW5nKScgbXVzdCBiZSBpbXBsZW1lbnRlZC5cIik7XG4gIH1cblxuICAvKipcbiAgICogRW5hYmxlZCB0aGUgaXRlbVxuICAgKiBAcGFyYW0gdmFsdWUgLSB2YWx1ZVxuICAgKi9cbiAgd2l0aElzRW5hYmxlZCh2YWx1ZTogYm9vbGVhbik6IElUb29sYmFyQnV0dG9uSXRlbUJ1aWxkZXIge1xuICAgIHRocm93IG5ldyBFcnJvcihcIk1ldGhvZCAnd2l0aElzRW5hYmxlZCh2YWx1ZTogYm9vbGVhbiknIG11c3QgYmUgaW1wbGVtZW50ZWQuXCIpO1xuICB9XG5cbiAgLyoqXG4gICAqIEl0ZW0ncyBoaW50XG4gICAqIEBwYXJhbSBoaW50IC0gdmFsdWVcbiAgICovXG4gIHdpdGhIaW50KGhpbnQ6ICBzdHJpbmcpOiBJVG9vbGJhckJ1dHRvbkl0ZW1CdWlsZGVyIHtcbiAgICB0aHJvdyBuZXcgRXJyb3IoXCJNZXRob2QgJ3dpdGhIaW50KGhpbnQ6ICBzdHJpbmcpJyBtdXN0IGJlIGltcGxlbWVudGVkLlwiKTtcbiAgfVxufSJdfQ==
|
@@ -1,15 +1,15 @@
|
|
1
|
-
import { IToolbarButtonItemBuilder } from "./toolbar-item.builder";
|
2
|
-
/**
|
3
|
-
* Represents a toolbar menu button and enables to set parametres to it
|
4
|
-
*/
|
5
|
-
export class IToolbarMenuButtonItemBuilder extends IToolbarButtonItemBuilder {
|
6
|
-
/**
|
7
|
-
* Build a dropdown menu
|
8
|
-
* @param itemSubmenuHandler - toolbar submenu handler
|
9
|
-
* @returns The toolbar button menu builder
|
10
|
-
*/
|
11
|
-
withMenu(itemSubmenuHandler) {
|
12
|
-
throw new Error("Method 'withMenu(itemSubmenuHandler: IToolbarItemSubmenuHandler)' must be implemented.");
|
13
|
-
}
|
14
|
-
}
|
15
|
-
//# sourceMappingURL=data:application/json;base64,
|
1
|
+
import { IToolbarButtonItemBuilder } from "./toolbar-item.builder";
|
2
|
+
/**
|
3
|
+
* Represents a toolbar menu button and enables to set parametres to it
|
4
|
+
*/
|
5
|
+
export class IToolbarMenuButtonItemBuilder extends IToolbarButtonItemBuilder {
|
6
|
+
/**
|
7
|
+
* Build a dropdown menu
|
8
|
+
* @param itemSubmenuHandler - toolbar submenu handler
|
9
|
+
* @returns The toolbar button menu builder
|
10
|
+
*/
|
11
|
+
withMenu(itemSubmenuHandler) {
|
12
|
+
throw new Error("Method 'withMenu(itemSubmenuHandler: IToolbarItemSubmenuHandler)' must be implemented.");
|
13
|
+
}
|
14
|
+
}
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbGJhci1tZW51LWl0ZW0uYnVpbGRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3BpbG90LXdlYi1zZGsvc3JjL2xpYi90b29sYmFyL3Rvb2xiYXItbWVudS1pdGVtLmJ1aWxkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLHlCQUF5QixFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFHbkU7O0dBRUc7QUFDSCxNQUFNLE9BQWdCLDZCQUE4QixTQUFRLHlCQUF5QjtJQUNuRjs7OztPQUlHO0lBQ0gsUUFBUSxDQUFDLGtCQUE4QztRQUNyRCxNQ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olbar-item.builder";
|
2
|
-
/**
|
3
|
-
* Represents a toolbar toggle button and enables to set parametres to it
|
4
|
-
*/
|
5
|
-
export class IToolbarToggleButtonItemBuilder extends IToolbarButtonItemBuilder {
|
6
|
-
/**
|
7
|
-
*
|
8
|
-
* @param value
|
9
|
-
*/
|
10
|
-
withIsChecked(value) {
|
11
|
-
throw new Error("Method 'withIsChecked(value: boolean)' must be implemented.");
|
12
|
-
}
|
13
|
-
}
|
14
|
-
//# sourceMappingURL=data:application/json;base64,
|
1
|
+
import { IToolbarButtonItemBuilder } from "./toolbar-item.builder";
|
2
|
+
/**
|
3
|
+
* Represents a toolbar toggle button and enables to set parametres to it
|
4
|
+
*/
|
5
|
+
export class IToolbarToggleButtonItemBuilder extends IToolbarButtonItemBuilder {
|
6
|
+
/**
|
7
|
+
*
|
8
|
+
* @param value
|
9
|
+
*/
|
10
|
+
withIsChecked(value) {
|
11
|
+
throw new Error("Method 'withIsChecked(value: boolean)' must be implemented.");
|
12
|
+
}
|
13
|
+
}
|
14
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbGJhci10b2dnbGUtaXRlbS5idWlsZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvcGlsb3Qtd2ViLXNkay9zcmMvbGliL3Rvb2xiYXIvdG9vbGJhci10b2dnbGUtaXRlbS5idWlsZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSx5QkFBeUIsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBRW5FOztHQUVHO0FBQ0gsTUFBTSxPQUFnQiwrQkFBZ0MsU0FBUSx5QkFBeUI7SUFFckY7OztPQUdHO0lBQ0gsYUFBYSxDQUFDLEtBQWM7UUFDMUIsTUFBTSxJQUFJLEtBQUssQ0FBQyw2REFBNkQsQ0FBQyxDQUFDO0lBQ2pGLENBQUM7Q0FDRiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IElUb29sYmFyQnV0dG9uSXRlbUJ1aWxkZXIgfSBmcm9tIFwiLi90b29sYmFyLWl0ZW0uYnVpbGRlclwiO1xuXG4vKipcbiAqIFJlcHJlc2VudHMgYSB0b29sYmFyIHRvZ2dsZSBidXR0b24gYW5kIGVuYWJsZXMgdG8gc2V0IHBhcmFtZXRyZXMgdG8gaXRcbiAqL1xuZXhwb3J0IGFic3RyYWN0IGNsYXNzIElUb29sYmFyVG9nZ2xlQnV0dG9uSXRlbUJ1aWxkZXIgZXh0ZW5kcyBJVG9vbGJhckJ1dHRvbkl0ZW1CdWlsZGVyIHtcbiAgXG4gIC8qKlxuICAgKiBcbiAgICogQHBhcmFtIHZhbHVlIFxuICAgKi9cbiAgd2l0aElzQ2hlY2tlZCh2YWx1ZTogYm9vbGVhbik6IElUb29sYmFyVG9nZ2xlQnV0dG9uSXRlbUJ1aWxkZXIge1xuICAgIHRocm93IG5ldyBFcnJvcihcIk1ldGhvZCAnd2l0aElzQ2hlY2tlZCh2YWx1ZTogYm9vbGVhbiknIG11c3QgYmUgaW1wbGVtZW50ZWQuXCIpO1xuICB9XG59Il19
|
@@ -1,88 +1,88 @@
|
|
1
|
-
export class IToolbarBuilder {
|
2
|
-
constructor() {
|
3
|
-
if (this.constructor == IToolbarBuilder) {
|
4
|
-
throw new Error("Abstract classes can't be instantiated.");
|
5
|
-
}
|
6
|
-
}
|
7
|
-
/**
|
8
|
-
* Adds a new separator to the associated toolbar
|
9
|
-
* @param index - The index to put the new item at
|
10
|
-
*/
|
11
|
-
addSeparator(index) {
|
12
|
-
throw new Error("Method 'addSeparator(index: number)' must be implemented.");
|
13
|
-
}
|
14
|
-
/**
|
15
|
-
* Adds a new button to the associated toolbar
|
16
|
-
* @param name - Internal item's name
|
17
|
-
* @param index - The index to put the new item at
|
18
|
-
*/
|
19
|
-
addButtonItem(name, index) {
|
20
|
-
throw new Error("Method 'addButtonItem(name: string, index: number)' must be implemented.");
|
21
|
-
}
|
22
|
-
/**
|
23
|
-
* Adds a new menu 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
|
-
addMenuButtonItem(name, index) {
|
28
|
-
throw new Error("Method 'addMenuButtonItem(name: string, index: number)' must be implemented.");
|
29
|
-
}
|
30
|
-
/**
|
31
|
-
* Adds a new toggle button to the associated toolbar
|
32
|
-
* @param name - Internal item's name
|
33
|
-
* @param index - The index to put the new item at
|
34
|
-
*/
|
35
|
-
addToggleButtonItem(name, index) {
|
36
|
-
throw new Error("Method 'addToggleButtonItem(name: string, index: number)' must be implemented.");
|
37
|
-
}
|
38
|
-
/**
|
39
|
-
* Replaces the item from the associated toolbar on button
|
40
|
-
* @param name - The name of toolbar button to replace
|
41
|
-
*/
|
42
|
-
replaceButtonItem(name) {
|
43
|
-
throw new Error("Method 'replaceButtonItem(name: string)' must be implemented.");
|
44
|
-
}
|
45
|
-
/**
|
46
|
-
* Replace the item from the associated toolbar on menu button
|
47
|
-
* @param name - The name of toolbar menu button to replace
|
48
|
-
*/
|
49
|
-
replaceMenuButtonItem(name) {
|
50
|
-
throw new Error("Method 'replaceMenuButtonItem(name: string)' must be implemented.");
|
51
|
-
}
|
52
|
-
/**
|
53
|
-
* Enables to set parametres to menu button item submenu
|
54
|
-
* @param name - Item's internal name
|
55
|
-
* @param itemSubmenuHandler - The toolbar button menu builder
|
56
|
-
*/
|
57
|
-
handleMenuButtonItemSubmenu(name, itemSubmenuHandler) {
|
58
|
-
throw new Error("Method 'handleMenuButtonItemSubmenu(name: string, itemSubmenuHandler: IToolbarItemSubmenuHandler)' must be implemented.");
|
59
|
-
}
|
60
|
-
/**
|
61
|
-
* Replaces the item from the associated toolbar on toggle button
|
62
|
-
* @param name - The name of toolbar toggle button to replace
|
63
|
-
*/
|
64
|
-
replaceToggleButtonItem(name) {
|
65
|
-
throw new Error("Method 'replaceToggleButtonItem(name: string)' must be implemented.");
|
66
|
-
}
|
67
|
-
/**
|
68
|
-
* Gets the list of existing item names of associated toolbar
|
69
|
-
* @returns - Existing toolbar item names
|
70
|
-
*/
|
71
|
-
get itemNames() {
|
72
|
-
throw new Error("Getter 'itemNames()' must be implemented.");
|
73
|
-
}
|
74
|
-
/**
|
75
|
-
* Gets count of toolbar items
|
76
|
-
*/
|
77
|
-
get count() {
|
78
|
-
throw new Error("Getter 'count()' must be implemented.");
|
79
|
-
}
|
80
|
-
/**
|
81
|
-
* Removes specified item
|
82
|
-
* @param itemName - Item's internal name
|
83
|
-
*/
|
84
|
-
removeItem(itemName) {
|
85
|
-
throw new Error("Method 'removeItem(name: string)' must be implemented.");
|
86
|
-
}
|
87
|
-
}
|
88
|
-
//# sourceMappingURL=data:application/json;base64,
|
1
|
+
export class IToolbarBuilder {
|
2
|
+
constructor() {
|
3
|
+
if (this.constructor == IToolbarBuilder) {
|
4
|
+
throw new Error("Abstract classes can't be instantiated.");
|
5
|
+
}
|
6
|
+
}
|
7
|
+
/**
|
8
|
+
* Adds a new separator to the associated toolbar
|
9
|
+
* @param index - The index to put the new item at
|
10
|
+
*/
|
11
|
+
addSeparator(index) {
|
12
|
+
throw new Error("Method 'addSeparator(index: number)' must be implemented.");
|
13
|
+
}
|
14
|
+
/**
|
15
|
+
* Adds a new button to the associated toolbar
|
16
|
+
* @param name - Internal item's name
|
17
|
+
* @param index - The index to put the new item at
|
18
|
+
*/
|
19
|
+
addButtonItem(name, index) {
|
20
|
+
throw new Error("Method 'addButtonItem(name: string, index: number)' must be implemented.");
|
21
|
+
}
|
22
|
+
/**
|
23
|
+
* Adds a new menu 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
|
+
addMenuButtonItem(name, index) {
|
28
|
+
throw new Error("Method 'addMenuButtonItem(name: string, index: number)' must be implemented.");
|
29
|
+
}
|
30
|
+
/**
|
31
|
+
* Adds a new toggle button to the associated toolbar
|
32
|
+
* @param name - Internal item's name
|
33
|
+
* @param index - The index to put the new item at
|
34
|
+
*/
|
35
|
+
addToggleButtonItem(name, index) {
|
36
|
+
throw new Error("Method 'addToggleButtonItem(name: string, index: number)' must be implemented.");
|
37
|
+
}
|
38
|
+
/**
|
39
|
+
* Replaces the item from the associated toolbar on button
|
40
|
+
* @param name - The name of toolbar button to replace
|
41
|
+
*/
|
42
|
+
replaceButtonItem(name) {
|
43
|
+
throw new Error("Method 'replaceButtonItem(name: string)' must be implemented.");
|
44
|
+
}
|
45
|
+
/**
|
46
|
+
* Replace the item from the associated toolbar on menu button
|
47
|
+
* @param name - The name of toolbar menu button to replace
|
48
|
+
*/
|
49
|
+
replaceMenuButtonItem(name) {
|
50
|
+
throw new Error("Method 'replaceMenuButtonItem(name: string)' must be implemented.");
|
51
|
+
}
|
52
|
+
/**
|
53
|
+
* Enables to set parametres to menu button item submenu
|
54
|
+
* @param name - Item's internal name
|
55
|
+
* @param itemSubmenuHandler - The toolbar button menu builder
|
56
|
+
*/
|
57
|
+
handleMenuButtonItemSubmenu(name, itemSubmenuHandler) {
|
58
|
+
throw new Error("Method 'handleMenuButtonItemSubmenu(name: string, itemSubmenuHandler: IToolbarItemSubmenuHandler)' must be implemented.");
|
59
|
+
}
|
60
|
+
/**
|
61
|
+
* Replaces the item from the associated toolbar on toggle button
|
62
|
+
* @param name - The name of toolbar toggle button to replace
|
63
|
+
*/
|
64
|
+
replaceToggleButtonItem(name) {
|
65
|
+
throw new Error("Method 'replaceToggleButtonItem(name: string)' must be implemented.");
|
66
|
+
}
|
67
|
+
/**
|
68
|
+
* Gets the list of existing item names of associated toolbar
|
69
|
+
* @returns - Existing toolbar item names
|
70
|
+
*/
|
71
|
+
get itemNames() {
|
72
|
+
throw new Error("Getter 'itemNames()' must be implemented.");
|
73
|
+
}
|
74
|
+
/**
|
75
|
+
* Gets count of toolbar items
|
76
|
+
*/
|
77
|
+
get count() {
|
78
|
+
throw new Error("Getter 'count()' must be implemented.");
|
79
|
+
}
|
80
|
+
/**
|
81
|
+
* Removes specified item
|
82
|
+
* @param itemName - Item's internal name
|
83
|
+
*/
|
84
|
+
removeItem(itemName) {
|
85
|
+
throw new Error("Method 'removeItem(name: string)' must be implemented.");
|
86
|
+
}
|
87
|
+
}
|
88
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbGJhci5idWlsZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvcGlsb3Qtd2ViLXNkay9zcmMvbGliL3Rvb2xiYXIvdG9vbGJhci5idWlsZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUtBLE1BQU0sT0FBZ0IsZUFBZTtJQUVuQztRQUNFLElBQUksSUFBSSxDQUFDLFdBQVcsSUFBSSxlQUFlLEVBQUU7WUFDdkMsTUFBTSxJQUFJLEtBQUssQ0FBQyx5Q0FBeUMsQ0FBQyxDQUFDO1NBQzVEO0lBQ0gsQ0FBQztJQUVEOzs7T0FHRztJQUNILFlBQVksQ0FBQyxLQUFhO1FBQ3hCLE1BQU0sSUFBSSxLQUFLLENBQUMsMkRBQTJELENBQUMsQ0FBQztJQUMvRSxDQUFDO0lBRUQ7Ozs7T0FJRztJQUNILGFBQWEsQ0FBQyxJQUFZLEVBQUUsS0FBYTtRQUN2QyxNQUFNLElBQUksS0FBSyxDQUFDLDBFQUEwRSxDQUFDLENBQUM7SUFDOUYsQ0FBQztJQUVEOzs7O09BSUc7SUFDSCxpQkFBaUIsQ0FBQyxJQUFZLEVBQUUsS0FBYTtRQUMzQyxNQUFNLElBQUksS0FBSyxDQUFDLDhFQUE4RSxDQUFDLENBQUM7SUFDbEcsQ0FBQztJQUVEOzs7O09BSUc7SUFDSCxtQkFBbUIsQ0FBQyxJQUFZLEVBQUUsS0FBYTtRQUM3QyxNQUFNLElBQUksS0FBSyxDQUFDLGdGQU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yaW5nW10ge1xuICAgIHRocm93IG5ldyBFcnJvcihcIkdldHRlciAnaXRlbU5hbWVzKCknIG11c3QgYmUgaW1wbGVtZW50ZWQuXCIpO1xuICB9XG5cbiAgLyoqXG4gICAqIEdldHMgY291bnQgb2YgdG9vbGJhciBpdGVtc1xuICAgKi9cbiAgZ2V0IGNvdW50KCk6IG51bWJlciB7XG4gICAgdGhyb3cgbmV3IEVycm9yKFwiR2V0dGVyICdjb3VudCgpJyBtdXN0IGJlIGltcGxlbWVudGVkLlwiKTtcbiAgfVxuXG4gIC8qKlxuICAgKiBSZW1vdmVzIHNwZWNpZmllZCBpdGVtXG4gICAqIEBwYXJhbSBpdGVtTmFtZSAtIEl0ZW0ncyBpbnRlcm5hbCBuYW1lXG4gICAqL1xuICByZW1vdmVJdGVtKGl0ZW1OYW1lOiBzdHJpbmcpOiB2b2lkIHtcbiAgICB0aHJvdyBuZXcgRXJyb3IoXCJNZXRob2QgJ3JlbW92ZUl0ZW0obmFtZTogc3RyaW5nKScgbXVzdCBiZSBpbXBsZW1lbnRlZC5cIik7XG4gIH1cbn0iXX0=
|
@@ -1,27 +1,27 @@
|
|
1
|
-
/**
|
2
|
-
* Interface that allows to add new items to the toolbar
|
3
|
-
*/
|
4
|
-
export class IToolbar {
|
5
|
-
constructor() {
|
6
|
-
if (this.constructor == (IToolbar)) {
|
7
|
-
throw new Error("Abstract classes can't be instantiated.");
|
8
|
-
}
|
9
|
-
}
|
10
|
-
/**
|
11
|
-
* The method is called just before the toolbar is created
|
12
|
-
* @param builder - the toolbar builder object of associated toolbar
|
13
|
-
* @param context - context
|
14
|
-
*/
|
15
|
-
build(builder, context) {
|
16
|
-
throw new Error("Method 'build(builder: IToolbarBuilder, context: TToolbarContext)' must be implemented.");
|
17
|
-
}
|
18
|
-
/**
|
19
|
-
*
|
20
|
-
* @param name
|
21
|
-
* @param context
|
22
|
-
*/
|
23
|
-
onToolbarItemClick(name, context) {
|
24
|
-
throw new Error("Method 'onToolbarItemClick(name: string, context: TToolbarContext)' must be implemented.");
|
25
|
-
}
|
26
|
-
}
|
27
|
-
//# sourceMappingURL=data:application/json;base64,
|
1
|
+
/**
|
2
|
+
* Interface that allows to add new items to the toolbar
|
3
|
+
*/
|
4
|
+
export class IToolbar {
|
5
|
+
constructor() {
|
6
|
+
if (this.constructor == (IToolbar)) {
|
7
|
+
throw new Error("Abstract classes can't be instantiated.");
|
8
|
+
}
|
9
|
+
}
|
10
|
+
/**
|
11
|
+
* The method is called just before the toolbar is created
|
12
|
+
* @param builder - the toolbar builder object of associated toolbar
|
13
|
+
* @param context - context
|
14
|
+
*/
|
15
|
+
build(builder, context) {
|
16
|
+
throw new Error("Method 'build(builder: IToolbarBuilder, context: TToolbarContext)' must be implemented.");
|
17
|
+
}
|
18
|
+
/**
|
19
|
+
*
|
20
|
+
* @param name
|
21
|
+
* @param context
|
22
|
+
*/
|
23
|
+
onToolbarItemClick(name, context) {
|
24
|
+
throw new Error("Method 'onToolbarItemClick(name: string, context: TToolbarContext)' must be implemented.");
|
25
|
+
}
|
26
|
+
}
|
27
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbGJhci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3BpbG90LXdlYi1zZGsvc3JjL2xpYi90b29sYmFyL3Rvb2xiYXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUE7O0dBRUc7QUFDSCxNQUFNLE9BQWdCLFFBQVE7SUFFNUI7UUFDRSxJQUFJLElBQUksQ0FBQyxXQUFXLEtBQUksUUFBeUIsQ0FBQSxFQUFFO1lBQ2pELE1BQU0sSUFBSSxLQUFLLENBQUMseUNBQXlDLENBQUMsQ0FBQztTQUM1RDtJQUNILENBQUM7SUFFRDs7OztPQUlHO0lBQ0gsS0FBSyxDQUFDLE9BQXdCLEVBQUUsT0FBd0I7UUFDdEQsT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1aWxkZXI6IElUb29sYmFyQnVpbGRlciwgY29udGV4dDogVFRvb2xiYXJDb250ZXh0KScgbXVzdCBiZSBpbXBsZW1lbnRlZC5cIik7XG4gIH1cblxuICAvKipcbiAgICogXG4gICAqIEBwYXJhbSBuYW1lIFxuICAgKiBAcGFyYW0gY29udGV4dCBcbiAgICovXG4gIG9uVG9vbGJhckl0ZW1DbGljayhuYW1lOiBzdHJpbmcsIGNvbnRleHQ6IFRUb29sYmFyQ29udGV4dCk6IHZvaWQge1xuICAgIHRocm93IG5ldyBFcnJvcihcIk1ldGhvZCAnb25Ub29sYmFySXRlbUNsaWNrKG5hbWU6IHN0cmluZywgY29udGV4dDogVFRvb2xiYXJDb250ZXh0KScgbXVzdCBiZSBpbXBsZW1lbnRlZC5cIik7XG4gIH1cbn0iXX0=
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import { objectToMap } from "./utils";
|
2
|
+
export class AttributePermissionInfo {
|
3
|
+
constructor(editableForPositionsSource) {
|
4
|
+
this.ATTRIBUTE_NAME_MARKER = '&';
|
5
|
+
this.orgUnits = new Array();
|
6
|
+
this.orgUnitAttributes = new Array();
|
7
|
+
if (!editableForPositionsSource)
|
8
|
+
return;
|
9
|
+
editableForPositionsSource.forEach(str => {
|
10
|
+
if (str.length > 0 && str[0] === this.ATTRIBUTE_NAME_MARKER) {
|
11
|
+
this.orgUnitAttributes.push(str.substring(1));
|
12
|
+
}
|
13
|
+
else {
|
14
|
+
const num = Number(str);
|
15
|
+
if (!isNaN(num))
|
16
|
+
this.orgUnits.push(num);
|
17
|
+
}
|
18
|
+
});
|
19
|
+
}
|
20
|
+
extractAllOrgUnits(obj) {
|
21
|
+
const attrMap = objectToMap(obj.attributes);
|
22
|
+
return this.extractAllOrgUnitsByAttributes(attrMap);
|
23
|
+
}
|
24
|
+
extractAllOrgUnitsByAttributes(attributes) {
|
25
|
+
let result = new Array();
|
26
|
+
if (!this.orgUnitAttributes || !attributes)
|
27
|
+
return result;
|
28
|
+
this.orgUnitAttributes.forEach(permissionAttributeName => {
|
29
|
+
if (attributes.has(permissionAttributeName)) {
|
30
|
+
const value = attributes.get(permissionAttributeName);
|
31
|
+
if (value && Array.isArray(value)) {
|
32
|
+
value.forEach(intValue => {
|
33
|
+
result.push(intValue);
|
34
|
+
});
|
35
|
+
}
|
36
|
+
}
|
37
|
+
});
|
38
|
+
return result;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXR0cmlidXRlLXBlcm1pc3Npb24uaW5mby5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3BpbG90LXdlYi1zZGsvc3JjL2xpYi90b29scy9hdHRyaWJ1dGUtcGVybWlzc2lvbi5pbmZvLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxTQUFTLENBQUM7QUFFdEMsTUFBTSxPQUFPLHVCQUF1QjtJQU1sQyxZQUFZLDBCQUFvQztRQUx4QywwQkFBcUIsR0FBRyxHQUFHLENBQUM7UUFNbEMsSUFBSSxDQUFDLFFBQVEsR0FBRyxJQUFJLEtBQUssRUFBVSxDQUFDO1FBQ3BDLElBQUksQ0FBQyxpQkFBaUIsR0FBRyxJQUFJLEtBQUssRUFBVSxDQUFDO1FBRTdDLElBQUksQ0FBQywwQkFBMEI7WUFDN0IsT0FBTztRQUVULDBCQUEwQixDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsRUFBRTtZQUN2QyxJQUFJLEdBQUcsQ0FBQyxNQUFNLEdBQUcsQ0FBQyxJQUFJLEdBQUcsQ0FBQyxDQUFDLENBQUMsS0FBSyxJQUFJLENBQUMscUJBQXFCLEVBQUU7Z0JBQzNELElBQUksQ0FBQyxpQkFBaUIsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLFN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blxuICBleHRyYWN0QWxsT3JnVW5pdHMob2JqOiBhbnkpOiBudW1iZXJbXSB7XG4gICAgY29uc3QgYXR0ck1hcCA9IG9iamVjdFRvTWFwPGFueT4ob2JqLmF0dHJpYnV0ZXMpO1xuICAgIHJldHVybiB0aGlzLmV4dHJhY3RBbGxPcmdVbml0c0J5QXR0cmlidXRlcyhhdHRyTWFwKTtcbiAgfVxuXG4gIGV4dHJhY3RBbGxPcmdVbml0c0J5QXR0cmlidXRlcyhhdHRyaWJ1dGVzOiBNYXA8c3RyaW5nLCBhbnk+KSA6IG51bWJlcltdIHtcbiAgICBsZXQgcmVzdWx0ID0gbmV3IEFycmF5PG51bWJlcj4oKTtcbiAgICBpZiAoIXRoaXMub3JnVW5pdEF0dHJpYnV0ZXMgfHwgIWF0dHJpYnV0ZXMgIClcbiAgICAgIHJldHVybiByZXN1bHQ7XG5cbiAgICB0aGlzLm9yZ1VuaXRBdHRyaWJ1dGVzLmZvckVhY2gocGVybWlzc2lvbkF0dHJpYnV0ZU5hbWUgPT4ge1xuICAgICAgaWYgKGF0dHJpYnV0ZXMuaGFzKHBlcm1pc3Npb25BdHRyaWJ1dGVOYW1lKSl7XG4gICAgICAgIGNvbnN0IHZhbHVlID0gYXR0cmlidXRlcy5nZXQocGVybWlzc2lvbkF0dHJpYnV0ZU5hbWUpO1xuICAgICAgICBpZiAodmFsdWUgJiYgQXJyYXkuaXNBcnJheSh2YWx1ZSkpe1xuICAgICAgICAgIHZhbHVlLmZvckVhY2goaW50VmFsdWUgPT4ge1xuICAgICAgICAgICAgcmVzdWx0LnB1c2goaW50VmFsdWUpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSk7XG5cbiAgICByZXR1cm4gcmVzdWx0O1xuICB9XG59XG4iXX0=
|
@@ -0,0 +1,53 @@
|
|
1
|
+
const byteToHex = Array();
|
2
|
+
for (let i = 0; i < 256; ++i) {
|
3
|
+
byteToHex.push((i + 0x100).toString(16).slice(1));
|
4
|
+
}
|
5
|
+
export class Guid {
|
6
|
+
static newGuid() {
|
7
|
+
if (window.isSecureContext) {
|
8
|
+
// If crypto.getRandomValues is available try to use it.
|
9
|
+
return window.crypto.randomUUID();
|
10
|
+
}
|
11
|
+
// Fall back to Math.random if a higher quality random number generator is not available.
|
12
|
+
const uuid = new Array(16);
|
13
|
+
var d = new Date().getTime();
|
14
|
+
for (var i = 0; i < 16; i++) {
|
15
|
+
var r = ((d + Math.random() * 256) % 256) | 0;
|
16
|
+
d = Math.trunc(d / 256);
|
17
|
+
uuid[i] = r;
|
18
|
+
}
|
19
|
+
// Makes uuid compliant to RFC-4122
|
20
|
+
uuid[6] = (uuid[6] & 0x0F) | 0x40; // uuid version
|
21
|
+
uuid[8] = (uuid[8] & 0x3F) | 0x80; // uuid variant
|
22
|
+
return this.stringify(uuid);
|
23
|
+
}
|
24
|
+
static isGuid(str) {
|
25
|
+
const regex = new RegExp(this.regex);
|
26
|
+
return regex.test(str) && str.length === 36;
|
27
|
+
}
|
28
|
+
static stringify(arr) {
|
29
|
+
return (byteToHex[arr[0]] +
|
30
|
+
byteToHex[arr[1]] +
|
31
|
+
byteToHex[arr[2]] +
|
32
|
+
byteToHex[arr[3]] +
|
33
|
+
'-' +
|
34
|
+
byteToHex[arr[4]] +
|
35
|
+
byteToHex[arr[5]] +
|
36
|
+
'-' +
|
37
|
+
byteToHex[arr[6]] +
|
38
|
+
byteToHex[arr[7]] +
|
39
|
+
'-' +
|
40
|
+
byteToHex[arr[8]] +
|
41
|
+
byteToHex[arr[9]] +
|
42
|
+
'-' +
|
43
|
+
byteToHex[arr[10]] +
|
44
|
+
byteToHex[arr[11]] +
|
45
|
+
byteToHex[arr[12]] +
|
46
|
+
byteToHex[arr[13]] +
|
47
|
+
byteToHex[arr[14]] +
|
48
|
+
byteToHex[arr[15]]).toLowerCase();
|
49
|
+
}
|
50
|
+
}
|
51
|
+
Guid.regex = "(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-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