fds-vue-core 8.2.3 → 8.3.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.
- package/components.d.ts +2 -0
- package/dist/components/FdsSearchSelect/FdsSearchSelect.vue.d.ts +3 -5
- package/dist/components/FdsSearchSelectPro/FdsSearchSelectPro.vue.d.ts +3 -5
- package/dist/components/Form/FdsInput/FdsInput.vue.d.ts +2 -3
- package/dist/components/Form/FdsInput/types.d.ts +0 -2
- package/dist/components/Form/FdsPhonenumber/FdsPhonenumber.vue.d.ts +0 -3
- package/dist/components/Form/FdsPhonenumber/normalizePhoneInput.d.ts +7 -0
- package/dist/components/Form/FdsPhonenumber/phoneMask.d.ts +2 -0
- package/dist/components/Form/FdsPhonenumber/types.d.ts +1 -1
- package/dist/components/Form/FdsSsn/FdsSsn.vue.d.ts +33 -0
- package/dist/components/Form/FdsSsn/ssnMask.d.ts +19 -0
- package/dist/components/Form/FdsSsn/types.d.ts +24 -0
- package/dist/fds-vue-core.cjs.js +937 -448
- 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 +938 -449
- package/dist/fds-vue-core.es.js.map +1 -1
- package/dist/helpers/validateSsn.d.ts +16 -0
- package/dist/index.d.ts +5 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -1
- package/src/components/Form/FdsInput/FdsInput.stories.ts +1 -7
- package/src/components/Form/FdsInput/FdsInput.vue +41 -163
- package/src/components/Form/FdsInput/types.ts +0 -2
- package/src/components/Form/FdsPhonenumber/FdsPhonenumber.vue +30 -9
- package/src/components/Form/FdsPhonenumber/normalizePhoneInput.ts +88 -0
- package/src/components/Form/FdsPhonenumber/phoneMask.ts +28 -0
- package/src/components/Form/FdsPhonenumber/types.ts +0 -3
- package/src/components/Form/FdsSsn/FdsSsn.stories.ts +131 -0
- package/src/components/Form/FdsSsn/FdsSsn.vue +133 -0
- package/src/components/Form/FdsSsn/ssnMask.ts +20 -0
- package/src/components/Form/FdsSsn/types.ts +36 -0
- package/src/helpers/validateSsn.ts +63 -0
- package/src/index.ts +16 -0
- package/src/lang/en.json +2 -0
- package/src/lang/sv.json +2 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface SsnValidationOptions {
|
|
2
|
+
allowCoordinationNumber?: boolean;
|
|
3
|
+
allowInterimNumber?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface SsnValidationResult {
|
|
6
|
+
isValid: boolean;
|
|
7
|
+
/** Normalized value without separators; `null` when empty or invalid. */
|
|
8
|
+
digits: string | null;
|
|
9
|
+
}
|
|
10
|
+
/** Strip separators; keeps alphanumeric characters for interim numbers. */
|
|
11
|
+
export declare function stripSsnSeparators(value: string): string;
|
|
12
|
+
/** Validate a Swedish personal identity number. */
|
|
13
|
+
export declare function validateSsnNumber(value: string, options?: SsnValidationOptions): SsnValidationResult;
|
|
14
|
+
export declare function validateSsn(value: string, options?: SsnValidationOptions): boolean;
|
|
15
|
+
/** `null` when empty, otherwise whether the value is a valid personnummer. */
|
|
16
|
+
export declare function getSsnValidationState(value: string, options?: SsnValidationOptions): boolean | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ import { default as FdsWizard } from './components/FdsWizard/FdsWizard.vue';
|
|
|
27
27
|
import { default as FdsCheckbox } from './components/Form/FdsCheckbox/FdsCheckbox.vue';
|
|
28
28
|
import { default as FdsInput } from './components/Form/FdsInput/FdsInput.vue';
|
|
29
29
|
import { default as FdsPhonenumber } from './components/Form/FdsPhonenumber/FdsPhonenumber.vue';
|
|
30
|
+
import { default as FdsSsn } from './components/Form/FdsSsn/FdsSsn.vue';
|
|
30
31
|
import { default as FdsRadio } from './components/Form/FdsRadio/FdsRadio.vue';
|
|
31
32
|
import { default as FdsSelect } from './components/Form/FdsSelect/FdsSelect.vue';
|
|
32
33
|
import { default as FdsTextarea } from './components/Form/FdsTextarea/FdsTextarea.vue';
|
|
@@ -58,7 +59,7 @@ import { debounce } from './helpers/debounce';
|
|
|
58
59
|
import { useFileSizeValidation, useFileValidation } from './helpers/fileValidation';
|
|
59
60
|
import { FdsI18nLike } from './plugin/i18n';
|
|
60
61
|
import { FdsButtonBaseProps } from './components/Buttons/ButtonBaseProps';
|
|
61
|
-
export { FdsBlockAlert, FdsBlockContent, FdsBlockExpander, FdsBlockInfo, FdsBlockLink, FdsButtonCopy, FdsButtonDownload, FdsButtonIcon, FdsButtonMinor, FdsButtonPrimary, FdsButtonSecondary, FdsCheckbox, FdsDevMode, FdsExitModal, FdsH1, FdsH2, FdsH3, FdsHr, FdsIcon, FdsInput, FdsLabel, FdsLead, FdsListHeading, FdsMeta, FdsModal, FdsPagination, FdsPhonenumber, FdsPopover, FdsRadio, FdsSearchSelect, FdsSearchSelectPro, FdsSelect, FdsSpinner, FdsSticker, FdsTable, FdsTableHead, FdsTabs, FdsTabsItem, FdsTextarea, FdsTreeView, FdsTruncatedText, FdsWeekCalendar, FdsWizard, };
|
|
62
|
+
export { FdsBlockAlert, FdsBlockContent, FdsBlockExpander, FdsBlockInfo, FdsBlockLink, FdsButtonCopy, FdsButtonDownload, FdsButtonIcon, FdsButtonMinor, FdsButtonPrimary, FdsButtonSecondary, FdsCheckbox, FdsDevMode, FdsExitModal, FdsH1, FdsH2, FdsH3, FdsHr, FdsIcon, FdsInput, FdsLabel, FdsLead, FdsListHeading, FdsMeta, FdsModal, FdsPagination, FdsPhonenumber, FdsSsn, FdsPopover, FdsRadio, FdsSearchSelect, FdsSearchSelectPro, FdsSelect, FdsSpinner, FdsSticker, FdsTable, FdsTableHead, FdsTabs, FdsTabsItem, FdsTextarea, FdsTreeView, FdsTruncatedText, FdsWeekCalendar, FdsWizard, };
|
|
62
63
|
export { capitalizeFirstLetter, clearUnsavedChanges, debounce, formatPidWithDash, isRelativeHref, getExitGuardWizardId, isPidString, normalizePidSearchValue, PID_MASK, PID_MASK_OPTIONS, resolveRouterLinkTarget, setupExitConfirmationGuard, setupRouterLinkInterceptor, shouldBlockNavigation, shouldBlockWizardExit, teardownRouterLinkInterceptor, useBoldQuery, useDevMode, useDevModeEnvironment, useDevModeToggles, useDownload, useExitConfirmationGuard, useExitConfirmationGuardState, useFileSizeValidation, useFileValidation, useIsPid, useRouteScrollPositions, useTreeState, useViewportBreakpoint, };
|
|
63
64
|
export * from './assets/logos';
|
|
64
65
|
export interface FdsVueCorePluginOptions {
|
|
@@ -86,6 +87,9 @@ export type { CountryPhoneOption } from './components/Form/FdsPhonenumber/countr
|
|
|
86
87
|
export { buildCountryOptions, countryCodeToFlag, filterCountryOptions, sortCountryOptionsByName, } from './components/Form/FdsPhonenumber/countries';
|
|
87
88
|
export { getPhoneValidationState, validatePhoneNumber, type PhoneValidationResult, } from './components/Form/FdsPhonenumber/validatePhone';
|
|
88
89
|
export type { FdsPhonenumberEmits, FdsPhonenumberProps } from './components/Form/FdsPhonenumber/types';
|
|
90
|
+
export { getSsnValidationState, stripSsnSeparators, validateSsn, validateSsnNumber, type SsnValidationOptions, type SsnValidationResult, } from './helpers/validateSsn';
|
|
91
|
+
export { getSsnMask, getSsnMaskOptions, SSN_INTERIM_MASK, SSN_MASK } from './components/Form/FdsSsn/ssnMask';
|
|
92
|
+
export type { FdsSsnEmits, FdsSsnProps } from './components/Form/FdsSsn/types';
|
|
89
93
|
export type { FdsTableProps } from './components/Table/FdsTable/types';
|
|
90
94
|
export type { FdsTableHeadProps } from './components/Table/FdsTableHead/types';
|
|
91
95
|
export type { FdsAlertBlockProps } from './components/Blocks/FdsBlockAlert/types';
|