@me-framework/me-ui-antdv-next 0.0.34 → 0.0.36
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/README.md +160 -54
- package/dist/index.d.ts +7 -1
- package/dist/input-json/index.css +1 -0
- package/dist/input-json/index.d.ts +4 -0
- package/dist/input-json/index.js +208 -0
- package/dist/input-json/index.vue.d.ts +50 -0
- package/dist/input-json/types.d.ts +69 -0
- package/dist/input-number/index.css +1 -0
- package/dist/input-number/index.d.ts +4 -0
- package/dist/input-number/index.js +170 -0
- package/dist/input-number/index.vue.d.ts +44 -0
- package/dist/input-number/types.d.ts +66 -0
- package/dist/input-property/index.css +1 -1
- package/dist/input-property/index.js +317 -297
- package/dist/input-property/index.vue.d.ts +2 -2
- package/dist/input-radio/index.css +1 -1
- package/dist/input-radio/index.js +70 -33
- package/dist/input-radio/index.vue.d.ts +39 -10
- package/dist/input-radio/types.d.ts +26 -4
- package/dist/me-ui-antdv-next.js +1097 -584
- package/dist/me-ui-antdv-next.umd.cjs +3 -3
- package/dist/nav/index.vue.d.ts +2 -2
- package/dist/resolver/index.js +4 -1
- package/dist/style.css +1 -1
- package/dist/text/index.css +1 -0
- package/dist/text/index.d.ts +4 -0
- package/dist/text/index.js +98 -0
- package/dist/text/index.vue.d.ts +25 -0
- package/dist/text/types.d.ts +63 -0
- package/dist/tree-menu/index.vue.d.ts +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { computed as e, createBlock as t, defineComponent as n, mergeProps as r, openBlock as i, ref as a, resolveComponent as o, watch as s } from "vue";
|
|
2
|
+
//#endregion
|
|
3
|
+
//#region src/components/input-number/index.vue
|
|
4
|
+
var c = /* @__PURE__ */ n({
|
|
5
|
+
name: "MeInputNumber",
|
|
6
|
+
__name: "index",
|
|
7
|
+
props: {
|
|
8
|
+
modelValue: {},
|
|
9
|
+
precision: { default: void 0 },
|
|
10
|
+
finance: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: !1
|
|
13
|
+
},
|
|
14
|
+
thousands: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: void 0
|
|
17
|
+
},
|
|
18
|
+
thousandsSeparator: { default: "," },
|
|
19
|
+
decimalSeparator: { default: "." },
|
|
20
|
+
prefix: { default: "" },
|
|
21
|
+
suffix: { default: "" },
|
|
22
|
+
min: { default: void 0 },
|
|
23
|
+
max: { default: void 0 },
|
|
24
|
+
step: { default: void 0 },
|
|
25
|
+
disabled: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: !1
|
|
28
|
+
},
|
|
29
|
+
readonly: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: !1
|
|
32
|
+
},
|
|
33
|
+
size: { default: "middle" },
|
|
34
|
+
variant: { default: "outlined" },
|
|
35
|
+
status: { default: "" },
|
|
36
|
+
controls: {
|
|
37
|
+
type: [Boolean, Object],
|
|
38
|
+
default: !0
|
|
39
|
+
},
|
|
40
|
+
placeholder: { default: "" },
|
|
41
|
+
allowNull: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: !0
|
|
44
|
+
},
|
|
45
|
+
autoFixOnBlur: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: !0
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
emits: [
|
|
51
|
+
"update:modelValue",
|
|
52
|
+
"change",
|
|
53
|
+
"focus",
|
|
54
|
+
"blur",
|
|
55
|
+
"pressEnter",
|
|
56
|
+
"input"
|
|
57
|
+
],
|
|
58
|
+
setup(n, { expose: c, emit: l }) {
|
|
59
|
+
let u = n, d = l, f = e(() => u.finance || u.thousands === !0), p = e(() => u.precision === void 0 ? u.finance ? 2 : 0 : u.precision), m = e(() => u.thousands === void 0 ? u.finance : u.thousands), h = e(() => p.value > 15 || typeof u.min == "string" || typeof u.max == "string"), g = a(u.modelValue);
|
|
60
|
+
s(() => u.modelValue, (e) => {
|
|
61
|
+
g.value = e;
|
|
62
|
+
});
|
|
63
|
+
let _ = e(() => u.step === void 0 ? p.value <= 0 ? 1 : Number(`1e-${p.value}`) : u.step), v = (e) => {
|
|
64
|
+
if (e == null || e === "") return "";
|
|
65
|
+
let t = String(e), n = u.decimalSeparator, r = u.thousandsSeparator, [i, a] = t.split("."), o = "", s = i;
|
|
66
|
+
i.startsWith("-") && (o = "-", s = i.slice(1));
|
|
67
|
+
let c = s;
|
|
68
|
+
m.value && r && (c = s.replace(/\B(?=(\d{3})+(?!\d))/g, r));
|
|
69
|
+
let l = o + c;
|
|
70
|
+
return a !== void 0 && (l += n + a), u.prefix && (l = u.prefix + l), u.suffix && (l += u.suffix), l;
|
|
71
|
+
}, y = (e) => {
|
|
72
|
+
if (!e) return 0;
|
|
73
|
+
let t = e;
|
|
74
|
+
if (u.prefix && t.startsWith(u.prefix) && (t = t.slice(u.prefix.length)), u.suffix && t.endsWith(u.suffix) && (t = t.slice(0, -u.suffix.length)), m.value && u.thousandsSeparator) {
|
|
75
|
+
let e = new RegExp(u.thousandsSeparator.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g");
|
|
76
|
+
t = t.replace(e, "");
|
|
77
|
+
}
|
|
78
|
+
if (u.decimalSeparator && u.decimalSeparator !== ".") {
|
|
79
|
+
let e = new RegExp(u.decimalSeparator.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g");
|
|
80
|
+
t = t.replace(e, ".");
|
|
81
|
+
}
|
|
82
|
+
t = t.replace(/[^\d.\-]/g, "");
|
|
83
|
+
let n = t.indexOf("-");
|
|
84
|
+
n > 0 && (t = t.slice(0, n));
|
|
85
|
+
let r = t.indexOf(".");
|
|
86
|
+
return r >= 0 && (t = t.slice(0, r + 1) + t.slice(r + 1).replace(/\./g, "")), t === "" || t === "-" ? 0 : h.value ? t : Number(t);
|
|
87
|
+
}, b = (e) => {
|
|
88
|
+
if (e == null || e === "") return u.allowNull ? null : 0;
|
|
89
|
+
let t = String(e);
|
|
90
|
+
if (t === "-" || t === ".") return u.allowNull ? null : 0;
|
|
91
|
+
let n = Number(t);
|
|
92
|
+
if (isNaN(n)) return u.allowNull ? null : 0;
|
|
93
|
+
if (p.value <= 0) {
|
|
94
|
+
let e = Math.round(n);
|
|
95
|
+
return h.value ? String(e) : e;
|
|
96
|
+
}
|
|
97
|
+
let r = 10 ** p.value, i = Math.round(n * r) / r;
|
|
98
|
+
if (h.value || f.value) {
|
|
99
|
+
let e = i.toFixed(p.value);
|
|
100
|
+
return h.value ? e : Number(e);
|
|
101
|
+
}
|
|
102
|
+
return i;
|
|
103
|
+
}, x = (e) => {
|
|
104
|
+
d("update:modelValue", e), d("change", e);
|
|
105
|
+
}, S = (e) => {
|
|
106
|
+
d("focus", e);
|
|
107
|
+
}, C = (e) => {
|
|
108
|
+
if (u.autoFixOnBlur) {
|
|
109
|
+
let e = b(g.value);
|
|
110
|
+
e !== g.value && (g.value = e, d("update:modelValue", e), d("change", e));
|
|
111
|
+
}
|
|
112
|
+
d("blur", e);
|
|
113
|
+
}, w = (e) => {
|
|
114
|
+
d("pressEnter", e);
|
|
115
|
+
}, T = (e) => {
|
|
116
|
+
d("input", e);
|
|
117
|
+
};
|
|
118
|
+
return c({ fixPrecision: () => b(g.value) }), (e, n) => {
|
|
119
|
+
let a = o("a-input-number");
|
|
120
|
+
return i(), t(a, r({
|
|
121
|
+
value: g.value,
|
|
122
|
+
"onUpdate:value": n[0] ||= (e) => g.value = e,
|
|
123
|
+
class: ["me-input-number", {
|
|
124
|
+
"me-input-number--disabled": u.disabled,
|
|
125
|
+
"me-input-number--finance": f.value
|
|
126
|
+
}],
|
|
127
|
+
min: u.min,
|
|
128
|
+
max: u.max,
|
|
129
|
+
step: _.value,
|
|
130
|
+
disabled: u.disabled,
|
|
131
|
+
readonly: u.readonly,
|
|
132
|
+
size: u.size,
|
|
133
|
+
variant: u.variant,
|
|
134
|
+
status: u.status,
|
|
135
|
+
controls: u.controls,
|
|
136
|
+
placeholder: u.placeholder,
|
|
137
|
+
formatter: v,
|
|
138
|
+
parser: y,
|
|
139
|
+
"string-mode": h.value,
|
|
140
|
+
onChange: x,
|
|
141
|
+
onFocus: S,
|
|
142
|
+
onBlur: C,
|
|
143
|
+
onPressEnter: w,
|
|
144
|
+
onInput: T
|
|
145
|
+
}, e.$attrs), null, 16, [
|
|
146
|
+
"value",
|
|
147
|
+
"class",
|
|
148
|
+
"min",
|
|
149
|
+
"max",
|
|
150
|
+
"step",
|
|
151
|
+
"disabled",
|
|
152
|
+
"readonly",
|
|
153
|
+
"size",
|
|
154
|
+
"variant",
|
|
155
|
+
"status",
|
|
156
|
+
"controls",
|
|
157
|
+
"placeholder",
|
|
158
|
+
"string-mode"
|
|
159
|
+
]);
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region src/components/input-number/index.ts
|
|
165
|
+
c.install = (e) => {
|
|
166
|
+
e.component("MeInputNumber", c);
|
|
167
|
+
};
|
|
168
|
+
var l = c;
|
|
169
|
+
//#endregion
|
|
170
|
+
export { c as MeInputNumber, l as default };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { MeInputNumberProps } from './types';
|
|
2
|
+
declare const __VLS_export: import('vue').DefineComponent<MeInputNumberProps, {
|
|
3
|
+
/** 按精度修正当前值(四舍五入 + 补零) */
|
|
4
|
+
fixPrecision: () => string | number | null;
|
|
5
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
6
|
+
input: (value: string) => any;
|
|
7
|
+
change: (value: string | number | null) => any;
|
|
8
|
+
blur: (event: FocusEvent) => any;
|
|
9
|
+
focus: (event: FocusEvent) => any;
|
|
10
|
+
"update:modelValue": (value: string | number | null) => any;
|
|
11
|
+
pressEnter: (event: KeyboardEvent) => any;
|
|
12
|
+
}, string, import('vue').PublicProps, Readonly<MeInputNumberProps> & Readonly<{
|
|
13
|
+
onInput?: ((value: string) => any) | undefined;
|
|
14
|
+
onChange?: ((value: string | number | null) => any) | undefined;
|
|
15
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
16
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
17
|
+
"onUpdate:modelValue"?: ((value: string | number | null) => any) | undefined;
|
|
18
|
+
onPressEnter?: ((event: KeyboardEvent) => any) | undefined;
|
|
19
|
+
}>, {
|
|
20
|
+
size: "small" | "middle" | "large";
|
|
21
|
+
max: number | string;
|
|
22
|
+
min: number | string;
|
|
23
|
+
disabled: boolean;
|
|
24
|
+
placeholder: string;
|
|
25
|
+
precision: number;
|
|
26
|
+
finance: boolean;
|
|
27
|
+
thousands: boolean;
|
|
28
|
+
thousandsSeparator: string;
|
|
29
|
+
decimalSeparator: string;
|
|
30
|
+
prefix: string;
|
|
31
|
+
suffix: string;
|
|
32
|
+
step: number | string;
|
|
33
|
+
readonly: boolean;
|
|
34
|
+
variant: "outlined" | "filled" | "borderless";
|
|
35
|
+
status: "" | "warning" | "error";
|
|
36
|
+
controls: boolean | {
|
|
37
|
+
upIcon?: any;
|
|
38
|
+
downIcon?: any;
|
|
39
|
+
};
|
|
40
|
+
allowNull: boolean;
|
|
41
|
+
autoFixOnBlur: boolean;
|
|
42
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
43
|
+
declare const _default: typeof __VLS_export;
|
|
44
|
+
export default _default;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { InputNumberProps } from 'antdv-next';
|
|
2
|
+
/** MeInputNumber 组件 Props */
|
|
3
|
+
export interface MeInputNumberProps {
|
|
4
|
+
/** 绑定值(支持 v-model) */
|
|
5
|
+
modelValue?: number | string | null;
|
|
6
|
+
/** 小数点位数,默认 0(整数);finance 模式下默认 2 */
|
|
7
|
+
precision?: number;
|
|
8
|
+
/** 是否启用金融格式(千分位 + 默认 2 位小数) */
|
|
9
|
+
finance?: boolean;
|
|
10
|
+
/** 是否显示千分位分隔符(finance 模式下默认 true) */
|
|
11
|
+
thousands?: boolean;
|
|
12
|
+
/** 千分位分隔符,默认 ',' */
|
|
13
|
+
thousandsSeparator?: string;
|
|
14
|
+
/** 小数点符号,默认 '.' */
|
|
15
|
+
decimalSeparator?: string;
|
|
16
|
+
/** 前缀(如货币符号 ¥ $ €) */
|
|
17
|
+
prefix?: string;
|
|
18
|
+
/** 后缀(如 % 元) */
|
|
19
|
+
suffix?: string;
|
|
20
|
+
/** 最小值 */
|
|
21
|
+
min?: number | string;
|
|
22
|
+
/** 最大值 */
|
|
23
|
+
max?: number | string;
|
|
24
|
+
/** 步长 */
|
|
25
|
+
step?: number | string;
|
|
26
|
+
/** 是否禁用 */
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/** 是否只读 */
|
|
29
|
+
readonly?: boolean;
|
|
30
|
+
/** 输入框尺寸 */
|
|
31
|
+
size?: 'small' | 'middle' | 'large';
|
|
32
|
+
/** 输入框风格变体 */
|
|
33
|
+
variant?: 'outlined' | 'filled' | 'borderless';
|
|
34
|
+
/** 校验状态 */
|
|
35
|
+
status?: '' | 'warning' | 'error';
|
|
36
|
+
/** 是否显示加减控制按钮 */
|
|
37
|
+
controls?: boolean | {
|
|
38
|
+
upIcon?: any;
|
|
39
|
+
downIcon?: any;
|
|
40
|
+
};
|
|
41
|
+
/** 占位文字 */
|
|
42
|
+
placeholder?: string;
|
|
43
|
+
/** 是否允许值为 null */
|
|
44
|
+
allowNull?: boolean;
|
|
45
|
+
/** 失焦时自动修正精度,默认 true */
|
|
46
|
+
autoFixOnBlur?: boolean;
|
|
47
|
+
}
|
|
48
|
+
/** MeInputNumber 组件 Emits */
|
|
49
|
+
export interface MeInputNumberEmits {
|
|
50
|
+
/** v-model 事件 */
|
|
51
|
+
(e: 'update:modelValue', value: number | string | null): void;
|
|
52
|
+
/** 值变化事件 */
|
|
53
|
+
(e: 'change', value: number | string | null): void;
|
|
54
|
+
/** 聚焦事件 */
|
|
55
|
+
(e: 'focus', event: FocusEvent): void;
|
|
56
|
+
/** 失焦事件 */
|
|
57
|
+
(e: 'blur', event: FocusEvent): void;
|
|
58
|
+
/** 按下回车 */
|
|
59
|
+
(e: 'pressEnter', event: KeyboardEvent): void;
|
|
60
|
+
/** 输入事件 */
|
|
61
|
+
(e: 'input', value: string): void;
|
|
62
|
+
}
|
|
63
|
+
/** MeInputNumber 组件实例类型 */
|
|
64
|
+
export type MeInputNumberInstance = InstanceType<typeof import('./index.vue').default>;
|
|
65
|
+
/** 透传给 a-input-number 的 Props 类型(扩展用) */
|
|
66
|
+
export type MeInputNumberPassThroughProps = Omit<InputNumberProps, 'value' | 'defaultValue' | 'onChange' | 'formatter' | 'parser' | 'precision' | 'decimalSeparator'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.me-input-property{width:100%;position:relative}.me-input-
|
|
1
|
+
.me-input-property{width:100%;position:relative}.me-input-property__add-btn:hover{color:#4096ff;background:#0000000a}.me-input-property__value{width:100%}.me-input-property__value-type{flex:0 0 95px;width:95px}.me-input-property__value-editor{flex:1;min-width:0}.me-input-property__table{width:100%}.me-input-property__table .ant-table-row.me-input-property__row--ghost td{opacity:.4;background:#1677ff0a}.me-input-property__table .ant-input-status-error,.me-input-property__table .ant-input-number-status-error,.me-input-property__table .ant-picker-status-error{box-shadow:none!important;border-color:#d9d9d9!important}.me-input-property__table .ant-select-status-error{--ant-select-border-color:#d9d9d9!important;--ant-select-background-color:#fff!important;--ant-select-color:inherit!important;box-shadow:none!important}.me-input-property__table .me-input-property__field--error.ant-input,.me-input-property__table .me-input-property__field--error.ant-input-number,.me-input-property__table .me-input-property__field--error.ant-picker{border-color:#ff4d4f!important}.me-input-property__table .me-input-property__value.me-input-property__field--error{border-radius:6px;box-shadow:0 0 0 1px #ff4d4f}.me-input-property__drop-line{background:var(--me-primary,#1677ff);pointer-events:none;z-index:9;border-radius:2px;height:2px;display:none;position:absolute;left:0;box-shadow:0 0 0 1px #fffc}.me-input-property__drag-fallback{table-layout:fixed;border-collapse:separate;border-spacing:0;background:#fff;width:auto;display:table;box-shadow:0 4px 12px #00000026}.me-input-property__drag-fallback td{box-sizing:border-box;vertical-align:middle;background:#fff;border-bottom:1px solid #f0f0f0}.me-input-property__actions{align-items:center;gap:2px;display:inline-flex}.me-input-property__drag{cursor:grab;color:#999;border-radius:4px;justify-content:center;align-items:center;padding:2px;display:inline-flex}.me-input-property__drag:active{cursor:grabbing;color:var(--me-primary,#1677ff)}.me-input-property__drag:hover{color:var(--me-primary,#1677ff);background:#0000000a}.me-input-property__del{color:#999}.me-input-property__del:hover{color:#ff4d4f}.me-input-property__rules-btn{color:#bbb;border-radius:4px}.me-input-property__rules-btn:hover{color:var(--me-primary,#1677ff);background:#0000000a}.me-input-property__rules-btn.is-active{color:var(--me-primary,#1677ff)}.me-input-property__rule-input{width:100%}
|