@@ -17,51 +17,93 @@ import '../../styles/fabric-icon-font';
1717import { MgtTemplatedComponent } from '../templatedComponent' ;
1818import { prepScopes } from '../../Graph' ;
1919import { 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' )
2228export 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 ( ) ;
0 commit comments