@pilotdev/pilot-web-sdk 23.0.0-alpha.2 → 24.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/README.md +2 -5
  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 -2
  20. package/esm2020/lib/injectable/index.mjs +5 -2
  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 -14
  26. package/esm2020/lib/menu/index.mjs +5 -5
  27. package/esm2020/lib/menu/menu-item.builder.mjs +39 -39
  28. package/esm2020/lib/menu/menu.builder.mjs +68 -68
  29. package/esm2020/lib/menu/menu.mjs +22 -22
  30. package/esm2020/lib/toolbar/index.mjs +7 -7
  31. package/esm2020/lib/toolbar/toolbar-item-submenu.handler.mjs +11 -3
  32. package/esm2020/lib/toolbar/toolbar-item.builder.mjs +41 -41
  33. package/esm2020/lib/toolbar/toolbar-menu-item.builder.mjs +15 -15
  34. package/esm2020/lib/toolbar/toolbar-toggle-item.builder.mjs +14 -14
  35. package/esm2020/lib/toolbar/toolbar.builder.mjs +88 -88
  36. package/esm2020/lib/toolbar/toolbar.mjs +27 -27
  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 +4 -4
  42. package/esm2020/public-api.mjs +11 -9
  43. package/fesm2015/pilotdev-pilot-web-sdk.mjs +561 -322
  44. package/fesm2015/pilotdev-pilot-web-sdk.mjs.map +1 -1
  45. package/fesm2020/pilotdev-pilot-web-sdk.mjs +561 -322
  46. package/fesm2020/pilotdev-pilot-web-sdk.mjs.map +1 -1
  47. package/index.d.ts +5 -5
  48. package/lib/contexts/context.d.ts +22 -0
  49. package/lib/contexts/document-annotations-list-context.d.ts +12 -0
  50. package/lib/contexts/index.d.ts +3 -0
  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/lib/data/index.d.ts +12 -0
  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 -2
  66. package/lib/injectable/index.d.ts +4 -1
  67. package/lib/injectable/modifier-provider.d.ts +10 -0
  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 -11
  72. package/lib/menu/index.d.ts +4 -4
  73. package/lib/menu/menu-item.builder.d.ts +27 -27
  74. package/lib/menu/menu.builder.d.ts +49 -49
  75. package/lib/menu/menu.d.ts +18 -18
  76. package/lib/toolbar/index.d.ts +6 -6
  77. package/lib/toolbar/toolbar-item-submenu.handler.d.ts +9 -2
  78. package/lib/toolbar/toolbar-item.builder.d.ts +28 -28
  79. package/lib/toolbar/toolbar-menu-item.builder.d.ts +13 -13
  80. package/lib/toolbar/toolbar-toggle-item.builder.d.ts +11 -11
  81. package/lib/toolbar/toolbar.builder.d.ts +65 -65
  82. package/lib/toolbar/toolbar.d.ts +19 -19
  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 +5 -5
  88. package/public-api.d.ts +7 -5
  89. package/esm2020/lib/context.mjs +0 -11
  90. package/esm2020/lib/injectable/objects.repository.mjs +0 -2
  91. package/lib/context.d.ts +0 -18
  92. package/lib/injectable/objects.repository.d.ts +0 -5
@@ -1,349 +1,588 @@
1
- /**
2
- * Contex for objects view
3
- */
4
- class ObjectsViewContext {
5
- constructor(selectedObjects, isContext, shortcuts) {
6
- this.selectedObjects = selectedObjects;
7
- this.isContext = isContext;
8
- this.shortcuts = shortcuts;
9
- }
1
+ /**
2
+ * Interface that allows to add new items to the toolbar
3
+ */
4
+ 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
+ }
10
26
  }
11
27
 
