@nutui/nutui 4.1.0-beta.5 → 4.1.0

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 (134) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/nutui.es.js +1 -1
  3. package/dist/nutui.js +4651 -4662
  4. package/dist/nutui.umd.js +1 -1
  5. package/dist/packages/_es/ActionSheet.js +2 -2
  6. package/dist/packages/_es/Address.js +4 -3
  7. package/dist/packages/_es/AddressList.js +1 -1
  8. package/dist/packages/_es/Animate.js +1 -1
  9. package/dist/packages/_es/Audio.js +1 -1
  10. package/dist/packages/_es/AudioOperate.js +1 -1
  11. package/dist/packages/_es/Avatar.js +17 -79
  12. package/dist/packages/_es/AvatarGroup.js +91 -19
  13. package/dist/packages/_es/Backtop.js +1 -1
  14. package/dist/packages/_es/Badge.js +1 -1
  15. package/dist/packages/_es/Barrage.js +1 -1
  16. package/dist/packages/_es/Button.js +1 -1
  17. package/dist/packages/_es/Calendar.js +22 -24
  18. package/dist/packages/_es/CalendarItem.js +2 -2
  19. package/dist/packages/_es/Card.js +1 -1
  20. package/dist/packages/_es/Cascader.js +2 -2
  21. package/dist/packages/_es/Category.js +1 -1
  22. package/dist/packages/_es/CategoryPane.js +1 -1
  23. package/dist/packages/_es/Cell.js +1 -1
  24. package/dist/packages/_es/CellGroup.js +1 -1
  25. package/dist/packages/_es/Checkbox.js +1 -1
  26. package/dist/packages/_es/CheckboxGroup.js +1 -1
  27. package/dist/packages/_es/CircleProgress.js +1 -1
  28. package/dist/packages/_es/Col.js +1 -1
  29. package/dist/packages/_es/Collapse.js +1 -1
  30. package/dist/packages/_es/CollapseItem.js +1 -1
  31. package/dist/packages/_es/Comment.js +1 -1
  32. package/dist/packages/_es/ConfigProvider.js +1 -1
  33. package/dist/packages/_es/Countdown.js +1 -1
  34. package/dist/packages/_es/Countup.js +1 -1
  35. package/dist/packages/_es/DatePicker.js +1 -1
  36. package/dist/packages/_es/Dialog.js +4 -4
  37. package/dist/packages/_es/Divider.js +1 -1
  38. package/dist/packages/_es/Drag.js +1 -1
  39. package/dist/packages/_es/Ecard.js +1 -1
  40. package/dist/packages/_es/Elevator.js +1 -1
  41. package/dist/packages/_es/Ellipsis.js +1 -1
  42. package/dist/packages/_es/Empty.js +1 -1
  43. package/dist/packages/_es/FixedNav.js +1 -1
  44. package/dist/packages/_es/Form.js +26 -21
  45. package/dist/packages/_es/FormItem.js +1 -1
  46. package/dist/packages/_es/Grid.js +2 -2
  47. package/dist/packages/_es/GridItem.js +2 -2
  48. package/dist/packages/_es/Image.js +1 -1
  49. package/dist/packages/_es/ImagePreview.js +4 -4
  50. package/dist/packages/_es/Indicator.js +1 -1
  51. package/dist/packages/_es/InfiniteLoading.js +1 -1
  52. package/dist/packages/_es/Input.js +1 -1
  53. package/dist/packages/_es/InputNumber.js +23 -2
  54. package/dist/packages/_es/{Interceptor-883a3078.js → Interceptor-c05a39f2.js} +1 -1
  55. package/dist/packages/_es/Invoice.js +3 -3
  56. package/dist/packages/_es/Layout.js +1 -1
  57. package/dist/packages/_es/List.js +1 -1
  58. package/dist/packages/_es/Menu.js +1 -1
  59. package/dist/packages/_es/MenuItem.js +2 -2
  60. package/dist/packages/_es/Navbar.js +42 -89
  61. package/dist/packages/_es/Noticebar.js +1 -1
  62. package/dist/packages/_es/Notify.js +2 -2
  63. package/dist/packages/_es/NumberKeyboard.js +2 -2
  64. package/dist/packages/_es/Overlay.js +1 -1
  65. package/dist/packages/_es/Pagination.js +1 -1
  66. package/dist/packages/_es/Picker.js +1 -1
  67. package/dist/packages/_es/Popover.js +2 -2
  68. package/dist/packages/_es/Popup.js +2 -2
  69. package/dist/packages/_es/Price.js +1 -1
  70. package/dist/packages/_es/Progress.js +1 -1
  71. package/dist/packages/_es/PullRefresh.js +1 -1
  72. package/dist/packages/_es/Radio.js +2 -2
  73. package/dist/packages/_es/RadioGroup.js +2 -2
  74. package/dist/packages/_es/Range.js +1 -1
  75. package/dist/packages/_es/Rate.js +1 -1
  76. package/dist/packages/_es/Row.js +1 -1
  77. package/dist/packages/_es/Searchbar.js +1 -1
  78. package/dist/packages/_es/ShortPassword.js +2 -2
  79. package/dist/packages/_es/SideNavbar.js +1 -1
  80. package/dist/packages/_es/SideNavbarItem.js +1 -1
  81. package/dist/packages/_es/Signature.js +1 -1
  82. package/dist/packages/_es/Skeleton.js +1 -1
  83. package/dist/packages/_es/Sku.js +2 -2
  84. package/dist/packages/_es/Step.js +1 -1
  85. package/dist/packages/_es/Steps.js +1 -1
  86. package/dist/packages/_es/Sticky.js +5 -1
  87. package/dist/packages/_es/SubSideNavbar.js +1 -1
  88. package/dist/packages/_es/Swipe.js +1 -1
  89. package/dist/packages/_es/Swiper.js +1 -1
  90. package/dist/packages/_es/SwiperItem.js +1 -1
  91. package/dist/packages/_es/Switch.js +1 -1
  92. package/dist/packages/_es/TabPane.js +1 -1
  93. package/dist/packages/_es/Tabbar.js +1 -1
  94. package/dist/packages/_es/TabbarItem.js +1 -1
  95. package/dist/packages/_es/Table.js +1 -1
  96. package/dist/packages/_es/Tabs.js +1 -1
  97. package/dist/packages/_es/Tag.js +1 -1
  98. package/dist/packages/_es/Textarea.js +1 -1
  99. package/dist/packages/_es/TimeDetail.js +1 -1
  100. package/dist/packages/_es/TimePannel.js +1 -1
  101. package/dist/packages/_es/TimeSelect.js +2 -2
  102. package/dist/packages/_es/Toast.js +2 -2
  103. package/dist/packages/_es/Tour.js +2 -2
  104. package/dist/packages/_es/TrendArrow.js +1 -1
  105. package/dist/packages/_es/Uploader.js +25 -18
  106. package/dist/packages/_es/Video.js +1 -1
  107. package/dist/packages/_es/Watermark.js +1 -1
  108. package/dist/packages/_es/{common-3cfd9c50.js → common-8775d905.js} +1 -1
  109. package/dist/packages/_es/{component-470275dd.js → component-0fbad28e.js} +2 -2
  110. package/dist/packages/_es/{index-02204c4b.js → index-3a5098e4.js} +14 -12
  111. package/dist/packages/_es/{index-412323a0.js → index-5ffbc437.js} +1 -1
  112. package/dist/packages/_es/{index.vue_vue_type_script_lang-0b4f12ed.js → index.vue_vue_type_script_lang-2852286e.js} +1 -1
  113. package/dist/packages/_es/{index.vue_vue_type_script_lang-9ebe2e75.js → index.vue_vue_type_script_lang-cdf21a24.js} +1 -1
  114. package/dist/packages/_es/{mountComponent-f893becf.js → mountComponent-a895e3f1.js} +1 -1
  115. package/dist/packages/avatargroup/index.scss +0 -3
  116. package/dist/packages/navbar/index.scss +1 -0
  117. package/dist/smartips/web-types.json +132 -6
  118. package/dist/style.css +1 -1
  119. package/dist/styles/themes/default.scss +51 -153
  120. package/dist/styles/themes/jdb.scss +51 -153
  121. package/dist/styles/themes/jddkh.scss +51 -153
  122. package/dist/styles/themes/jdt.scss +51 -153
  123. package/dist/types/__VUE/avatar/index.vue.d.ts +11 -27
  124. package/dist/types/__VUE/avatar/types.d.ts +3 -0
  125. package/dist/types/__VUE/avatargroup/index.vue.d.ts +18 -15
  126. package/dist/types/__VUE/calendar/index.vue.d.ts +1 -1
  127. package/dist/types/__VUE/calendaritem/index.vue.d.ts +7 -8
  128. package/dist/types/__VUE/calendaritem/type.d.ts +0 -1
  129. package/dist/types/__VUE/form/common.d.ts +2 -2
  130. package/dist/types/__VUE/form/index.vue.d.ts +4 -4
  131. package/dist/types/__VUE/navbar/index.vue.d.ts +8 -5
  132. package/dist/types/__VUE/uploader/index.vue.d.ts +40 -4
  133. package/dist/types/index.d.ts +1 -1
  134. package/package.json +1 -1
