mis-crystal-design-system 2.6.3 → 2.6.5-testing

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.
Files changed (42) hide show
  1. package/action-list/action-list.component.d.ts +5 -1
  2. package/bundles/mis-crystal-design-system-action-list.umd.js.map +1 -1
  3. package/bundles/mis-crystal-design-system-action-list.umd.min.js.map +1 -1
  4. package/bundles/mis-crystal-design-system-button.umd.js.map +1 -1
  5. package/bundles/mis-crystal-design-system-datepicker_v2.umd.js.map +1 -1
  6. package/bundles/mis-crystal-design-system-daterangepicker_v2.umd.js.map +1 -1
  7. package/bundles/mis-crystal-design-system-drawer.umd.js.map +1 -1
  8. package/bundles/mis-crystal-design-system-dropdown.umd.js +12 -4
  9. package/bundles/mis-crystal-design-system-dropdown.umd.js.map +1 -1
  10. package/bundles/mis-crystal-design-system-dropdown.umd.min.js +2 -2
  11. package/bundles/mis-crystal-design-system-dropdown.umd.min.js.map +1 -1
  12. package/bundles/mis-crystal-design-system-input.umd.js +4 -6
  13. package/bundles/mis-crystal-design-system-input.umd.js.map +1 -1
  14. package/bundles/mis-crystal-design-system-input.umd.min.js +1 -1
  15. package/bundles/mis-crystal-design-system-input.umd.min.js.map +1 -1
  16. package/bundles/mis-crystal-design-system-modal.umd.js.map +1 -1
  17. package/bundles/mis-crystal-design-system-radio-button.umd.js.map +1 -1
  18. package/bundles/mis-crystal-design-system-radio-button.umd.min.js.map +1 -1
  19. package/bundles/mis-crystal-design-system-table.umd.js.map +1 -1
  20. package/bundles/mis-crystal-design-system-toast.umd.js.map +1 -1
  21. package/dropdown/dropdown.component.d.ts +9 -2
  22. package/dropdown/mis-crystal-design-system-dropdown.metadata.json +1 -1
  23. package/esm2015/action-list/action-list.component.js +1 -1
  24. package/esm2015/dropdown/dropdown.component.js +13 -5
  25. package/esm2015/input/directives/input/input.directive.js +4 -6
  26. package/esm2015/input/mis-input.component.js +1 -1
  27. package/fesm2015/mis-crystal-design-system-action-list.js.map +1 -1
  28. package/fesm2015/mis-crystal-design-system-button.js.map +1 -1
  29. package/fesm2015/mis-crystal-design-system-datepicker_v2.js.map +1 -1
  30. package/fesm2015/mis-crystal-design-system-daterangepicker_v2.js.map +1 -1
  31. package/fesm2015/mis-crystal-design-system-drawer.js.map +1 -1
  32. package/fesm2015/mis-crystal-design-system-dropdown.js +12 -4
  33. package/fesm2015/mis-crystal-design-system-dropdown.js.map +1 -1
  34. package/fesm2015/mis-crystal-design-system-input.js +4 -6
  35. package/fesm2015/mis-crystal-design-system-input.js.map +1 -1
  36. package/fesm2015/mis-crystal-design-system-modal.js.map +1 -1
  37. package/fesm2015/mis-crystal-design-system-radio-button.js.map +1 -1
  38. package/fesm2015/mis-crystal-design-system-table.js.map +1 -1
  39. package/fesm2015/mis-crystal-design-system-toast.js.map +1 -1
  40. package/input/mis-crystal-design-system-input.metadata.json +1 -1
  41. package/input/mis-input.component.scss +9 -6
  42. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"mis-crystal-design-system-radio-button.js","sources":["../../../projects/mis-components/radio-button/radio-button.component.ts","../../../projects/mis-components/radio-button/radio-button.module.ts","../../../projects/mis-components/radio-button/mis-crystal-design-system-radio-button.ts"],"sourcesContent":["import { Component, Input, OnInit, Output, EventEmitter } from \"@angular/core\";\nimport { AbstractControl, FormControl } from \"@angular/forms\";\n\n@Component({\n selector: \"mis-radio\",\n templateUrl: \"./radio-button.component.html\",\n styleUrls: [\"./radio-button.component.scss\"]\n})\nexport class RadioButtonComponent implements OnInit {\n /** When multiple radio input fields are used\n * an \"id\" can be given to keep track of them */\n @Input() id: string | number = \"\";\n /** Name of the attribute for which the radio\n * selection is provided */\n @Input() name: string | number = \"\";\n /** Value of the attribute which is to be emitted\n * when selected */\n @Input() value: string | number = \"\";\n /** Controls the state of the radio button */\n @Input() disabled: boolean = false;\n\n /** Can be used to attach the radio input field\n * to a reactive form by passing in a\n * FormControl Object. It can also be\n * used to set the default attribute value */\n @Input() formControl: AbstractControl = new FormControl(null);\n\n /** Emits \"value\" of the radio button on selection */\n @Output() valueChange = new EventEmitter<any>();\n\n constructor() {}\n ngOnInit() {}\n onChange(event) {\n this.valueChange.emit(this.formControl.value);\n }\n}\n","import { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\n\nimport { RadioButtonComponent } from \"./radio-button.component\";\nimport { ReactiveFormsModule } from \"@angular/forms\";\n\n@NgModule({\n declarations: [RadioButtonComponent],\n imports: [CommonModule, ReactiveFormsModule],\n exports: [RadioButtonComponent]\n})\nexport class RadioButtonModule {\n static forRoot(): ModuleWithProviders<RadioButtonModule> {\n return { ngModule: RadioButtonModule, providers: [] };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAQa,oBAAoB;IAsB/B;;;QAnBS,OAAE,GAAoB,EAAE,CAAC;;;QAGzB,SAAI,GAAoB,EAAE,CAAC;;;QAG3B,UAAK,GAAoB,EAAE,CAAC;;QAE5B,aAAQ,GAAY,KAAK,CAAC;;;;;QAM1B,gBAAW,GAAoB,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;;QAGpD,gBAAW,GAAG,IAAI,YAAY,EAAO,CAAC;KAEhC;IAChB,QAAQ,MAAK;IACb,QAAQ,CAAC,KAAK;QACZ,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;KAC/C;;;YA/BF,SAAS,SAAC;gBACT,QAAQ,EAAE,WAAW;gBACrB,4KAA4C;;aAE7C;;;;iBAIE,KAAK;mBAGL,KAAK;oBAGL,KAAK;uBAEL,KAAK;0BAML,KAAK;0BAGL,MAAM;;;MCjBI,iBAAiB;IAC5B,OAAO,OAAO;QACZ,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;KACvD;;;YARF,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,oBAAoB,CAAC;gBACpC,OAAO,EAAE,CAAC,YAAY,EAAE,mBAAmB,CAAC;gBAC5C,OAAO,EAAE,CAAC,oBAAoB,CAAC;aAChC;;;ACVD;;;;;;"}
