@pilotdev/pilot-web-sdk 24.4.0 → 24.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. package/README.md +0 -22
  2. package/esm2020/lib/contexts/context.mjs +29 -0
  3. package/esm2020/lib/contexts/document-annotations-list-context.mjs +15 -0
  4. package/esm2020/lib/contexts/index.mjs +4 -0
  5. package/esm2020/lib/contexts/render-context.mjs +22 -0
  6. package/esm2020/lib/data/access.mjs +26 -0
  7. package/esm2020/lib/data/annotations.mjs +2 -0
  8. package/esm2020/lib/data/attribute.mjs +17 -0
  9. package/esm2020/lib/data/data-object.mjs +19 -0
  10. package/esm2020/lib/data/file.mjs +2 -0
  11. package/esm2020/lib/data/files-snapshot.mjs +2 -0
  12. package/esm2020/lib/data/index.mjs +13 -0
  13. package/esm2020/lib/data/modifier.mjs +2 -0
  14. package/esm2020/lib/data/object-builder.mjs +2 -0
  15. package/esm2020/lib/data/organisation-unit.mjs +7 -0
  16. package/esm2020/lib/data/person.mjs +2 -0
  17. package/esm2020/lib/data/relation.mjs +2 -0
  18. package/esm2020/lib/data/subscriptionType.mjs +6 -0
  19. package/esm2020/lib/idata.plugin.mjs +2 -0
  20. package/esm2020/lib/injectable/index.mjs +5 -0
  21. package/esm2020/lib/injectable/modifier-provider.mjs +2 -0
  22. package/esm2020/lib/injectable/objects-repository.mjs +2 -0
  23. package/esm2020/lib/injectable/render-context-provider.mjs +2 -0
  24. package/esm2020/lib/injectable/repository-events.mjs +2 -0
  25. package/esm2020/lib/menu/checkable-menu.builder.mjs +14 -0
  26. package/esm2020/lib/menu/index.mjs +5 -0
  27. package/esm2020/lib/menu/menu-item.builder.mjs +39 -0
  28. package/esm2020/lib/menu/menu.builder.mjs +68 -0
  29. package/esm2020/lib/menu/menu.mjs +22 -0
  30. package/esm2020/lib/toolbar/index.mjs +7 -0
  31. package/esm2020/lib/toolbar/toolbar-item-submenu.handler.mjs +11 -0
  32. package/esm2020/lib/toolbar/toolbar-item.builder.mjs +41 -0
  33. package/esm2020/lib/toolbar/toolbar-menu-item.builder.mjs +15 -0
  34. package/esm2020/lib/toolbar/toolbar-toggle-item.builder.mjs +14 -0
  35. package/esm2020/lib/toolbar/toolbar.builder.mjs +88 -0
  36. package/esm2020/lib/toolbar/toolbar.mjs +27 -0
  37. package/esm2020/lib/tools/attribute-permission.info.mjs +41 -0
  38. package/esm2020/lib/tools/guid.mjs +53 -0
  39. package/esm2020/lib/tools/index.mjs +4 -0
  40. package/esm2020/lib/tools/utils.mjs +8 -0
  41. package/esm2020/pilotdev-pilot-web-sdk.mjs +5 -0
  42. package/esm2020/public-api.mjs +11 -0
  43. package/fesm2015/pilotdev-pilot-web-sdk.mjs +588 -0
  44. package/fesm2015/pilotdev-pilot-web-sdk.mjs.map +1 -0
  45. package/fesm2020/pilotdev-pilot-web-sdk.mjs +588 -0
  46. package/fesm2020/pilotdev-pilot-web-sdk.mjs.map +1 -0
  47. package/index.d.ts +5 -0
  48. package/lib/contexts/context.d.ts +22 -0
  49. package/lib/contexts/document-annotations-list-context.d.ts +12 -0
  50. package/{src/lib/contexts/index.ts → lib/contexts/index.d.ts} +1 -1
  51. package/lib/contexts/render-context.d.ts +17 -0
  52. package/lib/data/access.d.ts +35 -0
  53. package/lib/data/annotations.d.ts +15 -0
  54. package/lib/data/attribute.d.ts +30 -0
  55. package/lib/data/data-object.d.ts +74 -0
  56. package/lib/data/file.d.ts +23 -0
  57. package/lib/data/files-snapshot.d.ts +8 -0
  58. package/{src/lib/data/index.ts → lib/data/index.d.ts} +2 -2
  59. package/lib/data/modifier.d.ts +30 -0
  60. package/lib/data/object-builder.d.ts +110 -0
  61. package/lib/data/organisation-unit.d.ts +18 -0
  62. package/lib/data/person.d.ts +17 -0
  63. package/lib/data/relation.d.ts +8 -0
  64. package/lib/data/subscriptionType.d.ts +4 -0
  65. package/lib/idata.plugin.d.ts +2 -0
  66. package/{src/lib/injectable/index.ts → lib/injectable/index.d.ts} +2 -2
  67. package/{src/lib/injectable/modifier-provider.ts → lib/injectable/modifier-provider.d.ts} +5 -6
  68. package/lib/injectable/objects-repository.d.ts +72 -0
  69. package/lib/injectable/render-context-provider.d.ts +10 -0
  70. package/lib/injectable/repository-events.d.ts +31 -0
  71. package/lib/menu/checkable-menu.builder.d.ts +11 -0
  72. package/{src/lib/menu/index.ts → lib/menu/index.d.ts} +1 -2
  73. package/lib/menu/menu-item.builder.d.ts +27 -0
  74. package/lib/menu/menu.builder.d.ts +49 -0
  75. package/lib/menu/menu.d.ts +18 -0
  76. package/{src/lib/toolbar/index.ts → lib/toolbar/index.d.ts} +1 -2
  77. package/lib/toolbar/toolbar-item-submenu.handler.d.ts +9 -0
  78. package/lib/toolbar/toolbar-item.builder.d.ts +28 -0
  79. package/lib/toolbar/toolbar-menu-item.builder.d.ts +13 -0
  80. package/lib/toolbar/toolbar-toggle-item.builder.d.ts +11 -0
  81. package/lib/toolbar/toolbar.builder.d.ts +65 -0
  82. package/lib/toolbar/toolbar.d.ts +19 -0
  83. package/lib/tools/attribute-permission.info.d.ts +8 -0
  84. package/lib/tools/guid.d.ts +7 -0
  85. package/lib/tools/index.d.ts +3 -0
  86. package/lib/tools/utils.d.ts +3 -0
  87. package/package.json +21 -2
  88. package/{src/public-api.ts → public-api.d.ts} +1 -4
  89. package/.eslintrc.json +0 -31
  90. package/ng-package.json +0 -7
  91. package/src/lib/contexts/context.ts +0 -38
  92. package/src/lib/contexts/document-annotations-list-context.ts +0 -21
  93. package/src/lib/contexts/render-context.ts +0 -28
  94. package/src/lib/data/access.ts +0 -40
  95. package/src/lib/data/annotations.ts +0 -20
  96. package/src/lib/data/attribute.ts +0 -33
  97. package/src/lib/data/data-object.ts +0 -78
  98. package/src/lib/data/file.ts +0 -25
  99. package/src/lib/data/files-snapshot.ts +0 -9
  100. package/src/lib/data/modifier.ts +0 -31
  101. package/src/lib/data/object-builder.ts +0 -111
  102. package/src/lib/data/organisation-unit.ts +0 -20
  103. package/src/lib/data/person.ts +0 -17
  104. package/src/lib/data/relation.ts +0 -10
  105. package/src/lib/data/subscriptionType.ts +0 -5
  106. package/src/lib/idata.plugin.ts +0 -2
  107. package/src/lib/injectable/objects-repository.ts +0 -74
  108. package/src/lib/injectable/render-context-provider.ts +0 -11
  109. package/src/lib/injectable/repository-events.ts +0 -33
  110. package/src/lib/menu/checkable-menu.builder.ts +0 -15
  111. package/src/lib/menu/menu-item.builder.ts +0 -45
  112. package/src/lib/menu/menu.builder.ts +0 -79
  113. package/src/lib/menu/menu.ts +0 -24
  114. package/src/lib/toolbar/toolbar-item-submenu.handler.ts +0 -12
  115. package/src/lib/toolbar/toolbar-item.builder.ts +0 -45
  116. package/src/lib/toolbar/toolbar-menu-item.builder.ts +0 -16
  117. package/src/lib/toolbar/toolbar-toggle-item.builder.ts +0 -15
  118. package/src/lib/toolbar/toolbar.builder.ts +0 -104
  119. package/src/lib/toolbar/toolbar.ts +0 -31
  120. package/src/lib/tools/attribute-permission.info.ts +0 -51
  121. package/src/lib/tools/guid.ts +0 -63
  122. package/src/lib/tools/index.ts +0 -3
  123. package/src/lib/tools/utils.ts +0 -8
  124. package/tsconfig.lib.json +0 -15
  125. package/tsconfig.lib.prod.json +0 -10
