@tectra-ng/ui 0.4.4 → 0.4.6

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 (180) 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 +11 -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-amount.mjs +96 -14
  14. package/fesm2022/tectra-ng-ui-amount.mjs.map +1 -1
  15. package/fesm2022/tectra-ng-ui-analog-clock.mjs +6 -19
  16. package/fesm2022/tectra-ng-ui-analog-clock.mjs.map +1 -1
  17. package/fesm2022/tectra-ng-ui-autocomplete.mjs +5 -4
  18. package/fesm2022/tectra-ng-ui-autocomplete.mjs.map +1 -1
  19. package/fesm2022/tectra-ng-ui-avatar.mjs +59 -17
  20. package/fesm2022/tectra-ng-ui-avatar.mjs.map +1 -1
  21. package/fesm2022/tectra-ng-ui-button.mjs +2 -2
  22. package/fesm2022/tectra-ng-ui-button.mjs.map +1 -1
  23. package/fesm2022/tectra-ng-ui-card.mjs +2 -2
  24. package/fesm2022/tectra-ng-ui-card.mjs.map +1 -1
  25. package/fesm2022/tectra-ng-ui-cascade-select.mjs +7 -4
  26. package/fesm2022/tectra-ng-ui-cascade-select.mjs.map +1 -1
  27. package/fesm2022/tectra-ng-ui-chips-input.mjs +142 -22
  28. package/fesm2022/tectra-ng-ui-chips-input.mjs.map +1 -1
  29. package/fesm2022/tectra-ng-ui-color-picker.mjs +93 -6
  30. package/fesm2022/tectra-ng-ui-color-picker.mjs.map +1 -1
  31. package/fesm2022/tectra-ng-ui-countdown.mjs +39 -10
  32. package/fesm2022/tectra-ng-ui-countdown.mjs.map +1 -1
  33. package/fesm2022/tectra-ng-ui-country-select.mjs +28 -5
  34. package/fesm2022/tectra-ng-ui-country-select.mjs.map +1 -1
  35. package/fesm2022/tectra-ng-ui-country.mjs +15 -6
  36. package/fesm2022/tectra-ng-ui-country.mjs.map +1 -1
  37. package/fesm2022/tectra-ng-ui-datepicker.mjs +10 -8
  38. package/fesm2022/tectra-ng-ui-datepicker.mjs.map +1 -1
  39. package/fesm2022/tectra-ng-ui-dialog.mjs +6 -6
  40. package/fesm2022/tectra-ng-ui-dialog.mjs.map +1 -1
  41. package/fesm2022/tectra-ng-ui-export.mjs +1237 -84
  42. package/fesm2022/tectra-ng-ui-export.mjs.map +1 -1
  43. package/fesm2022/tectra-ng-ui-field.mjs +1 -0
  44. package/fesm2022/tectra-ng-ui-field.mjs.map +1 -1
  45. package/fesm2022/tectra-ng-ui-fieldset.mjs +2 -2
  46. package/fesm2022/tectra-ng-ui-fieldset.mjs.map +1 -1
  47. package/fesm2022/tectra-ng-ui-icon-field.mjs +51 -23
  48. package/fesm2022/tectra-ng-ui-icon-field.mjs.map +1 -1
  49. package/fesm2022/tectra-ng-ui-input-number.mjs +2 -2
  50. package/fesm2022/tectra-ng-ui-input-number.mjs.map +1 -1
  51. package/fesm2022/tectra-ng-ui-input.mjs +5 -4
  52. package/fesm2022/tectra-ng-ui-input.mjs.map +1 -1
  53. package/fesm2022/tectra-ng-ui-key-filter.mjs +84 -19
  54. package/fesm2022/tectra-ng-ui-key-filter.mjs.map +1 -1
  55. package/fesm2022/tectra-ng-ui-knob.mjs +24 -2
  56. package/fesm2022/tectra-ng-ui-knob.mjs.map +1 -1
  57. package/fesm2022/tectra-ng-ui-label.mjs +68 -9
  58. package/fesm2022/tectra-ng-ui-label.mjs.map +1 -1
  59. package/fesm2022/tectra-ng-ui-link.mjs +38 -14
  60. package/fesm2022/tectra-ng-ui-link.mjs.map +1 -1
  61. package/fesm2022/tectra-ng-ui-mention-textarea.mjs +16 -5
  62. package/fesm2022/tectra-ng-ui-mention-textarea.mjs.map +1 -1
  63. package/fesm2022/tectra-ng-ui-message.mjs +17 -7
  64. package/fesm2022/tectra-ng-ui-message.mjs.map +1 -1
  65. package/fesm2022/tectra-ng-ui-month-calendar.mjs +26 -9
  66. package/fesm2022/tectra-ng-ui-month-calendar.mjs.map +1 -1
  67. package/fesm2022/tectra-ng-ui-multiselect.mjs +3 -2
  68. package/fesm2022/tectra-ng-ui-multiselect.mjs.map +1 -1
  69. package/fesm2022/tectra-ng-ui-panel-menu.mjs +45 -14
  70. package/fesm2022/tectra-ng-ui-panel-menu.mjs.map +1 -1
  71. package/fesm2022/tectra-ng-ui-panel.mjs +4 -2
  72. package/fesm2022/tectra-ng-ui-panel.mjs.map +1 -1
  73. package/fesm2022/tectra-ng-ui-password-generator.mjs +18 -1
  74. package/fesm2022/tectra-ng-ui-password-generator.mjs.map +1 -1
  75. package/fesm2022/tectra-ng-ui-password.mjs +2 -2
  76. package/fesm2022/tectra-ng-ui-password.mjs.map +1 -1
  77. package/fesm2022/tectra-ng-ui-pill.mjs +33 -17
  78. package/fesm2022/tectra-ng-ui-pill.mjs.map +1 -1
  79. package/fesm2022/tectra-ng-ui-rating.mjs +2 -2
  80. package/fesm2022/tectra-ng-ui-rating.mjs.map +1 -1
  81. package/fesm2022/tectra-ng-ui-select.mjs +30 -7
  82. package/fesm2022/tectra-ng-ui-select.mjs.map +1 -1
  83. package/fesm2022/tectra-ng-ui-stat-tiles.mjs +93 -8
  84. package/fesm2022/tectra-ng-ui-stat-tiles.mjs.map +1 -1
  85. package/fesm2022/tectra-ng-ui-status-icon.mjs +40 -3
  86. package/fesm2022/tectra-ng-ui-status-icon.mjs.map +1 -1
  87. package/fesm2022/tectra-ng-ui-table.mjs +20 -6
  88. package/fesm2022/tectra-ng-ui-table.mjs.map +1 -1
  89. package/fesm2022/tectra-ng-ui-tag.mjs +2 -2
  90. package/fesm2022/tectra-ng-ui-tag.mjs.map +1 -1
  91. package/fesm2022/tectra-ng-ui-toast.mjs +2 -2
  92. package/fesm2022/tectra-ng-ui-toast.mjs.map +1 -1
  93. package/fesm2022/tectra-ng-ui-tree-select.mjs +10 -8
  94. package/fesm2022/tectra-ng-ui-tree-select.mjs.map +1 -1
  95. package/fesm2022/tectra-ng-ui-tree-table.mjs +4 -4
  96. package/fesm2022/tectra-ng-ui-tree-table.mjs.map +1 -1
  97. package/fesm2022/tectra-ng-ui-truncate-text.mjs +33 -9
  98. package/fesm2022/tectra-ng-ui-truncate-text.mjs.map +1 -1
  99. package/fesm2022/tectra-ng-ui.mjs +1 -1
  100. package/icon-field/README.md +2 -1
  101. package/key-filter/README.md +3 -2
  102. package/knob/README.md +3 -1
  103. package/label/README.md +4 -1
  104. package/link/README.md +4 -1
  105. package/message/README.md +3 -3
  106. package/month-calendar/README.md +2 -1
  107. package/multiselect/README.md +1 -1
  108. package/package.json +4 -4
  109. package/panel/README.md +3 -1
  110. package/panel-menu/README.md +3 -2
  111. package/password-generator/README.md +2 -0
  112. package/pill/README.md +4 -4
  113. package/select/README.md +1 -1
  114. package/stat-tiles/README.md +17 -1
  115. package/status-icon/README.md +3 -1
  116. package/table/README.md +1 -1
  117. package/tag/README.md +2 -0
  118. package/tree-select/README.md +1 -1
  119. package/truncate-text/README.md +2 -1
  120. package/types/tectra-ng-ui-amount.d.ts +41 -1
  121. package/types/tectra-ng-ui-amount.d.ts.map +1 -1
  122. package/types/tectra-ng-ui-analog-clock.d.ts +1 -4
  123. package/types/tectra-ng-ui-analog-clock.d.ts.map +1 -1
  124. package/types/tectra-ng-ui-autocomplete.d.ts +1 -1
  125. package/types/tectra-ng-ui-avatar.d.ts +45 -12
  126. package/types/tectra-ng-ui-avatar.d.ts.map +1 -1
  127. package/types/tectra-ng-ui-cascade-select.d.ts +3 -2
  128. package/types/tectra-ng-ui-cascade-select.d.ts.map +1 -1
  129. package/types/tectra-ng-ui-chips-input.d.ts +62 -6
  130. package/types/tectra-ng-ui-chips-input.d.ts.map +1 -1
  131. package/types/tectra-ng-ui-color-picker.d.ts +38 -1
  132. package/types/tectra-ng-ui-color-picker.d.ts.map +1 -1
  133. package/types/tectra-ng-ui-countdown.d.ts +12 -1
  134. package/types/tectra-ng-ui-countdown.d.ts.map +1 -1
  135. package/types/tectra-ng-ui-country-select.d.ts +17 -4
  136. package/types/tectra-ng-ui-country-select.d.ts.map +1 -1
  137. package/types/tectra-ng-ui-country.d.ts +7 -1
  138. package/types/tectra-ng-ui-country.d.ts.map +1 -1
  139. package/types/tectra-ng-ui-datepicker.d.ts +2 -2
  140. package/types/tectra-ng-ui-datepicker.d.ts.map +1 -1
  141. package/types/tectra-ng-ui-export.d.ts +68 -8
  142. package/types/tectra-ng-ui-export.d.ts.map +1 -1
  143. package/types/tectra-ng-ui-icon-field.d.ts +9 -2
  144. package/types/tectra-ng-ui-icon-field.d.ts.map +1 -1
  145. package/types/tectra-ng-ui-key-filter.d.ts +19 -4
  146. package/types/tectra-ng-ui-key-filter.d.ts.map +1 -1
  147. package/types/tectra-ng-ui-knob.d.ts +10 -2
  148. package/types/tectra-ng-ui-knob.d.ts.map +1 -1
  149. package/types/tectra-ng-ui-label.d.ts +8 -1
  150. package/types/tectra-ng-ui-label.d.ts.map +1 -1
  151. package/types/tectra-ng-ui-link.d.ts +8 -2
  152. package/types/tectra-ng-ui-link.d.ts.map +1 -1
  153. package/types/tectra-ng-ui-mention-textarea.d.ts +5 -0
  154. package/types/tectra-ng-ui-mention-textarea.d.ts.map +1 -1
  155. package/types/tectra-ng-ui-message.d.ts +6 -3
  156. package/types/tectra-ng-ui-message.d.ts.map +1 -1
  157. package/types/tectra-ng-ui-month-calendar.d.ts +14 -4
  158. package/types/tectra-ng-ui-month-calendar.d.ts.map +1 -1
  159. package/types/tectra-ng-ui-multiselect.d.ts +1 -1
  160. package/types/tectra-ng-ui-panel-menu.d.ts +34 -6
  161. package/types/tectra-ng-ui-panel-menu.d.ts.map +1 -1
  162. package/types/tectra-ng-ui-panel.d.ts +1 -1
  163. package/types/tectra-ng-ui-panel.d.ts.map +1 -1
  164. package/types/tectra-ng-ui-password-generator.d.ts +10 -3
  165. package/types/tectra-ng-ui-password-generator.d.ts.map +1 -1
  166. package/types/tectra-ng-ui-pill.d.ts +9 -5
  167. package/types/tectra-ng-ui-pill.d.ts.map +1 -1
  168. package/types/tectra-ng-ui-select.d.ts +5 -2
  169. package/types/tectra-ng-ui-select.d.ts.map +1 -1
  170. package/types/tectra-ng-ui-stat-tiles.d.ts +49 -5
  171. package/types/tectra-ng-ui-stat-tiles.d.ts.map +1 -1
  172. package/types/tectra-ng-ui-status-icon.d.ts +20 -2
  173. package/types/tectra-ng-ui-status-icon.d.ts.map +1 -1
  174. package/types/tectra-ng-ui-table.d.ts +2 -1
  175. package/types/tectra-ng-ui-table.d.ts.map +1 -1
  176. package/types/tectra-ng-ui-tree-select.d.ts +3 -3
  177. package/types/tectra-ng-ui-tree-select.d.ts.map +1 -1
  178. package/types/tectra-ng-ui-truncate-text.d.ts +7 -2
  179. package/types/tectra-ng-ui-truncate-text.d.ts.map +1 -1
  180. package/types/tectra-ng-ui.d.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tectra-ng-ui-pill.mjs","names":[],"sources":["../../../../packages/ui/pill/src/pill.icons.ts","../../../../packages/ui/pill/src/pill.theme.ts","../../../../packages/ui/pill/src/pill.component.ts"],"sourcesContent":["import { TxIconSet, txIconInfo, txIconTimes } from '@tectra-ng/icons';\n\nexport const PILL_ICON_DEFAULTS: TxIconSet = {\n info: txIconInfo,\n times: txIconTimes,\n};\n","import { pillTokens } from '@tectra-ng/themes';\n\nexport const PILL_THEME = {\n pill: pillTokens,\n};\n","import { ChangeDetectionStrategy, Component, booleanAttribute, computed, input, output } from '@angular/core';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { injectTxIcons, provideTxIconDefaults, TxIcon, TxIconName } from '@tectra-ng/icons';\nimport { TectraDeepPartial, TectraPillTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxPillPart, TxPillSize, TxPillTone, TxPillVariant } from './pill.types';\nimport { PILL_ICON_DEFAULTS } from './pill.icons';\nimport { PILL_THEME } from './pill.theme';\n\n@Component({\n selector: 'tx-pill',\n imports: [TxIcon],\n template: `\n @if (dot()) {\n <span class=\"tx-pill__dot\" aria-hidden=\"true\"></span>\n } @else if (icon(); as icon) {\n <span class=\"tx-pill__icon\" aria-hidden=\"true\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\">\n @if (iconName(); as name) {\n <tx-icon [name]=\"name\" />\n } @else {\n <span [class]=\"icon\"></span>\n }\n </span>\n }\n <ng-content select=\"[txPillLeading]\" />\n <span class=\"tx-pill__label\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\">{{ value() }}<ng-content /></span>\n @if (removable()) {\n <button\n type=\"button\"\n class=\"tx-pill__remove\"\n [class]=\"passThrough().remove?.class\"\n [style]=\"passThrough().remove?.style\"\n [attr.aria-label]=\"removeLabel() ?? translations().remove\"\n [title]=\"removeLabel() ?? translations().remove\"\n (click)=\"remove($event)\"\n (keydown.delete)=\"remove($event)\"\n (keydown.backspace)=\"remove($event)\"\n >\n <tx-icon [name]=\"'times'\" />\n </button>\n }\n `,\n styleUrl: './pill.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-pill',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-tone]': 'resolvedTone()',\n '[attr.data-variant]': 'variant()',\n '[attr.data-size]': 'resolvedSize()',\n },\n viewProviders: [provideTxIconDefaults(PILL_ICON_DEFAULTS)],\n})\nexport class TxPill {\n private readonly pillTheme = injectTokens(PILL_THEME);\n\n private txIconRegistry = injectTxIcons();\n\n readonly value = input<string | number | undefined>(undefined);\n readonly tone = input<TxPillTone>('neutral');\n readonly variant = input<TxPillVariant>('soft');\n readonly size = input<TxPillSize>('medium');\n readonly icon = input<TxIconName | (string & {}) | undefined>(undefined);\n readonly dot = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly removable = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly removeLabel = input<string | undefined>(undefined);\n readonly dt = input<TectraDeepPartial<TectraPillTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxPillPart, TxPill> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly removed = output<Event>();\n\n readonly translations = injectTranslations();\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('pill', this, this.pt, this.ptOptions);\n readonly resolvedTone = computed(() => (this.tone() === 'secondary' ? 'neutral' : this.tone()));\n readonly resolvedSize = computed(() => (this.size() === 'normal' ? 'medium' : this.size()));\n readonly iconName = computed(() => {\n const icon = this.icon();\n return icon && this.txIconRegistry.has(icon) ? icon : null;\n });\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-pill'), ...this.passThrough().root?.style }));\n\n remove(event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n this.removed.emit(event);\n }\n}\n"],"mappings":";;;;;;;AAEA,MAAa,qBAAgC;CAC3C,MAAM;CACN,OAAO;AACR;ACHD,MAAa,aAAa,EACxB,MAAM,WACP;ACoDD,IAAa,SAAb,MAAa,OAAM;CACA,YAAY,aAAa,UAAU;CAE5C,iBAAiB,cAAa;CAE7B,QAAQ,MAAmC,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACrD,OAAO,MAAkB,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACnC,UAAU,MAAqB,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+B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,CAAA,s4HAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"tectra-ng-ui-pill.mjs","names":[],"sources":["../../../../packages/ui/pill/src/pill.icons.ts","../../../../packages/ui/pill/src/pill.theme.ts","../../../../packages/ui/pill/src/pill.component.ts"],"sourcesContent":["import { TxIconSet, txIconInfo, txIconTimes } from '@tectra-ng/icons';\n\nexport const PILL_ICON_DEFAULTS: TxIconSet = {\n info: txIconInfo,\n times: txIconTimes,\n};\n","import { pillTokens } from '@tectra-ng/themes';\n\nexport const PILL_THEME = {\n pill: pillTokens,\n};\n","import { ChangeDetectionStrategy, Component, booleanAttribute, computed, input, output } from '@angular/core';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { injectTxIcons, provideTxIconDefaults, splitIconValue, TxIcon, TxIconName } from '@tectra-ng/icons';\nimport { TectraDeepPartial, TectraPillTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxPillPart, TxPillSize, TxPillTone, TxPillVariant } from './pill.types';\nimport { PILL_ICON_DEFAULTS } from './pill.icons';\nimport { PILL_THEME } from './pill.theme';\n\n@Component({\n selector: 'tx-pill',\n imports: [TxIcon],\n template: `\n @if (dot()) {\n <span class=\"tx-pill__dot\" aria-hidden=\"true\"></span>\n } @else if (icon(); as icon) {\n <span\n class=\"tx-pill__icon\"\n aria-hidden=\"true\"\n [class.tx-pill__icon--spin]=\"iconSpin()\"\n [class]=\"passThrough().icon?.class\"\n [style]=\"passThrough().icon?.style\"\n >\n @if (iconName(); as name) {\n <tx-icon [name]=\"name\" [class]=\"iconModifiers()\" />\n } @else {\n <span [class]=\"icon\"></span>\n }\n </span>\n }\n <span class=\"tx-pill__leading\" [class]=\"passThrough().leading?.class\" [style]=\"passThrough().leading?.style\"><ng-content select=\"[txPillLeading]\" /></span>\n <span class=\"tx-pill__label\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\">{{ value() }}<ng-content /></span>\n @if (removable()) {\n <button\n type=\"button\"\n class=\"tx-pill__remove\"\n [class]=\"passThrough().remove?.class\"\n [style]=\"passThrough().remove?.style\"\n [attr.aria-label]=\"removeText()\"\n [title]=\"removeText()\"\n (click)=\"remove($event)\"\n (keydown.delete)=\"remove($event)\"\n (keydown.backspace)=\"remove($event)\"\n >\n <tx-icon [name]=\"'times'\" />\n </button>\n }\n `,\n styleUrl: './pill.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-pill',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-tone]': 'resolvedTone()',\n '[attr.data-variant]': 'variant()',\n '[attr.data-size]': 'resolvedSize()',\n },\n viewProviders: [provideTxIconDefaults(PILL_ICON_DEFAULTS)],\n})\nexport class TxPill {\n private readonly pillTheme = injectTokens(PILL_THEME);\n\n private txIconRegistry = injectTxIcons();\n\n readonly value = input<string | number | undefined>(undefined);\n readonly tone = input<TxPillTone>('neutral');\n readonly variant = input<TxPillVariant>('soft');\n readonly size = input<TxPillSize>('medium');\n readonly icon = input<TxIconName | (string & {}) | undefined>(undefined);\n readonly dot = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly removable = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly removeLabel = input<string | undefined>(undefined);\n readonly dt = input<TectraDeepPartial<TectraPillTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxPillPart, TxPill> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly removed = output<Event>();\n\n readonly translations = injectTranslations();\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('pill', this, this.pt, this.ptOptions);\n readonly resolvedTone = computed(() => (this.tone() === 'secondary' ? 'neutral' : this.tone()));\n readonly resolvedSize = computed(() => (this.size() === 'normal' ? 'medium' : this.size()));\n private readonly iconParts = computed(() => {\n const parts = splitIconValue(this.icon());\n return parts && this.txIconRegistry.has(parts.name) ? parts : null;\n });\n readonly iconName = computed(() => this.iconParts()?.name ?? null);\n readonly iconModifiers = computed(() => this.iconParts()?.modifiers.join(' ') ?? '');\n readonly iconSpin = computed(() => this.iconParts()?.spin ?? false);\n readonly removeText = computed(() => this.removeLabel() || this.translations().remove);\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-pill'), ...this.passThrough().root?.style }));\n\n remove(event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n this.removed.emit(event);\n }\n}\n"],"mappings":";;;;;;;AAEA,MAAa,qBAAgC;CAC3C,MAAM;CACN,OAAO;AACR;ACHD,MAAa,aAAa,EACxB,MAAM,WACP;AC0DD,IAAa,SAAb,MAAa,OAAM;CACA,YAAY,aAAa,UAAU;CAE5C,iBAAiB,cAAa;CAE7B,QAAQ,MAAmC,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACrD,OAAO,MAAkB,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACnC,UAAU,MAAqB,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACtC,OAAO,MAAkB,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAClC,OAAO,MAA8C,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC/D,MAAM,MAAwB,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,MAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAClE,YAAY,MAAwB,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,YAAA,+BAAA,CAAA;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,wBAAwB;GAAM,MACzC;IACJ,OAAO;IACP,WAAW;IACX,WAAW;IACX,sBAAsB;IACtB,oBAAoB;IACpB,uBAAuB;IACvB,oBAAoB;GACrB;GAAA,eACc,CAAC,sBAAsB,kBAAkB,CAAC;GAAC,QAAA,CAAA,8vIAAA;EAAA,CAAA"}
