@lemon-fe/kits 1.0.0-20 → 1.0.0-22
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/es/components/DataGrid/cell-editors/Date.d.ts +1 -0
- package/es/components/DataGrid/cell-editors/Date.js +3 -1
- package/es/components/DataGrid/cell-editors/Number.js +3 -1
- package/es/components/DataGrid/cell-editors/Select.d.ts +1 -1
- package/es/components/DataGrid/typings.d.ts +4 -4
- package/es/components/DataGrid/typings.js +1 -4
- package/es/components/Popup/index.js +11 -9
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import type { ICellEditorReactComp } from '@ag-grid-community/react';
|
|
|
3
3
|
import type { ICellEditorParams } from '@ag-grid-community/core';
|
|
4
4
|
export interface DateEditorParams {
|
|
5
5
|
format: string;
|
|
6
|
+
disabled?: boolean;
|
|
6
7
|
}
|
|
7
8
|
declare const _default: React.ForwardRefExoticComponent<ICellEditorParams<any, any> & DateEditorParams & React.RefAttributes<ICellEditorReactComp>>;
|
|
8
9
|
export default _default;
|
|
@@ -19,7 +19,8 @@ import { editorPrefixClass } from "./utils";
|
|
|
19
19
|
export default /*#__PURE__*/forwardRef(function DateEditor(props, ref) {
|
|
20
20
|
var cellStartedEdit = props.cellStartedEdit,
|
|
21
21
|
_props$format = props.format,
|
|
22
|
-
format = _props$format === void 0 ? 'YYYY-MM-DD' : _props$format
|
|
22
|
+
format = _props$format === void 0 ? 'YYYY-MM-DD' : _props$format,
|
|
23
|
+
disabled = props.disabled;
|
|
23
24
|
|
|
24
25
|
var _useState = useState(props.value ? moment(props.value, format) : null),
|
|
25
26
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -50,6 +51,7 @@ export default /*#__PURE__*/forwardRef(function DateEditor(props, ref) {
|
|
|
50
51
|
paddingTop: 0,
|
|
51
52
|
paddingBottom: 0
|
|
52
53
|
},
|
|
54
|
+
disabled: disabled,
|
|
53
55
|
className: editorPrefixClass('date'),
|
|
54
56
|
value: value,
|
|
55
57
|
placeholder: format,
|
|
@@ -23,7 +23,8 @@ export default /*#__PURE__*/forwardRef(function NumberEditor(props, ref) {
|
|
|
23
23
|
_props$max = props.max,
|
|
24
24
|
max = _props$max === void 0 ? 99999999 : _props$max,
|
|
25
25
|
emptyValue = props.emptyValue,
|
|
26
|
-
undoWhenError = props.undoWhenError
|
|
26
|
+
undoWhenError = props.undoWhenError,
|
|
27
|
+
disabled = props.disabled;
|
|
27
28
|
|
|
28
29
|
var _useState = useState((_props$value = props.value) !== null && _props$value !== void 0 ? _props$value : null),
|
|
29
30
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -75,6 +76,7 @@ export default /*#__PURE__*/forwardRef(function NumberEditor(props, ref) {
|
|
|
75
76
|
});
|
|
76
77
|
return /*#__PURE__*/React.createElement(EditorWrapper, null, /*#__PURE__*/React.createElement("input", {
|
|
77
78
|
type: "number",
|
|
79
|
+
disabled: disabled,
|
|
78
80
|
className: editorPrefixClass('text'),
|
|
79
81
|
ref: elm,
|
|
80
82
|
value: value !== null && value !== void 0 ? value : '',
|
|
@@ -2,6 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import type { ICellEditorReactComp } from '@ag-grid-community/react';
|
|
3
3
|
import type { ICellEditorParams } from '@ag-grid-community/core';
|
|
4
4
|
import type { SelectProps } from 'antd/lib/select';
|
|
5
|
-
export declare type SelectEditorParams = Pick<SelectProps, 'options' | 'fieldNames' | 'virtual' | 'showSearch' | 'listHeight' | 'listItemHeight' | 'allowClear' | 'mode' | 'labelInValue'>;
|
|
5
|
+
export declare type SelectEditorParams = Pick<SelectProps, 'disabled' | 'options' | 'fieldNames' | 'virtual' | 'showSearch' | 'listHeight' | 'listItemHeight' | 'allowClear' | 'mode' | 'labelInValue'>;
|
|
6
6
|
declare const _default: React.ForwardRefExoticComponent<ICellEditorParams<any, any> & SelectEditorParams & React.RefAttributes<ICellEditorReactComp>>;
|
|
7
7
|
export default _default;
|
|
@@ -3,10 +3,10 @@ import type { ColDef, ColGroupDef, ICellEditorParams, ICellRendererParams, IHead
|
|
|
3
3
|
import type { RuleItem } from 'async-validator/dist-types/interface';
|
|
4
4
|
import type { ForwardedRef, ReactElement, ReactNode } from 'react';
|
|
5
5
|
export type { ColDef, ColGroupDef, ColumnState, GridApi, ICellEditorParams, ICellRendererParams, } from '@ag-grid-community/core';
|
|
6
|
-
export { TextEditorParams } from './cell-editors/Text';
|
|
7
|
-
export { NumberEditorParams } from './cell-editors/Number';
|
|
8
|
-
export { DateEditorParams } from './cell-editors/Date';
|
|
9
|
-
export { SelectEditorParams } from './cell-editors/Select';
|
|
6
|
+
export type { TextEditorParams } from './cell-editors/Text';
|
|
7
|
+
export type { NumberEditorParams } from './cell-editors/Number';
|
|
8
|
+
export type { DateEditorParams } from './cell-editors/Date';
|
|
9
|
+
export type { SelectEditorParams } from './cell-editors/Select';
|
|
10
10
|
export declare type GetRowKey<T> = string | ((data: T) => string);
|
|
11
11
|
export declare type PathType = string | (string | number)[];
|
|
12
12
|
export declare type ValidateRule<T> = Pick<RuleItem, 'required' | 'message' | 'pattern' | 'min' | 'max' | 'len' | 'type'> & {
|
|
@@ -26,11 +26,12 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
26
26
|
|
|
27
27
|
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; }
|
|
28
28
|
|
|
29
|
-
import React, { useState, cloneElement, useRef, isValidElement, useEffect } from 'react';
|
|
30
|
-
import { Modal, Input, message } from 'antd';
|
|
29
|
+
import React, { useState, cloneElement, useRef, isValidElement, useEffect, useContext } from 'react';
|
|
30
|
+
import { Modal, Input, message, ConfigProvider } from 'antd';
|
|
31
31
|
import { CloseCircleFilled } from '@ant-design/icons';
|
|
32
|
-
import { PREFIX_CLS } from "../../constants";
|
|
33
32
|
import SearchIcon from "../Icons/Search";
|
|
33
|
+
import { prefixClassName } from "../utils";
|
|
34
|
+
var prefix = prefixClassName('popup');
|
|
34
35
|
|
|
35
36
|
function Popup(props) {
|
|
36
37
|
var valueProp = props.value,
|
|
@@ -55,8 +56,6 @@ function Popup(props) {
|
|
|
55
56
|
emptyValue = props.emptyValue,
|
|
56
57
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
57
58
|
|
|
58
|
-
var prefixCls = "".concat(PREFIX_CLS, "-popup");
|
|
59
|
-
|
|
60
59
|
var _useState = useState(valueProp || emptyValue),
|
|
61
60
|
_useState2 = _slicedToArray(_useState, 2),
|
|
62
61
|
value = _useState2[0],
|
|
@@ -69,6 +68,9 @@ function Popup(props) {
|
|
|
69
68
|
|
|
70
69
|
var inputRef = useRef(null);
|
|
71
70
|
|
|
71
|
+
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
72
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
73
|
+
|
|
72
74
|
var handleCancel = function handleCancel() {
|
|
73
75
|
setVisible(false);
|
|
74
76
|
};
|
|
@@ -180,7 +182,7 @@ function Popup(props) {
|
|
|
180
182
|
trigger = showLabel ? /*#__PURE__*/cloneElement(children, undefined, label) : children;
|
|
181
183
|
} else {
|
|
182
184
|
trigger = /*#__PURE__*/React.createElement(Input, {
|
|
183
|
-
className:
|
|
185
|
+
className: prefix('input'),
|
|
184
186
|
value: label,
|
|
185
187
|
readOnly: true,
|
|
186
188
|
ref: inputRef,
|
|
@@ -189,7 +191,7 @@ function Popup(props) {
|
|
|
189
191
|
placeholder: placeholder,
|
|
190
192
|
bordered: bordered,
|
|
191
193
|
suffix: /*#__PURE__*/React.createElement(React.Fragment, null, !disabled && allowClear && label && /*#__PURE__*/React.createElement(CloseCircleFilled, {
|
|
192
|
-
className: "
|
|
194
|
+
className: "".concat(getPrefixCls('input'), "-clear-icon"),
|
|
193
195
|
onClick: handleClear
|
|
194
196
|
}), /*#__PURE__*/React.createElement(SearchIcon, null))
|
|
195
197
|
});
|
|
@@ -201,11 +203,11 @@ function Popup(props) {
|
|
|
201
203
|
}
|
|
202
204
|
}, [valueProp]);
|
|
203
205
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
204
|
-
className:
|
|
206
|
+
className: prefix('wrapper'),
|
|
205
207
|
onClick: handleOpen
|
|
206
208
|
}, trigger), /*#__PURE__*/React.createElement(Modal, _extends({
|
|
207
209
|
destroyOnClose: true,
|
|
208
|
-
|
|
210
|
+
open: visible,
|
|
209
211
|
width: 994,
|
|
210
212
|
centered: true,
|
|
211
213
|
onCancel: handleCancel,
|