@ng-nest/ui 14.0.0 → 14.0.3

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 (207) hide show
  1. package/auto-complete/auto-complete.component.d.ts +2 -2
  2. package/base-form/base-form.component.d.ts +6 -3
  3. package/button/button.property.d.ts +11 -1
  4. package/cascade/cascade.component.d.ts +2 -3
  5. package/color-picker/color-picker.component.d.ts +1 -1
  6. package/core/config/config.d.ts +6 -0
  7. package/date-picker/date-picker.component.d.ts +1 -1
  8. package/date-picker/date-range.component.d.ts +1 -1
  9. package/dialog/dialog.module.d.ts +2 -1
  10. package/dialog/dialog.property.d.ts +2 -0
  11. package/esm2020/auto-complete/auto-complete.component.mjs +7 -5
  12. package/esm2020/base-form/base-form.component.mjs +11 -3
  13. package/esm2020/button/button.component.mjs +3 -3
  14. package/esm2020/button/button.property.mjs +7 -2
  15. package/esm2020/cascade/cascade.component.mjs +8 -9
  16. package/esm2020/checkbox/checkbox.component.mjs +6 -4
  17. package/esm2020/color-picker/color-picker-portal.component.mjs +3 -3
  18. package/esm2020/color-picker/color-picker.component.mjs +4 -3
  19. package/esm2020/core/config/config.mjs +1 -1
  20. package/esm2020/date-picker/date-picker.component.mjs +4 -3
  21. package/esm2020/date-picker/date-range.component.mjs +1 -1
  22. package/esm2020/dialog/dialog.module.mjs +8 -4
  23. package/esm2020/dialog/dialog.property.mjs +1 -1
  24. package/esm2020/find/find.component.mjs +5 -3
  25. package/esm2020/form/control.component.mjs +39 -26
  26. package/esm2020/form/form.component.mjs +16 -3
  27. package/esm2020/form/form.module.mjs +6 -3
  28. package/esm2020/form/form.property.mjs +10 -3
  29. package/esm2020/i18n/i18n.property.mjs +1 -1
  30. package/esm2020/i18n/languages/en_US.mjs +6 -2
  31. package/esm2020/i18n/languages/zh_CN.mjs +6 -2
  32. package/esm2020/i18n/languages/zh_TW.mjs +6 -2
  33. package/esm2020/icon/icon.component.mjs +6 -2
  34. package/esm2020/input/input.component.mjs +23 -10
  35. package/esm2020/input/input.property.mjs +31 -2
  36. package/esm2020/input-number/input-number.component.mjs +3 -3
  37. package/esm2020/list/list.component.mjs +16 -16
  38. package/esm2020/radio/radio.component.mjs +4 -3
  39. package/esm2020/rate/rate.component.mjs +8 -3
  40. package/esm2020/select/select-portal.component.mjs +15 -6
  41. package/esm2020/select/select.component.mjs +297 -42
  42. package/esm2020/select/select.module.mjs +35 -4
  43. package/esm2020/select/select.property.mjs +31 -3
  44. package/esm2020/slider-select/slider-select.component.mjs +6 -5
  45. package/esm2020/switch/switch.component.mjs +1 -1
  46. package/esm2020/table/table-body.component.mjs +15 -6
  47. package/esm2020/table/table-foot.component.mjs +7 -3
  48. package/esm2020/table/table-head.component.mjs +23 -7
  49. package/esm2020/table/table.component.mjs +55 -8
  50. package/esm2020/table/table.property.mjs +20 -5
  51. package/esm2020/tag/tag.component.mjs +5 -5
  52. package/esm2020/tag/tag.property.mjs +1 -1
  53. package/esm2020/textarea/textarea.component.mjs +3 -3
  54. package/esm2020/textarea/textarea.property.mjs +1 -6
  55. package/esm2020/theme/theme.component.mjs +1 -1
  56. package/esm2020/time-picker/time-picker.component.mjs +4 -3
  57. package/esm2020/transfer/transfer.component.mjs +1 -1
  58. package/esm2020/tree/tree-node.component.mjs +4 -70
  59. package/esm2020/tree/tree.component.mjs +123 -23
  60. package/esm2020/tree/tree.property.mjs +1 -1
  61. package/esm2020/upload/upload.component.mjs +1 -1
  62. package/fesm2015/ng-nest-ui-auto-complete.mjs +6 -4
  63. package/fesm2015/ng-nest-ui-auto-complete.mjs.map +1 -1
  64. package/fesm2015/ng-nest-ui-base-form.mjs +10 -2
  65. package/fesm2015/ng-nest-ui-base-form.mjs.map +1 -1
  66. package/fesm2015/ng-nest-ui-button.mjs +8 -3
  67. package/fesm2015/ng-nest-ui-button.mjs.map +1 -1
  68. package/fesm2015/ng-nest-ui-cascade.mjs +6 -7
  69. package/fesm2015/ng-nest-ui-cascade.mjs.map +1 -1
  70. package/fesm2015/ng-nest-ui-checkbox.mjs +5 -3
  71. package/fesm2015/ng-nest-ui-checkbox.mjs.map +1 -1
  72. package/fesm2015/ng-nest-ui-color-picker.mjs +5 -4
  73. package/fesm2015/ng-nest-ui-color-picker.mjs.map +1 -1
  74. package/fesm2015/ng-nest-ui-core.mjs.map +1 -1
  75. package/fesm2015/ng-nest-ui-date-picker.mjs +3 -2
  76. package/fesm2015/ng-nest-ui-date-picker.mjs.map +1 -1
  77. package/fesm2015/ng-nest-ui-dialog.mjs +7 -3
  78. package/fesm2015/ng-nest-ui-dialog.mjs.map +1 -1
  79. package/fesm2015/ng-nest-ui-find.mjs +4 -2
  80. package/fesm2015/ng-nest-ui-find.mjs.map +1 -1
  81. package/fesm2015/ng-nest-ui-form.mjs +68 -31
  82. package/fesm2015/ng-nest-ui-form.mjs.map +1 -1
  83. package/fesm2015/ng-nest-ui-i18n.mjs +15 -3
  84. package/fesm2015/ng-nest-ui-i18n.mjs.map +1 -1
  85. package/fesm2015/ng-nest-ui-icon.mjs +5 -1
  86. package/fesm2015/ng-nest-ui-icon.mjs.map +1 -1
  87. package/fesm2015/ng-nest-ui-input-number.mjs +2 -2
  88. package/fesm2015/ng-nest-ui-input-number.mjs.map +1 -1
  89. package/fesm2015/ng-nest-ui-input.mjs +52 -10
  90. package/fesm2015/ng-nest-ui-input.mjs.map +1 -1
  91. package/fesm2015/ng-nest-ui-list.mjs +15 -15
  92. package/fesm2015/ng-nest-ui-list.mjs.map +1 -1
  93. package/fesm2015/ng-nest-ui-radio.mjs +3 -2
  94. package/fesm2015/ng-nest-ui-radio.mjs.map +1 -1
  95. package/fesm2015/ng-nest-ui-rate.mjs +7 -2
  96. package/fesm2015/ng-nest-ui-rate.mjs.map +1 -1
  97. package/fesm2015/ng-nest-ui-select.mjs +375 -50
  98. package/fesm2015/ng-nest-ui-select.mjs.map +1 -1
  99. package/fesm2015/ng-nest-ui-slider-select.mjs +5 -4
  100. package/fesm2015/ng-nest-ui-slider-select.mjs.map +1 -1
  101. package/fesm2015/ng-nest-ui-switch.mjs.map +1 -1
  102. package/fesm2015/ng-nest-ui-table.mjs +113 -23
  103. package/fesm2015/ng-nest-ui-table.mjs.map +1 -1
  104. package/fesm2015/ng-nest-ui-tag.mjs +4 -4
  105. package/fesm2015/ng-nest-ui-tag.mjs.map +1 -1
  106. package/fesm2015/ng-nest-ui-textarea.mjs +2 -7
  107. package/fesm2015/ng-nest-ui-textarea.mjs.map +1 -1
  108. package/fesm2015/ng-nest-ui-theme.mjs.map +1 -1
  109. package/fesm2015/ng-nest-ui-time-picker.mjs +3 -2
  110. package/fesm2015/ng-nest-ui-time-picker.mjs.map +1 -1
  111. package/fesm2015/ng-nest-ui-transfer.mjs.map +1 -1
  112. package/fesm2015/ng-nest-ui-tree.mjs +125 -91
  113. package/fesm2015/ng-nest-ui-tree.mjs.map +1 -1
  114. package/fesm2015/ng-nest-ui-upload.mjs.map +1 -1
  115. package/fesm2020/ng-nest-ui-auto-complete.mjs +6 -4
  116. package/fesm2020/ng-nest-ui-auto-complete.mjs.map +1 -1
  117. package/fesm2020/ng-nest-ui-base-form.mjs +10 -2
  118. package/fesm2020/ng-nest-ui-base-form.mjs.map +1 -1
  119. package/fesm2020/ng-nest-ui-button.mjs +8 -3
  120. package/fesm2020/ng-nest-ui-button.mjs.map +1 -1
  121. package/fesm2020/ng-nest-ui-cascade.mjs +6 -7
  122. package/fesm2020/ng-nest-ui-cascade.mjs.map +1 -1
  123. package/fesm2020/ng-nest-ui-checkbox.mjs +5 -3
  124. package/fesm2020/ng-nest-ui-checkbox.mjs.map +1 -1
  125. package/fesm2020/ng-nest-ui-color-picker.mjs +5 -4
  126. package/fesm2020/ng-nest-ui-color-picker.mjs.map +1 -1
  127. package/fesm2020/ng-nest-ui-core.mjs.map +1 -1
  128. package/fesm2020/ng-nest-ui-date-picker.mjs +3 -2
  129. package/fesm2020/ng-nest-ui-date-picker.mjs.map +1 -1
  130. package/fesm2020/ng-nest-ui-dialog.mjs +7 -3
  131. package/fesm2020/ng-nest-ui-dialog.mjs.map +1 -1
  132. package/fesm2020/ng-nest-ui-find.mjs +4 -2
  133. package/fesm2020/ng-nest-ui-find.mjs.map +1 -1
  134. package/fesm2020/ng-nest-ui-form.mjs +67 -31
  135. package/fesm2020/ng-nest-ui-form.mjs.map +1 -1
  136. package/fesm2020/ng-nest-ui-i18n.mjs +15 -3
  137. package/fesm2020/ng-nest-ui-i18n.mjs.map +1 -1
  138. package/fesm2020/ng-nest-ui-icon.mjs +5 -1
  139. package/fesm2020/ng-nest-ui-icon.mjs.map +1 -1
  140. package/fesm2020/ng-nest-ui-input-number.mjs +2 -2
  141. package/fesm2020/ng-nest-ui-input-number.mjs.map +1 -1
  142. package/fesm2020/ng-nest-ui-input.mjs +52 -10
  143. package/fesm2020/ng-nest-ui-input.mjs.map +1 -1
  144. package/fesm2020/ng-nest-ui-list.mjs +15 -15
  145. package/fesm2020/ng-nest-ui-list.mjs.map +1 -1
  146. package/fesm2020/ng-nest-ui-radio.mjs +3 -2
  147. package/fesm2020/ng-nest-ui-radio.mjs.map +1 -1
  148. package/fesm2020/ng-nest-ui-rate.mjs +7 -2
  149. package/fesm2020/ng-nest-ui-rate.mjs.map +1 -1
  150. package/fesm2020/ng-nest-ui-select.mjs +372 -50
  151. package/fesm2020/ng-nest-ui-select.mjs.map +1 -1
  152. package/fesm2020/ng-nest-ui-slider-select.mjs +5 -4
  153. package/fesm2020/ng-nest-ui-slider-select.mjs.map +1 -1
  154. package/fesm2020/ng-nest-ui-switch.mjs.map +1 -1
  155. package/fesm2020/ng-nest-ui-table.mjs +112 -23
  156. package/fesm2020/ng-nest-ui-table.mjs.map +1 -1
  157. package/fesm2020/ng-nest-ui-tag.mjs +4 -4
  158. package/fesm2020/ng-nest-ui-tag.mjs.map +1 -1
  159. package/fesm2020/ng-nest-ui-textarea.mjs +2 -7
  160. package/fesm2020/ng-nest-ui-textarea.mjs.map +1 -1
  161. package/fesm2020/ng-nest-ui-theme.mjs.map +1 -1
  162. package/fesm2020/ng-nest-ui-time-picker.mjs +3 -2
  163. package/fesm2020/ng-nest-ui-time-picker.mjs.map +1 -1
  164. package/fesm2020/ng-nest-ui-transfer.mjs.map +1 -1
  165. package/fesm2020/ng-nest-ui-tree.mjs +125 -91
  166. package/fesm2020/ng-nest-ui-tree.mjs.map +1 -1
  167. package/fesm2020/ng-nest-ui-upload.mjs.map +1 -1
  168. package/find/find.component.d.ts +1 -1
  169. package/form/control.component.d.ts +6 -3
  170. package/form/examples/en_US/default/form-vaild/README.md +8 -0
  171. package/form/examples/zh_CN/default/form-vaild/README.md +8 -0
  172. package/form/form.component.d.ts +4 -1
  173. package/form/form.module.d.ts +2 -1
  174. package/form/form.property.d.ts +7 -2
  175. package/i18n/i18n.property.d.ts +6 -0
  176. package/i18n/languages/en_US.d.ts +4 -0
  177. package/i18n/languages/zh_CN.d.ts +4 -0
  178. package/i18n/languages/zh_TW.d.ts +4 -0
  179. package/input/input.component.d.ts +3 -0
  180. package/input/input.property.d.ts +31 -1
  181. package/input-number/input-number.component.d.ts +1 -1
  182. package/package.json +1 -1
  183. package/rate/rate.component.d.ts +1 -0
  184. package/select/examples/en_US/default/search/README.md +6 -0
  185. package/select/examples/zh_CN/default/search/README.md +6 -0
  186. package/select/select-portal.component.d.ts +6 -1
  187. package/select/select.component.d.ts +33 -6
  188. package/select/select.module.d.ts +4 -2
  189. package/select/select.property.d.ts +63 -2
  190. package/slider-select/slider-select.component.d.ts +1 -1
  191. package/switch/switch.component.d.ts +1 -1
  192. package/table/examples/en_US/default/fix/README.md +6 -0
  193. package/table/examples/en_US/default/head/README.md +6 -0
  194. package/table/examples/en_US/default/header/README.md +6 -0
  195. package/table/examples/zh_CN/default/fix/README.md +6 -0
  196. package/table/examples/zh_CN/default/head/README.md +6 -0
  197. package/table/examples/zh_CN/default/header/README.md +6 -0
  198. package/table/table-foot.component.d.ts +1 -0
  199. package/table/table-head.component.d.ts +2 -1
  200. package/table/table.component.d.ts +14 -2
  201. package/table/table.property.d.ts +48 -3
  202. package/tag/tag.component.d.ts +1 -1
  203. package/tag/tag.property.d.ts +1 -1
  204. package/time-picker/time-picker.component.d.ts +1 -1
  205. package/tree/tree-node.component.d.ts +0 -3
  206. package/tree/tree.component.d.ts +3 -0
  207. package/tree/tree.property.d.ts +5 -0
