@nutui/nutui 3.1.22-beta.0 → 3.1.22-beta.3

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 (176) hide show
  1. package/dist/nutui.es.js +4019 -19251
  2. package/dist/nutui.umd.js +4012 -19344
  3. package/dist/packages/_es/ActionSheet.js +26 -157
  4. package/dist/packages/_es/Address.js +119 -542
  5. package/dist/packages/_es/AddressList.js +113 -613
  6. package/dist/packages/_es/Audio.js +62 -264
  7. package/dist/packages/_es/AudioOperate.js +18 -107
  8. package/dist/packages/_es/Avatar.js +42 -165
  9. package/dist/packages/_es/AvatarGroup.js +14 -73
  10. package/dist/packages/_es/BackTop.js +43 -156
  11. package/dist/packages/_es/Badge.js +14 -86
  12. package/dist/packages/_es/Barrage.js +41 -120
  13. package/dist/packages/_es/Button.js +23 -128
  14. package/dist/packages/_es/Calendar.js +24 -237
  15. package/dist/packages/_es/CalendarItem.js +1 -1
  16. package/dist/packages/_es/Card.js +10 -107
  17. package/dist/packages/_es/Cascader.js +156 -500
  18. package/dist/packages/_es/Category.js +15 -58
  19. package/dist/packages/_es/CategoryPane.js +11 -111
  20. package/dist/packages/_es/Cell.js +21 -100
  21. package/dist/packages/_es/CellGroup.js +9 -44
  22. package/dist/packages/_es/Checkbox.js +31 -113
  23. package/dist/packages/_es/CheckboxGroup.js +29 -58
  24. package/dist/packages/_es/CircleProgress.js +28 -151
  25. package/dist/packages/_es/Col.js +14 -56
  26. package/dist/packages/_es/Collapse.js +24 -85
  27. package/dist/packages/_es/CollapseItem.js +70 -261
  28. package/dist/packages/_es/Comment.js +64 -434
  29. package/dist/packages/_es/CountDown.js +61 -242
  30. package/dist/packages/_es/CountUp.js +149 -546
  31. package/dist/packages/_es/DatePicker.js +107 -322
  32. package/dist/packages/_es/Dialog.js +69 -261
  33. package/dist/packages/_es/Divider.js +18 -68
  34. package/dist/packages/_es/Drag.js +56 -197
  35. package/dist/packages/_es/Ecard.js +24 -159
  36. package/dist/packages/_es/Elevator.js +63 -198
  37. package/dist/packages/_es/Empty.js +12 -71
  38. package/dist/packages/_es/FixedNav.js +15 -122
  39. package/dist/packages/_es/Form.js +64 -151
  40. package/dist/packages/_es/FormItem.js +15 -110
  41. package/dist/packages/_es/Grid.js +5 -6
  42. package/dist/packages/_es/GridItem.js +33 -144
  43. package/dist/packages/_es/Icon.js +15 -40
  44. package/dist/packages/_es/ImagePreview.js +74 -298
  45. package/dist/packages/_es/Indicator.js +15 -62
  46. package/dist/packages/_es/InfiniteLoading.js +66 -258
  47. package/dist/packages/_es/Input.js +51 -413
  48. package/dist/packages/_es/InputNumber.js +41 -160
  49. package/dist/packages/_es/Layout.js +4 -5
  50. package/dist/packages/_es/List.js +23 -110
  51. package/dist/packages/_es/Menu.js +30 -118
  52. package/dist/packages/_es/MenuItem.js +34 -162
  53. package/dist/packages/_es/Navbar.js +30 -192
  54. package/dist/packages/_es/NoticeBar.js +83 -387
  55. package/dist/packages/_es/Notify.js +81 -236
  56. package/dist/packages/_es/NumberKeyboard.js +41 -272
  57. package/dist/packages/_es/OldPicker.js +140 -464
  58. package/dist/packages/_es/OverLay.js +32 -105
  59. package/dist/packages/_es/Pagination.js +39 -157
  60. package/dist/packages/_es/Picker.js +138 -459
  61. package/dist/packages/_es/Popover.js +327 -965
  62. package/dist/packages/_es/Popup.js +64 -303
  63. package/dist/packages/_es/Price.js +16 -118
  64. package/dist/packages/_es/Progress.js +14 -146
  65. package/dist/packages/_es/PullRefresh.js +92 -346
  66. package/dist/packages/_es/Radio.js +22 -90
  67. package/dist/packages/_es/RadioGroup.js +8 -37
  68. package/dist/packages/_es/Range.js +92 -417
  69. package/dist/packages/_es/Rate.js +16 -139
  70. package/dist/packages/_es/Row.js +22 -64
  71. package/dist/packages/_es/SearchBar.js +46 -247
  72. package/dist/packages/_es/ShortPassword.js +35 -225
  73. package/dist/packages/_es/SideNavBar.js +33 -89
  74. package/dist/packages/_es/SideNavBarItem.js +11 -46
  75. package/dist/packages/_es/Signature.js +46 -165
  76. package/dist/packages/_es/Skeleton.js +20 -136
  77. package/dist/packages/_es/Sku.js +93 -499
  78. package/dist/packages/_es/Step.js +25 -119
  79. package/dist/packages/_es/Steps.js +18 -53
  80. package/dist/packages/_es/Sticky.js +53 -138
  81. package/dist/packages/_es/SubSideNavBar.js +26 -90
  82. package/dist/packages/_es/Swipe.js +46 -183
  83. package/dist/packages/_es/Swiper.js +121 -433
  84. package/dist/packages/_es/SwiperItem.js +22 -53
  85. package/dist/packages/_es/Switch.js +21 -116
  86. package/dist/packages/_es/TabPane.js +12 -39
  87. package/dist/packages/_es/Tabbar.js +17 -72
  88. package/dist/packages/_es/TabbarItem.js +29 -151
  89. package/dist/packages/_es/Table.js +27 -186
  90. package/dist/packages/_es/Tabs.js +51 -209
  91. package/dist/packages/_es/Tag.js +20 -97
  92. package/dist/packages/_es/TextArea.js +42 -160
  93. package/dist/packages/_es/TimeDetail.js +23 -84
  94. package/dist/packages/_es/TimePannel.js +19 -52
  95. package/dist/packages/_es/TimeSelect.js +15 -103
  96. package/dist/packages/_es/Toast.js +80 -319
  97. package/dist/packages/_es/Uploader.js +112 -460
  98. package/dist/packages/_es/Video.js +83 -340
  99. package/dist/packages/_es/common.js +38 -128
  100. package/dist/packages/_es/component.js +35 -76
  101. package/dist/packages/_es/index.js +5 -6
  102. package/dist/packages/_es/index2.js +9 -30
  103. package/dist/packages/_es/index3.js +6 -8
  104. package/dist/packages/_es/index4.js +13 -58
  105. package/dist/packages/_es/index5.js +120 -675
  106. package/dist/packages/_es/plugin-vue_export-helper.js +7 -8
  107. package/dist/packages/_es/pxCheck.js +3 -5
  108. package/dist/packages/_es/raf.js +8 -15
  109. package/dist/packages/button/index.scss +2 -1
  110. package/dist/packages/cell/index.scss +11 -0
  111. package/dist/packages/checkbox/index.scss +6 -0
  112. package/dist/packages/dialog/index.scss +1 -0
  113. package/dist/packages/elevator/index.scss +21 -0
  114. package/dist/packages/input/index.scss +13 -1
  115. package/dist/packages/locale/lang/baseLang.d.ts +1 -0
  116. package/dist/packages/locale/lang/baseLang.js +3 -3
  117. package/dist/packages/locale/lang/en-US.d.ts +8 -0
  118. package/dist/packages/locale/lang/en-US.js +5 -97
  119. package/dist/packages/locale/lang/id-ID.d.ts +8 -0
  120. package/dist/packages/locale/lang/id-ID.js +5 -97
  121. package/dist/packages/locale/lang/index.js +16 -38
  122. package/dist/packages/locale/lang/zh-CN.d.ts +8 -0
  123. package/dist/packages/locale/lang/zh-CN.js +5 -97
  124. package/dist/packages/locale/lang/zh-TW.d.ts +8 -0
  125. package/dist/packages/locale/lang/zh-TW.js +5 -97
  126. package/dist/packages/radio/index.scss +1 -0
  127. package/dist/packages/switch/index.scss +3 -3
  128. package/dist/packages/tabpane/index.scss +1 -0
  129. package/dist/smartips/attributes.json +62 -10
  130. package/dist/smartips/tags.json +17 -4
  131. package/dist/style.css +1 -1
  132. package/dist/styles/themes/default.scss +49 -49
  133. package/dist/styles/themes/jdb.scss +49 -49
  134. package/dist/styles/themes/jdt.scss +49 -49
  135. package/dist/styles/variables-jdb.scss +10 -1
  136. package/dist/styles/variables-jdt.scss +10 -1
  137. package/dist/styles/variables.scss +10 -1
  138. package/dist/types/__VUE/address/index.vue.d.ts +5 -5
  139. package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +1 -0
  140. package/dist/types/__VUE/audiooperate/index.vue.d.ts +1 -0
  141. package/dist/types/__VUE/avatar/index.vue.d.ts +4 -4
  142. package/dist/types/__VUE/backtop/index.vue.d.ts +2 -2
  143. package/dist/types/__VUE/badge/index.vue.d.ts +2 -2
  144. package/dist/types/__VUE/button/index.vue.d.ts +2 -2
  145. package/dist/types/__VUE/cascader/index.vue.d.ts +1 -1
  146. package/dist/types/__VUE/cell/index.vue.d.ts +11 -4
  147. package/dist/types/__VUE/checkbox/common.d.ts +59 -0
  148. package/dist/types/__VUE/checkbox/index.vue.d.ts +18 -5
  149. package/dist/types/__VUE/checkboxgroup/index.vue.d.ts +7 -0
  150. package/dist/types/__VUE/collapseitem/index.vue.d.ts +2 -2
  151. package/dist/types/__VUE/dialog/index.d.ts +9 -2
  152. package/dist/types/__VUE/dialog/index.vue.d.ts +23 -8
  153. package/dist/types/__VUE/ecard/index.vue.d.ts +3 -3
  154. package/dist/types/__VUE/elevator/index.vue.d.ts +29 -0
  155. package/dist/types/__VUE/empty/index.vue.d.ts +2 -2
  156. package/dist/types/__VUE/formitem/index.vue.d.ts +3 -10
  157. package/dist/types/__VUE/grid/index.vue.d.ts +4 -4
  158. package/dist/types/__VUE/griditem/index.vue.d.ts +1 -1
  159. package/dist/types/__VUE/input/index.vue.d.ts +2 -2
  160. package/dist/types/__VUE/noticebar/index.vue.d.ts +1 -1
  161. package/dist/types/__VUE/oldpicker/index.vue.d.ts +2 -2
  162. package/dist/types/__VUE/picker/index.vue.d.ts +2 -2
  163. package/dist/types/__VUE/popover/index.vue.d.ts +2 -2
  164. package/dist/types/__VUE/range/index.vue.d.ts +1 -1
  165. package/dist/types/__VUE/rate/index.vue.d.ts +2 -2
  166. package/dist/types/__VUE/row/index.vue.d.ts +2 -2
  167. package/dist/types/__VUE/shortpassword/index.vue.d.ts +2 -2
  168. package/dist/types/__VUE/step/index.vue.d.ts +2 -2
  169. package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
  170. package/dist/types/__VUE/tabbaritem/index.vue.d.ts +2 -2
  171. package/dist/types/__VUE/timeselect/index.vue.d.ts +9 -2
  172. package/dist/types/__VUE/toast/index.vue.d.ts +3 -3
  173. package/dist/types/__VUE/uploader/index.vue.d.ts +2 -2
  174. package/dist/types/__VUE/video/index.vue.d.ts +1 -1
  175. package/dist/types/index.d.ts +1 -1
  176. package/package.json +2 -1
