@pisell/private-materials 3.0.13 → 3.0.15

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.
Files changed (204) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +8 -8
  11. package/es/components/booking/addons/index.d.ts +1 -1
  12. package/es/components/booking/addons/model.d.ts +2 -1
  13. package/es/components/booking/components/addButton/index.d.ts +8 -8
  14. package/es/components/booking/components/addButton/index.js +1 -1
  15. package/es/components/booking/components/drawer/index.d.ts +1 -1
  16. package/es/components/booking/components/footer/FooterMenus/index.js +1 -1
  17. package/es/components/booking/components/footer/index.js +25 -23
  18. package/es/components/booking/components/footer/utils.js +4 -3
  19. package/es/components/booking/forms/forms.d.ts +1 -1
  20. package/es/components/booking/forms/forms.js +2 -1
  21. package/es/components/booking/forms/index.d.ts +1 -1
  22. package/es/components/booking/forms/model.d.ts +2 -1
  23. package/es/components/booking/index.d.ts +1 -1
  24. package/es/components/booking/info/client/index.js +0 -1
  25. package/es/components/booking/info/date/index.less +1 -1
  26. package/es/components/booking/info/index.d.ts +1 -1
  27. package/es/components/booking/info/index.js +23 -9
  28. package/es/components/booking/info/model.d.ts +2 -1
  29. package/es/components/booking/info/notes/index.d.ts +3 -0
  30. package/es/components/booking/info/notes/index.js +83 -0
  31. package/es/components/booking/info/pet/index.js +5 -7
  32. package/es/components/booking/info/service/addService/index.js +74 -15
  33. package/es/components/booking/info/service/editService/index.js +8 -7
  34. package/es/components/booking/info/service/index.js +1 -1
  35. package/es/components/booking/info/service/index.less +3 -0
  36. package/es/components/booking/locales.d.ts +3 -0
  37. package/es/components/booking/locales.js +3 -0
  38. package/es/components/booking/model.d.ts +13 -1
  39. package/es/components/booking/notes/index.d.ts +1 -1
  40. package/es/components/booking/notes/model.d.ts +2 -1
  41. package/es/components/booking/payments/index.d.ts +1 -1
  42. package/es/components/booking/payments/model.d.ts +2 -1
  43. package/es/components/booking/utils.js +2 -1
  44. package/es/components/index.d.ts +2 -1
  45. package/es/components/index.js +2 -1
  46. package/es/components/productExtension/card/index.d.ts +10 -0
  47. package/es/components/productExtension/card/index.js +20 -0
  48. package/es/components/productExtension/card/index.less +34 -0
  49. package/es/components/productExtension/fields/Actor/Container/index.d.ts +12 -0
  50. package/es/components/productExtension/fields/Actor/Container/index.js +34 -0
  51. package/es/components/productExtension/fields/Actor/Container/index.less +19 -0
  52. package/es/components/productExtension/fields/Actor/CutOffTime/index.d.ts +10 -0
  53. package/es/components/productExtension/fields/Actor/CutOffTime/index.js +94 -0
  54. package/es/components/productExtension/fields/Actor/CutOffTime/index.less +32 -0
  55. package/es/components/productExtension/fields/Actor/CutOffTime/status.d.ts +0 -0
  56. package/es/components/productExtension/fields/Actor/CutOffTime/status.js +0 -0
  57. package/es/components/productExtension/fields/Actor/index.d.ts +5 -0
  58. package/es/components/productExtension/fields/Actor/index.js +23 -0
  59. package/es/components/productExtension/fields/Forms/index.d.ts +10 -0
  60. package/es/components/productExtension/fields/Forms/index.js +184 -0
  61. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +4 -0
  62. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.js +30 -0
  63. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.less +69 -0
  64. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +4 -0
  65. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +39 -0
  66. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.less +62 -0
  67. package/es/components/productExtension/fields/SelectProducts/index.d.ts +10 -0
  68. package/es/components/productExtension/fields/SelectProducts/index.js +99 -0
  69. package/es/components/productExtension/fields/SelectProducts/index.less +30 -0
  70. package/es/components/productExtension/fields/SelectProducts/mock.d.ts +0 -0
  71. package/es/components/productExtension/fields/SelectProducts/mock.js +0 -0
  72. package/es/components/productExtension/fields/SelectProducts/server.d.ts +1 -0
  73. package/es/components/productExtension/fields/SelectProducts/server.js +29 -0
  74. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +4 -0
  75. package/es/components/productExtension/fields/SelectResourcesTable/index.js +200 -0
  76. package/es/components/productExtension/fields/SelectResourcesTable/index.less +0 -0
  77. package/es/components/productExtension/fields/SelectResourcesTable/mock.d.ts +2681 -0
  78. package/es/components/productExtension/fields/SelectResourcesTable/mock.js +5072 -0
  79. package/es/components/productExtension/fields/SelectResourcesTable/server.d.ts +2 -0
  80. package/es/components/productExtension/fields/SelectResourcesTable/server.js +49 -0
  81. package/es/components/productExtension/fields/index.d.ts +1 -0
  82. package/es/components/productExtension/fields/index.js +33 -0
  83. package/es/components/productExtension/index.d.ts +7 -0
  84. package/es/components/productExtension/index.js +78 -0
  85. package/es/components/productExtension/index.less +0 -0
  86. package/es/components/productExtension/locales.d.ts +48 -0
  87. package/es/components/productExtension/locales.js +47 -0
  88. package/es/components/productExtension/server.d.ts +1 -0
  89. package/es/components/productExtension/server.js +29 -0
  90. package/es/components/schedules/index.d.ts +1 -1
  91. package/es/components/schedules/model.d.ts +2 -1
  92. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -1
  93. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.js +21 -5
  94. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +5 -2
  95. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +20 -5
  96. package/es/components/selectModal/index.d.ts +24 -0
  97. package/es/components/selectModal/index.js +108 -0
  98. package/es/components/selectModal/index.less +0 -0
  99. package/es/components/tabProduct/card/index.d.ts +2 -2
  100. package/es/components/tabProduct/card/index.js +3 -4
  101. package/es/components/tabProduct/index.d.ts +4 -2
  102. package/es/components/tabProduct/index.js +10 -9
  103. package/es/index.d.ts +1 -0
  104. package/es/index.js +2 -1
  105. package/es/utils/index.d.ts +22 -0
  106. package/es/utils/index.js +56 -0
  107. package/lib/components/booking/addons/index.d.ts +1 -1
  108. package/lib/components/booking/addons/model.d.ts +2 -1
  109. package/lib/components/booking/components/addButton/index.d.ts +8 -8
  110. package/lib/components/booking/components/addButton/index.js +1 -1
  111. package/lib/components/booking/components/drawer/index.d.ts +1 -1
  112. package/lib/components/booking/components/footer/FooterMenus/index.js +1 -1
  113. package/lib/components/booking/components/footer/index.js +5 -3
  114. package/lib/components/booking/components/footer/utils.js +4 -2
  115. package/lib/components/booking/forms/forms.d.ts +1 -1
  116. package/lib/components/booking/forms/forms.js +1 -1
  117. package/lib/components/booking/forms/index.d.ts +1 -1
  118. package/lib/components/booking/forms/model.d.ts +2 -1
  119. package/lib/components/booking/index.d.ts +1 -1
  120. package/lib/components/booking/info/client/index.js +0 -1
  121. package/lib/components/booking/info/date/index.less +1 -1
  122. package/lib/components/booking/info/index.d.ts +1 -1
  123. package/lib/components/booking/info/index.js +27 -9
  124. package/lib/components/booking/info/model.d.ts +2 -1
  125. package/lib/components/booking/info/notes/index.d.ts +3 -0
  126. package/lib/components/booking/info/notes/index.js +111 -0
  127. package/lib/components/booking/info/pet/index.js +5 -7
  128. package/lib/components/booking/info/service/addService/index.js +65 -10
  129. package/lib/components/booking/info/service/editService/index.js +7 -5
  130. package/lib/components/booking/info/service/index.js +1 -1
  131. package/lib/components/booking/info/service/index.less +3 -0
  132. package/lib/components/booking/locales.d.ts +3 -0
  133. package/lib/components/booking/locales.js +3 -0
  134. package/lib/components/booking/model.d.ts +13 -1
  135. package/lib/components/booking/notes/index.d.ts +1 -1
  136. package/lib/components/booking/notes/model.d.ts +2 -1
  137. package/lib/components/booking/payments/index.d.ts +1 -1
  138. package/lib/components/booking/payments/model.d.ts +2 -1
  139. package/lib/components/booking/utils.js +2 -1
  140. package/lib/components/index.d.ts +2 -1
  141. package/lib/components/index.js +3 -0
  142. package/lib/components/productExtension/card/index.d.ts +10 -0
  143. package/lib/components/productExtension/card/index.js +57 -0
  144. package/lib/components/productExtension/card/index.less +34 -0
  145. package/lib/components/productExtension/fields/Actor/Container/index.d.ts +12 -0
  146. package/lib/components/productExtension/fields/Actor/Container/index.js +64 -0
  147. package/lib/components/productExtension/fields/Actor/Container/index.less +19 -0
  148. package/lib/components/productExtension/fields/Actor/CutOffTime/index.d.ts +10 -0
  149. package/lib/components/productExtension/fields/Actor/CutOffTime/index.js +128 -0
  150. package/lib/components/productExtension/fields/Actor/CutOffTime/index.less +32 -0
  151. package/lib/components/productExtension/fields/Actor/CutOffTime/status.d.ts +0 -0
  152. package/lib/components/productExtension/fields/Actor/CutOffTime/status.js +0 -0
  153. package/lib/components/productExtension/fields/Actor/index.d.ts +5 -0
  154. package/lib/components/productExtension/fields/Actor/index.js +56 -0
  155. package/lib/components/productExtension/fields/Forms/index.d.ts +10 -0
  156. package/lib/components/productExtension/fields/Forms/index.js +108 -0
  157. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +4 -0
  158. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.js +65 -0
  159. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.less +69 -0
  160. package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +4 -0
  161. package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +79 -0
  162. package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.less +62 -0
  163. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +10 -0
  164. package/lib/components/productExtension/fields/SelectProducts/index.js +126 -0
  165. package/lib/components/productExtension/fields/SelectProducts/index.less +30 -0
  166. package/lib/components/productExtension/fields/SelectProducts/mock.d.ts +0 -0
  167. package/lib/components/productExtension/fields/SelectProducts/mock.js +0 -0
  168. package/lib/components/productExtension/fields/SelectProducts/server.d.ts +1 -0
  169. package/lib/components/productExtension/fields/SelectProducts/server.js +33 -0
  170. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +4 -0
  171. package/lib/components/productExtension/fields/SelectResourcesTable/index.js +178 -0
  172. package/lib/components/productExtension/fields/SelectResourcesTable/index.less +0 -0
  173. package/lib/components/productExtension/fields/SelectResourcesTable/mock.d.ts +2681 -0
  174. package/lib/components/productExtension/fields/SelectResourcesTable/mock.js +12723 -0
  175. package/lib/components/productExtension/fields/SelectResourcesTable/server.d.ts +2 -0
  176. package/lib/components/productExtension/fields/SelectResourcesTable/server.js +39 -0
  177. package/lib/components/productExtension/fields/index.d.ts +1 -0
  178. package/lib/components/productExtension/fields/index.js +69 -0
  179. package/lib/components/productExtension/index.d.ts +7 -0
  180. package/lib/components/productExtension/index.js +109 -0
  181. package/lib/components/productExtension/index.less +0 -0
  182. package/lib/components/productExtension/locales.d.ts +48 -0
  183. package/lib/components/productExtension/locales.js +71 -0
  184. package/lib/components/productExtension/server.d.ts +1 -0
  185. package/lib/components/productExtension/server.js +33 -0
  186. package/lib/components/schedules/index.d.ts +1 -1
  187. package/lib/components/schedules/model.d.ts +2 -1
  188. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -1
  189. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.js +11 -6
  190. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +5 -2
  191. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +18 -4
  192. package/lib/components/selectModal/index.d.ts +24 -0
  193. package/lib/components/selectModal/index.js +133 -0
  194. package/lib/components/selectModal/index.less +0 -0
  195. package/lib/components/tabProduct/card/index.d.ts +2 -2
  196. package/lib/components/tabProduct/card/index.js +1 -2
  197. package/lib/components/tabProduct/index.d.ts +4 -2
  198. package/lib/components/tabProduct/index.js +7 -8
  199. package/lib/index.d.ts +1 -0
  200. package/lib/index.js +3 -0
  201. package/lib/utils/index.d.ts +22 -0
  202. package/lib/utils/index.js +59 -0
  203. package/lowcode/product-extension/meta.ts +120 -0
  204. package/package.json +3 -3