@@ -390,7 +390,7 @@ var TxRating = class TxRating extends TxFormControlBase {
390
390
  usesInheritance: true,
391
391
  ngImport: i0,
392
392
  template: "<span\n class=\"tx-rating__stars\"\n role=\"slider\"\n [class]=\"passThrough().stars?.class\"\n [style]=\"passThrough().stars?.style\"\n [attr.tabindex]=\"isDisabled() ? -1 : (tabindex() ?? 0)\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"stars()\"\n [attr.aria-valuenow]=\"value() ?? 0\"\n [attr.aria-valuetext]=\"valueText()\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n (click)=\"onClick($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerleave)=\"onPointerLeave()\"\n>\n @for (index of indexes(); track index) {\n <span\n class=\"tx-rating__star\"\n [class.tx-rating__star--active]=\"fill(index) > 0\"\n [class]=\"passThrough().star?.class\"\n [style]=\"passThrough().star?.style\"\n [attr.data-index]=\"index\"\n >\n <span class=\"tx-rating__off\" aria-hidden=\"true\">\n @if (offTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: index }\" />\n } @else if (offIconName(); as name) {\n <tx-icon [name]=\"name\" />\n } @else {\n <span [class]=\"offIcon()\"></span>\n }\n </span>\n <span class=\"tx-rating__on\" aria-hidden=\"true\" [style.width.%]=\"fill(index)\">\n @if (onTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: index }\" />\n } @else if (onIconName(); as name) {\n <tx-icon [name]=\"name\" />\n } @else {\n <span [class]=\"onIcon()\"></span>\n }\n </span>\n </span>\n }\n</span>\n@if (clearable() && isEditable() && value()) {\n <button\n type=\"button\"\n class=\"tx-rating__clear\"\n [class]=\"passThrough().clear?.class\"\n [style]=\"passThrough().clear?.style\"\n [attr.aria-label]=\"clearLabel() ? null : translations().clear\"\n (click)=\"clear($event)\"\n >\n <tx-icon [name]=\"'times'\" />\n @if (clearLabel()) {\n <span>{{ clearLabel() }}</span>\n }\n </button>\n}\n",
393
- styles: [":host{display:inline-flex;align-items:center;vertical-align:middle}.tx-rating__stars{display:inline-flex;align-items:center;line-height:0}.tx-rating__star{position:relative;display:block;flex-shrink:0;width:1em;height:1em}.tx-rating__off,.tx-rating__on{position:absolute;top:0;left:0;display:flex;align-items:center;height:1em;overflow:hidden;line-height:1}.tx-rating__off{width:1em}.tx-rating__off>*,.tx-rating__on>*{flex-shrink:0;width:1em;height:1em}:host([data-styled]){--_size: var(--tx-rating-icon-size);--_gap: var(--tx-rating-gap);gap:var(--tx-rating-clear-gap)}:host([data-styled][data-size=small]){--_size: var(--tx-rating-sm-icon-size);--_gap: var(--tx-rating-sm-gap)}:host([data-styled][data-size=large]){--_size: var(--tx-rating-lg-icon-size);--_gap: var(--tx-rating-lg-gap)}:host([data-styled]) .tx-rating__stars{gap:var(--_gap);border-radius:var(--tx-rating-border-radius);outline:none;font-size:var(--_size)}:host([data-styled]) .tx-rating__stars:focus-visible{outline:var(--tx-rating-focus-ring-width) solid var(--tx-rating-focus-ring-color);outline-offset:var(--tx-rating-focus-ring-offset)}:host([data-styled]) .tx-rating__star{color:var(--tx-rating-color);cursor:pointer;transition:transform .25s cubic-bezier(.34,1.56,.64,1)}:host([data-styled]:not(.tx-rating--readonly):not(.tx-rating--disabled)) .tx-rating__star:hover{transform:scale(var(--tx-rating-hover-scale))}:host([data-styled]) .tx-rating__on{color:var(--tx-rating-active-color);transition:color var(--tx-rating-transition-duration)}:host([data-styled].tx-rating--preview) .tx-rating__on{color:var(--tx-rating-hover-color)}:host([data-styled].tx-rating--readonly) .tx-rating__star,:host([data-styled].tx-rating--disabled) .tx-rating__star{cursor:default}:host([data-styled].tx-rating--disabled) .tx-rating__stars{opacity:var(--tx-rating-disabled-opacity)}:host([data-styled].tx-rating--invalid) .tx-rating__star{color:var(--tx-form-field-invalid-border-color)}:host([data-styled]) .tx-rating__clear{display:inline-flex;align-items:center;gap:4px;padding:2px 6px;border:none;border-radius:var(--tx-radius-sm);background:transparent;color:var(--tx-rating-clear-color);font:inherit;font-size:var(--tx-rating-clear-font-size);cursor:pointer;transition:color var(--tx-motion-duration) var(--tx-motion-easing)}:host([data-styled]) .tx-rating__clear:hover{color:var(--tx-rating-clear-hover-color)}:host([data-styled]) .tx-rating__clear:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:1px}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-rating__on,:host([data-styled]) .tx-rating__star{transition:none}:host([data-styled]:not(.tx-rating--readonly):not(.tx-rating--disabled)) .tx-rating__star:hover{transform:none}}\n"],
393
+ styles: [":host{display:inline-flex;align-items:center;vertical-align:middle}.tx-rating__stars{display:inline-flex;align-items:center;line-height:0}.tx-rating__star{position:relative;display:block;flex-shrink:0;width:1em;height:1em}.tx-rating__off,.tx-rating__on{position:absolute;top:0;left:0;display:flex;align-items:center;height:1em;overflow:hidden;line-height:1}.tx-rating__off{width:1em}.tx-rating__off>*,.tx-rating__on>*{flex-shrink:0;width:1em;height:1em}:host([data-styled]){--_size: var(--tx-rating-icon-size);--_gap: var(--tx-rating-gap);gap:var(--tx-rating-clear-gap)}:host([data-styled][data-size=small]){--_size: var(--tx-rating-sm-icon-size);--_gap: var(--tx-rating-sm-gap)}:host([data-styled][data-size=large]){--_size: var(--tx-rating-lg-icon-size);--_gap: var(--tx-rating-lg-gap)}:host([data-styled]) .tx-rating__stars{gap:var(--_gap);border-radius:var(--tx-rating-border-radius);outline:none;font-size:var(--_size)}:host([data-styled]) .tx-rating__stars:focus-visible{outline:var(--tx-rating-focus-ring-width) solid var(--tx-rating-focus-ring-color);outline-offset:var(--tx-rating-focus-ring-offset)}:host([data-styled]) .tx-rating__star{color:var(--tx-rating-color);cursor:pointer;transition:transform .25s cubic-bezier(.34,1.56,.64,1)}:host([data-styled]:not(.tx-rating--readonly):not(.tx-rating--disabled)) .tx-rating__star:hover{transform:scale(var(--tx-rating-hover-scale))}:host([data-styled]) .tx-rating__on{color:var(--tx-rating-active-color);transition:color var(--tx-rating-transition-duration)}:host([data-styled].tx-rating--preview) .tx-rating__on{color:var(--tx-rating-hover-color)}:host([data-styled].tx-rating--readonly) .tx-rating__star,:host([data-styled].tx-rating--disabled) .tx-rating__star{cursor:default}:host([data-styled].tx-rating--disabled) .tx-rating__stars{opacity:var(--tx-rating-disabled-opacity)}:host([data-styled].tx-rating--invalid) .tx-rating__star{color:var(--tx-form-field-invalid-border-color)}:host([data-styled]) .tx-rating__clear{display:inline-flex;align-items:center;gap:var(--tx-space-1);padding:var(--tx-rating-clear-padding);border:none;border-radius:var(--tx-radius-sm);background:transparent;color:var(--tx-rating-clear-color);font:inherit;font-size:var(--tx-rating-clear-font-size);cursor:pointer;transition:color var(--tx-motion-duration) var(--tx-motion-easing)}:host([data-styled]) .tx-rating__clear:hover{color:var(--tx-rating-clear-hover-color)}:host([data-styled]) .tx-rating__clear:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:1px}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-rating__on,:host([data-styled]) .tx-rating__star{transition:none}:host([data-styled]:not(.tx-rating--readonly):not(.tx-rating--disabled)) .tx-rating__star:hover{transform:none}}\n"],
394
394
  dependencies: [{
395
395
  kind: "directive",
396
396
  type: NgTemplateOutlet,
@@ -439,7 +439,7 @@ i0.ɵɵngDeclareClassMetadata({
439
439
  },
440
440
  viewProviders: [provideTxIconDefaults(RATING_ICON_DEFAULTS)],
441
441
  template: "<span\n class=\"tx-rating__stars\"\n role=\"slider\"\n [class]=\"passThrough().stars?.class\"\n [style]=\"passThrough().stars?.style\"\n [attr.tabindex]=\"isDisabled() ? -1 : (tabindex() ?? 0)\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"stars()\"\n [attr.aria-valuenow]=\"value() ?? 0\"\n [attr.aria-valuetext]=\"valueText()\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n (click)=\"onClick($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerleave)=\"onPointerLeave()\"\n>\n @for (index of indexes(); track index) {\n <span\n class=\"tx-rating__star\"\n [class.tx-rating__star--active]=\"fill(index) > 0\"\n [class]=\"passThrough().star?.class\"\n [style]=\"passThrough().star?.style\"\n [attr.data-index]=\"index\"\n >\n <span class=\"tx-rating__off\" aria-hidden=\"true\">\n @if (offTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: index }\" />\n } @else if (offIconName(); as name) {\n <tx-icon [name]=\"name\" />\n } @else {\n <span [class]=\"offIcon()\"></span>\n }\n </span>\n <span class=\"tx-rating__on\" aria-hidden=\"true\" [style.width.%]=\"fill(index)\">\n @if (onTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: index }\" />\n } @else if (onIconName(); as name) {\n <tx-icon [name]=\"name\" />\n } @else {\n <span [class]=\"onIcon()\"></span>\n }\n </span>\n </span>\n }\n</span>\n@if (clearable() && isEditable() && value()) {\n <button\n type=\"button\"\n class=\"tx-rating__clear\"\n [class]=\"passThrough().clear?.class\"\n [style]=\"passThrough().clear?.style\"\n [attr.aria-label]=\"clearLabel() ? null : translations().clear\"\n (click)=\"clear($event)\"\n >\n <tx-icon [name]=\"'times'\" />\n @if (clearLabel()) {\n <span>{{ clearLabel() }}</span>\n }\n </button>\n}\n",
442
- styles: [":host{display:inline-flex;align-items:center;vertical-align:middle}.tx-rating__stars{display:inline-flex;align-items:center;line-height:0}.tx-rating__star{position:relative;display:block;flex-shrink:0;width:1em;height:1em}.tx-rating__off,.tx-rating__on{position:absolute;top:0;left:0;display:flex;align-items:center;height:1em;overflow:hidden;line-height:1}.tx-rating__off{width:1em}.tx-rating__off>*,.tx-rating__on>*{flex-shrink:0;width:1em;height:1em}:host([data-styled]){--_size: var(--tx-rating-icon-size);--_gap: var(--tx-rating-gap);gap:var(--tx-rating-clear-gap)}:host([data-styled][data-size=small]){--_size: var(--tx-rating-sm-icon-size);--_gap: var(--tx-rating-sm-gap)}:host([data-styled][data-size=large]){--_size: var(--tx-rating-lg-icon-size);--_gap: var(--tx-rating-lg-gap)}:host([data-styled]) .tx-rating__stars{gap:var(--_gap);border-radius:var(--tx-rating-border-radius);outline:none;font-size:var(--_size)}:host([data-styled]) .tx-rating__stars:focus-visible{outline:var(--tx-rating-focus-ring-width) solid var(--tx-rating-focus-ring-color);outline-offset:var(--tx-rating-focus-ring-offset)}:host([data-styled]) .tx-rating__star{color:var(--tx-rating-color);cursor:pointer;transition:transform .25s cubic-bezier(.34,1.56,.64,1)}:host([data-styled]:not(.tx-rating--readonly):not(.tx-rating--disabled)) .tx-rating__star:hover{transform:scale(var(--tx-rating-hover-scale))}:host([data-styled]) .tx-rating__on{color:var(--tx-rating-active-color);transition:color var(--tx-rating-transition-duration)}:host([data-styled].tx-rating--preview) .tx-rating__on{color:var(--tx-rating-hover-color)}:host([data-styled].tx-rating--readonly) .tx-rating__star,:host([data-styled].tx-rating--disabled) .tx-rating__star{cursor:default}:host([data-styled].tx-rating--disabled) .tx-rating__stars{opacity:var(--tx-rating-disabled-opacity)}:host([data-styled].tx-rating--invalid) .tx-rating__star{color:var(--tx-form-field-invalid-border-color)}:host([data-styled]) .tx-rating__clear{display:inline-flex;align-items:center;gap:4px;padding:2px 6px;border:none;border-radius:var(--tx-radius-sm);background:transparent;color:var(--tx-rating-clear-color);font:inherit;font-size:var(--tx-rating-clear-font-size);cursor:pointer;transition:color var(--tx-motion-duration) var(--tx-motion-easing)}:host([data-styled]) .tx-rating__clear:hover{color:var(--tx-rating-clear-hover-color)}:host([data-styled]) .tx-rating__clear:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:1px}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-rating__on,:host([data-styled]) .tx-rating__star{transition:none}:host([data-styled]:not(.tx-rating--readonly):not(.tx-rating--disabled)) .tx-rating__star:hover{transform:none}}\n"]
442
+ styles: [":host{display:inline-flex;align-items:center;vertical-align:middle}.tx-rating__stars{display:inline-flex;align-items:center;line-height:0}.tx-rating__star{position:relative;display:block;flex-shrink:0;width:1em;height:1em}.tx-rating__off,.tx-rating__on{position:absolute;top:0;left:0;display:flex;align-items:center;height:1em;overflow:hidden;line-height:1}.tx-rating__off{width:1em}.tx-rating__off>*,.tx-rating__on>*{flex-shrink:0;width:1em;height:1em}:host([data-styled]){--_size: var(--tx-rating-icon-size);--_gap: var(--tx-rating-gap);gap:var(--tx-rating-clear-gap)}:host([data-styled][data-size=small]){--_size: var(--tx-rating-sm-icon-size);--_gap: var(--tx-rating-sm-gap)}:host([data-styled][data-size=large]){--_size: var(--tx-rating-lg-icon-size);--_gap: var(--tx-rating-lg-gap)}:host([data-styled]) .tx-rating__stars{gap:var(--_gap);border-radius:var(--tx-rating-border-radius);outline:none;font-size:var(--_size)}:host([data-styled]) .tx-rating__stars:focus-visible{outline:var(--tx-rating-focus-ring-width) solid var(--tx-rating-focus-ring-color);outline-offset:var(--tx-rating-focus-ring-offset)}:host([data-styled]) .tx-rating__star{color:var(--tx-rating-color);cursor:pointer;transition:transform .25s cubic-bezier(.34,1.56,.64,1)}:host([data-styled]:not(.tx-rating--readonly):not(.tx-rating--disabled)) .tx-rating__star:hover{transform:scale(var(--tx-rating-hover-scale))}:host([data-styled]) .tx-rating__on{color:var(--tx-rating-active-color);transition:color var(--tx-rating-transition-duration)}:host([data-styled].tx-rating--preview) .tx-rating__on{color:var(--tx-rating-hover-color)}:host([data-styled].tx-rating--readonly) .tx-rating__star,:host([data-styled].tx-rating--disabled) .tx-rating__star{cursor:default}:host([data-styled].tx-rating--disabled) .tx-rating__stars{opacity:var(--tx-rating-disabled-opacity)}:host([data-styled].tx-rating--invalid) .tx-rating__star{color:var(--tx-form-field-invalid-border-color)}:host([data-styled]) .tx-rating__clear{display:inline-flex;align-items:center;gap:var(--tx-space-1);padding:var(--tx-rating-clear-padding);border:none;border-radius:var(--tx-radius-sm);background:transparent;color:var(--tx-rating-clear-color);font:inherit;font-size:var(--tx-rating-clear-font-size);cursor:pointer;transition:color var(--tx-motion-duration) var(--tx-motion-easing)}:host([data-styled]) .tx-rating__clear:hover{color:var(--tx-rating-clear-hover-color)}:host([data-styled]) .tx-rating__clear:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:1px}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-rating__on,:host([data-styled]) .tx-rating__star{transition:none}:host([data-styled]:not(.tx-rating--readonly):not(.tx-rating--disabled)) .tx-rating__star:hover{transform:none}}\n"]
443
443
  }]
444
444
  }],
