@nutui/nutui 3.1.22-beta.5 → 3.1.23-beta.1
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/CHANGELOG.md +48 -0
- package/README.md +3 -4
- package/dist/nutui.es.js +20412 -4214
- package/dist/nutui.umd.js +20518 -4216
- package/dist/packages/_es/ActionSheet.js +149 -17
- package/dist/packages/_es/Address.js +535 -110
- package/dist/packages/_es/AddressList.js +615 -113
- package/dist/packages/_es/Animate.js +59 -17
- package/dist/packages/_es/Audio.js +257 -53
- package/dist/packages/_es/AudioOperate.js +100 -13
- package/dist/packages/_es/Avatar.js +162 -38
- package/dist/packages/_es/AvatarGroup.js +73 -14
- package/dist/packages/_es/BackTop.js +156 -43
- package/dist/packages/_es/Badge.js +86 -14
- package/dist/packages/_es/Barrage.js +120 -41
- package/dist/packages/_es/Button.js +128 -23
- package/dist/packages/_es/Calendar.js +246 -30
- package/dist/packages/_es/CalendarItem.js +1 -1
- package/dist/packages/_es/Card.js +107 -10
- package/dist/packages/_es/Cascader.js +496 -147
- package/dist/packages/_es/Category.js +58 -15
- package/dist/packages/_es/CategoryPane.js +111 -11
- package/dist/packages/_es/Cell.js +108 -21
- package/dist/packages/_es/CellGroup.js +44 -9
- package/dist/packages/_es/Checkbox.js +134 -29
- package/dist/packages/_es/CheckboxGroup.js +79 -29
- package/dist/packages/_es/CircleProgress.js +150 -28
- package/dist/packages/_es/Col.js +56 -14
- package/dist/packages/_es/Collapse.js +109 -32
- package/dist/packages/_es/CollapseItem.js +253 -59
- package/dist/packages/_es/Comment.js +434 -64
- package/dist/packages/_es/ConfigProvider.js +20 -8
- package/dist/packages/_es/CountDown.js +238 -56
- package/dist/packages/_es/CountUp.js +539 -140
- package/dist/packages/_es/DatePicker.js +315 -98
- package/dist/packages/_es/Dialog.js +289 -60
- package/dist/packages/_es/Divider.js +65 -13
- package/dist/packages/_es/Drag.js +197 -56
- package/dist/packages/_es/Ecard.js +159 -24
- package/dist/packages/_es/Elevator.js +255 -58
- package/dist/packages/_es/Ellipsis.js +200 -58
- package/dist/packages/_es/Empty.js +71 -12
- package/dist/packages/_es/FixedNav.js +122 -15
- package/dist/packages/_es/Form.js +151 -64
- package/dist/packages/_es/FormItem.js +114 -15
- package/dist/packages/_es/Grid.js +6 -5
- package/dist/packages/_es/GridItem.js +144 -33
- package/dist/packages/_es/Icon.js +40 -15
- package/dist/packages/_es/Image.js +137 -26
- package/dist/packages/_es/ImagePreview.js +547 -76
- package/dist/packages/_es/Indicator.js +62 -15
- package/dist/packages/_es/InfiniteLoading.js +249 -57
- package/dist/packages/_es/Input.js +433 -51
- package/dist/packages/_es/InputNumber.js +160 -41
- package/dist/packages/_es/Layout.js +5 -4
- package/dist/packages/_es/List.js +106 -18
- package/dist/packages/_es/Menu.js +168 -44
- package/dist/packages/_es/MenuItem.js +173 -37
- package/dist/packages/_es/Navbar.js +192 -30
- package/dist/packages/_es/NoticeBar.js +380 -74
- package/dist/packages/_es/Notify.js +227 -72
- package/dist/packages/_es/NumberKeyboard.js +272 -41
- package/dist/packages/_es/OldPicker.js +457 -130
- package/dist/packages/_es/OverLay.js +98 -24
- package/dist/packages/_es/Pagination.js +157 -39
- package/dist/packages/_es/Picker.js +454 -129
- package/dist/packages/_es/Popover.js +957 -318
- package/dist/packages/_es/Popup.js +299 -55
- package/dist/packages/_es/Price.js +118 -16
- package/dist/packages/_es/Progress.js +146 -14
- package/dist/packages/_es/PullRefresh.js +339 -84
- package/dist/packages/_es/Radio.js +90 -22
- package/dist/packages/_es/RadioGroup.js +37 -8
- package/dist/packages/_es/Range.js +408 -83
- package/dist/packages/_es/Rate.js +192 -36
- package/dist/packages/_es/Row.js +64 -22
- package/dist/packages/_es/SearchBar.js +238 -37
- package/dist/packages/_es/ShortPassword.js +225 -35
- package/dist/packages/_es/SideNavBar.js +81 -24
- package/dist/packages/_es/SideNavBarItem.js +46 -11
- package/dist/packages/_es/Signature.js +160 -41
- package/dist/packages/_es/Skeleton.js +136 -20
- package/dist/packages/_es/Sku.js +491 -84
- package/dist/packages/_es/Step.js +115 -20
- package/dist/packages/_es/Steps.js +53 -18
- package/dist/packages/_es/Sticky.js +138 -53
- package/dist/packages/_es/SubSideNavBar.js +82 -17
- package/dist/packages/_es/Swipe.js +178 -41
- package/dist/packages/_es/Swiper.js +433 -121
- package/dist/packages/_es/SwiperItem.js +53 -22
- package/dist/packages/_es/Switch.js +116 -21
- package/dist/packages/_es/TabPane.js +39 -12
- package/dist/packages/_es/Tabbar.js +72 -17
- package/dist/packages/_es/TabbarItem.js +151 -29
- package/dist/packages/_es/Table.js +178 -18
- package/dist/packages/_es/Tabs.js +202 -43
- package/dist/packages/_es/Tag.js +97 -20
- package/dist/packages/_es/TextArea.js +160 -42
- package/dist/packages/_es/TimeDetail.js +79 -18
- package/dist/packages/_es/TimePannel.js +48 -14
- package/dist/packages/_es/TimeSelect.js +112 -15
- package/dist/packages/_es/Toast.js +310 -71
- package/dist/packages/_es/Uploader.js +455 -104
- package/dist/packages/_es/Video.js +332 -74
- package/dist/packages/_es/common.js +128 -38
- package/dist/packages/_es/component.js +76 -35
- package/dist/packages/_es/index.js +6 -5
- package/dist/packages/_es/index2.js +30 -9
- package/dist/packages/_es/index3.js +8 -6
- package/dist/packages/_es/index4.js +64 -13
- package/dist/packages/_es/index5.js +780 -164
- package/dist/packages/_es/plugin-vue_export-helper.js +8 -7
- package/dist/packages/_es/pxCheck.js +5 -3
- package/dist/packages/_es/raf.js +15 -8
- package/dist/packages/imagepreview/index.scss +6 -1
- package/dist/packages/locale/lang/baseLang.js +3 -3
- package/dist/packages/locale/lang/en-US.js +105 -5
- package/dist/packages/locale/lang/id-ID.js +105 -5
- package/dist/packages/locale/lang/index.js +38 -16
- package/dist/packages/locale/lang/zh-CN.js +105 -5
- package/dist/packages/locale/lang/zh-TW.js +105 -5
- package/dist/packages/picker/index.scss +13 -0
- package/dist/smartips/attributes.json +8 -0
- package/dist/smartips/tags.json +3 -1
- package/dist/smartips/web-types.json +19 -1
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/themes/default.scss +49 -49
- package/dist/styles/themes/jdb.scss +49 -49
- package/dist/styles/themes/jdt.scss +49 -49
- package/dist/styles/variables-jdb.scss +4 -1
- package/dist/styles/variables-jdt.scss +4 -1
- package/dist/styles/variables.scss +1 -1
- package/dist/types/__VUE/actionsheet/index.vue.d.ts +3 -3
- package/dist/types/__VUE/address/index.vue.d.ts +4 -4
- package/dist/types/__VUE/calendar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/cascader/index.vue.d.ts +3 -3
- package/dist/types/__VUE/cell/index.vue.d.ts +2 -2
- package/dist/types/__VUE/checkbox/index.vue.d.ts +2 -2
- package/dist/types/__VUE/collapse/index.vue.d.ts +2 -2
- package/dist/types/__VUE/datepicker/index.vue.d.ts +2 -2
- package/dist/types/__VUE/dialog/index.vue.d.ts +2 -2
- package/dist/types/__VUE/ecard/index.vue.d.ts +2 -2
- package/dist/types/__VUE/fixednav/index.vue.d.ts +2 -2
- package/dist/types/__VUE/grid/index.vue.d.ts +3 -3
- package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +95 -0
- package/dist/types/__VUE/imagepreview/index.vue.d.ts +23 -25
- package/dist/types/__VUE/infiniteloading/index.vue.d.ts +6 -6
- package/dist/types/__VUE/input/index.vue.d.ts +2 -2
- package/dist/types/__VUE/menu/index.vue.d.ts +4 -4
- package/dist/types/__VUE/menuitem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +2 -2
- package/dist/types/__VUE/oldpicker/index.vue.d.ts +3 -3
- package/dist/types/__VUE/picker/index.vue.d.ts +3 -3
- package/dist/types/__VUE/popover/index.vue.d.ts +6 -6
- package/dist/types/__VUE/popup/index.vue.d.ts +4 -4
- package/dist/types/__VUE/range/index.vue.d.ts +1 -1
- package/dist/types/__VUE/rate/index.vue.d.ts +2 -2
- package/dist/types/__VUE/searchbar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/shortpassword/index.vue.d.ts +1 -1
- package/dist/types/__VUE/sku/index.vue.d.ts +3 -3
- package/dist/types/__VUE/swipe/index.vue.d.ts +2 -2
- package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tabbar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/textarea/index.vue.d.ts +2 -2
- package/dist/types/__VUE/toast/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -2
|
@@ -1,58 +1,440 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.1 Mon Jun 27 2022 21:39:05 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { ref
|
|
7
|
-
import { c as
|
|
8
|
-
import { _ as
|
|
6
|
+
import { ref, reactive, computed, watch, onMounted, resolveComponent, openBlock, createElementBlock, normalizeClass, Fragment, normalizeStyle, createElementVNode, toDisplayString, createCommentVNode, renderSlot, createVNode, withDirectives, createBlock, vShow, createTextVNode } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
function
|
|
11
|
-
const
|
|
12
|
-
|
|
10
|
+
function trimExtraChar(value, char, regExp) {
|
|
11
|
+
const index2 = value.indexOf(char);
|
|
12
|
+
if (index2 === -1) {
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
if (char === "-" && index2 !== 0) {
|
|
16
|
+
return value.slice(0, index2);
|
|
17
|
+
}
|
|
18
|
+
return value.slice(0, index2 + 1) + value.slice(index2).replace(regExp, "");
|
|
13
19
|
}
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
21
|
+
if (allowDot) {
|
|
22
|
+
value = trimExtraChar(value, ".", /\./g);
|
|
23
|
+
} else {
|
|
24
|
+
value = value.split(".")[0];
|
|
25
|
+
}
|
|
26
|
+
if (allowMinus) {
|
|
27
|
+
value = trimExtraChar(value, "-", /-/g);
|
|
28
|
+
} else {
|
|
29
|
+
value = value.replace(/-/, "");
|
|
30
|
+
}
|
|
31
|
+
const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
|
|
32
|
+
return value.replace(regExp, "");
|
|
18
33
|
}
|
|
19
|
-
const { componentName
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
34
|
+
const { componentName, create, translate } = createComponent("input");
|
|
35
|
+
const _sfc_main = create({
|
|
36
|
+
props: {
|
|
37
|
+
ref: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: ""
|
|
40
|
+
},
|
|
41
|
+
type: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: "text"
|
|
44
|
+
},
|
|
45
|
+
modelValue: {
|
|
46
|
+
type: [String, Number],
|
|
47
|
+
default: ""
|
|
48
|
+
},
|
|
49
|
+
placeholder: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: ""
|
|
52
|
+
},
|
|
53
|
+
label: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: ""
|
|
56
|
+
},
|
|
57
|
+
labelClass: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: ""
|
|
60
|
+
},
|
|
61
|
+
labelWidth: {
|
|
62
|
+
type: [String, Number],
|
|
63
|
+
default: "80"
|
|
64
|
+
},
|
|
65
|
+
labelAlign: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: "left"
|
|
68
|
+
},
|
|
69
|
+
colon: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: false
|
|
72
|
+
},
|
|
73
|
+
inputAlign: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: "left"
|
|
76
|
+
},
|
|
77
|
+
center: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: false
|
|
80
|
+
},
|
|
81
|
+
required: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: false
|
|
84
|
+
},
|
|
85
|
+
disabled: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: false
|
|
88
|
+
},
|
|
89
|
+
readonly: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
default: false
|
|
92
|
+
},
|
|
93
|
+
error: {
|
|
94
|
+
type: Boolean,
|
|
95
|
+
default: false
|
|
96
|
+
},
|
|
97
|
+
maxLength: {
|
|
98
|
+
type: [String, Number],
|
|
99
|
+
default: "9999"
|
|
100
|
+
},
|
|
101
|
+
leftIcon: {
|
|
102
|
+
type: String,
|
|
103
|
+
default: ""
|
|
104
|
+
},
|
|
105
|
+
leftIconSize: {
|
|
106
|
+
type: [String, Number],
|
|
107
|
+
default: ""
|
|
108
|
+
},
|
|
109
|
+
rightIcon: {
|
|
110
|
+
type: String,
|
|
111
|
+
default: ""
|
|
112
|
+
},
|
|
113
|
+
rightIconSize: {
|
|
114
|
+
type: [String, Number],
|
|
115
|
+
default: ""
|
|
116
|
+
},
|
|
117
|
+
clearable: {
|
|
118
|
+
type: Boolean,
|
|
119
|
+
default: false
|
|
120
|
+
},
|
|
121
|
+
clearIcon: {
|
|
122
|
+
type: String,
|
|
123
|
+
default: "mask-close"
|
|
124
|
+
},
|
|
125
|
+
clearSize: {
|
|
126
|
+
type: [String, Number],
|
|
127
|
+
default: "14"
|
|
128
|
+
},
|
|
129
|
+
border: {
|
|
130
|
+
type: Boolean,
|
|
131
|
+
default: true
|
|
132
|
+
},
|
|
133
|
+
formatTrigger: {
|
|
134
|
+
type: String,
|
|
135
|
+
default: "onChange"
|
|
136
|
+
},
|
|
137
|
+
formatter: {
|
|
138
|
+
type: Function,
|
|
139
|
+
default: null
|
|
140
|
+
},
|
|
141
|
+
rules: {
|
|
142
|
+
type: Array,
|
|
143
|
+
default: []
|
|
144
|
+
},
|
|
145
|
+
errorMessage: {
|
|
146
|
+
type: String,
|
|
147
|
+
default: ""
|
|
148
|
+
},
|
|
149
|
+
errorMessageAlign: {
|
|
150
|
+
type: String,
|
|
151
|
+
default: ""
|
|
152
|
+
},
|
|
153
|
+
rows: {
|
|
154
|
+
type: [String, Number],
|
|
155
|
+
default: null
|
|
156
|
+
},
|
|
157
|
+
showWordLimit: {
|
|
158
|
+
type: Boolean,
|
|
159
|
+
default: false
|
|
160
|
+
},
|
|
161
|
+
autofocus: {
|
|
162
|
+
type: Boolean,
|
|
163
|
+
default: false
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
emits: [
|
|
167
|
+
"update:modelValue",
|
|
168
|
+
"change",
|
|
169
|
+
"blur",
|
|
170
|
+
"focus",
|
|
171
|
+
"clear",
|
|
172
|
+
"keypress",
|
|
173
|
+
"click-input",
|
|
174
|
+
"click-left-icon",
|
|
175
|
+
"click-right-icon"
|
|
176
|
+
],
|
|
177
|
+
setup(props, { emit, slots }) {
|
|
178
|
+
const active = ref(false);
|
|
179
|
+
const inputRef = ref();
|
|
180
|
+
ref();
|
|
181
|
+
const getModelValue = () => {
|
|
182
|
+
var _a;
|
|
183
|
+
return String((_a = props.modelValue) != null ? _a : "");
|
|
184
|
+
};
|
|
185
|
+
const state = reactive({
|
|
186
|
+
focused: false,
|
|
187
|
+
validateFailed: false,
|
|
188
|
+
validateMessage: ""
|
|
189
|
+
});
|
|
190
|
+
const classes = computed(() => {
|
|
191
|
+
const prefixCls = componentName;
|
|
192
|
+
return {
|
|
193
|
+
[prefixCls]: true,
|
|
194
|
+
center: props.center,
|
|
195
|
+
[`${prefixCls}-disabled`]: props.disabled,
|
|
196
|
+
[`${prefixCls}-required`]: props.required,
|
|
197
|
+
[`${prefixCls}-error`]: props.error,
|
|
198
|
+
[`${prefixCls}-border`]: props.border
|
|
199
|
+
};
|
|
200
|
+
});
|
|
201
|
+
const styles = computed(() => {
|
|
202
|
+
return {
|
|
203
|
+
textAlign: props.inputAlign
|
|
204
|
+
};
|
|
205
|
+
});
|
|
206
|
+
const stylesTextarea = computed(() => {
|
|
207
|
+
return {
|
|
208
|
+
textAlign: props.inputAlign,
|
|
209
|
+
height: Number(props.rows) * 24 + "px"
|
|
210
|
+
};
|
|
211
|
+
});
|
|
212
|
+
const inputType = (type) => {
|
|
213
|
+
if (type === "number") {
|
|
214
|
+
return "text";
|
|
215
|
+
} else if (type === "digit") {
|
|
216
|
+
return "tel";
|
|
217
|
+
} else {
|
|
218
|
+
return type;
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
const onInput = (event) => {
|
|
222
|
+
const input = event.target;
|
|
223
|
+
let value = input.value;
|
|
224
|
+
if (props.maxLength && value.length > Number(props.maxLength)) {
|
|
225
|
+
value = value.slice(0, Number(props.maxLength));
|
|
226
|
+
}
|
|
227
|
+
updateValue(value);
|
|
228
|
+
};
|
|
229
|
+
const updateValue = (value, trigger = "onChange") => {
|
|
230
|
+
var _a;
|
|
231
|
+
if (props.type === "digit") {
|
|
232
|
+
value = formatNumber(value, false, false);
|
|
233
|
+
}
|
|
234
|
+
if (props.type === "number") {
|
|
235
|
+
value = formatNumber(value, true, true);
|
|
236
|
+
}
|
|
237
|
+
if (props.formatter && trigger === props.formatTrigger) {
|
|
238
|
+
value = props.formatter(value);
|
|
239
|
+
}
|
|
240
|
+
if (((_a = inputRef == null ? void 0 : inputRef.value) == null ? void 0 : _a.value) !== value) {
|
|
241
|
+
inputRef.value.value = value;
|
|
242
|
+
}
|
|
243
|
+
if (value !== props.modelValue) {
|
|
244
|
+
emit("update:modelValue", value);
|
|
245
|
+
emit("change", value);
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
const onFocus = (event) => {
|
|
249
|
+
const input = event.target;
|
|
250
|
+
let value = input.value;
|
|
251
|
+
active.value = true;
|
|
252
|
+
emit("focus", value, event);
|
|
253
|
+
};
|
|
254
|
+
const onBlur = (event) => {
|
|
255
|
+
setTimeout(() => {
|
|
256
|
+
active.value = false;
|
|
257
|
+
}, 200);
|
|
258
|
+
const input = event.target;
|
|
259
|
+
let value = input.value;
|
|
260
|
+
if (props.maxLength && value.length > Number(props.maxLength)) {
|
|
261
|
+
value = value.slice(0, Number(props.maxLength));
|
|
262
|
+
}
|
|
263
|
+
updateValue(getModelValue(), "onBlur");
|
|
264
|
+
emit("blur", value, event);
|
|
265
|
+
};
|
|
266
|
+
const clear = (event) => {
|
|
267
|
+
emit("update:modelValue", "", event);
|
|
268
|
+
emit("change", "", event);
|
|
269
|
+
emit("clear", "", event);
|
|
270
|
+
};
|
|
271
|
+
const resetValidation = () => {
|
|
272
|
+
if (state.validateFailed) {
|
|
273
|
+
state.validateFailed = false;
|
|
274
|
+
state.validateMessage = "";
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
const onClickInput = (event) => {
|
|
278
|
+
emit("click-input", event);
|
|
279
|
+
};
|
|
280
|
+
const onClickLeftIcon = (event) => emit("click-left-icon", event);
|
|
281
|
+
const onClickRightIcon = (event) => emit("click-right-icon", event);
|
|
282
|
+
watch(() => props.modelValue, () => {
|
|
283
|
+
updateValue(getModelValue());
|
|
284
|
+
resetValidation();
|
|
285
|
+
});
|
|
286
|
+
onMounted(() => {
|
|
287
|
+
updateValue(getModelValue(), props.formatTrigger);
|
|
288
|
+
});
|
|
289
|
+
return {
|
|
290
|
+
inputRef,
|
|
291
|
+
active,
|
|
292
|
+
classes,
|
|
293
|
+
styles,
|
|
294
|
+
stylesTextarea,
|
|
295
|
+
inputType,
|
|
296
|
+
onInput,
|
|
297
|
+
onFocus,
|
|
298
|
+
onBlur,
|
|
299
|
+
clear,
|
|
300
|
+
onClickInput,
|
|
301
|
+
onClickLeftIcon,
|
|
302
|
+
onClickRightIcon,
|
|
303
|
+
translate
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
const _hoisted_1 = { class: "label-string" };
|
|
308
|
+
const _hoisted_2 = { class: "nut-input-value" };
|
|
309
|
+
const _hoisted_3 = { class: "label-string" };
|
|
310
|
+
const _hoisted_4 = { class: "nut-input-value" };
|
|
311
|
+
const _hoisted_5 = ["maxlength", "placeholder", "disabled", "readonly", "value", "formatTrigger", "autofocus"];
|
|
312
|
+
const _hoisted_6 = ["type", "maxlength", "placeholder", "disabled", "readonly", "value", "formatTrigger", "autofocus"];
|
|
313
|
+
const _hoisted_7 = {
|
|
314
|
+
key: 0,
|
|
315
|
+
class: "nut-input-word-limit"
|
|
316
|
+
};
|
|
317
|
+
const _hoisted_8 = { class: "nut-input-word-num" };
|
|
318
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
319
|
+
const _component_nut_icon = resolveComponent("nut-icon");
|
|
320
|
+
return openBlock(), createElementBlock("view", {
|
|
321
|
+
class: normalizeClass(_ctx.classes)
|
|
322
|
+
}, [
|
|
323
|
+
_ctx.$slots.input ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
324
|
+
_ctx.label ? (openBlock(), createElementBlock("view", {
|
|
325
|
+
key: 0,
|
|
326
|
+
class: normalizeClass(["nut-input-label", _ctx.labelClass]),
|
|
327
|
+
style: normalizeStyle({
|
|
328
|
+
width: `${_ctx.labelWidth}px`,
|
|
329
|
+
textAlign: _ctx.labelAlign
|
|
330
|
+
})
|
|
331
|
+
}, [
|
|
332
|
+
createElementVNode("view", _hoisted_1, toDisplayString(_ctx.label) + " " + toDisplayString(_ctx.colon ? ":" : ""), 1)
|
|
333
|
+
], 6)) : createCommentVNode("", true),
|
|
334
|
+
createElementVNode("view", _hoisted_2, [
|
|
335
|
+
createElementVNode("view", {
|
|
336
|
+
class: "nut-input-inner",
|
|
337
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClickInput && _ctx.onClickInput(...args))
|
|
338
|
+
}, [
|
|
339
|
+
renderSlot(_ctx.$slots, "input")
|
|
340
|
+
])
|
|
341
|
+
])
|
|
342
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
343
|
+
_ctx.leftIcon && _ctx.leftIcon.length > 0 ? (openBlock(), createElementBlock("view", {
|
|
344
|
+
key: 0,
|
|
345
|
+
class: "nut-input-left-icon",
|
|
346
|
+
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onClickLeftIcon && _ctx.onClickLeftIcon(...args))
|
|
347
|
+
}, [
|
|
348
|
+
createVNode(_component_nut_icon, {
|
|
349
|
+
name: _ctx.leftIcon,
|
|
350
|
+
size: _ctx.leftIconSize
|
|
351
|
+
}, null, 8, ["name", "size"])
|
|
352
|
+
])) : createCommentVNode("", true),
|
|
353
|
+
_ctx.label ? (openBlock(), createElementBlock("view", {
|
|
354
|
+
key: 1,
|
|
355
|
+
class: normalizeClass(["nut-input-label", _ctx.labelClass]),
|
|
356
|
+
style: normalizeStyle({
|
|
357
|
+
width: `${_ctx.labelWidth}px`,
|
|
358
|
+
textAlign: _ctx.labelAlign
|
|
359
|
+
})
|
|
360
|
+
}, [
|
|
361
|
+
createElementVNode("view", _hoisted_3, toDisplayString(_ctx.label) + " " + toDisplayString(_ctx.colon ? ":" : ""), 1)
|
|
362
|
+
], 6)) : createCommentVNode("", true),
|
|
363
|
+
createElementVNode("view", _hoisted_4, [
|
|
364
|
+
createElementVNode("view", {
|
|
365
|
+
class: "nut-input-inner",
|
|
366
|
+
onClick: _cache[9] || (_cache[9] = (...args) => _ctx.onClickInput && _ctx.onClickInput(...args))
|
|
367
|
+
}, [
|
|
368
|
+
_ctx.type == "textarea" ? (openBlock(), createElementBlock("textarea", {
|
|
369
|
+
key: 0,
|
|
370
|
+
class: "input-text",
|
|
371
|
+
ref: "inputRef",
|
|
372
|
+
style: normalizeStyle(_ctx.stylesTextarea),
|
|
373
|
+
maxlength: _ctx.maxLength,
|
|
374
|
+
placeholder: _ctx.placeholder || _ctx.translate("placeholder"),
|
|
375
|
+
disabled: _ctx.disabled,
|
|
376
|
+
readonly: _ctx.readonly,
|
|
377
|
+
value: _ctx.modelValue,
|
|
378
|
+
formatTrigger: _ctx.formatTrigger,
|
|
379
|
+
autofocus: _ctx.autofocus,
|
|
380
|
+
onInput: _cache[2] || (_cache[2] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
|
|
381
|
+
onFocus: _cache[3] || (_cache[3] = (...args) => _ctx.onFocus && _ctx.onFocus(...args)),
|
|
382
|
+
onBlur: _cache[4] || (_cache[4] = (...args) => _ctx.onBlur && _ctx.onBlur(...args))
|
|
383
|
+
}, null, 44, _hoisted_5)) : (openBlock(), createElementBlock("input", {
|
|
384
|
+
key: 1,
|
|
385
|
+
class: "input-text",
|
|
386
|
+
ref: "inputRef",
|
|
387
|
+
style: normalizeStyle(_ctx.styles),
|
|
388
|
+
type: _ctx.inputType(_ctx.type),
|
|
389
|
+
maxlength: _ctx.maxLength,
|
|
390
|
+
placeholder: _ctx.placeholder || _ctx.translate("placeholder"),
|
|
391
|
+
disabled: _ctx.disabled,
|
|
392
|
+
readonly: _ctx.readonly,
|
|
393
|
+
value: _ctx.modelValue,
|
|
394
|
+
formatTrigger: _ctx.formatTrigger,
|
|
395
|
+
autofocus: _ctx.autofocus,
|
|
396
|
+
onInput: _cache[5] || (_cache[5] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
|
|
397
|
+
onFocus: _cache[6] || (_cache[6] = (...args) => _ctx.onFocus && _ctx.onFocus(...args)),
|
|
398
|
+
onBlur: _cache[7] || (_cache[7] = (...args) => _ctx.onBlur && _ctx.onBlur(...args))
|
|
399
|
+
}, null, 44, _hoisted_6)),
|
|
400
|
+
_ctx.clearable && !_ctx.readonly ? withDirectives((openBlock(), createBlock(_component_nut_icon, {
|
|
401
|
+
key: 2,
|
|
402
|
+
class: "nut-input-clear",
|
|
403
|
+
name: _ctx.clearIcon,
|
|
404
|
+
size: _ctx.clearSize,
|
|
405
|
+
onClick: _ctx.clear
|
|
406
|
+
}, null, 8, ["name", "size", "onClick"])), [
|
|
407
|
+
[vShow, _ctx.active && _ctx.modelValue.length > 0]
|
|
408
|
+
]) : createCommentVNode("", true),
|
|
409
|
+
_ctx.rightIcon && _ctx.rightIcon.length > 0 ? (openBlock(), createElementBlock("view", {
|
|
410
|
+
key: 3,
|
|
411
|
+
class: "nut-input-right-icon",
|
|
412
|
+
onClick: _cache[8] || (_cache[8] = (...args) => _ctx.onClickRightIcon && _ctx.onClickRightIcon(...args))
|
|
413
|
+
}, [
|
|
414
|
+
createVNode(_component_nut_icon, {
|
|
415
|
+
name: _ctx.rightIcon,
|
|
416
|
+
size: _ctx.rightIconSize
|
|
417
|
+
}, null, 8, ["name", "size"])
|
|
418
|
+
])) : createCommentVNode("", true),
|
|
419
|
+
_ctx.$slots.button ? renderSlot(_ctx.$slots, "button", {
|
|
420
|
+
key: 4,
|
|
421
|
+
class: "nut-input-button"
|
|
422
|
+
}) : createCommentVNode("", true)
|
|
423
|
+
]),
|
|
424
|
+
_ctx.showWordLimit && _ctx.maxLength ? (openBlock(), createElementBlock("view", _hoisted_7, [
|
|
425
|
+
createElementVNode("span", _hoisted_8, toDisplayString(_ctx.modelValue ? _ctx.modelValue.length : 0), 1),
|
|
426
|
+
createTextVNode("/" + toDisplayString(_ctx.maxLength), 1)
|
|
427
|
+
])) : createCommentVNode("", true),
|
|
428
|
+
_ctx.errorMessage ? (openBlock(), createElementBlock("view", {
|
|
429
|
+
key: 1,
|
|
430
|
+
class: "nut-input-error-message",
|
|
431
|
+
style: normalizeStyle({
|
|
432
|
+
textAlign: _ctx.errorMessageAlign
|
|
433
|
+
})
|
|
434
|
+
}, toDisplayString(_ctx.errorMessage), 5)) : createCommentVNode("", true)
|
|
435
|
+
])
|
|
436
|
+
], 64))
|
|
437
|
+
], 2);
|
|
438
|
+
}
|
|
439
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
440
|
+
export { index as default };
|