@pisell/materials 2.2.80 → 2.2.81

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 (39) 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 +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +14 -14
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +15 -15
  11. package/es/components/media/index.d.ts +15 -1
  12. package/es/components/media/index.js +12 -12
  13. package/es/components/pisellVHFix/index.d.ts +13 -0
  14. package/es/components/pisellVHFix/index.js +36 -0
  15. package/es/components/pisellVHFix/index.less +10 -0
  16. package/es/components/productCard/components/AmountFooter/index.js +22 -6
  17. package/es/components/productCard/components/AmountFooter/index.less +28 -1
  18. package/es/components/productCard/components/Warning/index.d.ts +7 -0
  19. package/es/components/productCard/components/Warning/index.js +48 -0
  20. package/es/components/productCard/index.js +8 -8
  21. package/es/components/productCard/locales.d.ts +3 -0
  22. package/es/components/productCard/locales.js +6 -3
  23. package/es/components/productCard/status.js +3 -1
  24. package/es/components/productCard/types.d.ts +1 -0
  25. package/lib/components/media/index.d.ts +15 -1
  26. package/lib/components/media/index.js +12 -12
  27. package/lib/components/pisellVHFix/index.d.ts +13 -0
  28. package/lib/components/pisellVHFix/index.js +56 -0
  29. package/lib/components/pisellVHFix/index.less +10 -0
  30. package/lib/components/productCard/components/AmountFooter/index.js +16 -6
  31. package/lib/components/productCard/components/AmountFooter/index.less +28 -1
  32. package/lib/components/productCard/components/Warning/index.d.ts +7 -0
  33. package/lib/components/productCard/components/Warning/index.js +68 -0
  34. package/lib/components/productCard/index.js +4 -11
  35. package/lib/components/productCard/locales.d.ts +3 -0
  36. package/lib/components/productCard/locales.js +6 -3
  37. package/lib/components/productCard/status.js +3 -1
  38. package/lib/components/productCard/types.d.ts +1 -0
  39. package/package.json +1 -1
@@ -1,4 +1,18 @@
1
1
  import React from 'react';
2
+ export interface MediaProps {
3
+ __designMode?: 'design' | undefined;
4
+ value?: string | string[];
5
+ onChange?: (value: string | string[]) => void;
6
+ multiple?: boolean;
7
+ maxCount?: number;
8
+ accept?: string;
9
+ disabled?: boolean;
10
+ className?: string;
11
+ style?: React.CSSProperties;
12
+ placeholder?: string;
13
+ showUploadList?: boolean;
14
+ listType?: 'text' | 'picture' | 'picture-card';
15
+ }
2
16
  import './index.less';
3
- declare const Media: React.ForwardRefExoticComponent<Omit<MediaProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
17
+ declare const Media: React.ForwardRefExoticComponent<MediaProps & React.RefAttributes<HTMLDivElement>>;
4
18
  export default Media;
