@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
@@ -0,0 +1,114 @@
1
+ import { afterRenderEffect, Directive, effect, ElementRef, inject, Injector, signal, untracked } from '@angular/core';
2
+ import { HighlightInstance } from '../highlightInstance/highlightInstance.directive';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Direcitve that handles highlighting of search text, attached directly to option where highlighting should occur.
6
+ */
7
+ export class HighlightSearch {
8
+ //######################### constructor #########################
9
+ constructor() {
10
+ //######################### protected fields #########################
11
+ /**
12
+ * Instance of highlight instance
13
+ */
14
+ this.highlightInstance = inject(HighlightInstance);
15
+ /**
16
+ * Instance of element reference
17
+ */
18
+ this.element = inject(ElementRef);
19
+ /**
20
+ * All nodes that are children of this element and can be highlighted
21
+ */
22
+ this.nodes = signal([], /* @ts-ignore */
23
+ ...(ngDevMode ? [{ debugName: "nodes" }] : /* istanbul ignore next */ []));
24
+ /**
25
+ * Array of registered text nodes that are currently active on this element
26
+ */
27
+ this.textNodes = signal([], /* @ts-ignore */
28
+ ...(ngDevMode ? [{ debugName: "textNodes" }] : /* istanbul ignore next */ []));
29
+ /**
30
+ * Array of highlighted ranges that are currently active on this element
31
+ */
32
+ this.ranges = signal([], /* @ts-ignore */
33
+ ...(ngDevMode ? [{ debugName: "ranges" }] : /* istanbul ignore next */ []));
34
+ //######################### public properties #########################
35
+ /**
36
+ * Instance of injector used for obtaining dependencies in templates
37
+ */
38
+ this.injector = inject(Injector);
39
+ afterRenderEffect({
40
+ read: () => {
41
+ const nodes = [];
42
+ for (let x = 0; x < this.element.nativeElement.childNodes.length; x++) {
43
+ const node = this.element.nativeElement.childNodes.item(x);
44
+ if (node && node.nodeType === Node.TEXT_NODE) {
45
+ nodes.push(node);
46
+ }
47
+ }
48
+ this.nodes.set(nodes);
49
+ },
50
+ });
51
+ effect(() => {
52
+ const nodes = this.textNodes().length ? this.textNodes() : this.nodes();
53
+ if (!this.highlightInstance.enabled() || !nodes.length) {
54
+ return;
55
+ }
56
+ const searchQuery = this.highlightInstance.searchQuery();
57
+ if (!searchQuery) {
58
+ this.highlightInstance.unregisterHighlightRanges(untracked(() => this.ranges()));
59
+ this.ranges.set([]);
60
+ return;
61
+ }
62
+ this.highlightInstance.unregisterHighlightRanges(untracked(() => this.ranges()));
63
+ this.ranges.set(nodes.flatMap(node => {
64
+ const ranges = [];
65
+ let text = node.textContent ?? '';
66
+ let index;
67
+ let length = 0;
68
+ while ((index = text.indexOf(searchQuery)) > -1) {
69
+ const range = new Range();
70
+ range.setStart(node, index + length);
71
+ range.setEnd(node, index + length + searchQuery.length);
72
+ ranges.push(range);
73
+ text = text.slice(index + searchQuery.length);
74
+ length += index + searchQuery.length;
75
+ }
76
+ return ranges;
77
+ }));
78
+ this.highlightInstance.registerHighlightRanges(untracked(() => this.ranges()));
79
+ });
80
+ }
81
+ //######################### public methods - implementation of OnDestroy #########################
82
+ /**
83
+ * @inheritdoc
84
+ */
85
+ ngOnDestroy() {
86
+ this.highlightInstance.unregisterHighlightRanges(untracked(() => this.ranges()));
87
+ this.ranges.set([]);
88
+ }
89
+ //######################### public methods #########################
90
+ /**
91
+ * Adds nodes to the list of text nodes that are currently active on this element
92
+ * @param nodes - Nodes to be added
93
+ */
94
+ addNodes(nodes) {
95
+ this.textNodes.set([...untracked(() => this.textNodes()), ...nodes]);
96
+ }
97
+ /**
98
+ * Removes nodes from the list of text nodes that are currently active on this element
99
+ * @param nodes - Nodes to be removed
100
+ */
101
+ removeNodes(nodes) {
102
+ this.textNodes.set(untracked(() => this.textNodes()).filter(node => !nodes.includes(node)));
103
+ }
104
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: HighlightSearch, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
105
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.4", type: HighlightSearch, isStandalone: true, selector: "[highlightSearch]", exportAs: ["highlightSearch"], ngImport: i0 }); }
106
+ }
107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: HighlightSearch, decorators: [{
108
+ type: Directive,
109
+ args: [{
110
+ selector: '[highlightSearch]',
111
+ exportAs: 'highlightSearch',
112
+ }]
113
+ }], ctorParameters: () => [] });
114
+ //# sourceMappingURL=highlightSearch.directive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"highlightSearch.directive.js","sourceRoot":"","sources":["../../../../src/directives/highlightSearch/highlightSearch.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAE,SAAS,EAAE,MAAM,EAAE,UA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mB;oBAC7B,QAAQ,EAAE,iBAAiB;iBAC9B","sourcesContent":["import {afterRenderEffect, Directive, effect, ElementRef, inject, Injector, OnDestroy, signal, untracked, WritableSignal} from '@angular/core';\n\nimport {HighlightInstance} from '../highlightInstance/highlightInstance.directive';\n\n/**\n * Direcitve that handles highlighting of search text, attached directly to option where highlighting should occur.\n */\n@Directive(\n{\n selector: '[highlightSearch]',\n exportAs: 'highlightSearch',\n})\nexport class HighlightSearch implements OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Instance of highlight instance\n */\n protected highlightInstance: HighlightInstance = inject(HighlightInstance);\n\n /**\n * Instance of element reference\n */\n protected element: ElementRef<HTMLElement> = inject(ElementRef);\n\n /**\n * All nodes that are children of this element and can be highlighted\n */\n protected nodes: WritableSignal<Node[]> = signal([]);\n\n /**\n * Array of registered text nodes that are currently active on this element\n */\n protected textNodes: WritableSignal<Node[]> = signal([]);\n\n /**\n * Array of highlighted ranges that are currently active on this element\n */\n protected ranges: WritableSignal<Range[]> = signal([]);\n\n //######################### public properties #########################\n\n /**\n * Instance of injector used for obtaining dependencies in templates\n */\n public injector: Injector = inject(Injector);\n\n //######################### constructor #########################\n constructor()\n {\n afterRenderEffect(\n {\n read: () =>\n {\n const nodes: Node[] = [];\n\n for(let x = 0; x < this.element.nativeElement.childNodes.length; x++)\n {\n const node = this.element.nativeElement.childNodes.item(x);\n\n if(node && node.nodeType === Node.TEXT_NODE)\n {\n nodes.push(node);\n }\n }\n\n this.nodes.set(nodes);\n },\n });\n\n effect(() =>\n {\n const nodes = this.textNodes().length ? this.textNodes() : this.nodes();\n\n if(!this.highlightInstance.enabled() || !nodes.length)\n {\n return;\n }\n\n const searchQuery = this.highlightInstance.searchQuery();\n\n if(!searchQuery)\n {\n this.highlightInstance.unregisterHighlightRanges(untracked(() => this.ranges()));\n this.ranges.set([]);\n\n return;\n }\n\n this.highlightInstance.unregisterHighlightRanges(untracked(() => this.ranges()));\n\n this.ranges.set(nodes.flatMap(node =>\n {\n const ranges: Range[] = [];\n let text = node.textContent ?? '';\n let index: number;\n let length: number = 0;\n\n while((index = text.indexOf(searchQuery)) > -1)\n {\n const range = new Range();\n\n range.setStart(node, index + length);\n range.setEnd(node, index + length + searchQuery.length);\n ranges.push(range);\n\n text = text.slice(index + searchQuery.length);\n length += index + searchQuery.length;\n }\n\n return ranges;\n }));\n\n this.highlightInstance.registerHighlightRanges(untracked(() => this.ranges()));\n });\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * @inheritdoc\n */\n public ngOnDestroy(): void\n {\n this.highlightInstance.unregisterHighlightRanges(untracked(() => this.ranges()));\n this.ranges.set([]);\n }\n\n //######################### public methods #########################\n\n /**\n * Adds nodes to the list of text nodes that are currently active on this element\n * @param nodes - Nodes to be added\n */\n public addNodes(nodes: Node[]): void\n {\n this.textNodes.set([...untracked(() => this.textNodes()), ...nodes]);\n }\n\n /**\n * Removes nodes from the list of text nodes that are currently active on this element\n * @param nodes - Nodes to be removed\n */\n public removeNodes(nodes: Node[]): void\n {\n this.textNodes.set(untracked(() => this.textNodes()).filter(node => !nodes.includes(node)));\n }\n}\n"]}
@@ -0,0 +1,63 @@
1
+ import { afterRenderEffect, Directive, effect, ElementRef, inject, signal } from '@angular/core';
2
+ import { HighlightSearch } from '../highlightSearch/highlightSearch.directive';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Directive that marks element that contains text that should be highlighted
6
+ */
7
+ export class HighlightText {
8
+ //######################### constructor #########################
9
+ constructor() {
10
+ //######################### protected fields #########################
11
+ /**
12
+ * Instance of element that will have highlighted text
13
+ */
14
+ this.element = inject(ElementRef);
15
+ /**
16
+ * Instance of HighlightSearch directive that is used to highlight text in the element
17
+ */
18
+ this.highlightSearch = inject(HighlightSearch, { optional: true });
19
+ /**
20
+ * Array of registered text nodes that are currently active on this element
21
+ */
22
+ this.textNodes = signal([], /* @ts-ignore */
23
+ ...(ngDevMode ? [{ debugName: "textNodes" }] : /* istanbul ignore next */ []));
24
+ if (!this.highlightSearch) {
25
+ throw new Error('HighlightText: HighlightSearch directive is not found on parent elements. Use HighlightText within OptionTemplate directive.');
26
+ }
27
+ afterRenderEffect({
28
+ read: () => {
29
+ const nodes = [];
30
+ for (let x = 0; x < this.element.nativeElement.childNodes.length; x++) {
31
+ const node = this.element.nativeElement.childNodes.item(x);
32
+ if (node && node.nodeType === Node.TEXT_NODE) {
33
+ nodes.push(node);
34
+ }
35
+ }
36
+ this.textNodes.set(nodes);
37
+ },
38
+ });
39
+ effect(() => {
40
+ const nodes = this.textNodes();
41
+ if (!nodes.length) {
42
+ return;
43
+ }
44
+ this.highlightSearch?.addNodes(nodes);
45
+ });
46
+ }
47
+ //######################### public methods - implementation of OnDestroy #########################
48
+ /**
49
+ * @inheritdoc
50
+ */
51
+ ngOnDestroy() {
52
+ this.highlightSearch?.removeNodes(this.textNodes());
53
+ }
54
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: HighlightText, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
55
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.4", type: HighlightText, isStandalone: true, selector: "[highlightText]", ngImport: i0 }); }
56
+ }
57
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: HighlightText, decorators: [{
58
+ type: Directive,
59
+ args: [{
60
+ selector: '[highlightText]',
61
+ }]
62
+ }], ctorParameters: () => [] });
63
+ //# sourceMappingURL=highlightText.directive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"highlightText.directive.js","sourceRoot":"","sources":["../../../../src/directives/highlightText/highlightText.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAa,MAAM,EAAiB,MAAM,eAAe,CAAC;AAE1H,OAAO,EAAC,eAAe,EAAC,MAAM,8CAA8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AAC,CAAC;IACP,CAAC;IAED,kGAAkG;IAElG;;OAEG;IACI,WAAW;QAEd,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACxD,CAAC;8GApEQ,aAAa;kGAAb,aAAa;;2FAAb,aAAa;kBAJzB,SAAS;mBACV;oBACI,QAAQ,EAAE,iBAAiB;iBAC9B","sourcesContent":["import {afterRenderEffect, Directive, effect, ElementRef, inject, OnDestroy, signal, WritableSignal} from '@angular/core';\n\nimport {HighlightSearch} from '../highlightSearch/highlightSearch.directive';\n\n/**\n * Directive that marks element that contains text that should be highlighted\n */\n@Directive(\n{\n selector: '[highlightText]',\n})\nexport class HighlightText implements OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Instance of element that will have highlighted text\n */\n protected element: ElementRef<HTMLElement> = inject(ElementRef);\n\n /**\n * Instance of HighlightSearch directive that is used to highlight text in the element\n */\n protected highlightSearch: HighlightSearch|undefined|null = inject(HighlightSearch, {optional: true});\n\n /**\n * Array of registered text nodes that are currently active on this element\n */\n protected textNodes: WritableSignal<Node[]> = signal([]);\n\n //######################### constructor #########################\n constructor()\n {\n if(!this.highlightSearch)\n {\n throw new Error('HighlightText: HighlightSearch directive is not found on parent elements. Use HighlightText within OptionTemplate directive.');\n }\n\n afterRenderEffect(\n {\n read: () =>\n {\n const nodes: Node[] = [];\n\n for(let x = 0; x < this.element.nativeElement.childNodes.length; x++)\n {\n const node = this.element.nativeElement.childNodes.item(x);\n\n if(node && node.nodeType === Node.TEXT_NODE)\n {\n nodes.push(node);\n }\n }\n\n this.textNodes.set(nodes);\n },\n });\n\n effect(() =>\n {\n const nodes = this.textNodes();\n\n if(!nodes.length)\n {\n return;\n }\n\n this.highlightSearch?.addNodes(nodes);\n });\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * @inheritdoc\n */\n public ngOnDestroy(): void\n {\n this.highlightSearch?.removeNodes(this.textNodes());\n }\n}\n"]}
@@ -1,3 +1,6 @@
1
+ export * from './highlightInstance/highlightInstance.directive';
2
+ export * from './highlightSearch/highlightSearch.directive';
3
+ export * from './highlightText/highlightText.directive';
1
4
  export * from './normalStateTemplate/normalStateTemplate.directive';
