mis-crystal-design-system 2.4.4 → 2.4.7
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-datepicker_v2.umd.js +24 -10
- package/bundles/mis-crystal-design-system-datepicker_v2.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-datepicker_v2.umd.min.js +2 -2
- package/bundles/mis-crystal-design-system-datepicker_v2.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-daterangepicker_v2.umd.js +17 -26
- package/bundles/mis-crystal-design-system-daterangepicker_v2.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-daterangepicker_v2.umd.min.js +2 -2
- package/bundles/mis-crystal-design-system-daterangepicker_v2.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-table.umd.js +12 -8
- package/bundles/mis-crystal-design-system-table.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-table.umd.min.js +1 -1
- package/bundles/mis-crystal-design-system-table.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-tooltip.umd.js +86 -120
- package/bundles/mis-crystal-design-system-tooltip.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-tooltip.umd.min.js +1 -1
- package/bundles/mis-crystal-design-system-tooltip.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-utils.umd.js +33 -0
- package/bundles/mis-crystal-design-system-utils.umd.js.map +1 -0
- package/bundles/mis-crystal-design-system-utils.umd.min.js +2 -0
- package/bundles/mis-crystal-design-system-utils.umd.min.js.map +1 -0
- package/datepicker_v2/mis-crystal-design-system-datepicker_v2.metadata.json +1 -1
- package/daterangepicker_v2/mis-crystal-design-system-daterangepicker_v2.metadata.json +1 -1
- package/daterangepicker_v2/tz-daterangepicker.directive.d.ts +0 -1
- package/esm2015/datepicker_v2/tz-datepicker.directive.js +23 -8
- package/esm2015/daterangepicker_v2/tz-daterangepicker.directive.js +17 -25
- package/esm2015/table/table.component.js +13 -9
- package/esm2015/tooltip/index.js +2 -2
- package/esm2015/tooltip/models/tooltip.model.js +2 -0
- package/esm2015/tooltip/public_api.js +4 -4
- package/esm2015/tooltip/tooltip-container/tooltip.component.js +34 -0
- package/esm2015/tooltip/tooltip.directive.js +68 -57
- package/esm2015/tooltip/tooltip.module.js +5 -5
- package/esm2015/utils/index.js +17 -0
- package/esm2015/utils/mis-crystal-design-system-utils.js +5 -0
- package/fesm2015/mis-crystal-design-system-datepicker_v2.js +21 -6
- package/fesm2015/mis-crystal-design-system-datepicker_v2.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-daterangepicker_v2.js +15 -23
- package/fesm2015/mis-crystal-design-system-daterangepicker_v2.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-table.js +12 -8
- package/fesm2015/mis-crystal-design-system-table.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-tooltip.js +86 -101
- package/fesm2015/mis-crystal-design-system-tooltip.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-utils.js +24 -0
- package/fesm2015/mis-crystal-design-system-utils.js.map +1 -0
- package/package.json +1 -1
- package/table/mis-crystal-design-system-table.metadata.json +1 -1
- package/table/table.component.d.ts +2 -1
- package/tooltip/index.d.ts +1 -1
- package/tooltip/mis-crystal-design-system-tooltip.metadata.json +1 -1
- package/tooltip/models/tooltip.model.d.ts +1 -0
- package/tooltip/public_api.d.ts +4 -3
- package/tooltip/tooltip-container/tooltip.component.d.ts +10 -0
- package/tooltip/tooltip.directive.d.ts +10 -13
- package/tooltip/tooltip.module.d.ts +1 -1
- package/utils/index.d.ts +7 -0
- package/utils/mis-crystal-design-system-utils.d.ts +4 -0
- package/utils/mis-crystal-design-system-utils.metadata.json +1 -0
- package/utils/package.json +11 -0
- package/esm2015/tooltip/tooltip.component.js +0 -60
- package/tooltip/tooltip.component.d.ts +0 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/tslib/tslib.es6.js","../../../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"],"names":["Object","create","__values","o","s","Symbol","iterator","m","i","call","length","next","value","done","TypeError","TableComponent","renderer","this","showFilter","filterName","filterData","filterContainerStyles","appliedFilters","filtersUpdated","EventEmitter","selectedPage","pages","pageSelected","tableData","subTableData","prototype","ngOnInit","_this","initializeFilters","config","paginationConfig","initializePagination","undefined","canScrollHorizontally","document","addEventListener","event","filter","isCheckBoxClicked","target","className","container","nativeElement","contains","toggleFilter","ngAfterViewInit","height","table","offsetHeight","setStyle","_e","colHeaderConfig","_f","colHeader","filters","_g","e_2","_h","checked","push","name","data","offSet","colHeadersReversed","colHeaders","toArray","reverse","colHeadersReversed_1","colHeadersReversed_1_1","header","innerText","offsetWidth","top","right","updateAppliedFilters","emit","assign","len","noOfPages","updateSelectedPage","pageNumber","getContainerHeight","getContainerWidth","width","getColHeadersRowHeight","colHeadersRowConfig","getColHeadersRowBorderTop","_a","style","borderTop","_b","getColHeadersRowBorderBottom","borderBottom","Component","args","selector","template","Renderer2","Output","ViewChild","ViewChildren","Input","CustomTableCellDirective","viewContainerRef","componentFactoryResolver","defineProperty","component","createComponent","cellData","ref","instance","cmpFactoryResolver","resolveComponentFactory","clear","setData","Directive","ViewContainerRef","ComponentFactoryResolver","SubTableComponent","TableFilterComponent","filtersData","containerStyles","filtersApplied","filtersMap","searchValue","mySort","a","b","forEach","resetFilters","applyFilters","list","values","map","updateSearchValue","updateFilter","getFiltersBasedOnSearchValue","match","RegExp","sort","getCheckedFilters","TableModule","forRoot","ngModule","providers","NgModule","declarations","imports","CommonModule","CheckboxModule","ScrollingModule","exports"],"mappings":";;;;;;;;;;;;;;oFA2G6BA,OAAOC,gBAYpBC,EAASC,GACrB,IAAIC,EAAsB,mBAAXC,QAAyBA,OAAOC,SAAUC,EAAIH,GAAKD,EAAEC,GAAII,EAAI,EAC5E,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AK+G,WAAW9D,EAAKD,MAAMF,SAAW9C,KAAK+G,WAAW9D,EAAKD,MAAMF,UAGrE6D,EAAA9F,UAAA+G,6BAAA,WAAA,IAAA7G,EAAAf,KACMuH,EAAOxI,OAAOyI,OAAOxH,KAAK+G,YAI9B,OAHAQ,EAAOA,EAAK9F,QAAO,SAACA,GAClB,OAAOA,EAAOuB,KAAK6E,MAAM,IAAIC,OAAO/G,EAAKiG,YAAa,UAE5Ce,KAAK/H,KAAKiH,SAExBN,EAAA9F,UAAAmH,kBAAA,WACE,IAAIT,EAAOxI,OAAOyI,OAAOxH,KAAK+G,YAI9B,OAHAQ,EAAOA,EACJ9F,QAAO,SAACA,GAAyB,OAAAA,EAAOqB,WACxCiF,KAAK/H,KAAKiH,kCA3DhBhC,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,mBACVC,SAAA,ixIAICK,EAAAA,+BACAA,EAAAA,8BAEAH,EAAAA,0BAEAC,EAAAA,UAASL,KAAA,CAAC,qCCOb,SAAA+C,YACSA,EAAAC,QAAP,WACE,MAAO,CAAEC,SAAUF,EAAaG,UAAW,8BArB9CC,EAAAA,SAAQnD,KAAA,CAAC,CACRoD,aAAc,CACZxI,EACA4G,EACAC,EACAjB,GAEF6C,QAAS,CACPC,EAAAA,aACAC,EAAAA,eACAC,EAAAA,iBAEFC,QAAS,CACP7I,EACA4G,EACAC,EACAjB","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","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 {};\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 selectedPage = 1;\n pages: Array<number> = [];\n\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.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(\n event.target\n );\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(\n this.table.nativeElement,\n 'height',\n (height - 56) + 'px'\n );\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)\n return;\n this.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.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 (\n this.config.colHeadersRowConfig &&\n this.config.colHeadersRowConfig.height\n ) {\n return this.config.colHeadersRowConfig.height;\n } else return '44px';\n }\n getColHeadersRowBorderTop() {\n if (\n this.config.colHeadersRowConfig &&\n this.config.colHeadersRowConfig.style?.borderTop\n ) {\n return this.config.colHeadersRowConfig.style?.borderTop;\n } else return '';\n }\n getColHeadersRowBorderBottom() {\n if (\n this.config.colHeadersRowConfig &&\n this.config.colHeadersRowConfig.style?.borderBottom\n ) {\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}\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 {\n ComponentFactoryResolver,\n Directive,\n Input,\n ViewContainerRef,\n} 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) { this.ref.instance.data = this.cellData; }\n }\n\n\n constructor(\n private viewContainerRef: ViewContainerRef,\n private componentFactoryResolver: ComponentFactoryResolver\n ) { }\n\n createComponent() {\n if (this.component) {\n const cmpFactoryResolver =\n 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 {\n AfterViewInit,\n Component,\n ElementRef,\n Input,\n OnInit,\n Renderer2,\n ViewChild,\n} 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(\n this.table.nativeElement,\n 'height',\n height - 56 + 'px'\n );\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 (\n this.config.colHeadersRowConfig &&\n this.config.colHeadersRowConfig.height\n ) {\n return this.config.colHeadersRowConfig.height;\n } else return '44px';\n }\n getColHeadersRowBorderTop() {\n if (\n this.config.colHeadersRowConfig &&\n this.config.colHeadersRowConfig.style?.borderTop\n ) {\n return this.config.colHeadersRowConfig.style?.borderTop;\n } else return '';\n }\n getColHeadersRowBorderBottom() {\n if (\n this.config.colHeadersRowConfig &&\n this.config.colHeadersRowConfig.style?.borderBottom\n ) {\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 {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewChild,\n} 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\n .filter((filter: Filter | any) => filter.checked)\n .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: [\n TableComponent,\n SubTableComponent,\n TableFilterComponent,\n CustomTableCellDirective,\n ],\n imports: [\n CommonModule,\n CheckboxModule,\n ScrollingModule\n ],\n exports: [\n TableComponent,\n SubTableComponent,\n TableFilterComponent,\n CustomTableCellDirective\n ]\n})\nexport class TableModule {\n static forRoot(): ModuleWithProviders<TableModule> {\n return { ngModule: TableModule, providers: [] };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/tslib/tslib.es6.js","../../../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"],"names":["Object","create","__values","o","s","Symbol","iterator","m","i","call","length","next","value","done","TypeError","__read","n","r","e","ar","push","error","TableComponent","renderer","this","showFilter","filterName","filterData","filterContainerStyles","appliedFilters","filtersUpdated","EventEmitter","pages","pageSelected","tableData","subTableData","prototype","ngOnInit","_this","tableLength","concat","apply","arguments","__spread","initializeFilters","config","paginationConfig","initializePagination","undefined","canScrollHorizontally","document","addEventListener","event","filter","isCheckBoxClicked","target","className","container","nativeElement","contains","toggleFilter","ngAfterViewInit","height","table","offsetHeight","setStyle","_e","_a","colHeaderConfig","_f","colHeader","filters","_g","e_2","_h","checked","name","data","offSet","colHeadersReversed","colHeaders","toArray","reverse","colHeadersReversed_1","colHeadersReversed_1_1","header","innerText","offsetWidth","top","right","updateAppliedFilters","emit","assign","len","noOfPages","updateSelectedPage","pageNumber","selectedPage","getContainerHeight","getContainerWidth","width","getColHeadersRowHeight","colHeadersRowConfig","getColHeadersRowBorderTop","style","borderTop","_b","getColHeadersRowBorderBottom","borderBottom","Component","args","selector","template","Renderer2","Output","ViewChild","ViewChildren","Input","CustomTableCellDirective","viewContainerRef","componentFactoryResolver","defineProperty","component","createComponent","cellData","ref","instance","cmpFactoryResolver","resolveComponentFactory","clear","setData","Directive","ViewContainerRef","ComponentFactoryResolver","SubTableComponent","TableFilterComponent","filtersData","containerStyles","filtersApplied","filtersMap","searchValue","mySort","a","b","forEach","resetFilters","applyFilters","list","values","map","updateSearchValue","updateFilter","getFiltersBasedOnSearchValue","match","RegExp","sort","getCheckedFilters","TableModule","forRoot","ngModule","providers","NgModule","declarations","imports","CommonModule","CheckboxModule","ScrollingModule","exports"],"mappings":";;;;;;;;;;;;;;oFA2G6BA,OAAOC,gBAYpBC,EAASC,GACrB,IAAIC,EAAsB,mB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ExBN,EAAAnG,UAAAwH,kBAAA,WACE,IAAIT,EAAOnJ,OAAOoJ,OAAO5H,KAAKmH,YAI9B,OAHAQ,EAAOA,EACJ9F,QAAO,SAACA,GAAyB,OAAAA,EAAOsB,WACxCgF,KAAKnI,KAAKqH,kCA3DhBhC,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,mBACVC,SAAA,ixIAICK,EAAAA,+BACAA,EAAAA,8BAEAH,EAAAA,0BAEAC,EAAAA,UAASL,KAAA,CAAC,qCCOb,SAAA+C,YACSA,EAAAC,QAAP,WACE,MAAO,CAAEC,SAAUF,EAAaG,UAAW,8BArB9CC,EAAAA,SAAQnD,KAAA,CAAC,CACRoD,aAAc,CACZ5I,EACAgH,EACAC,EACAjB,GAEF6C,QAAS,CACPC,EAAAA,aACAC,EAAAA,eACAC,EAAAA,iBAEFC,QAAS,CACPjJ,EACAgH,EACAC,EACAjB","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","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 {};\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(\n event.target\n );\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(\n this.table.nativeElement,\n 'height',\n (height - 56) + 'px'\n );\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)\n 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 (\n this.config.colHeadersRowConfig &&\n this.config.colHeadersRowConfig.height\n ) {\n return this.config.colHeadersRowConfig.height;\n } else return '44px';\n }\n getColHeadersRowBorderTop() {\n if (\n this.config.colHeadersRowConfig &&\n this.config.colHeadersRowConfig.style?.borderTop\n ) {\n return this.config.colHeadersRowConfig.style?.borderTop;\n } else return '';\n }\n getColHeadersRowBorderBottom() {\n if (\n this.config.colHeadersRowConfig &&\n this.config.colHeadersRowConfig.style?.borderBottom\n ) {\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 {\n ComponentFactoryResolver,\n Directive,\n Input,\n ViewContainerRef,\n} 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) { this.ref.instance.data = this.cellData; }\n }\n\n\n constructor(\n private viewContainerRef: ViewContainerRef,\n private componentFactoryResolver: ComponentFactoryResolver\n ) { }\n\n createComponent() {\n if (this.component) {\n const cmpFactoryResolver =\n 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 {\n AfterViewInit,\n Component,\n ElementRef,\n Input,\n OnInit,\n Renderer2,\n ViewChild,\n} 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(\n this.table.nativeElement,\n 'height',\n height - 56 + 'px'\n );\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 (\n this.config.colHeadersRowConfig &&\n this.config.colHeadersRowConfig.height\n ) {\n return this.config.colHeadersRowConfig.height;\n } else return '44px';\n }\n getColHeadersRowBorderTop() {\n if (\n this.config.colHeadersRowConfig &&\n this.config.colHeadersRowConfig.style?.borderTop\n ) {\n return this.config.colHeadersRowConfig.style?.borderTop;\n } else return '';\n }\n getColHeadersRowBorderBottom() {\n if (\n this.config.colHeadersRowConfig &&\n this.config.colHeadersRowConfig.style?.borderBottom\n ) {\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 {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewChild,\n} 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\n .filter((filter: Filter | any) => filter.checked)\n .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: [\n TableComponent,\n SubTableComponent,\n TableFilterComponent,\n CustomTableCellDirective,\n ],\n imports: [\n CommonModule,\n CheckboxModule,\n ScrollingModule\n ],\n exports: [\n TableComponent,\n SubTableComponent,\n TableFilterComponent,\n CustomTableCellDirective\n ]\n})\nexport class TableModule {\n static forRoot(): ModuleWithProviders<TableModule> {\n return { ngModule: TableModule, providers: [] };\n }\n}\n"]}
|
|
@@ -1,93 +1,52 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('mis-crystal-design-system/tooltip', ['exports', '@angular/core', '@angular/common'], 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'].tooltip = {}), global.ng.core, global.ng.common));
|
|
5
|
-
}(this, (function (exports, core, common) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/cdk/overlay'), require('rxjs/operators'), require('@angular/cdk/portal'), require('mis-crystal-design-system/utils'), require('@angular/common')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('mis-crystal-design-system/tooltip', ['exports', '@angular/core', '@angular/cdk/overlay', 'rxjs/operators', '@angular/cdk/portal', 'mis-crystal-design-system/utils', '@angular/common'], 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'].tooltip = {}), global.ng.core, global.ng.cdk.overlay, global.rxjs.operators, global.ng.cdk.portal, global['mis-crystal-design-system'].utils, global.ng.common));
|
|
5
|
+
}(this, (function (exports, core, overlay, operators, portal, utils, common) { 'use strict';
|
|
6
6
|
|
|
7
7
|
var ToolTipComponent = /** @class */ (function () {
|
|
8
|
-
function ToolTipComponent(
|
|
9
|
-
this.
|
|
10
|
-
this.
|
|
11
|
-
this.toolTipWidth = '';
|
|
12
|
-
this.toolTipPosition = 'Bottom';
|
|
8
|
+
function ToolTipComponent() {
|
|
9
|
+
this.toolTipText = "";
|
|
10
|
+
this.toolTipPosition = "bottom";
|
|
13
11
|
}
|
|
14
|
-
|
|
15
|
-
set: function (value) {
|
|
16
|
-
this.toolTipText = value;
|
|
17
|
-
this.updateToolTipPosition();
|
|
18
|
-
},
|
|
19
|
-
enumerable: false,
|
|
20
|
-
configurable: true
|
|
21
|
-
});
|
|
22
|
-
Object.defineProperty(ToolTipComponent.prototype, "width", {
|
|
23
|
-
set: function (value) {
|
|
24
|
-
this.toolTipWidth = value;
|
|
25
|
-
this.updateToolTipPosition();
|
|
26
|
-
},
|
|
27
|
-
enumerable: false,
|
|
28
|
-
configurable: true
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(ToolTipComponent.prototype, "position", {
|
|
31
|
-
set: function (value) {
|
|
32
|
-
this.toolTipPosition = value;
|
|
33
|
-
this.updateToolTipPosition();
|
|
34
|
-
},
|
|
35
|
-
enumerable: false,
|
|
36
|
-
configurable: true
|
|
37
|
-
});
|
|
38
|
-
ToolTipComponent.prototype.ngOnInit = function () {
|
|
39
|
-
};
|
|
12
|
+
ToolTipComponent.prototype.ngOnInit = function () { };
|
|
40
13
|
ToolTipComponent.prototype.ngAfterViewInit = function () {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (this.
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
this.renderer.setStyle(this.container.nativeElement, 'right', "-" + (width + 12) + "px");
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
this.renderer.setStyle(this.container.nativeElement, 'left', '50%');
|
|
56
|
-
this.renderer.setStyle(this.container.nativeElement, 'right', '');
|
|
57
|
-
}
|
|
14
|
+
var _a;
|
|
15
|
+
if (!((_a = this.container) === null || _a === void 0 ? void 0 : _a.nativeElement))
|
|
16
|
+
return;
|
|
17
|
+
if (this.toolTipPosition === "top" || this.toolTipPosition === "bottom") {
|
|
18
|
+
var eleWidth = this.container.nativeElement.getBoundingClientRect();
|
|
19
|
+
this.container.nativeElement.style.left = eleWidth.width / -2 + "px";
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (this.toolTipPosition === "left") {
|
|
23
|
+
var eleWidth = this.container.nativeElement.getBoundingClientRect();
|
|
24
|
+
this.container.nativeElement.style.left = -eleWidth.width + "px";
|
|
58
25
|
}
|
|
59
26
|
};
|
|
60
27
|
return ToolTipComponent;
|
|
61
28
|
}());
|
|
62
29
|
ToolTipComponent.decorators = [
|
|
63
30
|
{ type: core.Component, args: [{
|
|
64
|
-
selector:
|
|
65
|
-
template: "<div id=\"tooltip-container\"
|
|
66
|
-
styles: ["#tooltip-container{position:absolute;z-index:1}#tooltip
|
|
31
|
+
selector: "mis-tooltip",
|
|
32
|
+
template: "<div id=\"tooltip-container\" *ngIf=\"toolTipText.length > 0\" #container>\n <div id=\"tooltip\">\n <div id=\"tooltip-text\">{{ toolTipText }}</div>\n <span\n id=\"arrow\"\n [ngClass]=\"{\n 'arrow-left': toolTipPosition === 'left',\n 'arrow-right': toolTipPosition === 'right',\n 'arrow-top': toolTipPosition === 'top',\n 'arrow-bottom': toolTipPosition === 'bottom'\n }\"\n ></span>\n </div>\n</div>\n",
|
|
33
|
+
styles: ["#tooltip-container{position:absolute;z-index:1}#tooltip{position:relative;display:block;padding:8px 12px;border-radius:8px;color:#fff;background:#181f33;font-family:Lato,sans-serif;font-style:normal;font-weight:400;font-size:14px;line-height:20px;text-align:center;letter-spacing:.2px}#tooltip-text{width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#arrow{position:absolute;height:12px;width:12px;background:#181f33;z-index:1}.arrow-top{bottom:-6px}.arrow-bottom,.arrow-top{left:50%;transform:translateX(-50%) rotate(-45deg);-webkit-transform:translateX(-50%) rotate(-45deg)}.arrow-bottom{top:-6px}.arrow-left{right:-6px}.arrow-left,.arrow-right{top:50%;transform:translateY(-50%) rotate(-45deg);-webkit-transform:translateY(-50%) rotate(-45deg)}.arrow-right{left:-6px}"]
|
|
67
34
|
},] }
|
|
68
35
|
];
|
|
69
|
-
ToolTipComponent.ctorParameters = function () { return [
|
|
70
|
-
{ type: core.Renderer2 }
|
|
71
|
-
]; };
|
|
36
|
+
ToolTipComponent.ctorParameters = function () { return []; };
|
|
72
37
|
ToolTipComponent.propDecorators = {
|
|
73
|
-
|
|
74
|
-
width: [{ type: core.Input }],
|
|
75
|
-
position: [{ type: core.Input }],
|
|
76
|
-
container: [{ type: core.ViewChild, args: ['container',] }]
|
|
38
|
+
container: [{ type: core.ViewChild, args: ["container",] }]
|
|
77
39
|
};
|
|
78
40
|
|
|
79
41
|
var ToolTipDirective = /** @class */ (function () {
|
|
80
|
-
function ToolTipDirective(
|
|
81
|
-
this.
|
|
82
|
-
this.
|
|
42
|
+
function ToolTipDirective(element, overlay, viewContainerRef) {
|
|
43
|
+
this.element = element;
|
|
44
|
+
this.overlay = overlay;
|
|
83
45
|
this.viewContainerRef = viewContainerRef;
|
|
84
|
-
this.componentFactoryResolver = componentFactoryResolver;
|
|
85
46
|
this.isToolTipDisplayed = false;
|
|
86
|
-
this.
|
|
87
|
-
this.
|
|
88
|
-
this.
|
|
89
|
-
this.responsivePosition = false;
|
|
90
|
-
this.showOnHover = false;
|
|
47
|
+
this.toolTipText = "";
|
|
48
|
+
this.toolTipPosition = "bottom";
|
|
49
|
+
this.showOnHover = true;
|
|
91
50
|
}
|
|
92
51
|
Object.defineProperty(ToolTipDirective.prototype, "showToolTip", {
|
|
93
52
|
set: function (value) {
|
|
@@ -100,18 +59,9 @@
|
|
|
100
59
|
enumerable: false,
|
|
101
60
|
configurable: true
|
|
102
61
|
});
|
|
103
|
-
Object.defineProperty(ToolTipDirective.prototype, "width", {
|
|
104
|
-
set: function (value) {
|
|
105
|
-
this.toolTipWidth = value;
|
|
106
|
-
this.createToolTip();
|
|
107
|
-
},
|
|
108
|
-
enumerable: false,
|
|
109
|
-
configurable: true
|
|
110
|
-
});
|
|
111
62
|
Object.defineProperty(ToolTipDirective.prototype, "text", {
|
|
112
63
|
set: function (value) {
|
|
113
64
|
this.toolTipText = value;
|
|
114
|
-
this.createToolTip();
|
|
115
65
|
},
|
|
116
66
|
enumerable: false,
|
|
117
67
|
configurable: true
|
|
@@ -119,7 +69,6 @@
|
|
|
119
69
|
Object.defineProperty(ToolTipDirective.prototype, "position", {
|
|
120
70
|
set: function (value) {
|
|
121
71
|
this.toolTipPosition = value;
|
|
122
|
-
this.createToolTip();
|
|
123
72
|
},
|
|
124
73
|
enumerable: false,
|
|
125
74
|
configurable: true
|
|
@@ -132,69 +81,86 @@
|
|
|
132
81
|
if (this.showOnHover)
|
|
133
82
|
this.hideToolTip();
|
|
134
83
|
};
|
|
135
|
-
ToolTipDirective.prototype.ngOnInit = function () {
|
|
136
|
-
this.createToolTip();
|
|
137
|
-
};
|
|
84
|
+
ToolTipDirective.prototype.ngOnInit = function () { };
|
|
138
85
|
ToolTipDirective.prototype.ngAfterViewInit = function () {
|
|
139
|
-
this.renderer.setStyle(this.elementRef.nativeElement, 'position', 'relative');
|
|
140
86
|
if (this.isToolTipDisplayed)
|
|
141
87
|
this.displayToolTip();
|
|
142
88
|
else
|
|
143
89
|
this.hideToolTip();
|
|
144
|
-
if (this.isToolTipDisplayed && this.responsivePosition)
|
|
145
|
-
this.updatePosition();
|
|
146
|
-
};
|
|
147
|
-
ToolTipDirective.prototype.createToolTip = function () {
|
|
148
|
-
var cmpFactoryResolver = this.componentFactoryResolver.resolveComponentFactory(ToolTipComponent);
|
|
149
|
-
this.viewContainerRef.clear();
|
|
150
|
-
this.componentRef = this.viewContainerRef.createComponent(cmpFactoryResolver);
|
|
151
|
-
this.componentRef.instance.width = this.toolTipWidth;
|
|
152
|
-
this.componentRef.instance.text = this.toolTipText;
|
|
153
|
-
this.componentRef.instance.position = this.toolTipPosition;
|
|
154
90
|
};
|
|
155
91
|
ToolTipDirective.prototype.displayToolTip = function () {
|
|
156
|
-
var
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
92
|
+
var _this = this;
|
|
93
|
+
var positionStrategy = this.overlay
|
|
94
|
+
.position()
|
|
95
|
+
.flexibleConnectedTo(this.element)
|
|
96
|
+
.withPositions(utils.genPositionPairs({
|
|
97
|
+
positionX: "center",
|
|
98
|
+
positionY: this.toolTipPosition === "top" ? "top" : "center",
|
|
99
|
+
offsetX: this.positionTooltip("OFFSET_X"),
|
|
100
|
+
offsetY: this.positionTooltip("OFFSET_Y")
|
|
101
|
+
}, false))
|
|
102
|
+
.withPush(true);
|
|
103
|
+
var config = new overlay.OverlayConfig({
|
|
104
|
+
hasBackdrop: false,
|
|
105
|
+
positionStrategy: positionStrategy,
|
|
106
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition()
|
|
107
|
+
});
|
|
108
|
+
this.overlayRef = this.overlay.create(config);
|
|
109
|
+
var tempRef = new portal.ComponentPortal(ToolTipComponent, this.viewContainerRef);
|
|
110
|
+
var tooltipRef = this.overlayRef.attach(tempRef);
|
|
111
|
+
tooltipRef.instance.toolTipText = this.toolTipText;
|
|
112
|
+
tooltipRef.instance.toolTipPosition = this.toolTipPosition;
|
|
113
|
+
this.overlayRef
|
|
114
|
+
.backdropClick()
|
|
115
|
+
.pipe(operators.take(1))
|
|
116
|
+
.subscribe(function () {
|
|
117
|
+
_this.hideToolTip();
|
|
118
|
+
});
|
|
161
119
|
};
|
|
162
|
-
ToolTipDirective.prototype.
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
120
|
+
ToolTipDirective.prototype.positionTooltip = function (type) {
|
|
121
|
+
if (type === "OFFSET_X") {
|
|
122
|
+
return this.toolTipPosition === "right"
|
|
123
|
+
? this.element.nativeElement.offsetWidth / 2 + 8
|
|
124
|
+
: this.toolTipPosition === "left"
|
|
125
|
+
? (this.element.nativeElement.offsetWidth / 2 + 8) * -1
|
|
126
|
+
: this.toolTipPosition === "top" || this.toolTipPosition === "bottom"
|
|
127
|
+
? 0
|
|
128
|
+
: 8;
|
|
129
|
+
}
|
|
130
|
+
if (type !== "OFFSET_Y")
|
|
131
|
+
return;
|
|
132
|
+
return this.toolTipPosition === "right" || this.toolTipPosition === "left"
|
|
133
|
+
? -18
|
|
134
|
+
: this.toolTipPosition === "top"
|
|
135
|
+
? -44
|
|
136
|
+
: this.toolTipPosition === "bottom"
|
|
137
|
+
? this.element.nativeElement.offsetHeight / 2 + 8
|
|
138
|
+
: 8;
|
|
166
139
|
};
|
|
167
|
-
ToolTipDirective.prototype.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
// Use default value as priority and dont change it here 'toolTipPosition'
|
|
172
|
-
// Update the position using below line
|
|
173
|
-
// this.componentRef.instance.position = 'Right'
|
|
174
|
-
// console.log(x, y, height, width)
|
|
140
|
+
ToolTipDirective.prototype.hideToolTip = function () {
|
|
141
|
+
var _a, _b;
|
|
142
|
+
(_a = this.overlayRef) === null || _a === void 0 ? void 0 : _a.detach();
|
|
143
|
+
(_b = this.overlayRef) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
175
144
|
};
|
|
176
145
|
return ToolTipDirective;
|
|
177
146
|
}());
|
|
178
147
|
ToolTipDirective.decorators = [
|
|
179
148
|
{ type: core.Directive, args: [{
|
|
180
|
-
selector:
|
|
149
|
+
selector: "[misToolTip]"
|
|
181
150
|
},] }
|
|
182
151
|
];
|
|
183
152
|
ToolTipDirective.ctorParameters = function () { return [
|
|
184
153
|
{ type: core.ElementRef },
|
|
185
|
-
{ type:
|
|
186
|
-
{ type: core.ViewContainerRef }
|
|
187
|
-
{ type: core.ComponentFactoryResolver }
|
|
154
|
+
{ type: overlay.Overlay },
|
|
155
|
+
{ type: core.ViewContainerRef }
|
|
188
156
|
]; };
|
|
189
157
|
ToolTipDirective.propDecorators = {
|
|
190
|
-
responsivePosition: [{ type: core.Input }],
|
|
191
158
|
showOnHover: [{ type: core.Input }],
|
|
192
159
|
showToolTip: [{ type: core.Input }],
|
|
193
|
-
width: [{ type: core.Input }],
|
|
194
160
|
text: [{ type: core.Input }],
|
|
195
161
|
position: [{ type: core.Input }],
|
|
196
|
-
onMouseEnter: [{ type: core.HostListener, args: [
|
|
197
|
-
onMouseLeave: [{ type: core.HostListener, args: [
|
|
162
|
+
onMouseEnter: [{ type: core.HostListener, args: ["mouseenter",] }],
|
|
163
|
+
onMouseLeave: [{ type: core.HostListener, args: ["mouseleave",] }]
|
|
198
164
|
};
|
|
199
165
|
|
|
200
166
|
var ToolTipModule = /** @class */ (function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mis-crystal-design-system-tooltip.umd.js","sources":["../../../projects/mis-components/tooltip/tooltip.component.ts","../../../projects/mis-components/tooltip/tooltip.directive.ts","../../../projects/mis-components/tooltip/tooltip.module.ts","../../../projects/mis-components/tooltip/mis-crystal-design-system-tooltip.ts"],"sourcesContent":["import {AfterViewInit, Component, ElementRef, Input, OnInit, Renderer2, ViewChild} from '@angular/core';\n\n@Component({\n selector: 'mis-tooltip',\n templateUrl: './tooltip.component.html',\n styleUrls: ['./tooltip.component.scss']\n})\nexport class ToolTipComponent implements OnInit, AfterViewInit{\n\n public toolTipText: string = ''\n public toolTipWidth: string = ''\n public toolTipPosition: 'Left' | 'Right' | 'Top' | 'Bottom' = 'Bottom'\n\n @Input() set text(value: string){\n this.toolTipText = value\n this.updateToolTipPosition()\n }\n @Input() set width(value: string){\n this.toolTipWidth = value;\n this.updateToolTipPosition()\n }\n @Input() set position(value: 'Left' | 'Right' | 'Top' | 'Bottom'){\n this.toolTipPosition = value\n this.updateToolTipPosition()\n }\n\n @ViewChild('container') container: ElementRef\n\n constructor(private renderer: Renderer2) {\n }\n ngOnInit() {\n }\n ngAfterViewInit(){\n this.updateToolTipPosition()\n }\n updateToolTipPosition(){\n if(this.container){\n let width = this.container.nativeElement.offsetWidth\n if(this.toolTipPosition === 'Left'){\n this.renderer.setStyle(this.container.nativeElement, 'left', `-${width + 12}px`)\n this.renderer.setStyle(this.container.nativeElement, 'right', '')\n }\n else if(this.toolTipPosition === 'Right'){\n this.renderer.setStyle(this.container.nativeElement, 'left', '')\n this.renderer.setStyle(this.container.nativeElement, 'right', `-${width + 12}px`)\n }\n else{\n this.renderer.setStyle(this.container.nativeElement, 'left', '50%')\n this.renderer.setStyle(this.container.nativeElement, 'right', '')\n }\n }\n }\n}\n","import {\n AfterViewInit,\n ComponentFactoryResolver, ComponentRef,\n Directive,\n ElementRef, HostListener, Input,\n OnInit,\n Renderer2,\n ViewContainerRef\n} from '@angular/core';\nimport {ToolTipComponent} from './tooltip.component';\nimport {isChildNodeOf} from 'codelyzer/util/isChildNodeOf';\n\n@Directive({\n selector: '[misToolTip]'\n})\nexport class ToolTipDirective implements OnInit, AfterViewInit {\n public isToolTipDisplayed: boolean = false\n public toolTipWidth: string = ''\n public toolTipText: string = ''\n public toolTipPosition: 'Left' | 'Right' | 'Top' | 'Bottom' = 'Bottom'\n\n @Input() responsivePosition: boolean = false\n @Input() showOnHover: boolean = false\n @Input() set showToolTip(value: boolean){\n this.isToolTipDisplayed = value\n if(value) this.displayToolTip()\n else this.hideToolTip()\n }\n @Input() set width(value: string){\n this.toolTipWidth = value\n this.createToolTip()\n }\n @Input() set text(value: string){\n this.toolTipText = value\n this.createToolTip()\n }\n @Input() set position(value: 'Left' | 'Right' | 'Top' | 'Bottom'){\n this.toolTipPosition = value\n this.createToolTip()\n }\n\n @HostListener('mouseenter',) onMouseEnter() {\n if (this.showOnHover) this.displayToolTip()\n }\n @HostListener('mouseleave',) onMouseLeave(){\n if(this.showOnHover) this.hideToolTip()\n }\n\n private componentRef: ComponentRef<ToolTipComponent>\n constructor(\n private elementRef: ElementRef,\n private renderer: Renderer2,\n private viewContainerRef: ViewContainerRef,\n private componentFactoryResolver: ComponentFactoryResolver\n ) {\n }\n\n ngOnInit() {\n this.createToolTip()\n }\n ngAfterViewInit(){\n this.renderer.setStyle(this.elementRef.nativeElement, 'position', 'relative')\n if(this.isToolTipDisplayed) this.displayToolTip()\n else this.hideToolTip()\n if(this.isToolTipDisplayed && this.responsivePosition) this.updatePosition()\n }\n createToolTip(){\n const cmpFactoryResolver = this.componentFactoryResolver.resolveComponentFactory(ToolTipComponent);\n this.viewContainerRef.clear();\n this.componentRef = this.viewContainerRef.createComponent(cmpFactoryResolver);\n this.componentRef.instance.width = this.toolTipWidth\n this.componentRef.instance.text = this.toolTipText\n this.componentRef.instance.position = this.toolTipPosition\n }\n displayToolTip(){\n let isChild = this.elementRef.nativeElement.contains(this.componentRef.location.nativeElement)\n if(!isChild) this.renderer.appendChild(this.elementRef.nativeElement, this.componentRef.location.nativeElement)\n if(this.responsivePosition) this.updatePosition()\n }\n hideToolTip(){\n let isChild = this.elementRef.nativeElement.contains(this.componentRef.location.nativeElement)\n if(isChild) this.renderer.removeChild(this.elementRef.nativeElement, this.componentRef.location.nativeElement)\n }\n updatePosition(){\n // let rect: any = this.componentRef.location.nativeElement.children[0].getBoundingClientRect()\n // let {x, y, height, width} = rect\n //TODO: Add logic for responsive positioning\n // Use default value as priority and dont change it here 'toolTipPosition'\n // Update the position using below line\n // this.componentRef.instance.position = 'Right'\n // console.log(x, y, height, width)\n }\n}\n\n","import { NgModule, ModuleWithProviders } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { ToolTipDirective } from './tooltip.directive';\nimport {ToolTipComponent} from './tooltip.component';\n\n@NgModule({\n declarations: [ToolTipDirective, ToolTipComponent],\n imports: [CommonModule],\n exports: [ToolTipDirective, ToolTipComponent],\n entryComponents:[ToolTipComponent]\n})\nexport class ToolTipModule {\n static forRoot(): ModuleWithProviders<ToolTipModule> {\n return { ngModule: ToolTipModule, providers: [] };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["Component","Renderer2","Input","ViewChild","Directive","ElementRef","ViewContainerRef","ComponentFactoryResolver","HostListener","NgModule","CommonModule"],"mappings":";;;;;;;QA4BE,0BAAoB,QAAmB;YAAnB,aAAQ,GAAR,QAAQ,CAAW;YAnBhC,gBAAW,GAAW,EAAE,CAAA;YACxB,iBAAY,GAAW,EAAE,CAAA;YACzB,oBAAe,GAAwC,QAAQ,CAAA;SAkBrE;QAhBD,sBAAa,kCAAI;iBAAjB,UAAkB,KAAa;gBAC7B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAA;gBACxB,IAAI,CAAC,qBAAqB,EAAE,CAAA;aAC7B;;;WAAA;QACD,sBAAa,mCAAK;iBAAlB,UAAmB,KAAa;gBAC9B,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;gBAC1B,IAAI,CAAC,qBAAqB,EAAE,CAAA;aAC7B;;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component.ts","../../../projects/mis-components/tooltip/tooltip.directive.ts","../../../projects/mis-components/tooltip/tooltip.module.ts","../../../projects/mis-components/tooltip/mis-crystal-design-system-tooltip.ts"],"sourcesContent":["import { AfterViewInit, Component, ElementRef, Inject, OnInit, ViewChild } from \"@angular/core\";\nimport { ITooltipPositions } from \"../models/tooltip.model\";\n\n@Component({\n selector: \"mis-tooltip\",\n templateUrl: \"./tooltip.component.html\",\n styleUrls: [\"./tooltip.component.scss\"]\n})\nexport class ToolTipComponent implements OnInit, AfterViewInit {\n public toolTipText: string = \"\";\n public toolTipPosition: ITooltipPositions = \"bottom\";\n\n @ViewChild(\"container\") container: ElementRef;\n\n constructor() {}\n ngOnInit() {}\n ngAfterViewInit() {\n if (!this.container?.nativeElement) return;\n if (this.toolTipPosition === \"top\" || this.toolTipPosition === \"bottom\") {\n const eleWidth = this.container.nativeElement.getBoundingClientRect();\n this.container.nativeElement.style.left = eleWidth.width / -2 + \"px\";\n return;\n }\n if (this.toolTipPosition === \"left\") {\n const eleWidth = this.container.nativeElement.getBoundingClientRect();\n this.container.nativeElement.style.left = -eleWidth.width + \"px\";\n }\n }\n}\n","import { AfterViewInit, Directive, ElementRef, HostListener, Input, OnInit, ViewContainerRef, Injector } from \"@angular/core\";\nimport { Overlay, OverlayConfig, OverlayRef } from \"@angular/cdk/overlay\";\nimport { take } from \"rxjs/operators\";\nimport { ComponentPortal } from \"@angular/cdk/portal\";\nimport { ToolTipComponent } from \"./tooltip-container/tooltip.component\";\nimport { genPositionPairs } from \"mis-crystal-design-system/utils\";\nimport { ITooltipPositions } from \"./models/tooltip.model\";\n\n@Directive({\n selector: \"[misToolTip]\"\n})\nexport class ToolTipDirective implements OnInit, AfterViewInit {\n public isToolTipDisplayed: boolean = false;\n public toolTipText: string = \"\";\n public toolTipPosition: ITooltipPositions = \"bottom\";\n private overlayRef: OverlayRef;\n\n @Input() showOnHover: boolean = true;\n @Input() set showToolTip(value: boolean) {\n this.isToolTipDisplayed = value;\n if (value) this.displayToolTip();\n else this.hideToolTip();\n }\n @Input() set text(value: string) {\n this.toolTipText = value;\n }\n @Input() set position(value: ITooltipPositions) {\n this.toolTipPosition = value;\n }\n\n @HostListener(\"mouseenter\") onMouseEnter() {\n if (this.showOnHover) this.displayToolTip();\n }\n @HostListener(\"mouseleave\") onMouseLeave() {\n if (this.showOnHover) this.hideToolTip();\n }\n\n constructor(private element: ElementRef, private overlay: Overlay, private viewContainerRef: ViewContainerRef) {}\n\n ngOnInit() {}\n ngAfterViewInit() {\n if (this.isToolTipDisplayed) this.displayToolTip();\n else this.hideToolTip();\n }\n\n displayToolTip() {\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.element)\n .withPositions(\n genPositionPairs(\n {\n positionX: \"center\",\n positionY: this.toolTipPosition === \"top\" ? \"top\" : \"center\",\n offsetX: this.positionTooltip(\"OFFSET_X\"),\n offsetY: this.positionTooltip(\"OFFSET_Y\")\n },\n false\n )\n )\n .withPush(true);\n const config = new OverlayConfig({\n hasBackdrop: false,\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.reposition()\n });\n this.overlayRef = this.overlay.create(config);\n const tempRef = new ComponentPortal(ToolTipComponent, this.viewContainerRef);\n const tooltipRef = this.overlayRef.attach(tempRef);\n tooltipRef.instance.toolTipText = this.toolTipText;\n tooltipRef.instance.toolTipPosition = this.toolTipPosition;\n this.overlayRef\n .backdropClick()\n .pipe(take(1))\n .subscribe(() => {\n this.hideToolTip();\n });\n }\n\n positionTooltip(type: \"OFFSET_X\" | \"OFFSET_Y\") {\n if (type === \"OFFSET_X\") {\n return this.toolTipPosition === \"right\"\n ? this.element.nativeElement.offsetWidth / 2 + 8\n : this.toolTipPosition === \"left\"\n ? (this.element.nativeElement.offsetWidth / 2 + 8) * -1\n : this.toolTipPosition === \"top\" || this.toolTipPosition === \"bottom\"\n ? 0\n : 8;\n }\n if (type !== \"OFFSET_Y\") return;\n return this.toolTipPosition === \"right\" || this.toolTipPosition === \"left\"\n ? -18\n : this.toolTipPosition === \"top\"\n ? -44\n : this.toolTipPosition === \"bottom\"\n ? this.element.nativeElement.offsetHeight / 2 + 8\n : 8;\n }\n\n hideToolTip() {\n this.overlayRef?.detach();\n this.overlayRef?.dispose();\n }\n}\n","import { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\n\nimport { ToolTipDirective } from \"./tooltip.directive\";\nimport { ToolTipComponent } from \"./tooltip-container/tooltip.component\";\n\n@NgModule({\n declarations: [ToolTipDirective, ToolTipComponent],\n imports: [CommonModule],\n exports: [ToolTipDirective, ToolTipComponent],\n entryComponents: [ToolTipComponent]\n})\nexport class ToolTipModule {\n static forRoot(): ModuleWithProviders<ToolTipModule> {\n return { ngModule: ToolTipModule, providers: [] };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["Component","ViewChild","genPositionPairs","OverlayConfig","ComponentPortal","take","Directive","ElementRef","Overlay","ViewContainerRef","Input","HostListener","NgModule","CommonModule"],"mappings":";;;;;;;QAcE;YALO,gBAAW,GAAW,EAAE,CAAC;YACzB,oBAAe,GAAsB,QAAQ,CAAC;SAIrC;QAChB,mCAAQ,GAAR,eAAa;QACb,0CAAe,GAAf;;YACE,IAAI,QAAC,IAAI,CAAC,SAAS,0CAAE,aAAa,CAAA;gBAAE,OAAO;YAC3C,IAAI,IAAI,CAAC,eAAe,KAAK,KAAK,IAAI,IAAI,CAAC,eAAe,KAAK,QAAQ,EAAE;gBACvE,IAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC;gBACtE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;gBACrE,OAAO;aACR;YACD,IAAI,IAAI,CAAC,eAAe,KAAK,MAAM,EAAE;gBACnC,IAAM,QAAQ,GAAG,IAAI,CAAC,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Aa,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;SACnD;;;;gBATFC,aAAQ,SAAC;oBACR,YAAY,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;oBAClD,OAAO,EAAE,CAACC,mBAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;oBAC7C,eAAe,EAAE,CAAC,gBAAgB,CAAC;iBACpC;;;ICXD;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define("mis-crystal-design-system/tooltip",["exports","@angular/core","@angular/common"],o):o(((t="undefined"!=typeof globalThis?globalThis:t||self)["mis-crystal-design-system"]=t["mis-crystal-design-system"]||{},t["mis-crystal-design-system"].tooltip={}),t.ng.core,t.ng.common)}(this,(function(t,o,e){"use strict";var
|
|
1
|
+
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("@angular/core"),require("@angular/cdk/overlay"),require("rxjs/operators"),require("@angular/cdk/portal"),require("mis-crystal-design-system/utils"),require("@angular/common")):"function"==typeof define&&define.amd?define("mis-crystal-design-system/tooltip",["exports","@angular/core","@angular/cdk/overlay","rxjs/operators","@angular/cdk/portal","mis-crystal-design-system/utils","@angular/common"],o):o(((t="undefined"!=typeof globalThis?globalThis:t||self)["mis-crystal-design-system"]=t["mis-crystal-design-system"]||{},t["mis-crystal-design-system"].tooltip={}),t.ng.core,t.ng.cdk.overlay,t.rxjs.operators,t.ng.cdk.portal,t["mis-crystal-design-system"].utils,t.ng.common)}(this,(function(t,o,i,e,n,r,s){"use strict";var l=function(){function t(){this.toolTipText="",this.toolTipPosition="bottom"}return t.prototype.ngOnInit=function(){},t.prototype.ngAfterViewInit=function(){var t;if(null===(t=this.container)||void 0===t?void 0:t.nativeElement)if("top"!==this.toolTipPosition&&"bottom"!==this.toolTipPosition){if("left"===this.toolTipPosition){o=this.container.nativeElement.getBoundingClientRect();this.container.nativeElement.style.left=-o.width+"px"}}else{var o=this.container.nativeElement.getBoundingClientRect();this.container.nativeElement.style.left=o.width/-2+"px"}},t}();l.decorators=[{type:o.Component,args:[{selector:"mis-tooltip",template:"<div id=\"tooltip-container\" *ngIf=\"toolTipText.length > 0\" #container>\n <div id=\"tooltip\">\n <div id=\"tooltip-text\">{{ toolTipText }}</div>\n <span\n id=\"arrow\"\n [ngClass]=\"{\n 'arrow-left': toolTipPosition === 'left',\n 'arrow-right': toolTipPosition === 'right',\n 'arrow-top': toolTipPosition === 'top',\n 'arrow-bottom': toolTipPosition === 'bottom'\n }\"\n ></span>\n </div>\n</div>\n",styles:["#tooltip-container{position:absolute;z-index:1}#tooltip{position:relative;display:block;padding:8px 12px;border-radius:8px;color:#fff;background:#181f33;font-family:Lato,sans-serif;font-style:normal;font-weight:400;font-size:14px;line-height:20px;text-align:center;letter-spacing:.2px}#tooltip-text{width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#arrow{position:absolute;height:12px;width:12px;background:#181f33;z-index:1}.arrow-top{bottom:-6px}.arrow-bottom,.arrow-top{left:50%;transform:translateX(-50%) rotate(-45deg);-webkit-transform:translateX(-50%) rotate(-45deg)}.arrow-bottom{top:-6px}.arrow-left{right:-6px}.arrow-left,.arrow-right{top:50%;transform:translateY(-50%) rotate(-45deg);-webkit-transform:translateY(-50%) rotate(-45deg)}.arrow-right{left:-6px}"]}]}],l.ctorParameters=function(){return[]},l.propDecorators={container:[{type:o.ViewChild,args:["container"]}]};var p=function(){function t(t,o,i){this.element=t,this.overlay=o,this.viewContainerRef=i,this.isToolTipDisplayed=!1,this.toolTipText="",this.toolTipPosition="bottom",this.showOnHover=!0}return Object.defineProperty(t.prototype,"showToolTip",{set:function(t){this.isToolTipDisplayed=t,t?this.displayToolTip():this.hideToolTip()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{set:function(t){this.toolTipText=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{set:function(t){this.toolTipPosition=t},enumerable:!1,configurable:!0}),t.prototype.onMouseEnter=function(){this.showOnHover&&this.displayToolTip()},t.prototype.onMouseLeave=function(){this.showOnHover&&this.hideToolTip()},t.prototype.ngOnInit=function(){},t.prototype.ngAfterViewInit=function(){this.isToolTipDisplayed?this.displayToolTip():this.hideToolTip()},t.prototype.displayToolTip=function(){var t=this,o=this.overlay.position().flexibleConnectedTo(this.element).withPositions(r.genPositionPairs({positionX:"center",positionY:"top"===this.toolTipPosition?"top":"center",offsetX:this.positionTooltip("OFFSET_X"),offsetY:this.positionTooltip("OFFSET_Y")},!1)).withPush(!0),s=new i.OverlayConfig({hasBackdrop:!1,positionStrategy:o,scrollStrategy:this.overlay.scrollStrategies.reposition()});this.overlayRef=this.overlay.create(s);var p=new n.ComponentPortal(l,this.viewContainerRef),a=this.overlayRef.attach(p);a.instance.toolTipText=this.toolTipText,a.instance.toolTipPosition=this.toolTipPosition,this.overlayRef.backdropClick().pipe(e.take(1)).subscribe((function(){t.hideToolTip()}))},t.prototype.positionTooltip=function(t){return"OFFSET_X"===t?"right"===this.toolTipPosition?this.element.nativeElement.offsetWidth/2+8:"left"===this.toolTipPosition?-1*(this.element.nativeElement.offsetWidth/2+8):"top"===this.toolTipPosition||"bottom"===this.toolTipPosition?0:8:"OFFSET_Y"===t?"right"===this.toolTipPosition||"left"===this.toolTipPosition?-18:"top"===this.toolTipPosition?-44:"bottom"===this.toolTipPosition?this.element.nativeElement.offsetHeight/2+8:8:void 0},t.prototype.hideToolTip=function(){var t,o;null===(t=this.overlayRef)||void 0===t||t.detach(),null===(o=this.overlayRef)||void 0===o||o.dispose()},t}();p.decorators=[{type:o.Directive,args:[{selector:"[misToolTip]"}]}],p.ctorParameters=function(){return[{type:o.ElementRef},{type:i.Overlay},{type:o.ViewContainerRef}]},p.propDecorators={showOnHover:[{type:o.Input}],showToolTip:[{type:o.Input}],text:[{type:o.Input}],position:[{type:o.Input}],onMouseEnter:[{type:o.HostListener,args:["mouseenter"]}],onMouseLeave:[{type:o.HostListener,args:["mouseleave"]}]};var a=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[]}},t}();a.decorators=[{type:o.NgModule,args:[{declarations:[p,l],imports:[s.CommonModule],exports:[p,l],entryComponents:[l]}]}],t.ToolTipComponent=l,t.ToolTipDirective=p,t.ToolTipModule=a,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
2
2
|
//# sourceMappingURL=mis-crystal-design-system-tooltip.umd.min.js.map
|