@pisell/private-materials 3.0.13 → 3.0.14
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 +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/booking/components/addButton/index.d.ts +8 -8
- package/es/components/booking/components/addButton/index.js +1 -1
- package/es/components/booking/components/drawer/index.d.ts +1 -1
- package/es/components/booking/components/footer/FooterMenus/index.js +1 -1
- package/es/components/booking/components/footer/index.js +23 -21
- package/es/components/booking/components/footer/utils.js +4 -3
- package/es/components/booking/forms/forms.js +2 -1
- package/es/components/booking/info/client/index.js +0 -1
- package/es/components/booking/info/date/index.less +1 -1
- package/es/components/booking/info/index.js +10 -4
- package/es/components/booking/info/pet/index.js +5 -7
- package/es/components/booking/info/service/addService/index.js +27 -11
- package/es/components/booking/info/service/editService/index.js +8 -7
- package/es/components/booking/info/service/index.js +1 -1
- package/es/components/booking/info/service/index.less +3 -0
- package/es/components/booking/locales.d.ts +3 -0
- package/es/components/booking/locales.js +3 -0
- package/es/components/booking/model.d.ts +11 -0
- package/es/components/booking/utils.js +2 -1
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +2 -1
- package/es/components/productExtension/card/index.d.ts +10 -0
- package/es/components/productExtension/card/index.js +20 -0
- package/es/components/productExtension/card/index.less +34 -0
- package/es/components/productExtension/fields/Actor/Container/index.d.ts +12 -0
- package/es/components/productExtension/fields/Actor/Container/index.js +34 -0
- package/es/components/productExtension/fields/Actor/Container/index.less +19 -0
- package/es/components/productExtension/fields/Actor/CutOffTime/index.d.ts +10 -0
- package/es/components/productExtension/fields/Actor/CutOffTime/index.js +94 -0
- package/es/components/productExtension/fields/Actor/CutOffTime/index.less +32 -0
- package/es/components/productExtension/fields/Actor/CutOffTime/status.d.ts +0 -0
- package/es/components/productExtension/fields/Actor/CutOffTime/status.js +0 -0
- package/es/components/productExtension/fields/Actor/index.d.ts +5 -0
- package/es/components/productExtension/fields/Actor/index.js +23 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +10 -0
- package/es/components/productExtension/fields/Forms/index.js +184 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +4 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.js +30 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.less +69 -0
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +10 -0
- package/es/components/productExtension/fields/SelectProducts/index.js +91 -0
- package/es/components/productExtension/fields/SelectProducts/index.less +30 -0
- package/es/components/productExtension/fields/SelectProducts/mock.d.ts +0 -0
- package/es/components/productExtension/fields/SelectProducts/mock.js +0 -0
- package/es/components/productExtension/fields/SelectProducts/server.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/server.js +29 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +4 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.js +198 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.less +0 -0
- package/es/components/productExtension/fields/SelectResourcesTable/mock.d.ts +2681 -0
- package/es/components/productExtension/fields/SelectResourcesTable/mock.js +5072 -0
- package/es/components/productExtension/fields/SelectResourcesTable/server.d.ts +2 -0
- package/es/components/productExtension/fields/SelectResourcesTable/server.js +49 -0
- package/es/components/productExtension/fields/index.d.ts +1 -0
- package/es/components/productExtension/fields/index.js +33 -0
- package/es/components/productExtension/index.d.ts +7 -0
- package/es/components/productExtension/index.js +77 -0
- package/es/components/productExtension/index.less +0 -0
- package/es/components/productExtension/locales.d.ts +48 -0
- package/es/components/productExtension/locales.js +47 -0
- package/es/components/productExtension/server.d.ts +1 -0
- package/es/components/productExtension/server.js +29 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.js +21 -5
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +5 -2
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +20 -5
- package/es/components/selectModal/index.d.ts +24 -0
- package/es/components/selectModal/index.js +108 -0
- package/es/components/selectModal/index.less +0 -0
- package/es/components/tabProduct/card/index.d.ts +2 -2
- package/es/components/tabProduct/card/index.js +3 -4
- package/es/components/tabProduct/index.d.ts +4 -2
- package/es/components/tabProduct/index.js +10 -9
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/utils/index.d.ts +22 -0
- package/es/utils/index.js +56 -0
- package/lib/components/booking/components/addButton/index.d.ts +8 -8
- package/lib/components/booking/components/addButton/index.js +1 -1
- package/lib/components/booking/components/drawer/index.d.ts +1 -1
- package/lib/components/booking/components/footer/FooterMenus/index.js +1 -1
- package/lib/components/booking/components/footer/index.js +3 -1
- package/lib/components/booking/components/footer/utils.js +4 -2
- package/lib/components/booking/forms/forms.js +1 -1
- package/lib/components/booking/info/client/index.js +0 -1
- package/lib/components/booking/info/date/index.less +1 -1
- package/lib/components/booking/info/index.js +7 -1
- package/lib/components/booking/info/pet/index.js +5 -7
- package/lib/components/booking/info/service/addService/index.js +25 -10
- package/lib/components/booking/info/service/editService/index.js +7 -5
- package/lib/components/booking/info/service/index.js +1 -1
- package/lib/components/booking/info/service/index.less +3 -0
- package/lib/components/booking/locales.d.ts +3 -0
- package/lib/components/booking/locales.js +3 -0
- package/lib/components/booking/model.d.ts +11 -0
- package/lib/components/booking/utils.js +2 -1
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +3 -0
- package/lib/components/productExtension/card/index.d.ts +10 -0
- package/lib/components/productExtension/card/index.js +57 -0
- package/lib/components/productExtension/card/index.less +34 -0
- package/lib/components/productExtension/fields/Actor/Container/index.d.ts +12 -0
- package/lib/components/productExtension/fields/Actor/Container/index.js +64 -0
- package/lib/components/productExtension/fields/Actor/Container/index.less +19 -0
- package/lib/components/productExtension/fields/Actor/CutOffTime/index.d.ts +10 -0
- package/lib/components/productExtension/fields/Actor/CutOffTime/index.js +128 -0
- package/lib/components/productExtension/fields/Actor/CutOffTime/index.less +32 -0
- package/lib/components/productExtension/fields/Actor/CutOffTime/status.d.ts +0 -0
- package/lib/components/productExtension/fields/Actor/CutOffTime/status.js +0 -0
- package/lib/components/productExtension/fields/Actor/index.d.ts +5 -0
- package/lib/components/productExtension/fields/Actor/index.js +56 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +10 -0
- package/lib/components/productExtension/fields/Forms/index.js +108 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +4 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.js +65 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.less +69 -0
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +10 -0
- package/lib/components/productExtension/fields/SelectProducts/index.js +111 -0
- package/lib/components/productExtension/fields/SelectProducts/index.less +30 -0
- package/lib/components/productExtension/fields/SelectProducts/mock.d.ts +0 -0
- package/lib/components/productExtension/fields/SelectProducts/mock.js +0 -0
- package/lib/components/productExtension/fields/SelectProducts/server.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/server.js +33 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +4 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.js +179 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.less +0 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/mock.d.ts +2681 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/mock.js +12723 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/server.d.ts +2 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/server.js +39 -0
- package/lib/components/productExtension/fields/index.d.ts +1 -0
- package/lib/components/productExtension/fields/index.js +69 -0
- package/lib/components/productExtension/index.d.ts +7 -0
- package/lib/components/productExtension/index.js +108 -0
- package/lib/components/productExtension/index.less +0 -0
- package/lib/components/productExtension/locales.d.ts +48 -0
- package/lib/components/productExtension/locales.js +71 -0
- package/lib/components/productExtension/server.d.ts +1 -0
- package/lib/components/productExtension/server.js +33 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.js +11 -6
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +5 -2
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +18 -4
- package/lib/components/selectModal/index.d.ts +24 -0
- package/lib/components/selectModal/index.js +133 -0
- package/lib/components/selectModal/index.less +0 -0
- package/lib/components/tabProduct/card/index.d.ts +2 -2
- package/lib/components/tabProduct/card/index.js +1 -2
- package/lib/components/tabProduct/index.d.ts +4 -2
- package/lib/components/tabProduct/index.js +7 -8
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/utils/index.d.ts +22 -0
- package/lib/utils/index.js +59 -0
- package/lowcode/product-extension/meta.ts +120 -0
- package/package.json +1 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3
|
+
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."); }
|
|
4
|
+
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); }
|
|
5
|
+
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; }
|
|
6
|
+
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; } }
|
|
7
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
+
import React, { useState, useMemo } from "react";
|
|
9
|
+
import classNames from "classnames";
|
|
10
|
+
import { Input, Skeleton } from "antd";
|
|
11
|
+
import SearchLg from "@pisell/icon/es/SearchLg";
|
|
12
|
+
import AddButton from "../booking/components/addButton";
|
|
13
|
+
import Drawer from "../booking/components/drawer";
|
|
14
|
+
import TabProduct from "../tabProduct";
|
|
15
|
+
import { formatProductListByCategory } from "../booking/utils";
|
|
16
|
+
import { changeArray } from "@pisell/utils";
|
|
17
|
+
import "./index.less";
|
|
18
|
+
var MAX_LENGTH = 999;
|
|
19
|
+
var SelectModal = function SelectModal(props) {
|
|
20
|
+
var value = props.value,
|
|
21
|
+
onChange = props.onChange,
|
|
22
|
+
_props$dataSource = props.dataSource,
|
|
23
|
+
dataSource = _props$dataSource === void 0 ? [] : _props$dataSource,
|
|
24
|
+
renderValueItem = props.renderValueItem,
|
|
25
|
+
renderOptionItem = props.renderOptionItem,
|
|
26
|
+
disabled = props.disabled,
|
|
27
|
+
className = props.className,
|
|
28
|
+
style = props.style,
|
|
29
|
+
_props$maxLength = props.maxLength,
|
|
30
|
+
maxLength = _props$maxLength === void 0 ? MAX_LENGTH : _props$maxLength,
|
|
31
|
+
buttonProps = props.buttonProps,
|
|
32
|
+
drawerProps = props.drawerProps,
|
|
33
|
+
tabProductProps = props.tabProductProps,
|
|
34
|
+
loading = props.loading;
|
|
35
|
+
var _useState = useState(false),
|
|
36
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
37
|
+
open = _useState2[0],
|
|
38
|
+
setOpen = _useState2[1];
|
|
39
|
+
var _useState3 = useState(""),
|
|
40
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
41
|
+
search = _useState4[0],
|
|
42
|
+
setSearch = _useState4[1];
|
|
43
|
+
var _value = useMemo(function () {
|
|
44
|
+
return value || [];
|
|
45
|
+
}, [value]);
|
|
46
|
+
var onOpen = function onOpen() {
|
|
47
|
+
setOpen(true);
|
|
48
|
+
};
|
|
49
|
+
var onClose = function onClose() {
|
|
50
|
+
setSearch("");
|
|
51
|
+
setOpen(false);
|
|
52
|
+
};
|
|
53
|
+
var renderList = useMemo(function () {
|
|
54
|
+
var _list = dataSource || [];
|
|
55
|
+
var isIncludes = function isIncludes(str) {
|
|
56
|
+
return str.toLowerCase().indexOf(search.toLowerCase()) !== -1;
|
|
57
|
+
};
|
|
58
|
+
return formatProductListByCategory(_list, search ? function (item) {
|
|
59
|
+
return isIncludes(item.title);
|
|
60
|
+
} : undefined);
|
|
61
|
+
}, [search, dataSource]);
|
|
62
|
+
var onSelect = function onSelect(item) {
|
|
63
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(changeArray(_value, item, "id"));
|
|
64
|
+
onClose();
|
|
65
|
+
};
|
|
66
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
67
|
+
className: classNames("pisell2-select-modal", className),
|
|
68
|
+
style: style
|
|
69
|
+
}, /*#__PURE__*/React.createElement(Skeleton, {
|
|
70
|
+
active: true,
|
|
71
|
+
round: true,
|
|
72
|
+
loading: loading
|
|
73
|
+
}, _value.map(function (item) {
|
|
74
|
+
return renderValueItem === null || renderValueItem === void 0 ? void 0 : renderValueItem(item, function (item) {
|
|
75
|
+
onOpen();
|
|
76
|
+
});
|
|
77
|
+
})), _value.length < maxLength ? /*#__PURE__*/React.createElement(AddButton, _extends({
|
|
78
|
+
onClick: onOpen
|
|
79
|
+
}, buttonProps)) : null, /*#__PURE__*/React.createElement(Drawer, _extends({
|
|
80
|
+
open: open,
|
|
81
|
+
onClose: onClose,
|
|
82
|
+
header: /*#__PURE__*/React.createElement("div", {
|
|
83
|
+
className: "pisell-lowcode__booking-service-header"
|
|
84
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
85
|
+
prefix: /*#__PURE__*/React.createElement(SearchLg, null),
|
|
86
|
+
style: {
|
|
87
|
+
marginTop: 16,
|
|
88
|
+
height: 44
|
|
89
|
+
},
|
|
90
|
+
placeholder: "",
|
|
91
|
+
allowClear: true,
|
|
92
|
+
value: search,
|
|
93
|
+
onChange: function onChange(e) {
|
|
94
|
+
setSearch(e.target.value);
|
|
95
|
+
}
|
|
96
|
+
}))
|
|
97
|
+
}, drawerProps), /*#__PURE__*/React.createElement("div", {
|
|
98
|
+
className: "pisell-lowcode__booking-service-body"
|
|
99
|
+
}, /*#__PURE__*/React.createElement(TabProduct, _extends({
|
|
100
|
+
list: renderList
|
|
101
|
+
// scrollDom='.booking-server-wrap .pisell-lowcode-drawer-body'
|
|
102
|
+
}, tabProductProps, {
|
|
103
|
+
renderItem: function renderItem(item) {
|
|
104
|
+
return renderOptionItem === null || renderOptionItem === void 0 ? void 0 : renderOptionItem(item, onSelect);
|
|
105
|
+
}
|
|
106
|
+
})))));
|
|
107
|
+
};
|
|
108
|
+
export default SelectModal;
|
|
File without changes
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
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); }
|
|
2
|
-
import
|
|
3
|
-
import classNames from "classnames";
|
|
2
|
+
import classNames from 'classnames';
|
|
4
3
|
import "./index.less";
|
|
5
4
|
var Card = function Card(props) {
|
|
6
5
|
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
7
|
-
className: classNames(
|
|
8
|
-
|
|
6
|
+
className: classNames('pisell-card', {
|
|
7
|
+
'pisell-card-layout_2': props.layout === 2
|
|
9
8
|
}, props.className)
|
|
10
9
|
}), props.children);
|
|
11
10
|
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./index.less";
|
|
3
|
-
interface TabProductProps {
|
|
4
|
-
list
|
|
3
|
+
export interface TabProductProps {
|
|
4
|
+
list?: any[];
|
|
5
5
|
scrollDom?: string;
|
|
6
6
|
renderItem?: (item: any) => React.ReactNode;
|
|
7
7
|
rowKey?: string;
|
|
8
8
|
tabsWrapClassName?: string;
|
|
9
9
|
categoryWrapClassName?: string;
|
|
10
10
|
listWrapClassName?: string;
|
|
11
|
+
warpClassName?: string;
|
|
12
|
+
stickyTop?: number;
|
|
11
13
|
}
|
|
12
14
|
declare const TabProduct: (props: TabProductProps) => React.JSX.Element;
|
|
13
15
|
export default TabProduct;
|
|
@@ -12,14 +12,18 @@ import classNames from "classnames";
|
|
|
12
12
|
import "./index.less";
|
|
13
13
|
var io = null;
|
|
14
14
|
var TabProduct = function TabProduct(props) {
|
|
15
|
-
var list = props.list,
|
|
15
|
+
var _props$list = props.list,
|
|
16
|
+
list = _props$list === void 0 ? [] : _props$list,
|
|
16
17
|
scrollDom = props.scrollDom,
|
|
17
18
|
_props$rowKey = props.rowKey,
|
|
18
19
|
rowKey = _props$rowKey === void 0 ? "id" : _props$rowKey,
|
|
19
20
|
tabsWrapClassName = props.tabsWrapClassName,
|
|
20
21
|
categoryWrapClassName = props.categoryWrapClassName,
|
|
21
22
|
listWrapClassName = props.listWrapClassName,
|
|
22
|
-
renderItem = props.renderItem
|
|
23
|
+
renderItem = props.renderItem,
|
|
24
|
+
warpClassName = props.warpClassName,
|
|
25
|
+
_props$stickyTop = props.stickyTop,
|
|
26
|
+
stickyTop = _props$stickyTop === void 0 ? 0 : _props$stickyTop;
|
|
23
27
|
var tabsRef = useRef();
|
|
24
28
|
var _useState = useState(1),
|
|
25
29
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -32,9 +36,6 @@ var TabProduct = function TabProduct(props) {
|
|
|
32
36
|
}
|
|
33
37
|
}, [list]);
|
|
34
38
|
var handleObserver = function handleObserver() {
|
|
35
|
-
var _marginTop = 0;
|
|
36
|
-
var _marginBottom = window.innerHeight - 100;
|
|
37
|
-
var _rootMargin = "".concat(_marginTop * -1, "px 0px ").concat(_marginBottom * -1, "px 0px");
|
|
38
39
|
io = new IntersectionObserver(function (entries) {
|
|
39
40
|
console.log(entries);
|
|
40
41
|
if (entries[0].isIntersecting) {
|
|
@@ -88,12 +89,12 @@ var TabProduct = function TabProduct(props) {
|
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
};
|
|
91
|
-
return /*#__PURE__*/React.createElement(
|
|
92
|
-
className: "tab-product"
|
|
92
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
93
|
+
className: classNames("tab-product", warpClassName)
|
|
93
94
|
}, /*#__PURE__*/React.createElement("div", {
|
|
94
95
|
className: "tabs-wrap",
|
|
95
96
|
style: {
|
|
96
|
-
top:
|
|
97
|
+
top: stickyTop
|
|
97
98
|
}
|
|
98
99
|
}, /*#__PURE__*/React.createElement(Card, {
|
|
99
100
|
className: classNames("tabs", tabsWrapClassName),
|
|
@@ -135,6 +136,6 @@ var TabProduct = function TabProduct(props) {
|
|
|
135
136
|
key: index
|
|
136
137
|
}, index);
|
|
137
138
|
})));
|
|
138
|
-
})))
|
|
139
|
+
})));
|
|
139
140
|
};
|
|
140
141
|
export default TabProduct;
|
package/es/index.d.ts
CHANGED
|
@@ -11,3 +11,4 @@ export { default as BookingResources } from './components/booking/materiels/reso
|
|
|
11
11
|
export { default as BookingStartTime } from './components/booking/materiels/startTime';
|
|
12
12
|
export { default as BookingDuration } from './components/booking/materiels/duration';
|
|
13
13
|
export { default as BookingContacts } from './components/booking/materiels/contacts';
|
|
14
|
+
export { default as ProductExtension } from './components/productExtension';
|
package/es/index.js
CHANGED
|
@@ -14,4 +14,5 @@ export { default as Schedules } from "./components/schedules";
|
|
|
14
14
|
export { default as BookingResources } from "./components/booking/materiels/resources";
|
|
15
15
|
export { default as BookingStartTime } from "./components/booking/materiels/startTime";
|
|
16
16
|
export { default as BookingDuration } from "./components/booking/materiels/duration";
|
|
17
|
-
export { default as BookingContacts } from "./components/booking/materiels/contacts";
|
|
17
|
+
export { default as BookingContacts } from "./components/booking/materiels/contacts";
|
|
18
|
+
export { default as ProductExtension } from "./components/productExtension";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ModalStaticFunctions } from "antd/es/modal/confirm";
|
|
2
|
+
declare type RType = (url: string, data?: {} | undefined, config?: {} | undefined) => Promise<any>;
|
|
3
|
+
declare class Request {
|
|
4
|
+
private request;
|
|
5
|
+
constructor();
|
|
6
|
+
setRequest(val: any): void;
|
|
7
|
+
getRequest(): {
|
|
8
|
+
get: RType;
|
|
9
|
+
post: RType;
|
|
10
|
+
put: RType;
|
|
11
|
+
remove: RType;
|
|
12
|
+
custom: RType;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export declare const request: Request;
|
|
16
|
+
declare let modal: Omit<ModalStaticFunctions, "warn">;
|
|
17
|
+
export declare const setModal: (m: Omit<ModalStaticFunctions, "warn">) => void;
|
|
18
|
+
export declare const saveConfirm: () => Promise<{
|
|
19
|
+
destroy: () => void;
|
|
20
|
+
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
21
|
+
}>;
|
|
22
|
+
export { modal };
|
|
@@ -0,0 +1,56 @@
|
|
|
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 _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; }
|
|
3
|
+
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); } }
|
|
4
|
+
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); }); }; }
|
|
5
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
7
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8
|
+
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; }
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
|
+
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); }
|
|
11
|
+
import { locales } from "@pisell/utils";
|
|
12
|
+
var Request = /*#__PURE__*/function () {
|
|
13
|
+
function Request() {
|
|
14
|
+
_classCallCheck(this, Request);
|
|
15
|
+
_defineProperty(this, "request", {});
|
|
16
|
+
}
|
|
17
|
+
_createClass(Request, [{
|
|
18
|
+
key: "setRequest",
|
|
19
|
+
value: function setRequest(val) {
|
|
20
|
+
this.request = val;
|
|
21
|
+
}
|
|
22
|
+
}, {
|
|
23
|
+
key: "getRequest",
|
|
24
|
+
value: function getRequest() {
|
|
25
|
+
return this.request;
|
|
26
|
+
}
|
|
27
|
+
}]);
|
|
28
|
+
return Request;
|
|
29
|
+
}();
|
|
30
|
+
export var request = new Request();
|
|
31
|
+
var modal;
|
|
32
|
+
export var setModal = function setModal(m) {
|
|
33
|
+
modal = m;
|
|
34
|
+
};
|
|
35
|
+
export var saveConfirm = /*#__PURE__*/function () {
|
|
36
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
37
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
38
|
+
while (1) switch (_context.prev = _context.next) {
|
|
39
|
+
case 0:
|
|
40
|
+
return _context.abrupt("return", modal.confirm({
|
|
41
|
+
title: locales.getText("pisell2.text.products.unsaved-title"),
|
|
42
|
+
content: locales.getText("pisell2.text.products.unsaved-content"),
|
|
43
|
+
cancelText: locales.getText("pisell2.text.products.unsaved-back"),
|
|
44
|
+
okText: locales.getText("pisell2.text.products.unsaved-yes")
|
|
45
|
+
}));
|
|
46
|
+
case 1:
|
|
47
|
+
case "end":
|
|
48
|
+
return _context.stop();
|
|
49
|
+
}
|
|
50
|
+
}, _callee);
|
|
51
|
+
}));
|
|
52
|
+
return function saveConfirm() {
|
|
53
|
+
return _ref.apply(this, arguments);
|
|
54
|
+
};
|
|
55
|
+
}();
|
|
56
|
+
export { modal };
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import React from "react";
|
|
9
9
|
import "./index.less";
|
|
10
|
-
interface AddButtonProps {
|
|
11
|
-
onClick
|
|
12
|
-
title
|
|
13
|
-
subTitle
|
|
14
|
-
showSub
|
|
15
|
-
style
|
|
16
|
-
disabled
|
|
17
|
-
loading
|
|
10
|
+
export interface AddButtonProps {
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
title?: string;
|
|
13
|
+
subTitle?: string;
|
|
14
|
+
showSub?: boolean;
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
loading?: boolean;
|
|
18
18
|
}
|
|
19
19
|
declare const AddButton: React.FC<AddButtonProps>;
|
|
20
20
|
export default AddButton;
|
|
@@ -39,7 +39,7 @@ var import_utils = require("@pisell/utils");
|
|
|
39
39
|
var FooterMenus = ({ state, dispatch }) => {
|
|
40
40
|
const items = (0, import_react.useMemo)(() => {
|
|
41
41
|
let list = [];
|
|
42
|
-
if (state.bookingId) {
|
|
42
|
+
if (state.bookingId && state.renderType !== "eventBooking") {
|
|
43
43
|
list.push({
|
|
44
44
|
label: import_utils.locales.getText("pisell2.text.rebook"),
|
|
45
45
|
key: "rebook"
|
|
@@ -145,6 +145,8 @@ var Footer = (props) => {
|
|
|
145
145
|
var _a2;
|
|
146
146
|
let _setLoading = type === "checkout" ? setCheckoutLoading : setLoading;
|
|
147
147
|
_setLoading(true);
|
|
148
|
+
const editApi = state.renderType === "eventBooking" ? state.apis.editEventBooking : state.apis.editBooking;
|
|
149
|
+
const createApi = state.renderType === "eventBooking" ? state.apis.createEventBooking : state.apis.createBooking;
|
|
148
150
|
let saveOtherValue = {};
|
|
149
151
|
if (type === "save") {
|
|
150
152
|
saveOtherValue = await ((_a2 = state == null ? void 0 : state.onSave) == null ? void 0 : _a2.call(state, state.client)) || {};
|
|
@@ -152,7 +154,7 @@ var Footer = (props) => {
|
|
|
152
154
|
try {
|
|
153
155
|
let callbackData = null;
|
|
154
156
|
let values = (0, import_utils2.formatValues)({ ...state, ...saveOtherValue });
|
|
155
|
-
const api = state.bookingId ?
|
|
157
|
+
const api = state.bookingId ? editApi : createApi;
|
|
156
158
|
if (addonsEdit) {
|
|
157
159
|
await handleSaveAddons();
|
|
158
160
|
}
|
|
@@ -44,6 +44,7 @@ var formatCustomer = (data) => {
|
|
|
44
44
|
};
|
|
45
45
|
var formatBookings = (data) => {
|
|
46
46
|
const list = data.service.value;
|
|
47
|
+
const eventOtherParams = data.eventOtherParams;
|
|
47
48
|
let bookings = [];
|
|
48
49
|
bookings = list.map((item) => {
|
|
49
50
|
let start_date = item._extend.startDate.format("YYYY-MM-DD");
|
|
@@ -77,7 +78,8 @@ var formatBookings = (data) => {
|
|
|
77
78
|
"end_date": end_date,
|
|
78
79
|
"start_date": start_date,
|
|
79
80
|
"duration": import_utils.flexibleObj.getValue(item._extend.duration),
|
|
80
|
-
"number": item._extend.number || 1
|
|
81
|
+
"number": item._extend.number || 1,
|
|
82
|
+
...eventOtherParams || {}
|
|
81
83
|
};
|
|
82
84
|
});
|
|
83
85
|
return bookings;
|
|
@@ -99,7 +101,7 @@ var formatHolder = (data, values) => {
|
|
|
99
101
|
var formatValues = (state) => {
|
|
100
102
|
var _a;
|
|
101
103
|
let values = {
|
|
102
|
-
type: "appointment_booking",
|
|
104
|
+
type: state.renderType === "eventBooking" ? "event_booking_v2" : "appointment_booking",
|
|
103
105
|
platform: "shop",
|
|
104
106
|
sales_channel: "my_pisel",
|
|
105
107
|
bookings: [],
|
|
@@ -122,7 +122,6 @@ var Info = () => {
|
|
|
122
122
|
[import_utils.locales.localeMap]
|
|
123
123
|
);
|
|
124
124
|
const handleSelectClient = (value) => {
|
|
125
|
-
console.log("valuevalue", value);
|
|
126
125
|
let _value = (value == null ? void 0 : value[value.length - 1]) || import_model.walkInData;
|
|
127
126
|
if (_value.loading) {
|
|
128
127
|
return;
|
|
@@ -96,11 +96,17 @@ var Info = (0, import_model.Provider)((props) => {
|
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
98
|
};
|
|
99
|
+
const header = (0, import_react.useMemo)(() => {
|
|
100
|
+
if ((globalState == null ? void 0 : globalState.renderType) === "eventBooking") {
|
|
101
|
+
return import_utils.locales.getText("pisell2.text.enroll");
|
|
102
|
+
}
|
|
103
|
+
return (globalState == null ? void 0 : globalState.bookingId) ? /* @__PURE__ */ import_react.default.createElement(import_header.default, { state: modal.state, dispatch: modal.dispatch }) : import_utils.locales.getText("pisell2.text.new-appointment");
|
|
104
|
+
}, [globalState == null ? void 0 : globalState.bookingId, modal.state, modal.dispatch, globalState == null ? void 0 : globalState.renderType]);
|
|
99
105
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, !!modal.state.setGlobalState ? /* @__PURE__ */ import_react.default.createElement(
|
|
100
106
|
import_tabPane.default,
|
|
101
107
|
{
|
|
102
108
|
style,
|
|
103
|
-
header
|
|
109
|
+
header,
|
|
104
110
|
footer: /* @__PURE__ */ import_react.default.createElement(
|
|
105
111
|
import_footer.default,
|
|
106
112
|
{
|
|
@@ -42,7 +42,7 @@ var import_forms = __toESM(require("../../forms/forms"));
|
|
|
42
42
|
var import_format = require("../../forms/format");
|
|
43
43
|
var import_utils2 = require("../../utils");
|
|
44
44
|
var Pet = () => {
|
|
45
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
45
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
46
46
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
47
47
|
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
48
48
|
const [valueLoading, setValueLoading] = (0, import_react.useState)(false);
|
|
@@ -87,7 +87,6 @@ var Pet = () => {
|
|
|
87
87
|
});
|
|
88
88
|
setLoading(false);
|
|
89
89
|
};
|
|
90
|
-
console.log("values", (_d = state.pet) == null ? void 0 : _d.value);
|
|
91
90
|
const getForms = async (isUpdateValue = true) => {
|
|
92
91
|
var _a2, _b2;
|
|
93
92
|
setLoading(true);
|
|
@@ -100,7 +99,7 @@ var Pet = () => {
|
|
|
100
99
|
}
|
|
101
100
|
try {
|
|
102
101
|
let formData = await state.apis.getForms({
|
|
103
|
-
relation_type: "appointment_booking",
|
|
102
|
+
relation_type: state.renderType === "eventBooking" ? "event_booking_v2" : "appointment_booking",
|
|
104
103
|
relation_id: ((_b2 = (_a2 = state.bookingDetail) == null ? void 0 : _a2.bookings) == null ? void 0 : _b2.id) || 0
|
|
105
104
|
// _config: { useCache: true },
|
|
106
105
|
});
|
|
@@ -197,7 +196,7 @@ var Pet = () => {
|
|
|
197
196
|
type: "setPet",
|
|
198
197
|
payload: { value: changeFormValuesData }
|
|
199
198
|
});
|
|
200
|
-
}, [(
|
|
199
|
+
}, [(_d = state.client.value) == null ? void 0 : _d.id]);
|
|
201
200
|
(0, import_react.useEffect)(() => {
|
|
202
201
|
if (state.bookingId) {
|
|
203
202
|
if (!state.bookingDetail) {
|
|
@@ -212,9 +211,8 @@ var Pet = () => {
|
|
|
212
211
|
state.bookingDetail,
|
|
213
212
|
params.form_id,
|
|
214
213
|
params.type,
|
|
215
|
-
(
|
|
214
|
+
(_f = (_e = state.client) == null ? void 0 : _e.value) == null ? void 0 : _f.id
|
|
216
215
|
]);
|
|
217
|
-
console.log("state.pet.formData", state.pet.formData);
|
|
218
216
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-pet-wraps" }, /* @__PURE__ */ import_react.default.createElement(
|
|
219
217
|
import_forms.default,
|
|
220
218
|
{
|
|
@@ -229,7 +227,7 @@ var Pet = () => {
|
|
|
229
227
|
modalOpen: state.modalOpen,
|
|
230
228
|
value: state.pet.value,
|
|
231
229
|
onChange: onValueChange,
|
|
232
|
-
client: (
|
|
230
|
+
client: (_g = state.client) == null ? void 0 : _g.value,
|
|
233
231
|
customSelectProps: {
|
|
234
232
|
// loading: loading,
|
|
235
233
|
handleViewItem,
|
|
@@ -47,15 +47,17 @@ var Info = () => {
|
|
|
47
47
|
const [search, setSearch] = (0, import_react.useState)("");
|
|
48
48
|
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
49
49
|
const getServices = async () => {
|
|
50
|
+
var _a2;
|
|
50
51
|
let data = await state.apis.getServices({
|
|
51
52
|
skip: 1,
|
|
52
53
|
num: 500,
|
|
53
|
-
extension_type: ["product_appointment"],
|
|
54
|
+
extension_type: state.renderType === "eventBooking" ? void 0 : ["product_appointment"],
|
|
54
55
|
with: ["category"],
|
|
55
56
|
// include_formula: "no",
|
|
56
57
|
// include_bundle: "no",
|
|
57
58
|
// include_option: "no",
|
|
58
59
|
// include_variant: "no",
|
|
60
|
+
ids: state.renderType === "eventBooking" ? (_a2 = state.eventOtherParams) == null ? void 0 : _a2.productIds : void 0,
|
|
59
61
|
open_quotation: 1,
|
|
60
62
|
with_schedule: 0
|
|
61
63
|
});
|
|
@@ -113,7 +115,6 @@ var Info = () => {
|
|
|
113
115
|
search ? (item) => isIncludes(item.title) : void 0
|
|
114
116
|
);
|
|
115
117
|
}, [search, (_a = state.service) == null ? void 0 : _a.services]);
|
|
116
|
-
console.log("renderList", renderList);
|
|
117
118
|
const isService = (0, import_react.useMemo)(() => {
|
|
118
119
|
return state.service.value.length > 0;
|
|
119
120
|
}, [state.service.value]);
|
|
@@ -128,15 +129,29 @@ var Info = () => {
|
|
|
128
129
|
const showAddButton = (0, import_react.useMemo)(() => {
|
|
129
130
|
return !state.disabledEdit && !state.channelDisabledEdit;
|
|
130
131
|
}, [state.disabledEdit, state.channelDisabledEdit]);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
132
|
+
const addButton = (0, import_react.useMemo)(() => {
|
|
133
|
+
if (state.renderType === "eventBooking") {
|
|
134
|
+
return isService ? /* @__PURE__ */ import_react.default.createElement("div", { style: { height: 20 } }) : /* @__PURE__ */ import_react.default.createElement(
|
|
135
|
+
import_addButton.default,
|
|
136
|
+
{
|
|
137
|
+
showSub: false,
|
|
138
|
+
title: import_utils2.locales.getText("pisell2.text.add-a-service"),
|
|
139
|
+
subTitle: import_utils2.locales.getText("pisell2.text.add-another-service"),
|
|
140
|
+
onClick: handleSelectService
|
|
141
|
+
}
|
|
142
|
+
);
|
|
138
143
|
}
|
|
139
|
-
|
|
144
|
+
return showAddButton ? /* @__PURE__ */ import_react.default.createElement(
|
|
145
|
+
import_addButton.default,
|
|
146
|
+
{
|
|
147
|
+
showSub: isService,
|
|
148
|
+
title: import_utils2.locales.getText("pisell2.text.add-a-service"),
|
|
149
|
+
subTitle: import_utils2.locales.getText("pisell2.text.add-another-service"),
|
|
150
|
+
onClick: handleSelectService
|
|
151
|
+
}
|
|
152
|
+
) : /* @__PURE__ */ import_react.default.createElement("div", { style: { height: 20 } });
|
|
153
|
+
}, [state.renderType, showAddButton, isService, state.service.value]);
|
|
154
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, addButton, /* @__PURE__ */ import_react.default.createElement(
|
|
140
155
|
import_drawer.default,
|
|
141
156
|
{
|
|
142
157
|
open: state.service.addModal,
|
|
@@ -277,7 +277,9 @@ var Info = () => {
|
|
|
277
277
|
if (state.service.editModal) {
|
|
278
278
|
let cacheItem = state.service.cacheItem;
|
|
279
279
|
form.setFieldsValue((0, import_utils2.getServerItemExtend)(state, cacheItem, timeObj));
|
|
280
|
-
|
|
280
|
+
if (state.renderType !== "eventBooking") {
|
|
281
|
+
getResources();
|
|
282
|
+
}
|
|
281
283
|
} else {
|
|
282
284
|
form.resetFields();
|
|
283
285
|
}
|
|
@@ -292,10 +294,10 @@ var Info = () => {
|
|
|
292
294
|
return (0, import_utils2.getErrorList)(currentResource, getCurrentCacheItem());
|
|
293
295
|
}, [currentResource, useDuration, useStartTime]);
|
|
294
296
|
(0, import_ahooks.useUpdateEffect)(() => {
|
|
295
|
-
if (useStartTime && useDuration) {
|
|
297
|
+
if (useStartTime && useDuration && state.renderType !== "eventBooking") {
|
|
296
298
|
getResources();
|
|
297
299
|
}
|
|
298
|
-
}, [useStartTime, useDuration]);
|
|
300
|
+
}, [useStartTime, useDuration, state.renderType]);
|
|
299
301
|
(0, import_react.useEffect)(() => {
|
|
300
302
|
setEditData();
|
|
301
303
|
}, [state.service.editModal, setEditData]);
|
|
@@ -398,7 +400,7 @@ var Info = () => {
|
|
|
398
400
|
name: "discount_reason"
|
|
399
401
|
},
|
|
400
402
|
/* @__PURE__ */ import_react.default.createElement(import_antd.Input.TextArea, { size: "large" })
|
|
401
|
-
)) : null, /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 12 }, /* @__PURE__ */ import_react.default.createElement(
|
|
403
|
+
)) : null, state.renderType !== "eventBooking" && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 12 }, /* @__PURE__ */ import_react.default.createElement(
|
|
402
404
|
import_antd.Form.Item,
|
|
403
405
|
{
|
|
404
406
|
label: import_utils.locales.getText("pisell2.text.start_time"),
|
|
@@ -463,7 +465,7 @@ var Info = () => {
|
|
|
463
465
|
)
|
|
464
466
|
)
|
|
465
467
|
))
|
|
466
|
-
)), /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { hidden: true, name: "quantity" }, /* @__PURE__ */ import_react.default.createElement(import_antd.InputNumber, null)), /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { hidden: true, name: "like_status" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Input, null)))), errorList.map((d, i) => {
|
|
468
|
+
)), /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { hidden: true, name: "quantity" }, /* @__PURE__ */ import_react.default.createElement(import_antd.InputNumber, null)), /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { hidden: true, name: "like_status" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Input, null))))), state.renderType !== "eventBooking" && errorList.map((d, i) => {
|
|
467
469
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
468
470
|
import_antd.Alert,
|
|
469
471
|
{
|