Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Commit

Permalink
chore(package): Publish Angular MDC v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
trimox committed Jun 23, 2019
1 parent 715b84f commit cf63aa8
Show file tree
Hide file tree
Showing 15 changed files with 196 additions and 212 deletions.
2 changes: 1 addition & 1 deletion demos/src/browserslist
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
last 2 versions
Firefox ESR
not dead
not IE 9-11
IE 9-11
57 changes: 20 additions & 37 deletions demos/src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,57 +18,40 @@
* BROWSER POLYFILLS
*/

/** IE9, IE10 and IE11 requires all of the following polyfills. **/
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';

/**
* If the application will be indexed by Google Search, the following is required.
* Googlebot uses a renderer based on Chrome 41.
* https://developers.google.com/search/docs/guides/rendering
**/
// import 'core-js/es6/array';

/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.

/** IE10 and IE11 requires the following for the Reflect API. */
// import 'core-js/es6/reflect';

/**
* Web Animations `@angular/platform-browser/animations`
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
**/
*/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.

/**
* By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
* because those flags need to be set before `zone.js` being loaded, and webpack
* will put import in the top of bundle, so user need to create a separate file
* in this directory (for example: zone-flags.ts), and put the following flags
* into that file, and then add the following code before importing zone.js.
* import './zone-flags.ts';
*
* The flags allowed in zone-flags.ts are listed here.
*
* The following flags will work for all browsers.
*
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
*
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
* with the following flag, it will bypass `zone.js` patch for IE/Edge
*
* (window as any).__Zone_enable_cross_context_check = true;
*
*/

// (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
// (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
// (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames

/*
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
* with the following flag, it will bypass `zone.js` patch for IE/Edge
*/
// (window as any).__Zone_enable_cross_context_check = true;

/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
Expand Down
4 changes: 2 additions & 2 deletions demos/tsconfig.aot.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "es2015",
"module": "esnext",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es5",
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
Expand Down
4 changes: 2 additions & 2 deletions demos/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "es2015",
"module": "esnext",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es5",
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
Expand Down
46 changes: 22 additions & 24 deletions demos/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -591,11 +591,6 @@ are-we-there-yet@~1.1.2:
delegates "^1.0.0"
readable-stream "^2.0.6"

arg@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.0.tgz#583c518199419e0037abb74062c37f8519e575f0"
integrity sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==

argparse@^1.0.7:
version "1.0.10"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
Expand Down Expand Up @@ -645,6 +640,11 @@ array-unique@^0.3.2:
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=

arrify@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d"
integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=

asap@^2.0.0, asap@~2.0.3:
version "2.0.6"
resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
Expand Down Expand Up @@ -1001,7 +1001,7 @@ browserslist@^4.5.4:
electron-to-chromium "^1.3.164"
node-releases "^1.1.23"

buffer-from@^1.0.0:
buffer-from@^1.0.0, buffer-from@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
Expand Down Expand Up @@ -1688,16 +1688,11 @@ dezalgo@^1.0.0:
asap "^2.0.0"
wrappy "1"

diff@^3.2.0:
diff@^3.1.0, diff@^3.2.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12"
integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==

diff@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.1.tgz#0c667cb467ebbb5cea7f14f135cc2dba7780a8ff"
integrity sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==

diffie-hellman@^5.0.0:
version "5.0.3"
resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875"
Expand Down Expand Up @@ -4533,7 +4528,7 @@ run-queue@^1.0.0, run-queue@^1.0.3:
dependencies:
aproba "^1.1.1"

[email protected], rxjs@~6.4.0:
[email protected]:
version "6.4.0"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.4.0.tgz#f3bb0fe7bda7fb69deac0c16f17b50b0b8790504"
integrity sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw==
Expand Down Expand Up @@ -5364,16 +5359,19 @@ trim-right@^1.0.1:
resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"
integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=

ts-node@~8.1.0:
version "8.1.1"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.1.1.tgz#2b9621934a0471f0e13c1b75be54ee0f46c31479"
integrity sha512-nd+mdxDP2BjQlyumBCMSU3IQLEjSla1X3uSzDfQ4M5OEZ3iDC01gjhs0FX29jyolATwLKB7YoRJ1Asbxd9EEoA==
ts-node@7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-7.0.0.tgz#a94a13c75e5e1aa6b82814b84c68deb339ba7bff"
integrity sha512-klJsfswHP0FuOLsvBZ/zzCfUvakOSSxds78mVeK7I+qP76YWtxf16hEZsp3U+b0kIo82R5UatGFeblYMqabb2Q==
dependencies:
arg "^4.1.0"
diff "^4.0.1"
arrify "^1.0.0"
buffer-from "^1.1.0"
diff "^3.1.0"
make-error "^1.1.1"
minimist "^1.2.0"
mkdirp "^0.5.1"
source-map-support "^0.5.6"
yn "^3.0.0"
yn "^2.0.0"

