@fmdeui/fmui 1.0.90 → 1.0.91
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/es/component.mjs +3 -1
- package/es/components/fm-inputnumber/index.d.ts +94 -0
- package/es/components/fm-inputnumber/index.vue.d.ts +63 -0
- package/es/components/index.d.ts +1 -0
- package/es/packages/components/fm-inputnumber/index.mjs +6 -0
- package/es/packages/components/fm-inputnumber/index.vue.mjs +5 -0
- package/es/packages/components/fm-inputnumber/index.vue2.mjs +104 -0
- package/es/packages/components/index.mjs +1 -0
- package/index.js +145 -41
- package/index.min.js +6 -6
- package/index.min.mjs +6 -6
- package/index.mjs +145 -41
- package/lib/component.js +3 -1
- package/lib/components/fm-inputnumber/index.d.ts +94 -0
- package/lib/components/fm-inputnumber/index.vue.d.ts +63 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/packages/components/fm-inputnumber/index.js +8 -0
- package/lib/packages/components/fm-inputnumber/index.vue.js +9 -0
- package/lib/packages/components/fm-inputnumber/index.vue2.js +108 -0
- package/lib/packages/components/index.js +6 -4
- package/locale/en.js +1 -1
- package/locale/en.min.js +1 -1
- package/locale/en.min.mjs +1 -1
- package/locale/en.mjs +1 -1
- package/locale/zh-cn.js +1 -1
- package/locale/zh-cn.min.js +1 -1
- package/locale/zh-cn.min.mjs +1 -1
- package/locale/zh-cn.mjs +1 -1
- package/package.json +1 -1
- /package/es/{version.css → index.css} +0 -0
- /package/lib/{component.css → make-installer.css} +0 -0
package/es/component.mjs
CHANGED
|
@@ -13,6 +13,7 @@ import { FSettings } from './packages/components/fm-settings/index.mjs';
|
|
|
13
13
|
import { FModifyRecord } from './packages/components/modifyRecord/index.mjs';
|
|
14
14
|
import { FmTree } from './packages/components/fmtree/index.mjs';
|
|
15
15
|
import { FmCascader } from './packages/components/fmcascader/index.mjs';
|
|
16
|
+
import { FmInputNumber } from './packages/components/fm-inputnumber/index.mjs';
|
|
16
17
|
|
|
17
18
|
const plugins = [
|
|
18
19
|
FButton,
|
|
@@ -29,7 +30,8 @@ const plugins = [
|
|
|
29
30
|
FSettings,
|
|
30
31
|
FModifyRecord,
|
|
31
32
|
FmTree,
|
|
32
|
-
FmCascader
|
|
33
|
+
FmCascader,
|
|
34
|
+
FmInputNumber
|
|
33
35
|
];
|
|
34
36
|
|
|
35
37
|
export { plugins as default };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { CreateComponentPublicInstanceWithMixins, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, ComponentOptionsBase, VNodeProps, AllowedComponentProps, ComponentCustomProps } from 'vue';
|
|
2
|
+
export declare const FmInputNumber: {
|
|
3
|
+
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< ExtractPropTypes<{
|
|
4
|
+
placeholder: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
defaultValue: {
|
|
9
|
+
type: NumberConstructor;
|
|
10
|
+
default: number;
|
|
11
|
+
};
|
|
12
|
+
bType: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
modelValue: {
|
|
17
|
+
type: PropType<Number>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
}>> & Readonly<{
|
|
21
|
+
"onUpdate:modelValue"?: ((value: Number) => any) | undefined;
|
|
22
|
+
}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
23
|
+
"update:modelValue": (value: Number) => any;
|
|
24
|
+
}, PublicProps, {
|
|
25
|
+
defaultValue: number;
|
|
26
|
+
placeholder: string;
|
|
27
|
+
bType: string;
|
|
28
|
+
}, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
|
29
|
+
P: {};
|
|
30
|
+
B: {};
|
|
31
|
+
D: {};
|
|
32
|
+
C: {};
|
|
33
|
+
M: {};
|
|
34
|
+
Defaults: {};
|
|
35
|
+
}, Readonly< ExtractPropTypes<{
|
|
36
|
+
placeholder: {
|
|
37
|
+
type: StringConstructor;
|
|
38
|
+
default: string;
|
|
39
|
+
};
|
|
40
|
+
defaultValue: {
|
|
41
|
+
type: NumberConstructor;
|
|
42
|
+
default: number;
|
|
43
|
+
};
|
|
44
|
+
bType: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
default: string;
|
|
47
|
+
};
|
|
48
|
+
modelValue: {
|
|
49
|
+
type: PropType<Number>;
|
|
50
|
+
required: true;
|
|
51
|
+
};
|
|
52
|
+
}>> & Readonly<{
|
|
53
|
+
"onUpdate:modelValue"?: ((value: Number) => any) | undefined;
|
|
54
|
+
}>, {}, {}, {}, {}, {
|
|
55
|
+
defaultValue: number;
|
|
56
|
+
placeholder: string;
|
|
57
|
+
bType: string;
|
|
58
|
+
}>;
|
|
59
|
+
__isFragment?: never;
|
|
60
|
+
__isTeleport?: never;
|
|
61
|
+
__isSuspense?: never;
|
|
62
|
+
} & ComponentOptionsBase<Readonly< ExtractPropTypes<{
|
|
63
|
+
placeholder: {
|
|
64
|
+
type: StringConstructor;
|
|
65
|
+
default: string;
|
|
66
|
+
};
|
|
67
|
+
defaultValue: {
|
|
68
|
+
type: NumberConstructor;
|
|
69
|
+
default: number;
|
|
70
|
+
};
|
|
71
|
+
bType: {
|
|
72
|
+
type: StringConstructor;
|
|
73
|
+
default: string;
|
|
74
|
+
};
|
|
75
|
+
modelValue: {
|
|
76
|
+
type: PropType<Number>;
|
|
77
|
+
required: true;
|
|
78
|
+
};
|
|
79
|
+
}>> & Readonly<{
|
|
80
|
+
"onUpdate:modelValue"?: ((value: Number) => any) | undefined;
|
|
81
|
+
}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
82
|
+
"update:modelValue": (value: Number) => any;
|
|
83
|
+
}, string, {
|
|
84
|
+
defaultValue: number;
|
|
85
|
+
placeholder: string;
|
|
86
|
+
bType: string;
|
|
87
|
+
}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
88
|
+
$slots: {
|
|
89
|
+
prepend?(_: {}): any;
|
|
90
|
+
append?(_: {}): any;
|
|
91
|
+
prefix?(_: {}): any;
|
|
92
|
+
suffix?(_: {}): any;
|
|
93
|
+
};
|
|
94
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { DefineComponent, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
prepend?(_: {}): any;
|
|
6
|
+
append?(_: {}): any;
|
|
7
|
+
prefix?(_: {}): any;
|
|
8
|
+
suffix?(_: {}): any;
|
|
9
|
+
};
|
|
10
|
+
refs: {};
|
|
11
|
+
rootEl: any;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
14
|
+
declare const __VLS_component: DefineComponent<ExtractPropTypes<{
|
|
15
|
+
placeholder: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
defaultValue: {
|
|
20
|
+
type: NumberConstructor;
|
|
21
|
+
default: number;
|
|
22
|
+
};
|
|
23
|
+
bType: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
modelValue: {
|
|
28
|
+
type: PropType<Number>;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
32
|
+
"update:modelValue": (value: Number) => any;
|
|
33
|
+
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
34
|
+
placeholder: {
|
|
35
|
+
type: StringConstructor;
|
|
36
|
+
default: string;
|
|
37
|
+
};
|
|
38
|
+
defaultValue: {
|
|
39
|
+
type: NumberConstructor;
|
|
40
|
+
default: number;
|
|
41
|
+
};
|
|
42
|
+
bType: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
default: string;
|
|
45
|
+
};
|
|
46
|
+
modelValue: {
|
|
47
|
+
type: PropType<Number>;
|
|
48
|
+
required: true;
|
|
49
|
+
};
|
|
50
|
+
}>> & Readonly<{
|
|
51
|
+
"onUpdate:modelValue"?: ((value: Number) => any) | undefined;
|
|
52
|
+
}>, {
|
|
53
|
+
defaultValue: number;
|
|
54
|
+
placeholder: string;
|
|
55
|
+
bType: string;
|
|
56
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
57
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
58
|
+
export default _default;
|
|
59
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
60
|
+
new (): {
|
|
61
|
+
$slots: S;
|
|
62
|
+
};
|
|
63
|
+
};
|
package/es/components/index.d.ts
CHANGED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { defineComponent, useModel, watch, resolveComponent, openBlock, createBlock, createSlots, withCtx, renderSlot, mergeModels } from 'vue';
|
|
2
|
+
|
|
3
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
|
+
...{ name: "FmInputNumber" },
|
|
5
|
+
__name: "index",
|
|
6
|
+
props: /* @__PURE__ */ mergeModels({
|
|
7
|
+
placeholder: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: "\u8BF7\u8F93\u5165\u91D1\u989D"
|
|
10
|
+
},
|
|
11
|
+
defaultValue: {
|
|
12
|
+
type: Number,
|
|
13
|
+
default: -1
|
|
14
|
+
},
|
|
15
|
+
bType: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: "money"
|
|
18
|
+
}
|
|
19
|
+
}, {
|
|
20
|
+
"modelValue": { required: true, default: 0 },
|
|
21
|
+
"modelModifiers": {}
|
|
22
|
+
}),
|
|
23
|
+
emits: ["update:modelValue"],
|
|
24
|
+
setup(__props) {
|
|
25
|
+
const modelValue = useModel(__props, "modelValue");
|
|
26
|
+
const props = __props;
|
|
27
|
+
const handleInput = (val) => {
|
|
28
|
+
if (val == "" && props.defaultValue != -1) {
|
|
29
|
+
modelValue.value = props.defaultValue;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (props.bType == "number") {
|
|
33
|
+
modelValue.value = parseInt(val);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
let cleaned = String(val).replace(/[^\d.]/g, "");
|
|
37
|
+
const dotIndex = cleaned.indexOf(".");
|
|
38
|
+
if (dotIndex !== -1) {
|
|
39
|
+
const before = cleaned.substring(0, dotIndex + 1);
|
|
40
|
+
const after = cleaned.substring(dotIndex + 1).replace(/\./g, "");
|
|
41
|
+
cleaned = before + after;
|
|
42
|
+
}
|
|
43
|
+
if (cleaned.startsWith(".")) {
|
|
44
|
+
cleaned = "0" + cleaned;
|
|
45
|
+
}
|
|
46
|
+
const parts = cleaned.split(".");
|
|
47
|
+
parts[0] = parts[0].replace(/^0+/, "") || "0";
|
|
48
|
+
cleaned = parts.join(".");
|
|
49
|
+
if (cleaned.includes(".")) {
|
|
50
|
+
const [intPart, decPart] = cleaned.split(".");
|
|
51
|
+
cleaned = `${intPart}.${decPart.substring(0, 2)}`;
|
|
52
|
+
}
|
|
53
|
+
modelValue.value = cleaned;
|
|
54
|
+
};
|
|
55
|
+
watch(() => modelValue.value, (newvalue, oldValue) => {
|
|
56
|
+
if (newvalue == "") {
|
|
57
|
+
modelValue.value = props.defaultValue == -1 ? 0 : props.defaultValue;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
return (_ctx, _cache) => {
|
|
61
|
+
const _component_el_input = resolveComponent("el-input");
|
|
62
|
+
return openBlock(), createBlock(_component_el_input, {
|
|
63
|
+
modelValue: modelValue.value,
|
|
64
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
65
|
+
placeholder: __props.placeholder,
|
|
66
|
+
onInput: handleInput
|
|
67
|
+
}, createSlots({
|
|
68
|
+
_: 2
|
|
69
|
+
/* DYNAMIC */
|
|
70
|
+
}, [
|
|
71
|
+
_ctx.$slots.prepend ? {
|
|
72
|
+
name: "prepend",
|
|
73
|
+
fn: withCtx(() => [
|
|
74
|
+
renderSlot(_ctx.$slots, "prepend")
|
|
75
|
+
]),
|
|
76
|
+
key: "0"
|
|
77
|
+
} : void 0,
|
|
78
|
+
_ctx.$slots.append ? {
|
|
79
|
+
name: "append",
|
|
80
|
+
fn: withCtx(() => [
|
|
81
|
+
renderSlot(_ctx.$slots, "append")
|
|
82
|
+
]),
|
|
83
|
+
key: "1"
|
|
84
|
+
} : void 0,
|
|
85
|
+
_ctx.$slots.prefix ? {
|
|
86
|
+
name: "prefix",
|
|
87
|
+
fn: withCtx(() => [
|
|
88
|
+
renderSlot(_ctx.$slots, "prefix")
|
|
89
|
+
]),
|
|
90
|
+
key: "2"
|
|
91
|
+
} : void 0,
|
|
92
|
+
_ctx.$slots.suffix ? {
|
|
93
|
+
name: "suffix",
|
|
94
|
+
fn: withCtx(() => [
|
|
95
|
+
renderSlot(_ctx.$slots, "suffix")
|
|
96
|
+
]),
|
|
97
|
+
key: "3"
|
|
98
|
+
} : void 0
|
|
99
|
+
]), 1032, ["modelValue", "placeholder"]);
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
export { _sfc_main as default };
|
|
@@ -12,3 +12,4 @@ export { FLayout } from './fm-layout/index.mjs';
|
|
|
12
12
|
export { FSettings } from './fm-settings/index.mjs';
|
|
13
13
|
export { FModifyRecord } from './modifyRecord/index.mjs';
|
|
14
14
|
export { Fminputdropdown } from './fm-inputdropdown/index.mjs';
|
|
15
|
+
export { FmInputNumber } from './fm-inputnumber/index.mjs';
|