@pisell/materials 1.0.812 → 1.0.813

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.
@@ -42,6 +42,8 @@ export interface PisellGoodPassCardProps {
42
42
  }) => void;
43
43
  /**样式 */
44
44
  style: React.CSSProperties;
45
+ /**快捷展示排序 */
46
+ mixedSort?: (val: Discount[]) => Discount[];
45
47
  }
46
48
  declare const index: (props: PisellGoodPassCardProps) => JSX.Element;
47
49
  export default index;
@@ -26,7 +26,8 @@ var index = function index(props) {
26
26
  dataSource = _props$dataSource === void 0 ? [] : _props$dataSource,
27
27
  onChange = props.onChange,
28
28
  _props$style = props.style,
29
- style = _props$style === void 0 ? {} : _props$style;
29
+ style = _props$style === void 0 ? {} : _props$style,
30
+ mixedSort = props.mixedSort;
30
31
  var _useState = useState(false),
31
32
  _useState2 = _slicedToArray(_useState, 2),
32
33
  showModal = _useState2[0],
@@ -44,7 +45,9 @@ var index = function index(props) {
44
45
  });
45
46
  };
46
47
  var renderVoucherContent = function renderVoucherContent(item) {
47
- return /*#__PURE__*/React.createElement("span", null, getText('pisell2.text.goodpass.save'), " ", /*#__PURE__*/React.createElement(PisellText.Amount, {
48
+ return /*#__PURE__*/React.createElement("span", {
49
+ className: "voucher-item-content-save"
50
+ }, getText('pisell2.text.goodpass.save'), " ", /*#__PURE__*/React.createElement(PisellText.Amount, {
48
51
  value: item.savedAmount
49
52
  }));
50
53
  };
@@ -59,7 +62,7 @@ var index = function index(props) {
59
62
  onChange: function onChange(e) {
60
63
  return handleItemChange(item, e.target.checked);
61
64
  }
62
- });
65
+ }, renderVoucherContent(item));
63
66
  };
64
67
  var renderVoucherItem = function renderVoucherItem(item) {
65
68
  return /*#__PURE__*/React.createElement("div", {
@@ -69,7 +72,7 @@ var index = function index(props) {
69
72
  className: "item-title"
70
73
  }, translation(item.format_title)), /*#__PURE__*/React.createElement("div", {
71
74
  className: "item-content"
72
- }, renderVoucherContent(item), renderActionElement(item)));
75
+ }, renderActionElement(item)));
73
76
  };
