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,7 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
|
-
import "antd/es/form/style";
|
|
4
|
-
import _Form from "antd/es/form";
|
|
5
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
5
|
|
|
@@ -55,13 +53,15 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
55
53
|
import { PlusCircleOutlined } from '@ant-design/icons';
|
|
56
54
|
import moment from 'moment';
|
|
57
55
|
import { arrayMove } from '@dnd-kit/sortable';
|
|
58
|
-
import { Button, Checkbox, IconFont, Input, InputNumber, Radio, Select, Table, Switch, DatePicker } from 'linkmore-design';
|
|
56
|
+
import { Button, Checkbox, IconFont, Input, InputNumber, Radio, Select, Table, Switch, DatePicker, Form } from 'linkmore-design';
|
|
59
57
|
import { get, set } from 'lodash';
|
|
60
58
|
import React, { forwardRef, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState, memo, useCallback } from 'react';
|
|
61
59
|
import { produce } from 'immer';
|
|
62
60
|
import DndContainer from './DndContainer';
|
|
63
61
|
import SortableBox from './sortableBox';
|
|
62
|
+
import SortableBoxCol from './sortableBoxCol';
|
|
64
63
|
import SortableItem from './sortableItem';
|
|
64
|
+
import ColSortableItem from './sortableItemCol';
|
|
65
65
|
import DragHandle from './DragHandle';
|
|
66
66
|
import UploadOss from '../UploadOss';
|
|
67
67
|
var UploadBtn = UploadOss.UploadBtn;
|
|
@@ -71,11 +71,11 @@ var EditableRow = function EditableRow(_a) {
|
|
|
71
71
|
var index = _a.index,
|
|
72
72
|
props = __rest(_a, ["index"]);
|
|
73
73
|
|
|
74
|
-
var _Form$useForm =
|
|
74
|
+
var _Form$useForm = Form.useForm(),
|
|
75
75
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
76
76
|
form = _Form$useForm2[0];
|
|
77
77
|
|
|
78
|
-
return /*#__PURE__*/React.createElement(
|
|
78
|
+
return /*#__PURE__*/React.createElement(Form, {
|
|
79
79
|
form: form,
|
|
80
80
|
component: false
|
|
81
81
|
}, /*#__PURE__*/React.createElement(EditableContext.Provider, {
|
|
@@ -87,11 +87,11 @@ var EditableSortRow = function EditableSortRow(_a) {
|
|
|
87
87
|
var index = _a.index,
|
|
88
88
|
props = __rest(_a, ["index"]);
|
|
89
89
|
|
|
90
|
-
var _Form$useForm3 =
|
|
90
|
+
var _Form$useForm3 = Form.useForm(),
|
|
91
91
|
_Form$useForm4 = _slicedToArray(_Form$useForm3, 1),
|
|
92
92
|
form = _Form$useForm4[0];
|
|
93
93
|
|
|
94
|
-
return /*#__PURE__*/React.createElement(
|
|
94
|
+
return /*#__PURE__*/React.createElement(Form, {
|
|
95
95
|
form: form,
|
|
96
96
|
component: false
|
|
97
97
|
}, /*#__PURE__*/React.createElement(EditableContext.Provider, {
|
|
@@ -238,10 +238,11 @@ var EditableCell = function EditableCell(props) {
|
|
|
238
238
|
handleSave = props.handleSave,
|
|
239
239
|
handleAdd = props.handleAdd,
|
|
240
240
|
handleDelete = props.handleDelete,
|
|
241
|
+
handleCopy = props.handleCopy,
|
|
241
242
|
itemProps = props.itemProps,
|
|
242
243
|
setValid = props.setValid,
|
|
243
244
|
reWriteOriginSource = props.reWriteOriginSource,
|
|
244
|
-
restProps = __rest(props, ["record", "rowKey", "isEdit", "col", "handleTableRowDelete", "handleTableRowAdd", "getLength", "isHoverEdit", "editEnum", "valueType", "children", "handleSave", "handleAdd", "handleDelete", "itemProps", "setValid", "reWriteOriginSource"]);
|
|
245
|
+
restProps = __rest(props, ["record", "rowKey", "isEdit", "col", "handleTableRowDelete", "handleTableRowAdd", "getLength", "isHoverEdit", "editEnum", "valueType", "children", "handleSave", "handleAdd", "handleDelete", "handleCopy", "itemProps", "setValid", "reWriteOriginSource"]);
|
|
245
246
|
/** 去除移入移出功能,保留最纯粹的功能,优化性能 */
|
|
246
247
|
|
|
247
248
|
|
|
@@ -250,7 +251,8 @@ var EditableCell = function EditableCell(props) {
|
|
|
250
251
|
clearProps = __rest(restProps, ["onMouseEnter", "onMouseLeave"]);
|
|
251
252
|
|
|
252
253
|
var _col$componentProps = col.componentProps,
|
|
253
|
-
componentProps = _col$componentProps === void 0 ? {} : _col$componentProps
|
|
254
|
+
componentProps = _col$componentProps === void 0 ? {} : _col$componentProps,
|
|
255
|
+
dataIndex = col.dataIndex; // const checkCellRef = useRef(null)
|
|
254
256
|
// const focusCapturedRef = useRef(false);
|
|
255
257
|
// const curValue = useMemo(() => {
|
|
256
258
|
// return record?.dataIndex
|
|
@@ -265,50 +267,76 @@ var EditableCell = function EditableCell(props) {
|
|
|
265
267
|
while (1) {
|
|
266
268
|
switch (_context.prev = _context.next) {
|
|
267
269
|
case 0:
|
|
268
|
-
|
|
269
|
-
_context.prev = 1;
|
|
270
|
+
_context.prev = 0;
|
|
270
271
|
_context.t0 = row;
|
|
271
272
|
|
|
272
273
|
if (_context.t0) {
|
|
273
|
-
_context.next =
|
|
274
|
+
_context.next = 6;
|
|
274
275
|
break;
|
|
275
276
|
}
|
|
276
277
|
|
|
277
|
-
_context.next =
|
|
278
|
+
_context.next = 5;
|
|
278
279
|
return form.getFieldsValue();
|
|
279
280
|
|
|
280
|
-
case
|
|
281
|
+
case 5:
|
|
281
282
|
_context.t0 = _context.sent;
|
|
282
283
|
|
|
283
|
-
case
|
|
284
|
+
case 6:
|
|
284
285
|
values = _context.t0;
|
|
285
|
-
|
|
286
|
-
console.time('testForEach');
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
286
|
+
|
|
287
|
+
// console.time('testForEach');
|
|
288
|
+
|
|
289
|
+
/** 如果属于中有唯一性,并且当前的值与唯一值不一致,则改变其他的 */
|
|
290
|
+
if (componentProps.isOnlyValue !== undefined && values[dataIndex] !== record[dataIndex] && ![undefined, null].includes(values[dataIndex])) {
|
|
291
|
+
handleSave(Object.assign(Object.assign(Object.assign({}, record), values), _defineProperty({}, rowKey, record === null || record === void 0 ? void 0 : record[rowKey])), {
|
|
292
|
+
only: {
|
|
293
|
+
key: dataIndex,
|
|
294
|
+
value: componentProps.isOnlyValue
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
} else {
|
|
298
|
+
handleSave(Object.assign(Object.assign(Object.assign({}, record), values), _defineProperty({}, rowKey, record === null || record === void 0 ? void 0 : record[rowKey])));
|
|
299
|
+
} // console.timeEnd('testForEach');
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
_context.next = 10;
|
|
290
303
|
return form.validateFields();
|
|
291
304
|
|
|
292
|
-
case
|
|
293
|
-
_context.next =
|
|
305
|
+
case 10:
|
|
306
|
+
_context.next = 14;
|
|
294
307
|
break;
|
|
295
308
|
|
|
296
|
-
case
|
|
297
|
-
_context.prev =
|
|
298
|
-
_context.t1 = _context["catch"](
|
|
309
|
+
case 12:
|
|
310
|
+
_context.prev = 12;
|
|
311
|
+
_context.t1 = _context["catch"](0);
|
|
299
312
|
|
|
300
|
-
case
|
|
313
|
+
case 14:
|
|
301
314
|
case "end":
|
|
302
315
|
return _context.stop();
|
|
303
316
|
}
|
|
304
317
|
}
|
|
305
|
-
}, _callee, null, [[
|
|
318
|
+
}, _callee, null, [[0, 12]]);
|
|
306
319
|
}));
|
|
307
320
|
}; // 触发保存
|
|
308
321
|
|
|
309
322
|
|
|
310
323
|
var handleFormItemChange = function handleFormItemChange(e) {
|
|
311
|
-
save === null || save === void 0 ? void 0 : save();
|
|
324
|
+
save === null || save === void 0 ? void 0 : save(); // const { dataIndex } = col
|
|
325
|
+
// if (componentProps.isOnlyValue !== undefined) {
|
|
326
|
+
// console.log(777)
|
|
327
|
+
// handleCopy?.(dataIndex, componentProps.isOnlyValue)
|
|
328
|
+
// } else {
|
|
329
|
+
// save?.()
|
|
330
|
+
// }
|
|
331
|
+
};
|
|
332
|
+
/** 快捷刷子,把当前的所有列的值,刷成当前的选中的列 */
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
var copyKey = function copyKey(e) {
|
|
336
|
+
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
|
337
|
+
console.log(rowKey, record[rowKey], 'fff');
|
|
338
|
+
var dataIndex = col.dataIndex;
|
|
339
|
+
handleCopy === null || handleCopy === void 0 ? void 0 : handleCopy(dataIndex, record[dataIndex]);
|
|
312
340
|
};
|
|
313
341
|
|
|
314
342
|
var Control = function Control(con) {
|
|
@@ -320,17 +348,21 @@ var EditableCell = function EditableCell(props) {
|
|
|
320
348
|
// ref={checkCellRef}
|
|
321
349
|
placeholder: "\u8BF7\u8F93\u5165"
|
|
322
350
|
}, componentProps, {
|
|
323
|
-
addonBefore: componentProps.addonBefore ? /*#__PURE__*/React.createElement(
|
|
351
|
+
addonBefore: componentProps.addonBefore ? /*#__PURE__*/React.createElement(Form.Item, {
|
|
324
352
|
name: [col.dataIndex, 'addonBeforeValue'],
|
|
325
353
|
noStyle: true
|
|
326
354
|
}, /*#__PURE__*/React.cloneElement(componentProps.addonBefore, {
|
|
327
355
|
onChange: handleFormItemChange
|
|
328
356
|
})) : null,
|
|
329
|
-
addonAfter: componentProps.addonAfter ? /*#__PURE__*/React.createElement(
|
|
357
|
+
addonAfter: componentProps.addonAfter ? /*#__PURE__*/React.createElement(Form.Item, {
|
|
330
358
|
name: [col.dataIndex, 'addonAfterValue'],
|
|
331
359
|
noStyle: true
|
|
332
360
|
}, /*#__PURE__*/React.cloneElement(componentProps.addonAfter, {
|
|
333
361
|
onChange: handleFormItemChange
|
|
362
|
+
})) : null,
|
|
363
|
+
suffix: componentProps.quickcopy ? /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(IconFont, {
|
|
364
|
+
onClick: copyKey,
|
|
365
|
+
type: 'lmweb-icon_m_brush'
|
|
334
366
|
})) : null
|
|
335
367
|
}));
|
|
336
368
|
|
|
@@ -443,7 +475,9 @@ var EditableCell = function EditableCell(props) {
|
|
|
443
475
|
var childNode = children;
|
|
444
476
|
|
|
445
477
|
if (isEdit && editable) {
|
|
446
|
-
childNode = /*#__PURE__*/React.createElement(
|
|
478
|
+
childNode = /*#__PURE__*/React.createElement(Form.Item, Object.assign({
|
|
479
|
+
errorPlacement: "right",
|
|
480
|
+
valuePropName: editable === 'switch' ? 'checked' : 'value',
|
|
447
481
|
style: {
|
|
448
482
|
margin: 0
|
|
449
483
|
}
|
|
@@ -452,7 +486,8 @@ var EditableCell = function EditableCell(props) {
|
|
|
452
486
|
}), Control(editable));
|
|
453
487
|
|
|
454
488
|
if (editable === 'input' && ((componentProps === null || componentProps === void 0 ? void 0 : componentProps.addonBefore) || (componentProps === null || componentProps === void 0 ? void 0 : componentProps.addonAfter))) {
|
|
455
|
-
childNode = /*#__PURE__*/React.createElement(
|
|
489
|
+
childNode = /*#__PURE__*/React.createElement(Form.Item, Object.assign({
|
|
490
|
+
errorPlacement: "right",
|
|
456
491
|
style: {
|
|
457
492
|
margin: 0
|
|
458
493
|
}
|
|
@@ -471,9 +506,17 @@ var EditableCell = function EditableCell(props) {
|
|
|
471
506
|
var editable = col.editable,
|
|
472
507
|
dataIndex = col.dataIndex;
|
|
473
508
|
|
|
474
|
-
if (isEdit && editable
|
|
509
|
+
if (isEdit && editable) {
|
|
475
510
|
form.setFieldsValue(_defineProperty({}, dataIndex, editable === 'date' ? moment(record[dataIndex]) : record[dataIndex]));
|
|
476
|
-
}
|
|
511
|
+
} // if (
|
|
512
|
+
// (isEdit && editable && record[dataIndex]) ||
|
|
513
|
+
// (isHoverEdit && editable && record[dataIndex])
|
|
514
|
+
// ) {
|
|
515
|
+
// form.setFieldsValue({
|
|
516
|
+
// [dataIndex]: editable === 'date' ? moment(record[dataIndex]) : record[dataIndex],
|
|
517
|
+
// })
|
|
518
|
+
// }
|
|
519
|
+
|
|
477
520
|
}, [record]); // const isOpenEdit = (isEdit && focusCapturedRef.current) || (isHoverEdit && focusCapturedRef.current);
|
|
478
521
|
// const classNames = cx({
|
|
479
522
|
// 'lm_base_editTable_cell': true,
|
|
@@ -524,9 +567,11 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
524
567
|
useQuickOpetate = props.useQuickOpetate,
|
|
525
568
|
rowSelection = props.rowSelection,
|
|
526
569
|
sortOpen = props.sortOpen,
|
|
570
|
+
colSortOpen = props.colSortOpen,
|
|
571
|
+
filterChange = props.filterChange,
|
|
527
572
|
_props$size = props.size,
|
|
528
573
|
size = _props$size === void 0 ? 'small' : _props$size,
|
|
529
|
-
resetProps = __rest(props, ["value", "columns", "isEdit", "isAdd", "onChange", "rowKey", "rowHoverEdit", "isUseForm", "isHoverEdit", "useQuickOpetate", "rowSelection", "sortOpen", "size"]);
|
|
574
|
+
resetProps = __rest(props, ["value", "columns", "isEdit", "isAdd", "onChange", "rowKey", "rowHoverEdit", "isUseForm", "isHoverEdit", "useQuickOpetate", "rowSelection", "sortOpen", "colSortOpen", "filterChange", "size"]);
|
|
530
575
|
|
|
531
576
|
var _useState = useState([]),
|
|
532
577
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -567,6 +612,22 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
567
612
|
} else {
|
|
568
613
|
setDataSource(arrayMove(cloneArr, oldIndex, newIndex));
|
|
569
614
|
}
|
|
615
|
+
};
|
|
616
|
+
|
|
617
|
+
var onColSortEnd = function onColSortEnd(active, over) {
|
|
618
|
+
console.log(active, over, 2223);
|
|
619
|
+
var oldIndex = columns.findIndex(function (item) {
|
|
620
|
+
return item.dataIndex === active;
|
|
621
|
+
});
|
|
622
|
+
var newIndex = columns.findIndex(function (item) {
|
|
623
|
+
return item.dataIndex === over;
|
|
624
|
+
});
|
|
625
|
+
console.log(arrayMove(columns, oldIndex, newIndex), 222);
|
|
626
|
+
filterChange === null || filterChange === void 0 ? void 0 : filterChange(arrayMove(columns, oldIndex, newIndex).map(function (item, index) {
|
|
627
|
+
return Object.assign(Object.assign({}, item), {
|
|
628
|
+
order: index
|
|
629
|
+
});
|
|
630
|
+
}));
|
|
570
631
|
}; // 删除
|
|
571
632
|
|
|
572
633
|
|
|
@@ -625,26 +686,36 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
625
686
|
(_a = rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.onChange) === null || _a === void 0 ? void 0 : _a.call(rowSelection, selectRows);
|
|
626
687
|
};
|
|
627
688
|
|
|
628
|
-
var handleSave = function handleSave(row) {
|
|
689
|
+
var handleSave = function handleSave(row, options) {
|
|
629
690
|
var res = produce(dataSourceRef.current, function (draft) {
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
691
|
+
if (options === null || options === void 0 ? void 0 : options.only) {
|
|
692
|
+
var _ref2 = options === null || options === void 0 ? void 0 : options.only,
|
|
693
|
+
key = _ref2.key,
|
|
694
|
+
value = _ref2.value;
|
|
695
|
+
|
|
696
|
+
draft.forEach(function (item, index) {
|
|
697
|
+
if (row[_rowKey] === item[_rowKey]) {
|
|
698
|
+
draft[index] = row;
|
|
699
|
+
} else {
|
|
700
|
+
draft[index][key] = value;
|
|
701
|
+
}
|
|
702
|
+
});
|
|
703
|
+
} else {
|
|
704
|
+
var index = draft.findIndex(function (item) {
|
|
705
|
+
return row[_rowKey] === item[_rowKey];
|
|
706
|
+
});
|
|
633
707
|
|
|
634
|
-
|
|
635
|
-
|
|
708
|
+
if (index !== -1) {
|
|
709
|
+
draft[index] = row;
|
|
710
|
+
}
|
|
636
711
|
}
|
|
637
712
|
});
|
|
638
|
-
console.time('b');
|
|
639
|
-
console.log(res, 'rrrr');
|
|
640
713
|
|
|
641
714
|
if (onChange) {
|
|
642
715
|
onChange === null || onChange === void 0 ? void 0 : onChange(res);
|
|
643
716
|
} else {
|
|
644
717
|
setDataSource(res);
|
|
645
718
|
}
|
|
646
|
-
|
|
647
|
-
console.timeEnd('b');
|
|
648
719
|
};
|
|
649
720
|
|
|
650
721
|
var reWriteOriginSource = function reWriteOriginSource(rowKey, rowValue, dataIndex, nextValue) {
|
|
@@ -714,6 +785,20 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
714
785
|
}
|
|
715
786
|
};
|
|
716
787
|
|
|
788
|
+
var handleCopy = function handleCopy(key, value) {
|
|
789
|
+
var res = produce(dataSourceRef.current, function (draft) {
|
|
790
|
+
draft.forEach(function (item) {
|
|
791
|
+
return item[key] = value;
|
|
792
|
+
});
|
|
793
|
+
});
|
|
794
|
+
|
|
795
|
+
if (onChange) {
|
|
796
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(res);
|
|
797
|
+
} else {
|
|
798
|
+
setDataSource(res);
|
|
799
|
+
}
|
|
800
|
+
};
|
|
801
|
+
|
|
717
802
|
var resultColumns = useMemo(function () {
|
|
718
803
|
var localColumns = [sortOpen ? {
|
|
719
804
|
title: '',
|
|
@@ -787,6 +872,7 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
787
872
|
isHoverEdit: isHoverEdit,
|
|
788
873
|
handleAdd: handleAdd,
|
|
789
874
|
handleDelete: handleDelete,
|
|
875
|
+
handleCopy: handleCopy,
|
|
790
876
|
editEnum: typeof col.editEnum === 'function' ? col.editEnum(record) : col.editEnum,
|
|
791
877
|
valueType: typeof col.valueType === 'function' ? col.valueType(record) : col.valueType,
|
|
792
878
|
handleSave: handleSave,
|
|
@@ -808,10 +894,39 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
808
894
|
items: (_b = dataSourceRef.current) === null || _b === void 0 ? void 0 : _b.map(function (item) {
|
|
809
895
|
return item[_rowKey];
|
|
810
896
|
})
|
|
811
|
-
}, /*#__PURE__*/React.createElement("tbody", Object.assign({}, props))))
|
|
812
|
-
;
|
|
897
|
+
}, /*#__PURE__*/React.createElement("tbody", Object.assign({}, props))));
|
|
813
898
|
}, [sortEditTable]);
|
|
899
|
+
var colDraggableContainer = useCallback(function (_a) {
|
|
900
|
+
var props = __rest(_a, []);
|
|
901
|
+
|
|
902
|
+
return /*#__PURE__*/React.createElement("tr", null, React.Children.map(props.children, function (child) {
|
|
903
|
+
var _a, _b;
|
|
904
|
+
|
|
905
|
+
if ((_b = (_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.column) === null || _b === void 0 ? void 0 : _b.fixed) {
|
|
906
|
+
return child;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
return /*#__PURE__*/React.createElement(ColSortableItem, {
|
|
910
|
+
id: child.key
|
|
911
|
+
}, child);
|
|
912
|
+
}));
|
|
913
|
+
}, [columns]);
|
|
814
914
|
var config = useMemo(function () {
|
|
915
|
+
var component = {
|
|
916
|
+
body: Object.assign({
|
|
917
|
+
row: sortOpen ? EditableSortRow : EditableRow,
|
|
918
|
+
cell: EditableCell
|
|
919
|
+
}, sortOpen ? {
|
|
920
|
+
wrapper: DraggableContainer
|
|
921
|
+
} : {})
|
|
922
|
+
};
|
|
923
|
+
|
|
924
|
+
if (colSortOpen) {
|
|
925
|
+
component['header'] = {
|
|
926
|
+
row: colDraggableContainer
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
|
|
815
930
|
return Object.assign({
|
|
816
931
|
pagination: false,
|
|
817
932
|
tableLayout: 'fixed',
|
|
@@ -821,17 +936,9 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
821
936
|
rowKey: function rowKey(record) {
|
|
822
937
|
return record[_rowKey] || record.index || Math.random();
|
|
823
938
|
},
|
|
824
|
-
components:
|
|
825
|
-
body: Object.assign({
|
|
826
|
-
row: sortOpen ? EditableSortRow : EditableRow,
|
|
827
|
-
cell: EditableCell // wrapper: DraggableContainer
|
|
828
|
-
|
|
829
|
-
}, sortOpen ? {
|
|
830
|
-
wrapper: DraggableContainer
|
|
831
|
-
} : {})
|
|
832
|
-
}
|
|
939
|
+
components: component
|
|
833
940
|
}, resetProps);
|
|
834
|
-
}, [resultColumns, dataSource, sortOpen, size]);
|
|
941
|
+
}, [resultColumns, dataSource, sortOpen, colSortOpen, size]);
|
|
835
942
|
useEffect(function () {
|
|
836
943
|
setDataSource(defaultData === null || defaultData === void 0 ? void 0 : defaultData.map(function (v, idx) {
|
|
837
944
|
return Object.assign(Object.assign({}, v), _defineProperty({}, _rowKey, v[_rowKey] || "v".concat(idx + 1)));
|
|
@@ -847,7 +954,48 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
847
954
|
});
|
|
848
955
|
var isShowAddAction = useMemo(function () {
|
|
849
956
|
return isEdit && isAdd || isHoverEdit && isAdd;
|
|
850
|
-
}, [isEdit, isAdd, isHoverEdit]);
|
|
957
|
+
}, [isEdit, isAdd, isHoverEdit]);
|
|
958
|
+
|
|
959
|
+
if (colSortOpen) {
|
|
960
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
961
|
+
className: "lm_editTable_warpper"
|
|
962
|
+
}, /*#__PURE__*/React.createElement(DndContainer, {
|
|
963
|
+
move: onColSortEnd
|
|
964
|
+
}, /*#__PURE__*/React.createElement(SortableBoxCol, {
|
|
965
|
+
items: columns.reduce(function (acc, item) {
|
|
966
|
+
return [].concat(_toConsumableArray(acc), [item.dataIndex]);
|
|
967
|
+
}, [])
|
|
968
|
+
}, /*#__PURE__*/React.createElement(Table, Object.assign({}, config, {
|
|
969
|
+
size: size || 'small',
|
|
970
|
+
columns: resultColumns,
|
|
971
|
+
rowClassName: "editable-row",
|
|
972
|
+
bordered: true,
|
|
973
|
+
pagination: false,
|
|
974
|
+
// components={tableComponents}
|
|
975
|
+
rowSelection: !rowSelection ? undefined : {
|
|
976
|
+
fixed: true,
|
|
977
|
+
type: 'checkbox',
|
|
978
|
+
columnWidth: 36,
|
|
979
|
+
selectedRowKeys: localRowSelectList.map(function (v) {
|
|
980
|
+
return v[_rowKey];
|
|
981
|
+
}),
|
|
982
|
+
onChange: function onChange(selectedRowKeys, selectedRows) {
|
|
983
|
+
editTableRowChange(selectedRows);
|
|
984
|
+
}
|
|
985
|
+
},
|
|
986
|
+
dataSource: dataSource
|
|
987
|
+
})))), isShowAddAction && /*#__PURE__*/React.createElement(Button, {
|
|
988
|
+
className: "lm_editTable_add_bar",
|
|
989
|
+
type: "dashed",
|
|
990
|
+
onClick: handleAdd,
|
|
991
|
+
style: {
|
|
992
|
+
marginTop: 8
|
|
993
|
+
}
|
|
994
|
+
}, /*#__PURE__*/React.createElement(PlusCircleOutlined, {
|
|
995
|
+
className: "lmweb-plus"
|
|
996
|
+
}), "\u65B0\u589E"));
|
|
997
|
+
} // @ts-ignore
|
|
998
|
+
|
|
851
999
|
|
|
852
1000
|
return /*#__PURE__*/React.createElement("div", {
|
|
853
1001
|
className: "lm_editTable_warpper"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SortableContext, horizontalListSortingStrategy } from '@dnd-kit/sortable';
|
|
3
|
+
|
|
4
|
+
var SortableBox = function SortableBox(_ref) {
|
|
5
|
+
var items = _ref.items,
|
|
6
|
+
children = _ref.children;
|
|
7
|
+
return /*#__PURE__*/React.createElement(SortableContext, {
|
|
8
|
+
items: items,
|
|
9
|
+
strategy: horizontalListSortingStrategy
|
|
10
|
+
}, children);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default SortableBox;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function SortableItem(props: any): JSX.Element;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
|
|
4
|
+
for (var p in s) {
|
|
5
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
9
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
import React, { forwardRef } from 'react';
|
|
15
|
+
import { useSortable } from '@dnd-kit/sortable';
|
|
16
|
+
import { CSS } from '@dnd-kit/utilities';
|
|
17
|
+
var Item = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
18
|
+
var children = _a.children,
|
|
19
|
+
props = __rest(_a, ["children"]);
|
|
20
|
+
|
|
21
|
+
return /*#__PURE__*/React.createElement("th", Object.assign({}, props, {
|
|
22
|
+
ref: ref
|
|
23
|
+
}), children);
|
|
24
|
+
});
|
|
25
|
+
export default function SortableItem(props) {
|
|
26
|
+
var _useSortable = useSortable({
|
|
27
|
+
id: props.id
|
|
28
|
+
}),
|
|
29
|
+
attributes = _useSortable.attributes,
|
|
30
|
+
listeners = _useSortable.listeners,
|
|
31
|
+
setNodeRef = _useSortable.setNodeRef,
|
|
32
|
+
transform = _useSortable.transform,
|
|
33
|
+
transition = _useSortable.transition;
|
|
34
|
+
|
|
35
|
+
var style = {
|
|
36
|
+
position: 'relative',
|
|
37
|
+
transform: CSS.Translate.toString(transform),
|
|
38
|
+
transition: transition,
|
|
39
|
+
padding: 0,
|
|
40
|
+
touchAction: 'none',
|
|
41
|
+
height: '40px',
|
|
42
|
+
cursor: 'move'
|
|
43
|
+
};
|
|
44
|
+
return /*#__PURE__*/React.createElement(Item, Object.assign({
|
|
45
|
+
ref: setNodeRef,
|
|
46
|
+
style: style
|
|
47
|
+
}, attributes, listeners, props));
|
|
48
|
+
}
|
package/es/LmFilter/LmFilter.js
CHANGED
|
@@ -19,7 +19,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
19
19
|
|
|
20
20
|
var _FilterRoot = _interopRequireDefault(require("./wrapper/FilterRoot"));
|
|
21
21
|
|
|
22
|
-
var _localization = require("./localization
|
|
22
|
+
var _localization = require("./localization");
|
|
23
23
|
|
|
24
24
|
var _excluded = ["localization"];
|
|
25
25
|
|
|
@@ -28,10 +28,28 @@ var LmFilter = function LmFilter(_ref, ref) {
|
|
|
28
28
|
localization = _ref$localization === void 0 ? {} : _ref$localization,
|
|
29
29
|
resetProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
30
30
|
var defaultRef = (0, _react.useRef)(null);
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
var defaultProps = {
|
|
32
|
+
dataSource: [],
|
|
33
|
+
// 数据源
|
|
34
|
+
enableSearch: true,
|
|
35
|
+
// 是否启用模糊查询
|
|
36
|
+
enableBaisc: true,
|
|
37
|
+
// 是否启用基础筛选
|
|
38
|
+
enableComplex: false,
|
|
39
|
+
// 是否启用高级筛选
|
|
40
|
+
enableCustom: false,
|
|
41
|
+
// 是否启用自定义筛选
|
|
42
|
+
size: 'middle',
|
|
43
|
+
// 尺寸
|
|
44
|
+
searchKey: 'search',
|
|
45
|
+
// 搜索的key值
|
|
46
|
+
placeholder: '请输入',
|
|
47
|
+
// 搜索占位符
|
|
33
48
|
localization: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _localization.DefaultLocalization), localization)
|
|
34
|
-
}
|
|
49
|
+
};
|
|
50
|
+
return /*#__PURE__*/_react.default.createElement(_FilterRoot.default, (0, _extends2.default)({
|
|
51
|
+
ref: ref || defaultRef
|
|
52
|
+
}, defaultProps, resetProps));
|
|
35
53
|
};
|
|
36
54
|
|
|
37
55
|
var _default = /*#__PURE__*/(0, _react.forwardRef)(LmFilter);
|
|
File without changes
|
|
@@ -29,7 +29,12 @@ var FuzzySearch = function FuzzySearch(_ref) {
|
|
|
29
29
|
}, [state.basicFilter]);
|
|
30
30
|
|
|
31
31
|
var onSearch = function onSearch(val) {
|
|
32
|
-
|
|
32
|
+
var item = {
|
|
33
|
+
field: searchKey,
|
|
34
|
+
operator: 'contains',
|
|
35
|
+
fieldType: 'string'
|
|
36
|
+
};
|
|
37
|
+
setFilterValue(val, item);
|
|
33
38
|
};
|
|
34
39
|
|
|
35
40
|
(0, _react.useEffect)(function () {
|
|
@@ -17,9 +17,7 @@ var _components = _interopRequireDefault(require("../components"));
|
|
|
17
17
|
var LmFilterBase = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
18
18
|
var instance = _ref.instance;
|
|
19
19
|
var dataSource = instance.dataSource;
|
|
20
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
21
|
-
className: "lm_filter_basic"
|
|
22
|
-
}, /*#__PURE__*/_react.default.createElement(_fuzzySearch.default, {
|
|
20
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_fuzzySearch.default, {
|
|
23
21
|
instance: instance
|
|
24
22
|
}), dataSource.map(function (v, index) {
|
|
25
23
|
var isHidden = !v.show && typeof v.show === 'boolean';
|
|
@@ -14,13 +14,11 @@ var _linkmoreDesign = require("linkmore-design");
|
|
|
14
14
|
var LmFilterClear = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
15
15
|
var instance = _ref.instance;
|
|
16
16
|
var state = instance.state,
|
|
17
|
-
dispatch = instance.dispatch
|
|
17
|
+
dispatch = instance.dispatch,
|
|
18
|
+
onClearChange = instance.onClearChange;
|
|
18
19
|
|
|
19
20
|
var handleClear = function handleClear() {
|
|
20
|
-
|
|
21
|
-
dispatch({
|
|
22
|
-
type: 'reset'
|
|
23
|
-
});
|
|
21
|
+
onClearChange();
|
|
24
22
|
};
|
|
25
23
|
|
|
26
24
|
return /*#__PURE__*/_react.default.createElement("div", {
|