@pisell/materials 1.0.419 → 1.0.421

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.
Files changed (89) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +2 -2
  6. package/build/lowcode/preview.js +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +19 -19
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +20 -20
  11. package/es/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +10 -0
  12. package/es/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.js +58 -0
  13. package/es/components/pisellAdjustPrice/index.d.ts +10 -0
  14. package/es/components/pisellAdjustPrice/index.js +136 -0
  15. package/es/components/pisellAdjustPrice/index.less +30 -0
  16. package/es/components/table/Gallery/components/GalleryItem/components/Title/index.less +1 -1
  17. package/es/components/table/Gallery/components/GalleryItem/index.js +10 -3
  18. package/es/components/table/Gallery/components/GalleryItem/index.less +1 -0
  19. package/es/components/table/Gallery/index.js +12 -3
  20. package/es/components/table/types.d.ts +2 -0
  21. package/es/components/virtual-keyboard/Amount/index.d.ts +21 -0
  22. package/es/components/virtual-keyboard/Amount/index.js +61 -0
  23. package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +12 -0
  24. package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.js +22 -0
  25. package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.less +18 -0
  26. package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +19 -0
  27. package/es/components/virtual-keyboard/BaseNumberKeyboard/index.js +210 -0
  28. package/es/components/virtual-keyboard/BaseNumberKeyboard/index.less +9 -0
  29. package/es/components/virtual-keyboard/Keyboard/index.d.ts +8 -6
  30. package/es/components/virtual-keyboard/Keyboard/index.js +59 -15
  31. package/es/components/virtual-keyboard/Keyboard/index.less +35 -24
  32. package/es/components/virtual-keyboard/Number/index.d.ts +14 -0
  33. package/es/components/virtual-keyboard/Number/index.js +35 -0
  34. package/es/components/virtual-keyboard/VirtualInput/index.d.ts +9 -0
  35. package/es/components/virtual-keyboard/VirtualInput/index.js +40 -0
  36. package/es/components/virtual-keyboard/VirtualInput/index.less +46 -0
  37. package/es/components/virtual-keyboard/VirtualKeyInput/index.d.ts +6 -3
  38. package/es/components/virtual-keyboard/VirtualKeyInput/index.js +27 -20
  39. package/es/index.d.ts +4 -0
  40. package/es/index.js +5 -1
  41. package/es/locales/en-US.d.ts +6 -0
  42. package/es/locales/en-US.js +8 -1
  43. package/es/locales/zh-CN.d.ts +6 -0
  44. package/es/locales/zh-CN.js +8 -1
  45. package/es/locales/zh-TW.d.ts +6 -0
  46. package/es/locales/zh-TW.js +8 -1
  47. package/lib/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +10 -0
  48. package/lib/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.js +80 -0
  49. package/lib/components/pisellAdjustPrice/index.d.ts +10 -0
  50. package/lib/components/pisellAdjustPrice/index.js +142 -0
  51. package/lib/components/pisellAdjustPrice/index.less +30 -0
  52. package/lib/components/table/Gallery/components/GalleryItem/components/Title/index.less +1 -1
  53. package/lib/components/table/Gallery/components/GalleryItem/index.js +18 -4
  54. package/lib/components/table/Gallery/components/GalleryItem/index.less +1 -0
  55. package/lib/components/table/Gallery/index.js +12 -2
  56. package/lib/components/table/types.d.ts +2 -0
  57. package/lib/components/virtual-keyboard/Amount/index.d.ts +21 -0
  58. package/lib/components/virtual-keyboard/Amount/index.js +92 -0
  59. package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +12 -0
  60. package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.js +46 -0
  61. package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.less +18 -0
  62. package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +19 -0
  63. package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.js +242 -0
  64. package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.less +9 -0
  65. package/lib/components/virtual-keyboard/Keyboard/index.d.ts +8 -6
  66. package/lib/components/virtual-keyboard/Keyboard/index.js +51 -4
  67. package/lib/components/virtual-keyboard/Keyboard/index.less +35 -24
  68. package/lib/components/virtual-keyboard/Number/index.d.ts +14 -0
  69. package/lib/components/virtual-keyboard/Number/index.js +65 -0
  70. package/lib/components/virtual-keyboard/VirtualInput/index.d.ts +9 -0
  71. package/lib/components/virtual-keyboard/VirtualInput/index.js +62 -0
  72. package/lib/components/virtual-keyboard/VirtualInput/index.less +46 -0
  73. package/lib/components/virtual-keyboard/VirtualKeyInput/index.d.ts +6 -3
  74. package/lib/components/virtual-keyboard/VirtualKeyInput/index.js +20 -11
  75. package/lib/index.d.ts +4 -0
  76. package/lib/index.js +12 -0
  77. package/lib/locales/en-US.d.ts +6 -0
  78. package/lib/locales/en-US.js +8 -1
  79. package/lib/locales/zh-CN.d.ts +6 -0
  80. package/lib/locales/zh-CN.js +8 -1
  81. package/lib/locales/zh-TW.d.ts +6 -0
  82. package/lib/locales/zh-TW.js +8 -1
  83. package/lowcode/pisell-adjust-price/meta.ts +58 -0
  84. package/lowcode/pisell-adjust-price/snippets.ts +10 -0
  85. package/lowcode/pisell-adjust-price-input-number/meta.ts +245 -0
  86. package/lowcode/pisell-number-keyboard/meta.ts +98 -0
  87. package/lowcode/pisell-price-keyboard/meta.ts +174 -0
  88. package/lowcode/table/meta.ts +10 -0
  89. package/package.json +1 -1
