@nutui/nutui 3.1.22-beta.5 → 3.1.23-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 (168) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +3 -4
  3. package/dist/nutui.es.js +20412 -4214
  4. package/dist/nutui.umd.js +20518 -4216
  5. package/dist/packages/_es/ActionSheet.js +149 -17
  6. package/dist/packages/_es/Address.js +535 -110
  7. package/dist/packages/_es/AddressList.js +615 -113
  8. package/dist/packages/_es/Animate.js +59 -17
  9. package/dist/packages/_es/Audio.js +257 -53
  10. package/dist/packages/_es/AudioOperate.js +100 -13
  11. package/dist/packages/_es/Avatar.js +162 -38
  12. package/dist/packages/_es/AvatarGroup.js +73 -14
  13. package/dist/packages/_es/BackTop.js +156 -43
  14. package/dist/packages/_es/Badge.js +86 -14
  15. package/dist/packages/_es/Barrage.js +120 -41
  16. package/dist/packages/_es/Button.js +128 -23
  17. package/dist/packages/_es/Calendar.js +246 -30
  18. package/dist/packages/_es/CalendarItem.js +1 -1
  19. package/dist/packages/_es/Card.js +107 -10
  20. package/dist/packages/_es/Cascader.js +496 -147
  21. package/dist/packages/_es/Category.js +58 -15
  22. package/dist/packages/_es/CategoryPane.js +111 -11
  23. package/dist/packages/_es/Cell.js +108 -21
  24. package/dist/packages/_es/CellGroup.js +44 -9
  25. package/dist/packages/_es/Checkbox.js +134 -29
  26. package/dist/packages/_es/CheckboxGroup.js +79 -29
  27. package/dist/packages/_es/CircleProgress.js +150 -28
  28. package/dist/packages/_es/Col.js +56 -14
  29. package/dist/packages/_es/Collapse.js +109 -32
  30. package/dist/packages/_es/CollapseItem.js +253 -59
  31. package/dist/packages/_es/Comment.js +434 -64
  32. package/dist/packages/_es/ConfigProvider.js +20 -8
  33. package/dist/packages/_es/CountDown.js +238 -56
  34. package/dist/packages/_es/CountUp.js +539 -140
  35. package/dist/packages/_es/DatePicker.js +315 -98
  36. package/dist/packages/_es/Dialog.js +289 -60
  37. package/dist/packages/_es/Divider.js +65 -13
  38. package/dist/packages/_es/Drag.js +197 -56
  39. package/dist/packages/_es/Ecard.js +159 -24
  40. package/dist/packages/_es/Elevator.js +255 -58
  41. package/dist/packages/_es/Ellipsis.js +200 -58
  42. package/dist/packages/_es/Empty.js +71 -12
  43. package/dist/packages/_es/FixedNav.js +122 -15
  44. package/dist/packages/_es/Form.js +151 -64
  45. package/dist/packages/_es/FormItem.js +114 -15
  46. package/dist/packages/_es/Grid.js +6 -5
  47. package/dist/packages/_es/GridItem.js +144 -33
  48. package/dist/packages/_es/Icon.js +40 -15
  49. package/dist/packages/_es/Image.js +137 -26
  50. package/dist/packages/_es/ImagePreview.js +547 -76
  51. package/dist/packages/_es/Indicator.js +62 -15
  52. package/dist/packages/_es/InfiniteLoading.js +249 -57
  53. package/dist/packages/_es/Input.js +433 -51
  54. package/dist/packages/_es/InputNumber.js +160 -41
  55. package/dist/packages/_es/Layout.js +5 -4
  56. package/dist/packages/_es/List.js +106 -18
  57. package/dist/packages/_es/Menu.js +168 -44
  58. package/dist/packages/_es/MenuItem.js +173 -37
  59. package/dist/packages/_es/Navbar.js +192 -30
  60. package/dist/packages/_es/NoticeBar.js +380 -74
  61. package/dist/packages/_es/Notify.js +227 -72
  62. package/dist/packages/_es/NumberKeyboard.js +272 -41
  63. package/dist/packages/_es/OldPicker.js +457 -130
  64. package/dist/packages/_es/OverLay.js +98 -24
  65. package/dist/packages/_es/Pagination.js +157 -39
  66. package/dist/packages/_es/Picker.js +454 -129
  67. package/dist/packages/_es/Popover.js +957 -318
  68. package/dist/packages/_es/Popup.js +299 -55
  69. package/dist/packages/_es/Price.js +118 -16
  70. package/dist/packages/_es/Progress.js +146 -14
  71. package/dist/packages/_es/PullRefresh.js +339 -84
  72. package/dist/packages/_es/Radio.js +90 -22
  73. package/dist/packages/_es/RadioGroup.js +37 -8
  74. package/dist/packages/_es/Range.js +408 -83
  75. package/dist/packages/_es/Rate.js +192 -36
  76. package/dist/packages/_es/Row.js +64 -22
  77. package/dist/packages/_es/SearchBar.js +238 -37
  78. package/dist/packages/_es/ShortPassword.js +225 -35
  79. package/dist/packages/_es/SideNavBar.js +81 -24
  80. package/dist/packages/_es/SideNavBarItem.js +46 -11
  81. package/dist/packages/_es/Signature.js +160 -41
  82. package/dist/packages/_es/Skeleton.js +136 -20
  83. package/dist/packages/_es/Sku.js +491 -84
  84. package/dist/packages/_es/Step.js +115 -20
  85. package/dist/packages/_es/Steps.js +53 -18
  86. package/dist/packages/_es/Sticky.js +138 -53
  87. package/dist/packages/_es/SubSideNavBar.js +82 -17
  88. package/dist/packages/_es/Swipe.js +178 -41
  89. package/dist/packages/_es/Swiper.js +433 -121
  90. package/dist/packages/_es/SwiperItem.js +53 -22
  91. package/dist/packages/_es/Switch.js +116 -21
  92. package/dist/packages/_es/TabPane.js +39 -12
  93. package/dist/packages/_es/Tabbar.js +72 -17
  94. package/dist/packages/_es/TabbarItem.js +151 -29
  95. package/dist/packages/_es/Table.js +178 -18
  96. package/dist/packages/_es/Tabs.js +202 -43
  97. package/dist/packages/_es/Tag.js +97 -20
  98. package/dist/packages/_es/TextArea.js +160 -42
  99. package/dist/packages/_es/TimeDetail.js +79 -18
  100. package/dist/packages/_es/TimePannel.js +48 -14
  101. package/dist/packages/_es/TimeSelect.js +112 -15
  102. package/dist/packages/_es/Toast.js +310 -71
  103. package/dist/packages/_es/Uploader.js +455 -104
  104. package/dist/packages/_es/Video.js +332 -74
  105. package/dist/packages/_es/common.js +128 -38
  106. package/dist/packages/_es/component.js +76 -35
  107. package/dist/packages/_es/index.js +6 -5
  108. package/dist/packages/_es/index2.js +30 -9
  109. package/dist/packages/_es/index3.js +8 -6
  110. package/dist/packages/_es/index4.js +64 -13
  111. package/dist/packages/_es/index5.js +780 -164
  112. package/dist/packages/_es/plugin-vue_export-helper.js +8 -7
  113. package/dist/packages/_es/pxCheck.js +5 -3
  114. package/dist/packages/_es/raf.js +15 -8
  115. package/dist/packages/imagepreview/index.scss +6 -1
  116. package/dist/packages/locale/lang/baseLang.js +3 -3
  117. package/dist/packages/locale/lang/en-US.js +105 -5
  118. package/dist/packages/locale/lang/id-ID.js +105 -5
  119. package/dist/packages/locale/lang/index.js +38 -16
  120. package/dist/packages/locale/lang/zh-CN.js +105 -5
  121. package/dist/packages/locale/lang/zh-TW.js +105 -5
  122. package/dist/packages/picker/index.scss +13 -0
  123. package/dist/smartips/attributes.json +8 -0
  124. package/dist/smartips/tags.json +3 -1
  125. package/dist/smartips/web-types.json +19 -1
  126. package/dist/style.css +1 -1
  127. package/dist/style.es.js +1 -1
  128. package/dist/styles/themes/default.scss +49 -49
  129. package/dist/styles/themes/jdb.scss +49 -49
  130. package/dist/styles/themes/jdt.scss +49 -49
  131. package/dist/styles/variables-jdb.scss +4 -1
  132. package/dist/styles/variables-jdt.scss +4 -1
  133. package/dist/styles/variables.scss +1 -1
  134. package/dist/types/__VUE/actionsheet/index.vue.d.ts +3 -3
  135. package/dist/types/__VUE/address/index.vue.d.ts +4 -4
  136. package/dist/types/__VUE/calendar/index.vue.d.ts +1 -1
  137. package/dist/types/__VUE/cascader/index.vue.d.ts +3 -3
  138. package/dist/types/__VUE/cell/index.vue.d.ts +2 -2
  139. package/dist/types/__VUE/checkbox/index.vue.d.ts +2 -2
  140. package/dist/types/__VUE/collapse/index.vue.d.ts +2 -2
  141. package/dist/types/__VUE/datepicker/index.vue.d.ts +2 -2
  142. package/dist/types/__VUE/dialog/index.vue.d.ts +2 -2
  143. package/dist/types/__VUE/ecard/index.vue.d.ts +2 -2
  144. package/dist/types/__VUE/fixednav/index.vue.d.ts +2 -2
  145. package/dist/types/__VUE/grid/index.vue.d.ts +3 -3
  146. package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +95 -0
  147. package/dist/types/__VUE/imagepreview/index.vue.d.ts +23 -25
  148. package/dist/types/__VUE/infiniteloading/index.vue.d.ts +6 -6
  149. package/dist/types/__VUE/input/index.vue.d.ts +2 -2
  150. package/dist/types/__VUE/menu/index.vue.d.ts +4 -4
  151. package/dist/types/__VUE/menuitem/index.vue.d.ts +1 -1
  152. package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +2 -2
  153. package/dist/types/__VUE/oldpicker/index.vue.d.ts +3 -3
  154. package/dist/types/__VUE/picker/index.vue.d.ts +3 -3
  155. package/dist/types/__VUE/popover/index.vue.d.ts +6 -6
  156. package/dist/types/__VUE/popup/index.vue.d.ts +4 -4
  157. package/dist/types/__VUE/range/index.vue.d.ts +1 -1
  158. package/dist/types/__VUE/rate/index.vue.d.ts +2 -2
  159. package/dist/types/__VUE/searchbar/index.vue.d.ts +2 -2
  160. package/dist/types/__VUE/shortpassword/index.vue.d.ts +1 -1
  161. package/dist/types/__VUE/sku/index.vue.d.ts +3 -3
  162. package/dist/types/__VUE/swipe/index.vue.d.ts +2 -2
  163. package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
  164. package/dist/types/__VUE/tabbar/index.vue.d.ts +2 -2
  165. package/dist/types/__VUE/textarea/index.vue.d.ts +2 -2
  166. package/dist/types/__VUE/toast/index.vue.d.ts +1 -1
  167. package/dist/types/index.d.ts +1 -1
  168. package/package.json +1 -2
