@anglr/select 12.0.0 → 12.1.0-beta.20250516040933

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/changelog.md +11 -0
  2. package/es2015/elements/src/components/ngSelectElements.component.js +3 -3
  3. package/es2015/elements/src/components/ngSelectElements.component.js.map +1 -1
  4. package/es2015/elements/src/modules/ngSelectElements.module.js +4 -4
  5. package/es2015/elements/src/modules/ngSelectElements.module.js.map +1 -1
  6. package/es2015/material/src/components/basicDialogPopup/basicDialogPopup.component.js +3 -3
  7. package/es2015/material/src/components/basicDialogPopup/basicDialogPopup.component.js.map +1 -1
  8. package/es2015/material/src/directives/dialogPopup/dialogPopup.directive.js +3 -3
  9. package/es2015/material/src/directives/dialogPopup/dialogPopup.directive.js.map +1 -1
  10. package/es2015/material/src/modules/dialogPopup.module.js +4 -4
  11. package/es2015/material/src/modules/dialogPopup.module.js.map +1 -1
  12. package/es2015/material/src/modules/virtualEditPopup.module.js +4 -4
  13. package/es2015/material/src/modules/virtualEditPopup.module.js.map +1 -1
  14. package/es2015/material/src/plugins/popup/dialog/dialogPopup.component.js +3 -3
  15. package/es2015/material/src/plugins/popup/dialog/dialogPopup.component.js.map +1 -1
  16. package/es2015/material/src/plugins/popup/virtualEdit/virtualEditPopup.component.js +3 -3
  17. package/es2015/material/src/plugins/popup/virtualEdit/virtualEditPopup.component.js.map +1 -1
  18. package/es2015/src/components/option/optgroup.component.js +3 -3
  19. package/es2015/src/components/option/optgroup.component.js.map +1 -1
  20. package/es2015/src/components/option/option.component.js +3 -3
  21. package/es2015/src/components/option/option.component.js.map +1 -1
  22. package/es2015/src/components/select/select.component.js +6 -6
  23. package/es2015/src/components/select/select.component.js.map +1 -1
  24. package/es2015/src/directives/ngSelectAbsolute/ngSelectAbsolute.directive.js +3 -3
  25. package/es2015/src/directives/ngSelectAbsolute/ngSelectAbsolute.directive.js.map +1 -1
  26. package/es2015/src/directives/ngSelectEdit/ngSelectEdit.directive.js +3 -3
  27. package/es2015/src/directives/ngSelectEdit/ngSelectEdit.directive.js.map +1 -1
  28. package/es2015/src/directives/ngSelectPlaceholder/ngSelectPlaceholder.directive.js +3 -3
  29. package/es2015/src/directives/ngSelectPlaceholder/ngSelectPlaceholder.directive.js.map +1 -1
  30. package/es2015/src/misc/ngSelectControlValueAccessor.directive.js +3 -3
  31. package/es2015/src/misc/ngSelectControlValueAccessor.directive.js.map +1 -1
  32. package/es2015/src/misc/ngSelectOptions.interface.js.map +1 -1
  33. package/es2015/src/misc/pluginBus/pluginBus.js +3 -3
  34. package/es2015/src/misc/pluginBus/pluginBus.js.map +1 -1
  35. package/es2015/src/modules/ngSelect.module.js +4 -4
  36. package/es2015/src/modules/ngSelect.module.js.map +1 -1
  37. package/es2015/src/modules/ngSelectDynamic.module.js +4 -4
  38. package/es2015/src/modules/ngSelectDynamic.module.js.map +1 -1
  39. package/es2015/src/modules/ngSelectEdit.module.js +4 -4
  40. package/es2015/src/modules/ngSelectEdit.module.js.map +1 -1
  41. package/es2015/src/pipes/ngSelectHasValue.pipe.js +3 -3
  42. package/es2015/src/pipes/ngSelectHasValue.pipe.js.map +1 -1
  43. package/es2015/src/pipes/ngSelectValue.pipe.js +3 -3
  44. package/es2015/src/pipes/ngSelectValue.pipe.js.map +1 -1
  45. package/es2015/src/plugins/keyboardHandler/basic/basicKeyboardHandler.component.js +3 -3
  46. package/es2015/src/plugins/keyboardHandler/basic/basicKeyboardHandler.component.js.map +1 -1
  47. package/es2015/src/plugins/keyboardHandler/edit/editKeyboardHandler.component.js +3 -3
  48. package/es2015/src/plugins/keyboardHandler/edit/editKeyboardHandler.component.js.map +1 -1
  49. package/es2015/src/plugins/liveSearch/basic/basicLiveSearch.component.js +3 -3
  50. package/es2015/src/plugins/liveSearch/basic/basicLiveSearch.component.js.map +1 -1
  51. package/es2015/src/plugins/liveSearch/edit/editLiveSearch.component.js +3 -3
  52. package/es2015/src/plugins/liveSearch/edit/editLiveSearch.component.js.map +1 -1
  53. package/es2015/src/plugins/liveSearch/no/noLiveSearch.component.js +3 -3
  54. package/es2015/src/plugins/liveSearch/no/noLiveSearch.component.js.map +1 -1
  55. package/es2015/src/plugins/normalState/basic/basicNormalState.component.js +3 -3
  56. package/es2015/src/plugins/normalState/basic/basicNormalState.component.js.map +1 -1
  57. package/es2015/src/plugins/normalState/edit/editNormalState.component.js +3 -3
  58. package/es2015/src/plugins/normalState/edit/editNormalState.component.js.map +1 -1
  59. package/es2015/src/plugins/normalState/normalStateAbstract.component.js +3 -3
  60. package/es2015/src/plugins/normalState/normalStateAbstract.component.js.map +1 -1
  61. package/es2015/src/plugins/popup/basic/basicPopup.component.js +3 -3
  62. package/es2015/src/plugins/popup/basic/basicPopup.component.js.map +1 -1
  63. package/es2015/src/plugins/popup/edit/editPopup.component.js +3 -3
  64. package/es2015/src/plugins/popup/edit/editPopup.component.js.map +1 -1
  65. package/es2015/src/plugins/popup/popupAbstract.component.js +3 -3
  66. package/es2015/src/plugins/popup/popupAbstract.component.js.map +1 -1
  67. package/es2015/src/plugins/positioner/default/defaultPositioner.component.js +3 -3
  68. package/es2015/src/plugins/positioner/default/defaultPositioner.component.js.map +1 -1
  69. package/es2015/src/plugins/positioner/no/noPositioner.component.js +3 -3
  70. package/es2015/src/plugins/positioner/no/noPositioner.component.js.map +1 -1
  71. package/es2015/src/plugins/valueHandler/basic/basicValueHandler.component.js +3 -3
  72. package/es2015/src/plugins/valueHandler/basic/basicValueHandler.component.js.map +1 -1
  73. package/es2015/src/plugins/valueHandler/dynamic/dynamicValueHandler.component.js +3 -3
  74. package/es2015/src/plugins/valueHandler/dynamic/dynamicValueHandler.component.js.map +1 -1
  75. package/es2015/src/plugins/valueHandler/valueHandlerBase.js +3 -3
  76. package/es2015/src/plugins/valueHandler/valueHandlerBase.js.map +1 -1
  77. package/es2020/elements/src/components/ngSelectElements.component.js +3 -3
  78. package/es2020/elements/src/components/ngSelectElements.component.js.map +1 -1
  79. package/es2020/elements/src/modules/ngSelectElements.module.js +4 -4
  80. package/es2020/elements/src/modules/ngSelectElements.module.js.map +1 -1
  81. package/es2020/material/src/components/basicDialogPopup/basicDialogPopup.component.js +3 -3
  82. package/es2020/material/src/components/basicDialogPopup/basicDialogPopup.component.js.map +1 -1
  83. package/es2020/material/src/directives/dialogPopup/dialogPopup.directive.js +3 -3
  84. package/es2020/material/src/directives/dialogPopup/dialogPopup.directive.js.map +1 -1
  85. package/es2020/material/src/modules/dialogPopup.module.js +4 -4
  86. package/es2020/material/src/modules/dialogPopup.module.js.map +1 -1
  87. package/es2020/material/src/modules/virtualEditPopup.module.js +4 -4
  88. package/es2020/material/src/modules/virtualEditPopup.module.js.map +1 -1
  89. package/es2020/material/src/plugins/popup/dialog/dialogPopup.component.js +3 -3
  90. package/es2020/material/src/plugins/popup/dialog/dialogPopup.component.js.map +1 -1
  91. package/es2020/material/src/plugins/popup/virtualEdit/virtualEditPopup.component.js +3 -3
  92. package/es2020/material/src/plugins/popup/virtualEdit/virtualEditPopup.component.js.map +1 -1
  93. package/es2020/src/components/option/optgroup.component.js +3 -3
  94. package/es2020/src/components/option/optgroup.component.js.map +1 -1
  95. package/es2020/src/components/option/option.component.js +3 -3
  96. package/es2020/src/components/option/option.component.js.map +1 -1
  97. package/es2020/src/components/select/select.component.js +6 -6
  98. package/es2020/src/components/select/select.component.js.map +1 -1
  99. package/es2020/src/directives/ngSelectAbsolute/ngSelectAbsolute.directive.js +3 -3
  100. package/es2020/src/directives/ngSelectAbsolute/ngSelectAbsolute.directive.js.map +1 -1
  101. package/es2020/src/directives/ngSelectEdit/ngSelectEdit.directive.js +3 -3
  102. package/es2020/src/directives/ngSelectEdit/ngSelectEdit.directive.js.map +1 -1
  103. package/es2020/src/directives/ngSelectPlaceholder/ngSelectPlaceholder.directive.js +3 -3
  104. package/es2020/src/directives/ngSelectPlaceholder/ngSelectPlaceholder.directive.js.map +1 -1
  105. package/es2020/src/misc/ngSelectControlValueAccessor.directive.js +3 -3
  106. package/es2020/src/misc/ngSelectControlValueAccessor.directive.js.map +1 -1
  107. package/es2020/src/misc/ngSelectOptions.interface.js.map +1 -1
  108. package/es2020/src/misc/pluginBus/pluginBus.js +3 -3
  109. package/es2020/src/misc/pluginBus/pluginBus.js.map +1 -1
  110. package/es2020/src/modules/ngSelect.module.js +4 -4
  111. package/es2020/src/modules/ngSelect.module.js.map +1 -1
  112. package/es2020/src/modules/ngSelectDynamic.module.js +4 -4
  113. package/es2020/src/modules/ngSelectDynamic.module.js.map +1 -1
  114. package/es2020/src/modules/ngSelectEdit.module.js +4 -4
  115. package/es2020/src/modules/ngSelectEdit.module.js.map +1 -1
  116. package/es2020/src/pipes/ngSelectHasValue.pipe.js +3 -3
  117. package/es2020/src/pipes/ngSelectHasValue.pipe.js.map +1 -1
  118. package/es2020/src/pipes/ngSelectValue.pipe.js +3 -3
  119. package/es2020/src/pipes/ngSelectValue.pipe.js.map +1 -1
  120. package/es2020/src/plugins/keyboardHandler/basic/basicKeyboardHandler.component.js +3 -3
  121. package/es2020/src/plugins/keyboardHandler/basic/basicKeyboardHandler.component.js.map +1 -1
  122. package/es2020/src/plugins/keyboardHandler/edit/editKeyboardHandler.component.js +3 -3
  123. package/es2020/src/plugins/keyboardHandler/edit/editKeyboardHandler.component.js.map +1 -1
  124. package/es2020/src/plugins/liveSearch/basic/basicLiveSearch.component.js +3 -3
  125. package/es2020/src/plugins/liveSearch/basic/basicLiveSearch.component.js.map +1 -1
  126. package/es2020/src/plugins/liveSearch/edit/editLiveSearch.component.js +3 -3
  127. package/es2020/src/plugins/liveSearch/edit/editLiveSearch.component.js.map +1 -1
  128. package/es2020/src/plugins/liveSearch/no/noLiveSearch.component.js +3 -3
  129. package/es2020/src/plugins/liveSearch/no/noLiveSearch.component.js.map +1 -1
  130. package/es2020/src/plugins/normalState/basic/basicNormalState.component.js +3 -3
  131. package/es2020/src/plugins/normalState/basic/basicNormalState.component.js.map +1 -1
  132. package/es2020/src/plugins/normalState/edit/editNormalState.component.js +3 -3
  133. package/es2020/src/plugins/normalState/edit/editNormalState.component.js.map +1 -1
  134. package/es2020/src/plugins/normalState/normalStateAbstract.component.js +3 -3
  135. package/es2020/src/plugins/normalState/normalStateAbstract.component.js.map +1 -1
  136. package/es2020/src/plugins/popup/basic/basicPopup.component.js +3 -3
  137. package/es2020/src/plugins/popup/basic/basicPopup.component.js.map +1 -1
  138. package/es2020/src/plugins/popup/edit/editPopup.component.js +3 -3
  139. package/es2020/src/plugins/popup/edit/editPopup.component.js.map +1 -1
  140. package/es2020/src/plugins/popup/popupAbstract.component.js +3 -3
  141. package/es2020/src/plugins/popup/popupAbstract.component.js.map +1 -1
  142. package/es2020/src/plugins/positioner/default/defaultPositioner.component.js +3 -3
  143. package/es2020/src/plugins/positioner/default/defaultPositioner.component.js.map +1 -1
  144. package/es2020/src/plugins/positioner/no/noPositioner.component.js +3 -3
  145. package/es2020/src/plugins/positioner/no/noPositioner.component.js.map +1 -1
  146. package/es2020/src/plugins/valueHandler/basic/basicValueHandler.component.js +3 -3
  147. package/es2020/src/plugins/valueHandler/basic/basicValueHandler.component.js.map +1 -1
  148. package/es2020/src/plugins/valueHandler/dynamic/dynamicValueHandler.component.js +3 -3
  149. package/es2020/src/plugins/valueHandler/dynamic/dynamicValueHandler.component.js.map +1 -1
  150. package/es2020/src/plugins/valueHandler/valueHandlerBase.js +3 -3
  151. package/es2020/src/plugins/valueHandler/valueHandlerBase.js.map +1 -1
  152. package/package.json +1 -1
  153. package/src/misc/ngSelectOptions.interface.d.ts +6 -0
  154. package/src/misc/ngSelectOptions.interface.d.ts.map +1 -1
  155. package/version.bak +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"virtualEditPopup.component.js","sourceRoot":"","sources":["../../../../../../material/src/plugins/popup/virtualEdit/virtualEditPopup.component.ts","../../../../../../material/src/plugins/popup/virtualEdit/virtualEditPopup.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,uBAAuB,EAAE,SAAS,EAAE,SAAS,EAAC,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tualScrollViewport} from '@angular/cdk/scrolling';\nimport {EditPopupComponent, NgSelectPlugin, ɵNgSelectOption} from '@anglr/select';\n\nimport {VirtualEditPopup, VirtualEditPopupOptions} from './virtualEditPopup.interface';\n\n//TODO - resize and scroll\n//TODO - too few items and height\n//TODO - dynamic width update and collision with viewport\n\n/**\n * Component used for rendering virtual edit popup with options\n */\n@Component(\n{\n selector: 'div.ng-select-virtual-edit-popup',\n templateUrl: 'virtualEditPopup.component.html',\n styleUrls: ['virtualEditPopup.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class VirtualEditPopupComponent extends EditPopupComponent implements VirtualEditPopup, NgSelectPlugin<VirtualEditPopupOptions>\n{\n //######################### protected properties #########################\n\n /**\n * Currently stored max width of displayed popup\n */\n protected _maxWidth: number = 0;\n\n //######################### public properties - children #########################\n\n // /**\n // * \n // */\n // @ViewChildren('popupOptions')\n // public popupOptions: QueryList<ElementRef>;\n\n /**\n * View port that is used for virtual scrolling\n */\n @ViewChild(CdkVirtualScrollViewport)\n public viewPort: CdkVirtualScrollViewport;\n\n //######################### protected properties #########################\n\n /**\n * Gets currently available options\n */\n protected get availableOptions(): ɵNgSelectOption[]\n {\n return this.pluginBus.selectOptions.optionsGatherer.availableOptions;\n }\n\n //######################### public properties #########################\n\n public override invalidateVisuals()\n {\n super.invalidateVisuals();\n\n this._scrollToOption();\n }\n\n /**\n * Toggles popup visibility\n */\n protected override togglePopup(): void\n {\n super.togglePopup();\n\n if(this.viewPort)\n {\n this.viewPort.elementScrolled().subscribe(() =>\n {\n const viewportElement = this.viewPort?.getElementRef().nativeElement;\n\n if(viewportElement)\n {\n const width = viewportElement.children.item(0).clientWidth;\n\n if(width > this._maxWidth)\n {\n this._maxWidth = width;\n viewportElement.style.width = `${viewportElement.children.item(0).clientWidth}px`;\n }\n }\n });\n\n setTimeout(() =>\n {\n const viewportElement = this.viewPort?.getElementRef().nativeElement;\n \n viewportElement.style.width = `${viewportElement.children.item(0).clientWidth}px`;\n }, 0);\n \n this.viewPort.getElementRef().nativeElement.style.height = this.popupElement.style.maxHeight;\n this.viewPort.checkViewportSize();\n }\n else\n {\n this._maxWidth = 0;\n }\n }\n\n private _scrollToOption()\n {\n const activeOption = this.availableOptions.find(itm => itm.active);\n const index = activeOption ? this.availableOptions.indexOf(activeOption) : 0;\n\n this.viewPort?.scrollToIndex(index);\n\n // if (index === 0)\n // {\n // // scrollTop = 0;\n // }\n // else\n // {\n // // scrollTop = this._getOptionScrollPosition(this.viewPort.elementRef.nativeElement?.scrollTop);\n // }\n\n // console.log(scrollTop);\n\n // if (this.popupElement)\n // {\n // this.viewPort.elementRef.nativeElement.scrollTop = scrollTop;\n // }\n }\n\n // private _getOptionScrollPosition(currentScrollPosition: number)\n // {\n // const activeOptionsElement = this.popupOptions.toArray().find(el => el.nativeElement.classList.contains('active'))?.nativeElement;\n // const top = activeOptionsElement?.offsetTop;\n // const bottom = top + activeOptionsElement?.offsetHeight;\n \n // if (bottom > this.popupElement?.clientHeight + currentScrollPosition)\n // {\n // return Math.max(bottom - this.popupElement?.clientHeight);\n // }\n // else if (top < currentScrollPosition)\n // {\n // return Math.max(0, top);\n // }\n\n // return currentScrollPosition;\n // }\n}","<ng-template #defaultOptionTextLook let-option>{{option?.text}}</ng-template>\r\n\r\n<div #popupDiv \r\n *ngIf=\"options?.visible\"\r\n [ngClass]=\"options?.cssClasses?.popupDiv\">\r\n\r\n <cdk-virtual-scroll-viewport itemSize=\"28\" class=\"thin-scrollbar\">\r\n <div *cdkVirtualFor=\"let option of selectOptions\"\r\n #popupOptions\r\n [ngClass]=\"options?.cssClasses?.optionItemDiv\"\r\n [class.active]=\"option?.active\"\r\n [class.selected]=\"option?.selected\"\r\n (mouseenter)=\"handleMouseActivation(option)\"\r\n (click)=\"pluginBus?.optionSelect?.emit(option)\">\r\n <div [ngClass]=\"options?.cssClasses?.optionItemTextDiv\">\r\n <ng-container *ngTemplateOutlet=\"pluginBus?.selectOptions?.templateGatherer?.optionTemplate || defaultOptionTextLook; context: {$implicit: option, popup: this}\"></ng-container>\r\n </div>\r\n </div>\r\n </cdk-virtual-scroll-viewport>\r\n \r\n <div *ngIf=\"!selectOptions?.length\">{{texts?.noAvailableOptions}}</div>\r\n</div>"]}