@@ -3,181 +3,58 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
3
  var __hasOwnProp = Object.prototype.hasOwnProperty;
4
4
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
6
+ var __spreadValues = (a2, b) => {
7
7
  for (var prop in b || (b = {}))
8
8
  if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
9
+ __defNormalProp(a2, prop, b[prop]);
10
10
  if (__getOwnPropSymbols)
11
11
  for (var prop of __getOwnPropSymbols(b)) {
12
12
  if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
13
+ __defNormalProp(a2, prop, b[prop]);
14
14
  }
15
- return a;
15
+ return a2;
16
16
  };
17
17
  /*!
18
- * @nutui/nutui v3.1.22-beta.0 Tue May 31 2022 21:47:10 GMT+0800 (中国标准时间)
18
+ * @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
19
19
  * (c) 2022 @jdf2e.
20
20
  * Released under the MIT License.
21
21
  */
22
- import { toRefs, inject, ref, reactive, onMounted, computed, resolveComponent, openBlock, createElementBlock, normalizeStyle, normalizeClass, Fragment, createBlock, createCommentVNode, renderSlot, toDisplayString } from "vue";
23
- import { c as createComponent } from "./component.js";
24
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
22
+ 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";
23
+ import { c as f } from "./component.js";
24
+ import { _ as g } from "./plugin-vue_export-helper.js";
25
25
  import "../locale/lang";
