@nutui/nutui 4.0.11 → 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.
Files changed (158) hide show
  1. package/dist/nutui.es.js +1 -1
  2. package/dist/nutui.js +2 -2
  3. package/dist/nutui.umd.js +1 -1
  4. package/dist/packages/_es/ActionSheet.js +111 -78
  5. package/dist/packages/_es/Address.js +375 -250
  6. package/dist/packages/_es/AddressList.js +354 -269
  7. package/dist/packages/_es/Animate.js +58 -41
  8. package/dist/packages/_es/Audio.js +197 -128
  9. package/dist/packages/_es/AudioOperate.js +71 -60
  10. package/dist/packages/_es/Avatar.js +89 -66
  11. package/dist/packages/_es/AvatarGroup.js +31 -23
  12. package/dist/packages/_es/Backtop.js +99 -59
  13. package/dist/packages/_es/Badge.js +47 -36
  14. package/dist/packages/_es/Barrage.js +147 -68
  15. package/dist/packages/_es/Button.js +66 -47
  16. package/dist/packages/_es/Calendar.js +157 -135
  17. package/dist/packages/_es/CalendarItem.js +6 -6
  18. package/dist/packages/_es/Card.js +56 -42
  19. package/dist/packages/_es/Cascader.js +474 -315
  20. package/dist/packages/_es/Category.js +39 -29
  21. package/dist/packages/_es/CategoryPane.js +83 -57
  22. package/dist/packages/_es/Cell.js +71 -56
  23. package/dist/packages/_es/CellGroup.js +27 -19
  24. package/dist/packages/_es/Checkbox.js +156 -109
  25. package/dist/packages/_es/CheckboxGroup.js +59 -38
  26. package/dist/packages/_es/CircleProgress.js +96 -67
  27. package/dist/packages/_es/Col.js +31 -23
  28. package/dist/packages/_es/Collapse.js +58 -33
  29. package/dist/packages/_es/CollapseItem.js +108 -78
  30. package/dist/packages/_es/Comment.js +279 -207
  31. package/dist/packages/_es/ConfigProvider.js +55 -37
  32. package/dist/packages/_es/Countdown.js +212 -100
  33. package/dist/packages/_es/Countup.js +445 -232
  34. package/dist/packages/_es/DatePicker.js +265 -162
  35. package/dist/packages/_es/Dialog.js +213 -161
  36. package/dist/packages/_es/Divider.js +57 -42
  37. package/dist/packages/_es/Drag.js +153 -70
  38. package/dist/packages/_es/Ecard.js +104 -64
  39. package/dist/packages/_es/Elevator.js +219 -143
  40. package/dist/packages/_es/Ellipsis.js +178 -95
  41. package/dist/packages/_es/Empty.js +39 -23
  42. package/dist/packages/_es/FixedNav.js +116 -93
  43. package/dist/packages/_es/Form.js +178 -107
  44. package/dist/packages/_es/FormItem.js +61 -48
  45. package/dist/packages/_es/Grid.js +6 -5
  46. package/dist/packages/_es/GridItem.js +84 -58
  47. package/dist/packages/_es/Image.js +130 -90
  48. package/dist/packages/_es/ImagePreview.js +412 -256
  49. package/dist/packages/_es/Indicator.js +34 -30
  50. package/dist/packages/_es/InfiniteLoading.js +136 -83
  51. package/dist/packages/_es/Input.js +264 -160
  52. package/dist/packages/_es/InputNumber.js +117 -81
  53. package/dist/packages/_es/Interceptor-956b24fc.js +29 -0
  54. package/dist/packages/_es/Invoice.js +130 -104
  55. package/dist/packages/_es/Layout.js +4 -3
  56. package/dist/packages/_es/List.js +215 -117
  57. package/dist/packages/_es/Menu.js +150 -95
  58. package/dist/packages/_es/MenuItem.js +154 -109
  59. package/dist/packages/_es/Navbar.js +119 -103
  60. package/dist/packages/_es/Noticebar.js +312 -197
  61. package/dist/packages/_es/Notify.js +166 -110
  62. package/dist/packages/_es/NumberKeyboard.js +202 -127
  63. package/dist/packages/_es/Overlay.js +80 -52
  64. package/dist/packages/_es/Pagination.js +100 -70
  65. package/dist/packages/_es/Picker.js +437 -275
  66. package/dist/packages/_es/Popover.js +225 -122
  67. package/dist/packages/_es/Popup.js +4 -4
  68. package/dist/packages/_es/Price.js +82 -44
  69. package/dist/packages/_es/Progress.js +79 -63
  70. package/dist/packages/_es/PullRefresh.js +173 -95
  71. package/dist/packages/_es/Radio.js +4 -4
  72. package/dist/packages/_es/RadioGroup.js +3 -3
  73. package/dist/packages/_es/Range.js +347 -204
  74. package/dist/packages/_es/Rate.js +141 -92
  75. package/dist/packages/_es/Row.js +27 -21
  76. package/dist/packages/_es/Searchbar.js +174 -123
  77. package/dist/packages/_es/ShortPassword.js +93 -69
  78. package/dist/packages/_es/SideNavbar.js +80 -49
  79. package/dist/packages/_es/SideNavbarItem.js +32 -22
  80. package/dist/packages/_es/Signature.js +146 -83
  81. package/dist/packages/_es/Skeleton.js +130 -110
  82. package/dist/packages/_es/Sku.js +343 -250
  83. package/dist/packages/_es/Step.js +86 -59
  84. package/dist/packages/_es/Steps.js +31 -26
  85. package/dist/packages/_es/Sticky.js +4 -4
  86. package/dist/packages/_es/SubSideNavbar.js +74 -52
  87. package/dist/packages/_es/Swipe.js +155 -83
  88. package/dist/packages/_es/Swiper.js +311 -174
  89. package/dist/packages/_es/SwiperItem.js +44 -28
  90. package/dist/packages/_es/Switch.js +68 -55
  91. package/dist/packages/_es/TabPane.js +41 -30
  92. package/dist/packages/_es/Tabbar.js +52 -41
  93. package/dist/packages/_es/TabbarItem.js +82 -61
  94. package/dist/packages/_es/Table.js +165 -109
  95. package/dist/packages/_es/Tabs.js +388 -240
  96. package/dist/packages/_es/Tag.js +61 -44
  97. package/dist/packages/_es/Textarea.js +124 -80
  98. package/dist/packages/_es/TimeDetail.js +76 -49
  99. package/dist/packages/_es/TimePannel.js +48 -34
  100. package/dist/packages/_es/TimeSelect.js +68 -47
  101. package/dist/packages/_es/Toast.js +218 -144
  102. package/dist/packages/_es/Tour.js +192 -138
  103. package/dist/packages/_es/TrendArrow.js +77 -57
  104. package/dist/packages/_es/Uploader.js +359 -234
  105. package/dist/packages/_es/Video.js +316 -191
  106. package/dist/packages/_es/Watermark.js +117 -84
  107. package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +10 -0
  108. package/dist/packages/_es/common-b9a5e726.js +145 -0
  109. package/dist/packages/_es/component-81a4c1d0.js +145 -0
  110. package/dist/packages/_es/index-29892cda.js +33 -0
  111. package/dist/packages/_es/index-43c34ac6.js +30 -0
  112. package/dist/packages/_es/index-54d03fc1.js +8 -0
  113. package/dist/packages/_es/index-79c5dc33.js +10 -0
  114. package/dist/packages/_es/index-7a7385e4.js +67 -0
  115. package/dist/packages/_es/index-87422be8.js +942 -0
  116. package/dist/packages/_es/index-da0a7662.js +259 -0
  117. package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +46 -0
  118. package/dist/packages/_es/index.vue_vue_type_script_lang-a8856969.js +97 -0
  119. package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +151 -0
  120. package/dist/packages/_es/mountComponent-8b24c346.js +39 -0
  121. package/dist/packages/_es/pxCheck-c6b9f6b7.js +6 -0
  122. package/dist/packages/_es/raf-729dad54.js +25 -0
  123. package/dist/packages/_es/renderIcon-3d0fd47c.js +9 -0
  124. package/dist/packages/locale/lang/baseLang-3a8457ac.js +5 -0
  125. package/dist/packages/locale/lang/en-US.js +39 -36
  126. package/dist/packages/locale/lang/id-ID.js +39 -36
  127. package/dist/packages/locale/lang/index.js +44 -22
  128. package/dist/packages/locale/lang/zh-CN.js +38 -35
  129. package/dist/packages/locale/lang/zh-TW.js +38 -35
  130. package/dist/resolver/index.js +26 -1
  131. package/dist/resolver/index.mjs +17 -14
  132. package/dist/smartips/web-types.json +1 -1
  133. package/dist/style.css +1 -1
  134. package/dist/styles/themes/default.scss +48 -48
  135. package/dist/styles/themes/jdb.scss +48 -48
  136. package/dist/styles/themes/jddkh.scss +48 -48
  137. package/dist/styles/themes/jdt.scss +48 -48
  138. package/dist/types/index.d.ts +1 -1
  139. package/package.json +3 -4
  140. package/dist/packages/_es/Interceptor-6e26b757.js +0 -18
  141. package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +0 -9
  142. package/dist/packages/_es/common-d218746f.js +0 -116
  143. package/dist/packages/_es/component-234624bc.js +0 -89
  144. package/dist/packages/_es/index-14dfadc4.js +0 -561
  145. package/dist/packages/_es/index-192a3ef6.js +0 -29
  146. package/dist/packages/_es/index-360c5092.js +0 -210
  147. package/dist/packages/_es/index-496e6e05.js +0 -24
  148. package/dist/packages/_es/index-50eed3d9.js +0 -7
  149. package/dist/packages/_es/index-53ec2d4d.js +0 -34
  150. package/dist/packages/_es/index-fadb0974.js +0 -8
  151. package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +0 -43
  152. package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +0 -77
  153. package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +0 -110
  154. package/dist/packages/_es/mountComponent-6d4ff200.js +0 -23
  155. package/dist/packages/_es/pxCheck-38173291.js +0 -4
  156. package/dist/packages/_es/raf-a74f1a06.js +0 -16
  157. package/dist/packages/_es/renderIcon-47498b32.js +0 -5
  158. package/dist/packages/locale/lang/baseLang-0bdc6353.js +0 -5
