@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
@@ -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, { useEffect, useState } from "react";
9
- import { Input } from "antd";
10
- import Delete from "@pisell/icon/es/Delete";
11
- import { useEventListener } from "ahooks";
12
- import classNames from "classnames";
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 = ["Backspace"];
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
- var _useState = useState(false),
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("keydown", function (ev) {
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
- useEffect(function () {
29
- if (value) {
30
- setSelect(false);
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
- setSelect(false);
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("virtual-keyboard-input", {
56
- "virtual-keyboard-input-select": select
62
+ className: classNames('virtual-keyboard-input', {
63
+ 'virtual-keyboard-input-select': select
57
64
  }),
58
65
  onClick: function onClick() {
59
66
  if (value) {
60
- setSelect(!select);
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 && value.length ? /*#__PURE__*/React.createElement("div", {
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
@@ -106,3 +106,7 @@ export { globalConfig, default as PisellContext, } from './components/pisell-con
106
106
  export { default as PisellTags } from './components/pisellTags';
107
107
  export { default as PisellStatisticList } from './components/pisellStatisticList';
108
108
  export { default as PisellFloatingPanel } from './components/pisellFloatingPanel';
109
+ export { default as PisellPriceKeyboard } from './components/virtual-keyboard/Amount';
110
+ export { default as PisellNumberKeyboard } from './components/virtual-keyboard/Number';
111
+ export { default as PisellAdjustPrice } from './components/pisellAdjustPrice';
112
+ export { default as PisellAdjustPriceInputNumber } from './components/pisellAdjustPrice/PisellAdjustPriceInputNumber';
package/es/index.js CHANGED
@@ -127,4 +127,8 @@ export { default as usePisellConfig } from "./components/pisell-config-provider/
127
127
  export { globalConfig, default as PisellContext } from "./components/pisell-config-provider/context";
128
128
  export { default as PisellTags } from "./components/pisellTags";
129
129
  export { default as PisellStatisticList } from "./components/pisellStatisticList";
130
- export { default as PisellFloatingPanel } from "./components/pisellFloatingPanel";
130
+ export { default as PisellFloatingPanel } from "./components/pisellFloatingPanel";
131
+ export { default as PisellPriceKeyboard } from "./components/virtual-keyboard/Amount";
132
+ export { default as PisellNumberKeyboard } from "./components/virtual-keyboard/Number";
133
+ export { default as PisellAdjustPrice } from "./components/pisellAdjustPrice";
134
+ export { default as PisellAdjustPriceInputNumber } from "./components/pisellAdjustPrice/PisellAdjustPriceInputNumber";
@@ -118,5 +118,11 @@ declare const _default: {
118
118
  'pisell-wallet-pass-card-redeem': string;
119
119
  'pisell-wallet-pass-card-balance': string;
120
120
  'pisell-wallet-pass-card-valid-to': string;
121
+ 'pisell-adjust-price-price-override': string;
122
+ 'pisell-adjust-price-discount': string;
123
+ 'pisell-adjust-price-discount-amount': string;
124
+ 'pisell-adjust-price-discount-percentage': string;
125
+ 'pisell-adjust-price-total-after-discount': string;
126
+ 'pisell-adjust-price-discount-can-be-maximum': string;
121
127
  };
122
128
  export default _default;
@@ -143,5 +143,12 @@ export default {
143
143
  'pisell-wallet-pass-card-detail': 'Detail',
144
144
  'pisell-wallet-pass-card-redeem': 'Redeem',
145
145
  'pisell-wallet-pass-card-balance': 'Balance',
146
- 'pisell-wallet-pass-card-valid-to': 'Valid to'
146
+ 'pisell-wallet-pass-card-valid-to': 'Valid to',
147
+ // 金额修改组件
148
+ 'pisell-adjust-price-price-override': "Price override",
149
+ 'pisell-adjust-price-discount': "Discount",
150
+ 'pisell-adjust-price-discount-amount': "Amount",
151
+ 'pisell-adjust-price-discount-percentage': "Percentage",
152
+ 'pisell-adjust-price-total-after-discount': "Total after discount: ",
153
+ 'pisell-adjust-price-discount-can-be-maximum': "Discount can be maximum"
147
154
  };
@@ -118,5 +118,11 @@ declare const _default: {
118
118
  'pisell-wallet-pass-card-redeem': string;
119
119
  'pisell-wallet-pass-card-balance': string;
120
120
  'pisell-wallet-pass-card-valid-to': string;
121
+ 'pisell-adjust-price-price-override': string;
122
+ 'pisell-adjust-price-discount': string;
123
+ 'pisell-adjust-price-discount-amount': string;
124
+ 'pisell-adjust-price-discount-percentage': string;
125
+ 'pisell-adjust-price-total-after-discount': string;
126
+ 'pisell-adjust-price-discount-can-be-maximum': string;
121
127
  };
122
128
  export default _default;
@@ -143,5 +143,12 @@ export default {
143
143
  'pisell-wallet-pass-card-detail': '详情',
144
144
  'pisell-wallet-pass-card-redeem': '兑换',
145
145
  'pisell-wallet-pass-card-balance': '余额',
146
- 'pisell-wallet-pass-card-valid-to': '有效期至'
146
+ 'pisell-wallet-pass-card-valid-to': '有效期至',
147
+ // 金额修改组件
148
+ 'pisell-adjust-price-price-override': "一口价",
149
+ 'pisell-adjust-price-discount': "折扣",
150
+ 'pisell-adjust-price-discount-amount': "金额",
151
+ 'pisell-adjust-price-discount-percentage': "百分比",
152
+ 'pisell-adjust-price-total-after-discount': "打折后总价",
153
+ 'pisell-adjust-price-discount-can-be-maximum': "折扣最高可达"
147
154
  };
@@ -118,5 +118,11 @@ declare const _default: {
118
118
  'pisell-wallet-pass-card-redeem': string;
119
119
  'pisell-wallet-pass-card-balance': string;
120
120
  'pisell-wallet-pass-card-valid-to': string;
121
+ 'pisell-adjust-price-price-override': string;
122
+ 'pisell-adjust-price-discount': string;
123
+ 'pisell-adjust-price-discount-amount': string;
124
+ 'pisell-adjust-price-discount-percentage': string;
125
+ 'pisell-adjust-price-total-after-discount': string;
126
+ 'pisell-adjust-price-discount-can-be-maximum': string;
121
127
  };
122
128
  export default _default;
@@ -143,5 +143,12 @@ export default {
143
143
  'pisell-wallet-pass-card-detail': '詳情',
144
144
  'pisell-wallet-pass-card-redeem': '兌換',
145
145
  'pisell-wallet-pass-card-balance': '餘額',
146
- 'pisell-wallet-pass-card-valid-to': '有效期至'
146
+ 'pisell-wallet-pass-card-valid-to': '有效期至',
147
+ // 金额修改组件
148
+ 'pisell-adjust-price-price-override': "一口價",
149
+ 'pisell-adjust-price-discount': "折扣",
150
+ 'pisell-adjust-price-discount-amount': "金額",
151
+ 'pisell-adjust-price-discount-percentage': "百分比",
152
+ 'pisell-adjust-price-total-after-discount': "打折后總價",
153
+ 'pisell-adjust-price-discount-can-be-maximum': "折扣最高可達"
147
154
  };
@@ -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,80 @@
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(val);
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
+ },
67
+ /* @__PURE__ */ import_react.default.createElement("span", null, /* @__PURE__ */ import_react.default.createElement(
68
+ import_antd.InputNumber,
69
+ {
70
+ ...others,
71
+ disabled,
72
+ prefix,
73
+ size: size || "large",
74
+ value,
75
+ readOnly: true
76
+ }
77
+ ))
78
+ );
79
+ };
80
+ 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,142 @@
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
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-adjust-price-wrap" }, /* @__PURE__ */ import_react.default.createElement(
86
+ import_antd.Segmented,
87
+ {
88
+ size: "large",
89
+ options: [
90
+ {
91
+ label: (0, import_locales.getText)("pisell-adjust-price-price-override"),
92
+ value: "priceOverride"
93
+ },
94
+ { label: (0, import_locales.getText)("pisell-adjust-price-discount"), value: "discount" }
95
+ ],
96
+ value: updateMode,
97
+ onChange: handleUpdateMode,
98
+ block: true
99
+ }
100
+ ), updateMode === "discount" && /* @__PURE__ */ import_react.default.createElement(
101
+ import_antd.Segmented,
102
+ {
103
+ size: "large",
104
+ options: [
105
+ {
106
+ label: `${(0, import_locales.getText)("pisell-adjust-price-discount-amount")}(${(config == null ? void 0 : config.symbol) || "$"})`,
107
+ value: "amount"
108
+ },
109
+ {
110
+ label: `${(0, import_locales.getText)("pisell-adjust-price-discount-percentage")}(%)`,
111
+ value: "percentage"
112
+ }
113
+ ],
114
+ value: discountMode,
115
+ onChange: (val) => setDiscountMode(val),
116
+ block: true
117
+ }
118
+ ), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-adjust-price-amount-wrap" }, /* @__PURE__ */ import_react.default.createElement(
119
+ import_Amount.default,
120
+ {
121
+ ...others,
122
+ defaultValue: updateMode === "priceOverride" ? defaultValue : "",
123
+ key: updateMode,
124
+ value: newValue,
125
+ defaultSelect: updateMode === "priceOverride",
126
+ onChange: handleChange,
127
+ onEnter: handleEnter,
128
+ placeholder: discountMode === "amount" ? "0" : "%"
129
+ }
130
+ )), 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(
131
+ "div",
132
+ {
133
+ className: (0, import_classnames.default)("pisell-low-code-adjust-price-amount-desc", {
134
+ ["pisell-low-code-adjust-price-amount-desc-error"]: isDiscountError
135
+ })
136
+ },
137
+ (0, import_locales.getText)("pisell-adjust-price-discount-can-be-maximum"),
138
+ " ",
139
+ discountMode === "amount" ? /* @__PURE__ */ import_react.default.createElement(import_pisellText.default.Amount, { value: originValue }) : "100%"
140
+ )));
141
+ };
142
+ 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
+ }
@@ -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;
@@ -41,7 +41,15 @@ var import_RenderFields = __toESM(require("./components/RenderFields"));
41
41
  var import_index = require("./index.less");
42
42
  var prefix = "pisell-lowcode-";
43
43
  var GalleryItem = (props) => {
44
- const { record, gallery, columnsMap, index, gallerySetting, columns, onClick } = props;
44
+ const {
45
+ record,
46
+ gallery,
47
+ columnsMap,
48
+ index,
49
+ gallerySetting,
50
+ columns,
51
+ onClick
52
+ } = props;
45
53
  const {
46
54
  coverField,
47
55
  coverObjectFit,
@@ -50,7 +58,7 @@ var GalleryItem = (props) => {
50
58
  } = gallerySetting || {};
51
59
  const { cover, title, header, content, footer } = gallery;
52
60
  const { fields: headerFields, slot } = header || {};
53
- const { fields: contentFields } = content || {};
61
+ const { fields: contentFields, showLabel: contentShowLabel } = content || {};
54
62
  const { render, height } = footer || {};
55
63
  const coverDom = (0, import_react.useMemo)(() => {
56
64
  return cover.show && coverField !== "noCover" && /* @__PURE__ */ import_react.default.createElement(
@@ -100,6 +108,12 @@ var GalleryItem = (props) => {
100
108
  fixedFooter: false
101
109
  };
102
110
  }, [gallery.fixedHeight, gallery.fixedHeader, gallery.fixedFooter]);
111
+ const contentIsShowLabel = (0, import_react.useMemo)(() => {
112
+ if (typeof contentShowLabel === "boolean") {
113
+ return contentShowLabel;
114
+ }
115
+ return true;
116
+ }, [contentShowLabel]);
103
117
  const { showMode, isShowLabel } = (0, import_react.useMemo)(() => {
104
118
  if (compactMode === "compact") {
105
119
  return {
@@ -109,14 +123,14 @@ var GalleryItem = (props) => {
109
123
  } else if (compactMode === "default") {
110
124
  return {
111
125
  showMode: "block",
112
- isShowLabel: propsIsShowLabel
126
+ isShowLabel: contentIsShowLabel ? propsIsShowLabel : contentIsShowLabel
113
127
  };
114
128
  }
115
129
  return {
116
130
  showMode: "block",
117
131
  isShowLabel: propsIsShowLabel
118
132
  };
119
- }, [compactMode, propsIsShowLabel]);
133
+ }, [compactMode, propsIsShowLabel, contentIsShowLabel]);
120
134
  const Content = (0, import_react.useMemo)(() => {
121
135
  const showFieldList = [];
122
136
  columns.forEach((item) => {
@@ -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%;
@@ -100,6 +100,12 @@ var Gallery = (props) => {
100
100
  const gap = (0, import_react.useMemo)(() => {
101
101
  return [horizontalGutter, verticalGutter];
102
102
  }, [horizontalGutter, verticalGutter]);
103
+ const contentIsShowLabel = (0, import_react.useMemo)(() => {
104
+ if (typeof gallery.content.showLabel === "boolean") {
105
+ return gallery.content.showLabel;
106
+ }
107
+ return true;
108
+ }, [gallery.content.showLabel]);
103
109
  const rowHeight = (0, import_react.useMemo)(() => {
104
110
  var _a;
105
111
  if (fixedHeight) {
@@ -123,7 +129,10 @@ var Gallery = (props) => {
123
129
  const fieldCount = column_setting.filter(
124
130
  (item) => item.isShow
125
131
  ).length;
126
- const itemHeight = gallery_setting.isShowLabel && gallery_setting.compactMode !== "compact" ? import_constant.FIELD_LABEL_HEIGHT + import_constant.FIELD_VALUE_HEIGHT : import_constant.FIELD_VALUE_HEIGHT;
132
+ let itemHeight = import_constant.FIELD_VALUE_HEIGHT;
133
+ if (contentIsShowLabel && gallery_setting.isShowLabel && gallery_setting.compactMode !== "compact") {
134
+ itemHeight = import_constant.FIELD_LABEL_HEIGHT + import_constant.FIELD_VALUE_HEIGHT;
135
+ }
127
136
  contentHeight = itemHeight * fieldCount;
128
137
  if (gallery_setting.compactMode === "compact") {
129
138
  contentHeight = contentHeight * 0.8;
@@ -141,7 +150,8 @@ var Gallery = (props) => {
141
150
  gallery_setting,
142
151
  column_setting,
143
152
  header,
144
- footer
153
+ footer,
154
+ contentIsShowLabel
145
155
  ]);
146
156
  return /* @__PURE__ */ import_react.default.createElement(import_antd.Spin, { spinning: loading, wrapperClassName: `${prefix}gallery-spin` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}gallery-wrap` }, /* @__PURE__ */ import_react.default.createElement(
147
157
  import_VirtualGrid.default,
@@ -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;