@tectra-ng/ui 0.4.3 → 0.4.5

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 (233) hide show
  1. package/amount/README.md +19 -1
  2. package/analog-clock/README.md +1 -1
  3. package/autocomplete/README.md +1 -1
  4. package/avatar/README.md +24 -4
  5. package/cascade-select/README.md +1 -1
  6. package/chips-input/README.md +10 -5
  7. package/color-picker/README.md +5 -0
  8. package/countdown/README.md +7 -1
  9. package/country/README.md +14 -1
  10. package/country-select/README.md +2 -1
  11. package/export/README.md +27 -2
  12. package/export-font/README.md +1 -1
  13. package/fesm2022/tectra-ng-ui-accordion.mjs +21 -21
  14. package/fesm2022/tectra-ng-ui-amount.mjs +99 -17
  15. package/fesm2022/tectra-ng-ui-amount.mjs.map +1 -1
  16. package/fesm2022/tectra-ng-ui-analog-clock.mjs +12 -25
  17. package/fesm2022/tectra-ng-ui-analog-clock.mjs.map +1 -1
  18. package/fesm2022/tectra-ng-ui-autocomplete.mjs +8 -7
  19. package/fesm2022/tectra-ng-ui-autocomplete.mjs.map +1 -1
  20. package/fesm2022/tectra-ng-ui-avatar.mjs +68 -26
  21. package/fesm2022/tectra-ng-ui-avatar.mjs.map +1 -1
  22. package/fesm2022/tectra-ng-ui-badge.mjs +3 -3
  23. package/fesm2022/tectra-ng-ui-breadcrumb.mjs +9 -9
  24. package/fesm2022/tectra-ng-ui-button-group.mjs +3 -3
  25. package/fesm2022/tectra-ng-ui-button.mjs +11 -11
  26. package/fesm2022/tectra-ng-ui-button.mjs.map +1 -1
  27. package/fesm2022/tectra-ng-ui-card.mjs +5 -5
  28. package/fesm2022/tectra-ng-ui-card.mjs.map +1 -1
  29. package/fesm2022/tectra-ng-ui-carousel.mjs +15 -15
  30. package/fesm2022/tectra-ng-ui-cascade-select.mjs +10 -7
  31. package/fesm2022/tectra-ng-ui-cascade-select.mjs.map +1 -1
  32. package/fesm2022/tectra-ng-ui-checkbox.mjs +9 -9
  33. package/fesm2022/tectra-ng-ui-chip.mjs +3 -3
  34. package/fesm2022/tectra-ng-ui-chips-input.mjs +120 -21
  35. package/fesm2022/tectra-ng-ui-chips-input.mjs.map +1 -1
  36. package/fesm2022/tectra-ng-ui-color-picker.mjs +96 -9
  37. package/fesm2022/tectra-ng-ui-color-picker.mjs.map +1 -1
  38. package/fesm2022/tectra-ng-ui-color-swatches.mjs +3 -3
  39. package/fesm2022/tectra-ng-ui-confirm.mjs +9 -9
  40. package/fesm2022/tectra-ng-ui-countdown.mjs +48 -19
  41. package/fesm2022/tectra-ng-ui-countdown.mjs.map +1 -1
  42. package/fesm2022/tectra-ng-ui-country-select.mjs +31 -8
  43. package/fesm2022/tectra-ng-ui-country-select.mjs.map +1 -1
  44. package/fesm2022/tectra-ng-ui-country.mjs +18 -9
  45. package/fesm2022/tectra-ng-ui-country.mjs.map +1 -1
  46. package/fesm2022/tectra-ng-ui-data-view.mjs +30 -30
  47. package/fesm2022/tectra-ng-ui-datepicker.mjs +53 -40
  48. package/fesm2022/tectra-ng-ui-datepicker.mjs.map +1 -1
  49. package/fesm2022/tectra-ng-ui-dialog.mjs +30 -30
  50. package/fesm2022/tectra-ng-ui-dialog.mjs.map +1 -1
  51. package/fesm2022/tectra-ng-ui-divider.mjs +3 -3
  52. package/fesm2022/tectra-ng-ui-drawer.mjs +9 -9
  53. package/fesm2022/tectra-ng-ui-email-suggestion.mjs +3 -3
  54. package/fesm2022/tectra-ng-ui-export.mjs +1264 -111
  55. package/fesm2022/tectra-ng-ui-export.mjs.map +1 -1
  56. package/fesm2022/tectra-ng-ui-field.mjs +4 -3
  57. package/fesm2022/tectra-ng-ui-field.mjs.map +1 -1
  58. package/fesm2022/tectra-ng-ui-fieldset.mjs +5 -5
  59. package/fesm2022/tectra-ng-ui-fieldset.mjs.map +1 -1
  60. package/fesm2022/tectra-ng-ui-file-upload.mjs +12 -12
  61. package/fesm2022/tectra-ng-ui-galleria.mjs +21 -21
  62. package/fesm2022/tectra-ng-ui-highlight-text.mjs +3 -3
  63. package/fesm2022/tectra-ng-ui-icon-field.mjs +63 -35
  64. package/fesm2022/tectra-ng-ui-icon-field.mjs.map +1 -1
  65. package/fesm2022/tectra-ng-ui-image.mjs +9 -9
  66. package/fesm2022/tectra-ng-ui-input-group.mjs +6 -6
  67. package/fesm2022/tectra-ng-ui-input-mask.mjs +3 -3
  68. package/fesm2022/tectra-ng-ui-input-number.mjs +5 -5
  69. package/fesm2022/tectra-ng-ui-input-number.mjs.map +1 -1
  70. package/fesm2022/tectra-ng-ui-input-otp.mjs +3 -3
  71. package/fesm2022/tectra-ng-ui-input.mjs +11 -10
  72. package/fesm2022/tectra-ng-ui-input.mjs.map +1 -1
  73. package/fesm2022/tectra-ng-ui-key-filter.mjs +87 -22
  74. package/fesm2022/tectra-ng-ui-key-filter.mjs.map +1 -1
  75. package/fesm2022/tectra-ng-ui-knob.mjs +30 -8
  76. package/fesm2022/tectra-ng-ui-knob.mjs.map +1 -1
  77. package/fesm2022/tectra-ng-ui-label.mjs +77 -18
  78. package/fesm2022/tectra-ng-ui-label.mjs.map +1 -1
  79. package/fesm2022/tectra-ng-ui-link.mjs +44 -20
  80. package/fesm2022/tectra-ng-ui-link.mjs.map +1 -1
  81. package/fesm2022/tectra-ng-ui-list-input.mjs +3 -3
  82. package/fesm2022/tectra-ng-ui-listbox.mjs +3 -3
  83. package/fesm2022/tectra-ng-ui-mention-textarea.mjs +19 -8
  84. package/fesm2022/tectra-ng-ui-mention-textarea.mjs.map +1 -1
  85. package/fesm2022/tectra-ng-ui-menu.mjs +15 -15
  86. package/fesm2022/tectra-ng-ui-menubar.mjs +6 -6
  87. package/fesm2022/tectra-ng-ui-message.mjs +23 -19
  88. package/fesm2022/tectra-ng-ui-message.mjs.map +1 -1
  89. package/fesm2022/tectra-ng-ui-month-calendar.mjs +32 -15
  90. package/fesm2022/tectra-ng-ui-month-calendar.mjs.map +1 -1
  91. package/fesm2022/tectra-ng-ui-multiselect.mjs +6 -5
  92. package/fesm2022/tectra-ng-ui-multiselect.mjs.map +1 -1
  93. package/fesm2022/tectra-ng-ui-overlay-badge.mjs +3 -3
  94. package/fesm2022/tectra-ng-ui-paginator.mjs +9 -9
  95. package/fesm2022/tectra-ng-ui-panel-menu.mjs +51 -20
  96. package/fesm2022/tectra-ng-ui-panel-menu.mjs.map +1 -1
  97. package/fesm2022/tectra-ng-ui-panel.mjs +7 -5
  98. package/fesm2022/tectra-ng-ui-panel.mjs.map +1 -1
  99. package/fesm2022/tectra-ng-ui-password-generator.mjs +24 -7
  100. package/fesm2022/tectra-ng-ui-password-generator.mjs.map +1 -1
  101. package/fesm2022/tectra-ng-ui-password.mjs +14 -14
  102. package/fesm2022/tectra-ng-ui-password.mjs.map +1 -1
  103. package/fesm2022/tectra-ng-ui-pill.mjs +39 -19
  104. package/fesm2022/tectra-ng-ui-pill.mjs.map +1 -1
  105. package/fesm2022/tectra-ng-ui-popover.mjs +15 -15
  106. package/fesm2022/tectra-ng-ui-progress-bar.mjs +6 -6
  107. package/fesm2022/tectra-ng-ui-progress-spinner.mjs +3 -3
  108. package/fesm2022/tectra-ng-ui-radio-button.mjs +6 -6
  109. package/fesm2022/tectra-ng-ui-rating.mjs +11 -11
  110. package/fesm2022/tectra-ng-ui-rating.mjs.map +1 -1
  111. package/fesm2022/tectra-ng-ui-scroll-panel.mjs +3 -3
  112. package/fesm2022/tectra-ng-ui-select-button.mjs +6 -6
  113. package/fesm2022/tectra-ng-ui-select.mjs +66 -43
  114. package/fesm2022/tectra-ng-ui-select.mjs.map +1 -1
  115. package/fesm2022/tectra-ng-ui-skeleton.mjs +6 -6
  116. package/fesm2022/tectra-ng-ui-slider.mjs +3 -3
  117. package/fesm2022/tectra-ng-ui-sparkline.mjs +3 -3
  118. package/fesm2022/tectra-ng-ui-speed-dial.mjs +3 -3
  119. package/fesm2022/tectra-ng-ui-split-button.mjs +3 -3
  120. package/fesm2022/tectra-ng-ui-splitter.mjs +6 -6
  121. package/fesm2022/tectra-ng-ui-stat-tiles.mjs +99 -14
  122. package/fesm2022/tectra-ng-ui-stat-tiles.mjs.map +1 -1
  123. package/fesm2022/tectra-ng-ui-status-icon.mjs +43 -6
  124. package/fesm2022/tectra-ng-ui-status-icon.mjs.map +1 -1
  125. package/fesm2022/tectra-ng-ui-stepper.mjs +41 -35
  126. package/fesm2022/tectra-ng-ui-stepper.mjs.map +1 -1
  127. package/fesm2022/tectra-ng-ui-table.mjs +74 -60
  128. package/fesm2022/tectra-ng-ui-table.mjs.map +1 -1
  129. package/fesm2022/tectra-ng-ui-tabs.mjs +18 -18
  130. package/fesm2022/tectra-ng-ui-tag.mjs +8 -8
  131. package/fesm2022/tectra-ng-ui-tag.mjs.map +1 -1
  132. package/fesm2022/tectra-ng-ui-textarea.mjs +9 -9
  133. package/fesm2022/tectra-ng-ui-timeline.mjs +15 -15
  134. package/fesm2022/tectra-ng-ui-toast.mjs +11 -11
  135. package/fesm2022/tectra-ng-ui-toast.mjs.map +1 -1
  136. package/fesm2022/tectra-ng-ui-toggle-button.mjs +3 -3
  137. package/fesm2022/tectra-ng-ui-toggle-switch.mjs +6 -6
  138. package/fesm2022/tectra-ng-ui-toolbar.mjs +12 -12
  139. package/fesm2022/tectra-ng-ui-tooltip.mjs +9 -9
  140. package/fesm2022/tectra-ng-ui-tree-select.mjs +13 -11
  141. package/fesm2022/tectra-ng-ui-tree-select.mjs.map +1 -1
  142. package/fesm2022/tectra-ng-ui-tree-table.mjs +7 -7
  143. package/fesm2022/tectra-ng-ui-tree-table.mjs.map +1 -1
  144. package/fesm2022/tectra-ng-ui-tree.mjs +30 -30
  145. package/fesm2022/tectra-ng-ui-truncate-text.mjs +36 -12
  146. package/fesm2022/tectra-ng-ui-truncate-text.mjs.map +1 -1
  147. package/fesm2022/tectra-ng-ui-virtual-scroller.mjs +15 -15
  148. package/fesm2022/tectra-ng-ui.mjs +1 -1
  149. package/icon-field/README.md +2 -1
  150. package/input/README.md +1 -1
  151. package/key-filter/README.md +3 -2
  152. package/knob/README.md +3 -1
  153. package/label/README.md +4 -1
  154. package/link/README.md +4 -1
  155. package/message/README.md +2 -2
  156. package/month-calendar/README.md +2 -1
  157. package/multiselect/README.md +1 -1
  158. package/package.json +4 -4
  159. package/panel/README.md +3 -1
  160. package/panel-menu/README.md +3 -2
  161. package/password-generator/README.md +2 -0
  162. package/pill/README.md +4 -4
  163. package/select/README.md +1 -1
  164. package/stat-tiles/README.md +17 -1
  165. package/status-icon/README.md +3 -1
  166. package/table/README.md +1 -1
  167. package/tag/README.md +2 -0
  168. package/tree-select/README.md +1 -1
  169. package/truncate-text/README.md +2 -1
  170. package/types/tectra-ng-ui-amount.d.ts +41 -1
  171. package/types/tectra-ng-ui-amount.d.ts.map +1 -1
  172. package/types/tectra-ng-ui-analog-clock.d.ts +1 -4
  173. package/types/tectra-ng-ui-analog-clock.d.ts.map +1 -1
  174. package/types/tectra-ng-ui-autocomplete.d.ts +1 -1
  175. package/types/tectra-ng-ui-avatar.d.ts +45 -12
  176. package/types/tectra-ng-ui-avatar.d.ts.map +1 -1
  177. package/types/tectra-ng-ui-cascade-select.d.ts +3 -2
  178. package/types/tectra-ng-ui-cascade-select.d.ts.map +1 -1
  179. package/types/tectra-ng-ui-chips-input.d.ts +54 -6
  180. package/types/tectra-ng-ui-chips-input.d.ts.map +1 -1
  181. package/types/tectra-ng-ui-color-picker.d.ts +38 -1
  182. package/types/tectra-ng-ui-color-picker.d.ts.map +1 -1
  183. package/types/tectra-ng-ui-countdown.d.ts +12 -1
  184. package/types/tectra-ng-ui-countdown.d.ts.map +1 -1
  185. package/types/tectra-ng-ui-country-select.d.ts +17 -4
  186. package/types/tectra-ng-ui-country-select.d.ts.map +1 -1
  187. package/types/tectra-ng-ui-country.d.ts +7 -1
  188. package/types/tectra-ng-ui-country.d.ts.map +1 -1
  189. package/types/tectra-ng-ui-datepicker.d.ts +4 -2
  190. package/types/tectra-ng-ui-datepicker.d.ts.map +1 -1
  191. package/types/tectra-ng-ui-export.d.ts +68 -8
  192. package/types/tectra-ng-ui-export.d.ts.map +1 -1
  193. package/types/tectra-ng-ui-icon-field.d.ts +9 -2
  194. package/types/tectra-ng-ui-icon-field.d.ts.map +1 -1
  195. package/types/tectra-ng-ui-input.d.ts +1 -1
  196. package/types/tectra-ng-ui-key-filter.d.ts +19 -4
  197. package/types/tectra-ng-ui-key-filter.d.ts.map +1 -1
  198. package/types/tectra-ng-ui-knob.d.ts +10 -2
  199. package/types/tectra-ng-ui-knob.d.ts.map +1 -1
  200. package/types/tectra-ng-ui-label.d.ts +8 -1
  201. package/types/tectra-ng-ui-label.d.ts.map +1 -1
  202. package/types/tectra-ng-ui-link.d.ts +8 -2
  203. package/types/tectra-ng-ui-link.d.ts.map +1 -1
  204. package/types/tectra-ng-ui-mention-textarea.d.ts +5 -0
  205. package/types/tectra-ng-ui-mention-textarea.d.ts.map +1 -1
  206. package/types/tectra-ng-ui-message.d.ts +1 -1
  207. package/types/tectra-ng-ui-message.d.ts.map +1 -1
  208. package/types/tectra-ng-ui-month-calendar.d.ts +14 -4
  209. package/types/tectra-ng-ui-month-calendar.d.ts.map +1 -1
  210. package/types/tectra-ng-ui-multiselect.d.ts +1 -1
  211. package/types/tectra-ng-ui-panel-menu.d.ts +34 -6
  212. package/types/tectra-ng-ui-panel-menu.d.ts.map +1 -1
  213. package/types/tectra-ng-ui-panel.d.ts +1 -1
  214. package/types/tectra-ng-ui-panel.d.ts.map +1 -1
  215. package/types/tectra-ng-ui-password-generator.d.ts +10 -3
  216. package/types/tectra-ng-ui-password-generator.d.ts.map +1 -1
  217. package/types/tectra-ng-ui-pill.d.ts +9 -5
  218. package/types/tectra-ng-ui-pill.d.ts.map +1 -1
  219. package/types/tectra-ng-ui-select.d.ts +5 -2
  220. package/types/tectra-ng-ui-select.d.ts.map +1 -1
  221. package/types/tectra-ng-ui-stat-tiles.d.ts +49 -5
  222. package/types/tectra-ng-ui-stat-tiles.d.ts.map +1 -1
  223. package/types/tectra-ng-ui-status-icon.d.ts +20 -2
  224. package/types/tectra-ng-ui-status-icon.d.ts.map +1 -1
  225. package/types/tectra-ng-ui-stepper.d.ts +1 -0
  226. package/types/tectra-ng-ui-stepper.d.ts.map +1 -1
  227. package/types/tectra-ng-ui-table.d.ts +2 -1
  228. package/types/tectra-ng-ui-table.d.ts.map +1 -1
  229. package/types/tectra-ng-ui-tree-select.d.ts +3 -3
  230. package/types/tectra-ng-ui-tree-select.d.ts.map +1 -1
  231. package/types/tectra-ng-ui-truncate-text.d.ts +7 -2
  232. package/types/tectra-ng-ui-truncate-text.d.ts.map +1 -1
  233. package/types/tectra-ng-ui.d.ts +1 -1
