@pisell/materials 6.3.9 → 6.3.10
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +5 -5
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +15 -15
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +16 -16
- package/es/components/dataSourceComponents/fields/index.d.ts +2 -2
- package/es/components/pisellQRScanner/index.d.ts +0 -13
- package/es/components/pisellQRScanner/index.js +0 -8
- package/es/components/pisellText/components/Editable/index.d.ts +29 -0
- package/es/components/pisellText/components/Editable/index.js +130 -0
- package/es/components/pisellText/components/Editable/index.less +40 -0
- package/es/components/pisellText/index.d.ts +1 -0
- package/es/components/pisellText/index.js +2 -0
- package/es/components/select/index.js +4 -2
- package/es/components/sortableList/index.d.ts +1 -1
- package/es/components/sortableList/index.js +2 -1
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js +9 -1
- package/es/components/table/Actions/component/ExportImport/index.js +55 -27
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/table/serve.js +8 -0
- package/es/components/tabs/index.d.ts +1 -0
- package/es/components/tabs/index.js +9 -0
- package/es/components/walletCard/index.d.ts +11 -11
- package/es/components/walletCard/index.js +51 -40
- package/es/locales/en-US.d.ts +1 -1
- package/es/locales/en-US.js +2 -2
- package/es/locales/zh-CN.d.ts +1 -1
- package/es/locales/zh-CN.js +1 -1
- package/es/locales/zh-TW.d.ts +1 -1
- package/es/locales/zh-TW.js +1 -1
- package/es/typings.d.ts +7 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +2 -2
- package/lib/components/pisellQRScanner/index.d.ts +0 -13
- package/lib/components/pisellText/components/Editable/index.d.ts +29 -0
- package/lib/components/pisellText/components/Editable/index.js +139 -0
- package/lib/components/pisellText/components/Editable/index.less +40 -0
- package/lib/components/pisellText/index.d.ts +1 -0
- package/lib/components/pisellText/index.js +2 -0
- package/lib/components/select/index.js +7 -2
- package/lib/components/sortableList/index.d.ts +1 -1
- package/lib/components/sortableList/index.js +2 -2
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js +7 -1
- package/lib/components/table/Actions/component/ExportImport/index.js +37 -25
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/table/serve.js +8 -0
- package/lib/components/tabs/index.d.ts +1 -0
- package/lib/components/tabs/index.js +5 -0
- package/lib/components/walletCard/index.d.ts +11 -11
- package/lib/components/walletCard/index.js +47 -29
- package/lib/locales/en-US.d.ts +1 -1
- package/lib/locales/en-US.js +2 -2
- package/lib/locales/zh-CN.d.ts +1 -1
- package/lib/locales/zh-CN.js +1 -1
- package/lib/locales/zh-TW.d.ts +1 -1
- package/lib/locales/zh-TW.js +1 -1
- package/lib/typings.d.ts +7 -1
- package/lowcode/pisell-text.editable/meta.ts +115 -0
- package/lowcode/pisell-text.editable/snippets.ts +15 -0
- package/lowcode/sortable-list/meta.ts +1 -1
- package/lowcode/wallet-card/meta.ts +20 -0
- package/package.json +1 -1
|
@@ -79,7 +79,7 @@ declare const getFieldComponent: (fieldComponent: string) => (import("react").FC
|
|
|
79
79
|
name?: string | undefined;
|
|
80
80
|
fieldKey?: string | undefined;
|
|
81
81
|
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
82
|
-
}) | import("react").FC<any> | import("react").FC<import("./Input.Mobile/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Phone/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> |
|
|
82
|
+
}) | import("react").FC<any> | import("react").FC<import("./Input.Mobile/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Phone/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<{}> & {
|
|
83
83
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
84
84
|
} & {
|
|
85
85
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
@@ -97,5 +97,5 @@ declare const getFieldComponent: (fieldComponent: string) => (import("react").FC
|
|
|
97
97
|
dataSource?: any;
|
|
98
98
|
}) => JSX.Element) | import("react").FC<import("./TimePicker/type").TimePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & {
|
|
99
99
|
onChange: (value: string) => void;
|
|
100
|
-
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./Upload/type").UploadProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
100
|
+
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./DateRangePicker/type").DateRangePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Upload/type").UploadProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
101
101
|
export { getFieldComponent, formFieldMap };
|
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './index.less';
|
|
3
|
-
import type { DetailedHTMLProps, HTMLAttributes, VideoHTMLAttributes, InputHTMLAttributes } from 'react';
|
|
4
|
-
declare type ExtendedDetailedHTMLProps<T extends HTMLAttributes<E>, E extends HTMLElement> = DetailedHTMLProps<T, E> & {
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
};
|
|
7
|
-
declare global {
|
|
8
|
-
namespace JSX {
|
|
9
|
-
interface IntrinsicElements {
|
|
10
|
-
div: ExtendedDetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
11
|
-
video: DetailedHTMLProps<VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
|
|
12
|
-
input: DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
3
|
export interface PisellQRScannerProps {
|
|
17
4
|
/** 是否可见 */
|
|
18
5
|
visible: boolean;
|
|
@@ -18,14 +18,6 @@ import "./index.less";
|
|
|
18
18
|
import { createPortal } from 'react-dom';
|
|
19
19
|
import { getText } from "../../locales";
|
|
20
20
|
|
|
21
|
-
// 不使用全局声明,改用本地引入React类型
|
|
22
|
-
|
|
23
|
-
// 扩展HTMLAttributes接口以包含children属性
|
|
24
|
-
|
|
25
|
-
// 扩展DetailedHTMLProps类型以使用扩展的HTMLAttributes
|
|
26
|
-
|
|
27
|
-
// 声明JSX命名空间,解决JSX.IntrinsicElements错误
|
|
28
|
-
|
|
29
21
|
// 精确定义组件属性,只接收需要的属性
|
|
30
22
|
|
|
31
23
|
/**
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export declare type MultiLanguageValue = {
|
|
4
|
+
en: string;
|
|
5
|
+
'zh-CN': string;
|
|
6
|
+
'zh-HK': string;
|
|
7
|
+
};
|
|
8
|
+
export interface EditableConfig {
|
|
9
|
+
/** 是否禁用编辑 */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** 最大长度 */
|
|
12
|
+
maxLength?: number;
|
|
13
|
+
/** 编辑图标 */
|
|
14
|
+
icon?: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export interface EditableProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
17
|
+
/** 文本内容,支持字符串或多语言对象 */
|
|
18
|
+
value?: string | MultiLanguageValue;
|
|
19
|
+
/** 子节点内容,优先级高于 value */
|
|
20
|
+
children?: string;
|
|
21
|
+
/** 可编辑配置,boolean 时使用默认配置 */
|
|
22
|
+
editable?: boolean | EditableConfig;
|
|
23
|
+
/** 编辑变更回调 */
|
|
24
|
+
onChange?: (value: string | MultiLanguageValue) => void;
|
|
25
|
+
/** 输入框尺寸 */
|
|
26
|
+
size?: 'large' | 'middle' | 'small';
|
|
27
|
+
}
|
|
28
|
+
declare const Editable: React.FC<EditableProps>;
|
|
29
|
+
export default Editable;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
var _excluded = ["value", "children", "editable", "onChange", "className", "size"];
|
|
2
|
+
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); }
|
|
3
|
+
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); }
|
|
4
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
|
+
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."); }
|
|
6
|
+
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); }
|
|
7
|
+
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; }
|
|
8
|
+
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; } }
|
|
9
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
12
|
+
import React, { useState, useMemo } from 'react';
|
|
13
|
+
import { Input } from 'antd';
|
|
14
|
+
import Icon from "../../../icon";
|
|
15
|
+
import { locales } from '@pisell/utils';
|
|
16
|
+
import classNames from 'classnames';
|
|
17
|
+
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
18
|
+
import Translation from "../../../translation";
|
|
19
|
+
import "./index.less";
|
|
20
|
+
var Editable = function Editable(props) {
|
|
21
|
+
var value = props.value,
|
|
22
|
+
children = props.children,
|
|
23
|
+
_props$editable = props.editable,
|
|
24
|
+
editable = _props$editable === void 0 ? false : _props$editable,
|
|
25
|
+
onChange = props.onChange,
|
|
26
|
+
className = props.className,
|
|
27
|
+
_props$size = props.size,
|
|
28
|
+
size = _props$size === void 0 ? 'middle' : _props$size,
|
|
29
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
30
|
+
var context = useEngineContext();
|
|
31
|
+
var _useState = useState(false),
|
|
32
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
+
isEditing = _useState2[0],
|
|
34
|
+
setIsEditing = _useState2[1];
|
|
35
|
+
// 解析编辑配置
|
|
36
|
+
var editableConfig = useMemo(function () {
|
|
37
|
+
if (typeof editable === 'boolean') {
|
|
38
|
+
return editable ? {} : null;
|
|
39
|
+
}
|
|
40
|
+
return editable || null;
|
|
41
|
+
}, [editable]);
|
|
42
|
+
var currentLocale = useMemo(function () {
|
|
43
|
+
var _context$appHelper$ut;
|
|
44
|
+
var locale = (_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.storage) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.get('umi_locale');
|
|
45
|
+
return locales.formatLocale(locale);
|
|
46
|
+
}, []);
|
|
47
|
+
var displayValue = useMemo(function () {
|
|
48
|
+
if (typeof children === 'string') return children;
|
|
49
|
+
if (typeof value === 'string') {
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
if (value && _typeof(value) === 'object') {
|
|
53
|
+
return value[currentLocale] || '';
|
|
54
|
+
}
|
|
55
|
+
return '';
|
|
56
|
+
}, [value, currentLocale, children]);
|
|
57
|
+
|
|
58
|
+
// 判断是否为多语言对象
|
|
59
|
+
var isMultiLanguage = useMemo(function () {
|
|
60
|
+
return !!value && _typeof(value) === 'object';
|
|
61
|
+
}, [value]);
|
|
62
|
+
|
|
63
|
+
// 编辑功能
|
|
64
|
+
var handleEdit = function handleEdit() {
|
|
65
|
+
if (editableConfig !== null && editableConfig !== void 0 && editableConfig.disabled) return;
|
|
66
|
+
setIsEditing(true);
|
|
67
|
+
};
|
|
68
|
+
var handleInputChange = function handleInputChange(newValue) {
|
|
69
|
+
if (!onChange) return;
|
|
70
|
+
onChange(newValue);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// 编辑模式渲染
|
|
74
|
+
if (isEditing && editableConfig) {
|
|
75
|
+
// 如果是多语言对象,使用 Translation 组件
|
|
76
|
+
if (isMultiLanguage) {
|
|
77
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
className: classNames('pisell-text-editable-editing', className)
|
|
79
|
+
}, /*#__PURE__*/React.createElement(Translation, {
|
|
80
|
+
value: value,
|
|
81
|
+
onChange: handleInputChange,
|
|
82
|
+
onPressEnter: function onPressEnter() {
|
|
83
|
+
return setIsEditing(false);
|
|
84
|
+
}
|
|
85
|
+
// onBlur={() => setIsEditing(false)}
|
|
86
|
+
,
|
|
87
|
+
maxLength: editableConfig.maxLength,
|
|
88
|
+
size: size,
|
|
89
|
+
autoFocus: true
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// 普通字符串,使用 Input 组件
|
|
94
|
+
return /*#__PURE__*/React.createElement(Input, {
|
|
95
|
+
value: displayValue,
|
|
96
|
+
onChange: function onChange(e) {
|
|
97
|
+
return handleInputChange(e.target.value);
|
|
98
|
+
},
|
|
99
|
+
onPressEnter: function onPressEnter() {
|
|
100
|
+
return setIsEditing(false);
|
|
101
|
+
}
|
|
102
|
+
// onBlur={() => setIsEditing(false)}
|
|
103
|
+
,
|
|
104
|
+
maxLength: editableConfig.maxLength,
|
|
105
|
+
size: size,
|
|
106
|
+
autoFocus: true,
|
|
107
|
+
className: classNames('pisell-text-editable-input', className),
|
|
108
|
+
style: others.style
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// 正常显示模式
|
|
113
|
+
return /*#__PURE__*/React.createElement("span", _extends({
|
|
114
|
+
className: classNames('pisell-text-editable', className, {
|
|
115
|
+
'pisell-text-editable-enabled': editableConfig && !editableConfig.disabled
|
|
116
|
+
})
|
|
117
|
+
}, others), displayValue, editableConfig && !editableConfig.disabled && !isEditing && /*#__PURE__*/React.createElement("span", {
|
|
118
|
+
className: "pisell-text-editable-edit-icon",
|
|
119
|
+
onClick: function onClick(e) {
|
|
120
|
+
e.preventDefault();
|
|
121
|
+
e.stopPropagation();
|
|
122
|
+
handleEdit();
|
|
123
|
+
},
|
|
124
|
+
title: "\u70B9\u51FB\u7F16\u8F91"
|
|
125
|
+
}, editableConfig.icon || /*#__PURE__*/React.createElement(Icon, {
|
|
126
|
+
type: "pisell2-edit-05",
|
|
127
|
+
size: 16
|
|
128
|
+
})));
|
|
129
|
+
};
|
|
130
|
+
export default Editable;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.pisell-text-editable {
|
|
2
|
+
position: relative;
|
|
3
|
+
|
|
4
|
+
&-enabled {
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
&-edit-icon {
|
|
9
|
+
margin-left: 4px;
|
|
10
|
+
color: rgba(0, 0, 0, 0.45);
|
|
11
|
+
font-size: 12px;
|
|
12
|
+
opacity: 1;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
pointer-events: auto;
|
|
15
|
+
z-index: 1;
|
|
16
|
+
|
|
17
|
+
&:hover {
|
|
18
|
+
color: #1890ff;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// 确保内部的图标不会阻止点击事件
|
|
22
|
+
* {
|
|
23
|
+
pointer-events: none;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&-input {
|
|
28
|
+
min-width: 100px;
|
|
29
|
+
|
|
30
|
+
&.ant-input {
|
|
31
|
+
border: 1px solid #1890ff;
|
|
32
|
+
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&-editing {
|
|
37
|
+
display: inline-block;
|
|
38
|
+
width: 100%;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -4,5 +4,6 @@ export interface PisellTextProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
4
4
|
declare const PisellText: {
|
|
5
5
|
(props: PisellTextProps): JSX.Element;
|
|
6
6
|
Amount: (props: import("./components/Amount").AmountProps) => JSX.Element;
|
|
7
|
+
Editable: React.FC<import("./components/Editable").EditableProps>;
|
|
7
8
|
};
|
|
8
9
|
export default PisellText;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Amount from "./components/Amount";
|
|
3
|
+
import Editable from "./components/Editable";
|
|
3
4
|
var PisellText = function PisellText(props) {
|
|
4
5
|
return /*#__PURE__*/React.createElement("span", props);
|
|
5
6
|
};
|
|
6
7
|
PisellText.Amount = Amount;
|
|
8
|
+
PisellText.Editable = Editable;
|
|
7
9
|
export default PisellText;
|
|
@@ -23,6 +23,7 @@ var SelectBase = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
23
23
|
options = props.options,
|
|
24
24
|
propsDropdownRender = props.dropdownRender,
|
|
25
25
|
showSearch = props.showSearch,
|
|
26
|
+
onSearch = props.onSearch,
|
|
26
27
|
styleType = props.styleType,
|
|
27
28
|
_props$optionFilterPr = props.optionFilterProp,
|
|
28
29
|
optionFilterProp = _props$optionFilterPr === void 0 ? 'value' : _props$optionFilterPr,
|
|
@@ -87,7 +88,8 @@ var SelectBase = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
87
88
|
placeholder: getText('select-dropdown-render-search'),
|
|
88
89
|
value: searchValue,
|
|
89
90
|
onChange: function onChange(e) {
|
|
90
|
-
|
|
91
|
+
onSearch === null || onSearch === void 0 || onSearch(e.target.value);
|
|
92
|
+
setSearchValue(e.target.value);
|
|
91
93
|
},
|
|
92
94
|
bordered: false,
|
|
93
95
|
allowClear: true,
|
|
@@ -105,7 +107,7 @@ var SelectBase = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
105
107
|
onChange: onSelectAllChange,
|
|
106
108
|
checked: checkboxChecked
|
|
107
109
|
}, getText('select-dropdown-render-select-all')))));
|
|
108
|
-
}, [isShowDropdown, isShowSelectAll, checkboxChecked, propsDropdownRender, searchValue, showSearch]);
|
|
110
|
+
}, [isShowDropdown, isShowSelectAll, checkboxChecked, propsDropdownRender, searchValue, showSearch, onSearch]);
|
|
109
111
|
if (styleType === 'system') {
|
|
110
112
|
return /*#__PURE__*/React.createElement(BrowserSelect, props);
|
|
111
113
|
}
|
|
@@ -4,7 +4,7 @@ export interface SortableListProps<T> {
|
|
|
4
4
|
dataSource: Props<T>["list"];
|
|
5
5
|
onChange: Props<T>["onChange"];
|
|
6
6
|
rowKey: Props<T>["rowKey"];
|
|
7
|
-
renderItem?: (item: T) => React.ReactNode;
|
|
7
|
+
renderItem?: (item: T, index: number) => React.ReactNode;
|
|
8
8
|
activationConstraint?: Props<T>["activationConstraint"];
|
|
9
9
|
}
|
|
10
10
|
declare const SortableList: React.FC<SortableListProps<any>>;
|
|
@@ -18,13 +18,14 @@ var SortableList = function SortableList(props) {
|
|
|
18
18
|
activationConstraint: activationConstraint
|
|
19
19
|
}, function (params) {
|
|
20
20
|
var item = params.item,
|
|
21
|
+
index = params.index,
|
|
21
22
|
p = params.props,
|
|
22
23
|
attributes = params.attributes,
|
|
23
24
|
listeners = params.listeners,
|
|
24
25
|
style = params.style;
|
|
25
26
|
return /*#__PURE__*/React.createElement("div", _extends({}, p, attributes, listeners, {
|
|
26
27
|
style: style
|
|
27
|
-
}), renderItem === null || renderItem === void 0 ? void 0 : renderItem(item));
|
|
28
|
+
}), renderItem === null || renderItem === void 0 ? void 0 : renderItem(item, index));
|
|
28
29
|
});
|
|
29
30
|
};
|
|
30
31
|
export default SortableList;
|
package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js
CHANGED
|
@@ -12,6 +12,12 @@ import { getText } from "../../../../../../../locales/index";
|
|
|
12
12
|
import { exportData } from "../../../../../serve";
|
|
13
13
|
import { defaultOptions } from "../../../../../status";
|
|
14
14
|
import { getFileDateName } from "../../utils/file";
|
|
15
|
+
var exportImportTypeMap = {
|
|
16
|
+
'current-page': 'page',
|
|
17
|
+
'all-records': 'all',
|
|
18
|
+
'selected-records': 'select'
|
|
19
|
+
};
|
|
20
|
+
|
|
15
21
|
// 导出接口
|
|
16
22
|
var _batchExport = /*#__PURE__*/function () {
|
|
17
23
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
|
@@ -52,7 +58,8 @@ export var batchExport = function batchExport(exportParams, exportImport) {
|
|
|
52
58
|
apiUrl = exportImport.apiUrl,
|
|
53
59
|
otherParams = exportImport.otherParams;
|
|
54
60
|
var _name = getFileDateName();
|
|
55
|
-
|
|
61
|
+
// 拆分导入导出参数
|
|
62
|
+
var params = otherParams !== null && otherParams !== void 0 && otherParams.export ? _objectSpread({}, otherParams === null || otherParams === void 0 ? void 0 : otherParams.export) : _objectSpread({}, otherParams);
|
|
56
63
|
params.url = apiUrl === null || apiUrl === void 0 ? void 0 : apiUrl.export;
|
|
57
64
|
console.log("exportParams", exportParams);
|
|
58
65
|
var type = (exportParams === null || exportParams === void 0 ? void 0 : exportParams.type) || defaultOptions.exportType;
|
|
@@ -93,5 +100,6 @@ export var batchExport = function batchExport(exportParams, exportImport) {
|
|
|
93
100
|
params === null || params === void 0 || delete params.payment_status;
|
|
94
101
|
params === null || params === void 0 || delete params.status;
|
|
95
102
|
}
|
|
103
|
+
params.export_select = exportImportTypeMap[type];
|
|
96
104
|
return _batchExport(params);
|
|
97
105
|
};
|
|
@@ -55,6 +55,10 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
55
55
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
56
56
|
errorStatus = _useState10[0],
|
|
57
57
|
setErrorStatus = _useState10[1];
|
|
58
|
+
var _useState11 = useState(false),
|
|
59
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
60
|
+
loading = _useState12[0],
|
|
61
|
+
setLoading = _useState12[1];
|
|
58
62
|
var _useSharedState = useSharedState(Context),
|
|
59
63
|
state = _useSharedState.state;
|
|
60
64
|
var originResultDataSource = state.originResultDataSource,
|
|
@@ -147,9 +151,11 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
147
151
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
148
152
|
while (1) switch (_context.prev = _context.next) {
|
|
149
153
|
case 0:
|
|
150
|
-
apiUrl = exportImport.apiUrl, otherParams = exportImport.otherParams;
|
|
154
|
+
apiUrl = exportImport.apiUrl, otherParams = exportImport.otherParams;
|
|
155
|
+
setLoading(true);
|
|
156
|
+
_context.prev = 2;
|
|
151
157
|
if (!(value === defaultOptions.exportValue)) {
|
|
152
|
-
_context.next =
|
|
158
|
+
_context.next = 11;
|
|
153
159
|
break;
|
|
154
160
|
}
|
|
155
161
|
_params = {
|
|
@@ -157,41 +163,62 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
157
163
|
originDataSource: originResultDataSource,
|
|
158
164
|
currentDataSource: currentDataSource
|
|
159
165
|
};
|
|
160
|
-
_context.next =
|
|
166
|
+
_context.next = 7;
|
|
161
167
|
return batchExport(_params, exportImport);
|
|
162
|
-
case
|
|
168
|
+
case 7:
|
|
163
169
|
result = _context.sent;
|
|
164
170
|
if (result) {
|
|
165
171
|
onCancel();
|
|
166
172
|
}
|
|
167
|
-
_context.next =
|
|
173
|
+
_context.next = 24;
|
|
168
174
|
break;
|
|
169
|
-
case
|
|
170
|
-
if (value === defaultOptions.importValue) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
175
|
+
case 11:
|
|
176
|
+
if (!(value === defaultOptions.importValue)) {
|
|
177
|
+
_context.next = 24;
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
formData = new FormData();
|
|
181
|
+
formData.append('file', file);
|
|
182
|
+
formId = otherParams === null || otherParams === void 0 ? void 0 : otherParams.form_id;
|
|
183
|
+
formCode = otherParams === null || otherParams === void 0 ? void 0 : otherParams.code;
|
|
184
|
+
if (formId) {
|
|
185
|
+
formData.append('form_id', formId);
|
|
186
|
+
}
|
|
187
|
+
if (formCode) {
|
|
188
|
+
formData.append('code', formCode);
|
|
189
|
+
}
|
|
190
|
+
formData.append('url', (apiUrl === null || apiUrl === void 0 ? void 0 : apiUrl.import) || '');
|
|
191
|
+
if (otherParams.import) {
|
|
192
|
+
Object.entries(otherParams.import).forEach(function (_ref5) {
|
|
193
|
+
var _ref6 = _slicedToArray(_ref5, 2),
|
|
194
|
+
key = _ref6[0],
|
|
195
|
+
value = _ref6[1];
|
|
196
|
+
formData.append(key, value);
|
|
197
|
+
});
|
|
189
198
|
}
|
|
190
|
-
|
|
199
|
+
if (!formData) {
|
|
200
|
+
_context.next = 24;
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
message.loading({
|
|
204
|
+
content: 'Loading...',
|
|
205
|
+
key: value
|
|
206
|
+
});
|
|
207
|
+
_context.next = 24;
|
|
208
|
+
return _batchImport.run(formData);
|
|
209
|
+
case 24:
|
|
210
|
+
_context.next = 28;
|
|
211
|
+
break;
|
|
212
|
+
case 26:
|
|
213
|
+
_context.prev = 26;
|
|
214
|
+
_context.t0 = _context["catch"](2);
|
|
215
|
+
case 28:
|
|
216
|
+
setLoading(false);
|
|
217
|
+
case 29:
|
|
191
218
|
case "end":
|
|
192
219
|
return _context.stop();
|
|
193
220
|
}
|
|
194
|
-
}, _callee);
|
|
221
|
+
}, _callee, null, [[2, 26]]);
|
|
195
222
|
}));
|
|
196
223
|
return function onOk() {
|
|
197
224
|
return _ref4.apply(this, arguments);
|
|
@@ -226,6 +253,7 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
226
253
|
onOk: onOk,
|
|
227
254
|
cancelText: getText('table-action-export-import-cancel'),
|
|
228
255
|
okButtonProps: {
|
|
256
|
+
loading: loading,
|
|
229
257
|
disabled: value === defaultOptions.importValue && (!file || !!errorStatus)
|
|
230
258
|
}
|
|
231
259
|
}, /*#__PURE__*/React.createElement(Content, {
|
|
@@ -155,7 +155,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
|
|
|
155
155
|
sort?: SortType | undefined;
|
|
156
156
|
mode: "" | "localStorage" | "remote";
|
|
157
157
|
currentViewMode: ModeType;
|
|
158
|
-
}) => ("
|
|
158
|
+
}) => ("view_mode" | "filter_setting" | "group_by" | "order_by" | "column_setting" | "gallery_setting" | "filters")[];
|
|
159
159
|
export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
|
|
160
160
|
export declare const stringify: (obj: Record<string, any>) => string;
|
|
161
161
|
export {};
|
|
@@ -26,6 +26,14 @@ var defaultUrl = {
|
|
|
26
26
|
* @Date: 2024-09-05 12:01
|
|
27
27
|
*/
|
|
28
28
|
var formatApiParams = function formatApiParams(params, type) {
|
|
29
|
+
if (params instanceof FormData) {
|
|
30
|
+
var url = params.get('url');
|
|
31
|
+
params.delete('url');
|
|
32
|
+
return {
|
|
33
|
+
url: url || (defaultUrl === null || defaultUrl === void 0 ? void 0 : defaultUrl[type]),
|
|
34
|
+
params: params
|
|
35
|
+
};
|
|
36
|
+
}
|
|
29
37
|
var _url = (params === null || params === void 0 ? void 0 : params.url) || (defaultUrl === null || defaultUrl === void 0 ? void 0 : defaultUrl[type]);
|
|
30
38
|
var _params = _objectSpread({}, params);
|
|
31
39
|
delete _params.url;
|
|
@@ -100,6 +100,15 @@ var Tabs = /*#__PURE__*/function (_Component) {
|
|
|
100
100
|
value: function componentDidMount() {
|
|
101
101
|
document.body.id = 'body'; // 解决 antd tabs 样式问题
|
|
102
102
|
}
|
|
103
|
+
}, {
|
|
104
|
+
key: "componentDidUpdate",
|
|
105
|
+
value: function componentDidUpdate(prevProps) {
|
|
106
|
+
if (prevProps.activeKey !== this.props.activeKey) {
|
|
107
|
+
this.setState({
|
|
108
|
+
activeKey: this.props.activeKey
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
103
112
|
}, {
|
|
104
113
|
key: "render",
|
|
105
114
|
value: function render() {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './index.less';
|
|
3
|
-
declare global {
|
|
4
|
-
namespace JSX {
|
|
5
|
-
interface IntrinsicElements {
|
|
6
|
-
[elemName: string]: any;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
3
|
export interface WalletCardItem {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
type: string;
|
|
5
|
+
custom_title?: string | {
|
|
6
|
+
original: string;
|
|
7
|
+
en: string;
|
|
8
|
+
'zh-CN': string;
|
|
9
|
+
'zh-HK': string;
|
|
10
|
+
};
|
|
11
|
+
display?: 0 | 1;
|
|
14
12
|
value?: number;
|
|
15
13
|
}
|
|
16
14
|
export interface WalletCardProps {
|
|
15
|
+
/** 钱包ID */
|
|
16
|
+
id?: string;
|
|
17
17
|
/** 二维码弹窗适配平台 */
|
|
18
18
|
platform?: 'pc' | 'h5' | 'ipad';
|
|
19
19
|
/** 卡片主题 */
|
|
@@ -21,7 +21,7 @@ export interface WalletCardProps {
|
|
|
21
21
|
/** 默认还是完整显示code */
|
|
22
22
|
cardStyle?: 'normal' | 'full';
|
|
23
23
|
/** 条形码还是二维码 */
|
|
24
|
-
codeType?: 'barCode' | '
|
|
24
|
+
codeType?: 'barCode' | 'qrCode';
|
|
25
25
|
/** 二维码方向 */
|
|
26
26
|
codeDirection?: 'bottom' | 'top';
|
|
27
27
|
/** 自定义背景图 */
|