@pisell/private-materials 3.0.54 → 3.0.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +7 -7
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +8 -8
  11. package/es/components/booking/components/footer/index.js +23 -16
  12. package/es/components/booking/deposit/DepositItem/index.js +1 -1
  13. package/es/components/booking/deposit/index.js +4 -1
  14. package/es/components/booking/locales.js +1 -1
  15. package/es/components/index.d.ts +2 -1
  16. package/es/components/index.js +2 -1
  17. package/es/components/listComponent/index.d.ts +15 -0
  18. package/es/components/listComponent/index.js +75 -0
  19. package/es/components/ruleSetting/index.d.ts +10 -0
  20. package/es/components/ruleSetting/index.js +335 -0
  21. package/es/components/ruleSetting/index.less +81 -0
  22. package/es/components/ruleSetting/locales.d.ts +48 -0
  23. package/es/components/ruleSetting/locales.js +47 -0
  24. package/es/components/ruleSetting/ruleBorder/index.d.ts +10 -0
  25. package/es/components/ruleSetting/ruleBorder/index.js +66 -0
  26. package/es/components/ruleSetting/ruleBorder/index.less +30 -0
  27. package/es/components/ruleSetting/server.d.ts +4 -0
  28. package/es/components/ruleSetting/server.js +149 -0
  29. package/es/index.d.ts +1 -0
  30. package/es/index.js +2 -1
  31. package/lib/components/booking/components/footer/index.js +8 -2
  32. package/lib/components/booking/deposit/DepositItem/index.js +1 -1
  33. package/lib/components/booking/deposit/index.js +4 -1
  34. package/lib/components/booking/locales.js +1 -1
  35. package/lib/components/index.d.ts +2 -1
  36. package/lib/components/index.js +3 -0
  37. package/lib/components/listComponent/index.d.ts +15 -0
  38. package/lib/components/listComponent/index.js +85 -0
  39. package/lib/components/ruleSetting/index.d.ts +10 -0
  40. package/lib/components/ruleSetting/index.js +379 -0
  41. package/lib/components/ruleSetting/index.less +81 -0
  42. package/lib/components/ruleSetting/locales.d.ts +48 -0
  43. package/lib/components/ruleSetting/locales.js +71 -0
  44. package/lib/components/ruleSetting/ruleBorder/index.d.ts +10 -0
  45. package/lib/components/ruleSetting/ruleBorder/index.js +89 -0
  46. package/lib/components/ruleSetting/ruleBorder/index.less +30 -0
  47. package/lib/components/ruleSetting/server.d.ts +4 -0
  48. package/lib/components/ruleSetting/server.js +107 -0
  49. package/lib/index.d.ts +1 -0
  50. package/lib/index.js +3 -0
  51. package/lowcode/rule-setting/meta.ts +74 -0
  52. package/package.json +1 -1
