@theseam/ui-common 0.4.13 → 0.4.15

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 (139) hide show
  1. package/buttons/public-api.d.ts +1 -0
  2. package/buttons/testing/anchor-badge-button.harness.d.ts +16 -0
  3. package/buttons/testing/anchor-button.harness.d.ts +16 -0
  4. package/buttons/testing/badge-button.harness.d.ts +15 -0
  5. package/buttons/testing/base-badge-button.harness.d.ts +15 -0
  6. package/buttons/testing/base-button.harness.d.ts +19 -0
  7. package/buttons/testing/button.harness.d.ts +15 -0
  8. package/buttons/testing/index.d.ts +5 -0
  9. package/buttons/testing/toggle-button.harness.d.ts +21 -0
  10. package/checkbox/checkbox.component.d.ts +1 -1
  11. package/checkbox/checkbox.module.d.ts +2 -3
  12. package/datatable/datatable.module.d.ts +1 -1
  13. package/esm2020/buttons/button/button.component.mjs +2 -1
  14. package/esm2020/buttons/public-api.mjs +2 -1
  15. package/esm2020/buttons/testing/anchor-badge-button.harness.mjs +18 -0
  16. package/esm2020/buttons/testing/anchor-button.harness.mjs +18 -0
  17. package/esm2020/buttons/testing/badge-button.harness.mjs +14 -0
  18. package/esm2020/buttons/testing/base-badge-button.harness.mjs +29 -0
  19. package/esm2020/buttons/testing/base-button.harness.mjs +41 -0
  20. package/esm2020/buttons/testing/button.harness.mjs +16 -0
  21. package/esm2020/buttons/testing/index.mjs +6 -0
  22. package/esm2020/buttons/testing/toggle-button.harness.mjs +25 -0
  23. package/esm2020/checkbox/checkbox.component.mjs +8 -3
  24. package/esm2020/checkbox/checkbox.module.mjs +5 -12
  25. package/esm2020/datatable/datatable.module.mjs +5 -5
  26. package/esm2020/form-field/form-field.component.mjs +4 -4
  27. package/esm2020/framework/schema-form/index.mjs +2 -1
  28. package/esm2020/framework/schema-form/schema-form-framework.component.mjs +6 -3
  29. package/esm2020/framework/schema-form/schema-form-framework.mjs +62 -7
  30. package/esm2020/framework/schema-form/schema-form-widget.mjs +2 -0
  31. package/esm2020/framework/schema-form/schema-form.module.mjs +1 -8
  32. package/esm2020/framework/schema-form-controls/schema-form-checkbox/schema-form-checkbox.component.mjs +21 -11
  33. package/esm2020/framework/schema-form-controls/schema-form-divider/schema-form-divider.component.mjs +20 -0
  34. package/esm2020/framework/schema-form-controls/schema-form-input/schema-form-input.component.mjs +17 -8
  35. package/esm2020/framework/schema-form-controls/schema-form-number/schema-form-number.component.mjs +14 -5
  36. package/esm2020/framework/schema-form-controls/schema-form-select/schema-form-select.component.mjs +19 -9
  37. package/esm2020/framework/schema-form-controls/schema-form-submit/schema-form-submit.component.mjs +21 -13
  38. package/esm2020/framework/schema-form-controls/schema-form-submit-split/schema-form-submit-split.component.mjs +30 -18
  39. package/esm2020/framework/schema-form-controls/schema-form-tel/schema-form-tel.component.mjs +48 -0
  40. package/esm2020/framework/schema-form-controls/schema-form-tiled-select/schema-form-tiled-select.component.mjs +57 -0
  41. package/esm2020/google-maps/google-maps/google-maps.component.mjs +9 -2
  42. package/esm2020/google-maps/google-maps-api-loader/lazy-google-maps-api-loader.mjs +2 -1
  43. package/esm2020/menu/public-api.mjs +5 -1
  44. package/esm2020/menu/testing/menu-footer.harness.mjs +28 -0
  45. package/esm2020/menu/testing/menu-header.harness.mjs +23 -0
  46. package/esm2020/menu/testing/menu-item.harness.mjs +59 -0
  47. package/esm2020/menu/testing/menu.harness.mjs +163 -0
  48. package/esm2020/menu/testing/utils.mjs +13 -0
  49. package/esm2020/story-helpers/args-to-tpl.mjs +83 -0
  50. package/esm2020/story-helpers/public-api.mjs +2 -2
  51. package/esm2020/tel-input/public-api.mjs +2 -1
  52. package/esm2020/tel-input/tel-input/tel-input.component.mjs +22 -10
  53. package/esm2020/tel-input/tel-input.directive.mjs +12 -13
  54. package/esm2020/tel-input/tel-input.module.mjs +10 -9
  55. package/esm2020/tel-input/testing/tel-input.harness.mjs +49 -0
  56. package/esm2020/testing/harnesses/ng-select-dropdown.harness.mjs +39 -0
  57. package/esm2020/testing/harnesses/ng-select-option.harness.mjs +26 -0
  58. package/esm2020/testing/harnesses/ng-select.harness.mjs +104 -0
  59. package/esm2020/testing/public-api.mjs +4 -1
  60. package/esm2020/tiled-select/components/tiled-select/tiled-select.component.mjs +1 -1
  61. package/fesm2015/theseam-ui-common-buttons.mjs +181 -3
  62. package/fesm2015/theseam-ui-common-buttons.mjs.map +1 -1
  63. package/fesm2015/theseam-ui-common-checkbox.mjs +12 -14
  64. package/fesm2015/theseam-ui-common-checkbox.mjs.map +1 -1
  65. package/fesm2015/theseam-ui-common-datatable.mjs +4 -4
  66. package/fesm2015/theseam-ui-common-datatable.mjs.map +1 -1
  67. package/fesm2015/theseam-ui-common-form-field.mjs +3 -3
  68. package/fesm2015/theseam-ui-common-form-field.mjs.map +1 -1
  69. package/fesm2015/theseam-ui-common-framework.mjs +248 -164
  70. package/fesm2015/theseam-ui-common-framework.mjs.map +1 -1
  71. package/fesm2015/theseam-ui-common-google-maps.mjs +10 -1
  72. package/fesm2015/theseam-ui-common-google-maps.mjs.map +1 -1
  73. package/fesm2015/theseam-ui-common-menu.mjs +329 -3
  74. package/fesm2015/theseam-ui-common-menu.mjs.map +1 -1
  75. package/fesm2015/theseam-ui-common-story-helpers.mjs +86 -1
  76. package/fesm2015/theseam-ui-common-story-helpers.mjs.map +1 -1
  77. package/fesm2015/theseam-ui-common-tel-input.mjs +105 -29
  78. package/fesm2015/theseam-ui-common-tel-input.mjs.map +1 -1
  79. package/fesm2015/theseam-ui-common-testing.mjs +197 -1
  80. package/fesm2015/theseam-ui-common-testing.mjs.map +1 -1
  81. package/fesm2015/theseam-ui-common-tiled-select.mjs.map +1 -1
  82. package/fesm2020/theseam-ui-common-buttons.mjs +154 -2
  83. package/fesm2020/theseam-ui-common-buttons.mjs.map +1 -1
  84. package/fesm2020/theseam-ui-common-checkbox.mjs +12 -14
  85. package/fesm2020/theseam-ui-common-checkbox.mjs.map +1 -1
  86. package/fesm2020/theseam-ui-common-datatable.mjs +4 -4
  87. package/fesm2020/theseam-ui-common-datatable.mjs.map +1 -1
  88. package/fesm2020/theseam-ui-common-form-field.mjs +3 -3
  89. package/fesm2020/theseam-ui-common-form-field.mjs.map +1 -1
  90. package/fesm2020/theseam-ui-common-framework.mjs +236 -162
  91. package/fesm2020/theseam-ui-common-framework.mjs.map +1 -1
  92. package/fesm2020/theseam-ui-common-google-maps.mjs +9 -1
  93. package/fesm2020/theseam-ui-common-google-maps.mjs.map +1 -1
  94. package/fesm2020/theseam-ui-common-menu.mjs +275 -2
  95. package/fesm2020/theseam-ui-common-menu.mjs.map +1 -1
  96. package/fesm2020/theseam-ui-common-story-helpers.mjs +84 -1
  97. package/fesm2020/theseam-ui-common-story-helpers.mjs.map +1 -1
  98. package/fesm2020/theseam-ui-common-tel-input.mjs +89 -29
  99. package/fesm2020/theseam-ui-common-tel-input.mjs.map +1 -1
  100. package/fesm2020/theseam-ui-common-testing.mjs +165 -1
  101. package/fesm2020/theseam-ui-common-testing.mjs.map +1 -1
  102. package/fesm2020/theseam-ui-common-tiled-select.mjs.map +1 -1
  103. package/framework/schema-form/index.d.ts +1 -0
  104. package/framework/schema-form/schema-form-framework.d.ts +12 -1
  105. package/framework/schema-form/schema-form-widget.d.ts +61 -0
  106. package/framework/schema-form/schema-form.module.d.ts +1 -2
  107. package/framework/schema-form-controls/schema-form-checkbox/schema-form-checkbox.component.d.ts +12 -11
  108. package/framework/schema-form-controls/schema-form-divider/schema-form-divider.component.d.ts +12 -0
  109. package/framework/schema-form-controls/schema-form-input/schema-form-input.component.d.ts +10 -9
  110. package/framework/schema-form-controls/schema-form-number/schema-form-number.component.d.ts +8 -7
  111. package/framework/schema-form-controls/schema-form-select/schema-form-select.component.d.ts +10 -9
  112. package/framework/schema-form-controls/schema-form-submit/schema-form-submit.component.d.ts +10 -9
  113. package/framework/schema-form-controls/schema-form-submit-split/schema-form-submit-split.component.d.ts +10 -9
  114. package/framework/schema-form-controls/schema-form-tel/schema-form-tel.component.d.ts +23 -0
  115. package/framework/schema-form-controls/schema-form-tiled-select/schema-form-tiled-select.component.d.ts +32 -0
  116. package/google-maps/google-maps/google-maps.component.d.ts +2 -1
  117. package/google-maps/google-maps-api-loader/lazy-google-maps-api-loader.d.ts +1 -0
  118. package/menu/menu-footer-action/menu-footer-action.component.d.ts +1 -1
  119. package/menu/public-api.d.ts +4 -0
  120. package/menu/testing/menu-footer.harness.d.ts +22 -0
  121. package/menu/testing/menu-header.harness.d.ts +18 -0
  122. package/menu/testing/menu-item.harness.d.ts +37 -0
  123. package/menu/testing/menu.harness.d.ts +74 -0
  124. package/menu/testing/utils.d.ts +5 -0
  125. package/package.json +1 -1
  126. package/story-helpers/args-to-tpl.d.ts +25 -0
  127. package/story-helpers/public-api.d.ts +1 -0
  128. package/tel-input/public-api.d.ts +1 -0
  129. package/tel-input/tel-input/tel-input.component.d.ts +2 -2
  130. package/tel-input/tel-input.directive.d.ts +1 -1
  131. package/tel-input/tel-input.module.d.ts +7 -7
  132. package/tel-input/testing/tel-input.harness.d.ts +19 -0
  133. package/testing/harnesses/ng-select-dropdown.harness.d.ts +23 -0
  134. package/testing/harnesses/ng-select-option.harness.d.ts +18 -0
  135. package/testing/harnesses/ng-select.harness.d.ts +50 -0
  136. package/testing/public-api.d.ts +3 -0
  137. package/tiled-select/components/tiled-select/tiled-select.component.d.ts +10 -10
  138. package/esm2020/framework/schema-form-controls/schema-form-controls.module.mjs +0 -79
  139. package/framework/schema-form-controls/schema-form-controls.module.d.ts +0 -20