445
445
  propDecorators: {
@@ -1 +1 @@
1
- {"version":3,"file":"tectra-ng-ui-rating.mjs","names":[],"sources":["../../../../packages/ui/rating/src/rating-templates.directive.ts","../../../../packages/ui/rating/src/rating.icons.ts","../../../../packages/ui/rating/src/rating.theme.ts","../../../../packages/ui/rating/src/rating.component.ts","../../../../packages/ui/rating/src/rating.component.html"],"sourcesContent":["import { Directive, TemplateRef, inject } from '@angular/core';\nimport { TxRatingIconContext } from './rating.types';\n\n@Directive({ selector: 'ng-template[txRatingOnIcon]' })\nexport class TxRatingOnIconTemplate {\n readonly templateRef = inject<TemplateRef<TxRatingIconContext>>(TemplateRef);\n\n static ngTemplateContextGuard(_directive: TxRatingOnIconTemplate, context: unknown): context is TxRatingIconContext {\n return !!context;\n }\n}\n\n@Directive({ selector: 'ng-template[txRatingOffIcon]' })\nexport class TxRatingOffIconTemplate {\n readonly templateRef = inject<TemplateRef<TxRatingIconContext>>(TemplateRef);\n\n static ngTemplateContextGuard(_directive: TxRatingOffIconTemplate, context: unknown): context is TxRatingIconContext {\n return !!context;\n }\n}\n","import { TxIconSet, txIconStar, txIconStarFill, txIconTimes } from '@tectra-ng/icons';\n\nexport const RATING_ICON_DEFAULTS: TxIconSet = {\n star: txIconStar,\n 'star-fill': txIconStarFill,\n times: txIconTimes,\n};\n","import { formFieldTokens, ratingTokens } from '@tectra-ng/themes';\n\nexport const RATING_THEME = {\n formField: formFieldTokens,\n rating: ratingTokens,\n};\n","import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, booleanAttribute, computed, contentChild, forwardRef, inject, input, numberAttribute, output, signal } from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { TxFormControlBase, injectFieldInvalid } from '@tectra-ng/core/forms';\nimport { TxLocaleService, injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean, optionalNumber } from '@tectra-ng/core/utils';\nimport { injectTxIcons, provideTxIconDefaults, TxIcon, TxIconName } from '@tectra-ng/icons';\nimport { TectraDeepPartial, TectraRatingTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxRatingOffIconTemplate, TxRatingOnIconTemplate } from './rating-templates.directive';\nimport { TxRatingChangeEvent, TxRatingPart, TxRatingSize } from './rating.types';\nimport { RATING_ICON_DEFAULTS } from './rating.icons';\nimport { RATING_THEME } from './rating.theme';\n\n@Component({\n selector: 'tx-rating',\n imports: [NgTemplateOutlet, TxIcon],\n templateUrl: './rating.component.html',\n styleUrl: './rating.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => TxRating), multi: true }],\n host: {\n class: 'tx-rating',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-size]': 'size()',\n '[class.tx-rating--readonly]': 'readonly()',\n '[class.tx-rating--disabled]': 'isDisabled()',\n '[class.tx-rating--invalid]': 'isInvalid()',\n '[class.tx-rating--preview]': 'preview() !== null',\n },\n viewProviders: [provideTxIconDefaults(RATING_ICON_DEFAULTS)],\n})\nexport class TxRating extends TxFormControlBase<number> {\n private readonly ratingTheme = injectTokens(RATING_THEME);\n\n private txIconRegistry = injectTxIcons();\n private localeService = inject(TxLocaleService);\n\n readonly stars = input<number, unknown>(5, { transform: numberAttribute });\n readonly allowHalf = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly onIcon = input<TxIconName | (string & {})>('star-fill');\n readonly offIcon = input<TxIconName | (string & {})>('star-fill');\n readonly clearable = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly clearLabel = input<string | undefined>(undefined);\n readonly size = input<TxRatingSize>('medium');\n readonly invalid = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n // eslint-disable-next-line @angular-eslint/no-input-rename\n readonly disabledInput = input<boolean, unknown>(false, { alias: 'disabled', transform: booleanAttribute });\n readonly readonly = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly ariaLabel = input<string | undefined>(undefined);\n readonly ariaLabelledBy = input<string | undefined>(undefined);\n readonly tabindex = input<number | undefined, unknown>(undefined, { transform: optionalNumber });\n readonly dt = input<TectraDeepPartial<TectraRatingTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxRatingPart, TxRating> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly rated = output<TxRatingChangeEvent>();\n readonly cleared = output<void>();\n\n readonly onTemplate = contentChild(TxRatingOnIconTemplate);\n readonly offTemplate = contentChild(TxRatingOffIconTemplate);\n\n readonly translations = injectTranslations();\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly isInvalid = injectFieldInvalid(this.invalid);\n readonly passThrough = injectPassThrough('rating', this, this.pt, this.ptOptions);\n\n readonly preview = signal<number | null>(null);\n readonly indexes = computed(() => Array.from({ length: Math.max(1, this.stars()) }, (_, index) => index));\n readonly isDisabled = computed(() => this.disabled() || this.disabledInput());\n readonly isEditable = computed(() => !this.isDisabled() && !this.readonly());\n readonly shown = computed(() => this.preview() ?? this.value() ?? 0);\n readonly unit = computed(() => (this.allowHalf() ? 0.5 : 1));\n readonly onIconName = computed(() => (this.txIconRegistry.has(this.onIcon()) ? this.onIcon() : null));\n readonly offIconName = computed(() => (this.txIconRegistry.has(this.offIcon()) ? this.offIcon() : null));\n readonly valueText = computed(() =>\n this.translations()\n .ratingValue.replace('{value}', this.localeService.formatNumber(this.value() ?? 0))\n .replace('{stars}', String(this.stars())),\n );\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-rating'), ...this.passThrough().root?.style }));\n\n fill(index: number): number {\n return Math.max(0, Math.min(1, this.shown() - index)) * 100;\n }\n\n onPointerMove(event: PointerEvent): void {\n const star = this.starAt(event);\n if (this.isEditable() && star) {\n this.preview.set(this.valueAt(event, star));\n }\n }\n\n onPointerLeave(): void {\n this.preview.set(null);\n }\n\n onClick(event: MouseEvent): void {\n const star = this.starAt(event);\n if (this.isEditable() && star) {\n this.commit(this.valueAt(event, star), event);\n this.preview.set(null);\n }\n }\n\n onKeydown(event: KeyboardEvent): void {\n if (!this.isEditable()) {\n return;\n }\n const current = this.value() ?? 0;\n const step = this.unit();\n const keys: Record<string, number | null> = {\n ArrowRight: current + step,\n ArrowUp: current + step,\n ArrowLeft: current - step,\n ArrowDown: current - step,\n Home: step,\n End: this.stars(),\n PageUp: current + 1,\n PageDown: current - 1,\n Delete: null,\n Backspace: null,\n 0: null,\n };\n if (/^[1-9]$/.test(event.key) && Number(event.key) <= this.stars()) {\n event.preventDefault();\n this.commit(Number(event.key), event);\n return;\n }\n if (!(event.key in keys)) {\n return;\n }\n event.preventDefault();\n const next = keys[event.key];\n this.commit(next === null || next <= 0 ? null : Math.min(this.stars(), next), event);\n }\n\n onBlur(): void {\n this.markTouched();\n }\n\n clear(event: Event): void {\n this.commit(null, event);\n this.cleared.emit();\n }\n\n private starAt(event: Event): HTMLElement | null {\n return (event.target as HTMLElement).closest<HTMLElement>('.tx-rating__star');\n }\n\n private valueAt(event: MouseEvent, star: HTMLElement): number {\n const index = Number(star.dataset['index']);\n if (!this.allowHalf()) {\n return index + 1;\n }\n const rect = star.getBoundingClientRect();\n const half = rect.width > 0 && event.clientX - rect.left < rect.width / 2;\n return index + (half ? 0.5 : 1);\n }\n\n private commit(value: number | null, event: Event): void {\n if (value !== this.value()) {\n this.updateValue(value);\n this.rated.emit({ value, originalEvent: event });\n }\n }\n}\n","<span\n class=\"tx-rating__stars\"\n role=\"slider\"\n [class]=\"passThrough().stars?.class\"\n [style]=\"passThrough().stars?.style\"\n [attr.tabindex]=\"isDisabled() ? -1 : (tabindex() ?? 0)\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"stars()\"\n [attr.aria-valuenow]=\"value() ?? 0\"\n [attr.aria-valuetext]=\"valueText()\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n (click)=\"onClick($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerleave)=\"onPointerLeave()\"\n>\n @for (index of indexes(); track index) {\n <span\n class=\"tx-rating__star\"\n [class.tx-rating__star--active]=\"fill(index) > 0\"\n [class]=\"passThrough().star?.class\"\n [style]=\"passThrough().star?.style\"\n [attr.data-index]=\"index\"\n >\n <span class=\"tx-rating__off\" aria-hidden=\"true\">\n @if (offTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: index }\" />\n } @else if (offIconName(); as name) {\n <tx-icon [name]=\"name\" />\n } @else {\n <span [class]=\"offIcon()\"></span>\n }\n </span>\n <span class=\"tx-rating__on\" aria-hidden=\"true\" [style.width.%]=\"fill(index)\">\n @if (onTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: index }\" />\n } @else if (onIconName(); as name) {\n <tx-icon [name]=\"name\" />\n } @else {\n <span [class]=\"onIcon()\"></span>\n }\n </span>\n </span>\n }\n</span>\n@if (clearable() && isEditable() && value()) {\n <button\n type=\"button\"\n class=\"tx-rating__clear\"\n [class]=\"passThrough().clear?.class\"\n [style]=\"passThrough().clear?.style\"\n [attr.aria-label]=\"clearLabel() ? null : translations().clear\"\n (click)=\"clear($event)\"\n >\n <tx-icon [name]=\"'times'\" />\n @if (clearLabel()) {\n <span>{{ clearLabel() }}</span>\n }\n </button>\n}\n"],"mappings":";;;;;;;;;;AAIA,IAAa,yBAAb,MAAa,uBAAsB;CACxB,cAAc,OAAyC,WAAW;CAE3E,OAAO,uBAAuB,YAAoC,SAAgB;EAChF,OAAO,CAAC,CAAC;CACX;CALW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAsB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAtB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAsB,cAAA;EAAA,UAAA;EAAA,UAAA;CAAA,CAAA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AAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,sBAAsB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBACrB,uBAAuB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"tectra-ng-ui-rating.mjs","names":[],"sources":["../../../../packages/ui/rating/src/rating-templates.directive.ts","../../../../packages/ui/rating/src/rating.icons.ts","../../../../packages/ui/rating/src/rating.theme.ts","../../../../packages/ui/rating/src/rating.component.ts","../../../../packages/ui/rating/src/rating.component.html"],"sourcesContent":["import { Directive, TemplateRef, inject } from '@angular/core';\nimport { TxRatingIconContext } from './rating.types';\n\n@Directive({ selector: 'ng-template[txRatingOnIcon]' })\nexport class TxRatingOnIconTemplate {\n readonly templateRef = inject<TemplateRef<TxRatingIconContext>>(TemplateRef);\n\n static ngTemplateContextGuard(_directive: TxRatingOnIconTemplate, context: unknown): context is TxRatingIconContext {\n return !!context;\n }\n}\n\n@Directive({ selector: 'ng-template[txRatingOffIcon]' })\nexport class TxRatingOffIconTemplate {\n readonly templateRef = inject<TemplateRef<TxRatingIconContext>>(TemplateRef);\n\n static ngTemplateContextGuard(_directive: TxRatingOffIconTemplate, context: unknown): context is TxRatingIconContext {\n return !!context;\n }\n}\n","import { TxIconSet, txIconStar, txIconStarFill, txIconTimes } from '@tectra-ng/icons';\n\nexport const RATING_ICON_DEFAULTS: TxIconSet = {\n star: txIconStar,\n 'star-fill': txIconStarFill,\n times: txIconTimes,\n};\n","import { formFieldTokens, ratingTokens } from '@tectra-ng/themes';\n\nexport const RATING_THEME = {\n formField: formFieldTokens,\n rating: ratingTokens,\n};\n","import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, booleanAttribute, computed, contentChild, forwardRef, inject, input, numberAttribute, output, signal } from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { TxFormControlBase, injectFieldInvalid } from '@tectra-ng/core/forms';\nimport { TxLocaleService, injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean, optionalNumber } from '@tectra-ng/core/utils';\nimport { injectTxIcons, provideTxIconDefaults, TxIcon, TxIconName } from '@tectra-ng/icons';\nimport { TectraDeepPartial, TectraRatingTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxRatingOffIconTemplate, TxRatingOnIconTemplate } from './rating-templates.directive';\nimport { TxRatingChangeEvent, TxRatingPart, TxRatingSize } from './rating.types';\nimport { RATING_ICON_DEFAULTS } from './rating.icons';\nimport { RATING_THEME } from './rating.theme';\n\n@Component({\n selector: 'tx-rating',\n imports: [NgTemplateOutlet, TxIcon],\n templateUrl: './rating.component.html',\n styleUrl: './rating.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => TxRating), multi: true }],\n host: {\n class: 'tx-rating',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-size]': 'size()',\n '[class.tx-rating--readonly]': 'readonly()',\n '[class.tx-rating--disabled]': 'isDisabled()',\n '[class.tx-rating--invalid]': 'isInvalid()',\n '[class.tx-rating--preview]': 'preview() !== null',\n },\n viewProviders: [provideTxIconDefaults(RATING_ICON_DEFAULTS)],\n})\nexport class TxRating extends TxFormControlBase<number> {\n private readonly ratingTheme = injectTokens(RATING_THEME);\n\n private txIconRegistry = injectTxIcons();\n private localeService = inject(TxLocaleService);\n\n readonly stars = input<number, unknown>(5, { transform: numberAttribute });\n readonly allowHalf = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly onIcon = input<TxIconName | (string & {})>('star-fill');\n readonly offIcon = input<TxIconName | (string & {})>('star-fill');\n readonly clearable = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly clearLabel = input<string | undefined>(undefined);\n readonly size = input<TxRatingSize>('medium');\n readonly invalid = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n // eslint-disable-next-line @angular-eslint/no-input-rename\n readonly disabledInput = input<boolean, unknown>(false, { alias: 'disabled', transform: booleanAttribute });\n readonly readonly = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly ariaLabel = input<string | undefined>(undefined);\n readonly ariaLabelledBy = input<string | undefined>(undefined);\n readonly tabindex = input<number | undefined, unknown>(undefined, { transform: optionalNumber });\n readonly dt = input<TectraDeepPartial<TectraRatingTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxRatingPart, TxRating> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly rated = output<TxRatingChangeEvent>();\n readonly cleared = output<void>();\n\n readonly onTemplate = contentChild(TxRatingOnIconTemplate);\n readonly offTemplate = contentChild(TxRatingOffIconTemplate);\n\n readonly translations = injectTranslations();\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly isInvalid = injectFieldInvalid(this.invalid);\n readonly passThrough = injectPassThrough('rating', this, this.pt, this.ptOptions);\n\n readonly preview = signal<number | null>(null);\n readonly indexes = computed(() => Array.from({ length: Math.max(1, this.stars()) }, (_, index) => index));\n readonly isDisabled = computed(() => this.disabled() || this.disabledInput());\n readonly isEditable = computed(() => !this.isDisabled() && !this.readonly());\n readonly shown = computed(() => this.preview() ?? this.value() ?? 0);\n readonly unit = computed(() => (this.allowHalf() ? 0.5 : 1));\n readonly onIconName = computed(() => (this.txIconRegistry.has(this.onIcon()) ? this.onIcon() : null));\n readonly offIconName = computed(() => (this.txIconRegistry.has(this.offIcon()) ? this.offIcon() : null));\n readonly valueText = computed(() =>\n this.translations()\n .ratingValue.replace('{value}', this.localeService.formatNumber(this.value() ?? 0))\n .replace('{stars}', String(this.stars())),\n );\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-rating'), ...this.passThrough().root?.style }));\n\n fill(index: number): number {\n return Math.max(0, Math.min(1, this.shown() - index)) * 100;\n }\n\n onPointerMove(event: PointerEvent): void {\n const star = this.starAt(event);\n if (this.isEditable() && star) {\n this.preview.set(this.valueAt(event, star));\n }\n }\n\n onPointerLeave(): void {\n this.preview.set(null);\n }\n\n onClick(event: MouseEvent): void {\n const star = this.starAt(event);\n if (this.isEditable() && star) {\n this.commit(this.valueAt(event, star), event);\n this.preview.set(null);\n }\n }\n\n onKeydown(event: KeyboardEvent): void {\n if (!this.isEditable()) {\n return;\n }\n const current = this.value() ?? 0;\n const step = this.unit();\n const keys: Record<string, number | null> = {\n ArrowRight: current + step,\n ArrowUp: current + step,\n ArrowLeft: current - step,\n ArrowDown: current - step,\n Home: step,\n End: this.stars(),\n PageUp: current + 1,\n PageDown: current - 1,\n Delete: null,\n Backspace: null,\n 0: null,\n };\n if (/^[1-9]$/.test(event.key) && Number(event.key) <= this.stars()) {\n event.preventDefault();\n this.commit(Number(event.key), event);\n return;\n }\n if (!(event.key in keys)) {\n return;\n }\n event.preventDefault();\n const next = keys[event.key];\n this.commit(next === null || next <= 0 ? null : Math.min(this.stars(), next), event);\n }\n\n onBlur(): void {\n this.markTouched();\n }\n\n clear(event: Event): void {\n this.commit(null, event);\n this.cleared.emit();\n }\n\n private starAt(event: Event): HTMLElement | null {\n return (event.target as HTMLElement).closest<HTMLElement>('.tx-rating__star');\n }\n\n private valueAt(event: MouseEvent, star: HTMLElement): number {\n const index = Number(star.dataset['index']);\n if (!this.allowHalf()) {\n return index + 1;\n }\n const rect = star.getBoundingClientRect();\n const half = rect.width > 0 && event.clientX - rect.left < rect.width / 2;\n return index + (half ? 0.5 : 1);\n }\n\n private commit(value: number | null, event: Event): void {\n if (value !== this.value()) {\n this.updateValue(value);\n this.rated.emit({ value, originalEvent: event });\n }\n }\n}\n","<span\n class=\"tx-rating__stars\"\n role=\"slider\"\n [class]=\"passThrough().stars?.class\"\n [style]=\"passThrough().stars?.style\"\n [attr.tabindex]=\"isDisabled() ? -1 : (tabindex() ?? 0)\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"stars()\"\n [attr.aria-valuenow]=\"value() ?? 0\"\n [attr.aria-valuetext]=\"valueText()\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n (click)=\"onClick($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerleave)=\"onPointerLeave()\"\n>\n @for (index of indexes(); track index) {\n <span\n class=\"tx-rating__star\"\n [class.tx-rating__star--active]=\"fill(index) > 0\"\n [class]=\"passThrough().star?.class\"\n [style]=\"passThrough().star?.style\"\n [attr.data-index]=\"index\"\n >\n <span class=\"tx-rating__off\" aria-hidden=\"true\">\n @if (offTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: index }\" />\n } @else if (offIconName(); as name) {\n <tx-icon [name]=\"name\" />\n } @else {\n <span [class]=\"offIcon()\"></span>\n }\n </span>\n <span class=\"tx-rating__on\" aria-hidden=\"true\" [style.width.%]=\"fill(index)\">\n @if (onTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: index }\" />\n } @else if (onIconName(); as name) {\n <tx-icon [name]=\"name\" />\n } @else {\n <span [class]=\"onIcon()\"></span>\n }\n </span>\n </span>\n }\n</span>\n@if (clearable() && isEditable() && value()) {\n <button\n type=\"button\"\n class=\"tx-rating__clear\"\n [class]=\"passThrough().clear?.class\"\n [style]=\"passThrough().clear?.style\"\n [attr.aria-label]=\"clearLabel() ? null : translations().clear\"\n (click)=\"clear($event)\"\n >\n <tx-icon [name]=\"'times'\" />\n @if (clearLabel()) {\n <span>{{ clearLabel() }}</span>\n }\n </button>\n}\n"],"mappings":";;;;;;;;;;AAIA,IAAa,yBAAb,MAAa,uBAAsB;CACxB,cAAc,OAAyC,WAAW;CAE3E,OAAO,uBAAuB,YAAoC,SAAgB;EAChF,OAAO,CAAC,CAAC;CACX;CALW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAsB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAtB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAsB,cAAA;EAAA,UAAA;EAAA,UAAA;CAAA,CAAA;;AAAtB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAsB,YAAA,CAAA;EADlC,MAAA;EAAU,MAAA,CAAA,EAAE,UAAU,8BAA6B,CAAE;;;AAUtD,IAAa,0BAAb,MAAa,wBAAuB;CACzB,cAAc,OAAyC,WAAW;CAE3E,OAAO,uBAAuB,YAAqC,SAAgB;EACjF,OAAO,CAAC,CAAC;CACX;CALW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAuB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAvB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAuB,cAAA;EAAA,UAAA;EAAA,UAAA;CAAA,CAAA;;AAAvB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAuB,YAAA,CAAA;EADnC,MAAA;EAAU,MAAA,CAAA,EAAE,UAAU,+BAA8B,CAAE;;;ACVvD,MAAa,uBAA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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,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,SAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,sBAAsB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBACrB,uBAAuB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollViewport } from "@angular/cdk/scrolling";
2
2
  import { DOCUMENT, NgTemplateOutlet } from "@angular/common";
3
3
  import * as i0 from "@angular/core";
4
- import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, Injector, TemplateRef, afterRenderEffect, booleanAttribute, computed, contentChild, effect, forwardRef, inject, input, output, signal, untracked, viewChild } from "@angular/core";
4
+ import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, Injector, TemplateRef, afterNextRender, afterRenderEffect, booleanAttribute, computed, contentChild, effect, forwardRef, inject, input, output, signal, untracked, viewChild } from "@angular/core";
5
5
  import { injectPassThrough, injectTokens, injectUnstyled } from "@tectra-ng/core/config";
