@pisell/private-materials 3.0.184 → 3.0.186
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 +11 -11
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +11 -11
- package/es/components/booking/addons/model.d.ts +2 -1
- package/es/components/booking/forms/model.d.ts +2 -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/model.d.ts +2 -1
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +2 -1
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/index.js +10 -2
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +17 -1
- package/es/components/pay/toC/PaymentMethods/index.js +6 -1
- package/es/components/pay/toC/index.js +10 -2
- package/es/components/pisellSelectCustomerModal/CustomerCard/index.d.ts +12 -0
- package/es/components/pisellSelectCustomerModal/CustomerCard/index.js +71 -0
- package/es/components/pisellSelectCustomerModal/CustomerCard/index.less +83 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +3 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.js +277 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +3 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.js +17 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +3 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.js +57 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/serve.d.ts +2 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/serve.js +166 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +8 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.js +191 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.less +35 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +13 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.js +78 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.less +49 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +15 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/index.js +149 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/index.less +43 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/mock.d.ts +47 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/mock.js +115 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/serve.d.ts +3 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/serve.js +56 -0
- package/es/components/pisellSelectCustomerModal/index.d.ts +16 -0
- package/es/components/pisellSelectCustomerModal/index.js +221 -0
- package/es/components/pisellSelectCustomerModal/index.less +16 -0
- package/es/components/pisellSelectCustomerModal/locales.d.ts +75 -0
- package/es/components/pisellSelectCustomerModal/locales.js +74 -0
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +2 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/lib/components/booking/addons/model.d.ts +2 -1
- package/lib/components/booking/forms/model.d.ts +2 -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/model.d.ts +2 -1
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +3 -0
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/index.js +18 -3
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +24 -0
- package/lib/components/pay/toC/PaymentMethods/index.js +6 -1
- package/lib/components/pay/toC/index.js +16 -2
- package/lib/components/pisellSelectCustomerModal/CustomerCard/index.d.ts +12 -0
- package/lib/components/pisellSelectCustomerModal/CustomerCard/index.js +99 -0
- package/lib/components/pisellSelectCustomerModal/CustomerCard/index.less +83 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +3 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.js +256 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +3 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.js +51 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +3 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.js +81 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/serve.d.ts +2 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/serve.js +193 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +8 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.js +200 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.less +35 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +13 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.js +94 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.less +49 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +15 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.js +150 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.less +43 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/mock.d.ts +47 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/mock.js +150 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/serve.d.ts +3 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/serve.js +39 -0
- package/lib/components/pisellSelectCustomerModal/index.d.ts +16 -0
- package/lib/components/pisellSelectCustomerModal/index.js +230 -0
- package/lib/components/pisellSelectCustomerModal/index.less +16 -0
- package/lib/components/pisellSelectCustomerModal/locales.d.ts +75 -0
- package/lib/components/pisellSelectCustomerModal/locales.js +98 -0
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +2 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lowcode/pisell-select-customer-modal/meta.ts +80 -0
- package/package.json +3 -3
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/pisellSelectCustomerModal/CustomerCard/index.tsx
|
|
30
|
+
var CustomerCard_exports = {};
|
|
31
|
+
__export(CustomerCard_exports, {
|
|
32
|
+
default: () => CustomerCard_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(CustomerCard_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_PlusCircle = __toESM(require("@pisell/icon/es/PlusCircle"));
|
|
38
|
+
var import_XCircle = __toESM(require("@pisell/icon/es/XCircle"));
|
|
39
|
+
var import_utils = require("@pisell/utils");
|
|
40
|
+
var import_index = require("./index.less");
|
|
41
|
+
var import_classnames = __toESM(require("classnames"));
|
|
42
|
+
var CustomerCard = ({
|
|
43
|
+
onClickItem,
|
|
44
|
+
customer,
|
|
45
|
+
showIcon = true,
|
|
46
|
+
customIcon,
|
|
47
|
+
onRemove,
|
|
48
|
+
className
|
|
49
|
+
}) => {
|
|
50
|
+
const username = (0, import_react.useMemo)(() => {
|
|
51
|
+
if (!customer) {
|
|
52
|
+
return "Walk-in";
|
|
53
|
+
}
|
|
54
|
+
const firstLastName = customer.first_name || customer.last_name ? `${customer.first_name} ${customer.last_name}` : "";
|
|
55
|
+
return customer.name || (customer.display_name || "").trim() || (customer.nickname || "").trim() || firstLastName.trim() || "";
|
|
56
|
+
}, [customer]);
|
|
57
|
+
const getAvatarName = (0, import_react.useMemo)(() => {
|
|
58
|
+
if (!username)
|
|
59
|
+
return "";
|
|
60
|
+
const parts = username.trim().split(/\s+/);
|
|
61
|
+
if (parts.length === 1) {
|
|
62
|
+
return parts[0].charAt(0);
|
|
63
|
+
}
|
|
64
|
+
return parts[0].charAt(0) + parts[1].charAt(0);
|
|
65
|
+
}, [username]);
|
|
66
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
className: (0, import_classnames.default)("pisell-lowcode__customer_card", className),
|
|
70
|
+
onClick: () => {
|
|
71
|
+
onClickItem(customer);
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
75
|
+
import_antd.Avatar,
|
|
76
|
+
{
|
|
77
|
+
className: "pisell-lowcode__customer_card-avatar",
|
|
78
|
+
src: (customer == null ? void 0 : customer.cover) ? import_utils.image.ali(customer == null ? void 0 : customer.cover, 100) : void 0
|
|
79
|
+
},
|
|
80
|
+
getAvatarName
|
|
81
|
+
),
|
|
82
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__customer_card-info" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__customer_card-info-left" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__customer_card-info-name" }, username), !customer ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__customer_card-info-desc" }, import_utils.locales.getText("pisell2.text.leave-empty-for-walk-in")) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, (customer == null ? void 0 : customer.email) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__customer_card-info-email" }, customer == null ? void 0 : customer.email) : null, (customer == null ? void 0 : customer.phone) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__customer_card-info-phone" }, customer == null ? void 0 : customer.phone) : null)), showIcon ? /* @__PURE__ */ import_react.default.createElement(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
className: "pisell-lowcode__customer_card-info-right",
|
|
86
|
+
onClick: (e) => {
|
|
87
|
+
if (!customer) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
e.stopPropagation();
|
|
92
|
+
onRemove == null ? void 0 : onRemove();
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
customIcon ? customIcon : customer ? /* @__PURE__ */ import_react.default.createElement(import_XCircle.default, { className: "pisell-lowcode__customer_card-add-icon" }) : /* @__PURE__ */ import_react.default.createElement(import_PlusCircle.default, { className: "pisell-lowcode__customer_card-add-icon" })
|
|
96
|
+
) : null)
|
|
97
|
+
);
|
|
98
|
+
};
|
|
99
|
+
var CustomerCard_default = CustomerCard;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
.pisell-lowcode__customer_card {
|
|
2
|
+
display: flex;
|
|
3
|
+
width: 100%;
|
|
4
|
+
padding: 20px 8px;
|
|
5
|
+
align-items: center;
|
|
6
|
+
gap: 16px;
|
|
7
|
+
border-radius: 8px;
|
|
8
|
+
border: 1px solid #D5D7DA;
|
|
9
|
+
background: var(--base-white, #FFF);
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
position: relative;
|
|
12
|
+
margin-bottom: 0;
|
|
13
|
+
|
|
14
|
+
.pisell-lowcode__customer_card-avatar {
|
|
15
|
+
display: flex;
|
|
16
|
+
width: 48px;
|
|
17
|
+
height: 48px;
|
|
18
|
+
padding: 16px;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
align-items: center;
|
|
21
|
+
border-radius: 200px;
|
|
22
|
+
background: var(--Badge-Blue_Container, #D1E3FF);
|
|
23
|
+
font-weight: 600;
|
|
24
|
+
color: #0B5FDB;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.pisell-lowcode__customer_card-avatar-icon {
|
|
28
|
+
font-size: 24px;
|
|
29
|
+
color: #0B5FDB;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
.pisell-lowcode__customer_card-info {
|
|
34
|
+
flex: 1;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
|
|
38
|
+
.pisell-lowcode__customer_card-info-left {
|
|
39
|
+
flex: 1;
|
|
40
|
+
width: 0;
|
|
41
|
+
|
|
42
|
+
.pisell-lowcode__customer_card-info-name {
|
|
43
|
+
color: var(--gray-900, #101828);
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
font-size: 16px;
|
|
47
|
+
font-style: normal;
|
|
48
|
+
font-weight: 600;
|
|
49
|
+
line-height: 24px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.pisell-lowcode__customer_card-info-desc {
|
|
53
|
+
color: var(--gray-400, #98A2B3);
|
|
54
|
+
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
font-style: normal;
|
|
57
|
+
font-weight: 400;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.pisell-lowcode__customer_card-info-email,
|
|
61
|
+
.pisell-lowcode__customer_card-info-phone {
|
|
62
|
+
color: var(--gray-400, #98A2B3);
|
|
63
|
+
|
|
64
|
+
font-size: 14px;
|
|
65
|
+
font-style: normal;
|
|
66
|
+
font-weight: 400;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.pisell-lowcode__customer_card-info-right {
|
|
71
|
+
width: 40px;
|
|
72
|
+
height: 40px;
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
|
|
77
|
+
.pisell-lowcode__customer_card-add-icon {
|
|
78
|
+
font-size: 28px;
|
|
79
|
+
color: #475467;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.tsx
|
|
30
|
+
var BirthdayField_exports = {};
|
|
31
|
+
__export(BirthdayField_exports, {
|
|
32
|
+
default: () => BirthdayField_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(BirthdayField_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_debounce = __toESM(require("lodash/debounce"));
|
|
38
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
39
|
+
var import_utils = require("@pisell/utils");
|
|
40
|
+
var { Option } = import_antd.Select;
|
|
41
|
+
var getSelectInput = (id) => {
|
|
42
|
+
const input = document.getElementById(id);
|
|
43
|
+
if (input) {
|
|
44
|
+
return input;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var setSelectInputType = ({
|
|
48
|
+
input,
|
|
49
|
+
type
|
|
50
|
+
}) => {
|
|
51
|
+
if (input) {
|
|
52
|
+
input.type = type;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
var DateSectionCom = ({
|
|
56
|
+
value,
|
|
57
|
+
onChange,
|
|
58
|
+
showTime,
|
|
59
|
+
className = "",
|
|
60
|
+
style = {},
|
|
61
|
+
useSpace = true,
|
|
62
|
+
format,
|
|
63
|
+
itemStyle = {
|
|
64
|
+
width: 100
|
|
65
|
+
}
|
|
66
|
+
}) => {
|
|
67
|
+
const currentYear = (0, import_dayjs.default)().year();
|
|
68
|
+
const locale = import_utils.locales.locale;
|
|
69
|
+
const dayRef = (0, import_react.useRef)(null);
|
|
70
|
+
const monthRef = (0, import_react.useRef)(null);
|
|
71
|
+
const yearRef = (0, import_react.useRef)(null);
|
|
72
|
+
const [date, setDate] = (0, import_react.useState)({
|
|
73
|
+
year: value ? (0, import_dayjs.default)(value).year() : null,
|
|
74
|
+
month: value ? (0, import_dayjs.default)(value).month() + 1 : null,
|
|
75
|
+
day: value ? (0, import_dayjs.default)(value).date() : null
|
|
76
|
+
});
|
|
77
|
+
const [dayOptions, setDayOptions] = (0, import_react.useState)([]);
|
|
78
|
+
const [monthOptions, setMonthOptions] = (0, import_react.useState)([]);
|
|
79
|
+
const [yearOptions, setYearOptions] = (0, import_react.useState)([]);
|
|
80
|
+
const localeMap = {
|
|
81
|
+
year: import_utils.locales.getText("pisell2.text.date-year-text"),
|
|
82
|
+
month: import_utils.locales.getText("pisell2.text.date-month-text"),
|
|
83
|
+
day: import_utils.locales.getText("pisell2.text.date-day-text")
|
|
84
|
+
};
|
|
85
|
+
(0, import_react.useEffect)(() => {
|
|
86
|
+
setDate({
|
|
87
|
+
year: value ? (0, import_dayjs.default)(value).year() : null,
|
|
88
|
+
month: value ? (0, import_dayjs.default)(value).month() + 1 : null,
|
|
89
|
+
day: value ? (0, import_dayjs.default)(value).date() : null
|
|
90
|
+
});
|
|
91
|
+
}, [value]);
|
|
92
|
+
(0, import_react.useEffect)(() => {
|
|
93
|
+
setMonthOptions(renderOptions("month", 1, 12));
|
|
94
|
+
setYearOptions(renderOptions("year", currentYear - 100, currentYear + 50));
|
|
95
|
+
}, []);
|
|
96
|
+
(0, import_react.useEffect)(() => {
|
|
97
|
+
setDayOptions(
|
|
98
|
+
renderOptions(
|
|
99
|
+
"day",
|
|
100
|
+
1,
|
|
101
|
+
date.month ? getDaysInMonth(date.year || currentYear, date.month) : 31
|
|
102
|
+
)
|
|
103
|
+
);
|
|
104
|
+
}, [date.month, date.year]);
|
|
105
|
+
const handleDateChange = (field, value2) => {
|
|
106
|
+
if (!value2) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
let newDate = {
|
|
110
|
+
year: date.year,
|
|
111
|
+
month: date.month,
|
|
112
|
+
day: date.day,
|
|
113
|
+
[field]: value2
|
|
114
|
+
};
|
|
115
|
+
const foucsList = {
|
|
116
|
+
day: monthRef,
|
|
117
|
+
month: yearRef
|
|
118
|
+
};
|
|
119
|
+
if (field === "month" || field === "year") {
|
|
120
|
+
const daysInMonth = getDaysInMonth(
|
|
121
|
+
(newDate == null ? void 0 : newDate.year) || currentYear,
|
|
122
|
+
newDate == null ? void 0 : newDate.month
|
|
123
|
+
);
|
|
124
|
+
const newDay = (newDate == null ? void 0 : newDate.day) > daysInMonth ? daysInMonth : newDate.day;
|
|
125
|
+
newDate = {
|
|
126
|
+
...newDate,
|
|
127
|
+
day: newDay
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
setDate(newDate);
|
|
131
|
+
if (foucsList[field]) {
|
|
132
|
+
foucsList[field].current.focus();
|
|
133
|
+
} else {
|
|
134
|
+
yearRef.current.blur();
|
|
135
|
+
}
|
|
136
|
+
const _format = format || "YYYY-MM-DD";
|
|
137
|
+
if (newDate.year && newDate.month && newDate.day) {
|
|
138
|
+
const _date = `${newDate.year}-${newDate.month.toString().padStart(2, "0")}-${newDate.day.toString().padStart(2, "0")}`;
|
|
139
|
+
onChange((0, import_dayjs.default)(_date).format(_format));
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
const getDaysInMonth = (year, month) => {
|
|
143
|
+
return (0, import_dayjs.default)(`${year}-${month}`, "YYYY-MM").daysInMonth();
|
|
144
|
+
};
|
|
145
|
+
const renderOptions = (field, start, end) => {
|
|
146
|
+
const options = [];
|
|
147
|
+
const _text = locale !== "en-US" && locale !== "en" ? localeMap[field] : "";
|
|
148
|
+
for (let i = start; i <= end; i++) {
|
|
149
|
+
options.push({
|
|
150
|
+
label: `${i}${_text}`,
|
|
151
|
+
value: i
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
return options;
|
|
155
|
+
};
|
|
156
|
+
const selectId = (0, import_react.useMemo)(() => {
|
|
157
|
+
return {
|
|
158
|
+
dayId: (0, import_utils.getUniqueId)("day"),
|
|
159
|
+
monthId: (0, import_utils.getUniqueId)("month"),
|
|
160
|
+
yearId: (0, import_utils.getUniqueId)("year")
|
|
161
|
+
};
|
|
162
|
+
}, []);
|
|
163
|
+
(0, import_react.useLayoutEffect)(() => {
|
|
164
|
+
setSelectInputType({
|
|
165
|
+
input: getSelectInput(selectId.dayId),
|
|
166
|
+
type: "number"
|
|
167
|
+
});
|
|
168
|
+
setSelectInputType({
|
|
169
|
+
input: getSelectInput(selectId.monthId),
|
|
170
|
+
type: "number"
|
|
171
|
+
});
|
|
172
|
+
setSelectInputType({
|
|
173
|
+
input: getSelectInput(selectId.yearId),
|
|
174
|
+
type: "number"
|
|
175
|
+
});
|
|
176
|
+
}, [selectId]);
|
|
177
|
+
const handleDateSearch = (0, import_react.useCallback)(
|
|
178
|
+
(0, import_debounce.default)((field, value2) => {
|
|
179
|
+
const dateOption = {
|
|
180
|
+
day: dayOptions,
|
|
181
|
+
month: monthOptions,
|
|
182
|
+
year: yearOptions
|
|
183
|
+
};
|
|
184
|
+
const _value = Number(value2);
|
|
185
|
+
const index = dateOption[field].findIndex((item) => {
|
|
186
|
+
return item.value === _value;
|
|
187
|
+
});
|
|
188
|
+
if (index !== -1) {
|
|
189
|
+
handleDateChange(field, _value);
|
|
190
|
+
} else {
|
|
191
|
+
handleDateChange(field, null);
|
|
192
|
+
}
|
|
193
|
+
}, 300),
|
|
194
|
+
[dayOptions, monthOptions, yearOptions, date]
|
|
195
|
+
);
|
|
196
|
+
const content = /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
197
|
+
import_antd.Select,
|
|
198
|
+
{
|
|
199
|
+
id: selectId.dayId,
|
|
200
|
+
value: date.day,
|
|
201
|
+
placeholder: import_utils.locales.getText("pisell2.text.date-day-text"),
|
|
202
|
+
onChange: (value2) => handleDateChange("day", value2),
|
|
203
|
+
style: itemStyle,
|
|
204
|
+
showSearch: true,
|
|
205
|
+
onSearch: (value2) => {
|
|
206
|
+
handleDateSearch("day", value2);
|
|
207
|
+
},
|
|
208
|
+
ref: dayRef,
|
|
209
|
+
size: "large"
|
|
210
|
+
},
|
|
211
|
+
dayOptions.map((item) => {
|
|
212
|
+
return /* @__PURE__ */ import_react.default.createElement(Option, { key: item.value, value: item.value }, item.label);
|
|
213
|
+
})
|
|
214
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
215
|
+
import_antd.Select,
|
|
216
|
+
{
|
|
217
|
+
id: selectId.monthId,
|
|
218
|
+
value: date.month,
|
|
219
|
+
placeholder: import_utils.locales.getText("pisell2.text.date-month-text"),
|
|
220
|
+
onChange: (value2) => handleDateChange("month", value2),
|
|
221
|
+
style: itemStyle,
|
|
222
|
+
showSearch: true,
|
|
223
|
+
onSearch: (value2) => {
|
|
224
|
+
handleDateSearch("month", value2);
|
|
225
|
+
},
|
|
226
|
+
ref: monthRef,
|
|
227
|
+
size: "large"
|
|
228
|
+
},
|
|
229
|
+
monthOptions.map((item) => {
|
|
230
|
+
return /* @__PURE__ */ import_react.default.createElement(Option, { key: item.value, value: item.value }, item.label);
|
|
231
|
+
})
|
|
232
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
233
|
+
import_antd.Select,
|
|
234
|
+
{
|
|
235
|
+
id: selectId.yearId,
|
|
236
|
+
value: date.year,
|
|
237
|
+
placeholder: import_utils.locales.getText("pisell2.text.date-year-text"),
|
|
238
|
+
onChange: (value2) => handleDateChange("year", value2),
|
|
239
|
+
style: itemStyle,
|
|
240
|
+
showSearch: true,
|
|
241
|
+
onSearch: (value2) => {
|
|
242
|
+
handleDateSearch("year", value2);
|
|
243
|
+
},
|
|
244
|
+
ref: yearRef,
|
|
245
|
+
size: "large"
|
|
246
|
+
},
|
|
247
|
+
yearOptions.map((item) => {
|
|
248
|
+
return /* @__PURE__ */ import_react.default.createElement(Option, { key: item.value, value: item.value }, item.label);
|
|
249
|
+
})
|
|
250
|
+
));
|
|
251
|
+
if (useSpace) {
|
|
252
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { className: className || "", style: style || {} }, content);
|
|
253
|
+
}
|
|
254
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: className || "", style: style || {} }, content);
|
|
255
|
+
};
|
|
256
|
+
var BirthdayField_default = DateSectionCom;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.tsx
|
|
30
|
+
var GenderField_exports = {};
|
|
31
|
+
__export(GenderField_exports, {
|
|
32
|
+
default: () => GenderField_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(GenderField_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_utils = require("@pisell/utils");
|
|
38
|
+
var GenderField = (props) => {
|
|
39
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
40
|
+
import_antd.Select,
|
|
41
|
+
{
|
|
42
|
+
size: "large",
|
|
43
|
+
options: [
|
|
44
|
+
{ label: import_utils.locales.getText("pisell2.text.gender.male"), value: "1" },
|
|
45
|
+
{ label: import_utils.locales.getText("pisell2.text.gender.female"), value: "2" }
|
|
46
|
+
],
|
|
47
|
+
...props
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
var GenderField_default = GenderField;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.tsx
|
|
30
|
+
var PhoneField_exports = {};
|
|
31
|
+
__export(PhoneField_exports, {
|
|
32
|
+
default: () => PhoneField_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(PhoneField_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_ahooks = require("ahooks");
|
|
38
|
+
var import_serve = require("./serve");
|
|
39
|
+
var defaultValue = {
|
|
40
|
+
code: "+61",
|
|
41
|
+
phone: ""
|
|
42
|
+
};
|
|
43
|
+
var PhoneField = ({ value, onChange }) => {
|
|
44
|
+
const codes = (0, import_ahooks.useRequest)(import_serve.getCountries, {
|
|
45
|
+
manual: true
|
|
46
|
+
});
|
|
47
|
+
console.log("codes", codes.data);
|
|
48
|
+
(0, import_react.useEffect)(() => {
|
|
49
|
+
codes.run();
|
|
50
|
+
}, []);
|
|
51
|
+
const _onChange = (key, val) => {
|
|
52
|
+
onChange({ ...defaultValue, ...value, [key]: val });
|
|
53
|
+
};
|
|
54
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Space.Compact, { style: { width: "100%" } }, /* @__PURE__ */ import_react.default.createElement(
|
|
55
|
+
import_antd.Select,
|
|
56
|
+
{
|
|
57
|
+
options: codes.data || [],
|
|
58
|
+
onChange: (val) => {
|
|
59
|
+
_onChange("code", val);
|
|
60
|
+
},
|
|
61
|
+
size: "large",
|
|
62
|
+
style: { flex: "0 0 100px" },
|
|
63
|
+
loading: codes.loading,
|
|
64
|
+
optionLabelProp: "value",
|
|
65
|
+
value: value == null ? void 0 : value.code,
|
|
66
|
+
dropdownMatchSelectWidth: false
|
|
67
|
+
}
|
|
68
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
69
|
+
import_antd.Input,
|
|
70
|
+
{
|
|
71
|
+
type: "number",
|
|
72
|
+
value: value == null ? void 0 : value.phone,
|
|
73
|
+
size: "large",
|
|
74
|
+
style: { flex: 1 },
|
|
75
|
+
onChange: (e) => {
|
|
76
|
+
_onChange("phone", e.target.value);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
));
|
|
80
|
+
};
|
|
81
|
+
var PhoneField_default = PhoneField;
|