fds-vue-core 8.6.0 β 8.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Form/FdsPhonenumber/FdsPhonenumber.vue.d.ts +2 -0
- package/dist/components/Form/FdsPhonenumber/countries.d.ts +3 -1
- package/dist/components/Form/FdsPhonenumber/types.d.ts +7 -0
- package/dist/components/Form/FdsPhonenumber/useSharedClickOutside.d.ts +8 -0
- package/dist/fds-vue-core.cjs.js +211 -90
- package/dist/fds-vue-core.cjs.js.map +1 -1
- package/dist/fds-vue-core.css +1 -1
- package/dist/fds-vue-core.es.js +211 -90
- package/dist/fds-vue-core.es.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +14 -14
- package/src/components/FdsSearchSelect/FdsSearchSelect.vue +4 -3
- package/src/components/Form/FdsPhonenumber/FdsPhonenumber.stories.ts +25 -0
- package/src/components/Form/FdsPhonenumber/FdsPhonenumber.vue +60 -9
- package/src/components/Form/FdsPhonenumber/FdsPhonenumberCountryPicker.vue +31 -16
- package/src/components/Form/FdsPhonenumber/countries.ts +56 -17
- package/src/components/Form/FdsPhonenumber/types.ts +7 -0
- package/src/components/Form/FdsPhonenumber/useSharedClickOutside.ts +50 -0
- package/src/index.ts +1 -0
|
@@ -37,6 +37,8 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {},
|
|
|
37
37
|
readonly: boolean;
|
|
38
38
|
defaultCountry: string;
|
|
39
39
|
countries: import('./countries').CountryPhoneOption[];
|
|
40
|
+
fixedCountry: string;
|
|
41
|
+
hideCountryPicker: boolean;
|
|
40
42
|
selectClass: string;
|
|
41
43
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
42
44
|
export default _default;
|
|
@@ -6,7 +6,9 @@ export interface CountryPhoneOption {
|
|
|
6
6
|
}
|
|
7
7
|
export declare function isPrioritizedCountry(iso2: string): boolean;
|
|
8
8
|
export declare function sortCountryOptionsByName(options: CountryPhoneOption[], locale?: string, _preferredCountry?: string): CountryPhoneOption[];
|
|
9
|
-
/**
|
|
9
|
+
/** Single country option without building the full catalog (e.g. fixed-country UI). */
|
|
10
|
+
export declare function getCountryOption(iso2: string, locale?: string): CountryPhoneOption | null;
|
|
11
|
+
/** Country options for phone fields; SE/NO/DK/FI first, then alphabetical by name. Cached per locale. */
|
|
10
12
|
export declare function buildCountryOptions(locale?: string, preferredCountry?: string): CountryPhoneOption[];
|
|
11
13
|
/** ISO 3166-1 alpha-2 to regional indicator flag emoji, e.g. `SE` β πΈπͺ */
|
|
12
14
|
export declare function countryCodeToFlag(iso2: string): string;
|
|
@@ -17,6 +17,13 @@ export interface FdsPhonenumberProps extends FdsPhonenumberInputPassthroughProps
|
|
|
17
17
|
countries?: CountryPhoneOption[];
|
|
18
18
|
/** BCP 47 locale for country names in the list, e.g. `sv-SE` or `en`. Falls back to FDS i18n locale. */
|
|
19
19
|
locale?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Lock to this ISO2 country and render a static dial code (no dropdown / country list).
|
|
22
|
+
* Prefer this over `:countries="[SE]"` in long forms β avoids N interactive pickers.
|
|
23
|
+
*/
|
|
24
|
+
fixedCountry?: string;
|
|
25
|
+
/** Hide the interactive country picker; shows a static dial code for the current/fixed country. */
|
|
26
|
+
hideCountryPicker?: boolean;
|
|
20
27
|
disabled?: boolean;
|
|
21
28
|
dataTestid?: string;
|
|
22
29
|
selectClass?: string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
type ClickOutsideHandler = (event: MouseEvent) => void;
|
|
3
|
+
/**
|
|
4
|
+
* One window `mousedown` listener shared by all subscribers.
|
|
5
|
+
* Subscribe only while `active` is true (e.g. dropdown open).
|
|
6
|
+
*/
|
|
7
|
+
export declare function useSharedClickOutside(handler: ClickOutsideHandler, active: Ref<boolean>): void;
|
|
8
|
+
export {};
|