@@ -39,7 +39,7 @@ var Media = /*#__PURE__*/forwardRef(function (props, ref) {
39
39
  className = props.className,
40
40
  style = props.style,
41
41
  _props$placeholder = props.placeholder,
42
- placeholder = _props$placeholder === void 0 ? '选择媒体文件' : _props$placeholder,
42
+ placeholder = _props$placeholder === void 0 ? '選擇媒體文件' : _props$placeholder,
43
43
  _props$showUploadList = props.showUploadList,
44
44
  showUploadList = _props$showUploadList === void 0 ? true : _props$showUploadList,
45
45
  _props$listType = props.listType,
@@ -126,11 +126,11 @@ var Media = /*#__PURE__*/forwardRef(function (props, ref) {
126
126
  }(), {
127
127
  manual: true,
128
128
  onSuccess: function onSuccess(result) {
129
- message.success('上传成功');
129
+ message.success('上傳成功');
130
130
  fetchMediaList();
131
131
  },
132
132
  onError: function onError() {
133
- message.error('上传失败');
133
+ message.error('上傳失敗');
134
134
  }
135
135
  }),
136
136
  uploadFile = _useRequest2.run;
@@ -145,7 +145,7 @@ var Media = /*#__PURE__*/forwardRef(function (props, ref) {
145
145
  _context3.next = 3;
146
146
  break;
147
147
  }
148
- message.error('文件大小不能超过10MB');
148
+ message.error('文件大小不能超過10MB');
149
149
  return _context3.abrupt("return", false);
150
150
  case 3:
151
151
  setUploading(true);
@@ -196,7 +196,7 @@ var Media = /*#__PURE__*/forwardRef(function (props, ref) {
196
196
  }));
197
197
  } else {
198
198
  if (selectedItems.length >= maxCount) {
199
- message.warning("\u6700\u591A\u53EA\u80FD\u9009\u62E9".concat(maxCount, "\u4E2A\u6587\u4EF6"));
199
+ message.warning("\u6700\u591A\u53EA\u80FD\u9078\u64C7".concat(maxCount, "\u500B\u6587\u4EF6"));
200
200
  return;
201
201
  }
202
202
  setSelectedItems([].concat(_toConsumableArray(selectedItems), [item]));
@@ -209,7 +209,7 @@ var Media = /*#__PURE__*/forwardRef(function (props, ref) {
209
209
  // 确认选择
210
210
  var handleOk = useCallback(function () {
211
211
  if (selectedItems.length === 0) {
212
- message.warning('请选择媒体文件');
212
+ message.warning('請選擇媒體文件');
213
213
  return;
214
214
  }
215
215
  var urls = selectedItems.map(function (item) {
@@ -251,7 +251,7 @@ var Media = /*#__PURE__*/forwardRef(function (props, ref) {
251
251
  });
252
252
  onChange === null || onChange === void 0 || onChange(multiple ? newFiles : newFiles[0] || '');
253
253
  }
254
- }, "\u5220\u9664")));
254
+ }, "\u522A\u9664")));
255
255
  }));
256
256
  }
257
257
  return /*#__PURE__*/React.createElement("div", {
@@ -269,7 +269,7 @@ var Media = /*#__PURE__*/forwardRef(function (props, ref) {
269
269
  });
270
270
  onChange === null || onChange === void 0 || onChange(multiple ? newFiles : newFiles[0] || '');
271
271
  }
272
- }, "\u5220\u9664"));
272
+ }, "\u522A\u9664"));
273
273
  }));
274
274
  }, [value, listType, multiple, onChange]);
275
275
  return /*#__PURE__*/React.createElement("div", {
@@ -286,12 +286,12 @@ var Media = /*#__PURE__*/forwardRef(function (props, ref) {
286
286
  height: listType === 'picture-card' ? 80 : 32
287
287
  }
288
288
  }, placeholder), showUploadList && renderCurrentFiles, /*#__PURE__*/React.createElement(Modal, {
289
- title: "\u5A92\u4F53\u5E93",
289
+ title: "\u5A92\u9AD4\u5EAB",
290
290
  open: isModalVisible,
291
291
  onCancel: handleCancel,
292
292
  onOk: handleOk,
293
293
  width: 800,
294
- okText: "\u786E\u5B9A",
294
+ okText: "\u78BA\u5B9A",
295
295
  cancelText: "\u53D6\u6D88"
296
296
  }, /*#__PURE__*/React.createElement("div", {
297
297
  className: "pisell-media-modal"
@@ -305,7 +305,7 @@ var Media = /*#__PURE__*/forwardRef(function (props, ref) {
305
305
  }, /*#__PURE__*/React.createElement(Button, {
306
306
  icon: /*#__PURE__*/React.createElement(PlusOutlined, null),
307
307
  loading: uploading
308
- }, "\u4E0A\u4F20\u6587\u4EF6"))), /*#__PURE__*/React.createElement("div", {
308
+ }, "\u4E0A\u50B3\u6587\u4EF6"))), /*#__PURE__*/React.createElement("div", {
309
309
  className: "pisell-media-list"
310
310
  }, mediaList === null || mediaList === void 0 ? void 0 : mediaList.map(function (item) {
311
311
  var isSelected = selectedItems.find(function (selected) {
@@ -335,6 +335,6 @@ var Media = /*#__PURE__*/forwardRef(function (props, ref) {
335
335
  }, (item.size / 1024 / 1024).toFixed(2), " MB")));
336
336
  })), selectedItems.length > 0 && /*#__PURE__*/React.createElement("div", {
337
337
  className: "pisell-media-selected"
338
- }, "\u5DF2\u9009\u62E9 ", selectedItems.length, " \u4E2A\u6587\u4EF6"))));
338
+ }, "\u5DF2\u9078\u64C7 ", selectedItems.length, " \u500B\u6587\u4EF6"))));
339
339
  });