2
5
  export * from './normalStateTagTemplate/normalStateTagTemplate.directive';
3
6
  export * from './optionGroupTemplate/optionGroupTemplate.directive';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/directives/index.ts"],"names":[],"mappings":"AAAA,cAAc,qDAAqD,CAAC;AACpE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,qDAAqD,CAAC;AACpE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,mEAAmE,CAAC;AAClF,cAAc,mCAAmC,CAAC;AAClD,cAAc,iDAAiD,CAAC;AAChE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iDAAiD,CAAC;AAChE,cAAc,+CAA+C,CAAC","sourcesContent":["export * from './normalStateTemplate/normalStateTemplate.directive';\nexport * from './normalStateTagTemplate/normalStateTagTemplate.directive';\nexport * from './optionGroupTemplate/optionGroupTemplate.directive';\nexport * from './optionTemplate/optionTemplate.directive';\nexport * from './selectAbsolute/selectAbsolute.directive';\nexport * from './selectControlValueAccessor/selectControlValueAccessor.directive';\nexport * from './selectEdit/selectEdit.directive';\nexport * from './selectFormControl/selectFormControl.directive';\nexport * from './selectMultipleKeepPopup/selectMultipleKeepPopup.directive';\nexport * from './selectNoCarret/selectNoCarret.directive';\nexport * from './selectPlaceholder/selectPlaceholder.directive';\nexport * from './withDirectAccess/withDirectAccess.directive';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/directives/index.ts"],"names":[],"mappings":"AAAA,cAAc,iDAAiD,CAAC;AAChE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,yCAAyC,CAAC;AACxD,cAAc,qDAAqD,CAAC;AACpE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,qDAAqD,CAAC;AACpE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,mEAAmE,CAAC;AAClF,cAAc,mCAAmC,CAAC;AAClD,cAAc,iDAAiD,CAAC;AAChE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iDAAiD,CAAC;AAChE,cAAc,+CAA+C,CAAC","sourcesContent":["export * from './highlightInstance/highlightInstance.directive';\nexport * from './highlightSearch/highlightSearch.directive';\nexport * from './highlightText/highlightText.directive';\nexport * from './normalStateTemplate/normalStateTemplate.directive';\nexport * from './normalStateTagTemplate/normalStateTagTemplate.directive';\nexport * from './optionGroupTemplate/optionGroupTemplate.directive';\nexport * from './optionTemplate/optionTemplate.directive';\nexport * from './selectAbsolute/selectAbsolute.directive';\nexport * from './selectControlValueAccessor/selectControlValueAccessor.directive';\nexport * from './selectEdit/selectEdit.directive';\nexport * from './selectFormControl/selectFormControl.directive';\nexport * from './selectMultipleKeepPopup/selectMultipleKeepPopup.directive';\nexport * from './selectNoCarret/selectNoCarret.directive';\nexport * from './selectPlaceholder/selectPlaceholder.directive';\nexport * from './withDirectAccess/withDirectAccess.directive';\n"]}