@@ -0,0 +1,81 @@
1
+ .rule-setting-wrap {
2
+ display: flex;
3
+ align-items: center;
4
+
5
+ .rule-setting-list {
6
+ flex: 1;
7
+
8
+ .rule-setting-item {
9
+ margin-bottom: 20px;
10
+ padding: 20px;
11
+ width: 100%;
12
+ background: #f9fafb;
13
+ border: 1px solid #ddd;
14
+ border-radius: 8px;
15
+
16
+ &:last-child {
17
+ margin-bottom: 0;
18
+ }
19
+
20
+ .rule-setting-item-header {
21
+ display: flex;
22
+ align-items: center;
23
+ justify-content: space-between;
24
+
25
+ .rule-setting-item-title {
26
+ font-size: 14px;
27
+ font-weight: 550;
28
+ }
29
+
30
+ .rule-setting-item-btns {
31
+ display: flex;
32
+ align-items: center;
33
+ justify-content: center;
34
+
35
+ .rule-setting-item-btn {
36
+ width: 40px;
37
+ height: 40px;
38
+ display: flex;
39
+ align-items: center;
40
+ justify-content: center;
41
+ cursor: pointer;
42
+ font-size: 16px;
43
+ }
44
+ }
45
+ }
46
+
47
+ .rule-setting-item-body {
48
+ margin-top: 10px;
49
+ display: flex;
50
+ align-items: center;
51
+
52
+ .rule-setting-item-body-list {
53
+ flex: 1;
54
+
55
+
56
+ .rule-setting-item-body-item {
57
+ display: flex;
58
+ align-items: center;
59
+ gap: 12px;
60
+ margin-bottom: 12px;
61
+
62
+ &:last-child {
63
+ margin-bottom: 0;
64
+ }
65
+ }
66
+ }
67
+
68
+ }
69
+ }
70
+ }
71
+ }
72
+
73
+ .rule-setting-add-button-wrap {
74
+ transition: all 0.2s ease;
75
+ padding-left: 0;
76
+ margin-top: 20px;
77
+
78
+ &.rule-setting-add-button-wrap-padding {
79
+ padding-left: 200px;
80
+ }
81
+ }
@@ -0,0 +1,48 @@
1
+ declare const _default: {
2
+ en: {
3
+ 'pisell2.text.satisfy_any_condition': string;
4
+ 'pisell2.text.add': string;
5
+ 'pisell2.text.and': string;
6
+ 'pisell2.text.or': string;
7
+ 'pisell2.text.all': string;
8
+ 'pisell2.text.rule-setting.Contain': string;
9
+ 'pisell2.text.rule-setting.Exclude': string;
10
+ 'pisell2.text.rule-setting.order_type': string;
11
+ 'pisell2.text.rule-setting.sales_channel': string;
12
+ 'pisell2.text.rule-setting.staff': string;
13
+ 'pisell2.text.rule-setting.payment_method': string;
14
+ 'pisell2.text.rule-setting.pisell_terminal_device': string;
15
+ 'pisell2.text.rule-setting.current_device': string;
16
+ };
17
+ 'zh-CN': {
18
+ 'pisell2.text.satisfy_any_condition': string;
19
+ 'pisell2.text.and': string;
20
+ 'pisell2.text.or': string;
21
+ 'pisell2.text.all': string;
22
+ 'pisell2.text.add': string;
23
+ 'pisell2.text.rule-setting.Contain': string;
24
+ 'pisell2.text.rule-setting.Exclude': string;
25
+ 'pisell2.text.rule-setting.order_type': string;
26
+ 'pisell2.text.rule-setting.sales_channel': string;
27
+ 'pisell2.text.rule-setting.staff': string;
28
+ 'pisell2.text.rule-setting.payment_method': string;
29
+ 'pisell2.text.rule-setting.pisell_terminal_device': string;
30
+ 'pisell2.text.rule-setting.current_device': string;
31
+ };
32
+ 'zh-HK': {
33
+ 'pisell2.text.satisfy_any_condition': string;
34
+ 'pisell2.text.and': string;
35
+ 'pisell2.text.or': string;
36
+ 'pisell2.text.all': string;
37
+ 'pisell2.text.add': string;
38
+ 'pisell2.text.rule-setting.Contain': string;
39
+ 'pisell2.text.rule-setting.Exclude': string;
40
+ 'pisell2.text.rule-setting.order_type': string;
41
+ 'pisell2.text.rule-setting.sales_channel': string;
42
+ 'pisell2.text.rule-setting.staff': string;
43
+ 'pisell2.text.rule-setting.payment_method': string;
44
+ 'pisell2.text.rule-setting.pisell_terminal_device': string;
45
+ 'pisell2.text.rule-setting.current_device': string;
46
+ };
47
+ };
48
+ export default _default;
@@ -0,0 +1,47 @@
1
+ export default {
2
+ "en": {
3
+ 'pisell2.text.satisfy_any_condition': 'Satisfy any condition',
4
+ 'pisell2.text.add': 'Add',
5
+ 'pisell2.text.and': 'And',
6
+ 'pisell2.text.or': 'Or',
7
+ 'pisell2.text.all': 'All',
8
+ 'pisell2.text.rule-setting.Contain': "Contain",
9
+ 'pisell2.text.rule-setting.Exclude': "Exclude",
10
+ 'pisell2.text.rule-setting.order_type': "Order type",
11
+ 'pisell2.text.rule-setting.sales_channel': "Operation platform",
12
+ 'pisell2.text.rule-setting.staff': "Staff",
13
+ 'pisell2.text.rule-setting.payment_method': "Payment method",
14
+ 'pisell2.text.rule-setting.pisell_terminal_device': "Pisell terminal device",
15
+ 'pisell2.text.rule-setting.current_device': "Current device"
16
+ },
17
+ 'zh-CN': {
18
+ 'pisell2.text.satisfy_any_condition': '满足任何条件',
19
+ 'pisell2.text.and': '并且',
20
+ 'pisell2.text.or': '或者',
21
+ 'pisell2.text.all': '全部',
22
+ 'pisell2.text.add': '添加',
23
+ 'pisell2.text.rule-setting.Contain': "包含",
24
+ 'pisell2.text.rule-setting.Exclude': "不包含",
25
+ 'pisell2.text.rule-setting.order_type': "订单类型",
26
+ 'pisell2.text.rule-setting.sales_channel': "操作平台",
27
+ 'pisell2.text.rule-setting.staff': "员工",
28
+ 'pisell2.text.rule-setting.payment_method': "支付方式",
29
+ 'pisell2.text.rule-setting.pisell_terminal_device': "Pisell终端",
30
+ 'pisell2.text.rule-setting.current_device': "当前设备"
31
+ },
32
+ 'zh-HK': {
33
+ 'pisell2.text.satisfy_any_condition': '滿足任何條件',
34
+ 'pisell2.text.and': '並且',
35
+ 'pisell2.text.or': '或者',
36
+ 'pisell2.text.all': '全部',
37
+ 'pisell2.text.add': '添加',
38
+ 'pisell2.text.rule-setting.Contain': "包含",
39
+ 'pisell2.text.rule-setting.Exclude': "不包含",
40
+ 'pisell2.text.rule-setting.order_type': "訂單類型",
41
+ 'pisell2.text.rule-setting.sales_channel': "操作平台",
42
+ 'pisell2.text.rule-setting.staff': "員工",
43
+ 'pisell2.text.rule-setting.payment_method': "支付方式",
44
+ 'pisell2.text.rule-setting.pisell_terminal_device': "Pisell終端",
45
+ 'pisell2.text.rule-setting.current_device': "當前設備"
46
+ }
47
+ };
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import "./index.less";
3
+ interface RuleSettingProps {
4
+ value: any;
5
+ onChange: (type: string) => void;
6
+ startDomClassName: string;
7
+ endDomClassName: string;
8
+ }
9
+ declare const RuleBorder: (props: RuleSettingProps) => React.JSX.Element;
10
+ export default RuleBorder;
@@ -0,0 +1,66 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ 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."); }
3
+ 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); }
4
+ 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; }
5
+ 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; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import React, { useState, useEffect } from "react";
8
+ import { Select } from "antd";
9
+ import { locales } from "@pisell/utils";
10
+ import "./index.less";
11
+ var RuleBorder = function RuleBorder(props) {
12
+ var startDomClassName = props.startDomClassName,
13
+ endDomClassName = props.endDomClassName,
14
+ value = props.value,
15
+ _onChange = props.onChange;
16
+ var _useState = useState({
17
+ top: "0px",
18
+ bottom: "0px"
19
+ }),
20
+ _useState2 = _slicedToArray(_useState, 2),
21
+ typePosition = _useState2[0],
22
+ setTypePosition = _useState2[1];
23
+ var includeOption = [{
24
+ label: locales.getText("pisell2.text.and"),
25
+ value: "and"
26
+ }, {
27
+ label: locales.getText("pisell2.text.or"),
28
+ value: "or"
29
+ }];
30
+ var getTypePosition = function getTypePosition(startDomClassName, endDomClassName) {
31
+ var startDom = document.querySelector(".".concat(startDomClassName));
32
+ var endDom = document.querySelector(".".concat(endDomClassName));
33
+ var startDomRect = startDom === null || startDom === void 0 ? void 0 : startDom.getBoundingClientRect();
34
+ var endDomRect = endDom === null || endDom === void 0 ? void 0 : endDom.getBoundingClientRect();
35
+ if (startDomRect && endDomRect) {
36
+ var startDomHeight = startDomRect.height;
37
+ var endDomHeight = endDomRect.height;
38
+ return {
39
+ top: startDomHeight / 2 + "px",
40
+ bottom: endDomHeight / 2 + "px"
41
+ };
42
+ }
43
+ return {
44
+ top: "0px",
45
+ bottom: "0px"
46
+ };
47
+ };
48
+ useEffect(function () {
49
+ setTypePosition(getTypePosition(startDomClassName, endDomClassName));
50
+ }, [startDomClassName, endDomClassName]);
51
+ return /*#__PURE__*/React.createElement("div", {
52
+ className: "rule-setting-type"
53
+ }, /*#__PURE__*/React.createElement("div", {
54
+ className: "border",
55
+ style: typePosition
56
+ }, /*#__PURE__*/React.createElement(Select, {
57
+ className: "rule-setting-type-select",
58
+ options: includeOption,
59
+ size: "large",
60
+ value: value,
61
+ onChange: function onChange(type) {
62
+ _onChange(type);
63
+ }
64
+ })));
65
+ };
66
+ export default RuleBorder;
@@ -0,0 +1,30 @@
1
+ .rule-setting-type {
2
+ width: 200px;
3
+ display: flex;
4
+ align-items: center;
5
+ justify-content: center;
6
+ align-self: stretch;
7
+ position: relative;
8
+
9
+
10
+
11
+ .border {
12
+ position: absolute;
13
+ top: 0;
14
+ left: 50%;
15
+ width: 50%;
16
+ bottom: 0;
17
+ border: 1px solid #ddd;
18
+ border-right: none;
19
+ transition: all 0.2s ease;
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: flex-start;
23
+
24
+ .rule-setting-type-select {
25
+ z-index: 1;
26
+ width: 100px;
27
+ transform: translateX(-50%);
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,4 @@
1
+ export declare const getStaffList: () => Promise<any>;
2
+ export declare const getProductChannel: () => Promise<any>;
3
+ export declare const getOrderTypes: () => Promise<any>;
4
+ export declare const getPaymentTypes: () => Promise<any>;
@@ -0,0 +1,149 @@
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 ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
+ 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; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ 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); }
8
+ 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); } }
9
+ 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); }); }; }
10
+ import { locales } from "@pisell/utils";
11
+ import { request } from "../../utils/index";
12
+ export var getStaffList = /*#__PURE__*/function () {
13
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
14
+ var _yield$request$getReq, data, _list;
15
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
16
+ while (1) switch (_context.prev = _context.next) {
17
+ case 0:
18
+ _context.next = 2;
19
+ return request.getRequest().get('/shop/shop/setting/staff', {}, {
20
+ useCache: true
21
+ });
22
+ case 2:
23
+ _yield$request$getReq = _context.sent;
24
+ data = _yield$request$getReq.data;
25
+ _list = ((data === null || data === void 0 ? void 0 : data.staff) || []).map(function (d) {
26
+ var label = "".concat(d.first_name, " ").concat(d.last_name);
27
+ if (label.trim() === '') {
28
+ label = d.email;
29
+ }
30
+ return _objectSpread(_objectSpread({}, d), {}, {
31
+ label: label,
32
+ value: d.account_id
33
+ });
34
+ });
35
+ _list.unshift({
36
+ label: locales.getText('pisell2.text.all'),
37
+ value: 'all'
38
+ });
39
+ return _context.abrupt("return", _list);
40
+ case 7:
41
+ case "end":
42
+ return _context.stop();
43
+ }
44
+ }, _callee);
45
+ }));
46
+ return function getStaffList() {
47
+ return _ref.apply(this, arguments);
48
+ };
49
+ }();
50
+ export var getProductChannel = /*#__PURE__*/function () {
51
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
52
+ var _yield$request$getReq2, data, _list;
53
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
54
+ while (1) switch (_context2.prev = _context2.next) {
55
+ case 0:
56
+ _context2.next = 2;
57
+ return request.getRequest().get('/shop/order/platform-list');
58
+ case 2:
59
+ _yield$request$getReq2 = _context2.sent;
60
+ data = _yield$request$getReq2.data;
61
+ _list = (data || []).map(function (d) {
62
+ return {
63
+ label: d.name,
64
+ value: d.platform
65
+ };
66
+ });
67
+ _list.unshift({
68
+ label: locales.getText('pisell2.text.all'),
69
+ value: 'all'
70
+ });
71
+ return _context2.abrupt("return", _list);
72
+ case 7:
73
+ case "end":
74
+ return _context2.stop();
75
+ }
76
+ }, _callee2);
77
+ }));
78
+ return function getProductChannel() {
79
+ return _ref2.apply(this, arguments);
80
+ };
81
+ }();
82
+ export var getOrderTypes = /*#__PURE__*/function () {
83
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
84
+ var _ref4;
85
+ var _yield$request$getReq3, data, _list;
86
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
87
+ while (1) switch (_context3.prev = _context3.next) {
88
+ case 0:
89
+ _context3.next = 2;
90
+ return request.getRequest().get('/shop/order/aggregation-type');
91
+ case 2:
92
+ _yield$request$getReq3 = _context3.sent;
93
+ data = _yield$request$getReq3.data;
94
+ _list = (_ref4 = data || []) === null || _ref4 === void 0 ? void 0 : _ref4.map(function (d) {
95
+ return _objectSpread(_objectSpread({}, d), {}, {
96
+ label: d.name,
97
+ value: d.type
98
+ });
99
+ });
100
+ _list.unshift({
101
+ label: locales.getText('pisell2.text.all'),
102
+ value: 'all'
103
+ });
104
+ return _context3.abrupt("return", _list);
105
+ case 7:
106
+ case "end":
107
+ return _context3.stop();
108
+ }
109
+ }, _callee3);
110
+ }));
111
+ return function getOrderTypes() {
112
+ return _ref3.apply(this, arguments);
113
+ };
114
+ }();
115
+ export var getPaymentTypes = /*#__PURE__*/function () {
116
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
117
+ var _ref6;
118
+ var _yield$request$getReq4, data, _list;
119
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
120
+ while (1) switch (_context4.prev = _context4.next) {
121
+ case 0:
122
+ _context4.next = 2;
123
+ return request.getRequest().get('/shop/till/opened-payment-method');
124
+ case 2:
125
+ _yield$request$getReq4 = _context4.sent;
126
+ data = _yield$request$getReq4.data;
127
+ _list = (_ref6 = data || []) === null || _ref6 === void 0 ? void 0 : _ref6.map(function (d) {
128
+ return _objectSpread(_objectSpread({}, d), {}, {
129
+ label: d.name,
130
+ value: d.code
131
+ });
132
+ });
133
+ _list.unshift({
134
+ label: locales.getText('pisell2.text.all'),
135
+ value: 'all'
136
+ });
137
+ return _context4.abrupt("return", _list);
138
+ case 7:
139
+ case "end":
140
+ return _context4.stop();
141
+ }
142
+ }, _callee4);
143
+ }));
144
+ return function getPaymentTypes() {
145
+ return _ref5.apply(this, arguments);
146
+ };
147
+ }();
148
+
149
+ //
package/es/index.d.ts CHANGED
@@ -13,3 +13,4 @@ export { default as BookingDuration } from './components/booking/materiels/durat
13
13
  export { default as BookingContacts } from './components/booking/materiels/contacts';