@@ -99,7 +99,7 @@ var TxColorSwatches = class TxColorSwatches extends TxFormControlBase {
99
99
  }
100
100
  static ɵfac = i0.ɵɵngDeclareFactory({
101
101
  minVersion: "12.0.0",
102
- version: "22.2.5",
102
+ version: "22.2.6",
103
103
  ngImport: i0,
104
104
  type: TxColorSwatches,
105
105
  deps: null,
@@ -107,7 +107,7 @@ var TxColorSwatches = class TxColorSwatches extends TxFormControlBase {
107
107
  });
108
108
  static ɵcmp = i0.ɵɵngDeclareComponent({
109
109
  minVersion: "17.0.0",
110
- version: "22.2.5",
110
+ version: "22.2.6",
111
111
  type: TxColorSwatches,
112
112
  isStandalone: true,
113
113
  selector: "tx-color-swatches",
@@ -237,7 +237,7 @@ var TxColorSwatches = class TxColorSwatches extends TxFormControlBase {
237
237
  };
238
238
  i0.ɵɵngDeclareClassMetadata({
239
239
  minVersion: "12.0.0",
240
- version: "22.2.5",
240
+ version: "22.2.6",
241
241
  ngImport: i0,
242
242
  type: TxColorSwatches,
243
243
  decorators: [{
@@ -67,7 +67,7 @@ var TxConfirmDialog = class TxConfirmDialog {
67
67
  finish = (accepted) => void this.ref.close(accepted);
68
68
  static ɵfac = i0.ɵɵngDeclareFactory({
69
69
  minVersion: "12.0.0",
70
- version: "22.2.5",
70
+ version: "22.2.6",
71
71
  ngImport: i0,
72
72
  type: TxConfirmDialog,
73
73
  deps: [],
@@ -75,7 +75,7 @@ var TxConfirmDialog = class TxConfirmDialog {
75
75
  });
76
76
  static ɵcmp = i0.ɵɵngDeclareComponent({
77
77
  minVersion: "17.0.0",
78
- version: "22.2.5",
78
+ version: "22.2.6",
79
79
  type: TxConfirmDialog,
80
80
  isStandalone: true,
81
81
  selector: "tx-confirm-dialog",
@@ -176,7 +176,7 @@ var TxConfirmDialog = class TxConfirmDialog {
176
176
  };
177
177
  i0.ɵɵngDeclareClassMetadata({
178
178
  minVersion: "12.0.0",
179
- version: "22.2.5",
179
+ version: "22.2.6",
180
180
  ngImport: i0,
181
181
  type: TxConfirmDialog,
182
182
  decorators: [{
@@ -242,7 +242,7 @@ var TxConfirmPopup = class TxConfirmPopup {
242
242
  }
243
243
  static ɵfac = i0.ɵɵngDeclareFactory({
244
244
  minVersion: "12.0.0",
245
- version: "22.2.5",
245
+ version: "22.2.6",
246
246
  ngImport: i0,
247
247
  type: TxConfirmPopup,
248
248
  deps: [],
@@ -250,7 +250,7 @@ var TxConfirmPopup = class TxConfirmPopup {
250
250
  });
251
251
  static ɵcmp = i0.ɵɵngDeclareComponent({
252
252
  minVersion: "17.0.0",
253
- version: "22.2.5",
253
+ version: "22.2.6",
254
254
  type: TxConfirmPopup,
255
255
  isStandalone: true,
256
256
  selector: "tx-confirm-popup",
@@ -352,7 +352,7 @@ var TxConfirmPopup = class TxConfirmPopup {
352
352
  };
353
353
  i0.ɵɵngDeclareClassMetadata({
354
354
  minVersion: "12.0.0",
355
- version: "22.2.5",
355
+ version: "22.2.6",
356
356
  ngImport: i0,
357
357
  type: TxConfirmPopup,
358
358
  decorators: [{
@@ -475,7 +475,7 @@ var TxConfirmService = class TxConfirmService {
475
475
  }
476
476
  static ɵfac = i0.ɵɵngDeclareFactory({
477
477
  minVersion: "12.0.0",
478
- version: "22.2.5",
478
+ version: "22.2.6",
479
479
  ngImport: i0,
480
480
  type: TxConfirmService,
481
481
  deps: [],
@@ -483,7 +483,7 @@ var TxConfirmService = class TxConfirmService {
483
483
  });
484
484
  static ɵprov = i0.ɵɵngDeclareInjectable({
485
485
  minVersion: "12.0.0",
486
- version: "22.2.5",
486
+ version: "22.2.6",
487
487
  ngImport: i0,
488
488
  type: TxConfirmService,
489
489
  providedIn: "root"
@@ -491,7 +491,7 @@ var TxConfirmService = class TxConfirmService {
491
491
  };
492
492
  i0.ɵɵngDeclareClassMetadata({
493
493
  minVersion: "12.0.0",
494
- version: "22.2.5",
494
+ version: "22.2.6",
495
495
  ngImport: i0,
496
496
  type: TxConfirmService,
497
497
  decorators: [{
@@ -40,7 +40,7 @@ var TxCountdownValue = class TxCountdownValue {
40
40
  }
41
41
  static ɵfac = i0.ɵɵngDeclareFactory({
42
42
  minVersion: "12.0.0",
43
- version: "22.2.5",
43
+ version: "22.2.6",
44
44
  ngImport: i0,
45
45
  type: TxCountdownValue,
46
46
  deps: [],
@@ -48,7 +48,7 @@ var TxCountdownValue = class TxCountdownValue {
48
48
  });
49
49
  static ɵdir = i0.ɵɵngDeclareDirective({
50
50
  minVersion: "14.0.0",
51
- version: "22.2.5",
51
+ version: "22.2.6",
52
52
  type: TxCountdownValue,
53
53
  isStandalone: true,
54
54
  selector: "ng-template[txCountdownValue]",
@@ -57,7 +57,7 @@ var TxCountdownValue = class TxCountdownValue {
57
57
  };
58
58
  i0.ɵɵngDeclareClassMetadata({
59
59
  minVersion: "12.0.0",
60
- version: "22.2.5",
60
+ version: "22.2.6",
61
61
  ngImport: i0,
62
62
  type: TxCountdownValue,
63
63
  decorators: [{
@@ -71,7 +71,7 @@ var TxRemainingTimePipe = class TxRemainingTimePipe {
71
71
  }
72
72
  static ɵfac = i0.ɵɵngDeclareFactory({
73
73
  minVersion: "12.0.0",
74
- version: "22.2.5",
74
+ version: "22.2.6",
75
75
  ngImport: i0,
76
76
  type: TxRemainingTimePipe,
77
77
  deps: [],
@@ -79,7 +79,7 @@ var TxRemainingTimePipe = class TxRemainingTimePipe {
79
79
  });
80
80
  static ɵpipe = i0.ɵɵngDeclarePipe({
81
81
  minVersion: "14.0.0",
82
- version: "22.2.5",
82
+ version: "22.2.6",
83
83
  ngImport: i0,
84
84
  type: TxRemainingTimePipe,
85
85
  isStandalone: true,
@@ -88,7 +88,7 @@ var TxRemainingTimePipe = class TxRemainingTimePipe {
88
88
  };
89
89
  i0.ɵɵngDeclareClassMetadata({
90
90
  minVersion: "12.0.0",
91
- version: "22.2.5",
91
+ version: "22.2.6",
92
92
  ngImport: i0,
93
93
  type: TxRemainingTimePipe,
94
94
  decorators: [{
@@ -116,6 +116,10 @@ var TxCountdown = class TxCountdown {
116
116
  ...ngDevMode ? { debugName: "paused" } : /* istanbul ignore next */ {},
117
117
  transform: booleanAttribute
118
118
  });
119
+ restartOnChange = input(true, {
120
+ ...ngDevMode ? { debugName: "restartOnChange" } : /* istanbul ignore next */ {},
121
+ transform: booleanAttribute
122
+ });
119
123
  ariaLive = input("off", ...ngDevMode ? [{ debugName: "ariaLive" }] : /* istanbul ignore next */ []);
120
124
  dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
121
125
  pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
@@ -138,6 +142,7 @@ var TxCountdown = class TxCountdown {
138
142
  frozen = signal(null, ...ngDevMode ? [{ debugName: "frozen" }] : /* istanbul ignore next */ []);
139
143
  timer = null;
140
144
  done = false;
145
+ countsValue = false;
141
146
  resolvedFormat = computed(() => this.format() ?? (this.target() !== void 0 && this.value() === void 0 ? "clock" : "number"), ...ngDevMode ? [{ debugName: "resolvedFormat" }] : /* istanbul ignore next */ []);
142
147
  remainingMs = computed(() => {
143
148
  const frozen = this.frozen();
@@ -162,18 +167,27 @@ var TxCountdown = class TxCountdown {
162
167
  const unit = this.unit();
163
168
  const target = targetTime(this.target());
164
169
  untracked(() => {
165
- this.done = false;
166
- this.now.set(Date.now());
167
- const deadline = value !== void 0 ? Date.now() + value * TX_COUNTDOWN_UNIT_MS[unit] : target;
168
- if (this.paused()) {
169
- this.deadline.set(deadline);
170
- this.frozen.set(deadline === null ? null : Math.max(0, deadline - Date.now()));
171
- } else {
172
- this.frozen.set(null);
173
- this.deadline.set(deadline);
174
- }
170
+ const running = this.deadline() !== null && !this.isExpired();
171
+ if (!this.restartOnChange() && running && this.countsValue && value !== void 0) return;
172
+ this.begin(value, unit, target);
175
173
  });
176
174
  }, ...ngDevMode ? [{ debugName: "start" }] : /* istanbul ignore next */ []);
175
+ restart() {
176
+ this.begin(this.value(), this.unit(), targetTime(this.target()));
177
+ }
178
+ begin(value, unit, target) {
179
+ this.done = false;
180
+ this.countsValue = value !== void 0;
181
+ this.now.set(Date.now());
182
+ const deadline = value !== void 0 ? Date.now() + value * TX_COUNTDOWN_UNIT_MS[unit] : target;
183
+ if (this.paused()) {
184
+ this.deadline.set(deadline);
185
+ this.frozen.set(deadline === null ? null : Math.max(0, deadline - Date.now()));
186
+ } else {
187
+ this.frozen.set(null);
188
+ this.deadline.set(deadline);
189
+ }
190
+ }
177
191
  pause = effect(() => {
178
192
  const paused = this.paused();
179
193
  untracked(() => {
@@ -220,7 +234,7 @@ var TxCountdown = class TxCountdown {
220
234
  });
221
235
  static ɵfac = i0.ɵɵngDeclareFactory({
222
236
  minVersion: "12.0.0",
223
- version: "22.2.5",
237
+ version: "22.2.6",
224
238
  ngImport: i0,
225
239
  type: TxCountdown,
226
240
  deps: [],
@@ -228,7 +242,7 @@ var TxCountdown = class TxCountdown {
228
242
  });
229
243
  static ɵcmp = i0.ɵɵngDeclareComponent({
230
244
  minVersion: "17.0.0",
231
- version: "22.2.5",
245
+ version: "22.2.6",
232
246
  type: TxCountdown,
233
247
  isStandalone: true,
234
248
  selector: "tx-countdown",
@@ -282,6 +296,13 @@ var TxCountdown = class TxCountdown {
282
296
  isRequired: false,
283
297
  transformFunction: null
284
298
  },
299
+ restartOnChange: {
300
+ classPropertyName: "restartOnChange",
301
+ publicName: "restartOnChange",
302
+ isSignal: true,
303
+ isRequired: false,
304
+ transformFunction: null
305
+ },
285
306
  ariaLive: {
286
307
  classPropertyName: "ariaLive",
287
308
  publicName: "ariaLive",
@@ -371,7 +392,7 @@ var TxCountdown = class TxCountdown {
371
392
  };
372
393
  i0.ɵɵngDeclareClassMetadata({
373
394
  minVersion: "12.0.0",
374
- version: "22.2.5",
395
+ version: "22.2.6",
375
396
  ngImport: i0,
376
397
  type: TxCountdown,
377
398
  decorators: [{
@@ -460,6 +481,14 @@ i0.ɵɵngDeclareClassMetadata({
460
481
  required: false
461
482
  }]
462
483
  }],
484
+ restartOnChange: [{
485
+ type: i0.Input,
486
+ args: [{
487
+ isSignal: true,
488
+ alias: "restartOnChange",
489
+ required: false
490
+ }]
491
+ }],
463
492
  ariaLive: [{
464
493
  type: i0.Input,
465
494
  args: [{
@@ -1 +1 @@
1
- {"version":3,"file":"tectra-ng-ui-countdown.mjs","names":[],"sources":["../../../../packages/ui/countdown/src/countdown.utils.ts","../../../../packages/ui/countdown/src/countdown.templates.ts","../../../../packages/ui/countdown/src/remaining-time.pipe.ts","../../../../packages/ui/countdown/src/countdown.icons.ts","../../../../packages/ui/countdown/src/countdown.theme.ts","../../../../packages/ui/countdown/src/countdown.component.ts"],"sourcesContent":["import { TxCountdownTarget, TxCountdownUnit } from './countdown.types';\n\n/** Length of each countdown unit in milliseconds. */\nexport const TX_COUNTDOWN_UNIT_MS: Record<TxCountdownUnit, number> = {\n seconds: 1000,\n minutes: 60000,\n hours: 3600000,\n days: 86400000,\n};\n\n/**\n * Formats remaining milliseconds as `mm:ss`, or `h:mm:ss` from one hour on; negative or empty values give `00:00`.\n */\nexport function formatRemaining(ms: number | null | undefined): string {\n const total = Math.max(0, Math.floor((ms ?? 0) / 1000));\n const hours = Math.floor(total / 3600);\n const minutes = Math.floor((total % 3600) / 60);\n const seconds = total % 60;\n const pad = (value: number) => String(value).padStart(2, '0');\n return hours ? `${hours}:${pad(minutes)}:${pad(seconds)}` : `${pad(minutes)}:${pad(seconds)}`;\n}\n\n/** Splits remaining milliseconds into days, hours, minutes and seconds, rounding partial seconds up. */\nexport function splitRemaining(ms: number): { days: number; hours: number; minutes: number; seconds: number } {\n const total = Math.max(0, Math.ceil(ms / 1000));\n return {\n days: Math.floor(total / 86400),\n hours: Math.floor((total % 86400) / 3600),\n minutes: Math.floor((total % 3600) / 60),\n seconds: total % 60,\n };\n}\n\n/** Reads a target as milliseconds since the epoch; `null` when it is empty or not a valid date. */\nexport function targetTime(value: TxCountdownTarget): number | null {\n if (value === null || value === undefined || value === '') return null;\n const time = new Date(value).getTime();\n return Number.isNaN(time) ? null : time;\n}\n","import { Directive, TemplateRef, inject } from '@angular/core';\nimport { TxCountdownContext } from './countdown.types';\n\n@Directive({ selector: 'ng-template[txCountdownValue]' })\nexport class TxCountdownValue {\n readonly templateRef = inject<TemplateRef<TxCountdownContext>>(TemplateRef);\n\n static ngTemplateContextGuard(_directive: TxCountdownValue, context: unknown): context is TxCountdownContext {\n return !!context;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { formatRemaining } from './countdown.utils';\n\n/** Formats remaining milliseconds as `mm:ss` or `h:mm:ss`, like `tx-countdown` with the `clock` format. */\n@Pipe({ name: 'txRemainingTime' })\nexport class TxRemainingTimePipe implements PipeTransform {\n transform(ms: number | null | undefined): string {\n return formatRemaining(ms);\n }\n}\n","import { TxIconSet, txIconClock } from '@tectra-ng/icons';\n\nexport const COUNTDOWN_ICON_DEFAULTS: TxIconSet = {\n clock: txIconClock,\n};\n","import { countdownTokens } from '@tectra-ng/themes';\n\nexport const COUNTDOWN_THEME = {\n countdown: countdownTokens,\n};\n","import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, DestroyRef, booleanAttribute, computed, contentChild, effect, inject, input, numberAttribute, output, signal, untracked } from '@angular/core';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { optionalBoolean, optionalNumber } from '@tectra-ng/core/utils';\nimport { TectraCountdownTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { TxCountdownValue } from './countdown.templates';\nimport { TxCountdownContext, TxCountdownFormat, TxCountdownPart, TxCountdownTarget, TxCountdownUnit } from './countdown.types';\nimport { TX_COUNTDOWN_UNIT_MS, formatRemaining, splitRemaining, targetTime } from './countdown.utils';\nimport { provideTxIconDefaults } from '@tectra-ng/icons';\nimport { COUNTDOWN_ICON_DEFAULTS } from './countdown.icons';\nimport { COUNTDOWN_THEME } from './countdown.theme';\n\n@Component({\n selector: 'tx-countdown',\n imports: [NgTemplateOutlet],\n template: `\n @if (valueTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"context()\" />\n } @else {\n {{ text() }}\n }\n `,\n styleUrl: './countdown.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-countdown',\n role: 'timer',\n 'aria-atomic': 'true',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.aria-live]': 'ariaLive()',\n '[class.tx-countdown--ending]': 'isEnding()',\n '[class.tx-countdown--expired]': 'isExpired()',\n '[class.tx-countdown--paused]': 'paused()',\n },\n viewProviders: [provideTxIconDefaults(COUNTDOWN_ICON_DEFAULTS)],\n})\nexport class TxCountdown {\n private readonly countdownTheme = injectTokens(COUNTDOWN_THEME);\n\n readonly value = input<number | undefined, unknown>(undefined, { transform: optionalNumber });\n readonly unit = input<TxCountdownUnit>('seconds');\n readonly target = input<TxCountdownTarget>(undefined);\n readonly suffix = input<string>('');\n readonly format = input<TxCountdownFormat | undefined>(undefined);\n readonly endingSoon = input<number, unknown>(0, { transform: numberAttribute });\n readonly paused = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly ariaLive = input<'off' | 'polite' | 'assertive'>('off');\n readonly dt = input<TectraDeepPartial<TectraCountdownTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxCountdownPart, TxCountdown> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly completed = output<void>();\n readonly tick = output<number>();\n\n protected readonly valueTemplate = contentChild(TxCountdownValue);\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('countdown', this, this.pt, this.ptOptions);\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-countdown'), ...this.passThrough().root?.style }));\n\n private readonly now = signal(Date.now());\n private readonly deadline = signal<number | null>(null);\n private readonly frozen = signal<number | null>(null);\n private timer: ReturnType<typeof setTimeout> | null = null;\n private done = false;\n\n readonly resolvedFormat = computed<TxCountdownFormat>(() => this.format() ?? (this.target() !== undefined && this.value() === undefined ? 'clock' : 'number'));\n readonly remainingMs = computed(() => {\n const frozen = this.frozen();\n if (frozen !== null) return frozen;\n const deadline = this.deadline();\n return deadline === null ? 0 : Math.max(0, deadline - this.now());\n });\n readonly isExpired = computed(() => this.deadline() !== null && this.remainingMs() === 0);\n readonly isEnding = computed(() => this.remainingMs() > 0 && this.remainingMs() <= this.endingSoon());\n readonly text = computed(() => {\n const remaining = this.remainingMs();\n const display = this.resolvedFormat() === 'clock' ? formatRemaining(Math.ceil(remaining / 1000) * 1000) : String(Math.ceil(remaining / TX_COUNTDOWN_UNIT_MS[this.unit()]));\n return this.suffix() ? `${display} ${this.suffix()}` : display;\n });\n readonly context = computed<TxCountdownContext>(() => ({ $implicit: this.remainingMs(), ...splitRemaining(this.remainingMs()), expired: this.isExpired() }));\n\n private readonly start = effect(() => {\n const value = this.value();\n const unit = this.unit();\n const target = targetTime(this.target());\n untracked(() => {\n this.done = false;\n this.now.set(Date.now());\n const deadline = value !== undefined ? Date.now() + value * TX_COUNTDOWN_UNIT_MS[unit] : target;\n if (this.paused()) {\n this.deadline.set(deadline);\n this.frozen.set(deadline === null ? null : Math.max(0, deadline - Date.now()));\n } else {\n this.frozen.set(null);\n this.deadline.set(deadline);\n }\n });\n });\n\n private readonly pause = effect(() => {\n const paused = this.paused();\n untracked(() => {\n if (paused && this.frozen() === null && this.deadline() !== null) this.frozen.set(this.remainingMs());\n if (!paused && this.frozen() !== null) {\n this.deadline.set(Date.now() + (this.frozen() as number));\n this.now.set(Date.now());\n this.frozen.set(null);\n }\n });\n });\n\n private readonly refresh = effect(() => {\n this.resolvedFormat();\n this.endingSoon();\n untracked(() => this.now.set(Date.now()));\n });\n\n private readonly schedule = effect((onCleanup) => {\n const deadline = this.deadline();\n const frozen = this.frozen();\n this.now();\n if (deadline === null || frozen !== null) return;\n const remaining = deadline - Date.now();\n if (remaining <= 0) return;\n const step = this.resolvedFormat() === 'clock' || this.endingSoon() ? 1000 : TX_COUNTDOWN_UNIT_MS[this.unit()];\n const delay = remaining % step || step;\n this.timer = setTimeout(() => this.now.set(Date.now()), delay + 5);\n onCleanup(() => {\n if (this.timer) clearTimeout(this.timer);\n });\n });\n\n private readonly finish = effect(() => {\n const remaining = this.remainingMs();\n const expired = this.isExpired();\n untracked(() => {\n this.tick.emit(remaining);\n if (expired && !this.done) {\n this.done = true;\n this.completed.emit();\n }\n });\n });\n\n private readonly cleanup = inject(DestroyRef).onDestroy(() => {\n if (this.timer) clearTimeout(this.timer);\n });\n}\n"],"mappings":";;;;;;;AAGA,MAAa,uBAAwD;CACnE,SAAS;CACT,SAAS;CACT,OAAO;CACP,MAAM;AACP;AAKD,SAAgB,gBAAgB,IAA6B;CAC3D,MAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,OAAO,MAAM,KAAK,GAAI,CAAC;CACtD,MAAM,QAAQ,KAAK,MAAM,QAAQ,IAAI;CACrC,MAAM,UAAU,KAAK,MAAO,QAAQ,OAAQ,EAAE;CAC9C,MAAM,UAAU,QAAQ;CACxB,MAAM,OAAO,UAAkB,OAAO,KAAK,CAAC,CAAC,SAAS,GAAG,GAAG;CAC5D,OAAO,QAAQ,GAAG,MAAK,GAAI,I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AA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,IAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,IAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,WAAA;EAAA,CAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,MAAA;EAAA,CAAA;EAAA,eAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,gBAAgB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"tectra-ng-ui-countdown.mjs","names":[],"sources":["../../../../packages/ui/countdown/src/countdown.utils.ts","../../../../packages/ui/countdown/src/countdown.templates.ts","../../../../packages/ui/countdown/src/remaining-time.pipe.ts","../../../../packages/ui/countdown/src/countdown.icons.ts","../../../../packages/ui/countdown/src/countdown.theme.ts","../../../../packages/ui/countdown/src/countdown.component.ts"],"sourcesContent":["import { TxCountdownTarget, TxCountdownUnit } from './countdown.types';\n\n/** Length of each countdown unit in milliseconds. */\nexport const TX_COUNTDOWN_UNIT_MS: Record<TxCountdownUnit, number> = {\n seconds: 1000,\n minutes: 60000,\n hours: 3600000,\n days: 86400000,\n};\n\n/**\n * Formats remaining milliseconds as `mm:ss`, or `h:mm:ss` from one hour on; negative or empty values give `00:00`.\n */\nexport function formatRemaining(ms: number | null | undefined): string {\n const total = Math.max(0, Math.floor((ms ?? 0) / 1000));\n const hours = Math.floor(total / 3600);\n const minutes = Math.floor((total % 3600) / 60);\n const seconds = total % 60;\n const pad = (value: number) => String(value).padStart(2, '0');\n return hours ? `${hours}:${pad(minutes)}:${pad(seconds)}` : `${pad(minutes)}:${pad(seconds)}`;\n}\n\n/** Splits remaining milliseconds into days, hours, minutes and seconds, rounding partial seconds up. */\nexport function splitRemaining(ms: number): { days: number; hours: number; minutes: number; seconds: number } {\n const total = Math.max(0, Math.ceil(ms / 1000));\n return {\n days: Math.floor(total / 86400),\n hours: Math.floor((total % 86400) / 3600),\n minutes: Math.floor((total % 3600) / 60),\n seconds: total % 60,\n };\n}\n\n/** Reads a target as milliseconds since the epoch; `null` when it is empty or not a valid date. */\nexport function targetTime(value: TxCountdownTarget): number | null {\n if (value === null || value === undefined || value === '') return null;\n const time = new Date(value).getTime();\n return Number.isNaN(time) ? null : time;\n}\n","import { Directive, TemplateRef, inject } from '@angular/core';\nimport { TxCountdownContext } from './countdown.types';\n\n@Directive({ selector: 'ng-template[txCountdownValue]' })\nexport class TxCountdownValue {\n readonly templateRef = inject<TemplateRef<TxCountdownContext>>(TemplateRef);\n\n static ngTemplateContextGuard(_directive: TxCountdownValue, context: unknown): context is TxCountdownContext {\n return !!context;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { formatRemaining } from './countdown.utils';\n\n/** Formats remaining milliseconds as `mm:ss` or `h:mm:ss`, like `tx-countdown` with the `clock` format. */\n@Pipe({ name: 'txRemainingTime' })\nexport class TxRemainingTimePipe implements PipeTransform {\n transform(ms: number | null | undefined): string {\n return formatRemaining(ms);\n }\n}\n","import { TxIconSet, txIconClock } from '@tectra-ng/icons';\n\nexport const COUNTDOWN_ICON_DEFAULTS: TxIconSet = {\n clock: txIconClock,\n};\n","import { countdownTokens } from '@tectra-ng/themes';\n\nexport const COUNTDOWN_THEME = {\n countdown: countdownTokens,\n};\n","import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, DestroyRef, booleanAttribute, computed, contentChild, effect, inject, input, numberAttribute, output, signal, untracked } from '@angular/core';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { optionalBoolean, optionalNumber } from '@tectra-ng/core/utils';\nimport { TectraCountdownTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { TxCountdownValue } from './countdown.templates';\nimport { TxCountdownContext, TxCountdownFormat, TxCountdownPart, TxCountdownTarget, TxCountdownUnit } from './countdown.types';\nimport { TX_COUNTDOWN_UNIT_MS, formatRemaining, splitRemaining, targetTime } from './countdown.utils';\nimport { provideTxIconDefaults } from '@tectra-ng/icons';\nimport { COUNTDOWN_ICON_DEFAULTS } from './countdown.icons';\nimport { COUNTDOWN_THEME } from './countdown.theme';\n\n@Component({\n selector: 'tx-countdown',\n imports: [NgTemplateOutlet],\n template: `\n @if (valueTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"context()\" />\n } @else {\n {{ text() }}\n }\n `,\n styleUrl: './countdown.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-countdown',\n role: 'timer',\n 'aria-atomic': 'true',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.aria-live]': 'ariaLive()',\n '[class.tx-countdown--ending]': 'isEnding()',\n '[class.tx-countdown--expired]': 'isExpired()',\n '[class.tx-countdown--paused]': 'paused()',\n },\n viewProviders: [provideTxIconDefaults(COUNTDOWN_ICON_DEFAULTS)],\n})\nexport class TxCountdown {\n private readonly countdownTheme = injectTokens(COUNTDOWN_THEME);\n\n readonly value = input<number | undefined, unknown>(undefined, { transform: optionalNumber });\n readonly unit = input<TxCountdownUnit>('seconds');\n readonly target = input<TxCountdownTarget>(undefined);\n readonly suffix = input<string>('');\n readonly format = input<TxCountdownFormat | undefined>(undefined);\n readonly endingSoon = input<number, unknown>(0, { transform: numberAttribute });\n readonly paused = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly restartOnChange = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly ariaLive = input<'off' | 'polite' | 'assertive'>('off');\n readonly dt = input<TectraDeepPartial<TectraCountdownTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxCountdownPart, TxCountdown> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly completed = output<void>();\n readonly tick = output<number>();\n\n protected readonly valueTemplate = contentChild(TxCountdownValue);\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('countdown', this, this.pt, this.ptOptions);\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-countdown'), ...this.passThrough().root?.style }));\n\n private readonly now = signal(Date.now());\n private readonly deadline = signal<number | null>(null);\n private readonly frozen = signal<number | null>(null);\n private timer: ReturnType<typeof setTimeout> | null = null;\n private done = false;\n private countsValue = false;\n\n readonly resolvedFormat = computed<TxCountdownFormat>(() => this.format() ?? (this.target() !== undefined && this.value() === undefined ? 'clock' : 'number'));\n readonly remainingMs = computed(() => {\n const frozen = this.frozen();\n if (frozen !== null) return frozen;\n const deadline = this.deadline();\n return deadline === null ? 0 : Math.max(0, deadline - this.now());\n });\n readonly isExpired = computed(() => this.deadline() !== null && this.remainingMs() === 0);\n readonly isEnding = computed(() => this.remainingMs() > 0 && this.remainingMs() <= this.endingSoon());\n readonly text = computed(() => {\n const remaining = this.remainingMs();\n const display = this.resolvedFormat() === 'clock' ? formatRemaining(Math.ceil(remaining / 1000) * 1000) : String(Math.ceil(remaining / TX_COUNTDOWN_UNIT_MS[this.unit()]));\n return this.suffix() ? `${display} ${this.suffix()}` : display;\n });\n readonly context = computed<TxCountdownContext>(() => ({ $implicit: this.remainingMs(), ...splitRemaining(this.remainingMs()), expired: this.isExpired() }));\n\n private readonly start = effect(() => {\n const value = this.value();\n const unit = this.unit();\n const target = targetTime(this.target());\n untracked(() => {\n const running = this.deadline() !== null && !this.isExpired();\n if (!this.restartOnChange() && running && this.countsValue && value !== undefined) return;\n this.begin(value, unit, target);\n });\n });\n\n restart(): void {\n this.begin(this.value(), this.unit(), targetTime(this.target()));\n }\n\n private begin(value: number | undefined, unit: TxCountdownUnit, target: number | null): void {\n this.done = false;\n this.countsValue = value !== undefined;\n this.now.set(Date.now());\n const deadline = value !== undefined ? Date.now() + value * TX_COUNTDOWN_UNIT_MS[unit] : target;\n if (this.paused()) {\n this.deadline.set(deadline);\n this.frozen.set(deadline === null ? null : Math.max(0, deadline - Date.now()));\n } else {\n this.frozen.set(null);\n this.deadline.set(deadline);\n }\n }\n\n private readonly pause = effect(() => {\n const paused = this.paused();\n untracked(() => {\n if (paused && this.frozen() === null && this.deadline() !== null) this.frozen.set(this.remainingMs());\n if (!paused && this.frozen() !== null) {\n this.deadline.set(Date.now() + (this.frozen() as number));\n this.now.set(Date.now());\n this.frozen.set(null);\n }\n });\n });\n\n private readonly refresh = effect(() => {\n this.resolvedFormat();\n this.endingSoon();\n untracked(() => this.now.set(Date.now()));\n });\n\n private readonly schedule = effect((onCleanup) => {\n const deadline = this.deadline();\n const frozen = this.frozen();\n this.now();\n if (deadline === null || frozen !== null) return;\n const remaining = deadline - Date.now();\n if (remaining <= 0) return;\n const step = this.resolvedFormat() === 'clock' || this.endingSoon() ? 1000 : TX_COUNTDOWN_UNIT_MS[this.unit()];\n const delay = remaining % step || step;\n this.timer = setTimeout(() => this.now.set(Date.now()), delay + 5);\n onCleanup(() => {\n if (this.timer) clearTimeout(this.timer);\n });\n });\n\n private readonly finish = effect(() => {\n const remaining = this.remainingMs();\n const expired = this.isExpired();\n untracked(() => {\n this.tick.emit(remaining);\n if (expired && !this.done) {\n this.done = true;\n this.completed.emit();\n }\n });\n });\n\n private readonly cleanup = inject(DestroyRef).onDestroy(() => {\n if (this.timer) clearTimeout(this.timer);\n });\n}\n"],"mappings":";;;;;;;AAGA,MAAa,uBAAwD;CACnE,SAAS;CACT,SAAS;CACT,OAAO;CACP,MAAM;AACP;AAKD,SAAgB,gBAAgB,IAA6B;CAC3D,MAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,OAAO,MAAM,KAAK,GAAI,CAAC;CACtD,MAAM,QAAQ,KAAK,MAAM,QAAQ,IAAI;CACrC,MAAM,UAAU,KAAK,MAAO,QAAQ,OAAQ,EAAE;CAC9C,MAAM,UAAU,QAAQ;CACxB,MAAM,OAAO,UAAkB,OAAO,KAAK,CAAC,CAAC,SAAS,GAAG,GAAG;CAC5D,OAAO,QAAQ,GAAG,MAAK,GAAI,IAAI,OAAO,EAAC,GAAI,IAAI,OAAO,MAAM,GAAG,IAAI,OAAO,EAAC,GAAI,IAAI,OAAO;AAC5F;AAGA,SAAgB,eAAe,IAAU;CACvC,MAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,KAAK,KAAK,GAAI,CAAC;CAC9C,OAAO;EACL,MAAM,KAAK,MAAM,QAAQ,KAAK;EAC9B,OAAO,KAAK,MAAO,QAAQ,QAAS,IAAI;EACxC,SAAS,KAAK,MAAO,QAAQ,OAAQ,EAAE;EACvC,SAAS,QAAQ;CAClB;AACH;AAGA,SAAgB,WAAW,OAAwB;CACjD,IAAI,UAAU,QAAQ,UAAU,UAAa,UAAU,IAAI,OAAO;CAClE,MAAM,OAAO,IAAI,KAAK,KAAK,CAAC,CAAC,QAAO;CACpC,OAAO,OAAO,MAAM,IAAI,IAAI,OAAO;AACrC;AClCA,IAAa,mBAAb,MAAa,iBAAgB;CAClB,cAAc,OAAwC,WAAW;CAE1E,OAAO,uB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OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,IAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,IAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,WAAA;EAAA,CAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,MAAA;EAAA,CAAA;EAAA,eAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,gBAAgB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -3,15 +3,16 @@ import * as i0 from "@angular/core";
3
3
  import { ChangeDetectionStrategy, Component, booleanAttribute, computed, forwardRef, inject, input, output } from "@angular/core";
4
4
  import * as i1 from "@angular/forms";
5
5
  import { FormsModule, NG_VALUE_ACCESSOR } from "@angular/forms";
6
- import { TxFormControlBase } from "@tectra-ng/core/forms";
6
+ import { TxFormControlBase, injectFieldInvalid } from "@tectra-ng/core/forms";
7
7
  import { TxLocaleService } from "@tectra-ng/core/i18n";
8
8
  import { optionalBoolean } from "@tectra-ng/core/utils";
9
- import { TX_COUNTRY_CODES, TxCountry, countryName } from "@tectra-ng/ui/country";
9
+ import { TX_COUNTRY_CODES, TX_REGION_CODES, TxCountry, countryName, isCountryCode } from "@tectra-ng/ui/country";
10
10
  import { TxMultiselect } from "@tectra-ng/ui/multiselect";
11
11
  import { TxSelect, TxSelectOptionTemplate, TxSelectValueTemplate } from "@tectra-ng/ui/select";
12
12
  import { injectTokens } from "@tectra-ng/core/config";
13
13
  import { countryTokens } from "@tectra-ng/themes";
14
14
  const COUNTRY_SELECT_THEME = { country: countryTokens };
15
+ const FLAG_CODES = /* @__PURE__ */ new Set([...TX_COUNTRY_CODES, ...TX_REGION_CODES]);
15
16
  var TxCountrySelect = class TxCountrySelect extends TxFormControlBase {
16
17
  countrySelectTheme = injectTokens(COUNTRY_SELECT_THEME);
17
18
  locale = inject(TxLocaleService);
@@ -27,6 +28,7 @@ var TxCountrySelect = class TxCountrySelect extends TxFormControlBase {
27
28
  sort = input("name", ...ngDevMode ? [{ debugName: "sort" }] : /* istanbul ignore next */ []);
28
29
  shape = input("rectangle", ...ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []);
29
30
  maxFlags = input(3, ...ngDevMode ? [{ debugName: "maxFlags" }] : /* istanbul ignore next */ []);
31
+ maxNamed = input(1, ...ngDevMode ? [{ debugName: "maxNamed" }] : /* istanbul ignore next */ []);
30
32
  virtualScrollThreshold = input(50, ...ngDevMode ? [{ debugName: "virtualScrollThreshold" }] : /* istanbul ignore next */ []);
31
33
  placeholder = input("", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
32
34
  showClear = input(false, {
@@ -56,15 +58,18 @@ var TxCountrySelect = class TxCountrySelect extends TxFormControlBase {
56
58
  transform: optionalBoolean
57
59
  });
58
60
  changed = output();
61
+ isInvalid = injectFieldInvalid(this.invalid);
59
62
  items = computed(() => {
60
63
  const locale = this.locale.locale().intl;
61
64
  const items = (this.options() ?? TX_COUNTRY_CODES).map((option) => {
62
65
  const entry = typeof option === "string" ? { code: option } : option;
63
- const code = entry.code.trim().toUpperCase();
66
+ const trimmed = entry.code.trim();
67
+ const code = isCountryCode(trimmed) ? trimmed.toUpperCase() : trimmed;
64
68
  return {
65
69
  code,
66
70
  value: entry.value ?? code,
67
71
  label: entry.label ?? countryName(code, locale),
72
+ flag: entry.flag ?? FLAG_CODES.has(code),
68
73
  count: entry.count ?? null,
69
74
  hint: entry.hint ?? "",
70
75
  disabled: !!entry.disabled
@@ -83,6 +88,9 @@ var TxCountrySelect = class TxCountrySelect extends TxFormControlBase {
83
88
  firstFlags(items) {
84
89
  return items.slice(0, this.maxFlags()).map((item) => item.option);
85
90
  }
91
+ showsNames(items) {
92
+ return items.length <= this.maxNamed();
93
+ }
86
94
  onModelChange(value) {
87
95
  this.updateValue(value);
88
96
  this.changed.emit(value);
@@ -92,7 +100,7 @@ var TxCountrySelect = class TxCountrySelect extends TxFormControlBase {
92
100
  }
93
101
  static ɵfac = i0.ɵɵngDeclareFactory({
94
102
  minVersion: "12.0.0",
95
- version: "22.2.5",
103
+ version: "22.2.6",
96
104
  ngImport: i0,
97
105
  type: TxCountrySelect,
98
106
  deps: null,
@@ -100,7 +108,7 @@ var TxCountrySelect = class TxCountrySelect extends TxFormControlBase {
100
108
  });
101
109
  static ɵcmp = i0.ɵɵngDeclareComponent({
102
110
  minVersion: "17.0.0",
103
- version: "22.2.5",
111
+ version: "22.2.6",
104
112
  type: TxCountrySelect,
105
113
  isStandalone: true,
106
114
  selector: "tx-country-select",
@@ -147,6 +155,13 @@ var TxCountrySelect = class TxCountrySelect extends TxFormControlBase {
147
155
  isRequired: false,
148
156
  transformFunction: null
149
157
  },
158
+ maxNamed: {
159
+ classPropertyName: "maxNamed",
160
+ publicName: "maxNamed",
161
+ isSignal: true,
162
+ isRequired: false,
163
+ transformFunction: null
164
+ },
150
165
  virtualScrollThreshold: {
151
166
  classPropertyName: "virtualScrollThreshold",
152
167
  publicName: "virtualScrollThreshold",
@@ -251,7 +266,7 @@ var TxCountrySelect = class TxCountrySelect extends TxFormControlBase {
251
266
  }],
252
267
  usesInheritance: true,
253
268
  ngImport: i0,
254
- template: "@if (multiple()) {\n <tx-multiselect\n [options]=\"items()\"\n [optionLabel]=\"'label'\"\n [optionValue]=\"'value'\"\n [optionDisabled]=\"'disabled'\"\n [filter]=\"filter()\"\n [filterBy]=\"'label,code'\"\n [virtualScroll]=\"virtual()\"\n [placeholder]=\"placeholder()\"\n [showClear]=\"showClear()\"\n [loading]=\"loading()\"\n [inputId]=\"inputId()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [invalid]=\"invalid()\"\n [readonly]=\"readonly()\"\n [dt]=\"dt()\"\n [unstyled]=\"unstyled()\"\n [ngModel]=\"value()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [disabled]=\"disabled()\"\n (ngModelChange)=\"onModelChange($event)\"\n (closed)=\"onClosed()\"\n >\n <ng-template txSelectOption let-item>\n <ng-container [ngTemplateOutlet]=\"option\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </ng-template>\n <ng-template txSelectValue let-selected>\n <span class=\"tx-country-select__flags\" [class.tx-country-select__flags--styled]=\"!unstyled()\">\n @for (item of firstFlags(selected); track item.value) {\n <tx-country [country]=\"item.code\" [name]=\"item.label\" [showName]=\"selected.length === 1\" [shape]=\"shape()\" />\n }\n @if (extraCount(selected); as extra) {\n <span class=\"tx-country-select__more\">+{{ extra }}</span>\n }\n </span>\n </ng-template>\n </tx-multiselect>\n} @else {\n <tx-select\n [options]=\"items()\"\n [optionLabel]=\"'label'\"\n [optionValue]=\"'value'\"\n [optionDisabled]=\"'disabled'\"\n [filter]=\"filter()\"\n [filterBy]=\"'label,code'\"\n [virtualScroll]=\"virtual()\"\n [placeholder]=\"placeholder()\"\n [showClear]=\"showClear()\"\n [loading]=\"loading()\"\n [inputId]=\"inputId()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [invalid]=\"invalid()\"\n [readonly]=\"readonly()\"\n [dt]=\"dt()\"\n [unstyled]=\"unstyled()\"\n [ngModel]=\"value()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [disabled]=\"disabled()\"\n (ngModelChange)=\"onModelChange($event)\"\n (closed)=\"onClosed()\"\n >\n <ng-template txSelectOption let-item>\n <ng-container [ngTemplateOutlet]=\"option\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </ng-template>\n <ng-template txSelectValue let-item>\n <tx-country [country]=\"item.code\" [name]=\"item.label\" [shape]=\"shape()\" />\n </ng-template>\n </tx-select>\n}\n\n<ng-template #option let-item>\n <span class=\"tx-country-select__option\" [class.tx-country-select__option--styled]=\"!unstyled()\">\n <tx-country class=\"tx-country-select__country\" [country]=\"item.code\" [name]=\"item.label\" [shape]=\"shape()\" />\n @if (item.hint) {\n <span class=\"tx-country-select__hint\">{{ item.hint }}</span>\n }\n @if (item.count !== null) {\n <span class=\"tx-country-select__count\">{{ item.count }}</span>\n }\n </span>\n</ng-template>\n",
269
+ template: "@if (multiple()) {\n <tx-multiselect\n [options]=\"items()\"\n [optionLabel]=\"'label'\"\n [optionValue]=\"'value'\"\n [optionDisabled]=\"'disabled'\"\n [filter]=\"filter()\"\n [filterBy]=\"'label,code'\"\n [virtualScroll]=\"virtual()\"\n [placeholder]=\"placeholder()\"\n [showClear]=\"showClear()\"\n [loading]=\"loading()\"\n [inputId]=\"inputId()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [invalid]=\"isInvalid()\"\n [readonly]=\"readonly()\"\n [dt]=\"dt()\"\n [unstyled]=\"unstyled()\"\n [ngModel]=\"value()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [disabled]=\"disabled()\"\n (ngModelChange)=\"onModelChange($event)\"\n (closed)=\"onClosed()\"\n >\n <ng-template txSelectOption let-item>\n <ng-container [ngTemplateOutlet]=\"option\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </ng-template>\n <ng-template txSelectValue let-selected>\n <span class=\"tx-country-select__flags\" [class.tx-country-select__flags--styled]=\"!unstyled()\">\n @for (item of firstFlags(selected); track item.value) {\n <tx-country [country]=\"item.flag ? item.code : null\" [name]=\"item.label\" [showName]=\"!item.flag || showsNames(selected)\" [shape]=\"shape()\" />\n }\n @if (extraCount(selected); as extra) {\n <span class=\"tx-country-select__more\">+{{ extra }}</span>\n }\n </span>\n </ng-template>\n </tx-multiselect>\n} @else {\n <tx-select\n [options]=\"items()\"\n [optionLabel]=\"'label'\"\n [optionValue]=\"'value'\"\n [optionDisabled]=\"'disabled'\"\n [filter]=\"filter()\"\n [filterBy]=\"'label,code'\"\n [virtualScroll]=\"virtual()\"\n [placeholder]=\"placeholder()\"\n [showClear]=\"showClear()\"\n [loading]=\"loading()\"\n [inputId]=\"inputId()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [invalid]=\"isInvalid()\"\n [readonly]=\"readonly()\"\n [dt]=\"dt()\"\n [unstyled]=\"unstyled()\"\n [ngModel]=\"value()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [disabled]=\"disabled()\"\n (ngModelChange)=\"onModelChange($event)\"\n (closed)=\"onClosed()\"\n >\n <ng-template txSelectOption let-item>\n <ng-container [ngTemplateOutlet]=\"option\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </ng-template>\n <ng-template txSelectValue let-item>\n <tx-country [country]=\"item.flag ? item.code : null\" [name]=\"item.label\" [shape]=\"shape()\" />\n </ng-template>\n </tx-select>\n}\n\n<ng-template #option let-item>\n <span class=\"tx-country-select__option\" [class.tx-country-select__option--styled]=\"!unstyled()\">\n <tx-country class=\"tx-country-select__country\" [country]=\"item.flag ? item.code : null\" [name]=\"item.label\" [shape]=\"shape()\" />\n @if (item.hint) {\n <span class=\"tx-country-select__hint\">{{ item.hint }}</span>\n }\n @if (item.count !== null) {\n <span class=\"tx-country-select__count\">{{ item.count }}</span>\n }\n </span>\n</ng-template>\n",
255
270
  styles: [":host{display:block;width:100%}.tx-country-select__option{display:flex;align-items:center;min-width:0}.tx-country-select__country{flex:0 1 auto}.tx-country-select__flags{display:inline-flex;align-items:center;vertical-align:middle}.tx-country-select__option--styled,.tx-country-select__flags--styled{gap:var(--tx-country-gap)}.tx-country-select__option--styled .tx-country-select__hint{overflow:hidden;color:var(--tx-country-hint-color);font-size:var(--tx-country-count-font-size);text-overflow:ellipsis;white-space:nowrap}.tx-country-select__option--styled .tx-country-select__count{margin-inline-start:auto;color:var(--tx-country-count-color);font-size:var(--tx-country-count-font-size);font-variant-numeric:tabular-nums}.tx-country-select__flags--styled .tx-country-select__more{color:var(--tx-country-hint-color);font-size:var(--tx-country-count-font-size)}\n"],
256
271
  dependencies: [
257
272
  {
@@ -357,7 +372,7 @@ var TxCountrySelect = class TxCountrySelect extends TxFormControlBase {
357
372
  };
358
373
  i0.ɵɵngDeclareClassMetadata({
359
374
  minVersion: "12.0.0",
360
- version: "22.2.5",
375
+ version: "22.2.6",
361
376
  ngImport: i0,
362
377
  type: TxCountrySelect,
363
378
  decorators: [{
@@ -383,7 +398,7 @@ i0.ɵɵngDeclareClassMetadata({
383
398
  class: "tx-country-select",
384
399
  "[attr.data-styled]": "unstyled() ? null : true"
385
400
  },
386
- template: "@if (multiple()) {\n <tx-multiselect\n [options]=\"items()\"\n [optionLabel]=\"'label'\"\n [optionValue]=\"'value'\"\n [optionDisabled]=\"'disabled'\"\n [filter]=\"filter()\"\n [filterBy]=\"'label,code'\"\n [virtualScroll]=\"virtual()\"\n [placeholder]=\"placeholder()\"\n [showClear]=\"showClear()\"\n [loading]=\"loading()\"\n [inputId]=\"inputId()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [invalid]=\"invalid()\"\n [readonly]=\"readonly()\"\n [dt]=\"dt()\"\n [unstyled]=\"unstyled()\"\n [ngModel]=\"value()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [disabled]=\"disabled()\"\n (ngModelChange)=\"onModelChange($event)\"\n (closed)=\"onClosed()\"\n >\n <ng-template txSelectOption let-item>\n <ng-container [ngTemplateOutlet]=\"option\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </ng-template>\n <ng-template txSelectValue let-selected>\n <span class=\"tx-country-select__flags\" [class.tx-country-select__flags--styled]=\"!unstyled()\">\n @for (item of firstFlags(selected); track item.value) {\n <tx-country [country]=\"item.code\" [name]=\"item.label\" [showName]=\"selected.length === 1\" [shape]=\"shape()\" />\n }\n @if (extraCount(selected); as extra) {\n <span class=\"tx-country-select__more\">+{{ extra }}</span>\n }\n </span>\n </ng-template>\n </tx-multiselect>\n} @else {\n <tx-select\n [options]=\"items()\"\n [optionLabel]=\"'label'\"\n [optionValue]=\"'value'\"\n [optionDisabled]=\"'disabled'\"\n [filter]=\"filter()\"\n [filterBy]=\"'label,code'\"\n [virtualScroll]=\"virtual()\"\n [placeholder]=\"placeholder()\"\n [showClear]=\"showClear()\"\n [loading]=\"loading()\"\n [inputId]=\"inputId()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [invalid]=\"invalid()\"\n [readonly]=\"readonly()\"\n [dt]=\"dt()\"\n [unstyled]=\"unstyled()\"\n [ngModel]=\"value()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [disabled]=\"disabled()\"\n (ngModelChange)=\"onModelChange($event)\"\n (closed)=\"onClosed()\"\n >\n <ng-template txSelectOption let-item>\n <ng-container [ngTemplateOutlet]=\"option\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </ng-template>\n <ng-template txSelectValue let-item>\n <tx-country [country]=\"item.code\" [name]=\"item.label\" [shape]=\"shape()\" />\n </ng-template>\n </tx-select>\n}\n\n<ng-template #option let-item>\n <span class=\"tx-country-select__option\" [class.tx-country-select__option--styled]=\"!unstyled()\">\n <tx-country class=\"tx-country-select__country\" [country]=\"item.code\" [name]=\"item.label\" [shape]=\"shape()\" />\n @if (item.hint) {\n <span class=\"tx-country-select__hint\">{{ item.hint }}</span>\n }\n @if (item.count !== null) {\n <span class=\"tx-country-select__count\">{{ item.count }}</span>\n }\n </span>\n</ng-template>\n",
401
+ template: "@if (multiple()) {\n <tx-multiselect\n [options]=\"items()\"\n [optionLabel]=\"'label'\"\n [optionValue]=\"'value'\"\n [optionDisabled]=\"'disabled'\"\n [filter]=\"filter()\"\n [filterBy]=\"'label,code'\"\n [virtualScroll]=\"virtual()\"\n [placeholder]=\"placeholder()\"\n [showClear]=\"showClear()\"\n [loading]=\"loading()\"\n [inputId]=\"inputId()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [invalid]=\"isInvalid()\"\n [readonly]=\"readonly()\"\n [dt]=\"dt()\"\n [unstyled]=\"unstyled()\"\n [ngModel]=\"value()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [disabled]=\"disabled()\"\n (ngModelChange)=\"onModelChange($event)\"\n (closed)=\"onClosed()\"\n >\n <ng-template txSelectOption let-item>\n <ng-container [ngTemplateOutlet]=\"option\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </ng-template>\n <ng-template txSelectValue let-selected>\n <span class=\"tx-country-select__flags\" [class.tx-country-select__flags--styled]=\"!unstyled()\">\n @for (item of firstFlags(selected); track item.value) {\n <tx-country [country]=\"item.flag ? item.code : null\" [name]=\"item.label\" [showName]=\"!item.flag || showsNames(selected)\" [shape]=\"shape()\" />\n }\n @if (extraCount(selected); as extra) {\n <span class=\"tx-country-select__more\">+{{ extra }}</span>\n }\n </span>\n </ng-template>\n </tx-multiselect>\n} @else {\n <tx-select\n [options]=\"items()\"\n [optionLabel]=\"'label'\"\n [optionValue]=\"'value'\"\n [optionDisabled]=\"'disabled'\"\n [filter]=\"filter()\"\n [filterBy]=\"'label,code'\"\n [virtualScroll]=\"virtual()\"\n [placeholder]=\"placeholder()\"\n [showClear]=\"showClear()\"\n [loading]=\"loading()\"\n [inputId]=\"inputId()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [invalid]=\"isInvalid()\"\n [readonly]=\"readonly()\"\n [dt]=\"dt()\"\n [unstyled]=\"unstyled()\"\n [ngModel]=\"value()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [disabled]=\"disabled()\"\n (ngModelChange)=\"onModelChange($event)\"\n (closed)=\"onClosed()\"\n >\n <ng-template txSelectOption let-item>\n <ng-container [ngTemplateOutlet]=\"option\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </ng-template>\n <ng-template txSelectValue let-item>\n <tx-country [country]=\"item.flag ? item.code : null\" [name]=\"item.label\" [shape]=\"shape()\" />\n </ng-template>\n </tx-select>\n}\n\n<ng-template #option let-item>\n <span class=\"tx-country-select__option\" [class.tx-country-select__option--styled]=\"!unstyled()\">\n <tx-country class=\"tx-country-select__country\" [country]=\"item.flag ? item.code : null\" [name]=\"item.label\" [shape]=\"shape()\" />\n @if (item.hint) {\n <span class=\"tx-country-select__hint\">{{ item.hint }}</span>\n }\n @if (item.count !== null) {\n <span class=\"tx-country-select__count\">{{ item.count }}</span>\n }\n </span>\n</ng-template>\n",
387
402
  styles: [":host{display:block;width:100%}.tx-country-select__option{display:flex;align-items:center;min-width:0}.tx-country-select__country{flex:0 1 auto}.tx-country-select__flags{display:inline-flex;align-items:center;vertical-align:middle}.tx-country-select__option--styled,.tx-country-select__flags--styled{gap:var(--tx-country-gap)}.tx-country-select__option--styled .tx-country-select__hint{overflow:hidden;color:var(--tx-country-hint-color);font-size:var(--tx-country-count-font-size);text-overflow:ellipsis;white-space:nowrap}.tx-country-select__option--styled .tx-country-select__count{margin-inline-start:auto;color:var(--tx-country-count-color);font-size:var(--tx-country-count-font-size);font-variant-numeric:tabular-nums}.tx-country-select__flags--styled .tx-country-select__more{color:var(--tx-country-hint-color);font-size:var(--tx-country-count-font-size)}\n"]
388
403
  }]
389
404
  }],
@@ -436,6 +451,14 @@ i0.ɵɵngDeclareClassMetadata({
436
451
  required: false
437
452
  }]
438
453
  }],
454
+ maxNamed: [{
455
+ type: i0.Input,
456
+ args: [{
457
+ isSignal: true,
458
+ alias: "maxNamed",
459
+ required: false
460
+ }]
461
+ }],
439
462
  virtualScrollThreshold: [{
440
463
  type: i0.Input,
441
464
  args: [{
@@ -1 +1 @@
1
- {"version":3,"file":"tectra-ng-ui-country-select.mjs","names":[],"sources":["../../../../packages/ui/country-select/src/country-select.theme.ts","../../../../packages/ui/country-select/src/country-select.component.ts","../../../../packages/ui/country-select/src/country-select.component.html"],"sourcesContent":["import { countryTokens } from '@tectra-ng/themes';\n\nexport const COUNTRY_SELECT_THEME = {\n country: countryTokens,\n};\n","import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, booleanAttribute, computed, forwardRef, inject, input, output } from '@angular/core';\nimport { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TxFormControlBase } from '@tectra-ng/core/forms';\nimport { TxLocaleService } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraDeepPartial, TectraSelectTokens } from '@tectra-ng/themes';\nimport { TX_COUNTRY_CODES, TxCountry, TxFlagShape, countryName } from '@tectra-ng/ui/country';\nimport { TxMultiselect } from '@tectra-ng/ui/multiselect';\nimport { TxFieldVariant, TxSelect, TxSelectItem, TxSelectOptionTemplate, TxSelectSize, TxSelectValueTemplate } from '@tectra-ng/ui/select';\nimport { TxCountryItem, TxCountryOption, TxCountrySort } from './country-select.types';\nimport { injectTokens } from '@tectra-ng/core/config';\nimport { COUNTRY_SELECT_THEME } from './country-select.theme';\n\n@Component({\n selector: 'tx-country-select',\n imports: [FormsModule, NgTemplateOutlet, TxSelect, TxMultiselect, TxSelectOptionTemplate, TxSelectValueTemplate, TxCountry],\n templateUrl: './country-select.component.html',\n styleUrl: './country-select.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => TxCountrySelect), multi: true }],\n host: {\n class: 'tx-country-select',\n '[attr.data-styled]': 'unstyled() ? null : true',\n },\n})\nexport class TxCountrySelect extends TxFormControlBase<string | string[]> {\n private readonly countrySelectTheme = injectTokens(COUNTRY_SELECT_THEME);\n\n private locale = inject(TxLocaleService);\n\n readonly options = input<readonly (string | TxCountryOption)[] | undefined>(undefined);\n readonly multiple = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly filter = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly sort = input<TxCountrySort>('name');\n readonly shape = input<TxFlagShape>('rectangle');\n readonly maxFlags = input<number>(3);\n readonly virtualScrollThreshold = input<number>(50);\n readonly placeholder = input<string>('');\n readonly showClear = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly loading = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly inputId = input<string | undefined>(undefined);\n readonly ariaLabel = input<string | undefined>(undefined);\n readonly ariaLabelledBy = input<string | undefined>(undefined);\n readonly size = input<TxSelectSize>('medium');\n readonly variant = input<TxFieldVariant>('outlined');\n readonly invalid = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n readonly readonly = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly dt = input<TectraDeepPartial<TectraSelectTokens> | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly changed = output<string | string[] | null>();\n\n readonly items = computed<TxCountryItem[]>(() => {\n const locale = this.locale.locale().intl;\n const items = (this.options() ?? TX_COUNTRY_CODES).map((option) => {\n const entry: TxCountryOption = typeof option === 'string' ? { code: option } : option;\n const code = entry.code.trim().toUpperCase();\n return {\n code,\n value: entry.value ?? code,\n label: entry.label ?? countryName(code, locale),\n count: entry.count ?? null,\n hint: entry.hint ?? '',\n disabled: !!entry.disabled,\n };\n });\n if (this.sort() === 'name') {\n const collator = new Intl.Collator(locale);\n items.sort((a, b) => collator.compare(a.label, b.label));\n }\n return items;\n });\n readonly virtual = computed(() => this.items().length > this.virtualScrollThreshold());\n\n extraCount(items: TxSelectItem[]): number {\n return Math.max(0, items.length - this.maxFlags());\n }\n\n firstFlags(items: TxSelectItem[]): TxCountryItem[] {\n return items.slice(0, this.maxFlags()).map((item) => item.option as TxCountryItem);\n }\n\n onModelChange(value: string | string[] | null): void {\n this.updateValue(value);\n this.changed.emit(value);\n }\n\n onClosed(): void {\n this.markTouched();\n }\n}\n","@if (multiple()) {\n <tx-multiselect\n [options]=\"items()\"\n [optionLabel]=\"'label'\"\n [optionValue]=\"'value'\"\n [optionDisabled]=\"'disabled'\"\n [filter]=\"filter()\"\n [filterBy]=\"'label,code'\"\n [virtualScroll]=\"virtual()\"\n [placeholder]=\"placeholder()\"\n [showClear]=\"showClear()\"\n [loading]=\"loading()\"\n [inputId]=\"inputId()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [invalid]=\"invalid()\"\n [readonly]=\"readonly()\"\n [dt]=\"dt()\"\n [unstyled]=\"unstyled()\"\n [ngModel]=\"value()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [disabled]=\"disabled()\"\n (ngModelChange)=\"onModelChange($event)\"\n (closed)=\"onClosed()\"\n >\n <ng-template txSelectOption let-item>\n <ng-container [ngTemplateOutlet]=\"option\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </ng-template>\n <ng-template txSelectValue let-selected>\n <span class=\"tx-country-select__flags\" [class.tx-country-select__flags--styled]=\"!unstyled()\">\n @for (item of firstFlags(selected); track item.value) {\n <tx-country [country]=\"item.code\" [name]=\"item.label\" [showName]=\"selected.length === 1\" [shape]=\"shape()\" />\n }\n @if (extraCount(selected); as extra) {\n <span class=\"tx-country-select__more\">+{{ extra }}</span>\n }\n </span>\n </ng-template>\n </tx-multiselect>\n} @else {\n <tx-select\n [options]=\"items()\"\n [optionLabel]=\"'label'\"\n [optionValue]=\"'value'\"\n [optionDisabled]=\"'disabled'\"\n [filter]=\"filter()\"\n [filterBy]=\"'label,code'\"\n [virtualScroll]=\"virtual()\"\n [placeholder]=\"placeholder()\"\n [showClear]=\"showClear()\"\n [loading]=\"loading()\"\n [inputId]=\"inputId()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [invalid]=\"invalid()\"\n [readonly]=\"readonly()\"\n [dt]=\"dt()\"\n [unstyled]=\"unstyled()\"\n [ngModel]=\"value()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [disabled]=\"disabled()\"\n (ngModelChange)=\"onModelChange($event)\"\n (closed)=\"onClosed()\"\n >\n <ng-template txSelectOption let-item>\n <ng-container [ngTemplateOutlet]=\"option\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </ng-template>\n <ng-template txSelectValue let-item>\n <tx-country [country]=\"item.code\" [name]=\"item.label\" [shape]=\"shape()\" />\n </ng-template>\n </tx-select>\n}\n\n<ng-template #option let-item>\n <span class=\"tx-country-select__option\" [class.tx-country-select__option--styled]=\"!unstyled()\">\n <tx-country class=\"tx-country-select__country\" [country]=\"item.code\" [name]=\"item.label\" [shape]=\"shape()\" />\n @if (item.hint) {\n <span class=\"tx-country-select__hint\">{{ item.hint }}</span>\n }\n @if (item.count !== null) {\n <span class=\"tx-country-select__count\">{{ item.count }}</span>\n }\n </span>\n</ng-template>\n"],"mappings":";;;;;;;;;;;;;AAEA,MAAa,uBAAuB,EAClC,SA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S;GAAC,iBAG1G,wBAAwB;GAAM,WACpC,CAAC;IAAE,SAAS;IAAmB,aAAa,iBAAgB,eAAgB;IAAG,OAAO;GAAI,CAAE;GAAC,MAClG;IACJ,OAAO;IACP,sBAAsB;GACvB;GAAA,UAAA;GAAA,QAAA,CAAA,i2BAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"tectra-ng-ui-country-select.mjs","names":[],"sources":["../../../../packages/ui/country-select/src/country-select.theme.ts","../../../../packages/ui/country-select/src/country-select.component.ts","../../../../packages/ui/country-select/src/country-select.component.html"],"sourcesContent":["import { countryTokens } from '@tectra-ng/themes';\n\nexport const COUNTRY_SELECT_THEME = {\n country: countryTokens,\n};\n","import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, booleanAttribute, computed, forwardRef, inject, input, output } from '@angular/core';\nimport { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TxFormControlBase, injectFieldInvalid } from '@tectra-ng/core/forms';\nimport { TxLocaleService } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraDeepPartial, TectraSelectTokens } from '@tectra-ng/themes';\nimport { TX_COUNTRY_CODES, TX_REGION_CODES, TxCountry, TxFlagShape, countryName, isCountryCode } from '@tectra-ng/ui/country';\nimport { TxMultiselect } from '@tectra-ng/ui/multiselect';\nimport { TxFieldVariant, TxSelect, TxSelectItem, TxSelectOptionTemplate, TxSelectSize, TxSelectValueTemplate } from '@tectra-ng/ui/select';\nimport { TxCountryItem, TxCountryOption, TxCountrySort } from './country-select.types';\nimport { injectTokens } from '@tectra-ng/core/config';\nimport { COUNTRY_SELECT_THEME } from './country-select.theme';\n\nconst FLAG_CODES = new Set([...TX_COUNTRY_CODES, ...TX_REGION_CODES]);\n\n@Component({\n selector: 'tx-country-select',\n imports: [FormsModule, NgTemplateOutlet, TxSelect, TxMultiselect, TxSelectOptionTemplate, TxSelectValueTemplate, TxCountry],\n templateUrl: './country-select.component.html',\n styleUrl: './country-select.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => TxCountrySelect), multi: true }],\n host: {\n class: 'tx-country-select',\n '[attr.data-styled]': 'unstyled() ? null : true',\n },\n})\nexport class TxCountrySelect extends TxFormControlBase<string | string[]> {\n private readonly countrySelectTheme = injectTokens(COUNTRY_SELECT_THEME);\n\n private locale = inject(TxLocaleService);\n\n readonly options = input<readonly (string | TxCountryOption)[] | undefined>(undefined);\n readonly multiple = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly filter = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly sort = input<TxCountrySort>('name');\n readonly shape = input<TxFlagShape>('rectangle');\n readonly maxFlags = input<number>(3);\n readonly maxNamed = input<number>(1);\n readonly virtualScrollThreshold = input<number>(50);\n readonly placeholder = input<string>('');\n readonly showClear = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly loading = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly inputId = input<string | undefined>(undefined);\n readonly ariaLabel = input<string | undefined>(undefined);\n readonly ariaLabelledBy = input<string | undefined>(undefined);\n readonly size = input<TxSelectSize>('medium');\n readonly variant = input<TxFieldVariant>('outlined');\n readonly invalid = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n readonly readonly = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly dt = input<TectraDeepPartial<TectraSelectTokens> | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly changed = output<string | string[] | null>();\n\n readonly isInvalid = injectFieldInvalid(this.invalid);\n\n readonly items = computed<TxCountryItem[]>(() => {\n const locale = this.locale.locale().intl;\n const items = (this.options() ?? TX_COUNTRY_CODES).map((option) => {\n const entry: TxCountryOption = typeof option === 'string' ? { code: option } : option;\n const trimmed = entry.code.trim();\n const code = isCountryCode(trimmed) ? trimmed.toUpperCase() : trimmed;\n return {\n code,\n value: entry.value ?? code,\n label: entry.label ?? countryName(code, locale),\n flag: entry.flag ?? FLAG_CODES.has(code),\n count: entry.count ?? null,\n hint: entry.hint ?? '',\n disabled: !!entry.disabled,\n };\n });\n if (this.sort() === 'name') {\n const collator = new Intl.Collator(locale);\n items.sort((a, b) => collator.compare(a.label, b.label));\n }\n return items;\n });\n readonly virtual = computed(() => this.items().length > this.virtualScrollThreshold());\n\n extraCount(items: TxSelectItem[]): number {\n return Math.max(0, items.length - this.maxFlags());\n }\n\n firstFlags(items: TxSelectItem[]): TxCountryItem[] {\n return items.slice(0, this.maxFlags()).map((item) => item.option as TxCountryItem);\n }\n\n showsNames(items: TxSelectItem[]): boolean {\n return items.length <= this.maxNamed();\n }\n\n onModelChange(value: string | string[] | null): void {\n this.updateValue(value);\n this.changed.emit(value);\n }\n\n onClosed(): void {\n this.markTouched();\n }\n}\n","@if (multiple()) {\n <tx-multiselect\n [options]=\"items()\"\n [optionLabel]=\"'label'\"\n [optionValue]=\"'value'\"\n [optionDisabled]=\"'disabled'\"\n [filter]=\"filter()\"\n [filterBy]=\"'label,code'\"\n [virtualScroll]=\"virtual()\"\n [placeholder]=\"placeholder()\"\n [showClear]=\"showClear()\"\n [loading]=\"loading()\"\n [inputId]=\"inputId()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [invalid]=\"isInvalid()\"\n [readonly]=\"readonly()\"\n [dt]=\"dt()\"\n [unstyled]=\"unstyled()\"\n [ngModel]=\"value()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [disabled]=\"disabled()\"\n (ngModelChange)=\"onModelChange($event)\"\n (closed)=\"onClosed()\"\n >\n <ng-template txSelectOption let-item>\n <ng-container [ngTemplateOutlet]=\"option\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </ng-template>\n <ng-template txSelectValue let-selected>\n <span class=\"tx-country-select__flags\" [class.tx-country-select__flags--styled]=\"!unstyled()\">\n @for (item of firstFlags(selected); track item.value) {\n <tx-country [country]=\"item.flag ? item.code : null\" [name]=\"item.label\" [showName]=\"!item.flag || showsNames(selected)\" [shape]=\"shape()\" />\n }\n @if (extraCount(selected); as extra) {\n <span class=\"tx-country-select__more\">+{{ extra }}</span>\n }\n </span>\n </ng-template>\n </tx-multiselect>\n} @else {\n <tx-select\n [options]=\"items()\"\n [optionLabel]=\"'label'\"\n [optionValue]=\"'value'\"\n [optionDisabled]=\"'disabled'\"\n [filter]=\"filter()\"\n [filterBy]=\"'label,code'\"\n [virtualScroll]=\"virtual()\"\n [placeholder]=\"placeholder()\"\n [showClear]=\"showClear()\"\n [loading]=\"loading()\"\n [inputId]=\"inputId()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [invalid]=\"isInvalid()\"\n [readonly]=\"readonly()\"\n [dt]=\"dt()\"\n [unstyled]=\"unstyled()\"\n [ngModel]=\"value()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [disabled]=\"disabled()\"\n (ngModelChange)=\"onModelChange($event)\"\n (closed)=\"onClosed()\"\n >\n <ng-template txSelectOption let-item>\n <ng-container [ngTemplateOutlet]=\"option\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </ng-template>\n <ng-template txSelectValue let-item>\n <tx-country [country]=\"item.flag ? item.code : null\" [name]=\"item.label\" [shape]=\"shape()\" />\n </ng-template>\n </tx-select>\n}\n\n<ng-template #option let-item>\n <span class=\"tx-country-select__option\" [class.tx-country-select__option--styled]=\"!unstyled()\">\n <tx-country class=\"tx-country-select__country\" [country]=\"item.flag ? item.code : null\" [name]=\"item.label\" [shape]=\"shape()\" />\n @if (item.hint) {\n <span class=\"tx-country-select__hint\">{{ item.hint }}</span>\n }\n @if (item.count !== null) {\n <span class=\"tx-country-select__count\">{{ item.count }}</span>\n }\n </span>\n</ng-template>\n"],"mappings":";;;;;;;;;;;;;A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