ordering-ui-admin-external 1.43.87 → 1.43.89
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/_bundles/{ordering-ui-admin.508bc29611b368682b89.js → ordering-ui-admin.953186d9492b9e360543.js} +2 -2
- package/_modules/components/Stores/ProductExtraOptionDetails/index.js +10 -8
- package/_modules/components/Stores/ProductExtraSuboption/index.js +13 -3
- package/_modules/components/Stores/SnoozeComponent/index.js +0 -3
- package/package.json +2 -2
- package/src/components/Stores/ProductExtraOptionDetails/index.js +5 -4
- package/src/components/Stores/ProductExtraSuboption/index.js +15 -3
- package/src/components/Stores/SnoozeComponent/index.js +0 -4
- /package/_bundles/{ordering-ui-admin.508bc29611b368682b89.js.LICENSE.txt → ordering-ui-admin.953186d9492b9e360543.js.LICENSE.txt} +0 -0
|
@@ -124,6 +124,10 @@ var ProductExtraOptionDetailsUI = function ProductExtraOptionDetailsUI(props) {
|
|
|
124
124
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
125
125
|
isExtraOptionSnooze = _useState14[0],
|
|
126
126
|
setIsExtraOptionSnooze = _useState14[1];
|
|
127
|
+
var _useState15 = (0, _react.useState)(false),
|
|
128
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
129
|
+
isDraggingExtraOption = _useState16[0],
|
|
130
|
+
setIsDraggingExtraOption = _useState16[1];
|
|
127
131
|
var handleClickSubOptionImage = function handleClickSubOptionImage(id) {
|
|
128
132
|
document.getElementById(id).click();
|
|
129
133
|
};
|
|
@@ -292,7 +296,9 @@ var ProductExtraOptionDetailsUI = function ProductExtraOptionDetailsUI(props) {
|
|
|
292
296
|
hanldeDragOver: hanldeDragOver,
|
|
293
297
|
handleDrop: handleDrop,
|
|
294
298
|
handleDragEnd: handleDragEnd,
|
|
295
|
-
handleDuplicateSubOption: handleDuplicateSubOption
|
|
299
|
+
handleDuplicateSubOption: handleDuplicateSubOption,
|
|
300
|
+
isDraggingExtraOption: isDraggingExtraOption,
|
|
301
|
+
setIsDraggingExtraOption: setIsDraggingExtraOption
|
|
296
302
|
});
|
|
297
303
|
}), isAddForm && /*#__PURE__*/_react.default.createElement(_styles2.AdddSubOptionForm, {
|
|
298
304
|
onSubmit: handleSubmit(handleAddOption)
|
|
@@ -302,7 +308,7 @@ var ProductExtraOptionDetailsUI = function ProductExtraOptionDetailsUI(props) {
|
|
|
302
308
|
name: "image",
|
|
303
309
|
control: control,
|
|
304
310
|
render: function render() {
|
|
305
|
-
var _changesState$
|
|
311
|
+
var _changesState$changes, _changesState$changes2;
|
|
306
312
|
return /*#__PURE__*/_react.default.createElement(_styles2.SubOptionImage, {
|
|
307
313
|
onClick: function onClick() {
|
|
308
314
|
return handleClickSubOptionImage('add_suboption_image');
|
|
@@ -319,12 +325,8 @@ var ProductExtraOptionDetailsUI = function ProductExtraOptionDetailsUI(props) {
|
|
|
319
325
|
return handleSubOptionFiles(dataTransfer.files, 'add_suboption_image');
|
|
320
326
|
},
|
|
321
327
|
accept: "image/png, image/jpeg, image/jpg",
|
|
322
|
-
disabled: optionState.loading
|
|
323
|
-
}, changesState
|
|
324
|
-
src: changesState === null || changesState === void 0 || (_changesState$result2 = changesState.result) === null || _changesState$result2 === void 0 ? void 0 : _changesState$result2.image,
|
|
325
|
-
alt: "sub option image",
|
|
326
|
-
loading: "lazy"
|
|
327
|
-
}) : (changesState === null || changesState === void 0 || (_changesState$changes = changesState.changes) === null || _changesState$changes === void 0 ? void 0 : _changesState$changes.image) && editSubOptionId === null && /*#__PURE__*/_react.default.createElement("img", {
|
|
328
|
+
disabled: optionState.loading || isDraggingExtraOption
|
|
329
|
+
}, (changesState === null || changesState === void 0 || (_changesState$changes = changesState.changes) === null || _changesState$changes === void 0 ? void 0 : _changesState$changes.image) && editSubOptionId === null && /*#__PURE__*/_react.default.createElement("img", {
|
|
328
330
|
src: changesState === null || changesState === void 0 || (_changesState$changes2 = changesState.changes) === null || _changesState$changes2 === void 0 ? void 0 : _changesState$changes2.image,
|
|
329
331
|
alt: "sub option image",
|
|
330
332
|
loading: "lazy"
|
|
@@ -52,7 +52,9 @@ var ProductExtraSuboption = exports.ProductExtraSuboption = function ProductExtr
|
|
|
52
52
|
hanldeDragOver = props.hanldeDragOver,
|
|
53
53
|
handleDrop = props.handleDrop,
|
|
54
54
|
handleDragEnd = props.handleDragEnd,
|
|
55
|
-
handleDuplicateSubOption = props.handleDuplicateSubOption
|
|
55
|
+
handleDuplicateSubOption = props.handleDuplicateSubOption,
|
|
56
|
+
isDraggingExtraOption = props.isDraggingExtraOption,
|
|
57
|
+
setIsDraggingExtraOption = props.setIsDraggingExtraOption;
|
|
56
58
|
var theme = (0, _styledComponents.useTheme)();
|
|
57
59
|
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
58
60
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
@@ -177,6 +179,13 @@ var ProductExtraSuboption = exports.ProductExtraSuboption = function ProductExtr
|
|
|
177
179
|
});
|
|
178
180
|
setExternalIdOpen(false);
|
|
179
181
|
};
|
|
182
|
+
var handleDropSubOption = function handleDropSubOption(e, subOption) {
|
|
183
|
+
setIsDraggingExtraOption(false);
|
|
184
|
+
handleDrop(e, subOption);
|
|
185
|
+
};
|
|
186
|
+
var handleDragStartSubOption = function handleDragStartSubOption() {
|
|
187
|
+
setIsDraggingExtraOption(true);
|
|
188
|
+
};
|
|
180
189
|
(0, _react.useEffect)(function () {
|
|
181
190
|
if (Object.keys(errors).length > 0) {
|
|
182
191
|
setAlertState({
|
|
@@ -202,11 +211,12 @@ var ProductExtraSuboption = exports.ProductExtraSuboption = function ProductExtr
|
|
|
202
211
|
onSubmit: handleSubmit(onSubmit),
|
|
203
212
|
isDragOver: dragoverSubOptionId === subOption.id,
|
|
204
213
|
isBorderBottom: isSubOptionsBottom && isLastSubOption,
|
|
214
|
+
onDragStart: handleDragStartSubOption,
|
|
205
215
|
onDragOver: function onDragOver(e) {
|
|
206
216
|
return hanldeDragOver(e, subOption, isLastSubOption);
|
|
207
217
|
},
|
|
208
218
|
onDrop: function onDrop(e) {
|
|
209
|
-
return
|
|
219
|
+
return handleDropSubOption(e, subOption);
|
|
210
220
|
},
|
|
211
221
|
onDragEnd: handleDragEnd,
|
|
212
222
|
className: "draggable-suboption"
|
|
@@ -233,7 +243,7 @@ var ProductExtraSuboption = exports.ProductExtraSuboption = function ProductExtr
|
|
|
233
243
|
return handleSubOptionFiles(dataTransfer.files, subOption.id);
|
|
234
244
|
},
|
|
235
245
|
accept: "image/png, image/jpeg, image/jpg",
|
|
236
|
-
disabled: optionState.loading
|
|
246
|
+
disabled: optionState.loading || isDraggingExtraOption
|
|
237
247
|
}, changesState !== null && changesState !== void 0 && (_changesState$result = changesState.result) !== null && _changesState$result !== void 0 && _changesState$result.image && editSubOptionId === subOption.id ? /*#__PURE__*/_react.default.createElement("img", {
|
|
238
248
|
src: changesState === null || changesState === void 0 || (_changesState$result2 = changesState.result) === null || _changesState$result2 === void 0 ? void 0 : _changesState$result2.image,
|
|
239
249
|
alt: "sub option image",
|
|
@@ -167,9 +167,6 @@ var SnoozeComponent = exports.SnoozeComponent = function SnoozeComponent(props)
|
|
|
167
167
|
}, {
|
|
168
168
|
value: '12',
|
|
169
169
|
content: t('SNOOZE_TWELVE_HOUR', '12H')
|
|
170
|
-
}, {
|
|
171
|
-
value: 'indefinitely',
|
|
172
|
-
content: t('SNOOZE_INDEFINITELY', 'Indefinitely')
|
|
173
170
|
}, {
|
|
174
171
|
value: 'or',
|
|
175
172
|
content: t('SNOOZE_OR', 'or')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-admin-external",
|
|
3
|
-
"version": "1.43.
|
|
3
|
+
"version": "1.43.89",
|
|
4
4
|
"description": "Ordering UI Admin Components",
|
|
5
5
|
"main": "./_modules/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"lodash": "^4.17.20",
|
|
84
84
|
"moment": "^2.29.1",
|
|
85
85
|
"moment-range": "^4.0.2",
|
|
86
|
-
"ordering-components-admin-external": "1.43.
|
|
86
|
+
"ordering-components-admin-external": "1.43.57",
|
|
87
87
|
"polished": "^3.6.7",
|
|
88
88
|
"prop-types": "^15.7.2",
|
|
89
89
|
"react-big-calendar": "^1.4.2",
|
|
@@ -94,6 +94,7 @@ const ProductExtraOptionDetailsUI = (props) => {
|
|
|
94
94
|
const [cropState, setCropState] = useState({ name: null, data: null, open: false })
|
|
95
95
|
const [externalId, setExternalId] = useState()
|
|
96
96
|
const [isExtraOptionSnooze, setIsExtraOptionSnooze] = useState(false)
|
|
97
|
+
const [isDraggingExtraOption, setIsDraggingExtraOption] = useState(false)
|
|
97
98
|
|
|
98
99
|
const handleClickSubOptionImage = (id) => {
|
|
99
100
|
document.getElementById(id).click()
|
|
@@ -286,6 +287,8 @@ const ProductExtraOptionDetailsUI = (props) => {
|
|
|
286
287
|
handleDrop={handleDrop}
|
|
287
288
|
handleDragEnd={handleDragEnd}
|
|
288
289
|
handleDuplicateSubOption={handleDuplicateSubOption}
|
|
290
|
+
isDraggingExtraOption={isDraggingExtraOption}
|
|
291
|
+
setIsDraggingExtraOption={setIsDraggingExtraOption}
|
|
289
292
|
/>
|
|
290
293
|
)
|
|
291
294
|
})}
|
|
@@ -309,12 +312,10 @@ const ProductExtraOptionDetailsUI = (props) => {
|
|
|
309
312
|
<DragAndDrop
|
|
310
313
|
onDrop={dataTransfer => handleSubOptionFiles(dataTransfer.files, 'add_suboption_image')}
|
|
311
314
|
accept='image/png, image/jpeg, image/jpg'
|
|
312
|
-
disabled={optionState.loading}
|
|
315
|
+
disabled={optionState.loading || isDraggingExtraOption}
|
|
313
316
|
>
|
|
314
317
|
{
|
|
315
|
-
(changesState?.
|
|
316
|
-
? (<img src={changesState?.result?.image} alt='sub option image' loading='lazy' />)
|
|
317
|
-
: (changesState?.changes?.image && editSubOptionId === null) && (<img src={changesState?.changes?.image} alt='sub option image' loading='lazy' />)
|
|
318
|
+
(changesState?.changes?.image && editSubOptionId === null) && (<img src={changesState?.changes?.image} alt='sub option image' loading='lazy' />)
|
|
318
319
|
}
|
|
319
320
|
<UploadImageIconContainer>
|
|
320
321
|
<UploadImageIcon small>
|
|
@@ -45,7 +45,9 @@ export const ProductExtraSuboption = (props) => {
|
|
|
45
45
|
hanldeDragOver,
|
|
46
46
|
handleDrop,
|
|
47
47
|
handleDragEnd,
|
|
48
|
-
handleDuplicateSubOption
|
|
48
|
+
handleDuplicateSubOption,
|
|
49
|
+
isDraggingExtraOption,
|
|
50
|
+
setIsDraggingExtraOption
|
|
49
51
|
} = props
|
|
50
52
|
|
|
51
53
|
const theme = useTheme()
|
|
@@ -133,6 +135,15 @@ export const ProductExtraSuboption = (props) => {
|
|
|
133
135
|
setExternalIdOpen(false)
|
|
134
136
|
}
|
|
135
137
|
|
|
138
|
+
const handleDropSubOption = (e, subOption) => {
|
|
139
|
+
setIsDraggingExtraOption(false)
|
|
140
|
+
handleDrop(e, subOption)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const handleDragStartSubOption = () => {
|
|
144
|
+
setIsDraggingExtraOption(true)
|
|
145
|
+
}
|
|
146
|
+
|
|
136
147
|
useEffect(() => {
|
|
137
148
|
if (Object.keys(errors).length > 0) {
|
|
138
149
|
setAlertState({
|
|
@@ -160,8 +171,9 @@ export const ProductExtraSuboption = (props) => {
|
|
|
160
171
|
onSubmit={handleSubmit(onSubmit)}
|
|
161
172
|
isDragOver={dragoverSubOptionId === subOption.id}
|
|
162
173
|
isBorderBottom={isSubOptionsBottom && isLastSubOption}
|
|
174
|
+
onDragStart={handleDragStartSubOption}
|
|
163
175
|
onDragOver={e => hanldeDragOver(e, subOption, isLastSubOption)}
|
|
164
|
-
onDrop={e =>
|
|
176
|
+
onDrop={e => handleDropSubOption(e, subOption)}
|
|
165
177
|
onDragEnd={handleDragEnd}
|
|
166
178
|
className='draggable-suboption'
|
|
167
179
|
>
|
|
@@ -186,7 +198,7 @@ export const ProductExtraSuboption = (props) => {
|
|
|
186
198
|
<DragAndDrop
|
|
187
199
|
onDrop={dataTransfer => handleSubOptionFiles(dataTransfer.files, subOption.id)}
|
|
188
200
|
accept='image/png, image/jpeg, image/jpg'
|
|
189
|
-
disabled={optionState.loading}
|
|
201
|
+
disabled={optionState.loading || isDraggingExtraOption}
|
|
190
202
|
>
|
|
191
203
|
{
|
|
192
204
|
(changesState?.result?.image && editSubOptionId === subOption.id)
|
|
@@ -153,10 +153,6 @@ export const SnoozeComponent = (props) => {
|
|
|
153
153
|
value: '12',
|
|
154
154
|
content: t('SNOOZE_TWELVE_HOUR', '12H')
|
|
155
155
|
},
|
|
156
|
-
{
|
|
157
|
-
value: 'indefinitely',
|
|
158
|
-
content: t('SNOOZE_INDEFINITELY', 'Indefinitely')
|
|
159
|
-
},
|
|
160
156
|
{
|
|
161
157
|
value: 'or',
|
|
162
158
|
content: t('SNOOZE_OR', 'or')
|