@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.
- package/dist/components/controls/SubtypeInput/SubtypeInput.d.ts +21 -0
- package/dist/components/controls/SubtypeInput/bankAccount.d.ts +26 -0
- 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 +22 -0
- package/dist/components/groups/BankAccountGroup/index.d.ts +1 -0
- 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
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `custom-attributes.subtype` (COP-4585) — formbuilder-react's copy of the register
|
|
3
|
+
* form-xhtmlform/src/main/resources/com/micromerce/xhtmlform/form/control/subtypes.json; index.test.ts
|
|
4
|
+
* keeps the two in step. A subtype works on any input, inside or outside any group, independent of
|
|
5
|
+
* the input type; an unknown subtype is ignored. Only the server refuses a value (Subtypes in
|
|
6
|
+
* form-xhtmlform) and words the reason, localized, at the field; the editor uses `isValid` for the
|
|
7
|
+
* positive case only (a check mark) and never blocks a submit.
|
|
8
|
+
*/
|
|
9
|
+
import { compactBic } from "../../components/controls/SubtypeInput/bankAccount";
|
|
10
|
+
export type Normalize = "compact-upper" | "upper";
|
|
11
|
+
export interface ISubtype {
|
|
12
|
+
/** The server refuses a value that fails `check`. */
|
|
13
|
+
checked: boolean;
|
|
14
|
+
/** The shape a plain HTML form checks: the input's `pattern` when the form sets none. */
|
|
15
|
+
htmlPattern?: string;
|
|
16
|
+
/** What the editor stores when the field is left. */
|
|
17
|
+
normalize?: Normalize;
|
|
18
|
+
/** Whether a non-empty value passes — for the check mark only; the server decides and words the reason. */
|
|
19
|
+
isValid?: (value: string) => boolean;
|
|
20
|
+
/** How a valid value reads while the field is not being edited (the stored value is not changed). */
|
|
21
|
+
display?: (value: string) => string;
|
|
22
|
+
/** An example, shown as the placeholder of an empty field when the form sets none. */
|
|
23
|
+
example?: string;
|
|
24
|
+
/** How wide the field is: as wide as its longest value, in characters (`ch`). */
|
|
25
|
+
width?: number;
|
|
26
|
+
}
|
|
27
|
+
export declare const SUBTYPES: Record<string, ISubtype>;
|
|
28
|
+
/** The registered subtype name of an input's custom attributes, or undefined. */
|
|
29
|
+
export declare const subtypeOf: (customAttributes: unknown) => string | undefined;
|
|
30
|
+
/** The registered subtype of an input's custom attributes, or undefined. */
|
|
31
|
+
export declare const subtypeFor: (customAttributes: unknown) => ISubtype | undefined;
|
|
32
|
+
/** The `pattern` of a subtype, for an input whose form sets none. */
|
|
33
|
+
export declare const subtypePattern: (subtype: unknown) => string | undefined;
|
|
34
|
+
export declare const normalizeValue: (value: string, normalize: Normalize | undefined) => string;
|
|
35
|
+
export { compactBic };
|