@aceshooting/lyra-ui 25.4.0 → 25.6.0

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 (179) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +15 -3
  3. package/custom-elements.json +1 -1
  4. package/dist/all.d.ts +1 -1
  5. package/dist/all.js +1 -1
  6. package/dist/cli/migration-contract.json +1 -1
  7. package/dist/components/forms/button/button.class.d.ts +13 -3
  8. package/dist/components/forms/button/button.class.js +2 -2
  9. package/dist/components/forms/catalog-picker-base.d.ts +48 -0
  10. package/dist/components/forms/catalog-picker-base.js +29 -0
  11. package/dist/components/forms/catalog-picker-base.styles.d.ts +1 -0
  12. package/dist/components/forms/catalog-picker-base.styles.js +1 -0
  13. package/dist/components/forms/combobox/combobox.class.d.ts +4 -1
  14. package/dist/components/forms/combobox/combobox.class.js +2 -2
  15. package/dist/components/forms/country-picker/country-picker.class.d.ts +40 -0
  16. package/dist/components/forms/country-picker/country-picker.class.js +1 -0
  17. package/dist/components/forms/country-picker/country-picker.d.ts +1 -0
  18. package/dist/components/forms/country-picker/country-picker.js +1 -0
  19. package/dist/components/forms/country-picker/country-picker.styles.d.ts +1 -0
  20. package/dist/components/forms/country-picker/country-picker.styles.js +1 -0
  21. package/dist/components/forms/currency-picker/currency-catalog.d.ts +19 -0
  22. package/dist/components/forms/currency-picker/currency-catalog.js +1 -0
  23. package/dist/components/forms/currency-picker/currency-picker.class.d.ts +95 -0
  24. package/dist/components/forms/currency-picker/currency-picker.class.js +30 -0
  25. package/dist/components/forms/currency-picker/currency-picker.d.ts +1 -0
  26. package/dist/components/forms/currency-picker/currency-picker.js +1 -0
  27. package/dist/components/forms/currency-picker/currency-picker.styles.d.ts +1 -0
  28. package/dist/components/forms/currency-picker/currency-picker.styles.js +1 -0
  29. package/dist/components/forms/currency-picker/currency-presentation.d.ts +3 -0
  30. package/dist/components/forms/currency-picker/currency-presentation.js +1 -0
  31. package/dist/components/forms/currency-picker/currency-types.d.ts +3 -0
  32. package/dist/components/forms/index.d.ts +1 -1
  33. package/dist/components/forms/index.js +1 -1
  34. package/dist/components/forms/locale-picker/locale-picker.class.d.ts +37 -11
  35. package/dist/components/forms/locale-picker/locale-picker.class.js +43 -8
  36. package/dist/components/forms/locale-picker/locale-picker.styles.js +1 -1
  37. package/dist/components/forms/select/select.class.d.ts +9 -2
  38. package/dist/components/forms/select/select.class.js +2 -2
  39. package/dist/components/forms/select/select.styles.js +1 -1
  40. package/dist/components/forms/time-zone-picker/time-zone-picker.class.d.ts +40 -0
  41. package/dist/components/forms/time-zone-picker/time-zone-picker.class.js +1 -0
  42. package/dist/components/forms/time-zone-picker/time-zone-picker.d.ts +1 -0
  43. package/dist/components/forms/time-zone-picker/time-zone-picker.js +1 -0
  44. package/dist/components/forms/time-zone-picker/time-zone-picker.styles.d.ts +1 -0
  45. package/dist/components/forms/time-zone-picker/time-zone-picker.styles.js +1 -0
  46. package/dist/components/forms/unit-picker/unit-picker.class.d.ts +38 -0
  47. package/dist/components/forms/unit-picker/unit-picker.class.js +1 -0
  48. package/dist/components/forms/unit-picker/unit-picker.d.ts +1 -0
  49. package/dist/components/forms/unit-picker/unit-picker.js +1 -0
  50. package/dist/components/forms/unit-picker/unit-picker.styles.d.ts +1 -0
  51. package/dist/components/forms/unit-picker/unit-picker.styles.js +1 -0
  52. package/dist/components/lr-country-picker.js +1 -0
  53. package/dist/components/lr-currency-picker.js +1 -0
  54. package/dist/components/lr-time-zone-picker.js +1 -0
  55. package/dist/components/lr-unit-picker.js +1 -0
  56. package/dist/components/overlays/overlay/popover.class.d.ts +6 -5
  57. package/dist/components/overlays/overlay/popover.class.js +1 -1
  58. package/dist/countries.d.ts +7 -0
  59. package/dist/countries.js +1 -0
  60. package/dist/currency.d.ts +39 -0
  61. package/dist/currency.js +1 -0
  62. package/dist/custom-elements-jsx.d.ts +1 -1
  63. package/dist/events.d.ts +28 -24
  64. package/dist/framework-types.d.ts +2 -2
  65. package/dist/internal/autoloader-manifest.js +1 -1
  66. package/dist/internal/autoloader-tags.d.ts +1 -1
  67. package/dist/internal/autoloader-tags.js +1 -1
  68. package/dist/internal/default-strings.generated.d.ts +1 -1
  69. package/dist/internal/default-strings.generated.js +1 -1
  70. package/dist/internal/form-associated.d.ts +3 -1
  71. package/dist/internal/form-associated.js +1 -1
  72. package/dist/internal/localization-types.d.ts +1 -1
  73. package/dist/internal/localization.js +1 -1
  74. package/dist/internal/package-metadata.d.ts +1 -1
  75. package/dist/internal/package-metadata.js +1 -1
  76. package/dist/internal/root-registration-allowlist.d.ts +1 -1
  77. package/dist/internal/root-registration-allowlist.js +1 -1
  78. package/dist/internal/scoped-definitions.generated.js +1 -1
  79. package/dist/internal/selection-catalog.d.ts +4 -0
  80. package/dist/internal/selection-catalog.js +1 -0
  81. package/dist/lyra.d.ts +1 -1
  82. package/dist/lyra.js +1 -1
  83. package/dist/ssr/all.d.ts +1 -1
  84. package/dist/ssr/all.js +1 -1
  85. package/dist/ssr.d.ts +4 -4
  86. package/dist/ssr.js +1 -1
  87. package/dist/svelte.d.ts +1 -1
  88. package/dist/testing/lyra-tag-event-map.d.ts +2 -2
  89. package/dist/testing/lyra-tag-event-map.js +1 -1
  90. package/dist/time-zones.d.ts +8 -0
  91. package/dist/time-zones.js +1 -0
  92. package/dist/translations/am/forms.js +1 -1
  93. package/dist/translations/ar/forms.js +1 -1
  94. package/dist/translations/bho/forms.js +1 -1
  95. package/dist/translations/bn/forms.js +1 -1
  96. package/dist/translations/cs/forms.js +1 -1
  97. package/dist/translations/da/forms.js +1 -1
  98. package/dist/translations/de/forms.js +1 -1
  99. package/dist/translations/el/forms.js +1 -1
  100. package/dist/translations/es/forms.js +1 -1
  101. package/dist/translations/fa/forms.js +1 -1
  102. package/dist/translations/fa-AF/forms.js +1 -1
  103. package/dist/translations/fi/forms.js +1 -1
  104. package/dist/translations/fr/forms.js +1 -1
  105. package/dist/translations/gu/forms.js +1 -1
  106. package/dist/translations/ha/forms.js +1 -1
  107. package/dist/translations/he/forms.js +1 -1
  108. package/dist/translations/hi/forms.js +1 -1
  109. package/dist/translations/hr/forms.js +1 -1
  110. package/dist/translations/hu/forms.js +1 -1
  111. package/dist/translations/id/forms.js +1 -1
  112. package/dist/translations/ig/forms.js +1 -1
  113. package/dist/translations/it/forms.js +1 -1
  114. package/dist/translations/ja/forms.js +1 -1
  115. package/dist/translations/jv/forms.js +1 -1
  116. package/dist/translations/kk/forms.js +1 -1
  117. package/dist/translations/kn/forms.js +1 -1
  118. package/dist/translations/ko/forms.js +1 -1
  119. package/dist/translations/ln/forms.js +1 -1
  120. package/dist/translations/ml/forms.js +1 -1
  121. package/dist/translations/mr/forms.js +1 -1
  122. package/dist/translations/ms/forms.js +1 -1
  123. package/dist/translations/my/forms.js +1 -1
  124. package/dist/translations/nb/forms.js +1 -1
  125. package/dist/translations/ne/forms.js +1 -1
  126. package/dist/translations/nl/forms.js +1 -1
  127. package/dist/translations/nn/forms.js +1 -1
  128. package/dist/translations/om/forms.js +1 -1
  129. package/dist/translations/or/forms.js +1 -1
  130. package/dist/translations/pa/forms.js +1 -1
  131. package/dist/translations/pcm/forms.js +1 -1
  132. package/dist/translations/pl/forms.js +1 -1
  133. package/dist/translations/pnb/forms.js +1 -1
  134. package/dist/translations/ps/forms.js +1 -1
  135. package/dist/translations/pt-BR/forms.js +1 -1
  136. package/dist/translations/pt-PT/forms.js +1 -1
  137. package/dist/translations/ro/forms.js +1 -1
  138. package/dist/translations/ru/forms.js +1 -1
  139. package/dist/translations/sd/forms.js +1 -1
  140. package/dist/translations/sl/forms.js +1 -1
  141. package/dist/translations/su/forms.js +1 -1
  142. package/dist/translations/sv/forms.js +1 -1
  143. package/dist/translations/sw/forms.js +1 -1
  144. package/dist/translations/ta/forms.js +1 -1
  145. package/dist/translations/te/forms.js +1 -1
  146. package/dist/translations/th/forms.js +1 -1
  147. package/dist/translations/tl/forms.js +1 -1
  148. package/dist/translations/tr/forms.js +1 -1
  149. package/dist/translations/uk/forms.js +1 -1
  150. package/dist/translations/ur/forms.js +1 -1
  151. package/dist/translations/uz/forms.js +1 -1
  152. package/dist/translations/vi/forms.js +1 -1
  153. package/dist/translations/yo/forms.js +1 -1
  154. package/dist/translations/zh-CN/forms.js +1 -1
  155. package/dist/translations/zh-TW/forms.js +1 -1
  156. package/dist/translations/zu/forms.js +1 -1
  157. package/dist/units.d.ts +5 -0
  158. package/dist/units.js +1 -0
  159. package/dist/vue.d.ts +1 -1
  160. package/llms/components/lr-button.md +9 -0
  161. package/llms/components/lr-combobox.md +5 -0
  162. package/llms/components/lr-country-picker.md +92 -0
  163. package/llms/components/lr-currency-picker.md +101 -0
  164. package/llms/components/lr-locale-picker.md +18 -4
  165. package/llms/components/lr-popover.md +10 -4
  166. package/llms/components/lr-select.md +29 -0
  167. package/llms/components/lr-time-zone-picker.md +56 -0
  168. package/llms/components/lr-unit-picker.md +54 -0
  169. package/llms/index.md +6 -2
  170. package/llms/shared/events-and-types.md +16 -0
  171. package/llms/shared/imports-and-registration.md +1 -1
  172. package/llms/shared/testing-and-utilities.md +4 -1
  173. package/llms/shared.md +21 -2
  174. package/llms.txt +1 -1
  175. package/locales.json +138 -138
  176. package/package.json +55 -3
  177. package/registrations.json +1 -1
  178. package/vscode-html-data.json +1 -1
  179. package/web-types.json +1 -1
