@elementar-rt/components 0.6.55
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/README.md +49 -0
- package/action-required/index.d.ts +13 -0
- package/alert/index.d.ts +51 -0
- package/announcement/index.d.ts +45 -0
- package/avatar/index.d.ts +67 -0
- package/block-loader/index.d.ts +21 -0
- package/block-state/index.d.ts +33 -0
- package/brand-colors/index.d.ts +27 -0
- package/breadcrumbs/index.d.ts +104 -0
- package/card-overlay/index.d.ts +20 -0
- package/carousel/index.d.ts +75 -0
- package/code-highlighter/index.d.ts +18 -0
- package/color-picker/index.d.ts +92 -0
- package/color-scheme/index.d.ts +44 -0
- package/command-bar/index.d.ts +28 -0
- package/comment-editor/index.d.ts +194 -0
- package/comparison-slider/index.d.ts +51 -0
- package/confirm/index.d.ts +35 -0
- package/content-fade/index.d.ts +17 -0
- package/cookie-popup/index.d.ts +41 -0
- package/core/index.d.ts +252 -0
- package/country-select/index.d.ts +76 -0
- package/crop/index.d.ts +59 -0
- package/currency-select/index.d.ts +78 -0
- package/dashboard/index.d.ts +48 -0
- package/data-view/index.d.ts +127 -0
- package/date-format-select/index.d.ts +56 -0
- package/divider/index.d.ts +13 -0
- package/drawer/index.d.ts +35 -0
- package/emoji-picker/index.d.ts +49 -0
- package/expand/index.d.ts +26 -0
- package/fesm2022/elementar-rt-components-action-required.mjs +30 -0
- package/fesm2022/elementar-rt-components-action-required.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-alert.mjs +139 -0
- package/fesm2022/elementar-rt-components-alert.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-announcement.mjs +73 -0
- package/fesm2022/elementar-rt-components-announcement.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-avatar.mjs +234 -0
- package/fesm2022/elementar-rt-components-avatar.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-block-loader.mjs +54 -0
- package/fesm2022/elementar-rt-components-block-loader.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-block-state.mjs +75 -0
- package/fesm2022/elementar-rt-components-block-state.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-brand-colors.mjs +78 -0
- package/fesm2022/elementar-rt-components-brand-colors.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-breadcrumbs.mjs +213 -0
- package/fesm2022/elementar-rt-components-breadcrumbs.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-card-overlay.mjs +55 -0
- package/fesm2022/elementar-rt-components-card-overlay.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-carousel.mjs +605 -0
- package/fesm2022/elementar-rt-components-carousel.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-code-highlighter.mjs +57 -0
- package/fesm2022/elementar-rt-components-code-highlighter.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-color-picker.mjs +708 -0
- package/fesm2022/elementar-rt-components-color-picker.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-color-scheme.mjs +106 -0
- package/fesm2022/elementar-rt-components-color-scheme.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-command-bar.mjs +59 -0
- package/fesm2022/elementar-rt-components-command-bar.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-comment-editor.mjs +1039 -0
- package/fesm2022/elementar-rt-components-comment-editor.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-comparison-slider.mjs +193 -0
- package/fesm2022/elementar-rt-components-comparison-slider.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-confirm.mjs +86 -0
- package/fesm2022/elementar-rt-components-confirm.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-content-fade.mjs +35 -0
- package/fesm2022/elementar-rt-components-content-fade.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-cookie-popup.mjs +109 -0
- package/fesm2022/elementar-rt-components-cookie-popup.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-core.mjs +837 -0
- package/fesm2022/elementar-rt-components-core.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-country-select.mjs +477 -0
- package/fesm2022/elementar-rt-components-country-select.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-crop.mjs +183 -0
- package/fesm2022/elementar-rt-components-crop.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-currency-select.mjs +384 -0
- package/fesm2022/elementar-rt-components-currency-select.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-dashboard.mjs +96 -0
- package/fesm2022/elementar-rt-components-dashboard.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-data-view.mjs +302 -0
- package/fesm2022/elementar-rt-components-data-view.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-date-format-select.mjs +136 -0
- package/fesm2022/elementar-rt-components-date-format-select.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-divider.mjs +31 -0
- package/fesm2022/elementar-rt-components-divider.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-drawer.mjs +131 -0
- package/fesm2022/elementar-rt-components-drawer.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-emoji-picker.mjs +249 -0
- package/fesm2022/elementar-rt-components-emoji-picker.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-expand.mjs +60 -0
- package/fesm2022/elementar-rt-components-expand.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-filter-builder.mjs +333 -0
- package/fesm2022/elementar-rt-components-filter-builder.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-autocomplete-many-field.component-AqEghjO_.mjs +123 -0
- package/fesm2022/elementar-rt-components-form-renderer-autocomplete-many-field.component-AqEghjO_.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-checkbox-field.component-CUKmZGFq.mjs +22 -0
- package/fesm2022/elementar-rt-components-form-renderer-checkbox-field.component-CUKmZGFq.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-datepicker-field.component-DihIRWMt.mjs +40 -0
- package/fesm2022/elementar-rt-components-form-renderer-datepicker-field.component-DihIRWMt.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-divider-content.component-CjlGcU3B.mjs +17 -0
- package/fesm2022/elementar-rt-components-form-renderer-divider-content.component-CjlGcU3B.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-image-content.component-0pL2Fk0H.mjs +17 -0
- package/fesm2022/elementar-rt-components-form-renderer-image-content.component-0pL2Fk0H.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-input-field.component-X2sKvj6J.mjs +33 -0
- package/fesm2022/elementar-rt-components-form-renderer-input-field.component-X2sKvj6J.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-radio-group-field.component-DWXZAA3F.mjs +38 -0
- package/fesm2022/elementar-rt-components-form-renderer-radio-group-field.component-DWXZAA3F.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-select-field.component-Cx9DZoD6.mjs +39 -0
- package/fesm2022/elementar-rt-components-form-renderer-select-field.component-Cx9DZoD6.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-text-content.component-BmFyUG06.mjs +24 -0
- package/fesm2022/elementar-rt-components-form-renderer-text-content.component-BmFyUG06.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-textarea-field.component-D9KmE049.mjs +37 -0
- package/fesm2022/elementar-rt-components-form-renderer-textarea-field.component-D9KmE049.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-timezone-field.component-BroP_Q4P.mjs +35 -0
- package/fesm2022/elementar-rt-components-form-renderer-timezone-field.component-BroP_Q4P.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-toggle-field.component-nGbtVi1_.mjs +22 -0
- package/fesm2022/elementar-rt-components-form-renderer-toggle-field.component-nGbtVi1_.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer.mjs +321 -0
- package/fesm2022/elementar-rt-components-form-renderer.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-gauge.mjs +50 -0
- package/fesm2022/elementar-rt-components-gauge.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-icon.mjs +62 -0
- package/fesm2022/elementar-rt-components-icon.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-image-resizer.mjs +159 -0
- package/fesm2022/elementar-rt-components-image-resizer.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-image-viewer.mjs +349 -0
- package/fesm2022/elementar-rt-components-image-viewer.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-incidents.mjs +259 -0
- package/fesm2022/elementar-rt-components-incidents.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-inline-text-edit.mjs +181 -0
- package/fesm2022/elementar-rt-components-inline-text-edit.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-input-mask.mjs +180 -0
- package/fesm2022/elementar-rt-components-input-mask.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-input-validator.mjs +24 -0
- package/fesm2022/elementar-rt-components-input-validator.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-kanban-board.mjs +156 -0
- package/fesm2022/elementar-rt-components-kanban-board.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-layout.mjs +188 -0
- package/fesm2022/elementar-rt-components-layout.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-logo.mjs +43 -0
- package/fesm2022/elementar-rt-components-logo.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-marquee.mjs +79 -0
- package/fesm2022/elementar-rt-components-marquee.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-micro-chart.mjs +950 -0
- package/fesm2022/elementar-rt-components-micro-chart.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-navigation.mjs +379 -0
- package/fesm2022/elementar-rt-components-navigation.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-notifications.mjs +190 -0
- package/fesm2022/elementar-rt-components-notifications.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-number-input.mjs +288 -0
- package/fesm2022/elementar-rt-components-number-input.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-overlay-scrollbar.mjs +455 -0
- package/fesm2022/elementar-rt-components-overlay-scrollbar.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-overlay.mjs +112 -0
- package/fesm2022/elementar-rt-components-overlay.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-page-loading-bar.mjs +79 -0
- package/fesm2022/elementar-rt-components-page-loading-bar.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-panel.mjs +105 -0
- package/fesm2022/elementar-rt-components-panel.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-password-strength.mjs +474 -0
- package/fesm2022/elementar-rt-components-password-strength.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-phone-input.mjs +637 -0
- package/fesm2022/elementar-rt-components-phone-input.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-pin-input.mjs +197 -0
- package/fesm2022/elementar-rt-components-pin-input.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-popover.mjs +262 -0
- package/fesm2022/elementar-rt-components-popover.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-radio-card.mjs +102 -0
- package/fesm2022/elementar-rt-components-radio-card.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-rail-nav.mjs +84 -0
- package/fesm2022/elementar-rt-components-rail-nav.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-resizable-container.mjs +69 -0
- package/fesm2022/elementar-rt-components-resizable-container.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-screen-loader.mjs +27 -0
- package/fesm2022/elementar-rt-components-screen-loader.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-scroll-spy.mjs +165 -0
- package/fesm2022/elementar-rt-components-scroll-spy.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-segmented.mjs +153 -0
- package/fesm2022/elementar-rt-components-segmented.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-side-panel.mjs +110 -0
- package/fesm2022/elementar-rt-components-side-panel.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-sidebar.mjs +423 -0
- package/fesm2022/elementar-rt-components-sidebar.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-signature-pad.mjs +452 -0
- package/fesm2022/elementar-rt-components-signature-pad.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-skeleton.mjs +56 -0
- package/fesm2022/elementar-rt-components-skeleton.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-splash-screen.mjs +91 -0
- package/fesm2022/elementar-rt-components-splash-screen.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-stepper.mjs +194 -0
- package/fesm2022/elementar-rt-components-stepper.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-suggestions.mjs +76 -0
- package/fesm2022/elementar-rt-components-suggestions.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-tab-panel.mjs +270 -0
- package/fesm2022/elementar-rt-components-tab-panel.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-text-editor.mjs +1025 -0
- package/fesm2022/elementar-rt-components-text-editor.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-thumbnail-maker.mjs +214 -0
- package/fesm2022/elementar-rt-components-thumbnail-maker.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-timeline.mjs +122 -0
- package/fesm2022/elementar-rt-components-timeline.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-timezone-select.mjs +351 -0
- package/fesm2022/elementar-rt-components-timezone-select.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-upload.mjs +340 -0
- package/fesm2022/elementar-rt-components-upload.mjs.map +1 -0
- package/fesm2022/elementar-rt-components.mjs +6 -0
- package/fesm2022/elementar-rt-components.mjs.map +1 -0
- package/filter-builder/index.d.ts +107 -0
- package/form-renderer/index.d.ts +121 -0
- package/gauge/index.d.ts +21 -0
- package/icon/index.d.ts +17 -0
- package/image-resizer/index.d.ts +35 -0
- package/image-viewer/index.d.ts +63 -0
- package/incidents/index.d.ts +119 -0
- package/index.d.ts +2 -0
- package/inline-text-edit/index.d.ts +39 -0
- package/input-mask/index.d.ts +36 -0
- package/input-validator/index.d.ts +5 -0
- package/kanban-board/index.d.ts +68 -0
- package/layout/index.d.ts +75 -0
- package/logo/index.d.ts +21 -0
- package/marquee/index.d.ts +26 -0
- package/micro-chart/index.d.ts +193 -0
- package/navigation/index.d.ts +119 -0
- package/notifications/index.d.ts +84 -0
- package/number-input/index.d.ts +93 -0
- package/overlay/index.d.ts +12 -0
- package/overlay-scrollbar/index.d.ts +66 -0
- package/package.json +356 -0
- package/page-loading-bar/index.d.ts +20 -0
- package/panel/index.d.ts +43 -0
- package/password-strength/index.d.ts +109 -0
- package/phone-input/index.d.ts +94 -0
- package/pin-input/index.d.ts +48 -0
- package/popover/index.d.ts +75 -0
- package/radio-card/index.d.ts +37 -0
- package/rail-nav/index.d.ts +36 -0
- package/resizable-container/index.d.ts +21 -0
- package/screen-loader/index.d.ts +9 -0
- package/scroll-spy/index.d.ts +48 -0
- package/segmented/index.d.ts +54 -0
- package/side-panel/index.d.ts +42 -0
- package/sidebar/index.d.ts +143 -0
- package/signature-pad/index.d.ts +49 -0
- package/skeleton/index.d.ts +24 -0
- package/splash-screen/index.d.ts +31 -0
- package/stepper/index.d.ts +65 -0
- package/styles/_common.scss +776 -0
- package/styles/themes/cyan-orange.scss +41 -0
- package/styles/themes/default.scss +5 -0
- package/styles/themes/magenta-violet.scss +41 -0
- package/styles/themes/rose-red.scss +41 -0
- package/suggestions/index.d.ts +32 -0
- package/tab-panel/index.d.ts +96 -0
- package/text-editor/index.d.ts +191 -0
- package/thumbnail-maker/index.d.ts +35 -0
- package/timeline/index.d.ts +57 -0
- package/timezone-select/index.d.ts +72 -0
- package/upload/index.d.ts +134 -0
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, Renderer2, signal, input, model, booleanAttribute, computed, viewChild, DestroyRef, effect, forwardRef, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { FormControl, NgControl, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { MatFormFieldControl } from '@angular/material/form-field';
|
|
6
|
+
import { MatOption, MatSelect, MatSelectTrigger } from '@angular/material/select';
|
|
7
|
+
import { Subject } from 'rxjs';
|
|
8
|
+
import { startWith } from 'rxjs/operators';
|
|
9
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
10
|
+
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
11
|
+
import { toSignal } from '@angular/core/rxjs-interop';
|
|
12
|
+
import { MatIconButton } from '@angular/material/button';
|
|
13
|
+
import { MatIcon } from '@angular/material/icon';
|
|
14
|
+
|
|
15
|
+
const countries = [
|
|
16
|
+
{ "code": "AF", "name": "Afghanistan", "flag": "🇦🇫" },
|
|
17
|
+
{ "code": "AX", "name": "Åland Islands", "flag": "🇦🇽" },
|
|
18
|
+
{ "code": "AL", "name": "Albania", "flag": "🇦🇱" },
|
|
19
|
+
{ "code": "DZ", "name": "Algeria", "flag": "🇩🇿" },
|
|
20
|
+
{ "code": "AS", "name": "American Samoa", "flag": "🇦🇸" },
|
|
21
|
+
{ "code": "AD", "name": "Andorra", "flag": "🇦🇩" },
|
|
22
|
+
{ "code": "AO", "name": "Angola", "flag": "🇦🇴" },
|
|
23
|
+
{ "code": "AI", "name": "Anguilla", "flag": "🇦🇮" },
|
|
24
|
+
{ "code": "AQ", "name": "Antarctica", "flag": "🇦🇶" },
|
|
25
|
+
{ "code": "AG", "name": "Antigua and Barbuda", "flag": "🇦🇬" },
|
|
26
|
+
{ "code": "AR", "name": "Argentina", "flag": "🇦🇷" },
|
|
27
|
+
{ "code": "AM", "name": "Armenia", "flag": "🇦🇲" },
|
|
28
|
+
{ "code": "AW", "name": "Aruba", "flag": "🇦🇼" },
|
|
29
|
+
{ "code": "AU", "name": "Australia", "flag": "🇦🇺" },
|
|
30
|
+
{ "code": "AT", "name": "Austria", "flag": "🇦🇹" },
|
|
31
|
+
{ "code": "AZ", "name": "Azerbaijan", "flag": "🇦🇿" },
|
|
32
|
+
{ "code": "BS", "name": "Bahamas", "flag": "🇧🇸" },
|
|
33
|
+
{ "code": "BH", "name": "Bahrain", "flag": "🇧🇭" },
|
|
34
|
+
{ "code": "BD", "name": "Bangladesh", "flag": "🇧🇩" },
|
|
35
|
+
{ "code": "BB", "name": "Barbados", "flag": "🇧🇧" },
|
|
36
|
+
{ "code": "BY", "name": "Belarus", "flag": "🇧🇾" },
|
|
37
|
+
{ "code": "BE", "name": "Belgium", "flag": "🇧🇪" },
|
|
38
|
+
{ "code": "BZ", "name": "Belize", "flag": "🇧🇿" },
|
|
39
|
+
{ "code": "BJ", "name": "Benin", "flag": "🇧🇯" },
|
|
40
|
+
{ "code": "BM", "name": "Bermuda", "flag": "🇧🇲" },
|
|
41
|
+
{ "code": "BT", "name": "Bhutan", "flag": "🇧🇹" },
|
|
42
|
+
{ "code": "BO", "name": "Bolivia (Plurinational State of)", "flag": "🇧🇴" },
|
|
43
|
+
{ "code": "BQ", "name": "Bonaire, Sint Eustatius and Saba", "flag": "🇧🇶" },
|
|
44
|
+
{ "code": "BA", "name": "Bosnia and Herzegovina", "flag": "🇧🇦" },
|
|
45
|
+
{ "code": "BW", "name": "Botswana", "flag": "🇧🇼" },
|
|
46
|
+
{ "code": "BV", "name": "Bouvet Island", "flag": "🇧🇻" },
|
|
47
|
+
{ "code": "BR", "name": "Brazil", "flag": "🇧🇷" },
|
|
48
|
+
{ "code": "IO", "name": "British Indian Ocean Territory", "flag": "🇮🇴" },
|
|
49
|
+
{ "code": "BN", "name": "Brunei Darussalam", "flag": "🇧🇳" },
|
|
50
|
+
{ "code": "BG", "name": "Bulgaria", "flag": "🇧🇬" },
|
|
51
|
+
{ "code": "BF", "name": "Burkina Faso", "flag": "🇧🇫" },
|
|
52
|
+
{ "code": "BI", "name": "Burundi", "flag": "🇧🇮" },
|
|
53
|
+
{ "code": "CV", "name": "Cabo Verde", "flag": "🇨🇻" },
|
|
54
|
+
{ "code": "KH", "name": "Cambodia", "flag": "🇰🇭" },
|
|
55
|
+
{ "code": "CM", "name": "Cameroon", "flag": "🇨🇲" },
|
|
56
|
+
{ "code": "CA", "name": "Canada", "flag": "🇨🇦" },
|
|
57
|
+
{ "code": "KY", "name": "Cayman Islands", "flag": "🇰🇾" },
|
|
58
|
+
{ "code": "CF", "name": "Central African Republic", "flag": "🇨🇫" },
|
|
59
|
+
{ "code": "TD", "name": "Chad", "flag": "🇹🇩" },
|
|
60
|
+
{ "code": "CL", "name": "Chile", "flag": "🇨🇱" },
|
|
61
|
+
{ "code": "CN", "name": "China", "flag": "🇨🇳" },
|
|
62
|
+
{ "code": "CX", "name": "Christmas Island", "flag": "🇨🇽" },
|
|
63
|
+
{ "code": "CC", "name": "Cocos (Keeling) Islands", "flag": "🇨🇨" },
|
|
64
|
+
{ "code": "CO", "name": "Colombia", "flag": "🇨🇴" },
|
|
65
|
+
{ "code": "KM", "name": "Comoros", "flag": "🇰🇲" },
|
|
66
|
+
{ "code": "CG", "name": "Congo", "flag": "🇨🇬" },
|
|
67
|
+
{ "code": "CD", "name": "Congo (Democratic Republic of the)", "flag": "🇨🇩" },
|
|
68
|
+
{ "code": "CK", "name": "Cook Islands", "flag": "🇨🇰" },
|
|
69
|
+
{ "code": "CR", "name": "Costa Rica", "flag": "🇨🇷" },
|
|
70
|
+
{ "code": "CI", "name": "Côte d'Ivoire", "flag": "🇨🇮" },
|
|
71
|
+
{ "code": "HR", "name": "Croatia", "flag": "🇭🇷" },
|
|
72
|
+
{ "code": "CU", "name": "Cuba", "flag": "🇨🇺" },
|
|
73
|
+
{ "code": "CW", "name": "Curaçao", "flag": "🇨🇼" },
|
|
74
|
+
{ "code": "CY", "name": "Cyprus", "flag": "🇨🇾" },
|
|
75
|
+
{ "code": "CZ", "name": "Czechia", "flag": "🇨🇿" },
|
|
76
|
+
{ "code": "DK", "name": "Denmark", "flag": "🇩🇰" },
|
|
77
|
+
{ "code": "DJ", "name": "Djibouti", "flag": "🇩🇯" },
|
|
78
|
+
{ "code": "DM", "name": "Dominica", "flag": "🇩🇲" },
|
|
79
|
+
{ "code": "DO", "name": "Dominican Republic", "flag": "🇩🇴" },
|
|
80
|
+
{ "code": "EC", "name": "Ecuador", "flag": "🇪🇨" },
|
|
81
|
+
{ "code": "EG", "name": "Egypt", "flag": "🇪🇬" },
|
|
82
|
+
{ "code": "SV", "name": "El Salvador", "flag": "🇸🇻" },
|
|
83
|
+
{ "code": "GQ", "name": "Equatorial Guinea", "flag": "🇬🇶" },
|
|
84
|
+
{ "code": "ER", "name": "Eritrea", "flag": "🇪🇷" },
|
|
85
|
+
{ "code": "EE", "name": "Estonia", "flag": "🇪🇪" },
|
|
86
|
+
{ "code": "SZ", "name": "Eswatini", "flag": "🇸🇿" },
|
|
87
|
+
{ "code": "ET", "name": "Ethiopia", "flag": "🇪🇹" },
|
|
88
|
+
{ "code": "FK", "name": "Falkland Islands (Malvinas)", "flag": "🇫🇰" },
|
|
89
|
+
{ "code": "FO", "name": "Faroe Islands", "flag": "🇫🇴" },
|
|
90
|
+
{ "code": "FJ", "name": "Fiji", "flag": "🇫🇯" },
|
|
91
|
+
{ "code": "FI", "name": "Finland", "flag": "🇫🇮" },
|
|
92
|
+
{ "code": "FR", "name": "France", "flag": "🇫🇷" },
|
|
93
|
+
{ "code": "GF", "name": "French Guiana", "flag": "🇬🇫" },
|
|
94
|
+
{ "code": "PF", "name": "French Polynesia", "flag": "🇵🇫" },
|
|
95
|
+
{ "code": "TF", "name": "French Southern Territories", "flag": "🇹🇫" },
|
|
96
|
+
{ "code": "GA", "name": "Gabon", "flag": "🇬🇦" },
|
|
97
|
+
{ "code": "GM", "name": "Gambia", "flag": "🇬🇲" },
|
|
98
|
+
{ "code": "GE", "name": "Georgia", "flag": "🇬🇪" },
|
|
99
|
+
{ "code": "DE", "name": "Germany", "flag": "🇩🇪" },
|
|
100
|
+
{ "code": "GH", "name": "Ghana", "flag": "🇬🇭" },
|
|
101
|
+
{ "code": "GI", "name": "Gibraltar", "flag": "🇬🇮" },
|
|
102
|
+
{ "code": "GR", "name": "Greece", "flag": "🇬🇷" },
|
|
103
|
+
{ "code": "GL", "name": "Greenland", "flag": "🇬🇱" },
|
|
104
|
+
{ "code": "GD", "name": "Grenada", "flag": "🇬🇩" },
|
|
105
|
+
{ "code": "GP", "name": "Guadeloupe", "flag": "🇬🇵" },
|
|
106
|
+
{ "code": "GU", "name": "Guam", "flag": "🇬🇺" },
|
|
107
|
+
{ "code": "GT", "name": "Guatemala", "flag": "🇬🇹" },
|
|
108
|
+
{ "code": "GG", "name": "Guernsey", "flag": "🇬🇬" },
|
|
109
|
+
{ "code": "GN", "name": "Guinea", "flag": "🇬🇳" },
|
|
110
|
+
{ "code": "GW", "name": "Guinea-Bissau", "flag": "🇬🇼" },
|
|
111
|
+
{ "code": "GY", "name": "Guyana", "flag": "🇬🇾" },
|
|
112
|
+
{ "code": "HT", "name": "Haiti", "flag": "🇭🇹" },
|
|
113
|
+
{ "code": "HM", "name": "Heard Island and McDonald Islands", "flag": "🇭🇲" },
|
|
114
|
+
{ "code": "VA", "name": "Holy See", "flag": "🇻🇦" },
|
|
115
|
+
{ "code": "HN", "name": "Honduras", "flag": "🇭🇳" },
|
|
116
|
+
{ "code": "HK", "name": "Hong Kong", "flag": "🇭🇰" },
|
|
117
|
+
{ "code": "HU", "name": "Hungary", "flag": "🇭🇺" },
|
|
118
|
+
{ "code": "IS", "name": "Iceland", "flag": "🇮🇸" },
|
|
119
|
+
{ "code": "IN", "name": "India", "flag": "🇮🇳" },
|
|
120
|
+
{ "code": "ID", "name": "Indonesia", "flag": "🇮🇩" },
|
|
121
|
+
{ "code": "IR", "name": "Iran (Islamic Republic of)", "flag": "🇮🇷" },
|
|
122
|
+
{ "code": "IQ", "name": "Iraq", "flag": "🇮🇶" },
|
|
123
|
+
{ "code": "IE", "name": "Ireland", "flag": "🇮🇪" },
|
|
124
|
+
{ "code": "IM", "name": "Isle of Man", "flag": "🇮🇲" },
|
|
125
|
+
{ "code": "IL", "name": "Israel", "flag": "🇮🇱" },
|
|
126
|
+
{ "code": "IT", "name": "Italy", "flag": "🇮🇹" },
|
|
127
|
+
{ "code": "JM", "name": "Jamaica", "flag": "🇯🇲" },
|
|
128
|
+
{ "code": "JP", "name": "Japan", "flag": "🇯🇵" },
|
|
129
|
+
{ "code": "JE", "name": "Jersey", "flag": "🇯🇪" },
|
|
130
|
+
{ "code": "JO", "name": "Jordan", "flag": "🇯🇴" },
|
|
131
|
+
{ "code": "KZ", "name": "Kazakhstan", "flag": "🇰🇿" },
|
|
132
|
+
{ "code": "KE", "name": "Kenya", "flag": "🇰🇪" },
|
|
133
|
+
{ "code": "KI", "name": "Kiribati", "flag": "🇰🇮" },
|
|
134
|
+
{ "code": "KP", "name": "Korea (Democratic People's Republic of)", "flag": "🇰🇵" },
|
|
135
|
+
{ "code": "KR", "name": "Korea (Republic of)", "flag": "🇰🇷" },
|
|
136
|
+
{ "code": "KW", "name": "Kuwait", "flag": "🇰🇼" },
|
|
137
|
+
{ "code": "KG", "name": "Kyrgyzstan", "flag": "🇰🇬" },
|
|
138
|
+
{ "code": "LA", "name": "Lao People's Democratic Republic", "flag": "🇱🇦" },
|
|
139
|
+
{ "code": "LV", "name": "Latvia", "flag": "🇱🇻" },
|
|
140
|
+
{ "code": "LB", "name": "Lebanon", "flag": "🇱🇧" },
|
|
141
|
+
{ "code": "LS", "name": "Lesotho", "flag": "🇱🇸" },
|
|
142
|
+
{ "code": "LR", "name": "Liberia", "flag": "🇱🇷" },
|
|
143
|
+
{ "code": "LY", "name": "Libya", "flag": "🇱🇾" },
|
|
144
|
+
{ "code": "LI", "name": "Liechtenstein", "flag": "🇱🇮" },
|
|
145
|
+
{ "code": "LT", "name": "Lithuania", "flag": "🇱🇹" },
|
|
146
|
+
{ "code": "LU", "name": "Luxembourg", "flag": "🇱🇺" },
|
|
147
|
+
{ "code": "MO", "name": "Macao", "flag": "🇲🇴" },
|
|
148
|
+
{ "code": "MG", "name": "Madagascar", "flag": "🇲🇬" },
|
|
149
|
+
{ "code": "MW", "name": "Malawi", "flag": "🇲🇼" },
|
|
150
|
+
{ "code": "MY", "name": "Malaysia", "flag": "🇲🇾" },
|
|
151
|
+
{ "code": "MV", "name": "Maldives", "flag": "🇲🇻" },
|
|
152
|
+
{ "code": "ML", "name": "Mali", "flag": "🇲🇱" },
|
|
153
|
+
{ "code": "MT", "name": "Malta", "flag": "🇲🇹" },
|
|
154
|
+
{ "code": "MH", "name": "Marshall Islands", "flag": "🇲🇭" },
|
|
155
|
+
{ "code": "MQ", "name": "Martinique", "flag": "🇲🇶" },
|
|
156
|
+
{ "code": "MR", "name": "Mauritania", "flag": "🇲🇷" },
|
|
157
|
+
{ "code": "MU", "name": "Mauritius", "flag": "🇲🇺" },
|
|
158
|
+
{ "code": "YT", "name": "Mayotte", "flag": "🇾🇹" },
|
|
159
|
+
{ "code": "MX", "name": "Mexico", "flag": "🇲🇽" },
|
|
160
|
+
{ "code": "FM", "name": "Micronesia (Federated States of)", "flag": "🇫🇲" },
|
|
161
|
+
{ "code": "MD", "name": "Moldova (Republic of)", "flag": "🇲🇩" },
|
|
162
|
+
{ "code": "MC", "name": "Monaco", "flag": "🇲🇨" },
|
|
163
|
+
{ "code": "MN", "name": "Mongolia", "flag": "🇲🇳" },
|
|
164
|
+
{ "code": "ME", "name": "Montenegro", "flag": "🇲🇪" },
|
|
165
|
+
{ "code": "MS", "name": "Montserrat", "flag": "🇲🇸" },
|
|
166
|
+
{ "code": "MA", "name": "Morocco", "flag": "🇲🇦" },
|
|
167
|
+
{ "code": "MZ", "name": "Mozambique", "flag": "🇲🇿" },
|
|
168
|
+
{ "code": "MM", "name": "Myanmar", "flag": "🇲🇲" },
|
|
169
|
+
{ "code": "NA", "name": "Namibia", "flag": "🇳🇦" },
|
|
170
|
+
{ "code": "NR", "name": "Nauru", "flag": "🇳🇷" },
|
|
171
|
+
{ "code": "NP", "name": "Nepal", "flag": "🇳🇵" },
|
|
172
|
+
{ "code": "NL", "name": "Netherlands", "flag": "🇳🇱" },
|
|
173
|
+
{ "code": "NC", "name": "New Caledonia", "flag": "🇳🇨" },
|
|
174
|
+
{ "code": "NZ", "name": "New Zealand", "flag": "🇳🇿" },
|
|
175
|
+
{ "code": "NI", "name": "Nicaragua", "flag": "🇳🇮" },
|
|
176
|
+
{ "code": "NE", "name": "Niger", "flag": "🇳🇪" },
|
|
177
|
+
{ "code": "NG", "name": "Nigeria", "flag": "🇳🇬" },
|
|
178
|
+
{ "code": "NU", "name": "Niue", "flag": "🇳🇺" },
|
|
179
|
+
{ "code": "NF", "name": "Norfolk Island", "flag": "🇳🇫" },
|
|
180
|
+
{ "code": "MK", "name": "North Macedonia", "flag": "🇲🇰" },
|
|
181
|
+
{ "code": "MP", "name": "Northern Mariana Islands", "flag": "🇲🇵" },
|
|
182
|
+
{ "code": "NO", "name": "Norway", "flag": "🇳🇴" },
|
|
183
|
+
{ "code": "OM", "name": "Oman", "flag": "🇴🇲" },
|
|
184
|
+
{ "code": "PK", "name": "Pakistan", "flag": "🇵🇰" },
|
|
185
|
+
{ "code": "PW", "name": "Palau", "flag": "🇵🇼" },
|
|
186
|
+
{ "code": "PS", "name": "Palestine, State of", "flag": "🇵🇸" },
|
|
187
|
+
{ "code": "PA", "name": "Panama", "flag": "🇵🇦" },
|
|
188
|
+
{ "code": "PG", "name": "Papua New Guinea", "flag": "🇵🇬" },
|
|
189
|
+
{ "code": "PY", "name": "Paraguay", "flag": "🇵🇾" },
|
|
190
|
+
{ "code": "PE", "name": "Peru", "flag": "🇵🇪" },
|
|
191
|
+
{ "code": "PH", "name": "Philippines", "flag": "🇵🇭" },
|
|
192
|
+
{ "code": "PN", "name": "Pitcairn", "flag": "🇵🇳" },
|
|
193
|
+
{ "code": "PL", "name": "Poland", "flag": "🇵🇱" },
|
|
194
|
+
{ "code": "PT", "name": "Portugal", "flag": "🇵🇹" },
|
|
195
|
+
{ "code": "PR", "name": "Puerto Rico", "flag": "🇵🇷" },
|
|
196
|
+
{ "code": "QA", "name": "Qatar", "flag": "🇶🇦" },
|
|
197
|
+
{ "code": "RE", "name": "Réunion", "flag": "🇷🇪" },
|
|
198
|
+
{ "code": "RO", "name": "Romania", "flag": "🇷🇴" },
|
|
199
|
+
{ "code": "RU", "name": "Russian Federation", "flag": "🇷🇺" },
|
|
200
|
+
{ "code": "RW", "name": "Rwanda", "flag": "🇷🇼" },
|
|
201
|
+
{ "code": "BL", "name": "Saint Barthélemy", "flag": "🇧🇱" },
|
|
202
|
+
{ "code": "SH", "name": "Saint Helena, Ascension and Tristan da Cunha", "flag": "🇸🇭" },
|
|
203
|
+
{ "code": "KN", "name": "Saint Kitts and Nevis", "flag": "🇰🇳" },
|
|
204
|
+
{ "code": "LC", "name": "Saint Lucia", "flag": "🇱🇨" },
|
|
205
|
+
{ "code": "MF", "name": "Saint Martin (French part)", "flag": "🇲🇫" },
|
|
206
|
+
{ "code": "PM", "name": "Saint Pierre and Miquelon", "flag": "🇵🇲" },
|
|
207
|
+
{ "code": "VC", "name": "Saint Vincent and the Grenadines", "flag": "🇻🇨" },
|
|
208
|
+
{ "code": "WS", "name": "Samoa", "flag": "🇼🇸" },
|
|
209
|
+
{ "code": "SM", "name": "San Marino", "flag": "🇸🇲" },
|
|
210
|
+
{ "code": "ST", "name": "Sao Tome and Principe", "flag": "🇸🇹" },
|
|
211
|
+
{ "code": "SA", "name": "Saudi Arabia", "flag": "🇸🇦" },
|
|
212
|
+
{ "code": "SN", "name": "Senegal", "flag": "🇸🇳" },
|
|
213
|
+
{ "code": "RS", "name": "Serbia", "flag": "🇷🇸" },
|
|
214
|
+
{ "code": "SC", "name": "Seychelles", "flag": "🇸🇨" },
|
|
215
|
+
{ "code": "SL", "name": "Sierra Leone", "flag": "🇸🇱" },
|
|
216
|
+
{ "code": "SG", "name": "Singapore", "flag": "🇸🇬" },
|
|
217
|
+
{ "code": "SX", "name": "Sint Maarten (Dutch part)", "flag": "🇸🇽" },
|
|
218
|
+
{ "code": "SK", "name": "Slovakia", "flag": "🇸🇰" },
|
|
219
|
+
{ "code": "SI", "name": "Slovenia", "flag": "🇸🇮" },
|
|
220
|
+
{ "code": "SB", "name": "Solomon Islands", "flag": "🇸🇧" },
|
|
221
|
+
{ "code": "SO", "name": "Somalia", "flag": "🇸🇴" },
|
|
222
|
+
{ "code": "ZA", "name": "South Africa", "flag": "🇿🇦" },
|
|
223
|
+
{ "code": "GS", "name": "South Georgia and the South Sandwich Islands", "flag": "🇬🇸" },
|
|
224
|
+
{ "code": "SS", "name": "South Sudan", "flag": "🇸🇸" },
|
|
225
|
+
{ "code": "ES", "name": "Spain", "flag": "🇪🇸" },
|
|
226
|
+
{ "code": "LK", "name": "Sri Lanka", "flag": "🇱🇰" },
|
|
227
|
+
{ "code": "SD", "name": "Sudan", "flag": "🇸🇩" },
|
|
228
|
+
{ "code": "SR", "name": "Suriname", "flag": "🇸🇷" },
|
|
229
|
+
{ "code": "SJ", "name": "Svalbard and Jan Mayen", "flag": "🇸🇯" },
|
|
230
|
+
{ "code": "SE", "name": "Sweden", "flag": "🇸🇪" },
|
|
231
|
+
{ "code": "CH", "name": "Switzerland", "flag": "🇨🇭" },
|
|
232
|
+
{ "code": "SY", "name": "Syrian Arab Republic", "flag": "🇸🇾" },
|
|
233
|
+
{ "code": "TW", "name": "Taiwan, Province of China", "flag": "🇹🇼" },
|
|
234
|
+
{ "code": "TJ", "name": "Tajikistan", "flag": "🇹🇯" },
|
|
235
|
+
{ "code": "TZ", "name": "Tanzania, United Republic of", "flag": "🇹🇿" },
|
|
236
|
+
{ "code": "TH", "name": "Thailand", "flag": "🇹🇭" },
|
|
237
|
+
{ "code": "TL", "name": "Timor-Leste", "flag": "🇹🇱" },
|
|
238
|
+
{ "code": "TG", "name": "Togo", "flag": "🇹🇬" },
|
|
239
|
+
{ "code": "TK", "name": "Tokelau", "flag": "🇹🇰" },
|
|
240
|
+
{ "code": "TO", "name": "Tonga", "flag": "🇹🇴" },
|
|
241
|
+
{ "code": "TT", "name": "Trinidad and Tobago", "flag": "🇹🇹" },
|
|
242
|
+
{ "code": "TN", "name": "Tunisia", "flag": "🇹🇳" },
|
|
243
|
+
{ "code": "TR", "name": "Turkey", "flag": "🇹🇷" },
|
|
244
|
+
{ "code": "TM", "name": "Turkmenistan", "flag": "🇹🇲" },
|
|
245
|
+
{ "code": "TC", "name": "Turks and Caicos Islands", "flag": "🇹🇨" },
|
|
246
|
+
{ "code": "TV", "name": "Tuvalu", "flag": "🇹🇻" },
|
|
247
|
+
{ "code": "UG", "name": "Uganda", "flag": "🇺🇬" },
|
|
248
|
+
{ "code": "UA", "name": "Ukraine", "flag": "🇺🇦" },
|
|
249
|
+
{ "code": "AE", "name": "United Arab Emirates", "flag": "🇦🇪" },
|
|
250
|
+
{ "code": "GB", "name": "United Kingdom of Great Britain and Northern Ireland", "flag": "🇬🇧" },
|
|
251
|
+
{ "code": "US", "name": "United States of America", "flag": "🇺🇸" },
|
|
252
|
+
{ "code": "UM", "name": "United States Minor Outlying Islands", "flag": "🇺🇲" },
|
|
253
|
+
{ "code": "UY", "name": "Uruguay", "flag": "🇺🇾" },
|
|
254
|
+
{ "code": "UZ", "name": "Uzbekistan", "flag": "🇺🇿" },
|
|
255
|
+
{ "code": "VU", "name": "Vanuatu", "flag": "🇻🇺" },
|
|
256
|
+
{ "code": "VE", "name": "Venezuela (Bolivarian Republic of)", "flag": "🇻🇪" },
|
|
257
|
+
{ "code": "VN", "name": "Viet Nam", "flag": "🇻🇳" },
|
|
258
|
+
{ "code": "VG", "name": "Virgin Islands (British)", "flag": "🇻🇬" },
|
|
259
|
+
{ "code": "VI", "name": "Virgin Islands (U.S.)", "flag": "🇻🇮" },
|
|
260
|
+
{ "code": "WF", "name": "Wallis and Futuna", "flag": "🇼🇫" },
|
|
261
|
+
{ "code": "EH", "name": "Western Sahara", "flag": "🇪🇭" },
|
|
262
|
+
{ "code": "YE", "name": "Yemen", "flag": "🇾🇪" },
|
|
263
|
+
{ "code": "ZM", "name": "Zambia", "flag": "🇿🇲" },
|
|
264
|
+
{ "code": "ZW", "name": "Zimbabwe", "flag": "🇿🇼" }
|
|
265
|
+
];
|
|
266
|
+
|
|
267
|
+
class CountrySelectComponent {
|
|
268
|
+
_elementRef = inject(ElementRef);
|
|
269
|
+
_renderer = inject(Renderer2);
|
|
270
|
+
static nextId = 0;
|
|
271
|
+
id = `emr-country-select-${CountrySelectComponent.nextId++}`;
|
|
272
|
+
stateChanges = new Subject();
|
|
273
|
+
controlType = 'emr-country-select';
|
|
274
|
+
autofilled;
|
|
275
|
+
_valueSignal = signal(null, ...(ngDevMode ? [{ debugName: "_valueSignal" }] : []));
|
|
276
|
+
_focusedSignal = signal(false, ...(ngDevMode ? [{ debugName: "_focusedSignal" }] : []));
|
|
277
|
+
_touched = false;
|
|
278
|
+
placeholderInputSignal = input('', ...(ngDevMode ? [{ debugName: "placeholderInputSignal", alias: 'placeholder' }] : [{ alias: 'placeholder' }]));
|
|
279
|
+
isRequiredSignal = model(false, ...(ngDevMode ? [{ debugName: "isRequiredSignal", alias: 'required' }] : [{ alias: 'required' }]));
|
|
280
|
+
isDisabledSignal = model(false, ...(ngDevMode ? [{ debugName: "isDisabledSignal", alias: 'disabled' }] : [{ alias: 'disabled' }]));
|
|
281
|
+
showCountryCode = input(false, ...(ngDevMode ? [{ debugName: "showCountryCode", transform: booleanAttribute }] : [{
|
|
282
|
+
transform: booleanAttribute
|
|
283
|
+
}]));
|
|
284
|
+
searchCtrl = new FormControl('');
|
|
285
|
+
searchText = toSignal(this.searchCtrl.valueChanges.pipe(startWith('')), { initialValue: '' });
|
|
286
|
+
internalCountries = countries;
|
|
287
|
+
filteredCountries = computed(() => this._filterCountries(this.searchText()), ...(ngDevMode ? [{ debugName: "filteredCountries" }] : []));
|
|
288
|
+
selectedCountryDisplay = computed(() => {
|
|
289
|
+
return this.internalCountries.find(c => c.code === this._valueSignal());
|
|
290
|
+
}, ...(ngDevMode ? [{ debugName: "selectedCountryDisplay" }] : []));
|
|
291
|
+
matSelect = viewChild.required('matSelect');
|
|
292
|
+
searchInput = viewChild.required('searchInput');
|
|
293
|
+
fm = inject(FocusMonitor);
|
|
294
|
+
elRef = inject(ElementRef);
|
|
295
|
+
ngControl = inject(NgControl, { self: true, optional: true });
|
|
296
|
+
destroyRef = inject(DestroyRef);
|
|
297
|
+
onChangeFn = () => { };
|
|
298
|
+
onTouchedFn = () => { };
|
|
299
|
+
constructor() {
|
|
300
|
+
if (this.ngControl) {
|
|
301
|
+
this.ngControl.valueAccessor = this;
|
|
302
|
+
}
|
|
303
|
+
this.destroyRef.onDestroy(() => {
|
|
304
|
+
this.fm.stopMonitoring(this.elRef.nativeElement);
|
|
305
|
+
this.stateChanges.complete();
|
|
306
|
+
});
|
|
307
|
+
effect(() => {
|
|
308
|
+
this.onChangeFn(this._valueSignal());
|
|
309
|
+
});
|
|
310
|
+
effect(() => {
|
|
311
|
+
this._valueSignal();
|
|
312
|
+
this._focusedSignal();
|
|
313
|
+
this.isRequiredSignal();
|
|
314
|
+
this.isDisabledSignal();
|
|
315
|
+
this.placeholderInputSignal();
|
|
316
|
+
this.ngControl?.control?.status;
|
|
317
|
+
this.stateChanges.next();
|
|
318
|
+
});
|
|
319
|
+
effect(() => {
|
|
320
|
+
if (this.isDisabledSignal()) {
|
|
321
|
+
this.searchCtrl.disable({ emitEvent: false });
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
this.searchCtrl.enable({ emitEvent: false });
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
ngOnInit() {
|
|
329
|
+
if (this.ngControl?.control) {
|
|
330
|
+
const control = this.ngControl.control;
|
|
331
|
+
if (control.validator) {
|
|
332
|
+
const validator = control.validator({});
|
|
333
|
+
if (validator && validator['required']) {
|
|
334
|
+
this.isRequiredSignal.set(true);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
this.isDisabledSignal.set(control.disabled);
|
|
338
|
+
}
|
|
339
|
+
const formFieldElement = this._elementRef.nativeElement.closest('.mat-mdc-form-field');
|
|
340
|
+
if (formFieldElement) {
|
|
341
|
+
this._renderer.addClass(formFieldElement, 'mat-mdc-form-field-type-mat-select');
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
ngOnDestroy() {
|
|
345
|
+
}
|
|
346
|
+
get value() {
|
|
347
|
+
return this._valueSignal();
|
|
348
|
+
}
|
|
349
|
+
set value(val) {
|
|
350
|
+
this._valueSignal.set(val);
|
|
351
|
+
}
|
|
352
|
+
get focused() {
|
|
353
|
+
return this._focusedSignal();
|
|
354
|
+
}
|
|
355
|
+
get placeholder() {
|
|
356
|
+
return this.placeholderInputSignal();
|
|
357
|
+
}
|
|
358
|
+
set placeholder(plh) {
|
|
359
|
+
this.stateChanges.next();
|
|
360
|
+
}
|
|
361
|
+
get required() {
|
|
362
|
+
return this.isRequiredSignal();
|
|
363
|
+
}
|
|
364
|
+
set required(req) {
|
|
365
|
+
this.isRequiredSignal.set(coerceBooleanProperty(req));
|
|
366
|
+
}
|
|
367
|
+
get disabled() {
|
|
368
|
+
return this.isDisabledSignal();
|
|
369
|
+
}
|
|
370
|
+
set disabled(dis) {
|
|
371
|
+
this.isDisabledSignal.set(coerceBooleanProperty(dis));
|
|
372
|
+
}
|
|
373
|
+
get empty() {
|
|
374
|
+
return !this._valueSignal();
|
|
375
|
+
}
|
|
376
|
+
get shouldLabelFloat() {
|
|
377
|
+
return this._focusedSignal() || !this.empty;
|
|
378
|
+
}
|
|
379
|
+
get errorState() {
|
|
380
|
+
return !!(this.ngControl?.invalid && (this.ngControl?.touched || this._touched));
|
|
381
|
+
}
|
|
382
|
+
get touched() {
|
|
383
|
+
return this._touched;
|
|
384
|
+
}
|
|
385
|
+
setDescribedByIds(ids) {
|
|
386
|
+
const controlElement = this.elRef.nativeElement.querySelector('.select-trigger');
|
|
387
|
+
if (controlElement) {
|
|
388
|
+
controlElement.setAttribute('aria-describedby', ids.join(' '));
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
onContainerClick() {
|
|
392
|
+
if (this.disabled) {
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
this._focusedSignal.set(true);
|
|
396
|
+
this.matSelect().onContainerClick();
|
|
397
|
+
}
|
|
398
|
+
writeValue(value) {
|
|
399
|
+
this._valueSignal.set(value);
|
|
400
|
+
}
|
|
401
|
+
registerOnChange(fn) {
|
|
402
|
+
this.onChangeFn = fn;
|
|
403
|
+
}
|
|
404
|
+
registerOnTouched(fn) {
|
|
405
|
+
this.onTouchedFn = () => {
|
|
406
|
+
this._touched = true;
|
|
407
|
+
fn();
|
|
408
|
+
this.stateChanges.next();
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
setDisabledState(isDisabled) {
|
|
412
|
+
this.disabled = isDisabled;
|
|
413
|
+
}
|
|
414
|
+
_filterCountries(searchText) {
|
|
415
|
+
const filterValue = (searchText || '').toLowerCase();
|
|
416
|
+
if (!filterValue) {
|
|
417
|
+
return [...this.internalCountries];
|
|
418
|
+
}
|
|
419
|
+
return this.internalCountries.filter((country) => country.name.toLowerCase().includes(filterValue) ||
|
|
420
|
+
country.code.toLowerCase().includes(filterValue));
|
|
421
|
+
}
|
|
422
|
+
onSelectionChange(event) {
|
|
423
|
+
this.value = event.value;
|
|
424
|
+
this.onTouchedFn();
|
|
425
|
+
}
|
|
426
|
+
clearSearch(event) {
|
|
427
|
+
event.stopPropagation();
|
|
428
|
+
this.searchCtrl.setValue('');
|
|
429
|
+
this.searchInput().nativeElement.focus();
|
|
430
|
+
}
|
|
431
|
+
onSelectOpened() {
|
|
432
|
+
setTimeout(() => {
|
|
433
|
+
this.searchInput().nativeElement.focus();
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
onSelectClosed() {
|
|
437
|
+
this._focusedSignal.set(false);
|
|
438
|
+
this.searchCtrl.setValue('');
|
|
439
|
+
if (!this._touched) {
|
|
440
|
+
this.onTouchedFn();
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CountrySelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
444
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: CountrySelectComponent, isStandalone: true, selector: "emr-country-select", inputs: { placeholderInputSignal: { classPropertyName: "placeholderInputSignal", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, isRequiredSignal: { classPropertyName: "isRequiredSignal", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, isDisabledSignal: { classPropertyName: "isDisabledSignal", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, showCountryCode: { classPropertyName: "showCountryCode", publicName: "showCountryCode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isRequiredSignal: "requiredChange", isDisabledSignal: "disabledChange" }, host: { properties: { "class.floating": "shouldLabelFloat", "id": "id" }, classAttribute: "emr-country-select" }, providers: [
|
|
445
|
+
{
|
|
446
|
+
provide: MatFormFieldControl,
|
|
447
|
+
useExisting: forwardRef(() => CountrySelectComponent),
|
|
448
|
+
},
|
|
449
|
+
], viewQueries: [{ propertyName: "matSelect", first: true, predicate: ["matSelect"], descendants: true, isSignal: true }, { propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }], exportAs: ["emrCountrySelect"], ngImport: i0, template: "<mat-select\r\n #matSelect\r\n panelClass=\"emr-country-select-panel\"\r\n [value]=\"value\"\r\n (selectionChange)=\"onSelectionChange($event)\"\r\n (opened)=\"onSelectOpened()\"\r\n (closed)=\"onSelectClosed()\"\r\n [placeholder]=\"placeholder\"\r\n [required]=\"isRequiredSignal()\"\r\n [disabled]=\"isDisabledSignal()\">\r\n <mat-select-trigger class=\"select-trigger\">\r\n @let selectedCountry = selectedCountryDisplay();\r\n @if (selectedCountry) {\r\n <div class=\"flex items-center gap-2\">\r\n <span class=\"text-xl leading-[0]\">{{ selectedCountry.flag }}</span>\r\n {{ selectedCountry.name }}\r\n @if (showCountryCode()) {\r\n <span class=\"code\">({{ selectedCountry.code }})</span>\r\n }\r\n </div>\r\n }\r\n\r\n @if (!selectedCountryDisplay() && placeholder) {\r\n <div class=\"placeholder-text\">\r\n {{ placeholder }}\r\n </div>\r\n }\r\n </mat-select-trigger>\r\n\r\n <div class=\"px-3 py-3 rounded-t sticky top-0 z-1 bg-[var(--mat-select-panel-background-color)]\">\r\n <input #searchInput\r\n type=\"text\" placeholder=\"Search...\" autocomplete=\"off\" [formControl]=\"searchCtrl\"\r\n class=\"w-full bg-surface-container-highest rounded-lg text-sm focus:outline-none\r\n focus:bg-surface-container-lowest focus:shadow-sm h-12 px-3\">\r\n @if (searchCtrl.value) {\r\n <div class=\"absolute end-4 top-1/2 -translate-y-1/2\">\r\n <button\r\n mat-icon-button\r\n (click)=\"clearSearch($event)\"\r\n class=\"clear-button\"\r\n type=\"button\"\r\n aria-label=\"Clear search\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n\r\n @for (country of filteredCountries(); track country.code) {\r\n <mat-option [value]=\"country.code\">\r\n <div class=\"flex items-center gap-2 h-full\">\r\n <span class=\"text-xl leading-[0]\">{{ country.flag }}</span>\r\n {{ country.name }}\r\n @if (showCountryCode()) {\r\n <span class=\"code\">({{ country.code }})</span>\r\n }\r\n </div>\r\n </mat-option>\r\n } @empty {\r\n @if (searchCtrl.value) {\r\n <div class=\"text-sm px-4 py-3\">\r\n <span i18n>Country not found</span>.\r\n </div>\r\n }\r\n }\r\n</mat-select>\r\n", styles: [":host{display:block}:host .code{text-transform:uppercase;color:var(--color-neutral-500)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
|
|
450
|
+
}
|
|
451
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CountrySelectComponent, decorators: [{
|
|
452
|
+
type: Component,
|
|
453
|
+
args: [{ selector: 'emr-country-select', exportAs: 'emrCountrySelect', providers: [
|
|
454
|
+
{
|
|
455
|
+
provide: MatFormFieldControl,
|
|
456
|
+
useExisting: forwardRef(() => CountrySelectComponent),
|
|
457
|
+
},
|
|
458
|
+
], host: {
|
|
459
|
+
'class': 'emr-country-select',
|
|
460
|
+
'[class.floating]': 'shouldLabelFloat',
|
|
461
|
+
'[id]': 'id',
|
|
462
|
+
}, imports: [
|
|
463
|
+
MatOption,
|
|
464
|
+
MatIcon,
|
|
465
|
+
MatIconButton,
|
|
466
|
+
MatSelect,
|
|
467
|
+
MatSelectTrigger,
|
|
468
|
+
ReactiveFormsModule
|
|
469
|
+
], template: "<mat-select\r\n #matSelect\r\n panelClass=\"emr-country-select-panel\"\r\n [value]=\"value\"\r\n (selectionChange)=\"onSelectionChange($event)\"\r\n (opened)=\"onSelectOpened()\"\r\n (closed)=\"onSelectClosed()\"\r\n [placeholder]=\"placeholder\"\r\n [required]=\"isRequiredSignal()\"\r\n [disabled]=\"isDisabledSignal()\">\r\n <mat-select-trigger class=\"select-trigger\">\r\n @let selectedCountry = selectedCountryDisplay();\r\n @if (selectedCountry) {\r\n <div class=\"flex items-center gap-2\">\r\n <span class=\"text-xl leading-[0]\">{{ selectedCountry.flag }}</span>\r\n {{ selectedCountry.name }}\r\n @if (showCountryCode()) {\r\n <span class=\"code\">({{ selectedCountry.code }})</span>\r\n }\r\n </div>\r\n }\r\n\r\n @if (!selectedCountryDisplay() && placeholder) {\r\n <div class=\"placeholder-text\">\r\n {{ placeholder }}\r\n </div>\r\n }\r\n </mat-select-trigger>\r\n\r\n <div class=\"px-3 py-3 rounded-t sticky top-0 z-1 bg-[var(--mat-select-panel-background-color)]\">\r\n <input #searchInput\r\n type=\"text\" placeholder=\"Search...\" autocomplete=\"off\" [formControl]=\"searchCtrl\"\r\n class=\"w-full bg-surface-container-highest rounded-lg text-sm focus:outline-none\r\n focus:bg-surface-container-lowest focus:shadow-sm h-12 px-3\">\r\n @if (searchCtrl.value) {\r\n <div class=\"absolute end-4 top-1/2 -translate-y-1/2\">\r\n <button\r\n mat-icon-button\r\n (click)=\"clearSearch($event)\"\r\n class=\"clear-button\"\r\n type=\"button\"\r\n aria-label=\"Clear search\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n\r\n @for (country of filteredCountries(); track country.code) {\r\n <mat-option [value]=\"country.code\">\r\n <div class=\"flex items-center gap-2 h-full\">\r\n <span class=\"text-xl leading-[0]\">{{ country.flag }}</span>\r\n {{ country.name }}\r\n @if (showCountryCode()) {\r\n <span class=\"code\">({{ country.code }})</span>\r\n }\r\n </div>\r\n </mat-option>\r\n } @empty {\r\n @if (searchCtrl.value) {\r\n <div class=\"text-sm px-4 py-3\">\r\n <span i18n>Country not found</span>.\r\n </div>\r\n }\r\n }\r\n</mat-select>\r\n", styles: [":host{display:block}:host .code{text-transform:uppercase;color:var(--color-neutral-500)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"] }]
|
|
470
|
+
}], ctorParameters: () => [], propDecorators: { placeholderInputSignal: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], isRequiredSignal: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }, { type: i0.Output, args: ["requiredChange"] }], isDisabledSignal: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], showCountryCode: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCountryCode", required: false }] }], matSelect: [{ type: i0.ViewChild, args: ['matSelect', { isSignal: true }] }], searchInput: [{ type: i0.ViewChild, args: ['searchInput', { isSignal: true }] }] } });
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* Generated bundle index. Do not edit.
|
|
474
|
+
*/
|
|
475
|
+
|
|
476
|
+
export { CountrySelectComponent, countries };
|
|
477
|
+
//# sourceMappingURL=elementar-rt-components-country-select.mjs.map
|