@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.
- 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/addons/index.d.ts +1 -1
- package/es/components/booking/addons/model.d.ts +2 -1
- 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 +25 -23
- package/es/components/booking/components/footer/utils.js +4 -3
- package/es/components/booking/forms/forms.d.ts +1 -1
- package/es/components/booking/forms/forms.js +2 -1
- package/es/components/booking/forms/index.d.ts +1 -1
- package/es/components/booking/forms/model.d.ts +2 -1
- package/es/components/booking/index.d.ts +1 -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.d.ts +1 -1
- package/es/components/booking/info/index.js +23 -9
- package/es/components/booking/info/model.d.ts +2 -1
- package/es/components/booking/info/notes/index.d.ts +3 -0
- package/es/components/booking/info/notes/index.js +83 -0
- package/es/components/booking/info/pet/index.js +5 -7
- package/es/components/booking/info/service/addService/index.js +74 -15
- 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 +13 -1
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +2 -1
- package/es/components/booking/payments/index.d.ts +1 -1
- package/es/components/booking/payments/model.d.ts +2 -1
- 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/ProductItemPreview/index.d.ts +4 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +39 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.less +62 -0
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +10 -0
- package/es/components/productExtension/fields/SelectProducts/index.js +99 -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 +200 -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 +78 -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/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +2 -1
- 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/addons/index.d.ts +1 -1
- package/lib/components/booking/addons/model.d.ts +2 -1
- 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 +5 -3
- package/lib/components/booking/components/footer/utils.js +4 -2
- package/lib/components/booking/forms/forms.d.ts +1 -1
- package/lib/components/booking/forms/forms.js +1 -1
- package/lib/components/booking/forms/index.d.ts +1 -1
- package/lib/components/booking/forms/model.d.ts +2 -1
- package/lib/components/booking/index.d.ts +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.d.ts +1 -1
- package/lib/components/booking/info/index.js +27 -9
- package/lib/components/booking/info/model.d.ts +2 -1
- package/lib/components/booking/info/notes/index.d.ts +3 -0
- package/lib/components/booking/info/notes/index.js +111 -0
- package/lib/components/booking/info/pet/index.js +5 -7
- package/lib/components/booking/info/service/addService/index.js +65 -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 +13 -1
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +2 -1
- package/lib/components/booking/payments/index.d.ts +1 -1
- package/lib/components/booking/payments/model.d.ts +2 -1
- 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/ProductItemPreview/index.d.ts +4 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +79 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.less +62 -0
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +10 -0
- package/lib/components/productExtension/fields/SelectProducts/index.js +126 -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 +178 -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 +109 -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/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +2 -1
- 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 +3 -3
|
@@ -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 };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
3
4
|
state: FormState;
|
|
4
5
|
} & {
|
|
5
6
|
dispatch: (params: {
|
|
@@ -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
|
}
|
|
@@ -382,12 +384,12 @@ var Footer = (props) => {
|
|
|
382
384
|
if (!state.bookingDetail) {
|
|
383
385
|
return true;
|
|
384
386
|
}
|
|
385
|
-
if (!((_a2 = state.addons) == null ? void 0 : _a2.load)) {
|
|
387
|
+
if (!((_a2 = state.addons) == null ? void 0 : _a2.load) && state.renderType !== "eventBooking") {
|
|
386
388
|
return true;
|
|
387
389
|
}
|
|
388
390
|
}
|
|
389
391
|
return false;
|
|
390
|
-
}, [state.bookingId, state.bookingDetail, (_e = state.addons) == null ? void 0 : _e.load]);
|
|
392
|
+
}, [state.bookingId, state.bookingDetail, (_e = state.addons) == null ? void 0 : _e.load, state.renderType]);
|
|
391
393
|
return /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { title: false, round: true, loading: showFooter, active: true }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-footer-total" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-footer-left" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-footer-left-total" }, totalText), /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-footer-left-arrears" }, arrearsText)), /* @__PURE__ */ import_react.default.createElement(
|
|
392
394
|
"span",
|
|
393
395
|
{
|
|
@@ -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: [],
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
3
4
|
state: FormState;
|
|
4
5
|
} & {
|
|
5
6
|
dispatch: (params: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const Booking: (props: any) =>
|
|
1
|
+
declare const Booking: (props: any) => any;
|
|
2
2
|
export default Booking;
|
|
@@ -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;
|
|
@@ -46,6 +46,7 @@ var import_locales = __toESM(require("../locales"));
|
|
|
46
46
|
var import_utils = require("@pisell/utils");
|
|
47
47
|
var import_utils2 = require("../utils");
|
|
48
48
|
var import_date2 = require("./date");
|
|
49
|
+
var import_notes = __toESM(require("./notes"));
|
|
49
50
|
var import_index = require("./index.less");
|
|
50
51
|
var defaultModules = {
|
|
51
52
|
client: 1,
|
|
@@ -56,7 +57,7 @@ var defaultModules = {
|
|
|
56
57
|
};
|
|
57
58
|
import_utils.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
|
|
58
59
|
var Info = (0, import_model.Provider)((props) => {
|
|
59
|
-
var _a, _b, _c, _d, _e;
|
|
60
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
60
61
|
const { style, globalState, modules = defaultModules, slot } = props;
|
|
61
62
|
const modal = (0, import_react.useContext)(import_model.Context);
|
|
62
63
|
const params = (0, import_react.useMemo)(() => {
|
|
@@ -96,11 +97,34 @@ var Info = (0, import_model.Provider)((props) => {
|
|
|
96
97
|
}
|
|
97
98
|
});
|
|
98
99
|
};
|
|
100
|
+
const header = (0, import_react.useMemo)(() => {
|
|
101
|
+
if ((globalState == null ? void 0 : globalState.renderType) === "eventBooking") {
|
|
102
|
+
return import_utils.locales.getText("pisell2.text.enroll");
|
|
103
|
+
}
|
|
104
|
+
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");
|
|
105
|
+
}, [
|
|
106
|
+
globalState == null ? void 0 : globalState.bookingId,
|
|
107
|
+
modal.state,
|
|
108
|
+
modal.dispatch,
|
|
109
|
+
globalState == null ? void 0 : globalState.renderType
|
|
110
|
+
]);
|
|
111
|
+
const notes = (0, import_react.useMemo)(() => {
|
|
112
|
+
var _a2, _b2;
|
|
113
|
+
if (!modules.note) {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
return (globalState == null ? void 0 : globalState.bookingId) ? globalState.renderType === "eventBooking" ? /* @__PURE__ */ import_react.default.createElement(import_notes.default, null) : null : /* @__PURE__ */ import_react.default.createElement(import_addNote.default, { value: (_b2 = (_a2 = modal.state) == null ? void 0 : _a2.notes) == null ? void 0 : _b2.orderNote, onChange: addNote });
|
|
117
|
+
}, [
|
|
118
|
+
modules.note,
|
|
119
|
+
globalState == null ? void 0 : globalState.bookingId,
|
|
120
|
+
globalState.render,
|
|
121
|
+
(_f = (_e = modal.state) == null ? void 0 : _e.notes) == null ? void 0 : _f.orderNote
|
|
122
|
+
]);
|
|
99
123
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, !!modal.state.setGlobalState ? /* @__PURE__ */ import_react.default.createElement(
|
|
100
124
|
import_tabPane.default,
|
|
101
125
|
{
|
|
102
126
|
style,
|
|
103
|
-
header
|
|
127
|
+
header,
|
|
104
128
|
footer: /* @__PURE__ */ import_react.default.createElement(
|
|
105
129
|
import_footer.default,
|
|
106
130
|
{
|
|
@@ -111,13 +135,7 @@ var Info = (0, import_model.Provider)((props) => {
|
|
|
111
135
|
),
|
|
112
136
|
bodyClassName: "booking-info-warp"
|
|
113
137
|
},
|
|
114
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "booking-info" }, modules.client ? /* @__PURE__ */ import_react.default.createElement(import_client.default, null) : null, modules.holder && !((
|
|
115
|
-
import_addNote.default,
|
|
116
|
-
{
|
|
117
|
-
value: modal.state.notes.orderNote,
|
|
118
|
-
onChange: addNote
|
|
119
|
-
}
|
|
120
|
-
)) : null, slot ? slot : null)
|
|
138
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "booking-info" }, modules.client ? /* @__PURE__ */ import_react.default.createElement(import_client.default, null) : null, modules.holder && !((_g = modal.state) == null ? void 0 : _g.disabledEdit) ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, params.type === "form" ? /* @__PURE__ */ import_react.default.createElement(import_pet.default, null) : null) : null, modules.date ? /* @__PURE__ */ import_react.default.createElement(import_date.default, null) : null, modules.service ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, modal.state.date.value ? /* @__PURE__ */ import_react.default.createElement(import_service.default, null) : null) : null, notes, slot ? slot : null)
|
|
121
139
|
) : null);
|
|
122
140
|
});
|
|
123
141
|
var info_default = Info;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
3
|
export declare const walkInData: {
|
|
3
4
|
id: number;
|
|
4
5
|
nickname: string;
|
|
5
6
|
};
|
|
6
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
7
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
7
8
|
state: FormState;
|
|
8
9
|
} & {
|
|
9
10
|
dispatch: (params: {
|