@etsoo/react 1.5.44 → 1.5.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/mu/RLink.d.ts CHANGED
@@ -1,8 +1,14 @@
1
1
  import { LinkProps } from '@mui/material';
2
2
  import React from 'react';
3
+ /**
4
+ * Router Link properties
5
+ */
6
+ export declare type RLinkProps = LinkProps & {
7
+ delay?: number;
8
+ };
3
9
  /**
4
10
  * Router Link
5
11
  * @param props Props
6
12
  * @returns Component
7
13
  */
8
- export declare const RLink: React.ForwardRefExoticComponent<Pick<LinkProps<"a", {}>, "role" | "children" | "p" | "slot" | "title" | "maxWidth" | "type" | keyof import("@mui/material/OverridableComponent").CommonProps | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "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" | "sx" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "href" | "variant" | "key" | "underline" | "media" | "target" | "hrefLang" | "referrerPolicy" | "rel" | "download" | "ping" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping" | "TypographyClasses"> & React.RefAttributes<HTMLAnchorElement>>;
14
+ export declare const RLink: React.ForwardRefExoticComponent<Pick<RLinkProps, "role" | "children" | "p" | "slot" | "title" | "maxWidth" | "type" | keyof import("@mui/material/OverridableComponent").CommonProps | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "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" | "sx" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "href" | "variant" | "key" | "underline" | "media" | "target" | "hrefLang" | "referrerPolicy" | "rel" | "download" | "ping" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping" | "TypographyClasses" | "delay"> & React.RefAttributes<HTMLAnchorElement>>;
package/lib/mu/RLink.js CHANGED
@@ -9,11 +9,11 @@ import { useDelayedExecutor } from '../uses/useDelayedExecutor';
9
9
  */
10
10
  export const RLink = React.forwardRef((props, ref) => {
11
11
  // Destruct
12
- const { href, target, onClick, ...rest } = props;
12
+ const { delay = 0, href, target, onClick, ...rest } = props;
13
13
  const delayed = useDelayedExecutor((href) => {
14
14
  // Router push
15
15
  globalApp.history.push(href);
16
- }, 100);
16
+ }, delay);
17
17
  // Click handler
