linkmore-design 1.0.57 → 1.0.58

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.
Files changed (63) hide show
  1. package/dist/CardTable/LmCardTable.d.ts +1 -0
  2. package/dist/Empty/demos/custom.d.ts +2 -0
  3. package/dist/Empty/empty.d.ts +2 -0
  4. package/dist/Empty/index.d.ts +18 -3
  5. package/dist/Empty/simple.d.ts +2 -0
  6. package/dist/LmFilter/utils.d.ts +1 -1
  7. package/dist/index.umd.js +336 -183
  8. package/dist/index.umd.min.js +6 -6
  9. package/es/CardTable/LmCardTable.js +4 -1
  10. package/es/CardTable/card/PictureTextRow.js +8 -3
  11. package/es/CardTable/style/index.css +8 -1
  12. package/es/CustomTableOption/cardSort.js +0 -3
  13. package/es/CustomTableOption/columnsSort.js +2 -4
  14. package/es/CustomTableOption/filterSort.js +0 -3
  15. package/es/CustomTableOption/index.js +2 -2
  16. package/es/Empty/empty.d.ts +2 -0
  17. package/es/Empty/empty.js +55 -0
  18. package/es/Empty/index.d.ts +18 -3
  19. package/es/Empty/index.js +100 -1
  20. package/es/Empty/simple.d.ts +2 -0
  21. package/es/Empty/simple.js +36 -0
  22. package/es/Empty/style/index.css +44 -0
  23. package/es/LmFilter/Controls/index.js +32 -2
  24. package/es/LmFilter/complexFilter/drawer.js +18 -32
  25. package/es/LmFilter/components/CascaderFilter.js +19 -32
  26. package/es/LmFilter/components/CheckboxFilter.js +13 -21
  27. package/es/LmFilter/components/DateFilter.js +50 -22
  28. package/es/LmFilter/components/DropdownFIlter.js +44 -23
  29. package/es/LmFilter/components/SelectFilter.js +2 -3
  30. package/es/LmFilter/components/index.js +5 -61
  31. package/es/LmFilter/filterFns/index.js +17 -17
  32. package/es/LmFilter/style/style.css +2 -1
  33. package/es/LmFilter/utils.js +63 -14
  34. package/es/LmFilter/wrapper/FilterRoot.js +4 -17
  35. package/es/LmTable/Table.js +8 -6
  36. package/lib/CardTable/LmCardTable.js +4 -1
  37. package/lib/CardTable/card/PictureTextRow.js +8 -3
  38. package/lib/CardTable/style/index.css +8 -1
  39. package/lib/CustomTableOption/cardSort.js +0 -3
  40. package/lib/CustomTableOption/columnsSort.js +2 -4
  41. package/lib/CustomTableOption/filterSort.js +0 -3
  42. package/lib/CustomTableOption/index.js +2 -2
  43. package/lib/Empty/empty.d.ts +2 -0
  44. package/lib/Empty/empty.js +66 -0
  45. package/lib/Empty/index.d.ts +18 -3
  46. package/lib/Empty/index.js +107 -1
  47. package/lib/Empty/simple.d.ts +2 -0
  48. package/lib/Empty/simple.js +47 -0
  49. package/lib/Empty/style/index.css +44 -0
  50. package/lib/LmFilter/Controls/index.js +32 -2
  51. package/lib/LmFilter/complexFilter/drawer.js +18 -32
  52. package/lib/LmFilter/components/CascaderFilter.js +19 -32
  53. package/lib/LmFilter/components/CheckboxFilter.js +13 -21
  54. package/lib/LmFilter/components/DateFilter.js +50 -22
  55. package/lib/LmFilter/components/DropdownFIlter.js +44 -23
  56. package/lib/LmFilter/components/SelectFilter.js +2 -3
  57. package/lib/LmFilter/components/index.js +5 -61
  58. package/lib/LmFilter/filterFns/index.js +17 -17
  59. package/lib/LmFilter/style/style.css +2 -1
  60. package/lib/LmFilter/utils.js +63 -14
  61. package/lib/LmFilter/wrapper/FilterRoot.js +4 -17
  62. package/lib/LmTable/Table.js +8 -6
  63. package/package.json +1 -1
@@ -17,7 +17,7 @@ var _react = _interopRequireWildcard(require("react"));
17
17
 
18
18
  var _TableRoot = _interopRequireDefault(require("./table/TableRoot"));
