@nutui/nutui 4.0.10-beta.1 → 4.0.10
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/CHANGELOG.md +17 -0
- package/dist/nutui.es.js +1 -1
- package/dist/nutui.js +6550 -8291
- package/dist/nutui.umd.js +1 -1
- package/dist/packages/_es/ActionSheet.js +78 -111
- package/dist/packages/_es/Address.js +250 -375
- package/dist/packages/_es/AddressList.js +269 -354
- package/dist/packages/_es/Animate.js +41 -58
- package/dist/packages/_es/Audio.js +128 -197
- package/dist/packages/_es/AudioOperate.js +60 -71
- package/dist/packages/_es/Avatar.js +66 -89
- package/dist/packages/_es/AvatarGroup.js +23 -31
- package/dist/packages/_es/Backtop.js +59 -99
- package/dist/packages/_es/Badge.js +36 -47
- package/dist/packages/_es/Barrage.js +68 -147
- package/dist/packages/_es/Button.js +47 -66
- package/dist/packages/_es/Calendar.js +135 -157
- package/dist/packages/_es/CalendarItem.js +6 -6
- package/dist/packages/_es/Card.js +42 -56
- package/dist/packages/_es/Cascader.js +315 -474
- package/dist/packages/_es/Category.js +29 -39
- package/dist/packages/_es/CategoryPane.js +57 -83
- package/dist/packages/_es/Cell.js +56 -71
- package/dist/packages/_es/CellGroup.js +19 -27
- package/dist/packages/_es/Checkbox.js +109 -156
- package/dist/packages/_es/CheckboxGroup.js +38 -59
- package/dist/packages/_es/CircleProgress.js +67 -96
- package/dist/packages/_es/Col.js +23 -31
- package/dist/packages/_es/Collapse.js +33 -58
- package/dist/packages/_es/CollapseItem.js +78 -108
- package/dist/packages/_es/Comment.js +207 -279
- package/dist/packages/_es/ConfigProvider.js +37 -55
- package/dist/packages/_es/Countdown.js +100 -212
- package/dist/packages/_es/Countup.js +232 -445
- package/dist/packages/_es/DatePicker.js +162 -265
- package/dist/packages/_es/Dialog.js +161 -213
- package/dist/packages/_es/Divider.js +42 -57
- package/dist/packages/_es/Drag.js +70 -153
- package/dist/packages/_es/Ecard.js +64 -104
- package/dist/packages/_es/Elevator.js +143 -219
- package/dist/packages/_es/Ellipsis.js +95 -178
- package/dist/packages/_es/Empty.js +23 -39
- package/dist/packages/_es/FixedNav.js +93 -116
- package/dist/packages/_es/Form.js +107 -178
- package/dist/packages/_es/FormItem.js +48 -61
- package/dist/packages/_es/Grid.js +5 -6
- package/dist/packages/_es/GridItem.js +58 -84
- package/dist/packages/_es/Image.js +90 -129
- package/dist/packages/_es/ImagePreview.js +256 -412
- package/dist/packages/_es/Indicator.js +30 -34
- package/dist/packages/_es/InfiniteLoading.js +83 -136
- package/dist/packages/_es/Input.js +160 -264
- package/dist/packages/_es/InputNumber.js +81 -117
- package/dist/packages/_es/Interceptor-6e26b757.js +18 -0
- package/dist/packages/_es/Invoice.js +104 -130
- package/dist/packages/_es/Layout.js +3 -4
- package/dist/packages/_es/List.js +117 -215
- package/dist/packages/_es/Menu.js +95 -150
- package/dist/packages/_es/MenuItem.js +109 -154
- package/dist/packages/_es/Navbar.js +103 -119
- package/dist/packages/_es/Noticebar.js +197 -312
- package/dist/packages/_es/Notify.js +110 -166
- package/dist/packages/_es/NumberKeyboard.js +127 -202
- package/dist/packages/_es/Overlay.js +52 -80
- package/dist/packages/_es/Pagination.js +70 -100
- package/dist/packages/_es/Picker.js +275 -437
- package/dist/packages/_es/Popover.js +122 -225
- package/dist/packages/_es/Popup.js +4 -4
- package/dist/packages/_es/Price.js +44 -82
- package/dist/packages/_es/Progress.js +63 -79
- package/dist/packages/_es/PullRefresh.js +95 -173
- package/dist/packages/_es/Radio.js +4 -4
- package/dist/packages/_es/RadioGroup.js +3 -3
- package/dist/packages/_es/Range.js +204 -347
- package/dist/packages/_es/Rate.js +92 -141
- package/dist/packages/_es/Row.js +21 -27
- package/dist/packages/_es/Searchbar.js +123 -174
- package/dist/packages/_es/ShortPassword.js +69 -93
- package/dist/packages/_es/SideNavbar.js +49 -80
- package/dist/packages/_es/SideNavbarItem.js +22 -32
- package/dist/packages/_es/Signature.js +83 -146
- package/dist/packages/_es/Skeleton.js +110 -130
- package/dist/packages/_es/Sku.js +250 -343
- package/dist/packages/_es/Step.js +59 -86
- package/dist/packages/_es/Steps.js +26 -31
- package/dist/packages/_es/Sticky.js +4 -4
- package/dist/packages/_es/SubSideNavbar.js +52 -74
- package/dist/packages/_es/Swipe.js +83 -155
- package/dist/packages/_es/Swiper.js +174 -311
- package/dist/packages/_es/SwiperItem.js +28 -44
- package/dist/packages/_es/Switch.js +55 -68
- package/dist/packages/_es/TabPane.js +30 -41
- package/dist/packages/_es/Tabbar.js +41 -52
- package/dist/packages/_es/TabbarItem.js +61 -82
- package/dist/packages/_es/Table.js +109 -165
- package/dist/packages/_es/Tabs.js +240 -388
- package/dist/packages/_es/Tag.js +44 -61
- package/dist/packages/_es/Textarea.js +80 -124
- package/dist/packages/_es/TimeDetail.js +49 -76
- package/dist/packages/_es/TimePannel.js +34 -48
- package/dist/packages/_es/TimeSelect.js +47 -68
- package/dist/packages/_es/Toast.js +144 -218
- package/dist/packages/_es/Tour.js +138 -192
- package/dist/packages/_es/TrendArrow.js +57 -77
- package/dist/packages/_es/Uploader.js +234 -359
- package/dist/packages/_es/Video.js +191 -316
- package/dist/packages/_es/Watermark.js +84 -117
- package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +9 -0
- package/dist/packages/_es/common-d218746f.js +116 -0
- package/dist/packages/_es/component-234624bc.js +89 -0
- package/dist/packages/_es/index-14dfadc4.js +561 -0
- package/dist/packages/_es/index-192a3ef6.js +29 -0
- package/dist/packages/_es/index-360c5092.js +210 -0
- package/dist/packages/_es/index-496e6e05.js +24 -0
- package/dist/packages/_es/index-50eed3d9.js +7 -0
- package/dist/packages/_es/index-53ec2d4d.js +34 -0
- package/dist/packages/_es/index-fadb0974.js +8 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +43 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +77 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +110 -0
- package/dist/packages/_es/mountComponent-6d4ff200.js +23 -0
- package/dist/packages/_es/pxCheck-38173291.js +4 -0
- package/dist/packages/_es/raf-a74f1a06.js +16 -0
- package/dist/packages/_es/renderIcon-47498b32.js +5 -0
- package/dist/smartips/web-types.json +1 -1
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +154 -51
- package/dist/styles/themes/jdb.scss +154 -51
- package/dist/styles/themes/jddkh.scss +154 -51
- package/dist/styles/themes/jdt.scss +154 -51
- package/dist/types/__VUE/address/index.vue.d.ts +1 -1
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +110 -3
- package/dist/types/__VUE/image/index.vue.d.ts +2 -2
- package/dist/types/__VUE/rate/index.vue.d.ts +110 -3
- package/dist/types/__VUE/searchbar/index.vue.d.ts +110 -3
- package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -2
- package/dist/types/__VUE/swiper/index.vue.d.ts +1 -1
- package/dist/types/__VUE/table/common.d.ts +55 -2
- package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
- package/dist/types/__VUE/watermark/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/packages/_es/Interceptor-956b24fc.js +0 -29
- package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +0 -10
- package/dist/packages/_es/common-b9a5e726.js +0 -145
- package/dist/packages/_es/component-81a4c1d0.js +0 -145
- package/dist/packages/_es/index-29892cda.js +0 -33
- package/dist/packages/_es/index-43c34ac6.js +0 -30
- package/dist/packages/_es/index-54d03fc1.js +0 -8
- package/dist/packages/_es/index-79c5dc33.js +0 -10
- package/dist/packages/_es/index-7a7385e4.js +0 -67
- package/dist/packages/_es/index-87422be8.js +0 -942
- package/dist/packages/_es/index-da0a7662.js +0 -259
- package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +0 -46
- package/dist/packages/_es/index.vue_vue_type_script_lang-442e4704.js +0 -98
- package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +0 -151
- package/dist/packages/_es/mountComponent-8b24c346.js +0 -39
- package/dist/packages/_es/pxCheck-c6b9f6b7.js +0 -6
- package/dist/packages/_es/raf-729dad54.js +0 -25
- package/dist/packages/_es/renderIcon-3d0fd47c.js +0 -9
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { ref, computed, onMounted, onUnmounted, reactive, provide, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, normalizeStyle, toDisplayString, renderSlot, createBlock } from "vue";
|
|
2
|
-
import { c as
|
|
3
|
-
import { u as
|
|
4
|
-
import { ArrowUp2, ArrowDown2 } from "@nutui/icons-vue";
|
|
5
|
-
import { _ as
|
|
1
|
+
import { ref as v, computed as y, onMounted as N, onUnmounted as P, reactive as _, provide as T, resolveComponent as k, openBlock as i, createElementBlock as g, normalizeClass as u, createElementVNode as p, Fragment as D, renderList as I, normalizeStyle as U, toDisplayString as R, renderSlot as b, createBlock as x } from "vue";
|
|
2
|
+
import { c as z } from "./component-234624bc.js";
|
|
3
|
+
import { u as M } from "./index-192a3ef6.js";
|
|
4
|
+
import { ArrowUp2 as j, ArrowDown2 as H } from "@nutui/icons-vue";
|
|
5
|
+
import { _ as V } from "./_plugin-vue_export-helper-dad06003.js";
|
|
6
6
|
import "../locale/lang";
|
|
7
|
-
const { componentName, create } =
|
|
8
|
-
const _sfc_main = create({
|
|
7
|
+
const { componentName: W, create: Y } = z("menu"), q = Y({
|
|
9
8
|
components: {
|
|
10
|
-
ArrowUp2,
|
|
11
|
-
ArrowDown2
|
|
9
|
+
ArrowUp2: j,
|
|
10
|
+
ArrowDown2: H
|
|
12
11
|
},
|
|
13
12
|
props: {
|
|
14
13
|
activeColor: {
|
|
@@ -17,11 +16,11 @@ const _sfc_main = create({
|
|
|
17
16
|
},
|
|
18
17
|
overlay: {
|
|
19
18
|
type: Boolean,
|
|
20
|
-
default:
|
|
19
|
+
default: !0
|
|
21
20
|
},
|
|
22
21
|
lockScroll: {
|
|
23
22
|
type: Boolean,
|
|
24
|
-
default:
|
|
23
|
+
default: !0
|
|
25
24
|
},
|
|
26
25
|
duration: {
|
|
27
26
|
type: [Number, String],
|
|
@@ -29,7 +28,7 @@ const _sfc_main = create({
|
|
|
29
28
|
},
|
|
30
29
|
closeOnClickOverlay: {
|
|
31
30
|
type: Boolean,
|
|
32
|
-
default:
|
|
31
|
+
default: !0
|
|
33
32
|
},
|
|
34
33
|
direction: {
|
|
35
34
|
type: String,
|
|
@@ -37,162 +36,108 @@ const _sfc_main = create({
|
|
|
37
36
|
},
|
|
38
37
|
scrollFixed: {
|
|
39
38
|
type: [Boolean, String, Number],
|
|
40
|
-
default:
|
|
39
|
+
default: !1
|
|
41
40
|
},
|
|
42
41
|
titleClass: [String]
|
|
43
42
|
},
|
|
44
|
-
setup(
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
const isScrollFixed = ref(false);
|
|
48
|
-
const useChildren = () => {
|
|
49
|
-
const publicChildren = reactive([]);
|
|
50
|
-
const internalChildren = reactive([]);
|
|
51
|
-
const linkChildren2 = (value) => {
|
|
52
|
-
const link = (child) => {
|
|
53
|
-
if (child.proxy) {
|
|
54
|
-
internalChildren.push(child);
|
|
55
|
-
publicChildren.push(child.proxy);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
const removeLink = (child) => {
|
|
59
|
-
if (child.proxy) {
|
|
60
|
-
let internalIndex = internalChildren.indexOf(child);
|
|
61
|
-
if (internalIndex > -1) {
|
|
62
|
-
internalChildren.splice(internalIndex, 1);
|
|
63
|
-
}
|
|
64
|
-
let publicIndex = publicChildren.indexOf(child.proxy);
|
|
65
|
-
if (internalIndex > -1) {
|
|
66
|
-
publicChildren.splice(publicIndex, 1);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
provide(
|
|
71
|
-
"menuParent",
|
|
72
|
-
Object.assign(
|
|
73
|
-
{
|
|
74
|
-
removeLink,
|
|
75
|
-
link,
|
|
76
|
-
children: publicChildren,
|
|
77
|
-
internalChildren
|
|
78
|
-
},
|
|
79
|
-
value
|
|
80
|
-
)
|
|
81
|
-
);
|
|
82
|
-
};
|
|
83
|
-
return {
|
|
84
|
-
children: publicChildren,
|
|
85
|
-
linkChildren: linkChildren2
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
const { children, linkChildren } = useChildren();
|
|
89
|
-
const opened = computed(() => children.some((item) => item.state.showWrapper));
|
|
90
|
-
const classes = computed(() => {
|
|
91
|
-
const prefixCls = componentName;
|
|
43
|
+
setup(o, { emit: S, slots: $ }) {
|
|
44
|
+
const c = v(), a = v(0), f = v(!1), m = () => {
|
|
45
|
+
const e = _([]), t = _([]);
|
|
92
46
|
return {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
47
|
+
children: e,
|
|
48
|
+
linkChildren: (E) => {
|
|
49
|
+
T(
|
|
50
|
+
"menuParent",
|
|
51
|
+
Object.assign(
|
|
52
|
+
{
|
|
53
|
+
removeLink: (r) => {
|
|
54
|
+
if (r.proxy) {
|
|
55
|
+
let w = t.indexOf(r);
|
|
56
|
+
w > -1 && t.splice(w, 1);
|
|
57
|
+
let L = e.indexOf(r.proxy);
|
|
58
|
+
w > -1 && e.splice(L, 1);
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
link: (r) => {
|
|
62
|
+
r.proxy && (t.push(r), e.push(r.proxy));
|
|
63
|
+
},
|
|
64
|
+
children: e,
|
|
65
|
+
internalChildren: t
|
|
66
|
+
},
|
|
67
|
+
E
|
|
68
|
+
)
|
|
69
|
+
);
|
|
104
70
|
}
|
|
71
|
+
};
|
|
72
|
+
}, { children: s, linkChildren: n } = m(), d = y(() => s.some((e) => e.state.showWrapper)), h = y(() => ({
|
|
73
|
+
[W]: !0,
|
|
74
|
+
"scroll-fixed": f.value
|
|
75
|
+
})), B = () => {
|
|
76
|
+
if (c.value) {
|
|
77
|
+
const e = M(c);
|
|
78
|
+
o.direction === "down" ? a.value = e.bottom : a.value = window.innerHeight - e.top;
|
|
105
79
|
}
|
|
106
80
|
};
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
updateOffset();
|
|
112
|
-
item.toggle();
|
|
113
|
-
} else if (item.state.showPopup) {
|
|
114
|
-
item.toggle(false, { immediate: true });
|
|
115
|
-
}
|
|
81
|
+
n({ props: o, offset: a });
|
|
82
|
+
const O = (e) => {
|
|
83
|
+
s.forEach((t, l) => {
|
|
84
|
+
l === e ? (B(), t.toggle()) : t.state.showPopup && t.toggle(!1, { immediate: !0 });
|
|
116
85
|
});
|
|
86
|
+
}, A = (e) => Math.max(0, "scrollTop" in e ? e.scrollTop : e.pageYOffset), C = () => {
|
|
87
|
+
const { scrollFixed: e } = o, t = A(window);
|
|
88
|
+
f.value = t > (typeof e == "boolean" ? 30 : Number(e));
|
|
89
|
+
}, F = (e) => {
|
|
90
|
+
let t = "";
|
|
91
|
+
const { titleClass: l } = o;
|
|
92
|
+
return e && (t += "active"), l && (t += ` ${l}`), t;
|
|
117
93
|
};
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
const { scrollFixed } =
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
if (titleClass) {
|
|
133
|
-
str += ` ${titleClass}`;
|
|
134
|
-
}
|
|
135
|
-
return str;
|
|
136
|
-
};
|
|
137
|
-
onMounted(() => {
|
|
138
|
-
const { scrollFixed } = props;
|
|
139
|
-
if (scrollFixed) {
|
|
140
|
-
window.addEventListener("scroll", onScroll);
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
onUnmounted(() => {
|
|
144
|
-
const { scrollFixed } = props;
|
|
145
|
-
if (scrollFixed) {
|
|
146
|
-
window.removeEventListener("scroll", onScroll);
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
return {
|
|
150
|
-
toggleItem,
|
|
151
|
-
children,
|
|
152
|
-
opened,
|
|
153
|
-
classes,
|
|
154
|
-
barRef,
|
|
155
|
-
getClasses
|
|
94
|
+
return N(() => {
|
|
95
|
+
const { scrollFixed: e } = o;
|
|
96
|
+
e && window.addEventListener("scroll", C);
|
|
97
|
+
}), P(() => {
|
|
98
|
+
const { scrollFixed: e } = o;
|
|
99
|
+
e && window.removeEventListener("scroll", C);
|
|
100
|
+
}), {
|
|
101
|
+
toggleItem: O,
|
|
102
|
+
children: s,
|
|
103
|
+
opened: d,
|
|
104
|
+
classes: h,
|
|
105
|
+
barRef: c,
|
|
106
|
+
getClasses: F
|
|
156
107
|
};
|
|
157
108
|
}
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
const _component_ArrowUp2 = resolveComponent("ArrowUp2");
|
|
164
|
-
const _component_ArrowDown2 = resolveComponent("ArrowDown2");
|
|
165
|
-
return openBlock(), createElementBlock("view", {
|
|
166
|
-
class: normalizeClass(_ctx.classes)
|
|
109
|
+
}), G = ["onClick"], J = { class: "nut-menu__title-text" }, K = { class: "nut-menu__title-icon" };
|
|
110
|
+
function Q(o, S, $, c, a, f) {
|
|
111
|
+
const m = k("ArrowUp2"), s = k("ArrowDown2");
|
|
112
|
+
return i(), g("view", {
|
|
113
|
+
class: u(o.classes)
|
|
167
114
|
}, [
|
|
168
|
-
|
|
169
|
-
class:
|
|
115
|
+
p("view", {
|
|
116
|
+
class: u(["nut-menu__bar", { opened: o.opened }]),
|
|
170
117
|
ref: "barRef"
|
|
171
118
|
}, [
|
|
172
|
-
(
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
119
|
+
(i(!0), g(D, null, I(o.children, (n, d) => (i(), g("view", {
|
|
120
|
+
key: d,
|
|
121
|
+
class: u(["nut-menu__item", { disabled: n.disabled, active: n.state.showPopup }]),
|
|
122
|
+
onClick: (h) => !n.disabled && o.toggleItem(d),
|
|
123
|
+
style: U({ color: n.state.showPopup ? o.activeColor : "" })
|
|
124
|
+
}, [
|
|
125
|
+
p("view", {
|
|
126
|
+
class: u(["nut-menu__title", o.getClasses(n.state.showPopup)])
|
|
178
127
|
}, [
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
createElementVNode("span", _hoisted_3, [
|
|
184
|
-
renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
185
|
-
_ctx.direction === "up" ? (openBlock(), createBlock(_component_ArrowUp2, { key: 0 })) : (openBlock(), createBlock(_component_ArrowDown2, { key: 1 }))
|
|
186
|
-
])
|
|
128
|
+
p("view", J, R(n.renderTitle()), 1),
|
|
129
|
+
p("span", K, [
|
|
130
|
+
b(o.$slots, "icon", {}, () => [
|
|
131
|
+
o.direction === "up" ? (i(), x(m, { key: 0 })) : (i(), x(s, { key: 1 }))
|
|
187
132
|
])
|
|
188
|
-
]
|
|
189
|
-
],
|
|
190
|
-
|
|
133
|
+
])
|
|
134
|
+
], 2)
|
|
135
|
+
], 14, G))), 128))
|
|
191
136
|
], 2),
|
|
192
|
-
|
|
137
|
+
b(o.$slots, "default")
|
|
193
138
|
], 2);
|
|
194
139
|
}
|
|
195
|
-
const
|
|
140
|
+
const le = /* @__PURE__ */ V(q, [["render", Q]]);
|
|
196
141
|
export {
|
|
197
|
-
|
|
142
|
+
le as default
|
|
198
143
|
};
|
|
@@ -1,31 +1,23 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { reactive, computed, inject, getCurrentInstance, onUnmounted, resolveComponent, withDirectives, openBlock, createElementBlock, normalizeStyle, createElementVNode, vShow, createVNode, mergeProps, withCtx, Fragment, renderList, normalizeClass, renderSlot, createCommentVNode, toDisplayString } from "vue";
|
|
21
|
-
import { c as createComponent } from "./component-81a4c1d0.js";
|
|
22
|
-
import { P as Popup } from "./index-da0a7662.js";
|
|
23
|
-
import { Check } from "@nutui/icons-vue";
|
|
24
|
-
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
1
|
+
var B = Object.defineProperty, D = Object.defineProperties;
|
|
2
|
+
var z = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var w = Object.getOwnPropertySymbols;
|
|
4
|
+
var L = Object.prototype.hasOwnProperty, U = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var g = (e, o, t) => o in e ? B(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t, d = (e, o) => {
|
|
6
|
+
for (var t in o || (o = {}))
|
|
7
|
+
L.call(o, t) && g(e, t, o[t]);
|
|
8
|
+
if (w)
|
|
9
|
+
for (var t of w(o))
|
|
10
|
+
U.call(o, t) && g(e, t, o[t]);
|
|
11
|
+
return e;
|
|
12
|
+
}, m = (e, o) => D(e, z(o));
|
|
13
|
+
import { reactive as j, computed as P, inject as A, getCurrentInstance as F, onUnmounted as I, resolveComponent as S, withDirectives as V, openBlock as r, createElementBlock as i, normalizeStyle as p, createElementVNode as v, vShow as b, createVNode as $, mergeProps as T, withCtx as q, Fragment as G, renderList as H, normalizeClass as f, renderSlot as O, createCommentVNode as J, toDisplayString as K } from "vue";
|
|
14
|
+
import { c as M } from "./component-234624bc.js";
|
|
15
|
+
import { P as E } from "./index-360c5092.js";
|
|
16
|
+
import { Check as Q } from "@nutui/icons-vue";
|
|
17
|
+
import { _ as R } from "./_plugin-vue_export-helper-dad06003.js";
|
|
25
18
|
import "../locale/lang";
|
|
26
19
|
import "./Overlay.js";
|
|
27
|
-
const { create } =
|
|
28
|
-
const _sfc_main = create({
|
|
20
|
+
const { create: X } = M("menu-item"), Y = X({
|
|
29
21
|
props: {
|
|
30
22
|
title: String,
|
|
31
23
|
options: {
|
|
@@ -34,7 +26,7 @@ const _sfc_main = create({
|
|
|
34
26
|
},
|
|
35
27
|
disabled: {
|
|
36
28
|
type: Boolean,
|
|
37
|
-
default:
|
|
29
|
+
default: !1
|
|
38
30
|
},
|
|
39
31
|
modelValue: null,
|
|
40
32
|
cols: {
|
|
@@ -45,155 +37,118 @@ const _sfc_main = create({
|
|
|
45
37
|
inactiveTitleClass: String
|
|
46
38
|
},
|
|
47
39
|
components: {
|
|
48
|
-
[
|
|
49
|
-
Check
|
|
40
|
+
[E.name]: E,
|
|
41
|
+
Check: Q
|
|
50
42
|
},
|
|
51
43
|
emits: ["update:modelValue", "change", "open", "close"],
|
|
52
|
-
setup(
|
|
53
|
-
const
|
|
54
|
-
showPopup:
|
|
55
|
-
showWrapper:
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
onUnmounted(() => {
|
|
64
|
-
removeLink(instance);
|
|
65
|
-
});
|
|
66
|
-
return { parent: parent2 };
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
const { parent } = useParent();
|
|
70
|
-
const style = computed(() => {
|
|
71
|
-
return parent.props.direction === "down" ? {
|
|
72
|
-
top: parent.offset.value + "px"
|
|
73
|
-
} : {
|
|
74
|
-
bottom: parent.offset.value + "px"
|
|
75
|
-
};
|
|
76
|
-
});
|
|
77
|
-
const placeholderElementStyle = computed(() => {
|
|
78
|
-
const heightStyle = { height: parent.offset.value + "px" };
|
|
79
|
-
if (parent.props.direction === "down") {
|
|
80
|
-
return __spreadProps(__spreadValues({}, heightStyle), { top: "0px" });
|
|
81
|
-
} else {
|
|
82
|
-
return __spreadProps(__spreadValues({}, heightStyle), { bottom: "0px" });
|
|
44
|
+
setup(e, { emit: o }) {
|
|
45
|
+
const t = j({
|
|
46
|
+
showPopup: !1,
|
|
47
|
+
showWrapper: !1
|
|
48
|
+
}), h = () => {
|
|
49
|
+
const l = A("menuParent", null);
|
|
50
|
+
if (l) {
|
|
51
|
+
const a = F(), { link: c, removeLink: W } = l;
|
|
52
|
+
return c(a), I(() => {
|
|
53
|
+
W(a);
|
|
54
|
+
}), { parent: l };
|
|
83
55
|
}
|
|
56
|
+
}, { parent: s } = h(), C = P(() => s.props.direction === "down" ? {
|
|
57
|
+
top: s.offset.value + "px"
|
|
58
|
+
} : {
|
|
59
|
+
bottom: s.offset.value + "px"
|
|
60
|
+
}), u = P(() => {
|
|
61
|
+
const l = { height: s.offset.value + "px" };
|
|
62
|
+
return s.props.direction === "down" ? m(d({}, l), { top: "0px" }) : m(d({}, l), { bottom: "0px" });
|
|
84
63
|
});
|
|
85
|
-
const toggle = (show = !state.showPopup) => {
|
|
86
|
-
if (show === state.showPopup) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
state.showPopup = show;
|
|
90
|
-
if (show) {
|
|
91
|
-
state.showWrapper = true;
|
|
92
|
-
emit("open");
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
const renderTitle = () => {
|
|
96
|
-
var _a;
|
|
97
|
-
if (props.title) {
|
|
98
|
-
return props.title;
|
|
99
|
-
}
|
|
100
|
-
const match = (_a = props.options) == null ? void 0 : _a.find((option) => option.value === props.modelValue);
|
|
101
|
-
return match ? match.text : "";
|
|
102
|
-
};
|
|
103
|
-
const onClick = (option) => {
|
|
104
|
-
state.showPopup = false;
|
|
105
|
-
if (option.value !== props.modelValue) {
|
|
106
|
-
emit("update:modelValue", option.value);
|
|
107
|
-
emit("change", option.value);
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
const handleClose = () => {
|
|
111
|
-
emit("close");
|
|
112
|
-
state.showWrapper = false;
|
|
113
|
-
};
|
|
114
|
-
const handleClickOutside = () => {
|
|
115
|
-
state.showPopup = false;
|
|
116
|
-
emit("close");
|
|
117
|
-
};
|
|
118
64
|
return {
|
|
119
|
-
style,
|
|
120
|
-
placeholderElementStyle,
|
|
121
|
-
renderTitle
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
65
|
+
style: C,
|
|
66
|
+
placeholderElementStyle: u,
|
|
67
|
+
renderTitle: () => {
|
|
68
|
+
var a;
|
|
69
|
+
if (e.title)
|
|
70
|
+
return e.title;
|
|
71
|
+
const l = (a = e.options) == null ? void 0 : a.find((c) => c.value === e.modelValue);
|
|
72
|
+
return l ? l.text : "";
|
|
73
|
+
},
|
|
74
|
+
state: t,
|
|
75
|
+
parent: s,
|
|
76
|
+
toggle: (l = !t.showPopup) => {
|
|
77
|
+
l !== t.showPopup && (t.showPopup = l, l && (t.showWrapper = !0, o("open")));
|
|
78
|
+
},
|
|
79
|
+
onClick: (l) => {
|
|
80
|
+
t.showPopup = !1, l.value !== e.modelValue && (o("update:modelValue", l.value), o("change", l.value));
|
|
81
|
+
},
|
|
82
|
+
handleClose: () => {
|
|
83
|
+
o("close"), t.showWrapper = !1;
|
|
84
|
+
},
|
|
85
|
+
handleClickOutside: () => {
|
|
86
|
+
t.showPopup = !1, o("close");
|
|
87
|
+
}
|
|
128
88
|
};
|
|
129
89
|
}
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
const _component_Check = resolveComponent("Check");
|
|
135
|
-
const _component_nut_popup = resolveComponent("nut-popup");
|
|
136
|
-
return withDirectives((openBlock(), createElementBlock("view", {
|
|
90
|
+
}), Z = { class: "nut-menu-item__content nut-menu-item__overflow" }, _ = ["onClick"];
|
|
91
|
+
function x(e, o, t, h, s, C) {
|
|
92
|
+
const u = S("Check"), y = S("nut-popup");
|
|
93
|
+
return V((r(), i("view", {
|
|
137
94
|
class: "nut-menu-item",
|
|
138
|
-
style:
|
|
95
|
+
style: p(e.style)
|
|
139
96
|
}, [
|
|
140
|
-
|
|
141
|
-
onClick:
|
|
97
|
+
V(v("div", {
|
|
98
|
+
onClick: o[0] || (o[0] = (...n) => e.handleClickOutside && e.handleClickOutside(...n)),
|
|
142
99
|
class: "nut-menu-item-placeholder-element",
|
|
143
|
-
style:
|
|
100
|
+
style: p(e.placeholderElementStyle)
|
|
144
101
|
}, null, 4), [
|
|
145
|
-
[
|
|
102
|
+
[b, e.state.showPopup]
|
|
146
103
|
]),
|
|
147
|
-
|
|
104
|
+
$(y, T({
|
|
148
105
|
style: { position: "absolute" },
|
|
149
106
|
overlayStyle: { position: "absolute" }
|
|
150
|
-
},
|
|
151
|
-
visible:
|
|
152
|
-
"onUpdate:visible":
|
|
153
|
-
position:
|
|
154
|
-
duration:
|
|
155
|
-
"destroy-on-close":
|
|
156
|
-
overlay:
|
|
157
|
-
onClosed:
|
|
158
|
-
lockScroll:
|
|
159
|
-
teleportDisable:
|
|
160
|
-
"close-on-click-overlay":
|
|
107
|
+
}, e.$attrs, {
|
|
108
|
+
visible: e.state.showPopup,
|
|
109
|
+
"onUpdate:visible": o[1] || (o[1] = (n) => e.state.showPopup = n),
|
|
110
|
+
position: e.parent.props.direction === "down" ? "top" : "bottom",
|
|
111
|
+
duration: e.parent.props.duration,
|
|
112
|
+
"destroy-on-close": !1,
|
|
113
|
+
overlay: e.parent.props.overlay,
|
|
114
|
+
onClosed: e.handleClose,
|
|
115
|
+
lockScroll: e.parent.props.lockScroll,
|
|
116
|
+
teleportDisable: !1,
|
|
117
|
+
"close-on-click-overlay": e.parent.props.closeOnClickOverlay
|
|
161
118
|
}), {
|
|
162
|
-
default:
|
|
163
|
-
|
|
164
|
-
(
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
119
|
+
default: q(() => [
|
|
120
|
+
v("view", Z, [
|
|
121
|
+
(r(!0), i(G, null, H(e.options, (n, k) => (r(), i("view", {
|
|
122
|
+
key: k,
|
|
123
|
+
class: f(["nut-menu-item__option", [{ active: n.value === e.modelValue }]]),
|
|
124
|
+
style: p({ "flex-basis": 100 / e.cols + "%" }),
|
|
125
|
+
onClick: (N) => e.onClick(n)
|
|
126
|
+
}, [
|
|
127
|
+
n.value === e.modelValue ? (r(), i("span", {
|
|
128
|
+
key: 0,
|
|
129
|
+
class: f(["nut-menu-item__span", [n.value === e.modelValue ? e.activeTitleClass : e.inactiveTitleClass]])
|
|
170
130
|
}, [
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
style: normalizeStyle({ color: option.value === _ctx.modelValue ? _ctx.parent.props.activeColor : "" })
|
|
184
|
-
}, toDisplayString(option.text), 7)
|
|
185
|
-
], 14, _hoisted_2);
|
|
186
|
-
}), 128)),
|
|
187
|
-
renderSlot(_ctx.$slots, "default")
|
|
131
|
+
O(e.$slots, "icon", {}, () => [
|
|
132
|
+
$(u, T(e.$attrs, {
|
|
133
|
+
color: e.parent.props.activeColor
|
|
134
|
+
}), null, 16, ["color"])
|
|
135
|
+
])
|
|
136
|
+
], 2)) : J("", !0),
|
|
137
|
+
v("view", {
|
|
138
|
+
class: f([n.value === e.modelValue ? e.activeTitleClass : e.inactiveTitleClass]),
|
|
139
|
+
style: p({ color: n.value === e.modelValue ? e.parent.props.activeColor : "" })
|
|
140
|
+
}, K(n.text), 7)
|
|
141
|
+
], 14, _))), 128)),
|
|
142
|
+
O(e.$slots, "default")
|
|
188
143
|
])
|
|
189
144
|
]),
|
|
190
145
|
_: 3
|
|
191
146
|
}, 16, ["visible", "position", "duration", "overlay", "onClosed", "lockScroll", "close-on-click-overlay"])
|
|
192
147
|
], 4)), [
|
|
193
|
-
[
|
|
148
|
+
[b, e.state.showWrapper]
|
|
194
149
|
]);
|
|
195
150
|
}
|
|
196
|
-
const
|
|
151
|
+
const pe = /* @__PURE__ */ R(Y, [["render", x]]);
|
|
197
152
|
export {
|
|
198
|
-
|
|
153
|
+
pe as default
|
|
199
154
|
};
|