@tectra-ng/ui 0.0.0-stage → 0.1.1
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.
- package/LICENSE +21 -0
- package/README.md +26 -2
- package/amount/README.md +28 -0
- package/autocomplete/README.md +82 -0
- package/avatar/README.md +43 -0
- package/badge/README.md +19 -0
- package/button/README.md +46 -0
- package/button-group/README.md +8 -0
- package/card/README.md +30 -0
- package/cascade-select/README.md +49 -0
- package/checkbox/README.md +64 -0
- package/chip/README.md +38 -0
- package/chips-input/README.md +47 -0
- package/color-picker/README.md +43 -0
- package/confirm/README.md +46 -0
- package/country/README.md +23 -0
- package/country-select/README.md +39 -0
- package/dialog/README.md +84 -0
- package/divider/README.md +24 -0
- package/drawer/README.md +54 -0
- package/email-suggestion/README.md +20 -0
- package/fesm2022/tectra-ng-ui-amount.mjs +415 -0
- package/fesm2022/tectra-ng-ui-amount.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-autocomplete.mjs +730 -0
- package/fesm2022/tectra-ng-ui-autocomplete.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-avatar.mjs +670 -0
- package/fesm2022/tectra-ng-ui-avatar.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-badge.mjs +191 -0
- package/fesm2022/tectra-ng-ui-badge.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-button-group.mjs +50 -0
- package/fesm2022/tectra-ng-ui-button-group.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-button.mjs +725 -0
- package/fesm2022/tectra-ng-ui-button.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-card.mjs +210 -0
- package/fesm2022/tectra-ng-ui-card.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-cascade-select.mjs +887 -0
- package/fesm2022/tectra-ng-ui-cascade-select.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-checkbox.mjs +1150 -0
- package/fesm2022/tectra-ng-ui-checkbox.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-chip.mjs +344 -0
- package/fesm2022/tectra-ng-ui-chip.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-chips-input.mjs +649 -0
- package/fesm2022/tectra-ng-ui-chips-input.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-color-picker.mjs +828 -0
- package/fesm2022/tectra-ng-ui-color-picker.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-confirm.mjs +489 -0
- package/fesm2022/tectra-ng-ui-confirm.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-country-select.mjs +545 -0
- package/fesm2022/tectra-ng-ui-country-select.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-country.mjs +313 -0
- package/fesm2022/tectra-ng-ui-country.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-dialog.mjs +1539 -0
- package/fesm2022/tectra-ng-ui-dialog.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-divider.mjs +194 -0
- package/fesm2022/tectra-ng-ui-divider.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-drawer.mjs +540 -0
- package/fesm2022/tectra-ng-ui-drawer.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-email-suggestion.mjs +341 -0
- package/fesm2022/tectra-ng-ui-email-suggestion.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-field.mjs +492 -0
- package/fesm2022/tectra-ng-ui-field.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-fieldset.mjs +258 -0
- package/fesm2022/tectra-ng-ui-fieldset.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-highlight-text.mjs +246 -0
- package/fesm2022/tectra-ng-ui-highlight-text.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-icon-field.mjs +478 -0
- package/fesm2022/tectra-ng-ui-icon-field.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input-group.mjs +113 -0
- package/fesm2022/tectra-ng-ui-input-group.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input-mask.mjs +413 -0
- package/fesm2022/tectra-ng-ui-input-mask.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input-number.mjs +1045 -0
- package/fesm2022/tectra-ng-ui-input-number.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input-otp.mjs +553 -0
- package/fesm2022/tectra-ng-ui-input-otp.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input.mjs +260 -0
- package/fesm2022/tectra-ng-ui-input.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-key-filter.mjs +185 -0
- package/fesm2022/tectra-ng-ui-key-filter.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-knob.mjs +630 -0
- package/fesm2022/tectra-ng-ui-knob.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-label.mjs +271 -0
- package/fesm2022/tectra-ng-ui-label.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-link.mjs +699 -0
- package/fesm2022/tectra-ng-ui-link.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-listbox.mjs +484 -0
- package/fesm2022/tectra-ng-ui-listbox.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-mention-textarea.mjs +717 -0
- package/fesm2022/tectra-ng-ui-mention-textarea.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-menu.mjs +1484 -0
- package/fesm2022/tectra-ng-ui-menu.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-message.mjs +975 -0
- package/fesm2022/tectra-ng-ui-message.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-multiselect.mjs +569 -0
- package/fesm2022/tectra-ng-ui-multiselect.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-overlay-badge.mjs +345 -0
- package/fesm2022/tectra-ng-ui-overlay-badge.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-paginator.mjs +849 -0
- package/fesm2022/tectra-ng-ui-paginator.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-panel.mjs +317 -0
- package/fesm2022/tectra-ng-ui-panel.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-password-generator.mjs +292 -0
- package/fesm2022/tectra-ng-ui-password-generator.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-password.mjs +871 -0
- package/fesm2022/tectra-ng-ui-password.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-pill.mjs +361 -0
- package/fesm2022/tectra-ng-ui-pill.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-popover.mjs +742 -0
- package/fesm2022/tectra-ng-ui-popover.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-progress-bar.mjs +440 -0
- package/fesm2022/tectra-ng-ui-progress-bar.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-progress-spinner.mjs +265 -0
- package/fesm2022/tectra-ng-ui-progress-spinner.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-radio-button.mjs +817 -0
- package/fesm2022/tectra-ng-ui-radio-button.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-rating.mjs +584 -0
- package/fesm2022/tectra-ng-ui-rating.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-select.mjs +2478 -0
- package/fesm2022/tectra-ng-ui-select.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-skeleton.mjs +548 -0
- package/fesm2022/tectra-ng-ui-skeleton.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-slider.mjs +630 -0
- package/fesm2022/tectra-ng-ui-slider.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-speed-dial.mjs +669 -0
- package/fesm2022/tectra-ng-ui-speed-dial.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-split-button.mjs +614 -0
- package/fesm2022/tectra-ng-ui-split-button.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-status-icon.mjs +295 -0
- package/fesm2022/tectra-ng-ui-status-icon.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-table.mjs +5997 -0
- package/fesm2022/tectra-ng-ui-table.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-tag.mjs +422 -0
- package/fesm2022/tectra-ng-ui-tag.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-textarea.mjs +482 -0
- package/fesm2022/tectra-ng-ui-textarea.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-toast.mjs +668 -0
- package/fesm2022/tectra-ng-ui-toast.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-toggle-button.mjs +416 -0
- package/fesm2022/tectra-ng-ui-toggle-button.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-toggle-switch.mjs +560 -0
- package/fesm2022/tectra-ng-ui-toggle-switch.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-tooltip.mjs +835 -0
- package/fesm2022/tectra-ng-ui-tooltip.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-tree-select.mjs +986 -0
- package/fesm2022/tectra-ng-ui-tree-select.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui.mjs +4 -0
- package/fesm2022/tectra-ng-ui.mjs.map +1 -0
- package/field/README.md +43 -0
- package/fieldset/README.md +36 -0
- package/highlight-text/README.md +20 -0
- package/icon-field/README.md +30 -0
- package/input/README.md +22 -0
- package/input-group/README.md +21 -0
- package/input-mask/README.md +30 -0
- package/input-number/README.md +61 -0
- package/input-otp/README.md +44 -0
- package/key-filter/README.md +31 -0
- package/knob/README.md +50 -0
- package/label/README.md +29 -0
- package/link/README.md +47 -0
- package/listbox/README.md +68 -0
- package/mention-textarea/README.md +47 -0
- package/menu/README.md +65 -0
- package/message/README.md +58 -0
- package/multiselect/README.md +85 -0
- package/overlay-badge/README.md +30 -0
- package/package.json +301 -3
- package/paginator/README.md +60 -0
- package/panel/README.md +45 -0
- package/password/README.md +60 -0
- package/password-generator/README.md +34 -0
- package/pill/README.md +42 -0
- package/popover/README.md +67 -0
- package/progress-bar/README.md +32 -0
- package/progress-spinner/README.md +22 -0
- package/radio-button/README.md +54 -0
- package/rating/README.md +49 -0
- package/select/README.md +78 -0
- package/skeleton/README.md +27 -0
- package/slider/README.md +48 -0
- package/speed-dial/README.md +49 -0
- package/split-button/README.md +45 -0
- package/status-icon/README.md +22 -0
- package/table/README.md +178 -0
- package/tag/README.md +42 -0
- package/textarea/README.md +37 -0
- package/toast/README.md +52 -0
- package/toggle-button/README.md +34 -0
- package/toggle-switch/README.md +49 -0
- package/tooltip/README.md +60 -0
- package/tree-select/README.md +49 -0
- package/types/tectra-ng-ui-amount.d.ts +135 -0
- package/types/tectra-ng-ui-amount.d.ts.map +1 -0
- package/types/tectra-ng-ui-autocomplete.d.ts +250 -0
- package/types/tectra-ng-ui-autocomplete.d.ts.map +1 -0
- package/types/tectra-ng-ui-avatar.d.ts +289 -0
- package/types/tectra-ng-ui-avatar.d.ts.map +1 -0
- package/types/tectra-ng-ui-badge.d.ts +119 -0
- package/types/tectra-ng-ui-badge.d.ts.map +1 -0
- package/types/tectra-ng-ui-button-group.d.ts +6 -0
- package/types/tectra-ng-ui-button-group.d.ts.map +1 -0
- package/types/tectra-ng-ui-button.d.ts +466 -0
- package/types/tectra-ng-ui-button.d.ts.map +1 -0
- package/types/tectra-ng-ui-card.d.ts +71 -0
- package/types/tectra-ng-ui-card.d.ts.map +1 -0
- package/types/tectra-ng-ui-cascade-select.d.ts +244 -0
- package/types/tectra-ng-ui-cascade-select.d.ts.map +1 -0
- package/types/tectra-ng-ui-checkbox.d.ts +450 -0
- package/types/tectra-ng-ui-checkbox.d.ts.map +1 -0
- package/types/tectra-ng-ui-chip.d.ts +106 -0
- package/types/tectra-ng-ui-chip.d.ts.map +1 -0
- package/types/tectra-ng-ui-chips-input.d.ts +187 -0
- package/types/tectra-ng-ui-chips-input.d.ts.map +1 -0
- package/types/tectra-ng-ui-color-picker.d.ts +237 -0
- package/types/tectra-ng-ui-color-picker.d.ts.map +1 -0
- package/types/tectra-ng-ui-confirm.d.ts +80 -0
- package/types/tectra-ng-ui-confirm.d.ts.map +1 -0
- package/types/tectra-ng-ui-country-select.d.ts +235 -0
- package/types/tectra-ng-ui-country-select.d.ts.map +1 -0
- package/types/tectra-ng-ui-country.d.ts +105 -0
- package/types/tectra-ng-ui-country.d.ts.map +1 -0
- package/types/tectra-ng-ui-dialog.d.ts +453 -0
- package/types/tectra-ng-ui-dialog.d.ts.map +1 -0
- package/types/tectra-ng-ui-divider.d.ts +70 -0
- package/types/tectra-ng-ui-divider.d.ts.map +1 -0
- package/types/tectra-ng-ui-drawer.d.ts +188 -0
- package/types/tectra-ng-ui-drawer.d.ts.map +1 -0
- package/types/tectra-ng-ui-email-suggestion.d.ts +84 -0
- package/types/tectra-ng-ui-email-suggestion.d.ts.map +1 -0
- package/types/tectra-ng-ui-field.d.ts +139 -0
- package/types/tectra-ng-ui-field.d.ts.map +1 -0
- package/types/tectra-ng-ui-fieldset.d.ts +74 -0
- package/types/tectra-ng-ui-fieldset.d.ts.map +1 -0
- package/types/tectra-ng-ui-highlight-text.d.ts +75 -0
- package/types/tectra-ng-ui-highlight-text.d.ts.map +1 -0
- package/types/tectra-ng-ui-icon-field.d.ts +77 -0
- package/types/tectra-ng-ui-icon-field.d.ts.map +1 -0
- package/types/tectra-ng-ui-input-group.d.ts +18 -0
- package/types/tectra-ng-ui-input-group.d.ts.map +1 -0
- package/types/tectra-ng-ui-input-mask.d.ts +91 -0
- package/types/tectra-ng-ui-input-mask.d.ts.map +1 -0
- package/types/tectra-ng-ui-input-number.d.ts +326 -0
- package/types/tectra-ng-ui-input-number.d.ts.map +1 -0
- package/types/tectra-ng-ui-input-otp.d.ts +173 -0
- package/types/tectra-ng-ui-input-otp.d.ts.map +1 -0
- package/types/tectra-ng-ui-input.d.ts +113 -0
- package/types/tectra-ng-ui-input.d.ts.map +1 -0
- package/types/tectra-ng-ui-key-filter.d.ts +43 -0
- package/types/tectra-ng-ui-key-filter.d.ts.map +1 -0
- package/types/tectra-ng-ui-knob.d.ts +207 -0
- package/types/tectra-ng-ui-knob.d.ts.map +1 -0
- package/types/tectra-ng-ui-label.d.ts +53 -0
- package/types/tectra-ng-ui-label.d.ts.map +1 -0
- package/types/tectra-ng-ui-link.d.ts +223 -0
- package/types/tectra-ng-ui-link.d.ts.map +1 -0
- package/types/tectra-ng-ui-listbox.d.ts +131 -0
- package/types/tectra-ng-ui-listbox.d.ts.map +1 -0
- package/types/tectra-ng-ui-mention-textarea.d.ts +169 -0
- package/types/tectra-ng-ui-mention-textarea.d.ts.map +1 -0
- package/types/tectra-ng-ui-menu.d.ts +512 -0
- package/types/tectra-ng-ui-menu.d.ts.map +1 -0
- package/types/tectra-ng-ui-message.d.ts +390 -0
- package/types/tectra-ng-ui-message.d.ts.map +1 -0
- package/types/tectra-ng-ui-multiselect.d.ts +216 -0
- package/types/tectra-ng-ui-multiselect.d.ts.map +1 -0
- package/types/tectra-ng-ui-overlay-badge.d.ts +104 -0
- package/types/tectra-ng-ui-overlay-badge.d.ts.map +1 -0
- package/types/tectra-ng-ui-paginator.d.ts +293 -0
- package/types/tectra-ng-ui-paginator.d.ts.map +1 -0
- package/types/tectra-ng-ui-panel.d.ts +133 -0
- package/types/tectra-ng-ui-panel.d.ts.map +1 -0
- package/types/tectra-ng-ui-password-generator.d.ts +80 -0
- package/types/tectra-ng-ui-password-generator.d.ts.map +1 -0
- package/types/tectra-ng-ui-password.d.ts +271 -0
- package/types/tectra-ng-ui-password.d.ts.map +1 -0
- package/types/tectra-ng-ui-pill.d.ts +167 -0
- package/types/tectra-ng-ui-pill.d.ts.map +1 -0
- package/types/tectra-ng-ui-popover.d.ts +244 -0
- package/types/tectra-ng-ui-popover.d.ts.map +1 -0
- package/types/tectra-ng-ui-progress-bar.d.ts +151 -0
- package/types/tectra-ng-ui-progress-bar.d.ts.map +1 -0
- package/types/tectra-ng-ui-progress-spinner.d.ts +95 -0
- package/types/tectra-ng-ui-progress-spinner.d.ts.map +1 -0
- package/types/tectra-ng-ui-radio-button.d.ts +380 -0
- package/types/tectra-ng-ui-radio-button.d.ts.map +1 -0
- package/types/tectra-ng-ui-rating.d.ts +195 -0
- package/types/tectra-ng-ui-rating.d.ts.map +1 -0
- package/types/tectra-ng-ui-select.d.ts +761 -0
- package/types/tectra-ng-ui-select.d.ts.map +1 -0
- package/types/tectra-ng-ui-skeleton.d.ts +182 -0
- package/types/tectra-ng-ui-skeleton.d.ts.map +1 -0
- package/types/tectra-ng-ui-slider.d.ts +220 -0
- package/types/tectra-ng-ui-slider.d.ts.map +1 -0
- package/types/tectra-ng-ui-speed-dial.d.ts +175 -0
- package/types/tectra-ng-ui-speed-dial.d.ts.map +1 -0
- package/types/tectra-ng-ui-split-button.d.ts +139 -0
- package/types/tectra-ng-ui-split-button.d.ts.map +1 -0
- package/types/tectra-ng-ui-status-icon.d.ts +105 -0
- package/types/tectra-ng-ui-status-icon.d.ts.map +1 -0
- package/types/tectra-ng-ui-table.d.ts +1301 -0
- package/types/tectra-ng-ui-table.d.ts.map +1 -0
- package/types/tectra-ng-ui-tag.d.ts +157 -0
- package/types/tectra-ng-ui-tag.d.ts.map +1 -0
- package/types/tectra-ng-ui-textarea.d.ts +146 -0
- package/types/tectra-ng-ui-textarea.d.ts.map +1 -0
- package/types/tectra-ng-ui-toast.d.ts +268 -0
- package/types/tectra-ng-ui-toast.d.ts.map +1 -0
- package/types/tectra-ng-ui-toggle-button.d.ts +184 -0
- package/types/tectra-ng-ui-toggle-button.d.ts.map +1 -0
- package/types/tectra-ng-ui-toggle-switch.d.ts +226 -0
- package/types/tectra-ng-ui-toggle-switch.d.ts.map +1 -0
- package/types/tectra-ng-ui-tooltip.d.ts +275 -0
- package/types/tectra-ng-ui-tooltip.d.ts.map +1 -0
- package/types/tectra-ng-ui-tree-select.d.ts +339 -0
- package/types/tectra-ng-ui-tree-select.d.ts.map +1 -0
- package/types/tectra-ng-ui.d.ts +2 -0
- package/types/tectra-ng-ui.d.ts.map +1 -0
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, InjectionToken, booleanAttribute, computed, inject, input } from "@angular/core";
|
|
3
|
+
import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
4
|
+
import { TxLocaleService } from "@tectra-ng/core/i18n";
|
|
5
|
+
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
6
|
+
import { toStyleObject } from "@tectra-ng/themes";
|
|
7
|
+
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(" ");
|
|
8
|
+
const COUNTRY_CODE = /^[A-Z]{2}$/;
|
|
9
|
+
const nameCache = /* @__PURE__ */ new Map();
|
|
10
|
+
function isCountryCode(code) {
|
|
11
|
+
return !!code && COUNTRY_CODE.test(code.trim().toUpperCase());
|
|
12
|
+
}
|
|
13
|
+
function countryName(code, locale) {
|
|
14
|
+
const upper = code.trim().toUpperCase();
|
|
15
|
+
if (!isCountryCode(upper)) return code;
|
|
16
|
+
let names = nameCache.get(locale);
|
|
17
|
+
if (!names) {
|
|
18
|
+
names = new Intl.DisplayNames([locale], {
|
|
19
|
+
type: "region",
|
|
20
|
+
fallback: "code"
|
|
21
|
+
});
|
|
22
|
+
nameCache.set(locale, names);
|
|
23
|
+
}
|
|
24
|
+
return names.of(upper) ?? upper;
|
|
25
|
+
}
|
|
26
|
+
function countryEmoji(code) {
|
|
27
|
+
const upper = code.trim().toUpperCase();
|
|
28
|
+
return isCountryCode(upper) ? String.fromCodePoint(...[...upper].map((letter) => 127462 + letter.charCodeAt(0) - 65)) : "";
|
|
29
|
+
}
|
|
30
|
+
const TX_FLAG_RESOLVER = new InjectionToken("TX_FLAG_RESOLVER");
|
|
31
|
+
function provideTxFlags(resolver) {
|
|
32
|
+
return {
|
|
33
|
+
provide: TX_FLAG_RESOLVER,
|
|
34
|
+
useValue: resolver
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
const txFlagIcons = (code, shape) => ({ class: `fi fi-${code.toLowerCase()}${shape === "circle" ? " fis" : ""}` });
|
|
38
|
+
function txFlagImages(url) {
|
|
39
|
+
return (code, shape) => ({ src: url(code.toLowerCase(), shape) });
|
|
40
|
+
}
|
|
41
|
+
var TxCountry = class TxCountry {
|
|
42
|
+
locale = inject(TxLocaleService);
|
|
43
|
+
resolver = inject(TX_FLAG_RESOLVER, { optional: true });
|
|
44
|
+
country = input(void 0, ...ngDevMode ? [{ debugName: "country" }] : /* istanbul ignore next */ []);
|
|
45
|
+
name = input(void 0, ...ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []);
|
|
46
|
+
showName = input(true, {
|
|
47
|
+
...ngDevMode ? { debugName: "showName" } : /* istanbul ignore next */ {},
|
|
48
|
+
transform: booleanAttribute
|
|
49
|
+
});
|
|
50
|
+
size = input("small", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
51
|
+
shape = input("rectangle", ...ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []);
|
|
52
|
+
dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
|
|
53
|
+
pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
|
|
54
|
+
ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
|
|
55
|
+
unstyled = input(void 0, {
|
|
56
|
+
...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
|
|
57
|
+
transform: optionalBoolean
|
|
58
|
+
});
|
|
59
|
+
isUnstyled = injectUnstyled(this.unstyled);
|
|
60
|
+
passThrough = injectPassThrough("country", this, this.pt, this.ptOptions);
|
|
61
|
+
code = computed(() => {
|
|
62
|
+
const value = (this.country() ?? "").trim().toUpperCase();
|
|
63
|
+
return isCountryCode(value) ? value : null;
|
|
64
|
+
}, ...ngDevMode ? [{ debugName: "code" }] : /* istanbul ignore next */ []);
|
|
65
|
+
label = computed(() => this.name() ?? (this.code() ? countryName(this.code() ?? "", this.locale.locale().intl) : (this.country() ?? "").trim()), ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
66
|
+
flag = computed(() => {
|
|
67
|
+
const code = this.code();
|
|
68
|
+
return code && this.resolver ? this.resolver(code, this.shape()) : null;
|
|
69
|
+
}, ...ngDevMode ? [{ debugName: "flag" }] : /* istanbul ignore next */ []);
|
|
70
|
+
emoji = computed(() => countryEmoji(this.code() ?? ""), ...ngDevMode ? [{ debugName: "emoji" }] : /* istanbul ignore next */ []);
|
|
71
|
+
hostStyle = computed(() => ({
|
|
72
|
+
...toStyleObject(this.dt(), "--tx-country"),
|
|
73
|
+
...this.passThrough().root?.style
|
|
74
|
+
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
75
|
+
flagClass(own) {
|
|
76
|
+
return [own, this.passThrough().flag?.class].filter(Boolean).join(" ");
|
|
77
|
+
}
|
|
78
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
79
|
+
minVersion: "12.0.0",
|
|
80
|
+
version: "22.2.3",
|
|
81
|
+
ngImport: i0,
|
|
82
|
+
type: TxCountry,
|
|
83
|
+
deps: [],
|
|
84
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
85
|
+
});
|
|
86
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
87
|
+
minVersion: "17.0.0",
|
|
88
|
+
version: "22.2.3",
|
|
89
|
+
type: TxCountry,
|
|
90
|
+
isStandalone: true,
|
|
91
|
+
selector: "tx-country",
|
|
92
|
+
inputs: {
|
|
93
|
+
country: {
|
|
94
|
+
classPropertyName: "country",
|
|
95
|
+
publicName: "country",
|
|
96
|
+
isSignal: true,
|
|
97
|
+
isRequired: false,
|
|
98
|
+
transformFunction: null
|
|
99
|
+
},
|
|
100
|
+
name: {
|
|
101
|
+
classPropertyName: "name",
|
|
102
|
+
publicName: "name",
|
|
103
|
+
isSignal: true,
|
|
104
|
+
isRequired: false,
|
|
105
|
+
transformFunction: null
|
|
106
|
+
},
|
|
107
|
+
showName: {
|
|
108
|
+
classPropertyName: "showName",
|
|
109
|
+
publicName: "showName",
|
|
110
|
+
isSignal: true,
|
|
111
|
+
isRequired: false,
|
|
112
|
+
transformFunction: null
|
|
113
|
+
},
|
|
114
|
+
size: {
|
|
115
|
+
classPropertyName: "size",
|
|
116
|
+
publicName: "size",
|
|
117
|
+
isSignal: true,
|
|
118
|
+
isRequired: false,
|
|
119
|
+
transformFunction: null
|
|
120
|
+
},
|
|
121
|
+
shape: {
|
|
122
|
+
classPropertyName: "shape",
|
|
123
|
+
publicName: "shape",
|
|
124
|
+
isSignal: true,
|
|
125
|
+
isRequired: false,
|
|
126
|
+
transformFunction: null
|
|
127
|
+
},
|
|
128
|
+
dt: {
|
|
129
|
+
classPropertyName: "dt",
|
|
130
|
+
publicName: "dt",
|
|
131
|
+
isSignal: true,
|
|
132
|
+
isRequired: false,
|
|
133
|
+
transformFunction: null
|
|
134
|
+
},
|
|
135
|
+
pt: {
|
|
136
|
+
classPropertyName: "pt",
|
|
137
|
+
publicName: "pt",
|
|
138
|
+
isSignal: true,
|
|
139
|
+
isRequired: false,
|
|
140
|
+
transformFunction: null
|
|
141
|
+
},
|
|
142
|
+
ptOptions: {
|
|
143
|
+
classPropertyName: "ptOptions",
|
|
144
|
+
publicName: "ptOptions",
|
|
145
|
+
isSignal: true,
|
|
146
|
+
isRequired: false,
|
|
147
|
+
transformFunction: null
|
|
148
|
+
},
|
|
149
|
+
unstyled: {
|
|
150
|
+
classPropertyName: "unstyled",
|
|
151
|
+
publicName: "unstyled",
|
|
152
|
+
isSignal: true,
|
|
153
|
+
isRequired: false,
|
|
154
|
+
transformFunction: null
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
host: {
|
|
158
|
+
properties: {
|
|
159
|
+
"class": "passThrough().root?.class",
|
|
160
|
+
"style": "hostStyle()",
|
|
161
|
+
"attr.data-styled": "!isUnstyled() || null",
|
|
162
|
+
"attr.data-size": "size()",
|
|
163
|
+
"attr.data-shape": "shape()",
|
|
164
|
+
"attr.role": "showName() || !code() ? null : \"img\"",
|
|
165
|
+
"attr.aria-label": "showName() || !code() ? null : label()",
|
|
166
|
+
"attr.title": "showName() ? null : label()"
|
|
167
|
+
},
|
|
168
|
+
classAttribute: "tx-country"
|
|
169
|
+
},
|
|
170
|
+
ngImport: i0,
|
|
171
|
+
template: `
|
|
172
|
+
@if (code(); as iso) {
|
|
173
|
+
@if (flag(); as image) {
|
|
174
|
+
@if (image.src) {
|
|
175
|
+
<img class="tx-country__flag tx-country__flag--image" alt="" [src]="image.src" [class]="passThrough().flag?.class" [style]="passThrough().flag?.style" />
|
|
176
|
+
} @else {
|
|
177
|
+
<span class="tx-country__flag" aria-hidden="true" [class]="flagClass(image.class)" [style]="passThrough().flag?.style"></span>
|
|
178
|
+
}
|
|
179
|
+
} @else {
|
|
180
|
+
<span class="tx-country__flag tx-country__flag--emoji" aria-hidden="true" [class]="passThrough().flag?.class" [style]="passThrough().flag?.style">{{
|
|
181
|
+
emoji()
|
|
182
|
+
}}</span>
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
@if (showName()) {
|
|
186
|
+
<span class="tx-country__name" [class]="passThrough().name?.class" [style]="passThrough().name?.style">{{ label() }}</span>
|
|
187
|
+
}
|
|
188
|
+
`,
|
|
189
|
+
isInline: true,
|
|
190
|
+
styles: [":host{display:inline-flex;align-items:center;min-width:0;vertical-align:middle}.tx-country__flag{display:inline-block;flex:none}.tx-country__name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([data-styled]){--_size: var(--tx-country-small-size);gap:var(--tx-country-gap)}:host([data-styled]) .tx-country__flag:not(.tx-country__flag--emoji){width:calc(var(--_size) * 4 / 3);height:var(--_size);border-radius:var(--tx-country-border-radius);background-position:center;background-size:cover;box-shadow:var(--tx-country-ring);object-fit:cover}:host([data-styled]) .tx-country__flag--emoji{font-size:var(--_size);line-height:1}:host([data-styled]) .tx-country__name{color:var(--tx-country-name-color)}:host([data-styled][data-size=medium]){--_size: var(--tx-country-medium-size)}:host([data-styled][data-size=large]){--_size: var(--tx-country-large-size)}:host([data-styled][data-shape=circle]) .tx-country__flag:not(.tx-country__flag--emoji){width:var(--_size);border-radius:50%}\n"],
|
|
191
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
192
|
+
});
|
|
193
|
+
};
|
|
194
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
195
|
+
minVersion: "12.0.0",
|
|
196
|
+
version: "22.2.3",
|
|
197
|
+
ngImport: i0,
|
|
198
|
+
type: TxCountry,
|
|
199
|
+
decorators: [{
|
|
200
|
+
type: Component,
|
|
201
|
+
args: [{
|
|
202
|
+
selector: "tx-country",
|
|
203
|
+
template: `
|
|
204
|
+
@if (code(); as iso) {
|
|
205
|
+
@if (flag(); as image) {
|
|
206
|
+
@if (image.src) {
|
|
207
|
+
<img class="tx-country__flag tx-country__flag--image" alt="" [src]="image.src" [class]="passThrough().flag?.class" [style]="passThrough().flag?.style" />
|
|
208
|
+
} @else {
|
|
209
|
+
<span class="tx-country__flag" aria-hidden="true" [class]="flagClass(image.class)" [style]="passThrough().flag?.style"></span>
|
|
210
|
+
}
|
|
211
|
+
} @else {
|
|
212
|
+
<span class="tx-country__flag tx-country__flag--emoji" aria-hidden="true" [class]="passThrough().flag?.class" [style]="passThrough().flag?.style">{{
|
|
213
|
+
emoji()
|
|
214
|
+
}}</span>
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
@if (showName()) {
|
|
218
|
+
<span class="tx-country__name" [class]="passThrough().name?.class" [style]="passThrough().name?.style">{{ label() }}</span>
|
|
219
|
+
}
|
|
220
|
+
`,
|
|
221
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
222
|
+
host: {
|
|
223
|
+
class: "tx-country",
|
|
224
|
+
"[class]": "passThrough().root?.class",
|
|
225
|
+
"[style]": "hostStyle()",
|
|
226
|
+
"[attr.data-styled]": "!isUnstyled() || null",
|
|
227
|
+
"[attr.data-size]": "size()",
|
|
228
|
+
"[attr.data-shape]": "shape()",
|
|
229
|
+
"[attr.role]": "showName() || !code() ? null : \"img\"",
|
|
230
|
+
"[attr.aria-label]": "showName() || !code() ? null : label()",
|
|
231
|
+
"[attr.title]": "showName() ? null : label()"
|
|
232
|
+
},
|
|
233
|
+
styles: [":host{display:inline-flex;align-items:center;min-width:0;vertical-align:middle}.tx-country__flag{display:inline-block;flex:none}.tx-country__name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([data-styled]){--_size: var(--tx-country-small-size);gap:var(--tx-country-gap)}:host([data-styled]) .tx-country__flag:not(.tx-country__flag--emoji){width:calc(var(--_size) * 4 / 3);height:var(--_size);border-radius:var(--tx-country-border-radius);background-position:center;background-size:cover;box-shadow:var(--tx-country-ring);object-fit:cover}:host([data-styled]) .tx-country__flag--emoji{font-size:var(--_size);line-height:1}:host([data-styled]) .tx-country__name{color:var(--tx-country-name-color)}:host([data-styled][data-size=medium]){--_size: var(--tx-country-medium-size)}:host([data-styled][data-size=large]){--_size: var(--tx-country-large-size)}:host([data-styled][data-shape=circle]) .tx-country__flag:not(.tx-country__flag--emoji){width:var(--_size);border-radius:50%}\n"]
|
|
234
|
+
}]
|
|
235
|
+
}],
|
|
236
|
+
propDecorators: {
|
|
237
|
+
country: [{
|
|
238
|
+
type: i0.Input,
|
|
239
|
+
args: [{
|
|
240
|
+
isSignal: true,
|
|
241
|
+
alias: "country",
|
|
242
|
+
required: false
|
|
243
|
+
}]
|
|
244
|
+
}],
|
|
245
|
+
name: [{
|
|
246
|
+
type: i0.Input,
|
|
247
|
+
args: [{
|
|
248
|
+
isSignal: true,
|
|
249
|
+
alias: "name",
|
|
250
|
+
required: false
|
|
251
|
+
}]
|
|
252
|
+
}],
|
|
253
|
+
showName: [{
|
|
254
|
+
type: i0.Input,
|
|
255
|
+
args: [{
|
|
256
|
+
isSignal: true,
|
|
257
|
+
alias: "showName",
|
|
258
|
+
required: false
|
|
259
|
+
}]
|
|
260
|
+
}],
|
|
261
|
+
size: [{
|
|
262
|
+
type: i0.Input,
|
|
263
|
+
args: [{
|
|
264
|
+
isSignal: true,
|
|
265
|
+
alias: "size",
|
|
266
|
+
required: false
|
|
267
|
+
}]
|
|
268
|
+
}],
|
|
269
|
+
shape: [{
|
|
270
|
+
type: i0.Input,
|
|
271
|
+
args: [{
|
|
272
|
+
isSignal: true,
|
|
273
|
+
alias: "shape",
|
|
274
|
+
required: false
|
|
275
|
+
}]
|
|
276
|
+
}],
|
|
277
|
+
dt: [{
|
|
278
|
+
type: i0.Input,
|
|
279
|
+
args: [{
|
|
280
|
+
isSignal: true,
|
|
281
|
+
alias: "dt",
|
|
282
|
+
required: false
|
|
283
|
+
}]
|
|
284
|
+
}],
|
|
285
|
+
pt: [{
|
|
286
|
+
type: i0.Input,
|
|
287
|
+
args: [{
|
|
288
|
+
isSignal: true,
|
|
289
|
+
alias: "pt",
|
|
290
|
+
required: false
|
|
291
|
+
}]
|
|
292
|
+
}],
|
|
293
|
+
ptOptions: [{
|
|
294
|
+
type: i0.Input,
|
|
295
|
+
args: [{
|
|
296
|
+
isSignal: true,
|
|
297
|
+
alias: "ptOptions",
|
|
298
|
+
required: false
|
|
299
|
+
}]
|
|
300
|
+
}],
|
|
301
|
+
unstyled: [{
|
|
302
|
+
type: i0.Input,
|
|
303
|
+
args: [{
|
|
304
|
+
isSignal: true,
|
|
305
|
+
alias: "unstyled",
|
|
306
|
+
required: false
|
|
307
|
+
}]
|
|
308
|
+
}]
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
export { TX_COUNTRY_CODES, TX_FLAG_RESOLVER, TxCountry, countryEmoji, countryName, isCountryCode, provideTxFlags, txFlagIcons, txFlagImages };
|
|
312
|
+
|
|
313
|
+
//# sourceMappingURL=tectra-ng-ui-country.mjs.map
|
|
@@ -0,0 +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.component.ts"],"sourcesContent":["export 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\nexport function isCountryCode(code: string | null | undefined): boolean {\n return !!code && COUNTRY_CODE.test(code.trim().toUpperCase());\n}\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\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 } from './country.types';\n\nexport const TX_FLAG_RESOLVER = new InjectionToken<TxFlagResolver>('TX_FLAG_RESOLVER');\n\nexport function provideTxFlags(resolver: TxFlagResolver): Provider {\n return { provide: TX_FLAG_RESOLVER, useValue: resolver };\n}\n\nexport const txFlagIcons: TxFlagResolver = (code, shape) => ({\n class: `fi fi-${code.toLowerCase()}${shape === 'circle' ? ' fis' : ''}`,\n});\n\nexport function txFlagImages(url: (code: string, shape: string) => string): TxFlagResolver {\n return (code, shape) => ({ src: url(code.toLowerCase(), shape) });\n}\n","import { ChangeDetectionStrategy, Component, booleanAttribute, computed, inject, input } from '@angular/core';\nimport { TxPassThrough, TxPassThroughOptions, injectPassThrough, injectUnstyled } 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, TxFlagShape } from './country.types';\nimport { TX_FLAG_RESOLVER } from './flags';\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 {\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})\nexport class TxCountry {\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(() => this.name() ?? (this.code() ? countryName(this.code() ?? '', this.locale.locale().intl) : (this.country() ?? '').trim()));\n readonly flag = computed(() => {\n const code = this.code();\n return code && this.resolver ? this.resolver(code, this.shape()) : null;\n });\n readonly emoji = computed(() => countryEmoji(this.code() ?? ''));\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-country'), ...this.passThrough().root?.style }));\n\n flagClass(own: string | undefined): string {\n return [own, this.passThrough().flag?.class].filter(Boolean).join(' ');\n }\n}\n"],"mappings":";;;;;;AAAA,MAAa,mBACX,gvBAMA,MAAM,GAAG;AAEX,MAAM,eAAe;AACrB,MAAM,4BAAY,IAAI,IAAG;AAEzB,SAAgB,cAAc,MAA+B;CAC3D,OAAO,CAAC,CAAC,QAAQ,aAAa,KAAK,KAAK,KAAI,CAAE,CAAC,YAAW,CAAE;AAC9D;AAEA,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;AAEA,SAAgB,aAAa,MAAY;CACvC,MAAM,QAAQ,KAAK,KAAI,CAAE,CAAC,YAAW;CACrC,OAAO,cAAc,KAAK,IAAI,OAAO,cAAc,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,KAAK,WAAW,SAAU,OAAO,WAAW,CAAC,IAAI,EAAE,CAAC,IAAI;AAC3H;AC7BA,M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