@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,9 +1,19 @@
1
- import { toRefs, inject, ref, reactive, onMounted, computed, openBlock, createElementBlock, normalizeStyle, normalizeClass, renderSlot, createCommentVNode, Fragment, createTextVNode, toDisplayString } from "vue";
2
- import { c as createComponent } from "./component-81a4c1d0.js";
3
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
1
+ var N = Object.defineProperty;
2
+ var b = Object.getOwnPropertySymbols;
3
+ var V = Object.prototype.hasOwnProperty, A = Object.prototype.propertyIsEnumerable;
4
+ var k = (o, s, r) => s in o ? N(o, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[s] = r, w = (o, s) => {
5
+ for (var r in s || (s = {}))
6
+ V.call(s, r) && k(o, r, s[r]);
7
+ if (b)
8
+ for (var r of b(s))
9
+ A.call(s, r) && k(o, r, s[r]);
10
+ return o;
11
+ };
12
+ import { toRefs as I, inject as O, ref as R, reactive as M, onMounted as T, computed as g, openBlock as L, createElementBlock as B, normalizeStyle as j, normalizeClass as D, renderSlot as E, createCommentVNode as h, Fragment as F, createTextVNode as q, toDisplayString as H } from "vue";
13
+ import { c as J } from "./component-234624bc.js";
14
+ import { _ as K } from "./_plugin-vue_export-helper-dad06003.js";
4
15
  import "../locale/lang";
5
- const { componentName, create } = createComponent("avatar");
6
- const _sfc_main = create({
16
+ const { componentName: P, create: Q } = J("avatar"), U = Q({
7
17
  props: {
8
18
  size: {
9
19
  type: String,
@@ -22,94 +32,76 @@ const _sfc_main = create({
22
32
  default: "#666"
23
33
  }
24
34
  },
25
- setup(props) {
26
- const { size, shape, bgColor, color } = toRefs(props);
27
- const sizeValue = ["large", "normal", "small"];
28
- const avatarGroup = inject("avatarGroup", null);
29
- const avatarRef = ref(null);
30
- const visible = reactive({
31
- lightTheme: false
32
- });
33
- const state = reactive({
35
+ setup(o) {
36
+ const { size: s, shape: r, bgColor: $, color: y } = I(o), C = ["large", "normal", "small"], e = O("avatarGroup", null), i = R(null), m = M({
37
+ lightTheme: !1
38
+ }), l = M({
34
39
  index: 1,
35
- showMax: false,
40
+ showMax: !1,
36
41
  // 是否显示的最大头像个数
37
42
  maxIndex: 0
38
43
  // avatarGroup里的avatar的个数
39
44
  });
40
- onMounted(() => {
41
- var _a, _b;
42
- const children = (_b = (_a = avatarGroup == null ? void 0 : avatarGroup.avatarGroupRef) == null ? void 0 : _a.value) == null ? void 0 : _b.children;
43
- if (children) {
44
- avatarLength(children);
45
- }
45
+ T(() => {
46
+ var n, a;
47
+ const t = (a = (n = e == null ? void 0 : e.avatarGroupRef) == null ? void 0 : n.value) == null ? void 0 : a.children;
48
+ t && c(t);
46
49
  });
47
- const classes = computed(() => {
48
- var _a, _b;
49
- const prefixCls = componentName;
50
+ const d = g(() => {
51
+ var n, a;
50
52
  return {
51
- [prefixCls]: true,
52
- [`nut-avatar-${size.value || ((_a = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _a.size) || "normal"}`]: true,
53
- [`nut-avatar-${shape.value || ((_b = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _b.shape) || "normal"}`]: true
53
+ [P]: !0,
54
+ [`nut-avatar-${s.value || ((n = e == null ? void 0 : e.props) == null ? void 0 : n.size) || "normal"}`]: !0,
55
+ [`nut-avatar-${r.value || ((a = e == null ? void 0 : e.props) == null ? void 0 : a.shape) || "normal"}`]: !0
54
56
  };
55
- });
56
- const styles = computed(() => {
57
- var _a, _b, _c;
57
+ }), x = g(() => {
58
+ var t, n, a;
58
59
  return {
59
- width: sizeValue.indexOf(size.value) > -1 ? "" : `${size.value}px`,
60
- height: sizeValue.indexOf(size.value) > -1 ? "" : `${size.value}px`,
61
- backgroundColor: `${bgColor.value}`,
62
- color: `${color.value}`,
63
- marginLeft: state.index != 1 && (((_a = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _a.span) ? `${(_b = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _b.span}px` : ""),
64
- zIndex: ((_c = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _c.zIndex) == "right" ? `${Math.abs(state.maxIndex - state.index)}` : ""
60
+ width: C.indexOf(s.value) > -1 ? "" : `${s.value}px`,
61
+ height: C.indexOf(s.value) > -1 ? "" : `${s.value}px`,
62
+ backgroundColor: `${$.value}`,
63
+ color: `${y.value}`,
64
+ marginLeft: l.index != 1 && ((t = e == null ? void 0 : e.props) != null && t.span ? `${(n = e == null ? void 0 : e.props) == null ? void 0 : n.span}px` : ""),
65
+ zIndex: ((a = e == null ? void 0 : e.props) == null ? void 0 : a.zIndex) == "right" ? `${Math.abs(l.maxIndex - l.index)}` : ""
65
66
  };
66
- });
67
- const maxStyles = computed(() => {
68
- var _a, _b;
67
+ }), f = g(() => {
68
+ var t, n;
69
69
  return {
70
- backgroundColor: `${(_a = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _a.maxBgColor}`,
71
- color: `${(_b = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _b.maxColor}`
70
+ backgroundColor: `${(t = e == null ? void 0 : e.props) == null ? void 0 : t.maxBgColor}`,
71
+ color: `${(n = e == null ? void 0 : e.props) == null ? void 0 : n.maxColor}`
72
72
  };
73
- });
74
- const avatarLength = (children) => {
75
- var _a, _b, _c;
76
- state.maxIndex = children.length;
77
- for (let i = 0; i < children.length; i++) {
78
- if (children[i] && children[i].classList && children[i].classList[0] == "nut-avatar") {
79
- children[i].setAttribute("data-index", i + 1);
80
- }
81
- }
82
- state.index = (_b = (_a = avatarRef == null ? void 0 : avatarRef.value) == null ? void 0 : _a.dataset) == null ? void 0 : _b.index;
83
- if (state.index == state.maxIndex && state.index != ((_c = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _c.maxCount)) {
84
- state.showMax = true;
85
- }
86
- };
87
- return {
88
- classes,
89
- styles,
90
- maxStyles,
91
- avatarGroup,
92
- visible,
93
- avatarRef,
94
- ...toRefs(state)
73
+ }), c = (t) => {
74
+ var n, a, u;
75
+ l.maxIndex = t.length;
76
+ for (let p = 0; p < t.length; p++)
77
+ t[p] && t[p].classList && t[p].classList[0] == "nut-avatar" && t[p].setAttribute("data-index", p + 1);
78
+ l.index = (a = (n = i == null ? void 0 : i.value) == null ? void 0 : n.dataset) == null ? void 0 : a.index, l.index == l.maxIndex && l.index != ((u = e == null ? void 0 : e.props) == null ? void 0 : u.maxCount) && (l.showMax = !0);
95
79
  };
80
+ return w({
81
+ classes: d,
82
+ styles: x,
83
+ maxStyles: f,
84
+ avatarGroup: e,
85
+ visible: m,
86
+ avatarRef: i
87
+ }, I(l));
96
88
  }
97
89
  });
98
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
99
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
100
- return _ctx.showMax || !((_b = (_a = _ctx.avatarGroup) == null ? void 0 : _a.props) == null ? void 0 : _b.maxCount) || _ctx.index <= ((_d = (_c = _ctx.avatarGroup) == null ? void 0 : _c.props) == null ? void 0 : _d.maxCount) ? (openBlock(), createElementBlock("view", {
90
+ function W(o, s, r, $, y, C) {
91
+ var e, i, m, l, d, x, f, c, t, n, a, u, p, v, S, z;
92
+ return o.showMax || !((i = (e = o.avatarGroup) == null ? void 0 : e.props) != null && i.maxCount) || o.index <= ((l = (m = o.avatarGroup) == null ? void 0 : m.props) == null ? void 0 : l.maxCount) ? (L(), B("view", {
101
93
  key: 0,
102
- style: normalizeStyle(!_ctx.showMax ? _ctx.styles : _ctx.maxStyles),
103
- class: normalizeClass(_ctx.classes),
94
+ style: j(o.showMax ? o.maxStyles : o.styles),
95
+ class: D(o.classes),
104
96
  ref: "avatarRef"
105
97
  }, [
106
- !((_f = (_e = _ctx.avatarGroup) == null ? void 0 : _e.props) == null ? void 0 : _f.maxCount) || _ctx.index <= ((_h = (_g = _ctx.avatarGroup) == null ? void 0 : _g.props) == null ? void 0 : _h.maxCount) ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true),
107
- _ctx.showMax && ((_j = (_i = _ctx.avatarGroup) == null ? void 0 : _i.props) == null ? void 0 : _j.maxCount) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
108
- createTextVNode(toDisplayString(((_l = (_k = _ctx.avatarGroup) == null ? void 0 : _k.props) == null ? void 0 : _l.maxContent) ? (_n = (_m = _ctx.avatarGroup) == null ? void 0 : _m.props) == null ? void 0 : _n.maxContent : `+ ${_ctx.maxIndex - ((_p = (_o = _ctx.avatarGroup) == null ? void 0 : _o.props) == null ? void 0 : _p.maxCount)}`), 1)
109
- ], 64)) : createCommentVNode("", true)
110
- ], 6)) : createCommentVNode("", true);
98
+ !((x = (d = o.avatarGroup) == null ? void 0 : d.props) != null && x.maxCount) || o.index <= ((c = (f = o.avatarGroup) == null ? void 0 : f.props) == null ? void 0 : c.maxCount) ? E(o.$slots, "default", { key: 0 }) : h("", !0),
99
+ o.showMax && ((n = (t = o.avatarGroup) == null ? void 0 : t.props) != null && n.maxCount) ? (L(), B(F, { key: 1 }, [
100
+ q(H((u = (a = o.avatarGroup) == null ? void 0 : a.props) != null && u.maxContent ? (v = (p = o.avatarGroup) == null ? void 0 : p.props) == null ? void 0 : v.maxContent : `+ ${o.maxIndex - ((z = (S = o.avatarGroup) == null ? void 0 : S.props) == null ? void 0 : z.maxCount)}`), 1)
101
+ ], 64)) : h("", !0)
102
+ ], 6)) : h("", !0);
111
103
  }
112
- const Avatar = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
104
+ const ee = /* @__PURE__ */ K(U, [["render", W]]);
113
105
  export {
114
- Avatar as default
106
+ ee as default
115
107
  };
@@ -1,9 +1,8 @@
1
- import { toRefs, ref, computed, onMounted, provide, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
2
- import { c as createComponent } from "./component-81a4c1d0.js";
3
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
1
+ import { toRefs as p, ref as a, computed as l, onMounted as u, provide as f, openBlock as i, createElementBlock as c, normalizeClass as d, renderSlot as m } from "vue";
2
+ import { c as g } from "./component-234624bc.js";
3
+ import { _ as x } from "./_plugin-vue_export-helper-dad06003.js";
4
4
  import "../locale/lang";
5
- const { componentName, create } = createComponent("avatar-group");
6
- const _sfc_main = create({
5
+ const { componentName: S, create: y } = g("avatar-group"), C = y({
7
6
  props: {
8
7
  maxContent: {
9
8
  type: String,
@@ -38,39 +37,32 @@ const _sfc_main = create({
38
37
  default: "left"
39
38
  }
40
39
  },
41
- setup(props, { emit, slots }) {
42
- toRefs(props);
43
- const avatarGroupRef = ref(null);
44
- const index2 = ref(0);
45
- const classes = computed(() => {
46
- const prefixCls = componentName;
47
- return {
48
- [prefixCls]: true
49
- };
50
- });
51
- onMounted(() => {
52
- });
53
- provide("avatarGroup", {
54
- props,
55
- avatarGroupRef,
56
- index: index2
57
- });
58
- return {
59
- classes,
40
+ setup(e, { emit: n, slots: s }) {
41
+ p(e);
42
+ const t = a(null), r = a(0), o = l(() => ({
43
+ [S]: !0
44
+ }));
45
+ return u(() => {
46
+ }), f("avatarGroup", {
47
+ props: e,
48
+ avatarGroupRef: t,
49
+ index: r
50
+ }), {
51
+ classes: o,
60
52
  // styles,
61
- avatarGroupRef
53
+ avatarGroupRef: t
62
54
  };
63
55
  }
64
56
  });
65
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
66
- return openBlock(), createElementBlock("view", {
67
- class: normalizeClass(_ctx.classes),
57
+ function _(e, n, s, t, r, o) {
58
+ return i(), c("view", {
59
+ class: d(e.classes),
68
60
  ref: "avatarGroupRef"
69
61
  }, [
70
- renderSlot(_ctx.$slots, "default")
62
+ m(e.$slots, "default")
71
63
  ], 2);
72
64
  }
73
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
65
+ const R = /* @__PURE__ */ x(C, [["render", _]]);
74
66
  export {
75
- index as default
67
+ R as default
76
68
  };
@@ -1,13 +1,12 @@
1
- import { reactive, computed, onMounted, onUnmounted, onActivated, onDeactivated, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, withModifiers, renderSlot, createVNode } from "vue";
2
- import { c as createComponent } from "./component-81a4c1d0.js";
3
- import { r as requestAniFrame, c as cancelRaf } from "./raf-729dad54.js";
4
- import { Top } from "@nutui/icons-vue";
5
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
1
+ import { reactive as k, computed as u, onMounted as b, onUnmounted as y, onActivated as w, onDeactivated as x, resolveComponent as A, openBlock as I, createElementBlock as g, normalizeClass as h, normalizeStyle as z, withModifiers as L, renderSlot as N, createVNode as $ } from "vue";
2
+ import { c as C } from "./component-234624bc.js";
3
+ import { r as p, c as B } from "./raf-a74f1a06.js";
4
+ import { Top as _ } from "@nutui/icons-vue";
5
+ import { _ as D } from "./_plugin-vue_export-helper-dad06003.js";
6
6
  import "../locale/lang";
7
- const { componentName, create } = createComponent("backtop");
8
- const _sfc_main = create({
7
+ const { componentName: M, create: S } = C("backtop"), W = S({
9
8
  components: {
10
- Top
9
+ Top: _
11
10
  },
12
11
  props: {
13
12
  bottom: {
@@ -32,7 +31,7 @@ const _sfc_main = create({
32
31
  },
33
32
  isAnimation: {
34
33
  type: Boolean,
35
- default: true
34
+ default: !0
36
35
  },
37
36
  duration: {
38
37
  type: Number,
@@ -40,109 +39,70 @@ const _sfc_main = create({
40
39
  }
41
40
  },
42
41
  emits: ["click"],
43
- setup(props, { emit }) {
44
- const state = reactive({
45
- backTop: false,
42
+ setup(t, { emit: n }) {
43
+ const e = k({
44
+ backTop: !1,
46
45
  scrollTop: 0,
47
46
  scrollEl: window,
48
47
  startTime: 0,
49
- keepAlive: false
50
- });
51
- const classes = computed(() => {
52
- const prefixCls = componentName;
53
- return {
54
- [prefixCls]: true,
55
- show: state.backTop
56
- };
57
- });
58
- const style = computed(() => {
59
- return {
60
- right: `${props.right}px`,
61
- bottom: `${props.bottom}px`,
62
- zIndex: props.zIndex
63
- };
64
- });
65
- function scrollListener() {
66
- if (state.scrollEl instanceof Window) {
67
- state.scrollTop = state.scrollEl.pageYOffset;
68
- } else {
69
- state.scrollTop = state.scrollEl.scrollTop;
70
- }
71
- state.backTop = state.scrollTop >= props.distance;
48
+ keepAlive: !1
49
+ }), s = u(() => ({
50
+ [M]: !0,
51
+ show: e.backTop
52
+ })), c = u(() => ({
53
+ right: `${t.right}px`,
54
+ bottom: `${t.bottom}px`,
55
+ zIndex: t.zIndex
56
+ }));
57
+ function l() {
58
+ e.scrollEl instanceof Window ? e.scrollTop = e.scrollEl.pageYOffset : e.scrollTop = e.scrollEl.scrollTop, e.backTop = e.scrollTop >= t.distance;
72
59
  }
73
- function scroll(y = 0) {
74
- if (state.scrollEl instanceof Window) {
75
- window.scrollTo(0, y);
76
- } else {
77
- state.scrollEl.scrollTop = y;
78
- }
60
+ function i(o = 0) {
61
+ e.scrollEl instanceof Window ? window.scrollTo(0, o) : e.scrollEl.scrollTop = o;
79
62
  }
80
- function scrollAnimation() {
81
- let cid = requestAniFrame(function fn() {
82
- var t = props.duration - Math.max(0, state.startTime - +new Date() + props.duration);
83
- var y = t * -state.scrollTop / props.duration + state.scrollTop;
84
- scroll(y);
85
- cid = requestAniFrame(fn);
86
- if (t == props.duration || y == 0) {
87
- cancelRaf(cid);
88
- }
63
+ function r() {
64
+ let o = p(function T() {
65
+ var f = t.duration - Math.max(0, e.startTime - +/* @__PURE__ */ new Date() + t.duration), m = f * -e.scrollTop / t.duration + e.scrollTop;
66
+ i(m), o = p(T), (f == t.duration || m == 0) && B(o);
89
67
  });
90
68
  }
91
- function addEventListener() {
92
- state.scrollEl.addEventListener("scroll", scrollListener, false);
93
- state.scrollEl.addEventListener("resize", scrollListener, false);
69
+ function v() {
70
+ e.scrollEl.addEventListener("scroll", l, !1), e.scrollEl.addEventListener("resize", l, !1);
94
71
  }
95
- function removeEventListener() {
96
- state.scrollEl.removeEventListener("scroll", scrollListener, false);
97
- state.scrollEl.removeEventListener("resize", scrollListener, false);
72
+ function a() {
73
+ e.scrollEl.removeEventListener("scroll", l, !1), e.scrollEl.removeEventListener("resize", l, !1);
98
74
  }
99
- function click(e) {
100
- state.startTime = +new Date();
101
- props.isAnimation && props.duration > 0 ? scrollAnimation() : scroll();
102
- emit("click", e);
75
+ function E(o) {
76
+ e.startTime = +/* @__PURE__ */ new Date(), t.isAnimation && t.duration > 0 ? r() : i(), n("click", o);
103
77
  }
104
- function init() {
105
- if (props.elId && document.getElementById(props.elId)) {
106
- state.scrollEl = document.getElementById(props.elId);
107
- }
108
- addEventListener();
78
+ function d() {
79
+ t.elId && document.getElementById(t.elId) && (e.scrollEl = document.getElementById(t.elId)), v();
109
80
  }
110
- onMounted(() => {
111
- if (props.distance == 0) {
112
- state.backTop = true;
113
- }
114
- init();
115
- });
116
- onUnmounted(() => {
117
- removeEventListener();
118
- });
119
- onActivated(() => {
120
- if (state.keepAlive) {
121
- state.keepAlive = false;
122
- init();
123
- }
124
- });
125
- onDeactivated(() => {
126
- state.keepAlive = true;
127
- removeEventListener();
128
- });
129
- return {
130
- state,
131
- classes,
132
- style,
133
- click
81
+ return b(() => {
82
+ t.distance == 0 && (e.backTop = !0), d();
83
+ }), y(() => {
84
+ a();
85
+ }), w(() => {
86
+ e.keepAlive && (e.keepAlive = !1, d());
87
+ }), x(() => {
88
+ e.keepAlive = !0, a();
89
+ }), {
90
+ state: e,
91
+ classes: s,
92
+ style: c,
93
+ click: E
134
94
  };
135
95
  }
136
96
  });
137
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
138
- const _component_Top = resolveComponent("Top");
139
- return openBlock(), createElementBlock("div", {
140
- class: normalizeClass(_ctx.classes),
141
- style: normalizeStyle(_ctx.style),
142
- onClick: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.click && _ctx.click(...args), ["stop"]))
97
+ function q(t, n, e, s, c, l) {
98
+ const i = A("Top");
99
+ return I(), g("div", {
100
+ class: h(t.classes),
101
+ style: z(t.style),
102
+ onClick: n[0] || (n[0] = L((...r) => t.click && t.click(...r), ["stop"]))
143
103
  }, [
144
- renderSlot(_ctx.$slots, "default", {}, () => [
145
- createVNode(_component_Top, {
104
+ N(t.$slots, "default", {}, () => [
105
+ $(i, {
146
106
  width: "19px",
147
107
  height: "19px",
148
108
  class: "nut-backtop-main"
@@ -150,7 +110,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
150
110
  ])
151
111
  ], 6);
152
112
  }
153
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
113
+ const j = /* @__PURE__ */ D(W, [["render", q]]);
154
114
  export {
155
- index as default
115
+ j as default
156
116
  };
@@ -1,9 +1,8 @@
1
- import { reactive, computed, openBlock, createElementBlock, withDirectives, createElementVNode, normalizeStyle, renderSlot, vShow, toDisplayString, normalizeClass } from "vue";
2
- import { c as createComponent } from "./component-81a4c1d0.js";
3
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
1
+ import { reactive as f, computed as r, openBlock as b, createElementBlock as m, withDirectives as d, createElementVNode as s, normalizeStyle as u, renderSlot as i, vShow as c, toDisplayString as p, normalizeClass as g } from "vue";
2
+ import { c as y } from "./component-234624bc.js";
3
+ import { _ as h } from "./_plugin-vue_export-helper-dad06003.js";
4
4
  import "../locale/lang";
5
- const { create } = createComponent("badge");
6
- const _sfc_main = create({
5
+ const { create: $ } = y("badge"), v = $({
7
6
  props: {
8
7
  value: {
9
8
  type: [String, Number]
@@ -14,11 +13,15 @@ const _sfc_main = create({
14
13
  },
15
14
  dot: {
16
15
  type: Boolean,
17
- default: false
16
+ default: !1
17
+ },
18
+ bubble: {
19
+ type: Boolean,
20
+ default: !1
18
21
  },
19
22
  hidden: {
20
23
  type: Boolean,
21
- default: false
24
+ default: !1
22
25
  },
23
26
  top: {
24
27
  type: String,
@@ -37,56 +40,46 @@ const _sfc_main = create({
37
40
  default: ""
38
41
  }
39
42
  },
40
- setup(props) {
41
- const state = reactive({});
42
- const stl = computed(() => {
43
- return {
44
- top: `${props.top}px`,
45
- right: `${props.right}px`,
46
- zIndex: props.zIndex,
47
- background: props.color
48
- };
49
- });
50
- const content = computed(() => {
51
- if (props.dot)
43
+ setup(e) {
44
+ const o = f({}), a = r(() => ({
45
+ top: `${e.top}px`,
46
+ right: `${e.right}px`,
47
+ zIndex: e.zIndex,
48
+ background: e.color
49
+ })), l = r(() => {
50
+ if (e.dot)
52
51
  return;
53
- const value = props.value;
54
- const max = props.max;
55
- if (typeof value === "number" && typeof max === "number") {
56
- return max < value ? `${max}+` : value;
57
- }
58
- return value;
52
+ const t = e.value, n = e.max;
53
+ return typeof t == "number" && typeof n == "number" && n < t ? `${n}+` : t;
59
54
  });
60
55
  return {
61
- state,
62
- stl,
63
- content
56
+ state: o,
57
+ stl: a,
58
+ content: l
64
59
  };
65
60
  }
66
- });
67
- const _hoisted_1 = { class: "nut-badge" };
68
- const _hoisted_2 = ["textContent"];
69
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
70
- return openBlock(), createElementBlock("view", _hoisted_1, [
71
- withDirectives(createElementVNode("view", {
61
+ }), _ = { class: "nut-badge" }, S = ["textContent"];
62
+ function B(e, o, a, l, t, n) {
63
+ return b(), m("view", _, [
64
+ d(s("view", {
72
65
  class: "nut-badge__icon",
73
- style: normalizeStyle(_ctx.stl)
66
+ style: u(e.stl)
74
67
  }, [
75
- renderSlot(_ctx.$slots, "icon")
68
+ i(e.$slots, "icon")
76
69
  ], 4), [
77
- [vShow, !_ctx.hidden && !_ctx.dot && _ctx.$slots.icon]
70
+ [c, !e.hidden && !e.dot && e.$slots.icon]
78
71
  ]),
79
- renderSlot(_ctx.$slots, "default"),
80
- withDirectives(createElementVNode("view", {
81
- textContent: toDisplayString(_ctx.content),
82
- class: normalizeClass(["nut-badge__content nut-badge__content--sup", { "nut-badge__content--dot": _ctx.dot }]),
83
- style: normalizeStyle(_ctx.stl)
84
- }, null, 14, _hoisted_2), [
85
- [vShow, !_ctx.hidden && (_ctx.content || _ctx.dot)]
72
+ i(e.$slots, "default"),
73
+ d(s("view", {
74
+ textContent: p(e.content),
75
+ class: g(["nut-badge__content nut-badge__content--sup", { "nut-badge__content--dot": e.dot, "nut-badge__content--bubble": !e.dot && e.bubble }]),
76
+ style: u(e.stl)
77
+ }, null, 14, S), [
78
+ [c, !e.hidden && (e.content || e.dot)]
86
79
  ])
87
80
  ]);
88
81
  }
89
- const Badge = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
82
+ const k = /* @__PURE__ */ h(v, [["render", B]]);
90
83
  export {
91
- Badge as default
84
+ k as default
92
85
  };