@micromerce/formbuilder-react 1.0.1010 → 1.0.1013
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/index.d.ts
CHANGED
|
@@ -18,8 +18,9 @@ import { queryControl } from "./components/QueryControl/data/defaultControls";
|
|
|
18
18
|
import { FormBuilderConfig } from "./types";
|
|
19
19
|
import { compactVatId, vatIdProblem } from "./components/controls/SubtypeInput/vatId";
|
|
20
20
|
import type { VatIdProblem } from "./components/controls/SubtypeInput/vatId";
|
|
21
|
+
import { SOCIAL_NETWORKS, handleOf, isValidSocialLink, networkOf } from "./utils/subtypes/socialNetworks";
|
|
21
22
|
import { FormBuilderThemeProvider, FORM_BUILDER_TOKENS, LEGACY_CSS_VARS, toCssVars } from "./theme";
|
|
22
23
|
import type { FormBuilderTheme, FormBuilderThemeKey, FormBuilderThemePreset } from "./theme";
|
|
23
24
|
export type { FormBuilderTheme, FormBuilderThemeKey, FormBuilderThemePreset, VatIdProblem };
|
|
24
|
-
export { FormBuilderThemeProvider, FORM_BUILDER_TOKENS, LEGACY_CSS_VARS, toCssVars, FormBuilder, FormBuilderConfig, queryControl, Select, MultiSelect, Checkbox, ControlWrapper, FormFooter, Input, InputFreeSolo, FormList, FormGroup, MrnInput, PasswordInput, Textarea, TrafficLightCardSelect, useValueGenerator, compactVatId, vatIdProblem, };
|
|
25
|
+
export { FormBuilderThemeProvider, FORM_BUILDER_TOKENS, LEGACY_CSS_VARS, toCssVars, FormBuilder, FormBuilderConfig, queryControl, Select, MultiSelect, Checkbox, ControlWrapper, FormFooter, Input, InputFreeSolo, FormList, FormGroup, MrnInput, PasswordInput, Textarea, TrafficLightCardSelect, useValueGenerator, compactVatId, vatIdProblem, SOCIAL_NETWORKS, isValidSocialLink, networkOf, handleOf, };
|
|
25
26
|
export default FormBuilder;
|
|
@@ -16,13 +16,15 @@ export interface ISubtype {
|
|
|
16
16
|
/** What the editor stores when the field is left. */
|
|
17
17
|
normalize?: Normalize;
|
|
18
18
|
/** Whether a non-empty value passes — for the check mark only; the server decides and words the reason. */
|
|
19
|
-
isValid?: (value: string) => boolean;
|
|
19
|
+
isValid?: (value: string, customAttributes?: Record<string, unknown>) => boolean;
|
|
20
20
|
/** How a valid value reads while the field is not being edited (the stored value is not changed). */
|
|
21
21
|
display?: (value: string) => string;
|
|
22
22
|
/** An example, shown as the placeholder of an empty field when the form sets none. */
|
|
23
23
|
example?: string;
|
|
24
24
|
/** How wide the field is: as wide as its longest value, in characters (`ch`). */
|
|
25
25
|
width?: number;
|
|
26
|
+
/** Not a code read character by character (a link): the field keeps the form's type face. */
|
|
27
|
+
text?: boolean;
|
|
26
28
|
}
|
|
27
29
|
export declare const SUBTYPES: Record<string, ISubtype>;
|
|
28
30
|
/** The registered subtype name of an input's custom attributes, or undefined. */
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The social subtype (COP-4584): the networks and their hosts, formbuilder-react's copy of
|
|
3
|
+
* `social.networks` in the register (form-xhtmlform subtypes.json, read by the server's SocialProfiles);
|
|
4
|
+
* index.test.ts keeps the two in step. A subdomain counts (m.facebook.com, de.linkedin.com).
|
|
5
|
+
*/
|
|
6
|
+
export interface INetwork {
|
|
7
|
+
label: string;
|
|
8
|
+
hosts: string[];
|
|
9
|
+
}
|
|
10
|
+
export declare const SOCIAL_NETWORKS: Record<string, INetwork>;
|
|
11
|
+
/** The host of an https link, lower case; undefined for anything else. */
|
|
12
|
+
export declare const httpsHost: (value: string) => string | undefined;
|
|
13
|
+
/** The id of the network a link belongs to, by its host. */
|
|
14
|
+
export declare const networkOf: (value: string) => string | undefined;
|
|
15
|
+
/** As the server: an https link, and with a known `network` a host of that network. */
|
|
16
|
+
export declare const isValidSocialLink: (value: string, network?: unknown) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The name a profile link stands for — what the field shows while not being edited and the detail view
|
|
19
|
+
* shows as the link's label: "anna-weber" for linkedin.com/in/anna-weber, "@anna" for x.com/anna. The
|
|
20
|
+
* stored and copied value stays the full link. Falls back to the last path segment, then the host.
|
|
21
|
+
*/
|
|
22
|
+
export declare const handleOf: (value: string) => string;
|