@pisell/private-materials 3.0.185 → 3.0.187
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/index.d.ts +2 -1
- package/es/components/index.js +2 -1
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +10 -4
- 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 +151 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/index.less +50 -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 +227 -0
- package/es/components/pisellSelectCustomerModal/index.less +22 -0
- package/es/components/pisellSelectCustomerModal/locales.d.ts +81 -0
- package/es/components/pisellSelectCustomerModal/locales.js +80 -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 +3 -0
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +3 -0
- 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 +152 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.less +50 -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 +237 -0
- package/lib/components/pisellSelectCustomerModal/index.less +22 -0
- package/lib/components/pisellSelectCustomerModal/locales.d.ts +81 -0
- package/lib/components/pisellSelectCustomerModal/locales.js +104 -0
- 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,200 @@
|
|
|
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/index.tsx
|
|
30
|
+
var Add_exports = {};
|
|
31
|
+
__export(Add_exports, {
|
|
32
|
+
default: () => Add_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Add_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_index = require("./index.less");
|
|
38
|
+
var import_ahooks = require("ahooks");
|
|
39
|
+
var import_PhoneField = __toESM(require("./PhoneField"));
|
|
40
|
+
var import_GenderField = __toESM(require("./GenderField"));
|
|
41
|
+
var import_BirthdayField = __toESM(require("./BirthdayField"));
|
|
42
|
+
var import_utils = require("@pisell/utils");
|
|
43
|
+
var import_serve = require("../serve");
|
|
44
|
+
var AddClient = (props) => {
|
|
45
|
+
const { onChange, phone } = props;
|
|
46
|
+
const [form] = import_antd.Form.useForm();
|
|
47
|
+
const useIsChecked = import_antd.Form.useWatch("is_checked", form);
|
|
48
|
+
(0, import_react.useEffect)(() => {
|
|
49
|
+
form.setFieldsValue({ phone: { code: "+61", phone } });
|
|
50
|
+
}, [phone]);
|
|
51
|
+
const _addClient = (0, import_ahooks.useRequest)(import_serve.addCustomer, {
|
|
52
|
+
manual: true,
|
|
53
|
+
onSuccess: (res, param) => {
|
|
54
|
+
var _a;
|
|
55
|
+
onChange({ ...(_a = param[0]) == null ? void 0 : _a.customer, id: res.customer_id });
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const onFinish = (values) => {
|
|
59
|
+
var _a;
|
|
60
|
+
const { phone: phone2, ...rest } = values;
|
|
61
|
+
if (!values.first_name && !values.last_name && !values.email && !((_a = values == null ? void 0 : values.phone) == null ? void 0 : _a.phone)) {
|
|
62
|
+
import_antd.message.info(import_utils.locales.getText("pisell2.text.add-client.confirm"));
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
_addClient.run({
|
|
66
|
+
customer: {
|
|
67
|
+
accepts_marketing: 0,
|
|
68
|
+
register_channel: "shop",
|
|
69
|
+
tax_exempt: 1,
|
|
70
|
+
...rest,
|
|
71
|
+
first_name: rest.first_name || "",
|
|
72
|
+
last_name: rest.last_name || "",
|
|
73
|
+
note: rest.note || "",
|
|
74
|
+
email: rest.email || "",
|
|
75
|
+
country_calling_code: phone2.code || "",
|
|
76
|
+
phone: phone2.phone || ""
|
|
77
|
+
},
|
|
78
|
+
address: {
|
|
79
|
+
first_name: "",
|
|
80
|
+
last_name: "",
|
|
81
|
+
company: "",
|
|
82
|
+
address1: "",
|
|
83
|
+
address2: "",
|
|
84
|
+
city: "",
|
|
85
|
+
country_code: "AU",
|
|
86
|
+
province_code: "ACT",
|
|
87
|
+
phone: "",
|
|
88
|
+
country: "澳大利亚",
|
|
89
|
+
province: "Australian Capital Territory",
|
|
90
|
+
country_calling_code: "+61"
|
|
91
|
+
},
|
|
92
|
+
tags: []
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "select-customer-right-panel-add-client" }, /* @__PURE__ */ import_react.default.createElement(
|
|
96
|
+
import_antd.Form,
|
|
97
|
+
{
|
|
98
|
+
form,
|
|
99
|
+
onFinish,
|
|
100
|
+
layout: "vertical",
|
|
101
|
+
initialValues: {
|
|
102
|
+
is_checked: 0,
|
|
103
|
+
phone: {
|
|
104
|
+
code: "+61",
|
|
105
|
+
phone: ""
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Row, { gutter: [16, 0] }, /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 12 }, /* @__PURE__ */ import_react.default.createElement(
|
|
110
|
+
import_antd.Form.Item,
|
|
111
|
+
{
|
|
112
|
+
label: import_utils.locales.getText("pisell2.text.firstname"),
|
|
113
|
+
name: "first_name"
|
|
114
|
+
},
|
|
115
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Input, { size: "large" })
|
|
116
|
+
)), /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 12 }, /* @__PURE__ */ import_react.default.createElement(
|
|
117
|
+
import_antd.Form.Item,
|
|
118
|
+
{
|
|
119
|
+
label: import_utils.locales.getText("pisell2.text.lastname"),
|
|
120
|
+
name: "last_name"
|
|
121
|
+
},
|
|
122
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Input, { size: "large" })
|
|
123
|
+
)), /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(
|
|
124
|
+
import_antd.Form.Item,
|
|
125
|
+
{
|
|
126
|
+
label: import_utils.locales.getText("pisell2.text.gender"),
|
|
127
|
+
name: "gender"
|
|
128
|
+
},
|
|
129
|
+
/* @__PURE__ */ import_react.default.createElement(import_GenderField.default, null)
|
|
130
|
+
)), /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(
|
|
131
|
+
import_antd.Form.Item,
|
|
132
|
+
{
|
|
133
|
+
label: import_utils.locales.getText("pisell2.text.birthday"),
|
|
134
|
+
name: "birthday"
|
|
135
|
+
},
|
|
136
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
137
|
+
import_BirthdayField.default,
|
|
138
|
+
{
|
|
139
|
+
itemStyle: { flex: 1 },
|
|
140
|
+
style: { display: "flex", gap: 16, width: "100%" },
|
|
141
|
+
useSpace: false
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
)), /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(
|
|
145
|
+
import_antd.Form.Item,
|
|
146
|
+
{
|
|
147
|
+
label: import_utils.locales.getText("pisell2.text.phone"),
|
|
148
|
+
name: "phone"
|
|
149
|
+
},
|
|
150
|
+
/* @__PURE__ */ import_react.default.createElement(import_PhoneField.default, null)
|
|
151
|
+
)), /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(
|
|
152
|
+
import_antd.Form.Item,
|
|
153
|
+
{
|
|
154
|
+
label: import_utils.locales.getText("pisell2.text.email"),
|
|
155
|
+
name: "email",
|
|
156
|
+
rules: [
|
|
157
|
+
{
|
|
158
|
+
pattern: /^([a-zA-Z0-9_\-\.+])+@([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,63})+$/,
|
|
159
|
+
message: import_utils.locales.getText("pisell2.text.email-error-message")
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Input, { size: "large" })
|
|
164
|
+
)), /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(
|
|
165
|
+
import_antd.Form.Item,
|
|
166
|
+
{
|
|
167
|
+
label: import_utils.locales.getText("pisell2.text.notes"),
|
|
168
|
+
name: "note"
|
|
169
|
+
},
|
|
170
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Input.TextArea, { size: "large" })
|
|
171
|
+
)), /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { hidden: true, name: "is_checked" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Input, null))),
|
|
172
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "select-customer-right-panel-add-client__footer" }, /* @__PURE__ */ import_react.default.createElement(
|
|
173
|
+
import_antd.Button,
|
|
174
|
+
{
|
|
175
|
+
size: "large",
|
|
176
|
+
style: { flex: 1 },
|
|
177
|
+
onClick: () => {
|
|
178
|
+
form.setFieldsValue({ is_checked: 0 });
|
|
179
|
+
form.submit();
|
|
180
|
+
},
|
|
181
|
+
loading: _addClient.loading && !useIsChecked
|
|
182
|
+
},
|
|
183
|
+
import_utils.locales.getText("pisell2.text.save")
|
|
184
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
185
|
+
import_antd.Button,
|
|
186
|
+
{
|
|
187
|
+
type: "primary",
|
|
188
|
+
size: "large",
|
|
189
|
+
style: { flex: 1 },
|
|
190
|
+
onClick: () => {
|
|
191
|
+
form.setFieldsValue({ is_checked: 1 });
|
|
192
|
+
form.submit();
|
|
193
|
+
},
|
|
194
|
+
loading: _addClient.loading && useIsChecked
|
|
195
|
+
},
|
|
196
|
+
import_utils.locales.getText("pisell2.text.save-and-select")
|
|
197
|
+
))
|
|
198
|
+
));
|
|
199
|
+
};
|
|
200
|
+
var Add_default = AddClient;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.select-customer-right-panel-add-client {
|
|
2
|
+
width: 100%;
|
|
3
|
+
flex: 1;
|
|
4
|
+
overflow-y: auto;
|
|
5
|
+
overflow-x: hidden;
|
|
6
|
+
position: relative;
|
|
7
|
+
|
|
8
|
+
.select-customer-right-panel-add-client__footer {
|
|
9
|
+
position: sticky;
|
|
10
|
+
left: 0;
|
|
11
|
+
bottom: 0;
|
|
12
|
+
width: 100%;
|
|
13
|
+
background-color: #fff;
|
|
14
|
+
display: flex;
|
|
15
|
+
gap: 16px;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
input::-webkit-inner-spin-button,
|
|
20
|
+
input::-webkit-outer-spin-button {
|
|
21
|
+
-webkit-appearance: none;
|
|
22
|
+
margin: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
input[type="number"]::-webkit-inner-spin-button,
|
|
26
|
+
input[type="number"]::-webkit-outer-spin-button {
|
|
27
|
+
-webkit-appearance: none;
|
|
28
|
+
margin: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
input[type="search"]::-webkit-search-decoration,
|
|
32
|
+
input[type="search"]::-webkit-search-cancel-button {
|
|
33
|
+
-webkit-appearance: none;
|
|
34
|
+
appearance: none;
|
|
35
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface CustomerListProps {
|
|
4
|
+
value: any;
|
|
5
|
+
onChange: (value: any) => void;
|
|
6
|
+
phone: string;
|
|
7
|
+
customerOrigin?: any;
|
|
8
|
+
loading: boolean;
|
|
9
|
+
onLoadMore: () => void;
|
|
10
|
+
setPage: (page: 'create') => void;
|
|
11
|
+
}
|
|
12
|
+
declare const CustomerList: (props: CustomerListProps) => React.JSX.Element;
|
|
13
|
+
export default CustomerList;
|
|
@@ -0,0 +1,94 @@
|
|
|
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/List/index.tsx
|
|
30
|
+
var List_exports = {};
|
|
31
|
+
__export(List_exports, {
|
|
32
|
+
default: () => List_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(List_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_classnames = __toESM(require("classnames"));
|
|
37
|
+
var import_antd = require("antd");
|
|
38
|
+
var import_CustomerCard = __toESM(require("../../CustomerCard"));
|
|
39
|
+
var import_CheckCircle = __toESM(require("@pisell/icon/es/CheckCircle"));
|
|
40
|
+
var import_materials = require("@pisell/materials");
|
|
41
|
+
var import_PlusCircle = __toESM(require("@pisell/icon/es/PlusCircle"));
|
|
42
|
+
var import_index = require("./index.less");
|
|
43
|
+
var import_utils = require("@pisell/utils");
|
|
44
|
+
var CustomerList = (props) => {
|
|
45
|
+
const {
|
|
46
|
+
value,
|
|
47
|
+
onChange,
|
|
48
|
+
phone,
|
|
49
|
+
customerOrigin,
|
|
50
|
+
onLoadMore,
|
|
51
|
+
loading,
|
|
52
|
+
setPage
|
|
53
|
+
} = props;
|
|
54
|
+
const list = (0, import_react.useMemo)(() => {
|
|
55
|
+
const _list = (customerOrigin == null ? void 0 : customerOrigin.list) || [];
|
|
56
|
+
return _list;
|
|
57
|
+
}, [customerOrigin, phone]);
|
|
58
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, list.length ? /* @__PURE__ */ import_react.default.createElement("div", { className: "select-customer-right-panel-list" }, list.map((item) => {
|
|
59
|
+
const active = item.id === (value == null ? void 0 : value.id);
|
|
60
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
61
|
+
import_CustomerCard.default,
|
|
62
|
+
{
|
|
63
|
+
key: item.id,
|
|
64
|
+
className: (0, import_classnames.default)("select-customer-right-panel-item", {
|
|
65
|
+
"select-customer-right-panel-item-active": active
|
|
66
|
+
}),
|
|
67
|
+
customer: item,
|
|
68
|
+
showIcon: active,
|
|
69
|
+
customIcon: /* @__PURE__ */ import_react.default.createElement(import_CheckCircle.default, { style: { fontSize: 28, color: "#079455" } }),
|
|
70
|
+
onClickItem: () => {
|
|
71
|
+
onChange(item);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}), customerOrigin.list.length < customerOrigin.count ? /* @__PURE__ */ import_react.default.createElement("div", { className: "select-customer-right-panel-load-more" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: onLoadMore, loading }, import_utils.locales.getText("pisell2.text.load-more"))) : null) : !loading ? /* @__PURE__ */ import_react.default.createElement(
|
|
76
|
+
import_materials.PisellEmpty,
|
|
77
|
+
{
|
|
78
|
+
description: import_utils.locales.getText("pisell2.text.no-results-found"),
|
|
79
|
+
imageStyle: { height: "auto" },
|
|
80
|
+
extraDescription: /* @__PURE__ */ import_react.default.createElement(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
className: "select-customer-right-panel-add",
|
|
84
|
+
onClick: () => {
|
|
85
|
+
setPage("create");
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
/* @__PURE__ */ import_react.default.createElement(import_PlusCircle.default, { className: "select-customer-right-panel-header-icon" }),
|
|
89
|
+
/* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell2.text.create-new-client"))
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
) : /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { round: true, active: true }));
|
|
93
|
+
};
|
|
94
|
+
var List_default = CustomerList;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
.select-customer-right-panel-list {
|
|
2
|
+
width: 100%;
|
|
3
|
+
flex: 1;
|
|
4
|
+
overflow-y: auto;
|
|
5
|
+
|
|
6
|
+
.select-customer-right-panel-item {
|
|
7
|
+
border: none;
|
|
8
|
+
position: relative;
|
|
9
|
+
|
|
10
|
+
// &::before {
|
|
11
|
+
// content: '';
|
|
12
|
+
// position: absolute;
|
|
13
|
+
// bottom: 0;
|
|
14
|
+
// left: 0;
|
|
15
|
+
// width: 100%;
|
|
16
|
+
// height: 100%;
|
|
17
|
+
// background: transparent;
|
|
18
|
+
// z-index: 1;
|
|
19
|
+
// height: 1px;
|
|
20
|
+
// background-color: #eaecf0;
|
|
21
|
+
// }
|
|
22
|
+
|
|
23
|
+
&.select-customer-right-panel-item-active,
|
|
24
|
+
&:hover {
|
|
25
|
+
background: var(--Gray-100, #F2F4F7);
|
|
26
|
+
|
|
27
|
+
// &::before {
|
|
28
|
+
// display: none;
|
|
29
|
+
// }
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.select-customer-right-panel-load-more {
|
|
35
|
+
padding: 10px 0;
|
|
36
|
+
text-align: center;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.select-customer-right-panel-add {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
color: #7f56d9;
|
|
45
|
+
font-size: 16px;
|
|
46
|
+
font-style: normal;
|
|
47
|
+
font-weight: 400;
|
|
48
|
+
gap: 8px;
|
|
49
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface RightPanelProps {
|
|
4
|
+
value: any;
|
|
5
|
+
onChange: (value: any) => void;
|
|
6
|
+
phone: string;
|
|
7
|
+
}
|
|
8
|
+
export interface QueryParams {
|
|
9
|
+
sort_by: 'updated_at' | 'id' | '';
|
|
10
|
+
search: string;
|
|
11
|
+
skip: number;
|
|
12
|
+
num: number;
|
|
13
|
+
}
|
|
14
|
+
declare const RightPanel: (props: RightPanelProps) => React.JSX.Element;
|
|
15
|
+
export default RightPanel;
|
|
@@ -0,0 +1,152 @@
|
|
|
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/index.tsx
|
|
30
|
+
var RightPanel_exports = {};
|
|
31
|
+
__export(RightPanel_exports, {
|
|
32
|
+
default: () => RightPanel_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(RightPanel_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_index = require("./index.less");
|
|
37
|
+
var import_classnames = __toESM(require("classnames"));
|
|
38
|
+
var import_ahooks = require("ahooks");
|
|
39
|
+
var import_serve = require("./serve");
|
|
40
|
+
var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
|
|
41
|
+
var import_utils = require("../../../utils");
|
|
42
|
+
var import_PlusCircle = __toESM(require("@pisell/icon/es/PlusCircle"));
|
|
43
|
+
var import_List = __toESM(require("./List"));
|
|
44
|
+
var import_Add = __toESM(require("./Add"));
|
|
45
|
+
var import_ChevronLeft = __toESM(require("@pisell/icon/es/ChevronLeft"));
|
|
46
|
+
var import_utils2 = require("@pisell/utils");
|
|
47
|
+
var defaultParams = {
|
|
48
|
+
skip: 1,
|
|
49
|
+
num: 10,
|
|
50
|
+
sort_by: "id",
|
|
51
|
+
search: ""
|
|
52
|
+
};
|
|
53
|
+
var RightPanel = (props) => {
|
|
54
|
+
const { value, onChange, phone } = props;
|
|
55
|
+
const [page, setPage] = (0, import_react.useState)("list");
|
|
56
|
+
const context = (0, import_useEngineContext.default)();
|
|
57
|
+
import_utils.request.setRequest(context.appHelper.utils.request);
|
|
58
|
+
const [customerOrigin, setCustomerOrigin] = (0, import_react.useState)({
|
|
59
|
+
skip: 1,
|
|
60
|
+
count: 0,
|
|
61
|
+
list: []
|
|
62
|
+
});
|
|
63
|
+
const [params, setParams] = (0, import_react.useState)(defaultParams);
|
|
64
|
+
const _getCustomerList = (0, import_ahooks.useRequest)(import_serve.getCustomerList, {
|
|
65
|
+
manual: true,
|
|
66
|
+
onSuccess: (res, param) => {
|
|
67
|
+
const _params = param[0];
|
|
68
|
+
setParams(_params);
|
|
69
|
+
let list = [];
|
|
70
|
+
if (_params.skip === 1) {
|
|
71
|
+
list = res.list;
|
|
72
|
+
} else {
|
|
73
|
+
list = customerOrigin.list.concat(res.list);
|
|
74
|
+
}
|
|
75
|
+
setCustomerOrigin({ ...res, list });
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
(0, import_react.useEffect)(() => {
|
|
79
|
+
if (page !== "list") {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
_getCustomerList.run({
|
|
83
|
+
...defaultParams,
|
|
84
|
+
search: phone
|
|
85
|
+
});
|
|
86
|
+
}, [phone, page]);
|
|
87
|
+
const header = (0, import_react.useMemo)(() => {
|
|
88
|
+
if (page === "list") {
|
|
89
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "select-customer-right-panel-header" }, /* @__PURE__ */ import_react.default.createElement("span", null, phone ? import_utils2.locales.getText("pisell2.text.result-found") : import_utils2.locales.getText("pisell2.text.personnel-list")), /* @__PURE__ */ import_react.default.createElement(
|
|
90
|
+
"span",
|
|
91
|
+
{
|
|
92
|
+
className: "select-customer-right-panel-header-create-btn",
|
|
93
|
+
onClick: () => {
|
|
94
|
+
setPage("create");
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
/* @__PURE__ */ import_react.default.createElement(import_PlusCircle.default, { className: "select-customer-right-panel-header-icon" }),
|
|
98
|
+
import_utils2.locales.getText("pisell2.text.create")
|
|
99
|
+
));
|
|
100
|
+
}
|
|
101
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
102
|
+
"div",
|
|
103
|
+
{
|
|
104
|
+
className: (0, import_classnames.default)("select-customer-right-panel-header", {
|
|
105
|
+
"select-customer-right-panel-header-create": page === "create"
|
|
106
|
+
})
|
|
107
|
+
},
|
|
108
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
109
|
+
import_ChevronLeft.default,
|
|
110
|
+
{
|
|
111
|
+
className: "select-customer-right-panel-header-icon select-customer-right-panel-header-icon-back",
|
|
112
|
+
onClick: () => {
|
|
113
|
+
setPage("list");
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
import_utils2.locales.getText("pisell2.text.create-new-client")
|
|
118
|
+
);
|
|
119
|
+
}, [phone, page]);
|
|
120
|
+
const addChange = (values) => {
|
|
121
|
+
setPage("list");
|
|
122
|
+
if (values == null ? void 0 : values.is_checked) {
|
|
123
|
+
onChange == null ? void 0 : onChange(values);
|
|
124
|
+
}
|
|
125
|
+
setCustomerOrigin({
|
|
126
|
+
...customerOrigin,
|
|
127
|
+
count: customerOrigin.count + 1,
|
|
128
|
+
list: [values].concat(customerOrigin.list)
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "select-customer-right-panel" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "select-customer-right-panel-header" }, header), page === "list" ? /* @__PURE__ */ import_react.default.createElement(
|
|
132
|
+
import_List.default,
|
|
133
|
+
{
|
|
134
|
+
loading: _getCustomerList.loading,
|
|
135
|
+
phone,
|
|
136
|
+
customerOrigin,
|
|
137
|
+
value,
|
|
138
|
+
onChange,
|
|
139
|
+
onLoadMore: () => {
|
|
140
|
+
if (customerOrigin.list.length >= customerOrigin.count) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
_getCustomerList.run({
|
|
144
|
+
...params,
|
|
145
|
+
skip: params.skip + 1
|
|
146
|
+
});
|
|
147
|
+
},
|
|
148
|
+
setPage
|
|
149
|
+
}
|
|
150
|
+
) : null, page === "create" ? /* @__PURE__ */ import_react.default.createElement(import_Add.default, { phone, onChange: addChange }) : null);
|
|
151
|
+
};
|
|
152
|
+
var RightPanel_default = RightPanel;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
.select-customer-right-panel {
|
|
2
|
+
width: 348px;
|
|
3
|
+
height: 511px;
|
|
4
|
+
position: relative;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
|
|
8
|
+
.select-customer-right-panel-header {
|
|
9
|
+
color: var(--Gray-900, #101828);
|
|
10
|
+
font-size: 16px;
|
|
11
|
+
font-style: normal;
|
|
12
|
+
font-weight: 600;
|
|
13
|
+
line-height: 44px;
|
|
14
|
+
position: sticky;
|
|
15
|
+
top: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
width: 100%;
|
|
18
|
+
z-index: 1;
|
|
19
|
+
background-color: #fff;
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: space-between;
|
|
23
|
+
|
|
24
|
+
.select-customer-right-panel-header-create {
|
|
25
|
+
justify-content: flex-start;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.select-customer-right-panel-header-create-btn {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.select-customer-right-panel-header-icon {
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
width: 44px;
|
|
40
|
+
height: 44px;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
font-size: 24px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.select-customer-right-panel-header-icon-back {
|
|
46
|
+
justify-content: flex-start;
|
|
47
|
+
width: 24px;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
status: boolean;
|
|
3
|
+
code: number;
|
|
4
|
+
message: string;
|
|
5
|
+
data: {
|
|
6
|
+
list: ({
|
|
7
|
+
phone: string;
|
|
8
|
+
email: string;
|
|
9
|
+
country_calling_code: string;
|
|
10
|
+
channel: string;
|
|
11
|
+
shop_id: number;
|
|
12
|
+
display_name: string;
|
|
13
|
+
updated_at: string;
|
|
14
|
+
created_at: string;
|
|
15
|
+
id: number;
|
|
16
|
+
nickname?: undefined;
|
|
17
|
+
is_deleted?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
id: number;
|
|
20
|
+
shop_id: number;
|
|
21
|
+
country_calling_code: string;
|
|
22
|
+
phone: string;
|
|
23
|
+
display_name: string;
|
|
24
|
+
nickname: string;
|
|
25
|
+
email: string;
|
|
26
|
+
channel: string;
|
|
27
|
+
is_deleted: number;
|
|
28
|
+
created_at: string;
|
|
29
|
+
updated_at: string;
|
|
30
|
+
} | {
|
|
31
|
+
shop_id: string;
|
|
32
|
+
nickname: string;
|
|
33
|
+
channel: string;
|
|
34
|
+
updated_at: string;
|
|
35
|
+
created_at: string;
|
|
36
|
+
id: number;
|
|
37
|
+
phone?: undefined;
|
|
38
|
+
email?: undefined;
|
|
39
|
+
country_calling_code?: undefined;
|
|
40
|
+
display_name?: undefined;
|
|
41
|
+
is_deleted?: undefined;
|
|
42
|
+
})[];
|
|
43
|
+
count: number;
|
|
44
|
+
skip: number;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export default _default;
|