@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.
Files changed (158) hide show
  1. package/dist/nutui.es.js +1 -1
  2. package/dist/nutui.js +1 -1
  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 +50 -50
  135. package/dist/styles/themes/jdb.scss +50 -50
  136. package/dist/styles/themes/jddkh.scss +50 -50
  137. package/dist/styles/themes/jdt.scss +50 -50
  138. package/dist/types/index.d.ts +1 -1
  139. package/package.json +2 -2
  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,29 +1,50 @@
1
- var D = Object.defineProperty;
2
- var b = Object.getOwnPropertySymbols;
3
- var P = Object.prototype.hasOwnProperty, W = Object.prototype.propertyIsEnumerable;
4
- var C = (e, n, o) => n in e ? D(e, n, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[n] = o, k = (e, n) => {
5
- for (var o in n || (n = {}))
6
- P.call(n, o) && C(e, o, n[o]);
7
- if (b)
8
- for (var o of b(n))
9
- W.call(n, o) && C(e, o, n[o]);
10
- return e;
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
11
16
  };
12
- import { ref as w, reactive as O, computed as S, watch as j, onMounted as G, h as H, resolveComponent as J, openBlock as f, createElementBlock as g, normalizeClass as K, createElementVNode as s, renderSlot as p, createBlock as Q, resolveDynamicComponent as R, normalizeStyle as U, toDisplayString as V, createTextVNode as X, createCommentVNode as B, withDirectives as Y, createVNode as Z, mergeProps as x, vShow as _ } from "vue";
13
- import { c as ee } from "./component-234624bc.js";
14
- import { MaskClose as te } from "@nutui/icons-vue";
15
- import { _ as ne } from "./_plugin-vue_export-helper-dad06003.js";
17
+ import { ref, reactive, computed, watch, onMounted, h, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createBlock, resolveDynamicComponent, normalizeStyle, toDisplayString, createTextVNode, createCommentVNode, withDirectives, createVNode, mergeProps, vShow } from "vue";
18
+ import { c as createComponent } from "./component-81a4c1d0.js";
19
+ import { MaskClose } from "@nutui/icons-vue";
20
+ import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
16
21
  import "../locale/lang";
17
- function v(e, n, o) {
18
- const l = e.indexOf(n);
19
- return l === -1 ? e : n === "-" && l !== 0 ? e.slice(0, l) : e.slice(0, l + 1) + e.slice(l).replace(o, "");
22
+ function trimExtraChar(value, char, regExp) {
23
+ const index2 = value.indexOf(char);
24
+ if (index2 === -1) {
25
+ return value;
26
+ }
27
+ if (char === "-" && index2 !== 0) {
28
+ return value.slice(0, index2);
29
+ }
30
+ return value.slice(0, index2 + 1) + value.slice(index2).replace(regExp, "");
20
31
  }
21
- function L(e, n = !0, o = !0) {
22
- n ? e = v(e, ".", /\./g) : e = e.split(".")[0], o ? e = v(e, "-", /-/g) : e = e.replace(/-/, "");
23
- const l = n ? /[^-0-9.]/g : /[^-0-9]/g;
24
- return e.replace(l, "");
32
+ function formatNumber(value, allowDot = true, allowMinus = true) {
33
+ if (allowDot) {
34
+ value = trimExtraChar(value, ".", /\./g);
35
+ } else {
36
+ value = value.split(".")[0];
37
+ }
38
+ if (allowMinus) {
39
+ value = trimExtraChar(value, "-", /-/g);
40
+ } else {
41
+ value = value.replace(/-/, "");
42
+ }
43
+ const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
44
+ return value.replace(regExp, "");
25
45
  }
26
- const { componentName: oe, create: le } = ee("input"), ae = le({
46
+ const { componentName, create } = createComponent("input");
47
+ const _sfc_main = create({
27
48
  props: {
28
49
  type: {
29
50
  type: String,
@@ -43,15 +64,15 @@ const { componentName: oe, create: le } = ee("input"), ae = le({
43
64
  },
44
65
  required: {
45
66
  type: Boolean,
46
- default: !1
67
+ default: false
47
68
  },
48
69
  disabled: {
49
70
  type: Boolean,
50
- default: !1
71
+ default: false
51
72
  },
52
73
  readonly: {
53
74
  type: Boolean,
54
- default: !1
75
+ default: false
55
76
  },
56
77
  maxLength: {
57
78
  type: [String, Number],
@@ -59,7 +80,7 @@ const { componentName: oe, create: le } = ee("input"), ae = le({
59
80
  },
60
81
  clearable: {
61
82
  type: Boolean,
62
- default: !1
83
+ default: false
63
84
  },
64
85
  clearSize: {
65
86
  type: [String, Number],
@@ -67,7 +88,7 @@ const { componentName: oe, create: le } = ee("input"), ae = le({
67
88
  },
68
89
  border: {
69
90
  type: Boolean,
70
- default: !0
91
+ default: true
71
92
  },
72
93
  formatTrigger: {
73
94
  type: String,
@@ -79,11 +100,11 @@ const { componentName: oe, create: le } = ee("input"), ae = le({
79
100
  },
80
101
  showWordLimit: {
81
102
  type: Boolean,
82
- default: !1
103
+ default: false
83
104
  },
84
105
  autofocus: {
85
106
  type: Boolean,
86
- default: !1
107
+ default: false
87
108
  },
88
109
  confirmType: {
89
110
  type: String,
@@ -91,181 +112,264 @@ const { componentName: oe, create: le } = ee("input"), ae = le({
91
112
  },
92
113
  error: {
93
114
  type: Boolean,
94
- default: !1
115
+ default: false
95
116
  },
96
117
  showClearIcon: {
97
118
  type: Boolean,
98
- default: !1
119
+ default: false
99
120
  },
100
121
  class: {
101
122
  type: String,
102
123
  default: ""
103
124
  }
104
125
  },
105
- components: { MaskClose: te },
126
+ components: { MaskClose },
106
127
  emits: ["update:modelValue", "blur", "focus", "clear", "keypress", "click", "click-input"],
107
128
  expose: ["focus", "blur", "select"],
108
- setup(e, { emit: n, slots: o }) {
109
- const l = w(!1), i = w(), u = () => {
110
- var t;
111
- return String((t = e.modelValue) != null ? t : "");
112
- }, m = (t) => H("input", k({
113
- style: h
114
- }, y(t))), r = O({
115
- focused: !1,
116
- validateFailed: !1,
129
+ setup(props, { emit, slots }) {
130
+ const active = ref(false);
131
+ const inputRef = ref();
132
+ const getModelValue = () => {
133
+ var _a;
134
+ return String((_a = props.modelValue) != null ? _a : "");
135
+ };
136
+ const renderInput = (type) => {
137
+ return h("input", __spreadValues({
138
+ style: styles
139
+ }, inputType(type)));
140
+ };
141
+ const state = reactive({
142
+ focused: false,
143
+ validateFailed: false,
117
144
  // 校验失败
118
145
  validateMessage: ""
119
146
  // 校验信息
120
- }), N = S(() => {
121
- const t = oe;
147
+ });
148
+ const classes = computed(() => {
149
+ const prefixCls = componentName;
122
150
  return {
123
- [t]: !0,
124
- [`${t}--disabled`]: e.disabled,
125
- [`${t}--required`]: e.required,
126
- [`${t}--error`]: e.error,
127
- [`${t}--border`]: e.border,
128
- [e.class]: !!e.class
151
+ [prefixCls]: true,
152
+ [`${prefixCls}--disabled`]: props.disabled,
153
+ [`${prefixCls}--required`]: props.required,
154
+ [`${prefixCls}--error`]: props.error,
155
+ [`${prefixCls}--border`]: props.border,
156
+ [props.class]: !!props.class
129
157
  };
130
- }), h = S(() => ({
131
- textAlign: e.inputAlign
132
- })), y = (t) => t === "number" ? {
133
- type: "text"
134
- } : t === "digit" ? {
135
- type: "tel"
136
- } : { type: t }, $ = (t) => {
137
- if (!t.target.composing) {
138
- let a = t.target.value;
139
- e.maxLength && a.length > Number(e.maxLength) && (a = a.slice(0, Number(e.maxLength))), d(a);
158
+ });
159
+ const styles = computed(() => {
160
+ return {
161
+ textAlign: props.inputAlign
162
+ };
163
+ });
164
+ const inputType = (type) => {
165
+ if (type === "number") {
166
+ return {
167
+ type: "text"
168
+ };
169
+ }
170
+ if (type === "digit") {
171
+ return {
172
+ type: "tel"
173
+ };
140
174
  }
141
- }, d = (t, c = "onChange") => {
142
- var a;
143
- e.type === "digit" && (t = L(t, !1, !1)), e.type === "number" && (t = L(t, !0, !0)), e.formatter && c === e.formatTrigger && (t = e.formatter(t)), ((a = i == null ? void 0 : i.value) == null ? void 0 : a.value) !== t && (i.value.value = t), t !== e.modelValue && n("update:modelValue", t);
144
- }, T = (t) => {
145
- if (e.disabled || e.readonly)
175
+ return { type };
176
+ };
177
+ const onInput = (event) => {
178
+ if (!event.target.composing) {
179
+ const input = event.target;
180
+ let value = input.value;
181
+ if (props.maxLength && value.length > Number(props.maxLength)) {
182
+ value = value.slice(0, Number(props.maxLength));
183
+ }
184
+ updateValue(value);
185
+ }
186
+ };
187
+ const updateValue = (value, trigger = "onChange") => {
188
+ var _a;
189
+ if (props.type === "digit") {
190
+ value = formatNumber(value, false, false);
191
+ }
192
+ if (props.type === "number") {
193
+ value = formatNumber(value, true, true);
194
+ }
195
+ if (props.formatter && trigger === props.formatTrigger) {
196
+ value = props.formatter(value);
197
+ }
198
+ if (((_a = inputRef == null ? void 0 : inputRef.value) == null ? void 0 : _a.value) !== value) {
199
+ inputRef.value.value = value;
200
+ }
201
+ if (value !== props.modelValue) {
202
+ emit("update:modelValue", value);
203
+ }
204
+ };
205
+ const onFocus = (event) => {
206
+ if (props.disabled || props.readonly) {
146
207
  return;
147
- t.target.value, l.value = !0, n("focus", t);
148
- }, I = (t) => {
149
- if (e.disabled || e.readonly)
208
+ }
209
+ const input = event.target;
210
+ input.value;
211
+ active.value = true;
212
+ emit("focus", event);
213
+ };
214
+ const onBlur = (event) => {
215
+ if (props.disabled || props.readonly) {
150
216
  return;
217
+ }
151
218
  setTimeout(() => {
152
- l.value = !1;
219
+ active.value = false;
153
220
  }, 200);
154
- let a = t.target.value;
155
- e.maxLength && a.length > Number(e.maxLength) && (a = a.slice(0, Number(e.maxLength))), d(u(), "onBlur"), n("blur", t);
156
- }, z = (t) => {
157
- t.stopPropagation(), !e.disabled && (n("update:modelValue", "", t), n("clear", "", t));
158
- }, F = () => {
159
- r.validateFailed && (r.validateFailed = !1, r.validateMessage = "");
160
- }, M = (t) => {
161
- e.disabled || n("click-input", t);
162
- }, E = (t) => {
163
- n("click", t);
164
- }, q = ({ target: t }) => {
165
- t.composing = !0;
166
- }, A = ({ target: t }) => {
167
- t.composing && (t.composing = !1, t.dispatchEvent(new Event("input")));
221
+ const input = event.target;
222
+ let value = input.value;
223
+ if (props.maxLength && value.length > Number(props.maxLength)) {
224
+ value = value.slice(0, Number(props.maxLength));
225
+ }
226
+ updateValue(getModelValue(), "onBlur");
227
+ emit("blur", event);
168
228
  };
169
- return j(
170
- () => e.modelValue,
171
- () => {
172
- d(u()), F();
229
+ const clear = (event) => {
230
+ event.stopPropagation();
231
+ if (props.disabled)
232
+ return;
233
+ emit("update:modelValue", "", event);
234
+ emit("clear", "", event);
235
+ };
236
+ const resetValidation = () => {
237
+ if (state.validateFailed) {
238
+ state.validateFailed = false;
239
+ state.validateMessage = "";
173
240
  }
174
- ), G(() => {
175
- d(u(), e.formatTrigger);
176
- }), {
177
- renderInput: m,
178
- inputRef: i,
179
- active: l,
180
- classes: N,
181
- styles: h,
182
- inputType: y,
183
- onInput: $,
184
- onFocus: T,
185
- onBlur: I,
186
- clear: z,
187
- startComposing: q,
188
- endComposing: A,
189
- onClick: E,
190
- onClickInput: M,
191
- focus: () => {
192
- var t;
193
- (t = i.value) == null || t.focus();
194
- },
195
- blur: () => {
196
- var t;
197
- (t = i.value) == null || t.blur();
198
- },
199
- select: () => {
200
- var t;
201
- (t = i.value) == null || t.select();
241
+ };
242
+ const onClickInput = (event) => {
243
+ if (props.disabled) {
244
+ return;
202
245
  }
246
+ emit("click-input", event);
247
+ };
248
+ const onClick = (event) => {
249
+ emit("click", event);
250
+ };
251
+ const startComposing = ({ target }) => {
252
+ target.composing = true;
253
+ };
254
+ const endComposing = ({ target }) => {
255
+ if (target.composing) {
256
+ target.composing = false;
257
+ target.dispatchEvent(new Event("input"));
258
+ }
259
+ };
260
+ watch(
261
+ () => props.modelValue,
262
+ () => {
263
+ updateValue(getModelValue());
264
+ resetValidation();
265
+ }
266
+ );
267
+ onMounted(() => {
268
+ updateValue(getModelValue(), props.formatTrigger);
269
+ });
270
+ const focus = () => {
271
+ var _a;
272
+ (_a = inputRef.value) == null ? void 0 : _a.focus();
273
+ };
274
+ const blur = () => {
275
+ var _a;
276
+ (_a = inputRef.value) == null ? void 0 : _a.blur();
277
+ };
278
+ const select = () => {
279
+ var _a;
280
+ (_a = inputRef.value) == null ? void 0 : _a.select();
281
+ };
282
+ return {
283
+ renderInput,
284
+ inputRef,
285
+ active,
286
+ classes,
287
+ styles,
288
+ inputType,
289
+ onInput,
290
+ onFocus,
291
+ onBlur,
292
+ clear,
293
+ startComposing,
294
+ endComposing,
295
+ onClick,
296
+ onClickInput,
297
+ focus,
298
+ blur,
299
+ select
203
300
  };
204
301
  }
205
- }), ie = { class: "nut-input-value" }, re = { class: "nut-input-inner" }, se = { class: "nut-input-left-box" }, ue = { class: "nut-input-box" }, de = {
302
+ });
303
+ const _hoisted_1 = { class: "nut-input-value" };
304
+ const _hoisted_2 = { class: "nut-input-inner" };
305
+ const _hoisted_3 = { class: "nut-input-left-box" };
306
+ const _hoisted_4 = { class: "nut-input-box" };
307
+ const _hoisted_5 = {
206
308
  key: 0,
207
309
  class: "nut-input-word-limit"
208
- }, ce = { class: "nut-input-word-num" }, fe = { class: "nut-input-right-box" };
209
- function me(e, n, o, l, i, u) {
210
- const m = J("MaskClose");
211
- return f(), g("view", {
212
- class: K(e.classes),
213
- onClick: n[1] || (n[1] = (...r) => e.onClick && e.onClick(...r))
310
+ };
311
+ const _hoisted_6 = { class: "nut-input-word-num" };
312
+ const _hoisted_7 = { class: "nut-input-right-box" };
313
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
314
+ const _component_MaskClose = resolveComponent("MaskClose");
315
+ return openBlock(), createElementBlock("view", {
316
+ class: normalizeClass(_ctx.classes),
317
+ onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onClick && _ctx.onClick(...args))
214
318
  }, [
215
- s("view", ie, [
216
- s("view", re, [
217
- s("view", se, [
218
- p(e.$slots, "left")
319
+ createElementVNode("view", _hoisted_1, [
320
+ createElementVNode("view", _hoisted_2, [
321
+ createElementVNode("view", _hoisted_3, [
322
+ renderSlot(_ctx.$slots, "left")
219
323
  ]),
220
- s("view", ue, [
221
- (f(), Q(R(e.renderInput(e.type)), {
324
+ createElementVNode("view", _hoisted_4, [
325
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.renderInput(_ctx.type)), {
222
326
  class: "input-text",
223
327
  ref: "inputRef",
224
- style: U(e.styles),
225
- maxlength: e.maxLength,
226
- placeholder: e.placeholder,
227
- disabled: e.disabled,
228
- readonly: e.readonly,
229
- value: e.modelValue,
230
- formatTrigger: e.formatTrigger,
231
- autofocus: e.autofocus,
232
- enterkeyhint: e.confirmType,
233
- onInput: e.onInput,
234
- onFocus: e.onFocus,
235
- onBlur: e.onBlur,
236
- onClick: e.onClickInput,
237
- onChange: e.endComposing,
238
- onCompositionend: e.endComposing,
239
- onCompositionstart: e.startComposing
328
+ style: normalizeStyle(_ctx.styles),
329
+ maxlength: _ctx.maxLength,
330
+ placeholder: _ctx.placeholder,
331
+ disabled: _ctx.disabled,
332
+ readonly: _ctx.readonly,
333
+ value: _ctx.modelValue,
334
+ formatTrigger: _ctx.formatTrigger,
335
+ autofocus: _ctx.autofocus,
336
+ enterkeyhint: _ctx.confirmType,
337
+ onInput: _ctx.onInput,
338
+ onFocus: _ctx.onFocus,
339
+ onBlur: _ctx.onBlur,
340
+ onClick: _ctx.onClickInput,
341
+ onChange: _ctx.endComposing,
342
+ onCompositionend: _ctx.endComposing,
343
+ onCompositionstart: _ctx.startComposing
240
344
  }, null, 40, ["style", "maxlength", "placeholder", "disabled", "readonly", "value", "formatTrigger", "autofocus", "enterkeyhint", "onInput", "onFocus", "onBlur", "onClick", "onChange", "onCompositionend", "onCompositionstart"])),
241
- e.showWordLimit && e.maxLength ? (f(), g("view", de, [
242
- s("span", ce, V(e.modelValue ? e.modelValue.length : 0), 1),
243
- X("/" + V(e.maxLength), 1)
244
- ])) : B("", !0)
345
+ _ctx.showWordLimit && _ctx.maxLength ? (openBlock(), createElementBlock("view", _hoisted_5, [
346
+ createElementVNode("span", _hoisted_6, toDisplayString(_ctx.modelValue ? _ctx.modelValue.length : 0), 1),
347
+ createTextVNode("/" + toDisplayString(_ctx.maxLength), 1)
348
+ ])) : createCommentVNode("", true)
245
349
  ]),
246
- e.clearable && !e.readonly ? Y((f(), g("view", {
350
+ _ctx.clearable && !_ctx.readonly ? withDirectives((openBlock(), createElementBlock("view", {
247
351
  key: 0,
248
352
  class: "nut-input-clear-box",
249
- onClick: n[0] || (n[0] = (...r) => e.clear && e.clear(...r))
353
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.clear && _ctx.clear(...args))
250
354
  }, [
251
- p(e.$slots, "clear", {}, () => [
252
- Z(m, x({ class: "nut-input-clear" }, e.$attrs, {
253
- size: e.clearSize,
254
- width: e.clearSize,
255
- height: e.clearSize
355
+ renderSlot(_ctx.$slots, "clear", {}, () => [
356
+ createVNode(_component_MaskClose, mergeProps({ class: "nut-input-clear" }, _ctx.$attrs, {
357
+ size: _ctx.clearSize,
358
+ width: _ctx.clearSize,
359
+ height: _ctx.clearSize
256
360
  }), null, 16, ["size", "width", "height"])
257
361
  ])
258
362
  ], 512)), [
259
- [_, (e.active || e.showClearIcon) && e.modelValue.length > 0]
260
- ]) : B("", !0),
261
- s("view", fe, [
262
- p(e.$slots, "right")
363
+ [vShow, (_ctx.active || _ctx.showClearIcon) && _ctx.modelValue.length > 0]
364
+ ]) : createCommentVNode("", true),
365
+ createElementVNode("view", _hoisted_7, [
366
+ renderSlot(_ctx.$slots, "right")
263
367
  ])
264
368
  ])
265
369
  ])
266
370
  ], 2);
267
371
  }
268
- const Ve = /* @__PURE__ */ ne(ae, [["render", me]]);
372
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
269
373
  export {
270
- Ve as default
374
+ index as default
271
375
  };