340
340
  export default Media;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ interface PisellVHFixProps {
4
+ children?: React.ReactNode;
5
+ className?: string;
6
+ style?: React.CSSProperties;
7
+ height?: number;
8
+ minHeight?: boolean;
9
+ maxHeight?: boolean;
10
+ minusPixels?: number;
11
+ }
12
+ declare const PisellVHFix: React.FC<PisellVHFixProps>;
13
+ export default PisellVHFix;
@@ -0,0 +1,36 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ 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; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import React from 'react';
8
+ import { useVH } from "../../hooks/useVH";
9
+ import "./index.less";
10
+ var PisellVHFix = function PisellVHFix(_ref) {
11
+ var children = _ref.children,
12
+ className = _ref.className,
13
+ style = _ref.style,
14
+ _ref$height = _ref.height,
15
+ height = _ref$height === void 0 ? 100 : _ref$height,
16
+ _ref$minHeight = _ref.minHeight,
17
+ minHeight = _ref$minHeight === void 0 ? false : _ref$minHeight,
18
+ _ref$maxHeight = _ref.maxHeight,
19
+ maxHeight = _ref$maxHeight === void 0 ? false : _ref$maxHeight,
20
+ _ref$minusPixels = _ref.minusPixels,
21
+ minusPixels = _ref$minusPixels === void 0 ? 0 : _ref$minusPixels;
22
+ // 启用vh修复
23
+ useVH();
24
+ var containerStyle = _objectSpread(_objectSpread(_objectSpread({}, style), {}, {
25
+ height: minusPixels > 0 ? "calc(var(--vh, 1vh) * ".concat(height, " - ").concat(minusPixels, "px)") : "calc(var(--vh, 1vh) * ".concat(height, ")")
26
+ }, minHeight && {
27
+ minHeight: "calc(var(--vh, 1vh) * ".concat(height, ")")
28
+ }), maxHeight && {
29
+ maxHeight: "calc(var(--vh, 1vh) * ".concat(height, ")")
30
+ });
31
+ return /*#__PURE__*/React.createElement("div", {
32
+ className: "pisell-vh-fix ".concat(className || ''),
33
+ style: containerStyle
34
+ }, children);
35
+ };
36
+ export default PisellVHFix;
@@ -0,0 +1,10 @@
1
+ .pisell-vh-fix {
2
+ box-sizing: border-box;
3
+ overflow: hidden;
4
+
5
+ // 确保在Safari移动端正确显示
6
+ -webkit-overflow-scrolling: touch;
7
+
8
+ // 防止iOS Safari的弹性滚动
9
+ overscroll-behavior: contain;
10
+ }
@@ -1,6 +1,6 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import classNames from 'classnames';
3
- import { Tooltip } from 'antd';
3
+ import { Tag, Tooltip } from 'antd';
4
4
  import { QuestionCircleOutlined } from '@ant-design/icons';
5
5
  import { _formatAmount } from "../Packages/utils";
6
6
  import Divider from "../Divider";
@@ -31,6 +31,24 @@ var Footer = function Footer(_ref) {
31
31
  if (!origin_total) return false;
32
32
  return Number(total) != Number(origin_total);
33
33
  }, [total, origin_total]);