26
- const { componentName, create } = createComponent("avatar");
27
- const _sfc_main = create({
28
- props: {
29
- size: {
30
- type: String,
31
- default: ""
32
- },
33
- shape: {
34
- type: String,
35
- default: "round"
36
- },
37
- bgColor: {
38
- type: String,
39
- default: "#eee"
40
- },
41
- color: {
42
- type: String,
43
- default: "#666"
44
- },
45
- url: {
46
- type: String,
47
- default: ""
48
- },
49
- alt: {
50
- type: String,
51
- default: ""
52
- },
53
- icon: {
54
- type: String,
55
- default: ""
56
- }
57
- },
58
- emits: ["active-avatar", "onError"],
59
- setup(props, { emit, slots }) {
60
- const { size, shape, bgColor, color, icon } = toRefs(props);
61
- const sizeValue = ["large", "normal", "small"];
62
- const avatarGroup = inject("avatarGroup", null);
63
- const avatarRef = ref(null);
64
- const visible = reactive({
65
- lightTheme: false
66
- });
67
- const state = reactive({
68
- index: 1,
69
- showMax: false,
70
- maxIndex: 0
71
- });
72
- onMounted(() => {
73
- var _a, _b;
74
- const children = (_b = (_a = avatarGroup == null ? void 0 : avatarGroup.avatarGroupRef) == null ? void 0 : _a.value) == null ? void 0 : _b.children;
75
- if (children) {
76
- avatarLength(children);
77
- }
78
- });
79
- const classes = computed(() => {
80
- var _a, _b;
81
- const prefixCls = componentName;
82
- return {
83
- [prefixCls]: true,
84
- [`nut-avatar-${size.value || ((_a = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _a.size) || "normal"}`]: true,
85
- [`nut-avatar-${shape.value || ((_b = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _b.shape) || "normal"}`]: true
86
- };
87
- });
88
- const styles = computed(() => {
89
- var _a, _b, _c;
90
- return {
91
- width: sizeValue.indexOf(size.value) > -1 ? "" : `${size.value}px`,
92
- height: sizeValue.indexOf(size.value) > -1 ? "" : `${size.value}px`,
93
- backgroundColor: `${bgColor.value}`,
94
- color: `${color.value}`,
95
- 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` : ""),
96
- zIndex: ((_c = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _c.zIndex) == "right" ? `${Math.abs(state.maxIndex - state.index)}` : ""
97
- };
98
- });
99
- const maxStyles = computed(() => {
100
- var _a, _b;
101
- return {
102
- backgroundColor: `${(_a = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _a.maxBgColor}`,
103
- color: `${(_b = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _b.maxColor}`
104
- };
105
- });
106
- const iconStyles = computed(() => {
107
- return !!icon.value ? icon.value : "";
108
- });
109
- const isShowText = computed(() => {
110
- return slots.default;
111
- });
112
- const avatarLength = (children) => {
113
- var _a, _b, _c;
114
- state.maxIndex = children.length;
115
- for (let i = 0; i < children.length; i++) {
116
- if (children[i] && children[i].classList && children[i].classList[0] == "nut-avatar") {
117
- children[i].setAttribute("data-index", i + 1);
118
- }
119
- }
120
- state.index = (_b = (_a = avatarRef == null ? void 0 : avatarRef.value) == null ? void 0 : _a.dataset) == null ? void 0 : _b.index;
121
- if (state.index == state.maxIndex && state.index != ((_c = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _c.maxCount)) {
122
- state.showMax = true;
123
- }
124
- };
125
- const activeAvatar = (event) => {
126
- emit("active-avatar", event);
127
- };
128
- const onError = (event) => {
129
- emit("onError", event);
130
- };
131
- return __spreadValues({
132
- classes,
133
- styles,
134
- iconStyles,
135
- isShowText,
136
- maxStyles,
137
- activeAvatar,
138
- onError,
139
- avatarGroup,
140
- visible,
141
- avatarRef
142
- }, toRefs(state));
143
- }
144
- });
145
- const _hoisted_1 = ["src", "alt"];
146
- const _hoisted_2 = {
147
- key: 2,
148
- class: "text"
149
- };
150
- const _hoisted_3 = {
151
- key: 1,
152
- class: "text"
153
- };
154
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
26
+ 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 }) {
27
+ 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 });
28
+ o(() => {
29
+ var _a, _b;
30
+ const a2 = (_b = (_a = d2 == null ? void 0 : d2.avatarGroupRef) == null ? void 0 : _a.value) == null ? void 0 : _b.children;
31
+ a2 && k(a2);
32
+ });
33
+ const C2 = n(() => {
34
+ var _a, _b;
35
+ 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 };
36
+ }), S2 = n(() => {
37
+ var _a, _b, _c;
38
+ 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)}` : "" };
39
+ }), w2 = n(() => {
40
+ var _a, _b;
41
+ 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}` };
42
+ }), $2 = n(() => c2.value ? c2.value : ""), G2 = n(() => p2.default), k = (a2) => {
43
+ var _a, _b, _c;
44
+ y2.maxIndex = a2.length;
45
+ for (let e2 = 0; e2 < a2.length; e2++)
46
+ a2[e2] && a2[e2].classList && a2[e2].classList[0] == "nut-avatar" && a2[e2].setAttribute("data-index", e2 + 1);
47
+ 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);
48
+ };
49
+ return __spreadValues({ classes: C2, styles: S2, iconStyles: $2, isShowText: G2, maxStyles: w2, activeAvatar: (a2) => {
50
+ l2("active-avatar", a2);
51
+ }, onError: (a2) => {
52
+ l2("onError", a2);
53
+ }, avatarGroup: d2, visible: g2, avatarRef: f2 }, a(y2));
54
+ } }), S = ["src", "alt"], w = { key: 2, class: "text" }, $ = { key: 1, class: "text" };
55
+ var G = g(C, [["render", function(a2, e2, t2, r2, o2, n2) {
155
56
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
156
- const _component_nut_icon = resolveComponent("nut-icon");
157
- 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", {
158
- key: 0,
159
- style: normalizeStyle(!_ctx.showMax ? _ctx.styles : _ctx.maxStyles),
160
- class: normalizeClass(_ctx.classes),
161
- onClick: _cache[1] || (_cache[1] = ($event) => _ctx.activeAvatar(_ctx.e)),
162
- ref: "avatarRef"
163
- }, [
164
- !((_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 }, [
165
- _ctx.url ? (openBlock(), createElementBlock("img", {
166
- key: 0,
167
- src: _ctx.url,
168
- alt: _ctx.alt,
169
- onError: _cache[0] || (_cache[0] = (...args) => _ctx.onError && _ctx.onError(...args))
170
- }, null, 40, _hoisted_1)) : _ctx.icon ? (openBlock(), createBlock(_component_nut_icon, {
171
- key: 1,
172
- class: "icon",
173
- name: _ctx.iconStyles
174
- }, null, 8, ["name"])) : createCommentVNode("", true),
175
- _ctx.isShowText ? (openBlock(), createElementBlock("view", _hoisted_2, [
176
- renderSlot(_ctx.$slots, "default")
177
- ])) : createCommentVNode("", true)
178
- ], 64)) : createCommentVNode("", true),
179
- _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)
180
- ], 6)) : createCommentVNode("", true);
181
- }
182
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
183
- export { index as default };
57
+ const f2 = s("nut-icon");
58
+ 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);
59
+ }]]);
60
+ export { G as default };
@@ -1,78 +1,19 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.22-beta.0 Tue May 31 2022 21:47:10 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
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";
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";
9
9
  import "../locale/lang";
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 };
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 };
@@ -1,163 +1,50 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.22-beta.0 Tue May 31 2022 21:47:10 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
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";
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";
9
9
  import "../locale/lang";
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
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);
143
25
  };
144
26
  }
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 };
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 };
@@ -1,91 +1,19 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.22-beta.0 Tue May 31 2022 21:47:10 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
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";
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";
9
9
  import "../locale/lang";
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 };
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 };