@micromerce/formbuilder-react 1.0.1006 → 1.0.1008

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,21 @@
1
+ import React from "react";
2
+ import { IProps as InputProps } from "../Input/Input";
3
+ /** Whether an input's subtype is one this control handles: a registered, checked subtype. */
4
+ export declare const isCheckedSubtype: (customAttributes: unknown) => boolean;
5
+ /**
6
+ * An input with a checked `custom-attributes.subtype` (register: utils/subtypes, COP-4585) — iban, bic,
7
+ * leitweg-id, creditor-id. The behaviour belongs to the field, wherever it stands:
8
+ * - monospaced, read character by character, as wide as its code;
9
+ * - an empty field shows an example, unless the form sets a placeholder;
10
+ * - leaving the field stores the value normalized (the subtype's `normalize`); a valid value may read
11
+ * differently while not being edited (an IBAN in groups of four) — only the shown copy, the form
12
+ * state stays as stored;
13
+ * - the positive case right away: a check mark at the right edge as soon as the value passes, also
14
+ * while it is being typed.
15
+ * A failing value is not this control's business: the submit goes to the server, which refuses it and
16
+ * sends the reason, localized, back to the field (like every other field error). The editor never
17
+ * blocks a submit, so it can never be stricter than the server. The input keeps its `type` and gets
18
+ * the subtype's `pattern` (README, "HTML compatibility").
19
+ */
20
+ declare const SubtypeInput: (props: InputProps) => React.JSX.Element;
21
+ export default SubtypeInput;
@@ -0,0 +1,26 @@
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 IBAN/BIC rules — only to show the positive case (a check mark) and to
6
+ * format; the check that refuses a value, and its message, is the server's (Subtypes in
7
+ * form-xhtmlform). The detail view of service-entity carries the same rules to show stored values.
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;
@@ -0,0 +1,5 @@
1
+ export type CheckDigitProblem = "format" | "checksum";
2
+ /** Leitweg-ID (XRechnung buyer reference): 2-12 digits, optional fine address (≤ 30), two check digits. */
3
+ export declare const leitwegIdProblem: (value: string) => CheckDigitProblem | undefined;
4
+ /** SEPA creditor identifier: country, check digits, business code (not checked), national id; 18 in Germany. */
5
+ export declare const creditorIdProblem: (value: string) => CheckDigitProblem | undefined;
@@ -0,0 +1 @@
1
+ export { default } from "./SubtypeInput";
@@ -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
+ * (SubtypeInput), 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";