funda-ui 4.5.666 → 4.5.671
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/ColorPicker/index.js +3 -1
- package/Date/index.js +14 -1
- package/DragDropList/index.css +188 -0
- package/DragDropList/index.d.ts +44 -0
- package/DragDropList/index.js +1587 -0
- package/Input/index.d.ts +2 -0
- package/Input/index.js +14 -1
- package/LICENSE +21 -0
- package/MultipleSelect/index.css +237 -144
- package/MultipleSelect/index.d.ts +24 -10
- package/MultipleSelect/index.js +2240 -1225
- package/README.md +3 -1
- package/RangeSlider/index.js +14 -1
- package/Textarea/index.d.ts +2 -0
- package/Textarea/index.js +14 -1
- package/Tree/index.d.ts +1 -0
- package/Tree/index.js +29 -0
- package/Utils/useBoundedDrag.d.ts +125 -0
- package/Utils/useBoundedDrag.js +380 -0
- package/Utils/useDragDropPosition.d.ts +169 -0
- package/Utils/useDragDropPosition.js +456 -0
- package/Utils/useIsMobile.d.ts +2 -0
- package/Utils/useIsMobile.js +168 -0
- package/all.d.ts +1 -0
- package/all.js +1 -1
- package/lib/cjs/ColorPicker/index.js +3 -1
- package/lib/cjs/Date/index.js +14 -1
- package/lib/cjs/DragDropList/index.d.ts +44 -0
- package/lib/cjs/DragDropList/index.js +1587 -0
- package/lib/cjs/Input/index.d.ts +2 -0
- package/lib/cjs/Input/index.js +14 -1
- package/lib/cjs/MultipleSelect/index.d.ts +24 -10
- package/lib/cjs/MultipleSelect/index.js +2240 -1225
- package/lib/cjs/RangeSlider/index.js +14 -1
- package/lib/cjs/Textarea/index.d.ts +2 -0
- package/lib/cjs/Textarea/index.js +14 -1
- package/lib/cjs/Tree/index.d.ts +1 -0
- package/lib/cjs/Tree/index.js +29 -0
- package/lib/cjs/Utils/useBoundedDrag.d.ts +125 -0
- package/lib/cjs/Utils/useBoundedDrag.js +380 -0
- package/lib/cjs/Utils/useDragDropPosition.d.ts +169 -0
- package/lib/cjs/Utils/useDragDropPosition.js +456 -0
- package/lib/cjs/Utils/useIsMobile.d.ts +2 -0
- package/lib/cjs/Utils/useIsMobile.js +168 -0
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +1 -1
- package/lib/css/DragDropList/index.css +188 -0
- package/lib/css/MultipleSelect/index.css +237 -144
- package/lib/esm/ColorPicker/index.tsx +53 -49
- package/lib/esm/DragDropList/index.scss +245 -0
- package/lib/esm/DragDropList/index.tsx +494 -0
- package/lib/esm/Input/index.tsx +17 -3
- package/lib/esm/MultipleSelect/index.scss +288 -183
- package/lib/esm/MultipleSelect/index.tsx +305 -166
- package/lib/esm/MultipleSelect/utils/func.ts +21 -1
- package/lib/esm/Tabs/Tabs.tsx +1 -1
- package/lib/esm/Textarea/index.tsx +18 -1
- package/lib/esm/Tree/TreeList.tsx +32 -0
- package/lib/esm/Tree/index.tsx +3 -0
- package/lib/esm/Utils/hooks/useBoundedDrag.tsx +301 -0
- package/lib/esm/Utils/hooks/useDragDropPosition.tsx +420 -0
- package/lib/esm/Utils/hooks/useIsMobile.tsx +56 -0
- package/lib/esm/index.js +1 -0
- package/package.json +1 -1
- package/lib/esm/MultipleSelect/ItemList.tsx +0 -323
package/lib/cjs/Date/index.js
CHANGED
|
@@ -1055,7 +1055,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
1055
1055
|
var funda_utils_dist_cjs_useDebounce__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_41372__(702);
|
|
1056
1056
|
/* harmony import */
|
|
1057
1057
|
var funda_utils_dist_cjs_useDebounce__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_41372__.n(funda_utils_dist_cjs_useDebounce__WEBPACK_IMPORTED_MODULE_4__);
|
|
1058
|
-
var _excluded = ["contentRef", "wrapperClassName", "controlClassName", "controlExClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "type", "disabled", "required", "placeholder", "pattern", "readOnly", "defaultValue", "value", "requiredLabel", "label", "units", "name", "step", "min", "max", "src", "size", "minLength", "maxLength", "alt", "inputMode", "id", "appendControl", "aiPredict", "aiPredictRemainingTextRGB", "aiPredictConfirmKey", "aiPredictFetchFuncAsync", "aiPredictFetchFuncMethod", "aiPredictFetchFuncMethodParams", "aiPredictFetchCallback", "iconLeft", "iconRight", "autoComplete", "autoCapitalize", "spellCheck", "style", "tabIndex", "onChangeCallback", "onInputCallback", "onKeyPressedCallback", "onChange", "onBlur", "onFocus", "onPressEnter"];
|
|
1058
|
+
var _excluded = ["contentRef", "wrapperClassName", "controlClassName", "controlExClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "type", "disabled", "required", "placeholder", "pattern", "readOnly", "defaultValue", "value", "requiredLabel", "label", "units", "name", "step", "min", "max", "src", "size", "minLength", "maxLength", "alt", "inputMode", "id", "appendControl", "aiPredict", "aiPredictRemainingTextRGB", "aiPredictConfirmKey", "aiPredictFetchFuncAsync", "aiPredictFetchFuncMethod", "aiPredictFetchFuncMethodParams", "aiPredictFetchCallback", "iconLeft", "iconRight", "autoComplete", "autoCapitalize", "spellCheck", "style", "tabIndex", "onChangeCallback", "onInputCallback", "onKeyPressedCallback", "onChange", "onBlur", "onFocus", "onPressEnter", "onKeyDown", "onKeyUp"];
|
|
1059
1059
|
function _regeneratorRuntime() {
|
|
1060
1060
|
"use strict";
|
|
1061
1061
|
|
|
@@ -1555,6 +1555,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
1555
1555
|
onBlur = props.onBlur,
|
|
1556
1556
|
onFocus = props.onFocus,
|
|
1557
1557
|
onPressEnter = props.onPressEnter,
|
|
1558
|
+
onKeyDown = props.onKeyDown,
|
|
1559
|
+
onKeyUp = props.onKeyUp,
|
|
1558
1560
|
attributes = _objectWithoutProperties(props, _excluded);
|
|
1559
1561
|
var uniqueID = funda_utils_dist_cjs_useComId__WEBPACK_IMPORTED_MODULE_1___default()();
|
|
1560
1562
|
var idRes = id || uniqueID;
|
|
@@ -1760,6 +1762,12 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
1760
1762
|
set: function set(value, cb) {
|
|
1761
1763
|
setChangedVal("".concat(value));
|
|
1762
1764
|
cb === null || cb === void 0 ? void 0 : cb();
|
|
1765
|
+
},
|
|
1766
|
+
aiPredictReset: function aiPredictReset() {
|
|
1767
|
+
setTimeout(function () {
|
|
1768
|
+
// Avoid conflicts with other asynchronous states, resulting in invalid clearing
|
|
1769
|
+
setCurrentSuggestion('');
|
|
1770
|
+
}, 0);
|
|
1763
1771
|
}
|
|
1764
1772
|
};
|
|
1765
1773
|
}, [contentRef]);
|
|
@@ -1823,6 +1831,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
1823
1831
|
}
|
|
1824
1832
|
|
|
1825
1833
|
function handleKeyPressed(event) {
|
|
1834
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event, valRef.current);
|
|
1826
1835
|
if (typeof onKeyPressedCallback === 'function') {
|
|
1827
1836
|
var newData = onKeyPressedCallback(event, valRef.current);
|
|
1828
1837
|
if (newData) setChangedVal(newData); // Avoid the error "react checkbox changing an uncontrolled input to be controlled"
|
|
@@ -1866,6 +1875,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
1866
1875
|
setCurrentSuggestion(tempMatchedSuggestion[currentSuggestionIndex.current] || '');
|
|
1867
1876
|
}
|
|
1868
1877
|
}
|
|
1878
|
+
function handleKeyUp(event) {
|
|
1879
|
+
onKeyUp === null || onKeyUp === void 0 ? void 0 : onKeyUp(event, valRef.current);
|
|
1880
|
+
}
|
|
1869
1881
|
(0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
1870
1882
|
// update default value
|
|
1871
1883
|
//--------------
|
|
@@ -1957,6 +1969,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
1957
1969
|
}
|
|
1958
1970
|
},
|
|
1959
1971
|
onKeyDown: handleKeyPressed,
|
|
1972
|
+
onKeyUp: handleKeyUp,
|
|
1960
1973
|
onCompositionStart: handleComposition,
|
|
1961
1974
|
onCompositionUpdate: handleComposition,
|
|
1962
1975
|
onCompositionEnd: handleComposition,
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ListItem {
|
|
3
|
+
id: number;
|
|
4
|
+
parentId?: number;
|
|
5
|
+
label: string;
|
|
6
|
+
listItemLabel: string;
|
|
7
|
+
value: string;
|
|
8
|
+
queryString: string;
|
|
9
|
+
depth?: number;
|
|
10
|
+
children?: ListItem[];
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
appendControl?: React.ReactNode;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
export interface DragDropListProps {
|
|
16
|
+
wrapperClassName?: string;
|
|
17
|
+
prefix?: string;
|
|
18
|
+
data?: ListItem[];
|
|
19
|
+
draggable?: boolean;
|
|
20
|
+
handleHide?: boolean;
|
|
21
|
+
handleIcon?: string;
|
|
22
|
+
handlePos?: 'left' | 'right';
|
|
23
|
+
dragMode?: 'handle' | 'block';
|
|
24
|
+
editable?: boolean;
|
|
25
|
+
itemStyle?: React.CSSProperties;
|
|
26
|
+
hierarchical?: boolean;
|
|
27
|
+
indentation?: string;
|
|
28
|
+
doubleIndent?: boolean;
|
|
29
|
+
alternateCollapse?: boolean;
|
|
30
|
+
arrow?: React.ReactNode;
|
|
31
|
+
onUpdate?: (items: ListItem[], curId: number) => void;
|
|
32
|
+
}
|
|
33
|
+
export interface EditValue {
|
|
34
|
+
[propName: string]: string | number;
|
|
35
|
+
}
|
|
36
|
+
export interface TouchOffset {
|
|
37
|
+
x: number;
|
|
38
|
+
y: number;
|
|
39
|
+
}
|
|
40
|
+
export interface OptionConfig {
|
|
41
|
+
[propName: string]: string | number | boolean | Function | any[];
|
|
42
|
+
}
|
|
43
|
+
declare const DragDropList: React.ForwardRefExoticComponent<DragDropListProps & React.RefAttributes<unknown>>;
|
|
44
|
+
export default DragDropList;
|