funda-ui 3.9.311 → 3.9.410
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/Date/index.css +14 -3
- package/Date/index.d.ts +8 -4
- package/Date/index.js +81 -35
- package/Input/index.d.ts +1 -0
- package/Input/index.js +7 -2
- package/LiveSearch/index.d.ts +1 -0
- package/LiveSearch/index.js +12 -3
- package/MultiFuncSelect/index.js +1 -1
- package/RangeSlider/index.js +7 -2
- package/SearchBar/index.d.ts +1 -0
- package/SearchBar/index.js +7 -2
- package/Textarea/index.d.ts +2 -0
- package/Textarea/index.js +25 -6
- package/lib/cjs/Date/index.d.ts +8 -4
- package/lib/cjs/Date/index.js +81 -35
- package/lib/cjs/Input/index.d.ts +1 -0
- package/lib/cjs/Input/index.js +7 -2
- package/lib/cjs/LiveSearch/index.d.ts +1 -0
- package/lib/cjs/LiveSearch/index.js +12 -3
- package/lib/cjs/MultiFuncSelect/index.js +1 -1
- package/lib/cjs/RangeSlider/index.js +7 -2
- package/lib/cjs/SearchBar/index.d.ts +1 -0
- package/lib/cjs/SearchBar/index.js +7 -2
- package/lib/cjs/Textarea/index.d.ts +2 -0
- package/lib/cjs/Textarea/index.js +25 -6
- package/lib/css/Date/index.css +14 -3
- package/lib/esm/ColorPicker/index.tsx +3 -3
- package/lib/esm/Date/index.scss +16 -2
- package/lib/esm/Date/index.tsx +98 -40
- package/lib/esm/Input/index.tsx +13 -5
- package/lib/esm/LiveSearch/index.tsx +7 -2
- package/lib/esm/MultiFuncSelect/index.tsx +1 -4
- package/lib/esm/SearchBar/index.tsx +18 -9
- package/lib/esm/TagInput/index.tsx +8 -8
- package/lib/esm/Textarea/index.tsx +21 -4
- package/lib/esm/Textarea/utils/useAutosizeTextArea.js +17 -3
- package/package.json +1 -1
package/SearchBar/index.js
CHANGED
|
@@ -96,7 +96,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
96
96
|
/* harmony export */ });
|
|
97
97
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(787);
|
|
98
98
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
99
|
-
var _excluded = ["wrapperClassName", "controlClassName", "controlExClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "appearance", "isSearchInput", "readOnly", "disabled", "required", "placeholder", "value", "label", "name", "units", "iconLeft", "iconRight", "minLength", "maxLength", "btnId", "id", "icon", "autoComplete", "style", "tabIndex", "onClick", "onKeyPressedCallback", "onSubmit", "onChange", "onBlur", "onFocus"];
|
|
99
|
+
var _excluded = ["wrapperClassName", "controlClassName", "controlExClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "appearance", "isSearchInput", "readOnly", "disabled", "required", "placeholder", "value", "label", "name", "units", "iconLeft", "iconRight", "minLength", "maxLength", "btnId", "id", "icon", "autoComplete", "style", "tabIndex", "onClick", "onKeyPressedCallback", "onSubmit", "onChange", "onBlur", "onFocus", "onPressEnter"];
|
|
100
100
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
101
101
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
102
102
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -139,6 +139,7 @@ var SearchBar = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(f
|
|
|
139
139
|
onChange = props.onChange,
|
|
140
140
|
onBlur = props.onBlur,
|
|
141
141
|
onFocus = props.onFocus,
|
|
142
|
+
onPressEnter = props.onPressEnter,
|
|
142
143
|
attributes = _objectWithoutProperties(props, _excluded);
|
|
143
144
|
var uniqueID = (0,react__WEBPACK_IMPORTED_MODULE_0__.useId)();
|
|
144
145
|
var idRes = id || uniqueID;
|
|
@@ -208,8 +209,12 @@ var SearchBar = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(f
|
|
|
208
209
|
var newData = onKeyPressedCallback(event);
|
|
209
210
|
if (newData) setChangedVal(newData); // Avoid the error "react checkbox changing an uncontrolled input to be controlled"
|
|
210
211
|
}
|
|
211
|
-
}
|
|
212
212
|
|
|
213
|
+
if (event.code == "Enter") {
|
|
214
|
+
// DO NOT USE "preventDefault()"
|
|
215
|
+
onPressEnter === null || onPressEnter === void 0 ? void 0 : onPressEnter(event, onComposition);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
213
218
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
214
219
|
// update default value
|
|
215
220
|
//--------------
|
package/Textarea/index.d.ts
CHANGED
|
@@ -35,6 +35,8 @@ declare type TextareaProps = {
|
|
|
35
35
|
onChange?: (e: any, el: any) => void;
|
|
36
36
|
onBlur?: (e: any, el: any) => void;
|
|
37
37
|
onFocus?: (e: any, el: any) => void;
|
|
38
|
+
onPressEnter?: (e: any, el: any) => void;
|
|
39
|
+
onResize?: (e: any, el: any, params: any) => void;
|
|
38
40
|
};
|
|
39
41
|
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<unknown>>;
|
|
40
42
|
export default Textarea;
|
package/Textarea/index.js
CHANGED
|
@@ -118,7 +118,13 @@ const App = () => {
|
|
|
118
118
|
const [value, setValue] = useState("");
|
|
119
119
|
const el = useRef<HTMLTextAreaElement>(null);
|
|
120
120
|
|
|
121
|
-
useAutosizeTextArea(
|
|
121
|
+
useAutosizeTextArea(
|
|
122
|
+
el.current,
|
|
123
|
+
value,
|
|
124
|
+
(res) => {
|
|
125
|
+
onResize?.(event, valRef.current, res);
|
|
126
|
+
}
|
|
127
|
+
);
|
|
122
128
|
|
|
123
129
|
const handleChange = (evt: React.ChangeEvent<HTMLTextAreaElement>) => {
|
|
124
130
|
const val = evt.target?.value;
|
|
@@ -144,7 +150,7 @@ const App = () => {
|
|
|
144
150
|
|
|
145
151
|
|
|
146
152
|
// Updates the height of a <textarea> when the value changes.
|
|
147
|
-
var useAutosizeTextArea = function useAutosizeTextArea(el, value) {
|
|
153
|
+
var useAutosizeTextArea = function useAutosizeTextArea(el, value, cb) {
|
|
148
154
|
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
|
|
149
155
|
_useState2 = _slicedToArray(_useState, 2),
|
|
150
156
|
defaultRowHeight = _useState2[0],
|
|
@@ -155,9 +161,11 @@ var useAutosizeTextArea = function useAutosizeTextArea(el, value) {
|
|
|
155
161
|
setDefaultRowHeightInit = _useState4[1];
|
|
156
162
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
157
163
|
if (el) {
|
|
164
|
+
var style = el.currentStyle || window.getComputedStyle(el);
|
|
165
|
+
var _controlWidth = el.scrollWidth + parseInt(style.borderLeftWidth) + parseInt(style.borderRightWidth);
|
|
166
|
+
|
|
158
167
|
// initialize default row height
|
|
159
168
|
if (el.scrollHeight > 0 && !defaultRowHeightInit) {
|
|
160
|
-
var style = el.currentStyle || window.getComputedStyle(el);
|
|
161
169
|
setDefaultRowHeight(el.scrollHeight + parseInt(style.borderTopWidth) + parseInt(style.borderBottomWidth));
|
|
162
170
|
setDefaultRowHeightInit(true);
|
|
163
171
|
}
|
|
@@ -177,12 +185,15 @@ var useAutosizeTextArea = function useAutosizeTextArea(el, value) {
|
|
|
177
185
|
if (scrollHeight > defaultRowHeight && defaultRowHeight > 0) {
|
|
178
186
|
el.style.height = scrollHeight + "px";
|
|
179
187
|
}
|
|
188
|
+
|
|
189
|
+
//
|
|
190
|
+
cb === null || cb === void 0 ? void 0 : cb([_controlWidth, scrollHeight]);
|
|
180
191
|
}
|
|
181
192
|
}, [el, value]);
|
|
182
193
|
};
|
|
183
194
|
/* harmony default export */ const utils_useAutosizeTextArea = (useAutosizeTextArea);
|
|
184
195
|
;// CONCATENATED MODULE: ./src/index.tsx
|
|
185
|
-
var _excluded = ["contentRef", "wrapperClassName", "controlClassName", "controlExClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "cols", "rows", "disabled", "required", "placeholder", "autoSize", "iconLeft", "iconRight", "readOnly", "value", "label", "name", "id", "maxLength", "style", "tabIndex", "onChangeCallback", "onInputCallback", "onKeyPressedCallback", "onChange", "onBlur", "onFocus"];
|
|
196
|
+
var _excluded = ["contentRef", "wrapperClassName", "controlClassName", "controlExClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "cols", "rows", "disabled", "required", "placeholder", "autoSize", "iconLeft", "iconRight", "readOnly", "value", "label", "name", "id", "maxLength", "style", "tabIndex", "onChangeCallback", "onInputCallback", "onKeyPressedCallback", "onChange", "onBlur", "onFocus", "onPressEnter", "onResize"];
|
|
186
197
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
187
198
|
function src_slicedToArray(arr, i) { return src_arrayWithHoles(arr) || src_iterableToArrayLimit(arr, i) || src_unsupportedIterableToArray(arr, i) || src_nonIterableRest(); }
|
|
188
199
|
function src_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -223,6 +234,8 @@ var Textarea = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
223
234
|
onChange = props.onChange,
|
|
224
235
|
onBlur = props.onBlur,
|
|
225
236
|
onFocus = props.onFocus,
|
|
237
|
+
onPressEnter = props.onPressEnter,
|
|
238
|
+
onResize = props.onResize,
|
|
226
239
|
attributes = _objectWithoutProperties(props, _excluded);
|
|
227
240
|
var uniqueID = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useId)();
|
|
228
241
|
var idRes = id || uniqueID;
|
|
@@ -248,7 +261,9 @@ var Textarea = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
248
261
|
}, [contentRef]);
|
|
249
262
|
|
|
250
263
|
// auto size
|
|
251
|
-
utils_useAutosizeTextArea(autoSize ? valRef.current : null, autoSize ? changedVal : '')
|
|
264
|
+
utils_useAutosizeTextArea(autoSize ? valRef.current : null, autoSize ? changedVal : '', function (res) {
|
|
265
|
+
onResize === null || onResize === void 0 ? void 0 : onResize(event, valRef.current, res);
|
|
266
|
+
});
|
|
252
267
|
function handleFocus(event) {
|
|
253
268
|
var _rootRef$current;
|
|
254
269
|
var el = event.target;
|
|
@@ -304,8 +319,12 @@ var Textarea = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
304
319
|
var newData = onKeyPressedCallback(event, valRef.current);
|
|
305
320
|
if (newData) setChangedVal(newData); // Avoid the error "react checkbox changing an uncontrolled input to be controlled"
|
|
306
321
|
}
|
|
307
|
-
}
|
|
308
322
|
|
|
323
|
+
if (event.code == "Enter") {
|
|
324
|
+
// DO NOT USE "preventDefault()"
|
|
325
|
+
onPressEnter === null || onPressEnter === void 0 ? void 0 : onPressEnter(event, valRef.current);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
309
328
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
310
329
|
// update default value
|
|
311
330
|
//--------------
|
package/lib/cjs/Date/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
declare type DateProps = {
|
|
3
|
+
contentRef?: React.RefObject<any>;
|
|
3
4
|
popupRef?: React.RefObject<any>;
|
|
4
5
|
popupClassName?: string;
|
|
5
6
|
triggerClassName?: string;
|
|
@@ -8,6 +9,8 @@ declare type DateProps = {
|
|
|
8
9
|
controlGroupWrapperClassName?: string;
|
|
9
10
|
controlGroupTextClassName?: string;
|
|
10
11
|
delimiter?: string;
|
|
12
|
+
hideClearButton?: boolean;
|
|
13
|
+
showToolsWhenHover?: boolean;
|
|
11
14
|
offset?: number;
|
|
12
15
|
exceededSidePosOffset?: number;
|
|
13
16
|
localization?: 'en_US' | 'zh_CN';
|
|
@@ -35,10 +38,11 @@ declare type DateProps = {
|
|
|
35
38
|
autoComplete?: string;
|
|
36
39
|
tabIndex?: number;
|
|
37
40
|
[key: `data-${string}`]: string | undefined;
|
|
38
|
-
onLoad?: (e: any, data: any) => void;
|
|
39
|
-
onChange?: (e: any, data: any, isValidDate: boolean) => void;
|
|
40
|
-
onBlur?: (e: any) => void;
|
|
41
|
-
onFocus?: (e: any) => void;
|
|
41
|
+
onLoad?: (e: any, data: any, allSplittingInputs: any[]) => void;
|
|
42
|
+
onChange?: (e: any, data: any, isValidDate: boolean, allSplittingInputs: any[]) => void;
|
|
43
|
+
onBlur?: (e: any, allSplittingInputs: any[]) => void;
|
|
44
|
+
onFocus?: (e: any, allSplittingInputs: any[]) => void;
|
|
45
|
+
onPressEnter?: (e: any, allSplittingInputs: any[]) => void;
|
|
42
46
|
onOpenPopup?: (allSplittingInputs: any[]) => void;
|
|
43
47
|
onClosePopup?: (allSplittingInputs: any[]) => void;
|
|
44
48
|
onChangeDate?: (currentData: any) => void;
|
package/lib/cjs/Date/index.js
CHANGED
|
@@ -821,7 +821,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
821
821
|
var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1465__(787);
|
|
822
822
|
/* harmony import */
|
|
823
823
|
var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1465__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
824
|
-
var _excluded = ["contentRef", "wrapperClassName", "controlClassName", "controlExClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "type", "disabled", "required", "placeholder", "pattern", "readOnly", "value", "label", "units", "name", "step", "min", "max", "src", "size", "minLength", "maxLength", "alt", "inputMode", "id", "appendControl", "iconLeft", "iconRight", "autoComplete", "style", "tabIndex", "onChangeCallback", "onInputCallback", "onKeyPressedCallback", "onChange", "onBlur", "onFocus"];
|
|
824
|
+
var _excluded = ["contentRef", "wrapperClassName", "controlClassName", "controlExClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "type", "disabled", "required", "placeholder", "pattern", "readOnly", "value", "label", "units", "name", "step", "min", "max", "src", "size", "minLength", "maxLength", "alt", "inputMode", "id", "appendControl", "iconLeft", "iconRight", "autoComplete", "style", "tabIndex", "onChangeCallback", "onInputCallback", "onKeyPressedCallback", "onChange", "onBlur", "onFocus", "onPressEnter"];
|
|
825
825
|
function _extends() {
|
|
826
826
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
827
827
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -951,6 +951,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
951
951
|
onChange = props.onChange,
|
|
952
952
|
onBlur = props.onBlur,
|
|
953
953
|
onFocus = props.onFocus,
|
|
954
|
+
onPressEnter = props.onPressEnter,
|
|
954
955
|
attributes = _objectWithoutProperties(props, _excluded);
|
|
955
956
|
var uniqueID = (0, react__WEBPACK_IMPORTED_MODULE_0__.useId)();
|
|
956
957
|
var idRes = id || uniqueID;
|
|
@@ -1044,8 +1045,12 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
1044
1045
|
var newData = onKeyPressedCallback(event, valRef.current);
|
|
1045
1046
|
if (newData) setChangedVal(newData); // Avoid the error "react checkbox changing an uncontrolled input to be controlled"
|
|
1046
1047
|
}
|
|
1047
|
-
}
|
|
1048
1048
|
|
|
1049
|
+
if (event.code == "Enter") {
|
|
1050
|
+
// DO NOT USE "preventDefault()"
|
|
1051
|
+
onPressEnter === null || onPressEnter === void 0 ? void 0 : onPressEnter(event, valRef.current);
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1049
1054
|
(0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
1050
1055
|
// update default value
|
|
1051
1056
|
//--------------
|
|
@@ -2092,7 +2097,7 @@ var zh_CN_default = /*#__PURE__*/__webpack_require__.n(zh_CN);
|
|
|
2092
2097
|
// EXTERNAL MODULE: ./src/utils/performance.js
|
|
2093
2098
|
var performance = __webpack_require__(342);
|
|
2094
2099
|
;// CONCATENATED MODULE: ./src/index.tsx
|
|
2095
|
-
var _excluded = ["popupRef", "triggerClassName", "popupClassName", "wrapperClassName", "controlClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "delimiter", "offset", "exceededSidePosOffset", "localization", "type", "onlyTime", "truncateSeconds", "valueUseSlash", "disabled", "required", "readOnly", "value", "clickInitValue", "min", "max", "placeholder", "label", "units", "name", "alt", "id", "iconLeft", "iconRight", "autoComplete", "style", "tabIndex", "onLoad", "onChange", "onBlur", "onFocus", "onOpenPopup", "onClosePopup", "onChangeDate", "onChangeMonth", "onChangeYear", "onChangeToday", "onChangeHours", "onChangeMinutes", "onChangeSeconds", "langHoursTitle", "langMinutesTitle", "langSecondsTitle", "langWeek", "langWeekFull", "langMonths", "langMonthsFull", "langToday"];
|
|
2100
|
+
var _excluded = ["contentRef", "popupRef", "triggerClassName", "popupClassName", "wrapperClassName", "controlClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "delimiter", "hideClearButton", "showToolsWhenHover", "offset", "exceededSidePosOffset", "localization", "type", "onlyTime", "truncateSeconds", "valueUseSlash", "disabled", "required", "readOnly", "value", "clickInitValue", "min", "max", "placeholder", "label", "units", "name", "alt", "id", "iconLeft", "iconRight", "autoComplete", "style", "tabIndex", "onLoad", "onChange", "onBlur", "onFocus", "onPressEnter", "onOpenPopup", "onClosePopup", "onChangeDate", "onChangeMonth", "onChangeYear", "onChangeToday", "onChangeHours", "onChangeMinutes", "onChangeSeconds", "langHoursTitle", "langMinutesTitle", "langSecondsTitle", "langWeek", "langWeekFull", "langMonths", "langMonthsFull", "langToday"];
|
|
2096
2101
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2097
2102
|
function src_slicedToArray(arr, i) { return src_arrayWithHoles(arr) || src_iterableToArrayLimit(arr, i) || src_unsupportedIterableToArray(arr, i) || src_nonIterableRest(); }
|
|
2098
2103
|
function src_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -2114,7 +2119,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
2114
2119
|
|
|
2115
2120
|
|
|
2116
2121
|
var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)(function (props, _ref) {
|
|
2117
|
-
var
|
|
2122
|
+
var contentRef = props.contentRef,
|
|
2123
|
+
popupRef = props.popupRef,
|
|
2118
2124
|
triggerClassName = props.triggerClassName,
|
|
2119
2125
|
popupClassName = props.popupClassName,
|
|
2120
2126
|
wrapperClassName = props.wrapperClassName,
|
|
@@ -2122,6 +2128,8 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
2122
2128
|
controlGroupWrapperClassName = props.controlGroupWrapperClassName,
|
|
2123
2129
|
controlGroupTextClassName = props.controlGroupTextClassName,
|
|
2124
2130
|
delimiter = props.delimiter,
|
|
2131
|
+
hideClearButton = props.hideClearButton,
|
|
2132
|
+
showToolsWhenHover = props.showToolsWhenHover,
|
|
2125
2133
|
offset = props.offset,
|
|
2126
2134
|
exceededSidePosOffset = props.exceededSidePosOffset,
|
|
2127
2135
|
localization = props.localization,
|
|
@@ -2151,6 +2159,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
2151
2159
|
_onChange = props.onChange,
|
|
2152
2160
|
onBlur = props.onBlur,
|
|
2153
2161
|
onFocus = props.onFocus,
|
|
2162
|
+
onPressEnter = props.onPressEnter,
|
|
2154
2163
|
onOpenPopup = props.onOpenPopup,
|
|
2155
2164
|
onClosePopup = props.onClosePopup,
|
|
2156
2165
|
_onChangeDate = props.onChangeDate,
|
|
@@ -2184,6 +2193,8 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
2184
2193
|
//
|
|
2185
2194
|
var DELIMITER_DATE = delimiter || '/';
|
|
2186
2195
|
var DELIMITER_TIME = ':';
|
|
2196
|
+
var SHOW_TOOLS_ENABLED = !(typeof showToolsWhenHover === 'undefined' || showToolsWhenHover === false);
|
|
2197
|
+
var HIDE_CLEAR_BTN_ENABLED = !(typeof hideClearButton === 'undefined' || hideClearButton === false);
|
|
2187
2198
|
|
|
2188
2199
|
// placeholder
|
|
2189
2200
|
var datePlaceholder = placeholder || placeholder === '' ? placeholder : 'yyyy/MM/dd HH:mm:ss';
|
|
@@ -2264,6 +2275,11 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
2264
2275
|
// blur for popup window
|
|
2265
2276
|
var popupBlurEnabled = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false); // DO NOT USE 'useState()'
|
|
2266
2277
|
|
|
2278
|
+
//
|
|
2279
|
+
var getAllSplittingInputs = function getAllSplittingInputs() {
|
|
2280
|
+
return [partedInputYear.current, partedInputMonth.current, partedInputDay.current, partedInputHours.current, partedInputMinutes.current, partedInputSeconds.current];
|
|
2281
|
+
};
|
|
2282
|
+
|
|
2267
2283
|
// exposes the following methods
|
|
2268
2284
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(popupRef, function () {
|
|
2269
2285
|
return {
|
|
@@ -2273,6 +2289,30 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
2273
2289
|
}
|
|
2274
2290
|
};
|
|
2275
2291
|
}, [popupRef]);
|
|
2292
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(contentRef, function () {
|
|
2293
|
+
return {
|
|
2294
|
+
clear: function clear(cb) {
|
|
2295
|
+
clearAll();
|
|
2296
|
+
cb === null || cb === void 0 ? void 0 : cb();
|
|
2297
|
+
},
|
|
2298
|
+
blur: function blur(cb) {
|
|
2299
|
+
getAllSplittingInputs().forEach(function (el) {
|
|
2300
|
+
if (el !== null) el.blur();
|
|
2301
|
+
});
|
|
2302
|
+
handleBlur(null);
|
|
2303
|
+
cb === null || cb === void 0 ? void 0 : cb();
|
|
2304
|
+
},
|
|
2305
|
+
/*
|
|
2306
|
+
set('2024-04-18 21:54:09', () => { console.log('callback') }])
|
|
2307
|
+
*/
|
|
2308
|
+
set: function set(value, cb) {
|
|
2309
|
+
var _defaultValueIsEmpty = typeof value === 'undefined' || value === null || value === 'null' || value === '';
|
|
2310
|
+
setDateDefaultValueExist(_defaultValueIsEmpty ? false : true);
|
|
2311
|
+
initValue(value);
|
|
2312
|
+
cb === null || cb === void 0 ? void 0 : cb();
|
|
2313
|
+
}
|
|
2314
|
+
};
|
|
2315
|
+
}, [contentRef]);
|
|
2276
2316
|
var windowScrollUpdate = (0,performance.debounce)(handleScrollEvent, 50);
|
|
2277
2317
|
var eventFire = function eventFire(el, etype) {
|
|
2278
2318
|
if (el.fireEvent) {
|
|
@@ -2323,8 +2363,6 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
2323
2363
|
//
|
|
2324
2364
|
var MIN = typeof min !== 'undefined' && min !== '' && min !== null && (0,utils_date.isValidDate)(min) ? getFullTimeData(min) : '';
|
|
2325
2365
|
var MAX = typeof max !== 'undefined' && max !== '' && max !== null && (0,utils_date.isValidDate)(max) ? getFullTimeData(max) : '';
|
|
2326
|
-
var currentMinDateDisabled = MIN !== '' ? Number(new window.Date().getTime()) < Number(new window.Date(MIN.res).getTime()) ? true : false : false;
|
|
2327
|
-
var currentMaxDateDisabled = MAX !== '' ? Number(new window.Date().getTime()) > Number(new window.Date(MAX.res).getTime()) ? true : false : false;
|
|
2328
2366
|
var getActualDefaultValue = function getActualDefaultValue(v) {
|
|
2329
2367
|
var init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
2330
2368
|
var _v = getFullTimeData((0,utils_date.getNow)());
|
|
@@ -2433,7 +2471,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
2433
2471
|
}
|
|
2434
2472
|
function popwinPosHide() {
|
|
2435
2473
|
setIsShow(false);
|
|
2436
|
-
onClosePopup === null || onClosePopup === void 0 ? void 0 : onClosePopup(
|
|
2474
|
+
onClosePopup === null || onClosePopup === void 0 ? void 0 : onClosePopup(getAllSplittingInputs());
|
|
2437
2475
|
}
|
|
2438
2476
|
function handleClickOutside(event) {
|
|
2439
2477
|
if (event.target.closest(".date2d__wrapper") === null && event.target.closest(".date2d-cal__wrapper") === null) {
|
|
@@ -2445,7 +2483,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
2445
2483
|
|
|
2446
2484
|
// move out the popup window
|
|
2447
2485
|
if (popupBlurEnabled.current) {
|
|
2448
|
-
onBlur === null || onBlur === void 0 ? void 0 : onBlur(inputRef.current);
|
|
2486
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(inputRef.current, getAllSplittingInputs());
|
|
2449
2487
|
popupBlurEnabled.current = false;
|
|
2450
2488
|
}
|
|
2451
2489
|
}
|
|
@@ -2454,7 +2492,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
2454
2492
|
setIsShow(true);
|
|
2455
2493
|
setTimeout(function () {
|
|
2456
2494
|
popwinPosInit();
|
|
2457
|
-
onOpenPopup === null || onOpenPopup === void 0 ? void 0 : onOpenPopup(
|
|
2495
|
+
onOpenPopup === null || onOpenPopup === void 0 ? void 0 : onOpenPopup(getAllSplittingInputs());
|
|
2458
2496
|
}, 0);
|
|
2459
2497
|
|
|
2460
2498
|
// focus
|
|
@@ -2465,13 +2503,13 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
2465
2503
|
(_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.add('focus');
|
|
2466
2504
|
|
|
2467
2505
|
//
|
|
2468
|
-
onFocus === null || onFocus === void 0 ? void 0 : onFocus(inputRef.current);
|
|
2506
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(inputRef.current, getAllSplittingInputs());
|
|
2469
2507
|
}
|
|
2470
2508
|
function handleChange(event) {
|
|
2471
2509
|
var val = event.target.value;
|
|
2472
2510
|
|
|
2473
2511
|
//
|
|
2474
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, val, (0,utils_date.isValidDate)(val));
|
|
2512
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, val, (0,utils_date.isValidDate)(val), getAllSplittingInputs());
|
|
2475
2513
|
}
|
|
2476
2514
|
function handleBlur(event) {
|
|
2477
2515
|
var _rootRef$current3;
|
|
@@ -2479,7 +2517,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
2479
2517
|
(_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.classList.remove('focus');
|
|
2480
2518
|
|
|
2481
2519
|
//
|
|
2482
|
-
onBlur === null || onBlur === void 0 ? void 0 : onBlur(inputRef.current);
|
|
2520
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(inputRef.current, getAllSplittingInputs());
|
|
2483
2521
|
}
|
|
2484
2522
|
function handleInitSplitClickEv(e) {
|
|
2485
2523
|
e.preventDefault();
|
|
@@ -2489,17 +2527,23 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
2489
2527
|
resetDefauleValueExist();
|
|
2490
2528
|
var _date = "".concat(splitVals[0], "-").concat(splitVals[1], "-").concat(splitVals[2]);
|
|
2491
2529
|
var _full = "".concat(_date, " ").concat(splitVals[3], ":").concat(splitVals[4], ":").concat(splitVals[5]);
|
|
2492
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full));
|
|
2530
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full), getAllSplittingInputs());
|
|
2493
2531
|
}
|
|
2494
2532
|
function handleKeypress(event) {
|
|
2495
2533
|
if (event.code == "Enter") {
|
|
2496
2534
|
event.preventDefault();
|
|
2535
|
+
getAllSplittingInputs().forEach(function (el) {
|
|
2536
|
+
if (el !== null) el.blur();
|
|
2537
|
+
});
|
|
2497
2538
|
handleBlur(null);
|
|
2539
|
+
|
|
2540
|
+
//
|
|
2541
|
+
onPressEnter === null || onPressEnter === void 0 ? void 0 : onPressEnter(inputRef.current, getAllSplittingInputs());
|
|
2498
2542
|
}
|
|
2499
2543
|
}
|
|
2500
2544
|
function clearAll() {
|
|
2501
2545
|
setDateDefaultValueExist(false);
|
|
2502
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, '', false);
|
|
2546
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, '', false, getAllSplittingInputs());
|
|
2503
2547
|
}
|
|
2504
2548
|
function resetDefauleValueExist() {
|
|
2505
2549
|
if (!dateDefaultValueExist) setDateDefaultValueExist(true);
|
|
@@ -2671,7 +2715,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
2671
2715
|
_initValue2 = src_slicedToArray(_initValue, 2),
|
|
2672
2716
|
a = _initValue2[0],
|
|
2673
2717
|
b = _initValue2[1];
|
|
2674
|
-
onLoad === null || onLoad === void 0 ? void 0 : onLoad(a, getFullTimeData(b));
|
|
2718
|
+
onLoad === null || onLoad === void 0 ? void 0 : onLoad(a, getFullTimeData(b), getAllSplittingInputs());
|
|
2675
2719
|
|
|
2676
2720
|
//--------------
|
|
2677
2721
|
document.removeEventListener('pointerdown', handleClickOutside);
|
|
@@ -2693,21 +2737,23 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
2693
2737
|
// window.removeEventListener('touchmove', windowScrollUpdate);
|
|
2694
2738
|
};
|
|
2695
2739
|
}, [value]);
|
|
2696
|
-
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
2740
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, label ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, typeof label === 'string' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
2697
2741
|
className: "date2d__label"
|
|
2698
|
-
},
|
|
2742
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("label", {
|
|
2699
2743
|
htmlFor: idRes,
|
|
2700
2744
|
className: "form-label",
|
|
2701
2745
|
dangerouslySetInnerHTML: {
|
|
2702
2746
|
__html: "".concat(label)
|
|
2703
2747
|
}
|
|
2704
|
-
}) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("
|
|
2748
|
+
})) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
2749
|
+
className: "date2d__label"
|
|
2750
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("label", {
|
|
2705
2751
|
htmlFor: idRes,
|
|
2706
2752
|
className: "form-label"
|
|
2707
|
-
}, label)) : null
|
|
2753
|
+
}, label))) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
2708
2754
|
ref: rootRef,
|
|
2709
2755
|
"data-overlay-id": "date2d__wrapper-".concat(idRes),
|
|
2710
|
-
className: "date2d__trigger d-inline-block is-".concat(type, " ").concat(triggerClassName || ''),
|
|
2756
|
+
className: "date2d__trigger d-inline-block is-".concat(type, " ").concat(triggerClassName || '', " ").concat(SHOW_TOOLS_ENABLED ? 'date2d__trigger--hover-show-tools' : ''),
|
|
2711
2757
|
onClick: handleShow,
|
|
2712
2758
|
onFocus: handleFocus,
|
|
2713
2759
|
onBlur: handleBlur,
|
|
@@ -2763,7 +2809,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
2763
2809
|
if (_val !== '' && !(0,utils_date.isValidYear)(_val) && !(0,utils_date.isNumeric)(_val)) _val = "".concat((0,utils_date.getCurrentYear)());
|
|
2764
2810
|
var _date = "".concat(_val, "-").concat(splitVals[1], "-").concat(splitVals[2]);
|
|
2765
2811
|
var _full = "".concat(_date, " ").concat(splitVals[3], ":").concat(splitVals[4], ":").concat(splitVals[5]);
|
|
2766
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full));
|
|
2812
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full), getAllSplittingInputs());
|
|
2767
2813
|
setSplitVals(function (prevState) {
|
|
2768
2814
|
return [_val, prevState[1], prevState[2], prevState[3], prevState[4], prevState[5]];
|
|
2769
2815
|
});
|
|
@@ -2793,7 +2839,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
2793
2839
|
if (_val !== '' && !(0,utils_date.isValidMonth)(_val) && !(0,utils_date.isNumeric)(_val)) _val = "".concat((0,utils_date.getCurrentMonth)());
|
|
2794
2840
|
var _date = "".concat(splitVals[0], "-").concat(_val, "-").concat(splitVals[2]);
|
|
2795
2841
|
var _full = "".concat(_date, " ").concat(splitVals[3], ":").concat(splitVals[4], ":").concat(splitVals[5]);
|
|
2796
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full));
|
|
2842
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full), getAllSplittingInputs());
|
|
2797
2843
|
setSplitVals(function (prevState) {
|
|
2798
2844
|
return [prevState[0], _val, prevState[2], prevState[3], prevState[4], prevState[5]];
|
|
2799
2845
|
});
|
|
@@ -2828,7 +2874,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
2828
2874
|
if (_val !== '' && !(0,utils_date.isValidDay)(_val) && !(0,utils_date.isNumeric)(_val)) _val = "".concat((0,utils_date.getCurrentDay)());
|
|
2829
2875
|
var _date = "".concat(splitVals[0], "-").concat(splitVals[1], "-").concat(_val);
|
|
2830
2876
|
var _full = "".concat(_date, " ").concat(splitVals[3], ":").concat(splitVals[4], ":").concat(splitVals[5]);
|
|
2831
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full));
|
|
2877
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full), getAllSplittingInputs());
|
|
2832
2878
|
setSplitVals(function (prevState) {
|
|
2833
2879
|
return [prevState[0], prevState[1], _val, prevState[3], prevState[4], prevState[5]];
|
|
2834
2880
|
});
|
|
@@ -2855,7 +2901,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
2855
2901
|
if (_val !== '' && !(0,utils_date.isValidHours)(_val) && !(0,utils_date.isNumeric)(_val)) _val = '00';
|
|
2856
2902
|
var _date = "".concat(splitVals[0], "-").concat(splitVals[1], "-").concat(splitVals[2]);
|
|
2857
2903
|
var _full = "".concat(_date, " ").concat(_val, ":").concat(splitVals[4], ":").concat(splitVals[5]);
|
|
2858
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full));
|
|
2904
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full), getAllSplittingInputs());
|
|
2859
2905
|
setSplitVals(function (prevState) {
|
|
2860
2906
|
return [prevState[0], prevState[1], prevState[2], _val, prevState[4], prevState[5]];
|
|
2861
2907
|
});
|
|
@@ -2882,7 +2928,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
2882
2928
|
if (_val !== '' && !(0,utils_date.isValidMinutesAndSeconds)(_val) && !(0,utils_date.isNumeric)(_val)) _val = '00';
|
|
2883
2929
|
var _date = "".concat(splitVals[0], "-").concat(splitVals[1], "-").concat(splitVals[2]);
|
|
2884
2930
|
var _full = "".concat(_date, " ").concat(splitVals[3], ":").concat(_val, ":").concat(splitVals[5]);
|
|
2885
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full));
|
|
2931
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full), getAllSplittingInputs());
|
|
2886
2932
|
setSplitVals(function (prevState) {
|
|
2887
2933
|
return [prevState[0], prevState[1], prevState[2], prevState[3], _val, prevState[5]];
|
|
2888
2934
|
});
|
|
@@ -2909,7 +2955,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
2909
2955
|
if (_val !== '' && !(0,utils_date.isValidMinutesAndSeconds)(_val) && !(0,utils_date.isNumeric)(_val)) _val = '00';
|
|
2910
2956
|
var _date = "".concat(splitVals[0], "-").concat(splitVals[1], "-").concat(splitVals[2]);
|
|
2911
2957
|
var _full = "".concat(_date, " ").concat(splitVals[3], ":").concat(splitVals[4], ":").concat(_val);
|
|
2912
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full));
|
|
2958
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full), getAllSplittingInputs());
|
|
2913
2959
|
setSplitVals(function (prevState) {
|
|
2914
2960
|
return [prevState[0], prevState[1], prevState[2], prevState[3], prevState[4], _val];
|
|
2915
2961
|
});
|
|
@@ -2922,11 +2968,11 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
2922
2968
|
}, attributes))) : null) : null)),
|
|
2923
2969
|
style: style
|
|
2924
2970
|
}, attributes)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
2925
|
-
className: "
|
|
2971
|
+
className: "date2d__control-tools ".concat(SHOW_TOOLS_ENABLED ? 'date2d__control-tools--hover-show-tools' : '')
|
|
2926
2972
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("a", {
|
|
2927
2973
|
tabIndex: -1,
|
|
2928
2974
|
href: "#",
|
|
2929
|
-
className: "
|
|
2975
|
+
className: "date2d__control-tools__close ".concat(HIDE_CLEAR_BTN_ENABLED ? 'd-none' : '', " ").concat(dateDefaultValueExist ? '' : 'd-none'),
|
|
2930
2976
|
onClick: function onClick(e) {
|
|
2931
2977
|
e.preventDefault();
|
|
2932
2978
|
e.stopPropagation(); // Avoid triggering pop-ups
|
|
@@ -2984,7 +3030,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
2984
3030
|
setSplitVals(function (prevState) {
|
|
2985
3031
|
return [_v.year, _v.month, _v.day, prevState[3], prevState[4], prevState[5]];
|
|
2986
3032
|
});
|
|
2987
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true);
|
|
3033
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true, getAllSplittingInputs());
|
|
2988
3034
|
|
|
2989
3035
|
//
|
|
2990
3036
|
_onChangeDate === null || _onChangeDate === void 0 ? void 0 : _onChangeDate(_v);
|
|
@@ -3003,7 +3049,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
3003
3049
|
setSplitVals(function (prevState) {
|
|
3004
3050
|
return [_v.year, _v.month, _v.day, prevState[3], prevState[4], prevState[5]];
|
|
3005
3051
|
});
|
|
3006
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true);
|
|
3052
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true, getAllSplittingInputs());
|
|
3007
3053
|
|
|
3008
3054
|
//
|
|
3009
3055
|
_onChangeToday === null || _onChangeToday === void 0 ? void 0 : _onChangeToday(_v);
|
|
@@ -3022,7 +3068,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
3022
3068
|
setSplitVals(function (prevState) {
|
|
3023
3069
|
return [_v.year, _v.month, _v.day, prevState[3], prevState[4], prevState[5]];
|
|
3024
3070
|
});
|
|
3025
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true);
|
|
3071
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true, getAllSplittingInputs());
|
|
3026
3072
|
|
|
3027
3073
|
//
|
|
3028
3074
|
_onChangeMonth === null || _onChangeMonth === void 0 ? void 0 : _onChangeMonth(_v);
|
|
@@ -3041,7 +3087,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
3041
3087
|
setSplitVals(function (prevState) {
|
|
3042
3088
|
return [_v.year, _v.month, _v.day, prevState[3], prevState[4], prevState[5]];
|
|
3043
3089
|
});
|
|
3044
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true);
|
|
3090
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true, getAllSplittingInputs());
|
|
3045
3091
|
|
|
3046
3092
|
//
|
|
3047
3093
|
_onChangeYear === null || _onChangeYear === void 0 ? void 0 : _onChangeYear(_v);
|
|
@@ -3073,7 +3119,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
3073
3119
|
setSplitVals(function (prevState) {
|
|
3074
3120
|
return [prevState[0], prevState[1], prevState[2], _v.hours, prevState[4], prevState[5]];
|
|
3075
3121
|
});
|
|
3076
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true);
|
|
3122
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true, getAllSplittingInputs());
|
|
3077
3123
|
|
|
3078
3124
|
//
|
|
3079
3125
|
onChangeHours === null || onChangeHours === void 0 ? void 0 : onChangeHours(_v);
|
|
@@ -3107,7 +3153,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
3107
3153
|
setSplitVals(function (prevState) {
|
|
3108
3154
|
return [prevState[0], prevState[1], prevState[2], prevState[3], _v.minutes, prevState[5]];
|
|
3109
3155
|
});
|
|
3110
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true);
|
|
3156
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true, getAllSplittingInputs());
|
|
3111
3157
|
|
|
3112
3158
|
//
|
|
3113
3159
|
onChangeMinutes === null || onChangeMinutes === void 0 ? void 0 : onChangeMinutes(_v);
|
|
@@ -3141,7 +3187,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
3141
3187
|
setSplitVals(function (prevState) {
|
|
3142
3188
|
return [prevState[0], prevState[1], prevState[2], prevState[3], prevState[5], _v.seconds];
|
|
3143
3189
|
});
|
|
3144
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true);
|
|
3190
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true, getAllSplittingInputs());
|
|
3145
3191
|
|
|
3146
3192
|
//
|
|
3147
3193
|
onChangeSeconds === null || onChangeSeconds === void 0 ? void 0 : onChangeSeconds(_v);
|
package/lib/cjs/Input/index.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ declare type InputProps = {
|
|
|
45
45
|
onChange?: (e: any, param: any, el: any) => void;
|
|
46
46
|
onBlur?: (e: any, param: any, el: any) => void;
|
|
47
47
|
onFocus?: (e: any, param: any, el: any) => void;
|
|
48
|
+
onPressEnter?: (e: any, el: any) => void;
|
|
48
49
|
};
|
|
49
50
|
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<unknown>>;
|
|
50
51
|
export default Input;
|
package/lib/cjs/Input/index.js
CHANGED
|
@@ -96,7 +96,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
96
96
|
/* harmony export */ });
|
|
97
97
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(787);
|
|
98
98
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
99
|
-
var _excluded = ["contentRef", "wrapperClassName", "controlClassName", "controlExClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "type", "disabled", "required", "placeholder", "pattern", "readOnly", "value", "label", "units", "name", "step", "min", "max", "src", "size", "minLength", "maxLength", "alt", "inputMode", "id", "appendControl", "iconLeft", "iconRight", "autoComplete", "style", "tabIndex", "onChangeCallback", "onInputCallback", "onKeyPressedCallback", "onChange", "onBlur", "onFocus"];
|
|
99
|
+
var _excluded = ["contentRef", "wrapperClassName", "controlClassName", "controlExClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "type", "disabled", "required", "placeholder", "pattern", "readOnly", "value", "label", "units", "name", "step", "min", "max", "src", "size", "minLength", "maxLength", "alt", "inputMode", "id", "appendControl", "iconLeft", "iconRight", "autoComplete", "style", "tabIndex", "onChangeCallback", "onInputCallback", "onKeyPressedCallback", "onChange", "onBlur", "onFocus", "onPressEnter"];
|
|
100
100
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
101
101
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
102
102
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -146,6 +146,7 @@ var Input = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(funct
|
|
|
146
146
|
onChange = props.onChange,
|
|
147
147
|
onBlur = props.onBlur,
|
|
148
148
|
onFocus = props.onFocus,
|
|
149
|
+
onPressEnter = props.onPressEnter,
|
|
149
150
|
attributes = _objectWithoutProperties(props, _excluded);
|
|
150
151
|
var uniqueID = (0,react__WEBPACK_IMPORTED_MODULE_0__.useId)();
|
|
151
152
|
var idRes = id || uniqueID;
|
|
@@ -239,8 +240,12 @@ var Input = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(funct
|
|
|
239
240
|
var newData = onKeyPressedCallback(event, valRef.current);
|
|
240
241
|
if (newData) setChangedVal(newData); // Avoid the error "react checkbox changing an uncontrolled input to be controlled"
|
|
241
242
|
}
|
|
242
|
-
}
|
|
243
243
|
|
|
244
|
+
if (event.code == "Enter") {
|
|
245
|
+
// DO NOT USE "preventDefault()"
|
|
246
|
+
onPressEnter === null || onPressEnter === void 0 ? void 0 : onPressEnter(event, valRef.current);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
244
249
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
245
250
|
// update default value
|
|
246
251
|
//--------------
|
|
@@ -57,6 +57,7 @@ declare type LiveSearchProps = {
|
|
|
57
57
|
onChange?: (inputEl: any, data: any, selectedData: any, popupEl: any) => void;
|
|
58
58
|
onKeyboardInput?: (e: any, inputEl: any, popupEl: any) => void;
|
|
59
59
|
onBlur?: (inputEl: any, popupEl: any) => void;
|
|
60
|
+
onPressEnter?: (inputEl: any, popupEl: any) => void;
|
|
60
61
|
};
|
|
61
62
|
declare const LiveSearch: React.ForwardRefExoticComponent<LiveSearchProps & React.RefAttributes<unknown>>;
|
|
62
63
|
export default LiveSearch;
|