Skip to content

Commit 9e95d7c

Browse files
committed
Initiated Peoplepicker control
1 parent 824dc6f commit 9e95d7c

File tree

6 files changed

+520
-6
lines changed

6 files changed

+520
-6
lines changed

src/PeoplePicker.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './controls/peoplepicker/index';
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import { IPersonaProps, DirectionalHint } from "office-ui-fabric-react";
2+
import { WebPartContext } from '@microsoft/sp-webpart-base';
3+
4+
/**
5+
* Used to display a placeholder in case of no or temporary content. Button is optional.
6+
*
7+
*/
8+
export interface IPeoplePickerProps {
9+
/**
10+
* Context of the component
11+
*/
12+
context: WebPartContext;
13+
/**
14+
* Name of SharePoint Group
15+
*/
16+
groupName?: string;
17+
/**
18+
* image Initials
19+
*/
20+
getAllUsers?: boolean;
21+
/**
22+
* Text of the Control
23+
*/
24+
titleText: string;
25+
/**
26+
* Selection Limit of Control
27+
*/
28+
personSelectionLimit?: number;
29+
/**
30+
* Show or Hide Tooltip
31+
*/
32+
showtooltip? : boolean;
33+
/**
34+
* People Field is mandatory
35+
*/
36+
isRequired? : boolean;
37+
/**
38+
* Mandatory field error message
39+
*/
40+
errorMessage? : string;
41+
/**
42+
* Method to check value of People Picker text
43+
*/
44+
selectedItems?: (items: any[]) => void;
45+
/**
46+
* Tooltip Message
47+
*/
48+
tooltipMessage? : string;
49+
/**
50+
* Directional Hint of tool tip
51+
*/
52+
tooltipDirectional? : DirectionalHint;
53+
}
54+
55+
export interface IPeoplePickerState {
56+
selectedPersons?: IPersonaProps[];
57+
mostRecentlyUsedPersons: IPersonaProps[];
58+
currentSelectedPersons: IPersonaProps[];
59+
allPersons: [{
60+
id: string,
61+
imageUrl: string,
62+
imageInitials: string,
63+
primaryText: string, //Name
64+
secondaryText: string, //Role
65+
tertiaryText: string, //status
66+
optionalText: string //stgring
67+
}];
68+
delayResults?: boolean;
69+
currentPicker?: number | string;
70+
peoplePersonaMenu?: IPersonaProps[];
71+
peoplePartTitle: string;
72+
peoplePartTooltip : string;
73+
isLoading : boolean;
74+
peopleValidatorText? : string;
75+
showmessageerror: boolean;
76+
}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
.placeholder {
2+
display: -webkit-box;
3+
display: -ms-flexbox;
4+
display: flex;
5+
6+
.placeholderContainer {
7+
-webkit-box-align: center;
8+
-ms-flex-align: center;
9+
-ms-grid-row-align: center;
10+
align-items: center;
11+
color: "[theme:neutralSecondary, default: #666666]";
12+
background-color: "[theme:neutralLighter, default: #f4f4f4]";
13+
width: 100%;
14+
padding: 80px 0;
15+
16+
.placeholderHead {
17+
color: "[theme:neutralPrimary, default: #333333]";
18+
19+
.placeholderHeadContainer {
20+
height: 100%;
21+
white-space: nowrap;
22+
text-align: center;
23+
}
24+
25+
.placeholderIcon {
26+
display: inline-block;
27+
vertical-align: middle;
28+
white-space: normal;
29+
}
30+
31+
.placeholderText {
32+
display: inline-block;
33+
vertical-align: middle;
34+
white-space: normal
35+
}
36+
}
37+
38+
.placeholderDescription {
39+
width: 65%;
40+
vertical-align: middle;
41+
margin: 0 auto;
42+
text-align: center;
43+
44+
.placeholderDescriptionText {
45+
color: "[theme:neutralSecondary, default: #666666]";
46+
font-size: 17px;
47+
display: inline-block;
48+
margin: 24px 0;
49+
font-weight: 100;
50+
}
51+
52+
button {
53+
font-size: 14px;
54+
font-weight: 400;
55+
box-sizing: border-box;
56+
display: inline-block;
57+
text-align: center;
58+
cursor: pointer;
59+
vertical-align: top;
60+
min-width: 80px;
61+
height: 32px;
62+
background-color: "[theme:themePrimary, default: #0078d7]";
63+
color: #fff;
64+
user-select: none;
65+
outline: transparent;
66+
border-width: 1px;
67+
border-style: solid;
68+
border-color: transparent;
69+
border-image: initial;
70+
text-decoration: none;
71+
}
72+
}
73+
}
74+
}
75+
76+
[dir=ltr] .placeholder,
77+
[dir=rtl] .placeholder {
78+
79+
.placeholderContainer {
80+
81+
.placeholderHead {
82+
83+
.placeholderText {
84+
padding-left: 20px;
85+
}
86+
}
87+
}
88+
}
89+
90+
.placeholderOverlay {
91+
position: relative;
92+
height: 100%;
93+
z-index: 1;
94+
95+
.placeholderSpinnerContainer {
96+
position: relative;
97+
width: 100%;
98+
margin: 164px 0
99+
}
100+
}

0 commit comments

Comments
 (0)