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.
@@ -0,0 +1 @@
1
+ "use strict";if("undefined"!=typeof module&&null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&"undefined"!=typeof __dirname&&null!==__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter(function(path){return eval("require.main.paths").includes(path)})))}if(null==window)var window="undefined"==typeof global||null===global?{}:global;!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t=n();for(var i in t)("object"==typeof exports?exports:e)[i]=t[i]}}(this,function(){return function(){var e={d:function(n,t){for(var i in t)e.o(t,i)&&!e.o(n,i)&&Object.defineProperty(n,i,{enumerable:!0,get:t[i]})},o:function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{checkboxInput:function(){return t}});var t=function(e){var n=e.locator("input");return{main:e,inputNode:n,check:n.check.bind(n),uncheck:n.uncheck.bind(n),setChecked:n.setChecked.bind(n),isChecked:function(){return n.isChecked()}}};return n.default=t,n}()});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-input-material",
3
- "version": "0.0.762",
3
+ "version": "0.0.764",
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",
@@ -122,7 +122,7 @@
122
122
  "@codemirror/lint": "^6.9.2",
123
123
  "@codemirror/search": "^6.5.11",
124
124
  "@codemirror/state": "^6.5.3",
125
- "@codemirror/view": "^6.39.7",
125
+ "@codemirror/view": "^6.39.8",
126
126
  "@emotion/react": "^11.14.0",
127
127
  "@playwright/test": "^1.57.0",
128
128
  "@rmwc/card": "^14.3.5",
@@ -154,8 +154,8 @@
154
154
  "@types/react-transition-group": "^4.4.12",
155
155
  "@types/spark-md5": "^3.0.5",
156
156
  "@types/webpack-env": "^1.18.8",
157
- "@typescript-eslint/eslint-plugin": "^8.50.1",
158
- "@typescript-eslint/parser": "^8.50.1",
157
+ "@typescript-eslint/eslint-plugin": "^8.51.0",
158
+ "@typescript-eslint/parser": "^8.51.0",
159
159
  "blob-util": "^2.0.2",
160
160
  "clientnode": "3.0.1339",
161
161
  "css-loader": "^7.1.2",
@@ -174,7 +174,7 @@
174
174
  "postcss-import": "^16.1.1",
175
175
  "postcss-loader": "^8.2.0",
176
176
  "postcss-nested": "^7.0.2",
177
- "postcss-preset-env": "^10.5.0",
177
+ "postcss-preset-env": "^10.6.0",
178
178
  "prop-types": "^15.8.1",
179
179
  "react": "^18.3.1",
180
180
  "react-dom": "^18.3.1",
@@ -188,7 +188,7 @@
188
188
  "stylelint": "^16.26.1",
189
189
  "stylelint-config-standard": "^39.0.1",
190
190
  "tslib": "^2.8.1",
191
- "typescript-eslint": "^8.50.1",
191
+ "typescript-eslint": "^8.51.0",
192
192
  "typescript-plugin-css-modules": "^5.2.0",
193
193
  "web-component-wrapper": "^0.0.538",
194
194
  "weboptimizer": "^2.0.1636",
@@ -402,6 +402,7 @@
402
402
  },
