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/Date/index.css
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
--date2d-trigger-focus-box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25);
|
|
7
7
|
--date2d-trigger-clear-bg: rgb(156, 156, 156);
|
|
8
8
|
width: 100%;
|
|
9
|
+
/* tools */
|
|
9
10
|
}
|
|
10
11
|
.date2d__trigger.focus .date2d__control input {
|
|
11
12
|
box-shadow: var(--date2d-trigger-focus-box-shadow);
|
|
@@ -19,19 +20,26 @@
|
|
|
19
20
|
color: transparent;
|
|
20
21
|
pointer-events: none;
|
|
21
22
|
}
|
|
22
|
-
.date2d__trigger .date2d__control .
|
|
23
|
+
.date2d__trigger .date2d__control .date2d__control-tools {
|
|
23
24
|
position: absolute;
|
|
24
25
|
top: 0.3rem;
|
|
25
26
|
right: 0.5rem;
|
|
26
27
|
z-index: 6;
|
|
27
28
|
cursor: pointer;
|
|
29
|
+
height: 1.5rem;
|
|
30
|
+
line-height: 1.5rem;
|
|
28
31
|
}
|
|
29
|
-
.date2d__trigger .date2d__control .
|
|
32
|
+
.date2d__trigger .date2d__control .date2d__control-tools.date2d__control-tools--hover-show-tools {
|
|
33
|
+
transform: scale(0);
|
|
34
|
+
transition: 0.1s ease-in-out;
|
|
35
|
+
transition-delay: 0.25s;
|
|
36
|
+
}
|
|
37
|
+
.date2d__trigger .date2d__control .date2d__control-tools .date2d__control-tools__close {
|
|
30
38
|
display: inline-block;
|
|
31
39
|
margin-right: 0.2rem;
|
|
32
40
|
pointer-events: all;
|
|
33
41
|
}
|
|
34
|
-
.date2d__trigger .date2d__control .
|
|
42
|
+
.date2d__trigger .date2d__control .date2d__control-tools .date2d__control-tools__close svg path {
|
|
35
43
|
fill: var(--date2d-trigger-clear-bg);
|
|
36
44
|
}
|
|
37
45
|
.date2d__trigger .date2d__control__inputplaceholder {
|
|
@@ -68,6 +76,9 @@
|
|
|
68
76
|
.date2d__trigger .date2d__control .input-group:not(.has-left-content) .date2d__control__inputplaceholder {
|
|
69
77
|
left: 0.5rem;
|
|
70
78
|
}
|
|
79
|
+
.date2d__trigger.date2d__trigger--hover-show-tools:hover .date2d__control-tools.date2d__control-tools--hover-show-tools {
|
|
80
|
+
transform: scale(1);
|
|
81
|
+
}
|
|
71
82
|
|
|
72
83
|
.date2d__wrapper {
|
|
73
84
|
--date2d-box-shadow: 0 5px 15px 0 rgba(0,0,0,.07), 0 15px 35px 0 rgba(50,50,93,.1);
|
package/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/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/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/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
|
//--------------
|
package/LiveSearch/index.d.ts
CHANGED
|
@@ -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;
|
package/LiveSearch/index.js
CHANGED
|
@@ -547,7 +547,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
547
547
|
var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1465__(787);
|
|
548
548
|
/* harmony import */
|
|
549
549
|
var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1465__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
550
|
-
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"];
|
|
550
|
+
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"];
|
|
551
551
|
function _extends() {
|
|
552
552
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
553
553
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -670,6 +670,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
670
670
|
onChange = props.onChange,
|
|
671
671
|
onBlur = props.onBlur,
|
|
672
672
|
onFocus = props.onFocus,
|
|
673
|
+
onPressEnter = props.onPressEnter,
|
|
673
674
|
attributes = _objectWithoutProperties(props, _excluded);
|
|
674
675
|
var uniqueID = (0, react__WEBPACK_IMPORTED_MODULE_0__.useId)();
|
|
675
676
|
var idRes = id || uniqueID;
|
|
@@ -739,8 +740,12 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
739
740
|
var newData = onKeyPressedCallback(event);
|
|
740
741
|
if (newData) setChangedVal(newData); // Avoid the error "react checkbox changing an uncontrolled input to be controlled"
|
|
741
742
|
}
|
|
742
|
-
}
|
|
743
743
|
|
|
744
|
+
if (event.code == "Enter") {
|
|
745
|
+
// DO NOT USE "preventDefault()"
|
|
746
|
+
onPressEnter === null || onPressEnter === void 0 ? void 0 : onPressEnter(event, onComposition);
|
|
747
|
+
}
|
|
748
|
+
}
|
|
744
749
|
(0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
745
750
|
// update default value
|
|
746
751
|
//--------------
|
|
@@ -984,7 +989,7 @@ var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs);
|
|
|
984
989
|
var dist_cjs = __webpack_require__(962);
|
|
985
990
|
var dist_cjs_default = /*#__PURE__*/__webpack_require__.n(dist_cjs);
|
|
986
991
|
;// CONCATENATED MODULE: ./src/index.tsx
|
|
987
|
-
var _excluded = ["popupRef", "wrapperClassName", "controlClassName", "controlExClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "exceededSidePosOffset", "appearance", "isSearchInput", "allowSpacingRetrive", "readOnly", "disabled", "required", "placeholder", "options", "value", "label", "name", "units", "iconLeft", "iconRight", "minLength", "maxLength", "id", "icon", "btnId", "fetchTrigger", "hideIcon", "depth", "style", "winWidth", "tabIndex", "data", "autoShowOptions", "fetchNoneInfo", "fetchUpdate", "fetchFuncAsync", "fetchFuncMethod", "fetchFuncMethodParams", "fetchCallback", "onClick", "onFetch", "onChange", "onKeyboardInput", "onBlur"];
|
|
992
|
+
var _excluded = ["popupRef", "wrapperClassName", "controlClassName", "controlExClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "exceededSidePosOffset", "appearance", "isSearchInput", "allowSpacingRetrive", "readOnly", "disabled", "required", "placeholder", "options", "value", "label", "name", "units", "iconLeft", "iconRight", "minLength", "maxLength", "id", "icon", "btnId", "fetchTrigger", "hideIcon", "depth", "style", "winWidth", "tabIndex", "data", "autoShowOptions", "fetchNoneInfo", "fetchUpdate", "fetchFuncAsync", "fetchFuncMethod", "fetchFuncMethodParams", "fetchCallback", "onClick", "onFetch", "onChange", "onKeyboardInput", "onBlur", "onPressEnter"];
|
|
988
993
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
989
994
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
990
995
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -1054,6 +1059,7 @@ var LiveSearch = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_re
|
|
|
1054
1059
|
onChange = props.onChange,
|
|
1055
1060
|
onKeyboardInput = props.onKeyboardInput,
|
|
1056
1061
|
onBlur = props.onBlur,
|
|
1062
|
+
_onPressEnter = props.onPressEnter,
|
|
1057
1063
|
attributes = _objectWithoutProperties(props, _excluded);
|
|
1058
1064
|
var DEPTH = depth || 1055; // the default value same as bootstrap
|
|
1059
1065
|
var POS_OFFSET = 0;
|
|
@@ -1775,6 +1781,9 @@ var LiveSearch = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_re
|
|
|
1775
1781
|
isSearchInput: isSearchInput,
|
|
1776
1782
|
onKeyPressedCallback: function onKeyPressedCallback(e) {
|
|
1777
1783
|
onKeyboardInput === null || onKeyboardInput === void 0 ? void 0 : onKeyboardInput(e, inputRef.current, listRef.current);
|
|
1784
|
+
},
|
|
1785
|
+
onPressEnter: function onPressEnter(event, onComposition) {
|
|
1786
|
+
_onPressEnter === null || _onPressEnter === void 0 ? void 0 : _onPressEnter(event, onComposition);
|
|
1778
1787
|
}
|
|
1779
1788
|
}, attributes)), orginalData && !hasErr ? /*#__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((cjs_default()), {
|
|
1780
1789
|
show: true,
|
package/MultiFuncSelect/index.js
CHANGED
|
@@ -1282,7 +1282,7 @@ var MultiFuncSelect = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
|
|
|
1282
1282
|
cb === null || cb === void 0 ? void 0 : cb();
|
|
1283
1283
|
},
|
|
1284
1284
|
/*
|
|
1285
|
-
set([{"label": "Option 1","listItemLabel":"Option 1 (No: 001)","value": "value-1","queryString": "option1"}, () => { console.log('callback') }])
|
|
1285
|
+
set([{"label": "Option 1","listItemLabel":"Option 1 (No: 001)","value": "value-1","queryString": "option1"}], () => { console.log('callback') }])
|
|
1286
1286
|
*/
|
|
1287
1287
|
set: function set(value, cb) {
|
|
1288
1288
|
if (MULTI_SEL_VALID) {
|
package/RangeSlider/index.js
CHANGED
|
@@ -158,7 +158,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
158
158
|
var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1465__(787);
|
|
159
159
|
/* harmony import */
|
|
160
160
|
var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1465__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
161
|
-
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"];
|
|
161
|
+
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"];
|
|
162
162
|
function _extends() {
|
|
163
163
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
164
164
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -288,6 +288,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
288
288
|
onChange = props.onChange,
|
|
289
289
|
onBlur = props.onBlur,
|
|
290
290
|
onFocus = props.onFocus,
|
|
291
|
+
onPressEnter = props.onPressEnter,
|
|
291
292
|
attributes = _objectWithoutProperties(props, _excluded);
|
|
292
293
|
var uniqueID = (0, react__WEBPACK_IMPORTED_MODULE_0__.useId)();
|
|
293
294
|
var idRes = id || uniqueID;
|
|
@@ -381,8 +382,12 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
381
382
|
var newData = onKeyPressedCallback(event, valRef.current);
|
|
382
383
|
if (newData) setChangedVal(newData); // Avoid the error "react checkbox changing an uncontrolled input to be controlled"
|
|
383
384
|
}
|
|
384
|
-
}
|
|
385
385
|
|
|
386
|
+
if (event.code == "Enter") {
|
|
387
|
+
// DO NOT USE "preventDefault()"
|
|
388
|
+
onPressEnter === null || onPressEnter === void 0 ? void 0 : onPressEnter(event, valRef.current);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
386
391
|
(0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
387
392
|
// update default value
|
|
388
393
|
//--------------
|
package/SearchBar/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ declare type SearchBarProps = {
|
|
|
38
38
|
onChange?: (e: any, param: any) => void;
|
|
39
39
|
onBlur?: (e: any, param: any) => void;
|
|
40
40
|
onFocus?: (e: any, param: any) => void;
|
|
41
|
+
onPressEnter?: (e: any, param: any) => void;
|
|
41
42
|
};
|
|
42
43
|
declare const SearchBar: React.ForwardRefExoticComponent<SearchBarProps & React.RefAttributes<unknown>>;
|
|
43
44
|
export default SearchBar;
|