@pisell/materials 1.0.850 → 1.0.852
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +13 -13
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +14 -14
- package/es/components/productCard/components/Warning/index.js +48 -0
- package/es/components/productCard/index.js +8 -8
- package/es/components/productCard/locales.js +6 -3
- package/es/components/productCard/status.js +3 -1
- package/es/components/walletCard/index.js +3 -4
- package/es/components/walletCard/index.less +10 -0
- package/lib/components/productCard/components/Warning/index.js +68 -0
- package/lib/components/productCard/index.js +4 -11
- package/lib/components/productCard/locales.js +6 -3
- package/lib/components/productCard/status.js +3 -1
- package/lib/components/walletCard/index.js +3 -2
- package/lib/components/walletCard/index.less +10 -0
- package/package.json +1 -1
|
@@ -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
|
+
osWainTips = _ref.osWainTips;
|
|
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 ((osWainTips === null || osWainTips === void 0 ? void 0 : osWainTips.length) > 0) {
|
|
29
|
+
return osWainTips.map(function (item) {
|
|
30
|
+
return locales.getText(item);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return [];
|
|
34
|
+
}, [errorMessage, osWainTips]);
|
|
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$osWainTip = dataSource.osWainTips,
|
|
69
|
+
osWainTips = _dataSource$osWainTip === void 0 ? [] : _dataSource$osWainTip;
|
|
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,
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
className: "pisell-lowcode-product-card-error"
|
|
167
|
-
}) : null), /*#__PURE__*/React.createElement(UseOpenNote, {
|
|
164
|
+
}) : null, /*#__PURE__*/React.createElement(Warning, {
|
|
165
|
+
errorMessage: errorMessage,
|
|
166
|
+
osWainTips: osWainTips
|
|
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), {}, {
|
|
@@ -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
|
};
|
|
@@ -179,9 +179,7 @@ var CardHeader = function CardHeader(_ref2) {
|
|
|
179
179
|
className: "pisell-wallet-card-header-level-text"
|
|
180
180
|
}, walletName)), processedShowShopName && shopName && /*#__PURE__*/React.createElement("div", null, shopName), processedShowCardNo && cardNo && /*#__PURE__*/React.createElement("div", null, cardNo), processedShowViewPin && /*#__PURE__*/React.createElement("div", {
|
|
181
181
|
className: "pisell-wallet-card-header-view-pin",
|
|
182
|
-
onClick:
|
|
183
|
-
return onViewPinClick === null || onViewPinClick === void 0 ? void 0 : onViewPinClick();
|
|
184
|
-
}
|
|
182
|
+
onClick: onViewPinClick
|
|
185
183
|
}, getText('walletCard-viewPin'), /*#__PURE__*/React.createElement(EyeOff, {
|
|
186
184
|
className: "pisell-wallet-card-header-view-pin-icon"
|
|
187
185
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
@@ -396,7 +394,8 @@ var WalletCard = function WalletCard(props) {
|
|
|
396
394
|
/**
|
|
397
395
|
* 查看PIN的回调
|
|
398
396
|
*/
|
|
399
|
-
var onViewPinClick = function onViewPinClick() {
|
|
397
|
+
var onViewPinClick = function onViewPinClick(e) {
|
|
398
|
+
e.stopPropagation();
|
|
400
399
|
if (props !== null && props !== void 0 && props.onViewPinClick) {
|
|
401
400
|
props.onViewPinClick();
|
|
402
401
|
} else {
|
|
@@ -108,6 +108,7 @@
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
.pisell-wallet-card-header-view-pin {
|
|
111
|
+
position: relative;
|
|
111
112
|
color: #53b1fd;
|
|
112
113
|
cursor: pointer;
|
|
113
114
|
font-size: 12px;
|
|
@@ -122,6 +123,15 @@
|
|
|
122
123
|
color: #53b1fd;
|
|
123
124
|
font-size: 16px;
|
|
124
125
|
}
|
|
126
|
+
|
|
127
|
+
&:after {
|
|
128
|
+
content: '';
|
|
129
|
+
position: absolute;
|
|
130
|
+
top: -5px;
|
|
131
|
+
left: -5px;
|
|
132
|
+
right: -5px;
|
|
133
|
+
bottom: -5px; /* 向外扩展5px */
|
|
134
|
+
}
|
|
125
135
|
}
|
|
126
136
|
}
|
|
127
137
|
|
|
@@ -0,0 +1,68 @@
|
|
|
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/productCard/components/Warning/index.tsx
|
|
30
|
+
var Warning_exports = {};
|
|
31
|
+
__export(Warning_exports, {
|
|
32
|
+
default: () => Warning_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Warning_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_utils = require("@pisell/utils");
|
|
37
|
+
var import_antd = require("antd");
|
|
38
|
+
var import__ = require("../../index.less");
|
|
39
|
+
var Warning = ({ errorMessage, osWainTips }) => {
|
|
40
|
+
const errorLists = (0, import_react.useMemo)(() => {
|
|
41
|
+
if (errorMessage) {
|
|
42
|
+
if (Array.isArray(errorMessage)) {
|
|
43
|
+
return errorMessage;
|
|
44
|
+
}
|
|
45
|
+
if (typeof errorMessage === "string") {
|
|
46
|
+
return [errorMessage];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if ((osWainTips == null ? void 0 : osWainTips.length) > 0) {
|
|
50
|
+
return osWainTips.map((item) => import_utils.locales.getText(item));
|
|
51
|
+
}
|
|
52
|
+
return [];
|
|
53
|
+
}, [errorMessage, osWainTips]);
|
|
54
|
+
if ((errorLists == null ? void 0 : errorLists.length) === 0) {
|
|
55
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null);
|
|
56
|
+
}
|
|
57
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, errorLists.map((item, index) => /* @__PURE__ */ import_react.default.createElement(
|
|
58
|
+
import_antd.Alert,
|
|
59
|
+
{
|
|
60
|
+
key: index,
|
|
61
|
+
message: item,
|
|
62
|
+
type: "warning",
|
|
63
|
+
showIcon: true,
|
|
64
|
+
className: "pisell-lowcode-product-card-error"
|
|
65
|
+
}
|
|
66
|
+
)));
|
|
67
|
+
};
|
|
68
|
+
var Warning_default = Warning;
|
|
@@ -34,7 +34,6 @@ __export(productCard_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(productCard_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_classnames = __toESM(require("classnames"));
|
|
37
|
-
var import_antd = require("antd");
|
|
38
37
|
var import_utils = require("@pisell/utils");
|
|
39
38
|
var import_cardPro = __toESM(require("../cardPro"));
|
|
40
39
|
var import_Header = __toESM(require("./components/Header"));
|
|
@@ -50,6 +49,7 @@ var import_useOpenNote = __toESM(require("./hooks/useOpenNote"));
|
|
|
50
49
|
var import_locales = __toESM(require("./locales"));
|
|
51
50
|
var import_status = require("./status");
|
|
52
51
|
var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
|
|
52
|
+
var import_Warning = __toESM(require("./components/Warning"));
|
|
53
53
|
var import_index = require("./index.less");
|
|
54
54
|
var ProductCard = (props) => {
|
|
55
55
|
var _a, _b;
|
|
@@ -84,7 +84,8 @@ var ProductCard = (props) => {
|
|
|
84
84
|
isShowAction,
|
|
85
85
|
actionText,
|
|
86
86
|
errorMessage,
|
|
87
|
-
isNormalProduct
|
|
87
|
+
isNormalProduct,
|
|
88
|
+
osWainTips = []
|
|
88
89
|
} = dataSource;
|
|
89
90
|
const showImage = (0, import_react.useMemo)(() => {
|
|
90
91
|
return isShowImage && image;
|
|
@@ -180,15 +181,7 @@ var ProductCard = (props) => {
|
|
|
180
181
|
onAction: () => onAction == null ? void 0 : onAction(dataSource)
|
|
181
182
|
}
|
|
182
183
|
) : null,
|
|
183
|
-
|
|
184
|
-
import_antd.Alert,
|
|
185
|
-
{
|
|
186
|
-
message: errorMessage,
|
|
187
|
-
type: "warning",
|
|
188
|
-
showIcon: true,
|
|
189
|
-
className: "pisell-lowcode-product-card-error"
|
|
190
|
-
}
|
|
191
|
-
) : null
|
|
184
|
+
/* @__PURE__ */ import_react.default.createElement(import_Warning.default, { errorMessage, osWainTips })
|
|
192
185
|
), /* @__PURE__ */ import_react.default.createElement(
|
|
193
186
|
import_useOpenNote.default,
|
|
194
187
|
{
|
|
@@ -47,7 +47,8 @@ var locales_default = {
|
|
|
47
47
|
"pisell2.product.card.add.holder.modal.cancel": "Cancel",
|
|
48
48
|
"pisell2.product.card.add.holder.modal.clear": "Clear",
|
|
49
49
|
"pisell2.product.card.add.holder.modal.apply": "Apply",
|
|
50
|
-
"pisell2.product.card.add.holder.modal.add": "Add New"
|
|
50
|
+
"pisell2.product.card.add.holder.modal.add": "Add New",
|
|
51
|
+
"pisell2.product.card.closing-soon.warning": "The venue will close soon. Please make sure you have enough time for your visit."
|
|
51
52
|
},
|
|
52
53
|
"zh-CN": {
|
|
53
54
|
"pisell2.product.card.edit": "编辑",
|
|
@@ -73,7 +74,8 @@ var locales_default = {
|
|
|
73
74
|
"pisell2.product.card.add.holder.modal.cancel": "取消",
|
|
74
75
|
"pisell2.product.card.add.holder.modal.clear": "清除",
|
|
75
76
|
"pisell2.product.card.add.holder.modal.apply": "应用",
|
|
76
|
-
"pisell2.product.card.add.holder.modal.add": "添加"
|
|
77
|
+
"pisell2.product.card.add.holder.modal.add": "添加",
|
|
78
|
+
"pisell2.product.card.closing-soon.warning": "当前入场时间临近营业结束,请确认是否仍要购买。"
|
|
77
79
|
},
|
|
78
80
|
"zh-HK": {
|
|
79
81
|
"pisell2.product.card.edit": "編輯",
|
|
@@ -99,6 +101,7 @@ var locales_default = {
|
|
|
99
101
|
"pisell2.product.card.add.holder.modal.cancel": "取消",
|
|
100
102
|
"pisell2.product.card.add.holder.modal.clear": "清除",
|
|
101
103
|
"pisell2.product.card.add.holder.modal.apply": "應用",
|
|
102
|
-
"pisell2.product.card.add.holder.modal.add": "添加"
|
|
104
|
+
"pisell2.product.card.add.holder.modal.add": "添加",
|
|
105
|
+
"pisell2.product.card.closing-soon.warning": "當前入場時間臨近營業結束,請確認是否仍要購買。"
|
|
103
106
|
}
|
|
104
107
|
};
|
|
@@ -61,7 +61,9 @@ var defaultValue = {
|
|
|
61
61
|
isShowPackageNote: true,
|
|
62
62
|
isShowEditProduct: false,
|
|
63
63
|
locale: "en-US",
|
|
64
|
-
symbol: "$"
|
|
64
|
+
symbol: "$",
|
|
65
|
+
// os层自定义错误提示
|
|
66
|
+
osWainTips: []
|
|
65
67
|
};
|
|
66
68
|
// Annotate the CommonJS export names for ESM import in node:
|
|
67
69
|
0 && (module.exports = {
|
|
@@ -165,7 +165,7 @@ var CardHeader = ({
|
|
|
165
165
|
"div",
|
|
166
166
|
{
|
|
167
167
|
className: "pisell-wallet-card-header-view-pin",
|
|
168
|
-
onClick:
|
|
168
|
+
onClick: onViewPinClick
|
|
169
169
|
},
|
|
170
170
|
(0, import_locales.getText)("walletCard-viewPin"),
|
|
171
171
|
/* @__PURE__ */ import_react.default.createElement(import_EyeOff.default, { className: "pisell-wallet-card-header-view-pin-icon" })
|
|
@@ -341,7 +341,8 @@ var WalletCard = (props) => {
|
|
|
341
341
|
}
|
|
342
342
|
});
|
|
343
343
|
};
|
|
344
|
-
const onViewPinClick = () => {
|
|
344
|
+
const onViewPinClick = (e) => {
|
|
345
|
+
e.stopPropagation();
|
|
345
346
|
if (props == null ? void 0 : props.onViewPinClick) {
|
|
346
347
|
props.onViewPinClick();
|
|
347
348
|
} else {
|
|
@@ -108,6 +108,7 @@
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
.pisell-wallet-card-header-view-pin {
|
|
111
|
+
position: relative;
|
|
111
112
|
color: #53b1fd;
|
|
112
113
|
cursor: pointer;
|
|
113
114
|
font-size: 12px;
|
|
@@ -122,6 +123,15 @@
|
|
|
122
123
|
color: #53b1fd;
|
|
123
124
|
font-size: 16px;
|
|
124
125
|
}
|
|
126
|
+
|
|
127
|
+
&:after {
|
|
128
|
+
content: '';
|
|
129
|
+
position: absolute;
|
|
130
|
+
top: -5px;
|
|
131
|
+
left: -5px;
|
|
132
|
+
right: -5px;
|
|
133
|
+
bottom: -5px; /* 向外扩展5px */
|
|
134
|
+
}
|
|
125
135
|
}
|
|
126
136
|
}
|
|
127
137
|
|