@nutui/nutui 4.0.0 → 4.0.1-2.beta-1

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