@@ -17,9 +17,9 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { c as createComponent } from "./component-470275dd.js";
20
+ import { c as createComponent } from "./component-0fbad28e.js";
21
21
  import { useSlots, computed, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, normalizeClass, createElementBlock, toDisplayString, createCommentVNode, renderSlot, Fragment, renderList, normalizeStyle } from "vue";
22
- import { P as Popup, p as popupProps } from "./index-412323a0.js";
22
+ import { P as Popup, p as popupProps } from "./index-5ffbc437.js";
23
23
  import { Loading } from "@nutui/icons-vue";
24
24
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
25
25
  import "../locale/lang";
@@ -18,8 +18,8 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { ref, reactive, computed, watch, toRefs, nextTick, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, renderSlot, withDirectives, createVNode, vShow, toDisplayString, createElementBlock, Fragment, renderList, normalizeClass, createCommentVNode, normalizeStyle, createTextVNode } from "vue";
21
- import { c as createComponent } from "./component-470275dd.js";
22
- import { P as Popup, p as popupProps } from "./index-412323a0.js";
21
+ import { c as createComponent } from "./component-0fbad28e.js";
22
+ import { P as Popup, p as popupProps } from "./index-5ffbc437.js";
23
23
  import Elevator from "./Elevator.js";
24
24
  import { Location, Location2, Check, Close, Left } from "@nutui/icons-vue";