@@ -2,23 +2,28 @@ import { Subject } from 'rxjs';
2
2
  import * as i0 from '@angular/core';
3
3
  import { Component, Input, ViewEncapsulation, ChangeDetectionStrategy, HostBinding, HostListener, ViewChild, NgModule } from '@angular/core';
4
4
  import { __decorate } from 'tslib';
5
- import * as i3$1 from '@ng-nest/ui/core';
6
- import { XDataConvert, XWithConfig, XInputBoolean, XConnectBaseAnimation, XIsEmpty, XIsChange, XClearClass, XSetData, XIsObjectArray, XIsObservable, XIsArray } from '@ng-nest/ui/core';
5
+ import * as i4 from '@ng-nest/ui/core';
6
+ import { XDataConvert, XWithConfig, XInputBoolean, XInputNumber, XConnectBaseAnimation, XIsEmpty, XIsChange, XResize, XClearClass, XSetData, XIsFunction, XIsObjectArray, XRemove, XIsString, XIsObservable, XIsArray } from '@ng-nest/ui/core';
7
7
  import { XControlValueAccessor, XValueAccessor, XBaseFormModule } from '@ng-nest/ui/base-form';
8
8
  import * as i1$1 from '@ng-nest/ui/portal';
9
9
  import { XPortalConnectedPosition, XPortalModule } from '@ng-nest/ui/portal';
10
- import { takeUntil, map, throttleTime } from 'rxjs/operators';
10
+ import { takeUntil, map, debounceTime, distinctUntilChanged, throttleTime } from 'rxjs/operators';
11
11
  import * as i1 from '@ng-nest/ui/i18n';
12
12
  import { XI18nModule } from '@ng-nest/ui/i18n';
13
- import * as i4 from '@angular/forms';
13
+ import * as i6 from '@angular/forms';
14
14
  import { FormsModule, ReactiveFormsModule } from '@angular/forms';
15
15
  import * as i3 from '@ng-nest/ui/list';
16
16
  import { XListModule } from '@ng-nest/ui/list';
17
17
  import { DOWN_ARROW, UP_ARROW, LEFT_ARROW, RIGHT_ARROW, ENTER, MAC_ENTER, ESCAPE, TAB } from '@angular/cdk/keycodes';
18
18
  import * as i2 from '@angular/cdk/overlay';
19
- import * as i5 from '@ng-nest/ui/input';
20
- import { XInputModule } from '@ng-nest/ui/input';
19
+ import * as i5 from '@angular/common';
21
20
  import { CommonModule } from '@angular/common';
