@micromerce/formbuilder-react 1.0.1005 → 1.0.1007

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.
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import { IProps as InputProps } from "../Input/Input";
3
+ /** The subtype that makes an input an IBAN or a BIC field, or undefined. */
4
+ export declare const bankCodeSubtype: (customAttributes: unknown) => "iban" | "bic" | undefined;
5
+ /**
6
+ * An input with `custom-attributes.subtype` "iban" or "bic" (COP-4581). The behaviour belongs to the
7
+ * field, wherever it stands — on its own or in a bank-account group:
8
+ * - monospaced, read digit by digit;
9
+ * - leaving the field stores the value compact and upper case ("DE89370400440532013000"); a valid
10
+ * IBAN then reads in groups of four, focusing shows the compact value again for editing — only the
11
+ * shown copy is formatted, the form state stays compact;
12
+ * - a value that fails its check shows the reason below the field once the field was left, and
13
+ * blocks the submit through the input's custom validity (FormBuilder's checkValidity()).
14
+ * The server checks the same, like every field check (`BankAccountFormats` in form-xhtmlform); the input keeps
15
+ * its `type` and gets a shape `pattern` (README, "HTML compatibility").
16
+ */
17
+ declare const BankCodeInput: (props: InputProps) => React.JSX.Element;
18
+ export default BankCodeInput;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The bank-account field type (`custom-attributes.type: "bankAccount"`, COP-4581): a group of
3
+ * `accountHolder`, `iban` and `bic` — the idents module-customers uses for `bankAccount`.
4
+ *
5
+ * The editor's copy of the checks; the detail view of service-entity carries the same file
6
+ * (layout-controls/group/bank-account/bankAccount.ts) to decide how a stored value is shown, and
7
+ * the server checks again on save. Keep the three in step.
8
+ */
9
+ /**
10
+ * IBAN length per country, from the SWIFT IBAN registry. A country missing here is checked by its
11
+ * check digits only (ISO 13616 mod 97), not by its length.
12
+ */
13
+ export declare const IBAN_LENGTHS: Record<string, number>;
14
+ /** Spaces and dashes out, upper case: what is stored and what is copied. */
15
+ export declare const compactIban: (value: string) => string;
16
+ /** "DE89 3704 0044 0532 0130 00" — groups of four, as printed on cards and statements. */
17
+ export declare const formatIban: (value: string) => string;
18
+ export type IbanProblem = "format" | "length" | "checksum";
19
+ /** Why an IBAN is not valid, or undefined when it is. An empty value has no problem. */
20
+ export declare const ibanProblem: (value: string) => IbanProblem | undefined;
21
+ /** "DE89 … 3000": country, check digits and the last four — enough to tell accounts apart in a list. */
22
+ export declare const maskIban: (value: string) => string;
23
+ /** Spaces out, upper case. */
24
+ export declare const compactBic: (value: string) => string;
25
+ /** ISO 9362: bank (4 letters), country (2 letters), location (2), optional branch (3). */
26
+ export declare const isValidBic: (value: string) => boolean;
27
+ /** The message the form shows for a value that fails its check, or undefined when it passes. */
28
+ export declare const ibanMessage: (value: string) => string | undefined;
29
+ export declare const bicMessage: (value: string) => string | undefined;
@@ -0,0 +1 @@
1
+ export { default } from "./BankCodeInput";
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import type { controlProps } from "../../../types/controlProps";
3
+ import { GroupFormControl } from "../../../types";
4
+ export interface IProps {
5
+ id: string;
6
+ control: GroupFormControl;
7
+ objectPathId?: string;
8
+ groupIsRequired?: boolean;
9
+ isInRequiredGroup?: boolean;
10
+ isInGroup?: boolean;
11
+ controlProps?: controlProps;
12
+ helper?: string;
13
+ }
14
+ /**
15
+ * A bank account as one block (`custom-attributes.type: "bankAccount"`, COP-4581): the holder on
16
+ * its own row, IBAN and BIC beside each other. The group only lays out its fields. What an IBAN or
17
+ * BIC field does — check, formatting, monospace — comes from the field's own subtype
18
+ * (BankCodeInput), the same inside or outside this group; a child without the subtype is a plain
19
+ * text field here too.
20
+ */
21
+ declare const BankAccountGroup: ({ id, control, objectPathId, groupIsRequired, isInRequiredGroup, isInGroup, controlProps, helper, }: IProps) => React.JSX.Element;
22
+ export default BankAccountGroup;
@@ -0,0 +1 @@
1
+ export { default } from "./BankAccountGroup";