1
+ {"version":3,"file":"mis-crystal-design-system-radio-button.js","sources":["../../../projects/mis-components/radio-button/radio-button.component.ts","../../../projects/mis-components/radio-button/radio-button.module.ts","../../../projects/mis-components/radio-button/mis-crystal-design-system-radio-button.ts"],"sourcesContent":["import { Component, Input, OnInit, Output, EventEmitter } from \"@angular/core\";\nimport { AbstractControl, FormControl } from \"@angular/forms\";\n\n@Component({\n selector: \"mis-radio\",\n templateUrl: \"./radio-button.component.html\",\n styleUrls: [\"./radio-button.component.scss\"]\n})\nexport class RadioButtonComponent implements OnInit {\n /** When multiple radio input fields are used\n * an \"id\" can be given to keep track of them */\n @Input() id: string | number = \"\";\n /** Name of the attribute for which the radio\n * selection is provided */\n @Input() name: string | number = \"\";\n /** Value of the attribute which is to be emitted\n * when selected */\n @Input() value: string | number = \"\";\n /** Controls the state of the radio button */\n @Input() disabled: boolean = false;\n\n /** Can be used to attach the radio input field\n * to a reactive form by passing in a\n * “FormControl“ Object. It can also be\n * used to set the default attribute value */\n @Input() formControl: AbstractControl = new FormControl(null);\n\n /** Emits \"value\" of the radio button on selection */\n @Output() valueChange = new EventEmitter<any>();\n\n constructor() {}\n ngOnInit() {}\n onChange(event) {\n this.valueChange.emit(this.formControl.value);\n }\n}\n","import { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\n\nimport { RadioButtonComponent } from \"./radio-button.component\";\nimport { ReactiveFormsModule } from \"@angular/forms\";\n\n@NgModule({\n declarations: [RadioButtonComponent],\n imports: [CommonModule, ReactiveFormsModule],\n exports: [RadioButtonComponent]\n})\nexport class RadioButtonModule {\n static forRoot(): ModuleWithProviders<RadioButtonModule> {\n return { ngModule: RadioButtonModule, providers: [] };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAQa,oBAAoB;IAsB/B;;;QAnBS,OAAE,GAAoB,EAAE,CAAC;;;QAGzB,SAAI,GAAoB,EAAE,CAAC;;;QAG3B,UAAK,GAAoB,EAAE,CAAC;;QAE5B,aAAQ,GAAY,KAAK,CAAC;;;;;QAM1B,gBAAW,GAAoB,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;;QAGpD,gBAAW,GAAG,IAAI,YAAY,EAAO,CAAC;KAEhC;IAChB,QAAQ,MAAK;IACb,QAAQ,CAAC,KAAK;QACZ,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;KAC/C;;;YA/BF,SAAS,SAAC;gBACT,QAAQ,EAAE,WAAW;gBACrB,4KAA4C;;aAE7C;;;;iBAIE,KAAK;mBAGL,KAAK;oBAGL,KAAK;uBAEL,KAAK;0BAML,KAAK;0BAGL,MAAM;;;MCjBI,iBAAiB;IAC5B,OAAO,OAAO;QACZ,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;KACvD;;;YARF,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,oBAAoB,CAAC;gBACpC,OAAO,EAAE,CAAC,YAAY,EAAE,mBAAmB,CAAC;gBAC5C,OAAO,EAAE,CAAC,oBAAoB,CAAC;aAChC;;;ACVD;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"mis-crystal-design-system-table.js","sources":["../../../projects/mis-components/table/table.component.ts","../../../projects/mis-components/table/custom-table-cell.directive.ts","../../../projects/mis-components/table/sub-table/sub-table.component.ts","../../../projects/mis-components/table/filter/filter.component.ts","../../../projects/mis-components/table/table.module.ts","../../../projects/mis-components/table/mis-crystal-design-system-table.ts"],"sourcesContent":["import {\n AfterViewInit,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnInit,\n Output,\n QueryList,\n Renderer2,\n ViewChild,\n ViewChildren\n} from \"@angular/core\";\nimport { Filter, TableFilterComponent } from \"./filter/filter.component\";\n\n@Component({\n selector: \"mis-table\",\n templateUrl: \"table.component.html\",\n styleUrls: [\"table.component.css\"]\n})\nexport class TableComponent implements OnInit, AfterViewInit {\n // Filter related variables\n showFilter: boolean = false;\n filterName: string = \"\";\n filterData: Array<Filter> = [];\n filterContainerStyles: any = {};\n appliedFilters: { [key: string]: Array<{ name: string; value: string }> } = {};\n @Output() filtersUpdated = new EventEmitter<{\n [key: string]: Array<{ name: string; value: string }>;\n }>();\n\n @ViewChild(\"filter\") filter: TableFilterComponent | any;\n @ViewChildren(\"colHeaderRef\") colHeaders: QueryList<ElementRef> | any;\n\n // Pagination related variables\n pages: Array<number> = [];\n tableLength: number;\n @Output() pageSelected = new EventEmitter<number>();\n\n @Input(\"tableConfig\") config: TableConfig | any;\n @Input() subTableconfig: TableConfig | any;\n @Input() tableDataLoading: boolean | any;\n @Input() expandedIndex: number | any;\n @Input() tableData: Array<Array<any>> = [];\n @Input() subTableData: Array<Array<any>> = [];\n @Input() subTableDataLoading: boolean | any;\n @ViewChild(\"table\") table: ElementRef | any;\n\n constructor(private renderer: Renderer2) {}\n\n ngOnInit(): void {\n this.tableLength = [].concat(...this.tableData).length;\n this.initializeFilters();\n if (this.config.paginationConfig) {\n this.initializePagination();\n }\n if (this.config.canScrollHorizontally === undefined) {\n this.config.canScrollHorizontally = false;\n }\n document.addEventListener(\"click\", event => {\n if (this.filter) {\n let isCheckBoxClicked = true;\n let targetElement = event.target as HTMLSpanElement;\n if (targetElement.className === \"checkmark\") {\n isCheckBoxClicked = true;\n this.showFilter = true;\n }\n let isClickInsideElement = this.filter.container.nativeElement.contains(event.target);\n if (!isClickInsideElement && !isCheckBoxClicked) {\n this.toggleFilter(this.filterName);\n }\n }\n });\n }\n ngAfterViewInit() {\n if (this.config.paginationConfig) {\n let height = this.table.nativeElement.offsetHeight;\n this.renderer.setStyle(this.table.nativeElement, \"height\", height - 56 + \"px\");\n }\n }\n\n // Filter related functions\n initializeFilters() {\n for (let colHeader of this.config?.colHeaderConfig) {\n if (colHeader.filters) {\n let filters = [];\n for (let filter of colHeader.filters) {\n if (filter.checked) {\n filters.push({\n name: filter.name,\n value: filter.value\n });\n }\n }\n if (filters.length > 0) this.appliedFilters[colHeader.data] = filters;\n }\n }\n }\n toggleFilter(filterName: string) {\n if (!this.showFilter) {\n this.filterName = filterName;\n this.showFilter = true;\n\n let offSet = 0;\n let colHeadersReversed = this.colHeaders.toArray().reverse();\n\n for (let header of colHeadersReversed) {\n if (header.nativeElement.innerText === filterName) break;\n offSet += header.nativeElement.offsetWidth;\n }\n this.filterContainerStyles = {\n top: \"44px\",\n right: offSet > 0 ? offSet - 116 + \"px\" : \"12px\"\n };\n } else {\n this.filterName = \"\";\n this.filterData = [];\n this.showFilter = false;\n }\n }\n updateAppliedFilters(appliedFilters: Array<{ name: string; value: string }>) {\n if (appliedFilters.length == 0) {\n delete this.appliedFilters[this.filterName];\n } else {\n this.appliedFilters[this.filterName] = appliedFilters;\n }\n this.filtersUpdated.emit({ ...this.appliedFilters });\n this.toggleFilter(this.filterName);\n }\n\n // Pagination related functions\n initializePagination() {\n if (this.config.paginationConfig) {\n let len = this.config.paginationConfig.noOfPages;\n if (len <= 7) {\n for (let i = 1; i <= len; i++) {\n this.pages.push(i);\n }\n } else {\n this.pages = [1, 2, 3, 4, 0, len];\n }\n }\n }\n updateSelectedPage(pageNumber: number) {\n if (pageNumber < 1 || pageNumber > this.config.paginationConfig.noOfPages) return;\n this.config.paginationConfig.selectedPage = pageNumber;\n let len = this.config.paginationConfig.noOfPages;\n if (len > 7) {\n if (pageNumber - 2 <= 1) {\n this.pages = [1, 2, 3, 4, 0, len];\n } else if (pageNumber - 2 > 1 && pageNumber + 2 < len) {\n this.pages = [1, 0, pageNumber - 1, pageNumber, pageNumber + 1, 0, len];\n } else if (pageNumber + 2 >= len) {\n this.pages = [1, 0, len - 3, len - 2, len - 1, len];\n }\n }\n this.pageSelected.emit(this.config.paginationConfig?.selectedPage);\n }\n\n // Main container related functions\n getContainerHeight() {\n if (this.config?.height) return this.config.height;\n else return \"\";\n }\n getContainerWidth() {\n if (this.config?.width) return this.config.width;\n else return \"\";\n }\n\n // Column Headers related functions\n getColHeadersRowHeight() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.height) {\n return this.config.colHeadersRowConfig.height;\n } else return \"44px\";\n }\n getColHeadersRowBorderTop() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.style?.borderTop) {\n return this.config.colHeadersRowConfig.style?.borderTop;\n } else return \"\";\n }\n getColHeadersRowBorderBottom() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.style?.borderBottom) {\n return this.config.colHeadersRowConfig.style?.borderBottom;\n } else return \"1px solid #E0E0E0\";\n }\n}\n\nexport interface TableConfig {\n height: string | \"100%\";\n width: string | \"100%\";\n paginationConfig?: PaginationConfig | undefined | null;\n colHeadersRowConfig: RowConfig | undefined | null;\n rowConfig: RowConfig | undefined | null;\n colHeaderConfig: Array<ColHeaderConfig>;\n colConfig: Array<ColConfig>;\n canExpand?: boolean;\n canScrollHorizontally?: boolean;\n cellHover?: boolean;\n}\nexport interface PaginationConfig {\n noOfPages: number;\n rowsPerPage: number;\n totalNoOfRows: number;\n selectedPage?: number;\n}\nexport interface RowConfig {\n height?: string | undefined | null;\n style?: {};\n}\nexport interface ColHeaderConfig {\n type: \"text\" | \"number\" | \"custom\";\n data: any;\n componentRef?: any;\n filters?: Array<Filter> | null;\n style?: {};\n action?: any;\n}\nexport interface ColConfig {\n type: \"text\" | \"number\" | \"custom\";\n componentRef?: any;\n style?: {};\n action?: any;\n}\n","import { ComponentFactoryResolver, Directive, Input, ViewContainerRef } from \"@angular/core\";\n\n@Directive({\n selector: \"[customTableCell]\"\n})\nexport class CustomTableCellDirective {\n private ref: any;\n private component: any;\n private cellData: any;\n\n @Input() set customComponent(value: any) {\n this.component = value;\n this.createComponent();\n }\n @Input() set data(value: any) {\n this.cellData = value;\n if (this.ref) {\n this.ref.instance.data = this.cellData;\n }\n }\n\n constructor(private viewContainerRef: ViewContainerRef, private componentFactoryResolver: ComponentFactoryResolver) {}\n\n createComponent() {\n if (this.component) {\n const cmpFactoryResolver = this.componentFactoryResolver.resolveComponentFactory(this.component);\n this.viewContainerRef.clear();\n this.ref = this.viewContainerRef.createComponent(cmpFactoryResolver);\n this.setData();\n }\n }\n setData() {\n this.ref.instance.data = this.cellData;\n }\n}\n","import { AfterViewInit, Component, ElementRef, Input, OnInit, Renderer2, ViewChild } from \"@angular/core\";\n\n@Component({\n selector: \"sub-table\",\n templateUrl: \"sub-table.component.html\",\n styleUrls: [\"sub-table.component.css\"]\n})\nexport class SubTableComponent implements OnInit, AfterViewInit {\n selectedPage = 1;\n pages: Array<number> = [];\n\n @Input() config: SubTableConfig | any;\n @Input() tableData: Array<Array<any>> = [];\n @ViewChild(\"table\") table: ElementRef | any;\n constructor(private renderer: Renderer2) {}\n\n ngOnInit() {}\n\n ngAfterViewInit() {\n if (this.config.paginationConfig) {\n let height = this.table.nativeElement.offsetHeight;\n this.renderer.setStyle(this.table.nativeElement, \"height\", height - 56 + \"px\");\n }\n }\n\n // Main container related functions\n getContainerHeight() {\n if (this.config.height) return this.config.height;\n else return \"\";\n }\n getContainerWidth() {\n if (this.config.width) return this.config.width;\n else return \"\";\n }\n\n // Column Headers related functions\n getColHeadersRowHeight() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.height) {\n return this.config.colHeadersRowConfig.height;\n } else return \"44px\";\n }\n getColHeadersRowBorderTop() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.style?.borderTop) {\n return this.config.colHeadersRowConfig.style?.borderTop;\n } else return \"\";\n }\n getColHeadersRowBorderBottom() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.style?.borderBottom) {\n return this.config.colHeadersRowConfig.style?.borderBottom;\n } else return \"1px solid #E0E0E0\";\n }\n}\n\nexport interface SubTableConfig {\n height: string | \"100%\";\n width: string | \"100%\";\n dataContainerMaxHeight: string | \"400px\";\n showHeader?: boolean | undefined;\n rowConfig: SubTableRowConfig | undefined | null;\n colHeaderConfig?: Array<SubTableColHeaderConfig>;\n colConfig: Array<SubTableColConfig>;\n}\n\nexport interface SubTableRowConfig {\n height?: string | undefined | null;\n style?: {};\n}\nexport interface SubTableColHeaderConfig {\n type: \"text\" | \"number\" | \"custom\";\n data: any;\n componentRef?: any;\n style?: {};\n action?: any;\n}\nexport interface SubTableColConfig {\n type: \"text\" | \"number\" | \"custom\";\n componentRef?: any;\n style?: {};\n action?: any;\n}\n","import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from \"@angular/core\";\n\n@Component({\n selector: \"mis-table-filter\",\n templateUrl: \"filter.component.html\",\n styleUrls: [\"filter.component.css\"]\n})\nexport class TableFilterComponent implements OnInit {\n @Input() filtersData: Array<Filter> = [];\n @Input() containerStyles: any = {};\n\n @Output() filtersApplied = new EventEmitter<any>();\n\n @ViewChild(\"mainContainer\") container: ElementRef | undefined;\n\n filtersMap: any = {};\n searchValue: string = \"\";\n\n constructor() {}\n\n ngOnInit(): void {\n this.filtersData.forEach(filter => {\n this.filtersMap[filter.value] = filter;\n });\n }\n resetFilters() {\n this.filtersData.forEach(filter => {\n this.filtersMap[filter.value].checked = false;\n });\n this.filtersApplied.emit([]);\n }\n applyFilters() {\n let list = Object.values(this.filtersMap)\n .filter((filter: Filter | any) => filter.checked)\n .map((filter: Filter | any) => {\n return {\n name: filter.name,\n value: filter.value\n };\n });\n this.filtersApplied.emit(list);\n }\n updateSearchValue(event: any) {\n this.searchValue = event.target.value;\n }\n updateFilter(data: any) {\n if (this.filtersMap[data.name]) {\n this.filtersMap[data.name].checked = !this.filtersMap[data.name].checked;\n }\n }\n getFiltersBasedOnSearchValue(): Filter[] | any {\n let list = Object.values(this.filtersMap);\n list = list.filter((filter: Filter | any) => {\n return filter.name.match(new RegExp(this.searchValue, \"i\"));\n });\n return list.sort(this.mySort);\n }\n getCheckedFilters(): Filter[] | any {\n let list = Object.values(this.filtersMap);\n list = list.filter((filter: Filter | any) => filter.checked).sort(this.mySort);\n return list;\n }\n mySort = (a: Filter | any, b: Filter | any) => {\n if (a.name < b.name) return -1;\n else if (b.name < a.name) return 1;\n else return 0;\n };\n}\nexport interface Filter {\n name: string;\n value: string;\n checked: boolean;\n}\n","import { ModuleWithProviders, NgModule } from \"@angular/core\";\nimport { TableComponent } from \"./table.component\";\nimport { CustomTableCellDirective } from \"./custom-table-cell.directive\";\nimport { SubTableComponent } from \"./sub-table/sub-table.component\";\nimport { CommonModule } from \"@angular/common\";\nimport { TableFilterComponent } from \"./filter/filter.component\";\nimport { CheckboxModule } from \"mis-crystal-design-system/checkbox\";\nimport { ScrollingModule } from \"@angular/cdk/scrolling\";\n\n@NgModule({\n declarations: [TableComponent, SubTableComponent, TableFilterComponent, CustomTableCellDirective],\n imports: [CommonModule, CheckboxModule, ScrollingModule],\n exports: [TableComponent, SubTableComponent, TableFilterComponent, CustomTableCellDirective]\n})\nexport class TableModule {\n static forRoot(): ModuleWithProviders<TableModule> {\n return { ngModule: TableModule, providers: [] };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {SubTableComponent as ɵa} from './sub-table/sub-table.component';"],"names":[],"mappings":";;;;;MAoBa,cAAc;IA4BzB,YAAoB,QAAmB;QAAnB,aAAQ,GAAR,QAAQ,CAAW;;QA1BvC,eAAU,GAAY,KAAK,CAAC;QAC5B,eAAU,GAAW,EAAE,CAAC;QACxB,eAAU,GAAkB,EAAE,CAAC;QAC/B,0BAAqB,GAAQ,EAAE,CAAC;QAChC,mBAAc,GAA8D,EAAE,CAAC;QACrE,mBAAc,GAAG,IAAI,YAAY,EAEvC,CAAC;;QAML,UAAK,GAAkB,EAAE,CAAC;QAEhB,iBAAY,GAAG,IAAI,YAAY,EAAU,CAAC;QAM3C,cAAS,GAAsB,EAAE,CAAC;QAClC,iBAAY,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ACD,4BAA4B;QAC1B,IAAI,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1C,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,MAAoB;YACtC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC;SAC7D,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAC/B;IACD,iBAAiB;QACf,IAAI,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1C,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,MAAoB,KAAK,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/E,OAAO,IAAI,CAAC;KACb;;;YA3DF,SAAS,SAAC;gBACT,QAAQ,EAAE,kBAAkB;gBAC5B,6/EAAoC;;aAErC;;;;0BAEE,KAAK;8BACL,KAAK;6BAEL,MAAM;wBAEN,SAAS,SAAC,eAAe;;;MCCf,WAAW;IACtB,OAAO,OAAO;QACZ,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;KACjD;;;YARF,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,wBAAwB,CAAC;gBACjG,OAAO,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,eAAe,CAAC;gBACxD,OAAO,EAAE,CAAC,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,wBAAwB,CAAC;aAC7F;;;ACbD;;;;;;"}
1
+ {"version":3,"file":"mis-crystal-design-system-table.js","sources":["../../../projects/mis-components/table/table.component.ts","../../../projects/mis-components/table/custom-table-cell.directive.ts","../../../projects/mis-components/table/sub-table/sub-table.component.ts","../../../projects/mis-components/table/filter/filter.component.ts","../../../projects/mis-components/table/table.module.ts","../../../projects/mis-components/table/mis-crystal-design-system-table.ts"],"sourcesContent":["import {\n AfterViewInit,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnInit,\n Output,\n QueryList,\n Renderer2,\n ViewChild,\n ViewChildren\n} from \"@angular/core\";\nimport { Filter, TableFilterComponent } from \"./filter/filter.component\";\n\n@Component({\n selector: \"mis-table\",\n templateUrl: \"table.component.html\",\n styleUrls: [\"table.component.css\"]\n})\nexport class TableComponent implements OnInit, AfterViewInit {\n // Filter related variables\n showFilter: boolean = false;\n filterName: string = \"\";\n filterData: Array<Filter> = [];\n filterContainerStyles: any = {};\n appliedFilters: { [key: string]: Array<{ name: string; value: string }> } = {};\n @Output() filtersUpdated = new EventEmitter<{\n [key: string]: Array<{ name: string; value: string }>;\n }>();\n\n @ViewChild(\"filter\") filter: TableFilterComponent | any;\n @ViewChildren(\"colHeaderRef\") colHeaders: QueryList<ElementRef> | any;\n\n // Pagination related variables\n pages: Array<number> = [];\n tableLength: number;\n @Output() pageSelected = new EventEmitter<number>();\n\n @Input(\"tableConfig\") config: TableConfig | any;\n @Input() subTableconfig: TableConfig | any;\n @Input() tableDataLoading: boolean | any;\n @Input() expandedIndex: number | any;\n @Input() tableData: Array<Array<any>> = [];\n @Input() subTableData: Array<Array<any>> = [];\n @Input() subTableDataLoading: boolean | any;\n @ViewChild(\"table\") table: ElementRef | any;\n\n constructor(private renderer: Renderer2) {}\n\n ngOnInit(): void {\n this.tableLength = [].concat(...this.tableData).length;\n this.initializeFilters();\n if (this.config.paginationConfig) {\n this.initializePagination();\n }\n if (this.config.canScrollHorizontally === undefined) {\n this.config.canScrollHorizontally = false;\n }\n document.addEventListener(\"click\", event => {\n if (this.filter) {\n let isCheckBoxClicked = true;\n let targetElement = event.target as HTMLSpanElement;\n if (targetElement.className === \"checkmark\") {\n isCheckBoxClicked = true;\n this.showFilter = true;\n }\n let isClickInsideElement = this.filter.container.nativeElement.contains(event.target);\n if (!isClickInsideElement && !isCheckBoxClicked) {\n this.toggleFilter(this.filterName);\n }\n }\n });\n }\n ngAfterViewInit() {\n if (this.config.paginationConfig) {\n let height = this.table.nativeElement.offsetHeight;\n this.renderer.setStyle(this.table.nativeElement, \"height\", height - 56 + \"px\");\n }\n }\n\n // Filter related functions\n initializeFilters() {\n for (let colHeader of this.config?.colHeaderConfig) {\n if (colHeader.filters) {\n let filters = [];\n for (let filter of colHeader.filters) {\n if (filter.checked) {\n filters.push({\n name: filter.name,\n value: filter.value\n });\n }\n }\n if (filters.length > 0) this.appliedFilters[colHeader.data] = filters;\n }\n }\n }\n toggleFilter(filterName: string) {\n if (!this.showFilter) {\n this.filterName = filterName;\n this.showFilter = true;\n\n let offSet = 0;\n let colHeadersReversed = this.colHeaders.toArray().reverse();\n\n for (let header of colHeadersReversed) {\n if (header.nativeElement.innerText === filterName) break;\n offSet += header.nativeElement.offsetWidth;\n }\n this.filterContainerStyles = {\n top: \"44px\",\n right: offSet > 0 ? offSet - 116 + \"px\" : \"12px\"\n };\n } else {\n this.filterName = \"\";\n this.filterData = [];\n this.showFilter = false;\n }\n }\n updateAppliedFilters(appliedFilters: Array<{ name: string; value: string }>) {\n if (appliedFilters.length == 0) {\n delete this.appliedFilters[this.filterName];\n } else {\n this.appliedFilters[this.filterName] = appliedFilters;\n }\n this.filtersUpdated.emit({ ...this.appliedFilters });\n this.toggleFilter(this.filterName);\n }\n\n // Pagination related functions\n initializePagination() {\n if (this.config.paginationConfig) {\n let len = this.config.paginationConfig.noOfPages;\n if (len <= 7) {\n for (let i = 1; i <= len; i++) {\n this.pages.push(i);\n }\n } else {\n this.pages = [1, 2, 3, 4, 0, len];\n }\n }\n }\n updateSelectedPage(pageNumber: number) {\n if (pageNumber < 1 || pageNumber > this.config.paginationConfig.noOfPages) return;\n this.config.paginationConfig.selectedPage = pageNumber;\n let len = this.config.paginationConfig.noOfPages;\n if (len > 7) {\n if (pageNumber - 2 <= 1) {\n this.pages = [1, 2, 3, 4, 0, len];\n } else if (pageNumber - 2 > 1 && pageNumber + 2 < len) {\n this.pages = [1, 0, pageNumber - 1, pageNumber, pageNumber + 1, 0, len];\n } else if (pageNumber + 2 >= len) {\n this.pages = [1, 0, len - 3, len - 2, len - 1, len];\n }\n }\n this.pageSelected.emit(this.config.paginationConfig?.selectedPage);\n }\n\n // Main container related functions\n getContainerHeight() {\n if (this.config?.height) return this.config.height;\n else return \"\";\n }\n getContainerWidth() {\n if (this.config?.width) return this.config.width;\n else return \"\";\n }\n\n // Column Headers related functions\n getColHeadersRowHeight() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.height) {\n return this.config.colHeadersRowConfig.height;\n } else return \"44px\";\n }\n getColHeadersRowBorderTop() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.style?.borderTop) {\n return this.config.colHeadersRowConfig.style?.borderTop;\n } else return \"\";\n }\n getColHeadersRowBorderBottom() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.style?.borderBottom) {\n return this.config.colHeadersRowConfig.style?.borderBottom;\n } else return \"1px solid #E0E0E0\";\n }\n}\n\nexport interface TableConfig {\n height: string | \"100%\";\n width: string | \"100%\";\n paginationConfig?: PaginationConfig | undefined | null;\n colHeadersRowConfig: RowConfig | undefined | null;\n rowConfig: RowConfig | undefined | null;\n colHeaderConfig: Array<ColHeaderConfig>;\n colConfig: Array<ColConfig>;\n canExpand?: boolean;\n canScrollHorizontally?: boolean;\n cellHover?: boolean;\n}\nexport interface PaginationConfig {\n noOfPages: number;\n rowsPerPage: number;\n totalNoOfRows: number;\n selectedPage?: number;\n}\nexport interface RowConfig {\n height?: string | undefined | null;\n style?: {};\n}\nexport interface ColHeaderConfig {\n type: \"text\" | \"number\" | \"custom\";\n data: any;\n componentRef?: any;\n filters?: Array<Filter> | null;\n style?: {};\n action?: any;\n}\nexport interface ColConfig {\n type: \"text\" | \"number\" | \"custom\";\n componentRef?: any;\n style?: {};\n action?: any;\n}\n","import { ComponentFactoryResolver, Directive, Input, ViewContainerRef } from \"@angular/core\";\n\n@Directive({\n selector: \"[customTableCell]\"\n})\nexport class CustomTableCellDirective {\n private ref: any;\n private component: any;\n private cellData: any;\n\n @Input() set customComponent(value: any) {\n this.component = value;\n this.createComponent();\n }\n @Input() set data(value: any) {\n this.cellData = value;\n if (this.ref) {\n this.ref.instance.data = this.cellData;\n }\n }\n\n constructor(private viewContainerRef: ViewContainerRef, private componentFactoryResolver: ComponentFactoryResolver) {}\n\n createComponent() {\n if (this.component) {\n const cmpFactoryResolver = this.componentFactoryResolver.resolveComponentFactory(this.component);\n this.viewContainerRef.clear();\n this.ref = this.viewContainerRef.createComponent(cmpFactoryResolver);\n this.setData();\n }\n }\n setData() {\n this.ref.instance.data = this.cellData;\n }\n}\n","import { AfterViewInit, Component, ElementRef, Input, OnInit, Renderer2, ViewChild } from \"@angular/core\";\n\n@Component({\n selector: \"sub-table\",\n templateUrl: \"sub-table.component.html\",\n styleUrls: [\"sub-table.component.css\"]\n})\nexport class SubTableComponent implements OnInit, AfterViewInit {\n selectedPage = 1;\n pages: Array<number> = [];\n\n @Input() config: SubTableConfig | any;\n @Input() tableData: Array<Array<any>> = [];\n @ViewChild(\"table\") table: ElementRef | any;\n constructor(private renderer: Renderer2) {}\n\n ngOnInit() {}\n\n ngAfterViewInit() {\n if (this.config.paginationConfig) {\n let height = this.table.nativeElement.offsetHeight;\n this.renderer.setStyle(this.table.nativeElement, \"height\", height - 56 + \"px\");\n }\n }\n\n // Main container related functions\n getContainerHeight() {\n if (this.config.height) return this.config.height;\n else return \"\";\n }\n getContainerWidth() {\n if (this.config.width) return this.config.width;\n else return \"\";\n }\n\n // Column Headers related functions\n getColHeadersRowHeight() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.height) {\n return this.config.colHeadersRowConfig.height;\n } else return \"44px\";\n }\n getColHeadersRowBorderTop() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.style?.borderTop) {\n return this.config.colHeadersRowConfig.style?.borderTop;\n } else return \"\";\n }\n getColHeadersRowBorderBottom() {\n if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.style?.borderBottom) {\n return this.config.colHeadersRowConfig.style?.borderBottom;\n } else return \"1px solid #E0E0E0\";\n }\n}\n\nexport interface SubTableConfig {\n height: string | \"100%\";\n width: string | \"100%\";\n dataContainerMaxHeight: string | \"400px\";\n showHeader?: boolean | undefined;\n rowConfig: SubTableRowConfig | undefined | null;\n colHeaderConfig?: Array<SubTableColHeaderConfig>;\n colConfig: Array<SubTableColConfig>;\n}\n\nexport interface SubTableRowConfig {\n height?: string | undefined | null;\n style?: {};\n}\nexport interface SubTableColHeaderConfig {\n type: \"text\" | \"number\" | \"custom\";\n data: any;\n componentRef?: any;\n style?: {};\n action?: any;\n}\nexport interface SubTableColConfig {\n type: \"text\" | \"number\" | \"custom\";\n componentRef?: any;\n style?: {};\n action?: any;\n}\n","import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from \"@angular/core\";\n\n@Component({\n selector: \"mis-table-filter\",\n templateUrl: \"filter.component.html\",\n styleUrls: [\"filter.component.css\"]\n})\nexport class TableFilterComponent implements OnInit {\n @Input() filtersData: Array<Filter> = [];\n @Input() containerStyles: any = {};\n\n @Output() filtersApplied = new EventEmitter<any>();\n\n @ViewChild(\"mainContainer\") container: ElementRef | undefined;\n\n filtersMap: any = {};\n searchValue: string = \"\";\n\n constructor() {}\n\n ngOnInit(): void {\n this.filtersData.forEach(filter => {\n this.filtersMap[filter.value] = filter;\n });\n }\n resetFilters() {\n this.filtersData.forEach(filter => {\n this.filtersMap[filter.value].checked = false;\n });\n this.filtersApplied.emit([]);\n }\n applyFilters() {\n let list = Object.values(this.filtersMap)\n .filter((filter: Filter | any) => filter.checked)\n .map((filter: Filter | any) => {\n return {\n name: filter.name,\n value: filter.value\n };\n });\n this.filtersApplied.emit(list);\n }\n updateSearchValue(event: any) {\n this.searchValue = event.target.value;\n }\n updateFilter(data: any) {\n if (this.filtersMap[data.name]) {\n this.filtersMap[data.name].checked = !this.filtersMap[data.name].checked;\n }\n }\n getFiltersBasedOnSearchValue(): Filter[] | any {\n let list = Object.values(this.filtersMap);\n list = list.filter((filter: Filter | any) => {\n return filter.name.match(new RegExp(this.searchValue, \"i\"));\n });\n return list.sort(this.mySort);\n }\n getCheckedFilters(): Filter[] | any {\n let list = Object.values(this.filtersMap);\n list = list.filter((filter: Filter | any) => filter.checked).sort(this.mySort);\n return list;\n }\n mySort = (a: Filter | any, b: Filter | any) => {\n if (a.name < b.name) return -1;\n else if (b.name < a.name) return 1;\n else return 0;\n };\n}\nexport interface Filter {\n name: string;\n value: string;\n checked: boolean;\n}\n","import { ModuleWithProviders, NgModule } from \"@angular/core\";\nimport { TableComponent } from \"./table.component\";\nimport { CustomTableCellDirective } from \"./custom-table-cell.directive\";\nimport { SubTableComponent } from \"./sub-table/sub-table.component\";\nimport { CommonModule } from \"@angular/common\";\nimport { TableFilterComponent } from \"./filter/filter.component\";\nimport { CheckboxModule } from \"mis-crystal-design-system/checkbox\";\nimport { ScrollingModule } from \"@angular/cdk/scrolling\";\n\n@NgModule({\n declarations: [TableComponent, SubTableComponent, TableFilterComponent, CustomTableCellDirective],\n imports: [CommonModule, CheckboxModule, ScrollingModule],\n exports: [TableComponent, SubTableComponent, TableFilterComponent, CustomTableCellDirective]\n})\nexport class TableModule {\n static forRoot(): ModuleWithProviders<TableModule> {\n return { ngModule: TableModule, providers: [] };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {SubTableComponent as ɵa} from './sub-table/sub-table.component';"],"names":[],"mappings":";;;;;MAoBa,cAAc;IA4BzB,YAAoB,QAAmB;QAAnB,aAAQ,GAAR,QAAQ,CAAW;;QA1BvC,eAAU,GAAY,KAAK,CAAC;QAC5B,eAAU,GAAW,EAAE,CAAC;QACxB,eAAU,GAAkB,EAAE,CAAC;QAC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Ac,EAAE,eAAe,CAAC;gBACxD,OAAO,EAAE,CAAC,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,wBAAwB,CAAC;aAC7F;;;ACbD;;;;;;"}
@@ -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\nexport {ToastComponent as ɵa} from './toast.component';"],"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,IAA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AAC;gBACT,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC;gBAC5C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE;oBAC3B,IAAI,CAAC,iBAAiB,EAAE,CAAC;iBAC1B;;aAEF,EAAE,OAAO,GAAG,GAAG,CAAC,CAAC;SACnB,CAAC,CACH,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,SAAQ,CAAC,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;;;;;;"}
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\nexport {ToastComponent as ɵa} from './toast.component';"],"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,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,SAAQ,CAAC,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;;;;;;"}
@@ -1 +1 @@
1
- {"__symbolic":"module","version":4,"metadata":{"MisInputDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":5,"character":1},"arguments":[{"selector":"input[misInput]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Self","line":10,"character":38}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":10,"character":46}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":10,"character":25},{"__symbolic":"reference","module":"@angular/forms","name":"NgControl","line":10,"character":74}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}},"MisInputComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":4,"character":1},"arguments":[{"selector":"mis-input","template":"<div\n [class]=\"'input-container ' + size\"\n [ngClass]=\"{\n rounded: type === 'rounded',\n floating: type === 'floating',\n 'has-error': !inputValidity || hasError,\n 'no-hint': noHints\n }\"\n>\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>\n","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.sm input{padding:0}.input-container.rounded.md input{padding:6px 0}.input-container.rounded.lg input{padding:12px 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:focus-within{border:1px solid #0937b2}.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}"]}]}],"members":{"type":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":10,"character":3}}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":11,"character":3}}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":12,"character":3}}]}],"noHints":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}}]}],"hasError":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":14,"character":3}}]}],"formInput":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":15,"character":3},"arguments":[{"__symbolic":"reference","name":"MisInputDirective"}]}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}},"MisInputModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":6,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"MisInputComponent"},{"__symbolic":"reference","name":"MisInputDirective"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":8,"character":12},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":8,"character":26}],"exports":[{"__symbolic":"reference","name":"MisInputComponent"},{"__symbolic":"reference","name":"MisInputDirective"}]}]}],"members":{}}},"origins":{"MisInputDirective":"./directives/input/input.directive","MisInputComponent":"./mis-input.component","MisInputModule":"./mis-input.module"},"importAs":"mis-crystal-design-system/input"}
1
+ {"__symbolic":"module","version":4,"metadata":{"MisInputDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":5,"character":1},"arguments":[{"selector":"input[misInput]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Self","line":10,"character":38}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":10,"character":46}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":10,"character":25},{"__symbolic":"reference","module":"@angular/forms","name":"NgControl","line":10,"character":74}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}},"MisInputComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":4,"character":1},"arguments":[{"selector":"mis-input","template":"<div\n [class]=\"'input-container ' + size\"\n [ngClass]=\"{\n rounded: type === 'rounded',\n floating: type === 'floating',\n 'has-error': !inputValidity || hasError,\n 'no-hint': noHints\n }\"\n>\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>\n","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.sm input{padding:3px 16px}.input-container.rounded.md input{padding:9px 16px}.input-container.rounded.lg input{padding:15px 16px}.input-container.rounded .input-wrapper{border-radius:4px;border:1px solid #e0e0e0;padding:0}.input-container.rounded .input-wrapper input:not(:disabled):focus,.input-container.rounded .input-wrapper input:not(:disabled):hover{background-color:#f5f5f5}.input-container.rounded .input-wrapper:focus-within{border:1px solid #0937b2}.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}"]}]}],"members":{"type":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":10,"character":3}}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":11,"character":3}}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":12,"character":3}}]}],"noHints":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}}]}],"hasError":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":14,"character":3}}]}],"formInput":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":15,"character":3},"arguments":[{"__symbolic":"reference","name":"MisInputDirective"}]}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}},"MisInputModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":6,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"MisInputComponent"},{"__symbolic":"reference","name":"MisInputDirective"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":8,"character":12},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":8,"character":26}],"exports":[{"__symbolic":"reference","name":"MisInputComponent"},{"__symbolic":"reference","name":"MisInputDirective"}]}]}],"members":{}}},"origins":{"MisInputDirective":"./directives/input/input.directive","MisInputComponent":"./mis-input.component","MisInputModule":"./mis-input.module"},"importAs":"mis-crystal-design-system/input"}
@@ -80,25 +80,28 @@
80
80
  &.rounded {
81
81
  &.sm {
82
82
  input {
83
- padding: 0;
83
+ padding: 3px 16px;
84
84
  }
85
85
  }
86
86
  &.md {
87
87
  input {
88
- padding: 6px 0;
88
+ padding: 9px 16px;
89
89
  }
90
90
  }
91
91
  &.lg {
92
92
  input {
93
- padding: 12px 0;
93
+ padding: 15px 16px;
94
94
  }
95
95
  }
96
96
  .input-wrapper {
97
97
  border-radius: 4px;
98
98
  border: 1px solid #e0e0e0;
99
- &:hover,
100
- &:focus-within {
101
- background-color: #f5f5f5;
99
+ padding: 0;
100
+ input:not(:disabled) {
101
+ &:hover,
102
+ &:focus {
103
+ background-color: #f5f5f5;
104
+ }
102
105
  }
103
106
  &:focus-within {
104
107
  border: 1px solid #0937b2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mis-crystal-design-system",
3
- "version": "2.6.3",
3
+ "version": "2.6.5-testing",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "*",
6
6
  "@angular/core": "*",