403
403
  "generic": {
404
404
  "entry": {
405
+ "./components/Checkbox/harness": "./components/Checkbox/harness",
405
406
  "./components/Checkbox/import.module": "./implementations/rmwc/Checkbox/import.module",
406
407
  "./components/Checkbox/index": "./components/Checkbox/index",
407
408
  "./components/Checkbox/type": "./components/Checkbox/type",
@@ -1,37 +0,0 @@
1
- import { Locator } from 'playwright-core';
2
- export declare const checkboxInput: (parent: Locator) => {
3
- main: Locator;
4
- inputNode: Locator;
5
- check: (options?: {
6
- force?: boolean;
7
- noWaitAfter?: boolean;
8
- position?: {
9
- x: number;
10
- y: number;
11
- };
12
- timeout?: number;
13
- trial?: boolean;
14
- }) => Promise<void>;
15
- uncheck: (options?: {
16
- force?: boolean;
17
- noWaitAfter?: boolean;
18
- position?: {
19
- x: number;
20
- y: number;
21
- };
22
- timeout?: number;
23
- trial?: boolean;
24
- }) => Promise<void>;
25
- setChecked: (checked: boolean, options?: {
26
- force?: boolean;
27
- noWaitAfter?: boolean;
28
- position?: {
29
- x: number;
30
- y: number;
31
- };
32
- timeout?: number;
33
- trial?: boolean;
34
- }) => Promise<void>;
35
- isChecked: () => Promise<boolean>;
36
- };
37
- export default checkboxInput;
@@ -1,43 +0,0 @@
1
- import { ForwardRefRenderFunction } from 'react';
2
- import { Adapter, Component, DefaultProperties, ModelState, Props } from './type';
3
- /**
4
- * Derives validation state from provided properties and state.
5
- * @param properties - Current component properties.
6
- * @param currentState - Current component state.
7
- * @returns Whether component is in an aggregated valid or invalid state.
8
- */
9
- export declare function determineValidationState(properties: DefaultProperties, currentState: Partial<ModelState>): boolean;
10
- /**
11
- * Wrapper component for checkboxes to validate.
12
- * @property displayName - Descriptive name for component to show in web
13
- * developer tools.
14
- * Dataflow:
15
- * 1. On-Render all states are merged with given properties into a normalized
16
- * property object.
17
- * 2. Properties, corresponding state values and sub node instances are saved
18
- * into a "ref" object (to make them accessible from the outside for example
19
- * for wrapper like web-components).
20
- * 3. Event handler saves corresponding data modifications into state and
21
- * normalized properties object.
22
- * 4. All state changes except selection changes trigger an "onChange" event
23
- * which delivers the consolidated properties object (with latest
24
- * modifications included).
25
- * @param props - Given components properties.
26
- * @param reference - Reference object to forward internal state.
27
- * @returns React elements.
28
- */
29
- export declare const CheckboxInner: ForwardRefRenderFunction<Adapter, Props>;
30
- /**
31
- * Wrapping web component compatible react component.
32
- * @property defaultModelState - Initial model state.
33
- * @property defaultProperties - Initial property configuration.
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 wrapped - Wrapped component.
38
- * @param props - Given components properties.
39
- * @param reference - Reference object to forward internal state.
40
- * @returns React elements.
41
- */
42
- export declare const Checkbox: Component<typeof CheckboxInner>;
43
- export default Checkbox;
@@ -1,26 +0,0 @@
1
- import { ComponentAdapter, ValidationMapping } from 'web-component-wrapper/type';
2
- import { BaseModel, Component as BaseComponent, ModelState as BaseModelState, Properties as BaseProperties, State as BaseState, ValueState as BaseValueState } from '../../type';
3
- export interface Properties extends BaseProperties<boolean | null> {
4
- default?: boolean;
5
- checked: boolean;
6
- id: string;
7
- }
8
- export interface Model extends BaseModel<boolean | null> {
9
- default?: boolean;
10
- }
11
- export type ModelState = BaseModelState;
12
- export type ValueState = BaseValueState<boolean>;
13
- export type Props = Partial<Omit<Properties, 'model'>> & {
14
- model?: (Partial<Omit<Model, 'state'>> & {
15
- state?: Partial<ModelState>;
16
- });
17
- };
18
- export type DefaultProperties = Omit<Props, 'model'> & {
19
- model: Model;
20
- };
21
- export type State = BaseState<boolean>;
22
- export type Adapter = ComponentAdapter<Properties, Omit<State, 'value'>>;
23
- export type Component<ComponentType> = BaseComponent<boolean, ComponentType, Props, ModelState, DefaultProperties, Adapter>;
24
- export declare const propertyTypes: ValidationMapping;
25
- export declare const defaultModel: Model;
26
- export declare const defaultProperties: DefaultProperties;
@@ -1,18 +0,0 @@
1
- import { FirstParameter } from 'clientnode';
2
- import { FileChooser, Locator, Page } from 'playwright-core';
3
- export declare const fileInput: (parent: Locator) => {
4
- main: Locator;
5
- inputNode: Locator;
6
- nameInput: {
7
- main: Locator;
8
- inputNode: Locator;
9
- getOptions: () => Promise<string[]>;
10
- fill: (valueRepresentation: string) => Promise<void>;
11
- inputValue: () => Promise<string | null>;
12
- };
13
- openFileChooser: () => Promise<void>;
14
- getFileChooser: (page: Page) => Promise<FileChooser>;
15
- fillFiles: (page: Page, files: FirstParameter<FileChooser["setFiles"]>) => Promise<void>;
16
- getFiles: () => Promise<string>;
17
- };
18
- export default fileInput;
@@ -1,51 +0,0 @@
1
- import { ElementType } from 'react';
2
- import { Props } from '../TextInput/type';
3
- import { DefaultProperties as DefaultProperties, ModelState as ModelState, Value, RepresentationType as RepresentationType, Properties } from './type';
4
- export declare const CSS_CLASS_NAMES: Record<string, string>;
5
- export declare const IMAGE_CONTENT_TYPE_REGULAR_EXPRESSION: RegExp;
6
- export declare const TEXT_CONTENT_TYPE_REGULAR_EXPRESSION: RegExp;
7
- export declare const EMBEDABLE_TEXT_CONTENT_TYPE_REGULAR_EXPRESSION: RegExp;
8
- export declare const VIDEO_CONTENT_TYPE_REGULAR_EXPRESSION: RegExp;
9
- /**
10
- * Generates properties for nested text input to edit file name.
11
- * @param prototype - Base properties to extend from.
12
- * @param properties - Actual properties to derive from.
13
- * @param properties.name - Name of filename input field.
14
- * @param properties.value - Current edited file value.
15
- * @returns Input properties.
16
- */
17
- export declare const preserveStaticFileBaseNameInputGenerator: <Type extends Value = Value, MediaTag extends ElementType = "div">(prototype: Props<string>, { name, value }: Properties<Type, MediaTag>) => Props<string>;
18
- /**
19
- * Determines files content type for given file input properties.
20
- * @param properties - File input properties to analyze.
21
- * @returns The determined content type.
22
- */
23
- export declare const determineContentType: <Type extends Value = Value>(properties: Properties<Type>) => null | string;
24
- /**
25
- * Determines which type of file we have to present.
26
- * @param contentType - File type to derive representation type from.
27
- * @returns Representative string for given content type.
28
- */
29
- export declare const determineRepresentationType: (contentType: string) => RepresentationType;
30
- /**
31
- * Derives validation state from provided properties and state.
32
- * @param properties - Current component properties.
33
- * @param invalidName - Determines if edited file name is invalid or not.
34
- * @param currentState - Current component state.
35
- * @returns Boolean indicating Whether component is in an aggregated valid or
36
- * invalid state.
37
- */
38
- export declare const determineValidationState: <Type extends Value = Value, P extends DefaultProperties<Type> = DefaultProperties<Type>>(properties: P, invalidName: boolean, currentState: ModelState) => boolean;
39
- /**
40
- * Derive base46 string from given file value.
41
- * @param value - File to derive string from.
42
- * @returns A promise holding base64 string.
43
- */
44
- export declare const deriveBase64String: <Type extends Value = Value>(value: Type) => Promise<string>;
45
- /**
46
- * Read text from given binary data with given encoding.
47
- * @param blob - Binary data object.
48
- * @param encoding - Encoding for reading file correctly.
49
- * @returns A promise holding parsed text as string.
50
- */
51
- export declare const readBinaryDataIntoText: (blob: Blob, encoding?: string) => Promise<string>;
@@ -1,40 +0,0 @@
1
- import { ForwardedRef, ReactElement } from 'react';
2
- import { AdapterWithReferences, Component, Props, Value } from './type';
3
- export { CSS_CLASS_NAMES, IMAGE_CONTENT_TYPE_REGULAR_EXPRESSION, TEXT_CONTENT_TYPE_REGULAR_EXPRESSION, EMBEDABLE_TEXT_CONTENT_TYPE_REGULAR_EXPRESSION, VIDEO_CONTENT_TYPE_REGULAR_EXPRESSION, determineRepresentationType, determineValidationState, deriveBase64String, readBinaryDataIntoText, preserveStaticFileBaseNameInputGenerator } from './helper';
4
- /**
5
- * Validatable checkbox wrapper component.
6
- * @property displayName - Descriptive name for component to show in web
7
- * developer tools.
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
- * @param props - Given components properties.
20
- * @param reference - Reference object to forward internal state.
21
- * @returns React elements.
22
- */
23
- export declare const FileInputInner: {
24
- <Type extends Value = Value>(props: Props<Type>, reference?: ForwardedRef<AdapterWithReferences<Type>>): ReactElement;
25
- displayName: string;
26
- };
27
- /**
28
- * Wrapping web component compatible react component.
29
- * @property defaultModelState - Initial model state.
30
- * @property defaultProperties - Initial property configuration.
31
- * @property propTypes - Triggers reacts runtime property value checks.
32
- * @property strict - Indicates whether we should wrap render output in reacts
33
- * strict component.
34
- * @property wrapped - Wrapped component.
35
- * @param props - Given components properties.
36
- * @param reference - Reference object to forward internal state.
37
- * @returns React elements.
38
- */
39
- export declare const FileInput: Component<typeof FileInputInner>;
40
- export default FileInput;
@@ -1,115 +0,0 @@
1
- import { Mapping, ValueOf } from 'clientnode';
2
- import BasePropertyTypes, { Requireable } from 'clientnode/property-types';
3
- import { ElementType, ForwardRefExoticComponent, ReactElement, ReactNode, RefAttributes, RefObject } from 'react';
4
- import { ComponentAdapter, ValidationMapping } from 'web-component-wrapper/type';
5
- import { Adapter as TextInputAdapter, Model as TextInputModel, Props as TextInputProps, PartialModel as PartialTextInputModel } from '../TextInput/type';
6
- import { BaseModel, ModelState as BaseModelState, Pattern, Properties as BaseProperties, State as BaseState, StaticWebComponent, ValueState as BaseValueState } from '../../type';
7
- import { MediaCardReference } from '../../implementations/type';
8
- export declare enum RepresentationType {
9
- BINARY = "binary",
10
- IMAGE = "image",
11
- EMBEDABLE_TEXT = "embedableText",
12
- TEXT = "text",
13
- VIDEO = "video"
14
- }
15
- export type BlobType = Blob | Buffer | string;
16
- export interface Value {
17
- blob?: Partial<BlobType>;
18
- hash?: string;
19
- name?: string;
20
- source?: string;
21
- url?: string;
22
- }
23
- export interface ValueState<Type extends Value = Value> extends BaseValueState<Type, ModelState> {
24
- attachBlobProperty: boolean;
25
- }
26
- export interface ModelState extends BaseModelState {
27
- invalidMaximumSize: boolean;
28
- invalidMinimumSize: boolean;
29
- invalidContentTypePattern: boolean;
30
- invalidInvertedContentTypePattern: boolean;
31
- invalidName: boolean;
32
- }
33
- export interface Model<Type extends Value = Value> extends Omit<BaseModel<null | Type>, 'default'> {
34
- default?: Mapping<Type>;
35
- contentTypePattern?: Pattern;
36
- invertedContentTypePattern?: Pattern;
37
- maximumSize: number;
38
- minimumSize: number;
39
- fileName: TextInputModel<string>;
40
- state?: ModelState;
41
- }
42
- export interface ChildrenOptions<P, Type extends Value = Value> {
43
- declaration: string;
44
- invalid: boolean;
45
- properties: P;
46
- value?: null | Type;
47
- }
48
- export interface Properties<Type extends Value = Value, MediaTag extends ElementType = 'div'> extends BaseProperties<null | Type>, ModelState {
49
- default?: Mapping<Type>;
50
- children?: (options: ChildrenOptions<Properties<Type, MediaTag>, Type>) => ReactNode;
51
- fileInputClassNames?: Array<string>;
52
- imageClassNames?: Array<string>;
53
- contentTypePattern: Array<RegExp | string> | null | RegExp | string;
54
- invertedContentTypePattern: Array<RegExp | string> | null | RegExp | string;
55
- contentTypePatternText: string;
56
- invertedContentTypePatternText: string;
57
- maximumSizeText: string;
58
- minimumSizeText: string;
59
- deleteButton: ReactNode;
60
- downloadButton: ReactNode;
61
- editButton: ReactNode;
62
- newButton: ReactNode;
63
- encoding: string;
64
- generateFileNameInputProperties: (prototype: TextInputProps<string>, properties: Properties<Type, MediaTag>) => TextInputProps<string> | null;
65
- model: Model<Type>;
66
- outlined: boolean;
67
- sourceToBlobOptions?: {
68
- endings?: 'native' | 'transparent';
69
- type?: string;
70
- };
71
- hashingConfiguration: {
72
- binaryString: boolean;
73
- prefix: string;
74
- readChunkSizeInByte: number;
75
- };
76
- }
77
- export type Props<Type extends Value = Value> = Partial<Omit<Properties<Type>, 'model'>> & {
78
- model?: (Partial<Omit<Model<Type>, 'fileName' | 'state'>> & {
79
- fileName?: PartialTextInputModel<string>;
80
- state?: Partial<ModelState>;
81
- });
82
- };
83
- export type DefaultProperties<Type extends Value = Value> = Omit<Props<Type>, 'model'> & {
84
- model: Model<Type>;
85
- };
86
- export type PropertyTypes = {
87
- [key in keyof Properties]: ValueOf<typeof BasePropertyTypes>;
88
- };
89
- export declare const renderProperties: Array<string>;
90
- export interface State<Type extends Value = Value> extends BaseState<Type> {
91
- modelState: ModelState;
92
- }
93
- export type Adapter<Type extends Value = Value> = ComponentAdapter<Properties<Type>, Omit<State<Type>, 'value'> & {
94
- value?: null | Type;
95
- }>;
96
- export interface AdapterWithReferences<Type extends Value = Value> extends Adapter<Type> {
97
- references: {
98
- fileInput: RefObject<HTMLInputElement | null>;
99
- mediaCard: RefObject<MediaCardReference | null>;
100
- nameInput: RefObject<TextInputAdapter<string> | null>;
101
- };
102
- }
103
- export interface Component<Type> extends Omit<ForwardRefExoticComponent<Props>, 'propTypes'>, StaticWebComponent<Type, ModelState, DefaultProperties> {
104
- <T extends Value = Value>(props: Props<T> & RefAttributes<Adapter<T>>): ReactElement;
105
- }
106
- export declare const dedicatedPropertyTypes: ValidationMapping;
107
- export declare const modelPropertyTypes: ValidationMapping;
108
- export declare const modelStatePropertyTypes: {
109
- [key in keyof ModelState]: Requireable<boolean | symbol>;
110
- };
111
- export declare const propertyTypes: ValidationMapping;
112
- export declare const defaultModelState: ModelState;
113
- export declare const defaultModel: Model;
114
- export declare const defaultFileNameInputProperties: TextInputProps<string>;
115
- export declare const defaultProperties: DefaultProperties;
@@ -1,5 +0,0 @@
1
- import { Locator } from 'playwright-core';
2
- export declare const inputsInput: (parent: Locator) => {
3
- main: Locator;
4
- };
5
- export default inputsInput;
@@ -1,29 +0,0 @@
1
- import { Mapping } from 'clientnode';
2
- import { ForwardedRef, ReactElement } from 'react';
3
- import { Props as TextInputProps } from '../TextInput/type';
4
- import { Adapter, Component, PropertiesItem, Props } from './type';
5
- /**
6
- * Generic inputs wrapper component.
7
- * @property displayName - Descriptive name for component to show in web
8
- * developer tools.
9
- * @param props - Given components properties.
10
- * @param reference - Reference object to forward internal state.
11
- * @returns React elements.
12
- */
13
- export declare const InputsInner: {
14
- <T = unknown, P extends PropertiesItem<T> = TextInputProps<T>, State = Mapping<unknown>>(props: Props<T, P>, reference?: ForwardedRef<Adapter<T, P>>): ReactElement;
15
- displayName: string;
16
- };
17
- /**
18
- * Wrapping web component compatible react component.
19
- * @property defaultProperties - Initial property configuration.
20
- * @property propTypes - Triggers reacts runtime property value checks.
21
- * @property strict - Indicates whether we should wrap render output in reacts
22
- * strict component.
23
- * @property wrapped - Wrapped component.
24
- * @param props - Given components properties.
25
- * @param reference - Reference object to forward internal state.
26
- * @returns React elements.
27
- */
28
- export declare const Inputs: Component<typeof InputsInner>;
29
- export default Inputs;
@@ -1,79 +0,0 @@
1
- import { ValueOf } from 'clientnode';
2
- import BasePropertyTypes from 'clientnode/property-types';
3
- import { ForwardRefExoticComponent, ReactElement, ReactNode, RefAttributes, MutableRefObject as RefObject } from 'react';
4
- import { ComponentAdapter, ValidationMapping } from 'web-component-wrapper/type';
5
- import { Properties as TextInputProperties, Props as TextInputProps } from '../TextInput/type';
6
- import { BaseModel, ModelState as BaseModelState, Properties as BaseProperties, State as BaseState, StaticWebComponent } from '../../type';
7
- export interface PropertiesItem<T, TS = unknown> {
8
- model?: {
9
- state?: TS;
10
- value?: T;
11
- };
12
- value?: T;
13
- }
14
- export interface CreateOptions<T, IP> {
15
- index: number;
16
- properties: IP;
17
- values?: Array<T> | null;
18
- }
19
- export interface CreateItemOptions<T, P extends PropertiesItem<T>, IP> extends CreateOptions<T, IP> {
20
- item: Partial<P>;
21
- }
22
- export interface CreatePrototypeOptions<T, P extends PropertiesItem<T>, IP> extends CreateItemOptions<T, P, IP> {
23
- lastValue: null | T | undefined;
24
- }
25
- export interface ModelState extends BaseModelState {
26
- invalidMaximumNumber: boolean;
27
- invalidMinimumNumber: boolean;
28
- }
29
- export interface Model<T, P extends PropertiesItem<T> = PropertiesItem<T>> extends BaseModel<Array<P> | null> {
30
- default?: Array<P> | null;
31
- maximumNumber: number;
32
- minimumNumber: number;
33
- state?: ModelState;
34
- writable: boolean;
35
- }
36
- export interface ChildrenOptions<T, P extends PropertiesItem<T>, IP> {
37
- index: number;
38
- inputsProperties: IP;
39
- properties: Partial<P>;
40
- }
41
- export interface Properties<T = unknown, P extends PropertiesItem<T> = BaseProperties<T>> extends ModelState, Omit<BaseProperties<Array<P> | null>, 'onChangeValue'> {
42
- default?: T;
43
- addIcon: string;
44
- removeIcon: string;
45
- children: (options: ChildrenOptions<T, P, this>) => ReactNode;
46
- createItem: (options: CreateItemOptions<T, P, this>) => P;
47
- createPrototype: (options: CreatePrototypeOptions<T, P, this>) => P;
48
- maximumNumber: number;
49
- minimumNumber: number;
50
- model: Model<T, P>;
51
- onChangeValue: (values: Array<T> | null, event: unknown, properties: this) => void;
52
- value: Array<P> | null;
53
- writable: boolean;
54
- }
55
- export type PartialModel<T = unknown, P extends PropertiesItem<T> = BaseProperties<T>> = Partial<Omit<Model<T, P>, 'state'> & {
56
- state?: Partial<ModelState>;
57
- }>;
58
- export type Props<T = unknown, P extends PropertiesItem<T> = BaseProperties<T>> = Partial<Omit<Properties<T, P>, 'model' | 'value'>> & {
59
- model?: PartialModel<T, P>;
60
- value?: Array<Partial<P>> | Array<T> | null;
61
- };
62
- export type DefaultProperties<T = string, P extends PropertiesItem<T> = TextInputProps<T>> = Partial<Omit<Properties<T, P>, 'default' | 'model' | 'value'>> & {
63
- model: Model<T, P>;
64
- };
65
- export type PropertyTypes<T = unknown, P extends PropertiesItem<T> = BaseProperties<T>> = {
66
- [key in keyof Properties<P>]: ValueOf<typeof BasePropertyTypes>;
67
- };
68
- export type State<T = unknown> = BaseState<Array<null | T | undefined>>;
69
- export type Adapter<T = unknown, P extends PropertiesItem<T> = BaseProperties<T>> = ComponentAdapter<Properties<T, P>, State<T>>;
70
- export type AdapterWithReferences<T = unknown, P extends PropertiesItem<T> = BaseProperties<T>, RefType = unknown> = Adapter<T, P> & {
71
- references: Array<RefObject<RefType>>;
72
- };
73
- export interface Component<Type> extends Omit<ForwardRefExoticComponent<Props>, 'propTypes'>, StaticWebComponent<Type, ModelState, DefaultProperties> {
74
- <T = string, P extends PropertiesItem<T> = TextInputProperties<T>>(props: Props<T, P> & RefAttributes<Adapter<T, P>>): ReactElement;
75
- }
76
- export declare const propertyTypes: ValidationMapping;
77
- export declare const renderProperties: Array<string>;
78
- export declare const defaultModel: Model<string, TextInputProperties<string>>;
79
- export declare const defaultProperties: DefaultProperties;
@@ -1,5 +0,0 @@
1
- import { Locator } from 'playwright-core';
2
- export declare const intervalInput: (parent: Locator) => {
3
- main: Locator;
4
- };
5
- export default intervalInput;
@@ -1,25 +0,0 @@
1
- import { ForwardedRef, ReactElement } from 'react';
2
- import { Adapter, Component, Props } from './type';
3
- /**
4
- * Generic interval start, end input wrapper component.
5
- * @param props - Component properties.
6
- * @param reference - Mutable reference bound to created component instance.
7
- * @returns React elements.
8
- */
9
- export declare const IntervalInner: {
10
- (props: Props, reference?: ForwardedRef<Adapter>): ReactElement;
11
- displayName: string;
12
- };
13
- /**
14
- * Wrapping web component compatible react component.
15
- * @property defaultProperties - Initial property configuration.
16
- * @property propTypes - Triggers reacts runtime property value checks.
17
- * @property strict - Indicates whether we should wrap render output in reacts
18
- * strict component.
19
- * @property wrapped - Wrapped component.
20
- * @param props - Given components properties.
21
- * @param reference - Reference object to forward internal state.
22
- * @returns React elements.
23
- */
24
- export declare const Interval: Component<typeof IntervalInner>;
25
- export default Interval;
@@ -1,85 +0,0 @@
1
- import { ValueOf } from 'clientnode';
2
- import BasePropertyTypes from 'clientnode/property-types';
3
- import { MutableRefObject as RefObject } from 'react';
4
- import { GenericEvent } from 'react-generic-tools/type';
5
- import { ComponentAdapter, PropertiesValidationMap } from 'web-component-wrapper/type';
6
- import { IconProperties } from '../../implementations/type';
7
- import { Component as BaseComponent, ModelState as BaseModelState } from '../../type';
8
- import { AdapterWithReferences as TextInputAdapterWithReferences, Model as TextInputModel, Properties as TextInputProperties, Props as TextInputProps } from '../TextInput/type';
9
- export type DateTimeRepresentation = number | string;
10
- export interface Value {
11
- end?: DateTimeRepresentation | null;
12
- start?: DateTimeRepresentation | null;
13
- }
14
- export type IntervalTextInputModel = Omit<TextInputModel<DateTimeRepresentation | null>, 'maximum' | 'minimum'> & {
15
- maximum: DateTimeRepresentation;
16
- minimum: DateTimeRepresentation;
17
- };
18
- export type IntervalTextInputProps = Omit<TextInputProps<DateTimeRepresentation | null>, 'maximum' | 'minimum'> & {
19
- maximum: DateTimeRepresentation;
20
- minimum: DateTimeRepresentation;
21
- };
22
- export interface Configuration {
23
- end: Partial<IntervalTextInputModel> | Partial<IntervalTextInputProps>;
24
- start: Partial<IntervalTextInputModel> | Partial<IntervalTextInputProps>;
25
- }
26
- export type ModelState = BaseModelState;
27
- export interface Model {
28
- name: string;
29
- state?: ModelState;
30
- value: {
31
- end: IntervalTextInputModel;
32
- start: IntervalTextInputModel;
33
- };
34
- }
35
- export interface Properties extends Omit<TextInputProperties<DateTimeRepresentation | null>, 'icon' | 'model' | 'onChange' | 'onChangeValue' | 'value'> {
36
- icon: IconProperties;
37
- model: Model;
38
- onChange: (properties: this, event?: GenericEvent) => void;
39
- onChangeValue: (value: Value | null, event?: GenericEvent) => void;
40
- value: Configuration;
41
- }
42
- type PartialValue = Partial<Omit<TextInputModel<DateTimeRepresentation | null>, 'value'>> & {
43
- value: DateTimeRepresentation | null;
44
- };
45
- export type PartialModel = Partial<Omit<Properties['model'], 'state' | 'value'>> & {
46
- value?: {
47
- end?: PartialValue;
48
- start?: PartialValue;
49
- };
50
- state?: Partial<ModelState>;
51
- };
52
- export type Props = Omit<TextInputProps<DateTimeRepresentation | null>, 'icon' | 'model' | 'onChange' | 'onChangeValue' | 'value'> & Partial<{
53
- end: Partial<Omit<TextInputProps<DateTimeRepresentation | null>, 'maximum' | 'minimum'> & {
54
- maximum: DateTimeRepresentation;
55
- minimum: DateTimeRepresentation;
56
- }>;
57
- start: Partial<Omit<TextInputProps<DateTimeRepresentation | null>, 'maximum' | 'minimum'> & {
58
- maximum: DateTimeRepresentation;
59
- minimum: DateTimeRepresentation;
60
- }>;
61
- icon: IconProperties | string;
62
- model?: PartialModel;
63
- onChange: Properties['onChange'];
64
- onChangeValue: Properties['onChangeValue'];
65
- value?: Configuration | Value | null;
66
- }>;
67
- export type DefaultProperties = Omit<Props, 'model'> & {
68
- model: Model;
69
- };
70
- export type PropertyTypes = {
71
- [key in keyof Properties]: ValueOf<typeof BasePropertyTypes>;
72
- };
73
- export type Adapter = ComponentAdapter<Properties, {
74
- value?: Value | null;
75
- }>;
76
- export interface AdapterWithReferences extends Adapter {
77
- references: {
78
- end: RefObject<TextInputAdapterWithReferences<DateTimeRepresentation | null> | null>;
79
- start: RefObject<TextInputAdapterWithReferences<DateTimeRepresentation | null> | null>;
80
- };
81
- }
82
- export type Component<ComponentType> = BaseComponent<Configuration | Value | null, ComponentType, Props, ModelState, DefaultProperties, Adapter>;
83
- export declare const propertyTypes: PropertiesValidationMap;
84
- export declare const defaultProperties: DefaultProperties;
85
- export {};
@@ -1,9 +0,0 @@
1
- import { Locator } from 'playwright-core';
2
- export declare const textInput: (parent: Locator) => {
3
- main: Locator;
4
- inputNode: Locator;
5
- getOptions: () => Promise<string[]>;
6
- fill: (valueRepresentation: string) => Promise<void>;
7
- inputValue: () => Promise<string | null>;
8
- };
9
- export default textInput;