@taiga-ui/legacy 4.52.0-canary.2c75afa → 4.52.0-canary.2d877cf

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 (225) hide show
  1. package/README.md +1 -1
  2. package/components/dialog/dialog.service.d.ts +1 -1
  3. package/components/dialog/dialog.tokens.d.ts +1 -3
  4. package/components/index.d.ts +0 -17
  5. package/components/mobile-dialog/mobile-dialog.options.d.ts +1 -3
  6. package/components/mobile-dialog/mobile-dialog.service.d.ts +1 -1
  7. package/components/pdf-viewer/pdf-viewer.options.d.ts +1 -3
  8. package/components/pdf-viewer/pdf-viewer.service.d.ts +1 -1
  9. package/fesm2022/taiga-ui-legacy-components-dialog.mjs +14 -19
  10. package/fesm2022/taiga-ui-legacy-components-dialog.mjs.map +1 -1
  11. package/fesm2022/taiga-ui-legacy-components-mobile-dialog.mjs +11 -16
  12. package/fesm2022/taiga-ui-legacy-components-mobile-dialog.mjs.map +1 -1
  13. package/fesm2022/taiga-ui-legacy-components-pdf-viewer.mjs +13 -18
  14. package/fesm2022/taiga-ui-legacy-components-pdf-viewer.mjs.map +1 -1
  15. package/fesm2022/taiga-ui-legacy-components.mjs +0 -17
  16. package/fesm2022/taiga-ui-legacy-components.mjs.map +1 -1
  17. package/fesm2022/taiga-ui-legacy.mjs +0 -4
  18. package/fesm2022/taiga-ui-legacy.mjs.map +1 -1
  19. package/index.d.ts +0 -4
  20. package/package.json +12 -114
  21. package/classes/abstract-native-select.d.ts +0 -22
  22. package/classes/abstract-textfield-host.d.ts +0 -19
  23. package/classes/control.d.ts +0 -60
  24. package/classes/controller.d.ts +0 -9
  25. package/classes/index.d.ts +0 -9
  26. package/classes/interactive.d.ts +0 -34
  27. package/classes/multiple-control.d.ts +0 -11
  28. package/classes/named-day.d.ts +0 -11
  29. package/classes/nullable-control.d.ts +0 -10
  30. package/classes/stringifiable-item.d.ts +0 -11
  31. package/components/arrow/arrow.component.d.ts +0 -17
  32. package/components/arrow/arrow.options.d.ts +0 -19
  33. package/components/arrow/arrow.providers.d.ts +0 -23
  34. package/components/arrow/index.d.ts +0 -3
  35. package/components/input/index.d.ts +0 -3
  36. package/components/input/input.component.d.ts +0 -32
  37. package/components/input/input.directive.d.ts +0 -12
  38. package/components/input/input.module.d.ts +0 -16
  39. package/components/input-date-range/index.d.ts +0 -3
  40. package/components/input-date-range/input-date-range.component.d.ts +0 -66
  41. package/components/input-date-range/input-date-range.directive.d.ts +0 -16
  42. package/components/input-date-range/input-date-range.module.d.ts +0 -21
  43. package/components/input-date-time/index.d.ts +0 -3
  44. package/components/input-date-time/input-date-time.component.d.ts +0 -87
  45. package/components/input-date-time/input-date-time.directive.d.ts +0 -17
  46. package/components/input-date-time/input-date-time.module.d.ts +0 -23
  47. package/components/input-date-time/native-date-time/native-date-time.directive.d.ts +0 -13
  48. package/components/input-month-range/index.d.ts +0 -3
  49. package/components/input-month-range/input-month-range.component.d.ts +0 -38
  50. package/components/input-month-range/input-month-range.directive.d.ts +0 -23
  51. package/components/input-month-range/input-month-range.module.d.ts +0 -18
  52. package/components/input-number/index.d.ts +0 -4
  53. package/components/input-number/input-number.component.d.ts +0 -62
  54. package/components/input-number/input-number.directive.d.ts +0 -16
  55. package/components/input-number/input-number.module.d.ts +0 -18
  56. package/components/input-number/input-number.options.d.ts +0 -29
  57. package/components/input-range/index.d.ts +0 -2
  58. package/components/input-range/input-range.component.d.ts +0 -56
  59. package/components/input-range/input-range.module.d.ts +0 -19
  60. package/components/input-slider/index.d.ts +0 -2
  61. package/components/input-slider/input-slider.component.d.ts +0 -42
  62. package/components/input-slider/input-slider.module.d.ts +0 -18
  63. package/components/input-tag/index.d.ts +0 -3
  64. package/components/input-tag/input-tag.component.d.ts +0 -103
  65. package/components/input-tag/input-tag.module.d.ts +0 -22
  66. package/components/input-tag/input-tag.options.d.ts +0 -27
  67. package/components/multi-select/hide-selected.pipe.d.ts +0 -11
  68. package/components/multi-select/index.d.ts +0 -10
  69. package/components/multi-select/multi-select-group/multi-select-group.component.d.ts +0 -23
  70. package/components/multi-select/multi-select-group/multi-select-group.directive.d.ts +0 -8
  71. package/components/multi-select/multi-select.component.d.ts +0 -71
  72. package/components/multi-select/multi-select.directive.d.ts +0 -14
  73. package/components/multi-select/multi-select.module.d.ts +0 -30
  74. package/components/multi-select/multi-select.options.d.ts +0 -14
  75. package/components/multi-select/native-multi-select/native-multi-select-group.component.d.ts +0 -9
  76. package/components/multi-select/native-multi-select/native-multi-select.component.d.ts +0 -8
  77. package/components/multi-select/native-multi-select/native-multi-select.d.ts +0 -11
  78. package/components/multi-select-option/index.d.ts +0 -2
  79. package/components/multi-select-option/multi-select-option.component.d.ts +0 -9
  80. package/components/multi-select-option/multi-select-option.module.d.ts +0 -9
  81. package/components/primitive-textfield/index.d.ts +0 -7
  82. package/components/primitive-textfield/primitive-textfield-options.d.ts +0 -21
  83. package/components/primitive-textfield/primitive-textfield-types.d.ts +0 -11
  84. package/components/primitive-textfield/primitive-textfield.component.d.ts +0 -73
  85. package/components/primitive-textfield/primitive-textfield.directive.d.ts +0 -14
  86. package/components/primitive-textfield/primitive-textfield.module.d.ts +0 -21
  87. package/components/primitive-textfield/textfield/textfield.component.d.ts +0 -13
  88. package/components/primitive-textfield/value-decoration/value-decoration.component.d.ts +0 -22
  89. package/components/select/index.d.ts +0 -6
  90. package/components/select/native-select/native-select-group.component.d.ts +0 -17
  91. package/components/select/native-select/native-select.component.d.ts +0 -16
  92. package/components/select/select.component.d.ts +0 -45
  93. package/components/select/select.directive.d.ts +0 -16
  94. package/components/select/select.module.d.ts +0 -24
  95. package/components/select/select.options.d.ts +0 -25
  96. package/components/select-option/index.d.ts +0 -2
  97. package/components/select-option/select-option.component.d.ts +0 -27
  98. package/components/select-option/select-option.module.d.ts +0 -10
  99. package/components/tag/index.d.ts +0 -3
  100. package/components/tag/tag.component.d.ts +0 -44
  101. package/components/tag/tag.module.d.ts +0 -16
  102. package/components/tag/tag.options.d.ts +0 -27
  103. package/components/textarea/index.d.ts +0 -3
  104. package/components/textarea/textarea.component.d.ts +0 -54
  105. package/components/textarea/textarea.directive.d.ts +0 -12
  106. package/components/textarea/textarea.module.d.ts +0 -21
  107. package/components/tooltip/index.d.ts +0 -2
  108. package/components/tooltip/tooltip.component.d.ts +0 -12
  109. package/components/tooltip/tooltip.module.d.ts +0 -13
  110. package/directives/index.d.ts +0 -5
  111. package/directives/legacy-dropdown-open-monitor/index.d.ts +0 -1
  112. package/directives/legacy-dropdown-open-monitor/legacy-dropdown-open-monitor.d.ts +0 -11
  113. package/directives/textfield-controller/index.d.ts +0 -14
  114. package/directives/textfield-controller/textfield-appearance.directive.d.ts +0 -9
  115. package/directives/textfield-controller/textfield-cleaner.directive.d.ts +0 -9
  116. package/directives/textfield-controller/textfield-controller.module.d.ts +0 -17
  117. package/directives/textfield-controller/textfield-controller.provider.d.ts +0 -4
  118. package/directives/textfield-controller/textfield-custom-content.directive.d.ts +0 -10
  119. package/directives/textfield-controller/textfield-filler.directive.d.ts +0 -9
  120. package/directives/textfield-controller/textfield-icon-left.directive.d.ts +0 -12
  121. package/directives/textfield-controller/textfield-icon.directive.d.ts +0 -12
  122. package/directives/textfield-controller/textfield-label-outside.directive.d.ts +0 -9
  123. package/directives/textfield-controller/textfield-postfix.directive.d.ts +0 -9
  124. package/directives/textfield-controller/textfield-prefix.directive.d.ts +0 -9
  125. package/directives/textfield-controller/textfield-size.directive.d.ts +0 -10
  126. package/directives/textfield-controller/textfield.controller.d.ts +0 -41
  127. package/directives/textfield-controller/textfield.options.d.ts +0 -19
  128. package/directives/unfinished-validator/index.d.ts +0 -2
  129. package/directives/unfinished-validator/unfinished-validator.directive.d.ts +0 -10
  130. package/directives/unfinished-validator/unfinished.validator.d.ts +0 -4
  131. package/directives/value-accessor/index.d.ts +0 -3
  132. package/directives/value-accessor/value-accessor.directive.d.ts +0 -5
  133. package/directives/value-accessor/value-accessor.module.d.ts +0 -7
  134. package/directives/value-accessor/value-accessor.provider.d.ts +0 -2
  135. package/directives/wrapper/README.md +0 -19
  136. package/directives/wrapper/index.d.ts +0 -2
  137. package/directives/wrapper/wrapper.directive.d.ts +0 -22
  138. package/directives/wrapper/wrapper.module.d.ts +0 -10
  139. package/fesm2022/taiga-ui-legacy-classes.mjs +0 -413
  140. package/fesm2022/taiga-ui-legacy-classes.mjs.map +0 -1
  141. package/fesm2022/taiga-ui-legacy-components-arrow.mjs +0 -85
  142. package/fesm2022/taiga-ui-legacy-components-arrow.mjs.map +0 -1
  143. package/fesm2022/taiga-ui-legacy-components-input-date-range.mjs +0 -346
  144. package/fesm2022/taiga-ui-legacy-components-input-date-range.mjs.map +0 -1
  145. package/fesm2022/taiga-ui-legacy-components-input-date-time.mjs +0 -459
  146. package/fesm2022/taiga-ui-legacy-components-input-date-time.mjs.map +0 -1
  147. package/fesm2022/taiga-ui-legacy-components-input-month-range.mjs +0 -221
  148. package/fesm2022/taiga-ui-legacy-components-input-month-range.mjs.map +0 -1
  149. package/fesm2022/taiga-ui-legacy-components-input-number.mjs +0 -383
  150. package/fesm2022/taiga-ui-legacy-components-input-number.mjs.map +0 -1
  151. package/fesm2022/taiga-ui-legacy-components-input-range.mjs +0 -261
  152. package/fesm2022/taiga-ui-legacy-components-input-range.mjs.map +0 -1
  153. package/fesm2022/taiga-ui-legacy-components-input-slider.mjs +0 -199
  154. package/fesm2022/taiga-ui-legacy-components-input-slider.mjs.map +0 -1
  155. package/fesm2022/taiga-ui-legacy-components-input-tag.mjs +0 -524
  156. package/fesm2022/taiga-ui-legacy-components-input-tag.mjs.map +0 -1
  157. package/fesm2022/taiga-ui-legacy-components-input.mjs +0 -156
  158. package/fesm2022/taiga-ui-legacy-components-input.mjs.map +0 -1
  159. package/fesm2022/taiga-ui-legacy-components-multi-select-option.mjs +0 -47
  160. package/fesm2022/taiga-ui-legacy-components-multi-select-option.mjs.map +0 -1
  161. package/fesm2022/taiga-ui-legacy-components-multi-select.mjs +0 -686
  162. package/fesm2022/taiga-ui-legacy-components-multi-select.mjs.map +0 -1
  163. package/fesm2022/taiga-ui-legacy-components-primitive-textfield.mjs +0 -454
  164. package/fesm2022/taiga-ui-legacy-components-primitive-textfield.mjs.map +0 -1
  165. package/fesm2022/taiga-ui-legacy-components-select-option.mjs +0 -88
  166. package/fesm2022/taiga-ui-legacy-components-select-option.mjs.map +0 -1
  167. package/fesm2022/taiga-ui-legacy-components-select.mjs +0 -353
  168. package/fesm2022/taiga-ui-legacy-components-select.mjs.map +0 -1
  169. package/fesm2022/taiga-ui-legacy-components-tag.mjs +0 -225
  170. package/fesm2022/taiga-ui-legacy-components-tag.mjs.map +0 -1
  171. package/fesm2022/taiga-ui-legacy-components-textarea.mjs +0 -262
  172. package/fesm2022/taiga-ui-legacy-components-textarea.mjs.map +0 -1
  173. package/fesm2022/taiga-ui-legacy-components-tooltip.mjs +0 -53
  174. package/fesm2022/taiga-ui-legacy-components-tooltip.mjs.map +0 -1
  175. package/fesm2022/taiga-ui-legacy-directives-legacy-dropdown-open-monitor.mjs +0 -49
  176. package/fesm2022/taiga-ui-legacy-directives-legacy-dropdown-open-monitor.mjs.map +0 -1
  177. package/fesm2022/taiga-ui-legacy-directives-textfield-controller.mjs +0 -401
  178. package/fesm2022/taiga-ui-legacy-directives-textfield-controller.mjs.map +0 -1
  179. package/fesm2022/taiga-ui-legacy-directives-unfinished-validator.mjs +0 -48
  180. package/fesm2022/taiga-ui-legacy-directives-unfinished-validator.mjs.map +0 -1
  181. package/fesm2022/taiga-ui-legacy-directives-value-accessor.mjs +0 -44
  182. package/fesm2022/taiga-ui-legacy-directives-value-accessor.mjs.map +0 -1
  183. package/fesm2022/taiga-ui-legacy-directives-wrapper.mjs +0 -99
  184. package/fesm2022/taiga-ui-legacy-directives-wrapper.mjs.map +0 -1
  185. package/fesm2022/taiga-ui-legacy-directives.mjs +0 -10
  186. package/fesm2022/taiga-ui-legacy-directives.mjs.map +0 -1
  187. package/fesm2022/taiga-ui-legacy-tokens.mjs +0 -384
  188. package/fesm2022/taiga-ui-legacy-tokens.mjs.map +0 -1
  189. package/fesm2022/taiga-ui-legacy-utils.mjs +0 -262
  190. package/fesm2022/taiga-ui-legacy-utils.mjs.map +0 -1
  191. package/styles/mixins/mixins.less +0 -239
  192. package/styles/mixins/mixins.scss +0 -224
  193. package/styles/mixins/textfield.less +0 -324
  194. package/styles/mixins/textfield.scss +0 -308
  195. package/styles/taiga-ui-local.less +0 -3
  196. package/styles/taiga-ui-local.scss +0 -3
  197. package/tokens/countries-masks.d.ts +0 -9
  198. package/tokens/focusable-item-accessor.d.ts +0 -25
  199. package/tokens/fonts-ready.d.ts +0 -6
  200. package/tokens/icons.d.ts +0 -6
  201. package/tokens/index.d.ts +0 -14
  202. package/tokens/is-apple.d.ts +0 -6
  203. package/tokens/is-chromium.d.ts +0 -6
  204. package/tokens/is-firefox.d.ts +0 -6
  205. package/tokens/is-stackblitz.d.ts +0 -5
  206. package/tokens/month-formatter.d.ts +0 -10
  207. package/tokens/sanitizer.d.ts +0 -6
  208. package/tokens/textfield-appearance.d.ts +0 -7
  209. package/tokens/textfield-host.d.ts +0 -23
  210. package/tokens/touch-supported.d.ts +0 -5
  211. package/tokens/value-accessor.d.ts +0 -7
  212. package/utils/capitalize-first-letter.d.ts +0 -4
  213. package/utils/date-mode-maskito-adapter.d.ts +0 -6
  214. package/utils/format-phone.d.ts +0 -30
  215. package/utils/get-border.d.ts +0 -5
  216. package/utils/get-max-allowed-phone-length.d.ts +0 -24
  217. package/utils/get-safe-area-size.d.ts +0 -7
  218. package/utils/icons-path-factory.d.ts +0 -13
  219. package/utils/index.d.ts +0 -13
  220. package/utils/is-presumed-html-string.d.ts +0 -4
  221. package/utils/iso-to-country-code.d.ts +0 -13
  222. package/utils/not-kz-region.d.ts +0 -20
  223. package/utils/process-icon.d.ts +0 -4
  224. package/utils/specific-dropdown-controllers.d.ts +0 -4
  225. package/utils/status.d.ts +0 -4