@@ -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,58 @@
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(val);
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
+ }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InputNumber, _extends({}, others, {
51
+ disabled: disabled,
52
+ prefix: prefix,
53
+ size: size || 'large',
54
+ value: value,
55
+ readOnly: true
56
+ }))));
57
+ };
58
+ 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,136 @@
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
+ return /*#__PURE__*/React.createElement("div", {
87
+ className: "pisell-lowcode-adjust-price-wrap"
88
+ }, /*#__PURE__*/React.createElement(Segmented, {
89
+ size: "large",
90
+ options: [{
91
+ label: getText('pisell-adjust-price-price-override'),
92
+ value: 'priceOverride'
93
+ }, {
94
+ label: getText('pisell-adjust-price-discount'),
95
+ value: 'discount'
96
+ }],
97
+ value: updateMode,
98
+ onChange: handleUpdateMode,
99
+ block: true
100
+ }), updateMode === 'discount' && /*#__PURE__*/React.createElement(Segmented, {
101
+ size: "large",
102
+ options: [{
103
+ label: "".concat(getText('pisell-adjust-price-discount-amount'), "(").concat((config === null || config === void 0 ? void 0 : config.symbol) || "$", ")"),
104
+ value: 'amount'
105
+ }, {
106
+ label: "".concat(getText('pisell-adjust-price-discount-percentage'), "(%)"),
107
+ value: 'percentage'
108
+ }],
109
+ value: discountMode,
110
+ onChange: function onChange(val) {
111
+ return setDiscountMode(val);
112
+ },
113
+ block: true
114
+ }), /*#__PURE__*/React.createElement("div", {
115
+ className: "pisell-lowcode-adjust-price-amount-wrap"
116
+ }, /*#__PURE__*/React.createElement(Amount, _extends({}, others, {
117
+ defaultValue: updateMode === 'priceOverride' ? defaultValue : '',
118
+ key: updateMode,
119
+ value: newValue,
120
+ defaultSelect: updateMode === 'priceOverride',
121
+ onChange: handleChange,
122
+ onEnter: handleEnter,
123
+ placeholder: discountMode === 'amount' ? '0' : '%'
124
+ }))), updateMode === 'discount' && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
125
+ className: "pisell-low-code-adjust-price-total"
126
+ }, isDiscountError ? /*#__PURE__*/React.createElement(PisellText.Amount, {
127
+ value: originValue
128
+ }) : /*#__PURE__*/React.createElement(React.Fragment, null, newValue && getText('pisell-adjust-price-total-after-discount'), /*#__PURE__*/React.createElement(PisellText.Amount, {
129
+ value: totalAfterDiscount
130
+ }))), /*#__PURE__*/React.createElement("div", {
131
+ className: classNames('pisell-low-code-adjust-price-amount-desc', _defineProperty({}, 'pisell-low-code-adjust-price-amount-desc-error', isDiscountError))
132
+ }, getText('pisell-adjust-price-discount-can-be-maximum'), ' ', discountMode === 'amount' ? /*#__PURE__*/React.createElement(PisellText.Amount, {
133
+ value: originValue
134
+ }) : '100%')));
135
+ };
136
+ 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
+ }
@@ -6,7 +6,7 @@
6
6
  overflow: hidden;
