@lemon-fe/components 0.1.3 → 0.1.6

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.
@@ -1,4 +1,4 @@
1
- var _excluded = ["onWidthChange", "width", "fullTableRef"],
1
+ var _excluded = ["onWidthChange", "width", "fullTableRef", "children", "className"],
2
2
  _excluded2 = ["id", "columns", "defaultColumnProps", "rowKey", "children", "summaryTitle", "summaryRecord", "dataSource", "onSortChange", "sort", "scroll", "virtual", "components", "pagination", "onChange", "rowHeight", "tableLayout", "rowActions"];
3
3
 
4
4
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
@@ -69,10 +69,25 @@ function Th(props) {
69
69
  var onWidthChange = props.onWidthChange,
70
70
  width = props.width,
71
71
  fullTableRef = props.fullTableRef,
72
+ children = props.children,
73
+ className = props.className,
72
74
  restProps = _objectWithoutProperties(props, _excluded);
73
75
 
76
+ var reg = /\bant-table-cell-ellipsis\b/;
77
+ var content = children;
78
+ var mClassName = className;
79
+
80
+ if (mClassName && reg.test(mClassName)) {
81
+ mClassName = mClassName.replace(reg, '');
82
+ content = /*#__PURE__*/React.createElement("div", {
83
+ className: "ant-table-cell-ellipsis"
84
+ }, content);
85
+ }
86
+
74
87
  if (!width || !onWidthChange) {
75
- return /*#__PURE__*/React.createElement("th", _objectSpread({}, restProps));
88
+ return /*#__PURE__*/React.createElement("th", _objectSpread(_objectSpread({}, restProps), {}, {
89
+ className: mClassName
90
+ }), content);
76
91
  }
77
92
 
78
93
  return /*#__PURE__*/React.createElement(ResizeHeaderCell, {
@@ -80,7 +95,9 @@ function Th(props) {
80
95
  onChange: onWidthChange,
81
96
  fullTableRef: fullTableRef,
82
97
  prefixCls: "".concat(PREFIX_CLS, "-table")
83
- }, /*#__PURE__*/React.createElement("th", _objectSpread({}, restProps)));
98
+ }, /*#__PURE__*/React.createElement("th", _objectSpread(_objectSpread({}, restProps), {}, {
99
+ className: mClassName
100
+ }), content));
84
101
  }
85
102
 
86
103
  function BaseTable(props) {
@@ -77,8 +77,12 @@
77
77
  content: '';
78
78
  }
79
79
 
80
- &-column::after {
81
- display: none !important;
80
+ &-column {
81
+ border-right: none !important;
82
+
83
+ &::after {
84
+ display: none !important;
85
+ }
82
86
  }
83
87
 
84
88
  &-item {
@@ -157,22 +161,28 @@
157
161
  width: 11px;
158
162
  height: 12px;
159
163
  margin-top: -6px;
164
+ padding: 0 5px;
165
+ background-color: #bbb;
166
+ background-clip: content-box;
160
167
  cursor: col-resize;
168
+ }
161
169
 
162
- & > div {
163
- width: 1px;
164
- height: 100%;
165
- margin: 0 auto;
166
- background-color: #bbb;
167
- }
170
+ .ant-table-bordered &-resizable-handle {
171
+ right: -6px;
172
+ background-color: transparent;
168
173
  }
169
174
 
170
175
  &-resizable-indicator {
171
176
  position: absolute;
172
177
  top: 0;
173
178
  z-index: 20;
174
- width: 1px;
179
+ box-sizing: border-box;
180
+ width: 11px;
181
+ margin-left: -5px;
182
+ padding: 0 5px;
175
183
  background-color: @resize-indicator-color;
184
+ background-clip: content-box;
185
+ cursor: col-resize;
176
186
  }
177
187
 
178
188
  &-resizing-col thead th {
@@ -1,3 +1,5 @@
1
+ var _excluded = ["prefixCls", "types", "options", "value", "dateFormat", "onChange"];
2
+
1
3
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
4
 
3
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -16,6 +18,10 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
16
18
 
17
19
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
20
 
21
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
22
+
23
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
24
+
19
25
  import React, { useMemo, useState, useEffect } from 'react';
20
26
  import { DatePicker, Dropdown, Menu } from 'antd';
21
27
  import moment from 'moment';
@@ -106,7 +112,9 @@ export default function DurationPicker(props) {
106
112
  valueProp = props.value,
107
113
  _props$dateFormat = props.dateFormat,
108
114
  dateFormat = _props$dateFormat === void 0 ? 'YYYY-MM-DD' : _props$dateFormat,
109
- onChange = props.onChange;
115
+ onChange = props.onChange,
116
+ restProps = _objectWithoutProperties(props, _excluded);
117
+
110
118
  var defaultValue = useMemo(function () {
111
119
  if (valueProp === undefined) {
112
120
  var _options$0$value, _options$;
@@ -218,9 +226,9 @@ export default function DurationPicker(props) {
218
226
  }))
219
227
  }, /*#__PURE__*/React.createElement("div", {
220
228
  className: "".concat(prefixCls, "-duration-option")
221
- }, (_result$option = result.option) === null || _result$option === void 0 ? void 0 : _result$option.label, /*#__PURE__*/React.createElement(Down, null))), /*#__PURE__*/React.createElement(DatePicker.RangePicker, {
229
+ }, (_result$option = result.option) === null || _result$option === void 0 ? void 0 : _result$option.label, /*#__PURE__*/React.createElement(Down, null))), /*#__PURE__*/React.createElement(DatePicker.RangePicker, _objectSpread({
222
230
  value: result.dates,
223
231
  onChange: handleChangeDates,
224
232
  disabled: ((_result$option2 = result.option) === null || _result$option2 === void 0 ? void 0 : _result$option2.value) !== null
225
- })));
233
+ }, restProps))));
226
234
  }