12
- /**
13
- * Interface that allows to add new items to the toolbar
14
- */
15
- class IToolbar {
16
- constructor() {
17
- if (this.constructor == (IToolbar)) {
18
- throw new Error("Abstract classes can't be instantiated.");
19
- }
20
- }
21
- /**
22
- * The method is called just before the toolbar is created
23
- * @param builder - the toolbar builder object of associated toolbar
24
- * @param context - context
25
- */
26
- build(builder, context) {
27
- throw new Error("Method 'build(builder: IToolbarBuilder, context: TToolbarContext)' must be implemented.");
28
- }
29
- /**
30
- *
31
- * @param name
32
- * @param context
33
- */
34
- onToolbarItemClick(name, context) {
35
- throw new Error("Method 'onToolbarItemClick(name: string, context: TToolbarContext)' must be implemented.");
36
- }
28
+ /**
29
+ * Represents a toolbar button and enables to set parametres to it
30
+ */
31
+ class IToolbarButtonItemBuilder {
32
+ constructor() {
33
+ if (this.constructor == IToolbarButtonItemBuilder) {
34
+ throw new Error("Abstract classes can't be instantiated.");
35
+ }
36
+ }
37
+ /**
38
+ * Item's name to be displayed
39
+ * @param header - value
40
+ * @returns instance of IToolbarButtonItemBuilder
41
+ */
42
+ withHeader(header) {
43
+ throw new Error("Method 'withHeader(header: string)' must be implemented.");
44
+ }
45
+ /**
46
+ * Item's icon in SVG format
47
+ * @param name - icon name
48
+ * @param svg - url icon or base64 string
49
+ */
50
+ withIcon(name, svg) {
51
+ throw new Error("Method 'withIcon(name: string, svg: string)' must be implemented.");
52
+ }
53
+ /**
54
+ * Enabled the item
55
+ * @param value - value
56
+ */
57
+ withIsEnabled(value) {
58
+ throw new Error("Method 'withIsEnabled(value: boolean)' must be implemented.");
59
+ }
60
+ /**
61
+ * Item's hint
62
+ * @param hint - value
63
+ */
64
+ withHint(hint) {
65
+ throw new Error("Method 'withHint(hint: string)' must be implemented.");
66
+ }
37
67
  }
38
68
 
39
- /**
40
- * Represents a toolbar button and enables to set parametres to it
41
- */
42
- class IToolbarButtonItemBuilder {
43
- constructor() {
44
- if (this.constructor == IToolbarButtonItemBuilder) {
45
- throw new Error("Abstract classes can't be instantiated.");
46
- }
47
- }
48
- /**
49
- * Item's name to be displayed
50
- * @param header - value
51
- * @returns instance of IToolbarButtonItemBuilder
52
- */
53
- withHeader(header) {
54
- throw new Error("Method 'withHeader(header: string)' must be implemented.");
55
- }
56
- /**
57
- * Item's icon in SVG format
58
- * @param name - icon name
59
- * @param svg - url icon or base64 string
60
- */
61
- withIcon(name, svg) {
62
- throw new Error("Method 'withIcon(name: string, svg: string)' must be implemented.");
63
- }
64
- /**
65
- * Enabled the item
66
- * @param value - value
67
- */
68
- withIsEnabled(value) {
69
- throw new Error("Method 'withIsEnabled(value: boolean)' must be implemented.");
70
- }
71
- /**
72
- * Item's hint
73
- * @param hint - value
74
- */
75
- withHint(hint) {
76
- throw new Error("Method 'withHint(hint: string)' must be implemented.");
77
- }
69
+ class IToolbarItemSubmenuHandler {
70
+ /**
71
+ * Build a submenu
72
+ * @param builder - toolbar builder
73
+ * @returns
74
+ */
75
+ onSubmenuRequested(builder) {
76
+ throw new Error("Method 'onSubmenuRequested(builder: IToolbarBuilder)' must be implemented.");
77
+ }
78
78
  }
79
79
 
80
- class IToolbarItemSubmenuHandler {
80
+ /**
81
+ * Represents a toolbar menu button and enables to set parametres to it
82
+ */
83
+ class IToolbarMenuButtonItemBuilder extends IToolbarButtonItemBuilder {
84
+ /**
85
+ * Build a dropdown menu
86
+ * @param itemSubmenuHandler - toolbar submenu handler
87
+ * @returns The toolbar button menu builder
88
+ */
89
+ withMenu(itemSubmenuHandler) {
90
+ throw new Error("Method 'withMenu(itemSubmenuHandler: IToolbarItemSubmenuHandler)' must be implemented.");
91
+ }
81
92
  }
82
93
 
83
- /**
84
- * Represents a toolbar menu button and enables to set parametres to it
85
- */
86
- class IToolbarMenuButtonItemBuilder extends IToolbarButtonItemBuilder {
87
- /**
88
- * Build a dropdown menu
89
- * @param itemSubmenuHandler - toolbar submenu handler
90
- * @returns The toolbar button menu builder
91
- */
92
- withMenu(itemSubmenuHandler) {
93
- throw new Error("Method 'withMenu(itemSubmenuHandler: IToolbarItemSubmenuHandler)' must be implemented.");
94
- }
94
+ /**
95
+ * Represents a toolbar toggle button and enables to set parametres to it
96
+ */
97
+ class IToolbarToggleButtonItemBuilder extends IToolbarButtonItemBuilder {
98
+ /**
99
+ *
100
+ * @param value
101
+ */
102
+ withIsChecked(value) {
103
+ throw new Error("Method 'withIsChecked(value: boolean)' must be implemented.");
104
+ }
95
105
  }
96
106
 
97
- /**
98
- * Represents a toolbar toggle button and enables to set parametres to it
99
- */
100
- class IToolbarToggleButtonItemBuilder extends IToolbarButtonItemBuilder {
101
- /**
102
- *
103
- * @param value
104
- */
105
- withIsChecked(value) {
106
- throw new Error("Method 'withIsChecked(value: boolean)' must be implemented.");
107
- }
107
+ class IToolbarBuilder {
108
+ constructor() {
109
+ if (this.constructor == IToolbarBuilder) {
110
+ throw new Error("Abstract classes can't be instantiated.");
111
+ }
112
+ }
113
+ /**
114
+ * Adds a new separator to the associated toolbar
115
+ * @param index - The index to put the new item at
116
+ */
117
+ addSeparator(index) {
118
+ throw new Error("Method 'addSeparator(index: number)' must be implemented.");
119
+ }
120
+ /**
121
+ * Adds a new button to the associated toolbar
122
+ * @param name - Internal item's name
123
+ * @param index - The index to put the new item at
124
+ */
125
+ addButtonItem(name, index) {
126
+ throw new Error("Method 'addButtonItem(name: string, index: number)' must be implemented.");
127
+ }
128
+ /**
129
+ * Adds a new menu button to the associated toolbar
130
+ * @param name - Internal item's name
131
+ * @param index - The index to put the new item at
132
+ */
133
+ addMenuButtonItem(name, index) {
134
+ throw new Error("Method 'addMenuButtonItem(name: string, index: number)' must be implemented.");
135
+ }
136
+ /**
137
+ * Adds a new toggle button to the associated toolbar
138
+ * @param name - Internal item's name
139
+ * @param index - The index to put the new item at
140
+ */
141
+ addToggleButtonItem(name, index) {
142
+ throw new Error("Method 'addToggleButtonItem(name: string, index: number)' must be implemented.");
143
+ }
144
+ /**
145
+ * Replaces the item from the associated toolbar on button
146
+ * @param name - The name of toolbar button to replace
147
+ */
148
+ replaceButtonItem(name) {
149
+ throw new Error("Method 'replaceButtonItem(name: string)' must be implemented.");
150
+ }
151
+ /**
152
+ * Replace the item from the associated toolbar on menu button
153
+ * @param name - The name of toolbar menu button to replace
154
+ */
155
+ replaceMenuButtonItem(name) {
156
+ throw new Error("Method 'replaceMenuButtonItem(name: string)' must be implemented.");
157
+ }
158
+ /**
159
+ * Enables to set parametres to menu button item submenu
160
+ * @param name - Item's internal name
161
+ * @param itemSubmenuHandler - The toolbar button menu builder
162
+ */
163
+ handleMenuButtonItemSubmenu(name, itemSubmenuHandler) {
164
+ throw new Error("Method 'handleMenuButtonItemSubmenu(name: string, itemSubmenuHandler: IToolbarItemSubmenuHandler)' must be implemented.");
165
+ }
166
+ /**
167
+ * Replaces the item from the associated toolbar on toggle button
168
+ * @param name - The name of toolbar toggle button to replace
169
+ */
170
+ replaceToggleButtonItem(name) {
171
+ throw new Error("Method 'replaceToggleButtonItem(name: string)' must be implemented.");
172
+ }
173
+ /**
174
+ * Gets the list of existing item names of associated toolbar
175
+ * @returns - Existing toolbar item names
176
+ */
177
+ get itemNames() {
178
+ throw new Error("Getter 'itemNames()' must be implemented.");
179
+ }
180
+ /**
181
+ * Gets count of toolbar items
182
+ */
183
+ get count() {
184
+ throw new Error("Getter 'count()' must be implemented.");
185
+ }
186
+ /**
187
+ * Removes specified item
188
+ * @param itemName - Item's internal name
189
+ */
190
+ removeItem(itemName) {
191
+ throw new Error("Method 'removeItem(name: string)' must be implemented.");
192
+ }
193
+ }
194
+
195
+ /**
196
+ * Interface that allows to add new items to the menu and context menus
197
+ */
198
+ class IMenu {
199
+ /**
200
+ * The method is called just before the menu is shown
201
+ * @param builder The menu builder object of associated menu
202
+ * @param context Context
203
+ */
204
+ build(builder, context) {
205
+ throw new Error("Method 'build(builder: IMenuBuilder, context: TMenuContext)' must be implemented.");
206
+ }
207
+ /**
208
+ *
209
+ * @param name
210
+ * @param context
211
+ */
212
+ onMenuItemClick(name, context) {
213
+ throw new Error("Method 'onMenuItemClick(name: string, context: TMenuContext)' must be implemented.");
214
+ }
108
215
  }
109
216
 
110
- class IToolbarBuilder {
111
- constructor() {
112
- if (this.constructor == IToolbarBuilder) {
113
- throw new Error("Abstract classes can't be instantiated.");
114
- }
115
- }
116
- /**
117
- * Adds a new separator to the associated toolbar
118
- * @param index - The index to put the new item at
119
- */
120
- addSeparator(index) {
121
- throw new Error("Method 'addSeparator(index: number)' must be implemented.");
122
- }
123
- /**
124
- * Adds a new button to the associated toolbar
125
- * @param name - Internal item's name
126
- * @param index - The index to put the new item at
127
- */
128
- addButtonItem(name, index) {
129
- throw new Error("Method 'addButtonItem(name: string, index: number)' must be implemented.");
130
- }
131
- /**
132
- * Adds a new menu button to the associated toolbar
133
- * @param name - Internal item's name
134
- * @param index - The index to put the new item at
135
- */
136
- addMenuButtonItem(name, index) {
137
- throw new Error("Method 'addMenuButtonItem(name: string, index: number)' must be implemented.");
138
- }
139
- /**
140
- * Adds a new toggle button to the associated toolbar
141
- * @param name - Internal item's name
142
- * @param index - The index to put the new item at
143
- */
144
- addToggleButtonItem(name, index) {
145
- throw new Error("Method 'addToggleButtonItem(name: string, index: number)' must be implemented.");
146
- }
147
- /**
148
- * Replaces the item from the associated toolbar on button
149
- * @param name - The name of toolbar button to replace
150
- */
151
- replaceButtonItem(name) {
152
- throw new Error("Method 'replaceButtonItem(name: string)' must be implemented.");
153
- }
154
- /**
155
- * Replace the item from the associated toolbar on menu button
156
- * @param name - The name of toolbar menu button to replace
157
- */
158
- replaceMenuButtonItem(name) {
159
- throw new Error("Method 'replaceMenuButtonItem(name: string)' must be implemented.");
160
- }
161
- /**
162
- * Enables to set parametres to menu button item submenu
163
- * @param name - Item's internal name
164
- * @param itemSubmenuHandler - The toolbar button menu builder
165
- */
166
- handleMenuButtonItemSubmenu(name, itemSubmenuHandler) {
167
- throw new Error("Method 'handleMenuButtonItemSubmenu(name: string, itemSubmenuHandler: IToolbarItemSubmenuHandler)' must be implemented.");
168
- }
169
- /**
170
- * Replaces the item from the associated toolbar on toggle button
171
- * @param name - The name of toolbar toggle button to replace
172
- */
173
- replaceToggleButtonItem(name) {
174
- throw new Error("Method 'replaceToggleButtonItem(name: string)' must be implemented.");
175
- }
176
- /**
177
- * Gets the list of existing item names of associated toolbar
178
- * @returns - Existing toolbar item names
179
- */
180
- get itemNames() {
181
- throw new Error("Getter 'itemNames()' must be implemented.");
182
- }
183
- /**
184
- * Gets count of toolbar items
185
- */
186
- get count() {
187
- throw new Error("Getter 'count()' must be implemented.");
188
- }
189
- /**
190
- * Removes specified item
191
- * @param itemName - Item's internal name
192
- */
193
- removeItem(itemName) {
194
- throw new Error("Method 'removeItem(name: string)' must be implemented.");
195
- }
217
+ /**
218
+ * Represents a menu item and enables to set parametres to it
219
+ */
220
+ class IMenuItemBuilder {
221
+ constructor() {
222
+ if (this.constructor == IMenuItemBuilder) {
223
+ throw new Error("Abstract classes can't be instantiated.");
224
+ }
225
+ }
226
+ /**
227
+ * Item's name to be displayed
228
+ * @param header value
229
+ */
230
+ withHeader(header) {
231
+ throw new Error("Method 'withHeader(header: string)' must be implemented.");
232
+ }
233
+ /**
234
+ * Item's icon
235
+ * @param name Icon name
236
+ * @param iconSvg Url of icon or base64 string
237
+ */
238
+ withIcon(name, iconSvg) {
239
+ throw new Error("Method 'withIcon(name: string, iconSvg: string)' must be implemented.");
240
+ }
241
+ /**
242
+ * Enabled the item
243
+ * @param value value
244
+ */
245
+ withIsEnabled(value) {
246
+ throw new Error("Method 'withIsEnabled(value: boolean)' must be implemented.");
247
+ }
248
+ /**
249
+ * Item's submenu
250
+ */
251
+ withSubmenu() {
252
+ throw new Error("Method 'withSubmenu()' must be implemented.");
253
+ }
196
254
  }
197
255
 
198
- /**
199
- * Interface that allows to add new items to the menu and context menus
200
- */
201
- class IMenu {
202
- /**
203
- * The method is called just before the menu is shown
204
- * @param builder The menu builder object of associated menu
205
- * @param context Context
206
- */
207
- build(builder, context) {
208
- throw new Error("Method 'build(builder: IMenuBuilder, context: TMenuContext)' must be implemented.");
209
- }
210
- /**
211
- *
212
- * @param name
213
- * @param context
214
- */
215
- onMenuItemClick(name, context) {
216
- throw new Error("Method 'onMenuItemClick(name: string, context: TMenuContext)' must be implemented.");
217
- }
256
+ /**
257
+ *
258
+ */
259
+ class ICheckableMenuItemBuilder extends IMenuItemBuilder {
260
+ /**
261
+ *
262
+ * @param value
263
+ */
264
+ withIsChecked(value) {
265
+ throw new Error("Method 'withIsChecked(value: boolean)' must be implemented.");
266
+ }
218
267
  }
219
268
 
220
- /**
221
- * Represents a menu item and enables to set parametres to it
222
- */
223
- class IMenuItemBuilder {
224
- constructor() {
225
- if (this.constructor == IMenuItemBuilder) {
226
- throw new Error("Abstract classes can't be instantiated.");
227
- }
228
- }
229
- /**
230
- * Item's name to be displayed
231
- * @param header value
232
- */
233
- withHeader(header) {
234
- throw new Error("Method 'withHeader(header: string)' must be implemented.");
235
- }
236
- /**
237
- * Item's icon
238
- * @param name Icon name
239
- * @param iconSvg Url of icon or base64 string
240
- */
241
- withIcon(name, iconSvg) {
242
- throw new Error("Method 'withIcon(name: string, iconSvg: string)' must be implemented.");
243
- }
244
- /**
245
- * Enabled the item
246
- * @param value value
247
- */
248
- withIsEnabled(value) {
249
- throw new Error("Method 'withIsEnabled(value: boolean)' must be implemented.");
250
- }
251
- /**
252
- * Item's submenu
253
- */
254
- withSubmenu() {
255
- throw new Error("Method 'withSubmenu()' must be implemented.");
256
- }
269
+ /**
270
+ * Represents a menu and enables to add new items to it
271
+ */
272
+ class IMenuBuilder {
273
+ constructor() {
274
+ if (this.constructor == IMenuBuilder) {
275
+ throw new Error("Abstract classes can't be instantiated.");
276
+ }
277
+ }
278
+ /**
279
+ * Gets the list of existing items of associated menu or subitems of an item
280
+ * @returns Existing menu item names
281
+ */
282
+ get itemNames() {
283
+ throw new Error("Getter 'itemNames()' must be implemented.");
284
+ }
285
+ /**
286
+ * Gets count of menu items
287
+ */
288
+ get count() {
289
+ throw new Error("Getter 'count()' must be implemented.");
290
+ }
291
+ /**
292
+ * Adds a new separator to the associated menu
293
+ * @param index The index to put the new item at
294
+ */
295
+ addSeparator(index) {
296
+ throw new Error("Method 'addSeparator(index: number)' must be implemented.");
297
+ }
298
+ /**
299
+ * Adds a new item to the associated menu
300
+ * @param name Item's internal name
301
+ * @param index The index to put the new item at
302
+ */
303
+ addItem(name, index) {
304
+ throw new Error("Method 'addItem(name: string, index: number)' must be implemented.");
305
+ }
306
+ /**
307
+ * Adds a new checkable item to the associated menu
308
+ * @param name Item's internal name
309
+ * @param index The index to put the new item at
310
+ */
311
+ addCheckableItem(name, index) {
312
+ throw new Error("Method 'addCheckableItem(name: string, index: number)' must be implemented.");
313
+ }
314
+ /**
315
+ * Replaces the item to the associated menu
316
+ * @param name Item's internal name
317
+ */
318
+ replaceItem(name) {
319
+ throw new Error("Method 'replaceItem(name: string)' must be implemented.");
320
+ }
321
+ /**
322
+ * Removes the item with the specified name
323
+ * @param name Item's internal name
324
+ */
325
+ removeItem(name) {
326
+ throw new Error("Method 'removeItem(name: string)' must be implemented.");
327
+ }
328
+ /**
329
+ * Gets the item
330
+ * @param name Item's internal name
331
+ */
332
+ getItem(name) {
333
+ throw new Error("Method 'getItem(name: string)' must be implemented.");
334
+ }
257
335
  }
258
336
 
259
- /**
260
- *
261
- */
262
- class ICheckableMenuItemBuilder extends IMenuItemBuilder {
263
- /**
264
- *
265
- * @param value
266
- */
267
- withIsChecked(value) {
268
- throw new Error("Method 'withIsChecked(value: boolean)' must be implemented.");
269
- }
337
+ /**
338
+ * Contex for objects view
339
+ */
340
+ class ObjectsViewContext {
341
+ constructor(selectedObjects, context, shortcuts) {
342
+ this._selectedObjects = selectedObjects;
343
+ this._context = context;
344
+ this._shortcuts = shortcuts !== null && shortcuts !== void 0 ? shortcuts : [];
345
+ }
346
+ /**
347
+ *
348
+ */
349
+ get selectedObjects() {
350
+ return this._selectedObjects;
351
+ }
352
+ /**
353
+ *
354
+ */
355
+ get contextObject() {
356
+ return this._context;
357
+ }
358
+ /**
359
+ *
360
+ */
361
+ get shortcuts() {
362
+ return this._shortcuts;
363
+ }
270
364
  }
271
365
 
272
- /**
273
- * Represents a menu and enables to add new items to it
274
- */
275
- class IMenuBuilder {
276
- constructor() {
277
- if (this.constructor == IMenuBuilder) {
278
- throw new Error("Abstract classes can't be instantiated.");
279
- }
280
- }
281
- /**
282
- * Gets the list of existing items of associated menu or subitems of an item
283
- * @returns Existing menu item names
284
- */
285
- get itemNames() {
286
- throw new Error("Getter 'itemNames()' must be implemented.");
287
- }
288
- /**
289
- * Gets count of menu items
290
- */
291
- get count() {
292
- throw new Error("Getter 'count()' must be implemented.");
293
- }
294
- /**
295
- * Adds a new separator to the associated menu
296
- * @param index The index to put the new item at
297
- */
298
- addSeparator(index) {
299
- throw new Error("Method 'addSeparator(index: number)' must be implemented.");
300
- }
301
- /**
302
- * Adds a new item to the associated menu
303
- * @param name Item's internal name
304
- * @param index The index to put the new item at
305
- */
306
- addItem(name, index) {
307
- throw new Error("Method 'addItem(name: string, index: number)' must be implemented.");
308
- }
309
- /**
310
- * Adds a new checkable item to the associated menu
311
- * @param name Item's internal name
312
- * @param index The index to put the new item at
313
- */
314
- addCheckableItem(name, index) {
315
- throw new Error("Method 'addCheckableItem(name: string, index: number)' must be implemented.");
316
- }
317
- /**
318
- * Replaces the item to the associated menu
319
- * @param name Item's internal name
320
- */
321
- replaceItem(name) {
322
- throw new Error("Method 'replaceItem(name: string)' must be implemented.");
323
- }
324
- /**
325
- * Removes the item with the specified name
326
- * @param name Item's internal name
327
- */
328
- removeItem(name) {
329
- throw new Error("Method 'removeItem(name: string)' must be implemented.");
330
- }
331
- /**
332
- * Gets the item
333
- * @param name Item's internal name
334
- */
335
- getItem(name) {
336
- throw new Error("Method 'getItem(name: string)' must be implemented.");
337
- }
366
+ /**
367
+ * Context for document annotations list
368
+ */
369
+ class DocumentAnnotationsListContext {
370
+ constructor(selectedAnnotations) {
371
+ this._selectedAnnotations = selectedAnnotations;
372
+ }
373
+ /**
374
+ *
375
+ */
376
+ get selectedAnnotations() {
377
+ return this._selectedAnnotations;
378
+ }
338
379
  }
339
380
 
340
- /*
341
- * Public API Surface of pilot-web-sdk
381
+ /**
382
+ * Context for xps render
383
+ */
384
+ class RenderContext {
385
+ constructor(dataObject, selectedVersion) {
386
+ this._dataObject = dataObject;
387
+ this._selectedVersion = selectedVersion;
388
+ }
389
+ /**
390
+ * Target object
391
+ */
392
+ get dataObject() {
393
+ return this._dataObject;
394
+ }
395
+ /**
396
+ * Selected version time
397
+ */
398
+ get selectedVersion() {
399
+ return this._selectedVersion;
400
+ }
401
+ }
402
+
403
+ function objectToMap(objectMap) {
404
+ const map = new Map();
405
+ Object.keys(objectMap).forEach(key => {
406
+ map.set(key, objectMap[key]);
407
+ });
408
+ return map;
409
+ }
410
+
411
+ class AttributePermissionInfo {
412
+ constructor(editableForPositionsSource) {
413
+ this.ATTRIBUTE_NAME_MARKER = '&';
414
+ this.orgUnits = new Array();
415
+ this.orgUnitAttributes = new Array();
416
+ if (!editableForPositionsSource)
417
+ return;
418
+ editableForPositionsSource.forEach(str => {
419
+ if (str.length > 0 && str[0] === this.ATTRIBUTE_NAME_MARKER) {
420
+ this.orgUnitAttributes.push(str.substring(1));
421
+ }
422
+ else {
423
+ const num = Number(str);
424
+ if (!isNaN(num))
425
+ this.orgUnits.push(num);
426
+ }
427
+ });
428
+ }
429
+ extractAllOrgUnits(obj) {
430
+ const attrMap = objectToMap(obj.attributes);
431
+ return this.extractAllOrgUnitsByAttributes(attrMap);
432
+ }
433
+ extractAllOrgUnitsByAttributes(attributes) {
434
+ let result = new Array();
435
+ if (!this.orgUnitAttributes || !attributes)
436
+ return result;
437
+ this.orgUnitAttributes.forEach(permissionAttributeName => {
438
+ if (attributes.has(permissionAttributeName)) {
439
+ const value = attributes.get(permissionAttributeName);
440
+ if (value && Array.isArray(value)) {
441
+ value.forEach(intValue => {
442
+ result.push(intValue);
443
+ });
444
+ }
445
+ }
446
+ });
447
+ return result;
448
+ }
449
+ }
450
+
451
+ const byteToHex = Array();
452
+ for (let i = 0; i < 256; ++i) {
453
+ byteToHex.push((i + 0x100).toString(16).slice(1));
454
+ }
455
+ class Guid {
456
+ static newGuid() {
457
+ if (window.isSecureContext) {
458
+ // If crypto.getRandomValues is available try to use it.
459
+ return window.crypto.randomUUID();
460
+ }
461
+ // Fall back to Math.random if a higher quality random number generator is not available.
462
+ const uuid = new Array(16);
463
+ var d = new Date().getTime();
464
+ for (var i = 0; i < 16; i++) {
465
+ var r = ((d + Math.random() * 256) % 256) | 0;
466
+ d = Math.trunc(d / 256);
467
+ uuid[i] = r;
468
+ }
469
+ // Makes uuid compliant to RFC-4122
470
+ uuid[6] = (uuid[6] & 0x0F) | 0x40; // uuid version
471
+ uuid[8] = (uuid[8] & 0x3F) | 0x80; // uuid variant
472
+ return this.stringify(uuid);
473
+ }
474
+ static isGuid(str) {
475
+ const regex = new RegExp(this.regex);
476
+ return regex.test(str) && str.length === 36;
477
+ }
478
+ static stringify(arr) {
479
+ return (byteToHex[arr[0]] +
480
+ byteToHex[arr[1]] +
481
+ byteToHex[arr[2]] +
482
+ byteToHex[arr[3]] +
483
+ '-' +
484
+ byteToHex[arr[4]] +
485
+ byteToHex[arr[5]] +
486
+ '-' +
487
+ byteToHex[arr[6]] +
488
+ byteToHex[arr[7]] +
489
+ '-' +
490
+ byteToHex[arr[8]] +
491
+ byteToHex[arr[9]] +
492
+ '-' +
493
+ byteToHex[arr[10]] +
494
+ byteToHex[arr[11]] +
495
+ byteToHex[arr[12]] +
496
+ byteToHex[arr[13]] +
497
+ byteToHex[arr[14]] +
498
+ byteToHex[arr[15]]).toLowerCase();
499
+ }
500
+ }
501
+ Guid.regex = "(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})";
502
+ Guid.EMPTY = "00000000-0000-0000-0000-000000000000";
503
+
504
+ var AccessLevel;
505
+ (function (AccessLevel) {
506
+ AccessLevel[AccessLevel["None"] = 0] = "None";
507
+ AccessLevel[AccessLevel["Create"] = 1] = "Create";
508
+ AccessLevel[AccessLevel["Edit"] = 2] = "Edit";
509
+ AccessLevel[AccessLevel["View"] = 4] = "View";
510
+ AccessLevel[AccessLevel["Freeze"] = 8] = "Freeze";
511
+ AccessLevel[AccessLevel["Agreement"] = 16] = "Agreement";
512
+ AccessLevel[AccessLevel["Share"] = 32] = "Share";
513
+ AccessLevel[AccessLevel["ViewCreate"] = 5] = "ViewCreate";
514
+ AccessLevel[AccessLevel["ViewEdit"] = 7] = "ViewEdit";
515
+ AccessLevel[AccessLevel["ViewEditAgrement"] = 23] = "ViewEditAgrement";
516
+ AccessLevel[AccessLevel["Full"] = 63] = "Full";
517
+ })(AccessLevel || (AccessLevel = {}));
518
+ var AccessType;
519
+ (function (AccessType) {
520
+ AccessType[AccessType["Allow"] = 0] = "Allow";
521
+ AccessType[AccessType["Deny"] = 1] = "Deny";
522
+ })(AccessType || (AccessType = {}));
523
+ var AccessInheritance;
524
+ (function (AccessInheritance) {
525
+ AccessInheritance[AccessInheritance["None"] = 0] = "None";
526
+ AccessInheritance[AccessInheritance["InheritUntilSecret"] = 1] = "InheritUntilSecret";
527
+ AccessInheritance[AccessInheritance["InheritWholeSubtree"] = 2] = "InheritWholeSubtree";
528
+ })(AccessInheritance || (AccessInheritance = {}));
529
+
530
+ var AttributeType;
531
+ (function (AttributeType) {
532
+ AttributeType[AttributeType["Integer"] = 0] = "Integer";
533
+ AttributeType[AttributeType["Double"] = 1] = "Double";
534
+ AttributeType[AttributeType["DateTime"] = 2] = "DateTime";
535
+ AttributeType[AttributeType["String"] = 3] = "String";
536
+ AttributeType[AttributeType["Decimal"] = 4] = "Decimal";
537
+ AttributeType[AttributeType["Numerator"] = 5] = "Numerator";
538
+ AttributeType[AttributeType["Array"] = 6] = "Array";
539
+ AttributeType[AttributeType["UserState"] = 7] = "UserState";
540
+ AttributeType[AttributeType["OrgUnit"] = 8] = "OrgUnit";
541
+ AttributeType[AttributeType["ElementBook"] = 9] = "ElementBook";
542
+ AttributeType[AttributeType["Guid"] = 10] = "Guid";
543
+ AttributeType[AttributeType["IntegerArray"] = 11] = "IntegerArray";
544
+ AttributeType[AttributeType["Unknown"] = 99] = "Unknown";
545
+ })(AttributeType || (AttributeType = {}));
546
+
547
+ var RelationType;
548
+ (function (RelationType) {
549
+ RelationType[RelationType["SourceFiles"] = 1] = "SourceFiles";
550
+ RelationType[RelationType["TaskInitiatorAttachments"] = 2] = "TaskInitiatorAttachments";
551
+ RelationType[RelationType["TaskExecutorAttachments"] = 3] = "TaskExecutorAttachments";
552
+ RelationType[RelationType["MessageAttachments"] = 4] = "MessageAttachments";
553
+ RelationType[RelationType["Custom"] = 5] = "Custom";
554
+ RelationType[RelationType["TaskAttachments"] = 6] = "TaskAttachments";
555
+ })(RelationType || (RelationType = {}));
556
+ var ObjectState;
557
+ (function (ObjectState) {
558
+ ObjectState[ObjectState["Alive"] = 0] = "Alive";
559
+ ObjectState[ObjectState["InRecycleBin"] = 1] = "InRecycleBin";
560
+ ObjectState[ObjectState["DeletedPermanently"] = 2] = "DeletedPermanently";
561
+ ObjectState[ObjectState["Frozen"] = 3] = "Frozen";
562
+ ObjectState[ObjectState["LockRequested"] = 4] = "LockRequested";
563
+ ObjectState[ObjectState["LockAccepted"] = 5] = "LockAccepted";
564
+ })(ObjectState || (ObjectState = {}));
565
+
566
+ var OrgUnitKind;
567
+ (function (OrgUnitKind) {
568
+ OrgUnitKind[OrgUnitKind["Department"] = 0] = "Department";
569
+ OrgUnitKind[OrgUnitKind["Position"] = 1] = "Position";
570
+ OrgUnitKind[OrgUnitKind["Group"] = 2] = "Group";
571
+ })(OrgUnitKind || (OrgUnitKind = {}));
572
+
573
+ var SubscriptionType;
574
+ (function (SubscriptionType) {
575
+ SubscriptionType[SubscriptionType["Shallow"] = 0] = "Shallow";
576
+ SubscriptionType[SubscriptionType["Deep"] = 1] = "Deep";
577
+ })(SubscriptionType || (SubscriptionType = {}));
578
+
579
+ /*
580
+ * Public API Surface of pilot-web-sdk
342
581
  */
343
582
 
344
- /**
345
- * Generated bundle index. Do not edit.
583
+ /**
584
+ * Generated bundle index. Do not edit.
346
585
  */
347
586
 
348
- export { ICheckableMenuItemBuilder, IMenu, IMenuBuilder, IMenuItemBuilder, IToolbar, IToolbarBuilder, IToolbarButtonItemBuilder, IToolbarItemSubmenuHandler, IToolbarMenuButtonItemBuilder, IToolbarToggleButtonItemBuilder, ObjectsViewContext };
587
+ export { AccessInheritance, AccessLevel, AccessType, AttributePermissionInfo, AttributeType, DocumentAnnotationsListContext, Guid, ICheckableMenuItemBuilder, IMenu, IMenuBuilder, IMenuItemBuilder, IToolbar, IToolbarBuilder, IToolbarButtonItemBuilder, IToolbarItemSubmenuHandler, IToolbarMenuButtonItemBuilder, IToolbarToggleButtonItemBuilder, ObjectState, ObjectsViewContext, OrgUnitKind, RelationType, RenderContext, SubscriptionType, objectToMap };
349
588
  //# sourceMappingURL=pilotdev-pilot-web-sdk.mjs.map