@nutui/nutui 4.0.12-beta.1 → 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.
- package/dist/nutui.es.js +1 -1
- package/dist/nutui.js +1 -1
- package/dist/nutui.umd.js +1 -1
- package/dist/packages/_es/ActionSheet.js +111 -78
- package/dist/packages/_es/Address.js +375 -250
- package/dist/packages/_es/AddressList.js +354 -269
- package/dist/packages/_es/Animate.js +58 -41
- package/dist/packages/_es/Audio.js +197 -128
- package/dist/packages/_es/AudioOperate.js +71 -60
- package/dist/packages/_es/Avatar.js +89 -66
- package/dist/packages/_es/AvatarGroup.js +31 -23
- package/dist/packages/_es/Backtop.js +99 -59
- package/dist/packages/_es/Badge.js +47 -36
- package/dist/packages/_es/Barrage.js +147 -68
- package/dist/packages/_es/Button.js +66 -47
- package/dist/packages/_es/Calendar.js +157 -135
- package/dist/packages/_es/CalendarItem.js +6 -6
- package/dist/packages/_es/Card.js +56 -42
- package/dist/packages/_es/Cascader.js +474 -315
- package/dist/packages/_es/Category.js +39 -29
- package/dist/packages/_es/CategoryPane.js +83 -57
- package/dist/packages/_es/Cell.js +71 -56
- package/dist/packages/_es/CellGroup.js +27 -19
- package/dist/packages/_es/Checkbox.js +156 -109
- package/dist/packages/_es/CheckboxGroup.js +59 -38
- package/dist/packages/_es/CircleProgress.js +96 -67
- package/dist/packages/_es/Col.js +31 -23
- package/dist/packages/_es/Collapse.js +58 -33
- package/dist/packages/_es/CollapseItem.js +108 -78
- package/dist/packages/_es/Comment.js +279 -207
- package/dist/packages/_es/ConfigProvider.js +55 -37
- package/dist/packages/_es/Countdown.js +212 -100
- package/dist/packages/_es/Countup.js +445 -232
- package/dist/packages/_es/DatePicker.js +265 -162
- package/dist/packages/_es/Dialog.js +213 -161
- package/dist/packages/_es/Divider.js +57 -42
- package/dist/packages/_es/Drag.js +153 -70
- package/dist/packages/_es/Ecard.js +104 -64
- package/dist/packages/_es/Elevator.js +219 -143
- package/dist/packages/_es/Ellipsis.js +178 -95
- package/dist/packages/_es/Empty.js +39 -23
- package/dist/packages/_es/FixedNav.js +116 -93
- package/dist/packages/_es/Form.js +178 -107
- package/dist/packages/_es/FormItem.js +61 -48
- package/dist/packages/_es/Grid.js +6 -5
- package/dist/packages/_es/GridItem.js +84 -58
- package/dist/packages/_es/Image.js +130 -90
- package/dist/packages/_es/ImagePreview.js +412 -256
- package/dist/packages/_es/Indicator.js +34 -30
- package/dist/packages/_es/InfiniteLoading.js +136 -83
- package/dist/packages/_es/Input.js +264 -160
- package/dist/packages/_es/InputNumber.js +117 -81
- package/dist/packages/_es/Interceptor-956b24fc.js +29 -0
- package/dist/packages/_es/Invoice.js +130 -104
- package/dist/packages/_es/Layout.js +4 -3
- package/dist/packages/_es/List.js +215 -117
- package/dist/packages/_es/Menu.js +150 -95
- package/dist/packages/_es/MenuItem.js +154 -109
- package/dist/packages/_es/Navbar.js +119 -103
- package/dist/packages/_es/Noticebar.js +312 -197
- package/dist/packages/_es/Notify.js +166 -110
- package/dist/packages/_es/NumberKeyboard.js +202 -127
- package/dist/packages/_es/Overlay.js +80 -52
- package/dist/packages/_es/Pagination.js +100 -70
- package/dist/packages/_es/Picker.js +437 -275
- package/dist/packages/_es/Popover.js +225 -122
- package/dist/packages/_es/Popup.js +4 -4
- package/dist/packages/_es/Price.js +82 -44
- package/dist/packages/_es/Progress.js +79 -63
- package/dist/packages/_es/PullRefresh.js +173 -95
- package/dist/packages/_es/Radio.js +4 -4
- package/dist/packages/_es/RadioGroup.js +3 -3
- package/dist/packages/_es/Range.js +347 -204
- package/dist/packages/_es/Rate.js +141 -92
- package/dist/packages/_es/Row.js +27 -21
- package/dist/packages/_es/Searchbar.js +174 -123
- package/dist/packages/_es/ShortPassword.js +93 -69
- package/dist/packages/_es/SideNavbar.js +80 -49
- package/dist/packages/_es/SideNavbarItem.js +32 -22
- package/dist/packages/_es/Signature.js +146 -83
- package/dist/packages/_es/Skeleton.js +130 -110
- package/dist/packages/_es/Sku.js +343 -250
- package/dist/packages/_es/Step.js +86 -59
- package/dist/packages/_es/Steps.js +31 -26
- package/dist/packages/_es/Sticky.js +4 -4
- package/dist/packages/_es/SubSideNavbar.js +74 -52
- package/dist/packages/_es/Swipe.js +155 -83
- package/dist/packages/_es/Swiper.js +311 -174
- package/dist/packages/_es/SwiperItem.js +44 -28
- package/dist/packages/_es/Switch.js +68 -55
- package/dist/packages/_es/TabPane.js +41 -30
- package/dist/packages/_es/Tabbar.js +52 -41
- package/dist/packages/_es/TabbarItem.js +82 -61
- package/dist/packages/_es/Table.js +165 -109
- package/dist/packages/_es/Tabs.js +388 -240
- package/dist/packages/_es/Tag.js +61 -44
- package/dist/packages/_es/Textarea.js +124 -80
- package/dist/packages/_es/TimeDetail.js +76 -49
- package/dist/packages/_es/TimePannel.js +48 -34
- package/dist/packages/_es/TimeSelect.js +68 -47
- package/dist/packages/_es/Toast.js +218 -144
- package/dist/packages/_es/Tour.js +192 -138
- package/dist/packages/_es/TrendArrow.js +77 -57
- package/dist/packages/_es/Uploader.js +359 -234
- package/dist/packages/_es/Video.js +316 -191
- package/dist/packages/_es/Watermark.js +117 -84
- package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +10 -0
- package/dist/packages/_es/common-b9a5e726.js +145 -0
- package/dist/packages/_es/component-81a4c1d0.js +145 -0
- package/dist/packages/_es/index-29892cda.js +33 -0
- package/dist/packages/_es/index-43c34ac6.js +30 -0
- package/dist/packages/_es/index-54d03fc1.js +8 -0
- package/dist/packages/_es/index-79c5dc33.js +10 -0
- package/dist/packages/_es/index-7a7385e4.js +67 -0
- package/dist/packages/_es/index-87422be8.js +942 -0
- package/dist/packages/_es/index-da0a7662.js +259 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +46 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-a8856969.js +97 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +151 -0
- package/dist/packages/_es/mountComponent-8b24c346.js +39 -0
- package/dist/packages/_es/pxCheck-c6b9f6b7.js +6 -0
- package/dist/packages/_es/raf-729dad54.js +25 -0
- package/dist/packages/_es/renderIcon-3d0fd47c.js +9 -0
- package/dist/packages/locale/lang/baseLang-3a8457ac.js +5 -0
- package/dist/packages/locale/lang/en-US.js +39 -36
- package/dist/packages/locale/lang/id-ID.js +39 -36
- package/dist/packages/locale/lang/index.js +44 -22
- package/dist/packages/locale/lang/zh-CN.js +38 -35
- package/dist/packages/locale/lang/zh-TW.js +38 -35
- package/dist/resolver/index.js +26 -1
- package/dist/resolver/index.mjs +17 -14
- package/dist/smartips/web-types.json +1 -1
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +50 -50
- package/dist/styles/themes/jdb.scss +50 -50
- package/dist/styles/themes/jddkh.scss +50 -50
- package/dist/styles/themes/jdt.scss +50 -50
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/packages/_es/Interceptor-6e26b757.js +0 -18
- package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +0 -9
- package/dist/packages/_es/common-d218746f.js +0 -116
- package/dist/packages/_es/component-234624bc.js +0 -89
- package/dist/packages/_es/index-14dfadc4.js +0 -561
- package/dist/packages/_es/index-192a3ef6.js +0 -29
- package/dist/packages/_es/index-360c5092.js +0 -210
- package/dist/packages/_es/index-496e6e05.js +0 -24
- package/dist/packages/_es/index-50eed3d9.js +0 -7
- package/dist/packages/_es/index-53ec2d4d.js +0 -34
- package/dist/packages/_es/index-fadb0974.js +0 -8
- package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +0 -43
- package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +0 -77
- package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +0 -110
- package/dist/packages/_es/mountComponent-6d4ff200.js +0 -23
- package/dist/packages/_es/pxCheck-38173291.js +0 -4
- package/dist/packages/_es/raf-a74f1a06.js +0 -16
- package/dist/packages/_es/renderIcon-47498b32.js +0 -5
- package/dist/packages/locale/lang/baseLang-0bdc6353.js +0 -5
|
@@ -1,22 +1,30 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
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
|
-
[
|
|
36
|
+
[Button.name]: Button
|
|
29
37
|
},
|
|
30
38
|
emits: ["click"],
|
|
31
|
-
setup(
|
|
32
|
-
const
|
|
33
|
-
|
|
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
|
-
})
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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:
|
|
53
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.fastBack && _ctx.fastBack(...args))
|
|
43
54
|
}, [
|
|
44
|
-
|
|
55
|
+
!_ctx.customSlot ? (openBlock(), createBlock(_component_nut_button, {
|
|
45
56
|
key: 0,
|
|
46
57
|
type: "primary",
|
|
47
58
|
size: "small"
|
|
48
59
|
}, {
|
|
49
|
-
default:
|
|
50
|
-
|
|
60
|
+
default: withCtx(() => [
|
|
61
|
+
createTextVNode(toDisplayString(_ctx.translate("back")), 1)
|
|
51
62
|
]),
|
|
52
63
|
_: 1
|
|
53
|
-
})),
|
|
54
|
-
|
|
55
|
-
])) :
|
|
56
|
-
|
|
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:
|
|
70
|
+
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.changeStatus && _ctx.changeStatus(...args))
|
|
60
71
|
}, [
|
|
61
|
-
|
|
72
|
+
!_ctx.customSlot ? (openBlock(), createBlock(_component_nut_button, {
|
|
62
73
|
key: 0,
|
|
63
74
|
type: "primary",
|
|
64
75
|
size: "small"
|
|
65
76
|
}, {
|
|
66
|
-
default:
|
|
67
|
-
|
|
77
|
+
default: withCtx(() => [
|
|
78
|
+
createTextVNode(toDisplayString(!_ctx.audioData.playing ? `${_ctx.translate("start")}` : `${_ctx.translate("pause")}`), 1)
|
|
68
79
|
]),
|
|
69
80
|
_: 1
|
|
70
|
-
})),
|
|
71
|
-
|
|
72
|
-
])) :
|
|
73
|
-
|
|
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:
|
|
87
|
+
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.forward && _ctx.forward(...args))
|
|
77
88
|
}, [
|
|
78
|
-
|
|
89
|
+
!_ctx.customSlot ? (openBlock(), createBlock(_component_nut_button, {
|
|
79
90
|
key: 0,
|
|
80
91
|
type: "primary",
|
|
81
92
|
size: "small"
|
|
82
93
|
}, {
|
|
83
|
-
default:
|
|
84
|
-
|
|
94
|
+
default: withCtx(() => [
|
|
95
|
+
createTextVNode("快进")
|
|
85
96
|
]),
|
|
86
97
|
_: 1
|
|
87
|
-
})),
|
|
88
|
-
|
|
89
|
-
])) :
|
|
90
|
-
|
|
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:
|
|
104
|
+
onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleMute && _ctx.handleMute(...args))
|
|
94
105
|
}, [
|
|
95
|
-
|
|
106
|
+
!_ctx.customSlot ? (openBlock(), createBlock(_component_nut_button, {
|
|
96
107
|
key: 0,
|
|
97
|
-
type:
|
|
108
|
+
type: !_ctx.audioData.hanMuted ? "primary" : "default",
|
|
98
109
|
size: "small"
|
|
99
110
|
}, {
|
|
100
|
-
default:
|
|
101
|
-
|
|
111
|
+
default: withCtx(() => [
|
|
112
|
+
createTextVNode(toDisplayString(_ctx.translate("mute")), 1)
|
|
102
113
|
]),
|
|
103
114
|
_: 1
|
|
104
|
-
}, 8, ["type"])),
|
|
105
|
-
|
|
106
|
-
])) :
|
|
115
|
+
}, 8, ["type"])) : createCommentVNode("", true),
|
|
116
|
+
renderSlot(_ctx.$slots, "default")
|
|
117
|
+
])) : createCommentVNode("", true)
|
|
107
118
|
]);
|
|
108
119
|
}
|
|
109
|
-
const
|
|
120
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
110
121
|
export {
|
|
111
|
-
|
|
122
|
+
index as default
|
|
112
123
|
};
|
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
|
13
|
-
import { c as
|
|
14
|
-
import { _ as
|
|
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
|
|
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(
|
|
36
|
-
const { size
|
|
37
|
-
|
|
38
|
-
|
|
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:
|
|
51
|
+
showMax: false,
|
|
41
52
|
// 是否显示的最大头像个数
|
|
42
53
|
maxIndex: 0
|
|
43
54
|
// avatarGroup里的avatar的个数
|
|
44
55
|
});
|
|
45
|
-
|
|
46
|
-
var
|
|
47
|
-
const
|
|
48
|
-
|
|
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
|
|
51
|
-
var
|
|
63
|
+
const classes = computed(() => {
|
|
64
|
+
var _a, _b;
|
|
65
|
+
const prefixCls = componentName;
|
|
52
66
|
return {
|
|
53
|
-
[
|
|
54
|
-
[`nut-avatar-${
|
|
55
|
-
[`nut-avatar-${
|
|
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
|
-
})
|
|
58
|
-
|
|
71
|
+
});
|
|
72
|
+
const styles = computed(() => {
|
|
73
|
+
var _a, _b, _c;
|
|
59
74
|
return {
|
|
60
|
-
width:
|
|
61
|
-
height:
|
|
62
|
-
backgroundColor: `${
|
|
63
|
-
color: `${
|
|
64
|
-
marginLeft:
|
|
65
|
-
zIndex: ((
|
|
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
|
-
})
|
|
68
|
-
|
|
82
|
+
});
|
|
83
|
+
const maxStyles = computed(() => {
|
|
84
|
+
var _a, _b;
|
|
69
85
|
return {
|
|
70
|
-
backgroundColor: `${(
|
|
71
|
-
color: `${(
|
|
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
|
-
})
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
|
81
|
-
classes
|
|
82
|
-
styles
|
|
83
|
-
maxStyles
|
|
84
|
-
avatarGroup
|
|
85
|
-
visible
|
|
86
|
-
avatarRef
|
|
87
|
-
},
|
|
103
|
+
return __spreadValues({
|
|
104
|
+
classes,
|
|
105
|
+
styles,
|
|
106
|
+
maxStyles,
|
|
107
|
+
avatarGroup,
|
|
108
|
+
visible,
|
|
109
|
+
avatarRef
|
|
110
|
+
}, toRefs(state));
|
|
88
111
|
}
|
|
89
112
|
});
|
|
90
|
-
function
|
|
91
|
-
var
|
|
92
|
-
return
|
|
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:
|
|
95
|
-
class:
|
|
117
|
+
style: normalizeStyle(!_ctx.showMax ? _ctx.styles : _ctx.maxStyles),
|
|
118
|
+
class: normalizeClass(_ctx.classes),
|
|
96
119
|
ref: "avatarRef"
|
|
97
120
|
}, [
|
|
98
|
-
!((
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
], 64)) :
|
|
102
|
-
], 6)) :
|
|
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
|
|
127
|
+
const Avatar = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
105
128
|
export {
|
|
106
|
-
|
|
129
|
+
Avatar as default
|
|
107
130
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { toRefs
|
|
2
|
-
import { c as
|
|
3
|
-
import { _ as
|
|
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
|
|
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(
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
|
61
|
+
avatarGroupRef
|
|
54
62
|
};
|
|
55
63
|
}
|
|
56
64
|
});
|
|
57
|
-
function
|
|
58
|
-
return
|
|
59
|
-
class:
|
|
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
|
-
|
|
70
|
+
renderSlot(_ctx.$slots, "default")
|
|
63
71
|
], 2);
|
|
64
72
|
}
|
|
65
|
-
const
|
|
73
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
66
74
|
export {
|
|
67
|
-
|
|
75
|
+
index as default
|
|
68
76
|
};
|