@subiz/widget-v4 4.0.63 → 4.0.64
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/babel.config.js +2 -4
- package/compiled_src/bot.js +7 -1
- package/compiled_src/call/call.js +15 -12
- package/compiled_src/chatbox/DropdownSelect.js +75 -66
- package/compiled_src/chatbox/MessageInput.js +7 -4
- package/compiled_src/chatbox/Order.js +94 -90
- package/compiled_src/chatbox/Rating.js +10 -7
- package/compiled_src/chatbox/Widget.js +27 -23
- package/compiled_src/contact/contact.js +9 -6
- package/compiled_src/lib.js +14 -9
- package/compiled_src/notif/notif.js +15 -12
- package/compiled_src/order/address_picker.js +71 -63
- package/compiled_src/order/order.js +330 -316
- package/compiled_src/popup/countdown.js +7 -4
- package/compiled_src/popup/popup.js +12 -9
- package/compiled_src/store/api.js +110 -80
- package/compiled_src/store/api_fake.js +82 -55
- package/compiled_src/store/store.js +170 -133
- package/dist/132.js +633 -588
- package/dist/17ee31b89ac.132.js +1 -0
- package/dist/{17e757ccadd.178.js → 17ee31b89ac.178.js} +0 -0
- package/dist/17ee31b89ac.213.js +1 -0
- package/dist/17ee31b89ac.335.js +1 -0
- package/dist/{17e757ccadd.362.js → 17ee31b89ac.362.js} +1 -1
- package/dist/17ee31b89ac.441.js +1 -0
- package/dist/17ee31b89ac.605.js +1 -0
- package/dist/{17e757ccadd.678.js → 17ee31b89ac.678.js} +0 -0
- package/dist/{17e757ccadd.782.js → 17ee31b89ac.782.js} +1 -1
- package/dist/17ee31b89ac.app.js +1 -0
- package/dist/{17e757ccadd.index.html → 17ee31b89ac.index.html} +1 -1
- package/dist/{17e757ccadd.library.html → 17ee31b89ac.library.html} +1 -1
- package/dist/17ee31b89ac.library.js +1 -0
- package/dist/{17e757ccadd.preview.html → 17ee31b89ac.preview.html} +1 -1
- package/dist/17ee31b89ac.preview.js +1 -0
- package/dist/17ee31b89ac.screenshoot.js +1 -0
- package/dist/213.js +19 -13
- package/dist/335.js +9 -6
- package/dist/362.js +1 -1
- package/dist/441.js +2 -2
- package/dist/605.js +15 -12
- package/dist/782.js +1 -1
- package/dist/HASH +1 -1
- package/dist/screenshoot.html +1 -1
- package/dist/screenshoot.js +372 -273
- package/package.json +12 -12
- package/src/bot.js +2 -1
- package/dist/17e757ccadd.132.js +0 -1
- package/dist/17e757ccadd.213.js +0 -1
- package/dist/17e757ccadd.335.js +0 -1
- package/dist/17e757ccadd.441.js +0 -1
- package/dist/17e757ccadd.605.js +0 -1
- package/dist/17e757ccadd.app.js +0 -1
- package/dist/17e757ccadd.library.js +0 -1
- package/dist/17e757ccadd.preview.js +0 -1
- package/dist/17e757ccadd.screenshoot.js +0 -1
|
@@ -13,6 +13,8 @@ var _common = require("../common.js");
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
|
+
|
|
16
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
19
|
|
|
18
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -20,20 +22,21 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
20
22
|
let notifCSS = (() => Promise.resolve().then(() => _interopRequireWildcard(require('./css.js'))))();
|
|
21
23
|
|
|
22
24
|
class Notif extends _common.Com {
|
|
23
|
-
state = {
|
|
24
|
-
close: true,
|
|
25
|
-
cssready: false,
|
|
26
|
-
closeAnimation: true,
|
|
27
|
-
imageReady: false,
|
|
28
|
-
user: {},
|
|
29
|
-
timestamp: '',
|
|
30
|
-
message: '',
|
|
31
|
-
title: '',
|
|
32
|
-
last_show: 0
|
|
33
|
-
};
|
|
34
|
-
|
|
35
25
|
constructor(props) {
|
|
36
26
|
super(props);
|
|
27
|
+
|
|
28
|
+
_defineProperty(this, "state", {
|
|
29
|
+
close: true,
|
|
30
|
+
cssready: false,
|
|
31
|
+
closeAnimation: true,
|
|
32
|
+
imageReady: false,
|
|
33
|
+
user: {},
|
|
34
|
+
timestamp: '',
|
|
35
|
+
message: '',
|
|
36
|
+
title: '',
|
|
37
|
+
last_show: 0
|
|
38
|
+
});
|
|
39
|
+
|
|
37
40
|
setTimeout(async () => {
|
|
38
41
|
let {
|
|
39
42
|
body: impression
|
|
@@ -15,53 +15,86 @@ var _spinner = _interopRequireDefault(require("../chatbox/spinner.js"));
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
state = {
|
|
20
|
-
show: false,
|
|
21
|
-
searchValue: '',
|
|
22
|
-
addresses: []
|
|
23
|
-
};
|
|
24
|
-
filterRef = (0, _preact.createRef)();
|
|
25
|
-
overlayRef = (0, _preact.createRef)();
|
|
18
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
26
19
|
|
|
20
|
+
class AddressPicker extends _common.Com {
|
|
27
21
|
constructor(props) {
|
|
28
22
|
super(props);
|
|
29
|
-
document.addEventListener('touchmove', function (e) {});
|
|
30
|
-
}
|
|
31
23
|
|
|
32
|
-
|
|
33
|
-
if (e.target === this.overlayRef.current) {
|
|
34
|
-
e.preventDefault();
|
|
35
|
-
e.stopPropagation();
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
hideDropdown = () => {
|
|
39
|
-
this.setState({
|
|
24
|
+
_defineProperty(this, "state", {
|
|
40
25
|
show: false,
|
|
41
|
-
searchValue: ''
|
|
26
|
+
searchValue: '',
|
|
27
|
+
addresses: []
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
_defineProperty(this, "filterRef", (0, _preact.createRef)());
|
|
31
|
+
|
|
32
|
+
_defineProperty(this, "overlayRef", (0, _preact.createRef)());
|
|
33
|
+
|
|
34
|
+
_defineProperty(this, "onTouchMove", e => {
|
|
35
|
+
if (e.target === this.overlayRef.current) {
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
e.stopPropagation();
|
|
38
|
+
}
|
|
42
39
|
});
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (this.state.searchValue) this.setState({
|
|
40
|
+
|
|
41
|
+
_defineProperty(this, "hideDropdown", () => {
|
|
42
|
+
this.setState({
|
|
43
|
+
show: false,
|
|
48
44
|
searchValue: ''
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
_defineProperty(this, "onKeydown", e => {
|
|
49
|
+
if (e.key === 'Escape') {
|
|
50
|
+
if (!this.state.show) return;
|
|
51
|
+
if (this.state.searchValue) this.setState({
|
|
52
|
+
searchValue: ''
|
|
53
|
+
});else this.hideDropdown();
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
e.stopPropagation();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (e.key == 'Enter') {}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
_defineProperty(this, "doSearch", _index.default.throttle(async () => {
|
|
62
|
+
let requestId = Date.now();
|
|
63
|
+
this.requestId = requestId;
|
|
64
|
+
let res = await this.props.store.suggest_addresses(this.state.searchValue);
|
|
65
|
+
if (this.requestId !== requestId) return;
|
|
66
|
+
this.setState({
|
|
67
|
+
addresses: _index.default.get(res, 'body.addresses', [])
|
|
68
|
+
});
|
|
69
|
+
}, 100));
|
|
53
70
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if (this.requestId !== requestId) return;
|
|
61
|
-
this.setState({
|
|
62
|
-
addresses: _index.default.get(res, 'body.addresses', [])
|
|
71
|
+
_defineProperty(this, "onChangeSearchValue", e => {
|
|
72
|
+
this.setState({
|
|
73
|
+
searchValue: e.target.value
|
|
74
|
+
});
|
|
75
|
+
this.props.onChangeAddress(e.target.value);
|
|
76
|
+
this.doSearch();
|
|
63
77
|
});
|
|
64
|
-
|
|
78
|
+
|
|
79
|
+
_defineProperty(this, "toogleDropdown", async () => {
|
|
80
|
+
await this.setState({
|
|
81
|
+
show: true,
|
|
82
|
+
searchValue: this.props.initAddress || ''
|
|
83
|
+
});
|
|
84
|
+
this.focusFilter();
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
_defineProperty(this, "onSelect", item => {
|
|
88
|
+
this.props.onSelect(item);
|
|
89
|
+
this.hideDropdown();
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
_defineProperty(this, "onBackgroundScroll", e => {
|
|
93
|
+
console.log('EEEEEEE', e);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
document.addEventListener('touchmove', function (e) {});
|
|
97
|
+
}
|
|
65
98
|
|
|
66
99
|
componentDidMount() {
|
|
67
100
|
window.addEventListener('keydown', this.onKeydown);
|
|
@@ -71,14 +104,6 @@ class AddressPicker extends _common.Com {
|
|
|
71
104
|
window.removeEventListener('keydown', this.onKeydown);
|
|
72
105
|
}
|
|
73
106
|
|
|
74
|
-
onChangeSearchValue = e => {
|
|
75
|
-
this.setState({
|
|
76
|
-
searchValue: e.target.value
|
|
77
|
-
});
|
|
78
|
-
this.props.onChangeAddress(e.target.value);
|
|
79
|
-
this.doSearch();
|
|
80
|
-
};
|
|
81
|
-
|
|
82
107
|
renderEmpty() {
|
|
83
108
|
return (0, _preact.h)("div", {
|
|
84
109
|
class: "dropdown_select_filter__empty"
|
|
@@ -103,14 +128,6 @@ class AddressPicker extends _common.Com {
|
|
|
103
128
|
}, "\u0110ang t\u1EA3i d\u1EEF li\u1EC7u"));
|
|
104
129
|
}
|
|
105
130
|
|
|
106
|
-
toogleDropdown = async () => {
|
|
107
|
-
await this.setState({
|
|
108
|
-
show: true,
|
|
109
|
-
searchValue: this.props.initAddress || ''
|
|
110
|
-
});
|
|
111
|
-
this.focusFilter();
|
|
112
|
-
};
|
|
113
|
-
|
|
114
131
|
focusFilter() {
|
|
115
132
|
if (!this.filterRef.current) return;
|
|
116
133
|
this.filterRef.current.focus();
|
|
@@ -120,11 +137,6 @@ class AddressPicker extends _common.Com {
|
|
|
120
137
|
}, 100);
|
|
121
138
|
}
|
|
122
139
|
|
|
123
|
-
onSelect = item => {
|
|
124
|
-
this.props.onSelect(item);
|
|
125
|
-
this.hideDropdown();
|
|
126
|
-
};
|
|
127
|
-
|
|
128
140
|
renderDropdown() {
|
|
129
141
|
if (!this.state.show) return null;
|
|
130
142
|
|
|
@@ -193,10 +205,6 @@ class AddressPicker extends _common.Com {
|
|
|
193
205
|
}, $items));
|
|
194
206
|
}
|
|
195
207
|
|
|
196
|
-
onBackgroundScroll = e => {
|
|
197
|
-
console.log('EEEEEEE', e);
|
|
198
|
-
};
|
|
199
|
-
|
|
200
208
|
render() {
|
|
201
209
|
let $name = (0, _preact.h)("div", {
|
|
202
210
|
class: "text-truncate",
|