@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,22 +1,30 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
+
import { reactive, computed, ref, onMounted, toRefs, openBlock, createElementBlock, normalizeStyle, toDisplayString, createCommentVNode, renderSlot, createElementVNode, normalizeClass, withModifiers, withDirectives, createBlock, resolveDynamicComponent, vShow } from "vue";
|
|
21
|
+
import { c as createComponent } from "./component-81a4c1d0.js";
|
|
22
|
+
import { r as renderIcon } from "./renderIcon-3d0fd47c.js";
|
|
23
|
+
import { CircleClose } from "@nutui/icons-vue";
|
|
24
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
18
25
|
import "../locale/lang";
|
|
19
|
-
const { create
|
|
26
|
+
const { create, translate } = createComponent("searchbar");
|
|
27
|
+
const _sfc_main = create({
|
|
20
28
|
props: {
|
|
21
29
|
modelValue: {
|
|
22
30
|
type: [String, Number],
|
|
@@ -44,11 +52,11 @@ const { create: Y, translate: Z } = Q("searchbar"), _ = Y({
|
|
|
44
52
|
},
|
|
45
53
|
clearable: {
|
|
46
54
|
type: Boolean,
|
|
47
|
-
default:
|
|
55
|
+
default: true
|
|
48
56
|
},
|
|
49
57
|
clearIcon: {
|
|
50
58
|
type: Object,
|
|
51
|
-
default: () =>
|
|
59
|
+
default: () => CircleClose
|
|
52
60
|
},
|
|
53
61
|
background: {
|
|
54
62
|
type: String,
|
|
@@ -64,15 +72,15 @@ const { create: Y, translate: Z } = Q("searchbar"), _ = Y({
|
|
|
64
72
|
},
|
|
65
73
|
autofocus: {
|
|
66
74
|
type: Boolean,
|
|
67
|
-
default:
|
|
75
|
+
default: false
|
|
68
76
|
},
|
|
69
77
|
disabled: {
|
|
70
78
|
type: Boolean,
|
|
71
|
-
default:
|
|
79
|
+
default: false
|
|
72
80
|
},
|
|
73
81
|
readonly: {
|
|
74
82
|
type: Boolean,
|
|
75
|
-
default:
|
|
83
|
+
default: false
|
|
76
84
|
},
|
|
77
85
|
inputAlign: {
|
|
78
86
|
type: String,
|
|
@@ -90,140 +98,183 @@ const { create: Y, translate: Z } = Q("searchbar"), _ = Y({
|
|
|
90
98
|
"click-left-icon",
|
|
91
99
|
"click-right-icon"
|
|
92
100
|
],
|
|
93
|
-
setup(
|
|
94
|
-
const
|
|
95
|
-
active:
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
101
|
+
setup(props, { emit }) {
|
|
102
|
+
const state = reactive({
|
|
103
|
+
active: false
|
|
104
|
+
});
|
|
105
|
+
const searchbarStyle = computed(() => {
|
|
106
|
+
return {
|
|
107
|
+
background: props.background
|
|
108
|
+
};
|
|
109
|
+
});
|
|
110
|
+
const inputSearchbarStyle = computed(() => {
|
|
111
|
+
return {
|
|
112
|
+
background: props.inputBackground
|
|
113
|
+
};
|
|
114
|
+
});
|
|
115
|
+
const valueChange = (event) => {
|
|
116
|
+
const input = event.target;
|
|
117
|
+
let val = input.value;
|
|
118
|
+
if (props.maxLength && val.length > Number(props.maxLength)) {
|
|
119
|
+
val = val.slice(0, Number(props.maxLength));
|
|
120
|
+
}
|
|
121
|
+
emit("update:modelValue", val, event);
|
|
122
|
+
emit("change", val, event);
|
|
123
|
+
};
|
|
124
|
+
const focusCss = ref({});
|
|
125
|
+
const valueFocus = (event) => {
|
|
126
|
+
const input = event.target;
|
|
127
|
+
let value = input.value;
|
|
128
|
+
state.active = true;
|
|
129
|
+
focusCss.value = props.focusStyle;
|
|
130
|
+
emit("focus", value, event);
|
|
131
|
+
};
|
|
132
|
+
const valueBlur = (event) => {
|
|
107
133
|
setTimeout(() => {
|
|
108
|
-
|
|
134
|
+
state.active = false;
|
|
109
135
|
}, 0);
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
136
|
+
const input = event.target;
|
|
137
|
+
let value = input.value;
|
|
138
|
+
if (props.maxLength && value.length > Number(props.maxLength)) {
|
|
139
|
+
value = value.slice(0, Number(props.maxLength));
|
|
140
|
+
}
|
|
141
|
+
focusCss.value = {};
|
|
142
|
+
emit("blur", value, event);
|
|
143
|
+
};
|
|
144
|
+
const handleClear = (event) => {
|
|
145
|
+
emit("update:modelValue", "", event);
|
|
146
|
+
emit("change", "", event);
|
|
147
|
+
emit("clear", "");
|
|
148
|
+
};
|
|
149
|
+
const handleSubmit = () => {
|
|
150
|
+
emit("search", props.modelValue);
|
|
151
|
+
};
|
|
152
|
+
const clickInput = (event) => {
|
|
153
|
+
emit("click-input", event);
|
|
154
|
+
};
|
|
155
|
+
const leftIconClick = (event) => {
|
|
156
|
+
emit("click-left-icon", props.modelValue, event);
|
|
157
|
+
};
|
|
158
|
+
const rightIconClick = (event) => {
|
|
159
|
+
emit("click-right-icon", props.modelValue, event);
|
|
160
|
+
};
|
|
161
|
+
const styleSearchbar = computed(() => {
|
|
162
|
+
const style = {
|
|
163
|
+
textAlign: props.inputAlign
|
|
164
|
+
};
|
|
165
|
+
return style;
|
|
166
|
+
});
|
|
167
|
+
const inputsearch = ref(null);
|
|
168
|
+
onMounted(() => {
|
|
169
|
+
if (props.autofocus) {
|
|
170
|
+
inputsearch.value.focus();
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
return __spreadProps(__spreadValues({
|
|
174
|
+
renderIcon,
|
|
175
|
+
inputsearch
|
|
176
|
+
}, toRefs(state)), {
|
|
177
|
+
valueChange,
|
|
178
|
+
valueFocus,
|
|
179
|
+
valueBlur,
|
|
180
|
+
handleClear,
|
|
181
|
+
handleSubmit,
|
|
182
|
+
searchbarStyle,
|
|
183
|
+
inputSearchbarStyle,
|
|
184
|
+
focusCss,
|
|
185
|
+
translate,
|
|
186
|
+
clickInput,
|
|
187
|
+
leftIconClick,
|
|
188
|
+
rightIconClick,
|
|
189
|
+
styleSearchbar
|
|
144
190
|
});
|
|
145
191
|
}
|
|
146
|
-
})
|
|
192
|
+
});
|
|
193
|
+
const _hoisted_1 = {
|
|
147
194
|
key: 0,
|
|
148
195
|
class: "nut-searchbar__search-label"
|
|
149
|
-
}
|
|
196
|
+
};
|
|
197
|
+
const _hoisted_2 = {
|
|
150
198
|
key: 1,
|
|
151
199
|
class: "nut-searchbar__search-icon nut-searchbar__left-search-icon"
|
|
152
|
-
}
|
|
200
|
+
};
|
|
201
|
+
const _hoisted_3 = ["type", "maxlength", "placeholder", "value", "disabled", "readonly"];
|
|
202
|
+
const _hoisted_4 = {
|
|
153
203
|
key: 1,
|
|
154
204
|
class: "nut-searchbar__search-icon nut-searchbar__iptright-search-icon"
|
|
155
|
-
}
|
|
205
|
+
};
|
|
206
|
+
const _hoisted_5 = {
|
|
156
207
|
key: 2,
|
|
157
208
|
class: "nut-searchbar__search-icon nut-searchbar__right-search-icon"
|
|
158
209
|
};
|
|
159
|
-
function
|
|
160
|
-
return
|
|
210
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
211
|
+
return openBlock(), createElementBlock("view", {
|
|
161
212
|
class: "nut-searchbar",
|
|
162
|
-
style:
|
|
213
|
+
style: normalizeStyle(_ctx.searchbarStyle)
|
|
163
214
|
}, [
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
])) :
|
|
168
|
-
|
|
169
|
-
class:
|
|
170
|
-
style:
|
|
215
|
+
_ctx.label ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(_ctx.label), 1)) : createCommentVNode("", true),
|
|
216
|
+
_ctx.$slots.leftout ? (openBlock(), createElementBlock("view", _hoisted_2, [
|
|
217
|
+
renderSlot(_ctx.$slots, "leftout")
|
|
218
|
+
])) : createCommentVNode("", true),
|
|
219
|
+
createElementVNode("view", {
|
|
220
|
+
class: normalizeClass([`nut-searchbar__search-input`, _ctx.shape]),
|
|
221
|
+
style: normalizeStyle(__spreadValues(__spreadValues({}, _ctx.inputSearchbarStyle), _ctx.focusCss))
|
|
171
222
|
}, [
|
|
172
|
-
|
|
223
|
+
_ctx.$slots.leftin ? (openBlock(), createElementBlock("view", {
|
|
173
224
|
key: 0,
|
|
174
225
|
class: "nut-searchbar__search-icon nut-searchbar__iptleft-search-icon",
|
|
175
|
-
onClick:
|
|
226
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.leftIconClick && _ctx.leftIconClick(...args))
|
|
176
227
|
}, [
|
|
177
|
-
|
|
178
|
-
])) :
|
|
179
|
-
|
|
180
|
-
class:
|
|
228
|
+
renderSlot(_ctx.$slots, "leftin")
|
|
229
|
+
])) : createCommentVNode("", true),
|
|
230
|
+
createElementVNode("view", {
|
|
231
|
+
class: normalizeClass(["nut-searchbar__input-inner", _ctx.$slots.rightin && "nut-searchbar__input-inner-absolute"])
|
|
181
232
|
}, [
|
|
182
|
-
|
|
233
|
+
createElementVNode("form", {
|
|
183
234
|
class: "nut-searchbar__input-form",
|
|
184
235
|
action: "#",
|
|
185
|
-
onSubmit:
|
|
236
|
+
onSubmit: _cache[5] || (_cache[5] = withModifiers((...args) => _ctx.handleSubmit && _ctx.handleSubmit(...args), ["prevent"]))
|
|
186
237
|
}, [
|
|
187
|
-
|
|
238
|
+
createElementVNode("input", {
|
|
188
239
|
ref: "inputsearch",
|
|
189
|
-
class:
|
|
190
|
-
type:
|
|
191
|
-
maxlength:
|
|
192
|
-
placeholder:
|
|
193
|
-
value:
|
|
194
|
-
disabled:
|
|
195
|
-
readonly:
|
|
196
|
-
onClick:
|
|
197
|
-
onInput:
|
|
198
|
-
onFocus:
|
|
199
|
-
onBlur:
|
|
200
|
-
style:
|
|
201
|
-
}, null, 46,
|
|
240
|
+
class: normalizeClass(["nut-searchbar__input-bar", _ctx.clearable && "nut-searchbar__input-bar_clear"]),
|
|
241
|
+
type: _ctx.inputType,
|
|
242
|
+
maxlength: _ctx.maxLength,
|
|
243
|
+
placeholder: _ctx.placeholder || _ctx.translate("placeholder"),
|
|
244
|
+
value: _ctx.modelValue,
|
|
245
|
+
disabled: _ctx.disabled,
|
|
246
|
+
readonly: _ctx.readonly,
|
|
247
|
+
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.clickInput && _ctx.clickInput(...args)),
|
|
248
|
+
onInput: _cache[2] || (_cache[2] = (...args) => _ctx.valueChange && _ctx.valueChange(...args)),
|
|
249
|
+
onFocus: _cache[3] || (_cache[3] = (...args) => _ctx.valueFocus && _ctx.valueFocus(...args)),
|
|
250
|
+
onBlur: _cache[4] || (_cache[4] = (...args) => _ctx.valueBlur && _ctx.valueBlur(...args)),
|
|
251
|
+
style: normalizeStyle(_ctx.styleSearchbar)
|
|
252
|
+
}, null, 46, _hoisted_3)
|
|
202
253
|
], 32)
|
|
203
254
|
], 2),
|
|
204
|
-
|
|
205
|
-
class:
|
|
255
|
+
createElementVNode("view", {
|
|
256
|
+
class: normalizeClass(["nut-searchbar__input-inner-icon", _ctx.$slots.rightin && "nut-searchbar__input-inner-icon-absolute"])
|
|
206
257
|
}, [
|
|
207
|
-
|
|
258
|
+
_ctx.clearable ? withDirectives((openBlock(), createElementBlock("view", {
|
|
208
259
|
key: 0,
|
|
209
|
-
onClick:
|
|
260
|
+
onClick: _cache[6] || (_cache[6] = (...args) => _ctx.handleClear && _ctx.handleClear(...args)),
|
|
210
261
|
class: "nut-searchbar__search-icon nut-searchbar__input-clear"
|
|
211
262
|
}, [
|
|
212
|
-
|
|
263
|
+
_ctx.$slots["clear-icon"] ? renderSlot(_ctx.$slots, "clear-icon", { key: 0 }) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.renderIcon(_ctx.clearIcon)), { key: 1 }))
|
|
213
264
|
], 512)), [
|
|
214
|
-
[
|
|
215
|
-
]) :
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
])) :
|
|
265
|
+
[vShow, String(_ctx.modelValue).length > 0]
|
|
266
|
+
]) : createCommentVNode("", true),
|
|
267
|
+
_ctx.$slots.rightin ? (openBlock(), createElementBlock("view", _hoisted_4, [
|
|
268
|
+
renderSlot(_ctx.$slots, "rightin")
|
|
269
|
+
])) : createCommentVNode("", true)
|
|
219
270
|
], 2)
|
|
220
271
|
], 6),
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
])) :
|
|
272
|
+
_ctx.$slots.rightout ? (openBlock(), createElementBlock("view", _hoisted_5, [
|
|
273
|
+
renderSlot(_ctx.$slots, "rightout")
|
|
274
|
+
])) : createCommentVNode("", true)
|
|
224
275
|
], 4);
|
|
225
276
|
}
|
|
226
|
-
const
|
|
277
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
227
278
|
export {
|
|
228
|
-
|
|
279
|
+
index as default
|
|
229
280
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { ref
|
|
2
|
-
import { c as
|
|
3
|
-
import { P as
|
|
4
|
-
import { Tips
|
|
5
|
-
import { _ as
|
|
1
|
+
import { ref, computed, watch, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, createElementVNode, toDisplayString, Fragment, renderList, createCommentVNode } from "vue";
|
|
2
|
+
import { c as createComponent } from "./component-81a4c1d0.js";
|
|
3
|
+
import { P as Popup } from "./index-da0a7662.js";
|
|
4
|
+
import { Tips } from "@nutui/icons-vue";
|
|
5
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
6
6
|
import "../locale/lang";
|
|
7
7
|
import "./Overlay.js";
|
|
8
|
-
const { create
|
|
8
|
+
const { create, translate } = createComponent("short-password");
|
|
9
|
+
const _sfc_main = create({
|
|
9
10
|
components: {
|
|
10
|
-
[
|
|
11
|
-
Tips
|
|
11
|
+
[Popup.name]: Popup,
|
|
12
|
+
Tips
|
|
12
13
|
},
|
|
13
14
|
props: {
|
|
14
15
|
title: {
|
|
@@ -25,7 +26,7 @@ const { create: O, translate: N } = _("short-password"), B = O({
|
|
|
25
26
|
},
|
|
26
27
|
visible: {
|
|
27
28
|
type: Boolean,
|
|
28
|
-
default:
|
|
29
|
+
default: false
|
|
29
30
|
},
|
|
30
31
|
modelValue: {
|
|
31
32
|
type: String,
|
|
@@ -37,7 +38,7 @@ const { create: O, translate: N } = _("short-password"), B = O({
|
|
|
37
38
|
},
|
|
38
39
|
closeOnClickOverlay: {
|
|
39
40
|
type: Boolean,
|
|
40
|
-
default:
|
|
41
|
+
default: true
|
|
41
42
|
},
|
|
42
43
|
length: {
|
|
43
44
|
type: [String, Number],
|
|
@@ -46,97 +47,120 @@ const { create: O, translate: N } = _("short-password"), B = O({
|
|
|
46
47
|
}
|
|
47
48
|
},
|
|
48
49
|
emits: ["update:modelValue", "update:visible", "complete", "tips", "close", "focus"],
|
|
49
|
-
setup(
|
|
50
|
-
const
|
|
51
|
-
|
|
50
|
+
setup(props, { emit }) {
|
|
51
|
+
const realInput = ref(props.modelValue);
|
|
52
|
+
const comLen = computed(() => range(Number(props.length)));
|
|
53
|
+
const show = ref(props.visible);
|
|
54
|
+
const onTouchStart = (event) => {
|
|
55
|
+
event.stopPropagation();
|
|
56
|
+
emit("focus");
|
|
52
57
|
};
|
|
53
|
-
|
|
54
|
-
() =>
|
|
55
|
-
(
|
|
56
|
-
|
|
58
|
+
watch(
|
|
59
|
+
() => props.visible,
|
|
60
|
+
(value) => {
|
|
61
|
+
show.value = value;
|
|
57
62
|
}
|
|
58
|
-
)
|
|
59
|
-
|
|
60
|
-
(
|
|
61
|
-
|
|
63
|
+
);
|
|
64
|
+
watch(
|
|
65
|
+
() => props.modelValue,
|
|
66
|
+
(value) => {
|
|
67
|
+
realInput.value = value;
|
|
68
|
+
if (String(value).length === comLen.value) {
|
|
69
|
+
emit("complete", value);
|
|
70
|
+
}
|
|
62
71
|
}
|
|
63
72
|
);
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
73
|
+
const close = () => {
|
|
74
|
+
emit("update:visible", false);
|
|
75
|
+
emit("close");
|
|
76
|
+
};
|
|
77
|
+
const range = (val) => {
|
|
78
|
+
return Math.min(Math.max(4, val), 6);
|
|
79
|
+
};
|
|
80
|
+
const onTips = () => {
|
|
81
|
+
emit("tips");
|
|
82
|
+
};
|
|
67
83
|
return {
|
|
68
|
-
comLen
|
|
69
|
-
realInput
|
|
70
|
-
onTouchStart
|
|
71
|
-
range
|
|
72
|
-
close
|
|
73
|
-
onTips
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
show: c,
|
|
77
|
-
translate: N
|
|
84
|
+
comLen,
|
|
85
|
+
realInput,
|
|
86
|
+
onTouchStart,
|
|
87
|
+
range,
|
|
88
|
+
close,
|
|
89
|
+
onTips,
|
|
90
|
+
show,
|
|
91
|
+
translate
|
|
78
92
|
};
|
|
79
93
|
}
|
|
80
|
-
})
|
|
94
|
+
});
|
|
95
|
+
const _hoisted_1 = { class: "nut-short-password-title" };
|
|
96
|
+
const _hoisted_2 = { class: "nut-short-password-subtitle" };
|
|
97
|
+
const _hoisted_3 = { class: "nut-short-password-wrapper" };
|
|
98
|
+
const _hoisted_4 = {
|
|
81
99
|
key: 0,
|
|
82
100
|
class: "nut-short-password__item-icon"
|
|
83
|
-
}
|
|
101
|
+
};
|
|
102
|
+
const _hoisted_5 = { class: "nut-short-password__message" };
|
|
103
|
+
const _hoisted_6 = { class: "nut-short-password--error" };
|
|
104
|
+
const _hoisted_7 = {
|
|
84
105
|
key: 0,
|
|
85
106
|
class: "nut-short-password--forget"
|
|
86
107
|
};
|
|
87
|
-
function
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
108
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
109
|
+
const _component_tips = resolveComponent("tips");
|
|
110
|
+
const _component_nut_popup = resolveComponent("nut-popup");
|
|
111
|
+
return openBlock(), createElementBlock("view", null, [
|
|
112
|
+
createVNode(_component_nut_popup, {
|
|
91
113
|
style: {
|
|
92
114
|
padding: "30px 24px 20px 24px",
|
|
93
115
|
borderRadius: "12px",
|
|
94
116
|
textAlign: "center",
|
|
95
117
|
top: "45%"
|
|
96
118
|
},
|
|
97
|
-
visible:
|
|
98
|
-
"onUpdate:visible":
|
|
99
|
-
closeable:
|
|
100
|
-
onClickCloseIcon:
|
|
101
|
-
"close-on-click-overlay":
|
|
102
|
-
onClickOverlay:
|
|
103
|
-
teleportDisable:
|
|
119
|
+
visible: _ctx.show,
|
|
120
|
+
"onUpdate:visible": _cache[2] || (_cache[2] = ($event) => _ctx.show = $event),
|
|
121
|
+
closeable: true,
|
|
122
|
+
onClickCloseIcon: _ctx.close,
|
|
123
|
+
"close-on-click-overlay": _ctx.closeOnClickOverlay,
|
|
124
|
+
onClickOverlay: _ctx.close,
|
|
125
|
+
teleportDisable: false
|
|
104
126
|
}, {
|
|
105
|
-
default:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
127
|
+
default: withCtx(() => [
|
|
128
|
+
createElementVNode("view", _hoisted_1, toDisplayString(_ctx.title || _ctx.translate("title")), 1),
|
|
129
|
+
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.desc || _ctx.translate("desc")), 1),
|
|
130
|
+
createElementVNode("div", _hoisted_3, [
|
|
131
|
+
createElementVNode("view", {
|
|
110
132
|
class: "nut-short-password__list",
|
|
111
|
-
onTouchstart:
|
|
133
|
+
onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args))
|
|
112
134
|
}, [
|
|
113
|
-
(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
135
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(new Array(_ctx.comLen), (sublen, index2) => {
|
|
136
|
+
return openBlock(), createElementBlock("view", {
|
|
137
|
+
class: "nut-short-password__item",
|
|
138
|
+
key: index2
|
|
139
|
+
}, [
|
|
140
|
+
String(_ctx.realInput).length > index2 ? (openBlock(), createElementBlock("view", _hoisted_4)) : createCommentVNode("", true)
|
|
141
|
+
]);
|
|
142
|
+
}), 128))
|
|
119
143
|
], 32)
|
|
120
144
|
]),
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
145
|
+
createElementVNode("view", _hoisted_5, [
|
|
146
|
+
createElementVNode("view", _hoisted_6, toDisplayString(_ctx.errorMsg), 1),
|
|
147
|
+
_ctx.tips || _ctx.translate("tips") ? (openBlock(), createElementBlock("view", _hoisted_7, [
|
|
148
|
+
createVNode(_component_tips, {
|
|
125
149
|
class: "icon",
|
|
126
150
|
width: "11px",
|
|
127
151
|
height: "11px"
|
|
128
152
|
}),
|
|
129
|
-
|
|
130
|
-
onClick:
|
|
131
|
-
},
|
|
132
|
-
])) :
|
|
153
|
+
createElementVNode("view", {
|
|
154
|
+
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onTips && _ctx.onTips(...args))
|
|
155
|
+
}, toDisplayString(_ctx.tips || _ctx.translate("tips")), 1)
|
|
156
|
+
])) : createCommentVNode("", true)
|
|
133
157
|
])
|
|
134
158
|
]),
|
|
135
159
|
_: 1
|
|
136
160
|
}, 8, ["visible", "onClickCloseIcon", "close-on-click-overlay", "onClickOverlay"])
|
|
137
161
|
]);
|
|
138
162
|
}
|
|
139
|
-
const
|
|
163
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
140
164
|
export {
|
|
141
|
-
|
|
165
|
+
index as default
|
|
142
166
|
};
|