34
+ var renderDiscountReason = function renderDiscountReason() {
35
+ if (isDiscount && discount_reason && type === 'total') {
36
+ if (Array.isArray(discount_reason)) {
37
+ return /*#__PURE__*/React.createElement("div", {
38
+ className: "".concat(prefix, "product-item-discount-reason")
39
+ }, discount_reason.map(function (reason, index) {
40
+ return /*#__PURE__*/React.createElement(Tag, {
41
+ key: index,
42
+ color: "red"
43
+ }, reason);
44
+ }));
45
+ }
46
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement("div", {
47
+ className: "".concat(prefix, "product-item-discount-reason")
48
+ }, /*#__PURE__*/React.createElement("span", null, "".concat(locales.getText('pisell2.product.card.discount.reason'), ": ").concat(discount_reason))));
49
+ }
50
+ return null;
51
+ };
34
52
  return /*#__PURE__*/React.createElement(React.Fragment, null, !hideDivider ? /*#__PURE__*/React.createElement(Divider, {
35
53
  type: type !== 'total' ? 'inside' : ''
36
54
  }) : null, /*#__PURE__*/React.createElement("div", {
@@ -49,10 +67,8 @@ var Footer = function Footer(_ref) {
49
67
  }
50
68
  })) : null), /*#__PURE__*/React.createElement("span", null, "\xD7".concat(num))) : null, /*#__PURE__*/React.createElement("span", {
51
69
  className: "".concat(prefix, "packages-product-footer-total")
52
- }, _formatAmount(total * num, symbol))), isDiscount ? /*#__PURE__*/React.createElement("div", {
53
- className: "".concat(prefix, "packages-product-footer-discount")
54
- }, !isOnlyTotal ? /*#__PURE__*/React.createElement("span", null, _formatAmount(origin_total, symbol)) : null, /*#__PURE__*/React.createElement("span", null, _formatAmount(origin_total * num, symbol, 2))) : null), isDiscount && discount_reason && type === 'total' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement("div", {
55
- className: "".concat(prefix, "product-item-discount-reason")
56
- }, /*#__PURE__*/React.createElement("span", null, "".concat(locales.getText('pisell2.product.card.discount.reason'), ": ").concat(discount_reason)))) : null);
70
+ }, isDiscount ? /*#__PURE__*/React.createElement("span", {
71
+ className: "".concat(prefix, "packages-product-footer-origin-total")
72
+ }, _formatAmount(origin_total * num, symbol, 2)) : null, /*#__PURE__*/React.createElement("span", null, _formatAmount(total * num, symbol))))), renderDiscountReason());
57
73
  };
58
74
  export default Footer;
@@ -35,6 +35,19 @@
35
35
  color: var(--Gray-900, #101828);
36
36
  }
37
37
 
38
+ &-packages-product-footer-origin-total {
39
+ color: var(--Gray-500, #667085);
40
+ text-align: center;
41
+ font-size: 12px;
42
+ font-style: normal;
43
+ font-weight: 400;
44
+ line-height: 18px; /* 150% */
45
+ text-decoration-line: line-through;
46
+ margin-right: 8px;
47
+ display: inline-block;
48
+ transform: translateY(-1px);
49
+ }
50
+
38
51
  &-packages-product-hide-divider-footer {
39
52
  margin-top: 8px;
40
53
  }
@@ -45,6 +58,20 @@
45
58
  font-style: normal;
46
59
  font-weight: 400;
47
60
  line-height: 20px;
48
- white-space: break-spaces;
61
+ margin-top: 4px;
62
+ display: flex;
63
+ flex-wrap: wrap;
64
+ gap: 4px;
65
+ overflow: hidden;
66
+
67
+ >span {
68
+ display: inline-block;
69
+ max-width: 100%;
70
+ text-overflow: ellipsis;
71
+ white-space: nowrap;
72
+ overflow: hidden;
73
+ border-radius: 4px;
74
+ margin: 0;
75
+ }
49
76
  }
