ordering-ui-admin-external 1.37.3 → 1.38.0

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.
@@ -91,7 +91,7 @@ var OrderNotificationUI = function OrderNotificationUI(props) {
91
91
  };
92
92
  var toastNotify = function toastNotify(orderId) {
93
93
  var toastConfigure = {
94
- position: 'top-right',
94
+ position: 'bottom-right',
95
95
  autoClose: 3000,
96
96
  hideProgressBar: false,
97
97
  closeOnClick: true,
@@ -184,21 +184,6 @@ var ProductExtraOptionDetailsUI = function ProductExtraOptionDetailsUI(props) {
184
184
  }
185
185
  });
186
186
  };
187
- var handleEnterAddSuboption = function handleEnterAddSuboption(e) {
188
- if (e.key === 'Enter' && e.shiftKey === false) {
189
- handleSubmit(handleAddOption)();
190
- }
191
- };
192
- var onChangeAddModifierName = function onChangeAddModifierName(e) {
193
- e.persist();
194
- clearTimeout(timer);
195
- var _timer = setTimeout(function () {
196
- if (e.target.value) {
197
- handleSubmit(handleAddOption)();
198
- }
199
- }, 750);
200
- setTimer(_timer);
201
- };
202
187
  var handleUpdateExternalId = function handleUpdateExternalId() {
203
188
  handleUpdateOption({
204
189
  external_id: externalId
@@ -346,12 +331,16 @@ var ProductExtraOptionDetailsUI = function ProductExtraOptionDetailsUI(props) {
346
331
  autoComplete: "off",
347
332
  placeholder: t('NAME', 'Name'),
348
333
  defaultValue: editSubOptionId === null && (changesState === null || changesState === void 0 || (_changesState$changes3 = changesState.changes) === null || _changesState$changes3 === void 0 ? void 0 : _changesState$changes3.name) || '',
334
+ onKeyDown: function onKeyDown(e) {
335
+ var code = e.keyCode || e.which;
336
+ if (code === 13) {
337
+ e.preventDefault();
338
+ return false;
339
+ }
340
+ },
349
341
  ref: register({
350
342
  required: t('NAME_REQUIRED', 'The name is required.')
351
343
  }),
352
- onChange: function onChange(e) {
353
- return onChangeAddModifierName(e);
354
- },
355
344
  readOnly: optionState === null || optionState === void 0 ? void 0 : optionState.loading
356
345
  }))), /*#__PURE__*/_react.default.createElement(_styles2.RightSubOptionContent, null, /*#__PURE__*/_react.default.createElement(_styles2.InputWrapper, {
357
346
  primary: (optionState === null || optionState === void 0 || (_optionState$option8 = optionState.option) === null || _optionState$option8 === void 0 || (_optionState$option8 = _optionState$option8.suboptions) === null || _optionState$option8 === void 0 ? void 0 : _optionState$option8.length) === 0
@@ -361,10 +350,14 @@ var ProductExtraOptionDetailsUI = function ProductExtraOptionDetailsUI(props) {
361
350
  defaultValue: editSubOptionId === null && (changesState === null || changesState === void 0 || (_changesState$changes4 = changesState.changes) === null || _changesState$changes4 === void 0 ? void 0 : _changesState$changes4.price) || 0,
362
351
  ref: register(),
363
352
  onKeyPress: function onKeyPress(e) {
353
+ var code = e.keyCode || e.which;
354
+ if (code === 13) {
355
+ e.preventDefault();
356
+ return false;
357
+ }
364
358
  if (!/^[0-9.]$/.test(e.key)) {
365
359
  e.preventDefault();
366
360
  }
367
- handleEnterAddSuboption(e);
368
361
  }
369
362
  })), (typeof (settingChangeState === null || settingChangeState === void 0 || (_settingChangeState$c5 = settingChangeState.changes) === null || _settingChangeState$c5 === void 0 ? void 0 : _settingChangeState$c5.with_half_option) !== 'undefined' ? settingChangeState === null || settingChangeState === void 0 || (_settingChangeState$c6 = settingChangeState.changes) === null || _settingChangeState$c6 === void 0 ? void 0 : _settingChangeState$c6.with_half_option : optionState === null || optionState === void 0 || (_optionState$option9 = optionState.option) === null || _optionState$option9 === void 0 ? void 0 : _optionState$option9.with_half_option) && /*#__PURE__*/_react.default.createElement(_styles2.InputWrapper, {
370
363
  primary: (optionState === null || optionState === void 0 || (_optionState$option10 = optionState.option) === null || _optionState$option10 === void 0 || (_optionState$option10 = _optionState$option10.suboptions) === null || _optionState$option10 === void 0 ? void 0 : _optionState$option10.length) === 0
@@ -374,10 +367,14 @@ var ProductExtraOptionDetailsUI = function ProductExtraOptionDetailsUI(props) {
374
367
  defaultValue: editSubOptionId === null && (changesState === null || changesState === void 0 || (_changesState$changes5 = changesState.changes) === null || _changesState$changes5 === void 0 ? void 0 : _changesState$changes5.half_price) || '',
375
368
  ref: register(),
376
369
  onKeyPress: function onKeyPress(e) {
370
+ var code = e.keyCode || e.which;
371
+ if (code === 13) {
372
+ e.preventDefault();
373
+ return false;
374
+ }
377
375
  if (!/^[0-9.]$/.test(e.key)) {
378
376
  e.preventDefault();
379
377
  }
380
- handleEnterAddSuboption(e);
381
378
  }
382
379
  })), (typeof (settingChangeState === null || settingChangeState === void 0 || (_settingChangeState$c7 = settingChangeState.changes) === null || _settingChangeState$c7 === void 0 ? void 0 : _settingChangeState$c7.allow_suboption_quantity) !== 'undefined' ? settingChangeState === null || settingChangeState === void 0 || (_settingChangeState$c8 = settingChangeState.changes) === null || _settingChangeState$c8 === void 0 ? void 0 : _settingChangeState$c8.allow_suboption_quantity : optionState === null || optionState === void 0 || (_optionState$option11 = optionState.option) === null || _optionState$option11 === void 0 ? void 0 : _optionState$option11.allow_suboption_quantity) && /*#__PURE__*/_react.default.createElement(_styles2.InputWrapper, {
383
380
  primary: (optionState === null || optionState === void 0 || (_optionState$option12 = optionState.option) === null || _optionState$option12 === void 0 || (_optionState$option12 = _optionState$option12.suboptions) === null || _optionState$option12 === void 0 ? void 0 : _optionState$option12.length) === 0
@@ -387,10 +384,14 @@ var ProductExtraOptionDetailsUI = function ProductExtraOptionDetailsUI(props) {
387
384
  defaultValue: editSubOptionId === null && (changesState === null || changesState === void 0 || (_changesState$changes6 = changesState.changes) === null || _changesState$changes6 === void 0 ? void 0 : _changesState$changes6.max) || '',
388
385
  ref: register(),
389
386
  onKeyPress: function onKeyPress(e) {
387
+ var code = e.keyCode || e.which;
388
+ if (code === 13) {
389
+ e.preventDefault();
390
+ return false;
391
+ }
390
392
  if (!/^[0-9.]$/.test(e.key)) {
391
393
  e.preventDefault();
392
394
  }
393
- handleEnterAddSuboption(e);
394
395
  }
395
396
  })), /*#__PURE__*/_react.default.createElement(_styles2.InputWrapper, {
396
397
  maxHeight: true
@@ -256,6 +256,13 @@ var ProductExtraSuboption = function ProductExtraSuboption(props) {
256
256
  onChange: function onChange(e) {
257
257
  _onChange(e.target.vaue);
258
258
  handleChangeInput(e);
259
+ },
260
+ onKeyDown: function onKeyDown(e) {
261
+ var code = e.keyCode || e.which;
262
+ if (code === 13) {
263
+ e.preventDefault();
264
+ return false;
265
+ }
259
266
  }
260
267
  });
261
268
  },
@@ -278,6 +285,11 @@ var ProductExtraSuboption = function ProductExtraSuboption(props) {
278
285
  handleChangeInput(e);
279
286
  },
280
287
  onKeyPress: function onKeyPress(e) {
288
+ var code = e.keyCode || e.which;
289
+ if (code === 13) {
290
+ e.preventDefault();
291
+ return false;
292
+ }
281
293
  if (!/^[0-9.]$/.test(e.key)) {
282
294
  e.preventDefault();
283
295
  }
@@ -302,6 +314,11 @@ var ProductExtraSuboption = function ProductExtraSuboption(props) {
302
314
  handleChangeInput(e);
303
315
  },
304
316
  onKeyPress: function onKeyPress(e) {
317
+ var code = e.keyCode || e.which;
318
+ if (code === 13) {
319
+ e.preventDefault();
320
+ return false;
321
+ }
305
322
  if (!/^[0-9.]$/.test(e.key)) {
306
323
  e.preventDefault();
307
324
  }
@@ -323,6 +340,11 @@ var ProductExtraSuboption = function ProductExtraSuboption(props) {
323
340
  handleChangeInput(e);
324
341
  },
325
342
  onKeyPress: function onKeyPress(e) {
343
+ var code = e.keyCode || e.which;
344
+ if (code === 13) {
345
+ e.preventDefault();
346
+ return false;
347
+ }
326
348
  if (!/^[0-9.]$/.test(e.key)) {
327
349
  e.preventDefault();
328
350
  }
package/index-template.js CHANGED
@@ -298,7 +298,7 @@ if (!(window?.location?.hostname === 'localhost')) {
298
298
  integrations: [
299
299
  new Integrations.BrowserTracing()
300
300
  ],
301
- release: process.env.npm_package_version ? 'ordering-ui-admin-release@' + process.env.npm_package_version : 'ordering-ui-admin-release@' + '1.1.0',
301
+ release: process.env.npm_package_version ? 'ordering-ui-admin-release@' + process.env.npm_package_version : 'ordering-ui-admin-release@' + '1.1.1',
302
302
  // Release health
303
303
  autoSessionTracking: true,
304
304
  ignoreErrors: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-admin-external",
3
- "version": "1.37.3",
3
+ "version": "1.38.0",
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.37.1",
86
+ "ordering-components-admin-external": "1.38.0",
87
87
  "polished": "^3.6.7",
88
88
  "prop-types": "^15.7.2",
89
89
  "react-big-calendar": "^1.4.2",
@@ -61,7 +61,7 @@ const OrderNotificationUI = (props) => {
61
61
 
62
62
  const toastNotify = (orderId) => {
63
63
  const toastConfigure = {
64
- position: 'top-right',
64
+ position: 'bottom-right',
65
65
  autoClose: 3000,
66
66
  hideProgressBar: false,
67
67
  closeOnClick: true,
@@ -148,23 +148,6 @@ const ProductExtraOptionDetailsUI = (props) => {
148
148
  })
149
149
  }
150
150
 
151
- const handleEnterAddSuboption = (e) => {
152
- if (e.key === 'Enter' && e.shiftKey === false) {
153
- handleSubmit(handleAddOption)()
154
- }
155
- }
156
-
157
- const onChangeAddModifierName = (e) => {
158
- e.persist()
159
- clearTimeout(timer)
160
- const _timer = setTimeout(function () {
161
- if (e.target.value) {
162
- handleSubmit(handleAddOption)()
163
- }
164
- }, 750)
165
- setTimer(_timer)
166
- }
167
-
168
151
  const handleUpdateExternalId = () => {
169
152
  handleUpdateOption({ external_id: externalId })
170
153
  setOpenModal({ ...openModal, externalId: false })
@@ -342,10 +325,16 @@ const ProductExtraOptionDetailsUI = (props) => {
342
325
  defaultValue={
343
326
  ((editSubOptionId === null) && changesState?.changes?.name) || ''
344
327
  }
328
+ onKeyDown={(e) => {
329
+ const code = e.keyCode || e.which
330
+ if (code === 13) {
331
+ e.preventDefault()
332
+ return false
333
+ }
334
+ }}
345
335
  ref={register({
346
336
  required: t('NAME_REQUIRED', 'The name is required.')
347
337
  })}
348
- onChange={(e) => onChangeAddModifierName(e)}
349
338
  readOnly={optionState?.loading}
350
339
  />
351
340
  </InputWrapper>
@@ -360,10 +349,14 @@ const ProductExtraOptionDetailsUI = (props) => {
360
349
  }
361
350
  ref={register()}
362
351
  onKeyPress={(e) => {
352
+ const code = e.keyCode || e.which
353
+ if (code === 13) {
354
+ e.preventDefault()
355
+ return false
356
+ }
363
357
  if (!/^[0-9.]$/.test(e.key)) {
364
358
  e.preventDefault()
365
359
  }
366
- handleEnterAddSuboption(e)
367
360
  }}
368
361
  />
369
362
  </InputWrapper>
@@ -377,10 +370,14 @@ const ProductExtraOptionDetailsUI = (props) => {
377
370
  }
378
371
  ref={register()}
379
372
  onKeyPress={(e) => {
373
+ const code = e.keyCode || e.which
374
+ if (code === 13) {
375
+ e.preventDefault()
376
+ return false
377
+ }
380
378
  if (!/^[0-9.]$/.test(e.key)) {
381
379
  e.preventDefault()
382
380
  }
383
- handleEnterAddSuboption(e)
384
381
  }}
385
382
  />
386
383
  </InputWrapper>
@@ -395,10 +392,14 @@ const ProductExtraOptionDetailsUI = (props) => {
395
392
  }
396
393
  ref={register()}
397
394
  onKeyPress={(e) => {
395
+ const code = e.keyCode || e.which
396
+ if (code === 13) {
397
+ e.preventDefault()
398
+ return false
399
+ }
398
400
  if (!/^[0-9.]$/.test(e.key)) {
399
401
  e.preventDefault()
400
402
  }
401
- handleEnterAddSuboption(e)
402
403
  }}
403
404
  />
404
405
  </InputWrapper>
@@ -214,6 +214,13 @@ export const ProductExtraSuboption = (props) => {
214
214
  onChange(e.target.vaue)
215
215
  handleChangeInput(e)
216
216
  }}
217
+ onKeyDown={(e) => {
218
+ const code = e.keyCode || e.which
219
+ if (code === 13) {
220
+ e.preventDefault()
221
+ return false
222
+ }
223
+ }}
217
224
  />
218
225
  )}
219
226
  defaultValue={subOption.name}
@@ -236,6 +243,11 @@ export const ProductExtraSuboption = (props) => {
236
243
  handleChangeInput(e)
237
244
  }}
238
245
  onKeyPress={(e) => {
246
+ const code = e.keyCode || e.which
247
+ if (code === 13) {
248
+ e.preventDefault()
249
+ return false
250
+ }
239
251
  if (!/^[0-9.]$/.test(e.key)) {
240
252
  e.preventDefault()
241
253
  }
@@ -260,6 +272,11 @@ export const ProductExtraSuboption = (props) => {
260
272
  handleChangeInput(e)
261
273
  }}
262
274
  onKeyPress={(e) => {
275
+ const code = e.keyCode || e.which
276
+ if (code === 13) {
277
+ e.preventDefault()
278
+ return false
279
+ }
263
280
  if (!/^[0-9.]$/.test(e.key)) {
264
281
  e.preventDefault()
265
282
  }
@@ -284,6 +301,11 @@ export const ProductExtraSuboption = (props) => {
284
301
  handleChangeInput(e)
285
302
  }}
286
303
  onKeyPress={(e) => {
304
+ const code = e.keyCode || e.which
305
+ if (code === 13) {
306
+ e.preventDefault()
307
+ return false
308
+ }
287
309
  if (!/^[0-9.]$/.test(e.key)) {
288
310
  e.preventDefault()
289
311
  }