@nutui/nutui 4.0.11 → 4.0.12

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 (158) hide show
  1. package/dist/nutui.es.js +1 -1
  2. package/dist/nutui.js +2 -2
  3. package/dist/nutui.umd.js +1 -1
  4. package/dist/packages/_es/ActionSheet.js +111 -78
  5. package/dist/packages/_es/Address.js +375 -250
  6. package/dist/packages/_es/AddressList.js +354 -269
  7. package/dist/packages/_es/Animate.js +58 -41
  8. package/dist/packages/_es/Audio.js +197 -128
  9. package/dist/packages/_es/AudioOperate.js +71 -60
  10. package/dist/packages/_es/Avatar.js +89 -66
  11. package/dist/packages/_es/AvatarGroup.js +31 -23
  12. package/dist/packages/_es/Backtop.js +99 -59
  13. package/dist/packages/_es/Badge.js +47 -36
  14. package/dist/packages/_es/Barrage.js +147 -68
  15. package/dist/packages/_es/Button.js +66 -47
  16. package/dist/packages/_es/Calendar.js +157 -135
  17. package/dist/packages/_es/CalendarItem.js +6 -6
  18. package/dist/packages/_es/Card.js +56 -42
  19. package/dist/packages/_es/Cascader.js +474 -315
  20. package/dist/packages/_es/Category.js +39 -29
  21. package/dist/packages/_es/CategoryPane.js +83 -57
  22. package/dist/packages/_es/Cell.js +71 -56
  23. package/dist/packages/_es/CellGroup.js +27 -19
  24. package/dist/packages/_es/Checkbox.js +156 -109
  25. package/dist/packages/_es/CheckboxGroup.js +59 -38
  26. package/dist/packages/_es/CircleProgress.js +96 -67
  27. package/dist/packages/_es/Col.js +31 -23
  28. package/dist/packages/_es/Collapse.js +58 -33
  29. package/dist/packages/_es/CollapseItem.js +108 -78
  30. package/dist/packages/_es/Comment.js +279 -207
  31. package/dist/packages/_es/ConfigProvider.js +55 -37
  32. package/dist/packages/_es/Countdown.js +212 -100
  33. package/dist/packages/_es/Countup.js +445 -232
  34. package/dist/packages/_es/DatePicker.js +265 -162
  35. package/dist/packages/_es/Dialog.js +213 -161
  36. package/dist/packages/_es/Divider.js +57 -42
  37. package/dist/packages/_es/Drag.js +153 -70
  38. package/dist/packages/_es/Ecard.js +104 -64
  39. package/dist/packages/_es/Elevator.js +219 -143
  40. package/dist/packages/_es/Ellipsis.js +178 -95
  41. package/dist/packages/_es/Empty.js +39 -23
  42. package/dist/packages/_es/FixedNav.js +116 -93
  43. package/dist/packages/_es/Form.js +178 -107
  44. package/dist/packages/_es/FormItem.js +61 -48
  45. package/dist/packages/_es/Grid.js +6 -5
  46. package/dist/packages/_es/GridItem.js +84 -58
  47. package/dist/packages/_es/Image.js +130 -90
  48. package/dist/packages/_es/ImagePreview.js +412 -256
  49. package/dist/packages/_es/Indicator.js +34 -30
  50. package/dist/packages/_es/InfiniteLoading.js +136 -83
  51. package/dist/packages/_es/Input.js +264 -160
  52. package/dist/packages/_es/InputNumber.js +117 -81
  53. package/dist/packages/_es/Interceptor-956b24fc.js +29 -0
  54. package/dist/packages/_es/Invoice.js +130 -104
  55. package/dist/packages/_es/Layout.js +4 -3
  56. package/dist/packages/_es/List.js +215 -117
  57. package/dist/packages/_es/Menu.js +150 -95
  58. package/dist/packages/_es/MenuItem.js +154 -109
  59. package/dist/packages/_es/Navbar.js +119 -103
  60. package/dist/packages/_es/Noticebar.js +312 -197
  61. package/dist/packages/_es/Notify.js +166 -110
  62. package/dist/packages/_es/NumberKeyboard.js +202 -127
  63. package/dist/packages/_es/Overlay.js +80 -52
  64. package/dist/packages/_es/Pagination.js +100 -70
  65. package/dist/packages/_es/Picker.js +437 -275
  66. package/dist/packages/_es/Popover.js +225 -122
  67. package/dist/packages/_es/Popup.js +4 -4
  68. package/dist/packages/_es/Price.js +82 -44
  69. package/dist/packages/_es/Progress.js +79 -63
  70. package/dist/packages/_es/PullRefresh.js +173 -95
  71. package/dist/packages/_es/Radio.js +4 -4
  72. package/dist/packages/_es/RadioGroup.js +3 -3
  73. package/dist/packages/_es/Range.js +347 -204
  74. package/dist/packages/_es/Rate.js +141 -92
  75. package/dist/packages/_es/Row.js +27 -21
  76. package/dist/packages/_es/Searchbar.js +174 -123
  77. package/dist/packages/_es/ShortPassword.js +93 -69
  78. package/dist/packages/_es/SideNavbar.js +80 -49
  79. package/dist/packages/_es/SideNavbarItem.js +32 -22
  80. package/dist/packages/_es/Signature.js +146 -83
  81. package/dist/packages/_es/Skeleton.js +130 -110
  82. package/dist/packages/_es/Sku.js +343 -250
  83. package/dist/packages/_es/Step.js +86 -59
  84. package/dist/packages/_es/Steps.js +31 -26
  85. package/dist/packages/_es/Sticky.js +4 -4
  86. package/dist/packages/_es/SubSideNavbar.js +74 -52
  87. package/dist/packages/_es/Swipe.js +155 -83
  88. package/dist/packages/_es/Swiper.js +311 -174
  89. package/dist/packages/_es/SwiperItem.js +44 -28
  90. package/dist/packages/_es/Switch.js +68 -55
  91. package/dist/packages/_es/TabPane.js +41 -30
  92. package/dist/packages/_es/Tabbar.js +52 -41
  93. package/dist/packages/_es/TabbarItem.js +82 -61
  94. package/dist/packages/_es/Table.js +165 -109
  95. package/dist/packages/_es/Tabs.js +388 -240
  96. package/dist/packages/_es/Tag.js +61 -44
  97. package/dist/packages/_es/Textarea.js +124 -80
  98. package/dist/packages/_es/TimeDetail.js +76 -49
  99. package/dist/packages/_es/TimePannel.js +48 -34
  100. package/dist/packages/_es/TimeSelect.js +68 -47
  101. package/dist/packages/_es/Toast.js +218 -144
  102. package/dist/packages/_es/Tour.js +192 -138
  103. package/dist/packages/_es/TrendArrow.js +77 -57
  104. package/dist/packages/_es/Uploader.js +359 -234
  105. package/dist/packages/_es/Video.js +316 -191
  106. package/dist/packages/_es/Watermark.js +117 -84
  107. package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +10 -0
  108. package/dist/packages/_es/common-b9a5e726.js +145 -0
  109. package/dist/packages/_es/component-81a4c1d0.js +145 -0
  110. package/dist/packages/_es/index-29892cda.js +33 -0
  111. package/dist/packages/_es/index-43c34ac6.js +30 -0
  112. package/dist/packages/_es/index-54d03fc1.js +8 -0
  113. package/dist/packages/_es/index-79c5dc33.js +10 -0
  114. package/dist/packages/_es/index-7a7385e4.js +67 -0
  115. package/dist/packages/_es/index-87422be8.js +942 -0
  116. package/dist/packages/_es/index-da0a7662.js +259 -0
  117. package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +46 -0
  118. package/dist/packages/_es/index.vue_vue_type_script_lang-a8856969.js +97 -0
  119. package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +151 -0
  120. package/dist/packages/_es/mountComponent-8b24c346.js +39 -0
  121. package/dist/packages/_es/pxCheck-c6b9f6b7.js +6 -0
  122. package/dist/packages/_es/raf-729dad54.js +25 -0
  123. package/dist/packages/_es/renderIcon-3d0fd47c.js +9 -0
  124. package/dist/packages/locale/lang/baseLang-3a8457ac.js +5 -0
  125. package/dist/packages/locale/lang/en-US.js +39 -36
  126. package/dist/packages/locale/lang/id-ID.js +39 -36
  127. package/dist/packages/locale/lang/index.js +44 -22
  128. package/dist/packages/locale/lang/zh-CN.js +38 -35
  129. package/dist/packages/locale/lang/zh-TW.js +38 -35
  130. package/dist/resolver/index.js +26 -1
  131. package/dist/resolver/index.mjs +17 -14
  132. package/dist/smartips/web-types.json +1 -1
  133. package/dist/style.css +1 -1
  134. package/dist/styles/themes/default.scss +48 -48
  135. package/dist/styles/themes/jdb.scss +48 -48
  136. package/dist/styles/themes/jddkh.scss +48 -48
  137. package/dist/styles/themes/jdt.scss +48 -48
  138. package/dist/types/index.d.ts +1 -1
  139. package/package.json +3 -4
  140. package/dist/packages/_es/Interceptor-6e26b757.js +0 -18
  141. package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +0 -9
  142. package/dist/packages/_es/common-d218746f.js +0 -116
  143. package/dist/packages/_es/component-234624bc.js +0 -89
  144. package/dist/packages/_es/index-14dfadc4.js +0 -561
  145. package/dist/packages/_es/index-192a3ef6.js +0 -29
  146. package/dist/packages/_es/index-360c5092.js +0 -210
  147. package/dist/packages/_es/index-496e6e05.js +0 -24
  148. package/dist/packages/_es/index-50eed3d9.js +0 -7
  149. package/dist/packages/_es/index-53ec2d4d.js +0 -34
  150. package/dist/packages/_es/index-fadb0974.js +0 -8
  151. package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +0 -43
  152. package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +0 -77
  153. package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +0 -110
  154. package/dist/packages/_es/mountComponent-6d4ff200.js +0 -23
  155. package/dist/packages/_es/pxCheck-38173291.js +0 -4
  156. package/dist/packages/_es/raf-a74f1a06.js +0 -16
  157. package/dist/packages/_es/renderIcon-47498b32.js +0 -5
  158. package/dist/packages/locale/lang/baseLang-0bdc6353.js +0 -5
