@fmdeui/fmui 1.0.151 → 1.0.153

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.
@@ -18,15 +18,15 @@ export declare const FmInputNumber: {
18
18
  default: number;
19
19
  };
20
20
  modelValue: {
21
- type: PropType<number>;
21
+ type: PropType<string | number>;
22
22
  required: true;
23
23
  };
24
24
  }>> & Readonly<{
25
- "onUpdate:modelValue"?: ((value: number) => any) | undefined;
25
+ "onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
26
26
  onHandleInput?: ((...args: any[]) => any) | undefined;
27
27
  }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
28
28
  handleInput: (...args: any[]) => void;
29
- "update:modelValue": (value: number) => void;
29
+ "update:modelValue": (value: string | number) => void;
30
30
  }, PublicProps, {
31
31
  defaultValue: number;
32
32
  placeholder: string;
@@ -57,11 +57,11 @@ export declare const FmInputNumber: {
57
57
  default: number;
58
58
  };
59
59
  modelValue: {
60
- type: PropType<number>;
60
+ type: PropType<string | number>;
61
61
  required: true;
62
62
  };
63
63
  }>> & Readonly<{
64
- "onUpdate:modelValue"?: ((value: number) => any) | undefined;
64
+ "onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
65
65
  onHandleInput?: ((...args: any[]) => any) | undefined;
66
66
  }>, {}, {}, {}, {}, {
67
67
  defaultValue: number;
@@ -90,15 +90,15 @@ export declare const FmInputNumber: {
90
90
  default: number;
91
91
  };
92
92
  modelValue: {
93
- type: PropType<number>;
93
+ type: PropType<string | number>;
94
94
  required: true;
95
95
  };
96
96
  }>> & Readonly<{
97
- "onUpdate:modelValue"?: ((value: number) => any) | undefined;
97
+ "onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
98
98
  onHandleInput?: ((...args: any[]) => any) | undefined;
99
99
  }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
100
100
  handleInput: (...args: any[]) => void;
101
- "update:modelValue": (value: number) => void;
101
+ "update:modelValue": (value: string | number) => void;
102
102
  }, string, {
103
103
  defaultValue: number;
104
104
  placeholder: string;
@@ -32,12 +32,12 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
32
32
  default: number;
33
33
  };
34
34
  modelValue: {
35
- type: PropType<number>;
35
+ type: PropType<string | number>;
36
36
  required: true;
37
37
  };
38
38
  }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
39
39
  handleInput: (...args: any[]) => void;