50
77
  }
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import '../../index.less';
3
+ declare const Warning: React.FC<{
4
+ errorMessage: string | Array<string>;
5
+ osWarnTips: Array<string>;
6
+ }>;
7
+ export default Warning;
@@ -0,0 +1,48 @@
1
+ import React, { useMemo } from 'react';
2
+ import { locales } from '@pisell/utils';
3
+ import { Alert } from 'antd';
4
+ import "../../index.less";
5
+ var Warning = function Warning(_ref) {
6
+ var errorMessage = _ref.errorMessage,
7
+ osWarnTips = _ref.osWarnTips;
8
+ /**
9
+ * @title: 错误提示列表
10
+ * @description: 错误提示列表
11
+ * @param {*} useMemo
12
+ * @return {*}
13
+ * @Author: WangHan
14
+ * @Date: 2025-07-23 10:10
15
+ */
16
+ var errorLists = useMemo(function () {
17
+ if (errorMessage) {
18
+ // 如果errorMessage是数组,则返回数组
19
+ if (Array.isArray(errorMessage)) {
20
+ return errorMessage;
21
+ }
22
+
23
+ // 如果errorMessage是字符串,则返回字符串
24
+ if (typeof errorMessage === 'string') {
25
+ return [errorMessage];
26
+ }
27
+ }
28
+ if ((osWarnTips === null || osWarnTips === void 0 ? void 0 : osWarnTips.length) > 0) {
29
+ return osWarnTips.map(function (item) {
30
+ return locales.getText(item);
31
+ });
32
+ }
33
+ return [];
34
+ }, [errorMessage, osWarnTips]);
35
+ if ((errorLists === null || errorLists === void 0 ? void 0 : errorLists.length) === 0) {
36
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
37
+ }
38
+ return /*#__PURE__*/React.createElement(React.Fragment, null, errorLists.map(function (item, index) {
39
+ return /*#__PURE__*/React.createElement(Alert, {
40
+ key: index,
41
+ message: item,
42
+ type: "warning",
43
+ showIcon: true,
44
+ className: "pisell-lowcode-product-card-error"
45
+ });
46
+ }));
47
+ };
48
+ export default Warning;
@@ -10,7 +10,6 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
10
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
11
  import React, { useMemo, useRef } from 'react';
12
12
  import classNames from 'classnames';
13
- import { Alert } from 'antd';
14
13
  import { locales } from '@pisell/utils';
15
14
  import CardPro from "../cardPro";
16
15
  import Header from "./components/Header";
@@ -26,6 +25,7 @@ import UseOpenNote from "./hooks/useOpenNote";
26
25
  import localeTexts from "./locales";
27
26
  import { defaultValue } from "./status";
28
27
  import useEngineContext from "../../hooks/useEngineContext";
28
+ import Warning from "./components/Warning";
29
29
  import "./index.less";