@@ -1,22 +1,30 @@
1
- var D = Object.defineProperty, T = Object.defineProperties;
2
- var j = Object.getOwnPropertyDescriptors;
3
- var v = Object.getOwnPropertySymbols;
4
- var z = Object.prototype.hasOwnProperty, E = Object.prototype.propertyIsEnumerable;
5
- var S = (e, a, n) => a in e ? D(e, a, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[a] = n, h = (e, a) => {
6
- for (var n in a || (a = {}))
7
- z.call(a, n) && S(e, n, a[n]);
8
- if (v)
9
- for (var n of v(a))
10
- E.call(a, n) && S(e, n, a[n]);
11
- return e;
12
- }, C = (e, a) => T(e, j(a));
13
- import { reactive as M, computed as b, ref as $, onMounted as O, toRefs as R, openBlock as s, createElementBlock as u, normalizeStyle as f, toDisplayString as q, createCommentVNode as o, renderSlot as i, createElementVNode as c, normalizeClass as d, withModifiers as G, withDirectives as H, createBlock as J, resolveDynamicComponent as K, vShow as P } from "vue";
14
- import { c as Q } from "./component-234624bc.js";
15
- import { r as U } from "./renderIcon-47498b32.js";
16
- import { CircleClose as W } from "@nutui/icons-vue";
17
- import { _ as X } from "./_plugin-vue_export-helper-dad06003.js";
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: Y, translate: Z } = Q("searchbar"), _ = Y({
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: !0
55
+ default: true
48
56
  },
49
57
  clearIcon: {
50
58
  type: Object,
51
- default: () => W
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: !1
75
+ default: false
68
76
  },
69
77
  disabled: {
70
78
  type: Boolean,
71
- default: !1
79
+ default: false
72
80
  },
73
81
  readonly: {
74
82
  type: Boolean,
75
- default: !1
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(e, { emit: a }) {
94
- const n = M({
95
- active: !1
96
- }), p = b(() => ({
97
- background: e.background
98
- })), g = b(() => ({
99
- background: e.inputBackground
100
- })), y = (t) => {
101
- let r = t.target.value;
102
- e.maxLength && r.length > Number(e.maxLength) && (r = r.slice(0, Number(e.maxLength))), a("update:modelValue", r, t), a("change", r, t);
103
- }, l = $({}), B = (t) => {
104
- let r = t.target.value;
105
- n.active = !0, l.value = e.focusStyle, a("focus", r, t);
106
- }, w = (t) => {
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
- n.active = !1;
134
+ state.active = false;
109
135
  }, 0);
110
- let r = t.target.value;
111
- e.maxLength && r.length > Number(e.maxLength) && (r = r.slice(0, Number(e.maxLength))), l.value = {}, a("blur", r, t);
112
- }, I = (t) => {
113
- a("update:modelValue", "", t), a("change", "", t), a("clear", "");
114
- }, V = () => {
115
- a("search", e.modelValue);
116
- }, L = (t) => {
117
- a("click-input", t);
118
- }, N = (t) => {
119
- a("click-left-icon", e.modelValue, t);
120
- }, F = (t) => {
121
- a("click-right-icon", e.modelValue, t);
122
- }, A = b(() => ({
123
- textAlign: e.inputAlign
124
- })), m = $(null);
125
- return O(() => {
126
- e.autofocus && m.value.focus();
127
- }), C(h({
128
- renderIcon: U,
129
- inputsearch: m
130
- }, R(n)), {
131
- valueChange: y,
132
- valueFocus: B,
133
- valueBlur: w,
134
- handleClear: I,
135
- handleSubmit: V,
136
- searchbarStyle: p,
137
- inputSearchbarStyle: g,
138
- focusCss: l,
139
- translate: Z,
140
- clickInput: L,
141
- leftIconClick: N,
142
- rightIconClick: F,
143
- styleSearchbar: A
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
- }), x = {
192
+ });
193
+ const _hoisted_1 = {
147
194
  key: 0,
148
195
  class: "nut-searchbar__search-label"
149
- }, ee = {
196
+ };
197
+ const _hoisted_2 = {
150
198
  key: 1,
151
199
  class: "nut-searchbar__search-icon nut-searchbar__left-search-icon"
152
- }, ae = ["type", "maxlength", "placeholder", "value", "disabled", "readonly"], te = {
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
- }, le = {
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 ne(e, a, n, p, g, y) {
160
- return s(), u("view", {
210
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
211
+ return openBlock(), createElementBlock("view", {
161
212
  class: "nut-searchbar",
162
- style: f(e.searchbarStyle)
213
+ style: normalizeStyle(_ctx.searchbarStyle)
163
214
  }, [
164
- e.label ? (s(), u("span", x, q(e.label), 1)) : o("", !0),
165
- e.$slots.leftout ? (s(), u("view", ee, [
166
- i(e.$slots, "leftout")
167
- ])) : o("", !0),
168
- c("view", {
169
- class: d(["nut-searchbar__search-input", e.shape]),
170
- style: f(h(h({}, e.inputSearchbarStyle), e.focusCss))
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
- e.$slots.leftin ? (s(), u("view", {
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: a[0] || (a[0] = (...l) => e.leftIconClick && e.leftIconClick(...l))
226
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.leftIconClick && _ctx.leftIconClick(...args))
176
227
  }, [
177
- i(e.$slots, "leftin")
178
- ])) : o("", !0),
179
- c("view", {
180
- class: d(["nut-searchbar__input-inner", e.$slots.rightin && "nut-searchbar__input-inner-absolute"])
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
- c("form", {
233
+ createElementVNode("form", {
183
234
  class: "nut-searchbar__input-form",
184
235
  action: "#",
185
- onSubmit: a[5] || (a[5] = G((...l) => e.handleSubmit && e.handleSubmit(...l), ["prevent"]))
236
+ onSubmit: _cache[5] || (_cache[5] = withModifiers((...args) => _ctx.handleSubmit && _ctx.handleSubmit(...args), ["prevent"]))
186
237
  }, [
187
- c("input", {
238
+ createElementVNode("input", {
188
239
  ref: "inputsearch",
189
- class: d(["nut-searchbar__input-bar", e.clearable && "nut-searchbar__input-bar_clear"]),
190
- type: e.inputType,
191
- maxlength: e.maxLength,
192
- placeholder: e.placeholder || e.translate("placeholder"),
193
- value: e.modelValue,
194
- disabled: e.disabled,
195
- readonly: e.readonly,
196
- onClick: a[1] || (a[1] = (...l) => e.clickInput && e.clickInput(...l)),
197
- onInput: a[2] || (a[2] = (...l) => e.valueChange && e.valueChange(...l)),
198
- onFocus: a[3] || (a[3] = (...l) => e.valueFocus && e.valueFocus(...l)),
199
- onBlur: a[4] || (a[4] = (...l) => e.valueBlur && e.valueBlur(...l)),
200
- style: f(e.styleSearchbar)
201
- }, null, 46, ae)
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
- c("view", {
205
- class: d(["nut-searchbar__input-inner-icon", e.$slots.rightin && "nut-searchbar__input-inner-icon-absolute"])
255
+ createElementVNode("view", {
256
+ class: normalizeClass(["nut-searchbar__input-inner-icon", _ctx.$slots.rightin && "nut-searchbar__input-inner-icon-absolute"])
206
257
  }, [
207
- e.clearable ? H((s(), u("view", {
258
+ _ctx.clearable ? withDirectives((openBlock(), createElementBlock("view", {
208
259
  key: 0,
209
- onClick: a[6] || (a[6] = (...l) => e.handleClear && e.handleClear(...l)),
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
- e.$slots["clear-icon"] ? i(e.$slots, "clear-icon", { key: 0 }) : (s(), J(K(e.renderIcon(e.clearIcon)), { key: 1 }))
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
- [P, String(e.modelValue).length > 0]
215
- ]) : o("", !0),
216
- e.$slots.rightin ? (s(), u("view", te, [
217
- i(e.$slots, "rightin")
218
- ])) : o("", !0)
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
- e.$slots.rightout ? (s(), u("view", le, [
222
- i(e.$slots, "rightout")
223
- ])) : o("", !0)
272
+ _ctx.$slots.rightout ? (openBlock(), createElementBlock("view", _hoisted_5, [
273
+ renderSlot(_ctx.$slots, "rightout")
274
+ ])) : createCommentVNode("", true)
224
275
  ], 4);
225
276
  }
226
- const de = /* @__PURE__ */ X(_, [["render", ne]]);
277
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
227
278
  export {
228
- de as default
279
+ index as default
229
280
  };
@@ -1,14 +1,15 @@
1
- import { ref as h, computed as b, watch as w, resolveComponent as f, openBlock as r, createElementBlock as l, createVNode as v, withCtx as k, createElementVNode as n, toDisplayString as a, Fragment as C, renderList as S, createCommentVNode as g } from "vue";
2
- import { c as _ } from "./component-234624bc.js";
3
- import { P as y } from "./index-360c5092.js";
4
- import { Tips as T } from "@nutui/icons-vue";
5
- import { _ as V } from "./_plugin-vue_export-helper-dad06003.js";
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: O, translate: N } = _("short-password"), B = O({
8
+ const { create, translate } = createComponent("short-password");
9
+ const _sfc_main = create({
9
10
  components: {
10
- [y.name]: y,
11
- Tips: T
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: !1
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: !0
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(e, { emit: t }) {
50
- const p = h(e.modelValue), u = b(() => i(Number(e.length))), c = h(e.visible), m = (s) => {
51
- s.stopPropagation(), t("focus");
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
- w(
54
- () => e.visible,
55
- (s) => {
56
- c.value = s;
58
+ watch(
59
+ () => props.visible,
60
+ (value) => {
61
+ show.value = value;
57
62
  }
58
- ), w(
59
- () => e.modelValue,
60
- (s) => {
61
- p.value = s, String(s).length === u.value && t("complete", s);
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 d = () => {
65
- t("update:visible", !1), t("close");
66
- }, i = (s) => Math.min(Math.max(4, s), 6);
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: u,
69
- realInput: p,
70
- onTouchStart: m,
71
- range: i,
72
- close: d,
73
- onTips: () => {
74
- t("tips");
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
- }), I = { class: "nut-short-password-title" }, M = { class: "nut-short-password-subtitle" }, $ = { class: "nut-short-password-wrapper" }, L = {
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
- }, P = { class: "nut-short-password__message" }, A = { class: "nut-short-password--error" }, D = {
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 E(e, t, p, u, c, m) {
88
- const d = f("tips"), i = f("nut-popup");
89
- return r(), l("view", null, [
90
- v(i, {
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: e.show,
98
- "onUpdate:visible": t[2] || (t[2] = (o) => e.show = o),
99
- closeable: !0,
100
- onClickCloseIcon: e.close,
101
- "close-on-click-overlay": e.closeOnClickOverlay,
102
- onClickOverlay: e.close,
103
- teleportDisable: !1
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: k(() => [
106
- n("view", I, a(e.title || e.translate("title")), 1),
107
- n("view", M, a(e.desc || e.translate("desc")), 1),
108
- n("div", $, [
109
- n("view", {
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: t[0] || (t[0] = (...o) => e.onTouchStart && e.onTouchStart(...o))
133
+ onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args))
112
134
  }, [
113
- (r(!0), l(C, null, S(new Array(e.comLen), (o, s) => (r(), l("view", {
114
- class: "nut-short-password__item",
115
- key: s
116
- }, [
117
- String(e.realInput).length > s ? (r(), l("view", L)) : g("", !0)
118
- ]))), 128))
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
- n("view", P, [
122
- n("view", A, a(e.errorMsg), 1),
123
- e.tips || e.translate("tips") ? (r(), l("view", D, [
124
- v(d, {
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
- n("view", {
130
- onClick: t[1] || (t[1] = (...o) => e.onTips && e.onTips(...o))
131
- }, a(e.tips || e.translate("tips")), 1)
132
- ])) : g("", !0)
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 H = /* @__PURE__ */ V(B, [["render", E]]);
163
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
140
164
  export {
141
- H as default
165
+ index as default
142
166
  };