react-input-material 0.0.762 → 0.0.764

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.
@@ -1,38 +0,0 @@
1
- import type { EditorOptions } from '@tiptap/core';
2
- import { KeyboardEvent } from 'react';
3
- import Dummy from 'react-generic-dummy';
4
- import UseAnimationsType from 'react-useanimations';
5
- import LockAnimation from 'react-useanimations/lib/lock';
6
- import PlusToXAnimation from 'react-useanimations/lib/plusToX';
7
- import { DefaultProperties as DefaultProperties, ModelState as ModelState } from './type';
8
- export declare const IS_BROWSER: boolean;
9
- export declare const UseAnimations: (null | typeof Dummy | typeof UseAnimationsType | undefined);
10
- export declare const lockAnimation: null | typeof LockAnimation | undefined;
11
- export declare const plusToXAnimation: null | typeof PlusToXAnimation | undefined;
12
- export declare const CSS_CLASS_NAMES: Record<string, string>;
13
- export declare const CODE_EDITOR_OPTIONS: {};
14
- export declare const CURRENT_UTC_BUILD_TIMESTAMP: number;
15
- export declare const TIPTAP_DEFAULT_OPTIONS: Partial<EditorOptions>;
16
- /**
17
- * Derives validation state from provided properties and state.
18
- * @param properties - Current component properties.
19
- * @param currentState - Current component state.
20
- * @returns Boolean indicating whether component is in an aggregated valid or
21
- * invalid state.
22
- */
23
- export declare const determineValidationState: <T>(properties: DefaultProperties<T>, currentState: Partial<ModelState>) => boolean;
24
- /**
25
- * Avoid propagating the enter key event since this usually sends a form which
26
- * is not intended when working in a text field.
27
- * @param event - Keyboard event.
28
- */
29
- export declare function preventEnterKeyPropagation(event: KeyboardEvent): void;
30
- /**
31
- * Indicates whether a provided query is matching currently provided
32
- * suggestion.
33
- * @param suggestion - Candidate to match again.
34
- * @param query - Search query to check for matching.
35
- * @returns Boolean result whether provided suggestion matches given query or
36
- * not.
37
- */
38
- export declare function suggestionMatches(suggestion: string, query?: null | string): boolean;
@@ -1,44 +0,0 @@
1
- import { ForwardedRef, ReactElement } from 'react';
2
- import { AdapterWithReferences, Component, DataTransformation, Props } from './type';
3
- export { CODE_EDITOR_OPTIONS, CSS_CLASS_NAMES, determineValidationState, preventEnterKeyPropagation, suggestionMatches, TIPTAP_DEFAULT_OPTIONS } from './helper';
4
- export declare const INPUT_TRANSFORMER: DataTransformation;
5
- /**
6
- * Generic text input wrapper component which automatically determines a useful
7
- * input field depending on given model specification.
8
- * Dataflow:
9
- * 1. On-Render all states are merged with given properties into a normalized
10
- * property object.
11
- * 2. Properties, corresponding state values and sub node instances are saved
12
- * into a "ref" object (to make them accessible from the outside for example
13
- * for wrapper like web-components).
14
- * 3. Event handler saves corresponding data modifications into state and
15
- * normalized properties object.
16
- * 4. All state changes except selection changes trigger an "onChange" event
17
- * which delivers the consolidated properties object (with latest
18
- * modifications included).
19
- * @property displayName - Descriptive name for component to show in web
20
- * developer tools.
21
- * @param props - Given components properties.
22
- * @param reference - Reference object to forward internal state.
23
- * @returns React elements.
24
- */
25
- export declare const TextInputInner: {
26
- <Type = unknown>(props: Props<Type>, reference?: ForwardedRef<AdapterWithReferences<Type>>): ReactElement;
27
- displayName: string;
28
- };
29
- /**
30
- * Wrapping web component compatible react component.
31
- * @property defaultModelState - Initial model state.
32
- * @property defaultProperties - Initial property configuration.
33
- * @property locales - Defines input formatting locales.
34
- * @property propTypes - Triggers reacts runtime property value checks.
35
- * @property strict - Indicates whether we should wrap render output in reacts
36
- * strict component.
37
- * @property transformer - Text input data transformation specifications.
38
- * @property wrapped - Wrapped component.
39
- * @param props - Given components properties.
40
- * @param reference - Reference object to forward internal state.
41
- * @returns React elements.
42
- */
43
- export declare const TextInput: Component<typeof TextInputInner>;
44
- export default TextInput;
@@ -1,201 +0,0 @@
1
- import { LanguageSupport } from '@codemirror/language';
2
- import { JSONContent } from '@tiptap/core';
3
- import { Mapping, PlainObject, RecursivePartial, ValueOf } from 'clientnode';
4
- import BasePropertyTypes, { Requireable } from 'clientnode/property-types';
5
- import { FocusEvent as ReactFocusEvent, ForwardRefExoticComponent, KeyboardEvent, MouseEvent, ReactElement, ReactNode, RefAttributes, MutableRefObject as RefObject } from 'react';
6
- import { GenericEvent } from 'react-generic-tools/type';
7
- import { ComponentAdapter, ValidationMapping } from 'web-component-wrapper/type';
8
- import { ChainedCommands, type EditorOptions, Extensions } from '@tiptap/core';
9
- import { EditorEvents } from '@tiptap/react';
10
- import { StarterKitOptions } from '@tiptap/starter-kit';
11
- import { IconProperties, InputReference, SelectProperties, TextAreaProperties, TextFieldProperties } from '../../implementations/type';
12
- import { BaseModel, CursorState, NormalizedSelection, ModelState as BaseModelState, Properties as BaseProperties, Selection, State as BaseState, StaticWebComponent, ValueState as BaseValueState } from '../../type';
13
- import { Reference as InputEventMapperReference } from './InputEventMapperWrapper';
14
- export type Transformer<T = unknown> = (value: T, transformer: DataTransformation, configuration: DefaultProperties<T>) => string;
15
- export interface FormatSpecification<T = unknown> {
16
- options?: PlainObject;
17
- transform?: Transformer<T>;
18
- }
19
- export interface FormatSpecifications<T = unknown> {
20
- final: FormatSpecification<T>;
21
- intermediate?: FormatSpecification<T>;
22
- }
23
- export interface DataTransformSpecification<T = unknown, InputType = number | string> {
24
- format?: FormatSpecifications<T>;
25
- parse?: (value: InputType, transformer: DataTransformation, configuration: DefaultProperties<T>) => T;
26
- type?: NativeType;
27
- }
28
- export interface DateTransformSpecification extends DataTransformSpecification<number | string, Date | number | string> {
29
- useISOString: boolean;
30
- }
31
- export type DataTransformation = {
32
- boolean: DataTransformSpecification<boolean>;
33
- currency: DataTransformSpecification<number, string>;
34
- date: DateTransformSpecification;
35
- 'date-local': DataTransformSpecification<number | string, Date | number | string>;
36
- datetime: DataTransformSpecification<number | string, Date | number | string>;
37
- 'datetime-local': DataTransformSpecification<number | string, Date | number | string>;
38
- time: DataTransformSpecification<number | string, Date | number | string>;
39
- 'time-local': DataTransformSpecification<number | string, Date | number | string>;
40
- float: DataTransformSpecification<number, string>;
41
- integer: DataTransformSpecification<number, string>;
42
- number: DataTransformSpecification<number, number>;
43
- string?: DataTransformSpecification;
44
- } & {
45
- [key in Exclude<NativeType, ('date' | 'date-local' | 'datetime' | 'datetime-local' | 'time' | 'time-local' | 'number')>]?: DataTransformSpecification;
46
- };
47
- export interface EditorReference {
48
- input: RefObject<InputEventMapperReference | null>;
49
- }
50
- export interface EditorProperties extends Omit<NonNullable<TextAreaProperties>, 'onChange' | 'textarea' | 'value'> {
51
- id: string;
52
- value: number | string;
53
- minimumLength: number;
54
- maximumLength: number;
55
- rows: number;
56
- onChange: (value: string, contentTree?: JSONContent) => void;
57
- }
58
- export interface RichTextEditorButtonProps {
59
- action: (command: ChainedCommands) => ChainedCommands;
60
- activeIndicator?: string;
61
- enabledIndicator?: null | ((command: ChainedCommands) => ChainedCommands);
62
- checkedIconName?: string;
63
- iconName: string;
64
- label?: string;
65
- }
66
- export interface TiptapProperties extends Omit<EditorProperties, 'onBlur' | 'onFocus'> {
67
- onBlur: (event: EditorEvents['focus']) => void;
68
- onFocus: (event: EditorEvents['focus']) => void;
69
- editor: {
70
- options?: Partial<EditorOptions>;
71
- extensions?: Extensions;
72
- starterKitOptions?: Partial<StarterKitOptions>;
73
- };
74
- }
75
- export type TiptapProps = Partial<TiptapProperties>;
76
- export interface CodeMirrorProperties extends Omit<EditorProperties, 'onBlur' | 'onFocus'> {
77
- onBlur: (event: ReactFocusEvent<HTMLDivElement>) => void;
78
- onFocus: (event: ReactFocusEvent<HTMLDivElement>) => void;
79
- editor: {
80
- mode?: LanguageSupport;
81
- };
82
- }
83
- export type CodeMirrorProps = Partial<CodeMirrorProperties>;
84
- export interface ModelState extends BaseModelState {
85
- invalidMaximum: boolean;
86
- invalidMinimum: boolean;
87
- invalidMaximumLength: boolean;
88
- invalidMinimumLength: boolean;
89
- invalidInvertedPattern: boolean;
90
- invalidPattern: boolean;
91
- }
92
- export interface Model<T = unknown> extends BaseModel<T> {
93
- default?: T;
94
- state?: ModelState;
95
- }
96
- export type PartialModel<T = unknown> = Partial<Omit<Model<T>, 'state'>> & {
97
- state?: Partial<ModelState>;
98
- };
99
- export interface ValueState<T = unknown, MS = BaseModelState> extends BaseValueState<T, MS> {
100
- representation?: ReactNode;
101
- }
102
- export type NativeType = ('date' | 'datetime-local' | 'time' | 'week' | 'month' | 'number' | 'range' | 'text');
103
- export type Type = ('date-local' | 'datetime' | 'time-local' | 'boolean' | 'currency' | 'float' | 'integer' | 'string' | NativeType);
104
- export interface ChildrenOptions<P, T> {
105
- index: number;
106
- normalizedSelection?: NormalizedSelection | null;
107
- properties: P;
108
- query: string;
109
- suggestion: ReactNode | string;
110
- value: T;
111
- }
112
- export interface SuggestionCreatorOptions<P> {
113
- abortController: AbortController;
114
- properties: P;
115
- query: string;
116
- }
117
- export type EditorType = ('code' | 'code(css)' | 'code(cascadingstylesheet)' | 'code(cascadingstylesheets)' | 'code(style)' | 'code(styles)' | 'code(script)' | 'code(js)' | 'code(jsx)' | 'code(javascript)' | 'code(ts)' | 'code(tsx)' | 'code(typescript)' | 'plain' | 'text' | 'richtext');
118
- export interface Properties<Type = unknown> extends ModelState, BaseProperties<Type> {
119
- default?: Type;
120
- align: 'end' | 'start';
121
- children: (options: ChildrenOptions<this, Type>) => null | ReactElement;
122
- cursor: Partial<CursorState> | null;
123
- editor: EditorType;
124
- editorIsActive: boolean;
125
- editorIsInitiallyActive: boolean;
126
- hidden?: boolean;
127
- leadingIcon: string | (IconProperties & {
128
- tooltip?: string;
129
- });
130
- trailingIcon: string | (IconProperties & {
131
- tooltip?: string;
132
- });
133
- domNodeProperties: Partial<CodeMirrorProps | SelectProperties<Type> | TiptapProps | TextAreaProperties | TextFieldProperties | Mapping<unknown>>;
134
- attributes?: Mapping<boolean | number | string>;
135
- invertedPattern: Array<RegExp | string> | null | RegExp | string;
136
- invertedPatternText: string;
137
- labels: Selection;
138
- maximumLengthText: string;
139
- minimumLengthText: string;
140
- maximumText: string;
141
- minimumText: string;
142
- model: Model<Type>;
143
- onChangeEditorIsActive: (isActive: boolean, event: MouseEvent | undefined, properties: this) => void;
144
- onKeyDown: (event: KeyboardEvent, properties: this) => void;
145
- onKeyUp: (event: KeyboardEvent, properties: this) => void;
146
- onSelect: (event: GenericEvent, properties: this) => void;
147
- onSelectionChange: (event: GenericEvent, properties: this) => void;
148
- pattern: Array<RegExp | string> | null | RegExp | string;
149
- patternText: string;
150
- placeholder: string;
151
- representation: ReactNode | string;
152
- rows: number;
153
- searchSelection: boolean;
154
- selectableEditor: boolean;
155
- step: number;
156
- suggestionCreator?: (options: SuggestionCreatorOptions<this>) => Properties['selection'] | Promise<Properties['selection']>;
157
- suggestSelection: boolean;
158
- transformer: RecursivePartial<DataTransformSpecification<Type, Date | number | string>>;
159
- }
160
- export type Props<T = unknown> = Partial<Omit<Properties<T>, 'model'>> & {
161
- model?: PartialModel<T>;
162
- };
163
- export type DefaultProperties<T = string> = Omit<Props<T>, 'model'> & {
164
- model: Model<T>;
165
- };
166
- export type PropertyTypes<T = unknown> = {
167
- [key in keyof Properties<T>]: ValueOf<typeof BasePropertyTypes>;
168
- };
169
- export interface State<T = unknown> extends BaseState<T> {
170
- cursor: CursorState;
171
- editorIsActive: boolean;
172
- hidden?: boolean;
173
- modelState: ModelState;
174
- representation?: ReactNode | string;
175
- selectionIsUnstable: boolean;
176
- showDeclaration: boolean;
177
- }
178
- export type Adapter<T = unknown> = ComponentAdapter<Properties<T>, Omit<State<T>, 'representation' | 'selectionIsUnstable' | 'value'> & {
179
- representation?: ReactNode | string;
180
- value?: null | T;
181
- }>;
182
- export interface AdapterWithReferences<T = unknown> extends Adapter<T> {
183
- references: {
184
- input: RefObject<InputReference | InputEventMapperReference | null>;
185
- menu: RefObject<unknown>;
186
- wrapper: RefObject<HTMLDivElement | null>;
187
- };
188
- }
189
- export interface Component<Type> extends Omit<ForwardRefExoticComponent<Props>, 'propTypes'>, StaticWebComponent<Type, ModelState, DefaultProperties> {
190
- <T = unknown>(props: Props<T> & RefAttributes<Adapter<T>>): ReactElement;
191
- locales: Array<string>;
192
- transformer: DataTransformation;
193
- }
194
- export declare const modelStatePropertyTypes: {
195
- [key in keyof ModelState]: Requireable<boolean | symbol>;
196
- };
197
- export declare const propertyTypes: ValidationMapping;
198
- export declare const renderProperties: Array<string>;
199
- export declare const defaultModelState: ModelState;
200
- export declare const defaultInputModel: Model<string>;
201
- export declare const defaultProperties: DefaultProperties;
@@ -1,37 +0,0 @@
1
- import { ThemePropT } from '@rmwc/types';
2
- import { AnyFunction, FirstParameter } from 'clientnode';
3
- import { FunctionComponent, ReactElement } from 'react';
4
- import { ConfigurationProperties } from '../../type';
5
- /**
6
- * Wraps a theme provider, strict wrapper and tooltip to given element if
7
- * corresponding configurations are provided.
8
- * @param properties - Component provided properties.
9
- * @param properties.children - Component or string to wrap.
10
- * @param properties.strict - Indicates whether to render in strict mode.
11
- * @param properties.themeConfiguration - Optional theme configurations.
12
- * @param properties.tooltip - Optional tooltip to show on hover.
13
- * @param properties.wrap - Instead of injecting a div tag, wrap a child
14
- * component by merging the theme styles directly onto it. Useful when you
15
- * don't want to mess with layout.
16
- * @returns Wrapped content.
17
- */
18
- export declare const WrapConfigurations: FunctionComponent<ConfigurationProperties & {
19
- children: ReactElement;
20
- }>;
21
- /**
22
- * Component factory to dynamically create a wrapped component.
23
- * @param WrappedComponent - Component to wrap.
24
- * @param options - Options configure wrapping.
25
- * @param options.withReference - Indicates whether to add a mutable reference
26
- * to wrapping component.
27
- * @param options.withThemeWrapper - Indicates whether all theme configurations
28
- * should be provided.
29
- * @returns Created wrapped component.
30
- */
31
- export declare function createWrapConfigurationsComponent<Type extends AnyFunction = AnyFunction, Reference = unknown>(WrappedComponent: Type, options?: {
32
- withReference?: boolean | null;
33
- withThemeWrapper?: boolean;
34
- }): FunctionComponent<FirstParameter<Type> & ConfigurationProperties & {
35
- theme?: ThemePropT;
36
- }>;
37
- export default WrapConfigurations;
@@ -1,14 +0,0 @@
1
- import { FunctionComponent, ReactNode } from 'react';
2
- /**
3
- * Generic strict wrapper component.
4
- * @param properties - Provided component properties.
5
- * @param properties.children - Components to wrap.
6
- * @param properties.strict - Indicates whether to wrap with strict indicating
7
- * component.
8
- * @returns React component.
9
- */
10
- export declare const WrapStrict: FunctionComponent<{
11
- children: ReactNode;
12
- strict: boolean;
13
- }>;
14
- export default WrapStrict;
@@ -1,18 +0,0 @@
1
- import { FunctionComponent, ReactElement } from 'react';
2
- import { ThemeProviderProps } from '@rmwc/theme';
3
- /**
4
- * Wraps a theme provider to given element if a configuration is provided.
5
- * @param properties - Component provided properties.
6
- * @param properties.children - Component or string to wrap.
7
- * @param properties.configuration - Potential theme provider configuration.
8
- * @param properties.wrap - Instead of injecting a div tag, wrap a child
9
- * component by merging the theme styles directly onto it. Useful when you
10
- * don't want to mess with layout.
11
- * @returns Wrapped content.
12
- */
13
- export declare const WrapThemeProvider: FunctionComponent<{
14
- children: ReactElement;
15
- configuration?: ThemeProviderProps['options'];
16
- wrap?: boolean;
17
- }>;
18
- export default WrapThemeProvider;
@@ -1,16 +0,0 @@
1
- import { FunctionComponent, ReactElement } from 'react';
2
- import { Properties } from '../../type';
3
- export declare const isDummy: boolean;
4
- /**
5
- * Wraps given component with a tooltip component with given tooltip
6
- * configuration.
7
- * @param properties - Component provided properties.
8
- * @param properties.children - Component or string to wrap.
9
- * @param properties.value - Tooltip value.
10
- * @returns Wrapped given content.
11
- */
12
- export declare const WrapTooltip: FunctionComponent<{
13
- children: ReactElement;
14
- value?: Properties['tooltip'] | null;
15
- }>;
16
- export default WrapTooltip;
package/dist/helper.d.ts DELETED
@@ -1,164 +0,0 @@
1
- import { Mapping } from 'clientnode';
2
- import { NullSymbol, UndefinedSymbol } from 'clientnode/property-types';
3
- import { ReactNode, useState } from 'react';
4
- import { BaseProperties, BaseProps, DefaultBaseProperties, DefaultProperties, ModelState, NormalizedSelection, Selection, ValueState } from './type';
5
- import { DateTimeRepresentation } from './components/Interval/type';
6
- import { DefaultProperties as TextInputDefaultProperties, DataTransformation as TextInputDataTransformation, Props as TextInputProps } from './components/TextInput/type';
7
- /**
8
- * Removes all none serializable values from given data structure.
9
- * @param object - Mapping of values to slice.
10
- */
11
- export declare const slicePropertiesForState: (object: Mapping) => void;
12
- /**
13
- * Removes all none serializable values from given data structure recursively.
14
- * @param properties - Mapping of values to slice.
15
- * @returns Nothing.
16
- */
17
- export declare const slicePropertiesForStateRecursively: (properties: unknown) => object | undefined;
18
- /**
19
- * Creates a mocked a state setter. Useful to dynamically convert a component
20
- * from uncontrolled to controlled one.
21
- * @param value - Parameter for state setter.
22
- * @returns Resulting value of the "useState" hook.
23
- */
24
- export declare const createDummyStateSetter: <Type = unknown>(value: Type) => ReturnType<typeof useState>[1];
25
- /**
26
- * Consolidates properties not found in properties but in state into
27
- * properties.
28
- * @param properties - To consolidate.
29
- * @param state - To search values in.
30
- * @returns Consolidated properties.
31
- */
32
- export declare const deriveMissingPropertiesFromState: <Properties extends BaseProps = BaseProps, State extends ValueState = ValueState>(properties: Properties, state: State) => Properties;
33
- /**
34
- * Creates a hybrid a state setter which only triggers when model state changes
35
- * occur. Useful to dynamically convert a component from uncontrolled to
36
- * controlled while model state should be uncontrolled either.
37
- * @param setValueState - Value setter to wrap.
38
- * @param currentValueState - Last known value state to provide to setter when
39
- * called.
40
- * @returns Wrapped given method.
41
- */
42
- export declare const wrapStateSetter: <Type = unknown>(setValueState: (value: Type | ((value: Type) => Type)) => void, currentValueState: Type) => ReturnType<typeof useState>[1];
43
- /**
44
- * Renders given template string against all properties in current
45
- * instance.
46
- * @param template - Template to render.
47
- * @param scope - Scope to render given template again.
48
- * @returns Evaluated template or an empty string if something goes wrong.
49
- */
50
- export declare const renderMessage: <Scope extends object = object>(template: unknown, scope: Scope) => string;
51
- /**
52
- * Triggered when a value state changes like validation or focusing.
53
- * @param properties - Properties to search in.
54
- * @param name - Event callback name to search for in given properties.
55
- * @param synchronous - Indicates whether to trigger callback immediately or
56
- * later. Controlled components should call synchronously and uncontrolled
57
- * otherwise as long as callbacks are called in a state setter context.
58
- * @param parameters - Additional arguments to forward to callback.
59
- */
60
- export declare const triggerCallbackIfExists: <P extends Omit<BaseProperties, "model"> & {
61
- model: unknown;
62
- }>(properties: P, name: string, synchronous?: boolean, ...parameters: Array<unknown>) => void;
63
- /**
64
- * Translate known symbols in a copied and return properties object.
65
- * @param properties - Object to translate.
66
- * @returns Transformed properties.
67
- */
68
- export declare const translateKnownSymbols: <Type = unknown>(properties: Mapping<typeof NullSymbol | Type | typeof UndefinedSymbol>) => Mapping<Type>;
69
- /**
70
- * Determines initial value representation as string.
71
- * @param properties - Components properties.
72
- * @param defaultProperties - Components default properties.
73
- * @param value - Current value to represent.
74
- * @param transformer - To apply to given value.
75
- * @param selection - Data mapping of allowed values.
76
- * @returns Determined initial representation.
77
- */
78
- export declare function determineInitialRepresentation<T = unknown, P extends TextInputProps<T> = TextInputProps<T>, DP extends TextInputDefaultProperties<T> = TextInputDefaultProperties<T>>(properties: P, defaultProperties: DP, value: null | T, transformer: TextInputDataTransformation, selection?: NormalizedSelection | null): string;
79
- /**
80
- * Determines initial value depending on given properties.
81
- * @param properties - Components properties.
82
- * @param defaultValue - Internal fallback value.
83
- * @param alternateValue - Alternate value to respect.
84
- * @returns Determined value.
85
- */
86
- export declare const determineInitialValue: <Type = unknown, DefaultType = unknown>(properties: BaseProps & {
87
- default?: DefaultType;
88
- model?: {
89
- default?: DefaultType;
90
- };
91
- }, defaultValue?: Type, alternateValue?: Type) => null | Type;
92
- /**
93
- * Derives current validation state from given value.
94
- * @param properties - Input configuration.
95
- * @param currentState - Current validation state.
96
- * @param validators - Mapping from validation state key to corresponding
97
- * validator function.
98
- * @returns A boolean indicating if validation state has changed.
99
- */
100
- export declare const determineValidationState: <Type = unknown, P extends DefaultProperties<Type> = DefaultProperties<Type>, MS extends Partial<ModelState> = Partial<ModelState>>(properties: P, currentState: MS, validators?: Mapping<() => boolean>) => boolean;
101
- /**
102
- * Synchronizes property, state and model configuration:
103
- * Properties overwrites default properties which overwrites default model
104
- * properties.
105
- * @param properties - Properties to merge.
106
- * @param defaultModel - Default model to merge.
107
- * @returns Merged properties.
108
- */
109
- export declare const mapPropertiesIntoModel: <P extends BaseProps = BaseProps, DP extends DefaultBaseProperties = DefaultBaseProperties>(properties: P, defaultModel: DP["model"]) => DP;
110
- /**
111
- * Calculate external properties (a set of all configurable properties).
112
- * @param properties - Properties to merge.
113
- * @returns External properties object.
114
- */
115
- export declare const getConsolidatedProperties: <P extends BaseProps, R extends BaseProperties>(properties: P) => R;
116
- /**
117
- * Determine normalized labels and values for selection and auto-complete
118
- * components.
119
- * @param selection - Selection component property configuration.
120
- * @returns Normalized sorted listed of labels and values.
121
- */
122
- export declare function getLabelAndValues(selection?: NormalizedSelection | null): [Array<ReactNode | string>, Array<unknown>];
123
- /**
124
- * Determine representation for given value while respecting existing labels.
125
- * @param value - To represent.
126
- * @param selection - Selection component property configuration.
127
- * @returns Determined representation.
128
- */
129
- export declare function getRepresentationFromValueSelection(value: unknown, selection?: NormalizedSelection | null): null | string;
130
- /**
131
- * Determine value from provided representation (for example user inputs).
132
- * @param label - To search a value for.
133
- * @param selection - Selection component property configuration.
134
- * @returns Determined value.
135
- */
136
- export declare function getValueFromSelection<T>(label: ReactNode | string, selection: NormalizedSelection | null | undefined): T;
137
- /**
138
- * Normalize given selection. NOTE: It is important to have an ordered list
139
- * to map values to labels and the other way around in a deterministic way.
140
- * @param selection - Selection component property configuration.
141
- * @param labels - Additional labels to take into account (for example provided
142
- * via a content management system).
143
- * @returns Determined normalized sorted selection configuration.
144
- */
145
- export declare function normalizeSelection(selection?: Selection | null, labels?: Selection | null): NormalizedSelection | null | undefined;
146
- /**
147
- * Applies configured value transformations.
148
- * @param configuration - Input configuration.
149
- * @param value - Value to transform.
150
- * @param transformer - To apply to given value.
151
- * @param trim - Indicates whether to trim strings or not.
152
- * @returns Transformed value.
153
- */
154
- export declare const parseValue: <T = unknown, P extends TextInputDefaultProperties<T> = TextInputDefaultProperties<T>, InputType = T>(configuration: P, value: InputType | undefined, transformer: TextInputDataTransformation, trim?: boolean) => T;
155
- /**
156
- * Represents configured value as string.
157
- * @param configuration - Input configuration.
158
- * @param value - To represent.
159
- * @param transformerMapping - To apply to given value.
160
- * @param final - Specifies whether it is a final representation.
161
- * @returns Transformed value.
162
- */
163
- export declare function formatValue<T = unknown, P extends TextInputDefaultProperties<T> = TextInputDefaultProperties<T>>(configuration: P, value: null | T, transformerMapping: TextInputDataTransformation, final?: boolean): string;
164
- export declare const formatDateTimeAsConfigured: (value?: DateTimeRepresentation | Date | null) => DateTimeRepresentation | null | undefined;
package/dist/index.d.ts DELETED
@@ -1,16 +0,0 @@
1
- export { Checkbox } from './components/Checkbox';
2
- export { FileInput } from './components/FileInput';
3
- export { Interval } from './components/Interval';
4
- export { Inputs } from './components/Inputs';
5
- export { TextInput } from './components/TextInput';
6
- export { WrapConfigurations } from './components/Wrapper/WrapConfigurations';
7
- export { WrapStrict } from './components/Wrapper/WrapStrict';
8
- export { WrapThemeProvider } from './components/Wrapper/WrapThemeProvider';
9
- export { WrapTooltip } from './components/Wrapper/WrapTooltip';
10
- export * from './helper';
11
- export * from './type';
12
- export * as CheckboxTypes from './components/Checkbox/type';
13
- export * as FileInputTypes from './components/FileInput/type';
14
- export * as IntervalTypes from './components/Interval/type';
15
- export * as InputsTypes from './components/Inputs/type';
16
- export * as TextInputTypes from './components/TextInput/type';