@ng-nest/ui 14.0.1 → 14.0.4

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 (228) 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 +1 -1
  5. package/color-picker/color-picker.component.d.ts +1 -1
  6. package/core/config/config.d.ts +5 -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 +5 -3
  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 +4 -3
  16. package/esm2020/checkbox/checkbox.component.mjs +4 -3
  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 +7 -4
  25. package/esm2020/form/control.component.mjs +37 -25
  26. package/esm2020/form/form.component.mjs +15 -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 +13 -13
  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 +13 -19
  41. package/esm2020/select/select.component.mjs +299 -52
  42. package/esm2020/select/select.module.mjs +35 -4
  43. package/esm2020/select/select.property.mjs +19 -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 +16 -8
  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 +26 -5
  51. package/esm2020/tabs/tabs.component.mjs +45 -15
  52. package/esm2020/tabs/tabs.module.mjs +5 -4
  53. package/esm2020/tabs/tabs.property.mjs +4 -2
  54. package/esm2020/tag/tag.component.mjs +5 -5
  55. package/esm2020/tag/tag.property.mjs +1 -1
  56. package/esm2020/textarea/textarea.component.mjs +3 -3
  57. package/esm2020/textarea/textarea.property.mjs +1 -6
  58. package/esm2020/theme/theme.component.mjs +1 -1
  59. package/esm2020/time-picker/time-picker.component.mjs +4 -3
  60. package/esm2020/timeline/timeline.component.mjs +11 -5
  61. package/esm2020/timeline/timeline.property.mjs +7 -2
  62. package/esm2020/transfer/transfer.component.mjs +1 -1
  63. package/esm2020/tree/tree-node.component.mjs +4 -70
  64. package/esm2020/tree/tree.component.mjs +123 -23
  65. package/esm2020/tree/tree.property.mjs +1 -1
  66. package/esm2020/upload/upload.component.mjs +1 -1
  67. package/fesm2015/ng-nest-ui-auto-complete.mjs +4 -2
  68. package/fesm2015/ng-nest-ui-auto-complete.mjs.map +1 -1
  69. package/fesm2015/ng-nest-ui-base-form.mjs +10 -2
  70. package/fesm2015/ng-nest-ui-base-form.mjs.map +1 -1
  71. package/fesm2015/ng-nest-ui-button.mjs +8 -3
  72. package/fesm2015/ng-nest-ui-button.mjs.map +1 -1
  73. package/fesm2015/ng-nest-ui-cascade.mjs +3 -2
  74. package/fesm2015/ng-nest-ui-cascade.mjs.map +1 -1
  75. package/fesm2015/ng-nest-ui-checkbox.mjs +3 -2
  76. package/fesm2015/ng-nest-ui-checkbox.mjs.map +1 -1
  77. package/fesm2015/ng-nest-ui-color-picker.mjs +5 -4
  78. package/fesm2015/ng-nest-ui-color-picker.mjs.map +1 -1
  79. package/fesm2015/ng-nest-ui-core.mjs.map +1 -1
  80. package/fesm2015/ng-nest-ui-date-picker.mjs +3 -2
  81. package/fesm2015/ng-nest-ui-date-picker.mjs.map +1 -1
  82. package/fesm2015/ng-nest-ui-dialog.mjs +7 -3
  83. package/fesm2015/ng-nest-ui-dialog.mjs.map +1 -1
  84. package/fesm2015/ng-nest-ui-find.mjs +6 -3
  85. package/fesm2015/ng-nest-ui-find.mjs.map +1 -1
  86. package/fesm2015/ng-nest-ui-form.mjs +65 -30
  87. package/fesm2015/ng-nest-ui-form.mjs.map +1 -1
  88. package/fesm2015/ng-nest-ui-i18n.mjs +15 -3
  89. package/fesm2015/ng-nest-ui-i18n.mjs.map +1 -1
  90. package/fesm2015/ng-nest-ui-icon.mjs +5 -1
  91. package/fesm2015/ng-nest-ui-icon.mjs.map +1 -1
  92. package/fesm2015/ng-nest-ui-input-number.mjs +2 -2
  93. package/fesm2015/ng-nest-ui-input-number.mjs.map +1 -1
  94. package/fesm2015/ng-nest-ui-input.mjs +52 -10
  95. package/fesm2015/ng-nest-ui-input.mjs.map +1 -1
  96. package/fesm2015/ng-nest-ui-list.mjs +12 -12
  97. package/fesm2015/ng-nest-ui-list.mjs.map +1 -1
  98. package/fesm2015/ng-nest-ui-radio.mjs +3 -2
  99. package/fesm2015/ng-nest-ui-radio.mjs.map +1 -1
  100. package/fesm2015/ng-nest-ui-rate.mjs +7 -2
  101. package/fesm2015/ng-nest-ui-rate.mjs.map +1 -1
  102. package/fesm2015/ng-nest-ui-select.mjs +363 -73
  103. package/fesm2015/ng-nest-ui-select.mjs.map +1 -1
  104. package/fesm2015/ng-nest-ui-slider-select.mjs +5 -4
  105. package/fesm2015/ng-nest-ui-slider-select.mjs.map +1 -1
  106. package/fesm2015/ng-nest-ui-switch.mjs.map +1 -1
  107. package/fesm2015/ng-nest-ui-table.mjs +120 -25
  108. package/fesm2015/ng-nest-ui-table.mjs.map +1 -1
  109. package/fesm2015/ng-nest-ui-tabs.mjs +52 -18
  110. package/fesm2015/ng-nest-ui-tabs.mjs.map +1 -1
  111. package/fesm2015/ng-nest-ui-tag.mjs +4 -4
  112. package/fesm2015/ng-nest-ui-tag.mjs.map +1 -1
  113. package/fesm2015/ng-nest-ui-textarea.mjs +2 -7
  114. package/fesm2015/ng-nest-ui-textarea.mjs.map +1 -1
  115. package/fesm2015/ng-nest-ui-theme.mjs.map +1 -1
  116. package/fesm2015/ng-nest-ui-time-picker.mjs +3 -2
  117. package/fesm2015/ng-nest-ui-time-picker.mjs.map +1 -1
  118. package/fesm2015/ng-nest-ui-timeline.mjs +16 -5
  119. package/fesm2015/ng-nest-ui-timeline.mjs.map +1 -1
  120. package/fesm2015/ng-nest-ui-transfer.mjs.map +1 -1
  121. package/fesm2015/ng-nest-ui-tree.mjs +125 -91
  122. package/fesm2015/ng-nest-ui-tree.mjs.map +1 -1
  123. package/fesm2015/ng-nest-ui-upload.mjs.map +1 -1
  124. package/fesm2020/ng-nest-ui-auto-complete.mjs +4 -2
  125. package/fesm2020/ng-nest-ui-auto-complete.mjs.map +1 -1
  126. package/fesm2020/ng-nest-ui-base-form.mjs +10 -2
  127. package/fesm2020/ng-nest-ui-base-form.mjs.map +1 -1
  128. package/fesm2020/ng-nest-ui-button.mjs +8 -3
  129. package/fesm2020/ng-nest-ui-button.mjs.map +1 -1
  130. package/fesm2020/ng-nest-ui-cascade.mjs +3 -2
  131. package/fesm2020/ng-nest-ui-cascade.mjs.map +1 -1
  132. package/fesm2020/ng-nest-ui-checkbox.mjs +3 -2
  133. package/fesm2020/ng-nest-ui-checkbox.mjs.map +1 -1
  134. package/fesm2020/ng-nest-ui-color-picker.mjs +5 -4
  135. package/fesm2020/ng-nest-ui-color-picker.mjs.map +1 -1
  136. package/fesm2020/ng-nest-ui-core.mjs.map +1 -1
  137. package/fesm2020/ng-nest-ui-date-picker.mjs +3 -2
  138. package/fesm2020/ng-nest-ui-date-picker.mjs.map +1 -1
  139. package/fesm2020/ng-nest-ui-dialog.mjs +7 -3
  140. package/fesm2020/ng-nest-ui-dialog.mjs.map +1 -1
  141. package/fesm2020/ng-nest-ui-find.mjs +6 -3
  142. package/fesm2020/ng-nest-ui-find.mjs.map +1 -1
  143. package/fesm2020/ng-nest-ui-form.mjs +64 -30
  144. package/fesm2020/ng-nest-ui-form.mjs.map +1 -1
  145. package/fesm2020/ng-nest-ui-i18n.mjs +15 -3
  146. package/fesm2020/ng-nest-ui-i18n.mjs.map +1 -1
  147. package/fesm2020/ng-nest-ui-icon.mjs +5 -1
  148. package/fesm2020/ng-nest-ui-icon.mjs.map +1 -1
  149. package/fesm2020/ng-nest-ui-input-number.mjs +2 -2
  150. package/fesm2020/ng-nest-ui-input-number.mjs.map +1 -1
  151. package/fesm2020/ng-nest-ui-input.mjs +52 -10
  152. package/fesm2020/ng-nest-ui-input.mjs.map +1 -1
  153. package/fesm2020/ng-nest-ui-list.mjs +12 -12
  154. package/fesm2020/ng-nest-ui-list.mjs.map +1 -1
  155. package/fesm2020/ng-nest-ui-radio.mjs +3 -2
  156. package/fesm2020/ng-nest-ui-radio.mjs.map +1 -1
  157. package/fesm2020/ng-nest-ui-rate.mjs +7 -2
  158. package/fesm2020/ng-nest-ui-rate.mjs.map +1 -1
  159. package/fesm2020/ng-nest-ui-select.mjs +360 -73
  160. package/fesm2020/ng-nest-ui-select.mjs.map +1 -1
  161. package/fesm2020/ng-nest-ui-slider-select.mjs +5 -4
  162. package/fesm2020/ng-nest-ui-slider-select.mjs.map +1 -1
  163. package/fesm2020/ng-nest-ui-switch.mjs.map +1 -1
  164. package/fesm2020/ng-nest-ui-table.mjs +119 -25
  165. package/fesm2020/ng-nest-ui-table.mjs.map +1 -1
  166. package/fesm2020/ng-nest-ui-tabs.mjs +51 -18
  167. package/fesm2020/ng-nest-ui-tabs.mjs.map +1 -1
  168. package/fesm2020/ng-nest-ui-tag.mjs +4 -4
  169. package/fesm2020/ng-nest-ui-tag.mjs.map +1 -1
  170. package/fesm2020/ng-nest-ui-textarea.mjs +2 -7
  171. package/fesm2020/ng-nest-ui-textarea.mjs.map +1 -1
  172. package/fesm2020/ng-nest-ui-theme.mjs.map +1 -1
  173. package/fesm2020/ng-nest-ui-time-picker.mjs +3 -2
  174. package/fesm2020/ng-nest-ui-time-picker.mjs.map +1 -1
  175. package/fesm2020/ng-nest-ui-timeline.mjs +16 -5
  176. package/fesm2020/ng-nest-ui-timeline.mjs.map +1 -1
  177. package/fesm2020/ng-nest-ui-transfer.mjs.map +1 -1
  178. package/fesm2020/ng-nest-ui-tree.mjs +125 -91
  179. package/fesm2020/ng-nest-ui-tree.mjs.map +1 -1
  180. package/fesm2020/ng-nest-ui-upload.mjs.map +1 -1
  181. package/find/find.component.d.ts +1 -1
  182. package/form/control.component.d.ts +6 -3
  183. package/form/examples/en_US/default/form-vaild/README.md +8 -0
  184. package/form/examples/zh_CN/default/form-vaild/README.md +8 -0
  185. package/form/form.component.d.ts +3 -1
  186. package/form/form.module.d.ts +2 -1
  187. package/form/form.property.d.ts +7 -2
  188. package/i18n/i18n.property.d.ts +6 -0
  189. package/i18n/languages/en_US.d.ts +4 -0
  190. package/i18n/languages/zh_CN.d.ts +4 -0
  191. package/i18n/languages/zh_TW.d.ts +4 -0
  192. package/input/input.component.d.ts +3 -0
  193. package/input/input.property.d.ts +31 -1
  194. package/input-number/input-number.component.d.ts +1 -1
  195. package/package.json +1 -1
  196. package/rate/rate.component.d.ts +1 -0
  197. package/select/select-portal.component.d.ts +1 -1
  198. package/select/select.component.d.ts +34 -9
  199. package/select/select.module.d.ts +4 -2
  200. package/select/select.property.d.ts +18 -2
  201. package/slider-select/slider-select.component.d.ts +1 -1
  202. package/switch/switch.component.d.ts +1 -1
  203. package/table/examples/en_US/default/fix/README.md +6 -0
  204. package/table/examples/en_US/default/head/README.md +6 -0
  205. package/table/examples/en_US/default/header/README.md +6 -0
  206. package/table/examples/zh_CN/default/fix/README.md +6 -0
  207. package/table/examples/zh_CN/default/head/README.md +6 -0
  208. package/table/examples/zh_CN/default/header/README.md +6 -0
  209. package/table/table-body.component.d.ts +1 -1
  210. package/table/table-foot.component.d.ts +1 -0
  211. package/table/table-head.component.d.ts +2 -1
  212. package/table/table.component.d.ts +14 -2
  213. package/table/table.property.d.ts +54 -4
  214. package/tabs/examples/en_US/default/action/README.md +6 -0
  215. package/tabs/examples/zh_CN/default/action/README.md +6 -0
  216. package/tabs/tabs.component.d.ts +9 -2
  217. package/tabs/tabs.module.d.ts +3 -2
  218. package/tabs/tabs.property.d.ts +8 -3
  219. package/tag/tag.component.d.ts +1 -1
  220. package/tag/tag.property.d.ts +1 -1
  221. package/time-picker/time-picker.component.d.ts +1 -1
  222. package/timeline/examples/en_US/default/mode/README.md +6 -0
  223. package/timeline/examples/zh_CN/default/mode/README.md +6 -0
  224. package/timeline/timeline.component.d.ts +1 -0
  225. package/timeline/timeline.property.d.ts +11 -1
  226. package/tree/tree-node.component.d.ts +0 -3
  227. package/tree/tree.component.d.ts +3 -0
  228. package/tree/tree.property.d.ts +5 -0
