mis-crystal-design-system 2.3.12 → 2.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/mis-crystal-design-system-input.umd.js +4 -2
- package/bundles/mis-crystal-design-system-input.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-input.umd.min.js +1 -1
- package/bundles/mis-crystal-design-system-input.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-toast.umd.js +2 -2
- package/bundles/mis-crystal-design-system-toast.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-toast.umd.min.js +1 -1
- package/esm2015/input/directives/input/input.directive.js +5 -3
- package/esm2015/toast/mis-crystal-design-system-toast.js +2 -3
- package/esm2015/toast/public_api.js +4 -3
- package/fesm2015/mis-crystal-design-system-input.js +4 -2
- package/fesm2015/mis-crystal-design-system-input.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-toast.js +1 -1
- package/fesm2015/mis-crystal-design-system-toast.js.map +1 -1
- package/package.json +1 -1
- package/toast/mis-crystal-design-system-toast.d.ts +1 -2
- package/toast/mis-crystal-design-system-toast.metadata.json +1 -1
- package/toast/public_api.d.ts +3 -2
|
@@ -18,8 +18,10 @@
|
|
|
18
18
|
var _this = this;
|
|
19
19
|
var _a, _b;
|
|
20
20
|
(_b = (_a = this.control) === null || _a === void 0 ? void 0 : _a.control) === null || _b === void 0 ? void 0 : _b.statusChanges.pipe(operators.takeUntil(this.endObs)).subscribe(function () {
|
|
21
|
-
var _a;
|
|
22
|
-
|
|
21
|
+
var _a, _b;
|
|
22
|
+
if (!((_a = _this.control.control) === null || _a === void 0 ? void 0 : _a.disabled)) {
|
|
23
|
+
_this.validityChange.next(!((_b = _this.control.control) === null || _b === void 0 ? void 0 : _b.invalid));
|
|
24
|
+
}
|
|
23
25
|
});
|
|
24
26
|
this.el.nativeElement.placeholder += ' ';
|
|
25
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mis-crystal-design-system-input.umd.js","sources":["../../../projects/mis-components/input/directives/input/input.directive.ts","../../../projects/mis-components/input/mis-input.component.ts","../../../projects/mis-components/input/mis-input.module.ts","../../../projects/mis-components/input/mis-crystal-design-system-input.ts"],"sourcesContent":["import {\n Directive,\n ElementRef,\n OnDestroy,\n OnInit,\n Optional,\n Self,\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { ReplaySubject, Subject, Subscription } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\n@Directive({\n // tslint:disable-next-line\n selector: 'input[misInput]',\n})\nexport class MisInputDirective implements OnInit, OnDestroy {\n constructor(\n public el: ElementRef,\n @Self() @Optional() private control: NgControl\n ) {}\n private validityChange: ReplaySubject<boolean> = new ReplaySubject(1);\n validity = this.validityChange.asObservable();\n endObs: Subject<void> = new Subject();\n focus = false;\n hasValue = false;\n\n ngOnInit(): void {\n this.control?.control?.statusChanges\n .pipe(takeUntil(this.endObs))\n .subscribe(() => {\n this.validityChange.next(this.control.control?.
|
|
1
|
+
{"version":3,"file":"mis-crystal-design-system-input.umd.js","sources":["../../../projects/mis-components/input/directives/input/input.directive.ts","../../../projects/mis-components/input/mis-input.component.ts","../../../projects/mis-components/input/mis-input.module.ts","../../../projects/mis-components/input/mis-crystal-design-system-input.ts"],"sourcesContent":["import {\n Directive,\n ElementRef,\n OnDestroy,\n OnInit,\n Optional,\n Self,\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { ReplaySubject, Subject, Subscription } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\n@Directive({\n // tslint:disable-next-line\n selector: 'input[misInput]',\n})\nexport class MisInputDirective implements OnInit, OnDestroy {\n constructor(\n public el: ElementRef,\n @Self() @Optional() private control: NgControl\n ) {}\n private validityChange: ReplaySubject<boolean> = new ReplaySubject(1);\n validity = this.validityChange.asObservable();\n endObs: Subject<void> = new Subject();\n focus = false;\n hasValue = false;\n\n ngOnInit(): void {\n this.control?.control?.statusChanges\n .pipe(takeUntil(this.endObs))\n .subscribe(() => {\n if(!this.control.control?.disabled){\n this.validityChange.next(!this.control.control?.invalid);\n }\n });\n this.el.nativeElement.placeholder += ' ';\n }\n ngOnDestroy(): void {\n this.endObs.next();\n this.endObs.complete();\n }\n}\n","import {\n Component,\n ContentChild,\n Input,\n OnDestroy,\n OnInit,\n ViewEncapsulation,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { MisInputDirective } from './directives/input/input.directive';\n\n@Component({\n selector: 'mis-input',\n templateUrl: './mis-input.component.html',\n styleUrls: ['./mis-input.component.scss'],\n})\nexport class MisInputComponent implements OnInit, OnDestroy {\n @Input() type: 'rounded' | 'floating' = 'floating';\n @Input() placeholder: string; // floating placeholder text\n @Input() noHints = false;\n @Input() hasError = false; // show input in error state\n @ContentChild(MisInputDirective) set formInput(input: MisInputDirective) {\n if (!this.placeholder) {\n this.placeholder = input.el.nativeElement.placeholder;\n }\n this.inputSubscription?.unsubscribe();\n this.inputSubscription = input?.validity.subscribe(\n (res) => (this.inputValidity = res)\n );\n this.placeholder += ' ';\n }\n inputSubscription: Subscription | undefined;\n inputValidity: boolean = true;\n constructor() {}\n\n ngOnInit(): void {}\n ngOnDestroy(): void {\n this.inputSubscription?.unsubscribe();\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { MisInputDirective } from './directives/input/input.directive';\nimport { MisInputComponent } from './mis-input.component';\n\n@NgModule({\n declarations: [MisInputComponent, MisInputDirective],\n imports: [CommonModule, FormsModule],\n exports: [MisInputComponent, MisInputDirective],\n})\nexport class MisInputModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["ReplaySubject","Subject","takeUntil","Directive","ElementRef","NgControl","Self","Optional","Component","Input","ContentChild","NgModule","CommonModule","FormsModule"],"mappings":";;;;;;;QAiBE,2BACS,EAAc,EACO,OAAkB;YADvC,OAAE,GAAF,EAAE,CAAY;YAC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,EAAE,CAAC,aAAa,CAAC,WAAW,CAAC;iBACvD;gBACD,MAAA,IAAI,CAAC,iBAAiB,0CAAE,WAAW,GAAG;gBACtC,IAAI,CAAC,iBAAiB,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,CAAC,SAAS,CAChD,UAAC,GAAG,IAAK,QAAC,KAAI,CAAC,aAAa,GAAG,GAAG,IAAC,CACpC,CAAC;gBACF,IAAI,CAAC,WAAW,IAAI,GAAG,CAAC;aACzB;;;WAAA;QAKD,oCAAQ,GAAR,eAAmB;QACnB,uCAAW,GAAX;;YACE,MAAA,IAAI,CAAC,iBAAiB,0CAAE,WAAW,GAAG;SACvC;;;;gBA3BFC,cAAS,SAAC;oBACT,QAAQ,EAAE,WAAW;oBACrB,6mBAAyC;;iBAE1C;;;;uBAEEC,UAAK;8BACLA,UAAK;0BACLA,UAAK;2BACLA,UAAK;4BACLC,iBAAY,SAAC,iBAAiB;;;;QCVjC;;;;;gBALCC,aAAQ,SAAC;oBACR,YAAY,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;oBACpD,OAAO,EAAE,CAACC,mBAAY,EAAEC,iBAAW,CAAC;oBACpC,OAAO,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;iBAChD;;;ICVD;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/forms"),require("rxjs"),require("rxjs/operators"),require("@angular/common")):"function"==typeof define&&define.amd?define("mis-crystal-design-system/input",["exports","@angular/core","@angular/forms","rxjs","rxjs/operators","@angular/common"],t):t(((n="undefined"!=typeof globalThis?globalThis:n||self)["mis-crystal-design-system"]=n["mis-crystal-design-system"]||{},n["mis-crystal-design-system"].input={}),n.ng.core,n.ng.forms,n.rxjs,n.rxjs.operators,n.ng.common)}(this,(function(n,t,i,e,o,r){"use strict";var p=function(){function n(n,t){this.el=n,this.control=t,this.validityChange=new e.ReplaySubject(1),this.validity=this.validityChange.asObservable(),this.endObs=new e.Subject,this.focus=!1,this.hasValue=!1}return n.prototype.ngOnInit=function(){var n,t,i=this;null===(t=null===(n=this.control)||void 0===n?void 0:n.control)||void 0===t||t.statusChanges.pipe(o.takeUntil(this.endObs)).subscribe((function(){var n;i.validityChange.next(null===(
|
|
1
|
+
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/forms"),require("rxjs"),require("rxjs/operators"),require("@angular/common")):"function"==typeof define&&define.amd?define("mis-crystal-design-system/input",["exports","@angular/core","@angular/forms","rxjs","rxjs/operators","@angular/common"],t):t(((n="undefined"!=typeof globalThis?globalThis:n||self)["mis-crystal-design-system"]=n["mis-crystal-design-system"]||{},n["mis-crystal-design-system"].input={}),n.ng.core,n.ng.forms,n.rxjs,n.rxjs.operators,n.ng.common)}(this,(function(n,t,i,e,o,r){"use strict";var p=function(){function n(n,t){this.el=n,this.control=t,this.validityChange=new e.ReplaySubject(1),this.validity=this.validityChange.asObservable(),this.endObs=new e.Subject,this.focus=!1,this.hasValue=!1}return n.prototype.ngOnInit=function(){var n,t,i=this;null===(t=null===(n=this.control)||void 0===n?void 0:n.control)||void 0===t||t.statusChanges.pipe(o.takeUntil(this.endObs)).subscribe((function(){var n,t;(null===(n=i.control.control)||void 0===n?void 0:n.disabled)||i.validityChange.next(!(null===(t=i.control.control)||void 0===t?void 0:t.invalid))})),this.el.nativeElement.placeholder+=" "},n.prototype.ngOnDestroy=function(){this.endObs.next(),this.endObs.complete()},n}();p.decorators=[{type:t.Directive,args:[{selector:"input[misInput]"}]}],p.ctorParameters=function(){return[{type:t.ElementRef},{type:i.NgControl,decorators:[{type:t.Self},{type:t.Optional}]}]};var a=function(){function n(){this.type="floating",this.noHints=!1,this.hasError=!1,this.inputValidity=!0}return Object.defineProperty(n.prototype,"formInput",{set:function(n){var t,i=this;this.placeholder||(this.placeholder=n.el.nativeElement.placeholder),null===(t=this.inputSubscription)||void 0===t||t.unsubscribe(),this.inputSubscription=null==n?void 0:n.validity.subscribe((function(n){return i.inputValidity=n})),this.placeholder+=" "},enumerable:!1,configurable:!0}),n.prototype.ngOnInit=function(){},n.prototype.ngOnDestroy=function(){var n;null===(n=this.inputSubscription)||void 0===n||n.unsubscribe()},n}();a.decorators=[{type:t.Component,args:[{selector:"mis-input",template:'<div class="input-container" [ngClass]="{\'rounded\': type === \'rounded\', \'floating\': type === \'floating\', \'has-error\': !inputValidity || hasError, \'no-hint\': noHints}">\n <div class="input-wrapper">\n <ng-content select="[mis-input-icon]"></ng-content>\n <div class="mis-input">\n <ng-content select="input"></ng-content>\n <span class="mis-placeholder">{{placeholder}}</span>\n </div>\n <ng-content select="[mis-input-act]"></ng-content>\n </div>\n <ng-content select="[mis-input-hint]"></ng-content>\n <ng-content select="[mis-input-error]"></ng-content>\n</div>',styles:[".input-container{position:relative;padding-bottom:24px}.input-container .input-wrapper{box-sizing:border-box;display:flex;align-items:center;flex-direction:row;flex-wrap:nowrap;transition:all 60ms ease-in;background-color:#fff;padding:3px 16px}.input-container .input-wrapper>:not(:last-child){margin-right:16px}.input-container .input-wrapper .mis-input{flex:1 1 auto;z-index:0;position:relative;display:flex;align-items:center}.input-container .input-wrapper input{flex:1 1 auto;border:none;outline:none;height:100%;padding:0;font-family:Lato;font-style:normal;font-weight:400;font-size:16px;height:24px;color:#181f33;background-color:transparent;width:100%;vertical-align:middle}.input-container .input-wrapper input::-moz-placeholder{-moz-transition:all .1s ease-in;transition:all .1s ease-in;opacity:0;transform-origin:left center;color:transparent}.input-container .input-wrapper input:-ms-input-placeholder{-ms-transition:all .1s ease-in;transition:all .1s ease-in;opacity:0;transform-origin:left center;color:transparent}.input-container .input-wrapper input::placeholder{transition:all .1s ease-in;opacity:0;transform-origin:left center;color:transparent}.input-container .input-wrapper .mis-placeholder{position:absolute;font-family:Lato;font-style:normal;font-weight:400;font-size:16px;line-height:24px;color:#6a737d;z-index:-1;transition:all .15s ease-in}.input-container .input-wrapper:focus-within{background-color:#f5f5f5}.input-container .input-wrapper:focus-within{border:1px solid #0937b2}.input-container .input-wrapper [mis-input-act],.input-container .input-wrapper [mis-input-icon]{width:18px;height:18px;color:#6a737d;font-size:24px;line-height:18px}.input-container .input-wrapper [mis-input-act]{cursor:pointer}.input-container.no-hint{padding-bottom:0}.input-container.rounded .input-wrapper{border-radius:4px;border:1px solid #e0e0e0}.input-container.rounded .input-wrapper:focus-within,.input-container.rounded .input-wrapper:hover{background-color:#f5f5f5}.input-container.rounded .input-wrapper input:not(:-moz-placeholder-shown)+.mis-placeholder{color:transparent!important}.input-container.rounded .input-wrapper input:not(:-ms-input-placeholder)+.mis-placeholder{color:transparent!important}.input-container.rounded .input-wrapper input:not(:placeholder-shown)+.mis-placeholder{color:transparent!important}.input-container.rounded .input-wrapper .mis-placeholder{transition-duration:50ms}.input-container.rounded.has-error .input-wrapper{border:1px solid #b00020!important}.input-container.floating .input-wrapper{padding-top:24px;padding-bottom:7px;border-bottom:1px solid #e0e0e0}.input-container.floating .input-wrapper input:focus+.mis-placeholder{color:#0937b2!important}.input-container.floating .input-wrapper input:not(:-moz-placeholder-shown)+.mis-placeholder{transform:translateY(calc(-100% + 6px))!important;font-size:12px!important;letter-spacing:.2px!important}.input-container.floating .input-wrapper input:not(:-ms-input-placeholder)+.mis-placeholder{transform:translateY(calc(-100% + 6px))!important;font-size:12px!important;letter-spacing:.2px!important}.input-container.floating .input-wrapper input:focus+.mis-placeholder,.input-container.floating .input-wrapper input:not(:placeholder-shown)+.mis-placeholder{transform:translateY(calc(-100% + 6px))!important;font-size:12px!important;letter-spacing:.2px!important}.input-container.floating .input-wrapper:focus-within{border:none;border-bottom:1px solid #0937b2}.input-container.floating .input-wrapper:focus-within input::-moz-placeholder{color:#6a737d;opacity:1;font-size:16px}.input-container.floating .input-wrapper:focus-within input:-ms-input-placeholder{color:#6a737d;opacity:1;font-size:16px}.input-container.floating .input-wrapper:focus-within input::placeholder{color:#6a737d;opacity:1;font-size:16px}.input-container.floating.has-error .input-wrapper{border-bottom:1px solid #b00020!important}.input-container.floating.has-error .input-wrapper .mis-placeholder{color:#b00020!important}.input-container [mis-input-error],.input-container [mis-input-hint]{position:absolute;left:0;right:0;bottom:0;line-height:24px;height:24px;font-size:12px;color:#6a737d;letter-spacing:.2px}.input-container [mis-input-error]{color:#b00020}"]}]}],a.ctorParameters=function(){return[]},a.propDecorators={type:[{type:t.Input}],placeholder:[{type:t.Input}],noHints:[{type:t.Input}],hasError:[{type:t.Input}],formInput:[{type:t.ContentChild,args:[p]}]};var s=function(){};s.decorators=[{type:t.NgModule,args:[{declarations:[a,p],imports:[r.CommonModule,i.FormsModule],exports:[a,p]}]}],n.MisInputComponent=a,n.MisInputDirective=p,n.MisInputModule=s,Object.defineProperty(n,"__esModule",{value:!0})}));
|
|
2
2
|
//# sourceMappingURL=mis-crystal-design-system-input.umd.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../projects/mis-components/input/directives/input/input.directive.ts","../../../projects/mis-components/input/mis-input.component.ts","../../../projects/mis-components/input/mis-input.module.ts"],"names":["MisInputDirective","el","control","this","validityChange","ReplaySubject","validity","asObservable","endObs","Subject","focus","hasValue","prototype","ngOnInit","_this","_b","_a","statusChanges","pipe","takeUntil","subscribe","next","
|
|
1
|
+
{"version":3,"sources":["../../../projects/mis-components/input/directives/input/input.directive.ts","../../../projects/mis-components/input/mis-input.component.ts","../../../projects/mis-components/input/mis-input.module.ts"],"names":["MisInputDirective","el","control","this","validityChange","ReplaySubject","validity","asObservable","endObs","Subject","focus","hasValue","prototype","ngOnInit","_this","_b","_a","statusChanges","pipe","takeUntil","subscribe","disabled","next","invalid","nativeElement","placeholder","ngOnDestroy","complete","Directive","args","selector","ElementRef","NgControl","decorators","type","Self","Optional","MisInputComponent","noHints","hasError","inputValidity","Object","defineProperty","input","inputSubscription","unsubscribe","res","Component","template","Input","ContentChild","NgModule","declarations","imports","CommonModule","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AK,EAALA,EAAOrC,SAASc,WACvC,SAAC0B,GAAQ,OAAChC,EAAK0B,cAAgBM,KAEjC3C,KAAKsB,aAAe,qCAMtBY,EAAAzB,UAAAC,SAAA,aACAwB,EAAAzB,UAAAc,YAAA,iBACwB,QAAtBV,EAAAb,KAAKyC,yBAAiB,IAAA5B,GAAAA,EAAE6B,wCA1B3BE,EAAAA,UAASlB,KAAA,CAAC,CACTC,SAAU,YACVkB,SAAA,8zJAICC,EAAAA,2BACAA,EAAAA,uBACAA,EAAAA,wBACAA,EAAAA,yBACAC,EAAAA,aAAYrB,KAAA,CAAC7B,YCVhB,iCALCmD,EAAAA,SAAQtB,KAAA,CAAC,CACRuB,aAAc,CAACf,EAAmBrC,GAClCqD,QAAS,CAACC,EAAAA,aAAcC,EAAAA,aACxBC,QAAS,CAACnB,EAAmBrC","sourcesContent":["import {\n Directive,\n ElementRef,\n OnDestroy,\n OnInit,\n Optional,\n Self,\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { ReplaySubject, Subject, Subscription } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\n@Directive({\n // tslint:disable-next-line\n selector: 'input[misInput]',\n})\nexport class MisInputDirective implements OnInit, OnDestroy {\n constructor(\n public el: ElementRef,\n @Self() @Optional() private control: NgControl\n ) {}\n private validityChange: ReplaySubject<boolean> = new ReplaySubject(1);\n validity = this.validityChange.asObservable();\n endObs: Subject<void> = new Subject();\n focus = false;\n hasValue = false;\n\n ngOnInit(): void {\n this.control?.control?.statusChanges\n .pipe(takeUntil(this.endObs))\n .subscribe(() => {\n if(!this.control.control?.disabled){\n this.validityChange.next(!this.control.control?.invalid);\n }\n });\n this.el.nativeElement.placeholder += ' ';\n }\n ngOnDestroy(): void {\n this.endObs.next();\n this.endObs.complete();\n }\n}\n","import {\n Component,\n ContentChild,\n Input,\n OnDestroy,\n OnInit,\n ViewEncapsulation,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { MisInputDirective } from './directives/input/input.directive';\n\n@Component({\n selector: 'mis-input',\n templateUrl: './mis-input.component.html',\n styleUrls: ['./mis-input.component.scss'],\n})\nexport class MisInputComponent implements OnInit, OnDestroy {\n @Input() type: 'rounded' | 'floating' = 'floating';\n @Input() placeholder: string; // floating placeholder text\n @Input() noHints = false;\n @Input() hasError = false; // show input in error state\n @ContentChild(MisInputDirective) set formInput(input: MisInputDirective) {\n if (!this.placeholder) {\n this.placeholder = input.el.nativeElement.placeholder;\n }\n this.inputSubscription?.unsubscribe();\n this.inputSubscription = input?.validity.subscribe(\n (res) => (this.inputValidity = res)\n );\n this.placeholder += ' ';\n }\n inputSubscription: Subscription | undefined;\n inputValidity: boolean = true;\n constructor() {}\n\n ngOnInit(): void {}\n ngOnDestroy(): void {\n this.inputSubscription?.unsubscribe();\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { MisInputDirective } from './directives/input/input.directive';\nimport { MisInputComponent } from './mis-input.component';\n\n@NgModule({\n declarations: [MisInputComponent, MisInputDirective],\n imports: [CommonModule, FormsModule],\n exports: [MisInputComponent, MisInputDirective],\n})\nexport class MisInputModule {}\n"]}
|
|
@@ -196,10 +196,10 @@
|
|
|
196
196
|
* Generated bundle index. Do not edit.
|
|
197
197
|
*/
|
|
198
198
|
|
|
199
|
+
exports.ToastDataService = ToastDataService;
|
|
199
200
|
exports.ToastModule = ToastModule;
|
|
200
201
|
exports.ToastService = ToastService;
|
|
201
|
-
exports.ɵa =
|
|
202
|
-
exports.ɵb = ToastComponent;
|
|
202
|
+
exports.ɵa = ToastComponent;
|
|
203
203
|
|
|
204
204
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
205
205
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mis-crystal-design-system-toast.umd.js","sources":["../../../projects/mis-components/toast/toast.data.service.ts","../../../projects/mis-components/toast/toast.component.ts","../../../projects/mis-components/toast/toast.service.ts","../../../projects/mis-components/toast/toast.module.ts","../../../projects/mis-components/toast/mis-crystal-design-system-toast.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ToastDataService {\n private messageMap: Map<number, string> = new Map();\n get messages(): string[] {\n return Array.from(this.messageMap.values()).reverse();\n }\n\n constructor() {}\n\n updateMessage(msg: string): number {\n const id = new Date().getTime();\n this.messageMap.set(id, msg);\n return id;\n }\n\n removeMessage(id: number): void {\n this.messageMap.delete(id);\n }\n\n hasMessage(): boolean {\n return this.messageMap.size > 0;\n }\n}\n","import { animate, style, transition, trigger } from '@angular/animations';\nimport { Component } from '@angular/core';\nimport { ToastDataService } from './toast.data.service';\n\n@Component({\n selector: 'mis-teams-toast',\n templateUrl: './toast.component.html',\n styleUrls: ['./toast.component.scss'],\n animations: [\n trigger('fadeInOut', [\n transition(':enter', [\n style({ opacity: '0', transform: 'translateY(-50%)', height: '0' }),\n animate(\n '300ms ease-in',\n style({ opacity: '1', transform: 'translateY(0)', height: '*' })\n ),\n ]),\n transition(':leave', [\n animate(\n '300ms ease-in',\n style({ opacity: '0', transform: 'translateY(50%)' })\n ),\n ]),\n ]),\n ],\n})\nexport class ToastComponent {\n constructor(public data: ToastDataService) {}\n}\n","import { Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { Injectable } from '@angular/core';\nimport { ToastComponent } from './toast.component';\nimport { ToastDataService } from './toast.data.service';\n\ntype Operations =\n | 'created'\n | 'updated'\n | 'deleted'\n | 'create'\n | 'update'\n | 'delete';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ToastService {\n constructor(private overlay: Overlay, private data: ToastDataService) {\n this.userProfilePortal = new ComponentPortal(ToastComponent);\n }\n private toastWrapperRef: OverlayRef;\n private messagePromises: Promise<void>[] = [];\n private userProfilePortal: ComponentPortal<ToastComponent>;\n\n messageBuilder = {\n error: {\n simple: 'Something went wrong. Please try again later.',\n 400: 'Bad Request! We are working to fix this.',\n 401: 'UNAUTHORISED',\n 403: 'Sorry for the interruption but seems like your session has expired. Please login again and continue',\n 404: 'Unable to find resource. Please try again later',\n },\n item: (item: string) => {\n return {\n action: (act: Operations = 'updated') => {\n const success = `Successfully ${act} ${item}.`;\n const failure = `Failed to ${act} ${item}.`;\n return {\n success,\n failure,\n };\n },\n };\n },\n short: (act: Operations = 'updated') => {\n const success = `Successfully ${act}.`;\n const failure = `Failed to ${act}.`;\n return {\n success,\n failure,\n };\n },\n simple: (...args: string[]) => args.join(' '),\n simplest: 'Done!',\n };\n\n displayMsg(msg: string, timeout = 3000): void {\n const positionStrategy = this.overlay\n .position()\n .global()\n .centerHorizontally();\n\n if (window?.innerWidth < 600) {\n positionStrategy.bottom('48px');\n } else {\n positionStrategy.top('80px');\n }\n const config = new OverlayConfig({\n hasBackdrop: false,\n positionStrategy,\n });\n if (!this.toastWrapperRef?.hasAttached()) {\n this.toastWrapperRef = this.overlay.create(config);\n this.toastWrapperRef.attach(this.userProfilePortal);\n }\n const messageId = this.data.updateMessage(msg);\n this.messagePromises.push(\n new Promise((resolve, reject) => {\n setTimeout(() => {\n resolve(this.data.removeMessage(messageId));\n if (!this.data.hasMessage()) {\n this.closeToastOverlay();\n }\n // adding 300ms for entry animation\n }, timeout + 300);\n })\n );\n Promise.race(this.messagePromises).then(() => {});\n }\n\n // tslint:disable-next-line\n private closeToastOverlay(): any {\n return setTimeout(() => {\n this.messagePromises = [];\n this.toastWrapperRef?.detach();\n // adding 300ms for exit animation\n }, 300);\n }\n}\n","import { OverlayModule } from '@angular/cdk/overlay';\nimport { CommonModule } from '@angular/common';\nimport { ModuleWithProviders, NgModule } from '@angular/core';\nimport { ToastComponent } from './toast.component';\nimport { ToastDataService } from './toast.data.service';\nimport { ToastService } from './toast.service';\n\n@NgModule({\n declarations: [ToastComponent],\n imports: [CommonModule, OverlayModule],\n entryComponents: [ToastComponent]\n})\nexport class ToastModule {\n static forRoot(): ModuleWithProviders<ToastModule> {\n return {\n ngModule: ToastModule,\n providers: [ToastDataService, ToastService],\n };\n }\n\n static forChild(): ModuleWithProviders<ToastModule> {\n return {\n ngModule: ToastModule,\n providers: [ToastDataService, ToastService],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {ToastComponent as
|
|
1
|
+
{"version":3,"file":"mis-crystal-design-system-toast.umd.js","sources":["../../../projects/mis-components/toast/toast.data.service.ts","../../../projects/mis-components/toast/toast.component.ts","../../../projects/mis-components/toast/toast.service.ts","../../../projects/mis-components/toast/toast.module.ts","../../../projects/mis-components/toast/mis-crystal-design-system-toast.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ToastDataService {\n private messageMap: Map<number, string> = new Map();\n get messages(): string[] {\n return Array.from(this.messageMap.values()).reverse();\n }\n\n constructor() {}\n\n updateMessage(msg: string): number {\n const id = new Date().getTime();\n this.messageMap.set(id, msg);\n return id;\n }\n\n removeMessage(id: number): void {\n this.messageMap.delete(id);\n }\n\n hasMessage(): boolean {\n return this.messageMap.size > 0;\n }\n}\n","import { animate, style, transition, trigger } from '@angular/animations';\nimport { Component } from '@angular/core';\nimport { ToastDataService } from './toast.data.service';\n\n@Component({\n selector: 'mis-teams-toast',\n templateUrl: './toast.component.html',\n styleUrls: ['./toast.component.scss'],\n animations: [\n trigger('fadeInOut', [\n transition(':enter', [\n style({ opacity: '0', transform: 'translateY(-50%)', height: '0' }),\n animate(\n '300ms ease-in',\n style({ opacity: '1', transform: 'translateY(0)', height: '*' })\n ),\n ]),\n transition(':leave', [\n animate(\n '300ms ease-in',\n style({ opacity: '0', transform: 'translateY(50%)' })\n ),\n ]),\n ]),\n ],\n})\nexport class ToastComponent {\n constructor(public data: ToastDataService) {}\n}\n","import { Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { Injectable } from '@angular/core';\nimport { ToastComponent } from './toast.component';\nimport { ToastDataService } from './toast.data.service';\n\ntype Operations =\n | 'created'\n | 'updated'\n | 'deleted'\n | 'create'\n | 'update'\n | 'delete';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ToastService {\n constructor(private overlay: Overlay, private data: ToastDataService) {\n this.userProfilePortal = new ComponentPortal(ToastComponent);\n }\n private toastWrapperRef: OverlayRef;\n private messagePromises: Promise<void>[] = [];\n private userProfilePortal: ComponentPortal<ToastComponent>;\n\n messageBuilder = {\n error: {\n simple: 'Something went wrong. Please try again later.',\n 400: 'Bad Request! We are working to fix this.',\n 401: 'UNAUTHORISED',\n 403: 'Sorry for the interruption but seems like your session has expired. Please login again and continue',\n 404: 'Unable to find resource. Please try again later',\n },\n item: (item: string) => {\n return {\n action: (act: Operations = 'updated') => {\n const success = `Successfully ${act} ${item}.`;\n const failure = `Failed to ${act} ${item}.`;\n return {\n success,\n failure,\n };\n },\n };\n },\n short: (act: Operations = 'updated') => {\n const success = `Successfully ${act}.`;\n const failure = `Failed to ${act}.`;\n return {\n success,\n failure,\n };\n },\n simple: (...args: string[]) => args.join(' '),\n simplest: 'Done!',\n };\n\n displayMsg(msg: string, timeout = 3000): void {\n const positionStrategy = this.overlay\n .position()\n .global()\n .centerHorizontally();\n\n if (window?.innerWidth < 600) {\n positionStrategy.bottom('48px');\n } else {\n positionStrategy.top('80px');\n }\n const config = new OverlayConfig({\n hasBackdrop: false,\n positionStrategy,\n });\n if (!this.toastWrapperRef?.hasAttached()) {\n this.toastWrapperRef = this.overlay.create(config);\n this.toastWrapperRef.attach(this.userProfilePortal);\n }\n const messageId = this.data.updateMessage(msg);\n this.messagePromises.push(\n new Promise((resolve, reject) => {\n setTimeout(() => {\n resolve(this.data.removeMessage(messageId));\n if (!this.data.hasMessage()) {\n this.closeToastOverlay();\n }\n // adding 300ms for entry animation\n }, timeout + 300);\n })\n );\n Promise.race(this.messagePromises).then(() => {});\n }\n\n // tslint:disable-next-line\n private closeToastOverlay(): any {\n return setTimeout(() => {\n this.messagePromises = [];\n this.toastWrapperRef?.detach();\n // adding 300ms for exit animation\n }, 300);\n }\n}\n","import { OverlayModule } from '@angular/cdk/overlay';\nimport { CommonModule } from '@angular/common';\nimport { ModuleWithProviders, NgModule } from '@angular/core';\nimport { ToastComponent } from './toast.component';\nimport { ToastDataService } from './toast.data.service';\nimport { ToastService } from './toast.service';\n\n@NgModule({\n declarations: [ToastComponent],\n imports: [CommonModule, OverlayModule],\n entryComponents: [ToastComponent]\n})\nexport class ToastModule {\n static forRoot(): ModuleWithProviders<ToastModule> {\n return {\n ngModule: ToastModule,\n providers: [ToastDataService, ToastService],\n };\n }\n\n static forChild(): ModuleWithProviders<ToastModule> {\n return {\n ngModule: ToastModule,\n providers: [ToastDataService, ToastService],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {ToastComponent as ɵa} from './toast.component';"],"names":["Injectable","Component","trigger","transition","style","animate","ComponentPortal","OverlayConfig","Overlay","NgModule","CommonModule","OverlayModule"],"mappings":";;;;;;;QAWE;YALQ,eAAU,GAAwB,IAAI,GAAG,EAAE,CAAC;SAKpC;QAJhB,sBAAI,sCAAQ;iBAAZ;gBACE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;aACvD;;;WAAA;QAID,wCAAa,GAAb,UAAc,GAAW;YACvB,IAAM,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;YAChC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;YAC7B,OAAO,EAAE,CAAC;SACX;QAED,wCAAa,GAAb,UAAc,EAAU;YACtB,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;SAC5B;QAED,qCAAU,GAAV;YACE,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC;SACj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CAAC;SACH;;;;gBAlBFC,WAAQ,SAAC;oBACR,YAAY,EAAE,CAAC,cAAc,CAAC;oBAC9B,OAAO,EAAE,CAACC,mBAAY,EAAEC,gBAAa,CAAC;oBACtC,eAAe,EAAE,CAAC,cAAc,CAAC;iBAClC;;;ICXD;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/overlay"),require("@angular/cdk/portal"),require("@angular/core"),require("@angular/animations"),require("@angular/common")):"function"==typeof define&&define.amd?define("mis-crystal-design-system/toast",["exports","@angular/cdk/overlay","@angular/cdk/portal","@angular/core","@angular/animations","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self)["mis-crystal-design-system"]=e["mis-crystal-design-system"]||{},e["mis-crystal-design-system"].toast={}),e.ng.cdk.overlay,e.ng.cdk.portal,e.ng.core,e.ng.animations,e.ng.common)}(this,(function(e,t,r,a,o,n){"use strict";var s=function(){function e(){this.messageMap=new Map}return Object.defineProperty(e.prototype,"messages",{get:function(){return Array.from(this.messageMap.values()).reverse()},enumerable:!1,configurable:!0}),e.prototype.updateMessage=function(e){var t=(new Date).getTime();return this.messageMap.set(t,e),t},e.prototype.removeMessage=function(e){this.messageMap.delete(e)},e.prototype.hasMessage=function(){return this.messageMap.size>0},e}();s.ɵprov=a.ɵɵdefineInjectable({factory:function(){return new s},token:s,providedIn:"root"}),s.decorators=[{type:a.Injectable,args:[{providedIn:"root"}]}],s.ctorParameters=function(){return[]};var i=function(e){this.data=e};i.decorators=[{type:a.Component,args:[{selector:"mis-teams-toast",template:'<div class="toast-container">\n <div *ngFor="let msg of data.messages" @fadeInOut>\n <div class="toast-wrapper">\n <div class="msg">{{msg}}</div>\n </div>\n </div>\n</div>',animations:[o.trigger("fadeInOut",[o.transition(":enter",[o.style({opacity:"0",transform:"translateY(-50%)",height:"0"}),o.animate("300ms ease-in",o.style({opacity:"1",transform:"translateY(0)",height:"*"}))]),o.transition(":leave",[o.animate("300ms ease-in",o.style({opacity:"0",transform:"translateY(50%)"}))])])],styles:[".toast-container{transition:max-height .3s ease-in}.toast-container>div{position:relative;display:flex;justify-content:center}.toast-wrapper{display:flex;flex-direction:row;align-items:center;gap:20px;padding:14px 12px;background:#181f33;box-shadow:0 12px 17px rgba(0,0,0,.14),0 5px 22px rgba(0,0,0,.12),0 7px 8px rgba(0,0,0,.2);border-radius:4px;transition:all .3s ease-in;min-height:44px;transform-origin:top}.toast-wrapper .msg{color:#fff;max-width:314px;flex:1 1 314px;font-size:14px;line-height:20px;letter-spacing:.2px}@media screen and (max-width:360px){.toast-wrapper .msg{max-width:90vw;flex:1 1 90vw}}"]}]}],i.ctorParameters=function(){return[{type:s}]};var l=function(){function e(e,t){this.overlay=e,this.data=t,this.messagePromises=[],this.messageBuilder={error:{simple:"Something went wrong. Please try again later.",400:"Bad Request! We are working to fix this.",401:"UNAUTHORISED",403:"Sorry for the interruption but seems like your session has expired. Please login again and continue",404:"Unable to find resource. Please try again later"},item:function(e){return{action:function(t){return void 0===t&&(t="updated"),{success:"Successfully "+t+" "+e+".",failure:"Failed to "+t+" "+e+"."}}}},short:function(e){return void 0===e&&(e="updated"),{success:"Successfully "+e+".",failure:"Failed to "+e+"."}},simple:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.join(" ")},simplest:"Done!"},this.userProfilePortal=new r.ComponentPortal(i)}return e.prototype.displayMsg=function(e,r){var a,o=this;void 0===r&&(r=3e3);var n=this.overlay.position().global().centerHorizontally();(null===window||void 0===window?void 0:window.innerWidth)<600?n.bottom("48px"):n.top("80px");var s=new t.OverlayConfig({hasBackdrop:!1,positionStrategy:n});(null===(a=this.toastWrapperRef)||void 0===a?void 0:a.hasAttached())||(this.toastWrapperRef=this.overlay.create(s),this.toastWrapperRef.attach(this.userProfilePortal));var i=this.data.updateMessage(e);this.messagePromises.push(new Promise((function(e,t){setTimeout((function(){e(o.data.removeMessage(i)),o.data.hasMessage()||o.closeToastOverlay()}),r+300)}))),Promise.race(this.messagePromises).then((function(){}))},e.prototype.closeToastOverlay=function(){var e=this;return setTimeout((function(){var t;e.messagePromises=[],null===(t=e.toastWrapperRef)||void 0===t||t.detach()}),300)},e}();l.ɵprov=a.ɵɵdefineInjectable({factory:function(){return new l(a.ɵɵinject(t.Overlay),a.ɵɵinject(s))},token:l,providedIn:"root"}),l.decorators=[{type:a.Injectable,args:[{providedIn:"root"}]}],l.ctorParameters=function(){return[{type:t.Overlay},{type:s}]};var u=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[s,l]}},e.forChild=function(){return{ngModule:e,providers:[s,l]}},e}();u.decorators=[{type:a.NgModule,args:[{declarations:[i],imports:[n.CommonModule,t.OverlayModule],entryComponents:[i]}]}],e.ToastModule=u,e.ToastService=l,e.ɵa=
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/overlay"),require("@angular/cdk/portal"),require("@angular/core"),require("@angular/animations"),require("@angular/common")):"function"==typeof define&&define.amd?define("mis-crystal-design-system/toast",["exports","@angular/cdk/overlay","@angular/cdk/portal","@angular/core","@angular/animations","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self)["mis-crystal-design-system"]=e["mis-crystal-design-system"]||{},e["mis-crystal-design-system"].toast={}),e.ng.cdk.overlay,e.ng.cdk.portal,e.ng.core,e.ng.animations,e.ng.common)}(this,(function(e,t,r,a,o,n){"use strict";var s=function(){function e(){this.messageMap=new Map}return Object.defineProperty(e.prototype,"messages",{get:function(){return Array.from(this.messageMap.values()).reverse()},enumerable:!1,configurable:!0}),e.prototype.updateMessage=function(e){var t=(new Date).getTime();return this.messageMap.set(t,e),t},e.prototype.removeMessage=function(e){this.messageMap.delete(e)},e.prototype.hasMessage=function(){return this.messageMap.size>0},e}();s.ɵprov=a.ɵɵdefineInjectable({factory:function(){return new s},token:s,providedIn:"root"}),s.decorators=[{type:a.Injectable,args:[{providedIn:"root"}]}],s.ctorParameters=function(){return[]};var i=function(e){this.data=e};i.decorators=[{type:a.Component,args:[{selector:"mis-teams-toast",template:'<div class="toast-container">\n <div *ngFor="let msg of data.messages" @fadeInOut>\n <div class="toast-wrapper">\n <div class="msg">{{msg}}</div>\n </div>\n </div>\n</div>',animations:[o.trigger("fadeInOut",[o.transition(":enter",[o.style({opacity:"0",transform:"translateY(-50%)",height:"0"}),o.animate("300ms ease-in",o.style({opacity:"1",transform:"translateY(0)",height:"*"}))]),o.transition(":leave",[o.animate("300ms ease-in",o.style({opacity:"0",transform:"translateY(50%)"}))])])],styles:[".toast-container{transition:max-height .3s ease-in}.toast-container>div{position:relative;display:flex;justify-content:center}.toast-wrapper{display:flex;flex-direction:row;align-items:center;gap:20px;padding:14px 12px;background:#181f33;box-shadow:0 12px 17px rgba(0,0,0,.14),0 5px 22px rgba(0,0,0,.12),0 7px 8px rgba(0,0,0,.2);border-radius:4px;transition:all .3s ease-in;min-height:44px;transform-origin:top}.toast-wrapper .msg{color:#fff;max-width:314px;flex:1 1 314px;font-size:14px;line-height:20px;letter-spacing:.2px}@media screen and (max-width:360px){.toast-wrapper .msg{max-width:90vw;flex:1 1 90vw}}"]}]}],i.ctorParameters=function(){return[{type:s}]};var l=function(){function e(e,t){this.overlay=e,this.data=t,this.messagePromises=[],this.messageBuilder={error:{simple:"Something went wrong. Please try again later.",400:"Bad Request! We are working to fix this.",401:"UNAUTHORISED",403:"Sorry for the interruption but seems like your session has expired. Please login again and continue",404:"Unable to find resource. Please try again later"},item:function(e){return{action:function(t){return void 0===t&&(t="updated"),{success:"Successfully "+t+" "+e+".",failure:"Failed to "+t+" "+e+"."}}}},short:function(e){return void 0===e&&(e="updated"),{success:"Successfully "+e+".",failure:"Failed to "+e+"."}},simple:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.join(" ")},simplest:"Done!"},this.userProfilePortal=new r.ComponentPortal(i)}return e.prototype.displayMsg=function(e,r){var a,o=this;void 0===r&&(r=3e3);var n=this.overlay.position().global().centerHorizontally();(null===window||void 0===window?void 0:window.innerWidth)<600?n.bottom("48px"):n.top("80px");var s=new t.OverlayConfig({hasBackdrop:!1,positionStrategy:n});(null===(a=this.toastWrapperRef)||void 0===a?void 0:a.hasAttached())||(this.toastWrapperRef=this.overlay.create(s),this.toastWrapperRef.attach(this.userProfilePortal));var i=this.data.updateMessage(e);this.messagePromises.push(new Promise((function(e,t){setTimeout((function(){e(o.data.removeMessage(i)),o.data.hasMessage()||o.closeToastOverlay()}),r+300)}))),Promise.race(this.messagePromises).then((function(){}))},e.prototype.closeToastOverlay=function(){var e=this;return setTimeout((function(){var t;e.messagePromises=[],null===(t=e.toastWrapperRef)||void 0===t||t.detach()}),300)},e}();l.ɵprov=a.ɵɵdefineInjectable({factory:function(){return new l(a.ɵɵinject(t.Overlay),a.ɵɵinject(s))},token:l,providedIn:"root"}),l.decorators=[{type:a.Injectable,args:[{providedIn:"root"}]}],l.ctorParameters=function(){return[{type:t.Overlay},{type:s}]};var u=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[s,l]}},e.forChild=function(){return{ngModule:e,providers:[s,l]}},e}();u.decorators=[{type:a.NgModule,args:[{declarations:[i],imports:[n.CommonModule,t.OverlayModule],entryComponents:[i]}]}],e.ToastDataService=s,e.ToastModule=u,e.ToastService=l,e.ɵa=i,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
2
2
|
//# sourceMappingURL=mis-crystal-design-system-toast.umd.min.js.map
|
|
@@ -15,8 +15,10 @@ export class MisInputDirective {
|
|
|
15
15
|
ngOnInit() {
|
|
16
16
|
var _a, _b;
|
|
17
17
|
(_b = (_a = this.control) === null || _a === void 0 ? void 0 : _a.control) === null || _b === void 0 ? void 0 : _b.statusChanges.pipe(takeUntil(this.endObs)).subscribe(() => {
|
|
18
|
-
var _a;
|
|
19
|
-
|
|
18
|
+
var _a, _b;
|
|
19
|
+
if (!((_a = this.control.control) === null || _a === void 0 ? void 0 : _a.disabled)) {
|
|
20
|
+
this.validityChange.next(!((_b = this.control.control) === null || _b === void 0 ? void 0 : _b.invalid));
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
this.el.nativeElement.placeholder += ' ';
|
|
22
24
|
}
|
|
@@ -35,4 +37,4 @@ MisInputDirective.ctorParameters = () => [
|
|
|
35
37
|
{ type: ElementRef },
|
|
36
38
|
{ type: NgControl, decorators: [{ type: Self }, { type: Optional }] }
|
|
37
39
|
];
|
|
38
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
40
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5wdXQuZGlyZWN0aXZlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbWlzLWNvbXBvbmVudHMvaW5wdXQvZGlyZWN0aXZlcy9pbnB1dC9pbnB1dC5kaXJlY3RpdmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUNMLFNBQVMsRUFDVCxVQUFVLEVBR1YsUUFBUSxFQUNSLElBQUksR0FDTCxNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFDM0MsT0FBTyxFQUFFLGFBQWEsRUFBRSxPQUFPLEVBQWdCLE1BQU0sTUFBTSxDQUFDO0FBQzVELE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQU0zQyxNQUFNLE9BQU8saUJBQWlCO0lBQzVCLFlBQ1MsRUFBYyxFQUNPLE9BQWtCO1FBRHZDLE9BQUUsR0FBRixFQUFFLENBQVk7UUFDTyxZQUFPLEdBQVAsT0FBTyxDQUFXO1FBRXhDLG1CQUFjLEdBQTJCLElBQUksYUFBYSxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQ3RFLGFBQVEsR0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b2wuY29udHJvbD8uZGlzYWJsZWQpe1xuICAgICAgICAgIHRoaXMudmFsaWRpdHlDaGFuZ2UubmV4dCghdGhpcy5jb250cm9sLmNvbnRyb2w/LmludmFsaWQpO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB0aGlzLmVsLm5hdGl2ZUVsZW1lbnQucGxhY2Vob2xkZXIgKz0gJyAnO1xuICB9XG4gIG5nT25EZXN0cm95KCk6IHZvaWQge1xuICAgIHRoaXMuZW5kT2JzLm5leHQoKTtcbiAgICB0aGlzLmVuZE9icy5jb21wbGV0ZSgpO1xuICB9XG59XG4iXX0=
|
|
@@ -2,6 +2,5 @@
|
|
|
2
2
|
* Generated bundle index. Do not edit.
|
|
3
3
|
*/
|
|
4
4
|
export * from './index';
|
|
5
|
-
export { ToastComponent as
|
|
6
|
-
|
|
7
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWlzLWNyeXN0YWwtZGVzaWduLXN5c3RlbS10b2FzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL21pcy1jb21wb25lbnRzL3RvYXN0L21pcy1jcnlzdGFsLWRlc2lnbi1zeXN0ZW0tdG9hc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLFNBQVMsQ0FBQztBQUV4QixPQUFPLEVBQUMsY0FBYyxJQUFJLEVBQUUsRUFBQyxNQUFNLG1CQUFtQixDQUFDO0FBQ3ZELE9BQU8sRUFBQyxnQkFBZ0IsSUFBSSxFQUFFLEVBQUMsTUFBTSxzQkFBc0IsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9pbmRleCc7XG5cbmV4cG9ydCB7VG9hc3RDb21wb25lbnQgYXMgybVifSBmcm9tICcuL3RvYXN0LmNvbXBvbmVudCc7XG5leHBvcnQge1RvYXN0RGF0YVNlcnZpY2UgYXMgybVhfSBmcm9tICcuL3RvYXN0LmRhdGEuc2VydmljZSc7Il19
|
|
5
|
+
export { ToastComponent as ɵa } from './toast.component';
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWlzLWNyeXN0YWwtZGVzaWduLXN5c3RlbS10b2FzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL21pcy1jb21wb25lbnRzL3RvYXN0L21pcy1jcnlzdGFsLWRlc2lnbi1zeXN0ZW0tdG9hc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLFNBQVMsQ0FBQztBQUV4QixPQUFPLEVBQUMsY0FBYyxJQUFJLEVBQUUsRUFBQyxNQUFNLG1CQUFtQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcblxuZXhwb3J0IHtUb2FzdENvbXBvbmVudCBhcyDJtWF9IGZyb20gJy4vdG9hc3QuY29tcG9uZW50JzsiXX0=
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
|
|
1
|
+
export * from "./toast.service";
|
|
2
|
+
export * from "./toast.module";
|
|
3
|
+
export * from "./toast.data.service";
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL21pcy1jb21wb25lbnRzL3RvYXN0L3B1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxpQkFBaUIsQ0FBQztBQUNoQyxjQUFjLGdCQUFnQixDQUFDO0FBQy9CLGNBQWMsc0JBQXNCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tIFwiLi90b2FzdC5zZXJ2aWNlXCI7XG5leHBvcnQgKiBmcm9tIFwiLi90b2FzdC5tb2R1bGVcIjtcbmV4cG9ydCAqIGZyb20gXCIuL3RvYXN0LmRhdGEuc2VydmljZVwiO1xuIl19
|
|
@@ -17,8 +17,10 @@ class MisInputDirective {
|
|
|
17
17
|
ngOnInit() {
|
|
18
18
|
var _a, _b;
|
|
19
19
|
(_b = (_a = this.control) === null || _a === void 0 ? void 0 : _a.control) === null || _b === void 0 ? void 0 : _b.statusChanges.pipe(takeUntil(this.endObs)).subscribe(() => {
|
|
20
|
-
var _a;
|
|
21
|
-
|
|
20
|
+
var _a, _b;
|
|
21
|
+
if (!((_a = this.control.control) === null || _a === void 0 ? void 0 : _a.disabled)) {
|
|
22
|
+
this.validityChange.next(!((_b = this.control.control) === null || _b === void 0 ? void 0 : _b.invalid));
|
|
23
|
+
}
|
|
22
24
|
});
|
|
23
25
|
this.el.nativeElement.placeholder += ' ';
|
|
24
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mis-crystal-design-system-input.js","sources":["../../../projects/mis-components/input/directives/input/input.directive.ts","../../../projects/mis-components/input/mis-input.component.ts","../../../projects/mis-components/input/mis-input.module.ts","../../../projects/mis-components/input/mis-crystal-design-system-input.ts"],"sourcesContent":["import {\n Directive,\n ElementRef,\n OnDestroy,\n OnInit,\n Optional,\n Self,\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { ReplaySubject, Subject, Subscription } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\n@Directive({\n // tslint:disable-next-line\n selector: 'input[misInput]',\n})\nexport class MisInputDirective implements OnInit, OnDestroy {\n constructor(\n public el: ElementRef,\n @Self() @Optional() private control: NgControl\n ) {}\n private validityChange: ReplaySubject<boolean> = new ReplaySubject(1);\n validity = this.validityChange.asObservable();\n endObs: Subject<void> = new Subject();\n focus = false;\n hasValue = false;\n\n ngOnInit(): void {\n this.control?.control?.statusChanges\n .pipe(takeUntil(this.endObs))\n .subscribe(() => {\n this.validityChange.next(this.control.control?.
|
|
1
|
+
{"version":3,"file":"mis-crystal-design-system-input.js","sources":["../../../projects/mis-components/input/directives/input/input.directive.ts","../../../projects/mis-components/input/mis-input.component.ts","../../../projects/mis-components/input/mis-input.module.ts","../../../projects/mis-components/input/mis-crystal-design-system-input.ts"],"sourcesContent":["import {\n Directive,\n ElementRef,\n OnDestroy,\n OnInit,\n Optional,\n Self,\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { ReplaySubject, Subject, Subscription } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\n@Directive({\n // tslint:disable-next-line\n selector: 'input[misInput]',\n})\nexport class MisInputDirective implements OnInit, OnDestroy {\n constructor(\n public el: ElementRef,\n @Self() @Optional() private control: NgControl\n ) {}\n private validityChange: ReplaySubject<boolean> = new ReplaySubject(1);\n validity = this.validityChange.asObservable();\n endObs: Subject<void> = new Subject();\n focus = false;\n hasValue = false;\n\n ngOnInit(): void {\n this.control?.control?.statusChanges\n .pipe(takeUntil(this.endObs))\n .subscribe(() => {\n if(!this.control.control?.disabled){\n this.validityChange.next(!this.control.control?.invalid);\n }\n });\n this.el.nativeElement.placeholder += ' ';\n }\n ngOnDestroy(): void {\n this.endObs.next();\n this.endObs.complete();\n }\n}\n","import {\n Component,\n ContentChild,\n Input,\n OnDestroy,\n OnInit,\n ViewEncapsulation,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { MisInputDirective } from './directives/input/input.directive';\n\n@Component({\n selector: 'mis-input',\n templateUrl: './mis-input.component.html',\n styleUrls: ['./mis-input.component.scss'],\n})\nexport class MisInputComponent implements OnInit, OnDestroy {\n @Input() type: 'rounded' | 'floating' = 'floating';\n @Input() placeholder: string; // floating placeholder text\n @Input() noHints = false;\n @Input() hasError = false; // show input in error state\n @ContentChild(MisInputDirective) set formInput(input: MisInputDirective) {\n if (!this.placeholder) {\n this.placeholder = input.el.nativeElement.placeholder;\n }\n this.inputSubscription?.unsubscribe();\n this.inputSubscription = input?.validity.subscribe(\n (res) => (this.inputValidity = res)\n );\n this.placeholder += ' ';\n }\n inputSubscription: Subscription | undefined;\n inputValidity: boolean = true;\n constructor() {}\n\n ngOnInit(): void {}\n ngOnDestroy(): void {\n this.inputSubscription?.unsubscribe();\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { MisInputDirective } from './directives/input/input.directive';\nimport { MisInputComponent } from './mis-input.component';\n\n@NgModule({\n declarations: [MisInputComponent, MisInputDirective],\n imports: [CommonModule, FormsModule],\n exports: [MisInputComponent, MisInputDirective],\n})\nexport class MisInputModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAgBa,iBAAiB;IAC5B,YACS,EAAc,EACO,OAAkB;QADvC,OAAE,GAAF,EAAE,CAAY;QACO,YAAO,GAAP,OAAO,CAAW;QAExC,mBAAc,GAA2B,IAAI,aAAa,CAAC,CAAC,CAAC,CAAC;QACtE,aAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC;QAC9C,WAAM,GAAkB,IAAI,OAAO,EAAE,CAAC;QACtC,UAAK,GAAG,KAAK,CAAC;QACd,aAAQ,GAAG,KAAK,CAAC;KALb;IAOJ,QAAQ;;QACN,YAAA,IAAI,CAAC,OAAO,0CAAE,OAAO,0CAAE,aAAa,CACjC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAC3B,SAAS,CAAC;;YACT,IAAG,QAAC,IAAI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0BACL,KAAK;sBACL,KAAK;uBACL,KAAK;wBACL,YAAY,SAAC,iBAAiB;;;MCVpB,cAAc;;;YAL1B,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;gBACpD,OAAO,EAAE,CAAC,YAAY,EAAE,WAAW,CAAC;gBACpC,OAAO,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;aAChD;;;ACVD;;;;;;"}
|
|
@@ -175,5 +175,5 @@ ToastModule.decorators = [
|
|
|
175
175
|
* Generated bundle index. Do not edit.
|
|
176
176
|
*/
|
|
177
177
|
|
|
178
|
-
export { ToastModule, ToastService,
|
|
178
|
+
export { ToastDataService, ToastModule, ToastService, ToastComponent as ɵa };
|
|
179
179
|
//# sourceMappingURL=mis-crystal-design-system-toast.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mis-crystal-design-system-toast.js","sources":["../../../projects/mis-components/toast/toast.data.service.ts","../../../projects/mis-components/toast/toast.component.ts","../../../projects/mis-components/toast/toast.service.ts","../../../projects/mis-components/toast/toast.module.ts","../../../projects/mis-components/toast/mis-crystal-design-system-toast.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ToastDataService {\n private messageMap: Map<number, string> = new Map();\n get messages(): string[] {\n return Array.from(this.messageMap.values()).reverse();\n }\n\n constructor() {}\n\n updateMessage(msg: string): number {\n const id = new Date().getTime();\n this.messageMap.set(id, msg);\n return id;\n }\n\n removeMessage(id: number): void {\n this.messageMap.delete(id);\n }\n\n hasMessage(): boolean {\n return this.messageMap.size > 0;\n }\n}\n","import { animate, style, transition, trigger } from '@angular/animations';\nimport { Component } from '@angular/core';\nimport { ToastDataService } from './toast.data.service';\n\n@Component({\n selector: 'mis-teams-toast',\n templateUrl: './toast.component.html',\n styleUrls: ['./toast.component.scss'],\n animations: [\n trigger('fadeInOut', [\n transition(':enter', [\n style({ opacity: '0', transform: 'translateY(-50%)', height: '0' }),\n animate(\n '300ms ease-in',\n style({ opacity: '1', transform: 'translateY(0)', height: '*' })\n ),\n ]),\n transition(':leave', [\n animate(\n '300ms ease-in',\n style({ opacity: '0', transform: 'translateY(50%)' })\n ),\n ]),\n ]),\n ],\n})\nexport class ToastComponent {\n constructor(public data: ToastDataService) {}\n}\n","import { Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { Injectable } from '@angular/core';\nimport { ToastComponent } from './toast.component';\nimport { ToastDataService } from './toast.data.service';\n\ntype Operations =\n | 'created'\n | 'updated'\n | 'deleted'\n | 'create'\n | 'update'\n | 'delete';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ToastService {\n constructor(private overlay: Overlay, private data: ToastDataService) {\n this.userProfilePortal = new ComponentPortal(ToastComponent);\n }\n private toastWrapperRef: OverlayRef;\n private messagePromises: Promise<void>[] = [];\n private userProfilePortal: ComponentPortal<ToastComponent>;\n\n messageBuilder = {\n error: {\n simple: 'Something went wrong. Please try again later.',\n 400: 'Bad Request! We are working to fix this.',\n 401: 'UNAUTHORISED',\n 403: 'Sorry for the interruption but seems like your session has expired. Please login again and continue',\n 404: 'Unable to find resource. Please try again later',\n },\n item: (item: string) => {\n return {\n action: (act: Operations = 'updated') => {\n const success = `Successfully ${act} ${item}.`;\n const failure = `Failed to ${act} ${item}.`;\n return {\n success,\n failure,\n };\n },\n };\n },\n short: (act: Operations = 'updated') => {\n const success = `Successfully ${act}.`;\n const failure = `Failed to ${act}.`;\n return {\n success,\n failure,\n };\n },\n simple: (...args: string[]) => args.join(' '),\n simplest: 'Done!',\n };\n\n displayMsg(msg: string, timeout = 3000): void {\n const positionStrategy = this.overlay\n .position()\n .global()\n .centerHorizontally();\n\n if (window?.innerWidth < 600) {\n positionStrategy.bottom('48px');\n } else {\n positionStrategy.top('80px');\n }\n const config = new OverlayConfig({\n hasBackdrop: false,\n positionStrategy,\n });\n if (!this.toastWrapperRef?.hasAttached()) {\n this.toastWrapperRef = this.overlay.create(config);\n this.toastWrapperRef.attach(this.userProfilePortal);\n }\n const messageId = this.data.updateMessage(msg);\n this.messagePromises.push(\n new Promise((resolve, reject) => {\n setTimeout(() => {\n resolve(this.data.removeMessage(messageId));\n if (!this.data.hasMessage()) {\n this.closeToastOverlay();\n }\n // adding 300ms for entry animation\n }, timeout + 300);\n })\n );\n Promise.race(this.messagePromises).then(() => {});\n }\n\n // tslint:disable-next-line\n private closeToastOverlay(): any {\n return setTimeout(() => {\n this.messagePromises = [];\n this.toastWrapperRef?.detach();\n // adding 300ms for exit animation\n }, 300);\n }\n}\n","import { OverlayModule } from '@angular/cdk/overlay';\nimport { CommonModule } from '@angular/common';\nimport { ModuleWithProviders, NgModule } from '@angular/core';\nimport { ToastComponent } from './toast.component';\nimport { ToastDataService } from './toast.data.service';\nimport { ToastService } from './toast.service';\n\n@NgModule({\n declarations: [ToastComponent],\n imports: [CommonModule, OverlayModule],\n entryComponents: [ToastComponent]\n})\nexport class ToastModule {\n static forRoot(): ModuleWithProviders<ToastModule> {\n return {\n ngModule: ToastModule,\n providers: [ToastDataService, ToastService],\n };\n }\n\n static forChild(): ModuleWithProviders<ToastModule> {\n return {\n ngModule: ToastModule,\n providers: [ToastDataService, ToastService],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {ToastComponent as
|
|
1
|
+
{"version":3,"file":"mis-crystal-design-system-toast.js","sources":["../../../projects/mis-components/toast/toast.data.service.ts","../../../projects/mis-components/toast/toast.component.ts","../../../projects/mis-components/toast/toast.service.ts","../../../projects/mis-components/toast/toast.module.ts","../../../projects/mis-components/toast/mis-crystal-design-system-toast.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ToastDataService {\n private messageMap: Map<number, string> = new Map();\n get messages(): string[] {\n return Array.from(this.messageMap.values()).reverse();\n }\n\n constructor() {}\n\n updateMessage(msg: string): number {\n const id = new Date().getTime();\n this.messageMap.set(id, msg);\n return id;\n }\n\n removeMessage(id: number): void {\n this.messageMap.delete(id);\n }\n\n hasMessage(): boolean {\n return this.messageMap.size > 0;\n }\n}\n","import { animate, style, transition, trigger } from '@angular/animations';\nimport { Component } from '@angular/core';\nimport { ToastDataService } from './toast.data.service';\n\n@Component({\n selector: 'mis-teams-toast',\n templateUrl: './toast.component.html',\n styleUrls: ['./toast.component.scss'],\n animations: [\n trigger('fadeInOut', [\n transition(':enter', [\n style({ opacity: '0', transform: 'translateY(-50%)', height: '0' }),\n animate(\n '300ms ease-in',\n style({ opacity: '1', transform: 'translateY(0)', height: '*' })\n ),\n ]),\n transition(':leave', [\n animate(\n '300ms ease-in',\n style({ opacity: '0', transform: 'translateY(50%)' })\n ),\n ]),\n ]),\n ],\n})\nexport class ToastComponent {\n constructor(public data: ToastDataService) {}\n}\n","import { Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { Injectable } from '@angular/core';\nimport { ToastComponent } from './toast.component';\nimport { ToastDataService } from './toast.data.service';\n\ntype Operations =\n | 'created'\n | 'updated'\n | 'deleted'\n | 'create'\n | 'update'\n | 'delete';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ToastService {\n constructor(private overlay: Overlay, private data: ToastDataService) {\n this.userProfilePortal = new ComponentPortal(ToastComponent);\n }\n private toastWrapperRef: OverlayRef;\n private messagePromises: Promise<void>[] = [];\n private userProfilePortal: ComponentPortal<ToastComponent>;\n\n messageBuilder = {\n error: {\n simple: 'Something went wrong. Please try again later.',\n 400: 'Bad Request! We are working to fix this.',\n 401: 'UNAUTHORISED',\n 403: 'Sorry for the interruption but seems like your session has expired. Please login again and continue',\n 404: 'Unable to find resource. Please try again later',\n },\n item: (item: string) => {\n return {\n action: (act: Operations = 'updated') => {\n const success = `Successfully ${act} ${item}.`;\n const failure = `Failed to ${act} ${item}.`;\n return {\n success,\n failure,\n };\n },\n };\n },\n short: (act: Operations = 'updated') => {\n const success = `Successfully ${act}.`;\n const failure = `Failed to ${act}.`;\n return {\n success,\n failure,\n };\n },\n simple: (...args: string[]) => args.join(' '),\n simplest: 'Done!',\n };\n\n displayMsg(msg: string, timeout = 3000): void {\n const positionStrategy = this.overlay\n .position()\n .global()\n .centerHorizontally();\n\n if (window?.innerWidth < 600) {\n positionStrategy.bottom('48px');\n } else {\n positionStrategy.top('80px');\n }\n const config = new OverlayConfig({\n hasBackdrop: false,\n positionStrategy,\n });\n if (!this.toastWrapperRef?.hasAttached()) {\n this.toastWrapperRef = this.overlay.create(config);\n this.toastWrapperRef.attach(this.userProfilePortal);\n }\n const messageId = this.data.updateMessage(msg);\n this.messagePromises.push(\n new Promise((resolve, reject) => {\n setTimeout(() => {\n resolve(this.data.removeMessage(messageId));\n if (!this.data.hasMessage()) {\n this.closeToastOverlay();\n }\n // adding 300ms for entry animation\n }, timeout + 300);\n })\n );\n Promise.race(this.messagePromises).then(() => {});\n }\n\n // tslint:disable-next-line\n private closeToastOverlay(): any {\n return setTimeout(() => {\n this.messagePromises = [];\n this.toastWrapperRef?.detach();\n // adding 300ms for exit animation\n }, 300);\n }\n}\n","import { OverlayModule } from '@angular/cdk/overlay';\nimport { CommonModule } from '@angular/common';\nimport { ModuleWithProviders, NgModule } from '@angular/core';\nimport { ToastComponent } from './toast.component';\nimport { ToastDataService } from './toast.data.service';\nimport { ToastService } from './toast.service';\n\n@NgModule({\n declarations: [ToastComponent],\n imports: [CommonModule, OverlayModule],\n entryComponents: [ToastComponent]\n})\nexport class ToastModule {\n static forRoot(): ModuleWithProviders<ToastModule> {\n return {\n ngModule: ToastModule,\n providers: [ToastDataService, ToastService],\n };\n }\n\n static forChild(): ModuleWithProviders<ToastModule> {\n return {\n ngModule: ToastModule,\n providers: [ToastDataService, ToastService],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {ToastComponent as ɵa} from './toast.component';"],"names":[],"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AAU,EAAE,MAAM;aACnB;;;YAhBQ,OAAO;YAIP,gBAAgB;;;MCQZ,WAAW;IACtB,OAAO,OAAO;QACZ,OAAO;YACL,QAAQ,EAAE,WAAW;YACrB,SAAS,EAAE,CAAC,gBAAgB,EAAE,YAAY,CAAC;SAC5C,CAAC;KACH;IAED,OAAO,QAAQ;QACb,OAAO;YACL,QAAQ,EAAE,WAAW;YACrB,SAAS,EAAE,CAAC,gBAAgB,EAAE,YAAY,CAAC;SAC5C,CAAC;KACH;;;YAlBF,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,cAAc,CAAC;gBAC9B,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC;gBACtC,eAAe,EAAE,CAAC,cAAc,CAAC;aAClC;;;ACXD;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"ToastService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":14,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/cdk/overlay","name":"Overlay","line":18,"character":31},{"__symbolic":"reference","name":"
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"ToastService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":14,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/cdk/overlay","name":"Overlay","line":18,"character":31},{"__symbolic":"reference","name":"ToastDataService"}]}],"displayMsg":[{"__symbolic":"method"}],"closeToastOverlay":[{"__symbolic":"method"}]},"statics":{"ɵprov":{}}},"ToastModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":7,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"ɵa"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":9,"character":12},{"__symbolic":"reference","module":"@angular/cdk/overlay","name":"OverlayModule","line":9,"character":26}],"entryComponents":[{"__symbolic":"reference","name":"ɵa"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"ToastModule"},"providers":[{"__symbolic":"reference","name":"ToastDataService"},{"__symbolic":"reference","name":"ToastService"}]}},"forChild":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"ToastModule"},"providers":[{"__symbolic":"reference","name":"ToastDataService"},{"__symbolic":"reference","name":"ToastService"}]}}}},"ToastDataService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":2,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"updateMessage":[{"__symbolic":"method"}],"removeMessage":[{"__symbolic":"method"}],"hasMessage":[{"__symbolic":"method"}]},"statics":{"ɵprov":{}}},"ɵa":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":4,"character":1},"arguments":[{"selector":"mis-teams-toast","animations":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/animations","name":"trigger","line":9,"character":4},"arguments":["fadeInOut",[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/animations","name":"transition","line":10,"character":6},"arguments":[":enter",[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/animations","name":"style","line":11,"character":8},"arguments":[{"opacity":"0","transform":"translateY(-50%)","height":"0"}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/animations","name":"animate","line":12,"character":8},"arguments":["300ms ease-in",{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/animations","name":"style","line":14,"character":10},"arguments":[{"opacity":"1","transform":"translateY(0)","height":"*"}]}]}]]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/animations","name":"transition","line":17,"character":6},"arguments":[":leave",[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/animations","name":"animate","line":18,"character":8},"arguments":["300ms ease-in",{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/animations","name":"style","line":20,"character":10},"arguments":[{"opacity":"0","transform":"translateY(50%)"}]}]}]]}]]}],"template":"<div class=\"toast-container\">\n <div *ngFor=\"let msg of data.messages\" @fadeInOut>\n <div class=\"toast-wrapper\">\n <div class=\"msg\">{{msg}}</div>\n </div>\n </div>\n</div>","styles":[".toast-container{transition:max-height .3s ease-in}.toast-container>div{position:relative;display:flex;justify-content:center}.toast-wrapper{display:flex;flex-direction:row;align-items:center;gap:20px;padding:14px 12px;background:#181f33;box-shadow:0 12px 17px rgba(0,0,0,.14),0 5px 22px rgba(0,0,0,.12),0 7px 8px rgba(0,0,0,.2);border-radius:4px;transition:all .3s ease-in;min-height:44px;transform-origin:top}.toast-wrapper .msg{color:#fff;max-width:314px;flex:1 1 314px;font-size:14px;line-height:20px;letter-spacing:.2px}@media screen and (max-width:360px){.toast-wrapper .msg{max-width:90vw;flex:1 1 90vw}}"]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ToastDataService"}]}]}}},"origins":{"ToastService":"./toast.service","ToastModule":"./toast.module","ToastDataService":"./toast.data.service","ɵa":"./toast.component"},"importAs":"mis-crystal-design-system/toast"}
|
package/toast/public_api.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from "./toast.service";
|
|
2
|
+
export * from "./toast.module";
|
|
3
|
+
export * from "./toast.data.service";
|