mis-crystal-design-system 4.0.29 → 4.0.30-test
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-star-rating.umd.js +112 -0
- package/bundles/mis-crystal-design-system-star-rating.umd.js.map +1 -0
- package/bundles/mis-crystal-design-system-star-rating.umd.min.js +2 -0
- package/bundles/mis-crystal-design-system-star-rating.umd.min.js.map +1 -0
- package/bundles/mis-crystal-design-system-toast.umd.js +1 -1
- 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/star-rating/index.js +2 -0
- package/esm2015/star-rating/mis-crystal-design-system-star-rating.js +5 -0
- package/esm2015/star-rating/public_api.js +3 -0
- package/esm2015/star-rating/star-rating.component.js +78 -0
- package/esm2015/star-rating/star-rating.module.js +13 -0
- package/esm2015/toast/mis-crystal-design-system-toast.js +1 -2
- package/esm2015/toast/public_api.js +2 -1
- package/fesm2015/mis-crystal-design-system-star-rating.js +96 -0
- package/fesm2015/mis-crystal-design-system-star-rating.js.map +1 -0
- 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/star-rating/index.d.ts +1 -0
- package/star-rating/mis-crystal-design-system-star-rating.d.ts +4 -0
- package/star-rating/mis-crystal-design-system-star-rating.metadata.json +1 -0
- package/star-rating/package.json +11 -0
- package/star-rating/public_api.d.ts +2 -0
- package/star-rating/star-rating.component.d.ts +26 -0
- package/star-rating/star-rating.module.d.ts +2 -0
- package/toast/mis-crystal-design-system-toast.d.ts +0 -1
- package/toast/mis-crystal-design-system-toast.metadata.json +1 -1
- package/toast/public_api.d.ts +1 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('mis-crystal-design-system/star-rating', ['exports', '@angular/common', '@angular/core'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['mis-crystal-design-system'] = global['mis-crystal-design-system'] || {}, global['mis-crystal-design-system']['star-rating'] = {}), global.ng.common, global.ng.core));
|
|
5
|
+
}(this, (function (exports, common, core) { 'use strict';
|
|
6
|
+
|
|
7
|
+
var StarRatingComponent = /** @class */ (function () {
|
|
8
|
+
function StarRatingComponent() {
|
|
9
|
+
this.noOfStars = 0;
|
|
10
|
+
this.selectedRating = -1;
|
|
11
|
+
this.selectedStarSvg = '';
|
|
12
|
+
this.emptyStarSvg = '';
|
|
13
|
+
this.starHeight = '24px';
|
|
14
|
+
this.starWidth = '24px';
|
|
15
|
+
this.starSelectionAllowed = true;
|
|
16
|
+
this.starHoverAllowed = true;
|
|
17
|
+
this.starRated = new core.EventEmitter();
|
|
18
|
+
this.starData = [];
|
|
19
|
+
this.selectedData = [];
|
|
20
|
+
}
|
|
21
|
+
StarRatingComponent.prototype.ngOnInit = function () {
|
|
22
|
+
var _this = this;
|
|
23
|
+
if (this.noOfStars > 0) {
|
|
24
|
+
this.starData = Array.from({ length: this.noOfStars }, function (_, i) { return ({
|
|
25
|
+
id: i,
|
|
26
|
+
asset: _this.emptyStarSvg,
|
|
27
|
+
hoverId: -1,
|
|
28
|
+
}); });
|
|
29
|
+
}
|
|
30
|
+
this.selectedRating = this.selectedRating > this.noOfStars ? this.noOfStars : this.selectedRating;
|
|
31
|
+
this.assetsSelection(this.selectedRating);
|
|
32
|
+
this.selectedData = JSON.parse(JSON.stringify(this.starData));
|
|
33
|
+
};
|
|
34
|
+
StarRatingComponent.prototype.ngOnChanges = function (changes) {
|
|
35
|
+
this.assetsSelection(this.selectedRating);
|
|
36
|
+
this.selectedData = JSON.parse(JSON.stringify(this.starData));
|
|
37
|
+
};
|
|
38
|
+
StarRatingComponent.prototype.assetsSelection = function (index) {
|
|
39
|
+
var _this = this;
|
|
40
|
+
if (index === void 0) { index = -1; }
|
|
41
|
+
this.starData.forEach(function (item) {
|
|
42
|
+
item.asset = item.id <= index - 1 ? _this.selectedStarSvg : _this.emptyStarSvg;
|
|
43
|
+
item.hoverId = -1;
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
StarRatingComponent.prototype.starMouseOver = function (index) {
|
|
47
|
+
var _this = this;
|
|
48
|
+
if (!this.starHoverAllowed)
|
|
49
|
+
return;
|
|
50
|
+
var threshold = this.selectedRating - 1;
|
|
51
|
+
this.starData.forEach(function (item) {
|
|
52
|
+
item.hoverId = index;
|
|
53
|
+
item.asset = index > threshold && item.id <= index ? _this.selectedStarSvg : _this.selectedData[item.id].asset;
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
StarRatingComponent.prototype.starMouseLeave = function () {
|
|
57
|
+
if (!this.starHoverAllowed)
|
|
58
|
+
return;
|
|
59
|
+
this.starData = JSON.parse(JSON.stringify(this.selectedData));
|
|
60
|
+
this.assetsSelection(this.selectedRating);
|
|
61
|
+
};
|
|
62
|
+
StarRatingComponent.prototype.selectedStarData = function (index) {
|
|
63
|
+
if (this.starSelectionAllowed) {
|
|
64
|
+
this.starRated.emit(index + 1);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
return StarRatingComponent;
|
|
68
|
+
}());
|
|
69
|
+
StarRatingComponent.decorators = [
|
|
70
|
+
{ type: core.Component, args: [{
|
|
71
|
+
selector: 'mis-star-rating',
|
|
72
|
+
template: "<div class=\"rating-container\" (mouseleave)=\"starMouseLeave()\" [ngStyle]=\"{'cursor': starSelectionAllowed ? 'pointer' : 'not-allowed'}\">\n <div class=\"stars-container\" *ngFor=\"let star of starData\">\n <div class=\"star\" \n (click)=\"selectedStarData(star.id)\" \n (mouseover)=\"starMouseOver(star.id)\"\n [ngClass]=\"{'hoveredStarZoom': star.id === star.hoverId, 'not-hovered' : star.hoverId >=0 && star.id > star.hoverId}\"\n >\n <img [src]=\"star.asset\" [ngStyle]=\"{'height': starHeight, 'width': starWidth}\">\n </div>\n </div>\n</div>\n",
|
|
73
|
+
styles: [".rating-container{display:flex;flex-direction:row;gap:12px}.not-hovered{opacity:.6}.hoveredStarZoom{transform:scale(1.2);transition:all .3s ease-out}"]
|
|
74
|
+
},] }
|
|
75
|
+
];
|
|
76
|
+
StarRatingComponent.ctorParameters = function () { return []; };
|
|
77
|
+
StarRatingComponent.propDecorators = {
|
|
78
|
+
noOfStars: [{ type: core.Input }],
|
|
79
|
+
selectedRating: [{ type: core.Input }],
|
|
80
|
+
selectedStarSvg: [{ type: core.Input }],
|
|
81
|
+
emptyStarSvg: [{ type: core.Input }],
|
|
82
|
+
starHeight: [{ type: core.Input }],
|
|
83
|
+
starWidth: [{ type: core.Input }],
|
|
84
|
+
starSelectionAllowed: [{ type: core.Input }],
|
|
85
|
+
starHoverAllowed: [{ type: core.Input }],
|
|
86
|
+
starRated: [{ type: core.Output, args: ['starRated',] }]
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
var StarRatingModule = /** @class */ (function () {
|
|
90
|
+
function StarRatingModule() {
|
|
91
|
+
}
|
|
92
|
+
return StarRatingModule;
|
|
93
|
+
}());
|
|
94
|
+
StarRatingModule.decorators = [
|
|
95
|
+
{ type: core.NgModule, args: [{
|
|
96
|
+
declarations: [StarRatingComponent],
|
|
97
|
+
imports: [common.CommonModule],
|
|
98
|
+
exports: [StarRatingComponent]
|
|
99
|
+
},] }
|
|
100
|
+
];
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Generated bundle index. Do not edit.
|
|
104
|
+
*/
|
|
105
|
+
|
|
106
|
+
exports.StarRatingComponent = StarRatingComponent;
|
|
107
|
+
exports.StarRatingModule = StarRatingModule;
|
|
108
|
+
|
|
109
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
110
|
+
|
|
111
|
+
})));
|
|
112
|
+
//# sourceMappingURL=mis-crystal-design-system-star-rating.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mis-crystal-design-system-star-rating.umd.js","sources":["../../../projects/mis-components/star-rating/star-rating.component.ts","../../../projects/mis-components/star-rating/star-rating.module.ts","../../../projects/mis-components/star-rating/mis-crystal-design-system-star-rating.ts"],"sourcesContent":["import { Component, OnInit, Input, Output, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';\n\n@Component({\n selector: 'mis-star-rating',\n templateUrl: './star-rating.component.html',\n styleUrls: ['./star-rating.component.scss']\n})\nexport class StarRatingComponent implements OnInit, OnChanges {\n\n @Input() noOfStars: number = 0;\n @Input() selectedRating: number = -1;\n @Input() selectedStarSvg = '';\n @Input() emptyStarSvg = '';\n @Input() starHeight = '24px';\n @Input() starWidth = '24px';\n @Input() starSelectionAllowed = true;\n @Input() starHoverAllowed = true;\n @Output('starRated') starRated: EventEmitter<number> = new EventEmitter();\n\n starData: STAR_DATA[] = [];\n selectedData: STAR_DATA[] = [];\n constructor() { }\n\n ngOnInit(): void {\n if(this.noOfStars > 0){\n this.starData = Array.from({ length: this.noOfStars }, (_, i) => ({\n id: i,\n asset: this.emptyStarSvg,\n hoverId: -1,\n }));\n }\n this.selectedRating = this.selectedRating > this.noOfStars ? this.noOfStars : this.selectedRating; \n this.assetsSelection(this.selectedRating);\n this.selectedData = JSON.parse(JSON.stringify(this.starData));\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n this.assetsSelection(this.selectedRating);\n this.selectedData = JSON.parse(JSON.stringify(this.starData));\n }\n\n assetsSelection(index: number = -1){\n this.starData.forEach((item: STAR_DATA) => {\n item.asset = item.id <= index - 1 ? this.selectedStarSvg : this.emptyStarSvg;\n item.hoverId = -1;\n });\n }\n\n starMouseOver(index){\n if (!this.starHoverAllowed) return;\n\n const threshold = this.selectedRating - 1;\n this.starData.forEach(item => {\n item.hoverId = index;\n item.asset = index > threshold && item.id <= index ? this.selectedStarSvg : this.selectedData[item.id].asset;\n });\n\n }\n\n starMouseLeave(){\n if(!this.starHoverAllowed) return;\n\n this.starData = JSON.parse(JSON.stringify(this.selectedData));\n this.assetsSelection(this.selectedRating);\n }\n\n selectedStarData(index: number){\n if(this.starSelectionAllowed){\n this.starRated.emit(index+1)\n }\n }\n\n}\n\nexport interface STAR_DATA {\n id: number,\n asset: string,\n hoverId: number\n}\n","import { CommonModule } from \"@angular/common\";\nimport { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { StarRatingComponent } from \"./star-rating.component\";\n\n@NgModule({\n declarations: [StarRatingComponent],\n imports: [CommonModule],\n exports: [StarRatingComponent]\n})\nexport class StarRatingModule {\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["EventEmitter","Component","Input","Output","NgModule","CommonModule"],"mappings":";;;;;;;QAqBE;YAZS,cAAS,GAAW,CAAC,CAAC;YACtB,mBAAc,GAAW,CAAC,CAAC,CAAC;YAC5B,oBAAe,GAAG,EAAE,CAAC;YACrB,iBAAY,GAAG,EAAE,CAAC;YAClB,eAAU,GAAG,MAAM,CAAC;YACpB,cAAS,GAAG,MAAM,CAAC;YACnB,yBAAoB,GAAG,IAAI,CAAC;YAC5B,qBAAgB,GAAG,IAAI,CAAC;YACZ,cAAS,GAAyB,IAAIA,iBAAY,EAAE,CAAC;YAE1E,aAAQ,GAAgB,EAAE,CAAC;YAC3B,iBAAY,GAAgB,EAAE,CAAC;SACd;QAEjB,sCAAQ,GAAR;YAAA,iBAWC;YAVC,IAAG,IAAI,CAAC,SAAS,GAAG,CAAC,EAAC;gBACpB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE,UAAC,CAAC,EAAE,CAAC,IAAK,QAAC;oBAChE,EAAE,EAAE,CAAC;oBACL,KAAK,EAAE,KAAI,CAAC,YAAY;oBACxB,OAAO,EAAE,CAAC,CAAC;iBACZ,IAAC,CAAC,CAAC;aACL;YACD,IAAI,CAAC,cAA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C,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC;aAC9G,CAAC,CAAC;SAEJ;QAED,4CAAc,GAAd;YACE,IAAG,CAAC,IAAI,CAAC,gBAAgB;gBAAE,OAAO;YAElC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;YAC9D,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;SAC3C;QAED,8CAAgB,GAAhB,UAAiB,KAAa;YAC5B,IAAG,IAAI,CAAC,oBAAoB,EAAC;gBAC3B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,GAAC,CAAC,CAAC,CAAA;aAC7B;SACF;;;;gBApEFC,cAAS,SAAC;oBACT,QAAQ,EAAE,iBAAiB;oBAC3B,+mBAA2C;;iBAE5C;;;;4BAGEC,UAAK;iCACLA,UAAK;kCACLA,UAAK;+BACLA,UAAK;6BACLA,UAAK;4BACLA,UAAK;uCACLA,UAAK;mCACLA,UAAK;4BACLC,WAAM,SAAC,WAAW;;;;QCRrB;;;;;gBALCC,aAAQ,SAAC;oBACR,YAAY,EAAE,CAAC,mBAAmB,CAAC;oBACnC,OAAO,EAAE,CAACC,mBAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,mBAAmB,CAAC;iBAC/B;;;ICRD;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/common"),require("@angular/core")):"function"==typeof define&&define.amd?define("mis-crystal-design-system/star-rating",["exports","@angular/common","@angular/core"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self)["mis-crystal-design-system"]=t["mis-crystal-design-system"]||{},t["mis-crystal-design-system"]["star-rating"]={}),t.ng.common,t.ng.core)}(this,(function(t,e,s){"use strict";var a=function(){function t(){this.noOfStars=0,this.selectedRating=-1,this.selectedStarSvg="",this.emptyStarSvg="",this.starHeight="24px",this.starWidth="24px",this.starSelectionAllowed=!0,this.starHoverAllowed=!0,this.starRated=new s.EventEmitter,this.starData=[],this.selectedData=[]}return t.prototype.ngOnInit=function(){var t=this;this.noOfStars>0&&(this.starData=Array.from({length:this.noOfStars},(function(e,s){return{id:s,asset:t.emptyStarSvg,hoverId:-1}}))),this.selectedRating=this.selectedRating>this.noOfStars?this.noOfStars:this.selectedRating,this.assetsSelection(this.selectedRating),this.selectedData=JSON.parse(JSON.stringify(this.starData))},t.prototype.ngOnChanges=function(t){this.assetsSelection(this.selectedRating),this.selectedData=JSON.parse(JSON.stringify(this.starData))},t.prototype.assetsSelection=function(t){var e=this;void 0===t&&(t=-1),this.starData.forEach((function(s){s.asset=s.id<=t-1?e.selectedStarSvg:e.emptyStarSvg,s.hoverId=-1}))},t.prototype.starMouseOver=function(t){var e=this;if(this.starHoverAllowed){var s=this.selectedRating-1;this.starData.forEach((function(a){a.hoverId=t,a.asset=t>s&&a.id<=t?e.selectedStarSvg:e.selectedData[a.id].asset}))}},t.prototype.starMouseLeave=function(){this.starHoverAllowed&&(this.starData=JSON.parse(JSON.stringify(this.selectedData)),this.assetsSelection(this.selectedRating))},t.prototype.selectedStarData=function(t){this.starSelectionAllowed&&this.starRated.emit(t+1)},t}();a.decorators=[{type:s.Component,args:[{selector:"mis-star-rating",template:'<div class="rating-container" (mouseleave)="starMouseLeave()" [ngStyle]="{\'cursor\': starSelectionAllowed ? \'pointer\' : \'not-allowed\'}">\n <div class="stars-container" *ngFor="let star of starData">\n <div class="star" \n (click)="selectedStarData(star.id)" \n (mouseover)="starMouseOver(star.id)"\n [ngClass]="{\'hoveredStarZoom\': star.id === star.hoverId, \'not-hovered\' : star.hoverId >=0 && star.id > star.hoverId}"\n >\n <img [src]="star.asset" [ngStyle]="{\'height\': starHeight, \'width\': starWidth}">\n </div>\n </div>\n</div>\n',styles:[".rating-container{display:flex;flex-direction:row;gap:12px}.not-hovered{opacity:.6}.hoveredStarZoom{transform:scale(1.2);transition:all .3s ease-out}"]}]}],a.ctorParameters=function(){return[]},a.propDecorators={noOfStars:[{type:s.Input}],selectedRating:[{type:s.Input}],selectedStarSvg:[{type:s.Input}],emptyStarSvg:[{type:s.Input}],starHeight:[{type:s.Input}],starWidth:[{type:s.Input}],starSelectionAllowed:[{type:s.Input}],starHoverAllowed:[{type:s.Input}],starRated:[{type:s.Output,args:["starRated"]}]};var r=function(){};r.decorators=[{type:s.NgModule,args:[{declarations:[a],imports:[e.CommonModule],exports:[a]}]}],t.StarRatingComponent=a,t.StarRatingModule=r,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
2
|
+
//# sourceMappingURL=mis-crystal-design-system-star-rating.umd.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../projects/mis-components/star-rating/star-rating.component.ts","../../../projects/mis-components/star-rating/star-rating.module.ts"],"names":["StarRatingComponent","this","noOfStars","selectedRating","selectedStarSvg","emptyStarSvg","starHeight","starWidth","starSelectionAllowed","starHoverAllowed","starRated","EventEmitter","starData","selectedData","prototype","ngOnInit","_this","Array","from","length","_","i","id","asset","hoverId","assetsSelection","JSON","parse","stringify","ngOnChanges","changes","index","forEach","item","starMouseOver","threshold","starMouseLeave","selectedStarData","emit","Component","args","selector","template","Input","Output","NgModule","declarations","imports","CommonModule","exports"],"mappings":"ggBAqBE,SAAAA,IAZSC,KAAAC,UAAoB,EACpBD,KAAAE,gBAA0B,EAC1BF,KAAAG,gBAAkB,GAClBH,KAAAI,aAAe,GACfJ,KAAAK,WAAa,OACbL,KAAAM,UAAY,OACZN,KAAAO,sBAAuB,EACvBP,KAAAQ,kBAAmB,EACPR,KAAAS,UAAkC,IAAIC,EAAAA,aAE3DV,KAAAW,SAAwB,GACxBX,KAAAY,aAA4B,UAG5Bb,EAAAc,UAAAC,SAAA,WAAA,IAAAC,EAAAf,KACKA,KAAKC,UAAY,IAClBD,KAAKW,SAAWK,MAAMC,KAA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,8BACAA,EAAAA,+BACAA,EAAAA,4BACAA,EAAAA,0BACAA,EAAAA,yBACAA,EAAAA,oCACAA,EAAAA,gCACAA,EAAAA,yBACAC,EAAAA,OAAMJ,KAAA,CAAC,sBCRV,iCALCK,EAAAA,SAAQL,KAAA,CAAC,CACRM,aAAc,CAAC9C,GACf+C,QAAS,CAACC,EAAAA,cACVC,QAAS,CAACjD","sourcesContent":["import { Component, OnInit, Input, Output, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';\n\n@Component({\n selector: 'mis-star-rating',\n templateUrl: './star-rating.component.html',\n styleUrls: ['./star-rating.component.scss']\n})\nexport class StarRatingComponent implements OnInit, OnChanges {\n\n @Input() noOfStars: number = 0;\n @Input() selectedRating: number = -1;\n @Input() selectedStarSvg = '';\n @Input() emptyStarSvg = '';\n @Input() starHeight = '24px';\n @Input() starWidth = '24px';\n @Input() starSelectionAllowed = true;\n @Input() starHoverAllowed = true;\n @Output('starRated') starRated: EventEmitter<number> = new EventEmitter();\n\n starData: STAR_DATA[] = [];\n selectedData: STAR_DATA[] = [];\n constructor() { }\n\n ngOnInit(): void {\n if(this.noOfStars > 0){\n this.starData = Array.from({ length: this.noOfStars }, (_, i) => ({\n id: i,\n asset: this.emptyStarSvg,\n hoverId: -1,\n }));\n }\n this.selectedRating = this.selectedRating > this.noOfStars ? this.noOfStars : this.selectedRating; \n this.assetsSelection(this.selectedRating);\n this.selectedData = JSON.parse(JSON.stringify(this.starData));\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n this.assetsSelection(this.selectedRating);\n this.selectedData = JSON.parse(JSON.stringify(this.starData));\n }\n\n assetsSelection(index: number = -1){\n this.starData.forEach((item: STAR_DATA) => {\n item.asset = item.id <= index - 1 ? this.selectedStarSvg : this.emptyStarSvg;\n item.hoverId = -1;\n });\n }\n\n starMouseOver(index){\n if (!this.starHoverAllowed) return;\n\n const threshold = this.selectedRating - 1;\n this.starData.forEach(item => {\n item.hoverId = index;\n item.asset = index > threshold && item.id <= index ? this.selectedStarSvg : this.selectedData[item.id].asset;\n });\n\n }\n\n starMouseLeave(){\n if(!this.starHoverAllowed) return;\n\n this.starData = JSON.parse(JSON.stringify(this.selectedData));\n this.assetsSelection(this.selectedRating);\n }\n\n selectedStarData(index: number){\n if(this.starSelectionAllowed){\n this.starRated.emit(index+1)\n }\n }\n\n}\n\nexport interface STAR_DATA {\n id: number,\n asset: string,\n hoverId: number\n}\n","import { CommonModule } from \"@angular/common\";\nimport { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { StarRatingComponent } from \"./star-rating.component\";\n\n@NgModule({\n declarations: [StarRatingComponent],\n imports: [CommonModule],\n exports: [StarRatingComponent]\n})\nexport class StarRatingModule {\n}\n"]}
|
|
@@ -191,10 +191,10 @@
|
|
|
191
191
|
* Generated bundle index. Do not edit.
|
|
192
192
|
*/
|
|
193
193
|
|
|
194
|
+
exports.ToastComponent = ToastComponent;
|
|
194
195
|
exports.ToastDataService = ToastDataService;
|
|
195
196
|
exports.ToastModule = ToastModule;
|
|
196
197
|
exports.ToastService = ToastService;
|
|
197
|
-
exports.ɵa = ToastComponent;
|
|
198
198
|
|
|
199
199
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
200
200
|
|
|
@@ -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(\"300ms ease-in\", style({ opacity: \"1\", transform: \"translateY(0)\", height: \"*\" }))\n ]),\n transition(\":leave\", [animate(\"300ms ease-in\", style({ opacity: \"0\", transform: \"translateY(50%)\" }))])\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 = \"created\" | \"updated\" | \"deleted\" | \"create\" | \"update\" | \"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.position().global().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
|
|
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(\"300ms ease-in\", style({ opacity: \"1\", transform: \"translateY(0)\", height: \"*\" }))\n ]),\n transition(\":leave\", [animate(\"300ms ease-in\", style({ opacity: \"0\", transform: \"translateY(50%)\" }))])\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 = \"created\" | \"updated\" | \"deleted\" | \"create\" | \"update\" | \"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.position().global().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"],"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;SACjC;;;;;gBAvBFA,aAAU,SAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;;;QCeC,wBAAmB,IAAsB;YAAtB,SAAI,GAAJ,IAAI,CAAkB;SAAI;;;;gBAf9CC,YAAS,SAAC;oBACT,QAAQ,EAAE,iBAAiB;oBAC3B,gNAAqC;oBAErC,UAAU,EAAE;wBACVC,kBAAO,CAAC,WAAW,EAAE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"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>\n',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
|
|
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>\n',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 p=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[s,l]}},e.forChild=function(){return{ngModule:e,providers:[s,l]}},e}();p.decorators=[{type:a.NgModule,args:[{declarations:[i],imports:[n.CommonModule,t.OverlayModule],entryComponents:[i]}]}],e.ToastComponent=i,e.ToastDataService=s,e.ToastModule=p,e.ToastService=l,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
2
2
|
//# sourceMappingURL=mis-crystal-design-system-toast.umd.min.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export * from "./public_api";
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9taXMtY29tcG9uZW50cy9zdGFyLXJhdGluZy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gXCIuL3B1YmxpY19hcGlcIjsiXX0=
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './index';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWlzLWNyeXN0YWwtZGVzaWduLXN5c3RlbS1zdGFyLXJhdGluZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL21pcy1jb21wb25lbnRzL3N0YXItcmF0aW5nL21pcy1jcnlzdGFsLWRlc2lnbi1zeXN0ZW0tc3Rhci1yYXRpbmcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLFNBQVMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9pbmRleCc7XG4iXX0=
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { StarRatingModule } from './star-rating.module';
|
|
2
|
+
export { StarRatingComponent } from './star-rating.component';
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL21pcy1jb21wb25lbnRzL3N0YXItcmF0aW5nL3B1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDeEQsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0seUJBQXlCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgeyBTdGFyUmF0aW5nTW9kdWxlIH0gZnJvbSAnLi9zdGFyLXJhdGluZy5tb2R1bGUnO1xuZXhwb3J0IHsgU3RhclJhdGluZ0NvbXBvbmVudCB9IGZyb20gJy4vc3Rhci1yYXRpbmcuY29tcG9uZW50JzsiXX0=
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
|
2
|
+
export class StarRatingComponent {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.noOfStars = 0;
|
|
5
|
+
this.selectedRating = -1;
|
|
6
|
+
this.selectedStarSvg = '';
|
|
7
|
+
this.emptyStarSvg = '';
|
|
8
|
+
this.starHeight = '24px';
|
|
9
|
+
this.starWidth = '24px';
|
|
10
|
+
this.starSelectionAllowed = true;
|
|
11
|
+
this.starHoverAllowed = true;
|
|
12
|
+
this.starRated = new EventEmitter();
|
|
13
|
+
this.starData = [];
|
|
14
|
+
this.selectedData = [];
|
|
15
|
+
}
|
|
16
|
+
ngOnInit() {
|
|
17
|
+
if (this.noOfStars > 0) {
|
|
18
|
+
this.starData = Array.from({ length: this.noOfStars }, (_, i) => ({
|
|
19
|
+
id: i,
|
|
20
|
+
asset: this.emptyStarSvg,
|
|
21
|
+
hoverId: -1,
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
this.selectedRating = this.selectedRating > this.noOfStars ? this.noOfStars : this.selectedRating;
|
|
25
|
+
this.assetsSelection(this.selectedRating);
|
|
26
|
+
this.selectedData = JSON.parse(JSON.stringify(this.starData));
|
|
27
|
+
}
|
|
28
|
+
ngOnChanges(changes) {
|
|
29
|
+
this.assetsSelection(this.selectedRating);
|
|
30
|
+
this.selectedData = JSON.parse(JSON.stringify(this.starData));
|
|
31
|
+
}
|
|
32
|
+
assetsSelection(index = -1) {
|
|
33
|
+
this.starData.forEach((item) => {
|
|
34
|
+
item.asset = item.id <= index - 1 ? this.selectedStarSvg : this.emptyStarSvg;
|
|
35
|
+
item.hoverId = -1;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
starMouseOver(index) {
|
|
39
|
+
if (!this.starHoverAllowed)
|
|
40
|
+
return;
|
|
41
|
+
const threshold = this.selectedRating - 1;
|
|
42
|
+
this.starData.forEach(item => {
|
|
43
|
+
item.hoverId = index;
|
|
44
|
+
item.asset = index > threshold && item.id <= index ? this.selectedStarSvg : this.selectedData[item.id].asset;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
starMouseLeave() {
|
|
48
|
+
if (!this.starHoverAllowed)
|
|
49
|
+
return;
|
|
50
|
+
this.starData = JSON.parse(JSON.stringify(this.selectedData));
|
|
51
|
+
this.assetsSelection(this.selectedRating);
|
|
52
|
+
}
|
|
53
|
+
selectedStarData(index) {
|
|
54
|
+
if (this.starSelectionAllowed) {
|
|
55
|
+
this.starRated.emit(index + 1);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
StarRatingComponent.decorators = [
|
|
60
|
+
{ type: Component, args: [{
|
|
61
|
+
selector: 'mis-star-rating',
|
|
62
|
+
template: "<div class=\"rating-container\" (mouseleave)=\"starMouseLeave()\" [ngStyle]=\"{'cursor': starSelectionAllowed ? 'pointer' : 'not-allowed'}\">\n <div class=\"stars-container\" *ngFor=\"let star of starData\">\n <div class=\"star\" \n (click)=\"selectedStarData(star.id)\" \n (mouseover)=\"starMouseOver(star.id)\"\n [ngClass]=\"{'hoveredStarZoom': star.id === star.hoverId, 'not-hovered' : star.hoverId >=0 && star.id > star.hoverId}\"\n >\n <img [src]=\"star.asset\" [ngStyle]=\"{'height': starHeight, 'width': starWidth}\">\n </div>\n </div>\n</div>\n",
|
|
63
|
+
styles: [".rating-container{display:flex;flex-direction:row;gap:12px}.not-hovered{opacity:.6}.hoveredStarZoom{transform:scale(1.2);transition:all .3s ease-out}"]
|
|
64
|
+
},] }
|
|
65
|
+
];
|
|
66
|
+
StarRatingComponent.ctorParameters = () => [];
|
|
67
|
+
StarRatingComponent.propDecorators = {
|
|
68
|
+
noOfStars: [{ type: Input }],
|
|
69
|
+
selectedRating: [{ type: Input }],
|
|
70
|
+
selectedStarSvg: [{ type: Input }],
|
|
71
|
+
emptyStarSvg: [{ type: Input }],
|
|
72
|
+
starHeight: [{ type: Input }],
|
|
73
|
+
starWidth: [{ type: Input }],
|
|
74
|
+
starSelectionAllowed: [{ type: Input }],
|
|
75
|
+
starHoverAllowed: [{ type: Input }],
|
|
76
|
+
starRated: [{ type: Output, args: ['starRated',] }]
|
|
77
|
+
};
|
|
78
|
+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c3RhclJhdGVkLmVtaXQoaW5kZXgrMSlcbiAgICB9XG4gIH1cblxufVxuXG5leHBvcnQgaW50ZXJmYWNlIFNUQVJfREFUQSB7XG4gIGlkOiBudW1iZXIsXG4gIGFzc2V0OiBzdHJpbmcsXG4gIGhvdmVySWQ6IG51bWJlclxufVxuIl19
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CommonModule } from "@angular/common";
|
|
2
|
+
import { NgModule } from "@angular/core";
|
|
3
|
+
import { StarRatingComponent } from "./star-rating.component";
|
|
4
|
+
export class StarRatingModule {
|
|
5
|
+
}
|
|
6
|
+
StarRatingModule.decorators = [
|
|
7
|
+
{ type: NgModule, args: [{
|
|
8
|
+
declarations: [StarRatingComponent],
|
|
9
|
+
imports: [CommonModule],
|
|
10
|
+
exports: [StarRatingComponent]
|
|
11
|
+
},] }
|
|
12
|
+
];
|
|
13
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3Rhci1yYXRpbmcubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvbWlzLWNvbXBvbmVudHMvc3Rhci1yYXRpbmcvc3Rhci1yYXRpbmcubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUMvQyxPQUFPLEVBQUUsUUFBUSxFQUF1QixNQUFNLGVBQWUsQ0FBQztBQUM5RCxPQUFPLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQU85RCxNQUFNLE9BQU8sZ0JBQWdCOzs7WUFMNUIsUUFBUSxTQUFDO2dCQUNSLFlBQVksRUFBRSxDQUFDLG1CQUFtQixDQUFDO2dCQUNuQyxPQUFPLEVBQUUsQ0FBQyxZQUFZLENBQUM7Z0JBQ3ZCLE9BQU8sR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nVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcblxuZXhwb3J0IHtUb2FzdENvbXBvbmVudCBhcyDJtWF9IGZyb20gJy4vdG9hc3QuY29tcG9uZW50JzsiXX0=
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWlzLWNyeXN0YWwtZGVzaWduLXN5c3RlbS10b2FzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL21pcy1jb21wb25lbnRzL3RvYXN0L21pcy1jcnlzdGFsLWRlc2lnbi1zeXN0ZW0tdG9hc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLFNBQVMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9pbmRleCc7XG4iXX0=
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from "./toast.service";
|
|
2
2
|
export * from "./toast.module";
|
|
3
3
|
export * from "./toast.data.service";
|
|
4
|
-
|
|
4
|
+
export { ToastComponent } from "./toast.component";
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL21pcy1jb21wb25lbnRzL3RvYXN0L3B1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxpQkFBaUIsQ0FBQztBQUNoQyxjQUFjLGdCQUFnQixDQUFDO0FBQy9CLGNBQWMsc0JBQXNCLENBQUM7QUFDckMsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLG1CQUFtQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSBcIi4vdG9hc3Quc2VydmljZVwiO1xuZXhwb3J0ICogZnJvbSBcIi4vdG9hc3QubW9kdWxlXCI7XG5leHBvcnQgKiBmcm9tIFwiLi90b2FzdC5kYXRhLnNlcnZpY2VcIjtcbmV4cG9ydCB7IFRvYXN0Q29tcG9uZW50IH0gZnJvbSBcIi4vdG9hc3QuY29tcG9uZW50XCI7XG4iXX0=
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { EventEmitter, Component, Input, Output, NgModule } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
class StarRatingComponent {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.noOfStars = 0;
|
|
7
|
+
this.selectedRating = -1;
|
|
8
|
+
this.selectedStarSvg = '';
|
|
9
|
+
this.emptyStarSvg = '';
|
|
10
|
+
this.starHeight = '24px';
|
|
11
|
+
this.starWidth = '24px';
|
|
12
|
+
this.starSelectionAllowed = true;
|
|
13
|
+
this.starHoverAllowed = true;
|
|
14
|
+
this.starRated = new EventEmitter();
|
|
15
|
+
this.starData = [];
|
|
16
|
+
this.selectedData = [];
|
|
17
|
+
}
|
|
18
|
+
ngOnInit() {
|
|
19
|
+
if (this.noOfStars > 0) {
|
|
20
|
+
this.starData = Array.from({ length: this.noOfStars }, (_, i) => ({
|
|
21
|
+
id: i,
|
|
22
|
+
asset: this.emptyStarSvg,
|
|
23
|
+
hoverId: -1,
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
this.selectedRating = this.selectedRating > this.noOfStars ? this.noOfStars : this.selectedRating;
|
|
27
|
+
this.assetsSelection(this.selectedRating);
|
|
28
|
+
this.selectedData = JSON.parse(JSON.stringify(this.starData));
|
|
29
|
+
}
|
|
30
|
+
ngOnChanges(changes) {
|
|
31
|
+
this.assetsSelection(this.selectedRating);
|
|
32
|
+
this.selectedData = JSON.parse(JSON.stringify(this.starData));
|
|
33
|
+
}
|
|
34
|
+
assetsSelection(index = -1) {
|
|
35
|
+
this.starData.forEach((item) => {
|
|
36
|
+
item.asset = item.id <= index - 1 ? this.selectedStarSvg : this.emptyStarSvg;
|
|
37
|
+
item.hoverId = -1;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
starMouseOver(index) {
|
|
41
|
+
if (!this.starHoverAllowed)
|
|
42
|
+
return;
|
|
43
|
+
const threshold = this.selectedRating - 1;
|
|
44
|
+
this.starData.forEach(item => {
|
|
45
|
+
item.hoverId = index;
|
|
46
|
+
item.asset = index > threshold && item.id <= index ? this.selectedStarSvg : this.selectedData[item.id].asset;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
starMouseLeave() {
|
|
50
|
+
if (!this.starHoverAllowed)
|
|
51
|
+
return;
|
|
52
|
+
this.starData = JSON.parse(JSON.stringify(this.selectedData));
|
|
53
|
+
this.assetsSelection(this.selectedRating);
|
|
54
|
+
}
|
|
55
|
+
selectedStarData(index) {
|
|
56
|
+
if (this.starSelectionAllowed) {
|
|
57
|
+
this.starRated.emit(index + 1);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
StarRatingComponent.decorators = [
|
|
62
|
+
{ type: Component, args: [{
|
|
63
|
+
selector: 'mis-star-rating',
|
|
64
|
+
template: "<div class=\"rating-container\" (mouseleave)=\"starMouseLeave()\" [ngStyle]=\"{'cursor': starSelectionAllowed ? 'pointer' : 'not-allowed'}\">\n <div class=\"stars-container\" *ngFor=\"let star of starData\">\n <div class=\"star\" \n (click)=\"selectedStarData(star.id)\" \n (mouseover)=\"starMouseOver(star.id)\"\n [ngClass]=\"{'hoveredStarZoom': star.id === star.hoverId, 'not-hovered' : star.hoverId >=0 && star.id > star.hoverId}\"\n >\n <img [src]=\"star.asset\" [ngStyle]=\"{'height': starHeight, 'width': starWidth}\">\n </div>\n </div>\n</div>\n",
|
|
65
|
+
styles: [".rating-container{display:flex;flex-direction:row;gap:12px}.not-hovered{opacity:.6}.hoveredStarZoom{transform:scale(1.2);transition:all .3s ease-out}"]
|
|
66
|
+
},] }
|
|
67
|
+
];
|
|
68
|
+
StarRatingComponent.ctorParameters = () => [];
|
|
69
|
+
StarRatingComponent.propDecorators = {
|
|
70
|
+
noOfStars: [{ type: Input }],
|
|
71
|
+
selectedRating: [{ type: Input }],
|
|
72
|
+
selectedStarSvg: [{ type: Input }],
|
|
73
|
+
emptyStarSvg: [{ type: Input }],
|
|
74
|
+
starHeight: [{ type: Input }],
|
|
75
|
+
starWidth: [{ type: Input }],
|
|
76
|
+
starSelectionAllowed: [{ type: Input }],
|
|
77
|
+
starHoverAllowed: [{ type: Input }],
|
|
78
|
+
starRated: [{ type: Output, args: ['starRated',] }]
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
class StarRatingModule {
|
|
82
|
+
}
|
|
83
|
+
StarRatingModule.decorators = [
|
|
84
|
+
{ type: NgModule, args: [{
|
|
85
|
+
declarations: [StarRatingComponent],
|
|
86
|
+
imports: [CommonModule],
|
|
87
|
+
exports: [StarRatingComponent]
|
|
88
|
+
},] }
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Generated bundle index. Do not edit.
|
|
93
|
+
*/
|
|
94
|
+
|
|
95
|
+
export { StarRatingComponent, StarRatingModule };
|
|
96
|
+
//# sourceMappingURL=mis-crystal-design-system-star-rating.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mis-crystal-design-system-star-rating.js","sources":["../../../projects/mis-components/star-rating/star-rating.component.ts","../../../projects/mis-components/star-rating/star-rating.module.ts","../../../projects/mis-components/star-rating/mis-crystal-design-system-star-rating.ts"],"sourcesContent":["import { Component, OnInit, Input, Output, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';\n\n@Component({\n selector: 'mis-star-rating',\n templateUrl: './star-rating.component.html',\n styleUrls: ['./star-rating.component.scss']\n})\nexport class StarRatingComponent implements OnInit, OnChanges {\n\n @Input() noOfStars: number = 0;\n @Input() selectedRating: number = -1;\n @Input() selectedStarSvg = '';\n @Input() emptyStarSvg = '';\n @Input() starHeight = '24px';\n @Input() starWidth = '24px';\n @Input() starSelectionAllowed = true;\n @Input() starHoverAllowed = true;\n @Output('starRated') starRated: EventEmitter<number> = new EventEmitter();\n\n starData: STAR_DATA[] = [];\n selectedData: STAR_DATA[] = [];\n constructor() { }\n\n ngOnInit(): void {\n if(this.noOfStars > 0){\n this.starData = Array.from({ length: this.noOfStars }, (_, i) => ({\n id: i,\n asset: this.emptyStarSvg,\n hoverId: -1,\n }));\n }\n this.selectedRating = this.selectedRating > this.noOfStars ? this.noOfStars : this.selectedRating; \n this.assetsSelection(this.selectedRating);\n this.selectedData = JSON.parse(JSON.stringify(this.starData));\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n this.assetsSelection(this.selectedRating);\n this.selectedData = JSON.parse(JSON.stringify(this.starData));\n }\n\n assetsSelection(index: number = -1){\n this.starData.forEach((item: STAR_DATA) => {\n item.asset = item.id <= index - 1 ? this.selectedStarSvg : this.emptyStarSvg;\n item.hoverId = -1;\n });\n }\n\n starMouseOver(index){\n if (!this.starHoverAllowed) return;\n\n const threshold = this.selectedRating - 1;\n this.starData.forEach(item => {\n item.hoverId = index;\n item.asset = index > threshold && item.id <= index ? this.selectedStarSvg : this.selectedData[item.id].asset;\n });\n\n }\n\n starMouseLeave(){\n if(!this.starHoverAllowed) return;\n\n this.starData = JSON.parse(JSON.stringify(this.selectedData));\n this.assetsSelection(this.selectedRating);\n }\n\n selectedStarData(index: number){\n if(this.starSelectionAllowed){\n this.starRated.emit(index+1)\n }\n }\n\n}\n\nexport interface STAR_DATA {\n id: number,\n asset: string,\n hoverId: number\n}\n","import { CommonModule } from \"@angular/common\";\nimport { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { StarRatingComponent } from \"./star-rating.component\";\n\n@NgModule({\n declarations: [StarRatingComponent],\n imports: [CommonModule],\n exports: [StarRatingComponent]\n})\nexport class StarRatingModule {\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAOa,mBAAmB;IAc9B;QAZS,cAAS,GAAW,CAAC,CAAC;QACtB,mBAAc,GAAW,CAAC,CAAC,CAAC;QAC5B,oBAAe,GAAG,EAAE,CAAC;QACrB,iBAAY,GAAG,EAAE,CAAC;QAClB,eAAU,GAAG,MAAM,CAAC;QACpB,cAAS,GAAG,MAAM,CAAC;QACnB,yBAAoB,GAAG,IAAI,CAAC;QAC5B,qBAAgB,GAAG,IAAI,CAAC;QACZ,cAAS,GAAyB,IAAI,YAAY,EAAE,CAAC;QAE1E,aAAQ,GAAgB,EAAE,CAAC;QAC3B,iBAAY,GAAgB,EAAE,CAAC;KACd;IAEjB,QAAQ;QACN,IAAG,IAAI,CAAC,SAAS,GAAG,CAAC,EAAC;YACpB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,MAAM;gBAChE,EAAE,EAAE,CAAC;gBACL,KAAK,EAAE,IAAI,CAAC,YAAY;gBACxB,OAAO,EAAE,CAAC,CAAC;aACZ,CAAC,CAAC,CAAC;SACL;QACD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC;QAClG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC1C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;KAC/D;IAED,WAAW,CAAC,OAAsB;QAChC,IAAI,CAAC,eAAe,CAAC,IA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AAK,GAAC,CAAC,CAAC,CAAA;SAC7B;KACF;;;YApEF,SAAS,SAAC;gBACT,QAAQ,EAAE,iBAAiB;gBAC3B,+mBAA2C;;aAE5C;;;;wBAGE,KAAK;6BACL,KAAK;8BACL,KAAK;2BACL,KAAK;yBACL,KAAK;wBACL,KAAK;mCACL,KAAK;+BACL,KAAK;wBACL,MAAM,SAAC,WAAW;;;MCRR,gBAAgB;;;YAL5B,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,mBAAmB,CAAC;gBACnC,OAAO,EAAE,CAAC,YAAY,CAAC;gBACvB,OAAO,EAAE,CAAC,mBAAmB,CAAC;aAC/B;;;ACRD;;;;;;"}
|
|
@@ -170,5 +170,5 @@ ToastModule.decorators = [
|
|
|
170
170
|
* Generated bundle index. Do not edit.
|
|
171
171
|
*/
|
|
172
172
|
|
|
173
|
-
export { ToastDataService, ToastModule, ToastService
|
|
173
|
+
export { ToastComponent, ToastDataService, ToastModule, ToastService };
|
|
174
174
|
//# 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(\"300ms ease-in\", style({ opacity: \"1\", transform: \"translateY(0)\", height: \"*\" }))\n ]),\n transition(\":leave\", [animate(\"300ms ease-in\", style({ opacity: \"0\", transform: \"translateY(50%)\" }))])\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 = \"created\" | \"updated\" | \"deleted\" | \"create\" | \"update\" | \"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.position().global().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
|
|
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(\"300ms ease-in\", style({ opacity: \"1\", transform: \"translateY(0)\", height: \"*\" }))\n ]),\n transition(\":leave\", [animate(\"300ms ease-in\", style({ opacity: \"0\", transform: \"translateY(50%)\" }))])\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 = \"created\" | \"updated\" | \"deleted\" | \"create\" | \"update\" | \"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.position().global().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"],"names":[],"mappings":";;;;;;MAKa,gBAAgB;IAM3B;QALQ,eAAU,GAAwB,IAAI,GAAG,EAAE,CAAC;KAKpC;IAJhB,IAAI,QAAQ;QACV,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;KACvD;IAID,aAAa,CAAC,GAAW;QACvB,MAAM,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;QAChC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;QAC7B,OAAO,EAAE,CAAC;KACX;IAED,aAAa,CAAC,EAAU;QACtB,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;KAC5B;IAED,UAAU;QACR,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC;KACjC;;;;YAvBF,UAAU,SAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;;;MCcY,cAAc;IACzB,YAAmB,IAAsB;QAAtB,SAAI,GAAJ,IAAI,CAAkB;KAAI;;;YAf9C,SAAS,SAAC;gBACT,QAAQ,EAAE,iBAAiB;gBAC3B,gNAAqC;gBAErC,UAAU,EAAE;oBACV,OAAO,CAAC,WAAW,EAAE;wBACnB,UAAU,CAAC,QAAQ,EAAE;4BACnB,KAAK,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;4BACnE,OAAO,CAAC,eAAe,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,S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,CAAC;KACnD;;IAGO,iBAAiB;QACvB,OAAO,UAAU,CAAC;;YAChB,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;YAC1B,MAAA,IAAI,CAAC,eAAe,0CAAE,MAAM,GAAG;;SAEhC,EAAE,GAAG,CAAC,CAAC;KACT;;;;YAjFF,UAAU,SAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;;YAVQ,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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./public_api";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"StarRatingModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":4,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"StarRatingComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":6,"character":12}],"exports":[{"__symbolic":"reference","name":"StarRatingComponent"}]}]}],"members":{}},"StarRatingComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"selector":"mis-star-rating","template":"<div class=\"rating-container\" (mouseleave)=\"starMouseLeave()\" [ngStyle]=\"{'cursor': starSelectionAllowed ? 'pointer' : 'not-allowed'}\">\n <div class=\"stars-container\" *ngFor=\"let star of starData\">\n <div class=\"star\" \n (click)=\"selectedStarData(star.id)\" \n (mouseover)=\"starMouseOver(star.id)\"\n [ngClass]=\"{'hoveredStarZoom': star.id === star.hoverId, 'not-hovered' : star.hoverId >=0 && star.id > star.hoverId}\"\n >\n <img [src]=\"star.asset\" [ngStyle]=\"{'height': starHeight, 'width': starWidth}\">\n </div>\n </div>\n</div>\n","styles":[".rating-container{display:flex;flex-direction:row;gap:12px}.not-hovered{opacity:.6}.hoveredStarZoom{transform:scale(1.2);transition:all .3s ease-out}"]}]}],"members":{"noOfStars":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":9,"character":3}}]}],"selectedRating":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":10,"character":3}}]}],"selectedStarSvg":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":11,"character":3}}]}],"emptyStarSvg":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":12,"character":3}}]}],"starHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}}]}],"starWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":14,"character":3}}]}],"starSelectionAllowed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":15,"character":3}}]}],"starHoverAllowed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":16,"character":3}}]}],"starRated":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":17,"character":3},"arguments":["starRated"]}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"assetsSelection":[{"__symbolic":"method"}],"starMouseOver":[{"__symbolic":"method"}],"starMouseLeave":[{"__symbolic":"method"}],"selectedStarData":[{"__symbolic":"method"}]}}},"origins":{"StarRatingModule":"./star-rating.module","StarRatingComponent":"./star-rating.component"},"importAs":"mis-crystal-design-system/star-rating"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"main": "../bundles/mis-crystal-design-system-star-rating.umd.js",
|
|
3
|
+
"module": "../fesm2015/mis-crystal-design-system-star-rating.js",
|
|
4
|
+
"es2015": "../fesm2015/mis-crystal-design-system-star-rating.js",
|
|
5
|
+
"esm2015": "../esm2015/star-rating/mis-crystal-design-system-star-rating.js",
|
|
6
|
+
"fesm2015": "../fesm2015/mis-crystal-design-system-star-rating.js",
|
|
7
|
+
"typings": "mis-crystal-design-system-star-rating.d.ts",
|
|
8
|
+
"metadata": "mis-crystal-design-system-star-rating.metadata.json",
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"name": "mis-crystal-design-system/star-rating"
|
|
11
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { OnInit, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
export declare class StarRatingComponent implements OnInit, OnChanges {
|
|
3
|
+
noOfStars: number;
|
|
4
|
+
selectedRating: number;
|
|
5
|
+
selectedStarSvg: string;
|
|
6
|
+
emptyStarSvg: string;
|
|
7
|
+
starHeight: string;
|
|
8
|
+
starWidth: string;
|
|
9
|
+
starSelectionAllowed: boolean;
|
|
10
|
+
starHoverAllowed: boolean;
|
|
11
|
+
starRated: EventEmitter<number>;
|
|
12
|
+
starData: STAR_DATA[];
|
|
13
|
+
selectedData: STAR_DATA[];
|
|
14
|
+
constructor();
|
|
15
|
+
ngOnInit(): void;
|
|
16
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
17
|
+
assetsSelection(index?: number): void;
|
|
18
|
+
starMouseOver(index: any): void;
|
|
19
|
+
starMouseLeave(): void;
|
|
20
|
+
selectedStarData(index: number): void;
|
|
21
|
+
}
|
|
22
|
+
export interface STAR_DATA {
|
|
23
|
+
id: number;
|
|
24
|
+
asset: string;
|
|
25
|
+
hoverId: number;
|
|
26
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"ToastService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":8,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/cdk/overlay","name":"Overlay","line":12,"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":"
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"ToastService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":8,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/cdk/overlay","name":"Overlay","line":12,"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":"ToastComponent"}],"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":"ToastComponent"}]}]}],"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":{}}},"ToastComponent":{"__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":12,"character":33},"arguments":[{"opacity":"1","transform":"translateY(0)","height":"*"}]}]}]]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/animations","name":"transition","line":14,"character":6},"arguments":[":leave",[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/animations","name":"animate","line":14,"character":28},"arguments":["300ms ease-in",{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/animations","name":"style","line":14,"character":53},"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>\n","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","ToastComponent":"./toast.component"},"importAs":"mis-crystal-design-system/toast"}
|
package/toast/public_api.d.ts
CHANGED