@pisell/materials 3.0.49-gray → 3.0.50-gray
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 +19 -19
- 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/pisellStatisticList/index.js +2 -1
- package/es/components/pisellStatisticList/index.less +4 -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/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 +4 -0
- 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/pisellStatisticList/index.js +1 -1
- package/lib/components/pisellStatisticList/index.less +4 -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/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/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 +1 -1
|
@@ -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,5 +102,9 @@ 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';
|
|
105
109
|
export { default as PisellStatisticList } from './components/pisellStatisticList';
|
|
106
110
|
export { default as PisellFloatingPanel } from './components/pisellFloatingPanel';
|
package/es/index.js
CHANGED
|
@@ -124,5 +124,9 @@ 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
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";
|
|
127
131
|
export { default as PisellStatisticList } from "./components/pisellStatisticList";
|
|
128
132
|
export { default as PisellFloatingPanel } from "./components/pisellFloatingPanel";
|
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
|
+
}
|
|
@@ -87,7 +87,7 @@ var PisellStatisticList = (props) => {
|
|
|
87
87
|
item.value
|
|
88
88
|
),
|
|
89
89
|
!!((_a = item.children) == null ? void 0 : _a.length) && /* @__PURE__ */ import_react.default.createElement(import_antd.Row, { className: "pisell-lowcode-statistic-list-item-children-wrap" }, item.children.map((child) => {
|
|
90
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 12 }, /* @__PURE__ */ import_react.default.createElement(
|
|
90
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 12, className: "pisell-lowcode-statistic-list-item-children-item" }, /* @__PURE__ */ import_react.default.createElement(
|
|
91
91
|
"span",
|
|
92
92
|
{
|
|
93
93
|
className: "pisell-lowcode-statistic-list-item-children-label",
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
line-height: 28px; /* 155.556% */
|
|
26
26
|
}
|
|
27
27
|
.pisell-lowcode-statistic-list-item-children-wrap {
|
|
28
|
+
.pisell-lowcode-statistic-list-item-children-item {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: baseline;
|
|
31
|
+
}
|
|
28
32
|
.pisell-lowcode-statistic-list-item-children-label {
|
|
29
33
|
color: var(--Base-White, #fff);
|
|
30
34
|
font-size: 12px;
|
|
@@ -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
|
};
|
|
@@ -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,96 @@
|
|
|
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/virtual-keyboard/Amount/index.tsx
|
|
30
|
+
var Amount_exports = {};
|
|
31
|
+
__export(Amount_exports, {
|
|
32
|
+
default: () => Amount_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Amount_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_ahooks = require("ahooks");
|
|
37
|
+
var import_BaseNumberKeyboard = __toESM(require("../BaseNumberKeyboard"));
|
|
38
|
+
var import_pisellText = __toESM(require("../../pisellText"));
|
|
39
|
+
var Amount = (props) => {
|
|
40
|
+
const {
|
|
41
|
+
min,
|
|
42
|
+
max,
|
|
43
|
+
amountProps,
|
|
44
|
+
doneText,
|
|
45
|
+
resetText,
|
|
46
|
+
defaultValue,
|
|
47
|
+
placeholder,
|
|
48
|
+
onEnter,
|
|
49
|
+
presets,
|
|
50
|
+
defaultSelect,
|
|
51
|
+
inputFormat
|
|
52
|
+
} = props;
|
|
53
|
+
const [value, setValue] = (0, import_ahooks.useControllableValue)(props, {
|
|
54
|
+
defaultValue: defaultValue || ""
|
|
55
|
+
});
|
|
56
|
+
(0, import_react.useEffect)(() => {
|
|
57
|
+
document.body.id = "body";
|
|
58
|
+
}, []);
|
|
59
|
+
const format = (_v) => {
|
|
60
|
+
const v = `${_v}`;
|
|
61
|
+
if (inputFormat == null ? void 0 : inputFormat(v)) {
|
|
62
|
+
return inputFormat == null ? void 0 : inputFormat(v);
|
|
63
|
+
}
|
|
64
|
+
const precision = v.includes(".") ? v.split(".")[1].length : 0;
|
|
65
|
+
const endWith = v.endsWith(".");
|
|
66
|
+
const value2 = endWith ? v.slice(0, -1) : v;
|
|
67
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
68
|
+
import_pisellText.default.Amount,
|
|
69
|
+
{
|
|
70
|
+
value: value2,
|
|
71
|
+
precision,
|
|
72
|
+
hideDecimalForWholeNumbers: false,
|
|
73
|
+
showCurrencySymbol: amountProps == null ? void 0 : amountProps.showCurrencySymbol,
|
|
74
|
+
useThousandsSeparator: amountProps == null ? void 0 : amountProps.useThousandsSeparator
|
|
75
|
+
}
|
|
76
|
+
), endWith && ".");
|
|
77
|
+
};
|
|
78
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
79
|
+
import_BaseNumberKeyboard.default,
|
|
80
|
+
{
|
|
81
|
+
defaultSelect,
|
|
82
|
+
max,
|
|
83
|
+
min,
|
|
84
|
+
value,
|
|
85
|
+
onChange: setValue,
|
|
86
|
+
placeholder,
|
|
87
|
+
defaultValue,
|
|
88
|
+
format,
|
|
89
|
+
doneText,
|
|
90
|
+
resetText,
|
|
91
|
+
onEnter,
|
|
92
|
+
presets
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
var Amount_default = Amount;
|