Skip to content

Commit 055bd4e

Browse files
updated to lit-element 2.3.1 and fixed minor bugs found during validation (#341)
Co-authored-by: Shane Weaver <[email protected]>
1 parent a0e5f36 commit 055bd4e

File tree

4 files changed

+37
-29
lines changed

4 files changed

+37
-29
lines changed

package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -61,33 +61,33 @@
6161
"@microsoft/microsoft-graph-client": "^2.0.0",
6262
"@microsoft/microsoft-graph-types": "^1.12.0",
6363
"@microsoft/microsoft-graph-types-beta": "github:microsoftgraph/msgraph-typescript-typings#beta",
64-
"lit-element": "^2.2.1",
64+
"lit-element": "^2.3.1",
6565
"msal": "1.1.3",
6666
"office-ui-fabric-core": "11.0.0"
6767
},
6868
"devDependencies": {
69-
"@babel/core": "^7.8.3",
69+
"@babel/core": "^7.9.0",
7070
"@babel/plugin-proposal-class-properties": "^7.8.3",
7171
"@babel/plugin-proposal-decorators": "^7.8.3",
72-
"@babel/plugin-proposal-object-rest-spread": "^7.8.3",
73-
"@babel/preset-env": "^7.8.3",
74-
"@babel/preset-react": "^7.7.4",
75-
"@babel/preset-typescript": "^7.8.3",
76-
"@storybook/addon-a11y": "^5.3.8",
77-
"@storybook/addon-actions": "^5.3.8",
78-
"@storybook/addon-docs": "^5.3.8",
79-
"@storybook/addon-knobs": "^5.3.8",
80-
"@storybook/addon-links": "^5.3.8",
81-
"@storybook/addon-storysource": "^5.3.8",
72+
"@babel/plugin-proposal-object-rest-spread": "^7.9.0",
73+
"@babel/preset-env": "^7.9.0",
74+
"@babel/preset-react": "^7.9.4",
75+
"@babel/preset-typescript": "^7.9.0",
76+
"@storybook/addon-a11y": "^5.3.17",
77+
"@storybook/addon-actions": "^5.3.17",
78+
"@storybook/addon-docs": "^5.3.17",
79+
"@storybook/addon-knobs": "^5.3.17",
80+
"@storybook/addon-links": "^5.3.17",
81+
"@storybook/addon-storysource": "^5.3.17",
8282
"@storybook/storybook-deployer": "^2.8.1",
83-
"@storybook/web-components": "^5.3.8",
83+
"@storybook/web-components": "^5.3.17",
8484
"@types/jest": "^24.9.1",
8585
"@types/node": "12.12.22",
86-
"@webcomponents/webcomponentsjs": "^2.4.1",
87-
"babel-loader": "^8.0.6",
86+
"@webcomponents/webcomponentsjs": "^2.4.3",
87+
"babel-loader": "^8.1.0",
8888
"core-js": "^3.6.4",
8989
"cpx": "^1.5.0",
90-
"es-dev-server": "^1.36.2",
90+
"es-dev-server": "^1.45.3",
9191
"gulp": "^4.0.2",
9292
"gulp-append-prepend": "^1.0.8",
9393
"gulp-header-license": "^1.0.9",
@@ -101,17 +101,17 @@
101101
"monaco-editor-webpack-plugin": "^1.8.2",
102102
"npm-run-all": "^4.1.5",
103103
"prettier": "1.17.0",
104-
"regenerator-runtime": "^0.13.3",
104+
"regenerator-runtime": "^0.13.5",
105105
"rollup": "^1.29.1",
106106
"rollup-plugin-babel": "^4.3.3",
107107
"rollup-plugin-babel-minify": "^9.1.1",
108108
"rollup-plugin-commonjs": "^10.1.0",
109109
"rollup-plugin-json": "^4.0.0",
110110
"rollup-plugin-node-resolve": "^5.2.0",
111-
"rollup-plugin-postcss": "^2.0.4",
111+
"rollup-plugin-postcss": "^2.5.0",
112112
"rollup-plugin-terser": "^5.2.0",
113113
"rollup-plugin-typescript": "^1.0.1",
114-
"sass": "^1.25.0",
114+
"sass": "^1.26.3",
115115
"shx": "^0.3.2",
116116
"storybook-addon-web-components-knobs": "^0.2.7",
117117
"ts-jest": "^24.3.0",

src/components/baseComponent.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ export abstract class MgtBaseComponent extends LitElement {
105105
* determines if login component is in loading state
106106
* @type {boolean}
107107
*/
108-
@property({ attribute: false })
109108
private _isLoadingState: boolean = false;
110109

111110
private _isFirstUpdated = false;
@@ -213,22 +212,22 @@ export abstract class MgtBaseComponent extends LitElement {
213212
}
214213

215214
// Wait for the current load promise to complete (unless forced).
216-
if (this._isLoadingState && !force) {
215+
if (this.isLoadingState && !force) {
217216
await this._currentLoadStatePromise;
218217
}
219218

220219
const loadStatePromise = new Promise(async (resolve, reject) => {
221220
try {
222-
this._isLoadingState = true;
221+
this.setLoadingState(true);
223222
this.fireCustomEvent('loadingInitiated');
224223

225224
await this.loadState();
226225

227-
this._isLoadingState = false;
226+
this.setLoadingState(false);
228227
this.fireCustomEvent('loadingCompleted');
229228
resolve();
230229
} catch (e) {
231-
this._isLoadingState = false;
230+
this.setLoadingState(false);
232231
this.fireCustomEvent('loadingFailed');
233232
reject(e);
234233
}
@@ -237,8 +236,17 @@ export abstract class MgtBaseComponent extends LitElement {
237236
// Return the load state promise.
238237
// If loading + forced, chain the promises.
239238
return (this._currentLoadStatePromise =
240-
this._isLoadingState && !!this._currentLoadStatePromise && force
239+
this.isLoadingState && !!this._currentLoadStatePromise && force
241240
? this._currentLoadStatePromise.then(() => loadStatePromise)
242241
: loadStatePromise);
243242
}
243+
244+
private setLoadingState(value: boolean) {
245+
if (this._isLoadingState === value) {
246+
return;
247+
}
248+
249+
this._isLoadingState = value;
250+
this.requestUpdate('isLoadingState');
251+
}
244252
}

src/components/mgt-people-picker/mgt-people-picker.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ $people-list-background-color: var(--people-list-background-color, white);
2121

2222
:host {
2323
border-radius: 2px;
24+
font-family: var(--default-font-family);
25+
font-style: normal;
26+
font-weight: normal;
2427
}
2528
:host .root,
2629
mgt-people-picker .root {
@@ -46,9 +49,6 @@ mgt-people-picker .flyout-root {
4649
overflow-y: auto;
4750
text-align: left;
4851
list-style-type: none;
49-
font-family: var(--default-font-family, 'Segoe UI');
50-
font-style: normal;
51-
font-weight: normal;
5252

5353
li {
5454
cursor: pointer;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ export class MgtPeople extends MgtTemplatedComponent {
257257
}
258258

259259
const newIdsSet = new Set(newIds);
260-
this.people = this.people.filter(p => newIdsSet.has(p.id));
260+
this.people = this.people ? this.people.filter(p => newIdsSet.has(p.id)) : [];
261261
const oldIdsSet = new Set(this.people ? this.people.map(p => p.id) : []);
262262

263263
const newToLoad = [];

0 commit comments

Comments
 (0)