@anglr/select 11.0.2 → 12.0.0-beta.20230109082659
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +43 -0
- package/elements/src/components/ngSelectElements.component.d.ts +1 -1
- package/es2015/elements/src/components/ngSelectElements.component.js +7 -13
- package/es2015/elements/src/components/ngSelectElements.component.js.map +1 -1
- package/es2015/elements/src/modules/ngSelectElements.module.js +7 -9
- package/es2015/elements/src/modules/ngSelectElements.module.js.map +1 -1
- package/es2015/material/src/components/basicDialogPopup/basicDialogPopup.component.js +3 -3
- package/es2015/material/src/directives/dialogPopup/dialogPopup.directive.js +3 -3
- package/es2015/material/src/modules/dialogPopup.module.js +5 -7
- package/es2015/material/src/modules/dialogPopup.module.js.map +1 -1
- package/es2015/material/src/modules/virtualEditPopup.module.js +5 -7
- package/es2015/material/src/modules/virtualEditPopup.module.js.map +1 -1
- package/es2015/material/src/plugins/popup/dialog/dialogPopup.component.js +3 -3
- package/es2015/material/src/plugins/popup/virtualEdit/virtualEditPopup.component.js +5 -5
- package/es2015/src/components/option/optgroup.component.js +3 -3
- package/es2015/src/components/option/option.component.js +3 -3
- package/es2015/src/components/select/select.component.js +9 -15
- package/es2015/src/components/select/select.component.js.map +1 -1
- package/es2015/src/directives/ngSelectAbsolute/ngSelectAbsolute.directive.js +3 -3
- package/es2015/src/directives/ngSelectEdit/ngSelectEdit.directive.js +3 -3
- package/es2015/src/directives/ngSelectPlaceholder/ngSelectPlaceholder.directive.js +3 -3
- package/es2015/src/misc/ngSelectControlValueAccessor.directive.js +3 -3
- package/es2015/src/misc/pluginBus/pluginBus.js +3 -3
- package/es2015/src/modules/ngSelect.module.js +8 -10
- package/es2015/src/modules/ngSelect.module.js.map +1 -1
- package/es2015/src/modules/ngSelectDynamic.module.js +4 -4
- package/es2015/src/modules/ngSelectEdit.module.js +5 -7
- package/es2015/src/modules/ngSelectEdit.module.js.map +1 -1
- package/es2015/src/pipes/ngSelectHasValue.pipe.js +3 -3
- package/es2015/src/pipes/ngSelectValue.pipe.js +3 -3
- package/es2015/src/plugins/keyboardHandler/basic/basicKeyboardHandler.component.js +3 -3
- package/es2015/src/plugins/keyboardHandler/edit/editKeyboardHandler.component.js +3 -3
- package/es2015/src/plugins/liveSearch/basic/basicLiveSearch.component.js +3 -3
- package/es2015/src/plugins/liveSearch/edit/editLiveSearch.component.js +3 -3
- package/es2015/src/plugins/liveSearch/no/noLiveSearch.component.js +3 -3
- package/es2015/src/plugins/liveSearch/no/noLiveSearch.component.js.map +1 -1
- package/es2015/src/plugins/normalState/basic/basicNormalState.component.js +3 -3
- package/es2015/src/plugins/normalState/edit/editNormalState.component.js +3 -3
- package/es2015/src/plugins/normalState/normalStateAbstract.component.js +3 -3
- package/es2015/src/plugins/popup/basic/basicPopup.component.js +3 -3
- package/es2015/src/plugins/popup/basic/basicPopup.component.js.map +1 -1
- package/es2015/src/plugins/popup/edit/editPopup.component.js +3 -3
- package/es2015/src/plugins/popup/edit/editPopup.component.js.map +1 -1
- package/es2015/src/plugins/popup/popupAbstract.component.js +3 -3
- package/es2015/src/plugins/popup/popupAbstract.component.js.map +1 -1
- package/es2015/src/plugins/positioner/components.js +1 -1
- package/es2015/src/plugins/positioner/components.js.map +1 -1
- package/es2015/src/plugins/positioner/default/defaultPositioner.component.js +175 -0
- package/es2015/src/plugins/positioner/default/defaultPositioner.component.js.map +1 -0
- package/es2015/src/plugins/positioner/default/defaultPositioner.interface.js +2 -0
- package/es2015/src/plugins/positioner/default/defaultPositioner.interface.js.map +1 -0
- package/es2015/src/plugins/positioner/index.js +1 -1
- package/es2015/src/plugins/positioner/index.js.map +1 -1
- package/es2015/src/plugins/positioner/no/noPositioner.component.js +12 -7
- package/es2015/src/plugins/positioner/no/noPositioner.component.js.map +1 -1
- package/es2015/src/plugins/positioner/positioner.interface.js.map +1 -1
- package/es2015/src/plugins/positioner/types.js +0 -1
- package/es2015/src/plugins/positioner/types.js.map +1 -1
- package/es2015/src/plugins/valueHandler/basic/basicValueHandler.component.js +3 -3
- package/es2015/src/plugins/valueHandler/dynamic/dynamicValueHandler.component.js +3 -3
- package/es2015/src/plugins/valueHandler/valueHandlerBase.js +3 -3
- package/es2020/elements/src/components/ngSelectElements.component.js +7 -13
- package/es2020/elements/src/components/ngSelectElements.component.js.map +1 -1
- package/es2020/elements/src/modules/ngSelectElements.module.js +7 -9
- package/es2020/elements/src/modules/ngSelectElements.module.js.map +1 -1
- package/es2020/material/src/components/basicDialogPopup/basicDialogPopup.component.js +3 -3
- package/es2020/material/src/directives/dialogPopup/dialogPopup.directive.js +3 -3
- package/es2020/material/src/modules/dialogPopup.module.js +5 -7
- package/es2020/material/src/modules/dialogPopup.module.js.map +1 -1
- package/es2020/material/src/modules/virtualEditPopup.module.js +5 -7
- package/es2020/material/src/modules/virtualEditPopup.module.js.map +1 -1
- package/es2020/material/src/plugins/popup/dialog/dialogPopup.component.js +3 -3
- package/es2020/material/src/plugins/popup/virtualEdit/virtualEditPopup.component.js +5 -5
- package/es2020/src/components/option/optgroup.component.js +3 -3
- package/es2020/src/components/option/option.component.js +3 -3
- package/es2020/src/components/select/select.component.js +9 -15
- package/es2020/src/components/select/select.component.js.map +1 -1
- package/es2020/src/directives/ngSelectAbsolute/ngSelectAbsolute.directive.js +3 -3
- package/es2020/src/directives/ngSelectEdit/ngSelectEdit.directive.js +3 -3
- package/es2020/src/directives/ngSelectPlaceholder/ngSelectPlaceholder.directive.js +3 -3
- package/es2020/src/misc/ngSelectControlValueAccessor.directive.js +3 -3
- package/es2020/src/misc/pluginBus/pluginBus.js +3 -3
- package/es2020/src/modules/ngSelect.module.js +8 -10
- package/es2020/src/modules/ngSelect.module.js.map +1 -1
- package/es2020/src/modules/ngSelectDynamic.module.js +4 -4
- package/es2020/src/modules/ngSelectEdit.module.js +5 -7
- package/es2020/src/modules/ngSelectEdit.module.js.map +1 -1
- package/es2020/src/pipes/ngSelectHasValue.pipe.js +3 -3
- package/es2020/src/pipes/ngSelectValue.pipe.js +3 -3
- package/es2020/src/plugins/keyboardHandler/basic/basicKeyboardHandler.component.js +3 -3
- package/es2020/src/plugins/keyboardHandler/edit/editKeyboardHandler.component.js +3 -3
- package/es2020/src/plugins/liveSearch/basic/basicLiveSearch.component.js +3 -3
- package/es2020/src/plugins/liveSearch/edit/editLiveSearch.component.js +3 -3
- package/es2020/src/plugins/liveSearch/no/noLiveSearch.component.js +3 -3
- package/es2020/src/plugins/liveSearch/no/noLiveSearch.component.js.map +1 -1
- package/es2020/src/plugins/normalState/basic/basicNormalState.component.js +3 -3
- package/es2020/src/plugins/normalState/edit/editNormalState.component.js +3 -3
- package/es2020/src/plugins/normalState/normalStateAbstract.component.js +3 -3
- package/es2020/src/plugins/popup/basic/basicPopup.component.js +3 -3
- package/es2020/src/plugins/popup/basic/basicPopup.component.js.map +1 -1
- package/es2020/src/plugins/popup/edit/editPopup.component.js +3 -3
- package/es2020/src/plugins/popup/edit/editPopup.component.js.map +1 -1
- package/es2020/src/plugins/popup/popupAbstract.component.js +3 -3
- package/es2020/src/plugins/popup/popupAbstract.component.js.map +1 -1
- package/es2020/src/plugins/positioner/components.js +1 -1
- package/es2020/src/plugins/positioner/components.js.map +1 -1
- package/es2020/src/plugins/positioner/default/defaultPositioner.component.js +172 -0
- package/es2020/src/plugins/positioner/default/defaultPositioner.component.js.map +1 -0
- package/es2020/src/plugins/positioner/default/defaultPositioner.interface.js +2 -0
- package/es2020/src/plugins/positioner/default/defaultPositioner.interface.js.map +1 -0
- package/es2020/src/plugins/positioner/index.js +1 -1
- package/es2020/src/plugins/positioner/index.js.map +1 -1
- package/es2020/src/plugins/positioner/no/noPositioner.component.js +12 -7
- package/es2020/src/plugins/positioner/no/noPositioner.component.js.map +1 -1
- package/es2020/src/plugins/positioner/positioner.interface.js.map +1 -1
- package/es2020/src/plugins/positioner/types.js +0 -1
- package/es2020/src/plugins/positioner/types.js.map +1 -1
- package/es2020/src/plugins/valueHandler/basic/basicValueHandler.component.js +3 -3
- package/es2020/src/plugins/valueHandler/dynamic/dynamicValueHandler.component.js +3 -3
- package/es2020/src/plugins/valueHandler/valueHandlerBase.js +3 -3
- package/material/src/components/basicDialogPopup/basicDialogPopup.component.d.ts +1 -1
- package/material/src/directives/dialogPopup/dialogPopup.directive.d.ts +1 -1
- package/material/src/plugins/popup/dialog/dialogPopup.component.d.ts +1 -1
- package/material/src/plugins/popup/virtualEdit/virtualEditPopup.component.d.ts +1 -1
- package/package.json +37 -52
- package/src/components/option/optgroup.component.d.ts +1 -1
- package/src/components/option/option.component.d.ts +1 -1
- package/src/components/select/select.component.d.ts +1 -1
- package/src/directives/ngSelectAbsolute/ngSelectAbsolute.directive.d.ts +1 -1
- package/src/directives/ngSelectEdit/ngSelectEdit.directive.d.ts +1 -1
- package/src/directives/ngSelectPlaceholder/ngSelectPlaceholder.directive.d.ts +1 -1
- package/src/misc/ngSelectControlValueAccessor.directive.d.ts +1 -1
- package/src/modules/ngSelect.module.d.ts +2 -2
- package/src/pipes/ngSelectHasValue.pipe.d.ts +1 -1
- package/src/pipes/ngSelectValue.pipe.d.ts +1 -1
- package/src/plugins/keyboardHandler/basic/basicKeyboardHandler.component.d.ts +1 -1
- package/src/plugins/keyboardHandler/edit/editKeyboardHandler.component.d.ts +1 -1
- package/src/plugins/liveSearch/basic/basicLiveSearch.component.d.ts +1 -1
- package/src/plugins/liveSearch/edit/editLiveSearch.component.d.ts +1 -1
- package/src/plugins/liveSearch/no/noLiveSearch.component.d.ts +1 -1
- package/src/plugins/normalState/basic/basicNormalState.component.d.ts +1 -1
- package/src/plugins/normalState/edit/editNormalState.component.d.ts +1 -1
- package/src/plugins/normalState/normalStateAbstract.component.d.ts +1 -1
- package/src/plugins/popup/basic/basicPopup.component.d.ts +1 -1
- package/src/plugins/popup/edit/editPopup.component.d.ts +1 -1
- package/src/plugins/popup/popupAbstract.component.d.ts +1 -1
- package/src/plugins/positioner/components.d.ts +1 -1
- package/src/plugins/positioner/components.d.ts.map +1 -1
- package/src/plugins/positioner/default/defaultPositioner.component.d.ts +94 -0
- package/src/plugins/positioner/default/defaultPositioner.component.d.ts.map +1 -0
- package/src/plugins/positioner/default/defaultPositioner.interface.d.ts +12 -0
- package/src/plugins/positioner/default/defaultPositioner.interface.d.ts.map +1 -0
- package/src/plugins/positioner/index.d.ts +1 -1
- package/src/plugins/positioner/index.d.ts.map +1 -1
- package/src/plugins/positioner/no/noPositioner.component.d.ts +11 -3
- package/src/plugins/positioner/no/noPositioner.component.d.ts.map +1 -1
- package/src/plugins/positioner/positioner.interface.d.ts +8 -7
- package/src/plugins/positioner/positioner.interface.d.ts.map +1 -1
- package/src/plugins/positioner/types.d.ts +0 -1
- package/src/plugins/positioner/types.d.ts.map +1 -1
- package/src/plugins/valueHandler/basic/basicValueHandler.component.d.ts +1 -1
- package/src/plugins/valueHandler/dynamic/dynamicValueHandler.component.d.ts +1 -1
- package/src/plugins/valueHandler/valueHandlerBase.d.ts +1 -1
- package/version.bak +1 -1
- package/es2015/popperJs/src/index.js +0 -4
- package/es2015/popperJs/src/index.js.map +0 -1
- package/es2015/popperJs/src/modules/popperjsPositioner.module.js +0 -23
- package/es2015/popperJs/src/modules/popperjsPositioner.module.js.map +0 -1
- package/es2015/popperJs/src/plugins/positioner/components.js +0 -2
- package/es2015/popperJs/src/plugins/positioner/components.js.map +0 -1
- package/es2015/popperJs/src/plugins/positioner/index.js +0 -2
- package/es2015/popperJs/src/plugins/positioner/index.js.map +0 -1
- package/es2015/popperJs/src/plugins/positioner/popperJs/popperJsPositioner.component.js +0 -151
- package/es2015/popperJs/src/plugins/positioner/popperJs/popperJsPositioner.component.js.map +0 -1
- package/es2015/popperJs/src/plugins/positioner/popperJs/popperjsPositioner.interface.js +0 -2
- package/es2015/popperJs/src/plugins/positioner/popperJs/popperjsPositioner.interface.js.map +0 -1
- package/es2015/src/plugins/positioner/basic/basicPositioner.component.js +0 -193
- package/es2015/src/plugins/positioner/basic/basicPositioner.component.js.map +0 -1
- package/es2015/src/plugins/positioner/basic/basicPositioner.interface.js +0 -2
- package/es2015/src/plugins/positioner/basic/basicPositioner.interface.js.map +0 -1
- package/es2015/src/plugins/positioner/basic/types.js +0 -36
- package/es2015/src/plugins/positioner/basic/types.js.map +0 -1
- package/es2020/popperJs/src/index.js +0 -4
- package/es2020/popperJs/src/index.js.map +0 -1
- package/es2020/popperJs/src/modules/popperjsPositioner.module.js +0 -23
- package/es2020/popperJs/src/modules/popperjsPositioner.module.js.map +0 -1
- package/es2020/popperJs/src/plugins/positioner/components.js +0 -2
- package/es2020/popperJs/src/plugins/positioner/components.js.map +0 -1
- package/es2020/popperJs/src/plugins/positioner/index.js +0 -2
- package/es2020/popperJs/src/plugins/positioner/index.js.map +0 -1
- package/es2020/popperJs/src/plugins/positioner/popperJs/popperJsPositioner.component.js +0 -148
- package/es2020/popperJs/src/plugins/positioner/popperJs/popperJsPositioner.component.js.map +0 -1
- package/es2020/popperJs/src/plugins/positioner/popperJs/popperjsPositioner.interface.js +0 -2
- package/es2020/popperJs/src/plugins/positioner/popperJs/popperjsPositioner.interface.js.map +0 -1
- package/es2020/src/plugins/positioner/basic/basicPositioner.component.js +0 -190
- package/es2020/src/plugins/positioner/basic/basicPositioner.component.js.map +0 -1
- package/es2020/src/plugins/positioner/basic/basicPositioner.interface.js +0 -2
- package/es2020/src/plugins/positioner/basic/basicPositioner.interface.js.map +0 -1
- package/es2020/src/plugins/positioner/basic/types.js +0 -36
- package/es2020/src/plugins/positioner/basic/types.js.map +0 -1
- package/popperJs/package.json +0 -9
- package/popperJs/src/index.d.ts +0 -4
- package/popperJs/src/index.d.ts.map +0 -1
- package/popperJs/src/modules/popperjsPositioner.module.d.ts +0 -11
- package/popperJs/src/modules/popperjsPositioner.module.d.ts.map +0 -1
- package/popperJs/src/plugins/positioner/components.d.ts +0 -2
- package/popperJs/src/plugins/positioner/components.d.ts.map +0 -1
- package/popperJs/src/plugins/positioner/index.d.ts +0 -2
- package/popperJs/src/plugins/positioner/index.d.ts.map +0 -1
- package/popperJs/src/plugins/positioner/popperJs/popperJsPositioner.component.d.ts +0 -78
- package/popperJs/src/plugins/positioner/popperJs/popperJsPositioner.component.d.ts.map +0 -1
- package/popperJs/src/plugins/positioner/popperJs/popperjsPositioner.interface.d.ts +0 -12
- package/popperJs/src/plugins/positioner/popperJs/popperjsPositioner.interface.d.ts.map +0 -1
- package/src/plugins/positioner/basic/basicPositioner.component.d.ts +0 -90
- package/src/plugins/positioner/basic/basicPositioner.component.d.ts.map +0 -1
- package/src/plugins/positioner/basic/basicPositioner.interface.d.ts +0 -29
- package/src/plugins/positioner/basic/basicPositioner.interface.d.ts.map +0 -1
- package/src/plugins/positioner/basic/types.d.ts +0 -22
- package/src/plugins/positioner/basic/types.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noLiveSearch.component.js","sourceRoot":"","sources":["../../../../../src/plugins/liveSearch/no/noLiveSearch.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAKzC,OAAO,EAAC,0BAA0B,EAAC,MAAM,kCAAkC,CAAC;;AAG5E;;GAEG;AAOH,MAAM,OAAO,qBAAqB;IAuC9B,iEAAiE;IACjE,YAAmE,eAAwC,EACxF,aAAyB,EACN,SAAmB;QAFU,oBAAe,GAAf,eAAe,CAAyB;QACxF,kBAAa,GAAb,aAAa,CAAY;QACN,cAAS,GAAT,SAAS,CAAU;QAbzD;;WAEG;QACI,gBAAW,GAAW,IAAI,CAAC;QAElC;;WAEG;QACI,sBAAiB,GAAuB,IAAI,YAAY,EAAQ,CAAC;IAOxE,CAAC;IAvBD;;OAEG;IACH,IAAW,iBAAiB;QAExB,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAChD,CAAC;IAmBD,qGAAqG;IAErG;;OAEG;IACI,UAAU;IAEjB,CAAC;IAED;;OAEG;IACI,WAAW;IAElB,CAAC;IAED;;OAEG;IACI,iBAAiB;IAExB,CAAC;;kHAnEQ,qBAAqB,kBAwCV,0BAA0B,uDAE1B,QAAQ;sGA1CnB,qBAAqB,yDAHpB,EAAE;2FAGH,qBAAqB;kBANjC,SAAS;mBACV;oBACI,QAAQ,EAAE,mBAAmB;oBAC7B,QAAQ,EAAE,EAAE;oBACZ,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAClD;;0BAyCgB,MAAM;2BAAC,0BAA0B;;0BAAG,QAAQ
|
|
1
|
+
{"version":3,"file":"noLiveSearch.component.js","sourceRoot":"","sources":["../../../../../src/plugins/liveSearch/no/noLiveSearch.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAKzC,OAAO,EAAC,0BAA0B,EAAC,MAAM,kCAAkC,CAAC;;AAG5E;;GAEG;AAOH,MAAM,OAAO,qBAAqB;IAuC9B,iEAAiE;IACjE,YAAmE,eAAwC,EACxF,aAAyB,EACN,SAAmB;QAFU,oBAAe,GAAf,eAAe,CAAyB;QACxF,kBAAa,GAAb,aAAa,CAAY;QACN,cAAS,GAAT,SAAS,CAAU;QAbzD;;WAEG;QACI,gBAAW,GAAW,IAAI,CAAC;QAElC;;WAEG;QACI,sBAAiB,GAAuB,IAAI,YAAY,EAAQ,CAAC;IAOxE,CAAC;IAvBD;;OAEG;IACH,IAAW,iBAAiB;QAExB,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAChD,CAAC;IAmBD,qGAAqG;IAErG;;OAEG;IACI,UAAU;IAEjB,CAAC;IAED;;OAEG;IACI,WAAW;IAElB,CAAC;IAED;;OAEG;IACI,iBAAiB;IAExB,CAAC;;kHAnEQ,qBAAqB,kBAwCV,0BAA0B,uDAE1B,QAAQ;sGA1CnB,qBAAqB,yDAHpB,EAAE;2FAGH,qBAAqB;kBANjC,SAAS;mBACV;oBACI,QAAQ,EAAE,mBAAmB;oBAC7B,QAAQ,EAAE,EAAE;oBACZ,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAClD;;0BAyCgB,MAAM;2BAAC,0BAA0B;;0BAAG,QAAQ;;0BAE5C,MAAM;2BAAC,QAAQ","sourcesContent":["import {Component, ChangeDetectionStrategy, Inject, Optional, ElementRef, EventEmitter} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\n\nimport {NoLiveSearchOptions, NoLiveSearch} from './noLiveSearch.interface';\nimport {NgSelectPlugin} from '../../../misc';\nimport {NgSelectPluginInstances} from '../../../components/select';\nimport {NG_SELECT_PLUGIN_INSTANCES} from '../../../components/select/types';\nimport {PluginBus} from '../../../misc/pluginBus/pluginBus';\n\n/**\n * Component used for no live search\n */\n@Component(\n{\n selector: 'ng-no-live-search',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NoLiveSearchComponent implements NoLiveSearch, NgSelectPlugin<NoLiveSearchOptions>\n{\n //######################### protected fields #########################\n\n /**\n * Options for NgSelect plugin\n */\n protected _options: NoLiveSearchOptions;\n\n //######################### public properties - implementation of NoLiveSearch #########################\n\n /**\n * Options for NgSelect plugin\n */\n public options: NoLiveSearchOptions;\n\n /**\n * Plugin bus used for inter plugin shared events\n */\n public pluginBus: PluginBus;\n\n /**\n * HTML element that represents live search\n */\n public get liveSearchElement(): HTMLElement\n {\n return this._document.createElement('span');\n }\n\n /**\n * Current value of live search\n */\n public searchValue: string = null;\n\n /**\n * Occurs when current value of live search changes\n */\n public searchValueChange: EventEmitter<void> = new EventEmitter<void>();\n\n //######################### constructor #########################\n constructor(@Inject(NG_SELECT_PLUGIN_INSTANCES) @Optional() public ngSelectPlugins: NgSelectPluginInstances,\n public pluginElement: ElementRef,\n @Inject(DOCUMENT) private _document: Document)\n {\n }\n\n //######################### public methods - implementation of NoLiveSearch #########################\n\n /**\n * Initialize plugin, to be ready to use, initialize communication with other plugins\n */\n public initialize()\n {\n }\n\n /**\n * Initialize plugin options, all operations required to be done with plugin options are handled here\n */\n public initOptions()\n {\n }\n\n /**\n * Explicitly runs invalidation of content (change detection)\n */\n public invalidateVisuals(): void\n {\n }\n}"]}
|
|
@@ -34,9 +34,9 @@ export class BasicNormalStateComponent extends NormalStateAbstractComponent {
|
|
|
34
34
|
this._options = extend(true, {}, defaultOptions, options);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
BasicNormalStateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
38
|
-
BasicNormalStateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
39
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
37
|
+
BasicNormalStateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BasicNormalStateComponent, deps: [{ token: NG_SELECT_PLUGIN_INSTANCES, optional: true }, { token: i1.PluginBus, optional: true }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: STRING_LOCALIZATION }, { token: NORMAL_STATE_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
38
|
+
BasicNormalStateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: BasicNormalStateComponent, selector: "div.normal-state", usesInheritance: true, ngImport: i0, template: "<ng-template #defaultLook>{{valueHandler?.selectedOptions | ngSelectValue: texts?.nothingSelected: options?.optionDisplayText}}</ng-template>\r\n\r\n<button [ngClass]=\"options?.cssClasses?.normalStateElement\" (click)=\"pluginBus?.togglePopup.emit(); pluginBus?.liveSearchFocus.emit()\" (focus)=\"pluginBus?.focus?.emit()\" [disabled]=\"!!pluginBus?.selectOptions?.readonly\" type=\"button\" [title]=\"valueHandler?.selectedOptions | ngSelectValue: texts?.nothingSelected\">\r\n <span [ngClass]=\"options?.cssClasses?.selectedValue\"><ng-container *ngTemplateOutlet=\"pluginBus?.selectOptions?.templateGatherer?.normalStateTemplate || defaultLook; context: {$implicit: this}\"></ng-container></span>\r\n <span [ngClass]=\"options?.cssClasses?.selectedCarret\"></span>\r\n</button>", styles: ["button.btn-select\r\n{\r\n display: flex;\r\n width: 100%;\r\n padding: 5px 0px 4px 6px;\r\n background-color: #ffffff;\r\n background-image: none;\r\n border: 1px solid #cccccc;\r\n border-radius: 4px;\r\n box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;\r\n height: 28px;\r\n overflow: hidden;\r\n}\r\n\r\nbutton.btn-select:hover\r\n{\r\n background-color: #F2F2F2;\r\n}\r\n\r\nbutton.btn-select:active\r\n{\r\n box-shadow: 0 0 5px -1px #888888 inset;\r\n}\r\n\r\nbutton.btn-select .selected-value\r\n{\r\n flex: 1;\r\n text-align: left;\r\n min-width: 0;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n}\r\n\r\nbutton.btn-select .selected-caret\r\n{\r\n flex: 0 0 20px;\r\n align-self: center;\r\n}"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i3.NgSelectValuePipe, name: "ngSelectValue" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
39
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BasicNormalStateComponent, decorators: [{
|
|
40
40
|
type: Component,
|
|
41
41
|
args: [{ selector: 'div.normal-state', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template #defaultLook>{{valueHandler?.selectedOptions | ngSelectValue: texts?.nothingSelected: options?.optionDisplayText}}</ng-template>\r\n\r\n<button [ngClass]=\"options?.cssClasses?.normalStateElement\" (click)=\"pluginBus?.togglePopup.emit(); pluginBus?.liveSearchFocus.emit()\" (focus)=\"pluginBus?.focus?.emit()\" [disabled]=\"!!pluginBus?.selectOptions?.readonly\" type=\"button\" [title]=\"valueHandler?.selectedOptions | ngSelectValue: texts?.nothingSelected\">\r\n <span [ngClass]=\"options?.cssClasses?.selectedValue\"><ng-container *ngTemplateOutlet=\"pluginBus?.selectOptions?.templateGatherer?.normalStateTemplate || defaultLook; context: {$implicit: this}\"></ng-container></span>\r\n <span [ngClass]=\"options?.cssClasses?.selectedCarret\"></span>\r\n</button>", styles: ["button.btn-select\r\n{\r\n display: flex;\r\n width: 100%;\r\n padding: 5px 0px 4px 6px;\r\n background-color: #ffffff;\r\n background-image: none;\r\n border: 1px solid #cccccc;\r\n border-radius: 4px;\r\n box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;\r\n height: 28px;\r\n overflow: hidden;\r\n}\r\n\r\nbutton.btn-select:hover\r\n{\r\n background-color: #F2F2F2;\r\n}\r\n\r\nbutton.btn-select:active\r\n{\r\n box-shadow: 0 0 5px -1px #888888 inset;\r\n}\r\n\r\nbutton.btn-select .selected-value\r\n{\r\n flex: 1;\r\n text-align: left;\r\n min-width: 0;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n}\r\n\r\nbutton.btn-select .selected-caret\r\n{\r\n flex: 0 0 20px;\r\n align-self: center;\r\n}"] }]
|
|
42
42
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
@@ -65,9 +65,9 @@ export class EditNormalStateComponent extends NormalStateAbstractComponent {
|
|
|
65
65
|
this.pluginBus.updateDisplayedValue.emit();
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
EditNormalStateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
69
|
-
EditNormalStateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
70
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
68
|
+
EditNormalStateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: EditNormalStateComponent, deps: [{ token: NG_SELECT_PLUGIN_INSTANCES, optional: true }, { token: i1.PluginBus, optional: true }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: STRING_LOCALIZATION }, { token: NORMAL_STATE_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
69
|
+
EditNormalStateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: EditNormalStateComponent, selector: "div.edit-normal-state", usesInheritance: true, ngImport: i0, template: "<div [ngClass]=\"options?.cssClasses?.normalStateElement\" [title]=\"valueHandler?.selectedOptions | ngSelectValue: texts?.nothingSelected\">\r\n <ng-template [ngIf]=\"pluginBus.selectOptions.multiple\">\r\n <div *ngFor=\"let option of selectedOptions\" [ngClass]=\"options?.cssClasses?.selectedMultiValueContainer\">\r\n <span>{{option | ngSelectValue: texts?.nothingSelected: options?.optionDisplayText}}</span>\r\n <span [ngClass]=\"options?.cssClasses?.selectedMultiValueCancel\"\r\n (click)=\"pluginBus.optionCancel.emit(option)\">x</span>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-content></ng-content>\r\n\r\n <div *ngIf=\"options?.cancelButton && (valueHandler?.selectedOptions | ngSelectHasValue)\"\r\n (click)=\"cancelSelected()\"\r\n [ngClass]=\"options?.cssClasses?.cancelSelectedElement\"></div>\r\n\r\n <div [ngClass]=\"options?.cssClasses?.selectedCarretWrapper\" (click)=\"pluginBus?.togglePopup.emit(); pluginBus?.liveSearchFocus?.emit()\" *ngIf=\"options?.showOptionsButton\">\r\n <span [ngClass]=\"options?.cssClasses?.selectedCarret\"></span>\r\n </div>\r\n</div>", styles: ["div.btn-select\r\n{\r\n display: flex;\r\n flex-direction: row;\r\n width: 100%;\r\n padding: 0;\r\n background-color: #ffffff;\r\n background-image: none;\r\n border: 1px solid #cccccc;\r\n border-radius: 4px;\r\n box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;\r\n height: 28px;\r\n overflow: hidden;\r\n cursor: default;\r\n}\r\n\r\ndiv.btn-select:hover .selected-caret\r\n{\r\n background-color: #F2F2F2;\r\n}\r\n\r\ndiv.btn-select .selected-value\r\n{\r\n flex: 1;\r\n text-align: left;\r\n min-width: 0;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n}\r\n\r\ndiv.btn-select .selected-caret\r\n{\r\n flex: 0 0 20px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n flex-direction: row;\r\n cursor: pointer;\r\n}\r\n\r\n.selected-multi-value\r\n{\r\n align-self: center;\r\n padding: 1px 4px;\r\n border-radius: 4px;\r\n margin-left: 3px;\r\n margin-right: 3px;\r\n background: #BBB;\r\n}\r\n\r\n.selected-multi-value-cancel\r\n{\r\n margin-left: 4px;\r\n}\r\n\r\n.selected-multi-value-cancel:hover\r\n{\r\n opacity: 0.7;\r\n cursor: pointer;\r\n}\r\n\r\n.cancel-selected\r\n{\r\n cursor: pointer;\r\n align-self: center;\r\n padding: 2px;\r\n}\r\n\r\n.cancel-selected:hover\r\n{\r\n opacity: 0.7;\r\n}\r\n\r\n.cancel-selected:before \r\n{\r\n content: \"\\f00d\"; \r\n} "], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i3.NgSelectValuePipe, name: "ngSelectValue" }, { kind: "pipe", type: i4.NgSelectHasValuePipe, name: "ngSelectHasValue" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
70
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: EditNormalStateComponent, decorators: [{
|
|
71
71
|
type: Component,
|
|
72
72
|
args: [{ selector: 'div.edit-normal-state', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [ngClass]=\"options?.cssClasses?.normalStateElement\" [title]=\"valueHandler?.selectedOptions | ngSelectValue: texts?.nothingSelected\">\r\n <ng-template [ngIf]=\"pluginBus.selectOptions.multiple\">\r\n <div *ngFor=\"let option of selectedOptions\" [ngClass]=\"options?.cssClasses?.selectedMultiValueContainer\">\r\n <span>{{option | ngSelectValue: texts?.nothingSelected: options?.optionDisplayText}}</span>\r\n <span [ngClass]=\"options?.cssClasses?.selectedMultiValueCancel\"\r\n (click)=\"pluginBus.optionCancel.emit(option)\">x</span>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-content></ng-content>\r\n\r\n <div *ngIf=\"options?.cancelButton && (valueHandler?.selectedOptions | ngSelectHasValue)\"\r\n (click)=\"cancelSelected()\"\r\n [ngClass]=\"options?.cssClasses?.cancelSelectedElement\"></div>\r\n\r\n <div [ngClass]=\"options?.cssClasses?.selectedCarretWrapper\" (click)=\"pluginBus?.togglePopup.emit(); pluginBus?.liveSearchFocus?.emit()\" *ngIf=\"options?.showOptionsButton\">\r\n <span [ngClass]=\"options?.cssClasses?.selectedCarret\"></span>\r\n </div>\r\n</div>", styles: ["div.btn-select\r\n{\r\n display: flex;\r\n flex-direction: row;\r\n width: 100%;\r\n padding: 0;\r\n background-color: #ffffff;\r\n background-image: none;\r\n border: 1px solid #cccccc;\r\n border-radius: 4px;\r\n box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;\r\n height: 28px;\r\n overflow: hidden;\r\n cursor: default;\r\n}\r\n\r\ndiv.btn-select:hover .selected-caret\r\n{\r\n background-color: #F2F2F2;\r\n}\r\n\r\ndiv.btn-select .selected-value\r\n{\r\n flex: 1;\r\n text-align: left;\r\n min-width: 0;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n}\r\n\r\ndiv.btn-select .selected-caret\r\n{\r\n flex: 0 0 20px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n flex-direction: row;\r\n cursor: pointer;\r\n}\r\n\r\n.selected-multi-value\r\n{\r\n align-self: center;\r\n padding: 1px 4px;\r\n border-radius: 4px;\r\n margin-left: 3px;\r\n margin-right: 3px;\r\n background: #BBB;\r\n}\r\n\r\n.selected-multi-value-cancel\r\n{\r\n margin-left: 4px;\r\n}\r\n\r\n.selected-multi-value-cancel:hover\r\n{\r\n opacity: 0.7;\r\n cursor: pointer;\r\n}\r\n\r\n.cancel-selected\r\n{\r\n cursor: pointer;\r\n align-self: center;\r\n padding: 2px;\r\n}\r\n\r\n.cancel-selected:hover\r\n{\r\n opacity: 0.7;\r\n}\r\n\r\n.cancel-selected:before \r\n{\r\n content: \"\\f00d\"; \r\n} "] }]
|
|
73
73
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
@@ -85,9 +85,9 @@ export class NormalStateAbstractComponent {
|
|
|
85
85
|
this._changeDetector.detectChanges();
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
NormalStateAbstractComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
89
|
-
NormalStateAbstractComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
90
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
88
|
+
NormalStateAbstractComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NormalStateAbstractComponent, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
|
|
89
|
+
NormalStateAbstractComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: NormalStateAbstractComponent, ngImport: i0 });
|
|
90
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NormalStateAbstractComponent, decorators: [{
|
|
91
91
|
type: Directive
|
|
92
92
|
}], ctorParameters: function () { return [{ type: undefined }, { type: i1.PluginBus }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: undefined }]; } });
|
|
93
93
|
//# sourceMappingURL=normalStateAbstract.component.js.map
|
|
@@ -35,9 +35,9 @@ export class BasicPopupComponent extends PopupAbstractComponent {
|
|
|
35
35
|
this._options = extend(true, {}, defaultOptions, options);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
BasicPopupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
39
|
-
BasicPopupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
40
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
38
|
+
BasicPopupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BasicPopupComponent, deps: [{ token: NG_SELECT_PLUGIN_INSTANCES, optional: true }, { token: i1.PluginBus, optional: true }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: POPUP_OPTIONS, optional: true }, { token: STRING_LOCALIZATION }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
|
|
39
|
+
BasicPopupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: BasicPopupComponent, selector: "div.ng-select-popup", usesInheritance: true, ngImport: i0, template: "<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 <ng-content></ng-content>\r\n\r\n <div *ngFor=\"let option of selectOptions\"\r\n [ngClass]=\"options?.cssClasses?.optionItemDiv\"\r\n [class.selected]=\"option?.selected\"\r\n [class.active]=\"option?.active\"\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\r\n <div *ngIf=\"option?.selected && pluginBus?.selectOptions?.multiple\" [ngClass]=\"options?.cssClasses?.optionChecked\"></div>\r\n </div>\r\n\r\n <div *ngIf=\"!selectOptions?.length\">{{texts?.noAvailableOptions}}</div>\r\n</div>", styles: [".popup-div\r\n{\r\n position: absolute;\r\n z-index: 1000;\r\n background-color: #FFFFFF;\r\n border-radius: 4px;\r\n border: 1px solid #BBBBBB;\r\n overflow: auto;\r\n padding: 5px 0;\r\n box-shadow: 0 6px 12px rgba(0,0,0,.175);\r\n scrollbar-width: thin;\r\n}\r\n\r\n.popup-div::-webkit-scrollbar-thumb \r\n{\r\n background-color: #cdcdcd;\r\n}\r\n\r\n.popup-div::-webkit-scrollbar \r\n{\r\n width: 6px;\r\n background-color: #f0f0f0;\r\n}\r\n\r\n.option-item\r\n{\r\n padding: 3px 12px;\r\n display: flex;\r\n align-items: center;\r\n}\r\n\r\n.option-item .option-item-text\r\n{\r\n min-width: 0;\r\n flex: 1;\r\n white-space: nowrap;\r\n}\r\n\r\n.option-item .option-item-text:hover\r\n{\r\n cursor: pointer;\r\n}\r\n\r\n.option-item .fa-check\r\n{\r\n margin-left: 8px;\r\n}\r\n\r\n.option-item.selected,\r\n.option-item.active\r\n{\r\n background-color: #E8E8E8;\r\n background-image: linear-gradient(to bottom,#F5F5F5 0,#E8E8E8 100%);\r\n}\r\n\r\n.option-item:hover\r\n{\r\n background-color: #E8E8E8;\r\n background-image: linear-gradient(to bottom,#F5F5F5 0,#E8E8E8 100%);\r\n cursor: pointer;\r\n}"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
40
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BasicPopupComponent, decorators: [{
|
|
41
41
|
type: Component,
|
|
42
42
|
args: [{ selector: 'div.ng-select-popup', changeDetection: ChangeDetectionStrategy.OnPush, template: "<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 <ng-content></ng-content>\r\n\r\n <div *ngFor=\"let option of selectOptions\"\r\n [ngClass]=\"options?.cssClasses?.optionItemDiv\"\r\n [class.selected]=\"option?.selected\"\r\n [class.active]=\"option?.active\"\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\r\n <div *ngIf=\"option?.selected && pluginBus?.selectOptions?.multiple\" [ngClass]=\"options?.cssClasses?.optionChecked\"></div>\r\n </div>\r\n\r\n <div *ngIf=\"!selectOptions?.length\">{{texts?.noAvailableOptions}}</div>\r\n</div>", styles: [".popup-div\r\n{\r\n position: absolute;\r\n z-index: 1000;\r\n background-color: #FFFFFF;\r\n border-radius: 4px;\r\n border: 1px solid #BBBBBB;\r\n overflow: auto;\r\n padding: 5px 0;\r\n box-shadow: 0 6px 12px rgba(0,0,0,.175);\r\n scrollbar-width: thin;\r\n}\r\n\r\n.popup-div::-webkit-scrollbar-thumb \r\n{\r\n background-color: #cdcdcd;\r\n}\r\n\r\n.popup-div::-webkit-scrollbar \r\n{\r\n width: 6px;\r\n background-color: #f0f0f0;\r\n}\r\n\r\n.option-item\r\n{\r\n padding: 3px 12px;\r\n display: flex;\r\n align-items: center;\r\n}\r\n\r\n.option-item .option-item-text\r\n{\r\n min-width: 0;\r\n flex: 1;\r\n white-space: nowrap;\r\n}\r\n\r\n.option-item .option-item-text:hover\r\n{\r\n cursor: pointer;\r\n}\r\n\r\n.option-item .fa-check\r\n{\r\n margin-left: 8px;\r\n}\r\n\r\n.option-item.selected,\r\n.option-item.active\r\n{\r\n background-color: #E8E8E8;\r\n background-image: linear-gradient(to bottom,#F5F5F5 0,#E8E8E8 100%);\r\n}\r\n\r\n.option-item:hover\r\n{\r\n background-color: #E8E8E8;\r\n background-image: linear-gradient(to bottom,#F5F5F5 0,#E8E8E8 100%);\r\n cursor: pointer;\r\n}"] }]
|
|
43
43
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basicPopup.component.js","sourceRoot":"","sources":["../../../../../src/plugins/popup/basic/basicPopup.component.ts","../../../../../src/plugins/popup/basic/basicPopup.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAgB,uBAAuB,EAAE,iBAAiB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAa,QAAQ,EAAC,MAAM,eAAe,CAAC;AAC5I,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAC,mBAAmB,EAAqB,MAAM,eAAe,CAAC;AACtE,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAGtC,OAAO,EAAC,0BAA0B,EAAC,MAAM,kCAAkC,CAAC;AAE5E,OAAO,EAAC,SAAS,EAAC,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AAEvC,OAAO,EAAC,sBAAsB,EAAC,MAAM,4BAA4B,CAAC;;;;AAElE;;;GAGG;AACH,MAAM,cAAc,GACpB;IACI,UAAU,EACV;QACI,aAAa,EAAE,aAAa;QAC5B,aAAa,EAAE,aAAa;QAC5B,iBAAiB,EAAE,kBAAkB;QACrC,QAAQ,EAAE,WAAW;KACxB;IACD,KAAK,EACL;QACI,kBAAkB,EAAE,gBAAgB;KACvC;IACD,OAAO,EAAE,KAAK;CACjB,CAAC;AAEF;;GAEG;AAQH,MAAM,OAAO,mBAAoB,SAAQ,sBAA+D;IAEpG,iEAAiE;IACjE,YAA4D,eAAwC,EAC5E,SAAoB,EAChC,aAAyB,EACzB,cAAiC,EACE,OAA0B,EAChC,kBAAsC,EACjD,QAAmB;QAE7C,KAAK,CAAC,eAAe,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,kBAAkB,CAAC,CAAC;QAE/F,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;;gHAdQ,mBAAmB,kBAGR,0BAA0B,iIAI1B,aAAa,6BACb,mBAAmB,aACnB,QAAQ;oGATnB,mBAAmB,kFC3ChC,qgCAoBM;2FDuBO,mBAAmB;kBAP/B,SAAS;+BAEI,qBAAqB,mBAGd,uBAAuB,CAAC,MAAM;;0BAKlC,MAAM;2BAAC,0BAA0B;;0BAAG,QAAQ;;0BAC5C,QAAQ;;0BAGR,MAAM;2BAAC,aAAa;;0BAAG,QAAQ;;0BAC/B,MAAM;2BAAC,mBAAmB
|
|
1
|
+
{"version":3,"file":"basicPopup.component.js","sourceRoot":"","sources":["../../../../../src/plugins/popup/basic/basicPopup.component.ts","../../../../../src/plugins/popup/basic/basicPopup.component.html"],"names":[],"mappings":"AAAA,OAAO,EA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P/B,SAAS;+BAEI,qBAAqB,mBAGd,uBAAuB,CAAC,MAAM;;0BAKlC,MAAM;2BAAC,0BAA0B;;0BAAG,QAAQ;;0BAC5C,QAAQ;;0BAGR,MAAM;2BAAC,aAAa;;0BAAG,QAAQ;;0BAC/B,MAAM;2BAAC,mBAAmB;;0BAC1B,MAAM;2BAAC,QAAQ","sourcesContent":["import {AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Inject, OnDestroy, Optional} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {STRING_LOCALIZATION, StringLocalization} from '@anglr/common';\nimport {extend} from '@jscrpt/common';\n\nimport {NgSelectPluginInstances} from '../../../components/select';\nimport {NG_SELECT_PLUGIN_INSTANCES} from '../../../components/select/types';\nimport {NgSelectPlugin} from '../../../misc';\nimport {PluginBus} from '../../../misc/pluginBus/pluginBus';\nimport {POPUP_OPTIONS} from '../types';\nimport {BasicPopup, BasicPopupOptions, CssClassesBasicPopup} from './basicPopup.interface';\nimport {PopupAbstractComponent} from '../popupAbstract.component';\n\n/**\n * Default options for popup\n * @internal\n */\nconst defaultOptions: BasicPopupOptions =\n{\n cssClasses:\n {\n optionChecked: 'fa fa-check',\n optionItemDiv: 'option-item',\n optionItemTextDiv: 'option-item-text',\n popupDiv: 'popup-div'\n },\n texts:\n {\n noAvailableOptions: 'No items found'\n },\n visible: false\n};\n\n/**\n * Component used for rendering basic popup with options\n */\n@Component(\n{\n selector: 'div.ng-select-popup',\n templateUrl: 'basicPopup.component.html',\n styleUrls: ['basicPopup.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class BasicPopupComponent extends PopupAbstractComponent<CssClassesBasicPopup, BasicPopupOptions> implements BasicPopup, NgSelectPlugin<BasicPopupOptions>, AfterViewInit, OnDestroy\n{\n //######################### constructor #########################\n constructor(@Inject(NG_SELECT_PLUGIN_INSTANCES) @Optional() ngSelectPlugins: NgSelectPluginInstances,\n @Optional() pluginBus: PluginBus,\n pluginElement: ElementRef,\n changeDetector: ChangeDetectorRef,\n @Inject(POPUP_OPTIONS) @Optional() options: BasicPopupOptions,\n @Inject(STRING_LOCALIZATION) stringLocalization: StringLocalization,\n @Inject(DOCUMENT) document?: Document)\n {\n super(ngSelectPlugins, pluginBus, pluginElement, changeDetector, document, stringLocalization);\n\n this._options = extend(true, {}, defaultOptions, options);\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 <ng-content></ng-content>\r\n\r\n <div *ngFor=\"let option of selectOptions\"\r\n [ngClass]=\"options?.cssClasses?.optionItemDiv\"\r\n [class.selected]=\"option?.selected\"\r\n [class.active]=\"option?.active\"\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\r\n <div *ngIf=\"option?.selected && pluginBus?.selectOptions?.multiple\" [ngClass]=\"options?.cssClasses?.optionChecked\"></div>\r\n </div>\r\n\r\n <div *ngIf=\"!selectOptions?.length\">{{texts?.noAvailableOptions}}</div>\r\n</div>"]}
|
|
@@ -58,9 +58,9 @@ export class EditPopupComponent extends PopupAbstractComponent {
|
|
|
58
58
|
option.active = true;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
EditPopupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
62
|
-
EditPopupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
63
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
61
|
+
EditPopupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: EditPopupComponent, deps: [{ token: NG_SELECT_PLUGIN_INSTANCES, optional: true }, { token: i1.PluginBus, optional: true }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: POPUP_OPTIONS, optional: true }, { token: STRING_LOCALIZATION }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
|
|
62
|
+
EditPopupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: EditPopupComponent, selector: "div.ng-select-edit-popup", usesInheritance: true, ngImport: i0, template: "<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 <div *ngFor=\"let option of selectOptions\"\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 \r\n <div *ngIf=\"!selectOptions?.length\">{{texts?.noAvailableOptions}}</div>\r\n</div>", styles: [".popup-div\r\n{\r\n position: absolute;\r\n z-index: 1000;\r\n background-color: #FFFFFF;\r\n border-radius: 4px;\r\n border: 1px solid #BBBBBB;\r\n overflow: auto;\r\n padding: 5px 0;\r\n box-shadow: 0 6px 12px rgba(0,0,0,.175);\r\n scrollbar-width: thin;\r\n}\r\n\r\n.popup-div::-webkit-scrollbar-thumb \r\n{\r\n background-color: #cdcdcd;\r\n}\r\n\r\n.popup-div::-webkit-scrollbar \r\n{\r\n width: 6px;\r\n background-color: #f0f0f0;\r\n}\r\n\r\n.option-item\r\n{\r\n padding: 3px 12px;\r\n display: flex;\r\n align-items: center;\r\n}\r\n\r\n.option-item .option-item-text\r\n{\r\n min-width: 0;\r\n flex: 1;\r\n white-space: nowrap;\r\n}\r\n\r\n.option-item .option-item-text:hover\r\n{\r\n cursor: pointer;\r\n}\r\n\r\n.option-item .fa-check\r\n{\r\n margin-left: 8px;\r\n}\r\n\r\n.option-item.selected,\r\n.option-item.active\r\n{\r\n background-color: #E8E8E8;\r\n background-image: linear-gradient(to bottom,#F5F5F5 0,#E8E8E8 100%);\r\n}\r\n\r\n.option-item:hover\r\n{\r\n background-color: #E8E8E8;\r\n background-image: linear-gradient(to bottom,#F5F5F5 0,#E8E8E8 100%);\r\n cursor: pointer;\r\n}"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
63
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: EditPopupComponent, decorators: [{
|
|
64
64
|
type: Component,
|
|
65
65
|
args: [{ selector: 'div.ng-select-edit-popup', changeDetection: ChangeDetectionStrategy.OnPush, template: "<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 <div *ngFor=\"let option of selectOptions\"\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 \r\n <div *ngIf=\"!selectOptions?.length\">{{texts?.noAvailableOptions}}</div>\r\n</div>", styles: [".popup-div\r\n{\r\n position: absolute;\r\n z-index: 1000;\r\n background-color: #FFFFFF;\r\n border-radius: 4px;\r\n border: 1px solid #BBBBBB;\r\n overflow: auto;\r\n padding: 5px 0;\r\n box-shadow: 0 6px 12px rgba(0,0,0,.175);\r\n scrollbar-width: thin;\r\n}\r\n\r\n.popup-div::-webkit-scrollbar-thumb \r\n{\r\n background-color: #cdcdcd;\r\n}\r\n\r\n.popup-div::-webkit-scrollbar \r\n{\r\n width: 6px;\r\n background-color: #f0f0f0;\r\n}\r\n\r\n.option-item\r\n{\r\n padding: 3px 12px;\r\n display: flex;\r\n align-items: center;\r\n}\r\n\r\n.option-item .option-item-text\r\n{\r\n min-width: 0;\r\n flex: 1;\r\n white-space: nowrap;\r\n}\r\n\r\n.option-item .option-item-text:hover\r\n{\r\n cursor: pointer;\r\n}\r\n\r\n.option-item .fa-check\r\n{\r\n margin-left: 8px;\r\n}\r\n\r\n.option-item.selected,\r\n.option-item.active\r\n{\r\n background-color: #E8E8E8;\r\n background-image: linear-gradient(to bottom,#F5F5F5 0,#E8E8E8 100%);\r\n}\r\n\r\n.option-item:hover\r\n{\r\n background-color: #E8E8E8;\r\n background-image: linear-gradient(to bottom,#F5F5F5 0,#E8E8E8 100%);\r\n cursor: pointer;\r\n}"] }]
|
|
66
66
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editPopup.component.js","sourceRoot":"","sources":["../../../../../src/plugins/popup/edit/editPop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O,KAAK,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,IAAc,UAAU;QAEpB,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,eAAe,CAAC,OAAO,CAAC;IAChE,CAAC;IAgBD,wFAAwF;IAExF;;;;OAIG;IACI,qBAAqB,CAAC,MAAuB;QAEhD,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;QAEzD,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC;IACzB,CAAC;;+GA9CQ,kBAAkB,kBAqBP,0BAA0B,iIAI1B,aAAa,6BACb,mBAAmB,aACnB,QAAQ;mGA3BnB,kBAAkB,uFC5C/B,u5BAkBM;2FD0BO,kBAAkB;kBAP9B,SAAS;+BAEI,0BAA0B,mBAGnB,uBAAuB,CAAC,MAAM;;0BAuBlC,MAAM;2BAAC,0BAA0B;;0BAAG,QAAQ;;0BAC5C,QAAQ;;0BAGR,MAAM;2BAAC,aAAa;;0BAAG,QAAQ;;0BAC/B,MAAM;2BAAC,mBAAmB
|
|
1
|
+
{"version":3,"file":"editPopup.component.js","sourceRoot":"","sources":["../../../../../src/plugins/popup/edit/editPopup.component.ts","../../../../../src/plugins/popup/edit/editPopup.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAgB,uBAAuB,EAAE,iBAAiB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAa,QAAQ,EAAC,MAAM,eAAe,CAAC;AAC5I,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAC,mBAAmB,EAAqB,MAAM,eAAe,CAAC;AACtE,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAGtC,OAAO,EAAC,0BAA0B,EAAC,MAAM,kCAAkC,CAAC;AAE5E,OAAO,EAAC,SAAS,EAAC,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAC,sBAAsB,EAAC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5C/B,u5BAkBM;2FD0BO,kBAAkB;kBAP9B,SAAS;+BAEI,0BAA0B,mBAGnB,uBAAuB,CAAC,MAAM;;0BAuBlC,MAAM;2BAAC,0BAA0B;;0BAAG,QAAQ;;0BAC5C,QAAQ;;0BAGR,MAAM;2BAAC,aAAa;;0BAAG,QAAQ;;0BAC/B,MAAM;2BAAC,mBAAmB;;0BAC1B,MAAM;2BAAC,QAAQ","sourcesContent":["import {AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Inject, OnDestroy, Optional} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {STRING_LOCALIZATION, StringLocalization} from '@anglr/common';\nimport {extend} from '@jscrpt/common';\n\nimport {NgSelectPluginInstances} from '../../../components/select';\nimport {NG_SELECT_PLUGIN_INSTANCES} from '../../../components/select/types';\nimport {NgSelectPlugin} from '../../../misc';\nimport {PluginBus} from '../../../misc/pluginBus/pluginBus';\nimport {PopupAbstractComponent} from '../popupAbstract.component';\nimport {POPUP_OPTIONS} from '../types';\nimport {CssClassesEditPopup, EditPopup, EditPopupOptions} from './editPopup.interface';\nimport {ɵNgSelectOption} from '../../../components/option';\n\n/**\n * Default options for popup\n * @internal\n */\nconst defaultOptions: EditPopupOptions =\n{\n cssClasses:\n {\n optionChecked: 'fa fa-check',\n optionItemDiv: 'option-item',\n optionItemTextDiv: 'option-item-text',\n popupDiv: 'popup-div'\n },\n texts:\n {\n noAvailableOptions: 'No items found'\n },\n visible: false\n};\n\n/**\n * Component used for rendering edit popup with options\n */\n@Component(\n{\n selector: 'div.ng-select-edit-popup',\n templateUrl: 'editPopup.component.html',\n styleUrls: ['editPopup.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class EditPopupComponent extends PopupAbstractComponent<CssClassesEditPopup, EditPopupOptions> implements EditPopup, NgSelectPlugin<EditPopupOptions>, AfterViewInit, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Gets indication whether keep open popup after value change\n */\n protected override get keepOpen(): boolean\n {\n return false;\n }\n\n /**\n * Gets all options\n */\n protected get allOptions(): ɵNgSelectOption[]\n {\n return this.pluginBus.selectOptions.optionsGatherer.options;\n }\n\n //######################### constructor #########################\n constructor(@Inject(NG_SELECT_PLUGIN_INSTANCES) @Optional() ngSelectPlugins: NgSelectPluginInstances,\n @Optional() pluginBus: PluginBus,\n pluginElement: ElementRef,\n changeDetector: ChangeDetectorRef,\n @Inject(POPUP_OPTIONS) @Optional() options: EditPopupOptions,\n @Inject(STRING_LOCALIZATION) stringLocalization: StringLocalization,\n @Inject(DOCUMENT) document?: Document)\n {\n super(ngSelectPlugins, pluginBus, pluginElement, changeDetector, document, stringLocalization);\n\n this._options = extend(true, {}, defaultOptions, options);\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Handles mouse move and changes active option\n * @param option - Option to be set as active\n * @internal\n */\n public handleMouseActivation(option: ɵNgSelectOption): void\n {\n this.allOptions.forEach(option => option.active = false);\n\n option.active = true;\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 <div *ngFor=\"let option of selectOptions\"\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 \r\n <div *ngIf=\"!selectOptions?.length\">{{texts?.noAvailableOptions}}</div>\r\n</div>"]}
|
|
@@ -192,9 +192,9 @@ export class PopupAbstractComponent {
|
|
|
192
192
|
this._changeDetector.detectChanges();
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
PopupAbstractComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
196
|
-
PopupAbstractComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
197
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
195
|
+
PopupAbstractComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PopupAbstractComponent, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
|
|
196
|
+
PopupAbstractComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: PopupAbstractComponent, viewQueries: [{ propertyName: "popupElementChildren", predicate: ["popupDiv"], descendants: true }], ngImport: i0 });
|
|
197
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PopupAbstractComponent, decorators: [{
|
|
198
198
|
type: Directive
|
|
199
199
|
}], ctorParameters: function () { return [{ type: undefined }, { type: i1.PluginBus }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: Document }, { type: undefined }]; }, propDecorators: { popupElementChildren: [{
|
|
200
200
|
type: ViewChildren,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popupAbstract.component.js","sourceRoot":"","sources":["../../../../src/plugins/popup/popupAbstract.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAa,SAAS,EAAE,YAAY,EAAE,SAAS,EAAC,MAAM,eAAe,CAAC;AAExI,OAAO,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAMpD,OAAO,EAAC,SAAS,EAAC,MAAM,gCAAgC,CAAC;AAGzD,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;;;AAGpD;;GAEG;AAEH,MAAM,OAAO,sB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aAAa,EAAE,CAAC;IACzC,CAAC;IAED,uEAAuE;IAEvE;;OAEG;IACO,UAAU;QAEhB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAE1C,IAAI,CAAC,KAAK,CAAC,GAAuB,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAuB,CAAC,CAAC,CAAC;QACpH,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC;IACzC,CAAC;IAED;;OAEG;IACO,WAAW;QAEjB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC;QAC5D,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC;IACzC,CAAC;IAED;;OAEG;IACO,WAAW;QAEjB,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QAC7C,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC;IACzC,CAAC;;mHAhSQ,sBAAsB;uGAAtB,sBAAsB;2FAAtB,sBAAsB;kBADlC,SAAS;gKA0H2B,QAAQ,+CAPlC,oBAAoB;sBAD1B,YAAY;uBAAC,UAAU","sourcesContent":["import {AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, QueryList, ViewChildren, Directive} from '@angular/core';\nimport {StringLocalization} from '@anglr/common';\nimport {extend, isDescendant} from '@jscrpt/common';\nimport {Subscription} from 'rxjs';\n\nimport {ɵNgSelectOption} from '../../components/option';\nimport {NgSelectPluginInstances} from '../../components/select';\nimport {NgSelectPlugin, OptionsGatherer} from '../../misc';\nimport {PluginBus} from '../../misc/pluginBus/pluginBus';\nimport {Popup, PopupOptions, PopupTexts} from './popup.interface';\nimport {ValueHandler} from '../valueHandler';\nimport {VALUE_HANDLER} from '../valueHandler/types';\n\n\n/**\n * Base abstract class for popup with options\n */\n@Directive()\nexport class PopupAbstractComponent<TCssClasses = any, TOptions extends PopupOptions<TCssClasses> = any> implements Popup, NgSelectPlugin<TOptions>, AfterViewInit, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Options for NgSelect plugin\n */\n protected _options: TOptions;\n\n /**\n * Instance of previous options gatherer, that is used for obtaining available options\n */\n protected _optionsGatherer: OptionsGatherer;\n\n /**\n * Subscription for changes of options in options gatherer\n */\n protected _optionsChangeSubscription: Subscription;\n\n /**\n * Subscription for toggle popup event\n */\n protected _popupToggleSubscription: Subscription;\n\n /**\n * Subscription for popup visibility change request\n */\n protected _visibilityRequestSubscription: Subscription;\n\n /**\n * Subscription for changes of selected value\n */\n protected _valueChangedSubscription: Subscription;\n\n /**\n * Subscription for changes in texts\n */\n protected _textsChangedSubscription: Subscription;\n\n /**\n * Indication whether is popup visible\n */\n protected _popupVisible: boolean = false;\n\n /**\n * Value handler plugin used within `NgSelect`\n */\n protected _valueHandler: ValueHandler;\n\n //######################### protected properties #########################\n\n /**\n * Gets indication whether keep open popup after value change\n */\n protected get keepOpen(): boolean\n {\n return this.pluginBus.selectOptions.multiple;\n }\n\n //######################### public properties - implementation of Popup #########################\n\n /**\n * Options for NgSelect plugin\n */\n public get options(): TOptions\n {\n return this._options;\n }\n public set options(options: TOptions)\n {\n this._options = extend(true, this._options, options);\n }\n\n /**\n * Occurs when visibility of popup has changed\n */\n public visibilityChange: EventEmitter<void> = new EventEmitter<void>();\n\n /**\n * Html element that represents popup itself\n */\n public get popupElement(): HTMLElement\n {\n const ref = this.popupElementChildren.first;\n\n if(!ref)\n {\n return null;\n }\n\n return ref.nativeElement;\n }\n\n //######################### public properties - template bindings #########################\n\n /**\n * Array of select options available\n * @internal\n */\n public selectOptions: ɵNgSelectOption[];\n\n /**\n * Object containing available texts\n * @internal\n */\n public texts: PopupTexts = {};\n \n //######################### public properties - children #########################\n\n /**\n * Watch for visibility of popup div element\n * @internal\n */\n @ViewChildren('popupDiv')\n public popupElementChildren: QueryList<ElementRef<HTMLElement>>;\n\n //######################### constructor #########################\n constructor(public ngSelectPlugins: NgSelectPluginInstances,\n public pluginBus: PluginBus,\n public pluginElement: ElementRef,\n protected _changeDetector: ChangeDetectorRef,\n protected _document: Document,\n protected _stringLocalization: StringLocalization)\n {\n }\n\n //######################### public methods - implementation of AfterViewInit #########################\n\n /**\n * Called when view was initialized\n */\n public ngAfterViewInit()\n {\n this.popupElementChildren.changes.subscribe(() =>\n {\n if(!!this.popupElementChildren.first == this._popupVisible)\n {\n return;\n }\n\n //handle click outside\n if(this.popupElementChildren.first)\n {\n this._document.addEventListener('mouseup', this._handleClickOutside);\n }\n //unregister handle click outside\n else\n {\n this._document.removeEventListener('mouseup', this._handleClickOutside);\n }\n\n this._popupVisible = !!this.popupElementChildren.first;\n this.visibilityChange.emit();\n });\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * Called when component is destroyed\n */\n public ngOnDestroy()\n {\n this._optionsChangeSubscription?.unsubscribe();\n this._optionsChangeSubscription = null;\n\n this._popupToggleSubscription?.unsubscribe();\n this._popupToggleSubscription = null;\n\n this._valueChangedSubscription?.unsubscribe();\n this._valueChangedSubscription = null;\n\n this._visibilityRequestSubscription?.unsubscribe();\n this._visibilityRequestSubscription = null;\n\n this._textsChangedSubscription?.unsubscribe();\n this._textsChangedSubscription = null;\n\n this._document.removeEventListener('mouseup', this._handleClickOutside);\n }\n\n //######################### public methods - implementation of Popup #########################\n\n /**\n * Initialize plugin, to be ready to use, initialize communication with other plugins\n */\n public initialize()\n {\n this._textsChangedSubscription = this._stringLocalization.textsChange.subscribe(() => this._initTexts());\n\n if(this._optionsGatherer && this._optionsGatherer != this.pluginBus.selectOptions.optionsGatherer)\n {\n this._optionsChangeSubscription.unsubscribe();\n this._optionsChangeSubscription = null;\n\n this._optionsGatherer = null;\n }\n\n if(!this._optionsGatherer)\n {\n this._optionsGatherer = this.pluginBus.selectOptions.optionsGatherer;\n\n this._optionsChangeSubscription = this._optionsGatherer.availableOptionsChange.subscribe(() => this.loadOptions());\n }\n\n if(!this._popupToggleSubscription)\n {\n this._popupToggleSubscription = this.pluginBus.togglePopup.subscribe(() => this.togglePopup());\n }\n\n if(!this._visibilityRequestSubscription)\n {\n this._visibilityRequestSubscription = this.pluginBus.showHidePopup.subscribe(this._handleVisibilityChange);\n }\n\n const valueHandler = this.ngSelectPlugins[VALUE_HANDLER] as ValueHandler;\n\n if(this._valueHandler && this._valueHandler != valueHandler)\n {\n this._valueChangedSubscription.unsubscribe();\n this._valueChangedSubscription = null;\n\n this._valueHandler = null;\n }\n\n if(!this._valueHandler)\n {\n this._valueHandler = valueHandler;\n\n this._valueChangedSubscription = this._valueHandler.valueChange.subscribe(() =>\n {\n if(!this.keepOpen)\n {\n this._handleVisibilityChange(false);\n }\n });\n }\n\n this.loadOptions();\n this._initTexts();\n }\n\n /**\n * Initialize plugin options, all operations required to be done with plugin options are handled here\n */\n public initOptions()\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 //######################### protected methods #########################\n\n /**\n * Initialize texts\n */\n protected _initTexts()\n {\n Object.keys(this.options.texts).forEach(key =>\n {\n this.texts[key as keyof PopupTexts] = this._stringLocalization.get(this.options.texts[key as keyof PopupTexts]);\n });\n\n this._changeDetector.detectChanges();\n }\n\n /**\n * Loads options\n */\n protected loadOptions()\n {\n this.selectOptions = this._optionsGatherer.availableOptions;\n this._changeDetector.detectChanges();\n }\n\n /**\n * Toggles popup visibility\n */\n protected togglePopup()\n {\n this.options.visible = !this.options.visible;\n this._changeDetector.detectChanges();\n }\n\n /**\n * Handles click outside of select element\n * @param event - Mouse event object\n */\n protected _handleClickOutside = (event: MouseEvent) =>\n {\n if(this.pluginBus.selectElement.nativeElement != event.target &&\n !isDescendant(this.pluginBus.selectElement.nativeElement, event.target as HTMLElement) &&\n this.pluginElement.nativeElement != event.target &&\n !isDescendant(this.pluginElement.nativeElement, event.target as HTMLElement))\n {\n this.togglePopup();\n\n this.pluginBus.updateDisplayedValue.emit();\n }\n }\n\n /**\n * Handles visibility change\n */\n protected _handleVisibilityChange = (visible: boolean) =>\n {\n if(this.options.visible != visible)\n {\n this.options.visible = visible;\n this._changeDetector.detectChanges();\n }\n };\n}"]}
|
|
1
|
+
{"version":3,"file":"popupAbstract.component.js","sourceRoot":"","sources":["../../../../src/plugins/popup/popupAbstract.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAa,SAAS,EAAE,YAAY,EAAE,SAAS,EAAC,MAAM,eAAe,CAAC;AAExI,OAAO,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAMpD,OAAO,EAAC,SAAS,EAAC,MAAM,gCAAgC,CAAC;AAGzD,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;;;AAGpD;;GAEG;AAEH,MAAM,OAAO,sBAAsB;IAoH/B,iEAAiE;IACjE,YAAmB,eAAwC,EACxC,SAAoB,EACpB,aAAyB,EACtB,eAAkC,EAClC,SAAmB,EACnB,mBAAuC;QAL1C,oBAAe,GAAf,eAAe,CAAyB;QACxC,cAAS,GAAT,SAAS,CAAW;QACpB,kBAAa,GAAb,aAAa,CAAY;QACtB,oBAAe,GAAf,eAAe,CAAmB;QAClC,cAAS,GAAT,SAAS,CAAU;QACnB,wBAAmB,GAAnB,mBAAmB,CAAoB;QAnF7D;;WAEG;QACO,kBAAa,GAAY,KAAK,CAAC;QA+BzC;;WAEG;QACI,qBAAgB,GAAuB,IAAI,YAAY,EAAQ,CAAC;QAyBvE;;;WAGG;QACI,UAAK,GAAe,EAAE,CAAC;QAyL9B;;;WAGG;QACO,wBAAmB,GAAG,CAAC,KAAiB,EAAE,EAAE;YAElD,IAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,aAAa,IAA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O,WAAW;QAEjB,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QAC7C,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC;IACzC,CAAC;;mHAhSQ,sBAAsB;uGAAtB,sBAAsB;2FAAtB,sBAAsB;kBADlC,SAAS;uNAmHC,oBAAoB;sBAD1B,YAAY;uBAAC,UAAU","sourcesContent":["import {AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, QueryList, ViewChildren, Directive} from '@angular/core';\nimport {StringLocalization} from '@anglr/common';\nimport {extend, isDescendant} from '@jscrpt/common';\nimport {Subscription} from 'rxjs';\n\nimport {ɵNgSelectOption} from '../../components/option';\nimport {NgSelectPluginInstances} from '../../components/select';\nimport {NgSelectPlugin, OptionsGatherer} from '../../misc';\nimport {PluginBus} from '../../misc/pluginBus/pluginBus';\nimport {Popup, PopupOptions, PopupTexts} from './popup.interface';\nimport {ValueHandler} from '../valueHandler';\nimport {VALUE_HANDLER} from '../valueHandler/types';\n\n\n/**\n * Base abstract class for popup with options\n */\n@Directive()\nexport class PopupAbstractComponent<TCssClasses = any, TOptions extends PopupOptions<TCssClasses> = any> implements Popup, NgSelectPlugin<TOptions>, AfterViewInit, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Options for NgSelect plugin\n */\n protected _options: TOptions;\n\n /**\n * Instance of previous options gatherer, that is used for obtaining available options\n */\n protected _optionsGatherer: OptionsGatherer;\n\n /**\n * Subscription for changes of options in options gatherer\n */\n protected _optionsChangeSubscription: Subscription;\n\n /**\n * Subscription for toggle popup event\n */\n protected _popupToggleSubscription: Subscription;\n\n /**\n * Subscription for popup visibility change request\n */\n protected _visibilityRequestSubscription: Subscription;\n\n /**\n * Subscription for changes of selected value\n */\n protected _valueChangedSubscription: Subscription;\n\n /**\n * Subscription for changes in texts\n */\n protected _textsChangedSubscription: Subscription;\n\n /**\n * Indication whether is popup visible\n */\n protected _popupVisible: boolean = false;\n\n /**\n * Value handler plugin used within `NgSelect`\n */\n protected _valueHandler: ValueHandler;\n\n //######################### protected properties #########################\n\n /**\n * Gets indication whether keep open popup after value change\n */\n protected get keepOpen(): boolean\n {\n return this.pluginBus.selectOptions.multiple;\n }\n\n //######################### public properties - implementation of Popup #########################\n\n /**\n * Options for NgSelect plugin\n */\n public get options(): TOptions\n {\n return this._options;\n }\n public set options(options: TOptions)\n {\n this._options = extend(true, this._options, options);\n }\n\n /**\n * Occurs when visibility of popup has changed\n */\n public visibilityChange: EventEmitter<void> = new EventEmitter<void>();\n\n /**\n * Html element that represents popup itself\n */\n public get popupElement(): HTMLElement\n {\n const ref = this.popupElementChildren.first;\n\n if(!ref)\n {\n return null;\n }\n\n return ref.nativeElement;\n }\n\n //######################### public properties - template bindings #########################\n\n /**\n * Array of select options available\n * @internal\n */\n public selectOptions: ɵNgSelectOption[];\n\n /**\n * Object containing available texts\n * @internal\n */\n public texts: PopupTexts = {};\n \n //######################### public properties - children #########################\n\n /**\n * Watch for visibility of popup div element\n * @internal\n */\n @ViewChildren('popupDiv')\n public popupElementChildren: QueryList<ElementRef<HTMLElement>>;\n\n //######################### constructor #########################\n constructor(public ngSelectPlugins: NgSelectPluginInstances,\n public pluginBus: PluginBus,\n public pluginElement: ElementRef,\n protected _changeDetector: ChangeDetectorRef,\n protected _document: Document,\n protected _stringLocalization: StringLocalization)\n {\n }\n\n //######################### public methods - implementation of AfterViewInit #########################\n\n /**\n * Called when view was initialized\n */\n public ngAfterViewInit()\n {\n this.popupElementChildren.changes.subscribe(() =>\n {\n if(!!this.popupElementChildren.first == this._popupVisible)\n {\n return;\n }\n\n //handle click outside\n if(this.popupElementChildren.first)\n {\n this._document.addEventListener('mouseup', this._handleClickOutside);\n }\n //unregister handle click outside\n else\n {\n this._document.removeEventListener('mouseup', this._handleClickOutside);\n }\n\n this._popupVisible = !!this.popupElementChildren.first;\n this.visibilityChange.emit();\n });\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * Called when component is destroyed\n */\n public ngOnDestroy()\n {\n this._optionsChangeSubscription?.unsubscribe();\n this._optionsChangeSubscription = null;\n\n this._popupToggleSubscription?.unsubscribe();\n this._popupToggleSubscription = null;\n\n this._valueChangedSubscription?.unsubscribe();\n this._valueChangedSubscription = null;\n\n this._visibilityRequestSubscription?.unsubscribe();\n this._visibilityRequestSubscription = null;\n\n this._textsChangedSubscription?.unsubscribe();\n this._textsChangedSubscription = null;\n\n this._document.removeEventListener('mouseup', this._handleClickOutside);\n }\n\n //######################### public methods - implementation of Popup #########################\n\n /**\n * Initialize plugin, to be ready to use, initialize communication with other plugins\n */\n public initialize()\n {\n this._textsChangedSubscription = this._stringLocalization.textsChange.subscribe(() => this._initTexts());\n\n if(this._optionsGatherer && this._optionsGatherer != this.pluginBus.selectOptions.optionsGatherer)\n {\n this._optionsChangeSubscription.unsubscribe();\n this._optionsChangeSubscription = null;\n\n this._optionsGatherer = null;\n }\n\n if(!this._optionsGatherer)\n {\n this._optionsGatherer = this.pluginBus.selectOptions.optionsGatherer;\n\n this._optionsChangeSubscription = this._optionsGatherer.availableOptionsChange.subscribe(() => this.loadOptions());\n }\n\n if(!this._popupToggleSubscription)\n {\n this._popupToggleSubscription = this.pluginBus.togglePopup.subscribe(() => this.togglePopup());\n }\n\n if(!this._visibilityRequestSubscription)\n {\n this._visibilityRequestSubscription = this.pluginBus.showHidePopup.subscribe(this._handleVisibilityChange);\n }\n\n const valueHandler = this.ngSelectPlugins[VALUE_HANDLER] as ValueHandler;\n\n if(this._valueHandler && this._valueHandler != valueHandler)\n {\n this._valueChangedSubscription.unsubscribe();\n this._valueChangedSubscription = null;\n\n this._valueHandler = null;\n }\n\n if(!this._valueHandler)\n {\n this._valueHandler = valueHandler;\n\n this._valueChangedSubscription = this._valueHandler.valueChange.subscribe(() =>\n {\n if(!this.keepOpen)\n {\n this._handleVisibilityChange(false);\n }\n });\n }\n\n this.loadOptions();\n this._initTexts();\n }\n\n /**\n * Initialize plugin options, all operations required to be done with plugin options are handled here\n */\n public initOptions()\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 //######################### protected methods #########################\n\n /**\n * Initialize texts\n */\n protected _initTexts()\n {\n Object.keys(this.options.texts).forEach(key =>\n {\n this.texts[key as keyof PopupTexts] = this._stringLocalization.get(this.options.texts[key as keyof PopupTexts]);\n });\n\n this._changeDetector.detectChanges();\n }\n\n /**\n * Loads options\n */\n protected loadOptions()\n {\n this.selectOptions = this._optionsGatherer.availableOptions;\n this._changeDetector.detectChanges();\n }\n\n /**\n * Toggles popup visibility\n */\n protected togglePopup()\n {\n this.options.visible = !this.options.visible;\n this._changeDetector.detectChanges();\n }\n\n /**\n * Handles click outside of select element\n * @param event - Mouse event object\n */\n protected _handleClickOutside = (event: MouseEvent) =>\n {\n if(this.pluginBus.selectElement.nativeElement != event.target &&\n !isDescendant(this.pluginBus.selectElement.nativeElement, event.target as HTMLElement) &&\n this.pluginElement.nativeElement != event.target &&\n !isDescendant(this.pluginElement.nativeElement, event.target as HTMLElement))\n {\n this.togglePopup();\n\n this.pluginBus.updateDisplayedValue.emit();\n }\n }\n\n /**\n * Handles visibility change\n */\n protected _handleVisibilityChange = (visible: boolean) =>\n {\n if(this.options.visible != visible)\n {\n this.options.visible = visible;\n this._changeDetector.detectChanges();\n }\n };\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../../../src/plugins/positioner/components.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../../../src/plugins/positioner/components.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC;AACtD,cAAc,6BAA6B,CAAC","sourcesContent":["export * from './default/defaultPositioner.component';\nexport * from './no/noPositioner.component';"]}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { Component, ChangeDetectionStrategy, Inject, Optional, ElementRef, PLATFORM_ID, ChangeDetectorRef } from '@angular/core';
|
|
2
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
3
|
+
import { POSITION, PositionOffset, PositionPlacement } from '@anglr/common';
|
|
4
|
+
import { extend } from '@jscrpt/common';
|
|
5
|
+
import { NG_SELECT_PLUGIN_INSTANCES } from '../../../components/select/types';
|
|
6
|
+
import { POSITIONER_OPTIONS } from '../types';
|
|
7
|
+
import { POPUP } from '../../popup/types';
|
|
8
|
+
import { PluginBus } from '../../../misc/pluginBus/pluginBus';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
import * as i1 from "../../../misc/pluginBus/pluginBus";
|
|
11
|
+
/**
|
|
12
|
+
* Default options for positioner
|
|
13
|
+
*/
|
|
14
|
+
const defaultOptions = {
|
|
15
|
+
positionOptions: {
|
|
16
|
+
offset: PositionOffset.None,
|
|
17
|
+
placement: PositionPlacement.BottomStart,
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Component used for positioning popup element, handles resize, scroll and collision using `Position`
|
|
22
|
+
*/
|
|
23
|
+
export class DefaultPositionerComponent {
|
|
24
|
+
//######################### constructor #########################
|
|
25
|
+
constructor(ngSelectPlugins, pluginBus, pluginElement, position, changeDetector, options, platformId) {
|
|
26
|
+
this.ngSelectPlugins = ngSelectPlugins;
|
|
27
|
+
this.pluginBus = pluginBus;
|
|
28
|
+
this.pluginElement = pluginElement;
|
|
29
|
+
this.position = position;
|
|
30
|
+
this.changeDetector = changeDetector;
|
|
31
|
+
this.platformId = platformId;
|
|
32
|
+
/**
|
|
33
|
+
* Indication whether is code running in browser
|
|
34
|
+
*/
|
|
35
|
+
this.isBrowser = isPlatformBrowser(this.platformId);
|
|
36
|
+
this.ɵoptions = extend(true, {}, defaultOptions, options);
|
|
37
|
+
}
|
|
38
|
+
//######################### public properties - implementation of DefaultPositioner #########################
|
|
39
|
+
/**
|
|
40
|
+
* Options for NgSelect plugin
|
|
41
|
+
*/
|
|
42
|
+
get options() {
|
|
43
|
+
return this.ɵoptions;
|
|
44
|
+
}
|
|
45
|
+
set options(options) {
|
|
46
|
+
this.ɵoptions = extend(true, this.ɵoptions, options);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* @inheritdoc
|
|
50
|
+
*/
|
|
51
|
+
get flip() {
|
|
52
|
+
return this.ɵflip;
|
|
53
|
+
}
|
|
54
|
+
//######################### public methods - implementation of OnDestroy #########################
|
|
55
|
+
/**
|
|
56
|
+
* Called when component is destroyed
|
|
57
|
+
*/
|
|
58
|
+
ngOnDestroy() {
|
|
59
|
+
var _a, _b, _c, _d;
|
|
60
|
+
(_a = this.visibilitySubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
61
|
+
this.visibilitySubscription = null;
|
|
62
|
+
(_b = this.optionsChangeSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
|
|
63
|
+
this.optionsChangeSubscription = null;
|
|
64
|
+
(_c = this.positioningDispose) === null || _c === void 0 ? void 0 : _c.call(this);
|
|
65
|
+
(_d = this.positioningSubscription) === null || _d === void 0 ? void 0 : _d.unsubscribe();
|
|
66
|
+
this.positioningSubscription = null;
|
|
67
|
+
}
|
|
68
|
+
//######################### public methods - implementation of DefaultPositioner #########################
|
|
69
|
+
/**
|
|
70
|
+
* Initialize plugin, to be ready to use, initialize communication with other plugins
|
|
71
|
+
*/
|
|
72
|
+
initialize() {
|
|
73
|
+
// if(this.optionsGatherer && this.optionsGatherer != this.pluginBus?.selectOptions.optionsGatherer)
|
|
74
|
+
// {
|
|
75
|
+
// this.optionsChangeSubscription.unsubscribe();
|
|
76
|
+
// this.optionsChangeSubscription = null;
|
|
77
|
+
var _a;
|
|
78
|
+
// this.optionsGatherer = null;
|
|
79
|
+
// }
|
|
80
|
+
// if(!this.optionsGatherer)
|
|
81
|
+
// {
|
|
82
|
+
// this.optionsGatherer = this.pluginBus?.selectOptions.optionsGatherer;
|
|
83
|
+
// this.optionsChangeSubscription = this.optionsGatherer.availableOptionsChange.subscribe(() =>
|
|
84
|
+
// {
|
|
85
|
+
// if(this.popup.popupElement && this.optionsGatherer.availableOptions)
|
|
86
|
+
// {
|
|
87
|
+
// this._handlePosition();
|
|
88
|
+
// }
|
|
89
|
+
// });
|
|
90
|
+
// }
|
|
91
|
+
const popup = this.ngSelectPlugins[POPUP];
|
|
92
|
+
if (this.popup && this.popup != popup) {
|
|
93
|
+
(_a = this.visibilitySubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
94
|
+
this.visibilitySubscription = null;
|
|
95
|
+
this.popup = null;
|
|
96
|
+
}
|
|
97
|
+
if (!this.popup) {
|
|
98
|
+
this.popup = popup;
|
|
99
|
+
this.visibilitySubscription = this.popup.visibilityChange.subscribe(() => this.initPosition());
|
|
100
|
+
}
|
|
101
|
+
this.initPosition();
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* @inheritdoc
|
|
105
|
+
*/
|
|
106
|
+
initOptions() {
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* @inheritdoc
|
|
110
|
+
*/
|
|
111
|
+
invalidateVisuals() {
|
|
112
|
+
}
|
|
113
|
+
//######################### protected methods #########################
|
|
114
|
+
/**
|
|
115
|
+
* Initialize positioning of popup
|
|
116
|
+
*/
|
|
117
|
+
initPosition() {
|
|
118
|
+
var _a, _b, _c, _d;
|
|
119
|
+
this.popupElement = this.popup.popupElement;
|
|
120
|
+
// //this has meaning only when popup is outside of ng-element
|
|
121
|
+
// this.changeDetector.markForCheck();
|
|
122
|
+
if (this.isBrowser) {
|
|
123
|
+
//register events and handle position of opened popup
|
|
124
|
+
if (this.popupElement) {
|
|
125
|
+
(_a = this.positioningSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
126
|
+
(_b = this.positioningDispose) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
127
|
+
this.positioningSubscription = null;
|
|
128
|
+
this.positioningDispose = null;
|
|
129
|
+
this.positioningSubscription = this.position.placeElement(this.popupElement, this.pluginBus.selectElement.nativeElement, this.options.positionOptions)
|
|
130
|
+
.subscribe(result => {
|
|
131
|
+
this.positioningDispose = result.dispose;
|
|
132
|
+
if (result.flip) {
|
|
133
|
+
this.flip.emit();
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
//unregister events
|
|
138
|
+
else {
|
|
139
|
+
(_c = this.positioningSubscription) === null || _c === void 0 ? void 0 : _c.unsubscribe();
|
|
140
|
+
(_d = this.positioningDispose) === null || _d === void 0 ? void 0 : _d.call(this);
|
|
141
|
+
this.positioningSubscription = null;
|
|
142
|
+
this.positioningDispose = null;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
DefaultPositionerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: DefaultPositionerComponent, deps: [{ token: NG_SELECT_PLUGIN_INSTANCES, optional: true }, { token: i1.PluginBus, optional: true }, { token: i0.ElementRef }, { token: POSITION }, { token: i0.ChangeDetectorRef }, { token: POSITIONER_OPTIONS, optional: true }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component });
|
|
148
|
+
DefaultPositionerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: DefaultPositionerComponent, selector: "ng-default-positioner", ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
149
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: DefaultPositionerComponent, decorators: [{
|
|
150
|
+
type: Component,
|
|
151
|
+
args: [{
|
|
152
|
+
selector: 'ng-default-positioner',
|
|
153
|
+
template: '',
|
|
154
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
155
|
+
}]
|
|
156
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
157
|
+
type: Inject,
|
|
158
|
+
args: [NG_SELECT_PLUGIN_INSTANCES]
|
|
159
|
+
}, {
|
|
160
|
+
type: Optional
|
|
161
|
+
}] }, { type: i1.PluginBus, decorators: [{
|
|
162
|
+
type: Optional
|
|
163
|
+
}] }, { type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
164
|
+
type: Inject,
|
|
165
|
+
args: [POSITION]
|
|
166
|
+
}] }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
|
|
167
|
+
type: Inject,
|
|
168
|
+
args: [POSITIONER_OPTIONS]
|
|
169
|
+
}, {
|
|
170
|
+
type: Optional
|
|
171
|
+
}] }, { type: Object, decorators: [{
|
|
172
|
+
type: Inject,
|
|
173
|
+
args: [PLATFORM_ID]
|
|
174
|
+
}] }]; } });
|
|
175
|
+
//# sourceMappingURL=defaultPositioner.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultPositioner.component.js","sourceRoot":"","sources":["../../../../../src/plugins/positioner/default/defaultPositioner.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAa,WAAW,EAAE,iBAAiB,EAAe,MAAM,eAAe,CAAC;AACxJ,OAAO,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAW,QAAQ,EAAE,cAAc,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AACpF,OAAO,EAAC,MAAM,EAAa,MAAM,gBAAgB,CAAC;AAMlD,OAAO,EAAC,0BAA0B,EAAC,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAC,kBAAkB,EAAC,MAAM,UAAU,CAAC;AAE5C,OAAO,EAAC,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAC,SAAS,EAAC,MAAM,mCAAmC,CAAC;;;AAE5D;;GAEG;AACH,MAAM,cAAc,GACp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f,MAAM;2BAAC,kBAAkB;;0BAAG,QAAQ;;0BACpC,MAAM;2BAAC,WAAW","sourcesContent":["import {Component, ChangeDetectionStrategy, Inject, Optional, ElementRef, OnDestroy, PLATFORM_ID, ChangeDetectorRef, EventEmitter} from '@angular/core';\nimport {isPlatformBrowser} from '@angular/common';\nimport {Position, POSITION, PositionOffset, PositionPlacement} from '@anglr/common';\nimport {extend, NoopAction} from '@jscrpt/common';\nimport {Subscription} from 'rxjs';\n\nimport {DefaultPositionerOptions, DefaultPositioner} from './defaultPositioner.interface';\nimport {NgSelectPlugin, OptionsGatherer} from '../../../misc';\nimport {NgSelectPluginInstances} from '../../../components/select';\nimport {NG_SELECT_PLUGIN_INSTANCES} from '../../../components/select/types';\nimport {POSITIONER_OPTIONS} from '../types';\nimport {Popup} from '../../popup';\nimport {POPUP} from '../../popup/types';\nimport {PluginBus} from '../../../misc/pluginBus/pluginBus';\n\n/**\n * Default options for positioner\n */\nconst defaultOptions: DefaultPositionerOptions =\n{\n positionOptions:\n {\n offset: PositionOffset.None,\n placement: PositionPlacement.BottomStart,\n }\n};\n\n/**\n * Component used for positioning popup element, handles resize, scroll and collision using `Position`\n */\n@Component(\n{\n selector: 'ng-default-positioner',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DefaultPositionerComponent implements DefaultPositioner, NgSelectPlugin<DefaultPositionerOptions>, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Instance of previous options gatherer, that is used for obtaining available options\n */\n protected optionsGatherer: OptionsGatherer;\n\n /**\n * Occurs when flip occured during positining of popup\n */\n protected ɵflip: EventEmitter<void>;\n\n /**\n * Options for NgSelect plugin\n */\n protected ɵoptions: DefaultPositionerOptions;\n\n /**\n * Subscription for visibility change of popup\n */\n protected visibilitySubscription: Subscription|undefined|null;\n\n /**\n * Subscription for changes of options in options gatherer\n */\n protected optionsChangeSubscription: Subscription|undefined|null;\n\n /**\n * Subscription for positioning event that occured\n */\n protected positioningSubscription: Subscription|undefined|null;\n\n /**\n * Function used for disposing of positining watch\n */\n protected positioningDispose: NoopAction;\n\n /**\n * Popup that is displayed\n */\n protected popup: Popup;\n\n /**\n * Html element of popup plugin\n */\n protected popupElement: HTMLElement;\n\n /**\n * Indication whether is code running in browser\n */\n protected isBrowser: boolean = isPlatformBrowser(this.platformId);\n\n //######################### public properties - implementation of DefaultPositioner #########################\n\n /**\n * Options for NgSelect plugin\n */\n public get options(): DefaultPositionerOptions\n {\n return this.ɵoptions;\n }\n public set options(options: DefaultPositionerOptions)\n {\n this.ɵoptions = extend(true, this.ɵoptions, options);\n }\n\n /**\n * @inheritdoc\n */\n public get flip(): EventEmitter<void>\n {\n return this.ɵflip;\n }\n\n //######################### constructor #########################\n constructor(@Inject(NG_SELECT_PLUGIN_INSTANCES) @Optional() public ngSelectPlugins: NgSelectPluginInstances,\n @Optional() public pluginBus: PluginBus,\n public pluginElement: ElementRef,\n @Inject(POSITION) protected position: Position,\n protected changeDetector: ChangeDetectorRef,\n @Inject(POSITIONER_OPTIONS) @Optional() options?: DefaultPositionerOptions,\n @Inject(PLATFORM_ID) protected platformId?: Object,)\n {\n this.ɵoptions = extend(true, {}, defaultOptions, options);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * Called when component is destroyed\n */\n public ngOnDestroy()\n {\n this.visibilitySubscription?.unsubscribe();\n this.visibilitySubscription = null;\n\n this.optionsChangeSubscription?.unsubscribe();\n this.optionsChangeSubscription = null;\n\n this.positioningDispose?.();\n\n this.positioningSubscription?.unsubscribe();\n this.positioningSubscription = null;\n }\n\n //######################### public methods - implementation of DefaultPositioner #########################\n\n /**\n * Initialize plugin, to be ready to use, initialize communication with other plugins\n */\n public initialize()\n {\n // if(this.optionsGatherer && this.optionsGatherer != this.pluginBus?.selectOptions.optionsGatherer)\n // {\n // this.optionsChangeSubscription.unsubscribe();\n // this.optionsChangeSubscription = null;\n\n // this.optionsGatherer = null;\n // }\n\n // if(!this.optionsGatherer)\n // {\n // this.optionsGatherer = this.pluginBus?.selectOptions.optionsGatherer;\n\n // this.optionsChangeSubscription = this.optionsGatherer.availableOptionsChange.subscribe(() =>\n // {\n // if(this.popup.popupElement && this.optionsGatherer.availableOptions)\n // {\n // this._handlePosition();\n // }\n // });\n // }\n\n const popup: Popup = this.ngSelectPlugins[POPUP] as Popup;\n\n if(this.popup && this.popup != popup)\n {\n this.visibilitySubscription?.unsubscribe();\n this.visibilitySubscription = null;\n\n this.popup = null;\n }\n\n if(!this.popup)\n {\n this.popup = popup;\n\n this.visibilitySubscription = this.popup.visibilityChange.subscribe(() => this.initPosition());\n }\n\n this.initPosition();\n }\n\n /**\n * @inheritdoc\n */\n public initOptions()\n {\n }\n\n /**\n * @inheritdoc\n */\n public invalidateVisuals(): void\n {\n }\n\n //######################### protected methods #########################\n\n /**\n * Initialize positioning of popup\n */\n protected initPosition()\n {\n this.popupElement = this.popup.popupElement;\n\n // //this has meaning only when popup is outside of ng-element\n // this.changeDetector.markForCheck();\n\n if(this.isBrowser)\n {\n //register events and handle position of opened popup\n if(this.popupElement)\n {\n this.positioningSubscription?.unsubscribe();\n this.positioningDispose?.();\n \n this.positioningSubscription = null;\n this.positioningDispose = null;\n\n this.positioningSubscription = this.position.placeElement(this.popupElement,\n this.pluginBus.selectElement.nativeElement,\n this.options.positionOptions,)\n .subscribe(result =>\n {\n this.positioningDispose = result.dispose;\n\n if(result.flip)\n {\n this.flip.emit();\n }\n });\n }\n //unregister events\n else\n {\n this.positioningSubscription?.unsubscribe();\n this.positioningDispose?.();\n\n this.positioningSubscription = null;\n this.positioningDispose = null;\n }\n }\n }\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultPositioner.interface.js","sourceRoot":"","sources":["../../../../../src/plugins/positioner/default/defaultPositioner.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {Positioner, PositionerOptions} from '../positioner.interface';\n\n/**\n * Default positioner options\n */\nexport interface DefaultPositionerOptions extends PositionerOptions\n{\n}\n\n/**\n * Public API for 'DefaultPositionerComponent'\n */\nexport interface DefaultPositioner extends Positioner\n{\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/positioner/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AAEvC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/positioner/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AAEvC,cAAc,uCAAuC,CAAC;AACtD,cAAc,6BAA6B,CAAC","sourcesContent":["export * from './positioner.interface';\n\nexport * from './default/defaultPositioner.interface';\nexport * from './no/noPositioner.interface';"]}
|