jitz-sharepoint-utilities 2.0.14 → 2.0.16

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 (61) hide show
  1. package/data/context/List.ts +5 -8
  2. package/data/interfaces/IList.ts +2 -2
  3. package/lib/common/IModels.d.ts +40 -0
  4. package/lib/common/IModels.js +2 -0
  5. package/lib/common/IObjects.d.ts +72 -0
  6. package/lib/common/IObjects.js +30 -0
  7. package/lib/controls/JitzGrid.d.ts +75 -0
  8. package/lib/controls/JitzGrid.js +606 -0
  9. package/lib/controls/JitzImage.d.ts +14 -0
  10. package/lib/controls/JitzImage.js +37 -0
  11. package/lib/controls/JitzPeoplePicker.d.ts +49 -0
  12. package/lib/controls/JitzPeoplePicker.js +311 -0
  13. package/lib/controls/JitzPersonInfo.d.ts +32 -0
  14. package/lib/controls/JitzPersonInfo.js +98 -0
  15. package/lib/controls/JitzPersona.d.ts +23 -0
  16. package/lib/controls/JitzPersona.js +48 -0
  17. package/lib/data/context/CommonRepository.d.ts +17 -0
  18. package/lib/data/context/CommonRepository.js +287 -0
  19. package/lib/data/context/JitzContext.d.ts +13 -0
  20. package/lib/data/context/JitzContext.js +80 -0
  21. package/lib/data/context/JitzSPContext.d.ts +8 -0
  22. package/lib/data/context/JitzSPContext.js +58 -0
  23. package/lib/data/context/JitzSPHttpClient.d.ts +14 -0
  24. package/lib/data/context/JitzSPHttpClient.js +173 -0
  25. package/lib/data/context/List.d.ts +39 -0
  26. package/lib/data/context/List.js +492 -0
  27. package/lib/data/context/Repository.d.ts +22 -0
  28. package/lib/data/context/Repository.js +486 -0
  29. package/lib/data/interfaces/ICommonRepository.d.ts +6 -0
  30. package/lib/data/interfaces/ICommonRepository.js +2 -0
  31. package/lib/data/interfaces/IJitzContext.d.ts +10 -0
  32. package/lib/data/interfaces/IJitzContext.js +2 -0
  33. package/lib/data/interfaces/IJitzSPContext.d.ts +6 -0
  34. package/lib/data/interfaces/IJitzSPContext.js +2 -0
  35. package/lib/data/interfaces/IJitzSPHttpClient.d.ts +6 -0
  36. package/lib/data/interfaces/IJitzSPHttpClient.js +2 -0
  37. package/lib/data/interfaces/IList.d.ts +26 -0
  38. package/lib/data/interfaces/IList.js +2 -0
  39. package/lib/data/interfaces/IModels.d.ts +32 -0
  40. package/lib/data/interfaces/IModels.js +2 -0
  41. package/lib/data/interfaces/IRepository.d.ts +17 -0
  42. package/lib/data/interfaces/IRepository.js +2 -0
  43. package/lib/jitzHttpClient.d.ts +11 -0
  44. package/lib/jitzHttpClient.js +37 -0
  45. package/lib/jitzSPHttpClient.d.ts +30 -0
  46. package/lib/jitzSPHttpClient.js +193 -0
  47. package/lib/repositories/CommonRepository.d.ts +17 -0
  48. package/lib/repositories/CommonRepository.js +287 -0
  49. package/lib/repositories/ICommonRepository.d.ts +6 -0
  50. package/lib/repositories/ICommonRepository.js +2 -0
  51. package/lib/repositories/IRepository.d.ts +13 -0
  52. package/lib/repositories/IRepository.js +2 -0
  53. package/lib/repositories/Repository.d.ts +18 -0
  54. package/lib/repositories/Repository.js +392 -0
  55. package/lib/services/GraphService.d.ts +10 -0
  56. package/lib/services/GraphService.js +103 -0
  57. package/lib/services/UserService.d.ts +15 -0
  58. package/lib/services/UserService.js +202 -0
  59. package/lib/services/UtilityService.d.ts +29 -0
  60. package/lib/services/UtilityService.js +254 -0
  61. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
1
  import IJitzContext from "../interfaces/IJitzContext";
2
+ import IJitzSPContext from "../interfaces/IJitzSPContext";
2
3
  import { IList } from "../interfaces/IList";
3
4
  import { IModel } from "../interfaces/IModels";
4
5
  import { IRepository } from "../interfaces/IRepository";
@@ -9,7 +10,7 @@ interface BigObject<T> {
9
10
  }
10
11
 
