@pisell/materials 2.2.54 → 2.2.55
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 +5 -5
- package/build/lowcode/preview.js +164 -148
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +39 -25
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +39 -25
- package/es/components/Pagination/index.d.ts +1 -1
- package/es/components/appVersionControl/index.d.ts +0 -1
- package/es/components/colorPicker/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Input.Url/ReadPretty.less +2 -0
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +10 -10
- package/es/components/drag-sort-tree/index.d.ts +0 -1
- package/es/components/filter/components/items/index.d.ts +1 -0
- package/es/components/filter/components/items/text/Editor/index.d.ts +1 -0
- package/es/components/filter/components/items/text/Preview/index.d.ts +1 -0
- package/es/components/filter/components/items/text/index.d.ts +1 -0
- package/es/components/iconfont/index.js +1 -1
- package/es/components/login-and-register/index.js +23 -21
- package/es/components/login-and-register/index.less +7 -7
- package/es/components/page/index.js +23 -57
- package/es/components/pisellCustomCheckboxGroup/index.js +3 -0
- 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/pisellNavigationMenu/PisellNavigationMenu.js +18 -2
- package/es/components/pisellWalletPassCard/index.d.ts +0 -1
- package/es/components/productCard/components/MultiDay/index.js +2 -1
- package/es/components/productCard/components/Packages/components/collapsibleList/utils.js +4 -3
- package/es/components/productCard/components/Time/components/SelectResource/index.d.ts +3 -0
- package/es/components/productCard/components/Time/components/SelectResource/index.js +53 -0
- package/es/components/productCard/components/Time/index.d.ts +1 -1
- package/es/components/productCard/components/Time/index.js +21 -7
- package/es/components/productCard/components/Time/index.less +29 -0
- package/es/components/productCard/index.js +5 -2
- package/es/components/productCard/locales.d.ts +3 -0
- package/es/components/productCard/locales.js +9 -0
- package/es/components/productCard/types.d.ts +4 -0
- package/es/components/productCard/utils.js +10 -0
- package/es/components/table/Actions/component/ExportImport/index.d.ts +0 -1
- package/es/components/table/Table/SelectField/index.d.ts +1 -0
- package/es/components/table/Table/tableConfig/summary/index.d.ts +1 -0
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/tabs/index.js +6 -1
- package/es/components/virtual-keyboard/Number/index.d.ts +1 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/locales/en-US.d.ts +28 -2
- package/es/locales/en-US.js +43 -10
- package/es/locales/zh-CN.d.ts +26 -0
- package/es/locales/zh-CN.js +29 -1
- package/es/locales/zh-TW.d.ts +26 -0
- package/es/locales/zh-TW.js +28 -1
- package/lib/components/Pagination/index.d.ts +1 -1
- package/lib/components/appVersionControl/index.d.ts +0 -1
- package/lib/components/colorPicker/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Input.Url/ReadPretty.less +2 -0
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +10 -10
- package/lib/components/drag-sort-tree/index.d.ts +0 -1
- package/lib/components/filter/components/items/index.d.ts +1 -0
- package/lib/components/filter/components/items/text/Editor/index.d.ts +1 -0
- package/lib/components/filter/components/items/text/Preview/index.d.ts +1 -0
- package/lib/components/filter/components/items/text/index.d.ts +1 -0
- package/lib/components/iconfont/index.js +1 -1
- package/lib/components/login-and-register/index.js +23 -21
- package/lib/components/login-and-register/index.less +7 -7
- package/lib/components/page/index.js +37 -65
- package/lib/components/pisellCustomCheckboxGroup/index.js +1 -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/pisellNavigationMenu/PisellNavigationMenu.js +24 -3
- package/lib/components/pisellWalletPassCard/index.d.ts +0 -1
- package/lib/components/productCard/components/MultiDay/index.js +3 -2
- package/lib/components/productCard/components/Packages/components/collapsibleList/utils.js +5 -4
- package/lib/components/productCard/components/Time/components/SelectResource/index.d.ts +3 -0
- package/lib/components/productCard/components/Time/components/SelectResource/index.js +63 -0
- package/lib/components/productCard/components/Time/index.d.ts +1 -1
- package/lib/components/productCard/components/Time/index.js +38 -14
- package/lib/components/productCard/components/Time/index.less +29 -0
- package/lib/components/productCard/index.js +4 -1
- package/lib/components/productCard/locales.d.ts +3 -0
- package/lib/components/productCard/locales.js +3 -0
- package/lib/components/productCard/types.d.ts +4 -0
- package/lib/components/productCard/utils.js +10 -2
- package/lib/components/table/Actions/component/ExportImport/index.d.ts +0 -1
- package/lib/components/table/Table/SelectField/index.d.ts +1 -0
- package/lib/components/table/Table/tableConfig/summary/index.d.ts +1 -0
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/tabs/index.js +1 -0
- package/lib/components/virtual-keyboard/Number/index.d.ts +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/locales/en-US.d.ts +28 -2
- package/lib/locales/en-US.js +29 -3
- package/lib/locales/zh-CN.d.ts +26 -0
- package/lib/locales/zh-CN.js +29 -1
- package/lib/locales/zh-TW.d.ts +26 -0
- package/lib/locales/zh-TW.js +28 -1
- package/lowcode/pisell-good-pass-card/meta.ts +38 -0
- package/lowcode/pisell-good-pass-card/snippets.ts +9 -0
- package/lowcode/product-card/meta.ts +28 -0
- package/package.json +1 -1
|
@@ -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 { PisellText, PisellCard, PisellModal } from "../../index";
|
|
16
|
+
import { getText } from "../../locales";
|
|
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, getText('pisell2.text.goodpass.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: getText('pisell2.text.goodpass.product-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, getText('pisell2.text.goodpass.product-vouchers')), /*#__PURE__*/React.createElement(Typography.Text, {
|
|
94
|
+
underline: true,
|
|
95
|
+
onClick: function onClick() {
|
|
96
|
+
return setShowModal(true);
|
|
97
|
+
}
|
|
98
|
+
}, 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
|
+
}
|
|
@@ -67,9 +67,22 @@ var PisellNavigationMenu = function PisellNavigationMenu(_ref) {
|
|
|
67
67
|
onAddPage === null || onAddPage === void 0 || onAddPage(item);
|
|
68
68
|
}
|
|
69
69
|
}, []);
|
|
70
|
+
var tagTextMap = useMemo(function () {
|
|
71
|
+
return {
|
|
72
|
+
base: {
|
|
73
|
+
text: getText('pisell-lowcode-navigation-menu-tag-base'),
|
|
74
|
+
color: '#7f56d9'
|
|
75
|
+
},
|
|
76
|
+
pisellV1: {
|
|
77
|
+
text: getText('pisell-lowcode-navigation-menu-tag-pisell1'),
|
|
78
|
+
color: '#ee837a'
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}, []);
|
|
70
82
|
|
|
71
83
|
// 自定义渲染菜单项
|
|
72
84
|
var renderMenuItem = useCallback(function (itemProps) {
|
|
85
|
+
var _tagTextMap$item$sour, _tagTextMap$item$sour2;
|
|
73
86
|
var item = itemProps.item;
|
|
74
87
|
var _item$allowEdit = item.allowEdit,
|
|
75
88
|
allowEdit = _item$allowEdit === void 0 ? true : _item$allowEdit,
|
|
@@ -96,10 +109,13 @@ var PisellNavigationMenu = function PisellNavigationMenu(_ref) {
|
|
|
96
109
|
className: "pisell-lowcode-navigation-menu-item-title"
|
|
97
110
|
}, item.title), /*#__PURE__*/React.createElement("div", {
|
|
98
111
|
className: "pisell-lowcode-navigation-menu-item-description"
|
|
99
|
-
}, item.description,
|
|
112
|
+
}, item.description, item.source && /*#__PURE__*/React.createElement(PisellTags, {
|
|
113
|
+
type: "pill_color",
|
|
114
|
+
color: (_tagTextMap$item$sour = tagTextMap[item.source]) === null || _tagTextMap$item$sour === void 0 ? void 0 : _tagTextMap$item$sour.color
|
|
115
|
+
}, ((_tagTextMap$item$sour2 = tagTextMap[item.source]) === null || _tagTextMap$item$sour2 === void 0 ? void 0 : _tagTextMap$item$sour2.text) || ""), !item.isGroup && item.version && /*#__PURE__*/React.createElement(PisellTags, {
|
|
100
116
|
type: "pill_color",
|
|
101
117
|
color: "success"
|
|
102
|
-
}, item.version)))), /*#__PURE__*/React.createElement("div", {
|
|
118
|
+
}, "v", item.version)))), /*#__PURE__*/React.createElement("div", {
|
|
103
119
|
className: "pisell-lowcode-navigation-menu-item-action-wrap"
|
|
104
120
|
}, allowEdit && /*#__PURE__*/React.createElement(Button, {
|
|
105
121
|
type: "text",
|
|
@@ -24,7 +24,8 @@ var MultiDay = function MultiDay(_ref) {
|
|
|
24
24
|
return '';
|
|
25
25
|
};
|
|
26
26
|
var context = useEngineContext();
|
|
27
|
-
|
|
27
|
+
var utils = context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils;
|
|
28
|
+
translationOriginal = (utils === null || utils === void 0 ? void 0 : utils.translationOriginal) || (utils === null || utils === void 0 ? void 0 : utils.translation);
|
|
28
29
|
|
|
29
30
|
/**
|
|
30
31
|
* @title: 商品单价 + 套餐价格
|
|
@@ -7,11 +7,12 @@ import Options from "../options";
|
|
|
7
7
|
var prefix = 'pisell-lowcode-';
|
|
8
8
|
export var renderBundles = function renderBundles(item, hidePrice, isShowPackageNote) {
|
|
9
9
|
var _context$appHelper;
|
|
10
|
-
var
|
|
10
|
+
var translation = function translation(text) {
|
|
11
11
|
return '';
|
|
12
12
|
};
|
|
13
13
|
var context = useEngineContext();
|
|
14
|
-
|
|
14
|
+
var utils = context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils;
|
|
15
|
+
translation = (utils === null || utils === void 0 ? void 0 : utils.translationOriginal) || (utils === null || utils === void 0 ? void 0 : utils.translation);
|
|
15
16
|
var title = item.title,
|
|
16
17
|
name = item.name,
|
|
17
18
|
id = item.id,
|
|
@@ -25,7 +26,7 @@ export var renderBundles = function renderBundles(item, hidePrice, isShowPackage
|
|
|
25
26
|
className: "".concat(prefix, "packages-product-bundle-info")
|
|
26
27
|
}, /*#__PURE__*/React.createElement("div", {
|
|
27
28
|
className: "".concat(prefix, "packages-product-bundle-info-title")
|
|
28
|
-
},
|
|
29
|
+
}, translation(title || name)), !hidePrice ? /*#__PURE__*/React.createElement("div", {
|
|
29
30
|
className: "".concat(prefix, "packages-product-bundle-info-num")
|
|
30
31
|
}, _formatAmount(price, symbol)) : null), /*#__PURE__*/React.createElement(Options, {
|
|
31
32
|
options: option,
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(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; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
8
|
+
import { Select } from 'antd';
|
|
9
|
+
var SelectResource = function SelectResource(_ref) {
|
|
10
|
+
var lists = _ref.lists,
|
|
11
|
+
value = _ref.value,
|
|
12
|
+
_onChange = _ref.onChange;
|
|
13
|
+
var _useState = useState(),
|
|
14
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
15
|
+
selectedValue = _useState2[0],
|
|
16
|
+
setSelectedValue = _useState2[1];
|
|
17
|
+
useEffect(function () {
|
|
18
|
+
setSelectedValue(value);
|
|
19
|
+
}, [value]);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @title: 渲染下拉框
|
|
23
|
+
* @description:
|
|
24
|
+
* @param {*} useCallback
|
|
25
|
+
* @return {*}
|
|
26
|
+
* @Author: WangHan
|
|
27
|
+
* @Date: 2025-04-11 14:57
|
|
28
|
+
*/
|
|
29
|
+
var renderOptions = useCallback(function () {
|
|
30
|
+
return (lists || []).map(function (d) {
|
|
31
|
+
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
32
|
+
value: d.id,
|
|
33
|
+
key: d.id
|
|
34
|
+
}, d['label']);
|
|
35
|
+
});
|
|
36
|
+
}, [lists]);
|
|
37
|
+
return /*#__PURE__*/React.createElement(Select, {
|
|
38
|
+
size: "large",
|
|
39
|
+
showSearch: true,
|
|
40
|
+
style: {
|
|
41
|
+
flex: 1
|
|
42
|
+
},
|
|
43
|
+
value: selectedValue,
|
|
44
|
+
onChange: function onChange(val) {
|
|
45
|
+
setSelectedValue(val);
|
|
46
|
+
var item = lists.find(function (d) {
|
|
47
|
+
return d.id === val;
|
|
48
|
+
});
|
|
49
|
+
_onChange(item);
|
|
50
|
+
}
|
|
51
|
+
}, renderOptions());
|
|
52
|
+
};
|
|
53
|
+
export default SelectResource;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './index.less';
|
|
3
|
-
declare const Time: ({ item, isShowHolder, onLike }: any) => JSX.Element | null;
|
|
3
|
+
declare const Time: ({ item, isShowHolder, onLike, isShowChangeResource, changeResource, }: any) => JSX.Element | null;
|
|
4
4
|
export default Time;
|
|
@@ -8,30 +8,40 @@ import React, { useMemo } from 'react';
|
|
|
8
8
|
import { getServiceTime } from "../../utils";
|
|
9
9
|
import Divider from "../Divider";
|
|
10
10
|
import Like from "./components/Like";
|
|
11
|
+
import SelectResource from "./components/SelectResource";
|
|
11
12
|
import "./index.less";
|
|
12
13
|
var prefix = 'pisell-lowcode-';
|
|
13
14
|
var Time = function Time(_ref) {
|
|
14
15
|
var item = _ref.item,
|
|
15
16
|
isShowHolder = _ref.isShowHolder,
|
|
16
|
-
_onLike = _ref.onLike
|
|
17
|
+
_onLike = _ref.onLike,
|
|
18
|
+
isShowChangeResource = _ref.isShowChangeResource,
|
|
19
|
+
changeResource = _ref.changeResource;
|
|
17
20
|
var start_date = item.start_date,
|
|
18
21
|
end_date = item.end_date,
|
|
19
22
|
holder_title = item.holder_title,
|
|
20
23
|
resource_id = item.resource_id,
|
|
21
24
|
relation_form_name = item.relation_form_name,
|
|
22
|
-
like_status = item.like_status
|
|
25
|
+
like_status = item.like_status,
|
|
26
|
+
resources = item.resources,
|
|
27
|
+
is_hide_like = item.is_hide_like;
|
|
23
28
|
var isShow = useMemo(function () {
|
|
24
|
-
return start_date && end_date || isShowHolder && holder_title || resource_id || relation_form_name;
|
|
29
|
+
return start_date && end_date || isShowHolder && holder_title || resource_id || relation_form_name || isShowChangeResource;
|
|
25
30
|
}, [start_date, isShowHolder, holder_title, resource_id]);
|
|
31
|
+
console.log('isShowChangeResource33', resources, isShowChangeResource);
|
|
26
32
|
return isShow ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement("div", {
|
|
27
33
|
className: "".concat(prefix, "product-time-wrap")
|
|
28
34
|
}, start_date && end_date ? /*#__PURE__*/React.createElement("div", {
|
|
29
35
|
className: "".concat(prefix, "product-date")
|
|
30
36
|
}, getServiceTime(item, start_date)) : null, isShowHolder && holder_title ? /*#__PURE__*/React.createElement("div", {
|
|
31
37
|
className: "".concat(prefix, "product-holder-wrap")
|
|
32
|
-
}, holder_title) : null,
|
|
33
|
-
|
|
34
|
-
}, resource_id ? /*#__PURE__*/React.createElement(
|
|
38
|
+
}, holder_title) : null, isShowChangeResource && (start_date && end_date || isShowHolder && holder_title) ? /*#__PURE__*/React.createElement(Divider, {
|
|
39
|
+
type: "inside"
|
|
40
|
+
}) : null, resource_id || relation_form_name || isShowChangeResource ? /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
className: "".concat(prefix, "product-technician ").concat(isShowChangeResource ? 'pisell-lowcode-change-resource' : '')
|
|
42
|
+
}, resource_id && !is_hide_like ? /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
className: "".concat(prefix, "product-card-like-wrap")
|
|
44
|
+
}, /*#__PURE__*/React.createElement(Like, {
|
|
35
45
|
style: {
|
|
36
46
|
marginRight: 4
|
|
37
47
|
},
|
|
@@ -41,6 +51,10 @@ var Time = function Time(_ref) {
|
|
|
41
51
|
like_status: e
|
|
42
52
|
}));
|
|
43
53
|
}
|
|
44
|
-
}) : null,
|
|
54
|
+
})) : null, isShowChangeResource ? /*#__PURE__*/React.createElement(SelectResource, {
|
|
55
|
+
lists: resources,
|
|
56
|
+
value: resource_id,
|
|
57
|
+
onChange: changeResource
|
|
58
|
+
}) : relation_form_name) : null)) : null;
|
|
45
59
|
};
|
|
46
60
|
export default Time;
|
|
@@ -32,4 +32,33 @@
|
|
|
32
32
|
display: flex;
|
|
33
33
|
align-items: center;
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
&-product-card-like-wrap {
|
|
37
|
+
display: flex;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
align-items: center;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&-change-resource {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
gap: 10px;
|
|
46
|
+
flex: 1 0 0;
|
|
47
|
+
align-self: stretch;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&-change-resource &-product-card-like-wrap {
|
|
51
|
+
display: flex;
|
|
52
|
+
width: 44px;
|
|
53
|
+
height: 44px;
|
|
54
|
+
padding: 10px 14px;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
align-items: center;
|
|
57
|
+
border-radius: 8px;
|
|
58
|
+
border: 1px solid var(--Gray-300, #d0d5dd);
|
|
59
|
+
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
|
|
60
|
+
.like-icon {
|
|
61
|
+
margin-right: 0 !important;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
35
64
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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
|
-
var _excluded = ["dataSource", "isShowImage", "isShowHolder", "isShowNote", "isShowDelete", "isShowPackageNote", "onAction", "onDelete", "onNote", "onLike", "onCard"];
|
|
2
|
+
var _excluded = ["dataSource", "isShowImage", "isShowHolder", "isShowNote", "isShowDelete", "isShowPackageNote", "onAction", "onDelete", "onNote", "onLike", "onCard", "onChangeResource"];
|
|
3
3
|
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; }
|
|
4
4
|
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; }
|
|
5
5
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -48,6 +48,7 @@ var ProductCard = function ProductCard(props) {
|
|
|
48
48
|
onNote = props.onNote,
|
|
49
49
|
_onLike = props.onLike,
|
|
50
50
|
onCard = props.onCard,
|
|
51
|
+
onChangeResource = props.onChangeResource,
|
|
51
52
|
other = _objectWithoutProperties(props, _excluded);
|
|
52
53
|
var useOpenNoteRef = useRef();
|
|
53
54
|
var locale = (utils === null || utils === void 0 || (_utils$storage = utils.storage) === null || _utils$storage === void 0 ? void 0 : _utils$storage.get('umi_locale')) || localStorage.getItem('umi_locale');
|
|
@@ -113,9 +114,11 @@ var ProductCard = function ProductCard(props) {
|
|
|
113
114
|
})), /*#__PURE__*/React.createElement(Time, {
|
|
114
115
|
item: dataSource,
|
|
115
116
|
isShowHolder: isShowHolder,
|
|
117
|
+
isShowChangeResource: other === null || other === void 0 ? void 0 : other.isShowChangeResource,
|
|
116
118
|
onLike: function onLike(item) {
|
|
117
119
|
return _onLike === null || _onLike === void 0 ? void 0 : _onLike(item);
|
|
118
|
-
}
|
|
120
|
+
},
|
|
121
|
+
changeResource: onChangeResource
|
|
119
122
|
}), /*#__PURE__*/React.createElement(Packages, {
|
|
120
123
|
item: dataSource,
|
|
121
124
|
isShowPackageNote: isShowPackageNote
|
|
@@ -2,6 +2,7 @@ declare const _default: {
|
|
|
2
2
|
en: {
|
|
3
3
|
'pisell2.product.card.day': (val: number) => string;
|
|
4
4
|
'pisell2.product.card.day.event': (val: number) => string;
|
|
5
|
+
'pisell2.product.card.minute': (val: number) => string;
|
|
5
6
|
'pisell2.product.card.discount.reason': string;
|
|
6
7
|
'pisell2.product.card.discount.note': string;
|
|
7
8
|
'pisell2.product.card.discount.add.note': string;
|
|
@@ -16,6 +17,7 @@ declare const _default: {
|
|
|
16
17
|
'zh-CN': {
|
|
17
18
|
'pisell2.product.card.day': (val: number) => string;
|
|
18
19
|
'pisell2.product.card.day.event': (val: number) => string;
|
|
20
|
+
'pisell2.product.card.minute': (val: number) => string;
|
|
19
21
|
'pisell2.product.card.discount.reason': string;
|
|
20
22
|
'pisell2.product.card.discount.note': string;
|
|
21
23
|
'pisell2.product.card.discount.add.note': string;
|
|
@@ -30,6 +32,7 @@ declare const _default: {
|
|
|
30
32
|
'zh-HK': {
|
|
31
33
|
'pisell2.product.card.day': (val: number) => string;
|
|
32
34
|
'pisell2.product.card.day.event': (val: number) => string;
|
|
35
|
+
'pisell2.product.card.minute': (val: number) => string;
|
|
33
36
|
'pisell2.product.card.discount.reason': string;
|
|
34
37
|
'pisell2.product.card.discount.note': string;
|
|
35
38
|
'pisell2.product.card.discount.add.note': string;
|
|
@@ -6,6 +6,9 @@ export default {
|
|
|
6
6
|
'pisell2.product.card.day.event': function pisell2ProductCardDayEvent(val) {
|
|
7
7
|
return "".concat(val > 1 ? ' events' : ' event');
|
|
8
8
|
},
|
|
9
|
+
'pisell2.product.card.minute': function pisell2ProductCardMinute(val) {
|
|
10
|
+
return "".concat(val > 1 ? ' minutes' : ' minute');
|
|
11
|
+
},
|
|
9
12
|
'pisell2.product.card.discount.reason': 'Discount reason',
|
|
10
13
|
'pisell2.product.card.discount.note': 'Note',
|
|
11
14
|
'pisell2.product.card.discount.add.note': 'Add note',
|
|
@@ -24,6 +27,9 @@ export default {
|
|
|
24
27
|
'pisell2.product.card.day.event': function pisell2ProductCardDayEvent(val) {
|
|
25
28
|
return '个活动';
|
|
26
29
|
},
|
|
30
|
+
'pisell2.product.card.minute': function pisell2ProductCardMinute(val) {
|
|
31
|
+
return '分钟';
|
|
32
|
+
},
|
|
27
33
|
'pisell2.product.card.discount.reason': '折扣原因',
|
|
28
34
|
'pisell2.product.card.discount.note': '备注',
|
|
29
35
|
'pisell2.product.card.discount.add.note': '添加备注',
|
|
@@ -42,6 +48,9 @@ export default {
|
|
|
42
48
|
'pisell2.product.card.day.event': function pisell2ProductCardDayEvent(val) {
|
|
43
49
|
return '个活動';
|
|
44
50
|
},
|
|
51
|
+
'pisell2.product.card.minute': function pisell2ProductCardMinute(val) {
|
|
52
|
+
return '分鐘';
|
|
53
|
+
},
|
|
45
54
|
'pisell2.product.card.discount.reason': '折扣原因',
|
|
46
55
|
'pisell2.product.card.discount.note': '備註',
|
|
47
56
|
'pisell2.product.card.discount.add.note': '添加備註',
|
|
@@ -70,9 +70,13 @@ export declare type ProductCardTypes = {
|
|
|
70
70
|
disabledEdit?: boolean;
|
|
71
71
|
locale?: string;
|
|
72
72
|
symbol?: string;
|
|
73
|
+
isShowChangeHolder?: boolean;
|
|
74
|
+
isShowChangeResource?: boolean;
|
|
75
|
+
isShowChangeDate?: boolean;
|
|
73
76
|
onAction?: (val: any) => void;
|
|
74
77
|
onDelete?: (val: any) => void;
|
|
75
78
|
onNote?: (val: any) => void;
|
|
76
79
|
onLike?: (val: any) => void;
|
|
77
80
|
onCard?: (val: any) => void;
|
|
81
|
+
onChangeResource?: (val: any) => void;
|
|
78
82
|
};
|
|
@@ -82,6 +82,11 @@ export var getServiceTime = function getServiceTime(item, currentDate) {
|
|
|
82
82
|
startDate = dayjs("".concat(item === null || item === void 0 ? void 0 : item.start_date, " ").concat(item === null || item === void 0 ? void 0 : item.start_time));
|
|
83
83
|
endDate = dayjs("".concat(item === null || item === void 0 ? void 0 : item.end_date, " ").concat(item === null || item === void 0 ? void 0 : item.end_time));
|
|
84
84
|
}
|
|
85
|
+
|
|
86
|
+
// 显示时长分钟
|
|
87
|
+
if ((item === null || item === void 0 ? void 0 : item.duration_type) === 'minutes') {
|
|
88
|
+
diffInDays = endDate.diff(startDate, 'minute');
|
|
89
|
+
}
|
|
85
90
|
var date = "".concat(startDate.format(_format), " ~ ").concat(endDate.format(_format));
|
|
86
91
|
|
|
87
92
|
// 自定义文案
|
|
@@ -89,6 +94,11 @@ export var getServiceTime = function getServiceTime(item, currentDate) {
|
|
|
89
94
|
if (item !== null && item !== void 0 && item.custom_day_count) {
|
|
90
95
|
text = locales.getText('pisell2.product.card.day.event')(diffInDays);
|
|
91
96
|
}
|
|
97
|
+
var textTypes = {
|
|
98
|
+
'minutes': locales.getText('pisell2.product.card.minute')(diffInDays),
|
|
99
|
+
'event': locales.getText('pisell2.product.card.day.event')(diffInDays)
|
|
100
|
+
};
|
|
101
|
+
text = (textTypes === null || textTypes === void 0 ? void 0 : textTypes[item === null || item === void 0 ? void 0 : item.duration_type]) || text;
|
|
92
102
|
var duration = "".concat(diffInDays).concat(text);
|
|
93
103
|
return "".concat(date, " (").concat(duration, ")");
|
|
94
104
|
};
|
|
@@ -155,7 +155,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
|
|
|
155
155
|
sort?: SortType | undefined;
|
|
156
156
|
mode: "" | "localStorage" | "remote";
|
|
157
157
|
currentViewMode: ModeType;
|
|
158
|
-
}) => ("
|
|
158
|
+
}) => ("filter_setting" | "group_by" | "order_by" | "column_setting" | "view_mode" | "gallery_setting")[];
|
|
159
159
|
export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
|
|
160
160
|
export declare const stringify: (obj: Record<string, any>) => string;
|
|
161
161
|
export {};
|
|
@@ -78,7 +78,12 @@ var Tabs = /*#__PURE__*/function (_Component) {
|
|
|
78
78
|
onClick: function onClick(e) {
|
|
79
79
|
return props.onTabClick(item.key, e);
|
|
80
80
|
}
|
|
81
|
-
}, /*#__PURE__*/React.createElement(
|
|
81
|
+
}, /*#__PURE__*/React.createElement(Badge, {
|
|
82
|
+
count: item.badge,
|
|
83
|
+
offset: [0, 6]
|
|
84
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
85
|
+
className: "".concat(prefix, "tab-bar-icon-wrap")
|
|
86
|
+
}, item.icon)), /*#__PURE__*/React.createElement("span", {
|
|
82
87
|
className: "".concat(prefix, "tab-bar-label")
|
|
83
88
|
}, item.label));
|
|
84
89
|
}), props.extra);
|
package/es/index.d.ts
CHANGED
|
@@ -136,3 +136,4 @@ export { default as PisellList01 } from './components/pisellList01';
|
|
|
136
136
|
export { default as SectionFooters } from './components/section-footers';
|
|
137
137
|
export { default as ProductCard } from './components/productCard';
|
|
138
138
|
export { default as Collapse } from './components/collapse';
|
|
139
|
+
export { default as PisellGoodPassCard } from './components/pisellGoodPassCard';
|
package/es/index.js
CHANGED
|
@@ -135,4 +135,5 @@ export { default as PisellHeaderProgressBar } from "./components/pisellHeaderPro
|
|
|
135
135
|
export { default as PisellList01 } from "./components/pisellList01";
|
|
136
136
|
export { default as SectionFooters } from "./components/section-footers";
|
|
137
137
|
export { default as ProductCard } from "./components/productCard";
|
|
138
|
-
export { default as Collapse } from "./components/collapse";
|
|
138
|
+
export { default as Collapse } from "./components/collapse";
|
|
139
|
+
export { default as PisellGoodPassCard } from "./components/pisellGoodPassCard";
|