14
14
  export { default as ProductExtension } from './components/productExtension';
15
15
  export { default as BookingDeposit } from './components/booking/deposit';
16
+ export { default as RuleSetting } from './components/ruleSetting';
package/es/index.js CHANGED
@@ -16,4 +16,5 @@ export { default as BookingStartTime } from "./components/booking/materiels/star
16
16
  export { default as BookingDuration } from "./components/booking/materiels/duration";
17
17
  export { default as BookingContacts } from "./components/booking/materiels/contacts";
18
18
  export { default as ProductExtension } from "./components/productExtension";
19
- export { default as BookingDeposit } from "./components/booking/deposit";
19
+ export { default as BookingDeposit } from "./components/booking/deposit";
20
+ export { default as RuleSetting } from "./components/ruleSetting";
@@ -190,7 +190,7 @@ var Footer = (props) => {
190
190
  }
191
191
  state == null ? void 0 : state.callback(callbackData);
192
192
  _setLoading(false);
193
- return callbackData;
193
+ return callbackData || values;
194
194
  } catch (err) {
195
195
  console.log(err);
196
196
  if ((err == null ? void 0 : err.code) === 70101) {
@@ -238,16 +238,22 @@ var Footer = (props) => {
238
238
  );
239
239
  }, [isEdit, checkoutLoading, isDisabled, state, source]);
