@nutui/nutui 3.1.17-beta.0 → 3.1.18
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 +78 -0
- package/LICENSE +1 -1
- package/README.md +7 -1
- package/dist/nutui.d.ts +3 -1
- package/dist/nutui.es.js +2335 -1280
- package/dist/nutui.umd.js +2350 -1293
- package/dist/packages/_es/ActionSheet.js +8 -3
- package/dist/packages/_es/Address.js +17 -11
- package/dist/packages/_es/Audio.js +2 -2
- package/dist/packages/_es/Avatar.js +2 -2
- package/dist/packages/_es/BackTop.js +7 -4
- package/dist/packages/_es/Badge.js +2 -2
- package/dist/packages/_es/Barrage.js +2 -2
- package/dist/packages/_es/Button.js +2 -2
- package/dist/packages/_es/Calendar.js +15 -16
- package/dist/packages/_es/Card.js +2 -2
- package/dist/packages/_es/Cascader.js +2 -2
- package/dist/packages/_es/Cell.js +25 -18
- package/dist/packages/_es/CellGroup.js +2 -2
- package/dist/packages/_es/Checkbox.js +4 -4
- package/dist/packages/_es/CheckboxGroup.js +4 -4
- package/dist/packages/_es/CircleProgress.js +2 -2
- package/dist/packages/_es/Col.js +2 -2
- package/dist/packages/_es/Collapse.js +2 -2
- package/dist/packages/_es/CollapseItem.js +31 -19
- package/dist/packages/_es/CountDown.js +4 -2
- package/dist/packages/_es/CountUp.js +25 -16
- package/dist/packages/_es/DatePicker.js +83 -47
- package/dist/packages/_es/Dialog.js +5 -3
- package/dist/packages/_es/Divider.js +2 -2
- package/dist/packages/_es/Drag.js +4 -4
- package/dist/packages/_es/Elevator.js +3 -3
- package/dist/packages/_es/Empty.js +2 -2
- package/dist/packages/_es/FixedNav.js +2 -2
- package/dist/packages/_es/Form.js +8 -6
- package/dist/packages/_es/FormItem.js +9 -6
- package/dist/packages/_es/Grid.js +2 -2
- package/dist/packages/_es/GridItem.js +3 -3
- package/dist/packages/_es/Icon.js +2 -2
- package/dist/packages/_es/ImagePreview.js +9 -4
- package/dist/packages/_es/Indicator.js +2 -2
- package/dist/packages/_es/InfiniteLoading.js +2 -2
- package/dist/packages/_es/Input.js +290 -66
- package/dist/packages/_es/InputNumber.js +2 -2
- package/dist/packages/_es/Layout.js +2 -2
- package/dist/packages/_es/List.js +124 -0
- package/dist/packages/_es/Menu.js +3 -3
- package/dist/packages/_es/MenuItem.js +2 -2
- package/dist/packages/_es/Navbar.js +31 -66
- package/dist/packages/_es/NoticeBar.js +41 -22
- package/dist/packages/_es/Notify.js +7 -3
- package/dist/packages/_es/NumberKeyboard.js +9 -4
- package/dist/packages/_es/OverLay.js +2 -2
- package/dist/packages/_es/Pagination.js +2 -2
- package/dist/packages/_es/Picker.js +163 -156
- package/dist/packages/_es/Popover.js +5 -2
- package/dist/packages/_es/Popup.js +2 -2
- package/dist/packages/_es/Price.js +2 -2
- package/dist/packages/_es/Progress.js +14 -22
- package/dist/packages/_es/Radio.js +3 -3
- package/dist/packages/_es/RadioGroup.js +2 -2
- package/dist/packages/_es/Range.js +131 -21
- package/dist/packages/_es/Rate.js +2 -2
- package/dist/packages/_es/Row.js +2 -2
- package/dist/packages/_es/SearchBar.js +2 -2
- package/dist/packages/_es/ShortPassword.js +9 -4
- package/dist/packages/_es/SideNavBar.js +2 -2
- package/dist/packages/_es/SideNavBarItem.js +2 -2
- package/dist/packages/_es/Signature.js +25 -6
- package/dist/packages/_es/Skeleton.js +2 -2
- package/dist/packages/_es/Sku.js +31 -13
- package/dist/packages/_es/Step.js +28 -12
- package/dist/packages/_es/Steps.js +8 -3
- package/dist/packages/_es/Sticky.js +3 -3
- package/dist/packages/_es/SubSideNavBar.js +2 -2
- package/dist/packages/_es/Swipe.js +3 -3
- package/dist/packages/_es/Swiper.js +3 -3
- package/dist/packages/_es/SwiperItem.js +3 -3
- package/dist/packages/_es/Switch.js +2 -2
- package/dist/packages/_es/TabPane.js +2 -2
- package/dist/packages/_es/Tabbar.js +2 -2
- package/dist/packages/_es/TabbarItem.js +23 -8
- package/dist/packages/_es/Table.js +2 -2
- package/dist/packages/_es/Tabs.js +8 -5
- package/dist/packages/_es/Tag.js +11 -5
- package/dist/packages/_es/TextArea.js +38 -6
- package/dist/packages/_es/TimeDetail.js +2 -2
- package/dist/packages/_es/TimePannel.js +2 -2
- package/dist/packages/_es/TimeSelect.js +8 -3
- package/dist/packages/_es/Toast.js +16 -9
- package/dist/packages/_es/Uploader.js +2 -4
- package/dist/packages/_es/Video.js +12 -8
- package/dist/packages/_es/common.js +2 -2
- package/dist/packages/_es/component.js +2 -2
- package/dist/packages/_es/index.js +6 -8
- package/dist/packages/_es/index2.js +9 -32
- package/dist/packages/_es/index3.js +29 -57
- package/dist/packages/_es/index4.js +64 -0
- package/dist/packages/_es/plugin-vue_export-helper.js +2 -2
- package/dist/packages/_es/pxCheck.js +2 -2
- package/dist/packages/_es/raf.js +2 -2
- package/dist/packages/_es/util.js +2 -2
- package/dist/packages/actionsheet/index.scss +7 -6
- package/dist/packages/badge/index.scss +11 -13
- package/dist/packages/button/index.scss +6 -5
- package/dist/packages/calendar/index.scss +9 -4
- package/dist/packages/calendaritem/index.scss +0 -207
- package/dist/packages/cell/index.scss +9 -9
- package/dist/packages/cellgroup/index.scss +1 -1
- package/dist/packages/checkbox/index.scss +4 -3
- package/dist/packages/collapseitem/index.scss +21 -11
- package/dist/packages/countdown/index.scss +3 -1
- package/dist/packages/divider/index.scss +8 -8
- package/dist/packages/elevator/index.scss +36 -36
- package/dist/packages/formitem/index.scss +15 -8
- package/dist/packages/indicator/index.scss +1 -1
- package/dist/packages/input/index.scss +70 -24
- package/dist/packages/inputnumber/index.scss +4 -2
- package/dist/packages/list/index.scss +24 -0
- package/dist/packages/menu/index.scss +3 -3
- package/dist/packages/navbar/index.scss +30 -8
- package/dist/packages/noticebar/index.scss +10 -5
- package/dist/packages/notify/index.scss +10 -0
- package/dist/packages/numberkeyboard/index.scss +22 -21
- package/dist/packages/oldpicker/index.scss +131 -0
- package/dist/packages/picker/index.scss +38 -32
- package/dist/packages/progress/index.scss +24 -19
- package/dist/packages/radio/index.scss +7 -6
- package/dist/packages/range/index.scss +113 -6
- package/dist/packages/searchbar/index.scss +7 -7
- package/dist/packages/sidenavbaritem/index.scss +5 -5
- package/dist/packages/step/index.scss +29 -29
- package/dist/packages/subsidenavbar/index.scss +10 -8
- package/dist/packages/swiper/index.scss +4 -4
- package/dist/packages/switch/index.scss +8 -8
- package/dist/packages/tabbar/index.scss +3 -2
- package/dist/packages/tabbaritem/index.scss +19 -3
- package/dist/packages/tabs/index.scss +1 -0
- package/dist/packages/timedetail/index.scss +13 -13
- package/dist/packages/timepannel/index.scss +7 -7
- package/dist/packages/timeselect/index.scss +3 -3
- package/dist/packages/toast/index.scss +8 -7
- package/dist/packages/uploader/index.scss +4 -4
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +43 -41
- package/dist/styles/themes/jdt.scss +91 -0
- package/dist/styles/variables-jdt.scss +727 -0
- package/dist/styles/variables.scss +322 -38
- package/package.json +3 -2
- package/dist/styles/themes/jdd.scss +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
3
|
-
* (c)
|
|
2
|
+
* @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { toRefs, computed, openBlock, createElementBlock, normalizeClass, Fragment, renderList, toDisplayString } from "vue";
|
|
@@ -18,8 +18,8 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
22
|
-
* (c)
|
|
21
|
+
* @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
|
|
22
|
+
* (c) 2022 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
25
25
|
import { reactive, computed, onMounted, onUnmounted, ref, onActivated, onDeactivated, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, createVNode, toDisplayString, renderSlot, createCommentVNode } from "vue";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
3
|
-
* (c)
|
|
2
|
+
* @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { ref, computed, resolveComponent, openBlock, createElementBlock, normalizeClass,
|
|
6
|
+
import { ref, reactive, computed, watch, onMounted, resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, createCommentVNode, normalizeStyle, createElementVNode, toDisplayString, withDirectives, createBlock, vShow, renderSlot, createTextVNode } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
8
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
function trimExtraChar(value, char, regExp) {
|
|
@@ -20,7 +20,7 @@ function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
|
20
20
|
if (allowDot) {
|
|
21
21
|
value = trimExtraChar(value, ".", /\./g);
|
|
22
22
|
} else {
|
|
23
|
-
value = value.
|
|
23
|
+
value = value.split(".")[0];
|
|
24
24
|
}
|
|
25
25
|
if (allowMinus) {
|
|
26
26
|
value = trimExtraChar(value, "-", /-/g);
|
|
@@ -33,6 +33,10 @@ function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
|
33
33
|
const { componentName, create } = createComponent("input");
|
|
34
34
|
const _sfc_main = create({
|
|
35
35
|
props: {
|
|
36
|
+
ref: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: ""
|
|
39
|
+
},
|
|
36
40
|
type: {
|
|
37
41
|
type: String,
|
|
38
42
|
default: "text"
|
|
@@ -49,7 +53,31 @@ const _sfc_main = create({
|
|
|
49
53
|
type: String,
|
|
50
54
|
default: ""
|
|
51
55
|
},
|
|
52
|
-
|
|
56
|
+
labelClass: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: ""
|
|
59
|
+
},
|
|
60
|
+
labelWidth: {
|
|
61
|
+
type: [String, Number],
|
|
62
|
+
default: "80"
|
|
63
|
+
},
|
|
64
|
+
labelAlign: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: "left"
|
|
67
|
+
},
|
|
68
|
+
colon: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: false
|
|
71
|
+
},
|
|
72
|
+
inputAlign: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: "left"
|
|
75
|
+
},
|
|
76
|
+
center: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: false
|
|
79
|
+
},
|
|
80
|
+
required: {
|
|
53
81
|
type: Boolean,
|
|
54
82
|
default: false
|
|
55
83
|
},
|
|
@@ -61,132 +89,328 @@ const _sfc_main = create({
|
|
|
61
89
|
type: Boolean,
|
|
62
90
|
default: false
|
|
63
91
|
},
|
|
64
|
-
|
|
92
|
+
error: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
default: false
|
|
95
|
+
},
|
|
96
|
+
maxNum: {
|
|
97
|
+
type: [String, Number],
|
|
98
|
+
default: ""
|
|
99
|
+
},
|
|
100
|
+
leftIcon: {
|
|
65
101
|
type: String,
|
|
66
|
-
default: "
|
|
102
|
+
default: ""
|
|
103
|
+
},
|
|
104
|
+
leftIconSize: {
|
|
105
|
+
type: [String, Number],
|
|
106
|
+
default: ""
|
|
67
107
|
},
|
|
68
|
-
|
|
108
|
+
rightIcon: {
|
|
109
|
+
type: String,
|
|
110
|
+
default: ""
|
|
111
|
+
},
|
|
112
|
+
rightIconSize: {
|
|
69
113
|
type: [String, Number],
|
|
70
114
|
default: ""
|
|
71
115
|
},
|
|
72
116
|
clearable: {
|
|
117
|
+
type: Boolean,
|
|
118
|
+
default: false
|
|
119
|
+
},
|
|
120
|
+
clearIcon: {
|
|
121
|
+
type: String,
|
|
122
|
+
default: "mask-close"
|
|
123
|
+
},
|
|
124
|
+
clearSize: {
|
|
125
|
+
type: [String, Number],
|
|
126
|
+
default: "14"
|
|
127
|
+
},
|
|
128
|
+
border: {
|
|
73
129
|
type: Boolean,
|
|
74
130
|
default: true
|
|
75
131
|
},
|
|
76
|
-
|
|
132
|
+
formatTrigger: {
|
|
133
|
+
type: String,
|
|
134
|
+
default: "onChange"
|
|
135
|
+
},
|
|
136
|
+
formatter: {
|
|
137
|
+
type: Function,
|
|
138
|
+
default: null
|
|
139
|
+
},
|
|
140
|
+
rules: {
|
|
141
|
+
type: Array,
|
|
142
|
+
default: []
|
|
143
|
+
},
|
|
144
|
+
errorMessage: {
|
|
145
|
+
type: String,
|
|
146
|
+
default: ""
|
|
147
|
+
},
|
|
148
|
+
errorMessageAlign: {
|
|
149
|
+
type: String,
|
|
150
|
+
default: ""
|
|
151
|
+
},
|
|
152
|
+
rows: {
|
|
153
|
+
type: [String, Number],
|
|
154
|
+
default: null
|
|
155
|
+
},
|
|
156
|
+
showWordLimit: {
|
|
77
157
|
type: Boolean,
|
|
78
158
|
default: true
|
|
159
|
+
},
|
|
160
|
+
autofocus: {
|
|
161
|
+
type: Boolean,
|
|
162
|
+
default: false
|
|
79
163
|
}
|
|
80
164
|
},
|
|
81
|
-
emits: [
|
|
82
|
-
|
|
165
|
+
emits: [
|
|
166
|
+
"update:modelValue",
|
|
167
|
+
"change",
|
|
168
|
+
"blur",
|
|
169
|
+
"focus",
|
|
170
|
+
"clear",
|
|
171
|
+
"keypress",
|
|
172
|
+
"click-input",
|
|
173
|
+
"click-left-icon",
|
|
174
|
+
"click-right-icon"
|
|
175
|
+
],
|
|
176
|
+
setup(props, { emit, slots }) {
|
|
83
177
|
const active = ref(false);
|
|
178
|
+
const inputRef = ref();
|
|
179
|
+
const customValue = ref();
|
|
180
|
+
const getModelValue = () => {
|
|
181
|
+
var _a;
|
|
182
|
+
return String((_a = props.modelValue) != null ? _a : "");
|
|
183
|
+
};
|
|
184
|
+
const state = reactive({
|
|
185
|
+
focused: false,
|
|
186
|
+
validateFailed: false,
|
|
187
|
+
validateMessage: ""
|
|
188
|
+
});
|
|
84
189
|
const classes = computed(() => {
|
|
85
190
|
const prefixCls = componentName;
|
|
86
191
|
return {
|
|
87
192
|
[prefixCls]: true,
|
|
193
|
+
center: props.center,
|
|
88
194
|
[`${prefixCls}-disabled`]: props.disabled,
|
|
89
|
-
[`${prefixCls}-
|
|
90
|
-
[`${prefixCls}-
|
|
195
|
+
[`${prefixCls}-required`]: props.required,
|
|
196
|
+
[`${prefixCls}-error`]: props.error,
|
|
197
|
+
[`${prefixCls}-border`]: props.border
|
|
91
198
|
};
|
|
92
199
|
});
|
|
93
|
-
const inputmode = computed(() => {
|
|
94
|
-
return props.type === "digit" ? "decimal" : props.type === "number" ? "numeric" : "text";
|
|
95
|
-
});
|
|
96
200
|
const styles = computed(() => {
|
|
97
201
|
return {
|
|
98
|
-
textAlign: props.
|
|
202
|
+
textAlign: props.inputAlign
|
|
203
|
+
};
|
|
204
|
+
});
|
|
205
|
+
const stylesTextarea = computed(() => {
|
|
206
|
+
return {
|
|
207
|
+
textAlign: props.inputAlign,
|
|
208
|
+
height: Number(props.rows) * 24 + "px"
|
|
99
209
|
};
|
|
100
210
|
});
|
|
101
|
-
const
|
|
211
|
+
const inputType = (type) => {
|
|
212
|
+
if (type === "number") {
|
|
213
|
+
return "text";
|
|
214
|
+
} else if (type === "digit") {
|
|
215
|
+
return "tel";
|
|
216
|
+
} else {
|
|
217
|
+
return type;
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
computed(() => {
|
|
221
|
+
if (customValue.value && slots.input) {
|
|
222
|
+
return customValue.value();
|
|
223
|
+
}
|
|
224
|
+
return props.modelValue;
|
|
225
|
+
});
|
|
226
|
+
const onInput = (event) => {
|
|
102
227
|
const input = event.target;
|
|
103
|
-
let
|
|
228
|
+
let value = input.value;
|
|
229
|
+
updateValue(value);
|
|
230
|
+
};
|
|
231
|
+
const updateValue = (value, trigger = "onChange") => {
|
|
104
232
|
if (props.type === "digit") {
|
|
105
|
-
|
|
233
|
+
value = formatNumber(value, false, false);
|
|
106
234
|
}
|
|
107
235
|
if (props.type === "number") {
|
|
108
|
-
|
|
236
|
+
value = formatNumber(value, true, true);
|
|
237
|
+
}
|
|
238
|
+
if (props.formatter && trigger === props.formatTrigger) {
|
|
239
|
+
value = props.formatter(value);
|
|
240
|
+
}
|
|
241
|
+
if (inputRef.value && inputRef.value.value !== value) {
|
|
242
|
+
inputRef.value.value = value;
|
|
109
243
|
}
|
|
110
|
-
if (
|
|
111
|
-
|
|
244
|
+
if (value !== props.modelValue) {
|
|
245
|
+
emit("update:modelValue", value);
|
|
246
|
+
emit("change", value);
|
|
112
247
|
}
|
|
113
|
-
emit("update:modelValue", val, event);
|
|
114
|
-
emit("change", val, event);
|
|
115
248
|
};
|
|
116
|
-
const
|
|
249
|
+
const onFocus = (event) => {
|
|
117
250
|
const input = event.target;
|
|
118
251
|
let value = input.value;
|
|
119
252
|
active.value = true;
|
|
120
253
|
emit("focus", value, event);
|
|
121
254
|
};
|
|
122
|
-
const
|
|
255
|
+
const onBlur = (event) => {
|
|
123
256
|
setTimeout(() => {
|
|
124
257
|
active.value = false;
|
|
125
258
|
}, 200);
|
|
126
259
|
const input = event.target;
|
|
127
260
|
let value = input.value;
|
|
128
|
-
if (props.
|
|
129
|
-
value = value.slice(0, Number(props.
|
|
261
|
+
if (props.maxNum && value.length > Number(props.maxNum)) {
|
|
262
|
+
value = value.slice(0, Number(props.maxNum));
|
|
130
263
|
}
|
|
264
|
+
updateValue(getModelValue(), "onBlur");
|
|
131
265
|
emit("blur", value, event);
|
|
132
266
|
};
|
|
133
|
-
const
|
|
267
|
+
const clear = (event) => {
|
|
134
268
|
emit("update:modelValue", "", event);
|
|
135
269
|
emit("change", "", event);
|
|
136
|
-
emit("clear", "");
|
|
270
|
+
emit("clear", "", event);
|
|
137
271
|
};
|
|
272
|
+
const resetValidation = () => {
|
|
273
|
+
if (state.validateFailed) {
|
|
274
|
+
state.validateFailed = false;
|
|
275
|
+
state.validateMessage = "";
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
const onClickInput = (event) => {
|
|
279
|
+
emit("click-input", event);
|
|
280
|
+
};
|
|
281
|
+
const onClickLeftIcon = (event) => emit("click-left-icon", event);
|
|
282
|
+
const onClickRightIcon = (event) => emit("click-right-icon", event);
|
|
283
|
+
watch(() => props.modelValue, () => {
|
|
284
|
+
updateValue(getModelValue());
|
|
285
|
+
resetValidation();
|
|
286
|
+
});
|
|
287
|
+
onMounted(() => {
|
|
288
|
+
updateValue(getModelValue(), props.formatTrigger);
|
|
289
|
+
});
|
|
138
290
|
return {
|
|
291
|
+
inputRef,
|
|
139
292
|
active,
|
|
140
293
|
classes,
|
|
141
294
|
styles,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
295
|
+
stylesTextarea,
|
|
296
|
+
inputType,
|
|
297
|
+
onInput,
|
|
298
|
+
onFocus,
|
|
299
|
+
onBlur,
|
|
300
|
+
clear,
|
|
301
|
+
onClickInput,
|
|
302
|
+
onClickLeftIcon,
|
|
303
|
+
onClickRightIcon
|
|
147
304
|
};
|
|
148
305
|
}
|
|
149
306
|
});
|
|
150
|
-
const _hoisted_1 = {
|
|
307
|
+
const _hoisted_1 = { class: "label-string" };
|
|
308
|
+
const _hoisted_2 = { class: "nut-input-value" };
|
|
309
|
+
const _hoisted_3 = ["maxlength", "placeholder", "disabled", "readonly", "value", "formatTrigger", "autofocus"];
|
|
310
|
+
const _hoisted_4 = ["type", "maxNum", "placeholder", "disabled", "readonly", "value", "formatTrigger", "autofocus"];
|
|
311
|
+
const _hoisted_5 = {
|
|
151
312
|
key: 0,
|
|
152
|
-
class: "nut-input-
|
|
313
|
+
class: "nut-input-word-limit"
|
|
153
314
|
};
|
|
154
|
-
const
|
|
155
|
-
const _hoisted_3 = ["type", "maxlength", "placeholder", "disabled", "readonly", "value", "inputmode"];
|
|
315
|
+
const _hoisted_6 = { class: "nut-input-word-num" };
|
|
156
316
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
157
317
|
const _component_nut_icon = resolveComponent("nut-icon");
|
|
158
318
|
return openBlock(), createElementBlock("view", {
|
|
159
319
|
class: normalizeClass(_ctx.classes)
|
|
160
320
|
}, [
|
|
161
|
-
_ctx.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
class: "input-text",
|
|
166
|
-
style: normalizeStyle(_ctx.styles),
|
|
167
|
-
type: _ctx.type,
|
|
168
|
-
maxlength: _ctx.maxLength,
|
|
169
|
-
placeholder: _ctx.placeholder,
|
|
170
|
-
disabled: _ctx.disabled,
|
|
171
|
-
readonly: _ctx.readonly,
|
|
172
|
-
value: _ctx.modelValue,
|
|
173
|
-
inputmode: _ctx.inputmode,
|
|
174
|
-
onInput: _cache[0] || (_cache[0] = (...args) => _ctx.valueChange && _ctx.valueChange(...args)),
|
|
175
|
-
onFocus: _cache[1] || (_cache[1] = (...args) => _ctx.valueFocus && _ctx.valueFocus(...args)),
|
|
176
|
-
onBlur: _cache[2] || (_cache[2] = (...args) => _ctx.valueBlur && _ctx.valueBlur(...args))
|
|
177
|
-
}, null, 44, _hoisted_3),
|
|
178
|
-
_ctx.clearable && !_ctx.readonly ? withDirectives((openBlock(), createElementBlock("view", {
|
|
179
|
-
key: 1,
|
|
180
|
-
onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleClear && _ctx.handleClear(...args)),
|
|
181
|
-
class: "nut-textinput-clear"
|
|
321
|
+
_ctx.leftIcon && _ctx.leftIcon.length > 0 ? (openBlock(), createElementBlock("view", {
|
|
322
|
+
key: 0,
|
|
323
|
+
class: "nut-input-left-icon",
|
|
324
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClickLeftIcon && _ctx.onClickLeftIcon(...args))
|
|
182
325
|
}, [
|
|
183
326
|
createVNode(_component_nut_icon, {
|
|
184
|
-
name:
|
|
185
|
-
size:
|
|
327
|
+
name: _ctx.leftIcon,
|
|
328
|
+
size: _ctx.leftIconSize
|
|
329
|
+
}, null, 8, ["name", "size"])
|
|
330
|
+
])) : createCommentVNode("", true),
|
|
331
|
+
_ctx.label ? (openBlock(), createElementBlock("view", {
|
|
332
|
+
key: 1,
|
|
333
|
+
class: normalizeClass(["nut-input-label", _ctx.labelClass]),
|
|
334
|
+
style: normalizeStyle({
|
|
335
|
+
width: `${_ctx.labelWidth}px`,
|
|
336
|
+
textAlign: _ctx.labelAlign
|
|
186
337
|
})
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
]) : createCommentVNode("", true)
|
|
338
|
+
}, [
|
|
339
|
+
createElementVNode("view", _hoisted_1, toDisplayString(_ctx.label) + " " + toDisplayString(_ctx.colon ? ":" : ""), 1)
|
|
340
|
+
], 6)) : createCommentVNode("", true),
|
|
341
|
+
createElementVNode("view", _hoisted_2, [
|
|
342
|
+
createElementVNode("view", {
|
|
343
|
+
class: "nut-input-inner",
|
|
344
|
+
onClick: _cache[8] || (_cache[8] = (...args) => _ctx.onClickInput && _ctx.onClickInput(...args))
|
|
345
|
+
}, [
|
|
346
|
+
_ctx.type == "textarea" ? (openBlock(), createElementBlock("textarea", {
|
|
347
|
+
key: 0,
|
|
348
|
+
class: "input-text",
|
|
349
|
+
ref: "inputRef",
|
|
350
|
+
style: normalizeStyle(_ctx.stylesTextarea),
|
|
351
|
+
maxlength: _ctx.maxLength,
|
|
352
|
+
placeholder: _ctx.placeholder,
|
|
353
|
+
disabled: _ctx.disabled,
|
|
354
|
+
readonly: _ctx.readonly,
|
|
355
|
+
value: _ctx.modelValue,
|
|
356
|
+
formatTrigger: _ctx.formatTrigger,
|
|
357
|
+
autofocus: _ctx.autofocus,
|
|
358
|
+
onInput: _cache[1] || (_cache[1] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
|
|
359
|
+
onFocus: _cache[2] || (_cache[2] = (...args) => _ctx.onFocus && _ctx.onFocus(...args)),
|
|
360
|
+
onBlur: _cache[3] || (_cache[3] = (...args) => _ctx.onBlur && _ctx.onBlur(...args))
|
|
361
|
+
}, null, 44, _hoisted_3)) : (openBlock(), createElementBlock("input", {
|
|
362
|
+
key: 1,
|
|
363
|
+
class: "input-text",
|
|
364
|
+
ref: "inputRef",
|
|
365
|
+
style: normalizeStyle(_ctx.styles),
|
|
366
|
+
type: _ctx.inputType(_ctx.type),
|
|
367
|
+
maxNum: _ctx.maxNum,
|
|
368
|
+
placeholder: _ctx.placeholder,
|
|
369
|
+
disabled: _ctx.disabled,
|
|
370
|
+
readonly: _ctx.readonly,
|
|
371
|
+
value: _ctx.modelValue,
|
|
372
|
+
formatTrigger: _ctx.formatTrigger,
|
|
373
|
+
autofocus: _ctx.autofocus,
|
|
374
|
+
onInput: _cache[4] || (_cache[4] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
|
|
375
|
+
onFocus: _cache[5] || (_cache[5] = (...args) => _ctx.onFocus && _ctx.onFocus(...args)),
|
|
376
|
+
onBlur: _cache[6] || (_cache[6] = (...args) => _ctx.onBlur && _ctx.onBlur(...args))
|
|
377
|
+
}, null, 44, _hoisted_4)),
|
|
378
|
+
_ctx.clearable && !_ctx.readonly ? withDirectives((openBlock(), createBlock(_component_nut_icon, {
|
|
379
|
+
key: 2,
|
|
380
|
+
class: "nut-input-clear",
|
|
381
|
+
name: _ctx.clearIcon,
|
|
382
|
+
size: _ctx.clearSize,
|
|
383
|
+
onClick: _ctx.clear
|
|
384
|
+
}, null, 8, ["name", "size", "onClick"])), [
|
|
385
|
+
[vShow, _ctx.active && _ctx.modelValue.length > 0]
|
|
386
|
+
]) : createCommentVNode("", true),
|
|
387
|
+
_ctx.rightIcon && _ctx.rightIcon.length > 0 ? (openBlock(), createElementBlock("view", {
|
|
388
|
+
key: 3,
|
|
389
|
+
class: "nut-input-right-icon",
|
|
390
|
+
onClick: _cache[7] || (_cache[7] = (...args) => _ctx.onClickRightIcon && _ctx.onClickRightIcon(...args))
|
|
391
|
+
}, [
|
|
392
|
+
createVNode(_component_nut_icon, {
|
|
393
|
+
name: _ctx.rightIcon,
|
|
394
|
+
size: _ctx.rightIconSize
|
|
395
|
+
}, null, 8, ["name", "size"])
|
|
396
|
+
])) : createCommentVNode("", true),
|
|
397
|
+
_ctx.$slots.button ? renderSlot(_ctx.$slots, "button", {
|
|
398
|
+
key: 4,
|
|
399
|
+
class: "nut-input-button"
|
|
400
|
+
}) : createCommentVNode("", true)
|
|
401
|
+
]),
|
|
402
|
+
_ctx.showWordLimit && _ctx.maxNum ? (openBlock(), createElementBlock("view", _hoisted_5, [
|
|
403
|
+
createElementVNode("span", _hoisted_6, toDisplayString(_ctx.modelValue ? _ctx.modelValue.length : 0), 1),
|
|
404
|
+
createTextVNode("/" + toDisplayString(_ctx.maxNum), 1)
|
|
405
|
+
])) : createCommentVNode("", true),
|
|
406
|
+
_ctx.errorMessage ? (openBlock(), createElementBlock("view", {
|
|
407
|
+
key: 1,
|
|
408
|
+
class: "nut-input-error-message",
|
|
409
|
+
style: normalizeStyle({
|
|
410
|
+
textAlign: _ctx.errorMessageAlign
|
|
411
|
+
})
|
|
412
|
+
}, toDisplayString(_ctx.errorMessage), 5)) : createCommentVNode("", true)
|
|
413
|
+
])
|
|
190
414
|
], 2);
|
|
191
415
|
}
|
|
192
416
|
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
3
|
-
* (c)
|
|
2
|
+
* @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode, createElementVNode } from "vue";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
3
|
-
* (c)
|
|
2
|
+
* @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { c as createComponent } from "./component.js";
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
/*!
|
|
21
|
+
* @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
|
|
22
|
+
* (c) 2022 @jdf2e.
|
|
23
|
+
* Released under the MIT License.
|
|
24
|
+
*/
|
|
25
|
+
import { ref, reactive, computed, watch, toRefs, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, Fragment, renderList, renderSlot } from "vue";
|
|
26
|
+
import { c as createComponent } from "./component.js";
|
|
27
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
28
|
+
const { componentName, create } = createComponent("list");
|
|
29
|
+
const _sfc_main = create({
|
|
30
|
+
props: {
|
|
31
|
+
height: {
|
|
32
|
+
type: [Number],
|
|
33
|
+
default: 50
|
|
34
|
+
},
|
|
35
|
+
listData: {
|
|
36
|
+
type: Array,
|
|
37
|
+
default: () => {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
emits: ["scroll"],
|
|
43
|
+
setup(props, { emit }) {
|
|
44
|
+
const list = ref(null);
|
|
45
|
+
const state = reactive({
|
|
46
|
+
screenHeight: document.documentElement.clientHeight || document.body.clientHeight || 667,
|
|
47
|
+
startOffset: 0,
|
|
48
|
+
start: 0,
|
|
49
|
+
list: props.listData.slice()
|
|
50
|
+
});
|
|
51
|
+
const visibleCount = computed(() => {
|
|
52
|
+
return Math.ceil(state.screenHeight / props.height);
|
|
53
|
+
});
|
|
54
|
+
const end = computed(() => {
|
|
55
|
+
return state.start + visibleCount.value;
|
|
56
|
+
});
|
|
57
|
+
const getTransform = computed(() => {
|
|
58
|
+
return `translate3d(0, ${state.startOffset}px, 0)`;
|
|
59
|
+
});
|
|
60
|
+
const classes = computed(() => {
|
|
61
|
+
const prefixCls = componentName;
|
|
62
|
+
return {
|
|
63
|
+
[prefixCls]: true
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
const listHeight = computed(() => {
|
|
67
|
+
return state.list.length * props.height;
|
|
68
|
+
});
|
|
69
|
+
const visibleData = computed(() => {
|
|
70
|
+
return state.list.slice(state.start, Math.min(end.value, state.list.length));
|
|
71
|
+
});
|
|
72
|
+
const handleScrollEvent = () => {
|
|
73
|
+
var _a;
|
|
74
|
+
const scrollTop = (_a = list.value) == null ? void 0 : _a.scrollTop;
|
|
75
|
+
state.start = Math.floor(scrollTop / props.height);
|
|
76
|
+
if (end.value > state.list.length) {
|
|
77
|
+
emit("scroll");
|
|
78
|
+
}
|
|
79
|
+
state.startOffset = scrollTop - scrollTop % props.height;
|
|
80
|
+
};
|
|
81
|
+
watch(() => props.listData, () => {
|
|
82
|
+
state.list = props.listData.slice();
|
|
83
|
+
});
|
|
84
|
+
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
|
85
|
+
list,
|
|
86
|
+
getTransform,
|
|
87
|
+
listHeight,
|
|
88
|
+
visibleData,
|
|
89
|
+
classes,
|
|
90
|
+
handleScrollEvent
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
95
|
+
return openBlock(), createElementBlock("view", {
|
|
96
|
+
class: normalizeClass(_ctx.classes),
|
|
97
|
+
onScrollPassive: _cache[0] || (_cache[0] = (...args) => _ctx.handleScrollEvent && _ctx.handleScrollEvent(...args)),
|
|
98
|
+
ref: "list"
|
|
99
|
+
}, [
|
|
100
|
+
createElementVNode("div", {
|
|
101
|
+
class: "nut-list-phantom",
|
|
102
|
+
style: normalizeStyle({ height: _ctx.listHeight + "px" })
|
|
103
|
+
}, null, 4),
|
|
104
|
+
createElementVNode("div", {
|
|
105
|
+
class: "nut-list-container",
|
|
106
|
+
style: normalizeStyle({ transform: _ctx.getTransform })
|
|
107
|
+
}, [
|
|
108
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.visibleData, (item, index2) => {
|
|
109
|
+
return openBlock(), createElementBlock("div", {
|
|
110
|
+
class: "nut-list-item",
|
|
111
|
+
style: normalizeStyle({ height: _ctx.height + "px" }),
|
|
112
|
+
key: item
|
|
113
|
+
}, [
|
|
114
|
+
renderSlot(_ctx.$slots, "default", {
|
|
115
|
+
item,
|
|
116
|
+
index: index2
|
|
117
|
+
})
|
|
118
|
+
], 4);
|
|
119
|
+
}), 128))
|
|
120
|
+
], 4)
|
|
121
|
+
], 34);
|
|
122
|
+
}
|
|
123
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
124
|
+
export { index as default };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
3
|
-
* (c)
|
|
2
|
+
* @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { ref, computed, reactive, provide, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, normalizeStyle, toDisplayString, createVNode, renderSlot } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import { u as useRect } from "./
|
|
8
|
+
import { u as useRect } from "./index3.js";
|
|
9
9
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
10
|
const { componentName, create } = createComponent("menu");
|
|
11
11
|
const _sfc_main = create({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
3
|
-
* (c)
|
|
2
|
+
* @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { reactive, computed, inject, getCurrentInstance, resolveComponent, withDirectives, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, vShow, createVNode, mergeProps, withCtx, Fragment, renderList, createBlock, createCommentVNode, toDisplayString, renderSlot } from "vue";
|