@@ -1,22 +1,30 @@
1
- var v = Object.defineProperty, g = Object.defineProperties;
2
- var b = Object.getOwnPropertyDescriptors;
3
- var S = Object.getOwnPropertySymbols;
4
- var w = Object.prototype.hasOwnProperty, z = Object.prototype.propertyIsEnumerable;
5
- var c = (t, e, o) => e in t ? v(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o, d = (t, e) => {
6
- for (var o in e || (e = {}))
7
- w.call(e, o) && c(t, o, e[o]);
8
- if (S)
9
- for (var o of S(e))
10
- z.call(e, o) && c(t, o, e[o]);
11
- return t;
12
- }, $ = (t, e) => g(t, b(e));
13
- import { inject as D, reactive as M, ref as N, useSlots as E, toRefs as B, resolveComponent as F, openBlock as a, createElementBlock as n, createBlock as l, withCtx as i, createTextVNode as p, toDisplayString as f, createCommentVNode as r, renderSlot as m } from "vue";
14
- import { c as V } from "./component-234624bc.js";
15
- import C from "./Button.js";
16
- import { _ as j } from "./_plugin-vue_export-helper-dad06003.js";
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
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-81a4c1d0.js";
22
+ import Button from "./Button.js";
23
+ import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
17
24
  import "../locale/lang";
18
25
  import "@nutui/icons-vue";
19
- const { componentName: Q, create: P, translate: R } = V("audio-operate"), T = P({
26
+ const { componentName, create, translate } = createComponent("audio-operate");
27
+ const _sfc_main = create({
20
28
  props: {
21
29
  // 展示的形式 back 倒退 play 开始 or 暂停 forward 快进 mute 静音
22
30
  type: {
@@ -25,88 +33,91 @@ const { componentName: Q, create: P, translate: R } = V("audio-operate"), T = P(
25
33
  }
26
34
  },
27
35
  components: {
28
- [C.name]: C
36
+ [Button.name]: Button
29
37
  },
30
38
  emits: ["click"],
31
- setup(t, { emit: e }) {
32
- const o = D("audioParent"), y = M(o), k = N(E().default);
33
- return $(d(d({}, B(t)), B(y)), { customSlot: k, translate: R });
39
+ setup(props, { emit }) {
40
+ const audio = inject("audioParent");
41
+ const parent = reactive(audio);
42
+ const customSlot = ref(useSlots().default);
43
+ return __spreadProps(__spreadValues(__spreadValues({}, toRefs(props)), toRefs(parent)), { customSlot, translate });
34
44
  }
35
- }), h = { class: "nut-audio-operate" };
36
- function q(t, e, o, y, k, A) {
37
- const u = F("nut-button");
38
- return a(), n("div", h, [
39
- t.type == "back" ? (a(), n("div", {
45
+ });
46
+ const _hoisted_1 = { class: "nut-audio-operate" };
47
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
48
+ const _component_nut_button = resolveComponent("nut-button");
49
+ return openBlock(), createElementBlock("div", _hoisted_1, [
50
+ _ctx.type == "back" ? (openBlock(), createElementBlock("div", {
40
51
  key: 0,
41
52
  class: "nut-audio-operate-item",
42
- onClick: e[0] || (e[0] = (...s) => t.fastBack && t.fastBack(...s))
53
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.fastBack && _ctx.fastBack(...args))
43
54
  }, [
44
- t.customSlot ? r("", !0) : (a(), l(u, {
55
+ !_ctx.customSlot ? (openBlock(), createBlock(_component_nut_button, {
45
56
  key: 0,
46
57
  type: "primary",
47
58
  size: "small"
48
59
  }, {
49
- default: i(() => [
50
- p(f(t.translate("back")), 1)
60
+ default: withCtx(() => [
61
+ createTextVNode(toDisplayString(_ctx.translate("back")), 1)
51
62
  ]),
52
63
  _: 1
53
- })),
54
- m(t.$slots, "default")
55
- ])) : r("", !0),
56
- t.type == "play" ? (a(), n("div", {
64
+ })) : createCommentVNode("", true),
65
+ renderSlot(_ctx.$slots, "default")
66
+ ])) : createCommentVNode("", true),
67
+ _ctx.type == "play" ? (openBlock(), createElementBlock("div", {
57
68
  key: 1,
58
69
  class: "nut-audio-operate-item",
59
- onClick: e[1] || (e[1] = (...s) => t.changeStatus && t.changeStatus(...s))
70
+ onClick: _cache[1] || (_cache[1] = (...args) => _ctx.changeStatus && _ctx.changeStatus(...args))
60
71
  }, [
61
- t.customSlot ? r("", !0) : (a(), l(u, {
72
+ !_ctx.customSlot ? (openBlock(), createBlock(_component_nut_button, {
62
73
  key: 0,
63
74
  type: "primary",
64
75
  size: "small"
65
76
  }, {
66
- default: i(() => [
67
- p(f(t.audioData.playing ? `${t.translate("pause")}` : `${t.translate("start")}`), 1)
77
+ default: withCtx(() => [
78
+ createTextVNode(toDisplayString(!_ctx.audioData.playing ? `${_ctx.translate("start")}` : `${_ctx.translate("pause")}`), 1)
68
79
  ]),
69
80
  _: 1
70
- })),
71
- m(t.$slots, "default")
72
- ])) : r("", !0),
73
- t.type == "forward" ? (a(), n("div", {
81
+ })) : createCommentVNode("", true),
82
+ renderSlot(_ctx.$slots, "default")
83
+ ])) : createCommentVNode("", true),
84
+ _ctx.type == "forward" ? (openBlock(), createElementBlock("div", {
74
85
  key: 2,
75
86
  class: "nut-audio-operate-item",
76
- onClick: e[2] || (e[2] = (...s) => t.forward && t.forward(...s))
87
+ onClick: _cache[2] || (_cache[2] = (...args) => _ctx.forward && _ctx.forward(...args))
77
88
  }, [
78
- t.customSlot ? r("", !0) : (a(), l(u, {
89
+ !_ctx.customSlot ? (openBlock(), createBlock(_component_nut_button, {
79
90
  key: 0,
80
91
  type: "primary",
81
92
  size: "small"
82
93
  }, {
83
- default: i(() => [
84
- p("快进")
94
+ default: withCtx(() => [
95
+ createTextVNode("快进")
85
96
  ]),
86
97
  _: 1
87
- })),
88
- m(t.$slots, "default")
89
- ])) : r("", !0),
90
- t.type == "mute" ? (a(), n("div", {
98
+ })) : createCommentVNode("", true),
99
+ renderSlot(_ctx.$slots, "default")
100
+ ])) : createCommentVNode("", true),
101
+ _ctx.type == "mute" ? (openBlock(), createElementBlock("div", {
91
102
  key: 3,
92
103
  class: "nut-audio-operate-item",
93
- onClick: e[3] || (e[3] = (...s) => t.handleMute && t.handleMute(...s))
104
+ onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleMute && _ctx.handleMute(...args))
94
105
  }, [
95
- t.customSlot ? r("", !0) : (a(), l(u, {
106
+ !_ctx.customSlot ? (openBlock(), createBlock(_component_nut_button, {
96
107
  key: 0,
97
- type: t.audioData.hanMuted ? "default" : "primary",
108
+ type: !_ctx.audioData.hanMuted ? "primary" : "default",
98
109
  size: "small"
99
110
  }, {
100
- default: i(() => [
101
- p(f(t.translate("mute")), 1)
111
+ default: withCtx(() => [
112
+ createTextVNode(toDisplayString(_ctx.translate("mute")), 1)
102
113
  ]),
103
114
  _: 1
104
- }, 8, ["type"])),
105
- m(t.$slots, "default")
106
- ])) : r("", !0)
115
+ }, 8, ["type"])) : createCommentVNode("", true),
116
+ renderSlot(_ctx.$slots, "default")
117
+ ])) : createCommentVNode("", true)
107
118
  ]);
108
119
  }
109
- const U = /* @__PURE__ */ j(T, [["render", q]]);
120
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
110
121
  export {
111
- U as default
122
+ index as default
112
123
  };
@@ -1,19 +1,25 @@
1
- var N = Object.defineProperty;
2
- var b = Object.getOwnPropertySymbols;
3
- var V = Object.prototype.hasOwnProperty, A = Object.prototype.propertyIsEnumerable;
4
- var k = (o, s, r) => s in o ? N(o, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[s] = r, w = (o, s) => {
5
- for (var r in s || (s = {}))
6
- V.call(s, r) && k(o, r, s[r]);
7
- if (b)
8
- for (var r of b(s))
9
- A.call(s, r) && k(o, r, s[r]);
10
- return o;
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;
11
16
  };
12
- import { toRefs as I, inject as O, ref as R, reactive as M, onMounted as T, computed as g, openBlock as L, createElementBlock as B, normalizeStyle as j, normalizeClass as D, renderSlot as E, createCommentVNode as h, Fragment as F, createTextVNode as q, toDisplayString as H } from "vue";
13
- import { c as J } from "./component-234624bc.js";
14
- import { _ as K } from "./_plugin-vue_export-helper-dad06003.js";
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-81a4c1d0.js";
19
+ import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
15
20
  import "../locale/lang";
16
- const { componentName: P, create: Q } = J("avatar"), U = Q({
21
+ const { componentName, create } = createComponent("avatar");
22
+ const _sfc_main = create({
17
23
  props: {
18
24
  size: {
19
25
  type: String,
@@ -32,76 +38,93 @@ const { componentName: P, create: Q } = J("avatar"), U = Q({
32
38
  default: "#666"
33
39
  }
34
40
  },
35
- setup(o) {
36
- const { size: s, shape: r, bgColor: $, color: y } = I(o), C = ["large", "normal", "small"], e = O("avatarGroup", null), i = R(null), m = M({
37
- lightTheme: !1
38
- }), l = M({
41
+ setup(props) {
42
+ const { size, shape, bgColor, color } = toRefs(props);
43
+ const sizeValue = ["large", "normal", "small"];
44
+ const avatarGroup = inject("avatarGroup", null);
45
+ const avatarRef = ref(null);
46
+ const visible = reactive({
47
+ lightTheme: false
48
+ });
49
+ const state = reactive({
39
50
  index: 1,
40
- showMax: !1,
51
+ showMax: false,
41
52
  // 是否显示的最大头像个数
42
53
  maxIndex: 0
43
54
  // avatarGroup里的avatar的个数
44
55
  });
45
- T(() => {
46
- var n, a;
47
- const t = (a = (n = e == null ? void 0 : e.avatarGroupRef) == null ? void 0 : n.value) == null ? void 0 : a.children;
48
- t && c(t);
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
+ }
49
62
  });
50
- const d = g(() => {
51
- var n, a;
63
+ const classes = computed(() => {
64
+ var _a, _b;
65
+ const prefixCls = componentName;
52
66
  return {
53
- [P]: !0,
54
- [`nut-avatar-${s.value || ((n = e == null ? void 0 : e.props) == null ? void 0 : n.size) || "normal"}`]: !0,
55
- [`nut-avatar-${r.value || ((a = e == null ? void 0 : e.props) == null ? void 0 : a.shape) || "normal"}`]: !0
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
56
70
  };
57
- }), x = g(() => {
58
- var t, n, a;
71
+ });
72
+ const styles = computed(() => {
73
+ var _a, _b, _c;
59
74
  return {
60
- width: C.indexOf(s.value) > -1 ? "" : `${s.value}px`,
61
- height: C.indexOf(s.value) > -1 ? "" : `${s.value}px`,
62
- backgroundColor: `${$.value}`,
63
- color: `${y.value}`,
64
- marginLeft: l.index != 1 && ((t = e == null ? void 0 : e.props) != null && t.span ? `${(n = e == null ? void 0 : e.props) == null ? void 0 : n.span}px` : ""),
65
- zIndex: ((a = e == null ? void 0 : e.props) == null ? void 0 : a.zIndex) == "right" ? `${Math.abs(l.maxIndex - l.index)}` : ""
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)}` : ""
66
81
  };
67
- }), f = g(() => {
68
- var t, n;
82
+ });
83
+ const maxStyles = computed(() => {
84
+ var _a, _b;
69
85
  return {
70
- backgroundColor: `${(t = e == null ? void 0 : e.props) == null ? void 0 : t.maxBgColor}`,
71
- color: `${(n = e == null ? void 0 : e.props) == null ? void 0 : n.maxColor}`
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}`
72
88
  };
73
- }), c = (t) => {
74
- var n, a, u;
75
- l.maxIndex = t.length;
76
- for (let p = 0; p < t.length; p++)
77
- t[p] && t[p].classList && t[p].classList[0] == "nut-avatar" && t[p].setAttribute("data-index", p + 1);
78
- l.index = (a = (n = i == null ? void 0 : i.value) == null ? void 0 : n.dataset) == null ? void 0 : a.index, l.index == l.maxIndex && l.index != ((u = e == null ? void 0 : e.props) == null ? void 0 : u.maxCount) && (l.showMax = !0);
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
+ }
79
102
  };
80
- return w({
81
- classes: d,
82
- styles: x,
83
- maxStyles: f,
84
- avatarGroup: e,
85
- visible: m,
86
- avatarRef: i
87
- }, I(l));
103
+ return __spreadValues({
104
+ classes,
105
+ styles,
106
+ maxStyles,
107
+ avatarGroup,
108
+ visible,
109
+ avatarRef
110
+ }, toRefs(state));
88
111
  }
89
112
  });
90
- function W(o, s, r, $, y, C) {
91
- var e, i, m, l, d, x, f, c, t, n, a, u, p, v, S, z;
92
- return o.showMax || !((i = (e = o.avatarGroup) == null ? void 0 : e.props) != null && i.maxCount) || o.index <= ((l = (m = o.avatarGroup) == null ? void 0 : m.props) == null ? void 0 : l.maxCount) ? (L(), B("view", {
113
+ 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", {
93
116
  key: 0,
94
- style: j(o.showMax ? o.maxStyles : o.styles),
95
- class: D(o.classes),
117
+ style: normalizeStyle(!_ctx.showMax ? _ctx.styles : _ctx.maxStyles),
118
+ class: normalizeClass(_ctx.classes),
96
119
  ref: "avatarRef"
97
120
  }, [
98
- !((x = (d = o.avatarGroup) == null ? void 0 : d.props) != null && x.maxCount) || o.index <= ((c = (f = o.avatarGroup) == null ? void 0 : f.props) == null ? void 0 : c.maxCount) ? E(o.$slots, "default", { key: 0 }) : h("", !0),
99
- o.showMax && ((n = (t = o.avatarGroup) == null ? void 0 : t.props) != null && n.maxCount) ? (L(), B(F, { key: 1 }, [
100
- q(H((u = (a = o.avatarGroup) == null ? void 0 : a.props) != null && u.maxContent ? (v = (p = o.avatarGroup) == null ? void 0 : p.props) == null ? void 0 : v.maxContent : `+ ${o.maxIndex - ((z = (S = o.avatarGroup) == null ? void 0 : S.props) == null ? void 0 : z.maxCount)}`), 1)
101
- ], 64)) : h("", !0)
102
- ], 6)) : h("", !0);
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);
103
126
  }
104
- const ee = /* @__PURE__ */ K(U, [["render", W]]);
127
+ const Avatar = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
105
128
  export {
106
- ee as default
129
+ Avatar as default
107
130
  };
@@ -1,8 +1,9 @@
1
- import { toRefs as p, ref as a, computed as l, onMounted as u, provide as f, openBlock as i, createElementBlock as c, normalizeClass as d, renderSlot as m } from "vue";
2
- import { c as g } from "./component-234624bc.js";
3
- import { _ as x } from "./_plugin-vue_export-helper-dad06003.js";
1
+ import { toRefs, ref, computed, onMounted, provide, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
+ import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
4
  import "../locale/lang";
5
- const { componentName: S, create: y } = g("avatar-group"), C = y({
5
+ const { componentName, create } = createComponent("avatar-group");
6
+ const _sfc_main = create({
6
7
  props: {
7
8
  maxContent: {
8
9
  type: String,
@@ -37,32 +38,39 @@ const { componentName: S, create: y } = g("avatar-group"), C = y({
37
38
  default: "left"
38
39
  }
39
40
  },
40
- setup(e, { emit: n, slots: s }) {
41
- p(e);
42
- const t = a(null), r = a(0), o = l(() => ({
43
- [S]: !0
44
- }));
45
- return u(() => {
46
- }), f("avatarGroup", {
47
- props: e,
48
- avatarGroupRef: t,
49
- index: r
50
- }), {
51
- classes: o,
41
+ setup(props, { emit, slots }) {
42
+ toRefs(props);
43
+ const avatarGroupRef = ref(null);
44
+ const index2 = ref(0);
45
+ const classes = computed(() => {
46
+ const prefixCls = componentName;
47
+ return {
48
+ [prefixCls]: true
49
+ };
50
+ });
51
+ onMounted(() => {
52
+ });
53
+ provide("avatarGroup", {
54
+ props,
55
+ avatarGroupRef,
56
+ index: index2
57
+ });
58
+ return {
59
+ classes,
52
60
  // styles,
53
- avatarGroupRef: t
61
+ avatarGroupRef
54
62
  };
55
63
  }
56
64
  });
57
- function _(e, n, s, t, r, o) {
58
- return i(), c("view", {
59
- class: d(e.classes),
65
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
66
+ return openBlock(), createElementBlock("view", {
67
+ class: normalizeClass(_ctx.classes),
60
68
  ref: "avatarGroupRef"
61
69
  }, [
62
- m(e.$slots, "default")
70
+ renderSlot(_ctx.$slots, "default")
63
71
  ], 2);
64
72
  }
65
- const R = /* @__PURE__ */ x(C, [["render", _]]);
73
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
66
74
  export {
67
- R as default
75
+ index as default
68
76
  };