@nutui/nutui 3.1.21 → 3.1.22-beta.5
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 +4203 -19263
- package/dist/nutui.umd.js +4208 -19368
- package/dist/packages/_es/ActionSheet.js +17 -167
- package/dist/packages/_es/Address.js +110 -552
- package/dist/packages/_es/AddressList.js +113 -613
- package/dist/packages/_es/Animate.js +22 -0
- package/dist/packages/_es/Audio.js +53 -274
- package/dist/packages/_es/AudioOperate.js +13 -121
- package/dist/packages/_es/Avatar.js +38 -177
- package/dist/packages/_es/AvatarGroup.js +14 -73
- package/dist/packages/_es/BackTop.js +43 -156
- package/dist/packages/_es/Badge.js +14 -86
- package/dist/packages/_es/Barrage.js +41 -120
- package/dist/packages/_es/Button.js +23 -128
- package/dist/packages/_es/Calendar.js +30 -237
- package/dist/packages/_es/CalendarItem.js +2 -1
- package/dist/packages/_es/Card.js +10 -107
- package/dist/packages/_es/Cascader.js +147 -523
- package/dist/packages/_es/Category.js +15 -58
- package/dist/packages/_es/CategoryPane.js +11 -111
- package/dist/packages/_es/Cell.js +21 -100
- package/dist/packages/_es/CellGroup.js +9 -44
- package/dist/packages/_es/Checkbox.js +31 -113
- package/dist/packages/_es/CheckboxGroup.js +29 -58
- package/dist/packages/_es/CircleProgress.js +28 -151
- package/dist/packages/_es/Col.js +14 -56
- package/dist/packages/_es/Collapse.js +32 -84
- package/dist/packages/_es/CollapseItem.js +59 -272
- package/dist/packages/_es/Comment.js +64 -434
- package/dist/packages/_es/ConfigProvider.js +13 -0
- package/dist/packages/_es/CountDown.js +56 -256
- package/dist/packages/_es/CountUp.js +140 -556
- package/dist/packages/_es/DatePicker.js +98 -332
- package/dist/packages/_es/Dialog.js +60 -271
- package/dist/packages/_es/Divider.js +13 -82
- package/dist/packages/_es/Drag.js +56 -197
- package/dist/packages/_es/Ecard.js +24 -159
- package/dist/packages/_es/Elevator.js +58 -212
- package/dist/packages/_es/Ellipsis.js +64 -0
- package/dist/packages/_es/Empty.js +12 -71
- package/dist/packages/_es/FixedNav.js +15 -122
- package/dist/packages/_es/Form.js +64 -151
- package/dist/packages/_es/FormItem.js +15 -110
- package/dist/packages/_es/Grid.js +5 -6
- package/dist/packages/_es/GridItem.js +33 -144
- package/dist/packages/_es/Icon.js +15 -40
- package/dist/packages/_es/Image.js +31 -0
- package/dist/packages/_es/ImagePreview.js +77 -309
- package/dist/packages/_es/Indicator.js +15 -62
- package/dist/packages/_es/InfiniteLoading.js +57 -268
- package/dist/packages/_es/Input.js +51 -413
- package/dist/packages/_es/InputNumber.js +41 -160
- package/dist/packages/_es/Layout.js +4 -5
- package/dist/packages/_es/List.js +18 -124
- package/dist/packages/_es/Menu.js +45 -118
- package/dist/packages/_es/MenuItem.js +37 -162
- package/dist/packages/_es/Navbar.js +30 -192
- package/dist/packages/_es/NoticeBar.js +74 -397
- package/dist/packages/_es/Notify.js +72 -246
- package/dist/packages/_es/NumberKeyboard.js +41 -272
- package/dist/packages/_es/OldPicker.js +131 -474
- package/dist/packages/_es/OverLay.js +24 -113
- package/dist/packages/_es/Pagination.js +39 -157
- package/dist/packages/_es/Picker.js +129 -469
- package/dist/packages/_es/Popover.js +318 -975
- package/dist/packages/_es/Popup.js +55 -313
- package/dist/packages/_es/Price.js +16 -118
- package/dist/packages/_es/Progress.js +14 -146
- package/dist/packages/_es/PullRefresh.js +84 -354
- package/dist/packages/_es/Radio.js +22 -90
- package/dist/packages/_es/RadioGroup.js +8 -37
- package/dist/packages/_es/Range.js +83 -427
- package/dist/packages/_es/Rate.js +35 -137
- package/dist/packages/_es/Row.js +22 -64
- package/dist/packages/_es/SearchBar.js +37 -257
- package/dist/packages/_es/ShortPassword.js +35 -225
- package/dist/packages/_es/SideNavBar.js +24 -99
- package/dist/packages/_es/SideNavBarItem.js +11 -46
- package/dist/packages/_es/Signature.js +41 -179
- package/dist/packages/_es/Skeleton.js +20 -136
- package/dist/packages/_es/Sku.js +84 -509
- package/dist/packages/_es/Step.js +20 -133
- package/dist/packages/_es/Steps.js +18 -53
- package/dist/packages/_es/Sticky.js +53 -138
- package/dist/packages/_es/SubSideNavBar.js +17 -100
- package/dist/packages/_es/Swipe.js +41 -197
- package/dist/packages/_es/Swiper.js +121 -433
- package/dist/packages/_es/SwiperItem.js +22 -53
- package/dist/packages/_es/Switch.js +21 -116
- package/dist/packages/_es/TabPane.js +12 -39
- package/dist/packages/_es/Tabbar.js +17 -72
- package/dist/packages/_es/TabbarItem.js +29 -151
- package/dist/packages/_es/Table.js +18 -196
- package/dist/packages/_es/Tabs.js +43 -217
- package/dist/packages/_es/Tag.js +20 -97
- package/dist/packages/_es/TextArea.js +42 -160
- package/dist/packages/_es/TimeDetail.js +18 -98
- package/dist/packages/_es/TimePannel.js +14 -66
- package/dist/packages/_es/TimeSelect.js +15 -103
- package/dist/packages/_es/Toast.js +71 -329
- package/dist/packages/_es/Uploader.js +104 -468
- package/dist/packages/_es/Video.js +74 -350
- package/dist/packages/_es/common.js +38 -128
- package/dist/packages/_es/component.js +35 -76
- package/dist/packages/_es/index.js +5 -6
- package/dist/packages/_es/index2.js +9 -30
- package/dist/packages/_es/index3.js +6 -8
- package/dist/packages/_es/index4.js +13 -58
- package/dist/packages/_es/index5.js +164 -682
- package/dist/packages/_es/plugin-vue_export-helper.js +7 -8
- package/dist/packages/_es/pxCheck.js +3 -5
- package/dist/packages/_es/raf.js +8 -15
- package/dist/packages/animate/index.scss +299 -0
- package/dist/packages/button/index.scss +2 -1
- package/dist/packages/cell/index.scss +18 -1
- package/dist/packages/checkbox/index.scss +16 -0
- package/dist/packages/configprovider/index.scss +2 -0
- package/dist/packages/dialog/index.scss +1 -0
- package/dist/packages/elevator/index.scss +21 -0
- package/dist/packages/ellipsis/index.scss +12 -0
- package/dist/packages/formitem/index.scss +12 -0
- package/dist/packages/griditem/index.scss +11 -0
- package/dist/packages/image/index.scss +39 -0
- package/dist/packages/imagepreview/index.scss +21 -2
- package/dist/packages/input/index.scss +26 -1
- package/dist/packages/inputnumber/index.scss +21 -0
- package/dist/packages/locale/lang/baseLang.d.ts +1 -0
- package/dist/packages/locale/lang/baseLang.js +3 -3
- package/dist/packages/locale/lang/en-US.d.ts +8 -0
- package/dist/packages/locale/lang/en-US.js +5 -97
- package/dist/packages/locale/lang/id-ID.d.ts +8 -0
- package/dist/packages/locale/lang/id-ID.js +5 -97
- package/dist/packages/locale/lang/index.js +16 -38
- package/dist/packages/locale/lang/zh-CN.d.ts +8 -0
- package/dist/packages/locale/lang/zh-CN.js +5 -97
- package/dist/packages/locale/lang/zh-TW.d.ts +8 -0
- package/dist/packages/locale/lang/zh-TW.js +5 -97
- package/dist/packages/menu/index.scss +45 -36
- package/dist/packages/menuitem/index.scss +4 -0
- package/dist/packages/navbar/index.scss +9 -0
- package/dist/packages/pagination/index.scss +19 -0
- package/dist/packages/radio/index.scss +19 -0
- package/dist/packages/range/index.scss +19 -0
- package/dist/packages/rate/index.scss +1 -1
- package/dist/packages/searchbar/index.scss +21 -0
- package/dist/packages/switch/index.scss +4 -3
- package/dist/packages/tabbar/index.scss +5 -0
- package/dist/packages/tabbaritem/index.scss +7 -0
- package/dist/packages/tabpane/index.scss +6 -0
- package/dist/packages/tabs/index.scss +22 -0
- package/dist/packages/textarea/index.scss +8 -0
- package/dist/smartips/attributes.json +192 -12
- package/dist/smartips/tags.json +70 -10
- package/dist/smartips/web-types.json +6945 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/font/config.json +3 -1
- package/dist/styles/font/demo_index.html +49 -3
- package/dist/styles/font/iconfont.css +11 -3
- package/dist/styles/font/iconfont.js +15 -15
- package/dist/styles/font/iconfont.json +14 -0
- package/dist/styles/font/iconfont.ttf +0 -0
- package/dist/styles/font/iconfont.woff +0 -0
- package/dist/styles/font/iconfont.woff2 +0 -0
- package/dist/styles/themes/default.scss +54 -50
- package/dist/styles/themes/jdb.scss +54 -50
- package/dist/styles/themes/jdt.scss +54 -50
- package/dist/styles/variables-jdb.scss +19 -1
- package/dist/styles/variables-jdt.scss +19 -1
- package/dist/styles/variables.scss +22 -1
- package/dist/types/__VUE/address/index.vue.d.ts +2 -2
- package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +1 -0
- package/dist/types/__VUE/animate/index.vue.d.ts +48 -0
- package/dist/types/__VUE/animate/type.d.ts +6 -0
- package/dist/types/__VUE/audiooperate/index.vue.d.ts +1 -0
- package/dist/types/__VUE/avatar/index.vue.d.ts +7 -7
- 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 +2 -2
- package/dist/types/__VUE/calendaritem/index.vue.d.ts +10 -2
- package/dist/types/__VUE/cell/index.vue.d.ts +13 -6
- package/dist/types/__VUE/checkbox/common.d.ts +59 -0
- package/dist/types/__VUE/checkbox/index.vue.d.ts +20 -7
- package/dist/types/__VUE/checkboxgroup/index.vue.d.ts +7 -0
- package/dist/types/__VUE/circleprogress/index.vue.d.ts +2 -2
- package/dist/types/__VUE/collapse/index.vue.d.ts +5 -3
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +2 -2
- package/dist/types/__VUE/configprovider/common.d.ts +20 -0
- package/dist/types/__VUE/configprovider/index.vue.d.ts +33 -0
- package/dist/types/__VUE/datepicker/index.vue.d.ts +5 -5
- package/dist/types/__VUE/datepicker/type.d.ts +6 -0
- package/dist/types/__VUE/dialog/index.d.ts +9 -2
- package/dist/types/__VUE/dialog/index.vue.d.ts +26 -17
- package/dist/types/__VUE/ecard/index.vue.d.ts +3 -3
- package/dist/types/__VUE/elevator/index.vue.d.ts +29 -0
- package/dist/types/__VUE/ellipsis/index.vue.d.ts +72 -0
- package/dist/types/__VUE/empty/index.vue.d.ts +2 -2
- package/dist/types/__VUE/formitem/index.vue.d.ts +3 -10
- package/dist/types/__VUE/grid/common.d.ts +3 -3
- package/dist/types/__VUE/grid/index.vue.d.ts +5 -5
- package/dist/types/__VUE/griditem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/image/index.vue.d.ts +105 -0
- package/dist/types/__VUE/image/type.d.ts +6 -0
- package/dist/types/__VUE/imagepreview/index.vue.d.ts +36 -2
- package/dist/types/__VUE/infiniteloading/index.vue.d.ts +6 -6
- package/dist/types/__VUE/input/index.vue.d.ts +4 -4
- package/dist/types/__VUE/menu/index.vue.d.ts +29 -2
- package/dist/types/__VUE/menuitem/index.vue.d.ts +16 -7
- package/dist/types/__VUE/menuitem/type.d.ts +8 -0
- package/dist/types/__VUE/noticebar/index.vue.d.ts +3 -3
- package/dist/types/__VUE/picker/Column.vue.d.ts +1 -1
- package/dist/types/__VUE/picker/index.vue.d.ts +1 -1
- package/dist/types/__VUE/popover/index.vue.d.ts +2 -2
- package/dist/types/__VUE/range/index.vue.d.ts +1 -1
- package/dist/types/__VUE/rate/common.d.ts +149 -0
- package/dist/types/__VUE/rate/index.vue.d.ts +17 -7
- package/dist/types/__VUE/searchbar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/skeleton/common.d.ts +2 -4
- package/dist/types/__VUE/step/index.vue.d.ts +2 -2
- package/dist/types/__VUE/swiper/index.vue.d.ts +4 -4
- package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tabbaritem/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tabs/common.d.ts +2 -2
- package/dist/types/__VUE/textarea/index.vue.d.ts +2 -2
- package/dist/types/__VUE/timeselect/index.vue.d.ts +8 -0
- package/dist/types/__VUE/toast/index.vue.d.ts +2 -2
- package/dist/types/__VUE/uploader/index.vue.d.ts +4 -4
- package/dist/types/__VUE/uploader/type.d.ts +2 -1
- package/dist/types/__VUE/uploader/uploader.d.ts +1 -0
- package/dist/types/__VUE/video/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/nutui.d.ts +5 -1
- package/package.json +7 -3
|
@@ -1,183 +1,44 @@
|
|
|
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
1
|
/*!
|
|
18
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
|
|
19
3
|
* (c) 2022 @jdf2e.
|
|
20
4
|
* Released under the MIT License.
|
|
21
5
|
*/
|
|
22
|
-
import { toRefs, inject, ref, reactive, onMounted, computed, resolveComponent, openBlock, createElementBlock, normalizeStyle, normalizeClass, Fragment, createBlock, createCommentVNode, renderSlot, toDisplayString } from "vue";
|
|
23
|
-
import { c as
|
|
24
|
-
import { _ as
|
|
6
|
+
import { toRefs as a, inject as e, ref as t, reactive as r, onMounted as o, computed as n, resolveComponent as s, openBlock as l, createElementBlock as p, normalizeStyle as u, normalizeClass as i, Fragment as x, createBlock as v, createCommentVNode as c, renderSlot as m, toDisplayString as d } from "vue";
|
|
7
|
+
import { c as f } from "./component.js";
|
|
8
|
+
import { _ as g } from "./plugin-vue_export-helper.js";
|
|
25
9
|
import "../locale/lang";
|
|
26
|
-
const { componentName, create } =
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
color: {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
emits: ["active-avatar", "onError"],
|
|
59
|
-
setup(props, { emit, slots }) {
|
|
60
|
-
const { size, shape, bgColor, color, icon } = toRefs(props);
|
|
61
|
-
const sizeValue = ["large", "normal", "small"];
|
|
62
|
-
const avatarGroup = inject("avatarGroup", null);
|
|
63
|
-
const avatarRef = ref(null);
|
|
64
|
-
const visible = reactive({
|
|
65
|
-
lightTheme: false
|
|
66
|
-
});
|
|
67
|
-
const state = reactive({
|
|
68
|
-
index: 1,
|
|
69
|
-
showMax: false,
|
|
70
|
-
maxIndex: 0
|
|
71
|
-
});
|
|
72
|
-
onMounted(() => {
|
|
73
|
-
var _a, _b;
|
|
74
|
-
const children = (_b = (_a = avatarGroup == null ? void 0 : avatarGroup.avatarGroupRef) == null ? void 0 : _a.value) == null ? void 0 : _b.children;
|
|
75
|
-
if (children) {
|
|
76
|
-
avatarLength(children);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
const classes = computed(() => {
|
|
80
|
-
var _a, _b;
|
|
81
|
-
const prefixCls = componentName;
|
|
82
|
-
return {
|
|
83
|
-
[prefixCls]: true,
|
|
84
|
-
[`nut-avatar-${size.value || ((_a = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _a.size) || "normal"}`]: true,
|
|
85
|
-
[`nut-avatar-${shape.value || ((_b = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _b.shape) || "normal"}`]: true
|
|
86
|
-
};
|
|
87
|
-
});
|
|
88
|
-
const styles = computed(() => {
|
|
89
|
-
var _a, _b, _c;
|
|
90
|
-
return {
|
|
91
|
-
width: sizeValue.indexOf(size.value) > -1 ? "" : `${size.value}px`,
|
|
92
|
-
height: sizeValue.indexOf(size.value) > -1 ? "" : `${size.value}px`,
|
|
93
|
-
backgroundColor: `${bgColor.value}`,
|
|
94
|
-
color: `${color.value}`,
|
|
95
|
-
marginLeft: state.index != 1 && (((_a = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _a.span) ? `${(_b = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _b.span}px` : ""),
|
|
96
|
-
zIndex: ((_c = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _c.zIndex) == "right" ? `${Math.abs(state.maxIndex - state.index)}` : ""
|
|
97
|
-
};
|
|
98
|
-
});
|
|
99
|
-
const maxStyles = computed(() => {
|
|
100
|
-
var _a, _b;
|
|
101
|
-
return {
|
|
102
|
-
backgroundColor: `${(_a = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _a.maxBgColor}`,
|
|
103
|
-
color: `${(_b = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _b.maxColor}`
|
|
104
|
-
};
|
|
105
|
-
});
|
|
106
|
-
const iconStyles = computed(() => {
|
|
107
|
-
return !!icon.value ? icon.value : "";
|
|
108
|
-
});
|
|
109
|
-
const isShowText = computed(() => {
|
|
110
|
-
return slots.default;
|
|
111
|
-
});
|
|
112
|
-
const avatarLength = (children) => {
|
|
113
|
-
var _a, _b, _c;
|
|
114
|
-
state.maxIndex = children.length;
|
|
115
|
-
for (let i = 0; i < children.length; i++) {
|
|
116
|
-
if (children[i] && children[i].classList && children[i].classList[0] == "nut-avatar") {
|
|
117
|
-
children[i].setAttribute("data-index", i + 1);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
state.index = (_b = (_a = avatarRef == null ? void 0 : avatarRef.value) == null ? void 0 : _a.dataset) == null ? void 0 : _b.index;
|
|
121
|
-
if (state.index == state.maxIndex && state.index != ((_c = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _c.maxCount)) {
|
|
122
|
-
state.showMax = true;
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
const activeAvatar = (event) => {
|
|
126
|
-
emit("active-avatar", event);
|
|
127
|
-
};
|
|
128
|
-
const onError = (event) => {
|
|
129
|
-
emit("onError", event);
|
|
130
|
-
};
|
|
131
|
-
return __spreadValues({
|
|
132
|
-
classes,
|
|
133
|
-
styles,
|
|
134
|
-
iconStyles,
|
|
135
|
-
isShowText,
|
|
136
|
-
maxStyles,
|
|
137
|
-
activeAvatar,
|
|
138
|
-
onError,
|
|
139
|
-
avatarGroup,
|
|
140
|
-
visible,
|
|
141
|
-
avatarRef
|
|
142
|
-
}, toRefs(state));
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
const _hoisted_1 = ["src", "alt"];
|
|
146
|
-
const _hoisted_2 = {
|
|
147
|
-
key: 2,
|
|
148
|
-
class: "text"
|
|
149
|
-
};
|
|
150
|
-
const _hoisted_3 = {
|
|
151
|
-
key: 1,
|
|
152
|
-
class: "text"
|
|
153
|
-
};
|
|
154
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
10
|
+
const { componentName: h, create: y } = f("avatar"), C = y({ props: { size: { type: String, default: "" }, shape: { type: String, default: "round" }, bgColor: { type: String, default: "#eee" }, color: { type: String, default: "#666" }, url: { type: String, default: "" }, alt: { type: String, default: "" }, icon: { type: String, default: "" } }, emits: ["active-avatar", "onError"], setup(s2, { emit: l2, slots: p2 }) {
|
|
11
|
+
const { size: u2, shape: i2, bgColor: x2, color: v2, icon: c2 } = a(s2), m2 = ["large", "normal", "small"], d2 = e("avatarGroup", null), f2 = t(null), g2 = r({ lightTheme: false }), y2 = r({ index: 1, showMax: false, maxIndex: 0 });
|
|
12
|
+
o(() => {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
const a2 = (_b = (_a = d2 == null ? void 0 : d2.avatarGroupRef) == null ? void 0 : _a.value) == null ? void 0 : _b.children;
|
|
15
|
+
a2 && k(a2);
|
|
16
|
+
});
|
|
17
|
+
const C2 = n(() => {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
return { [h]: true, [`nut-avatar-${u2.value || ((_a = d2 == null ? void 0 : d2.props) == null ? void 0 : _a.size) || "normal"}`]: true, [`nut-avatar-${i2.value || ((_b = d2 == null ? void 0 : d2.props) == null ? void 0 : _b.shape) || "normal"}`]: true };
|
|
20
|
+
}), S2 = n(() => {
|
|
21
|
+
var _a, _b, _c;
|
|
22
|
+
return { width: m2.indexOf(u2.value) > -1 ? "" : `${u2.value}px`, height: m2.indexOf(u2.value) > -1 ? "" : `${u2.value}px`, backgroundColor: `${x2.value}`, color: `${v2.value}`, marginLeft: y2.index != 1 && (((_a = d2 == null ? void 0 : d2.props) == null ? void 0 : _a.span) ? `${(_b = d2 == null ? void 0 : d2.props) == null ? void 0 : _b.span}px` : ""), zIndex: ((_c = d2 == null ? void 0 : d2.props) == null ? void 0 : _c.zIndex) == "right" ? `${Math.abs(y2.maxIndex - y2.index)}` : "" };
|
|
23
|
+
}), w2 = n(() => {
|
|
24
|
+
var _a, _b;
|
|
25
|
+
return { backgroundColor: `${(_a = d2 == null ? void 0 : d2.props) == null ? void 0 : _a.maxBgColor}`, color: `${(_b = d2 == null ? void 0 : d2.props) == null ? void 0 : _b.maxColor}` };
|
|
26
|
+
}), $2 = n(() => c2.value ? c2.value : ""), G2 = n(() => p2.default), k = (a2) => {
|
|
27
|
+
var _a, _b, _c;
|
|
28
|
+
y2.maxIndex = a2.length;
|
|
29
|
+
for (let e2 = 0; e2 < a2.length; e2++)
|
|
30
|
+
a2[e2] && a2[e2].classList && a2[e2].classList[0] == "nut-avatar" && a2[e2].setAttribute("data-index", e2 + 1);
|
|
31
|
+
y2.index = (_b = (_a = f2 == null ? void 0 : f2.value) == null ? void 0 : _a.dataset) == null ? void 0 : _b.index, y2.index == y2.maxIndex && y2.index != ((_c = d2 == null ? void 0 : d2.props) == null ? void 0 : _c.maxCount) && (y2.showMax = true);
|
|
32
|
+
};
|
|
33
|
+
return { classes: C2, styles: S2, iconStyles: $2, isShowText: G2, maxStyles: w2, activeAvatar: (a2) => {
|
|
34
|
+
l2("active-avatar", a2);
|
|
35
|
+
}, onError: (a2) => {
|
|
36
|
+
l2("onError", a2);
|
|
37
|
+
}, avatarGroup: d2, visible: g2, avatarRef: f2, ...a(y2) };
|
|
38
|
+
} }), S = ["src", "alt"], w = { key: 2, class: "text" }, $ = { key: 1, class: "text" };
|
|
39
|
+
var G = g(C, [["render", function(a2, e2, t2, r2, o2, n2) {
|
|
155
40
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
156
|
-
const
|
|
157
|
-
return
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
class: normalizeClass(_ctx.classes),
|
|
161
|
-
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.activeAvatar(_ctx.e)),
|
|
162
|
-
ref: "avatarRef"
|
|
163
|
-
}, [
|
|
164
|
-
!((_f = (_e = _ctx.avatarGroup) == null ? void 0 : _e.props) == null ? void 0 : _f.maxCount) || _ctx.index <= ((_h = (_g = _ctx.avatarGroup) == null ? void 0 : _g.props) == null ? void 0 : _h.maxCount) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
165
|
-
_ctx.url ? (openBlock(), createElementBlock("img", {
|
|
166
|
-
key: 0,
|
|
167
|
-
src: _ctx.url,
|
|
168
|
-
alt: _ctx.alt,
|
|
169
|
-
onError: _cache[0] || (_cache[0] = (...args) => _ctx.onError && _ctx.onError(...args))
|
|
170
|
-
}, null, 40, _hoisted_1)) : _ctx.icon ? (openBlock(), createBlock(_component_nut_icon, {
|
|
171
|
-
key: 1,
|
|
172
|
-
class: "icon",
|
|
173
|
-
name: _ctx.iconStyles
|
|
174
|
-
}, null, 8, ["name"])) : createCommentVNode("", true),
|
|
175
|
-
_ctx.isShowText ? (openBlock(), createElementBlock("view", _hoisted_2, [
|
|
176
|
-
renderSlot(_ctx.$slots, "default")
|
|
177
|
-
])) : createCommentVNode("", true)
|
|
178
|
-
], 64)) : createCommentVNode("", true),
|
|
179
|
-
_ctx.showMax ? (openBlock(), createElementBlock("view", _hoisted_3, toDisplayString(((_j = (_i = _ctx.avatarGroup) == null ? void 0 : _i.props) == null ? void 0 : _j.maxContent) ? (_l = (_k = _ctx.avatarGroup) == null ? void 0 : _k.props) == null ? void 0 : _l.maxContent : `+ ${_ctx.maxIndex - ((_n = (_m = _ctx.avatarGroup) == null ? void 0 : _m.props) == null ? void 0 : _n.maxCount)}`), 1)) : createCommentVNode("", true)
|
|
180
|
-
], 6)) : createCommentVNode("", true);
|
|
181
|
-
}
|
|
182
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
183
|
-
export { index as default };
|
|
41
|
+
const f2 = s("nut-icon");
|
|
42
|
+
return a2.showMax || !((_b = (_a = a2.avatarGroup) == null ? void 0 : _a.props) == null ? void 0 : _b.maxCount) || a2.index <= ((_d = (_c = a2.avatarGroup) == null ? void 0 : _c.props) == null ? void 0 : _d.maxCount) ? (l(), p("view", { key: 0, style: u(a2.showMax ? a2.maxStyles : a2.styles), class: i(a2.classes), onClick: e2[1] || (e2[1] = (e3) => a2.activeAvatar(a2.e)), ref: "avatarRef" }, [!((_f = (_e = a2.avatarGroup) == null ? void 0 : _e.props) == null ? void 0 : _f.maxCount) || a2.index <= ((_h = (_g = a2.avatarGroup) == null ? void 0 : _g.props) == null ? void 0 : _h.maxCount) ? (l(), p(x, { key: 0 }, [a2.url ? (l(), p("img", { key: 0, src: a2.url, alt: a2.alt, onError: e2[0] || (e2[0] = (...e3) => a2.onError && a2.onError(...e3)) }, null, 40, S)) : a2.icon ? (l(), v(f2, { key: 1, class: "icon", name: a2.iconStyles }, null, 8, ["name"])) : c("", true), a2.isShowText ? (l(), p("view", w, [m(a2.$slots, "default")])) : c("", true)], 64)) : c("", true), a2.showMax ? (l(), p("view", $, d(((_j = (_i = a2.avatarGroup) == null ? void 0 : _i.props) == null ? void 0 : _j.maxContent) ? (_l = (_k = a2.avatarGroup) == null ? void 0 : _k.props) == null ? void 0 : _l.maxContent : "+ " + (a2.maxIndex - ((_n = (_m = a2.avatarGroup) == null ? void 0 : _m.props) == null ? void 0 : _n.maxCount))), 1)) : c("", true)], 6)) : c("", true);
|
|
43
|
+
}]]);
|
|
44
|
+
export { G as default };
|
|
@@ -1,78 +1,19 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { toRefs, ref, computed, onMounted, provide, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
|
|
7
|
-
import { c as
|
|
8
|
-
import { _ as
|
|
6
|
+
import { toRefs as e, ref as t, computed as a, onMounted as r, provide as o, openBlock as p, createElementBlock as n, normalizeClass as l, renderSlot as s } from "vue";
|
|
7
|
+
import { c as u } from "./component.js";
|
|
8
|
+
import { _ as f } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const { componentName, create } =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
maxBgColor: {
|
|
22
|
-
type: String,
|
|
23
|
-
default: "#eee"
|
|
24
|
-
},
|
|
25
|
-
maxColor: {
|
|
26
|
-
type: String,
|
|
27
|
-
default: "#666"
|
|
28
|
-
},
|
|
29
|
-
size: {
|
|
30
|
-
type: String,
|
|
31
|
-
default: ""
|
|
32
|
-
},
|
|
33
|
-
shape: {
|
|
34
|
-
type: String,
|
|
35
|
-
default: ""
|
|
36
|
-
},
|
|
37
|
-
span: {
|
|
38
|
-
type: String,
|
|
39
|
-
default: "-8"
|
|
40
|
-
},
|
|
41
|
-
zIndex: {
|
|
42
|
-
type: String,
|
|
43
|
-
default: "left"
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
setup(props, { emit, slots }) {
|
|
47
|
-
toRefs(props);
|
|
48
|
-
const avatarGroupRef = ref(null);
|
|
49
|
-
const index2 = ref(0);
|
|
50
|
-
const classes = computed(() => {
|
|
51
|
-
const prefixCls = componentName;
|
|
52
|
-
return {
|
|
53
|
-
[prefixCls]: true
|
|
54
|
-
};
|
|
55
|
-
});
|
|
56
|
-
onMounted(() => {
|
|
57
|
-
});
|
|
58
|
-
provide("avatarGroup", {
|
|
59
|
-
props,
|
|
60
|
-
avatarGroupRef,
|
|
61
|
-
index: index2
|
|
62
|
-
});
|
|
63
|
-
return {
|
|
64
|
-
classes,
|
|
65
|
-
avatarGroupRef
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
70
|
-
return openBlock(), createElementBlock("view", {
|
|
71
|
-
class: normalizeClass(_ctx.classes),
|
|
72
|
-
ref: "avatarGroupRef"
|
|
73
|
-
}, [
|
|
74
|
-
renderSlot(_ctx.$slots, "default")
|
|
75
|
-
], 2);
|
|
76
|
-
}
|
|
77
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
78
|
-
export { index as default };
|
|
10
|
+
const { componentName: i, create: m } = u("avatar-group"), d = m({ props: { maxContent: { type: String, default: "" }, maxCount: { type: [Number, String], default: "" }, maxBgColor: { type: String, default: "#eee" }, maxColor: { type: String, default: "#666" }, size: { type: String, default: "" }, shape: { type: String, default: "" }, span: { type: String, default: "-8" }, zIndex: { type: String, default: "left" } }, setup(p2, { emit: n2, slots: l2 }) {
|
|
11
|
+
e(p2);
|
|
12
|
+
const s2 = t(null), u2 = t(0), f2 = a(() => ({ [i]: true }));
|
|
13
|
+
return r(() => {
|
|
14
|
+
}), o("avatarGroup", { props: p2, avatarGroupRef: s2, index: u2 }), { classes: f2, avatarGroupRef: s2 };
|
|
15
|
+
} });
|
|
16
|
+
var g = f(d, [["render", function(e2, t2, a2, r2, o2, u2) {
|
|
17
|
+
return p(), n("view", { class: l(e2.classes), ref: "avatarGroupRef" }, [s(e2.$slots, "default")], 2);
|
|
18
|
+
}]]);
|
|
19
|
+
export { g as default };
|
|
@@ -1,163 +1,50 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { reactive, computed, onMounted, onUnmounted, onActivated, onDeactivated, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, withModifiers, renderSlot, createVNode } from "vue";
|
|
7
|
-
import { c as
|
|
8
|
-
import { _ as
|
|
6
|
+
import { reactive as e, computed as t, onMounted as o, onUnmounted as l, onActivated as n, onDeactivated as i, resolveComponent as r, openBlock as c, createElementBlock as s, normalizeClass as a, normalizeStyle as d, withModifiers as m, renderSlot as p, createVNode as u } from "vue";
|
|
7
|
+
import { c as f } from "./component.js";
|
|
8
|
+
import { _ as w } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const { componentName, create } =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
distance: {
|
|
26
|
-
type: Number,
|
|
27
|
-
default: 200
|
|
28
|
-
},
|
|
29
|
-
zIndex: {
|
|
30
|
-
type: Number,
|
|
31
|
-
default: 10
|
|
32
|
-
},
|
|
33
|
-
isAnimation: {
|
|
34
|
-
type: Boolean,
|
|
35
|
-
default: true
|
|
36
|
-
},
|
|
37
|
-
duration: {
|
|
38
|
-
type: Number,
|
|
39
|
-
default: 1e3
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
emits: ["click"],
|
|
43
|
-
setup(props, { emit }) {
|
|
44
|
-
const state = reactive({
|
|
45
|
-
backTop: false,
|
|
46
|
-
scrollTop: 0,
|
|
47
|
-
scrollEl: window,
|
|
48
|
-
startTime: 0,
|
|
49
|
-
keepAlive: false
|
|
50
|
-
});
|
|
51
|
-
const classes = computed(() => {
|
|
52
|
-
const prefixCls = componentName;
|
|
53
|
-
return {
|
|
54
|
-
[prefixCls]: true,
|
|
55
|
-
show: state.backTop
|
|
56
|
-
};
|
|
57
|
-
});
|
|
58
|
-
const style = computed(() => {
|
|
59
|
-
return {
|
|
60
|
-
right: `${props.right}px`,
|
|
61
|
-
bottom: `${props.bottom}px`,
|
|
62
|
-
zIndex: props.zIndex
|
|
63
|
-
};
|
|
64
|
-
});
|
|
65
|
-
function scrollListener() {
|
|
66
|
-
if (state.scrollEl instanceof Window) {
|
|
67
|
-
state.scrollTop = state.scrollEl.pageYOffset;
|
|
68
|
-
} else {
|
|
69
|
-
state.scrollTop = state.scrollEl.scrollTop;
|
|
70
|
-
}
|
|
71
|
-
state.backTop = state.scrollTop >= props.distance;
|
|
72
|
-
}
|
|
73
|
-
function scroll(y = 0) {
|
|
74
|
-
if (state.scrollEl instanceof Window) {
|
|
75
|
-
window.scrollTo(0, y);
|
|
76
|
-
} else {
|
|
77
|
-
state.scrollEl.scrollTop = y;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
function scrollAnimation() {
|
|
81
|
-
let cid = requestAniFrame()(function fn() {
|
|
82
|
-
var t = props.duration - Math.max(0, state.startTime - +new Date() + props.duration);
|
|
83
|
-
var y = t * -state.scrollTop / props.duration + state.scrollTop;
|
|
84
|
-
scroll(y);
|
|
85
|
-
cid = requestAniFrame()(fn);
|
|
86
|
-
if (t == props.duration || y == 0) {
|
|
87
|
-
window.cancelAnimationFrame(cid);
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
function addEventListener() {
|
|
92
|
-
state.scrollEl.addEventListener("scroll", scrollListener, false);
|
|
93
|
-
state.scrollEl.addEventListener("resize", scrollListener, false);
|
|
94
|
-
}
|
|
95
|
-
function removeEventListener() {
|
|
96
|
-
state.scrollEl.removeEventListener("scroll", scrollListener, false);
|
|
97
|
-
state.scrollEl.removeEventListener("resize", scrollListener, false);
|
|
98
|
-
}
|
|
99
|
-
function initCancelAniFrame() {
|
|
100
|
-
window.cancelAnimationFrame = window.webkitCancelAnimationFrame;
|
|
101
|
-
}
|
|
102
|
-
function requestAniFrame() {
|
|
103
|
-
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function(callback) {
|
|
104
|
-
window.setTimeout(callback, 1e3 / 60);
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
function click(e) {
|
|
108
|
-
state.startTime = +new Date();
|
|
109
|
-
props.isAnimation && props.duration > 0 ? scrollAnimation() : scroll();
|
|
110
|
-
emit("click", e);
|
|
111
|
-
}
|
|
112
|
-
function init() {
|
|
113
|
-
if (props.elId && document.getElementById(props.elId)) {
|
|
114
|
-
state.scrollEl = document.getElementById(props.elId);
|
|
115
|
-
}
|
|
116
|
-
addEventListener();
|
|
117
|
-
initCancelAniFrame();
|
|
118
|
-
}
|
|
119
|
-
onMounted(() => {
|
|
120
|
-
if (props.distance == 0) {
|
|
121
|
-
state.backTop = true;
|
|
122
|
-
}
|
|
123
|
-
init();
|
|
124
|
-
});
|
|
125
|
-
onUnmounted(() => {
|
|
126
|
-
removeEventListener();
|
|
127
|
-
});
|
|
128
|
-
onActivated(() => {
|
|
129
|
-
if (state.keepAlive) {
|
|
130
|
-
state.keepAlive = false;
|
|
131
|
-
init();
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
onDeactivated(() => {
|
|
135
|
-
state.keepAlive = true;
|
|
136
|
-
removeEventListener();
|
|
137
|
-
});
|
|
138
|
-
return {
|
|
139
|
-
state,
|
|
140
|
-
classes,
|
|
141
|
-
style,
|
|
142
|
-
click
|
|
10
|
+
const { componentName: k, create: E } = f("backtop");
|
|
11
|
+
var b = w(E({ props: { bottom: { type: Number, default: 20 }, right: { type: Number, default: 10 }, elId: { type: [String, Element], default: "body" }, distance: { type: Number, default: 200 }, zIndex: { type: Number, default: 10 }, isAnimation: { type: Boolean, default: true }, duration: { type: Number, default: 1e3 } }, emits: ["click"], setup(r2, { emit: c2 }) {
|
|
12
|
+
const s2 = e({ backTop: false, scrollTop: 0, scrollEl: window, startTime: 0, keepAlive: false }), a2 = t(() => ({ [k]: true, show: s2.backTop })), d2 = t(() => ({ right: `${r2.right}px`, bottom: `${r2.bottom}px`, zIndex: r2.zIndex }));
|
|
13
|
+
function m2() {
|
|
14
|
+
s2.scrollEl instanceof Window ? s2.scrollTop = s2.scrollEl.pageYOffset : s2.scrollTop = s2.scrollEl.scrollTop, s2.backTop = s2.scrollTop >= r2.distance;
|
|
15
|
+
}
|
|
16
|
+
function p2(e2 = 0) {
|
|
17
|
+
s2.scrollEl instanceof Window ? window.scrollTo(0, e2) : s2.scrollEl.scrollTop = e2;
|
|
18
|
+
}
|
|
19
|
+
function u2() {
|
|
20
|
+
s2.scrollEl.removeEventListener("scroll", m2, false), s2.scrollEl.removeEventListener("resize", m2, false);
|
|
21
|
+
}
|
|
22
|
+
function f2() {
|
|
23
|
+
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function(e2) {
|
|
24
|
+
window.setTimeout(e2, 1e3 / 60);
|
|
143
25
|
};
|
|
144
26
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
return
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
},
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
27
|
+
function w2() {
|
|
28
|
+
r2.elId && document.getElementById(r2.elId) && (s2.scrollEl = document.getElementById(r2.elId)), s2.scrollEl.addEventListener("scroll", m2, false), s2.scrollEl.addEventListener("resize", m2, false), window.cancelAnimationFrame = window.webkitCancelAnimationFrame;
|
|
29
|
+
}
|
|
30
|
+
return o(() => {
|
|
31
|
+
r2.distance == 0 && (s2.backTop = true), w2();
|
|
32
|
+
}), l(() => {
|
|
33
|
+
u2();
|
|
34
|
+
}), n(() => {
|
|
35
|
+
s2.keepAlive && (s2.keepAlive = false, w2());
|
|
36
|
+
}), i(() => {
|
|
37
|
+
s2.keepAlive = true, u2();
|
|
38
|
+
}), { state: s2, classes: a2, style: d2, click: function(e2) {
|
|
39
|
+
s2.startTime = +new Date(), r2.isAnimation && r2.duration > 0 ? function() {
|
|
40
|
+
let e3 = f2()(function t2() {
|
|
41
|
+
var o2 = r2.duration - Math.max(0, s2.startTime - +new Date() + r2.duration), l2 = o2 * -s2.scrollTop / r2.duration + s2.scrollTop;
|
|
42
|
+
p2(l2), e3 = f2()(t2), o2 != r2.duration && l2 != 0 || window.cancelAnimationFrame(e3);
|
|
43
|
+
});
|
|
44
|
+
}() : p2(), c2("click", e2);
|
|
45
|
+
} };
|
|
46
|
+
} }), [["render", function(e2, t2, o2, l2, n2, i2) {
|
|
47
|
+
const f2 = r("nut-icon");
|
|
48
|
+
return c(), s("div", { class: a(e2.classes), style: d(e2.style), onClick: t2[0] || (t2[0] = m((...t3) => e2.click && e2.click(...t3), ["stop"])) }, [p(e2.$slots, "default", {}, () => [u(f2, { size: "19px", class: "nut-backtop-main", name: "top" })])], 6);
|
|
49
|
+
}]]);
|
|
50
|
+
export { b as default };
|
|
@@ -1,91 +1,19 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { reactive, computed, openBlock, createElementBlock, createElementVNode, renderSlot, withDirectives, toDisplayString, normalizeClass, normalizeStyle, vShow } from "vue";
|
|
7
|
-
import { c as
|
|
8
|
-
import { _ as
|
|
6
|
+
import { reactive as t, computed as e, openBlock as o, createElementBlock as n, createElementVNode as r, renderSlot as l, withDirectives as a, toDisplayString as u, normalizeClass as p, normalizeStyle as s, vShow as d } from "vue";
|
|
7
|
+
import { c as i } from "./component.js";
|
|
8
|
+
import { _ as c } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const { create } =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
dot: {
|
|
21
|
-
type: Boolean,
|
|
22
|
-
default: false
|
|
23
|
-
},
|
|
24
|
-
hidden: {
|
|
25
|
-
type: Boolean,
|
|
26
|
-
default: false
|
|
27
|
-
},
|
|
28
|
-
top: {
|
|
29
|
-
type: String,
|
|
30
|
-
default: "0"
|
|
31
|
-
},
|
|
32
|
-
right: {
|
|
33
|
-
type: String,
|
|
34
|
-
default: "0"
|
|
35
|
-
},
|
|
36
|
-
zIndex: {
|
|
37
|
-
type: Number,
|
|
38
|
-
default: 9
|
|
39
|
-
},
|
|
40
|
-
color: {
|
|
41
|
-
type: String,
|
|
42
|
-
default: ""
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
setup(props) {
|
|
46
|
-
const state = reactive({});
|
|
47
|
-
const stl = computed(() => {
|
|
48
|
-
return {
|
|
49
|
-
top: `${props.top}px`,
|
|
50
|
-
right: `${props.right}px`,
|
|
51
|
-
zIndex: props.zIndex,
|
|
52
|
-
background: props.color
|
|
53
|
-
};
|
|
54
|
-
});
|
|
55
|
-
const content = computed(() => {
|
|
56
|
-
if (props.dot)
|
|
57
|
-
return;
|
|
58
|
-
const value = props.value;
|
|
59
|
-
const max = props.max;
|
|
60
|
-
if (typeof value === "number" && typeof max === "number") {
|
|
61
|
-
return max < value ? `${max}+` : value;
|
|
62
|
-
}
|
|
63
|
-
return value;
|
|
64
|
-
});
|
|
65
|
-
return {
|
|
66
|
-
state,
|
|
67
|
-
stl,
|
|
68
|
-
content
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
const _hoisted_1 = { class: "nut-badge" };
|
|
73
|
-
const _hoisted_2 = { class: "slot-icons" };
|
|
74
|
-
const _hoisted_3 = ["textContent"];
|
|
75
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
76
|
-
return openBlock(), createElementBlock("view", _hoisted_1, [
|
|
77
|
-
createElementVNode("view", _hoisted_2, [
|
|
78
|
-
renderSlot(_ctx.$slots, "icons")
|
|
79
|
-
]),
|
|
80
|
-
renderSlot(_ctx.$slots, "default"),
|
|
81
|
-
withDirectives(createElementVNode("view", {
|
|
82
|
-
textContent: toDisplayString(_ctx.content),
|
|
83
|
-
class: normalizeClass(["nut-badge__content sup", { "is-dot": _ctx.dot }]),
|
|
84
|
-
style: normalizeStyle(_ctx.stl)
|
|
85
|
-
}, null, 14, _hoisted_3), [
|
|
86
|
-
[vShow, !_ctx.hidden && (_ctx.content || _ctx.dot)]
|
|
87
|
-
])
|
|
88
|
-
]);
|
|
89
|
-
}
|
|
90
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
91
|
-
export { index as default };
|
|
10
|
+
const { create: f } = i("badge"), m = f({ props: { value: { type: [String, Number] }, max: { type: Number, default: 1e4 }, dot: { type: Boolean, default: false }, hidden: { type: Boolean, default: false }, top: { type: String, default: "0" }, right: { type: String, default: "0" }, zIndex: { type: Number, default: 9 }, color: { type: String, default: "" } }, setup: (o2) => ({ state: t({}), stl: e(() => ({ top: `${o2.top}px`, right: `${o2.right}px`, zIndex: o2.zIndex, background: o2.color })), content: e(() => {
|
|
11
|
+
if (o2.dot)
|
|
12
|
+
return;
|
|
13
|
+
const t2 = o2.value, e2 = o2.max;
|
|
14
|
+
return typeof t2 == "number" && typeof e2 == "number" && e2 < t2 ? `${e2}+` : t2;
|
|
15
|
+
}) }) }), g = { class: "nut-badge" }, x = { class: "slot-icons" }, y = ["textContent"];
|
|
16
|
+
var b = c(m, [["render", function(t2, e2, i2, c2, f2, m2) {
|
|
17
|
+
return o(), n("view", g, [r("view", x, [l(t2.$slots, "icons")]), l(t2.$slots, "default"), a(r("view", { textContent: u(t2.content), class: p(["nut-badge__content sup", { "is-dot": t2.dot }]), style: s(t2.stl) }, null, 14, y), [[d, !t2.hidden && (t2.content || t2.dot)]])]);
|
|
18
|
+
}]]);
|
|
19
|
+
export { b as default };
|