40
- "update:modelValue": (value: number) => void;
40
+ "update:modelValue": (value: string | number) => void;
41
41
  }, string, PublicProps, Readonly< ExtractPropTypes<{
42
42
  placeholder: {
43
43
  type: StringConstructor;
@@ -59,11 +59,11 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
59
59
  default: number;
60
60
  };
61
61
  modelValue: {
62
- type: PropType<number>;
62
+ type: PropType<string | number>;
63
63
  required: true;
64
64
  };
65
65
  }>> & Readonly<{
66
- "onUpdate:modelValue"?: ((value: number) => any) | undefined;
66
+ "onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
67
67
  onHandleInput?: ((...args: any[]) => any) | undefined;
68
68
  }>, {
69
69
  defaultValue: number;
@@ -211,6 +211,7 @@ const COST_CATEGORIES = [
211
211
  { code: "INSURE", type: 9, name: "\u4FDD\u9669", icon: "\u{1F6E1}\uFE0F", color: "#eb2f96", bg: "#fff0f6" },
212
212
  { code: "GUIDE", type: 10, name: "\u5BFC\u670D", icon: "\u{1F468}\u200D", color: "#f5222d", bg: "#fff1f0" },
213
213
  { code: "VISA", type: 15, name: "\u7B7E\u8BC1", icon: "\u{1F4CB}", color: "#faad14", bg: "#fffbe6" },
214
+ { code: "SHIP", type: 14, name: "\u6E38\u8239", icon: "\u{1F6A2}", color: "#0ea5e9", bg: "#e0f2fe" },
214
215
  { code: "TOPLAN", type: 6, name: "\u5730\u63A5", icon: "\u{1F91D}", color: "#1890ff", bg: "#e6f7ff" },
215
216
  { code: "OTHEROUT", type: 2, name: "\u5176\u4ED6\u652F\u51FA", icon: "\u{1F4BC}", color: "#8c8c8c", bg: "#fafafa" },
216
217
  { code: "OTHERIN", type: 1, name: "\u5176\u4ED6\u6536\u5165", icon: "\u{1F48E}", color: "#72AFF2", bg: "#D2EEFE" }
@@ -39,39 +39,62 @@ 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;
45
- if (props.bType == "number") {
46
- let trimstr = pureVal.replace(/[^\d]/g, "");
47
- const num = parseInt(trimstr, 10);
48
- const validNum = Number.isNaN(num) ? props.defaultValue : num;
49
- modelValue.value = isNegative ? -validNum : validNum;
50
- emit("handleInput", isNegative ? -validNum : validNum);
42
+ let strVal = String(val);
43
+ strVal = strVal.replace(/[^\d.-]/g, "");
44
+ if (strVal.indexOf("-") !== -1) {
45
+ if (!strVal.startsWith("-")) {
46
+ strVal = strVal.replace(/-/g, "");
47
+ } else {
48
+ const rest = strVal.substring(1);
49
+ if (rest.includes("-")) {
50
+ strVal = "-" + rest.replace(/-/g, "");
51
+ }
52
+ }
53
+ }
54
+ const dotCount = (strVal.match(/\./g) || []).length;
55
+ if (dotCount > 1) {
56
+ const firstDotIndex = strVal.indexOf(".");
57
+ const before = strVal.substring(0, firstDotIndex + 1);
58
+ const after = strVal.substring(firstDotIndex + 1).replace(/\./g, "");
59
+ strVal = before + after;
60
+ }
61
+ let sign = "";
62
+ let body = strVal;
63
+ if (body.startsWith("-")) {
64
+ sign = "-";
65
+ body = body.substring(1);
66
+ }
67
+ if (body === "") {
68
+ modelValue.value = sign;
69
+ emit("handleInput", sign);
51
70
  return;
52
71
  }
53
- let cleaned = pureVal.replace(/[^\d.]/g, "");
54
- const dotIndex = cleaned.indexOf(".");
55
- if (dotIndex !== -1) {
56
- const before = cleaned.substring(0, dotIndex + 1);
57
- const after = cleaned.substring(dotIndex + 1).replace(/\./g, "");
58
- cleaned = before + after;
72
+ if (body.startsWith(".")) {
73
+ body = "0" + body;
74
+ }
75
+ const parts = body.split(".");
76
+ let intPart = parts[0];
77
+ let decPart = parts.length > 1 ? parts[1] : "";
78
+ intPart = intPart.replace(/^0+/, "") || "0";
79
+ if (props.bType === "number") {
80
+ decPart = "";
81
+ } else {
82
+ if (decPart.length > props.decimalPlaces) {
83
+ decPart = decPart.substring(0, props.decimalPlaces);
84
+ }
59
85
  }
60
- if (cleaned.startsWith(".")) {
61
- cleaned = "0" + cleaned;
86
+ let finalStr = sign + intPart;
87
+ if (decPart !== "") {
88
+ finalStr += "." + decPart;
62
89
  }
63
- const parts = cleaned.split(".");
64
- parts[0] = parts[0].replace(/^0+/, "") || "0";
65
- cleaned = parts.join(".");
66
- if (cleaned.includes(".")) {
67
- const [intPart, decPart] = cleaned.split(".");
68
- cleaned = `${intPart}.${decPart.substring(0, props.decimalPlaces)}`;
90
+ modelValue.value = finalStr;
91
+ if (finalStr === "" || finalStr === "-" || finalStr === "-.") {
92
+ finalStr = "0";
69
93
  }
70
- modelValue.value = isNegative ? -cleaned : cleaned;
71
- emit("handleInput", isNegative ? -cleaned : cleaned);
94
+ emit("handleInput", finalStr);
72
95
  };
73
96
  watch(() => modelValue.value, (newvalue, oldValue) => {
74
- if (newvalue == "") {
97
+ if (newvalue == "" || newvalue === "-" || newvalue === "-.") {
75
98
  modelValue.value = props.defaultValue == -1 ? 0 : props.defaultValue;
76
99
  }
77
100
  });
@@ -81,7 +104,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
81
104
  modelValue: modelValue.value,
82
105
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
83
106
  placeholder: __props.placeholder,
84
- onInput: handleInput
107
+ onInput: handleInput,
108
+ type: "text"
85
109
  }, createSlots({
86
110
  _: 2
87
111
  /* DYNAMIC */
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! fmdeui-fmui v1.0.151 */
1
+ /*! fmdeui-fmui v1.0.153 */
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) :
@@ -3880,6 +3880,7 @@
3880
3880
  { code: "INSURE", type: 9, name: "\u4FDD\u9669", icon: "\u{1F6E1}\uFE0F", color: "#eb2f96", bg: "#fff0f6" },
3881
3881
  { code: "GUIDE", type: 10, name: "\u5BFC\u670D", icon: "\u{1F468}\u200D", color: "#f5222d", bg: "#fff1f0" },
3882
3882
  { code: "VISA", type: 15, name: "\u7B7E\u8BC1", icon: "\u{1F4CB}", color: "#faad14", bg: "#fffbe6" },
3883
+ { code: "SHIP", type: 14, name: "\u6E38\u8239", icon: "\u{1F6A2}", color: "#0ea5e9", bg: "#e0f2fe" },
3883
3884
  { code: "TOPLAN", type: 6, name: "\u5730\u63A5", icon: "\u{1F91D}", color: "#1890ff", bg: "#e6f7ff" },
3884
3885
  { code: "OTHEROUT", type: 2, name: "\u5176\u4ED6\u652F\u51FA", icon: "\u{1F4BC}", color: "#8c8c8c", bg: "#fafafa" },
3885
3886
  { code: "OTHERIN", type: 1, name: "\u5176\u4ED6\u6536\u5165", icon: "\u{1F48E}", color: "#72AFF2", bg: "#D2EEFE" }
@@ -27436,39 +27437,62 @@
27436
27437
  emit("handleInput", validNum);
27437
27438
  return;
27438
27439
  }
27439
- const strVal = String(val);
27440
- const isNegative = strVal.startsWith("-");
27441
- let pureVal = isNegative ? strVal.substring(1) : strVal;
27442
- if (props.bType == "number") {
27443
- let trimstr = pureVal.replace(/[^\d]/g, "");
27444
- const num = parseInt(trimstr, 10);
27445
- const validNum = Number.isNaN(num) ? props.defaultValue : num;
27446
- modelValue.value = isNegative ? -validNum : validNum;
27447
- emit("handleInput", isNegative ? -validNum : validNum);
27440
+ let strVal = String(val);
27441
+ strVal = strVal.replace(/[^\d.-]/g, "");
27442
+ if (strVal.indexOf("-") !== -1) {
27443
+ if (!strVal.startsWith("-")) {
27444
+ strVal = strVal.replace(/-/g, "");
27445
+ } else {
27446
+ const rest = strVal.substring(1);
27447
+ if (rest.includes("-")) {
27448
+ strVal = "-" + rest.replace(/-/g, "");
27449
+ }
27450
+ }
27451
+ }
27452
+ const dotCount = (strVal.match(/\./g) || []).length;
27453
+ if (dotCount > 1) {
27454
+ const firstDotIndex = strVal.indexOf(".");
27455
+ const before = strVal.substring(0, firstDotIndex + 1);
27456
+ const after = strVal.substring(firstDotIndex + 1).replace(/\./g, "");
27457
+ strVal = before + after;
27458
+ }
27459
+ let sign = "";
27460
+ let body = strVal;
27461
+ if (body.startsWith("-")) {
27462
+ sign = "-";
27463
+ body = body.substring(1);
27464
+ }
27465
+ if (body === "") {
27466
+ modelValue.value = sign;
27467
+ emit("handleInput", sign);
27448
27468
  return;
27449
27469
  }
27450
- let cleaned = pureVal.replace(/[^\d.]/g, "");
27451
- const dotIndex = cleaned.indexOf(".");
27452
- if (dotIndex !== -1) {
27453
- const before = cleaned.substring(0, dotIndex + 1);
27454
- const after = cleaned.substring(dotIndex + 1).replace(/\./g, "");
27455
- cleaned = before + after;
27470
+ if (body.startsWith(".")) {
27471
+ body = "0" + body;
27472
+ }
27473
+ const parts = body.split(".");
27474
+ let intPart = parts[0];
27475
+ let decPart = parts.length > 1 ? parts[1] : "";
27476
+ intPart = intPart.replace(/^0+/, "") || "0";
27477
+ if (props.bType === "number") {
27478
+ decPart = "";
27479
+ } else {
27480
+ if (decPart.length > props.decimalPlaces) {
27481
+ decPart = decPart.substring(0, props.decimalPlaces);
27482
+ }
27456
27483
  }
27457
- if (cleaned.startsWith(".")) {
27458
- cleaned = "0" + cleaned;
27484
+ let finalStr = sign + intPart;
27485
+ if (decPart !== "") {
27486
+ finalStr += "." + decPart;
27459
27487
  }
27460
- const parts = cleaned.split(".");
27461
- parts[0] = parts[0].replace(/^0+/, "") || "0";
27462
- cleaned = parts.join(".");
27463
- if (cleaned.includes(".")) {
27464
- const [intPart, decPart] = cleaned.split(".");
27465
- cleaned = `${intPart}.${decPart.substring(0, props.decimalPlaces)}`;
27488
+ modelValue.value = finalStr;
27489
+ if (finalStr === "" || finalStr === "-" || finalStr === "-.") {
27490
+ finalStr = "0";
27466
27491
  }
27467
- modelValue.value = isNegative ? -cleaned : cleaned;
27468
- emit("handleInput", isNegative ? -cleaned : cleaned);
27492
+ emit("handleInput", finalStr);
27469
27493
  };
27470
27494
  vue.watch(() => modelValue.value, (newvalue, oldValue) => {
27471
- if (newvalue == "") {
27495
+ if (newvalue == "" || newvalue === "-" || newvalue === "-.") {
27472
27496
  modelValue.value = props.defaultValue == -1 ? 0 : props.defaultValue;
27473
27497
  }
27474
27498
  });
@@ -27478,7 +27502,8 @@
27478
27502
  modelValue: modelValue.value,
27479
27503
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
27480
27504
  placeholder: __props.placeholder,
27481
- onInput: handleInput
27505
+ onInput: handleInput,
27506
+ type: "text"
27482
27507
  }, vue.createSlots({
27483
27508
  _: 2
27484
27509
  /* DYNAMIC */