19
19
 
20
- var _excluded = ["cellKey", "type", "height", "virtual", "components", "dataSource", "cellConfig", "checkboxConfig"];
20
+ var _excluded = ["cellKey", "type", "height", "virtual", "ellipsis", "components", "dataSource", "cellConfig", "checkboxConfig"];
21
21
 
22
22
  // export type LmCardTableProps<TData extends Record<string, any> = {}> {
23
23
  // rows: LM_Row<TData>[];
@@ -32,6 +32,8 @@ var LmCardTable = function LmCardTable(_ref, ref) {
32
32
  height = _ref$height === void 0 ? '100%' : _ref$height,
33
33
  _ref$virtual = _ref.virtual,
34
34
  virtual = _ref$virtual === void 0 ? true : _ref$virtual,
35
+ _ref$ellipsis = _ref.ellipsis,
36
+ ellipsis = _ref$ellipsis === void 0 ? true : _ref$ellipsis,
35
37
  _ref$components = _ref.components,
36
38
  components = _ref$components === void 0 ? {} : _ref$components,
37
39
  _ref$dataSource = _ref.dataSource,
@@ -47,6 +49,7 @@ var LmCardTable = function LmCardTable(_ref, ref) {
47
49
  type: type,
48
50
  height: height,
49
51
  virtual: virtual,
52
+ ellipsis: ellipsis,
50
53
  components: components,
51
54
  dataSource: dataSource,
52
55
  cellConfig: cellConfig,
@@ -40,7 +40,8 @@ var PictureTextRow = function PictureTextRow(_ref) {
40
40
  cellClick = table.cellClick,
41
41
  cellDoubleClick = table.cellDoubleClick,
42
42
  toggleCheckboxKey = table.toggleCheckboxKey,
43
- checkboxChange = table.checkboxChange;
43
+ checkboxChange = table.checkboxChange,
44
+ ellipsis = table.ellipsis;
44
45
  var trigger = state.checkboxConfig.trigger;
45
46
  var resetDefaultConfig = (0, _objectSpread2.default)({
46
47
  checkbox: true,
@@ -116,9 +117,13 @@ var PictureTextRow = function PictureTextRow(_ref) {
116
117
  className: "PTR_column_box"
117
118
  }, resetDefaultConfig.columns.map(function (v, idx) {
118
119
  var isVisible = v.show || typeof v.show !== 'boolean';
119
- return isVisible ? /*#__PURE__*/_react.default.createElement("span", {
120
+ return isVisible ? /*#__PURE__*/_react.default.createElement("div", {
120
121
  key: (v === null || v === void 0 ? void 0 : v.dataIndex) || idx
121
- }, v.title, ": ", cell[v.dataIndex]) : null;
122
+ }, v.title, "\uFF1A", /*#__PURE__*/_react.default.createElement("div", {
123
+ className: (0, _classnames.default)({
124
+ ellipsis: ellipsis
125
+ })
126
+ }, typeof v.render === 'function' ? v.render(cell[v.dataIndex], cell, table) : cell[v.dataIndex])) : null;
122
127
  }))) : null, resetDefaultConfig.extend ? /*#__PURE__*/_react.default.createElement("div", {
123
128
  className: "PTR_extend"
124
129
  }, resetDefaultConfig.extend(cell, table)) : null, resetDefaultConfig.desc ? /*#__PURE__*/_react.default.createElement("div", {
@@ -231,14 +231,21 @@
231
231
  font-size: 12px;
232
232
  display: grid;
233
233
  grid-template-columns: repeat(2, 1fr);
234
+ column-gap: 8px;
234
235
  color: var(--color-65);
235
236
  margin-top: 8px;
236
237
  }
237
- .card_PTR .card_PTR_container .card_PTR_body .card_PTR_right .PTR_column .PTR_column_box span {
238
+ .card_PTR .card_PTR_container .card_PTR_body .card_PTR_right .PTR_column .PTR_column_box > div {
238
239
  display: inline-flex;
239
240
  align-items: center;
240
241
  min-height: 20px;
241
242
  }
243
+ .card_PTR .card_PTR_container .card_PTR_body .card_PTR_right .PTR_column .PTR_column_box .ellipsis {
244
+ flex: 1 1 0;
245
+ text-overflow: ellipsis;
246
+ white-space: nowrap;
247
+ overflow: hidden;
248
+ }
242
249
  .card_PTR .card_PTR_container .card_PTR_body .card_PTR_right .PTR_desc {
243
250
  font-size: 12px;
244
251
  color: var(--color-65);
@@ -100,9 +100,6 @@ var FilterSort = /*#__PURE__*/forwardRef(function (_ref, ref) {
100
100
  setSearchValue(searchIngValue);
101
101
  };
102
102
 
103
- useEffect(function () {
104
- console.log(localCard, 'localFilter');
105
- }, [localCard]);
106
103
  useEffect(function () {
107
104
  setLocalCard(card);
108
105
  setColStateValue(cardStateValue);
@@ -45,7 +45,6 @@ var SortItem = function SortItem(props) {
45
45
  type: "lmweb-vertical-align-top",
46
46
  className: "lm_custom_icon hover_show icon_top",
47
47
  onClick: function onClick(e) {
48
- console.log(e, 'eee');
49
48
  e.stopPropagation();
50
49
  props.addFiexd(props.id, 'left');
51
50
  }
@@ -67,8 +66,7 @@ var SortItem = function SortItem(props) {
67
66
 
68
67
 
69
68
  var ColumnsSort = /*#__PURE__*/forwardRef(function (_ref, ref) {
70
- var _ref$columns = _ref.columns,
71
- columns = _ref$columns === void 0 ? [] : _ref$columns,
69
+ var columns = _ref.columns,
72
70
  _ref$ColumnsStateValu = _ref.ColumnsStateValue,
73
71
  ColumnsStateValue = _ref$ColumnsStateValu === void 0 ? {} : _ref$ColumnsStateValu;
74
72
 
@@ -148,7 +146,7 @@ var ColumnsSort = /*#__PURE__*/forwardRef(function (_ref, ref) {
148
146
  };
149
147
 
150
148
  useEffect(function () {
151
- setLocalColumns(columns);
149
+ setLocalColumns(columns || []);
152
150
  setColStateValue(ColumnsStateValue);
153
151
  }, [columns]);
154
152
  var leftSensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
@@ -100,9 +100,6 @@ var FilterSort = /*#__PURE__*/forwardRef(function (_ref, ref) {
100
100
  setSearchValue(searchIngValue);
101
101
  };
102
102
 
103
- useEffect(function () {
104
- console.log(localFilter, 'localFilter');
105
- }, [localFilter]);
106
103
  useEffect(function () {
107
104
  setLocalFilter(filter);
108
105
  setColStateValue(filterStateValue);
@@ -70,8 +70,8 @@ var LMCustomTableOption = /*#__PURE__*/forwardRef(function (props, ref) {
70
70
 
71
71
  useEffect(function () {
72
72
  setLmOptions({
73
- filter: props.filter,
74
- columns: props.columns,
73
+ filter: props.filter || [],
74
+ columns: props.columns || [],
75
75
  size: props.size || 'default',
76
76
  card: props.card || []
77
77
  });
@@ -0,0 +1,2 @@
1
+ declare const Empty: () => JSX.Element;
2
+ export default Empty;
@@ -0,0 +1,55 @@
1
+ import * as React from 'react';
2
+ import { ConfigContext } from 'antd/es/config-provider';
3
+
4
+ var Empty = function Empty() {
5
+ var _React$useContext = React.useContext(ConfigContext),
6
+ getPrefixCls = _React$useContext.getPrefixCls;
7
+
8
+ var prefixCls = getPrefixCls('empty-img-default');
9
+ return /*#__PURE__*/React.createElement("svg", {
10
+ className: prefixCls,
11
+ width: "184",
12
+ height: "152",
13
+ viewBox: "0 0 184 152",
14
+ xmlns: "http://www.w3.org/2000/svg"
15
+ }, /*#__PURE__*/React.createElement("g", {
16
+ fill: "none",
17
+ fillRule: "evenodd"
18
+ }, /*#__PURE__*/React.createElement("g", {
19
+ transform: "translate(24 31.67)"
20
+ }, /*#__PURE__*/React.createElement("ellipse", {
21
+ className: "".concat(prefixCls, "-ellipse"),
22
+ cx: "67.797",
23
+ cy: "106.89",
24
+ rx: "67.797",
25
+ ry: "12.668"
26
+ }), /*#__PURE__*/React.createElement("path", {
27
+ className: "".concat(prefixCls, "-path-1"),
28
+ d: "M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z"
29
+ }), /*#__PURE__*/React.createElement("path", {
30
+ className: "".concat(prefixCls, "-path-2"),
31
+ d: "M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",
32
+ transform: "translate(13.56)"
33
+ }), /*#__PURE__*/React.createElement("path", {
34
+ className: "".concat(prefixCls, "-path-3"),
35
+ d: "M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z"
36
+ }), /*#__PURE__*/React.createElement("path", {
37
+ className: "".concat(prefixCls, "-path-4"),
38
+ d: "M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z"
39
+ })), /*#__PURE__*/React.createElement("path", {
40
+ className: "".concat(prefixCls, "-path-5"),
41
+ d: "M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z"
42
+ }), /*#__PURE__*/React.createElement("g", {
43
+ className: "".concat(prefixCls, "-g"),
44
+ transform: "translate(149.65 15.383)"
45
+ }, /*#__PURE__*/React.createElement("ellipse", {
46
+ cx: "20.654",
47
+ cy: "3.167",
48
+ rx: "2.849",
49
+ ry: "2.815"
50
+ }), /*#__PURE__*/React.createElement("path", {
51
+ d: "M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"
52
+ }))));
53
+ };
54
+
55
+ export default Empty;
@@ -1,7 +1,22 @@
1
- import React from 'react';
2
- import { Empty } from 'antd';
3
- export interface IEmptyProps {
1
+ import * as React from 'react';
2
+ export interface TransferLocale {
3
+ description: string;
4
+ }
5
+ export interface EmptyProps {
6
+ prefixCls?: string;
4
7
  className?: string;
5
8
  style?: React.CSSProperties;
9
+ /** @since 3.16.0 */
10
+ imageStyle?: React.CSSProperties;
11
+ image?: React.ReactNode;
12
+ description?: React.ReactNode;
13
+ children?: React.ReactNode;
14
+ title: string | React.ReactNode;
15
+ }
16
+ interface EmptyType extends React.FC<EmptyProps> {
17
+ PRESENTED_IMAGE_DEFAULT: React.ReactNode;
18
+ PRESENTED_IMAGE_SIMPLE: React.ReactNode;
19
+ AntdEmpty: React.ReactNode;
6
20
  }
21
+ declare const Empty: EmptyType;
7
22
  export default Empty;
package/es/Empty/index.js CHANGED
@@ -1,3 +1,102 @@
1
1
  import "antd/es/empty/style";
2
2
  import _Empty from "antd/es/empty";
3
- export default _Empty;
3
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
+
5
+ var __rest = this && this.__rest || function (s, e) {
6
+ var t = {};
7
+
8
+ for (var p in s) {
9
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
10
+ }
11
+
12
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
13
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
14
+ }
15
+ return t;
16
+ };
17
+
18
+ import classNames from 'classnames';
19
+ import * as React from 'react';
20
+ import { useMemo } from 'react';
21
+ import { ConfigContext } from 'antd/es/config-provider';
22
+ import LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver';
23
+ import DefaultEmptyImg from './empty';
24
+ import SimpleEmptyImg from './simple';
25
+ var defaultEmptyImg = /*#__PURE__*/React.createElement(DefaultEmptyImg, null);
26
+ var simpleEmptyImg = /*#__PURE__*/React.createElement(SimpleEmptyImg, null);
27
+ var TitleMap = {
28
+ notfound: '抱歉,404页面',
29
+ nopermissions: '抱歉,您的权限不足',
30
+ loaderror: '数据加载中,请您再试一次',
31
+ networkerror: '抱歉,服务器出错误',
32
+ nodata: '抱歉,暂无数据'
33
+ };
34
+
35
+ var Empty = function Empty(_a) {
36
+ var className = _a.className,
37
+ customizePrefixCls = _a.prefixCls,
38
+ _a$image = _a.image,
39
+ image = _a$image === void 0 ? defaultEmptyImg : _a$image,
40
+ title = _a.title,
41
+ description = _a.description,
42
+ children = _a.children,
43
+ imageStyle = _a.imageStyle,
44
+ restProps = __rest(_a, ["className", "prefixCls", "image", "title", "description", "children", "imageStyle"]);
45
+
46
+ var _React$useContext = React.useContext(ConfigContext),
47
+ getPrefixCls = _React$useContext.getPrefixCls,
48
+ direction = _React$useContext.direction;
49
+
50
+ var isCustomEmpty = useMemo(function () {
51
+ if (typeof image === 'string' && ['notfound', 'nopermissions', 'loaderror', 'networkerror', 'nodata'].includes(image)) {
52
+ return true;
53
+ }
54
+
55
+ return false;
56
+ }, [image]);
57
+ return (
58
+ /*#__PURE__*/
59
+ // @ts-ignore
60
+ React.createElement(LocaleReceiver, {
61
+ componentName: "Empty"
62
+ }, function (locale) {
63
+ var _classNames;
64
+
65
+ var prefixCls = getPrefixCls('empty', customizePrefixCls);
66
+ var des = typeof description !== 'undefined' ? description : locale.description;
67
+ var alt = typeof des === 'string' ? des : 'empty';
68
+ var imageNode = null;
69
+
70
+ if (isCustomEmpty) {
71
+ imageNode = /*#__PURE__*/React.createElement("div", {
72
+ className: classNames('lm_custom_empty_img', "".concat(image))
73
+ });
74
+ } else if (typeof image === 'string') {
75
+ imageNode = /*#__PURE__*/React.createElement("img", {
76
+ alt: alt,
77
+ src: image
78
+ });
79
+ } else {
80
+ imageNode = image;
81
+ }
82
+
83
+ return /*#__PURE__*/React.createElement("div", Object.assign({
84
+ className: classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-normal"), image === simpleEmptyImg), _defineProperty(_classNames, "".concat(prefixCls, "-rtl"), direction === 'rtl'), _classNames), className, 'lm_empty')
85
+ }, restProps), /*#__PURE__*/React.createElement("div", {
86
+ className: classNames("".concat(prefixCls, "-image"), isCustomEmpty && 'lm_custom_empty'),
87
+ style: imageStyle
88
+ }, imageNode), (title || isCustomEmpty) && /*#__PURE__*/React.createElement("div", {
89
+ className: "".concat(prefixCls, "-title")
90
+ }, title || TitleMap["".concat(image)]), des && /*#__PURE__*/React.createElement("div", {
91
+ className: "".concat(prefixCls, "-description")
92
+ }, des), children && /*#__PURE__*/React.createElement("div", {
93
+ className: "".concat(prefixCls, "-footer")
94
+ }, children));
95
+ })
96
+ );
97
+ };
98
+
99
+ Empty.PRESENTED_IMAGE_DEFAULT = defaultEmptyImg;
100
+ Empty.PRESENTED_IMAGE_SIMPLE = simpleEmptyImg;
101
+ Empty.AntdEmpty = _Empty;
102
+ export default Empty;
@@ -0,0 +1,2 @@
1
+ declare const Simple: () => JSX.Element;
2
+ export default Simple;
@@ -0,0 +1,36 @@
1
+ import * as React from 'react';
2
+ import { ConfigContext } from 'antd/es/config-provider';
3
+
4
+ var Simple = function Simple() {
5
+ var _React$useContext = React.useContext(ConfigContext),
6
+ getPrefixCls = _React$useContext.getPrefixCls;
7
+
8
+ var prefixCls = getPrefixCls('empty-img-simple');
9
+ return /*#__PURE__*/React.createElement("svg", {
10
+ className: prefixCls,
11
+ width: "64",
12
+ height: "41",
13
+ viewBox: "0 0 64 41",
14
+ xmlns: "http://www.w3.org/2000/svg"
15
+ }, /*#__PURE__*/React.createElement("g", {
16
+ transform: "translate(0 1)",
17
+ fill: "none",
18
+ fillRule: "evenodd"
19
+ }, /*#__PURE__*/React.createElement("ellipse", {
20
+ className: "".concat(prefixCls, "-ellipse"),
21
+ cx: "32",
22
+ cy: "33",
23
+ rx: "32",
24
+ ry: "7"
25
+ }), /*#__PURE__*/React.createElement("g", {
26
+ className: "".concat(prefixCls, "-g"),
27
+ fillRule: "nonzero"
28
+ }, /*#__PURE__*/React.createElement("path", {
29
+ d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
30
+ }), /*#__PURE__*/React.createElement("path", {
31
+ d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",
32
+ className: "".concat(prefixCls, "-path")
33
+ }))));
34
+ };
35
+
36
+ export default Simple;