1
+ {"version":3,"file":"virtualEditPopup.component.js","sourceRoot":"","sources":["../../../../../../material/src/plugins/popup/virtualEdit/virtualEditPopup.component.ts","../../../../../../material/src/plugins/popup/virtualEdit/virtualEditPopup.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,uBAAuB,EAAE,SAAS,EAAE,SAAS,EAAC,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAC,wBAAwB,EAAC,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAC,kBAAkB,EAAkC,MAAM,eAAe,CAAC;;;;AAIlF,0BAA0B;AAC1B,iCAAiC;AACjC,yDAAyD;AAEzD;;GAEG;AAQH,MAAM,OAAO,yBAA0B,SAAQ,kBAAkB;IAPjE;;QASI,0EAA0E;QAE1E;;WAEG;QACO,cAAS,GAAW,CAAC,CAAC;KAqHnC;IArGG,0EAA0E;IAE1E;;OAEG;IACH,IAAc,gBAAgB;QAE1B,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,eAAe,CAAC,gBAAgB,CAAC;IACzE,CAAC;IAED,uEAAuE;IAEvD,iBAAiB;QAE7B,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAE1B,IAAI,CAAC,eAAe,EAAE,CAAC;IAC3B,CAAC;IAED;;OAEG;IACgB,WAAW;QAE1B,KAAK,CAAC,WAAW,EAAE,CAAC;QAEpB,IAAG,IAAI,CAAC,QAAQ,EAChB;YACI,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE;gBAE3C,MAAM,eAAe,GAAG,IAAI,CAAC,QAAQ,EAAE,aAAa,EAAE,CAAC,aAAa,CAAC;gBAErE,IAAG,eAAe,EAClB;oBACI,MAAM,KAAK,GAAG,eAAe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,IAAI;QACJ,uGAAuG;QACvG,IAAI;QAEJ,0BAA0B;QAE1B,yBAAyB;QACzB,IAAI;QACJ,oEAAoE;QACpE,IAAI;IACR,CAAC;;uHAzGQ,yBAAyB;2GAAzB,yBAAyB,kHAoBvB,wBAAwB,uECxCvC,4lCAqBM;4FDDO,yBAAyB;kBAPrC,SAAS;+BAEI,kCAAkC,mBAG3B,uBAAuB,CAAC,MAAM;8BAuBxC,QAAQ;sBADd,SAAS;uBAAC,wBAAwB","sourcesContent":["import {ChangeDetectionStrategy, Component, ViewChild} from '@angular/core';\nimport {CdkVirtualScrollViewport} from '@angular/cdk/scrolling';\nimport {EditPopupComponent, NgSelectPlugin, ɵNgSelectOption} from '@anglr/select';\n\nimport {VirtualEditPopup, VirtualEditPopupOptions} from './virtualEditPopup.interface';\n\n//TODO - resize and scroll\n//TODO - too few items and height\n//TODO - dynamic width update and collision with viewport\n\n/**\n * Component used for rendering virtual edit popup with options\n */\n@Component(\n{\n selector: 'div.ng-select-virtual-edit-popup',\n templateUrl: 'virtualEditPopup.component.html',\n styleUrls: ['virtualEditPopup.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class VirtualEditPopupComponent extends EditPopupComponent implements VirtualEditPopup, NgSelectPlugin<VirtualEditPopupOptions>\n{\n //######################### protected properties #########################\n\n /**\n * Currently stored max width of displayed popup\n */\n protected _maxWidth: number = 0;\n\n //######################### public properties - children #########################\n\n // /**\n // * \n // */\n // @ViewChildren('popupOptions')\n // public popupOptions: QueryList<ElementRef>;\n\n /**\n * View port that is used for virtual scrolling\n */\n @ViewChild(CdkVirtualScrollViewport)\n public viewPort: CdkVirtualScrollViewport;\n\n //######################### protected properties #########################\n\n /**\n * Gets currently available options\n */\n protected get availableOptions(): ɵNgSelectOption[]\n {\n return this.pluginBus.selectOptions.optionsGatherer.availableOptions;\n }\n\n //######################### public properties #########################\n\n public override invalidateVisuals()\n {\n super.invalidateVisuals();\n\n this._scrollToOption();\n }\n\n /**\n * Toggles popup visibility\n */\n protected override togglePopup(): void\n {\n super.togglePopup();\n\n if(this.viewPort)\n {\n this.viewPort.elementScrolled().subscribe(() =>\n {\n const viewportElement = this.viewPort?.getElementRef().nativeElement;\n\n if(viewportElement)\n {\n const width = viewportElement.children.item(0).clientWidth;\n\n if(width > this._maxWidth)\n {\n this._maxWidth = width;\n viewportElement.style.width = `${viewportElement.children.item(0).clientWidth}px`;\n }\n }\n });\n\n setTimeout(() =>\n {\n const viewportElement = this.viewPort?.getElementRef().nativeElement;\n \n viewportElement.style.width = `${viewportElement.children.item(0).clientWidth}px`;\n }, 0);\n \n this.viewPort.getElementRef().nativeElement.style.height = this.popupElement.style.maxHeight;\n this.viewPort.checkViewportSize();\n }\n else\n {\n this._maxWidth = 0;\n }\n }\n\n private _scrollToOption()\n {\n const activeOption = this.availableOptions.find(itm => itm.active);\n const index = activeOption ? this.availableOptions.indexOf(activeOption) : 0;\n\n this.viewPort?.scrollToIndex(index);\n\n // if (index === 0)\n // {\n // // scrollTop = 0;\n // }\n // else\n // {\n // // scrollTop = this._getOptionScrollPosition(this.viewPort.elementRef.nativeElement?.scrollTop);\n // }\n\n // console.log(scrollTop);\n\n // if (this.popupElement)\n // {\n // this.viewPort.elementRef.nativeElement.scrollTop = scrollTop;\n // }\n }\n\n // private _getOptionScrollPosition(currentScrollPosition: number)\n // {\n // const activeOptionsElement = this.popupOptions.toArray().find(el => el.nativeElement.classList.contains('active'))?.nativeElement;\n // const top = activeOptionsElement?.offsetTop;\n // const bottom = top + activeOptionsElement?.offsetHeight;\n \n // if (bottom > this.popupElement?.clientHeight + currentScrollPosition)\n // {\n // return Math.max(bottom - this.popupElement?.clientHeight);\n // }\n // else if (top < currentScrollPosition)\n // {\n // return Math.max(0, top);\n // }\n\n // return currentScrollPosition;\n // }\n}","<ng-template #defaultOptionTextLook let-option>{{option?.text}}</ng-template>\r\n\r\n<div #popupDiv \r\n *ngIf=\"options?.visible\"\r\n [ngClass]=\"options?.cssClasses?.popupDiv\">\r\n\r\n <cdk-virtual-scroll-viewport itemSize=\"28\" class=\"thin-scrollbar\">\r\n <div *cdkVirtualFor=\"let option of selectOptions\"\r\n #popupOptions\r\n [ngClass]=\"options?.cssClasses?.optionItemDiv\"\r\n [class.active]=\"option?.active\"\r\n [class.selected]=\"option?.selected\"\r\n (mouseenter)=\"handleMouseActivation(option)\"\r\n (click)=\"pluginBus?.optionSelect?.emit(option)\">\r\n <div [ngClass]=\"options?.cssClasses?.optionItemTextDiv\">\r\n <ng-container *ngTemplateOutlet=\"pluginBus?.selectOptions?.templateGatherer?.optionTemplate || defaultOptionTextLook; context: {$implicit: option, popup: this}\"></ng-container>\r\n </div>\r\n </div>\r\n </cdk-virtual-scroll-viewport>\r\n \r\n <div *ngIf=\"!selectOptions?.length\">{{texts?.noAvailableOptions}}</div>\r\n</div>"]}
@@ -35,9 +35,9 @@ export class OptGroupComponent {
35
35
  });
36
36
  }
37
37
  }