30
30
  var ProductCard = function ProductCard(props) {
31
31
  var _utils$storage, _dataSource$items;
@@ -64,7 +64,9 @@ var ProductCard = function ProductCard(props) {
64
64
  isShowAction = dataSource.isShowAction,
65
65
  actionText = dataSource.actionText,
66
66
  errorMessage = dataSource.errorMessage,
67
- isNormalProduct = dataSource.isNormalProduct;
67
+ isNormalProduct = dataSource.isNormalProduct,
68
+ _dataSource$osWarnTip = dataSource.osWarnTips,
69
+ osWarnTips = _dataSource$osWarnTip === void 0 ? [] : _dataSource$osWarnTip;
68
70
 
69
71
  /**
70
72
  * @title: 显示图片
@@ -159,12 +161,10 @@ var ProductCard = function ProductCard(props) {
159
161
  onAction: function onAction() {
160
162
  return _onAction === null || _onAction === void 0 ? void 0 : _onAction(dataSource);
161
163
  }
162
- }) : null, errorMessage ? /*#__PURE__*/React.createElement(Alert, {
163
- message: errorMessage,
164
- type: "warning",
165
- showIcon: true,
166
- className: "pisell-lowcode-product-card-error"
167
- }) : null), /*#__PURE__*/React.createElement(UseOpenNote, {
164
+ }) : null, /*#__PURE__*/React.createElement(Warning, {
165
+ errorMessage: errorMessage,
166
+ osWarnTips: osWarnTips
167
+ })), /*#__PURE__*/React.createElement(UseOpenNote, {
168
168
  ref: useOpenNoteRef,
169
169
  onNoteChange: function onNoteChange(e) {
170
170
  onNote === null || onNote === void 0 || onNote(_objectSpread(_objectSpread({}, dataSource), {}, {
@@ -24,6 +24,7 @@ declare const _default: {
24
24
  'pisell2.product.card.add.holder.modal.clear': string;
25
25
  'pisell2.product.card.add.holder.modal.apply': string;
26
26
  'pisell2.product.card.add.holder.modal.add': string;
27
+ 'pisell2.product.card.closing-soon.warning': string;
27
28
  };
28
29
  'zh-CN': {
29
30
  'pisell2.product.card.edit': string;
@@ -50,6 +51,7 @@ declare const _default: {
50
51
  'pisell2.product.card.add.holder.modal.clear': string;
51
52
  'pisell2.product.card.add.holder.modal.apply': string;
52
53
  'pisell2.product.card.add.holder.modal.add': string;
54
+ 'pisell2.product.card.closing-soon.warning': string;
53
55
  };
54
56
  'zh-HK': {
55
57
  'pisell2.product.card.edit': string;
@@ -76,6 +78,7 @@ declare const _default: {
76
78
  'pisell2.product.card.add.holder.modal.clear': string;
77
79
  'pisell2.product.card.add.holder.modal.apply': string;
78
80
  'pisell2.product.card.add.holder.modal.add': string;
81
+ 'pisell2.product.card.closing-soon.warning': string;
79
82
  };
80
83
  };
81
84
  export default _default;
@@ -37,7 +37,8 @@ export default {
37
37
  'pisell2.product.card.add.holder.modal.cancel': 'Cancel',
38
38
  'pisell2.product.card.add.holder.modal.clear': 'Clear',
39
39
  'pisell2.product.card.add.holder.modal.apply': 'Apply',
40
- 'pisell2.product.card.add.holder.modal.add': 'Add New'
40
+ 'pisell2.product.card.add.holder.modal.add': 'Add New',
41
+ 'pisell2.product.card.closing-soon.warning': 'The venue will close soon. Please make sure you have enough time for your visit.'
41
42
  },
42
43
  'zh-CN': {
43
44
  'pisell2.product.card.edit': '编辑',
@@ -77,7 +78,8 @@ export default {
77
78
  'pisell2.product.card.add.holder.modal.cancel': '取消',
78
79
  'pisell2.product.card.add.holder.modal.clear': '清除',
79
80
  'pisell2.product.card.add.holder.modal.apply': '应用',
80
- 'pisell2.product.card.add.holder.modal.add': '添加'
81
+ 'pisell2.product.card.add.holder.modal.add': '添加',
82
+ 'pisell2.product.card.closing-soon.warning': '当前入场时间临近营业结束,请确认是否仍要购买。'
81
83
  },
82
84
  'zh-HK': {
83
85
  'pisell2.product.card.edit': '編輯',
@@ -117,6 +119,7 @@ export default {
117
119
  'pisell2.product.card.add.holder.modal.cancel': '取消',
118
120
  'pisell2.product.card.add.holder.modal.clear': '清除',
119
121
  'pisell2.product.card.add.holder.modal.apply': '應用',
120
- 'pisell2.product.card.add.holder.modal.add': '添加'
122
+ 'pisell2.product.card.add.holder.modal.add': '添加',
123
+ 'pisell2.product.card.closing-soon.warning': '當前入場時間臨近營業結束,請確認是否仍要購買。'
121
124
  }
122
125
  };
@@ -64,5 +64,7 @@ export var defaultValue = {
64
64
  isShowPackageNote: true,
65
65
  isShowEditProduct: false,
66
66
  locale: 'en-US',
67
- symbol: '$'
67
+ symbol: '$',
68
+ // os层自定义错误提示
69
+ osWarnTips: []
68
70
  };
@@ -79,5 +79,6 @@ export declare type ProductCardTypes = {
79
79
  onLike?: (val: any) => void;
80
80
  onCard?: (val: any) => void;
81
81
  onChangeResource?: (val: any) => void;
82
+ osWarnTips?: Array<string>;
82
83
  [key: string]: any;
83
84
  };
@@ -1,4 +1,18 @@
1
1
  import React from 'react';
2
+ export interface MediaProps {
3
+ __designMode?: 'design' | undefined;
4
+ value?: string | string[];
5
+ onChange?: (value: string | string[]) => void;
6
+ multiple?: boolean;
7
+ maxCount?: number;
8
+ accept?: string;
9
+ disabled?: boolean;
10
+ className?: string;
11
+ style?: React.CSSProperties;
12
+ placeholder?: string;
13
+ showUploadList?: boolean;
14
+ listType?: 'text' | 'picture' | 'picture-card';
15
+ }
2
16
  import './index.less';
3
- declare const Media: React.ForwardRefExoticComponent<Omit<MediaProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
17
+ declare const Media: React.ForwardRefExoticComponent<MediaProps & React.RefAttributes<HTMLDivElement>>;
4
18
  export default Media;
@@ -50,7 +50,7 @@ var Media = (0, import_react.forwardRef)((props, ref) => {
50
50
  disabled = false,
51
51
  className,
52
52
  style,
53
- placeholder = "选择媒体文件",
53
+ placeholder = "選擇媒體文件",
54
54
  showUploadList = true,
55
55
  listType = "picture-card"
56
56
  } = props;
@@ -97,18 +97,18 @@ var Media = (0, import_react.forwardRef)((props, ref) => {
97
97
  {
98
98
  manual: true,
99
99
  onSuccess: (result) => {
100
- import_antd.message.success("上传成功");
100
+ import_antd.message.success("上傳成功");
101
101
  fetchMediaList();
102
102
  },
103
103
  onError: () => {
104
- import_antd.message.error("上传失败");
104
+ import_antd.message.error("上傳失敗");
105
105
  }
106
106
  }
107
107
  );
108
108
  const handleUpload = (0, import_react.useCallback)(
109
109
  async (file) => {
110
110
  if (file.size > 10 * 1024 * 1024) {
111
- import_antd.message.error("文件大小不能超过10MB");
111
+ import_antd.message.error("文件大小不能超過10MB");
112
112
  return false;
113
113
  }
114
114
  setUploading(true);
@@ -144,7 +144,7 @@ var Media = (0, import_react.forwardRef)((props, ref) => {
144
144
  );
145
145
  } else {
146
146
  if (selectedItems.length >= maxCount) {
147
- import_antd.message.warning(`最多只能选择${maxCount}个文件`);
147
+ import_antd.message.warning(`最多只能選擇${maxCount}個文件`);
148
148
  return;
149
149
  }
150
150
  setSelectedItems([...selectedItems, item]);
@@ -157,7 +157,7 @@ var Media = (0, import_react.forwardRef)((props, ref) => {
157
157
  );
158
158
  const handleOk = (0, import_react.useCallback)(() => {
159
159
  if (selectedItems.length === 0) {
160
- import_antd.message.warning("请选择媒体文件");
160
+ import_antd.message.warning("請選擇媒體文件");
161
161
  return;
162
162
  }
163
163
  const urls = selectedItems.map((item) => item.url);
@@ -189,7 +189,7 @@ var Media = (0, import_react.forwardRef)((props, ref) => {
189
189
  onChange == null ? void 0 : onChange(multiple ? newFiles : newFiles[0] || "");
190
190
  }
191
191
  },
192
- "删除"
192
+ "刪除"
193
193
  )))));
194
194
  }
195
195
  return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-media-current-files" }, files.map((url, index) => /* @__PURE__ */ import_react.default.createElement("div", { key: index, className: "pisell-media-file-item" }, /* @__PURE__ */ import_react.default.createElement("span", null, url), /* @__PURE__ */ import_react.default.createElement(
@@ -202,7 +202,7 @@ var Media = (0, import_react.forwardRef)((props, ref) => {
202
202
  onChange == null ? void 0 : onChange(multiple ? newFiles : newFiles[0] || "");
203
203
  }
204
204
  },
205
- "删除"
205
+ "刪除"
206
206
  ))));
207
207
  }, [value, listType, multiple, onChange]);
208
208
  return /* @__PURE__ */ import_react.default.createElement("div", { ref, className: `pisell-media ${className || ""}`, style }, /* @__PURE__ */ import_react.default.createElement(
@@ -218,12 +218,12 @@ var Media = (0, import_react.forwardRef)((props, ref) => {
218
218
  ), showUploadList && renderCurrentFiles, /* @__PURE__ */ import_react.default.createElement(
219
219
  import_antd.Modal,
220
220
  {
221
- title: "媒体库",
221
+ title: "媒體庫",
222
222
  open: isModalVisible,
223
223
  onCancel: handleCancel,
224
224
  onOk: handleOk,
225
225
  width: 800,
226
- okText: "确定",
226
+ okText: "確定",
227
227
  cancelText: "取消"
228
228
  },
229
229
  /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-media-modal" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-media-upload" }, /* @__PURE__ */ import_react.default.createElement(
@@ -234,7 +234,7 @@ var Media = (0, import_react.forwardRef)((props, ref) => {
234
234
  showUploadList: false,
235
235
  disabled: uploading
236
236
  },
237
- /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { icon: /* @__PURE__ */ import_react.default.createElement(import_icons.PlusOutlined, null), loading: uploading }, "上传文件")
237
+ /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { icon: /* @__PURE__ */ import_react.default.createElement(import_icons.PlusOutlined, null), loading: uploading }, "上傳文件")
238
238
  )), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-media-list" }, mediaList == null ? void 0 : mediaList.map((item) => {
239
239
  const isSelected = selectedItems.find(
240
240
  (selected) => selected.id === item.id
@@ -259,7 +259,7 @@ var Media = (0, import_react.forwardRef)((props, ref) => {
259
259
  ),
260
260
  /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-media-item-info" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-media-item-name" }, item.name), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-media-item-size" }, (item.size / 1024 / 1024).toFixed(2), " MB"))
261
261
  );
262
- })), selectedItems.length > 0 && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-media-selected" }, "已选择 ", selectedItems.length, " 个文件"))
262
+ })), selectedItems.length > 0 && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-media-selected" }, "已選擇 ", selectedItems.length, " 個文件"))
263
263
  ));