25
25
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
@@ -391,6 +391,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
391
391
  return openBlock(), createBlock(_component_nut_popup, {
392
392
  position: "bottom",
393
393
  "lock-scroll": _ctx.lockScroll,
394
+ round: _ctx.round,
394
395
  onClose: _ctx.close,
395
396
  onClickOverlay: _ctx.clickOverlay,
396
397
  onOpen: _cache[3] || (_cache[3] = ($event) => _ctx.closeWay = "self"),
@@ -517,7 +518,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
517
518
  ])
518
519
  ]),
519
520
  _: 3
520
- }, 8, ["lock-scroll", "onClose", "onClickOverlay", "visible", "teleportDisable", "teleport"]);
521
+ }, 8, ["lock-scroll", "round", "onClose", "onClickOverlay", "visible", "teleportDisable", "teleport"]);
521
522
  }
522
523
  const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
523
524
  export {
@@ -1,5 +1,5 @@
1
1
  import { resolveComponent, openBlock, createElementBlock, createElementVNode, renderSlot, toDisplayString, createCommentVNode, createVNode, createTextVNode, ref, h, createBlock, resolveDynamicComponent, withCtx, reactive, computed, watch, onMounted, normalizeClass, Fragment, renderList, createSlots } from "vue";
2
- import { c as createComponent, n as floatData } from "./component-470275dd.js";
2
+ import { c as createComponent, n as floatData } from "./component-0fbad28e.js";
3
3
  import { Del, Edit } from "@nutui/icons-vue";
4
4
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
5
5
  import Button from "./Button.js";
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { toRefs, reactive, computed, openBlock, createElementBlock, createElementVNode, normalizeClass, normalizeStyle, renderSlot } from "vue";
21
- import { c as createComponent } from "./component-470275dd.js";
21
+ import { c as createComponent } from "./component-0fbad28e.js";
22
22
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
23
23
  import "../locale/lang";
24
24
  const { componentName, create } = createComponent("animate");
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { ref, reactive, onMounted, watch, provide, toRefs, resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, createVNode, withCtx, createCommentVNode, normalizeClass, createBlock, renderSlot } from "vue";
21
- import { c as createComponent } from "./component-470275dd.js";
21
+ import { c as createComponent } from "./component-0fbad28e.js";
22
22
  import { Service } from "@nutui/icons-vue";
23
23
  import Range from "./Range.js";
24
24
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { inject, reactive, ref, useSlots, toRefs, resolveComponent, openBlock, createElementBlock, createBlock, withCtx, createTextVNode, toDisplayString, createCommentVNode, renderSlot } from "vue";
21
- import { c as createComponent } from "./component-470275dd.js";
21
+ import { c as createComponent } from "./component-0fbad28e.js";
22
22
  import Button from "./Button.js";
23
23
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
24
24
  import "../locale/lang";
@@ -1,29 +1,13 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
- var __hasOwnProp = Object.prototype.hasOwnProperty;
4
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
7
- for (var prop in b || (b = {}))
8
- if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
10
- if (__getOwnPropSymbols)
11
- for (var prop of __getOwnPropSymbols(b)) {
12
- if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- }
15
- return a;
16
- };
17
- import { toRefs, inject, ref, reactive, onMounted, computed, openBlock, createElementBlock, normalizeStyle, normalizeClass, renderSlot, createCommentVNode, Fragment, createTextVNode, toDisplayString } from "vue";
18
- import { c as createComponent } from "./component-470275dd.js";
1
+ import { toRefs, inject, ref, computed, openBlock, createElementBlock, normalizeStyle, normalizeClass, renderSlot } from "vue";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
19
3
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
20
4
  import "../locale/lang";