tslib@^1.10.0, tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0:
version "1.10.0"
Expand Down Expand Up @@ -5869,10 +5867,10 @@ [email protected]:
y18n "^4.0.0"
yargs-parser "^13.0.0"

yn@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.0.tgz#fcbe2db63610361afcc5eb9e0ac91e976d046114"
integrity sha512-kKfnnYkbTfrAdd0xICNFw7Atm8nKpLcLv9AZGEt+kczL/WQVai4e2V6ZN8U/O+iI6WrNuJjNNOyu4zfhl9D3Hg==
yn@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a"
integrity sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=

zone.js@~0.9.1:
version "0.9.1"
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"url": "https://github.com/trimox/angular-mdc-web.git"
},
"license": "MIT",
"version": "1.0.5",
"version": "2.0.0",
"engines": {
"node": ">= 9.11.1"
},
Expand Down Expand Up @@ -72,21 +72,21 @@
"karma-webpack": "^4.0.2",
"magic-string": "^0.25.2",
"node-sass": "^4.12.0",
"rollup": "^1.10.0",
"rollup-plugin-alias": "^1.5.1",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^9.3.4",
"rollup-plugin-node-resolve": "^4.2.3",
"rollup": "^1.16.2",
"rollup-plugin-alias": "^1.5.2",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-commonjs": "^10.0.0",
"rollup-plugin-node-resolve": "^5.0.4",
"run-sequence": "^2.2.1",
"sorcery": "^0.10.0",
"stylelint": "^9.10.1",
"stylelint-config-standard": "^18.0.0",
"stylelint-order": "^2.0.0",
"stylelint-scss": "^3.5.3",
"stylelint-selector-bem-pattern": "^2.1.0",
"terser": "^3.17.0",
"terser": "^4.0.0",
"ts-loader": "^6.0.4",
"ts-node": "^8.0.3",
"ts-node": "^8.3.0",
"tsconfig-paths": "^3.8.0",
"tsconfig-paths-webpack-plugin": "^3.2.0",
"tslint": "^5.18.0",
Expand Down
6 changes: 2 additions & 4 deletions packages/common/platform.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import {Inject, Injectable, PLATFORM_ID} from '@angular/core';
import {isPlatformBrowser} from '@angular/common';

