react-input-material 0.0.405 → 0.0.406

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-input-material",
3
- "version": "0.0.405",
3
+ "version": "0.0.406",
4
4
  "description": "Reusable material design based input field with support for (richt-)text, code, selections, numbers, dates and so on.",
5
5
  "keywords": [
6
6
  "form-field",
package/type.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import PropertyTypes from 'clientnode/property-types';
2
2
  import { Mapping, PlainObject, RecursivePartial, ValueOf } from 'clientnode/type';
3
- import { ComponentClass, FocusEvent, ForwardRefExoticComponent, FunctionComponent, HTMLProps, KeyboardEvent, MouseEvent, MutableRefObject, ReactElement, RefAttributes, Requireable, SyntheticEvent } from 'react';
3
+ import { ComponentClass, FocusEvent, ForwardRefExoticComponent, FunctionComponent, HTMLProps, KeyboardEvent, MouseEvent, MutableRefObject, ReactElement, ReactNode, RefAttributes, Requireable, SyntheticEvent } from 'react';
4
4
  import CodeEditorType, { IAceEditorProps as CodeEditorProps } from 'react-ace';
5
5
  import { EditorOptions as RawTinyMCEOptions, Editor as RichTextEditor } from 'tinymce';
6
6
  import { ComponentAdapter, PropertiesValidationMap, StaticWebComponent as StaticBaseWebComponent, ValidationMapping } from 'web-component-wrapper/type';
@@ -9,7 +9,7 @@ import { MDCSelectFoundation } from '@material/select';
9
9
  import { MDCTextFieldFoundation } from '@material/textfield';
10
10
  import { CardMediaProps } from '@rmwc/card';
11
11
  import { MenuApi } from '@rmwc/menu';
12
- import { SelectProps } from '@rmwc/select';
12
+ import { FormattedOption as FormattedSelectionOption, SelectProps } from '@rmwc/select';
13
13
  import { TextFieldProps } from '@rmwc/textfield';
14
14
  import { ThemeProviderProps } from '@rmwc/theme';
15
15
  import { TooltipProps } from '@rmwc/tooltip';
@@ -195,6 +195,9 @@ export declare type InputDataTransformation = {
195
195
  } & {
196
196
  [_key in Exclude<NativeInputType, 'date' | 'datetime-local' | 'time' | 'number'>]?: DataTransformSpecification<unknown>;
197
197
  };
198
+ export declare type NormalizedSelection = Array<Omit<FormattedSelectionOption, 'value'> & {
199
+ value: unknown;
200
+ }>;
198
201
  export interface InputTablePosition {
199
202
  column: number;
200
203
  row: number;
@@ -211,19 +214,16 @@ export interface InputModel<T = unknown> extends Model<T> {
211
214
  state: InputModelState;
212
215
  }
213
216
  export interface InputValueState<T = unknown, MS = ModelState> extends ValueState<T, MS> {
214
- representation?: string;
217
+ representation?: ReactNode | string;
215
218
  }
216
219
  export declare type NativeInputType = ('date' | 'datetime-local' | 'month' | 'number' | 'range' | 'text' | 'time' | 'week');
217
220
  export declare type GenericInputType = ('boolean' | 'currency' | 'float' | 'integer' | 'string' | NativeInputType);
218
221
  export interface InputChildrenOptions<P, T> {
219
222
  index: number;
220
- normalizedSelection: (SelectProps['options'] | Array<{
221
- label?: string;
222
- value: unknown;
223
- }>);
223
+ normalizedSelection: NormalizedSelection;
224
224
  properties: P;
225
225
  query: string;
226
- suggestion: string;
226
+ suggestion: ReactNode | string;
227
227
  value: T;
228
228
  }
229
229
  export interface SuggestionCreatorOptions<P> {
@@ -257,7 +257,7 @@ export interface InputProperties<T = unknown> extends InputModelState, Propertie
257
257
  outlined: boolean;
258
258
  patternText: string;
259
259
  placeholder: string;
260
- representation: string;
260
+ representation: ReactNode | string;
261
261
  rows: number;
262
262
  searchSelection: boolean;
263
263
  selectableEditor: boolean;
@@ -283,12 +283,12 @@ export interface InputState<T = unknown> extends State<T> {
283
283
  editorIsActive: boolean;
284
284
  hidden?: boolean;
285
285
  modelState: InputModelState;
286
- representation?: string;
286
+ representation?: ReactNode | string;
287
287
  selectionIsUnstable: boolean;
288
288
  showDeclaration: boolean;
289
289
  }
290
290
  export declare type InputAdapter<T = unknown> = ComponentAdapter<InputProperties<T>, Omit<InputState<T>, 'representation' | 'selectionIsUnstable' | 'value'> & {
291
- representation?: string;
291
+ representation?: ReactNode | string;
292
292
  value?: null | T;
293
293
  }>;
294
294
  export interface InputAdapterWithReferences<T = unknown> extends InputAdapter<T> {