@@ -0,0 +1 @@
1
+ import{__decorate}from"tslib";import{html,nothing}from"lit";import{property}from"lit/decorators.js";import{trueDefaultBooleanConverter}from"../../../internal/converters.js";import{snapshotSelectionCatalog}from"../../../internal/selection-catalog.js";import{LyraCatalogPickerBase}from"../catalog-picker-base.js";import{COUNTRY_CODES,resolveCountryNames}from"../../../countries.js";import{styles}from"./country-picker.styles.js";import{LyraElement}from"../../../internal/lyra-element.js";import{LYRA_DEFAULT_collapse,LYRA_DEFAULT_countryPickerLabel,LYRA_DEFAULT_date,LYRA_DEFAULT_details,LYRA_DEFAULT_fieldRequired,LYRA_DEFAULT_loading,LYRA_DEFAULT_map,LYRA_DEFAULT_navigation,LYRA_DEFAULT_noData,LYRA_DEFAULT_notInCatalog,LYRA_DEFAULT_open,LYRA_DEFAULT_progress,LYRA_DEFAULT_restore,LYRA_DEFAULT_retry,LYRA_DEFAULT_search,LYRA_DEFAULT_select,LYRA_DEFAULT_tableLoadFailed}from"../../../internal/default-strings.generated.js";const defaultEntries=Object.freeze(COUNTRY_CODES.map(code=>Object.freeze({code})));function normalizeCountry(value){const text=typeof value=="string"?value.trim():"";return/^[A-Za-z]{2}$/.test(text)?text.toUpperCase():text}class LyraCountryPicker extends LyraCatalogPickerBase{constructor(){super(...arguments),this.flags=!0}static{this.defaultStrings={...super.defaultStrings,collapse:LYRA_DEFAULT_collapse,countryPickerLabel:LYRA_DEFAULT_countryPickerLabel,date:LYRA_DEFAULT_date,details:LYRA_DEFAULT_details,fieldRequired:LYRA_DEFAULT_fieldRequired,loading:LYRA_DEFAULT_loading,map:LYRA_DEFAULT_map,navigation:LYRA_DEFAULT_navigation,noData:LYRA_DEFAULT_noData,notInCatalog:LYRA_DEFAULT_notInCatalog,open:LYRA_DEFAULT_open,progress:LYRA_DEFAULT_progress,restore:LYRA_DEFAULT_restore,retry:LYRA_DEFAULT_retry,search:LYRA_DEFAULT_search,select:LYRA_DEFAULT_select,tableLoadFailed:LYRA_DEFAULT_tableLoadFailed}}static{this.styles=[LyraElement.styles,styles]}get countries(){return this._countries}set countries(value){const previous=this._countries;this._countries=snapshotSelectionCatalog(value,normalizeCountry,code=>/^[A-Z]{2}$/.test(code)),this.updateValidity(),this.requestUpdate("countries",previous)}get entries(){return this._countries??defaultEntries}get pickerLabel(){return this.localize("countryPickerLabel")}normalizeValue(value){return normalizeCountry(value)}resolveRows(){return resolveCountryNames(this.entries,this.effectiveLocale)}renderAdornment(row){if(!this.flags||!/^[A-Z]{2}$/.test(row.code))return nothing;const emoji=String.fromCodePoint(...[...row.code].map(char=>char.charCodeAt(0)+127397));return html`<span part="flag" aria-hidden="true">${emoji}</span>`}}__decorate([property({converter:trueDefaultBooleanConverter})],LyraCountryPicker.prototype,"flags",void 0),__decorate([property({attribute:!1})],LyraCountryPicker.prototype,"countries",null);export{LyraCountryPicker};
@@ -0,0 +1 @@
1
+ export*from'./country-picker.class.js';import'../select/select.js';import'../combobox/combobox.js';import'../combobox/option.js';
@@ -0,0 +1 @@
1
+ export*from"./country-picker.class.js";import{LyraCountryPicker}from"./country-picker.class.js";import{defineElement}from"../../../internal/prefix.js";import"../select/select.js";import"../combobox/combobox.js";import"../combobox/option.js";defineElement("country-picker",LyraCountryPicker);
@@ -0,0 +1 @@
1
+ export{styles}from'../catalog-picker-base.styles.js';
@@ -0,0 +1 @@
1
+ import{styles}from"../catalog-picker-base.styles.js";export{styles};
@@ -0,0 +1,19 @@
1
+ import type{LyraCurrencyEntry}from'./currency-types.js';
2
+ /**
3
+ * ISO 4217 currency, fund and metal codes from SIX list one, published 2026-09-17.
4
+ * Source: https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/lists/list-one.xml
5
+ * XML SHA-256: 33139b438657d1cee116ba737807ea71d19d6de4b90f799a09c56f0cc6a1b0ff.
6
+ * The 178 unique source codes are sorted, including XTS (test) and XXX (no currency).
7
+ * Names and symbols are resolved from Intl at runtime, never copied from the source.
8
+ */
9
+ declare const ISO_CURRENCY_CODES:readonly["AED","AFN","ALL","AMD","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VED","VES","VND","VUV","WST","XAD","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XCD","XCG","XDR","XOF","XPD","XPF","XPT","XSU","XTS","XUA","XXX","YER","ZAR","ZMW","ZWG"];
10
+ /** A code in the pinned ISO 4217 catalog, including funds, metals and reserved codes. */
11
+ export type LyraCurrencyCode=typeof ISO_CURRENCY_CODES[number];
12
+ /** Frozen full ISO 4217 catalog; membership does not imply exchange-rate provider support. */
13
+ export declare const CURRENCY_CODES:readonly LyraCurrencyCode[];
14
+ /** Picker defaults exclude the test and no-currency sentinels. */
15
+ export declare const DEFAULT_CURRENCY_CODES:readonly LyraCurrencyCode[];export declare const DEFAULT_CURRENCY_ENTRIES:readonly LyraCurrencyEntry[];
16
+ /** Normalize an assigned value without discarding malformed, nonempty caller data. */
17
+ export declare function normalizeCurrencyValue(value:unknown):string;
18
+ /** Clone a bounded caller catalog; undefined means the pinned default catalog. */
19
+ export declare function normalizeCurrencyCatalog(value:unknown):readonly LyraCurrencyEntry[]|undefined;export{};
@@ -0,0 +1 @@
1
+ import{getOwnDataDescriptor,MISSING_OWN_DATA_DESCRIPTOR,UNSAFE_OWN_DATA_DESCRIPTOR}from"../../../internal/data-descriptors.js";const ISO_CURRENCY_CODES=Object.freeze(["AED","AFN","ALL","AMD","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VED","VES","VND","VUV","WST","XAD","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XCD","XCG","XDR","XOF","XPD","XPF","XPT","XSU","XTS","XUA","XXX","YER","ZAR","ZMW","ZWG"]),CURRENCY_CODES=ISO_CURRENCY_CODES,DEFAULT_CURRENCY_CODES=Object.freeze(CURRENCY_CODES.filter(code=>code!=="XTS"&&code!=="XXX")),DEFAULT_CURRENCY_ENTRIES=Object.freeze(DEFAULT_CURRENCY_CODES.map(code=>Object.freeze({code})));function normalizeCurrencyValue(value){const text=typeof value=="string"?value.trim():"";return/^[A-Za-z]{3}$/.test(text)?text.toUpperCase():text}function normalizeCurrencyCatalog(value){if(value==null)return;let length;try{if(!Array.isArray(value))return Object.freeze([]);const lengthDescriptor=getOwnDataDescriptor(value,"length"),ownLength=typeof lengthDescriptor=="symbol"?void 0:lengthDescriptor.value;if(typeof ownLength!="number"||!Number.isSafeInteger(ownLength)||ownLength<0)return Object.freeze([]);length=Math.min(ownLength,512)}catch{return Object.freeze([])}const rows=[],seen=new Set;for(let index=0;index<length;index++){let code,label,symbol,disabled,group;try{const indexDescriptor=getOwnDataDescriptor(value,String(index));if(typeof indexDescriptor=="symbol")continue;const item=indexDescriptor.value;if(typeof item=="string")code=item;else if(item&&typeof item=="object"&&!Array.isArray(item)){const codeDescriptor=getOwnDataDescriptor(item,"code");if(codeDescriptor===MISSING_OWN_DATA_DESCRIPTOR||codeDescriptor===UNSAFE_OWN_DATA_DESCRIPTOR)continue;const labelDescriptor=getOwnDataDescriptor(item,"label"),symbolDescriptor=getOwnDataDescriptor(item,"symbol"),disabledDescriptor=getOwnDataDescriptor(item,"disabled"),groupDescriptor=getOwnDataDescriptor(item,"group");if(labelDescriptor===UNSAFE_OWN_DATA_DESCRIPTOR||symbolDescriptor===UNSAFE_OWN_DATA_DESCRIPTOR||disabledDescriptor===UNSAFE_OWN_DATA_DESCRIPTOR||groupDescriptor===UNSAFE_OWN_DATA_DESCRIPTOR)continue;code=codeDescriptor.value,label=labelDescriptor===MISSING_OWN_DATA_DESCRIPTOR?void 0:labelDescriptor.value,symbol=symbolDescriptor===MISSING_OWN_DATA_DESCRIPTOR?void 0:symbolDescriptor.value,disabled=disabledDescriptor===MISSING_OWN_DATA_DESCRIPTOR?void 0:disabledDescriptor.value,group=groupDescriptor===MISSING_OWN_DATA_DESCRIPTOR?void 0:groupDescriptor.value}else continue}catch{continue}const normalized=normalizeCurrencyValue(code);if(!/^[A-Z]{3}$/.test(normalized)||seen.has(normalized)||label!==void 0&&typeof label!="string"||symbol!==void 0&&typeof symbol!="string"||disabled!==void 0&&typeof disabled!="boolean"||group!==void 0&&typeof group!="string")continue;const row={code:normalized};label!==void 0&&Object.assign(row,{label}),symbol!==void 0&&Object.assign(row,{symbol}),disabled!==void 0&&Object.assign(row,{disabled}),group!==void 0&&Object.assign(row,{group}),rows.push(Object.freeze(row)),seen.add(normalized)}return Object.freeze(rows)}export{CURRENCY_CODES,DEFAULT_CURRENCY_CODES,DEFAULT_CURRENCY_ENTRIES,normalizeCurrencyCatalog,normalizeCurrencyValue};
@@ -0,0 +1,95 @@
1
+ import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import{type FormSubmissionValue}from'../../../internal/form-associated.js';import type{PlaceStrategy}from'../../../internal/positioner.js';import type{LyraSize}from'../../../internal/variants.js';import'../select/select.class.js';import'../combobox/combobox.class.js';import'../combobox/option.class.js';import type{LyraCurrencyCatalog}from'./currency-types.js';export type{LyraCurrencyCatalog,LyraCurrencyEntry}from'./currency-types.js';export interface LyraCurrencyChangeDetail{readonly value:string;readonly previousValue:string;}export interface LyraCurrencyPickerEventMap{'lr-input':CustomEvent<LyraCurrencyChangeDetail>;'lr-change':CustomEvent<LyraCurrencyChangeDetail>;'lr-invalid':CustomEvent<null>;input:Event;change:Event;focus:FocusEvent;blur:FocusEvent;}declare class CurrencyPickerBase extends LyraElement<LyraCurrencyPickerEventMap>{}declare const LyraCurrencyPicker_base:typeof CurrencyPickerBase&(new(...args:any[])=>import("../../../lyra.js").FormAssociatedInterface<string> &import("../../../internal/form-associated.js").FormAssociatedSubclassInterface<string>);
2
+ /**
3
+ * `<lr-currency-picker>` — a form-associated currency-code selector.
4
+ *
5
+ * The trigger shows the committed ISO code; options pair code-only type-ahead with localized
6
+ * names and symbols. Omission uses a pinned catalog of 176 currency, fund and metal codes.
7
+ * Supply `currencies` for an ordered application subset, literal display overrides or contiguous
8
+ * groups. Opt into `searchable` for code, localized name and regular/narrow symbol filtering.
9
+ * Filter text is transient: typing never commits a currency or emits selection events.
10
+ * As in the composed combobox, text equal to the selected code keeps the full list available.
11
+ *
12
+ * Empty values remain uncommitted. Unknown, malformed and subsequently disabled values remain
13
+ * visible and invalid until replaced or cleared. Programmatic changes, catalog updates, locale
14
+ * changes and form reset are silent. A user commit emits input, lr-input, change and lr-change
15
+ * exactly once, after the value and outer form state have changed.
16
+ *
17
+ * The outer field owns form submission, defaults and validation. The composed select or combobox supplies
18
+ * supported keyboard, popup and field chrome behavior. Selection does not convert amounts,
19
+ * persist a preference, fetch exchange rates or change the page locale.
20
+ *
21
+ * @customElement lr-currency-picker
22
+ * @slot label - Custom field label.
23
+ * @slot hint - Custom field guidance.
24
+ * @slot error - Custom validation guidance.
25
+ * @csspart form-control - The field wrapper.
26
+ * @csspart form-control-label - The field label.
27
+ * @csspart select-trigger - The select trigger or searchable input container.
28
+ * @csspart select-display-input - The selected code or editable filter input.
29
+ * @csspart select-listbox - The currency listbox.
30
+ * @csspart select-option - A currency option.
31
+ * @csspart select-option-sub - The option descriptive subtext.
32
+ * @csspart select-group-label - A caller-supplied contiguous group heading.
33
+ * @csspart select-clear-button - The optional clear action.
34
+ * @csspart hint - Field guidance.
35
+ * @csspart error - Validation guidance.
36
+ * @event {Event} input - Fired after a user selection updates the committed value and form state.
37
+ * @event lr-input - User selection changed the committed value.
38
+ * @event {Event} change - Fired once after an accepted user selection or clear.
39
+ * @event lr-change - User selection changed the committed value.
40
+ * @event lr-invalid - Native invalid alias. Cancelable: preventDefault() suppresses validation UI.
41
+ * @event {FocusEvent} focus - Re-dispatched from the visible control as a bubbling, composed event.
42
+ * @event {FocusEvent} blur - Re-dispatched from the visible control as a bubbling, composed event.
43
+ * @status experimental
44
+ * @since 25.5.0
45
+ */
46
+ export declare class LyraCurrencyPicker extends LyraCurrencyPicker_base{static styles:import("lit").CSSResultGroup[];protected static collectionSupport:import("../../../internal/lyra-element.js").LyraCollectionSupport;protected static readonly immutableEventDetails:readonly string[];
47
+ /** Visible field label; the label slot takes precedence. */
48
+ label:string;
49
+ /** Field guidance; the hint slot takes precedence. */
50
+ hint:string;
51
+ /** Static error guidance; the error slot takes precedence. */
52
+ errorText:string;
53
+ /** Empty display text. Omission localizes Select; explicit empty text stays empty. */
54
+ placeholder:string|undefined;
55
+ /** Host aria-label override, taking precedence over labels and aria-labelledby. */
56
+ accessibleLabel:string|null;
57
+ /** Shared form-control size. */
58
+ size:LyraSize;
59
+ /** Show the supported select clear action for a nonempty value. */
60
+ clearable:boolean;
61
+ /** Opt into text filtering by code, localized name and symbol without accepting custom values. */
62
+ searchable:boolean;
63
+ /** Native autocomplete hint for the optional filter input. */
64
+ autocomplete:string;
65
+ /** Native input keyboard hint for the optional filter input. */
66
+ inputMode:string;
67
+ /** Native enter-key hint for the optional filter input. */
68
+ enterKeyHint:string;
69
+ /** Native spellchecking for the filter; removing the attribute restores false. */
70
+ spellcheck:boolean;
71
+ /** Native capitalization hint for the optional filter input. */
72
+ autocapitalize:string;private autocorrectValue;
73
+ /** Native filter autocorrection. The HTML attribute accepts on/off; omission defaults to true.
74
+ * @default true */
75
+ get autocorrect():boolean;set autocorrect(next:boolean);
76
+ /** Place the popup in the browser top layer, including within native dialogs. */
77
+ topLayer:boolean;
78
+ /** Explicit popup strategy; omission inherits --lr-positioning-strategy. */
79
+ positioningStrategy?:PlaceStrategy;private controlElement?;private readonly slotPresence;private descriptionLease?;private labelLease?;private validationChild?;private validationDocument?;private readonly validationController;constructor();private projectValidation;private projectionToken;private projectedAnchor?;private replacingControl?;private restoreControlFocus;private focusReplacement?;private _currencies;private presentationEntries?;private presentationLocale?;private presentationRows?;
80
+ /** Clone-owned, bounded catalog snapshot. Undefined/null restores defaults; [] stays empty. */
81
+ get currencies():LyraCurrencyCatalog|undefined;set currencies(next:LyraCurrencyCatalog|undefined);
82
+ /** Committed code, empty by default. Normalizes three ASCII letters; retains malformed text. */
83
+ get value():string;set value(next:string);
84
+ /** Normalized value restored by native form reset and value-attribute changes. */
85
+ get defaultValue():string;set defaultValue(next:string);private get entries();private get rows();private get unavailable();private get liveDisabled();protected updateValidity():void;
86
+ /** Native filter input when searchable, otherwise null. Native editing methods are available
87
+ * here; after programmatically changing its text, dispatch input to apply filtering. Text edits
88
+ * never change the committed currency value. */
89
+ get input():HTMLInputElement|null;
90
+ /** Focus the composed trigger when enabled. */
91
+ focus(options?:FocusOptions):void;
92
+ /** Blur the composed trigger. */
93
+ blur():void;
94
+ /** Activate the composed trigger when enabled. */
95
+ click():void;private syncChildValue;private resetChildTransientState;private readonly onChildChange;private readonly onChildFocus;private readonly onChildFocusOut;private readonly onChildKeyDown;private syncRelationships;protected willUpdate(changed:PropertyValues):void;protected updated(changed:PropertyValues):void;connectedCallback():void;adoptedCallback():void;formResetCallback():void;formStateRestoreCallback(state:FormSubmissionValue,reason:'autocomplete'|'restore'):void;disconnectedCallback():void;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-currency-picker':LyraCurrencyPicker;}}
@@ -0,0 +1,30 @@
1
+ import{__decorate}from"tslib";import{noChange,nothing}from"lit";import{html,unsafeStatic}from"lit/static-html.js";import{tag}from"../../../internal/prefix.js";import{collectionSupport}from"../../../internal/collection-snapshot.js";import{styleMap}from"lit/directives/style-map.js";import{property,query}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{FormAssociated,isBarredFromValidation}from"../../../internal/form-associated.js";import{resolveValidityAnchor,SET_ANCHORED_VALIDITY,VALIDITY_ANCHOR}from"../../../internal/anchored-validity.js";import{acquireResolvedAriaRelationship}from"../../../internal/aria-controls.js";import{SlotPresenceController}from"../../../internal/slot-presence-controller.js";import{dispatchNativeEvent,relayNativeEvent}from"../../../internal/native-event-relay.js";import{activeElementIn,deepActiveElementIn}from"../../../internal/active-element.js";import{autocorrectConverter,spellcheckConverter}from"../../../internal/converters.js";import{submitOnEnter}from"../../../internal/submit-on-enter.js";import"../select/select.class.js";import"../combobox/combobox.class.js";import"../combobox/option.class.js";import{styles}from"./currency-picker.styles.js";import{DEFAULT_CURRENCY_ENTRIES,normalizeCurrencyCatalog,normalizeCurrencyValue}from"./currency-catalog.js";import{resolveCurrencyPresentation}from"./currency-presentation.js";import{LYRA_DEFAULT_collapse,LYRA_DEFAULT_currencyPickerLabel,LYRA_DEFAULT_date,LYRA_DEFAULT_details,LYRA_DEFAULT_fieldRequired,LYRA_DEFAULT_loading,LYRA_DEFAULT_map,LYRA_DEFAULT_navigation,LYRA_DEFAULT_noData,LYRA_DEFAULT_notInCatalog,LYRA_DEFAULT_open,LYRA_DEFAULT_progress,LYRA_DEFAULT_restore,LYRA_DEFAULT_retry,LYRA_DEFAULT_search,LYRA_DEFAULT_select,LYRA_DEFAULT_tableLoadFailed}from"../../../internal/default-strings.generated.js";const valueAdapter={empty:"",toFormValue:value=>value,fromAttribute:normalizeCurrencyValue,toAttribute:normalizeCurrencyValue,fromFormState:state=>normalizeCurrencyValue(state)};class CurrencyPickerBase extends LyraElement{}const currencySpellcheckConverter={...spellcheckConverter,fromAttribute:(value,type)=>value===null?void 0:spellcheckConverter.fromAttribute?.(value,type)};class LyraCurrencyPicker extends FormAssociated(CurrencyPickerBase,valueAdapter){static{this.defaultStrings={...super.defaultStrings,collapse:LYRA_DEFAULT_collapse,currencyPickerLabel:LYRA_DEFAULT_currencyPickerLabel,date:LYRA_DEFAULT_date,details:LYRA_DEFAULT_details,fieldRequired:LYRA_DEFAULT_fieldRequired,loading:LYRA_DEFAULT_loading,map:LYRA_DEFAULT_map,navigation:LYRA_DEFAULT_navigation,noData:LYRA_DEFAULT_noData,notInCatalog:LYRA_DEFAULT_notInCatalog,open:LYRA_DEFAULT_open,progress:LYRA_DEFAULT_progress,restore:LYRA_DEFAULT_restore,retry:LYRA_DEFAULT_retry,search:LYRA_DEFAULT_search,select:LYRA_DEFAULT_select,tableLoadFailed:LYRA_DEFAULT_tableLoadFailed}}static{this.styles=[LyraElement.styles,styles]}static{this.collectionSupport=collectionSupport}static{this.immutableEventDetails=Object.freeze(["lr-input","lr-change"])}get autocorrect(){return this.autocorrectValue}set autocorrect(next){this.autocorrectValue=!!next,this.requestUpdate()}constructor(){super(),this.label="",this.hint="",this.errorText="",this.accessibleLabel=null,this.size="m",this.clearable=!1,this.searchable=!1,this.autocomplete="off",this.inputMode="",this.enterKeyHint="",this.spellcheck=!1,this.autocapitalize="",this.autocorrectValue=!0,this.topLayer=!1,this.slotPresence=new SlotPresenceController(this),this.validationController={hostUpdated:()=>this.projectValidation()},this.projectionToken=0,this.restoreControlFocus=!1,this.onChildChange=event=>{const child=this.controlElement;if(!child||event.target!==child||(event.stopPropagation(),event.type!=="lr-change"))return;const next=event.detail.value,previousValue=this.value;if(this.liveDisabled||typeof next!="string"||next&&!this.entries.some(row=>row.code===next&&!row.disabled)){this.syncChildValue(child);return}if(next===previousValue)return;this.value=next;const detail={value:this.value,previousValue};dispatchNativeEvent(this,"input"),this.emit("lr-input",detail),dispatchNativeEvent(this,"change"),this.emit("lr-change",detail)},this.onChildFocus=event=>{event.target===this.controlElement&&(event.stopPropagation(),this.replacingControl||relayNativeEvent(this,event))},this.onChildFocusOut=event=>{event.target===this.replacingControl&&event.stopPropagation()},this.onChildKeyDown=event=>{!this.liveDisabled&&this.searchable&&event.target===this.controlElement&&event.composedPath()[0]===this.input&&submitOnEnter(this,event)},this.addEventListener("invalid",()=>this.projectValidation())}projectValidation(){const child=this.validationChild;!child||!this.isConnected||child!==this.controlElement||this.validationDocument!==this.ownerDocument||resolveValidityAnchor(child)?.setAttribute("aria-invalid",this.internals.states?.has("user-invalid")?"true":"false")}get currencies(){return this._currencies}set currencies(next){const previous=this._currencies;this._currencies=normalizeCurrencyCatalog(next),this.updateValidity(),this.requestUpdate("currencies",previous)}get value(){return super.value}set value(next){super.value=normalizeCurrencyValue(next)}get defaultValue(){return normalizeCurrencyValue(super.defaultValue)}set defaultValue(next){super.defaultValue=next}get entries(){return this._currencies??DEFAULT_CURRENCY_ENTRIES}get rows(){const entries=this.entries,locale=this.effectiveLocale;return(this.presentationEntries!==entries||this.presentationLocale!==locale||!this.presentationRows)&&(this.presentationEntries=entries,this.presentationLocale=locale,this.presentationRows=resolveCurrencyPresentation(entries,locale)),this.presentationRows}get unavailable(){return!!(this.value&&!this.entries.some(row=>row.code===this.value&&!row.disabled))}get liveDisabled(){return this.effectiveDisabled||this.matches(":disabled")}updateValidity(){this.internals&&(isBarredFromValidation(this,this.internals)?this[SET_ANCHORED_VALIDITY]({}):this.unavailable?this[SET_ANCHORED_VALIDITY]({customError:!0},this.localize("notInCatalog")):this.required&&!this.value?this[SET_ANCHORED_VALIDITY]({valueMissing:!0},this.localize("fieldRequired")):this[SET_ANCHORED_VALIDITY]({}))}get input(){const child=this.controlElement;return this.searchable&&child&&"input"in child?child.input:null}[VALIDITY_ANCHOR](){return resolveValidityAnchor(this.controlElement)??null}focus(options){this.liveDisabled||this.controlElement?.focus(options)}blur(){this.controlElement?.blur()}click(){this.liveDisabled||this.controlElement?.click()}syncChildValue(child){child.value="inputValue"in child?this.value||null:this.value}resetChildTransientState(){const child=this.controlElement;child&&(child.open=!1,"inputValue"in child&&(child.formResetCallback(),this.syncChildValue(child)))}syncRelationships(){const anchor=this[VALIDITY_ANCHOR]();this.descriptionLease?this.descriptionLease.update(anchor):this.descriptionLease=acquireResolvedAriaRelationship(this,anchor,"aria-describedby"),this.accessibleLabel!==null?(this.labelLease?.release(),this.labelLease=void 0):this.labelLease?this.labelLease.update(anchor):this.labelLease=acquireResolvedAriaRelationship(this,anchor,"aria-labelledby"),anchor&&this.projectedAnchor!==anchor&&(this.projectedAnchor=anchor,this.requestUpdate())}willUpdate(changed){super.willUpdate(changed),changed.has("searchable")&&this.controlElement&&(this.replacingControl=this.controlElement,this.restoreControlFocus=activeElementIn(this.shadowRoot)===this.controlElement||this.focusReplacement===this.controlElement,this.focusReplacement=void 0,this.controlElement.open=!1)}updated(changed){super.updated(changed);const child=this.controlElement;this.restoreControlFocus&&(this.focusReplacement=child),this.restoreControlFocus=!1,this.replacingControl=void 0,changed.has("positioningStrategy")&&child?.requestUpdate("positioningStrategy"),(this.validationChild!==child||this.validationDocument!==this.ownerDocument)&&(this.validationChild?.removeController(this.validationController),this.validationChild=child,this.validationDocument=this.ownerDocument,child?.addController(this.validationController)),this.projectValidation();const token=++this.projectionToken,document=this.ownerDocument;child&&child.updateComplete.then(()=>{if(token===this.projectionToken&&this.isConnected&&this.ownerDocument===document&&this.controlElement===child){this.syncRelationships();const active=deepActiveElementIn(document);this.focusReplacement===child&&(this.focusReplacement=void 0,!this.liveDisabled&&(!active||active===document.body||active===this||active===child)&&(child.focus({preventScroll:!0}),child.hide()))}})}connectedCallback(){super.connectedCallback(),this.requestUpdate()}adoptedCallback(){super.adoptedCallback(),this.requestUpdate()}formResetCallback(){super.formResetCallback(),this.resetChildTransientState(),this.projectValidation()}formStateRestoreCallback(state,reason){super.formStateRestoreCallback(state,reason),this.resetChildTransientState(),this.projectValidation()}disconnectedCallback(){++this.projectionToken,this.restoreControlFocus=!1,this.focusReplacement=void 0,this.replacingControl=void 0,this.resetChildTransientState(),this.validationChild?.removeController(this.validationController),this.validationChild=void 0,this.validationDocument=void 0,this.projectedAnchor=void 0,this.presentationEntries=void 0,this.presentationLocale=void 0,this.presentationRows=void 0,this.descriptionLease?.release(),this.descriptionLease=void 0,this.labelLease?.release(),this.labelLease=void 0,super.disconnectedCallback()}render(){const hasLabel=!!this.label||this.slotPresence.has("label"),controlTag=unsafeStatic(tag(this.searchable?"combobox":"select")),optionTag=unsafeStatic(tag("option")),exportParts=["form-control,form-control-label",this.searchable?"combobox:select-trigger,combobox-input:select-display-input":"trigger:select-trigger,display-input:select-display-input","listbox:select-listbox,option:select-option,option-sub:select-option-sub,group-label:select-group-label,clear-button:select-clear-button,hint,error"].join(",");return html`<${controlTag}
2
+ exportparts=${exportParts}
3
+ style=${styleMap({"--lr-positioning-strategy":this.positioningStrategy==="fixed"||this.positioningStrategy==="absolute"?this.positioningStrategy:void 0})}
4
+ .strings=${this.strings}
5
+ .customError=${this.validity.valid?null:this.validationMessage}
6
+ .value=${this.searchable?this.value||null:this.value} .label=${this.label} .hint=${this.hint} .errorText=${this.errorText}
7
+ .placeholder=${this.placeholder??this.localize("select")}
8
+ aria-label=${this.accessibleLabel??(hasLabel?nothing:this.localize("currencyPickerLabel"))}
9
+ .required=${this.required} .disabled=${this.effectiveDisabled} .size=${this.size}
10
+ .clearable=${this.clearable} .topLayer=${this.topLayer}
11
+ .maxRender=${this.searchable?this.rows.length||1:noChange}
12
+ .autocomplete=${this.searchable?this.autocomplete:noChange}
13
+ .inputMode=${this.searchable?this.inputMode:noChange} .enterKeyHint=${this.searchable?this.enterKeyHint:noChange}
14
+ .spellcheck=${this.searchable?this.spellcheck:noChange}
15
+ .autocapitalize=${this.searchable?this.autocapitalize:noChange} .autocorrect=${this.searchable?this.autocorrect:noChange}
16
+ autocorrect=${this.searchable&&this.hasAttribute("autocorrect")?this.autocorrect?"on":"off":nothing}
17
+ @input=${this.onChildChange} @lr-input=${this.onChildChange}
18
+ @change=${this.onChildChange} @lr-change=${this.onChildChange}
19
+ @lr-filter=${this.onChildChange} @focusout=${this.onChildFocusOut}
20
+ @keydown=${this.onChildKeyDown}
21
+ @focus=${this.onChildFocus} @blur=${this.onChildFocus}
22
+ >${this.rows.map(row=>html`<${optionTag} .value=${row.code} .label=${row.code}
23
+ .sub=${[row.label,row.symbol].filter(text=>text.length>0).join(" · ")}
24
+ .group=${row.group??""} .searchText=${this.searchable?row.searchText:""}
25
+ .disabled=${!!row.disabled}>${row.code}</${optionTag}>`)}
26
+ ${this.slotPresence.has("label")?html`<slot name="label" slot="label"></slot>`:nothing}
27
+ ${this.slotPresence.has("hint")?html`<slot name="hint" slot="hint"></slot>`:nothing}
28
+ ${this.slotPresence.has("error")?html`<slot name="error" slot="error"></slot>`:nothing}
29
+ ${this.entries.some(row=>row.code===this.value&&row.disabled)?html`<span slot="end">${this.localize("notInCatalog")}</span>`:nothing}
30
+ </${controlTag}>`}}__decorate([property()],LyraCurrencyPicker.prototype,"label",void 0),__decorate([property()],LyraCurrencyPicker.prototype,"hint",void 0),__decorate([property({attribute:"error-text"})],LyraCurrencyPicker.prototype,"errorText",void 0),__decorate([property()],LyraCurrencyPicker.prototype,"placeholder",void 0),__decorate([property({attribute:"aria-label"})],LyraCurrencyPicker.prototype,"accessibleLabel",void 0),__decorate([property({reflect:!0})],LyraCurrencyPicker.prototype,"size",void 0),__decorate([property({type:Boolean})],LyraCurrencyPicker.prototype,"clearable",void 0),__decorate([property({type:Boolean})],LyraCurrencyPicker.prototype,"searchable",void 0),__decorate([property()],LyraCurrencyPicker.prototype,"autocomplete",void 0),__decorate([property({attribute:"inputmode"})],LyraCurrencyPicker.prototype,"inputMode",void 0),__decorate([property({attribute:"enterkeyhint"})],LyraCurrencyPicker.prototype,"enterKeyHint",void 0),__decorate([property({converter:currencySpellcheckConverter,useDefault:!0})],LyraCurrencyPicker.prototype,"spellcheck",void 0),__decorate([property()],LyraCurrencyPicker.prototype,"autocapitalize",void 0),__decorate([property({converter:autocorrectConverter})],LyraCurrencyPicker.prototype,"autocorrect",null),__decorate([property({type:Boolean,attribute:"top-layer"})],LyraCurrencyPicker.prototype,"topLayer",void 0),__decorate([property({attribute:"positioning-strategy"})],LyraCurrencyPicker.prototype,"positioningStrategy",void 0),__decorate([query(`${tag("select")},${tag("combobox")}`)],LyraCurrencyPicker.prototype,"controlElement",void 0),__decorate([property({attribute:!1})],LyraCurrencyPicker.prototype,"currencies",null);export{LyraCurrencyPicker};
@@ -0,0 +1 @@
1
+ export*from'./currency-picker.class.js';import'../select/select.js';import'../combobox/combobox.js';import'../combobox/option.js';
@@ -0,0 +1 @@
1
+ export*from"./currency-picker.class.js";import{LyraCurrencyPicker}from"./currency-picker.class.js";import{defineElement}from"../../../internal/prefix.js";import"../select/select.js";import"../combobox/combobox.js";import"../combobox/option.js";defineElement("currency-picker",LyraCurrencyPicker);
@@ -0,0 +1 @@
1
+ export declare const styles:import("lit").CSSResult;
@@ -0,0 +1 @@
1
+ import{css}from"lit";const styles=css`:host{--_lr-currency-picker-invalid-border:var(--lr-color-danger);min-inline-size:0;display:block}:host(:where(:state(user-invalid))) [exportparts]::part(trigger),:host(:where(:state(user-invalid))) [exportparts]::part(combobox){border-color:var(--_lr-currency-picker-invalid-border)}[exportparts]{inline-size:100%;min-inline-size:0}[exportparts]::part(display-input),[exportparts]::part(combobox-input),[exportparts]::part(option-label),[exportparts]::part(option-sub){unicode-bidi:isolate}`;export{styles};
@@ -0,0 +1,3 @@
1
+ import type{LyraCurrencyDisplayEntry,LyraCurrencyEntry}from'./currency-types.js';export interface ResolvedCurrencyEntry extends LyraCurrencyDisplayEntry{readonly searchText:string;}
2
+ /** Resolve display-only names and symbols without changing currency identity. */
3
+ export declare function resolveCurrencyPresentation(entries:readonly LyraCurrencyEntry[],locale:string):readonly ResolvedCurrencyEntry[];
@@ -0,0 +1 @@
1
+ import{getDisplayNames,getNumberFormat}from"../../../internal/intl-cache.js";function resolveSymbol(code,locale,currencyDisplay){try{const part=getNumberFormat(locale,{style:"currency",currency:code,currencyDisplay}).formatToParts(0).find(candidate=>candidate.type==="currency")?.value;return part?.trim()?part:code}catch{return code}}function resolveCurrencyPresentation(entries,locale){const rows=entries.map(entry=>{let localizedName;try{const name=getDisplayNames(locale,{type:"currency",fallback:"code"}).of(entry.code);localizedName=name?.trim()?name:entry.code}catch{localizedName=entry.code}const regularSymbol=resolveSymbol(entry.code,locale,"symbol"),narrowSymbol=resolveSymbol(entry.code,locale,"narrowSymbol"),label=entry.label??localizedName,symbol=entry.symbol??regularSymbol,searchText=[...new Set([entry.code,label,localizedName,symbol,regularSymbol,narrowSymbol])].join(" ");return Object.freeze({code:entry.code,label,symbol,narrowSymbol,disabled:entry.disabled===!0,...entry.group===void 0?{}:{group:entry.group},searchText})});return Object.freeze(rows)}export{resolveCurrencyPresentation};
@@ -0,0 +1,3 @@
1
+ export interface LyraCurrencyEntry{readonly code:string;readonly label?:string;readonly symbol?:string;readonly disabled?:boolean;readonly group?:string;}export type LyraCurrencyCatalog=readonly string[]|readonly LyraCurrencyEntry[];
2
+ /** Localized display data for one currency; caller labels and symbols take precedence. */
3
+ export interface LyraCurrencyDisplayEntry{readonly code:string;readonly label:string;readonly symbol:string;readonly narrowSymbol:string;readonly disabled:boolean;readonly group?:string;}
@@ -1 +1 @@
1
- export type{LyraFormValidator,LyraFormValidatorResult}from'./form-validator.js';export*from'./button/button.js';export*from'./checkbox/checkbox.js';export*from'./checkbox-group/checkbox-group.js';export*from'./code-editor/code-editor.js';export*from'./color-picker/color-picker.js';export*from'./combobox/combobox.js';export*from'./combobox/option.js';export*from'./date-picker/date-input.js';export*from'./date-picker/date-picker.js';export*from'./emoji-picker/emoji-picker.js';export*from'./icon-button/icon-button.js';export*from'./input/input.js';export*from'./input/native-time-input.js';export*from'./input/number-input.js';export*from'./input/time-input.js';export*from'./locale-picker/locale-picker.js';export*from'./otp-input/otp-input.js';export*from'./phone-input/phone-input.js';export*from'./radio/radio-button.js';export*from'./radio/radio-group.js';export*from'./radio/radio.js';export*from'./rubric-form/rubric-form.js';export*from'./select/select.js';export*from'./slider/slider.js';export*from'./swatch-picker/swatch-picker.js';export*from'./switch/switch.js';export*from'./textarea/textarea.js';export*from'./time-range/time-range.js';export*from'./toggle/toggle.js';export*from'./toggle-group/toggle-group.js';export*from'./token-input/token-input.js';
1
+ export type{LyraFormValidator,LyraFormValidatorResult}from'./form-validator.js';export*from'./button/button.js';export*from'./checkbox/checkbox.js';export*from'./checkbox-group/checkbox-group.js';export*from'./code-editor/code-editor.js';export*from'./color-picker/color-picker.js';export*from'./combobox/combobox.js';export*from'./combobox/option.js';export*from'./country-picker/country-picker.js';export*from'./currency-picker/currency-picker.js';export*from'./date-picker/date-input.js';export*from'./date-picker/date-picker.js';export*from'./emoji-picker/emoji-picker.js';export*from'./icon-button/icon-button.js';export*from'./input/input.js';export*from'./input/native-time-input.js';export*from'./input/number-input.js';export*from'./input/time-input.js';export*from'./locale-picker/locale-picker.js';export*from'./otp-input/otp-input.js';export*from'./phone-input/phone-input.js';export*from'./radio/radio-button.js';export*from'./radio/radio-group.js';export*from'./radio/radio.js';export*from'./rubric-form/rubric-form.js';export*from'./select/select.js';export*from'./slider/slider.js';export*from'./swatch-picker/swatch-picker.js';export*from'./switch/switch.js';export*from'./textarea/textarea.js';export*from'./time-range/time-range.js';export*from'./time-zone-picker/time-zone-picker.js';export*from'./toggle/toggle.js';export*from'./toggle-group/toggle-group.js';export*from'./token-input/token-input.js';export*from'./unit-picker/unit-picker.js';
@@ -1 +1 @@
1
- export*from"./button/button.js";export*from"./checkbox/checkbox.js";export*from"./checkbox-group/checkbox-group.js";export*from"./code-editor/code-editor.js";export*from"./color-picker/color-picker.js";export*from"./combobox/combobox.js";export*from"./combobox/option.js";export*from"./date-picker/date-input.js";export*from"./date-picker/date-picker.js";export*from"./emoji-picker/emoji-picker.js";export*from"./icon-button/icon-button.js";export*from"./input/input.js";export*from"./input/native-time-input.js";export*from"./input/number-input.js";export*from"./input/time-input.js";export*from"./locale-picker/locale-picker.js";export*from"./otp-input/otp-input.js";export*from"./phone-input/phone-input.js";export*from"./radio/radio-button.js";export*from"./radio/radio-group.js";export*from"./radio/radio.js";export*from"./rubric-form/rubric-form.js";export*from"./select/select.js";export*from"./slider/slider.js";export*from"./swatch-picker/swatch-picker.js";export*from"./switch/switch.js";export*from"./textarea/textarea.js";export*from"./time-range/time-range.js";export*from"./toggle/toggle.js";export*from"./toggle-group/toggle-group.js";export*from"./token-input/token-input.js";
1
+ export*from"./button/button.js";export*from"./checkbox/checkbox.js";export*from"./checkbox-group/checkbox-group.js";export*from"./code-editor/code-editor.js";export*from"./color-picker/color-picker.js";export*from"./combobox/combobox.js";export*from"./combobox/option.js";export*from"./country-picker/country-picker.js";export*from"./currency-picker/currency-picker.js";export*from"./date-picker/date-input.js";export*from"./date-picker/date-picker.js";export*from"./emoji-picker/emoji-picker.js";export*from"./icon-button/icon-button.js";export*from"./input/input.js";export*from"./input/native-time-input.js";export*from"./input/number-input.js";export*from"./input/time-input.js";export*from"./locale-picker/locale-picker.js";export*from"./otp-input/otp-input.js";export*from"./phone-input/phone-input.js";export*from"./radio/radio-button.js";export*from"./radio/radio-group.js";export*from"./radio/radio.js";export*from"./rubric-form/rubric-form.js";export*from"./select/select.js";export*from"./slider/slider.js";export*from"./swatch-picker/swatch-picker.js";export*from"./switch/switch.js";export*from"./textarea/textarea.js";export*from"./time-range/time-range.js";export*from"./time-zone-picker/time-zone-picker.js";export*from"./toggle/toggle.js";export*from"./toggle-group/toggle-group.js";export*from"./token-input/token-input.js";export*from"./unit-picker/unit-picker.js";
@@ -55,9 +55,9 @@ export interface LyraLocaleChangeDetail{value:string;previousValue:string;direct
55
55
  * higher-precedence validation layer until the caller clears it.
56
56
  *
57
57
  * Built directly on the shared trigger-button/`aria-activedescendant` listbox technique
58
- * `<lr-select>` uses (not composed from it) — a plain closed list, no filter/free-text mode; a
59
- * locale catalog is realistically dozens of rows, not thousands, so `<lr-combobox>`'s filterable
60
- * model would be more surface than the job needs.
58
+ * `<lr-select>` uses (not composed from it). Optional `searchable` adds a text filter over the
59
+ * offered rows, matching tags, native names, caller labels and localized language names. The
60
+ * filter never becomes a submitted value and never selects a locale by itself.
61
61
  *
62
62
  * Selecting a row emits a cancelable `lr-change-request` before setting `value` — if a listener doesn't call
63
63
  * `event.preventDefault()`, the component applies the pick itself via `setLyraLocale()`. A host
@@ -83,8 +83,9 @@ export interface LyraLocaleChangeDetail{value:string;previousValue:string;direct
83
83
  * @event lr-change - Non-cancelable notification after locale selection commits. The selection changed. `detail: { value, previousValue, direction }`, where
84
84
  * `direction` is the picked locale's `'ltr'`/`'rtl'` writing direction. Veto through
85
85
  * `lr-change-request`; preventing this notification does not reverse the commit.
86
- * @event blur - Native `FocusEvent` relayed from the internal trigger button.
87
- * @event focus - Native `FocusEvent` relayed from the internal trigger button.
86
+ * @event blur - Native `FocusEvent` relayed when focus leaves the control. Internal moves between
87
+ * the trigger, optional search input and Retry do not emit another blur.
88
+ * @event focus - Native `FocusEvent` relayed when focus enters the control.
88
89
  * @event lr-invalid - The locale picker failed a validity check; cancelable. Calling
89
90
  * `preventDefault()` also cancels the native `invalid` event it aliases, suppressing the
90
91
  * browser's own validation bubble and `reportValidity()`'s focus/scroll.
@@ -100,6 +101,8 @@ export interface LyraLocaleChangeDetail{value:string;previousValue:string;direct
100
101
  * @csspart trigger-label - The current locale's label. Visually hidden in flag-only mode but
101
102
  * retained as the trigger's accessible current-value description.
102
103
  * @csspart listbox - The options popover.
104
+ * @csspart search-input - The optional text filter inside the popover.
105
+ * @csspart empty - The optional filter's no-match guidance.
103
106
  * @csspart option - An option row.
104
107
  * @csspart option-flag - The row's leading `<lr-flag>` (present only while `withoutFlags` is off).
105
108
  * @csspart option-label - An option row's label wrapper (native name + tag).
@@ -215,14 +218,33 @@ triggerDisplay:LyraLocaleTriggerDisplay;
215
218
  * rather than hiding it -- a visually hidden tag still joins the row's accessible name and still
216
219
  * matches a consumer's own `::part(option-tag)` rule, so hiding is not omitting. The trigger,
217
220
  * the row flags and selection behaviour are identical either way. */
218
- optionDisplay:LyraLocaleOptionDisplay;label:string;hint:string;errorText:string;
221
+ optionDisplay:LyraLocaleOptionDisplay;
222
+ /** Adds an optional text filter over tags, native names, caller labels and localized language
223
+ * names. Filtering is case/accent insensitive, never commits a free-text value and emits no
224
+ * selection event. Opening focuses the filter; arrows move the active match and Enter chooses
225
+ * it. Escape returns to the trigger. The private query clears on close, reset, disablement,
226
+ * disconnect or turning this option off. Unset preserves the original closed-list behavior. */
227
+ searchable:boolean;
228
+ /** Native autocomplete hint for the optional filter input. */
229
+ autocomplete:string;
230
+ /** Native keyboard hint for the optional filter input. */
231
+ inputMode:string;
232
+ /** Native enter-key hint for the optional filter input. */
233
+ enterKeyHint:string;
234
+ /** Native spellchecking for the filter; removing the attribute restores false. */
235
+ spellcheck:boolean;
236
+ /** Native capitalization hint for the optional filter input. */
237
+ autocapitalize:string;private autocorrectValue;
238
+ /** Native filter autocorrection. HTML accepts on/off; omission defaults to true.
239
+ * @default true */
240
+ get autocorrect():boolean;set autocorrect(next:boolean);label:string;hint:string;errorText:string;
219
241
  /** Whether the option popup is open. Disabled controls reject direct reopen attempts, including
220
242
  * the synchronous fieldset cascade before `formDisabledCallback()` runs. */
221
243
  get open():boolean;set open(next:boolean);
222
244
  /** Visual size — the library-wide `2xs`–`xl` ladder shared with `lr-select`. The Web Awesome /
223
245
  * Shoelace spellings `small`/`medium`/`large` are accepted for `s`/`m`/`l`, so a migration is a
224
246
  * tag rename with no attribute rewrite. */
225
- size:LyraSize;private activeIndex;private touched;private hasHintSlot;private hasErrorSlot;private hasLabelSlot;private registryTick;private triggerElement?;private internals;private validityController;
247
+ size:LyraSize;private activeIndex;private searchQuery;private touched;private hasHintSlot;private hasErrorSlot;private hasLabelSlot;private registryTick;private triggerElement?;private searchElement?;private searchAnnouncements?;private searchFocusGeneration;private internals;private validityController;
226
248
  /** Consumer-supplied validation message reflected through `custom-error`. */
227
249
  customError:string|null;private listId;private controlId;private cleanup?;
228
250
  /** Whether the last placement forced the top layer, so turning `topLayer` off demotes. */
@@ -243,12 +265,16 @@ private readonly typeAheadReset;private activeScrollGeneration;private localized
243
265
  private get liveDisabled();
244
266
  /** Focus the internal trigger unless the form control is effectively disabled. */
245
267
  focus(options?:FocusOptions):void;
246
- /** Blur the internal trigger. */
268
+ /** Blur the internal trigger or the optional focused search input. */
247
269
  blur():void;
248
270
  /** Activates the internal trigger -- `HTMLElement.prototype.click()` on a custom element with
249
271
  * no native click semantics is otherwise a silent no-op. Mirrors `<lr-select>`'s identical
250
272
  * `click()`. */
251
- click():void;get form():HTMLFormElement|null;set form(owner:FormOwnerValue);getForm():HTMLFormElement|null;get labels():NodeList;get validity():ValidityState;get validationMessage():string;get willValidate():boolean;private localDescriptionIds;private externalDescriptionLease?;private syncExternalDescription;private releaseExternalDescription;connectedCallback():void;disconnectedCallback():void;adoptedCallback():void;protected willUpdate(changed:PropertyValues):void;
273
+ click():void;
274
+ /** Native filter input when searchable, otherwise null. After editing its value directly,
275
+ * dispatch a native input event to update filtering; this never changes the committed locale.
276
+ * The field remains disabled while the popup is closed. */
277
+ get input():HTMLInputElement|null;get form():HTMLFormElement|null;set form(owner:FormOwnerValue);getForm():HTMLFormElement|null;get labels():NodeList;get validity():ValidityState;get validationMessage():string;get willValidate():boolean;private localDescriptionIds;private externalDescriptionLease?;private syncExternalDescription;private releaseExternalDescription;connectedCallback():void;disconnectedCallback():void;adoptedCallback():void;protected willUpdate(changed:PropertyValues):void;
252
278
  /** The current locale tag (empty string when nothing is committed). */
253
279
  get value():string;set value(next:string);
254
280
  /** Reflected current reset default; changing it never overwrites a dirty live `value`. */
@@ -313,7 +339,7 @@ setCustomValidity(message:string):void;
313
339
  * per-entry `label` carries no useful information -- it falls back to the derived
314
340
  * `localeNativeName(tag)` exactly like an omitted label, rather than rendering/announcing an
315
341
  * empty option row. */
316
- private get normalizedEntries();
342
+ private get normalizedEntries();private normalizeSearch;private get visibleEntries();private clearSearch;private queueSearchFocus;
317
343
  /** The tag actually shown in the trigger: the committed `value` once set, else a live preview
318
344
  * of `effectiveLocale` -- never a committed selection, see the class doc's value/preview
319
345
  * split.
@@ -339,7 +365,7 @@ private labelFor;private show;private hide;private dismissFromEscape;private onD
339
365
  * in-flight wait -- see `updated()`'s `open`-driven caller. */
340
366
  private settleClosedLayout;protected updated(changed:PropertyValues):void;private commitDispatching;private valueWriteVersion;private loadGeneration;private loadAnnouncements?;private loadingTag?;private loadFailureTag?;private cancelLocaleLoad;private announceLoad;
341
367
  /** Requests a selection before loading or updating the control and the global locale. */
342
- private commit;private retryLocaleLoad;private onTriggerClick;private onTriggerBlur;private onTriggerFocus;private onLabelSlotChange;private onHintSlotChange;private onErrorSlotChange;
368
+ private commit;private retryLocaleLoad;private onTriggerClick;private onTriggerBlur;private onTriggerFocus;private isSearchFocusTransfer;private onSearchInput;private onSearchChange;private onSearchKeyDown;private onLabelSlotChange;private onHintSlotChange;private onErrorSlotChange;
343
369
  /** Standard listbox type-ahead: moves to the next row whose native name starts with the
344
370
  * accumulated buffer, cycling from just after the "current" row (the active row while open,
345
371
  * the preview tag while closed). While open this only moves `activeIndex` (a highlight,