@nutui/nutui 4.0.12-beta.1 → 4.0.12
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/dist/nutui.es.js +1 -1
- package/dist/nutui.js +1 -1
- package/dist/nutui.umd.js +1 -1
- package/dist/packages/_es/ActionSheet.js +111 -78
- package/dist/packages/_es/Address.js +375 -250
- package/dist/packages/_es/AddressList.js +354 -269
- package/dist/packages/_es/Animate.js +58 -41
- package/dist/packages/_es/Audio.js +197 -128
- package/dist/packages/_es/AudioOperate.js +71 -60
- package/dist/packages/_es/Avatar.js +89 -66
- package/dist/packages/_es/AvatarGroup.js +31 -23
- package/dist/packages/_es/Backtop.js +99 -59
- package/dist/packages/_es/Badge.js +47 -36
- package/dist/packages/_es/Barrage.js +147 -68
- package/dist/packages/_es/Button.js +66 -47
- package/dist/packages/_es/Calendar.js +157 -135
- package/dist/packages/_es/CalendarItem.js +6 -6
- package/dist/packages/_es/Card.js +56 -42
- package/dist/packages/_es/Cascader.js +474 -315
- package/dist/packages/_es/Category.js +39 -29
- package/dist/packages/_es/CategoryPane.js +83 -57
- package/dist/packages/_es/Cell.js +71 -56
- package/dist/packages/_es/CellGroup.js +27 -19
- package/dist/packages/_es/Checkbox.js +156 -109
- package/dist/packages/_es/CheckboxGroup.js +59 -38
- package/dist/packages/_es/CircleProgress.js +96 -67
- package/dist/packages/_es/Col.js +31 -23
- package/dist/packages/_es/Collapse.js +58 -33
- package/dist/packages/_es/CollapseItem.js +108 -78
- package/dist/packages/_es/Comment.js +279 -207
- package/dist/packages/_es/ConfigProvider.js +55 -37
- package/dist/packages/_es/Countdown.js +212 -100
- package/dist/packages/_es/Countup.js +445 -232
- package/dist/packages/_es/DatePicker.js +265 -162
- package/dist/packages/_es/Dialog.js +213 -161
- package/dist/packages/_es/Divider.js +57 -42
- package/dist/packages/_es/Drag.js +153 -70
- package/dist/packages/_es/Ecard.js +104 -64
- package/dist/packages/_es/Elevator.js +219 -143
- package/dist/packages/_es/Ellipsis.js +178 -95
- package/dist/packages/_es/Empty.js +39 -23
- package/dist/packages/_es/FixedNav.js +116 -93
- package/dist/packages/_es/Form.js +178 -107
- package/dist/packages/_es/FormItem.js +61 -48
- package/dist/packages/_es/Grid.js +6 -5
- package/dist/packages/_es/GridItem.js +84 -58
- package/dist/packages/_es/Image.js +130 -90
- package/dist/packages/_es/ImagePreview.js +412 -256
- package/dist/packages/_es/Indicator.js +34 -30
- package/dist/packages/_es/InfiniteLoading.js +136 -83
- package/dist/packages/_es/Input.js +264 -160
- package/dist/packages/_es/InputNumber.js +117 -81
- package/dist/packages/_es/Interceptor-956b24fc.js +29 -0
- package/dist/packages/_es/Invoice.js +130 -104
- package/dist/packages/_es/Layout.js +4 -3
- package/dist/packages/_es/List.js +215 -117
- package/dist/packages/_es/Menu.js +150 -95
- package/dist/packages/_es/MenuItem.js +154 -109
- package/dist/packages/_es/Navbar.js +119 -103
- package/dist/packages/_es/Noticebar.js +312 -197
- package/dist/packages/_es/Notify.js +166 -110
- package/dist/packages/_es/NumberKeyboard.js +202 -127
- package/dist/packages/_es/Overlay.js +80 -52
- package/dist/packages/_es/Pagination.js +100 -70
- package/dist/packages/_es/Picker.js +437 -275
- package/dist/packages/_es/Popover.js +225 -122
- package/dist/packages/_es/Popup.js +4 -4
- package/dist/packages/_es/Price.js +82 -44
- package/dist/packages/_es/Progress.js +79 -63
- package/dist/packages/_es/PullRefresh.js +173 -95
- package/dist/packages/_es/Radio.js +4 -4
- package/dist/packages/_es/RadioGroup.js +3 -3
- package/dist/packages/_es/Range.js +347 -204
- package/dist/packages/_es/Rate.js +141 -92
- package/dist/packages/_es/Row.js +27 -21
- package/dist/packages/_es/Searchbar.js +174 -123
- package/dist/packages/_es/ShortPassword.js +93 -69
- package/dist/packages/_es/SideNavbar.js +80 -49
- package/dist/packages/_es/SideNavbarItem.js +32 -22
- package/dist/packages/_es/Signature.js +146 -83
- package/dist/packages/_es/Skeleton.js +130 -110
- package/dist/packages/_es/Sku.js +343 -250
- package/dist/packages/_es/Step.js +86 -59
- package/dist/packages/_es/Steps.js +31 -26
- package/dist/packages/_es/Sticky.js +4 -4
- package/dist/packages/_es/SubSideNavbar.js +74 -52
- package/dist/packages/_es/Swipe.js +155 -83
- package/dist/packages/_es/Swiper.js +311 -174
- package/dist/packages/_es/SwiperItem.js +44 -28
- package/dist/packages/_es/Switch.js +68 -55
- package/dist/packages/_es/TabPane.js +41 -30
- package/dist/packages/_es/Tabbar.js +52 -41
- package/dist/packages/_es/TabbarItem.js +82 -61
- package/dist/packages/_es/Table.js +165 -109
- package/dist/packages/_es/Tabs.js +388 -240
- package/dist/packages/_es/Tag.js +61 -44
- package/dist/packages/_es/Textarea.js +124 -80
- package/dist/packages/_es/TimeDetail.js +76 -49
- package/dist/packages/_es/TimePannel.js +48 -34
- package/dist/packages/_es/TimeSelect.js +68 -47
- package/dist/packages/_es/Toast.js +218 -144
- package/dist/packages/_es/Tour.js +192 -138
- package/dist/packages/_es/TrendArrow.js +77 -57
- package/dist/packages/_es/Uploader.js +359 -234
- package/dist/packages/_es/Video.js +316 -191
- package/dist/packages/_es/Watermark.js +117 -84
- package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +10 -0
- package/dist/packages/_es/common-b9a5e726.js +145 -0
- package/dist/packages/_es/component-81a4c1d0.js +145 -0
- package/dist/packages/_es/index-29892cda.js +33 -0
- package/dist/packages/_es/index-43c34ac6.js +30 -0
- package/dist/packages/_es/index-54d03fc1.js +8 -0
- package/dist/packages/_es/index-79c5dc33.js +10 -0
- package/dist/packages/_es/index-7a7385e4.js +67 -0
- package/dist/packages/_es/index-87422be8.js +942 -0
- package/dist/packages/_es/index-da0a7662.js +259 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +46 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-a8856969.js +97 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +151 -0
- package/dist/packages/_es/mountComponent-8b24c346.js +39 -0
- package/dist/packages/_es/pxCheck-c6b9f6b7.js +6 -0
- package/dist/packages/_es/raf-729dad54.js +25 -0
- package/dist/packages/_es/renderIcon-3d0fd47c.js +9 -0
- package/dist/packages/locale/lang/baseLang-3a8457ac.js +5 -0
- package/dist/packages/locale/lang/en-US.js +39 -36
- package/dist/packages/locale/lang/id-ID.js +39 -36
- package/dist/packages/locale/lang/index.js +44 -22
- package/dist/packages/locale/lang/zh-CN.js +38 -35
- package/dist/packages/locale/lang/zh-TW.js +38 -35
- package/dist/resolver/index.js +26 -1
- package/dist/resolver/index.mjs +17 -14
- package/dist/smartips/web-types.json +1 -1
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +50 -50
- package/dist/styles/themes/jdb.scss +50 -50
- package/dist/styles/themes/jddkh.scss +50 -50
- package/dist/styles/themes/jdt.scss +50 -50
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/packages/_es/Interceptor-6e26b757.js +0 -18
- package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +0 -9
- package/dist/packages/_es/common-d218746f.js +0 -116
- package/dist/packages/_es/component-234624bc.js +0 -89
- package/dist/packages/_es/index-14dfadc4.js +0 -561
- package/dist/packages/_es/index-192a3ef6.js +0 -29
- package/dist/packages/_es/index-360c5092.js +0 -210
- package/dist/packages/_es/index-496e6e05.js +0 -24
- package/dist/packages/_es/index-50eed3d9.js +0 -7
- package/dist/packages/_es/index-53ec2d4d.js +0 -34
- package/dist/packages/_es/index-fadb0974.js +0 -8
- package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +0 -43
- package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +0 -77
- package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +0 -110
- package/dist/packages/_es/mountComponent-6d4ff200.js +0 -23
- package/dist/packages/_es/pxCheck-38173291.js +0 -4
- package/dist/packages/_es/raf-a74f1a06.js +0 -16
- package/dist/packages/_es/renderIcon-47498b32.js +0 -5
- package/dist/packages/locale/lang/baseLang-0bdc6353.js +0 -5
|
@@ -1,29 +1,50 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
11
16
|
};
|
|
12
|
-
import { ref
|
|
13
|
-
import { c as
|
|
14
|
-
import { MaskClose
|
|
15
|
-
import { _ as
|
|
17
|
+
import { ref, reactive, computed, watch, onMounted, h, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createBlock, resolveDynamicComponent, normalizeStyle, toDisplayString, createTextVNode, createCommentVNode, withDirectives, createVNode, mergeProps, vShow } from "vue";
|
|
18
|
+
import { c as createComponent } from "./component-81a4c1d0.js";
|
|
19
|
+
import { MaskClose } from "@nutui/icons-vue";
|
|
20
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
16
21
|
import "../locale/lang";
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
|
|
22
|
+
function trimExtraChar(value, char, regExp) {
|
|
23
|
+
const index2 = value.indexOf(char);
|
|
24
|
+
if (index2 === -1) {
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
if (char === "-" && index2 !== 0) {
|
|
28
|
+
return value.slice(0, index2);
|
|
29
|
+
}
|
|
30
|
+
return value.slice(0, index2 + 1) + value.slice(index2).replace(regExp, "");
|
|
20
31
|
}
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
32
|
+
function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
33
|
+
if (allowDot) {
|
|
34
|
+
value = trimExtraChar(value, ".", /\./g);
|
|
35
|
+
} else {
|
|
36
|
+
value = value.split(".")[0];
|
|
37
|
+
}
|
|
38
|
+
if (allowMinus) {
|
|
39
|
+
value = trimExtraChar(value, "-", /-/g);
|
|
40
|
+
} else {
|
|
41
|
+
value = value.replace(/-/, "");
|
|
42
|
+
}
|
|
43
|
+
const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
|
|
44
|
+
return value.replace(regExp, "");
|
|
25
45
|
}
|
|
26
|
-
const { componentName
|
|
46
|
+
const { componentName, create } = createComponent("input");
|
|
47
|
+
const _sfc_main = create({
|
|
27
48
|
props: {
|
|
28
49
|
type: {
|
|
29
50
|
type: String,
|
|
@@ -43,15 +64,15 @@ const { componentName: oe, create: le } = ee("input"), ae = le({
|
|
|
43
64
|
},
|
|
44
65
|
required: {
|
|
45
66
|
type: Boolean,
|
|
46
|
-
default:
|
|
67
|
+
default: false
|
|
47
68
|
},
|
|
48
69
|
disabled: {
|
|
49
70
|
type: Boolean,
|
|
50
|
-
default:
|
|
71
|
+
default: false
|
|
51
72
|
},
|
|
52
73
|
readonly: {
|
|
53
74
|
type: Boolean,
|
|
54
|
-
default:
|
|
75
|
+
default: false
|
|
55
76
|
},
|
|
56
77
|
maxLength: {
|
|
57
78
|
type: [String, Number],
|
|
@@ -59,7 +80,7 @@ const { componentName: oe, create: le } = ee("input"), ae = le({
|
|
|
59
80
|
},
|
|
60
81
|
clearable: {
|
|
61
82
|
type: Boolean,
|
|
62
|
-
default:
|
|
83
|
+
default: false
|
|
63
84
|
},
|
|
64
85
|
clearSize: {
|
|
65
86
|
type: [String, Number],
|
|
@@ -67,7 +88,7 @@ const { componentName: oe, create: le } = ee("input"), ae = le({
|
|
|
67
88
|
},
|
|
68
89
|
border: {
|
|
69
90
|
type: Boolean,
|
|
70
|
-
default:
|
|
91
|
+
default: true
|
|
71
92
|
},
|
|
72
93
|
formatTrigger: {
|
|
73
94
|
type: String,
|
|
@@ -79,11 +100,11 @@ const { componentName: oe, create: le } = ee("input"), ae = le({
|
|
|
79
100
|
},
|
|
80
101
|
showWordLimit: {
|
|
81
102
|
type: Boolean,
|
|
82
|
-
default:
|
|
103
|
+
default: false
|
|
83
104
|
},
|
|
84
105
|
autofocus: {
|
|
85
106
|
type: Boolean,
|
|
86
|
-
default:
|
|
107
|
+
default: false
|
|
87
108
|
},
|
|
88
109
|
confirmType: {
|
|
89
110
|
type: String,
|
|
@@ -91,181 +112,264 @@ const { componentName: oe, create: le } = ee("input"), ae = le({
|
|
|
91
112
|
},
|
|
92
113
|
error: {
|
|
93
114
|
type: Boolean,
|
|
94
|
-
default:
|
|
115
|
+
default: false
|
|
95
116
|
},
|
|
96
117
|
showClearIcon: {
|
|
97
118
|
type: Boolean,
|
|
98
|
-
default:
|
|
119
|
+
default: false
|
|
99
120
|
},
|
|
100
121
|
class: {
|
|
101
122
|
type: String,
|
|
102
123
|
default: ""
|
|
103
124
|
}
|
|
104
125
|
},
|
|
105
|
-
components: { MaskClose
|
|
126
|
+
components: { MaskClose },
|
|
106
127
|
emits: ["update:modelValue", "blur", "focus", "clear", "keypress", "click", "click-input"],
|
|
107
128
|
expose: ["focus", "blur", "select"],
|
|
108
|
-
setup(
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
129
|
+
setup(props, { emit, slots }) {
|
|
130
|
+
const active = ref(false);
|
|
131
|
+
const inputRef = ref();
|
|
132
|
+
const getModelValue = () => {
|
|
133
|
+
var _a;
|
|
134
|
+
return String((_a = props.modelValue) != null ? _a : "");
|
|
135
|
+
};
|
|
136
|
+
const renderInput = (type) => {
|
|
137
|
+
return h("input", __spreadValues({
|
|
138
|
+
style: styles
|
|
139
|
+
}, inputType(type)));
|
|
140
|
+
};
|
|
141
|
+
const state = reactive({
|
|
142
|
+
focused: false,
|
|
143
|
+
validateFailed: false,
|
|
117
144
|
// 校验失败
|
|
118
145
|
validateMessage: ""
|
|
119
146
|
// 校验信息
|
|
120
|
-
})
|
|
121
|
-
|
|
147
|
+
});
|
|
148
|
+
const classes = computed(() => {
|
|
149
|
+
const prefixCls = componentName;
|
|
122
150
|
return {
|
|
123
|
-
[
|
|
124
|
-
[`${
|
|
125
|
-
[`${
|
|
126
|
-
[`${
|
|
127
|
-
[`${
|
|
128
|
-
[
|
|
151
|
+
[prefixCls]: true,
|
|
152
|
+
[`${prefixCls}--disabled`]: props.disabled,
|
|
153
|
+
[`${prefixCls}--required`]: props.required,
|
|
154
|
+
[`${prefixCls}--error`]: props.error,
|
|
155
|
+
[`${prefixCls}--border`]: props.border,
|
|
156
|
+
[props.class]: !!props.class
|
|
129
157
|
};
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
if (
|
|
138
|
-
|
|
139
|
-
|
|
158
|
+
});
|
|
159
|
+
const styles = computed(() => {
|
|
160
|
+
return {
|
|
161
|
+
textAlign: props.inputAlign
|
|
162
|
+
};
|
|
163
|
+
});
|
|
164
|
+
const inputType = (type) => {
|
|
165
|
+
if (type === "number") {
|
|
166
|
+
return {
|
|
167
|
+
type: "text"
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
if (type === "digit") {
|
|
171
|
+
return {
|
|
172
|
+
type: "tel"
|
|
173
|
+
};
|
|
140
174
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
175
|
+
return { type };
|
|
176
|
+
};
|
|
177
|
+
const onInput = (event) => {
|
|
178
|
+
if (!event.target.composing) {
|
|
179
|
+
const input = event.target;
|
|
180
|
+
let value = input.value;
|
|
181
|
+
if (props.maxLength && value.length > Number(props.maxLength)) {
|
|
182
|
+
value = value.slice(0, Number(props.maxLength));
|
|
183
|
+
}
|
|
184
|
+
updateValue(value);
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
const updateValue = (value, trigger = "onChange") => {
|
|
188
|
+
var _a;
|
|
189
|
+
if (props.type === "digit") {
|
|
190
|
+
value = formatNumber(value, false, false);
|
|
191
|
+
}
|
|
192
|
+
if (props.type === "number") {
|
|
193
|
+
value = formatNumber(value, true, true);
|
|
194
|
+
}
|
|
195
|
+
if (props.formatter && trigger === props.formatTrigger) {
|
|
196
|
+
value = props.formatter(value);
|
|
197
|
+
}
|
|
198
|
+
if (((_a = inputRef == null ? void 0 : inputRef.value) == null ? void 0 : _a.value) !== value) {
|
|
199
|
+
inputRef.value.value = value;
|
|
200
|
+
}
|
|
201
|
+
if (value !== props.modelValue) {
|
|
202
|
+
emit("update:modelValue", value);
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
const onFocus = (event) => {
|
|
206
|
+
if (props.disabled || props.readonly) {
|
|
146
207
|
return;
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
208
|
+
}
|
|
209
|
+
const input = event.target;
|
|
210
|
+
input.value;
|
|
211
|
+
active.value = true;
|
|
212
|
+
emit("focus", event);
|
|
213
|
+
};
|
|
214
|
+
const onBlur = (event) => {
|
|
215
|
+
if (props.disabled || props.readonly) {
|
|
150
216
|
return;
|
|
217
|
+
}
|
|
151
218
|
setTimeout(() => {
|
|
152
|
-
|
|
219
|
+
active.value = false;
|
|
153
220
|
}, 200);
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
e.disabled || n("click-input", t);
|
|
162
|
-
}, E = (t) => {
|
|
163
|
-
n("click", t);
|
|
164
|
-
}, q = ({ target: t }) => {
|
|
165
|
-
t.composing = !0;
|
|
166
|
-
}, A = ({ target: t }) => {
|
|
167
|
-
t.composing && (t.composing = !1, t.dispatchEvent(new Event("input")));
|
|
221
|
+
const input = event.target;
|
|
222
|
+
let value = input.value;
|
|
223
|
+
if (props.maxLength && value.length > Number(props.maxLength)) {
|
|
224
|
+
value = value.slice(0, Number(props.maxLength));
|
|
225
|
+
}
|
|
226
|
+
updateValue(getModelValue(), "onBlur");
|
|
227
|
+
emit("blur", event);
|
|
168
228
|
};
|
|
169
|
-
|
|
170
|
-
()
|
|
171
|
-
()
|
|
172
|
-
|
|
229
|
+
const clear = (event) => {
|
|
230
|
+
event.stopPropagation();
|
|
231
|
+
if (props.disabled)
|
|
232
|
+
return;
|
|
233
|
+
emit("update:modelValue", "", event);
|
|
234
|
+
emit("clear", "", event);
|
|
235
|
+
};
|
|
236
|
+
const resetValidation = () => {
|
|
237
|
+
if (state.validateFailed) {
|
|
238
|
+
state.validateFailed = false;
|
|
239
|
+
state.validateMessage = "";
|
|
173
240
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
inputRef: i,
|
|
179
|
-
active: l,
|
|
180
|
-
classes: N,
|
|
181
|
-
styles: h,
|
|
182
|
-
inputType: y,
|
|
183
|
-
onInput: $,
|
|
184
|
-
onFocus: T,
|
|
185
|
-
onBlur: I,
|
|
186
|
-
clear: z,
|
|
187
|
-
startComposing: q,
|
|
188
|
-
endComposing: A,
|
|
189
|
-
onClick: E,
|
|
190
|
-
onClickInput: M,
|
|
191
|
-
focus: () => {
|
|
192
|
-
var t;
|
|
193
|
-
(t = i.value) == null || t.focus();
|
|
194
|
-
},
|
|
195
|
-
blur: () => {
|
|
196
|
-
var t;
|
|
197
|
-
(t = i.value) == null || t.blur();
|
|
198
|
-
},
|
|
199
|
-
select: () => {
|
|
200
|
-
var t;
|
|
201
|
-
(t = i.value) == null || t.select();
|
|
241
|
+
};
|
|
242
|
+
const onClickInput = (event) => {
|
|
243
|
+
if (props.disabled) {
|
|
244
|
+
return;
|
|
202
245
|
}
|
|
246
|
+
emit("click-input", event);
|
|
247
|
+
};
|
|
248
|
+
const onClick = (event) => {
|
|
249
|
+
emit("click", event);
|
|
250
|
+
};
|
|
251
|
+
const startComposing = ({ target }) => {
|
|
252
|
+
target.composing = true;
|
|
253
|
+
};
|
|
254
|
+
const endComposing = ({ target }) => {
|
|
255
|
+
if (target.composing) {
|
|
256
|
+
target.composing = false;
|
|
257
|
+
target.dispatchEvent(new Event("input"));
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
watch(
|
|
261
|
+
() => props.modelValue,
|
|
262
|
+
() => {
|
|
263
|
+
updateValue(getModelValue());
|
|
264
|
+
resetValidation();
|
|
265
|
+
}
|
|
266
|
+
);
|
|
267
|
+
onMounted(() => {
|
|
268
|
+
updateValue(getModelValue(), props.formatTrigger);
|
|
269
|
+
});
|
|
270
|
+
const focus = () => {
|
|
271
|
+
var _a;
|
|
272
|
+
(_a = inputRef.value) == null ? void 0 : _a.focus();
|
|
273
|
+
};
|
|
274
|
+
const blur = () => {
|
|
275
|
+
var _a;
|
|
276
|
+
(_a = inputRef.value) == null ? void 0 : _a.blur();
|
|
277
|
+
};
|
|
278
|
+
const select = () => {
|
|
279
|
+
var _a;
|
|
280
|
+
(_a = inputRef.value) == null ? void 0 : _a.select();
|
|
281
|
+
};
|
|
282
|
+
return {
|
|
283
|
+
renderInput,
|
|
284
|
+
inputRef,
|
|
285
|
+
active,
|
|
286
|
+
classes,
|
|
287
|
+
styles,
|
|
288
|
+
inputType,
|
|
289
|
+
onInput,
|
|
290
|
+
onFocus,
|
|
291
|
+
onBlur,
|
|
292
|
+
clear,
|
|
293
|
+
startComposing,
|
|
294
|
+
endComposing,
|
|
295
|
+
onClick,
|
|
296
|
+
onClickInput,
|
|
297
|
+
focus,
|
|
298
|
+
blur,
|
|
299
|
+
select
|
|
203
300
|
};
|
|
204
301
|
}
|
|
205
|
-
})
|
|
302
|
+
});
|
|
303
|
+
const _hoisted_1 = { class: "nut-input-value" };
|
|
304
|
+
const _hoisted_2 = { class: "nut-input-inner" };
|
|
305
|
+
const _hoisted_3 = { class: "nut-input-left-box" };
|
|
306
|
+
const _hoisted_4 = { class: "nut-input-box" };
|
|
307
|
+
const _hoisted_5 = {
|
|
206
308
|
key: 0,
|
|
207
309
|
class: "nut-input-word-limit"
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
310
|
+
};
|
|
311
|
+
const _hoisted_6 = { class: "nut-input-word-num" };
|
|
312
|
+
const _hoisted_7 = { class: "nut-input-right-box" };
|
|
313
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
314
|
+
const _component_MaskClose = resolveComponent("MaskClose");
|
|
315
|
+
return openBlock(), createElementBlock("view", {
|
|
316
|
+
class: normalizeClass(_ctx.classes),
|
|
317
|
+
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onClick && _ctx.onClick(...args))
|
|
214
318
|
}, [
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
319
|
+
createElementVNode("view", _hoisted_1, [
|
|
320
|
+
createElementVNode("view", _hoisted_2, [
|
|
321
|
+
createElementVNode("view", _hoisted_3, [
|
|
322
|
+
renderSlot(_ctx.$slots, "left")
|
|
219
323
|
]),
|
|
220
|
-
|
|
221
|
-
(
|
|
324
|
+
createElementVNode("view", _hoisted_4, [
|
|
325
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.renderInput(_ctx.type)), {
|
|
222
326
|
class: "input-text",
|
|
223
327
|
ref: "inputRef",
|
|
224
|
-
style:
|
|
225
|
-
maxlength:
|
|
226
|
-
placeholder:
|
|
227
|
-
disabled:
|
|
228
|
-
readonly:
|
|
229
|
-
value:
|
|
230
|
-
formatTrigger:
|
|
231
|
-
autofocus:
|
|
232
|
-
enterkeyhint:
|
|
233
|
-
onInput:
|
|
234
|
-
onFocus:
|
|
235
|
-
onBlur:
|
|
236
|
-
onClick:
|
|
237
|
-
onChange:
|
|
238
|
-
onCompositionend:
|
|
239
|
-
onCompositionstart:
|
|
328
|
+
style: normalizeStyle(_ctx.styles),
|
|
329
|
+
maxlength: _ctx.maxLength,
|
|
330
|
+
placeholder: _ctx.placeholder,
|
|
331
|
+
disabled: _ctx.disabled,
|
|
332
|
+
readonly: _ctx.readonly,
|
|
333
|
+
value: _ctx.modelValue,
|
|
334
|
+
formatTrigger: _ctx.formatTrigger,
|
|
335
|
+
autofocus: _ctx.autofocus,
|
|
336
|
+
enterkeyhint: _ctx.confirmType,
|
|
337
|
+
onInput: _ctx.onInput,
|
|
338
|
+
onFocus: _ctx.onFocus,
|
|
339
|
+
onBlur: _ctx.onBlur,
|
|
340
|
+
onClick: _ctx.onClickInput,
|
|
341
|
+
onChange: _ctx.endComposing,
|
|
342
|
+
onCompositionend: _ctx.endComposing,
|
|
343
|
+
onCompositionstart: _ctx.startComposing
|
|
240
344
|
}, null, 40, ["style", "maxlength", "placeholder", "disabled", "readonly", "value", "formatTrigger", "autofocus", "enterkeyhint", "onInput", "onFocus", "onBlur", "onClick", "onChange", "onCompositionend", "onCompositionstart"])),
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
])) :
|
|
345
|
+
_ctx.showWordLimit && _ctx.maxLength ? (openBlock(), createElementBlock("view", _hoisted_5, [
|
|
346
|
+
createElementVNode("span", _hoisted_6, toDisplayString(_ctx.modelValue ? _ctx.modelValue.length : 0), 1),
|
|
347
|
+
createTextVNode("/" + toDisplayString(_ctx.maxLength), 1)
|
|
348
|
+
])) : createCommentVNode("", true)
|
|
245
349
|
]),
|
|
246
|
-
|
|
350
|
+
_ctx.clearable && !_ctx.readonly ? withDirectives((openBlock(), createElementBlock("view", {
|
|
247
351
|
key: 0,
|
|
248
352
|
class: "nut-input-clear-box",
|
|
249
|
-
onClick:
|
|
353
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.clear && _ctx.clear(...args))
|
|
250
354
|
}, [
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
size:
|
|
254
|
-
width:
|
|
255
|
-
height:
|
|
355
|
+
renderSlot(_ctx.$slots, "clear", {}, () => [
|
|
356
|
+
createVNode(_component_MaskClose, mergeProps({ class: "nut-input-clear" }, _ctx.$attrs, {
|
|
357
|
+
size: _ctx.clearSize,
|
|
358
|
+
width: _ctx.clearSize,
|
|
359
|
+
height: _ctx.clearSize
|
|
256
360
|
}), null, 16, ["size", "width", "height"])
|
|
257
361
|
])
|
|
258
362
|
], 512)), [
|
|
259
|
-
[
|
|
260
|
-
]) :
|
|
261
|
-
|
|
262
|
-
|
|
363
|
+
[vShow, (_ctx.active || _ctx.showClearIcon) && _ctx.modelValue.length > 0]
|
|
364
|
+
]) : createCommentVNode("", true),
|
|
365
|
+
createElementVNode("view", _hoisted_7, [
|
|
366
|
+
renderSlot(_ctx.$slots, "right")
|
|
263
367
|
])
|
|
264
368
|
])
|
|
265
369
|
])
|
|
266
370
|
], 2);
|
|
267
371
|
}
|
|
268
|
-
const
|
|
372
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
269
373
|
export {
|
|
270
|
-
|
|
374
|
+
index as default
|
|
271
375
|
};
|