@etsoo/materialui 1.0.99 → 1.1.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.
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ComboBox } from '../src';
3
3
  import { fireEvent, render, screen } from '@testing-library/react';
4
- import '@testing-library/jest-dom/extend-expect';
4
+ //import '@testing-library/jest-dom/extend-expect';
5
5
 
6
6
  it('Render ComboBox', async () => {
7
7
  // Arrange
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import { SelectEx } from '../src';
3
3
  import { findByText, fireEvent, render, screen } from '@testing-library/react';
4
- import '@testing-library/jest-dom/extend-expect';
5
4
  import { ListType1, Utils } from '@etsoo/shared';
6
5
  import { act } from 'react-dom/test-utils';
7
6
 
package/babel.config.json CHANGED
@@ -1,5 +1,9 @@
1
1
  {
2
- "presets": [["@babel/env"]],
2
+ "presets": [
3
+ ["@babel/env"],
4
+ "@babel/preset-typescript",
5
+ "@babel/preset-react"
6
+ ],
3
7
  "plugins": [
4
8
  [
5
9
  "@babel/plugin-transform-runtime",
@@ -17,7 +17,7 @@ export declare class NotificationMU extends NotificationReact {
17
17
  * @param className Style class name
18
18
  * @param classes Style classes
19
19
  */
20
- render(props: NotificationRenderProps, className: string): JSX.Element;
20
+ render(props: NotificationRenderProps, className?: string): JSX.Element;
21
21
  }
22
22
  /**
23
23
  * Antd notifier
@@ -1,6 +1,6 @@
1
1
  import { DataTypes, Utils } from '@etsoo/shared';
2
2
  import { Box, Checkbox, FormControl, FormControlLabel, FormGroup, FormHelperText, InputLabel, Radio, RadioGroup, useTheme } from '@mui/material';
3
- import NotchedOutline from '@mui/material/OutlinedInput/NotchedOutline';
3
+ import NotchedOutline from '@mui/material/OutlinedInput';
4
4
  import React from 'react';
5
5
  /**
6
6
  * OptionGroup
@@ -12,6 +12,12 @@ export type TextFieldExProps = TextFieldProps & {
12
12
  * On enter click
13
13
  */
14
14
  onEnter?: React.KeyboardEventHandler<HTMLDivElement>;
15
+ /**
16
+ * On visibility
17
+ * @param input HTML input
18
+ * @returns Result
19
+ */
20
+ onVisibility?: (input: HTMLInputElement) => void | boolean | Promise<boolean>;
15
21
  /**
16
22
  * Is the field read only?
17
23
  */
@@ -44,6 +50,12 @@ export declare const TextFieldEx: React.ForwardRefExoticComponent<(Pick<import("
44
50
  * On enter click
45
51
  */
46
52
  onEnter?: React.KeyboardEventHandler<HTMLDivElement> | undefined;
53
+ /**
54
+ * On visibility
55
+ * @param input HTML input
56
+ * @returns Result
57
+ */
58
+ onVisibility?: ((input: HTMLInputElement) => void | boolean | Promise<boolean>) | undefined;
47
59
  /**
48
60
  * Is the field read only?
49
61
  */
@@ -56,7 +68,7 @@ export declare const TextFieldEx: React.ForwardRefExoticComponent<(Pick<import("
56
68
  * Show password button
57
69
  */
58
70
  showPassword?: boolean | undefined;
59
- }, "className" | "style" | "classes" | "children" | "sx" | "variant" | "label" | "slot" | "select" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "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" | "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" | "disabled" | "type" | "margin" | "size" | "name" | "autoFocus" | "value" | "autoComplete" | "readOnly" | "required" | "rows" | "fullWidth" | "error" | "inputProps" | "onEnter" | "inputRef" | "focused" | "hiddenLabel" | "multiline" | "maxRows" | "minRows" | "changeDelay" | "InputLabelProps" | "InputProps" | "FormHelperTextProps" | "helperText" | "SelectProps" | "showClear" | "showPassword"> | Pick<import("@mui/material").FilledTextFieldProps & {
71
+ }, "className" | "style" | "classes" | "children" | "sx" | "variant" | "label" | "slot" | "select" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "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" | "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" | "disabled" | "type" | "margin" | "size" | "name" | "autoFocus" | "value" | "autoComplete" | "readOnly" | "required" | "rows" | "fullWidth" | "error" | "inputProps" | "onEnter" | "inputRef" | "focused" | "hiddenLabel" | "multiline" | "maxRows" | "minRows" | "changeDelay" | "InputLabelProps" | "InputProps" | "FormHelperTextProps" | "helperText" | "SelectProps" | "onVisibility" | "showClear" | "showPassword"> | Pick<import("@mui/material").FilledTextFieldProps & {
60
72
  /**
61
73
  * Change delay (ms) to avoid repeatly dispatch onChange
62
74
  */
@@ -65,6 +77,12 @@ export declare const TextFieldEx: React.ForwardRefExoticComponent<(Pick<import("
65
77
  * On enter click
66
78
  */
67
79
  onEnter?: React.KeyboardEventHandler<HTMLDivElement> | undefined;
80
+ /**
81
+ * On visibility
82
+ * @param input HTML input
83
+ * @returns Result
84
+ */
85
+ onVisibility?: ((input: HTMLInputElement) => void | boolean | Promise<boolean>) | undefined;
68
86
  /**
69
87
  * Is the field read only?
70
88
  */
@@ -77,7 +95,7 @@ export declare const TextFieldEx: React.ForwardRefExoticComponent<(Pick<import("
77
95
  * Show password button
78
96
  */
79
97
  showPassword?: boolean | undefined;
80
- }, "className" | "style" | "classes" | "children" | "sx" | "variant" | "label" | "slot" | "select" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "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" | "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" | "disabled" | "type" | "margin" | "size" | "name" | "autoFocus" | "value" | "autoComplete" | "readOnly" | "required" | "rows" | "fullWidth" | "error" | "inputProps" | "onEnter" | "inputRef" | "focused" | "hiddenLabel" | "multiline" | "maxRows" | "minRows" | "changeDelay" | "InputLabelProps" | "InputProps" | "FormHelperTextProps" | "helperText" | "SelectProps" | "showClear" | "showPassword"> | Pick<import("@mui/material").OutlinedTextFieldProps & {
98
+ }, "className" | "style" | "classes" | "children" | "sx" | "variant" | "label" | "slot" | "select" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "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" | "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" | "disabled" | "type" | "margin" | "size" | "name" | "autoFocus" | "value" | "autoComplete" | "readOnly" | "required" | "rows" | "fullWidth" | "error" | "inputProps" | "onEnter" | "inputRef" | "focused" | "hiddenLabel" | "multiline" | "maxRows" | "minRows" | "changeDelay" | "InputLabelProps" | "InputProps" | "FormHelperTextProps" | "helperText" | "SelectProps" | "onVisibility" | "showClear" | "showPassword"> | Pick<import("@mui/material").OutlinedTextFieldProps & {
81
99
  /**
82
100
  * Change delay (ms) to avoid repeatly dispatch onChange
83
101
  */
@@ -86,6 +104,12 @@ export declare const TextFieldEx: React.ForwardRefExoticComponent<(Pick<import("
86
104
  * On enter click
87
105
  */
88
106
  onEnter?: React.KeyboardEventHandler<HTMLDivElement> | undefined;
107
+ /**
108
+ * On visibility
109
+ * @param input HTML input
110
+ * @returns Result
111
+ */
112
+ onVisibility?: ((input: HTMLInputElement) => void | boolean | Promise<boolean>) | undefined;
89
113
  /**
90
114
  * Is the field read only?
91
115
  */
@@ -98,4 +122,4 @@ export declare const TextFieldEx: React.ForwardRefExoticComponent<(Pick<import("
98
122
  * Show password button
99
123
  */
100
124
  showPassword?: boolean | undefined;
101
- }, "className" | "style" | "classes" | "children" | "sx" | "variant" | "label" | "slot" | "select" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "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" | "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" | "disabled" | "type" | "margin" | "size" | "name" | "autoFocus" | "value" | "autoComplete" | "readOnly" | "required" | "rows" | "fullWidth" | "error" | "inputProps" | "onEnter" | "inputRef" | "focused" | "hiddenLabel" | "multiline" | "maxRows" | "minRows" | "changeDelay" | "InputLabelProps" | "InputProps" | "FormHelperTextProps" | "helperText" | "SelectProps" | "showClear" | "showPassword">) & React.RefAttributes<TextFieldExMethods>>;
125
+ }, "className" | "style" | "classes" | "children" | "sx" | "variant" | "label" | "slot" | "select" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "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" | "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" | "disabled" | "type" | "margin" | "size" | "name" | "autoFocus" | "value" | "autoComplete" | "readOnly" | "required" | "rows" | "fullWidth" | "error" | "inputProps" | "onEnter" | "inputRef" | "focused" | "hiddenLabel" | "multiline" | "maxRows" | "minRows" | "changeDelay" | "InputLabelProps" | "InputProps" | "FormHelperTextProps" | "helperText" | "SelectProps" | "onVisibility" | "showClear" | "showPassword">) & React.RefAttributes<TextFieldExMethods>>;
@@ -6,7 +6,7 @@ import { Keyboard } from '@etsoo/shared';
6
6
  import { useCombinedRefs, useDelayedExecutor } from '@etsoo/react';
7
7
  export const TextFieldEx = React.forwardRef((props, ref) => {
8
8
  // Destructure
9
- const { changeDelay, error, fullWidth = true, helperText, InputProps = {}, onChange, onKeyPress, onEnter, inputRef, readOnly, showClear, showPassword, type, variant = MUGlobal.textFieldVariant, ...rest } = props;
9
+ const { changeDelay, error, fullWidth = true, helperText, InputProps = {}, onChange, onKeyPress, onEnter, onVisibility, inputRef, readOnly, showClear, showPassword, type, variant = MUGlobal.textFieldVariant, ...rest } = props;
10
10
  // State
11
11
  const [errorText, updateErrorText] = React.useState();
12
12
  const [empty, updateEmpty] = React.useState(true);
@@ -46,9 +46,14 @@ export const TextFieldEx = React.forwardRef((props, ref) => {
46
46
  if (e.isDefaultPrevented())
47
47
  e.preventDefault();
48
48
  };
49
- const touchStart = (e) => {
49
+ const touchStart = async (e) => {
50
50
  // Show the password
51
51
  if (input) {
52
+ if (onVisibility) {
53
+ const result = await onVisibility(input);
54
+ if (result === false)
55
+ return;
56
+ }
52
57
  input.blur();
53
58
  input.type = 'text';
54
59
  }
@@ -56,8 +61,11 @@ export const TextFieldEx = React.forwardRef((props, ref) => {
56
61
  };
57
62
  const touchEnd = (e) => {
58
63
  // Show the password
59
- if (input)
64
+ if (input) {
65
+ if (onVisibility)
66
+ return;
60
67
  input.type = 'password';
68
+ }
61
69
  preventDefault(e);
62
70
  };
63
71
  // Show password and/or clear button
@@ -98,7 +98,7 @@ export declare class ReactApp<S extends IAppSettings, D extends IUser, P extends
98
98
  /**
99
99
  * Get notifier provider
100
100
  */
101
- static get notifierProvider(): React.FunctionComponent<object>;
101
+ static get notifierProvider(): React.FunctionComponent<DataTypes.StringRecord>;
102
102
  private static createNotifier;
103
103
  /**
104
104
  * Culture state
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.0.99",
3
+ "version": "1.1.1",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -18,11 +18,10 @@
18
18
  ],
19
19
  "testEnvironment": "jsdom",
20
20
  "transform": {
21
- ".+\\.jsx?$": "babel-jest",
22
- ".+\\.tsx?$": "ts-jest"
21
+ "^.+\\.[t|j]sx?$": "babel-jest"
23
22
  },
24
23
  "transformIgnorePatterns": [
25
- "/node_modules/(?!@etsoo/).+\\.js$"
24
+ "/node_modules/(?!(@etsoo)/)"
26
25
  ]
27
26
  },
28
27
  "repository": {
@@ -46,22 +45,22 @@
46
45
  },
47
46
  "homepage": "https://github.com/ETSOO/ReactMU#readme",
48
47
  "dependencies": {
49
- "@dnd-kit/core": "^6.0.5",
48
+ "@dnd-kit/core": "^6.0.6",
50
49
  "@dnd-kit/sortable": "^7.0.1",
51
50
  "@emotion/css": "^11.10.5",
52
51
  "@emotion/react": "^11.10.5",
53
52
  "@emotion/styled": "^11.10.5",
54
- "@etsoo/appscript": "^1.3.44",
55
- "@etsoo/notificationbase": "^1.1.18",
56
- "@etsoo/react": "^1.6.35",
57
- "@etsoo/shared": "^1.1.79",
58
- "@mui/icons-material": "^5.10.16",
59
- "@mui/material": "^5.10.16",
53
+ "@etsoo/appscript": "^1.3.50",
54
+ "@etsoo/notificationbase": "^1.1.20",
55
+ "@etsoo/react": "^1.6.37",
56
+ "@etsoo/shared": "^1.1.84",
57
+ "@mui/icons-material": "^5.11.0",
58
+ "@mui/material": "^5.11.2",
60
59
  "@types/pica": "^9.0.1",
61
60
  "@types/pulltorefreshjs": "^0.1.5",
62
61
  "@types/react": "^18.0.26",
63
62
  "@types/react-avatar-editor": "^13.0.0",
64
- "@types/react-dom": "^18.0.9",
63
+ "@types/react-dom": "^18.0.10",
65
64
  "@types/react-input-mask": "^3.0.2",
66
65
  "@types/react-window": "^1.8.5",
67
66
  "pica": "^9.0.1",
@@ -71,27 +70,28 @@
71
70
  "react-dom": "^18.2.0",
72
71
  "react-draggable": "^4.4.5",
73
72
  "react-imask": "^6.4.3",
74
- "react-router-dom": "^6.4.4",
73
+ "react-router-dom": "^6.6.1",
75
74
  "react-window": "^1.8.8"
76
75
  },
77
76
  "devDependencies": {
78
- "@babel/cli": "^7.19.3",
79
- "@babel/core": "^7.20.5",
77
+ "@babel/cli": "^7.20.7",
78
+ "@babel/core": "^7.20.7",
80
79
  "@babel/plugin-transform-runtime": "^7.19.6",
80
+ "@babel/preset-typescript": "^7.18.6",
81
81
  "@babel/preset-env": "^7.20.2",
82
- "@babel/runtime-corejs3": "^7.20.6",
82
+ "@babel/preset-react": "^7.18.6",
83
+ "@babel/runtime-corejs3": "^7.20.7",
83
84
  "@testing-library/jest-dom": "^5.16.5",
84
85
  "@testing-library/react": "^13.4.0",
85
- "@types/jest": "^29.2.3",
86
- "@typescript-eslint/eslint-plugin": "^5.45.0",
87
- "@typescript-eslint/parser": "^5.45.0",
88
- "eslint": "^8.29.0",
86
+ "@types/jest": "^29.2.4",
87
+ "@typescript-eslint/eslint-plugin": "^5.47.1",
88
+ "@typescript-eslint/parser": "^5.47.1",
89
+ "eslint": "^8.30.0",
89
90
  "eslint-config-airbnb-base": "^15.0.0",
90
91
  "eslint-plugin-import": "^2.26.0",
91
92
  "eslint-plugin-react": "^7.31.11",
92
93
  "jest": "^29.3.1",
93
94
  "jest-environment-jsdom": "^29.3.1",
94
- "ts-jest": "^29.0.3",
95
- "typescript": "^4.9.3"
95
+ "typescript": "^4.9.4"
96
96
  }
97
97
  }
@@ -59,7 +59,7 @@ const IconDialogTitle = styled(DialogTitle)`
59
59
  */
60
60
  export class NotificationMU extends NotificationReact {
61
61
  // Create alert
62
- private createAlert(_props: NotificationRenderProps, className: string) {
62
+ private createAlert(_props: NotificationRenderProps, className?: string) {
63
63
  const labels = Labels.NotificationMU;
64
64
 
65
65
  const {
@@ -140,7 +140,7 @@ export class NotificationMU extends NotificationReact {
140
140
  }
141
141
 
142
142
  // Create confirm
143
- private createConfirm(_props: NotificationRenderProps, className: string) {
143
+ private createConfirm(_props: NotificationRenderProps, className?: string) {
144
144
  const labels = Labels.NotificationMU;
145
145
  const title = this.title ?? labels.confirmTitle;
146
146
 
@@ -222,7 +222,7 @@ export class NotificationMU extends NotificationReact {
222
222
  }
223
223
 
224
224
  // Create message
225
- private createMessage(_props: NotificationRenderProps, className: string) {
225
+ private createMessage(_props: NotificationRenderProps, className?: string) {
226
226
  if (!this.open) return <React.Fragment key={this.id}></React.Fragment>;
227
227
 
228
228
  const setupProps: AlertProps = {
@@ -248,7 +248,7 @@ export class NotificationMU extends NotificationReact {
248
248
  }
249
249
 
250
250
  // Create prompt
251
- private createPrompt(_props: NotificationRenderProps, className: string) {
251
+ private createPrompt(_props: NotificationRenderProps, className?: string) {
252
252
  const labels = Labels.NotificationMU;
253
253
  const title = this.title ?? labels.promptTitle;
254
254
 
@@ -431,7 +431,7 @@ export class NotificationMU extends NotificationReact {
431
431
  }
432
432
 
433
433
  // Create loading
434
- private createLoading(_props: NotificationRenderProps, className: string) {
434
+ private createLoading(_props: NotificationRenderProps, className?: string) {
435
435
  // Properties
436
436
  const setupProps: CircularProgressProps = { color: 'primary' };
437
437
 
@@ -487,7 +487,7 @@ export class NotificationMU extends NotificationReact {
487
487
  * @param className Style class name
488
488
  * @param classes Style classes
489
489
  */
490
- render(props: NotificationRenderProps, className: string) {
490
+ render(props: NotificationRenderProps, className?: string) {
491
491
  // Loading bar
492
492
  if (this.type === NotificationType.Loading) {
493
493
  return this.createLoading(props, className);
@@ -18,7 +18,7 @@ import {
18
18
  RadioGroup,
19
19
  useTheme
20
20
  } from '@mui/material';
21
- import NotchedOutline from '@mui/material/OutlinedInput/NotchedOutline';
21
+ import NotchedOutline from '@mui/material/OutlinedInput';
22
22
  import React from 'react';
23
23
 
24
24
  /**
@@ -24,6 +24,15 @@ export type TextFieldExProps = TextFieldProps & {
24
24
  */
25
25
  onEnter?: React.KeyboardEventHandler<HTMLDivElement>;
26
26
 
27
+ /**
28
+ * On visibility
29
+ * @param input HTML input
30
+ * @returns Result
31
+ */
32
+ onVisibility?: (
33
+ input: HTMLInputElement
34
+ ) => void | boolean | Promise<boolean>;
35
+
27
36
  /**
28
37
  * Is the field read only?
29
38
  */
@@ -65,6 +74,7 @@ export const TextFieldEx = React.forwardRef<
65
74
  onChange,
66
75
  onKeyPress,
67
76
  onEnter,
77
+ onVisibility,
68
78
  inputRef,
69
79
  readOnly,
70
80
  showClear,
@@ -121,9 +131,14 @@ export const TextFieldEx = React.forwardRef<
121
131
  if (e.isDefaultPrevented()) e.preventDefault();
122
132
  };
123
133
 
124
- const touchStart = (e: React.TouchEvent | React.MouseEvent) => {
134
+ const touchStart = async (e: React.TouchEvent | React.MouseEvent) => {
125
135
  // Show the password
126
136
  if (input) {
137
+ if (onVisibility) {
138
+ const result = await onVisibility(input);
139
+ if (result === false) return;
140
+ }
141
+
127
142
  input.blur();
128
143
  input.type = 'text';
129
144
  }
@@ -132,7 +147,11 @@ export const TextFieldEx = React.forwardRef<
132
147
 
133
148
  const touchEnd = (e: React.TouchEvent | React.MouseEvent) => {
134
149
  // Show the password
135
- if (input) input.type = 'password';
150
+ if (input) {
151
+ if (onVisibility) return;
152
+
153
+ input.type = 'password';
154
+ }
136
155
  preventDefault(e);
137
156
  };
138
157