@pdg/react-form 1.0.0 → 1.0.2
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/README.md +1 -1
- package/dist/index.esm.js +11 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,5 +4,5 @@ React Form
|
|
|
4
4
|
|
|
5
5
|
## 설치
|
|
6
6
|
```
|
|
7
|
-
npm install -D @pdg/react-
|
|
7
|
+
npm install -D @pdg/react-form @mui/material @mui/icons-material @emotion/react @emotion/styled @mui/x-date-pickers dayjs
|
|
8
8
|
```
|
package/dist/index.esm.js
CHANGED
|
@@ -7172,6 +7172,7 @@ styleInject(css_248z$8);var FormTextEditor = React__default.forwardRef(function
|
|
|
7172
7172
|
var _c = useAutoUpdateState$1(initFocused || formFocused), focused = _c[0], setFocused = _c[1];
|
|
7173
7173
|
// Ref -------------------------------------------------------------------------------------------------------------
|
|
7174
7174
|
var editorRef = useRef(null);
|
|
7175
|
+
var keyDownTime = useRef(0);
|
|
7175
7176
|
// State - value ---------------------------------------------------------------------------------------------------
|
|
7176
7177
|
var _d = useAutoUpdateState$1(initValue), value = _d[0], setValue = _d[1];
|
|
7177
7178
|
useFirstSkipEffect$1(function () {
|
|
@@ -7290,11 +7291,16 @@ styleInject(css_248z$8);var FormTextEditor = React__default.forwardRef(function
|
|
|
7290
7291
|
// Event Handler ---------------------------------------------------------------------------------------------------
|
|
7291
7292
|
var handleEditorChange = useCallback(function (value) {
|
|
7292
7293
|
setValue(value);
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
onValueChangeByUser
|
|
7296
|
-
|
|
7294
|
+
if (new Date().getTime() - keyDownTime.current < 300) {
|
|
7295
|
+
nextTick(function () {
|
|
7296
|
+
if (onValueChangeByUser)
|
|
7297
|
+
onValueChangeByUser(name, value);
|
|
7298
|
+
});
|
|
7299
|
+
}
|
|
7297
7300
|
}, [name, onValueChangeByUser]);
|
|
7301
|
+
var handleKeyDown = useCallback(function () {
|
|
7302
|
+
keyDownTime.current = new Date().getTime();
|
|
7303
|
+
}, []);
|
|
7298
7304
|
var handleImageUpload = useCallback(function (blobInfo, success, failure, progress) {
|
|
7299
7305
|
if (onImageUpload)
|
|
7300
7306
|
onImageUpload(blobInfo.blob(), success, failure, progress);
|
|
@@ -7323,7 +7329,7 @@ styleInject(css_248z$8);var FormTextEditor = React__default.forwardRef(function
|
|
|
7323
7329
|
images_upload_handler: handleImageUpload,
|
|
7324
7330
|
}, onInit: function () {
|
|
7325
7331
|
setTimeout(function () { return setInitialized(true); }, 10);
|
|
7326
|
-
}, onEditorChange: handleEditorChange, onFocus: function () { return setFocused(initFocused || true); }, onBlur: function () { return setFocused(initFocused || false); } })) }));
|
|
7332
|
+
}, onEditorChange: handleEditorChange, onKeyDown: handleKeyDown, onFocus: function () { return setFocused(initFocused || true); }, onBlur: function () { return setFocused(initFocused || false); } })) }));
|
|
7327
7333
|
});
|
|
7328
7334
|
FormTextEditor.displayName = 'FormTextEditor';
|
|
7329
7335
|
FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDefaultProps = {
|