74
77
  var renderModal = function renderModal() {
75
78
  return /*#__PURE__*/React.createElement(PisellModal, {
@@ -82,12 +85,16 @@ var index = function index(props) {
82
85
  className: "".concat(clsPrefix, "-all-items-modal")
83
86
  }, /*#__PURE__*/React.createElement("div", {
84
87
  style: {
85
- padding: '10px 0'
88
+ padding: '10px 0',
89
+ display: "flex",
90
+ flexDirection: "column",
91
+ gap: 12
86
92
  }
87
93
  }, dataSource.map(renderVoucherItem)));
88
94
  };
89
95
  var renderMixedMode = function renderMixedMode() {
90
- var list = dataSource.length > 3 ? dataSource.slice(0, 3) : dataSource;
96
+ var sortList = (mixedSort === null || mixedSort === void 0 ? void 0 : mixedSort(dataSource)) || dataSource;
97
+ var list = sortList.length > 3 ? sortList.slice(0, 3) : sortList;
91
98
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
92
99
  className: "".concat(clsPrefix, "-header")
93
100
  }, /*#__PURE__*/React.createElement("div", null, getText('pisell2.text.goodpass.product-vouchers')), /*#__PURE__*/React.createElement(Typography.Text, {
@@ -22,20 +22,28 @@
22
22
  .item-title {
23
23
  color: var(--Gray-500, #667085);
24
24
  // text-align: center;
25
- font-size: 14px;
25
+ font-size: 16px;
26
26
  font-style: normal;
27
27
  font-weight: 600;
28
28
  line-height: 20px;
29
29
  }
30
30
 
31
31
  .item-content {
32
- color: var(--, #8157d5);
33
- font-size: 14px;
32
+ font-size: 16px;
34
33
  font-style: normal;
35
34
  font-weight: 400;
36
35
  line-height: 20px;
37
36
  white-space: nowrap;
38
37
 
38
+ .voucher-item-content-save {
39
+ color: var(--, #8157d5);
40
+ }
41
+
42
+ .pisell-lowcode-checkbox-wrapper {
43
+ display: flex;
44
+ flex-direction: row-reverse;
45
+ }
46
+
39
47
  .add-btn {
40
48
  color: var(--, #8157d5);
41
49
  text-align: center;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Actions: ({ children, style }: any) => JSX.Element | null;
4
3
  export default Actions;
@@ -42,6 +42,8 @@ export interface PisellGoodPassCardProps {
42
42
  }) => void;
43
43
  /**样式 */
44
44
  style: React.CSSProperties;
45
+ /**快捷展示排序 */
46
+ mixedSort?: (val: Discount[]) => Discount[];
45
47
  }
46
48
  declare const index: (props: PisellGoodPassCardProps) => JSX.Element;
47
49
  export default index;
@@ -43,7 +43,7 @@ var index = (props) => {
43
43
  var _a;
44
44
  const context = (0, import_useEngineContext.default)();
45
45
  const { translation } = (_a = context.appHelper) == null ? void 0 : _a.utils;
46
- const { dataSource = [], onChange, style = {} } = props;
46
+ const { dataSource = [], onChange, style = {}, mixedSort } = props;
47
47
  const [showModal, setShowModal] = (0, import_react.useState)(false);
48
48
  console.log("pisell good card datasource", dataSource);
49
49
  const handleChange = (newValue) => {
@@ -58,7 +58,7 @@ var index = (props) => {
58
58
  });
59
59
  };
60
60
  const renderVoucherContent = (item) => {
61
- return /* @__PURE__ */ import_react.default.createElement("span", null, (0, import_locales.getText)("pisell2.text.goodpass.save"), " ", /* @__PURE__ */ import_react.default.createElement(import__.PisellText.Amount, { value: item.savedAmount }));
61
+ return /* @__PURE__ */ import_react.default.createElement("span", { className: `voucher-item-content-save` }, (0, import_locales.getText)("pisell2.text.goodpass.save"), " ", /* @__PURE__ */ import_react.default.createElement(import__.PisellText.Amount, { value: item.savedAmount }));
62
62
  };
63
63
  const renderActionElement = (item) => {
64
64
  const isChecked = item.isSelected;
@@ -69,11 +69,12 @@ var index = (props) => {
69
69
  style: { marginLeft: 8 },
70
70
  checked: isChecked,
71
71
  onChange: (e) => handleItemChange(item, e.target.checked)
72
- }
72
+ },
73
+ renderVoucherContent(item)
73
74
  );
74
75
  };
75
76
  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
+ 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" }, renderActionElement(item)));
77
78
  };
78
79
  const renderModal = () => {
79
80
  return /* @__PURE__ */ import_react.default.createElement(
@@ -85,11 +86,12 @@ var index = (props) => {
85
86
  onCancel: () => setShowModal(false),
86
87
  className: `${clsPrefix}-all-items-modal`
87
88
  },
88
- /* @__PURE__ */ import_react.default.createElement("div", { style: { padding: "10px 0" } }, dataSource.map(renderVoucherItem))
89
+ /* @__PURE__ */ import_react.default.createElement("div", { style: { padding: "10px 0", display: "flex", flexDirection: "column", gap: 12 } }, dataSource.map(renderVoucherItem))
89
90
  );
90
91
  };
91
92
  const renderMixedMode = () => {
92
- const list = dataSource.length > 3 ? dataSource.slice(0, 3) : dataSource;
93
+ const sortList = (mixedSort == null ? void 0 : mixedSort(dataSource)) || dataSource;
94
+ const list = sortList.length > 3 ? sortList.slice(0, 3) : sortList;
93
95
  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, (0, import_locales.getText)("pisell2.text.goodpass.product-vouchers")), /* @__PURE__ */ import_react.default.createElement(import_antd.Typography.Text, { underline: true, onClick: () => setShowModal(true) }, (0, import_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
96
  };
95
97
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, renderModal(), /* @__PURE__ */ import_react.default.createElement(
@@ -22,20 +22,28 @@
22
22
  .item-title {
23
23
  color: var(--Gray-500, #667085);
24
24
  // text-align: center;
25
- font-size: 14px;
25
+ font-size: 16px;
26
26
  font-style: normal;
27
27
  font-weight: 600;
28
28
  line-height: 20px;
29
29
  }
30
30
 
31
31
  .item-content {
32
- color: var(--, #8157d5);
33
- font-size: 14px;
32
+ font-size: 16px;
34
33
  font-style: normal;
35
34
  font-weight: 400;
36
35
  line-height: 20px;
37
36
  white-space: nowrap;
38
37
 
38
+ .voucher-item-content-save {
39
+ color: var(--, #8157d5);
40
+ }
41
+
42
+ .pisell-lowcode-checkbox-wrapper {
43
+ display: flex;
44
+ flex-direction: row-reverse;
45
+ }
46
+
39
47
  .add-btn {
40
48
  color: var(--, #8157d5);
41
49
  text-align: center;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Actions: ({ children, style }: any) => JSX.Element | null;
4
3
  export default Actions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.812",
3
+ "version": "1.0.813",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -72,8 +72,8 @@
72
72
  "react-barcode": "^1.5.3",
73
73
  "vod-js-sdk-v6": "^1.4.11",
74
74
  "@pisell/date-picker": "1.0.115",
75
- "@pisell/utils": "1.0.43",
76
- "@pisell/icon": "0.0.10"
75
+ "@pisell/icon": "0.0.10",
76
+ "@pisell/utils": "1.0.43"
77
77
  },
78
78
  "peerDependencies": {
79
79
  "react": "^18.0.0",