21
+ import * as i7 from '@ng-nest/ui/input';
22
+ import { XInputModule } from '@ng-nest/ui/input';
23
+ import * as i8 from '@ng-nest/ui/tag';
24
+ import { XTagModule } from '@ng-nest/ui/tag';
25
+ import * as i9 from '@ng-nest/ui/outlet';
26
+ import { XOutletModule } from '@ng-nest/ui/outlet';
22
27
 
23
28
  /**
24
29
  * Select
@@ -41,7 +46,7 @@ class XSelectProperty extends XControlValueAccessor {
41
46
  }
42
47
  }
43
48
  /** @nocollapse */ XSelectProperty.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: XSelectProperty, deps: null, target: i0.ɵɵFactoryTarget.Component });
44
- /** @nocollapse */ XSelectProperty.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: XSelectProperty, selector: "ng-component", inputs: { data: "data", clearable: "clearable", async: "async", placement: "placement", multiple: "multiple", selectAll: "selectAll", selectAllText: "selectAllText", nodeTpl: "nodeTpl", size: "size", bordered: "bordered", portalMaxHeight: "portalMaxHeight" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
49
+ /** @nocollapse */ XSelectProperty.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: XSelectProperty, selector: "ng-component", inputs: { data: "data", clearable: "clearable", async: "async", placement: "placement", multiple: "multiple", selectAll: "selectAll", selectAllText: "selectAllText", nodeTpl: "nodeTpl", size: "size", bordered: "bordered", portalMaxHeight: "portalMaxHeight", search: "search", caseSensitive: "caseSensitive", debounceTime: "debounceTime", maxTagCount: "maxTagCount", maxTagContent: "maxTagContent" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
45
50
  __decorate([
46
51
  XDataConvert()
47
52
  ], XSelectProperty.prototype, "data", void 0);
@@ -74,6 +79,24 @@ __decorate([
74
79
  __decorate([
75
80
  XWithConfig(X_CONFIG_NAME, '12rem')
76
81
  ], XSelectProperty.prototype, "portalMaxHeight", void 0);
82
+ __decorate([
83
+ XInputBoolean(),
84
+ XWithConfig(X_CONFIG_NAME, false)
85
+ ], XSelectProperty.prototype, "search", void 0);
86
+ __decorate([
87
+ XInputBoolean(),
88
+ XWithConfig(X_CONFIG_NAME, true)
89
+ ], XSelectProperty.prototype, "caseSensitive", void 0);
90
+ __decorate([
91
+ XWithConfig(X_CONFIG_NAME, 200)
92
+ ], XSelectProperty.prototype, "debounceTime", void 0);
93
+ __decorate([
94
+ XInputNumber(),
95
+ XWithConfig(X_CONFIG_NAME)
96
+ ], XSelectProperty.prototype, "maxTagCount", void 0);
97
+ __decorate([
98
+ XWithConfig(X_CONFIG_NAME)
99
+ ], XSelectProperty.prototype, "maxTagContent", void 0);
77
100
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: XSelectProperty, decorators: [{
78
101
  type: Component,
79
102
  args: [{ template: '' }]
@@ -99,6 +122,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImpor
99
122
  type: Input
100
123
  }], portalMaxHeight: [{
101
124
  type: Input
125
+ }], search: [{
126
+ type: Input
127
+ }], caseSensitive: [{
128
+ type: Input
129
+ }], debounceTime: [{
130
+ type: Input
131
+ }], maxTagCount: [{
132
+ type: Input
133
+ }], maxTagContent: [{
134
+ type: Input
102
135
  }] } });
103
136
  /**
104
137
  * Select Portal
@@ -116,9 +149,12 @@ class XSelectPortalComponent {
116
149
  this.selectAll = false;
117
150
  this.show = false;
118
151
  this.objectArray = false;
152
+ this.caseSensitive = true;
119
153
  this.active = -1;
120
154
  this.portalMaxHeight = '';
121
155
  this.locale = {};
156
+ this.search = false;
157
+ this.scrollNull = undefined;
122
158
  this._unSubject = new Subject();
123
159
  }
124
160
  done(event) {
@@ -140,6 +176,10 @@ class XSelectPortalComponent {
140
176
  this.placement = x;
141
177
  this.cdr.detectChanges();
142
178
  });
179
+ this.dataChange.pipe(takeUntil(this._unSubject)).subscribe((x) => {
180
+ this.data = x;
181
+ this.cdr.detectChanges();
182
+ });
143
183
  this.closeSubject.pipe(takeUntil(this._unSubject)).subscribe(() => {
144
184
  this.list.setUnActive(this.active);
145
185
  });
@@ -161,10 +201,12 @@ class XSelectPortalComponent {
161
201
  event.stopPropagation();
162
202
  }
163
203
  nodeClick(node) {
164
- if (this.multiple === 0)
165
- this.nodeEmit(this.value);
166
- else
204
+ if (this.multiple === 0) {
205
+ this.nodeEmit(node, this.value);
206
+ }
207
+ else {
167
208
  this.nodeEmit(node);
209
+ }
168
210
  }
169
211
  onSelectAll(_isSelectAll) {
170
212
  this.nodeEmit(this.value);
@@ -177,10 +219,10 @@ class XSelectPortalComponent {
177
219
  }
178
220
  }
179
221
  /** @nocollapse */ XSelectPortalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: XSelectPortalComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i1.XI18nService }], target: i0.ɵɵFactoryTarget.Component });
180
- /** @nocollapse */ XSelectPortalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: XSelectPortalComponent, selector: "x-select-portal", host: { listeners: { "@x-connect-base-animation.done": "done($event)", "@x-connect-base-animation.start": "start($event)" }, properties: { "@x-connect-base-animation": "this.placement" } }, viewQueries: [{ propertyName: "list", first: true, predicate: ["list"], descendants: true }], ngImport: i0, template: "<div #selectPortal class=\"x-select-portal\" (click)=\"inputCom.inputFocus(); stopPropagation($event)\" [style.maxHeight]=\"portalMaxHeight\">\r\n <x-list\r\n #list\r\n [data]=\"data\"\r\n [(ngModel)]=\"value\"\r\n (nodeClick)=\"nodeClick($event)\"\r\n (keyManagerChange)=\"onActive($event)\"\r\n (keyManagerTabOut)=\"onTabOut()\"\r\n (onSelectAll)=\"onSelectAll($event)\"\r\n checked\r\n [objectArray]=\"objectArray\"\r\n [multiple]=\"multiple\"\r\n [selectAll]=\"selectAll\"\r\n [selectAllText]=\"getSelectAllText\"\r\n [nodeTpl]=\"nodeTpl\"\r\n [scrollElement]=\"selectPortal\"\r\n ></x-list>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";x-select-portal{width:100%}.x-select-portal{margin:.0625rem 0;font-size:var(--x-font-size);color:var(--x-text);border:var(--x-border-width) var(--x-border-style) var(--x-border);width:100%;border-radius:var(--x-border-radius);box-shadow:var(--x-box-shadow) var(--x-box-shadow-light-color);position:relative;display:flex;background-color:var(--x-background);overflow:hidden auto;max-height:calc((calc(var(--x-font-size) + .875rem) * 6) + (var(--x-border-width) * 7))}\n"], dependencies: [{ kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.XListComponent, selector: "x-list" }], animations: [XConnectBaseAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
222
+ /** @nocollapse */ XSelectPortalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: XSelectPortalComponent, selector: "x-select-portal", host: { listeners: { "@x-connect-base-animation.done": "done($event)", "@x-connect-base-animation.start": "start($event)" }, properties: { "@x-connect-base-animation": "this.placement" } }, viewQueries: [{ propertyName: "list", first: true, predicate: ["list"], descendants: true }], ngImport: i0, template: "<div #selectPortal class=\"x-select-portal\" (click)=\"inputCom.inputFocus(); stopPropagation($event)\" [style.maxHeight]=\"portalMaxHeight\">\r\n <x-list\r\n #list\r\n [data]=\"data\"\r\n [(ngModel)]=\"value\"\r\n (nodeClick)=\"nodeClick($event)\"\r\n (keyManagerChange)=\"onActive($event)\"\r\n (keyManagerTabOut)=\"onTabOut()\"\r\n (onSelectAll)=\"onSelectAll($event)\"\r\n checked\r\n [objectArray]=\"objectArray\"\r\n [multiple]=\"multiple\"\r\n [selectAll]=\"selectAll\"\r\n [selectAllText]=\"getSelectAllText\"\r\n [nodeTpl]=\"nodeTpl\"\r\n [scrollElement]=\"search ? scrollNull : selectPortal\"\r\n ></x-list>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";x-select-portal{width:100%}.x-select-portal{margin:.0625rem 0;font-size:var(--x-font-size);color:var(--x-text);border:var(--x-border-width) var(--x-border-style) var(--x-border);width:100%;border-radius:var(--x-border-radius);box-shadow:var(--x-box-shadow) var(--x-box-shadow-light-color);position:relative;display:flex;background-color:var(--x-background);overflow:hidden auto;max-height:calc((calc(var(--x-font-size) + .875rem) * 6) + (var(--x-border-width) * 7))}\n"], dependencies: [{ kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.XListComponent, selector: "x-list" }], animations: [XConnectBaseAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
181
223
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: XSelectPortalComponent, decorators: [{
182
224
  type: Component,
183
- args: [{ selector: `${XSelectPortalPrefix}`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, animations: [XConnectBaseAnimation], template: "<div #selectPortal class=\"x-select-portal\" (click)=\"inputCom.inputFocus(); stopPropagation($event)\" [style.maxHeight]=\"portalMaxHeight\">\r\n <x-list\r\n #list\r\n [data]=\"data\"\r\n [(ngModel)]=\"value\"\r\n (nodeClick)=\"nodeClick($event)\"\r\n (keyManagerChange)=\"onActive($event)\"\r\n (keyManagerTabOut)=\"onTabOut()\"\r\n (onSelectAll)=\"onSelectAll($event)\"\r\n checked\r\n [objectArray]=\"objectArray\"\r\n [multiple]=\"multiple\"\r\n [selectAll]=\"selectAll\"\r\n [selectAllText]=\"getSelectAllText\"\r\n [nodeTpl]=\"nodeTpl\"\r\n [scrollElement]=\"selectPortal\"\r\n ></x-list>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";x-select-portal{width:100%}.x-select-portal{margin:.0625rem 0;font-size:var(--x-font-size);color:var(--x-text);border:var(--x-border-width) var(--x-border-style) var(--x-border);width:100%;border-radius:var(--x-border-radius);box-shadow:var(--x-box-shadow) var(--x-box-shadow-light-color);position:relative;display:flex;background-color:var(--x-background);overflow:hidden auto;max-height:calc((calc(var(--x-font-size) + .875rem) * 6) + (var(--x-border-width) * 7))}\n"] }]
225
+ args: [{ selector: `${XSelectPortalPrefix}`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, animations: [XConnectBaseAnimation], template: "<div #selectPortal class=\"x-select-portal\" (click)=\"inputCom.inputFocus(); stopPropagation($event)\" [style.maxHeight]=\"portalMaxHeight\">\r\n <x-list\r\n #list\r\n [data]=\"data\"\r\n [(ngModel)]=\"value\"\r\n (nodeClick)=\"nodeClick($event)\"\r\n (keyManagerChange)=\"onActive($event)\"\r\n (keyManagerTabOut)=\"onTabOut()\"\r\n (onSelectAll)=\"onSelectAll($event)\"\r\n checked\r\n [objectArray]=\"objectArray\"\r\n [multiple]=\"multiple\"\r\n [selectAll]=\"selectAll\"\r\n [selectAllText]=\"getSelectAllText\"\r\n [nodeTpl]=\"nodeTpl\"\r\n [scrollElement]=\"search ? scrollNull : selectPortal\"\r\n ></x-list>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";x-select-portal{width:100%}.x-select-portal{margin:.0625rem 0;font-size:var(--x-font-size);color:var(--x-text);border:var(--x-border-width) var(--x-border-style) var(--x-border);width:100%;border-radius:var(--x-border-radius);box-shadow:var(--x-box-shadow) var(--x-box-shadow-light-color);position:relative;display:flex;background-color:var(--x-background);overflow:hidden auto;max-height:calc((calc(var(--x-font-size) + .875rem) * 6) + (var(--x-border-width) * 7))}\n"] }]
184
226
  }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i1.XI18nService }]; }, propDecorators: { placement: [{
185
227
  type: HostBinding,
186
228
  args: ['@x-connect-base-animation']
@@ -196,33 +238,54 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImpor
196
238
  }] } });
