@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,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;
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/serve.ts
|
|
20
|
+
var serve_exports = {};
|
|
21
|
+
__export(serve_exports, {
|
|
22
|
+
defaultCodes: () => defaultCodes,
|
|
23
|
+
getCountries: () => getCountries
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(serve_exports);
|
|
26
|
+
var import_utils = require("../../../../../utils");
|
|
27
|
+
var import_utils2 = require("@pisell/utils");
|
|
28
|
+
var formatData = (data) => {
|
|
29
|
+
return data.map((item, i) => {
|
|
30
|
+
return {
|
|
31
|
+
label: `${item.name} (+${item.calling_code})`,
|
|
32
|
+
value: "+" + item.calling_code,
|
|
33
|
+
key: i
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
var defaultCodes = formatData([
|
|
38
|
+
{
|
|
39
|
+
"name": "Mexico",
|
|
40
|
+
"code": "MX",
|
|
41
|
+
"calling_code": "52",
|
|
42
|
+
"currency_code": "MXN"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "美国",
|
|
46
|
+
"code": "US",
|
|
47
|
+
"calling_code": "1",
|
|
48
|
+
"currency_code": "USD"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "加拿大",
|
|
52
|
+
"code": "CA",
|
|
53
|
+
"calling_code": "1",
|
|
54
|
+
"currency_code": "CAD"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "澳大利亚",
|
|
58
|
+
"code": "AU",
|
|
59
|
+
"calling_code": "61",
|
|
60
|
+
"currency_code": "AUD"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "新西兰",
|
|
64
|
+
"code": "NZ",
|
|
65
|
+
"calling_code": "64",
|
|
66
|
+
"currency_code": "NZD"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "新加坡",
|
|
70
|
+
"code": "SG",
|
|
71
|
+
"calling_code": "65",
|
|
72
|
+
"currency_code": "SGD"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "香港特别行政区",
|
|
76
|
+
"code": "HK",
|
|
77
|
+
"calling_code": "852",
|
|
78
|
+
"currency_code": "HKD"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "中国",
|
|
82
|
+
"code": "CN",
|
|
83
|
+
"calling_code": "86",
|
|
84
|
+
"currency_code": "AUD"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "日本",
|
|
88
|
+
"code": "JP",
|
|
89
|
+
"calling_code": "81",
|
|
90
|
+
"currency_code": "JPY"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"name": "马来西亚",
|
|
94
|
+
"code": "MY",
|
|
95
|
+
"calling_code": "60",
|
|
96
|
+
"currency_code": "USD"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "英国",
|
|
100
|
+
"code": "GB",
|
|
101
|
+
"calling_code": "44",
|
|
102
|
+
"currency_code": "GBP"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "法国",
|
|
106
|
+
"code": "FR",
|
|
107
|
+
"calling_code": "33",
|
|
108
|
+
"currency_code": "EUR"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "意大利",
|
|
112
|
+
"code": "IT",
|
|
113
|
+
"calling_code": "39",
|
|
114
|
+
"currency_code": "EUR"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"name": "Ireland",
|
|
118
|
+
"code": "IE",
|
|
119
|
+
"calling_code": "353",
|
|
120
|
+
"currency_code": "EUR"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "Netherlands",
|
|
124
|
+
"code": "NL",
|
|
125
|
+
"calling_code": "31",
|
|
126
|
+
"currency_code": "EUR"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"name": "Germany",
|
|
130
|
+
"code": "DE",
|
|
131
|
+
"calling_code": "49",
|
|
132
|
+
"currency_code": "EUR"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"name": "Spain",
|
|
136
|
+
"code": "ES",
|
|
137
|
+
"calling_code": "34",
|
|
138
|
+
"currency_code": "EUR"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "India",
|
|
142
|
+
"code": "IND",
|
|
143
|
+
"calling_code": "91",
|
|
144
|
+
"currency_code": "INR"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"name": "Nigeria",
|
|
148
|
+
"code": "NG",
|
|
149
|
+
"calling_code": "234",
|
|
150
|
+
"currency_code": "NGN"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"name": "Islamic Republic of Pakistan",
|
|
154
|
+
"code": "PAK",
|
|
155
|
+
"calling_code": "92",
|
|
156
|
+
"currency_code": "PRK"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"name": "Philippines",
|
|
160
|
+
"code": "PH",
|
|
161
|
+
"calling_code": "63",
|
|
162
|
+
"currency_code": "PHP"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"name": "Thailand",
|
|
166
|
+
"code": "TH",
|
|
167
|
+
"calling_code": "66",
|
|
168
|
+
"currency_code": "THB"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "South Africa",
|
|
172
|
+
"code": "ZA",
|
|
173
|
+
"calling_code": "27",
|
|
174
|
+
"currency_code": "ZAR"
|
|
175
|
+
}
|
|
176
|
+
]);
|
|
177
|
+
var getCountries = async (params) => {
|
|
178
|
+
import_utils.request.getRequest().get("/shop/area/country", { "translate-locale": import_utils2.locales.formatLocale(localStorage.getItem("umi_locale") || "en") }, { abort: true, useCache: true }).then((res) => {
|
|
179
|
+
localStorage.setItem("pisell2_data_countries", JSON.stringify(formatData(res.data || [])));
|
|
180
|
+
});
|
|
181
|
+
let data = localStorage.getItem("pisell2_data_countries");
|
|
182
|
+
if (data) {
|
|
183
|
+
data = JSON.parse(data);
|
|
184
|
+
return data;
|
|
185
|
+
} else {
|
|
186
|
+
return defaultCodes;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
190
|
+
0 && (module.exports = {
|
|
191
|
+
defaultCodes,
|
|
192
|
+
getCountries
|
|
193
|
+
});
|