264
264
  });
265
265
  var media_default = Media;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ interface PisellVHFixProps {
4
+ children?: React.ReactNode;
5
+ className?: string;
6
+ style?: React.CSSProperties;
7
+ height?: number;
8
+ minHeight?: boolean;
9
+ maxHeight?: boolean;
10
+ minusPixels?: number;
11
+ }
12
+ declare const PisellVHFix: React.FC<PisellVHFixProps>;
13
+ export default PisellVHFix;
@@ -0,0 +1,56 @@
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/pisellVHFix/index.tsx
30
+ var pisellVHFix_exports = {};
31
+ __export(pisellVHFix_exports, {
32
+ default: () => pisellVHFix_default
33
+ });
34
+ module.exports = __toCommonJS(pisellVHFix_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_useVH = require("../../hooks/useVH");
37
+ var import_index = require("./index.less");
38
+ var PisellVHFix = ({
39
+ children,
40
+ className,
41
+ style,
42
+ height = 100,
43
+ minHeight = false,
44
+ maxHeight = false,
45
+ minusPixels = 0
46
+ }) => {
47
+ (0, import_useVH.useVH)();
48
+ const containerStyle = {
49
+ ...style,
50
+ height: minusPixels > 0 ? `calc(var(--vh, 1vh) * ${height} - ${minusPixels}px)` : `calc(var(--vh, 1vh) * ${height})`,
51
+ ...minHeight && { minHeight: `calc(var(--vh, 1vh) * ${height})` },
52
+ ...maxHeight && { maxHeight: `calc(var(--vh, 1vh) * ${height})` }
53
+ };
54
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: `pisell-vh-fix ${className || ""}`, style: containerStyle }, children);
55
+ };
56
+ var pisellVHFix_default = PisellVHFix;
@@ -0,0 +1,10 @@
1
+ .pisell-vh-fix {
2
+ box-sizing: border-box;
3
+ overflow: hidden;
4
+
5
+ // 确保在Safari移动端正确显示
6
+ -webkit-overflow-scrolling: touch;
7
+
8
+ // 防止iOS Safari的弹性滚动
9
+ overscroll-behavior: contain;
10
+ }