197
239
 
198
240
  class XSelectComponent extends XSelectProperty {
199
- constructor(renderer, cdr, portalService, viewContainerRef, overlay, configService) {
241
+ constructor(renderer, cdr, portalService, viewContainerRef, overlay, i18n, configService) {
200
242
  super();
201
243
  this.renderer = renderer;
202
244
  this.cdr = cdr;
203
245
  this.portalService = portalService;
204
246
  this.viewContainerRef = viewContainerRef;
205
247
  this.overlay = overlay;
248
+ this.i18n = i18n;
206
249
  this.configService = configService;
207
250
  this.readonly = true;
208
251
  this.enter = false;
209
252
  this.showClearable = false;
210
253
  this.displayValue = '';
254
+ this.multipleSearchValue = '';
211
255
  this.nodes = [];
256
+ this.selectedNodes = [];
257
+ this.displayNodes = [];
258
+ this.displayMore = '';
259
+ this.showDisplayMore = false;
260
+ this.searchNodes = [];
212
261
  this.icon = 'fto-chevron-down';
213
262
  this.iconSpin = false;
214
263
  this.maxNodes = 6;
264
+ this.inputPadding = 0.4;
215
265
  this.protalTobottom = true;
216
266
  this.asyncLoading = false;
217
267
  this.animating = false;
218
268
  this.objectArray = false;
269
+ this.selectedSurplus = 0;
270
+ this.selectedTotal = 0;
271
+ this.locale = {};
219
272
  this.valueTplContext = { $node: null, $isValue: true };
220
273
  this.valueChange = new Subject();
221
274
  this.positionChange = new Subject();
222
275
  this.closeSubject = new Subject();
276
+ this.dataChange = new Subject();
223
277
  this.keydownSubject = new Subject();
278
+ this.inputChange = new Subject();
279
+ this.composition = false;
280
+ this.multipleInputSizeChange = new Subject();
224
281
  this._unSubject = new Subject();
225
282
  }
283
+ get getReadonly() {
284
+ return (this.readonly && !this.search) || (Boolean(this.search) && Boolean(this.multiple));
285
+ }
286
+ get getMaxTagContent() {
287
+ return this.maxTagContent || this.locale.maxTagContent;
288
+ }
226
289
  writeValue(value) {
227
290
  if (this.multiple && XIsEmpty(value)) {
228
291
  value = [];
@@ -236,6 +299,16 @@ class XSelectComponent extends XSelectProperty {
236
299
  this.setFlex(this.select.nativeElement, this.renderer, this.justify, this.align, this.direction);
237
300
  this.setClassMap();
238
301
  this.setSubject();
302
+ if (this.multiple) {
303
+ this.valueTpl = this.multipleValueTpl;
304
+ this.inputPadding = 0.125;
305
+ }
306
+ this.i18n.localeChange
307
+ .pipe(map((x) => x.select), takeUntil(this._unSubject))
308
+ .subscribe((x) => {
309
+ this.locale = x;
310
+ this.cdr.markForCheck();
311
+ });
239
312
  }
240
313
  ngOnChanges(changes) {
241
314
  const { data } = changes;
@@ -243,10 +316,20 @@ class XSelectComponent extends XSelectProperty {
243
316
  }
244
317
  ngAfterViewInit() {
245
318
  this.setPortal();
319
+ if (this.multiple && this.inputCom.inputValueRef) {
320
+ XResize(this.inputCom.inputValueRef.nativeElement)
321
+ .pipe(debounceTime(30), takeUntil(this._unSubject))
322
+ .subscribe((x) => {
323
+ this._resizeObserver = x.resizeObserver;
324
+ this.setMutipleInputSize();
325
+ });
326
+ }
246
327
  }
247
328
  ngOnDestroy() {
329
+ var _a;
248
330
  this._unSubject.next();
249
331
  this._unSubject.unsubscribe();
332
+ (_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
250
333
  }
251
334
  setClassMap() {
252
335
  XClearClass(this.labelMap);
@@ -266,18 +349,68 @@ class XSelectComponent extends XSelectProperty {
266
349
  this.closeSubject.pipe(takeUntil(this._unSubject)).subscribe(() => {
267
350
  this.closePortal();
268
351
  });
352
+ this.inputChange.pipe(debounceTime(this.debounceTime), distinctUntilChanged(), takeUntil(this._unSubject)).subscribe((x) => {
353
+ this.modelChange(x);
354
+ });
269
355
  this.keydownSubject.pipe(throttleTime(10), takeUntil(this._unSubject)).subscribe((x) => {
270
356
  const keyCode = x.keyCode;
271
357
  if (!this.portalAttached() && [DOWN_ARROW, UP_ARROW, LEFT_ARROW, RIGHT_ARROW, ENTER, MAC_ENTER].includes(keyCode)) {
272
- this.showPortal();
358
+ this.inputChange.next(this.displayValue);
273
359
  }
274
360
  if (this.portalAttached() && [ESCAPE].includes(keyCode)) {
275
361
  this.closeSubject.next();
276
362
  }
277
363
  });
364
+ this.multipleInputSizeChange.pipe(distinctUntilChanged(), takeUntil(this._unSubject)).subscribe((x) => {
365
+ var _a;
366
+ if (this.multipleInput) {
367
+ const input = (_a = this.multipleInput) === null || _a === void 0 ? void 0 : _a.elementRef.nativeElement;
368
+ this.renderer.setStyle(input, 'width', `${x}px`);
369
+ }
370
+ });
371
+ }
372
+ setMutipleInputSize() {
373
+ var _a, _b;
374
+ const ivf = this.inputCom.inputValueRef.nativeElement;
375
+ let { clientWidth, scrollHeight } = ivf;
376
+ const len = ivf.children.length;
377
+ let lastRowTagTop = -1;
378
+ let lines = 1;
379
+ let rowTagTop = -1;
380
+ let lastRowTagsWidth = 0;
381
+ let marginLeft = 0;
382
+ let marginTop = 0;
383
+ for (let i = len - 1; i >= 0; i--) {
384
+ const ele = ivf.children[i];
385
+ if (ele.tagName === 'X-TAG') {
386
+ const { offsetTop, offsetWidth } = ele;
387
+ const style = getComputedStyle(ele);
388
+ marginLeft = Number(style.marginLeft.replace('px', ''));
389
+ marginTop = Number(style.marginTop.replace('px', ''));
390
+ if (rowTagTop === -1) {
391
+ rowTagTop = offsetTop;
392
+ }
393
+ else if (rowTagTop !== offsetTop) {
394
+ lines++;
395
+ rowTagTop = offsetTop;
396
+ }
397
+ if (lastRowTagTop === -1) {
398
+ lastRowTagTop = offsetTop;
399
+ }
400
+ if (lastRowTagTop === offsetTop) {
401
+ lastRowTagsWidth += offsetWidth + marginLeft;
402
+ }
403
+ }
404
+ }
405
+ const height = scrollHeight + (lines > 1 ? marginTop : 0);
406
+ this.renderer.setStyle(this.inputCom.inputRef.nativeElement, 'height', `${height}px`);
407
+ if (this.multipleInput) {
408
+ this.multipleInputSizeChange.next(clientWidth - lastRowTagsWidth - marginLeft);
409
+ }
410
+ (_b = (_a = this.portal) === null || _a === void 0 ? void 0 : _a.overlayRef) === null || _b === void 0 ? void 0 : _b.updatePosition();
278
411
  }
279
412
  menter() {
280
- if (this.disabled || !this.clearable)
413
+ if (this.disabled || !this.clearable || this.iconSpin)
281
414
  return;
282
415
  this.enter = true;
283
416
  if (!XIsEmpty(this.displayValue)) {
@@ -287,7 +420,7 @@ class XSelectComponent extends XSelectProperty {
287
420
  }
288
421
  }
289
422
  mleave() {
290
- if (this.disabled || !this.clearable)
423
+ if (this.disabled || !this.clearable || this.iconSpin)
291
424
  return;
292
425
  this.enter = false;
293
426
  if (this.clearable) {
@@ -296,34 +429,102 @@ class XSelectComponent extends XSelectProperty {
296
429
  this.cdr.detectChanges();
297
430
  }
298
431
  }
432
+ modelChange(value) {
433
+ if (XIsFunction(this.data)) {
434
+ if (!this.portalAttached()) {
435
+ this.showPortal();
436
+ }
437
+ else {
438
+ this.icon = 'fto-loader';
439
+ this.iconSpin = true;
440
+ this.cdr.detectChanges();
441
+ XSetData(this.data, this._unSubject, true, value).subscribe((x) => {
442
+ this.icon = '';
443
+ this.iconSpin = false;
444
+ this.nodes = x;
445
+ this.dataChange.next(this.nodes);
446
+ this.cdr.detectChanges();
447
+ });
448
+ }
449
+ return;
450
+ }
451
+ if (this.nodes) {
452
+ if (!this.portalAttached()) {
453
+ this.showPortal();
454
+ }
455
+ else {
456
+ if (XIsEmpty(value)) {
457
+ this.searchNodes = [...this.nodes];
458
+ }
459
+ else {
460
+ this.setSearchNodes(value);
461
+ }
462
+ this.dataChange.next(this.searchNodes);
463
+ }
464
+ }
465
+ }
466
+ setSearchNodes(value) {
467
+ if (this.caseSensitive) {
468
+ this.searchNodes = this.nodes.filter((x) => x.label.indexOf(value) >= 0);
469
+ }
470
+ else {
471
+ this.searchNodes = this.nodes.filter((x) => x.label.toLowerCase().indexOf(value.toLowerCase()) >= 0);
472
+ }
473
+ }
299
474
  clearEmit() {
300
- this.value = '';
475
+ this.value = this.multiple ? [] : '';
301
476
  this.displayValue = '';
477
+ this.multipleSearchValue = '';
478
+ this.selectedNodes = [];
479
+ this.setDisplayNodes();
302
480
  this.valueTplContext.$node = null;
303
481
  this.mleave();
304
482
  this.valueChange.next(this.value);
483
+ this.inputChange.next('');
305
484
  if (this.onChange)
306
485
  this.onChange(this.value);
307
486
  }
308
- setDisplayValue() {
487
+ setDisplayValue(clickNode) {
309
488
  if (this.nodes.length > 0) {
310
489
  if (this.multiple) {
311
490
  if (XIsEmpty(this.value)) {
312
491
  this.displayValue = '';
492
+ this.selectedNodes = [];
493
+ this.displayNodes = [];
494
+ this.displayMore = '';
313
495
  this.valueTplContext.$node = null;
496
+ this.setDisplayNodes();
314
497
  }
315
498
  else {
316
- let nodes = [];
499
+ let ids = [];
500
+ let selected = [];
317
501
  if (XIsObjectArray(this.value)) {
318
502
  this.objectArray = true;
319
- nodes = this.nodes.filter((x) => !XIsEmpty(this.value.find((y) => y.id === x.id)));
503
+ ids = this.value.map((x) => x.id);
320
504
  }
321
505
  else {
322
506
  this.objectArray = false;
323
- nodes = this.nodes.filter((x) => !XIsEmpty(this.value.find((y) => y === x.id)));
507
+ ids = this.value;
324
508
  }
325
- this.displayValue = nodes.map((x) => x.label).join(',');
326
- this.valueTplContext.$node = [...nodes];
509
+ if (clickNode) {
510
+ if (clickNode.selected) {
511
+ this.selectedNodes.push(clickNode);
512
+ }
513
+ else {
514
+ XRemove(this.selectedNodes, (x) => x.id === clickNode.id);
515
+ }
516
+ }
517
+ else {
518
+ for (let id of ids) {
519
+ let node = this.nodes.find((x) => x.id === id);
520
+ if (node)
521
+ selected.push(node);
522
+ }
523
+ this.selectedNodes = selected;
524
+ }
525
+ this.setDisplayNodes();
526
+ this.displayValue = this.selectedNodes.map((x) => x.label).join(',');
527
+ this.valueTplContext.$node = [...this.selectedNodes];
327
528
  }
328
529
  }
329
530
  else {
@@ -340,6 +541,46 @@ class XSelectComponent extends XSelectProperty {
340
541
  this.cdr.detectChanges();
341
542
  }
342
543
  }
544
+ closeNode(event, node, index) {
545
+ let inx = -1;
546
+ if (XIsObjectArray(this.value)) {
547
+ inx = this.value.findIndex((y) => y.id === node.id);
548
+ }
549
+ else {
550
+ inx = this.value.findIndex((y) => y === node.id);
551
+ }
552
+ if (inx >= 0) {
553
+ this.value.splice(inx, 1);
554
+ this.valueChange.next(this.value);
555
+ if (this.onChange)
556
+ this.onChange(this.value);
557
+ this.selectedNodes.splice(index, 1);
558
+ this.setDisplayNodes();
559
+ }
560
+ event.stopPropagation();
561
+ }
562
+ setDisplayNodes() {
563
+ const maxlen = this.selectedNodes.length;
564
+ let len = 0;
565
+ if (!this.maxTagCount) {
566
+ len = maxlen;
567
+ }
568
+ else {
569
+ len = maxlen > Number(this.maxTagCount) ? Number(this.maxTagCount) : maxlen;
570
+ }
571
+ let more = maxlen - len;
572
+ more = more < 0 ? 0 : more;
573
+ this.displayNodes = this.selectedNodes.slice(0, len);
574
+ this.showDisplayMore = more > 0;
575
+ if (XIsString(this.getMaxTagContent)) {
576
+ this.displayMore = more > 0 ? this.getMaxTagContent.replace(/\{\{surplus\}\}/g, `${more}`) : '';
577
+ }
578
+ else {
579
+ this.selectedSurplus = more;
580
+ this.selectedTotal = maxlen;
581
+ }
582
+ setTimeout(() => this.setMutipleInputSize());
583
+ }
343
584
  portalAttached() {
344
585
  var _a, _b;
345
586
  return (_b = (_a = this.portal) === null || _a === void 0 ? void 0 : _a.overlayRef) === null || _b === void 0 ? void 0 : _b.hasAttached();
@@ -349,6 +590,7 @@ class XSelectComponent extends XSelectProperty {
349
590
  if (this.portalAttached()) {
350
591
  (_b = (_a = this.portal) === null || _a === void 0 ? void 0 : _a.overlayRef) === null || _b === void 0 ? void 0 : _b.detach();
351
592
  this.active = false;
593
+ this.multipleSearchValue = '';
352
594
  this.cdr.detectChanges();
353
595
  return true;
354
596
  }
@@ -358,29 +600,34 @@ class XSelectComponent extends XSelectProperty {
358
600
  var _a, _b;
359
601
  (_b = (_a = this.portal) === null || _a === void 0 ? void 0 : _a.overlayRef) === null || _b === void 0 ? void 0 : _b.dispose();
360
602
  }
361
- showPortal() {
362
- if (this.disabled || this.iconSpin)
363
- return;
364
- if (this.animating)
603
+ showPortal(click = false) {
604
+ if (this.disabled || this.iconSpin || this.animating)
365
605
  return;
366
606
  this.active = true;
367
- if (this.async && XIsObservable(this.data) && this.nodes.length === 0) {
607
+ if ((this.async && XIsObservable(this.data) && this.nodes.length === 0) || XIsFunction(this.data)) {
368
608
  this.icon = 'fto-loader';
369
609
  this.iconSpin = true;
370
- this.cdr.detectChanges();
371
- XSetData(this.data, this._unSubject).subscribe((x) => {
372
- this.nodes = x;
373
- this.setDisplayValue();
374
- this.createPortal();
610
+ this.inputCom.cdr.detectChanges();
611
+ XSetData(this.data, this._unSubject, true, click ? '' : this.displayValue).subscribe((x) => {
375
612
  this.icon = 'fto-chevron-down';
376
613
  this.iconSpin = false;
614
+ this.inputCom.cdr.detectChanges();
615
+ this.nodes = x;
616
+ if (!this.search)
617
+ this.setDisplayValue();
618
+ this.createPortal();
377
619
  this.cdr.detectChanges();
378
620
  });
379
621
  }
380
622
  else {
381
623
  this.createPortal();
382
624
  }
383
- this.inputCom.inputFocus();
625
+ if (this.search && this.multiple) {
626
+ this.multipleInput.inputFocus();
627
+ }
628
+ else {
629
+ this.inputCom.inputFocus();
630
+ }
384
631
  }
385
632
  createPortal() {
386
633
  var _a;
@@ -426,21 +673,48 @@ class XSelectComponent extends XSelectProperty {
426
673
  positionChange: this.positionChange,
427
674
  closeSubject: this.closeSubject,
428
675
  keydownSubject: this.keydownSubject,
676
+ dataChange: this.dataChange,
429
677
  inputCom: this.inputCom,
430
678
  portalMaxHeight: this.portalMaxHeight,
431
679
  objectArray: this.objectArray,
432
680
  selectAllText: this.selectAllText,
681
+ caseSensitive: this.caseSensitive,
682
+ search: this.search,
433
683
  destroyPortal: () => this.destroyPortal(),
434
- nodeEmit: (node) => this.nodeClick(node),
684
+ nodeEmit: (node, value) => this.nodeClick(node, value),
435
685
  animating: (ing) => (this.animating = ing)
436
686
  });
437
687
  componentRef.changeDetectorRef.detectChanges();
438
688
  }
439
- nodeClick(node) {
440
- if (this.multiple && XIsArray(node)) {
441
- node = node;
442
- this.value = node;
443
- this.setDisplayValue();
689
+ nodeClick(node, value) {
690
+ if (this.multiple) {
691
+ if (XIsObjectArray(value)) {
692
+ if (node.selected) {
693
+ this.value.push(node);
694
+ }
695
+ else {
696
+ let inx = this.value.findIndex((x) => x.id === node.id);
697
+ this.value.splice(inx, 1);
698
+ }
699
+ }
700
+ else if (XIsArray(value)) {
701
+ if (node.selected) {
702
+ this.value.push(node.id);
703
+ }
704
+ else {
705
+ this.value.splice(this.value.indexOf(node.id), 1);
706
+ }
707
+ }
708
+ if (this.multipleInput) {
709
+ const input = this.multipleInput.elementRef.nativeElement;
710
+ this.renderer.setStyle(input, 'width', '2rem');
711
+ }
712
+ if (this.search && this.multipleSearchValue !== '') {
713
+ this.multipleSearchValue = '';
714
+ this.inputChange.next('');
715
+ this.valueChange.next([...this.value]);
716
+ }
717
+ this.setDisplayValue(node);
444
718
  }
445
719
  else {
446
720
  node = node;
@@ -449,9 +723,15 @@ class XSelectComponent extends XSelectProperty {
449
723
  this.value = node.id;
450
724
  this.closeSubject.next();
451
725
  }
452
- this.inputCom.inputFocus();
726
+ if (this.search && this.multiple) {
727
+ this.multipleInput.inputFocus();
728
+ }
729
+ else {
730
+ this.inputCom.inputFocus();
731
+ }
453
732
  if (this.onChange)
454
733
  this.onChange(this.value);
734
+ this.formControlValidator();
455
735
  this.cdr.detectChanges();
456
736
  }
457
737
  setPlacement() {
@@ -472,37 +752,82 @@ class XSelectComponent extends XSelectProperty {
472
752
  }
473
753
  onKeydown($event) {
474
754
  this.keydownSubject.next($event);
475
- if ($event.keyCode !== TAB)
755
+ if ($event.keyCode !== TAB && !this.search) {
476
756
  $event.preventDefault();
757
+ }
477
758
  }
478
759
  onFocus(_event) {
479
- this.inputCom.inputFocus();
760
+ if (this.search && this.multiple) {
761
+ this.multipleInput.inputFocus();
762
+ }
763
+ else {
764
+ this.inputCom.inputFocus();
765
+ }
766
+ }
767
+ onInput(_event) {
768
+ this.formControlValidator();
769
+ setTimeout(() => this.inputChange.next(this.multiple ? this.multipleSearchValue : this.displayValue));
480
770
  }
481
771
  }
482
- /** @nocollapse */ XSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: XSelectComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i1$1.XPortalService }, { token: i0.ViewContainerRef }, { token: i2.Overlay }, { token: i3$1.XConfigService }], target: i0.ɵɵFactoryTarget.Component });
483
- /** @nocollapse */ XSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: XSelectComponent, selector: "x-select", providers: [XValueAccessor(XSelectComponent)], viewQueries: [{ propertyName: "inputCom", first: true, predicate: ["inputCom"], descendants: true, static: true }, { propertyName: "select", first: true, predicate: ["select"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div #select class=\"x-select\">\r\n <div class=\"x-select-row\">\r\n <x-input\r\n #inputCom\r\n type=\"text\"\r\n [label]=\"label\"\r\n [labelWidth]=\"labelWidth\"\r\n [labelAlign]=\"labelAlign\"\r\n [justify]=\"justify\"\r\n [align]=\"align\"\r\n [direction]=\"direction\"\r\n [disabled]=\"disabled\"\r\n [required]=\"required\"\r\n [icon]=\"icon\"\r\n [iconSpin]=\"iconSpin\"\r\n [placeholder]=\"placeholder\"\r\n [readonly]=\"readonly\"\r\n [clearable]=\"showClearable\"\r\n [(ngModel)]=\"displayValue\"\r\n [valueTpl]=\"valueTpl ? valueTpl : nodeTpl\"\r\n [valueTplContext]=\"valueTplContext\"\r\n [size]=\"size\"\r\n [bordered]=\"bordered\"\r\n [before]=\"before\"\r\n [after]=\"after\"\r\n [pattern]=\"pattern\"\r\n [message]=\"message\"\r\n [pointer]=\"true\"\r\n [(active)]=\"active\"\r\n (clearEmit)=\"clearEmit()\"\r\n (xKeydown)=\"onKeydown($event)\"\r\n (xFocus)=\"onFocus($event)\"\r\n (xClick)=\"showPortal()\"\r\n (xMouseenter)=\"menter()\"\r\n (xMouseleave)=\"mleave()\"\r\n ></x-input>\r\n </div>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";x-select{display:inline-block}.x-select{margin:0;padding:0;width:100%}.x-select x-input{width:100%}.x-select-portal{margin:.0625rem 0;font-size:var(--x-font-size);color:var(--x-text);border:var(--x-border-width) var(--x-border-style) var(--x-border);width:100%;border-radius:var(--x-border-radius);box-shadow:var(--x-box-shadow) var(--x-box-shadow-light-color);position:relative;display:flex;background-color:var(--x-background);overflow:hidden auto;max-height:calc((calc(var(--x-font-size) + .875rem) * 6) + (var(--x-border-width) * 7))}\n"], dependencies: [{ kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i4.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i5.XInputComponent, selector: "x-input" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
772
+ /** @nocollapse */ XSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: XSelectComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i1$1.XPortalService }, { token: i0.ViewContainerRef }, { token: i2.Overlay }, { token: i1.XI18nService }, { token: i4.XConfigService }], target: i0.ɵɵFactoryTarget.Component });
773
+ /** @nocollapse */ XSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: XSelectComponent, selector: "x-select", providers: [XValueAccessor(XSelectComponent)], viewQueries: [{ propertyName: "inputCom", first: true, predicate: ["inputCom"], descendants: true, static: true }, { propertyName: "select", first: true, predicate: ["select"], descendants: true, static: true }, { propertyName: "multipleValueTpl", first: true, predicate: ["multipleValueTpl"], descendants: true, static: true }, { propertyName: "multipleInput", first: true, predicate: ["multipleInput"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div #select class=\"x-select\" [class.x-select-multiple]=\"multiple\">\r\n <div class=\"x-select-row\">\r\n <x-input\r\n #inputCom\r\n type=\"text\"\r\n [label]=\"label\"\r\n [labelWidth]=\"labelWidth\"\r\n [labelAlign]=\"labelAlign\"\r\n [justify]=\"justify\"\r\n [align]=\"align\"\r\n [direction]=\"direction\"\r\n [required]=\"required\"\r\n [validator]=\"validator\"\r\n [icon]=\"icon\"\r\n [iconSpin]=\"iconSpin\"\r\n [placeholder]=\"placeholder\"\r\n [readonly]=\"getReadonly\"\r\n [clearable]=\"showClearable\"\r\n [(ngModel)]=\"displayValue\"\r\n [valueTpl]=\"valueTpl ? valueTpl : nodeTpl\"\r\n [valueTplContext]=\"valueTplContext\"\r\n [size]=\"size\"\r\n [bordered]=\"bordered\"\r\n [before]=\"before\"\r\n [after]=\"after\"\r\n [pattern]=\"pattern\"\r\n [message]=\"message\"\r\n [pointer]=\"true\"\r\n [inputPadding]=\"inputPadding\"\r\n [(active)]=\"active\"\r\n (clearEmit)=\"clearEmit()\"\r\n (xKeydown)=\"onKeydown($event)\"\r\n (xInput)=\"onInput($event)\"\r\n (xFocus)=\"onFocus($event)\"\r\n (xClick)=\"showPortal(true)\"\r\n (xMouseenter)=\"menter()\"\r\n (xMouseleave)=\"mleave()\"\r\n (xComposition)=\"composition = $event\"\r\n ></x-input>\r\n </div>\r\n</div>\r\n\r\n<ng-template #multipleValueTpl>\r\n <x-tag [@.disabled]=\"true\" *ngFor=\"let node of displayNodes; index as i\" closable (close)=\"closeNode($event, node, i)\" [size]=\"size\">{{\r\n node.label\r\n }}</x-tag>\r\n <x-tag [@.disabled]=\"true\" *ngIf=\"showDisplayMore\" [size]=\"size\">\r\n <ng-container *xOutlet=\"getMaxTagContent; context: { $surplus: selectedSurplus, $total: selectedTotal }\">{{\r\n displayMore\r\n }}</ng-container>\r\n </x-tag>\r\n <x-input\r\n #multipleInput\r\n *ngIf=\"search\"\r\n bordered=\"false\"\r\n [size]=\"size\"\r\n inputPadding=\"0.275\"\r\n [(ngModel)]=\"multipleSearchValue\"\r\n (xInput)=\"onInput($event)\"\r\n (xKeydown)=\"onKeydown($event)\"\r\n ></x-input>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";x-select{display:inline-block;width:12rem}.x-select{margin:0;padding:0;width:100%}.x-select x-input{width:100%}.x-select-multiple .x-input-value-template-value{display:flex;align-items:center;margin-bottom:.125rem;flex-wrap:wrap;width:initial;height:initial!important}.x-select-multiple .x-input-value-template-value>x-tag{display:inline-flex;margin-left:.0625rem;margin-top:.125rem}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-big{height:var(--x-height-large);line-height:var(--x-height-large);padding:0 var(--x-padding-large)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-big>.x-icon{right:calc(-var(--x-padding-large)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-large{height:var(--x-height-medium);line-height:var(--x-height-medium);padding:0 var(--x-padding-medium)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-large>.x-icon{right:calc(-var(--x-padding-medium)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-medium{height:var(--x-height-small);line-height:var(--x-height-small);padding:0 var(--x-padding-small)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-medium>.x-icon{right:calc(-var(--x-padding-small)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-small{height:var(--x-height-mini);line-height:var(--x-height-mini);padding:0 var(--x-padding-mini)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-small>.x-icon{right:calc(-var(--x-padding-mini)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-mini{height:1.125rem;line-height:1.125rem;padding:0 .125rem}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-mini>.x-icon{right:-.0625rem}.x-select-multiple .x-input-value-template-value>x-input{margin-top:.125rem;width:5rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-large);line-height:var(--x-height-large);padding:0 var(--x-padding-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-large);line-height:var(--x-height-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-large);line-height:var(--x-height-large);padding:0 var(--x-padding-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>label{height:var(--x-height-large);line-height:var(--x-height-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-medium);line-height:var(--x-height-medium);padding:0 var(--x-padding-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-medium);line-height:var(--x-height-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-medium);line-height:var(--x-height-medium);padding:0 var(--x-padding-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>label{height:var(--x-height-medium);line-height:var(--x-height-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-small);line-height:var(--x-height-small);padding:0 var(--x-padding-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-small);line-height:var(--x-height-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-small);line-height:var(--x-height-small);padding:0 var(--x-padding-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>label{height:var(--x-height-small);line-height:var(--x-height-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-mini);line-height:var(--x-height-mini);padding:0 var(--x-padding-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-mini);line-height:var(--x-height-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-mini);line-height:var(--x-height-mini);padding:0 var(--x-padding-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>label{height:var(--x-height-mini);line-height:var(--x-height-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-value-template-value{height:1.125rem;line-height:1.125rem;padding:0 .125rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-max-length{height:1.125rem;line-height:1.125rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:1.125rem;line-height:1.125rem;padding:0 .125rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>label{height:1.125rem;line-height:1.125rem}.x-select-portal{margin:.0625rem 0;font-size:var(--x-font-size);color:var(--x-text);border:var(--x-border-width) var(--x-border-style) var(--x-border);width:100%;border-radius:var(--x-border-radius);box-shadow:var(--x-box-shadow) var(--x-box-shadow-light-color);position:relative;display:flex;background-color:var(--x-background);overflow:hidden auto;max-height:calc((calc(var(--x-font-size) + .875rem) * 6) + (var(--x-border-width) * 7))}\n"], dependencies: [{ kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i6.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i7.XInputComponent, selector: "x-input" }, { kind: "component", type: i8.XTagComponent, selector: "x-tag" }, { kind: "directive", type: i9.XOutletDirective, selector: "[xOutlet]", inputs: ["xOutletContext", "xOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
484
774
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: XSelectComponent, decorators: [{
485
775
  type: Component,
486
- args: [{ selector: `${XSelectPrefix}`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [XValueAccessor(XSelectComponent)], template: "<div #select class=\"x-select\">\r\n <div class=\"x-select-row\">\r\n <x-input\r\n #inputCom\r\n type=\"text\"\r\n [label]=\"label\"\r\n [labelWidth]=\"labelWidth\"\r\n [labelAlign]=\"labelAlign\"\r\n [justify]=\"justify\"\r\n [align]=\"align\"\r\n [direction]=\"direction\"\r\n [disabled]=\"disabled\"\r\n [required]=\"required\"\r\n [icon]=\"icon\"\r\n [iconSpin]=\"iconSpin\"\r\n [placeholder]=\"placeholder\"\r\n [readonly]=\"readonly\"\r\n [clearable]=\"showClearable\"\r\n [(ngModel)]=\"displayValue\"\r\n [valueTpl]=\"valueTpl ? valueTpl : nodeTpl\"\r\n [valueTplContext]=\"valueTplContext\"\r\n [size]=\"size\"\r\n [bordered]=\"bordered\"\r\n [before]=\"before\"\r\n [after]=\"after\"\r\n [pattern]=\"pattern\"\r\n [message]=\"message\"\r\n [pointer]=\"true\"\r\n [(active)]=\"active\"\r\n (clearEmit)=\"clearEmit()\"\r\n (xKeydown)=\"onKeydown($event)\"\r\n (xFocus)=\"onFocus($event)\"\r\n (xClick)=\"showPortal()\"\r\n (xMouseenter)=\"menter()\"\r\n (xMouseleave)=\"mleave()\"\r\n ></x-input>\r\n </div>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";x-select{display:inline-block}.x-select{margin:0;padding:0;width:100%}.x-select x-input{width:100%}.x-select-portal{margin:.0625rem 0;font-size:var(--x-font-size);color:var(--x-text);border:var(--x-border-width) var(--x-border-style) var(--x-border);width:100%;border-radius:var(--x-border-radius);box-shadow:var(--x-box-shadow) var(--x-box-shadow-light-color);position:relative;display:flex;background-color:var(--x-background);overflow:hidden auto;max-height:calc((calc(var(--x-font-size) + .875rem) * 6) + (var(--x-border-width) * 7))}\n"] }]
487
- }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i1$1.XPortalService }, { type: i0.ViewContainerRef }, { type: i2.Overlay }, { type: i3$1.XConfigService }]; }, propDecorators: { inputCom: [{
776
+ args: [{ selector: `${XSelectPrefix}`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [XValueAccessor(XSelectComponent)], template: "<div #select class=\"x-select\" [class.x-select-multiple]=\"multiple\">\r\n <div class=\"x-select-row\">\r\n <x-input\r\n #inputCom\r\n type=\"text\"\r\n [label]=\"label\"\r\n [labelWidth]=\"labelWidth\"\r\n [labelAlign]=\"labelAlign\"\r\n [justify]=\"justify\"\r\n [align]=\"align\"\r\n [direction]=\"direction\"\r\n [required]=\"required\"\r\n [validator]=\"validator\"\r\n [icon]=\"icon\"\r\n [iconSpin]=\"iconSpin\"\r\n [placeholder]=\"placeholder\"\r\n [readonly]=\"getReadonly\"\r\n [clearable]=\"showClearable\"\r\n [(ngModel)]=\"displayValue\"\r\n [valueTpl]=\"valueTpl ? valueTpl : nodeTpl\"\r\n [valueTplContext]=\"valueTplContext\"\r\n [size]=\"size\"\r\n [bordered]=\"bordered\"\r\n [before]=\"before\"\r\n [after]=\"after\"\r\n [pattern]=\"pattern\"\r\n [message]=\"message\"\r\n [pointer]=\"true\"\r\n [inputPadding]=\"inputPadding\"\r\n [(active)]=\"active\"\r\n (clearEmit)=\"clearEmit()\"\r\n (xKeydown)=\"onKeydown($event)\"\r\n (xInput)=\"onInput($event)\"\r\n (xFocus)=\"onFocus($event)\"\r\n (xClick)=\"showPortal(true)\"\r\n (xMouseenter)=\"menter()\"\r\n (xMouseleave)=\"mleave()\"\r\n (xComposition)=\"composition = $event\"\r\n ></x-input>\r\n </div>\r\n</div>\r\n\r\n<ng-template #multipleValueTpl>\r\n <x-tag [@.disabled]=\"true\" *ngFor=\"let node of displayNodes; index as i\" closable (close)=\"closeNode($event, node, i)\" [size]=\"size\">{{\r\n node.label\r\n }}</x-tag>\r\n <x-tag [@.disabled]=\"true\" *ngIf=\"showDisplayMore\" [size]=\"size\">\r\n <ng-container *xOutlet=\"getMaxTagContent; context: { $surplus: selectedSurplus, $total: selectedTotal }\">{{\r\n displayMore\r\n }}</ng-container>\r\n </x-tag>\r\n <x-input\r\n #multipleInput\r\n *ngIf=\"search\"\r\n bordered=\"false\"\r\n [size]=\"size\"\r\n inputPadding=\"0.275\"\r\n [(ngModel)]=\"multipleSearchValue\"\r\n (xInput)=\"onInput($event)\"\r\n (xKeydown)=\"onKeydown($event)\"\r\n ></x-input>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";x-select{display:inline-block;width:12rem}.x-select{margin:0;padding:0;width:100%}.x-select x-input{width:100%}.x-select-multiple .x-input-value-template-value{display:flex;align-items:center;margin-bottom:.125rem;flex-wrap:wrap;width:initial;height:initial!important}.x-select-multiple .x-input-value-template-value>x-tag{display:inline-flex;margin-left:.0625rem;margin-top:.125rem}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-big{height:var(--x-height-large);line-height:var(--x-height-large);padding:0 var(--x-padding-large)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-big>.x-icon{right:calc(-var(--x-padding-large)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-large{height:var(--x-height-medium);line-height:var(--x-height-medium);padding:0 var(--x-padding-medium)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-large>.x-icon{right:calc(-var(--x-padding-medium)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-medium{height:var(--x-height-small);line-height:var(--x-height-small);padding:0 var(--x-padding-small)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-medium>.x-icon{right:calc(-var(--x-padding-small)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-small{height:var(--x-height-mini);line-height:var(--x-height-mini);padding:0 var(--x-padding-mini)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-small>.x-icon{right:calc(-var(--x-padding-mini)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-mini{height:1.125rem;line-height:1.125rem;padding:0 .125rem}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-mini>.x-icon{right:-.0625rem}.x-select-multiple .x-input-value-template-value>x-input{margin-top:.125rem;width:5rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-large);line-height:var(--x-height-large);padding:0 var(--x-padding-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-large);line-height:var(--x-height-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-large);line-height:var(--x-height-large);padding:0 var(--x-padding-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>label{height:var(--x-height-large);line-height:var(--x-height-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-medium);line-height:var(--x-height-medium);padding:0 var(--x-padding-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-medium);line-height:var(--x-height-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-medium);line-height:var(--x-height-medium);padding:0 var(--x-padding-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>label{height:var(--x-height-medium);line-height:var(--x-height-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-small);line-height:var(--x-height-small);padding:0 var(--x-padding-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-small);line-height:var(--x-height-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-small);line-height:var(--x-height-small);padding:0 var(--x-padding-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>label{height:var(--x-height-small);line-height:var(--x-height-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-mini);line-height:var(--x-height-mini);padding:0 var(--x-padding-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-mini);line-height:var(--x-height-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-mini);line-height:var(--x-height-mini);padding:0 var(--x-padding-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>label{height:var(--x-height-mini);line-height:var(--x-height-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-value-template-value{height:1.125rem;line-height:1.125rem;padding:0 .125rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-max-length{height:1.125rem;line-height:1.125rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:1.125rem;line-height:1.125rem;padding:0 .125rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>label{height:1.125rem;line-height:1.125rem}.x-select-portal{margin:.0625rem 0;font-size:var(--x-font-size);color:var(--x-text);border:var(--x-border-width) var(--x-border-style) var(--x-border);width:100%;border-radius:var(--x-border-radius);box-shadow:var(--x-box-shadow) var(--x-box-shadow-light-color);position:relative;display:flex;background-color:var(--x-background);overflow:hidden auto;max-height:calc((calc(var(--x-font-size) + .875rem) * 6) + (var(--x-border-width) * 7))}\n"] }]
777
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i1$1.XPortalService }, { type: i0.ViewContainerRef }, { type: i2.Overlay }, { type: i1.XI18nService }, { type: i4.XConfigService }]; }, propDecorators: { inputCom: [{
488
778
  type: ViewChild,
489
779
  args: ['inputCom', { static: true }]
490
780
  }], select: [{
491
781
  type: ViewChild,
492
782
  args: ['select', { static: true }]
783
+ }], multipleValueTpl: [{
784
+ type: ViewChild,
785
+ args: ['multipleValueTpl', { static: true }]
786
+ }], multipleInput: [{
787
+ type: ViewChild,
788
+ args: ['multipleInput']
493
789
  }] } });
494
790
 
495
791
  class XSelectModule {
496
792
  }
497
793
  /** @nocollapse */ XSelectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: XSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
498
- /** @nocollapse */ XSelectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: XSelectModule, declarations: [XSelectComponent, XSelectPortalComponent, XSelectProperty], imports: [CommonModule, FormsModule, ReactiveFormsModule, XPortalModule, XInputModule, XListModule, XBaseFormModule, XI18nModule], exports: [XSelectComponent, XSelectPortalComponent] });
499
- /** @nocollapse */ XSelectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: XSelectModule, imports: [CommonModule, FormsModule, ReactiveFormsModule, XPortalModule, XInputModule, XListModule, XBaseFormModule, XI18nModule] });
794
+ /** @nocollapse */ XSelectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: XSelectModule, declarations: [XSelectComponent, XSelectPortalComponent, XSelectProperty], imports: [CommonModule,
795
+ FormsModule,
796
+ ReactiveFormsModule,
797
+ XPortalModule,
798
+ XInputModule,
799
+ XListModule,
800
+ XBaseFormModule,
801
+ XTagModule,
802
+ XI18nModule,
803
+ XOutletModule], exports: [XSelectComponent, XSelectPortalComponent] });
804
+ /** @nocollapse */ XSelectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: XSelectModule, imports: [CommonModule,
805
+ FormsModule,
806
+ ReactiveFormsModule,
807
+ XPortalModule,
808
+ XInputModule,
809
+ XListModule,
810
+ XBaseFormModule,
811
+ XTagModule,
812
+ XI18nModule,
813
+ XOutletModule] });
500
814
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: XSelectModule, decorators: [{
501
815
  type: NgModule,
502
816
  args: [{
503
817
  declarations: [XSelectComponent, XSelectPortalComponent, XSelectProperty],
504
818
  exports: [XSelectComponent, XSelectPortalComponent],
505
- imports: [CommonModule, FormsModule, ReactiveFormsModule, XPortalModule, XInputModule, XListModule, XBaseFormModule, XI18nModule]
819
+ imports: [
820
+ CommonModule,
821
+ FormsModule,
822
+ ReactiveFormsModule,
823
+ XPortalModule,
824
+ XInputModule,
825
+ XListModule,
826
+ XBaseFormModule,
827
+ XTagModule,
828
+ XI18nModule,
829
+ XOutletModule
830
+ ]
506
831
  }]
507
832
  }] });
508
833