21
- const { componentName, create } = createComponent("avatar");
5
+ const { create } = createComponent("avatar");
22
6
  const _sfc_main = create({
23
7
  props: {
24
8
  size: {
25
- type: String,
26
- default: ""
9
+ type: [String, Number],
10
+ default: "normal"
27
11
  },
28
12
  shape: {
29
13
  type: String,
@@ -43,86 +27,40 @@ const _sfc_main = create({
43
27
  const sizeValue = ["large", "normal", "small"];
44
28
  const avatarGroup = inject("avatarGroup", null);
45
29
  const avatarRef = ref(null);
46
- const visible = reactive({
47
- lightTheme: false
48
- });
49
- const state = reactive({
50
- index: 1,
51
- showMax: false,
52
- // 是否显示的最大头像个数
53
- maxIndex: 0
54
- // avatarGroup里的avatar的个数
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
30
  const classes = computed(() => {
64
31
  var _a, _b;
65
- const prefixCls = componentName;
32
+ const prefixCls = "nut-avatar";
66
33
  return {
67
34
  [prefixCls]: true,
68
35
  [`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
36
+ [`nut-avatar-${shape.value || ((_b = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _b.shape) || "round"}`]: true
70
37
  };
71
38
  });
72
39
  const styles = computed(() => {
73
- var _a, _b, _c;
40
+ var _a, _b;
74
41
  return {
75
- width: sizeValue.indexOf(size.value) > -1 ? "" : `${size.value}px`,
76
- height: sizeValue.indexOf(size.value) > -1 ? "" : `${size.value}px`,
42
+ width: size.value in sizeValue ? "" : `${size.value}px`,
43
+ height: size.value in sizeValue ? "" : `${size.value}px`,
77
44
  backgroundColor: `${bgColor.value}`,
78
45
  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)}` : ""
46
+ marginLeft: ((_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` : ""
81
47
  };
82
48
  });
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 avatarLength = (children) => {
91
- var _a, _b, _c;
92
- state.maxIndex = children.length;
93
- for (let i = 0; i < children.length; i++) {
94
- if (children[i] && children[i].classList && children[i].classList[0] == "nut-avatar") {
95
- children[i].setAttribute("data-index", i + 1);
96
- }
97
- }
98
- state.index = (_b = (_a = avatarRef == null ? void 0 : avatarRef.value) == null ? void 0 : _a.dataset) == null ? void 0 : _b.index;
99
- if (state.index == state.maxIndex && state.index != ((_c = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _c.maxCount)) {
100
- state.showMax = true;
101
- }
102
- };
103
- return __spreadValues({
49
+ return {
104
50
  classes,
105
51
  styles,
106
- maxStyles,
107
- avatarGroup,
108
- visible,
109
52
  avatarRef
110
- }, toRefs(state));
53
+ };
111
54
  }
112
55
  });
113
56
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
114
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
115
- 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", {
116
- key: 0,
117
- style: normalizeStyle(!_ctx.showMax ? _ctx.styles : _ctx.maxStyles),
57
+ return openBlock(), createElementBlock("view", {
58
+ style: normalizeStyle(_ctx.styles),
118
59
  class: normalizeClass(_ctx.classes),
119
60
  ref: "avatarRef"
120
61
  }, [
121
- !((_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),
122
- _ctx.showMax && ((_j = (_i = _ctx.avatarGroup) == null ? void 0 : _i.props) == null ? void 0 : _j.maxCount) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
123
- 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)
124
- ], 64)) : createCommentVNode("", true)
125
- ], 6)) : createCommentVNode("", true);
62
+ renderSlot(_ctx.$slots, "default")
63
+ ], 6);
126
64
  }
127
65
  const Avatar = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
128
66
  export {
@@ -1,9 +1,13 @@
1
- import { ref, computed, onMounted, provide, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
2
- import { c as createComponent } from "./component-470275dd.js";
1
+ import { ref, computed, onMounted, nextTick, unref, onUnmounted, provide, resolveComponent, openBlock, createElementBlock, normalizeStyle, renderSlot, createBlock, withCtx, createTextVNode, toDisplayString, createCommentVNode } from "vue";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
3
+ import Avatar from "./Avatar.js";
3
4
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
5
  import "../locale/lang";
5
- const { componentName, create } = createComponent("avatar-group");
6
+ const { create } = createComponent("avatar-group");
6
7
  const _sfc_main = create({
8
+ components: {
9
+ [Avatar.name]: Avatar
10
+ },
7
11
  props: {
8
12
  maxContent: {
9
13
  type: String,
@@ -22,15 +26,15 @@ const _sfc_main = create({
22
26
  default: "#666"
23
27
  },
24
28
  size: {
25
- type: String,
26
- default: ""
29
+ type: [String, Number],
30
+ default: "normal"
27
31
  },
28
32
  shape: {
29
33
  type: String,
30
- default: ""
34
+ default: "round"
31
35
  },
32
36
  span: {
33
- type: String,
37
+ type: [String, Number],
34
38
  default: "-8"
35
39
  },
36
40
  zIndex: {
@@ -40,34 +44,102 @@ const _sfc_main = create({
40
44
  },
41
45
  setup(props) {
42
46
  const avatarGroupRef = ref(null);
43
- const index2 = ref(0);
44
- const classes = computed(() => {
45
- const prefixCls = componentName;
47
+ const foldCount = ref(99);
48
+ const observer = ref();
49
+ const styles = computed(() => {
46
50
  return {
47
- [prefixCls]: true
51
+ marginLeft: -1 * Number(props.span) + "px"
48
52
  };
49
53
  });
54
+ const foldAvatar = (element) => {
55
+ let count = 0;
56
+ if (element && element.$el) {
57
+ element = element.$el;
58
+ }
59
+ const children = element.children;
60
+ if (props.zIndex === "right") {
61
+ for (let i = 0; i < Number(props.maxCount); i++) {
62
+ const child = children[i];
63
+ child.style.zIndex = `${99 - i}`;
64
+ }
65
+ }
66
+ for (let i = Number(props.maxCount); i < children.length; i++) {
67
+ const child = children[i];
68
+ if (child.className.includes("avater-fold")) {
69
+ continue;
70
+ }
71
+ child.style.display = "none";
72
+ count++;
73
+ }
74
+ foldCount.value = count;
75
+ };
76
+ const watchDefaultSlot = (element) => {
77
+ const config = { attributes: false, childList: true, subtree: true };
78
+ const callback = function(mutations) {
79
+ let sig = false;
80
+ for (let mutation of mutations) {
81
+ if (mutation.type === "childList") {
82
+ sig = true;
83
+ break;
84
+ }
85
+ }
86
+ if (sig)
87
+ foldAvatar(element);
88
+ };
89
+ const observer2 = new MutationObserver(callback);
90
+ observer2.observe(element, config);
91
+ return observer2;
92
+ };
50
93
  onMounted(() => {
94
+ if (props.maxCount) {
95
+ nextTick(() => {
96
+ let element = unref(avatarGroupRef);
97
+ if (element && element.$el) {
98
+ element = element.$el;
99
+ }
100
+ foldAvatar(element);
101
+ observer.value = watchDefaultSlot(element);
102
+ });
103
+ }
104
+ });
105
+ onUnmounted(() => {
106
+ var _a;
107
+ (_a = observer.value) == null ? void 0 : _a.disconnect();
51
108
  });
52
109
  provide("avatarGroup", {
53
110
  props,
54
- avatarGroupRef,
55
- index: index2
111
+ avatarGroupRef
56
112
  });
57
113
  return {
58
- classes,
59
- // styles,
114
+ styles,
115
+ foldCount,
60
116
  avatarGroupRef
61
117
  };
62
118
  }
63
119
  });
64
120
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
121
+ const _component_nut_avatar = resolveComponent("nut-avatar");
65
122
  return openBlock(), createElementBlock("view", {
66
- class: normalizeClass(_ctx.classes),
67
- ref: "avatarGroupRef"
123
+ class: "nut-avatar-group",
124
+ ref: "avatarGroupRef",
125
+ style: normalizeStyle(_ctx.styles)
68
126
  }, [
69
- renderSlot(_ctx.$slots, "default")
70
- ], 2);
127
+ renderSlot(_ctx.$slots, "default"),
128
+ _ctx.foldCount > 0 ? (openBlock(), createBlock(_component_nut_avatar, {
129
+ key: 0,
130
+ class: "avater-fold",
131
+ color: _ctx.maxColor,
132
+ bgColor: _ctx.maxBgColor,
133
+ size: _ctx.size,
134
+ shape: _ctx.shape,
135
+ style: normalizeStyle({ magrinLeft: `${_ctx.span}px` })
136
+ }, {
137
+ default: withCtx(() => [
138
+ createTextVNode(toDisplayString(_ctx.maxContent || _ctx.foldCount), 1)
139
+ ]),
140
+ _: 1
141
+ }, 8, ["color", "bgColor", "size", "shape", "style"])) : createCommentVNode("", true)
142
+ ], 4);
71
143
  }
72
144
  const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
73
145
  export {
@@ -1,5 +1,5 @@
1
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-470275dd.js";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
3
3
  import { r as requestAniFrame, c as cancelRaf } from "./raf-729dad54.js";
4
4
  import { Top } from "@nutui/icons-vue";
5
5
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
@@ -1,5 +1,5 @@
1
1
  import { reactive, computed, openBlock, createElementBlock, withDirectives, createElementVNode, normalizeStyle, renderSlot, vShow, toDisplayString, normalizeClass } from "vue";
2
- import { c as createComponent } from "./component-470275dd.js";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
3
3
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
4
  import "../locale/lang";
5
5
  const { create } = createComponent("badge");
@@ -1,5 +1,5 @@
1
1
  import { useSlots, computed, ref, onMounted, onUnmounted, watch, nextTick, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createCommentVNode } from "vue";
2
- import { c as createComponent } from "./component-470275dd.js";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
3
3
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
4
  import "../locale/lang";
5
5
  const { componentName, create } = createComponent("barrage");
@@ -1,5 +1,5 @@
1
1
  import { toRefs, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, createBlock, createCommentVNode, renderSlot } from "vue";
2
- import { c as createComponent } from "./component-470275dd.js";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
3
3
  import { Loading } from "@nutui/icons-vue";
4
4
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
5
5
  import "../locale/lang";
@@ -1,7 +1,7 @@
1
- import { computed, ref, resolveComponent, openBlock, createBlock, withCtx, createSlots, renderSlot, createCommentVNode } from "vue";
2
- import { c as createComponent } from "./component-470275dd.js";
3
- import { C as CalendarItem, U as Utils } from "./index-02204c4b.js";
4
- import { P as Popup } from "./index-412323a0.js";
1
+ import { computed, ref, resolveComponent, openBlock, createBlock, mergeProps, withCtx, createVNode, createSlots, renderSlot } from "vue";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
3
+ import { C as CalendarItem, U as Utils } from "./index-3a5098e4.js";
4
+ import { P as Popup } from "./index-5ffbc437.js";
5
5
  import { u as useExpose } from "./index-79c5dc33.js";
6
6
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
7
7
  import "../locale/lang";
@@ -118,18 +118,18 @@ const _sfc_main = create({
118
118
  close();
119
119
  emit("choose", param);
120
120
  };
121
- const select = (param) => {
122
- emit("select", param);
123
- };
124
121
  const closePopup = () => {
125
122
  close();
126
123
  };
124
+ const select = (param) => {
125
+ emit("select", param);
126
+ };
127
127
  return {
128
128
  closePopup,
129
129
  update,
130
130
  close,
131
- choose,
132
131
  select,
132
+ choose,
133
133
  calendarRef,
134
134
  showTopBtn,
135
135
  topInfo,
@@ -141,29 +141,24 @@ const _sfc_main = create({
141
141
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
142
142
  const _component_nut_calendar_item = resolveComponent("nut-calendar-item");
143
143
  const _component_nut_popup = resolveComponent("nut-popup");
144
- return _ctx.poppable ? (openBlock(), createBlock(_component_nut_popup, {
144
+ return _ctx.poppable ? (openBlock(), createBlock(_component_nut_popup, mergeProps({
145
145
  key: 0,
146
146
  visible: _ctx.visible,
147
147
  position: "bottom",
148
148
  round: "",
149
- closeable: true,
149
+ closeable: ""
150
+ }, _ctx.$attrs, {
150
151
  onClickOverlay: _ctx.closePopup,
151
152
  onClickCloseIcon: _ctx.closePopup,
152
- "destroy-on-close": true,
153
153
  style: { height: "85vh" }
154
- }, {
154
+ }), {
155
155
  default: withCtx(() => [
156
- _ctx.visible ? (openBlock(), createBlock(_component_nut_calendar_item, {
157
- key: 0,
158
- props: "",
156
+ createVNode(_component_nut_calendar_item, {
159
157
  ref: "calendarRef",
160
158
  type: _ctx.type,
161
159
  "is-auto-back-fill": _ctx.isAutoBackFill,
162
160
  poppable: _ctx.poppable,
163
161
  title: _ctx.title,
164
- "confirm-text": _ctx.confirmText,
165
- "start-text": _ctx.startText,
166
- "end-text": _ctx.endText,
167
162
  "default-value": _ctx.defaultValue,
168
163
  "start-date": _ctx.startDate,
169
164
  "end-date": _ctx.endDate,
@@ -171,6 +166,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
171
166
  onClose: _ctx.close,
172
167
  onChoose: _ctx.choose,
173
168
  onSelect: _ctx.select,
169
+ "confirm-text": _ctx.confirmText,
170
+ "start-text": _ctx.startText,
171
+ "end-text": _ctx.endText,
174
172
  "show-today": _ctx.showToday,
175
173
  "show-title": _ctx.showTitle,
176
174
  "show-sub-title": _ctx.showSubTitle,
@@ -211,15 +209,16 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
211
209
  ]),
212
210
  key: "3"
213
211
  } : void 0
214
- ]), 1032, ["type", "is-auto-back-fill", "poppable", "title", "confirm-text", "start-text", "end-text", "default-value", "start-date", "end-date", "onUpdate", "onClose", "onChoose", "onSelect", "show-today", "show-title", "show-sub-title", "to-date-animation", "first-day-of-week"])) : createCommentVNode("", true)
212
+ ]), 1032, ["type", "is-auto-back-fill", "poppable", "title", "default-value", "start-date", "end-date", "onUpdate", "onClose", "onChoose", "onSelect", "confirm-text", "start-text", "end-text", "show-today", "show-title", "show-sub-title", "to-date-animation", "first-day-of-week"])
215
213
  ]),
216
214
  _: 3
217
- }, 8, ["visible", "onClickOverlay", "onClickCloseIcon"])) : (openBlock(), createBlock(_component_nut_calendar_item, {
215
+ }, 16, ["visible", "onClickOverlay", "onClickCloseIcon"])) : (openBlock(), createBlock(_component_nut_calendar_item, {
218
216
  key: 1,
219
217
  type: _ctx.type,
220
218
  "is-auto-back-fill": _ctx.isAutoBackFill,
221
219
  poppable: _ctx.poppable,
222
220
  title: _ctx.title,
221
+ ref: "calendarRef",
223
222
  "confirm-text": _ctx.confirmText,
224
223
  "start-text": _ctx.startText,
225
224
  "end-text": _ctx.endText,
@@ -230,12 +229,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
230
229
  onClose: _ctx.close,
231
230
  onChoose: _ctx.choose,
232
231
  onSelect: _ctx.select,
233
- "show-today": _ctx.showToday,
234
232
  "show-title": _ctx.showTitle,
235
233
  "show-sub-title": _ctx.showSubTitle,
236
234
  "to-date-animation": _ctx.toDateAnimation,
237
- "first-day-of-week": _ctx.firstDayOfWeek,
238
- ref: "calendarRef"
235
+ "show-today": _ctx.showToday,
236
+ "first-day-of-week": _ctx.firstDayOfWeek
239
237
  }, createSlots({ _: 2 }, [
240
238
  _ctx.showTopBtn ? {
241
239
  name: "btn",
@@ -271,7 +269,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
271
269
  ]),
272
270
  key: "3"
273
271
  } : void 0
274
- ]), 1032, ["type", "is-auto-back-fill", "poppable", "title", "confirm-text", "start-text", "end-text", "default-value", "start-date", "end-date", "onUpdate", "onClose", "onChoose", "onSelect", "show-today", "show-title", "show-sub-title", "to-date-animation", "first-day-of-week"]));
272
+ ]), 1032, ["type", "is-auto-back-fill", "poppable", "title", "confirm-text", "start-text", "end-text", "default-value", "start-date", "end-date", "onUpdate", "onClose", "onChoose", "onSelect", "show-title", "show-sub-title", "to-date-animation", "show-today", "first-day-of-week"]));
275
273
  }
276
274
  const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
277
275
  export {
@@ -1,7 +1,7 @@
1
- import { C } from "./index-02204c4b.js";
1
+ import { C } from "./index-3a5098e4.js";
2
2
  import "vue";
3
3
  import "./_plugin-vue_export-helper-cc2b3d55.js";
4
- import "./component-470275dd.js";
4
+ import "./component-0fbad28e.js";
5
5
  import "../locale/lang";
6
6
  import "./raf-729dad54.js";
7
7
  import "./index-79c5dc33.js";
@@ -1,4 +1,4 @@
1
- import { c as createComponent } from "./component-470275dd.js";
1
+ import { c as createComponent } from "./component-0fbad28e.js";
2
2
  import { resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, renderSlot, createBlock, createCommentVNode, Fragment, createVNode, withCtx, createTextVNode } from "vue";
3
3
  import Price from "./Price.js";
4
4
  import Tag from "./Tag.js";
@@ -55,8 +55,8 @@ var __async = (__this, __arguments, generator) => {
55
55
  });
56
56
  };
57
57
  import { computed, ref, watch, resolveComponent, openBlock, createBlock, withCtx, createElementBlock, Fragment, renderList, createElementVNode, normalizeClass, toDisplayString, createCommentVNode, createVNode } from "vue";
58
- import { P as Popup, p as popupProps } from "./index-412323a0.js";
59
- import { c as createComponent } from "./component-470275dd.js";
58
+ import { P as Popup, p as popupProps } from "./index-5ffbc437.js";
59
+ import { c as createComponent } from "./component-0fbad28e.js";
60
60
  import { Loading, Checklist } from "@nutui/icons-vue";
61
61
  import Tabs from "./Tabs.js";
62
62
  import TabPane from "./TabPane.js";
@@ -1,5 +1,5 @@
1
1
  import { ref, openBlock, createElementBlock, createElementVNode, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode, renderSlot } from "vue";
2
- import { c as createComponent } from "./component-470275dd.js";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
3
3
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
4
  import "../locale/lang";
5
5
  const { create } = createComponent("category");
@@ -1,4 +1,4 @@
1
- import { c as createComponent } from "./component-470275dd.js";
1
+ import { c as createComponent } from "./component-0fbad28e.js";
2
2
  import { openBlock, createElementBlock, Fragment, renderList, createElementVNode, toDisplayString, createCommentVNode } from "vue";
3
3
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
4
  import "../locale/lang";
@@ -1,5 +1,5 @@
1
1
  import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot, createCommentVNode, Fragment, createElementVNode, toDisplayString, createTextVNode, createBlock } from "vue";
2
- import { c as createComponent } from "./component-470275dd.js";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
3
3
  import { u as useRouter } from "./index-54d03fc1.js";
4
4
  import { p as pxCheck } from "./pxCheck-c6b9f6b7.js";
5
5
  import { Right } from "@nutui/icons-vue";
@@ -1,4 +1,4 @@
1
- import { c as createComponent } from "./component-470275dd.js";
1
+ import { c as createComponent } from "./component-0fbad28e.js";
2
2
  import { openBlock, createElementBlock, renderSlot, toDisplayString, createCommentVNode, createElementVNode } from "vue";
3
3
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
4
  import "../locale/lang";
@@ -1,4 +1,4 @@
1
- import { c as createComponent } from "./component-470275dd.js";
1
+ import { c as createComponent } from "./component-0fbad28e.js";
2
2
  import { inject, reactive, computed, watch, onMounted, getCurrentInstance, onBeforeUnmount, h } from "vue";
3
3
  import { p as pxCheck } from "./pxCheck-c6b9f6b7.js";
4
4
  import { CheckNormal, Checked, CheckDisabled } from "@nutui/icons-vue";
@@ -1,5 +1,5 @@
1
1
  import { reactive, provide, computed, watch, h } from "vue";
2
- import { c as createComponent } from "./component-470275dd.js";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
3
3
  import { u as useExpose } from "./index-79c5dc33.js";
4
4
  import "../locale/lang";
5
5
  const { create, componentName } = createComponent("checkbox-group");
@@ -1,5 +1,5 @@
1
1
  import { useSlots, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, Fragment, renderList, renderSlot, toDisplayString, createCommentVNode } from "vue";
2
- import { g as isObject, c as createComponent } from "./component-470275dd.js";
2
+ import { h as isObject, c as createComponent } from "./component-0fbad28e.js";
3
3
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
4
  import "../locale/lang";
5
5
  const { componentName, create } = createComponent("circle-progress");
@@ -1,5 +1,5 @@
1
1
  import { inject, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot } from "vue";
2
- import { c as createComponent } from "./component-470275dd.js";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
3
3
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
4
  import "../locale/lang";
5
5
  const { componentName, create } = createComponent("col");
@@ -1,5 +1,5 @@
1
1
  import { ref, computed, watch, provide, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
2
- import { c as createComponent } from "./component-470275dd.js";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
3
3
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
4
  import "../locale/lang";
5
5
  const { create, componentName } = createComponent("collapse");
@@ -1,6 +1,6 @@
1
1
  import { ref, inject, reactive, computed, watch, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, toDisplayString, createCommentVNode, normalizeStyle, createBlock, resolveDynamicComponent } from "vue";
2
2
  import { DownArrow } from "@nutui/icons-vue";
3
- import { c as createComponent } from "./component-470275dd.js";
3
+ import { c as createComponent } from "./component-0fbad28e.js";
4
4
  import { r as renderIcon } from "./renderIcon-3d0fd47c.js";
5
5
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
6
6
  import "../locale/lang";