@fmdeui/fmui 1.0.152 → 1.0.154

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,58 +39,65 @@ 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
- const match = pureVal.match(/^-?\d*/);
47
- let trimstr = match ? match[0] : "";
48
- if (trimstr === "-") {
49
- modelValue.value = trimstr;
50
- emit("handleInput", 0);
51
- return;
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
52
  }
53
- const num = parseInt(trimstr, 10);
54
- const validNum = Number.isNaN(num) ? props.defaultValue : num;
55
- modelValue.value = validNum;
56
- emit("handleInput", validNum);
57
- return;
58
53
  }
59
- let cleaned = pureVal.replace(/[^\d.]/g, "");
60
- const dotIndex = cleaned.indexOf(".");
61
- if (dotIndex !== -1) {
62
- const before = cleaned.substring(0, dotIndex + 1);
63
- const after = cleaned.substring(dotIndex + 1).replace(/\./g, "");
64
- cleaned = before + after;
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;
65
60
  }
66
- if (cleaned.startsWith(".")) {
67
- cleaned = "0" + cleaned;
61
+ let sign = "";
62
+ let body = strVal;
63
+ if (body.startsWith("-")) {
64
+ sign = "-";
65
+ body = body.substring(1);
68
66
  }
69
- const parts = cleaned.split(".");
70
- parts[0] = parts[0].replace(/^0+/, "") || "0";
71
- cleaned = parts.join(".");
72
- if (cleaned.includes(".")) {
73
- const [intPart, decPart] = cleaned.split(".");
74
- cleaned = `${intPart}.${decPart.substring(0, props.decimalPlaces)}`;
67
+ if (body === "") {
68
+ modelValue.value = sign;
69
+ emit("handleInput", sign);
70
+ return;
75
71
  }
76
- if (isNegative) {
77
- if (cleaned === "" || cleaned === "0") {
78
- cleaned = cleaned === "" ? "-" : pureVal === "-0" ? "-0" : "0";
79
- if (pureVal === "-") cleaned = "-";
80
- } else {
81
- cleaned = "-" + cleaned;
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);
82
84
  }
83
85
  }
84
- if (cleaned === "-.") {
85
- cleaned = "-0.";
86
+ let finalStr = sign + intPart;
87
+ if (decPart !== "") {
88
+ finalStr += "." + decPart;
89
+ }
90
+ if (finalStr === "" || finalStr === "-" || finalStr === "-.") {
91
+ finalStr = "0";
92
+ } else {
93
+ modelValue.value = finalStr;
86
94
  }
87
- modelValue.value = cleaned;
88
- const numValue = Number(cleaned);
95
+ const numValue = Number(finalStr);
89
96
  const finalNum = Number.isNaN(numValue) ? props.defaultValue !== -1 ? props.defaultValue : 0 : numValue;
90
97
  emit("handleInput", finalNum);
91
98
  };
92
99
  watch(() => modelValue.value, (newvalue, oldValue) => {
93
- if (newvalue == "") {
100
+ if (newvalue == "" || newvalue === "-" || newvalue === "-.") {
94
101
  modelValue.value = props.defaultValue == -1 ? 0 : props.defaultValue;
95
102
  }
96
103
  });
@@ -100,7 +107,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
100
107
  modelValue: modelValue.value,
101
108
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
102
109
  placeholder: __props.placeholder,
103
- onInput: handleInput
110
+ onInput: handleInput,
111
+ type: "text"
104
112
  }, createSlots({
105
113
  _: 2
106
114
  /* DYNAMIC */
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! fmdeui-fmui v1.0.152 */
1
+ /*! fmdeui-fmui v1.0.154 */
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,58 +27437,65 @@
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
- const match = pureVal.match(/^-?\d*/);
27444
- let trimstr = match ? match[0] : "";
27445
- if (trimstr === "-") {
27446
- modelValue.value = trimstr;
27447
- emit("handleInput", 0);
27448
- return;
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
+ }
27449
27450
  }
27450
- const num = parseInt(trimstr, 10);
27451
- const validNum = Number.isNaN(num) ? props.defaultValue : num;
27452
- modelValue.value = validNum;
27453
- emit("handleInput", validNum);
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);
27454
27468
  return;
27455
27469
  }
27456
- let cleaned = pureVal.replace(/[^\d.]/g, "");
27457
- const dotIndex = cleaned.indexOf(".");
27458
- if (dotIndex !== -1) {
27459
- const before = cleaned.substring(0, dotIndex + 1);
27460
- const after = cleaned.substring(dotIndex + 1).replace(/\./g, "");
27461
- cleaned = before + after;
27462
- }
27463
- if (cleaned.startsWith(".")) {
27464
- cleaned = "0" + cleaned;
27465
- }
27466
- const parts = cleaned.split(".");
27467
- parts[0] = parts[0].replace(/^0+/, "") || "0";
27468
- cleaned = parts.join(".");
27469
- if (cleaned.includes(".")) {
27470
- const [intPart, decPart] = cleaned.split(".");
27471
- cleaned = `${intPart}.${decPart.substring(0, props.decimalPlaces)}`;
27472
- }
27473
- if (isNegative) {
27474
- if (cleaned === "" || cleaned === "0") {
27475
- cleaned = cleaned === "" ? "-" : pureVal === "-0" ? "-0" : "0";
27476
- if (pureVal === "-") cleaned = "-";
27477
- } else {
27478
- cleaned = "-" + cleaned;
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);
27479
27482
  }
27480
27483
  }
27481
- if (cleaned === "-.") {
27482
- cleaned = "-0.";
27484
+ let finalStr = sign + intPart;
27485
+ if (decPart !== "") {
27486
+ finalStr += "." + decPart;
27487
+ }
27488
+ if (finalStr === "" || finalStr === "-" || finalStr === "-.") {
27489
+ finalStr = "0";
27490
+ } else {
27491
+ modelValue.value = finalStr;
27483
27492
  }
27484
- modelValue.value = cleaned;
27485
- const numValue = Number(cleaned);
27493
+ const numValue = Number(finalStr);
27486
27494
  const finalNum = Number.isNaN(numValue) ? props.defaultValue !== -1 ? props.defaultValue : 0 : numValue;
27487
27495
  emit("handleInput", finalNum);
27488
27496
  };
27489
27497
  vue.watch(() => modelValue.value, (newvalue, oldValue) => {
27490
- if (newvalue == "") {
27498
+ if (newvalue == "" || newvalue === "-" || newvalue === "-.") {
27491
27499
  modelValue.value = props.defaultValue == -1 ? 0 : props.defaultValue;
27492
27500
  }
27493
27501
  });
@@ -27497,7 +27505,8 @@
27497
27505
  modelValue: modelValue.value,
27498
27506
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
27499
27507
  placeholder: __props.placeholder,
27500
- onInput: handleInput
27508
+ onInput: handleInput,
27509
+ type: "text"
27501
27510
  }, vue.createSlots({
27502
27511
  _: 2
27503
27512
  /* DYNAMIC */