@@ -1,24 +1,29 @@
1
- import { Subject, debounceTime, BehaviorSubject } from 'rxjs';
1
+ 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, filter, 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", search: "search", caseSensitive: "caseSensitive" }, 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);
@@ -82,6 +87,16 @@ __decorate([
82
87
  XInputBoolean(),
83
88
  XWithConfig(X_CONFIG_NAME, true)
84
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);
85
100
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: XSelectProperty, decorators: [{
86
101
  type: Component,
87
102
  args: [{ template: '' }]
@@ -111,6 +126,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImpor
111
126
  type: Input
112
127
  }], caseSensitive: [{
113
128
  type: Input
129
+ }], debounceTime: [{
130
+ type: Input
131
+ }], maxTagCount: [{
132
+ type: Input
133
+ }], maxTagContent: [{
134
+ type: Input
114
135
  }] } });
115
136
  /**
116
137
  * Select Portal
@@ -147,7 +168,6 @@ class XSelectPortalComponent {
147
168
  return this.selectAllText || this.locale.selectAllText;
148
169
  }
149
170
  ngOnInit() {
150
- this.searchData = [...this.data];
151
171
  this.valueChange.pipe(takeUntil(this._unSubject)).subscribe((x) => {
152
172
  this.value = x;
153
173
  this.cdr.detectChanges();
@@ -156,23 +176,16 @@ class XSelectPortalComponent {
156
176
  this.placement = x;
157
177
  this.cdr.detectChanges();
158
178
  });
179
+ this.dataChange.pipe(takeUntil(this._unSubject)).subscribe((x) => {
180
+ this.data = x;
181
+ this.cdr.detectChanges();
182
+ });
159
183
  this.closeSubject.pipe(takeUntil(this._unSubject)).subscribe(() => {
160
184
  this.list.setUnActive(this.active);
161
185
  });
162
186
  this.keydownSubject.pipe(takeUntil(this._unSubject)).subscribe((x) => {
163
187
  this.list.keydown(x);
164
188
  });
165
- this.searchSubject
166
- .pipe(filter((x) => x !== null), debounceTime(10), takeUntil(this._unSubject))
167
- .subscribe((x) => {
168
- if (this.caseSensitive) {
169
- this.data = this.searchData.filter((y) => y.label.indexOf(x) >= 0);
170
- }
171
- else {
172
- this.data = this.searchData.filter((y) => y.label.toLowerCase().indexOf(x.toLowerCase()) >= 0);
173
- }
174
- this.cdr.detectChanges();
175
- });
176
189
  this.i18n.localeChange
177
190
  .pipe(map((x) => x.select), takeUntil(this._unSubject))
178
191
  .subscribe((x) => {
@@ -188,13 +201,15 @@ class XSelectPortalComponent {
188
201
  event.stopPropagation();
189
202
  }
190
203
  nodeClick(node) {
191
- if (this.multiple === 0)
192
- this.nodeEmit(this.value);
193
- else
204
+ if (this.multiple === 0) {
205
+ this.nodeEmit(node, this.value);
206
+ }
207
+ else {
194
208
  this.nodeEmit(node);
209
+ }
195
210
  }
196
211
  onSelectAll(_isSelectAll) {
197
- this.nodeEmit(this.value);
212
+ this.nodeEmit(null, this.value);
198
213
  }
199
214
  onActive(num) {
200
215
  this.active = num;
@@ -204,7 +219,7 @@ class XSelectPortalComponent {
204
219
  }
205
220
  }
206
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 });
207
- /** @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: 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 });
208
223
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: XSelectPortalComponent, decorators: [{
209
224
  type: Component,
210
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"] }]
@@ -223,36 +238,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImpor
223
238
  }] } });
224
239
 
225
240
  class XSelectComponent extends XSelectProperty {
226
- constructor(renderer, cdr, portalService, viewContainerRef, overlay, configService) {
241
+ constructor(renderer, cdr, portalService, viewContainerRef, overlay, i18n, configService) {
227
242
  super();
228
243
  this.renderer = renderer;
229
244
  this.cdr = cdr;
230
245
  this.portalService = portalService;
231
246
  this.viewContainerRef = viewContainerRef;
232
247
  this.overlay = overlay;
248
+ this.i18n = i18n;
233
249
  this.configService = configService;
234
250
  this.readonly = true;
235
251
  this.enter = false;
236
252
  this.showClearable = false;
237
253
  this.displayValue = '';
254
+ this.multipleSearchValue = '';
238
255
  this.nodes = [];
256
+ this.selectedNodes = [];
257
+ this.displayNodes = [];
258
+ this.displayMore = '';
259
+ this.showDisplayMore = false;
260
+ this.searchNodes = [];
239
261
  this.icon = 'fto-chevron-down';
240
262
  this.iconSpin = false;
241
263
  this.maxNodes = 6;
264
+ this.inputPadding = 0.4;
242
265
  this.protalTobottom = true;
243
266
  this.asyncLoading = false;
244
267
  this.animating = false;
245
268
  this.objectArray = false;
269
+ this.selectedSurplus = 0;
270
+ this.selectedTotal = 0;
271
+ this.locale = {};
246
272
  this.valueTplContext = { $node: null, $isValue: true };
247
273
  this.valueChange = new Subject();
248
274
  this.positionChange = new Subject();
249
275
  this.closeSubject = new Subject();
276
+ this.dataChange = new Subject();
250
277
  this.keydownSubject = new Subject();
251
- this.searchSubject = new BehaviorSubject(null);
278
+ this.inputChange = new Subject();
279
+ this.composition = false;
280
+ this.multipleInputSizeChange = new Subject();
252
281
  this._unSubject = new Subject();
253
282
  }
254
283
  get getReadonly() {
255
- return this.readonly && !this.search;
284
+ return (this.readonly && !this.search) || (Boolean(this.search) && Boolean(this.multiple));
285
+ }
286
+ get getMaxTagContent() {
287
+ return this.maxTagContent || this.locale.maxTagContent;
256
288
  }
257
289
  writeValue(value) {
258
290
  if (this.multiple && XIsEmpty(value)) {
@@ -267,6 +299,16 @@ class XSelectComponent extends XSelectProperty {
267
299
  this.setFlex(this.select.nativeElement, this.renderer, this.justify, this.align, this.direction);
268
300
  this.setClassMap();
269
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
+ });
270
312
  }
271
313
  ngOnChanges(changes) {
272
314
  const { data } = changes;
@@ -274,10 +316,19 @@ class XSelectComponent extends XSelectProperty {
274
316
  }
275
317
  ngAfterViewInit() {
276
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
+ }
277
327
  }
278
328
  ngOnDestroy() {
279
329
  this._unSubject.next();
280
330
  this._unSubject.unsubscribe();
331
+ this._resizeObserver?.disconnect();
281
332
  }
282
333
  setClassMap() {
283
334
  XClearClass(this.labelMap);
@@ -297,18 +348,66 @@ class XSelectComponent extends XSelectProperty {
297
348
  this.closeSubject.pipe(takeUntil(this._unSubject)).subscribe(() => {
298
349
  this.closePortal();
299
350
  });
351
+ this.inputChange.pipe(debounceTime(this.debounceTime), distinctUntilChanged(), takeUntil(this._unSubject)).subscribe((x) => {
352
+ this.modelChange(x);
353
+ });
300
354
  this.keydownSubject.pipe(throttleTime(10), takeUntil(this._unSubject)).subscribe((x) => {
301
355
  const keyCode = x.keyCode;
302
356
  if (!this.portalAttached() && [DOWN_ARROW, UP_ARROW, LEFT_ARROW, RIGHT_ARROW, ENTER, MAC_ENTER].includes(keyCode)) {
303
- this.showPortal();
357
+ this.inputChange.next(this.displayValue);
304
358
  }
305
359
  if (this.portalAttached() && [ESCAPE].includes(keyCode)) {
306
360
  this.closeSubject.next();
307
361
  }
308
362
  });
363
+ this.multipleInputSizeChange.pipe(distinctUntilChanged(), takeUntil(this._unSubject)).subscribe((x) => {
364
+ if (this.multipleInput) {
365
+ const input = this.multipleInput?.elementRef.nativeElement;
366
+ this.renderer.setStyle(input, 'width', `${x}px`);
367
+ }
368
+ });
369
+ }
370
+ setMutipleInputSize() {
371
+ const ivf = this.inputCom.inputValueRef.nativeElement;
372
+ let { clientWidth, scrollHeight } = ivf;
373
+ const len = ivf.children.length;
374
+ let lastRowTagTop = -1;
375
+ let lines = 1;
376
+ let rowTagTop = -1;
377
+ let lastRowTagsWidth = 0;
378
+ let marginLeft = 0;
379
+ let marginTop = 0;
380
+ for (let i = len - 1; i >= 0; i--) {
381
+ const ele = ivf.children[i];
382
+ if (ele.tagName === 'X-TAG') {
383
+ const { offsetTop, offsetWidth } = ele;
384
+ const style = getComputedStyle(ele);
385
+ marginLeft = Number(style.marginLeft.replace('px', ''));
386
+ marginTop = Number(style.marginTop.replace('px', ''));
387
+ if (rowTagTop === -1) {
388
+ rowTagTop = offsetTop;
389
+ }
390
+ else if (rowTagTop !== offsetTop) {
391
+ lines++;
392
+ rowTagTop = offsetTop;
393
+ }
394
+ if (lastRowTagTop === -1) {
395
+ lastRowTagTop = offsetTop;
396
+ }
397
+ if (lastRowTagTop === offsetTop) {
398
+ lastRowTagsWidth += offsetWidth + marginLeft;
399
+ }
400
+ }
401
+ }
402
+ const height = scrollHeight + (lines > 1 ? marginTop : 0);
403
+ this.renderer.setStyle(this.inputCom.inputRef.nativeElement, 'height', `${height}px`);
404
+ if (this.multipleInput) {
405
+ this.multipleInputSizeChange.next(clientWidth - lastRowTagsWidth - marginLeft);
406
+ }
407
+ this.portal?.overlayRef?.updatePosition();
309
408
  }
310
409
  menter() {
311
- if (this.disabled || !this.clearable)
410
+ if (this.disabled || !this.clearable || this.iconSpin)
312
411
  return;
313
412
  this.enter = true;
314
413
  if (!XIsEmpty(this.displayValue)) {
@@ -318,7 +417,7 @@ class XSelectComponent extends XSelectProperty {
318
417
  }
319
418
  }
320
419
  mleave() {
321
- if (this.disabled || !this.clearable)
420
+ if (this.disabled || !this.clearable || this.iconSpin)
322
421
  return;
323
422
  this.enter = false;
324
423
  if (this.clearable) {
@@ -327,35 +426,102 @@ class XSelectComponent extends XSelectProperty {
327
426
  this.cdr.detectChanges();
328
427
  }
329
428
  }
429
+ modelChange(value) {
430
+ if (XIsFunction(this.data)) {
431
+ if (!this.portalAttached()) {
432
+ this.showPortal();
433
+ }
434
+ else {
435
+ this.icon = 'fto-loader';
436
+ this.iconSpin = true;
437
+ this.cdr.detectChanges();
438
+ XSetData(this.data, this._unSubject, true, value).subscribe((x) => {
439
+ this.icon = '';
440
+ this.iconSpin = false;
441
+ this.nodes = x;
442
+ this.dataChange.next(this.nodes);
443
+ this.cdr.detectChanges();
444
+ });
445
+ }
446
+ return;
447
+ }
448
+ if (this.nodes) {
449
+ if (!this.portalAttached()) {
450
+ this.showPortal();
451
+ }
452
+ else {
453
+ if (XIsEmpty(value)) {
454
+ this.searchNodes = [...this.nodes];
455
+ }
456
+ else {
457
+ this.setSearchNodes(value);
458
+ }
459
+ this.dataChange.next(this.searchNodes);
460
+ }
461
+ }
462
+ }
463
+ setSearchNodes(value) {
464
+ if (this.caseSensitive) {
465
+ this.searchNodes = this.nodes.filter((x) => x.label.indexOf(value) >= 0);
466
+ }
467
+ else {
468
+ this.searchNodes = this.nodes.filter((x) => x.label.toLowerCase().indexOf(value.toLowerCase()) >= 0);
469
+ }
470
+ }
330
471
  clearEmit() {
331
- this.value = '';
472
+ this.value = this.multiple ? [] : '';
332
473
  this.displayValue = '';
474
+ this.multipleSearchValue = '';
475
+ this.selectedNodes = [];
476
+ this.setDisplayNodes();
333
477
  this.valueTplContext.$node = null;
334
478
  this.mleave();
335
479
  this.valueChange.next(this.value);
336
- this.searchSubject.next('');
480
+ this.inputChange.next('');
337
481
  if (this.onChange)
338
482
  this.onChange(this.value);
339
483
  }
340
- setDisplayValue() {
484
+ setDisplayValue(clickNode) {
341
485
  if (this.nodes.length > 0) {
342
486
  if (this.multiple) {
343
487
  if (XIsEmpty(this.value)) {
344
488
  this.displayValue = '';
489
+ this.selectedNodes = [];
490
+ this.displayNodes = [];
491
+ this.displayMore = '';
345
492
  this.valueTplContext.$node = null;
493
+ this.setDisplayNodes();
346
494
  }
347
495
  else {
348
- let nodes = [];
496
+ let ids = [];
497
+ let selected = [];
349
498
  if (XIsObjectArray(this.value)) {
350
499
  this.objectArray = true;
351
- nodes = this.nodes.filter((x) => !XIsEmpty(this.value.find((y) => y.id === x.id)));
500
+ ids = this.value.map((x) => x.id);
352
501
  }
353
502
  else {
354
503
  this.objectArray = false;
355
- nodes = this.nodes.filter((x) => !XIsEmpty(this.value.find((y) => y === x.id)));
504
+ ids = this.value;
505
+ }
506
+ if (clickNode) {
507
+ if (clickNode.selected) {
508
+ this.selectedNodes.push(clickNode);
509
+ }
510
+ else {
511
+ XRemove(this.selectedNodes, (x) => x.id === clickNode.id);
512
+ }
513
+ }
514
+ else {
515
+ for (let id of ids) {
516
+ let node = this.nodes.find((x) => x.id === id);
517
+ if (node)
518
+ selected.push(node);
519
+ }
520
+ this.selectedNodes = selected;
356
521
  }
357
- this.displayValue = nodes.map((x) => x.label).join(',');
358
- this.valueTplContext.$node = [...nodes];
522
+ this.setDisplayNodes();
523
+ this.displayValue = this.selectedNodes.map((x) => x.label).join(',');
524
+ this.valueTplContext.$node = [...this.selectedNodes];
359
525
  }
360
526
  }
361
527
  else {
@@ -372,6 +538,48 @@ class XSelectComponent extends XSelectProperty {
372
538
  this.cdr.detectChanges();
373
539
  }
374
540
  }
541
+ closeNode(event, node, index) {
542
+ let inx = -1;
543
+ if (XIsObjectArray(this.value)) {
544
+ inx = this.value.findIndex((y) => y.id === node.id);
545
+ }
546
+ else {
547
+ inx = this.value.findIndex((y) => y === node.id);
548
+ }
549
+ if (inx >= 0) {
550
+ this.value.splice(inx, 1);
551
+ this.valueChange.next(this.value);
552
+ if (this.onChange)
553
+ this.onChange(this.value);
554
+ this.selectedNodes.splice(index, 1);
555
+ this.setDisplayNodes();
556
+ }
557
+ event.stopPropagation();
558
+ }
559
+ setDisplayNodes() {
560
+ if (!this.multiple || !this.search)
561
+ return;
562
+ const maxlen = this.selectedNodes.length;
563
+ let len = 0;
564
+ if (!this.maxTagCount) {
565
+ len = maxlen;
566
+ }
567
+ else {
568
+ len = maxlen > Number(this.maxTagCount) ? Number(this.maxTagCount) : maxlen;
569
+ }
570
+ let more = maxlen - len;
571
+ more = more < 0 ? 0 : more;
572
+ this.displayNodes = this.selectedNodes.slice(0, len);
573
+ this.showDisplayMore = more > 0;
574
+ if (XIsString(this.getMaxTagContent)) {
575
+ this.displayMore = more > 0 ? this.getMaxTagContent.replace(/\{\{surplus\}\}/g, `${more}`) : '';
576
+ }
577
+ else {
578
+ this.selectedSurplus = more;
579
+ this.selectedTotal = maxlen;
580
+ }
581
+ setTimeout(() => this.setMutipleInputSize());
582
+ }
375
583
  portalAttached() {
376
584
  return this.portal?.overlayRef?.hasAttached();
377
585
  }
@@ -379,6 +587,7 @@ class XSelectComponent extends XSelectProperty {
379
587
  if (this.portalAttached()) {
380
588
  this.portal?.overlayRef?.detach();
381
589
  this.active = false;
590
+ this.multipleSearchValue = '';
382
591
  this.cdr.detectChanges();
383
592
  return true;
384
593
  }
@@ -387,29 +596,34 @@ class XSelectComponent extends XSelectProperty {
387
596
  destroyPortal() {
388
597
  this.portal?.overlayRef?.dispose();
389
598
  }
390
- showPortal() {
391
- if (this.disabled || this.iconSpin)
392
- return;
393
- if (this.animating)
599
+ showPortal(click = false) {
600
+ if (this.disabled || this.iconSpin || this.animating)
394
601
  return;
395
602
  this.active = true;
396
- if (this.async && XIsObservable(this.data) && this.nodes.length === 0) {
603
+ if ((this.async && XIsObservable(this.data) && this.nodes.length === 0) || XIsFunction(this.data)) {
397
604
  this.icon = 'fto-loader';
398
605
  this.iconSpin = true;
399
- this.cdr.detectChanges();
400
- XSetData(this.data, this._unSubject).subscribe((x) => {
401
- this.nodes = x;
402
- this.setDisplayValue();
403
- this.createPortal();
606
+ this.inputCom.cdr.detectChanges();
607
+ XSetData(this.data, this._unSubject, true, click ? '' : this.displayValue).subscribe((x) => {
404
608
  this.icon = 'fto-chevron-down';
405
609
  this.iconSpin = false;
610
+ this.inputCom.cdr.detectChanges();
611
+ this.nodes = x;
612
+ if (!this.search)
613
+ this.setDisplayValue();
614
+ this.createPortal();
406
615
  this.cdr.detectChanges();
407
616
  });
408
617
  }
409
618
  else {
410
619
  this.createPortal();
411
620
  }
412
- this.inputCom.inputFocus();
621
+ if (this.search && this.multiple) {
622
+ this.multipleInput.inputFocus();
623
+ }
624
+ else {
625
+ this.inputCom.inputFocus();
626
+ }
413
627
  }
414
628
  createPortal() {
415
629
  this.nodes.filter((x) => x.selected).map((x) => (x.selected = false));
@@ -434,9 +648,6 @@ class XSelectComponent extends XSelectProperty {
434
648
  this.closeSubject.next();
435
649
  });
436
650
  this.setInstance();
437
- if (this.search && this.value) {
438
- this.searchSubject.next('');
439
- }
440
651
  }
441
652
  setPosition(config) {
442
653
  let position = config.positionStrategy;
@@ -460,7 +671,7 @@ class XSelectComponent extends XSelectProperty {
460
671
  positionChange: this.positionChange,
461
672
  closeSubject: this.closeSubject,
462
673
  keydownSubject: this.keydownSubject,
463
- searchSubject: this.searchSubject,
674
+ dataChange: this.dataChange,
464
675
  inputCom: this.inputCom,
465
676
  portalMaxHeight: this.portalMaxHeight,
466
677
  objectArray: this.objectArray,
@@ -468,16 +679,45 @@ class XSelectComponent extends XSelectProperty {
468
679
  caseSensitive: this.caseSensitive,
469
680
  search: this.search,
470
681
  destroyPortal: () => this.destroyPortal(),
471
- nodeEmit: (node) => this.nodeClick(node),
682
+ nodeEmit: (node, value) => this.nodeClick(node, value),
472
683
  animating: (ing) => (this.animating = ing)
473
684
  });
474
685
  componentRef.changeDetectorRef.detectChanges();
475
686
  }
476
- nodeClick(node) {
477
- if (this.multiple && XIsArray(node)) {
478
- node = node;
479
- this.value = node;
480
- this.setDisplayValue();
687
+ nodeClick(node, value) {
688
+ if (this.multiple) {
689
+ if (node) {
690
+ if (XIsObjectArray(value)) {
691
+ if (node.selected) {
692
+ this.value.push(node);
693
+ }
694
+ else {
695
+ let inx = this.value.findIndex((x) => x.id === node.id);
696
+ this.value.splice(inx, 1);
697
+ }
698
+ }
699
+ else if (XIsArray(value)) {
700
+ if (node.selected) {
701
+ this.value.push(node.id);
702
+ }
703
+ else {
704
+ this.value.splice(this.value.indexOf(node.id), 1);
705
+ }
706
+ }
707
+ }
708
+ else {
709
+ this.value = value;
710
+ }
711
+ if (this.multipleInput) {
712
+ const input = this.multipleInput.elementRef.nativeElement;
713
+ this.renderer.setStyle(input, 'width', '2rem');
714
+ }
715
+ if (this.search && this.multipleSearchValue !== '') {
716
+ this.multipleSearchValue = '';
717
+ this.inputChange.next('');
718
+ this.valueChange.next([...this.value]);
719
+ }
720
+ this.setDisplayValue(node);
481
721
  }
482
722
  else {
483
723
  node = node;
@@ -486,11 +726,20 @@ class XSelectComponent extends XSelectProperty {
486
726
  this.value = node.id;
487
727
  this.closeSubject.next();
488
728
  }
489
- this.inputCom.inputFocus();
729
+ if (this.search && this.multiple) {
730
+ this.multipleInput.inputFocus();
731
+ }
732
+ else {
733
+ this.inputCom.inputFocus();
734
+ }
490
735
  if (this.onChange)
491
736
  this.onChange(this.value);
737
+ this.formControlValidator();
492
738
  this.cdr.detectChanges();
493
739
  }
740
+ selectAllNodes(value) {
741
+ this.value = value;
742
+ }
494
743
  setPlacement() {
495
744
  return this.portalService.setPlacement({
496
745
  elementRef: this.inputCom.inputRef,
@@ -513,39 +762,77 @@ class XSelectComponent extends XSelectProperty {
513
762
  }
514
763
  }
515
764
  onFocus(_event) {
516
- this.inputCom.inputFocus();
765
+ if (this.search && this.multiple) {
766
+ this.multipleInput.inputFocus();
767
+ }
768
+ else {
769
+ this.inputCom.inputFocus();
770
+ }
517
771
  }
518
772
  onInput(_event) {
519
- this.searchSubject.next(this.displayValue);
520
- if (!this.portalAttached()) {
521
- this.showPortal();
522
- }
773
+ this.formControlValidator();
774
+ setTimeout(() => this.inputChange.next(this.multiple ? this.multipleSearchValue : this.displayValue));
523
775
  }
524
776
  }
525
- /** @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 });
526
- /** @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 [required]=\"required\"\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 [(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()\"\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;width:12rem}.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 });
777
+ /** @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 });
778
+ /** @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 });
527
779
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: XSelectComponent, decorators: [{
528
780
  type: Component,
529
- 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 [required]=\"required\"\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 [(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()\"\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;width:12rem}.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"] }]
530
- }], 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: [{
781
+ 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"] }]
782
+ }], 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: [{
531
783
  type: ViewChild,
532
784
  args: ['inputCom', { static: true }]
533
785
  }], select: [{
534
786
  type: ViewChild,
535
787
  args: ['select', { static: true }]
788
+ }], multipleValueTpl: [{
789
+ type: ViewChild,
790
+ args: ['multipleValueTpl', { static: true }]
791
+ }], multipleInput: [{
792
+ type: ViewChild,
793
+ args: ['multipleInput']
536
794
  }] } });
537
795
 
538
796
  class XSelectModule {
539
797
  }
540
798
  /** @nocollapse */ XSelectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: XSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
