linkmore-design 1.0.62 → 1.0.66
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/README.md +1 -1
- package/dist/Approval/demos/basic.d.ts +2 -0
- package/dist/Approval/index.d.ts +24 -0
- package/dist/Approval/style/index.d.ts +1 -0
- 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/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/index.d.ts +1 -1
- 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 +4 -1
- package/dist/LmEditTable/demos/colsort.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/customFilter/drawer.d.ts +4 -0
- package/dist/LmFilter/customFilter/saveModal.d.ts +4 -0
- package/dist/LmFilter/customFilter/valueDrawer.d.ts +4 -0
- package/dist/LmFilter/filterFns/index.d.ts +35 -17
- package/dist/LmFilter/utils.d.ts +2 -0
- package/dist/Mentions/demos/basic.d.ts +2 -0
- package/dist/Mentions/index.d.ts +3 -0
- package/dist/Mentions/style/index.d.ts +1 -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/Rate/demos/basic.d.ts +2 -0
- package/dist/Rate/index.d.ts +3 -0
- package/dist/Rate/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/Steps/demos/basic.d.ts +2 -0
- package/dist/Steps/index.d.ts +3 -0
- package/dist/Steps/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 +17449 -8958
- package/dist/index.umd.min.js +6 -6
- package/es/Approval/index.d.ts +24 -0
- package/es/Approval/index.js +210 -0
- package/es/Approval/style/index.css +592 -0
- package/es/Approval/style/index.d.ts +1 -0
- package/es/Approval/style/index.js +1 -0
- 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/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/EditTable/README.md.old +66 -0
- package/es/Form/container.js +17 -1
- package/es/Form/index.d.ts +1 -1
- package/es/Form/index.js +5 -2
- package/es/Form/style/index.css +32 -17
- 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/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 +4 -1
- package/es/LmEditTable/EditTable.js +241 -59
- 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/{icon_placeholder.png → assets/empty.png} +0 -0
- package/es/LmFilter/clearFilter/index.js +3 -5
- package/es/LmFilter/complexFilter/drawer.js +26 -9
- package/es/LmFilter/components/CheckboxFilter.js +1 -1
- package/es/LmFilter/components/CustomSelectFilter.js +139 -0
- package/es/LmFilter/components/EmptyFilter.js +2 -2
- package/es/LmFilter/components/SelectFilter.js +15 -6
- package/es/LmFilter/components/index.js +9 -2
- package/es/LmFilter/customFilter/drawer.js +427 -0
- package/es/LmFilter/customFilter/index.js +107 -2
- package/es/LmFilter/customFilter/saveModal.js +187 -0
- package/es/LmFilter/customFilter/valueDrawer.js +238 -0
- package/es/LmFilter/filterFns/index.js +316 -70
- package/es/LmFilter/style/{style.css → index.css} +61 -6
- package/es/LmFilter/style/index.js +1 -1
- package/es/LmFilter/utils.js +34 -0
- package/es/LmFilter/wrapper/FilterRoot.js +63 -49
- package/es/Mentions/index.d.ts +3 -0
- package/es/Mentions/index.js +3 -0
- package/es/Mentions/style/index.css +505 -0
- package/es/Mentions/style/index.d.ts +1 -0
- package/es/Mentions/style/index.js +1 -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/Rate/index.d.ts +3 -0
- package/es/Rate/index.js +3 -0
- package/es/Rate/style/index.css +505 -0
- package/es/Rate/style/index.d.ts +1 -0
- package/es/Rate/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/Steps/index.d.ts +3 -0
- package/es/Steps/index.js +3 -0
- package/es/Steps/style/index.css +505 -0
- package/es/Steps/style/index.d.ts +1 -0
- package/es/Steps/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/Approval/index.d.ts +24 -0
- package/lib/Approval/index.js +223 -0
- package/lib/Approval/style/index.css +592 -0
- package/lib/Approval/style/index.d.ts +1 -0
- package/lib/Approval/style/index.js +3 -0
- 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/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/EditTable/README.md.old +66 -0
- package/lib/Form/container.js +17 -1
- package/lib/Form/index.d.ts +1 -1
- package/lib/Form/index.js +5 -2
- package/lib/Form/style/index.css +32 -17
- 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/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 +4 -1
- package/lib/LmEditTable/EditTable.js +242 -60
- 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/{icon_placeholder.png → assets/empty.png} +0 -0
- package/lib/LmFilter/clearFilter/index.js +3 -5
- package/lib/LmFilter/complexFilter/drawer.js +26 -9
- package/lib/LmFilter/components/CheckboxFilter.js +1 -1
- package/lib/LmFilter/components/CustomSelectFilter.js +139 -0
- package/lib/LmFilter/components/EmptyFilter.js +2 -2
- package/lib/LmFilter/components/SelectFilter.js +15 -6
- package/lib/LmFilter/components/index.js +9 -2
- package/lib/LmFilter/customFilter/drawer.js +427 -0
- package/lib/LmFilter/customFilter/index.js +107 -2
- package/lib/LmFilter/customFilter/saveModal.js +187 -0
- package/lib/LmFilter/customFilter/valueDrawer.js +238 -0
- package/lib/LmFilter/filterFns/index.js +316 -70
- package/lib/LmFilter/style/{style.css → index.css} +61 -6
- package/lib/LmFilter/style/index.js +1 -1
- package/lib/LmFilter/utils.js +34 -0
- package/lib/LmFilter/wrapper/FilterRoot.js +63 -49
- package/lib/Mentions/index.d.ts +3 -0
- package/lib/Mentions/index.js +15 -0
- package/lib/Mentions/style/index.css +505 -0
- package/lib/Mentions/style/index.d.ts +1 -0
- package/lib/Mentions/style/index.js +3 -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/Rate/index.d.ts +3 -0
- package/lib/Rate/index.js +15 -0
- package/lib/Rate/style/index.css +505 -0
- package/lib/Rate/style/index.d.ts +1 -0
- package/lib/Rate/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/Steps/index.d.ts +3 -0
- package/lib/Steps/index.js +15 -0
- package/lib/Steps/style/index.css +505 -0
- package/lib/Steps/style/index.d.ts +1 -0
- package/lib/Steps/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 +2 -2
|
@@ -1,36 +1,215 @@
|
|
|
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
14
|
var _objectSpread4 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
13
15
|
|
|
16
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
17
|
+
|
|
18
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
+
|
|
14
20
|
var _utils = require("../utils");
|
|
15
21
|
|
|
16
|
-
//
|
|
17
|
-
var
|
|
22
|
+
// 初始化查询结构
|
|
23
|
+
var initLocalization = function initLocalization(props) {
|
|
24
|
+
var _globalQuery$filters, _globalQuery$filters$, _filterQuery$filters, _filterQuery$filters$;
|
|
25
|
+
|
|
26
|
+
var localization = props.localization,
|
|
27
|
+
dataSource = props.dataSource,
|
|
28
|
+
searchKey = props.searchKey,
|
|
29
|
+
customOptions = props.customOptions;
|
|
30
|
+
var globalQuery = localization.globalQuery,
|
|
31
|
+
filterQuery = localization.filterQuery;
|
|
32
|
+
var basicFilter = (localization === null || localization === void 0 ? void 0 : localization.basicFilter) || {};
|
|
33
|
+
var basicQuery = {}; // 存储查询结构
|
|
34
|
+
|
|
35
|
+
var customFilter = (customOptions === null || customOptions === void 0 ? void 0 : customOptions.find(function (v) {
|
|
36
|
+
var _localization$customF;
|
|
37
|
+
|
|
38
|
+
return (v === null || v === void 0 ? void 0 : v.value) === (localization === null || localization === void 0 ? void 0 : (_localization$customF = localization.customFilter) === null || _localization$customF === void 0 ? void 0 : _localization$customF.value);
|
|
39
|
+
})) || {};
|
|
40
|
+
var customQuery = {}; // 自定义筛选存储结构
|
|
41
|
+
|
|
42
|
+
if (globalQuery === null || globalQuery === void 0 ? void 0 : (_globalQuery$filters = globalQuery.filters) === null || _globalQuery$filters === void 0 ? void 0 : (_globalQuery$filters$ = _globalQuery$filters[0]) === null || _globalQuery$filters$ === void 0 ? void 0 : _globalQuery$filters$.conditions) {
|
|
43
|
+
var _globalQuery$filters2, _globalQuery$filters3;
|
|
44
|
+
|
|
45
|
+
var globalQueryArr = (globalQuery === null || globalQuery === void 0 ? void 0 : (_globalQuery$filters2 = globalQuery.filters) === null || _globalQuery$filters2 === void 0 ? void 0 : (_globalQuery$filters3 = _globalQuery$filters2[0]) === null || _globalQuery$filters3 === void 0 ? void 0 : _globalQuery$filters3.conditions) || [];
|
|
46
|
+
customQuery = globalQueryArr.reduce(function (pre, cur) {
|
|
47
|
+
var checkedValue = cur.value; // 选中的数据
|
|
48
|
+
// 查找该数据是否展示
|
|
49
|
+
|
|
50
|
+
if ((0, _utils.getIsHas)(checkedValue)) {
|
|
51
|
+
pre[cur.fieldName] = cur;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return pre;
|
|
55
|
+
}, {});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
;
|
|
59
|
+
|
|
60
|
+
if ((0, _utils.getIsHas)(basicFilter)) {
|
|
61
|
+
var _Object$keys;
|
|
62
|
+
|
|
63
|
+
basicQuery = (_Object$keys = Object.keys(basicFilter)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.reduce(function (pre, cur) {
|
|
64
|
+
var item = dataSource.find(function (v) {
|
|
65
|
+
if (cur === v.field) {
|
|
66
|
+
return v.show || typeof v.show !== 'boolean';
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return false;
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
if (cur === searchKey) {
|
|
73
|
+
item = {
|
|
74
|
+
field: searchKey,
|
|
75
|
+
operator: 'contains',
|
|
76
|
+
fieldType: 'string'
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if ((0, _utils.getIsHas)(basicFilter[cur]) && !!item) {
|
|
81
|
+
var _item, _item2;
|
|
82
|
+
|
|
83
|
+
pre[cur] = {
|
|
84
|
+
fieldName: cur,
|
|
85
|
+
fieldType: ((_item = item) === null || _item === void 0 ? void 0 : _item.valueType) || 'string',
|
|
86
|
+
value: Array.isArray(basicFilter[cur]) ? basicFilter[cur] : [basicFilter[cur]],
|
|
87
|
+
operator: ((_item2 = item) === null || _item2 === void 0 ? void 0 : _item2.operator) || 'equal'
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return pre;
|
|
92
|
+
}, {});
|
|
93
|
+
} 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) {
|
|
94
|
+
var _filterQuery$filters2, _filterQuery$filters3;
|
|
95
|
+
|
|
96
|
+
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) || []; // 初始化基础查询缓存
|
|
97
|
+
|
|
98
|
+
basicFilter = filterQueryArr.reduce(function (pre, cur) {
|
|
99
|
+
var checkedValue = cur.value; // 选中的数据
|
|
100
|
+
// 是否搜索框
|
|
101
|
+
|
|
102
|
+
var isSearchInput = cur.fieldName === searchKey; // 查找该数据是否展示
|
|
103
|
+
|
|
104
|
+
var someData = dataSource.some(function (v) {
|
|
105
|
+
if (cur.fieldName === v.field) {
|
|
106
|
+
return v.show || typeof v.show !== 'boolean';
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return false;
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
if ((0, _utils.getIsHas)(checkedValue) && someData || isSearchInput) {
|
|
113
|
+
basicQuery[cur.fieldName] = cur; // 复选/级联/日期区间
|
|
114
|
+
|
|
115
|
+
if (!['checkbox', 'cascader'].includes(cur.type) && checkedValue.length < 2) {
|
|
116
|
+
checkedValue = checkedValue[0];
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
pre[cur.fieldName] = checkedValue;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return pre;
|
|
123
|
+
}, {});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
;
|
|
127
|
+
return {
|
|
128
|
+
basicFilter: basicFilter,
|
|
129
|
+
basicQuery: basicQuery,
|
|
130
|
+
customFilter: customFilter,
|
|
131
|
+
customQuery: customQuery
|
|
132
|
+
};
|
|
133
|
+
}; // 核心参数集合
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
exports.initLocalization = initLocalization;
|
|
137
|
+
|
|
138
|
+
var useCoreOptions = function useCoreOptions(_ref) {
|
|
18
139
|
var state = _ref.state,
|
|
19
140
|
dispatch = _ref.dispatch,
|
|
20
141
|
props = _ref.props;
|
|
21
142
|
var onChange = props.onChange,
|
|
22
143
|
dataSource = props.dataSource,
|
|
23
|
-
searchKey = props.searchKey
|
|
144
|
+
searchKey = props.searchKey,
|
|
145
|
+
customOptions = props.customOptions; // object => array
|
|
146
|
+
|
|
147
|
+
var tranformQuery = (0, _react.useCallback)(function (obj) {
|
|
148
|
+
var _Object$keys2;
|
|
149
|
+
|
|
150
|
+
var nArr = ((_Object$keys2 = Object.keys(obj)) === null || _Object$keys2 === void 0 ? void 0 : _Object$keys2.reduce(function (pre, cur) {
|
|
151
|
+
var item = dataSource.find(function (v) {
|
|
152
|
+
return cur === v.field;
|
|
153
|
+
});
|
|
154
|
+
var itemValue = obj[cur].value;
|
|
155
|
+
|
|
156
|
+
if ((0, _utils.getIsHas)(itemValue) && !!item) {
|
|
157
|
+
return [].concat((0, _toConsumableArray2.default)(pre), [{
|
|
158
|
+
fieldName: cur,
|
|
159
|
+
fieldType: (item === null || item === void 0 ? void 0 : item.valueType) || 'string',
|
|
160
|
+
type: item.type,
|
|
161
|
+
value: Array.isArray(itemValue) ? itemValue : [itemValue],
|
|
162
|
+
operator: obj[cur].mode === 'and' ? 'equal' : 'contains'
|
|
163
|
+
}]);
|
|
164
|
+
}
|
|
24
165
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
166
|
+
return pre;
|
|
167
|
+
}, [])) || [];
|
|
168
|
+
return nArr;
|
|
169
|
+
}, [dataSource]); // 触发查询 type basic基础筛选 | complex高级筛选
|
|
170
|
+
|
|
171
|
+
var onQuery = (0, _react.useCallback)(function () {
|
|
172
|
+
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
173
|
+
_ref2$basicFilter = _ref2.basicFilter,
|
|
174
|
+
basicFilter = _ref2$basicFilter === void 0 ? {} : _ref2$basicFilter,
|
|
175
|
+
_ref2$complexFilter = _ref2.complexFilter,
|
|
176
|
+
complexFilter = _ref2$complexFilter === void 0 ? {} : _ref2$complexFilter,
|
|
177
|
+
_ref2$customFilter = _ref2.customFilter,
|
|
178
|
+
customFilter = _ref2$customFilter === void 0 ? state.customFilter || {} : _ref2$customFilter,
|
|
179
|
+
_ref2$basicQuery = _ref2.basicQuery,
|
|
180
|
+
basicQuery = _ref2$basicQuery === void 0 ? {} : _ref2$basicQuery,
|
|
181
|
+
_ref2$type = _ref2.type,
|
|
182
|
+
type = _ref2$type === void 0 ? 'basic' : _ref2$type;
|
|
183
|
+
|
|
184
|
+
if (type === 'custom') {
|
|
185
|
+
var _Object$keys3;
|
|
186
|
+
|
|
187
|
+
dispatch({
|
|
188
|
+
type: 'changeCustomFilter',
|
|
189
|
+
customFilter: customFilter
|
|
190
|
+
});
|
|
191
|
+
var globalQuery = {
|
|
192
|
+
filters: [{
|
|
193
|
+
conditions: tranformQuery(customFilter === null || customFilter === void 0 ? void 0 : customFilter.data)
|
|
194
|
+
}]
|
|
195
|
+
};
|
|
196
|
+
var filterQuery = {
|
|
197
|
+
filters: [{
|
|
198
|
+
conditions: (_Object$keys3 = Object.keys(state.basicQuery)) === null || _Object$keys3 === void 0 ? void 0 : _Object$keys3.map(function (k) {
|
|
199
|
+
return state.basicQuery[k];
|
|
200
|
+
})
|
|
201
|
+
}]
|
|
202
|
+
};
|
|
203
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
204
|
+
basicFilter: basicFilter,
|
|
205
|
+
globalQuery: globalQuery,
|
|
206
|
+
filterQuery: filterQuery,
|
|
207
|
+
type: 'custom'
|
|
208
|
+
});
|
|
209
|
+
}
|
|
31
210
|
|
|
32
211
|
if (type === 'basic') {
|
|
33
|
-
var _Object$
|
|
212
|
+
var _Object$keys4;
|
|
34
213
|
|
|
35
214
|
dispatch({
|
|
36
215
|
type: 'changeBasicFilter',
|
|
@@ -46,24 +225,30 @@ var CoreOptions = function CoreOptions(_ref) {
|
|
|
46
225
|
}); // 基础筛选清空高级筛选
|
|
47
226
|
// 抛出给外部查询
|
|
48
227
|
|
|
49
|
-
var
|
|
228
|
+
var _globalQuery = {
|
|
229
|
+
filters: [{
|
|
230
|
+
conditions: tranformQuery(customFilter.data)
|
|
231
|
+
}]
|
|
232
|
+
};
|
|
233
|
+
var _filterQuery = {
|
|
50
234
|
filters: [{
|
|
51
|
-
conditions: (_Object$
|
|
235
|
+
conditions: (_Object$keys4 = Object.keys(basicQuery)) === null || _Object$keys4 === void 0 ? void 0 : _Object$keys4.map(function (k) {
|
|
52
236
|
return basicQuery[k];
|
|
53
237
|
})
|
|
54
238
|
}]
|
|
55
239
|
};
|
|
56
240
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
57
241
|
basicFilter: basicFilter,
|
|
58
|
-
|
|
242
|
+
globalQuery: _globalQuery,
|
|
243
|
+
filterQuery: _filterQuery,
|
|
59
244
|
type: 'basic'
|
|
60
245
|
});
|
|
61
246
|
}
|
|
62
247
|
|
|
63
248
|
if (type === 'complex') {
|
|
64
|
-
var _Object$
|
|
249
|
+
var _Object$keys5, _Object$keys6;
|
|
65
250
|
|
|
66
|
-
var _basicQuery = (_Object$
|
|
251
|
+
var _basicQuery = (_Object$keys5 = Object.keys(complexFilter)) === null || _Object$keys5 === void 0 ? void 0 : _Object$keys5.reduce(function (pre, cur) {
|
|
67
252
|
var item = dataSource.find(function (v) {
|
|
68
253
|
return cur === v.field;
|
|
69
254
|
});
|
|
@@ -73,6 +258,7 @@ var CoreOptions = function CoreOptions(_ref) {
|
|
|
73
258
|
pre[cur] = {
|
|
74
259
|
fieldName: cur,
|
|
75
260
|
fieldType: (item === null || item === void 0 ? void 0 : item.valueType) || 'string',
|
|
261
|
+
type: item.type,
|
|
76
262
|
value: Array.isArray(itemValue) ? itemValue : [itemValue],
|
|
77
263
|
operator: complexFilter[cur].mode === 'and' ? 'equal' : 'contains'
|
|
78
264
|
};
|
|
@@ -100,31 +286,87 @@ var CoreOptions = function CoreOptions(_ref) {
|
|
|
100
286
|
type: 'changeBasicQuery',
|
|
101
287
|
basicQuery: _basicQuery
|
|
102
288
|
});
|
|
103
|
-
var
|
|
289
|
+
var _globalQuery2 = {
|
|
104
290
|
filters: [{
|
|
105
|
-
conditions: (
|
|
291
|
+
conditions: tranformQuery(customFilter.data)
|
|
292
|
+
}]
|
|
293
|
+
};
|
|
294
|
+
var _filterQuery2 = {
|
|
295
|
+
filters: [{
|
|
296
|
+
conditions: (_Object$keys6 = Object.keys(_basicQuery)) === null || _Object$keys6 === void 0 ? void 0 : _Object$keys6.map(function (k) {
|
|
106
297
|
return _basicQuery[k];
|
|
107
298
|
})
|
|
108
299
|
}]
|
|
109
300
|
};
|
|
110
301
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
111
302
|
complexFilter: complexFilter,
|
|
112
|
-
|
|
303
|
+
globalQuery: _globalQuery2,
|
|
304
|
+
filterQuery: _filterQuery2,
|
|
113
305
|
type: type
|
|
114
306
|
});
|
|
115
307
|
}
|
|
116
|
-
}; //
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
308
|
+
}, [tranformQuery, state]); // 清除事件
|
|
309
|
+
|
|
310
|
+
var onClearChange = (0, _react.useCallback)(function () {
|
|
311
|
+
var _props$onClearChange;
|
|
312
|
+
|
|
313
|
+
var params = {
|
|
314
|
+
basicFilter: {},
|
|
315
|
+
complexFilter: {},
|
|
316
|
+
basicQuery: {},
|
|
317
|
+
type: 'basic'
|
|
318
|
+
};
|
|
319
|
+
(_props$onClearChange = props.onClearChange) === null || _props$onClearChange === void 0 ? void 0 : _props$onClearChange.call(props, params);
|
|
320
|
+
onQuery(params);
|
|
321
|
+
}, [onQuery]); // 根据字段查找过滤的数据, 不存在时返回默认值
|
|
322
|
+
|
|
323
|
+
var getFilterValue = (0, _react.useCallback)(function (_ref3) {
|
|
120
324
|
var field = _ref3.field,
|
|
121
325
|
type = _ref3.type;
|
|
122
326
|
var defaultValue = (0, _utils.getValueForType)(type);
|
|
327
|
+
|
|
328
|
+
if ((0, _utils.getIsHas)(state.basicFilter[field])) {
|
|
329
|
+
return state.basicFilter[field];
|
|
330
|
+
}
|
|
331
|
+
|
|
123
332
|
return state.basicFilter[field] || defaultValue;
|
|
124
|
-
}; //
|
|
333
|
+
}, [state.basicFilter]); // 获取查询结构
|
|
125
334
|
|
|
335
|
+
var getFilterQuery = (0, _react.useCallback)(function () {
|
|
336
|
+
var _Object$keys7;
|
|
126
337
|
|
|
127
|
-
|
|
338
|
+
var originData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : dataSource;
|
|
339
|
+
var basicFilter = (0, _utils.getFilterShow)(state.basicFilter, originData);
|
|
340
|
+
var basicQuery = (0, _utils.getFilterShow)(state.basicQuery, originData);
|
|
341
|
+
dispatch({
|
|
342
|
+
type: 'changeBasicFilter',
|
|
343
|
+
basicFilter: basicFilter
|
|
344
|
+
});
|
|
345
|
+
dispatch({
|
|
346
|
+
type: 'changeBasicQuery',
|
|
347
|
+
basicQuery: basicQuery
|
|
348
|
+
});
|
|
349
|
+
var globalQuery = {
|
|
350
|
+
filters: [{
|
|
351
|
+
conditions: tranformQuery(state.customFilter.data)
|
|
352
|
+
}]
|
|
353
|
+
};
|
|
354
|
+
var filterQuery = {
|
|
355
|
+
filters: [{
|
|
356
|
+
conditions: (_Object$keys7 = Object.keys(basicQuery)) === null || _Object$keys7 === void 0 ? void 0 : _Object$keys7.map(function (k) {
|
|
357
|
+
return basicQuery[k];
|
|
358
|
+
})
|
|
359
|
+
}]
|
|
360
|
+
};
|
|
361
|
+
return {
|
|
362
|
+
basicFilter: basicFilter,
|
|
363
|
+
globalQuery: globalQuery,
|
|
364
|
+
filterQuery: filterQuery,
|
|
365
|
+
type: 'basic'
|
|
366
|
+
};
|
|
367
|
+
}, [state, dataSource]); // 设置筛选的值 itemValue => String || Array => ['', '', ...]
|
|
368
|
+
|
|
369
|
+
var setFilterValue = (0, _react.useCallback)(function (itemValue, item) {
|
|
128
370
|
var field = item.field;
|
|
129
371
|
|
|
130
372
|
if (field) {
|
|
@@ -134,6 +376,7 @@ var CoreOptions = function CoreOptions(_ref) {
|
|
|
134
376
|
var basicQuery = (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.basicQuery), {}, (0, _defineProperty2.default)({}, field, {
|
|
135
377
|
fieldName: field,
|
|
136
378
|
fieldType: item.valueType || 'string',
|
|
379
|
+
type: item.type,
|
|
137
380
|
value: Array.isArray(itemValue) ? itemValue : [itemValue],
|
|
138
381
|
operator: item.operator || 'equal'
|
|
139
382
|
}));
|
|
@@ -150,45 +393,26 @@ var CoreOptions = function CoreOptions(_ref) {
|
|
|
150
393
|
type: 'basic'
|
|
151
394
|
});
|
|
152
395
|
}
|
|
153
|
-
}; //
|
|
154
|
-
|
|
396
|
+
}, [state]); // 单个设置过滤字段值, 会触发onChange事件, 多个字段时使用setLocalization
|
|
155
397
|
|
|
156
|
-
var
|
|
157
|
-
var
|
|
398
|
+
var setFilterFieldValue = (0, _react.useCallback)(function (field, value) {
|
|
399
|
+
var item = dataSource.find(function (v) {
|
|
400
|
+
return v.fidld === field;
|
|
401
|
+
}) || {};
|
|
402
|
+
setFilterValue === null || setFilterValue === void 0 ? void 0 : setFilterValue(value, item);
|
|
403
|
+
}, [dataSource]); // 读取缓存
|
|
158
404
|
|
|
405
|
+
var setLocalization = (0, _react.useCallback)(function () {
|
|
159
406
|
var localization = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : props.localization;
|
|
160
|
-
var globalQuery = localization.globalQuery,
|
|
161
|
-
basicFilter = localization.basicFilter;
|
|
162
|
-
var basicQuery = (_Object$keys4 = Object.keys(basicFilter)) === null || _Object$keys4 === void 0 ? void 0 : _Object$keys4.reduce(function (pre, cur) {
|
|
163
|
-
var item = dataSource.find(function (v) {
|
|
164
|
-
if (cur === v.field) {
|
|
165
|
-
return v.show || typeof v.show !== 'boolean';
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
return false;
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
if (cur === searchKey) {
|
|
172
|
-
item = {
|
|
173
|
-
field: searchKey,
|
|
174
|
-
operator: 'contains',
|
|
175
|
-
fieldType: 'string'
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
if ((0, _utils.getIsHas)(basicFilter[cur]) && !!item) {
|
|
180
|
-
var _item, _item2;
|
|
181
407
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
408
|
+
var _initLocalization = initLocalization((0, _objectSpread4.default)((0, _objectSpread4.default)({}, props), {}, {
|
|
409
|
+
localization: localization
|
|
410
|
+
})),
|
|
411
|
+
basicFilter = _initLocalization.basicFilter,
|
|
412
|
+
basicQuery = _initLocalization.basicQuery,
|
|
413
|
+
customFilter = _initLocalization.customFilter,
|
|
414
|
+
customQuery = _initLocalization.customQuery;
|
|
189
415
|
|
|
190
|
-
return pre;
|
|
191
|
-
}, {});
|
|
192
416
|
dispatch({
|
|
193
417
|
type: 'changeBasicFilter',
|
|
194
418
|
basicFilter: basicFilter
|
|
@@ -197,18 +421,34 @@ var CoreOptions = function CoreOptions(_ref) {
|
|
|
197
421
|
type: 'changeBasicQuery',
|
|
198
422
|
basicQuery: basicQuery
|
|
199
423
|
});
|
|
200
|
-
|
|
201
|
-
|
|
424
|
+
dispatch({
|
|
425
|
+
type: 'changeCustomFilter',
|
|
426
|
+
customFilter: customFilter
|
|
427
|
+
});
|
|
428
|
+
dispatch({
|
|
429
|
+
type: 'changeCustomQuery',
|
|
430
|
+
customQuery: customQuery
|
|
431
|
+
});
|
|
432
|
+
}, [props]); // 自定义筛选查询
|
|
202
433
|
|
|
203
|
-
var
|
|
204
|
-
var
|
|
205
|
-
return v.
|
|
206
|
-
})
|
|
207
|
-
|
|
208
|
-
|
|
434
|
+
var setCustomFilter = (0, _react.useCallback)(function (val) {
|
|
435
|
+
var customFilter = customOptions.find(function (v) {
|
|
436
|
+
return v.value === val;
|
|
437
|
+
});
|
|
438
|
+
console.log('state.basicFilter', state.basicFilter);
|
|
439
|
+
onQuery({
|
|
440
|
+
customFilter: customFilter,
|
|
441
|
+
basicFilter: state.basicFilter,
|
|
442
|
+
type: 'custom'
|
|
443
|
+
});
|
|
444
|
+
}, [customOptions, state.basicFilter]); // 组件内部使用
|
|
209
445
|
|
|
210
|
-
|
|
446
|
+
var CoreMethods = {
|
|
211
447
|
onQuery: onQuery,
|
|
448
|
+
setCustomFilter: setCustomFilter
|
|
449
|
+
}; // 参与Ref转发
|
|
450
|
+
|
|
451
|
+
var RefMethods = {
|
|
212
452
|
getState: function getState() {
|
|
213
453
|
return state;
|
|
214
454
|
},
|
|
@@ -216,11 +456,17 @@ var CoreOptions = function CoreOptions(_ref) {
|
|
|
216
456
|
return state.basicFilter;
|
|
217
457
|
},
|
|
218
458
|
getFilterValue: getFilterValue,
|
|
459
|
+
getFilterQuery: getFilterQuery,
|
|
219
460
|
setFilterValue: setFilterValue,
|
|
220
461
|
setFilterFieldValue: setFilterFieldValue,
|
|
221
|
-
setLocalization: setLocalization
|
|
462
|
+
setLocalization: setLocalization,
|
|
463
|
+
onClearChange: onClearChange
|
|
464
|
+
};
|
|
465
|
+
return {
|
|
466
|
+
CoreMethods: CoreMethods,
|
|
467
|
+
RefMethods: RefMethods
|
|
222
468
|
};
|
|
223
469
|
};
|
|
224
470
|
|
|
225
|
-
var _default =
|
|
471
|
+
var _default = useCoreOptions;
|
|
226
472
|
exports.default = _default;
|
|
@@ -5,6 +5,53 @@
|
|
|
5
5
|
gap: 8px;
|
|
6
6
|
font-size: 12px;
|
|
7
7
|
}
|
|
8
|
+
.lm_filter_wrapper .lm_filter_container .lm_filter .lm_filter_custom {
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
gap: 8px;
|
|
11
|
+
}
|
|
12
|
+
.lm_filter_wrapper .lm_filter_container .lm_filter .lm_filter_custom .lm_filter_custom_select {
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: space-between;
|
|
16
|
+
height: 32px;
|
|
17
|
+
line-height: 1;
|
|
18
|
+
min-width: 100px;
|
|
19
|
+
max-width: 180px;
|
|
20
|
+
border: 1px solid var(--color-15);
|
|
21
|
+
border-radius: 2px;
|
|
22
|
+
color: var(--font2-color);
|
|
23
|
+
padding: 0 8px;
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
transition: 0.3s;
|
|
26
|
+
}
|
|
27
|
+
.lm_filter_wrapper .lm_filter_container .lm_filter .lm_filter_custom .lm_filter_custom_select.small {
|
|
28
|
+
height: 24px;
|
|
29
|
+
}
|
|
30
|
+
.lm_filter_wrapper .lm_filter_container .lm_filter .lm_filter_custom .lm_filter_custom_select .lm_filter_custom_select_label span {
|
|
31
|
+
text-overflow: ellipsis;
|
|
32
|
+
white-space: nowrap;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
}
|
|
35
|
+
.lm_filter_wrapper .lm_filter_container .lm_filter .lm_filter_custom .lm_filter_custom_select .lm_filter_custom_select_icon {
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
color: var(--text-color);
|
|
38
|
+
transition: 0.3s;
|
|
39
|
+
}
|
|
40
|
+
.lm_filter_wrapper .lm_filter_container .lm_filter .lm_filter_custom .lm_filter_custom_select:hover {
|
|
41
|
+
border-color: var(--primary-hover-color);
|
|
42
|
+
}
|
|
43
|
+
.lm_filter_wrapper .lm_filter_container .lm_filter .lm_filter_custom .lm_filter_custom_select.expand {
|
|
44
|
+
color: var(--text-color);
|
|
45
|
+
border-color: var(--primary-hover-color);
|
|
46
|
+
}
|
|
47
|
+
.lm_filter_wrapper .lm_filter_container .lm_filter .lm_filter_custom .lm_filter_custom_select.expand .lm_filter_custom_select_icon {
|
|
48
|
+
transform: rotateX(180deg);
|
|
49
|
+
}
|
|
50
|
+
.lm_filter_wrapper .lm_filter_container .lm_filter .lm_filter_custom .lm_filter_custom_line {
|
|
51
|
+
width: 1px;
|
|
52
|
+
height: 32px;
|
|
53
|
+
background-color: var(--background-color-hover);
|
|
54
|
+
}
|
|
8
55
|
.lm_filter_wrapper .lm_filter_container .lm_filter .lm_filter_search {
|
|
9
56
|
max-width: 140px;
|
|
10
57
|
}
|
|
@@ -125,28 +172,36 @@
|
|
|
125
172
|
cursor: pointer;
|
|
126
173
|
gap: 8px;
|
|
127
174
|
}
|
|
128
|
-
.ant-dropdown .filter_dropdown .filter_body .filter_item.
|
|
129
|
-
border-top: 1px solid var(--
|
|
175
|
+
.ant-dropdown .filter_dropdown .filter_body .filter_item.last_item {
|
|
176
|
+
border-top: 1px solid var(--line-color);
|
|
130
177
|
}
|
|
131
178
|
.ant-dropdown .filter_dropdown .filter_body .filter_item .filter_item_content {
|
|
132
179
|
flex: auto;
|
|
133
180
|
}
|
|
134
|
-
.ant-dropdown .filter_dropdown .filter_body .filter_item .filter_item_operate
|
|
181
|
+
.ant-dropdown .filter_dropdown .filter_body .filter_item .filter_item_operate {
|
|
182
|
+
display: inline-flex;
|
|
183
|
+
align-items: center;
|
|
184
|
+
gap: 4px;
|
|
185
|
+
}
|
|
186
|
+
.ant-dropdown .filter_dropdown .filter_body .filter_item .filter_item_operate .icon_hover {
|
|
135
187
|
font-size: 16px;
|
|
136
|
-
color: var(--primary-color);
|
|
137
188
|
transition: 0.3s;
|
|
138
189
|
opacity: 0;
|
|
139
190
|
}
|
|
191
|
+
.ant-dropdown .filter_dropdown .filter_body .filter_item .filter_item_operate .icon_hover:hover {
|
|
192
|
+
color: var(--primary-color);
|
|
193
|
+
}
|
|
140
194
|
.ant-dropdown .filter_dropdown .filter_body .filter_item[disabled] {
|
|
141
195
|
display: none;
|
|
142
196
|
}
|
|
143
197
|
.ant-dropdown .filter_dropdown .filter_body .filter_item.checked {
|
|
198
|
+
color: var(--font-color);
|
|
144
199
|
background-color: var(--primary-select-color);
|
|
145
200
|
}
|
|
146
201
|
.ant-dropdown .filter_dropdown .filter_body .filter_item:hover {
|
|
147
|
-
background-color: var(--
|
|
202
|
+
background-color: var(--background-color);
|
|
148
203
|
}
|
|
149
|
-
.ant-dropdown .filter_dropdown .filter_body .filter_item:hover .filter_item_operate .
|
|
204
|
+
.ant-dropdown .filter_dropdown .filter_body .filter_item:hover .filter_item_operate .icon_hover {
|
|
150
205
|
opacity: 1;
|
|
151
206
|
}
|
|
152
207
|
.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
|
}
|