@nutui/nutui 4.0.9 → 4.0.10

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