@@ -1,44 +1,168 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.23-beta.1 Mon Jun 27 2022 21:39:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { toRefs as a, inject as e, ref as t, reactive as r, onMounted as o, computed as n, resolveComponent as s, openBlock as l, createElementBlock as p, normalizeStyle as u, normalizeClass as i, Fragment as x, createBlock as v, createCommentVNode as c, renderSlot as m, toDisplayString as d } from "vue";
7
- import { c as f } from "./component.js";
8
- import { _ as g } from "./plugin-vue_export-helper.js";
6
+ import { toRefs, inject, ref, reactive, onMounted, computed, resolveComponent, openBlock, createElementBlock, normalizeStyle, normalizeClass, Fragment, createBlock, createCommentVNode, renderSlot, toDisplayString } from "vue";
7
+ import { c as createComponent } from "./component.js";
8
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
9
  import "../locale/lang";
10
- const { componentName: h, create: y } = f("avatar"), C = y({ props: { size: { type: String, default: "" }, shape: { type: String, default: "round" }, bgColor: { type: String, default: "#eee" }, color: { type: String, default: "#666" }, url: { type: String, default: "" }, alt: { type: String, default: "" }, icon: { type: String, default: "" } }, emits: ["active-avatar", "onError"], setup(s2, { emit: l2, slots: p2 }) {
11
- const { size: u2, shape: i2, bgColor: x2, color: v2, icon: c2 } = a(s2), m2 = ["large", "normal", "small"], d2 = e("avatarGroup", null), f2 = t(null), g2 = r({ lightTheme: false }), y2 = r({ index: 1, showMax: false, maxIndex: 0 });
12
- o(() => {
13
- var _a, _b;
14
- const a2 = (_b = (_a = d2 == null ? void 0 : d2.avatarGroupRef) == null ? void 0 : _a.value) == null ? void 0 : _b.children;
15
- a2 && k(a2);
16
- });
17
- const C2 = n(() => {
18
- var _a, _b;
19
- return { [h]: true, [`nut-avatar-${u2.value || ((_a = d2 == null ? void 0 : d2.props) == null ? void 0 : _a.size) || "normal"}`]: true, [`nut-avatar-${i2.value || ((_b = d2 == null ? void 0 : d2.props) == null ? void 0 : _b.shape) || "normal"}`]: true };
20
- }), S2 = n(() => {
21
- var _a, _b, _c;
22
- return { width: m2.indexOf(u2.value) > -1 ? "" : `${u2.value}px`, height: m2.indexOf(u2.value) > -1 ? "" : `${u2.value}px`, backgroundColor: `${x2.value}`, color: `${v2.value}`, marginLeft: y2.index != 1 && (((_a = d2 == null ? void 0 : d2.props) == null ? void 0 : _a.span) ? `${(_b = d2 == null ? void 0 : d2.props) == null ? void 0 : _b.span}px` : ""), zIndex: ((_c = d2 == null ? void 0 : d2.props) == null ? void 0 : _c.zIndex) == "right" ? `${Math.abs(y2.maxIndex - y2.index)}` : "" };
23
- }), w2 = n(() => {
24
- var _a, _b;
25
- return { backgroundColor: `${(_a = d2 == null ? void 0 : d2.props) == null ? void 0 : _a.maxBgColor}`, color: `${(_b = d2 == null ? void 0 : d2.props) == null ? void 0 : _b.maxColor}` };
26
- }), $2 = n(() => c2.value ? c2.value : ""), G2 = n(() => p2.default), k = (a2) => {
27
- var _a, _b, _c;
28
- y2.maxIndex = a2.length;
29
- for (let e2 = 0; e2 < a2.length; e2++)
30
- a2[e2] && a2[e2].classList && a2[e2].classList[0] == "nut-avatar" && a2[e2].setAttribute("data-index", e2 + 1);
31
- y2.index = (_b = (_a = f2 == null ? void 0 : f2.value) == null ? void 0 : _a.dataset) == null ? void 0 : _b.index, y2.index == y2.maxIndex && y2.index != ((_c = d2 == null ? void 0 : d2.props) == null ? void 0 : _c.maxCount) && (y2.showMax = true);
32
- };
33
- return { classes: C2, styles: S2, iconStyles: $2, isShowText: G2, maxStyles: w2, activeAvatar: (a2) => {
34
- l2("active-avatar", a2);
35
- }, onError: (a2) => {
36
- l2("onError", a2);
37
- }, avatarGroup: d2, visible: g2, avatarRef: f2, ...a(y2) };
38
- } }), S = ["src", "alt"], w = { key: 2, class: "text" }, $ = { key: 1, class: "text" };
39
- var G = g(C, [["render", function(a2, e2, t2, r2, o2, n2) {
10
+ const { componentName, create } = createComponent("avatar");
11
+ const _sfc_main = create({
12
+ props: {
13
+ size: {
14
+ type: String,
15
+ default: ""
16
+ },
17
+ shape: {
18
+ type: String,
19
+ default: "round"
20
+ },
21
+ bgColor: {
22
+ type: String,
23
+ default: "#eee"
24
+ },
25
+ color: {
26
+ type: String,
27
+ default: "#666"
28
+ },
29
+ url: {
30
+ type: String,
31
+ default: ""
32
+ },
33
+ alt: {
34
+ type: String,
35
+ default: ""
36
+ },
37
+ icon: {
38
+ type: String,
39
+ default: ""
40
+ }
41
+ },
42
+ emits: ["active-avatar", "onError"],
43
+ setup(props, { emit, slots }) {
44
+ const { size, shape, bgColor, color, icon } = toRefs(props);
45
+ const sizeValue = ["large", "normal", "small"];
46
+ const avatarGroup = inject("avatarGroup", null);
47
+ const avatarRef = ref(null);
48
+ const visible = reactive({
49
+ lightTheme: false
50
+ });
51
+ const state = reactive({
52
+ index: 1,
53
+ showMax: false,
54
+ maxIndex: 0
55
+ });
56
+ onMounted(() => {
57
+ var _a, _b;
58
+ const children = (_b = (_a = avatarGroup == null ? void 0 : avatarGroup.avatarGroupRef) == null ? void 0 : _a.value) == null ? void 0 : _b.children;
59
+ if (children) {
60
+ avatarLength(children);
61
+ }
62
+ });
63
+ const classes = computed(() => {
64
+ var _a, _b;
65
+ const prefixCls = componentName;
66
+ return {
67
+ [prefixCls]: true,
68
+ [`nut-avatar-${size.value || ((_a = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _a.size) || "normal"}`]: true,
69
+ [`nut-avatar-${shape.value || ((_b = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _b.shape) || "normal"}`]: true
70
+ };
71
+ });
72
+ const styles = computed(() => {
73
+ var _a, _b, _c;
74
+ return {
75
+ width: sizeValue.indexOf(size.value) > -1 ? "" : `${size.value}px`,
76
+ height: sizeValue.indexOf(size.value) > -1 ? "" : `${size.value}px`,
77
+ backgroundColor: `${bgColor.value}`,
78
+ color: `${color.value}`,
79
+ 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` : ""),
80
+ zIndex: ((_c = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _c.zIndex) == "right" ? `${Math.abs(state.maxIndex - state.index)}` : ""
81
+ };
82
+ });
83
+ const maxStyles = computed(() => {
84
+ var _a, _b;
85
+ return {
86
+ backgroundColor: `${(_a = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _a.maxBgColor}`,
87
+ color: `${(_b = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _b.maxColor}`
88
+ };
89
+ });
90
+ const iconStyles = computed(() => {
91
+ return !!icon.value ? icon.value : "";
92
+ });
93
+ const isShowText = computed(() => {
94
+ return slots.default;
95
+ });
96
+ const avatarLength = (children) => {
97
+ var _a, _b, _c;
98
+ state.maxIndex = children.length;
99
+ for (let i = 0; i < children.length; i++) {
100
+ if (children[i] && children[i].classList && children[i].classList[0] == "nut-avatar") {
101
+ children[i].setAttribute("data-index", i + 1);
102
+ }
103
+ }
104
+ state.index = (_b = (_a = avatarRef == null ? void 0 : avatarRef.value) == null ? void 0 : _a.dataset) == null ? void 0 : _b.index;
105
+ if (state.index == state.maxIndex && state.index != ((_c = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _c.maxCount)) {
106
+ state.showMax = true;
107
+ }
108
+ };
109
+ const activeAvatar = (event) => {
110
+ emit("active-avatar", event);
111
+ };
112
+ const onError = (event) => {
113
+ emit("onError", event);
114
+ };
115
+ return {
116
+ classes,
117
+ styles,
118
+ iconStyles,
119
+ isShowText,
120
+ maxStyles,
121
+ activeAvatar,
122
+ onError,
123
+ avatarGroup,
124
+ visible,
125
+ avatarRef,
126
+ ...toRefs(state)
127
+ };
128
+ }
129
+ });
130
+ const _hoisted_1 = ["src", "alt"];
131
+ const _hoisted_2 = {
132
+ key: 2,
133
+ class: "text"
134
+ };
135
+ const _hoisted_3 = {
136
+ key: 1,
137
+ class: "text"
138
+ };
139
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
40
140
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
41
- const f2 = s("nut-icon");
42
- return a2.showMax || !((_b = (_a = a2.avatarGroup) == null ? void 0 : _a.props) == null ? void 0 : _b.maxCount) || a2.index <= ((_d = (_c = a2.avatarGroup) == null ? void 0 : _c.props) == null ? void 0 : _d.maxCount) ? (l(), p("view", { key: 0, style: u(a2.showMax ? a2.maxStyles : a2.styles), class: i(a2.classes), onClick: e2[1] || (e2[1] = (e3) => a2.activeAvatar(a2.e)), ref: "avatarRef" }, [!((_f = (_e = a2.avatarGroup) == null ? void 0 : _e.props) == null ? void 0 : _f.maxCount) || a2.index <= ((_h = (_g = a2.avatarGroup) == null ? void 0 : _g.props) == null ? void 0 : _h.maxCount) ? (l(), p(x, { key: 0 }, [a2.url ? (l(), p("img", { key: 0, src: a2.url, alt: a2.alt, onError: e2[0] || (e2[0] = (...e3) => a2.onError && a2.onError(...e3)) }, null, 40, S)) : a2.icon ? (l(), v(f2, { key: 1, class: "icon", name: a2.iconStyles }, null, 8, ["name"])) : c("", true), a2.isShowText ? (l(), p("view", w, [m(a2.$slots, "default")])) : c("", true)], 64)) : c("", true), a2.showMax ? (l(), p("view", $, d(((_j = (_i = a2.avatarGroup) == null ? void 0 : _i.props) == null ? void 0 : _j.maxContent) ? (_l = (_k = a2.avatarGroup) == null ? void 0 : _k.props) == null ? void 0 : _l.maxContent : "+ " + (a2.maxIndex - ((_n = (_m = a2.avatarGroup) == null ? void 0 : _m.props) == null ? void 0 : _n.maxCount))), 1)) : c("", true)], 6)) : c("", true);
43
- }]]);
44
- export { G as default };
141
+ const _component_nut_icon = resolveComponent("nut-icon");
142
+ 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", {
143
+ key: 0,
144
+ style: normalizeStyle(!_ctx.showMax ? _ctx.styles : _ctx.maxStyles),
145
+ class: normalizeClass(_ctx.classes),
146
+ onClick: _cache[1] || (_cache[1] = ($event) => _ctx.activeAvatar(_ctx.e)),
147
+ ref: "avatarRef"
148
+ }, [
149
+ !((_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) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
150
+ _ctx.url ? (openBlock(), createElementBlock("img", {
151
+ key: 0,
152
+ src: _ctx.url,
153
+ alt: _ctx.alt,
154
+ onError: _cache[0] || (_cache[0] = (...args) => _ctx.onError && _ctx.onError(...args))
155
+ }, null, 40, _hoisted_1)) : _ctx.icon ? (openBlock(), createBlock(_component_nut_icon, {
156
+ key: 1,
157
+ class: "icon",
158
+ name: _ctx.iconStyles
159
+ }, null, 8, ["name"])) : createCommentVNode("", true),
160
+ _ctx.isShowText ? (openBlock(), createElementBlock("view", _hoisted_2, [
161
+ renderSlot(_ctx.$slots, "default")
162
+ ])) : createCommentVNode("", true)
163
+ ], 64)) : createCommentVNode("", true),
164
+ _ctx.showMax ? (openBlock(), createElementBlock("view", _hoisted_3, toDisplayString(((_j = (_i = _ctx.avatarGroup) == null ? void 0 : _i.props) == null ? void 0 : _j.maxContent) ? (_l = (_k = _ctx.avatarGroup) == null ? void 0 : _k.props) == null ? void 0 : _l.maxContent : `+ ${_ctx.maxIndex - ((_n = (_m = _ctx.avatarGroup) == null ? void 0 : _m.props) == null ? void 0 : _n.maxCount)}`), 1)) : createCommentVNode("", true)
165
+ ], 6)) : createCommentVNode("", true);
166
+ }
167
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
168
+ export { index as default };
@@ -1,19 +1,78 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.23-beta.1 Mon Jun 27 2022 21:39:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { toRefs as e, ref as t, computed as a, onMounted as r, provide as o, openBlock as p, createElementBlock as n, normalizeClass as l, renderSlot as s } from "vue";
7
- import { c as u } from "./component.js";
8
- import { _ as f } from "./plugin-vue_export-helper.js";
6
+ import { toRefs, ref, computed, onMounted, provide, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
7
+ import { c as createComponent } from "./component.js";
8
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
9
  import "../locale/lang";
10
- const { componentName: i, create: m } = u("avatar-group"), d = m({ props: { maxContent: { type: String, default: "" }, maxCount: { type: [Number, String], default: "" }, maxBgColor: { type: String, default: "#eee" }, maxColor: { type: String, default: "#666" }, size: { type: String, default: "" }, shape: { type: String, default: "" }, span: { type: String, default: "-8" }, zIndex: { type: String, default: "left" } }, setup(p2, { emit: n2, slots: l2 }) {
11
- e(p2);
12
- const s2 = t(null), u2 = t(0), f2 = a(() => ({ [i]: true }));
13
- return r(() => {
14
- }), o("avatarGroup", { props: p2, avatarGroupRef: s2, index: u2 }), { classes: f2, avatarGroupRef: s2 };
15
- } });
16
- var g = f(d, [["render", function(e2, t2, a2, r2, o2, u2) {
17
- return p(), n("view", { class: l(e2.classes), ref: "avatarGroupRef" }, [s(e2.$slots, "default")], 2);
18
- }]]);
19
- export { g as default };
10
+ const { componentName, create } = createComponent("avatar-group");
11
+ const _sfc_main = create({
12
+ props: {
13
+ maxContent: {
14
+ type: String,
15
+ default: ""
16
+ },
17
+ maxCount: {
18
+ type: [Number, String],
19
+ default: ""
20
+ },
21
+ maxBgColor: {
22
+ type: String,
23
+ default: "#eee"
24
+ },
25
+ maxColor: {
26
+ type: String,
27
+ default: "#666"
28
+ },
29
+ size: {
30
+ type: String,
31
+ default: ""
32
+ },
33
+ shape: {
34
+ type: String,
35
+ default: ""
36
+ },
37
+ span: {
38
+ type: String,
39
+ default: "-8"
40
+ },
41
+ zIndex: {
42
+ type: String,
43
+ default: "left"
44
+ }
45
+ },
46
+ setup(props, { emit, slots }) {
47
+ toRefs(props);
48
+ const avatarGroupRef = ref(null);
49
+ const index2 = ref(0);
50
+ const classes = computed(() => {
51
+ const prefixCls = componentName;
52
+ return {
53
+ [prefixCls]: true
54
+ };
55
+ });
56
+ onMounted(() => {
57
+ });
58
+ provide("avatarGroup", {
59
+ props,
60
+ avatarGroupRef,
61
+ index: index2
62
+ });
63
+ return {
64
+ classes,
65
+ avatarGroupRef
66
+ };
67
+ }
68
+ });
69
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
70
+ return openBlock(), createElementBlock("view", {
71
+ class: normalizeClass(_ctx.classes),
72
+ ref: "avatarGroupRef"
73
+ }, [
74
+ renderSlot(_ctx.$slots, "default")
75
+ ], 2);
76
+ }
77
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
78
+ export { index as default };
@@ -1,50 +1,163 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.23-beta.1 Mon Jun 27 2022 21:39:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { reactive as e, computed as t, onMounted as o, onUnmounted as l, onActivated as n, onDeactivated as i, resolveComponent as r, openBlock as c, createElementBlock as s, normalizeClass as a, normalizeStyle as d, withModifiers as m, renderSlot as p, createVNode as u } from "vue";
7
- import { c as f } from "./component.js";
8
- import { _ as w } from "./plugin-vue_export-helper.js";
6
+ import { reactive, computed, onMounted, onUnmounted, onActivated, onDeactivated, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, withModifiers, renderSlot, createVNode } from "vue";
7
+ import { c as createComponent } from "./component.js";
8
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
9
  import "../locale/lang";
10
- const { componentName: k, create: E } = f("backtop");
11
- var b = w(E({ props: { bottom: { type: Number, default: 20 }, right: { type: Number, default: 10 }, elId: { type: [String, Element], default: "body" }, distance: { type: Number, default: 200 }, zIndex: { type: Number, default: 10 }, isAnimation: { type: Boolean, default: true }, duration: { type: Number, default: 1e3 } }, emits: ["click"], setup(r2, { emit: c2 }) {
12
- const s2 = e({ backTop: false, scrollTop: 0, scrollEl: window, startTime: 0, keepAlive: false }), a2 = t(() => ({ [k]: true, show: s2.backTop })), d2 = t(() => ({ right: `${r2.right}px`, bottom: `${r2.bottom}px`, zIndex: r2.zIndex }));
13
- function m2() {
14
- s2.scrollEl instanceof Window ? s2.scrollTop = s2.scrollEl.pageYOffset : s2.scrollTop = s2.scrollEl.scrollTop, s2.backTop = s2.scrollTop >= r2.distance;
15
- }
16
- function p2(e2 = 0) {
17
- s2.scrollEl instanceof Window ? window.scrollTo(0, e2) : s2.scrollEl.scrollTop = e2;
18
- }
19
- function u2() {
20
- s2.scrollEl.removeEventListener("scroll", m2, false), s2.scrollEl.removeEventListener("resize", m2, false);
21
- }
22
- function f2() {
23
- return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function(e2) {
24
- window.setTimeout(e2, 1e3 / 60);
10
+ const { componentName, create } = createComponent("backtop");
11
+ const _sfc_main = create({
12
+ props: {
13
+ bottom: {
14
+ type: Number,
15
+ default: 20
16
+ },
17
+ right: {
18
+ type: Number,
19
+ default: 10
20
+ },
21
+ elId: {
22
+ type: [String, Element],
23
+ default: "body"
24
+ },
25
+ distance: {
26
+ type: Number,
27
+ default: 200
28
+ },
29
+ zIndex: {
30
+ type: Number,
31
+ default: 10
32
+ },
33
+ isAnimation: {
34
+ type: Boolean,
35
+ default: true
36
+ },
37
+ duration: {
38
+ type: Number,
39
+ default: 1e3
40
+ }
41
+ },
42
+ emits: ["click"],
43
+ setup(props, { emit }) {
44
+ const state = reactive({
45
+ backTop: false,
46
+ scrollTop: 0,
47
+ scrollEl: window,
48
+ 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;
72
+ }
73
+ function scroll(y = 0) {
74
+ if (state.scrollEl instanceof Window) {
75
+ window.scrollTo(0, y);
76
+ } else {
77
+ state.scrollEl.scrollTop = y;
78
+ }
79
+ }
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
+ window.cancelAnimationFrame(cid);
88
+ }
89
+ });
90
+ }
91
+ function addEventListener() {
92
+ state.scrollEl.addEventListener("scroll", scrollListener, false);
93
+ state.scrollEl.addEventListener("resize", scrollListener, false);
94
+ }
95
+ function removeEventListener() {
96
+ state.scrollEl.removeEventListener("scroll", scrollListener, false);
97
+ state.scrollEl.removeEventListener("resize", scrollListener, false);
98
+ }
99
+ function initCancelAniFrame() {
100
+ window.cancelAnimationFrame = window.webkitCancelAnimationFrame;
101
+ }
102
+ function requestAniFrame() {
103
+ return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function(callback) {
104
+ window.setTimeout(callback, 1e3 / 60);
105
+ };
106
+ }
107
+ function click(e) {
108
+ state.startTime = +new Date();
109
+ props.isAnimation && props.duration > 0 ? scrollAnimation() : scroll();
110
+ emit("click", e);
111
+ }
112
+ function init() {
113
+ if (props.elId && document.getElementById(props.elId)) {
114
+ state.scrollEl = document.getElementById(props.elId);
115
+ }
116
+ addEventListener();
117
+ initCancelAniFrame();
118
+ }
119
+ onMounted(() => {
120
+ if (props.distance == 0) {
121
+ state.backTop = true;
122
+ }
123
+ init();
124
+ });
125
+ onUnmounted(() => {
126
+ removeEventListener();
127
+ });
128
+ onActivated(() => {
129
+ if (state.keepAlive) {
130
+ state.keepAlive = false;
131
+ init();
132
+ }
133
+ });
134
+ onDeactivated(() => {
135
+ state.keepAlive = true;
136
+ removeEventListener();
137
+ });
138
+ return {
139
+ state,
140
+ classes,
141
+ style,
142
+ click
25
143
  };
26
144
  }
27
- function w2() {
28
- r2.elId && document.getElementById(r2.elId) && (s2.scrollEl = document.getElementById(r2.elId)), s2.scrollEl.addEventListener("scroll", m2, false), s2.scrollEl.addEventListener("resize", m2, false), window.cancelAnimationFrame = window.webkitCancelAnimationFrame;
29
- }
30
- return o(() => {
31
- r2.distance == 0 && (s2.backTop = true), w2();
32
- }), l(() => {
33
- u2();
34
- }), n(() => {
35
- s2.keepAlive && (s2.keepAlive = false, w2());
36
- }), i(() => {
37
- s2.keepAlive = true, u2();
38
- }), { state: s2, classes: a2, style: d2, click: function(e2) {
39
- s2.startTime = +new Date(), r2.isAnimation && r2.duration > 0 ? function() {
40
- let e3 = f2()(function t2() {
41
- var o2 = r2.duration - Math.max(0, s2.startTime - +new Date() + r2.duration), l2 = o2 * -s2.scrollTop / r2.duration + s2.scrollTop;
42
- p2(l2), e3 = f2()(t2), o2 != r2.duration && l2 != 0 || window.cancelAnimationFrame(e3);
43
- });
44
- }() : p2(), c2("click", e2);
45
- } };
46
- } }), [["render", function(e2, t2, o2, l2, n2, i2) {
47
- const f2 = r("nut-icon");
48
- return c(), s("div", { class: a(e2.classes), style: d(e2.style), onClick: t2[0] || (t2[0] = m((...t3) => e2.click && e2.click(...t3), ["stop"])) }, [p(e2.$slots, "default", {}, () => [u(f2, { size: "19px", class: "nut-backtop-main", name: "top" })])], 6);
49
- }]]);
50
- export { b as default };
145
+ });
146
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
147
+ const _component_nut_icon = resolveComponent("nut-icon");
148
+ return openBlock(), createElementBlock("div", {
149
+ class: normalizeClass(_ctx.classes),
150
+ style: normalizeStyle(_ctx.style),
151
+ onClick: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.click && _ctx.click(...args), ["stop"]))
152
+ }, [
153
+ renderSlot(_ctx.$slots, "default", {}, () => [
154
+ createVNode(_component_nut_icon, {
155
+ size: "19px",
156
+ class: "nut-backtop-main",
157
+ name: "top"
158
+ })
159
+ ])
160
+ ], 6);
161
+ }
162
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
163
+ export { index as default };
@@ -1,19 +1,91 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.23-beta.1 Mon Jun 27 2022 21:39:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { reactive as t, computed as e, openBlock as o, createElementBlock as n, createElementVNode as r, renderSlot as l, withDirectives as a, toDisplayString as u, normalizeClass as p, normalizeStyle as s, vShow as d } from "vue";
7
- import { c as i } from "./component.js";
8
- import { _ as c } from "./plugin-vue_export-helper.js";
6
+ import { reactive, computed, openBlock, createElementBlock, createElementVNode, renderSlot, withDirectives, toDisplayString, normalizeClass, normalizeStyle, vShow } from "vue";
7
+ import { c as createComponent } from "./component.js";
8
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
9
  import "../locale/lang";
10
- const { create: f } = i("badge"), m = f({ props: { value: { type: [String, Number] }, max: { type: Number, default: 1e4 }, dot: { type: Boolean, default: false }, hidden: { type: Boolean, default: false }, top: { type: String, default: "0" }, right: { type: String, default: "0" }, zIndex: { type: Number, default: 9 }, color: { type: String, default: "" } }, setup: (o2) => ({ state: t({}), stl: e(() => ({ top: `${o2.top}px`, right: `${o2.right}px`, zIndex: o2.zIndex, background: o2.color })), content: e(() => {
11
- if (o2.dot)
12
- return;
13
- const t2 = o2.value, e2 = o2.max;
14
- return typeof t2 == "number" && typeof e2 == "number" && e2 < t2 ? `${e2}+` : t2;
15
- }) }) }), g = { class: "nut-badge" }, x = { class: "slot-icons" }, y = ["textContent"];
16
- var b = c(m, [["render", function(t2, e2, i2, c2, f2, m2) {
17
- return o(), n("view", g, [r("view", x, [l(t2.$slots, "icons")]), l(t2.$slots, "default"), a(r("view", { textContent: u(t2.content), class: p(["nut-badge__content sup", { "is-dot": t2.dot }]), style: s(t2.stl) }, null, 14, y), [[d, !t2.hidden && (t2.content || t2.dot)]])]);
18
- }]]);
19
- export { b as default };
10
+ const { create } = createComponent("badge");
11
+ const _sfc_main = create({
12
+ props: {
13
+ value: {
14
+ type: [String, Number]
15
+ },
16
+ max: {
17
+ type: Number,
18
+ default: 1e4
19
+ },
20
+ dot: {
21
+ type: Boolean,
22
+ default: false
23
+ },
24
+ hidden: {
25
+ type: Boolean,
26
+ default: false
27
+ },
28
+ top: {
29
+ type: String,
30
+ default: "0"
31
+ },
32
+ right: {
33
+ type: String,
34
+ default: "0"
35
+ },
36
+ zIndex: {
37
+ type: Number,
38
+ default: 9
39
+ },
40
+ color: {
41
+ type: String,
42
+ default: ""
43
+ }
44
+ },
45
+ setup(props) {
46
+ const state = reactive({});
47
+ const stl = computed(() => {
48
+ return {
49
+ top: `${props.top}px`,
50
+ right: `${props.right}px`,
51
+ zIndex: props.zIndex,
52
+ background: props.color
53
+ };
54
+ });
55
+ const content = computed(() => {
56
+ if (props.dot)
57
+ return;
58
+ const value = props.value;
59
+ const max = props.max;
60
+ if (typeof value === "number" && typeof max === "number") {
61
+ return max < value ? `${max}+` : value;
62
+ }
63
+ return value;
64
+ });
65
+ return {
66
+ state,
67
+ stl,
68
+ content
69
+ };
70
+ }
71
+ });
72
+ const _hoisted_1 = { class: "nut-badge" };
73
+ const _hoisted_2 = { class: "slot-icons" };
74
+ const _hoisted_3 = ["textContent"];
75
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
76
+ return openBlock(), createElementBlock("view", _hoisted_1, [
77
+ createElementVNode("view", _hoisted_2, [
78
+ renderSlot(_ctx.$slots, "icons")
79
+ ]),
80
+ renderSlot(_ctx.$slots, "default"),
81
+ withDirectives(createElementVNode("view", {
82
+ textContent: toDisplayString(_ctx.content),
83
+ class: normalizeClass(["nut-badge__content sup", { "is-dot": _ctx.dot }]),
84
+ style: normalizeStyle(_ctx.stl)
85
+ }, null, 14, _hoisted_3), [
86
+ [vShow, !_ctx.hidden && (_ctx.content || _ctx.dot)]
87
+ ])
88
+ ]);
89
+ }
90
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
91
+ export { index as default };