18
18
  const onClickLocl = (event) => {
19
19
  if (onClick)
@@ -24,9 +24,11 @@ export const RLink = React.forwardRef((props, ref) => {
24
24
  globalApp) {
25
25
  // Prevent href action
26
26
  event.preventDefault();
27
+ // Delayed excution
27
28
  delayed.call(undefined, href);
28
29
  }
29
30
  };
31
+ // Clear when exit
30
32
  React.useEffect(() => {
31
33
  return () => delayed.clear();
32
34
  }, [delayed]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.5.44",
3
+ "version": "1.5.47",
4
4
  "description": "TypeScript ReactJs framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -47,51 +47,51 @@
47
47
  "homepage": "https://github.com/ETSOO/AppReact#readme",
48
48
  "dependencies": {
49
49
  "@emotion/css": "^11.9.0",
50
- "@emotion/react": "^11.9.0",
50
+ "@emotion/react": "^11.9.3",
51
51
  "@emotion/style": "^0.8.0",
52
- "@emotion/styled": "^11.8.1",
53
- "@etsoo/appscript": "^1.2.61",
52
+ "@emotion/styled": "^11.9.3",
53
+ "@etsoo/appscript": "^1.2.62",
54
54
  "@etsoo/notificationbase": "^1.1.4",
55
55
  "@etsoo/shared": "^1.1.40",
56
- "@mui/icons-material": "^5.8.0",
57
- "@mui/material": "^5.8.1",
58
- "@types/pica": "^9.0.0",
56
+ "@mui/icons-material": "^5.8.4",
57
+ "@mui/material": "^5.9.1",
58
+ "@types/pica": "^9.0.1",
59
59
  "@types/pulltorefreshjs": "^0.1.5",
60
- "@types/react": "^18.0.9",
60
+ "@types/react": "^18.0.15",
61
61
  "@types/react-avatar-editor": "^12.0.0",
62
62
  "@types/react-beautiful-dnd": "^13.1.2",
63
- "@types/react-dom": "^18.0.5",
63
+ "@types/react-dom": "^18.0.6",
64
64
  "@types/react-input-mask": "^3.0.1",
65
65
  "@types/react-window": "^1.8.5",
66
66
  "pica": "^9.0.1",
67
67
  "pulltorefreshjs": "^0.1.22",
68
- "react": "^18.1.0",
68
+ "react": "^18.2.0",
69
69
  "react-avatar-editor": "^13.0.0",
70
70
  "react-beautiful-dnd": "^13.1.0",
71
- "react-dom": "^18.1.0",
71
+ "react-dom": "^18.2.0",
72
72
  "react-draggable": "^4.4.5",
73
73
  "react-imask": "^6.4.2",
74
74
  "react-router-dom": "^6.3.0",
75
75
  "react-window": "^1.8.7"
76
76
  },
77
77
  "devDependencies": {
78
- "@babel/cli": "^7.17.10",
79
- "@babel/core": "^7.18.2",
80
- "@babel/plugin-transform-runtime": "^7.18.2",
81
- "@babel/preset-env": "^7.18.2",
82
- "@babel/runtime-corejs3": "^7.18.3",
83
- "@types/jest": "^27.5.1",
78
+ "@babel/cli": "^7.18.9",
79
+ "@babel/core": "^7.18.9",
80
+ "@babel/plugin-transform-runtime": "^7.18.9",
81
+ "@babel/preset-env": "^7.18.9",
82
+ "@babel/runtime-corejs3": "^7.18.9",
83
+ "@types/jest": "^28.1.6",
84
84
  "@types/react-test-renderer": "^18.0.0",
85
- "@typescript-eslint/eslint-plugin": "^5.26.0",
86
- "@typescript-eslint/parser": "^5.26.0",
87
- "eslint": "^8.16.0",
85
+ "@typescript-eslint/eslint-plugin": "^5.30.7",
86
+ "@typescript-eslint/parser": "^5.30.7",
87
+ "eslint": "^8.20.0",
88
88
  "eslint-config-airbnb-base": "^15.0.0",
89
89
  "eslint-plugin-import": "^2.26.0",
90
- "eslint-plugin-react": "^7.30.0",
91
- "jest": "^28.1.0",
92
- "jest-environment-jsdom": "^28.1.0",
93
- "react-test-renderer": "^18.1.0",
94
- "ts-jest": "^28.0.3",
95
- "typescript": "^4.7.2"
90
+ "eslint-plugin-react": "^7.30.1",
91
+ "jest": "^28.1.3",
92
+ "jest-environment-jsdom": "^28.1.3",
93
+ "react-test-renderer": "^18.2.0",
94
+ "ts-jest": "^28.0.7",
95
+ "typescript": "^4.7.4"
96
96
  }
97
97
  }
package/src/mu/RLink.tsx CHANGED
@@ -3,20 +3,27 @@ import React from 'react';
3
3
  import { globalApp } from '../app/ReactApp';
4
4
  import { useDelayedExecutor } from '../uses/useDelayedExecutor';
5
5
 
6
+ /**
7
+ * Router Link properties
8
+ */
9
+ export type RLinkProps = LinkProps & {
10
+ delay?: number;
11
+ };
12
+
6
13
  /**
7
14
  * Router Link
8
15
  * @param props Props
9
16
  * @returns Component
10
17
  */
11
- export const RLink = React.forwardRef<HTMLAnchorElement, LinkProps>(
18
+ export const RLink = React.forwardRef<HTMLAnchorElement, RLinkProps>(
12
19
  (props, ref) => {
13
20
  // Destruct
14
- const { href, target, onClick, ...rest } = props;
21
+ const { delay = 0, href, target, onClick, ...rest } = props;
15
22
 
16
23
  const delayed = useDelayedExecutor((href: string) => {
17
24
  // Router push
18
25
  globalApp.history.push(href);
19
- }, 100);
26
+ }, delay);
20
27
 
21
28
  // Click handler
22
29
  const onClickLocl = (
@@ -32,10 +39,13 @@ export const RLink = React.forwardRef<HTMLAnchorElement, LinkProps>(
32
39
  ) {
33
40
  // Prevent href action
34
41
  event.preventDefault();
42
+
43
+ // Delayed excution
35
44
  delayed.call(undefined, href);
36
45
  }
37
46
  };
38
47
 
48
+ // Clear when exit
39
49
  React.useEffect(() => {
40
50
  return () => delayed.clear();
41
51
  }, [delayed]);