Skip to content

Commit 0069c83

Browse files
ThomasPemusale
andauthored
feat: expose updated event on mgt components (#3357)
* feat: expose updated event makes updated event of MgtBaseTaskComponent accessible on Person control * add updated event to baseTaskComponent * method order * Update agenda.html.stories.js * stories * login story * people * peoplePicker * personCard * picker * planner * search * taxonomy * teamsChannel * themeToggle * todo --------- Co-authored-by: Musale Martin <[email protected]>
1 parent d302305 commit 0069c83

File tree

70 files changed

+727
-64
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+727
-64
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { registerComponent } from '@microsoft/mgt-element';
2727
* @class MgtAgenda
2828
* @extends {MgtTemplatedComponent}
2929
*
30+
* @fires {CustomEvent<undefined>} updated - Fired when the component is updated
3031
* @fires {CustomEvent<MicrosoftGraph.Event>} eventClick - Fired when user click an event
3132
*
3233
* @cssprop --event-box-shadow - {String} Event box shadow color and size

packages/mgt-components/src/components/mgt-file-list/mgt-file-list.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ const isSharedInsight = (sharedInsightFile: SharedInsight): sharedInsightFile is
7171
* @export
7272
* @class MgtFileList
7373
*
74+
* @fires {CustomEvent<undefined>} updated - Fired when the component is updated
7475
* @fires {CustomEvent<MicrosoftGraph.DriveItem>} itemClick - Fired when a user clicks on a file.
7576
* it returns the file (DriveItem) details.
7677
*

packages/mgt-components/src/components/mgt-file/mgt-file.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ export const registerMgtFileComponent = () => registerComponent('file', MgtFile)
4242
* @class MgtFile
4343
* @extends {MgtTemplatedComponent}
4444
*
45+
* @fires {CustomEvent<undefined>} updated - Fired when the component is updated
46+
*
4547
* @cssprop --file-type-icon-height - {Length} file type icon height. Default value is 28px.
4648
* @cssprop --file-border - {String} file item border style. Default value is "1px solid transparent".
4749
* @cssprop --file-border-radius - {String} the border radius of the file component. Default value is 4px.

packages/mgt-components/src/components/mgt-get/mgt-get.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export const registerMgtGetComponent = () => registerComponent('get', MgtGet);
8383
/**
8484
* Custom element for making Microsoft Graph get queries
8585
*
86+
* @fires {CustomEvent<undefined>} updated - Fired when the component is updated
8687
* @fires {CustomEvent<DataChangedDetail>} dataChange - Fired when data changes bubbles, composed, and is not cancelable.
8788
*
8889
* @export

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export const registerMgtLoginComponent = () => {
5454
* @class MgtLogin
5555
* @extends {MgtTemplatedTaskComponent}
5656
*
57+
* @fires {CustomEvent<undefined>} updated - Fired when the component is updated
5758
* @fires {CustomEvent<undefined>} loginInitiated - Fired when login is initiated by the user
5859
* @fires {CustomEvent<undefined>} loginCompleted - Fired when login completes
5960
* @fires {CustomEvent<undefined>} loginFailed - Fired when login fails

packages/mgt-components/src/components/mgt-people-picker/mgt-people-picker.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export const registerMgtPeoplePickerComponent = () => {
7777
* @class MgtPicker
7878
* @extends {MgtTemplatedTaskComponent}
7979
*
80+
* @fires {CustomEvent<undefined>} updated - Fired when the component is updated
8081
* @fires {CustomEvent<IDynamicPerson[]>} selectionChanged - Fired when set of selected people changes
8182
*
8283
* @cssprop --people-picker-selected-option-background-color - {Color} the background color of the selected person.

packages/mgt-components/src/components/mgt-people/mgt-people.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ import { MgtPerson, registerMgtPersonComponent } from '../mgt-person/mgt-person'
3333
* @class MgtPeople
3434
* @extends {MgtTemplatedTaskComponent}
3535
*
36+
* @fires {CustomEvent<undefined>} updated - Fired when the component is updated
37+
*
3638
* @cssprop --people-list-margin- {String} the margin around the list of people. Default is 8px 4px 8px 8px.
3739
* @cssprop --people-avatar-gap - {String} the gap between the people in the list. Default is 4px.
3840
* @cssprop --people-overflow-font-color - {Color} the color of the overflow text.

packages/mgt-components/src/components/mgt-person-card/mgt-person-card.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export const registerMgtPersonCardComponent = () => {
8686
* @class MgtPersonCard
8787
* @extends {MgtTemplatedComponent}
8888
*
89+
* @fires {CustomEvent<undefined>} updated - Fired when the component is updated
8990
* @fires {CustomEvent<null>} expanded - Fired when expanded details section is opened
9091
*
9192
* @cssprop --person-card-line1-font-size - {Length} Font size of line 1

packages/mgt-components/src/components/mgt-person/mgt-person.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export const registerMgtPersonComponent = () => {
7575
* @class MgtPerson
7676
* @extends {MgtTemplatedComponent}
7777
*
78+
* @fires {CustomEvent<undefined>} updated - Fired when the component is updated
7879
* @fires {CustomEvent<IDynamicPerson>} line1clicked - Fired when line1 is clicked
7980
* @fires {CustomEvent<IDynamicPerson>} line2clicked - Fired when line2 is clicked
8081
* @fires {CustomEvent<IDynamicPerson>} line3clicked - Fired when line3 is clicked
@@ -952,7 +953,7 @@ export class MgtPerson extends MgtTemplatedTaskComponent {
952953
}
953954

954955
// if we have more than one line we add the second line
955-
if (this.view !== 'oneline') {
956+
if (!this.isOneLine()) {
956957
const text = this.getTextFromProperty(person, this.line2Property);
957958
if (this.hasTemplate('line2')) {
958959
// Render the line2 template
@@ -973,7 +974,7 @@ export class MgtPerson extends MgtTemplatedTaskComponent {
973974
}
974975

975976
// if we have a third or fourth line we add the third line
976-
if (this.view === 'threelines' || this.view === 'fourlines') {
977+
if (this.isThreeLines() || this.isFourLines()) {
977978
const text = this.getTextFromProperty(person, this.line3Property);
978979
if (this.hasTemplate('line3')) {
979980
// Render the line3 template
@@ -994,7 +995,7 @@ export class MgtPerson extends MgtTemplatedTaskComponent {
994995
}
995996

996997
// add the fourth line if necessary
997-
if (this.view === 'fourlines') {
998+
if (this.isFourLines()) {
998999
const text = this.getTextFromProperty(person, this.line4Property);
9991000
if (this.hasTemplate('line4')) {
10001001
// Render the line4 template

packages/mgt-components/src/components/mgt-picker/mgt-picker.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ export const registerMgtPickerComponent = () => {
3434
* @class MgtPicker
3535
* @extends {MgtTemplatedTaskComponent}
3636
*
37+
* @fires {CustomEvent<undefined>} updated - Fired when the component is updated
38+
*
3739
* @cssprop --picker-background-color - {Color} Picker component background color
3840
* @cssprop --picker-list-max-height - {String} max height for options list. Default value is 380px.
3941
*/

0 commit comments

Comments
 (0)