@@ -1,686 +0,0 @@
1
- import { __decorate } from 'tslib';
2
- import * as i0 from '@angular/core';
3
- import { InjectionToken, Directive, inject, EventEmitter, TemplateRef, Output, Input, ContentChild, ViewChild, ChangeDetectionStrategy, Component, Pipe, ContentChildren, NgModule } from '@angular/core';
4
- import { tuiProvideOptions, tuiIsString, tuiArrayToggle, tuiPure, tuiIsPresent, tuiGetOriginalArrayFromQueryList, tuiProvide } from '@taiga-ui/cdk/utils/miscellaneous';
5
- import { tuiIsFlat } from '@taiga-ui/kit/utils';
6
- import { TUI_TRUE_HANDLER, EMPTY_ARRAY, EMPTY_QUERY, TUI_DEFAULT_IDENTITY_MATCHER, EMPTY_FUNCTION } from '@taiga-ui/cdk/constants';
7
- import { TUI_IS_MOBILE } from '@taiga-ui/cdk/tokens';
8
- import { tuiGetClipboardDataText } from '@taiga-ui/cdk/utils/dom';
9
- import { tuiIsFocused } from '@taiga-ui/cdk/utils/focus';
10
- import * as i1$2 from '@taiga-ui/core/components/data-list';
11
- import { TUI_DATA_LIST_ACCESSOR, TuiDataListDirective, tuiAsDataListHost, TUI_DATA_LIST_HOST, TuiOption, tuiAsOptionContent, tuiAsDataList, TuiDataList } from '@taiga-ui/core/components/data-list';
12
- import * as i3 from '@taiga-ui/core/directives/dropdown';
13
- import { TuiDropdownOpen, TuiDropdownFixed, TuiDropdown } from '@taiga-ui/core/directives/dropdown';
14
- import { TUI_ITEMS_HANDLERS, TUI_MULTI_SELECT_TEXTS } from '@taiga-ui/kit/tokens';
15
- import { AbstractTuiNativeSelect, AbstractTuiMultipleControl, TuiStringifiableItem, tuiAsControl, AbstractTuiTextfieldHost, AbstractTuiControl } from '@taiga-ui/legacy/classes';
16
- import { TUI_ARROW_MODE, TuiArrowComponent } from '@taiga-ui/legacy/components/arrow';
17
- import * as i5 from '@taiga-ui/legacy/components/input-tag';
18
- import { TUI_INPUT_TAG_OPTIONS, TuiInputTagComponent, TuiInputTagModule } from '@taiga-ui/legacy/components/input-tag';
19
- import * as i6 from '@taiga-ui/legacy/directives';
20
- import { TUI_TEXTFIELD_WATCHED_CONTROLLER, TEXTFIELD_CONTROLLER_PROVIDER, TuiLegacyDropdownOpenMonitorDirective, TuiTextfieldControllerModule, TuiWrapperModule } from '@taiga-ui/legacy/directives';
21
- import { tuiAsFocusableItemAccessor, tuiAsTextfieldHost } from '@taiga-ui/legacy/tokens';
22
- import * as i2 from '@angular/common';
23
- import { CommonModule } from '@angular/common';
24
- import * as i1 from '@angular/forms';
25
- import { NgControl, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
26
- import * as i4 from '@taiga-ui/polymorpheus';
27
- import { PolymorpheusComponent, PolymorpheusOutlet, PolymorpheusTemplate } from '@taiga-ui/polymorpheus';
28
- import * as i6$1 from '@taiga-ui/cdk/pipes/mapper';
29
- import { TuiMapperPipe } from '@taiga-ui/cdk/pipes/mapper';
30
- import * as i1$1 from '@taiga-ui/core/components/link';
31
- import { TuiLink } from '@taiga-ui/core/components/link';
32
- import * as i2$1 from '@taiga-ui/kit/components/data-list-wrapper';
33
- import { TuiDataListWrapper } from '@taiga-ui/kit/components/data-list-wrapper';
34
- import * as i7 from '@taiga-ui/kit/pipes/stringify-content';
35
- import { TuiStringifyContentPipe } from '@taiga-ui/kit/pipes/stringify-content';
36
- import { TuiMultiSelectOptionComponent, TuiMultiSelectOptionModule } from '@taiga-ui/legacy/components/multi-select-option';
37
- import { tuiQueryListChanges, tuiControlValue } from '@taiga-ui/cdk/observables';
38
- import { map, combineLatest } from 'rxjs';
39
-
40
- const TUI_MULTI_SELECT_DEFAULT_OPTIONS = {
41
- rows: Infinity,
42
- valueContent: '',
43
- };
44
- /**
45
- * @deprecated: drop in v5.0
46
- * Default parameters for MultiSelect component
47
- */
48
- const TUI_MULTI_SELECT_OPTIONS = new InjectionToken(ngDevMode ? 'TUI_MULTI_SELECT_OPTIONS' : '', {
49
- factory: () => TUI_MULTI_SELECT_DEFAULT_OPTIONS,
50
- });
51
- function tuiMultiSelectOptionsProvider(options) {
52
- return tuiProvideOptions(TUI_MULTI_SELECT_OPTIONS, options, TUI_MULTI_SELECT_DEFAULT_OPTIONS);
53
- }
54
-
55
- class AbstractTuiNativeMultiSelect extends AbstractTuiNativeSelect {
56
- constructor() {
57
- super(...arguments);
58
- this.selectedMapper = (option, value) => value.includes(option);
59
- }
60
- get stringify() {
61
- return this.host.stringify;
62
- }
63
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AbstractTuiNativeMultiSelect, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
64
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: AbstractTuiNativeMultiSelect, isStandalone: true, usesInheritance: true, ngImport: i0 }); }
65
- }
66
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AbstractTuiNativeMultiSelect, decorators: [{
67
- type: Directive
68
- }] });
69
-
70
- class TuiMultiSelectComponent extends AbstractTuiMultipleControl {
71
- constructor() {
72
- super(...arguments);
73
- this.arrowMode = inject(TUI_ARROW_MODE);
74
- this.itemsHandlers = inject(TUI_ITEMS_HANDLERS);
75
- this.options = inject(TUI_MULTI_SELECT_OPTIONS);
76
- this.inputTagOptions = inject(TUI_INPUT_TAG_OPTIONS);
77
- this.open = false;
78
- this.controller = inject(TUI_TEXTFIELD_WATCHED_CONTROLLER);
79
- this.isMobile = inject(TUI_IS_MOBILE);
80
- this.stringify = this.itemsHandlers.stringify;
81
- this.identityMatcher = this.itemsHandlers.identityMatcher;
82
- this.search = '';
83
- this.placeholder = '';
84
- this.editable = true;
85
- this.disabledItemHandler = this.itemsHandlers.disabledItemHandler;
86
- this.valueContent = this.options.valueContent;
87
- this.tagValidator = TUI_TRUE_HANDLER;
88
- this.rows = this.options.rows;
89
- this.autoColor = false;
90
- this.searchChange = new EventEmitter();
91
- this.valueMapper = (value, stringify, group) => group
92
- ? EMPTY_ARRAY
93
- : value.map((item) => new TuiStringifiableItem(item, stringify));
94
- this.disabledItemHandlerWrapper = (handler) => (stringifiable) => tuiIsString(stringifiable) || handler(stringifiable.item);
95
- }
96
- get size() {
97
- return this.controller.size;
98
- }
99
- get nativeFocusableElement() {
100
- return this.input?.nativeFocusableElement ?? null;
101
- }
102
- get focused() {
103
- return !!this.input?.focused || !!this.dropdown?.tuiDropdownOpen;
104
- }
105
- onValueChange(value) {
106
- this.value = value;
107
- }
108
- onSearch(search) {
109
- // Clearing sets the empty value, the dropdown should not be opened on clear.
110
- if (search !== '') {
111
- this.open = true;
112
- }
113
- this.updateSearch(search);
114
- }
115
- setDisabledState() {
116
- super.setDisabledState();
117
- this.open = false;
118
- }
119
- handleOption(option) {
120
- const { value, identityMatcher } = this;
121
- const index = value.findIndex((item) => identityMatcher(item, option));
122
- this.value =
123
- index === -1 ? [...value, option] : value.filter((_, i) => i !== index);
124
- this.updateSearch(null);
125
- }
126
- get arrow() {
127
- return this.interactive ? this.arrowMode.interactive : this.arrowMode.disabled;
128
- }
129
- get nativeDropdownMode() {
130
- return !!this.nativeSelect && this.isMobile && !this.editable;
131
- }
132
- get computedValue() {
133
- return this.computedGroup ? EMPTY_ARRAY : this.value;
134
- }
135
- // @bad TODO: think of a better way
136
- get searchOrSpace() {
137
- return this.computedGroup ? ' ' : this.searchString;
138
- }
139
- get searchString() {
140
- return this.search === null ? '' : this.search;
141
- }
142
- get computedGroup() {
143
- return (!!this.valueContent &&
144
- this.value.length > 0 &&
145
- (!this.focused || !this.editable));
146
- }
147
- getStringifier(stringify) {
148
- return ({ $implicit }) => stringify($implicit);
149
- }
150
- onSpace(event) {
151
- if (!this.editable) {
152
- event.preventDefault();
153
- }
154
- if (!this.readOnly) {
155
- this.open = true;
156
- }
157
- }
158
- onEnter(event) {
159
- const { value } = this;
160
- const options = this.accessor ? this.accessor.getOptions() : [];
161
- if (options.length !== 1) {
162
- return;
163
- }
164
- event.preventDefault();
165
- this.value = options[0] ? tuiArrayToggle(value, options[0]) : value;
166
- this.updateSearch(null);
167
- }
168
- onKeyDown(event) {
169
- if (event.key === this.inputTagOptions.separator) {
170
- this.onEnter(event);
171
- }
172
- }
173
- onPaste(event) {
174
- const pasted = tuiGetClipboardDataText(event);
175
- const tags = pasted
176
- .split(this.inputTagOptions.separator)
177
- .map((tag) => tag.trim());
178
- const options = this.accessor?.getOptions() ?? [];
179
- const separator = tuiIsString(this.inputTagOptions.separator)
180
- ? this.inputTagOptions.separator
181
- : ',';
182
- const matches = options?.filter((option) => tags.includes(this.stringify(option))) ?? [];
183
- const matchingStrings = matches.map((v) => String(v));
184
- const invalid = tags.filter((value) => !matchingStrings.includes(value));
185
- this.value = this.filterValue([...this.value, ...matches]);
186
- this.updateSearch(invalid.length ? invalid.join(separator) : null);
187
- }
188
- onClick({ nativeFocusableElement }) {
189
- if (this.interactive &&
190
- nativeFocusableElement &&
191
- tuiIsFocused(nativeFocusableElement)) {
192
- this.open = !this.open;
193
- }
194
- }
195
- onInput(value) {
196
- this.value = value.map(({ item }) => item);
197
- }
198
- onActiveZone(active) {
199
- this.updateFocused(active);
200
- }
201
- filterValue(value) {
202
- const seen = new Set();
203
- return value
204
- .reverse()
205
- .filter((item) => item && !seen.has(item) && seen.add(item))
206
- .reverse();
207
- }
208
- updateSearch(search) {
209
- if (this.search === search) {
210
- return;
211
- }
212
- this.search = search;
213
- this.searchChange.emit(search);
214
- }
215
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiMultiSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
216
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiMultiSelectComponent, isStandalone: false, selector: "tui-multi-select", inputs: { stringify: "stringify", identityMatcher: "identityMatcher", search: "search", placeholder: "placeholder", editable: "editable", disabledItemHandler: "disabledItemHandler", valueContent: "valueContent", tagValidator: "tagValidator", rows: "rows", autoColor: "autoColor" }, outputs: { searchChange: "searchChange" }, host: { properties: { "attr.data-size": "size", "class._editable": "editable", "class._expandable": "rows > 1" } }, providers: [
217
- tuiAsFocusableItemAccessor(TuiMultiSelectComponent),
218
- tuiAsControl(TuiMultiSelectComponent),
219
- tuiAsDataListHost(TuiMultiSelectComponent),
220
- TEXTFIELD_CONTROLLER_PROVIDER,
221
- ], queries: [{ propertyName: "accessor", first: true, predicate: TUI_DATA_LIST_ACCESSOR, descendants: true }, { propertyName: "nativeSelect", first: true, predicate: AbstractTuiNativeMultiSelect, descendants: true, static: true }, { propertyName: "datalist", first: true, predicate: TuiDataListDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "dropdown", first: true, predicate: TuiDropdownOpen, descendants: true }, { propertyName: "input", first: true, predicate: TuiInputTagComponent, descendants: true }], usesInheritance: true, hostDirectives: [{ directive: i3.TuiDropdownFixed }], ngImport: i0, template: "<div\n tuiDropdownOpenMonitor\n class=\"t-hosted\"\n [tuiDropdown]=\"datalist || ''\"\n [tuiDropdownEnabled]=\"interactive && !nativeDropdownMode\"\n [(tuiDropdownOpen)]=\"open\"\n (tuiActiveZoneChange)=\"onActiveZone($event)\"\n>\n <tui-input-tag\n #inputTag\n automation-id=\"tui-multi-select__input\"\n class=\"t-input\"\n [autoColor]=\"autoColor\"\n [disabled]=\"disabled\"\n [disabledItemHandler]=\"disabledItemHandler | tuiMapper: disabledItemHandlerWrapper\"\n [editable]=\"false\"\n [inputHidden]=\"!editable\"\n [nativeId]=\"nativeId\"\n [ngModel]=\"computedValue | tuiMapper: valueMapper : stringify\"\n [ngModelOptions]=\"{standalone: true}\"\n [placeholder]=\"placeholder\"\n [pseudoFocus]=\"computedFocused\"\n [pseudoHover]=\"pseudoHover\"\n [pseudoInvalid]=\"computedInvalid\"\n [pseudoOpen]=\"open\"\n [readOnly]=\"readOnly\"\n [removable]=\"!nativeDropdownMode\"\n [rows]=\"rows\"\n [search]=\"searchOrSpace\"\n [tagValidator]=\"tagValidator | tuiMapper: disabledItemHandlerWrapper\"\n [tuiTextfieldIcon]=\"arrow ? icon : ''\"\n (click.prevent)=\"onClick(inputTag)\"\n (keydown.enter)=\"onEnter($event)\"\n (keydown.space)=\"onSpace($event)\"\n (keydown)=\"onKeyDown($event)\"\n (ngModelChange)=\"onInput($event)\"\n (paste.capture.stop.prevent)=\"onPaste($event)\"\n (searchChange)=\"onSearch($event)\"\n >\n <ng-content />\n <ng-template #select>\n @if (isMobile) {\n <ng-content select=\"select\" />\n }\n </ng-template>\n\n <ng-container\n *ngTemplateOutlet=\"select\"\n ngProjectAs=\"select\"\n />\n\n @if (computedGroup) {\n <div\n ngProjectAs=\"tuiContent\"\n class=\"t-content\"\n [class.t-content_fullsize]=\"inputTag.labelOutside\"\n >\n <span\n *polymorpheusOutlet=\"valueContent as text; context: {$implicit: value}\"\n class=\"t-primitive\"\n >\n {{ text }}\n </span>\n </div>\n }\n </tui-input-tag>\n\n <ng-template #icon>\n <div\n appearance=\"icon\"\n automation-id=\"tui-multi-select__arrow\"\n tuiWrapper\n class=\"t-arrow\"\n [class.t-arrow_native-dropdown]=\"nativeDropdownMode\"\n (mousedown.prevent.zoneless)=\"(0)\"\n >\n <ng-container *polymorpheusOutlet=\"arrow as text\">\n {{ text }}\n </ng-container>\n </div>\n </ng-template>\n</div>\n", styles: [":host{position:relative;display:block;border-radius:var(--tui-radius-m)}:host._disabled,:host :host-context(*:disabled){pointer-events:none}.t-hosted{display:block;border-radius:inherit}.t-input{border-radius:inherit}:host:not(._editable):not(._readonly) .t-input{cursor:pointer}.t-content{display:flex;align-items:center;pointer-events:none;box-sizing:border-box;margin:.0625rem 0}.t-primitive{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.t-arrow{pointer-events:auto;cursor:pointer}.t-arrow_native-dropdown{pointer-events:none}\n"], dependencies: [{ kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "component", type: i5.TuiInputTagComponent, selector: "tui-input-tag", inputs: ["separator", "search", "editable", "tagValidator", "rows", "inputHidden", "uniqueTags", "autoColor", "maxLength", "placeholder", "removable", "disabledItemHandler", "pseudoFocused", "pseudoOpen"], outputs: ["searchChange"] }, { kind: "directive", type: i3.TuiDropdownDirective, selector: "[tuiDropdown]:not(ng-container):not(ng-template)", inputs: ["tuiDropdown"], exportAs: ["tuiDropdown"] }, { kind: "directive", type: i3.TuiDropdownOpen, selector: "[tuiDropdown][tuiDropdownOpen],[tuiDropdown][tuiDropdownOpenChange]", inputs: ["tuiDropdownEnabled", "tuiDropdownOpen"], outputs: ["tuiDropdownOpenChange"] }, { kind: "directive", type: i6.TuiLegacyDropdownOpenMonitorDirective, selector: "[tuiDropdownOpenMonitor]" }, { kind: "directive", type: i6.TuiTextfieldIconDirective, selector: "[tuiTextfieldIcon]", inputs: ["tuiTextfieldIcon"] }, { kind: "directive", type: i6.TuiWrapperDirective, selector: "[tuiWrapper]", inputs: ["disabled", "readOnly", "hover", "active", "focus", "invalid", "appearance"] }, { kind: "pipe", type: i6$1.TuiMapperPipe, name: "tuiMapper" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
222
- }
223
- __decorate([
224
- tuiPure
225
- ], TuiMultiSelectComponent.prototype, "getStringifier", null);
226
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiMultiSelectComponent, decorators: [{
227
- type: Component,
228
- args: [{ standalone: false, selector: 'tui-multi-select', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
229
- tuiAsFocusableItemAccessor(TuiMultiSelectComponent),
230
- tuiAsControl(TuiMultiSelectComponent),
231
- tuiAsDataListHost(TuiMultiSelectComponent),
232
- TEXTFIELD_CONTROLLER_PROVIDER,
233
- ], hostDirectives: [TuiDropdownFixed], host: {
234
- '[attr.data-size]': 'size',
235
- '[class._editable]': 'editable',
236
- '[class._expandable]': 'rows > 1',
237
- }, template: "<div\n tuiDropdownOpenMonitor\n class=\"t-hosted\"\n [tuiDropdown]=\"datalist || ''\"\n [tuiDropdownEnabled]=\"interactive && !nativeDropdownMode\"\n [(tuiDropdownOpen)]=\"open\"\n (tuiActiveZoneChange)=\"onActiveZone($event)\"\n>\n <tui-input-tag\n #inputTag\n automation-id=\"tui-multi-select__input\"\n class=\"t-input\"\n [autoColor]=\"autoColor\"\n [disabled]=\"disabled\"\n [disabledItemHandler]=\"disabledItemHandler | tuiMapper: disabledItemHandlerWrapper\"\n [editable]=\"false\"\n [inputHidden]=\"!editable\"\n [nativeId]=\"nativeId\"\n [ngModel]=\"computedValue | tuiMapper: valueMapper : stringify\"\n [ngModelOptions]=\"{standalone: true}\"\n [placeholder]=\"placeholder\"\n [pseudoFocus]=\"computedFocused\"\n [pseudoHover]=\"pseudoHover\"\n [pseudoInvalid]=\"computedInvalid\"\n [pseudoOpen]=\"open\"\n [readOnly]=\"readOnly\"\n [removable]=\"!nativeDropdownMode\"\n [rows]=\"rows\"\n [search]=\"searchOrSpace\"\n [tagValidator]=\"tagValidator | tuiMapper: disabledItemHandlerWrapper\"\n [tuiTextfieldIcon]=\"arrow ? icon : ''\"\n (click.prevent)=\"onClick(inputTag)\"\n (keydown.enter)=\"onEnter($event)\"\n (keydown.space)=\"onSpace($event)\"\n (keydown)=\"onKeyDown($event)\"\n (ngModelChange)=\"onInput($event)\"\n (paste.capture.stop.prevent)=\"onPaste($event)\"\n (searchChange)=\"onSearch($event)\"\n >\n <ng-content />\n <ng-template #select>\n @if (isMobile) {\n <ng-content select=\"select\" />\n }\n </ng-template>\n\n <ng-container\n *ngTemplateOutlet=\"select\"\n ngProjectAs=\"select\"\n />\n\n @if (computedGroup) {\n <div\n ngProjectAs=\"tuiContent\"\n class=\"t-content\"\n [class.t-content_fullsize]=\"inputTag.labelOutside\"\n >\n <span\n *polymorpheusOutlet=\"valueContent as text; context: {$implicit: value}\"\n class=\"t-primitive\"\n >\n {{ text }}\n </span>\n </div>\n }\n </tui-input-tag>\n\n <ng-template #icon>\n <div\n appearance=\"icon\"\n automation-id=\"tui-multi-select__arrow\"\n tuiWrapper\n class=\"t-arrow\"\n [class.t-arrow_native-dropdown]=\"nativeDropdownMode\"\n (mousedown.prevent.zoneless)=\"(0)\"\n >\n <ng-container *polymorpheusOutlet=\"arrow as text\">\n {{ text }}\n </ng-container>\n </div>\n </ng-template>\n</div>\n", styles: [":host{position:relative;display:block;border-radius:var(--tui-radius-m)}:host._disabled,:host :host-context(*:disabled){pointer-events:none}.t-hosted{display:block;border-radius:inherit}.t-input{border-radius:inherit}:host:not(._editable):not(._readonly) .t-input{cursor:pointer}.t-content{display:flex;align-items:center;pointer-events:none;box-sizing:border-box;margin:.0625rem 0}.t-primitive{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.t-arrow{pointer-events:auto;cursor:pointer}.t-arrow_native-dropdown{pointer-events:none}\n"] }]
238
- }], propDecorators: { accessor: [{
239
- type: ContentChild,
240
- args: [TUI_DATA_LIST_ACCESSOR]
241
- }], nativeSelect: [{
242
- type: ContentChild,
243
- args: [AbstractTuiNativeMultiSelect, { static: true }]
244
- }], dropdown: [{
245
- type: ViewChild,
246
- args: [TuiDropdownOpen]
247
- }], input: [{
248
- type: ViewChild,
249
- args: [TuiInputTagComponent]
250
- }], datalist: [{
251
- type: ContentChild,
252
- args: [TuiDataListDirective, { read: TemplateRef }]
253
- }], stringify: [{
254
- type: Input
255
- }], identityMatcher: [{
256
- type: Input
257
- }], search: [{
258
- type: Input
259
- }], placeholder: [{
260
- type: Input
261
- }], editable: [{
262
- type: Input
263
- }], disabledItemHandler: [{
264
- type: Input
265
- }], valueContent: [{
266
- type: Input
267
- }], tagValidator: [{
268
- type: Input
269
- }], rows: [{
270
- type: Input
271
- }], autoColor: [{
272
- type: Input
273
- }], searchChange: [{
274
- type: Output
275
- }], getStringifier: [] } });
276
-
277
- class TuiHideSelectedPipe {
278
- constructor() {
279
- this.component = inject(TuiMultiSelectComponent);
280
- }
281
- transform(items) {
282
- const { value, identityMatcher } = this.component;
283
- if (!items) {
284
- return null;
285
- }
286
- return tuiIsFlat(items)
287
- ? this.filter(items, value, identityMatcher)
288
- : this.filter2d(items, value, identityMatcher);
289
- }
290
- filter2d(items, value, matcher) {
291
- return items.map((subItems) => this.filter(subItems, value, matcher));
292
- }
293
- filter(items, value, matcher) {
294
- return items.filter((item) => value.every((selected) => !matcher(selected, item)));
295
- }
296
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHideSelectedPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
297
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: TuiHideSelectedPipe, isStandalone: false, name: "tuiHideSelected", pure: false }); }
298
- }
299
- __decorate([
300
- tuiPure
301
- ], TuiHideSelectedPipe.prototype, "filter2d", null);
302
- __decorate([
303
- tuiPure
304
- ], TuiHideSelectedPipe.prototype, "filter", null);
305
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHideSelectedPipe, decorators: [{
306
- type: Pipe,
307
- args: [{
308
- standalone: false,
309
- name: 'tuiHideSelected',
310
- pure: false,
311
- }]
312
- }], propDecorators: { filter2d: [], filter: [] } });
313
-
314
- class TuiMultiSelectDirective extends AbstractTuiTextfieldHost {
315
- constructor() {
316
- super(...arguments);
317
- this.disableItemHandler = (item) => this.host.disabledItemHandler(item);
318
- }
319
- get readOnly() {
320
- return true;
321
- }
322
- get stringify() {
323
- return this.host.stringify;
324
- }
325
- onValueChange() { }
326
- onSelectionChange(value) {
327
- this.host.onValueChange(value);
328
- }
329
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiMultiSelectDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
330
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiMultiSelectDirective, isStandalone: false, selector: "tui-multi-select", providers: [tuiAsTextfieldHost(TuiMultiSelectDirective)], usesInheritance: true, ngImport: i0 }); }
331
- }
332
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiMultiSelectDirective, decorators: [{
333
- type: Directive,
334
- args: [{
335
- standalone: false,
336
- selector: 'tui-multi-select',
337
- providers: [tuiAsTextfieldHost(TuiMultiSelectDirective)],
338
- }]
339
- }] });
340
-
341
- class TuiMultiSelectGroupComponent {
342
- constructor() {
343
- this.options = EMPTY_QUERY;
344
- this.host = inject(TUI_DATA_LIST_HOST);
345
- this.control = inject(NgControl);
346
- this.multiSelectTexts = inject(TUI_MULTI_SELECT_TEXTS);
347
- this.label = '';
348
- }
349
- get empty$() {
350
- return tuiQueryListChanges(this.options).pipe(map(({ length }) => !length));
351
- }
352
- get disabled$() {
353
- return tuiQueryListChanges(this.options).pipe(map((items) => items.every(({ disabled }) => disabled)));
354
- }
355
- get value$() {
356
- return combineLatest([this.items$, this.valueChanges$]).pipe(map(([items, current]) => {
357
- let result = false;
358
- for (let i = 0; i < items.length; i++) {
359
- const selected = current.some((selected) => this.matcher(selected, items[i]));
360
- if ((!selected && result) || (selected && !result && i)) {
361
- return null;
362
- }
363
- result = selected;
364
- }
365
- return result;
366
- }));
367
- }
368
- onClick(checked) {
369
- if (!this.control.control) {
370
- return;
371
- }
372
- const controlValue = this.control.value || [];
373
- const { values } = this;
374
- const filtered = controlValue.filter((current) => values.every((item) => !this.matcher(current, item)));
375
- this.control.control.setValue(checked ? filtered : [...filtered, ...values]);
376
- }
377
- get items$() {
378
- return tuiQueryListChanges(this.options).pipe(map((options) => options.map(({ value }) => value).filter(tuiIsPresent)));
379
- }
380
- get valueChanges$() {
381
- return tuiControlValue(this.control).pipe(map((value) => value || []));
382
- }
383
- get values() {
384
- return this.filter(tuiGetOriginalArrayFromQueryList(this.options));
385
- }
386
- get matcher() {
387
- return this.host.identityMatcher || TUI_DEFAULT_IDENTITY_MATCHER;
388
- }
389
- filter(items) {
390
- return items.map(({ value }) => value).filter(tuiIsPresent);
391
- }
392
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiMultiSelectGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
393
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiMultiSelectGroupComponent, isStandalone: false, selector: "tui-opt-group[tuiMultiSelectGroup]", inputs: { label: "label" }, host: { properties: { "class._label": "label" } }, queries: [{ propertyName: "options", predicate: TuiOption }], ngImport: i0, template: "@let value = value$ | async;\n<span class=\"t-wrapper\">\n <span class=\"t-label\">{{ label }}</span>\n @if (label && !(empty$ | async)) {\n <button\n tuiLink\n type=\"button\"\n class=\"t-button\"\n [disabled]=\"!!(disabled$ | async)\"\n (click)=\"onClick(value)\"\n >\n {{ multiSelectTexts()[value ? 'none' : 'all'] }}\n </button>\n }\n</span>\n<ng-content />\n", styles: [":host._label:before{display:none}:host:not(:first-of-type) .t-label:not(:empty){padding-block-start:1.25rem}:host:not(:first-of-type) .t-button{margin-block-start:1.25rem}.t-wrapper{display:flex;align-items:flex-start}.t-label:not(:empty){flex:1;padding:.75rem 1rem .25rem .625rem}.t-button{margin:.75rem 1rem 0 auto;font-weight:400}\n"], dependencies: [{ kind: "directive", type: i1$1.TuiLink, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
394
- }
395
- __decorate([
396
- tuiPure
397
- ], TuiMultiSelectGroupComponent.prototype, "empty$", null);
398
- __decorate([
399
- tuiPure
400
- ], TuiMultiSelectGroupComponent.prototype, "disabled$", null);
401
- __decorate([
402
- tuiPure
403
- ], TuiMultiSelectGroupComponent.prototype, "value$", null);
404
- __decorate([
405
- tuiPure
406
- ], TuiMultiSelectGroupComponent.prototype, "items$", null);
407
- __decorate([
408
- tuiPure
409
- ], TuiMultiSelectGroupComponent.prototype, "valueChanges$", null);
410
- __decorate([
411
- tuiPure
412
- ], TuiMultiSelectGroupComponent.prototype, "filter", null);
413
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiMultiSelectGroupComponent, decorators: [{
414
- type: Component,
415
- args: [{ standalone: false, selector: 'tui-opt-group[tuiMultiSelectGroup]', changeDetection: ChangeDetectionStrategy.OnPush, host: {
416
- '[class._label]': 'label',
417
- }, template: "@let value = value$ | async;\n<span class=\"t-wrapper\">\n <span class=\"t-label\">{{ label }}</span>\n @if (label && !(empty$ | async)) {\n <button\n tuiLink\n type=\"button\"\n class=\"t-button\"\n [disabled]=\"!!(disabled$ | async)\"\n (click)=\"onClick(value)\"\n >\n {{ multiSelectTexts()[value ? 'none' : 'all'] }}\n </button>\n }\n</span>\n<ng-content />\n", styles: [":host._label:before{display:none}:host:not(:first-of-type) .t-label:not(:empty){padding-block-start:1.25rem}:host:not(:first-of-type) .t-button{margin-block-start:1.25rem}.t-wrapper{display:flex;align-items:flex-start}.t-label:not(:empty){flex:1;padding:.75rem 1rem .25rem .625rem}.t-button{margin:.75rem 1rem 0 auto;font-weight:400}\n"] }]
418
- }], propDecorators: { options: [{
419
- type: ContentChildren,
420
- args: [TuiOption]
421
- }], label: [{
422
- type: Input
423
- }], empty$: [], disabled$: [], value$: [], items$: [], valueChanges$: [], filter: [] } });
424
-
425
- const TUI_MULTI_SELECT_OPTION = new PolymorpheusComponent(TuiMultiSelectOptionComponent);
426
- class TuiMultiSelectGroupDirective {
427
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiMultiSelectGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
428
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiMultiSelectGroupDirective, isStandalone: false, selector: "[tuiMultiSelectGroup]", providers: [
429
- tuiAsOptionContent(TUI_MULTI_SELECT_OPTION),
430
- {
431
- provide: TUI_DATA_LIST_HOST,
432
- useFactory: () => {
433
- const multiSelect = inject(TuiMultiSelectComponent, { optional: true });
434
- const ngControl = inject(NgControl);
435
- const host = inject(AbstractTuiControl, { optional: true });
436
- const { identityMatcher, stringify } = inject(TUI_ITEMS_HANDLERS, { optional: true }) ?? {};
437
- return (multiSelect || {
438
- stringify,
439
- identityMatcher,
440
- handleOption: (option) => {
441
- const value = host?.value ?? ngControl.control?.value ?? [];
442
- const result = tuiArrayToggle(value, option, identityMatcher);
443
- if (host) {
444
- host.value = result;
445
- }
446
- else {
447
- ngControl.control?.setValue(result);
448
- }
449
- },
450
- });
451
- },
452
- },
453
- {
454
- provide: NG_VALUE_ACCESSOR,
455
- multi: true,
456
- useValue: {
457
- writeValue: EMPTY_FUNCTION,
458
- registerOnChange: EMPTY_FUNCTION,
459
- registerOnTouched: EMPTY_FUNCTION,
460
- },
461
- },
462
- ], ngImport: i0 }); }
463
- }
464
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiMultiSelectGroupDirective, decorators: [{
465
- type: Directive,
466
- args: [{
467
- standalone: false,
468
- selector: '[tuiMultiSelectGroup]',
469
- providers: [
470
- tuiAsOptionContent(TUI_MULTI_SELECT_OPTION),
471
- {
472
- provide: TUI_DATA_LIST_HOST,
473
- useFactory: () => {
474
- const multiSelect = inject(TuiMultiSelectComponent, { optional: true });
475
- const ngControl = inject(NgControl);
476
- const host = inject(AbstractTuiControl, { optional: true });
477
- const { identityMatcher, stringify } = inject(TUI_ITEMS_HANDLERS, { optional: true }) ?? {};
478
- return (multiSelect || {
479
- stringify,
480
- identityMatcher,
481
- handleOption: (option) => {
482
- const value = host?.value ?? ngControl.control?.value ?? [];
483
- const result = tuiArrayToggle(value, option, identityMatcher);
484
- if (host) {
485
- host.value = result;
486
- }
487
- else {
488
- ngControl.control?.setValue(result);
489
- }
490
- },
491
- });
492
- },
493
- },
494
- {
495
- provide: NG_VALUE_ACCESSOR,
496
- multi: true,
497
- useValue: {
498
- writeValue: EMPTY_FUNCTION,
499
- registerOnChange: EMPTY_FUNCTION,
500
- registerOnTouched: EMPTY_FUNCTION,
501
- },
502
- },
503
- ],
504
- }]
505
- }] });
506
-
507
- class TuiNativeMultiSelectComponent extends AbstractTuiNativeMultiSelect {
508
- constructor() {
509
- super(...arguments);
510
- this.items = [];
511
- }
512
- onValueChange(selectedOptions) {
513
- const selected = Array.from(selectedOptions).map((option) => option.index);
514
- const value = this.items?.filter((_, index) => selected.includes(index)) || [];
515
- this.host.onSelectionChange(value);
516
- }
517
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiNativeMultiSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
518
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiNativeMultiSelectComponent, isStandalone: false, selector: "select[multiple][tuiSelect]:not([labels])", inputs: { items: "items" }, host: { listeners: { "change": "onValueChange($event.target.selectedOptions)", "click.stop.zoneless": "0", "mousedown.stop.zoneless": "0" }, properties: { "attr.aria-invalid": "host.invalid", "disabled": "host.disabled || control.readOnly", "tabIndex": "host.focusable ? 0 : -1" } }, providers: [
519
- tuiAsDataList(TuiNativeMultiSelectComponent),
520
- tuiProvide(AbstractTuiNativeMultiSelect, TuiNativeMultiSelectComponent),
521
- {
522
- provide: TemplateRef,
523
- deps: [TuiNativeMultiSelectComponent],
524
- useFactory: ({ datalist }) => datalist,
525
- },
526
- ], usesInheritance: true, ngImport: i0, template: "@if (control.control?.valueChanges | async) {}\n\n<tui-data-list-wrapper\n *tuiDataList\n tuiMultiSelectGroup\n [disabledItemHandler]=\"disabledItemHandler || host.disableItemHandler\"\n [itemContent]=\"stringify | tuiStringifyContent\"\n [items]=\"items\"\n/>\n@for (option of items; track option) {\n <option\n [disabled]=\"disabledItemHandler ? disabledItemHandler(option) : host.disableItemHandler(option)\"\n [selected]=\"option | tuiMapper: selectedMapper : control.value\"\n [value]=\"stringify(option)\"\n >\n {{ stringify(option) }}\n </option>\n}\n", styles: [":host{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;opacity:0}\n"], dependencies: [{ kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$2.TuiDataListDirective, selector: "ng-template[tuiDataList]" }, { kind: "component", type: i2$1.TuiDataListWrapperComponent, selector: "tui-data-list-wrapper:not([labels]), tui-data-list-wrapper:not([labels])[new]", inputs: ["items", "disabledItemHandler", "emptyContent", "size", "itemContent"], outputs: ["itemClick"] }, { kind: "directive", type: TuiMultiSelectGroupDirective, selector: "[tuiMultiSelectGroup]" }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i6$1.TuiMapperPipe, name: "tuiMapper" }, { kind: "pipe", type: i7.TuiStringifyContentPipe, name: "tuiStringifyContent" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
527
- }
528
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiNativeMultiSelectComponent, decorators: [{
529
- type: Component,
530
- args: [{ standalone: false, selector: 'select[multiple][tuiSelect]:not([labels])', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
531
- tuiAsDataList(TuiNativeMultiSelectComponent),
532
- tuiProvide(AbstractTuiNativeMultiSelect, TuiNativeMultiSelectComponent),
533
- {
534
- provide: TemplateRef,
535
- deps: [TuiNativeMultiSelectComponent],
536
- useFactory: ({ datalist }) => datalist,
537
- },
538
- ], host: {
539
- '[attr.aria-invalid]': 'host.invalid',
540
- '[disabled]': 'host.disabled || control.readOnly',
541
- '[tabIndex]': 'host.focusable ? 0 : -1',
542
- '(change)': 'onValueChange($event.target.selectedOptions)',
543
- '(click.stop.zoneless)': '0',
544
- '(mousedown.stop.zoneless)': '0',
545
- }, template: "@if (control.control?.valueChanges | async) {}\n\n<tui-data-list-wrapper\n *tuiDataList\n tuiMultiSelectGroup\n [disabledItemHandler]=\"disabledItemHandler || host.disableItemHandler\"\n [itemContent]=\"stringify | tuiStringifyContent\"\n [items]=\"items\"\n/>\n@for (option of items; track option) {\n <option\n [disabled]=\"disabledItemHandler ? disabledItemHandler(option) : host.disableItemHandler(option)\"\n [selected]=\"option | tuiMapper: selectedMapper : control.value\"\n [value]=\"stringify(option)\"\n >\n {{ stringify(option) }}\n </option>\n}\n", styles: [":host{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;opacity:0}\n"] }]
546
- }], propDecorators: { items: [{
547
- type: Input
548
- }] } });
549
-
550
- class TuiNativeMultiSelectGroupComponent extends AbstractTuiNativeMultiSelect {
551
- constructor() {
552
- super(...arguments);
553
- this.items = [];
554
- this.labels = [];
555
- }
556
- onValueChange(selectedOptions) {
557
- const selected = Array.from(selectedOptions).map((option) => option.index);
558
- const flatItems = this.items?.reduce((acc, val) => acc.concat(val), []) || [];
559
- const value = flatItems.filter((_, index) => selected.includes(index));
560
- this.host.onSelectionChange(value);
561
- }
562
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiNativeMultiSelectGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
563
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiNativeMultiSelectGroupComponent, isStandalone: false, selector: "select[multiple][tuiSelect][labels]", inputs: { items: "items", labels: "labels" }, host: { listeners: { "change": "onValueChange($event.target.selectedOptions)", "click.stop.zoneless": "0", "mousedown.stop.zoneless": "0" }, properties: { "attr.aria-invalid": "host.invalid", "disabled": "host.disabled || control.readOnly", "tabIndex": "host.focusable ? 0 : -1" } }, providers: [
564
- tuiAsDataList(TuiNativeMultiSelectGroupComponent),
565
- tuiProvide(AbstractTuiNativeMultiSelect, TuiNativeMultiSelectGroupComponent),
566
- {
567
- provide: TemplateRef,
568
- deps: [TuiNativeMultiSelectGroupComponent],
569
- useFactory: ({ datalist }) => datalist,
570
- },
571
- ], usesInheritance: true, ngImport: i0, template: "@if (control.control?.valueChanges | async) {}\n\n<tui-data-list-wrapper\n *tuiDataList\n tuiMultiSelectGroup\n [disabledItemHandler]=\"disabledItemHandler || host.disableItemHandler\"\n [itemContent]=\"stringify | tuiStringifyContent\"\n [items]=\"items\"\n [labels]=\"labels\"\n/>\n@for (group of items; track group) {\n <optgroup [label]=\"labels[$index]\">\n @for (option of group; track option) {\n <option\n [disabled]=\"disabledItemHandler ? disabledItemHandler(option) : host.disableItemHandler(option)\"\n [selected]=\"option | tuiMapper: selectedMapper : control.value\"\n [value]=\"stringify(option)\"\n >\n {{ stringify(option) }}\n </option>\n }\n </optgroup>\n}\n", styles: [":host{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;opacity:0}\n"], dependencies: [{ kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$2.TuiDataListDirective, selector: "ng-template[tuiDataList]" }, { kind: "component", type: i2$1.TuiDataListGroupWrapperComponent, selector: "tui-data-list-wrapper[labels]", inputs: ["labels"] }, { kind: "directive", type: TuiMultiSelectGroupDirective, selector: "[tuiMultiSelectGroup]" }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i6$1.TuiMapperPipe, name: "tuiMapper" }, { kind: "pipe", type: i7.TuiStringifyContentPipe, name: "tuiStringifyContent" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
572
- }
573
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiNativeMultiSelectGroupComponent, decorators: [{
574
- type: Component,
575
- args: [{ standalone: false, selector: 'select[multiple][tuiSelect][labels]', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
576
- tuiAsDataList(TuiNativeMultiSelectGroupComponent),
577
- tuiProvide(AbstractTuiNativeMultiSelect, TuiNativeMultiSelectGroupComponent),
578
- {
579
- provide: TemplateRef,
580
- deps: [TuiNativeMultiSelectGroupComponent],
581
- useFactory: ({ datalist }) => datalist,
582
- },
583
- ], host: {
584
- '[attr.aria-invalid]': 'host.invalid',
585
- '[disabled]': 'host.disabled || control.readOnly',
586
- '[tabIndex]': 'host.focusable ? 0 : -1',
587
- '(change)': 'onValueChange($event.target.selectedOptions)',
588
- '(click.stop.zoneless)': '0',
589
- '(mousedown.stop.zoneless)': '0',
590
- }, template: "@if (control.control?.valueChanges | async) {}\n\n<tui-data-list-wrapper\n *tuiDataList\n tuiMultiSelectGroup\n [disabledItemHandler]=\"disabledItemHandler || host.disableItemHandler\"\n [itemContent]=\"stringify | tuiStringifyContent\"\n [items]=\"items\"\n [labels]=\"labels\"\n/>\n@for (group of items; track group) {\n <optgroup [label]=\"labels[$index]\">\n @for (option of group; track option) {\n <option\n [disabled]=\"disabledItemHandler ? disabledItemHandler(option) : host.disableItemHandler(option)\"\n [selected]=\"option | tuiMapper: selectedMapper : control.value\"\n [value]=\"stringify(option)\"\n >\n {{ stringify(option) }}\n </option>\n }\n </optgroup>\n}\n", styles: [":host{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;opacity:0}\n"] }]
591
- }], propDecorators: { items: [{
592
- type: Input
593
- }], labels: [{
594
- type: Input
595
- }] } });
596
-
597
- /**
598
- * TODO(v5): delete it
599
- * @deprecated use new version of {@link https://taiga-ui.dev/components/input-chip TuiInputChip} (from @taiga-ui/kit) instead
600
- */
601
- class TuiMultiSelectModule {
602
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiMultiSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
603
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: TuiMultiSelectModule, declarations: [TuiMultiSelectComponent,
604
- TuiMultiSelectGroupComponent,
605
- TuiMultiSelectGroupDirective,
606
- TuiHideSelectedPipe,
607
- TuiNativeMultiSelectComponent,
608
- TuiNativeMultiSelectGroupComponent,
609
- TuiMultiSelectDirective], imports: [CommonModule,
610
- FormsModule,
611
- PolymorpheusOutlet,
612
- PolymorpheusTemplate,
613
- TuiArrowComponent,
614
- TuiInputTagModule,
615
- TuiLegacyDropdownOpenMonitorDirective,
616
- TuiLink,
617
- TuiMapperPipe,
618
- TuiMultiSelectOptionModule,
619
- TuiStringifyContentPipe,
620
- TuiTextfieldControllerModule,
621
- TuiWrapperModule, i1$2.TuiDataListComponent, i1$2.TuiDataListDirective, i1$2.TuiOption, i1$2.TuiOptionNew, i1$2.TuiOptionWithValue, i1$2.TuiOptGroup, i2$1.TuiDataListWrapperComponent, i2$1.TuiDataListGroupWrapperComponent, i1$2.TuiDataListDirective, i3.TuiDropdownOptionsDirective, i3.TuiDropdownDriverDirective, i3.TuiDropdownDirective, i3.TuiDropdownComponent, i3.TuiDropdownOpen, i3.TuiDropdownOpenLegacy, i3.TuiDropdownManual, i3.TuiDropdownHover, i3.TuiDropdownContent, i3.TuiDropdownContext, i3.TuiDropdownPosition, i3.TuiDropdownPositionSided, i3.TuiDropdownSelection], exports: [TuiMultiSelectComponent,
622
- TuiMultiSelectGroupComponent,
623
- TuiMultiSelectGroupDirective,
624
- TuiHideSelectedPipe,
625
- TuiMultiSelectDirective,
626
- TuiNativeMultiSelectComponent,
627
- TuiNativeMultiSelectGroupComponent, i3.TuiDropdownOptionsDirective, i3.TuiDropdownDriverDirective, i3.TuiDropdownDirective, i3.TuiDropdownComponent, i3.TuiDropdownOpen, i3.TuiDropdownOpenLegacy, i3.TuiDropdownManual, i3.TuiDropdownHover, i3.TuiDropdownContent, i3.TuiDropdownContext, i3.TuiDropdownPosition, i3.TuiDropdownPositionSided, i3.TuiDropdownSelection, i1$2.TuiDataListComponent, i1$2.TuiDataListDirective, i1$2.TuiOption, i1$2.TuiOptionNew, i1$2.TuiOptionWithValue, i1$2.TuiOptGroup, i2$1.TuiDataListWrapperComponent, i2$1.TuiDataListGroupWrapperComponent, i1$2.TuiDataListDirective] }); }
628
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiMultiSelectModule, imports: [CommonModule,
629
- FormsModule,
630
- TuiArrowComponent,
631
- TuiInputTagModule,
632
- TuiMultiSelectOptionModule,
633
- TuiTextfieldControllerModule,
634
- TuiWrapperModule, i1$2.TuiDataListComponent, i1$2.TuiOption, i2$1.TuiDataListWrapperComponent, i2$1.TuiDataListGroupWrapperComponent, i3.TuiDropdownComponent] }); }
635
- }
636
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiMultiSelectModule, decorators: [{
637
- type: NgModule,
638
- args: [{
639
- imports: [
640
- CommonModule,
641
- FormsModule,
642
- PolymorpheusOutlet,
643
- PolymorpheusTemplate,
644
- TuiArrowComponent,
645
- TuiInputTagModule,
646
- TuiLegacyDropdownOpenMonitorDirective,
647
- TuiLink,
648
- TuiMapperPipe,
649
- TuiMultiSelectOptionModule,
650
- TuiStringifyContentPipe,
651
- TuiTextfieldControllerModule,
652
- TuiWrapperModule,
653
- ...TuiDataList,
654
- ...TuiDataListWrapper,
655
- ...TuiDropdown,
656
- ],
657
- declarations: [
658
- TuiMultiSelectComponent,
659
- TuiMultiSelectGroupComponent,
660
- TuiMultiSelectGroupDirective,
661
- TuiHideSelectedPipe,
662
- TuiNativeMultiSelectComponent,
663
- TuiNativeMultiSelectGroupComponent,
664
- TuiMultiSelectDirective,
665
- ],
666
- exports: [
667
- TuiMultiSelectComponent,
668
- TuiMultiSelectGroupComponent,
669
- TuiMultiSelectGroupDirective,
670
- TuiHideSelectedPipe,
671
- TuiMultiSelectDirective,
672
- TuiNativeMultiSelectComponent,
673
- TuiNativeMultiSelectGroupComponent,
674
- ...TuiDropdown,
675
- ...TuiDataList,
676
- ...TuiDataListWrapper,
677
- ],
678
- }]
679
- }] });
680
-
681
- /**
682
- * Generated bundle index. Do not edit.
683
- */
684
-
685
- export { AbstractTuiNativeMultiSelect, TUI_MULTI_SELECT_DEFAULT_OPTIONS, TUI_MULTI_SELECT_OPTION, TUI_MULTI_SELECT_OPTIONS, TuiHideSelectedPipe, TuiMultiSelectComponent, TuiMultiSelectDirective, TuiMultiSelectGroupComponent, TuiMultiSelectGroupDirective, TuiMultiSelectModule, TuiNativeMultiSelectComponent, TuiNativeMultiSelectGroupComponent, tuiMultiSelectOptionsProvider };
686
- //# sourceMappingURL=taiga-ui-legacy-components-multi-select.mjs.map