@pisell/private-materials 3.0.57 → 3.0.59
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 +8 -8
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +2 -1
- package/es/components/ruleSetting/index.js +3 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.js +33 -11
- package/es/components/schedules/schedules/index.js +3 -2
- package/es/components/taxSelect/index.d.ts +12 -0
- package/es/components/taxSelect/index.js +141 -0
- package/es/components/taxSelect/index.less +12 -0
- package/es/components/taxSelect/locales.d.ts +24 -0
- package/es/components/taxSelect/locales.js +23 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +5 -2
- package/lib/components/ruleSetting/index.js +3 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.js +39 -14
- package/lib/components/schedules/schedules/index.js +2 -2
- package/lib/components/taxSelect/index.d.ts +12 -0
- package/lib/components/taxSelect/index.js +161 -0
- package/lib/components/taxSelect/index.less +12 -0
- package/lib/components/taxSelect/locales.d.ts +24 -0
- package/lib/components/taxSelect/locales.js +47 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +5 -2
- package/lowcode/tax-select/meta.ts +107 -0
- package/package.json +1 -1
package/es/components/index.d.ts
CHANGED
|
@@ -7,4 +7,5 @@ import BookingForms from './booking/forms';
|
|
|
7
7
|
import Schedules from './schedules';
|
|
8
8
|
import ProductExtension from './productExtension';
|
|
9
9
|
import RuleSetting from './ruleSetting';
|
|
10
|
-
|
|
10
|
+
import TaxSelect from './taxSelect';
|
|
11
|
+
export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect };
|
package/es/components/index.js
CHANGED
|
@@ -7,4 +7,5 @@ import BookingForms from "./booking/forms";
|
|
|
7
7
|
import Schedules from "./schedules";
|
|
8
8
|
import ProductExtension from "./productExtension";
|
|
9
9
|
import RuleSetting from "./ruleSetting";
|
|
10
|
-
|
|
10
|
+
import TaxSelect from "./taxSelect";
|
|
11
|
+
export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect };
|
|
@@ -166,7 +166,9 @@ var RuleSetting = function RuleSetting(props) {
|
|
|
166
166
|
flex: 1
|
|
167
167
|
},
|
|
168
168
|
size: "large",
|
|
169
|
-
mode: "multiple"
|
|
169
|
+
mode: "multiple",
|
|
170
|
+
filterOption: false,
|
|
171
|
+
showSearch: false
|
|
170
172
|
}
|
|
171
173
|
};
|
|
172
174
|
}, [staffs, salesChannels, orderTypes, paymentMethods]);
|
|
@@ -25,14 +25,15 @@ import useComponents from "../../../../../../../hooks/useComponents";
|
|
|
25
25
|
import useEngineContext from "../../../../../../../hooks/useEngineContext";
|
|
26
26
|
import "./index.less";
|
|
27
27
|
var AddSchedules = function AddSchedules(_ref) {
|
|
28
|
-
var _state$
|
|
28
|
+
var _state$schedules3;
|
|
29
29
|
var value = _ref.value,
|
|
30
30
|
onChange = _ref.onChange,
|
|
31
31
|
drawerContainer = _ref.drawerContainer,
|
|
32
32
|
isSelf = _ref.isSelf;
|
|
33
33
|
var modalRef = useRef(null);
|
|
34
34
|
var _useContext = useContext(Context),
|
|
35
|
-
state = _useContext.state
|
|
35
|
+
state = _useContext.state,
|
|
36
|
+
dispatch = _useContext.dispatch;
|
|
36
37
|
var _useEngineContext = useEngineContext(),
|
|
37
38
|
appHelper = _useEngineContext.appHelper;
|
|
38
39
|
var createSchedules = useRef();
|
|
@@ -48,8 +49,8 @@ var AddSchedules = function AddSchedules(_ref) {
|
|
|
48
49
|
onSuccess: function onSuccess(res) {}
|
|
49
50
|
});
|
|
50
51
|
var onFinish = function onFinish(e) {
|
|
51
|
-
var _getScheduleList
|
|
52
|
-
var idMap = (
|
|
52
|
+
var scheduleList = isSelf ? _getScheduleList === null || _getScheduleList === void 0 ? void 0 : _getScheduleList.data : state.schedules.list;
|
|
53
|
+
var idMap = (scheduleList === null || scheduleList === void 0 ? void 0 : scheduleList.reduce(function (p, c) {
|
|
53
54
|
return _objectSpread(_objectSpread({}, p), {}, _defineProperty({}, c.id, c));
|
|
54
55
|
}, {})) || {};
|
|
55
56
|
onChange(e.map(function (item) {
|
|
@@ -63,9 +64,19 @@ var AddSchedules = function AddSchedules(_ref) {
|
|
|
63
64
|
});
|
|
64
65
|
};
|
|
65
66
|
var handleAddSchedule = function handleAddSchedule(data) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
if (isSelf) {
|
|
68
|
+
_getScheduleList.mutate(function (oldData) {
|
|
69
|
+
return [data].concat(_toConsumableArray(oldData || []));
|
|
70
|
+
});
|
|
71
|
+
} else {
|
|
72
|
+
var _state$schedules;
|
|
73
|
+
dispatch({
|
|
74
|
+
type: "setSchedules",
|
|
75
|
+
payload: _objectSpread(_objectSpread({}, state.schedules), {}, {
|
|
76
|
+
list: [data].concat(_toConsumableArray((state === null || state === void 0 ? void 0 : (_state$schedules = state.schedules) === null || _state$schedules === void 0 ? void 0 : _state$schedules.list) || []))
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
}
|
|
69
80
|
modalRef.current.setValue(function (v) {
|
|
70
81
|
return [].concat(_toConsumableArray(v), [data]);
|
|
71
82
|
});
|
|
@@ -85,7 +96,7 @@ var AddSchedules = function AddSchedules(_ref) {
|
|
|
85
96
|
});
|
|
86
97
|
};
|
|
87
98
|
var handleChangeResData = function handleChangeResData(data) {
|
|
88
|
-
|
|
99
|
+
var updateOldData = function updateOldData(oldData) {
|
|
89
100
|
return (oldData || []).map(function (item) {
|
|
90
101
|
if (item.id === data.id) {
|
|
91
102
|
var _appHelper$utils;
|
|
@@ -95,7 +106,18 @@ var AddSchedules = function AddSchedules(_ref) {
|
|
|
95
106
|
}
|
|
96
107
|
return item;
|
|
97
108
|
});
|
|
98
|
-
}
|
|
109
|
+
};
|
|
110
|
+
if (isSelf) {
|
|
111
|
+
_getScheduleList.mutate(updateOldData);
|
|
112
|
+
} else {
|
|
113
|
+
var _state$schedules2;
|
|
114
|
+
dispatch({
|
|
115
|
+
type: "setSchedules",
|
|
116
|
+
payload: _objectSpread(_objectSpread({}, state.schedules), {}, {
|
|
117
|
+
list: updateOldData(state === null || state === void 0 ? void 0 : (_state$schedules2 = state.schedules) === null || _state$schedules2 === void 0 ? void 0 : _state$schedules2.list)
|
|
118
|
+
})
|
|
119
|
+
});
|
|
120
|
+
}
|
|
99
121
|
};
|
|
100
122
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
101
123
|
ghost: true,
|
|
@@ -114,7 +136,7 @@ var AddSchedules = function AddSchedules(_ref) {
|
|
|
114
136
|
}, locales.getText("pisell2.text.schedules.assign-schedule")), /*#__PURE__*/React.createElement(CustomSelect, {
|
|
115
137
|
ref: modalRef,
|
|
116
138
|
rowKey: "id",
|
|
117
|
-
options: isSelf ? _getScheduleList.data || [] : (state === null || state === void 0 ? void 0 : (_state$
|
|
139
|
+
options: isSelf ? _getScheduleList.data || [] : (state === null || state === void 0 ? void 0 : (_state$schedules3 = state.schedules) === null || _state$schedules3 === void 0 ? void 0 : _state$schedules3.list) || [],
|
|
118
140
|
createItemText: locales.getText('pisell2.text.schedules.create-new-schedule'),
|
|
119
141
|
loading: _getScheduleList.loading,
|
|
120
142
|
value: value,
|
|
@@ -124,7 +146,7 @@ var AddSchedules = function AddSchedules(_ref) {
|
|
|
124
146
|
drawerProps: _objectSpread({
|
|
125
147
|
title: locales.getText("pisell2.text.schedules.assign-schedule"),
|
|
126
148
|
destroyOnClose: true,
|
|
127
|
-
width:
|
|
149
|
+
width: 480,
|
|
128
150
|
getContainer: drawerContainer || document.querySelector(".pisell-lowcode__schedules-component-products") || document.body,
|
|
129
151
|
rootStyle: {
|
|
130
152
|
position: "absolute"
|
|
@@ -32,7 +32,8 @@ var SchedulesConnect = function SchedulesConnect() {
|
|
|
32
32
|
schedules = state.schedules;
|
|
33
33
|
var _ref = schedules || {},
|
|
34
34
|
scheduleAllMap = _ref.scheduleAllMap,
|
|
35
|
-
scheduleMap = _ref.scheduleMap
|
|
35
|
+
scheduleMap = _ref.scheduleMap,
|
|
36
|
+
list = _ref.list;
|
|
36
37
|
var _ref2 = currentSelectDayDetail || {},
|
|
37
38
|
date = _ref2.date,
|
|
38
39
|
scheduleIds = _ref2.scheduleIds;
|
|
@@ -187,7 +188,7 @@ var SchedulesConnect = function SchedulesConnect() {
|
|
|
187
188
|
}, /*#__PURE__*/React.createElement(Schedules, {
|
|
188
189
|
loading: loading,
|
|
189
190
|
scheduleMap: scheduleMap,
|
|
190
|
-
dataSource:
|
|
191
|
+
dataSource: list,
|
|
191
192
|
type: currentSelectDayDetail ? "forADay" : "all",
|
|
192
193
|
currentSelectDayDetail: currentSelectDayDetail,
|
|
193
194
|
detail: schedulesDetail,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SelectProps } from "antd";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import "./index.less";
|
|
4
|
+
interface TaxSelectProps {
|
|
5
|
+
selectProps?: SelectProps;
|
|
6
|
+
value: string;
|
|
7
|
+
tax_rate?: string;
|
|
8
|
+
tax_title?: string;
|
|
9
|
+
onChange: (value: string) => void;
|
|
10
|
+
}
|
|
11
|
+
declare const TaxSelect: (props: TaxSelectProps) => React.JSX.Element;
|
|
12
|
+
export default TaxSelect;
|
|
@@ -0,0 +1,141 @@
|
|
|
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 { Select, Modal, Form, Button, InputNumber } from "antd";
|
|
9
|
+
import React, { useState, useMemo, useEffect, useRef } from "react";
|
|
10
|
+
import useEngineContext from "../../hooks/useEngineContext";
|
|
11
|
+
import { locales } from "@pisell/utils";
|
|
12
|
+
import localeTexts from "./locales";
|
|
13
|
+
import "./index.less";
|
|
14
|
+
var TaxSelect = function TaxSelect(props) {
|
|
15
|
+
var value = props.value,
|
|
16
|
+
onChange = props.onChange,
|
|
17
|
+
selectProps = props.selectProps,
|
|
18
|
+
_props$tax_rate = props.tax_rate,
|
|
19
|
+
tax_rate = _props$tax_rate === void 0 ? 10 : _props$tax_rate,
|
|
20
|
+
_props$tax_title = props.tax_title,
|
|
21
|
+
tax_title = _props$tax_title === void 0 ? "Tax" : _props$tax_title;
|
|
22
|
+
var inputNumberRef = useRef();
|
|
23
|
+
var _Form$useForm = Form.useForm(),
|
|
24
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
25
|
+
form = _Form$useForm2[0];
|
|
26
|
+
var _useState = useState(false),
|
|
27
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
28
|
+
open = _useState2[0],
|
|
29
|
+
setOpen = _useState2[1];
|
|
30
|
+
var context = useEngineContext();
|
|
31
|
+
var useTax = Form.useWatch("tax", form);
|
|
32
|
+
locales.init(localeTexts, localStorage.getItem("umi_locale") || "en");
|
|
33
|
+
useEffect(function () {
|
|
34
|
+
document.body.id = "body";
|
|
35
|
+
}, []);
|
|
36
|
+
var options = useMemo(function () {
|
|
37
|
+
var isEn = localStorage.getItem("umi_locale") === "en-US";
|
|
38
|
+
var taxOptions = [{
|
|
39
|
+
value: 0,
|
|
40
|
+
label: (isEn ? tax_title : "") + locales.getText("pisell2.text.tax-free")
|
|
41
|
+
}, {
|
|
42
|
+
value: tax_rate,
|
|
43
|
+
label: tax_rate + "%"
|
|
44
|
+
}, {
|
|
45
|
+
value: "custom",
|
|
46
|
+
label: locales.getText("pisell2.text.custom")
|
|
47
|
+
}];
|
|
48
|
+
return taxOptions;
|
|
49
|
+
}, []);
|
|
50
|
+
var _onChange = function _onChange(val) {
|
|
51
|
+
if (val === "custom") {
|
|
52
|
+
setOpen(true);
|
|
53
|
+
setTimeout(function () {
|
|
54
|
+
var _inputNumberRef$curre, _inputNumberRef$curre2;
|
|
55
|
+
form.setFieldsValue({
|
|
56
|
+
tax: value || tax_rate
|
|
57
|
+
});
|
|
58
|
+
(_inputNumberRef$curre = (_inputNumberRef$curre2 = inputNumberRef.current).focus) === null || _inputNumberRef$curre === void 0 ? void 0 : _inputNumberRef$curre.call(_inputNumberRef$curre2);
|
|
59
|
+
}, 10);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(val);
|
|
63
|
+
};
|
|
64
|
+
var _value = useMemo(function () {
|
|
65
|
+
if (value === undefined || value === null) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (options.some(function (d) {
|
|
69
|
+
return d.value === value;
|
|
70
|
+
})) {
|
|
71
|
+
return value;
|
|
72
|
+
}
|
|
73
|
+
return "".concat(locales.getText("pisell2.text.custom"), " (").concat(value, "%)");
|
|
74
|
+
}, [value]);
|
|
75
|
+
var onCancel = function onCancel() {
|
|
76
|
+
form.resetFields();
|
|
77
|
+
setOpen(false);
|
|
78
|
+
};
|
|
79
|
+
var onFinish = function onFinish(values) {
|
|
80
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(values.tax);
|
|
81
|
+
onCancel();
|
|
82
|
+
};
|
|
83
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Select, _extends({
|
|
84
|
+
options: options,
|
|
85
|
+
size: "large",
|
|
86
|
+
value: _value,
|
|
87
|
+
onChange: _onChange,
|
|
88
|
+
style: {
|
|
89
|
+
width: "100%"
|
|
90
|
+
},
|
|
91
|
+
placeholder: locales.getText("pisell2.text.please-enter")
|
|
92
|
+
}, selectProps)), /*#__PURE__*/React.createElement(Modal, {
|
|
93
|
+
open: open,
|
|
94
|
+
title: "".concat(locales.getText("pisell2.text.custom"), " ").concat(tax_title),
|
|
95
|
+
footer: null,
|
|
96
|
+
onCancel: onCancel
|
|
97
|
+
}, /*#__PURE__*/React.createElement(Form, {
|
|
98
|
+
form: form,
|
|
99
|
+
layout: "vertical",
|
|
100
|
+
onFinish: onFinish
|
|
101
|
+
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
102
|
+
label: tax_title,
|
|
103
|
+
name: "tax",
|
|
104
|
+
required: true
|
|
105
|
+
}, /*#__PURE__*/React.createElement(InputNumber, {
|
|
106
|
+
ref: inputNumberRef,
|
|
107
|
+
size: "large",
|
|
108
|
+
min: 0,
|
|
109
|
+
max: 100,
|
|
110
|
+
type: "number",
|
|
111
|
+
addonAfter: "%",
|
|
112
|
+
style: {
|
|
113
|
+
width: "100%"
|
|
114
|
+
}
|
|
115
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
116
|
+
className: "tax-select-footer"
|
|
117
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
118
|
+
onClick: onCancel,
|
|
119
|
+
className: "tax-select-footer-item",
|
|
120
|
+
size: "large"
|
|
121
|
+
}, locales.getText("pisell2.text.cancel")), /*#__PURE__*/React.createElement(Button, {
|
|
122
|
+
type: "primary",
|
|
123
|
+
className: "tax-select-footer-item",
|
|
124
|
+
size: "large",
|
|
125
|
+
disabled: !useTax,
|
|
126
|
+
onClick: function onClick() {
|
|
127
|
+
form.submit();
|
|
128
|
+
}
|
|
129
|
+
}, locales.getText("pisell2.text.confirm")))));
|
|
130
|
+
};
|
|
131
|
+
var Test = function Test() {
|
|
132
|
+
var _useState3 = useState(),
|
|
133
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
134
|
+
value = _useState4[0],
|
|
135
|
+
setValue = _useState4[1];
|
|
136
|
+
return /*#__PURE__*/React.createElement(TaxSelect, {
|
|
137
|
+
value: value,
|
|
138
|
+
onChange: setValue
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
export default TaxSelect;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
en: {
|
|
3
|
+
'pisell2.text.tax-free': string;
|
|
4
|
+
'pisell2.text.custom': string;
|
|
5
|
+
'pisell2.text.cancel': string;
|
|
6
|
+
'pisell2.text.confirm': string;
|
|
7
|
+
'pisell2.text.please-enter': string;
|
|
8
|
+
};
|
|
9
|
+
'zh-CN': {
|
|
10
|
+
'pisell2.text.tax-free': string;
|
|
11
|
+
'pisell2.text.custom': string;
|
|
12
|
+
'pisell2.text.cancel': string;
|
|
13
|
+
'pisell2.text.confirm': string;
|
|
14
|
+
'pisell2.text.please-enter': string;
|
|
15
|
+
};
|
|
16
|
+
'zh-HK': {
|
|
17
|
+
'pisell2.text.tax-free': string;
|
|
18
|
+
'pisell2.text.custom': string;
|
|
19
|
+
'pisell2.text.cancel': string;
|
|
20
|
+
'pisell2.text.confirm': string;
|
|
21
|
+
'pisell2.text.please-enter': string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"en": {
|
|
3
|
+
'pisell2.text.tax-free': ' free',
|
|
4
|
+
'pisell2.text.custom': 'Custom',
|
|
5
|
+
'pisell2.text.cancel': 'Cancel',
|
|
6
|
+
'pisell2.text.confirm': 'Confirm',
|
|
7
|
+
'pisell2.text.please-enter': 'Please enter'
|
|
8
|
+
},
|
|
9
|
+
'zh-CN': {
|
|
10
|
+
'pisell2.text.tax-free': '免税',
|
|
11
|
+
'pisell2.text.custom': '自定义',
|
|
12
|
+
'pisell2.text.cancel': '取消',
|
|
13
|
+
'pisell2.text.confirm': '确认',
|
|
14
|
+
'pisell2.text.please-enter': '请输入'
|
|
15
|
+
},
|
|
16
|
+
'zh-HK': {
|
|
17
|
+
'pisell2.text.tax-free': '免稅',
|
|
18
|
+
'pisell2.text.custom': '自定義',
|
|
19
|
+
'pisell2.text.cancel': '取消',
|
|
20
|
+
'pisell2.text.confirm': '確認',
|
|
21
|
+
'pisell2.text.please-enter': '請輸入'
|
|
22
|
+
}
|
|
23
|
+
};
|
package/es/index.d.ts
CHANGED
|
@@ -14,3 +14,4 @@ export { default as BookingContacts } from './components/booking/materiels/conta
|
|
|
14
14
|
export { default as ProductExtension } from './components/productExtension';
|
|
15
15
|
export { default as BookingDeposit } from './components/booking/deposit';
|
|
16
16
|
export { default as RuleSetting } from './components/ruleSetting';
|
|
17
|
+
export { default as TaxSelect } from './components/taxSelect';
|
package/es/index.js
CHANGED
|
@@ -17,4 +17,5 @@ export { default as BookingDuration } from "./components/booking/materiels/durat
|
|
|
17
17
|
export { default as BookingContacts } from "./components/booking/materiels/contacts";
|
|
18
18
|
export { default as ProductExtension } from "./components/productExtension";
|
|
19
19
|
export { default as BookingDeposit } from "./components/booking/deposit";
|
|
20
|
-
export { default as RuleSetting } from "./components/ruleSetting";
|
|
20
|
+
export { default as RuleSetting } from "./components/ruleSetting";
|
|
21
|
+
export { default as TaxSelect } from "./components/taxSelect";
|
|
@@ -7,4 +7,5 @@ import BookingForms from './booking/forms';
|
|
|
7
7
|
import Schedules from './schedules';
|
|
8
8
|
import ProductExtension from './productExtension';
|
|
9
9
|
import RuleSetting from './ruleSetting';
|
|
10
|
-
|
|
10
|
+
import TaxSelect from './taxSelect';
|
|
11
|
+
export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect };
|
package/lib/components/index.js
CHANGED
|
@@ -37,7 +37,8 @@ __export(components_exports, {
|
|
|
37
37
|
Login: () => import_login.default,
|
|
38
38
|
ProductExtension: () => import_productExtension.default,
|
|
39
39
|
RuleSetting: () => import_ruleSetting.default,
|
|
40
|
-
Schedules: () => import_schedules.default
|
|
40
|
+
Schedules: () => import_schedules.default,
|
|
41
|
+
TaxSelect: () => import_taxSelect.default
|
|
41
42
|
});
|
|
42
43
|
module.exports = __toCommonJS(components_exports);
|
|
43
44
|
var import_login = __toESM(require("./login"));
|
|
@@ -49,6 +50,7 @@ var import_forms = __toESM(require("./booking/forms"));
|
|
|
49
50
|
var import_schedules = __toESM(require("./schedules"));
|
|
50
51
|
var import_productExtension = __toESM(require("./productExtension"));
|
|
51
52
|
var import_ruleSetting = __toESM(require("./ruleSetting"));
|
|
53
|
+
var import_taxSelect = __toESM(require("./taxSelect"));
|
|
52
54
|
// Annotate the CommonJS export names for ESM import in node:
|
|
53
55
|
0 && (module.exports = {
|
|
54
56
|
Booking,
|
|
@@ -59,5 +61,6 @@ var import_ruleSetting = __toESM(require("./ruleSetting"));
|
|
|
59
61
|
Login,
|
|
60
62
|
ProductExtension,
|
|
61
63
|
RuleSetting,
|
|
62
|
-
Schedules
|
|
64
|
+
Schedules,
|
|
65
|
+
TaxSelect
|
|
63
66
|
});
|
|
@@ -158,7 +158,9 @@ var RuleSetting = (props) => {
|
|
|
158
158
|
key: "options",
|
|
159
159
|
style: { flex: 1 },
|
|
160
160
|
size: "large",
|
|
161
|
-
mode: "multiple"
|
|
161
|
+
mode: "multiple",
|
|
162
|
+
filterOption: false,
|
|
163
|
+
showSearch: false
|
|
162
164
|
}
|
|
163
165
|
};
|
|
164
166
|
}, [staffs, salesChannels, orderTypes, paymentMethods]);
|
|
@@ -45,7 +45,7 @@ var import_index = require("./index.less");
|
|
|
45
45
|
var AddSchedules = ({ value, onChange, drawerContainer, isSelf }) => {
|
|
46
46
|
var _a;
|
|
47
47
|
const modalRef = (0, import_react.useRef)(null);
|
|
48
|
-
const { state } = (0, import_react.useContext)(import_model.Context);
|
|
48
|
+
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
49
49
|
const { appHelper } = (0, import_useEngineContext.default)();
|
|
50
50
|
const createSchedules = (0, import_react.useRef)();
|
|
51
51
|
const AllCreateScheduleRef = (0, import_react.useRef)(null);
|
|
@@ -58,8 +58,8 @@ var AddSchedules = ({ value, onChange, drawerContainer, isSelf }) => {
|
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
const onFinish = (e) => {
|
|
61
|
-
|
|
62
|
-
const idMap = (
|
|
61
|
+
const scheduleList = isSelf ? _getScheduleList == null ? void 0 : _getScheduleList.data : state.schedules.list;
|
|
62
|
+
const idMap = (scheduleList == null ? void 0 : scheduleList.reduce((p, c) => {
|
|
63
63
|
return { ...p, [c.id]: c };
|
|
64
64
|
}, {})) || {};
|
|
65
65
|
onChange(e.map((item) => idMap[item.id]));
|
|
@@ -71,11 +71,22 @@ var AddSchedules = ({ value, onChange, drawerContainer, isSelf }) => {
|
|
|
71
71
|
});
|
|
72
72
|
};
|
|
73
73
|
const handleAddSchedule = (data) => {
|
|
74
|
-
|
|
74
|
+
var _a2;
|
|
75
|
+
if (isSelf) {
|
|
76
|
+
_getScheduleList.mutate((oldData) => [data, ...oldData || []]);
|
|
77
|
+
} else {
|
|
78
|
+
dispatch({
|
|
79
|
+
type: "setSchedules",
|
|
80
|
+
payload: {
|
|
81
|
+
...state.schedules,
|
|
82
|
+
list: [data, ...((_a2 = state == null ? void 0 : state.schedules) == null ? void 0 : _a2.list) || []]
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
75
86
|
modalRef.current.setValue((v) => [...v, data]);
|
|
76
87
|
setTimeout(() => {
|
|
77
|
-
var
|
|
78
|
-
(_b = (
|
|
88
|
+
var _a3, _b;
|
|
89
|
+
(_b = (_a3 = document.getElementById(data.id)) == null ? void 0 : _a3.scrollIntoView) == null ? void 0 : _b.call(_a3, { block: "center", behavior: "smooth" });
|
|
79
90
|
});
|
|
80
91
|
};
|
|
81
92
|
const handleEdit = (e, id) => {
|
|
@@ -84,13 +95,27 @@ var AddSchedules = ({ value, onChange, drawerContainer, isSelf }) => {
|
|
|
84
95
|
(_b = (_a2 = AllCreateScheduleRef.current) == null ? void 0 : _a2.open) == null ? void 0 : _b.call(_a2, { id });
|
|
85
96
|
};
|
|
86
97
|
const handleChangeResData = (data) => {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
98
|
+
var _a2;
|
|
99
|
+
const updateOldData = (oldData) => {
|
|
100
|
+
return (oldData || []).map((item) => {
|
|
101
|
+
var _a3;
|
|
102
|
+
if (item.id === data.id) {
|
|
103
|
+
return { ...data, name: ((_a3 = appHelper == null ? void 0 : appHelper.utils) == null ? void 0 : _a3.translationShop(data.name)) || data.name };
|
|
104
|
+
}
|
|
105
|
+
return item;
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
if (isSelf) {
|
|
109
|
+
_getScheduleList.mutate(updateOldData);
|
|
110
|
+
} else {
|
|
111
|
+
dispatch({
|
|
112
|
+
type: "setSchedules",
|
|
113
|
+
payload: {
|
|
114
|
+
...state.schedules,
|
|
115
|
+
list: updateOldData((_a2 = state == null ? void 0 : state.schedules) == null ? void 0 : _a2.list)
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
94
119
|
};
|
|
95
120
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
96
121
|
import_antd.Button,
|
|
@@ -122,7 +147,7 @@ var AddSchedules = ({ value, onChange, drawerContainer, isSelf }) => {
|
|
|
122
147
|
drawerProps: {
|
|
123
148
|
title: import_utils.locales.getText("pisell2.text.schedules.assign-schedule"),
|
|
124
149
|
destroyOnClose: true,
|
|
125
|
-
width:
|
|
150
|
+
width: 480,
|
|
126
151
|
getContainer: drawerContainer || document.querySelector(
|
|
127
152
|
".pisell-lowcode__schedules-component-products"
|
|
128
153
|
) || document.body,
|
|
@@ -46,7 +46,7 @@ var import_utils2 = require("./utils");
|
|
|
46
46
|
var SchedulesConnect = () => {
|
|
47
47
|
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
48
48
|
const { schedulesDetail, currentSelectDayDetail, products, schedules } = state;
|
|
49
|
-
const { scheduleAllMap, scheduleMap } = schedules || {};
|
|
49
|
+
const { scheduleAllMap, scheduleMap, list } = schedules || {};
|
|
50
50
|
const { date, scheduleIds } = currentSelectDayDetail || {};
|
|
51
51
|
const { currentProduct } = products || {};
|
|
52
52
|
const isProductSchedule = currentProduct && currentSelectDayDetail;
|
|
@@ -203,7 +203,7 @@ var SchedulesConnect = () => {
|
|
|
203
203
|
{
|
|
204
204
|
loading,
|
|
205
205
|
scheduleMap,
|
|
206
|
-
dataSource,
|
|
206
|
+
dataSource: list,
|
|
207
207
|
type: currentSelectDayDetail ? "forADay" : "all",
|
|
208
208
|
currentSelectDayDetail,
|
|
209
209
|
detail: schedulesDetail,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SelectProps } from "antd";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import "./index.less";
|
|
4
|
+
interface TaxSelectProps {
|
|
5
|
+
selectProps?: SelectProps;
|
|
6
|
+
value: string;
|
|
7
|
+
tax_rate?: string;
|
|
8
|
+
tax_title?: string;
|
|
9
|
+
onChange: (value: string) => void;
|
|
10
|
+
}
|
|
11
|
+
declare const TaxSelect: (props: TaxSelectProps) => React.JSX.Element;
|
|
12
|
+
export default TaxSelect;
|