[@catho/quantum] Added few missing attributes (#42287)

* simplecrawler modules type definition

* required fixes in export

* adjustments reference types of crawler.d.ts

* added catho__quantum types definitions

* Fix lint errors

* Fix lint errors

* Fix lint errors

* fix components event handlers types

* fix lint complains

* fix few missing attributes
This commit is contained in:
Pedro Mutter
2020-02-12 10:05:26 -08:00
committed by GitHub
parent 018095fc0e
commit e6d1f957fc
4 changed files with 26 additions and 1 deletions
+10 -1
View File
@@ -100,4 +100,13 @@ Validations.Required({ value: 'abc' });
<TextArea />;
<Toggle />;
<Tooltip text="this is a tooltip!">Tooltip example</Tooltip>;
<Input />;
<Input validate={Validations.Date} />;
<Input validate={({ value }: { value?: string }) => `value: ${value}`} />;
<Input validate={{ validate: Validations.Email, error: 'Error test' }} />;
<Input
validate={[
Validations.Required,
({ value }: { value?: string }) => `value: ${value}`,
{ validate: Validations.Date, error: 'Error test' },
]}
/>;
+1
View File
@@ -22,6 +22,7 @@ export interface ButtonProps<T> {
button: object;
};
};
id?: string;
}
export default class Button<T = HTMLButtonElement> extends React.Component<ButtonProps<T>> {
+14
View File
@@ -1,7 +1,19 @@
import React = require('react');
import { Validations } from '../Form';
import { string } from 'prop-types';
export type MaskFunction = (rawValue: string) => string[];
export type Mask = boolean | RegExp | string | MaskFunction;
export type Validate =
| typeof Validations.Required
| typeof Validations.CPF
| typeof Validations.CEP
| typeof Validations.Date
| typeof Validations.MinLength
| typeof Validations.MaxLength
| typeof Validations.Email;
export type CustomValidate = ((param?: { value: string }) => string) | { validate: Validate; error: string };
export interface InputProps<T> {
value?: string;
@@ -13,6 +25,8 @@ export interface InputProps<T> {
type?: 'email' | 'text' | 'tel' | 'number' | 'password' | 'search';
error?: string;
id?: string;
name?: string;
validate?: Validate | CustomValidate | Array<Validate | CustomValidate>;
mask?: Mask | Mask[];
onClean?: React.MouseEventHandler<T>;
onChange?: React.ChangeEventHandler<T>;
+1
View File
@@ -1,6 +1,7 @@
import React = require('react');
export interface ToggleProps {
id?: string;
checked?: boolean;
theme?: {
colors?: object;