@@ -1 +1 @@
1
- {"version":3,"file":"theseam-ui-common-tel-input.mjs","sources":["../../../projects/ui-common/tel-input/intl-tel-input.ts","../../../projects/ui-common/tel-input/tel-input-constants.ts","../../../projects/ui-common/tel-input/utils/add-country-code.ts","../../../projects/ui-common/tel-input/models/tel-input-number-format-name.ts","../../../projects/ui-common/tel-input/utils/coerce-phone-number-format.ts","../../../projects/ui-common/tel-input/utils/get-country-code.ts","../../../projects/ui-common/tel-input/utils/get-dial-code.ts","../../../projects/ui-common/tel-input/utils/get-global-intl-tel-input-globals.ts","../../../projects/ui-common/tel-input/utils/get-global-intl-tel-input-utils.ts","../../../projects/ui-common/tel-input/utils/get-intl-tel-input-utils.ts","../../../projects/ui-common/tel-input/utils/get-validation-error-message.ts","../../../projects/ui-common/tel-input/utils/process-country-codes.ts","../../../projects/ui-common/tel-input/tel-input.directive.ts","../../../projects/ui-common/tel-input/tel-input/tel-input.component.ts","../../../projects/ui-common/tel-input/tel-input/tel-input.component.html","../../../projects/ui-common/tel-input/tel-input-validator.ts","../../../projects/ui-common/tel-input/phone-number.pipe.ts","../../../projects/ui-common/tel-input/tel-input.module.ts","../../../projects/ui-common/tel-input/theseam-ui-common-tel-input.ts"],"sourcesContent":["import intlTelInput from 'intl-tel-input'\n\n//\n// NOTE: These types are mainly for providing types to 'intl-tel-input', because\n// the only published types I could find were incomplete. Some types are\n// missing, because they were not necessary for this library. I don't indend\n// this to be a perfect types for 'intl-tel-input', so as long as they are\n// compatible they may be slightly altered or extended to fit this library\n// better.\n//\n\n/**\n * Partial types for intl-tel-input-utils\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace intlTelInputUtils {\n\n export interface CountryData {\n name: string\n iso2: string\n dialCode: string\n areaCodes: string[] | null\n priority: number\n }\n\n export enum numberFormat {\n E164 = 0,\n INTERNATIONAL = 1,\n NATIONAL = 2,\n RFC3966 = 3\n }\n\n export enum numberType {\n FIXED_LINE = 0,\n MOBILE = 1,\n FIXED_LINE_OR_MOBILE = 2,\n TOLL_FREE = 3,\n PREMIUM_RATE = 4,\n SHARED_COST = 5,\n VOIP = 6,\n PERSONAL_NUMBER = 7,\n PAGER = 8,\n UAN = 9,\n VOICEMAIL = 10,\n UNKNOWN = -1\n }\n\n export enum validationError {\n IS_POSSIBLE = 0,\n INVALID_COUNTRY_CODE = 1,\n TOO_SHORT = 2,\n TOO_LONG = 3,\n NOT_A_NUMBER = 4\n }\n\n export type placeholderNumberType =\n | 'FIXED_LINE_OR_MOBILE'\n | 'FIXED_LINE'\n | 'MOBILE'\n | 'PAGER'\n | 'PERSONAL_NUMBER'\n | 'PREMIUM_RATE'\n | 'SHARED_COST'\n | 'TOLL_FREE'\n | 'UAN'\n | 'UNKNOWN'\n | 'VOICEMAIL'\n | 'VOIP'\n\n}\n\n// NOTE: If one of the functions return -99, then it is most likely from a\n// problem in 'google-libphonenumber' that 'intl-tel-input' swallowed in int\n// wrapper.\n//\n// NOTE: The following functions do not exist until util script has loaded.\nexport interface IntlTelInputUtilsScript {\n numberFormat: intlTelInputUtils.numberFormat\n numberType: intlTelInputUtils.numberType\n validationError: intlTelInputUtils.validationError\n\n /**\n * Format the given number to the given format.\n */\n formatNumber(number: string, countryCode: string, format: intlTelInputUtils.numberFormat): string\n\n /**\n * Get an example number for the given country code.\n */\n getExampleNumber(countryCode: string, national: boolean, numberType: intlTelInputUtils.numberType): string\n\n /**\n * Get the extension from the given number.\n */\n getExtension(number: string, countryCode: string): string\n\n /**\n * Get the type of the given number e.g. fixed-line/mobile.\n */\n getNumberType(number: string, countryCode: string): intlTelInputUtils.numberType\n\n /**\n * Get more info if the validation has failed e.g. too long/too short.\n */\n getValidationError(number: string, countryCode: string): intlTelInputUtils.validationError\n\n /**\n * Check if given number is valid.\n */\n isValidNumber(number: string, countryCode: string): boolean\n}\n\n/**\n * Partial types for intl-tel-input\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace IntlTelInput {\n export interface Static {\n /**\n * Default options for all instances\n */\n defaults: Options\n\n /**\n * Get all of the plugin's country data - either to re-use elsewhere\n * e.g. to populate a country dropdown.\n */\n getCountryData(): intlTelInputUtils.CountryData[]\n\n /**\n * Load the utils.js script (included in the lib directory) to enable\n * formatting/validation etc.\n */\n loadUtils(path: string, utilsScriptDeferred?: boolean): Promise<void> /* | null | void */\n }\n\n export interface Plugin {\n promise: Promise<void>\n\n /**\n * Remove the plugin from the input, and unbind any event listeners.\n */\n destroy(): void\n\n /**\n * Get the extension from the current number.\n * Requires the utilsScript option.\n * e.g. if the input value was \"(702) 555-5555 ext. 1234\", this would\n * return \"1234\".\n */\n getExtension(): string\n\n /**\n * Get the current number in the given format (defaults to E.164 standard).\n * The different formats are available in the enum\n * intlTelInputUtils.numberFormat - taken from here.\n * Requires the utilsScript option.\n * Note that even if nationalMode is enabled, this can still return a full\n * international number.\n * @param numberFormat the format in which the number will be returned.\n */\n getNumber(numberFormat?: intlTelInputUtils.numberFormat): string\n\n /**\n * Get the type (fixed-line/mobile/toll-free etc) of the current number.\n * Requires the utilsScript option.\n * Returns an integer, which you can match against the various options in the\n * global enum intlTelInputUtils.numberType.\n * Note that in the US there's no way to differentiate between fixed-line and\n * mobile numbers, so instead it will return FIXED_LINE_OR_MOBILE.\n */\n getNumberType(): intlTelInputUtils.numberType\n\n /**\n * Get the country data for the currently selected flag.\n */\n getSelectedCountryData(): intlTelInputUtils.CountryData\n\n /**\n * Get more information about a validation error.\n * Requires the utilsScript option.\n * Returns an integer, which you can match against the various options in the\n * global enum ValidationError\n */\n getValidationError(): intlTelInputUtils.validationError\n\n /**\n * Validate the current number. Expects an internationally formatted number\n * (unless nationalMode is enabled). If validation fails, you can use\n * getValidationError to get more information.\n * Requires the utilsScript option.\n * Also see getNumberType if you want to make sure the user enters a certain\n * type of number e.g. a mobile number.\n */\n isValidNumber(): boolean\n\n /**\n * Change the country selection (e.g. when the user is entering their address).\n * @param countryCode country code of the country to be set.\n */\n setCountry(countryCode: string): void\n\n /**\n * Insert a number, and update the selected flag accordingly.\n * Note that by default, if nationalMode is enabled it will try to use\n * national formatting.\n * @param aNumber number to be set.\n */\n setNumber(aNumber: string): void\n\n /**\n * Set the type of the placeholder number\n * @param type Placeholder number type to be set\n */\n setPlaceholderNumberType(type: intlTelInputUtils.placeholderNumberType): void\n }\n\n export interface Options {\n /**\n * Whether or not to allow the dropdown. If disabled, there is no dropdown\n * arrow, and the selected flag is not clickable. Also we display the\n * selected flag on the right instead because it is just a marker of state.\n * Default = true\n */\n allowDropdown?: boolean\n\n /**\n * If there is just a dial code in the input: remove it on blur or submit,\n * and re-add it on focus. This is to prevent just a dial code getting\n * submitted with the form. Requires nationalMode to be set to false.\n * Default = true\n */\n autoHideDialCode?: boolean\n\n /**\n * Set the input's placeholder to an example number for the selected country, and update it if the country changes.\n * You can specify the number type using the placeholderNumberType option.\n * By default it is set to \"polite\", which means it will only set the placeholder if the input doesn't already have one.\n * You can also set it to \"aggressive\", which will replace any existing placeholder, or \"off\".\n * Requires the utilsScript option.\n * Default = \"polite\"\n */\n autoPlaceholder?: 'off' | 'polite' | 'aggressive'\n\n /**\n * Change the placeholder generated by autoPlaceholder. Must return a string.\n * Default = null\n */\n customPlaceholder?: (selectedCountryPlaceholder: string, selectedCountryData: intlTelInputUtils.CountryData) => string\n\n /**\n * Expects a node e.g. document.body. Instead of putting the country dropdown next to the input,\n * append it to the specified node, and it will then be positioned absolutely next to the input using JavaScript.\n * This is useful when the input is inside a container with overflow: hidden.\n * Note that the absolute positioning can be broken by scrolling, so it will automatically close on the window scroll event.\n * Default = null\n */\n dropdownContainer?: Node\n\n /**\n * In the dropdown, display all countries except the ones you specify here.\n * Default = null\n */\n excludeCountries?: string[]\n\n /**\n * Format the input value (according to the nationalMode option) during initialisation, and on setNumber.\n * Requires the utilsScript option.\n * Default = true\n */\n formatOnDisplay?: boolean\n\n /**\n * When setting initialCountry to \"auto\", you must use this option to\n * specify a custom function that looks up the user's location,\n * and then calls the success callback with the relevant country code.\n * Also note that when instantiating the plugin, if the Promise object is defined,\n * one of those is returned under the promise instance property, so you can\n * do something like iti.promise.then(callback) to know when initialisation requests like this have completed.\n * Default = null\n */\n geoIpLookup?: (callback: (countryCode: string) => void) => void\n\n /**\n * Add a hidden input with the given name (or if your input name\n * contains square brackets then it will give the hidden input the same\n * name, replacing the contents of the brackets with the given name). On\n * submit, populate it with the full international number (using\n * getNumber). This is a quick way for people using non-ajax forms to\n * get the full international number, even when nationalMode is enabled.\n * Note: requires the input to be inside a form element, as this feature\n * works by listening for the submit event on the closest form element.\n * Also note that since this uses getNumber internally, it expects a\n * valid number, and so should only be used after validation. Default =\n * \"\"\n */\n hiddenInput?: string\n\n /**\n * Set the initial country selection by specifying it's country code.\n * You can also set it to \"auto\", which will lookup the user's country based\n * on their IP address (requires the geoIpLookup option).\n * Note that the \"auto\" option will not update the country selection if the\n * input already contains a number. If you leave initialCountry blank,\n * it will default to the first country in the list.\n */\n initialCountry?: string\n\n /**\n * Allows to translate the countries by its given iso code e.g.: { 'de': 'Deutschland' }\n * Default = {}\n */\n localizedCountries?: object\n\n /**\n * Allow users to enter national numbers (and not have to think about\n * international dial codes). Formatting, validation and placeholders still\n * work. Then you can use getNumber to extract a full international number.\n * This option now defaults to true, and it is recommended that you leave it\n * that way as it provides a better experience for the user.\n * Default = true\n */\n nationalMode?: boolean\n\n /**\n * In the dropdown, display only the countries you specify.\n * Default = undefined\n */\n onlyCountries?: string[]\n\n /**\n * Specify one of the keys from the global enum intlTelInputUtils.numberType\n * e.g. \"FIXED_LINE\" to set the number type to use for the placeholder.\n * Default = MOBILE\n */\n placeholderNumberType?: intlTelInputUtils.placeholderNumberType\n\n /**\n * Specify the countries to appear at the top of the list.\n * Default = [\"us\", \"gb\"]\n */\n preferredCountries?: string[]\n\n /**\n * Display the country dial code next to the selected flag so it's not part\n * of the typed number. Note that this will disable nationalMode because\n * technically we are dealing with international numbers, but with the\n * dial code separated.\n * Default = false\n */\n separateDialCode?: boolean\n\n /**\n * Enable formatting/validation etc. by specifying the URL of the\n * included utils.js script (or alternatively just point it to the file\n * on cdnjs.com). The script is fetched when the page has finished\n * loading (on the window load event) to prevent blocking (the script is\n * ~215KB). When instantiating the plugin, if the Promise object is\n * defined, one of those is returned under the promise instance\n * property, so you can do something like iti.promise.then(callback) to\n * know when initialisation requests like this have finished. Note that\n * if you're lazy loading the plugin script itself (intlTelInput.js)\n * this will not work and you will need to use the loadUtils method\n * instead. Example: \"build/js/utils.js\" Default = \"\"\n */\n utilsScript?: string\n }\n}\n\n/**\n * Initialise the plugin with optional options.\n * @param options options that can be provided during initialization.\n */\nexport function IntlTelInputFn(node: Element, options?: IntlTelInput.Options): IntlTelInput.Plugin {\n return (intlTelInput as any)(node, options)\n}\n\nexport default IntlTelInputFn\n","export const TEL_INPUT_ASSETS_PATH = 'assets/vendor/intl-tel-input'\n\nexport const TEL_INPUT_STYLES = `\n .iti { width: 100%; }\n\n .iti__flag {background-image: url(\"${TEL_INPUT_ASSETS_PATH}/img/flags.png\");}\n\n @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {\n .iti__flag {background-image: url(\"${TEL_INPUT_ASSETS_PATH}/img/flags@2x.png\");}\n }\n\n .iti__country-list {\n /* There is a bug that is causing the 'z-index: 2' from ng-select to conflict with this dropdown container. */\n z-index: 3;\n }\n`\n\nexport const TEL_INPUT_STYLESHEET_PATH = `${TEL_INPUT_ASSETS_PATH}/css/intlTelInput.min.css`\n\nexport const TEL_INPUT_UTILS_PATH = `${TEL_INPUT_ASSETS_PATH}/js/utils.js`\n","import type { TelInputCountryData } from '../models/index'\n\n/**\n * Add a country code to this.countryCodes.\n *\n * Based on: https://github.com/jackocnr/intl-tel-input/blob/4fe25fcf142c341a85b7b15cc307d66afb8573a3/src/js/intlTelInput.js#L197\n */\nexport function addCountryCode(data: TelInputCountryData, iso2: string, countryCode: string, priority?: number) {\n if (countryCode.length > data.countryCodeMaxLen) {\n data.countryCodeMaxLen = countryCode.length\n }\n if (!Object.prototype.hasOwnProperty.call(data.countryCodes, countryCode)) {\n data.countryCodes[countryCode] = []\n }\n // bail if we already have this country for this countryCode\n for (const code of data.countryCodes[countryCode]) {\n if (code === iso2) { return }\n }\n // check for undefined as 0 is falsy\n const index = (priority !== undefined) ? priority : data.countryCodes[countryCode].length\n data.countryCodes[countryCode][index] = iso2\n}\n","import { intlTelInputUtils } from '../intl-tel-input'\n\nexport const TelInputNumberFormatName: { [name: string]: intlTelInputUtils.numberFormat } = {\n 'E164': intlTelInputUtils.numberFormat.E164,\n 'INTERNATIONAL': intlTelInputUtils.numberFormat.INTERNATIONAL,\n 'NATIONAL': intlTelInputUtils.numberFormat.NATIONAL,\n 'RFC3966': intlTelInputUtils.numberFormat.RFC3966\n}\n","import { intlTelInputUtils } from '../intl-tel-input'\nimport { TelInputNumberFormatName } from '../models/index'\n\nexport const THESEAM_DEFAULT_PHONE_NUMBER_FORMAT = intlTelInputUtils.numberFormat.INTERNATIONAL\n\n/**\n * Types that should be acceptable in a template.\n */\nexport type TheSeamNumberFormatsInput =\n // Enum\n intlTelInputUtils.numberFormat\n // Strings matching enum\n | 'E164'\n | 'INTERNATIONAL'\n | 'NATIONAL'\n | 'RFC3966'\n // Strings matching enum in lower case, since it would be what a user will\n // most likely type if string is necessary.\n | 'e164'\n | 'international'\n | 'national'\n | 'rfc3966'\n\nexport function coercePhoneNumberFormat(\n format: TheSeamNumberFormatsInput,\n defaultFormat = THESEAM_DEFAULT_PHONE_NUMBER_FORMAT\n): intlTelInputUtils.numberFormat {\n let res = defaultFormat\n\n if (typeof format === 'string') {\n const _format = TelInputNumberFormatName[`${format}`.trim().toUpperCase()]\n res = (_format === undefined || _format === null) ? defaultFormat : _format\n } else if (typeof format === 'number') {\n // We could check for a number range, but I think it is safer to assume it's\n // valid if a number was provided. A number most likely means the value came\n // from using the enum and I don't want to accidentaly exclude a format that\n // we don't have documented.\n //\n // NOTE: We may want to limit it to specific numbers though and assume that\n // potentialy excluded formats are not intended to be used by this library.\n res = format\n }\n\n return res\n}\n","import type { TelInputCountryData } from '../models/index'\n\nfunction getNumeric(s: string): string {\n return s.replace(/\\D/g, '')\n}\n\nexport function getCountryCode(data: TelInputCountryData, dialCode: string) {\n const _countryCodes = data.countryCodes[getNumeric(dialCode)]\n // Refer to `_setInitialState` to get libraries default logic\n return (_countryCodes === undefined || _countryCodes === null || _countryCodes.length === 0) ? 'us' : _countryCodes[0]\n}\n","import type { TelInputCountryData } from '../models/index'\n\n/**\n * Try and extract a valid international dial code from a full telephone number.\n *\n * NOTE: returns the raw string inc plus character and any whitespace/dots etc.\n *\n * Based on: https://github.com/jackocnr/intl-tel-input/blob/4fe25fcf142c341a85b7b15cc307d66afb8573a3/src/js/intlTelInput.js#L1161\n */\nexport function getDialCode(data: TelInputCountryData, number: string, includeAreaCode: boolean = false): string {\n // console.log('getDialCode', number, includeAreaCode)\n // const data = processCountryCodes(globalIntlTelInputGlobals().getCountryData() as TelInputCountryData[])\n\n let dialCode = ''\n // only interested in international numbers (starting with a plus)\n if (number.charAt(0) === '+') {\n let numericChars = ''\n // iterate over chars\n for (let i = 0; i < number.length; i++) {\n const c = number.charAt(i)\n // if char is number (https://stackoverflow.com/a/8935649/217866)\n if (!isNaN(parseInt(c, 10))) {\n numericChars += c\n // if current numericChars make a valid dial code\n if (includeAreaCode) {\n if (data.countryCodes[numericChars]) {\n // store the actual raw string (useful for matching later)\n dialCode = number.substr(0, i + 1)\n }\n } else {\n if (data.dialCodes[numericChars]) {\n dialCode = number.substr(0, i + 1)\n // if we're just looking for a dial code, we can break as soon as we find one\n break\n }\n }\n // stop searching as soon as we can - in this case when we hit max len\n if (numericChars.length === data.countryCodeMaxLen) {\n break\n }\n }\n }\n }\n\n // console.log('getDialCode return', dialCode)\n return dialCode\n}\n","import type { IntlTelInput } from '../intl-tel-input'\n\nexport function globalIntlTelInputGlobals(): IntlTelInput.Static {\n return (window as any).intlTelInputGlobals\n}\n","import type { IntlTelInputUtilsScript } from '../intl-tel-input'\n\nexport function globalIntlTelInputUtils(): IntlTelInputUtilsScript {\n return (window as any).intlTelInputUtils\n}\n","import { notNullOrUndefined, waitOnConditionAsync } from '@theseam/ui-common/utils'\n\nimport type { IntlTelInputUtilsScript } from '../intl-tel-input'\nimport { TEL_INPUT_UTILS_PATH } from '../tel-input-constants'\nimport { globalIntlTelInputGlobals } from './get-global-intl-tel-input-globals'\nimport { globalIntlTelInputUtils } from './get-global-intl-tel-input-utils'\n\nexport function getIntlTelInputUtils(): Promise<IntlTelInputUtilsScript> {\n if (globalIntlTelInputUtils()) {\n return Promise.resolve(globalIntlTelInputUtils())\n }\n\n if ((globalIntlTelInputGlobals() as any).startedLoadingUtilsScript) {\n return waitOnConditionAsync(() => notNullOrUndefined(globalIntlTelInputUtils()), 5000)\n .then(() => globalIntlTelInputUtils())\n }\n\n return globalIntlTelInputGlobals().loadUtils(TEL_INPUT_UTILS_PATH)\n .then(() => waitOnConditionAsync(() => notNullOrUndefined(globalIntlTelInputUtils()), 5000))\n .then(() => globalIntlTelInputUtils())\n}\n","import { intlTelInputUtils } from '../intl-tel-input'\n\nexport const VALIDATOR_CODE_MESSAGES: { [key: number]: string } = {\n [intlTelInputUtils.validationError.INVALID_COUNTRY_CODE]: 'Country code is invalid.',\n [intlTelInputUtils.validationError.TOO_SHORT]: 'Number is too short.',\n [intlTelInputUtils.validationError.TOO_LONG]: 'Number is too long.',\n [intlTelInputUtils.validationError.NOT_A_NUMBER]: 'Must be numbers only.'\n}\n\nexport function getValidationErrorMessage(code: intlTelInputUtils.validationError): string {\n const message = VALIDATOR_CODE_MESSAGES[code]\n return message ?? 'Invalid number.'\n}\n","import type { intlTelInputUtils } from '../intl-tel-input'\nimport type { TelInputCountryData } from '../models/index'\nimport { addCountryCode } from './add-country-code'\n\n/**\n * Process the countryCodes map.\n *\n * Based on: https://github.com/jackocnr/intl-tel-input/blob/4fe25fcf142c341a85b7b15cc307d66afb8573a3/src/js/intlTelInput.js#L252\n */\nexport function processCountryCodes(countries: intlTelInputUtils.CountryData[]): TelInputCountryData {\n const data: TelInputCountryData = {\n countryCodeMaxLen: 0,\n // here we store just dial codes\n dialCodes: {},\n // here we store \"country codes\" (both dial codes and their area codes)\n countryCodes: {}\n }\n\n // first: add dial codes\n for (const c of countries) {\n if (!data.dialCodes[c.dialCode]) { data.dialCodes[c.dialCode] = true }\n addCountryCode(data, c.iso2, c.dialCode, c.priority)\n }\n\n // next: add area codes\n // this is a second loop over countries, to make sure we have all of the \"root\" countries\n // already in the map, so that we can access them, as each time we add an area code substring\n // to the map, we also need to include the \"root\" country's code, as that also matches\n for (const c of countries) {\n // area codes\n if (c.areaCodes) {\n const rootCountryCode = data.countryCodes[c.dialCode][0]\n // for each area code\n for (const areaCode of c.areaCodes) {\n // for each digit in the area code to add all partial matches as well\n for (let k = 1; k < areaCode.length; k++) {\n const partialDialCode = c.dialCode + areaCode.substr(0, k)\n // start with the root country, as that also matches this dial code\n addCountryCode(data, rootCountryCode, partialDialCode)\n addCountryCode(data, c.iso2, partialDialCode)\n }\n // add the full area code\n addCountryCode(data, c.iso2, c.dialCode + areaCode)\n }\n }\n }\n\n return data\n}\n","import { DOCUMENT } from '@angular/common'\nimport { Directive, DoCheck, ElementRef, Host, HostBinding, Inject, Input, NgZone, OnDestroy, OnInit, Optional, Self } from '@angular/core'\nimport { fromEvent, merge, Subject } from 'rxjs'\nimport { auditTime, last, switchMap, takeUntil, tap } from 'rxjs/operators'\n\nimport { AssetLoaderService, LoadedAssetRef } from '@theseam/ui-common/services'\nimport { getAttribute, hasAttribute, notNullOrUndefined, toggleAttribute } from '@theseam/ui-common/utils'\n\nimport { NgControl } from '@angular/forms'\nimport { IntlTelInputFn, intlTelInputUtils } from './intl-tel-input'\nimport type { IntlTelInput } from './intl-tel-input'\nimport { TEL_INPUT_STYLES, TEL_INPUT_STYLESHEET_PATH, TEL_INPUT_UTILS_PATH } from './tel-input-constants'\nimport { globalIntlTelInputUtils } from './utils/index'\n\n@Directive({\n selector: 'input[seamTelInput]',\n exportAs: 'seamTelInput'\n})\nexport class TheSeamTelInputDirective implements OnInit, OnDestroy, DoCheck {\n private readonly _ngUnsubscribe = new Subject<void>()\n\n private _instance: IntlTelInput.Plugin | undefined\n private _loadedAssetRefs: LoadedAssetRef<HTMLLinkElement | HTMLStyleElement>[] = []\n\n @HostBinding('attr.type') _attrType = 'tel'\n\n @Input()\n set value(v: string | undefined | null) {\n // console.log('set value', v, this._instance)\n this._value = v\n if (this._instance) {\n this._instance.setNumber(notNullOrUndefined(v) ? v : '')\n this.updateValue()\n }\n }\n get value(): string | undefined | null {\n if (this._instance) {\n return this._instance?.getNumber()\n }\n return this._value\n }\n private _value: string | undefined | null\n\n constructor(\n private readonly _elementRef: ElementRef<HTMLInputElement>,\n private readonly _assetLoader: AssetLoaderService,\n private readonly _ngZone: NgZone,\n @Optional() @Inject(DOCUMENT) private readonly _document?: any,\n @Optional() @Self() private readonly _ngControl?: NgControl,\n ) { }\n\n ngOnInit(): void {\n merge(\n this._assetLoader.loadStyleSheet(TEL_INPUT_STYLESHEET_PATH),\n this._assetLoader.loadStyle(TEL_INPUT_STYLES)\n ).pipe(\n // tap(v => console.log('loaded', v)),\n tap(v => this._loadedAssetRefs.push(v)),\n last(),\n // tap(v => console.log('StyleLoadingDone', v)),\n switchMap(() => {\n this._instance = IntlTelInputFn(this._elementRef.nativeElement, {\n utilsScript: TEL_INPUT_UTILS_PATH,\n preferredCountries: [ 'US' ],\n nationalMode: false,\n formatOnDisplay: true,\n autoPlaceholder: 'off',\n separateDialCode: false,\n autoHideDialCode: false,\n // TODO: Add initialCountry support.\n // initialCountry: 'auto'\n })\n\n this._tryUpdateDropdownAttributes()\n\n return this._instance.promise\n }),\n // tap(() => console.log('%c_instance ready', 'color:green', this._instance, this._elementRef.nativeElement.value)),\n tap(() => this._initDropdownListener()),\n tap(() => this.value = this._value),\n tap(this._formatIntlTelInput),\n switchMap(() => merge(\n fromEvent(this._elementRef.nativeElement, 'keyup'),\n fromEvent(this._elementRef.nativeElement, 'change')\n )),\n tap(this._formatIntlTelInput),\n takeUntil(this._ngUnsubscribe)\n ).subscribe()\n }\n\n ngOnDestroy(): void {\n this._instance?.destroy()\n for (const ref of this._loadedAssetRefs) {\n ref.destroy()\n }\n\n this._ngUnsubscribe.next(undefined)\n this._ngUnsubscribe.complete()\n }\n\n ngDoCheck() {\n this._tryUpdateDropdownAttributes()\n }\n\n private _tryUpdateDropdownAttributes() {\n const control = this._ngControl\n if (control) {\n const flagsContainer: HTMLElement | null | undefined = (this._instance as any)?.selectedFlag\n if (flagsContainer) {\n toggleAttribute(flagsContainer, 'aria-disabled', control.disabled ?? false)\n\n const disabled = control.disabled ?? false\n if (!disabled) {\n if (getAttribute(flagsContainer, 'tabindex') !== '0') {\n flagsContainer.setAttribute('tabindex', '0')\n }\n } else {\n if (hasAttribute(flagsContainer, 'tabindex')) {\n flagsContainer.removeAttribute('tabindex')\n }\n }\n }\n }\n }\n\n private _formatIntlTelInput = () => {\n // if (typeof intlTelInputUtils !== 'undefined') {\n // const currentText = this._instance?.getNumber(intlTelInputUtils.numberFormat.INTERNATIONAL)\n // console.log('currentText', currentText, this._instance?.getSelectedCountryData())\n // console.log(this._instance?.getValidationError())\n // if (typeof currentText === 'string') {\n // this._instance?.setNumber(currentText)\n // }\n // }\n\n this.updateValue()\n }\n\n public updateValue(): void {\n // console.log('%cupdateValue START', 'color:cyan', typeof intlTelInputUtils !== 'undefined')\n if (typeof globalIntlTelInputUtils() !== 'undefined') {\n const currentText = this._instance?.getNumber(intlTelInputUtils.numberFormat.E164)\n // console.log('currentText', currentText, this._instance?.getSelectedCountryData())\n // console.log('fullNumber', (this._instance as any)._getFullNumber())\n // console.log('E164', this._instance?.getNumber(intlTelInputUtils.numberFormat.E164))\n // console.log('INTERNATIONAL', this._instance?.getNumber(intlTelInputUtils.numberFormat.INTERNATIONAL))\n // console.log('NATIONAL', this._instance?.getNumber(intlTelInputUtils.numberFormat.NATIONAL))\n // console.log('RFC3966', this._instance?.getNumber(intlTelInputUtils.numberFormat.RFC3966))\n // console.log('getValidationError', this._instance?.getValidationError())\n if (typeof currentText === 'string') {\n this._instance?.setNumber(currentText)\n }\n }\n // console.log('%cupdateValue END', 'color:cyan')\n }\n\n public getFullNumber(): string | undefined | null {\n if (typeof globalIntlTelInputUtils() !== 'undefined' && this._instance) {\n // return (this._instance as any)._getFullNumber()\n return this._instance.getNumber(intlTelInputUtils.numberFormat.E164)\n }\n return this.value\n }\n\n private _initDropdownListener() {\n const doc = this._document\n if (!doc) {\n return\n }\n\n this._ngZone.runOutsideAngular(() => {\n const openDropdown$ = fromEvent(this._elementRef.nativeElement, 'open:countrydropdown')\n const closeDropdown$ = fromEvent(this._elementRef.nativeElement, 'close:countrydropdown')\n const instance = this._instance as any\n openDropdown$.pipe(\n switchMap(() => {\n const pressDown$ = merge(\n fromEvent(doc, 'touchstart', { capture: true }),\n fromEvent(doc, 'mousedown', { capture: true })\n ).pipe(\n auditTime(0),\n tap((event: any) => {\n if (instance.countryList.contains(event.target) || instance.selectedFlag.contains(event.target)) {\n return\n }\n instance._closeDropdown()\n })\n )\n\n const flagBtnClick$ = fromEvent<MouseEvent>(instance.selectedFlag, 'click').pipe(\n tap((event: MouseEvent) => {\n if (!this.isDropdownVisible()) {\n return\n }\n\n event.preventDefault()\n instance._closeDropdown()\n })\n )\n\n return merge(pressDown$, flagBtnClick$).pipe(takeUntil(closeDropdown$))\n }),\n takeUntil(this._ngUnsubscribe)\n ).subscribe()\n\n const flagsContainer: HTMLElement | null | undefined = (this._instance as any)?.selectedFlag\n if (flagsContainer) {\n fromEvent(flagsContainer, 'keydown', { capture: true }).pipe(\n tap((e: any) => {\n const control = this._ngControl\n if (control) {\n const disabled = control.disabled ?? false\n if (disabled && ['ArrowUp', 'Up', 'ArrowDown', 'Down', ' ', 'Enter'].indexOf(e.key) !== -1) {\n // prevent form from being submitted if \"ENTER\" was pressed\n e.preventDefault()\n // prevent event from being handled again by document\n e.stopPropagation()\n }\n }\n }),\n takeUntil(this._ngUnsubscribe)\n ).subscribe()\n }\n })\n }\n\n public isDropdownVisible() {\n if (!this._instance) {\n return false\n }\n\n const instance = this._instance as any\n return !instance.countryList.classList.contains('iti__hide')\n }\n\n /** Focuses the input. */\n public focus(): void {\n this._elementRef.nativeElement.focus()\n }\n\n /** Unfocuses the input. */\n public blur(): void {\n this._elementRef.nativeElement.blur()\n }\n\n public getHostElement(): HTMLInputElement {\n return this._elementRef.nativeElement\n }\n}\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y'\nimport { BooleanInput, coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion'\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostBinding,\n HostListener,\n InjectFlags,\n Injector,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewChild\n} from '@angular/core'\nimport { ControlValueAccessor, UntypedFormControl, NgControl, NG_VALUE_ACCESSOR } from '@angular/forms'\nimport { defer, fromEvent, merge, Observable, of, Subject } from 'rxjs'\nimport { auditTime, map, switchMap, takeUntil } from 'rxjs/operators'\n\nimport { InputBoolean } from '@theseam/ui-common/core'\nimport { InputDirective } from '@theseam/ui-common/form-field'\n\nimport { TheSeamTelInputDirective } from '../tel-input.directive'\n\n// TODO: Fix focus\n// TODO: Fix disabled\n\n@Component({\n selector: 'seam-tel-input',\n templateUrl: './tel-input.component.html',\n styleUrls: ['./tel-input.component.scss'],\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TheSeamTelInputComponent),\n multi: true\n }],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TheSeamTelInputComponent implements OnInit, OnDestroy, ControlValueAccessor {\n static ngAcceptInputType_required: BooleanInput\n static ngAcceptInputType_disabled: BooleanInput\n\n /** @ignore */\n private readonly _ngUnsubscribe = new Subject<void>()\n\n /** @ignore */\n readonly _control = new UntypedFormControl()\n\n private _focusOrigin: FocusOrigin = null\n\n _hasInvalidCss$: Observable<boolean>\n\n @Input() @InputBoolean() required = false\n\n @Input()\n get disabled(): boolean { return this._disabled }\n set disabled(value: boolean) {\n const newValue = coerceBooleanProperty(value)\n\n if (this._control.disabled !== newValue) {\n if (newValue) {\n this._control.disable()\n } else {\n this._control.enable()\n }\n }\n\n if (newValue !== this.disabled) {\n this._disabled = newValue\n this._changeDetectorRef.markForCheck()\n }\n }\n /** @ignore */\n private _disabled = false\n\n /**\n * Set the tab index to `-1` to allow the root element of the\n * component to receive `focus` event from javascript, but not get focused by\n * keyboard navigation.\n */\n @Input()\n set tabIndex(value: number) { this._tabIndex = coerceNumberProperty(value) }\n get tabIndex(): number { return this._tabIndex }\n private _tabIndex = -1\n\n @HostBinding('attr.disabled')\n get _attrDisabled() { return this.disabled || null }\n\n @HostBinding('attr.tabindex')\n get _attrTabIndex() { return this.disabled ? -1 : (this.tabIndex || 0) }\n\n /** Name value will be applied to the input element if present */\n @Input() name: string | undefined | null = null\n\n /** The value attribute of the native input element */\n @Input() value: string | undefined | null\n\n /** Event emitted when the \"tel\" input value changes. */\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() readonly change = new EventEmitter<string>()\n\n /**\n * The telInput directive\n * @ignore\n */\n @ViewChild(TheSeamTelInputDirective, { static: true }) _telInputDirective?: TheSeamTelInputDirective\n\n /**\n * The telInput directive\n * @ignore\n */\n @ViewChild(InputDirective, { static: true }) _inputDirective?: InputDirective\n\n /**\n * The native `<input type=\"tel\">` element\n * @ignore\n */\n @ViewChild('input', { static: true }) _inputElementRef?: ElementRef<HTMLInputElement>\n\n @HostListener('focus', [ '$event' ])\n _onFocus() {\n this._telInputDirective?.focus()\n }\n\n /**\n * Called when the checkbox is blurred. Needed to properly implement ControlValueAccessor.\n * @ignore\n */\n _onTouched: () => any = () => {}\n\n /** @ignore */\n private _controlValueAccessorChangeFn: (value: any) => void = () => {}\n\n constructor(\n private readonly _changeDetectorRef: ChangeDetectorRef,\n private readonly _injector: Injector,\n private readonly _elementRef: ElementRef,\n private readonly _focusMonitor: FocusMonitor\n ) {\n const telInputBlurEvent$ = this._telInputDirective\n ? fromEvent(this._telInputDirective.getHostElement(), 'blur')\n : of<Event>()\n\n this._hasInvalidCss$ = defer(() => of((this._injector.get(NgControl, null, InjectFlags.Self)?.control) || undefined)).pipe(\n switchMap(control => {\n if (control) {\n return merge(\n control.valueChanges,\n control.statusChanges,\n telInputBlurEvent$\n ).pipe(\n auditTime(0),\n map(() => {\n const inputControl = this._inputDirective?.ngControl\n return control.invalid && (inputControl?.dirty as boolean || inputControl?.touched as boolean)\n })\n )\n }\n return of(false)\n })\n )\n }\n\n /** @ignore */\n ngOnInit(): void {\n this._focusMonitor.monitor(this._elementRef, true).pipe(\n takeUntil(this._ngUnsubscribe)\n ).subscribe(origin => this._focusOrigin = origin)\n\n this._control.valueChanges.pipe(\n takeUntil(this._ngUnsubscribe)\n ).subscribe(v => {\n const value = this._telInputDirective?.getFullNumber()\n this.value = value\n if (this._controlValueAccessorChangeFn) {\n this._controlValueAccessorChangeFn(value)\n }\n })\n }\n\n /** @ignore */\n ngOnDestroy(): void {\n this._focusMonitor.stopMonitoring(this._elementRef)\n\n this._ngUnsubscribe.next(undefined)\n this._ngUnsubscribe.complete()\n }\n\n // Implemented as part of ControlValueAccessor.\n /** @ignore */\n writeValue(value: any) {\n this.value = value\n if (this._telInputDirective) {\n this._telInputDirective.value = value\n this._telInputDirective.updateValue()\n }\n }\n\n // Implemented as part of ControlValueAccessor.\n /** @ignore */\n registerOnChange(fn: (value: any) => void) {\n this._controlValueAccessorChangeFn = fn\n }\n\n // Implemented as part of ControlValueAccessor.\n /** @ignore */\n registerOnTouched(fn: any) {\n this._onTouched = fn\n }\n\n // Implemented as part of ControlValueAccessor.\n /** @ignore */\n setDisabledState(isDisabled: boolean) {\n this.disabled = isDisabled\n }\n\n /** Focuses the input. */\n public focus(): void {\n this._telInputDirective?.focus()\n }\n\n /** Unfocuses the input. */\n public blur(): void {\n this._telInputDirective?.blur()\n }\n\n public hasFocus(): boolean {\n return this._focusOrigin !== null && this._focusOrigin !== undefined\n }\n\n}\n","<input seamTelInput seamInput\n [formControl]=\"_control\"\n [class.is-invalid]=\"_hasInvalidCss$ | async\" />\n","import { UntypedFormControl } from '@angular/forms'\n\nimport {\n getCountryCode,\n getDialCode,\n getIntlTelInputUtils,\n getValidationErrorMessage,\n globalIntlTelInputGlobals,\n processCountryCodes\n} from './utils'\n\nexport function telInputValidator(control: UntypedFormControl) {\n const value = control.value\n\n // This validator doesn't need to do anything if there isn't a value.\n if (typeof value !== 'string' || value.length === 0) {\n return Promise.resolve(null)\n }\n\n return getIntlTelInputUtils().then(utils => {\n const data = processCountryCodes(globalIntlTelInputGlobals().getCountryData())\n const dialCode = getDialCode(data, value)\n const countryCode = getCountryCode(data, dialCode)\n\n let number = value\n if (number.charAt(0) !== '+') {\n if (number.charAt(0) !== '1') { number = `1${number}` }\n number = `+${number}`\n }\n\n if (!utils.isValidNumber(number, countryCode)) {\n const code = utils.getValidationError(number, countryCode)\n const message = getValidationErrorMessage(code)\n return { 'telInput': { code, message } }\n }\n\n return null\n })\n}\n","import { ChangeDetectorRef, Pipe, PipeTransform } from '@angular/core'\n\nimport { intlTelInputUtils } from './intl-tel-input'\nimport { getCountryCode, getDialCode, getIntlTelInputUtils, globalIntlTelInputGlobals, processCountryCodes, TheSeamNumberFormatsInput } from './utils'\nimport { coercePhoneNumberFormat } from './utils'\n\n@Pipe({\n name: 'phoneNumber',\n pure: false\n})\nexport class TheSeamPhoneNumberPipe implements PipeTransform {\n\n private _latestPhoneNumber: string | undefined | null\n private _latestNumberFormat: TheSeamNumberFormatsInput | undefined | null\n private _latestValue: string | undefined | null\n\n constructor(private _cdr: ChangeDetectorRef) { }\n\n transform(\n phoneNumber: string,\n numberFormat: TheSeamNumberFormatsInput = intlTelInputUtils.numberFormat.INTERNATIONAL\n ): any {\n // console.log('transform', phoneNumber, numberFormat)\n if (this._latestPhoneNumber !== phoneNumber || this._latestNumberFormat !== numberFormat) {\n this._transform(phoneNumber, numberFormat)\n }\n this._latestPhoneNumber = phoneNumber\n this._latestNumberFormat = numberFormat\n\n // console.log('return', this._latestValue)\n return this._latestValue\n }\n\n async _transform(phoneNumber: string, numberFormat: TheSeamNumberFormatsInput) {\n // console.log('_transform', phoneNumber, numberFormat)\n const utils = await getIntlTelInputUtils()\n // console.log('utils', utils)\n\n const _format = coercePhoneNumberFormat(numberFormat)\n\n const data = processCountryCodes(globalIntlTelInputGlobals().getCountryData())\n const dialCode = getDialCode(data, phoneNumber)\n const countryCode = getCountryCode(data, dialCode)\n\n const number = phoneNumber\n // if (number.charAt(0) !== '+') {\n // if (number.charAt(0) !== '1') { number = `1${number}` }\n // number = `+${number}`\n // }\n\n const n = utils.formatNumber(number, countryCode, _format)\n // console.log('n', n)\n this._latestValue = n\n // this._cdr.markForCheck()\n this._cdr.detectChanges()\n }\n\n}\n","import { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\nimport { ReactiveFormsModule } from '@angular/forms'\n\nimport { TheSeamFormFieldModule } from '@theseam/ui-common/form-field'\n\nimport { TheSeamPhoneNumberPipe } from './phone-number.pipe'\nimport { TheSeamTelInputDirective } from './tel-input.directive'\nimport { TheSeamTelInputComponent } from './tel-input/tel-input.component'\n\n@NgModule({\n declarations: [\n TheSeamTelInputDirective,\n TheSeamTelInputComponent,\n TheSeamPhoneNumberPipe\n ],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n TheSeamFormFieldModule\n ],\n exports: [\n TheSeamTelInputDirective,\n TheSeamTelInputComponent,\n TheSeamPhoneNumberPipe\n ]\n})\nexport class TheSeamTelInputModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i4.TheSeamTelInputDirective"],"mappings":";;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;AAEG;AACH;AACM,IAAW,kBAsDhB;AAtDD,CAAA,UAAiB,iBAAiB,EAAA;AAUhC,IAAA,IAAY,YAKX,CAAA;AALD,IAAA,CAAA,UAAY,YAAY,EAAA;AACtB,QAAA,YAAA,CAAA,YAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ,CAAA;AACR,QAAA,YAAA,CAAA,YAAA,CAAA,eAAA,CAAA,GAAA,CAAA,CAAA,GAAA,eAAiB,CAAA;AACjB,QAAA,YAAA,CAAA,YAAA,CAAA,UAAA,CAAA,GAAA,CAAA,CAAA,GAAA,UAAY,CAAA;AACZ,QAAA,YAA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nB,sBAAsB;AACvB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,wBAAwB;wBACxB,wBAAwB;wBACxB,sBAAsB;AACvB,qBAAA;AACF,iBAAA,CAAA;;;AC1BD;;AAEG;;;;"}
1
+ {"version":3,"file":"theseam-ui-common-tel-input.mjs","sources":["../../../projects/ui-common/tel-input/intl-tel-input.ts","../../../projects/ui-common/tel-input/tel-input-constants.ts","../../../projects/ui-common/tel-input/utils/add-country-code.ts","../../../projects/ui-common/tel-input/models/tel-input-number-format-name.ts","../../../projects/ui-common/tel-input/utils/coerce-phone-number-format.ts","../../../projects/ui-common/tel-input/utils/get-country-code.ts","../../../projects/ui-common/tel-input/utils/get-dial-code.ts","../../../projects/ui-common/tel-input/utils/get-global-intl-tel-input-globals.ts","../../../projects/ui-common/tel-input/utils/get-global-intl-tel-input-utils.ts","../../../projects/ui-common/tel-input/utils/get-intl-tel-input-utils.ts","../../../projects/ui-common/tel-input/utils/get-validation-error-message.ts","../../../projects/ui-common/tel-input/utils/process-country-codes.ts","../../../projects/ui-common/tel-input/tel-input.directive.ts","../../../projects/ui-common/tel-input/tel-input/tel-input.component.ts","../../../projects/ui-common/tel-input/tel-input/tel-input.component.html","../../../projects/ui-common/tel-input/tel-input-validator.ts","../../../projects/ui-common/tel-input/phone-number.pipe.ts","../../../projects/ui-common/tel-input/tel-input.module.ts","../../../projects/ui-common/tel-input/testing/tel-input.harness.ts","../../../projects/ui-common/tel-input/theseam-ui-common-tel-input.ts"],"sourcesContent":["import intlTelInput from 'intl-tel-input'\n\n//\n// NOTE: These types are mainly for providing types to 'intl-tel-input', because\n// the only published types I could find were incomplete. Some types are\n// missing, because they were not necessary for this library. I don't indend\n// this to be a perfect types for 'intl-tel-input', so as long as they are\n// compatible they may be slightly altered or extended to fit this library\n// better.\n//\n\n/**\n * Partial types for intl-tel-input-utils\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace intlTelInputUtils {\n\n export interface CountryData {\n name: string\n iso2: string\n dialCode: string\n areaCodes: string[] | null\n priority: number\n }\n\n export enum numberFormat {\n E164 = 0,\n INTERNATIONAL = 1,\n NATIONAL = 2,\n RFC3966 = 3\n }\n\n export enum numberType {\n FIXED_LINE = 0,\n MOBILE = 1,\n FIXED_LINE_OR_MOBILE = 2,\n TOLL_FREE = 3,\n PREMIUM_RATE = 4,\n SHARED_COST = 5,\n VOIP = 6,\n PERSONAL_NUMBER = 7,\n PAGER = 8,\n UAN = 9,\n VOICEMAIL = 10,\n UNKNOWN = -1\n }\n\n export enum validationError {\n IS_POSSIBLE = 0,\n INVALID_COUNTRY_CODE = 1,\n TOO_SHORT = 2,\n TOO_LONG = 3,\n NOT_A_NUMBER = 4\n }\n\n export type placeholderNumberType =\n | 'FIXED_LINE_OR_MOBILE'\n | 'FIXED_LINE'\n | 'MOBILE'\n | 'PAGER'\n | 'PERSONAL_NUMBER'\n | 'PREMIUM_RATE'\n | 'SHARED_COST'\n | 'TOLL_FREE'\n | 'UAN'\n | 'UNKNOWN'\n | 'VOICEMAIL'\n | 'VOIP'\n\n}\n\n// NOTE: If one of the functions return -99, then it is most likely from a\n// problem in 'google-libphonenumber' that 'intl-tel-input' swallowed in int\n// wrapper.\n//\n// NOTE: The following functions do not exist until util script has loaded.\nexport interface IntlTelInputUtilsScript {\n numberFormat: intlTelInputUtils.numberFormat\n numberType: intlTelInputUtils.numberType\n validationError: intlTelInputUtils.validationError\n\n /**\n * Format the given number to the given format.\n */\n formatNumber(number: string, countryCode: string, format: intlTelInputUtils.numberFormat): string\n\n /**\n * Get an example number for the given country code.\n */\n getExampleNumber(countryCode: string, national: boolean, numberType: intlTelInputUtils.numberType): string\n\n /**\n * Get the extension from the given number.\n */\n getExtension(number: string, countryCode: string): string\n\n /**\n * Get the type of the given number e.g. fixed-line/mobile.\n */\n getNumberType(number: string, countryCode: string): intlTelInputUtils.numberType\n\n /**\n * Get more info if the validation has failed e.g. too long/too short.\n */\n getValidationError(number: string, countryCode: string): intlTelInputUtils.validationError\n\n /**\n * Check if given number is valid.\n */\n isValidNumber(number: string, countryCode: string): boolean\n}\n\n/**\n * Partial types for intl-tel-input\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace IntlTelInput {\n export interface Static {\n /**\n * Default options for all instances\n */\n defaults: Options\n\n /**\n * Get all of the plugin's country data - either to re-use elsewhere\n * e.g. to populate a country dropdown.\n */\n getCountryData(): intlTelInputUtils.CountryData[]\n\n /**\n * Load the utils.js script (included in the lib directory) to enable\n * formatting/validation etc.\n */\n loadUtils(path: string, utilsScriptDeferred?: boolean): Promise<void> /* | null | void */\n }\n\n export interface Plugin {\n promise: Promise<void>\n\n /**\n * Remove the plugin from the input, and unbind any event listeners.\n */\n destroy(): void\n\n /**\n * Get the extension from the current number.\n * Requires the utilsScript option.\n * e.g. if the input value was \"(702) 555-5555 ext. 1234\", this would\n * return \"1234\".\n */\n getExtension(): string\n\n /**\n * Get the current number in the given format (defaults to E.164 standard).\n * The different formats are available in the enum\n * intlTelInputUtils.numberFormat - taken from here.\n * Requires the utilsScript option.\n * Note that even if nationalMode is enabled, this can still return a full\n * international number.\n * @param numberFormat the format in which the number will be returned.\n */\n getNumber(numberFormat?: intlTelInputUtils.numberFormat): string\n\n /**\n * Get the type (fixed-line/mobile/toll-free etc) of the current number.\n * Requires the utilsScript option.\n * Returns an integer, which you can match against the various options in the\n * global enum intlTelInputUtils.numberType.\n * Note that in the US there's no way to differentiate between fixed-line and\n * mobile numbers, so instead it will return FIXED_LINE_OR_MOBILE.\n */\n getNumberType(): intlTelInputUtils.numberType\n\n /**\n * Get the country data for the currently selected flag.\n */\n getSelectedCountryData(): intlTelInputUtils.CountryData\n\n /**\n * Get more information about a validation error.\n * Requires the utilsScript option.\n * Returns an integer, which you can match against the various options in the\n * global enum ValidationError\n */\n getValidationError(): intlTelInputUtils.validationError\n\n /**\n * Validate the current number. Expects an internationally formatted number\n * (unless nationalMode is enabled). If validation fails, you can use\n * getValidationError to get more information.\n * Requires the utilsScript option.\n * Also see getNumberType if you want to make sure the user enters a certain\n * type of number e.g. a mobile number.\n */\n isValidNumber(): boolean\n\n /**\n * Change the country selection (e.g. when the user is entering their address).\n * @param countryCode country code of the country to be set.\n */\n setCountry(countryCode: string): void\n\n /**\n * Insert a number, and update the selected flag accordingly.\n * Note that by default, if nationalMode is enabled it will try to use\n * national formatting.\n * @param aNumber number to be set.\n */\n setNumber(aNumber: string): void\n\n /**\n * Set the type of the placeholder number\n * @param type Placeholder number type to be set\n */\n setPlaceholderNumberType(type: intlTelInputUtils.placeholderNumberType): void\n }\n\n export interface Options {\n /**\n * Whether or not to allow the dropdown. If disabled, there is no dropdown\n * arrow, and the selected flag is not clickable. Also we display the\n * selected flag on the right instead because it is just a marker of state.\n * Default = true\n */\n allowDropdown?: boolean\n\n /**\n * If there is just a dial code in the input: remove it on blur or submit,\n * and re-add it on focus. This is to prevent just a dial code getting\n * submitted with the form. Requires nationalMode to be set to false.\n * Default = true\n */\n autoHideDialCode?: boolean\n\n /**\n * Set the input's placeholder to an example number for the selected country, and update it if the country changes.\n * You can specify the number type using the placeholderNumberType option.\n * By default it is set to \"polite\", which means it will only set the placeholder if the input doesn't already have one.\n * You can also set it to \"aggressive\", which will replace any existing placeholder, or \"off\".\n * Requires the utilsScript option.\n * Default = \"polite\"\n */\n autoPlaceholder?: 'off' | 'polite' | 'aggressive'\n\n /**\n * Change the placeholder generated by autoPlaceholder. Must return a string.\n * Default = null\n */\n customPlaceholder?: (selectedCountryPlaceholder: string, selectedCountryData: intlTelInputUtils.CountryData) => string\n\n /**\n * Expects a node e.g. document.body. Instead of putting the country dropdown next to the input,\n * append it to the specified node, and it will then be positioned absolutely next to the input using JavaScript.\n * This is useful when the input is inside a container with overflow: hidden.\n * Note that the absolute positioning can be broken by scrolling, so it will automatically close on the window scroll event.\n * Default = null\n */\n dropdownContainer?: Node\n\n /**\n * In the dropdown, display all countries except the ones you specify here.\n * Default = null\n */\n excludeCountries?: string[]\n\n /**\n * Format the input value (according to the nationalMode option) during initialisation, and on setNumber.\n * Requires the utilsScript option.\n * Default = true\n */\n formatOnDisplay?: boolean\n\n /**\n * When setting initialCountry to \"auto\", you must use this option to\n * specify a custom function that looks up the user's location,\n * and then calls the success callback with the relevant country code.\n * Also note that when instantiating the plugin, if the Promise object is defined,\n * one of those is returned under the promise instance property, so you can\n * do something like iti.promise.then(callback) to know when initialisation requests like this have completed.\n * Default = null\n */\n geoIpLookup?: (callback: (countryCode: string) => void) => void\n\n /**\n * Add a hidden input with the given name (or if your input name\n * contains square brackets then it will give the hidden input the same\n * name, replacing the contents of the brackets with the given name). On\n * submit, populate it with the full international number (using\n * getNumber). This is a quick way for people using non-ajax forms to\n * get the full international number, even when nationalMode is enabled.\n * Note: requires the input to be inside a form element, as this feature\n * works by listening for the submit event on the closest form element.\n * Also note that since this uses getNumber internally, it expects a\n * valid number, and so should only be used after validation. Default =\n * \"\"\n */\n hiddenInput?: string\n\n /**\n * Set the initial country selection by specifying it's country code.\n * You can also set it to \"auto\", which will lookup the user's country based\n * on their IP address (requires the geoIpLookup option).\n * Note that the \"auto\" option will not update the country selection if the\n * input already contains a number. If you leave initialCountry blank,\n * it will default to the first country in the list.\n */\n initialCountry?: string\n\n /**\n * Allows to translate the countries by its given iso code e.g.: { 'de': 'Deutschland' }\n * Default = {}\n */\n localizedCountries?: object\n\n /**\n * Allow users to enter national numbers (and not have to think about\n * international dial codes). Formatting, validation and placeholders still\n * work. Then you can use getNumber to extract a full international number.\n * This option now defaults to true, and it is recommended that you leave it\n * that way as it provides a better experience for the user.\n * Default = true\n */\n nationalMode?: boolean\n\n /**\n * In the dropdown, display only the countries you specify.\n * Default = undefined\n */\n onlyCountries?: string[]\n\n /**\n * Specify one of the keys from the global enum intlTelInputUtils.numberType\n * e.g. \"FIXED_LINE\" to set the number type to use for the placeholder.\n * Default = MOBILE\n */\n placeholderNumberType?: intlTelInputUtils.placeholderNumberType\n\n /**\n * Specify the countries to appear at the top of the list.\n * Default = [\"us\", \"gb\"]\n */\n preferredCountries?: string[]\n\n /**\n * Display the country dial code next to the selected flag so it's not part\n * of the typed number. Note that this will disable nationalMode because\n * technically we are dealing with international numbers, but with the\n * dial code separated.\n * Default = false\n */\n separateDialCode?: boolean\n\n /**\n * Enable formatting/validation etc. by specifying the URL of the\n * included utils.js script (or alternatively just point it to the file\n * on cdnjs.com). The script is fetched when the page has finished\n * loading (on the window load event) to prevent blocking (the script is\n * ~215KB). When instantiating the plugin, if the Promise object is\n * defined, one of those is returned under the promise instance\n * property, so you can do something like iti.promise.then(callback) to\n * know when initialisation requests like this have finished. Note that\n * if you're lazy loading the plugin script itself (intlTelInput.js)\n * this will not work and you will need to use the loadUtils method\n * instead. Example: \"build/js/utils.js\" Default = \"\"\n */\n utilsScript?: string\n }\n}\n\n/**\n * Initialise the plugin with optional options.\n * @param options options that can be provided during initialization.\n */\nexport function IntlTelInputFn(node: Element, options?: IntlTelInput.Options): IntlTelInput.Plugin {\n return (intlTelInput as any)(node, options)\n}\n\nexport default IntlTelInputFn\n","export const TEL_INPUT_ASSETS_PATH = 'assets/vendor/intl-tel-input'\n\nexport const TEL_INPUT_STYLES = `\n .iti { width: 100%; }\n\n .iti__flag {background-image: url(\"${TEL_INPUT_ASSETS_PATH}/img/flags.png\");}\n\n @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {\n .iti__flag {background-image: url(\"${TEL_INPUT_ASSETS_PATH}/img/flags@2x.png\");}\n }\n\n .iti__country-list {\n /* There is a bug that is causing the 'z-index: 2' from ng-select to conflict with this dropdown container. */\n z-index: 3;\n }\n`\n\nexport const TEL_INPUT_STYLESHEET_PATH = `${TEL_INPUT_ASSETS_PATH}/css/intlTelInput.min.css`\n\nexport const TEL_INPUT_UTILS_PATH = `${TEL_INPUT_ASSETS_PATH}/js/utils.js`\n","import type { TelInputCountryData } from '../models/index'\n\n/**\n * Add a country code to this.countryCodes.\n *\n * Based on: https://github.com/jackocnr/intl-tel-input/blob/4fe25fcf142c341a85b7b15cc307d66afb8573a3/src/js/intlTelInput.js#L197\n */\nexport function addCountryCode(data: TelInputCountryData, iso2: string, countryCode: string, priority?: number) {\n if (countryCode.length > data.countryCodeMaxLen) {\n data.countryCodeMaxLen = countryCode.length\n }\n if (!Object.prototype.hasOwnProperty.call(data.countryCodes, countryCode)) {\n data.countryCodes[countryCode] = []\n }\n // bail if we already have this country for this countryCode\n for (const code of data.countryCodes[countryCode]) {\n if (code === iso2) { return }\n }\n // check for undefined as 0 is falsy\n const index = (priority !== undefined) ? priority : data.countryCodes[countryCode].length\n data.countryCodes[countryCode][index] = iso2\n}\n","import { intlTelInputUtils } from '../intl-tel-input'\n\nexport const TelInputNumberFormatName: { [name: string]: intlTelInputUtils.numberFormat } = {\n 'E164': intlTelInputUtils.numberFormat.E164,\n 'INTERNATIONAL': intlTelInputUtils.numberFormat.INTERNATIONAL,\n 'NATIONAL': intlTelInputUtils.numberFormat.NATIONAL,\n 'RFC3966': intlTelInputUtils.numberFormat.RFC3966\n}\n","import { intlTelInputUtils } from '../intl-tel-input'\nimport { TelInputNumberFormatName } from '../models/index'\n\nexport const THESEAM_DEFAULT_PHONE_NUMBER_FORMAT = intlTelInputUtils.numberFormat.INTERNATIONAL\n\n/**\n * Types that should be acceptable in a template.\n */\nexport type TheSeamNumberFormatsInput =\n // Enum\n intlTelInputUtils.numberFormat\n // Strings matching enum\n | 'E164'\n | 'INTERNATIONAL'\n | 'NATIONAL'\n | 'RFC3966'\n // Strings matching enum in lower case, since it would be what a user will\n // most likely type if string is necessary.\n | 'e164'\n | 'international'\n | 'national'\n | 'rfc3966'\n\nexport function coercePhoneNumberFormat(\n format: TheSeamNumberFormatsInput,\n defaultFormat = THESEAM_DEFAULT_PHONE_NUMBER_FORMAT\n): intlTelInputUtils.numberFormat {\n let res = defaultFormat\n\n if (typeof format === 'string') {\n const _format = TelInputNumberFormatName[`${format}`.trim().toUpperCase()]\n res = (_format === undefined || _format === null) ? defaultFormat : _format\n } else if (typeof format === 'number') {\n // We could check for a number range, but I think it is safer to assume it's\n // valid if a number was provided. A number most likely means the value came\n // from using the enum and I don't want to accidentaly exclude a format that\n // we don't have documented.\n //\n // NOTE: We may want to limit it to specific numbers though and assume that\n // potentialy excluded formats are not intended to be used by this library.\n res = format\n }\n\n return res\n}\n","import type { TelInputCountryData } from '../models/index'\n\nfunction getNumeric(s: string): string {\n return s.replace(/\\D/g, '')\n}\n\nexport function getCountryCode(data: TelInputCountryData, dialCode: string) {\n const _countryCodes = data.countryCodes[getNumeric(dialCode)]\n // Refer to `_setInitialState` to get libraries default logic\n return (_countryCodes === undefined || _countryCodes === null || _countryCodes.length === 0) ? 'us' : _countryCodes[0]\n}\n","import type { TelInputCountryData } from '../models/index'\n\n/**\n * Try and extract a valid international dial code from a full telephone number.\n *\n * NOTE: returns the raw string inc plus character and any whitespace/dots etc.\n *\n * Based on: https://github.com/jackocnr/intl-tel-input/blob/4fe25fcf142c341a85b7b15cc307d66afb8573a3/src/js/intlTelInput.js#L1161\n */\nexport function getDialCode(data: TelInputCountryData, number: string, includeAreaCode: boolean = false): string {\n // console.log('getDialCode', number, includeAreaCode)\n // const data = processCountryCodes(globalIntlTelInputGlobals().getCountryData() as TelInputCountryData[])\n\n let dialCode = ''\n // only interested in international numbers (starting with a plus)\n if (number.charAt(0) === '+') {\n let numericChars = ''\n // iterate over chars\n for (let i = 0; i < number.length; i++) {\n const c = number.charAt(i)\n // if char is number (https://stackoverflow.com/a/8935649/217866)\n if (!isNaN(parseInt(c, 10))) {\n numericChars += c\n // if current numericChars make a valid dial code\n if (includeAreaCode) {\n if (data.countryCodes[numericChars]) {\n // store the actual raw string (useful for matching later)\n dialCode = number.substr(0, i + 1)\n }\n } else {\n if (data.dialCodes[numericChars]) {\n dialCode = number.substr(0, i + 1)\n // if we're just looking for a dial code, we can break as soon as we find one\n break\n }\n }\n // stop searching as soon as we can - in this case when we hit max len\n if (numericChars.length === data.countryCodeMaxLen) {\n break\n }\n }\n }\n }\n\n // console.log('getDialCode return', dialCode)\n return dialCode\n}\n","import type { IntlTelInput } from '../intl-tel-input'\n\nexport function globalIntlTelInputGlobals(): IntlTelInput.Static {\n return (window as any).intlTelInputGlobals\n}\n","import type { IntlTelInputUtilsScript } from '../intl-tel-input'\n\nexport function globalIntlTelInputUtils(): IntlTelInputUtilsScript {\n return (window as any).intlTelInputUtils\n}\n","import { notNullOrUndefined, waitOnConditionAsync } from '@theseam/ui-common/utils'\n\nimport type { IntlTelInputUtilsScript } from '../intl-tel-input'\nimport { TEL_INPUT_UTILS_PATH } from '../tel-input-constants'\nimport { globalIntlTelInputGlobals } from './get-global-intl-tel-input-globals'\nimport { globalIntlTelInputUtils } from './get-global-intl-tel-input-utils'\n\nexport function getIntlTelInputUtils(): Promise<IntlTelInputUtilsScript> {\n if (globalIntlTelInputUtils()) {\n return Promise.resolve(globalIntlTelInputUtils())\n }\n\n if ((globalIntlTelInputGlobals() as any).startedLoadingUtilsScript) {\n return waitOnConditionAsync(() => notNullOrUndefined(globalIntlTelInputUtils()), 5000)\n .then(() => globalIntlTelInputUtils())\n }\n\n return globalIntlTelInputGlobals().loadUtils(TEL_INPUT_UTILS_PATH)\n .then(() => waitOnConditionAsync(() => notNullOrUndefined(globalIntlTelInputUtils()), 5000))\n .then(() => globalIntlTelInputUtils())\n}\n","import { intlTelInputUtils } from '../intl-tel-input'\n\nexport const VALIDATOR_CODE_MESSAGES: { [key: number]: string } = {\n [intlTelInputUtils.validationError.INVALID_COUNTRY_CODE]: 'Country code is invalid.',\n [intlTelInputUtils.validationError.TOO_SHORT]: 'Number is too short.',\n [intlTelInputUtils.validationError.TOO_LONG]: 'Number is too long.',\n [intlTelInputUtils.validationError.NOT_A_NUMBER]: 'Must be numbers only.'\n}\n\nexport function getValidationErrorMessage(code: intlTelInputUtils.validationError): string {\n const message = VALIDATOR_CODE_MESSAGES[code]\n return message ?? 'Invalid number.'\n}\n","import type { intlTelInputUtils } from '../intl-tel-input'\nimport type { TelInputCountryData } from '../models/index'\nimport { addCountryCode } from './add-country-code'\n\n/**\n * Process the countryCodes map.\n *\n * Based on: https://github.com/jackocnr/intl-tel-input/blob/4fe25fcf142c341a85b7b15cc307d66afb8573a3/src/js/intlTelInput.js#L252\n */\nexport function processCountryCodes(countries: intlTelInputUtils.CountryData[]): TelInputCountryData {\n const data: TelInputCountryData = {\n countryCodeMaxLen: 0,\n // here we store just dial codes\n dialCodes: {},\n // here we store \"country codes\" (both dial codes and their area codes)\n countryCodes: {}\n }\n\n // first: add dial codes\n for (const c of countries) {\n if (!data.dialCodes[c.dialCode]) { data.dialCodes[c.dialCode] = true }\n addCountryCode(data, c.iso2, c.dialCode, c.priority)\n }\n\n // next: add area codes\n // this is a second loop over countries, to make sure we have all of the \"root\" countries\n // already in the map, so that we can access them, as each time we add an area code substring\n // to the map, we also need to include the \"root\" country's code, as that also matches\n for (const c of countries) {\n // area codes\n if (c.areaCodes) {\n const rootCountryCode = data.countryCodes[c.dialCode][0]\n // for each area code\n for (const areaCode of c.areaCodes) {\n // for each digit in the area code to add all partial matches as well\n for (let k = 1; k < areaCode.length; k++) {\n const partialDialCode = c.dialCode + areaCode.substr(0, k)\n // start with the root country, as that also matches this dial code\n addCountryCode(data, rootCountryCode, partialDialCode)\n addCountryCode(data, c.iso2, partialDialCode)\n }\n // add the full area code\n addCountryCode(data, c.iso2, c.dialCode + areaCode)\n }\n }\n }\n\n return data\n}\n","import { DOCUMENT } from '@angular/common'\nimport { Directive, DoCheck, ElementRef, HostBinding, Inject, Input, NgZone, OnDestroy, OnInit, Optional, Self } from '@angular/core'\nimport { fromEvent, merge, Subject } from 'rxjs'\nimport { auditTime, last, switchMap, takeUntil, tap } from 'rxjs/operators'\n\nimport { AssetLoaderService, LoadedAssetRef } from '@theseam/ui-common/services'\nimport { getAttribute, hasAttribute, notNullOrUndefined, toggleAttribute } from '@theseam/ui-common/utils'\n\nimport { NgControl } from '@angular/forms'\nimport { IntlTelInputFn, intlTelInputUtils } from './intl-tel-input'\nimport type { IntlTelInput } from './intl-tel-input'\nimport { TEL_INPUT_STYLES, TEL_INPUT_STYLESHEET_PATH, TEL_INPUT_UTILS_PATH } from './tel-input-constants'\nimport { globalIntlTelInputUtils } from './utils/index'\n\n@Directive({\n selector: 'input[seamTelInput]',\n exportAs: 'seamTelInput',\n standalone: true,\n})\nexport class TheSeamTelInputDirective implements OnInit, OnDestroy, DoCheck {\n private readonly _ngUnsubscribe = new Subject<void>()\n\n private _instance: IntlTelInput.Plugin | undefined\n private _loadedAssetRefs: LoadedAssetRef<HTMLLinkElement | HTMLStyleElement>[] = []\n\n @HostBinding('attr.type') _attrType = 'tel'\n\n @Input()\n set value(v: string | undefined | null) {\n this._value = v\n if (this._instance) {\n this._instance.setNumber(notNullOrUndefined(v) ? v : '')\n this.updateValue()\n }\n }\n get value(): string | undefined | null {\n if (this._instance) {\n return this._instance?.getNumber()\n }\n return this._value\n }\n private _value: string | undefined | null\n\n constructor(\n private readonly _elementRef: ElementRef<HTMLInputElement>,\n private readonly _assetLoader: AssetLoaderService,\n private readonly _ngZone: NgZone,\n @Optional() @Inject(DOCUMENT) private readonly _document?: any,\n @Optional() @Self() private readonly _ngControl?: NgControl,\n ) { }\n\n ngOnInit(): void {\n this._elementRef.nativeElement.value = this._ngControl ? this._ngControl.value : this.value ?? ''\n this._elementRef.nativeElement.setAttribute('instance-loading', '')\n merge(\n this._assetLoader.loadStyleSheet(TEL_INPUT_STYLESHEET_PATH),\n this._assetLoader.loadStyle(TEL_INPUT_STYLES)\n ).pipe(\n tap(v => this._loadedAssetRefs.push(v)),\n last(),\n switchMap(() => {\n this._instance = IntlTelInputFn(this._elementRef.nativeElement, {\n utilsScript: TEL_INPUT_UTILS_PATH,\n preferredCountries: [ 'US' ],\n nationalMode: false,\n formatOnDisplay: true,\n autoPlaceholder: 'off',\n separateDialCode: false,\n autoHideDialCode: false,\n // TODO: Add initialCountry support.\n // initialCountry: 'auto'\n })\n\n this._tryUpdateDropdownAttributes()\n\n return this._instance.promise.then(v => {\n this._elementRef.nativeElement.removeAttribute('instance-loading')\n return v\n })\n }),\n tap(() => this._initDropdownListener()),\n tap(() => this.value = this._value),\n tap(this._formatIntlTelInput),\n switchMap(() => merge(\n fromEvent(this._elementRef.nativeElement, 'keyup'),\n fromEvent(this._elementRef.nativeElement, 'change')\n )),\n tap(this._formatIntlTelInput),\n takeUntil(this._ngUnsubscribe)\n ).subscribe()\n }\n\n ngOnDestroy(): void {\n this._instance?.destroy()\n for (const ref of this._loadedAssetRefs) {\n ref.destroy()\n }\n\n this._ngUnsubscribe.next(undefined)\n this._ngUnsubscribe.complete()\n }\n\n ngDoCheck() {\n this._tryUpdateDropdownAttributes()\n }\n\n private _tryUpdateDropdownAttributes() {\n const control = this._ngControl\n if (control) {\n const flagsContainer: HTMLElement | null | undefined = (this._instance as any)?.selectedFlag\n if (flagsContainer) {\n toggleAttribute(flagsContainer, 'aria-disabled', control.disabled ?? false)\n\n const disabled = control.disabled ?? false\n if (!disabled) {\n if (getAttribute(flagsContainer, 'tabindex') !== '0') {\n flagsContainer.setAttribute('tabindex', '0')\n }\n } else {\n if (hasAttribute(flagsContainer, 'tabindex')) {\n flagsContainer.removeAttribute('tabindex')\n }\n }\n }\n }\n }\n\n private _formatIntlTelInput = () => {\n // if (typeof intlTelInputUtils !== 'undefined') {\n // const currentText = this._instance?.getNumber(intlTelInputUtils.numberFormat.INTERNATIONAL)\n // console.log('currentText', currentText, this._instance?.getSelectedCountryData())\n // console.log(this._instance?.getValidationError())\n // if (typeof currentText === 'string') {\n // this._instance?.setNumber(currentText)\n // }\n // }\n\n this.updateValue()\n }\n\n public updateValue(): void {\n // console.log('%cupdateValue START', 'color:cyan', typeof intlTelInputUtils !== 'undefined')\n if (typeof globalIntlTelInputUtils() !== 'undefined') {\n const currentText = this._instance?.getNumber(intlTelInputUtils.numberFormat.E164)\n // console.log('currentText', currentText, this._instance?.getSelectedCountryData())\n // console.log('fullNumber', (this._instance as any)._getFullNumber())\n // console.log('E164', this._instance?.getNumber(intlTelInputUtils.numberFormat.E164))\n // console.log('INTERNATIONAL', this._instance?.getNumber(intlTelInputUtils.numberFormat.INTERNATIONAL))\n // console.log('NATIONAL', this._instance?.getNumber(intlTelInputUtils.numberFormat.NATIONAL))\n // console.log('RFC3966', this._instance?.getNumber(intlTelInputUtils.numberFormat.RFC3966))\n // console.log('getValidationError', this._instance?.getValidationError())\n if (typeof currentText === 'string') {\n this._instance?.setNumber(currentText)\n }\n }\n // console.log('%cupdateValue END', 'color:cyan')\n }\n\n public getFullNumber(): string | undefined | null {\n if (typeof globalIntlTelInputUtils() !== 'undefined' && this._instance) {\n // return (this._instance as any)._getFullNumber()\n return this._instance.getNumber(intlTelInputUtils.numberFormat.E164)\n }\n return this.value\n }\n\n private _initDropdownListener() {\n const doc = this._document\n if (!doc) {\n return\n }\n\n this._ngZone.runOutsideAngular(() => {\n const openDropdown$ = fromEvent(this._elementRef.nativeElement, 'open:countrydropdown')\n const closeDropdown$ = fromEvent(this._elementRef.nativeElement, 'close:countrydropdown')\n const instance = this._instance as any\n openDropdown$.pipe(\n switchMap(() => {\n const pressDown$ = merge(\n fromEvent(doc, 'touchstart', { capture: true }),\n fromEvent(doc, 'mousedown', { capture: true })\n ).pipe(\n auditTime(0),\n tap((event: any) => {\n if (instance.countryList.contains(event.target) || instance.selectedFlag.contains(event.target)) {\n return\n }\n instance._closeDropdown()\n })\n )\n\n const flagBtnClick$ = fromEvent<MouseEvent>(instance.selectedFlag, 'click').pipe(\n tap((event: MouseEvent) => {\n if (!this.isDropdownVisible()) {\n return\n }\n\n event.preventDefault()\n instance._closeDropdown()\n })\n )\n\n return merge(pressDown$, flagBtnClick$).pipe(takeUntil(closeDropdown$))\n }),\n takeUntil(this._ngUnsubscribe)\n ).subscribe()\n\n const flagsContainer: HTMLElement | null | undefined = (this._instance as any)?.selectedFlag\n if (flagsContainer) {\n fromEvent(flagsContainer, 'keydown', { capture: true }).pipe(\n tap((e: any) => {\n const control = this._ngControl\n if (control) {\n const disabled = control.disabled ?? false\n if (disabled && ['ArrowUp', 'Up', 'ArrowDown', 'Down', ' ', 'Enter'].indexOf(e.key) !== -1) {\n // prevent form from being submitted if \"ENTER\" was pressed\n e.preventDefault()\n // prevent event from being handled again by document\n e.stopPropagation()\n }\n }\n }),\n takeUntil(this._ngUnsubscribe)\n ).subscribe()\n }\n })\n }\n\n public isDropdownVisible() {\n if (!this._instance) {\n return false\n }\n\n const instance = this._instance as any\n return !instance.countryList.classList.contains('iti__hide')\n }\n\n /** Focuses the input. */\n public focus(): void {\n this._elementRef.nativeElement.focus()\n }\n\n /** Unfocuses the input. */\n public blur(): void {\n this._elementRef.nativeElement.blur()\n }\n\n public getHostElement(): HTMLInputElement {\n return this._elementRef.nativeElement\n }\n}\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y'\nimport { BooleanInput, coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion'\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostBinding,\n HostListener,\n InjectFlags,\n Injector,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewChild\n} from '@angular/core'\nimport { ControlValueAccessor, UntypedFormControl, NgControl, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'\nimport { defer, fromEvent, merge, Observable, of, Subject } from 'rxjs'\nimport { auditTime, map, switchMap, takeUntil } from 'rxjs/operators'\n\nimport { InputBoolean } from '@theseam/ui-common/core'\nimport { InputDirective, TheSeamFormFieldModule } from '@theseam/ui-common/form-field'\n\nimport { TheSeamTelInputDirective } from '../tel-input.directive'\nimport { CommonModule } from '@angular/common'\n\n// TODO: Fix focus\n// TODO: Fix disabled\n\n@Component({\n selector: 'seam-tel-input',\n templateUrl: './tel-input.component.html',\n styleUrls: ['./tel-input.component.scss'],\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TheSeamTelInputComponent),\n multi: true\n }],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [\n CommonModule,\n ReactiveFormsModule,\n TheSeamFormFieldModule,\n TheSeamTelInputDirective,\n ],\n})\nexport class TheSeamTelInputComponent implements OnInit, OnDestroy, ControlValueAccessor {\n static ngAcceptInputType_required: BooleanInput\n static ngAcceptInputType_disabled: BooleanInput\n\n /** @ignore */\n private readonly _ngUnsubscribe = new Subject<void>()\n\n /** @ignore */\n readonly _control = new UntypedFormControl()\n\n private _focusOrigin: FocusOrigin = null\n\n _hasInvalidCss$: Observable<boolean>\n\n @Input() @InputBoolean() required = false\n\n @Input()\n get disabled(): boolean { return this._disabled }\n set disabled(value: boolean) {\n const newValue = coerceBooleanProperty(value)\n\n if (this._control.disabled !== newValue) {\n if (newValue) {\n this._control.disable()\n } else {\n this._control.enable()\n }\n }\n\n if (newValue !== this.disabled) {\n this._disabled = newValue\n this._changeDetectorRef.markForCheck()\n }\n }\n /** @ignore */\n private _disabled = false\n\n /**\n * Set the tab index to `-1` to allow the root element of the\n * component to receive `focus` event from javascript, but not get focused by\n * keyboard navigation.\n */\n @Input()\n set tabIndex(value: number) { this._tabIndex = coerceNumberProperty(value) }\n get tabIndex(): number { return this._tabIndex }\n private _tabIndex = -1\n\n @HostBinding('attr.disabled')\n get _attrDisabled() { return this.disabled || null }\n\n @HostBinding('attr.tabindex')\n get _attrTabIndex() { return this.disabled ? -1 : (this.tabIndex || 0) }\n\n /** Name value will be applied to the input element if present */\n @Input() name: string | undefined | null = null\n\n /** The value attribute of the native input element */\n @Input() value: string | undefined | null\n\n /** Event emitted when the \"tel\" input value changes. */\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() readonly change = new EventEmitter<string | undefined | null>()\n\n /**\n * The telInput directive\n * @ignore\n */\n @ViewChild(TheSeamTelInputDirective, { static: true }) _telInputDirective?: TheSeamTelInputDirective\n\n /**\n * The telInput directive\n * @ignore\n */\n @ViewChild(InputDirective, { static: true }) _inputDirective?: InputDirective\n\n /**\n * The native `<input type=\"tel\">` element\n * @ignore\n */\n @ViewChild('input', { static: true }) _inputElementRef?: ElementRef<HTMLInputElement>\n\n @HostListener('focus', [ '$event' ])\n _onFocus() {\n this._telInputDirective?.focus()\n }\n\n /**\n * Called when the checkbox is blurred. Needed to properly implement ControlValueAccessor.\n * @ignore\n */\n _onTouched: () => any = () => {}\n\n /** @ignore */\n private _controlValueAccessorChangeFn: (value: any) => void = () => {}\n\n constructor(\n private readonly _changeDetectorRef: ChangeDetectorRef,\n private readonly _injector: Injector,\n private readonly _elementRef: ElementRef,\n private readonly _focusMonitor: FocusMonitor\n ) {\n const telInputBlurEvent$ = this._telInputDirective\n ? fromEvent(this._telInputDirective.getHostElement(), 'blur')\n : of<Event>()\n\n this._hasInvalidCss$ = defer(() => of((this._injector.get(NgControl, null, InjectFlags.Self)?.control) || undefined)).pipe(\n switchMap(control => {\n if (control) {\n return merge(\n control.valueChanges,\n control.statusChanges,\n telInputBlurEvent$\n ).pipe(\n auditTime(0),\n map(() => {\n const inputControl = this._inputDirective?.ngControl\n return control.invalid && (inputControl?.dirty as boolean || inputControl?.touched as boolean)\n })\n )\n }\n return of(false)\n })\n )\n }\n\n /** @ignore */\n ngOnInit(): void {\n this._focusMonitor.monitor(this._elementRef, true).pipe(\n takeUntil(this._ngUnsubscribe)\n ).subscribe(origin => this._focusOrigin = origin)\n\n this._control.valueChanges.pipe(\n takeUntil(this._ngUnsubscribe)\n ).subscribe(v => {\n const value = this._telInputDirective?.getFullNumber()\n // console.log('valueChanges', v, value)\n this.value = value\n if (this._controlValueAccessorChangeFn) {\n this._controlValueAccessorChangeFn(value)\n this.change.emit(value)\n }\n })\n this._control.setValue(this.value ?? '')\n }\n\n /** @ignore */\n ngOnDestroy(): void {\n this._focusMonitor.stopMonitoring(this._elementRef)\n\n this._ngUnsubscribe.next(undefined)\n this._ngUnsubscribe.complete()\n }\n\n // Implemented as part of ControlValueAccessor.\n /** @ignore */\n writeValue(value: any) {\n // console.log('writeValue', value, this._telInputDirective?.getFullNumber(), this._control.value)\n this.value = value\n if (this._control.value !== value) {\n this._control.setValue(value)\n }\n if (this._telInputDirective) {\n this._telInputDirective.value = value\n this._telInputDirective.updateValue()\n }\n }\n\n // Implemented as part of ControlValueAccessor.\n /** @ignore */\n registerOnChange(fn: (value: any) => void) {\n this._controlValueAccessorChangeFn = fn\n }\n\n // Implemented as part of ControlValueAccessor.\n /** @ignore */\n registerOnTouched(fn: any) {\n this._onTouched = fn\n }\n\n // Implemented as part of ControlValueAccessor.\n /** @ignore */\n setDisabledState(isDisabled: boolean) {\n this.disabled = isDisabled\n }\n\n /** Focuses the input. */\n public focus(): void {\n this._telInputDirective?.focus()\n }\n\n /** Unfocuses the input. */\n public blur(): void {\n this._telInputDirective?.blur()\n }\n\n public hasFocus(): boolean {\n return this._focusOrigin !== null && this._focusOrigin !== undefined\n }\n\n}\n","<input seamTelInput seamInput\n [formControl]=\"_control\"\n [class.is-invalid]=\"_hasInvalidCss$ | async\"\n [required]=\"required\"/>\n","import { UntypedFormControl } from '@angular/forms'\n\nimport {\n getCountryCode,\n getDialCode,\n getIntlTelInputUtils,\n getValidationErrorMessage,\n globalIntlTelInputGlobals,\n processCountryCodes\n} from './utils'\n\nexport function telInputValidator(control: UntypedFormControl) {\n const value = control.value\n\n // This validator doesn't need to do anything if there isn't a value.\n if (typeof value !== 'string' || value.length === 0) {\n return Promise.resolve(null)\n }\n\n return getIntlTelInputUtils().then(utils => {\n const data = processCountryCodes(globalIntlTelInputGlobals().getCountryData())\n const dialCode = getDialCode(data, value)\n const countryCode = getCountryCode(data, dialCode)\n\n let number = value\n if (number.charAt(0) !== '+') {\n if (number.charAt(0) !== '1') { number = `1${number}` }\n number = `+${number}`\n }\n\n if (!utils.isValidNumber(number, countryCode)) {\n const code = utils.getValidationError(number, countryCode)\n const message = getValidationErrorMessage(code)\n return { 'telInput': { code, message } }\n }\n\n return null\n })\n}\n","import { ChangeDetectorRef, Pipe, PipeTransform } from '@angular/core'\n\nimport { intlTelInputUtils } from './intl-tel-input'\nimport { getCountryCode, getDialCode, getIntlTelInputUtils, globalIntlTelInputGlobals, processCountryCodes, TheSeamNumberFormatsInput } from './utils'\nimport { coercePhoneNumberFormat } from './utils'\n\n@Pipe({\n name: 'phoneNumber',\n pure: false\n})\nexport class TheSeamPhoneNumberPipe implements PipeTransform {\n\n private _latestPhoneNumber: string | undefined | null\n private _latestNumberFormat: TheSeamNumberFormatsInput | undefined | null\n private _latestValue: string | undefined | null\n\n constructor(private _cdr: ChangeDetectorRef) { }\n\n transform(\n phoneNumber: string,\n numberFormat: TheSeamNumberFormatsInput = intlTelInputUtils.numberFormat.INTERNATIONAL\n ): any {\n // console.log('transform', phoneNumber, numberFormat)\n if (this._latestPhoneNumber !== phoneNumber || this._latestNumberFormat !== numberFormat) {\n this._transform(phoneNumber, numberFormat)\n }\n this._latestPhoneNumber = phoneNumber\n this._latestNumberFormat = numberFormat\n\n // console.log('return', this._latestValue)\n return this._latestValue\n }\n\n async _transform(phoneNumber: string, numberFormat: TheSeamNumberFormatsInput) {\n // console.log('_transform', phoneNumber, numberFormat)\n const utils = await getIntlTelInputUtils()\n // console.log('utils', utils)\n\n const _format = coercePhoneNumberFormat(numberFormat)\n\n const data = processCountryCodes(globalIntlTelInputGlobals().getCountryData())\n const dialCode = getDialCode(data, phoneNumber)\n const countryCode = getCountryCode(data, dialCode)\n\n const number = phoneNumber\n // if (number.charAt(0) !== '+') {\n // if (number.charAt(0) !== '1') { number = `1${number}` }\n // number = `+${number}`\n // }\n\n const n = utils.formatNumber(number, countryCode, _format)\n // console.log('n', n)\n this._latestValue = n\n // this._cdr.markForCheck()\n this._cdr.detectChanges()\n }\n\n}\n","import { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\nimport { ReactiveFormsModule } from '@angular/forms'\n\nimport { TheSeamFormFieldModule } from '@theseam/ui-common/form-field'\n\nimport { TheSeamPhoneNumberPipe } from './phone-number.pipe'\nimport { TheSeamTelInputDirective } from './tel-input.directive'\nimport { TheSeamTelInputComponent } from './tel-input/tel-input.component'\n\n@NgModule({\n declarations: [\n TheSeamPhoneNumberPipe\n ],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n TheSeamFormFieldModule,\n TheSeamTelInputDirective,\n TheSeamTelInputComponent,\n ],\n exports: [\n TheSeamTelInputDirective,\n TheSeamTelInputComponent,\n TheSeamPhoneNumberPipe\n ]\n})\nexport class TheSeamTelInputModule { }\n","import { BaseHarnessFilters, ComponentHarness, HarnessPredicate } from '@angular/cdk/testing'\n\nimport { waitOnConditionAsync } from '@theseam/ui-common/utils'\n\ninterface TheSeamTelInputHarnessFilters extends BaseHarnessFilters {\n /** Filters based on the name of the field. */\n name?: string | RegExp\n}\n\nexport class TheSeamTelInputHarness extends ComponentHarness {\n static hostSelector = 'seam-tel-input'\n\n private readonly _input = this.locatorFor('input')\n\n /** Creates a `HarnessPredicate` used to locate a particular `TheSeamTelInputHarness`. */\n static with(options: TheSeamTelInputHarnessFilters): HarnessPredicate<TheSeamTelInputHarness> {\n return new HarnessPredicate(TheSeamTelInputHarness, options)\n .addOption('field name', options.name,\n (harness, name) => HarnessPredicate.stringMatches(harness.getName(), name))\n }\n\n public async getName(): Promise<string | null> {\n return (await this._input()).getAttribute('name')\n }\n\n public async getValue(): Promise<any> {\n return (await this._input()).getProperty('value')\n }\n\n public async isDisabled(): Promise<boolean> {\n return (await this._input()).getProperty('disabled')\n }\n\n public async isRequired(): Promise<boolean> {\n return (await this._input()).getProperty('required')\n }\n\n public async click(): Promise<void> {\n return (await this._input()).click()\n }\n\n public async setValue(value: any): Promise<void> {\n await this._waitOnInstance()\n // TODO: Find out why setInputValue() doesn't update the FormControl.\n // return (await this._input()).setInputValue(value)\n await (await this._input()).click()\n await this._input().then(x => x.setInputValue(''))\n return (await this._input()).sendKeys(value)\n }\n\n private async _waitOnInstance() {\n const input = document.querySelector('input')\n const isInstanceReady = () => {\n const instLoading = input?.getAttribute('instance-loading')\n return instLoading === null\n }\n if (isInstanceReady()) {\n return true\n }\n await waitOnCondition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ular/cdk/coercion';
1
3
  import { tick } from '@angular/core/testing';
2
4
  import expectPatched from '@storybook/expect';
3
5
  import { instrument } from '@storybook/instrumenter';
@@ -5,6 +7,168 @@ import * as mock from 'jest-mock';
5
7
  import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
6
8
  import { StorybookHarnessEnvironment } from '@marklb/storybook-harness';
7
9
 
10
+ class TheSeamNgSelectOptionHarness extends ComponentHarness {
11
+ /** Creates a `HarnessPredicate` used to locate a particular `MyMenuHarness`. */
12
+ static with(options) {
13
+ return new HarnessPredicate(TheSeamNgSelectOptionHarness, options)
14
+ .addOption('option value', options.value, (harness, value) => HarnessPredicate.stringMatches(harness.getValue(), value));
15
+ }
16
+ /**
17
+ * NOTE: Only works with string values, curently.
18
+ * @returns value of the select option
19
+ */
20
+ async getValue() {
21
+ return (await this.host()).text();
22
+ }
23
+ /** Whether the ng-select is disabled. */
24
+ async isDisabled() {
25
+ const disabled = (await this.host()).getAttribute('disabled');
26
+ return coerceBooleanProperty(await disabled);
27
+ }
28
+ async click() {
29
+ return (await this.host()).click();
30
+ }
31
+ }
32
+ TheSeamNgSelectOptionHarness.hostSelector = '.ng-option';
33
+
34
+ class TheSeamNgSelectDropdownHarness extends ComponentHarness {
35
+ // private readonly _ngSelect = this.locatorFor(TheSeamNgSelectDropdownHarness)
36
+ // private readonly _requiredIndicator = this.locatorFor(TheSeamFormFieldRequiredIndicatorHarness)
37
+ // private readonly _valueLabel = this.locatorForOptional('.ng-value-label')
38
+ // private readonly _options = this.locatorForOptional(TheSeamNgSelectOptionHarness)
39
+ /** Creates a `HarnessPredicate` used to locate a particular `MyMenuHarness`. */
40
+ static with(options) {
41
+ return new HarnessPredicate(TheSeamNgSelectDropdownHarness, options)
42
+ .addOption('field id', options.id, (harness, id) => HarnessPredicate.stringMatches(harness.getId(), id));
43
+ }
44
+ async getId() {
45
+ return (await this.host()).getAttribute('id');
46
+ }
47
+ /**
48
+ * Gets a list of `TheSeamNgSelectOptionHarness` representing the items in the menu.
49
+ * @param filters Optionally filters which menu items are included.
50
+ */
51
+ async getOptions(filters) {
52
+ return this.locatorForAll(TheSeamNgSelectOptionHarness.with({
53
+ ...(filters || {}),
54
+ }))();
55
+ }
56
+ /**
57
+ * Clicks an option in the dropdown.
58
+ * @param optionFilter A filter used to represent which option in the dropdown should be clicked. The
59
+ * first matching dropdown option will be clicked.
60
+ */
61
+ async clickOption(optionFilter) {
62
+ const options = await this.getOptions(optionFilter);
63
+ if (!options.length) {
64
+ throw Error(`Could not find option matching ${JSON.stringify(optionFilter)}`);
65
+ }
66
+ return options[0].click();
67
+ }
68
+ }
69
+ TheSeamNgSelectDropdownHarness.hostSelector = 'ng-dropdown-panel';
70
+
71
+ class TheSeamNgSelectHarness extends ComponentHarness {
72
+ constructor() {
73
+ super(...arguments);
74
+ this._documentRootLocator = this.documentRootLocatorFactory();
75
+ this._value = this.locatorForOptional('.ng-value');
76
+ this._valueLabel = this.locatorForOptional('.ng-value-label');
77
+ }
78
+ /** Creates a `HarnessPredicate` used to locate a particular `MyMenuHarness`. */
79
+ static with(options) {
80
+ return new HarnessPredicate(TheSeamNgSelectHarness, options);
81
+ // .addOption('field name', options.name,
82
+ // (harness, name) => HarnessPredicate.stringMatches(harness.getName(), name))
83
+ }
84
+ async getId() {
85
+ return (await this.getInputElement()).getAttribute('id');
86
+ }
87
+ async getAriaControls() {
88
+ return (await this.getInputElement()).getAttribute('aria-controls');
89
+ }
90
+ async getName() {
91
+ return (await this.getInputElement()).getAttribute('name');
92
+ }
93
+ /**
94
+ * NOTE: Only works with string values, curently.
95
+ * @returns value of the select
96
+ */
97
+ async getValue() {
98
+ const valueLabel = await this._valueLabel();
99
+ if (valueLabel === null) {
100
+ const value = await this._value();
101
+ if (value === null) {
102
+ return null;
103
+ }
104
+ return value.text();
105
+ }
106
+ return valueLabel.text();
107
+ }
108
+ /**
109
+ * Gets a list of `TheSeamNgSelectOptionHarness` representing the options in the dropdown.
110
+ *
111
+ * NOTE: Must open the dropdown first. eg. `await ngSelectHarness.click()`
112
+ *
113
+ * @param filters Optionally filters which menu items are included.
114
+ */
115
+ async getOptions(filters) {
116
+ const dropdown = await this._getDropdown();
117
+ if (dropdown === null) {
118
+ return [];
119
+ }
120
+ return dropdown.getOptions(filters);
121
+ }
122
+ /**
123
+ * Clicks an option in the dropdown.
124
+ * @param optionFilter A filter used to represent which option in the dropdown should be clicked. The
125
+ * first matching dropdown option will be clicked.
126
+ */
127
+ async clickOption(optionFilter) {
128
+ await this.click();
129
+ const dropdown = await this._getDropdown();
130
+ if (dropdown === null) {
131
+ throw Error(`Could not find dropdown.`);
132
+ }
133
+ return dropdown.clickOption(optionFilter);
134
+ }
135
+ /** Whether the ng-select is disabled. */
136
+ async isDisabled() {
137
+ const disabled = (await this.host()).getAttribute('disabled');
138
+ return coerceBooleanProperty(await disabled);
139
+ }
140
+ /**
141
+ * Returns the required state of the ng-select.
142
+ *
143
+ * @returns true if the ng-select is required, false if not
144
+ */
145
+ async isRequired() {
146
+ const required = await (await this.host()).getAttribute('required');
147
+ return required === undefined ? true : coerceBooleanProperty(required);
148
+ }
149
+ async click() {
150
+ return (await this.getInputElement()).click();
151
+ }
152
+ /**
153
+ * Returns the input element of the checkbox.
154
+ *
155
+ * @returns the input element of the checkbox
156
+ */
157
+ async getInputElement() {
158
+ return this.locatorFor('input')();
159
+ }
160
+ async _getDropdown() {
161
+ const ariaControls = await this.getAriaControls();
162
+ if (ariaControls) {
163
+ return this._documentRootLocator.locatorForOptional(TheSeamNgSelectDropdownHarness.with({
164
+ id: ariaControls,
165
+ }))();
166
+ }
167
+ return null;
168
+ }
169
+ }
170
+ TheSeamNgSelectHarness.hostSelector = 'ng-select';
171
+
8
172
  class FakeToastrService {
9
173
  constructor() {
10
174
  this.currentlyActive = 0;
@@ -191,5 +355,5 @@ function isComponentHarnessConstructor(value) {
191
355
  * Generated bundle index. Do not edit.
192
356
  */
193
357
 
194
- export { FakeToastrService, TickHelper, currentTickTime, expectFn, getHarness, jest, renderStory };
358
+ export { FakeToastrService, TheSeamNgSelectDropdownHarness, TheSeamNgSelectHarness, TheSeamNgSelectOptionHarness, TickHelper, currentTickTime, expectFn, getHarness, jest, renderStory };
195
359
  //# sourceMappingURL=theseam-ui-common-testing.mjs.map