From f127e0bd9e8f1bdf7b7823c12f72faac5d2ad870 Mon Sep 17 00:00:00 2001 From: Nelis Bijl Date: Thu, 16 Feb 2017 15:27:27 +0100 Subject: [PATCH] configuration 'modules' added to BusyConfig it corresponds to DynamicComponent's componentModules attribute it is needed when a specified custom template contains Component(s) from other modules PS: not sure whether the build script is supposed to generate the complete build folder. Didn't work for me. Added typescript compile scripts and separate tsconfig.json for src and demo. They are separated because demo uses the *.d.ts files in build\src as input. tsc won't overwrite those d.ts files when src and demo are build together. --- .gitignore | 3 +++ build/src/busy-config.d.ts | 4 ++++ build/src/busy-config.js | 1 + build/src/busy-config.js.map | 2 +- build/src/busy.component.d.ts | 1 + build/src/busy.component.js | 2 +- build/src/busy.component.js.map | 2 +- build/src/busy.directive.d.ts | 2 +- build/src/busy.directive.js | 1 + build/src/busy.directive.js.map | 2 +- build/src/promise-tracker.service.d.ts | 1 + demo/tsconfig.json | 29 ++++++++++++++++++++++++++ package.json | 8 ++++++- src/busy-config.ts | 3 +++ src/busy.component.ts | 3 ++- src/busy.directive.ts | 1 + src/tsconfig.json | 29 ++++++++++++++++++++++++++ 17 files changed, 87 insertions(+), 7 deletions(-) create mode 100644 demo/tsconfig.json create mode 100644 src/tsconfig.json diff --git a/.gitignore b/.gitignore index 334c97f..18d43ff 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,6 @@ Thumbs.db # Style scripts build/busy.js + +#Webstorm IDE settings +/.idea \ No newline at end of file diff --git a/build/src/busy-config.d.ts b/build/src/busy-config.d.ts index 61c1e10..85d7f33 100644 --- a/build/src/busy-config.d.ts +++ b/build/src/busy-config.d.ts @@ -1,6 +1,8 @@ +/// import { Subscription } from 'rxjs/Subscription'; export declare class BusyConfig implements IBusyConfig { template: string; + modules: any[]; delay: number; minDuration: number; backdrop: boolean; @@ -10,6 +12,7 @@ export declare class BusyConfig implements IBusyConfig { } export interface IBusyConfig { template?: string; + modules?: any[]; delay?: number; minDuration?: number; backdrop?: boolean; @@ -19,6 +22,7 @@ export interface IBusyConfig { } export declare const BUSY_CONFIG_DEFAULTS: { template: string; + modules: any[]; delay: number; minDuration: number; backdrop: boolean; diff --git a/build/src/busy-config.js b/build/src/busy-config.js index 4e653f5..c2f1b76 100644 --- a/build/src/busy-config.js +++ b/build/src/busy-config.js @@ -11,6 +11,7 @@ var BusyConfig = (function () { exports.BusyConfig = BusyConfig; exports.BUSY_CONFIG_DEFAULTS = { template: "\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
{{message}}
\n
\n
\n ", + modules: [], delay: 0, minDuration: 0, backdrop: true, diff --git a/build/src/busy-config.js.map b/build/src/busy-config.js.map index 9d88245..634290e 100644 --- a/build/src/busy-config.js.map +++ b/build/src/busy-config.js.map @@ -1 +1 @@ -{"version":3,"file":"busy-config.js","sourceRoot":"","sources":["../../src/busy-config.ts"],"names":[],"mappings":";AAOA;IAQI,oBAAY,MAAwB;QAAxB,sBAAwB,GAAxB,WAAwB;QAChC,GAAG,CAAC,CAAC,IAAI,MAAM,IAAI,4BAAoB,CAAC,CAAC,CAAC;YACtC,IAAI,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,4BAAoB,CAAC,MAAM,CAAC,CAAC;QAC1F,CAAC;IACL,CAAC;IACL,iBAAC;AAAD,CAAC,AAbD,IAaC;AAbY,kBAAU,aAatB,CAAA;AAYY,4BAAoB,GAAG;IAChC,QAAQ,EAAE,02BAoBT;IACD,KAAK,EAAE,CAAC;IACR,WAAW,EAAE,CAAC;IACd,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,gBAAgB;IACzB,YAAY,EAAE,SAAS;CAC1B,CAAC"} \ No newline at end of file +{"version":3,"file":"busy-config.js","sourceRoot":"","sources":["../../src/busy-config.ts"],"names":[],"mappings":";AAOA;IASI,oBAAY,MAAwB;QAAxB,sBAAwB,GAAxB,WAAwB;QAChC,GAAG,CAAC,CAAC,IAAI,MAAM,IAAI,4BAAoB,CAAC,CAAC,CAAC;YACtC,IAAI,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,4BAAoB,CAAC,MAAM,CAAC,CAAC;QAC1F,CAAC;IACL,CAAC;IACL,iBAAC;AAAD,CAAC,AAdD,IAcC;AAdY,kBAAU,aActB,CAAA;AAaY,4BAAoB,GAAG;IAChC,QAAQ,EAAE,02BAoBT;IACD,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,CAAC;IACR,WAAW,EAAE,CAAC;IACd,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,gBAAgB;IACzB,YAAY,EAAE,SAAS;CAC1B,CAAC"} \ No newline at end of file diff --git a/build/src/busy.component.d.ts b/build/src/busy.component.d.ts index c57e49a..a8b6f75 100644 --- a/build/src/busy.component.d.ts +++ b/build/src/busy.component.d.ts @@ -8,6 +8,7 @@ export declare class BusyComponent { wrapperClass: string; template: string; context: IBusyContext; + modules: any[]; constructor(tracker: PromiseTrackerService); isActive(): boolean; } diff --git a/build/src/busy.component.js b/build/src/busy.component.js index 9d63946..bf14bff 100644 --- a/build/src/busy.component.js +++ b/build/src/busy.component.js @@ -29,7 +29,7 @@ var BusyComponent = (function () { BusyComponent = __decorate([ core_1.Component({ selector: 'ng-busy', - template: "\n
\n \n \n
\n ", + template: "\n
\n \n \n
\n ", animations: [ core_1.trigger('flyInOut', [ core_1.transition('void => *', [ diff --git a/build/src/busy.component.js.map b/build/src/busy.component.js.map index ff95e8c..4ebaaa0 100644 --- a/build/src/busy.component.js.map +++ b/build/src/busy.component.js.map @@ -1 +1 @@ -{"version":3,"file":"busy.component.js","sourceRoot":"","sources":["../../src/busy.component.ts"],"names":[],"mappings":";;;;;;;;;;AAKA,qBAOO,eAAe,CAAC,CAAA;AAEvB,wCAAoC,2BAA2B,CAAC,CAAA;AAGhE,IAAM,aAAa,GAAG,YAAK,CAAC;IACxB,OAAO,EAAE,CAAC;IACV,SAAS,EAAE,mBAAmB;CACjC,CAAC,CAAC;AACH,IAAM,MAAM,GAAG,UAAU,CAAC;AAIzB,CAAC;AAsBF;IAQI,uBAAoB,OAA8B;QAA9B,YAAO,GAAP,OAAO,CAAuB;QAJlD,YAAO,GAAiB;YACpB,OAAO,EAAE,IAAI;SAChB,CAAC;IAGF,CAAC;IAED,gCAAQ,GAAR;QACI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;IACnC,CAAC;IAjCL;QAAC,gBAAS,CAAC;YACP,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE,kOAKT;YACD,UAAU,EAAE;gBACR,cAAO,CAAC,UAAU,EAAE;oBAChB,iBAAU,CAAC,WAAW,EAAE;wBACpB,aAAa;wBACb,cAAO,CAAC,MAAM,CAAC;qBAClB,CAAC;oBACF,iBAAU,CAAC,WAAW,EAAE;wBACpB,cAAO,CAAC,MAAM,EAAE,aAAa,CAAC;qBACjC,CAAC;iBACL,CAAC;aACL;SACJ,CAAC;;qBAAA;IAeF,oBAAC;AAAD,CAAC,AAdD,IAcC;AAdY,qBAAa,gBAczB,CAAA"} \ No newline at end of file +{"version":3,"file":"busy.component.js","sourceRoot":"","sources":["../../src/busy.component.ts"],"names":[],"mappings":";;;;;;;;;;AAKA,qBAOO,eAAe,CAAC,CAAA;AAEvB,wCAAoC,2BAA2B,CAAC,CAAA;AAGhE,IAAM,aAAa,GAAG,YAAK,CAAC;IACxB,OAAO,EAAE,CAAC;IACV,SAAS,EAAE,mBAAmB;CACjC,CAAC,CAAC;AACH,IAAM,MAAM,GAAG,UAAU,CAAC;AAIzB,CAAC;AAsBF;IASI,uBAAoB,OAA8B;QAA9B,YAAO,GAAP,OAAO,CAAuB;QALlD,YAAO,GAAiB;YACpB,OAAO,EAAE,IAAI;SAChB,CAAC;IAIF,CAAC;IAED,gCAAQ,GAAR;QACI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;IACnC,CAAC;IAlCL;QAAC,gBAAS,CAAC;YACP,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE,+PAKT;YACD,UAAU,EAAE;gBACR,cAAO,CAAC,UAAU,EAAE;oBAChB,iBAAU,CAAC,WAAW,EAAE;wBACpB,aAAa;wBACb,cAAO,CAAC,MAAM,CAAC;qBAClB,CAAC;oBACF,iBAAU,CAAC,WAAW,EAAE;wBACpB,cAAO,CAAC,MAAM,EAAE,aAAa,CAAC;qBACjC,CAAC;iBACL,CAAC;aACL;SACJ,CAAC;;qBAAA;IAgBF,oBAAC;AAAD,CAAC,AAfD,IAeC;AAfY,qBAAa,gBAezB,CAAA"} \ No newline at end of file diff --git a/build/src/busy.directive.d.ts b/build/src/busy.directive.d.ts index af47c53..ae0f9ce 100644 --- a/build/src/busy.directive.d.ts +++ b/build/src/busy.directive.d.ts @@ -16,7 +16,7 @@ export declare class BusyDirective implements DoCheck { private backdropRef; constructor(service: BusyService, tracker: PromiseTrackerService, cfResolver: ComponentFactoryResolver, vcRef: ViewContainerRef, injector: Injector); private normalizeOptions(options); - dectectOptionsChange(): boolean; + private dectectOptionsChange(); ngDoCheck(): void; ngOnDestroy(): void; private destroyComponents(); diff --git a/build/src/busy.directive.js b/build/src/busy.directive.js index a7c0618..807607b 100644 --- a/build/src/busy.directive.js +++ b/build/src/busy.directive.js @@ -88,6 +88,7 @@ var BusyDirective = (function () { instance.context.message = message; instance.wrapperClass = wrapperClass; instance.template = template; + instance.modules = this.optionsNorm.modules; }; __decorate([ core_1.Input('ngBusy'), diff --git a/build/src/busy.directive.js.map b/build/src/busy.directive.js.map index 6762ebc..25fda8e 100644 --- a/build/src/busy.directive.js.map +++ b/build/src/busy.directive.js.map @@ -1 +1 @@ -{"version":3,"file":"busy.directive.js","sourceRoot":"","sources":["../../src/busy.directive.ts"],"names":[],"mappings":";;;;;;;;;;AAKA,qBASO,eAAe,CAAC,CAAA;AACvB,6B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GD;QAAC,YAAK,CAAC,QAAQ,CAAC;;kDAAA;IALpB;QAAC,gBAAS,CAAC;YACP,QAAQ,EAAE,UAAU;YACpB,SAAS,EAAE,CAAC,+CAAqB,CAAC;SACrC,CAAC;;qBAAA;IAwGF,oBAAC;AAAD,CAAC,AAvGD,IAuGC;AAvGY,qBAAa,gBAuGzB,CAAA"} \ No newline at end of file diff --git a/build/src/promise-tracker.service.d.ts b/build/src/promise-tracker.service.d.ts index b469c9f..336c815 100644 --- a/build/src/promise-tracker.service.d.ts +++ b/build/src/promise-tracker.service.d.ts @@ -1,3 +1,4 @@ +/// import { Subscription } from 'rxjs/Subscription'; export declare class PromiseTrackerService { promiseList: Array | Subscription>; diff --git a/demo/tsconfig.json b/demo/tsconfig.json new file mode 100644 index 0000000..c0fa645 --- /dev/null +++ b/demo/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "sourceMap": true, + "declaration": true, + "outDir": "../build/demo", + "removeComments": true, + "typeRoots": [ + "../node_modules/@types" + ] + }, + "exclude": [ + ], + "filesGlob": [ + "./**/*.ts" + ], + "awesomeTypescriptLoaderOptions": { + "resolveGlobs": true, + "forkChecker": true + }, + "compileOnSave": false, + "buildOnSave": false, + "atom": { + "rewriteTsconfig": false + } +} diff --git a/package.json b/package.json index 898310d..5c4caa2 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,11 @@ "watch:busy": "npm run watch", "build:demo": "cross-env NODE_ENV=demo webpack --progress", "watch:demo": "cross-env NODE_ENV=demo webpack-dev-server --inline --progress --profile --colors --watch --display-error-details --display-cached --content-base demo/asset", - "test": "cross-env NODE_ENV=test webpack --inline --progress --colors --watch --content-base test" + "test": "cross-env NODE_ENV=test webpack --inline --progress --colors --watch --content-base test", + "tsc": "node_modules/.bin/tsc", + "pretsc.src": "node_modules/.bin/rimraf build/src/**/*.d.ts", + "tsc.src": "npm run tsc -- -p src/", + "tsc.demo": "npm run tsc -- -p demo/" }, "dependencies": { "ts-metadata-helper": "~0.0.4", @@ -44,6 +48,8 @@ "@angular/platform-browser": "~2.4.0", "@angular/platform-browser-dynamic": "~2.4.0", "@angular/router": "~3.4.0", + "@types/core-js": "^0.9.35", + "@types/node": "^7.0.5", "autoprefixer": "^6.3.7", "awesome-typescript-loader": "^0.19.1", "bootstrap": "4.0.0-alpha.2", diff --git a/src/busy-config.ts b/src/busy-config.ts index 2c3dde3..94cf4e4 100644 --- a/src/busy-config.ts +++ b/src/busy-config.ts @@ -7,6 +7,7 @@ import {Subscription} from 'rxjs/Subscription'; export class BusyConfig implements IBusyConfig { template: string; + modules: any[]; delay: number; minDuration: number; backdrop: boolean; @@ -22,6 +23,7 @@ export class BusyConfig implements IBusyConfig { export interface IBusyConfig { template?: string; + modules?: any[]; delay?: number; minDuration?: number; backdrop?: boolean; @@ -52,6 +54,7 @@ export const BUSY_CONFIG_DEFAULTS = { `, + modules: [], delay: 0, minDuration: 0, backdrop: true, diff --git a/src/busy.component.ts b/src/busy.component.ts index 82c200c..22f14dd 100644 --- a/src/busy.component.ts +++ b/src/busy.component.ts @@ -29,7 +29,7 @@ export interface IBusyContext { selector: 'ng-busy', template: `
- +
`, @@ -52,6 +52,7 @@ export class BusyComponent { context: IBusyContext = { message: null }; + modules: any[]; constructor(private tracker: PromiseTrackerService) { } diff --git a/src/busy.directive.ts b/src/busy.directive.ts index f9f5e24..97144b3 100644 --- a/src/busy.directive.ts +++ b/src/busy.directive.ts @@ -134,5 +134,6 @@ export class BusyDirective implements DoCheck { instance.context.message = message; instance.wrapperClass = wrapperClass; instance.template = template; + instance.modules = this.optionsNorm.modules; } } diff --git a/src/tsconfig.json b/src/tsconfig.json new file mode 100644 index 0000000..3c2e830 --- /dev/null +++ b/src/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "sourceMap": true, + "declaration": true, + "outDir": "../build/src", + "removeComments": true, + "typeRoots": [ + "../node_modules/@types" + ] + }, + "exclude": [ + ], + "filesGlob": [ + "./**/*.ts" + ], + "awesomeTypescriptLoaderOptions": { + "resolveGlobs": true, + "forkChecker": true + }, + "compileOnSave": false, + "buildOnSave": false, + "atom": { + "rewriteTsconfig": false + } +}