linkmore-design 1.0.55 → 1.0.56
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/CardTable/card/PictureTextRowOperate.d.ts +7 -0
- package/dist/LmFilter/Controls/CheckboxTags.d.ts +6 -0
- package/dist/LmFilter/Controls/index.d.ts +2 -0
- package/dist/LmFilter/LmFilter.d.ts +4 -1
- package/dist/LmFilter/complexFilter/drawer.d.ts +4 -0
- package/dist/LmFilter/complexFilter/index.d.ts +3 -1
- package/dist/LmFilter/complexFilter/valueDrawer.d.ts +4 -0
- package/dist/LmFilter/localization.d.ts +8 -0
- package/dist/Switch/demos/table.d.ts +2 -0
- package/dist/Switch/index.d.ts +2 -1
- package/dist/index.umd.js +25 -14
- package/dist/index.umd.min.js +6 -6
- package/es/CardTable/body/TableBodyCell.js +3 -0
- package/es/CardTable/card/PictureTextRow.js +13 -50
- package/es/CardTable/card/PictureTextRowOperate.js +130 -0
- package/es/CardTable/style/index.css +158 -10
- package/es/LmFilter/Controls/CheckboxTags.js +53 -0
- package/es/LmFilter/Controls/index.js +47 -0
- package/es/LmFilter/LmFilter.js +17 -5
- package/es/LmFilter/complexFilter/drawer.js +376 -0
- package/es/LmFilter/complexFilter/index.js +50 -3
- package/es/LmFilter/complexFilter/valueDrawer.js +238 -0
- package/es/LmFilter/components/DropdownFIlter.js +1 -2
- package/es/LmFilter/filterFns/index.js +22 -3
- package/es/LmFilter/localization.d.ts +8 -0
- package/es/LmFilter/localization.js +12 -0
- package/es/LmFilter/style/style.css +11 -4
- package/es/LmFilter/wrapper/FilterRoot.js +56 -6
- package/es/Switch/index.d.ts +2 -1
- package/es/Switch/index.js +33 -1
- package/es/Switch/style/index.css +41 -0
- package/lib/CardTable/body/TableBodyCell.js +3 -0
- package/lib/CardTable/card/PictureTextRow.js +13 -50
- package/lib/CardTable/card/PictureTextRowOperate.js +130 -0
- package/lib/CardTable/style/index.css +158 -10
- package/lib/LmFilter/Controls/CheckboxTags.js +53 -0
- package/lib/LmFilter/Controls/index.js +47 -0
- package/lib/LmFilter/LmFilter.js +17 -5
- package/lib/LmFilter/complexFilter/drawer.js +376 -0
- package/lib/LmFilter/complexFilter/index.js +50 -3
- package/lib/LmFilter/complexFilter/valueDrawer.js +238 -0
- package/lib/LmFilter/components/DropdownFIlter.js +1 -2
- package/lib/LmFilter/filterFns/index.js +22 -3
- package/lib/LmFilter/localization.d.ts +8 -0
- package/lib/LmFilter/localization.js +19 -0
- package/lib/LmFilter/style/style.css +11 -4
- package/lib/LmFilter/wrapper/FilterRoot.js +56 -6
- package/lib/Switch/index.d.ts +2 -1
- package/lib/Switch/index.js +34 -1
- package/lib/Switch/style/index.css +41 -0
- package/package.json +1 -1
|
@@ -11,8 +11,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
11
11
|
|
|
12
12
|
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
13
13
|
|
|
14
|
-
var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime/helpers/objectDestructuringEmpty"));
|
|
15
|
-
|
|
16
14
|
var _utils = require("../utils");
|
|
17
15
|
|
|
18
16
|
// 核心参数集合
|
|
@@ -20,7 +18,7 @@ var CoreOptions = function CoreOptions(_ref) {
|
|
|
20
18
|
var state = _ref.state,
|
|
21
19
|
dispatch = _ref.dispatch,
|
|
22
20
|
props = _ref.props;
|
|
23
|
-
|
|
21
|
+
var onChange = props.onChange; // 设置筛选的值 item => Object || Array => [{label: '', value: ''}, ...]
|
|
24
22
|
|
|
25
23
|
var setFilterValue = function setFilterValue(item, field) {
|
|
26
24
|
var basicFilter = (0, _objectSpread3.default)((0, _objectSpread3.default)({}, state.basicFilter), {}, (0, _defineProperty2.default)({}, field, item));
|
|
@@ -34,6 +32,27 @@ var CoreOptions = function CoreOptions(_ref) {
|
|
|
34
32
|
type: 'changeBasicFilter',
|
|
35
33
|
basicFilter: basicFilter
|
|
36
34
|
});
|
|
35
|
+
|
|
36
|
+
var formatVK = function formatVK() {
|
|
37
|
+
var obj = {};
|
|
38
|
+
Object.entries(basicFilter).forEach(function (item) {
|
|
39
|
+
if (Array.isArray(item[1])) {
|
|
40
|
+
obj[item[0]] = item[1].map(function (v) {
|
|
41
|
+
return v.value;
|
|
42
|
+
});
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
obj[item[0]] = item[1].value;
|
|
47
|
+
});
|
|
48
|
+
return obj;
|
|
49
|
+
}; // 触发外部事件
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
53
|
+
basicFilter: basicFilter,
|
|
54
|
+
formatVK: formatVK()
|
|
55
|
+
});
|
|
37
56
|
}; // 根据字段查找过滤的数据, 不存在时返回默认值
|
|
38
57
|
|
|
39
58
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DefaultLocalization = void 0;
|
|
7
|
+
// export interface LM_Localization {
|
|
8
|
+
// fieldName: string,
|
|
9
|
+
// operator: number,
|
|
10
|
+
// }
|
|
11
|
+
var DefaultLocalization = {
|
|
12
|
+
globalQuery: {
|
|
13
|
+
filter: []
|
|
14
|
+
},
|
|
15
|
+
filterQuery: {
|
|
16
|
+
filter: []
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
exports.DefaultLocalization = DefaultLocalization;
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
.lm_filter_wrapper .lm_filter_container .lm_filter .lm_filter_search {
|
|
11
11
|
max-width: 140px;
|
|
12
12
|
}
|
|
13
|
+
.lm_filter_wrapper .lm_filter_container .lm_filter .lm_filter_complex {
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
}
|
|
13
16
|
.lm_filter_basic_item {
|
|
14
17
|
display: inline-flex;
|
|
15
18
|
align-items: center;
|
|
@@ -41,18 +44,22 @@
|
|
|
41
44
|
color: var(--text-color);
|
|
42
45
|
transition: 0.3s;
|
|
43
46
|
}
|
|
44
|
-
.lm_filter_basic_item .filter_item_icon
|
|
45
|
-
color: var(--
|
|
47
|
+
.lm_filter_basic_item .filter_item_icon.addon_before {
|
|
48
|
+
color: var(--font-color);
|
|
46
49
|
}
|
|
47
|
-
.lm_filter_basic_item.expand .filter_item_icon {
|
|
50
|
+
.lm_filter_basic_item.expand .filter_item_icon.addon_after {
|
|
48
51
|
transform: rotateX(180deg);
|
|
49
52
|
}
|
|
50
53
|
.lm_filter_basic_item.active .filter_item_value {
|
|
51
54
|
color: var(--primary-color);
|
|
52
55
|
}
|
|
53
|
-
.lm_filter_basic_item.active .filter_item_icon {
|
|
56
|
+
.lm_filter_basic_item.active .filter_item_icon.addon_after {
|
|
54
57
|
transform: rotateX(180deg);
|
|
55
58
|
}
|
|
59
|
+
.lm_filter_basic_item.active.lm_filter_complex_item .filter_item_icon,
|
|
60
|
+
.lm_filter_basic_item.active.lm_filter_complex_item .filter_item_label {
|
|
61
|
+
color: var(--primary-color);
|
|
62
|
+
}
|
|
56
63
|
.ant-dropdown.filter_dropdown_container_cascader > div {
|
|
57
64
|
transform: translateY(-4px);
|
|
58
65
|
}
|
|
@@ -25,7 +25,10 @@ var _filterFns = _interopRequireDefault(require("../filterFns"));
|
|
|
25
25
|
var reducer = function reducer(state, action) {
|
|
26
26
|
var basicFilter = action.basicFilter,
|
|
27
27
|
resize = action.resize,
|
|
28
|
-
rows = action.rows
|
|
28
|
+
rows = action.rows,
|
|
29
|
+
complexDrawer = action.complexDrawer,
|
|
30
|
+
valueDrawer = action.valueDrawer,
|
|
31
|
+
complexFilter = action.complexFilter;
|
|
29
32
|
|
|
30
33
|
switch (action.type) {
|
|
31
34
|
case 'changeBasicFilter':
|
|
@@ -43,6 +46,22 @@ var reducer = function reducer(state, action) {
|
|
|
43
46
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
|
|
44
47
|
resize: resize
|
|
45
48
|
});
|
|
49
|
+
// 高级筛选
|
|
50
|
+
|
|
51
|
+
case 'changeComplexFilter':
|
|
52
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
|
|
53
|
+
complexFilter: complexFilter
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
case 'changeComplexDrawer':
|
|
57
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
|
|
58
|
+
complexDrawer: complexDrawer
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
case 'changeValueDrawer':
|
|
62
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
|
|
63
|
+
valueDrawer: valueDrawer
|
|
64
|
+
});
|
|
46
65
|
|
|
47
66
|
case 'reset':
|
|
48
67
|
// 一键清空
|
|
@@ -53,12 +72,43 @@ var reducer = function reducer(state, action) {
|
|
|
53
72
|
default:
|
|
54
73
|
throw new Error();
|
|
55
74
|
}
|
|
56
|
-
}; //
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
75
|
+
}; // const getRows = ({ fieldName, value }, arr) => {
|
|
76
|
+
// const findItem = arr.find(item => {
|
|
77
|
+
// return item.field === fieldName;
|
|
78
|
+
// })
|
|
79
|
+
// switch (findItem.type) {
|
|
80
|
+
// case 'input':
|
|
81
|
+
// return value;
|
|
82
|
+
// case 'select':
|
|
83
|
+
// return findItem.data.find(v => v.value === value);
|
|
84
|
+
// case 'checkbox':
|
|
85
|
+
// return findItem.data.find(v => [value].includes(v.value));
|
|
86
|
+
// default:
|
|
87
|
+
// break;
|
|
88
|
+
// }
|
|
89
|
+
// };
|
|
90
|
+
// 仅在初始化时触发一次
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
var getInitialState = function getInitialState(_ref) {
|
|
94
|
+
var localization = _ref.localization;
|
|
95
|
+
var globalQuery = localization.globalQuery,
|
|
96
|
+
filterQuery = localization.filterQuery;
|
|
97
|
+
var basicFilter = {};
|
|
98
|
+
filterQuery.filter.forEach(function (item) {
|
|
99
|
+
basicFilter[item.fieldName] = item.value;
|
|
100
|
+
});
|
|
60
101
|
return {
|
|
61
|
-
basicFilter:
|
|
102
|
+
basicFilter: basicFilter,
|
|
103
|
+
complexFilter: {},
|
|
104
|
+
complexDrawer: {
|
|
105
|
+
visible: false,
|
|
106
|
+
data: {}
|
|
107
|
+
},
|
|
108
|
+
valueDrawer: {
|
|
109
|
+
visible: false,
|
|
110
|
+
data: {}
|
|
111
|
+
}
|
|
62
112
|
};
|
|
63
113
|
};
|
|
64
114
|
|
package/lib/Switch/index.d.ts
CHANGED
package/lib/Switch/index.js
CHANGED
|
@@ -11,5 +11,38 @@ require("antd/es/switch/style");
|
|
|
11
11
|
|
|
12
12
|
var _switch = _interopRequireDefault(require("antd/es/switch"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
+
|
|
16
|
+
var _react = _interopRequireDefault(require("react"));
|
|
17
|
+
|
|
18
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
19
|
+
|
|
20
|
+
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
21
|
+
var t = {};
|
|
22
|
+
|
|
23
|
+
for (var p in s) {
|
|
24
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
28
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
29
|
+
}
|
|
30
|
+
return t;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
var Switch = function Switch(props) {
|
|
34
|
+
var _props$size = props.size,
|
|
35
|
+
size = _props$size === void 0 ? 'default' : _props$size,
|
|
36
|
+
className = props.className,
|
|
37
|
+
restProps = __rest(props, ["size", "className"]);
|
|
38
|
+
|
|
39
|
+
var classs = (0, _classnames.default)('lm-switch', className, (0, _defineProperty2.default)({}, "lm-switch-".concat(size), size));
|
|
40
|
+
return /*#__PURE__*/_react.default.createElement(_switch.default, Object.assign({
|
|
41
|
+
className: classs
|
|
42
|
+
}, restProps, {
|
|
43
|
+
size: size
|
|
44
|
+
}));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var _default = Switch;
|
|
15
48
|
exports.default = _default;
|
|
@@ -503,3 +503,44 @@ html {
|
|
|
503
503
|
.card_cell_content:hover .card_cell_body .card_cell_checkbox {
|
|
504
504
|
opacity: 1;
|
|
505
505
|
}
|
|
506
|
+
.ant-switch.lm-switch {
|
|
507
|
+
width: 48px;
|
|
508
|
+
height: 24px;
|
|
509
|
+
line-height: 24px;
|
|
510
|
+
margin-bottom: 8px;
|
|
511
|
+
background: rgba(0, 0, 0, 0.25);
|
|
512
|
+
}
|
|
513
|
+
.ant-switch.lm-switch .ant-switch-handle {
|
|
514
|
+
width: 20px;
|
|
515
|
+
height: 20px;
|
|
516
|
+
}
|
|
517
|
+
.ant-switch.lm-switch .ant-switch-handle::before {
|
|
518
|
+
border-radius: 10px;
|
|
519
|
+
}
|
|
520
|
+
.ant-switch.lm-switch.ant-switch-checked {
|
|
521
|
+
background: #1890ff;
|
|
522
|
+
}
|
|
523
|
+
.ant-switch.lm-switch.ant-switch-checked .ant-switch-handle {
|
|
524
|
+
left: calc(100% - 20px - 2px);
|
|
525
|
+
}
|
|
526
|
+
.ant-switch.lm-switch.ant-switch-checked.ant-switch-disabled {
|
|
527
|
+
background: #C5E3FE;
|
|
528
|
+
}
|
|
529
|
+
.ant-switch.lm-switch.ant-switch-disabled {
|
|
530
|
+
background: rgba(0, 0, 0, 0.06);
|
|
531
|
+
opacity: 1;
|
|
532
|
+
}
|
|
533
|
+
.ant-switch.lm-switch-small {
|
|
534
|
+
width: 28px;
|
|
535
|
+
height: 16px;
|
|
536
|
+
}
|
|
537
|
+
.ant-switch.lm-switch-small .ant-switch-handle {
|
|
538
|
+
width: 12px;
|
|
539
|
+
height: 12px;
|
|
540
|
+
}
|
|
541
|
+
.ant-switch.lm-switch-small .ant-switch-handle::before {
|
|
542
|
+
border-radius: 6px;
|
|
543
|
+
}
|
|
544
|
+
.ant-switch.lm-switch-small.ant-switch-checked .ant-switch-handle {
|
|
545
|
+
left: calc(100% - 12px - 2px);
|
|
546
|
+
}
|