@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,227 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
12
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
import React, { useState, useMemo, useEffect } from 'react';
|
|
15
|
+
import { VirtualKeyboard } from '@pisell/materials';
|
|
16
|
+
import { Popover } from 'antd';
|
|
17
|
+
import RightPanel from "./RightPanel";
|
|
18
|
+
import CustomerCard from "./CustomerCard";
|
|
19
|
+
import "./index.less";
|
|
20
|
+
import { locales } from '@pisell/utils';
|
|
21
|
+
import useEngineContext from "../../hooks/useEngineContext";
|
|
22
|
+
import localeTexts from "./locales";
|
|
23
|
+
var items = [{
|
|
24
|
+
value: 1,
|
|
25
|
+
label: '1',
|
|
26
|
+
disabled: false,
|
|
27
|
+
type: 'text'
|
|
28
|
+
}, {
|
|
29
|
+
value: 2,
|
|
30
|
+
label: '2',
|
|
31
|
+
disabled: false,
|
|
32
|
+
type: 'text'
|
|
33
|
+
}, {
|
|
34
|
+
value: 3,
|
|
35
|
+
label: '3',
|
|
36
|
+
disabled: false,
|
|
37
|
+
type: 'text'
|
|
38
|
+
}, {
|
|
39
|
+
value: 4,
|
|
40
|
+
label: '4',
|
|
41
|
+
disabled: false,
|
|
42
|
+
type: 'text'
|
|
43
|
+
}, {
|
|
44
|
+
value: 5,
|
|
45
|
+
label: '5',
|
|
46
|
+
disabled: false,
|
|
47
|
+
type: 'text'
|
|
48
|
+
}, {
|
|
49
|
+
value: 6,
|
|
50
|
+
label: '6',
|
|
51
|
+
disabled: false,
|
|
52
|
+
type: 'text'
|
|
53
|
+
}, {
|
|
54
|
+
value: 7,
|
|
55
|
+
label: '7',
|
|
56
|
+
disabled: false,
|
|
57
|
+
type: 'text'
|
|
58
|
+
}, {
|
|
59
|
+
value: 8,
|
|
60
|
+
label: '8',
|
|
61
|
+
disabled: false,
|
|
62
|
+
type: 'text'
|
|
63
|
+
}, {
|
|
64
|
+
value: 9,
|
|
65
|
+
label: '9',
|
|
66
|
+
disabled: false,
|
|
67
|
+
type: 'text'
|
|
68
|
+
}, {
|
|
69
|
+
value: '+',
|
|
70
|
+
label: '+',
|
|
71
|
+
disabled: false,
|
|
72
|
+
type: 'text'
|
|
73
|
+
}, {
|
|
74
|
+
value: '0',
|
|
75
|
+
label: '0',
|
|
76
|
+
disabled: false,
|
|
77
|
+
type: 'text'
|
|
78
|
+
}, {
|
|
79
|
+
value: 'reset',
|
|
80
|
+
label: 'Reset',
|
|
81
|
+
disabled: false,
|
|
82
|
+
type: 'text'
|
|
83
|
+
}];
|
|
84
|
+
var PisellSelectCustomerModal = function PisellSelectCustomerModal(props) {
|
|
85
|
+
var onChange = props.onChange,
|
|
86
|
+
value = props.value,
|
|
87
|
+
popoverProps = props.popoverProps,
|
|
88
|
+
virtualKeyboardProps = props.virtualKeyboardProps,
|
|
89
|
+
keyboardProps = props.keyboardProps,
|
|
90
|
+
virtualKeyInputProps = props.virtualKeyInputProps,
|
|
91
|
+
cardProps = props.cardProps;
|
|
92
|
+
|
|
93
|
+
// 是否打开弹层
|
|
94
|
+
var _useState = useState(false),
|
|
95
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
96
|
+
open = _useState2[0],
|
|
97
|
+
setOpen = _useState2[1];
|
|
98
|
+
// 当前选择客户 -内部数据
|
|
99
|
+
var _useState3 = useState(),
|
|
100
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
101
|
+
_value = _useState4[0],
|
|
102
|
+
set_value = _useState4[1];
|
|
103
|
+
// 当前输入的值
|
|
104
|
+
var _useState5 = useState(''),
|
|
105
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
106
|
+
phone = _useState6[0],
|
|
107
|
+
setPhone = _useState6[1];
|
|
108
|
+
var context = useEngineContext();
|
|
109
|
+
// 初始化多语言
|
|
110
|
+
locales.init(localeTexts, localStorage.getItem('umi_locale') || 'en');
|
|
111
|
+
useEffect(function () {
|
|
112
|
+
set_value(value);
|
|
113
|
+
}, [value]);
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @title: 返回逻辑
|
|
117
|
+
* @description:
|
|
118
|
+
* @param {any} e
|
|
119
|
+
* @return {*}
|
|
120
|
+
* @Author: zhiwei.Wang
|
|
121
|
+
* @Date: 2024-11-02 09:30
|
|
122
|
+
*/
|
|
123
|
+
var _onChange = function _onChange(e) {
|
|
124
|
+
set_value(e);
|
|
125
|
+
// setPhone('');
|
|
126
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(e);
|
|
127
|
+
setOpen(false);
|
|
128
|
+
};
|
|
129
|
+
var onOpenChange = function onOpenChange(e) {
|
|
130
|
+
setOpen(e);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
// 防止页面过小时出现滚动条 造成页面滚动
|
|
134
|
+
useEffect(function () {
|
|
135
|
+
if (open) {
|
|
136
|
+
document.body.classList.add('hide-scroll');
|
|
137
|
+
} else {
|
|
138
|
+
setTimeout(function () {
|
|
139
|
+
document.body.classList.remove('hide-scroll');
|
|
140
|
+
}, 150);
|
|
141
|
+
}
|
|
142
|
+
}, [open]);
|
|
143
|
+
useEffect(function () {
|
|
144
|
+
document.body.id = 'body';
|
|
145
|
+
}, []);
|
|
146
|
+
|
|
147
|
+
// 动态计算input的字体大小
|
|
148
|
+
var adjustFontSize = useMemo(function () {
|
|
149
|
+
// 没有内容固定位30px, 因为placeholder的字体大小是30px 太大会展示不全
|
|
150
|
+
if (!phone) {
|
|
151
|
+
return 30;
|
|
152
|
+
}
|
|
153
|
+
var maxFontSize = 60; // 最大字体大小
|
|
154
|
+
var minFontSize = 10; // 最小字体大小
|
|
155
|
+
var defaultFontSize = maxFontSize;
|
|
156
|
+
|
|
157
|
+
// 获取输入框的宽度
|
|
158
|
+
var inputWidth = 248;
|
|
159
|
+
|
|
160
|
+
// 创建一个临时span元素用于测量内容宽度
|
|
161
|
+
var span = document.createElement('span');
|
|
162
|
+
span.style.position = 'absolute';
|
|
163
|
+
span.style.whiteSpace = 'nowrap';
|
|
164
|
+
span.style.visibility = 'hidden';
|
|
165
|
+
span.style.fontSize = "".concat(defaultFontSize, "px");
|
|
166
|
+
span.textContent = phone;
|
|
167
|
+
document.body.appendChild(span);
|
|
168
|
+
var fontSize = maxFontSize;
|
|
169
|
+
|
|
170
|
+
// 动态调整字体大小直到内容宽度小于或等于输入框宽度
|
|
171
|
+
while (span.offsetWidth > inputWidth && fontSize > minFontSize) {
|
|
172
|
+
fontSize -= 0.5;
|
|
173
|
+
span.style.fontSize = "".concat(fontSize, "px");
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// 移除临时span元素
|
|
177
|
+
document.body.removeChild(span);
|
|
178
|
+
return fontSize;
|
|
179
|
+
}, [phone]);
|
|
180
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Popover, _extends({
|
|
181
|
+
content: /*#__PURE__*/React.createElement(VirtualKeyboard, _extends({
|
|
182
|
+
style: {
|
|
183
|
+
zoom: 0.8
|
|
184
|
+
},
|
|
185
|
+
keyboardProps: _objectSpread({
|
|
186
|
+
keydown: false,
|
|
187
|
+
items: items,
|
|
188
|
+
onChange: function onChange(e) {
|
|
189
|
+
if (e === 'reset') {
|
|
190
|
+
setPhone('');
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
setPhone(phone + String(e));
|
|
194
|
+
}
|
|
195
|
+
}, keyboardProps),
|
|
196
|
+
virtualKeyInputProps: _objectSpread({
|
|
197
|
+
value: phone,
|
|
198
|
+
onChange: function onChange(e) {
|
|
199
|
+
setPhone(e.target.value);
|
|
200
|
+
},
|
|
201
|
+
placeholder: locales.getText('pisell2.text.search-customer-by-phone-number'),
|
|
202
|
+
style: {
|
|
203
|
+
textAlign: 'left',
|
|
204
|
+
fontSize: adjustFontSize
|
|
205
|
+
},
|
|
206
|
+
className: 'pisell-select-customer-modal-input'
|
|
207
|
+
}, virtualKeyInputProps),
|
|
208
|
+
rightPanel: /*#__PURE__*/React.createElement(RightPanel, {
|
|
209
|
+
value: _value,
|
|
210
|
+
phone: phone,
|
|
211
|
+
onChange: _onChange
|
|
212
|
+
})
|
|
213
|
+
}, virtualKeyboardProps)),
|
|
214
|
+
open: open,
|
|
215
|
+
placement: "bottom",
|
|
216
|
+
arrow: false,
|
|
217
|
+
onOpenChange: onOpenChange,
|
|
218
|
+
trigger: ['click']
|
|
219
|
+
}, popoverProps), /*#__PURE__*/React.createElement(CustomerCard, _extends({
|
|
220
|
+
onClickItem: function onClickItem() {
|
|
221
|
+
setOpen(true);
|
|
222
|
+
},
|
|
223
|
+
customer: _value,
|
|
224
|
+
onRemove: _onChange
|
|
225
|
+
}, cardProps))));
|
|
226
|
+
};
|
|
227
|
+
export default PisellSelectCustomerModal;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
body {
|
|
2
|
+
&.hide-scroll {
|
|
3
|
+
|
|
4
|
+
&::-webkit-scrollbar {
|
|
5
|
+
display: none;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
&::-webkit-scrollbar-thumb {
|
|
9
|
+
display: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&::-webkit-scrollbar-track {
|
|
13
|
+
display: none;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.pisell-select-customer-modal-input {
|
|
19
|
+
&::placeholder {
|
|
20
|
+
font-size: 30px;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
en: {
|
|
3
|
+
'pisell2.text.leave-empty-for-walk-in': string;
|
|
4
|
+
'pisell2.text.date-year-text': string;
|
|
5
|
+
'pisell2.text.date-month-text': string;
|
|
6
|
+
'pisell2.text.date-day-text': string;
|
|
7
|
+
'pisell2.text.gender': string;
|
|
8
|
+
'pisell2.text.gender.male': string;
|
|
9
|
+
'pisell2.text.gender.female': string;
|
|
10
|
+
'pisell2.text.birthday': string;
|
|
11
|
+
'pisell2.text.phone': string;
|
|
12
|
+
'pisell2.text.email': string;
|
|
13
|
+
'pisell2.text.lastname': string;
|
|
14
|
+
'pisell2.text.firstname': string;
|
|
15
|
+
'pisell2.text.email-error-message': string;
|
|
16
|
+
'pisell2.text.notes': string;
|
|
17
|
+
'pisell2.text.save': string;
|
|
18
|
+
'pisell2.text.save-and-select': string;
|
|
19
|
+
'pisell2.text.no-results-found': string;
|
|
20
|
+
'pisell2.text.create-new-client': string;
|
|
21
|
+
'pisell2.text.result-found': string;
|
|
22
|
+
'pisell2.text.personnel-list': string;
|
|
23
|
+
'pisell2.text.load-more': string;
|
|
24
|
+
'pisell2.text.add-client.confirm': string;
|
|
25
|
+
'pisell2.text.search-customer-by-phone-number': string;
|
|
26
|
+
'pisell2.text.create': string;
|
|
27
|
+
};
|
|
28
|
+
'zh-CN': {
|
|
29
|
+
'pisell2.text.leave-empty-for-walk-in': string;
|
|
30
|
+
'pisell2.text.date-year-text': string;
|
|
31
|
+
'pisell2.text.date-month-text': string;
|
|
32
|
+
'pisell2.text.date-day-text': string;
|
|
33
|
+
'pisell2.text.gender': string;
|
|
34
|
+
'pisell2.text.gender.male': string;
|
|
35
|
+
'pisell2.text.gender.female': string;
|
|
36
|
+
'pisell2.text.birthday': string;
|
|
37
|
+
'pisell2.text.phone': string;
|
|
38
|
+
'pisell2.text.email': string;
|
|
39
|
+
'pisell2.text.lastname': string;
|
|
40
|
+
'pisell2.text.firstname': string;
|
|
41
|
+
'pisell2.text.email-error-message': string;
|
|
42
|
+
'pisell2.text.notes': string;
|
|
43
|
+
'pisell2.text.save': string;
|
|
44
|
+
'pisell2.text.save-and-select': string;
|
|
45
|
+
'pisell2.text.no-results-found': string;
|
|
46
|
+
'pisell2.text.create-new-client': string;
|
|
47
|
+
'pisell2.text.result-found': string;
|
|
48
|
+
'pisell2.text.personnel-list': string;
|
|
49
|
+
'pisell2.text.add-client.confirm': string;
|
|
50
|
+
'pisell2.text.load-more': string;
|
|
51
|
+
'pisell2.text.search-customer-by-phone-number': string;
|
|
52
|
+
'pisell2.text.create': string;
|
|
53
|
+
};
|
|
54
|
+
'zh-HK': {
|
|
55
|
+
'pisell2.text.leave-empty-for-walk-in': string;
|
|
56
|
+
'pisell2.text.date-year-text': string;
|
|
57
|
+
'pisell2.text.date-month-text': string;
|
|
58
|
+
'pisell2.text.date-day-text': string;
|
|
59
|
+
'pisell2.text.gender': string;
|
|
60
|
+
'pisell2.text.gender.male': string;
|
|
61
|
+
'pisell2.text.gender.female': string;
|
|
62
|
+
'pisell2.text.birthday': string;
|
|
63
|
+
'pisell2.text.phone': string;
|
|
64
|
+
'pisell2.text.email': string;
|
|
65
|
+
'pisell2.text.lastname': string;
|
|
66
|
+
'pisell2.text.firstname': string;
|
|
67
|
+
'pisell2.text.email-error-message': string;
|
|
68
|
+
'pisell2.text.notes': string;
|
|
69
|
+
'pisell2.text.save': string;
|
|
70
|
+
'pisell2.text.save-and-select': string;
|
|
71
|
+
'pisell2.text.no-results-found': string;
|
|
72
|
+
'pisell2.text.create-new-client': string;
|
|
73
|
+
'pisell2.text.result-found': string;
|
|
74
|
+
'pisell2.text.personnel-list': string;
|
|
75
|
+
'pisell2.text.add-client.confirm': string;
|
|
76
|
+
'pisell2.text.load-more': string;
|
|
77
|
+
'pisell2.text.search-customer-by-phone-number': string;
|
|
78
|
+
'pisell2.text.create': string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
export default _default;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"en": {
|
|
3
|
+
'pisell2.text.leave-empty-for-walk-in': 'Leave empty for walk-in',
|
|
4
|
+
'pisell2.text.date-year-text': 'YYYY',
|
|
5
|
+
'pisell2.text.date-month-text': 'MM',
|
|
6
|
+
'pisell2.text.date-day-text': 'DD',
|
|
7
|
+
'pisell2.text.gender': 'Gender',
|
|
8
|
+
'pisell2.text.gender.male': 'Male',
|
|
9
|
+
'pisell2.text.gender.female': 'Female',
|
|
10
|
+
'pisell2.text.birthday': 'Birthday',
|
|
11
|
+
'pisell2.text.phone': 'Phone Number',
|
|
12
|
+
'pisell2.text.email': 'Email',
|
|
13
|
+
'pisell2.text.lastname': 'Last Name',
|
|
14
|
+
'pisell2.text.firstname': 'First Name',
|
|
15
|
+
'pisell2.text.email-error-message': 'Email format error',
|
|
16
|
+
'pisell2.text.notes': 'Note',
|
|
17
|
+
'pisell2.text.save': 'Save',
|
|
18
|
+
'pisell2.text.save-and-select': 'Save and select',
|
|
19
|
+
'pisell2.text.no-results-found': 'No results found.',
|
|
20
|
+
'pisell2.text.create-new-client': 'Create new client',
|
|
21
|
+
'pisell2.text.result-found': 'Result found',
|
|
22
|
+
'pisell2.text.personnel-list': 'Personnel list',
|
|
23
|
+
'pisell2.text.load-more': 'Load more',
|
|
24
|
+
'pisell2.text.add-client.confirm': 'Fill in at least one name, phone number and email address',
|
|
25
|
+
'pisell2.text.search-customer-by-phone-number': 'Search by phone number',
|
|
26
|
+
'pisell2.text.create': 'Create'
|
|
27
|
+
},
|
|
28
|
+
'zh-CN': {
|
|
29
|
+
'pisell2.text.leave-empty-for-walk-in': '未选择表示 Walk-In',
|
|
30
|
+
'pisell2.text.date-year-text': '年',
|
|
31
|
+
'pisell2.text.date-month-text': '月',
|
|
32
|
+
'pisell2.text.date-day-text': '日',
|
|
33
|
+
'pisell2.text.gender': '性别',
|
|
34
|
+
'pisell2.text.gender.male': '男',
|
|
35
|
+
'pisell2.text.gender.female': '女',
|
|
36
|
+
'pisell2.text.birthday': '生日',
|
|
37
|
+
'pisell2.text.phone': '电话号码',
|
|
38
|
+
'pisell2.text.email': '电子邮箱',
|
|
39
|
+
'pisell2.text.lastname': '姓',
|
|
40
|
+
'pisell2.text.firstname': '名',
|
|
41
|
+
'pisell2.text.email-error-message': '电子邮件格式错误',
|
|
42
|
+
'pisell2.text.notes': '备注',
|
|
43
|
+
'pisell2.text.save': '保存',
|
|
44
|
+
'pisell2.text.save-and-select': '保存并选中',
|
|
45
|
+
'pisell2.text.no-results-found': '没有搜索到结果',
|
|
46
|
+
'pisell2.text.create-new-client': '创建新客户',
|
|
47
|
+
'pisell2.text.result-found': '搜索结果',
|
|
48
|
+
'pisell2.text.personnel-list': '客户列表',
|
|
49
|
+
'pisell2.text.add-client.confirm': '姓名,电话,邮箱至少填一个',
|
|
50
|
+
'pisell2.text.load-more': '加载更多',
|
|
51
|
+
'pisell2.text.search-customer-by-phone-number': '输入手机号搜索客户',
|
|
52
|
+
'pisell2.text.create': '创建'
|
|
53
|
+
},
|
|
54
|
+
'zh-HK': {
|
|
55
|
+
'pisell2.text.leave-empty-for-walk-in': '未選擇表示 Walk-In',
|
|
56
|
+
'pisell2.text.date-year-text': '年',
|
|
57
|
+
'pisell2.text.date-month-text': '月',
|
|
58
|
+
'pisell2.text.date-day-text': '日',
|
|
59
|
+
'pisell2.text.gender': '性别',
|
|
60
|
+
'pisell2.text.gender.male': '男',
|
|
61
|
+
'pisell2.text.gender.female': '女',
|
|
62
|
+
'pisell2.text.birthday': '生日',
|
|
63
|
+
'pisell2.text.phone': '電話號碼',
|
|
64
|
+
'pisell2.text.email': '電子郵箱',
|
|
65
|
+
'pisell2.text.lastname': '姓',
|
|
66
|
+
'pisell2.text.firstname': '名',
|
|
67
|
+
'pisell2.text.email-error-message': '電子郵件格式錯誤',
|
|
68
|
+
'pisell2.text.notes': '備註',
|
|
69
|
+
'pisell2.text.save': '保存',
|
|
70
|
+
'pisell2.text.save-and-select': '保存並選中',
|
|
71
|
+
'pisell2.text.no-results-found': '沒有搜索到客戶',
|
|
72
|
+
'pisell2.text.create-new-client': '創建新客戶',
|
|
73
|
+
'pisell2.text.result-found': '搜索結果',
|
|
74
|
+
'pisell2.text.personnel-list': '客戶列表',
|
|
75
|
+
'pisell2.text.add-client.confirm': '姓名,電話,郵箱至少填一個',
|
|
76
|
+
'pisell2.text.load-more': '加載更多',
|
|
77
|
+
'pisell2.text.search-customer-by-phone-number': '輸入手機號搜索客戶',
|
|
78
|
+
'pisell2.text.create': '創建'
|
|
79
|
+
}
|
|
80
|
+
};
|
package/es/index.d.ts
CHANGED
|
@@ -21,3 +21,4 @@ export { default as ToCPay } from './components/pay/toC';
|
|
|
21
21
|
export { default as Eftpos } from './components/eftpos';
|
|
22
22
|
export { default as EftposPay } from './components/eftposPay';
|
|
23
23
|
export { default as BookingDashboard } from './components/booking/dashboard';
|
|
24
|
+
export { default as PisellSelectCustomerModal } from './components/pisellSelectCustomerModal';
|
package/es/index.js
CHANGED
|
@@ -24,4 +24,5 @@ export { default as TaxSelect } from "./components/taxSelect";
|
|
|
24
24
|
export { default as ToCPay } from "./components/pay/toC";
|
|
25
25
|
export { default as Eftpos } from "./components/eftpos";
|
|
26
26
|
export { default as EftposPay } from "./components/eftposPay";
|
|
27
|
-
export { default as BookingDashboard } from "./components/booking/dashboard";
|
|
27
|
+
export { default as BookingDashboard } from "./components/booking/dashboard";
|
|
28
|
+
export { default as PisellSelectCustomerModal } from "./components/pisellSelectCustomerModal";
|
|
@@ -9,4 +9,5 @@ import ProductExtension from './productExtension';
|
|
|
9
9
|
import RuleSetting from './ruleSetting';
|
|
10
10
|
import TaxSelect from './taxSelect';
|
|
11
11
|
import ToCPay from './pay/toC';
|
|
12
|
-
|
|
12
|
+
import PisellSelectCustomerModal from './pisellSelectCustomerModal';
|
|
13
|
+
export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal };
|
package/lib/components/index.js
CHANGED
|
@@ -35,6 +35,7 @@ __export(components_exports, {
|
|
|
35
35
|
BookingInfo: () => import_info.default,
|
|
36
36
|
BookingNotes: () => import_notes.default,
|
|
37
37
|
Login: () => import_login.default,
|
|
38
|
+
PisellSelectCustomerModal: () => import_pisellSelectCustomerModal.default,
|
|
38
39
|
ProductExtension: () => import_productExtension.default,
|
|
39
40
|
RuleSetting: () => import_ruleSetting.default,
|
|
40
41
|
Schedules: () => import_schedules.default,
|
|
@@ -53,6 +54,7 @@ var import_productExtension = __toESM(require("./productExtension"));
|
|
|
53
54
|
var import_ruleSetting = __toESM(require("./ruleSetting"));
|
|
54
55
|
var import_taxSelect = __toESM(require("./taxSelect"));
|
|
55
56
|
var import_toC = __toESM(require("./pay/toC"));
|
|
57
|
+
var import_pisellSelectCustomerModal = __toESM(require("./pisellSelectCustomerModal"));
|
|
56
58
|
// Annotate the CommonJS export names for ESM import in node:
|
|
57
59
|
0 && (module.exports = {
|
|
58
60
|
Booking,
|
|
@@ -61,6 +63,7 @@ var import_toC = __toESM(require("./pay/toC"));
|
|
|
61
63
|
BookingInfo,
|
|
62
64
|
BookingNotes,
|
|
63
65
|
Login,
|
|
66
|
+
PisellSelectCustomerModal,
|
|
64
67
|
ProductExtension,
|
|
65
68
|
RuleSetting,
|
|
66
69
|
Schedules,
|
|
@@ -134,6 +134,9 @@ var checkEnrollment = async (orderId, cardInfo, callback) => {
|
|
|
134
134
|
...cardInfo
|
|
135
135
|
});
|
|
136
136
|
(0, import_payGroup.setPayNumber)(orderId, data == null ? void 0 : data.pay_number);
|
|
137
|
+
if (!(data == null ? void 0 : data.pay_info)) {
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
137
140
|
return data;
|
|
138
141
|
} catch (err) {
|
|
139
142
|
log({
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export interface CustomerCardProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
onClickItem: (value?: any) => void;
|
|
6
|
+
customer?: any;
|
|
7
|
+
showIcon?: boolean;
|
|
8
|
+
onRemove?: (value?: any) => void;
|
|
9
|
+
customIcon?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare const CustomerCard: ({ onClickItem, customer, showIcon, customIcon, onRemove, className, }: CustomerCardProps) => React.JSX.Element;
|
|
12
|
+
export default CustomerCard;
|
|
@@ -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
|
+
}
|