@Injectable({
providedIn: 'root'
})
@Injectable({providedIn: 'root'})
export class Platform {
isBrowser: boolean = this._platformId ?
isPlatformBrowser(this._platformId) : typeof document === 'object' && !!document;

constructor(@Inject(PLATFORM_ID) private _platformId?: Object) { }
constructor(@Inject(PLATFORM_ID) private _platformId?: Object) {}
}
2 changes: 1 addition & 1 deletion packages/common/unique-selection-dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type UniqueSelectionDispatcherListener = (id: string, name: string) => vo
* This service does not *store* any IDs and names because they may change at any time, so it is
* less error-prone if they are simply passed through when the events occur.
*/
@Injectable({ providedIn: 'root' })
@Injectable({providedIn: 'root'})
export class UniqueSelectionDispatcher implements OnDestroy {
private _listeners: UniqueSelectionDispatcherListener[] = [];

Expand Down
4 changes: 2 additions & 2 deletions packages/icon/icon-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class SvgIconConfig {
* - Registers aliases for CSS classes, for use with icon fonts.
* - Loads icons from URLs and extracts individual icons from icon sets.
*/
@Injectable({ providedIn: 'root' })
@Injectable({providedIn: 'root'})
export class MdcIconRegistry implements OnDestroy {
private _document: Document;

Expand Down Expand Up @@ -559,7 +559,7 @@ export class MdcIconRegistry implements OnDestroy {

// TODO(jelbourn): for some reason, the `finalize` operator "loses" the generic type on the
// Observable. Figure out why and fix it.
const req = this._httpClient.get(url, { responseType: 'text' }).pipe(
const req = this._httpClient.get(url, {responseType: 'text'}).pipe(
finalize(() => this._inProgressUrlFetches.delete(url)),
share(),
);
Expand Down
2 changes: 1 addition & 1 deletion packages/material-components-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "git",
"url": "https://github.com/trimox/angular-mdc-web.git"
},
"version": "1.0.5",
"version": "2.0.0",
"license": "MIT",
"keywords": [
"angular-mdc",
Expand Down
6 changes: 3 additions & 3 deletions packages/overlay/overlay-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import {
} from '@angular/core';

/** Container inside which all overlays will render. */
@Injectable({ providedIn: 'root' })
@Injectable({providedIn: 'root'})
export class OverlayContainer implements OnDestroy {
protected _containerElement: HTMLElement | null = null;

constructor(@Inject(DOCUMENT) protected _document: any) { }
constructor(@Inject(DOCUMENT) protected _document: any) {}

ngOnDestroy() {
if (this._containerElement && this._containerElement.parentNode) {
Expand All @@ -33,7 +33,7 @@ export class OverlayContainer implements OnDestroy {
* @returns the container element
*/
getContainerElement(): HTMLElement {
if (!this._containerElement) { this._createContainer(); }
if (!this._containerElement) {this._createContainer();}
return this._containerElement!;
}

Expand Down
5 changes: 3 additions & 2 deletions packages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
"typings": "./web.d.ts",
"private": false,
"dependencies": {
"@angular-mdc/theme": "1.0.5",
"@angular-mdc/theme": "2.0.0",
"material-components-web": "^2.3.1"
},
"peerDependencies": {
"@angular/core": "0.0.0-NG",
"@angular/common": "0.0.0-NG"
"@angular/common": "0.0.0-NG",
"@angular/forms": "0.0.0-NG"
},
"sideEffects": false
}
10 changes: 5 additions & 5 deletions packages/snackbar/snackbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function MDC_SNACKBAR_DEFAULT_OPTIONS_FACTORY(): MdcSnackbarConfig {
return new MdcSnackbarConfig();
}

@Injectable({ providedIn: MdcSnackbarModule })
@Injectable({providedIn: MdcSnackbarModule})
export class MdcSnackbar implements OnDestroy {
/**
* Reference to the current snackbar in the view *at this level* (in the Angular injector tree).
Expand All @@ -58,7 +58,7 @@ export class MdcSnackbar implements OnDestroy {
private _overlay: Overlay,
private _injector: Injector,
@Optional() @SkipSelf() private _parentSnackBar: MdcSnackbar,
@Inject(MDC_SNACKBAR_DEFAULT_OPTIONS) private _defaultConfig: MdcSnackbarConfig) { }
@Inject(MDC_SNACKBAR_DEFAULT_OPTIONS) private _defaultConfig: MdcSnackbarConfig) {}

/**
* Creates and dispatches a snackbar with a custom component for the content, removing any
Expand All @@ -80,11 +80,11 @@ export class MdcSnackbar implements OnDestroy {
*/
open(message: string, action: string = '', config?: MdcSnackbarConfig):
MdcSnackbarRef<MdcSnackbarComponent> {
const _config = { ...this._defaultConfig, ...config };
const _config = {...this._defaultConfig, ...config};

// Since the user doesn't have access to the component, we can
// override the data to pass in our own message and action.
_config.data = { message, action };
_config.data = {message, action};

return this.openFromComponent(MdcSnackbarComponent, _config);
}
Expand Down Expand Up @@ -132,7 +132,7 @@ export class MdcSnackbar implements OnDestroy {
private _attach<T>(content: ComponentType<T>, userConfig?: MdcSnackbarConfig):
MdcSnackbarRef<T | EmbeddedViewRef<any>> {

const config = { ...new MdcSnackbarConfig(), ...this._defaultConfig, ...userConfig };
const config = {...new MdcSnackbarConfig(), ...this._defaultConfig, ...userConfig};
const overlayRef = this._createOverlay();
const container = this._attachSnackbarContainer(overlayRef, config);
const snackbarRef = new MdcSnackbarRef<T | EmbeddedViewRef<any>>(container, overlayRef);
Expand Down
2 changes: 1 addition & 1 deletion packages/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"sourceMap": true,
"inlineSources": true,
"target": "es2015",
"lib": ["es2015", "dom"],
"lib": ["es5", "es2015", "dom"],
"skipLibCheck": true,
"types": [],
"baseUrl": ".",
Expand Down
Loading

0 comments on commit cf63aa8

Please sign in to comment.