@@ -18,10 +18,10 @@ export class NormalStateTagTemplate {
18
18
  static ngTemplateContextGuard(_dir, _ctx) {
19
19
  return true;
20
20
  }
21
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NormalStateTagTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
22
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.5", type: NormalStateTagTemplate, isStandalone: true, selector: "[normalStateTagTemplate]", exportAs: ["normalStateTagTemplate", ""], ngImport: i0 }); }
21
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NormalStateTagTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
22
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.4", type: NormalStateTagTemplate, isStandalone: true, selector: "[normalStateTagTemplate]", exportAs: ["normalStateTagTemplate", ""], ngImport: i0 }); }
23
23
  }
24
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NormalStateTagTemplate, decorators: [{
24
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NormalStateTagTemplate, decorators: [{
25
25
  type: Directive,
26
26
  args: [{
27
27
  selector: '[normalStateTagTemplate]',
@@ -18,10 +18,10 @@ export class NormalStateTemplate {
18
18
  static ngTemplateContextGuard(_dir, _ctx) {
19
19
  return true;
20
20
  }
21
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NormalStateTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
22
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.5", type: NormalStateTemplate, isStandalone: true, selector: "[normalStateTemplate]", exportAs: ["normalStateTemplate", ""], ngImport: i0 }); }
21
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NormalStateTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
22
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.4", type: NormalStateTemplate, isStandalone: true, selector: "[normalStateTemplate]", exportAs: ["normalStateTemplate", ""], ngImport: i0 }); }
23
23
  }
24
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NormalStateTemplate, decorators: [{
24
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NormalStateTemplate, decorators: [{
25
25
  type: Directive,
26
26
  args: [{
27
27
  selector: '[normalStateTemplate]',
@@ -18,10 +18,10 @@ export class OptionGroupTemplate {
18
18
  static ngTemplateContextGuard(_dir, _ctx) {
19
19
  return true;
20
20
  }
21
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: OptionGroupTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
22
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.5", type: OptionGroupTemplate, isStandalone: true, selector: "[optionGroupTemplate]", ngImport: i0 }); }
21
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: OptionGroupTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
22
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.4", type: OptionGroupTemplate, isStandalone: true, selector: "[optionGroupTemplate]", ngImport: i0 }); }
23
23
  }
24
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: OptionGroupTemplate, decorators: [{
24
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: OptionGroupTemplate, decorators: [{
25
25
  type: Directive,
26
26
  args: [{
27
27
  selector: '[optionGroupTemplate]',
@@ -18,10 +18,10 @@ export class OptionTemplate {
18
18
  static ngTemplateContextGuard(_dir, _ctx) {
19
19
  return true;
20
20
  }
21
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: OptionTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
22
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.5", type: OptionTemplate, isStandalone: true, selector: "[optionTemplate]", exportAs: ["optionTemplate"], ngImport: i0 }); }
21
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: OptionTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
22
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.4", type: OptionTemplate, isStandalone: true, selector: "[optionTemplate]", exportAs: ["optionTemplate"], ngImport: i0 }); }
23
23
  }
24
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: OptionTemplate, decorators: [{
24
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: OptionTemplate, decorators: [{
25
25
  type: Directive,
26
26
  args: [{
27
27
  selector: '[optionTemplate]',
@@ -13,10 +13,10 @@ export class SelectAbsolute {
13
13
  absolute: true,
14
14
  };
15
15
  }
16
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: SelectAbsolute, deps: [{ token: i1.Select }], target: i0.ɵɵFactoryTarget.Directive }); }
17
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.5", type: SelectAbsolute, isStandalone: true, selector: "ng-select[absolute]", ngImport: i0 }); }
16
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: SelectAbsolute, deps: [{ token: i1.Select }], target: i0.ɵɵFactoryTarget.Directive }); }
17
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.4", type: SelectAbsolute, isStandalone: true, selector: "ng-select[absolute]", ngImport: i0 }); }
18
18
  }
19
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: SelectAbsolute, decorators: [{
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: SelectAbsolute, decorators: [{
20
20
  type: Directive,
21
21
  args: [{
22
22
  selector: 'ng-select[absolute]',
@@ -28,11 +28,13 @@ export class SelectControlValueAccessor {
28
28
  /**
29
29
  * Last set value to this control
30
30
  */
31
- this.value = signal(undefined, ...(ngDevMode ? [{ debugName: "value" }] : []));
31
+ this.value = signal(undefined, /* @ts-ignore */
32
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
32
33
  /**
33
34
  * Indication whether disable Select
34
35
  */
35
- this.disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
36
+ this.disabled = signal(false, /* @ts-ignore */
37
+ ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
36
38
  effect(() => {
37
39
  if (!select.initialized()) {
38
40
  return;
@@ -90,10 +92,10 @@ export class SelectControlValueAccessor {
90
92
  ngOnDestroy() {
91
93
  this.initSubscriptions.unsubscribe();
92
94
  }
93
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: SelectControlValueAccessor, deps: [{ token: i1.Select }], target: i0.ɵɵFactoryTarget.Directive }); }
94
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.5", type: SelectControlValueAccessor, isStandalone: true, selector: "ng-select[formControlName],ng-select[formControl],ng-select[ngModel]", providers: [SELECT_VALUE_ACCESSOR], ngImport: i0 }); }
95
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: SelectControlValueAccessor, deps: [{ token: i1.Select }], target: i0.ɵɵFactoryTarget.Directive }); }
96
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.4", type: SelectControlValueAccessor, isStandalone: true, selector: "ng-select[formControlName],ng-select[formControl],ng-select[ngModel]", providers: [SELECT_VALUE_ACCESSOR], ngImport: i0 }); }
95
97
  }
96
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: SelectControlValueAccessor, decorators: [{
98
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: SelectControlValueAccessor, decorators: [{
97
99
  type: Directive,
98
100
  args: [{
99
101
  selector: 'ng-select[formControlName],ng-select[formControl],ng-select[ngModel]',
@@ -1 +1 @@
1
- {"version":3,"file":"selectControlValueAccessor.directive.js","sourceRoot":"","sources":["../../../../src/directives/selectControlValueAccessor/selectControlValueAccessor.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAoB,SAAS,EAA6B,MAAM,EAAE,MAAM,EAAE,SAAS,EAAC,MAAM,eAAe,CAAC;AAC5H,OAAO,EAAC,iBAAiB,EAAuB,MAAM,gBAAgB,CAAC;AAEvE,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,0CAA0C,CAAC;;;AAEhE;;GAEG;AACH,MAAM,qBAAqB,GAC3B;IACI,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,0BAA0B,CAAC;IACzD,KAAK,EAAE,IAAI;CACd,CAAC;AAEF;;GAEG;AAMH,MAAM,OAAO,0BAA0B;IA6BnC,iEAAiE;IACjE,YAAY,MAAoC;QA5BhD,sEAAsE;QAEtE;;WAEG;QACO,sBAAiB,GAAiB,IAAI,YAAY,EAAE,CAAC;QAE/D;;WAEG;QACO,UAAK,GAA+D,MAAM,CAAC,SAAS,iDAAC,CAAC;QAEhG;;WAEG;QACO,aAAQ,GAA4B,MAAM,CAAC,KAAK,oDAAC,CAAC;QAexD,MAAM,CAAC,GAAG,EAAE;YAER,IAAG,CAAC,MAAM,CAAC,WAAW,EAAE,EACxB,CAAC;gBACG,OAAO;YACX,CAAC;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G,EAAE,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,gBAAgB,CAAC,UAAmB;QAEvC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC;IAED,kGAAkG;IAElG;;OAEG;IACI,WAAW;QAEd,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,CAAC;IACzC,CAAC;8GAnHQ,0BAA0B;kGAA1B,0BAA0B,mHAFxB,CAAC,qBAAqB,CAAC;;2FAEzB,0BAA0B;kBALtC,SAAS;mBACV;oBACI,QAAQ,EAAE,sEAAsE;oBAChF,SAAS,EAAE,CAAC,qBAAqB,CAAC;iBACrC","sourcesContent":["import {forwardRef, ExistingProvider, Directive, OnDestroy, WritableSignal, signal, effect, untracked} from '@angular/core';\nimport {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms';\nimport {Action1, NoopAction} from '@jscrpt/common';\nimport {isEqual} from 'lodash-es';\nimport {Subscription} from 'rxjs';\n\nimport {SelectPluginType} from '../../misc/enums';\nimport {Select} from '../../components/select/select.component';\n\n/**\n * Provider for control value accessor\n */\nconst SELECT_VALUE_ACCESSOR: ExistingProvider =\n{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SelectControlValueAccessor),\n multi: true,\n};\n\n/**\n * Control value accessor for Select\n */\n@Directive(\n{\n selector: 'ng-select[formControlName],ng-select[formControl],ng-select[ngModel]',\n providers: [SELECT_VALUE_ACCESSOR],\n})\nexport class SelectControlValueAccessor<TValue = unknown, TPublicValue = TValue> implements ControlValueAccessor, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n /**\n * Last set value to this control\n */\n protected value: WritableSignal<TPublicValue|TPublicValue[]|undefined|null> = signal(undefined);\n\n /**\n * Indication whether disable Select\n */\n protected disabled: WritableSignal<boolean> = signal(false);\n\n /**\n * On change callback for setting value back to control\n */\n protected onChange: Action1<TPublicValue|TPublicValue[]|undefined|null>|undefined|null;\n\n /**\n * On touched callback for setting touched back to control\n */\n protected onTouched: NoopAction|undefined|null;\n\n //######################### constructor #########################\n constructor(select: Select<TValue, TPublicValue>)\n {\n effect(() =>\n {\n if(!select.initialized())\n {\n return;\n }\n\n select.getPlugin(SelectPluginType.ValueHandler).setValue(this.value());\n });\n\n effect(() =>\n {\n if(!select.initialized())\n {\n return;\n }\n\n select.selectOptions.readonly = this.disabled();\n });\n\n effect(() =>\n {\n if(!select.initialized())\n {\n return;\n }\n\n const value = select.getPlugin(SelectPluginType.ValueHandler).value();\n\n untracked(() =>\n {\n if(!isEqual(value, this.value()))\n {\n this.onChange?.(value);\n }\n });\n });\n\n this.initSubscriptions.add(select.events.focus.subscribe(() => this.onTouched?.()));\n }\n\n //######################### public methods - implementation of ControlValueAccessor #########################\n\n /**\n * @inheritdoc\n */\n public writeValue(value: TPublicValue|TPublicValue[]|undefined|null): void\n {\n this.value.set(value);\n }\n\n /**\n * @inheritdoc\n */\n public registerOnChange(fn: (data: TPublicValue|TPublicValue[]|undefined|null) => void): void\n {\n this.onChange = fn;\n }\n\n /**\n * @inheritdoc\n */\n public registerOnTouched(fn: () => void): void\n {\n this.onTouched = fn;\n }\n\n /**\n * @inheritdoc\n */\n public setDisabledState(isDisabled: boolean): void\n {\n this.disabled.set(isDisabled);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * @inheritdoc\n */\n public ngOnDestroy()\n {\n this.initSubscriptions.unsubscribe();\n }\n}\n"]}
1
+ {"version":3,"file":"selectControlValueAccessor.directive.js","sourceRoot":"","sources":["../../../../src/directives/selectControlValueAccessor/selectControlValueAccessor.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAoB,SAAS,EAA6B,MAAM,EAAE,MAAM,EAAE,SAAS,EAAC,MAAM,eAAe,CAAC;AAC5H,OAAO,EAAC,iBAAiB,EAAuB,MAAM,gBAAgB,CAAC;AAEvE,OAAO,EAAC,OAA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CAAC,YAAY,CAAC,CAAC,KAAK,EAAE,CAAC;YAEtE,SAAS,CAAC,GAAG,EAAE;gBAEX,IAAG,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,EAChC,CAAC;oBACG,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC;gBAC3B,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC;IACxF,CAAC;IAED,6GAA6G;IAE7G;;OAEG;IACI,UAAU,CAAC,KAAiD;QAE/D,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IAED;;OAEG;IACI,gBAAgB,CAAC,EAA8D;QAElF,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;IACvB,CAAC;IAED;;OAEG;IACI,iBAAiB,CAAC,EAAc;QAEnC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,gBAAgB,CAAC,UAAmB;QAEvC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC;IAED,kGAAkG;IAElG;;OAEG;IACI,WAAW;QAEd,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,CAAC;IACzC,CAAC;8GAnHQ,0BAA0B;kGAA1B,0BAA0B,mHAFxB,CAAC,qBAAqB,CAAC;;2FAEzB,0BAA0B;kBALtC,SAAS;mBACV;oBACI,QAAQ,EAAE,sEAAsE;oBAChF,SAAS,EAAE,CAAC,qBAAqB,CAAC;iBACrC","sourcesContent":["import {forwardRef, ExistingProvider, Directive, OnDestroy, WritableSignal, signal, effect, untracked} from '@angular/core';\nimport {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms';\nimport {Action1, NoopAction} from '@jscrpt/common';\nimport {isEqual} from 'lodash-es';\nimport {Subscription} from 'rxjs';\n\nimport {SelectPluginType} from '../../misc/enums';\nimport {Select} from '../../components/select/select.component';\n\n/**\n * Provider for control value accessor\n */\nconst SELECT_VALUE_ACCESSOR: ExistingProvider =\n{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SelectControlValueAccessor),\n multi: true,\n};\n\n/**\n * Control value accessor for Select\n */\n@Directive(\n{\n selector: 'ng-select[formControlName],ng-select[formControl],ng-select[ngModel]',\n providers: [SELECT_VALUE_ACCESSOR],\n})\nexport class SelectControlValueAccessor<TValue = unknown, TPublicValue = TValue> implements ControlValueAccessor, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n /**\n * Last set value to this control\n */\n protected value: WritableSignal<TPublicValue|TPublicValue[]|undefined|null> = signal(undefined);\n\n /**\n * Indication whether disable Select\n */\n protected disabled: WritableSignal<boolean> = signal(false);\n\n /**\n * On change callback for setting value back to control\n */\n protected onChange: Action1<TPublicValue|TPublicValue[]|undefined|null>|undefined|null;\n\n /**\n * On touched callback for setting touched back to control\n */\n protected onTouched: NoopAction|undefined|null;\n\n //######################### constructor #########################\n constructor(select: Select<TValue, TPublicValue>)\n {\n effect(() =>\n {\n if(!select.initialized())\n {\n return;\n }\n\n select.getPlugin(SelectPluginType.ValueHandler).setValue(this.value());\n });\n\n effect(() =>\n {\n if(!select.initialized())\n {\n return;\n }\n\n select.selectOptions.readonly = this.disabled();\n });\n\n effect(() =>\n {\n if(!select.initialized())\n {\n return;\n }\n\n const value = select.getPlugin(SelectPluginType.ValueHandler).value();\n\n untracked(() =>\n {\n if(!isEqual(value, this.value()))\n {\n this.onChange?.(value);\n }\n });\n });\n\n this.initSubscriptions.add(select.events.focus.subscribe(() => this.onTouched?.()));\n }\n\n //######################### public methods - implementation of ControlValueAccessor #########################\n\n /**\n * @inheritdoc\n */\n public writeValue(value: TPublicValue|TPublicValue[]|undefined|null): void\n {\n this.value.set(value);\n }\n\n /**\n * @inheritdoc\n */\n public registerOnChange(fn: (data: TPublicValue|TPublicValue[]|undefined|null) => void): void\n {\n this.onChange = fn;\n }\n\n /**\n * @inheritdoc\n */\n public registerOnTouched(fn: () => void): void\n {\n this.onTouched = fn;\n }\n\n /**\n * @inheritdoc\n */\n public setDisabledState(isDisabled: boolean): void\n {\n this.disabled.set(isDisabled);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * @inheritdoc\n */\n public ngOnDestroy()\n {\n this.initSubscriptions.unsubscribe();\n }\n}\n"]}
@@ -22,13 +22,13 @@ export class SelectEdit {
22
22
  },
23
23
  };
24
24
  }
25
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: SelectEdit, deps: [{ token: i1.Select }], target: i0.ɵɵFactoryTarget.Directive }); }
26
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.5", type: SelectEdit, isStandalone: true, selector: "ng-select[edit]", providers: [
25
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: SelectEdit, deps: [{ token: i1.Select }], target: i0.ɵɵFactoryTarget.Directive }); }
26
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.4", type: SelectEdit, isStandalone: true, selector: "ng-select[edit]", providers: [
27
27
  provideNormalStateType(EditNormalState),
28
28
  provideLiveSearchType(EditLiveSearch),
29
29
  ], ngImport: i0 }); }
30
30
  }
31
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: SelectEdit, decorators: [{
31
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: SelectEdit, decorators: [{
32
32
  type: Directive,
33
33
  args: [{
34
34
  selector: 'ng-select[edit]',
@@ -26,19 +26,23 @@ export class SelectFormControl {
26
26
  /**
27
27
  * @inheritdoc
28
28
  */
29
- this.value = model(undefined, ...(ngDevMode ? [{ debugName: "value" }] : []));
29
+ this.value = model(undefined, /* @ts-ignore */
30
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
30
31
  /**
31
32
  * @inheritdoc
32
33
  */
33
- this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
34
+ this.disabled = input(false, /* @ts-ignore */
35
+ ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
34
36
  /**
35
37
  * @inheritdoc
36
38
  */
37
- this.readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : []));
39
+ this.readonly = input(false, /* @ts-ignore */
40
+ ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
38
41
  /**
39
42
  * @inheritdoc
40
43
  */
41
- this.touched = model(false, ...(ngDevMode ? [{ debugName: "touched" }] : []));
44
+ this.touched = model(false, /* @ts-ignore */
45
+ ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
42
46
  this.initSubscriptions.add(this.select.events.focus.subscribe(() => this.touched.set(true)));
43
47
  effect(() => this.select.selectOptions.readonly = this.disabled() || this.readonly());
44
48
  effect(() => {
@@ -82,10 +86,10 @@ export class SelectFormControl {
82
86
  ngOnDestroy() {
83
87
  this.initSubscriptions.unsubscribe();
84
88
  }
85
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: SelectFormControl, deps: [{ token: i1.Select }], target: i0.ɵɵFactoryTarget.Directive }); }
86
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.5", type: SelectFormControl, isStandalone: true, selector: "ng-select[formField]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touched: "touchedChange" }, ngImport: i0 }); }
89
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: SelectFormControl, deps: [{ token: i1.Select }], target: i0.ɵɵFactoryTarget.Directive }); }
90
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.4", type: SelectFormControl, isStandalone: true, selector: "ng-select[formField]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touched: "touchedChange" }, ngImport: i0 }); }
87
91
  }
88
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: SelectFormControl, decorators: [{
92
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: SelectFormControl, decorators: [{
89
93
  type: Directive,
90
94
  args: [{
91
95
  selector: 'ng-select[formField]',
@@ -1 +1 @@
1
- {"version":3,"file":"selectFormControl.directive.js","sourceRoot":"","sources":["../../../../src/directives/selectFormControl/selectFormControl.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAe,KAAK,EAA0B,SAAS,EAAC,MAAM,eAAe,CAAC;AAEtH,OAAO,EAAC,MAAM,EAAS,MAAM,eAAe,CA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AAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;IAClC,CAAC;IAED,kGAAkG;IAElG;;OAEG;IACI,WAAW;QAEd,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,CAAC;IACzC,CAAC;8GA3GQ,iBAAiB;kGAAjB,iBAAiB;;2FAAjB,iBAAiB;kBAJ7B,SAAS;mBACV;oBACI,QAAQ,EAAE,sBAAsB;iBACnC","sourcesContent":["import {Directive, effect, inject, input, InputSignal, model, ModelSignal, OnDestroy, untracked} from '@angular/core';\nimport {FormValueControl} from '@angular/forms/signals';\nimport {LOGGER, Logger} from '@anglr/common';\nimport {isEqual} from 'lodash-es';\nimport {Subscription} from 'rxjs';\n\nimport {Select} from '../../components/select/select.component';\nimport {SelectPluginType} from '../../misc/enums';\n\n/**\n * Form value control for Select\n */\n@Directive(\n{\n selector: 'ng-select[formField]',\n})\nexport class SelectFormControl<TValue = unknown, TPublicValue = TValue> implements FormValueControl<TPublicValue|TPublicValue[]|undefined|null>, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Instance of logger for logging purposes\n */\n protected logger: Logger = inject(LOGGER);\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n //######################### public properties - implementation of FormValueControl #########################\n\n /**\n * @inheritdoc\n */\n public readonly value: ModelSignal<TPublicValue|TPublicValue[]|null|undefined> = model<TPublicValue|TPublicValue[]|null|undefined>(undefined);\n\n /**\n * @inheritdoc\n */\n public checked: undefined;\n\n /**\n * @inheritdoc\n */\n public readonly disabled: InputSignal<boolean> = input(false);\n\n /**\n * @inheritdoc\n */\n public readonly readonly: InputSignal<boolean> = input(false);\n\n /**\n * @inheritdoc\n */\n public readonly touched: ModelSignal<boolean> = model(false);\n\n //######################### constructor #########################\n constructor(protected select: Select<TValue, TPublicValue>)\n {\n this.initSubscriptions.add(this.select.events.focus.subscribe(() => this.touched.set(true)));\n\n effect(() => this.select.selectOptions.readonly = this.disabled() || this.readonly());\n\n effect(() =>\n {\n if(!this.select.initialized())\n {\n return;\n }\n\n const value = this.value();\n this.logger.verbose('Select: Form control: control value changed \"{{@(4)value}}\"', {value});\n\n untracked(() =>\n {\n if(!isEqual(this.select.getPlugin(SelectPluginType.ValueHandler).value(), value))\n {\n this.logger.verbose('Select: Form control: setting select value \"{{@(4)value}}\"', {value});\n this.select.getPlugin(SelectPluginType.ValueHandler).setValue(value);\n }\n });\n });\n\n effect(() =>\n {\n if(!this.select.initialized())\n {\n return;\n }\n\n const value = this.select.getPlugin(SelectPluginType.ValueHandler).value();\n this.logger.verbose('Select: Form control: select value changed \"{{@(4)value}}\"', {value});\n\n untracked(() =>\n {\n if(!isEqual(this.value(), value))\n {\n this.logger.verbose('Select: Form control: setting control value \"{{@(4)value}}\"', {value});\n this.value.set(value);\n }\n });\n });\n }\n\n //######################### public methods - implementation of FormValueControl #########################\n\n /**\n * @inheritdoc\n */\n public focus(): void\n {\n this.select.events.setFocus();\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * @inheritdoc\n */\n public ngOnDestroy(): void\n {\n this.initSubscriptions.unsubscribe();\n }\n}\n"]}
1
+ {"version":3,"file":"selectFormControl.directive.js","sourceRoot":"","sources":["../../../../src/directives/selectFormControl/selectFormControl.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAe,KAAK,EAA0B,SAAS,EAAC,MAAM,eAAe,CAAC;AAEtH,OAAO,EAAC,MAAM,EAAS,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,EAAC,MAAM,EAAC,MAAM,0CAA0C,CAAC;AAChE,OAAO,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;;;AAElD;;GAEG;AAKH,MAAM,OAAO,iBAAiB;IAyC1B,iEAAiE;IACjE,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sourcesContent":["import {Directive, effect, inject, input, InputSignal, model, ModelSignal, OnDestroy, untracked} from '@angular/core';\nimport {FormValueControl} from '@angular/forms/signals';\nimport {LOGGER, Logger} from '@anglr/common';\nimport {isEqual} from 'lodash-es';\nimport {Subscription} from 'rxjs';\n\nimport {Select} from '../../components/select/select.component';\nimport {SelectPluginType} from '../../misc/enums';\n\n/**\n * Form value control for Select\n */\n@Directive(\n{\n selector: 'ng-select[formField]',\n})\nexport class SelectFormControl<TValue = unknown, TPublicValue = TValue> implements FormValueControl<TPublicValue|TPublicValue[]|undefined|null>, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Instance of logger for logging purposes\n */\n protected logger: Logger = inject(LOGGER);\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n //######################### public properties - implementation of FormValueControl #########################\n\n /**\n * @inheritdoc\n */\n public readonly value: ModelSignal<TPublicValue|TPublicValue[]|null|undefined> = model<TPublicValue|TPublicValue[]|null|undefined>(undefined);\n\n /**\n * @inheritdoc\n */\n public checked: undefined;\n\n /**\n * @inheritdoc\n */\n public readonly disabled: InputSignal<boolean> = input(false);\n\n /**\n * @inheritdoc\n */\n public readonly readonly: InputSignal<boolean> = input(false);\n\n /**\n * @inheritdoc\n */\n public readonly touched: ModelSignal<boolean> = model(false);\n\n //######################### constructor #########################\n constructor(protected select: Select<TValue, TPublicValue>)\n {\n this.initSubscriptions.add(this.select.events.focus.subscribe(() => this.touched.set(true)));\n\n effect(() => this.select.selectOptions.readonly = this.disabled() || this.readonly());\n\n effect(() =>\n {\n if(!this.select.initialized())\n {\n return;\n }\n\n const value = this.value();\n this.logger.verbose('Select: Form control: control value changed \"{{@(4)value}}\"', {value});\n\n untracked(() =>\n {\n if(!isEqual(this.select.getPlugin(SelectPluginType.ValueHandler).value(), value))\n {\n this.logger.verbose('Select: Form control: setting select value \"{{@(4)value}}\"', {value});\n this.select.getPlugin(SelectPluginType.ValueHandler).setValue(value);\n }\n });\n });\n\n effect(() =>\n {\n if(!this.select.initialized())\n {\n return;\n }\n\n const value = this.select.getPlugin(SelectPluginType.ValueHandler).value();\n this.logger.verbose('Select: Form control: select value changed \"{{@(4)value}}\"', {value});\n\n untracked(() =>\n {\n if(!isEqual(this.value(), value))\n {\n this.logger.verbose('Select: Form control: setting control value \"{{@(4)value}}\"', {value});\n this.value.set(value);\n }\n });\n });\n }\n\n //######################### public methods - implementation of FormValueControl #########################\n\n /**\n * @inheritdoc\n */\n public focus(): void\n {\n this.select.events.setFocus();\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * @inheritdoc\n */\n public ngOnDestroy(): void\n {\n this.initSubscriptions.unsubscribe();\n }\n}\n"]}
@@ -10,10 +10,10 @@ export class SelectMultipleKeepPopup {
10
10
  constructor(select) {
11
11
  select.selectOptions.closeOnSelect = false;
12
12
  }
13
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: SelectMultipleKeepPopup, deps: [{ token: i1.Select }], target: i0.ɵɵFactoryTarget.Directive }); }
14
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.5", type: SelectMultipleKeepPopup, isStandalone: true, selector: "ng-select[multiple]", ngImport: i0 }); }
13
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: SelectMultipleKeepPopup, deps: [{ token: i1.Select }], target: i0.ɵɵFactoryTarget.Directive }); }
14
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.4", type: SelectMultipleKeepPopup, isStandalone: true, selector: "ng-select[multiple]", ngImport: i0 }); }
15
15
  }
16
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: SelectMultipleKeepPopup, decorators: [{
16
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: SelectMultipleKeepPopup, decorators: [{
17
17
  type: Directive,
18
18
  args: [{
19
19
  selector: 'ng-select[multiple]',
@@ -19,10 +19,10 @@ export class SelectNoCarret {
19
19
  },
20
20
  };
21
21
  }
22
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: SelectNoCarret, deps: [{ token: i1.Select }], target: i0.ɵɵFactoryTarget.Directive }); }
23
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.5", type: SelectNoCarret, isStandalone: true, selector: "ng-select[noCarret]", ngImport: i0 }); }
22
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: SelectNoCarret, deps: [{ token: i1.Select }], target: i0.ɵɵFactoryTarget.Directive }); }
23
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.4", type: SelectNoCarret, isStandalone: true, selector: "ng-select[noCarret]", ngImport: i0 }); }
24
24
  }
25
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: SelectNoCarret, decorators: [{
25
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: SelectNoCarret, decorators: [{
26
26
  type: Directive,
27
27
  args: [{
28
28
  selector: 'ng-select[noCarret]',
@@ -12,7 +12,8 @@ export class SelectPlaceholder {
12
12
  /**
13
13
  * Placeholder text used for Select
14
14
  */
15
- this.placeholder = input.required(...(ngDevMode ? [{ debugName: "placeholder" }] : []));
15
+ this.placeholder = input.required(/* @ts-ignore */
16
+ ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
16
17
  effect(() => {
17
18
  select.selectOptions =
18
19
  {
@@ -20,10 +21,10 @@ export class SelectPlaceholder {
20
21
  };
21
22
  });
22
23
  }
23
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: SelectPlaceholder, deps: [{ token: i1.Select }], target: i0.ɵɵFactoryTarget.Directive }); }
24
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.5", type: SelectPlaceholder, isStandalone: true, selector: "ng-select[placeholder]", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
24
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: SelectPlaceholder, deps: [{ token: i1.Select }], target: i0.ɵɵFactoryTarget.Directive }); }
25
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.4", type: SelectPlaceholder, isStandalone: true, selector: "ng-select[placeholder]", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
25
26
  }
26
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: SelectPlaceholder, decorators: [{
27
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: SelectPlaceholder, decorators: [{
27
28
  type: Directive,
28
29
  args: [{
29
30
  selector: 'ng-select[placeholder]',
@@ -1 +1 @@
1
- {"version":3,"file":"selectPlaceholder.directive.js","sourceRoot":"","sources":["../../../../src/directives/selectPlaceholder/selectPlaceholder.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAc,MAAM,eAAe,CAAC;AAGpE,OAAO,EAAC,MAAM,EAAC,MAAM,0CAA0C,CAAC;;;AAEhE;;GAEG;AAKH,MAAM,OAAO,iBAAiB;IAS1B,iEAAiE;IACjE,YAAY,MAAoC;QARhD,gFAAgF;QAEhF;;WAEG;QACI,gBAAW,GAAwB,KAAK,CAAC,QAAQ,sDAAE,CAAC;QAKvD,MAAM,CAAC,GAAG,EAAE;YAER,MAAM,CAAC,aAAa;gBACpB;oBACI,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;iBACK,CAAC;QAC7C,CAAC,CAAC,CAAC;IACP,CAAC;8GAnBQ,iBAAiB;kGAAjB,iBAAiB;;2FAAjB,iBAAiB;kBAJ7B,SAAS;mBACV;oBACI,QAAQ,EAAE,wBAAwB;iBACrC","sourcesContent":["import {Directive, effect, input, InputSignal} from '@angular/core';\n\nimport {SelectOptions} from '../../interfaces';\nimport {Select} from '../../components/select/select.component';\n\n/**\n * Directive used for setting live search placeholder text\n */\n@Directive(\n{\n selector: 'ng-select[placeholder]',\n})\nexport class SelectPlaceholder<TValue = unknown, TPublicValue = TValue>\n{\n //######################### public properties - inputs #########################\n\n /**\n * Placeholder text used for Select\n */\n public placeholder: InputSignal<string> = input.required();\n\n //######################### constructor #########################\n constructor(select: Select<TValue, TPublicValue>)\n {\n effect(() =>\n {\n select.selectOptions =\n {\n placeholder: this.placeholder(),\n } as SelectOptions<TValue, TPublicValue>;\n });\n }\n}\n"]}
1
+ {"version":3,"file":"selectPlaceholder.directive.js","sourceRoot":"","sources":["../../../../src/directives/selectPlaceholder/selectPlaceholder.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAc,MAAM,eAAe,CAAC;AAGpE,OAAO,EAAC,MAAM,EAAC,MAAM,0CAA0C,CAAC;;;AAEhE;;GAEG;AAKH,MAAM,OAAO,iBAAiB;IAS1B,iEAAiE;IACjE,YAAY,MAAoC;QARhD,gFAAgF;QAEhF;;WAEG;QACI,gBAAW,GAAwB,KAAK,CAAC,QAAQ;wFAAE,CAAC;QAKvD,MAAM,CAAC,GAAG,EAAE;YAER,MAAM,CAAC,aAAa;gBACpB;oBACI,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;iBACK,CAAC;QAC7C,CAAC,CAAC,CAAC;IACP,CAAC;8GAnBQ,iBAAiB;kGAAjB,iBAAiB;;2FAAjB,iBAAiB;kBAJ7B,SAAS;mBACV;oBACI,QAAQ,EAAE,wBAAwB;iBACrC","sourcesContent":["import {Directive, effect, input, InputSignal} from '@angular/core';\n\nimport {SelectOptions} from '../../interfaces';\nimport {Select} from '../../components/select/select.component';\n\n/**\n * Directive used for setting live search placeholder text\n */\n@Directive(\n{\n selector: 'ng-select[placeholder]',\n})\nexport class SelectPlaceholder<TValue = unknown, TPublicValue = TValue>\n{\n //######################### public properties - inputs #########################\n\n /**\n * Placeholder text used for Select\n */\n public placeholder: InputSignal<string> = input.required();\n\n //######################### constructor #########################\n constructor(select: Select<TValue, TPublicValue>)\n {\n effect(() =>\n {\n select.selectOptions =\n {\n placeholder: this.placeholder(),\n } as SelectOptions<TValue, TPublicValue>;\n });\n }\n}\n"]}
@@ -14,7 +14,8 @@ export class WithDirectAccess {
14
14
  /**
15
15
  * Value of the Select to be set
16
16
  */
17
- this.value = model(undefined, ...(ngDevMode ? [{ debugName: "value" }] : []));
17
+ this.value = model(undefined, /* @ts-ignore */
18
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
18
19
  effect(() => {
19
20
  if (!select.initialized()) {
20
21
  return;
@@ -38,10 +39,10 @@ export class WithDirectAccess {
38
39
  });
39
40
  });
40
41
  }
41
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: WithDirectAccess, deps: [{ token: i1.Select }], target: i0.ɵɵFactoryTarget.Directive }); }
42
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.5", type: WithDirectAccess, isStandalone: true, selector: "ng-select[withDirectAccess]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, ngImport: i0 }); }
42
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: WithDirectAccess, deps: [{ token: i1.Select }], target: i0.ɵɵFactoryTarget.Directive }); }
43
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.4", type: WithDirectAccess, isStandalone: true, selector: "ng-select[withDirectAccess]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, ngImport: i0 }); }
43
44
  }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: WithDirectAccess, decorators: [{
45
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: WithDirectAccess, decorators: [{
45
46
  type: Directive,
46
47
  args: [{
47
48
  selector: 'ng-select[withDirectAccess]',
@@ -1 +1 @@
1
- {"version":3,"file":"withDirectAccess.directive.js","sourceRoot":"","sources":["../../../../src/directives/withDirectAccess/withDirectAccess.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAe,SAAS,EAAC,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,OAAO,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,0CAA0C,CAAC;;;AAEhE;;GAEG;AAKH,MAAM,OAAO,gBAAgB;IASzB,iEAAiE;IACjE,YAAY,MAAoC;QARhD,wFAAwF;QAExF;;WAEG;QACI,UAAK,GAA4D,KAAK,CAA6C,SAAS,iDAAC,CAAC;QAKjI,MAAM,CAAC,GAAG,EAAE;YAER,IAAG,CAAC,MAAM,CAAC,WAAW,EAAE,EACxB,CAAC;gBACG,OAAO;YACX,CAAC;YAED,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;YAE3B,SAAS,CAAC,GAAG,EAAE;gBAEX,IAAG,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,CAAC,EAC3E,CAAC;oBACG,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;gBACpE,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,GAAG,EAAE;YAER,IAAG,CAAC,MAAM,CAAC,WAAW,EAAE,EACxB,CAAC;gBACG,OAAO;YACX,CAAC;YAED,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,KAAK,EAAE,CAAC;YAEtE,SAAS,CAAC,GAAG,EAAE;gBAEX,IAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,KAAK,CAAC,EAChC,CAAC;oBACG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBAC1B,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;8GA/CQ,gBAAgB;kGAAhB,gBAAgB;;2FAAhB,gBAAgB;kBAJ5B,SAAS;mBACV;oBACI,QAAQ,EAAE,6BAA6B;iBAC1C","sourcesContent":["import {Directive, effect, model, ModelSignal, untracked} from '@angular/core';\nimport {isEqual} from 'lodash-es';\n\nimport {SelectPluginType} from '../../misc/enums';\nimport {Select} from '../../components/select/select.component';\n\n/**\n * Directive that allows direct access to select properties using inputs, outputs\n */\n@Directive(\n{\n selector: 'ng-select[withDirectAccess]',\n})\nexport class WithDirectAccess<TValue = unknown, TPublicValue = TValue>\n{\n //######################### public properties - inputs/outputs #########################\n\n /**\n * Value of the Select to be set\n */\n public value: ModelSignal<TPublicValue|TPublicValue[]|undefined|null> = model<TPublicValue|TPublicValue[]|undefined|null>(undefined);\n\n //######################### constructor #########################\n constructor(select: Select<TValue, TPublicValue>,)\n {\n effect(() =>\n {\n if(!select.initialized())\n {\n return;\n }\n\n const value = this.value();\n\n untracked(() =>\n {\n if(!isEqual(select.getPlugin(SelectPluginType.ValueHandler).value(), value))\n {\n select.getPlugin(SelectPluginType.ValueHandler).setValue(value);\n }\n });\n });\n\n effect(() =>\n {\n if(!select.initialized())\n {\n return;\n }\n\n const value = select.getPlugin(SelectPluginType.ValueHandler).value();\n\n untracked(() =>\n {\n if(!isEqual(this.value(), value))\n {\n this.value.set(value);\n }\n });\n });\n }\n}\n"]}
1
+ {"version":3,"file":"withDirectAccess.directive.js","sourceRoot":"","sources":["../../../../src/directives/withDirectAccess/withDirectAccess.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAe,SAAS,EAAC,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,OAAO,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,0CAA0C,CAAC;;;AAEhE;;GAEG;AAKH,MAAM,OAAO,gBAAgB;IASzB,iEAAiE;IACjE,YAAY,MAAoC;QARhD,wFAAwF;QAExF;;WAEG;QACI,UAAK,GAA4D,KAAK,CAA6C,SAAS;kFAAC,CAAC;QAKjI,MAAM,CAAC,GAAG,EAAE;YAER,IAAG,CAAC,MAAM,CAAC,WAAW,EAAE,EACxB,CAAC;gBACG,OAAO;YACX,CAAC;YAED,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;YAE3B,SAAS,CAAC,GAAG,EAAE;gBAEX,IAAG,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,CAAC,EAC3E,CAAC;oBACG,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;gBACpE,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,GAAG,EAAE;YAER,IAAG,CAAC,MAAM,CAAC,WAAW,EAAE,EACxB,CAAC;gBACG,OAAO;YACX,CAAC;YAED,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,KAAK,EAAE,CAAC;YAEtE,SAAS,CAAC,GAAG,EAAE;gBAEX,IAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,KAAK,CAAC,EAChC,CAAC;oBACG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBAC1B,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;8GA/CQ,gBAAgB;kGAAhB,gBAAgB;;2FAAhB,gBAAgB;kBAJ5B,SAAS;mBACV;oBACI,QAAQ,EAAE,6BAA6B;iBAC1C","sourcesContent":["import {Directive, effect, model, ModelSignal, untracked} from '@angular/core';\nimport {isEqual} from 'lodash-es';\n\nimport {SelectPluginType} from '../../misc/enums';\nimport {Select} from '../../components/select/select.component';\n\n/**\n * Directive that allows direct access to select properties using inputs, outputs\n */\n@Directive(\n{\n selector: 'ng-select[withDirectAccess]',\n})\nexport class WithDirectAccess<TValue = unknown, TPublicValue = TValue>\n{\n //######################### public properties - inputs/outputs #########################\n\n /**\n * Value of the Select to be set\n */\n public value: ModelSignal<TPublicValue|TPublicValue[]|undefined|null> = model<TPublicValue|TPublicValue[]|undefined|null>(undefined);\n\n //######################### constructor #########################\n constructor(select: Select<TValue, TPublicValue>,)\n {\n effect(() =>\n {\n if(!select.initialized())\n {\n return;\n }\n\n const value = this.value();\n\n untracked(() =>\n {\n if(!isEqual(select.getPlugin(SelectPluginType.ValueHandler).value(), value))\n {\n select.getPlugin(SelectPluginType.ValueHandler).setValue(value);\n }\n });\n });\n\n effect(() =>\n {\n if(!select.initialized())\n {\n return;\n }\n\n const value = select.getPlugin(SelectPluginType.ValueHandler).value();\n\n untracked(() =>\n {\n if(!isEqual(this.value(), value))\n {\n this.value.set(value);\n }\n });\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"popup.interface.js","sourceRoot":"","sources":["../../../../../src/interfaces/plugins/popup/popup.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {SelectPlugin} from '../../selectPlugin/selectPlugin.interface';\nimport {VisualPluginOptions} from '../../visualPluginOptions/visualPluginOptions.interface';\n\n/**\n * Texts that are used within Popup\n */\nexport interface PopupTexts\n{\n /**\n * Displayed when there are no available options to be displayed\n */\n noAvailableOptions: string;\n\n /**\n * Displayed when add new option is displayed\n */\n addNewOption: string;\n\n /**\n * ARIA label for options list\n */\n optionsList: string;\n}\n\n/**\n * CSS classes for pupup plugin\n */\nexport interface PopupCssClasses\n{\n}\n\n/**\n * Options for popup plugin\n */\nexport interface PopupOptions<TCssClasses extends PopupCssClasses = PopupCssClasses> extends VisualPluginOptions<TCssClasses>\n{\n //######################### properties #########################\n\n /**\n * Indication whether are popup options visible, or not, force popup to be visible if set to true\n */\n visible: boolean;\n\n /**\n * Texts that are used within any Popup\n */\n texts: PopupTexts;\n\n /**\n * Indication whether is live search enabled for popup\n */\n liveSearchEnabled: boolean;\n}\n\n/**\n * Popup plugin interface\n */\nexport interface Popup<TValue = unknown, TPublicValue = TValue, TOptions extends PopupOptions = PopupOptions> extends SelectPlugin<TOptions, TValue, TPublicValue>\n{\n}\n"]}
1
+ {"version":3,"file":"popup.interface.js","sourceRoot":"","sources":["../../../../../src/interfaces/plugins/popup/popup.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {SelectPlugin} from '../../selectPlugin/selectPlugin.interface';\nimport {VisualPluginOptions} from '../../visualPluginOptions/visualPluginOptions.interface';\n\n/**\n * Texts that are used within Popup\n */\nexport interface PopupTexts\n{\n /**\n * Displayed when there are no available options to be displayed\n */\n noAvailableOptions: string;\n\n /**\n * Displayed when add new option is displayed\n */\n addNewOption: string;\n\n /**\n * ARIA label for options list\n */\n optionsList: string;\n}\n\n/**\n * CSS classes for pupup plugin\n */\nexport interface PopupCssClasses\n{\n}\n\n/**\n * Options for popup plugin\n */\nexport interface PopupOptions<TCssClasses extends PopupCssClasses = PopupCssClasses> extends VisualPluginOptions<TCssClasses>\n{\n //######################### properties #########################\n\n /**\n * Indication whether are popup options visible, or not, force popup to be visible if set to true\n */\n visible: boolean;\n\n /**\n * Indication whether is highlighting enabled for popup, if set to true, then popup will search query\n */\n searchHighlighting: boolean;\n\n /**\n * Texts that are used within any Popup\n */\n texts: PopupTexts;\n\n /**\n * Indication whether is live search enabled for popup\n */\n liveSearchEnabled: boolean;\n}\n\n/**\n * Popup plugin interface\n */\nexport interface Popup<TValue = unknown, TPublicValue = TValue, TOptions extends PopupOptions = PopupOptions> extends SelectPlugin<TOptions, TValue, TPublicValue>\n{\n}\n"]}