240
240
  const handleMenuClick = async (e) => {
241
+ var _a2;
241
242
  let id = state.bookingId;
243
+ let customer = state.bookingDetail.customer;
242
244
  if (isEdit) {
243
245
  const res = await handleSave({ type: "checkout", messageShow: false });
244
246
  id = (res == null ? void 0 : res.order_id) || state.bookingId;
247
+ customer = (res == null ? void 0 : res.customer_id) ? { id: res == null ? void 0 : res.customer_id } : state.bookingDetail.customer;
245
248
  }
246
249
  if (e.key === "sendMail") {
247
250
  state.action({
248
251
  type: "pisell1.sendPayLinkEmail",
249
252
  data: {
250
- id
253
+ id,
254
+ is_deposit: state.bookingDetail.is_deposit || Number((_a2 = state.bookingDetail) == null ? void 0 : _a2.deposit_amount),
255
+ deposit_payment_time: state.bookingDetail.deposit_payment_time,
256
+ customer
251
257
  },
252
258
  callback: () => {
253
259
  }
@@ -79,7 +79,7 @@ var DepositItem = (props) => {
79
79
  {
80
80
  key: "1",
81
81
  disabled: isPaid || isBookingCancelled,
82
- label: /* @__PURE__ */ import_react.default.createElement("div", null, import_utils.locales.getText("pisell2.text.deposit-generate-payment-link"))
82
+ label: /* @__PURE__ */ import_react.default.createElement("div", null, import_utils.locales.getText("pisell2.text.copy-to-clipboard"))
83
83
  }
84
84
  ];
85
85
  const onClick = ({ key }) => {
@@ -58,7 +58,10 @@ var Deposit = (props) => {
58
58
  action({
59
59
  type: "pisell1.sendPayLinkEmail",
60
60
  data: {
61
- id
61
+ id,
62
+ is_deposit: 1,
63
+ deposit_payment_time: bookingDetail.deposit_payment_time,
64
+ customer: bookingDetail.customer
62
65
  },
63
66
  callback: () => {
64
67
  }
@@ -176,7 +176,7 @@ var locales_default = {
176
176
  "pisell2.text.deposit-paid": "Deposit paid",
177
177
  "pisell2.text.stock": "Stock",
178
178
  "pisell2.text.payment-link": "Payment link",
179
- "pisell2.text.send-mail": "Send mail",
179
+ "pisell2.text.send-mail": "Send email",
180
180
  "pisell2.text.copy-to-clipboard": "Copy to clipboard",
181
181
  "pisell2.text.ok": "OK",
182
182
  "pisell2.text.terminal-edit-message": "This operation cannot be performed. To proceed, please use the Pisell Terminal."
@@ -6,4 +6,5 @@ import BookingAddons from './booking/addons';
6
6
  import BookingForms from './booking/forms';
7
7
  import Schedules from './schedules';
8
8
  import ProductExtension from './productExtension';
9
- export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension };
9
+ import RuleSetting from './ruleSetting';
10
+ export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting };
@@ -36,6 +36,7 @@ __export(components_exports, {
36
36
  BookingNotes: () => import_notes.default,
37
37
  Login: () => import_login.default,
38
38
  ProductExtension: () => import_productExtension.default,
39
+ RuleSetting: () => import_ruleSetting.default,
39
40
  Schedules: () => import_schedules.default
40
41
  });
41
42
  module.exports = __toCommonJS(components_exports);
@@ -47,6 +48,7 @@ var import_addons = __toESM(require("./booking/addons"));
47
48
  var import_forms = __toESM(require("./booking/forms"));
48
49
  var import_schedules = __toESM(require("./schedules"));
49
50
  var import_productExtension = __toESM(require("./productExtension"));
51
+ var import_ruleSetting = __toESM(require("./ruleSetting"));
50
52
  // Annotate the CommonJS export names for ESM import in node:
51
53
  0 && (module.exports = {
52
54
  Booking,
@@ -56,5 +58,6 @@ var import_productExtension = __toESM(require("./productExtension"));
56
58
  BookingNotes,
57
59
  Login,
58
60
  ProductExtension,
61
+ RuleSetting,
59
62
  Schedules
60
63
  });
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ interface ListComponentProps {
3
+ value?: any[];
4
+ onChange?: (value: any) => void;
5
+ renderItem?: (item: any, index: number, handleDeleteItem: (item: any) => void, handleOnChangeItem: (item: any, newValue: any) => void) => React.ReactNode;
6
+ renderAddButton?: (handleAddItem: () => void) => React.ReactNode;
7
+ maxLength?: number;
8
+ createItem?: (item: any) => any;
9
+ rowKey?: string;
10
+ className?: string;
11
+ style?: React.CSSProperties;
12
+ wrapClassName?: string;
13
+ }
14
+ declare const _default: React.ForwardRefExoticComponent<ListComponentProps & React.RefAttributes<unknown>>;
15
+ export default _default;