@micromerce/formbuilder-react 1.0.1007 → 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.
- package/dist/components/controls/SubtypeInput/SubtypeInput.d.ts +21 -0
- package/dist/components/controls/{BankCodeInput → SubtypeInput}/bankAccount.d.ts +3 -6
- package/dist/components/controls/SubtypeInput/checkDigit.d.ts +5 -0
- package/dist/components/controls/SubtypeInput/index.d.ts +1 -0
- package/dist/components/groups/BankAccountGroup/BankAccountGroup.d.ts +1 -1
- package/dist/formbuilder.js +51 -51
- package/dist/formbuilder.js.map +1 -1
- package/dist/utils/subtypes/index.d.ts +35 -0
- package/package.json +1 -1
- package/dist/components/controls/BankCodeInput/BankCodeInput.d.ts +0 -18
- package/dist/components/controls/BankCodeInput/index.d.ts +0 -1
- package/dist/utils/subtypePattern/index.d.ts +0 -1
|
@@ -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;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* The bank-account field type (`custom-attributes.type: "bankAccount"`, COP-4581): a group of
|
|
3
3
|
* `accountHolder`, `iban` and `bic` — the idents module-customers uses for `bankAccount`.
|
|
4
4
|
*
|
|
5
|
-
* The editor's copy of the
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
8
|
*/
|
|
9
9
|
/**
|
|
10
10
|
* IBAN length per country, from the SWIFT IBAN registry. A country missing here is checked by its
|
|
@@ -24,6 +24,3 @@ export declare const maskIban: (value: string) => string;
|
|
|
24
24
|
export declare const compactBic: (value: string) => string;
|
|
25
25
|
/** ISO 9362: bank (4 letters), country (2 letters), location (2), optional branch (3). */
|
|
26
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,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";
|
|
@@ -15,7 +15,7 @@ export interface IProps {
|
|
|
15
15
|
* A bank account as one block (`custom-attributes.type: "bankAccount"`, COP-4581): the holder on
|
|
16
16
|
* its own row, IBAN and BIC beside each other. The group only lays out its fields. What an IBAN or
|
|
17
17
|
* BIC field does — check, formatting, monospace — comes from the field's own subtype
|
|
18
|
-
* (
|
|
18
|
+
* (SubtypeInput), the same inside or outside this group; a child without the subtype is a plain
|
|
19
19
|
* text field here too.
|
|
20
20
|
*/
|
|
21
21
|
declare const BankAccountGroup: ({ id, control, objectPathId, groupIsRequired, isInRequiredGroup, isInGroup, controlProps, helper, }: IProps) => React.JSX.Element;
|