@nutui/nutui 3.1.22-beta.5 → 3.1.23-beta.1
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 +48 -0
- package/README.md +3 -4
- package/dist/nutui.es.js +20412 -4214
- package/dist/nutui.umd.js +20518 -4216
- package/dist/packages/_es/ActionSheet.js +149 -17
- package/dist/packages/_es/Address.js +535 -110
- package/dist/packages/_es/AddressList.js +615 -113
- package/dist/packages/_es/Animate.js +59 -17
- package/dist/packages/_es/Audio.js +257 -53
- package/dist/packages/_es/AudioOperate.js +100 -13
- package/dist/packages/_es/Avatar.js +162 -38
- package/dist/packages/_es/AvatarGroup.js +73 -14
- package/dist/packages/_es/BackTop.js +156 -43
- package/dist/packages/_es/Badge.js +86 -14
- package/dist/packages/_es/Barrage.js +120 -41
- package/dist/packages/_es/Button.js +128 -23
- package/dist/packages/_es/Calendar.js +246 -30
- package/dist/packages/_es/CalendarItem.js +1 -1
- package/dist/packages/_es/Card.js +107 -10
- package/dist/packages/_es/Cascader.js +496 -147
- package/dist/packages/_es/Category.js +58 -15
- package/dist/packages/_es/CategoryPane.js +111 -11
- package/dist/packages/_es/Cell.js +108 -21
- package/dist/packages/_es/CellGroup.js +44 -9
- package/dist/packages/_es/Checkbox.js +134 -29
- package/dist/packages/_es/CheckboxGroup.js +79 -29
- package/dist/packages/_es/CircleProgress.js +150 -28
- package/dist/packages/_es/Col.js +56 -14
- package/dist/packages/_es/Collapse.js +109 -32
- package/dist/packages/_es/CollapseItem.js +253 -59
- package/dist/packages/_es/Comment.js +434 -64
- package/dist/packages/_es/ConfigProvider.js +20 -8
- package/dist/packages/_es/CountDown.js +238 -56
- package/dist/packages/_es/CountUp.js +539 -140
- package/dist/packages/_es/DatePicker.js +315 -98
- package/dist/packages/_es/Dialog.js +289 -60
- package/dist/packages/_es/Divider.js +65 -13
- package/dist/packages/_es/Drag.js +197 -56
- package/dist/packages/_es/Ecard.js +159 -24
- package/dist/packages/_es/Elevator.js +255 -58
- package/dist/packages/_es/Ellipsis.js +200 -58
- package/dist/packages/_es/Empty.js +71 -12
- package/dist/packages/_es/FixedNav.js +122 -15
- package/dist/packages/_es/Form.js +151 -64
- package/dist/packages/_es/FormItem.js +114 -15
- package/dist/packages/_es/Grid.js +6 -5
- package/dist/packages/_es/GridItem.js +144 -33
- package/dist/packages/_es/Icon.js +40 -15
- package/dist/packages/_es/Image.js +137 -26
- package/dist/packages/_es/ImagePreview.js +547 -76
- package/dist/packages/_es/Indicator.js +62 -15
- package/dist/packages/_es/InfiniteLoading.js +249 -57
- package/dist/packages/_es/Input.js +433 -51
- package/dist/packages/_es/InputNumber.js +160 -41
- package/dist/packages/_es/Layout.js +5 -4
- package/dist/packages/_es/List.js +106 -18
- package/dist/packages/_es/Menu.js +168 -44
- package/dist/packages/_es/MenuItem.js +173 -37
- package/dist/packages/_es/Navbar.js +192 -30
- package/dist/packages/_es/NoticeBar.js +380 -74
- package/dist/packages/_es/Notify.js +227 -72
- package/dist/packages/_es/NumberKeyboard.js +272 -41
- package/dist/packages/_es/OldPicker.js +457 -130
- package/dist/packages/_es/OverLay.js +98 -24
- package/dist/packages/_es/Pagination.js +157 -39
- package/dist/packages/_es/Picker.js +454 -129
- package/dist/packages/_es/Popover.js +957 -318
- package/dist/packages/_es/Popup.js +299 -55
- package/dist/packages/_es/Price.js +118 -16
- package/dist/packages/_es/Progress.js +146 -14
- package/dist/packages/_es/PullRefresh.js +339 -84
- package/dist/packages/_es/Radio.js +90 -22
- package/dist/packages/_es/RadioGroup.js +37 -8
- package/dist/packages/_es/Range.js +408 -83
- package/dist/packages/_es/Rate.js +192 -36
- package/dist/packages/_es/Row.js +64 -22
- package/dist/packages/_es/SearchBar.js +238 -37
- package/dist/packages/_es/ShortPassword.js +225 -35
- package/dist/packages/_es/SideNavBar.js +81 -24
- package/dist/packages/_es/SideNavBarItem.js +46 -11
- package/dist/packages/_es/Signature.js +160 -41
- package/dist/packages/_es/Skeleton.js +136 -20
- package/dist/packages/_es/Sku.js +491 -84
- package/dist/packages/_es/Step.js +115 -20
- package/dist/packages/_es/Steps.js +53 -18
- package/dist/packages/_es/Sticky.js +138 -53
- package/dist/packages/_es/SubSideNavBar.js +82 -17
- package/dist/packages/_es/Swipe.js +178 -41
- package/dist/packages/_es/Swiper.js +433 -121
- package/dist/packages/_es/SwiperItem.js +53 -22
- package/dist/packages/_es/Switch.js +116 -21
- package/dist/packages/_es/TabPane.js +39 -12
- package/dist/packages/_es/Tabbar.js +72 -17
- package/dist/packages/_es/TabbarItem.js +151 -29
- package/dist/packages/_es/Table.js +178 -18
- package/dist/packages/_es/Tabs.js +202 -43
- package/dist/packages/_es/Tag.js +97 -20
- package/dist/packages/_es/TextArea.js +160 -42
- package/dist/packages/_es/TimeDetail.js +79 -18
- package/dist/packages/_es/TimePannel.js +48 -14
- package/dist/packages/_es/TimeSelect.js +112 -15
- package/dist/packages/_es/Toast.js +310 -71
- package/dist/packages/_es/Uploader.js +455 -104
- package/dist/packages/_es/Video.js +332 -74
- package/dist/packages/_es/common.js +128 -38
- package/dist/packages/_es/component.js +76 -35
- package/dist/packages/_es/index.js +6 -5
- package/dist/packages/_es/index2.js +30 -9
- package/dist/packages/_es/index3.js +8 -6
- package/dist/packages/_es/index4.js +64 -13
- package/dist/packages/_es/index5.js +780 -164
- package/dist/packages/_es/plugin-vue_export-helper.js +8 -7
- package/dist/packages/_es/pxCheck.js +5 -3
- package/dist/packages/_es/raf.js +15 -8
- package/dist/packages/imagepreview/index.scss +6 -1
- package/dist/packages/locale/lang/baseLang.js +3 -3
- package/dist/packages/locale/lang/en-US.js +105 -5
- package/dist/packages/locale/lang/id-ID.js +105 -5
- package/dist/packages/locale/lang/index.js +38 -16
- package/dist/packages/locale/lang/zh-CN.js +105 -5
- package/dist/packages/locale/lang/zh-TW.js +105 -5
- package/dist/packages/picker/index.scss +13 -0
- package/dist/smartips/attributes.json +8 -0
- package/dist/smartips/tags.json +3 -1
- package/dist/smartips/web-types.json +19 -1
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/themes/default.scss +49 -49
- package/dist/styles/themes/jdb.scss +49 -49
- package/dist/styles/themes/jdt.scss +49 -49
- package/dist/styles/variables-jdb.scss +4 -1
- package/dist/styles/variables-jdt.scss +4 -1
- package/dist/styles/variables.scss +1 -1
- package/dist/types/__VUE/actionsheet/index.vue.d.ts +3 -3
- package/dist/types/__VUE/address/index.vue.d.ts +4 -4
- package/dist/types/__VUE/calendar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/cascader/index.vue.d.ts +3 -3
- package/dist/types/__VUE/cell/index.vue.d.ts +2 -2
- package/dist/types/__VUE/checkbox/index.vue.d.ts +2 -2
- package/dist/types/__VUE/collapse/index.vue.d.ts +2 -2
- package/dist/types/__VUE/datepicker/index.vue.d.ts +2 -2
- package/dist/types/__VUE/dialog/index.vue.d.ts +2 -2
- package/dist/types/__VUE/ecard/index.vue.d.ts +2 -2
- package/dist/types/__VUE/fixednav/index.vue.d.ts +2 -2
- package/dist/types/__VUE/grid/index.vue.d.ts +3 -3
- package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +95 -0
- package/dist/types/__VUE/imagepreview/index.vue.d.ts +23 -25
- package/dist/types/__VUE/infiniteloading/index.vue.d.ts +6 -6
- package/dist/types/__VUE/input/index.vue.d.ts +2 -2
- package/dist/types/__VUE/menu/index.vue.d.ts +4 -4
- package/dist/types/__VUE/menuitem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +2 -2
- package/dist/types/__VUE/oldpicker/index.vue.d.ts +3 -3
- package/dist/types/__VUE/picker/index.vue.d.ts +3 -3
- package/dist/types/__VUE/popover/index.vue.d.ts +6 -6
- package/dist/types/__VUE/popup/index.vue.d.ts +4 -4
- package/dist/types/__VUE/range/index.vue.d.ts +1 -1
- package/dist/types/__VUE/rate/index.vue.d.ts +2 -2
- package/dist/types/__VUE/searchbar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/shortpassword/index.vue.d.ts +1 -1
- package/dist/types/__VUE/sku/index.vue.d.ts +3 -3
- package/dist/types/__VUE/swipe/index.vue.d.ts +2 -2
- package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tabbar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/textarea/index.vue.d.ts +2 -2
- package/dist/types/__VUE/toast/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -2
|
@@ -1,45 +1,181 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.1 Mon Jun 27 2022 21:39:05 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { reactive
|
|
7
|
-
import { c as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { _ } from "./plugin-vue_export-helper.js";
|
|
6
|
+
import { reactive, computed, inject, getCurrentInstance, resolveComponent, withDirectives, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, vShow, createVNode, mergeProps, withCtx, Fragment, renderList, createBlock, createCommentVNode, toDisplayString, renderSlot } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import _sfc_main$1 from "./Icon.js";
|
|
9
|
+
import Popup from "./Popup.js";
|
|
10
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
11
11
|
import "../locale/lang";
|
|
12
12
|
import "./pxCheck.js";
|
|
13
13
|
import "./OverLay.js";
|
|
14
|
-
const { componentName
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
const { componentName, create } = createComponent("menu-item");
|
|
15
|
+
const _sfc_main = create({
|
|
16
|
+
props: {
|
|
17
|
+
title: String,
|
|
18
|
+
options: {
|
|
19
|
+
type: Array,
|
|
20
|
+
default: []
|
|
21
|
+
},
|
|
22
|
+
disabled: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
modelValue: null,
|
|
27
|
+
cols: {
|
|
28
|
+
type: Number,
|
|
29
|
+
default: 1
|
|
30
|
+
},
|
|
31
|
+
titleIcon: String,
|
|
32
|
+
optionIcon: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "Check"
|
|
20
35
|
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
36
|
+
},
|
|
37
|
+
components: {
|
|
38
|
+
[_sfc_main$1.name]: _sfc_main$1,
|
|
39
|
+
[Popup.name]: Popup
|
|
40
|
+
},
|
|
41
|
+
emits: ["update:modelValue", "change"],
|
|
42
|
+
setup(props, { emit, slots }) {
|
|
43
|
+
const state = reactive({
|
|
44
|
+
showPopup: false,
|
|
45
|
+
transition: true,
|
|
46
|
+
showWrapper: false,
|
|
47
|
+
isShowPlaceholderElement: false
|
|
48
|
+
});
|
|
49
|
+
const useParent = () => {
|
|
50
|
+
const parent2 = inject("menuParent", null);
|
|
51
|
+
if (parent2) {
|
|
52
|
+
const instance = getCurrentInstance();
|
|
53
|
+
const { link } = parent2;
|
|
54
|
+
link(instance);
|
|
55
|
+
return {
|
|
56
|
+
parent: parent2
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const { parent } = useParent();
|
|
61
|
+
const classes = computed(() => {
|
|
62
|
+
const prefixCls = componentName;
|
|
63
|
+
return {
|
|
64
|
+
[prefixCls]: true
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
const placeholderElementStyle = computed(() => {
|
|
68
|
+
const heightStyle = { height: parent.offset.value + "px" };
|
|
69
|
+
if (parent.props.direction === "down") {
|
|
70
|
+
return heightStyle;
|
|
71
|
+
} else {
|
|
72
|
+
return { ...heightStyle, top: "auto" };
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
const toggle = (show = !state.showPopup, options = {}) => {
|
|
76
|
+
if (show === state.showPopup) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
state.showPopup = show;
|
|
80
|
+
state.isShowPlaceholderElement = show;
|
|
81
|
+
if (show) {
|
|
82
|
+
state.showWrapper = true;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
const renderTitle = () => {
|
|
86
|
+
var _a;
|
|
87
|
+
if (props.title) {
|
|
88
|
+
return props.title;
|
|
89
|
+
}
|
|
90
|
+
const match = (_a = props.options) == null ? void 0 : _a.find((option) => option.value === props.modelValue);
|
|
91
|
+
return match ? match.text : "";
|
|
92
|
+
};
|
|
93
|
+
const onClick = (option) => {
|
|
94
|
+
state.showPopup = false;
|
|
95
|
+
state.isShowPlaceholderElement = false;
|
|
96
|
+
if (option.value !== props.modelValue) {
|
|
97
|
+
emit("update:modelValue", option.value);
|
|
98
|
+
emit("change", option.value);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
const handleClose = () => {
|
|
102
|
+
state.showWrapper = false;
|
|
103
|
+
state.isShowPlaceholderElement = false;
|
|
104
|
+
};
|
|
105
|
+
const handleClickOutside = () => {
|
|
106
|
+
state.showPopup = false;
|
|
107
|
+
};
|
|
108
|
+
return {
|
|
109
|
+
classes,
|
|
110
|
+
placeholderElementStyle,
|
|
111
|
+
renderTitle,
|
|
112
|
+
state,
|
|
113
|
+
parent,
|
|
114
|
+
toggle,
|
|
115
|
+
onClick,
|
|
116
|
+
handleClose,
|
|
117
|
+
handleClickOutside
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
const _hoisted_1 = { class: "nut-menu-item__content" };
|
|
122
|
+
const _hoisted_2 = ["onClick"];
|
|
123
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
124
|
+
const _component_nut_icon = resolveComponent("nut-icon");
|
|
125
|
+
const _component_nut_popup = resolveComponent("nut-popup");
|
|
126
|
+
return withDirectives((openBlock(), createElementBlock("view", {
|
|
127
|
+
class: normalizeClass(_ctx.classes)
|
|
128
|
+
}, [
|
|
129
|
+
withDirectives(createElementVNode("div", {
|
|
130
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClickOutside && _ctx.handleClickOutside(...args)),
|
|
131
|
+
class: normalizeClass(["placeholder-element", { up: _ctx.parent.props.direction === "up" }]),
|
|
132
|
+
style: normalizeStyle(_ctx.placeholderElementStyle)
|
|
133
|
+
}, null, 6), [
|
|
134
|
+
[vShow, _ctx.state.isShowPlaceholderElement]
|
|
135
|
+
]),
|
|
136
|
+
createVNode(_component_nut_popup, mergeProps({
|
|
137
|
+
style: _ctx.parent.props.direction === "down" ? { top: _ctx.parent.offset.value + "px" } : { bottom: _ctx.parent.offset.value + "px" },
|
|
138
|
+
overlayStyle: _ctx.parent.props.direction === "down" ? { top: _ctx.parent.offset.value + "px" } : { bottom: _ctx.parent.offset.value + "px" }
|
|
139
|
+
}, _ctx.$attrs, {
|
|
140
|
+
visible: _ctx.state.showPopup,
|
|
141
|
+
"onUpdate:visible": _cache[1] || (_cache[1] = ($event) => _ctx.state.showPopup = $event),
|
|
142
|
+
position: _ctx.parent.props.direction === "down" ? "top" : "bottom",
|
|
143
|
+
duration: _ctx.parent.props.duration,
|
|
144
|
+
"pop-class": "nut-menu__pop",
|
|
145
|
+
overlayClass: "nut-menu__overlay",
|
|
146
|
+
overlay: _ctx.parent.props.overlay,
|
|
147
|
+
onClosed: _ctx.handleClose,
|
|
148
|
+
lockScroll: _ctx.parent.props.lockScroll,
|
|
149
|
+
isWrapTeleport: false,
|
|
150
|
+
"close-on-click-overlay": _ctx.parent.props.closeOnClickOverlay
|
|
151
|
+
}), {
|
|
152
|
+
default: withCtx(() => [
|
|
153
|
+
createElementVNode("view", _hoisted_1, [
|
|
154
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (option, index2) => {
|
|
155
|
+
return openBlock(), createElementBlock("view", {
|
|
156
|
+
key: index2,
|
|
157
|
+
class: normalizeClass(["nut-menu-item__option", { active: option.value === _ctx.modelValue }]),
|
|
158
|
+
style: normalizeStyle({ "flex-basis": 100 / _ctx.cols + "%" }),
|
|
159
|
+
onClick: ($event) => _ctx.onClick(option)
|
|
160
|
+
}, [
|
|
161
|
+
option.value === _ctx.modelValue ? (openBlock(), createBlock(_component_nut_icon, {
|
|
162
|
+
key: 0,
|
|
163
|
+
name: _ctx.optionIcon,
|
|
164
|
+
color: _ctx.parent.props.activeColor
|
|
165
|
+
}, null, 8, ["name", "color"])) : createCommentVNode("", true),
|
|
166
|
+
createElementVNode("view", {
|
|
167
|
+
style: normalizeStyle({ color: option.value === _ctx.modelValue ? _ctx.parent.props.activeColor : "" })
|
|
168
|
+
}, toDisplayString(option.text), 5)
|
|
169
|
+
], 14, _hoisted_2);
|
|
170
|
+
}), 128)),
|
|
171
|
+
renderSlot(_ctx.$slots, "default")
|
|
172
|
+
])
|
|
173
|
+
]),
|
|
174
|
+
_: 3
|
|
175
|
+
}, 16, ["style", "overlayStyle", "visible", "position", "duration", "overlay", "onClosed", "lockScroll", "close-on-click-overlay"])
|
|
176
|
+
], 2)), [
|
|
177
|
+
[vShow, _ctx.state.showWrapper]
|
|
178
|
+
]);
|
|
179
|
+
}
|
|
180
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
181
|
+
export { index as default };
|
|
@@ -1,36 +1,198 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.1 Mon Jun 27 2022 21:39:05 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { toRefs
|
|
7
|
-
import { c as
|
|
8
|
-
import { _ as
|
|
6
|
+
import { toRefs, ref, computed, onMounted, nextTick, resolveComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, normalizeStyle, createBlock, createCommentVNode, toDisplayString, renderSlot } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const { componentName
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
const { componentName, create } = createComponent("navbar");
|
|
11
|
+
const _sfc_main = create({
|
|
12
|
+
props: {
|
|
13
|
+
leftShow: { type: Boolean, default: true },
|
|
14
|
+
title: { type: String, default: "" },
|
|
15
|
+
titIcon: { type: String, default: "" },
|
|
16
|
+
leftText: { type: String, default: "" },
|
|
17
|
+
desc: { type: String, default: "" },
|
|
18
|
+
fixed: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false
|
|
21
|
+
},
|
|
22
|
+
safeAreaInsetTop: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
border: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false
|
|
29
|
+
},
|
|
30
|
+
placeholder: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: true
|
|
33
|
+
},
|
|
34
|
+
zIndex: {
|
|
35
|
+
type: [Number, String],
|
|
36
|
+
default: 10
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
emits: ["on-click-back", "on-click-title", "on-click-icon", "on-click-right"],
|
|
40
|
+
setup(props, { emit }) {
|
|
41
|
+
const { border, fixed, safeAreaInsetTop, placeholder, zIndex } = toRefs(props);
|
|
42
|
+
const navBarWrap = ref(null);
|
|
43
|
+
const navBarHtml = ref(null);
|
|
44
|
+
let navHeight = ref(0);
|
|
45
|
+
const classes = computed(() => {
|
|
46
|
+
const prefixCls = componentName;
|
|
47
|
+
return {
|
|
48
|
+
[prefixCls]: true,
|
|
49
|
+
[`${prefixCls}--border`]: border.value,
|
|
50
|
+
[`${prefixCls}--fixed`]: fixed.value,
|
|
51
|
+
[`${prefixCls}--safe-area-inset-top`]: safeAreaInsetTop.value
|
|
52
|
+
};
|
|
21
53
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
54
|
+
const styles = computed(() => {
|
|
55
|
+
return {
|
|
56
|
+
zIndex: zIndex.value
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
onMounted(() => {
|
|
60
|
+
if (fixed.value && placeholder.value) {
|
|
61
|
+
nextTick(() => {
|
|
62
|
+
var _a;
|
|
63
|
+
navHeight = (_a = navBarHtml == null ? void 0 : navBarHtml.value) == null ? void 0 : _a.getBoundingClientRect().height;
|
|
64
|
+
navBarWrap.value.style.height = navHeight + "px";
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
function handleLeft() {
|
|
69
|
+
emit("on-click-back");
|
|
70
|
+
}
|
|
71
|
+
function handleCenter() {
|
|
72
|
+
emit("on-click-title");
|
|
73
|
+
}
|
|
74
|
+
function handleCenterIcon() {
|
|
75
|
+
emit("on-click-icon");
|
|
76
|
+
}
|
|
77
|
+
function handleRight() {
|
|
78
|
+
emit("on-click-right");
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
navBarWrap,
|
|
82
|
+
navBarHtml,
|
|
83
|
+
classes,
|
|
84
|
+
styles,
|
|
85
|
+
handleLeft,
|
|
86
|
+
handleCenter,
|
|
87
|
+
handleCenterIcon,
|
|
88
|
+
handleRight
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
const _hoisted_1 = {
|
|
93
|
+
key: 0,
|
|
94
|
+
class: "nut-navbar--placeholder",
|
|
95
|
+
ref: "navBarWrap"
|
|
96
|
+
};
|
|
97
|
+
const _hoisted_2 = {
|
|
98
|
+
key: 1,
|
|
99
|
+
class: "nut-navbar__text"
|
|
100
|
+
};
|
|
101
|
+
const _hoisted_3 = { class: "nut-navbar__title" };
|
|
102
|
+
const _hoisted_4 = {
|
|
103
|
+
key: 0,
|
|
104
|
+
class: "nut-navbar__text"
|
|
105
|
+
};
|
|
106
|
+
const _hoisted_5 = {
|
|
107
|
+
key: 1,
|
|
108
|
+
class: "nut-navbar__text"
|
|
109
|
+
};
|
|
110
|
+
const _hoisted_6 = { class: "nut-navbar__title" };
|
|
111
|
+
const _hoisted_7 = {
|
|
112
|
+
key: 0,
|
|
113
|
+
class: "nut-navbar__text"
|
|
114
|
+
};
|
|
115
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
116
|
+
const _component_nut_icon = resolveComponent("nut-icon");
|
|
117
|
+
return _ctx.fixed && _ctx.placeholder ? (openBlock(), createElementBlock("view", _hoisted_1, [
|
|
118
|
+
createElementVNode("view", {
|
|
119
|
+
class: normalizeClass(_ctx.classes),
|
|
120
|
+
style: normalizeStyle(_ctx.styles),
|
|
121
|
+
ref: "navBarHtml"
|
|
122
|
+
}, [
|
|
123
|
+
createElementVNode("view", {
|
|
124
|
+
class: "nut-navbar__left",
|
|
125
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleLeft && _ctx.handleLeft(...args))
|
|
126
|
+
}, [
|
|
127
|
+
_ctx.leftShow ? (openBlock(), createBlock(_component_nut_icon, {
|
|
128
|
+
key: 0,
|
|
129
|
+
color: "#979797",
|
|
130
|
+
name: "left"
|
|
131
|
+
})) : createCommentVNode("", true),
|
|
132
|
+
_ctx.leftText ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(_ctx.leftText), 1)) : createCommentVNode("", true),
|
|
133
|
+
renderSlot(_ctx.$slots, "left")
|
|
134
|
+
]),
|
|
135
|
+
createElementVNode("view", _hoisted_3, [
|
|
136
|
+
_ctx.title ? (openBlock(), createElementBlock("view", {
|
|
137
|
+
key: 0,
|
|
138
|
+
class: "title",
|
|
139
|
+
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.handleCenter && _ctx.handleCenter(...args))
|
|
140
|
+
}, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
|
|
141
|
+
_ctx.titIcon ? (openBlock(), createBlock(_component_nut_icon, {
|
|
142
|
+
key: 1,
|
|
143
|
+
class: "icon",
|
|
144
|
+
name: _ctx.titIcon,
|
|
145
|
+
onClick: _ctx.handleCenterIcon
|
|
146
|
+
}, null, 8, ["name", "onClick"])) : createCommentVNode("", true),
|
|
147
|
+
renderSlot(_ctx.$slots, "content")
|
|
148
|
+
]),
|
|
149
|
+
createElementVNode("view", {
|
|
150
|
+
class: "nut-navbar__right",
|
|
151
|
+
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.handleRight && _ctx.handleRight(...args))
|
|
152
|
+
}, [
|
|
153
|
+
_ctx.desc ? (openBlock(), createElementBlock("view", _hoisted_4, toDisplayString(_ctx.desc), 1)) : createCommentVNode("", true),
|
|
154
|
+
renderSlot(_ctx.$slots, "right")
|
|
155
|
+
])
|
|
156
|
+
], 6)
|
|
157
|
+
], 512)) : (openBlock(), createElementBlock("view", {
|
|
158
|
+
key: 1,
|
|
159
|
+
class: normalizeClass(_ctx.classes),
|
|
160
|
+
style: normalizeStyle(_ctx.styles)
|
|
161
|
+
}, [
|
|
162
|
+
createElementVNode("view", {
|
|
163
|
+
class: "nut-navbar__left",
|
|
164
|
+
onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleLeft && _ctx.handleLeft(...args))
|
|
165
|
+
}, [
|
|
166
|
+
_ctx.leftShow ? (openBlock(), createBlock(_component_nut_icon, {
|
|
167
|
+
key: 0,
|
|
168
|
+
color: "#979797",
|
|
169
|
+
name: "left"
|
|
170
|
+
})) : createCommentVNode("", true),
|
|
171
|
+
_ctx.leftText ? (openBlock(), createElementBlock("view", _hoisted_5, toDisplayString(_ctx.leftText), 1)) : createCommentVNode("", true),
|
|
172
|
+
renderSlot(_ctx.$slots, "left")
|
|
173
|
+
]),
|
|
174
|
+
createElementVNode("view", _hoisted_6, [
|
|
175
|
+
_ctx.title ? (openBlock(), createElementBlock("view", {
|
|
176
|
+
key: 0,
|
|
177
|
+
class: "title",
|
|
178
|
+
onClick: _cache[4] || (_cache[4] = (...args) => _ctx.handleCenter && _ctx.handleCenter(...args))
|
|
179
|
+
}, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
|
|
180
|
+
_ctx.titIcon ? (openBlock(), createBlock(_component_nut_icon, {
|
|
181
|
+
key: 1,
|
|
182
|
+
class: "icon",
|
|
183
|
+
name: _ctx.titIcon,
|
|
184
|
+
onClick: _ctx.handleCenterIcon
|
|
185
|
+
}, null, 8, ["name", "onClick"])) : createCommentVNode("", true),
|
|
186
|
+
renderSlot(_ctx.$slots, "content")
|
|
187
|
+
]),
|
|
188
|
+
createElementVNode("view", {
|
|
189
|
+
class: "nut-navbar__right",
|
|
190
|
+
onClick: _cache[5] || (_cache[5] = (...args) => _ctx.handleRight && _ctx.handleRight(...args))
|
|
191
|
+
}, [
|
|
192
|
+
_ctx.desc ? (openBlock(), createElementBlock("view", _hoisted_7, toDisplayString(_ctx.desc), 1)) : createCommentVNode("", true),
|
|
193
|
+
renderSlot(_ctx.$slots, "right")
|
|
194
|
+
])
|
|
195
|
+
], 6));
|
|
196
|
+
}
|
|
197
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
198
|
+
export { index as default };
|