linkmore-design 1.0.51 → 1.0.55
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/dist/{Notification → Affix}/demos/basic.d.ts +0 -0
- package/dist/Affix/index.d.ts +54 -0
- package/dist/{Notification → Affix}/style/index.d.ts +0 -0
- package/dist/Affix/utils.d.ts +15 -0
- package/dist/Alert/ErrorBoundary.d.ts +22 -0
- package/dist/{Notification/demos/button.d.ts → Alert/demos/basic.d.ts} +0 -0
- package/dist/{Notification/demos/icon.d.ts → Alert/demos/visible.d.ts} +0 -0
- package/dist/Alert/index.d.ts +41 -0
- package/dist/Alert/style/index.d.ts +1 -0
- package/dist/Button/style/index.d.ts +1 -1
- package/dist/CardTable/fns/index.d.ts +3 -3
- package/dist/CardTable/{toolbar → pager}/TablePagination.d.ts +0 -0
- package/dist/CardTable/pager/index.d.ts +3 -0
- package/dist/IconFont/index.d.ts +1 -1
- package/dist/LmEditTable/style/index.d.ts +1 -1
- package/dist/LmFilter/LmFilter.d.ts +3 -0
- package/dist/LmFilter/baseFilter/fuzzySearch.d.ts +4 -0
- package/dist/LmFilter/baseFilter/index.d.ts +3 -0
- package/dist/LmFilter/clearFilter/index.d.ts +3 -0
- package/dist/LmFilter/complexFilter/index.d.ts +2 -0
- package/dist/LmFilter/components/CascaderFilter.d.ts +5 -0
- package/dist/LmFilter/components/CheckboxFilter.d.ts +5 -0
- package/dist/LmFilter/components/DateFilter.d.ts +5 -0
- package/dist/LmFilter/components/DropdownFIlter.d.ts +3 -0
- package/dist/LmFilter/components/EmptyFilter.d.ts +2 -0
- package/dist/LmFilter/components/InputFilter.d.ts +4 -0
- package/dist/LmFilter/components/InputSearchClose.d.ts +3 -0
- package/dist/LmFilter/components/SelectFilter.d.ts +5 -0
- package/dist/LmFilter/components/index.d.ts +3 -0
- package/dist/LmFilter/customFilter/index.d.ts +2 -0
- package/dist/LmFilter/demos/basic.d.ts +2 -0
- package/dist/LmFilter/filterFns/index.d.ts +12 -0
- package/dist/LmFilter/hooks/index.d.ts +1 -0
- package/dist/LmFilter/hooks/useDelayedFn.d.ts +2 -0
- package/dist/LmFilter/index.d.ts +2 -0
- package/dist/LmFilter/style/index.d.ts +1 -0
- package/dist/LmFilter/utils.d.ts +9 -0
- package/dist/LmFilter/wrapper/Filter.d.ts +3 -0
- package/dist/LmFilter/wrapper/FilterContainer.d.ts +3 -0
- package/dist/LmFilter/wrapper/FilterRoot.d.ts +3 -0
- package/dist/LmFilter/wrapper/FilterWrapper.d.ts +3 -0
- package/dist/QuickMenu/demos/basic.d.ts +2 -0
- package/dist/QuickMenu/index.d.ts +14 -0
- package/dist/QuickMenu/style/index.d.ts +1 -0
- package/dist/Tag/demos/ExigencyTag.d.ts +2 -0
- package/dist/Tag/index.d.ts +4 -0
- package/dist/Upload/demos/picture-little.d.ts +3 -0
- package/dist/Upload/index.d.ts +5 -1
- package/dist/_util/domTarget.d.ts +7 -0
- package/dist/_util/getDataOrAriaProps.d.ts +1 -0
- package/dist/_util/reactNode.d.ts +7 -0
- package/dist/_util/throttleByAnimationFrame.d.ts +8 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.umd.js +3453 -317
- package/dist/index.umd.min.js +6 -6
- package/dist/message/hooks/useMessage.d.ts +7 -0
- package/dist/message/index.d.ts +63 -4
- package/dist/notification/demos/basic.d.ts +2 -0
- package/dist/notification/demos/button.d.ts +2 -0
- package/dist/notification/demos/icon.d.ts +2 -0
- package/dist/notification/hooks/useNotification.d.ts +7 -0
- package/dist/notification/index.d.ts +54 -0
- package/dist/notification/style/index.d.ts +1 -0
- package/es/Affix/index.d.ts +54 -0
- package/es/Affix/index.js +326 -0
- package/{lib/Notification → es/Affix}/style/index.css +0 -3
- package/es/{Notification → Affix}/style/index.d.ts +0 -0
- package/es/{Notification → Affix}/style/index.js +0 -0
- package/es/Affix/utils.d.ts +15 -0
- package/es/Affix/utils.js +83 -0
- package/es/Alert/ErrorBoundary.d.ts +22 -0
- package/es/Alert/ErrorBoundary.js +65 -0
- package/es/Alert/index.d.ts +41 -0
- package/es/Alert/index.js +192 -0
- package/es/Alert/style/index.css +531 -0
- package/{lib/Notification → es/Alert}/style/index.d.ts +0 -0
- package/es/Alert/style/index.js +1 -0
- package/es/Button/style/{style.css → index.css} +0 -0
- package/es/Button/style/index.d.ts +1 -1
- package/es/Button/style/index.js +1 -1
- package/es/ButtonTags/style/{style.css → index.css} +0 -0
- package/es/ButtonTags/style/index.js +1 -1
- package/es/CardTable/card/PictureTextColumn.js +8 -6
- package/es/CardTable/card/PictureTextRow.js +1 -1
- package/es/CardTable/fns/index.js +38 -8
- package/es/CardTable/{toolbar → pager}/TablePagination.js +0 -0
- package/es/CardTable/pager/index.js +48 -0
- package/{lib/CardTable/style/style.css → es/CardTable/style/index.css} +2 -2
- package/es/CardTable/style/index.js +1 -1
- package/es/CardTable/table/TableRoot.js +20 -18
- package/es/CardTable/table/TableWrapper.js +4 -0
- package/es/CardTable/toolbar/ToolBarBottom.js +8 -27
- package/es/Checkbox/style/{style.css → index.css} +0 -0
- package/es/Checkbox/style/index.js +1 -1
- package/es/CkFilter/style/{style.css → index.css} +0 -0
- package/es/CkFilter/style/index.js +1 -1
- package/es/CustomerService/style/{style.css → index.css} +0 -0
- package/es/CustomerService/style/index.js +1 -1
- package/es/Descriptions/style/index.css +10 -8
- package/es/EditTable/style/{style.css → index.css} +0 -0
- package/es/EditTable/style/index.js +1 -1
- package/es/EnlargeImg/style/{style.css → index.css} +0 -0
- package/es/EnlargeImg/style/index.js +1 -1
- package/es/Filter/style/{style.css → index.css} +0 -0
- package/es/Filter/style/index.js +1 -1
- package/es/IconFont/index.js +3 -2
- package/es/IconSelect/style/{style.css → index.css} +0 -0
- package/es/IconSelect/style/index.js +1 -1
- package/es/Input/style/{style.css → index.css} +0 -0
- package/es/Input/style/index.js +1 -1
- package/es/LeftTable/style/{style.css → index.css} +0 -0
- package/es/LeftTable/style/index.js +1 -1
- package/es/LmEditTable/style/{style.css → index.css} +0 -0
- package/es/LmEditTable/style/index.d.ts +1 -1
- package/es/LmEditTable/style/index.js +1 -1
- package/es/LmFilter/LmFilter.js +27 -0
- package/es/LmFilter/baseFilter/fuzzySearch.js +53 -0
- package/es/LmFilter/baseFilter/index.js +34 -0
- package/es/LmFilter/clearFilter/index.js +35 -0
- package/es/LmFilter/complexFilter/index.js +17 -0
- package/es/LmFilter/components/CascaderFilter.js +159 -0
- package/es/LmFilter/components/CheckboxFilter.js +197 -0
- package/es/LmFilter/components/DateFilter.js +139 -0
- package/es/LmFilter/components/DropdownFIlter.js +230 -0
- package/es/LmFilter/components/EmptyFilter.js +27 -0
- package/es/LmFilter/components/InputFilter.js +52 -0
- package/es/LmFilter/components/InputSearchClose.js +74 -0
- package/es/LmFilter/components/SelectFilter.js +113 -0
- package/es/LmFilter/components/index.js +140 -0
- package/es/LmFilter/customFilter/index.js +17 -0
- package/es/LmFilter/filterFns/index.js +54 -0
- package/es/LmFilter/hooks/index.js +18 -0
- package/es/LmFilter/hooks/useDelayedFn.js +29 -0
- package/es/LmFilter/icon_placeholder.png +0 -0
- package/es/LmFilter/index.js +16 -0
- package/es/LmFilter/style/index.js +3 -0
- package/es/LmFilter/style/style.css +205 -0
- package/es/LmFilter/utils.js +71 -0
- package/es/LmFilter/wrapper/Filter.js +33 -0
- package/es/LmFilter/wrapper/FilterContainer.js +29 -0
- package/es/LmFilter/wrapper/FilterRoot.js +120 -0
- package/es/LmFilter/wrapper/FilterWrapper.js +25 -0
- package/es/LmTable/style/{style.css → index.css} +0 -0
- package/es/LmTable/style/index.js +1 -1
- package/es/OldModal/style/{style.css → index.css} +0 -0
- package/es/OldModal/style/index.js +1 -1
- package/es/PopTable/style/{style.css → index.css} +0 -0
- package/es/PopTable/style/index.js +1 -1
- package/es/ProTable/style/{style.css → index.css} +0 -0
- package/es/ProTable/style/index.js +1 -1
- package/es/QuickMenu/index.d.ts +14 -0
- package/es/QuickMenu/index.js +169 -0
- package/es/QuickMenu/style/index.css +560 -0
- package/es/QuickMenu/style/index.d.ts +1 -0
- package/es/QuickMenu/style/index.js +1 -0
- package/es/Radio/style/{style.css → index.css} +0 -0
- package/es/Radio/style/index.js +1 -1
- package/es/TableRender/style/{style.css → index.css} +0 -0
- package/es/TableRender/style/index.js +1 -1
- package/es/Tag/index.d.ts +4 -0
- package/es/Tag/index.js +48 -2
- package/es/Tag/style/index.css +4 -1
- package/es/Upload/index.d.ts +5 -1
- package/es/Upload/index.js +7 -2
- package/es/Upload/style/index.css +35 -0
- package/es/UploadOss/style/{style.css → index.css} +0 -0
- package/es/UploadOss/style/index.js +1 -1
- package/es/VirtualList/style/{style.css → index.css} +0 -0
- package/es/VirtualList/style/index.js +1 -1
- package/es/_util/domTarget.d.ts +7 -0
- package/es/_util/domTarget.js +20 -0
- package/es/_util/getDataOrAriaProps.d.ts +1 -0
- package/es/_util/getDataOrAriaProps.js +9 -0
- package/es/_util/reactNode.d.ts +7 -0
- package/es/_util/reactNode.js +10 -0
- package/es/_util/throttleByAnimationFrame.d.ts +8 -0
- package/es/_util/throttleByAnimationFrame.js +58 -0
- package/es/index.d.ts +2 -1
- package/es/index.js +3 -2
- package/es/message/hooks/useMessage.d.ts +7 -0
- package/es/message/hooks/useMessage.js +83 -0
- package/es/message/index.d.ts +63 -4
- package/es/message/index.js +241 -12
- package/es/message/style/index.css +28 -1
- package/es/notification/hooks/useNotification.d.ts +7 -0
- package/es/notification/hooks/useNotification.js +54 -0
- package/es/notification/index.d.ts +54 -0
- package/es/notification/index.js +342 -0
- package/es/notification/style/index.css +546 -0
- package/es/notification/style/index.d.ts +1 -0
- package/es/notification/style/index.js +1 -0
- package/lib/Affix/index.d.ts +54 -0
- package/lib/Affix/index.js +349 -0
- package/{es/Notification → lib/Affix}/style/index.css +0 -3
- package/lib/Affix/style/index.d.ts +1 -0
- package/lib/{Notification → Affix}/style/index.js +0 -0
- package/lib/Affix/utils.d.ts +15 -0
- package/lib/Affix/utils.js +104 -0
- package/lib/Alert/ErrorBoundary.d.ts +22 -0
- package/lib/Alert/ErrorBoundary.js +79 -0
- package/lib/Alert/index.d.ts +41 -0
- package/lib/Alert/index.js +215 -0
- package/lib/Alert/style/index.css +531 -0
- package/lib/Alert/style/index.d.ts +1 -0
- package/lib/Alert/style/index.js +3 -0
- package/lib/Button/style/{style.css → index.css} +0 -0
- package/lib/Button/style/index.d.ts +1 -1
- package/lib/Button/style/index.js +1 -1
- package/lib/ButtonTags/style/{style.css → index.css} +0 -0
- package/lib/ButtonTags/style/index.js +1 -1
- package/lib/CardTable/card/PictureTextColumn.js +8 -6
- package/lib/CardTable/card/PictureTextRow.js +1 -1
- package/lib/CardTable/fns/index.js +38 -8
- package/lib/CardTable/{toolbar → pager}/TablePagination.js +0 -0
- package/lib/CardTable/pager/index.js +48 -0
- package/{es/CardTable/style/style.css → lib/CardTable/style/index.css} +2 -2
- package/lib/CardTable/style/index.js +1 -1
- package/lib/CardTable/table/TableRoot.js +20 -18
- package/lib/CardTable/table/TableWrapper.js +4 -0
- package/lib/CardTable/toolbar/ToolBarBottom.js +8 -27
- package/lib/Checkbox/style/{style.css → index.css} +0 -0
- package/lib/Checkbox/style/index.js +1 -1
- package/lib/CkFilter/style/{style.css → index.css} +0 -0
- package/lib/CkFilter/style/index.js +1 -1
- package/lib/CustomerService/style/{style.css → index.css} +0 -0
- package/lib/CustomerService/style/index.js +1 -1
- package/lib/Descriptions/style/index.css +10 -8
- package/lib/EditTable/style/{style.css → index.css} +0 -0
- package/lib/EditTable/style/index.js +1 -1
- package/lib/EnlargeImg/style/{style.css → index.css} +0 -0
- package/lib/EnlargeImg/style/index.js +1 -1
- package/lib/Filter/style/{style.css → index.css} +0 -0
- package/lib/Filter/style/index.js +1 -1
- package/lib/IconFont/index.js +3 -2
- package/lib/IconSelect/style/{style.css → index.css} +0 -0
- package/lib/IconSelect/style/index.js +1 -1
- package/lib/Input/style/{style.css → index.css} +0 -0
- package/lib/Input/style/index.js +1 -1
- package/lib/LeftTable/style/{style.css → index.css} +0 -0
- package/lib/LeftTable/style/index.js +1 -1
- package/lib/LmEditTable/style/{style.css → index.css} +0 -0
- package/lib/LmEditTable/style/index.d.ts +1 -1
- package/lib/LmEditTable/style/index.js +1 -1
- package/lib/LmFilter/LmFilter.js +27 -0
- package/lib/LmFilter/baseFilter/fuzzySearch.js +53 -0
- package/lib/LmFilter/baseFilter/index.js +34 -0
- package/lib/LmFilter/clearFilter/index.js +35 -0
- package/lib/LmFilter/complexFilter/index.js +17 -0
- package/lib/LmFilter/components/CascaderFilter.js +159 -0
- package/lib/LmFilter/components/CheckboxFilter.js +197 -0
- package/lib/LmFilter/components/DateFilter.js +139 -0
- package/lib/LmFilter/components/DropdownFIlter.js +230 -0
- package/lib/LmFilter/components/EmptyFilter.js +27 -0
- package/lib/LmFilter/components/InputFilter.js +52 -0
- package/lib/LmFilter/components/InputSearchClose.js +74 -0
- package/lib/LmFilter/components/SelectFilter.js +113 -0
- package/lib/LmFilter/components/index.js +140 -0
- package/lib/LmFilter/customFilter/index.js +17 -0
- package/lib/LmFilter/filterFns/index.js +54 -0
- package/lib/LmFilter/hooks/index.js +18 -0
- package/lib/LmFilter/hooks/useDelayedFn.js +29 -0
- package/lib/LmFilter/icon_placeholder.png +0 -0
- package/lib/LmFilter/index.js +16 -0
- package/lib/LmFilter/style/index.js +3 -0
- package/lib/LmFilter/style/style.css +205 -0
- package/lib/LmFilter/utils.js +71 -0
- package/lib/LmFilter/wrapper/Filter.js +33 -0
- package/lib/LmFilter/wrapper/FilterContainer.js +29 -0
- package/lib/LmFilter/wrapper/FilterRoot.js +120 -0
- package/lib/LmFilter/wrapper/FilterWrapper.js +25 -0
- package/lib/LmTable/style/{style.css → index.css} +0 -0
- package/lib/LmTable/style/index.js +1 -1
- package/lib/OldModal/style/{style.css → index.css} +0 -0
- package/lib/OldModal/style/index.js +1 -1
- package/lib/PopTable/style/{style.css → index.css} +0 -0
- package/lib/PopTable/style/index.js +1 -1
- package/lib/ProTable/style/{style.css → index.css} +0 -0
- package/lib/ProTable/style/index.js +1 -1
- package/lib/QuickMenu/index.d.ts +14 -0
- package/lib/QuickMenu/index.js +187 -0
- package/lib/QuickMenu/style/index.css +560 -0
- package/lib/QuickMenu/style/index.d.ts +1 -0
- package/lib/QuickMenu/style/index.js +3 -0
- package/lib/Radio/style/{style.css → index.css} +0 -0
- package/lib/Radio/style/index.js +1 -1
- package/lib/TableRender/style/{style.css → index.css} +0 -0
- package/lib/TableRender/style/index.js +1 -1
- package/lib/Tag/index.d.ts +4 -0
- package/lib/Tag/index.js +48 -1
- package/lib/Tag/style/index.css +4 -1
- package/lib/Upload/index.d.ts +5 -1
- package/lib/Upload/index.js +8 -2
- package/lib/Upload/style/index.css +35 -0
- package/lib/UploadOss/style/{style.css → index.css} +0 -0
- package/lib/UploadOss/style/index.js +1 -1
- package/lib/VirtualList/style/{style.css → index.css} +0 -0
- package/lib/VirtualList/style/index.js +1 -1
- package/lib/_util/domTarget.d.ts +7 -0
- package/lib/_util/domTarget.js +31 -0
- package/lib/_util/getDataOrAriaProps.d.ts +1 -0
- package/lib/_util/getDataOrAriaProps.js +16 -0
- package/lib/_util/reactNode.d.ts +7 -0
- package/lib/_util/reactNode.js +24 -0
- package/lib/_util/throttleByAnimationFrame.d.ts +8 -0
- package/lib/_util/throttleByAnimationFrame.js +72 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +11 -3
- package/lib/message/hooks/useMessage.d.ts +7 -0
- package/lib/message/hooks/useMessage.js +101 -0
- package/lib/message/index.d.ts +63 -4
- package/lib/message/index.js +262 -16
- package/lib/message/style/index.css +28 -1
- package/lib/notification/hooks/useNotification.d.ts +7 -0
- package/lib/notification/hooks/useNotification.js +69 -0
- package/lib/notification/index.d.ts +54 -0
- package/lib/notification/index.js +365 -0
- package/lib/notification/style/index.css +546 -0
- package/lib/notification/style/index.d.ts +1 -0
- package/lib/notification/style/index.js +3 -0
- package/package.json +5 -2
- package/dist/Notification/index.d.ts +0 -7
- package/es/Notification/index.d.ts +0 -7
- package/es/Notification/index.js +0 -10
- package/lib/Notification/index.d.ts +0 -7
- package/lib/Notification/index.js +0 -23
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
require("antd/es/cascader/style");
|
|
13
|
+
|
|
14
|
+
var _cascader = _interopRequireDefault(require("antd/es/cascader"));
|
|
15
|
+
|
|
16
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
|
+
|
|
18
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
+
|
|
20
|
+
var _linkmoreDesign = require("linkmore-design");
|
|
21
|
+
|
|
22
|
+
var _InputSearchClose = _interopRequireDefault(require("./InputSearchClose"));
|
|
23
|
+
|
|
24
|
+
// 重置级联弹框
|
|
25
|
+
var DropdownRender = function DropdownRender(_ref) {
|
|
26
|
+
var dom = _ref.dom,
|
|
27
|
+
instance = _ref.instance,
|
|
28
|
+
item = _ref.item,
|
|
29
|
+
setOptions = _ref.setOptions,
|
|
30
|
+
checkedValues = _ref.checkedValues,
|
|
31
|
+
setCheckedValues = _ref.setCheckedValues;
|
|
32
|
+
var _instance$filterValue = instance.filterValue,
|
|
33
|
+
filterValue = _instance$filterValue === void 0 ? [] : _instance$filterValue,
|
|
34
|
+
setFilterValue = instance.setFilterValue,
|
|
35
|
+
visible = instance.visible,
|
|
36
|
+
setVisible = instance.setVisible;
|
|
37
|
+
var _item$data = item.data,
|
|
38
|
+
filters = _item$data === void 0 ? [] : _item$data;
|
|
39
|
+
var inputRef = (0, _react.useRef)(null);
|
|
40
|
+
|
|
41
|
+
var handleFilter = function handleFilter(val) {
|
|
42
|
+
var serachValues = filters.filter(function (v) {
|
|
43
|
+
return v.label.indexOf(val) > -1;
|
|
44
|
+
});
|
|
45
|
+
setOptions(serachValues);
|
|
46
|
+
}; // 确定
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
var handleSure = function handleSure() {
|
|
50
|
+
setFilterValue(checkedValues);
|
|
51
|
+
setVisible(false);
|
|
52
|
+
}; // 取消
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
var handleReset = function handleReset() {
|
|
56
|
+
setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
(0, _react.useEffect)(function () {
|
|
60
|
+
if (visible) {
|
|
61
|
+
var _inputRef$current2, _inputRef$current2$se;
|
|
62
|
+
|
|
63
|
+
setTimeout(function () {
|
|
64
|
+
var _inputRef$current;
|
|
65
|
+
|
|
66
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus({
|
|
67
|
+
cursor: 'all'
|
|
68
|
+
});
|
|
69
|
+
}, 200);
|
|
70
|
+
setCheckedValues(filterValue);
|
|
71
|
+
(_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : (_inputRef$current2$se = _inputRef$current2.setValue) === null || _inputRef$current2$se === void 0 ? void 0 : _inputRef$current2$se.call(_inputRef$current2, '');
|
|
72
|
+
handleFilter('');
|
|
73
|
+
}
|
|
74
|
+
}, [visible]);
|
|
75
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
76
|
+
className: "filter_dropdown"
|
|
77
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
78
|
+
className: "filter_header"
|
|
79
|
+
}, /*#__PURE__*/_react.default.createElement(_InputSearchClose.default, {
|
|
80
|
+
ref: inputRef,
|
|
81
|
+
onSearch: handleFilter,
|
|
82
|
+
onChange: handleFilter
|
|
83
|
+
})), dom, /*#__PURE__*/_react.default.createElement("div", {
|
|
84
|
+
className: "filter_footer"
|
|
85
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
86
|
+
className: "footer_clear",
|
|
87
|
+
onClick: handleReset
|
|
88
|
+
}, "\u53D6\u6D88"), /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Button, {
|
|
89
|
+
type: "primary",
|
|
90
|
+
size: "small",
|
|
91
|
+
onClick: handleSure
|
|
92
|
+
}, "\u786E\u5B9A")));
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
var CascaderFilter = function CascaderFilter(_ref2) {
|
|
96
|
+
var instance = _ref2.instance,
|
|
97
|
+
itemProps = _ref2.item;
|
|
98
|
+
var _instance$filterValue2 = instance.filterValue,
|
|
99
|
+
filterValue = _instance$filterValue2 === void 0 ? [] : _instance$filterValue2,
|
|
100
|
+
setFilterValue = instance.setFilterValue,
|
|
101
|
+
visible = instance.visible,
|
|
102
|
+
setVisible = instance.setVisible;
|
|
103
|
+
var _itemProps$data = itemProps.data,
|
|
104
|
+
filters = _itemProps$data === void 0 ? [] : _itemProps$data;
|
|
105
|
+
|
|
106
|
+
var _useState = (0, _react.useState)(filters),
|
|
107
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
108
|
+
options = _useState2[0],
|
|
109
|
+
setOptions = _useState2[1];
|
|
110
|
+
|
|
111
|
+
var _useState3 = (0, _react.useState)([]),
|
|
112
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
113
|
+
checkedValues = _useState4[0],
|
|
114
|
+
setCheckedValues = _useState4[1];
|
|
115
|
+
|
|
116
|
+
var checkedKeys = (0, _react.useMemo)(function () {
|
|
117
|
+
return checkedValues.map(function (v) {
|
|
118
|
+
return v.value;
|
|
119
|
+
});
|
|
120
|
+
}, [checkedValues]);
|
|
121
|
+
var defaultValue = (0, _react.useMemo)(function () {
|
|
122
|
+
var flatKeys = function flatKeys(arr) {
|
|
123
|
+
return arr.map(function (v) {
|
|
124
|
+
return v.value;
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
var nKey = filterValue.map(function (v) {
|
|
129
|
+
return Array.isArray(v) ? flatKeys(v) : v.value;
|
|
130
|
+
});
|
|
131
|
+
return nKey;
|
|
132
|
+
}, [filterValue]);
|
|
133
|
+
|
|
134
|
+
var onChange = function onChange(item, selectedOptions) {
|
|
135
|
+
console.log('item', item, '===', selectedOptions);
|
|
136
|
+
setCheckedValues(selectedOptions);
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_cascader.default, {
|
|
140
|
+
multiple: true,
|
|
141
|
+
options: options,
|
|
142
|
+
onChange: onChange,
|
|
143
|
+
defaultValue: defaultValue,
|
|
144
|
+
open: visible,
|
|
145
|
+
dropdownRender: function dropdownRender(dom) {
|
|
146
|
+
return /*#__PURE__*/_react.default.createElement(DropdownRender, {
|
|
147
|
+
dom: dom,
|
|
148
|
+
instance: instance,
|
|
149
|
+
item: itemProps,
|
|
150
|
+
checkedValues: checkedValues,
|
|
151
|
+
setCheckedValues: setCheckedValues,
|
|
152
|
+
setOptions: setOptions
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}, /*#__PURE__*/_react.default.createElement("div", null)));
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
var _default = CascaderFilter;
|
|
159
|
+
exports.default = _default;
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
|
+
|
|
16
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
17
|
+
|
|
18
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
19
|
+
|
|
20
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
+
|
|
22
|
+
var _linkmoreDesign = require("linkmore-design");
|
|
23
|
+
|
|
24
|
+
var _InputSearchClose = _interopRequireDefault(require("./InputSearchClose"));
|
|
25
|
+
|
|
26
|
+
var _EmptyFilter = _interopRequireDefault(require("./EmptyFilter"));
|
|
27
|
+
|
|
28
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
29
|
+
|
|
30
|
+
var _utils = require("../utils");
|
|
31
|
+
|
|
32
|
+
var _hooks = require("../hooks");
|
|
33
|
+
|
|
34
|
+
var _excluded = ["item"];
|
|
35
|
+
var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? _react.useLayoutEffect : _react.useEffect;
|
|
36
|
+
|
|
37
|
+
var CheckboxFilter = function CheckboxFilter(_ref) {
|
|
38
|
+
var instance = _ref.instance,
|
|
39
|
+
itemProps = _ref.item;
|
|
40
|
+
var _instance$filterValue = instance.filterValue,
|
|
41
|
+
filterValue = _instance$filterValue === void 0 ? [] : _instance$filterValue,
|
|
42
|
+
setFilterValue = instance.setFilterValue,
|
|
43
|
+
visible = instance.visible,
|
|
44
|
+
setVisible = instance.setVisible;
|
|
45
|
+
var _itemProps$data = itemProps.data,
|
|
46
|
+
filters = _itemProps$data === void 0 ? [] : _itemProps$data;
|
|
47
|
+
var inputRef = (0, _react.useRef)(); // 选中的数据项: [{}, {}, ...];
|
|
48
|
+
|
|
49
|
+
var _useState = (0, _react.useState)(filterValue),
|
|
50
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
51
|
+
checkedValues = _useState2[0],
|
|
52
|
+
setCheckedValues = _useState2[1]; // 选中的数据的键
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
var checkedKeys = (0, _react.useMemo)(function () {
|
|
56
|
+
return checkedValues.map(function (v) {
|
|
57
|
+
return v.value;
|
|
58
|
+
});
|
|
59
|
+
}, [checkedValues]); // 搜索后的筛选项
|
|
60
|
+
|
|
61
|
+
var _useState3 = (0, _react.useState)(filters),
|
|
62
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
63
|
+
options = _useState4[0],
|
|
64
|
+
setOptions = _useState4[1];
|
|
65
|
+
|
|
66
|
+
var delayedFn = (0, _hooks.useDelayedFn)(); // 是否存在搜索, 当数据大于8时存在搜索
|
|
67
|
+
|
|
68
|
+
var isSearch = (0, _react.useMemo)(function () {
|
|
69
|
+
return filters.length > 8;
|
|
70
|
+
}, [filters.length]); // 是否全选: 选中的数据大于等于筛选后的数据 && 筛选后的数据全部存在于选中的数据中
|
|
71
|
+
|
|
72
|
+
var checkAll = (0, _react.useMemo)(function () {
|
|
73
|
+
var isAll = checkedValues.length >= options.length;
|
|
74
|
+
return isAll && options.every(function (_ref2) {
|
|
75
|
+
var value = _ref2.value;
|
|
76
|
+
return checkedValues.some(function (v) {
|
|
77
|
+
return v.value === value;
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
}, [checkedValues, options]); // 是否半选: 存在选中的数据 && 未全选
|
|
81
|
+
|
|
82
|
+
var indeterminate = (0, _react.useMemo)(function () {
|
|
83
|
+
return checkedValues.length && !checkAll;
|
|
84
|
+
}, [checkedValues.length, checkAll]); // 搜索
|
|
85
|
+
|
|
86
|
+
var handleFilter = function handleFilter() {
|
|
87
|
+
var val = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
88
|
+
var serachValues = filters.filter(function (v) {
|
|
89
|
+
return v.label.indexOf(val) > -1;
|
|
90
|
+
});
|
|
91
|
+
setOptions(serachValues);
|
|
92
|
+
}; // 单选事件
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
var onChange = function onChange(e, item) {
|
|
96
|
+
e.preventDefault();
|
|
97
|
+
var nValue = checkedValues.some(function (_ref3) {
|
|
98
|
+
var value = _ref3.value;
|
|
99
|
+
return value === item.value;
|
|
100
|
+
}) ? checkedValues.filter(function (_ref4) {
|
|
101
|
+
var value = _ref4.value;
|
|
102
|
+
return value !== item.value;
|
|
103
|
+
}) : (0, _utils.uniqueFunc)([].concat((0, _toConsumableArray2.default)(checkedValues), [item]), 'value');
|
|
104
|
+
setCheckedValues(nValue);
|
|
105
|
+
}; // 全选事件
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
var onCheckAllChange = function onCheckAllChange() {
|
|
109
|
+
var nValue = checkAll ? checkedValues.filter(function (_ref5) {
|
|
110
|
+
var value = _ref5.value;
|
|
111
|
+
return !options.some(function (v) {
|
|
112
|
+
return v.value === value;
|
|
113
|
+
});
|
|
114
|
+
}) : (0, _utils.uniqueFunc)([].concat((0, _toConsumableArray2.default)(checkedValues), (0, _toConsumableArray2.default)(options)), 'value');
|
|
115
|
+
setCheckedValues(nValue);
|
|
116
|
+
}; // 取消 不执行查询操作 关闭下拉框
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
var handleCancel = function handleCancel() {
|
|
120
|
+
// 手动触发内容改变(不会触发onChange事件)
|
|
121
|
+
setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
|
|
122
|
+
}; // 确定 执行查询操作
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
var handleSure = function handleSure() {
|
|
126
|
+
setFilterValue(checkedValues);
|
|
127
|
+
}; // 展开下拉时触发: 赋值 && 聚焦 && 重置显示内容
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
useIsomorphicLayoutEffect(function () {
|
|
131
|
+
if (visible) {
|
|
132
|
+
delayedFn(function () {
|
|
133
|
+
var _inputRef$current;
|
|
134
|
+
|
|
135
|
+
return (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus({
|
|
136
|
+
cursor: 'all'
|
|
137
|
+
});
|
|
138
|
+
}); // 若开启了 Dropdown => destroyPopupOnHide=true 无需重置操作 反之需开启
|
|
139
|
+
// setCheckedValues(filterValue);
|
|
140
|
+
// inputRef.current?.setValue?.('');
|
|
141
|
+
// handleFilter('');
|
|
142
|
+
}
|
|
143
|
+
}, [visible]);
|
|
144
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
145
|
+
className: "filter_dropdown"
|
|
146
|
+
}, isSearch && /*#__PURE__*/_react.default.createElement("div", {
|
|
147
|
+
className: "filter_header"
|
|
148
|
+
}, /*#__PURE__*/_react.default.createElement(_InputSearchClose.default, {
|
|
149
|
+
ref: inputRef,
|
|
150
|
+
onSearch: handleFilter,
|
|
151
|
+
onChange: handleFilter
|
|
152
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
153
|
+
className: "filter_header_operate"
|
|
154
|
+
}, /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Checkbox, {
|
|
155
|
+
indeterminate: indeterminate,
|
|
156
|
+
onChange: onCheckAllChange,
|
|
157
|
+
checked: checkAll,
|
|
158
|
+
className: "filter_tip"
|
|
159
|
+
}, "\u5168\u90E8"), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("span", {
|
|
160
|
+
className: "filter_tip"
|
|
161
|
+
}, "\u5DF2\u9009: ", checkedValues.length)))), /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Checkbox.Group, {
|
|
162
|
+
value: checkedKeys,
|
|
163
|
+
className: "filter_body"
|
|
164
|
+
}, /*#__PURE__*/_react.default.createElement(_linkmoreDesign.VirtualList, {
|
|
165
|
+
options: options,
|
|
166
|
+
className: "filter_list"
|
|
167
|
+
}, function (_ref6) {
|
|
168
|
+
var item = _ref6.item,
|
|
169
|
+
resetProps = (0, _objectWithoutProperties2.default)(_ref6, _excluded);
|
|
170
|
+
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, resetProps, {
|
|
171
|
+
className: (0, _classnames.default)('filter_item', {
|
|
172
|
+
checked: checkedValues.some(function (_ref7) {
|
|
173
|
+
var value = _ref7.value;
|
|
174
|
+
return value === item.value;
|
|
175
|
+
})
|
|
176
|
+
}),
|
|
177
|
+
onClick: function onClick(e) {
|
|
178
|
+
return onChange(e, item);
|
|
179
|
+
}
|
|
180
|
+
}), /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Checkbox, {
|
|
181
|
+
value: item.value,
|
|
182
|
+
className: "filter_item-content"
|
|
183
|
+
}, item.label));
|
|
184
|
+
}), !options.length && /*#__PURE__*/_react.default.createElement(_EmptyFilter.default, null)), /*#__PURE__*/_react.default.createElement("div", {
|
|
185
|
+
className: "filter_footer"
|
|
186
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
187
|
+
className: "footer_clear",
|
|
188
|
+
onClick: handleCancel
|
|
189
|
+
}, "\u53D6\u6D88"), /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Button, {
|
|
190
|
+
type: "primary",
|
|
191
|
+
size: "small",
|
|
192
|
+
onClick: handleSure
|
|
193
|
+
}, "\u786E\u5B9A")));
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
var _default = CheckboxFilter;
|
|
197
|
+
exports.default = _default;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
require("antd/es/date-picker/style");
|
|
13
|
+
|
|
14
|
+
var _datePicker = _interopRequireDefault(require("antd/es/date-picker"));
|
|
15
|
+
|
|
16
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
17
|
+
|
|
18
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
+
|
|
20
|
+
var _linkmoreDesign = require("linkmore-design");
|
|
21
|
+
|
|
22
|
+
var _utils = require("../utils");
|
|
23
|
+
|
|
24
|
+
var RangePicker = function RangePicker(_ref) {
|
|
25
|
+
var filterValue = _ref.filterValue,
|
|
26
|
+
setFilterValue = _ref.setFilterValue,
|
|
27
|
+
onChange = _ref.onChange,
|
|
28
|
+
itemProps = _ref.itemProps,
|
|
29
|
+
visible = _ref.visible;
|
|
30
|
+
// 最近的时间段, 值为JSON转换后的字符串
|
|
31
|
+
var ranges = (0, _react.useMemo)(function () {
|
|
32
|
+
return Object.entries((0, _utils.getRanges)()).map(function (item, i) {
|
|
33
|
+
return {
|
|
34
|
+
id: i,
|
|
35
|
+
label: item[0],
|
|
36
|
+
value: JSON.stringify(item[1])
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
}, []); // 选中时间段的触发
|
|
40
|
+
|
|
41
|
+
var handleOnChange = function handleOnChange(dates, dateStrings) {
|
|
42
|
+
onChange(dates, (0, _utils.getIsHas)(dateStrings.filter(function (v) {
|
|
43
|
+
return !!v;
|
|
44
|
+
})) ? dateStrings : null);
|
|
45
|
+
}; // 最近的时间触发事件
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
var handleLastDateOnChange = function handleLastDateOnChange(e) {
|
|
49
|
+
var nValue = JSON.parse(e.target.value);
|
|
50
|
+
setFilterValue(nValue);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
var panelRender = function panelRender(panelNode) {
|
|
54
|
+
var activeValue = JSON.stringify(filterValue);
|
|
55
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
56
|
+
className: "filter_picker_box"
|
|
57
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
58
|
+
className: "filter_picker_main"
|
|
59
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
60
|
+
className: "filter_picker_header"
|
|
61
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
62
|
+
className: "filter_picker_header_tip"
|
|
63
|
+
}, filterValue && "".concat(filterValue[0], " - ").concat(filterValue[1])), /*#__PURE__*/_react.default.createElement("div", {
|
|
64
|
+
className: "filter_picker_header_operate"
|
|
65
|
+
}, /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Radio.Group, {
|
|
66
|
+
value: activeValue,
|
|
67
|
+
onChange: handleLastDateOnChange,
|
|
68
|
+
size: "small"
|
|
69
|
+
}, ranges.map(function (v) {
|
|
70
|
+
return /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Radio.Button, {
|
|
71
|
+
key: v.label,
|
|
72
|
+
value: v.value
|
|
73
|
+
}, v.label);
|
|
74
|
+
})))), panelNode));
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_datePicker.default.RangePicker, (0, _extends2.default)({
|
|
78
|
+
picker: "date",
|
|
79
|
+
separator: /*#__PURE__*/_react.default.createElement(_linkmoreDesign.IconFont, {
|
|
80
|
+
type: "lmweb-swap-right",
|
|
81
|
+
style: {
|
|
82
|
+
color: 'var(--text-color)'
|
|
83
|
+
}
|
|
84
|
+
}),
|
|
85
|
+
placeholder: ['开始日期', '结束日期'],
|
|
86
|
+
style: {
|
|
87
|
+
width: 210
|
|
88
|
+
}
|
|
89
|
+
}, itemProps, {
|
|
90
|
+
onChange: handleOnChange,
|
|
91
|
+
open: visible,
|
|
92
|
+
panelRender: panelRender,
|
|
93
|
+
dropdownClassName: "lm_filter_dropdown_picker",
|
|
94
|
+
bordered: false,
|
|
95
|
+
size: "small",
|
|
96
|
+
inputReadOnly: true
|
|
97
|
+
})));
|
|
98
|
+
}; // 日期范围选择器
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
var DatePickerFilter = function DatePickerFilter(_ref2) {
|
|
102
|
+
var instance = _ref2.instance,
|
|
103
|
+
itemProps = _ref2.item;
|
|
104
|
+
var filterValue = instance.filterValue,
|
|
105
|
+
setFilterValue = instance.setFilterValue,
|
|
106
|
+
visible = instance.visible;
|
|
107
|
+
var _itemProps$props = itemProps.props,
|
|
108
|
+
props = _itemProps$props === void 0 ? {
|
|
109
|
+
picker: 'date'
|
|
110
|
+
} : _itemProps$props; // 选中时间段的触发
|
|
111
|
+
|
|
112
|
+
var onChange = function onChange(dates, dateStrings) {
|
|
113
|
+
setFilterValue((0, _utils.getIsHas)(dateStrings) ? dateStrings : null);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
if (['range', 'rangePicker'].includes(itemProps.dateType || itemProps.datetype)) {
|
|
117
|
+
return /*#__PURE__*/_react.default.createElement(RangePicker, {
|
|
118
|
+
filterValue: filterValue,
|
|
119
|
+
setFilterValue: setFilterValue,
|
|
120
|
+
onChange: onChange,
|
|
121
|
+
itemProps: props,
|
|
122
|
+
visible: visible
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return /*#__PURE__*/_react.default.createElement(_datePicker.default, (0, _extends2.default)({
|
|
127
|
+
placeholder: "\u9009\u62E9\u65F6\u95F4"
|
|
128
|
+
}, props, {
|
|
129
|
+
onChange: onChange,
|
|
130
|
+
open: visible,
|
|
131
|
+
bordered: false,
|
|
132
|
+
size: "small",
|
|
133
|
+
inputReadOnly: true,
|
|
134
|
+
dropdownClassName: "lm_filter_dropdown_picker"
|
|
135
|
+
}));
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
var _default = DatePickerFilter;
|
|
139
|
+
exports.default = _default;
|