@nutui/nutui 3.3.0 → 3.3.1-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 +324 -295
- package/dist/nutui.umd.js +320 -291
- package/dist/packages/_es/ActionSheet.js +1 -1
- package/dist/packages/_es/Address.js +1 -1
- package/dist/packages/_es/AddressList.js +2 -2
- package/dist/packages/_es/Animate.js +1 -1
- package/dist/packages/_es/Audio.js +1 -1
- package/dist/packages/_es/AudioOperate.js +1 -1
- package/dist/packages/_es/Avatar.js +1 -1
- package/dist/packages/_es/AvatarGroup.js +1 -1
- package/dist/packages/_es/BackTop.js +1 -1
- package/dist/packages/_es/Badge.js +1 -1
- package/dist/packages/_es/Barrage.js +1 -1
- package/dist/packages/_es/Button.js +1 -1
- package/dist/packages/_es/Calendar.js +1 -1
- package/dist/packages/_es/CalendarItem.js +1 -1
- package/dist/packages/_es/Card.js +1 -1
- package/dist/packages/_es/Cascader.js +1 -1
- package/dist/packages/_es/Category.js +1 -1
- package/dist/packages/_es/CategoryPane.js +1 -1
- package/dist/packages/_es/Cell.js +1 -1
- package/dist/packages/_es/CellGroup.js +1 -1
- package/dist/packages/_es/Checkbox.js +1 -1
- package/dist/packages/_es/CheckboxGroup.js +1 -1
- package/dist/packages/_es/CircleProgress.js +2 -2
- package/dist/packages/_es/Col.js +1 -1
- package/dist/packages/_es/Collapse.js +1 -1
- package/dist/packages/_es/CollapseItem.js +1 -1
- package/dist/packages/_es/Comment.js +1 -1
- package/dist/packages/_es/ConfigProvider.js +1 -1
- package/dist/packages/_es/CountDown.js +1 -1
- package/dist/packages/_es/CountUp.js +1 -1
- package/dist/packages/_es/DatePicker.js +1 -1
- package/dist/packages/_es/Dialog.js +1 -1
- package/dist/packages/_es/Divider.js +1 -1
- package/dist/packages/_es/Drag.js +1 -1
- package/dist/packages/_es/Ecard.js +1 -1
- package/dist/packages/_es/Elevator.js +1 -1
- package/dist/packages/_es/Ellipsis.js +1 -1
- package/dist/packages/_es/Empty.js +1 -1
- package/dist/packages/_es/FixedNav.js +1 -1
- package/dist/packages/_es/Form.js +2 -2
- package/dist/packages/_es/FormItem.js +1 -1
- package/dist/packages/_es/Grid.js +1 -1
- package/dist/packages/_es/GridItem.js +1 -1
- package/dist/packages/_es/Icon.js +1 -1
- package/dist/packages/_es/Image.js +1 -1
- package/dist/packages/_es/ImagePreview.js +3 -3
- package/dist/packages/_es/Indicator.js +1 -1
- package/dist/packages/_es/InfiniteLoading.js +18 -26
- package/dist/packages/_es/Input.js +1 -1
- package/dist/packages/_es/InputNumber.js +1 -1
- package/dist/packages/_es/Invoice.js +1 -1
- package/dist/packages/_es/Layout.js +1 -1
- package/dist/packages/_es/List.js +1 -1
- package/dist/packages/_es/Menu.js +1 -1
- package/dist/packages/_es/MenuItem.js +1 -1
- package/dist/packages/_es/Navbar.js +1 -1
- package/dist/packages/_es/NoticeBar.js +1 -1
- package/dist/packages/_es/Notify.js +1 -1
- package/dist/packages/_es/NumberKeyboard.js +1 -1
- package/dist/packages/_es/OverLay.js +1 -1
- package/dist/packages/_es/Pagination.js +1 -1
- package/dist/packages/_es/Picker.js +17 -7
- package/dist/packages/_es/Popover.js +171 -81
- package/dist/packages/_es/Popup.js +1 -1
- package/dist/packages/_es/Price.js +7 -2
- package/dist/packages/_es/Progress.js +1 -1
- package/dist/packages/_es/Radio.js +1 -1
- package/dist/packages/_es/RadioGroup.js +1 -1
- package/dist/packages/_es/Range.js +1 -1
- package/dist/packages/_es/Rate.js +1 -1
- package/dist/packages/_es/Row.js +1 -1
- package/dist/packages/_es/SearchBar.js +1 -1
- package/dist/packages/_es/ShortPassword.js +1 -1
- package/dist/packages/_es/SideNavBar.js +1 -1
- package/dist/packages/_es/SideNavBarItem.js +1 -1
- package/dist/packages/_es/Signature.js +1 -1
- package/dist/packages/_es/Skeleton.js +1 -1
- package/dist/packages/_es/Sku.js +1 -1
- package/dist/packages/_es/Step.js +1 -1
- package/dist/packages/_es/Steps.js +1 -1
- package/dist/packages/_es/Sticky.js +1 -1
- package/dist/packages/_es/SubSideNavBar.js +1 -1
- package/dist/packages/_es/Swipe.js +1 -1
- package/dist/packages/_es/Swiper.js +57 -115
- package/dist/packages/_es/SwiperItem.js +1 -1
- package/dist/packages/_es/Switch.js +1 -1
- package/dist/packages/_es/TabPane.js +1 -1
- package/dist/packages/_es/Tabbar.js +4 -8
- package/dist/packages/_es/TabbarItem.js +12 -13
- package/dist/packages/_es/Table.js +1 -1
- package/dist/packages/_es/Tabs.js +6 -9
- package/dist/packages/_es/Tag.js +1 -1
- package/dist/packages/_es/TextArea.js +1 -1
- package/dist/packages/_es/TimeDetail.js +1 -1
- package/dist/packages/_es/TimePannel.js +1 -1
- package/dist/packages/_es/TimeSelect.js +1 -1
- package/dist/packages/_es/Toast.js +1 -1
- package/dist/packages/_es/TrendArrow.js +1 -1
- package/dist/packages/_es/Uploader.js +1 -1
- package/dist/packages/_es/Video.js +1 -1
- package/dist/packages/_es/WaterMark.js +1 -1
- package/dist/packages/_es/common.js +1 -1
- package/dist/packages/_es/component.js +6 -2
- package/dist/packages/_es/index.js +1 -1
- package/dist/packages/_es/index2.js +1 -1
- package/dist/packages/_es/index3.js +1 -1
- package/dist/packages/_es/index4.js +1 -1
- package/dist/packages/_es/index5.js +1 -1
- package/dist/packages/_es/interceptor.js +2 -2
- package/dist/packages/_es/mountComponent.js +2 -2
- package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
- package/dist/packages/_es/props.js +1 -1
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +1 -1
- package/dist/packages/infiniteloading/index.scss +2 -0
- package/dist/packages/locale/lang/baseLang.js +1 -1
- package/dist/packages/locale/lang/en-US.js +1 -1
- package/dist/packages/locale/lang/id-ID.js +1 -1
- package/dist/packages/locale/lang/index.js +1 -1
- package/dist/packages/locale/lang/zh-CN.js +1 -1
- package/dist/packages/locale/lang/zh-TW.js +1 -1
- package/dist/packages/picker/index.scss +10 -4
- package/dist/packages/popover/index.scss +10 -38
- package/dist/packages/price/index.scss +5 -0
- package/dist/smartips/attributes.json +36 -8
- package/dist/smartips/tags.json +13 -6
- package/dist/smartips/web-types.json +72 -9
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +55 -55
- package/dist/styles/themes/jdb.scss +55 -55
- package/dist/styles/themes/jddkh.scss +55 -55
- package/dist/styles/themes/jdt.scss +55 -55
- package/dist/types/__VUE/actionsheet/index.vue.d.ts +1 -1
- package/dist/types/__VUE/address/index.vue.d.ts +2 -2
- package/dist/types/__VUE/audio/index.vue.d.ts +4 -4
- package/dist/types/__VUE/avatar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/avatargroup/index.vue.d.ts +1 -1
- package/dist/types/__VUE/backtop/index.vue.d.ts +1 -1
- package/dist/types/__VUE/badge/index.vue.d.ts +1 -1
- package/dist/types/__VUE/button/index.vue.d.ts +1 -1
- package/dist/types/__VUE/calendaritem/index.vue.d.ts +4 -4
- package/dist/types/__VUE/cell/index.vue.d.ts +5 -5
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/countup/index.vue.d.ts +2 -2
- package/dist/types/__VUE/datepicker/index.vue.d.ts +1 -1
- package/dist/types/__VUE/dialog/index.vue.d.ts +1 -1
- package/dist/types/__VUE/fixednav/index.vue.d.ts +1 -1
- package/dist/types/__VUE/grid/index.vue.d.ts +1 -1
- package/dist/types/__VUE/image/index.vue.d.ts +1 -1
- package/dist/types/__VUE/imagepreview/index.vue.d.ts +2 -2
- package/dist/types/__VUE/infiniteloading/index.vue.d.ts +1 -1
- package/dist/types/__VUE/input/index.vue.d.ts +2 -2
- package/dist/types/__VUE/navbar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/noticebar/index.vue.d.ts +4 -4
- package/dist/types/__VUE/picker/Column.vue.d.ts +4 -4
- package/dist/types/__VUE/picker/index.vue.d.ts +23 -5
- package/dist/types/__VUE/popover/index.vue.d.ts +33 -4
- package/dist/types/__VUE/popover/type.d.ts +7 -0
- package/dist/types/__VUE/price/index.vue.d.ts +9 -0
- package/dist/types/__VUE/range/index.vue.d.ts +7 -7
- package/dist/types/__VUE/rate/index.vue.d.ts +1 -1
- package/dist/types/__VUE/searchbar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/step/index.vue.d.ts +1 -1
- package/dist/types/__VUE/swiper/index.vue.d.ts +9 -8
- package/dist/types/__VUE/swiperitem/index.vue.d.ts +2 -2
- package/dist/types/__VUE/switch/index.vue.d.ts +1 -1
- package/dist/types/__VUE/tabbar/index.vue.d.ts +2 -11
- package/dist/types/__VUE/tabbaritem/index.vue.d.ts +4 -4
- package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
- package/dist/types/__VUE/toast/index.vue.d.ts +1 -1
- package/dist/types/__VUE/uploader/index.vue.d.ts +3 -3
- package/dist/types/__VUE/video/index.vue.d.ts +3 -3
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/types/__VUE/swiper/use-touch.d.ts +0 -20
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.3.0 Fri Dec
|
|
2
|
+
* @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { ref, reactive, computed, watch, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode, onBeforeUnmount, resolveComponent, createVNode, withCtx, renderSlot } from "vue";
|
|
7
|
-
import { c as createComponent, a as preventDefault } from "./component.js";
|
|
7
|
+
import { c as createComponent, a as preventDefault, d as clamp } from "./component.js";
|
|
8
8
|
import Popup from "./Popup.js";
|
|
9
9
|
import { p as popupProps } from "./props.js";
|
|
10
10
|
import { u as useTouch } from "./index4.js";
|
|
@@ -162,7 +162,7 @@ const _sfc_main$1 = create$1({
|
|
|
162
162
|
let currentDeg = (-updateMove / state.lineSpacing + 1) * state.rotation;
|
|
163
163
|
const maxDeg = (props.column.length + 1) * state.rotation;
|
|
164
164
|
const minDeg = 0;
|
|
165
|
-
deg =
|
|
165
|
+
deg = clamp(currentDeg, minDeg, maxDeg);
|
|
166
166
|
if (minDeg < deg && deg < maxDeg) {
|
|
167
167
|
setTransform(updateMove, null, void 0, deg + "deg");
|
|
168
168
|
state.currIndex = Math.abs(Math.round(updateMove / state.lineSpacing)) + 1;
|
|
@@ -303,6 +303,14 @@ const _sfc_main = create({
|
|
|
303
303
|
swipeDuration: {
|
|
304
304
|
type: [Number, String],
|
|
305
305
|
default: 1e3
|
|
306
|
+
},
|
|
307
|
+
showOkText: {
|
|
308
|
+
type: Boolean,
|
|
309
|
+
default: true
|
|
310
|
+
},
|
|
311
|
+
showCancelText: {
|
|
312
|
+
type: Boolean,
|
|
313
|
+
default: true
|
|
306
314
|
}
|
|
307
315
|
},
|
|
308
316
|
emits: ["close", "change", "confirm", "update:visible", "update:modelValue"],
|
|
@@ -511,15 +519,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
511
519
|
}, {
|
|
512
520
|
default: withCtx(() => [
|
|
513
521
|
createElementVNode("view", _hoisted_1, [
|
|
514
|
-
|
|
522
|
+
_ctx.showCancelText ? (openBlock(), createElementBlock("view", {
|
|
523
|
+
key: 0,
|
|
515
524
|
class: "nut-picker__left",
|
|
516
525
|
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.close && _ctx.close(...args))
|
|
517
|
-
}, toDisplayString(_ctx.cancelText || _ctx.translate("cancel")), 1),
|
|
526
|
+
}, toDisplayString(_ctx.cancelText || _ctx.translate("cancel")), 1)) : createCommentVNode("", true),
|
|
518
527
|
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.title), 1),
|
|
519
|
-
|
|
528
|
+
_ctx.showOkText ? (openBlock(), createElementBlock("view", {
|
|
529
|
+
key: 1,
|
|
520
530
|
class: "nut-picker__right",
|
|
521
531
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.confirmHandler())
|
|
522
|
-
}, toDisplayString(_ctx.okText || _ctx.translate("confirm")), 1)
|
|
532
|
+
}, toDisplayString(_ctx.okText || _ctx.translate("confirm")), 1)) : createCommentVNode("", true)
|
|
523
533
|
]),
|
|
524
534
|
renderSlot(_ctx.$slots, "top"),
|
|
525
535
|
createElementVNode("view", _hoisted_3, [
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.3.0 Fri Dec
|
|
2
|
+
* @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { ref,
|
|
7
|
-
import {
|
|
6
|
+
import { ref, computed, watch, resolveComponent, openBlock, createElementBlock, Fragment, renderSlot, createCommentVNode, createElementVNode, normalizeClass, normalizeStyle, createVNode, withCtx, renderList, withModifiers, mergeProps, toDisplayString } from "vue";
|
|
7
|
+
import { l as isArray, c as createComponent } from "./component.js";
|
|
8
|
+
import { u as useRect } from "./index2.js";
|
|
8
9
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
10
|
import "../locale/lang";
|
|
10
11
|
const { create } = createComponent("popover");
|
|
@@ -16,6 +17,7 @@ const _sfc_main = create({
|
|
|
16
17
|
theme: { type: String, default: "light" },
|
|
17
18
|
location: { type: String, default: "bottom" },
|
|
18
19
|
offset: { type: Array, default: [0, 12] },
|
|
20
|
+
arrowOffset: { type: Number, default: 0 },
|
|
19
21
|
customClass: { type: String, default: "" },
|
|
20
22
|
showArrow: { type: Boolean, default: true },
|
|
21
23
|
iconPrefix: { type: String, default: "nut-icon" },
|
|
@@ -25,52 +27,128 @@ const _sfc_main = create({
|
|
|
25
27
|
overlayStyle: { type: Object },
|
|
26
28
|
closeOnClickOverlay: { type: Boolean, default: true },
|
|
27
29
|
closeOnClickAction: { type: Boolean, default: true },
|
|
28
|
-
closeOnClickOutside: { type: Boolean, default: true }
|
|
30
|
+
closeOnClickOutside: { type: Boolean, default: true },
|
|
31
|
+
targetId: { type: String, default: "" },
|
|
32
|
+
bgColor: { type: String, default: "" }
|
|
29
33
|
},
|
|
30
34
|
emits: ["update", "update:visible", "close", "choose", "open"],
|
|
31
35
|
setup(props, { emit }) {
|
|
32
36
|
const popoverRef = ref();
|
|
33
37
|
const popoverContentRef = ref();
|
|
34
38
|
const showPopup = ref(props.visible);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
rootHeight: 0
|
|
38
|
-
});
|
|
39
|
+
let rootRect = ref();
|
|
40
|
+
let conentRootRect = ref();
|
|
39
41
|
const popoverArrow = computed(() => {
|
|
40
42
|
const prefixCls = "nut-popover-arrow";
|
|
41
43
|
const loca = props.location;
|
|
42
44
|
const direction = loca.split("-")[0];
|
|
43
45
|
return `${prefixCls} ${prefixCls}-${direction} ${prefixCls}--${loca}`;
|
|
44
46
|
});
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
const popoverArrowStyle = computed(() => {
|
|
48
|
+
const styles = {};
|
|
49
|
+
const { bgColor, arrowOffset, location } = props;
|
|
50
|
+
const direction = location.split("-")[0];
|
|
51
|
+
const skew = location.split("-")[1];
|
|
52
|
+
const base = 16;
|
|
53
|
+
if (bgColor) {
|
|
54
|
+
styles[`border${upperCaseFirst(direction)}Color`] = bgColor;
|
|
55
|
+
}
|
|
56
|
+
if (props.arrowOffset != 0) {
|
|
57
|
+
if (["bottom", "top"].includes(direction)) {
|
|
58
|
+
if (!skew) {
|
|
59
|
+
styles.left = `calc(50% + ${arrowOffset}px)`;
|
|
60
|
+
}
|
|
61
|
+
if (skew == "start") {
|
|
62
|
+
styles.left = `${base + arrowOffset}px`;
|
|
63
|
+
}
|
|
64
|
+
if (skew == "end") {
|
|
65
|
+
styles.right = `${base - arrowOffset}px`;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (["left", "right"].includes(direction)) {
|
|
69
|
+
if (!skew) {
|
|
70
|
+
styles.top = `calc(50% - ${arrowOffset}px)`;
|
|
71
|
+
}
|
|
72
|
+
if (skew == "start") {
|
|
73
|
+
styles.top = `${base - arrowOffset}px`;
|
|
74
|
+
}
|
|
75
|
+
if (skew == "end") {
|
|
76
|
+
styles.bottom = `${base + arrowOffset}px`;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return styles;
|
|
81
|
+
});
|
|
82
|
+
const upperCaseFirst = (str) => {
|
|
83
|
+
var str = str.toLowerCase();
|
|
84
|
+
str = str.replace(/\b\w+\b/g, (word) => word.substring(0, 1).toUpperCase() + word.substring(1));
|
|
85
|
+
return str;
|
|
86
|
+
};
|
|
87
|
+
const getRootPosition = computed(() => {
|
|
88
|
+
let styles = {};
|
|
89
|
+
if (!rootRect.value || !conentRootRect.value)
|
|
90
|
+
return {};
|
|
91
|
+
const conentWidth = conentRootRect.value.width;
|
|
92
|
+
const conentHeight = conentRootRect.value.height;
|
|
93
|
+
const { width, height, left, top } = rootRect.value;
|
|
94
|
+
const { location, offset } = props;
|
|
95
|
+
const direction = location.split("-")[0];
|
|
96
|
+
const skew = location.split("-")[1];
|
|
97
|
+
let cross = 0;
|
|
98
|
+
let parallel = 0;
|
|
49
99
|
if (isArray(offset) && offset.length == 2) {
|
|
50
100
|
cross += +offset[1];
|
|
51
|
-
|
|
101
|
+
parallel += +offset[0];
|
|
52
102
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
103
|
+
if (width) {
|
|
104
|
+
if (["bottom", "top"].includes(direction)) {
|
|
105
|
+
const h = direction == "bottom" ? height + cross : -(conentHeight + cross);
|
|
106
|
+
styles.top = `${top + h}px`;
|
|
107
|
+
if (!skew) {
|
|
108
|
+
styles.left = `${-(conentWidth - width) / 2 + left + parallel}px`;
|
|
109
|
+
}
|
|
110
|
+
if (skew == "start") {
|
|
111
|
+
styles.left = `${left + parallel}px`;
|
|
112
|
+
}
|
|
113
|
+
if (skew == "end") {
|
|
114
|
+
styles.left = `${rootRect.value.right + parallel}px`;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (["left", "right"].includes(direction)) {
|
|
118
|
+
const contentW = direction == "left" ? -(conentWidth + cross) : width + cross;
|
|
119
|
+
styles.left = `${left + contentW}px`;
|
|
120
|
+
if (!skew) {
|
|
121
|
+
styles.top = `${top - conentHeight / 2 + height / 2 - 4 + parallel}px`;
|
|
122
|
+
}
|
|
123
|
+
if (skew == "start") {
|
|
124
|
+
styles.top = `${top + parallel}px`;
|
|
125
|
+
}
|
|
126
|
+
if (skew == "end") {
|
|
127
|
+
styles.top = `${top + height + parallel}px`;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
67
130
|
}
|
|
68
|
-
return
|
|
131
|
+
return styles;
|
|
132
|
+
});
|
|
133
|
+
const customStyle = computed(() => {
|
|
134
|
+
const styles = {};
|
|
135
|
+
if (props.bgColor) {
|
|
136
|
+
styles.background = props.bgColor;
|
|
137
|
+
}
|
|
138
|
+
return styles;
|
|
69
139
|
});
|
|
70
140
|
const getContentWidth = () => {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
141
|
+
let rect2 = useRect(popoverRef.value);
|
|
142
|
+
if (props.targetId) {
|
|
143
|
+
rect2 = useRect(document.querySelector(`#${props.targetId}`));
|
|
144
|
+
}
|
|
145
|
+
rootRect.value = rect2;
|
|
146
|
+
setTimeout(() => {
|
|
147
|
+
conentRootRect.value = {
|
|
148
|
+
height: popoverContentRef.value.clientHeight,
|
|
149
|
+
width: popoverContentRef.value.clientWidth
|
|
150
|
+
};
|
|
151
|
+
}, 0);
|
|
74
152
|
};
|
|
75
153
|
watch(
|
|
76
154
|
() => props.visible,
|
|
@@ -105,7 +183,12 @@ const _sfc_main = create({
|
|
|
105
183
|
const clickAway = (event) => {
|
|
106
184
|
const element = popoverRef.value;
|
|
107
185
|
const elContent = popoverContentRef.value;
|
|
108
|
-
|
|
186
|
+
let el = element && !element.contains(event.target);
|
|
187
|
+
if (props.targetId) {
|
|
188
|
+
const dom = document.querySelector(`#${props.targetId}`);
|
|
189
|
+
el = dom && !dom.contains(event.target);
|
|
190
|
+
}
|
|
191
|
+
if (el && elContent && !elContent.contains(event.target) && props.closeOnClickOutside) {
|
|
109
192
|
closePopover();
|
|
110
193
|
}
|
|
111
194
|
};
|
|
@@ -116,8 +199,10 @@ const _sfc_main = create({
|
|
|
116
199
|
closePopover,
|
|
117
200
|
chooseItem,
|
|
118
201
|
popoverRef,
|
|
119
|
-
|
|
120
|
-
|
|
202
|
+
popoverContentRef,
|
|
203
|
+
getRootPosition,
|
|
204
|
+
customStyle,
|
|
205
|
+
popoverArrowStyle
|
|
121
206
|
};
|
|
122
207
|
}
|
|
123
208
|
});
|
|
@@ -128,59 +213,64 @@ const _hoisted_1 = {
|
|
|
128
213
|
const _hoisted_2 = ["onClick"];
|
|
129
214
|
const _hoisted_3 = { class: "nut-popover-menu-item-name" };
|
|
130
215
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
131
|
-
const
|
|
216
|
+
const _component_Icon = resolveComponent("Icon");
|
|
132
217
|
const _component_nut_popup = resolveComponent("nut-popup");
|
|
133
|
-
return openBlock(), createElementBlock(
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
createElementVNode("view", {
|
|
218
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
219
|
+
!_ctx.targetId ? (openBlock(), createElementBlock("div", {
|
|
220
|
+
key: 0,
|
|
137
221
|
class: "nut-popover-wrapper",
|
|
138
222
|
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.openPopover && _ctx.openPopover(...args)),
|
|
139
223
|
ref: "popoverRef"
|
|
140
224
|
}, [
|
|
141
225
|
renderSlot(_ctx.$slots, "reference")
|
|
142
|
-
], 512),
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
style: normalizeStyle(_ctx.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
226
|
+
], 512)) : createCommentVNode("", true),
|
|
227
|
+
createElementVNode("view", {
|
|
228
|
+
class: normalizeClass(["nut-popover", `nut-popover--${_ctx.theme}`, `${_ctx.customClass}`]),
|
|
229
|
+
style: normalizeStyle(_ctx.getRootPosition)
|
|
230
|
+
}, [
|
|
231
|
+
createVNode(_component_nut_popup, {
|
|
232
|
+
popClass: `nut-popover-content nut-popover-content--${_ctx.location}`,
|
|
233
|
+
style: normalizeStyle(_ctx.customStyle),
|
|
234
|
+
visible: _ctx.showPopup,
|
|
235
|
+
"onUpdate:visible": _cache[1] || (_cache[1] = ($event) => _ctx.showPopup = $event),
|
|
236
|
+
position: "",
|
|
237
|
+
transition: "nut-popover",
|
|
238
|
+
overlay: _ctx.overlay,
|
|
239
|
+
duration: _ctx.duration,
|
|
240
|
+
overlayStyle: _ctx.overlayStyle,
|
|
241
|
+
overlayClass: _ctx.overlayClass,
|
|
242
|
+
closeOnClickOverlay: _ctx.closeOnClickOverlay
|
|
243
|
+
}, {
|
|
244
|
+
default: withCtx(() => [
|
|
245
|
+
createElementVNode("view", _hoisted_1, [
|
|
246
|
+
_ctx.showArrow ? (openBlock(), createElementBlock("view", {
|
|
247
|
+
key: 0,
|
|
248
|
+
class: normalizeClass(_ctx.popoverArrow),
|
|
249
|
+
style: normalizeStyle(_ctx.popoverArrowStyle)
|
|
250
|
+
}, null, 6)) : createCommentVNode("", true),
|
|
251
|
+
renderSlot(_ctx.$slots, "content"),
|
|
252
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.list, (item, index2) => {
|
|
253
|
+
return openBlock(), createElementBlock("view", {
|
|
254
|
+
key: index2,
|
|
255
|
+
class: normalizeClass([item.className, item.disabled && "nut-popover-menu-disabled", "nut-popover-menu-item"]),
|
|
256
|
+
onClick: withModifiers(($event) => _ctx.chooseItem(item, index2), ["stop"])
|
|
257
|
+
}, [
|
|
258
|
+
item.icon ? renderSlot(_ctx.$slots, "default", { key: 0 }, () => [
|
|
259
|
+
createVNode(_component_Icon, mergeProps(_ctx.$attrs, {
|
|
260
|
+
class: "nut-popover-item-img",
|
|
261
|
+
classPrefix: _ctx.iconPrefix,
|
|
262
|
+
name: item.icon
|
|
263
|
+
}), null, 16, ["classPrefix", "name"])
|
|
264
|
+
]) : createCommentVNode("", true),
|
|
265
|
+
createElementVNode("view", _hoisted_3, toDisplayString(item.name), 1)
|
|
266
|
+
], 10, _hoisted_2);
|
|
267
|
+
}), 128))
|
|
268
|
+
], 512)
|
|
269
|
+
]),
|
|
270
|
+
_: 3
|
|
271
|
+
}, 8, ["popClass", "style", "visible", "overlay", "duration", "overlayStyle", "overlayClass", "closeOnClickOverlay"])
|
|
272
|
+
], 6)
|
|
273
|
+
], 64);
|
|
184
274
|
}
|
|
185
275
|
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
186
276
|
export { index as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.3.0 Fri Dec
|
|
2
|
+
* @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -37,12 +37,17 @@ const _sfc_main = create({
|
|
|
37
37
|
size: {
|
|
38
38
|
type: String,
|
|
39
39
|
default: "large"
|
|
40
|
+
},
|
|
41
|
+
strikeThrough: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false
|
|
40
44
|
}
|
|
41
45
|
},
|
|
42
46
|
setup(props) {
|
|
43
47
|
const classes = computed(() => {
|
|
44
48
|
return {
|
|
45
|
-
[componentName]: true
|
|
49
|
+
[componentName]: true,
|
|
50
|
+
[`${componentName}--strike`]: props.strikeThrough
|
|
46
51
|
};
|
|
47
52
|
});
|
|
48
53
|
const showSymbol = computed(() => {
|
package/dist/packages/_es/Row.js
CHANGED
package/dist/packages/_es/Sku.js
CHANGED