@lemon-fe/components 1.2.0-alpha.0 → 1.2.0-alpha.2
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/data-grid/cell-editors/date.js +6 -10
- package/es/data-grid/cell-editors/number.js +5 -9
- package/es/data-grid/cell-editors/select.d.ts +2 -2
- package/es/data-grid/cell-editors/select.js +1 -1
- package/es/data-grid/cell-editors/text.js +5 -9
- package/es/data-grid/cell-editors/utils.d.ts +2 -5
- package/es/data-grid/cell-editors/utils.js +4 -34
- package/es/data-grid/index.d.ts +1 -1
- package/es/data-grid/index.js +5 -1
- package/es/date-picker/index.d.ts +2 -0
- package/es/date-picker/index.js +21 -0
- package/es/duration-picker/index.js +3 -2
- package/es/empty/index.d.ts +9 -0
- package/es/{empty-image → empty}/index.js +10 -2
- package/es/filter/index.js +5 -1
- package/es/index.d.ts +19 -9
- package/es/index.js +16 -8
- package/es/locale/en_US.js +1 -7
- package/es/locale/locale.d.ts +2 -11
- package/es/locale/locale.js +0 -2
- package/es/locale/zh_CN.js +1 -40
- package/es/locale-receiver.d.ts +1 -2
- package/es/locale-receiver.js +3 -5
- package/es/message/index.d.ts +3 -0
- package/es/message/index.js +56 -0
- package/es/modal/index.d.ts +16 -0
- package/es/modal/index.js +114 -0
- package/es/modal/index.less +38 -0
- package/es/others.d.ts +2 -0
- package/es/others.js +45 -0
- package/es/popup/index.d.ts +1 -1
- package/es/popup/index.js +3 -1
- package/es/select/index.d.ts +2 -0
- package/es/select/index.js +19 -0
- package/es/select-view/index.js +35 -5
- package/es/select-view/index.less +18 -0
- package/es/sider-tree/index.js +1 -1
- package/es/state/index.less +8 -0
- package/es/styles/index.less +2 -1
- package/es/table/index.js +1 -1
- package/es/time-picker/index.d.ts +2 -0
- package/es/time-picker/index.js +21 -0
- package/es/utils.d.ts +2 -1
- package/es/utils.js +10 -0
- package/package.json +3 -3
- package/es/empty-image/index.d.ts +0 -2
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
2
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
4
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { DatePicker } from 'antd';
|
|
13
8
|
import React, { useEffect, useRef } from 'react';
|
|
14
9
|
import { forwardRef, useImperativeHandle, useState } from 'react';
|
|
15
10
|
import { editorPrefixClass, navigateCell } from "./utils";
|
|
16
11
|
import EditorWrapper from "./wrapper";
|
|
17
|
-
import { DatePicker } from 'antd';
|
|
18
12
|
import moment from 'moment';
|
|
19
13
|
export default /*#__PURE__*/forwardRef(function DateEditor(props, ref) {
|
|
20
14
|
var _props$format = props.format,
|
|
@@ -54,9 +48,11 @@ export default /*#__PURE__*/forwardRef(function DateEditor(props, ref) {
|
|
|
54
48
|
return /*#__PURE__*/React.createElement(EditorWrapper, null, /*#__PURE__*/React.createElement(DatePicker, {
|
|
55
49
|
onKeyDown: function onKeyDown(e) {
|
|
56
50
|
if (isEdited.current) {
|
|
57
|
-
navigateCell(
|
|
58
|
-
event: e
|
|
59
|
-
|
|
51
|
+
navigateCell({
|
|
52
|
+
event: e.nativeEvent,
|
|
53
|
+
api: props.api,
|
|
54
|
+
onKeyDown: props.onKeyDown
|
|
55
|
+
});
|
|
60
56
|
}
|
|
61
57
|
},
|
|
62
58
|
style: {
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
2
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -104,9 +98,11 @@ export default /*#__PURE__*/forwardRef(function NumberEditor(props, ref) {
|
|
|
104
98
|
return /*#__PURE__*/React.createElement(EditorWrapper, null, /*#__PURE__*/React.createElement("input", {
|
|
105
99
|
type: "number",
|
|
106
100
|
onKeyDown: function onKeyDown(e) {
|
|
107
|
-
|
|
108
|
-
event: e
|
|
109
|
-
|
|
101
|
+
navigateCell({
|
|
102
|
+
event: e.nativeEvent,
|
|
103
|
+
api: props.api,
|
|
104
|
+
onKeyDown: props.onKeyDown
|
|
105
|
+
});
|
|
110
106
|
},
|
|
111
107
|
disabled: disabled,
|
|
112
108
|
className: editorPrefixClass('text'),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { BaseOptionType, SelectProps } from 'antd/lib/select';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import type { ICellEditorParams } from '@ag-grid-community/core';
|
|
3
4
|
import type { ICellEditorReactComp } from '@ag-grid-community/react';
|
|
4
|
-
import type { BaseOptionType, SelectProps } from 'antd/lib/select';
|
|
5
5
|
export declare type SelectEditorParams = Pick<SelectProps<any, BaseOptionType>, 'disabled' | 'options' | 'virtual' | 'showSearch' | 'listHeight' | 'allowClear' | 'mode'> & {
|
|
6
6
|
fieldNames?: {
|
|
7
7
|
label: string;
|
|
@@ -16,7 +16,7 @@ export declare type SelectEditorParams = Pick<SelectProps<any, BaseOptionType>,
|
|
|
16
16
|
*/
|
|
17
17
|
action?: 'next' | 'stop' | 'none';
|
|
18
18
|
};
|
|
19
|
-
declare const _default: React.ForwardRefExoticComponent<ICellEditorParams<any, any, any> & Pick<SelectProps<any, BaseOptionType>, "disabled" | "mode" | "virtual" | "allowClear" | "
|
|
19
|
+
declare const _default: React.ForwardRefExoticComponent<ICellEditorParams<any, any, any> & Pick<SelectProps<any, BaseOptionType>, "disabled" | "mode" | "virtual" | "allowClear" | "showSearch" | "options" | "listHeight"> & {
|
|
20
20
|
fieldNames?: {
|
|
21
21
|
label: string;
|
|
22
22
|
value: string;
|
|
@@ -8,9 +8,9 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
8
8
|
import { useMemo } from 'react';
|
|
9
9
|
import React, { useEffect, useRef } from 'react';
|
|
10
10
|
import { forwardRef, useImperativeHandle, useState } from 'react';
|
|
11
|
+
import Select from "../../select";
|
|
11
12
|
import { editorPrefixClass } from "./utils";
|
|
12
13
|
import EditorWrapper from "./wrapper";
|
|
13
|
-
import { Select } from 'antd';
|
|
14
14
|
export default /*#__PURE__*/forwardRef(function SelectEditor(props, ref) {
|
|
15
15
|
var stopEditing = props.stopEditing,
|
|
16
16
|
api = props.api,
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
2
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -75,9 +69,11 @@ export default /*#__PURE__*/forwardRef(function TextEditor(props, ref) {
|
|
|
75
69
|
});
|
|
76
70
|
return /*#__PURE__*/React.createElement(EditorWrapper, null, /*#__PURE__*/React.createElement("input", {
|
|
77
71
|
onKeyDown: function onKeyDown(e) {
|
|
78
|
-
navigateCell(
|
|
79
|
-
event: e
|
|
80
|
-
|
|
72
|
+
navigateCell({
|
|
73
|
+
event: e.nativeEvent,
|
|
74
|
+
api: props.api,
|
|
75
|
+
onKeyDown: props.onKeyDown
|
|
76
|
+
});
|
|
81
77
|
},
|
|
82
78
|
disabled: disabled,
|
|
83
79
|
className: editorPrefixClass('text'),
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Column, ColumnApi, GridApi, IRowNode } from '@ag-grid-community/core';
|
|
1
|
+
import type { GridApi } from '@ag-grid-community/core';
|
|
3
2
|
export declare const editorPrefixClass: (val?: string | undefined) => string;
|
|
4
3
|
export declare function navigateCell(params: {
|
|
5
4
|
api: GridApi;
|
|
6
|
-
columnApi: ColumnApi;
|
|
7
5
|
event: KeyboardEvent;
|
|
8
|
-
|
|
9
|
-
column: Column;
|
|
6
|
+
onKeyDown?: (e: KeyboardEvent) => void;
|
|
10
7
|
}): void;
|
|
@@ -3,43 +3,13 @@ export var editorPrefixClass = prefixClassName('grid-editor');
|
|
|
3
3
|
export function navigateCell(params) {
|
|
4
4
|
var api = params.api,
|
|
5
5
|
event = params.event,
|
|
6
|
-
|
|
7
|
-
column = params.column,
|
|
8
|
-
columnApi = params.columnApi;
|
|
6
|
+
onKeyDown = params.onKeyDown;
|
|
9
7
|
if (event.key === 'Enter') {
|
|
10
8
|
api.tabToNextCell();
|
|
11
9
|
return;
|
|
12
10
|
}
|
|
13
|
-
if (
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
var columns = columnApi.getAllDisplayedColumns();
|
|
17
|
-
var nextColumnIndex = columns.findIndex(function (item) {
|
|
18
|
-
return item === column;
|
|
19
|
-
});
|
|
20
|
-
if (nextColumnIndex < 0) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
var nextRowIndex = node.rowIndex;
|
|
24
|
-
var renderedRowCount = api.getModel().getRowCount();
|
|
25
|
-
switch (event.key) {
|
|
26
|
-
case 'ArrowUp':
|
|
27
|
-
nextRowIndex -= 1;
|
|
28
|
-
break;
|
|
29
|
-
case 'ArrowRight':
|
|
30
|
-
nextColumnIndex += 1;
|
|
31
|
-
break;
|
|
32
|
-
case 'ArrowDown':
|
|
33
|
-
nextRowIndex += 1;
|
|
34
|
-
break;
|
|
35
|
-
case 'ArrowLeft':
|
|
36
|
-
nextColumnIndex -= 1;
|
|
37
|
-
break;
|
|
38
|
-
default:
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
if (nextRowIndex < 0 || nextRowIndex >= renderedRowCount || nextColumnIndex < 0 || nextColumnIndex >= columns.length) {
|
|
42
|
-
return;
|
|
11
|
+
if (['ArrowUp', 'ArrowRight', 'ArrowDown', 'ArrowLeft'].includes(event.key)) {
|
|
12
|
+
api.stopEditing();
|
|
43
13
|
}
|
|
44
|
-
|
|
14
|
+
onKeyDown === null || onKeyDown === void 0 || onKeyDown(event);
|
|
45
15
|
}
|
package/es/data-grid/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ declare const Editors: {
|
|
|
16
16
|
Text: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any, any> & import("./typings").TextEditorParams<any> & React.RefAttributes<import("@ag-grid-community/react").ICellEditorReactComp>>;
|
|
17
17
|
Date: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any, any> & import("./typings").DateEditorParams<any> & React.RefAttributes<import("@ag-grid-community/react").ICellEditorReactComp>>;
|
|
18
18
|
Number: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any, any> & import("./typings").NumberEditorParams<any> & React.RefAttributes<import("@ag-grid-community/react").ICellEditorReactComp>>;
|
|
19
|
-
Select: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any, any> & Pick<import("antd").SelectProps<any, import("antd/lib/select").BaseOptionType>, "disabled" | "mode" | "virtual" | "allowClear" | "
|
|
19
|
+
Select: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any, any> & Pick<import("antd").SelectProps<any, import("antd/lib/select").BaseOptionType>, "disabled" | "mode" | "virtual" | "allowClear" | "showSearch" | "options" | "listHeight"> & {
|
|
20
20
|
fieldNames?: {
|
|
21
21
|
label: string;
|
|
22
22
|
value: string;
|
package/es/data-grid/index.js
CHANGED
|
@@ -225,10 +225,14 @@ var InternalDataGrid = /*#__PURE__*/function (_Component) {
|
|
|
225
225
|
value: value
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
|
+
var result = typeof value === 'string' ? value.replace(_this.fieldSuffix, '') : value;
|
|
229
|
+
if (Number.isNaN(+result)) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
228
232
|
if (summary[field.id] === undefined) {
|
|
229
233
|
summary[field.id] = new BigNumber(0);
|
|
230
234
|
}
|
|
231
|
-
summary[field.id] = summary[field.id].plus(
|
|
235
|
+
summary[field.id] = summary[field.id].plus(result);
|
|
232
236
|
});
|
|
233
237
|
});
|
|
234
238
|
return summary;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DatePicker } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Icons from "../icons";
|
|
4
|
+
import { mergeDefaultProps } from "../utils";
|
|
5
|
+
mergeDefaultProps(DatePicker, {
|
|
6
|
+
suffixIcon: /*#__PURE__*/React.createElement(Icons.Calendar, {
|
|
7
|
+
style: {
|
|
8
|
+
pointerEvents: 'none'
|
|
9
|
+
}
|
|
10
|
+
}),
|
|
11
|
+
clearIcon: /*#__PURE__*/React.createElement(Icons.Clear, null)
|
|
12
|
+
});
|
|
13
|
+
mergeDefaultProps(DatePicker.RangePicker, {
|
|
14
|
+
suffixIcon: /*#__PURE__*/React.createElement(Icons.Calendar, {
|
|
15
|
+
style: {
|
|
16
|
+
pointerEvents: 'none'
|
|
17
|
+
}
|
|
18
|
+
}),
|
|
19
|
+
clearIcon: /*#__PURE__*/React.createElement(Icons.Clear, null)
|
|
20
|
+
});
|
|
21
|
+
export default DatePicker;
|
|
@@ -14,11 +14,12 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
14
14
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
15
|
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; }
|
|
16
16
|
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; }
|
|
17
|
-
import { DatePicker, Select } from 'antd';
|
|
18
17
|
import React, { useMemo, useState, useEffect } from 'react';
|
|
19
18
|
import { PREFIX_CLS } from "../constants";
|
|
19
|
+
import DatePicker from "../date-picker";
|
|
20
20
|
import InputCompact from "../input-compact";
|
|
21
21
|
import { useLocaleReceiver } from "../locale-receiver";
|
|
22
|
+
import Select from "../select";
|
|
22
23
|
import moment from 'moment';
|
|
23
24
|
var emptyValue = [];
|
|
24
25
|
function DurationPicker(props) {
|
|
@@ -57,7 +58,7 @@ function DurationPicker(props) {
|
|
|
57
58
|
}
|
|
58
59
|
return [{
|
|
59
60
|
label: customDateText,
|
|
60
|
-
id: '
|
|
61
|
+
id: '自定义时段',
|
|
61
62
|
value: function value() {
|
|
62
63
|
return emptyValue;
|
|
63
64
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type EmptyProps } from 'antd';
|
|
2
|
+
import React, { type SVGProps } from 'react';
|
|
3
|
+
export declare function EmptyImage(props: SVGProps<SVGSVGElement>): JSX.Element;
|
|
4
|
+
declare function Empty(props: EmptyProps): JSX.Element;
|
|
5
|
+
declare namespace Empty {
|
|
6
|
+
var PRESENTED_IMAGE_DEFAULT: typeof EmptyImage;
|
|
7
|
+
var PRESENTED_IMAGE_SIMPLE: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export default Empty;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
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); }
|
|
2
|
+
import { Empty as AntEmpty } from 'antd';
|
|
2
3
|
import React from 'react';
|
|
3
|
-
export
|
|
4
|
+
export function EmptyImage(props) {
|
|
4
5
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
5
6
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6
7
|
viewBox: "0 0 120 120"
|
|
@@ -75,4 +76,11 @@ export default function EmptyImage(props) {
|
|
|
75
76
|
fill: "#E7E7E7",
|
|
76
77
|
d: "M88.5 71c8.008 0 14.5 6.492 14.5 14.5 0 4.389-1.95 8.322-5.03 10.98A14.449 14.449 0 0 1 91.5 98C83.492 98 77 91.508 77 83.5c0-4.389 1.95-8.322 5.03-10.98A14.449 14.449 0 0 1 88.5 71Z"
|
|
77
78
|
})));
|
|
78
|
-
}
|
|
79
|
+
}
|
|
80
|
+
export default function Empty(props) {
|
|
81
|
+
return /*#__PURE__*/React.createElement(AntEmpty, _extends({
|
|
82
|
+
image: /*#__PURE__*/React.createElement(EmptyImage, null)
|
|
83
|
+
}, props));
|
|
84
|
+
}
|
|
85
|
+
Empty.PRESENTED_IMAGE_DEFAULT = EmptyImage;
|
|
86
|
+
Empty.PRESENTED_IMAGE_SIMPLE = AntEmpty.PRESENTED_IMAGE_SIMPLE;
|
package/es/filter/index.js
CHANGED
|
@@ -18,16 +18,20 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
18
18
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
19
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
20
|
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); }
|
|
21
|
-
import { Button, Checkbox, Form, Input, Popover, Space
|
|
21
|
+
import { Button, Checkbox, Form, Input, Popover, Space } from 'antd';
|
|
22
22
|
import React, { useEffect, useMemo, useState, useContext } from 'react';
|
|
23
23
|
import { ComponentConfigureContext } from "../component-configure";
|
|
24
24
|
import Dropdown from "../dropdown";
|
|
25
25
|
import DurationPicker from "../duration-picker";
|
|
26
|
+
import Empty from "../empty";
|
|
26
27
|
import FormLayout from "../form-layout";
|
|
27
28
|
import Icons from "../icons";
|
|
28
29
|
import InputNumber from "../input-number";
|
|
29
30
|
import { useLocaleReceiver } from "../locale-receiver";
|
|
30
31
|
import { parseLocalTemplate } from "../locale/locale";
|
|
32
|
+
import message from "../message";
|
|
33
|
+
import Modal from "../modal";
|
|
34
|
+
import Select from "../select";
|
|
31
35
|
import TabBar from "../tab-bar";
|
|
32
36
|
import { mergeProp, prefixClassName } from "../utils";
|
|
33
37
|
import { useDebounce, useRequest, useUpdateEffect } from '@lemon-fe/hooks';
|
package/es/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from 'antd';
|
|
1
2
|
export type { ColDef, ColGroupDef, ColumnState, GridOptions, GridReadyEvent, ICellEditorParams, ICellRendererParams, IHeaderParams, RowDataUpdatedEvent, CellValueChangedEvent, NavigateToNextCellParams, TabToNextCellParams, AgGridEvent, GroupCellRendererParams as IGroupCellRendererParams, Column, CellPosition, IRowNode, } from '@ag-grid-community/core';
|
|
2
3
|
export { GridApi, ColumnApi } from '@ag-grid-community/core';
|
|
3
4
|
export * from '@ag-grid-community/react';
|
|
@@ -8,8 +9,6 @@ export { default as EditableTable } from './editable-table';
|
|
|
8
9
|
export { default as EditableCell } from './editable-table/editable-cell';
|
|
9
10
|
export { default as EditableTableFormItem } from './editable-table/editable-table-form-item';
|
|
10
11
|
export type { EditableTableProps, EditableTableColumnType, EditableCellFocusedType, EditableTableRef, EditableTableRule, } from './editable-table/typings';
|
|
11
|
-
export { default as Table } from './table';
|
|
12
|
-
export type { TableRef } from './table/typings';
|
|
13
12
|
export { default as PageLoading } from './page-loading';
|
|
14
13
|
export { default as Actions } from './actions';
|
|
15
14
|
export { default as Filter } from './filter';
|
|
@@ -27,23 +26,34 @@ export { default as Icons } from './icons';
|
|
|
27
26
|
export { default as FormLayout } from './form-layout';
|
|
28
27
|
export { default as TabBar } from './tab-bar';
|
|
29
28
|
export { default as SymbolIcon } from './symbol-icon';
|
|
30
|
-
export { default as Dropdown } from './dropdown';
|
|
31
29
|
export { default as SelectView } from './select-view';
|
|
32
|
-
export { default as DataGrid, DataGridRef } from './data-grid';
|
|
30
|
+
export { default as DataGrid, type DataGridRef } from './data-grid';
|
|
33
31
|
export * from './data-grid/typings';
|
|
34
32
|
export * from './data-grid/hooks';
|
|
35
33
|
export { default as TipMark } from './tip-mark';
|
|
36
34
|
export { default as Portal } from './portal';
|
|
37
35
|
export { default as State } from './state';
|
|
38
36
|
export { default as GreyPanel } from './grey-panel';
|
|
39
|
-
export { default as Alert } from './alert';
|
|
40
|
-
export { default as InputNumber } from './input-number';
|
|
41
37
|
export { default as InputCompact } from './input-compact';
|
|
42
38
|
export { default as SelectPanel } from './select-panel';
|
|
43
39
|
export * from './component-configure';
|
|
44
|
-
export { default as EmptyImage } from './empty-image';
|
|
45
40
|
export type { Locale } from './locale/locale';
|
|
46
41
|
export { useLocaleReceiver } from './locale-receiver';
|
|
47
42
|
export { parseLocalTemplate } from './locale/locale';
|
|
48
|
-
|
|
49
|
-
export { default as
|
|
43
|
+
/** 修改antd */
|
|
44
|
+
export { default as Table } from './table';
|
|
45
|
+
export type { TableRef } from './table/typings';
|
|
46
|
+
export { default as Alert } from './alert';
|
|
47
|
+
export { default as InputNumber } from './input-number';
|
|
48
|
+
export { default as Empty, EmptyImage } from './empty';
|
|
49
|
+
export { default as Dropdown } from './dropdown';
|
|
50
|
+
export { default as Modal, type ModalProps, type ModalFuncProps } from './modal';
|
|
51
|
+
export { default as message, type MessageArgsProps } from './message';
|
|
52
|
+
export { default as Select } from './select';
|
|
53
|
+
export { default as DatePicker } from './date-picker';
|
|
54
|
+
export { default as TimePicker } from './time-picker';
|
|
55
|
+
export { TreeSelect, Tree, Cascader, Menu } from './others';
|
|
56
|
+
export type { PickerPanelDateProps } from 'antd/lib/calendar/generateCalendar';
|
|
57
|
+
export { DefaultOptionType } from 'antd/lib/cascader';
|
|
58
|
+
export type { CheckboxGroupProps } from 'antd/lib/checkbox';
|
|
59
|
+
export type { TextAreaProps } from 'antd/lib/input';
|
package/es/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from 'antd';
|
|
1
2
|
export { GridApi, ColumnApi } from '@ag-grid-community/core';
|
|
2
3
|
export * from '@ag-grid-community/react';
|
|
3
4
|
export * from "./constants";
|
|
@@ -5,7 +6,6 @@ export { default as BaseTable } from "./base-table";
|
|
|
5
6
|
export { default as EditableTable } from "./editable-table";
|
|
6
7
|
export { default as EditableCell } from "./editable-table/editable-cell";
|
|
7
8
|
export { default as EditableTableFormItem } from "./editable-table/editable-table-form-item";
|
|
8
|
-
export { default as Table } from "./table";
|
|
9
9
|
export { default as PageLoading } from "./page-loading";
|
|
10
10
|
export { default as Actions } from "./actions";
|
|
11
11
|
export { default as Filter } from "./filter";
|
|
@@ -19,22 +19,30 @@ export { default as Icons } from "./icons";
|
|
|
19
19
|
export { default as FormLayout } from "./form-layout";
|
|
20
20
|
export { default as TabBar } from "./tab-bar";
|
|
21
21
|
export { default as SymbolIcon } from "./symbol-icon";
|
|
22
|
-
export { default as Dropdown } from "./dropdown";
|
|
23
22
|
export { default as SelectView } from "./select-view";
|
|
24
|
-
export { default as DataGrid
|
|
23
|
+
export { default as DataGrid } from "./data-grid";
|
|
25
24
|
export * from "./data-grid/typings";
|
|
26
25
|
export * from "./data-grid/hooks";
|
|
27
26
|
export { default as TipMark } from "./tip-mark";
|
|
28
27
|
export { default as Portal } from "./portal";
|
|
29
28
|
export { default as State } from "./state";
|
|
30
29
|
export { default as GreyPanel } from "./grey-panel";
|
|
31
|
-
export { default as Alert } from "./alert";
|
|
32
|
-
export { default as InputNumber } from "./input-number";
|
|
33
30
|
export { default as InputCompact } from "./input-compact";
|
|
34
31
|
export { default as SelectPanel } from "./select-panel";
|
|
35
32
|
export * from "./component-configure";
|
|
36
|
-
export { default as EmptyImage } from "./empty-image";
|
|
37
33
|
export { useLocaleReceiver } from "./locale-receiver";
|
|
38
34
|
export { parseLocalTemplate } from "./locale/locale";
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
|
|
36
|
+
/** 修改antd */
|
|
37
|
+
export { default as Table } from "./table";
|
|
38
|
+
export { default as Alert } from "./alert";
|
|
39
|
+
export { default as InputNumber } from "./input-number";
|
|
40
|
+
export { default as Empty, EmptyImage } from "./empty";
|
|
41
|
+
export { default as Dropdown } from "./dropdown";
|
|
42
|
+
export { default as Modal } from "./modal";
|
|
43
|
+
export { default as message } from "./message";
|
|
44
|
+
export { default as Select } from "./select";
|
|
45
|
+
export { default as DatePicker } from "./date-picker";
|
|
46
|
+
export { default as TimePicker } from "./time-picker";
|
|
47
|
+
export { TreeSelect, Tree, Cascader, Menu } from "./others";
|
|
48
|
+
export { DefaultOptionType } from 'antd/lib/cascader';
|
package/es/locale/en_US.js
CHANGED
|
@@ -14,9 +14,6 @@ import { default as SelectPanelLocale } from "../select-panel/locale/en_US";
|
|
|
14
14
|
import { default as SelectViewLocale } from "../select-view/locale/en_US";
|
|
15
15
|
import { default as SiderTreeLocale } from "../sider-tree/locale/en_US";
|
|
16
16
|
var enUS = _objectSpread(_objectSpread({}, antEnUS), {}, {
|
|
17
|
-
Common: {
|
|
18
|
-
backText: 'Back'
|
|
19
|
-
},
|
|
20
17
|
Filter: Filter,
|
|
21
18
|
BaseTable: BaseTable,
|
|
22
19
|
ColorPicker: ColorPickerLocale,
|
|
@@ -24,9 +21,6 @@ var enUS = _objectSpread(_objectSpread({}, antEnUS), {}, {
|
|
|
24
21
|
SiderTree: SiderTreeLocale,
|
|
25
22
|
SelectView: SelectViewLocale,
|
|
26
23
|
SelectPanel: SelectPanelLocale,
|
|
27
|
-
DurationPicker: DurationPickerLocale
|
|
28
|
-
UseBatchOperator: {},
|
|
29
|
-
BasicLayout: {},
|
|
30
|
-
MicroLayout: {}
|
|
24
|
+
DurationPicker: DurationPickerLocale
|
|
31
25
|
});
|
|
32
26
|
export default enUS;
|
package/es/locale/locale.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Locale as
|
|
1
|
+
import type { Locale as AntLocale } from 'antd/lib/locale-provider';
|
|
2
2
|
import type { BaseTableLocale } from '../base-table/locale/locale';
|
|
3
3
|
import type { ColorPickerLocale } from '../color-picker/locale/locale';
|
|
4
4
|
import type { DataGridLocale } from '../data-grid/locale/locale';
|
|
@@ -7,13 +7,7 @@ import type { FilterLocale } from '../filter/locale/locale';
|
|
|
7
7
|
import type { SelectPanelLocale } from '../select-panel/locale/locale';
|
|
8
8
|
import type { SelectViewLocale } from '../select-view/locale/locale';
|
|
9
9
|
import type { SiderTreeLocale } from '../sider-tree/locale/locale';
|
|
10
|
-
|
|
11
|
-
export interface CommonLocale {
|
|
12
|
-
backText: string;
|
|
13
|
-
[key: string]: any;
|
|
14
|
-
}
|
|
15
|
-
export interface Locale extends antLocale {
|
|
16
|
-
Common: CommonLocale;
|
|
10
|
+
export interface Locale extends AntLocale {
|
|
17
11
|
Filter: FilterLocale;
|
|
18
12
|
BaseTable: BaseTableLocale;
|
|
19
13
|
ColorPicker: ColorPickerLocale;
|
|
@@ -22,8 +16,5 @@ export interface Locale extends antLocale {
|
|
|
22
16
|
SelectView: SelectViewLocale;
|
|
23
17
|
SelectPanel: SelectPanelLocale;
|
|
24
18
|
DurationPicker: DurationPickerLocale;
|
|
25
|
-
UseBatchOperator: Record<string, any>;
|
|
26
|
-
BasicLayout: Record<string, any>;
|
|
27
|
-
MicroLayout: Record<string, any>;
|
|
28
19
|
}
|
|
29
20
|
export declare function parseLocalTemplate(template: string, context: Record<string | number, any>): string;
|
package/es/locale/locale.js
CHANGED
package/es/locale/zh_CN.js
CHANGED
|
@@ -14,9 +14,6 @@ import { default as SelectPanelLocale } from "../select-panel/locale/zh_CN";
|
|
|
14
14
|
import { default as SelectViewLocale } from "../select-view/locale/zh_CN";
|
|
15
15
|
import { default as SiderTreeLocale } from "../sider-tree/locale/zh_CN";
|
|
16
16
|
var zhCN = _objectSpread(_objectSpread({}, antZhCN), {}, {
|
|
17
|
-
Common: {
|
|
18
|
-
backText: '返回'
|
|
19
|
-
},
|
|
20
17
|
Filter: Filter,
|
|
21
18
|
BaseTable: BaseTable,
|
|
22
19
|
ColorPicker: ColorPickerLocale,
|
|
@@ -24,42 +21,6 @@ var zhCN = _objectSpread(_objectSpread({}, antZhCN), {}, {
|
|
|
24
21
|
DurationPicker: DurationPickerLocale,
|
|
25
22
|
SiderTree: SiderTreeLocale,
|
|
26
23
|
SelectView: SelectViewLocale,
|
|
27
|
-
SelectPanel: SelectPanelLocale
|
|
28
|
-
UseBatchOperator: {
|
|
29
|
-
continueText: '继续',
|
|
30
|
-
oprationSuccessText: '操作成功',
|
|
31
|
-
indexText: '编号',
|
|
32
|
-
detailsText: '明细',
|
|
33
|
-
resumeExecText: '继续执行',
|
|
34
|
-
startExecText: '开始执行',
|
|
35
|
-
suspendExecText: '暂停执行',
|
|
36
|
-
resultStateText: '处理状态',
|
|
37
|
-
pendingStateText: '待处理',
|
|
38
|
-
progressStateText: '进行中'
|
|
39
|
-
},
|
|
40
|
-
BasicLayout: {
|
|
41
|
-
tabModal: {
|
|
42
|
-
infoText: '提示',
|
|
43
|
-
contentText: '当前打开页签已达10个, 为不影响浏览器性能, 已为您关闭最早打开的页签',
|
|
44
|
-
okText: '我知道啦',
|
|
45
|
-
cancelText: '今日不再提醒'
|
|
46
|
-
},
|
|
47
|
-
menu: {
|
|
48
|
-
noFavoriteText: '暂无收藏',
|
|
49
|
-
managementText: '功能管理',
|
|
50
|
-
favotireText: '收藏',
|
|
51
|
-
noWantMenuText: '没有找到想要的功能?',
|
|
52
|
-
viewAllText: '查看全部'
|
|
53
|
-
},
|
|
54
|
-
refreshButton: {
|
|
55
|
-
refreshCurrText: '刷新当前页',
|
|
56
|
-
closeOthersText: '关闭其他页',
|
|
57
|
-
closeAllText: '关闭全部页'
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
MicroLayout: {
|
|
61
|
-
pageExceptionText: '页面异常',
|
|
62
|
-
reloadPageText: '重新加载'
|
|
63
|
-
}
|
|
24
|
+
SelectPanel: SelectPanelLocale
|
|
64
25
|
});
|
|
65
26
|
export default zhCN;
|
package/es/locale-receiver.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { Locale } from './locale/locale';
|
|
2
|
-
export { default as LocaleProvide } from 'antd/lib/locale-provider';
|
|
3
2
|
export declare type LemonLocaleComponentName = Exclude<keyof Locale, 'locale'>;
|
|
4
|
-
export declare const useLocaleReceiver: <
|
|
3
|
+
export declare const useLocaleReceiver: <LocaleData extends Locale = Locale, Name extends keyof LocaleData = keyof LocaleData>(componentName: Name, defaultLocale?: LocaleData[Name] | (() => LocaleData[Name]) | undefined) => [NonNullable<LocaleData[Name]>];
|
package/es/locale-receiver.js
CHANGED
|
@@ -6,15 +6,13 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import { ConfigProvider } from 'antd';
|
|
8
8
|
import { useContext, useMemo } from 'react';
|
|
9
|
-
import localDefaultData from "./locale/
|
|
10
|
-
export { default as LocaleProvide } from 'antd/lib/locale-provider';
|
|
9
|
+
import localDefaultData from "./locale/en_US";
|
|
11
10
|
export var useLocaleReceiver = function useLocaleReceiver(componentName, defaultLocale) {
|
|
12
11
|
var antLocale = useContext(ConfigProvider.ConfigContext).locale;
|
|
13
12
|
var getLocale = useMemo(function () {
|
|
14
|
-
var _antLocale$componentN;
|
|
15
13
|
var locale = defaultLocale || localDefaultData[componentName];
|
|
16
|
-
var localeFromContext =
|
|
17
|
-
return _objectSpread(_objectSpread({}, typeof locale === 'function' ? locale() : locale), localeFromContext
|
|
14
|
+
var localeFromContext = antLocale === null || antLocale === void 0 ? void 0 : antLocale[componentName];
|
|
15
|
+
return _objectSpread(_objectSpread({}, typeof locale === 'function' ? locale() : locale), localeFromContext);
|
|
18
16
|
}, [componentName, defaultLocale, antLocale]);
|
|
19
17
|
return [getLocale];
|
|
20
18
|
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
11
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
12
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
13
|
+
import { message } from 'antd';
|
|
14
|
+
import React from 'react';
|
|
15
|
+
import Icons from "../icons";
|
|
16
|
+
function updateMsgInstance(msgInstance) {
|
|
17
|
+
var types = ['info', 'success', 'error', 'warning'];
|
|
18
|
+
types.forEach(function (type) {
|
|
19
|
+
var msgAPI = msgInstance[type];
|
|
20
|
+
msgInstance[type] = function () {
|
|
21
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
22
|
+
args[_key] = arguments[_key];
|
|
23
|
+
}
|
|
24
|
+
var args0 = args[0],
|
|
25
|
+
args1 = args[1],
|
|
26
|
+
args2 = args[2];
|
|
27
|
+
if (args.length === 1 && _typeof(args0) === 'object' && ! /*#__PURE__*/React.isValidElement(args0)) {
|
|
28
|
+
return msgAPI(_objectSpread({
|
|
29
|
+
icon: /*#__PURE__*/React.createElement(Icons.Tip, {
|
|
30
|
+
type: type
|
|
31
|
+
})
|
|
32
|
+
}, args0));
|
|
33
|
+
}
|
|
34
|
+
return msgAPI({
|
|
35
|
+
content: args0,
|
|
36
|
+
duration: args1,
|
|
37
|
+
onClose: args2,
|
|
38
|
+
icon: /*#__PURE__*/React.createElement(Icons.Tip, {
|
|
39
|
+
type: type
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
updateMsgInstance(message);
|
|
46
|
+
message.warn = message.warning;
|
|
47
|
+
var useMessage = message.useMessage;
|
|
48
|
+
message.useMessage = function useMessageWrapper() {
|
|
49
|
+
var _useMessage = useMessage.apply(void 0, arguments),
|
|
50
|
+
_useMessage2 = _slicedToArray(_useMessage, 2),
|
|
51
|
+
msgAPI = _useMessage2[0],
|
|
52
|
+
contextHolder = _useMessage2[1];
|
|
53
|
+
updateMsgInstance(msgAPI);
|
|
54
|
+
return [msgAPI, contextHolder];
|
|
55
|
+
};
|
|
56
|
+
export default message;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ModalProps as AntdModalProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare type ModalProps = AntdModalProps & {
|
|
4
|
+
enableFullscreen?: boolean;
|
|
5
|
+
defaultFullscreen?: boolean;
|
|
6
|
+
fullscreen?: boolean;
|
|
7
|
+
onFullscreenChange?: (fullscreen: boolean) => void;
|
|
8
|
+
};
|
|
9
|
+
export type { ModalFuncProps } from 'antd';
|
|
10
|
+
declare function LemonModal(props: ModalProps): JSX.Element;
|
|
11
|
+
declare const Modal: Pick<React.FC<AntdModalProps> & import("antd/lib/modal/confirm").ModalStaticFunctions & {
|
|
12
|
+
useModal: typeof import("antd/lib/modal/useModal").default;
|
|
13
|
+
destroyAll: () => void;
|
|
14
|
+
config: typeof import("antd/lib/modal/confirm").modalGlobalConfig;
|
|
15
|
+
}, "success" | "error" | "warning" | "info" | "warn" | "confirm" | "useModal" | "destroyAll" | "config"> & typeof LemonModal;
|
|
16
|
+
export default Modal;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["enableFullscreen", "defaultFullscreen", "fullscreen", "onFullscreenChange", "title", "wrapClassName"];
|
|
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
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
11
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
12
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
13
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
14
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
|
+
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; }
|
|
16
|
+
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; }
|
|
17
|
+
import { Modal as AntdModal } from 'antd';
|
|
18
|
+
import React, { useState } from 'react';
|
|
19
|
+
import Icons from "../icons";
|
|
20
|
+
import { prefixClassName } from "../utils";
|
|
21
|
+
import classNames from 'classnames';
|
|
22
|
+
function LemonModal(props) {
|
|
23
|
+
var _ref;
|
|
24
|
+
var enableFullscreen = props.enableFullscreen,
|
|
25
|
+
defaultFullscreen = props.defaultFullscreen,
|
|
26
|
+
fullscreenProp = props.fullscreen,
|
|
27
|
+
onFullscreenChange = props.onFullscreenChange,
|
|
28
|
+
title = props.title,
|
|
29
|
+
wrapClassName = props.wrapClassName,
|
|
30
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
31
|
+
var _useState = useState((_ref = fullscreenProp !== null && fullscreenProp !== void 0 ? fullscreenProp : defaultFullscreen) !== null && _ref !== void 0 ? _ref : false),
|
|
32
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
+
fullscreen = _useState2[0],
|
|
34
|
+
setFullscreen = _useState2[1];
|
|
35
|
+
var prefixCls = prefixClassName('modal');
|
|
36
|
+
var mergedFullscreen = fullscreenProp !== null && fullscreenProp !== void 0 ? fullscreenProp : fullscreen;
|
|
37
|
+
var handleFullscreenChange = function handleFullscreenChange(result) {
|
|
38
|
+
onFullscreenChange === null || onFullscreenChange === void 0 || onFullscreenChange(result);
|
|
39
|
+
setFullscreen(result);
|
|
40
|
+
};
|
|
41
|
+
return /*#__PURE__*/React.createElement(AntdModal, _extends({
|
|
42
|
+
closeIcon: /*#__PURE__*/React.createElement(Icons.CloseLight, null),
|
|
43
|
+
wrapClassName: classNames(prefixCls(), wrapClassName),
|
|
44
|
+
maskClosable: false,
|
|
45
|
+
title: enableFullscreen ? /*#__PURE__*/React.createElement("div", {
|
|
46
|
+
className: prefixCls('header')
|
|
47
|
+
}, title, /*#__PURE__*/React.createElement("button", {
|
|
48
|
+
className: prefixCls('fullscreen'),
|
|
49
|
+
onClick: function onClick() {
|
|
50
|
+
handleFullscreenChange(!mergedFullscreen);
|
|
51
|
+
}
|
|
52
|
+
}, mergedFullscreen ? /*#__PURE__*/React.createElement("svg", {
|
|
53
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
54
|
+
viewBox: "0 0 14 14"
|
|
55
|
+
}, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
|
|
56
|
+
d: "m9.828 9.121 2.829 2.829a.5.5 0 1 1-.707.707L9.12 9.828a.5.5 0 0 1 .707-.707ZM2.05 1.343l2.828 2.828a.5.5 0 0 1-.707.707L1.343 2.05a.5.5 0 1 1 .707-.707ZM4.879 9.828 2.05 12.657a.5.5 0 0 1-.638.058l-.069-.058a.5.5 0 0 1-.058-.638l.058-.07 2.829-2.828a.5.5 0 0 1 .707.707Z"
|
|
57
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
58
|
+
d: "M5 13.5a.5.5 0 0 1-.5-.5V9.499H1a.5.5 0 0 1-.492-.41L.5 8.999a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 .5.5V13a.5.5 0 0 1-.5.5Zm4 0a.5.5 0 0 1-.5-.5V8.999a.5.5 0 0 1 .5-.5h4a.5.5 0 1 1 0 1H9.5V13a.5.5 0 0 1-.41.492L9 13.5ZM1 5.499a.5.5 0 0 1 0-1h3.5V1a.5.5 0 0 1 .41-.492L5 .5a.5.5 0 0 1 .5.5v3.999a.5.5 0 0 1-.5.5H1Zm8 0a.5.5 0 0 1-.5-.5V1a.5.5 0 0 1 1 0v3.499H13a.5.5 0 0 1 .492.41L13.5 5a.5.5 0 0 1-.5.5H9Z"
|
|
59
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
60
|
+
d: "m9.122 4.171 2.828-2.828a.5.5 0 0 1 .707.707L9.829 4.878a.5.5 0 0 1-.638.058l-.07-.058a.5.5 0 0 1-.057-.638l.058-.069Z"
|
|
61
|
+
}))) : /*#__PURE__*/React.createElement("svg", {
|
|
62
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
63
|
+
viewBox: "0 0 14 14"
|
|
64
|
+
}, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
|
|
65
|
+
d: "m9.828 9.121 3.182 3.182-.707.707-3.182-3.182a.5.5 0 0 1 .707-.707ZM1.697.99 4.878 4.17a.5.5 0 0 1-.707.707L.99 1.697 1.697.99ZM4.879 9.828 1.697 13.01l-.707-.707 3.182-3.182a.5.5 0 0 1 .707.707Zm8.131-8.131L9.83 4.878a.5.5 0 0 1-.707-.707L12.303.99l.707.707Z"
|
|
66
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
67
|
+
d: "M1.5 8a.5.5 0 0 1 .5.5V12h3.5a.5.5 0 0 1 .492.41L6 12.5a.5.5 0 0 1-.5.5h-4a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5Zm11 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-4a.5.5 0 1 1 0-1H12V8.5a.5.5 0 0 1 .41-.492L12.5 8Zm-7-7a.5.5 0 0 1 0 1H2v3.5a.5.5 0 0 1-.41.492L1.5 6a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5h4Zm7 0a.5.5 0 0 1 .5.5v4a.5.5 0 1 1-1 0V2H8.5a.5.5 0 0 1-.492-.41L8 1.5a.5.5 0 0 1 .5-.5h4Z"
|
|
68
|
+
}))))) : title
|
|
69
|
+
}, restProps, {
|
|
70
|
+
centered: fullscreen ? true : restProps.centered,
|
|
71
|
+
width: fullscreen ? '95vw' : restProps.width,
|
|
72
|
+
bodyStyle: fullscreen ? _objectSpread(_objectSpread({}, restProps.bodyStyle), {}, {
|
|
73
|
+
height: '85vh'
|
|
74
|
+
}) : restProps.bodyStyle
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
var types = ['info', 'success', 'error', 'warning', 'warn', 'confirm'];
|
|
78
|
+
var Modal = LemonModal;
|
|
79
|
+
types.forEach(function (type) {
|
|
80
|
+
Modal[type] = function (props) {
|
|
81
|
+
return AntdModal[type](_objectSpread({
|
|
82
|
+
maskClosable: false,
|
|
83
|
+
width: 400,
|
|
84
|
+
icon: /*#__PURE__*/React.createElement(Icons.Tip, {
|
|
85
|
+
type: type === 'confirm' ? 'info' : type
|
|
86
|
+
})
|
|
87
|
+
}, props));
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
Modal.config = AntdModal.config;
|
|
91
|
+
Modal.destroyAll = AntdModal.destroyAll;
|
|
92
|
+
Modal.useModal = function useModal() {
|
|
93
|
+
var _AntdModal$useModal = AntdModal.useModal.apply(AntdModal, arguments),
|
|
94
|
+
_AntdModal$useModal2 = _slicedToArray(_AntdModal$useModal, 2),
|
|
95
|
+
fns = _AntdModal$useModal2[0],
|
|
96
|
+
contextHolder = _AntdModal$useModal2[1];
|
|
97
|
+
var mFns = _objectSpread({}, fns);
|
|
98
|
+
types.forEach(function (type) {
|
|
99
|
+
if (fns.hasOwnProperty(type)) {
|
|
100
|
+
var key = type;
|
|
101
|
+
var staticFunc = fns[key];
|
|
102
|
+
mFns[key] = function (props) {
|
|
103
|
+
return staticFunc(_objectSpread({
|
|
104
|
+
width: 400,
|
|
105
|
+
icon: /*#__PURE__*/React.createElement(Icons.Tip, {
|
|
106
|
+
type: type === 'confirm' ? 'info' : type
|
|
107
|
+
})
|
|
108
|
+
}, props));
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
return [mFns, contextHolder];
|
|
113
|
+
};
|
|
114
|
+
export default Modal;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.@{prefixCls}-modal {
|
|
2
|
+
&-header {
|
|
3
|
+
display: flex;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
&-fullscreen {
|
|
8
|
+
display: block;
|
|
9
|
+
width: 24px;
|
|
10
|
+
height: 24px;
|
|
11
|
+
margin-right: 24px;
|
|
12
|
+
margin-left: auto;
|
|
13
|
+
padding: 0;
|
|
14
|
+
color: rgba(51, 51, 51, 0.5);
|
|
15
|
+
font-size: 14px;
|
|
16
|
+
font-style: normal;
|
|
17
|
+
line-height: 24px;
|
|
18
|
+
text-align: center;
|
|
19
|
+
text-transform: none;
|
|
20
|
+
background: transparent;
|
|
21
|
+
border: 0;
|
|
22
|
+
border-radius: 4px;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
transition: background-color 0.3s;
|
|
25
|
+
text-rendering: auto;
|
|
26
|
+
|
|
27
|
+
&:hover {
|
|
28
|
+
background-color: #f2f3f5;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
svg {
|
|
32
|
+
width: 1em;
|
|
33
|
+
height: 1em;
|
|
34
|
+
vertical-align: -0.125em;
|
|
35
|
+
fill: fade(#333, 50);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
package/es/others.d.ts
ADDED
package/es/others.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// 部分组件不好包裹,直接替换defaultProps
|
|
2
|
+
import { TreeSelect, Tree, Cascader, Menu } from 'antd';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import Empty from "./empty";
|
|
5
|
+
import Icons from "./icons";
|
|
6
|
+
import { mergeDefaultProps } from "./utils";
|
|
7
|
+
var Down = Icons.Down,
|
|
8
|
+
Clear = Icons.Clear;
|
|
9
|
+
var node = /*#__PURE__*/React.createElement(Down, {
|
|
10
|
+
style: {
|
|
11
|
+
pointerEvents: 'none'
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
mergeDefaultProps(TreeSelect, {
|
|
15
|
+
notFoundContent: /*#__PURE__*/React.createElement(Empty, {
|
|
16
|
+
imageStyle: {
|
|
17
|
+
height: 60
|
|
18
|
+
}
|
|
19
|
+
}),
|
|
20
|
+
suffixIcon: node,
|
|
21
|
+
clearIcon: /*#__PURE__*/React.createElement(Clear, null)
|
|
22
|
+
});
|
|
23
|
+
mergeDefaultProps(Tree, {
|
|
24
|
+
switcherIcon: /*#__PURE__*/React.createElement(Down, {
|
|
25
|
+
style: {
|
|
26
|
+
fontSize: 14,
|
|
27
|
+
color: 'rgba(51, 51, 51, 0.7)',
|
|
28
|
+
verticalAlign: '-0.125em'
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
mergeDefaultProps(Cascader, {
|
|
33
|
+
suffixIcon: node,
|
|
34
|
+
clearIcon: /*#__PURE__*/React.createElement(Clear, null)
|
|
35
|
+
});
|
|
36
|
+
mergeDefaultProps(Menu, {
|
|
37
|
+
expandIcon: /*#__PURE__*/React.createElement(Down, {
|
|
38
|
+
style: {
|
|
39
|
+
transform: 'rotate(-90deg)',
|
|
40
|
+
top: 8,
|
|
41
|
+
color: '#666'
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
export { TreeSelect, Tree, Cascader, Menu };
|
package/es/popup/index.d.ts
CHANGED
package/es/popup/index.js
CHANGED
|
@@ -12,11 +12,13 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
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; }
|
|
14
14
|
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; }
|
|
15
|
+
import { Input, ConfigProvider } from 'antd';
|
|
15
16
|
import React, { useState, cloneElement, useRef, useEffect, useContext } from 'react';
|
|
16
17
|
import Icons from "../icons";
|
|
17
18
|
import SearchIcon from "../icons/search";
|
|
19
|
+
import message from "../message";
|
|
20
|
+
import Modal from "../modal";
|
|
18
21
|
import { prefixClassName } from "../utils";
|
|
19
|
-
import { Modal, Input, message, ConfigProvider } from 'antd';
|
|
20
22
|
var prefix = prefixClassName('popup');
|
|
21
23
|
|
|
22
24
|
// eslint-disable-next-line @typescript-eslint/unified-signatures
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Select } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Empty from "../empty";
|
|
4
|
+
import Icons from "../icons";
|
|
5
|
+
import { mergeDefaultProps } from "../utils";
|
|
6
|
+
mergeDefaultProps(Select, {
|
|
7
|
+
notFoundContent: /*#__PURE__*/React.createElement(Empty, {
|
|
8
|
+
imageStyle: {
|
|
9
|
+
height: 60
|
|
10
|
+
}
|
|
11
|
+
}),
|
|
12
|
+
suffixIcon: /*#__PURE__*/React.createElement(Icons.Down, {
|
|
13
|
+
style: {
|
|
14
|
+
pointerEvents: 'none'
|
|
15
|
+
}
|
|
16
|
+
}),
|
|
17
|
+
clearIcon: /*#__PURE__*/React.createElement(Icons.Clear, null)
|
|
18
|
+
});
|
|
19
|
+
export default Select;
|
package/es/select-view/index.js
CHANGED
|
@@ -17,11 +17,13 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
17
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
18
|
import { Form, Spin, Tabs } from 'antd';
|
|
19
19
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
20
|
+
import { Resizable } from 'react-resizable';
|
|
20
21
|
import DataGrid from "../data-grid";
|
|
21
22
|
import Filter from "../filter";
|
|
22
23
|
import { useLocaleReceiver } from "../locale-receiver";
|
|
23
24
|
import { parseLocalTemplate } from "../locale/locale";
|
|
24
25
|
import { mergeProp, prefixClassName } from "../utils";
|
|
26
|
+
import classNames from 'classnames';
|
|
25
27
|
import { get } from 'lodash';
|
|
26
28
|
export default function SelectView(props) {
|
|
27
29
|
var emptyValue = useMemo(function () {
|
|
@@ -72,6 +74,14 @@ export default function SelectView(props) {
|
|
|
72
74
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
73
75
|
loading = _useState10[0],
|
|
74
76
|
setLoading = _useState10[1];
|
|
77
|
+
var _useState11 = useState(200),
|
|
78
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
79
|
+
siderWidth = _useState12[0],
|
|
80
|
+
setSiderWidth = _useState12[1];
|
|
81
|
+
var _useState13 = useState(false),
|
|
82
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
83
|
+
dragging = _useState14[0],
|
|
84
|
+
setDragging = _useState14[1];
|
|
75
85
|
var filterForm = mergeProp(Form.useForm()[0], filter === null || filter === void 0 ? void 0 : filter.form);
|
|
76
86
|
var cParams = (filter === null || filter === void 0 ? void 0 : filter.value) || params;
|
|
77
87
|
var getRowKey = function getRowKey(item) {
|
|
@@ -189,9 +199,29 @@ export default function SelectView(props) {
|
|
|
189
199
|
var renderList = function renderList() {
|
|
190
200
|
return /*#__PURE__*/React.createElement("div", {
|
|
191
201
|
className: prefix('layout')
|
|
192
|
-
}, siderNode !== null && /*#__PURE__*/React.createElement(
|
|
193
|
-
|
|
194
|
-
|
|
202
|
+
}, siderNode !== null && /*#__PURE__*/React.createElement(Resizable, {
|
|
203
|
+
axis: "x",
|
|
204
|
+
height: 0,
|
|
205
|
+
width: siderWidth,
|
|
206
|
+
onResizeStart: function onResizeStart() {
|
|
207
|
+
setDragging(true);
|
|
208
|
+
},
|
|
209
|
+
onResizeStop: function onResizeStop() {
|
|
210
|
+
setDragging(false);
|
|
211
|
+
},
|
|
212
|
+
onResize: function onResize(_, _ref2) {
|
|
213
|
+
var size = _ref2.size;
|
|
214
|
+
setSiderWidth(size.width);
|
|
215
|
+
},
|
|
216
|
+
handle: /*#__PURE__*/React.createElement("div", {
|
|
217
|
+
className: prefix('sider-resizable')
|
|
218
|
+
})
|
|
219
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
220
|
+
style: {
|
|
221
|
+
width: "".concat(siderWidth, "px")
|
|
222
|
+
},
|
|
223
|
+
className: classNames(prefix('sider'), _defineProperty({}, prefix('sider-resizing'), dragging))
|
|
224
|
+
}, siderNode)), /*#__PURE__*/React.createElement("div", {
|
|
195
225
|
className: prefix('main')
|
|
196
226
|
}, headerNode !== null && /*#__PURE__*/React.createElement("div", {
|
|
197
227
|
className: prefix('head')
|
|
@@ -206,8 +236,8 @@ export default function SelectView(props) {
|
|
|
206
236
|
onChange: handleChangeData,
|
|
207
237
|
preserveSelectedRowKeys: true
|
|
208
238
|
},
|
|
209
|
-
onRowDoubleClicked: function onRowDoubleClicked(
|
|
210
|
-
var node =
|
|
239
|
+
onRowDoubleClicked: function onRowDoubleClicked(_ref3) {
|
|
240
|
+
var node = _ref3.node;
|
|
211
241
|
if (!multiple && node.id && node.data) {
|
|
212
242
|
handleChangeData([node.id], [node.data], true);
|
|
213
243
|
}
|
|
@@ -28,10 +28,28 @@
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
&-sider {
|
|
31
|
+
position: relative;
|
|
31
32
|
width: 200px;
|
|
32
33
|
padding: @padding-md @padding-md @padding-md 0;
|
|
33
34
|
overflow: auto;
|
|
34
35
|
border-right: 1px solid @border-color-split;
|
|
36
|
+
|
|
37
|
+
&-resizable {
|
|
38
|
+
position: absolute;
|
|
39
|
+
top: 0;
|
|
40
|
+
right: -9px;
|
|
41
|
+
box-sizing: border-box;
|
|
42
|
+
width: 17px;
|
|
43
|
+
height: 100%;
|
|
44
|
+
padding: 0 8px;
|
|
45
|
+
background-color: @border-color-split;
|
|
46
|
+
background-clip: content-box;
|
|
47
|
+
cursor: col-resize;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&:not(&-resizing) {
|
|
51
|
+
transition: width 0.2s;
|
|
52
|
+
}
|
|
35
53
|
}
|
|
36
54
|
|
|
37
55
|
&-main {
|
package/es/sider-tree/index.js
CHANGED
|
@@ -16,7 +16,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
16
16
|
import { Input, Tabs, Tree } from 'antd';
|
|
17
17
|
import React, { useMemo, useState } from 'react';
|
|
18
18
|
import { PREFIX_CLS } from "../constants";
|
|
19
|
-
import EmptyImage from "../empty
|
|
19
|
+
import { EmptyImage } from "../empty";
|
|
20
20
|
import Icons from "../icons";
|
|
21
21
|
import { useLocaleReceiver } from "../locale-receiver";
|
|
22
22
|
import { mapChildren, prefixClassName } from "../utils";
|
package/es/state/index.less
CHANGED
|
@@ -101,6 +101,10 @@
|
|
|
101
101
|
.orderShapeColor(@color-success);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
&-type-processing&-shape-order {
|
|
105
|
+
.orderShapeColor(@color-processing);
|
|
106
|
+
}
|
|
107
|
+
|
|
104
108
|
&-type-warning&-shape-order {
|
|
105
109
|
.orderShapeColor(@color-warning);
|
|
106
110
|
}
|
|
@@ -117,6 +121,10 @@
|
|
|
117
121
|
color: @color-success;
|
|
118
122
|
}
|
|
119
123
|
|
|
124
|
+
&-type-processing&-shape-text {
|
|
125
|
+
color: @color-processing;
|
|
126
|
+
}
|
|
127
|
+
|
|
120
128
|
&-type-warning&-shape-text {
|
|
121
129
|
color: @color-warning;
|
|
122
130
|
}
|
package/es/styles/index.less
CHANGED
|
@@ -24,5 +24,6 @@
|
|
|
24
24
|
@import '../state/index.less';
|
|
25
25
|
@import '../grey-panel/index.less';
|
|
26
26
|
@import '../input-number/index.less';
|
|
27
|
-
@import '
|
|
27
|
+
@import '../input-compact/index.less';
|
|
28
28
|
@import '../select-panel/index.less';
|
|
29
|
+
@import '../modal/index.less';
|
package/es/table/index.js
CHANGED
|
@@ -20,7 +20,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
20
20
|
import React, { useMemo, useState, useImperativeHandle, useEffect } from 'react';
|
|
21
21
|
import BaseTable from "../base-table";
|
|
22
22
|
import { PREFIX_CLS } from "../constants";
|
|
23
|
-
import EmptyImage from "../empty
|
|
23
|
+
import { EmptyImage } from "../empty";
|
|
24
24
|
import { isSortValue } from "./utils";
|
|
25
25
|
import { useRequest } from '@lemon-fe/hooks';
|
|
26
26
|
export default function Table(props) {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TimePicker } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Icons from "../icons";
|
|
4
|
+
import { mergeDefaultProps } from "../utils";
|
|
5
|
+
mergeDefaultProps(TimePicker, {
|
|
6
|
+
suffixIcon: /*#__PURE__*/React.createElement(Icons.Clock, {
|
|
7
|
+
style: {
|
|
8
|
+
pointerEvents: 'none'
|
|
9
|
+
}
|
|
10
|
+
}),
|
|
11
|
+
clearIcon: /*#__PURE__*/React.createElement(Icons.Clear, null)
|
|
12
|
+
});
|
|
13
|
+
mergeDefaultProps(TimePicker.RangePicker, {
|
|
14
|
+
suffixIcon: /*#__PURE__*/React.createElement(Icons.Clock, {
|
|
15
|
+
style: {
|
|
16
|
+
pointerEvents: 'none'
|
|
17
|
+
}
|
|
18
|
+
}),
|
|
19
|
+
clearIcon: /*#__PURE__*/React.createElement(Icons.Clear, null)
|
|
20
|
+
});
|
|
21
|
+
export default TimePicker;
|
package/es/utils.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
1
|
+
import type { ComponentType, ReactNode, ComponentProps } from 'react';
|
|
2
2
|
export declare function mapChildren<T>(children: ReactNode, cb: (node: ReactNode, index: number) => T): T[];
|
|
3
3
|
export declare function prefixClassName(prefix: string): (val?: string) => string;
|
|
4
4
|
export declare function mergeProp<T>(internal: T, prop: T | undefined): T;
|
|
5
|
+
export declare function mergeDefaultProps<T extends ComponentType>(comp: T, props: Partial<ComponentProps<T>>): T;
|
package/es/utils.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
1
7
|
import { PREFIX_CLS } from "./constants";
|
|
2
8
|
|
|
3
9
|
// 不使用Children.map的原因是由于它会给子节点生成一个key与tabs的activeTabKey无法对应
|
|
@@ -20,4 +26,8 @@ export function prefixClassName(prefix) {
|
|
|
20
26
|
}
|
|
21
27
|
export function mergeProp(internal, prop) {
|
|
22
28
|
return prop || internal;
|
|
29
|
+
}
|
|
30
|
+
export function mergeDefaultProps(comp, props) {
|
|
31
|
+
comp.defaultProps = _objectSpread(_objectSpread({}, comp.defaultProps), props);
|
|
32
|
+
return comp;
|
|
23
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lemon-fe/components",
|
|
3
|
-
"version": "1.2.0-alpha.
|
|
3
|
+
"version": "1.2.0-alpha.2",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@ag-grid-community/react": "29.2.0",
|
|
23
23
|
"@ag-grid-community/styles": "29.2.0",
|
|
24
24
|
"@dnd-kit/core": "^6.0.8",
|
|
25
|
-
"@lemon-fe/hooks": "^1.
|
|
25
|
+
"@lemon-fe/hooks": "^1.2.0-alpha.1",
|
|
26
26
|
"@lemon-fe/utils": "^1.1.0",
|
|
27
27
|
"async-validator": "^4.2.5",
|
|
28
28
|
"bignumber.js": ">=9.0.0",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"registry": "https://registry.npmjs.org"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "49675d62b0403af381b58a8a3da02255f2d16dbc"
|
|
66
66
|
}
|