@ichicraft/widgets-widget-base 1.9.2 → 1.9.4
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.
- package/README.md +200 -200
- package/lib/.DS_Store +0 -0
- package/lib/BaseWidget.d.ts +18 -18
- package/lib/BaseWidget.js +51 -51
- package/lib/index.d.ts +2 -2
- package/lib/index.js +23 -8
- package/lib/types/index.d.ts +717 -715
- package/lib/types/index.js +43 -42
- package/lib/utils/ConfigurationHelper.d.ts +13 -13
- package/lib/utils/ConfigurationHelper.js +25 -24
- package/lib/utils/UserHelper.d.ts +9 -9
- package/lib/utils/UserHelper.js +146 -145
- package/lib/utils/index.d.ts +2 -2
- package/lib/utils/index.js +18 -7
- package/package.json +27 -24
package/lib/types/index.d.ts
CHANGED
|
@@ -1,715 +1,717 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
*
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
*
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
*
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
*
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
*
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
*
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
*
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
*
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
*
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
*
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
*
|
|
293
|
-
* @param
|
|
294
|
-
*
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
*
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
*
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
*
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
*
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
*
|
|
391
|
-
*
|
|
392
|
-
*
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
*
|
|
399
|
-
*
|
|
400
|
-
*
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
*
|
|
407
|
-
*
|
|
408
|
-
*
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
*
|
|
452
|
-
*
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
*
|
|
474
|
-
*
|
|
475
|
-
*
|
|
476
|
-
*
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
*
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
*
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
/**
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
/**
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
export
|
|
714
|
-
|
|
715
|
-
|
|
1
|
+
import type { AadHttpClientFactory, AadTokenProviderFactory } from '@microsoft/sp-http';
|
|
2
|
+
export type { AadTokenProviderFactory, AadTokenProvider, AadHttpClientFactory, AadHttpClient, AadHttpClientConfiguration, AadHttpClientResponse, } from '@microsoft/sp-http';
|
|
3
|
+
/**
|
|
4
|
+
* Widget context providing widget metadata and functionality offered by the widget board
|
|
5
|
+
*/
|
|
6
|
+
export interface WidgetContext {
|
|
7
|
+
/**
|
|
8
|
+
* Metadata and functions in the context of a widget instance. A widget instance
|
|
9
|
+
* is a single and specific widget that a user has on his/her board. It has its own
|
|
10
|
+
* unique ID and possibly configuration data if the widget is configurable by the user
|
|
11
|
+
*/
|
|
12
|
+
instance: WidgetInstanceContext;
|
|
13
|
+
/**
|
|
14
|
+
* Metadata and functions in the context of a widget's variant (fka definition). A widget variant is
|
|
15
|
+
* a widget that's been installed by an administrator from within the board administration.
|
|
16
|
+
*/
|
|
17
|
+
definition: WidgetVariantContext;
|
|
18
|
+
/**
|
|
19
|
+
* Metadata and functions in the context of a widget's manifest. A widget manifest contains
|
|
20
|
+
* all information of the originally installed widget. Multiple `variants` of the same widget `manifest`
|
|
21
|
+
* can exist in a widget board configuration.
|
|
22
|
+
*/
|
|
23
|
+
manifest: WidgetManifestContext;
|
|
24
|
+
/**
|
|
25
|
+
* Tells whether the widget board is running in a Teams context
|
|
26
|
+
*/
|
|
27
|
+
inTeamsContext: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Tells whether the widget board is running in a Teams browser hosted context
|
|
30
|
+
*/
|
|
31
|
+
isTeamsBrowserHosted: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Tells whether the widget board is running in a Teams webview hosted context
|
|
34
|
+
*/
|
|
35
|
+
isTeamsWebViewHosted: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Tells whether the widget board is running in a SharePoint iOS app context
|
|
38
|
+
*/
|
|
39
|
+
isSharePointiOSApp: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Tells whether the widget board is running in a webview hosted context
|
|
42
|
+
*/
|
|
43
|
+
isWebViewHosted: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Tells whether the widget board is running in an embedded context
|
|
46
|
+
*/
|
|
47
|
+
isEmbedded: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Tells whether the widget board is running in a mobile browser context
|
|
50
|
+
*/
|
|
51
|
+
isMobileBrowser: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Tells whether the widget board is running in a mobile webview context
|
|
54
|
+
*/
|
|
55
|
+
isMobileWebView: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Tenant ID of current SharePoint tenant
|
|
58
|
+
*/
|
|
59
|
+
tenantId: string;
|
|
60
|
+
/**
|
|
61
|
+
* Site url of the site where the widget board is running
|
|
62
|
+
*/
|
|
63
|
+
siteUrl: string;
|
|
64
|
+
/**
|
|
65
|
+
* User name of the currently signed in user.
|
|
66
|
+
*/
|
|
67
|
+
userName: string;
|
|
68
|
+
/**
|
|
69
|
+
* The email address for the current user.
|
|
70
|
+
*
|
|
71
|
+
* @remarks
|
|
72
|
+
* Example: `"example@contoso.com"`
|
|
73
|
+
*/
|
|
74
|
+
userEmail: string;
|
|
75
|
+
/**
|
|
76
|
+
* SharePoint ID of the user in the current site
|
|
77
|
+
*/
|
|
78
|
+
spUserId: number;
|
|
79
|
+
/**
|
|
80
|
+
* Login name of current user in claim style: i:0#.f|myprovider|myuser
|
|
81
|
+
*/
|
|
82
|
+
claimBasedLoginName: string;
|
|
83
|
+
/**
|
|
84
|
+
* Azure AD Security groups that user is member of
|
|
85
|
+
*/
|
|
86
|
+
userSecurityGroups: string[];
|
|
87
|
+
/**
|
|
88
|
+
* SharePoint groups in this site collection that user is member of
|
|
89
|
+
*/
|
|
90
|
+
userSharePointGroups: number[];
|
|
91
|
+
/**
|
|
92
|
+
* Provides the date that the user's account was created
|
|
93
|
+
*/
|
|
94
|
+
userAccountCreated: Date;
|
|
95
|
+
/**
|
|
96
|
+
* Roles of the current user. This may very depending on the active board
|
|
97
|
+
*/
|
|
98
|
+
userRoles: UserRole[];
|
|
99
|
+
/**
|
|
100
|
+
* Language code of currently used UI rendering language in SharePoint
|
|
101
|
+
*/
|
|
102
|
+
language: string;
|
|
103
|
+
/**
|
|
104
|
+
* List of supported languages as configured in Widget Board configuration
|
|
105
|
+
*/
|
|
106
|
+
contentLanguages: {
|
|
107
|
+
/**
|
|
108
|
+
* Numeric Locale ID, like 1033 for English - United States
|
|
109
|
+
*/
|
|
110
|
+
LCID: number;
|
|
111
|
+
/**
|
|
112
|
+
* Language code, like 'en-US' for English - United States
|
|
113
|
+
*/
|
|
114
|
+
BCP47LanguageTag: string;
|
|
115
|
+
/**
|
|
116
|
+
* 2 or 3 character uppercase language code, like 'EN' for English - United States
|
|
117
|
+
*/
|
|
118
|
+
abbreviatedCode: string;
|
|
119
|
+
/**
|
|
120
|
+
* Friendly name of the language, translated in the currently used UI language
|
|
121
|
+
*/
|
|
122
|
+
friendlyName: string;
|
|
123
|
+
/**
|
|
124
|
+
* Whether this is the default UI language of the Widget Board
|
|
125
|
+
*/
|
|
126
|
+
isDefault?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Whether this is the current UI language of the Widget Board
|
|
129
|
+
*/
|
|
130
|
+
isCurrent?: boolean;
|
|
131
|
+
}[];
|
|
132
|
+
/**
|
|
133
|
+
* Preferred border radius of UI elements as configured in Widget Board configuration
|
|
134
|
+
*/
|
|
135
|
+
elementBorderRadius: number;
|
|
136
|
+
/**
|
|
137
|
+
* MS Graph Client Factory class as provided by the WebPartContext object.
|
|
138
|
+
*/
|
|
139
|
+
msGraphClientFactory: any;
|
|
140
|
+
/**
|
|
141
|
+
* AAD Http Client Factory class as provided by the WebPartContext object.
|
|
142
|
+
*/
|
|
143
|
+
aadHttpClientFactory: AadHttpClientFactory;
|
|
144
|
+
/**
|
|
145
|
+
* AAD Token Provider Factory class as provided by the WebPartContext object.
|
|
146
|
+
*/
|
|
147
|
+
aadTokenProviderFactory: AadTokenProviderFactory;
|
|
148
|
+
/**
|
|
149
|
+
* Currently in use theme (by SharePoint/Teams)
|
|
150
|
+
*/
|
|
151
|
+
theme: any;
|
|
152
|
+
/**
|
|
153
|
+
* Returns whether or not the currently signed in user is part of an AAD security group.
|
|
154
|
+
* Provide the guid of the group.
|
|
155
|
+
*/
|
|
156
|
+
isCurrentUserMemberOfSecGroup?: (groupId: string) => Promise<boolean>;
|
|
157
|
+
/**
|
|
158
|
+
* Returns whether or not the currently signed in user is part of a SharePoint group in the current site.
|
|
159
|
+
* Provide the id of the SP Group.
|
|
160
|
+
*/
|
|
161
|
+
isCurrentUserMemberOfSPGroup?: (groupId: number) => Promise<boolean>;
|
|
162
|
+
/**
|
|
163
|
+
* Generates a hash of all combined SP Groups of the current user. This can be used as
|
|
164
|
+
* cache invalidator to detect changes.
|
|
165
|
+
* Store this hash as part of your local cache to detect when to refresh SP Group related data.
|
|
166
|
+
*/
|
|
167
|
+
generateHashForAllCurrentUserSPGroups?: () => Promise<string>;
|
|
168
|
+
/**
|
|
169
|
+
* Generates a hash of all combined AAD Security Groups of the current user. This can be used as
|
|
170
|
+
* cache invalidator to detect changes.
|
|
171
|
+
* Store this hash as part of your local cache to detect when to refresh Sec Group related data.
|
|
172
|
+
*/
|
|
173
|
+
generateHashForAllCurrentUserSecGroups?: () => Promise<string>;
|
|
174
|
+
/**
|
|
175
|
+
* Call this function from within one of the applicable render methods in case of an unresolvable error.
|
|
176
|
+
* The widgetboard will render a 'disrupted' message and in case of an error in widget rendering it
|
|
177
|
+
* offers the user the option to delete the widget from the board.
|
|
178
|
+
*/
|
|
179
|
+
handleFatalError?: () => void;
|
|
180
|
+
/**
|
|
181
|
+
* Functionality offered by the widget board to load a script using SPComponentLoader.
|
|
182
|
+
*/
|
|
183
|
+
loadScript?: <TModule>(url: string, options?: any) => Promise<TModule>;
|
|
184
|
+
/**
|
|
185
|
+
* Functionality offered by the widget board to open a File Picker panel to select files.
|
|
186
|
+
* @param onFilePicked Function that's called when a file was picked. Returns the url of the picked file.
|
|
187
|
+
* @param options Options to change the behavior of the file picker
|
|
188
|
+
*/
|
|
189
|
+
openFilePicker?: (onFilePicked: (fileUrl: string, fileProps: FilePickerFileProps) => void, options?: FilePickerOptions) => void;
|
|
190
|
+
/**
|
|
191
|
+
* Functionality offered by the widget board to open a url in an iframe dialog.
|
|
192
|
+
* @param url The url to open in a dialog.
|
|
193
|
+
* @param options Options to configure the dialog (e.g. size, margin, callbacks, ...)
|
|
194
|
+
*/
|
|
195
|
+
openIFrameDialog?: (url: string, options?: IFrameDialogOptions) => void;
|
|
196
|
+
/**
|
|
197
|
+
* Provides access to the Teams SDK and Teams context. Only provided when the web part is loaded in Teams.
|
|
198
|
+
*/
|
|
199
|
+
teamsSdk?: {
|
|
200
|
+
/**
|
|
201
|
+
* Microsoft Teams SDK.
|
|
202
|
+
*/
|
|
203
|
+
teamsJs: any;
|
|
204
|
+
/**
|
|
205
|
+
* {@inheritDoc @microsoft/teams-js#Context}
|
|
206
|
+
*/
|
|
207
|
+
context: any;
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Widget instance context providing metadata and functionality offered by the widget board. A widget instance
|
|
212
|
+
* is a single and specific widget that a user has on his/her board. It has its own
|
|
213
|
+
* unique ID and possibly configuration data if the widget is configurable by the user
|
|
214
|
+
*/
|
|
215
|
+
export interface WidgetInstanceContext {
|
|
216
|
+
/**
|
|
217
|
+
* Unique id for a specific widget on a user's board
|
|
218
|
+
*/
|
|
219
|
+
id: string;
|
|
220
|
+
/**
|
|
221
|
+
* Optional configuration data that contains user settings of a specific widget instance
|
|
222
|
+
*/
|
|
223
|
+
data?: string;
|
|
224
|
+
/**
|
|
225
|
+
* The type of board this widget instance is added to.
|
|
226
|
+
*/
|
|
227
|
+
boardType?: BoardType;
|
|
228
|
+
/**
|
|
229
|
+
* Call this function from within a widget instance to publish a notification to the
|
|
230
|
+
* notitication box on top of the widget board. It should provide information for this specific
|
|
231
|
+
* widget instance. Notitifcation content is limited to one single line and a widget instance
|
|
232
|
+
* can only have one active notification at a time
|
|
233
|
+
*/
|
|
234
|
+
publishNotification?: (content: string, expirationDateTime: Date) => void;
|
|
235
|
+
/**
|
|
236
|
+
* Call this function to open the widget configuration panel for a user. This is an additional
|
|
237
|
+
* way to open the panel because a user can also open the configuration panel by using the contextual
|
|
238
|
+
* menu of the widget.
|
|
239
|
+
*/
|
|
240
|
+
openConfiguration?: () => void;
|
|
241
|
+
/**
|
|
242
|
+
* Call this function to open the widget delete confirmation dialog for a user. This offers widget developers
|
|
243
|
+
* the ability to trigger the "widget deletion process". This allows different methods to delete the widget.
|
|
244
|
+
*/
|
|
245
|
+
initiateWidgetDeletion?: () => void;
|
|
246
|
+
/**
|
|
247
|
+
* Functionality offered by the widget board to change the title of the widget.
|
|
248
|
+
*/
|
|
249
|
+
setWidgetTitle?: (title: string) => void;
|
|
250
|
+
/**
|
|
251
|
+
* Functionality offered by the widget board to append the title of the widget with additional text.
|
|
252
|
+
*/
|
|
253
|
+
setWidgetTitleSuffix?: (suffix: string) => void;
|
|
254
|
+
/**
|
|
255
|
+
* Functionality offered by the widget board to change the subtitle of the widget.
|
|
256
|
+
*/
|
|
257
|
+
setWidgetSubtitle?: (subtitle: string) => void;
|
|
258
|
+
/**
|
|
259
|
+
* Show or hide the header of the widget, allowing widgets to take control of full widget real estate.
|
|
260
|
+
*/
|
|
261
|
+
setWidgetHeaderVisibility?: (visible: boolean) => void;
|
|
262
|
+
/**
|
|
263
|
+
* Show or hide the settings button of the widget.
|
|
264
|
+
*/
|
|
265
|
+
setUserConfigButtonVisibility?: (visible: boolean) => void;
|
|
266
|
+
/**
|
|
267
|
+
* Optional callback to handle the click event of the widget title.
|
|
268
|
+
*/
|
|
269
|
+
onWidgetTitleClicked?: () => void;
|
|
270
|
+
/**
|
|
271
|
+
* Allows registration of multiple custom command bar items which can either result in an icon or
|
|
272
|
+
* an icon button, depending on the presence of the onClick property. To remove the items,
|
|
273
|
+
* use the [unregisterCommandBarItems] function.
|
|
274
|
+
*/
|
|
275
|
+
registerCustomCommandBarItems?: (props: CustomCommandBarItemProps[]) => void;
|
|
276
|
+
/**
|
|
277
|
+
* Allows registration of a custom command bar item which can either result in an icon or
|
|
278
|
+
* an icon button, depending on the presence of the onClick property. To remove the item,
|
|
279
|
+
* use the [unregisterCommandBarItem] function.
|
|
280
|
+
*/
|
|
281
|
+
registerCustomCommandBarItem?: (props: CustomCommandBarItemProps) => void;
|
|
282
|
+
/**
|
|
283
|
+
* Removes all registered custom command bar items.
|
|
284
|
+
*/
|
|
285
|
+
unregisterCustomCommandBarItems?: () => void;
|
|
286
|
+
/**
|
|
287
|
+
* Removes a single custom command bar item, corresponding to the provided id.
|
|
288
|
+
* If no id was specified, it removes all items.
|
|
289
|
+
*/
|
|
290
|
+
unregisterCustomCommandBarItem?: (id?: string) => void;
|
|
291
|
+
/**
|
|
292
|
+
* Raises an event to be handled by the Time-based Events feature of Ichicraft Boards.
|
|
293
|
+
* @param object The object this event concerns (e.g. app, report, newsArticle, ...). Use camelCase.
|
|
294
|
+
* @param action The action that was performed to/on the object (e.g. viewed, clicked, deleted, ...). Use camelCase.
|
|
295
|
+
* @param data Optionally provide extra metadata to be included with the raised event.
|
|
296
|
+
* widgetAlias property (from manifest) and variantTitle property will automatically be added by the widget board.
|
|
297
|
+
*/
|
|
298
|
+
raiseEvent?: (object: string, action: string, data?: {
|
|
299
|
+
[key: string]: string;
|
|
300
|
+
}) => void;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Widget variant context providing metadata and functionality offered by the widget board. A widget variant is
|
|
304
|
+
* a widget that's been installed by an administrator from within the board administration.
|
|
305
|
+
*/
|
|
306
|
+
export interface WidgetVariantContext {
|
|
307
|
+
/**
|
|
308
|
+
* Unique id of an installed and configured widget in the widget board.
|
|
309
|
+
* If this is a 'single instance widget', which means that no more than one instance of this
|
|
310
|
+
* widget can be installed in the widget board, the id of the definition is the same as the id of the manifest.
|
|
311
|
+
*/
|
|
312
|
+
id: string;
|
|
313
|
+
/**
|
|
314
|
+
* Optional configuration data that contains board-wide settings of a specific widget instance
|
|
315
|
+
*/
|
|
316
|
+
data?: string;
|
|
317
|
+
/**
|
|
318
|
+
* A list of board types applicable for this widget variant.
|
|
319
|
+
*/
|
|
320
|
+
allowedBoardTypes?: BoardType[];
|
|
321
|
+
/**
|
|
322
|
+
* The icon defined for this widget variant.
|
|
323
|
+
*/
|
|
324
|
+
iconName?: string;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Widget manifest context providing metadata and functions offered by the widget board. A widget manifest contains
|
|
328
|
+
* all information of the originally installed widget. Multiple `variants` of the same widget `manifest`
|
|
329
|
+
* can exist in a widget board configuration.
|
|
330
|
+
*/
|
|
331
|
+
export interface WidgetManifestContext {
|
|
332
|
+
/**
|
|
333
|
+
* Unique id of a widget 'type', also used in the widget manifest config file in the original script source manifest file.
|
|
334
|
+
* If this is a 'single instance widget', which means that no more than one instance of this
|
|
335
|
+
* widget can be installed in the widget board, the id of the definition is the same as the id of the manifest.
|
|
336
|
+
*/
|
|
337
|
+
id: string;
|
|
338
|
+
}
|
|
339
|
+
export interface ValidationResult {
|
|
340
|
+
isValid: boolean;
|
|
341
|
+
errors: string[];
|
|
342
|
+
}
|
|
343
|
+
export interface WidgetImages {
|
|
344
|
+
preview: string;
|
|
345
|
+
additional: string[];
|
|
346
|
+
}
|
|
347
|
+
export interface WidgetResource {
|
|
348
|
+
lang: number;
|
|
349
|
+
title: string;
|
|
350
|
+
subtitle?: string;
|
|
351
|
+
shortDescription: string;
|
|
352
|
+
instructions: string;
|
|
353
|
+
images: WidgetImages;
|
|
354
|
+
}
|
|
355
|
+
export interface WebApiPermissionRequest {
|
|
356
|
+
/**
|
|
357
|
+
* Specifies the name of the resource service principle to wich access has been granted. Use the same principle names as in a SPPKG packages webApiPermissionRequests.
|
|
358
|
+
*/
|
|
359
|
+
resource: string;
|
|
360
|
+
/**
|
|
361
|
+
* Specifies the name of the scope claim that the resource application should expect in the OAuth 2.0 access token. Use the same scope names as in a SPPKG packages webApiPermissionRequests.
|
|
362
|
+
*/
|
|
363
|
+
scope: string;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* The widget manifest contains meta information about the widget
|
|
367
|
+
*/
|
|
368
|
+
export interface WidgetManifestConfig {
|
|
369
|
+
/**
|
|
370
|
+
* Version of the widget manifest schema. The value of this field
|
|
371
|
+
* is controlled by Ichicraft. The purpose of this field is to help
|
|
372
|
+
* manage upgrades of the widget manifest schema.
|
|
373
|
+
* The current version is version 2, introducing externals + manifestVersion
|
|
374
|
+
* properties
|
|
375
|
+
*/
|
|
376
|
+
manifestVersion: number;
|
|
377
|
+
/**
|
|
378
|
+
* Unique id to identify the widget
|
|
379
|
+
*/
|
|
380
|
+
id: string;
|
|
381
|
+
/**
|
|
382
|
+
* Internal name for the widget, used internally by Ichicraft
|
|
383
|
+
*/
|
|
384
|
+
name: string;
|
|
385
|
+
/**
|
|
386
|
+
* Version should contain the semver of this widget. For future use.
|
|
387
|
+
*/
|
|
388
|
+
version: string;
|
|
389
|
+
/**
|
|
390
|
+
* The minimum number of rows this widget can inhabit in the widget board.
|
|
391
|
+
* By default, a widget always takes up 2 rows (and 1 column),
|
|
392
|
+
* If you want the widget to be able to shrink to 1 row, specify 1, otherwise, leave this
|
|
393
|
+
* property empty.
|
|
394
|
+
* _REMARK_: A value higher than 2 is considered invalid and will be ignored.
|
|
395
|
+
*/
|
|
396
|
+
minRows: number;
|
|
397
|
+
/**
|
|
398
|
+
* The maximum number of rows this widget can inhabit in the widget board.
|
|
399
|
+
* By default, a widget always takes up 2 rows (and 1 column).
|
|
400
|
+
* Leave this empty and the maxRows will be defaulted to 2.
|
|
401
|
+
* Specify Inifinity to allow spanning any number of rows.
|
|
402
|
+
* _REMARK_: A value lower than 2 is considered invalid and will be ignored.
|
|
403
|
+
*/
|
|
404
|
+
maxRows: number;
|
|
405
|
+
/**
|
|
406
|
+
* The maximum number of columns this widget can inhabit in the widget board.
|
|
407
|
+
* By default, a widget always takes up 1 column (and 2 rows).
|
|
408
|
+
* Leave this empty and the maxCols will be defaulted to 1.
|
|
409
|
+
* Specify Inifinity to allow spanning any number of columns.
|
|
410
|
+
* _REMARK_ A value lower than 1 is considered invalid and will be ignored.
|
|
411
|
+
*/
|
|
412
|
+
maxCols: number;
|
|
413
|
+
/**
|
|
414
|
+
* Whether this widget is configurable by the user. Implementation of user config functions is necessary if true.
|
|
415
|
+
*/
|
|
416
|
+
isConfigurableByUser: boolean;
|
|
417
|
+
/**
|
|
418
|
+
* Whether this widget is configurable by the board admin. Implementation of admin config functions is necessary if true.
|
|
419
|
+
*/
|
|
420
|
+
isConfigurableByAdmin: boolean;
|
|
421
|
+
/**
|
|
422
|
+
* Internally used by Ichicraft
|
|
423
|
+
*/
|
|
424
|
+
widgetBoardCompatibilityVersion?: number;
|
|
425
|
+
/**
|
|
426
|
+
* Icon used to represent this widget, used as default when installing a widget in the board. Icon should be the type id of a UI Fabric icon.
|
|
427
|
+
*/
|
|
428
|
+
iconName: string;
|
|
429
|
+
/**
|
|
430
|
+
* Image used to represent this widget, used as default when installing a widget in the board.
|
|
431
|
+
*/
|
|
432
|
+
thumbnailUrl: string;
|
|
433
|
+
/**
|
|
434
|
+
* Language specific resources for this widget, used as default when installing a widget in the board
|
|
435
|
+
*/
|
|
436
|
+
resources: WidgetResource[];
|
|
437
|
+
/**
|
|
438
|
+
* Web API permission requests. Like SPPKG packages, the widget specifies required API permissions.
|
|
439
|
+
*/
|
|
440
|
+
webApiPermissionRequests?: WebApiPermissionRequest[];
|
|
441
|
+
/**
|
|
442
|
+
* This is the url of the widget script. It should be a well formatted url that points
|
|
443
|
+
* to the script file's unique location. Script files should be hosted on a secure website (https).
|
|
444
|
+
*/
|
|
445
|
+
scriptUrl: string;
|
|
446
|
+
/**
|
|
447
|
+
* File path used when debugging a widget, this is set automatically when you debug a widget
|
|
448
|
+
*/
|
|
449
|
+
bundleFilePath?: string;
|
|
450
|
+
/**
|
|
451
|
+
* Added in manifestVersion 2
|
|
452
|
+
* Lists modules (package dependencies) that should be loaded separately from bundle.
|
|
453
|
+
* Libraries mentioned here will not be bundled when packed as a production release,
|
|
454
|
+
* instead, they will be loaded from the provided path (path points to a CDN or other file location)
|
|
455
|
+
*/
|
|
456
|
+
externals?: {
|
|
457
|
+
[name: string]: {
|
|
458
|
+
/**
|
|
459
|
+
* Path to the script file. If this is a module (e.g. AMD or UMD), make sure you also
|
|
460
|
+
* specify the modules this module depends on as separate modules using the correct aliases.
|
|
461
|
+
*/
|
|
462
|
+
path: string;
|
|
463
|
+
/**
|
|
464
|
+
* Used for non-AMD scripts to specify dependencies. Should point to other non-AMD modules
|
|
465
|
+
*/
|
|
466
|
+
globalDependencies?: string[];
|
|
467
|
+
/**
|
|
468
|
+
* In case this isn't an AMD module, define the variable name used by the script to
|
|
469
|
+
* make the module available (i.e. global/root/window variable name like jQuery or $)
|
|
470
|
+
*/
|
|
471
|
+
globalName?: string;
|
|
472
|
+
/**
|
|
473
|
+
* If this module has dependencies, map them here to other externals you also specified
|
|
474
|
+
* For instance: external @fluentui/react umd module has dependencies React and ReactDOM.
|
|
475
|
+
* To point these to the right externals, map them like this:
|
|
476
|
+
* React: react
|
|
477
|
+
* ReactDOM: 'react-dom'
|
|
478
|
+
* And make sure you specified 'react' and 'react-dom' as externals as well.
|
|
479
|
+
*/
|
|
480
|
+
dependencyMappings?: {
|
|
481
|
+
[name: string]: string;
|
|
482
|
+
};
|
|
483
|
+
};
|
|
484
|
+
};
|
|
485
|
+
/**
|
|
486
|
+
* Everything related to analytics of this widget in Ichicraft Boards
|
|
487
|
+
*/
|
|
488
|
+
analytics?: {
|
|
489
|
+
/**
|
|
490
|
+
* A list of time-based events this widget can raise. All the possible events MUST be
|
|
491
|
+
* described in this list for the widget board to be able to pick them up.
|
|
492
|
+
* @ref Use WidgetContext.instance.raiseEvent(object: string, action: string, data?: { [key: string]: string }) to raise these events
|
|
493
|
+
*/
|
|
494
|
+
timeBasedEvents: {
|
|
495
|
+
/**
|
|
496
|
+
* The object this event concerns (e.g. app, report, newsArticle, ...). Use camelCase.
|
|
497
|
+
*/
|
|
498
|
+
object: string;
|
|
499
|
+
/**
|
|
500
|
+
* The action that was performed to/on the object (e.g. viewed, clicked, deleted, ...). Use camelCase.
|
|
501
|
+
*/
|
|
502
|
+
action: string;
|
|
503
|
+
/**
|
|
504
|
+
* A descriptive text used in the Administration panel to describe this event
|
|
505
|
+
*/
|
|
506
|
+
description: string;
|
|
507
|
+
}[];
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
export declare enum DebugComponentType {
|
|
511
|
+
/**
|
|
512
|
+
* This is the default component type and just opens the default widget board.
|
|
513
|
+
*/
|
|
514
|
+
Default = "Default",
|
|
515
|
+
/**
|
|
516
|
+
* This automatically opens the widget board administration panel and opens the widget admin config
|
|
517
|
+
* dialog of the widget you're working on
|
|
518
|
+
*/
|
|
519
|
+
AdminConfig = "AdminConfig"
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* The widget debug serve config contains settings for debugging a widget in development
|
|
523
|
+
*/
|
|
524
|
+
export interface WidgetDebugServeConfig {
|
|
525
|
+
/**
|
|
526
|
+
* Provide a url of a SharePoint site that hosts a widget board. This page will be opened
|
|
527
|
+
* as soon as you start debugging using [npm run start]
|
|
528
|
+
*/
|
|
529
|
+
widgetsDebugPageUrl: string;
|
|
530
|
+
/**
|
|
531
|
+
* Provide a component type to open the debugging widget board with that specific component.
|
|
532
|
+
* This speeds up your development cycle: [npm run start] > save changes > builds automatically >
|
|
533
|
+
* refresh browser > automatically open updated component.
|
|
534
|
+
*/
|
|
535
|
+
debugComponentType?: DebugComponentType;
|
|
536
|
+
}
|
|
537
|
+
export declare enum ICPersonaType {
|
|
538
|
+
User = 0,
|
|
539
|
+
SPGroup = 1,
|
|
540
|
+
Other = 2,
|
|
541
|
+
Custom = 3
|
|
542
|
+
}
|
|
543
|
+
export interface ICPersona {
|
|
544
|
+
displayName: string;
|
|
545
|
+
id: string;
|
|
546
|
+
type?: ICPersonaType;
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* Tells the severity of the command bar item, resulting in
|
|
550
|
+
* distinguishable presentation of the item
|
|
551
|
+
*/
|
|
552
|
+
export declare enum CustomCommandBarItemSeverity {
|
|
553
|
+
/** Normal severity, displays just like all the other command bar items */
|
|
554
|
+
Normal = 0,
|
|
555
|
+
/** Warning severity, displays the item with a more noticable warning color */
|
|
556
|
+
Warning = 1
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Tells how to render the command bar item, e.g. as an icon button or as a link.
|
|
560
|
+
*/
|
|
561
|
+
export declare enum CommandBarItemType {
|
|
562
|
+
/** Normal severity, displays just like all the other command bar items */
|
|
563
|
+
Icon = "icon",
|
|
564
|
+
/** Warning severity, displays the item with a more noticable warning color */
|
|
565
|
+
Link = "link"
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Properties to pass to the registerCommandBarItems function, resulting in the
|
|
569
|
+
* rendering of a command bar item.
|
|
570
|
+
*/
|
|
571
|
+
export type CustomCommandBarItemProps = CommandBarIcon | CommandBarLink;
|
|
572
|
+
/**
|
|
573
|
+
* Base properties of a custom CommandBarItem.
|
|
574
|
+
*/
|
|
575
|
+
export interface CommandBarItemBase {
|
|
576
|
+
/**
|
|
577
|
+
* Optional identifier for the icon.
|
|
578
|
+
*/
|
|
579
|
+
id?: string;
|
|
580
|
+
/**
|
|
581
|
+
* Type of item, (e.g. 'icon' or 'link')
|
|
582
|
+
*/
|
|
583
|
+
itemType: CommandBarItemType;
|
|
584
|
+
/**
|
|
585
|
+
* Optional content to show as a tooltip above the item.
|
|
586
|
+
*/
|
|
587
|
+
tooltipContent?: string;
|
|
588
|
+
/**
|
|
589
|
+
* Optionally tells the tooltip to be shown automatically.
|
|
590
|
+
*/
|
|
591
|
+
showTooltipAutomatically?: boolean;
|
|
592
|
+
/**
|
|
593
|
+
* Optionally tells the Widget Header that this item should always be visible, even when not hovering.
|
|
594
|
+
*/
|
|
595
|
+
pinned?: boolean;
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* Properties to render a custom CommandBarItem either as a single Icon or an Icon Button.
|
|
599
|
+
*/
|
|
600
|
+
export interface CommandBarIcon extends CommandBarItemBase {
|
|
601
|
+
itemType: CommandBarItemType.Icon;
|
|
602
|
+
/**
|
|
603
|
+
* Name of the icon, as specified and available in Fluent UI Iconography:
|
|
604
|
+
* https://developer.microsoft.com/en-us/fluentui#/styles/web/icons
|
|
605
|
+
*/
|
|
606
|
+
iconName: string;
|
|
607
|
+
/**
|
|
608
|
+
* Optionally display a red notification icon badge in the top-right corner of the button.
|
|
609
|
+
*/
|
|
610
|
+
showNotificationBadge?: boolean;
|
|
611
|
+
/**
|
|
612
|
+
* Optional severity to specify how the item should render
|
|
613
|
+
*/
|
|
614
|
+
severity?: CustomCommandBarItemSeverity;
|
|
615
|
+
/**
|
|
616
|
+
* Optionally provide an order in which this button should appear, when registering multiple custom buttons.
|
|
617
|
+
*/
|
|
618
|
+
order?: number;
|
|
619
|
+
/**
|
|
620
|
+
* Optional onClick event, which is triggered on user click and makes the command
|
|
621
|
+
* bar item render as a button instead of a non-clickable icon.
|
|
622
|
+
*/
|
|
623
|
+
onClick?: () => void;
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* Properties to render a custom CommandBarItem as a Link Button.
|
|
627
|
+
*/
|
|
628
|
+
export interface CommandBarLink extends CommandBarItemBase {
|
|
629
|
+
itemType: CommandBarItemType.Link;
|
|
630
|
+
/**
|
|
631
|
+
* Required label to display the clickable link.
|
|
632
|
+
*/
|
|
633
|
+
label: string;
|
|
634
|
+
/**
|
|
635
|
+
* Required onClick event, which is triggered on user click.
|
|
636
|
+
*/
|
|
637
|
+
onClick: () => void;
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* Options to pass to the openIFrameDialog function. Use this to configure how the dialog is rendered, and to handle events (e.g. onDismissed)
|
|
641
|
+
*/
|
|
642
|
+
export interface IFrameDialogOptions {
|
|
643
|
+
/**
|
|
644
|
+
* Maximum width of the dialog. If it exceeds the window width, that width is used instead.
|
|
645
|
+
*/
|
|
646
|
+
maxWidth?: number;
|
|
647
|
+
/**
|
|
648
|
+
* Maximum height of the dialog. If it exceeds the window height, that height is used instead.
|
|
649
|
+
*/
|
|
650
|
+
maxHeight?: number;
|
|
651
|
+
/**
|
|
652
|
+
* Minimum margin on the left- and right side of the dialog.
|
|
653
|
+
*/
|
|
654
|
+
marginHorizontal?: number;
|
|
655
|
+
/**
|
|
656
|
+
* Minimum margin on the top- and bottom side of the dialog.
|
|
657
|
+
*/
|
|
658
|
+
marginVertical?: number;
|
|
659
|
+
/**
|
|
660
|
+
* This event is triggered when the iFrame dialog is dismissed by the user.
|
|
661
|
+
*/
|
|
662
|
+
onDismissed?: () => void;
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* Options to pass to openFilePicker function
|
|
666
|
+
*/
|
|
667
|
+
export interface FilePickerOptions {
|
|
668
|
+
/**
|
|
669
|
+
* Array of file extensions that will be used to filter the files in the picker.
|
|
670
|
+
* @default ['.gif', '.jpg', '.jpeg', '.png']
|
|
671
|
+
*/
|
|
672
|
+
extensions?: string[];
|
|
673
|
+
/**
|
|
674
|
+
* Maximum number of files to show in a folder
|
|
675
|
+
* @default 100
|
|
676
|
+
*/
|
|
677
|
+
itemsCountQueryLimit?: number;
|
|
678
|
+
/**
|
|
679
|
+
* Whether or not to hide the organisational site files tab
|
|
680
|
+
* @default false
|
|
681
|
+
*/
|
|
682
|
+
hideOrganisationalAssetTab?: boolean;
|
|
683
|
+
/**
|
|
684
|
+
* Whether or not to hide the site files tab
|
|
685
|
+
* @default false
|
|
686
|
+
*/
|
|
687
|
+
hideSiteFilesTab?: boolean;
|
|
688
|
+
/**
|
|
689
|
+
* Whether or not to hide the upload tab
|
|
690
|
+
* @default false
|
|
691
|
+
*/
|
|
692
|
+
hideLocalUploadTab?: boolean;
|
|
693
|
+
/**
|
|
694
|
+
* Function that's called when user closes file picker without picking a file
|
|
695
|
+
* @default undefined
|
|
696
|
+
*/
|
|
697
|
+
onCancel?: () => void;
|
|
698
|
+
}
|
|
699
|
+
export interface FilePickerFileProps {
|
|
700
|
+
/**
|
|
701
|
+
* Unique identifier of the file item in SharePoint, in the shape of a Guid.
|
|
702
|
+
*/
|
|
703
|
+
uniqueId: string;
|
|
704
|
+
/**
|
|
705
|
+
* Unique identifier of the list in SharePoint, in the shape of a Guid.
|
|
706
|
+
*/
|
|
707
|
+
listId: string;
|
|
708
|
+
/**
|
|
709
|
+
* Unique identifier of the site in SharePoint, in the shape of a Guid.
|
|
710
|
+
*/
|
|
711
|
+
siteId: string;
|
|
712
|
+
}
|
|
713
|
+
export type BoardType = 'shared' | 'personal';
|
|
714
|
+
export type UserRole = 'administrator' | 'board-owner';
|
|
715
|
+
export interface ExportData {
|
|
716
|
+
data: object[];
|
|
717
|
+
}
|