@anglr/select 16.1.0 → 17.0.0-beta.20260702112309

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/changelog.md +37 -0
  2. package/es2022/src/components/option/option.component.js +13 -8
  3. package/es2022/src/components/option/option.component.js.map +1 -1
  4. package/es2022/src/components/optionGroup/optgroup.component.js +6 -5
  5. package/es2022/src/components/optionGroup/optgroup.component.js.map +1 -1
  6. package/es2022/src/components/select/select.component.js +33 -21
  7. package/es2022/src/components/select/select.component.js.map +1 -1
  8. package/es2022/src/directives/highlightInstance/highlightInstance.directive.js +80 -0
  9. package/es2022/src/directives/highlightInstance/highlightInstance.directive.js.map +1 -0
  10. package/es2022/src/directives/highlightSearch/highlightSearch.directive.js +114 -0
  11. package/es2022/src/directives/highlightSearch/highlightSearch.directive.js.map +1 -0
  12. package/es2022/src/directives/highlightText/highlightText.directive.js +63 -0
  13. package/es2022/src/directives/highlightText/highlightText.directive.js.map +1 -0
  14. package/es2022/src/directives/index.js +3 -0
  15. package/es2022/src/directives/index.js.map +1 -1
  16. package/es2022/src/directives/normalStateTagTemplate/normalStateTagTemplate.directive.js +3 -3
  17. package/es2022/src/directives/normalStateTemplate/normalStateTemplate.directive.js +3 -3
  18. package/es2022/src/directives/optionGroupTemplate/optionGroupTemplate.directive.js +3 -3
  19. package/es2022/src/directives/optionTemplate/optionTemplate.directive.js +3 -3
  20. package/es2022/src/directives/selectAbsolute/selectAbsolute.directive.js +3 -3
  21. package/es2022/src/directives/selectControlValueAccessor/selectControlValueAccessor.directive.js +7 -5
  22. package/es2022/src/directives/selectControlValueAccessor/selectControlValueAccessor.directive.js.map +1 -1
  23. package/es2022/src/directives/selectEdit/selectEdit.directive.js +3 -3
  24. package/es2022/src/directives/selectFormControl/selectFormControl.directive.js +11 -7
  25. package/es2022/src/directives/selectFormControl/selectFormControl.directive.js.map +1 -1
  26. package/es2022/src/directives/selectMultipleKeepPopup/selectMultipleKeepPopup.directive.js +3 -3
  27. package/es2022/src/directives/selectNoCarret/selectNoCarret.directive.js +3 -3
  28. package/es2022/src/directives/selectPlaceholder/selectPlaceholder.directive.js +5 -4
  29. package/es2022/src/directives/selectPlaceholder/selectPlaceholder.directive.js.map +1 -1
  30. package/es2022/src/directives/withDirectAccess/withDirectAccess.directive.js +5 -4
  31. package/es2022/src/directives/withDirectAccess/withDirectAccess.directive.js.map +1 -1
  32. package/es2022/src/interfaces/plugins/popup/popup.interface.js.map +1 -1
  33. package/es2022/src/misc/classes/codeOptionsGatherer/codeOptionsGatherer.interface.js +6 -3
  34. package/es2022/src/misc/classes/codeOptionsGatherer/codeOptionsGatherer.interface.js.map +1 -1
  35. package/es2022/src/misc/classes/selectBus/selectBus.js +11 -7
  36. package/es2022/src/misc/classes/selectBus/selectBus.js.map +1 -1
  37. package/es2022/src/misc/classes/selectPluginInstances/selectPluginInstances.js +18 -9
  38. package/es2022/src/misc/classes/selectPluginInstances/selectPluginInstances.js.map +1 -1
  39. package/es2022/src/modules/select.module.js +4 -4
  40. package/es2022/src/pipes/addNewOption/addNewOption.pipe.js +3 -3
  41. package/es2022/src/pipes/displayOptionValue/displayOptionValue.pipe.js +7 -5
  42. package/es2022/src/pipes/displayOptionValue/displayOptionValue.pipe.js.map +1 -1
  43. package/es2022/src/pipes/displayValue/displayValue.pipe.js +9 -6
  44. package/es2022/src/pipes/displayValue/displayValue.pipe.js.map +1 -1
  45. package/es2022/src/pipes/getPlugin/getPlugin.pipe.js +3 -3
  46. package/es2022/src/pipes/groupedListOptions/groupedListOptions.pipe.js +3 -3
  47. package/es2022/src/pipes/hasValue/hasValue.pipe.js +3 -3
  48. package/es2022/src/pipes/optionCssClasses/optionCssClasses.pipe.js +3 -3
  49. package/es2022/src/plugins/interactions/simpleInteractions/simpleInteractions.component.js +3 -3
  50. package/es2022/src/plugins/keyboardHandler/simpleKeyboardHandler/simpleKeyboardHandler.component.js +3 -3
  51. package/es2022/src/plugins/liveSearch/editLiveSearch/editLiveSearch.component.js +13 -8
  52. package/es2022/src/plugins/liveSearch/editLiveSearch/editLiveSearch.component.js.map +1 -1
  53. package/es2022/src/plugins/liveSearch/filterLiveSearch/filterLiveSearch.component.js +7 -5
  54. package/es2022/src/plugins/liveSearch/filterLiveSearch/filterLiveSearch.component.js.map +1 -1
  55. package/es2022/src/plugins/liveSearch/noLiveSearch/noLiveSearch.component.js +7 -5
  56. package/es2022/src/plugins/liveSearch/noLiveSearch/noLiveSearch.component.js.map +1 -1
  57. package/es2022/src/plugins/normalState/editNormalState/editNormalState.component.js +9 -6
  58. package/es2022/src/plugins/normalState/editNormalState/editNormalState.component.js.map +1 -1
  59. package/es2022/src/plugins/normalState/simpleNormalState/simpleNormalState.component.js +5 -4
  60. package/es2022/src/plugins/normalState/simpleNormalState/simpleNormalState.component.js.map +1 -1
  61. package/es2022/src/plugins/optionsHandler/noOptionsHandler/noOptionsHandler.component.js +7 -5
  62. package/es2022/src/plugins/optionsHandler/noOptionsHandler/noOptionsHandler.component.js.map +1 -1
  63. package/es2022/src/plugins/optionsHandler/optionsHandlerBase.js +9 -6
  64. package/es2022/src/plugins/optionsHandler/optionsHandlerBase.js.map +1 -1
  65. package/es2022/src/plugins/optionsHandler/simpleOptionsHandler/simpleOptionsHandler.component.js +7 -5
  66. package/es2022/src/plugins/optionsHandler/simpleOptionsHandler/simpleOptionsHandler.component.js.map +1 -1
  67. package/es2022/src/plugins/popup/simplePopup/simplePopup.component.js +11 -5
  68. package/es2022/src/plugins/popup/simplePopup/simplePopup.component.js.map +1 -1
  69. package/es2022/src/plugins/positioner/commonPositioner/commonPositioner.component.js +3 -3
  70. package/es2022/src/plugins/positioner/noPositioner/noPositioner.component.js +3 -3
  71. package/es2022/src/plugins/positioner/popoverPositioner/popoverPositioner.component.js +3 -3
  72. package/es2022/src/plugins/valueHandler/dynamicValueHandler/dynamicValueHandler.component.js +13 -8
  73. package/es2022/src/plugins/valueHandler/dynamicValueHandler/dynamicValueHandler.component.js.map +1 -1
  74. package/es2022/src/plugins/valueHandler/staticValueHandler/staticValueHandler.component.js +7 -5
  75. package/es2022/src/plugins/valueHandler/staticValueHandler/staticValueHandler.component.js.map +1 -1
  76. package/package.json +19 -27
  77. package/src/directives/highlightInstance/highlightInstance.directive.d.ts +42 -0
  78. package/src/directives/highlightInstance/highlightInstance.directive.d.ts.map +1 -0
  79. package/src/directives/highlightSearch/highlightSearch.directive.d.ts +50 -0
  80. package/src/directives/highlightSearch/highlightSearch.directive.d.ts.map +1 -0
  81. package/src/directives/highlightText/highlightText.directive.d.ts +28 -0
  82. package/src/directives/highlightText/highlightText.directive.d.ts.map +1 -0
  83. package/src/directives/index.d.ts +3 -0
  84. package/src/directives/index.d.ts.map +1 -1
  85. package/src/interfaces/plugins/popup/popup.interface.d.ts +4 -0
  86. package/src/interfaces/plugins/popup/popup.interface.d.ts.map +1 -1
  87. package/src/plugins/liveSearch/filterLiveSearch/filterLiveSearch.component.d.ts +1 -1
  88. package/src/plugins/liveSearch/filterLiveSearch/filterLiveSearch.component.d.ts.map +1 -1
  89. package/src/plugins/popup/simplePopup/simplePopup.component.d.ts +2 -1
  90. package/src/plugins/popup/simplePopup/simplePopup.component.d.ts.map +1 -1
  91. package/src/plugins/popup/simplePopup/simplePopup.component.html +2 -2
  92. package/styles/components/_popup.scss +6 -0
  93. package/styles/core/_defaultTheme.scss +5 -0
  94. package/version.bak +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"editLiveSearch.component.js","sourceRoot":"","sources":["../../../../../src/plugins/liveSearch/editLiveSearch/editLiveSearch.component.ts","../../../../../src/plugins/liveSearch/editLiveSearch/editLiveSearch.component.html"],"names":[],"mappings":";AAAA,OAAO,EAAC,iBAAiB,EAAE,uBAAuB,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAa,QAAQ,EAAE,MAAM,EAAU,SAAS,EAAiB,MAAM,eAAe,CAAC;AA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O,CAAC,qBAAqB,CAAsB,CAAC;IAChE,CAAC;IAED,uEAAuE;IAEvE;;OAEG;IACO,gBAAgB;QAEtB,IAAI,CAAC,SAAS,EAAE,CAAC,aAAa,CAAC,KAAK,GAAG,EAAE,CAAC;QAC1C,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC;8GA3OQ,cAAc,kBAuFH,mBAAmB;kGAvF9B,cAAc,8QC3C3B,++BAmB+B,4CDoBvB,gBAAgB,uJAHhB,QAAQ,4CACR,YAAY,gDACZ,YAAY;;AAwCT;IADN,mBAAmB,EAAE;;+CACsC;2FAnCnD,cAAc;kBAjB1B,SAAS;+BAEI,kBAAkB,QAG5B;wBACI,SAAS,EAAE,qCAAqC;qBACnD,WAED;wBACI,QAAQ;wBACR,YAAY;wBACZ,YAAY;wBACZ,gBAAgB;qBACnB,mBACgB,uBAAuB,CAAC,MAAM;;0BAyFlC,MAAM;2BAAC,mBAAmB;;0BAAG,QAAQ;+FA9B6B,WAAW","sourcesContent":["import {afterRenderEffect, ChangeDetectionStrategy, Component, computed, DOCUMENT, effect, ElementRef, Inject, inject, OnDestroy, Optional, signal, Signal, viewChild, WritableSignal} from '@angular/core';\nimport {LocalizePipe, LOGGER, Logger, TooltipDirective} from '@anglr/common';\nimport {isDescendant, isPresent, RecursivePartial} from '@jscrpt/common';\nimport {deepCopyWithArrayOverride} from '@jscrpt/common/lodash';\n\nimport {LiveSearch, EditLiveSearchCssClasses, LiveSearchOptions, SelectPlugin} from '../../../interfaces';\nimport {SelectPluginInstances, SelectBus} from '../../../misc/classes';\nimport {CopyOptionsAsSignal} from '../../../decorators';\nimport {LIVE_SEARCH_OPTIONS} from '../../../misc/tokens';\nimport {DisplayValue, HasValue} from '../../../pipes';\n\nconst defaultOptions: LiveSearchOptions<EditLiveSearchCssClasses> =\n{\n searchDebounceTimeout: 280,\n cssClasses:\n {\n componentElement: 'live-search-component',\n searchElement: 'live-search-input',\n multiple: 'select-flex-1',\n single: 'absolute-input',\n },\n};\n\n/**\n * Live search component used for in edit Select.\n */\n@Component(\n{\n selector: 'edit-live-search',\n templateUrl: 'editLiveSearch.component.html',\n host:\n {\n '[class]': 'options.cssClasses.componentElement',\n },\n imports:\n [\n HasValue,\n DisplayValue,\n LocalizePipe,\n TooltipDirective,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class EditLiveSearch<TValue = unknown, TPublicValue = TValue> implements LiveSearch<TValue, TPublicValue, LiveSearchOptions<EditLiveSearchCssClasses>>, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Indication whether input search value is empty\n */\n protected emptyInputSignal: WritableSignal<boolean> = signal(true);\n\n /**\n * Timeout used for debouncing search input\n */\n protected timeout: number|undefined|null;\n\n /**\n * Instance of logger for logging purposes\n */\n protected logger: Logger = inject(LOGGER);\n\n /**\n * Value of search input holding value that was set by user\n */\n protected valueOutput: WritableSignal<string> = signal('');\n\n /**\n * Reference to document object for DOM operations\n */\n protected document: Document = inject(DOCUMENT);\n\n //######################### public properties - implementation of SelectPlugin #########################\n\n /**\n * @inheritdoc\n */\n @CopyOptionsAsSignal()\n public options: LiveSearchOptions<EditLiveSearchCssClasses>;\n\n /**\n * @inheritdoc\n */\n public selectPlugins: SelectPluginInstances<TValue, TPublicValue> = inject(SelectPluginInstances);\n\n /**\n * @inheritdoc\n */\n public pluginElement: ElementRef<HTMLElement> = inject(ElementRef);\n\n /**\n * @inheritdoc\n */\n public selectBus: SelectBus<TValue, TPublicValue> = inject(SelectBus);\n\n //######################### protected properties - children #########################\n\n /**\n * HTML input element used for search input\n */\n protected htmlInput: Signal<ElementRef<HTMLInputElement>> = viewChild.required('htmlInput');\n\n //######################### protected properties - template bindings #########################\n\n /**\n * Css classes applied to search input element\n */\n protected cssClasses: Signal<string[]>;\n\n /**\n * Active descendant for aria-activedescendant attribute\n */\n protected activeDescendant: Signal<string>;\n\n //######################### public properties - implementation of LiveSearch #########################\n\n /**\n * @inheritdoc\n */\n public readonly search: Signal<string>;\n\n /**\n * @inheritdoc\n */\n public get emptyInput(): Signal<boolean>\n {\n return this.emptyInputSignal.asReadonly();\n }\n\n //######################### constructor #########################\n constructor(@Inject(LIVE_SEARCH_OPTIONS) @Optional() options?: RecursivePartial<LiveSearchOptions<EditLiveSearchCssClasses>>|null,)\n {\n this.options = deepCopyWithArrayOverride(defaultOptions as LiveSearchOptions<EditLiveSearchCssClasses>,\n options);\n\n this.search = computed(() => this.valueOutput());\n\n const ref = afterRenderEffect(() =>\n {\n if(this.pluginElement.nativeElement.parentElement?.nodeName == 'NG-SELECT')\n {\n this.logger.verbose('Select: Live Search: removing plugin from DOM');\n this.pluginElement.nativeElement.remove();\n }\n\n ref.destroy();\n });\n\n effect(() =>\n {\n this.selectBus.selectedOptions();\n this.logger.verbose('Select: Live Search: selected value changed, resetting search input');\n\n this.clearSearchInput();\n });\n\n effect(() =>\n {\n //prevents clearing when changing tab or window\n if(!this.selectBus.hasFocusComputed() && (!this.document.activeElement || !isDescendant(this.selectBus.selectElement().nativeElement, this.document.activeElement as HTMLElement)))\n {\n this.logger.verbose('Select: Live Search: select lost focus, resetting search input');\n this.clearSearchInput();\n }\n });\n\n this.cssClasses = computed(() => [this.options.cssClasses.searchElement,\n ...(this.selectBus.selectOptions().multiple ? [...this.options.cssClasses.multiple.split(' ')] : [...this.options.cssClasses.single.split(' ')])]);\n\n this.activeDescendant = computed(() => `${this.selectBus.id}-${this.selectPlugins.optionsHandler()?.listOptions()?.find(option => option.active())?.index}`);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * @inheritdoc\n */\n public ngOnDestroy(): void\n {\n if(isPresent(this.timeout))\n {\n clearTimeout(this.timeout);\n }\n }\n\n //######################### public methods - implementation of LiveSearch #########################\n\n /**\n * @inheritdoc\n */\n public focus(): void\n {\n this.htmlInput().nativeElement.focus();\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Handles click event\n */\n protected click(): void\n {\n if(this.selectBus.popupVisible())\n {\n return;\n }\n\n this.selectBus.click.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n }\n\n /**\n * Handles focus event\n */\n protected handleFocus(): void\n {\n this.selectBus.internalsFocus.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n }\n\n /**\n * Handles blur event\n */\n protected blur(): void\n {\n this.selectBus.internalsBlur.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n }\n\n /**\n * Handles input event on search input\n * @param event - Event that occured\n */\n protected input(event: Event): void\n {\n this.selectBus.showPopup.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n\n if(isPresent(this.timeout))\n {\n clearTimeout(this.timeout);\n }\n\n this.emptyInputSignal.set((event.target as HTMLInputElement).value.length == 0);\n\n this.timeout = setTimeout(() =>\n {\n this.logger.verbose('Select: Live Search: emitting search value {{value}}', {value: (event.target as HTMLInputElement).value});\n this.valueOutput.set((event.target as HTMLInputElement).value);\n }, this.options.searchDebounceTimeout) as unknown as number;\n }\n\n //######################### protected methods #########################\n\n /**\n * Clears search input value and sets empty input signal to true\n */\n protected clearSearchInput(): void\n {\n this.htmlInput().nativeElement.value = '';\n this.emptyInputSignal.set(true);\n this.valueOutput.set('');\n }\n}\n","<input #htmlInput\n type=\"text\"\n aria-autocomplete=\"list\"\n autocorrect=\"off\"\n autocapitalize=\"none\"\n autocomplete=\"off\"\n role=\"combobox\"\n [attr.aria-expanded]=\"selectBus.popupVisible()\"\n [attr.aria-label]=\"selectBus.selectedOptions() | displayValue | localize\"\n [attr.aria-controls]=\"selectBus.popupVisible() ? selectBus.id : null\"\n [attr.aria-activedescendant]=\"selectBus.popupVisible() ? activeDescendant() : null\"\n [attr.aria-label]=\"selectBus.selectedOptions() | displayValue | localize\"\n [class]=\"cssClasses()\"\n [tooltip]=\"selectBus.selectedOptions() | displayValue | localize\"\n [disabled]=\"selectBus.selectOptions().readonly\"\n [placeholder]=\"(!(selectBus.selectedOptions() | hasValue) ? selectBus.selectOptions().placeholder : '') | localize\"\n (click)=\"click()\"\n (focus)=\"handleFocus()\"\n (blur)=\"blur()\"\n (input)=\"input($event)\">"]}
