@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-country-select.mjs","names":[],"sources":["../../../../packages/ui/country-select/src/country-select.theme.ts","../../../../packages/ui/country-select/src/country-select.component.ts","../../../../packages/ui/country-select/src/country-select.component.html"],"sourcesContent":["import { countryTokens } from '@tectra-ng/themes';\n\nexport const COUNTRY_SELECT_THEME = {\n country: countryTokens,\n};\n","import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, booleanAttribute, computed, forwardRef, inject, input, output } from '@angular/core';\nimport { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TxFormControlBase } from '@tectra-ng/core/forms';\nimport { TxLocaleService } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraDeepPartial, TectraSelectTokens } from '@tectra-ng/themes';\nimport { TX_COUNTRY_CODES, TxCountry, TxFlagShape, countryName } from '@tectra-ng/ui/country';\nimport { TxMultiselect } from '@tectra-ng/ui/multiselect';\nimport { TxFieldVariant, TxSelect, TxSelectItem, TxSelectOptionTemplate, TxSelectSize, TxSelectValueTemplate } from '@tectra-ng/ui/select';\nimport { TxCountryItem, TxCountryOption, TxCountrySort } from './country-select.types';\nimport { injectTokens } from '@tectra-ng/core/config';\nimport { COUNTRY_SELECT_THEME } from './country-select.theme';\n\n@Component({\n selector: 'tx-country-select',\n imports: [FormsModule, NgTemplateOutlet, TxSelect, TxMultiselect, TxSelectOptionTemplate, TxSelectValueTemplate, TxCountry],\n templateUrl: './country-select.component.html',\n styleUrl: './country-select.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => TxCountrySelect), multi: true }],\n host: {\n class: 'tx-country-select',\n '[attr.data-styled]': 'unstyled() ? null : true',\n },\n})\nexport class TxCountrySelect extends TxFormControlBase<string | string[]> {\n private readonly countrySelectTheme = injectTokens(COUNTRY_SELECT_THEME);\n\n private locale = inject(TxLocaleService);\n\n readonly options = input<readonly (string | TxCountryOption)[] | undefined>(undefined);\n readonly multiple = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly filter = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly sort = input<TxCountrySort>('name');\n readonly shape = input<TxFlagShape>('rectangle');\n readonly maxFlags = input<number>(3);\n readonly virtualScrollThreshold = input<number>(50);\n readonly placeholder = input<string>('');\n readonly showClear = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly loading = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly inputId = input<string | undefined>(undefined);\n readonly ariaLabel = input<string | undefined>(undefined);\n readonly ariaLabelledBy = input<string | undefined>(undefined);\n readonly size = input<TxSelectSize>('medium');\n readonly variant = input<TxFieldVariant>('outlined');\n readonly invalid = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n readonly readonly = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly dt = input<TectraDeepPartial<TectraSelectTokens> | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly changed = output<string | string[] | null>();\n\n readonly items = computed<TxCountryItem[]>(() => {\n const locale = this.locale.locale().intl;\n const items = (this.options() ?? TX_COUNTRY_CODES).map((option) => {\n const entry: TxCountryOption = typeof option === 'string' ? { code: option } : option;\n const code = entry.code.trim().toUpperCase();\n return {\n code,\n value: entry.value ?? code,\n label: entry.label ?? countryName(code, locale),\n count: entry.count ?? null,\n hint: entry.hint ?? '',\n disabled: !!entry.disabled,\n };\n });\n if (this.sort() === 'name') {\n const collator = new Intl.Collator(locale);\n items.sort((a, b) => collator.compare(a.label, b.label));\n }\n return items;\n });\n readonly virtual = computed(() => this.items().length > this.virtualScrollThreshold());\n\n extraCount(items: TxSelectItem[]): number {\n return Math.max(0, items.length - this.maxFlags());\n }\n\n firstFlags(items: TxSelectItem[]): TxCountryItem[] {\n return items.slice(0, this.maxFlags()).map((item) => item.option as TxCountryItem);\n }\n\n onModelChange(value: string | string[] | null): void {\n this.updateValue(value);\n this.changed.emit(value);\n }\n\n onClosed(): void {\n this.markTouched();\n }\n}\n","@if (multiple()) {\n <tx-multiselect\n [options]=\"items()\"\n [optionLabel]=\"'label'\"\n [optionValue]=\"'value'\"\n [optionDisabled]=\"'disabled'\"\n [filter]=\"filter()\"\n [filterBy]=\"'label,code'\"\n [virtualScroll]=\"virtual()\"\n [placeholder]=\"placeholder()\"\n [showClear]=\"showClear()\"\n [loading]=\"loading()\"\n [inputId]=\"inputId()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [invalid]=\"invalid()\"\n [readonly]=\"readonly()\"\n [dt]=\"dt()\"\n [unstyled]=\"unstyled()\"\n [ngModel]=\"value()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [disabled]=\"disabled()\"\n (ngModelChange)=\"onModelChange($event)\"\n (closed)=\"onClosed()\"\n >\n <ng-template txSelectOption let-item>\n <ng-container [ngTemplateOutlet]=\"option\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </ng-template>\n <ng-template txSelectValue let-selected>\n <span class=\"tx-country-select__flags\" [class.tx-country-select__flags--styled]=\"!unstyled()\">\n @for (item of firstFlags(selected); track item.value) {\n <tx-country [country]=\"item.code\" [name]=\"item.label\" [showName]=\"selected.length === 1\" [shape]=\"shape()\" />\n }\n @if (extraCount(selected); as extra) {\n <span class=\"tx-country-select__more\">+{{ extra }}</span>\n }\n </span>\n </ng-template>\n </tx-multiselect>\n} @else {\n <tx-select\n [options]=\"items()\"\n [optionLabel]=\"'label'\"\n [optionValue]=\"'value'\"\n [optionDisabled]=\"'disabled'\"\n [filter]=\"filter()\"\n [filterBy]=\"'label,code'\"\n [virtualScroll]=\"virtual()\"\n [placeholder]=\"placeholder()\"\n [showClear]=\"showClear()\"\n [loading]=\"loading()\"\n [inputId]=\"inputId()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [invalid]=\"invalid()\"\n [readonly]=\"readonly()\"\n [dt]=\"dt()\"\n [unstyled]=\"unstyled()\"\n [ngModel]=\"value()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [disabled]=\"disabled()\"\n (ngModelChange)=\"onModelChange($event)\"\n (closed)=\"onClosed()\"\n >\n <ng-template txSelectOption let-item>\n <ng-container [ngTemplateOutlet]=\"option\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </ng-template>\n <ng-template txSelectValue let-item>\n <tx-country [country]=\"item.code\" [name]=\"item.label\" [shape]=\"shape()\" />\n </ng-template>\n </tx-select>\n}\n\n<ng-template #option let-item>\n <span class=\"tx-country-select__option\" [class.tx-country-select__option--styled]=\"!unstyled()\">\n <tx-country class=\"tx-country-select__country\" [country]=\"item.code\" [name]=\"item.label\" [shape]=\"shape()\" />\n @if (item.hint) {\n <span class=\"tx-country-select__hint\">{{ item.hint }}</span>\n }\n @if (item.count !== null) {\n <span class=\"tx-country-select__count\">{{ item.count }}</span>\n }\n </span>\n</ng-template>\n"],"mappings":";;;;;;;;;;;;;AAEA,MAAa,uBAAuB,EAClC,SAAS,cACV;ACsBD,IAAa,kBAAb,MAAa,wBAAwB,kBAAoC;CACtD,qBAAqB,aAAa,oBAAoB;CAE/D,SAAS,OAAO,eAAe;CAE9B,UAAU,MAAyD,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC7E,WAAW,MAAwB,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACvE,SAAS,MAAwB,MAAI;EAAA,GAAA,YAAA,EAAA,WAAA,SAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACpE,OAAO,MAAqB,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACnC,QAAQ,MAAmB,aAAY,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACvC,WAAW,MAAc,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAC3B,yBAAyB,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,yBAAA,CAAA,+BAAA,CAAA,CAAA;CAC1C,cAAc,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,YAAY,MAAwB,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,YAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACxE,UAAU,MAAwB,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,UAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACtE,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;AAU/G,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAe,YAAA,CAAA;EAZ3B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAmB,SACpB;IAAC;IAAa;IAAkB;IAAU;IAAe;IAAwB;IAAuB;GAAS;GAAC,iBAG1G,wBAAwB;GAAM,WACpC,CAAC;IAAE,SAAS;IAAmB,aAAa,iBAAgB,eAAgB;IAAG,OAAO;GAAI,CAAE;GAAC,MAClG;IACJ,OAAO;IACP,sBAAsB;GACvB;GAAA,UAAA;GAAA,QAAA,CAAA,i2BAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"tectra-ng-ui-country-select.mjs","names":[],"sources":["../../../../packages/ui/country-select/src/country-select.theme.ts","../../../../packages/ui/country-select/src/country-select.component.ts","../../../../packages/ui/country-select/src/country-select.component.html"],"sourcesContent":["import { countryTokens } from '@tectra-ng/themes';\n\nexport const COUNTRY_SELECT_THEME = {\n country: countryTokens,\n};\n","import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, booleanAttribute, computed, forwardRef, inject, input, output } from '@angular/core';\nimport { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TxFormControlBase, injectFieldInvalid } from '@tectra-ng/core/forms';\nimport { TxLocaleService } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraDeepPartial, TectraSelectTokens } from '@tectra-ng/themes';\nimport { TX_COUNTRY_CODES, TX_REGION_CODES, TxCountry, TxFlagShape, countryName, isCountryCode } from '@tectra-ng/ui/country';\nimport { TxMultiselect } from '@tectra-ng/ui/multiselect';\nimport { TxFieldVariant, TxSelect, TxSelectItem, TxSelectOptionTemplate, TxSelectSize, TxSelectValueTemplate } from '@tectra-ng/ui/select';\nimport { TxCountryItem, TxCountryOption, TxCountrySort } from './country-select.types';\nimport { injectTokens } from '@tectra-ng/core/config';\nimport { COUNTRY_SELECT_THEME } from './country-select.theme';\n\nconst FLAG_CODES = new Set([...TX_COUNTRY_CODES, ...TX_REGION_CODES]);\n\n@Component({\n selector: 'tx-country-select',\n imports: [FormsModule, NgTemplateOutlet, TxSelect, TxMultiselect, TxSelectOptionTemplate, TxSelectValueTemplate, TxCountry],\n templateUrl: './country-select.component.html',\n styleUrl: './country-select.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => TxCountrySelect), multi: true }],\n host: {\n class: 'tx-country-select',\n '[attr.data-styled]': 'unstyled() ? null : true',\n },\n})\nexport class TxCountrySelect extends TxFormControlBase<string | string[]> {\n private readonly countrySelectTheme = injectTokens(COUNTRY_SELECT_THEME);\n\n private locale = inject(TxLocaleService);\n\n readonly options = input<readonly (string | TxCountryOption)[] | undefined>(undefined);\n readonly multiple = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly filter = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly sort = input<TxCountrySort>('name');\n readonly shape = input<TxFlagShape>('rectangle');\n readonly maxFlags = input<number>(3);\n readonly maxNamed = input<number>(1);\n readonly virtualScrollThreshold = input<number>(50);\n readonly placeholder = input<string>('');\n readonly showClear = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly loading = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly inputId = input<string | undefined>(undefined);\n readonly ariaLabel = input<string | undefined>(undefined);\n readonly ariaLabelledBy = input<string | undefined>(undefined);\n readonly size = input<TxSelectSize>('medium');\n readonly variant = input<TxFieldVariant>('outlined');\n readonly invalid = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n readonly readonly = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly dt = input<TectraDeepPartial<TectraSelectTokens> | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly changed = output<string | string[] | null>();\n\n readonly isInvalid = injectFieldInvalid(this.invalid);\n\n readonly items = computed<TxCountryItem[]>(() => {\n const locale = this.locale.locale().intl;\n const items = (this.options() ?? TX_COUNTRY_CODES).map((option) => {\n const entry: TxCountryOption = typeof option === 'string' ? { code: option } : option;\n const trimmed = entry.code.trim();\n const code = isCountryCode(trimmed) ? trimmed.toUpperCase() : trimmed;\n return {\n code,\n value: entry.value ?? code,\n label: entry.label ?? countryName(code, locale),\n flag: entry.flag ?? FLAG_CODES.has(code),\n count: entry.count ?? null,\n hint: entry.hint ?? '',\n disabled: !!entry.disabled,\n };\n });\n if (this.sort() === 'name') {\n const collator = new Intl.Collator(locale);\n items.sort((a, b) => collator.compare(a.label, b.label));\n }\n return items;\n });\n readonly virtual = computed(() => this.items().length > this.virtualScrollThreshold());\n\n extraCount(items: TxSelectItem[]): number {\n return Math.max(0, items.length - this.maxFlags());\n }\n\n firstFlags(items: TxSelectItem[]): TxCountryItem[] {\n return items.slice(0, this.maxFlags()).map((item) => item.option as TxCountryItem);\n }\n\n showsNames(items: TxSelectItem[]): boolean {\n return items.length <= this.maxNamed();\n }\n\n onModelChange(value: string | string[] | null): void {\n this.updateValue(value);\n this.changed.emit(value);\n }\n\n onClosed(): void {\n this.markTouched();\n }\n}\n","@if (multiple()) {\n <tx-multiselect\n [options]=\"items()\"\n [optionLabel]=\"'label'\"\n [optionValue]=\"'value'\"\n [optionDisabled]=\"'disabled'\"\n [filter]=\"filter()\"\n [filterBy]=\"'label,code'\"\n [virtualScroll]=\"virtual()\"\n [placeholder]=\"placeholder()\"\n [showClear]=\"showClear()\"\n [loading]=\"loading()\"\n [inputId]=\"inputId()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [invalid]=\"isInvalid()\"\n [readonly]=\"readonly()\"\n [dt]=\"dt()\"\n [unstyled]=\"unstyled()\"\n [ngModel]=\"value()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [disabled]=\"disabled()\"\n (ngModelChange)=\"onModelChange($event)\"\n (closed)=\"onClosed()\"\n >\n <ng-template txSelectOption let-item>\n <ng-container [ngTemplateOutlet]=\"option\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </ng-template>\n <ng-template txSelectValue let-selected>\n <span class=\"tx-country-select__flags\" [class.tx-country-select__flags--styled]=\"!unstyled()\">\n @for (item of firstFlags(selected); track item.value) {\n <tx-country [country]=\"item.flag ? item.code : null\" [name]=\"item.label\" [showName]=\"!item.flag || showsNames(selected)\" [shape]=\"shape()\" />\n }\n @if (extraCount(selected); as extra) {\n <span class=\"tx-country-select__more\">+{{ extra }}</span>\n }\n </span>\n </ng-template>\n </tx-multiselect>\n} @else {\n <tx-select\n [options]=\"items()\"\n [optionLabel]=\"'label'\"\n [optionValue]=\"'value'\"\n [optionDisabled]=\"'disabled'\"\n [filter]=\"filter()\"\n [filterBy]=\"'label,code'\"\n [virtualScroll]=\"virtual()\"\n [placeholder]=\"placeholder()\"\n [showClear]=\"showClear()\"\n [loading]=\"loading()\"\n [inputId]=\"inputId()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [invalid]=\"isInvalid()\"\n [readonly]=\"readonly()\"\n [dt]=\"dt()\"\n [unstyled]=\"unstyled()\"\n [ngModel]=\"value()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [disabled]=\"disabled()\"\n (ngModelChange)=\"onModelChange($event)\"\n (closed)=\"onClosed()\"\n >\n <ng-template txSelectOption let-item>\n <ng-container [ngTemplateOutlet]=\"option\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </ng-template>\n <ng-template txSelectValue let-item>\n <tx-country [country]=\"item.flag ? item.code : null\" [name]=\"item.label\" [shape]=\"shape()\" />\n </ng-template>\n </tx-select>\n}\n\n<ng-template #option let-item>\n <span class=\"tx-country-select__option\" [class.tx-country-select__option--styled]=\"!unstyled()\">\n <tx-country class=\"tx-country-select__country\" [country]=\"item.flag ? item.code : null\" [name]=\"item.label\" [shape]=\"shape()\" />\n @if (item.hint) {\n <span class=\"tx-country-select__hint\">{{ item.hint }}</span>\n }\n @if (item.count !== null) {\n <span class=\"tx-country-select__count\">{{ item.count }}</span>\n }\n </span>\n</ng-template>\n"],"mappings":";;;;;;;;;;;;;AAEA,MAAa,uBAAuB,EAClC,SAAS,cACV;ACUD,MAAM,6BAAa,IAAI,IAAI,CAAC,GAAG,kBAAkB,GAAG,eAAe,CAAC;AAcpE,IAAa,kBAAb,MAAa,wBAAwB,kBAAoC;CACtD,qBAAqB,aAAa,oBAAoB;CAE/D,SAAS,OAAO,eAAe;CAE9B,UAAU,MAAyD,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC7E,WAAW,MAAwB,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACvE,SAAS,MAAwB,MAAI;EAAA,GAAA,YAAA,EAAA,WAAA,SAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACpE,OAAO,MAAqB,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACnC,QAAQ,MAAmB,aAAY,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACvC,WAAW,MAAc,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAC3B,WAAW,MAAc,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAC3B,yBAAyB,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,yBAAA,CAAA,+BAAA,CAAA,CAAA;CAC1C,cAAc,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,YAAY,MAAwB,OA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AA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA,CAAA,SAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAsB,UAAA;IAAA,QAAA,CAAA,kBAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAqB,UAAA;IAAA,QAAA,CAAA,iBAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAS,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAU/G,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAe,YAAA,CAAA;EAZ3B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAmB,SACpB;IAAC;IAAa;IAAkB;IAAU;IAAe;IAAwB;IAAuB;GAAS;GAAC,iBAG1G,wBAAwB;GAAM,WACpC,CAAC;IAAE,SAAS;IAAmB,aAAa,iBAAgB,eAAgB;IAAG,OAAO;GAAI,CAAE;GAAC,MAClG;IACJ,OAAO;IACP,sBAAsB;GACvB;GAAA,UAAA;GAAA,QAAA,CAAA,i2BAAA;EAAA,CAAA"}
@@ -6,6 +6,8 @@ import { optionalBoolean } from "@tectra-ng/core/utils";
6
6
  import { countryTokens, toStyleObject } from "@tectra-ng/themes";
