@pisell/materials 2.2.27 → 2.2.29
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 +2 -2
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +13 -13
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +14 -14
- package/es/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +10 -0
- package/es/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.js +62 -0
- package/es/components/pisellAdjustPrice/index.d.ts +10 -0
- package/es/components/pisellAdjustPrice/index.js +148 -0
- package/es/components/pisellAdjustPrice/index.less +30 -0
- package/es/components/segmented/index.d.ts +1 -0
- package/es/components/segmented/index.js +1 -0
- package/es/components/segmented/index.less +3 -0
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js +14 -4
- package/es/components/table/index.js +8 -1
- package/es/components/table/index.less +6 -0
- package/es/components/table/serve.js +7 -0
- package/es/components/virtual-keyboard/Amount/index.d.ts +22 -0
- package/es/components/virtual-keyboard/Amount/index.js +65 -0
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +12 -0
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.js +22 -0
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.less +18 -0
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +19 -0
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.js +213 -0
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.less +9 -0
- package/es/components/virtual-keyboard/Keyboard/index.d.ts +8 -6
- package/es/components/virtual-keyboard/Keyboard/index.js +59 -15
- package/es/components/virtual-keyboard/Keyboard/index.less +35 -24
- package/es/components/virtual-keyboard/Number/index.d.ts +14 -0
- package/es/components/virtual-keyboard/Number/index.js +35 -0
- package/es/components/virtual-keyboard/VirtualInput/index.d.ts +9 -0
- package/es/components/virtual-keyboard/VirtualInput/index.js +41 -0
- package/es/components/virtual-keyboard/VirtualInput/index.less +46 -0
- package/es/components/virtual-keyboard/VirtualKeyInput/index.d.ts +6 -3
- package/es/components/virtual-keyboard/VirtualKeyInput/index.js +27 -20
- package/es/index.d.ts +4 -0
- package/es/index.js +5 -1
- package/es/locales/en-US.d.ts +6 -0
- package/es/locales/en-US.js +8 -1
- package/es/locales/zh-CN.d.ts +6 -0
- package/es/locales/zh-CN.js +8 -1
- package/es/locales/zh-TW.d.ts +6 -0
- package/es/locales/zh-TW.js +8 -1
- package/lib/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +10 -0
- package/lib/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.js +84 -0
- package/lib/components/pisellAdjustPrice/index.d.ts +10 -0
- package/lib/components/pisellAdjustPrice/index.js +156 -0
- package/lib/components/pisellAdjustPrice/index.less +30 -0
- package/lib/components/segmented/index.d.ts +1 -0
- package/lib/components/segmented/index.js +1 -0
- package/lib/components/segmented/index.less +3 -0
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js +9 -2
- package/lib/components/table/index.js +41 -23
- package/lib/components/table/index.less +6 -0
- package/lib/components/table/serve.js +5 -0
- package/lib/components/virtual-keyboard/Amount/index.d.ts +22 -0
- package/lib/components/virtual-keyboard/Amount/index.js +96 -0
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +12 -0
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.js +46 -0
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.less +18 -0
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +19 -0
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.js +245 -0
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.less +9 -0
- package/lib/components/virtual-keyboard/Keyboard/index.d.ts +8 -6
- package/lib/components/virtual-keyboard/Keyboard/index.js +51 -4
- package/lib/components/virtual-keyboard/Keyboard/index.less +35 -24
- package/lib/components/virtual-keyboard/Number/index.d.ts +14 -0
- package/lib/components/virtual-keyboard/Number/index.js +65 -0
- package/lib/components/virtual-keyboard/VirtualInput/index.d.ts +9 -0
- package/lib/components/virtual-keyboard/VirtualInput/index.js +63 -0
- package/lib/components/virtual-keyboard/VirtualInput/index.less +46 -0
- package/lib/components/virtual-keyboard/VirtualKeyInput/index.d.ts +6 -3
- package/lib/components/virtual-keyboard/VirtualKeyInput/index.js +20 -11
- package/lib/index.d.ts +4 -0
- package/lib/index.js +12 -0
- package/lib/locales/en-US.d.ts +6 -0
- package/lib/locales/en-US.js +8 -1
- package/lib/locales/zh-CN.d.ts +6 -0
- package/lib/locales/zh-CN.js +8 -1
- package/lib/locales/zh-TW.d.ts +6 -0
- package/lib/locales/zh-TW.js +8 -1
- package/lowcode/input/meta.ts +25 -0
- package/lowcode/pisell-adjust-price/meta.ts +58 -0
- package/lowcode/pisell-adjust-price/snippets.ts +10 -0
- package/lowcode/pisell-adjust-price-input-number/meta.ts +245 -0
- package/lowcode/pisell-number-keyboard/meta.ts +98 -0
- package/lowcode/pisell-price-keyboard/meta.ts +174 -0
- package/package.json +2 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InputNumberProps } from 'antd/es/input-number';
|
|
3
|
+
export interface PisellAdjustPriceInputNumberProps extends Omit<InputNumberProps, 'onChange'> {
|
|
4
|
+
value?: number;
|
|
5
|
+
originValue: number;
|
|
6
|
+
defaultValue?: number;
|
|
7
|
+
onChange?: (val: number) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const PisellAdjustPriceInputNumber: (props: PisellAdjustPriceInputNumberProps) => React.JSX.Element;
|
|
10
|
+
export default PisellAdjustPriceInputNumber;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var _excluded = ["value", "onChange", "originValue", "size", "prefix", "disabled"];
|
|
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
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."); }
|
|
5
|
+
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); }
|
|
6
|
+
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; }
|
|
7
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
8
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
import React, { useMemo, useState } from 'react';
|
|
12
|
+
import { InputNumber, Popover } from 'antd';
|
|
13
|
+
import PisellAdjustPricePanel from "./index";
|
|
14
|
+
var PisellAdjustPriceInputNumber = function PisellAdjustPriceInputNumber(props) {
|
|
15
|
+
var value = props.value,
|
|
16
|
+
onChange = props.onChange,
|
|
17
|
+
originValue = props.originValue,
|
|
18
|
+
size = props.size,
|
|
19
|
+
prefix = props.prefix,
|
|
20
|
+
disabled = props.disabled,
|
|
21
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
22
|
+
var _useState = useState(false),
|
|
23
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
24
|
+
open = _useState2[0],
|
|
25
|
+
setOpen = _useState2[1];
|
|
26
|
+
var handleChange = function handleChange(val) {
|
|
27
|
+
setOpen(false);
|
|
28
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(Number(val.toFixed(2)));
|
|
29
|
+
};
|
|
30
|
+
var content = useMemo(function () {
|
|
31
|
+
return /*#__PURE__*/React.createElement(PisellAdjustPricePanel, {
|
|
32
|
+
key: "".concat(open),
|
|
33
|
+
originValue: originValue,
|
|
34
|
+
defaultValue: value,
|
|
35
|
+
value: value,
|
|
36
|
+
onChange: handleChange
|
|
37
|
+
});
|
|
38
|
+
}, [originValue, value, open]);
|
|
39
|
+
return /*#__PURE__*/React.createElement(Popover, {
|
|
40
|
+
open: open,
|
|
41
|
+
content: content,
|
|
42
|
+
trigger: ['click'],
|
|
43
|
+
overlayInnerStyle: {
|
|
44
|
+
padding: 0
|
|
45
|
+
},
|
|
46
|
+
onOpenChange: function onOpenChange(val) {
|
|
47
|
+
return setOpen(val);
|
|
48
|
+
},
|
|
49
|
+
destroyTooltipOnHide: true,
|
|
50
|
+
arrow: false,
|
|
51
|
+
align: {
|
|
52
|
+
offset: [0, 20]
|
|
53
|
+
}
|
|
54
|
+
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InputNumber, _extends({}, others, {
|
|
55
|
+
disabled: disabled,
|
|
56
|
+
prefix: prefix,
|
|
57
|
+
size: size || 'large',
|
|
58
|
+
value: value,
|
|
59
|
+
readOnly: true
|
|
60
|
+
}))));
|
|
61
|
+
};
|
|
62
|
+
export default PisellAdjustPriceInputNumber;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export interface PisellAdjustPriceProps {
|
|
4
|
+
value?: number;
|
|
5
|
+
originValue: number;
|
|
6
|
+
defaultValue?: number;
|
|
7
|
+
onChange?: (val: number) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const PisellAdjustPrice: (props: PisellAdjustPriceProps) => React.JSX.Element;
|
|
10
|
+
export default PisellAdjustPrice;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["value", "onChange", "defaultValue", "originValue"];
|
|
3
|
+
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; }
|
|
4
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
5
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
6
|
+
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); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
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
|
+
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
|
+
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
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
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
|
+
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 React, { useEffect, useMemo, useState } from 'react';
|
|
16
|
+
import { Segmented } from 'antd';
|
|
17
|
+
import classNames from 'classnames';
|
|
18
|
+
import PisellText from "../pisellText";
|
|
19
|
+
import Amount from "../virtual-keyboard/Amount";
|
|
20
|
+
import { getText } from "../../locales";
|
|
21
|
+
import "./index.less";
|
|
22
|
+
import usePisellConfig from "../pisell-config-provider/hooks/usePisellConfig";
|
|
23
|
+
var PisellAdjustPrice = function PisellAdjustPrice(props) {
|
|
24
|
+
var value = props.value,
|
|
25
|
+
onChange = props.onChange,
|
|
26
|
+
defaultValue = props.defaultValue,
|
|
27
|
+
originValue = props.originValue,
|
|
28
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
29
|
+
var config = usePisellConfig();
|
|
30
|
+
var _useState = useState(value || 0),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
newValue = _useState2[0],
|
|
33
|
+
setNewValue = _useState2[1];
|
|
34
|
+
|
|
35
|
+
// 一口价或者折扣
|
|
36
|
+
var _useState3 = useState('priceOverride'),
|
|
37
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
38
|
+
updateMode = _useState4[0],
|
|
39
|
+
setUpdateMode = _useState4[1];
|
|
40
|
+
|
|
41
|
+
// 折扣模式
|
|
42
|
+
// 折扣模式分为 金额 和 百分比
|
|
43
|
+
var _useState5 = useState('amount'),
|
|
44
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
45
|
+
discountMode = _useState6[0],
|
|
46
|
+
setDiscountMode = _useState6[1];
|
|
47
|
+
useEffect(function () {
|
|
48
|
+
document.body.id = 'body';
|
|
49
|
+
}, []);
|
|
50
|
+
var handleEnter = function handleEnter() {
|
|
51
|
+
if (isDiscountError) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// 一口价直接取newValue
|
|
56
|
+
if (updateMode === 'priceOverride') {
|
|
57
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(Number(newValue));
|
|
58
|
+
} else {
|
|
59
|
+
// 折扣模式取折扣价格
|
|
60
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(Number(totalAfterDiscount));
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
var handleChange = function handleChange(val) {
|
|
64
|
+
setNewValue(val);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// 计算折扣后的价格
|
|
68
|
+
var totalAfterDiscount = useMemo(function () {
|
|
69
|
+
if (discountMode === 'amount') {
|
|
70
|
+
return originValue - Number(newValue || 0);
|
|
71
|
+
}
|
|
72
|
+
return originValue - originValue * (Number(newValue || 0) / 100);
|
|
73
|
+
}, [originValue, newValue, discountMode]);
|
|
74
|
+
var isDiscountError = useMemo(function () {
|
|
75
|
+
// 一口价时不展示折扣值
|
|
76
|
+
if (updateMode === 'priceOverride') {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
// 折扣模式为金额时 输入金额不能大于原始值
|
|
80
|
+
return totalAfterDiscount < 0;
|
|
81
|
+
}, [updateMode, totalAfterDiscount]);
|
|
82
|
+
var handleUpdateMode = function handleUpdateMode(val) {
|
|
83
|
+
setUpdateMode(val);
|
|
84
|
+
setNewValue(val === 'priceOverride' ? value || 0 : '');
|
|
85
|
+
};
|
|
86
|
+
var inputFormat = function inputFormat(v) {
|
|
87
|
+
if (updateMode === 'priceOverride') {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
if (discountMode === 'amount') {
|
|
91
|
+
return null;
|
|
92
|
+
} else {
|
|
93
|
+
return "".concat(v, "%");
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
97
|
+
className: "pisell-lowcode-adjust-price-wrap"
|
|
98
|
+
}, /*#__PURE__*/React.createElement(Segmented, {
|
|
99
|
+
size: "large",
|
|
100
|
+
options: [{
|
|
101
|
+
label: getText('pisell-adjust-price-price-override'),
|
|
102
|
+
value: 'priceOverride'
|
|
103
|
+
}, {
|
|
104
|
+
label: getText('pisell-adjust-price-discount'),
|
|
105
|
+
value: 'discount'
|
|
106
|
+
}],
|
|
107
|
+
value: updateMode,
|
|
108
|
+
onChange: handleUpdateMode,
|
|
109
|
+
block: true
|
|
110
|
+
}), updateMode === 'discount' && /*#__PURE__*/React.createElement(Segmented, {
|
|
111
|
+
size: "large",
|
|
112
|
+
options: [{
|
|
113
|
+
label: "".concat(getText('pisell-adjust-price-discount-amount'), "(").concat((config === null || config === void 0 ? void 0 : config.symbol) || '$', ")"),
|
|
114
|
+
value: 'amount'
|
|
115
|
+
}, {
|
|
116
|
+
label: "".concat(getText('pisell-adjust-price-discount-percentage'), "(%)"),
|
|
117
|
+
value: 'percentage'
|
|
118
|
+
}],
|
|
119
|
+
value: discountMode,
|
|
120
|
+
onChange: function onChange(val) {
|
|
121
|
+
setNewValue('');
|
|
122
|
+
setDiscountMode(val);
|
|
123
|
+
},
|
|
124
|
+
block: true
|
|
125
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
126
|
+
className: "pisell-lowcode-adjust-price-amount-wrap"
|
|
127
|
+
}, /*#__PURE__*/React.createElement(Amount, _extends({}, others, {
|
|
128
|
+
inputFormat: inputFormat,
|
|
129
|
+
defaultValue: updateMode === 'priceOverride' ? defaultValue : '',
|
|
130
|
+
key: updateMode,
|
|
131
|
+
value: newValue,
|
|
132
|
+
defaultSelect: updateMode === 'priceOverride',
|
|
133
|
+
onChange: handleChange,
|
|
134
|
+
onEnter: handleEnter,
|
|
135
|
+
placeholder: discountMode === 'amount' ? '0' : '%'
|
|
136
|
+
}))), updateMode === 'discount' && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
137
|
+
className: "pisell-low-code-adjust-price-total"
|
|
138
|
+
}, isDiscountError ? /*#__PURE__*/React.createElement(PisellText.Amount, {
|
|
139
|
+
value: originValue
|
|
140
|
+
}) : /*#__PURE__*/React.createElement(React.Fragment, null, newValue && getText('pisell-adjust-price-total-after-discount'), /*#__PURE__*/React.createElement(PisellText.Amount, {
|
|
141
|
+
value: totalAfterDiscount
|
|
142
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
143
|
+
className: classNames('pisell-low-code-adjust-price-amount-desc', _defineProperty({}, 'pisell-low-code-adjust-price-amount-desc-error', isDiscountError))
|
|
144
|
+
}, getText('pisell-adjust-price-discount-can-be-maximum'), ' ', discountMode === 'amount' ? /*#__PURE__*/React.createElement(PisellText.Amount, {
|
|
145
|
+
value: originValue
|
|
146
|
+
}) : '100%')));
|
|
147
|
+
};
|
|
148
|
+
export default PisellAdjustPrice;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.pisell-lowcode-adjust-price-wrap {
|
|
2
|
+
width: 380px;
|
|
3
|
+
border-radius: 10px;
|
|
4
|
+
background-color: #fff;
|
|
5
|
+
padding: 10px;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: 10px;
|
|
9
|
+
.pisell-lowcode-adjust-price-amount-wrap {
|
|
10
|
+
padding: 10px;
|
|
11
|
+
border-radius: 10px;
|
|
12
|
+
background: var(--Gray-300, #D0D5DD);
|
|
13
|
+
}
|
|
14
|
+
.pisell-low-code-adjust-price-total {
|
|
15
|
+
color: var(--Gray-900, #101828);
|
|
16
|
+
font-size: 20px;
|
|
17
|
+
font-weight: 600;
|
|
18
|
+
line-height: 30px; /* 150% */
|
|
19
|
+
}
|
|
20
|
+
.pisell-low-code-adjust-price-amount-desc {
|
|
21
|
+
color: var(--Gray-500, #667085);
|
|
22
|
+
font-size: 16px;
|
|
23
|
+
font-style: normal;
|
|
24
|
+
font-weight: 400;
|
|
25
|
+
line-height: 24px; /* 150% */
|
|
26
|
+
}
|
|
27
|
+
.pisell-low-code-adjust-price-amount-desc-error {
|
|
28
|
+
color: var(--Error-600, #D92D20);
|
|
29
|
+
}
|
|
30
|
+
}
|
package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js
CHANGED
|
@@ -70,10 +70,13 @@ export var batchExport = function batchExport(exportParams, exportImport) {
|
|
|
70
70
|
// 所有记录
|
|
71
71
|
if (type === "all-records") {
|
|
72
72
|
_name = "".concat(getText("table-action-export-import-all-records")).concat(_name);
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
// 表单则直接导出
|
|
74
|
+
if (otherParams !== null && otherParams !== void 0 && otherParams.form_id || otherParams !== null && otherParams !== void 0 && otherParams.code) {
|
|
75
|
+
var _lists = (exportParams === null || exportParams === void 0 ? void 0 : exportParams.originDataSource) || [];
|
|
76
|
+
params.ids = _lists.map(function (item) {
|
|
77
|
+
return (item === null || item === void 0 ? void 0 : item.id) || (item === null || item === void 0 ? void 0 : item.form_record_id);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
77
80
|
params.file_name = _name;
|
|
78
81
|
}
|
|
79
82
|
|
|
@@ -83,5 +86,12 @@ export var batchExport = function batchExport(exportParams, exportImport) {
|
|
|
83
86
|
params.ids = selectLists || [];
|
|
84
87
|
params.file_name = _name;
|
|
85
88
|
}
|
|
89
|
+
|
|
90
|
+
// 不是所有记录则删除对应的参数
|
|
91
|
+
if (type !== 'all-records') {
|
|
92
|
+
params === null || params === void 0 ? true : delete params.shipping_status;
|
|
93
|
+
params === null || params === void 0 ? true : delete params.payment_status;
|
|
94
|
+
params === null || params === void 0 ? true : delete params.status;
|
|
95
|
+
}
|
|
86
96
|
return _batchExport(params);
|
|
87
97
|
};
|
|
@@ -17,6 +17,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
17
17
|
import { useDebounce, useSize } from 'ahooks';
|
|
18
18
|
import { Form } from 'antd';
|
|
19
19
|
import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
|
20
|
+
import classNames from 'classNames';
|
|
20
21
|
import { useSharedState } from "../../hooks";
|
|
21
22
|
import useEngineContext from "../../hooks/useEngineContext";
|
|
22
23
|
import Actions from "./Actions";
|
|
@@ -79,6 +80,10 @@ var GridView = Provider( /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
79
80
|
wait: 100
|
|
80
81
|
});
|
|
81
82
|
var utils = context === null || context === void 0 ? void 0 : (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils;
|
|
83
|
+
var isTerminal = useMemo(function () {
|
|
84
|
+
var _utils$isTerminal;
|
|
85
|
+
return utils === null || utils === void 0 ? void 0 : (_utils$isTerminal = utils.isTerminal) === null || _utils$isTerminal === void 0 ? void 0 : _utils$isTerminal.call(utils);
|
|
86
|
+
}, [utils]);
|
|
82
87
|
var tableId = useMemo(function () {
|
|
83
88
|
if (props.__designMode === 'design') {
|
|
84
89
|
return 'designMode-mock-table-id';
|
|
@@ -285,7 +290,9 @@ var GridView = Provider( /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
285
290
|
},
|
|
286
291
|
className: "materials-grid-form-wrap"
|
|
287
292
|
}, /*#__PURE__*/React.createElement("div", {
|
|
288
|
-
className: 'materials-grid',
|
|
293
|
+
className: classNames('materials-grid', {
|
|
294
|
+
'materials-grid-terminal': isTerminal
|
|
295
|
+
}),
|
|
289
296
|
style: style,
|
|
290
297
|
ref: wrapRef
|
|
291
298
|
}, /*#__PURE__*/React.createElement(Header, {
|
|
@@ -29,6 +29,13 @@ var formatApiParams = function formatApiParams(params, type) {
|
|
|
29
29
|
var _url = (params === null || params === void 0 ? void 0 : params.url) || (defaultUrl === null || defaultUrl === void 0 ? void 0 : defaultUrl[type]);
|
|
30
30
|
var _params = _objectSpread({}, params);
|
|
31
31
|
delete _params.url;
|
|
32
|
+
|
|
33
|
+
// 删除无用数据
|
|
34
|
+
if (type !== 'export') {
|
|
35
|
+
_params === null || _params === void 0 ? true : delete _params.shipping_status;
|
|
36
|
+
_params === null || _params === void 0 ? true : delete _params.payment_status;
|
|
37
|
+
_params === null || _params === void 0 ? true : delete _params.status;
|
|
38
|
+
}
|
|
32
39
|
return {
|
|
33
40
|
url: _url,
|
|
34
41
|
params: _objectSpread({}, _params)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseNumberKeyboardProps } from '../BaseNumberKeyboard';
|
|
3
|
+
export interface AmountProps {
|
|
4
|
+
max?: number;
|
|
5
|
+
min?: number;
|
|
6
|
+
doneText?: string;
|
|
7
|
+
resetText?: string;
|
|
8
|
+
defaultValue?: string | number;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
amountProps?: {
|
|
11
|
+
showCurrencySymbol: boolean;
|
|
12
|
+
useThousandsSeparator: boolean;
|
|
13
|
+
};
|
|
14
|
+
presets?: BaseNumberKeyboardProps['presets'];
|
|
15
|
+
value?: string | number;
|
|
16
|
+
onChange?: (val: string | number) => void;
|
|
17
|
+
onEnter?: (val: string | number) => void;
|
|
18
|
+
defaultSelect?: boolean;
|
|
19
|
+
inputFormat?: (_v: string) => React.ReactNode | null;
|
|
20
|
+
}
|
|
21
|
+
declare const Amount: (props: AmountProps) => React.JSX.Element;
|
|
22
|
+
export default Amount;
|
|
@@ -0,0 +1,65 @@
|
|
|
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(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import React, { useEffect } from 'react';
|
|
8
|
+
import { useControllableValue } from 'ahooks';
|
|
9
|
+
import BaseNumberKeyboard from "../BaseNumberKeyboard";
|
|
10
|
+
import PisellText from "../../pisellText";
|
|
11
|
+
var Amount = function Amount(props) {
|
|
12
|
+
var min = props.min,
|
|
13
|
+
max = props.max,
|
|
14
|
+
amountProps = props.amountProps,
|
|
15
|
+
doneText = props.doneText,
|
|
16
|
+
resetText = props.resetText,
|
|
17
|
+
defaultValue = props.defaultValue,
|
|
18
|
+
placeholder = props.placeholder,
|
|
19
|
+
onEnter = props.onEnter,
|
|
20
|
+
presets = props.presets,
|
|
21
|
+
defaultSelect = props.defaultSelect,
|
|
22
|
+
inputFormat = props.inputFormat;
|
|
23
|
+
var _useControllableValue = useControllableValue(props, {
|
|
24
|
+
defaultValue: defaultValue || ""
|
|
25
|
+
}),
|
|
26
|
+
_useControllableValue2 = _slicedToArray(_useControllableValue, 2),
|
|
27
|
+
value = _useControllableValue2[0],
|
|
28
|
+
setValue = _useControllableValue2[1];
|
|
29
|
+
useEffect(function () {
|
|
30
|
+
document.body.id = 'body';
|
|
31
|
+
}, []);
|
|
32
|
+
var format = function format(_v) {
|
|
33
|
+
var v = "".concat(_v);
|
|
34
|
+
if (inputFormat !== null && inputFormat !== void 0 && inputFormat(v)) {
|
|
35
|
+
return inputFormat === null || inputFormat === void 0 ? void 0 : inputFormat(v);
|
|
36
|
+
}
|
|
37
|
+
// 取value小数位数
|
|
38
|
+
var precision = v.includes('.') ? v.split('.')[1].length : 0;
|
|
39
|
+
var endWith = v.endsWith('.');
|
|
40
|
+
// 最后一位是小数点时去除
|
|
41
|
+
var value = endWith ? v.slice(0, -1) : v;
|
|
42
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PisellText.Amount, {
|
|
43
|
+
value: value,
|
|
44
|
+
precision: precision,
|
|
45
|
+
hideDecimalForWholeNumbers: false,
|
|
46
|
+
showCurrencySymbol: amountProps === null || amountProps === void 0 ? void 0 : amountProps.showCurrencySymbol,
|
|
47
|
+
useThousandsSeparator: amountProps === null || amountProps === void 0 ? void 0 : amountProps.useThousandsSeparator
|
|
48
|
+
}), endWith && '.');
|
|
49
|
+
};
|
|
50
|
+
return /*#__PURE__*/React.createElement(BaseNumberKeyboard, {
|
|
51
|
+
defaultSelect: defaultSelect,
|
|
52
|
+
max: max,
|
|
53
|
+
min: min,
|
|
54
|
+
value: value,
|
|
55
|
+
onChange: setValue,
|
|
56
|
+
placeholder: placeholder,
|
|
57
|
+
defaultValue: defaultValue,
|
|
58
|
+
format: format,
|
|
59
|
+
doneText: doneText,
|
|
60
|
+
resetText: resetText,
|
|
61
|
+
onEnter: onEnter,
|
|
62
|
+
presets: presets
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
export default Amount;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import "./Presets.less";
|
|
3
|
+
export declare type PresetsItem = {
|
|
4
|
+
label: string;
|
|
5
|
+
value: number | string;
|
|
6
|
+
};
|
|
7
|
+
export interface PresetsProps {
|
|
8
|
+
presets?: PresetsItem[];
|
|
9
|
+
onChange: (val: string) => void;
|
|
10
|
+
}
|
|
11
|
+
declare const Presets: (props: PresetsProps) => React.JSX.Element | null;
|
|
12
|
+
export default Presets;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import "./Presets.less";
|
|
3
|
+
var Presets = function Presets(props) {
|
|
4
|
+
var presets = props.presets,
|
|
5
|
+
onChange = props.onChange;
|
|
6
|
+
return useMemo(function () {
|
|
7
|
+
if (!(presets !== null && presets !== void 0 && presets.length)) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
11
|
+
className: "pisell-virtual-keyboard-preset"
|
|
12
|
+
}, presets.map(function (item) {
|
|
13
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
onClick: function onClick() {
|
|
15
|
+
return onChange("".concat(item.value));
|
|
16
|
+
},
|
|
17
|
+
className: "pisell-virtual-keyboard-preset-item"
|
|
18
|
+
}, item.label);
|
|
19
|
+
}));
|
|
20
|
+
}, [presets]);
|
|
21
|
+
};
|
|
22
|
+
export default Presets;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.pisell-virtual-keyboard-preset {
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: 7px;
|
|
4
|
+
flex-wrap: wrap;
|
|
5
|
+
margin-bottom: 8px;
|
|
6
|
+
.pisell-virtual-keyboard-preset-item {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex: 1;
|
|
9
|
+
padding: 12px 20px;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
height: 48px;
|
|
13
|
+
border-radius: 8px;
|
|
14
|
+
border: 1px solid var(--Gray-300, #D0D5DD);
|
|
15
|
+
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
|
|
16
|
+
background: var(--Primary-25, #FCFAFF);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PresetsProps } from "./Presets";
|
|
3
|
+
import './index.less';
|
|
4
|
+
export interface BaseNumberKeyboardProps {
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
format?: (val: string) => React.ReactNode;
|
|
7
|
+
defaultValue?: string | number;
|
|
8
|
+
doneText?: string;
|
|
9
|
+
resetText?: string;
|
|
10
|
+
onChange?: (val: string) => void;
|
|
11
|
+
onEnter?: (val: string) => void;
|
|
12
|
+
value?: string | number;
|
|
13
|
+
max?: number;
|
|
14
|
+
min?: number;
|
|
15
|
+
presets?: PresetsProps['presets'];
|
|
16
|
+
defaultSelect?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const BaseNumberKeyboard: (props: BaseNumberKeyboardProps) => React.JSX.Element;
|
|
19
|
+
export default BaseNumberKeyboard;
|