ep-craft 0.1.28 → 0.1.30

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.
@@ -0,0 +1,169 @@
1
+ import type { ExtractPublicPropTypes, HTMLAttributes } from 'vue';
2
+ import type { ComponentSize } from '@element-plus/constants';
3
+ /**
4
+ * @description input-number component props
5
+ */
6
+ export interface InputNumberProps {
7
+ /**
8
+ * @description same as `id` in native input
9
+ */
10
+ id?: string;
11
+ /**
12
+ * @description incremental step
13
+ */
14
+ step?: number;
15
+ /**
16
+ * @description whether input value can only be multiple of step
17
+ */
18
+ stepStrictly?: boolean;
19
+ /**
20
+ * @description the maximum allowed value
21
+ */
22
+ max?: number;
23
+ /**
24
+ * @description the minimum allowed value
25
+ */
26
+ min?: number;
27
+ /**
28
+ * @description binding value
29
+ */
30
+ modelValue?: number | null;
31
+ /**
32
+ * @description same as `readonly` in native input
33
+ */
34
+ readonly?: boolean;
35
+ /**
36
+ * @description whether the component is disabled
37
+ */
38
+ disabled?: boolean;
39
+ /**
40
+ * @description size of the component
41
+ */
42
+ size?: ComponentSize;
43
+ /**
44
+ * @description whether to enable the control buttons
45
+ */
46
+ controls?: boolean;
47
+ /**
48
+ * @description position of the control buttons
49
+ */
50
+ controlsPosition?: '' | 'right';
51
+ /**
52
+ * @description value should be set when input box is cleared
53
+ */
54
+ valueOnClear?: 'min' | 'max' | number | null;
55
+ /**
56
+ * @description same as `name` in native input
57
+ */
58
+ name?: string;
59
+ /**
60
+ * @description same as `placeholder` in native input
61
+ */
62
+ placeholder?: string;
63
+ /**
64
+ * @description precision of input value
65
+ */
66
+ precision?: number;
67
+ /**
68
+ * @description whether to trigger form validation
69
+ */
70
+ validateEvent?: boolean;
71
+ /**
72
+ * @description native aria-label attribute
73
+ */
74
+ ariaLabel?: string;
75
+ /**
76
+ * @description native input mode for virtual keyboards
77
+ */
78
+ inputmode?: HTMLAttributes['inputmode'];
79
+ /**
80
+ * @description alignment for the inner input text
81
+ */
82
+ align?: 'left' | 'right' | 'center';
83
+ /**
84
+ * @description whether to disable scientific notation input (e.g. 'e', 'E')
85
+ */
86
+ disabledScientific?: boolean;
87
+ /**
88
+ * @description specifies the format of the value presented in the input
89
+ */
90
+ formatter?: (value: string) => string;
91
+ /**
92
+ * @description specifies the value extracted from the formatted input
93
+ */
94
+ parser?: (value: string) => string;
95
+ /**
96
+ * @description same as `tabindex` in native input
97
+ */
98
+ tabindex?: string | number;
99
+ /**
100
+ * @description whether to enable the floating label (Material style)
101
+ */
102
+ floatLabel?: boolean;
103
+ }
104
+ /**
105
+ * @deprecated Removed after 3.0.0, Use `InputNumberProps` instead.
106
+ */
107
+ export declare const inputNumberProps: {
108
+ readonly floatLabel: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
109
+ readonly inputmode: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => "search" | "none" | "text" | "email" | "tel" | "url" | "numeric" | "decimal") | (() => "search" | "none" | "text" | "email" | "tel" | "url" | "numeric" | "decimal" | undefined) | (((new (...args: any[]) => "search" | "none" | "text" | "email" | "tel" | "url" | "numeric" | "decimal") | (() => "search" | "none" | "text" | "email" | "tel" | "url" | "numeric" | "decimal" | undefined)) | null)[], unknown, unknown, undefined, boolean>;
110
+ readonly align: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => "left" | "right" | "center") | (() => "left" | "right" | "center") | (((new (...args: any[]) => "left" | "right" | "center") | (() => "left" | "right" | "center")) | null)[], unknown, unknown, "center", boolean>;
111
+ readonly disabledScientific: BooleanConstructor;
112
+ readonly formatter: {
113
+ readonly type: import("vue").PropType<Function>;
114
+ readonly required: false;
115
+ readonly validator: ((val: unknown) => boolean) | undefined;
116
+ __epPropKey: true;
117
+ };
118
+ readonly parser: {
119
+ readonly type: import("vue").PropType<Function>;
120
+ readonly required: false;
121
+ readonly validator: ((val: unknown) => boolean) | undefined;
122
+ __epPropKey: true;
123
+ };
124
+ readonly tabindex: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, 0, boolean>;
125
+ readonly ariaLabel: StringConstructor;
126
+ readonly id: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
127
+ readonly step: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
128
+ readonly stepStrictly: BooleanConstructor;
129
+ readonly max: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
130
+ readonly min: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
131
+ readonly modelValue: {
132
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<readonly [NumberConstructor, null], unknown, unknown>>;
133
+ readonly required: false;
134
+ readonly validator: ((val: unknown) => boolean) | undefined;
135
+ __epPropKey: true;
136
+ };
137
+ readonly readonly: BooleanConstructor;
138
+ readonly disabled: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
139
+ readonly size: {
140
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
141
+ readonly required: false;
142
+ readonly validator: ((val: unknown) => boolean) | undefined;
143
+ __epPropKey: true;
144
+ };
145
+ readonly controls: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
146
+ readonly controlsPosition: import("@element-plus/utils").EpPropFinalized<StringConstructor, "" | "right", unknown, "", boolean>;
147
+ readonly valueOnClear: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => number | "max" | "min") | (() => number | "max" | "min" | null) | (((new (...args: any[]) => number | "max" | "min") | (() => number | "max" | "min" | null)) | null)[], unknown, unknown, null, boolean>;
148
+ readonly name: StringConstructor;
149
+ readonly placeholder: StringConstructor;
150
+ readonly precision: {
151
+ readonly type: import("vue").PropType<number>;
152
+ readonly required: false;
153
+ readonly validator: ((val: unknown) => boolean) | undefined;
154
+ __epPropKey: true;
155
+ };
156
+ readonly validateEvent: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
157
+ };
158
+ /**
159
+ * @deprecated Removed after 3.0.0, Use `InputNumberProps` instead.
160
+ */
161
+ export type InputNumberPropsPublic = ExtractPublicPropTypes<typeof inputNumberProps>;
162
+ export declare const inputNumberEmits: {
163
+ change: (cur: number | undefined, prev: number | undefined) => boolean;
164
+ blur: (e: FocusEvent) => boolean;
165
+ focus: (e: FocusEvent) => boolean;
166
+ input: (val: number | null | undefined) => boolean;
167
+ "update:modelValue": (val: number | undefined) => boolean;
168
+ };
169
+ export type InputNumberEmits = typeof inputNumberEmits;
@@ -0,0 +1,165 @@
1
+ import { isNil as o } from "lodash-unified";
2
+ import { isNumber as r } from "../../utils/types.js";
3
+ import "@vueuse/core";
4
+ import "@vue/shared";
5
+ import { UPDATE_MODEL_EVENT as n, INPUT_EVENT as p, CHANGE_EVENT as u } from "../../constants/event.js";
6
+ import "@element-plus/icons-vue";
7
+ import { buildProps as l, definePropType as t } from "../../utils/vue/props/runtime.js";
8
+ import "vue";
9
+ import { useSizeProp as m } from "../../hooks/use-size/index.js";
10
+ import "@popperjs/core";
11
+ import "../../hooks/use-z-index/index.js";
12
+ import "../../hooks/use-delayed-toggle/index.js";
13
+ import { useAriaProps as a } from "../../hooks/use-aria/index.js";
14
+ import "../../hooks/use-model-toggle/index.js";
15
+ import "../../hooks/use-empty-values/index.js";
16
+ import { floatLabelProp as d } from "../../hooks/use-float-label/index.js";
17
+ l({
18
+ /**
19
+ * @description same as `id` in native input
20
+ */
21
+ id: {
22
+ type: String,
23
+ default: void 0
24
+ },
25
+ /**
26
+ * @description incremental step
27
+ */
28
+ step: {
29
+ type: Number,
30
+ default: 1
31
+ },
32
+ /**
33
+ * @description whether input value can only be multiple of step
34
+ */
35
+ stepStrictly: Boolean,
36
+ /**
37
+ * @description the maximum allowed value
38
+ */
39
+ max: {
40
+ type: Number,
41
+ default: Number.MAX_SAFE_INTEGER
42
+ },
43
+ /**
44
+ * @description the minimum allowed value
45
+ */
46
+ min: {
47
+ type: Number,
48
+ default: Number.MIN_SAFE_INTEGER
49
+ },
50
+ /**
51
+ * @description binding value
52
+ */
53
+ modelValue: {
54
+ type: [Number, null]
55
+ },
56
+ /**
57
+ * @description same as `readonly` in native input
58
+ */
59
+ readonly: Boolean,
60
+ /**
61
+ * @description whether the component is disabled
62
+ */
63
+ disabled: {
64
+ type: Boolean,
65
+ default: void 0
66
+ },
67
+ /**
68
+ * @description size of the component
69
+ */
70
+ size: m,
71
+ /**
72
+ * @description whether to enable the control buttons
73
+ */
74
+ controls: {
75
+ type: Boolean,
76
+ default: !0
77
+ },
78
+ /**
79
+ * @description position of the control buttons
80
+ */
81
+ controlsPosition: {
82
+ type: String,
83
+ default: "",
84
+ values: ["", "right"]
85
+ },
86
+ /**
87
+ * @description value should be set when input box is cleared
88
+ */
89
+ valueOnClear: {
90
+ type: t([String, Number, null]),
91
+ validator: (e) => e === null || r(e) || ["min", "max"].includes(e),
92
+ default: null
93
+ },
94
+ /**
95
+ * @description same as `name` in native input
96
+ */
97
+ name: String,
98
+ /**
99
+ * @description same as `placeholder` in native input
100
+ */
101
+ placeholder: String,
102
+ /**
103
+ * @description precision of input value
104
+ */
105
+ precision: {
106
+ type: Number,
107
+ validator: (e) => e >= 0 && e === Number.parseInt(`${e}`, 10)
108
+ },
109
+ /**
110
+ * @description whether to trigger form validation
111
+ */
112
+ validateEvent: {
113
+ type: Boolean,
114
+ default: !0
115
+ },
116
+ ...a(["ariaLabel"]),
117
+ /**
118
+ * @description native input mode for virtual keyboards
119
+ */
120
+ inputmode: {
121
+ type: t(String),
122
+ default: void 0
123
+ },
124
+ /**
125
+ * @description alignment for the inner input text
126
+ */
127
+ align: {
128
+ type: t(String),
129
+ default: "center"
130
+ },
131
+ /**
132
+ * @description whether to disable scientific notation input (e.g. 'e', 'E')
133
+ */
134
+ disabledScientific: Boolean,
135
+ /**
136
+ * @description specifies the format of the value presented in the input
137
+ */
138
+ formatter: {
139
+ type: Function
140
+ },
141
+ /**
142
+ * @description specifies the value extracted from the formatted input
143
+ */
144
+ parser: {
145
+ type: Function
146
+ },
147
+ /**
148
+ * @description same as `tabindex` in native input
149
+ */
150
+ tabindex: {
151
+ type: [String, Number],
152
+ default: 0
153
+ },
154
+ ...d
155
+ });
156
+ const I = {
157
+ [u]: (e, i) => i !== e,
158
+ blur: (e) => e instanceof FocusEvent,
159
+ focus: (e) => e instanceof FocusEvent,
160
+ [p]: (e) => r(e) || o(e),
161
+ [n]: (e) => r(e) || o(e)
162
+ };
163
+ export {
164
+ I as inputNumberEmits
165
+ };
@@ -0,0 +1,2 @@
1
+ import type _EpInputNumber from './EpInputNumber.vue';
2
+ export type InputNumberInstance = InstanceType<typeof _EpInputNumber>;