linkmore-design 1.0.59 → 1.0.63
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/AutoComplete/demos/basic.d.ts +3 -0
- package/dist/AutoComplete/index.d.ts +30 -0
- package/dist/AutoComplete/style/index.d.ts +1 -0
- package/dist/Avatar/demos/basic.d.ts +2 -0
- package/dist/Avatar/index.d.ts +3 -0
- package/dist/Avatar/style/index.d.ts +1 -0
- package/dist/Breadcrumb/demos/basic.d.ts +2 -0
- package/dist/Breadcrumb/demos/basic1.d.ts +2 -0
- package/dist/Breadcrumb/index.d.ts +4 -0
- package/dist/Breadcrumb/style/index.d.ts +1 -0
- package/dist/CardTable/fns/index.d.ts +1 -0
- package/dist/CardTable/utils.d.ts +1 -1
- package/dist/Col/demos/basic.d.ts +2 -0
- package/dist/Col/index.d.ts +3 -0
- package/dist/Col/style/index.d.ts +1 -0
- package/dist/Form/demos/error-tip.d.ts +2 -0
- package/dist/Form/index.d.ts +7 -2
- package/dist/Grid/RowContext.d.ts +8 -0
- package/dist/Grid/col.d.ts +28 -0
- package/dist/Grid/demos/basic.d.ts +2 -0
- package/dist/Grid/hooks/useBreakpoint.d.ts +3 -0
- package/dist/Grid/index.d.ts +11 -0
- package/dist/Grid/row.d.ts +14 -0
- package/dist/Grid/style/index.d.ts +1 -0
- package/dist/Layout/demos/basic.d.ts +2 -0
- package/dist/Layout/index.d.ts +4 -0
- package/dist/Layout/style/index.d.ts +1 -0
- package/dist/LmEditTable/EditTable.d.ts +2 -0
- package/dist/LmEditTable/demos/colsort.d.ts +2 -0
- package/dist/LmEditTable/demos/sinleEdit.d.ts +2 -0
- package/dist/LmEditTable/demos/size.d.ts +2 -0
- package/dist/LmEditTable/sortableBoxCol.d.ts +5 -0
- package/dist/LmEditTable/sortableItemCol.d.ts +1 -0
- package/dist/LmFilter/components/CustomSelectFilter.d.ts +4 -0
- package/dist/LmFilter/filterFns/index.d.ts +27 -10
- package/dist/LmFilter/localization.d.ts +8 -2
- package/dist/LmFilter/utils.d.ts +2 -0
- package/dist/PageHeader/demos/basic.d.ts +2 -0
- package/dist/PageHeader/index.d.ts +24 -0
- package/dist/PageHeader/style/index.d.ts +1 -0
- package/dist/Popover/demos/basic.d.ts +2 -0
- package/dist/Popover/demos/basic1.d.ts +2 -0
- package/dist/Popover/index.d.ts +11 -0
- package/dist/Popover/style/index.d.ts +1 -0
- package/dist/Row/demos/basic.d.ts +2 -0
- package/dist/Row/index.d.ts +3 -0
- package/dist/Row/style/index.d.ts +1 -0
- package/dist/Tooltip/index.d.ts +43 -1
- package/dist/Typography/Base/Ellipsis.d.ts +14 -0
- package/dist/Typography/Base/EllipsisTooltip.d.ts +13 -0
- package/dist/Typography/Base/index.d.ts +54 -0
- package/dist/Typography/Editable.d.ts +20 -0
- package/dist/Typography/Link.d.ts +7 -0
- package/dist/Typography/Paragraph.d.ts +7 -0
- package/dist/Typography/Text.d.ts +8 -0
- package/dist/Typography/Title.d.ts +9 -0
- package/dist/Typography/Typography.d.ts +11 -0
- package/dist/Typography/demos/basic.d.ts +2 -0
- package/dist/Typography/hooks/useMergedConfig.d.ts +1 -0
- package/dist/Typography/hooks/useUpdatedEffect.d.ts +3 -0
- package/dist/Typography/index.d.ts +15 -0
- package/dist/Typography/style/index.d.ts +1 -0
- package/dist/_util/colors.d.ts +5 -0
- package/dist/_util/getRenderPropValue.d.ts +3 -0
- package/dist/_util/hooks/useFlexGapSupport.d.ts +2 -0
- package/dist/_util/hooks/useForceUpdate.d.ts +2 -0
- package/dist/_util/placements.d.ts +16 -0
- package/dist/_util/responsiveObserve.d.ts +21 -0
- package/dist/_util/styleChecker.d.ts +4 -0
- package/dist/_util/transButton.d.ts +9 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.umd.js +17392 -8920
- package/dist/index.umd.min.js +6 -6
- package/es/AutoComplete/index.d.ts +30 -0
- package/es/AutoComplete/index.js +101 -0
- package/es/AutoComplete/style/index.css +505 -0
- package/es/AutoComplete/style/index.d.ts +1 -0
- package/es/AutoComplete/style/index.js +1 -0
- package/es/Avatar/index.d.ts +3 -0
- package/es/Avatar/index.js +3 -0
- package/es/Avatar/style/index.css +505 -0
- package/es/Avatar/style/index.d.ts +1 -0
- package/es/Avatar/style/index.js +1 -0
- package/es/Breadcrumb/index.d.ts +4 -0
- package/es/Breadcrumb/index.js +3 -0
- package/es/Breadcrumb/style/index.css +505 -0
- package/es/Breadcrumb/style/index.d.ts +1 -0
- package/es/Breadcrumb/style/index.js +1 -0
- package/es/CardTable/body/TableBodyCell.js +10 -5
- package/es/CardTable/fns/index.js +29 -2
- package/es/CardTable/table/TableRoot.js +46 -13
- package/es/Col/README.md.old +22 -0
- package/es/Col/index.d.ts +3 -0
- package/es/Col/index.js +2 -0
- package/es/Col/style/index.css +505 -0
- package/es/Col/style/index.d.ts +1 -0
- package/es/Col/style/index.js +1 -0
- package/es/Dropdown/index.js +2 -2
- package/es/Dropdown/style/index.css +19 -1
- package/es/Form/index.d.ts +7 -2
- package/es/Form/index.js +18 -2
- package/es/Form/style/index.css +86 -1
- package/es/Grid/RowContext.d.ts +8 -0
- package/es/Grid/RowContext.js +3 -0
- package/es/Grid/col.d.ts +28 -0
- package/es/Grid/col.js +112 -0
- package/es/Grid/hooks/useBreakpoint.d.ts +3 -0
- package/es/Grid/hooks/useBreakpoint.js +24 -0
- package/es/Grid/index.d.ts +11 -0
- package/es/Grid/index.js +14 -0
- package/es/Grid/row.d.ts +14 -0
- package/es/Grid/row.js +142 -0
- package/es/Grid/style/index.css +505 -0
- package/es/Grid/style/index.d.ts +1 -0
- package/es/Grid/style/index.js +1 -0
- package/es/IconFont/index.js +1 -1
- package/es/Layout/index.d.ts +4 -0
- package/es/Layout/index.js +3 -0
- package/es/Layout/style/index.css +505 -0
- package/es/Layout/style/index.d.ts +1 -0
- package/es/Layout/style/index.js +1 -0
- package/es/LmEditTable/EditTable.d.ts +2 -0
- package/es/LmEditTable/EditTable.js +206 -58
- package/es/LmEditTable/sortableBoxCol.d.ts +5 -0
- package/es/LmEditTable/sortableBoxCol.js +13 -0
- package/es/LmEditTable/sortableItemCol.d.ts +1 -0
- package/es/LmEditTable/sortableItemCol.js +48 -0
- package/es/LmFilter/LmFilter.js +22 -4
- package/es/LmFilter/{icon_placeholder.png → assets/empty.png} +0 -0
- package/es/LmFilter/baseFilter/fuzzySearch.js +6 -1
- package/es/LmFilter/baseFilter/index.js +1 -3
- package/es/LmFilter/clearFilter/index.js +3 -5
- package/es/LmFilter/complexFilter/drawer.js +32 -20
- package/es/LmFilter/components/CheckboxFilter.js +1 -1
- package/es/LmFilter/components/CustomSelectFilter.js +128 -0
- package/es/LmFilter/components/EmptyFilter.js +2 -2
- package/es/LmFilter/components/SelectFilter.js +1 -1
- package/es/LmFilter/components/index.js +1 -1
- package/es/LmFilter/customFilter/index.js +75 -2
- package/es/LmFilter/filterFns/index.js +290 -62
- package/es/LmFilter/localization.d.ts +8 -2
- package/es/LmFilter/localization.js +20 -2
- package/es/LmFilter/style/style.css +50 -8
- package/es/LmFilter/utils.js +34 -0
- package/es/LmFilter/wrapper/Filter.js +4 -0
- package/es/LmFilter/wrapper/FilterContainer.js +0 -4
- package/es/LmFilter/wrapper/FilterRoot.js +28 -63
- package/es/LmTable/Table.js +9 -3
- package/es/LmTable/style/index.css +5 -0
- package/es/PageHeader/index.d.ts +24 -0
- package/es/PageHeader/index.js +169 -0
- package/es/PageHeader/style/index.css +505 -0
- package/es/PageHeader/style/index.d.ts +1 -0
- package/es/PageHeader/style/index.js +1 -0
- package/es/Popover/index.d.ts +11 -0
- package/es/Popover/index.js +63 -0
- package/es/Popover/style/index.css +505 -0
- package/es/Popover/style/index.d.ts +1 -0
- package/es/Popover/style/index.js +1 -0
- package/es/Row/README.md.old +22 -0
- package/es/Row/index.d.ts +3 -0
- package/es/Row/index.js +2 -0
- package/es/Row/style/index.css +505 -0
- package/es/Row/style/index.d.ts +1 -0
- package/es/Row/style/index.js +1 -0
- package/es/Tooltip/index.d.ts +43 -1
- package/es/Tooltip/index.js +236 -1
- package/es/Typography/Base/Ellipsis.d.ts +14 -0
- package/es/Typography/Base/Ellipsis.js +197 -0
- package/es/Typography/Base/EllipsisTooltip.d.ts +13 -0
- package/es/Typography/Base/EllipsisTooltip.js +23 -0
- package/es/Typography/Base/index.d.ts +54 -0
- package/es/Typography/Base/index.js +509 -0
- package/es/Typography/Editable.d.ts +20 -0
- package/es/Typography/Editable.js +117 -0
- package/es/Typography/Link.d.ts +7 -0
- package/es/Typography/Link.js +43 -0
- package/es/Typography/Paragraph.d.ts +7 -0
- package/es/Typography/Paragraph.js +12 -0
- package/es/Typography/Text.d.ts +8 -0
- package/es/Typography/Text.js +41 -0
- package/es/Typography/Title.d.ts +9 -0
- package/es/Typography/Title.js +41 -0
- package/es/Typography/Typography.d.ts +11 -0
- package/es/Typography/Typography.js +61 -0
- package/es/Typography/hooks/useMergedConfig.d.ts +1 -0
- package/es/Typography/hooks/useMergedConfig.js +8 -0
- package/es/Typography/hooks/useUpdatedEffect.d.ts +3 -0
- package/es/Typography/hooks/useUpdatedEffect.js +13 -0
- package/es/Typography/index.d.ts +15 -0
- package/es/Typography/index.js +14 -0
- package/es/Typography/style/index.css +505 -0
- package/es/Typography/style/index.d.ts +1 -0
- package/es/Typography/style/index.js +1 -0
- package/es/_util/colors.d.ts +5 -0
- package/es/_util/colors.js +4 -0
- package/es/_util/getRenderPropValue.d.ts +3 -0
- package/es/_util/getRenderPropValue.js +13 -0
- package/es/_util/hooks/useFlexGapSupport.d.ts +2 -0
- package/es/_util/hooks/useFlexGapSupport.js +14 -0
- package/es/_util/hooks/useForceUpdate.d.ts +2 -0
- package/es/_util/hooks/useForceUpdate.js +11 -0
- package/es/_util/placements.d.ts +16 -0
- package/es/_util/placements.js +87 -0
- package/es/_util/responsiveObserve.d.ts +21 -0
- package/es/_util/responsiveObserve.js +66 -0
- package/es/_util/styleChecker.d.ts +4 -0
- package/es/_util/styleChecker.js +31 -0
- package/es/_util/transButton.d.ts +9 -0
- package/es/_util/transButton.js +73 -0
- package/es/index.d.ts +14 -0
- package/es/index.js +8 -1
- package/lib/AutoComplete/index.d.ts +30 -0
- package/lib/AutoComplete/index.js +125 -0
- package/lib/AutoComplete/style/index.css +505 -0
- package/lib/AutoComplete/style/index.d.ts +1 -0
- package/lib/AutoComplete/style/index.js +3 -0
- package/lib/Avatar/index.d.ts +3 -0
- package/lib/Avatar/index.js +15 -0
- package/lib/Avatar/style/index.css +505 -0
- package/lib/Avatar/style/index.d.ts +1 -0
- package/lib/Avatar/style/index.js +3 -0
- package/lib/Breadcrumb/index.d.ts +4 -0
- package/lib/Breadcrumb/index.js +15 -0
- package/lib/Breadcrumb/style/index.css +505 -0
- package/lib/Breadcrumb/style/index.d.ts +1 -0
- package/lib/Breadcrumb/style/index.js +3 -0
- package/lib/CardTable/body/TableBodyCell.js +10 -5
- package/lib/CardTable/fns/index.js +29 -2
- package/lib/CardTable/table/TableRoot.js +46 -13
- package/lib/Col/README.md.old +22 -0
- package/lib/Col/index.d.ts +3 -0
- package/lib/Col/index.js +11 -0
- package/lib/Col/style/index.css +505 -0
- package/lib/Col/style/index.d.ts +1 -0
- package/lib/Col/style/index.js +3 -0
- package/lib/Dropdown/index.js +2 -2
- package/lib/Dropdown/style/index.css +19 -1
- package/lib/Form/index.d.ts +7 -2
- package/lib/Form/index.js +16 -1
- package/lib/Form/style/index.css +86 -1
- package/lib/Grid/RowContext.d.ts +8 -0
- package/lib/Grid/RowContext.js +12 -0
- package/lib/Grid/col.d.ts +28 -0
- package/lib/Grid/col.js +128 -0
- package/lib/Grid/hooks/useBreakpoint.d.ts +3 -0
- package/lib/Grid/hooks/useBreakpoint.js +37 -0
- package/lib/Grid/index.d.ts +11 -0
- package/lib/Grid/index.js +45 -0
- package/lib/Grid/row.d.ts +14 -0
- package/lib/Grid/row.js +164 -0
- package/lib/Grid/style/index.css +505 -0
- package/lib/Grid/style/index.d.ts +1 -0
- package/lib/Grid/style/index.js +3 -0
- package/lib/IconFont/index.js +1 -1
- package/lib/Layout/index.d.ts +4 -0
- package/lib/Layout/index.js +15 -0
- package/lib/Layout/style/index.css +505 -0
- package/lib/Layout/style/index.d.ts +1 -0
- package/lib/Layout/style/index.js +3 -0
- package/lib/LmEditTable/EditTable.d.ts +2 -0
- package/lib/LmEditTable/EditTable.js +207 -59
- package/lib/LmEditTable/sortableBoxCol.d.ts +5 -0
- package/lib/LmEditTable/sortableBoxCol.js +24 -0
- package/lib/LmEditTable/sortableItemCol.d.ts +1 -0
- package/lib/LmEditTable/sortableItemCol.js +61 -0
- package/lib/LmFilter/LmFilter.js +22 -4
- package/lib/LmFilter/{icon_placeholder.png → assets/empty.png} +0 -0
- package/lib/LmFilter/baseFilter/fuzzySearch.js +6 -1
- package/lib/LmFilter/baseFilter/index.js +1 -3
- package/lib/LmFilter/clearFilter/index.js +3 -5
- package/lib/LmFilter/complexFilter/drawer.js +32 -20
- package/lib/LmFilter/components/CheckboxFilter.js +1 -1
- package/lib/LmFilter/components/CustomSelectFilter.js +128 -0
- package/lib/LmFilter/components/EmptyFilter.js +2 -2
- package/lib/LmFilter/components/SelectFilter.js +1 -1
- package/lib/LmFilter/components/index.js +1 -1
- package/lib/LmFilter/customFilter/index.js +75 -2
- package/lib/LmFilter/filterFns/index.js +290 -62
- package/lib/LmFilter/localization.d.ts +8 -2
- package/lib/LmFilter/localization.js +20 -2
- package/lib/LmFilter/style/style.css +50 -8
- package/lib/LmFilter/utils.js +34 -0
- package/lib/LmFilter/wrapper/Filter.js +4 -0
- package/lib/LmFilter/wrapper/FilterContainer.js +0 -4
- package/lib/LmFilter/wrapper/FilterRoot.js +28 -63
- package/lib/LmTable/Table.js +9 -3
- package/lib/LmTable/style/index.css +5 -0
- package/lib/PageHeader/index.d.ts +24 -0
- package/lib/PageHeader/index.js +194 -0
- package/lib/PageHeader/style/index.css +505 -0
- package/lib/PageHeader/style/index.d.ts +1 -0
- package/lib/PageHeader/style/index.js +3 -0
- package/lib/Popover/index.d.ts +11 -0
- package/lib/Popover/index.js +81 -0
- package/lib/Popover/style/index.css +505 -0
- package/lib/Popover/style/index.d.ts +1 -0
- package/lib/Popover/style/index.js +3 -0
- package/lib/Row/README.md.old +22 -0
- package/lib/Row/index.d.ts +3 -0
- package/lib/Row/index.js +11 -0
- package/lib/Row/style/index.css +505 -0
- package/lib/Row/style/index.d.ts +1 -0
- package/lib/Row/style/index.js +3 -0
- package/lib/Tooltip/index.d.ts +43 -1
- package/lib/Tooltip/index.js +247 -1
- package/lib/Typography/Base/Ellipsis.d.ts +14 -0
- package/lib/Typography/Base/Ellipsis.js +212 -0
- package/lib/Typography/Base/EllipsisTooltip.d.ts +13 -0
- package/lib/Typography/Base/EllipsisTooltip.js +36 -0
- package/lib/Typography/Base/index.d.ts +54 -0
- package/lib/Typography/Base/index.js +545 -0
- package/lib/Typography/Editable.d.ts +20 -0
- package/lib/Typography/Editable.js +137 -0
- package/lib/Typography/Link.d.ts +7 -0
- package/lib/Typography/Link.js +58 -0
- package/lib/Typography/Paragraph.d.ts +7 -0
- package/lib/Typography/Paragraph.js +26 -0
- package/lib/Typography/Text.d.ts +8 -0
- package/lib/Typography/Text.js +57 -0
- package/lib/Typography/Title.d.ts +9 -0
- package/lib/Typography/Title.js +58 -0
- package/lib/Typography/Typography.d.ts +11 -0
- package/lib/Typography/Typography.js +77 -0
- package/lib/Typography/hooks/useMergedConfig.d.ts +1 -0
- package/lib/Typography/hooks/useMergedConfig.js +21 -0
- package/lib/Typography/hooks/useUpdatedEffect.d.ts +3 -0
- package/lib/Typography/hooks/useUpdatedEffect.js +24 -0
- package/lib/Typography/index.d.ts +15 -0
- package/lib/Typography/index.js +31 -0
- package/lib/Typography/style/index.css +505 -0
- package/lib/Typography/style/index.d.ts +1 -0
- package/lib/Typography/style/index.js +3 -0
- package/lib/_util/colors.d.ts +5 -0
- package/lib/_util/colors.js +14 -0
- package/lib/_util/getRenderPropValue.d.ts +3 -0
- package/lib/_util/getRenderPropValue.js +22 -0
- package/lib/_util/hooks/useFlexGapSupport.d.ts +2 -0
- package/lib/_util/hooks/useFlexGapSupport.js +30 -0
- package/lib/_util/hooks/useForceUpdate.d.ts +2 -0
- package/lib/_util/hooks/useForceUpdate.js +24 -0
- package/lib/_util/placements.d.ts +16 -0
- package/lib/_util/placements.js +98 -0
- package/lib/_util/responsiveObserve.d.ts +21 -0
- package/lib/_util/responsiveObserve.js +79 -0
- package/lib/_util/styleChecker.d.ts +4 -0
- package/lib/_util/styleChecker.js +52 -0
- package/lib/_util/transButton.d.ts +9 -0
- package/lib/_util/transButton.js +87 -0
- package/lib/index.d.ts +14 -0
- package/lib/index.js +57 -1
- package/package.json +3 -3
|
@@ -1,102 +1,323 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
|
|
3
5
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
6
|
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
|
-
exports.default = void 0;
|
|
10
|
+
exports.initLocalization = exports.default = void 0;
|
|
9
11
|
|
|
10
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
11
13
|
|
|
12
|
-
var
|
|
14
|
+
var _objectSpread4 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
15
|
+
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
17
|
|
|
14
18
|
var _utils = require("../utils");
|
|
15
19
|
|
|
16
|
-
//
|
|
17
|
-
var
|
|
20
|
+
// 初始化查询结构
|
|
21
|
+
var initLocalization = function initLocalization(props) {
|
|
22
|
+
var _filterQuery$filters, _filterQuery$filters$;
|
|
23
|
+
|
|
24
|
+
var localization = props.localization,
|
|
25
|
+
dataSource = props.dataSource,
|
|
26
|
+
searchKey = props.searchKey;
|
|
27
|
+
var globalQuery = localization.globalQuery,
|
|
28
|
+
filterQuery = localization.filterQuery;
|
|
29
|
+
var basicFilter = (localization === null || localization === void 0 ? void 0 : localization.basicFilter) || {};
|
|
30
|
+
var basicQuery = {}; // 存储查询结构
|
|
31
|
+
|
|
32
|
+
if ((0, _utils.getIsHas)(basicFilter)) {
|
|
33
|
+
var _Object$keys;
|
|
34
|
+
|
|
35
|
+
basicQuery = (_Object$keys = Object.keys(basicFilter)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.reduce(function (pre, cur) {
|
|
36
|
+
var item = dataSource.find(function (v) {
|
|
37
|
+
if (cur === v.field) {
|
|
38
|
+
return v.show || typeof v.show !== 'boolean';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return false;
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
if (cur === searchKey) {
|
|
45
|
+
item = {
|
|
46
|
+
field: searchKey,
|
|
47
|
+
operator: 'contains',
|
|
48
|
+
fieldType: 'string'
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if ((0, _utils.getIsHas)(basicFilter[cur]) && !!item) {
|
|
53
|
+
var _item, _item2;
|
|
54
|
+
|
|
55
|
+
pre[cur] = {
|
|
56
|
+
fieldName: cur,
|
|
57
|
+
fieldType: ((_item = item) === null || _item === void 0 ? void 0 : _item.valueType) || 'string',
|
|
58
|
+
value: Array.isArray(basicFilter[cur]) ? basicFilter[cur] : [basicFilter[cur]],
|
|
59
|
+
operator: ((_item2 = item) === null || _item2 === void 0 ? void 0 : _item2.operator) || 'equal'
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return pre;
|
|
64
|
+
}, {});
|
|
65
|
+
} else if (filterQuery === null || filterQuery === void 0 ? void 0 : (_filterQuery$filters = filterQuery.filters) === null || _filterQuery$filters === void 0 ? void 0 : (_filterQuery$filters$ = _filterQuery$filters[0]) === null || _filterQuery$filters$ === void 0 ? void 0 : _filterQuery$filters$.conditions) {
|
|
66
|
+
var _filterQuery$filters2, _filterQuery$filters3;
|
|
67
|
+
|
|
68
|
+
var filterQueryArr = (filterQuery === null || filterQuery === void 0 ? void 0 : (_filterQuery$filters2 = filterQuery.filters) === null || _filterQuery$filters2 === void 0 ? void 0 : (_filterQuery$filters3 = _filterQuery$filters2[0]) === null || _filterQuery$filters3 === void 0 ? void 0 : _filterQuery$filters3.conditions) || []; // 初始化基础查询缓存
|
|
69
|
+
|
|
70
|
+
basicFilter = filterQueryArr.reduce(function (pre, cur) {
|
|
71
|
+
var checkedValue = cur.value; // 选中的数据
|
|
72
|
+
// 是否搜索框
|
|
73
|
+
|
|
74
|
+
var isSearchInput = cur.fieldName === searchKey; // 查找该数据是否展示
|
|
75
|
+
|
|
76
|
+
var someData = dataSource.some(function (v) {
|
|
77
|
+
if (cur.fieldName === v.field) {
|
|
78
|
+
return v.show || typeof v.show !== 'boolean';
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return false;
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
if ((0, _utils.getIsHas)(checkedValue) && someData || isSearchInput) {
|
|
85
|
+
basicQuery[cur.fieldName] = cur; // 复选/级联/日期区间
|
|
86
|
+
|
|
87
|
+
if (!['checkbox', 'cascader'].includes(cur.type) && checkedValue.length < 2) {
|
|
88
|
+
checkedValue = checkedValue[0];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
pre[cur.fieldName] = checkedValue;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return pre;
|
|
95
|
+
}, {});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return {
|
|
99
|
+
basicFilter: basicFilter,
|
|
100
|
+
basicQuery: basicQuery
|
|
101
|
+
};
|
|
102
|
+
}; // 核心参数集合
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
exports.initLocalization = initLocalization;
|
|
106
|
+
|
|
107
|
+
var useCoreOptions = function useCoreOptions(_ref) {
|
|
18
108
|
var state = _ref.state,
|
|
19
109
|
dispatch = _ref.dispatch,
|
|
20
110
|
props = _ref.props;
|
|
21
111
|
var onChange = props.onChange,
|
|
22
|
-
dataSource = props.dataSource
|
|
112
|
+
dataSource = props.dataSource,
|
|
113
|
+
searchKey = props.searchKey; // 触发查询 type basic基础筛选 | complex高级筛选
|
|
23
114
|
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
115
|
+
var onQuery = (0, _react.useCallback)(function () {
|
|
116
|
+
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
117
|
+
_ref2$basicFilter = _ref2.basicFilter,
|
|
118
|
+
basicFilter = _ref2$basicFilter === void 0 ? {} : _ref2$basicFilter,
|
|
119
|
+
_ref2$complexFilter = _ref2.complexFilter,
|
|
120
|
+
complexFilter = _ref2$complexFilter === void 0 ? {} : _ref2$complexFilter,
|
|
121
|
+
_ref2$basicQuery = _ref2.basicQuery,
|
|
122
|
+
basicQuery = _ref2$basicQuery === void 0 ? {} : _ref2$basicQuery,
|
|
123
|
+
_ref2$type = _ref2.type,
|
|
124
|
+
type = _ref2$type === void 0 ? 'basic' : _ref2$type;
|
|
30
125
|
|
|
126
|
+
if (type === 'basic') {
|
|
127
|
+
var _Object$keys2;
|
|
31
128
|
|
|
32
|
-
|
|
33
|
-
|
|
129
|
+
dispatch({
|
|
130
|
+
type: 'changeBasicFilter',
|
|
131
|
+
basicFilter: basicFilter
|
|
132
|
+
});
|
|
133
|
+
dispatch({
|
|
134
|
+
type: 'changeBasicQuery',
|
|
135
|
+
basicQuery: basicQuery
|
|
136
|
+
});
|
|
137
|
+
dispatch({
|
|
138
|
+
type: 'changeComplexFilter',
|
|
139
|
+
complexFilter: {}
|
|
140
|
+
}); // 基础筛选清空高级筛选
|
|
141
|
+
// 抛出给外部查询
|
|
142
|
+
|
|
143
|
+
var filterQuery = {
|
|
144
|
+
filters: [{
|
|
145
|
+
conditions: (_Object$keys2 = Object.keys(basicQuery)) === null || _Object$keys2 === void 0 ? void 0 : _Object$keys2.map(function (k) {
|
|
146
|
+
return basicQuery[k];
|
|
147
|
+
})
|
|
148
|
+
}]
|
|
149
|
+
};
|
|
150
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
151
|
+
basicFilter: basicFilter,
|
|
152
|
+
filterQuery: filterQuery,
|
|
153
|
+
type: 'basic'
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (type === 'complex') {
|
|
158
|
+
var _Object$keys3, _Object$keys4;
|
|
34
159
|
|
|
35
|
-
|
|
160
|
+
var _basicQuery = (_Object$keys3 = Object.keys(complexFilter)) === null || _Object$keys3 === void 0 ? void 0 : _Object$keys3.reduce(function (pre, cur) {
|
|
161
|
+
var item = dataSource.find(function (v) {
|
|
162
|
+
return cur === v.field;
|
|
163
|
+
});
|
|
164
|
+
var itemValue = complexFilter[cur].value;
|
|
165
|
+
|
|
166
|
+
if ((0, _utils.getIsHas)(itemValue) && !!item) {
|
|
167
|
+
pre[cur] = {
|
|
168
|
+
fieldName: cur,
|
|
169
|
+
fieldType: (item === null || item === void 0 ? void 0 : item.valueType) || 'string',
|
|
170
|
+
type: item.type,
|
|
171
|
+
value: Array.isArray(itemValue) ? itemValue : [itemValue],
|
|
172
|
+
operator: complexFilter[cur].mode === 'and' ? 'equal' : 'contains'
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return pre;
|
|
177
|
+
}, {});
|
|
36
178
|
|
|
37
|
-
|
|
38
|
-
|
|
179
|
+
dispatch({
|
|
180
|
+
type: 'changeBasicFilter',
|
|
181
|
+
basicFilter: {}
|
|
182
|
+
});
|
|
183
|
+
dispatch({
|
|
184
|
+
type: 'changeComplexFilter',
|
|
185
|
+
complexFilter: complexFilter
|
|
186
|
+
});
|
|
187
|
+
dispatch({
|
|
188
|
+
type: 'changeComplexDrawer',
|
|
189
|
+
complexDrawer: {
|
|
190
|
+
data: {},
|
|
191
|
+
visible: false
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
dispatch({
|
|
195
|
+
type: 'changeBasicQuery',
|
|
196
|
+
basicQuery: _basicQuery
|
|
197
|
+
});
|
|
198
|
+
var _filterQuery = {
|
|
199
|
+
filters: [{
|
|
200
|
+
conditions: (_Object$keys4 = Object.keys(_basicQuery)) === null || _Object$keys4 === void 0 ? void 0 : _Object$keys4.map(function (k) {
|
|
201
|
+
return _basicQuery[k];
|
|
202
|
+
})
|
|
203
|
+
}]
|
|
204
|
+
};
|
|
205
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
206
|
+
complexFilter: complexFilter,
|
|
207
|
+
filterQuery: _filterQuery,
|
|
208
|
+
type: type
|
|
209
|
+
});
|
|
39
210
|
}
|
|
211
|
+
}, []); // 清除事件
|
|
212
|
+
|
|
213
|
+
var onClearChange = (0, _react.useCallback)(function () {
|
|
214
|
+
var _props$onClearChange;
|
|
40
215
|
|
|
41
|
-
|
|
216
|
+
var params = {
|
|
217
|
+
basicFilter: {},
|
|
218
|
+
complexFilter: {},
|
|
219
|
+
basicQuery: {},
|
|
220
|
+
type: 'basic'
|
|
221
|
+
};
|
|
222
|
+
(_props$onClearChange = props.onClearChange) === null || _props$onClearChange === void 0 ? void 0 : _props$onClearChange.call(props, params);
|
|
223
|
+
onQuery(params);
|
|
224
|
+
}, [onQuery]); // 根据字段查找过滤的数据, 不存在时返回默认值
|
|
225
|
+
|
|
226
|
+
var getFilterValue = (0, _react.useCallback)(function (_ref3) {
|
|
227
|
+
var field = _ref3.field,
|
|
228
|
+
type = _ref3.type;
|
|
229
|
+
var defaultValue = (0, _utils.getValueForType)(type);
|
|
230
|
+
return state.basicFilter[field] || defaultValue;
|
|
231
|
+
}, [state.basicFilter]); // 获取查询结构
|
|
232
|
+
|
|
233
|
+
var getFilterQuery = (0, _react.useCallback)(function () {
|
|
234
|
+
var _Object$keys5;
|
|
235
|
+
|
|
236
|
+
var originData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : dataSource;
|
|
237
|
+
var basicFilter = (0, _utils.getFilterShow)(state.basicFilter, originData);
|
|
238
|
+
var basicQuery = (0, _utils.getFilterShow)(state.basicQuery, originData);
|
|
42
239
|
dispatch({
|
|
43
240
|
type: 'changeBasicFilter',
|
|
44
241
|
basicFilter: basicFilter
|
|
45
242
|
});
|
|
46
243
|
dispatch({
|
|
47
|
-
type: '
|
|
48
|
-
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}); // 触发外部事件
|
|
59
|
-
|
|
60
|
-
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
244
|
+
type: 'changeBasicQuery',
|
|
245
|
+
basicQuery: basicQuery
|
|
246
|
+
});
|
|
247
|
+
var filterQuery = {
|
|
248
|
+
filters: [{
|
|
249
|
+
conditions: (_Object$keys5 = Object.keys(basicQuery)) === null || _Object$keys5 === void 0 ? void 0 : _Object$keys5.map(function (k) {
|
|
250
|
+
return basicQuery[k];
|
|
251
|
+
})
|
|
252
|
+
}]
|
|
253
|
+
};
|
|
254
|
+
return {
|
|
61
255
|
basicFilter: basicFilter,
|
|
62
256
|
filterQuery: filterQuery,
|
|
63
257
|
type: 'basic'
|
|
64
|
-
}
|
|
65
|
-
}; //
|
|
258
|
+
};
|
|
259
|
+
}, [state, dataSource]); // 设置筛选的值 itemValue => String || Array => ['', '', ...]
|
|
66
260
|
|
|
261
|
+
var setFilterValue = (0, _react.useCallback)(function (itemValue, item) {
|
|
262
|
+
var field = item.field;
|
|
67
263
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
filterQuery = localization.filterQuery;
|
|
72
|
-
|
|
73
|
-
if (filterQuery === null || filterQuery === void 0 ? void 0 : filterQuery.filter) {
|
|
74
|
-
// 初始化基础查询缓存
|
|
75
|
-
var basicFilter = filterQuery === null || filterQuery === void 0 ? void 0 : filterQuery.filter.reduce(function (pre, cur) {
|
|
76
|
-
// 查找改数据是否展示
|
|
77
|
-
var someData = dataSource.some(function (v) {
|
|
78
|
-
if (cur.fieldName === v.field) {
|
|
79
|
-
var isHidden = !v.show && typeof v.show === 'boolean';
|
|
80
|
-
return !isHidden;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return false;
|
|
84
|
-
});
|
|
264
|
+
if (field) {
|
|
265
|
+
// 基础查询数据(受控数据)
|
|
266
|
+
var basicFilter = (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.basicFilter), {}, (0, _defineProperty2.default)({}, field, itemValue)); // 外部查询数据结构
|
|
85
267
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
268
|
+
var basicQuery = (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.basicQuery), {}, (0, _defineProperty2.default)({}, field, {
|
|
269
|
+
fieldName: field,
|
|
270
|
+
fieldType: item.valueType || 'string',
|
|
271
|
+
type: item.type,
|
|
272
|
+
value: Array.isArray(itemValue) ? itemValue : [itemValue],
|
|
273
|
+
operator: item.operator || 'equal'
|
|
274
|
+
}));
|
|
89
275
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
276
|
+
if (!(0, _utils.getIsHas)(itemValue)) {
|
|
277
|
+
delete basicFilter[field];
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
; // 触发外部事件
|
|
281
|
+
|
|
282
|
+
onQuery === null || onQuery === void 0 ? void 0 : onQuery({
|
|
283
|
+
basicFilter: basicFilter,
|
|
284
|
+
basicQuery: basicQuery,
|
|
285
|
+
type: 'basic'
|
|
95
286
|
});
|
|
96
287
|
}
|
|
97
|
-
};
|
|
288
|
+
}, [state]); // 单个设置过滤字段值, 会触发onChange事件, 多个字段时使用setLocalization
|
|
98
289
|
|
|
99
|
-
|
|
290
|
+
var setFilterFieldValue = (0, _react.useCallback)(function (field, value) {
|
|
291
|
+
var item = dataSource.find(function (v) {
|
|
292
|
+
return v.fidld === field;
|
|
293
|
+
}) || {};
|
|
294
|
+
setFilterValue === null || setFilterValue === void 0 ? void 0 : setFilterValue(value, item);
|
|
295
|
+
}, [dataSource]); // 读取缓存
|
|
296
|
+
|
|
297
|
+
var setLocalization = (0, _react.useCallback)(function () {
|
|
298
|
+
var localization = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : props.localization;
|
|
299
|
+
|
|
300
|
+
var _initLocalization = initLocalization((0, _objectSpread4.default)((0, _objectSpread4.default)({}, props), {}, {
|
|
301
|
+
localization: localization
|
|
302
|
+
})),
|
|
303
|
+
basicFilter = _initLocalization.basicFilter,
|
|
304
|
+
basicQuery = _initLocalization.basicQuery;
|
|
305
|
+
|
|
306
|
+
dispatch({
|
|
307
|
+
type: 'changeBasicFilter',
|
|
308
|
+
basicFilter: basicFilter
|
|
309
|
+
});
|
|
310
|
+
dispatch({
|
|
311
|
+
type: 'changeBasicQuery',
|
|
312
|
+
basicQuery: basicQuery
|
|
313
|
+
});
|
|
314
|
+
}, [props]); // 组件内部使用
|
|
315
|
+
|
|
316
|
+
var CoreMethods = {
|
|
317
|
+
onQuery: onQuery
|
|
318
|
+
}; // 参与Ref转发
|
|
319
|
+
|
|
320
|
+
var RefMethods = {
|
|
100
321
|
getState: function getState() {
|
|
101
322
|
return state;
|
|
102
323
|
},
|
|
@@ -104,10 +325,17 @@ var CoreOptions = function CoreOptions(_ref) {
|
|
|
104
325
|
return state.basicFilter;
|
|
105
326
|
},
|
|
106
327
|
getFilterValue: getFilterValue,
|
|
328
|
+
getFilterQuery: getFilterQuery,
|
|
107
329
|
setFilterValue: setFilterValue,
|
|
108
|
-
|
|
330
|
+
setFilterFieldValue: setFilterFieldValue,
|
|
331
|
+
setLocalization: setLocalization,
|
|
332
|
+
onClearChange: onClearChange
|
|
333
|
+
};
|
|
334
|
+
return {
|
|
335
|
+
CoreMethods: CoreMethods,
|
|
336
|
+
RefMethods: RefMethods
|
|
109
337
|
};
|
|
110
338
|
};
|
|
111
339
|
|
|
112
|
-
var _default =
|
|
340
|
+
var _default = useCoreOptions;
|
|
113
341
|
exports.default = _default;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
export declare const DefaultLocalization: {
|
|
2
|
+
customFilter: {};
|
|
3
|
+
basicFilter: {};
|
|
2
4
|
globalQuery: {
|
|
3
|
-
filter:
|
|
5
|
+
filter: {
|
|
6
|
+
conditions: any[];
|
|
7
|
+
}[];
|
|
4
8
|
};
|
|
5
9
|
filterQuery: {
|
|
6
|
-
filter:
|
|
10
|
+
filter: {
|
|
11
|
+
conditions: any[];
|
|
12
|
+
}[];
|
|
7
13
|
};
|
|
8
14
|
};
|
|
@@ -3,10 +3,28 @@
|
|
|
3
3
|
// operator: number,
|
|
4
4
|
// }
|
|
5
5
|
export var DefaultLocalization = {
|
|
6
|
+
customFilter: {},
|
|
7
|
+
basicFilter: {},
|
|
8
|
+
// 一级筛选
|
|
6
9
|
globalQuery: {
|
|
7
|
-
filter: [
|
|
10
|
+
filter: [{
|
|
11
|
+
// relation: 'and',
|
|
12
|
+
conditions: []
|
|
13
|
+
}]
|
|
8
14
|
},
|
|
15
|
+
// 二级筛选
|
|
9
16
|
filterQuery: {
|
|
10
|
-
filter: [
|
|
17
|
+
filter: [{
|
|
18
|
+
// relation: 'and',
|
|
19
|
+
conditions: [// {
|
|
20
|
+
// relation: 'antd', // 查询间的关系
|
|
21
|
+
// fieldName: '', // 查询字段
|
|
22
|
+
// fieldType: 'string', // 字段类型
|
|
23
|
+
// // 查询值的关系 "integer", "double", "string", "date", "datetime", and "boolean".
|
|
24
|
+
// operator: '',
|
|
25
|
+
// value: [], // 值的集合
|
|
26
|
+
// }
|
|
27
|
+
]
|
|
28
|
+
}]
|
|
11
29
|
}
|
|
12
30
|
};
|
|
@@ -1,12 +1,48 @@
|
|
|
1
|
-
.lm_filter_wrapper .lm_filter_container
|
|
2
|
-
.lm_filter_wrapper .lm_filter,
|
|
3
|
-
.lm_filter_wrapper .lm_filter_basic {
|
|
1
|
+
.lm_filter_wrapper .lm_filter_container .lm_filter {
|
|
4
2
|
display: flex;
|
|
5
3
|
flex-wrap: wrap;
|
|
6
4
|
align-items: center;
|
|
7
5
|
gap: 8px;
|
|
8
6
|
font-size: 12px;
|
|
9
7
|
}
|
|
8
|
+
.lm_filter_wrapper .lm_filter_container .lm_filter .lm_filter_custom_select {
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
height: 32px;
|
|
13
|
+
line-height: 1;
|
|
14
|
+
min-width: 100px;
|
|
15
|
+
max-width: 180px;
|
|
16
|
+
border: 1px solid var(--color-15);
|
|
17
|
+
border-radius: 2px;
|
|
18
|
+
color: var(--font2-color);
|
|
19
|
+
padding: 0 8px;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
transition: 0.3s;
|
|
22
|
+
}
|
|
23
|
+
.lm_filter_wrapper .lm_filter_container .lm_filter .lm_filter_custom_select.small {
|
|
24
|
+
height: 24px;
|
|
25
|
+
}
|
|
26
|
+
.lm_filter_wrapper .lm_filter_container .lm_filter .lm_filter_custom_select .lm_filter_custom_select_label span {
|
|
27
|
+
text-overflow: ellipsis;
|
|
28
|
+
white-space: nowrap;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
}
|
|
31
|
+
.lm_filter_wrapper .lm_filter_container .lm_filter .lm_filter_custom_select .lm_filter_custom_select_icon {
|
|
32
|
+
font-size: 14px;
|
|
33
|
+
color: var(--text-color);
|
|
34
|
+
transition: 0.3s;
|
|
35
|
+
}
|
|
36
|
+
.lm_filter_wrapper .lm_filter_container .lm_filter .lm_filter_custom_select:hover {
|
|
37
|
+
border-color: var(--primary-hover-color);
|
|
38
|
+
}
|
|
39
|
+
.lm_filter_wrapper .lm_filter_container .lm_filter .lm_filter_custom_select.expand {
|
|
40
|
+
color: var(--text-color);
|
|
41
|
+
border-color: var(--primary-hover-color);
|
|
42
|
+
}
|
|
43
|
+
.lm_filter_wrapper .lm_filter_container .lm_filter .lm_filter_custom_select.expand .lm_filter_custom_select_icon {
|
|
44
|
+
transform: rotateX(180deg);
|
|
45
|
+
}
|
|
10
46
|
.lm_filter_wrapper .lm_filter_container .lm_filter .lm_filter_search {
|
|
11
47
|
max-width: 140px;
|
|
12
48
|
}
|
|
@@ -127,13 +163,18 @@
|
|
|
127
163
|
cursor: pointer;
|
|
128
164
|
gap: 8px;
|
|
129
165
|
}
|
|
130
|
-
.ant-dropdown .filter_dropdown .filter_body .filter_item.
|
|
131
|
-
border-top: 1px solid var(--
|
|
166
|
+
.ant-dropdown .filter_dropdown .filter_body .filter_item.last_item {
|
|
167
|
+
border-top: 1px solid var(--line-color);
|
|
132
168
|
}
|
|
133
169
|
.ant-dropdown .filter_dropdown .filter_body .filter_item .filter_item_content {
|
|
134
170
|
flex: auto;
|
|
135
171
|
}
|
|
136
|
-
.ant-dropdown .filter_dropdown .filter_body .filter_item .filter_item_operate
|
|
172
|
+
.ant-dropdown .filter_dropdown .filter_body .filter_item .filter_item_operate {
|
|
173
|
+
display: inline-flex;
|
|
174
|
+
align-items: center;
|
|
175
|
+
gap: 4px;
|
|
176
|
+
}
|
|
177
|
+
.ant-dropdown .filter_dropdown .filter_body .filter_item .filter_item_operate .icon_hover {
|
|
137
178
|
font-size: 16px;
|
|
138
179
|
color: var(--primary-color);
|
|
139
180
|
transition: 0.3s;
|
|
@@ -143,12 +184,13 @@
|
|
|
143
184
|
display: none;
|
|
144
185
|
}
|
|
145
186
|
.ant-dropdown .filter_dropdown .filter_body .filter_item.checked {
|
|
187
|
+
color: var(--font-color);
|
|
146
188
|
background-color: var(--primary-select-color);
|
|
147
189
|
}
|
|
148
190
|
.ant-dropdown .filter_dropdown .filter_body .filter_item:hover {
|
|
149
|
-
background-color: var(--
|
|
191
|
+
background-color: var(--background-color);
|
|
150
192
|
}
|
|
151
|
-
.ant-dropdown .filter_dropdown .filter_body .filter_item:hover .filter_item_operate .
|
|
193
|
+
.ant-dropdown .filter_dropdown .filter_body .filter_item:hover .filter_item_operate .icon_hover {
|
|
152
194
|
opacity: 1;
|
|
153
195
|
}
|
|
154
196
|
.ant-dropdown .filter_dropdown .filter_footer {
|
package/es/LmFilter/utils.js
CHANGED
|
@@ -5,12 +5,16 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
+
exports.getFilterShow = getFilterShow;
|
|
9
|
+
exports.getFilterShowQuery = getFilterShowQuery;
|
|
8
10
|
exports.getFlatItem = getFlatItem;
|
|
9
11
|
exports.getIsHas = getIsHas;
|
|
10
12
|
exports.getRanges = getRanges;
|
|
11
13
|
exports.getValueForType = getValueForType;
|
|
12
14
|
exports.uniqueFunc = uniqueFunc;
|
|
13
15
|
|
|
16
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
17
|
+
|
|
14
18
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/typeof"));
|
|
15
19
|
|
|
16
20
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
@@ -117,4 +121,34 @@ function getFlatItem(filterValues, originArr) {
|
|
|
117
121
|
}
|
|
118
122
|
});
|
|
119
123
|
return nArr;
|
|
124
|
+
} // 返回过滤掉隐藏字段后的查询结构 () => {...}
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
function getFilterShow(basicFilter, dataSource) {
|
|
128
|
+
return Object.keys(basicFilter).reduce(function (pre, cur) {
|
|
129
|
+
var value = basicFilter[cur];
|
|
130
|
+
|
|
131
|
+
if (dataSource.some(function (v) {
|
|
132
|
+
return v.field === cur && (v.show || typeof v.show !== 'boolean');
|
|
133
|
+
})) {
|
|
134
|
+
pre[cur] = value;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return pre;
|
|
138
|
+
}, {});
|
|
139
|
+
} // 返回过滤掉隐藏字段后的查询结构 () => [...]
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
function getFilterShowQuery(basicQuery, dataSource) {
|
|
143
|
+
return Object.keys(basicQuery).reduce(function (pre, cur) {
|
|
144
|
+
var value = basicQuery[cur];
|
|
145
|
+
|
|
146
|
+
if (dataSource.some(function (v) {
|
|
147
|
+
return v.field === cur && v.show || typeof v.show !== 'boolean';
|
|
148
|
+
})) {
|
|
149
|
+
return [].concat((0, _toConsumableArray2.default)(pre), [value]);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return pre;
|
|
153
|
+
}, []);
|
|
120
154
|
}
|
|
@@ -15,6 +15,8 @@ var _customFilter = _interopRequireDefault(require("../customFilter"));
|
|
|
15
15
|
|
|
16
16
|
var _complexFilter = _interopRequireDefault(require("../complexFilter"));
|
|
17
17
|
|
|
18
|
+
var _clearFilter = _interopRequireDefault(require("../clearFilter"));
|
|
19
|
+
|
|
18
20
|
// 筛选组合
|
|
19
21
|
var LmFilter = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
20
22
|
var instance = _ref.instance;
|
|
@@ -29,6 +31,8 @@ var LmFilter = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
29
31
|
instance: instance
|
|
30
32
|
}), enableComplex && /*#__PURE__*/_react.default.createElement(_complexFilter.default, {
|
|
31
33
|
instance: instance
|
|
34
|
+
}), /*#__PURE__*/_react.default.createElement(_clearFilter.default, {
|
|
35
|
+
instance: instance
|
|
32
36
|
}));
|
|
33
37
|
});
|
|
34
38
|
|
|
@@ -11,8 +11,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _Filter = _interopRequireDefault(require("./Filter"));
|
|
13
13
|
|
|
14
|
-
var _clearFilter = _interopRequireDefault(require("../clearFilter"));
|
|
15
|
-
|
|
16
14
|
// 过滤组件主体区域
|
|
17
15
|
var LmFilterContainer = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
18
16
|
var instance = _ref.instance;
|
|
@@ -20,8 +18,6 @@ var LmFilterContainer = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
20
18
|
className: "lm_filter_container"
|
|
21
19
|
}, /*#__PURE__*/_react.default.createElement(_Filter.default, {
|
|
22
20
|
instance: instance
|
|
23
|
-
}), /*#__PURE__*/_react.default.createElement(_clearFilter.default, {
|
|
24
|
-
instance: instance
|
|
25
21
|
}));
|
|
26
22
|
});
|
|
27
23
|
|