7
7
  -webkit-line-clamp: 3;
8
8
  -webkit-box-orient: vertical;
9
- padding: 18px 22px 0;
9
+ padding: 0 22px 0;
10
10
  color: var(--Base-Black, #000);
11
11
  font-size: 24px;
12
12
  font-style: normal;
@@ -29,7 +29,8 @@ var GalleryItem = function GalleryItem(props) {
29
29
  headerFields = _ref2.fields,
30
30
  slot = _ref2.slot;
31
31
  var _ref3 = content || {},
32
- contentFields = _ref3.fields;
32
+ contentFields = _ref3.fields,
33
+ contentShowLabel = _ref3.showLabel;
33
34
  var _ref4 = footer || {},
34
35
  render = _ref4.render,
35
36
  height = _ref4.height;
@@ -72,6 +73,12 @@ var GalleryItem = function GalleryItem(props) {
72
73
  }, [gallery.fixedHeight, gallery.fixedHeader, gallery.fixedFooter]),
73
74
  fixedHeader = _useMemo.fixedHeader,
74
75
  fixedFooter = _useMemo.fixedFooter;
76
+ var contentIsShowLabel = useMemo(function () {
77
+ if (typeof contentShowLabel === 'boolean') {
78
+ return contentShowLabel;
79
+ }
80
+ return true;
81
+ }, [contentShowLabel]);
75
82
  var _useMemo2 = useMemo(function () {
76
83
  if (compactMode === "compact") {
77
84
  return {
@@ -81,14 +88,14 @@ var GalleryItem = function GalleryItem(props) {
81
88
  } else if (compactMode === "default") {
82
89
  return {
83
90
  showMode: "block",
84
- isShowLabel: propsIsShowLabel
91
+ isShowLabel: contentIsShowLabel ? propsIsShowLabel : contentIsShowLabel
85
92
  };
86
93
  }
87
94
  return {
88
95
  showMode: "block",
89
96
  isShowLabel: propsIsShowLabel
90
97
  };
91
- }, [compactMode, propsIsShowLabel]),
98
+ }, [compactMode, propsIsShowLabel, contentIsShowLabel]),
92
99
  showMode = _useMemo2.showMode,
93
100
  isShowLabel = _useMemo2.isShowLabel;
94
101
  var Content = useMemo(function () {
@@ -3,6 +3,7 @@
3
3
  .@{pisell-prefix} {
4
4
  &-header-wrap {
5
5
  background-color: #fff;
6
+ padding-top: 18px;
6
7
  }
7
8
  &-gallery-item-wrap {
8
9
  height: 100%;
@@ -73,6 +73,12 @@ var Gallery = function Gallery(props) {
73
73
  var gap = useMemo(function () {
74
74
  return [horizontalGutter, verticalGutter];
75
75
  }, [horizontalGutter, verticalGutter]);
76
+ var contentIsShowLabel = useMemo(function () {
77
+ if (typeof gallery.content.showLabel === 'boolean') {
78
+ return gallery.content.showLabel;
79
+ }
80
+ return true;
81
+ }, [gallery.content.showLabel]);
76
82
  var rowHeight = useMemo(function () {
77
83
  var _header$fields;
78
84
  if (fixedHeight) {
@@ -83,7 +89,7 @@ var Gallery = function Gallery(props) {
83
89
  var headerFieldHeight = 0;
84
90
  var contentHeight = 0;
85
91
  var footerHeight = 0;
86
- if (cover.show && (gallery_setting === null || gallery_setting === void 0 ? void 0 : gallery_setting.coverField) !== "noCover") {
92
+ if (cover.show && (gallery_setting === null || gallery_setting === void 0 ? void 0 : gallery_setting.coverField) !== 'noCover') {
87
93
  coverHeight = cover.height;
88
94
  }
89
95
  if (title.field) {
@@ -96,7 +102,10 @@ var Gallery = function Gallery(props) {
96
102
  var fieldCount = column_setting.filter(function (item) {
97
103
  return item.isShow;
98
104
  }).length;
99
- var itemHeight = gallery_setting.isShowLabel && gallery_setting.compactMode !== "compact" ? FIELD_LABEL_HEIGHT + FIELD_VALUE_HEIGHT : FIELD_VALUE_HEIGHT;
105
+ var itemHeight = FIELD_VALUE_HEIGHT;
106
+ if (contentIsShowLabel && gallery_setting.isShowLabel && gallery_setting.compactMode !== "compact") {
107
+ itemHeight = FIELD_LABEL_HEIGHT + FIELD_VALUE_HEIGHT;
108
+ }
100
109
  contentHeight = itemHeight * fieldCount;
101
110
  if (gallery_setting.compactMode === "compact") {
102
111
  contentHeight = contentHeight * 0.8;
@@ -106,7 +115,7 @@ var Gallery = function Gallery(props) {
106
115
  footerHeight = footer.height;
107
116
  }
108
117
  return coverHeight + titleHeight + headerFieldHeight + contentHeight + footerHeight;
109
- }, [cardHeight, fixedHeight, cover, title, gallery_setting, column_setting, header, footer]);
118
+ }, [cardHeight, fixedHeight, cover, title, gallery_setting, column_setting, header, footer, contentIsShowLabel]);
110
119
  return /*#__PURE__*/React.createElement(Spin, {
111
120
  spinning: loading,
112
121
  wrapperClassName: "".concat(prefix, "gallery-spin")
@@ -88,6 +88,8 @@ declare type GalleryContentType = {
88
88
  columnKey: string;
89
89
  show: boolean;
90
90
  }[];
91
+ /** 是否展示标题 */
92
+ showLabel?: boolean;
91
93
  };
92
94
  export declare type GallerySettingValueType = {
93
95
  coverField: string | "noCover";
@@ -0,0 +1,21 @@
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
+ }
20
+ declare const Amount: (props: AmountProps) => React.JSX.Element;
21
+ export default Amount;
@@ -0,0 +1,61 @@
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
+ var _useControllableValue = useControllableValue(props, {
23
+ defaultValue: defaultValue || ""
24
+ }),
25
+ _useControllableValue2 = _slicedToArray(_useControllableValue, 2),
26
+ value = _useControllableValue2[0],
27
+ setValue = _useControllableValue2[1];
28
+ useEffect(function () {
29
+ document.body.id = 'body';
30
+ }, []);
31
+ var format = function format(_v) {
32
+ var v = "".concat(_v);
33
+ // 取value小数位数
34
+ var precision = v.includes('.') ? v.split('.')[1].length : 0;
35
+ var endWith = v.endsWith('.');
36
+ // 最后一位是小数点时去除
37
+ var value = endWith ? v.slice(0, -1) : v;
38
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PisellText.Amount, {
39
+ value: value,
40
+ precision: precision,
41
+ hideDecimalForWholeNumbers: false,
42
+ showCurrencySymbol: amountProps === null || amountProps === void 0 ? void 0 : amountProps.showCurrencySymbol,
43
+ useThousandsSeparator: amountProps === null || amountProps === void 0 ? void 0 : amountProps.useThousandsSeparator
44
+ }), endWith && '.');
45
+ };
46
+ return /*#__PURE__*/React.createElement(BaseNumberKeyboard, {
47
+ defaultSelect: defaultSelect,
48
+ max: max,
49
+ min: min,
50
+ value: value,
51
+ onChange: setValue,
52
+ placeholder: placeholder,
53
+ defaultValue: defaultValue,
54
+ format: format,
55
+ doneText: doneText,
56
+ resetText: resetText,
57
+ onEnter: onEnter,
58
+ presets: presets
59
+ });
60
+ };
61
+ 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;