@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
|
@@ -5,43 +5,50 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
5
5
|
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; }
|
|
6
6
|
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; } }
|
|
7
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
-
import React, {
|
|
9
|
-
import { Input } from
|
|
10
|
-
import Delete from
|
|
11
|
-
import { useEventListener } from
|
|
12
|
-
import classNames from
|
|
8
|
+
import React, { useState } from 'react';
|
|
9
|
+
import { Input } from 'antd';
|
|
10
|
+
import Delete from '@pisell/icon/es/Delete';
|
|
11
|
+
import { useEventListener, useUpdateEffect } from 'ahooks';
|
|
12
|
+
import classNames from 'classnames';
|
|
13
13
|
import "./index.less";
|
|
14
|
-
var list = [
|
|
14
|
+
var list = ['Backspace'];
|
|
15
15
|
var VirtualKeyInput = function VirtualKeyInput(props) {
|
|
16
|
+
var _ref;
|
|
16
17
|
var _props$previewValue = props.previewValue,
|
|
17
18
|
previewValue = _props$previewValue === void 0 ? props.value : _props$previewValue,
|
|
18
|
-
value = props.value
|
|
19
|
-
|
|
19
|
+
value = props.value,
|
|
20
|
+
_props$showDelete = props.showDelete,
|
|
21
|
+
showDelete = _props$showDelete === void 0 ? true : _props$showDelete,
|
|
22
|
+
onValueSelect = props.onValueSelect,
|
|
23
|
+
defaultSelect = props.defaultSelect;
|
|
24
|
+
var _useState = useState(defaultSelect !== null && defaultSelect !== void 0 ? defaultSelect : false),
|
|
20
25
|
_useState2 = _slicedToArray(_useState, 2),
|
|
21
26
|
select = _useState2[0],
|
|
22
27
|
setSelect = _useState2[1];
|
|
23
|
-
useEventListener(
|
|
28
|
+
useEventListener('keydown', function (ev) {
|
|
24
29
|
if (list.includes(ev.key)) {
|
|
25
30
|
_onDelete === null || _onDelete === void 0 ? void 0 : _onDelete();
|
|
26
31
|
}
|
|
27
32
|
});
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
var handleSelectChange = function handleSelectChange(selected) {
|
|
34
|
+
onValueSelect === null || onValueSelect === void 0 ? void 0 : onValueSelect(selected);
|
|
35
|
+
setSelect(selected);
|
|
36
|
+
};
|
|
37
|
+
useUpdateEffect(function () {
|
|
38
|
+
handleSelectChange(false);
|
|
32
39
|
}, [value]);
|
|
33
40
|
var _onDelete = function _onDelete() {
|
|
34
41
|
if (select) {
|
|
35
42
|
var _props$onChange;
|
|
36
43
|
(_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, {
|
|
37
44
|
target: {
|
|
38
|
-
value:
|
|
45
|
+
value: ''
|
|
39
46
|
}
|
|
40
47
|
});
|
|
41
|
-
|
|
48
|
+
handleSelectChange(false);
|
|
42
49
|
return;
|
|
43
50
|
}
|
|
44
|
-
var _val = props.value +
|
|
51
|
+
var _val = props.value + '';
|
|
45
52
|
_val = _val.slice(0, _val.length - 1);
|
|
46
53
|
props.onChange && props.onChange({
|
|
47
54
|
target: {
|
|
@@ -52,12 +59,12 @@ var VirtualKeyInput = function VirtualKeyInput(props) {
|
|
|
52
59
|
return /*#__PURE__*/React.createElement("div", {
|
|
53
60
|
className: "virtual-keyboard-input-wrap"
|
|
54
61
|
}, props.renderInput ? /*#__PURE__*/React.createElement("div", {
|
|
55
|
-
className: classNames(
|
|
56
|
-
|
|
62
|
+
className: classNames('virtual-keyboard-input', {
|
|
63
|
+
'virtual-keyboard-input-select': select
|
|
57
64
|
}),
|
|
58
65
|
onClick: function onClick() {
|
|
59
66
|
if (value) {
|
|
60
|
-
|
|
67
|
+
handleSelectChange(!select);
|
|
61
68
|
}
|
|
62
69
|
}
|
|
63
70
|
}, props.renderInput(props)) : /*#__PURE__*/React.createElement(Input, _extends({
|
|
@@ -66,7 +73,7 @@ var VirtualKeyInput = function VirtualKeyInput(props) {
|
|
|
66
73
|
}, props, {
|
|
67
74
|
readOnly: true,
|
|
68
75
|
value: previewValue
|
|
69
|
-
})), value !== null && value !== void 0 &&
|
|
76
|
+
})), (_ref = "".concat(value !== null && value !== void 0 ? value : "")) !== null && _ref !== void 0 && _ref.length && showDelete ? /*#__PURE__*/React.createElement("div", {
|
|
70
77
|
className: "virtual-keyboard-input-delete",
|
|
71
78
|
onClick: _onDelete
|
|
72
79
|
}, /*#__PURE__*/React.createElement(Delete, {
|
package/es/index.d.ts
CHANGED
|
@@ -102,3 +102,7 @@ export { default as PisellCard } from './components/pisellCard';
|
|
|
102
102
|
export { default as PisellInformationEntry } from './components/pisellInformationEntry';
|
|
103
103
|
export { default as usePisellConfig } from './components/pisell-config-provider/hooks/usePisellConfig';
|
|
104
104
|
export { globalConfig, default as PisellContext } from './components/pisell-config-provider/context';
|
|
105
|
+
export { default as PisellPriceKeyboard } from './components/virtual-keyboard/Amount';
|
|
106
|
+
export { default as PisellNumberKeyboard } from './components/virtual-keyboard/Number';
|
|
107
|
+
export { default as PisellAdjustPrice } from './components/pisellAdjustPrice';
|
|
108
|
+
export { default as PisellAdjustPriceInputNumber } from './components/pisellAdjustPrice/PisellAdjustPriceInputNumber';
|
package/es/index.js
CHANGED
|
@@ -123,4 +123,8 @@ export { default as PisellAlert } from "./components/pisellAlert";
|
|
|
123
123
|
export { default as PisellCard } from "./components/pisellCard";
|
|
124
124
|
export { default as PisellInformationEntry } from "./components/pisellInformationEntry";
|
|
125
125
|
export { default as usePisellConfig } from "./components/pisell-config-provider/hooks/usePisellConfig";
|
|
126
|
-
export { globalConfig, default as PisellContext } from "./components/pisell-config-provider/context";
|
|
126
|
+
export { globalConfig, default as PisellContext } from "./components/pisell-config-provider/context";
|
|
127
|
+
export { default as PisellPriceKeyboard } from "./components/virtual-keyboard/Amount";
|
|
128
|
+
export { default as PisellNumberKeyboard } from "./components/virtual-keyboard/Number";
|
|
129
|
+
export { default as PisellAdjustPrice } from "./components/pisellAdjustPrice";
|
|
130
|
+
export { default as PisellAdjustPriceInputNumber } from "./components/pisellAdjustPrice/PisellAdjustPriceInputNumber";
|
package/es/locales/en-US.d.ts
CHANGED
|
@@ -106,5 +106,11 @@ declare const _default: {
|
|
|
106
106
|
'pisell-wallet-pass-card-redeem': string;
|
|
107
107
|
'pisell-wallet-pass-card-balance': string;
|
|
108
108
|
'pisell-wallet-pass-card-valid-to': string;
|
|
109
|
+
'pisell-adjust-price-price-override': string;
|
|
110
|
+
'pisell-adjust-price-discount': string;
|
|
111
|
+
'pisell-adjust-price-discount-amount': string;
|
|
112
|
+
'pisell-adjust-price-discount-percentage': string;
|
|
113
|
+
'pisell-adjust-price-total-after-discount': string;
|
|
114
|
+
'pisell-adjust-price-discount-can-be-maximum': string;
|
|
109
115
|
};
|
|
110
116
|
export default _default;
|
package/es/locales/en-US.js
CHANGED
|
@@ -130,5 +130,12 @@ export default {
|
|
|
130
130
|
'pisell-wallet-pass-card-detail': 'Detail',
|
|
131
131
|
'pisell-wallet-pass-card-redeem': 'Redeem',
|
|
132
132
|
'pisell-wallet-pass-card-balance': 'Balance',
|
|
133
|
-
'pisell-wallet-pass-card-valid-to': 'Valid to'
|
|
133
|
+
'pisell-wallet-pass-card-valid-to': 'Valid to',
|
|
134
|
+
// 金额修改组件
|
|
135
|
+
'pisell-adjust-price-price-override': "Price override",
|
|
136
|
+
'pisell-adjust-price-discount': "Discount",
|
|
137
|
+
'pisell-adjust-price-discount-amount': "Amount",
|
|
138
|
+
'pisell-adjust-price-discount-percentage': "Percentage",
|
|
139
|
+
'pisell-adjust-price-total-after-discount': "Total after discount: ",
|
|
140
|
+
'pisell-adjust-price-discount-can-be-maximum': "Discount can be maximum"
|
|
134
141
|
};
|
package/es/locales/zh-CN.d.ts
CHANGED
|
@@ -106,5 +106,11 @@ declare const _default: {
|
|
|
106
106
|
'pisell-wallet-pass-card-redeem': string;
|
|
107
107
|
'pisell-wallet-pass-card-balance': string;
|
|
108
108
|
'pisell-wallet-pass-card-valid-to': string;
|
|
109
|
+
'pisell-adjust-price-price-override': string;
|
|
110
|
+
'pisell-adjust-price-discount': string;
|
|
111
|
+
'pisell-adjust-price-discount-amount': string;
|
|
112
|
+
'pisell-adjust-price-discount-percentage': string;
|
|
113
|
+
'pisell-adjust-price-total-after-discount': string;
|
|
114
|
+
'pisell-adjust-price-discount-can-be-maximum': string;
|
|
109
115
|
};
|
|
110
116
|
export default _default;
|
package/es/locales/zh-CN.js
CHANGED
|
@@ -130,5 +130,12 @@ export default {
|
|
|
130
130
|
'pisell-wallet-pass-card-detail': '详情',
|
|
131
131
|
'pisell-wallet-pass-card-redeem': '兑换',
|
|
132
132
|
'pisell-wallet-pass-card-balance': '余额',
|
|
133
|
-
'pisell-wallet-pass-card-valid-to': '有效期至'
|
|
133
|
+
'pisell-wallet-pass-card-valid-to': '有效期至',
|
|
134
|
+
// 金额修改组件
|
|
135
|
+
'pisell-adjust-price-price-override': "一口价",
|
|
136
|
+
'pisell-adjust-price-discount': "折扣",
|
|
137
|
+
'pisell-adjust-price-discount-amount': "金额",
|
|
138
|
+
'pisell-adjust-price-discount-percentage': "百分比",
|
|
139
|
+
'pisell-adjust-price-total-after-discount': "打折后总价",
|
|
140
|
+
'pisell-adjust-price-discount-can-be-maximum': "折扣最高可达"
|
|
134
141
|
};
|
package/es/locales/zh-TW.d.ts
CHANGED
|
@@ -106,5 +106,11 @@ declare const _default: {
|
|
|
106
106
|
'pisell-wallet-pass-card-redeem': string;
|
|
107
107
|
'pisell-wallet-pass-card-balance': string;
|
|
108
108
|
'pisell-wallet-pass-card-valid-to': string;
|
|
109
|
+
'pisell-adjust-price-price-override': string;
|
|
110
|
+
'pisell-adjust-price-discount': string;
|
|
111
|
+
'pisell-adjust-price-discount-amount': string;
|
|
112
|
+
'pisell-adjust-price-discount-percentage': string;
|
|
113
|
+
'pisell-adjust-price-total-after-discount': string;
|
|
114
|
+
'pisell-adjust-price-discount-can-be-maximum': string;
|
|
109
115
|
};
|
|
110
116
|
export default _default;
|
package/es/locales/zh-TW.js
CHANGED
|
@@ -130,5 +130,12 @@ export default {
|
|
|
130
130
|
'pisell-wallet-pass-card-detail': '詳情',
|
|
131
131
|
'pisell-wallet-pass-card-redeem': '兌換',
|
|
132
132
|
'pisell-wallet-pass-card-balance': '餘額',
|
|
133
|
-
'pisell-wallet-pass-card-valid-to': '有效期至'
|
|
133
|
+
'pisell-wallet-pass-card-valid-to': '有效期至',
|
|
134
|
+
// 金额修改组件
|
|
135
|
+
'pisell-adjust-price-price-override': "一口價",
|
|
136
|
+
'pisell-adjust-price-discount': "折扣",
|
|
137
|
+
'pisell-adjust-price-discount-amount': "金額",
|
|
138
|
+
'pisell-adjust-price-discount-percentage': "百分比",
|
|
139
|
+
'pisell-adjust-price-total-after-discount': "打折后總價",
|
|
140
|
+
'pisell-adjust-price-discount-can-be-maximum': "折扣最高可達"
|
|
134
141
|
};
|
|
@@ -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,84 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.tsx
|
|
30
|
+
var PisellAdjustPriceInputNumber_exports = {};
|
|
31
|
+
__export(PisellAdjustPriceInputNumber_exports, {
|
|
32
|
+
default: () => PisellAdjustPriceInputNumber_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(PisellAdjustPriceInputNumber_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_index = __toESM(require("./index"));
|
|
38
|
+
var PisellAdjustPriceInputNumber = (props) => {
|
|
39
|
+
const { value, onChange, originValue, size, prefix, disabled, ...others } = props;
|
|
40
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
41
|
+
const handleChange = (val) => {
|
|
42
|
+
setOpen(false);
|
|
43
|
+
onChange == null ? void 0 : onChange(Number(val.toFixed(2)));
|
|
44
|
+
};
|
|
45
|
+
const content = (0, import_react.useMemo)(() => {
|
|
46
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
47
|
+
import_index.default,
|
|
48
|
+
{
|
|
49
|
+
key: `${open}`,
|
|
50
|
+
originValue,
|
|
51
|
+
defaultValue: value,
|
|
52
|
+
value,
|
|
53
|
+
onChange: handleChange
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}, [originValue, value, open]);
|
|
57
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
58
|
+
import_antd.Popover,
|
|
59
|
+
{
|
|
60
|
+
open,
|
|
61
|
+
content,
|
|
62
|
+
trigger: ["click"],
|
|
63
|
+
overlayInnerStyle: { padding: 0 },
|
|
64
|
+
onOpenChange: (val) => setOpen(val),
|
|
65
|
+
destroyTooltipOnHide: true,
|
|
66
|
+
arrow: false,
|
|
67
|
+
align: {
|
|
68
|
+
offset: [0, 20]
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
/* @__PURE__ */ import_react.default.createElement("span", null, /* @__PURE__ */ import_react.default.createElement(
|
|
72
|
+
import_antd.InputNumber,
|
|
73
|
+
{
|
|
74
|
+
...others,
|
|
75
|
+
disabled,
|
|
76
|
+
prefix,
|
|
77
|
+
size: size || "large",
|
|
78
|
+
value,
|
|
79
|
+
readOnly: true
|
|
80
|
+
}
|
|
81
|
+
))
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
var PisellAdjustPriceInputNumber_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,156 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/pisellAdjustPrice/index.tsx
|
|
30
|
+
var pisellAdjustPrice_exports = {};
|
|
31
|
+
__export(pisellAdjustPrice_exports, {
|
|
32
|
+
default: () => pisellAdjustPrice_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(pisellAdjustPrice_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_classnames = __toESM(require("classnames"));
|
|
38
|
+
var import_pisellText = __toESM(require("../pisellText"));
|
|
39
|
+
var import_Amount = __toESM(require("../virtual-keyboard/Amount"));
|
|
40
|
+
var import_locales = require("../../locales");
|
|
41
|
+
var import_index = require("./index.less");
|
|
42
|
+
var import_usePisellConfig = __toESM(require("../pisell-config-provider/hooks/usePisellConfig"));
|
|
43
|
+
var PisellAdjustPrice = (props) => {
|
|
44
|
+
const { value, onChange, defaultValue, originValue, ...others } = props;
|
|
45
|
+
const config = (0, import_usePisellConfig.default)();
|
|
46
|
+
const [newValue, setNewValue] = (0, import_react.useState)(value || 0);
|
|
47
|
+
const [updateMode, setUpdateMode] = (0, import_react.useState)(
|
|
48
|
+
"priceOverride"
|
|
49
|
+
);
|
|
50
|
+
const [discountMode, setDiscountMode] = (0, import_react.useState)(
|
|
51
|
+
"amount"
|
|
52
|
+
);
|
|
53
|
+
(0, import_react.useEffect)(() => {
|
|
54
|
+
document.body.id = "body";
|
|
55
|
+
}, []);
|
|
56
|
+
const handleEnter = () => {
|
|
57
|
+
if (isDiscountError) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (updateMode === "priceOverride") {
|
|
61
|
+
onChange == null ? void 0 : onChange(Number(newValue));
|
|
62
|
+
} else {
|
|
63
|
+
onChange == null ? void 0 : onChange(Number(totalAfterDiscount));
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const handleChange = (val) => {
|
|
67
|
+
setNewValue(val);
|
|
68
|
+
};
|
|
69
|
+
const totalAfterDiscount = (0, import_react.useMemo)(() => {
|
|
70
|
+
if (discountMode === "amount") {
|
|
71
|
+
return originValue - Number(newValue || 0);
|
|
72
|
+
}
|
|
73
|
+
return originValue - originValue * (Number(newValue || 0) / 100);
|
|
74
|
+
}, [originValue, newValue, discountMode]);
|
|
75
|
+
const isDiscountError = (0, import_react.useMemo)(() => {
|
|
76
|
+
if (updateMode === "priceOverride") {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
return totalAfterDiscount < 0;
|
|
80
|
+
}, [updateMode, totalAfterDiscount]);
|
|
81
|
+
const handleUpdateMode = (val) => {
|
|
82
|
+
setUpdateMode(val);
|
|
83
|
+
setNewValue(val === "priceOverride" ? value || 0 : "");
|
|
84
|
+
};
|
|
85
|
+
const inputFormat = (v) => {
|
|
86
|
+
if (updateMode === "priceOverride") {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
if (discountMode === "amount") {
|
|
90
|
+
return null;
|
|
91
|
+
} else {
|
|
92
|
+
return `${v}%`;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-adjust-price-wrap" }, /* @__PURE__ */ import_react.default.createElement(
|
|
96
|
+
import_antd.Segmented,
|
|
97
|
+
{
|
|
98
|
+
size: "large",
|
|
99
|
+
options: [
|
|
100
|
+
{
|
|
101
|
+
label: (0, import_locales.getText)("pisell-adjust-price-price-override"),
|
|
102
|
+
value: "priceOverride"
|
|
103
|
+
},
|
|
104
|
+
{ label: (0, import_locales.getText)("pisell-adjust-price-discount"), value: "discount" }
|
|
105
|
+
],
|
|
106
|
+
value: updateMode,
|
|
107
|
+
onChange: handleUpdateMode,
|
|
108
|
+
block: true
|
|
109
|
+
}
|
|
110
|
+
), updateMode === "discount" && /* @__PURE__ */ import_react.default.createElement(
|
|
111
|
+
import_antd.Segmented,
|
|
112
|
+
{
|
|
113
|
+
size: "large",
|
|
114
|
+
options: [
|
|
115
|
+
{
|
|
116
|
+
label: `${(0, import_locales.getText)("pisell-adjust-price-discount-amount")}(${(config == null ? void 0 : config.symbol) || "$"})`,
|
|
117
|
+
value: "amount"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
label: `${(0, import_locales.getText)("pisell-adjust-price-discount-percentage")}(%)`,
|
|
121
|
+
value: "percentage"
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
value: discountMode,
|
|
125
|
+
onChange: (val) => {
|
|
126
|
+
setNewValue("");
|
|
127
|
+
setDiscountMode(val);
|
|
128
|
+
},
|
|
129
|
+
block: true
|
|
130
|
+
}
|
|
131
|
+
), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-adjust-price-amount-wrap" }, /* @__PURE__ */ import_react.default.createElement(
|
|
132
|
+
import_Amount.default,
|
|
133
|
+
{
|
|
134
|
+
...others,
|
|
135
|
+
inputFormat,
|
|
136
|
+
defaultValue: updateMode === "priceOverride" ? defaultValue : "",
|
|
137
|
+
key: updateMode,
|
|
138
|
+
value: newValue,
|
|
139
|
+
defaultSelect: updateMode === "priceOverride",
|
|
140
|
+
onChange: handleChange,
|
|
141
|
+
onEnter: handleEnter,
|
|
142
|
+
placeholder: discountMode === "amount" ? "0" : "%"
|
|
143
|
+
}
|
|
144
|
+
)), updateMode === "discount" && /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-low-code-adjust-price-total" }, isDiscountError ? /* @__PURE__ */ import_react.default.createElement(import_pisellText.default.Amount, { value: originValue }) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, newValue && (0, import_locales.getText)("pisell-adjust-price-total-after-discount"), /* @__PURE__ */ import_react.default.createElement(import_pisellText.default.Amount, { value: totalAfterDiscount }))), /* @__PURE__ */ import_react.default.createElement(
|
|
145
|
+
"div",
|
|
146
|
+
{
|
|
147
|
+
className: (0, import_classnames.default)("pisell-low-code-adjust-price-amount-desc", {
|
|
148
|
+
["pisell-low-code-adjust-price-amount-desc-error"]: isDiscountError
|
|
149
|
+
})
|
|
150
|
+
},
|
|
151
|
+
(0, import_locales.getText)("pisell-adjust-price-discount-can-be-maximum"),
|
|
152
|
+
" ",
|
|
153
|
+
discountMode === "amount" ? /* @__PURE__ */ import_react.default.createElement(import_pisellText.default.Amount, { value: originValue }) : "100%"
|
|
154
|
+
)));
|
|
155
|
+
};
|
|
156
|
+
var pisellAdjustPrice_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
|
+
}
|
|
@@ -34,6 +34,7 @@ __export(segmented_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(segmented_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_antd = require("antd");
|
|
37
|
+
var import_index = require("./index.less");
|
|
37
38
|
var Segmented = (props) => {
|
|
38
39
|
return /* @__PURE__ */ import_react.default.createElement(import_antd.Segmented, { ...props });
|
|
39
40
|
};
|
package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js
CHANGED
|
@@ -54,8 +54,10 @@ var batchExport = (exportParams, exportImport) => {
|
|
|
54
54
|
}
|
|
55
55
|
if (type === "all-records") {
|
|
56
56
|
_name = `${(0, import_locales.getText)("table-action-export-import-all-records")}${_name}`;
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
if ((otherParams == null ? void 0 : otherParams.form_id) || (otherParams == null ? void 0 : otherParams.code)) {
|
|
58
|
+
const lists = (exportParams == null ? void 0 : exportParams.originDataSource) || [];
|
|
59
|
+
params.ids = lists.map((item) => (item == null ? void 0 : item.id) || (item == null ? void 0 : item.form_record_id));
|
|
60
|
+
}
|
|
59
61
|
params.file_name = _name;
|
|
60
62
|
}
|
|
61
63
|
if (type === "selected-records") {
|
|
@@ -65,6 +67,11 @@ var batchExport = (exportParams, exportImport) => {
|
|
|
65
67
|
params.ids = selectLists || [];
|
|
66
68
|
params.file_name = _name;
|
|
67
69
|
}
|
|
70
|
+
if (type !== "all-records") {
|
|
71
|
+
params == null ? true : delete params.shipping_status;
|
|
72
|
+
params == null ? true : delete params.payment_status;
|
|
73
|
+
params == null ? true : delete params.status;
|
|
74
|
+
}
|
|
68
75
|
return _batchExport(params);
|
|
69
76
|
};
|
|
70
77
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -35,6 +35,7 @@ module.exports = __toCommonJS(table_exports);
|
|
|
35
35
|
var import_ahooks = require("ahooks");
|
|
36
36
|
var import_antd = require("antd");
|
|
37
37
|
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_classNames = __toESM(require("classNames"));
|
|
38
39
|
var import_hooks = require("../../hooks");
|
|
39
40
|
var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
|
|
40
41
|
var import_Actions = __toESM(require("./Actions"));
|
|
@@ -91,6 +92,10 @@ var GridView = (0, import_model.Provider)(
|
|
|
91
92
|
const { width } = (0, import_ahooks.useSize)(wrapRef) || {};
|
|
92
93
|
const debouncedWidth = (0, import_ahooks.useDebounce)(width, { wait: 100 });
|
|
93
94
|
const utils = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils;
|
|
95
|
+
const isTerminal = (0, import_react.useMemo)(() => {
|
|
96
|
+
var _a2;
|
|
97
|
+
return (_a2 = utils == null ? void 0 : utils.isTerminal) == null ? void 0 : _a2.call(utils);
|
|
98
|
+
}, [utils]);
|
|
94
99
|
const tableId = (0, import_react.useMemo)(() => {
|
|
95
100
|
if (props.__designMode === "design") {
|
|
96
101
|
return "designMode-mock-table-id";
|
|
@@ -299,30 +304,43 @@ var GridView = (0, import_model.Provider)(
|
|
|
299
304
|
},
|
|
300
305
|
className: "materials-grid-form-wrap"
|
|
301
306
|
},
|
|
302
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
303
|
-
|
|
304
|
-
{
|
|
305
|
-
view,
|
|
306
|
-
buttons: actionButtons,
|
|
307
|
-
columnSetting,
|
|
308
|
-
dataSourceGroup,
|
|
309
|
-
filter,
|
|
310
|
-
sort,
|
|
311
|
-
tableId,
|
|
312
|
-
localPagination: (_e = other == null ? void 0 : other.pagination) == null ? void 0 : _e.localPagination,
|
|
313
|
-
gallery,
|
|
314
|
-
exportImport
|
|
315
|
-
}
|
|
316
|
-
), /* @__PURE__ */ import_react.default.createElement(import_Summary.default, { summary }), /* @__PURE__ */ import_react.default.createElement(
|
|
317
|
-
import_View.default,
|
|
307
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
308
|
+
"div",
|
|
318
309
|
{
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
}
|
|
325
|
-
|
|
310
|
+
className: (0, import_classNames.default)("materials-grid", {
|
|
311
|
+
"materials-grid-terminal": isTerminal
|
|
312
|
+
}),
|
|
313
|
+
style,
|
|
314
|
+
ref: wrapRef
|
|
315
|
+
},
|
|
316
|
+
/* @__PURE__ */ import_react.default.createElement(import_Header.default, { title, buttons }),
|
|
317
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
318
|
+
import_Actions.default,
|
|
319
|
+
{
|
|
320
|
+
view,
|
|
321
|
+
buttons: actionButtons,
|
|
322
|
+
columnSetting,
|
|
323
|
+
dataSourceGroup,
|
|
324
|
+
filter,
|
|
325
|
+
sort,
|
|
326
|
+
tableId,
|
|
327
|
+
localPagination: (_e = other == null ? void 0 : other.pagination) == null ? void 0 : _e.localPagination,
|
|
328
|
+
gallery,
|
|
329
|
+
exportImport
|
|
330
|
+
}
|
|
331
|
+
),
|
|
332
|
+
/* @__PURE__ */ import_react.default.createElement(import_Summary.default, { summary }),
|
|
333
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
334
|
+
import_View.default,
|
|
335
|
+
{
|
|
336
|
+
...props,
|
|
337
|
+
filter,
|
|
338
|
+
sort,
|
|
339
|
+
setTableSetting,
|
|
340
|
+
dataSourceGroup
|
|
341
|
+
}
|
|
342
|
+
)
|
|
343
|
+
)
|
|
326
344
|
);
|
|
327
345
|
})
|
|
328
346
|
);
|
|
@@ -38,6 +38,11 @@ var formatApiParams = (params, type) => {
|
|
|
38
38
|
const _url = (params == null ? void 0 : params.url) || (defaultUrl == null ? void 0 : defaultUrl[type]);
|
|
39
39
|
let _params = { ...params };
|
|
40
40
|
delete _params.url;
|
|
41
|
+
if (type !== "export") {
|
|
42
|
+
_params == null ? true : delete _params.shipping_status;
|
|
43
|
+
_params == null ? true : delete _params.payment_status;
|
|
44
|
+
_params == null ? true : delete _params.status;
|
|
45
|
+
}
|
|
41
46
|
return {
|
|
42
47
|
url: _url,
|
|
43
48
|
params: { ..._params }
|