@pisell/materials 3.2.16 → 3.2.18

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.
@@ -19,7 +19,6 @@ export var renderBundles = function renderBundles(item, hidePrice, isShowPackage
19
19
  price = item.price,
20
20
  symbol = item.symbol,
21
21
  option = item.option;
22
- console.log('item', item);
23
22
  return /*#__PURE__*/React.createElement("div", {
24
23
  key: id,
25
24
  className: "".concat(prefix, "packages-product-bundle-item")
@@ -33,7 +33,7 @@ var Time = function Time(_ref) {
33
33
  className: "".concat(prefix, "product-date")
34
34
  }, getServiceTime(item, start_date)) : null, isShowHolder && holder_title ? /*#__PURE__*/React.createElement("div", {
35
35
  className: "".concat(prefix, "product-holder-wrap")
36
- }, holder_title) : null, resource_id || relation_form_name ? /*#__PURE__*/React.createElement("div", {
36
+ }, holder_title) : null, resource_id || relation_form_name || isShowChangeResource ? /*#__PURE__*/React.createElement("div", {
37
37
  className: "".concat(prefix, "product-technician ").concat(isShowChangeResource ? 'pisell-lowcode-change-resource' : '')
38
38
  }, resource_id ? /*#__PURE__*/React.createElement("div", {
39
39
  className: "".concat(prefix, "product-card-like-wrap")
@@ -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': '添加備註',
@@ -68,7 +68,7 @@ export var getServiceTime = function getServiceTime(item, currentDate) {
68
68
  dayjs.locale(localeTypes[locale]);
69
69
  var startDate = dayjs(item === null || item === void 0 ? void 0 : item.start_date);
70
70
  var endDate = dayjs(item === null || item === void 0 ? void 0 : item.end_date);
71
- var diffInDays = (item === null || item === void 0 ? void 0 : item.custom_day_count) || endDate.diff(startDate, 'day');
71
+ var diffInDays = (item === null || item === void 0 ? void 0 : item.custom_day_count) || endDate.diff(startDate, (item === null || item === void 0 ? void 0 : item.duration_type) || 'day');
72
72
  var _format = isEn ? 'ddd, DD/MM/YYYY' : 'YYYY-MM-DD,ddd';
73
73
 
74
74
  // 是否自定义格式
@@ -89,6 +89,11 @@ export var getServiceTime = function getServiceTime(item, currentDate) {
89
89
  if (item !== null && item !== void 0 && item.custom_day_count) {
90
90
  text = locales.getText('pisell2.product.card.day.event')(diffInDays);
91
91
  }
92
+ var textTypes = {
93
+ 'minutes': locales.getText('pisell2.product.card.minute')(diffInDays),
94
+ 'event': locales.getText('pisell2.product.card.day.event')(diffInDays)
95
+ };
96
+ text = (textTypes === null || textTypes === void 0 ? void 0 : textTypes[item === null || item === void 0 ? void 0 : item.duration_type]) || text;
92
97
  var duration = "".concat(diffInDays).concat(text);
93
98
  return "".concat(date, " (").concat(duration, ")");
94
99
  };
@@ -46,7 +46,6 @@ var renderBundles = (item, hidePrice, isShowPackageNote) => {
46
46
  const utils = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils;
47
47
  translation = (utils == null ? void 0 : utils.translationOriginal) || (utils == null ? void 0 : utils.translation);
48
48
  const { title, name, id, price, symbol, option } = item;
49
- console.log("item", item);
50
49
  return /* @__PURE__ */ import_react.default.createElement("div", { key: id, className: `${prefix}packages-product-bundle-item` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}packages-product-bundle-info` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}packages-product-bundle-info-title` }, translation(title || name)), !hidePrice ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}packages-product-bundle-info-num` }, (0, import_utils._formatAmount)(price, symbol)) : null), /* @__PURE__ */ import_react.default.createElement(import_options.default, { options: option, amountSymbol: symbol }), /* @__PURE__ */ import_react.default.createElement(import_AmountFooter.default, { item }), isShowPackageNote ? /* @__PURE__ */ import_react.default.createElement(import_Note.default, { item, type: "inside" }) : null);
51
50
  };
52
51
  // Annotate the CommonJS export names for ESM import in node:
@@ -58,7 +58,7 @@ var Time = ({
58
58
  const isShow = (0, import_react.useMemo)(() => {
59
59
  return start_date && end_date || isShowHolder && holder_title || resource_id || relation_form_name;
60
60
  }, [start_date, isShowHolder, holder_title, resource_id]);
61
- return isShow ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_Divider.default, null), /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-time-wrap` }, start_date && end_date ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-date` }, (0, import_utils.getServiceTime)(item, start_date)) : null, isShowHolder && holder_title ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-holder-wrap` }, holder_title) : null, resource_id || relation_form_name ? /* @__PURE__ */ import_react.default.createElement(
61
+ return isShow ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_Divider.default, null), /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-time-wrap` }, start_date && end_date ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-date` }, (0, import_utils.getServiceTime)(item, start_date)) : null, isShowHolder && holder_title ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-holder-wrap` }, holder_title) : null, resource_id || relation_form_name || isShowChangeResource ? /* @__PURE__ */ import_react.default.createElement(
62
62
  "div",
63
63
  {
64
64
  className: `${prefix}product-technician ${isShowChangeResource ? "pisell-lowcode-change-resource" : ""}`
@@ -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;
@@ -26,6 +26,7 @@ var locales_default = {
26
26
  "en": {
27
27
  "pisell2.product.card.day": (val) => `${val > 1 ? " days" : " day"}`,
28
28
  "pisell2.product.card.day.event": (val) => `${val > 1 ? " events" : " event"}`,
29
+ "pisell2.product.card.minute": (val) => `${val > 1 ? " minutes" : " minute"}`,
29
30
  "pisell2.product.card.discount.reason": "Discount reason",
30
31
  "pisell2.product.card.discount.note": "Note",
31
32
  "pisell2.product.card.discount.add.note": "Add note",
@@ -40,6 +41,7 @@ var locales_default = {
40
41
  "zh-CN": {
41
42
  "pisell2.product.card.day": (val) => "天",
42
43
  "pisell2.product.card.day.event": (val) => "个活动",
44
+ "pisell2.product.card.minute": (val) => "分钟",
43
45
  "pisell2.product.card.discount.reason": "折扣原因",
44
46
  "pisell2.product.card.discount.note": "备注",
45
47
  "pisell2.product.card.discount.add.note": "添加备注",
@@ -54,6 +56,7 @@ var locales_default = {
54
56
  "zh-HK": {
55
57
  "pisell2.product.card.day": (val) => "天",
56
58
  "pisell2.product.card.day.event": (val) => "个活動",
59
+ "pisell2.product.card.minute": (val) => "分鐘",
57
60
  "pisell2.product.card.discount.reason": "折扣原因",
58
61
  "pisell2.product.card.discount.note": "備註",
59
62
  "pisell2.product.card.discount.add.note": "添加備註",
@@ -74,7 +74,7 @@ var getServiceTime = (item, currentDate) => {
74
74
  import_dayjs.default.locale(localeTypes[locale]);
75
75
  let startDate = (0, import_dayjs.default)(item == null ? void 0 : item.start_date);
76
76
  let endDate = (0, import_dayjs.default)(item == null ? void 0 : item.end_date);
77
- const diffInDays = (item == null ? void 0 : item.custom_day_count) || endDate.diff(startDate, "day");
77
+ const diffInDays = (item == null ? void 0 : item.custom_day_count) || endDate.diff(startDate, (item == null ? void 0 : item.duration_type) || "day");
78
78
  let _format = isEn2 ? "ddd, DD/MM/YYYY" : "YYYY-MM-DD,ddd";
79
79
  if ((item == null ? void 0 : item.hasOwnProperty("format")) && ((_b = item == null ? void 0 : item.format) == null ? void 0 : _b.length) > 0) {
80
80
  _format = isEn2 ? (_c = item == null ? void 0 : item.format) == null ? void 0 : _c[0] : (_d = item == null ? void 0 : item.format) == null ? void 0 : _d[1];
@@ -88,7 +88,12 @@ var getServiceTime = (item, currentDate) => {
88
88
  if (item == null ? void 0 : item.custom_day_count) {
89
89
  text = import_utils.locales.getText("pisell2.product.card.day.event")(diffInDays);
90
90
  }
91
- const duration = `${diffInDays}${text}`;
91
+ const textTypes = {
92
+ "minutes": import_utils.locales.getText("pisell2.product.card.minute")(diffInDays),
93
+ "event": import_utils.locales.getText("pisell2.product.card.day.event")(diffInDays)
94
+ };
95
+ text = (textTypes == null ? void 0 : textTypes[item == null ? void 0 : item.duration_type]) || text;
96
+ let duration = `${diffInDays}${text}`;
92
97
  return `${date} (${duration})`;
93
98
  };
94
99
  // Annotate the CommonJS export names for ESM import in node:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "3.2.16",
3
+ "version": "3.2.18",
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": "3.0.2",
75
- "@pisell/utils": "1.0.42",
76
- "@pisell/icon": "0.0.11"
75
+ "@pisell/icon": "0.0.11",
76
+ "@pisell/utils": "1.0.42"
77
77
  },
78
78
  "peerDependencies": {
79
79
  "react": "^18.0.0",