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