7
7
  import { provideTxIconDefaults, txIconCircle, txIconCode, txIconFlag } from "@tectra-ng/icons";
8
8
  const TX_COUNTRY_CODES = "AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS XK YE YT ZA ZM ZW".split(" ");
9
+ const TX_REGION_CODES = ["EU", "UN"];
10
+ const FALLBACK_LOCALE = "en-US";
9
11
  const COUNTRY_CODE = /^[A-Z]{2}$/;
10
12
  const nameCache = /* @__PURE__ */ new Map();
11
13
  function isCountryCode(code) {
@@ -14,15 +16,22 @@ function isCountryCode(code) {
14
16
  function countryName(code, locale) {
15
17
  const upper = code.trim().toUpperCase();
16
18
  if (!isCountryCode(upper)) return code;
19
+ return regionNames(locale).of(upper) ?? upper;
20
+ }
21
+ function regionNames(locale) {
17
22
  let names = nameCache.get(locale);
18
23
  if (!names) {
19
- names = new Intl.DisplayNames([locale], {
20
- type: "region",
21
- fallback: "code"
22
- });
24
+ try {
25
+ names = new Intl.DisplayNames([locale], {
26
+ type: "region",
27
+ fallback: "code"
28
+ });
29
+ } catch {
30
+ names = regionNames(FALLBACK_LOCALE);
31
+ }
23
32
  nameCache.set(locale, names);
24
33
  }
25
- return names.of(upper) ?? upper;
34
+ return names;
26
35
  }
27
36
  function countryEmoji(code) {
28
37
  const upper = code.trim().toUpperCase();
@@ -362,6 +371,6 @@ i0.ɵɵngDeclareClassMetadata({
362
371
  function isPromise(value) {
363
372
  return typeof value?.then === "function";
364
373
  }
365
- export { TX_COUNTRY_CODES, TX_FLAG_RESOLVER, TxCountry, countryEmoji, countryName, isCountryCode, provideTxFlags, txFlagIcons, txFlagImages };
374
+ export { TX_COUNTRY_CODES, TX_FLAG_RESOLVER, TX_REGION_CODES, TxCountry, countryEmoji, countryName, isCountryCode, provideTxFlags, txFlagIcons, txFlagImages };
366
375
 
367
376
  //# sourceMappingURL=tectra-ng-ui-country.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tectra-ng-ui-country.mjs","names":[],"sources":["../../../../packages/ui/country/src/countries.ts","../../../../packages/ui/country/src/flags.ts","../../../../packages/ui/country/src/country.icons.ts","../../../../packages/ui/country/src/country.theme.ts","../../../../packages/ui/country/src/country.component.ts"],"sourcesContent":["/** ISO 3166-1 alpha-2 codes of the countries the kit knows, plus `XK` for Kosovo. */\nexport const TX_COUNTRY_CODES: readonly string[] = (\n 'AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL ' +\n 'CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT ' +\n 'GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY ' +\n 'MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN ' +\n 'PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT ' +\n 'TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS XK YE YT ZA ZM ZW'\n).split(' ');\n\nconst COUNTRY_CODE = /^[A-Z]{2}$/;\nconst nameCache = new Map<string, Intl.DisplayNames>();\n\n/**\n * Tells whether the text is two letters, in any case, as a country code looks; it does not check that the country exists.\n */\nexport function isCountryCode(code: string | null | undefined): boolean {\n return !!code && COUNTRY_CODE.test(code.trim().toUpperCase());\n}\n\n/**\n * Name of the country in the given locale, such as `Poland` for `PL`; text that is not a country code comes back unchanged.\n */\nexport function countryName(code: string, locale: string): string {\n const upper = code.trim().toUpperCase();\n if (!isCountryCode(upper)) {\n return code;\n }\n let names = nameCache.get(locale);\n if (!names) {\n names = new Intl.DisplayNames([locale], { type: 'region', fallback: 'code' });\n nameCache.set(locale, names);\n }\n return names.of(upper) ?? upper;\n}\n\n/** Emoji flag of the country code; an empty string when the code is not valid. */\nexport function countryEmoji(code: string): string {\n const upper = code.trim().toUpperCase();\n return isCountryCode(upper) ? String.fromCodePoint(...[...upper].map((letter) => 0x1f1e6 + letter.charCodeAt(0) - 65)) : '';\n}\n","import { InjectionToken, Provider } from '@angular/core';\nimport { TxFlagResolver, TxFlagShape } from './country.types';\n\n/** Injection token of the flag resolver that `tx-country` uses; set it with `provideTxFlags`. */\nexport const TX_FLAG_RESOLVER = new InjectionToken<TxFlagResolver>('TX_FLAG_RESOLVER');\n\n/** Draws flags as images or CSS classes through the resolver instead of emoji; provide it once in the app. */\nexport function provideTxFlags(resolver: TxFlagResolver): Provider {\n return { provide: TX_FLAG_RESOLVER, useValue: resolver };\n}\n\n/**\n * Flag resolver for a flag stylesheet that is already on the page, using the classes `fi fi-ua` (and `fis` for circles).\n */\nexport const txFlagIcons: TxFlagResolver = (code, shape) => ({\n class: `fi fi-${code.toLowerCase()}${shape === 'circle' ? ' fis' : ''}`,\n});\n\n/**\n * Builds a flag resolver from a function that returns an image address for a lower-case code and a shape, now or as a promise.\n */\nexport function txFlagImages(url: (code: string, shape: TxFlagShape) => string | Promise<string | null>): TxFlagResolver {\n return (code, shape) => {\n const src = url(code.toLowerCase(), shape);\n return typeof src === 'string' ? { src } : src.then((value) => (value ? { src: value } : null));\n };\n}\n","import { TxIconSet, txIconCircle, txIconCode, txIconFlag } from '@tectra-ng/icons';\n\nexport const COUNTRY_ICON_DEFAULTS: TxIconSet = {\n circle: txIconCircle,\n code: txIconCode,\n flag: txIconFlag,\n};\n","import { countryTokens } from '@tectra-ng/themes';\n\nexport const COUNTRY_THEME = {\n country: countryTokens,\n};\n","import { ChangeDetectionStrategy, Component, booleanAttribute, computed, effect, inject, input, signal } from '@angular/core';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { TxLocaleService } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraCountryTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { countryEmoji, countryName, isCountryCode } from './countries';\nimport { TxCountryPart, TxCountrySize, TxFlag, TxFlagShape } from './country.types';\nimport { TX_FLAG_RESOLVER } from './flags';\nimport { provideTxIconDefaults } from '@tectra-ng/icons';\nimport { COUNTRY_ICON_DEFAULTS } from './country.icons';\nimport { COUNTRY_THEME } from './country.theme';\n\n@Component({\n selector: 'tx-country',\n template: `\n @if (code(); as iso) {\n @if (flag(); as image) {\n @if (image.src) {\n <img class=\"tx-country__flag tx-country__flag--image\" alt=\"\" [src]=\"image.src\" [class]=\"passThrough().flag?.class\" [style]=\"passThrough().flag?.style\" />\n } @else {\n <span class=\"tx-country__flag\" aria-hidden=\"true\" [class]=\"flagClass(image.class)\" [style]=\"passThrough().flag?.style\"></span>\n }\n } @else if (isLoading()) {\n <span class=\"tx-country__flag tx-country__flag--loading\" aria-hidden=\"true\" [class]=\"passThrough().flag?.class\" [style]=\"passThrough().flag?.style\"></span>\n } @else {\n <span class=\"tx-country__flag tx-country__flag--emoji\" aria-hidden=\"true\" [class]=\"passThrough().flag?.class\" [style]=\"passThrough().flag?.style\">{{\n emoji()\n }}</span>\n }\n }\n @if (showName()) {\n <span class=\"tx-country__name\" [class]=\"passThrough().name?.class\" [style]=\"passThrough().name?.style\">{{ label() }}</span>\n }\n `,\n styleUrl: './country.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-country',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-size]': 'size()',\n '[attr.data-shape]': 'shape()',\n '[attr.role]': 'showName() || !code() ? null : \"img\"',\n '[attr.aria-label]': 'showName() || !code() ? null : label()',\n '[attr.title]': 'showName() ? null : label()',\n },\n viewProviders: [provideTxIconDefaults(COUNTRY_ICON_DEFAULTS)],\n})\nexport class TxCountry {\n private readonly countryTheme = injectTokens(COUNTRY_THEME);\n\n private locale = inject(TxLocaleService);\n private resolver = inject(TX_FLAG_RESOLVER, { optional: true });\n\n readonly country = input<string | null | undefined>(undefined);\n readonly name = input<string | undefined>(undefined);\n readonly showName = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly size = input<TxCountrySize>('small');\n readonly shape = input<TxFlagShape>('rectangle');\n readonly dt = input<TectraDeepPartial<TectraCountryTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxCountryPart, TxCountry> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('country', this, this.pt, this.ptOptions);\n readonly code = computed(() => {\n const value = (this.country() ?? '').trim().toUpperCase();\n return isCountryCode(value) ? value : null;\n });\n readonly label = computed(() => {\n const code = this.code();\n return this.name() ?? (code ? countryName(code, this.locale.locale().intl) : (this.country() ?? '').trim());\n });\n private readonly loaded = signal<{ key: string; flag: TxFlag | null } | null>(null);\n private readonly resolution = computed(() => {\n const code = this.code();\n return code && this.resolver ? { key: `${this.shape()}:${code}`, value: this.resolver(code, this.shape()) } : null;\n });\n readonly isLoading = computed(() => {\n const resolution = this.resolution();\n return !!resolution && isPromise(resolution.value) && this.loaded()?.key !== resolution.key;\n });\n readonly flag = computed(() => {\n const resolution = this.resolution();\n if (!resolution) {\n return null;\n }\n if (!isPromise(resolution.value)) {\n return resolution.value;\n }\n const loaded = this.loaded();\n return loaded?.key === resolution.key ? loaded.flag : null;\n });\n readonly emoji = computed(() => countryEmoji(this.code() ?? ''));\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-country'), ...this.passThrough().root?.style }));\n\n constructor() {\n effect(() => {\n const resolution = this.resolution();\n if (resolution && isPromise(resolution.value)) {\n const { key, value } = resolution;\n value.then(\n (flag) => this.loaded.set({ key, flag }),\n () => this.loaded.set({ key, flag: null }),\n );\n }\n });\n }\n\n flagClass(own: string | undefined): string {\n return [own, this.passThrough().flag?.class].filter(Boolean).join(' ');\n }\n}\n\nfunction isPromise<T>(value: T | Promise<T>): value is Promise<T> {\n return typeof (value as Promise<T> | null)?.then === 'function';\n}\n"],"mappings":";;;;;;;AACA,MAAa,mBACX,gvBAMA,MAAM,GAAG;AAEX,MAAM,eAAe;AACrB,MAAM,4BAAY,IAAI,IAAG;AAKzB,SAAgB,cAAc,MAA+B;CAC3D,OAAO,CAAC,CAAC,QAAQ,aAAa,KAAK,KAAK,KAAI,CAAE,CAAC,YAAW,CAAE;AAC9D;AAKA,SAAgB,YAAY,MAAc,QAAc;CACtD,MAAM,QAAQ,KAAK,KAAI,CAAE,CAAC,YAAW;CACrC,IAAI,CAAC,cAAc,KAAK,GACtB,OAAO;CAET,IAAI,QAAQ,UAAU,IAAI,MAAM;CAChC,IAAI,CAAC,OAAO;EACV,QAAQ,IAAI,KAAK,aAAa,CAAC,MAAM,GAAG;GAAE,MAAM;GAAU,UAAU;EAAM,CAAE;EAC5E,UAAU,IAAI,QAAQ,KAAK;CAC7B;CACA,OAAO,MAAM,GAAG,KAAK,KAAK;AAC5B;AAGA,SAAgB,aAAa,MAAY;CACvC,MAAM,QAAQ,KAAK,KAAI,CAAE,CAAC,YAAW;CACrC,OAAO,cAAc,KAAK,IAAI,OAAO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AA,GAAA,wBAAA;CAAA,CAAA;;AAElD,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAS,YAAA,CAAA;EArCrB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAY,UACZ;;;;;;;;;;;;;;;;;;;;GAmBT,iBAEgB,wBAAwB;GAAM,MACzC;IACJ,OAAO;IACP,WAAW;IACX,WAAW;IACX,sBAAsB;IACtB,oBAAoB;IACpB,qBAAqB;IACrB,eAAe;IACf,qBAAqB;IACrB,gBAAgB;GACjB;GAAA,eACc,CAAC,sBAAsB,qBAAqB,CAAC;GAAC,QAAA,CAAA,moCAAA;EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqE/D,SAAS,UAAa,OAAqB;CACzC,OAAO,OAAQ,OAA6B,SAAS;AACvD"}
1
+ {"version":3,"file":"tectra-ng-ui-country.mjs","names":[],"sources":["../../../../packages/ui/country/src/countries.ts","../../../../packages/ui/country/src/flags.ts","../../../../packages/ui/country/src/country.icons.ts","../../../../packages/ui/country/src/country.theme.ts","../../../../packages/ui/country/src/country.component.ts"],"sourcesContent":["/** ISO 3166-1 alpha-2 codes of the countries the kit knows, plus `XK` for Kosovo. */\nexport const TX_COUNTRY_CODES: readonly string[] = (\n 'AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL ' +\n 'CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT ' +\n 'GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY ' +\n 'MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN ' +\n 'PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT ' +\n 'TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS XK YE YT ZA ZM ZW'\n).split(' ');\n\n/**\n * Two-letter codes that are not countries but have a localized name and a flag: `EU` (European Union) and `UN`\n * (United Nations). Add them to the country list where they fit: `[...TX_COUNTRY_CODES, ...TX_REGION_CODES]`.\n */\nexport const TX_REGION_CODES: readonly string[] = ['EU', 'UN'];\n\nconst FALLBACK_LOCALE = 'en-US';\nconst COUNTRY_CODE = /^[A-Z]{2}$/;\nconst nameCache = new Map<string, Intl.DisplayNames>();\n\n/**\n * Tells whether the text is two letters, in any case, as a country code looks; it does not check that the country exists.\n */\nexport function isCountryCode(code: string | null | undefined): boolean {\n return !!code && COUNTRY_CODE.test(code.trim().toUpperCase());\n}\n\n/**\n * Name of the country in the given locale, such as `Poland` for `PL`; text that is not a country code comes back unchanged.\n * A locale that `Intl` does not accept falls back to `en-US`.\n */\nexport function countryName(code: string, locale: string): string {\n const upper = code.trim().toUpperCase();\n if (!isCountryCode(upper)) {\n return code;\n }\n return regionNames(locale).of(upper) ?? upper;\n}\n\nfunction regionNames(locale: string): Intl.DisplayNames {\n let names = nameCache.get(locale);\n if (!names) {\n try {\n names = new Intl.DisplayNames([locale], { type: 'region', fallback: 'code' });\n } catch {\n names = regionNames(FALLBACK_LOCALE);\n }\n nameCache.set(locale, names);\n }\n return names;\n}\n\n/** Emoji flag of the country code; an empty string when the code is not valid. */\nexport function countryEmoji(code: string): string {\n const upper = code.trim().toUpperCase();\n return isCountryCode(upper) ? String.fromCodePoint(...[...upper].map((letter) => 0x1f1e6 + letter.charCodeAt(0) - 65)) : '';\n}\n","import { InjectionToken, Provider } from '@angular/core';\nimport { TxFlagResolver, TxFlagShape } from './country.types';\n\n/** Injection token of the flag resolver that `tx-country` uses; set it with `provideTxFlags`. */\nexport const TX_FLAG_RESOLVER = new InjectionToken<TxFlagResolver>('TX_FLAG_RESOLVER');\n\n/** Draws flags as images or CSS classes through the resolver instead of emoji; provide it once in the app. */\nexport function provideTxFlags(resolver: TxFlagResolver): Provider {\n return { provide: TX_FLAG_RESOLVER, useValue: resolver };\n}\n\n/**\n * Flag resolver for a flag stylesheet that is already on the page, using the classes `fi fi-ua` (and `fis` for circles).\n */\nexport const txFlagIcons: TxFlagResolver = (code, shape) => ({\n class: `fi fi-${code.toLowerCase()}${shape === 'circle' ? ' fis' : ''}`,\n});\n\n/**\n * Builds a flag resolver from a function that returns an image address for a lower-case code and a shape, now or as a promise.\n */\nexport function txFlagImages(url: (code: string, shape: TxFlagShape) => string | Promise<string | null>): TxFlagResolver {\n return (code, shape) => {\n const src = url(code.toLowerCase(), shape);\n return typeof src === 'string' ? { src } : src.then((value) => (value ? { src: value } : null));\n };\n}\n","import { TxIconSet, txIconCircle, txIconCode, txIconFlag } from '@tectra-ng/icons';\n\nexport const COUNTRY_ICON_DEFAULTS: TxIconSet = {\n circle: txIconCircle,\n code: txIconCode,\n flag: txIconFlag,\n};\n","import { countryTokens } from '@tectra-ng/themes';\n\nexport const COUNTRY_THEME = {\n country: countryTokens,\n};\n","import { ChangeDetectionStrategy, Component, booleanAttribute, computed, effect, inject, input, signal } from '@angular/core';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { TxLocaleService } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraCountryTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { countryEmoji, countryName, isCountryCode } from './countries';\nimport { TxCountryPart, TxCountrySize, TxFlag, TxFlagShape } from './country.types';\nimport { TX_FLAG_RESOLVER } from './flags';\nimport { provideTxIconDefaults } from '@tectra-ng/icons';\nimport { COUNTRY_ICON_DEFAULTS } from './country.icons';\nimport { COUNTRY_THEME } from './country.theme';\n\n@Component({\n selector: 'tx-country',\n template: `\n @if (code(); as iso) {\n @if (flag(); as image) {\n @if (image.src) {\n <img class=\"tx-country__flag tx-country__flag--image\" alt=\"\" [src]=\"image.src\" [class]=\"passThrough().flag?.class\" [style]=\"passThrough().flag?.style\" />\n } @else {\n <span class=\"tx-country__flag\" aria-hidden=\"true\" [class]=\"flagClass(image.class)\" [style]=\"passThrough().flag?.style\"></span>\n }\n } @else if (isLoading()) {\n <span class=\"tx-country__flag tx-country__flag--loading\" aria-hidden=\"true\" [class]=\"passThrough().flag?.class\" [style]=\"passThrough().flag?.style\"></span>\n } @else {\n <span class=\"tx-country__flag tx-country__flag--emoji\" aria-hidden=\"true\" [class]=\"passThrough().flag?.class\" [style]=\"passThrough().flag?.style\">{{\n emoji()\n }}</span>\n }\n }\n @if (showName()) {\n <span class=\"tx-country__name\" [class]=\"passThrough().name?.class\" [style]=\"passThrough().name?.style\">{{ label() }}</span>\n }\n `,\n styleUrl: './country.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-country',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-size]': 'size()',\n '[attr.data-shape]': 'shape()',\n '[attr.role]': 'showName() || !code() ? null : \"img\"',\n '[attr.aria-label]': 'showName() || !code() ? null : label()',\n '[attr.title]': 'showName() ? null : label()',\n },\n viewProviders: [provideTxIconDefaults(COUNTRY_ICON_DEFAULTS)],\n})\nexport class TxCountry {\n private readonly countryTheme = injectTokens(COUNTRY_THEME);\n\n private locale = inject(TxLocaleService);\n private resolver = inject(TX_FLAG_RESOLVER, { optional: true });\n\n readonly country = input<string | null | undefined>(undefined);\n readonly name = input<string | undefined>(undefined);\n readonly showName = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly size = input<TxCountrySize>('small');\n readonly shape = input<TxFlagShape>('rectangle');\n readonly dt = input<TectraDeepPartial<TectraCountryTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxCountryPart, TxCountry> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('country', this, this.pt, this.ptOptions);\n readonly code = computed(() => {\n const value = (this.country() ?? '').trim().toUpperCase();\n return isCountryCode(value) ? value : null;\n });\n readonly label = computed(() => {\n const code = this.code();\n return this.name() ?? (code ? countryName(code, this.locale.locale().intl) : (this.country() ?? '').trim());\n });\n private readonly loaded = signal<{ key: string; flag: TxFlag | null } | null>(null);\n private readonly resolution = computed(() => {\n const code = this.code();\n return code && this.resolver ? { key: `${this.shape()}:${code}`, value: this.resolver(code, this.shape()) } : null;\n });\n readonly isLoading = computed(() => {\n const resolution = this.resolution();\n return !!resolution && isPromise(resolution.value) && this.loaded()?.key !== resolution.key;\n });\n readonly flag = computed(() => {\n const resolution = this.resolution();\n if (!resolution) {\n return null;\n }\n if (!isPromise(resolution.value)) {\n return resolution.value;\n }\n const loaded = this.loaded();\n return loaded?.key === resolution.key ? loaded.flag : null;\n });\n readonly emoji = computed(() => countryEmoji(this.code() ?? ''));\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-country'), ...this.passThrough().root?.style }));\n\n constructor() {\n effect(() => {\n const resolution = this.resolution();\n if (resolution && isPromise(resolution.value)) {\n const { key, value } = resolution;\n value.then(\n (flag) => this.loaded.set({ key, flag }),\n () => this.loaded.set({ key, flag: null }),\n );\n }\n });\n }\n\n flagClass(own: string | undefined): string {\n return [own, this.passThrough().flag?.class].filter(Boolean).join(' ');\n }\n}\n\nfunction isPromise<T>(value: T | Promise<T>): value is Promise<T> {\n return typeof (value as Promise<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