package/es/Icons/More.js CHANGED
@@ -15,7 +15,7 @@ var MoreSvg = function MoreSvg(props) {
15
15
  xmlns: "http://www.w3.org/2000/svg"
16
16
  }, props), /*#__PURE__*/React.createElement("g", {
17
17
  fill: "currentColor",
18
- "fill-rule": "evenodd"
18
+ fillRule: "evenodd"
19
19
  }, /*#__PURE__*/React.createElement("circle", {
20
20
  opacity: ".7",
21
21
  cx: "15",
@@ -2,19 +2,21 @@
2
2
  position: relative;
3
3
  display: flex;
4
4
  flex-direction: column;
5
- min-height: 100%;
5
+ height: 100%;
6
6
  padding: 0 @space;
7
7
  background: #f2f2f2;
8
8
 
9
9
  &-header {
10
10
  padding: @space 0;
11
+ background-color: #f2f2f2;
11
12
  }
12
13
 
13
14
  &-content {
14
15
  display: flex;
15
16
  flex: 1;
17
+ min-height: 0;
18
+ overflow: hidden;
16
19
  background-color: #fff;
17
- background-clip: content-box;
18
20
  border-top-left-radius: 8px;
19
21
  border-top-right-radius: 8px;
20
22
 
@@ -87,19 +89,18 @@
87
89
  }
88
90
 
89
91
  &-main {
92
+ display: flex;
90
93
  flex: 1;
94
+ flex-direction: column;
91
95
  min-width: 0;
96
+ overflow: auto;
92
97
  }
93
98
 
94
99
  &-footer {
95
- position: sticky;
96
- bottom: 0;
97
- z-index: 10;
98
100
  display: flex;
99
101
  align-items: center;
100
- justify-content: flex-end;
102
+ justify-content: center;
101
103
  box-sizing: border-box;
102
- width: 100%;
103
104
  height: 65px;
104
105
  padding: @space;
105
106
  background: #fff;
@@ -118,17 +119,3 @@
118
119
  background-color: rgba(255, 255, 255, 0.5);
119
120
  }
120
121
  }
121
-
122
- .@{prefixCls}-layout.@{prefixCls}-layout-full {
123
- height: 100%;
124
- min-height: 0;
125
-
126
- .@{prefixCls}-layout-content {
127
- min-height: 0;
128
- }
129
-
130
- .@{prefixCls}-layout-main {
131
- display: flex;
132
- flex-direction: column;
133
- }
134
- }
@@ -228,7 +228,7 @@ export default function Menu(props) {
228
228
  var activeMenu = useMemo(function () {
229
229
  var check = function check(path) {
230
230
  if (path) {
231
- return new RegExp("".concat(path, "(?![^\\/])")).test(location.pathname);
231
+ return new RegExp("".concat(path.split('?')[0], "(?![^\\/])")).test(location.pathname);
232
232
  }
233
233
 
234
234
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/components",
3
- "version": "0.1.3",
3
+ "version": "0.1.6",
4
4
  "description": "> TODO: description",
5
5
  "author": "鲁盛杰 <lusj@cnlemon.net>",
6
6
  "homepage": "",
@@ -39,5 +39,5 @@
39
39
  "@types/lodash": "^4.14.179",
40
40
  "@types/react-resizable": "^1.7.4"
41
41
  },
42
- "gitHead": "5f375aa03a86a1c776ef3e99ead0db39cbdbf7e8"
42
+ "gitHead": "15adfd8b84c2c81952656df2ffa553f58c301715"
43
43
  }