@@ -0,0 +1,94 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
4
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
5
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
+ 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."); }
7
+ 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); }
8
+ 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; }
9
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
10
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ import React, { useEffect, useState } from "react";
12
+ import { Form, InputNumber, Select } from "antd";
13
+ import "./index.less";
14
+ import Container from "../Container";
15
+ import { locales } from "@pisell/utils";
16
+ var Option = Select.Option;
17
+ export var maxNumber = {
18
+ days: 365,
19
+ hours: 8760,
20
+ minutes: 525600
21
+ };
22
+ // 截单时间
23
+ var CutOffTime = function CutOffTime(_ref) {
24
+ var value = _ref.value,
25
+ onChange = _ref.onChange,
26
+ name = _ref.name;
27
+ var _useState = useState(365),
28
+ _useState2 = _slicedToArray(_useState, 2),
29
+ cutTimeMax = _useState2[0],
30
+ setCutTimeMax = _useState2[1];
31
+ var timeOptions = [{
32
+ label: locales.getText("pisell2.text.product-extension.days"),
33
+ value: "days"
34
+ }, {
35
+ label: locales.getText("pisell2.text.product-extension.hours"),
36
+ value: "hours"
37
+ }, {
38
+ label: locales.getText("pisell2.text.product-extension.minutes"),
39
+ value: "minutes"
40
+ }];
41
+ useEffect(function () {
42
+ if (value) {
43
+ setCutTimeMax(maxNumber[value === null || value === void 0 ? void 0 : value.unit_type]);
44
+ }
45
+ }, [value]);
46
+ return /*#__PURE__*/React.createElement("div", {
47
+ className: "pisell2_product-extension-cut-off-time-wrap"
48
+ }, /*#__PURE__*/React.createElement(Container, {
49
+ title: locales.getText("pisell2.text.product-extension.cut-off-time"),
50
+ desc: locales.getText("pisell2.text.product-extension.cut-off-time.desc"),
51
+ isMargin: true
52
+ }, /*#__PURE__*/React.createElement("div", {
53
+ className: "pisell2_product-extension-cut-off-time-input-wrap"
54
+ }, /*#__PURE__*/React.createElement(Form.Item, {
55
+ name: [].concat(_toConsumableArray(name), ["unit"]),
56
+ noStyle: true,
57
+ initialValue: 1
58
+ }, /*#__PURE__*/React.createElement(InputNumber, {
59
+ min: 1,
60
+ size: "large",
61
+ max: cutTimeMax,
62
+ className: "pisell2_product-extension-cut-off-time-input-small"
63
+ })), /*#__PURE__*/React.createElement(Form.Item, {
64
+ name: [].concat(_toConsumableArray(name), ["unit_type"]),
65
+ noStyle: true,
66
+ initialValue: "days"
67
+ }, /*#__PURE__*/React.createElement(Select, {
68
+ size: "large",
69
+ className: "pisell2_product-extension-cut-off-time-select-wrap",
70
+ onChange: function onChange(value) {
71
+ setCutTimeMax(maxNumber[value]);
72
+ }
73
+ }, timeOptions.map(function (i) {
74
+ return /*#__PURE__*/React.createElement(Option, {
75
+ key: i.value
76
+ }, i.label);
77
+ }))))), /*#__PURE__*/React.createElement(Container, {
78
+ title: locales.getText("pisell2.text.product-extension.future-day"),
79
+ desc: locales.getText("pisell2.text.product-extension.future-day.hint")
80
+ }, /*#__PURE__*/React.createElement("div", {
81
+ className: "pisell2_product-extension-cut-off-time-input-wrap"
82
+ }, /*#__PURE__*/React.createElement(Form.Item, {
83
+ name: [].concat(_toConsumableArray(name), ["future_day"]),
84
+ noStyle: true,
85
+ initialValue: 365
86
+ }, /*#__PURE__*/React.createElement(InputNumber, {
87
+ size: "large",
88
+ min: 0,
89
+ max: 365,
90
+ addonAfter: locales.getText("pisell2.text.product-extension.days"),
91
+ className: "pisell2_product-extension-cut-off-time-input-big"
92
+ })))));
93
+ };
94
+ export default CutOffTime;
@@ -0,0 +1,32 @@
1
+ .pisell2_product-extension-cut-off-time-wrap {
2
+ .pisell2_product-extension-cut-off-time-title {
3
+ font-size: 14px;
4
+ color: #222b45;
5
+ margin-bottom: 6px;
6
+ }
7
+
8
+ .pisell2_product-extension-cut-off-time-desc {
9
+ color: rgba(0, 0, 0, 0.45);
10
+ font-size: 14px;
11
+ transition: color 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
12
+ margin-top: 8px;
13
+ }
14
+
15
+ .pisell2_product-extension-cut-off-time-input-wrap {
16
+ display: flex;
17
+ justify-content: space-between;
18
+
19
+ .pisell2_product-extension-cut-off-time-select-wrap {
20
+ width: 20%;
21
+ border-radius: 4px;
22
+ }
23
+
24
+ .pisell2_product-extension-cut-off-time-input-small {
25
+ width: 78%;
26
+ }
27
+
28
+ .pisell2_product-extension-cut-off-time-input-big {
29
+ width: 100%;
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ declare const Actor: ({ name }: {
3
+ name: string;
4
+ }) => React.JSX.Element;
5
+ export default Actor;
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import { Form } from "antd";
3
+ import SelectProducts from "../SelectProducts";
4
+ import CutOffTime from "./CutOffTime";
5
+ var Actor = function Actor(_ref) {
6
+ var name = _ref.name;
7
+ return /*#__PURE__*/React.createElement("div", {
8
+ className: ""
9
+ }, /*#__PURE__*/React.createElement(Form.Item, {
10
+ name: [name, "products"]
11
+ }, /*#__PURE__*/React.createElement(SelectProducts, null)), /*#__PURE__*/React.createElement(Form.Item, {
12
+ hidden: true,
13
+ name: [name, "actor_type"],
14
+ initialValue: "product"
15
+ }), /*#__PURE__*/React.createElement(Form.Item, {
16
+ hidden: true,
17
+ name: [name, "product_type"],
18
+ initialValue: "products"
19
+ }), /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(CutOffTime, {
20
+ name: [name, "cut_off_time"]
21
+ })));
22
+ };
23
+ export default Actor;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ export interface InfoProps {
3
+ relation_id: any;
4
+ action: any;
5
+ value: any;
6
+ onChange: any;
7
+ apis: any;
8
+ }
9
+ declare const Forms: (props: InfoProps) => React.JSX.Element;
10
+ export default Forms;
@@ -0,0 +1,184 @@
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
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
7
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
8
+ 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; }
9
+ 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; }
10
+ 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; }
11
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
12
+ 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); }
13
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
14
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
15
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
16
+ 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."); }
17
+ 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); }
18
+ 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; }
19
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
20
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
+ import React, { useEffect, useState } from "react";
22
+ import FormsCom from "../../../booking/forms/forms";
23
+ var relation_type = "appointment_booking";
24
+ var Forms = function Forms(props) {
25
+ var relation_id = props.relation_id,
26
+ action = props.action,
27
+ value = props.value,
28
+ onChange = props.onChange,
29
+ apis = props.apis;
30
+ var _useState = useState([]),
31
+ _useState2 = _slicedToArray(_useState, 2),
32
+ formList = _useState2[0],
33
+ setFormList = _useState2[1];
34
+ var _useState3 = useState(true),
35
+ _useState4 = _slicedToArray(_useState3, 2),
36
+ loading = _useState4[0],
37
+ setLoading = _useState4[1];
38
+ useEffect(function () {
39
+ geForms();
40
+ }, []);
41
+ var getFormDataById = /*#__PURE__*/function () {
42
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(item) {
43
+ var _params, options, data;
44
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
45
+ while (1) switch (_context.prev = _context.next) {
46
+ case 0:
47
+ _params = {
48
+ form_id: item.form_id,
49
+ skip: 1,
50
+ num: 999
51
+ };
52
+ options = [];
53
+ _context.next = 4;
54
+ return apis.getPetsData(_params);
55
+ case 4:
56
+ data = _context.sent;
57
+ options = (data === null || data === void 0 ? void 0 : data.list) || [];
58
+ return _context.abrupt("return", _objectSpread(_objectSpread({}, item), {}, {
59
+ options: options
60
+ }));
61
+ case 7:
62
+ case "end":
63
+ return _context.stop();
64
+ }
65
+ }, _callee);
66
+ }));
67
+ return function getFormDataById(_x2) {
68
+ return _ref.apply(this, arguments);
69
+ };
70
+ }();
71
+ var getFormData = /*#__PURE__*/function () {
72
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(formList) {
73
+ var all;
74
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
75
+ while (1) switch (_context2.prev = _context2.next) {
76
+ case 0:
77
+ all = [];
78
+ all = formList.map(function (d) {
79
+ return getFormDataById(d);
80
+ });
81
+ return _context2.abrupt("return", Promise.all(all));
82
+ case 3:
83
+ case "end":
84
+ return _context2.stop();
85
+ }
86
+ }, _callee2);
87
+ }));
88
+ return function getFormData(_x3) {
89
+ return _ref2.apply(this, arguments);
90
+ };
91
+ }();
92
+ var getFormValues = function getFormValues(data) {
93
+ var _values = {};
94
+ var _iterator = _createForOfIteratorHelper(data),
95
+ _step;
96
+ try {
97
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
98
+ var item = _step.value;
99
+ _values[item.form_id] = item.form_record;
100
+ }
101
+ } catch (err) {
102
+ _iterator.e(err);
103
+ } finally {
104
+ _iterator.f();
105
+ }
106
+ return _values;
107
+ };
108
+ var geForms = /*#__PURE__*/function () {
109
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
110
+ var data, formData;
111
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
112
+ while (1) switch (_context3.prev = _context3.next) {
113
+ case 0:
114
+ setLoading(true);
115
+ _context3.prev = 1;
116
+ _context3.next = 4;
117
+ return apis.getForms({
118
+ relation_type: relation_type,
119
+ relation_id: relation_id
120
+ });
121
+ case 4:
122
+ data = _context3.sent;
123
+ _context3.next = 7;
124
+ return getFormData(data);
125
+ case 7:
126
+ formData = _context3.sent;
127
+ setFormList(formData);
128
+ setLoading(false);
129
+ _context3.next = 15;
130
+ break;
131
+ case 12:
132
+ _context3.prev = 12;
133
+ _context3.t0 = _context3["catch"](1);
134
+ console.log("form_error", _context3.t0);
135
+ case 15:
136
+ case "end":
137
+ return _context3.stop();
138
+ }
139
+ }, _callee3, null, [[1, 12]]);
140
+ }));
141
+ return function geForms() {
142
+ return _ref3.apply(this, arguments);
143
+ };
144
+ }();
145
+ var onValueChange = function onValueChange(data) {
146
+ var values = data.values;
147
+ onChange === null || onChange === void 0 ? void 0 : onChange(values);
148
+ };
149
+ var addCallback = /*#__PURE__*/function () {
150
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(form) {
151
+ var _data, data;
152
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
153
+ while (1) switch (_context4.prev = _context4.next) {
154
+ case 0:
155
+ _data = _toConsumableArray(formList);
156
+ _context4.next = 3;
157
+ return getFormDataById(form);
158
+ case 3:
159
+ data = _context4.sent;
160
+ _data = _data.map(function (d) {
161
+ return d.form_id === form.form_id ? data : d;
162
+ });
163
+ setFormList(_data);
164
+ case 6:
165
+ case "end":
166
+ return _context4.stop();
167
+ }
168
+ }, _callee4);
169
+ }));
170
+ return function addCallback(_x4) {
171
+ return _ref4.apply(this, arguments);
172
+ };
173
+ }();
174
+ return /*#__PURE__*/React.createElement(FormsCom, {
175
+ forms: formList,
176
+ action: action,
177
+ modalOpen: false,
178
+ value: value,
179
+ onChange: onValueChange,
180
+ addCallback: addCallback,
181
+ client: 0
182
+ });
183
+ };
184
+ export default Forms;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import "./index.less";
3
+ declare const ProductItem: ({ item, onClick, amountSymbol, style, className, }: any) => React.JSX.Element;
4
+ export default ProductItem;
@@ -0,0 +1,30 @@
1
+ import React from "react";
2
+ import { formatAmount, image } from "@pisell/utils";
3
+ import classNames from "classnames";
4
+ import "./index.less";
5
+ var ProductItem = function ProductItem(_ref) {
6
+ var _ref$item = _ref.item,
7
+ item = _ref$item === void 0 ? {} : _ref$item,
8
+ _onClick = _ref.onClick,
9
+ _ref$amountSymbol = _ref.amountSymbol,
10
+ amountSymbol = _ref$amountSymbol === void 0 ? "$" : _ref$amountSymbol,
11
+ style = _ref.style,
12
+ className = _ref.className;
13
+ return /*#__PURE__*/React.createElement("div", {
14
+ style: style,
15
+ className: classNames("product-item-card", className),
16
+ onClick: function onClick() {
17
+ _onClick(item);
18
+ }
19
+ }, item.cover ? /*#__PURE__*/React.createElement("img", {
20
+ src: image.ali(item.cover, 100),
21
+ className: "product-item-card-cover"
22
+ }) : null, /*#__PURE__*/React.createElement("div", {
23
+ className: "product-item-card-content"
24
+ }, /*#__PURE__*/React.createElement("div", {
25
+ className: "product-item-card-title"
26
+ }, item.title), /*#__PURE__*/React.createElement("div", {
27
+ className: "product-item-card-price"
28
+ }, formatAmount(item.price, 2, amountSymbol))));
29
+ };
30
+ export default ProductItem;
@@ -0,0 +1,69 @@
1
+ .product-item-card {
2
+ cursor: pointer;
3
+ padding: 16px;
4
+ position: relative;
5
+ display: flex;
6
+ align-items: center;
7
+ gap: 12px;
8
+
9
+ &::before {
10
+ content: "";
11
+ position: absolute;
12
+ bottom: 0;
13
+ left: 50%;
14
+ transform: translate(-50%, -50%);
15
+ width: calc(100% - 40px);
16
+ height: 1px;
17
+ background: #F1F1F1;
18
+ }
19
+
20
+ &:last-child {
21
+ &::before {
22
+ display: none;
23
+ }
24
+ }
25
+
26
+ .product-item-card-cover {
27
+ width: 80px;
28
+ height: 80px;
29
+ border-radius: 8px;
30
+ object-fit: cover;
31
+ }
32
+
33
+ .product-item-card-content {
34
+ flex: 1;
35
+
36
+ .product-item-card-title {
37
+ color: var(--text-text-1, #1B1B1B);
38
+
39
+
40
+ font-size: 14px;
41
+ font-style: normal;
42
+ font-weight: 600;
43
+ line-height: 20px;
44
+ }
45
+
46
+ .product-item-card-time {
47
+ overflow: hidden;
48
+ color: var(--text-text-2, #777);
49
+ text-overflow: ellipsis;
50
+
51
+
52
+ font-size: 12px;
53
+ font-style: normal;
54
+ font-weight: 400;
55
+ line-height: 18px;
56
+ }
57
+
58
+ .product-item-card-price {
59
+ color: var(--text-text-1, #1B1B1B);
60
+
61
+
62
+ font-size: 14px;
63
+ font-style: normal;
64
+ font-weight: 400;
65
+ line-height: 20px;
66
+ }
67
+ }
68
+
69
+ }
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import "./index.less";
3
+ declare const ProductItemPreview: ({ item, onClick, onRemove, amountSymbol, style, className, }: any) => React.JSX.Element;
4
+ export default ProductItemPreview;
@@ -0,0 +1,39 @@
1
+ import React from "react";
2
+ import { image } from "@pisell/utils";
3
+ import XClose from "@pisell/icon/es/XClose";
4
+ import classNames from "classnames";
5
+ import "./index.less";
6
+ var ProductItemPreview = function ProductItemPreview(_ref) {
7
+ var _ref$item = _ref.item,
8
+ item = _ref$item === void 0 ? {} : _ref$item,
9
+ _onClick = _ref.onClick,
10
+ onRemove = _ref.onRemove,
11
+ _ref$amountSymbol = _ref.amountSymbol,
12
+ amountSymbol = _ref$amountSymbol === void 0 ? "$" : _ref$amountSymbol,
13
+ style = _ref.style,
14
+ className = _ref.className;
15
+ return /*#__PURE__*/React.createElement("div", {
16
+ style: style,
17
+ className: classNames("product-item-card-preview", className),
18
+ onClick: function onClick() {
19
+ _onClick(item);
20
+ }
21
+ }, item.cover ? /*#__PURE__*/React.createElement("img", {
22
+ src: image.ali(item.cover, 100),
23
+ className: "product-item-card-preview-cover"
24
+ }) : null, /*#__PURE__*/React.createElement("div", {
25
+ className: "product-item-card-preview-content"
26
+ }, /*#__PURE__*/React.createElement("div", {
27
+ className: "product-item-card-preview-title"
28
+ }, item.title)), /*#__PURE__*/React.createElement("div", {
29
+ className: "product-item-card-preview-close-wrap",
30
+ onClick: function onClick(e) {
31
+ e.preventDefault();
32
+ e.stopPropagation();
33
+ onRemove === null || onRemove === void 0 ? void 0 : onRemove(item);
34
+ }
35
+ }, /*#__PURE__*/React.createElement(XClose, {
36
+ className: "product-item-card-preview-close"
37
+ })));
38
+ };
39
+ export default ProductItemPreview;
@@ -0,0 +1,62 @@
1
+ .product-item-card-preview {
2
+ padding: 16px;
3
+ position: relative;
4
+ display: flex;
5
+ align-items: center;
6
+ gap: 12px;
7
+
8
+ &::before {
9
+ content: "";
10
+ position: absolute;
11
+ bottom: 0;
12
+ left: 50%;
13
+ transform: translate(-50%, -50%);
14
+ width: calc(100% - 40px);
15
+ height: 1px;
16
+ background: #F1F1F1;
17
+ }
18
+
19
+ &:last-child {
20
+ &::before {
21
+ display: none;
22
+ }
23
+ }
24
+
25
+ .product-item-card-preview-cover {
26
+ width: 40px;
27
+ height: 40px;
28
+ border-radius: 8px;
29
+ object-fit: cover;
30
+ }
31
+
32
+ .product-item-card-preview-content {
33
+ flex: 1;
34
+
35
+ .product-item-card-preview-title {
36
+ color: var(--text-text-1, #1B1B1B);
37
+
38
+
39
+ font-size: 14px;
40
+ font-style: normal;
41
+ font-weight: 600;
42
+ line-height: 20px;
43
+ }
44
+
45
+ }
46
+
47
+ .product-item-card-preview-close-wrap {
48
+ display: flex;
49
+ align-items: center;
50
+ justify-content: center;
51
+ width: 40px;
52
+ height: 40px;
53
+ cursor: pointer;
54
+
55
+ .product-item-card-close {
56
+ font-size: 30px;
57
+
58
+ }
59
+ }
60
+
61
+
62
+ }
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import "./index.less";
3
+ interface valueType {
4
+ }
5
+ interface SelectProductsProps {
6
+ value?: valueType[];
7
+ onChange?: (value: valueType[]) => void;
8
+ }
9
+ declare const SelectProducts: ({ value, onChange }: SelectProductsProps) => React.JSX.Element;
10
+ export default SelectProducts;