6
6
  import { TxIcon, provideTxIconDefaults, txIconBox, txIconCheck, txIconChevronDown, txIconEquals, txIconFilter, txIconList, txIconSearch, txIconSpinner, txIconText, txIconTimes } from "@tectra-ng/icons";
7
7
  import { TxSkeleton } from "@tectra-ng/ui/skeleton";
@@ -10,7 +10,7 @@ import { TxTypeahead, nextListIndex, uniqueId } from "@tectra-ng/core/a11y";
10
10
  import { TxFormControlBase, injectFieldInvalid } from "@tectra-ng/core/forms";
11
11
  import { injectTranslations } from "@tectra-ng/core/i18n";
12
12
  import { CdkConnectedOverlay, CdkOverlayOrigin } from "@angular/cdk/overlay";
13
- import { TxOverlayAnchor, TxOverlayInsets, TxOverlayRoom, placementFromPosition, txAnimateEnter, txAnimateLeave, txPositions, txScrollStrategy, watchOrigin } from "@tectra-ng/core/overlay";
13
+ import { TxOverlayAnchor, TxOverlayInsets, TxOverlayRoom, TxPanelWidth, placementFromPosition, txAnimateEnter, txAnimateLeave, txFieldPositions, txScrollStrategy, watchOrigin } from "@tectra-ng/core/overlay";
14
14
  import { optionalBoolean } from "@tectra-ng/core/utils";