@@ -1,51 +0,0 @@
1
- import { objectToMap } from "./utils";
2
-
3
- export class AttributePermissionInfo {
4
- private ATTRIBUTE_NAME_MARKER = '&';
5
-
6
- orgUnits: number[];
7
- orgUnitAttributes: string[];
8
-
9
- constructor(editableForPositionsSource: string[]) {
10
- this.orgUnits = new Array<number>();
11
- this.orgUnitAttributes = new Array<string>();
12
-
13
- if (!editableForPositionsSource)
14
- return;
15
-
16
- editableForPositionsSource.forEach(str => {
17
- if (str.length > 0 && str[0] === this.ATTRIBUTE_NAME_MARKER) {
18
- this.orgUnitAttributes.push(str.substring(1));
19
- }
20
- else {
21
- const num = Number(str);
22
- if (!isNaN(num))
23
- this.orgUnits.push(num);
24
- }
25
- });
26
- }
27
-
28
- extractAllOrgUnits(obj: any): number[] {
29
- const attrMap = objectToMap<any>(obj.attributes);
30
- return this.extractAllOrgUnitsByAttributes(attrMap);
31
- }
32
-
33
- extractAllOrgUnitsByAttributes(attributes: Map<string, any>) : number[] {
34
- let result = new Array<number>();
35
- if (!this.orgUnitAttributes || !attributes )
36
- return result;
37
-
38
- this.orgUnitAttributes.forEach(permissionAttributeName => {
39
- if (attributes.has(permissionAttributeName)){
40
- const value = attributes.get(permissionAttributeName);
41
- if (value && Array.isArray(value)){
42
- value.forEach(intValue => {
43
- result.push(intValue);
44
- });
45
- }
46
- }
47
- });
48
-
49
- return result;
50
- }
51
- }
@@ -1,63 +0,0 @@
1
- const byteToHex = Array();
2
- for (let i = 0; i < 256; ++i) {
3
- byteToHex.push((i + 0x100).toString(16).slice(1));
4
- }
5
-
6
- export class Guid {
7
- private static readonly regex = "(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})";
8
-
9
- static readonly EMPTY = "00000000-0000-0000-0000-000000000000";
10
-
11
- static newGuid(): string {
12
-
13
- if (window.isSecureContext) {
14
- // If crypto.getRandomValues is available try to use it.
15
- return window.crypto.randomUUID();
16
- }
17
-
18
- // Fall back to Math.random if a higher quality random number generator is not available.
19
- const uuid = new Array(16);
20
- var d = new Date().getTime();
21
- for (var i = 0; i < 16; i++) {
22
- var r = ((d + Math.random() * 256) % 256) | 0;
23
- d = Math.trunc(d / 256);
24
- uuid[i] = r;
25
- }
26
-
27
- // Makes uuid compliant to RFC-4122
28
- uuid[6] = (uuid[6] & 0x0F) | 0x40; // uuid version
29
- uuid[8] = (uuid[8] & 0x3F) | 0x80; // uuid variant
30
-
31
- return this.stringify(uuid);
32
- }
33
-
34
- static isGuid(str: string) {
35
- const regex = new RegExp(this.regex);
36
- return regex.test(str) && str.length === 36;
37
- }
38
-
39
- private static stringify(arr: Array<number>) {
40
- return (
41
- byteToHex[arr[0]] +
42
- byteToHex[arr[1]] +
43
- byteToHex[arr[2]] +
44
- byteToHex[arr[3]] +
45
- '-' +
46
- byteToHex[arr[4]] +
47
- byteToHex[arr[5]] +
48
- '-' +
49
- byteToHex[arr[6]] +
50
- byteToHex[arr[7]] +
51
- '-' +
52
- byteToHex[arr[8]] +
53
- byteToHex[arr[9]] +
54
- '-' +
55
- byteToHex[arr[10]] +
56
- byteToHex[arr[11]] +
57
- byteToHex[arr[12]] +
58
- byteToHex[arr[13]] +
59
- byteToHex[arr[14]] +
60
- byteToHex[arr[15]]
61
- ).toLowerCase();
62
- }
63
- }
@@ -1,3 +0,0 @@
1
- export * from './attribute-permission.info';
2
- export * from './utils'
3
- export * from './guid'
@@ -1,8 +0,0 @@
1
-
2
- export function objectToMap<T>(objectMap: { [key: string]: any; }): Map<string, T> {
3
- const map = new Map<string, T>();
4
- Object.keys(objectMap).forEach(key => {
5
- map.set(key, objectMap[key]);
6
- });
7
- return map;
8
- }
package/tsconfig.lib.json DELETED
@@ -1,15 +0,0 @@
1
- /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
- {
3
- "extends": "../../tsconfig.json",
4
- "compilerOptions": {
5
- "outDir": "../../out-tsc/lib",
6
- "declaration": true,
7
- "declarationMap": true,
8
- "inlineSources": true,
9
- "types": [],
10
- "strict": true
11
- },
12
- "exclude": [
13
- "**/*.spec.ts"
14
- ]
15
- }
@@ -1,10 +0,0 @@
1
- /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
- {
3
- "extends": "./tsconfig.lib.json",
4
- "compilerOptions": {
5
- "declarationMap": false
6
- },
7
- "angularCompilerOptions": {
8
- "compilationMode": "partial"
9
- }
10
- }