@etsoo/react 1.3.58 → 1.3.62
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/app/ReactApp.js +18 -16
- package/lib/mu/CountdownButton.d.ts +1 -1
- package/lib/mu/TextFieldEx.d.ts +3 -3
- package/lib/mu/pages/CommonPageProps.d.ts +2 -1
- package/lib/states/IState.d.ts +2 -2
- package/lib/states/UserState.js +1 -1
- package/package.json +3 -3
- package/src/app/ReactApp.ts +20 -22
- package/src/mu/pages/CommonPageProps.ts +2 -1
- package/src/states/IState.ts +2 -2
- package/src/states/UserState.ts +3 -3
package/lib/app/ReactApp.js
CHANGED
|
@@ -24,25 +24,26 @@ export function ReactAppStateDetector(props) {
|
|
|
24
24
|
const { state } = globalApp == null
|
|
25
25
|
? { state: {} }
|
|
26
26
|
: React.useContext(globalApp.userState.context);
|
|
27
|
+
// Match fields
|
|
28
|
+
const authorized = state.authorized;
|
|
29
|
+
const changedFields = state.lastChangedFields;
|
|
30
|
+
let matchedFields;
|
|
31
|
+
if (targetFields == null || changedFields == null) {
|
|
32
|
+
matchedFields = changedFields;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
matchedFields = [];
|
|
36
|
+
targetFields.forEach((targetField) => {
|
|
37
|
+
if (changedFields.includes(targetField))
|
|
38
|
+
matchedFields === null || matchedFields === void 0 ? void 0 : matchedFields.push(targetField);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
console.log('ReactAppStateDetector', state, authorized, matchedFields);
|
|
27
42
|
// Ready
|
|
28
43
|
React.useEffect(() => {
|
|
29
|
-
// Match fields
|
|
30
|
-
const changedFields = state.lastChangedFields;
|
|
31
|
-
let matchedFields;
|
|
32
|
-
if (targetFields == null || changedFields == null) {
|
|
33
|
-
matchedFields = changedFields;
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
matchedFields = [];
|
|
37
|
-
targetFields.forEach((targetField) => {
|
|
38
|
-
if (changedFields.includes(targetField))
|
|
39
|
-
matchedFields === null || matchedFields === void 0 ? void 0 : matchedFields.push(targetField);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
console.log('ReactAppStateDetector', changedFields, targetFields, matchedFields);
|
|
43
44
|
// Callback
|
|
44
|
-
update(
|
|
45
|
-
}, [
|
|
45
|
+
update(authorized, matchedFields);
|
|
46
|
+
}, [authorized, matchedFields]);
|
|
46
47
|
// return
|
|
47
48
|
return React.createElement(React.Fragment);
|
|
48
49
|
}
|
|
@@ -63,6 +64,7 @@ export class ReactApp extends CoreApp {
|
|
|
63
64
|
this.userState = new UserState();
|
|
64
65
|
this.cultureState = new CultureState(settings.currentCulture);
|
|
65
66
|
this.pageState = new PageState();
|
|
67
|
+
globalApp = this;
|
|
66
68
|
}
|
|
67
69
|
/**
|
|
68
70
|
* Get notifier provider
|
|
@@ -20,4 +20,4 @@ export declare type CountdownButtonProps = Omit<ButtonProps, 'endIcon' | 'disabl
|
|
|
20
20
|
* @param props Props
|
|
21
21
|
* @returns Button
|
|
22
22
|
*/
|
|
23
|
-
export declare const CountdownButton: React.ForwardRefExoticComponent<Pick<CountdownButtonProps, "children" | "form" | "slot" | "title" | "value" | "fullWidth" | "type" | keyof import("@mui/material/OverridableComponent").CommonProps | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "
|
|
23
|
+
export declare const CountdownButton: React.ForwardRefExoticComponent<Pick<CountdownButtonProps, "name" | "role" | "children" | "form" | "slot" | "title" | "value" | "fullWidth" | "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" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "disableElevation" | "disableFocusRipple" | "href" | "size" | "startIcon" | "variant" | "key" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "onAction"> & React.RefAttributes<HTMLButtonElement>>;
|
package/lib/mu/TextFieldEx.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export declare const TextFieldEx: React.ForwardRefExoticComponent<(Pick<import("
|
|
|
56
56
|
* Show password button
|
|
57
57
|
*/
|
|
58
58
|
showPassword?: boolean | undefined;
|
|
59
|
-
}, "children" | "label" | "slot" | "select" | "style" | "title" | "value" | "fullWidth" | "type" | "className" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "
|
|
59
|
+
}, "name" | "role" | "children" | "label" | "slot" | "select" | "style" | "title" | "value" | "fullWidth" | "type" | "className" | "classes" | "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" | "disabled" | "sx" | "margin" | "size" | "variant" | "key" | "autoFocus" | "autoComplete" | "readOnly" | "required" | "rows" | "error" | "inputProps" | "onEnter" | "inputRef" | "focused" | "hiddenLabel" | "multiline" | "maxRows" | "minRows" | "SelectProps" | "changeDelay" | "InputLabelProps" | "InputProps" | "FormHelperTextProps" | "helperText" | "showClear" | "showPassword"> | Pick<import("@mui/material").FilledTextFieldProps & {
|
|
60
60
|
/**
|
|
61
61
|
* Change delay (ms) to avoid repeatly dispatch onChange
|
|
62
62
|
*/
|
|
@@ -77,7 +77,7 @@ export declare const TextFieldEx: React.ForwardRefExoticComponent<(Pick<import("
|
|
|
77
77
|
* Show password button
|
|
78
78
|
*/
|
|
79
79
|
showPassword?: boolean | undefined;
|
|
80
|
-
}, "children" | "label" | "slot" | "select" | "style" | "title" | "value" | "fullWidth" | "type" | "className" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "
|
|
80
|
+
}, "name" | "role" | "children" | "label" | "slot" | "select" | "style" | "title" | "value" | "fullWidth" | "type" | "className" | "classes" | "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" | "disabled" | "sx" | "margin" | "size" | "variant" | "key" | "autoFocus" | "autoComplete" | "readOnly" | "required" | "rows" | "error" | "inputProps" | "onEnter" | "inputRef" | "focused" | "hiddenLabel" | "multiline" | "maxRows" | "minRows" | "SelectProps" | "changeDelay" | "InputLabelProps" | "InputProps" | "FormHelperTextProps" | "helperText" | "showClear" | "showPassword"> | Pick<import("@mui/material").OutlinedTextFieldProps & {
|
|
81
81
|
/**
|
|
82
82
|
* Change delay (ms) to avoid repeatly dispatch onChange
|
|
83
83
|
*/
|
|
@@ -98,4 +98,4 @@ export declare const TextFieldEx: React.ForwardRefExoticComponent<(Pick<import("
|
|
|
98
98
|
* Show password button
|
|
99
99
|
*/
|
|
100
100
|
showPassword?: boolean | undefined;
|
|
101
|
-
}, "children" | "label" | "slot" | "select" | "style" | "title" | "value" | "fullWidth" | "type" | "className" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "
|
|
101
|
+
}, "name" | "role" | "children" | "label" | "slot" | "select" | "style" | "title" | "value" | "fullWidth" | "type" | "className" | "classes" | "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" | "disabled" | "sx" | "margin" | "size" | "variant" | "key" | "autoFocus" | "autoComplete" | "readOnly" | "required" | "rows" | "error" | "inputProps" | "onEnter" | "inputRef" | "focused" | "hiddenLabel" | "multiline" | "maxRows" | "minRows" | "SelectProps" | "changeDelay" | "InputLabelProps" | "InputProps" | "FormHelperTextProps" | "helperText" | "showClear" | "showPassword">) & React.RefAttributes<TextFieldExMethods>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { UserKey } from '@etsoo/appscript';
|
|
2
3
|
import { ContainerProps } from '@mui/material';
|
|
3
4
|
import { ListItemReact } from '../../components/ListItemReact';
|
|
4
5
|
import { IStateUpdate } from '../../states/IState';
|
|
@@ -55,5 +56,5 @@ export interface CommonPageProps extends Omit<ContainerProps, 'id'> {
|
|
|
55
56
|
/**
|
|
56
57
|
* State last changed fields
|
|
57
58
|
*/
|
|
58
|
-
targetFields?:
|
|
59
|
+
targetFields?: UserKey[];
|
|
59
60
|
}
|
package/lib/states/IState.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IAction, IState } from '@etsoo/appscript';
|
|
1
|
+
import { IAction, IState, UserKey } from '@etsoo/appscript';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* State UI creator
|
|
@@ -26,7 +26,7 @@ export interface IStateProps {
|
|
|
26
26
|
/**
|
|
27
27
|
* State last changed fields
|
|
28
28
|
*/
|
|
29
|
-
targetFields?:
|
|
29
|
+
targetFields?: UserKey[];
|
|
30
30
|
/**
|
|
31
31
|
* State update callback
|
|
32
32
|
*/
|
package/lib/states/UserState.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/react",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.62",
|
|
4
4
|
"description": "TypeScript ReactJs framework",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@emotion/react": "^11.7.1",
|
|
51
51
|
"@emotion/style": "^0.8.0",
|
|
52
52
|
"@emotion/styled": "^11.6.0",
|
|
53
|
-
"@etsoo/appscript": "^1.1.
|
|
53
|
+
"@etsoo/appscript": "^1.1.80",
|
|
54
54
|
"@etsoo/notificationbase": "^1.0.94",
|
|
55
55
|
"@etsoo/shared": "^1.0.78",
|
|
56
56
|
"@mui/icons-material": "^5.2.4",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@types/react-test-renderer": "^17.0.1",
|
|
84
84
|
"@typescript-eslint/eslint-plugin": "^5.7.0",
|
|
85
85
|
"@typescript-eslint/parser": "^5.7.0",
|
|
86
|
-
"eslint": "^8.
|
|
86
|
+
"eslint": "^8.5.0",
|
|
87
87
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
88
88
|
"eslint-plugin-import": "^2.25.3",
|
|
89
89
|
"eslint-plugin-react": "^7.27.1",
|
package/src/app/ReactApp.ts
CHANGED
|
@@ -53,31 +53,27 @@ export function ReactAppStateDetector(props: IStateProps) {
|
|
|
53
53
|
(globalApp.userState as UserState<IUser>).context
|
|
54
54
|
);
|
|
55
55
|
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
56
|
+
// Match fields
|
|
57
|
+
const authorized = state.authorized;
|
|
58
|
+
const changedFields = state.lastChangedFields;
|
|
59
|
+
let matchedFields: string[] | undefined;
|
|
60
|
+
if (targetFields == null || changedFields == null) {
|
|
61
|
+
matchedFields = changedFields;
|
|
62
|
+
} else {
|
|
63
|
+
matchedFields = [];
|
|
64
|
+
targetFields.forEach((targetField) => {
|
|
65
|
+
if (changedFields.includes(targetField))
|
|
66
|
+
matchedFields?.push(targetField);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
70
69
|
|
|
71
|
-
|
|
72
|
-
'ReactAppStateDetector',
|
|
73
|
-
changedFields,
|
|
74
|
-
targetFields,
|
|
75
|
-
matchedFields
|
|
76
|
-
);
|
|
70
|
+
console.log('ReactAppStateDetector', state, authorized, matchedFields);
|
|
77
71
|
|
|
72
|
+
// Ready
|
|
73
|
+
React.useEffect(() => {
|
|
78
74
|
// Callback
|
|
79
|
-
update(
|
|
80
|
-
}, [
|
|
75
|
+
update(authorized, matchedFields);
|
|
76
|
+
}, [authorized, matchedFields]);
|
|
81
77
|
|
|
82
78
|
// return
|
|
83
79
|
return React.createElement(React.Fragment);
|
|
@@ -199,6 +195,8 @@ export class ReactApp<
|
|
|
199
195
|
);
|
|
200
196
|
this.cultureState = new CultureState(settings.currentCulture);
|
|
201
197
|
this.pageState = new PageState<P>();
|
|
198
|
+
|
|
199
|
+
globalApp = this;
|
|
202
200
|
}
|
|
203
201
|
|
|
204
202
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UserKey } from '@etsoo/appscript';
|
|
1
2
|
import { ContainerProps } from '@mui/material';
|
|
2
3
|
import { ListItemReact } from '../../components/ListItemReact';
|
|
3
4
|
import { IStateUpdate } from '../../states/IState';
|
|
@@ -66,5 +67,5 @@ export interface CommonPageProps extends Omit<ContainerProps, 'id'> {
|
|
|
66
67
|
/**
|
|
67
68
|
* State last changed fields
|
|
68
69
|
*/
|
|
69
|
-
targetFields?:
|
|
70
|
+
targetFields?: UserKey[];
|
|
70
71
|
}
|
package/src/states/IState.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IAction, IState } from '@etsoo/appscript';
|
|
1
|
+
import { IAction, IState, UserKey } from '@etsoo/appscript';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -30,7 +30,7 @@ export interface IStateProps {
|
|
|
30
30
|
/**
|
|
31
31
|
* State last changed fields
|
|
32
32
|
*/
|
|
33
|
-
targetFields?:
|
|
33
|
+
targetFields?: UserKey[];
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* State update callback
|
package/src/states/UserState.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IAction, IUser, IUserData } from '@etsoo/appscript';
|
|
1
|
+
import { IAction, IUser, IUserData, UserKey } from '@etsoo/appscript';
|
|
2
2
|
import { Utils } from '@etsoo/shared';
|
|
3
3
|
import { IProviderProps, IUpdate } from './IState';
|
|
4
4
|
import { State } from './State';
|
|
@@ -77,7 +77,7 @@ export class UserState<D extends IUser> {
|
|
|
77
77
|
const lastChangedFields =
|
|
78
78
|
state.authorized && action.user
|
|
79
79
|
? this.getChangedFields(action.user, state)
|
|
80
|
-
:
|
|
80
|
+
: undefined;
|
|
81
81
|
return {
|
|
82
82
|
...action.user!,
|
|
83
83
|
authorized: true,
|
|
@@ -127,6 +127,6 @@ export class UserState<D extends IUser> {
|
|
|
127
127
|
'authorized',
|
|
128
128
|
'seconds',
|
|
129
129
|
'lastChangedFields'
|
|
130
|
-
]);
|
|
130
|
+
]) as UserKey[];
|
|
131
131
|
}
|
|
132
132
|
}
|