@lemon-fe/kits 1.0.0-110 → 1.0.0-112

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.
@@ -25,8 +25,7 @@ export default /*#__PURE__*/forwardRef(function NumberEditor(props, ref) {
25
25
  min = _props$min === void 0 ? -99999999 : _props$min,
26
26
  _props$max = props.max,
27
27
  max = _props$max === void 0 ? 99999999 : _props$max,
28
- _props$emptyValue = props.emptyValue,
29
- emptyValue = _props$emptyValue === void 0 ? 0 : _props$emptyValue,
28
+ emptyValue = props.emptyValue,
30
29
  disabled = props.disabled,
31
30
  precision = props.precision,
32
31
  _isCancelAfterEnd = props.isCancelAfterEnd,
@@ -94,11 +93,11 @@ export default /*#__PURE__*/forwardRef(function NumberEditor(props, ref) {
94
93
 
95
94
  var val = getFormatedValue();
96
95
 
97
- if (val === null) {
96
+ if (emptyValue === null && val === null) {
98
97
  return false;
99
98
  }
100
99
 
101
- if (val < min || val > max) {
100
+ if (val === null || val < min || val > max) {
102
101
  return true;
103
102
  }
104
103
 
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { ICellRendererParams } from '@ag-grid-community/core';
3
+ export default function CellDeleteRender<TData>(props: ICellRendererParams<TData>): JSX.Element | null;
@@ -0,0 +1,22 @@
1
+ import { DeleteTwoTone } from '@ant-design/icons';
2
+ import React from 'react';
3
+ export default function CellDeleteRender(props) {
4
+ var api = props.api,
5
+ data = props.data,
6
+ node = props.node;
7
+
8
+ if (node.isRowPinned()) {
9
+ return null;
10
+ }
11
+
12
+ return /*#__PURE__*/React.createElement(DeleteTwoTone, {
13
+ key: "delete",
14
+ onClick: function onClick() {
15
+ if (data !== undefined) {
16
+ api.applyTransaction({
17
+ remove: [data]
18
+ });
19
+ }
20
+ }
21
+ });
22
+ }
@@ -27,6 +27,7 @@ import { get as _get, set as _set } from 'lodash';
27
27
  import moment from 'moment';
28
28
  import { prefixClassName } from "../utils";
29
29
  import CellIndexRender from "./renderer/CellIndexRenderer";
30
+ import CellDeleteRender from "./renderer/CellDeleteRenderer";
30
31
  export var prefix = prefixClassName('grid');
31
32
  export function isColumn(col) {
32
33
  return col.children === undefined;
@@ -311,5 +312,12 @@ export var columnTypes = {
311
312
  },
312
313
  cellClass: prefix('cell-align-center'),
313
314
  sortable: false
315
+ },
316
+ delete: {
317
+ colId: '__delete__',
318
+ initialWidth: 30,
319
+ sortable: false,
320
+ suppressMenu: true,
321
+ cellRenderer: CellDeleteRender
314
322
  }
315
323
  };
@@ -20,6 +20,7 @@ interface Props extends Omit<RangePickerProps, 'value' | 'onChange'> {
20
20
  options?: Option[];
21
21
  dateFormat?: string;
22
22
  value?: DurationPickerValue;
23
+ hideType?: boolean;
23
24
  onChange?: (value: DurationPickerValue) => void;
24
25
  }
25
26
  declare function DurationPicker(props: Props): JSX.Element;
@@ -1,4 +1,4 @@
1
- var _excluded = ["prefixCls", "types", "options", "value", "dateFormat", "onChange"];
1
+ var _excluded = ["prefixCls", "types", "hideType", "options", "value", "dateFormat", "onChange"];
2
2
 
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
 
@@ -75,6 +75,8 @@ function DurationPicker(props) {
75
75
  var _props$prefixCls = props.prefixCls,
76
76
  prefixCls = _props$prefixCls === void 0 ? PREFIX_CLS : _props$prefixCls,
77
77
  types = props.types,
78
+ _props$hideType = props.hideType,
79
+ hideType = _props$hideType === void 0 ? false : _props$hideType,
78
80
  _props$options = props.options,
79
81
  options = _props$options === void 0 ? defaultOptions : _props$options,
80
82
  valueProp = props.value,
@@ -177,7 +179,7 @@ function DurationPicker(props) {
177
179
 
178
180
  return /*#__PURE__*/React.createElement("div", {
179
181
  className: "".concat(prefixCls, "-duration")
180
- }, /*#__PURE__*/React.createElement(Dropdown, {
182
+ }, !hideType && /*#__PURE__*/React.createElement(Dropdown, {
181
183
  overlay: /*#__PURE__*/React.createElement(Menu, {
182
184
  items: types.map(function (item) {
183
185
  return {
@@ -201,3 +201,19 @@ a[title='站长统计'] {
201
201
  /** tabs **/
202
202
  @tabs-horizontal-padding: 5px 0;
203
203
  @tabs-horizontal-gutter: 40px;
204
+
205
+ /** checkbox **/
206
+ .@{ant-prefix}-checkbox + span {
207
+ padding-right: 0;
208
+ padding-left: 4px;
209
+ }
210
+
211
+ /** radio **/
212
+ span.@{ant-prefix}-radio + * {
213
+ padding-right: 0;
214
+ padding-left: 4px;
215
+ }
216
+
217
+ .@{ant-prefix}-radio-wrapper:last-child {
218
+ margin-right: 0;
219
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/kits",
3
- "version": "1.0.0-110",
3
+ "version": "1.0.0-112",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",