@verifiedinc-public/shared-ui-elements 9.5.2 → 9.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.
- package/dist/components/chart/MetricLastUpdated.mjs +1 -1
- package/dist/components/form/index.d.ts +0 -1
- package/dist/components/index.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/CredentialsDisplay.d.ts +0 -2
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/CredentialsDisplay.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/CredentialsDisplayContext.d.ts +0 -38
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/CredentialsDisplayContext.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/CredentialsDisplayItem.d.ts +0 -13
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/CredentialsDisplayItem.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/CredentialsDisplayItemContext.d.ts +0 -47
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/CredentialsDisplayItemContext.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/components/EditModeButton.d.ts +0 -2
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/components/EditModeButton.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/components/index.d.ts +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/hooks.d.ts +0 -8
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/hooks.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/types.d.ts +0 -67
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/types.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/extractChildrenFromCredentialFieldSet.d.ts +0 -9
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/extractChildrenFromCredentialFieldSet.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/extractTypesFromSchema.d.ts +0 -12
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/extractTypesFromSchema.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/filterRepeatedCredentials.d.ts +0 -7
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/filterRepeatedCredentials.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/findCorrectSchemaProperty.d.ts +0 -7
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/findCorrectSchemaProperty.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/findCredentialsByType.d.ts +0 -8
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/findCredentialsByType.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/getCredentialTypeDisplayInfo.d.ts +0 -8
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/getCredentialTypeDisplayInfo.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/getCredentialValues.d.ts +0 -9
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/getCredentialValues.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/getLastPathName.d.ts +0 -6
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/getLastPathName.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/getParentPath.d.ts +0 -6
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/getParentPath.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/getReferencedSchemaNames.d.ts +0 -8
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/getReferencedSchemaNames.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/hasMandatoryFieldEmpty.d.ts +0 -9
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/hasMandatoryFieldEmpty.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/index.d.ts +0 -19
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/isNewCredentialAgainstInstance.d.ts +0 -9
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/isNewCredentialAgainstInstance.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/isNewCredentialValues.d.ts +0 -6
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/isNewCredentialValues.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/isRequiredCredentialDisplayInfo.d.ts +0 -4
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/isRequiredCredentialDisplayInfo.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/isSomeFieldInputAllowed.d.ts +0 -6
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/isSomeFieldInputAllowed.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/isValidInputCredential.d.ts +0 -13
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/isValidInputCredential.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/makeCredentialDisplayInfoList.d.ts +0 -14
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/makeCredentialDisplayInfoList.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/sortCredentialsBySchema.d.ts +0 -2
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/sortCredentialsBySchema.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/transformToFormObject.d.ts +0 -6
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/transformToFormObject.mjs +0 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/transformToFormSchema.d.ts +0 -15
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/transformToFormSchema.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/DataFieldAtomic.d.ts +0 -6
- package/dist/components/form/OneClickForm/components/DataField/DataFieldAtomic.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/DataFieldCheckbox.d.ts +0 -7
- package/dist/components/form/OneClickForm/components/DataField/DataFieldCheckbox.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/DataFieldClearAdornment.d.ts +0 -6
- package/dist/components/form/OneClickForm/components/DataField/DataFieldClearAdornment.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/DataFieldComposite.d.ts +0 -11
- package/dist/components/form/OneClickForm/components/DataField/DataFieldComposite.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/DataFieldDescription.d.ts +0 -1
- package/dist/components/form/OneClickForm/components/DataField/DataFieldDescription.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/DataFieldGroup.d.ts +0 -13
- package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/HeaderSelect/index.d.ts +0 -2
- package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/HeaderSelect/index.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/HeaderSelect/styles.d.ts +0 -2
- package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/HeaderSelect/styles.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/HeaderSelect/utils/getAddressFormat.d.ts +0 -2
- package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/HeaderSelect/utils/getAddressFormat.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/HeaderSelect/utils/index.d.ts +0 -1
- package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/HeaderSelect/utils/renderInstance.d.ts +0 -3
- package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/HeaderSelect/utils/renderInstance.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/index.d.ts +0 -12
- package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/index.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/DataFieldInputLabel.d.ts +0 -14
- package/dist/components/form/OneClickForm/components/DataField/DataFieldInputLabel.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/DataFieldInputModeHeader.d.ts +0 -11
- package/dist/components/form/OneClickForm/components/DataField/DataFieldLabel.d.ts +0 -6
- package/dist/components/form/OneClickForm/components/DataField/DataFieldLabel.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/DataFieldLabelText.d.ts +0 -11
- package/dist/components/form/OneClickForm/components/DataField/DataFieldLabelText.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/DataFieldLeftSide.d.ts +0 -7
- package/dist/components/form/OneClickForm/components/DataField/DataFieldLeftSide.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/DataFieldLegend.d.ts +0 -14
- package/dist/components/form/OneClickForm/components/DataField/DataFieldLegend.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/DataFieldPaper.d.ts +0 -13
- package/dist/components/form/OneClickForm/components/DataField/DataFieldRootStack.d.ts +0 -8
- package/dist/components/form/OneClickForm/components/DataField/DataFieldRootStack.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/DataFieldStack.d.ts +0 -8
- package/dist/components/form/OneClickForm/components/DataField/DataFieldStack.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/DataFieldValue.d.ts +0 -13
- package/dist/components/form/OneClickForm/components/DataField/DataFieldValue.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldImage.d.ts +0 -6
- package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldImage.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldInputAddress.d.ts +0 -10
- package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldInputSelect.d.ts +0 -9
- package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldText.d.ts +0 -6
- package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldText.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/formats/index.d.ts +0 -3
- package/dist/components/form/OneClickForm/components/DataField/index.d.ts +0 -10
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldAddressInput/autofill.hook.d.ts +0 -10
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldAddressInput/autofill.hook.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldAddressInput/hook.d.ts +0 -20
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldAddressInput/hook.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldAddressInput/index.d.ts +0 -6
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldAddressInput/index.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldAddressInput/types.d.ts +0 -25
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldDateInput.d.ts +0 -6
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldDateInput.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldImageInput.d.ts +0 -6
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldImageInput.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldPhoneInput.d.ts +0 -2
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldPhoneInput.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldSSNInput.d.ts +0 -6
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldSSNInput.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldSelectInput.d.ts +0 -5
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldSelectInput.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldTextInput.d.ts +0 -5
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldTextInput.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/inputs/index.d.ts +0 -7
- package/dist/components/form/OneClickForm/components/DataField/types.d.ts +0 -19
- package/dist/components/form/OneClickForm/components/DataField/types.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/utils/defaults.d.ts +0 -4
- package/dist/components/form/OneClickForm/components/DataField/utils/defaults.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/utils/getAutoCompleteAttributeValue.d.ts +0 -6
- package/dist/components/form/OneClickForm/components/DataField/utils/getAutoCompleteAttributeValue.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/utils/getCredentialLabel.d.ts +0 -7
- package/dist/components/form/OneClickForm/components/DataField/utils/getCredentialLabel.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/utils/getCredentialLabelInput.d.ts +0 -7
- package/dist/components/form/OneClickForm/components/DataField/utils/getCredentialLabelInput.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/utils/getCredentialSeparator.d.ts +0 -1
- package/dist/components/form/OneClickForm/components/DataField/utils/getCredentialSeparator.mjs +0 -1
- package/dist/components/form/OneClickForm/components/DataField/utils/hasSomeRequiredEmptyCredential.d.ts +0 -2
- package/dist/components/form/OneClickForm/components/DataField/utils/index.d.ts +0 -5
- package/dist/components/form/OneClickForm/components/shared/CountrySelector.d.ts +0 -10
- package/dist/components/form/OneClickForm/components/shared/DefaultInput.d.ts +0 -6
- package/dist/components/form/OneClickForm/components/shared/IMaskInput.d.ts +0 -15
- package/dist/components/form/OneClickForm/components/shared/Image.d.ts +0 -16
- package/dist/components/form/OneClickForm/components/shared/Image.mjs +0 -1
- package/dist/components/form/OneClickForm/components/shared/ImageEncoded.d.ts +0 -14
- package/dist/components/form/OneClickForm/components/shared/ImageEncoded.mjs +0 -1
- package/dist/components/form/OneClickForm/components/shared/InputMask.d.ts +0 -26
- package/dist/components/form/OneClickForm/components/shared/TextInput.d.ts +0 -15
- package/dist/components/form/OneClickForm/components/shared/TextMaskCustom.d.ts +0 -15
- package/dist/components/form/OneClickForm/components/shared/Textarea.d.ts +0 -14
- package/dist/components/form/OneClickForm/components/shared/When.d.ts +0 -17
- package/dist/components/form/OneClickForm/components/shared/When.mjs +0 -1
- package/dist/components/form/OneClickForm/components/validations/fragments/birthDate.d.ts +0 -6
- package/dist/components/form/OneClickForm/components/validations/fragments/birthDate.mjs +0 -1
- package/dist/components/form/OneClickForm/components/validations/fragments/credentials.d.ts +0 -7
- package/dist/components/form/OneClickForm/components/validations/fragments/credentials.mjs +0 -1
- package/dist/components/form/OneClickForm/components/validations/fragments/email.d.ts +0 -2
- package/dist/components/form/OneClickForm/components/validations/fragments/email.mjs +0 -1
- package/dist/components/form/OneClickForm/components/validations/fragments/otp.d.ts +0 -2
- package/dist/components/form/OneClickForm/components/validations/fragments/phone.d.ts +0 -3
- package/dist/components/form/OneClickForm/components/validations/fragments/uuid.d.ts +0 -2
- package/dist/components/form/OneClickForm/components/validations/schemas/date.schema.d.ts +0 -2
- package/dist/components/form/OneClickForm/components/validations/schemas/date.schema.mjs +0 -1
- package/dist/components/form/OneClickForm/constants/credentialTypes.d.ts +0 -9
- package/dist/components/form/OneClickForm/constants/credentialTypes.mjs +0 -1
- package/dist/components/form/OneClickForm/constants/index.d.ts +0 -1
- package/dist/components/form/OneClickForm/contexts/one-click-form-options.context.d.ts +0 -34
- package/dist/components/form/OneClickForm/contexts/one-click-form-options.context.mjs +0 -1
- package/dist/components/form/OneClickForm/hooks/useCanFillByQueryParam.d.ts +0 -5
- package/dist/components/form/OneClickForm/hooks/useCanFillByQueryParam.mjs +0 -1
- package/dist/components/form/OneClickForm/hooks/useDebounce.d.ts +0 -1
- package/dist/components/form/OneClickForm/hooks/useDebounceCallback.d.ts +0 -46
- package/dist/components/form/OneClickForm/hooks/useDebounceCallback.mjs +0 -1
- package/dist/components/form/OneClickForm/hooks/usePrevious.d.ts +0 -5
- package/dist/components/form/OneClickForm/hooks/useZipCodeLookup.d.ts +0 -11
- package/dist/components/form/OneClickForm/index.d.ts +0 -15
- package/dist/components/form/OneClickForm/index.mjs +0 -1
- package/dist/components/form/OneClickForm/styles/input.d.ts +0 -9
- package/dist/components/form/OneClickForm/styles/input.mjs +0 -1
- package/dist/components/form/OneClickForm/types/display-format.d.ts +0 -12
- package/dist/components/form/OneClickForm/types/display-format.mjs +0 -1
- package/dist/components/form/OneClickForm/types/input-format.d.ts +0 -9
- package/dist/components/form/OneClickForm/types/input-format.mjs +0 -1
- package/dist/components/form/OneClickForm/types/request.d.ts +0 -11
- package/dist/components/form/OneClickForm/utils/calendarDateFormatter.d.ts +0 -6
- package/dist/components/form/OneClickForm/utils/calendarDateFormatter.mjs +0 -1
- package/dist/components/form/OneClickForm/utils/compareCredentialData.d.ts +0 -1
- package/dist/components/form/OneClickForm/utils/compareCredentialData.mjs +0 -1
- package/dist/components/form/OneClickForm/utils/currencyRangeFormatter.d.ts +0 -6
- package/dist/components/form/OneClickForm/utils/currencyRangeFormatter.mjs +0 -1
- package/dist/components/form/OneClickForm/utils/date.d.ts +0 -36
- package/dist/components/form/OneClickForm/utils/date.mjs +0 -1
- package/dist/components/form/OneClickForm/utils/formatCredentialValue.d.ts +0 -8
- package/dist/components/form/OneClickForm/utils/formatCredentialValue.mjs +0 -1
- package/dist/components/form/OneClickForm/utils/image.d.ts +0 -2
- package/dist/components/form/OneClickForm/utils/image.mjs +0 -1
- package/dist/components/form/OneClickForm/utils/isAtomicBySchema.d.ts +0 -1
- package/dist/components/form/OneClickForm/utils/isAtomicBySchema.mjs +0 -1
- package/dist/components/form/OneClickForm/utils/isCompositeBySchema.d.ts +0 -1
- package/dist/components/form/OneClickForm/utils/isCompositeBySchema.mjs +0 -1
- package/dist/components/form/OneClickForm/utils/masks.d.ts +0 -3
- package/dist/components/form/OneClickForm/utils/observers.d.ts +0 -33
- package/dist/components/form/OneClickForm/utils/phone.d.ts +0 -31
- package/dist/components/form/OneClickForm/utils/phone.mjs +0 -1
- package/dist/components/form/OneClickForm/utils/phoneNumberFormatter.d.ts +0 -7
- package/dist/components/form/OneClickForm/utils/phoneNumberFormatter.mjs +0 -1
- package/dist/components/form/OneClickForm/utils/regex.d.ts +0 -1
- package/dist/components/form/OneClickForm/utils/regex.mjs +0 -1
- package/dist/components/form/OneClickForm/utils/ssnFormatter.d.ts +0 -7
- package/dist/components/form/OneClickForm/utils/ssnFormatter.mjs +0 -1
- package/dist/components/form/OneClickForm/utils/string.d.ts +0 -14
- package/dist/components/form/OneClickForm/utils/string.mjs +0 -1
- package/dist/components/form/OneClickForm/utils/when.d.ts +0 -10
- package/dist/components/form/OneClickForm/utils/when.mjs +0 -1
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export * from './getCredentialTypeDisplayInfo';
|
|
2
|
-
export * from './isRequiredCredentialDisplayInfo';
|
|
3
|
-
export * from './isValidInputCredential';
|
|
4
|
-
export * from './makeCredentialDisplayInfoList';
|
|
5
|
-
export * from './findCorrectSchemaProperty';
|
|
6
|
-
export * from './getReferencedSchemaNames';
|
|
7
|
-
export * from './getCredentialValues';
|
|
8
|
-
export * from './isNewCredentialAgainstInstance';
|
|
9
|
-
export * from './filterRepeatedCredentials';
|
|
10
|
-
export * from './findCredentialsByType';
|
|
11
|
-
export * from './extractTypesFromSchema';
|
|
12
|
-
export * from './sortCredentialsBySchema';
|
|
13
|
-
export * from './transformToFormObject';
|
|
14
|
-
export * from './transformToFormSchema';
|
|
15
|
-
export * from './getParentPath';
|
|
16
|
-
export * from './getLastPathName';
|
|
17
|
-
export * from './extractChildrenFromCredentialFieldSet';
|
|
18
|
-
export * from './hasMandatoryFieldEmpty';
|
|
19
|
-
export * from './isSomeFieldInputAllowed';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CredentialDisplayInfo } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Checks if a `CredentialDisplayInfo` is a new credential instance.
|
|
4
|
-
*
|
|
5
|
-
* @param {CredentialDisplayInfo} credentialDisplayInfo - The `CredentialDisplayInfo` to check.
|
|
6
|
-
* @returns {boolean} `true` if it's a new instance, `false` otherwise.
|
|
7
|
-
* @throws {Error} Throws an error if `credentialDisplayInfo.originalInstance` is `null`.
|
|
8
|
-
*/
|
|
9
|
-
export declare function isNewCredentialAgainstInstance(credentialDisplayInfo: CredentialDisplayInfo): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import r from"lodash";import{getCredentialValues as t}from"./getCredentialValues.mjs";function a(n){if(n.originalInstance===null)return!1;const e=t(n),i=t(n.originalInstance);return!r.isEqual(e,i)}export{a as isNewCredentialAgainstInstance};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { CredentialDisplayInfo } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Returns true if all the values in the credential display info are empty.
|
|
4
|
-
* @param credentialDisplayInfo
|
|
5
|
-
*/
|
|
6
|
-
export declare function isNewCredentialValues(credentialDisplayInfo: CredentialDisplayInfo): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{getCredentialValues as t}from"./getCredentialValues.mjs";function a(e){return t(e).every(r=>!r)}export{a as isNewCredentialValues};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{MandatoryEnum as o}from"../types.mjs";const t=a=>a.mandatory===o.YES||a.mandatory===o.IF_AVAILABLE;export{t as isRequiredCredentialDisplayInfo};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { CredentialFieldSet } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Recursively checks if any child in the credential field set has allowUserInput set to true
|
|
4
|
-
* in its credentialDisplayInfo.credentialRequest property.
|
|
5
|
-
*/
|
|
6
|
-
export declare function isSomeFieldInputAllowed(fieldSet: CredentialFieldSet): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{extractChildrenFromCredentialFieldSet as a}from"./extractChildrenFromCredentialFieldSet.mjs";function u(l){const t=e=>{var r,n;if(e.type==="PhoneCredential")return!1;if((n=(r=e.credentialDisplayInfo)==null?void 0:r.credentialRequest)!=null&&n.allowUserInput)return!0;const i=a(e);return Object.values(i).some(o=>t(o))};return t(l)}export{u as isSomeFieldInputAllowed};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CredentialDisplayInfo } from '../types';
|
|
2
|
-
type Options = {
|
|
3
|
-
phoneCredentialWhitelist?: string[];
|
|
4
|
-
phoneCredentialRegexWhitelist?: string;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Checks the validity of the credential based on the schema input pattern.
|
|
8
|
-
*/
|
|
9
|
-
export declare const isValidInputCredential: (value: string, schemaProperty: any | undefined, credentialDisplayInfo: CredentialDisplayInfo, options?: Options) => {
|
|
10
|
-
success: boolean;
|
|
11
|
-
error?: string;
|
|
12
|
-
} | undefined;
|
|
13
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{InputFormatEnum as a}from"../../../types/input-format.mjs";import{when as p}from"../../../utils/when.mjs";import{defaultTextSchema as f,phoneSchema as h,emailSchema as d,timestampSchema as S}from"../../validations/fragments/credentials.mjs";import{minimumDate1900Schema as P,minimumAge18Schema as g}from"../../validations/fragments/birthDate.mjs";import{SSNSchema as y}from"../../../../../../validations/ssn.schema.mjs";import{credentialTypes as v}from"../../../constants/credentialTypes.mjs";const x=(o,s,c,l)=>{var t,i;const{phoneCredentialWhitelist:u,phoneCredentialRegexWhitelist:n}=l??{};if(Array.isArray(c.children))return{success:!0};const e=String(o);return(t=s?.input)!=null&&t.pattern?{success:new RegExp(s.input.pattern).test(e)}:p((i=s?.input)==null?void 0:i.type,{[a.Date]:()=>{var r;if(!S.safeParse(e).success)return{success:!1,error:""};if(!P.safeParse(e).success)return{success:!1,error:""};if(c.credentialRequest.type===v.BirthDateCredential){const m=g.safeParse(e);if(!m.success)return{success:!1,error:(r=m.error)==null?void 0:r.errors[0].message}}return{success:!0}},[a.Email]:()=>({success:d.safeParse(e).success}),[a.Phone]:()=>n&&new RegExp(n).test(e)?{success:!0}:Array.isArray(u)&&u.some(r=>r===e)?{success:!0}:{success:h.safeParse(e).success},[a.SSN]:()=>e.includes("\u2022\u2022\u2022-\u2022\u2022-")?{success:!0}:{success:y.safeParse(e).success},else:()=>({success:f.safeParse(e).success})})};export{x as isValidInputCredential};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CredentialDisplayInfo, CredentialRequests, Credentials, MandatoryEnum } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Orders credentials by the order from the list of credential requests.
|
|
4
|
-
* Used for displaying credentials on the Request page
|
|
5
|
-
* @param {Credentials[]} credentials the credentials to order
|
|
6
|
-
* @param {CredentialRequests[]} credentialRequests the credential requests to order by
|
|
7
|
-
* @param {any} schema the schema to use to get the display info for each credential
|
|
8
|
-
* @param options Attributes or properties to cascade down to children
|
|
9
|
-
* @returns {CredentialDisplayInfo[]} the ordered credential display info
|
|
10
|
-
*/
|
|
11
|
-
export declare const makeCredentialDisplayInfoList: (credentials: Credentials[], credentialRequests: CredentialRequests[], schema: any, options?: {
|
|
12
|
-
allowUserInput?: boolean;
|
|
13
|
-
mandatory?: MandatoryEnum;
|
|
14
|
-
}) => CredentialDisplayInfo[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import y from"lodash";import{v4 as S}from"uuid";import{isCompositeBySchema as b}from"../../../utils/isCompositeBySchema.mjs";import{compareCredentialData as k}from"../../../utils/compareCredentialData.mjs";import{MandatoryEnum as M}from"../types.mjs";import{filterRepeatedCredentials as N}from"./filterRepeatedCredentials.mjs";import{getReferencedSchemaNames as O}from"./getReferencedSchemaNames.mjs";import{getCredentialTypeDisplayInfo as R}from"./getCredentialTypeDisplayInfo.mjs";import{isRequiredCredentialDisplayInfo as q}from"./isRequiredCredentialDisplayInfo.mjs";import{sortCredentialsBySchema as B}from"./sortCredentialsBySchema.mjs";const c=(u,f,l,n)=>{const I=!n,p=(t,e,a)=>{var r;const o=R(a,t.type),i=Array.isArray(t.data),C=e.description??"",m=(r=Object.values(t.data??{}))==null?void 0:r[0],s={...e,mandatory:e.mandatory??n?.mandatory??M.NO,allowUserInput:e.allowUserInput??n?.allowUserInput??!1,description:C},U=q({mandatory:s.mandatory}),D=A=>({type:A.type,mandatory:e.mandatory,allowUserInput:e.allowUserInput??n?.allowUserInput??!1}),g=()=>e.children?e.children:t.data.slice(0).sort(B(t,a)).map(D);return{id:t.uuid,label:o.label,value:i?"":m,isNewCredential:!1,displayFormat:o.displayFormat,children:i?c(t.data,g(),a,n??{allowUserInput:e.allowUserInput,mandatory:e.mandatory}):void 0,credentialRequest:s,schema:o.schema,credential:t,instances:[],originalInstance:null,uiState:{isEditMode:!1,isChecked:i||U?!0:m.length>0,isValid:!(s!=null&&s.allowUserInput),isDirty:!1,errorMessage:null}}},h=(t,e)=>y.chain(t).filter(a=>a.type===e.type).uniqWith(k).map(a=>p(a,e,l)).value(),d=({type:t})=>{const e=l[t];let a,r;b(e)?r=O(e,1).map(i=>d({type:i})):(a=e.properties,r={[Object.keys(a)[0]]:""});const o=S();return{uuid:o,id:o,type:t,data:r,createdAt:+new Date,updatedAt:+new Date}},w=t=>{const e=u.filter(i=>i.type===t.type);let a=e[0];a||(a=d({type:t.type}));const r=p(a,t,l),o=I?h(e,t):[];return r.instances=o,r.originalInstance=y.cloneDeep(r),r},v=t=>!!t;return N(f.map(w).filter(v))};export{c as makeCredentialDisplayInfoList};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{extractTypesFromSchema as a}from"./extractTypesFromSchema.mjs";const m=(t,r)=>(o,p)=>{const s=r[t.type],e=a(s);return e.indexOf(o.type)-e.indexOf(p.type)};export{m as sortCredentialsBySchema};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{stringUtils as d}from"../../../utils/string.mjs";import{when as p}from"../../../utils/when.mjs";const m=(r,t,e)=>p(t,{GovernmentIdDocumentImageCredential:()=>"documentImage",else:()=>r});function i(r){const t={};for(const e of r){const n=e.credentialRequest.type,o=d.camelCase(n.split("Credential").join("")),s=Object.keys(e.schema.properties??{})[0],a=m(s??o,n,Array.isArray(e.children));Array.isArray(e.children)?t[a]=e.children.reduce((l,c)=>({...l,...i([c])}),{id:e.id,value:e.value,type:e.credentialRequest.type,credentialDisplayInfo:e}):t[a]={id:e.id,value:e.value,type:e.credentialRequest.type,credentialDisplayInfo:e}}return t}export{i as transformToFormObject};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { OneClickFormOptions } from '../../../contexts/one-click-form-options.context';
|
|
2
|
-
import { CredentialFieldSet } from '../types';
|
|
3
|
-
import * as zod from 'zod';
|
|
4
|
-
type Options = {
|
|
5
|
-
schema: any;
|
|
6
|
-
};
|
|
7
|
-
type Context = {
|
|
8
|
-
parentFieldSet?: CredentialFieldSet;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Transforms the display info list into a form schema.
|
|
12
|
-
* @param displayInfoList
|
|
13
|
-
*/
|
|
14
|
-
export declare function transformToFormSchema(fieldSet: CredentialFieldSet, options: Options, oneClickFormOptions: OneClickFormOptions, context?: Context): zod.ZodObject<any>;
|
|
15
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import*as e from"zod";import{isValidInputCredential as D}from"./isValidInputCredential.mjs";import{findCorrectSchemaProperty as v}from"./findCorrectSchemaProperty.mjs";import{extractChildrenFromCredentialFieldSet as y}from"./extractChildrenFromCredentialFieldSet.mjs";import{credentialTypes as S}from"../../../constants/credentialTypes.mjs";function h(g,d,o,a){const l={},I=y(g);for(const[p,f]of Object.entries(I)){const C=y(f),u=Object.entries(C);u.length>0?l[p]=e.object(u.reduce((t,[n,s])=>{const r={[n]:s};return{...t,...h(r,d,o,{parentFieldSet:f}).shape}},{id:e.string(),value:e.string(),type:e.string(),credentialDisplayInfo:e.any()})):l[p]=e.object({id:e.string(),value:e.string(),type:e.string(),credentialDisplayInfo:e.any()}).superRefine((t,n)=>{var s,r;if((s=t.credentialDisplayInfo.uiState)!=null&&s.isChecked)if(t.value===""){const c=((r=t.credentialDisplayInfo.credentialRequest)==null?void 0:r.type)===S.BirthDateCredential;n.addIssue({code:e.ZodIssueCode.custom,message:c?"":`${t.credentialDisplayInfo.label} is empty`})}else{const c=v(t.credentialDisplayInfo.schema,d.schema,a!=null&&a.parentFieldSet?a.parentFieldSet:void 0),i=D(t.value,c,t.credentialDisplayInfo,{phoneCredentialWhitelist:o.features.phoneCredentialWhitelist,phoneCredentialRegexWhitelist:o.features.phoneCredentialRegexWhitelist});if(!(i!=null&&i.success)||typeof i=="object"&&typeof i.error=="string"){const m=typeof i=="object"&&typeof i.error=="string"&&i.error,b=`${t.credentialDisplayInfo.label} is invalid`;n.addIssue({code:e.ZodIssueCode.custom,message:typeof m=="string"?m:b})}}})}return e.object(l)}export{h as transformToFormSchema};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{Stack as s}from"@mui/material";import{DisplayFormatEnum as y}from"../../types/display-format.mjs";import{when as d}from"../../utils/when.mjs";import{When as S}from"../shared/When.mjs";import{useCredentialsDisplay as g}from"../CredentialsDisplay/CredentialsDisplayContext.mjs";import{useCredentialsDisplayItem as v}from"../CredentialsDisplay/CredentialsDisplayItemContext.mjs";import{InputFormatEnum as a}from"./types.mjs";import{jsxs as C,jsx as e}from"react/jsx-runtime";import{credentialTypes as r}from"../../constants/credentialTypes.mjs";import{DataFieldLeftSide as x}from"./DataFieldLeftSide.mjs";import{findCorrectSchemaProperty as b}from"../CredentialsDisplay/utils/findCorrectSchemaProperty.mjs";import{DataFieldTextInput as w}from"./inputs/DataFieldTextInput.mjs";import{DataFieldImageInput as P}from"./inputs/DataFieldImageInput.mjs";import{DataFieldSelectInput as j}from"./inputs/DataFieldSelectInput.mjs";import{DataFieldSSNInput as E}from"./inputs/DataFieldSSNInput.mjs";import{DataFieldPhoneInput as T}from"./inputs/DataFieldPhoneInput.mjs";import{DataFieldDateInput as k}from"./inputs/DataFieldDateInput.mjs";import{DataFieldHeader as A}from"./DataFieldHeader/index.mjs";import{DataFieldText as L}from"./formats/DataFieldText.mjs";import{DataFieldImage as M}from"./formats/DataFieldImage.mjs";function N(){const{schema:p}=g(),{credentialDisplayInfo:t,objectController:l,parentFieldSet:i,isRoot:c}=v(),f=t.instances.length>1,o=t.uiState.isEditMode,u=l.field.value.type,D={width:"calc(100%)"},F=()=>{var n;const m=b(t.schema,p,i);return d((n=m?.input)==null?void 0:n.type,{[a.Date]:()=>e(k,{}),[a.Phone]:()=>e(T,{}),[a.SSN]:()=>e(E,{}),[a.Select]:()=>e(j,{}),[a.Image]:()=>e(P,{}),else:()=>e(w,{})})},h=()=>f?e(S,{value:c&&!o,children:e(A,{block:!0})}):d(t?.displayFormat,{[y.Image]:()=>e(M,{}),else:()=>e(L,{})}),I=()=>o?F():h();return i?.type===r.AddressCredential&&(l.field.value.type!==r.Line2Credential||!o)||u===r.PhoneCredential?null:C(s,{component:"section",role:"region","aria-label":typeof t.label=="string"?t.label:"Credential field","data-testid":"data-field-atomic","data-credentialid":t.id,sx:{width:"100%",outline:"none"},direction:"row",alignItems:"center",children:[e(x,{}),e(s,{direction:"column",sx:D,children:I()})]})}export{N as DataFieldAtomic};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* This component renders and manages the check for atomic and composite level,
|
|
4
|
-
* when composite, it controls the children also by selecting/deselecting them.
|
|
5
|
-
* @constructor
|
|
6
|
-
*/
|
|
7
|
-
export declare function DataFieldCheckbox(): ReactElement | null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{Checkbox as l}from"@mui/material";import{useOneClickFormOptions as d}from"../../contexts/one-click-form-options.context.mjs";import{useCredentialsDisplayItem as p}from"../CredentialsDisplay/CredentialsDisplayItemContext.mjs";import{jsx as m}from"react/jsx-runtime";import{isRequiredCredentialDisplayInfo as c}from"../CredentialsDisplay/utils/isRequiredCredentialDisplayInfo.mjs";function f(){var t;const{options:{features:{selectableCredentials:o}}}=d(),{credentialDisplayInfo:i,isChecked:e,isAllChecked:r,handleSelectCredential:n}=p(),s=c({mandatory:(t=i.credentialRequest)==null?void 0:t.mandatory});return o?m(l,{sx:{mr:1,alignSelf:"flex-start"},checked:e,indeterminate:e&&!r,onChange:a=>{a.stopPropagation(),n(!e)},onClick:a=>{a.stopPropagation()},disabled:s,inputProps:{tabIndex:-1}}):null}export{f as DataFieldCheckbox};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{InputAdornment as m,IconButton as p}from"@mui/material";import{Close as c}from"@mui/icons-material";import{useCredentialsDisplayItem as f}from"../CredentialsDisplay/CredentialsDisplayItemContext.mjs";import{jsx as n}from"react/jsx-runtime";function v({onClick:r,disabled:t}){const{isDisabled:a,handleClearValueCredential:s}=f(),u=l=>{var e,o,i,d;return((o=(e=l.parentElement)==null?void 0:e.parentElement)==null?void 0:o.querySelector("input"))??((d=(i=l.parentElement)==null?void 0:i.parentElement)==null?void 0:d.querySelector("textarea"))};return n(m,{position:"end",children:n(p,{tabIndex:-1,"aria-label":"clear value",edge:"end",size:"small",onClick:l=>{var e;(t??a)||((e=u(l.currentTarget))==null||e.focus(),s(),r?.())},disabled:t??a,children:n(c,{fontSize:"small"})})})}export{v as DataFieldClearAdornment};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ReactElement, ReactNode } from 'react';
|
|
2
|
-
type DataFieldCompositeProps = {
|
|
3
|
-
children?: ReactNode | ReactNode[] | undefined;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* This component renders a composite level credential, followed by child of atomic/composite credentials.
|
|
7
|
-
* @param props
|
|
8
|
-
* @constructor
|
|
9
|
-
*/
|
|
10
|
-
export declare function DataFieldComposite(props: DataFieldCompositeProps): ReactElement | null;
|
|
11
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{Box as t,Stack as o}from"@mui/material";import{when as b}from"../../utils/when.mjs";import{When as n}from"../shared/When.mjs";import{useCredentialsDisplayItem as g}from"../CredentialsDisplay/CredentialsDisplayItemContext.mjs";import{DataFieldHeader as w}from"./DataFieldHeader/index.mjs";import{DataFieldLeftSide as s}from"./DataFieldLeftSide.mjs";import{jsxs as a,Fragment as y,jsx as e}from"react/jsx-runtime";import{credentialTypes as c}from"../../constants/credentialTypes.mjs";import{DataFieldAddressInput as C}from"./inputs/DataFieldAddressInput/index.mjs";function D(m){const{children:f}=m,{credentialDisplayInfo:i,objectController:l,isRoot:p}=g(),r=i.uiState.isEditMode,h={width:"100%","&:not(:last-child)":{}},u=()=>r?b(l.field.value.type,{[c.AddressCredential]:()=>e(C,{}),else:()=>null}):null,x=()=>l.field.value.type===c.AddressCredential,d=u();return a(y,{children:[e(n,{value:!r&&x(),children:e(t,{component:"section",role:"region","aria-label":typeof i.label=="string"?i.label:"Credential field",width:"100%","data-testid":"data-field-composite2","data-credentialid":i.id,children:a(o,{direction:"row",alignItems:"center",sx:{flex:1,flexShrink:1,width:"100%"},children:[e(s,{}),e(t,{sx:h,children:e(n,{value:p,children:e(w,{block:!0})})})]})})}),d&&a(o,{role:"region","aria-label":typeof i.label=="string"?i.label:"Credential field",component:"section",direction:"row",alignItems:"center",sx:{flex:1,flexShrink:1,width:"100%"},children:[e(s,{}),e(t,{width:"100%","data-testid":"data-field-composite","data-credentialid":i.id,children:d})]}),f]})}export{D as DataFieldComposite};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function DataFieldDescription(): import("react").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{Typography as e}from"@mui/material";import{useCredentialsDisplayItem as o}from"../CredentialsDisplay/CredentialsDisplayItemContext.mjs";import{jsx as i}from"react/jsx-runtime";function a(){var r;const{credentialDisplayInfo:t}=o();return i(e,{variant:"body1",color:"text.secondary",sx:{fontSize:12,fontWeight:400,wordBreak:"break-word",mt:.5,mr:1.75,textAlign:"left"},children:(r=t.credentialRequest)==null?void 0:r.description})}export{a as DataFieldDescription};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { SxProps } from '@mui/material';
|
|
3
|
-
type DataFieldGroupProps = PropsWithChildren & {
|
|
4
|
-
sx?: SxProps;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Component used to group the other data field elements, should not use other than this.
|
|
8
|
-
* @param children
|
|
9
|
-
* @param sx
|
|
10
|
-
* @constructor
|
|
11
|
-
*/
|
|
12
|
-
export declare function DataFieldGroup({ children, sx }: DataFieldGroupProps): import("react").JSX.Element;
|
|
13
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{useRef as f,useState as h,useMemo as b,useEffect as g}from"react";import{TextField as v}from"@mui/material";import{inputStyle as x}from"../../../../styles/input.mjs";import{useCredentialsDisplayItem as y}from"../../../CredentialsDisplay/CredentialsDisplayItemContext.mjs";import{isNewCredentialValues as o}from"../../../CredentialsDisplay/utils/isNewCredentialValues.mjs";import{styles as S}from"./styles.mjs";import{jsx as I}from"react/jsx-runtime";import{renderInstance as w}from"./utils/renderInstance.mjs";function M(){const{credentialDisplayInfo:t,handleChangeCredentialInstance:l}=y(),i=S(),s=o(t),n=f(void 0),[p,d]=h(void 0),r=b(()=>(t.instances.length>0?t.instances:[]).filter(e=>!o(e)).map(e=>e.id===t.id?t:e),[t]),c={...x,ref:e=>{e&&(n.current=e)},select:!0,variant:"outlined","aria-label":r.length<=1?`Current ${t.label}`:`Select ${t.label}`,value:s?void 0:t.id,helperText:t.credentialRequest.description,onChange:e=>{e.stopPropagation(),e.preventDefault(),l(e.target.value)},InputProps:{tabIndex:r.length<=1?-1:0,readOnly:r.length<=1},SelectProps:{size:"small",onClose:e=>{e.stopPropagation(),e.preventDefault()},MenuProps:{slotProps:{paper:{sx:{width:p}}}}},sx:{width:"100%",...i.fieldInputDisabledStyle,...r.length<=1&&i.fieldInputReadonlyStyle,'& div[role="combobox"]':{width:"100%",height:"auto",overflow:"hidden",whiteSpace:"break-spaces!important"},"& .MuiSelect-select":{display:"block",alignItems:"center",whiteSpace:"break-spaces!important"},"& .Mui-disabled .MuiOutlinedInput-notchedOutline":{border:"none"},"& .Mui-disabled.MuiSelect-icon":{display:"none"},"& .Mui-disabled":{color:e=>`${e.palette.text.primary}`,WebkitTextFillColor:e=>`${e.palette.text.primary}`},"& .MuiFormHelperText-root":{ml:r.length<=1?0:void 0}}};return g(()=>{const e=n.current;if(!e)return;const a=new ResizeObserver(u=>{for(const m of u)d(`${m.contentRect.width}px`)});return a.observe(e),()=>{a.disconnect()}},[]),I(v,{...c,children:r.map(w())})}export{M as HeaderSelect};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=()=>({menuStyle:{maxWidth:"100%",whiteSpace:"pre-wrap",flexWrap:"wrap","& *":{display:"inline-flex"},"& div":{width:"fit-content",height:"fit-content"},"& img.MuiBox-root, & .image-encoded-skeleton-container, & .MuiSkeleton-root":{display:"inline-flex",width:"100px",height:"100px"}},fieldInputEnabledStyle:{"& .MuiInputBase-root::before, & .MuiInputBase-root::after":{display:"none !important"},"& .MuiSelect-icon":{display:"none"}},fieldInputDisabledStyle:{pointerEvents:"auto"},blockStyle:{display:"inline-flex"},fieldInputReadonlyStyle:{"& .MuiInputBase-readOnly":{p:0,userSelect:"auto",cursor:"text",lineHeight:1.5},"& fieldset.MuiOutlinedInput-notchedOutline":{border:"none!important"},"& svg.MuiSvgIcon-root":{display:"none"}}});export{e as styles};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{toUSaddressPretty as r}from"../../../../../../../../utils/address/index.mjs";import{transformToFormObject as o}from"../../../../CredentialsDisplay/utils/transformToFormObject.mjs";function a(t){const{address:e}=o([t]);return r({line1:e.line1.value,line2:e.line2.value,city:e.city.value,state:e.state.value,zipCode:e.zipCode.value,country:e.country.value})}export{a as getAddressFormat};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './renderInstance';
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { CredentialDisplayInfo } from '../../../../CredentialsDisplay/types';
|
|
3
|
-
export declare const renderInstance: (renderAsString: boolean) => (credentialDisplayInfo: CredentialDisplayInfo) => string | import("react").JSX.Element | (string | ReactElement<any, string | import('react').JSXElementConstructor<any>>)[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{Fragment as d}from"react";import{MenuItem as h,Box as f}from"@mui/material";import{DisplayFormatEnum as y}from"../../../../../types/display-format.mjs";import{useOneClickFormOptions as g}from"../../../../../contexts/one-click-form-options.context.mjs";import{formatCredentialValue as x}from"../../../../../utils/formatCredentialValue.mjs";import{ImageEncoded as v}from"../../../../shared/ImageEncoded.mjs";import{styles as A}from"../styles.mjs";import{getAddressFormat as F}from"./getAddressFormat.mjs";import{jsx as a,jsxs as C,Fragment as k}from"react/jsx-runtime";import{credentialTypes as I}from"../../../../../constants/credentialTypes.mjs";import{getCredentialSeparator as P}from"../../../utils/getCredentialSeparator.mjs";const b=S=>o=>{const s=A(),c=g(),n=e=>{const i=x(e.value,e.displayFormat);return e.displayFormat===y.Image?a(f,{component:"div",sx:s.blockStyle,children:a(v,{servicePath:c.options.servicePaths.credentialImagePath,src:e.value,alt:e.label,sx:{"& > img":{width:"40px",height:"40px",objectFit:"contain"},width:"40px",height:"40px"}})},e.id):a(d,{children:i},e.id)},m=e=>{var i;if(!Array.isArray(e.children))return n(e);if(Array.isArray(e.children)&&e.credentialRequest.type===I.AddressCredential){const r=F(e);if(r)return r}const l=P((i=e.credentialRequest)==null?void 0:i.type);return e.children.reduce((r,t)=>(t.value&&r.push(n(t)),Array.isArray(t.children)&&r.push(...m(t).flat(1/0)),r),[]).filter(Boolean).map((r,t,p)=>{const u=!!p[t+1];return C(d,{children:[r,u&&a(k,{children:l===" "?" ":l??""})]},typeof r=="string"?r:r.key)})};return a(h,{value:o.id,sx:s.menuStyle,onClick:e=>{e.stopPropagation()},children:m(o)},o.id)};export{b as renderInstance};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
type DataFieldHeaderProps = Readonly<{
|
|
3
|
-
block?: boolean;
|
|
4
|
-
onFocus?: () => void;
|
|
5
|
-
}>;
|
|
6
|
-
/**
|
|
7
|
-
* This component renders the select for the composite level credential, it manages the selection
|
|
8
|
-
* of desired credential to be used.
|
|
9
|
-
* @constructor
|
|
10
|
-
*/
|
|
11
|
-
export declare function DataFieldHeader(props: DataFieldHeaderProps): ReactElement;
|
|
12
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{Box as e}from"@mui/material";import{HeaderSelect as o}from"./HeaderSelect/index.mjs";import{DataFieldLabel as s}from"../DataFieldLabel.mjs";import{jsx as a,jsxs as d}from"react/jsx-runtime";function l(i){const r={display:"flex",flexGrow:1,width:"100%"},t={width:i.block?"100%":"auto",minWidth:"150px",maxWidth:"100%",display:"flex"};return a(e,{sx:r,children:d(e,{sx:t,children:[a(s,{}),a(o,{})]})})}export{l as DataFieldHeader};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren, ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { SxProps } from '@mui/material';
|
|
3
|
-
type DataFieldLabelInputProps = PropsWithChildren & {
|
|
4
|
-
label?: ReactNode;
|
|
5
|
-
sx?: SxProps;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Component to display a credential label.
|
|
9
|
-
* @param label
|
|
10
|
-
* @param sx
|
|
11
|
-
* @constructor
|
|
12
|
-
*/
|
|
13
|
-
export declare function DataFieldInputLabel({ label, sx, }: DataFieldLabelInputProps): ReactElement;
|
|
14
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{Typography as a}from"@mui/material";import{useCredentialsDisplayItemValid as t}from"../CredentialsDisplay/hooks.mjs";import{jsx as l}from"react/jsx-runtime";function i({label:e,sx:r}){const o=t();return l(a,{component:"span",color:o.isValid?"primary":"error",sx:{position:"relative",transform:"translateX(-14px) scale(0.75)",fontSize:16,zIndex:1,cursor:"default",lineHeight:"23px",textOverflow:"ellipsis",userSelect:"none",whiteSpace:"collapse",backgroundColor:"background",alignSelf:"flex-start",...r},children:e})}export{i as DataFieldInputLabel};
|
package/dist/components/form/OneClickForm/components/DataField/DataFieldInputModeHeader.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { SxProps } from '@mui/material';
|
|
3
|
-
type DataFieldInputModeHeaderProps = {
|
|
4
|
-
sx?: SxProps;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Component that displays the header on input mode for a data field.
|
|
8
|
-
* @constructor
|
|
9
|
-
*/
|
|
10
|
-
export declare function DataFieldInputModeHeader(props: Readonly<DataFieldInputModeHeaderProps>): ReactElement | null;
|
|
11
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{Stack as r,Typography as l}from"@mui/material";import{useCredentialsDisplayItem as n}from"../CredentialsDisplay/CredentialsDisplayItemContext.mjs";import{jsx as e}from"react/jsx-runtime";import{getCredentialLabel as s}from"./utils/getCredentialLabel.mjs";function o({id:a}){const{credentialDisplayInfo:t}=n(),i=s(t.label,t.credentialRequest.type);return e(r,{sx:{flexShrink:0,alignItems:"flex-start",justifyContent:"flex-start",width:100,mt:.7},children:e(l,{component:"span",variant:"subtitle2",textTransform:"uppercase",color:"text.primary",id:a,sx:{position:"relative",fontSize:12,fontWeight:700,textAlign:"left",alignSelf:"flex-start",letterSpacing:1},children:i})})}export{o as DataFieldLabel};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
type DataFieldLabelTextProps = {
|
|
3
|
-
prefix?: string;
|
|
4
|
-
hideRequired?: boolean;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Component to display a credential label text, when required it renders an asterisk.
|
|
8
|
-
* @constructor
|
|
9
|
-
*/
|
|
10
|
-
export declare function DataFieldLabelText(props: DataFieldLabelTextProps): ReactElement;
|
|
11
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{Box as s,Typography as n}from"@mui/material";import{useCredentialsDisplayItem as o}from"../CredentialsDisplay/CredentialsDisplayItemContext.mjs";import{getCredentialLabelInput as l}from"./utils/getCredentialLabelInput.mjs";import{jsxs as p,jsx as i,Fragment as d}from"react/jsx-runtime";import{isRequiredCredentialDisplayInfo as m}from"../CredentialsDisplay/utils/isRequiredCredentialDisplayInfo.mjs";function c(e){var a;const{credentialDisplayInfo:r}=o(),t=l(r.label,r.credentialRequest.type);return m({mandatory:(a=r.credentialRequest)==null?void 0:a.mandatory})?p(s,{component:"span",sx:{display:"block",alignItems:"center",overflow:"hidden",textOverflow:"ellipsis",whitespace:"pre"},children:[(e.prefix??"")+t," ",!e.hideRequired&&i(n,{"data-asterisk":!0,component:"span",color:"error",variant:"subtitle2",sx:{fontSize:"inherit"},children:"\u273D"})]}):i(d,{children:(e.prefix??"")+t})}export{c as DataFieldLabelText};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{DataFieldCheckbox as t}from"./DataFieldCheckbox.mjs";import{jsx as e}from"react/jsx-runtime";function a(){return e(t,{})}export{a as DataFieldLeftSide};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { SxProps } from '@mui/material';
|
|
3
|
-
type DataFieldLegendProps = PropsWithChildren & {
|
|
4
|
-
sx?: SxProps;
|
|
5
|
-
error?: boolean;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Component to display a credential legend.
|
|
9
|
-
* @param children
|
|
10
|
-
* @param sx
|
|
11
|
-
* @constructor
|
|
12
|
-
*/
|
|
13
|
-
export declare function DataFieldLegend({ children, sx, ...props }: DataFieldLegendProps): import("react").JSX.Element;
|
|
14
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{FormHelperText as t}from"@mui/material";import{jsx as m}from"react/jsx-runtime";function i({children:r,sx:e,...o}){return m(t,{...o,sx:{mt:1,...e},children:r})}export{i as DataFieldLegend};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
-
import { SxProps } from '@mui/material';
|
|
3
|
-
type DataFieldPaperProps = PropsWithChildren & {
|
|
4
|
-
sx?: SxProps;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Component used to wrap data field types.
|
|
8
|
-
* @param children
|
|
9
|
-
* @param sx
|
|
10
|
-
* @constructor
|
|
11
|
-
*/
|
|
12
|
-
export declare function DataFieldPaper({ children, sx, }: DataFieldPaperProps): ReactElement;
|
|
13
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { StackProps } from '@mui/material';
|
|
3
|
-
/**
|
|
4
|
-
* This component renders a sequence of data field atomic/composite credentials and spaces them.
|
|
5
|
-
* @param props
|
|
6
|
-
* @constructor
|
|
7
|
-
*/
|
|
8
|
-
export declare function DataFieldRootStack(props: StackProps): ReactElement;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{useFormContext as e}from"react-hook-form";import{useCredentialsDisplay as r}from"../CredentialsDisplay/CredentialsDisplayContext.mjs";import{DataFieldStack as s}from"./DataFieldStack.mjs";import{jsx as m}from"react/jsx-runtime";import{isSomeFieldInputAllowed as d}from"../CredentialsDisplay/utils/isSomeFieldInputAllowed.mjs";function n(t){const o=r(),i=e().watch(),a=d(i);return m(s,{...t,onClick:()=>{o.isEditMode||!a||o.setEditMode(!0)}})}export{n as DataFieldRootStack};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { StackProps } from '@mui/material';
|
|
3
|
-
/**
|
|
4
|
-
* This component renders a sequence of data field atomic/composite credentials and spaces them.
|
|
5
|
-
* @param props
|
|
6
|
-
* @constructor
|
|
7
|
-
*/
|
|
8
|
-
export declare function DataFieldStack(props: StackProps): ReactElement;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{Stack as s}from"@mui/material";import{useCredentialsDisplay as t}from"../CredentialsDisplay/CredentialsDisplayContext.mjs";import{jsx as a}from"react/jsx-runtime";function r(i){const o=t();return a(s,{direction:"column",...i,sx:{width:"100%",...i.sx},spacing:o.isEditMode?2.125:1.1875})}export{r as DataFieldStack};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
-
import { SxProps } from '@mui/material';
|
|
3
|
-
type DataFieldValueProps = PropsWithChildren & {
|
|
4
|
-
sx?: SxProps;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Component to display a credential value of display type Text.
|
|
8
|
-
* @param children
|
|
9
|
-
* @param sx
|
|
10
|
-
* @constructor
|
|
11
|
-
*/
|
|
12
|
-
export declare function DataFieldValue({ children, sx, }: DataFieldValueProps): ReactElement;
|
|
13
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{Typography as o}from"@mui/material";import{jsx as t}from"react/jsx-runtime";function a({children:r,sx:e}){return t(o,{variant:"body1",sx:{...e,fontSize:20,fontWeight:300,wordBreak:"break-word",textAlign:"left"},children:r})}export{a as DataFieldValue};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{Stack as i}from"@mui/material";import{useOneClickFormOptions as t}from"../../../contexts/one-click-form-options.context.mjs";import{ImageEncoded as o}from"../../shared/ImageEncoded.mjs";import{useCredentialsDisplayItem as s}from"../../CredentialsDisplay/CredentialsDisplayItemContext.mjs";import{jsxs as m,jsx as e}from"react/jsx-runtime";import{DataFieldLabel as l}from"../DataFieldLabel.mjs";function n(){const r=t(),{credentialDisplayInfo:a}=s();return m(i,{direction:"row",width:"100%",children:[e(l,{}),e(i,{direction:"column",sx:{flex:1,maxWidth:100},children:e(o,{servicePath:r.options.servicePaths.credentialImagePath,src:a.value,alt:a.label})})]})}export{n as DataFieldImage};
|
package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldInputAddress.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
type DataFieldInputAddressProps = {
|
|
3
|
-
hasMultipleInstances: boolean;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* This component renders and manages display format Address.
|
|
7
|
-
* @constructor
|
|
8
|
-
*/
|
|
9
|
-
export declare function DataFieldInputAddress(props: DataFieldInputAddressProps): ReactElement;
|
|
10
|
-
export {};
|
package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldInputSelect.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
type DataFieldInputSelectProps = {
|
|
2
|
-
hasMultipleInstances?: boolean;
|
|
3
|
-
};
|
|
4
|
-
/**
|
|
5
|
-
* This component manages the input of type Select.
|
|
6
|
-
* @constructor
|
|
7
|
-
*/
|
|
8
|
-
export declare function DataFieldInputSelect(props: DataFieldInputSelectProps): import("react").JSX.Element;
|
|
9
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{Stack as i}from"@mui/material";import{formatCredentialValue as m}from"../../../utils/formatCredentialValue.mjs";import{useCredentialsDisplayItem as s}from"../../CredentialsDisplay/CredentialsDisplayItemContext.mjs";import{DataFieldDescription as d}from"../DataFieldDescription.mjs";import{MandatoryEnum as l}from"../../CredentialsDisplay/types.mjs";import{jsx as a,jsxs as t}from"react/jsx-runtime";import{DataFieldLabel as n}from"../DataFieldLabel.mjs";import{DataFieldValue as c}from"../DataFieldValue.mjs";function p(){const{credentialDisplayInfo:r}=s(),e=m(r.value,r.displayFormat),o=r.credentialRequest.mandatory===l.NO;return a("div",{style:{width:"100%"},children:t(i,{direction:"row",width:"100%",children:[a(n,{}),t(i,{direction:"column",children:[a(c,{children:e||o?"-":void 0}),a(d,{})]})]})})}export{p as DataFieldText};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from './DataFieldInputLabel';
|
|
2
|
-
export * from './DataFieldValue';
|
|
3
|
-
export * from './DataFieldGroup';
|
|
4
|
-
export * from './DataFieldLegend';
|
|
5
|
-
export * from './DataFieldLabelText';
|
|
6
|
-
export * from './DataFieldLabel';
|
|
7
|
-
export * from './DataFieldInputModeHeader';
|
|
8
|
-
export * from './DataFieldLeftSide';
|
|
9
|
-
export * from './DataFieldClearAdornment';
|
|
10
|
-
export * from './DataFieldHeader';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Address, PlaceAddressComponent, PlaceSuggestion } from './types';
|
|
2
|
-
type AutoFillHookReturn = {
|
|
3
|
-
handleAutoComplete: (value: string) => Promise<void>;
|
|
4
|
-
fetchPlace: (placeId: string) => Promise<PlaceAddressComponent[] | null>;
|
|
5
|
-
buildAddress: (placeComponents: PlaceAddressComponent[]) => Address;
|
|
6
|
-
suggestions: PlaceSuggestion[];
|
|
7
|
-
isPending: boolean;
|
|
8
|
-
};
|
|
9
|
-
export declare function useAutoFill(): AutoFillHookReturn;
|
|
10
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{useState as c,useRef as y}from"react";import{wrapPromise as l}from"../../../../../../../utils/wrapPromise/index.mjs";import"libphonenumber-js";import"lodash/find";import"tinycolor2";import{useOneClickFormOptions as b}from"../../../../contexts/one-click-form-options.context.mjs";function h(){const u=b(),{googlePlacesAutocompletePlaces:a,googlePlacesGetPlace:i}=u.options.servicePaths??{},[p,d]=c([]),[f,n]=c(!1),r=y(null);return{handleAutoComplete:async o=>{if(!a)return;r.current&&r.current.abort();const e=new AbortController;r.current=e,n(!0);try{const t=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:o}),signal:e.signal});if(e.signal.aborted)return;if(!t.ok){n(!1);return}const[s,g]=await l(t.json());if(e.signal.aborted)return;g||d(s)}catch(t){if(t instanceof DOMException&&t.name==="AbortError")return;console.error("Failed to fetch address suggestions:",t)}finally{r.current===e&&n(!1)}},fetchPlace:async o=>{if(!i)return null;const e=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:o})});if(!e.ok)return null;const[t,s]=await l(e.json());return s?null:t},buildAddress:o=>{const e={line1:"",city:"",state:"",country:"",zipCode:""};for(const t of o??[])switch(t.types[0]){case"street_number":{e.line1=`${t.longText} ${e.line1}`;break}case"route":{e.line1||(e.line1=""),e.line1+=t.shortText;break}case"postal_code":{e.zipCode=`${t.longText}${e.zipCode}`;break}case"postal_code_suffix":{e.zipCode=`${e.zipCode}-${t.longText}`;break}case"locality":e.city=t.longText??"";break;case"sublocality_level_1":case"sublocality":e.city||(e.city=t.longText??"");break;case"neighborhood":e.city||(e.city=t.longText??"");break;case"administrative_area_level_1":{t.shortText&&t.shortText.length===2&&(e.state=t.shortText);break}case"country":e.country=t.shortText??"US";break}return e},suggestions:p,isPending:f}}export{h as useAutoFill};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { useCredentialsDisplayItem } from '../../../CredentialsDisplay/CredentialsDisplayItemContext';
|
|
2
|
-
import { Option, PlaceSuggestion } from './types';
|
|
3
|
-
type DataFieldAddressInputReturn = {
|
|
4
|
-
value: Option;
|
|
5
|
-
inputValue: string;
|
|
6
|
-
suggestions: PlaceSuggestion[];
|
|
7
|
-
isPending: boolean;
|
|
8
|
-
isFetchingPlace: boolean;
|
|
9
|
-
error: string | undefined;
|
|
10
|
-
disabled: boolean;
|
|
11
|
-
handleInputChange: (newInputValue: string, changeOptions?: {
|
|
12
|
-
shouldValidate?: boolean;
|
|
13
|
-
}) => void;
|
|
14
|
-
handleOptionChange: (option: Option) => Promise<void>;
|
|
15
|
-
handleClear: () => void;
|
|
16
|
-
};
|
|
17
|
-
export declare function useDataFieldAddressInput({ credentialsDisplayItem, }: {
|
|
18
|
-
credentialsDisplayItem: ReturnType<typeof useCredentialsDisplayItem>;
|
|
19
|
-
}): DataFieldAddressInputReturn;
|
|
20
|
-
export {};
|
package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldAddressInput/hook.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{useState as s,useMemo as f,useEffect as v}from"react";import{useFormContext as E}from"react-hook-form";import{wrapPromise as M}from"../../../../../../../utils/wrapPromise/index.mjs";import"libphonenumber-js";import"lodash/find";import"tinycolor2";import{toUSaddress as C,fromUSAddress as R}from"../../../../../../../utils/address/index.mjs";import{useDebounceValue as k}from"../../../../../../../hooks/useDebounceValue.mjs";import{usePrevious as B}from"../../../../../../../hooks/usePrevious.mjs";import{useAutoFill as N}from"./autofill.hook.mjs";import{extractChildrenFromCredentialFieldSet as m}from"../../../CredentialsDisplay/utils/extractChildrenFromCredentialFieldSet.mjs";function _({credentialsDisplayItem:o}){const a=E(),{objectController:p}=o,g=p.field.name,t=p.field.value,[b,h]=s(!1),{handleAutoComplete:y,fetchPlace:F,buildAddress:D,suggestions:I,isPending:P}=N(),A=f(()=>{if(o.isDisabled)return!0;for(const[e]of Object.entries(m(t)))if(e!=="line2"&&!a.getValues(`${g}.${e}`).credentialDisplayInfo.credentialRequest.allowUserInput)return!0;return!1},[a,o]),S=f(()=>{var e;for(const[i]of Object.entries(m(t)))if(i!=="line2"&&(e=a.getFieldState(`${g}.${i}`).error)!=null&&e.message)return`${t.credentialDisplayInfo.label} is invalid`},[a]),V=f(()=>C({line1:t.line1.value,city:t.city.value,state:t.state.value,zipCode:t.zipCode.value}),[]),[$,j]=s({title:V??"",value:""}),[u,d]=s(""),O=B(u),r=k(u),[w,x]=s(!1),l=(e,i)=>{let n;typeof e=="string"?n=R(e.replace(/\n/g,"")):(n=e,d(C({...e,country:void 0})??""));for(const[c]of Object.entries(m(t)))c!=="line2"&&o.handleChangeChildValueCredential(c,n?.[c]??"",i)},U=async e=>{if(j(e),!e.value)return;h(!0);const[i]=await M(F(e.value));if(!i)return;const n=D(i);l(n),h(!1)},z=e=>{d(e)},q=()=>{d(""),l("",{shouldValidate:!1})};return v(()=>{!r.length&&w&&l("",void 0),!(!r||r.length<=3||r===O)&&(l(r,void 0),y(r).catch(console.error))},[r]),v(()=>{x(!0)},[]),{value:$,inputValue:u,suggestions:I,isPending:P,isFetchingPlace:b,error:S,disabled:A,handleInputChange:z,handleOptionChange:U,handleClear:q}}export{_ as useDataFieldAddressInput};
|