@pisell/materials 3.2.20 → 3.2.21
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 +3 -3
- 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/pisellGoodPassCard/index.d.ts +47 -0
- package/es/components/pisellGoodPassCard/index.js +115 -0
- package/es/components/pisellGoodPassCard/index.less +52 -0
- package/es/components/productCard/components/Time/components/SelectResource/index.js +4 -4
- package/es/components/productCard/components/Time/index.d.ts +3 -0
- package/es/components/productCard/components/Time/index.js +3 -2
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/locales/en-US.d.ts +2 -0
- package/es/locales/en-US.js +4 -1
- package/es/locales/zh-CN.d.ts +2 -0
- package/es/locales/zh-CN.js +4 -1
- package/es/locales/zh-TW.d.ts +2 -0
- package/es/locales/zh-TW.js +3 -1
- package/lib/components/pisellGoodPassCard/index.d.ts +47 -0
- package/lib/components/pisellGoodPassCard/index.js +109 -0
- package/lib/components/pisellGoodPassCard/index.less +52 -0
- package/lib/components/productCard/components/Time/components/SelectResource/index.js +4 -4
- package/lib/components/productCard/components/Time/index.d.ts +3 -0
- package/lib/components/productCard/components/Time/index.js +3 -2
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/locales/en-US.d.ts +2 -0
- package/lib/locales/en-US.js +4 -1
- package/lib/locales/zh-CN.d.ts +2 -0
- package/lib/locales/zh-CN.js +4 -1
- package/lib/locales/zh-TW.d.ts +2 -0
- package/lib/locales/zh-TW.js +3 -1
- package/lowcode/pisell-good-pass-card/meta.ts +38 -0
- package/lowcode/pisell-good-pass-card/snippets.ts +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface ApplicableProductDetails {
|
|
4
|
+
amount: string;
|
|
5
|
+
type: string;
|
|
6
|
+
resource_id: number;
|
|
7
|
+
title: string;
|
|
8
|
+
original_amount: string;
|
|
9
|
+
}
|
|
10
|
+
interface Discount {
|
|
11
|
+
id: number;
|
|
12
|
+
product_name: string;
|
|
13
|
+
encoded: string;
|
|
14
|
+
code: string;
|
|
15
|
+
tag: string;
|
|
16
|
+
expire_time?: string;
|
|
17
|
+
product_id: number;
|
|
18
|
+
relation_type: string;
|
|
19
|
+
par_value: string;
|
|
20
|
+
used_par_value: string;
|
|
21
|
+
limit_status: string;
|
|
22
|
+
limited_relation_product_data: any;
|
|
23
|
+
balance: string;
|
|
24
|
+
format_title: any;
|
|
25
|
+
product: any;
|
|
26
|
+
savedAmount: number;
|
|
27
|
+
isDisabled: boolean;
|
|
28
|
+
isSelected?: boolean;
|
|
29
|
+
isAvailable?: boolean;
|
|
30
|
+
isUsed?: boolean;
|
|
31
|
+
applicableProductIds?: number[];
|
|
32
|
+
applicableProductDetails: ApplicableProductDetails[];
|
|
33
|
+
appliedProductDetails: any[];
|
|
34
|
+
}
|
|
35
|
+
export interface PisellGoodPassCardProps {
|
|
36
|
+
/**数据源 */
|
|
37
|
+
dataSource: Array<Discount>;
|
|
38
|
+
/**事件 */
|
|
39
|
+
onChange?: (current: {
|
|
40
|
+
id: string | number;
|
|
41
|
+
isSelected: boolean;
|
|
42
|
+
}) => void;
|
|
43
|
+
/**样式 */
|
|
44
|
+
style: React.CSSProperties;
|
|
45
|
+
}
|
|
46
|
+
declare const index: (props: PisellGoodPassCardProps) => JSX.Element;
|
|
47
|
+
export default index;
|
|
@@ -0,0 +1,115 @@
|
|
|
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
|
+
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(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import React, { useState } from 'react';
|
|
14
|
+
import { Checkbox, Divider, Typography } from 'antd';
|
|
15
|
+
import { locales } from '@pisell/utils';
|
|
16
|
+
import { PisellText, PisellCard, PisellModal } from "../../index";
|
|
17
|
+
import useEngineContext from "../../hooks/useEngineContext";
|
|
18
|
+
import "./index.less";
|
|
19
|
+
var clsPrefix = 'pisell-good-pass-card';
|
|
20
|
+
var index = function index(props) {
|
|
21
|
+
var _context$appHelper;
|
|
22
|
+
var context = useEngineContext();
|
|
23
|
+
var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
|
|
24
|
+
translation = _context$appHelper$ut.translation;
|
|
25
|
+
var _props$dataSource = props.dataSource,
|
|
26
|
+
dataSource = _props$dataSource === void 0 ? [] : _props$dataSource,
|
|
27
|
+
onChange = props.onChange,
|
|
28
|
+
_props$style = props.style,
|
|
29
|
+
style = _props$style === void 0 ? {} : _props$style;
|
|
30
|
+
var _useState = useState(false),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
showModal = _useState2[0],
|
|
33
|
+
setShowModal = _useState2[1];
|
|
34
|
+
console.log('pisell good card datasource', dataSource);
|
|
35
|
+
var handleChange = function handleChange(newValue) {
|
|
36
|
+
if (onChange) {
|
|
37
|
+
onChange(newValue);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var handleItemChange = function handleItemChange(item, checked) {
|
|
41
|
+
handleChange({
|
|
42
|
+
id: item.id,
|
|
43
|
+
isSelected: checked
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
var renderVoucherContent = function renderVoucherContent(item) {
|
|
47
|
+
return /*#__PURE__*/React.createElement("span", null, "Save ", /*#__PURE__*/React.createElement(PisellText.Amount, {
|
|
48
|
+
value: item.savedAmount
|
|
49
|
+
}));
|
|
50
|
+
};
|
|
51
|
+
var renderActionElement = function renderActionElement(item) {
|
|
52
|
+
var isChecked = item.isSelected;
|
|
53
|
+
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
54
|
+
disabled: item.isDisabled,
|
|
55
|
+
style: {
|
|
56
|
+
marginLeft: 8
|
|
57
|
+
},
|
|
58
|
+
checked: isChecked,
|
|
59
|
+
onChange: function onChange(e) {
|
|
60
|
+
return handleItemChange(item, e.target.checked);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
var renderVoucherItem = function renderVoucherItem(item) {
|
|
65
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
66
|
+
key: item.id,
|
|
67
|
+
className: "".concat(clsPrefix, "-voucher-item")
|
|
68
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
className: "item-title"
|
|
70
|
+
}, translation(item.format_title)), /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
className: "item-content"
|
|
72
|
+
}, renderVoucherContent(item), renderActionElement(item)));
|
|
73
|
+
};
|
|
74
|
+
var renderModal = function renderModal() {
|
|
75
|
+
return /*#__PURE__*/React.createElement(PisellModal, {
|
|
76
|
+
title: 'Vouchers',
|
|
77
|
+
footer: null,
|
|
78
|
+
open: showModal,
|
|
79
|
+
onCancel: function onCancel() {
|
|
80
|
+
return setShowModal(false);
|
|
81
|
+
},
|
|
82
|
+
className: "".concat(clsPrefix, "-all-items-modal")
|
|
83
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
84
|
+
style: {
|
|
85
|
+
padding: '10px 0'
|
|
86
|
+
}
|
|
87
|
+
}, dataSource.map(renderVoucherItem)));
|
|
88
|
+
};
|
|
89
|
+
var renderMixedMode = function renderMixedMode() {
|
|
90
|
+
var list = dataSource.length > 3 ? dataSource.slice(0, 3) : dataSource;
|
|
91
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
92
|
+
className: "".concat(clsPrefix, "-header")
|
|
93
|
+
}, /*#__PURE__*/React.createElement("div", null, locales.getText('pisell2.text.goodpass.product-vouchers')), /*#__PURE__*/React.createElement(Typography.Text, {
|
|
94
|
+
underline: true,
|
|
95
|
+
onClick: function onClick() {
|
|
96
|
+
return setShowModal(true);
|
|
97
|
+
}
|
|
98
|
+
}, locales.getText('pisell2.text.goodpass.view-more'))), /*#__PURE__*/React.createElement(Divider, {
|
|
99
|
+
style: {
|
|
100
|
+
margin: 4
|
|
101
|
+
}
|
|
102
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
103
|
+
className: "".concat(clsPrefix, "-body")
|
|
104
|
+
}, list.map(renderVoucherItem)));
|
|
105
|
+
};
|
|
106
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, renderModal(), /*#__PURE__*/React.createElement(PisellCard, {
|
|
107
|
+
padding: 8,
|
|
108
|
+
borderRadius: 8,
|
|
109
|
+
style: _objectSpread({
|
|
110
|
+
width: 378
|
|
111
|
+
}, style),
|
|
112
|
+
className: clsPrefix
|
|
113
|
+
}, renderMixedMode()));
|
|
114
|
+
};
|
|
115
|
+
export default index;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
.pisell-good-pass-card-all-items-modal,
|
|
2
|
+
.pisell-good-pass-card {
|
|
3
|
+
.pisell-good-pass-card-header,
|
|
4
|
+
.pisell-good-pass-card-group-header {
|
|
5
|
+
display: flex;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
align-items: center;
|
|
8
|
+
color: var(--Gray-900, #101828);
|
|
9
|
+
text-align: center;
|
|
10
|
+
font-family: Inter;
|
|
11
|
+
font-size: 14px;
|
|
12
|
+
font-style: normal;
|
|
13
|
+
font-weight: 600;
|
|
14
|
+
line-height: 20px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.pisell-good-pass-card-voucher-item {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
height: 22px;
|
|
22
|
+
|
|
23
|
+
.item-title {
|
|
24
|
+
color: var(--Gray-500, #667085);
|
|
25
|
+
text-align: center;
|
|
26
|
+
font-family: Inter;
|
|
27
|
+
font-size: 14px;
|
|
28
|
+
font-style: normal;
|
|
29
|
+
font-weight: 600;
|
|
30
|
+
line-height: 20px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.item-content {
|
|
34
|
+
color: var(--, #8157d5);
|
|
35
|
+
font-family: Inter;
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
font-style: normal;
|
|
38
|
+
font-weight: 400;
|
|
39
|
+
line-height: 20px;
|
|
40
|
+
|
|
41
|
+
.add-btn {
|
|
42
|
+
color: var(--, #8157d5);
|
|
43
|
+
text-align: center;
|
|
44
|
+
font-family: Inter;
|
|
45
|
+
font-size: 14px;
|
|
46
|
+
font-style: normal;
|
|
47
|
+
font-weight: 600;
|
|
48
|
+
line-height: 20px; /* 142.857% */
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -6,17 +6,17 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
8
8
|
import { Select } from 'antd';
|
|
9
|
+
import Divider from "../../../Divider";
|
|
9
10
|
var SelectResource = function SelectResource(_ref) {
|
|
10
11
|
var lists = _ref.lists,
|
|
11
12
|
value = _ref.value,
|
|
12
13
|
_onChange = _ref.onChange;
|
|
13
|
-
var _useState = useState(
|
|
14
|
+
var _useState = useState(),
|
|
14
15
|
_useState2 = _slicedToArray(_useState, 2),
|
|
15
16
|
selectedValue = _useState2[0],
|
|
16
17
|
setSelectedValue = _useState2[1];
|
|
17
18
|
useEffect(function () {
|
|
18
19
|
setSelectedValue(value);
|
|
19
|
-
console.log(selectedValue, lists, value, 'SelectResource');
|
|
20
20
|
}, [value]);
|
|
21
21
|
|
|
22
22
|
/**
|
|
@@ -35,7 +35,7 @@ var SelectResource = function SelectResource(_ref) {
|
|
|
35
35
|
}, d['label']);
|
|
36
36
|
});
|
|
37
37
|
}, [lists]);
|
|
38
|
-
return /*#__PURE__*/React.createElement(Select, {
|
|
38
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(Select, {
|
|
39
39
|
size: "large",
|
|
40
40
|
allowClear: true,
|
|
41
41
|
showSearch: true,
|
|
@@ -47,6 +47,6 @@ var SelectResource = function SelectResource(_ref) {
|
|
|
47
47
|
setSelectedValue(val);
|
|
48
48
|
_onChange(val);
|
|
49
49
|
}
|
|
50
|
-
}, renderOptions());
|
|
50
|
+
}, renderOptions()));
|
|
51
51
|
};
|
|
52
52
|
export default SelectResource;
|
|
@@ -23,7 +23,8 @@ var Time = function Time(_ref) {
|
|
|
23
23
|
resource_id = item.resource_id,
|
|
24
24
|
relation_form_name = item.relation_form_name,
|
|
25
25
|
like_status = item.like_status,
|
|
26
|
-
resources = item.resources
|
|
26
|
+
resources = item.resources,
|
|
27
|
+
is_hide_like = item.is_hide_like;
|
|
27
28
|
var isShow = useMemo(function () {
|
|
28
29
|
return start_date && end_date || isShowHolder && holder_title || resource_id || relation_form_name;
|
|
29
30
|
}, [start_date, isShowHolder, holder_title, resource_id]);
|
|
@@ -35,7 +36,7 @@ var Time = function Time(_ref) {
|
|
|
35
36
|
className: "".concat(prefix, "product-holder-wrap")
|
|
36
37
|
}, holder_title) : null, resource_id || relation_form_name || isShowChangeResource ? /*#__PURE__*/React.createElement("div", {
|
|
37
38
|
className: "".concat(prefix, "product-technician ").concat(isShowChangeResource ? 'pisell-lowcode-change-resource' : '')
|
|
38
|
-
}, resource_id ? /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
}, resource_id && !is_hide_like ? /*#__PURE__*/React.createElement("div", {
|
|
39
40
|
className: "".concat(prefix, "product-card-like-wrap")
|
|
40
41
|
}, /*#__PURE__*/React.createElement(Like, {
|
|
41
42
|
style: {
|
package/es/index.d.ts
CHANGED
|
@@ -138,3 +138,4 @@ export { default as PisellList01 } from './components/pisellList01';
|
|
|
138
138
|
export { default as SectionFooters } from './components/section-footers';
|
|
139
139
|
export { default as ProductCard } from './components/productCard';
|
|
140
140
|
export { default as Collapse } from './components/collapse';
|
|
141
|
+
export { default as PisellGoodPassCard } from './components/pisellGoodPassCard';
|
package/es/index.js
CHANGED
|
@@ -137,4 +137,5 @@ export { default as PisellHeaderProgressBar } from "./components/pisellHeaderPro
|
|
|
137
137
|
export { default as PisellList01 } from "./components/pisellList01";
|
|
138
138
|
export { default as SectionFooters } from "./components/section-footers";
|
|
139
139
|
export { default as ProductCard } from "./components/productCard";
|
|
140
|
-
export { default as Collapse } from "./components/collapse";
|
|
140
|
+
export { default as Collapse } from "./components/collapse";
|
|
141
|
+
export { default as PisellGoodPassCard } from "./components/pisellGoodPassCard";
|
package/es/locales/en-US.d.ts
CHANGED
|
@@ -259,5 +259,7 @@ declare const _default: {
|
|
|
259
259
|
'pisell-login-and-register-register-button-text': string;
|
|
260
260
|
'pisell-login-and-register-remember-me': string;
|
|
261
261
|
'pisell-login-and-register-forgot-password': string;
|
|
262
|
+
'pisell2.text.goodpass.product-vouchers': string;
|
|
263
|
+
'pisell2.text.goodpass.view-more': string;
|
|
262
264
|
};
|
|
263
265
|
export default _default;
|
package/es/locales/en-US.js
CHANGED
|
@@ -322,5 +322,8 @@ export default {
|
|
|
322
322
|
'pisell-login-and-register-register-password-placeholder': 'Create a password',
|
|
323
323
|
'pisell-login-and-register-register-button-text': 'Create account',
|
|
324
324
|
'pisell-login-and-register-remember-me': 'Remember me',
|
|
325
|
-
'pisell-login-and-register-forgot-password': 'Forgot password?'
|
|
325
|
+
'pisell-login-and-register-forgot-password': 'Forgot password?',
|
|
326
|
+
// 商品券组件
|
|
327
|
+
'pisell2.text.goodpass.product-vouchers': "Product Vouchers",
|
|
328
|
+
'pisell2.text.goodpass.view-more': "View More"
|
|
326
329
|
};
|
package/es/locales/zh-CN.d.ts
CHANGED
|
@@ -254,5 +254,7 @@ declare const _default: {
|
|
|
254
254
|
'pisell-login-and-register-register-button-text': string;
|
|
255
255
|
'pisell-login-and-register-remember-me': string;
|
|
256
256
|
'pisell-login-and-register-forgot-password': string;
|
|
257
|
+
'pisell2.text.goodpass.product-vouchers': string;
|
|
258
|
+
'pisell2.text.goodpass.view-more': string;
|
|
257
259
|
};
|
|
258
260
|
export default _default;
|
package/es/locales/zh-CN.js
CHANGED
|
@@ -313,5 +313,8 @@ export default {
|
|
|
313
313
|
'pisell-login-and-register-register-password-placeholder': '创建密码',
|
|
314
314
|
'pisell-login-and-register-register-button-text': '创建账户',
|
|
315
315
|
'pisell-login-and-register-remember-me': '记住我',
|
|
316
|
-
'pisell-login-and-register-forgot-password': '忘记密码?'
|
|
316
|
+
'pisell-login-and-register-forgot-password': '忘记密码?',
|
|
317
|
+
// 商品券
|
|
318
|
+
'pisell2.text.goodpass.product-vouchers': "商品兑换券",
|
|
319
|
+
'pisell2.text.goodpass.view-more': "查看更多"
|
|
317
320
|
};
|
package/es/locales/zh-TW.d.ts
CHANGED
|
@@ -254,5 +254,7 @@ declare const _default: {
|
|
|
254
254
|
'pisell-login-and-register-register-button-text': string;
|
|
255
255
|
'pisell-login-and-register-remember-me': string;
|
|
256
256
|
'pisell-login-and-register-forgot-password': string;
|
|
257
|
+
'pisell2.text.goodpass.product-vouchers': string;
|
|
258
|
+
'pisell2.text.goodpass.view-more': string;
|
|
257
259
|
};
|
|
258
260
|
export default _default;
|
package/es/locales/zh-TW.js
CHANGED
|
@@ -315,5 +315,7 @@ export default {
|
|
|
315
315
|
'pisell-login-and-register-register-password-placeholder': '創建密碼',
|
|
316
316
|
'pisell-login-and-register-register-button-text': '創建帳戶',
|
|
317
317
|
'pisell-login-and-register-remember-me': '記住我',
|
|
318
|
-
'pisell-login-and-register-forgot-password': '忘記密碼?'
|
|
318
|
+
'pisell-login-and-register-forgot-password': '忘記密碼?',
|
|
319
|
+
'pisell2.text.goodpass.product-vouchers': "商品兌換券",
|
|
320
|
+
'pisell2.text.goodpass.view-more': "查看更多"
|
|
319
321
|
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface ApplicableProductDetails {
|
|
4
|
+
amount: string;
|
|
5
|
+
type: string;
|
|
6
|
+
resource_id: number;
|
|
7
|
+
title: string;
|
|
8
|
+
original_amount: string;
|
|
9
|
+
}
|
|
10
|
+
interface Discount {
|
|
11
|
+
id: number;
|
|
12
|
+
product_name: string;
|
|
13
|
+
encoded: string;
|
|
14
|
+
code: string;
|
|
15
|
+
tag: string;
|
|
16
|
+
expire_time?: string;
|
|
17
|
+
product_id: number;
|
|
18
|
+
relation_type: string;
|
|
19
|
+
par_value: string;
|
|
20
|
+
used_par_value: string;
|
|
21
|
+
limit_status: string;
|
|
22
|
+
limited_relation_product_data: any;
|
|
23
|
+
balance: string;
|
|
24
|
+
format_title: any;
|
|
25
|
+
product: any;
|
|
26
|
+
savedAmount: number;
|
|
27
|
+
isDisabled: boolean;
|
|
28
|
+
isSelected?: boolean;
|
|
29
|
+
isAvailable?: boolean;
|
|
30
|
+
isUsed?: boolean;
|
|
31
|
+
applicableProductIds?: number[];
|
|
32
|
+
applicableProductDetails: ApplicableProductDetails[];
|
|
33
|
+
appliedProductDetails: any[];
|
|
34
|
+
}
|
|
35
|
+
export interface PisellGoodPassCardProps {
|
|
36
|
+
/**数据源 */
|
|
37
|
+
dataSource: Array<Discount>;
|
|
38
|
+
/**事件 */
|
|
39
|
+
onChange?: (current: {
|
|
40
|
+
id: string | number;
|
|
41
|
+
isSelected: boolean;
|
|
42
|
+
}) => void;
|
|
43
|
+
/**样式 */
|
|
44
|
+
style: React.CSSProperties;
|
|
45
|
+
}
|
|
46
|
+
declare const index: (props: PisellGoodPassCardProps) => JSX.Element;
|
|
47
|
+
export default index;
|
|
@@ -0,0 +1,109 @@
|
|
|
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/pisellGoodPassCard/index.tsx
|
|
30
|
+
var pisellGoodPassCard_exports = {};
|
|
31
|
+
__export(pisellGoodPassCard_exports, {
|
|
32
|
+
default: () => pisellGoodPassCard_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(pisellGoodPassCard_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_utils = require("@pisell/utils");
|
|
38
|
+
var import__ = require("../../index");
|
|
39
|
+
var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
|
|
40
|
+
var import_index = require("./index.less");
|
|
41
|
+
var clsPrefix = "pisell-good-pass-card";
|
|
42
|
+
var index = (props) => {
|
|
43
|
+
var _a;
|
|
44
|
+
const context = (0, import_useEngineContext.default)();
|
|
45
|
+
const { translation } = (_a = context.appHelper) == null ? void 0 : _a.utils;
|
|
46
|
+
const { dataSource = [], onChange, style = {} } = props;
|
|
47
|
+
const [showModal, setShowModal] = (0, import_react.useState)(false);
|
|
48
|
+
console.log("pisell good card datasource", dataSource);
|
|
49
|
+
const handleChange = (newValue) => {
|
|
50
|
+
if (onChange) {
|
|
51
|
+
onChange(newValue);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const handleItemChange = (item, checked) => {
|
|
55
|
+
handleChange({
|
|
56
|
+
id: item.id,
|
|
57
|
+
isSelected: checked
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
const renderVoucherContent = (item) => {
|
|
61
|
+
return /* @__PURE__ */ import_react.default.createElement("span", null, "Save ", /* @__PURE__ */ import_react.default.createElement(import__.PisellText.Amount, { value: item.savedAmount }));
|
|
62
|
+
};
|
|
63
|
+
const renderActionElement = (item) => {
|
|
64
|
+
const isChecked = item.isSelected;
|
|
65
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
66
|
+
import_antd.Checkbox,
|
|
67
|
+
{
|
|
68
|
+
disabled: item.isDisabled,
|
|
69
|
+
style: { marginLeft: 8 },
|
|
70
|
+
checked: isChecked,
|
|
71
|
+
onChange: (e) => handleItemChange(item, e.target.checked)
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
const renderVoucherItem = (item) => {
|
|
76
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { key: item.id, className: `${clsPrefix}-voucher-item` }, /* @__PURE__ */ import_react.default.createElement("div", { className: "item-title" }, translation(item.format_title)), /* @__PURE__ */ import_react.default.createElement("div", { className: "item-content" }, renderVoucherContent(item), renderActionElement(item)));
|
|
77
|
+
};
|
|
78
|
+
const renderModal = () => {
|
|
79
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
80
|
+
import__.PisellModal,
|
|
81
|
+
{
|
|
82
|
+
title: "Vouchers",
|
|
83
|
+
footer: null,
|
|
84
|
+
open: showModal,
|
|
85
|
+
onCancel: () => setShowModal(false),
|
|
86
|
+
className: `${clsPrefix}-all-items-modal`
|
|
87
|
+
},
|
|
88
|
+
/* @__PURE__ */ import_react.default.createElement("div", { style: { padding: "10px 0" } }, dataSource.map(renderVoucherItem))
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
const renderMixedMode = () => {
|
|
92
|
+
const list = dataSource.length > 3 ? dataSource.slice(0, 3) : dataSource;
|
|
93
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: `${clsPrefix}-header` }, /* @__PURE__ */ import_react.default.createElement("div", null, import_utils.locales.getText("pisell2.text.goodpass.product-vouchers")), /* @__PURE__ */ import_react.default.createElement(import_antd.Typography.Text, { underline: true, onClick: () => setShowModal(true) }, import_utils.locales.getText("pisell2.text.goodpass.view-more"))), /* @__PURE__ */ import_react.default.createElement(import_antd.Divider, { style: { margin: 4 } }), /* @__PURE__ */ import_react.default.createElement("div", { className: `${clsPrefix}-body` }, list.map(renderVoucherItem)));
|
|
94
|
+
};
|
|
95
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, renderModal(), /* @__PURE__ */ import_react.default.createElement(
|
|
96
|
+
import__.PisellCard,
|
|
97
|
+
{
|
|
98
|
+
padding: 8,
|
|
99
|
+
borderRadius: 8,
|
|
100
|
+
style: {
|
|
101
|
+
width: 378,
|
|
102
|
+
...style
|
|
103
|
+
},
|
|
104
|
+
className: clsPrefix
|
|
105
|
+
},
|
|
106
|
+
renderMixedMode()
|
|
107
|
+
));
|
|
108
|
+
};
|
|
109
|
+
var pisellGoodPassCard_default = index;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
.pisell-good-pass-card-all-items-modal,
|
|
2
|
+
.pisell-good-pass-card {
|
|
3
|
+
.pisell-good-pass-card-header,
|
|
4
|
+
.pisell-good-pass-card-group-header {
|
|
5
|
+
display: flex;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
align-items: center;
|
|
8
|
+
color: var(--Gray-900, #101828);
|
|
9
|
+
text-align: center;
|
|
10
|
+
font-family: Inter;
|
|
11
|
+
font-size: 14px;
|
|
12
|
+
font-style: normal;
|
|
13
|
+
font-weight: 600;
|
|
14
|
+
line-height: 20px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.pisell-good-pass-card-voucher-item {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
height: 22px;
|
|
22
|
+
|
|
23
|
+
.item-title {
|
|
24
|
+
color: var(--Gray-500, #667085);
|
|
25
|
+
text-align: center;
|
|
26
|
+
font-family: Inter;
|
|
27
|
+
font-size: 14px;
|
|
28
|
+
font-style: normal;
|
|
29
|
+
font-weight: 600;
|
|
30
|
+
line-height: 20px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.item-content {
|
|
34
|
+
color: var(--, #8157d5);
|
|
35
|
+
font-family: Inter;
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
font-style: normal;
|
|
38
|
+
font-weight: 400;
|
|
39
|
+
line-height: 20px;
|
|
40
|
+
|
|
41
|
+
.add-btn {
|
|
42
|
+
color: var(--, #8157d5);
|
|
43
|
+
text-align: center;
|
|
44
|
+
font-family: Inter;
|
|
45
|
+
font-size: 14px;
|
|
46
|
+
font-style: normal;
|
|
47
|
+
font-weight: 600;
|
|
48
|
+
line-height: 20px; /* 142.857% */
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -34,18 +34,18 @@ __export(SelectResource_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(SelectResource_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_antd = require("antd");
|
|
37
|
+
var import_Divider = __toESM(require("../../../Divider"));
|
|
37
38
|
var SelectResource = ({ lists, value, onChange }) => {
|
|
38
|
-
const [selectedValue, setSelectedValue] = (0, import_react.useState)(
|
|
39
|
+
const [selectedValue, setSelectedValue] = (0, import_react.useState)();
|
|
39
40
|
(0, import_react.useEffect)(() => {
|
|
40
41
|
setSelectedValue(value);
|
|
41
|
-
console.log(selectedValue, lists, value, "SelectResource");
|
|
42
42
|
}, [value]);
|
|
43
43
|
const renderOptions = (0, import_react.useCallback)(() => {
|
|
44
44
|
return (lists || []).map((d) => {
|
|
45
45
|
return /* @__PURE__ */ import_react.default.createElement(import_antd.Select.Option, { value: d.id, key: d.id }, d["label"]);
|
|
46
46
|
});
|
|
47
47
|
}, [lists]);
|
|
48
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
48
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_Divider.default, null), /* @__PURE__ */ import_react.default.createElement(
|
|
49
49
|
import_antd.Select,
|
|
50
50
|
{
|
|
51
51
|
size: "large",
|
|
@@ -59,6 +59,6 @@ var SelectResource = ({ lists, value, onChange }) => {
|
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
61
|
renderOptions()
|
|
62
|
-
);
|
|
62
|
+
));
|
|
63
63
|
};
|
|
64
64
|
var SelectResource_default = SelectResource;
|
|
@@ -53,7 +53,8 @@ var Time = ({
|
|
|
53
53
|
resource_id,
|
|
54
54
|
relation_form_name,
|
|
55
55
|
like_status,
|
|
56
|
-
resources
|
|
56
|
+
resources,
|
|
57
|
+
is_hide_like
|
|
57
58
|
} = item;
|
|
58
59
|
const isShow = (0, import_react.useMemo)(() => {
|
|
59
60
|
return start_date && end_date || isShowHolder && holder_title || resource_id || relation_form_name;
|
|
@@ -63,7 +64,7 @@ var Time = ({
|
|
|
63
64
|
{
|
|
64
65
|
className: `${prefix}product-technician ${isShowChangeResource ? "pisell-lowcode-change-resource" : ""}`
|
|
65
66
|
},
|
|
66
|
-
resource_id ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-card-like-wrap` }, /* @__PURE__ */ import_react.default.createElement(
|
|
67
|
+
resource_id && !is_hide_like ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-card-like-wrap` }, /* @__PURE__ */ import_react.default.createElement(
|
|
67
68
|
import_Like.default,
|
|
68
69
|
{
|
|
69
70
|
style: { marginRight: 4 },
|
package/lib/index.d.ts
CHANGED
|
@@ -138,3 +138,4 @@ export { default as PisellList01 } from './components/pisellList01';
|
|
|
138
138
|
export { default as SectionFooters } from './components/section-footers';
|
|
139
139
|
export { default as ProductCard } from './components/productCard';
|
|
140
140
|
export { default as Collapse } from './components/collapse';
|
|
141
|
+
export { default as PisellGoodPassCard } from './components/pisellGoodPassCard';
|
package/lib/index.js
CHANGED
|
@@ -127,6 +127,7 @@ __export(src_exports, {
|
|
|
127
127
|
PisellEmpty: () => import_pisellEmpty.default,
|
|
128
128
|
PisellFloatingPanel: () => import_pisellFloatingPanel.default,
|
|
129
129
|
PisellFooter: () => import_footer.default,
|
|
130
|
+
PisellGoodPassCard: () => import_pisellGoodPassCard.default,
|
|
130
131
|
PisellHeader: () => import_header.default,
|
|
131
132
|
PisellHeaderProgressBar: () => import_pisellHeaderProgressBar.default,
|
|
132
133
|
PisellImageCarousels: () => import_pisellImageCarousels.default,
|
|
@@ -341,6 +342,7 @@ var import_pisellList01 = __toESM(require("./components/pisellList01"));
|
|
|
341
342
|
var import_section_footers = __toESM(require("./components/section-footers"));
|
|
342
343
|
var import_productCard = __toESM(require("./components/productCard"));
|
|
343
344
|
var import_collapse = __toESM(require("./components/collapse"));
|
|
345
|
+
var import_pisellGoodPassCard = __toESM(require("./components/pisellGoodPassCard"));
|
|
344
346
|
// Annotate the CommonJS export names for ESM import in node:
|
|
345
347
|
0 && (module.exports = {
|
|
346
348
|
Affix,
|
|
@@ -441,6 +443,7 @@ var import_collapse = __toESM(require("./components/collapse"));
|
|
|
441
443
|
PisellEmpty,
|
|
442
444
|
PisellFloatingPanel,
|
|
443
445
|
PisellFooter,
|
|
446
|
+
PisellGoodPassCard,
|
|
444
447
|
PisellHeader,
|
|
445
448
|
PisellHeaderProgressBar,
|
|
446
449
|
PisellImageCarousels,
|
package/lib/locales/en-US.d.ts
CHANGED
|
@@ -259,5 +259,7 @@ declare const _default: {
|
|
|
259
259
|
'pisell-login-and-register-register-button-text': string;
|
|
260
260
|
'pisell-login-and-register-remember-me': string;
|
|
261
261
|
'pisell-login-and-register-forgot-password': string;
|
|
262
|
+
'pisell2.text.goodpass.product-vouchers': string;
|
|
263
|
+
'pisell2.text.goodpass.view-more': string;
|
|
262
264
|
};
|
|
263
265
|
export default _default;
|