@etsoo/react 1.2.77 → 1.2.81

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.
@@ -17,6 +17,7 @@ export const CountdownButton = React.forwardRef((props, ref) => {
17
17
  const seconds = 2;
18
18
  // Countdown length
19
19
  const [shared] = React.useState({ maxLength: 0 });
20
+ const isMounted = React.useRef(true);
20
21
  // endIcon
21
22
  let endIcon;
22
23
  if (state === 0) {
@@ -43,6 +44,9 @@ export const CountdownButton = React.forwardRef((props, ref) => {
43
44
  // Update max length
44
45
  shared.maxLength = result.toString().length;
45
46
  const seed = setInterval(() => {
47
+ // Mounted?
48
+ if (!isMounted.current)
49
+ return;
46
50
  // Last 1 second and then complete
47
51
  if (result > seconds + 1) {
48
52
  result--;
@@ -68,5 +72,10 @@ export const CountdownButton = React.forwardRef((props, ref) => {
68
72
  // Return any countdown
69
73
  onAction().then(doAction);
70
74
  };
75
+ React.useEffect(() => {
76
+ return () => {
77
+ isMounted.current = false;
78
+ };
79
+ }, []);
71
80
  return (React.createElement(Button, { disabled: disabled, endIcon: endIcon, onClick: localClick, ref: ref, ...rest }));
72
81
  });
@@ -7,6 +7,6 @@ import Draggable from 'react-draggable';
7
7
  * @returns Component
8
8
  */
9
9
  export function DraggablePaperComponent(props) {
10
- return (React.createElement(Draggable, { handle: "#draggable-dialog-title", cancel: '[class*="MuiDialogContent-root"]' },
10
+ return (React.createElement(Draggable, { handle: ".draggable-dialog-title", cancel: '[class*="MuiDialogContent-root"]' },
11
11
  React.createElement(Paper, { ...props })));
12
12
  }
@@ -1,8 +1,21 @@
1
1
  /// <reference types="react" />
2
2
  import { TextFieldProps } from '@mui/material';
3
+ /**
4
+ * Input field props
5
+ */
6
+ export declare type InputFieldProps = TextFieldProps & {
7
+ /**
8
+ * Change delay (ms) to avoid repeatly dispatch onChange
9
+ */
10
+ changeDelay?: number;
11
+ /**
12
+ * Is the field read only?
13
+ */
14
+ readOnly?: boolean;
15
+ };
3
16
  /**
4
17
  * Input field
5
18
  * @param props Props
6
19
  * @returns Component
7
20
  */
8
- export declare function InputField(props: TextFieldProps): JSX.Element;
21
+ export declare function InputField(props: InputFieldProps): JSX.Element;
@@ -8,9 +8,34 @@ import { MUGlobal } from './MUGlobal';
8
8
  */
9
9
  export function InputField(props) {
10
10
  // Destruct
11
- const { InputLabelProps = {}, size = MUGlobal.inputFieldSize, variant = MUGlobal.inputFieldVariant, ...rest } = props;
11
+ const { changeDelay, InputLabelProps = {}, InputProps = {}, onChange, readOnly, size = MUGlobal.inputFieldSize, variant = MUGlobal.inputFieldVariant, ...rest } = props;
12
12
  // Shrink
13
13
  InputLabelProps.shrink = MUGlobal.searchFieldShrink;
14
+ // Read only
15
+ if (readOnly != null)
16
+ InputProps.readOnly = readOnly;
17
+ const isMounted = React.useRef(true);
18
+ const delaySeed = React.useRef(0);
19
+ const onChangeEx = (event) => {
20
+ if (onChange == null)
21
+ return;
22
+ if (changeDelay == null || changeDelay < 1) {
23
+ onChange(event);
24
+ return;
25
+ }
26
+ if (delaySeed.current > 0)
27
+ window.clearTimeout(delaySeed.current);
28
+ delaySeed.current = window.setTimeout(() => {
29
+ if (isMounted.current)
30
+ onChange(event);
31
+ }, changeDelay);
32
+ };
33
+ React.useEffect(() => {
34
+ return () => {
35
+ isMounted.current = false;
36
+ window.clearTimeout(delaySeed.current);
37
+ };
38
+ }, []);
14
39
  // Layout
15
- return (React.createElement(TextField, { InputLabelProps: InputLabelProps, size: size, variant: variant, ...rest }));
40
+ return (React.createElement(TextField, { InputLabelProps: InputLabelProps, InputProps: InputProps, onChange: onChangeEx, size: size, variant: variant, ...rest }));
16
41
  }
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * List item right icon component
3
3
  */
4
- export declare const ListItemRightIcon: import("@mui/system").StyledComponent<import("@mui/material").ListItemIconProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
4
+ export declare const ListItemRightIcon: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemIconProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -9,6 +9,7 @@ import { LoadingButton } from './LoadingButton';
9
9
  // Custom icon dialog title bar
10
10
  const IconDialogTitle = styled(DialogTitle) `
11
11
  ${({ theme }) => `
12
+ cursor: move;
12
13
  display: flex;
13
14
  align-items: center;
14
15
  & .dialogTitle {
@@ -62,7 +63,7 @@ export class NotificationMU extends NotificationReact {
62
63
  if (this.renderSetup)
63
64
  this.renderSetup(setupProps);
64
65
  return (React.createElement(Dialog, { key: this.id, open: this.open, PaperComponent: DraggablePaperComponent, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen },
65
- React.createElement(IconDialogTitle, { id: "draggable-dialog-title" },
66
+ React.createElement(IconDialogTitle, { className: "draggable-dialog-title" },
66
67
  icon,
67
68
  React.createElement("span", { className: "dialogTitle" }, title)),
68
69
  React.createElement(DialogContent, null,
@@ -78,7 +79,7 @@ export class NotificationMU extends NotificationReact {
78
79
  const title = (_a = this.title) !== null && _a !== void 0 ? _a : labels.confirmTitle;
79
80
  const { okLabel = labels.confirmYes, cancelLabel = labels.confirmNo, inputs, fullScreen, fullWidth = true, maxWidth, primaryButton } = (_b = this.inputProps) !== null && _b !== void 0 ? _b : {};
80
81
  return (React.createElement(Dialog, { key: this.id, open: this.open, PaperComponent: DraggablePaperComponent, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen },
81
- React.createElement(IconDialogTitle, { id: "draggable-dialog-title" },
82
+ React.createElement(IconDialogTitle, { className: "draggable-dialog-title" },
82
83
  React.createElement(Help, { color: "action" }),
83
84
  React.createElement("span", { className: "dialogTitle" }, title)),
84
85
  React.createElement(DialogContent, null,
@@ -186,7 +187,7 @@ export class NotificationMU extends NotificationReact {
186
187
  }
187
188
  return (React.createElement(Dialog, { key: this.id, open: this.open, PaperComponent: DraggablePaperComponent, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen },
188
189
  React.createElement("form", null,
189
- React.createElement(IconDialogTitle, { id: "draggable-dialog-title" },
190
+ React.createElement(IconDialogTitle, { className: "draggable-dialog-title" },
190
191
  React.createElement(Info, { color: "primary" }),
191
192
  React.createElement("span", { className: "dialogTitle" }, title)),
192
193
  React.createElement(DialogContent, null,
@@ -4,6 +4,10 @@ import { TextFieldProps } from '@mui/material';
4
4
  * Search field props
5
5
  */
6
6
  export declare type SearchFieldProps = TextFieldProps & {
7
+ /**
8
+ * Change delay (ms) to avoid repeatly dispatch onChange
9
+ */
10
+ changeDelay?: number;
7
11
  /**
8
12
  * Is the field read only?
9
13
  */
@@ -8,12 +8,34 @@ import { MUGlobal } from './MUGlobal';
8
8
  */
9
9
  export function SearchField(props) {
10
10
  // Destruct
11
- const { InputLabelProps = {}, InputProps = {}, readOnly, size = MUGlobal.searchFieldSize, variant = MUGlobal.searchFieldVariant, ...rest } = props;
11
+ const { changeDelay, InputLabelProps = {}, InputProps = {}, onChange, readOnly, size = MUGlobal.searchFieldSize, variant = MUGlobal.searchFieldVariant, ...rest } = props;
12
12
  // Shrink
13
13
  InputLabelProps.shrink = MUGlobal.searchFieldShrink;
14
14
  // Read only
15
15
  if (readOnly != null)
16
16
  InputProps.readOnly = readOnly;
17
+ const isMounted = React.useRef(true);
18
+ const delaySeed = React.useRef(0);
19
+ const onChangeEx = (event) => {
20
+ if (onChange == null)
21
+ return;
22
+ if (changeDelay == null || changeDelay < 1) {
23
+ onChange(event);
24
+ return;
25
+ }
26
+ if (delaySeed.current > 0)
27
+ window.clearTimeout(delaySeed.current);
28
+ delaySeed.current = window.setTimeout(() => {
29
+ if (isMounted.current)
30
+ onChange(event);
31
+ }, changeDelay);
32
+ };
33
+ React.useEffect(() => {
34
+ return () => {
35
+ isMounted.current = false;
36
+ window.clearTimeout(delaySeed.current);
37
+ };
38
+ }, []);
17
39
  // Layout
18
- return (React.createElement(TextField, { InputLabelProps: InputLabelProps, InputProps: InputProps, size: size, variant: variant, ...rest }));
40
+ return (React.createElement(TextField, { InputLabelProps: InputLabelProps, InputProps: InputProps, onChange: onChangeEx, size: size, variant: variant, ...rest }));
19
41
  }
@@ -4,6 +4,10 @@ import { TextFieldProps } from '@mui/material';
4
4
  * Extended text field props
5
5
  */
6
6
  export declare type TextFieldExProps = TextFieldProps & {
7
+ /**
8
+ * Change delay (ms) to avoid repeatly dispatch onChange
9
+ */
10
+ changeDelay?: number;
7
11
  /**
8
12
  * On enter click
9
13
  */
@@ -32,6 +36,10 @@ export interface TextFieldExMethods {
32
36
  setError(error: React.ReactNode): void;
33
37
  }
34
38
  export declare const TextFieldEx: React.ForwardRefExoticComponent<(Pick<import("@mui/material").StandardTextFieldProps & {
39
+ /**
40
+ * Change delay (ms) to avoid repeatly dispatch onChange
41
+ */
42
+ changeDelay?: number | undefined;
35
43
  /**
36
44
  * On enter click
37
45
  */
@@ -48,7 +56,11 @@ export declare const TextFieldEx: React.ForwardRefExoticComponent<(Pick<import("
48
56
  * Show password button
49
57
  */
50
58
  showPassword?: boolean | undefined;
51
- }, "children" | "label" | "slot" | "select" | "style" | "title" | "value" | "className" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "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" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "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" | "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" | "disabled" | "sx" | "margin" | "fullWidth" | "size" | "variant" | "key" | "autoFocus" | "name" | "type" | "rows" | "error" | "autoComplete" | "readOnly" | "required" | "onEnter" | "inputProps" | "inputRef" | "SelectProps" | "InputLabelProps" | "focused" | "hiddenLabel" | "InputProps" | "FormHelperTextProps" | "helperText" | "multiline" | "maxRows" | "minRows" | "showClear" | "showPassword"> | Pick<import("@mui/material").FilledTextFieldProps & {
59
+ }, "children" | "label" | "slot" | "select" | "style" | "title" | "value" | "className" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "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" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "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" | "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" | "disabled" | "sx" | "margin" | "fullWidth" | "size" | "variant" | "key" | "autoFocus" | "name" | "type" | "rows" | "error" | "autoComplete" | "readOnly" | "required" | "onEnter" | "inputProps" | "inputRef" | "SelectProps" | "changeDelay" | "focused" | "hiddenLabel" | "InputLabelProps" | "InputProps" | "multiline" | "maxRows" | "minRows" | "FormHelperTextProps" | "helperText" | "showClear" | "showPassword"> | Pick<import("@mui/material").FilledTextFieldProps & {
60
+ /**
61
+ * Change delay (ms) to avoid repeatly dispatch onChange
62
+ */
63
+ changeDelay?: number | undefined;
52
64
  /**
53
65
  * On enter click
54
66
  */
@@ -65,7 +77,11 @@ export declare const TextFieldEx: React.ForwardRefExoticComponent<(Pick<import("
65
77
  * Show password button
66
78
  */
67
79
  showPassword?: boolean | undefined;
68
- }, "children" | "label" | "slot" | "select" | "style" | "title" | "value" | "className" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "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" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "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" | "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" | "disabled" | "sx" | "margin" | "fullWidth" | "size" | "variant" | "key" | "autoFocus" | "name" | "type" | "rows" | "error" | "autoComplete" | "readOnly" | "required" | "onEnter" | "inputProps" | "inputRef" | "SelectProps" | "InputLabelProps" | "focused" | "hiddenLabel" | "InputProps" | "FormHelperTextProps" | "helperText" | "multiline" | "maxRows" | "minRows" | "showClear" | "showPassword"> | Pick<import("@mui/material").OutlinedTextFieldProps & {
80
+ }, "children" | "label" | "slot" | "select" | "style" | "title" | "value" | "className" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "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" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "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" | "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" | "disabled" | "sx" | "margin" | "fullWidth" | "size" | "variant" | "key" | "autoFocus" | "name" | "type" | "rows" | "error" | "autoComplete" | "readOnly" | "required" | "onEnter" | "inputProps" | "inputRef" | "SelectProps" | "changeDelay" | "focused" | "hiddenLabel" | "InputLabelProps" | "InputProps" | "multiline" | "maxRows" | "minRows" | "FormHelperTextProps" | "helperText" | "showClear" | "showPassword"> | Pick<import("@mui/material").OutlinedTextFieldProps & {
81
+ /**
82
+ * Change delay (ms) to avoid repeatly dispatch onChange
83
+ */
84
+ changeDelay?: number | undefined;
69
85
  /**
70
86
  * On enter click
71
87
  */
@@ -82,4 +98,4 @@ export declare const TextFieldEx: React.ForwardRefExoticComponent<(Pick<import("
82
98
  * Show password button
83
99
  */
84
100
  showPassword?: boolean | undefined;
85
- }, "children" | "label" | "slot" | "select" | "style" | "title" | "value" | "className" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "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" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "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" | "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" | "disabled" | "sx" | "margin" | "fullWidth" | "size" | "variant" | "key" | "autoFocus" | "name" | "type" | "rows" | "error" | "autoComplete" | "readOnly" | "required" | "onEnter" | "inputProps" | "inputRef" | "SelectProps" | "InputLabelProps" | "focused" | "hiddenLabel" | "InputProps" | "FormHelperTextProps" | "helperText" | "multiline" | "maxRows" | "minRows" | "showClear" | "showPassword">) & React.RefAttributes<TextFieldExMethods>>;
101
+ }, "children" | "label" | "slot" | "select" | "style" | "title" | "value" | "className" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "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" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "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" | "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" | "disabled" | "sx" | "margin" | "fullWidth" | "size" | "variant" | "key" | "autoFocus" | "name" | "type" | "rows" | "error" | "autoComplete" | "readOnly" | "required" | "onEnter" | "inputProps" | "inputRef" | "SelectProps" | "changeDelay" | "focused" | "hiddenLabel" | "InputLabelProps" | "InputProps" | "multiline" | "maxRows" | "minRows" | "FormHelperTextProps" | "helperText" | "showClear" | "showPassword">) & React.RefAttributes<TextFieldExMethods>>;
@@ -5,7 +5,7 @@ import { Clear, Visibility } from '@mui/icons-material';
5
5
  import useCombinedRefs from '../uses/useCombinedRefs';
6
6
  export const TextFieldEx = React.forwardRef((props, ref) => {
7
7
  // Destructure
8
- const { error, fullWidth = true, helperText, InputProps = {}, onChange, onKeyPress, onEnter, inputRef, readOnly, showClear, showPassword, type, variant = MUGlobal.textFieldVariant, ...rest } = props;
8
+ const { changeDelay, error, fullWidth = true, helperText, InputProps = {}, onChange, onKeyPress, onEnter, inputRef, readOnly, showClear, showPassword, type, variant = MUGlobal.textFieldVariant, ...rest } = props;
9
9
  // State
10
10
  const [errorText, updateErrorText] = React.useState();
11
11
  const [passwordVisible, updatePasswordVisible] = React.useState();
@@ -56,24 +56,6 @@ export const TextFieldEx = React.forwardRef((props, ref) => {
56
56
  showClear && (React.createElement(IconButton, { onClick: clearClick, tabIndex: -1 },
57
57
  React.createElement(Clear, null)))));
58
58
  }
59
- // Extend change
60
- const onChangeEx = (e) => {
61
- if (errorText != null) {
62
- // Reset
63
- updateErrorText(undefined);
64
- }
65
- if (showClear || showPassword) {
66
- if (e.target.value === '') {
67
- updateEmpty(true);
68
- }
69
- else if (empty) {
70
- updateEmpty(false);
71
- }
72
- }
73
- if (onChange != null) {
74
- onChange(e);
75
- }
76
- };
77
59
  // Extend key precess
78
60
  const onKeyPressEx = onEnter == null
79
61
  ? onKeyPress
@@ -96,6 +78,40 @@ export const TextFieldEx = React.forwardRef((props, ref) => {
96
78
  updateErrorText(error);
97
79
  }
98
80
  }), []);
81
+ const isMounted = React.useRef(true);
82
+ const delaySeed = React.useRef(0);
83
+ const onChangeEx = (event) => {
84
+ if (errorText != null) {
85
+ // Reset
86
+ updateErrorText(undefined);
87
+ }
88
+ if (showClear || showPassword) {
89
+ if (event.target.value === '') {
90
+ updateEmpty(true);
91
+ }
92
+ else if (empty) {
93
+ updateEmpty(false);
94
+ }
95
+ }
96
+ if (onChange == null)
97
+ return;
98
+ if (changeDelay == null || changeDelay < 1) {
99
+ onChange(event);
100
+ return;
101
+ }
102
+ if (delaySeed.current > 0)
103
+ window.clearTimeout(delaySeed.current);
104
+ delaySeed.current = window.setTimeout(() => {
105
+ if (isMounted.current)
106
+ onChange(event);
107
+ }, changeDelay);
108
+ };
109
+ React.useEffect(() => {
110
+ return () => {
111
+ isMounted.current = false;
112
+ window.clearTimeout(delaySeed.current);
113
+ };
114
+ }, []);
99
115
  // Textfield
100
116
  return (React.createElement(TextField, { error: errorEx, fullWidth: fullWidth, helperText: helperTextEx, inputRef: useCombinedRefs(inputRef, localRef), InputProps: InputProps, onChange: onChangeEx, onKeyPress: onKeyPressEx, type: typeEx, variant: variant, ...rest }));
101
117
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.2.77",
3
+ "version": "1.2.81",
4
4
  "description": "TypeScript ReactJs framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -50,16 +50,16 @@
50
50
  "@emotion/react": "^11.5.0",
51
51
  "@emotion/style": "^0.8.0",
52
52
  "@emotion/styled": "^11.3.0",
53
- "@etsoo/appscript": "^1.1.26",
53
+ "@etsoo/appscript": "^1.1.27",
54
54
  "@etsoo/notificationbase": "^1.0.91",
55
55
  "@etsoo/shared": "^1.0.62",
56
- "@mui/icons-material": "^5.0.4",
57
- "@mui/material": "^5.0.4",
56
+ "@mui/icons-material": "^5.0.5",
57
+ "@mui/material": "^5.0.6",
58
58
  "@reach/router": "^1.3.4",
59
59
  "@types/pica": "^5.1.3",
60
60
  "@types/pulltorefreshjs": "^0.1.5",
61
61
  "@types/reach__router": "^1.3.9",
62
- "@types/react": "^17.0.32",
62
+ "@types/react": "^17.0.33",
63
63
  "@types/react-avatar-editor": "^10.3.6",
64
64
  "@types/react-dom": "^17.0.10",
65
65
  "@types/react-input-mask": "^3.0.1",
@@ -81,8 +81,8 @@
81
81
  "@babel/runtime-corejs3": "^7.15.4",
82
82
  "@types/jest": "^27.0.2",
83
83
  "@types/react-test-renderer": "^17.0.1",
84
- "@typescript-eslint/eslint-plugin": "^5.1.0",
85
- "@typescript-eslint/parser": "^5.1.0",
84
+ "@typescript-eslint/eslint-plugin": "^5.2.0",
85
+ "@typescript-eslint/parser": "^5.2.0",
86
86
  "eslint": "^8.1.0",
87
87
  "eslint-config-airbnb-base": "^14.2.1",
88
88
  "eslint-plugin-import": "^2.25.2",
@@ -42,6 +42,8 @@ export const CountdownButton = React.forwardRef<
42
42
  // Countdown length
43
43
  const [shared] = React.useState({ maxLength: 0 });
44
44
 
45
+ const isMounted = React.useRef(true);
46
+
45
47
  // endIcon
46
48
  let endIcon: React.ReactNode;
47
49
  if (state === 0) {
@@ -70,6 +72,9 @@ export const CountdownButton = React.forwardRef<
70
72
  shared.maxLength = result.toString().length;
71
73
 
72
74
  const seed = setInterval(() => {
75
+ // Mounted?
76
+ if (!isMounted.current) return;
77
+
73
78
  // Last 1 second and then complete
74
79
  if (result > seconds + 1) {
75
80
  result--;
@@ -96,6 +101,12 @@ export const CountdownButton = React.forwardRef<
96
101
  onAction().then(doAction);
97
102
  };
98
103
 
104
+ React.useEffect(() => {
105
+ return () => {
106
+ isMounted.current = false;
107
+ };
108
+ }, []);
109
+
99
110
  return (
100
111
  <Button
101
112
  disabled={disabled}
@@ -10,7 +10,7 @@ import Draggable from 'react-draggable';
10
10
  export function DraggablePaperComponent(props: PaperProps) {
11
11
  return (
12
12
  <Draggable
13
- handle="#draggable-dialog-title"
13
+ handle=".draggable-dialog-title"
14
14
  cancel={'[class*="MuiDialogContent-root"]'}
15
15
  >
16
16
  <Paper {...props} />
@@ -2,15 +2,34 @@ import { TextField, TextFieldProps } from '@mui/material';
2
2
  import React from 'react';
3
3
  import { MUGlobal } from './MUGlobal';
4
4
 
5
+ /**
6
+ * Input field props
7
+ */
8
+ export type InputFieldProps = TextFieldProps & {
9
+ /**
10
+ * Change delay (ms) to avoid repeatly dispatch onChange
11
+ */
12
+ changeDelay?: number;
13
+
14
+ /**
15
+ * Is the field read only?
16
+ */
17
+ readOnly?: boolean;
18
+ };
19
+
5
20
  /**
6
21
  * Input field
7
22
  * @param props Props
8
23
  * @returns Component
9
24
  */
10
- export function InputField(props: TextFieldProps) {
25
+ export function InputField(props: InputFieldProps) {
11
26
  // Destruct
12
27
  const {
28
+ changeDelay,
13
29
  InputLabelProps = {},
30
+ InputProps = {},
31
+ onChange,
32
+ readOnly,
14
33
  size = MUGlobal.inputFieldSize,
15
34
  variant = MUGlobal.inputFieldVariant,
16
35
  ...rest
@@ -19,10 +38,41 @@ export function InputField(props: TextFieldProps) {
19
38
  // Shrink
20
39
  InputLabelProps.shrink = MUGlobal.searchFieldShrink;
21
40
 
41
+ // Read only
42
+ if (readOnly != null) InputProps.readOnly = readOnly;
43
+
44
+ const isMounted = React.useRef(true);
45
+ const delaySeed = React.useRef(0);
46
+
47
+ const onChangeEx = (
48
+ event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>
49
+ ) => {
50
+ if (onChange == null) return;
51
+
52
+ if (changeDelay == null || changeDelay < 1) {
53
+ onChange(event);
54
+ return;
55
+ }
56
+
57
+ if (delaySeed.current > 0) window.clearTimeout(delaySeed.current);
58
+ delaySeed.current = window.setTimeout(() => {
59
+ if (isMounted.current) onChange(event);
60
+ }, changeDelay);
61
+ };
62
+
63
+ React.useEffect(() => {
64
+ return () => {
65
+ isMounted.current = false;
66
+ window.clearTimeout(delaySeed.current);
67
+ };
68
+ }, []);
69
+
22
70
  // Layout
23
71
  return (
24
72
  <TextField
25
73
  InputLabelProps={InputLabelProps}
74
+ InputProps={InputProps}
75
+ onChange={onChangeEx}
26
76
  size={size}
27
77
  variant={variant}
28
78
  {...rest}
@@ -42,6 +42,7 @@ import { LoadingButton, LoadingButtonProps } from './LoadingButton';
42
42
  // Custom icon dialog title bar
43
43
  const IconDialogTitle = styled(DialogTitle)`
44
44
  ${({ theme }) => `
45
+ cursor: move;
45
46
  display: flex;
46
47
  align-items: center;
47
48
  & .dialogTitle {
@@ -112,7 +113,7 @@ export class NotificationMU extends NotificationReact {
112
113
  maxWidth={maxWidth}
113
114
  fullScreen={fullScreen}
114
115
  >
115
- <IconDialogTitle id="draggable-dialog-title">
116
+ <IconDialogTitle className="draggable-dialog-title">
116
117
  {icon}
117
118
  <span className="dialogTitle">{title}</span>
118
119
  </IconDialogTitle>
@@ -159,7 +160,7 @@ export class NotificationMU extends NotificationReact {
159
160
  maxWidth={maxWidth}
160
161
  fullScreen={fullScreen}
161
162
  >
162
- <IconDialogTitle id="draggable-dialog-title">
163
+ <IconDialogTitle className="draggable-dialog-title">
163
164
  <Help color="action" />
164
165
  <span className="dialogTitle">{title}</span>
165
166
  </IconDialogTitle>
@@ -331,7 +332,7 @@ export class NotificationMU extends NotificationReact {
331
332
  fullScreen={fullScreen}
332
333
  >
333
334
  <form>
334
- <IconDialogTitle id="draggable-dialog-title">
335
+ <IconDialogTitle className="draggable-dialog-title">
335
336
  <Info color="primary" />
336
337
  <span className="dialogTitle">{title}</span>
337
338
  </IconDialogTitle>
@@ -6,6 +6,11 @@ import { MUGlobal } from './MUGlobal';
6
6
  * Search field props
7
7
  */
8
8
  export type SearchFieldProps = TextFieldProps & {
9
+ /**
10
+ * Change delay (ms) to avoid repeatly dispatch onChange
11
+ */
12
+ changeDelay?: number;
13
+
9
14
  /**
10
15
  * Is the field read only?
11
16
  */
@@ -20,8 +25,10 @@ export type SearchFieldProps = TextFieldProps & {
20
25
  export function SearchField(props: SearchFieldProps) {
21
26
  // Destruct
22
27
  const {
28
+ changeDelay,
23
29
  InputLabelProps = {},
24
30
  InputProps = {},
31
+ onChange,
25
32
  readOnly,
26
33
  size = MUGlobal.searchFieldSize,
27
34
  variant = MUGlobal.searchFieldVariant,
@@ -34,11 +41,38 @@ export function SearchField(props: SearchFieldProps) {
34
41
  // Read only
35
42
  if (readOnly != null) InputProps.readOnly = readOnly;
36
43
 
44
+ const isMounted = React.useRef(true);
45
+ const delaySeed = React.useRef(0);
46
+
47
+ const onChangeEx = (
48
+ event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>
49
+ ) => {
50
+ if (onChange == null) return;
51
+
52
+ if (changeDelay == null || changeDelay < 1) {
53
+ onChange(event);
54
+ return;
55
+ }
56
+
57
+ if (delaySeed.current > 0) window.clearTimeout(delaySeed.current);
58
+ delaySeed.current = window.setTimeout(() => {
59
+ if (isMounted.current) onChange(event);
60
+ }, changeDelay);
61
+ };
62
+
63
+ React.useEffect(() => {
64
+ return () => {
65
+ isMounted.current = false;
66
+ window.clearTimeout(delaySeed.current);
67
+ };
68
+ }, []);
69
+
37
70
  // Layout
38
71
  return (
39
72
  <TextField
40
73
  InputLabelProps={InputLabelProps}
41
74
  InputProps={InputProps}
75
+ onChange={onChangeEx}
42
76
  size={size}
43
77
  variant={variant}
44
78
  {...rest}
@@ -13,6 +13,11 @@ import useCombinedRefs from '../uses/useCombinedRefs';
13
13
  * Extended text field props
14
14
  */
15
15
  export type TextFieldExProps = TextFieldProps & {
16
+ /**
17
+ * Change delay (ms) to avoid repeatly dispatch onChange
18
+ */
19
+ changeDelay?: number;
20
+
16
21
  /**
17
22
  * On enter click
18
23
  */
@@ -51,6 +56,7 @@ export const TextFieldEx = React.forwardRef<
51
56
  >((props, ref) => {
52
57
  // Destructure
53
58
  const {
59
+ changeDelay,
54
60
  error,
55
61
  fullWidth = true,
56
62
  helperText,
@@ -144,26 +150,6 @@ export const TextFieldEx = React.forwardRef<
144
150
  );
145
151
  }
146
152
 
147
- // Extend change
148
- const onChangeEx = (e: React.ChangeEvent<HTMLInputElement>) => {
149
- if (errorText != null) {
150
- // Reset
151
- updateErrorText(undefined);
152
- }
153
-
154
- if (showClear || showPassword) {
155
- if (e.target.value === '') {
156
- updateEmpty(true);
157
- } else if (empty) {
158
- updateEmpty(false);
159
- }
160
- }
161
-
162
- if (onChange != null) {
163
- onChange(e);
164
- }
165
- };
166
-
167
153
  // Extend key precess
168
154
  const onKeyPressEx =
169
155
  onEnter == null
@@ -194,6 +180,45 @@ export const TextFieldEx = React.forwardRef<
194
180
  []
195
181
  );
196
182
 
183
+ const isMounted = React.useRef(true);
184
+ const delaySeed = React.useRef(0);
185
+
186
+ const onChangeEx = (
187
+ event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>
188
+ ) => {
189
+ if (errorText != null) {
190
+ // Reset
191
+ updateErrorText(undefined);
192
+ }
193
+
194
+ if (showClear || showPassword) {
195
+ if (event.target.value === '') {
196
+ updateEmpty(true);
197
+ } else if (empty) {
198
+ updateEmpty(false);
199
+ }
200
+ }
201
+
202
+ if (onChange == null) return;
203
+
204
+ if (changeDelay == null || changeDelay < 1) {
205
+ onChange(event);
206
+ return;
207
+ }
208
+
209
+ if (delaySeed.current > 0) window.clearTimeout(delaySeed.current);
210
+ delaySeed.current = window.setTimeout(() => {
211
+ if (isMounted.current) onChange(event);
212
+ }, changeDelay);
213
+ };
214
+
215
+ React.useEffect(() => {
216
+ return () => {
217
+ isMounted.current = false;
218
+ window.clearTimeout(delaySeed.current);
219
+ };
220
+ }, []);
221
+
197
222
  // Textfield
198
223
  return (
199
224
  <TextField