1
+ {"version":3,"file":"editLiveSearch.component.js","sourceRoot":"","sources":["../../../../../src/plugins/liveSearch/editLiveSearch/editLiveSearch.component.ts","../../../../../src/plugins/liveSearch/editLiveSearch/editLiveSearch.component.html"],"names":[],"mappings":";AAAA,OAAO,EAAC,iBAAiB,EAAE,uBAAuB,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAa,QAAQ,EAAE,MAAM,EAAU,SAAS,EAAiB,MAAM,eAAe,CAAC;AAC5M,OAAO,EAAC,YAAY,EAAE,MAAM,EAAU,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAC,YAAY,EAAE,SAAS,EAAmB,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAC,yBAAyB,EAAC,MAAM,uBAAuB,CAAC;AAGhE,OAAO,EAAC,qBAAqB,EAAE,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAC,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;;AAEtD,MAAM,cAAc,GACpB;IACI,qBAAqB,EAAE,GAAG;IAC1B,UAAU,EACV;QACI,gBAAgB,EAAE,uBAAuB;QACzC,aAAa,EAAE,mBAAmB;QAClC,QAAQ,EAAE,eAAe;QACzB,MAAM,EAAE,gBAAgB;KAC3B;CACJ,CAAC;AAEF;;GAEG;AAkBH,MAAM,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MAAM;2BAAC,mBAAmB;;0BAAG,QAAQ;+FA9B6B,WAAW","sourcesContent":["import {afterRenderEffect, ChangeDetectionStrategy, Component, computed, DOCUMENT, effect, ElementRef, Inject, inject, OnDestroy, Optional, signal, Signal, viewChild, WritableSignal} from '@angular/core';\nimport {LocalizePipe, LOGGER, Logger, TooltipDirective} from '@anglr/common';\nimport {isDescendant, isPresent, RecursivePartial} from '@jscrpt/common';\nimport {deepCopyWithArrayOverride} from '@jscrpt/common/lodash';\n\nimport {LiveSearch, EditLiveSearchCssClasses, LiveSearchOptions, SelectPlugin} from '../../../interfaces';\nimport {SelectPluginInstances, SelectBus} from '../../../misc/classes';\nimport {CopyOptionsAsSignal} from '../../../decorators';\nimport {LIVE_SEARCH_OPTIONS} from '../../../misc/tokens';\nimport {DisplayValue, HasValue} from '../../../pipes';\n\nconst defaultOptions: LiveSearchOptions<EditLiveSearchCssClasses> =\n{\n searchDebounceTimeout: 280,\n cssClasses:\n {\n componentElement: 'live-search-component',\n searchElement: 'live-search-input',\n multiple: 'select-flex-1',\n single: 'absolute-input',\n },\n};\n\n/**\n * Live search component used for in edit Select.\n */\n@Component(\n{\n selector: 'edit-live-search',\n templateUrl: 'editLiveSearch.component.html',\n host:\n {\n '[class]': 'options.cssClasses.componentElement',\n },\n imports:\n [\n HasValue,\n DisplayValue,\n LocalizePipe,\n TooltipDirective,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class EditLiveSearch<TValue = unknown, TPublicValue = TValue> implements LiveSearch<TValue, TPublicValue, LiveSearchOptions<EditLiveSearchCssClasses>>, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Indication whether input search value is empty\n */\n protected emptyInputSignal: WritableSignal<boolean> = signal(true);\n\n /**\n * Timeout used for debouncing search input\n */\n protected timeout: number|undefined|null;\n\n /**\n * Instance of logger for logging purposes\n */\n protected logger: Logger = inject(LOGGER);\n\n /**\n * Value of search input holding value that was set by user\n */\n protected valueOutput: WritableSignal<string> = signal('');\n\n /**\n * Reference to document object for DOM operations\n */\n protected document: Document = inject(DOCUMENT);\n\n //######################### public properties - implementation of SelectPlugin #########################\n\n /**\n * @inheritdoc\n */\n @CopyOptionsAsSignal()\n public options: LiveSearchOptions<EditLiveSearchCssClasses>;\n\n /**\n * @inheritdoc\n */\n public selectPlugins: SelectPluginInstances<TValue, TPublicValue> = inject(SelectPluginInstances);\n\n /**\n * @inheritdoc\n */\n public pluginElement: ElementRef<HTMLElement> = inject(ElementRef);\n\n /**\n * @inheritdoc\n */\n public selectBus: SelectBus<TValue, TPublicValue> = inject(SelectBus);\n\n //######################### protected properties - children #########################\n\n /**\n * HTML input element used for search input\n */\n protected htmlInput: Signal<ElementRef<HTMLInputElement>> = viewChild.required('htmlInput');\n\n //######################### protected properties - template bindings #########################\n\n /**\n * Css classes applied to search input element\n */\n protected cssClasses: Signal<string[]>;\n\n /**\n * Active descendant for aria-activedescendant attribute\n */\n protected activeDescendant: Signal<string>;\n\n //######################### public properties - implementation of LiveSearch #########################\n\n /**\n * @inheritdoc\n */\n public readonly search: Signal<string>;\n\n /**\n * @inheritdoc\n */\n public get emptyInput(): Signal<boolean>\n {\n return this.emptyInputSignal.asReadonly();\n }\n\n //######################### constructor #########################\n constructor(@Inject(LIVE_SEARCH_OPTIONS) @Optional() options?: RecursivePartial<LiveSearchOptions<EditLiveSearchCssClasses>>|null,)\n {\n this.options = deepCopyWithArrayOverride(defaultOptions as LiveSearchOptions<EditLiveSearchCssClasses>,\n options);\n\n this.search = computed(() => this.valueOutput());\n\n const ref = afterRenderEffect(() =>\n {\n if(this.pluginElement.nativeElement.parentElement?.nodeName == 'NG-SELECT')\n {\n this.logger.verbose('Select: Live Search: removing plugin from DOM');\n this.pluginElement.nativeElement.remove();\n }\n\n ref.destroy();\n });\n\n effect(() =>\n {\n this.selectBus.selectedOptions();\n this.logger.verbose('Select: Live Search: selected value changed, resetting search input');\n\n this.clearSearchInput();\n });\n\n effect(() =>\n {\n //prevents clearing when changing tab or window\n if(!this.selectBus.hasFocusComputed() && (!this.document.activeElement || !isDescendant(this.selectBus.selectElement().nativeElement, this.document.activeElement as HTMLElement)))\n {\n this.logger.verbose('Select: Live Search: select lost focus, resetting search input');\n this.clearSearchInput();\n }\n });\n\n this.cssClasses = computed(() => [this.options.cssClasses.searchElement,\n ...(this.selectBus.selectOptions().multiple ? [...this.options.cssClasses.multiple.split(' ')] : [...this.options.cssClasses.single.split(' ')])]);\n\n this.activeDescendant = computed(() => `${this.selectBus.id}-${this.selectPlugins.optionsHandler()?.listOptions()?.find(option => option.active())?.index}`);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * @inheritdoc\n */\n public ngOnDestroy(): void\n {\n if(isPresent(this.timeout))\n {\n clearTimeout(this.timeout);\n }\n }\n\n //######################### public methods - implementation of LiveSearch #########################\n\n /**\n * @inheritdoc\n */\n public focus(): void\n {\n this.htmlInput().nativeElement.focus();\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Handles click event\n */\n protected click(): void\n {\n if(this.selectBus.popupVisible())\n {\n return;\n }\n\n this.selectBus.click.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n }\n\n /**\n * Handles focus event\n */\n protected handleFocus(): void\n {\n this.selectBus.internalsFocus.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n }\n\n /**\n * Handles blur event\n */\n protected blur(): void\n {\n this.selectBus.internalsBlur.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n }\n\n /**\n * Handles input event on search input\n * @param event - Event that occured\n */\n protected input(event: Event): void\n {\n this.selectBus.showPopup.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n\n if(isPresent(this.timeout))\n {\n clearTimeout(this.timeout);\n }\n\n this.emptyInputSignal.set((event.target as HTMLInputElement).value.length == 0);\n\n this.timeout = setTimeout(() =>\n {\n this.logger.verbose('Select: Live Search: emitting search value {{value}}', {value: (event.target as HTMLInputElement).value});\n this.valueOutput.set((event.target as HTMLInputElement).value);\n }, this.options.searchDebounceTimeout) as unknown as number;\n }\n\n //######################### protected methods #########################\n\n /**\n * Clears search input value and sets empty input signal to true\n */\n protected clearSearchInput(): void\n {\n this.htmlInput().nativeElement.value = '';\n this.emptyInputSignal.set(true);\n this.valueOutput.set('');\n }\n}\n","<input #htmlInput\n type=\"text\"\n aria-autocomplete=\"list\"\n autocorrect=\"off\"\n autocapitalize=\"none\"\n autocomplete=\"off\"\n role=\"combobox\"\n [attr.aria-expanded]=\"selectBus.popupVisible()\"\n [attr.aria-label]=\"selectBus.selectedOptions() | displayValue | localize\"\n [attr.aria-controls]=\"selectBus.popupVisible() ? selectBus.id : null\"\n [attr.aria-activedescendant]=\"selectBus.popupVisible() ? activeDescendant() : null\"\n [attr.aria-label]=\"selectBus.selectedOptions() | displayValue | localize\"\n [class]=\"cssClasses()\"\n [tooltip]=\"selectBus.selectedOptions() | displayValue | localize\"\n [disabled]=\"selectBus.selectOptions().readonly\"\n [placeholder]=\"(!(selectBus.selectedOptions() | hasValue) ? selectBus.selectOptions().placeholder : '') | localize\"\n (click)=\"click()\"\n (focus)=\"handleFocus()\"\n (blur)=\"blur()\"\n (input)=\"input($event)\">"]}
@@ -32,7 +32,8 @@ export class FilterLiveSearch {
32
32
  /**
33
33
  * Indication whether input search value is empty
34
34
  */
35
- this.emptyInputSignal = signal(true, ...(ngDevMode ? [{ debugName: "emptyInputSignal" }] : []));
35
+ this.emptyInputSignal = signal(true, /* @ts-ignore */
36
+ ...(ngDevMode ? [{ debugName: "emptyInputSignal" }] : /* istanbul ignore next */ []));
36
37
  /**
37
38
  * @inheritdoc
38
39
  */
@@ -49,7 +50,8 @@ export class FilterLiveSearch {
49
50
  this.value = form(signal(''), path => debounce(path, this.options.searchDebounceTimeout));
50
51
  this.search = computed(() => {
51
52
  return this.value().value();
52
- }, ...(ngDevMode ? [{ debugName: "search" }] : []));
53
+ }, /* @ts-ignore */
54
+ ...(ngDevMode ? [{ debugName: "search" }] : /* istanbul ignore next */ []));
53
55
  const ref = afterRenderEffect(() => {
54
56
  if (this.pluginElement.nativeElement.parentElement?.nodeName == 'NG-SELECT') {
55
57
  this.pluginElement.nativeElement.remove();
@@ -71,14 +73,14 @@ export class FilterLiveSearch {
71
73
  input(event) {
72
74
  this.emptyInputSignal.set(event.target.value.length == 0);
73
75
  }
74
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: FilterLiveSearch, deps: [{ token: LIVE_SEARCH_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
75
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.5", type: FilterLiveSearch, isStandalone: true, selector: "filter-live-search", host: { properties: { "class": "options.cssClasses.componentElement" } }, ngImport: i0, template: "<input type=\"text\" [placeholder]=\"options.texts.searchPlaceholder | localize\" [formField]=\"value\">", dependencies: [{ kind: "directive", type: FormField, selector: "[formField]", inputs: ["formField"] }, { kind: "pipe", type: LocalizePipe, name: "localize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
76
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: FilterLiveSearch, deps: [{ token: LIVE_SEARCH_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
77
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.4", type: FilterLiveSearch, isStandalone: true, selector: "filter-live-search", host: { properties: { "class": "options.cssClasses.componentElement" } }, ngImport: i0, template: "<input type=\"text\" [placeholder]=\"options.texts.searchPlaceholder | localize\" [formField]=\"value\">", dependencies: [{ kind: "directive", type: FormField, selector: "[formField]", inputs: ["formField"], exportAs: ["formField"] }, { kind: "pipe", type: LocalizePipe, name: "localize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
76
78
  }
77
79
  __decorate([
78
80
  CopyOptionsAsSignal(),
79
81
  __metadata("design:type", Object)
80
82
  ], FilterLiveSearch.prototype, "options", void 0);
81
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: FilterLiveSearch, decorators: [{
83
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: FilterLiveSearch, decorators: [{
82
84
  type: Component,
83
85
  args: [{ selector: 'filter-live-search', host: {
84
86
  '[class]': 'options.cssClasses.componentElement',
@@ -1 +1 @@
1
- {"version":3,"file":"filterLiveSearch.component.js","sourceRoot":"","sources":["../../../../../src/plugins/liveSearch/filterLiveSearch/filterLiveSearch.component.ts","../../../../../src/plugins/liveSearch/filterLiveSearch/filterLiveSearch.component.html"],"names":[],"mappings":";AAAA,OAAO,EAAC,iBAAiB,EAAE,uBAAuB,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAyB,MAAM,eAAe,CAAC;AACpK,OAAO,EAAC,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAC,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAC,yBAAyB,EAAC,MAAM,uBAAuB,CAAC;AAGhE,OAAO,EAAC,qBAAqB,EAAE,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAC,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;;AAEzD,MAAM,cAAc,GACpB;IACI,qBAAqB,EAAE,GAAG;IAC1B,KAAK,EACL;QACI,iBAAiB,EAAE,gBAAgB;KACtC;IACD,UAAU,EACV;QACI,gBAAgB,EAAE,uBAAuB;KAC5C;CACJ,CAAC;AAEF;;GAEG;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AI,CAAC,gBAAgB,CAAC,GAAG,CAAE,KAAK,CAAC,MAA2B,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC;IACpF,CAAC;8GAhGQ,gBAAgB,kBAuDL,mBAAmB;kGAvD9B,gBAAgB,wJC1C7B,0GAAkG,4CDqC1F,SAAS,0EACT,YAAY;;AA0BT;IADN,mBAAmB,EAAE;;iDACwC;2FAtBrD,gBAAgB;kBAf5B,SAAS;+BAEI,oBAAoB,QAG9B;wBACI,SAAS,EAAE,qCAAqC;qBACnD,WAED;wBACI,SAAS;wBACT,YAAY;qBACf,mBACgB,uBAAuB,CAAC,MAAM;;0BAyDlC,MAAM;2BAAC,mBAAmB;;0BAAG,QAAQ","sourcesContent":["import {afterRenderEffect, ChangeDetectionStrategy, Component, computed, ElementRef, Inject, inject, Optional, signal, Signal, WritableSignal} from '@angular/core';\nimport {debounce, form, FormField} from '@angular/forms/signals';\nimport {LocalizePipe} from '@anglr/common';\nimport {RecursivePartial} from '@jscrpt/common';\nimport {deepCopyWithArrayOverride} from '@jscrpt/common/lodash';\n\nimport {LiveSearch, LiveSearchCssClasses, FilterLiveSearchOptions} from '../../../interfaces';\nimport {SelectPluginInstances, SelectBus} from '../../../misc/classes';\nimport {CopyOptionsAsSignal} from '../../../decorators';\nimport {LIVE_SEARCH_OPTIONS} from '../../../misc/tokens';\n\nconst defaultOptions: FilterLiveSearchOptions<LiveSearchCssClasses> =\n{\n searchDebounceTimeout: 280,\n texts:\n {\n searchPlaceholder: 'filter options',\n },\n cssClasses:\n {\n componentElement: 'live-search-component',\n },\n};\n\n/**\n * Live search component used for filtering listed options\n */\n@Component(\n{\n selector: 'filter-live-search',\n templateUrl: 'filterLiveSearch.component.html',\n host:\n {\n '[class]': 'options.cssClasses.componentElement',\n },\n imports:\n [\n FormField,\n LocalizePipe,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FilterLiveSearch<TValue = unknown, TPublicValue = TValue> implements LiveSearch<TValue, TPublicValue, FilterLiveSearchOptions<LiveSearchCssClasses>>\n{\n //######################### protected fields #########################\n\n /**\n * Indication whether input search value is empty\n */\n protected emptyInputSignal: WritableSignal<boolean> = signal(true);\n\n //######################### protected properties - template bindings #########################\n\n /**\n * Instance of form value\n */\n protected value;\n\n //######################### public properties - implementation of SelectPlugin #########################\n\n /**\n * @inheritdoc\n */\n @CopyOptionsAsSignal()\n public options: FilterLiveSearchOptions<LiveSearchCssClasses>;\n\n /**\n * @inheritdoc\n */\n public selectPlugins: SelectPluginInstances<TValue, TPublicValue> = inject(SelectPluginInstances);\n\n /**\n * @inheritdoc\n */\n public pluginElement: ElementRef<HTMLElement> = inject(ElementRef);\n\n /**\n * @inheritdoc\n */\n public selectBus: SelectBus<TValue, TPublicValue> = inject(SelectBus);\n\n //######################### public properties - implementation of LiveSearch #########################\n\n /**\n * @inheritdoc\n */\n public readonly search: Signal<string>;\n\n /**\n * @inheritdoc\n */\n public get emptyInput(): Signal<boolean>\n {\n return this.emptyInputSignal.asReadonly();\n }\n\n //######################### constructor #########################\n constructor(@Inject(LIVE_SEARCH_OPTIONS) @Optional() options?: RecursivePartial<FilterLiveSearchOptions<LiveSearchCssClasses>>|null,)\n {\n this.options = deepCopyWithArrayOverride(defaultOptions as FilterLiveSearchOptions<LiveSearchCssClasses>,\n options);\n\n this.value = form(signal(''), path => debounce(path, this.options.searchDebounceTimeout));\n\n this.search = computed(() =>\n {\n return this.value().value();\n });\n\n const ref = afterRenderEffect(() =>\n {\n if(this.pluginElement.nativeElement.parentElement?.nodeName == 'NG-SELECT')\n {\n this.pluginElement.nativeElement.remove();\n }\n\n ref.destroy();\n });\n }\n\n //######################### public methods - implementation of LiveSearch #########################\n\n /**\n * @inheritdoc\n */\n public focus(): void\n {\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Handles input event on search input\n * @param event - Event that occured\n */\n protected input(event: Event): void\n {\n this.emptyInputSignal.set((event.target as HTMLInputElement).value.length == 0);\n }\n}\n","<input type=\"text\" [placeholder]=\"options.texts.searchPlaceholder | localize\" [formField]=\"value\">"]}
1
+ {"version":3,"file":"filterLiveSearch.component.js","sourceRoot":"","sources":["../../../../../src/plugins/liveSearch/filterLiveSearch/filterLiveSearch.component.ts","../../../../../src/plugins/liveSearch/filterLiveSearch/filterLiveSearch.component.html"],"names":[],"mappings":";AAAA,OAAO,EAAC,iBAAiB,EAAE,uBAAuB,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAyB,MAAM,eAAe,CAAC;AACpK,OAAO,EAAC,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAC,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAC,yBAAyB,EAAC,MAAM,uBAAuB,CAAC;AAGhE,OAAO,EAAC,qBAAqB,EAAE,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAC,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;;AAEzD,MAAM,cAAc,GACpB;IACI,qBAAqB,EAAE,GAAG;IAC1B,KAAK,EACL;QACI,iBAAiB,EAAE,gBAAgB;KACtC;IACD,UAAU,EACV;QACI,gBAAgB,EAAE,uBAAuB;KAC5C;CACJ,CAAC;AAEF;;GAEG;AAgBH,MAAM,OAAO,gBAAgB;IA8CzB;;OAEG;IACH,IAAW,UAAU;QAEjB,OAAO,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC;IAC9C,CAAC;IAED,iEAAiE;IACjE,YAAqD,OAA8E;QArDnI,sEAAsE;QAEtE;;WAEG;QACO,qBAAgB,GAA4B,MAAM,CAAC,IAAI;6FAAC,CAAC;QAiBnE;;WAEG;QACI,kBAAa,GAAgD,MAAM,CAAC,qBAAqB,CAAC,CAAC;QAElG;;WAEG;QACI,kBAA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D,WAED;wBACI,SAAS;wBACT,YAAY;qBACf,mBACgB,uBAAuB,CAAC,MAAM;;0BAyDlC,MAAM;2BAAC,mBAAmB;;0BAAG,QAAQ","sourcesContent":["import {afterRenderEffect, ChangeDetectionStrategy, Component, computed, ElementRef, Inject, inject, Optional, signal, Signal, WritableSignal} from '@angular/core';\nimport {debounce, form, FormField} from '@angular/forms/signals';\nimport {LocalizePipe} from '@anglr/common';\nimport {RecursivePartial} from '@jscrpt/common';\nimport {deepCopyWithArrayOverride} from '@jscrpt/common/lodash';\n\nimport {LiveSearch, LiveSearchCssClasses, FilterLiveSearchOptions} from '../../../interfaces';\nimport {SelectPluginInstances, SelectBus} from '../../../misc/classes';\nimport {CopyOptionsAsSignal} from '../../../decorators';\nimport {LIVE_SEARCH_OPTIONS} from '../../../misc/tokens';\n\nconst defaultOptions: FilterLiveSearchOptions<LiveSearchCssClasses> =\n{\n searchDebounceTimeout: 280,\n texts:\n {\n searchPlaceholder: 'filter options',\n },\n cssClasses:\n {\n componentElement: 'live-search-component',\n },\n};\n\n/**\n * Live search component used for filtering listed options\n */\n@Component(\n{\n selector: 'filter-live-search',\n templateUrl: 'filterLiveSearch.component.html',\n host:\n {\n '[class]': 'options.cssClasses.componentElement',\n },\n imports:\n [\n FormField,\n LocalizePipe,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FilterLiveSearch<TValue = unknown, TPublicValue = TValue> implements LiveSearch<TValue, TPublicValue, FilterLiveSearchOptions<LiveSearchCssClasses>>\n{\n //######################### protected fields #########################\n\n /**\n * Indication whether input search value is empty\n */\n protected emptyInputSignal: WritableSignal<boolean> = signal(true);\n\n //######################### protected properties - template bindings #########################\n\n /**\n * Instance of form value\n */\n protected value;\n\n //######################### public properties - implementation of SelectPlugin #########################\n\n /**\n * @inheritdoc\n */\n @CopyOptionsAsSignal()\n public options: FilterLiveSearchOptions<LiveSearchCssClasses>;\n\n /**\n * @inheritdoc\n */\n public selectPlugins: SelectPluginInstances<TValue, TPublicValue> = inject(SelectPluginInstances);\n\n /**\n * @inheritdoc\n */\n public pluginElement: ElementRef<HTMLElement> = inject(ElementRef);\n\n /**\n * @inheritdoc\n */\n public selectBus: SelectBus<TValue, TPublicValue> = inject(SelectBus);\n\n //######################### public properties - implementation of LiveSearch #########################\n\n /**\n * @inheritdoc\n */\n public readonly search: Signal<string>;\n\n /**\n * @inheritdoc\n */\n public get emptyInput(): Signal<boolean>\n {\n return this.emptyInputSignal.asReadonly();\n }\n\n //######################### constructor #########################\n constructor(@Inject(LIVE_SEARCH_OPTIONS) @Optional() options?: RecursivePartial<FilterLiveSearchOptions<LiveSearchCssClasses>>|null,)\n {\n this.options = deepCopyWithArrayOverride(defaultOptions as FilterLiveSearchOptions<LiveSearchCssClasses>,\n options);\n\n this.value = form(signal(''), path => debounce(path, this.options.searchDebounceTimeout));\n\n this.search = computed(() =>\n {\n return this.value().value();\n });\n\n const ref = afterRenderEffect(() =>\n {\n if(this.pluginElement.nativeElement.parentElement?.nodeName == 'NG-SELECT')\n {\n this.pluginElement.nativeElement.remove();\n }\n\n ref.destroy();\n });\n }\n\n //######################### public methods - implementation of LiveSearch #########################\n\n /**\n * @inheritdoc\n */\n public focus(): void\n {\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Handles input event on search input\n * @param event - Event that occured\n */\n protected input(event: Event): void\n {\n this.emptyInputSignal.set((event.target as HTMLInputElement).value.length == 0);\n }\n}\n","<input type=\"text\" [placeholder]=\"options.texts.searchPlaceholder | localize\" [formField]=\"value\">"]}
@@ -29,11 +29,13 @@ export class NoLiveSearch {
29
29
  /**
30
30
  * @inheritdoc
31
31
  */
32
- this.search = signal('', ...(ngDevMode ? [{ debugName: "search" }] : []));
32
+ this.search = signal('', /* @ts-ignore */
33
+ ...(ngDevMode ? [{ debugName: "search" }] : /* istanbul ignore next */ []));
33
34
  /**
34
35
  * @inheritdoc
35
36
  */
36
- this.emptyInput = signal(true, ...(ngDevMode ? [{ debugName: "emptyInput" }] : []));
37
+ this.emptyInput = signal(true, /* @ts-ignore */
38
+ ...(ngDevMode ? [{ debugName: "emptyInput" }] : /* istanbul ignore next */ []));
37
39
  }
38
40
  //######################### public methods - implementation of LiveSearch #########################
39
41
  /**
@@ -41,14 +43,14 @@ export class NoLiveSearch {
41
43
  */
42
44
  focus() {
43
45
  }
44
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NoLiveSearch, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
45
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.5", type: NoLiveSearch, isStandalone: true, selector: "no-live-search", host: { properties: { "class": "options.cssClasses.componentElement" } }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
46
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NoLiveSearch, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
47
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.4", type: NoLiveSearch, isStandalone: true, selector: "no-live-search", host: { properties: { "class": "options.cssClasses.componentElement" } }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
46
48
  }
47
49
  __decorate([
48
50
  CopyOptionsAsSignal(),
49
51
  __metadata("design:type", Object)
50
52
  ], NoLiveSearch.prototype, "options", void 0);
51
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NoLiveSearch, decorators: [{
53
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NoLiveSearch, decorators: [{
52
54
  type: Component,
53
55
  args: [{
54
56
  selector: 'no-live-search',
@@ -1 +1 @@
1
- {"version":3,"file":"noLiveSearch.component.js","sourceRoot":"","sources":["../../../../../src/plugins/liveSearch/noLiveSearch/noLiveSearch.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,uBAAuB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAU,MAAM,EAAC,MAAM,eAAe,CAAC;AAGrG,OAAO,EAAC,qBAAqB,EAAE,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;;AAExD;;GAEG;AAWH,MAAM,OAAO,YAAY;IAVzB;QAYI,wGAAwG;QAExG;;WAEG;QAEI,YAAO,GAAsB,EAAC,UAAU,EAAE,EAAC,gBAAgB,EAAE,uBAAuB,EAAC,EAAE,qBAAqB,EAAE,CAAC,EAAC,CAAC;QAExH;;WAEG;QACI,kBAAa,GAAgD,MAAM,CAAC,qBAAqB,CAAC,CAAC;QAElG;;WAEG;QACI,kBAAa,GAA4B,MAAM,CAAC,UAAU,CAAC,CAAC;QAEnE;;WAEG;QACI,cAAS,GAAoC,MAAM,CAAC,SAAS,CAAC,CAAC;QAEtE,sGAAsG;QAEtG;;WAEG;QACa,WAAM,GAAmB,MAAM,CAAC,EAAE,kDAAC,CAAC;QAEpD;;WAEG;QACa,eAAU,GAAoB,MAAM,CAAC,IAAI,sDAAC,CAAC;KAU9D;IARG,mGAAmG;IAEnG;;OAEG;IACI,KAAK;IAEZ,CAAC;8GA5CQ,YAAY;kGAAZ,YAAY,oJAPX,EAAE;;AAeL;IADN,mBAAmB,EAAE;;6CACkG;2FAR/G,YAAY;kBAVxB,SAAS;mBACV;oBACI,QAAQ,EAAE,gBAAgB;oBAC1B,QAAQ,EAAE,EAAE;oBACZ,IAAI,EACJ;wBACI,SAAS,EAAE,qCAAqC;qBACnD;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAClD","sourcesContent":["import {ChangeDetectionStrategy, Component, ElementRef, inject, Signal, signal} from '@angular/core';\n\nimport {LiveSearch, LiveSearchOptions} from '../../../interfaces';\nimport {SelectPluginInstances, SelectBus} from '../../../misc/classes';\nimport {CopyOptionsAsSignal} from '../../../decorators';\n\n/**\n * Component used for no live search\n */\n@Component(\n{\n selector: 'no-live-search',\n template: '',\n host:\n {\n '[class]': 'options.cssClasses.componentElement',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NoLiveSearch<TValue = unknown, TPublicValue = TValue> implements LiveSearch<TValue, TPublicValue, LiveSearchOptions>\n{\n //######################### public properties - implementation of SelectPlugin #########################\n\n /**\n * @inheritdoc\n */\n @CopyOptionsAsSignal()\n public options: LiveSearchOptions = {cssClasses: {componentElement: 'live-search-component'}, searchDebounceTimeout: 0};\n\n /**\n * @inheritdoc\n */\n public selectPlugins: SelectPluginInstances<TValue, TPublicValue> = inject(SelectPluginInstances);\n\n /**\n * @inheritdoc\n */\n public pluginElement: ElementRef<HTMLElement> = inject(ElementRef);\n\n /**\n * @inheritdoc\n */\n public selectBus: SelectBus<TValue, TPublicValue> = inject(SelectBus);\n\n //######################### public properties - implementation of LiveSearch #########################\n\n /**\n * @inheritdoc\n */\n public readonly search: Signal<string> = signal('');\n\n /**\n * @inheritdoc\n */\n public readonly emptyInput: Signal<boolean> = signal(true);\n\n //######################### public methods - implementation of LiveSearch #########################\n\n /**\n * @inheritdoc\n */\n public focus(): void\n {\n }\n}\n"]}
1
+ {"version":3,"file":"noLiveSearch.component.js","sourceRoot":"","sources":["../../../../../src/plugins/liveSearch/noLiveSearch/noLiveSearch.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,uBAAuB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAU,MAAM,EAAC,MAAM,eAAe,CAAC;AAGrG,OAAO,EAAC,qBAAqB,EAAE,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;;AAExD;;GAEG;AAWH,MAAM,OAAO,YAAY;IAVzB;QAYI,wGAAwG;QAExG;;WAEG;QAEI,YAAO,GAAsB,EAAC,UAAU,EAAE,EAAC,gBAAgB,EAAE,uBAAuB,EAAC,EAAE,qBAAqB,EAAE,CAAC,EAAC,CAAC;QAExH;;WAEG;QACI,kBAAa,GAAgD,MAAM,CAAC,qBAAqB,CAAC,CAAC;QAElG;;WAEG;QACI,kBAAa,GAA4B,MAAM,CAAC,UAAU,CAAC,CAAC;QAEnE;;WAEG;QACI,cAAS,GAAoC,MAAM,CAAC,SAAS,CAAC,CAAC;QAEtE,sGAAsG;QAEtG;;WAEG;QACa,WAAM,GAAmB,MAAM,CAAC,EAAE;mFAAC,CAAC;QAEpD;;WAEG;QACa,eAAU,GAAoB,MAAM,CAAC,IAAI;uFAAC,CAAC;KAU9D;IARG,mGAAmG;IAEnG;;OAEG;IACI,KAAK;IAEZ,CAAC;8GA5CQ,YAAY;kGAAZ,YAAY,oJAPX,EAAE;;AAeL;IADN,mBAAmB,EAAE;;6CACkG;2FAR/G,YAAY;kBAVxB,SAAS;mBACV;oBACI,QAAQ,EAAE,gBAAgB;oBAC1B,QAAQ,EAAE,EAAE;oBACZ,IAAI,EACJ;wBACI,SAAS,EAAE,qCAAqC;qBACnD;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAClD","sourcesContent":["import {ChangeDetectionStrategy, Component, ElementRef, inject, Signal, signal} from '@angular/core';\n\nimport {LiveSearch, LiveSearchOptions} from '../../../interfaces';\nimport {SelectPluginInstances, SelectBus} from '../../../misc/classes';\nimport {CopyOptionsAsSignal} from '../../../decorators';\n\n/**\n * Component used for no live search\n */\n@Component(\n{\n selector: 'no-live-search',\n template: '',\n host:\n {\n '[class]': 'options.cssClasses.componentElement',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NoLiveSearch<TValue = unknown, TPublicValue = TValue> implements LiveSearch<TValue, TPublicValue, LiveSearchOptions>\n{\n //######################### public properties - implementation of SelectPlugin #########################\n\n /**\n * @inheritdoc\n */\n @CopyOptionsAsSignal()\n public options: LiveSearchOptions = {cssClasses: {componentElement: 'live-search-component'}, searchDebounceTimeout: 0};\n\n /**\n * @inheritdoc\n */\n public selectPlugins: SelectPluginInstances<TValue, TPublicValue> = inject(SelectPluginInstances);\n\n /**\n * @inheritdoc\n */\n public pluginElement: ElementRef<HTMLElement> = inject(ElementRef);\n\n /**\n * @inheritdoc\n */\n public selectBus: SelectBus<TValue, TPublicValue> = inject(SelectBus);\n\n //######################### public properties - implementation of LiveSearch #########################\n\n /**\n * @inheritdoc\n */\n public readonly search: Signal<string> = signal('');\n\n /**\n * @inheritdoc\n */\n public readonly emptyInput: Signal<boolean> = signal(true);\n\n //######################### public methods - implementation of LiveSearch #########################\n\n /**\n * @inheritdoc\n */\n public focus(): void\n {\n }\n}\n"]}
@@ -60,12 +60,15 @@ export class EditNormalState {
60
60
  return [];
61
61
  }
62
62
  return selectedOptions;
63
- }, ...(ngDevMode ? [{ debugName: "selectedOptionsMultiple" }] : []));
63
+ }, /* @ts-ignore */
64
+ ...(ngDevMode ? [{ debugName: "selectedOptionsMultiple" }] : /* istanbul ignore next */ []));
64
65
  this.showValue = computed(() => ((hasValue(this.selectBus.selectedOptions()) || !this.selectBus.selectOptions().multiple) &&
65
66
  (this.selectPlugins.liveSearch()?.emptyInput() || this.selectBus.selectOptions().multiple)) ||
66
- (!this.selectBus.selectOptions().multiple && !hasValue(this.selectBus.selectedOptions()) && !this.selectPlugins.liveSearch()?.emptyInput()), ...(ngDevMode ? [{ debugName: "showValue" }] : []));
67
+ (!this.selectBus.selectOptions().multiple && !hasValue(this.selectBus.selectedOptions()) && !this.selectPlugins.liveSearch()?.emptyInput()), /* @ts-ignore */
68
+ ...(ngDevMode ? [{ debugName: "showValue" }] : /* istanbul ignore next */ []));
67
69
  this.cssClasses = computed(() => [this.options.cssClasses.value,
68
- ...(this.selectBus.selectOptions().multiple ? [...this.options.cssClasses.valueMultiple.split(' ')] : [...this.options.cssClasses.valueSingle.split(' ')])], ...(ngDevMode ? [{ debugName: "cssClasses" }] : []));
70
+ ...(this.selectBus.selectOptions().multiple ? [...this.options.cssClasses.valueMultiple.split(' ')] : [...this.options.cssClasses.valueSingle.split(' ')])], /* @ts-ignore */
71
+ ...(ngDevMode ? [{ debugName: "cssClasses" }] : /* istanbul ignore next */ []));
69
72
  }
70
73
  //######################### public methods - implementation of LiveSearch #########################
71
74
  /**
@@ -125,14 +128,14 @@ export class EditNormalState {
125
128
  data: option,
126
129
  });
127
130
  }
128
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: EditNormalState, deps: [{ token: NORMAL_STATE_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
129
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: EditNormalState, isStandalone: true, selector: "edit-normal-state", host: { properties: { "class": "options.cssClasses.componentElement", "class.disabled": "!!selectBus.selectOptions().readonly" } }, viewQueries: [{ propertyName: "liveSearchPlaceholder", first: true, predicate: ["liveSearchPlaceholder"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<ng-template #defaultSingleLook=\"normalStateTemplate\" normalStateTemplate>{{selectBus.selectedOptions() | displayValue: '' | localize}}</ng-template>\n<ng-template #defaultMultipleLook=\"normalStateTagTemplate\" normalStateTagTemplate let-option let-normalState=\"normalState\">\n <div [class]=\"options.cssClasses.tag\">\n <span>{{option | displayValue | localize}}</span>\n <button type=\"button\" (click)=\"optionClick(option)\" tabindex=\"-1\" aria-hidden=\"true\">\n <span>x</span>\n </button>\n </div>\n</ng-template>\n\n<div [class]=\"options.cssClasses.valueWrapper\">\n @if(showValue())\n {\n <div [class]=\"cssClasses()\">\n @if(!selectBus.selectOptions().multiple)\n {\n <ng-container *ngTemplateOutlet=\"selectBus.selectOptions().templateGatherer.normalStateTemplate() || defaultSingleLook.template; context: {$implicit: $any(this)}\"/>\n }\n @else\n {\n @for(option of selectedOptionsMultiple(); track option)\n {\n <ng-container *ngTemplateOutlet=\"selectBus.selectOptions().templateGatherer.normalStateTagTemplate() || defaultMultipleLook.template; context: {$implicit: option, normalState: this}\"/>\n }\n }\n </div>\n }\n\n <ng-container #liveSearchPlaceholder/>\n</div>\n\n@if(options.cancelValue && (selectBus.selectedOptions() | hasValue))\n{\n <button type=\"button\"\n [disabled]=\"!!selectBus.selectOptions().readonly\"\n [class]=\"options.cssClasses.cancel\" \n [tooltip]=\"options.texts.cancelTitle | localize\" \n [attr.aria-label]=\"options.texts.cancelTitle | localize\"\n (focus)=\"handleFocus()\" \n (blur)=\"blur()\" \n (click)=\"cancel()\">\n <span [class]=\"options.cssClasses.cancelIcon\"></span>\n </button>\n}\n\n@if(options.carret)\n{\n <button type=\"button\" [disabled]=\"!!selectBus.selectOptions().readonly\" (click)=\"click(); selectBus.setFocus()\" (focus)=\"handleFocus()\" (blur)=\"blur()\" tabindex=\"-1\" aria-hidden=\"true\">\n <span [class]=\"options.cssClasses.carret\"></span>\n </button>\n}", dependencies: [{ kind: "directive", type: TooltipDirective, selector: "[tooltip]", inputs: ["tooltip", "allowHtml", "template", "tooltipOptions", "tooltipVisible", "containerElement"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NormalStateTemplate, selector: "[normalStateTemplate]", exportAs: ["normalStateTemplate", ""] }, { kind: "directive", type: NormalStateTagTemplate, selector: "[normalStateTagTemplate]", exportAs: ["normalStateTagTemplate", ""] }, { kind: "pipe", type: HasValue, name: "hasValue" }, { kind: "pipe", type: DisplayValue, name: "displayValue" }, { kind: "pipe", type: LocalizePipe, name: "localize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
131
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: EditNormalState, deps: [{ token: NORMAL_STATE_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
132
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: EditNormalState, isStandalone: true, selector: "edit-normal-state", host: { properties: { "class": "options.cssClasses.componentElement", "class.disabled": "!!selectBus.selectOptions().readonly" } }, viewQueries: [{ propertyName: "liveSearchPlaceholder", first: true, predicate: ["liveSearchPlaceholder"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<ng-template #defaultSingleLook=\"normalStateTemplate\" normalStateTemplate>{{selectBus.selectedOptions() | displayValue: '' | localize}}</ng-template>\n<ng-template #defaultMultipleLook=\"normalStateTagTemplate\" normalStateTagTemplate let-option let-normalState=\"normalState\">\n <div [class]=\"options.cssClasses.tag\">\n <span>{{option | displayValue | localize}}</span>\n <button type=\"button\" (click)=\"optionClick(option)\" tabindex=\"-1\" aria-hidden=\"true\">\n <span>x</span>\n </button>\n </div>\n</ng-template>\n\n<div [class]=\"options.cssClasses.valueWrapper\">\n @if(showValue())\n {\n <div [class]=\"cssClasses()\">\n @if(!selectBus.selectOptions().multiple)\n {\n <ng-container *ngTemplateOutlet=\"selectBus.selectOptions().templateGatherer.normalStateTemplate() || defaultSingleLook.template; context: {$implicit: $any(this)}\"/>\n }\n @else\n {\n @for(option of selectedOptionsMultiple(); track option)\n {\n <ng-container *ngTemplateOutlet=\"selectBus.selectOptions().templateGatherer.normalStateTagTemplate() || defaultMultipleLook.template; context: {$implicit: option, normalState: this}\"/>\n }\n }\n </div>\n }\n\n <ng-container #liveSearchPlaceholder/>\n</div>\n\n@if(options.cancelValue && (selectBus.selectedOptions() | hasValue))\n{\n <button type=\"button\"\n [disabled]=\"!!selectBus.selectOptions().readonly\"\n [class]=\"options.cssClasses.cancel\" \n [tooltip]=\"options.texts.cancelTitle | localize\" \n [attr.aria-label]=\"options.texts.cancelTitle | localize\"\n (focus)=\"handleFocus()\" \n (blur)=\"blur()\" \n (click)=\"cancel()\">\n <span [class]=\"options.cssClasses.cancelIcon\"></span>\n </button>\n}\n\n@if(options.carret)\n{\n <button type=\"button\" [disabled]=\"!!selectBus.selectOptions().readonly\" (click)=\"click(); selectBus.setFocus()\" (focus)=\"handleFocus()\" (blur)=\"blur()\" tabindex=\"-1\" aria-hidden=\"true\">\n <span [class]=\"options.cssClasses.carret\"></span>\n </button>\n}", dependencies: [{ kind: "directive", type: TooltipDirective, selector: "[tooltip]", inputs: ["tooltip", "allowHtml", "template", "tooltipOptions", "tooltipVisible", "containerElement"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NormalStateTemplate, selector: "[normalStateTemplate]", exportAs: ["normalStateTemplate", ""] }, { kind: "directive", type: NormalStateTagTemplate, selector: "[normalStateTagTemplate]", exportAs: ["normalStateTagTemplate", ""] }, { kind: "pipe", type: HasValue, name: "hasValue" }, { kind: "pipe", type: DisplayValue, name: "displayValue" }, { kind: "pipe", type: LocalizePipe, name: "localize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
130
133
  }
131
134
  __decorate([
132
135
  CopyOptionsAsSignal(),
133
136
  __metadata("design:type", Object)
134
137
  ], EditNormalState.prototype, "options", void 0);
135
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: EditNormalState, decorators: [{
138
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: EditNormalState, decorators: [{
136
139
  type: Component,
137
140
  args: [{ selector: 'edit-normal-state', host: {
138
141
  '[class]': 'options.cssClasses.componentElement',
@@ -1 +1 @@
1
- {"version":3,"file":"editNormalState.component.js","sourceRoot":"","sources":["../../../../../src/plugins/normalState/editNormalState/editNormalState.component.ts","../../../../../src/plugins/normalState/editNormalState/editNormalState.component.html"],"names":[],"mappings":";AAAA,OAAO,EAAC,uBAAuB,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,QAA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ClC;YACI,MAAM,EAAE,IAAoB;YAC5B,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,aAAa;YAC/C,IAAI,EAAE,IAAI;SACb,CAAC,CAAC;IACP,CAAC;IAED;;;OAGG;IACO,WAAW,CAAC,MAAiC;QAEnD,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAClC;YACI,MAAM,EAAE,IAAoB;YAC5B,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,aAAa;YAC/C,IAAI,EAAE,MAAM;SACf,CAAC,CAAC;IACP,CAAC;8GAxJQ,eAAe,kBAkDJ,oBAAoB;kGAlD/B,eAAe,4TA+C8F,UAAU,6CC7GpI,ktEAkDC,4CDKO,gBAAgB,4JAChB,gBAAgB,oJAChB,mBAAmB,yGACnB,sBAAsB,0GANtB,QAAQ,4CACR,YAAY,gDACZ,YAAY;;AAgBT;IADN,mBAAmB,EAAE;;gDAC4C;2FARzD,eAAe;kBArB3B,SAAS;+BAEI,mBAAmB,QAG7B;wBACI,SAAS,EAAE,qCAAqC;wBAChD,kBAAkB,EAAE,sCAAsC;qBAC7D,WAED;wBACI,QAAQ;wBACR,YAAY;wBACZ,YAAY;wBACZ,gBAAgB;wBAChB,gBAAgB;wBAChB,mBAAmB;wBACnB,sBAAsB;qBACzB,mBACgB,uBAAuB,CAAC,MAAM;;0BAoDlC,MAAM;2BAAC,oBAAoB;;0BAAG,QAAQ;2GAHmC,uBAAuB,OAAE,EAAC,IAAI,EAAE,UAAU,EAAC","sourcesContent":["import {ChangeDetectionStrategy, Component, computed, effect, ElementRef, Inject, inject, Optional, Signal, viewChild} from '@angular/core';\nimport {NgTemplateOutlet} from '@angular/common';\nimport {LocalizePipe, TooltipDirective} from '@anglr/common';\nimport {RecursivePartial} from '@jscrpt/common';\nimport {deepCopyWithArrayOverride} from '@jscrpt/common/lodash';\n\nimport {NormalState, EditNormalStateOptions, SelectPlugin, EditNormalStateCssClasses, SelectOptionState} from '../../../interfaces';\nimport {SelectPluginInstances, SelectBus} from '../../../misc/classes';\nimport {CopyOptionsAsSignal} from '../../../decorators';\nimport {NORMAL_STATE_OPTIONS} from '../../../misc/tokens';\nimport {DisplayValue, HasValue} from '../../../pipes';\nimport {NormalStateTagTemplate, NormalStateTemplate} from '../../../directives';\nimport {hasValue} from '../../../misc/utils';\n\n//TODO: improvement, carret direction\n\nconst defaultOptions: EditNormalStateOptions<EditNormalStateCssClasses> =\n{\n cancelValue: true,\n carret: true,\n texts:\n {\n cancelTitle: 'cancel selected values',\n },\n cssClasses:\n {\n componentElement: 'normal-state-component',\n value: 'normal-state-value',\n tag: 'select-tag',\n carret: 'fas fa-caret-down select-align-self-center',\n cancel: 'normal-state-cancel',\n cancelIcon: 'fas fa-times select-align-self-center',\n valueWrapper: 'select-relative select-flex-1 select-flex-row select-normal-state-gap',\n valueMultiple: 'select-normal-state-gap select-flex-row',\n valueSingle: 'select-flex-1',\n },\n};\n\n/**\n * Simple normal state displaying value as 'button' that opens popup with options when clicked.\n */\n@Component(\n{\n selector: 'edit-normal-state',\n templateUrl: 'editNormalState.component.html',\n host:\n {\n '[class]': 'options.cssClasses.componentElement',\n '[class.disabled]': '!!selectBus.selectOptions().readonly',\n },\n imports:\n [\n HasValue,\n DisplayValue,\n LocalizePipe,\n TooltipDirective,\n NgTemplateOutlet,\n NormalStateTemplate,\n NormalStateTagTemplate,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class EditNormalState<TValue = unknown, TPublicValue = TValue> implements NormalState<TValue, TPublicValue, EditNormalStateOptions<EditNormalStateCssClasses>>\n{\n //######################### public properties - implementation of SelectPlugin #########################\n\n /**\n * @inheritdoc\n */\n @CopyOptionsAsSignal()\n public options: EditNormalStateOptions<EditNormalStateCssClasses>;\n\n /**\n * @inheritdoc\n */\n public selectPlugins: SelectPluginInstances<TValue, TPublicValue> = inject(SelectPluginInstances);\n\n /**\n * @inheritdoc\n */\n public pluginElement: ElementRef<HTMLElement> = inject(ElementRef);\n\n /**\n * @inheritdoc\n */\n public selectBus: SelectBus<TValue, TPublicValue> = inject(SelectBus);\n\n //######################### protected properties - template bindings #########################\n\n /**\n * Instance of selected options for multiple select\n */\n protected selectedOptionsMultiple: Signal<SelectOptionState<TValue>[]>;\n\n /**\n * Indication whether show value\n */\n protected showValue: Signal<boolean>;\n\n /**\n * Css classes applied to value element\n */\n protected cssClasses: Signal<string[]>;\n\n //######################### protected properties - children #########################\n\n /**\n * Instance of element that is used as placeholder for live search\n */\n protected liveSearchPlaceholder: Signal<ElementRef<HTMLElement>> = viewChild.required('liveSearchPlaceholder', {read: ElementRef});\n\n //######################### constructor #########################\n constructor(@Inject(NORMAL_STATE_OPTIONS) @Optional() options?: RecursivePartial<EditNormalStateOptions<EditNormalStateCssClasses>>|null,)\n {\n this.options = deepCopyWithArrayOverride(defaultOptions as EditNormalStateOptions<EditNormalStateCssClasses>,\n options);\n\n effect(() => this.liveSearchPlaceholder().nativeElement.after(this.selectPlugins.LiveSearch.pluginElement.nativeElement));\n\n this.selectedOptionsMultiple = computed(() =>\n {\n const selectedOptions = this.selectBus.selectedOptions();\n\n if(!this.selectBus.selectOptions().multiple || !Array.isArray(selectedOptions))\n {\n return [];\n }\n\n return selectedOptions;\n });\n\n this.showValue = computed(() => ((hasValue(this.selectBus.selectedOptions()) || !this.selectBus.selectOptions().multiple) &&\n (this.selectPlugins.liveSearch()?.emptyInput() || this.selectBus.selectOptions().multiple)) ||\n (!this.selectBus.selectOptions().multiple && !hasValue(this.selectBus.selectedOptions()) && !this.selectPlugins.liveSearch()?.emptyInput()));\n\n this.cssClasses = computed(() => [this.options.cssClasses.value,\n ...(this.selectBus.selectOptions().multiple ? [...this.options.cssClasses.valueMultiple.split(' ')] : [...this.options.cssClasses.valueSingle.split(' ')])]);\n }\n\n //######################### public methods - implementation of LiveSearch #########################\n\n /**\n * @inheritdoc\n */\n public focus(): void\n {\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Handles click event\n */\n protected click(): void\n {\n this.selectBus.click.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n }\n\n /**\n * Handles focus event\n */\n protected handleFocus(): void\n {\n this.selectBus.internalsFocus.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n }\n\n /**\n * Handles blur event\n */\n protected blur(): void\n {\n this.selectBus.internalsBlur.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n }\n\n /**\n * Handles cancel value\n */\n protected cancel(): void\n {\n this.selectBus.optionActivate.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n }\n\n /**\n * Handles option click\n * @param option - Option that was clicked\n */\n protected optionClick(option: SelectOptionState<TValue>): void\n {\n this.selectBus.optionActivate.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: option,\n });\n }\n}\n","<ng-template #defaultSingleLook=\"normalStateTemplate\" normalStateTemplate>{{selectBus.selectedOptions() | displayValue: '' | localize}}</ng-template>\n<ng-template #defaultMultipleLook=\"normalStateTagTemplate\" normalStateTagTemplate let-option let-normalState=\"normalState\">\n <div [class]=\"options.cssClasses.tag\">\n <span>{{option | displayValue | localize}}</span>\n <button type=\"button\" (click)=\"optionClick(option)\" tabindex=\"-1\" aria-hidden=\"true\">\n <span>x</span>\n </button>\n </div>\n</ng-template>\n\n<div [class]=\"options.cssClasses.valueWrapper\">\n @if(showValue())\n {\n <div [class]=\"cssClasses()\">\n @if(!selectBus.selectOptions().multiple)\n {\n <ng-container *ngTemplateOutlet=\"selectBus.selectOptions().templateGatherer.normalStateTemplate() || defaultSingleLook.template; context: {$implicit: $any(this)}\"/>\n }\n @else\n {\n @for(option of selectedOptionsMultiple(); track option)\n {\n <ng-container *ngTemplateOutlet=\"selectBus.selectOptions().templateGatherer.normalStateTagTemplate() || defaultMultipleLook.template; context: {$implicit: option, normalState: this}\"/>\n }\n }\n </div>\n }\n\n <ng-container #liveSearchPlaceholder/>\n</div>\n\n@if(options.cancelValue && (selectBus.selectedOptions() | hasValue))\n{\n <button type=\"button\"\n [disabled]=\"!!selectBus.selectOptions().readonly\"\n [class]=\"options.cssClasses.cancel\" \n [tooltip]=\"options.texts.cancelTitle | localize\" \n [attr.aria-label]=\"options.texts.cancelTitle | localize\"\n (focus)=\"handleFocus()\" \n (blur)=\"blur()\" \n (click)=\"cancel()\">\n <span [class]=\"options.cssClasses.cancelIcon\"></span>\n </button>\n}\n\n@if(options.carret)\n{\n <button type=\"button\" [disabled]=\"!!selectBus.selectOptions().readonly\" (click)=\"click(); selectBus.setFocus()\" (focus)=\"handleFocus()\" (blur)=\"blur()\" tabindex=\"-1\" aria-hidden=\"true\">\n <span [class]=\"options.cssClasses.carret\"></span>\n </button>\n}"]}
1
+ {"version":3,"file":"editNormalState.component.js","sourceRoot":"","sources":["../../../../../src/plugins/normalState/editNormalState/editNormalState.component.ts","../../../../../src/plugins/normalState/editNormalState/editNormalState.component.html"],"names":[],"mappings":";AAAA,OAAO,EAAC,uBAAuB,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAU,SAAS,EAAC,MAAM,eAAe,CAAC;AAC5I,OAAO,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAC,YAAY,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAE7D,OAAO,EAAC,yBAAyB,EAAC,MAAM,uBAAuB,CAAC;AAGhE,OAAO,EAAC,qBAAqB,EAAE,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAC,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAC,sBAA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,mBAAmB,yGACnB,sBAAsB,0GANtB,QAAQ,4CACR,YAAY,gDACZ,YAAY;;AAgBT;IADN,mBAAmB,EAAE;;gDAC4C;2FARzD,eAAe;kBArB3B,SAAS;+BAEI,mBAAmB,QAG7B;wBACI,SAAS,EAAE,qCAAqC;wBAChD,kBAAkB,EAAE,sCAAsC;qBAC7D,WAED;wBACI,QAAQ;wBACR,YAAY;wBACZ,YAAY;wBACZ,gBAAgB;wBAChB,gBAAgB;wBAChB,mBAAmB;wBACnB,sBAAsB;qBACzB,mBACgB,uBAAuB,CAAC,MAAM;;0BAoDlC,MAAM;2BAAC,oBAAoB;;0BAAG,QAAQ;2GAHmC,uBAAuB,OAAE,EAAC,IAAI,EAAE,UAAU,EAAC","sourcesContent":["import {ChangeDetectionStrategy, Component, computed, effect, ElementRef, Inject, inject, Optional, Signal, viewChild} from '@angular/core';\nimport {NgTemplateOutlet} from '@angular/common';\nimport {LocalizePipe, TooltipDirective} from '@anglr/common';\nimport {RecursivePartial} from '@jscrpt/common';\nimport {deepCopyWithArrayOverride} from '@jscrpt/common/lodash';\n\nimport {NormalState, EditNormalStateOptions, SelectPlugin, EditNormalStateCssClasses, SelectOptionState} from '../../../interfaces';\nimport {SelectPluginInstances, SelectBus} from '../../../misc/classes';\nimport {CopyOptionsAsSignal} from '../../../decorators';\nimport {NORMAL_STATE_OPTIONS} from '../../../misc/tokens';\nimport {DisplayValue, HasValue} from '../../../pipes';\nimport {NormalStateTagTemplate, NormalStateTemplate} from '../../../directives';\nimport {hasValue} from '../../../misc/utils';\n\n//TODO: improvement, carret direction\n\nconst defaultOptions: EditNormalStateOptions<EditNormalStateCssClasses> =\n{\n cancelValue: true,\n carret: true,\n texts:\n {\n cancelTitle: 'cancel selected values',\n },\n cssClasses:\n {\n componentElement: 'normal-state-component',\n value: 'normal-state-value',\n tag: 'select-tag',\n carret: 'fas fa-caret-down select-align-self-center',\n cancel: 'normal-state-cancel',\n cancelIcon: 'fas fa-times select-align-self-center',\n valueWrapper: 'select-relative select-flex-1 select-flex-row select-normal-state-gap',\n valueMultiple: 'select-normal-state-gap select-flex-row',\n valueSingle: 'select-flex-1',\n },\n};\n\n/**\n * Simple normal state displaying value as 'button' that opens popup with options when clicked.\n */\n@Component(\n{\n selector: 'edit-normal-state',\n templateUrl: 'editNormalState.component.html',\n host:\n {\n '[class]': 'options.cssClasses.componentElement',\n '[class.disabled]': '!!selectBus.selectOptions().readonly',\n },\n imports:\n [\n HasValue,\n DisplayValue,\n LocalizePipe,\n TooltipDirective,\n NgTemplateOutlet,\n NormalStateTemplate,\n NormalStateTagTemplate,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class EditNormalState<TValue = unknown, TPublicValue = TValue> implements NormalState<TValue, TPublicValue, EditNormalStateOptions<EditNormalStateCssClasses>>\n{\n //######################### public properties - implementation of SelectPlugin #########################\n\n /**\n * @inheritdoc\n */\n @CopyOptionsAsSignal()\n public options: EditNormalStateOptions<EditNormalStateCssClasses>;\n\n /**\n * @inheritdoc\n */\n public selectPlugins: SelectPluginInstances<TValue, TPublicValue> = inject(SelectPluginInstances);\n\n /**\n * @inheritdoc\n */\n public pluginElement: ElementRef<HTMLElement> = inject(ElementRef);\n\n /**\n * @inheritdoc\n */\n public selectBus: SelectBus<TValue, TPublicValue> = inject(SelectBus);\n\n //######################### protected properties - template bindings #########################\n\n /**\n * Instance of selected options for multiple select\n */\n protected selectedOptionsMultiple: Signal<SelectOptionState<TValue>[]>;\n\n /**\n * Indication whether show value\n */\n protected showValue: Signal<boolean>;\n\n /**\n * Css classes applied to value element\n */\n protected cssClasses: Signal<string[]>;\n\n //######################### protected properties - children #########################\n\n /**\n * Instance of element that is used as placeholder for live search\n */\n protected liveSearchPlaceholder: Signal<ElementRef<HTMLElement>> = viewChild.required('liveSearchPlaceholder', {read: ElementRef});\n\n //######################### constructor #########################\n constructor(@Inject(NORMAL_STATE_OPTIONS) @Optional() options?: RecursivePartial<EditNormalStateOptions<EditNormalStateCssClasses>>|null,)\n {\n this.options = deepCopyWithArrayOverride(defaultOptions as EditNormalStateOptions<EditNormalStateCssClasses>,\n options);\n\n effect(() => this.liveSearchPlaceholder().nativeElement.after(this.selectPlugins.LiveSearch.pluginElement.nativeElement));\n\n this.selectedOptionsMultiple = computed(() =>\n {\n const selectedOptions = this.selectBus.selectedOptions();\n\n if(!this.selectBus.selectOptions().multiple || !Array.isArray(selectedOptions))\n {\n return [];\n }\n\n return selectedOptions;\n });\n\n this.showValue = computed(() => ((hasValue(this.selectBus.selectedOptions()) || !this.selectBus.selectOptions().multiple) &&\n (this.selectPlugins.liveSearch()?.emptyInput() || this.selectBus.selectOptions().multiple)) ||\n (!this.selectBus.selectOptions().multiple && !hasValue(this.selectBus.selectedOptions()) && !this.selectPlugins.liveSearch()?.emptyInput()));\n\n this.cssClasses = computed(() => [this.options.cssClasses.value,\n ...(this.selectBus.selectOptions().multiple ? [...this.options.cssClasses.valueMultiple.split(' ')] : [...this.options.cssClasses.valueSingle.split(' ')])]);\n }\n\n //######################### public methods - implementation of LiveSearch #########################\n\n /**\n * @inheritdoc\n */\n public focus(): void\n {\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Handles click event\n */\n protected click(): void\n {\n this.selectBus.click.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n }\n\n /**\n * Handles focus event\n */\n protected handleFocus(): void\n {\n this.selectBus.internalsFocus.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n }\n\n /**\n * Handles blur event\n */\n protected blur(): void\n {\n this.selectBus.internalsBlur.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n }\n\n /**\n * Handles cancel value\n */\n protected cancel(): void\n {\n this.selectBus.optionActivate.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n }\n\n /**\n * Handles option click\n * @param option - Option that was clicked\n */\n protected optionClick(option: SelectOptionState<TValue>): void\n {\n this.selectBus.optionActivate.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: option,\n });\n }\n}\n","<ng-template #defaultSingleLook=\"normalStateTemplate\" normalStateTemplate>{{selectBus.selectedOptions() | displayValue: '' | localize}}</ng-template>\n<ng-template #defaultMultipleLook=\"normalStateTagTemplate\" normalStateTagTemplate let-option let-normalState=\"normalState\">\n <div [class]=\"options.cssClasses.tag\">\n <span>{{option | displayValue | localize}}</span>\n <button type=\"button\" (click)=\"optionClick(option)\" tabindex=\"-1\" aria-hidden=\"true\">\n <span>x</span>\n </button>\n </div>\n</ng-template>\n\n<div [class]=\"options.cssClasses.valueWrapper\">\n @if(showValue())\n {\n <div [class]=\"cssClasses()\">\n @if(!selectBus.selectOptions().multiple)\n {\n <ng-container *ngTemplateOutlet=\"selectBus.selectOptions().templateGatherer.normalStateTemplate() || defaultSingleLook.template; context: {$implicit: $any(this)}\"/>\n }\n @else\n {\n @for(option of selectedOptionsMultiple(); track option)\n {\n <ng-container *ngTemplateOutlet=\"selectBus.selectOptions().templateGatherer.normalStateTagTemplate() || defaultMultipleLook.template; context: {$implicit: option, normalState: this}\"/>\n }\n }\n </div>\n }\n\n <ng-container #liveSearchPlaceholder/>\n</div>\n\n@if(options.cancelValue && (selectBus.selectedOptions() | hasValue))\n{\n <button type=\"button\"\n [disabled]=\"!!selectBus.selectOptions().readonly\"\n [class]=\"options.cssClasses.cancel\" \n [tooltip]=\"options.texts.cancelTitle | localize\" \n [attr.aria-label]=\"options.texts.cancelTitle | localize\"\n (focus)=\"handleFocus()\" \n (blur)=\"blur()\" \n (click)=\"cancel()\">\n <span [class]=\"options.cssClasses.cancelIcon\"></span>\n </button>\n}\n\n@if(options.carret)\n{\n <button type=\"button\" [disabled]=\"!!selectBus.selectOptions().readonly\" (click)=\"click(); selectBus.setFocus()\" (focus)=\"handleFocus()\" (blur)=\"blur()\" tabindex=\"-1\" aria-hidden=\"true\">\n <span [class]=\"options.cssClasses.carret\"></span>\n </button>\n}"]}
@@ -48,7 +48,8 @@ export class SimpleNormalState {
48
48
  */
49
49
  this.htmlButton = viewChild.required('htmlButton', { read: ElementRef });
50
50
  this.options = deepCopyWithArrayOverride(defaultOptions, options);
51
- this.activeDescendant = computed(() => `${this.selectBus.id}-${this.selectPlugins.optionsHandler()?.listOptions()?.find(option => option.active())?.index}`, ...(ngDevMode ? [{ debugName: "activeDescendant" }] : []));
51
+ this.activeDescendant = computed(() => `${this.selectBus.id}-${this.selectPlugins.optionsHandler()?.listOptions()?.find(option => option.active())?.index}`, /* @ts-ignore */
52
+ ...(ngDevMode ? [{ debugName: "activeDescendant" }] : /* istanbul ignore next */ []));
52
53
  }
53
54
  //######################### public methods - implementation of LiveSearch #########################
54
55
  /**
@@ -98,14 +99,14 @@ export class SimpleNormalState {
98
99
  data: null,
99
100
  });
100
101
  }
101
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: SimpleNormalState, deps: [{ token: NORMAL_STATE_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
102
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: SimpleNormalState, isStandalone: true, selector: "simple-normal-state", host: { properties: { "class": "options.cssClasses.componentElement", "class.disabled": "!!selectBus.selectOptions().readonly" } }, viewQueries: [{ propertyName: "htmlButton", first: true, predicate: ["htmlButton"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<ng-template #defaultLook>{{selectBus.selectedOptions() | displayValue | localize}}</ng-template>\n\n<button #htmlButton\n type=\"button\"\n role=\"combobox\"\n [class]=\"options.cssClasses.element\"\n [disabled]=\"!!selectBus.selectOptions().readonly\"\n [attr.aria-expanded]=\"selectBus.popupVisible()\"\n [attr.aria-controls]=\"selectBus.popupVisible() ? selectBus.id : null\"\n [attr.aria-activedescendant]=\"selectBus.popupVisible() ? activeDescendant() : null\"\n [attr.aria-label]=\"selectBus.selectedOptions() | displayValue | localize\"\n [tooltip]=\"selectBus.selectedOptions() | displayValue | localize\"\n (click)=\"click()\"\n (blur)=\"blur()\"\n (focus)=\"handleFocus()\">\n <span [class]=\"options.cssClasses.value\">\n <ng-container *ngTemplateOutlet=\"selectBus.selectOptions().templateGatherer.normalStateTemplate() || defaultLook; context: {$implicit: this}\"/>\n </span>\n</button>\n\n@if(options.cancelValue && (selectBus.selectedOptions() | hasValue))\n{\n <button type=\"button\" \n [disabled]=\"!!selectBus.selectOptions().readonly\"\n [class]=\"options.cssClasses.cancel\" \n [tooltip]=\"options.texts.cancelTitle | localize\" \n [attr.aria-label]=\"options.texts.cancelTitle | localize\"\n (click)=\"cancel()\" \n (blur)=\"blur()\" \n (focus)=\"handleFocus()\">\n <span [class]=\"options.cssClasses.cancelIcon\"></span>\n </button>\n}\n\n<button type=\"button\" [class]=\"options.cssClasses.carret\" [disabled]=\"!!selectBus.selectOptions().readonly\" (click)=\"click(); selectBus.setFocus()\" (focus)=\"handleFocus()\" (blur)=\"blur()\" tabindex=\"-1\" aria-hidden=\"true\">\n <span [class]=\"options.cssClasses.carretIcon\"></span>\n</button>", dependencies: [{ kind: "directive", type: TooltipDirective, selector: "[tooltip]", inputs: ["tooltip", "allowHtml", "template", "tooltipOptions", "tooltipVisible", "containerElement"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: HasValue, name: "hasValue" }, { kind: "pipe", type: DisplayValue, name: "displayValue" }, { kind: "pipe", type: LocalizePipe, name: "localize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
102
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: SimpleNormalState, deps: [{ token: NORMAL_STATE_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
103
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: SimpleNormalState, isStandalone: true, selector: "simple-normal-state", host: { properties: { "class": "options.cssClasses.componentElement", "class.disabled": "!!selectBus.selectOptions().readonly" } }, viewQueries: [{ propertyName: "htmlButton", first: true, predicate: ["htmlButton"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<ng-template #defaultLook>{{selectBus.selectedOptions() | displayValue | localize}}</ng-template>\n\n<button #htmlButton\n type=\"button\"\n role=\"combobox\"\n [class]=\"options.cssClasses.element\"\n [disabled]=\"!!selectBus.selectOptions().readonly\"\n [attr.aria-expanded]=\"selectBus.popupVisible()\"\n [attr.aria-controls]=\"selectBus.popupVisible() ? selectBus.id : null\"\n [attr.aria-activedescendant]=\"selectBus.popupVisible() ? activeDescendant() : null\"\n [attr.aria-label]=\"selectBus.selectedOptions() | displayValue | localize\"\n [tooltip]=\"selectBus.selectedOptions() | displayValue | localize\"\n (click)=\"click()\"\n (blur)=\"blur()\"\n (focus)=\"handleFocus()\">\n <span [class]=\"options.cssClasses.value\">\n <ng-container *ngTemplateOutlet=\"selectBus.selectOptions().templateGatherer.normalStateTemplate() || defaultLook; context: {$implicit: this}\"/>\n </span>\n</button>\n\n@if(options.cancelValue && (selectBus.selectedOptions() | hasValue))\n{\n <button type=\"button\" \n [disabled]=\"!!selectBus.selectOptions().readonly\"\n [class]=\"options.cssClasses.cancel\" \n [tooltip]=\"options.texts.cancelTitle | localize\" \n [attr.aria-label]=\"options.texts.cancelTitle | localize\"\n (click)=\"cancel()\" \n (blur)=\"blur()\" \n (focus)=\"handleFocus()\">\n <span [class]=\"options.cssClasses.cancelIcon\"></span>\n </button>\n}\n\n<button type=\"button\" [class]=\"options.cssClasses.carret\" [disabled]=\"!!selectBus.selectOptions().readonly\" (click)=\"click(); selectBus.setFocus()\" (focus)=\"handleFocus()\" (blur)=\"blur()\" tabindex=\"-1\" aria-hidden=\"true\">\n <span [class]=\"options.cssClasses.carretIcon\"></span>\n</button>", dependencies: [{ kind: "directive", type: TooltipDirective, selector: "[tooltip]", inputs: ["tooltip", "allowHtml", "template", "tooltipOptions", "tooltipVisible", "containerElement"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: HasValue, name: "hasValue" }, { kind: "pipe", type: DisplayValue, name: "displayValue" }, { kind: "pipe", type: LocalizePipe, name: "localize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
103
104
  }
104
105
  __decorate([
105
106
  CopyOptionsAsSignal(),
106
107
  __metadata("design:type", Object)
107
108
  ], SimpleNormalState.prototype, "options", void 0);
108
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: SimpleNormalState, decorators: [{
109
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: SimpleNormalState, decorators: [{
109
110
  type: Component,
110
111
  args: [{ selector: 'simple-normal-state', host: {
111
112
  '[class]': 'options.cssClasses.componentElement',
@@ -1 +1 @@
1
- {"version":3,"file":"simpleNormalState.component.js","sourceRoot":"","sources":["../../../../../src/plugins/normalState/simpleNormalState/simpleNormalState.component.ts","../../../../../src/plugins/normalState/simpleNormalState/simpleNormalState.component.html"],"names":[],"mappings":";AAAA,OAAO,EAAC,uBAAuB,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAU,SAAS,EAAC,MAAM,eAAe,CAAC;AACpI,OAAO,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAC,YAAY,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAE7D,OAAO,EAAC,yBAAyB,EAAC,MAAM,uBAAuB,CAAC;AAGhE,OAAO,EAAC,qBAAqB,EAAE,SAAS,EAAC,MAAM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AG/B;wBACI,SAAS,EAAE,qCAAqC;wBAChD,kBAAkB,EAAE,sCAAsC;qBAC7D,WAED;wBACI,QAAQ;wBACR,YAAY;wBACZ,YAAY;wBACZ,gBAAgB;wBAChB,gBAAgB;qBACnB,mBACgB,uBAAuB,CAAC,MAAM;;0BA0ClC,MAAM;2BAAC,oBAAoB;;0BAAG,QAAQ;gGAH8B,YAAY,OAAE,EAAC,IAAI,EAAE,UAAU,EAAC","sourcesContent":["import {ChangeDetectionStrategy, Component, computed, ElementRef, Inject, inject, Optional, Signal, viewChild} from '@angular/core';\nimport {NgTemplateOutlet} from '@angular/common';\nimport {LocalizePipe, TooltipDirective} from '@anglr/common';\nimport {RecursivePartial} from '@jscrpt/common';\nimport {deepCopyWithArrayOverride} from '@jscrpt/common/lodash';\n\nimport {NormalState, NormalStateOptions, SelectPlugin, SimpleNormalStateCssClasses} from '../../../interfaces';\nimport {SelectPluginInstances, SelectBus} from '../../../misc/classes';\nimport {CopyOptionsAsSignal} from '../../../decorators';\nimport {NORMAL_STATE_OPTIONS} from '../../../misc/tokens';\nimport {DisplayValue, HasValue} from '../../../pipes';\n\n//TODO: improvement, carret direction\n\nconst defaultOptions: NormalStateOptions<SimpleNormalStateCssClasses> =\n{\n cancelValue: false,\n texts:\n {\n cancelTitle: 'cancel selected values',\n },\n cssClasses:\n {\n componentElement: 'normal-state-component',\n element: 'normal-state-element',\n value: 'select-align-self-center',\n carret: 'normal-state-carret',\n carretIcon: 'fas fa-caret-down select-align-self-center',\n cancel: 'normal-state-cancel',\n cancelIcon: 'fas fa-times select-align-self-center',\n },\n};\n\n/**\n * Simple normal state displaying value as 'button' that opens popup with options when clicked.\n */\n@Component(\n{\n selector: 'simple-normal-state',\n templateUrl: 'simpleNormalState.component.html',\n host:\n {\n '[class]': 'options.cssClasses.componentElement',\n '[class.disabled]': '!!selectBus.selectOptions().readonly',\n },\n imports:\n [\n HasValue,\n DisplayValue,\n LocalizePipe,\n TooltipDirective,\n NgTemplateOutlet,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SimpleNormalState<TValue = unknown, TPublicValue = TValue> implements NormalState<TValue, TPublicValue, NormalStateOptions<SimpleNormalStateCssClasses>>\n{\n //######################### public properties - implementation of SelectPlugin #########################\n\n /**\n * @inheritdoc\n */\n @CopyOptionsAsSignal()\n public options: NormalStateOptions<SimpleNormalStateCssClasses>;\n\n /**\n * @inheritdoc\n */\n public selectPlugins: SelectPluginInstances<TValue, TPublicValue> = inject(SelectPluginInstances);\n\n /**\n * @inheritdoc\n */\n public pluginElement: ElementRef<HTMLElement> = inject(ElementRef);\n\n /**\n * @inheritdoc\n */\n public selectBus: SelectBus<TValue, TPublicValue> = inject(SelectBus);\n\n //######################### protected properties - template bindings #########################\n\n /**\n * Active descendant for aria-activedescendant attribute\n */\n protected activeDescendant: Signal<string>;\n\n //######################### protected properties - children #########################\n\n /**\n * Reference to button element in template\n */\n protected htmlButton: Signal<ElementRef<HTMLButtonElement>> = viewChild.required('htmlButton', {read: ElementRef});\n\n //######################### constructor #########################\n constructor(@Inject(NORMAL_STATE_OPTIONS) @Optional() options?: RecursivePartial<NormalStateOptions<SimpleNormalStateCssClasses>>|null,)\n {\n this.options = deepCopyWithArrayOverride(defaultOptions as NormalStateOptions<SimpleNormalStateCssClasses>,\n options);\n\n this.activeDescendant = computed(() => `${this.selectBus.id}-${this.selectPlugins.optionsHandler()?.listOptions()?.find(option => option.active())?.index}`);\n }\n\n //######################### public methods - implementation of LiveSearch #########################\n\n /**\n * @inheritdoc\n */\n public focus(): void\n {\n this.htmlButton()?.nativeElement.focus();\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Handles click event\n */\n protected click(): void\n {\n this.selectBus.click.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n }\n\n /**\n * Handles focus event\n */\n protected handleFocus(): void\n {\n this.selectBus.internalsFocus.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n }\n\n /**\n * Handles blur event\n */\n protected blur(): void\n {\n this.selectBus.internalsBlur.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n }\n\n /**\n * Handles cancel value\n */\n protected cancel(): void\n {\n this.selectBus.optionActivate.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n }\n}\n","<ng-template #defaultLook>{{selectBus.selectedOptions() | displayValue | localize}}</ng-template>\n\n<button #htmlButton\n type=\"button\"\n role=\"combobox\"\n [class]=\"options.cssClasses.element\"\n [disabled]=\"!!selectBus.selectOptions().readonly\"\n [attr.aria-expanded]=\"selectBus.popupVisible()\"\n [attr.aria-controls]=\"selectBus.popupVisible() ? selectBus.id : null\"\n [attr.aria-activedescendant]=\"selectBus.popupVisible() ? activeDescendant() : null\"\n [attr.aria-label]=\"selectBus.selectedOptions() | displayValue | localize\"\n [tooltip]=\"selectBus.selectedOptions() | displayValue | localize\"\n (click)=\"click()\"\n (blur)=\"blur()\"\n (focus)=\"handleFocus()\">\n <span [class]=\"options.cssClasses.value\">\n <ng-container *ngTemplateOutlet=\"selectBus.selectOptions().templateGatherer.normalStateTemplate() || defaultLook; context: {$implicit: this}\"/>\n </span>\n</button>\n\n@if(options.cancelValue && (selectBus.selectedOptions() | hasValue))\n{\n <button type=\"button\" \n [disabled]=\"!!selectBus.selectOptions().readonly\"\n [class]=\"options.cssClasses.cancel\" \n [tooltip]=\"options.texts.cancelTitle | localize\" \n [attr.aria-label]=\"options.texts.cancelTitle | localize\"\n (click)=\"cancel()\" \n (blur)=\"blur()\" \n (focus)=\"handleFocus()\">\n <span [class]=\"options.cssClasses.cancelIcon\"></span>\n </button>\n}\n\n<button type=\"button\" [class]=\"options.cssClasses.carret\" [disabled]=\"!!selectBus.selectOptions().readonly\" (click)=\"click(); selectBus.setFocus()\" (focus)=\"handleFocus()\" (blur)=\"blur()\" tabindex=\"-1\" aria-hidden=\"true\">\n <span [class]=\"options.cssClasses.carretIcon\"></span>\n</button>"]}
1
+ {"version":3,"file":"simpleNormalState.component.js","sourceRoot":"","sources":["../../../../../src/plugins/normalState/simpleNormalState/simpleNormalState.component.ts","../../../../../src/plugins/normalState/simpleNormalState/simpleNormalState.component.html"],"names":[],"mappings":";AAAA,OAAO,EAAC,uBAAuB,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAU,SAAS,EAAC,MAAM,eAAe,CAAC;AACpI,OAAO,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAC,YAAY,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAE7D,OAAO,EAAC,yBAAyB,EAAC,MAAM,uBAAuB,CAAC;AAGhE,OAAO,EAAC,qBAAqB,EAAE,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAC,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;;AAEtD,qCAAqC;AAErC,MAAM,cAAc,GACpB;IACI,WAAW,EAAE,KAAK;IAClB,KAAK,EACL;QACI,WAAW,EAAE,wBAAwB;KACxC;IACD,UAAU,EACV;QACI,gBAAgB,EAAE,wBAAwB;QAC1C,OAAO,EAAE,sBAAsB;QAC/B,KAAK,EAAE,0BAA0B;QACjC,MAAM,EAAE,qBAAqB;QAC7B,UAAU,EAAE,4CAA4C;QACxD,MAAM,EAAE,qBAAqB;QAC7B,UAAU,EAAE,uCAAuC;KACtD;CACJ,CAAC;AAEF;;GAEG;AAoBH,MAAM,OAAO,iBAAiB;IAuC1B,iEAAiE;IACjE,YAAsD,OAAgF;QA9BtI;;WAEG;QACI,kBAAa,GAAgD,MAAM,CAAC,qBAAqB,CAAC,CAAC;QAElG;;WAE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;YAC5B,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,aAAa;YAC/C,IAAI,EAAE,IAAI;SACb,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACO,MAAM;QAEZ,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAClC;YACI,MAAM,EAAE,IAAoB;YAC5B,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,aAAa;YAC/C,IAAI,EAAE,IAAI;SACb,CAAC,CAAC;IACP,CAAC;8GA9GQ,iBAAiB,kBAwCN,oBAAoB;kGAxC/B,iBAAiB,wSAqC4E,UAAU,6CC5FpH,s0DAoCS,4CDcD,gBAAgB,4JAChB,gBAAgB,+IAJhB,QAAQ,4CACR,YAAY,gDACZ,YAAY;;AAcT;IADN,mBAAmB,EAAE;;kDAC0C;2FARvD,iBAAiB;kBAnB7B,SAAS;+BAEI,qBAAqB,QAG/B;wBACI,SAAS,EAAE,qCAAqC;wBAChD,kBAAkB,EAAE,sCAAsC;qBAC7D,WAED;wBACI,QAAQ;wBACR,YAAY;wBACZ,YAAY;wBACZ,gBAAgB;wBAChB,gBAAgB;qBACnB,mBACgB,uBAAuB,CAAC,MAAM;;0BA0ClC,MAAM;2BAAC,oBAAoB;;0BAAG,QAAQ;gGAH8B,YAAY,OAAE,EAAC,IAAI,EAAE,UAAU,EAAC","sourcesContent":["import {ChangeDetectionStrategy, Component, computed, ElementRef, Inject, inject, Optional, Signal, viewChild} from '@angular/core';\nimport {NgTemplateOutlet} from '@angular/common';\nimport {LocalizePipe, TooltipDirective} from '@anglr/common';\nimport {RecursivePartial} from '@jscrpt/common';\nimport {deepCopyWithArrayOverride} from '@jscrpt/common/lodash';\n\nimport {NormalState, NormalStateOptions, SelectPlugin, SimpleNormalStateCssClasses} from '../../../interfaces';\nimport {SelectPluginInstances, SelectBus} from '../../../misc/classes';\nimport {CopyOptionsAsSignal} from '../../../decorators';\nimport {NORMAL_STATE_OPTIONS} from '../../../misc/tokens';\nimport {DisplayValue, HasValue} from '../../../pipes';\n\n//TODO: improvement, carret direction\n\nconst defaultOptions: NormalStateOptions<SimpleNormalStateCssClasses> =\n{\n cancelValue: false,\n texts:\n {\n cancelTitle: 'cancel selected values',\n },\n cssClasses:\n {\n componentElement: 'normal-state-component',\n element: 'normal-state-element',\n value: 'select-align-self-center',\n carret: 'normal-state-carret',\n carretIcon: 'fas fa-caret-down select-align-self-center',\n cancel: 'normal-state-cancel',\n cancelIcon: 'fas fa-times select-align-self-center',\n },\n};\n\n/**\n * Simple normal state displaying value as 'button' that opens popup with options when clicked.\n */\n@Component(\n{\n selector: 'simple-normal-state',\n templateUrl: 'simpleNormalState.component.html',\n host:\n {\n '[class]': 'options.cssClasses.componentElement',\n '[class.disabled]': '!!selectBus.selectOptions().readonly',\n },\n imports:\n [\n HasValue,\n DisplayValue,\n LocalizePipe,\n TooltipDirective,\n NgTemplateOutlet,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SimpleNormalState<TValue = unknown, TPublicValue = TValue> implements NormalState<TValue, TPublicValue, NormalStateOptions<SimpleNormalStateCssClasses>>\n{\n //######################### public properties - implementation of SelectPlugin #########################\n\n /**\n * @inheritdoc\n */\n @CopyOptionsAsSignal()\n public options: NormalStateOptions<SimpleNormalStateCssClasses>;\n\n /**\n * @inheritdoc\n */\n public selectPlugins: SelectPluginInstances<TValue, TPublicValue> = inject(SelectPluginInstances);\n\n /**\n * @inheritdoc\n */\n public pluginElement: ElementRef<HTMLElement> = inject(ElementRef);\n\n /**\n * @inheritdoc\n */\n public selectBus: SelectBus<TValue, TPublicValue> = inject(SelectBus);\n\n //######################### protected properties - template bindings #########################\n\n /**\n * Active descendant for aria-activedescendant attribute\n */\n protected activeDescendant: Signal<string>;\n\n //######################### protected properties - children #########################\n\n /**\n * Reference to button element in template\n */\n protected htmlButton: Signal<ElementRef<HTMLButtonElement>> = viewChild.required('htmlButton', {read: ElementRef});\n\n //######################### constructor #########################\n constructor(@Inject(NORMAL_STATE_OPTIONS) @Optional() options?: RecursivePartial<NormalStateOptions<SimpleNormalStateCssClasses>>|null,)\n {\n this.options = deepCopyWithArrayOverride(defaultOptions as NormalStateOptions<SimpleNormalStateCssClasses>,\n options);\n\n this.activeDescendant = computed(() => `${this.selectBus.id}-${this.selectPlugins.optionsHandler()?.listOptions()?.find(option => option.active())?.index}`);\n }\n\n //######################### public methods - implementation of LiveSearch #########################\n\n /**\n * @inheritdoc\n */\n public focus(): void\n {\n this.htmlButton()?.nativeElement.focus();\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Handles click event\n */\n protected click(): void\n {\n this.selectBus.click.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n }\n\n /**\n * Handles focus event\n */\n protected handleFocus(): void\n {\n this.selectBus.internalsFocus.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n }\n\n /**\n * Handles blur event\n */\n protected blur(): void\n {\n this.selectBus.internalsBlur.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n }\n\n /**\n * Handles cancel value\n */\n protected cancel(): void\n {\n this.selectBus.optionActivate.next(\n {\n source: this as SelectPlugin,\n sourceElement: this.pluginElement.nativeElement,\n data: null,\n });\n }\n}\n","<ng-template #defaultLook>{{selectBus.selectedOptions() | displayValue | localize}}</ng-template>\n\n<button #htmlButton\n type=\"button\"\n role=\"combobox\"\n [class]=\"options.cssClasses.element\"\n [disabled]=\"!!selectBus.selectOptions().readonly\"\n [attr.aria-expanded]=\"selectBus.popupVisible()\"\n [attr.aria-controls]=\"selectBus.popupVisible() ? selectBus.id : null\"\n [attr.aria-activedescendant]=\"selectBus.popupVisible() ? activeDescendant() : null\"\n [attr.aria-label]=\"selectBus.selectedOptions() | displayValue | localize\"\n [tooltip]=\"selectBus.selectedOptions() | displayValue | localize\"\n (click)=\"click()\"\n (blur)=\"blur()\"\n (focus)=\"handleFocus()\">\n <span [class]=\"options.cssClasses.value\">\n <ng-container *ngTemplateOutlet=\"selectBus.selectOptions().templateGatherer.normalStateTemplate() || defaultLook; context: {$implicit: this}\"/>\n </span>\n</button>\n\n@if(options.cancelValue && (selectBus.selectedOptions() | hasValue))\n{\n <button type=\"button\" \n [disabled]=\"!!selectBus.selectOptions().readonly\"\n [class]=\"options.cssClasses.cancel\" \n [tooltip]=\"options.texts.cancelTitle | localize\" \n [attr.aria-label]=\"options.texts.cancelTitle | localize\"\n (click)=\"cancel()\" \n (blur)=\"blur()\" \n (focus)=\"handleFocus()\">\n <span [class]=\"options.cssClasses.cancelIcon\"></span>\n </button>\n}\n\n<button type=\"button\" [class]=\"options.cssClasses.carret\" [disabled]=\"!!selectBus.selectOptions().readonly\" (click)=\"click(); selectBus.setFocus()\" (focus)=\"handleFocus()\" (blur)=\"blur()\" tabindex=\"-1\" aria-hidden=\"true\">\n <span [class]=\"options.cssClasses.carretIcon\"></span>\n</button>"]}
@@ -17,7 +17,8 @@ export class NoOptionsHandler extends OptionsHandlerBase {
17
17
  constructor(options) {
18
18
  super();
19
19
  this.options = deepCopyWithArrayOverride(defaultOptions, options);
20
- this.availableOptions = computed(() => this.selectBus.selectOptions().optionsGatherer.availableOptions(), ...(ngDevMode ? [{ debugName: "availableOptions" }] : []));
20
+ this.availableOptions = computed(() => this.selectBus.selectOptions().optionsGatherer.availableOptions(), /* @ts-ignore */
21
+ ...(ngDevMode ? [{ debugName: "availableOptions" }] : /* istanbul ignore next */ []));
21
22
  this.listOptions = computed(() => {
22
23
  const firstOption = this.firstOption();
23
24
  const availableOptions = this.availableOptions();
@@ -25,16 +26,17 @@ export class NoOptionsHandler extends OptionsHandlerBase {
25
26
  availableOptions.unshift(firstOption);
26
27
  }
27
28
  return availableOptions;
28
- }, ...(ngDevMode ? [{ debugName: "listOptions" }] : []));
29
+ }, /* @ts-ignore */
30
+ ...(ngDevMode ? [{ debugName: "listOptions" }] : /* istanbul ignore next */ []));
29
31
  }
30
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NoOptionsHandler, deps: [{ token: OPTIONS_HANDLER_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
31
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.5", type: NoOptionsHandler, isStandalone: true, selector: "no-options-handler", usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
32
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NoOptionsHandler, deps: [{ token: OPTIONS_HANDLER_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
33
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.4", type: NoOptionsHandler, isStandalone: true, selector: "no-options-handler", usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
32
34
  }
33
35
  __decorate([
34
36
  CopyOptionsAsSignal(),
35
37
  __metadata("design:type", Object)
36
38
  ], NoOptionsHandler.prototype, "options", void 0);
37
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NoOptionsHandler, decorators: [{
39
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NoOptionsHandler, decorators: [{
38
40
  type: Component,
39
41
  args: [{
40
42
  selector: 'no-options-handler',
@@ -1 +1 @@
1
- {"version":3,"file":"noOptionsHandler.component.js","sourceRoot":"","sources":["../../../../../src/plugins/optionsHandler/noOptionsHandler/noOptionsHandler.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,uBAAuB,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAS,MAAM,eAAe,CAAC;AAErG,OAAO,EAAC,yBAAyB,EAAC,MA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AE;oBACZ,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAClD;;0BAwBgB,MAAM;2BAAC,uBAAuB;;0BAAG,QAAQ","sourcesContent":["import {ChangeDetectionStrategy, Component, computed, Inject, Optional, Signal} from '@angular/core';\nimport {RecursivePartial} from '@jscrpt/common';\nimport {deepCopyWithArrayOverride} from '@jscrpt/common/lodash';\n\nimport {OptionsHandler, SelectOptionState, OptionsHandlerOptions} from '../../../interfaces';\nimport {CopyOptionsAsSignal} from '../../../decorators';\nimport {OPTIONS_HANDLER_OPTIONS} from '../../../misc/tokens';\nimport {OptionsHandlerBase} from '../optionsHandlerBase';\n\nconst defaultOptions: OptionsHandlerOptions<unknown> =\n{\n newOptionGetter: undefined,\n newOptionOnlyWhenNoOptions: false,\n};\n\n/**\n * Options handler that does nothing to obtained options, use them as they are\n */\n@Component(\n{\n selector: 'no-options-handler',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NoOptionsHandler<TValue = unknown, TPublicValue = TValue> extends OptionsHandlerBase<TValue, TPublicValue, OptionsHandlerOptions<TValue>> implements OptionsHandler<TValue, TPublicValue, OptionsHandlerOptions<TValue>>\n{\n //######################### public properties - implementation of SelectPlugin #########################\n\n /**\n * @inheritdoc\n */\n @CopyOptionsAsSignal()\n public options: OptionsHandlerOptions<TValue>;\n\n //######################### public properties - implementation of OptionsHandler #########################\n\n /**\n * @inheritdoc\n */\n public readonly availableOptions: Signal<readonly SelectOptionState<TValue>[]|undefined|null>;\n\n /**\n * @inheritdoc\n */\n public readonly listOptions: Signal<readonly SelectOptionState<TValue>[]|undefined|null>;\n\n //######################### constructor #########################\n constructor(@Inject(OPTIONS_HANDLER_OPTIONS) @Optional() options?: RecursivePartial<OptionsHandlerOptions<TValue>>|null,)\n {\n super();\n\n this.options = deepCopyWithArrayOverride(defaultOptions as OptionsHandlerOptions<TValue>,\n options);\n\n this.availableOptions = computed(() => this.selectBus.selectOptions().optionsGatherer.availableOptions());\n this.listOptions = computed(() =>\n {\n const firstOption = this.firstOption();\n const availableOptions = this.availableOptions() as SelectOptionState<TValue>[] | null | undefined;\n\n if(firstOption && availableOptions && (!this.options.newOptionOnlyWhenNoOptions || !availableOptions.length))\n {\n availableOptions.unshift(firstOption);\n }\n\n return availableOptions;\n });\n }\n}\n"]}
1
+ {"version":3,"file":"noOptionsHandler.component.js","sourceRoot":"","sources":["../../../../../src/plugins/optionsHandler/noOptionsHandler/noOptionsHandler.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,uBAAuB,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAS,MAAM,eAAe,CAAC;AAErG,OAAO,EAAC,yBAAyB,EAAC,MAAM,uBAAuB,CAAC;AAGhE,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAC,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;;AAEzD,MAAM,cAAc,GACpB;IACI,eAAe,EAAE,SAAS;IAC1B,0BAA0B,EAAE,KAAK;CACpC,CAAC;AAEF;;GAEG;AAOH,MAAM,OAAO,gBAA0D,SAAQ,kBAAuE;IAsBlJ,iEAAiE;IACjE,YAAyD,OAA8D;QAEnH,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,OAAO,GAAG,yBAAyB,CAAC,cAA+C,EAC/C,OAAO,CAAC,CAAC;QAElD,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC,eAAe,CAAC,gBAAgB,EAAE;6FAAC,CAAC;QAC1G,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,GAAG,EAAE;YAE7B,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;YACvC,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,EAAoD,CAAC;YAEnG,IAAG,WAAW,IAAI,gBAAgB,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,0BAA0B,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAC5G,CAAC;gBACG,gBAAgB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;YAC1C,CAAC;YAED,OAAO,gBAAgB,CAAC;QAC5B,CAAC;wFAAC,CAAC;IACP,CAAC;8GA3CQ,gBAAgB,kBAuBL,uBAAuB;kGAvBlC,gBAAgB,qGAHf,EAAE;;AAWL;IADN,mBAAmB,EAAE;;iDACwB;2FARrC,gBAAgB;kBAN5B,SAAS;mBACV;oBACI,QAAQ,EAAE,oBAAoB;oBAC9B,QAAQ,EAAE,EAAE;oBACZ,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAClD;;0BAwBgB,MAAM;2BAAC,uBAAuB;;0BAAG,QAAQ","sourcesContent":["import {ChangeDetectionStrategy, Component, computed, Inject, Optional, Signal} from '@angular/core';\nimport {RecursivePartial} from '@jscrpt/common';\nimport {deepCopyWithArrayOverride} from '@jscrpt/common/lodash';\n\nimport {OptionsHandler, SelectOptionState, OptionsHandlerOptions} from '../../../interfaces';\nimport {CopyOptionsAsSignal} from '../../../decorators';\nimport {OPTIONS_HANDLER_OPTIONS} from '../../../misc/tokens';\nimport {OptionsHandlerBase} from '../optionsHandlerBase';\n\nconst defaultOptions: OptionsHandlerOptions<unknown> =\n{\n newOptionGetter: undefined,\n newOptionOnlyWhenNoOptions: false,\n};\n\n/**\n * Options handler that does nothing to obtained options, use them as they are\n */\n@Component(\n{\n selector: 'no-options-handler',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NoOptionsHandler<TValue = unknown, TPublicValue = TValue> extends OptionsHandlerBase<TValue, TPublicValue, OptionsHandlerOptions<TValue>> implements OptionsHandler<TValue, TPublicValue, OptionsHandlerOptions<TValue>>\n{\n //######################### public properties - implementation of SelectPlugin #########################\n\n /**\n * @inheritdoc\n */\n @CopyOptionsAsSignal()\n public options: OptionsHandlerOptions<TValue>;\n\n //######################### public properties - implementation of OptionsHandler #########################\n\n /**\n * @inheritdoc\n */\n public readonly availableOptions: Signal<readonly SelectOptionState<TValue>[]|undefined|null>;\n\n /**\n * @inheritdoc\n */\n public readonly listOptions: Signal<readonly SelectOptionState<TValue>[]|undefined|null>;\n\n //######################### constructor #########################\n constructor(@Inject(OPTIONS_HANDLER_OPTIONS) @Optional() options?: RecursivePartial<OptionsHandlerOptions<TValue>>|null,)\n {\n super();\n\n this.options = deepCopyWithArrayOverride(defaultOptions as OptionsHandlerOptions<TValue>,\n options);\n\n this.availableOptions = computed(() => this.selectBus.selectOptions().optionsGatherer.availableOptions());\n this.listOptions = computed(() =>\n {\n const firstOption = this.firstOption();\n const availableOptions = this.availableOptions() as SelectOptionState<TValue>[] | null | undefined;\n\n if(firstOption && availableOptions && (!this.options.newOptionOnlyWhenNoOptions || !availableOptions.length))\n {\n availableOptions.unshift(firstOption);\n }\n\n return availableOptions;\n });\n }\n}\n"]}
@@ -11,7 +11,8 @@ export class OptionsHandlerBase {
11
11
  /**
12
12
  * First option to be inserted into options list, when adding new option is enabled
13
13
  */
14
- this.firstOption = signal(null, ...(ngDevMode ? [{ debugName: "firstOption" }] : []));
14
+ this.firstOption = signal(null, /* @ts-ignore */
15
+ ...(ngDevMode ? [{ debugName: "firstOption" }] : /* istanbul ignore next */ []));
15
16
  /**
16
17
  * @inheritdoc
17
18
  */
@@ -37,16 +38,18 @@ export class OptionsHandlerBase {
37
38
  }
38
39
  const newOption = newOptionsGetter(search);
39
40
  newOption.created = true;
40
- newOption.selected = signal(false, ...(ngDevMode ? [{ debugName: "selected" }] : []));
41
- newOption.active = signal(false, ...(ngDevMode ? [{ debugName: "active" }] : []));
41
+ newOption.selected = signal(false, /* @ts-ignore */
42
+ ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
43
+ newOption.active = signal(false, /* @ts-ignore */
44
+ ...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
42
45
  newOption.index = 0;
43
46
  this.firstOption.set(newOption);
44
47
  });
45
48
  }
46
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: OptionsHandlerBase, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
47
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.5", type: OptionsHandlerBase, isStandalone: true, ngImport: i0 }); }
49
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: OptionsHandlerBase, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
50
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.4", type: OptionsHandlerBase, isStandalone: true, ngImport: i0 }); }
48
51
  }
49
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: OptionsHandlerBase, decorators: [{
52
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: OptionsHandlerBase, decorators: [{
50
53
  type: Directive
51
54
  }], ctorParameters: () => [] });
52
55
  //# sourceMappingURL=optionsHandlerBase.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"optionsHandlerBase.js","sourceRoot":"","sources":["../../../../src/plugins/optionsHandler/optionsHandlerBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AAG5F,OAAO,EAAC,SAAS,EAAE,qBAAqB,EAAC,MAAM,oBAAoB,CAAC;;AAEpE;;GAEG;AAEH,MAAM,OAAgB,kBAAkB;IA+BpC,iEAAiE;IACjE;QA9BA,sEAAsE;QAEtE;;WAEG;QACO,gBAAW,GAAqE,MAAM,CAAC,IAAI,uDAAC,CAAC;QASvG;;WAEG;QACI,kBAAa,GAAgD,MAAM,CAAC,qBAAqB,CAAC,CAAC;QAElG;;WAEG;QACI,kBAAa,GAA4B,MAAM,CAAC,UAAU,CAAC,CAAC;QAEnE;;WAEG;QACI,cAAS,GAAoC,MAAM,CAAC,SAAS,CAAC,CAAC;QAKlE,MAAM,CAAC,GAAG,EAAE;YAER,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC;YAEtD,IAAG,CAAC,gBAAgB,EACpB,CAAC;gBACG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBAE3B,OAAO;YACX,CAAC;YAED,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;YAEtD,IAAG,CAAC,MAAM,EACV,CAAC;gBACG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBAE3B,OAAO;YACX,CAAC;YAED,MAAM,SAAS,GAAG,gBAAgB,CAAC,MAAM,CAAsC,CAAC;YAChF,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;YACzB,SAAS,CAAC,QAAQ,GAAG,MAAM,CAAC,KAAK,oDAAC,CAAC;YACnC,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,kDAAC,CAAC;YACjC,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC;YAEpB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;IACP,CAAC;8GA9DiB,kBAAkB;kGAAlB,kBAAkB;;2FAAlB,kBAAkB;kBADvC,SAAS","sourcesContent":["import {Directive, effect, ElementRef, inject, signal, WritableSignal} from '@angular/core';\n\nimport {OptionsHandlerOptions, SelectOptionStateSyntetic} from '../../interfaces';\nimport {SelectBus, SelectPluginInstances} from '../../misc/classes';\n\n/**\n * Base class for options handlers.\n */\n@Directive()\nexport abstract class OptionsHandlerBase<TValue = unknown, TPublicValue = TValue, TOptions extends OptionsHandlerOptions<TValue> = OptionsHandlerOptions<TValue>>\n{\n //######################### protected fields #########################\n\n /**\n * First option to be inserted into options list, when adding new option is enabled\n */\n protected firstOption: WritableSignal<SelectOptionStateSyntetic<TValue>|undefined|null> = signal(null);\n\n //######################### public properties - implementation of SelectPlugin #########################\n\n /**\n * @inheritdoc\n */\n public abstract options: TOptions;\n\n /**\n * @inheritdoc\n */\n public selectPlugins: SelectPluginInstances<TValue, TPublicValue> = inject(SelectPluginInstances);\n\n /**\n * @inheritdoc\n */\n public pluginElement: ElementRef<HTMLElement> = inject(ElementRef);\n\n /**\n * @inheritdoc\n */\n public selectBus: SelectBus<TValue, TPublicValue> = inject(SelectBus);\n\n //######################### constructor #########################\n constructor()\n {\n effect(() =>\n {\n const newOptionsGetter = this.options.newOptionGetter;\n\n if(!newOptionsGetter)\n {\n this.firstOption.set(null);\n\n return;\n }\n\n const search = this.selectPlugins.LiveSearch.search();\n\n if(!search)\n {\n this.firstOption.set(null);\n\n return;\n }\n\n const newOption = newOptionsGetter(search) as SelectOptionStateSyntetic<TValue>;\n newOption.created = true;\n newOption.selected = signal(false);\n newOption.active = signal(false);\n newOption.index = 0;\n\n this.firstOption.set(newOption);\n });\n }\n}\n"]}
1
+ {"version":3,"file":"optionsHandlerBase.js","sourceRoot":"","sources":["../../../../src/plugins/optionsHandler/optionsHandlerBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AAG5F,OAAO,EAAC,SAAS,EAAE,qBAAqB,EAAC,MAAM,oBAAoB,CAAC;;AAEpE;;GAEG;AAEH,MAAM,OAAgB,kBAAkB;IA+BpC,iEAAiE;IACjE;QA9BA,sEAAsE;QAEtE;;WAEG;QACO,gBAAW,GAAqE,MAAM,CAAC,IAAI;wFAAC,CAAC;QASvG;;WAEG;QACI,kBAAa,GAAgD,MAAM,CAAC,qBAAqB,CAAC,CAAC;QAElG;;WAEG;QACI,kBAAa,GAA4B,MAAM,CAAC,UAAU,CAAC,CAAC;QAEnE;;WAEG;QACI,cAAS,GAAoC,MAAM,CAAC,SAAS,CAAC,CAAC;QAKlE,MAAM,CAAC,GAAG,EAAE;YAER,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC;YAEtD,IAAG,CAAC,gBAAgB,EACpB,CAAC;gBACG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBAE3B,OAAO;YACX,CAAC;YAED,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;YAEtD,IAAG,CAAC,MAAM,EACV,CAAC;gBACG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBAE3B,OAAO;YACX,CAAC;YAED,MAAM,SAAS,GAAG,gBAAgB,CAAC,MAAM,CAAsC,CAAC;YAChF,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;YACzB,SAAS,CAAC,QAAQ,GAAG,MAAM,CAAC,KAAK;yFAAC,CAAC;YACnC,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK;uFAAC,CAAC;YACjC,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC;YAEpB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;IACP,CAAC;8GA9DiB,kBAAkB;kGAAlB,kBAAkB;;2FAAlB,kBAAkB;kBADvC,SAAS","sourcesContent":["import {Directive, effect, ElementRef, inject, signal, WritableSignal} from '@angular/core';\n\nimport {OptionsHandlerOptions, SelectOptionStateSyntetic} from '../../interfaces';\nimport {SelectBus, SelectPluginInstances} from '../../misc/classes';\n\n/**\n * Base class for options handlers.\n */\n@Directive()\nexport abstract class OptionsHandlerBase<TValue = unknown, TPublicValue = TValue, TOptions extends OptionsHandlerOptions<TValue> = OptionsHandlerOptions<TValue>>\n{\n //######################### protected fields #########################\n\n /**\n * First option to be inserted into options list, when adding new option is enabled\n */\n protected firstOption: WritableSignal<SelectOptionStateSyntetic<TValue>|undefined|null> = signal(null);\n\n //######################### public properties - implementation of SelectPlugin #########################\n\n /**\n * @inheritdoc\n */\n public abstract options: TOptions;\n\n /**\n * @inheritdoc\n */\n public selectPlugins: SelectPluginInstances<TValue, TPublicValue> = inject(SelectPluginInstances);\n\n /**\n * @inheritdoc\n */\n public pluginElement: ElementRef<HTMLElement> = inject(ElementRef);\n\n /**\n * @inheritdoc\n */\n public selectBus: SelectBus<TValue, TPublicValue> = inject(SelectBus);\n\n //######################### constructor #########################\n constructor()\n {\n effect(() =>\n {\n const newOptionsGetter = this.options.newOptionGetter;\n\n if(!newOptionsGetter)\n {\n this.firstOption.set(null);\n\n return;\n }\n\n const search = this.selectPlugins.LiveSearch.search();\n\n if(!search)\n {\n this.firstOption.set(null);\n\n return;\n }\n\n const newOption = newOptionsGetter(search) as SelectOptionStateSyntetic<TValue>;\n newOption.created = true;\n newOption.selected = signal(false);\n newOption.active = signal(false);\n newOption.index = 0;\n\n this.firstOption.set(newOption);\n });\n }\n}\n"]}