Skip to content

Commit 64d193b

Browse files
vogtnnmetulev
authored andcommitted
[all] updating components with tsdocs comments to properties, additio… (#125)
* [all] updating components with tsdocs comments to properties, additionally only people picker has function comments * [mgt-agenda] updating tsdocs * [mgt-login] updating tsdocs * [people] updating ts docs * [people-picker] updating tsdocs * [mgt-person] updating tsdocs * [mgt-tasks] updating tsdocs * [mgt-login] additional ts documentation
1 parent d71fa44 commit 64d193b

File tree

6 files changed

+322
-43
lines changed

6 files changed

+322
-43
lines changed

src/components/mgt-agenda/mgt-agenda.ts

Lines changed: 65 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,51 +17,93 @@ import '../../styles/fabric-icon-font';
1717
import { MgtTemplatedComponent } from '../templatedComponent';
1818
import { prepScopes } from '../../Graph';
1919
import { MgtPersonDetails } from '../mgt-person/mgt-person';
20-
20+
/**
21+
* Web Component which represents events in a user or group calendar.
22+
*
23+
* @export
24+
* @class MgtAgenda
25+
* @extends {MgtTemplatedComponent}
26+
*/
2127
@customElement('mgt-agenda')
2228
export class MgtAgenda extends MgtTemplatedComponent {
2329
private _firstUpdated = false;
30+
/**
31+
* determines width available for agenda component.
32+
* @type {boolean}
33+
*/
2434
@property({ attribute: false }) private _isNarrow: boolean;
35+
36+
/**
37+
* determines if agenda component is still loading details.
38+
* @type {boolean}
39+
*/
2540
@property({ attribute: false }) private _loading: boolean = true;
2641

42+
/**
43+
* array containg events from user agenda.
44+
* @type {Array<MicrosoftGraph.Event>}
45+
*/
2746
@property({
2847
attribute: 'events'
2948
})
3049
events: Array<MicrosoftGraph.Event>;
3150

51+
/**
52+
* allows developer to define agenda to group events by day.
53+
* @type {Boolean}
54+
*/
3255
@property({
3356
attribute: 'group-by-day',
3457
type: Boolean,
3558
reflect: true
3659
})
3760
groupByDay = false;
3861

62+
/**
63+
* stores current date for intial calender selection in events.
64+
* @type {string}
65+
*/
3966
@property({
4067
attribute: 'date',
4168
type: String,
4269
reflect: true
4370
})
4471
date: string;
4572

73+
/**
74+
* sets number of days until endate, 3 is the default
75+
* @type {number}
76+
*/
4677
@property({
4778
attribute: 'days',
4879
type: Number,
4980
reflect: true
5081
})
5182
days: number = 3;
5283

84+
/**
85+
* allows developer to specify a different graph query that retrieves events
86+
* @type {string}
87+
*/
5388
@property({
5489
attribute: 'event-query',
5590
type: String
5691
})
5792
eventQuery: string;
5893

94+
/**
95+
* allows developer to define max number of events shown
96+
* @type {number}
97+
*/
5998
@property({
6099
attribute: 'show-max',
61100
type: Number
62101
})
63102
showMax: number;
64-
103+
/**
104+
* determines if agenda events come from specific group
105+
* @type {string}
106+
*/
65107
@property({
66108
attribute: 'group-id',
67109
type: String
@@ -77,7 +119,17 @@ export class MgtAgenda extends MgtTemplatedComponent {
77119
this.onResize = this.onResize.bind(this);
78120
}
79121

80-
firstUpdated() {
122+
/**
123+
* Invoked when the element is first updated. Implement to perform one time
124+
* work on the element after update.
125+
*
126+
* Setting properties inside this method will trigger the element to update
127+
* again after this update cycle completes.
128+
*
129+
* * @param _changedProperties Map of changed properties with old values
130+
*/
131+
132+
public firstUpdated() {
81133
this._firstUpdated = true;
82134
Providers.onProviderUpdated(() => this.loadData());
83135
this.loadData();
@@ -94,7 +146,16 @@ export class MgtAgenda extends MgtTemplatedComponent {
94146
super.disconnectedCallback();
95147
}
96148

97-
attributeChangedCallback(name, oldValue, newValue) {
149+
/**
150+
* Synchronizes property values when attributes change.
151+
*
152+
* @param {*} name
153+
* @param {*} oldValue
154+
* @param {*} newValue
155+
* @memberof MgtAgenda
156+
*/
157+
158+
public attributeChangedCallback(name, oldValue, newValue) {
98159
if (oldValue !== newValue && (name === 'date' || name === 'days' || name === 'group-id')) {
99160
this.events = null;
100161
this.loadData();

src/components/mgt-login/mgt-login.ts

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,49 @@ import { styles } from './mgt-login-css';
1616
import { MgtPersonDetails } from '../mgt-person/mgt-person';
1717
import '../mgt-person/mgt-person';
1818
import '../../styles/fabric-icon-font';
19-
19+
/**
20+
* Web component button and flyout control to facilitate Microsoft identity platform authentication
21+
*
22+
* @export
23+
* @class MgtLogin
24+
* @extends {MgtBaseComponent}
25+
*/
2026
@customElement('mgt-login')
2127
export class MgtLogin extends MgtBaseComponent {
28+
/**
29+
* Array of styles to apply to the element. The styles should be defined
30+
* using the `css` tag function.
31+
*/
32+
static get styles() {
33+
return styles;
34+
}
35+
2236
private _loginButtonRect: ClientRect;
2337
private _popupRect: ClientRect;
2438
private _openLeft: boolean = false;
2539

40+
/**
41+
* determines if login menu popup should be showing
42+
* @type {boolean}
43+
*/
2644
@property({ attribute: false }) private _showMenu: boolean = false;
45+
46+
/**
47+
* determines if login component is in loading state
48+
* @type {boolean}
49+
*/
2750
@property({ attribute: false }) private _loading: boolean = true;
2851

52+
/**
53+
* allows developer to use specific user details for login
54+
* @type {MgtPersonDetails}
55+
*/
2956
@property({
3057
attribute: 'user-details',
3158
type: Object
3259
})
3360
userDetails: MgtPersonDetails;
3461

35-
static get styles() {
36-
return styles;
37-
}
38-
3962
constructor() {
4063
super();
4164
Providers.onProviderUpdated(() => this.loadState());
@@ -82,6 +105,16 @@ export class MgtLogin extends MgtBaseComponent {
82105
}
83106
}
84107

108+
/**
109+
* Invoked when the element is first updated. Implement to perform one time
110+
* work on the element after update.
111+
*
112+
* Setting properties inside this method will trigger the element to update
113+
* again after this update cycle completes.
114+
*
115+
* * @param _changedProperties Map of changed properties with old values
116+
*/
117+
85118
firstUpdated() {
86119
window.addEventListener('click', (event: MouseEvent) => {
87120
// get popup bounds
@@ -183,6 +216,11 @@ export class MgtLogin extends MgtBaseComponent {
183216
this._showMenu = false;
184217
}
185218

219+
/**
220+
* Invoked on each update to perform rendering tasks. This method must return
221+
* a lit-html TemplateResult. Setting properties inside this method will *not*
222+
* trigger the element to update.
223+
*/
186224
render() {
187225
const content = this.userDetails ? this.renderLoggedIn() : this.renderLogIn();
188226

0 commit comments

Comments
 (0)