@fmdeui/fmui 1.0.150 → 1.0.151

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.
@@ -39,15 +39,18 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
39
39
  emit("handleInput", validNum);
40
40
  return;
41
41
  }
42
+ const strVal = String(val);
43
+ const isNegative = strVal.startsWith("-");
44
+ let pureVal = isNegative ? strVal.substring(1) : strVal;
42
45
  if (props.bType == "number") {
43
- let trimstr = String(val).replace(/[^\d]/g, "");
46
+ let trimstr = pureVal.replace(/[^\d]/g, "");
44
47
  const num = parseInt(trimstr, 10);
45
48
  const validNum = Number.isNaN(num) ? props.defaultValue : num;
46
- modelValue.value = validNum;
47
- emit("handleInput", validNum);
49
+ modelValue.value = isNegative ? -validNum : validNum;
50
+ emit("handleInput", isNegative ? -validNum : validNum);
48
51
  return;
49
52
  }
50
- let cleaned = String(val).replace(/[^\d.]/g, "");
53
+ let cleaned = pureVal.replace(/[^\d.]/g, "");
51
54
  const dotIndex = cleaned.indexOf(".");
52
55
  if (dotIndex !== -1) {
53
56
  const before = cleaned.substring(0, dotIndex + 1);
@@ -64,8 +67,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
64
67
  const [intPart, decPart] = cleaned.split(".");
65
68
  cleaned = `${intPart}.${decPart.substring(0, props.decimalPlaces)}`;
66
69
  }
67
- modelValue.value = cleaned;
68
- emit("handleInput", cleaned);
70
+ modelValue.value = isNegative ? -cleaned : cleaned;
71
+ emit("handleInput", isNegative ? -cleaned : cleaned);
69
72
  };
70
73
  watch(() => modelValue.value, (newvalue, oldValue) => {
71
74
  if (newvalue == "") {
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! fmdeui-fmui v1.0.150 */
1
+ /*! fmdeui-fmui v1.0.151 */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vxe-table'), require('@vxe-ui/plugin-render-element'), require('@vxe-ui/plugin-export-xlsx'), require('vxe-pc-ui'), require('exceljs'), require('@element-plus/icons-vue'), require('vue'), require('element-plus'), require('lodash-es'), require('js-cookie'), require('pinia'), require('vue-router'), require('@vueuse/core'), require('crypto-js'), require('xlsx-js-style'), require('vue-i18n'), require('sortablejs'), require('screenfull'), require('push.js'), require('mitt'), require('@microsoft/signalr'), require('axios')) :
4
4
  typeof define === 'function' && define.amd ? define(['exports', 'vxe-table', '@vxe-ui/plugin-render-element', '@vxe-ui/plugin-export-xlsx', 'vxe-pc-ui', 'exceljs', '@element-plus/icons-vue', 'vue', 'element-plus', 'lodash-es', 'js-cookie', 'pinia', 'vue-router', '@vueuse/core', 'crypto-js', 'xlsx-js-style', 'vue-i18n', 'sortablejs', 'screenfull', 'push.js', 'mitt', '@microsoft/signalr', 'axios'], factory) :
@@ -27436,15 +27436,18 @@
27436
27436
  emit("handleInput", validNum);
27437
27437
  return;
27438
27438
  }
27439
+ const strVal = String(val);
27440
+ const isNegative = strVal.startsWith("-");
27441
+ let pureVal = isNegative ? strVal.substring(1) : strVal;
27439
27442
  if (props.bType == "number") {
27440
- let trimstr = String(val).replace(/[^\d]/g, "");
27443
+ let trimstr = pureVal.replace(/[^\d]/g, "");
27441
27444
  const num = parseInt(trimstr, 10);
27442
27445
  const validNum = Number.isNaN(num) ? props.defaultValue : num;
27443
- modelValue.value = validNum;
27444
- emit("handleInput", validNum);
27446
+ modelValue.value = isNegative ? -validNum : validNum;
27447
+ emit("handleInput", isNegative ? -validNum : validNum);
27445
27448
  return;
27446
27449
  }
27447
- let cleaned = String(val).replace(/[^\d.]/g, "");
27450
+ let cleaned = pureVal.replace(/[^\d.]/g, "");
27448
27451
  const dotIndex = cleaned.indexOf(".");
27449
27452
  if (dotIndex !== -1) {
27450
27453
  const before = cleaned.substring(0, dotIndex + 1);
@@ -27461,8 +27464,8 @@
27461
27464
  const [intPart, decPart] = cleaned.split(".");
27462
27465
  cleaned = `${intPart}.${decPart.substring(0, props.decimalPlaces)}`;
27463
27466
  }
27464
- modelValue.value = cleaned;
27465
- emit("handleInput", cleaned);
27467
+ modelValue.value = isNegative ? -cleaned : cleaned;
27468
+ emit("handleInput", isNegative ? -cleaned : cleaned);
27466
27469
  };
27467
27470
  vue.watch(() => modelValue.value, (newvalue, oldValue) => {
27468
27471
  if (newvalue == "") {