@pisell/materials 2.2.35 → 2.2.36
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 +2 -2
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +30 -30
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +23 -23
- package/es/components/cardPro/index.d.ts +4 -0
- package/es/components/cardPro/index.js +69 -0
- package/es/components/cardPro/index.less +55 -0
- package/es/components/collapse/index.d.ts +15 -0
- package/es/components/collapse/index.js +80 -0
- package/es/components/collapse/index.less +0 -0
- package/es/components/productCard/components/Action/index.d.ts +4 -0
- package/es/components/productCard/components/Action/index.js +21 -0
- package/es/components/productCard/components/Action/index.less +14 -0
- package/es/components/productCard/components/AmountFooter/index.d.ts +4 -0
- package/es/components/productCard/components/AmountFooter/index.js +38 -0
- package/es/components/productCard/components/AmountFooter/index.less +39 -0
- package/es/components/productCard/components/Divider/index.d.ts +4 -0
- package/es/components/productCard/components/Divider/index.js +11 -0
- package/es/components/productCard/components/Divider/index.less +13 -0
- package/es/components/productCard/components/Header/index.d.ts +4 -0
- package/es/components/productCard/components/Header/index.js +70 -0
- package/es/components/productCard/components/Header/index.less +63 -0
- package/es/components/productCard/components/Note/index.d.ts +4 -0
- package/es/components/productCard/components/Note/index.js +25 -0
- package/es/components/productCard/components/Note/index.less +20 -0
- package/es/components/productCard/components/Packages/components/collapsibleList/index.d.ts +10 -0
- package/es/components/productCard/components/Packages/components/collapsibleList/index.js +96 -0
- package/es/components/productCard/components/Packages/components/collapsibleList/index.less +53 -0
- package/es/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +2 -0
- package/es/components/productCard/components/Packages/components/collapsibleList/utils.js +33 -0
- package/es/components/productCard/components/Packages/components/options/index.d.ts +4 -0
- package/es/components/productCard/components/Packages/components/options/index.js +23 -0
- package/es/components/productCard/components/Packages/components/options/index.less +29 -0
- package/es/components/productCard/components/Packages/index.d.ts +4 -0
- package/es/components/productCard/components/Packages/index.js +32 -0
- package/es/components/productCard/components/Packages/index.less +17 -0
- package/es/components/productCard/components/Packages/utils.d.ts +20 -0
- package/es/components/productCard/components/Packages/utils.js +40 -0
- package/es/components/productCard/components/Sales/index.d.ts +4 -0
- package/es/components/productCard/components/Sales/index.js +39 -0
- package/es/components/productCard/components/Sales/index.less +18 -0
- package/es/components/productCard/components/Time/components/Like/index.d.ts +9 -0
- package/es/components/productCard/components/Time/components/Like/index.js +26 -0
- package/es/components/productCard/components/Time/components/Like/index.less +6 -0
- package/es/components/productCard/components/Time/components/Like/like-heart.png +0 -0
- package/es/components/productCard/components/Time/components/Like/like-hide-heart.png +0 -0
- package/es/components/productCard/components/Time/index.d.ts +4 -0
- package/es/components/productCard/components/Time/index.js +44 -0
- package/es/components/productCard/components/Time/index.less +35 -0
- package/es/components/productCard/hooks/useOpenNote.d.ts +3 -0
- package/es/components/productCard/hooks/useOpenNote.js +65 -0
- package/es/components/productCard/index.d.ts +5 -0
- package/es/components/productCard/index.js +131 -0
- package/es/components/productCard/index.less +53 -0
- package/es/components/productCard/locales.d.ts +42 -0
- package/es/components/productCard/locales.js +47 -0
- package/es/components/productCard/status.d.ts +9 -0
- package/es/components/productCard/status.js +15 -0
- package/es/components/productCard/types.d.ts +17 -0
- package/es/components/productCard/types.js +1 -0
- package/es/components/productCard/utils.d.ts +162 -0
- package/es/components/productCard/utils.js +700 -0
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/index.d.ts +4 -2
- package/es/index.js +7 -2
- package/lib/components/cardPro/index.d.ts +4 -0
- package/lib/components/cardPro/index.js +101 -0
- package/lib/components/cardPro/index.less +55 -0
- package/lib/components/collapse/index.d.ts +15 -0
- package/lib/components/collapse/index.js +83 -0
- package/lib/components/collapse/index.less +0 -0
- package/lib/components/productCard/components/Action/index.d.ts +4 -0
- package/lib/components/productCard/components/Action/index.js +55 -0
- package/lib/components/productCard/components/Action/index.less +14 -0
- package/lib/components/productCard/components/AmountFooter/index.d.ts +4 -0
- package/lib/components/productCard/components/AmountFooter/index.js +61 -0
- package/lib/components/productCard/components/AmountFooter/index.less +39 -0
- package/lib/components/productCard/components/Divider/index.d.ts +4 -0
- package/lib/components/productCard/components/Divider/index.js +50 -0
- package/lib/components/productCard/components/Divider/index.less +13 -0
- package/lib/components/productCard/components/Header/index.d.ts +4 -0
- package/lib/components/productCard/components/Header/index.js +82 -0
- package/lib/components/productCard/components/Header/index.less +63 -0
- package/lib/components/productCard/components/Note/index.d.ts +4 -0
- package/lib/components/productCard/components/Note/index.js +56 -0
- package/lib/components/productCard/components/Note/index.less +20 -0
- package/lib/components/productCard/components/Packages/components/collapsibleList/index.d.ts +10 -0
- package/lib/components/productCard/components/Packages/components/collapsibleList/index.js +93 -0
- package/lib/components/productCard/components/Packages/components/collapsibleList/index.less +53 -0
- package/lib/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +2 -0
- package/lib/components/productCard/components/Packages/components/collapsibleList/utils.js +52 -0
- package/lib/components/productCard/components/Packages/components/options/index.d.ts +4 -0
- package/lib/components/productCard/components/Packages/components/options/index.js +73 -0
- package/lib/components/productCard/components/Packages/components/options/index.less +29 -0
- package/lib/components/productCard/components/Packages/index.d.ts +4 -0
- package/lib/components/productCard/components/Packages/index.js +56 -0
- package/lib/components/productCard/components/Packages/index.less +17 -0
- package/lib/components/productCard/components/Packages/utils.d.ts +20 -0
- package/lib/components/productCard/components/Packages/utils.js +44 -0
- package/lib/components/productCard/components/Sales/index.d.ts +4 -0
- package/lib/components/productCard/components/Sales/index.js +61 -0
- package/lib/components/productCard/components/Sales/index.less +18 -0
- package/lib/components/productCard/components/Time/components/Like/index.d.ts +9 -0
- package/lib/components/productCard/components/Time/components/Like/index.js +64 -0
- package/lib/components/productCard/components/Time/components/Like/index.less +6 -0
- package/lib/components/productCard/components/Time/components/Like/like-heart.png +0 -0
- package/lib/components/productCard/components/Time/components/Like/like-hide-heart.png +0 -0
- package/lib/components/productCard/components/Time/index.d.ts +4 -0
- package/lib/components/productCard/components/Time/index.js +64 -0
- package/lib/components/productCard/components/Time/index.less +35 -0
- package/lib/components/productCard/hooks/useOpenNote.d.ts +3 -0
- package/lib/components/productCard/hooks/useOpenNote.js +83 -0
- package/lib/components/productCard/index.d.ts +5 -0
- package/lib/components/productCard/index.js +160 -0
- package/lib/components/productCard/index.less +53 -0
- package/lib/components/productCard/locales.d.ts +42 -0
- package/lib/components/productCard/locales.js +65 -0
- package/lib/components/productCard/status.d.ts +9 -0
- package/lib/components/productCard/status.js +36 -0
- package/lib/components/productCard/types.d.ts +17 -0
- package/lib/components/productCard/types.js +17 -0
- package/lib/components/productCard/utils.d.ts +162 -0
- package/lib/components/productCard/utils.js +613 -0
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.js +38 -32
- package/lowcode/card-pro/meta.ts +338 -0
- package/lowcode/card-pro/snippe.ts +39 -0
- package/lowcode/collapse/meta.ts +85 -1
- package/lowcode/date-picker.range-picker/meta.ts +20 -0
- package/lowcode/product-card/meta.ts +92 -0
- package/lowcode/product-card/snippets.ts +23 -0
- package/package.json +2 -2
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { withWrap } from "../../utils/hoc";
|
|
3
|
+
import { Card, Flex } from 'antd';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import "./index.less";
|
|
6
|
+
var CardPro = function CardPro(props) {
|
|
7
|
+
var headTitle = props.headTitle,
|
|
8
|
+
headSubTitle = props.headSubTitle,
|
|
9
|
+
_props$isShowFooter = props.isShowFooter,
|
|
10
|
+
isShowFooter = _props$isShowFooter === void 0 ? true : _props$isShowFooter,
|
|
11
|
+
contentHeight = props.contentHeight,
|
|
12
|
+
children = props.children,
|
|
13
|
+
_props$actionButtons = props.actionButtons,
|
|
14
|
+
actionButtons = _props$actionButtons === void 0 ? [] : _props$actionButtons,
|
|
15
|
+
_props$buttonPosition = props.buttonPosition,
|
|
16
|
+
buttonPosition = _props$buttonPosition === void 0 ? 'center' : _props$buttonPosition,
|
|
17
|
+
cover = props.cover,
|
|
18
|
+
extra = props.extra,
|
|
19
|
+
isShowHead = props.isShowHead,
|
|
20
|
+
className = props.className,
|
|
21
|
+
coverHeight = props.coverHeight,
|
|
22
|
+
badge = props.badge;
|
|
23
|
+
useEffect(function () {
|
|
24
|
+
document.body.id = 'body';
|
|
25
|
+
}, []);
|
|
26
|
+
return /*#__PURE__*/React.createElement(Card, {
|
|
27
|
+
title: null,
|
|
28
|
+
style: {
|
|
29
|
+
padding: 0
|
|
30
|
+
},
|
|
31
|
+
className: classNames('pisell-cardPro-wrap', className, cover && 'pisell-cardPro-wrap-with-cover')
|
|
32
|
+
}, !!cover && /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: classNames('pisell-cardPro-cover'),
|
|
34
|
+
style: {
|
|
35
|
+
height: coverHeight
|
|
36
|
+
}
|
|
37
|
+
}, cover, /*#__PURE__*/React.createElement("div", {
|
|
38
|
+
className: classNames('pisell-cardPro-badge')
|
|
39
|
+
}, badge)), isShowHead && /*#__PURE__*/React.createElement(Flex, {
|
|
40
|
+
className: classNames('pisell-cardPro-head'),
|
|
41
|
+
justify: "space-between"
|
|
42
|
+
}, /*#__PURE__*/React.createElement(Flex, {
|
|
43
|
+
style: {
|
|
44
|
+
flex: 1
|
|
45
|
+
},
|
|
46
|
+
vertical: true,
|
|
47
|
+
gap: "middle"
|
|
48
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
className: classNames('pisell-cardPro-head-title')
|
|
50
|
+
}, headTitle), /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
className: classNames('pisell-cardPro-head-subTitle')
|
|
52
|
+
}, headSubTitle)), /*#__PURE__*/React.createElement("div", {
|
|
53
|
+
className: classNames('pisell-cardPro-head-extra')
|
|
54
|
+
}, extra)), /*#__PURE__*/React.createElement(Flex, {
|
|
55
|
+
style: {
|
|
56
|
+
height: contentHeight
|
|
57
|
+
},
|
|
58
|
+
className: classNames('pisell-cardPro-content')
|
|
59
|
+
}, children), isShowFooter && /*#__PURE__*/React.createElement(Flex, {
|
|
60
|
+
gap: 20,
|
|
61
|
+
justify: buttonPosition,
|
|
62
|
+
style: {
|
|
63
|
+
marginTop: 20
|
|
64
|
+
}
|
|
65
|
+
}, actionButtons.map(function (item, index) {
|
|
66
|
+
return item.button;
|
|
67
|
+
})));
|
|
68
|
+
};
|
|
69
|
+
export default withWrap(CardPro);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
.pisell-cardPro-wrap {
|
|
2
|
+
border-radius: 12px;
|
|
3
|
+
|
|
4
|
+
&.pisell-cardPro-wrap-with-cover {
|
|
5
|
+
.pisell-lowcode-card-body {
|
|
6
|
+
padding-top: 0;
|
|
7
|
+
padding-left: 0;
|
|
8
|
+
padding-right: 0;
|
|
9
|
+
padding-bottom: 24px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.pisell-cardPro-head,
|
|
13
|
+
.pisell-cardPro-content {
|
|
14
|
+
padding: 0 24px;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.pisell-cardPro-cover {
|
|
19
|
+
position: relative;
|
|
20
|
+
|
|
21
|
+
.pisell-cardPro-badge {
|
|
22
|
+
position: absolute;
|
|
23
|
+
right: 0;
|
|
24
|
+
top: 0;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.pisell-cardPro-head {
|
|
29
|
+
padding: 0;
|
|
30
|
+
.pisell-cardPro-head-title {
|
|
31
|
+
font-size: 16px;
|
|
32
|
+
font-weight: 600;
|
|
33
|
+
color: #1a2029;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.pisell-cardPro-head-subtitle {
|
|
37
|
+
font-size: 12px;
|
|
38
|
+
color: #6e8098;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.pisell-cardPro-head-extra {
|
|
42
|
+
width: 150px;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.pisell-cardPro-content {
|
|
47
|
+
overflow-y: auto;
|
|
48
|
+
margin-top: 20px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.pisell-cardPro-content {
|
|
52
|
+
overflow-y: auto;
|
|
53
|
+
margin-top: 20px;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface CollapseProps {
|
|
4
|
+
panelBackground?: string;
|
|
5
|
+
panelMarginBottom?: string | 0;
|
|
6
|
+
panelBorderRadius?: string | 0;
|
|
7
|
+
items: any[];
|
|
8
|
+
showHeader?: boolean;
|
|
9
|
+
headerColor?: string | '#101828';
|
|
10
|
+
headerFontSize?: string | 14;
|
|
11
|
+
expandIcon?: any;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
declare const Collapse: React.FC<CollapseProps>;
|
|
15
|
+
export default Collapse;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["panelBackground", "panelMarginBottom", "panelBorderRadius", "items", "showHeader", "headerColor", "headerFontSize", "expandIcon"];
|
|
3
|
+
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); }
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
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; }
|
|
7
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
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
|
+
import React, { useMemo } from 'react';
|
|
12
|
+
import { Collapse as OriginalCollapse } from 'antd';
|
|
13
|
+
import "./index.less";
|
|
14
|
+
var Collapse = function Collapse(props) {
|
|
15
|
+
var panelBackground = props.panelBackground,
|
|
16
|
+
panelMarginBottom = props.panelMarginBottom,
|
|
17
|
+
panelBorderRadius = props.panelBorderRadius,
|
|
18
|
+
items = props.items,
|
|
19
|
+
showHeader = props.showHeader,
|
|
20
|
+
headerColor = props.headerColor,
|
|
21
|
+
headerFontSize = props.headerFontSize,
|
|
22
|
+
expandIcon = props.expandIcon,
|
|
23
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
24
|
+
|
|
25
|
+
// 自定义样式
|
|
26
|
+
// const CustomCollapse = styled(OriginalCollapse)`
|
|
27
|
+
// .pisell-lowcode-collapse-header {
|
|
28
|
+
// display: flex !important;
|
|
29
|
+
// align-items: center !important;
|
|
30
|
+
// }
|
|
31
|
+
|
|
32
|
+
// .pisell-lowcode-collapse-content {
|
|
33
|
+
// background-color: ${panelBackground ? 'transparent' : '#ffffff'};
|
|
34
|
+
// border-top: ${panelBackground ? '0' : '1px solid #D0D5DD'};
|
|
35
|
+
// }
|
|
36
|
+
// `;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @title: 自定义面板样式
|
|
40
|
+
* @description:
|
|
41
|
+
* @return {*}
|
|
42
|
+
* @Author: WangHan
|
|
43
|
+
* @Date: 2024-11-25 20:23
|
|
44
|
+
*/
|
|
45
|
+
var panelStyle = {
|
|
46
|
+
marginBottom: panelMarginBottom,
|
|
47
|
+
background: panelBackground,
|
|
48
|
+
borderRadius: panelBorderRadius
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @title: 面板内容
|
|
53
|
+
* @description:
|
|
54
|
+
* @param {*} CollapseProps
|
|
55
|
+
* @return {*}
|
|
56
|
+
* @Author: WangHan
|
|
57
|
+
* @Date: 2024-11-25 20:28
|
|
58
|
+
*/
|
|
59
|
+
var itemsMap = useMemo(function () {
|
|
60
|
+
return items === null || items === void 0 ? void 0 : items.map(function (item) {
|
|
61
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
62
|
+
label: showHeader ? /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
style: {
|
|
64
|
+
color: headerColor,
|
|
65
|
+
fontSize: headerFontSize
|
|
66
|
+
}
|
|
67
|
+
}, item === null || item === void 0 ? void 0 : item.label) : null,
|
|
68
|
+
style: panelStyle
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
}, [items, headerColor, showHeader, headerFontSize, panelStyle]);
|
|
72
|
+
return /*#__PURE__*/React.createElement(OriginalCollapse, _extends({}, rest, {
|
|
73
|
+
expandIcon: expandIcon ? function () {
|
|
74
|
+
return expandIcon;
|
|
75
|
+
} : undefined,
|
|
76
|
+
items: itemsMap
|
|
77
|
+
}));
|
|
78
|
+
};
|
|
79
|
+
Collapse.Panel = OriginalCollapse.Panel;
|
|
80
|
+
export default Collapse;
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { Button } from 'antd';
|
|
4
|
+
import "./index.less";
|
|
5
|
+
var prefix = 'pisell-lowcode-';
|
|
6
|
+
var Action = function Action(_ref) {
|
|
7
|
+
var item = _ref.item,
|
|
8
|
+
onAction = _ref.onAction;
|
|
9
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
10
|
+
className: classNames("".concat(prefix, "product-actions"))
|
|
11
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
12
|
+
className: classNames("".concat(prefix, "product-actions-item")),
|
|
13
|
+
size: "large",
|
|
14
|
+
onClick: function onClick(e) {
|
|
15
|
+
e.preventDefault();
|
|
16
|
+
e.stopPropagation();
|
|
17
|
+
onAction();
|
|
18
|
+
}
|
|
19
|
+
}, item._actionText));
|
|
20
|
+
};
|
|
21
|
+
export default Action;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { _formatAmount } from "../Packages/utils";
|
|
4
|
+
import Divider from "../Divider";
|
|
5
|
+
import "./index.less";
|
|
6
|
+
import { locales } from '@pisell/utils';
|
|
7
|
+
var prefix = 'pisell-lowcode-';
|
|
8
|
+
var Footer = function Footer(_ref) {
|
|
9
|
+
var _item$_extend, _item$_extend2;
|
|
10
|
+
var item = _ref.item,
|
|
11
|
+
hideDivider = _ref.hideDivider,
|
|
12
|
+
type = _ref.type;
|
|
13
|
+
/**
|
|
14
|
+
* @title: 折扣
|
|
15
|
+
* @description:
|
|
16
|
+
* @param {*} useMemo
|
|
17
|
+
* @return {*}
|
|
18
|
+
* @Author: WangHan
|
|
19
|
+
* @Date: 2024-11-22 13:50
|
|
20
|
+
*/
|
|
21
|
+
var isDiscount = useMemo(function () {
|
|
22
|
+
// item中没有该属性则不展示
|
|
23
|
+
if (!(item !== null && item !== void 0 && item.hasOwnProperty('origin_total'))) return false;
|
|
24
|
+
return Number(item === null || item === void 0 ? void 0 : item.total) != Number(item === null || item === void 0 ? void 0 : item.origin_total);
|
|
25
|
+
}, [item]);
|
|
26
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !hideDivider ? /*#__PURE__*/React.createElement(Divider, {
|
|
27
|
+
type: type !== 'total' ? 'inside' : ''
|
|
28
|
+
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
className: classNames("".concat(prefix, "packages-product-footer"), hideDivider && "".concat(prefix, "packages-product-hide-divider-footer"))
|
|
30
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, _formatAmount(item === null || item === void 0 ? void 0 : item.total, item === null || item === void 0 ? void 0 : item.symbol)), /*#__PURE__*/React.createElement("span", null, "\xD7".concat(item === null || item === void 0 ? void 0 : item.num)), /*#__PURE__*/React.createElement("span", {
|
|
31
|
+
className: "".concat(prefix, "packages-product-footer-total")
|
|
32
|
+
}, _formatAmount((item === null || item === void 0 ? void 0 : item.total) * (item === null || item === void 0 ? void 0 : item.num), item === null || item === void 0 ? void 0 : item.symbol))), isDiscount ? /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: "".concat(prefix, "packages-product-footer-discount")
|
|
34
|
+
}, /*#__PURE__*/React.createElement("span", null, _formatAmount(item === null || item === void 0 ? void 0 : item.origin_total, item === null || item === void 0 ? void 0 : item.symbol)), /*#__PURE__*/React.createElement("span", null, _formatAmount((item === null || item === void 0 ? void 0 : item.origin_total) * (item === null || item === void 0 ? void 0 : item.num), item === null || item === void 0 ? void 0 : item.symbol, 2))) : null), isDiscount && (_item$_extend = item._extend) !== null && _item$_extend !== void 0 && _item$_extend.discount_reason && type === 'total' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
className: "".concat(prefix, "product-item-discount-reason")
|
|
36
|
+
}, /*#__PURE__*/React.createElement("span", null, "".concat(locales.getText('pisell2.product.card.discount.reason'), ": ").concat((_item$_extend2 = item._extend) === null || _item$_extend2 === void 0 ? void 0 : _item$_extend2.discount_reason)))) : null);
|
|
37
|
+
};
|
|
38
|
+
export default Footer;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
@pisell-prefix: pisell-lowcode;
|
|
2
|
+
|
|
3
|
+
.@{pisell-prefix} {
|
|
4
|
+
&-packages-product-footer {
|
|
5
|
+
color: var(--Gray-500, #667085);
|
|
6
|
+
font-size: 14px;
|
|
7
|
+
font-style: normal;
|
|
8
|
+
font-weight: 600;
|
|
9
|
+
line-height: 20px;
|
|
10
|
+
> div {
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: space-between;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&-packages-product-footer-discount {
|
|
17
|
+
font-size: 12px;
|
|
18
|
+
font-weight: 400;
|
|
19
|
+
line-height: 18px;
|
|
20
|
+
text-decoration-line: line-through;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&-packages-product-footer-total {
|
|
24
|
+
color: var(--Gray-900, #101828);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&-packages-product-hide-divider-footer {
|
|
28
|
+
margin-top: 8px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&-product-item-discount-reason {
|
|
32
|
+
color: var(--gray-500, #667085);
|
|
33
|
+
font-size: 14px;
|
|
34
|
+
font-style: normal;
|
|
35
|
+
font-weight: 400;
|
|
36
|
+
line-height: 20px;
|
|
37
|
+
white-space: break-spaces;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import "./index.less";
|
|
4
|
+
var prefix = 'pisell-lowcode-';
|
|
5
|
+
var Divider = function Divider(_ref) {
|
|
6
|
+
var type = _ref.type;
|
|
7
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
8
|
+
className: classNames("".concat(prefix, "product-divider"), type === 'inside' && "".concat(prefix, "product-divider-inside"))
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
export default Divider;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Button } from 'antd';
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import Iconfont from "../../../iconfont";
|
|
5
|
+
import { image, formatAmount } from '@pisell/utils';
|
|
6
|
+
import Options from "../Packages/components/options";
|
|
7
|
+
import "./index.less";
|
|
8
|
+
var prefix = 'pisell-lowcode-';
|
|
9
|
+
var Header = function Header(props) {
|
|
10
|
+
var isShowDelete = props.isShowDelete,
|
|
11
|
+
item = props.item,
|
|
12
|
+
showImage = props.showImage,
|
|
13
|
+
onDelete = props.onDelete,
|
|
14
|
+
disabledEdit = props.disabledEdit;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @title: 是否显示价格
|
|
18
|
+
* @description:
|
|
19
|
+
* @param {*} useMemo
|
|
20
|
+
* @return {*}
|
|
21
|
+
* @Author: WangHan
|
|
22
|
+
* @Date: 2024-11-23 16:13
|
|
23
|
+
*/
|
|
24
|
+
var showPrice = useMemo(function () {
|
|
25
|
+
var _item$bundle, _item$options;
|
|
26
|
+
return (item === null || item === void 0 ? void 0 : (_item$bundle = item.bundle) === null || _item$bundle === void 0 ? void 0 : _item$bundle.length) > 0 || (item === null || item === void 0 ? void 0 : (_item$options = item.options) === null || _item$options === void 0 ? void 0 : _item$options.length) > 0;
|
|
27
|
+
}, [item === null || item === void 0 ? void 0 : item.bundle, item === null || item === void 0 ? void 0 : item.options]);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @title: 样式是否居中
|
|
31
|
+
* @description:
|
|
32
|
+
* @param {*} useMemo
|
|
33
|
+
* @return {*}
|
|
34
|
+
* @Author: WangHan
|
|
35
|
+
* @Date: 2024-11-23 17:37
|
|
36
|
+
*/
|
|
37
|
+
var headerCenterStyle = useMemo(function () {
|
|
38
|
+
var _item$options2;
|
|
39
|
+
return (item === null || item === void 0 ? void 0 : (_item$options2 = item.options) === null || _item$options2 === void 0 ? void 0 : _item$options2.length) > 0 || (item === null || item === void 0 ? void 0 : item.product_option_string);
|
|
40
|
+
}, [item === null || item === void 0 ? void 0 : item.options, item === null || item === void 0 ? void 0 : item.product_option_string]);
|
|
41
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: classNames("".concat(prefix, "product-header"), headerCenterStyle && "".concat(prefix, "product-options-header"))
|
|
43
|
+
}, isShowDelete && !disabledEdit ? /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: "".concat(prefix, "product-delete"),
|
|
45
|
+
onClick: function onClick(e) {
|
|
46
|
+
e.stopPropagation();
|
|
47
|
+
onDelete();
|
|
48
|
+
}
|
|
49
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
50
|
+
type: "text",
|
|
51
|
+
icon: /*#__PURE__*/React.createElement(Iconfont, {
|
|
52
|
+
type: "pisell2-trash-01"
|
|
53
|
+
})
|
|
54
|
+
})) : null, showImage ? /*#__PURE__*/React.createElement("img", {
|
|
55
|
+
src: image.ali(item.cover, 64),
|
|
56
|
+
className: "".concat(prefix, "product-header-cover")
|
|
57
|
+
}) : null, item !== null && item !== void 0 && item.id ? /*#__PURE__*/React.createElement("div", {
|
|
58
|
+
className: "".concat(prefix, "product-right-wrap")
|
|
59
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
60
|
+
className: "".concat(prefix, "product-title")
|
|
61
|
+
}, /*#__PURE__*/React.createElement("span", null, item === null || item === void 0 ? void 0 : item.title), showPrice ? /*#__PURE__*/React.createElement("span", {
|
|
62
|
+
className: "".concat(prefix, "product-title-price")
|
|
63
|
+
}, formatAmount(item === null || item === void 0 ? void 0 : item.price, 2, item === null || item === void 0 ? void 0 : item.symbol)) : null), item !== null && item !== void 0 && item.product_option_string ? /*#__PURE__*/React.createElement("span", {
|
|
64
|
+
className: "".concat(prefix, "product-title-variant")
|
|
65
|
+
}, item === null || item === void 0 ? void 0 : item.product_option_string) : null, /*#__PURE__*/React.createElement(Options, {
|
|
66
|
+
options: item === null || item === void 0 ? void 0 : item.options,
|
|
67
|
+
amountSymbol: item === null || item === void 0 ? void 0 : item.symbol
|
|
68
|
+
})) : null);
|
|
69
|
+
};
|
|
70
|
+
export default Header;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
@pisell-prefix: pisell-lowcode;
|
|
2
|
+
|
|
3
|
+
.@{pisell-prefix} {
|
|
4
|
+
&-product-header {
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: 8px;
|
|
8
|
+
padding-right: 24px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&-product-options-header {
|
|
12
|
+
align-items: initial;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&-product-delete {
|
|
16
|
+
position: absolute;
|
|
17
|
+
padding: 0;
|
|
18
|
+
top: 0;
|
|
19
|
+
right: 0;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
.pisell-lowcode-btn {
|
|
22
|
+
padding: 0;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&-product-header-cover {
|
|
27
|
+
width: 64px;
|
|
28
|
+
height: 64px;
|
|
29
|
+
object-fit: cover;
|
|
30
|
+
border-radius: 8px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&-product-right-wrap {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
justify-content: space-between;
|
|
37
|
+
flex: 1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&-product-title {
|
|
41
|
+
color: var(--gray-900, #101828);
|
|
42
|
+
font-size: 16px;
|
|
43
|
+
font-style: normal;
|
|
44
|
+
font-weight: 600;
|
|
45
|
+
line-height: 24px;
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&-product-title-price {
|
|
51
|
+
font-size: 14px;
|
|
52
|
+
font-weight: 500;
|
|
53
|
+
line-height: 20px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&-product-title-variant {
|
|
57
|
+
color: var(--Gray-500, #667085);
|
|
58
|
+
font-size: 14px;
|
|
59
|
+
font-style: normal;
|
|
60
|
+
font-weight: 400;
|
|
61
|
+
line-height: 20px;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { locales } from '@pisell/utils';
|
|
4
|
+
import Divider from "../Divider";
|
|
5
|
+
import "./index.less";
|
|
6
|
+
var prefix = 'pisell-lowcode-';
|
|
7
|
+
var Note = function Note(props) {
|
|
8
|
+
var item = props.item,
|
|
9
|
+
type = props.type,
|
|
10
|
+
openNote = props.openNote,
|
|
11
|
+
disabledEdit = props.disabledEdit;
|
|
12
|
+
return item !== null && item !== void 0 && item.note || !disabledEdit ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, {
|
|
13
|
+
type: type
|
|
14
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
className: classNames("".concat(prefix, "product-note-wrap"))
|
|
16
|
+
}, item !== null && item !== void 0 && item.note ? /*#__PURE__*/React.createElement("div", null, locales.getText('pisell2.product.card.discount.note'), ": ", item.note) : null, !disabledEdit ? /*#__PURE__*/React.createElement("span", {
|
|
17
|
+
className: "".concat(prefix, "product-note-btn"),
|
|
18
|
+
onClick: function onClick(e) {
|
|
19
|
+
e.preventDefault();
|
|
20
|
+
e.stopPropagation();
|
|
21
|
+
openNote();
|
|
22
|
+
}
|
|
23
|
+
}, item !== null && item !== void 0 && item.note ? locales.getText('pisell2.product.card.discount.edit.note') : locales.getText('pisell2.product.card.discount.add.note')) : null)) : null;
|
|
24
|
+
};
|
|
25
|
+
export default Note;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@pisell-prefix: pisell-lowcode;
|
|
2
|
+
|
|
3
|
+
.@{pisell-prefix} {
|
|
4
|
+
&-product-note-wrap {
|
|
5
|
+
display: flex;
|
|
6
|
+
gap: 8px;
|
|
7
|
+
color: var(--Gray-900, #101828);
|
|
8
|
+
font-size: 14px;
|
|
9
|
+
font-style: normal;
|
|
10
|
+
font-weight: 400;
|
|
11
|
+
line-height: 20px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&-product-note-btn {
|
|
15
|
+
color: var(--Blue-600, #1570ef);
|
|
16
|
+
font-weight: 600;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
white-space: nowrap;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface CollapsibleListProps<T> {
|
|
4
|
+
list: T[];
|
|
5
|
+
renderItem: (item: T, index: number) => React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
}
|
|
9
|
+
declare const CollapsibleList: React.FC<CollapsibleListProps<any>>;
|
|
10
|
+
export default CollapsibleList;
|