@nutui/nutui 3.1.12-beta.1 → 3.1.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/CHANGELOG.md +27 -0
- package/dist/nutui.d.ts +1 -1
- package/dist/nutui.es.js +3219 -2562
- package/dist/nutui.umd.js +3292 -2565
- package/dist/packages/_es/ActionSheet.js +12 -13
- package/dist/packages/_es/Address.js +49 -63
- package/dist/packages/_es/Avatar.js +5 -4
- package/dist/packages/_es/BackTop.js +109 -72
- package/dist/packages/_es/Badge.js +5 -4
- package/dist/packages/_es/Barrage.js +57 -63
- package/dist/packages/_es/Button.js +6 -5
- package/dist/packages/_es/Calendar.js +18 -27
- package/dist/packages/_es/Card.js +8 -7
- package/dist/packages/_es/Cell.js +13 -5
- package/dist/packages/_es/CellGroup.js +14 -7
- package/dist/packages/_es/Checkbox.js +3 -3
- package/dist/packages/_es/CheckboxGroup.js +4 -9
- package/dist/packages/_es/CircleProgress.js +46 -142
- package/dist/packages/_es/Col.js +5 -4
- package/dist/packages/_es/Collapse.js +10 -35
- package/dist/packages/_es/CollapseItem.js +35 -80
- package/dist/packages/_es/CountDown.js +5 -7
- package/dist/packages/_es/CountUp.js +31 -34
- package/dist/packages/_es/DatePicker.js +219 -451
- package/dist/packages/_es/Dialog.js +98 -46
- package/dist/packages/_es/Divider.js +6 -5
- package/dist/packages/_es/Drag.js +50 -76
- package/dist/packages/_es/Elevator.js +52 -81
- package/dist/packages/_es/FixedNav.js +9 -8
- package/dist/packages/_es/Form.js +6 -5
- package/dist/packages/_es/FormItem.js +5 -4
- package/dist/packages/_es/Icon.js +40 -6
- package/dist/packages/_es/ImagePreview.js +158 -44
- package/dist/packages/_es/InfiniteLoading.js +109 -95
- package/dist/packages/_es/Input.js +21 -22
- package/dist/packages/_es/InputNumber.js +18 -24
- package/dist/packages/_es/Layout.js +2 -2
- package/dist/packages/_es/Menu.js +14 -16
- package/dist/packages/_es/MenuItem.js +11 -9
- package/dist/packages/_es/Navbar.js +7 -7
- package/dist/packages/_es/NoticeBar.js +26 -39
- package/dist/packages/_es/Notify.js +166 -30
- package/dist/packages/_es/NumberKeyboard.js +7 -9
- package/dist/packages/_es/OverLay.js +29 -22
- package/dist/packages/_es/Pagination.js +9 -8
- package/dist/packages/_es/Picker.js +447 -61
- package/dist/packages/_es/Popover.js +34 -161
- package/dist/packages/_es/Popup.js +77 -17
- package/dist/packages/_es/Price.js +7 -18
- package/dist/packages/_es/Progress.js +12 -23
- package/dist/packages/_es/Radio.js +3 -3
- package/dist/packages/_es/RadioGroup.js +2 -2
- package/dist/packages/_es/Range.js +31 -38
- package/dist/packages/_es/Rate.js +35 -17
- package/dist/packages/_es/Row.js +5 -4
- package/dist/packages/_es/SearchBar.js +5 -7
- package/dist/packages/_es/ShortPassword.js +59 -89
- package/dist/packages/_es/Signature.js +71 -70
- package/dist/packages/_es/Sku.js +43 -53
- package/dist/packages/_es/Step.js +8 -10
- package/dist/packages/_es/Steps.js +2 -2
- package/dist/packages/_es/Swipe.js +28 -43
- package/dist/packages/_es/Swiper.js +418 -17
- package/dist/packages/_es/SwiperItem.js +39 -14
- package/dist/packages/_es/Switch.js +32 -11
- package/dist/packages/_es/TabPane.js +5 -4
- package/dist/packages/_es/Tabbar.js +5 -4
- package/dist/packages/_es/TabbarItem.js +9 -8
- package/dist/packages/_es/Tabs.js +16 -22
- package/dist/packages/_es/Tag.js +6 -5
- package/dist/packages/_es/TextArea.js +12 -16
- package/dist/packages/_es/TimeDetail.js +5 -7
- package/dist/packages/_es/TimePannel.js +5 -7
- package/dist/packages/_es/TimeSelect.js +7 -12
- package/dist/packages/_es/Toast.js +178 -46
- package/dist/packages/_es/Uploader.js +149 -109
- package/dist/packages/_es/Video.js +405 -0
- package/dist/packages/_es/component.js +1 -1
- package/dist/packages/_es/index.js +7 -58
- package/dist/packages/_es/index2.js +58 -43
- package/dist/packages/_es/index3.js +28 -411
- package/dist/packages/_es/plugin-vue_export-helper.js +13 -0
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +1 -1
- package/dist/packages/_es/util.js +1 -1
- package/dist/packages/cellgroup/index.scss +9 -0
- package/dist/packages/dialog/index.scss +17 -0
- package/dist/packages/drag/index.scss +4 -0
- package/dist/packages/fixednav/index.scss +6 -1
- package/dist/packages/formitem/index.scss +3 -0
- package/dist/packages/icon/index.scss +2 -1
- package/dist/packages/numberkeyboard/index.scss +1 -1
- package/dist/packages/popover/index.scss +2 -2
- package/dist/packages/rate/index.scss +1 -0
- package/dist/packages/textarea/index.scss +1 -0
- package/dist/packages/timedetail/index.scss +1 -2
- package/dist/packages/timeselect/index.scss +3 -0
- package/dist/packages/toast/index.scss +6 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +2 -1
- package/dist/styles/font/config.json +2 -1
- package/dist/styles/font/demo_index.html +26 -3
- package/dist/styles/font/iconfont.css +7 -3
- package/dist/styles/font/iconfont.js +31 -32
- package/dist/styles/font/iconfont.json +7 -0
- package/dist/styles/font/iconfont.ttf +0 -0
- package/dist/styles/font/iconfont.woff +0 -0
- package/dist/styles/font/iconfont.woff2 +0 -0
- package/dist/styles/themes/default.scss +38 -38
- package/dist/styles/variables.scss +5 -1
- package/package.json +1 -1
- package/dist/packages/_es/commonProps.js +0 -30
- package/dist/packages/_es/index.taro.vue_vue&type=script&lang.js +0 -44
- package/dist/packages/_es/use-lock-scroll.js +0 -23
|
@@ -17,21 +17,16 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __require = typeof require !== "undefined" ? require : (x) => {
|
|
21
|
-
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
22
|
-
};
|
|
23
20
|
/*!
|
|
24
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.12 Sat Nov 27 2021 11:30:43 GMT+0800 (中国标准时间)
|
|
25
22
|
* (c) 2021 @jdf2e.
|
|
26
23
|
* Released under the MIT License.
|
|
27
24
|
*/
|
|
28
|
-
import { reactive, computed, onMounted, toRefs, resolveComponent, openBlock,
|
|
25
|
+
import { reactive, computed, onMounted, onUnmounted, ref, onActivated, onDeactivated, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, createVNode, toDisplayString, renderSlot, createCommentVNode } from "vue";
|
|
29
26
|
import { c as createComponent } from "./component.js";
|
|
30
|
-
import { _ as
|
|
31
|
-
import Taro from "@tarojs/taro";
|
|
32
|
-
import "./pxCheck.js";
|
|
27
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
33
28
|
const { componentName, create } = createComponent("infiniteloading");
|
|
34
|
-
|
|
29
|
+
const _sfc_main = create({
|
|
35
30
|
props: {
|
|
36
31
|
hasMore: {
|
|
37
32
|
type: Boolean,
|
|
@@ -79,16 +74,14 @@ var _sfc_main = create({
|
|
|
79
74
|
}
|
|
80
75
|
},
|
|
81
76
|
emits: ["scroll-change", "load-more", "refresh"],
|
|
82
|
-
components: {
|
|
83
|
-
"nut-icon": _sfc_main$1
|
|
84
|
-
},
|
|
85
77
|
setup(props, { emit, slots }) {
|
|
86
78
|
const state = reactive({
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
79
|
+
scrollEl: window,
|
|
80
|
+
scroller: null,
|
|
81
|
+
refreshTop: null,
|
|
82
|
+
beforeScrollTop: 0,
|
|
91
83
|
isTouching: false,
|
|
84
|
+
isInfiniting: false,
|
|
92
85
|
refreshMaxH: 0,
|
|
93
86
|
y: 0,
|
|
94
87
|
x: 0,
|
|
@@ -107,46 +100,69 @@ var _sfc_main = create({
|
|
|
107
100
|
};
|
|
108
101
|
});
|
|
109
102
|
const getParentElement = (el) => {
|
|
110
|
-
return
|
|
103
|
+
return !!props.containerId ? document.querySelector(`#${props.containerId}`) : el && el.parentNode;
|
|
111
104
|
};
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}).exec();
|
|
105
|
+
const requestAniFrame = () => {
|
|
106
|
+
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function(callback) {
|
|
107
|
+
window.setTimeout(callback, 1e3 / 60);
|
|
108
|
+
};
|
|
117
109
|
};
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
emit("load-more", infiniteDone);
|
|
124
|
-
}
|
|
110
|
+
const getWindowScrollTop = () => {
|
|
111
|
+
return window.pageYOffset !== void 0 ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
|
|
112
|
+
};
|
|
113
|
+
const calculateTopPosition = (el) => {
|
|
114
|
+
return !el ? 0 : el.offsetTop + calculateTopPosition(el.offsetParent);
|
|
125
115
|
};
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
116
|
+
const isScrollAtBottom = () => {
|
|
117
|
+
let offsetDistance = 0;
|
|
118
|
+
let resScrollTop = 0;
|
|
119
|
+
let direction = "down";
|
|
120
|
+
const windowScrollTop = getWindowScrollTop();
|
|
121
|
+
if (props.useWindow) {
|
|
122
|
+
if (state.scroller) {
|
|
123
|
+
offsetDistance = calculateTopPosition(state.scroller) + state.scroller.offsetHeight - windowScrollTop - window.innerHeight;
|
|
124
|
+
}
|
|
125
|
+
resScrollTop = windowScrollTop;
|
|
126
|
+
} else {
|
|
127
|
+
const { scrollHeight, clientHeight, scrollTop } = state.scrollEl;
|
|
128
|
+
offsetDistance = scrollHeight - clientHeight - scrollTop;
|
|
129
|
+
resScrollTop = scrollTop;
|
|
131
130
|
}
|
|
132
|
-
if (
|
|
133
|
-
|
|
131
|
+
if (state.beforeScrollTop > resScrollTop) {
|
|
132
|
+
direction = "up";
|
|
134
133
|
} else {
|
|
135
|
-
|
|
134
|
+
direction = "down";
|
|
136
135
|
}
|
|
137
|
-
state.
|
|
138
|
-
emit("scroll-change",
|
|
136
|
+
state.beforeScrollTop = resScrollTop;
|
|
137
|
+
emit("scroll-change", resScrollTop);
|
|
138
|
+
return offsetDistance <= props.threshold && direction == "down";
|
|
139
139
|
};
|
|
140
140
|
const infiniteDone = () => {
|
|
141
141
|
state.isInfiniting = false;
|
|
142
142
|
};
|
|
143
|
+
const handleScroll = () => {
|
|
144
|
+
requestAniFrame()(() => {
|
|
145
|
+
if (!isScrollAtBottom() || !props.hasMore || state.isInfiniting) {
|
|
146
|
+
return false;
|
|
147
|
+
} else {
|
|
148
|
+
state.isInfiniting = true;
|
|
149
|
+
emit("load-more", infiniteDone);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
const scrollListener = () => {
|
|
154
|
+
state.scrollEl.addEventListener("scroll", handleScroll, props.useCapture);
|
|
155
|
+
};
|
|
156
|
+
const refreshDone = () => {
|
|
157
|
+
state.distance = 0;
|
|
158
|
+
state.isTouching = false;
|
|
159
|
+
};
|
|
143
160
|
const touchStart = (event) => {
|
|
144
|
-
if (state.
|
|
161
|
+
if (state.beforeScrollTop == 0 && !state.isTouching && props.isOpenRefresh) {
|
|
145
162
|
state.y = event.touches[0].pageY;
|
|
146
163
|
state.isTouching = true;
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}).exec();
|
|
164
|
+
const childHeight = state.refreshTop.firstElementChild.offsetHeight;
|
|
165
|
+
state.refreshMaxH = Math.floor(childHeight * 1 + 10);
|
|
150
166
|
}
|
|
151
167
|
};
|
|
152
168
|
const touchMove = (event) => {
|
|
@@ -167,20 +183,28 @@ var _sfc_main = create({
|
|
|
167
183
|
emit("refresh", refreshDone);
|
|
168
184
|
}
|
|
169
185
|
};
|
|
170
|
-
const refreshDone = () => {
|
|
171
|
-
state.distance = 0;
|
|
172
|
-
state.isTouching = false;
|
|
173
|
-
};
|
|
174
186
|
onMounted(() => {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
187
|
+
const parentElement = getParentElement(state.scroller);
|
|
188
|
+
state.scrollEl = props.useWindow ? window : parentElement;
|
|
189
|
+
scrollListener();
|
|
190
|
+
});
|
|
191
|
+
onUnmounted(() => {
|
|
192
|
+
state.scrollEl.removeEventListener("scroll", handleScroll, props.useCapture);
|
|
193
|
+
});
|
|
194
|
+
const isKeepAlive = ref(false);
|
|
195
|
+
onActivated(() => {
|
|
196
|
+
if (isKeepAlive.value) {
|
|
197
|
+
isKeepAlive.value = false;
|
|
198
|
+
scrollListener();
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
onDeactivated(() => {
|
|
202
|
+
isKeepAlive.value = true;
|
|
203
|
+
state.scrollEl.removeEventListener("scroll", handleScroll, props.useCapture);
|
|
178
204
|
});
|
|
179
205
|
return __spreadProps(__spreadValues({
|
|
180
206
|
classes
|
|
181
207
|
}, toRefs(state)), {
|
|
182
|
-
lower,
|
|
183
|
-
scroll,
|
|
184
208
|
touchStart,
|
|
185
209
|
touchMove,
|
|
186
210
|
touchEnd,
|
|
@@ -188,10 +212,7 @@ var _sfc_main = create({
|
|
|
188
212
|
});
|
|
189
213
|
}
|
|
190
214
|
});
|
|
191
|
-
const _hoisted_1 = {
|
|
192
|
-
class: "top-box",
|
|
193
|
-
id: "refreshTop"
|
|
194
|
-
};
|
|
215
|
+
const _hoisted_1 = { class: "top-box" };
|
|
195
216
|
const _hoisted_2 = { class: "top-text" };
|
|
196
217
|
const _hoisted_3 = { class: "nut-infinite-container" };
|
|
197
218
|
const _hoisted_4 = { class: "nut-infinite-bottom" };
|
|
@@ -206,46 +227,39 @@ const _hoisted_7 = {
|
|
|
206
227
|
};
|
|
207
228
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
208
229
|
const _component_nut_icon = resolveComponent("nut-icon");
|
|
209
|
-
|
|
210
|
-
return openBlock(), createBlock(_component_scroll_view, {
|
|
230
|
+
return openBlock(), createElementBlock("view", {
|
|
211
231
|
class: normalizeClass(_ctx.classes),
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
createElementVNode("view",
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
class: "top-img",
|
|
229
|
-
name: _ctx.pullIcon
|
|
230
|
-
}, null, 8, ["name"]),
|
|
231
|
-
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.pullTxt), 1)
|
|
232
|
-
])
|
|
233
|
-
], 4),
|
|
234
|
-
createElementVNode("view", _hoisted_3, [
|
|
235
|
-
renderSlot(_ctx.$slots, "default")
|
|
236
|
-
]),
|
|
237
|
-
createElementVNode("view", _hoisted_4, [
|
|
238
|
-
_ctx.isInfiniting ? (openBlock(), createElementBlock("view", _hoisted_5, [
|
|
239
|
-
createVNode(_component_nut_icon, {
|
|
240
|
-
class: "bottom-img",
|
|
241
|
-
name: _ctx.loadIcon
|
|
242
|
-
}, null, 8, ["name"]),
|
|
243
|
-
createElementVNode("view", _hoisted_6, toDisplayString(_ctx.loadTxt), 1)
|
|
244
|
-
])) : !_ctx.hasMore ? (openBlock(), createElementBlock("view", _hoisted_7, toDisplayString(_ctx.loadMoreTxt), 1)) : createCommentVNode("", true)
|
|
232
|
+
ref: "scroller",
|
|
233
|
+
onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.touchStart && _ctx.touchStart(...args)),
|
|
234
|
+
onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.touchMove && _ctx.touchMove(...args)),
|
|
235
|
+
onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.touchEnd && _ctx.touchEnd(...args))
|
|
236
|
+
}, [
|
|
237
|
+
createElementVNode("view", {
|
|
238
|
+
class: "nut-infinite-top",
|
|
239
|
+
ref: "refreshTop",
|
|
240
|
+
style: normalizeStyle(_ctx.getStyle)
|
|
241
|
+
}, [
|
|
242
|
+
createElementVNode("view", _hoisted_1, [
|
|
243
|
+
createVNode(_component_nut_icon, {
|
|
244
|
+
class: "top-img",
|
|
245
|
+
name: _ctx.pullIcon
|
|
246
|
+
}, null, 8, ["name"]),
|
|
247
|
+
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.pullTxt), 1)
|
|
245
248
|
])
|
|
249
|
+
], 4),
|
|
250
|
+
createElementVNode("view", _hoisted_3, [
|
|
251
|
+
renderSlot(_ctx.$slots, "default")
|
|
246
252
|
]),
|
|
247
|
-
|
|
248
|
-
|
|
253
|
+
createElementVNode("view", _hoisted_4, [
|
|
254
|
+
_ctx.isInfiniting ? (openBlock(), createElementBlock("view", _hoisted_5, [
|
|
255
|
+
createVNode(_component_nut_icon, {
|
|
256
|
+
class: "bottom-img",
|
|
257
|
+
name: _ctx.loadIcon
|
|
258
|
+
}, null, 8, ["name"]),
|
|
259
|
+
createElementVNode("view", _hoisted_6, toDisplayString(_ctx.loadTxt), 1)
|
|
260
|
+
])) : !_ctx.hasMore ? (openBlock(), createElementBlock("view", _hoisted_7, toDisplayString(_ctx.loadMoreTxt), 1)) : createCommentVNode("", true)
|
|
261
|
+
])
|
|
262
|
+
], 34);
|
|
249
263
|
}
|
|
250
|
-
_sfc_main
|
|
251
|
-
export {
|
|
264
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
265
|
+
export { index as default };
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.12 Sat Nov 27 2021 11:30:43 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { ref, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, normalizeStyle, withDirectives, createVNode, vShow } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
8
9
|
function trimExtraChar(value, char, regExp) {
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
10
|
+
const index2 = value.indexOf(char);
|
|
11
|
+
if (index2 === -1) {
|
|
11
12
|
return value;
|
|
12
13
|
}
|
|
13
|
-
if (char === "-" &&
|
|
14
|
-
return value.slice(0,
|
|
14
|
+
if (char === "-" && index2 !== 0) {
|
|
15
|
+
return value.slice(0, index2);
|
|
15
16
|
}
|
|
16
|
-
return value.slice(0,
|
|
17
|
+
return value.slice(0, index2 + 1) + value.slice(index2).replace(regExp, "");
|
|
17
18
|
}
|
|
18
19
|
function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
19
20
|
if (allowDot) {
|
|
@@ -30,7 +31,7 @@ function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
|
30
31
|
return value.replace(regExp, "");
|
|
31
32
|
}
|
|
32
33
|
const { componentName, create } = createComponent("input");
|
|
33
|
-
|
|
34
|
+
const _sfc_main = create({
|
|
34
35
|
props: {
|
|
35
36
|
type: {
|
|
36
37
|
type: String,
|
|
@@ -66,7 +67,7 @@ var _sfc_main = create({
|
|
|
66
67
|
},
|
|
67
68
|
maxLength: {
|
|
68
69
|
type: [String, Number],
|
|
69
|
-
default: "
|
|
70
|
+
default: ""
|
|
70
71
|
},
|
|
71
72
|
clearable: {
|
|
72
73
|
type: Boolean,
|
|
@@ -92,15 +93,15 @@ var _sfc_main = create({
|
|
|
92
93
|
const valueChange = (event) => {
|
|
93
94
|
const input = event.target;
|
|
94
95
|
let val = input.value;
|
|
95
|
-
if (props.maxLength && val.length > Number(props.maxLength)) {
|
|
96
|
-
val = val.slice(0, Number(props.maxLength));
|
|
97
|
-
}
|
|
98
96
|
if (props.type === "digit") {
|
|
99
97
|
val = formatNumber(val, true);
|
|
100
98
|
}
|
|
101
99
|
if (props.type === "number") {
|
|
102
100
|
val = formatNumber(val, false);
|
|
103
101
|
}
|
|
102
|
+
if (props.maxLength && val.length > Number(props.maxLength)) {
|
|
103
|
+
val = val.slice(0, Number(props.maxLength));
|
|
104
|
+
}
|
|
104
105
|
emit("update:modelValue", val, event);
|
|
105
106
|
emit("change", val, event);
|
|
106
107
|
};
|
|
@@ -116,6 +117,9 @@ var _sfc_main = create({
|
|
|
116
117
|
}, 0);
|
|
117
118
|
const input = event.target;
|
|
118
119
|
let value = input.value;
|
|
120
|
+
if (props.maxLength && value.length > Number(props.maxLength)) {
|
|
121
|
+
value = value.slice(0, Number(props.maxLength));
|
|
122
|
+
}
|
|
119
123
|
emit("blur", value, event);
|
|
120
124
|
};
|
|
121
125
|
const handleClear = (event) => {
|
|
@@ -139,11 +143,7 @@ const _hoisted_2 = {
|
|
|
139
143
|
key: 0,
|
|
140
144
|
class: "label-string"
|
|
141
145
|
};
|
|
142
|
-
const _hoisted_3 =
|
|
143
|
-
key: 0,
|
|
144
|
-
class: "input-text"
|
|
145
|
-
};
|
|
146
|
-
const _hoisted_4 = ["type", "maxlength", "placeholder", "disabled", "readonly", "value"];
|
|
146
|
+
const _hoisted_3 = ["type", "maxlength", "placeholder", "disabled", "readonly", "value"];
|
|
147
147
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
148
148
|
const _component_nut_icon = resolveComponent("nut-icon");
|
|
149
149
|
return openBlock(), createElementBlock("view", {
|
|
@@ -152,8 +152,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
152
152
|
createElementVNode("view", _hoisted_1, [
|
|
153
153
|
_ctx.label ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(_ctx.label), 1)) : createCommentVNode("", true)
|
|
154
154
|
]),
|
|
155
|
-
|
|
156
|
-
key: 1,
|
|
155
|
+
createElementVNode("input", {
|
|
157
156
|
class: "input-text",
|
|
158
157
|
style: normalizeStyle(_ctx.styles),
|
|
159
158
|
type: _ctx.type,
|
|
@@ -165,9 +164,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
165
164
|
onInput: _cache[0] || (_cache[0] = (...args) => _ctx.valueChange && _ctx.valueChange(...args)),
|
|
166
165
|
onFocus: _cache[1] || (_cache[1] = (...args) => _ctx.valueFocus && _ctx.valueFocus(...args)),
|
|
167
166
|
onBlur: _cache[2] || (_cache[2] = (...args) => _ctx.valueBlur && _ctx.valueBlur(...args))
|
|
168
|
-
}, null, 44,
|
|
167
|
+
}, null, 44, _hoisted_3),
|
|
169
168
|
_ctx.clearable && !_ctx.readonly ? withDirectives((openBlock(), createElementBlock("view", {
|
|
170
|
-
key:
|
|
169
|
+
key: 0,
|
|
171
170
|
onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleClear && _ctx.handleClear(...args)),
|
|
172
171
|
class: "nut-textinput-clear"
|
|
173
172
|
}, [
|
|
@@ -180,5 +179,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
180
179
|
]) : createCommentVNode("", true)
|
|
181
180
|
], 2);
|
|
182
181
|
}
|
|
183
|
-
_sfc_main
|
|
184
|
-
export {
|
|
182
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
183
|
+
export { index as default };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.12 Sat Nov 27 2021 11:30:43 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode,
|
|
6
|
+
import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode, createElementVNode } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
8
|
import { p as pxCheck } from "./pxCheck.js";
|
|
9
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
10
|
const { componentName, create } = createComponent("inputnumber");
|
|
10
|
-
|
|
11
|
+
const _sfc_main = create({
|
|
11
12
|
props: {
|
|
12
13
|
modelValue: {
|
|
13
14
|
type: [Number, String],
|
|
@@ -60,7 +61,7 @@ var _sfc_main = create({
|
|
|
60
61
|
};
|
|
61
62
|
const change = (event) => {
|
|
62
63
|
const input = event.target;
|
|
63
|
-
emit("update:modelValue", input.
|
|
64
|
+
emit("update:modelValue", input.valueAsNumber, event);
|
|
64
65
|
};
|
|
65
66
|
const emitChange = (value, event) => {
|
|
66
67
|
let output_value = fixedDecimalPlaces(value);
|
|
@@ -91,13 +92,20 @@ var _sfc_main = create({
|
|
|
91
92
|
emit("overlimit", event, "add");
|
|
92
93
|
}
|
|
93
94
|
};
|
|
95
|
+
const focus = (event) => {
|
|
96
|
+
if (props.disabled)
|
|
97
|
+
return;
|
|
98
|
+
if (props.readonly)
|
|
99
|
+
return;
|
|
100
|
+
emit("focus", event);
|
|
101
|
+
};
|
|
94
102
|
const blur = (event) => {
|
|
95
103
|
if (props.disabled)
|
|
96
104
|
return;
|
|
97
105
|
if (props.readonly)
|
|
98
106
|
return;
|
|
99
107
|
const input = event.target;
|
|
100
|
-
let value =
|
|
108
|
+
let value = input.valueAsNumber;
|
|
101
109
|
if (value < Number(props.min)) {
|
|
102
110
|
value = Number(props.min);
|
|
103
111
|
} else if (value > Number(props.max)) {
|
|
@@ -106,15 +114,6 @@ var _sfc_main = create({
|
|
|
106
114
|
emitChange(value, event);
|
|
107
115
|
emit("blur", event);
|
|
108
116
|
};
|
|
109
|
-
const focus = (event) => {
|
|
110
|
-
if (props.disabled)
|
|
111
|
-
return;
|
|
112
|
-
if (props.readonly) {
|
|
113
|
-
blur(event);
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
emit("focus", event);
|
|
117
|
-
};
|
|
118
117
|
return {
|
|
119
118
|
classes,
|
|
120
119
|
change,
|
|
@@ -128,11 +127,7 @@ var _sfc_main = create({
|
|
|
128
127
|
};
|
|
129
128
|
}
|
|
130
129
|
});
|
|
131
|
-
const _hoisted_1 =
|
|
132
|
-
key: 0,
|
|
133
|
-
class: "nut-inputnumber__text--readonly"
|
|
134
|
-
};
|
|
135
|
-
const _hoisted_2 = ["min", "max", "disabled", "readonly", "value"];
|
|
130
|
+
const _hoisted_1 = ["min", "max", "disabled", "readonly", "value"];
|
|
136
131
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
137
132
|
const _component_nut_icon = resolveComponent("nut-icon");
|
|
138
133
|
return openBlock(), createElementBlock("view", {
|
|
@@ -145,8 +140,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
145
140
|
size: _ctx.buttonSize,
|
|
146
141
|
onClick: _ctx.reduce
|
|
147
142
|
}, null, 8, ["class", "size", "onClick"]),
|
|
148
|
-
|
|
149
|
-
key: 1,
|
|
143
|
+
createElementVNode("input", {
|
|
150
144
|
type: "number",
|
|
151
145
|
min: _ctx.min,
|
|
152
146
|
max: _ctx.max,
|
|
@@ -157,7 +151,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
157
151
|
onInput: _cache[0] || (_cache[0] = (...args) => _ctx.change && _ctx.change(...args)),
|
|
158
152
|
onBlur: _cache[1] || (_cache[1] = (...args) => _ctx.blur && _ctx.blur(...args)),
|
|
159
153
|
onFocus: _cache[2] || (_cache[2] = (...args) => _ctx.focus && _ctx.focus(...args))
|
|
160
|
-
}, null, 44,
|
|
154
|
+
}, null, 44, _hoisted_1),
|
|
161
155
|
createVNode(_component_nut_icon, {
|
|
162
156
|
name: "plus",
|
|
163
157
|
class: normalizeClass(["nut-inputnumber__icon", { "nut-inputnumber__icon--disabled": !_ctx.addAllow() }]),
|
|
@@ -166,5 +160,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
166
160
|
}, null, 8, ["class", "size", "onClick"])
|
|
167
161
|
], 6);
|
|
168
162
|
}
|
|
169
|
-
_sfc_main
|
|
170
|
-
export {
|
|
163
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
164
|
+
export { index as default };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.12 Sat Nov 27 2021 11:30:43 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { c as createComponent } from "./component.js";
|
|
7
7
|
import "vue";
|
|
8
8
|
const { create } = createComponent("layout");
|
|
9
|
-
|
|
9
|
+
const _sfc_main = create({});
|
|
10
10
|
export { _sfc_main as default };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.12 Sat Nov 27 2021 11:30:43 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @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
|
|
8
|
+
import { u as useRect } from "./index3.js";
|
|
9
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
10
|
const { componentName, create } = createComponent("menu");
|
|
10
|
-
|
|
11
|
+
const _sfc_main = create({
|
|
11
12
|
props: {
|
|
12
13
|
activeColor: {
|
|
13
14
|
type: String,
|
|
@@ -19,7 +20,7 @@ var _sfc_main = create({
|
|
|
19
20
|
},
|
|
20
21
|
duration: {
|
|
21
22
|
type: [Number, String],
|
|
22
|
-
default: 0
|
|
23
|
+
default: 0
|
|
23
24
|
}
|
|
24
25
|
},
|
|
25
26
|
setup(props, { emit, slots }) {
|
|
@@ -56,17 +57,14 @@ var _sfc_main = create({
|
|
|
56
57
|
});
|
|
57
58
|
const updateOffset = () => {
|
|
58
59
|
if (barRef.value) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
offset.value = rect.bottom;
|
|
62
|
-
}).exec();
|
|
63
|
-
}, 100);
|
|
60
|
+
const rect = useRect(barRef);
|
|
61
|
+
offset.value = rect.bottom;
|
|
64
62
|
}
|
|
65
63
|
};
|
|
66
64
|
linkChildren({ props, offset });
|
|
67
65
|
const toggleItem = (active) => {
|
|
68
|
-
children.forEach((item,
|
|
69
|
-
if (
|
|
66
|
+
children.forEach((item, index2) => {
|
|
67
|
+
if (index2 === active) {
|
|
70
68
|
updateOffset();
|
|
71
69
|
item.toggle();
|
|
72
70
|
} else if (item.state.showPopup) {
|
|
@@ -94,11 +92,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
94
92
|
class: normalizeClass(["nut-menu__bar", { opened: _ctx.opened }]),
|
|
95
93
|
ref: "barRef"
|
|
96
94
|
}, [
|
|
97
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.children, (item,
|
|
95
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.children, (item, index2) => {
|
|
98
96
|
return openBlock(), createElementBlock("view", {
|
|
99
|
-
key:
|
|
97
|
+
key: index2,
|
|
100
98
|
class: normalizeClass(["nut-menu__item", { disabled: item.disabled }]),
|
|
101
|
-
onClick: ($event) => !item.disabled && _ctx.toggleItem(
|
|
99
|
+
onClick: ($event) => !item.disabled && _ctx.toggleItem(index2),
|
|
102
100
|
style: normalizeStyle({ color: item.state.showPopup ? _ctx.activeColor : "" })
|
|
103
101
|
}, [
|
|
104
102
|
createElementVNode("view", {
|
|
@@ -117,5 +115,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
117
115
|
renderSlot(_ctx.$slots, "default")
|
|
118
116
|
], 2);
|
|
119
117
|
}
|
|
120
|
-
_sfc_main
|
|
121
|
-
export {
|
|
118
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
119
|
+
export { index as default };
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.12 Sat Nov 27 2021 11:30:43 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @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";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import
|
|
9
|
-
import "./
|
|
8
|
+
import _sfc_main$1 from "./Icon.js";
|
|
9
|
+
import Popup from "./Popup.js";
|
|
10
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
11
|
import "./pxCheck.js";
|
|
12
|
+
import "./OverLay.js";
|
|
11
13
|
const { componentName, create } = createComponent("menu-item");
|
|
12
|
-
|
|
14
|
+
const _sfc_main = create({
|
|
13
15
|
props: {
|
|
14
16
|
title: String,
|
|
15
17
|
options: {
|
|
@@ -32,7 +34,7 @@ var _sfc_main = create({
|
|
|
32
34
|
},
|
|
33
35
|
components: {
|
|
34
36
|
[_sfc_main$1.name]: _sfc_main$1,
|
|
35
|
-
[
|
|
37
|
+
[Popup.name]: Popup
|
|
36
38
|
},
|
|
37
39
|
emits: ["update:modelValue", "change"],
|
|
38
40
|
setup(props, { emit, slots }) {
|
|
@@ -136,9 +138,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
136
138
|
}), {
|
|
137
139
|
default: withCtx(() => [
|
|
138
140
|
createElementVNode("view", _hoisted_1, [
|
|
139
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (option,
|
|
141
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (option, index2) => {
|
|
140
142
|
return openBlock(), createElementBlock("view", {
|
|
141
|
-
key:
|
|
143
|
+
key: index2,
|
|
142
144
|
class: normalizeClass(["nut-menu-item__option", { active: option.value === _ctx.modelValue }]),
|
|
143
145
|
style: normalizeStyle({ "flex-basis": 100 / _ctx.cols + "%" }),
|
|
144
146
|
onClick: ($event) => _ctx.onClick(option)
|
|
@@ -162,5 +164,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
162
164
|
[vShow, _ctx.state.showWrapper]
|
|
163
165
|
]);
|
|
164
166
|
}
|
|
165
|
-
_sfc_main
|
|
166
|
-
export {
|
|
167
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
168
|
+
export { index as default };
|