@sebgroup/green-react 1.3.0 → 1.3.1
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/index.js +30 -18
- package/package.json +3 -3
- package/src/lib/form/input/input.d.ts +6 -6
- package/src/lib/form/types.d.ts +4 -0
package/index.js
CHANGED
|
@@ -2429,6 +2429,7 @@ const useInput = (props, onChanges, onChangeInput) => {
|
|
|
2429
2429
|
const [value, setValue] = useState(props.value ? props.value : '');
|
|
2430
2430
|
const [checked, setChecked] = useState(props.checked ? props.checked : false);
|
|
2431
2431
|
useEffect(() => {
|
|
2432
|
+
if (props.value !== undefined) setValue(props.value);
|
|
2432
2433
|
if (ref.current && ref.current.form) {
|
|
2433
2434
|
const resetListener = () => {
|
|
2434
2435
|
setValue(props.value ? props.value : '');
|
|
@@ -2443,7 +2444,9 @@ const useInput = (props, onChanges, onChangeInput) => {
|
|
|
2443
2444
|
}
|
|
2444
2445
|
}, [props]);
|
|
2445
2446
|
const onChange = event => {
|
|
2446
|
-
|
|
2447
|
+
if (props.value === undefined) {
|
|
2448
|
+
setValue(event.target.value);
|
|
2449
|
+
}
|
|
2447
2450
|
setChecked(event.currentTarget.checked);
|
|
2448
2451
|
onChanges && onChanges(event);
|
|
2449
2452
|
onChangeInput && onChangeInput(event.target.value);
|
|
@@ -2457,7 +2460,7 @@ const useInput = (props, onChanges, onChangeInput) => {
|
|
|
2457
2460
|
});
|
|
2458
2461
|
};
|
|
2459
2462
|
|
|
2460
|
-
const RenderInput = (type, props, onChange, onChangeInput, label, info, validator, expandableInfo, expandableInfoButtonLabel) => {
|
|
2463
|
+
const RenderInput = (type, props, onChange, onChangeInput, label, info, validator, expandableInfo, expandableInfoButtonLabel, testId) => {
|
|
2461
2464
|
const _a = useInput(props, onChange, onChangeInput),
|
|
2462
2465
|
{
|
|
2463
2466
|
value
|
|
@@ -2469,7 +2472,8 @@ const RenderInput = (type, props, onChange, onChangeInput, label, info, validato
|
|
|
2469
2472
|
// Render naked
|
|
2470
2473
|
if (!label && !info && !expandableInfo) return jsx("input", Object.assign({
|
|
2471
2474
|
type: type,
|
|
2472
|
-
value: value
|
|
2475
|
+
value: value,
|
|
2476
|
+
"data-testid": testId
|
|
2473
2477
|
}, propsWithDescription));
|
|
2474
2478
|
return jsx(FormItem, Object.assign({
|
|
2475
2479
|
validator: validator,
|
|
@@ -2486,7 +2490,8 @@ const RenderInput = (type, props, onChange, onChangeInput, label, info, validato
|
|
|
2486
2490
|
type: type,
|
|
2487
2491
|
value: value
|
|
2488
2492
|
}, propsWithDescription, {
|
|
2489
|
-
className: validator && validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator)
|
|
2493
|
+
className: validator && validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator),
|
|
2494
|
+
"data-testid": testId
|
|
2490
2495
|
}))
|
|
2491
2496
|
}))
|
|
2492
2497
|
}));
|
|
@@ -2495,14 +2500,15 @@ const TextInput = _a => {
|
|
|
2495
2500
|
var {
|
|
2496
2501
|
label,
|
|
2497
2502
|
info,
|
|
2503
|
+
testId,
|
|
2498
2504
|
onChange,
|
|
2499
2505
|
onChangeInput,
|
|
2500
2506
|
validator,
|
|
2501
2507
|
expandableInfo,
|
|
2502
2508
|
expandableInfoButtonLabel
|
|
2503
2509
|
} = _a,
|
|
2504
|
-
props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator", "expandableInfo", "expandableInfoButtonLabel"]);
|
|
2505
|
-
return RenderInput('text', props, onChange, onChangeInput, label, info, validator, expandableInfo, expandableInfoButtonLabel);
|
|
2510
|
+
props = __rest(_a, ["label", "info", "testId", "onChange", "onChangeInput", "validator", "expandableInfo", "expandableInfoButtonLabel"]);
|
|
2511
|
+
return RenderInput('text', props, onChange, onChangeInput, label, info, validator, expandableInfo, expandableInfoButtonLabel, testId);
|
|
2506
2512
|
};
|
|
2507
2513
|
const EmailInput = _a => {
|
|
2508
2514
|
var {
|
|
@@ -2510,10 +2516,11 @@ const EmailInput = _a => {
|
|
|
2510
2516
|
info,
|
|
2511
2517
|
onChange,
|
|
2512
2518
|
onChangeInput,
|
|
2513
|
-
validator
|
|
2519
|
+
validator,
|
|
2520
|
+
testId
|
|
2514
2521
|
} = _a,
|
|
2515
|
-
props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
|
|
2516
|
-
return RenderInput('email', props, onChange, onChangeInput, label, info, validator);
|
|
2522
|
+
props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator", "testId"]);
|
|
2523
|
+
return RenderInput('email', props, onChange, onChangeInput, label, info, validator, testId);
|
|
2517
2524
|
};
|
|
2518
2525
|
const NumberInput = _a => {
|
|
2519
2526
|
var {
|
|
@@ -2523,18 +2530,20 @@ const NumberInput = _a => {
|
|
|
2523
2530
|
onChangeInput,
|
|
2524
2531
|
validator,
|
|
2525
2532
|
expandableInfo,
|
|
2526
|
-
expandableInfoButtonLabel
|
|
2533
|
+
expandableInfoButtonLabel,
|
|
2534
|
+
testId
|
|
2527
2535
|
} = _a,
|
|
2528
|
-
props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator", "expandableInfo", "expandableInfoButtonLabel"]);
|
|
2529
|
-
return RenderInput('number', props, onChange, onChangeInput, label, info, validator, expandableInfo, expandableInfoButtonLabel);
|
|
2536
|
+
props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator", "expandableInfo", "expandableInfoButtonLabel", "testId"]);
|
|
2537
|
+
return RenderInput('number', props, onChange, onChangeInput, label, info, validator, expandableInfo, expandableInfoButtonLabel, testId);
|
|
2530
2538
|
};
|
|
2531
2539
|
const Checkbox = _a => {
|
|
2532
2540
|
var {
|
|
2533
2541
|
label,
|
|
2534
2542
|
onChange,
|
|
2535
|
-
validator
|
|
2543
|
+
validator,
|
|
2544
|
+
testId
|
|
2536
2545
|
} = _a,
|
|
2537
|
-
props = __rest(_a, ["label", "onChange", "validator"]);
|
|
2546
|
+
props = __rest(_a, ["label", "onChange", "validator", "testId"]);
|
|
2538
2547
|
const inputProps = useInput(props, onChange);
|
|
2539
2548
|
const labelClassNames = classNames('form-control', validator && validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator));
|
|
2540
2549
|
const inputClassNames = classNames(validator && validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator));
|
|
@@ -2546,7 +2555,8 @@ const Checkbox = _a => {
|
|
|
2546
2555
|
className: labelClassNames
|
|
2547
2556
|
}, {
|
|
2548
2557
|
children: [label, jsx("input", Object.assign({
|
|
2549
|
-
type: "checkbox"
|
|
2558
|
+
type: "checkbox",
|
|
2559
|
+
"data-testid": testId
|
|
2550
2560
|
}, inputProps, {
|
|
2551
2561
|
className: inputClassNames
|
|
2552
2562
|
})), jsx("i", {})]
|
|
@@ -2560,9 +2570,10 @@ const Checkbox = _a => {
|
|
|
2560
2570
|
const RadioButton = /*#__PURE__*/React.forwardRef((_a, ref) => {
|
|
2561
2571
|
var {
|
|
2562
2572
|
label,
|
|
2563
|
-
validator
|
|
2573
|
+
validator,
|
|
2574
|
+
testId
|
|
2564
2575
|
} = _a,
|
|
2565
|
-
props = __rest(_a, ["label", "validator"]);
|
|
2576
|
+
props = __rest(_a, ["label", "validator", "testId"]);
|
|
2566
2577
|
const {
|
|
2567
2578
|
id
|
|
2568
2579
|
} = useInput(props);
|
|
@@ -2573,7 +2584,8 @@ const RadioButton = /*#__PURE__*/React.forwardRef((_a, ref) => {
|
|
|
2573
2584
|
}, {
|
|
2574
2585
|
children: [jsx("input", Object.assign({
|
|
2575
2586
|
id: id,
|
|
2576
|
-
type: "radio"
|
|
2587
|
+
type: "radio",
|
|
2588
|
+
"data-testid": testId
|
|
2577
2589
|
}, props, {
|
|
2578
2590
|
className: inputClassNames,
|
|
2579
2591
|
ref: ref
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sebgroup/green-react",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": "^17 || ^18",
|
|
6
6
|
"react-dom": "^17 || ^18"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@sebgroup/chlorophyll": "^1.
|
|
10
|
-
"@sebgroup/extract": "^1.
|
|
9
|
+
"@sebgroup/chlorophyll": "^1.6.0",
|
|
10
|
+
"@sebgroup/extract": "^1.3.0",
|
|
11
11
|
"classnames": "^2.3.2"
|
|
12
12
|
},
|
|
13
13
|
"description": "React components built on top of @sebgroup/chlorophyll.",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { InputHTMLAttributes } from 'react';
|
|
2
2
|
import { IValidator } from '@sebgroup/extract';
|
|
3
3
|
import { CheckboxProps, NumberInputProps, RadioButtonProps, TextInputProps } from '../types';
|
|
4
|
-
export type Renderer = (type: string, props: InputHTMLAttributes<HTMLInputElement>, onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void, onChangeInput?: (value: string) => string, label?: string, info?: string, validator?: IValidator, expandableInfo?: string, expandableInfoButtonLabel?: string) => JSX.Element;
|
|
4
|
+
export type Renderer = (type: string, props: InputHTMLAttributes<HTMLInputElement>, onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void, onChangeInput?: (value: string) => string, label?: string, info?: string, validator?: IValidator, expandableInfo?: string, expandableInfoButtonLabel?: string, testId?: string) => JSX.Element;
|
|
5
5
|
export declare const RenderInput: Renderer;
|
|
6
|
-
export declare const TextInput: ({ label, info, onChange, onChangeInput, validator, expandableInfo, expandableInfoButtonLabel, ...props }: TextInputProps) => JSX.Element;
|
|
7
|
-
export declare const EmailInput: ({ label, info, onChange, onChangeInput, validator, ...props }: TextInputProps) => JSX.Element;
|
|
8
|
-
export declare const NumberInput: ({ label, info, onChange, onChangeInput, validator, expandableInfo, expandableInfoButtonLabel, ...props }: NumberInputProps) => JSX.Element;
|
|
9
|
-
export declare const Checkbox: ({ label, onChange, validator, ...props }: CheckboxProps) => JSX.Element;
|
|
10
|
-
export declare const RadioButton: React.ForwardRefExoticComponent<Pick<RadioButtonProps, "label" | "onChange" | "validator" | "type" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "noValidate" | "open" | "optimum" | "pattern" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & React.RefAttributes<HTMLInputElement>>;
|
|
6
|
+
export declare const TextInput: ({ label, info, testId, onChange, onChangeInput, validator, expandableInfo, expandableInfoButtonLabel, ...props }: TextInputProps) => JSX.Element;
|
|
7
|
+
export declare const EmailInput: ({ label, info, onChange, onChangeInput, validator, testId, ...props }: TextInputProps) => JSX.Element;
|
|
8
|
+
export declare const NumberInput: ({ label, info, onChange, onChangeInput, validator, expandableInfo, expandableInfoButtonLabel, testId, ...props }: NumberInputProps) => JSX.Element;
|
|
9
|
+
export declare const Checkbox: ({ label, onChange, validator, testId, ...props }: CheckboxProps) => JSX.Element;
|
|
10
|
+
export declare const RadioButton: React.ForwardRefExoticComponent<Pick<RadioButtonProps, "label" | "testId" | "onChange" | "validator" | "type" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "noValidate" | "open" | "optimum" | "pattern" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & React.RefAttributes<HTMLInputElement>>;
|
package/src/lib/form/types.d.ts
CHANGED
|
@@ -4,12 +4,14 @@ export interface TextInputProps extends HTMLProps<HTMLInputElement> {
|
|
|
4
4
|
type?: 'text' | 'email' | 'number';
|
|
5
5
|
label?: string;
|
|
6
6
|
info?: string;
|
|
7
|
+
testId?: string;
|
|
7
8
|
expandableInfo?: string;
|
|
8
9
|
expandableInfoButtonLabel?: string;
|
|
9
10
|
validator?: IValidator;
|
|
10
11
|
onChangeInput?: (value: string) => string;
|
|
11
12
|
}
|
|
12
13
|
export interface NumberInputProps extends TextInputProps {
|
|
14
|
+
testId?: string;
|
|
13
15
|
min?: number;
|
|
14
16
|
max?: number;
|
|
15
17
|
step?: number;
|
|
@@ -17,10 +19,12 @@ export interface NumberInputProps extends TextInputProps {
|
|
|
17
19
|
expandableInfoButtonLabel?: string;
|
|
18
20
|
}
|
|
19
21
|
export interface CheckboxProps extends HTMLProps<HTMLInputElement> {
|
|
22
|
+
testId?: string;
|
|
20
23
|
validator?: IValidator;
|
|
21
24
|
}
|
|
22
25
|
export interface RadioButtonProps extends HTMLProps<HTMLInputElement> {
|
|
23
26
|
label: string;
|
|
27
|
+
testId?: string;
|
|
24
28
|
validator?: string;
|
|
25
29
|
value: string;
|
|
26
30
|
}
|