541
- /** @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] });
542
- /** @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] });
799
+ /** @nocollapse */ XSelectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: XSelectModule, declarations: [XSelectComponent, XSelectPortalComponent, XSelectProperty], imports: [CommonModule,
800
+ FormsModule,
801
+ ReactiveFormsModule,
802
+ XPortalModule,
803
+ XInputModule,
804
+ XListModule,
805
+ XBaseFormModule,
806
+ XTagModule,
807
+ XI18nModule,
808
+ XOutletModule], exports: [XSelectComponent, XSelectPortalComponent] });
809
+ /** @nocollapse */ XSelectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: XSelectModule, imports: [CommonModule,
810
+ FormsModule,
811
+ ReactiveFormsModule,
812
+ XPortalModule,
813
+ XInputModule,
814
+ XListModule,
815
+ XBaseFormModule,
816
+ XTagModule,
817
+ XI18nModule,
818
+ XOutletModule] });
543
819
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: XSelectModule, decorators: [{
544
820
  type: NgModule,
545
821
  args: [{
546
822
  declarations: [XSelectComponent, XSelectPortalComponent, XSelectProperty],
547
823
  exports: [XSelectComponent, XSelectPortalComponent],
548
- imports: [CommonModule, FormsModule, ReactiveFormsModule, XPortalModule, XInputModule, XListModule, XBaseFormModule, XI18nModule]
824
+ imports: [
825
+ CommonModule,
826
+ FormsModule,
827
+ ReactiveFormsModule,
828
+ XPortalModule,
829
+ XInputModule,
830
+ XListModule,
831
+ XBaseFormModule,
832
+ XTagModule,
833
+ XI18nModule,
834
+ XOutletModule
835
+ ]
549
836
  }]
550
837
  }] });
551
838