38
- OptGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: OptGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
39
- OptGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: OptGroupComponent, selector: "ng-select>ng-optgroup", inputs: { text: "text" }, viewQueries: [{ propertyName: "optionsChildren", predicate: OptionComponent, descendants: true }], ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
40
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: OptGroupComponent, decorators: [{
38
+ OptGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: OptGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
39
+ OptGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: OptGroupComponent, selector: "ng-select>ng-optgroup", inputs: { text: "text" }, viewQueries: [{ propertyName: "optionsChildren", predicate: OptionComponent, descendants: true }], ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
40
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: OptGroupComponent, decorators: [{
41
41
  type: Component,
42
42
  args: [{
43
43
  selector: 'ng-select>ng-optgroup',
@@ -1 +1 @@
1
- {"version":3,"file":"optgroup.component.js","sourceRoot":"","sources":["../../../../src/components/option/optgroup.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAgB,MAAM,eAAe,CAAC;AAI9H,OAAO,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;;AAEnD;;GAEG;AAOH,MAAM,OAAO,iBAAiB;IAN9B;QAQI,oEAAoE;QAEpE;;WAEG;QACK,mBAAc,GAAuB,IAAI,YAAY,EAAQ,CAAC;KAiDzE;IA/CG,uEAAuE;IAEvE;;OAEG;IACH,IAAW,OAAO;QAEd,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,IAAW,aAAa;QAEpB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAmBD,sGAAsG;IAEtG;;OAEG;IACI,eAAe;QAElB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,EAAE;YAExC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;QAC/B,CAAC,CAAC,CAAC;IACP,CAAC;;8GAvDQ,iBAAiB;kGAAjB,iBAAiB,2HAiCZ,eAAe,gDApCnB,EAAE;2FAGH,iBAAiB;kBAN7B,SAAS;mBACV;oBACI,QAAQ,EAAE,uBAAuB;oBACjC,QAAQ,EAAE,EAAE;oBACZ,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAClD;8BAmCU,eAAe;sBADrB,YAAY;uBAAC,eAAe;gBAStB,IAAI;sBADV,KAAK","sourcesContent":["import {Component, ChangeDetectionStrategy, Input, EventEmitter, QueryList, ViewChildren, AfterViewInit} from '@angular/core';\n\nimport {NgSelectOptGroup} from './optgroup.interface';\nimport {NgSelectOption} from './option.interface';\nimport {OptionComponent} from './option.component';\n\n/**\n * Component used for options group in select component\n */\n@Component(\n{\n selector: 'ng-select>ng-optgroup',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class OptGroupComponent<TValue = any> implements NgSelectOptGroup<TValue>, AfterViewInit\n{\n //######################### private fields #########################\n\n /**\n * Instance of event emitter for optionsChange\n */\n private _optionsChange: EventEmitter<void> = new EventEmitter<void>();\n\n //######################### public properties #########################\n\n /**\n * Options assigned to this options group\n */\n public get options(): NgSelectOption<TValue>[]\n {\n return this.optionsChildren.toArray();\n }\n\n /**\n * Occurs when options in this group change\n */\n public get optionsChange(): EventEmitter<void>\n {\n return this._optionsChange;\n }\n\n //######################### public properties - children #########################\n\n /**\n * Children options in this group\n * @internal\n */\n @ViewChildren(OptionComponent)\n public optionsChildren: QueryList<NgSelectOption<TValue>>;\n\n //######################### public properties - inputs #########################\n\n /**\n * Text that is displayed for this options group\n */\n @Input()\n public text: string;\n\n //######################### public methods - implementation of AfterViewInit #########################\n \n /**\n * Called when view was initialized\n */\n public ngAfterViewInit()\n {\n this.optionsChildren.changes.subscribe(() =>\n {\n this._optionsChange.emit();\n });\n }\n}"]}
1
+ {"version":3,"file":"optgroup.component.js","sourceRoot":"","sources":["../../../../src/components/option/optgroup.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAgB,MAAM,eAAe,CAAC;AAI9H,OAAO,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;;AAEnD;;GAEG;AAOH,MAAM,OAAO,iBAAiB;IAN9B;QAQI,oEAAoE;QAEpE;;WAEG;QACK,mBAAc,GAAuB,IAAI,YAAY,EAAQ,CAAC;KAiDzE;IA/CG,uEAAuE;IAEvE;;OAEG;IACH,IAAW,OAAO;QAEd,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,IAAW,aAAa;QAEpB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAmBD,sGAAsG;IAEtG;;OAEG;IACI,eAAe;QAElB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,EAAE;YAExC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;QAC/B,CAAC,CAAC,CAAC;IACP,CAAC;;+GAvDQ,iBAAiB;mGAAjB,iBAAiB,2HAiCZ,eAAe,gDApCnB,EAAE;4FAGH,iBAAiB;kBAN7B,SAAS;mBACV;oBACI,QAAQ,EAAE,uBAAuB;oBACjC,QAAQ,EAAE,EAAE;oBACZ,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAClD;8BAmCU,eAAe;sBADrB,YAAY;uBAAC,eAAe;gBAStB,IAAI;sBADV,KAAK","sourcesContent":["import {Component, ChangeDetectionStrategy, Input, EventEmitter, QueryList, ViewChildren, AfterViewInit} from '@angular/core';\n\nimport {NgSelectOptGroup} from './optgroup.interface';\nimport {NgSelectOption} from './option.interface';\nimport {OptionComponent} from './option.component';\n\n/**\n * Component used for options group in select component\n */\n@Component(\n{\n selector: 'ng-select>ng-optgroup',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class OptGroupComponent<TValue = any> implements NgSelectOptGroup<TValue>, AfterViewInit\n{\n //######################### private fields #########################\n\n /**\n * Instance of event emitter for optionsChange\n */\n private _optionsChange: EventEmitter<void> = new EventEmitter<void>();\n\n //######################### public properties #########################\n\n /**\n * Options assigned to this options group\n */\n public get options(): NgSelectOption<TValue>[]\n {\n return this.optionsChildren.toArray();\n }\n\n /**\n * Occurs when options in this group change\n */\n public get optionsChange(): EventEmitter<void>\n {\n return this._optionsChange;\n }\n\n //######################### public properties - children #########################\n\n /**\n * Children options in this group\n * @internal\n */\n @ViewChildren(OptionComponent)\n public optionsChildren: QueryList<NgSelectOption<TValue>>;\n\n //######################### public properties - inputs #########################\n\n /**\n * Text that is displayed for this options group\n */\n @Input()\n public text: string;\n\n //######################### public methods - implementation of AfterViewInit #########################\n \n /**\n * Called when view was initialized\n */\n public ngAfterViewInit()\n {\n this.optionsChildren.changes.subscribe(() =>\n {\n this._optionsChange.emit();\n });\n }\n}"]}
@@ -21,9 +21,9 @@ export class OptionComponent {
21
21
  this.group = null;
22
22
  }
23
23
  }
24
- OptionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: OptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
25
- OptionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: OptionComponent, selector: "ng-option", inputs: { value: "value", text: "text" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
26
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: OptionComponent, decorators: [{
24
+ OptionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: OptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
25
+ OptionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: OptionComponent, selector: "ng-option", inputs: { value: "value", text: "text" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
26
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: OptionComponent, decorators: [{
27
27
  type: Component,
28
28
  args: [{
29
29
  selector: 'ng-option',
@@ -1 +1 @@
1
- {"version":3,"file":"option.component.js","sourceRoot":"","sources":["../../../../src/components/option/option.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;;AAIxE;;GAEG;AAOH,MAAM,OAAO,eAAe;IAN5B;QAQI,2FAA2F;QAE3F;;WAEG;QACI,WAAM,GAAY,KAAK,CAAC;QAE/B;;WAEG;QACI,aAAQ,GAAY,KAAK,CAAC;QAgBjC,uEAAuE;QAEvE;;WAEG;QACI,UAAK,GAAW,IAAI,CAAC;KAC/B;;4GAlCY,eAAe;gGAAf,eAAe,2FAHd,EAAE;2FAGH,eAAe;kBAN3B,SAAS;mBACV;oBACI,QAAQ,EAAE,WAAW;oBACrB,QAAQ,EAAE,EAAE;oBACZ,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAClD;8BAqBU,KAAK;sBADX,KAAK;gBAOC,IAAI;sBADV,KAAK","sourcesContent":["import {Component, ChangeDetectionStrategy, Input} from '@angular/core';\n\nimport {NgSelectOption} from './option.interface';\n\n/**\n * Component used for options in select component\n */\n@Component(\n{\n selector: 'ng-option',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class OptionComponent<TValue = any> implements NgSelectOption<TValue>\n{\n //######################### public properties - template bindings #########################\n\n /**\n * Indication whether is item active\n */\n public active: boolean = false;\n\n /**\n * Indication whether this option is selected\n */\n public selected: boolean = false;\n\n //######################### public properties - inputs #########################\n\n /**\n * Value that will be used if this option will be selected\n */\n @Input()\n public value: TValue;\n\n /**\n * Text that is displayed if this value is selected\n */\n @Input()\n public text: string;\n \n //######################### public properties #########################\n\n /**\n * If specified this option will be displayed in group\n */\n public group: string = null;\n}"]}
1
+ {"version":3,"file":"option.component.js","sourceRoot":"","sources":["../../../../src/components/option/option.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;;AAIxE;;GAEG;AAOH,MAAM,OAAO,eAAe;IAN5B;QAQI,2FAA2F;QAE3F;;WAEG;QACI,WAAM,GAAY,KAAK,CAAC;QAE/B;;WAEG;QACI,aAAQ,GAAY,KAAK,CAAC;QAgBjC,uEAAuE;QAEvE;;WAEG;QACI,UAAK,GAAW,IAAI,CAAC;KAC/B;;6GAlCY,eAAe;iGAAf,eAAe,2FAHd,EAAE;4FAGH,eAAe;kBAN3B,SAAS;mBACV;oBACI,QAAQ,EAAE,WAAW;oBACrB,QAAQ,EAAE,EAAE;oBACZ,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAClD;8BAqBU,KAAK;sBADX,KAAK;gBAOC,IAAI;sBADV,KAAK","sourcesContent":["import {Component, ChangeDetectionStrategy, Input} from '@angular/core';\n\nimport {NgSelectOption} from './option.interface';\n\n/**\n * Component used for options in select component\n */\n@Component(\n{\n selector: 'ng-option',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class OptionComponent<TValue = any> implements NgSelectOption<TValue>\n{\n //######################### public properties - template bindings #########################\n\n /**\n * Indication whether is item active\n */\n public active: boolean = false;\n\n /**\n * Indication whether this option is selected\n */\n public selected: boolean = false;\n\n //######################### public properties - inputs #########################\n\n /**\n * Value that will be used if this option will be selected\n */\n @Input()\n public value: TValue;\n\n /**\n * Text that is displayed if this value is selected\n */\n @Input()\n public text: string;\n \n //######################### public properties #########################\n\n /**\n * If specified this option will be displayed in group\n */\n public group: string = null;\n}"]}
@@ -1,5 +1,5 @@
1
1
  import { Component, ChangeDetectionStrategy, Input, Inject, ChangeDetectorRef, Optional, Type, ContentChildren, QueryList, EventEmitter, forwardRef, resolveForwardRef, ElementRef, Attribute, TemplateRef, ContentChild, ComponentFactoryResolver, ApplicationRef, Injector } from '@angular/core';
2
- import { extend, nameof, isBoolean, isPresent, isString } from '@jscrpt/common';
2
+ import { extend, nameof, isBoolean, isPresent, isString, renderToBody } from '@jscrpt/common';
3
3
  import { BehaviorSubject } from 'rxjs';
4
4
  import { NG_SELECT_OPTIONS, KEYBOARD_HANDLER_TYPE, NORMAL_STATE_TYPE, POPUP_TYPE, POSITIONER_TYPE, READONLY_STATE_TYPE, VALUE_HANDLER_TYPE, LIVE_SEARCH_TYPE } from '../../misc/types';
5
5
  import { NG_SELECT_PLUGIN_INSTANCES } from './types';
@@ -454,7 +454,7 @@ export class NgSelectComponent {
454
454
  }
455
455
  this._absolutePopupType = component;
456
456
  this._absolutePopupElement = this.liveSearchElement[0][0];
457
- // 1. Create a component reference from the component
457
+ // 1. Create a component reference from the component
458
458
  this._absolutePopup = this._componentFactoryResolver
459
459
  .resolveComponentFactory(component)
460
460
  .create(this._injector, this.liveSearchElement);
@@ -464,7 +464,7 @@ export class NgSelectComponent {
464
464
  const domElem = this._absolutePopup.hostView
465
465
  .rootNodes[0];
466
466
  // 4. Append DOM element to the body
467
- document.body.appendChild(domElem);
467
+ renderToBody(document, domElem, this._selectOptions.containerElement);
468
468
  this.setPopupComponent(this._absolutePopup.instance);
469
469
  }
470
470
  /**
@@ -500,8 +500,8 @@ export class NgSelectComponent {
500
500
  }
501
501
  }
502
502
  }
503
- NgSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgSelectComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.ComponentFactoryResolver }, { token: i0.ApplicationRef }, { token: i0.Injector }, { token: i1.PluginBus }, { token: NG_SELECT_PLUGIN_INSTANCES }, { token: NG_SELECT_OPTIONS, optional: true }, { token: NORMAL_STATE_TYPE, optional: true }, { token: KEYBOARD_HANDLER_TYPE, optional: true }, { token: POPUP_TYPE, optional: true }, { token: POSITIONER_TYPE, optional: true }, { token: READONLY_STATE_TYPE, optional: true }, { token: VALUE_HANDLER_TYPE, optional: true }, { token: LIVE_SEARCH_TYPE, optional: true }, { token: 'readonly', attribute: true }, { token: 'disabled', attribute: true }, { token: 'multiple', attribute: true }], target: i0.ɵɵFactoryTarget.Component });
504
- NgSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: NgSelectComponent, selector: "ng-select", inputs: { selectOptions: "selectOptions", disabled: "disabled", readonly: "readonly" }, providers: [
503
+ NgSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgSelectComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.ComponentFactoryResolver }, { token: i0.ApplicationRef }, { token: i0.Injector }, { token: i1.PluginBus }, { token: NG_SELECT_PLUGIN_INSTANCES }, { token: NG_SELECT_OPTIONS, optional: true }, { token: NORMAL_STATE_TYPE, optional: true }, { token: KEYBOARD_HANDLER_TYPE, optional: true }, { token: POPUP_TYPE, optional: true }, { token: POSITIONER_TYPE, optional: true }, { token: READONLY_STATE_TYPE, optional: true }, { token: VALUE_HANDLER_TYPE, optional: true }, { token: LIVE_SEARCH_TYPE, optional: true }, { token: 'readonly', attribute: true }, { token: 'disabled', attribute: true }, { token: 'multiple', attribute: true }], target: i0.ɵɵFactoryTarget.Component });
504
+ NgSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: NgSelectComponent, selector: "ng-select", inputs: { selectOptions: "selectOptions", disabled: "disabled", readonly: "readonly" }, providers: [
505
505
  {
506
506
  provide: NG_SELECT_PLUGIN_INSTANCES,
507
507
  useFactory: () => { return {}; }
@@ -511,7 +511,7 @@ NgSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
511
511
  useClass: PluginBus
512
512
  }
513
513
  ], queries: [{ propertyName: "normalStateTemplate", first: true, predicate: ["normalStateTemplate"], descendants: true }, { propertyName: "optionTemplate", first: true, predicate: ["optionTemplate"], descendants: true }, { propertyName: "optionsChildren", predicate: OptionComponent }, { propertyName: "optGroupsChildren", predicate: OptGroupComponent }], usesOnChanges: true, ngImport: i0, template: "<ng-template [ngComponentOutletEx]=\"selectOptions?.plugins?.liveSearch?.type\" (ngComponentOutletExCreated)=\"setLiveSearchComponent($event)\"></ng-template>\r\n<ng-template [ngComponentOutletEx]=\"selectOptions?.plugins?.positioner?.type\" (ngComponentOutletExCreated)=\"setPositionerComponent($event)\"></ng-template>\r\n<ng-template [ngComponentOutletEx]=\"selectOptions?.plugins?.keyboardHandler?.type\" (ngComponentOutletExCreated)=\"setKeyboardHandlerComponent($event)\"></ng-template>\r\n<ng-template [ngComponentOutletEx]=\"selectOptions?.plugins?.valueHandler?.type\" (ngComponentOutletExCreated)=\"setValueHandlerComponent($event)\"></ng-template>\r\n\r\n<div>\r\n <ng-template [ngIf]=\"!selectOptions?.readonly\">\r\n <ng-template [ngComponentOutletEx]=\"selectOptions?.plugins?.normalState?.type\" (ngComponentOutletExCreated)=\"setNormalStateComponent($event)\" [ngComponentOutletExContent]=\"liveSearchElement\"></ng-template>\r\n </ng-template>\r\n\r\n <ng-template [ngIf]=\"selectOptions?.readonly\">\r\n <ng-template [ngComponentOutletEx]=\"selectOptions?.plugins?.readonlyState?.type\" (ngComponentOutletExCreated)=\"setReadonlyStateComponent($event)\"></ng-template>\r\n </ng-template>\r\n\r\n <ng-template [ngIf]=\"!selectOptions?.absolute\">\r\n <ng-template [ngComponentOutletEx]=\"selectOptions?.plugins?.popup?.type\" (ngComponentOutletExCreated)=\"setPopupComponent($event)\" [ngComponentOutletExContent]=\"liveSearchElement\"></ng-template>\r\n </ng-template>\r\n</div>", styles: [":host\n {\n display: block;\n position: relative;\n }"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgComponentOutletEx, selector: "[ngComponentOutletEx]", inputs: ["ngComponentOutletEx", "ngComponentOutletExInjector", "ngComponentOutletExContent"], outputs: ["ngComponentOutletExCreated"], exportAs: ["ngComponentOutletEx"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
514
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgSelectComponent, decorators: [{
514
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgSelectComponent, decorators: [{
515
515
  type: Component,
516
516
  args: [{ selector: 'ng-select', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
517
517
  {
@@ -1 +1 @@
1
- {"version":3,"file":"select.component.js","sourceRoot":"","sources":["../../../../src/components/select/select.component.ts","../../../../src/components/select/select.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAmB,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,IAAI,EAAyB,eAAe,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAA4B,SAAS,EAAa,WAAW,EAAE,YAAY,EAAE,wBAAwB,EAAE,cAAc,EAAE,QAAQ,EAA+C,MAAM,eAAe,CAAC;AAC7Z,OAAO,EAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAC,eAAe,EAA2B,MAAM,MAAM,CAAC;AAG/D,OAAO,EAAC,iBAAiB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,UAAU,EAAE,eAAe,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAErL,OAAO,EAAC,0BAA0B,EAAC,MAAM,SAAS,CAAC;AAEnD,OAAO,EAAC,6BAA6B,EAAC,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAC,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AAErE,OAAO,EAAC,YAAY,EAAC,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAC,yBAAyB,EAAC,MAAM,sCAAsC,CAAC;AAE/E,OAAO,E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eAAe;gBASzB,iBAAiB;sBADvB,eAAe;uBAAC,iBAAiB","sourcesContent":["import {Component, ChangeDetectionStrategy, FactoryProvider, Input, Inject, ChangeDetectorRef, Optional, Type, AfterViewInit, OnInit, ContentChildren, QueryList, EventEmitter, forwardRef, resolveForwardRef, ElementRef, OnChanges, SimpleChanges, Attribute, OnDestroy, TemplateRef, ContentChild, ComponentFactoryResolver, ApplicationRef, Injector, EmbeddedViewRef, ComponentRef, ClassProvider} from '@angular/core';\nimport {extend, nameof, isBoolean, isPresent, isString} from '@jscrpt/common';\nimport {BehaviorSubject, Observable, Subscription} from 'rxjs';\n\nimport {NgSelectOptions, NgSelectPlugin, PluginDescription, NormalizeFunc, NgSelectPluginTypes} from '../../misc';\nimport {NG_SELECT_OPTIONS, KEYBOARD_HANDLER_TYPE, NORMAL_STATE_TYPE, POPUP_TYPE, POSITIONER_TYPE, READONLY_STATE_TYPE, VALUE_HANDLER_TYPE, LIVE_SEARCH_TYPE} from '../../misc/types';\nimport {NgSelect, NgSelectPluginInstances, NgSelectAction, NgSelectFunction} from './select.interface';\nimport {NG_SELECT_PLUGIN_INSTANCES} from './types';\nimport {KeyboardHandler} from '../../plugins/keyboardHandler';\nimport {BasicKeyboardHandlerComponent} from '../../plugins/keyboardHandler/components';\nimport {KEYBOARD_HANDLER} from '../../plugins/keyboardHandler/types';\nimport {NormalState, NormalStateContext} from '../../plugins/normalState';\nimport {NORMAL_STATE} from '../../plugins/normalState/types';\nimport {BasicNormalStateComponent} from '../../plugins/normalState/components';\nimport {Popup, PopupContext} from '../../plugins/popup';\nimport {POPUP} from '../../plugins/popup/types';\nimport {BasicPopupComponent} from '../../plugins/popup/component';\nimport {Positioner} from '../../plugins/positioner';\nimport {POSITIONER} from '../../plugins/positioner/types';\nimport {DefaultPositionerComponent} from '../../plugins/positioner/components';\nimport {ReadonlyState} from '../../plugins/readonlyState';\nimport {READONLY_STATE} from '../../plugins/readonlyState/types';\nimport {ValueHandler} from '../../plugins/valueHandler';\nimport {VALUE_HANDLER} from '../../plugins/valueHandler/types';\nimport {BasicValueHandlerComponent} from '../../plugins/valueHandler/components';\nimport {LiveSearch} from '../../plugins/liveSearch';\nimport {LIVE_SEARCH} from '../../plugins/liveSearch/types';\nimport {NoLiveSearchComponent} from '../../plugins/liveSearch/components';\nimport {NgSelectOption, NgSelectOptGroup} from '../option';\nimport {OptionComponent} from '../option/option.component';\nimport {OptGroupComponent} from '../option/optgroup.component';\nimport {PluginBus} from '../../misc/pluginBus/pluginBus';\nimport {PluginBusEvents} from '../../misc/pluginBus/pluginBus.interface';\n\n//TODO - dynamic change of absolute popup\n//TODO - dynamic change of options gatherer destroy called properly ?\n\n/**\n * Default 'NgSelectOptions'\n * @internal\n */\nconst defaultOptions: NgSelectOptions =\n{\n autoInitialize: true,\n absolute: false,\n forceValueCheckOnInit: false,\n multiple: false,\n readonly: false,\n valueComparer: (source, target) =>\n {\n return source === target;\n },\n liveSearchFilter: (query: string, normalizer: NormalizeFunc = value => value) =>\n {\n return itm => normalizer(itm.text).indexOf(normalizer(query)) >= 0;\n },\n normalizer: value =>\n {\n if(isString(value))\n {\n return value.toLowerCase();\n }\n\n return value;\n },\n cssClasses:\n {\n },\n plugins:\n {\n normalState: <PluginDescription<BasicNormalStateComponent>>\n {\n type: forwardRef(() => BasicNormalStateComponent)\n },\n liveSearch: <PluginDescription<NoLiveSearchComponent>>\n {\n type: forwardRef(() => NoLiveSearchComponent)\n },\n popup: <PluginDescription<BasicPopupComponent>>\n {\n type: forwardRef(() => BasicPopupComponent)\n },\n positioner: <PluginDescription<DefaultPositionerComponent>>\n {\n type: forwardRef(() => DefaultPositionerComponent)\n },\n keyboardHandler: <PluginDescription<BasicKeyboardHandlerComponent>>\n {\n type: forwardRef(() => BasicKeyboardHandlerComponent)\n },\n readonlyState: <PluginDescription<ReadonlyState>>\n {\n type: forwardRef(() => BasicNormalStateComponent)\n },\n valueHandler: <PluginDescription<BasicValueHandlerComponent>>\n {\n type: forwardRef(() => BasicValueHandlerComponent)\n }\n }\n};\n\n/**\n * Component that represents NgSelect itself, allows selection of value from options\n */\n@Component(\n{\n selector: 'ng-select',\n templateUrl: 'select.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers:\n [\n <FactoryProvider>\n {\n provide: NG_SELECT_PLUGIN_INSTANCES,\n useFactory: () => {return {};}\n },\n <ClassProvider>\n {\n provide: PluginBus,\n useClass: PluginBus\n }\n ],\n styles: [\n `:host\n {\n display: block;\n position: relative;\n }`\n ]\n})\nexport class NgSelectComponent<TValue = any> implements NgSelect<TValue>, OnChanges, OnInit, AfterViewInit, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * NgSelect options\n */\n protected _selectOptions: NgSelectOptions<TValue>;\n\n /**\n * Subject used for indication that NgSelect was initialized\n */\n protected _initializedSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);\n\n /**\n * Occurs when array of provided options has changed\n */\n protected _optionsChange: EventEmitter<void> = new EventEmitter<void>();\n\n /**\n * Occurs when array of visible, displayed options has changed\n */\n protected _availableOptionsChange: EventEmitter<void> = new EventEmitter<void>();\n\n /**\n * Array of available options to be displayed\n */\n protected _availableOptions: NgSelectOption<TValue>[] = [];\n\n /**\n * Live search plugin currently used in NgSelect\n */\n protected _liveSearch: LiveSearch;\n\n /**\n * Subscription for changes of live search value\n */\n protected _searchValueChangeSubscription: Subscription;\n\n /**\n * Instance of component ref for absolute popup\n */\n protected _absolutePopup: ComponentRef<Popup>;\n\n /**\n * Instance of type that is used as absolute popup\n */\n protected _absolutePopupType: Type<Popup>;\n\n /**\n * Instance of html element that is used\n */\n protected _absolutePopupElement: HTMLElement;\n\n //######################### public properties - inputs #########################\n\n /**\n * Gets or sets NgSelect options\n */\n @Input()\n public get selectOptions(): NgSelectOptions<TValue>\n {\n return this._selectOptions;\n }\n public set selectOptions(options: NgSelectOptions<TValue>)\n {\n this._selectOptions = extend(true, this._selectOptions, options);\n this._pluginBus.selectOptions = this._selectOptions;\n }\n\n /**\n * Indication whether should be NgSelect disabled or not\n */\n @Input()\n public disabled: boolean;\n\n /**\n * Indication whether should be NgSelect readonly or not\n */\n @Input()\n public readonly: boolean;\n\n //######################### public properties - implementation of NgSelect #########################\n\n /**\n * Occurs every time when NgSelect is initialized or reinitialized, if value is false NgSelect was not initialized yet\n */\n public get initialized(): Observable<boolean>\n {\n return this._initializedSubject.asObservable();\n }\n\n /**\n * Gets current state of initialization\n */\n public isInitialized: boolean = false;\n\n //######################### public properties - implementation of TemplateGatherer #########################\n\n /**\n * Template used within normal state\n */\n @ContentChild('normalStateTemplate')\n public normalStateTemplate: TemplateRef<NormalStateContext>;\n\n /**\n * Template that is used within Popup as option\n * @internal\n */\n @ContentChild('optionTemplate')\n public optionTemplate?: TemplateRef<PopupContext>;\n\n //######################### public properties - implementation of OptionsGatherer #########################\n\n /**\n * Array of provided options for select\n */\n public get options(): NgSelectOption<TValue>[]\n {\n return this.optionsChildren.toArray();\n }\n\n /**\n * Occurs when array of provided options has changed\n */\n public get optionsChange(): EventEmitter<void>\n {\n return this._optionsChange;\n }\n\n /**\n * Array of visible, displayed options for select\n */\n public get availableOptions(): NgSelectOption<TValue>[]\n {\n return this._availableOptions;\n }\n\n /**\n * Occurs when array of visible, displayed options has changed\n */\n public get availableOptionsChange(): EventEmitter<void>\n {\n return this._availableOptionsChange;\n }\n\n /**\n * NgSelect plugin instances available for gatherer\n */\n public ngSelectPlugins: NgSelectPluginInstances;\n\n /**\n * Plugin bus used for inter plugin shared events\n */\n public pluginBus: PluginBus<TValue>;\n\n /**\n * Select element that implements default gatherers\n */\n public select: NgSelect<TValue>;\n\n //######################### public properties - template bindings #########################\n\n /**\n * Element used for live search\n */\n public liveSearchElement: HTMLElement[][];\n\n //######################### public properties - children #########################\n\n /**\n * Options children found inside ng-select\n */\n @ContentChildren(OptionComponent)\n public optionsChildren: QueryList<NgSelectOption>;\n\n //######################### public properties - children #########################\n\n /**\n * Options groups children found inside ng-select\n */\n @ContentChildren(OptGroupComponent)\n public optGroupsChildren: QueryList<NgSelectOptGroup>;\n\n //######################### constructors #########################\n constructor(protected _changeDetector: ChangeDetectorRef,\n protected _element: ElementRef<HTMLElement>,\n protected _componentFactoryResolver: ComponentFactoryResolver,\n protected _appRef: ApplicationRef,\n protected _injector: Injector,\n protected _pluginBus: PluginBus<TValue>,\n @Inject(NG_SELECT_PLUGIN_INSTANCES) protected _pluginInstances: NgSelectPluginInstances,\n @Inject(NG_SELECT_OPTIONS) @Optional() options?: NgSelectOptions<TValue>,\n @Inject(NORMAL_STATE_TYPE) @Optional() normalStateType?: Type<NormalState>,\n @Inject(KEYBOARD_HANDLER_TYPE) @Optional() keyboardHandlerType?: Type<KeyboardHandler>,\n @Inject(POPUP_TYPE) @Optional() popupType?: Type<Popup>,\n @Inject(POSITIONER_TYPE) @Optional() positionerType?: Type<Positioner>,\n @Inject(READONLY_STATE_TYPE) @Optional() readonlyStateType?: Type<ReadonlyState>,\n @Inject(VALUE_HANDLER_TYPE) @Optional() valueHandlerType?: Type<ValueHandler>,\n @Inject(LIVE_SEARCH_TYPE) @Optional() liveSearchType?: Type<LiveSearch>,\n @Attribute('readonly') readonly?: string,\n @Attribute('disabled') disabled?: string,\n @Attribute('multiple') multiple?: string)\n {\n //at least on of following is present (value is not important)\n const readonlyDefault = isPresent(readonly) || isPresent(disabled);\n const multipleDefault = isPresent(multiple);\n const opts: NgSelectOptions<TValue> = extend(true, {}, options);\n\n if(!opts.plugins)\n {\n opts.plugins = {};\n }\n\n if(keyboardHandlerType)\n {\n if(!opts.plugins.keyboardHandler)\n {\n opts.plugins.keyboardHandler = {};\n }\n\n opts.plugins.keyboardHandler.type = keyboardHandlerType;\n }\n\n if(normalStateType)\n {\n if(!opts.plugins.normalState)\n {\n opts.plugins.normalState = {};\n }\n\n opts.plugins.normalState.type = normalStateType;\n }\n\n if(popupType)\n {\n if(!opts.plugins.popup)\n {\n opts.plugins.popup = {};\n }\n\n opts.plugins.popup.type = popupType;\n }\n\n if(positionerType)\n {\n if(!opts.plugins.positioner)\n {\n opts.plugins.positioner = {};\n }\n\n opts.plugins.positioner.type = positionerType;\n }\n\n if(readonlyStateType)\n {\n if(!opts.plugins.readonlyState)\n {\n opts.plugins.readonlyState = {};\n }\n\n opts.plugins.readonlyState.type = readonlyStateType;\n }\n\n if(valueHandlerType)\n {\n if(!opts.plugins.valueHandler)\n {\n opts.plugins.valueHandler = {};\n }\n\n opts.plugins.valueHandler.type = valueHandlerType;\n }\n\n if(liveSearchType)\n {\n if(!opts.plugins.liveSearch)\n {\n opts.plugins.liveSearch = {};\n }\n\n opts.plugins.liveSearch.type = liveSearchType;\n }\n\n this._selectOptions = extend(true,\n <NgSelectOptions<TValue>>\n {\n optionsGatherer: this,\n templateGatherer: this,\n },\n defaultOptions,\n <NgSelectOptions<TValue>>\n {\n readonly: readonlyDefault,\n multiple: multipleDefault\n },\n opts);\n\n this._pluginBus.selectElement = this._element;\n this._pluginBus.selectOptions = this._selectOptions;\n }\n\n //######################### public methods - implementation of OnChanges #########################\n\n /**\n * Called when input value changes\n */\n public ngOnChanges(changes: SimpleChanges): void\n {\n const updateReadonly = (state: boolean, firstChange: boolean) =>\n {\n //update options\n this.selectOptions.readonly = state;\n\n if(!firstChange)\n {\n this.initOptions();\n this.initialize();\n }\n };\n\n if(nameof<NgSelectComponent<TValue>>('disabled') in changes && isBoolean(this.disabled))\n {\n updateReadonly(this.disabled, changes[nameof<NgSelectComponent<TValue>>('disabled')].firstChange);\n }\n\n if(nameof<NgSelectComponent<TValue>>('readonly') in changes && isBoolean(this.readonly))\n {\n updateReadonly(this.readonly, changes[nameof<NgSelectComponent<TValue>>('readonly')].firstChange);\n }\n }\n\n //######################### public methods - implementation of OnInit #########################\n\n /**\n * Initialize component\n */\n public ngOnInit()\n {\n this.initOptions();\n }\n\n //######################### public methods - implementation of AfterViewInit #########################\n\n /**\n * Called when view was initialized\n */\n public ngAfterViewInit()\n {\n this._availableOptions = this.options;\n\n this.optionsChildren.changes.subscribe(() =>\n {\n this._availableOptions = this.options;\n this._optionsChange.emit();\n this._availableOptionsChange.emit();\n });\n \n if(this._selectOptions.autoInitialize)\n {\n this.initialize();\n }\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * Called when component is destroyed\n */\n public ngOnDestroy()\n {\n this._searchValueChangeSubscription?.unsubscribe();\n this._searchValueChangeSubscription = null;\n\n this.selectOptions.optionsGatherer?.destroyGatherer();\n\n this._destroyAbsolutePopup();\n }\n\n //######################### public methods - implementation of OptionsGatherer #########################\n\n /**\n * Initialize gatherer during initialization phase\n */\n public initializeGatherer(): void\n {\n const liveSearch = this._pluginInstances[LIVE_SEARCH] as LiveSearch;\n\n if(this._liveSearch && this._liveSearch != liveSearch)\n {\n this._searchValueChangeSubscription.unsubscribe();\n this._searchValueChangeSubscription = null;\n\n this._liveSearch = null;\n }\n\n if(!this._liveSearch)\n {\n this._liveSearch = liveSearch;\n\n this._searchValueChangeSubscription = this._liveSearch.searchValueChange.subscribe(() =>\n {\n if(!this._liveSearch.searchValue)\n {\n this._availableOptions = this.options;\n this._availableOptionsChange.emit();\n\n return;\n }\n\n this._availableOptions = this.options.filter(this.selectOptions.liveSearchFilter(this._liveSearch.searchValue, this.selectOptions.normalizer));\n this._availableOptionsChange.emit();\n });\n }\n }\n\n /**\n * Called when gatherer needs to be destroyed\n */\n public destroyGatherer(): void\n {\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Sets normal state component\n * @param normalState - Created normal state that is rendered\n * @internal\n */\n public setNormalStateComponent(normalState: NormalState)\n {\n this._registerNewPlugin(normalState, NORMAL_STATE, 'normalState');\n }\n\n /**\n * Sets keyboard handler component\n * @param keyboardHandler - Created keyboard handler that is rendered\n * @internal\n */\n public setKeyboardHandlerComponent(keyboardHandler: KeyboardHandler)\n {\n this._registerNewPlugin(keyboardHandler, KEYBOARD_HANDLER, 'keyboardHandler');\n }\n\n /**\n * Sets popup component\n * @param popup - Created popup that is rendered\n * @internal\n */\n public setPopupComponent(popup: Popup)\n {\n this._registerNewPlugin(popup, POPUP, 'popup');\n }\n\n /**\n * Sets positioner component\n * @param positioner - Created positioner that is rendered\n * @internal\n */\n public setPositionerComponent(positioner: Positioner)\n {\n this._registerNewPlugin(positioner, POSITIONER, 'positioner');\n }\n\n /**\n * Sets readonly state component\n * @param readonlyState - Created readonly state that is rendered\n * @internal\n */\n public setReadonlyStateComponent(readonlyState: ReadonlyState)\n {\n this._registerNewPlugin(readonlyState, READONLY_STATE, 'readonlyState');\n this._pluginInstances[NORMAL_STATE] = this._pluginInstances[READONLY_STATE];\n }\n\n /**\n * Sets value handler component\n * @param valueHandler - Created value handler that is rendered\n * @internal\n */\n public setValueHandlerComponent(valueHandler: ValueHandler<TValue>)\n {\n this._registerNewPlugin(valueHandler, VALUE_HANDLER, 'valueHandler');\n }\n\n /**\n * Sets live search component\n * @param liveSearch - Created live search that is rendered\n * @internal\n */\n public setLiveSearchComponent(liveSearch: LiveSearch)\n {\n this._registerNewPlugin(liveSearch, LIVE_SEARCH, 'liveSearch');\n }\n\n //######################### public methods #########################\n\n /**\n * Initialize component, automatically called once if not blocked by options\n */\n public initialize()\n {\n const liveSearchPlugin = this._pluginInstances[LIVE_SEARCH] as LiveSearch;\n this.liveSearchElement = [[liveSearchPlugin.liveSearchElement]];\n\n if(this.selectOptions.absolute)\n {\n this._appendPopupToBody(this._selectOptions.plugins.popup.type);\n }\n\n this._changeDetector.detectChanges();\n \n this.selectOptions.optionsGatherer.initializeGatherer();\n\n this._pluginInstances[LIVE_SEARCH].initialize();\n this._pluginInstances[KEYBOARD_HANDLER].initialize();\n this._pluginInstances[VALUE_HANDLER].initialize();\n this._pluginInstances[NORMAL_STATE]?.initialize();\n this._pluginInstances[READONLY_STATE]?.initialize();\n this._pluginInstances[POPUP].initialize();\n this._pluginInstances[POSITIONER].initialize();\n\n this.isInitialized = true;\n this._initializedSubject.next(true);\n }\n\n /**\n * Initialize options, automaticaly called during init phase, but can be used to reinitialize NgSelectOptions\n */\n public initOptions()\n {\n this.selectOptions.optionsGatherer.ngSelectPlugins = this._pluginInstances;\n this.selectOptions.optionsGatherer.pluginBus = this._pluginBus;\n this.selectOptions.optionsGatherer.select = this;\n\n const initOptionsPlugin = (pluginKey: string, pluginName: keyof NgSelectPluginTypes) =>\n {\n if(this._selectOptions.plugins[pluginName])\n {\n this._selectOptions.plugins[pluginName].type = resolveForwardRef(this._selectOptions.plugins[pluginName].type);\n\n if(this._pluginInstances[pluginKey])\n {\n if(this._selectOptions.plugins && this._selectOptions.plugins[pluginName] && this._selectOptions.plugins[pluginName].options)\n {\n this._pluginInstances[pluginKey].options = this._selectOptions.plugins[pluginName].options;\n }\n\n this._pluginInstances[pluginKey].initOptions();\n }\n }\n };\n\n if(this._selectOptions.plugins)\n {\n initOptionsPlugin(NORMAL_STATE, 'normalState');\n initOptionsPlugin(KEYBOARD_HANDLER, 'keyboardHandler');\n initOptionsPlugin(POPUP, 'popup');\n initOptionsPlugin(POSITIONER, 'positioner');\n initOptionsPlugin(READONLY_STATE, 'readonlyState');\n initOptionsPlugin(VALUE_HANDLER, 'valueHandler');\n initOptionsPlugin(LIVE_SEARCH, 'liveSearch');\n }\n }\n\n /**\n * Explicitly runs invalidation of content (change detection)\n */\n public invalidateVisuals(): void\n {\n this._changeDetector.detectChanges();\n }\n\n /**\n * Gets instance of plugin by its id\n * @param pluginId - Id of plugin, use constants\n */\n public getPlugin<PluginType extends NgSelectPlugin>(pluginId: string): PluginType\n {\n return this._pluginInstances[pluginId] as PluginType;\n }\n\n /**\n * Subscribes for event\n * @param eventName - Name of event that should be listened to\n * @param handler - Function used for handling event\n */\n public listenTo<TParam = void>(eventName: keyof PluginBusEvents, handler: (data: TParam) => void): Subscription\n {\n return this._pluginBus[eventName].subscribe(handler);\n }\n\n /**\n * Executes actions on NgSelect\n * @param actions - Array of actions that are executed over NgSelect\n */\n public execute(...actions: NgSelectAction<TValue>[])\n {\n if(!actions)\n {\n return;\n }\n\n actions.forEach(action => action(this));\n }\n\n /**\n * Executes function on NgSelect and returns result\n * @param func - Function that is executed and its result is returned\n */\n public executeAndReturn<TResult>(func: NgSelectFunction<TResult, TValue>): TResult\n {\n if(!func)\n {\n return null;\n }\n\n return func(this);\n }\n\n //######################### protected methods #########################\n\n /**\n * Appends popup component directly to body, allows absolute positioning over page body\n * @param component - Popup component type to be appended\n */\n protected _appendPopupToBody(component: Type<Popup>) \n {\n //do not reinitialize if already exists and nothing has changed\n if(this._absolutePopupType == component && this.liveSearchElement[0][0] == this._absolutePopupElement)\n {\n return;\n }\n\n // 0. Destroyes absolute popup if it exists\n this._destroyAbsolutePopup();\n\n if(!component)\n {\n return;\n }\n\n this._absolutePopupType = component;\n this._absolutePopupElement = this.liveSearchElement[0][0];\n\n // 1. Create a component reference from the component \n this._absolutePopup = this._componentFactoryResolver\n .resolveComponentFactory(component)\n .create(this._injector, this.liveSearchElement);\n \n // 2. Attach component to the appRef so that it's inside the ng component tree\n this._appRef.attachView(this._absolutePopup.hostView);\n \n // 3. Get DOM element from component\n const domElem = (this._absolutePopup.hostView as EmbeddedViewRef<any>)\n .rootNodes[0] as HTMLElement;\n \n // 4. Append DOM element to the body\n document.body.appendChild(domElem);\n\n this.setPopupComponent(this._absolutePopup.instance);\n }\n\n /**\n * Destroyes absolute popup if it exists\n */\n protected _destroyAbsolutePopup()\n {\n if(this._absolutePopup)\n {\n this._appRef.detachView(this._absolutePopup.hostView);\n this._absolutePopup.destroy();\n this._absolutePopup = null;\n this._absolutePopupType = null;\n this._absolutePopupElement = null;\n }\n }\n\n /**\n * Registers newly created plugin\n * @param plugin - Plugin to be registered\n * @param pluginKey - Key of plugin used for pluginInstances\n * @param pluginName - Name property for plugin from options\n */\n protected _registerNewPlugin(plugin: NgSelectPlugin, pluginKey: string, pluginName: keyof NgSelectPluginTypes)\n {\n if(!plugin)\n {\n this._pluginInstances[pluginKey] = null;\n\n return;\n }\n\n this._pluginInstances[pluginKey] = plugin;\n\n if(this._selectOptions.plugins && this._selectOptions.plugins[pluginName] && this._selectOptions.plugins[pluginName].options)\n {\n plugin.options = this._selectOptions.plugins[pluginName].options;\n }\n\n plugin.initOptions();\n\n if(this._selectOptions.plugins && this._selectOptions.plugins[pluginName] && this._selectOptions.plugins[pluginName].instanceCallback)\n {\n this._selectOptions.plugins[pluginName].instanceCallback(plugin);\n }\n }\n}","<ng-template [ngComponentOutletEx]=\"selectOptions?.plugins?.liveSearch?.type\" (ngComponentOutletExCreated)=\"setLiveSearchComponent($event)\"></ng-template>\r\n<ng-template [ngComponentOutletEx]=\"selectOptions?.plugins?.positioner?.type\" (ngComponentOutletExCreated)=\"setPositionerComponent($event)\"></ng-template>\r\n<ng-template [ngComponentOutletEx]=\"selectOptions?.plugins?.keyboardHandler?.type\" (ngComponentOutletExCreated)=\"setKeyboardHandlerComponent($event)\"></ng-template>\r\n<ng-template [ngComponentOutletEx]=\"selectOptions?.plugins?.valueHandler?.type\" (ngComponentOutletExCreated)=\"setValueHandlerComponent($event)\"></ng-template>\r\n\r\n<div>\r\n <ng-template [ngIf]=\"!selectOptions?.readonly\">\r\n <ng-template [ngComponentOutletEx]=\"selectOptions?.plugins?.normalState?.type\" (ngComponentOutletExCreated)=\"setNormalStateComponent($event)\" [ngComponentOutletExContent]=\"liveSearchElement\"></ng-template>\r\n </ng-template>\r\n\r\n <ng-template [ngIf]=\"selectOptions?.readonly\">\r\n <ng-template [ngComponentOutletEx]=\"selectOptions?.plugins?.readonlyState?.type\" (ngComponentOutletExCreated)=\"setReadonlyStateComponent($event)\"></ng-template>\r\n </ng-template>\r\n\r\n <ng-template [ngIf]=\"!selectOptions?.absolute\">\r\n <ng-template [ngComponentOutletEx]=\"selectOptions?.plugins?.popup?.type\" (ngComponentOutletExCreated)=\"setPopupComponent($event)\" [ngComponentOutletExContent]=\"liveSearchElement\"></ng-template>\r\n </ng-template>\r\n</div>"]}
1
+ {"version":3,"file":"select.component.js","sourceRoot":"","sources":["../../../../src/components/select/select.component.ts","../../../../src/components/select/select.component.html"],"names":[],"mappings":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,mBAEJ,uBAAuB,CAAC,MAAM,aAE/C;wBAEI;4BACI,OAAO,EAAE,0BAA0B;4BACnC,UAAU,EAAE,GAAG,EAAE,GAAE,OAAO,EAAE,CAAC,CAAA,CAAC;yBACjC;wBAED;4BACI,OAAO,EAAE,SAAS;4BAClB,QAAQ,EAAE,SAAS;yBACtB;qBACJ;;0BAwMY,MAAM;2BAAC,0BAA0B;;0BACjC,MAAM;2BAAC,iBAAiB;;0BAAG,QAAQ;;0BACnC,MAAM;2BAAC,iBAAiB;;0BAAG,QAAQ;;0BACnC,MAAM;2BAAC,qBAAqB;;0BAAG,QAAQ;;0BACvC,MAAM;2BAAC,UAAU;;0BAAG,QAAQ;;0BAC5B,MAAM;2BAAC,eAAe;;0BAAG,QAAQ;;0BACjC,MAAM;2BAAC,mBAAmB;;0BAAG,QAAQ;;0BACrC,MAAM;2BAAC,kBAAkB;;0BAAG,QAAQ;;0BACpC,MAAM;2BAAC,gBAAgB;;0BAAG,QAAQ;;0BAClC,SAAS;2BAAC,UAAU;;0BACpB,SAAS;2BAAC,UAAU;;0BACpB,SAAS;2BAAC,UAAU;4CA9ItB,aAAa;sBADvB,KAAK;gBAeC,QAAQ;sBADd,KAAK;gBAOC,QAAQ;sBADd,KAAK;gBAwBC,mBAAmB;sBADzB,YAAY;uBAAC,qBAAqB;gBAQ5B,cAAc;sBADpB,YAAY;uBAAC,gBAAgB;gBAiEvB,eAAe;sBADrB,eAAe;uBAAC,eAAe;gBASzB,iBAAiB;sBADvB,eAAe;uBAAC,iBAAiB","sourcesContent":["import {Component, ChangeDetectionStrategy, FactoryProvider, Input, Inject, ChangeDetectorRef, Optional, Type, AfterViewInit, OnInit, ContentChildren, QueryList, EventEmitter, forwardRef, resolveForwardRef, ElementRef, OnChanges, SimpleChanges, Attribute, OnDestroy, TemplateRef, ContentChild, ComponentFactoryResolver, ApplicationRef, Injector, EmbeddedViewRef, ComponentRef, ClassProvider} from '@angular/core';\nimport {extend, nameof, isBoolean, isPresent, isString, renderToBody} from '@jscrpt/common';\nimport {BehaviorSubject, Observable, Subscription} from 'rxjs';\n\nimport {NgSelectOptions, NgSelectPlugin, PluginDescription, NormalizeFunc, NgSelectPluginTypes} from '../../misc';\nimport {NG_SELECT_OPTIONS, KEYBOARD_HANDLER_TYPE, NORMAL_STATE_TYPE, POPUP_TYPE, POSITIONER_TYPE, READONLY_STATE_TYPE, VALUE_HANDLER_TYPE, LIVE_SEARCH_TYPE} from '../../misc/types';\nimport {NgSelect, NgSelectPluginInstances, NgSelectAction, NgSelectFunction} from './select.interface';\nimport {NG_SELECT_PLUGIN_INSTANCES} from './types';\nimport {KeyboardHandler} from '../../plugins/keyboardHandler';\nimport {BasicKeyboardHandlerComponent} from '../../plugins/keyboardHandler/components';\nimport {KEYBOARD_HANDLER} from '../../plugins/keyboardHandler/types';\nimport {NormalState, NormalStateContext} from '../../plugins/normalState';\nimport {NORMAL_STATE} from '../../plugins/normalState/types';\nimport {BasicNormalStateComponent} from '../../plugins/normalState/components';\nimport {Popup, PopupContext} from '../../plugins/popup';\nimport {POPUP} from '../../plugins/popup/types';\nimport {BasicPopupComponent} from '../../plugins/popup/component';\nimport {Positioner} from '../../plugins/positioner';\nimport {POSITIONER} from '../../plugins/positioner/types';\nimport {DefaultPositionerComponent} from '../../plugins/positioner/components';\nimport {ReadonlyState} from '../../plugins/readonlyState';\nimport {READONLY_STATE} from '../../plugins/readonlyState/types';\nimport {ValueHandler} from '../../plugins/valueHandler';\nimport {VALUE_HANDLER} from '../../plugins/valueHandler/types';\nimport {BasicValueHandlerComponent} from '../../plugins/valueHandler/components';\nimport {LiveSearch} from '../../plugins/liveSearch';\nimport {LIVE_SEARCH} from '../../plugins/liveSearch/types';\nimport {NoLiveSearchComponent} from '../../plugins/liveSearch/components';\nimport {NgSelectOption, NgSelectOptGroup} from '../option';\nimport {OptionComponent} from '../option/option.component';\nimport {OptGroupComponent} from '../option/optgroup.component';\nimport {PluginBus} from '../../misc/pluginBus/pluginBus';\nimport {PluginBusEvents} from '../../misc/pluginBus/pluginBus.interface';\n\n//TODO - dynamic change of absolute popup\n//TODO - dynamic change of options gatherer destroy called properly ?\n\n/**\n * Default 'NgSelectOptions'\n * @internal\n */\nconst defaultOptions: NgSelectOptions =\n{\n autoInitialize: true,\n absolute: false,\n forceValueCheckOnInit: false,\n multiple: false,\n readonly: false,\n valueComparer: (source, target) =>\n {\n return source === target;\n },\n liveSearchFilter: (query: string, normalizer: NormalizeFunc = value => value) =>\n {\n return itm => normalizer(itm.text).indexOf(normalizer(query)) >= 0;\n },\n normalizer: value =>\n {\n if(isString(value))\n {\n return value.toLowerCase();\n }\n\n return value;\n },\n cssClasses:\n {\n },\n plugins:\n {\n normalState: <PluginDescription<BasicNormalStateComponent>>\n {\n type: forwardRef(() => BasicNormalStateComponent)\n },\n liveSearch: <PluginDescription<NoLiveSearchComponent>>\n {\n type: forwardRef(() => NoLiveSearchComponent)\n },\n popup: <PluginDescription<BasicPopupComponent>>\n {\n type: forwardRef(() => BasicPopupComponent)\n },\n positioner: <PluginDescription<DefaultPositionerComponent>>\n {\n type: forwardRef(() => DefaultPositionerComponent)\n },\n keyboardHandler: <PluginDescription<BasicKeyboardHandlerComponent>>\n {\n type: forwardRef(() => BasicKeyboardHandlerComponent)\n },\n readonlyState: <PluginDescription<ReadonlyState>>\n {\n type: forwardRef(() => BasicNormalStateComponent)\n },\n valueHandler: <PluginDescription<BasicValueHandlerComponent>>\n {\n type: forwardRef(() => BasicValueHandlerComponent)\n }\n }\n};\n\n/**\n * Component that represents NgSelect itself, allows selection of value from options\n */\n@Component(\n{\n selector: 'ng-select',\n templateUrl: 'select.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers:\n [\n <FactoryProvider>\n {\n provide: NG_SELECT_PLUGIN_INSTANCES,\n useFactory: () => {return {};}\n },\n <ClassProvider>\n {\n provide: PluginBus,\n useClass: PluginBus\n }\n ],\n styles: [\n `:host\n {\n display: block;\n position: relative;\n }`\n ]\n})\nexport class NgSelectComponent<TValue = any> implements NgSelect<TValue>, OnChanges, OnInit, AfterViewInit, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * NgSelect options\n */\n protected _selectOptions: NgSelectOptions<TValue>;\n\n /**\n * Subject used for indication that NgSelect was initialized\n */\n protected _initializedSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);\n\n /**\n * Occurs when array of provided options has changed\n */\n protected _optionsChange: EventEmitter<void> = new EventEmitter<void>();\n\n /**\n * Occurs when array of visible, displayed options has changed\n */\n protected _availableOptionsChange: EventEmitter<void> = new EventEmitter<void>();\n\n /**\n * Array of available options to be displayed\n */\n protected _availableOptions: NgSelectOption<TValue>[] = [];\n\n /**\n * Live search plugin currently used in NgSelect\n */\n protected _liveSearch: LiveSearch;\n\n /**\n * Subscription for changes of live search value\n */\n protected _searchValueChangeSubscription: Subscription;\n\n /**\n * Instance of component ref for absolute popup\n */\n protected _absolutePopup: ComponentRef<Popup>;\n\n /**\n * Instance of type that is used as absolute popup\n */\n protected _absolutePopupType: Type<Popup>;\n\n /**\n * Instance of html element that is used\n */\n protected _absolutePopupElement: HTMLElement;\n\n //######################### public properties - inputs #########################\n\n /**\n * Gets or sets NgSelect options\n */\n @Input()\n public get selectOptions(): NgSelectOptions<TValue>\n {\n return this._selectOptions;\n }\n public set selectOptions(options: NgSelectOptions<TValue>)\n {\n this._selectOptions = extend(true, this._selectOptions, options);\n this._pluginBus.selectOptions = this._selectOptions;\n }\n\n /**\n * Indication whether should be NgSelect disabled or not\n */\n @Input()\n public disabled: boolean;\n\n /**\n * Indication whether should be NgSelect readonly or not\n */\n @Input()\n public readonly: boolean;\n\n //######################### public properties - implementation of NgSelect #########################\n\n /**\n * Occurs every time when NgSelect is initialized or reinitialized, if value is false NgSelect was not initialized yet\n */\n public get initialized(): Observable<boolean>\n {\n return this._initializedSubject.asObservable();\n }\n\n /**\n * Gets current state of initialization\n */\n public isInitialized: boolean = false;\n\n //######################### public properties - implementation of TemplateGatherer #########################\n\n /**\n * Template used within normal state\n */\n @ContentChild('normalStateTemplate')\n public normalStateTemplate: TemplateRef<NormalStateContext>;\n\n /**\n * Template that is used within Popup as option\n * @internal\n */\n @ContentChild('optionTemplate')\n public optionTemplate?: TemplateRef<PopupContext>;\n\n //######################### public properties - implementation of OptionsGatherer #########################\n\n /**\n * Array of provided options for select\n */\n public get options(): NgSelectOption<TValue>[]\n {\n return this.optionsChildren.toArray();\n }\n\n /**\n * Occurs when array of provided options has changed\n */\n public get optionsChange(): EventEmitter<void>\n {\n return this._optionsChange;\n }\n\n /**\n * Array of visible, displayed options for select\n */\n public get availableOptions(): NgSelectOption<TValue>[]\n {\n return this._availableOptions;\n }\n\n /**\n * Occurs when array of visible, displayed options has changed\n */\n public get availableOptionsChange(): EventEmitter<void>\n {\n return this._availableOptionsChange;\n }\n\n /**\n * NgSelect plugin instances available for gatherer\n */\n public ngSelectPlugins: NgSelectPluginInstances;\n\n /**\n * Plugin bus used for inter plugin shared events\n */\n public pluginBus: PluginBus<TValue>;\n\n /**\n * Select element that implements default gatherers\n */\n public select: NgSelect<TValue>;\n\n //######################### public properties - template bindings #########################\n\n /**\n * Element used for live search\n */\n public liveSearchElement: HTMLElement[][];\n\n //######################### public properties - children #########################\n\n /**\n * Options children found inside ng-select\n */\n @ContentChildren(OptionComponent)\n public optionsChildren: QueryList<NgSelectOption>;\n\n //######################### public properties - children #########################\n\n /**\n * Options groups children found inside ng-select\n */\n @ContentChildren(OptGroupComponent)\n public optGroupsChildren: QueryList<NgSelectOptGroup>;\n\n //######################### constructors #########################\n constructor(protected _changeDetector: ChangeDetectorRef,\n protected _element: ElementRef<HTMLElement>,\n protected _componentFactoryResolver: ComponentFactoryResolver,\n protected _appRef: ApplicationRef,\n protected _injector: Injector,\n protected _pluginBus: PluginBus<TValue>,\n @Inject(NG_SELECT_PLUGIN_INSTANCES) protected _pluginInstances: NgSelectPluginInstances,\n @Inject(NG_SELECT_OPTIONS) @Optional() options?: NgSelectOptions<TValue>,\n @Inject(NORMAL_STATE_TYPE) @Optional() normalStateType?: Type<NormalState>,\n @Inject(KEYBOARD_HANDLER_TYPE) @Optional() keyboardHandlerType?: Type<KeyboardHandler>,\n @Inject(POPUP_TYPE) @Optional() popupType?: Type<Popup>,\n @Inject(POSITIONER_TYPE) @Optional() positionerType?: Type<Positioner>,\n @Inject(READONLY_STATE_TYPE) @Optional() readonlyStateType?: Type<ReadonlyState>,\n @Inject(VALUE_HANDLER_TYPE) @Optional() valueHandlerType?: Type<ValueHandler>,\n @Inject(LIVE_SEARCH_TYPE) @Optional() liveSearchType?: Type<LiveSearch>,\n @Attribute('readonly') readonly?: string,\n @Attribute('disabled') disabled?: string,\n @Attribute('multiple') multiple?: string)\n {\n //at least on of following is present (value is not important)\n const readonlyDefault = isPresent(readonly) || isPresent(disabled);\n const multipleDefault = isPresent(multiple);\n const opts: NgSelectOptions<TValue> = extend(true, {}, options);\n\n if(!opts.plugins)\n {\n opts.plugins = {};\n }\n\n if(keyboardHandlerType)\n {\n if(!opts.plugins.keyboardHandler)\n {\n opts.plugins.keyboardHandler = {};\n }\n\n opts.plugins.keyboardHandler.type = keyboardHandlerType;\n }\n\n if(normalStateType)\n {\n if(!opts.plugins.normalState)\n {\n opts.plugins.normalState = {};\n }\n\n opts.plugins.normalState.type = normalStateType;\n }\n\n if(popupType)\n {\n if(!opts.plugins.popup)\n {\n opts.plugins.popup = {};\n }\n\n opts.plugins.popup.type = popupType;\n }\n\n if(positionerType)\n {\n if(!opts.plugins.positioner)\n {\n opts.plugins.positioner = {};\n }\n\n opts.plugins.positioner.type = positionerType;\n }\n\n if(readonlyStateType)\n {\n if(!opts.plugins.readonlyState)\n {\n opts.plugins.readonlyState = {};\n }\n\n opts.plugins.readonlyState.type = readonlyStateType;\n }\n\n if(valueHandlerType)\n {\n if(!opts.plugins.valueHandler)\n {\n opts.plugins.valueHandler = {};\n }\n\n opts.plugins.valueHandler.type = valueHandlerType;\n }\n\n if(liveSearchType)\n {\n if(!opts.plugins.liveSearch)\n {\n opts.plugins.liveSearch = {};\n }\n\n opts.plugins.liveSearch.type = liveSearchType;\n }\n\n this._selectOptions = extend(true,\n <NgSelectOptions<TValue>>\n {\n optionsGatherer: this,\n templateGatherer: this,\n },\n defaultOptions,\n <NgSelectOptions<TValue>>\n {\n readonly: readonlyDefault,\n multiple: multipleDefault\n },\n opts);\n\n this._pluginBus.selectElement = this._element;\n this._pluginBus.selectOptions = this._selectOptions;\n }\n\n //######################### public methods - implementation of OnChanges #########################\n\n /**\n * Called when input value changes\n */\n public ngOnChanges(changes: SimpleChanges): void\n {\n const updateReadonly = (state: boolean, firstChange: boolean) =>\n {\n //update options\n this.selectOptions.readonly = state;\n\n if(!firstChange)\n {\n this.initOptions();\n this.initialize();\n }\n };\n\n if(nameof<NgSelectComponent<TValue>>('disabled') in changes && isBoolean(this.disabled))\n {\n updateReadonly(this.disabled, changes[nameof<NgSelectComponent<TValue>>('disabled')].firstChange);\n }\n\n if(nameof<NgSelectComponent<TValue>>('readonly') in changes && isBoolean(this.readonly))\n {\n updateReadonly(this.readonly, changes[nameof<NgSelectComponent<TValue>>('readonly')].firstChange);\n }\n }\n\n //######################### public methods - implementation of OnInit #########################\n\n /**\n * Initialize component\n */\n public ngOnInit()\n {\n this.initOptions();\n }\n\n //######################### public methods - implementation of AfterViewInit #########################\n\n /**\n * Called when view was initialized\n */\n public ngAfterViewInit()\n {\n this._availableOptions = this.options;\n\n this.optionsChildren.changes.subscribe(() =>\n {\n this._availableOptions = this.options;\n this._optionsChange.emit();\n this._availableOptionsChange.emit();\n });\n\n if(this._selectOptions.autoInitialize)\n {\n this.initialize();\n }\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * Called when component is destroyed\n */\n public ngOnDestroy()\n {\n this._searchValueChangeSubscription?.unsubscribe();\n this._searchValueChangeSubscription = null;\n\n this.selectOptions.optionsGatherer?.destroyGatherer();\n\n this._destroyAbsolutePopup();\n }\n\n //######################### public methods - implementation of OptionsGatherer #########################\n\n /**\n * Initialize gatherer during initialization phase\n */\n public initializeGatherer(): void\n {\n const liveSearch = this._pluginInstances[LIVE_SEARCH] as LiveSearch;\n\n if(this._liveSearch && this._liveSearch != liveSearch)\n {\n this._searchValueChangeSubscription.unsubscribe();\n this._searchValueChangeSubscription = null;\n\n this._liveSearch = null;\n }\n\n if(!this._liveSearch)\n {\n this._liveSearch = liveSearch;\n\n this._searchValueChangeSubscription = this._liveSearch.searchValueChange.subscribe(() =>\n {\n if(!this._liveSearch.searchValue)\n {\n this._availableOptions = this.options;\n this._availableOptionsChange.emit();\n\n return;\n }\n\n this._availableOptions = this.options.filter(this.selectOptions.liveSearchFilter(this._liveSearch.searchValue, this.selectOptions.normalizer));\n this._availableOptionsChange.emit();\n });\n }\n }\n\n /**\n * Called when gatherer needs to be destroyed\n */\n public destroyGatherer(): void\n {\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Sets normal state component\n * @param normalState - Created normal state that is rendered\n * @internal\n */\n public setNormalStateComponent(normalState: NormalState)\n {\n this._registerNewPlugin(normalState, NORMAL_STATE, 'normalState');\n }\n\n /**\n * Sets keyboard handler component\n * @param keyboardHandler - Created keyboard handler that is rendered\n * @internal\n */\n public setKeyboardHandlerComponent(keyboardHandler: KeyboardHandler)\n {\n this._registerNewPlugin(keyboardHandler, KEYBOARD_HANDLER, 'keyboardHandler');\n }\n\n /**\n * Sets popup component\n * @param popup - Created popup that is rendered\n * @internal\n */\n public setPopupComponent(popup: Popup)\n {\n this._registerNewPlugin(popup, POPUP, 'popup');\n }\n\n /**\n * Sets positioner component\n * @param positioner - Created positioner that is rendered\n * @internal\n */\n public setPositionerComponent(positioner: Positioner)\n {\n this._registerNewPlugin(positioner, POSITIONER, 'positioner');\n }\n\n /**\n * Sets readonly state component\n * @param readonlyState - Created readonly state that is rendered\n * @internal\n */\n public setReadonlyStateComponent(readonlyState: ReadonlyState)\n {\n this._registerNewPlugin(readonlyState, READONLY_STATE, 'readonlyState');\n this._pluginInstances[NORMAL_STATE] = this._pluginInstances[READONLY_STATE];\n }\n\n /**\n * Sets value handler component\n * @param valueHandler - Created value handler that is rendered\n * @internal\n */\n public setValueHandlerComponent(valueHandler: ValueHandler<TValue>)\n {\n this._registerNewPlugin(valueHandler, VALUE_HANDLER, 'valueHandler');\n }\n\n /**\n * Sets live search component\n * @param liveSearch - Created live search that is rendered\n * @internal\n */\n public setLiveSearchComponent(liveSearch: LiveSearch)\n {\n this._registerNewPlugin(liveSearch, LIVE_SEARCH, 'liveSearch');\n }\n\n //######################### public methods #########################\n\n /**\n * Initialize component, automatically called once if not blocked by options\n */\n public initialize()\n {\n const liveSearchPlugin = this._pluginInstances[LIVE_SEARCH] as LiveSearch;\n this.liveSearchElement = [[liveSearchPlugin.liveSearchElement]];\n\n if(this.selectOptions.absolute)\n {\n this._appendPopupToBody(this._selectOptions.plugins.popup.type);\n }\n\n this._changeDetector.detectChanges();\n\n this.selectOptions.optionsGatherer.initializeGatherer();\n\n this._pluginInstances[LIVE_SEARCH].initialize();\n this._pluginInstances[KEYBOARD_HANDLER].initialize();\n this._pluginInstances[VALUE_HANDLER].initialize();\n this._pluginInstances[NORMAL_STATE]?.initialize();\n this._pluginInstances[READONLY_STATE]?.initialize();\n this._pluginInstances[POPUP].initialize();\n this._pluginInstances[POSITIONER].initialize();\n\n this.isInitialized = true;\n this._initializedSubject.next(true);\n }\n\n /**\n * Initialize options, automaticaly called during init phase, but can be used to reinitialize NgSelectOptions\n */\n public initOptions()\n {\n this.selectOptions.optionsGatherer.ngSelectPlugins = this._pluginInstances;\n this.selectOptions.optionsGatherer.pluginBus = this._pluginBus;\n this.selectOptions.optionsGatherer.select = this;\n\n const initOptionsPlugin = (pluginKey: string, pluginName: keyof NgSelectPluginTypes) =>\n {\n if(this._selectOptions.plugins[pluginName])\n {\n this._selectOptions.plugins[pluginName].type = resolveForwardRef(this._selectOptions.plugins[pluginName].type);\n\n if(this._pluginInstances[pluginKey])\n {\n if(this._selectOptions.plugins && this._selectOptions.plugins[pluginName] && this._selectOptions.plugins[pluginName].options)\n {\n this._pluginInstances[pluginKey].options = this._selectOptions.plugins[pluginName].options;\n }\n\n this._pluginInstances[pluginKey].initOptions();\n }\n }\n };\n\n if(this._selectOptions.plugins)\n {\n initOptionsPlugin(NORMAL_STATE, 'normalState');\n initOptionsPlugin(KEYBOARD_HANDLER, 'keyboardHandler');\n initOptionsPlugin(POPUP, 'popup');\n initOptionsPlugin(POSITIONER, 'positioner');\n initOptionsPlugin(READONLY_STATE, 'readonlyState');\n initOptionsPlugin(VALUE_HANDLER, 'valueHandler');\n initOptionsPlugin(LIVE_SEARCH, 'liveSearch');\n }\n }\n\n /**\n * Explicitly runs invalidation of content (change detection)\n */\n public invalidateVisuals(): void\n {\n this._changeDetector.detectChanges();\n }\n\n /**\n * Gets instance of plugin by its id\n * @param pluginId - Id of plugin, use constants\n */\n public getPlugin<PluginType extends NgSelectPlugin>(pluginId: string): PluginType\n {\n return this._pluginInstances[pluginId] as PluginType;\n }\n\n /**\n * Subscribes for event\n * @param eventName - Name of event that should be listened to\n * @param handler - Function used for handling event\n */\n public listenTo<TParam = void>(eventName: keyof PluginBusEvents, handler: (data: TParam) => void): Subscription\n {\n return this._pluginBus[eventName].subscribe(handler);\n }\n\n /**\n * Executes actions on NgSelect\n * @param actions - Array of actions that are executed over NgSelect\n */\n public execute(...actions: NgSelectAction<TValue>[])\n {\n if(!actions)\n {\n return;\n }\n\n actions.forEach(action => action(this));\n }\n\n /**\n * Executes function on NgSelect and returns result\n * @param func - Function that is executed and its result is returned\n */\n public executeAndReturn<TResult>(func: NgSelectFunction<TResult, TValue>): TResult\n {\n if(!func)\n {\n return null;\n }\n\n return func(this);\n }\n\n //######################### protected methods #########################\n\n /**\n * Appends popup component directly to body, allows absolute positioning over page body\n * @param component - Popup component type to be appended\n */\n protected _appendPopupToBody(component: Type<Popup>)\n {\n //do not reinitialize if already exists and nothing has changed\n if(this._absolutePopupType == component && this.liveSearchElement[0][0] == this._absolutePopupElement)\n {\n return;\n }\n\n // 0. Destroyes absolute popup if it exists\n this._destroyAbsolutePopup();\n\n if(!component)\n {\n return;\n }\n\n this._absolutePopupType = component;\n this._absolutePopupElement = this.liveSearchElement[0][0];\n\n // 1. Create a component reference from the component\n this._absolutePopup = this._componentFactoryResolver\n .resolveComponentFactory(component)\n .create(this._injector, this.liveSearchElement);\n\n // 2. Attach component to the appRef so that it's inside the ng component tree\n this._appRef.attachView(this._absolutePopup.hostView);\n\n // 3. Get DOM element from component\n const domElem = (this._absolutePopup.hostView as EmbeddedViewRef<any>)\n .rootNodes[0] as HTMLElement;\n\n // 4. Append DOM element to the body\n renderToBody(document, domElem, this._selectOptions.containerElement);\n\n this.setPopupComponent(this._absolutePopup.instance);\n }\n\n /**\n * Destroyes absolute popup if it exists\n */\n protected _destroyAbsolutePopup()\n {\n if(this._absolutePopup)\n {\n this._appRef.detachView(this._absolutePopup.hostView);\n this._absolutePopup.destroy();\n this._absolutePopup = null;\n this._absolutePopupType = null;\n this._absolutePopupElement = null;\n }\n }\n\n /**\n * Registers newly created plugin\n * @param plugin - Plugin to be registered\n * @param pluginKey - Key of plugin used for pluginInstances\n * @param pluginName - Name property for plugin from options\n */\n protected _registerNewPlugin(plugin: NgSelectPlugin, pluginKey: string, pluginName: keyof NgSelectPluginTypes)\n {\n if(!plugin)\n {\n this._pluginInstances[pluginKey] = null;\n\n return;\n }\n\n this._pluginInstances[pluginKey] = plugin;\n\n if(this._selectOptions.plugins && this._selectOptions.plugins[pluginName] && this._selectOptions.plugins[pluginName].options)\n {\n plugin.options = this._selectOptions.plugins[pluginName].options;\n }\n\n plugin.initOptions();\n\n if(this._selectOptions.plugins && this._selectOptions.plugins[pluginName] && this._selectOptions.plugins[pluginName].instanceCallback)\n {\n this._selectOptions.plugins[pluginName].instanceCallback(plugin);\n }\n }\n}","<ng-template [ngComponentOutletEx]=\"selectOptions?.plugins?.liveSearch?.type\" (ngComponentOutletExCreated)=\"setLiveSearchComponent($event)\"></ng-template>\r\n<ng-template [ngComponentOutletEx]=\"selectOptions?.plugins?.positioner?.type\" (ngComponentOutletExCreated)=\"setPositionerComponent($event)\"></ng-template>\r\n<ng-template [ngComponentOutletEx]=\"selectOptions?.plugins?.keyboardHandler?.type\" (ngComponentOutletExCreated)=\"setKeyboardHandlerComponent($event)\"></ng-template>\r\n<ng-template [ngComponentOutletEx]=\"selectOptions?.plugins?.valueHandler?.type\" (ngComponentOutletExCreated)=\"setValueHandlerComponent($event)\"></ng-template>\r\n\r\n<div>\r\n <ng-template [ngIf]=\"!selectOptions?.readonly\">\r\n <ng-template [ngComponentOutletEx]=\"selectOptions?.plugins?.normalState?.type\" (ngComponentOutletExCreated)=\"setNormalStateComponent($event)\" [ngComponentOutletExContent]=\"liveSearchElement\"></ng-template>\r\n </ng-template>\r\n\r\n <ng-template [ngIf]=\"selectOptions?.readonly\">\r\n <ng-template [ngComponentOutletEx]=\"selectOptions?.plugins?.readonlyState?.type\" (ngComponentOutletExCreated)=\"setReadonlyStateComponent($event)\"></ng-template>\r\n </ng-template>\r\n\r\n <ng-template [ngIf]=\"!selectOptions?.absolute\">\r\n <ng-template [ngComponentOutletEx]=\"selectOptions?.plugins?.popup?.type\" (ngComponentOutletExCreated)=\"setPopupComponent($event)\" [ngComponentOutletExContent]=\"liveSearchElement\"></ng-template>\r\n </ng-template>\r\n</div>"]}
@@ -14,9 +14,9 @@ export class NgSelectAbsoluteDirective {
14
14
  };
15
15
  }
16
16
  }
17
- NgSelectAbsoluteDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgSelectAbsoluteDirective, deps: [{ token: i1.NgSelectComponent }], target: i0.ɵɵFactoryTarget.Directive });
18
- NgSelectAbsoluteDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: NgSelectAbsoluteDirective, selector: "ng-select[absolute]", ngImport: i0 });
19
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgSelectAbsoluteDirective, decorators: [{
17
+ NgSelectAbsoluteDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgSelectAbsoluteDirective, deps: [{ token: i1.NgSelectComponent }], target: i0.ɵɵFactoryTarget.Directive });
18
+ NgSelectAbsoluteDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: NgSelectAbsoluteDirective, selector: "ng-select[absolute]", ngImport: i0 });
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgSelectAbsoluteDirective, decorators: [{
20
20
  type: Directive,
21
21
  args: [{
22
22
  selector: 'ng-select[absolute]'
@@ -1 +1 @@
1
- {"version":3,"file":"ngSelectAbsolute.directive.js","sourceRoot":"","sources":["../../../../src/directives/ngSelectAbsolute/ngSelectAbsolute.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAExC,OAAO,EAAC,iBAAiB,EAAC,MAAM,0CAA0C,CAAC;;;AAE3E;;GAEG;AAKH,MAAM,OAAO,yBAAyB;IAElC,iEAAiE;IACjE,YAAY,MAAyB;QAEjC,MAAM,CAAC,aAAa;YACpB;gBACI,QAAQ,EAAE,IAAI;aACjB,CAAC;IACN,CAAC;;sHATQ,yBAAyB;0GAAzB,yBAAyB;2FAAzB,yBAAyB;kBAJrC,SAAS;mBACV;oBACI,QAAQ,EAAE,qBAAqB;iBAClC","sourcesContent":["import {Directive} from '@angular/core';\n\nimport {NgSelectComponent} from '../../components/select/select.component';\n\n/**\n * Directive used for setting absolute option for ng-select\n */\n@Directive(\n{\n selector: 'ng-select[absolute]'\n})\nexport class NgSelectAbsoluteDirective\n{\n //######################### constructor #########################\n constructor(select: NgSelectComponent)\n {\n select.selectOptions =\n {\n absolute: true\n };\n }\n}"]}
1
+ {"version":3,"file":"ngSelectAbsolute.directive.js","sourceRoot":"","sources":["../../../../src/directives/ngSelectAbsolute/ngSelectAbsolute.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAExC,OAAO,EAAC,iBAAiB,EAAC,MAAM,0CAA0C,CAAC;;;AAE3E;;GAEG;AAKH,MAAM,OAAO,yBAAyB;IAElC,iEAAiE;IACjE,YAAY,MAAyB;QAEjC,MAAM,CAAC,aAAa;YACpB;gBACI,QAAQ,EAAE,IAAI;aACjB,CAAC;IACN,CAAC;;uHATQ,yBAAyB;2GAAzB,yBAAyB;4FAAzB,yBAAyB;kBAJrC,SAAS;mBACV;oBACI,QAAQ,EAAE,qBAAqB;iBAClC","sourcesContent":["import {Directive} from '@angular/core';\n\nimport {NgSelectComponent} from '../../components/select/select.component';\n\n/**\n * Directive used for setting absolute option for ng-select\n */\n@Directive(\n{\n selector: 'ng-select[absolute]'\n})\nexport class NgSelectAbsoluteDirective\n{\n //######################### constructor #########################\n constructor(select: NgSelectComponent)\n {\n select.selectOptions =\n {\n absolute: true\n };\n }\n}"]}
@@ -20,8 +20,8 @@ export class NgSelectEditDirective {
20
20
  };
21
21
  }
22
22
  }
23
- NgSelectEditDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgSelectEditDirective, deps: [{ token: i1.NgSelectComponent }], target: i0.ɵɵFactoryTarget.Directive });
24
- NgSelectEditDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: NgSelectEditDirective, selector: "ng-select[editStyle]", providers: [
23
+ NgSelectEditDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgSelectEditDirective, deps: [{ token: i1.NgSelectComponent }], target: i0.ɵɵFactoryTarget.Directive });
24
+ NgSelectEditDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: NgSelectEditDirective, selector: "ng-select[editStyle]", providers: [
25
25
  {
26
26
  provide: NORMAL_STATE_TYPE,
27
27
  useValue: EditNormalStateComponent
@@ -39,7 +39,7 @@ NgSelectEditDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0",
39
39
  useValue: EditKeyboardHandlerComponent
40
40
  }
41
41
  ], ngImport: i0 });
42
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgSelectEditDirective, decorators: [{
42
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgSelectEditDirective, decorators: [{
43
43
  type: Directive,
44
44
  args: [{
45
45
  selector: 'ng-select[editStyle]',
@@ -1 +1 @@
1
- {"version":3,"file":"ngSelectEdit.directive.js","sourceRoot":"","sources":["../../../../src/directives/ngSelectEdit/ngSelectEdit.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAgB,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAC,iBAAiB,EAAE,gBAAgB,EAAE,UAAU,EAAE,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AACxG,OAAO,EAAC,wBAAwB,EAAC,MAAM,0DAA0D,CAAC;AAClG,OAAO,EAAC,uBAAuB,EAAC,MAAM,wDAAwD,CAAC;AAC/F,OAAO,EAAC,kBAAkB,EAAC,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAC,4BAA4B,EAAC,MAAM,0CAA0C,CAAC;AACtF,OAAO,EAAC,iBAAiB,EAAC,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAC,wBAAwB,EAAC,MAAM,kCAAkC,CAAC;;;AAE1E;;GAEG;AA4BH,MAAM,OAAO,qBAAqB;IAE9B,iEAAiE;IACjE,YAAY,MAAyB;QAEjC,MAAM,CAAC,aAAa;YACpB;gBACI,eAAe,EAAE,IAAI,wBAAwB,EAAE;aAClD,CAAC;IACN,CAAC;;kHATQ,qBAAqB;sGAArB,qBAAqB,+CAvB9B;QAEI;YACI,OAAO,EAAE,iBAAiB;YAC1B,QAAQ,EAAE,wBAAwB;SACrC;QAED;YACI,OAAO,EAAE,gBAAgB;YACzB,QAAQ,EAAE,uBAAuB;SACpC;QAED;YACI,OAAO,EAAE,UAAU;YACnB,QAAQ,EAAE,kBAAkB;SAC/B;QAED;YACI,OAAO,EAAE,qBAAqB;YAC9B,QAAQ,EAAE,4BAA4B;SACzC;KACJ;2FAEQ,qBAAqB;kBA3BjC,SAAS;mBACV;oBACI,QAAQ,EAAE,sBAAsB;oBAChC,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,iBAAiB;4BAC1B,QAAQ,EAAE,wBAAwB;yBACrC;wBAED;4BACI,OAAO,EAAE,gBAAgB;4BACzB,QAAQ,EAAE,uBAAuB;yBACpC;wBAED;4BACI,OAAO,EAAE,UAAU;4BACnB,QAAQ,EAAE,kBAAkB;yBAC/B;wBAED;4BACI,OAAO,EAAE,qBAAqB;4BAC9B,QAAQ,EAAE,4BAA4B;yBACzC;qBACJ;iBACJ","sourcesContent":["import {Directive, ValueProvider} from '@angular/core';\n\nimport {NORMAL_STATE_TYPE, LIVE_SEARCH_TYPE, POPUP_TYPE, KEYBOARD_HANDLER_TYPE} from '../../misc/types';\nimport {EditNormalStateComponent} from '../../plugins/normalState/edit/editNormalState.component';\nimport {EditLiveSearchComponent} from '../../plugins/liveSearch/edit/editLiveSearch.component';\nimport {EditPopupComponent} from '../../plugins/popup/edit/editPopup.component';\nimport {EditKeyboardHandlerComponent} from '../../plugins/keyboardHandler/components';\nimport {NgSelectComponent} from '../../components/select/select.component';\nimport {ExcludingOptionsGatherer} from '../../misc/optionsGatherer/types';\n\n/**\n * Directive that applies options for NgSelect which enable usage of NgSelect edit (jira like) style\n */\n@Directive(\n{\n selector: 'ng-select[editStyle]',\n providers:\n [\n <ValueProvider>\n {\n provide: NORMAL_STATE_TYPE,\n useValue: EditNormalStateComponent\n },\n <ValueProvider>\n {\n provide: LIVE_SEARCH_TYPE,\n useValue: EditLiveSearchComponent\n },\n <ValueProvider>\n {\n provide: POPUP_TYPE,\n useValue: EditPopupComponent\n },\n <ValueProvider>\n {\n provide: KEYBOARD_HANDLER_TYPE,\n useValue: EditKeyboardHandlerComponent\n }\n ]\n})\nexport class NgSelectEditDirective\n{\n //######################### constructor #########################\n constructor(select: NgSelectComponent)\n {\n select.selectOptions =\n {\n optionsGatherer: new ExcludingOptionsGatherer()\n };\n }\n}"]}
1
+ {"version":3,"file":"ngSelectEdit.directive.js","sourceRoot":"","sources":["../../../../src/directives/ngSelectEdit/ngSelectEdit.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAgB,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAC,iBAAiB,EAAE,gBAAgB,EAAE,UAAU,EAAE,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AACxG,OAAO,EAAC,wBAAwB,EAAC,MAAM,0DAA0D,CAAC;AAClG,OAAO,EAAC,uBAAuB,EAAC,MAAM,wDAAwD,CAAC;AAC/F,OAAO,EAAC,kBAAkB,EAAC,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAC,4BAA4B,EAAC,MAAM,0CAA0C,CAAC;AACtF,OAAO,EAAC,iBAAiB,EAAC,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAC,wBAAwB,EAAC,MAAM,kCAAkC,CAAC;;;AAE1E;;GAEG;AA4BH,MAAM,OAAO,qBAAqB;IAE9B,iEAAiE;IACjE,YAAY,MAAyB;QAEjC,MAAM,CAAC,aAAa;YACpB;gBACI,eAAe,EAAE,IAAI,wBAAwB,EAAE;aAClD,CAAC;IACN,CAAC;;mHATQ,qBAAqB;uGAArB,qBAAqB,+CAvB9B;QAEI;YACI,OAAO,EAAE,iBAAiB;YAC1B,QAAQ,EAAE,wBAAwB;SACrC;QAED;YACI,OAAO,EAAE,gBAAgB;YACzB,QAAQ,EAAE,uBAAuB;SACpC;QAED;YACI,OAAO,EAAE,UAAU;YACnB,QAAQ,EAAE,kBAAkB;SAC/B;QAED;YACI,OAAO,EAAE,qBAAqB;YAC9B,QAAQ,EAAE,4BAA4B;SACzC;KACJ;4FAEQ,qBAAqB;kBA3BjC,SAAS;mBACV;oBACI,QAAQ,EAAE,sBAAsB;oBAChC,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,iBAAiB;4BAC1B,QAAQ,EAAE,wBAAwB;yBACrC;wBAED;4BACI,OAAO,EAAE,gBAAgB;4BACzB,QAAQ,EAAE,uBAAuB;yBACpC;wBAED;4BACI,OAAO,EAAE,UAAU;4BACnB,QAAQ,EAAE,kBAAkB;yBAC/B;wBAED;4BACI,OAAO,EAAE,qBAAqB;4BAC9B,QAAQ,EAAE,4BAA4B;yBACzC;qBACJ;iBACJ","sourcesContent":["import {Directive, ValueProvider} from '@angular/core';\n\nimport {NORMAL_STATE_TYPE, LIVE_SEARCH_TYPE, POPUP_TYPE, KEYBOARD_HANDLER_TYPE} from '../../misc/types';\nimport {EditNormalStateComponent} from '../../plugins/normalState/edit/editNormalState.component';\nimport {EditLiveSearchComponent} from '../../plugins/liveSearch/edit/editLiveSearch.component';\nimport {EditPopupComponent} from '../../plugins/popup/edit/editPopup.component';\nimport {EditKeyboardHandlerComponent} from '../../plugins/keyboardHandler/components';\nimport {NgSelectComponent} from '../../components/select/select.component';\nimport {ExcludingOptionsGatherer} from '../../misc/optionsGatherer/types';\n\n/**\n * Directive that applies options for NgSelect which enable usage of NgSelect edit (jira like) style\n */\n@Directive(\n{\n selector: 'ng-select[editStyle]',\n providers:\n [\n <ValueProvider>\n {\n provide: NORMAL_STATE_TYPE,\n useValue: EditNormalStateComponent\n },\n <ValueProvider>\n {\n provide: LIVE_SEARCH_TYPE,\n useValue: EditLiveSearchComponent\n },\n <ValueProvider>\n {\n provide: POPUP_TYPE,\n useValue: EditPopupComponent\n },\n <ValueProvider>\n {\n provide: KEYBOARD_HANDLER_TYPE,\n useValue: EditKeyboardHandlerComponent\n }\n ]\n})\nexport class NgSelectEditDirective\n{\n //######################### constructor #########################\n constructor(select: NgSelectComponent)\n {\n select.selectOptions =\n {\n optionsGatherer: new ExcludingOptionsGatherer()\n };\n }\n}"]}
@@ -29,9 +29,9 @@ export class NgSelectPlaceholderDirective {
29
29
  };
30
30
  }
31
31
  }
32
- NgSelectPlaceholderDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgSelectPlaceholderDirective, deps: [{ token: i1.NgSelectComponent }], target: i0.ɵɵFactoryTarget.Directive });
33
- NgSelectPlaceholderDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: NgSelectPlaceholderDirective, selector: "ng-select[placeholder]", inputs: { placeholder: "placeholder" }, ngImport: i0 });
34
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgSelectPlaceholderDirective, decorators: [{
32
+ NgSelectPlaceholderDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgSelectPlaceholderDirective, deps: [{ token: i1.NgSelectComponent }], target: i0.ɵɵFactoryTarget.Directive });
33
+ NgSelectPlaceholderDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: NgSelectPlaceholderDirective, selector: "ng-select[placeholder]", inputs: { placeholder: "placeholder" }, ngImport: i0 });
34
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgSelectPlaceholderDirective, decorators: [{
35
35
  type: Directive,
36
36
  args: [{
37
37
  selector: 'ng-select[placeholder]'
@@ -1 +1 @@
1
- {"version":3,"file":"ngSelectPlaceholder.directive.js","sourceRoot":"","sources":["../../../../src/directives/ngSelectPlaceholder/ngSelectPlaceholder.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAU,KAAK,EAAC,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAC,iBAAiB,EAAC,MAAM,0CAA0C,CAAC;;;AAG3E;;GAEG;AAKH,MAAM,OAAO,4BAA4B;IAUrC,iEAAiE;IACjE,YAAoB,OAA0B;QAA1B,YAAO,GAAP,OAAO,CAAmB;IAE9C,CAAC;IAED,+FAA+F;IAE/F;;OAEG;IACI,QAAQ;QAEX,IAAI,CAAC,OAAO,CAAC,aAAa;YAC1B;gBACI,OAAO,EACP;oBACI,UAAU,EACV;wBACI,OAAO,EACP;4BACI,KAAK,EACL;gCACI,gBAAgB,EAAE,IAAI,CAAC,WAAW;6BACrC;yBACJ;qBACJ;iBACJ;aACJ,CAAC;IACN,CAAC;;yHAtCQ,4BAA4B;6GAA5B,4BAA4B;2FAA5B,4BAA4B;kBAJxC,SAAS;mBACV;oBACI,QAAQ,EAAE,wBAAwB;iBACrC;wGASU,WAAW;sBADjB,KAAK","sourcesContent":["import {Directive, OnInit, Input} from '@angular/core';\n\nimport {NgSelectComponent} from '../../components/select/select.component';\nimport {LiveSearchOptions} from '../../plugins/liveSearch';\n\n/**\n * Directive used for setting live search placeholder text\n */\n@Directive(\n{\n selector: 'ng-select[placeholder]'\n})\nexport class NgSelectPlaceholderDirective implements OnInit\n{\n //######################### public properties - inputs #########################\n\n /**\n * Placeholder text used for live search plugin\n */\n @Input()\n public placeholder: string;\n\n //######################### constructor #########################\n constructor(private _select: NgSelectComponent)\n {\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this._select.selectOptions = \n {\n plugins:\n {\n liveSearch:\n {\n options: <LiveSearchOptions>\n {\n texts:\n {\n inputPlaceholder: this.placeholder\n }\n }\n }\n }\n };\n }\n}"]}
1
+ {"version":3,"file":"ngSelectPlaceholder.directive.js","sourceRoot":"","sources":["../../../../src/directives/ngSelectPlaceholder/ngSelectPlaceholder.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAU,KAAK,EAAC,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAC,iBAAiB,EAAC,MAAM,0CAA0C,CAAC;;;AAG3E;;GAEG;AAKH,MAAM,OAAO,4BAA4B;IAUrC,iEAAiE;IACjE,YAAoB,OAA0B;QAA1B,YAAO,GAAP,OAAO,CAAmB;IAE9C,CAAC;IAED,+FAA+F;IAE/F;;OAEG;IACI,QAAQ;QAEX,IAAI,CAAC,OAAO,CAAC,aAAa;YAC1B;gBACI,OAAO,EACP;oBACI,UAAU,EACV;wBACI,OAAO,EACP;4BACI,KAAK,EACL;gCACI,gBAAgB,EAAE,IAAI,CAAC,WAAW;6BACrC;yBACJ;qBACJ;iBACJ;aACJ,CAAC;IACN,CAAC;;0HAtCQ,4BAA4B;8GAA5B,4BAA4B;4FAA5B,4BAA4B;kBAJxC,SAAS;mBACV;oBACI,QAAQ,EAAE,wBAAwB;iBACrC;wGASU,WAAW;sBADjB,KAAK","sourcesContent":["import {Directive, OnInit, Input} from '@angular/core';\n\nimport {NgSelectComponent} from '../../components/select/select.component';\nimport {LiveSearchOptions} from '../../plugins/liveSearch';\n\n/**\n * Directive used for setting live search placeholder text\n */\n@Directive(\n{\n selector: 'ng-select[placeholder]'\n})\nexport class NgSelectPlaceholderDirective implements OnInit\n{\n //######################### public properties - inputs #########################\n\n /**\n * Placeholder text used for live search plugin\n */\n @Input()\n public placeholder: string;\n\n //######################### constructor #########################\n constructor(private _select: NgSelectComponent)\n {\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this._select.selectOptions = \n {\n plugins:\n {\n liveSearch:\n {\n options: <LiveSearchOptions>\n {\n texts:\n {\n inputPlaceholder: this.placeholder\n }\n }\n }\n }\n };\n }\n}"]}
@@ -150,9 +150,9 @@ export class NgSelectControlValueAccessor {
150
150
  }
151
151
  }
152
152
  }
153
- NgSelectControlValueAccessor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgSelectControlValueAccessor, deps: [{ token: i1.NgSelectComponent }], target: i0.ɵɵFactoryTarget.Directive });
154
- NgSelectControlValueAccessor.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: NgSelectControlValueAccessor, selector: "ng-select[formControlName],ng-select[formControl],ng-select[ngModel]", providers: [NG_SELECT_VALUE_ACCESSOR], ngImport: i0 });
155
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgSelectControlValueAccessor, decorators: [{
153
+ NgSelectControlValueAccessor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgSelectControlValueAccessor, deps: [{ token: i1.NgSelectComponent }], target: i0.ɵɵFactoryTarget.Directive });
154
+ NgSelectControlValueAccessor.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: NgSelectControlValueAccessor, selector: "ng-select[formControlName],ng-select[formControl],ng-select[ngModel]", providers: [NG_SELECT_VALUE_ACCESSOR], ngImport: i0 });
155
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgSelectControlValueAccessor, decorators: [{
156
156
  type: Directive,
157
157
  args: [{
158
158
  selector: 'ng-select[formControlName],ng-select[formControl],ng-select[ngModel]',
@@ -1 +1 @@
1
- {"version":3,"file":"ngSelectControlValueAccessor.directive.js","sourceRoot":"","sources":["../../../src/misc/ngSelectControlValueAccessor.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAoB,SAAS,EAAY,MAAM,eAAe,CAAC;AACjF,OAAO,EAAC,iBAAiB,EAAuB,MAAM,gBAAgB,CAAC;AAGvE,OAAO,EAAC,iBAAiB,EAAC,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAC,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAC,MAAM,oBAAoB,CAAC;;;AAE9F;;;GAGG;A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,wBAAwB,EAChC;YACI,IAAI,CAAC,wBAAwB,CAAC,WAAW,EAAE,CAAC;YAC5C,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAC;SACxC;QAED,IAAG,IAAI,CAAC,8BAA8B,EACtC;YACI,IAAI,CAAC,8BAA8B,CAAC,WAAW,EAAE,CAAC;YAClD,IAAI,CAAC,8BAA8B,GAAG,IAAI,CAAC;SAC9C;QAED,IAAG,IAAI,CAAC,6BAA6B,EACrC;YACI,IAAI,CAAC,6BAA6B,CAAC,WAAW,EAAE,CAAC;YACjD,IAAI,CAAC,6BAA6B,GAAG,IAAI,CAAC;SAC7C;QAED,IAAG,IAAI,CAAC,kBAAkB,EAC1B;YACI,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,CAAC;YACtC,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;SAClC;QAED,IAAG,IAAI,CAAC,gCAAgC,EACxC;YACI,IAAI,CAAC,gCAAgC,CAAC,WAAW,EAAE,CAAC;YACpD,IAAI,CAAC,gCAAgC,GAAG,IAAI,CAAC;SAChD;IACL,CAAC;;yHA3NQ,4BAA4B;6GAA5B,4BAA4B,+FAF1B,CAAC,wBAAwB,CAAC;2FAE5B,4BAA4B;kBALxC,SAAS;mBACV;oBACI,QAAQ,EAAE,sEAAsE;oBAChF,SAAS,EAAE,CAAC,wBAAwB,CAAC;iBACxC","sourcesContent":["import {forwardRef, ExistingProvider, Directive, OnDestroy} from '@angular/core';\nimport {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms';\nimport {Subscription} from 'rxjs';\n\nimport {NgSelectComponent} from '../components/select/select.component';\nimport {ɵValueChange, ɵSetValue, ɵOnFocus, ɵSetReadonly, ɵGetValue} from '../misc/extensions';\n\n/**\n * Provider for control value accessor\n * @internal\n */\nconst NG_SELECT_VALUE_ACCESSOR: ExistingProvider =\n{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => NgSelectControlValueAccessor),\n multi: true\n};\n\n/**\n * Control value accessor for NgSelectComponent\n */\n@Directive(\n{\n selector: 'ng-select[formControlName],ng-select[formControl],ng-select[ngModel]',\n providers: [NG_SELECT_VALUE_ACCESSOR]\n})\nexport class NgSelectControlValueAccessor<TValue = any> implements ControlValueAccessor, OnDestroy\n{\n //######################### private fields #########################\n\n /**\n * Subscription for initialized status of NgSelect, used for writeValue\n */\n private _initializedSubscription: Subscription;\n\n /**\n * Subscription for initialized status of NgSelect, used for registerOnChange\n */\n private _changeInitializedSubscription: Subscription;\n\n /**\n * Subscription for initialized status of NgSelect, used for registerOnTouched\n */\n private _touchInitializedSubscription: Subscription;\n\n /**\n * Subscription for initialized status of NgSelect, used for setDisabledState\n */\n private _disabledInitializedSubscription: Subscription;\n\n /**\n * Subscription that looks for changes of select\n */\n private _changeSubscription: Subscription = null;\n\n /**\n * Subscription that looks for changes of select\n */\n private _focusSubscription: Subscription = null;\n\n /**\n * Last set value to this control\n */\n private _value: TValue|TValue[];\n\n //######################### constructor #########################\n constructor(private _select: NgSelectComponent<TValue>)\n {\n }\n\n //######################### public methods - implementation of ControlValueAccessor #########################\n\n /**\n * Sets value to select\n */\n public writeValue(value: TValue|Array<TValue>): void\n {\n this._value = value;\n\n if(this._select.isInitialized)\n {\n this._select.execute(ɵSetValue(value));\n\n return;\n }\n\n if(this._initializedSubscription)\n {\n this._initializedSubscription.unsubscribe();\n this._initializedSubscription = null;\n }\n\n this._initializedSubscription = this._select.initialized.subscribe(initialized =>\n {\n if(initialized)\n {\n this._initializedSubscription.unsubscribe();\n this._initializedSubscription = null;\n\n this._select.execute(ɵSetValue(value));\n }\n });\n }\n\n /**\n * Registers callback that is called when value of select changes\n */\n public registerOnChange(fn: (data: TValue|Array<TValue>) => void): void\n {\n const fnWrapper = (value: TValue|Array<TValue>) =>\n {\n //multivalue is new array in case of change\n if(Array.isArray(value) && Array.isArray(this._value))\n {\n if(value !== this._value)\n {\n this._value = value;\n fn(value);\n }\n }\n else if(!Array.isArray(value) && !Array.isArray(this._value))\n {\n if(!this._select.selectOptions?.valueComparer(this._value, value))\n {\n this._value = value;\n fn(value);\n }\n }\n };\n\n this._changeInitializedSubscription = this._select.initialized.subscribe(initialized =>\n {\n if(initialized)\n {\n if(this._changeSubscription)\n {\n this._changeSubscription.unsubscribe();\n this._changeSubscription = null;\n }\n\n this._changeSubscription = this._select.executeAndReturn(ɵValueChange(fnWrapper));\n\n if(this._select.selectOptions.forceValueCheckOnInit)\n {\n const value = this._select.executeAndReturn(ɵGetValue());\n\n fnWrapper(value);\n }\n }\n });\n }\n\n /**\n * Registers callback that is called when select is closed\n */\n public registerOnTouched(fn: () => void): void\n {\n this._touchInitializedSubscription = this._select.initialized.subscribe(initialized =>\n {\n if(initialized)\n {\n if(this._focusSubscription)\n {\n this._focusSubscription.unsubscribe();\n this._focusSubscription = null;\n }\n\n this._focusSubscription = this._select.executeAndReturn(ɵOnFocus(fn));\n }\n });\n }\n\n /**\n * Sets NgSelect as disabled/readonly\n * @param isDisabled - Indication whether is control disabled or not\n */\n public setDisabledState(isDisabled: boolean): void\n {\n if(this._select.isInitialized)\n {\n this._select.execute(ɵSetReadonly(isDisabled));\n\n return;\n }\n\n if(this._disabledInitializedSubscription)\n {\n this._disabledInitializedSubscription.unsubscribe();\n this._disabledInitializedSubscription = null;\n }\n\n this._disabledInitializedSubscription = this._select.initialized.subscribe(initialized =>\n {\n if(initialized)\n {\n this._disabledInitializedSubscription.unsubscribe();\n this._disabledInitializedSubscription = null;\n\n this._select.execute(ɵSetReadonly(isDisabled));\n }\n });\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * Called when component is destroyed\n */\n public ngOnDestroy()\n {\n if(this._changeSubscription)\n {\n this._changeSubscription.unsubscribe();\n this._changeSubscription = null;\n }\n\n if(this._initializedSubscription)\n {\n this._initializedSubscription.unsubscribe();\n this._initializedSubscription = null;\n }\n\n if(this._changeInitializedSubscription)\n {\n this._changeInitializedSubscription.unsubscribe();\n this._changeInitializedSubscription = null;\n }\n\n if(this._touchInitializedSubscription)\n {\n this._touchInitializedSubscription.unsubscribe();\n this._touchInitializedSubscription = null;\n }\n\n if(this._focusSubscription)\n {\n this._focusSubscription.unsubscribe();\n this._focusSubscription = null;\n }\n\n if(this._disabledInitializedSubscription)\n {\n this._disabledInitializedSubscription.unsubscribe();\n this._disabledInitializedSubscription = null;\n }\n }\n}"]}
1
+ {"version":3,"file":"ngSelectControlValueAccessor.directive.js","sourceRoot":"","sources":["../../../src/misc/ngSelectControlValueAccessor.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAoB,SAAS,EAAY,MAAM,eAAe,CAAC;AACjF,OAAO,EAAC,iBAAiB,EAAuB,MAAM,gBAAgB,CAAC;AAGvE,OAAO,EAAC,iBAAiB,EAAC,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAC,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAC,MAAM,oBAAoB,CAAC;;;AAE9F;;;GAGG;AACH,MAAM,wBAAwB,GAC9B;IACI,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,4BAA4B,CAAC;IAC3D,KAAK,EAAE,IAAI;CACd,CAAC;AAEF;;GAEG;AAMH,MAAM,OAAO,4BAA4B;IAuCrC,iEAAiE;IACjE,YAAoB,OAAkC;QAAlC,YAAO,GAAP,OAAO,CAA2B;QAhBtD;;WAEG;QACK,wBAAmB,GAAiB,IAAI,CAAC;QAEjD;;WAEG;QACK,uBAAkB,GAAiB,IAAI,CAAC;IAUhD,CAAC;IAED,6GAA6G;IAE7G;;OAEG;IACI,UAAU,CAAC,KAA2B;QAEzC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QAEpB,IAAG,IAAI,CAAC,OAAO,CAAC,aAAa,EAC7B;YACI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;YAEvC,OAAO;SACV;QA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,CAAC;YACpD,IAAI,CAAC,gCAAgC,GAAG,IAAI,CAAC;SAChD;IACL,CAAC;;0HA3NQ,4BAA4B;8GAA5B,4BAA4B,+FAF1B,CAAC,wBAAwB,CAAC;4FAE5B,4BAA4B;kBALxC,SAAS;mBACV;oBACI,QAAQ,EAAE,sEAAsE;oBAChF,SAAS,EAAE,CAAC,wBAAwB,CAAC;iBACxC","sourcesContent":["import {forwardRef, ExistingProvider, Directive, OnDestroy} from '@angular/core';\nimport {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms';\nimport {Subscription} from 'rxjs';\n\nimport {NgSelectComponent} from '../components/select/select.component';\nimport {ɵValueChange, ɵSetValue, ɵOnFocus, ɵSetReadonly, ɵGetValue} from '../misc/extensions';\n\n/**\n * Provider for control value accessor\n * @internal\n */\nconst NG_SELECT_VALUE_ACCESSOR: ExistingProvider =\n{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => NgSelectControlValueAccessor),\n multi: true\n};\n\n/**\n * Control value accessor for NgSelectComponent\n */\n@Directive(\n{\n selector: 'ng-select[formControlName],ng-select[formControl],ng-select[ngModel]',\n providers: [NG_SELECT_VALUE_ACCESSOR]\n})\nexport class NgSelectControlValueAccessor<TValue = any> implements ControlValueAccessor, OnDestroy\n{\n //######################### private fields #########################\n\n /**\n * Subscription for initialized status of NgSelect, used for writeValue\n */\n private _initializedSubscription: Subscription;\n\n /**\n * Subscription for initialized status of NgSelect, used for registerOnChange\n */\n private _changeInitializedSubscription: Subscription;\n\n /**\n * Subscription for initialized status of NgSelect, used for registerOnTouched\n */\n private _touchInitializedSubscription: Subscription;\n\n /**\n * Subscription for initialized status of NgSelect, used for setDisabledState\n */\n private _disabledInitializedSubscription: Subscription;\n\n /**\n * Subscription that looks for changes of select\n */\n private _changeSubscription: Subscription = null;\n\n /**\n * Subscription that looks for changes of select\n */\n private _focusSubscription: Subscription = null;\n\n /**\n * Last set value to this control\n */\n private _value: TValue|TValue[];\n\n //######################### constructor #########################\n constructor(private _select: NgSelectComponent<TValue>)\n {\n }\n\n //######################### public methods - implementation of ControlValueAccessor #########################\n\n /**\n * Sets value to select\n */\n public writeValue(value: TValue|Array<TValue>): void\n {\n this._value = value;\n\n if(this._select.isInitialized)\n {\n this._select.execute(ɵSetValue(value));\n\n return;\n }\n\n if(this._initializedSubscription)\n {\n this._initializedSubscription.unsubscribe();\n this._initializedSubscription = null;\n }\n\n this._initializedSubscription = this._select.initialized.subscribe(initialized =>\n {\n if(initialized)\n {\n this._initializedSubscription.unsubscribe();\n this._initializedSubscription = null;\n\n this._select.execute(ɵSetValue(value));\n }\n });\n }\n\n /**\n * Registers callback that is called when value of select changes\n */\n public registerOnChange(fn: (data: TValue|Array<TValue>) => void): void\n {\n const fnWrapper = (value: TValue|Array<TValue>) =>\n {\n //multivalue is new array in case of change\n if(Array.isArray(value) && Array.isArray(this._value))\n {\n if(value !== this._value)\n {\n this._value = value;\n fn(value);\n }\n }\n else if(!Array.isArray(value) && !Array.isArray(this._value))\n {\n if(!this._select.selectOptions?.valueComparer(this._value, value))\n {\n this._value = value;\n fn(value);\n }\n }\n };\n\n this._changeInitializedSubscription = this._select.initialized.subscribe(initialized =>\n {\n if(initialized)\n {\n if(this._changeSubscription)\n {\n this._changeSubscription.unsubscribe();\n this._changeSubscription = null;\n }\n\n this._changeSubscription = this._select.executeAndReturn(ɵValueChange(fnWrapper));\n\n if(this._select.selectOptions.forceValueCheckOnInit)\n {\n const value = this._select.executeAndReturn(ɵGetValue());\n\n fnWrapper(value);\n }\n }\n });\n }\n\n /**\n * Registers callback that is called when select is closed\n */\n public registerOnTouched(fn: () => void): void\n {\n this._touchInitializedSubscription = this._select.initialized.subscribe(initialized =>\n {\n if(initialized)\n {\n if(this._focusSubscription)\n {\n this._focusSubscription.unsubscribe();\n this._focusSubscription = null;\n }\n\n this._focusSubscription = this._select.executeAndReturn(ɵOnFocus(fn));\n }\n });\n }\n\n /**\n * Sets NgSelect as disabled/readonly\n * @param isDisabled - Indication whether is control disabled or not\n */\n public setDisabledState(isDisabled: boolean): void\n {\n if(this._select.isInitialized)\n {\n this._select.execute(ɵSetReadonly(isDisabled));\n\n return;\n }\n\n if(this._disabledInitializedSubscription)\n {\n this._disabledInitializedSubscription.unsubscribe();\n this._disabledInitializedSubscription = null;\n }\n\n this._disabledInitializedSubscription = this._select.initialized.subscribe(initialized =>\n {\n if(initialized)\n {\n this._disabledInitializedSubscription.unsubscribe();\n this._disabledInitializedSubscription = null;\n\n this._select.execute(ɵSetReadonly(isDisabled));\n }\n });\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * Called when component is destroyed\n */\n public ngOnDestroy()\n {\n if(this._changeSubscription)\n {\n this._changeSubscription.unsubscribe();\n this._changeSubscription = null;\n }\n\n if(this._initializedSubscription)\n {\n this._initializedSubscription.unsubscribe();\n this._initializedSubscription = null;\n }\n\n if(this._changeInitializedSubscription)\n {\n this._changeInitializedSubscription.unsubscribe();\n this._changeInitializedSubscription = null;\n }\n\n if(this._touchInitializedSubscription)\n {\n this._touchInitializedSubscription.unsubscribe();\n this._touchInitializedSubscription = null;\n }\n\n if(this._focusSubscription)\n {\n this._focusSubscription.unsubscribe();\n this._focusSubscription = null;\n }\n\n if(this._disabledInitializedSubscription)\n {\n this._disabledInitializedSubscription.unsubscribe();\n this._disabledInitializedSubscription = null;\n }\n }\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ngSelectOptions.interface.js","sourceRoot":"","sources":["../../../src/misc/ngSelectOptions.interface.ts"],"names":[],"mappings":"","sourcesContent":["\nimport {NgSelectPluginTypes} from './plugin.interface';\nimport {OptionsGatherer, LiveSearchFilter} from './optionsGatherer/optionsGatherer.interface';\nimport {TemplateGatherer} from './templateGatherer.interface';\n\n/**\n * Function used for comparing two values\n */\nexport interface CompareValueFunc<TValue = any>\n{\n /**\n * Compares two values and returns true if objects are equal, otherwise false\n * @param source - First value to be compared\n * @param target - Second value to be compared\n */\n (source: TValue, target: TValue): boolean;\n}\n\n/**\n * Function used for normalization of value, used during comparison or search\n */\nexport interface NormalizeFunc<TValue = any>\n{\n /**\n * Normalize provided value, usually used with strings\n * @param value - Value that is being normalized\n */\n (value: TValue): TValue;\n}\n\n/**\n * Options used for plugin bus\n */\nexport interface PluginBusOptions<TValue = any>\n{\n /**\n * Instance of options gatherer that is used for obtaining options\n */\n optionsGatherer?: OptionsGatherer<TValue>;\n\n /**\n * Instance of template gatherer used for obtaining custom templates\n */\n templateGatherer?: TemplateGatherer;\n\n /**\n * Indication whether is NgSelect readonly or not\n */\n readonly?: boolean;\n\n /**\n * Indication that multiple values can be selected\n */\n multiple?: boolean;\n\n /**\n * Indication whether use non existing value in live search as new value, use with dynamic value handler\n */\n useNonExistingAsValue?: boolean;\n\n /**\n * Function of value comparer that is used for comparison of values\n */\n valueComparer?: CompareValueFunc<TValue>;\n\n /**\n * Method that is used for filtering when live search is running on static data\n */\n liveSearchFilter?: LiveSearchFilter<TValue>;\n\n /**\n * Normalizer used for normalizing values\n */\n normalizer?: NormalizeFunc<TValue>;\n}\n\n/**\n * Describes select options used for NgSelect\n */\nexport interface NgSelectOptions<TValue = any> extends PluginBusOptions<TValue>\n{\n /**\n * Indication whether NgSelect should be initialized automaticaly during 'NgOnInit' phase\n */\n autoInitialize?: boolean;\n\n /**\n * Css classes applied to ng select component, possible to override only part of classes\n */\n cssClasses?: {};\n\n /**\n * Object defining overrides for default plugins, default plugins can be also specified using DI\n */\n plugins?: NgSelectPluginTypes;\n\n /**\n * Indication whether is 'Popup' plugin displayd inside of NgSelect (false) or directly in Body (true)\n */\n absolute?: boolean;\n\n /**\n * Indication whether force value check on initialization of select, this allows to change value of form control to value of valueHandler\n */\n forceValueCheckOnInit?: boolean;\n}"]}
1
+ {"version":3,"file":"ngSelectOptions.interface.js","sourceRoot":"","sources":["../../../src/misc/ngSelectOptions.interface.ts"],"names":[],"mappings":"","sourcesContent":["\nimport {NgSelectPluginTypes} from './plugin.interface';\nimport {OptionsGatherer, LiveSearchFilter} from './optionsGatherer/optionsGatherer.interface';\nimport {TemplateGatherer} from './templateGatherer.interface';\n\n/**\n * Function used for comparing two values\n */\nexport interface CompareValueFunc<TValue = any>\n{\n /**\n * Compares two values and returns true if objects are equal, otherwise false\n * @param source - First value to be compared\n * @param target - Second value to be compared\n */\n (source: TValue, target: TValue): boolean;\n}\n\n/**\n * Function used for normalization of value, used during comparison or search\n */\nexport interface NormalizeFunc<TValue = any>\n{\n /**\n * Normalize provided value, usually used with strings\n * @param value - Value that is being normalized\n */\n (value: TValue): TValue;\n}\n\n/**\n * Options used for plugin bus\n */\nexport interface PluginBusOptions<TValue = any>\n{\n /**\n * Instance of options gatherer that is used for obtaining options\n */\n optionsGatherer?: OptionsGatherer<TValue>;\n\n /**\n * Instance of template gatherer used for obtaining custom templates\n */\n templateGatherer?: TemplateGatherer;\n\n /**\n * Indication whether is NgSelect readonly or not\n */\n readonly?: boolean;\n\n /**\n * Indication that multiple values can be selected\n */\n multiple?: boolean;\n\n /**\n * Indication whether use non existing value in live search as new value, use with dynamic value handler\n */\n useNonExistingAsValue?: boolean;\n\n /**\n * Function of value comparer that is used for comparison of values\n */\n valueComparer?: CompareValueFunc<TValue>;\n\n /**\n * Method that is used for filtering when live search is running on static data\n */\n liveSearchFilter?: LiveSearchFilter<TValue>;\n\n /**\n * Normalizer used for normalizing values\n */\n normalizer?: NormalizeFunc<TValue>;\n}\n\n/**\n * Describes select options used for NgSelect\n */\nexport interface NgSelectOptions<TValue = any> extends PluginBusOptions<TValue>\n{\n /**\n * Indication whether NgSelect should be initialized automaticaly during 'NgOnInit' phase\n */\n autoInitialize?: boolean;\n\n /**\n * Css classes applied to ng select component, possible to override only part of classes\n */\n cssClasses?: {};\n\n /**\n * Object defining overrides for default plugins, default plugins can be also specified using DI\n */\n plugins?: NgSelectPluginTypes;\n\n /**\n * Indication whether is 'Popup' plugin displayd inside of NgSelect (false) or directly in Body (true)\n */\n absolute?: boolean;\n\n /**\n * String that defines element in which should be absolute popup rendered, if not specified, body is used, used only if absolute is set to true, otherwise it has no effect\n *\n * Allows also css classes to be specified (div.body-box)\n */\n containerElement?: string;\n\n /**\n * Indication whether force value check on initialization of select, this allows to change value of form control to value of valueHandler\n */\n forceValueCheckOnInit?: boolean;\n}"]}