11
12
  export default class List<T extends IModel> implements IList<T> {
12
- context: IJitzContext;
13
+ context: IJitzSPContext;
13
14
  listName: string;
14
15
  listGuid: string;
15
16
  // _listId: string;
@@ -29,7 +30,7 @@ export default class List<T extends IModel> implements IList<T> {
29
30
  orderBy?: string | undefined;
30
31
 
31
32
  constructor(
32
- jitzContext: IJitzContext,
33
+ jitzSPContext: IJitzSPContext,
33
34
  listName: string,
34
35
  simpleFields: string[],
35
36
  userTypeFields: string[],
@@ -37,18 +38,14 @@ export default class List<T extends IModel> implements IList<T> {
37
38
  additionalExpandFields: string[],
38
39
  listGuid: string = ""
39
40
  ) {
40
- this.context = jitzContext;
41
+ this.context = jitzSPContext;
41
42
  this.listName = listName;
42
43
  this.listGuid = listGuid;
43
44
  this.simpleFields = simpleFields || [];
44
45
  this.userTypeFields = userTypeFields || [];
45
46
  this.lookUpFields = lookUpFields || [];
46
47
  this.additionalExpandFields = additionalExpandFields || [];
47
- this.repository = new Repository<T>(
48
- this.context.spContext,
49
- listName,
50
- listGuid
51
- );
48
+ this.repository = new Repository<T>(this.context, listName, listGuid);
52
49
  }
53
50
 
54
51
  getItems = async (
@@ -1,9 +1,9 @@
1
1
  import { IModel } from "./IModels";
2
- import IJitzContext from "../interfaces/IJitzContext";
2
+ import IJitzSPContext from "../interfaces/IJitzSPContext";
3
3
  import { IRepository } from "./IRepository";
4
4
 
5
5
  export interface IList<T extends IModel> {
6
- context: IJitzContext;
6
+ context: IJitzSPContext;
7
7
  listName: string;
8
8
  repository: IRepository<T>;
9
9
  getItems(
@@ -0,0 +1,40 @@
1
+ export interface IModel {
2
+ Id?: number;
3
+ Title?: string;
4
+ AuthorId?: number;
5
+ Author?: IPersonOrGroup;
6
+ Created?: string;
7
+ Modified?: string;
8
+ __metadata?: {};
9
+ }
10
+ export interface IMultiUserFieldId {
11
+ results: number[];
12
+ }
13
+ export interface IMultiUserField {
14
+ results: IPersonOrGroup[];
15
+ }
16
+ export interface IListItemsMetadata<T> {
17
+ __next: string;
18
+ results: T[];
19
+ }
20
+ export interface IEmail {
21
+ properties: {
22
+ From?: string;
23
+ To: {
24
+ results: string[];
25
+ };
26
+ Body: string;
27
+ Subject: string;
28
+ __metadata?: {};
29
+ };
30
+ }
31
+ export interface IPersonOrGroup {
32
+ Id: number;
33
+ Title: string;
34
+ EMail: string;
35
+ Email: string;
36
+ Name: string;
37
+ LoginName: string;
38
+ IsGroup: boolean;
39
+ Groups?: IPersonOrGroup[];
40
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,72 @@
1
+ import { IPersona } from "@fluentui/react";
2
+ export interface IJitzAlertNotificationProps {
3
+ hideMe: boolean;
4
+ isDraggable: boolean;
5
+ title: string;
6
+ message: string;
7
+ shouldRedirectOnClose: boolean;
8
+ onClose?: () => void;
9
+ }
10
+ export interface IJitzAlertNotificationState {
11
+ }
12
+ export interface IJitzPeoplePickerState {
13
+ currentPicker?: number | string;
14
+ delayResults?: boolean;
15
+ disabled: boolean;
16
+ selectedItems: any[];
17
+ }
18
+ export interface IPeopleSearchProps {
19
+ JobTitle: string;
20
+ PictureURL: string;
21
+ PreferredName: string;
22
+ }
23
+ export interface IUserEntityData {
24
+ IsAltSecIdPresent: string;
25
+ ObjectId: string;
26
+ Title: string;
27
+ Email: string;
28
+ MobilePhone: string;
29
+ OtherMails: string;
30
+ Department: string;
31
+ }
32
+ export interface IClientPeoplePickerSearchUser {
33
+ Key: string;
34
+ Description: string;
35
+ DisplayText: string;
36
+ EntityType: string;
37
+ Title: string;
38
+ ProviderDisplayName: string;
39
+ ProviderName: string;
40
+ IsResolved: boolean;
41
+ EntityData: IUserEntityData;
42
+ MultipleMatches: any[];
43
+ }
44
+ export interface IEnsureUser {
45
+ Email: string;
46
+ Id: number;
47
+ IsEmailAuthenticationGuestUser: boolean;
48
+ IsHiddenInUI: boolean;
49
+ IsShareByEmailGuestUser: boolean;
50
+ IsSiteAdmin: boolean;
51
+ LoginName: string;
52
+ PrincipalType: number;
53
+ Title: string;
54
+ UserId: {
55
+ NameId: string;
56
+ NameIdIssuer: string;
57
+ };
58
+ }
59
+ export interface IEnsurableSharePointUser extends IClientPeoplePickerSearchUser, IEnsureUser {
60
+ imageUrl?: string;
61
+ }
62
+ export declare class SharePointUserPersona implements IPersona {
63
+ private _user;
64
+ get User(): IEnsurableSharePointUser;
65
+ set User(user: IEnsurableSharePointUser);
66
+ constructor(user: IEnsurableSharePointUser);
67
+ primaryText: string;
68
+ secondaryText: string;
69
+ tertiaryText: string;
70
+ imageUrl: string;
71
+ imageShouldFadeIn: boolean;
72
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SharePointUserPersona = void 0;
4
+ var SharePointUserPersona = /** @class */ (function () {
5
+ function SharePointUserPersona(user) {
6
+ this.User = user;
7
+ }
8
+ Object.defineProperty(SharePointUserPersona.prototype, "User", {
9
+ get: function () {
10
+ return this._user;
11
+ },
12
+ set: function (user) {
13
+ this._user = user;
14
+ this.primaryText = user.Title;
15
+ //this.secondaryText = user.EntityData.Title;
16
+ //this.tertiaryText = user.EntityData.Department;
17
+ this.imageShouldFadeIn = true;
18
+ // if (this.User.Key != undefined)
19
+ // this.imageUrl = `/_layouts/15/userphoto.aspx?size=S&accountname=${this.User.Key.substr(
20
+ // this.User.Key.lastIndexOf("|") + 1
21
+ // )}`;
22
+ // else
23
+ // this.imageUrl = `/_layouts/15/userphoto.aspx?size=S&accountname=${this.User.Email}`;
24
+ },
25
+ enumerable: false,
26
+ configurable: true
27
+ });
28
+ return SharePointUserPersona;
29
+ }());
30
+ exports.SharePointUserPersona = SharePointUserPersona;
@@ -0,0 +1,75 @@
1
+ import * as React from "react";
2
+ import { IColumn, SelectionMode } from "@fluentui/react";
3
+ import { IList } from "../data/interfaces/IList";
4
+ import { IModel } from "../common/IModels";
5
+ import IJitzContext from "../data/interfaces/IJitzContext";
6
+ export declare enum SortOrder {
7
+ Asc = "asc",
8
+ Desc = "desc"
9
+ }
10
+ export declare enum DisplayMode {
11
+ Grid = "Grid",
12
+ Tile = "Tile"
13
+ }
14
+ export interface IJitzGridState<T extends IModel> {
15
+ list: IList<T>;
16
+ listForDownload: IList<T>;
17
+ items: any[];
18
+ showingItems: any[];
19
+ rawData: any[];
20
+ showingRawData: any[];
21
+ exportData: any[];
22
+ totalCount: number;
23
+ columns?: IColumn[];
24
+ selectedItems?: {};
25
+ displayMode?: DisplayMode;
26
+ filterQuery?: string;
27
+ isItIndexedSearch?: boolean;
28
+ isItIndexedDownload?: boolean;
29
+ hasNextPage?: boolean;
30
+ hasNextPageToDownload?: boolean;
31
+ processing?: boolean;
32
+ downloading?: boolean;
33
+ }
34
+ export interface IJitzGridProps<T extends IModel> {
35
+ context: IJitzContext;
36
+ list: IList<T>;
37
+ filterQuery?: string;
38
+ orderBy?: string;
39
+ displayFields?: string[];
40
+ exportFields?: string[];
41
+ hasExport?: boolean;
42
+ pageSize?: number;
43
+ renderCustomColumns?: (content: any, fieldName: string, rowItem?: any) => React.ReactElement<{}>;
44
+ modifyColumns?: (columns: IColumn[]) => IColumn[];
45
+ onItemSelect?: (items: any) => void;
46
+ onItemInvoked?: (item: any, index: number | undefined) => void;
47
+ selectionMode?: SelectionMode;
48
+ noRecordsMessage?: string;
49
+ noRecordsMessageCssClass?: string;
50
+ tileComponent?: (content: any) => React.ReactElement<{}>;
51
+ refreshedOn?: Date;
52
+ displayMode?: DisplayMode;
53
+ downloadFileName?: string;
54
+ }
55
+ export declare class JitzGrid<T extends IModel> extends React.Component<IJitzGridProps<T>, IJitzGridState<T>> {
56
+ private _selection;
57
+ constructor(props: IJitzGridProps<T>);
58
+ private _getSelectedItems;
59
+ private getSortOrderString;
60
+ private hasKey;
61
+ private initalLoad;
62
+ private loadMore;
63
+ componentDidMount(): void;
64
+ componentWillReceiveProps(nextProps: IJitzGridProps<T>): Promise<void>;
65
+ downloadData: () => Promise<void>;
66
+ initiateDownload: () => Promise<void>;
67
+ continueDownload: (list: IList<T>) => Promise<void>;
68
+ render(): React.JSX.Element;
69
+ private itemSelected;
70
+ private _buildColumns;
71
+ private _renderItemColumn;
72
+ private _onColumnClick;
73
+ private _onColumnHeaderContextMenu;
74
+ private _onItemInvoked;
75
+ }