{"version":3,"sources":["../../node_modules/tslib/tslib.es6.js","../../src/app/components/cascadeselect/cascadeselect.ts"],"names":["Object","create","__values","o","s","Symbol","iterator","m","i","call","length","next","value","done","TypeError","CASCADESELECT_VALUE_ACCESSOR","provide","NG_VALUE_ACCESSOR","useExisting","forwardRef","CascadeSelect","multi","CascadeSelectSub","el","this","level","onSelect","EventEmitter","onGroupSelect","activeOption","defineProperty","prototype","_parentActive","val","ngOnInit","selectionPath","options","dirty","_b","_c","option","includes","root","position","onOptionClick","event","isOptionGroup","emit","originalEvent","getOptionValue","onOptionSelect","onOptionGroupSelect","getOptionLabel","optionLabel","ObjectUtils","resolveFieldData","optionValue","getOptionGroupLabel","optionGroup","optionGroupLabel","getOptionGroupChildren","optionGroupChildren","hasOwnProperty","getOptionLabelToRender","getItemClass","p-cascadeselect-item","p-cascadeselect-item-group","p-cascadeselect-item-active p-highlight","isOptionActive","onKeyDown","index","listItem","currentTarget","parentElement","key","nextItem","nativeElement","children","focus","prevItem","parentList","preventDefault","parentItem","containerOffset","DomHandler","getOffset","viewport","getViewport","sublistWidth","offsetParent","offsetWidth","getHiddenElementOuterWidth","itemOuterWidth","getOuterWidth","parseInt","left","width","calculateScrollbarWidth","style","Component","args","selector","template","encapsulation","ViewEncapsulation","None","changeDetection","ChangeDetectionStrategy","OnPush","ElementRef","Input","Output","cd","showTransitionOptions","hideTransitionOptions","onChange","onGroupChange","onShow","onHide","onBeforeShow","onBeforeHide","focused","filled","overlayVisible","onModelChange","onModelTouched","updateSelectionPath","ngAfterContentInit","_this","templates","forEach","item","getType","valueTemplate","optionTemplate","hide","focusInputEl","path","findModelOptionInGroup","updateFilledState","selectedOption","childOption","unshift","equals","dataKey","show","markForCheck","onClick","disabled","overlayEl","contains","target","onFocus","onBlur","onOverlayAnimationStart","toState","element","onOverlayEnter","onOverlayAnimationDone","onOverlayLeave","zIndex","String","generateZIndex","appendContainer","alignOverlay","bindOutsideClickListener","bindScrollListener","bindResizeListener","unbindOutsideClickListener","unbindScrollListener","unbindResizeListener","writeValue","registerOnChange","fn","registerOnTouched","setDisabledState","appendTo","absolutePosition","containerEl","minWidth","relativePosition","outsideClickListener","document","addEventListener","removeEventListener","scrollHandler","ConnectedOverlayScrollHandler","resizeListener","window","body","appendChild","getElementById","restoreAppend","removeChild","label","placeholder","findSingle","altKey","containerClass","p-cascadeselect p-component p-inputwrapper","p-disabled","p-focus","labelClass","p-cascadeselect-label","p-placeholder","p-cascadeselect-label-empty","ngOnDestroy","destroy","animations","trigger","transition","opacity","transform","animate","host","[class.p-inputwrapper-filled]","[class.p-inputwrapper-focus]","providers","ChangeDetectorRef","ViewChild","ContentChildren","PrimeTemplate","NgModule","imports","CommonModule","SharedModule","RippleModule","exports","declarations"],"mappings":";;;;;;;;;;;;;;oFA2G6BA,OAAOC,gBAYpBC,EAASC,GACrB,IAAIC,EAAsB,mBAAXC,QAAyBA,OAAOC,SAAUC,EAAIH,GAAKD,EAAEC,GAAII,EAAI,EAC5E,GAAID,EAAG,OAAOA,EAAEE,KAAKN,GACrB,GAAIA,GAAyB,iBAAbA,EAAEO,OAAqB,MAAO,CAC1CC,KAAM,WAEF,OADIR,GAAKK,GAAKL,EAAEO,SAAQP,OAAI,GACrB,CAAES,MAAOT,GAAKA,EAAEK,KAAMK,MAAOV,KAG5C,MAAM,IAAIW,UAAUV,EAAI,0BAA4B,mCA6E/BJ,OAAOC,WCnMnBc,EAAoC,CAC7CC,QAASC,EAAAA,kBACTC,YAAaC,EAAAA,YAAW,WAAM,OAAAC,KAC9BC,OAAO,gBAsEP,SAAAC,EAAoBC,GAAAC,KAAAD,GAAAA,EA/BXC,KAAAC,MAAgB,EAYfD,KAAAE,SAA8B,IAAIC,EAAAA,aAElCH,KAAAI,cAAmC,IAAID,EAAAA,aAajDH,KAAAK,aAAoB,YAXpB7B,OAAA8B,eAAaR,EAAAS,UAAA,eAAY,KAAzB,WACI,OAAOP,KAAKQ,mBAEhB,SAAiBC,GACRA,IACDT,KAAKK,aAAe,MA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AQ,8BAEVH,EAAAA,WAAW,SAAU,CACnBG,EAAAA,QAAQ,2BAA4BnH,EAAAA,MAAM,CAAEiH,QAAS,UAIjEG,KAAM,CACFC,gCAAiC,SACjCC,+BAAgC,6BAEpCC,UAAW,CAAC1M,GACZ2F,gBAAiBC,EAAAA,wBAAwBC,OACzCL,cAAeC,EAAAA,kBAAkBC,upCAhRqFI,EAAAA,kBAAyD6G,EAAAA,yDAqR9K5G,EAAAA,qBAEAA,EAAAA,uBAEAA,EAAAA,2BAEAA,EAAAA,2BAEAA,EAAAA,gCAEAA,EAAAA,mCAEAA,EAAAA,2BAEAA,EAAAA,qBAEAA,EAAAA,uBAEAA,EAAAA,uBAEAA,EAAAA,wBAEAA,EAAAA,8BAEAA,EAAAA,wBAEAA,EAAAA,wBAEAA,EAAAA,uBAEAA,EAAAA,qCAEAA,EAAAA,qCAEAA,EAAAA,4BAEA6G,EAAAA,UAASvH,KAAA,CAAC,mCAEVuH,EAAAA,UAASvH,KAAA,CAAC,+BAEVW,EAAAA,8BAEAA,EAAAA,uBAEAA,EAAAA,uBAEAA,EAAAA,6BAEAA,EAAAA,6BAEAA,EAAAA,0BAEA6G,EAAAA,gBAAexH,KAAA,CAACyH,EAAAA,wBAiWrB,iCALCC,EAAAA,SAAQ1H,KAAA,CAAC,CACN2H,QAAS,CAACC,EAAAA,aAAcC,EAAAA,aAAcC,EAAAA,cACtCC,QAAS,CAAC/M,EAAeE,EAAkB2M,EAAAA,cAC3CG,aAAc,CAAChN,EAAeE","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) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\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, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import { NgModule, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, TemplateRef, ContentChildren, QueryList, ElementRef, Output, EventEmitter, ViewChild, forwardRef, ChangeDetectorRef, Renderer2, OnDestroy, OnInit, AfterContentInit} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { SharedModule, PrimeTemplate } from 'primeng/api';\nimport { ObjectUtils } from 'primeng/utils';\nimport { DomHandler } from 'primeng/dom';\nimport { trigger,style,transition,animate,AnimationEvent} from '@angular/animations';\nimport { ConnectedOverlayScrollHandler } from 'primeng/dom';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { RippleModule } from 'primeng/ripple';\n\nexport const CASCADESELECT_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => CascadeSelect),\n multi: true\n};\n\n@Component({\n selector: 'p-cascadeSelectSub',\n template: `\n \n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class CascadeSelectSub implements OnInit {\n\n @Input() selectionPath: any[];\n\n @Input() options: any[];\n\n @Input() optionGroupChildren: any[];\n\n @Input() optionTemplate: TemplateRef;\n\n @Input() level: number = 0;\n\n @Input() optionLabel: string;\n\n @Input() optionValue: string;\n\n @Input() optionGroupLabel: string;\n\n @Input() dirty: boolean;\n\n @Input() root: boolean;\n\n @Output() onSelect: EventEmitter = new EventEmitter();\n\n @Output() onGroupSelect: EventEmitter = new EventEmitter();\n\n @Input() get parentActive(): boolean {\n return this._parentActive;\n };\n set parentActive(val) {\n if (!val) {\n this.activeOption = null;\n }\n\n this._parentActive = val;\n }\n\n activeOption: any = null;\n\n _parentActive: boolean;\n\n constructor(private el: ElementRef) { }\n\n ngOnInit() {\n if (this.selectionPath && this.options && !this.dirty) {\n for (let option of this.options) {\n if (this.selectionPath.includes(option)) {\n this.activeOption = option;\n break;\n }\n }\n }\n\n if (!this.root) {\n this.position();\n }\n }\n\n onOptionClick(event, option) {\n if (this.isOptionGroup(option)) {\n this.activeOption = (this.activeOption === option) ? null : option;\n\n this.onGroupSelect.emit({\n originalEvent: event,\n value: option\n });\n }\n else {\n this.onSelect.emit({\n originalEvent: event,\n value: this.getOptionValue(option)\n });\n }\n }\n\n onOptionSelect(event) {\n this.onSelect.emit(event);\n }\n\n onOptionGroupSelect(event) {\n this.onGroupSelect.emit(event);\n }\n\n getOptionLabel(option) {\n return this.optionLabel ? ObjectUtils.resolveFieldData(option, this.optionLabel) : option;\n }\n\n getOptionValue(option) {\n return this.optionValue ? ObjectUtils.resolveFieldData(option, this.optionValue) : option;\n }\n\n getOptionGroupLabel(optionGroup) {\n return this.optionGroupLabel ? ObjectUtils.resolveFieldData(optionGroup, this.optionGroupLabel) : null;\n }\n\n getOptionGroupChildren(optionGroup) {\n return ObjectUtils.resolveFieldData(optionGroup, this.optionGroupChildren[this.level]);\n }\n\n isOptionGroup(option) {\n return Object.prototype.hasOwnProperty.call(option, this.optionGroupChildren[this.level]);\n }\n\n getOptionLabelToRender(option) {\n return this.isOptionGroup(option) ? this.getOptionGroupLabel(option) : this.getOptionLabel(option);\n }\n\n getItemClass(option) {\n return {\n 'p-cascadeselect-item': true, \n 'p-cascadeselect-item-group': this.isOptionGroup(option),\n 'p-cascadeselect-item-active p-highlight': this.isOptionActive(option)\n }\n }\n\n isOptionActive(option) {\n return this.activeOption === option;\n }\n\n onKeyDown(event, option, index) {\n let listItem = event.currentTarget.parentElement;\n\n switch (event.key) {\n case 'Down':\n case 'ArrowDown':\n var nextItem = this.el.nativeElement.children[0].children[index + 1];\n if (nextItem) {\n nextItem.children[0].focus();\n }\n break;\n\n case 'Up':\n case 'ArrowUp':\n var prevItem = this.el.nativeElement.children[0].children[index - 1];\n if (prevItem) {\n prevItem.children[0].focus();\n }\n break;\n\n case 'Right':\n case 'ArrowRight':\n if (this.isOptionGroup(option)) {\n if (this.isOptionActive(option)) {\n listItem.children[1].children[0].children[0].children[0].focus();\n }\n else {\n this.activeOption = option;\n }\n }\n break;\n\n case 'Left':\n case 'ArrowLeft':\n this.activeOption = null;\n\n var parentList = listItem.parentElement.parentElement.parentElement;\n if (parentList) {\n parentList.children[0].focus();\n }\n break;\n\n case 'Enter':\n this.onOptionClick(event, option);\n break;\n }\n\n event.preventDefault();\n }\n\n position() {\n const parentItem = this.el.nativeElement.parentElement;\n const containerOffset = DomHandler.getOffset(parentItem);\n const viewport = DomHandler.getViewport();\n const sublistWidth = this.el.nativeElement.children[0].offsetParent ? this.el.nativeElement.children[0].offsetWidth : DomHandler.getHiddenElementOuterWidth(this.el.nativeElement.children[0]);\n const itemOuterWidth = DomHandler.getOuterWidth(parentItem.children[0]);\n\n if ((parseInt(containerOffset.left, 10) + itemOuterWidth + sublistWidth) > (viewport.width - DomHandler.calculateScrollbarWidth())) {\n this.el.nativeElement.children[0].style.left = '-200%';\n }\n }\n}\n\n@Component({\n selector: 'p-cascadeSelect',\n template: `\n
\n
\n \n
\n \n \n \n \n \n {{label()}}\n \n \n
\n \n
\n
\n
\n \n \n
\n
\n
\n `,\n animations: [\n trigger('overlayAnimation', [\n transition(':enter', [\n style({opacity: 0, transform: 'scaleY(0.8)'}),\n animate('{{showTransitionParams}}')\n ]),\n transition(':leave', [\n animate('{{hideTransitionParams}}', style({ opacity: 0 }))\n ])\n ])\n ],\n host: {\n '[class.p-inputwrapper-filled]': 'filled',\n '[class.p-inputwrapper-focus]': 'focused || overlayVisible'\n },\n providers: [CASCADESELECT_VALUE_ACCESSOR],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./cascadeselect.css']\n})\nexport class CascadeSelect implements OnInit, AfterContentInit, OnDestroy {\n\n @Input() styleClass: string;\n\n @Input() style: any;\n\n @Input() options: any[];\n\n @Input() optionLabel: string;\n\n @Input() optionValue: string;\n\n @Input() optionGroupLabel: string;\n\n @Input() optionGroupChildren: string;\n\n @Input() placeholder: string;\n \n @Input() value: string;\n\n @Input() dataKey: string;\n\n @Input() inputId: string;\n\n @Input() tabindex: string;\n \n @Input() ariaLabelledBy: string;\n\n @Input() appendTo: any;\n\n @Input() disabled: boolean;\n\n @Input() rounded: boolean;\n\n @Input() showTransitionOptions: string = '.12s cubic-bezier(0, 0, 0.2, 1)';\n\n @Input() hideTransitionOptions: string = '.1s linear';\n\n @ViewChild('focusInput') focusInputEl: ElementRef;\n\n @ViewChild('container') containerEl: ElementRef;\n\n @Output() onChange: EventEmitter = new EventEmitter();\n\n @Output() onGroupChange: EventEmitter = new EventEmitter();\n\n @Output() onShow: EventEmitter = new EventEmitter();\n\n @Output() onHide: EventEmitter = new EventEmitter();\n\n @Output() onBeforeShow: EventEmitter = new EventEmitter();\n\n @Output() onBeforeHide: EventEmitter = new EventEmitter();\n\n @ContentChildren(PrimeTemplate) templates: QueryList;\n\n selectionPath: any = null;\n\n focused: boolean = false;\n\n filled: boolean = false;\n\n overlayVisible: boolean = false;\n\n dirty: boolean = false;\n\n valueTemplate: TemplateRef;\n\n optionTemplate: TemplateRef;\n\n outsideClickListener: any;\n \n scrollHandler: any;\n \n resizeListener: any;\n\n overlayEl: any;\n\n onModelChange: Function = () => {};\n\n onModelTouched: Function = () => {};\n\n constructor(private el: ElementRef, private cd: ChangeDetectorRef) { }\n\n ngOnInit() {\n this.updateSelectionPath();\n }\n\n ngAfterContentInit() {\n this.templates.forEach((item) => {\n switch(item.getType()) {\n case 'value':\n this.valueTemplate = item.template;\n break;\n case 'option':\n this.optionTemplate = item.template;\n break;\n }\n });\n }\n\n onOptionSelect(event) {\n this.value = event.value;\n this.updateSelectionPath();\n this.onModelChange(this.value);\n this.onChange.emit(event);\n this.hide();\n this.focusInputEl.nativeElement.focus();\n }\n\n onOptionGroupSelect(event) {\n this.dirty = true;\n this.onGroupChange.emit(event);\n }\n\n getOptionLabel(option) {\n return this.optionLabel ? ObjectUtils.resolveFieldData(option, this.optionLabel) : option;\n }\n\n getOptionValue(option) {\n return this.optionValue ? ObjectUtils.resolveFieldData(option, this.optionValue) : option;\n }\n\n getOptionGroupChildren(optionGroup, level) {\n return ObjectUtils.resolveFieldData(optionGroup, this.optionGroupChildren[level]);\n }\n\n isOptionGroup(option, level) {\n return Object.prototype.hasOwnProperty.call(option, this.optionGroupChildren[level]);\n }\n\n updateSelectionPath() {\n let path;\n if (this.value != null && this.options) {\n for (let option of this.options) {\n path = this.findModelOptionInGroup(option, 0);\n if (path) {\n break;\n }\n }\n }\n\n this.selectionPath = path; \n this.updateFilledState();\n }\n\n updateFilledState() {\n this.filled = !(this.selectionPath == null || this.selectionPath.length == 0);\n }\n\n findModelOptionInGroup(option, level) {\n if (this.isOptionGroup(option, level)) {\n let selectedOption;\n for (let childOption of this.getOptionGroupChildren(option, level)) {\n selectedOption = this.findModelOptionInGroup(childOption, level + 1);\n if (selectedOption) {\n selectedOption.unshift(option);\n return selectedOption;\n }\n }\n }\n else if ((ObjectUtils.equals(this.value, this.getOptionValue(option), this.dataKey))) {\n return [option];\n }\n \n return null;\n }\n\n show() {\n this.onBeforeShow.emit();\n this.overlayVisible = true;\n }\n\n hide() {\n this.onBeforeHide.emit();\n this.overlayVisible = false;\n this.cd.markForCheck();\n }\n\n onClick(event) {\n if (this.disabled) {\n return;\n }\n\n if (!this.overlayEl || !this.overlayEl || !this.overlayEl.contains(event.target)) {\n if (this.overlayVisible){\n this.hide();\n }\n else{\n this.show();\n }\n\n this.focusInputEl.nativeElement.focus();\n }\n }\n\n onFocus() {\n this.focused = true;\n }\n\n onBlur() {\n this.focused = false;\n }\n\n onOverlayAnimationStart(event: AnimationEvent) {\n switch (event.toState) {\n case 'visible':\n this.overlayEl = event.element;\n this.onOverlayEnter();\n break;\n }\n }\n\n onOverlayAnimationDone(event: AnimationEvent) {\n switch (event.toState) {\n case 'void':\n this.onOverlayLeave();\n break;\n }\n }\n\n onOverlayEnter() {\n this.overlayEl.style.zIndex = String(DomHandler.generateZIndex());\n this.appendContainer();\n this.alignOverlay();\n this.bindOutsideClickListener();\n this.bindScrollListener();\n this.bindResizeListener();\n this.onShow.emit();\n }\n\n onOverlayLeave() {\n this.unbindOutsideClickListener();\n this.unbindScrollListener();\n this.unbindResizeListener();\n this.onHide.emit();\n this.overlayEl = null;\n this.dirty = false;\n }\n\n writeValue(value: any) : void {\n this.value = value;\n this.updateSelectionPath();\n this.cd.markForCheck();\n }\n\n registerOnChange(fn: Function): void {\n this.onModelChange = fn;\n }\n\n registerOnTouched(fn: Function): void {\n this.onModelTouched = fn;\n }\n\n setDisabledState(val: boolean): void {\n this.disabled = val;\n this.cd.markForCheck();\n }\n\n alignOverlay() {\n if (this.appendTo) {\n DomHandler.absolutePosition(this.overlayEl, this.containerEl.nativeElement);\n this.overlayEl.style.minWidth = DomHandler.getOuterWidth(this.containerEl.nativeElement) + 'px';\n } else {\n DomHandler.relativePosition(this.overlayEl, this.containerEl.nativeElement);\n }\n }\n\n bindOutsideClickListener() {\n if (!this.outsideClickListener) {\n this.outsideClickListener = (event) => {\n if (this.overlayVisible && this.overlayEl && !this.containerEl.nativeElement.contains(event.target) && !this.overlayEl.contains(event.target)) {\n this.hide();\n }\n };\n document.addEventListener('click', this.outsideClickListener);\n }\n }\n\n unbindOutsideClickListener() {\n if (this.outsideClickListener) {\n document.removeEventListener('click', this.outsideClickListener);\n this.outsideClickListener = null;\n }\n }\n\n bindScrollListener() {\n if (!this.scrollHandler) {\n this.scrollHandler = new ConnectedOverlayScrollHandler(this.containerEl.nativeElement, () => {\n if (this.overlayVisible) {\n this.hide();\n }\n });\n }\n\n this.scrollHandler.bindScrollListener();\n }\n\n unbindScrollListener() {\n if (this.scrollHandler) {\n this.scrollHandler.unbindScrollListener();\n }\n }\n\n bindResizeListener() {\n if (!this.resizeListener) {\n this.resizeListener = () => {\n if (this.overlayVisible) {\n this.hide();\n }\n };\n window.addEventListener('resize', this.resizeListener);\n }\n }\n\n unbindResizeListener() {\n if (this.resizeListener) {\n window.removeEventListener('resize', this.resizeListener);\n this.resizeListener = null;\n }\n }\n\n appendContainer() {\n if (this.appendTo) {\n if (this.appendTo === 'body')\n document.body.appendChild(this.overlayEl);\n else\n document.getElementById(this.appendTo).appendChild(this.overlayEl);\n }\n }\n\n restoreAppend() {\n if (this.overlayEl && this.appendTo) {\n if (this.appendTo === 'body')\n document.body.removeChild(this.overlayEl);\n else\n document.getElementById(this.appendTo).removeChild(this.overlayEl);\n }\n }\n\n label() {\n if (this.selectionPath)\n return this.getOptionLabel(this.selectionPath[this.selectionPath.length - 1]);\n else\n return this.placeholder||'p-emptylabel';\n }\n\n onKeyDown(event) {\n switch(event.key) {\n case 'Down':\n case 'ArrowDown':\n if (this.overlayVisible) {\n DomHandler.findSingle(this.overlayEl, '.p-cascadeselect-item').children[0].focus();\n }\n else if (event.altKey && this.options && this.options.length) {\n this.show();\n }\n event.preventDefault();\n break;\n\n case 'Escape':\n if (this.overlayVisible) {\n this.hide();\n event.preventDefault();\n }\n break;\n\n case 'Tab':\n this.hide();\n break;\n }\n }\n\n containerClass() {\n return {\n 'p-cascadeselect p-component p-inputwrapper': true,\n 'p-disabled': this.disabled,\n 'p-focus': this.focused\n };\n }\n\n labelClass() {\n return {\n 'p-cascadeselect-label': true,\n 'p-placeholder': this.label() === this.placeholder,\n 'p-cascadeselect-label-empty': !this.value && (this.label() === 'p-emptylabel' || this.label().length === 0)\n };\n }\n\n ngOnDestroy() {\n this.restoreAppend();\n this.unbindOutsideClickListener();\n this.unbindResizeListener();\n\n if (this.scrollHandler) {\n this.scrollHandler.destroy();\n this.scrollHandler = null;\n }\n this.overlayEl = null;\n }\n}\n\n@NgModule({\n imports: [CommonModule, SharedModule, RippleModule],\n exports: [CascadeSelect, CascadeSelectSub, SharedModule],\n declarations: [CascadeSelect, CascadeSelectSub]\n})\nexport class CascadeSelectModule { }\n"]}