15
15
  import { NG_VALUE_ACCESSOR } from "@angular/forms";
16
16
  const SELECT_ICON_DEFAULTS = {
@@ -1646,6 +1646,8 @@ i0.ɵɵngDeclareClassMetadata({
1646
1646
  }]
1647
1647
  }
1648
1648
  });
1649
+ const CUT_CONTENT = ".tx-select__option-label, .tx-select__list--virtual";
1650
+ const VIRTUAL_ROW = ".tx-select__list--virtual .tx-select__option";
1649
1651
  var TxSelectBase = class TxSelectBase extends TxOptionsBase {
1650
1652
  placeholder = input("", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
1651
1653
  inputId = input(void 0, ...ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []);
@@ -1681,9 +1683,10 @@ var TxSelectBase = class TxSelectBase extends TxOptionsBase {
1681
1683
  overlayInsets = inject(TxOverlayInsets);
1682
1684
  stopWatchingTrigger = null;
1683
1685
  hasEntered = false;
1686
+ widthPending = false;
1684
1687
  stopWatching = inject(DestroyRef).onDestroy(() => this.stopWatchingTrigger?.());
1685
1688
  isInvalid = injectFieldInvalid(this.invalid);
1686
- room = new TxOverlayRoom(txPositions("bottom-start", 4));
1689
+ room = new TxOverlayRoom(txFieldPositions(4));
1687
1690
  connectedOverlay = viewChild(CdkConnectedOverlay, ...ngDevMode ? [{ debugName: "connectedOverlay" }] : /* istanbul ignore next */ []);
1688
1691
  positions = this.room.positions;
1689
1692
  scrollStrategy = txScrollStrategy(this.injector);
@@ -1691,7 +1694,7 @@ var TxSelectBase = class TxSelectBase extends TxOptionsBase {
1691
1694
  isOpen = signal(false, ...ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []);
1692
1695
  isPanelMounted = signal(false, ...ngDevMode ? [{ debugName: "isPanelMounted" }] : /* istanbul ignore next */ []);
1693
1696
  panelPlacement = signal("bottom-start", ...ngDevMode ? [{ debugName: "panelPlacement" }] : /* istanbul ignore next */ []);
1694
- panelWidth = signal(0, ...ngDevMode ? [{ debugName: "panelWidth" }] : /* istanbul ignore next */ []);
1697
+ panelWidth = new TxPanelWidth({ maxWidth: "var(--tx-select-overlay-max-width)" });
1695
1698
  canClear = computed(() => this.showClear() && this.hasValue() && !this.disabled() && !this.readonly(), ...ngDevMode ? [{ debugName: "canClear" }] : /* istanbul ignore next */ []);
1696
1699
  isListActive() {
1697
1700
  return this.isOpen();
@@ -1701,7 +1704,8 @@ var TxSelectBase = class TxSelectBase extends TxOptionsBase {
1701
1704
  }
1702
1705
  open() {
1703
1706
  if (this.disabled() || this.readonly() || this.isOpen()) return;
1704
- this.panelWidth.set(this.box().nativeElement.offsetWidth);
1707
+ this.panelWidth.open(this.box().nativeElement);
1708
+ this.widthPending = false;
1705
1709
  this.activeIndex.set(-1);
1706
1710
  this.isOpen.set(true);
1707
1711
  this.hasEntered = false;
@@ -1766,6 +1770,7 @@ var TxSelectBase = class TxSelectBase extends TxOptionsBase {
1766
1770
  onPositionChange(change) {
1767
1771
  this.panelPlacement.set(placementFromPosition(change.connectionPair) ?? "bottom-start");
1768
1772
  const panel = this.panel()?.nativeElement;
1773
+ if (!this.hasEntered) this.lockPanelWidth(panel);
1769
1774
  if (!this.hasEntered && this.room.fit(this.box().nativeElement, panel, this.connectedOverlay(), this.injector)) return;
1770
1775
  if (!this.hasEntered && panel) {
1771
1776
  this.hasEntered = true;
@@ -1774,6 +1779,23 @@ var TxSelectBase = class TxSelectBase extends TxOptionsBase {
1774
1779
  this.optionList()?.scrollToIndex(this.activeIndex() >= 0 ? this.activeIndex() : selected);
1775
1780
  }
1776
1781
  }
1782
+ lockPanelWidth(panel) {
1783
+ if (panel && this.virtualScroll() && this.rows().length && !panel.querySelector(VIRTUAL_ROW)) {
1784
+ this.widthPending = true;
1785
+ return;
1786
+ }
1787
+ this.panelWidth.lock(panel, CUT_CONTENT);
1788
+ }
1789
+ onRangeChange(range) {
1790
+ super.onRangeChange(range);
1791
+ if (this.widthPending) {
1792
+ this.widthPending = false;
1793
+ afterNextRender(() => {
1794
+ this.panelWidth.lock(this.panel()?.nativeElement, CUT_CONTENT);
1795
+ this.connectedOverlay()?.overlayRef?.updatePosition();
1796
+ }, { injector: this.injector });
1797
+ }
1798
+ }
1777
1799
  onPanelDetach() {
1778
1800
  this.isPanelMounted.set(false);
1779
1801
  this.close();
@@ -2283,6 +2305,7 @@ var TxSelect = class TxSelect extends TxSelectBase {
2283
2305
  }), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
2284
2306
  panelStyle = computed(() => ({
2285
2307
  ...this.tokenStyle(),
2308
+ ...this.panelWidth.style(),
2286
2309
  ...this.passThrough().panel?.style
2287
2310
  }), ...ngDevMode ? [{ debugName: "panelStyle" }] : /* istanbul ignore next */ []);
2288
2311
  get typingTarget() {
@@ -2446,7 +2469,7 @@ var TxSelect = class TxSelect extends TxSelectBase {
2446
2469
  }],
2447
2470
  usesInheritance: true,
2448
2471
  ngImport: i0,
2449
- template: "<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- the combobox inside the box takes focus and keys; the box only widens the click area -->\n<div\n #box\n #origin=\"cdkOverlayOrigin\"\n cdkOverlayOrigin\n class=\"tx-select__box\"\n [class]=\"passThrough().box?.class\"\n [style]=\"passThrough().box?.style\"\n (click)=\"onBoxClick($event)\"\n>\n @if (editable()) {\n <input\n #trigger\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n class=\"tx-select__trigger tx-select__input\"\n aria-autocomplete=\"none\"\n aria-haspopup=\"listbox\"\n [class]=\"passThrough().trigger?.class\"\n [style]=\"passThrough().trigger?.style\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.id]=\"inputId() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? (ariaLabelledBy() || inputId() ? null : placeholder() || null)\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-activedescendant]=\"activeItemId()\"\n [attr.aria-busy]=\"loading() || null\"\n [placeholder]=\"placeholder()\"\n [value]=\"editableText()\"\n [readOnly]=\"readonly()\"\n [disabled]=\"disabled()\"\n (input)=\"onEditableInput($event)\"\n (keydown)=\"onKeydown($event)\"\n />\n } @else {\n <button\n #trigger\n type=\"button\"\n role=\"combobox\"\n class=\"tx-select__trigger\"\n aria-haspopup=\"listbox\"\n [class]=\"passThrough().trigger?.class\"\n [style]=\"passThrough().trigger?.style\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.id]=\"inputId() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? (ariaLabelledBy() || inputId() ? null : placeholder() || null)\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-activedescendant]=\"filter() ? null : activeItemId()\"\n [attr.aria-busy]=\"loading() || null\"\n [disabled]=\"disabled()\"\n (keydown)=\"onKeydown($event)\"\n >\n @if (selectedItem(); as item) {\n <span class=\"tx-select__value\" [class]=\"passThrough().value?.class\" [style]=\"passThrough().value?.style\">\n @if (valueTemplate() ?? optionTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.option, selected: true, disabled: item.disabled, index: item.index }\"\n />\n } @else {\n {{ item.label }}\n }\n </span>\n } @else {\n <span class=\"tx-select__value tx-select__value--placeholder\" [class]=\"passThrough().value?.class\" [style]=\"passThrough().value?.style\">{{\n placeholder()\n }}</span>\n }\n </button>\n }\n @if (canClear()) {\n <button\n type=\"button\"\n class=\"tx-select__clear\"\n [class]=\"passThrough().clear?.class\"\n [style]=\"passThrough().clear?.style\"\n [attr.aria-label]=\"translations().clear\"\n (click)=\"clear()\"\n >\n <tx-icon [name]=\"'times'\" />\n </button>\n }\n <span class=\"tx-select__dropdown\" aria-hidden=\"true\" [class]=\"passThrough().dropdown?.class\" [style]=\"passThrough().dropdown?.style\">\n @if (loading()) {\n <tx-icon class=\"tx-select__spinner\" [name]=\"'spinner'\" />\n } @else {\n <tx-icon class=\"tx-select__chevron\" [name]=\"dropdownIcon()\" />\n }\n </span>\n</div>\n\n<ng-template\n cdkConnectedOverlay\n txOverlayAnchor\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"isPanelMounted()\"\n [cdkConnectedOverlayPositions]=\"positions()\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayViewportMargin]=\"viewportMargin()\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n [cdkConnectedOverlayWidth]=\"panelWidth()\"\n (overlayOutsideClick)=\"onOutsideClick($event)\"\n (attach)=\"onPanelAttach()\"\n (positionChange)=\"onPositionChange($event)\"\n (detach)=\"onPanelDetach()\"\n>\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the panel only listens to keys and focus that bubble from its search field and actions -->\n <div\n #panel\n class=\"tx-select__panel\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [attr.data-size]=\"size()\"\n [class]=\"passThrough().panel?.class\"\n [style]=\"panelStyle()\"\n (keydown)=\"onPanelKeydown($event)\"\n (mousedown)=\"onPanelMousedown($event)\"\n (focusout)=\"onPanelFocusOut($event)\"\n >\n @if (headerTemplate(); as template) {\n <div class=\"tx-select__header\" [class]=\"passThrough().header?.class\" [style]=\"passThrough().header?.style\">\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n </div>\n }\n @if (filter()) {\n <div class=\"tx-select__filter\" [class]=\"passThrough().filter?.class\" [style]=\"passThrough().filter?.style\">\n <span class=\"tx-select__filter-field\">\n <input\n #filterInput\n type=\"text\"\n autocomplete=\"off\"\n class=\"tx-select__filter-input\"\n role=\"searchbox\"\n [class]=\"passThrough().filterInput?.class\"\n [style]=\"passThrough().filterInput?.style\"\n [attr.aria-label]=\"filterPlaceholder() ?? translations().searchPlaceholder\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeItemId()\"\n [placeholder]=\"filterPlaceholder() ?? translations().searchPlaceholder\"\n [value]=\"query()\"\n (input)=\"onFilterInput($event)\"\n (keydown)=\"onKeydown($event)\"\n />\n <tx-icon class=\"tx-select__filter-icon\" [name]=\"'search'\" />\n </span>\n </div>\n }\n <tx-option-list\n [rows]=\"rows()\"\n [listboxId]=\"listboxId\"\n [activeIndex]=\"activeIndex()\"\n [checkmark]=\"checkmark()\"\n [virtualScroll]=\"virtualScroll()\"\n [itemSize]=\"virtualScrollItemSize()\"\n [scrollHeight]=\"scrollHeight()\"\n [loading]=\"loading()\"\n [query]=\"query()\"\n [emptyText]=\"emptyText()\"\n [loadingText]=\"translations().loading\"\n [optionTemplate]=\"optionTemplate()?.templateRef\"\n [groupTemplate]=\"groupTemplate()?.templateRef\"\n [emptyTemplate]=\"emptyTemplate()?.templateRef\"\n [emptyFilterTemplate]=\"emptyFilterTemplate()?.templateRef\"\n [passThrough]=\"passThrough()\"\n [unstyled]=\"isUnstyled()\"\n (optionClick)=\"onOptionClick($event)\"\n (optionHover)=\"activeIndex.set($event)\"\n (rangeChange)=\"onRangeChange($event)\"\n />\n @if (footerTemplate(); as template) {\n <div class=\"tx-select__footer\" [class]=\"passThrough().footer?.class\" [style]=\"passThrough().footer?.style\">\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n </div>\n }\n </div>\n</ng-template>\n",
2472
+ template: "<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- the combobox inside the box takes focus and keys; the box only widens the click area -->\n<div\n #box\n #origin=\"cdkOverlayOrigin\"\n cdkOverlayOrigin\n class=\"tx-select__box\"\n [class]=\"passThrough().box?.class\"\n [style]=\"passThrough().box?.style\"\n (click)=\"onBoxClick($event)\"\n>\n @if (editable()) {\n <input\n #trigger\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n class=\"tx-select__trigger tx-select__input\"\n aria-autocomplete=\"none\"\n aria-haspopup=\"listbox\"\n [class]=\"passThrough().trigger?.class\"\n [style]=\"passThrough().trigger?.style\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.id]=\"inputId() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? (ariaLabelledBy() || inputId() ? null : placeholder() || null)\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-activedescendant]=\"activeItemId()\"\n [attr.aria-busy]=\"loading() || null\"\n [placeholder]=\"placeholder()\"\n [value]=\"editableText()\"\n [readOnly]=\"readonly()\"\n [disabled]=\"disabled()\"\n (input)=\"onEditableInput($event)\"\n (keydown)=\"onKeydown($event)\"\n />\n } @else {\n <button\n #trigger\n type=\"button\"\n role=\"combobox\"\n class=\"tx-select__trigger\"\n aria-haspopup=\"listbox\"\n [class]=\"passThrough().trigger?.class\"\n [style]=\"passThrough().trigger?.style\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.id]=\"inputId() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? (ariaLabelledBy() || inputId() ? null : placeholder() || null)\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-activedescendant]=\"filter() ? null : activeItemId()\"\n [attr.aria-busy]=\"loading() || null\"\n [disabled]=\"disabled()\"\n (keydown)=\"onKeydown($event)\"\n >\n @if (selectedItem(); as item) {\n <span class=\"tx-select__value\" [class]=\"passThrough().value?.class\" [style]=\"passThrough().value?.style\">\n @if (valueTemplate() ?? optionTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.option, selected: true, disabled: item.disabled, index: item.index }\"\n />\n } @else {\n {{ item.label }}\n }\n </span>\n } @else {\n <span class=\"tx-select__value tx-select__value--placeholder\" [class]=\"passThrough().value?.class\" [style]=\"passThrough().value?.style\">{{\n placeholder()\n }}</span>\n }\n </button>\n }\n @if (canClear()) {\n <button\n type=\"button\"\n class=\"tx-select__clear\"\n [class]=\"passThrough().clear?.class\"\n [style]=\"passThrough().clear?.style\"\n [attr.aria-label]=\"translations().clear\"\n (click)=\"clear()\"\n >\n <tx-icon [name]=\"'times'\" />\n </button>\n }\n <span class=\"tx-select__dropdown\" aria-hidden=\"true\" [class]=\"passThrough().dropdown?.class\" [style]=\"passThrough().dropdown?.style\">\n @if (loading()) {\n <tx-icon class=\"tx-select__spinner\" [name]=\"'spinner'\" />\n } @else {\n <tx-icon class=\"tx-select__chevron\" [name]=\"dropdownIcon()\" />\n }\n </span>\n</div>\n\n<ng-template\n cdkConnectedOverlay\n txOverlayAnchor\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"isPanelMounted()\"\n [cdkConnectedOverlayPositions]=\"positions()\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayViewportMargin]=\"viewportMargin()\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n (overlayOutsideClick)=\"onOutsideClick($event)\"\n (attach)=\"onPanelAttach()\"\n (positionChange)=\"onPositionChange($event)\"\n (detach)=\"onPanelDetach()\"\n>\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the panel only listens to keys and focus that bubble from its search field and actions -->\n <div\n #panel\n class=\"tx-select__panel\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [attr.data-size]=\"size()\"\n [class]=\"passThrough().panel?.class\"\n [style]=\"panelStyle()\"\n (keydown)=\"onPanelKeydown($event)\"\n (mousedown)=\"onPanelMousedown($event)\"\n (focusout)=\"onPanelFocusOut($event)\"\n >\n @if (headerTemplate(); as template) {\n <div class=\"tx-select__header\" [class]=\"passThrough().header?.class\" [style]=\"passThrough().header?.style\">\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n </div>\n }\n @if (filter()) {\n <div class=\"tx-select__filter\" [class]=\"passThrough().filter?.class\" [style]=\"passThrough().filter?.style\">\n <span class=\"tx-select__filter-field\">\n <input\n #filterInput\n type=\"text\"\n autocomplete=\"off\"\n class=\"tx-select__filter-input\"\n role=\"searchbox\"\n [class]=\"passThrough().filterInput?.class\"\n [style]=\"passThrough().filterInput?.style\"\n [attr.aria-label]=\"filterPlaceholder() ?? translations().searchPlaceholder\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeItemId()\"\n [placeholder]=\"filterPlaceholder() ?? translations().searchPlaceholder\"\n [value]=\"query()\"\n (input)=\"onFilterInput($event)\"\n (keydown)=\"onKeydown($event)\"\n />\n <tx-icon class=\"tx-select__filter-icon\" [name]=\"'search'\" />\n </span>\n </div>\n }\n <tx-option-list\n [rows]=\"rows()\"\n [listboxId]=\"listboxId\"\n [activeIndex]=\"activeIndex()\"\n [checkmark]=\"checkmark()\"\n [virtualScroll]=\"virtualScroll()\"\n [itemSize]=\"virtualScrollItemSize()\"\n [scrollHeight]=\"scrollHeight()\"\n [loading]=\"loading()\"\n [query]=\"query()\"\n [emptyText]=\"emptyText()\"\n [loadingText]=\"translations().loading\"\n [optionTemplate]=\"optionTemplate()?.templateRef\"\n [groupTemplate]=\"groupTemplate()?.templateRef\"\n [emptyTemplate]=\"emptyTemplate()?.templateRef\"\n [emptyFilterTemplate]=\"emptyFilterTemplate()?.templateRef\"\n [passThrough]=\"passThrough()\"\n [unstyled]=\"isUnstyled()\"\n (optionClick)=\"onOptionClick($event)\"\n (optionHover)=\"activeIndex.set($event)\"\n (rangeChange)=\"onRangeChange($event)\"\n />\n @if (footerTemplate(); as template) {\n <div class=\"tx-select__footer\" [class]=\"passThrough().footer?.class\" [style]=\"passThrough().footer?.style\">\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n </div>\n }\n </div>\n</ng-template>\n",
2450
2473
  styles: [":host{display:block;width:100%}.tx-select__box{display:flex;align-items:center;cursor:pointer}.tx-select__trigger{flex:1 1 auto;min-width:0}.tx-select__value{display:block;min-height:1lh;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-select__dropdown{display:inline-flex}:host(.tx-select--disabled) .tx-select__box{cursor:not-allowed}:host(.tx-select--readonly) .tx-select__box{cursor:default}:host([data-styled]){font-family:var(--tx-font-family)}:host([data-styled]) .tx-select__box{box-sizing:border-box;padding-top:var(--tx-field-padding-top, var(--tx-form-field-padding-y));padding-bottom:var(--tx-field-padding-bottom, var(--tx-form-field-padding-y));padding-inline:calc(var(--tx-form-field-padding-x) + var(--tx-field-inset-start, 0px)) calc(var(--tx-form-field-padding-x) + var(--tx-field-inset-end, 0px));border:1px solid var(--tx-form-field-border-color);border-start-start-radius:var(--tx-field-radius-start, var(--tx-form-field-border-radius));border-end-start-radius:var(--tx-field-radius-start, var(--tx-form-field-border-radius));border-start-end-radius:var(--tx-field-radius-end, var(--tx-form-field-border-radius));border-end-end-radius:var(--tx-field-radius-end, var(--tx-form-field-border-radius));outline:none;background-color:var(--tx-form-field-background);box-shadow:var(--tx-form-field-shadow);color:var(--tx-form-field-color);font-family:var(--tx-font-family);font-size:var(--tx-form-field-font-size);line-height:var(--tx-form-field-line-height);transition:background-color var(--tx-form-field-transition-duration),border-color var(--tx-form-field-transition-duration),box-shadow var(--tx-form-field-transition-duration);--_px: var(--tx-form-field-padding-x);--_py: var(--tx-form-field-padding-y);gap:var(--tx-select-gap);width:100%;padding-inline-end:0}:host([data-styled])[data-variant=filled] .tx-select__box{background-color:var(--tx-form-field-filled-background)}:host([data-styled]):not(.tx-select--disabled,.tx-select--readonly) .tx-select__box:not(:has(.tx-select__trigger:focus)):hover{border-color:var(--tx-form-field-hover-border-color)}:host([data-styled])[data-variant=filled]:not(.tx-select--disabled,.tx-select--readonly) .tx-select__box:not(:has(.tx-select__trigger:focus)):hover{background-color:var(--tx-form-field-filled-hover-background)}:host([data-styled]) .tx-select__box:has(.tx-select__trigger:focus){border-color:var(--tx-form-field-focus-border-color);outline:var(--tx-form-field-focus-ring-width) var(--tx-form-field-focus-ring-style) var(--tx-form-field-focus-ring-color);outline-offset:var(--tx-form-field-focus-ring-offset);box-shadow:var(--tx-form-field-focus-ring-shadow)}:host([data-styled])[data-variant=filled] .tx-select__box:has(.tx-select__trigger:focus){background-color:var(--tx-form-field-filled-focus-background)}:host([data-styled]).tx-select--readonly .tx-select__box,:host([data-styled]).tx-select--readonly .tx-select__box:hover{background-color:var(--tx-form-field-readonly-background);caret-color:transparent;cursor:default;border-color:var(--tx-form-field-border-color)}:host([data-styled]).tx-select--invalid .tx-select__box{border-color:var(--tx-form-field-invalid-border-color)}:host([data-styled]).tx-select--invalid .tx-select__box:has(.tx-select__trigger:focus){border-color:var(--tx-form-field-invalid-border-color);box-shadow:var(--tx-form-field-invalid-focus-ring-shadow)}:host([data-styled]).tx-select--disabled .tx-select__box{background-color:var(--tx-form-field-disabled-background);box-shadow:none;color:var(--tx-form-field-disabled-color);cursor:not-allowed}:host([data-styled])[data-size=small] .tx-select__box{padding-top:var(--tx-field-padding-top, var(--tx-form-field-sm-padding-y));padding-bottom:var(--tx-field-padding-bottom, var(--tx-form-field-sm-padding-y));padding-inline:calc(var(--tx-form-field-sm-padding-x) + var(--tx-field-inset-start, 0px)) calc(var(--tx-form-field-sm-padding-x) + var(--tx-field-inset-end, 0px));font-size:var(--tx-form-field-sm-font-size);line-height:var(--tx-form-field-sm-line-height);--_px: var(--tx-form-field-sm-padding-x);--_py: var(--tx-form-field-sm-padding-y);padding-inline-end:0}:host([data-styled])[data-size=large] .tx-select__box{padding-top:var(--tx-field-padding-top, var(--tx-form-field-lg-padding-y));padding-bottom:var(--tx-field-padding-bottom, var(--tx-form-field-lg-padding-y));padding-inline:calc(var(--tx-form-field-lg-padding-x) + var(--tx-field-inset-start, 0px)) calc(var(--tx-form-field-lg-padding-x) + var(--tx-field-inset-end, 0px));font-size:var(--tx-form-field-lg-font-size);line-height:var(--tx-form-field-lg-line-height);--_px: var(--tx-form-field-lg-padding-x);--_py: var(--tx-form-field-lg-padding-y);padding-inline-end:0}:host([data-styled]) .tx-select__trigger{padding:0;padding-inline-end:var(--_px);border:none;outline:none;background:transparent;color:inherit;font:inherit;line-height:inherit;text-align:left;cursor:inherit}:host([data-styled]) .tx-select__input{cursor:text}:host([data-styled]) .tx-select__input::placeholder{color:var(--tx-form-field-placeholder-color)}:host([data-styled]) .tx-select__input:disabled{cursor:not-allowed}:host([data-styled]).tx-select--invalid .tx-select__input::placeholder{color:var(--tx-form-field-invalid-placeholder-color)}:host([data-styled]) .tx-select__value--placeholder{color:var(--tx-form-field-placeholder-color)}:host([data-styled])[data-variant=filled] .tx-select__value--placeholder,:host([data-styled])[data-variant=filled] .tx-select__input::placeholder{color:var(--tx-form-field-filled-placeholder-color)}:host([data-styled]).tx-select--invalid .tx-select__value--placeholder{color:var(--tx-form-field-invalid-placeholder-color)}:host([data-styled]) .tx-select__clear{display:grid;flex:none;place-items:center;width:var(--tx-select-clear-size);height:var(--tx-select-clear-size);padding:0;border:none;border-radius:var(--tx-radius-full);background:none;color:var(--tx-select-dropdown-color);font-size:var(--tx-select-clear-size);cursor:pointer;transition:color var(--tx-motion-duration) var(--tx-motion-easing)}:host([data-styled]) .tx-select__clear:hover{color:var(--tx-form-field-color)}:host([data-styled]) .tx-select__clear:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:2px}:host([data-styled]) .tx-select__dropdown{flex:none;align-items:center;align-self:stretch;justify-content:center;width:var(--tx-select-dropdown-width);color:var(--tx-select-dropdown-color)}:host([data-styled]) .tx-select__spinner{animation:tx-select-spin .8s linear infinite}@keyframes tx-select-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-select__spinner{animation-duration:2.4s}}.tx-select__panel{box-sizing:border-box;width:100%}.tx-select__panel[data-styled]{overflow:hidden;border:1px solid var(--tx-select-overlay-border-color);border-radius:var(--tx-select-overlay-border-radius);background:var(--tx-select-overlay-background);box-shadow:var(--tx-select-overlay-shadow);color:var(--tx-select-option-color);font-family:var(--tx-font-family);font-size:var(--tx-form-field-font-size);line-height:var(--tx-form-field-line-height)}.tx-select__panel[data-styled] .tx-select__header{padding:var(--tx-select-header-padding)}.tx-select__panel[data-styled] .tx-select__footer{padding:var(--tx-select-footer-padding)}.tx-select__panel[data-styled] .tx-select__filter{display:flex;align-items:center;gap:var(--tx-select-filter-gap);padding:var(--tx-select-filter-padding)}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-field{position:relative;display:flex;flex:1 1 auto;align-items:center;min-width:0}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-input{box-sizing:border-box;padding-top:var(--tx-field-padding-top, var(--tx-form-field-padding-y));padding-bottom:var(--tx-field-padding-bottom, var(--tx-form-field-padding-y));padding-inline:calc(var(--tx-form-field-padding-x) + var(--tx-field-inset-start, 0px)) calc(var(--tx-form-field-padding-x) + var(--tx-field-inset-end, 0px));border:1px solid var(--tx-form-field-border-color);border-start-start-radius:var(--tx-field-radius-start, var(--tx-form-field-border-radius));border-end-start-radius:var(--tx-field-radius-start, var(--tx-form-field-border-radius));border-start-end-radius:var(--tx-field-radius-end, var(--tx-form-field-border-radius));border-end-end-radius:var(--tx-field-radius-end, var(--tx-form-field-border-radius));outline:none;background-color:var(--tx-form-field-background);box-shadow:var(--tx-form-field-shadow);color:var(--tx-form-field-color);font-family:var(--tx-font-family);font-size:var(--tx-form-field-font-size);line-height:var(--tx-form-field-line-height);transition:background-color var(--tx-form-field-transition-duration),border-color var(--tx-form-field-transition-duration),box-shadow var(--tx-form-field-transition-duration);width:100%;min-width:0;padding-inline-end:calc(var(--tx-form-field-padding-x) + 1em + var(--tx-select-filter-icon-inset))}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-input:hover{border-color:var(--tx-form-field-hover-border-color)}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-input:focus{border-color:var(--tx-form-field-focus-border-color);outline:var(--tx-form-field-focus-ring-width) var(--tx-form-field-focus-ring-style) var(--tx-form-field-focus-ring-color);outline-offset:var(--tx-form-field-focus-ring-offset);box-shadow:var(--tx-form-field-focus-ring-shadow)}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-input::placeholder{color:var(--tx-form-field-placeholder-color)}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-icon{position:absolute;right:var(--tx-select-filter-icon-inset);color:var(--tx-form-field-icon-color);pointer-events:none}\n"],
2451
2474
  dependencies: [
2452
2475
  {
@@ -2600,7 +2623,7 @@ i0.ɵɵngDeclareClassMetadata({
2600
2623
  "[class.tx-select--editable]": "editable()"
2601
2624
  },
2602
2625
  viewProviders: [provideTxIconDefaults(SELECT_ICON_DEFAULTS)],
2603
- template: "<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- the combobox inside the box takes focus and keys; the box only widens the click area -->\n<div\n #box\n #origin=\"cdkOverlayOrigin\"\n cdkOverlayOrigin\n class=\"tx-select__box\"\n [class]=\"passThrough().box?.class\"\n [style]=\"passThrough().box?.style\"\n (click)=\"onBoxClick($event)\"\n>\n @if (editable()) {\n <input\n #trigger\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n class=\"tx-select__trigger tx-select__input\"\n aria-autocomplete=\"none\"\n aria-haspopup=\"listbox\"\n [class]=\"passThrough().trigger?.class\"\n [style]=\"passThrough().trigger?.style\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.id]=\"inputId() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? (ariaLabelledBy() || inputId() ? null : placeholder() || null)\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-activedescendant]=\"activeItemId()\"\n [attr.aria-busy]=\"loading() || null\"\n [placeholder]=\"placeholder()\"\n [value]=\"editableText()\"\n [readOnly]=\"readonly()\"\n [disabled]=\"disabled()\"\n (input)=\"onEditableInput($event)\"\n (keydown)=\"onKeydown($event)\"\n />\n } @else {\n <button\n #trigger\n type=\"button\"\n role=\"combobox\"\n class=\"tx-select__trigger\"\n aria-haspopup=\"listbox\"\n [class]=\"passThrough().trigger?.class\"\n [style]=\"passThrough().trigger?.style\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.id]=\"inputId() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? (ariaLabelledBy() || inputId() ? null : placeholder() || null)\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-activedescendant]=\"filter() ? null : activeItemId()\"\n [attr.aria-busy]=\"loading() || null\"\n [disabled]=\"disabled()\"\n (keydown)=\"onKeydown($event)\"\n >\n @if (selectedItem(); as item) {\n <span class=\"tx-select__value\" [class]=\"passThrough().value?.class\" [style]=\"passThrough().value?.style\">\n @if (valueTemplate() ?? optionTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.option, selected: true, disabled: item.disabled, index: item.index }\"\n />\n } @else {\n {{ item.label }}\n }\n </span>\n } @else {\n <span class=\"tx-select__value tx-select__value--placeholder\" [class]=\"passThrough().value?.class\" [style]=\"passThrough().value?.style\">{{\n placeholder()\n }}</span>\n }\n </button>\n }\n @if (canClear()) {\n <button\n type=\"button\"\n class=\"tx-select__clear\"\n [class]=\"passThrough().clear?.class\"\n [style]=\"passThrough().clear?.style\"\n [attr.aria-label]=\"translations().clear\"\n (click)=\"clear()\"\n >\n <tx-icon [name]=\"'times'\" />\n </button>\n }\n <span class=\"tx-select__dropdown\" aria-hidden=\"true\" [class]=\"passThrough().dropdown?.class\" [style]=\"passThrough().dropdown?.style\">\n @if (loading()) {\n <tx-icon class=\"tx-select__spinner\" [name]=\"'spinner'\" />\n } @else {\n <tx-icon class=\"tx-select__chevron\" [name]=\"dropdownIcon()\" />\n }\n </span>\n</div>\n\n<ng-template\n cdkConnectedOverlay\n txOverlayAnchor\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"isPanelMounted()\"\n [cdkConnectedOverlayPositions]=\"positions()\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayViewportMargin]=\"viewportMargin()\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n [cdkConnectedOverlayWidth]=\"panelWidth()\"\n (overlayOutsideClick)=\"onOutsideClick($event)\"\n (attach)=\"onPanelAttach()\"\n (positionChange)=\"onPositionChange($event)\"\n (detach)=\"onPanelDetach()\"\n>\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the panel only listens to keys and focus that bubble from its search field and actions -->\n <div\n #panel\n class=\"tx-select__panel\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [attr.data-size]=\"size()\"\n [class]=\"passThrough().panel?.class\"\n [style]=\"panelStyle()\"\n (keydown)=\"onPanelKeydown($event)\"\n (mousedown)=\"onPanelMousedown($event)\"\n (focusout)=\"onPanelFocusOut($event)\"\n >\n @if (headerTemplate(); as template) {\n <div class=\"tx-select__header\" [class]=\"passThrough().header?.class\" [style]=\"passThrough().header?.style\">\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n </div>\n }\n @if (filter()) {\n <div class=\"tx-select__filter\" [class]=\"passThrough().filter?.class\" [style]=\"passThrough().filter?.style\">\n <span class=\"tx-select__filter-field\">\n <input\n #filterInput\n type=\"text\"\n autocomplete=\"off\"\n class=\"tx-select__filter-input\"\n role=\"searchbox\"\n [class]=\"passThrough().filterInput?.class\"\n [style]=\"passThrough().filterInput?.style\"\n [attr.aria-label]=\"filterPlaceholder() ?? translations().searchPlaceholder\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeItemId()\"\n [placeholder]=\"filterPlaceholder() ?? translations().searchPlaceholder\"\n [value]=\"query()\"\n (input)=\"onFilterInput($event)\"\n (keydown)=\"onKeydown($event)\"\n />\n <tx-icon class=\"tx-select__filter-icon\" [name]=\"'search'\" />\n </span>\n </div>\n }\n <tx-option-list\n [rows]=\"rows()\"\n [listboxId]=\"listboxId\"\n [activeIndex]=\"activeIndex()\"\n [checkmark]=\"checkmark()\"\n [virtualScroll]=\"virtualScroll()\"\n [itemSize]=\"virtualScrollItemSize()\"\n [scrollHeight]=\"scrollHeight()\"\n [loading]=\"loading()\"\n [query]=\"query()\"\n [emptyText]=\"emptyText()\"\n [loadingText]=\"translations().loading\"\n [optionTemplate]=\"optionTemplate()?.templateRef\"\n [groupTemplate]=\"groupTemplate()?.templateRef\"\n [emptyTemplate]=\"emptyTemplate()?.templateRef\"\n [emptyFilterTemplate]=\"emptyFilterTemplate()?.templateRef\"\n [passThrough]=\"passThrough()\"\n [unstyled]=\"isUnstyled()\"\n (optionClick)=\"onOptionClick($event)\"\n (optionHover)=\"activeIndex.set($event)\"\n (rangeChange)=\"onRangeChange($event)\"\n />\n @if (footerTemplate(); as template) {\n <div class=\"tx-select__footer\" [class]=\"passThrough().footer?.class\" [style]=\"passThrough().footer?.style\">\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n </div>\n }\n </div>\n</ng-template>\n",
2626
+ template: "<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- the combobox inside the box takes focus and keys; the box only widens the click area -->\n<div\n #box\n #origin=\"cdkOverlayOrigin\"\n cdkOverlayOrigin\n class=\"tx-select__box\"\n [class]=\"passThrough().box?.class\"\n [style]=\"passThrough().box?.style\"\n (click)=\"onBoxClick($event)\"\n>\n @if (editable()) {\n <input\n #trigger\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n class=\"tx-select__trigger tx-select__input\"\n aria-autocomplete=\"none\"\n aria-haspopup=\"listbox\"\n [class]=\"passThrough().trigger?.class\"\n [style]=\"passThrough().trigger?.style\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.id]=\"inputId() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? (ariaLabelledBy() || inputId() ? null : placeholder() || null)\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-activedescendant]=\"activeItemId()\"\n [attr.aria-busy]=\"loading() || null\"\n [placeholder]=\"placeholder()\"\n [value]=\"editableText()\"\n [readOnly]=\"readonly()\"\n [disabled]=\"disabled()\"\n (input)=\"onEditableInput($event)\"\n (keydown)=\"onKeydown($event)\"\n />\n } @else {\n <button\n #trigger\n type=\"button\"\n role=\"combobox\"\n class=\"tx-select__trigger\"\n aria-haspopup=\"listbox\"\n [class]=\"passThrough().trigger?.class\"\n [style]=\"passThrough().trigger?.style\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.id]=\"inputId() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? (ariaLabelledBy() || inputId() ? null : placeholder() || null)\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-activedescendant]=\"filter() ? null : activeItemId()\"\n [attr.aria-busy]=\"loading() || null\"\n [disabled]=\"disabled()\"\n (keydown)=\"onKeydown($event)\"\n >\n @if (selectedItem(); as item) {\n <span class=\"tx-select__value\" [class]=\"passThrough().value?.class\" [style]=\"passThrough().value?.style\">\n @if (valueTemplate() ?? optionTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.option, selected: true, disabled: item.disabled, index: item.index }\"\n />\n } @else {\n {{ item.label }}\n }\n </span>\n } @else {\n <span class=\"tx-select__value tx-select__value--placeholder\" [class]=\"passThrough().value?.class\" [style]=\"passThrough().value?.style\">{{\n placeholder()\n }}</span>\n }\n </button>\n }\n @if (canClear()) {\n <button\n type=\"button\"\n class=\"tx-select__clear\"\n [class]=\"passThrough().clear?.class\"\n [style]=\"passThrough().clear?.style\"\n [attr.aria-label]=\"translations().clear\"\n (click)=\"clear()\"\n >\n <tx-icon [name]=\"'times'\" />\n </button>\n }\n <span class=\"tx-select__dropdown\" aria-hidden=\"true\" [class]=\"passThrough().dropdown?.class\" [style]=\"passThrough().dropdown?.style\">\n @if (loading()) {\n <tx-icon class=\"tx-select__spinner\" [name]=\"'spinner'\" />\n } @else {\n <tx-icon class=\"tx-select__chevron\" [name]=\"dropdownIcon()\" />\n }\n </span>\n</div>\n\n<ng-template\n cdkConnectedOverlay\n txOverlayAnchor\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"isPanelMounted()\"\n [cdkConnectedOverlayPositions]=\"positions()\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayViewportMargin]=\"viewportMargin()\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n (overlayOutsideClick)=\"onOutsideClick($event)\"\n (attach)=\"onPanelAttach()\"\n (positionChange)=\"onPositionChange($event)\"\n (detach)=\"onPanelDetach()\"\n>\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the panel only listens to keys and focus that bubble from its search field and actions -->\n <div\n #panel\n class=\"tx-select__panel\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [attr.data-size]=\"size()\"\n [class]=\"passThrough().panel?.class\"\n [style]=\"panelStyle()\"\n (keydown)=\"onPanelKeydown($event)\"\n (mousedown)=\"onPanelMousedown($event)\"\n (focusout)=\"onPanelFocusOut($event)\"\n >\n @if (headerTemplate(); as template) {\n <div class=\"tx-select__header\" [class]=\"passThrough().header?.class\" [style]=\"passThrough().header?.style\">\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n </div>\n }\n @if (filter()) {\n <div class=\"tx-select__filter\" [class]=\"passThrough().filter?.class\" [style]=\"passThrough().filter?.style\">\n <span class=\"tx-select__filter-field\">\n <input\n #filterInput\n type=\"text\"\n autocomplete=\"off\"\n class=\"tx-select__filter-input\"\n role=\"searchbox\"\n [class]=\"passThrough().filterInput?.class\"\n [style]=\"passThrough().filterInput?.style\"\n [attr.aria-label]=\"filterPlaceholder() ?? translations().searchPlaceholder\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeItemId()\"\n [placeholder]=\"filterPlaceholder() ?? translations().searchPlaceholder\"\n [value]=\"query()\"\n (input)=\"onFilterInput($event)\"\n (keydown)=\"onKeydown($event)\"\n />\n <tx-icon class=\"tx-select__filter-icon\" [name]=\"'search'\" />\n </span>\n </div>\n }\n <tx-option-list\n [rows]=\"rows()\"\n [listboxId]=\"listboxId\"\n [activeIndex]=\"activeIndex()\"\n [checkmark]=\"checkmark()\"\n [virtualScroll]=\"virtualScroll()\"\n [itemSize]=\"virtualScrollItemSize()\"\n [scrollHeight]=\"scrollHeight()\"\n [loading]=\"loading()\"\n [query]=\"query()\"\n [emptyText]=\"emptyText()\"\n [loadingText]=\"translations().loading\"\n [optionTemplate]=\"optionTemplate()?.templateRef\"\n [groupTemplate]=\"groupTemplate()?.templateRef\"\n [emptyTemplate]=\"emptyTemplate()?.templateRef\"\n [emptyFilterTemplate]=\"emptyFilterTemplate()?.templateRef\"\n [passThrough]=\"passThrough()\"\n [unstyled]=\"isUnstyled()\"\n (optionClick)=\"onOptionClick($event)\"\n (optionHover)=\"activeIndex.set($event)\"\n (rangeChange)=\"onRangeChange($event)\"\n />\n @if (footerTemplate(); as template) {\n <div class=\"tx-select__footer\" [class]=\"passThrough().footer?.class\" [style]=\"passThrough().footer?.style\">\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n </div>\n }\n </div>\n</ng-template>\n",
2604
2627
  styles: [":host{display:block;width:100%}.tx-select__box{display:flex;align-items:center;cursor:pointer}.tx-select__trigger{flex:1 1 auto;min-width:0}.tx-select__value{display:block;min-height:1lh;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-select__dropdown{display:inline-flex}:host(.tx-select--disabled) .tx-select__box{cursor:not-allowed}:host(.tx-select--readonly) .tx-select__box{cursor:default}:host([data-styled]){font-family:var(--tx-font-family)}:host([data-styled]) .tx-select__box{box-sizing:border-box;padding-top:var(--tx-field-padding-top, var(--tx-form-field-padding-y));padding-bottom:var(--tx-field-padding-bottom, var(--tx-form-field-padding-y));padding-inline:calc(var(--tx-form-field-padding-x) + var(--tx-field-inset-start, 0px)) calc(var(--tx-form-field-padding-x) + var(--tx-field-inset-end, 0px));border:1px solid var(--tx-form-field-border-color);border-start-start-radius:var(--tx-field-radius-start, var(--tx-form-field-border-radius));border-end-start-radius:var(--tx-field-radius-start, var(--tx-form-field-border-radius));border-start-end-radius:var(--tx-field-radius-end, var(--tx-form-field-border-radius));border-end-end-radius:var(--tx-field-radius-end, var(--tx-form-field-border-radius));outline:none;background-color:var(--tx-form-field-background);box-shadow:var(--tx-form-field-shadow);color:var(--tx-form-field-color);font-family:var(--tx-font-family);font-size:var(--tx-form-field-font-size);line-height:var(--tx-form-field-line-height);transition:background-color var(--tx-form-field-transition-duration),border-color var(--tx-form-field-transition-duration),box-shadow var(--tx-form-field-transition-duration);--_px: var(--tx-form-field-padding-x);--_py: var(--tx-form-field-padding-y);gap:var(--tx-select-gap);width:100%;padding-inline-end:0}:host([data-styled])[data-variant=filled] .tx-select__box{background-color:var(--tx-form-field-filled-background)}:host([data-styled]):not(.tx-select--disabled,.tx-select--readonly) .tx-select__box:not(:has(.tx-select__trigger:focus)):hover{border-color:var(--tx-form-field-hover-border-color)}:host([data-styled])[data-variant=filled]:not(.tx-select--disabled,.tx-select--readonly) .tx-select__box:not(:has(.tx-select__trigger:focus)):hover{background-color:var(--tx-form-field-filled-hover-background)}:host([data-styled]) .tx-select__box:has(.tx-select__trigger:focus){border-color:var(--tx-form-field-focus-border-color);outline:var(--tx-form-field-focus-ring-width) var(--tx-form-field-focus-ring-style) var(--tx-form-field-focus-ring-color);outline-offset:var(--tx-form-field-focus-ring-offset);box-shadow:var(--tx-form-field-focus-ring-shadow)}:host([data-styled])[data-variant=filled] .tx-select__box:has(.tx-select__trigger:focus){background-color:var(--tx-form-field-filled-focus-background)}:host([data-styled]).tx-select--readonly .tx-select__box,:host([data-styled]).tx-select--readonly .tx-select__box:hover{background-color:var(--tx-form-field-readonly-background);caret-color:transparent;cursor:default;border-color:var(--tx-form-field-border-color)}:host([data-styled]).tx-select--invalid .tx-select__box{border-color:var(--tx-form-field-invalid-border-color)}:host([data-styled]).tx-select--invalid .tx-select__box:has(.tx-select__trigger:focus){border-color:var(--tx-form-field-invalid-border-color);box-shadow:var(--tx-form-field-invalid-focus-ring-shadow)}:host([data-styled]).tx-select--disabled .tx-select__box{background-color:var(--tx-form-field-disabled-background);box-shadow:none;color:var(--tx-form-field-disabled-color);cursor:not-allowed}:host([data-styled])[data-size=small] .tx-select__box{padding-top:var(--tx-field-padding-top, var(--tx-form-field-sm-padding-y));padding-bottom:var(--tx-field-padding-bottom, var(--tx-form-field-sm-padding-y));padding-inline:calc(var(--tx-form-field-sm-padding-x) + var(--tx-field-inset-start, 0px)) calc(var(--tx-form-field-sm-padding-x) + var(--tx-field-inset-end, 0px));font-size:var(--tx-form-field-sm-font-size);line-height:var(--tx-form-field-sm-line-height);--_px: var(--tx-form-field-sm-padding-x);--_py: var(--tx-form-field-sm-padding-y);padding-inline-end:0}:host([data-styled])[data-size=large] .tx-select__box{padding-top:var(--tx-field-padding-top, var(--tx-form-field-lg-padding-y));padding-bottom:var(--tx-field-padding-bottom, var(--tx-form-field-lg-padding-y));padding-inline:calc(var(--tx-form-field-lg-padding-x) + var(--tx-field-inset-start, 0px)) calc(var(--tx-form-field-lg-padding-x) + var(--tx-field-inset-end, 0px));font-size:var(--tx-form-field-lg-font-size);line-height:var(--tx-form-field-lg-line-height);--_px: var(--tx-form-field-lg-padding-x);--_py: var(--tx-form-field-lg-padding-y);padding-inline-end:0}:host([data-styled]) .tx-select__trigger{padding:0;padding-inline-end:var(--_px);border:none;outline:none;background:transparent;color:inherit;font:inherit;line-height:inherit;text-align:left;cursor:inherit}:host([data-styled]) .tx-select__input{cursor:text}:host([data-styled]) .tx-select__input::placeholder{color:var(--tx-form-field-placeholder-color)}:host([data-styled]) .tx-select__input:disabled{cursor:not-allowed}:host([data-styled]).tx-select--invalid .tx-select__input::placeholder{color:var(--tx-form-field-invalid-placeholder-color)}:host([data-styled]) .tx-select__value--placeholder{color:var(--tx-form-field-placeholder-color)}:host([data-styled])[data-variant=filled] .tx-select__value--placeholder,:host([data-styled])[data-variant=filled] .tx-select__input::placeholder{color:var(--tx-form-field-filled-placeholder-color)}:host([data-styled]).tx-select--invalid .tx-select__value--placeholder{color:var(--tx-form-field-invalid-placeholder-color)}:host([data-styled]) .tx-select__clear{display:grid;flex:none;place-items:center;width:var(--tx-select-clear-size);height:var(--tx-select-clear-size);padding:0;border:none;border-radius:var(--tx-radius-full);background:none;color:var(--tx-select-dropdown-color);font-size:var(--tx-select-clear-size);cursor:pointer;transition:color var(--tx-motion-duration) var(--tx-motion-easing)}:host([data-styled]) .tx-select__clear:hover{color:var(--tx-form-field-color)}:host([data-styled]) .tx-select__clear:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:2px}:host([data-styled]) .tx-select__dropdown{flex:none;align-items:center;align-self:stretch;justify-content:center;width:var(--tx-select-dropdown-width);color:var(--tx-select-dropdown-color)}:host([data-styled]) .tx-select__spinner{animation:tx-select-spin .8s linear infinite}@keyframes tx-select-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-select__spinner{animation-duration:2.4s}}.tx-select__panel{box-sizing:border-box;width:100%}.tx-select__panel[data-styled]{overflow:hidden;border:1px solid var(--tx-select-overlay-border-color);border-radius:var(--tx-select-overlay-border-radius);background:var(--tx-select-overlay-background);box-shadow:var(--tx-select-overlay-shadow);color:var(--tx-select-option-color);font-family:var(--tx-font-family);font-size:var(--tx-form-field-font-size);line-height:var(--tx-form-field-line-height)}.tx-select__panel[data-styled] .tx-select__header{padding:var(--tx-select-header-padding)}.tx-select__panel[data-styled] .tx-select__footer{padding:var(--tx-select-footer-padding)}.tx-select__panel[data-styled] .tx-select__filter{display:flex;align-items:center;gap:var(--tx-select-filter-gap);padding:var(--tx-select-filter-padding)}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-field{position:relative;display:flex;flex:1 1 auto;align-items:center;min-width:0}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-input{box-sizing:border-box;padding-top:var(--tx-field-padding-top, var(--tx-form-field-padding-y));padding-bottom:var(--tx-field-padding-bottom, var(--tx-form-field-padding-y));padding-inline:calc(var(--tx-form-field-padding-x) + var(--tx-field-inset-start, 0px)) calc(var(--tx-form-field-padding-x) + var(--tx-field-inset-end, 0px));border:1px solid var(--tx-form-field-border-color);border-start-start-radius:var(--tx-field-radius-start, var(--tx-form-field-border-radius));border-end-start-radius:var(--tx-field-radius-start, var(--tx-form-field-border-radius));border-start-end-radius:var(--tx-field-radius-end, var(--tx-form-field-border-radius));border-end-end-radius:var(--tx-field-radius-end, var(--tx-form-field-border-radius));outline:none;background-color:var(--tx-form-field-background);box-shadow:var(--tx-form-field-shadow);color:var(--tx-form-field-color);font-family:var(--tx-font-family);font-size:var(--tx-form-field-font-size);line-height:var(--tx-form-field-line-height);transition:background-color var(--tx-form-field-transition-duration),border-color var(--tx-form-field-transition-duration),box-shadow var(--tx-form-field-transition-duration);width:100%;min-width:0;padding-inline-end:calc(var(--tx-form-field-padding-x) + 1em + var(--tx-select-filter-icon-inset))}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-input:hover{border-color:var(--tx-form-field-hover-border-color)}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-input:focus{border-color:var(--tx-form-field-focus-border-color);outline:var(--tx-form-field-focus-ring-width) var(--tx-form-field-focus-ring-style) var(--tx-form-field-focus-ring-color);outline-offset:var(--tx-form-field-focus-ring-offset);box-shadow:var(--tx-form-field-focus-ring-shadow)}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-input::placeholder{color:var(--tx-form-field-placeholder-color)}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-icon{position:absolute;right:var(--tx-select-filter-icon-inset);color:var(--tx-form-field-icon-color);pointer-events:none}\n"]
2605
2628
  }]
2606
2629
  }],