@nutui/nutui 3.2.6-beta.1 → 3.2.6-beta.2
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/README.md +18 -4
- package/dist/nutui.es.js +4461 -4135
- package/dist/nutui.umd.js +4559 -4133
- package/dist/packages/_es/ActionSheet.js +19 -18
- package/dist/packages/_es/Address.js +85 -94
- package/dist/packages/_es/AddressList.js +12 -25
- package/dist/packages/_es/Animate.js +3 -3
- package/dist/packages/_es/Audio.js +2 -9
- package/dist/packages/_es/AudioOperate.js +1 -5
- package/dist/packages/_es/Avatar.js +10 -10
- package/dist/packages/_es/AvatarGroup.js +5 -5
- package/dist/packages/_es/BackTop.js +108 -55
- package/dist/packages/_es/Badge.js +12 -10
- package/dist/packages/_es/Barrage.js +103 -79
- package/dist/packages/_es/Button.js +3 -5
- package/dist/packages/_es/Calendar.js +23 -36
- package/dist/packages/_es/CalendarItem.js +3 -4
- package/dist/packages/_es/Card.js +5 -15
- package/dist/packages/_es/Cascader.js +11 -12
- package/dist/packages/_es/Category.js +12 -13
- package/dist/packages/_es/CategoryPane.js +13 -17
- package/dist/packages/_es/Cell.js +12 -9
- package/dist/packages/_es/CellGroup.js +2 -4
- package/dist/packages/_es/Checkbox.js +1 -1
- package/dist/packages/_es/CheckboxGroup.js +2 -2
- package/dist/packages/_es/CircleProgress.js +82 -98
- package/dist/packages/_es/Col.js +1 -1
- package/dist/packages/_es/Collapse.js +34 -65
- package/dist/packages/_es/CollapseItem.js +60 -93
- package/dist/packages/_es/Comment.js +19 -43
- package/dist/packages/_es/ConfigProvider.js +1 -1
- package/dist/packages/_es/CountDown.js +3 -3
- package/dist/packages/_es/CountUp.js +52 -47
- package/dist/packages/_es/DatePicker.js +54 -37
- package/dist/packages/_es/Dialog.js +88 -9
- package/dist/packages/_es/Divider.js +3 -3
- package/dist/packages/_es/Drag.js +49 -75
- package/dist/packages/_es/Ecard.js +18 -20
- package/dist/packages/_es/Elevator.js +76 -101
- package/dist/packages/_es/Ellipsis.js +100 -140
- package/dist/packages/_es/Empty.js +4 -6
- package/dist/packages/_es/FixedNav.js +6 -11
- package/dist/packages/_es/Form.js +4 -4
- package/dist/packages/_es/FormItem.js +1 -3
- package/dist/packages/_es/Grid.js +1 -1
- package/dist/packages/_es/GridItem.js +27 -10
- package/dist/packages/_es/Icon.js +1 -1
- package/dist/packages/_es/Image.js +114 -13
- package/dist/packages/_es/ImagePreview.js +411 -149
- package/dist/packages/_es/Indicator.js +3 -3
- package/dist/packages/_es/InfiniteLoading.js +115 -103
- package/dist/packages/_es/Input.js +32 -56
- package/dist/packages/_es/InputNumber.js +16 -25
- package/dist/packages/_es/Invoice.js +5 -6
- package/dist/packages/_es/Layout.js +1 -1
- package/dist/packages/_es/List.js +34 -47
- package/dist/packages/_es/Menu.js +35 -35
- package/dist/packages/_es/MenuItem.js +29 -56
- package/dist/packages/_es/Navbar.js +39 -49
- package/dist/packages/_es/NoticeBar.js +45 -54
- package/dist/packages/_es/Notify.js +162 -44
- package/dist/packages/_es/NumberKeyboard.js +20 -15
- package/dist/packages/_es/OldPicker.js +116 -130
- package/dist/packages/_es/OverLay.js +28 -5
- package/dist/packages/_es/Pagination.js +5 -8
- package/dist/packages/_es/Picker.js +74 -198
- package/dist/packages/_es/Popover.js +881 -201
- package/dist/packages/_es/Popup.js +84 -28
- package/dist/packages/_es/Price.js +6 -22
- package/dist/packages/_es/Progress.js +11 -18
- package/dist/packages/_es/PullRefresh.js +2 -4
- package/dist/packages/_es/Radio.js +3 -3
- package/dist/packages/_es/RadioGroup.js +1 -1
- package/dist/packages/_es/Range.js +34 -48
- package/dist/packages/_es/Rate.js +14 -15
- package/dist/packages/_es/Row.js +1 -1
- package/dist/packages/_es/SearchBar.js +36 -39
- package/dist/packages/_es/ShortPassword.js +66 -97
- package/dist/packages/_es/SideNavBar.js +18 -7
- package/dist/packages/_es/SideNavBarItem.js +1 -1
- package/dist/packages/_es/Signature.js +80 -113
- package/dist/packages/_es/Skeleton.js +11 -12
- package/dist/packages/_es/Sku.js +38 -63
- package/dist/packages/_es/Step.js +2 -7
- package/dist/packages/_es/Steps.js +1 -1
- package/dist/packages/_es/Sticky.js +23 -33
- package/dist/packages/_es/SubSideNavBar.js +2 -4
- package/dist/packages/_es/Swipe.js +26 -41
- package/dist/packages/_es/Swiper.js +21 -38
- package/dist/packages/_es/SwiperItem.js +2 -2
- package/dist/packages/_es/Switch.js +8 -8
- package/dist/packages/_es/TabPane.js +1 -1
- package/dist/packages/_es/Tabbar.js +13 -15
- package/dist/packages/_es/TabbarItem.js +30 -24
- package/dist/packages/_es/Table.js +17 -22
- package/dist/packages/_es/Tabs.js +16 -49
- package/dist/packages/_es/Tag.js +5 -6
- package/dist/packages/_es/TextArea.js +49 -114
- package/dist/packages/_es/TimeDetail.js +3 -4
- package/dist/packages/_es/TimePannel.js +3 -3
- package/dist/packages/_es/TimeSelect.js +10 -12
- package/dist/packages/_es/Toast.js +164 -53
- package/dist/packages/_es/TrendArrow.js +4 -6
- package/dist/packages/_es/Uploader.js +140 -141
- package/dist/packages/_es/Video.js +18 -39
- package/dist/packages/_es/WaterMark.js +14 -22
- package/dist/packages/_es/common.js +1 -1
- package/dist/packages/_es/component.js +1 -1
- package/dist/packages/_es/index.js +6 -44
- package/dist/packages/_es/index2.js +31 -8
- package/dist/packages/_es/index3.js +7 -64
- package/dist/packages/_es/index4.js +62 -424
- package/dist/packages/_es/{index.taro.js → index5.js} +154 -167
- package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +1 -1
- package/dist/packages/_es/style.css +3 -21
- package/dist/packages/checkbox/index.scss +1 -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/menuitem/index.scss +12 -3
- package/dist/smartips/attributes.json +5 -1
- package/dist/smartips/tags.json +1 -0
- package/dist/smartips/web-types.json +11 -2
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +48 -48
- package/dist/styles/themes/jdb.scss +48 -48
- package/dist/styles/themes/jddkh.scss +48 -48
- package/dist/styles/themes/jdt.scss +48 -48
- package/dist/types/__VUE/actionsheet/{index.taro.vue.d.ts → index.vue.d.ts} +9 -9
- package/dist/types/__VUE/address/{index.taro.vue.d.ts → index.vue.d.ts} +33 -73
- package/dist/types/__VUE/addresslist/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/animate/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/avatar/{index.taro.vue.d.ts → index.vue.d.ts} +6 -6
- package/dist/types/__VUE/avatargroup/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/backtop/{index.taro.vue.d.ts → index.vue.d.ts} +37 -15
- package/dist/types/__VUE/badge/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/barrage/{index.taro.vue.d.ts → index.vue.d.ts} +2 -2
- package/dist/types/__VUE/button/index.vue.d.ts +1 -1
- package/dist/types/__VUE/calendar/{index.taro.vue.d.ts → index.vue.d.ts} +1 -13
- package/dist/types/__VUE/calendaritem/{index.taro.vue.d.ts → index.vue.d.ts} +17 -17
- package/dist/types/__VUE/card/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/cascader/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
- package/dist/types/__VUE/category/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/categorypane/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/cell/{index.taro.vue.d.ts → index.vue.d.ts} +5 -12
- package/dist/types/__VUE/checkbox/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/circleprogress/{index.taro.vue.d.ts → index.vue.d.ts} +15 -14
- package/dist/types/__VUE/collapse/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
- package/dist/types/__VUE/collapseitem/{index.taro.vue.d.ts → index.vue.d.ts} +10 -2
- package/dist/types/__VUE/comment/{index.taro.vue.d.ts → index.vue.d.ts} +2 -1
- package/dist/types/__VUE/configprovider/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/countdown/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/countup/{index.taro.vue.d.ts → index.vue.d.ts} +7 -5
- package/dist/types/__VUE/datepicker/{index.taro.vue.d.ts → index.vue.d.ts} +5 -5
- package/dist/types/__VUE/dialog/index.d.ts +48 -0
- package/dist/types/__VUE/dialog/{index.taro.vue.d.ts → index.vue.d.ts} +12 -9
- package/dist/types/__VUE/divider/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
- package/dist/types/__VUE/drag/{index.taro.vue.d.ts → index.vue.d.ts} +1 -2
- package/dist/types/__VUE/ecard/{index.taro.vue.d.ts → index.vue.d.ts} +3 -3
- package/dist/types/__VUE/elevator/{index.taro.vue.d.ts → index.vue.d.ts} +2 -11
- package/dist/types/__VUE/ellipsis/{index.taro.vue.d.ts → index.vue.d.ts} +0 -4
- package/dist/types/__VUE/empty/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/fixednav/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
- package/dist/types/__VUE/form/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/grid/{index.taro.vue.d.ts → index.vue.d.ts} +2 -2
- package/dist/types/__VUE/griditem/{index.taro.vue.d.ts → index.vue.d.ts} +27 -2
- package/dist/types/__VUE/image/index.vue.d.ts +117 -0
- package/dist/types/__VUE/image/type.d.ts +6 -0
- package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +109 -0
- package/dist/types/__VUE/imagepreview/index.d.ts +25 -0
- package/dist/types/__VUE/imagepreview/{index.taro.vue.d.ts → index.vue.d.ts} +44 -33
- package/dist/types/__VUE/indicator/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/infiniteloading/{index.taro.vue.d.ts → index.vue.d.ts} +12 -19
- package/dist/types/__VUE/input/{index.taro.vue.d.ts → index.vue.d.ts} +16 -34
- package/dist/types/__VUE/inputnumber/{index.taro.vue.d.ts → index.vue.d.ts} +2 -2
- package/dist/types/__VUE/invoice/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/layout/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/list/{index.taro.vue.d.ts → index.vue.d.ts} +2 -2
- package/dist/types/__VUE/menu/{index.taro.vue.d.ts → index.vue.d.ts} +0 -1
- package/dist/types/__VUE/menuitem/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/navbar/{index.taro.vue.d.ts → index.vue.d.ts} +3 -2
- package/dist/types/__VUE/noticebar/{index.taro.vue.d.ts → index.vue.d.ts} +4 -4
- package/dist/types/__VUE/notify/index.d.ts +26 -0
- package/dist/types/__VUE/notify/{index.taro.vue.d.ts → index.vue.d.ts} +18 -5
- package/dist/types/__VUE/numberkeyboard/{index.taro.vue.d.ts → index.vue.d.ts} +29 -5
- package/dist/types/__VUE/oldpicker/{ColumnTaro.vue.d.ts → Column.vue.d.ts} +17 -28
- package/dist/types/__VUE/oldpicker/{index.taro.vue.d.ts → index.vue.d.ts} +44 -64
- package/dist/types/__VUE/pagination/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/picker/{ColumnTaro.vue.d.ts → Column.vue.d.ts} +4 -16
- package/dist/types/__VUE/picker/{index.taro.vue.d.ts → index.vue.d.ts} +28 -53
- package/dist/types/__VUE/popover/{index.taro.vue.d.ts → index.vue.d.ts} +13 -15
- package/dist/types/__VUE/popup/index.vue.d.ts +1 -1
- package/dist/types/__VUE/price/{index.taro.vue.d.ts → index.vue.d.ts} +0 -1
- package/dist/types/__VUE/progress/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
- package/dist/types/__VUE/radio/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/range/{index.taro.vue.d.ts → index.vue.d.ts} +7 -8
- package/dist/types/__VUE/rate/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/searchbar/{index.taro.vue.d.ts → index.vue.d.ts} +19 -19
- package/dist/types/__VUE/shortpassword/{index.taro.vue.d.ts → index.vue.d.ts} +21 -6
- package/dist/types/__VUE/sidenavbar/{index.taro.vue.d.ts → index.vue.d.ts} +5 -0
- package/dist/types/__VUE/signature/{index.taro.vue.d.ts → index.vue.d.ts} +5 -8
- package/dist/types/__VUE/skeleton/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/sku/index.vue.d.ts +310 -0
- package/dist/types/__VUE/step/index.vue.d.ts +1 -1
- package/dist/types/__VUE/steps/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/sticky/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/swipe/{index.taro.vue.d.ts → index.vue.d.ts} +1 -2
- package/dist/types/__VUE/swiper/{index.taro.vue.d.ts → index.vue.d.ts} +1 -2
- package/dist/types/__VUE/swiperitem/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/switch/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/tabbar/{index.taro.vue.d.ts → index.vue.d.ts} +2 -1
- package/dist/types/__VUE/tabbaritem/{index.taro.vue.d.ts → index.vue.d.ts} +9 -9
- package/dist/types/__VUE/table/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/tabs/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/tag/{index.taro.vue.d.ts → index.vue.d.ts} +4 -4
- package/dist/types/__VUE/tag/type.d.ts +5 -0
- package/dist/types/__VUE/textarea/{index.taro.vue.d.ts → index.vue.d.ts} +3 -5
- package/dist/types/__VUE/timedetail/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/timepannel/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/timeselect/{index.taro.vue.d.ts → index.vue.d.ts} +8 -7
- package/dist/types/__VUE/toast/index.d.ts +16 -0
- package/dist/types/__VUE/toast/{index.taro.vue.d.ts → index.vue.d.ts} +22 -44
- package/dist/types/__VUE/trendarrow/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/uploader/{index.taro.vue.d.ts → index.vue.d.ts} +13 -22
- package/dist/types/__VUE/watermark/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/nutui.d.ts +89 -89
- package/package.json +3 -2
- package/dist/packages/_es/use-lock-scroll.js +0 -23
- package/dist/types/__VUE/button/index.taro.vue.d.ts +0 -116
- package/dist/types/__VUE/icon/index.taro.vue.d.ts +0 -74
- package/dist/types/__VUE/image/index.taro.vue.d.ts +0 -33
- package/dist/types/__VUE/overlay/index.taro.vue.d.ts +0 -85
- package/dist/types/__VUE/popup/index.taro.vue.d.ts +0 -1728
- package/dist/types/__VUE/sku/index.taro.vue.d.ts +0 -182
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.6-beta.
|
|
2
|
+
* @nutui/nutui v3.2.6-beta.2 Fri Nov 04 2022 17:24:29 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { c as createComponent } from "./component.js";
|
|
7
|
-
import {
|
|
7
|
+
import { u as useRouter } from "./index.js";
|
|
8
|
+
import { inject, reactive, getCurrentInstance, computed, watch, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, Fragment, toDisplayString, createCommentVNode, createVNode, renderSlot } from "vue";
|
|
8
9
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
10
|
import "../locale/lang";
|
|
10
11
|
const { create } = createComponent("tabbar-item");
|
|
@@ -37,14 +38,14 @@ const _sfc_main = create({
|
|
|
37
38
|
type: String,
|
|
38
39
|
default: ""
|
|
39
40
|
},
|
|
40
|
-
dot: {
|
|
41
|
-
type: Boolean,
|
|
42
|
-
default: false
|
|
43
|
-
},
|
|
44
41
|
classPrefix: {
|
|
45
42
|
type: String,
|
|
46
43
|
default: "nut-icon"
|
|
47
44
|
},
|
|
45
|
+
dot: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: false
|
|
48
|
+
},
|
|
48
49
|
fontClassName: {
|
|
49
50
|
type: String,
|
|
50
51
|
default: "nutui-iconfont"
|
|
@@ -60,12 +61,13 @@ const _sfc_main = create({
|
|
|
60
61
|
active: parent.modelValue,
|
|
61
62
|
index: 0
|
|
62
63
|
});
|
|
64
|
+
const router = useRouter();
|
|
63
65
|
const relation = (child) => {
|
|
64
66
|
var _a;
|
|
65
67
|
if (child.proxy) {
|
|
66
68
|
parent.children.push(child.proxy);
|
|
67
|
-
const
|
|
68
|
-
state.index = (_a = props.name) != null ? _a :
|
|
69
|
+
const index2 = computed(() => parent.children.indexOf(child.proxy));
|
|
70
|
+
state.index = (_a = props.name) != null ? _a : index2.value;
|
|
69
71
|
}
|
|
70
72
|
};
|
|
71
73
|
relation(getCurrentInstance());
|
|
@@ -73,13 +75,13 @@ const _sfc_main = create({
|
|
|
73
75
|
function change() {
|
|
74
76
|
var _a;
|
|
75
77
|
let key = (_a = props.name) != null ? _a : state.index;
|
|
76
|
-
let
|
|
78
|
+
let index2 = null;
|
|
77
79
|
if (props.name) {
|
|
78
|
-
|
|
80
|
+
index2 = parent.children.findIndex((item) => {
|
|
79
81
|
return item.name == key;
|
|
80
82
|
});
|
|
81
83
|
}
|
|
82
|
-
parent.changeIndex(
|
|
84
|
+
parent.changeIndex(index2 != null ? index2 : key, state.index);
|
|
83
85
|
}
|
|
84
86
|
const choosed = computed(() => {
|
|
85
87
|
if (parent) {
|
|
@@ -88,16 +90,25 @@ const _sfc_main = create({
|
|
|
88
90
|
return null;
|
|
89
91
|
});
|
|
90
92
|
watch(choosed, (value, oldValue) => {
|
|
91
|
-
var _a;
|
|
93
|
+
var _a, _b;
|
|
92
94
|
state.active = value;
|
|
93
|
-
let
|
|
95
|
+
let index2 = value;
|
|
94
96
|
if (props.name) {
|
|
95
|
-
|
|
97
|
+
index2 = parent.children.findIndex((item) => {
|
|
96
98
|
return item.name == value;
|
|
97
99
|
});
|
|
98
100
|
}
|
|
99
|
-
if ((_a = parent.children[
|
|
100
|
-
window.location.href = parent.children[
|
|
101
|
+
if ((_a = parent.children[index2]) == null ? void 0 : _a.href) {
|
|
102
|
+
window.location.href = parent.children[index2].href;
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if ((_b = parent.children[index2]) == null ? void 0 : _b.to) {
|
|
106
|
+
let to = parent.children[index2].to;
|
|
107
|
+
if (to && router) {
|
|
108
|
+
router.push(to);
|
|
109
|
+
} else {
|
|
110
|
+
location.replace(to);
|
|
111
|
+
}
|
|
101
112
|
}
|
|
102
113
|
});
|
|
103
114
|
return {
|
|
@@ -129,15 +140,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
129
140
|
style: normalizeStyle({
|
|
130
141
|
color: _ctx.active ? _ctx.state.activeColor : _ctx.state.unactiveColor
|
|
131
142
|
}),
|
|
132
|
-
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.change(
|
|
143
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.change())
|
|
133
144
|
}, [
|
|
134
145
|
createElementVNode("view", _hoisted_1, [
|
|
135
146
|
!_ctx.dot ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
136
147
|
_ctx.num && _ctx.num <= 99 ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(_ctx.num), 1)) : _ctx.num && _ctx.num > 100 ? (openBlock(), createElementBlock("view", _hoisted_3, toDisplayString("99+"))) : createCommentVNode("", true)
|
|
137
148
|
], 64)) : createCommentVNode("", true),
|
|
138
|
-
createTextVNode(),
|
|
139
149
|
_ctx.dot ? (openBlock(), createElementBlock("div", _hoisted_4)) : createCommentVNode("", true),
|
|
140
|
-
createTextVNode(),
|
|
141
150
|
_ctx.icon ? (openBlock(), createElementBlock("view", _hoisted_5, [
|
|
142
151
|
createVNode(_component_nut_icon, {
|
|
143
152
|
class: "nut-tabbar-item_icon-box_icon",
|
|
@@ -147,7 +156,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
147
156
|
"class-prefix": _ctx.classPrefix
|
|
148
157
|
}, null, 8, ["size", "name", "font-class-name", "class-prefix"])
|
|
149
158
|
])) : createCommentVNode("", true),
|
|
150
|
-
createTextVNode(),
|
|
151
159
|
!_ctx.icon && _ctx.activeImg ? (openBlock(), createElementBlock("div", {
|
|
152
160
|
key: 3,
|
|
153
161
|
class: "nut-tabbar-item_icon-box_icon",
|
|
@@ -157,16 +165,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
157
165
|
height: _ctx.state.size
|
|
158
166
|
})
|
|
159
167
|
}, null, 4)) : createCommentVNode("", true),
|
|
160
|
-
createTextVNode(),
|
|
161
168
|
createElementVNode("view", {
|
|
162
169
|
class: normalizeClass(["nut-tabbar-item_icon-box_nav-word", { "nut-tabbar-item_icon-box_big-word": !_ctx.icon && !_ctx.activeImg }])
|
|
163
170
|
}, [
|
|
164
171
|
_ctx.tabTitle ? (openBlock(), createElementBlock("view", _hoisted_6, toDisplayString(_ctx.tabTitle), 1)) : createCommentVNode("", true),
|
|
165
|
-
createTextVNode(),
|
|
166
172
|
!_ctx.tabTitle ? renderSlot(_ctx.$slots, "default", { key: 1 }) : createCommentVNode("", true)
|
|
167
173
|
], 2)
|
|
168
174
|
])
|
|
169
175
|
], 6);
|
|
170
176
|
}
|
|
171
|
-
var
|
|
172
|
-
export {
|
|
177
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
178
|
+
export { index as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.6-beta.
|
|
2
|
+
* @nutui/nutui v3.2.6-beta.2 Fri Nov 04 2022 17:24:29 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -118,17 +118,17 @@ const _hoisted_4 = { class: "nut-table__main__body" };
|
|
|
118
118
|
const _hoisted_5 = { key: 1 };
|
|
119
119
|
const _hoisted_6 = {
|
|
120
120
|
key: 0,
|
|
121
|
-
class: "nut-table__summary"
|
|
122
|
-
};
|
|
123
|
-
const _hoisted_7 = ["innerHTML"];
|
|
124
|
-
const _hoisted_8 = {
|
|
125
|
-
key: 1,
|
|
126
121
|
class: "nut-table__nodata"
|
|
127
122
|
};
|
|
128
|
-
const
|
|
123
|
+
const _hoisted_7 = {
|
|
129
124
|
key: 0,
|
|
130
125
|
class: "nut-table__nodata__text"
|
|
131
126
|
};
|
|
127
|
+
const _hoisted_8 = {
|
|
128
|
+
key: 1,
|
|
129
|
+
class: "nut-table__summary"
|
|
130
|
+
};
|
|
131
|
+
const _hoisted_9 = ["innerHTML"];
|
|
132
132
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
133
133
|
const _component_nut_icon = resolveComponent("nut-icon");
|
|
134
134
|
const _component_RenderColumn = resolveComponent("RenderColumn");
|
|
@@ -149,7 +149,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
149
149
|
}, [
|
|
150
150
|
createTextVNode(toDisplayString(item.title) + " ", 1),
|
|
151
151
|
renderSlot(_ctx.$slots, "icon"),
|
|
152
|
-
createTextVNode(),
|
|
153
152
|
!_ctx.$slots.icon && item.sorter ? (openBlock(), createBlock(_component_nut_icon, {
|
|
154
153
|
key: 0,
|
|
155
154
|
name: "down-arrow",
|
|
@@ -159,7 +158,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
159
158
|
}), 128))
|
|
160
159
|
])
|
|
161
160
|
]),
|
|
162
|
-
createTextVNode(),
|
|
163
161
|
createElementVNode("view", _hoisted_4, [
|
|
164
162
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.curData, (item) => {
|
|
165
163
|
return openBlock(), createElementBlock("view", {
|
|
@@ -183,24 +181,21 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
183
181
|
}), 128))
|
|
184
182
|
])
|
|
185
183
|
], 2),
|
|
186
|
-
|
|
187
|
-
_ctx.summary ? (openBlock(), createElementBlock("view", _hoisted_6, [
|
|
188
|
-
createElementVNode("span", {
|
|
189
|
-
class: "nut-table__summary__text",
|
|
190
|
-
innerHTML: _ctx.summary().value
|
|
191
|
-
}, null, 8, _hoisted_7)
|
|
192
|
-
])) : createCommentVNode("", true),
|
|
193
|
-
createTextVNode(),
|
|
194
|
-
!_ctx.curData.length ? (openBlock(), createElementBlock("view", _hoisted_8, [
|
|
184
|
+
!_ctx.curData.length ? (openBlock(), createElementBlock("view", _hoisted_6, [
|
|
195
185
|
createElementVNode("div", {
|
|
196
186
|
class: normalizeClass(["nut-table__nodata", { "nut-table__nodata--border": _ctx.bordered }])
|
|
197
187
|
}, [
|
|
198
188
|
renderSlot(_ctx.$slots, "nodata"),
|
|
199
|
-
|
|
200
|
-
!_ctx.$slots.nodata ? (openBlock(), createElementBlock("div", _hoisted_9, toDisplayString(_ctx.translate("noData")), 1)) : createCommentVNode("", true)
|
|
189
|
+
!_ctx.$slots.nodata ? (openBlock(), createElementBlock("div", _hoisted_7, toDisplayString(_ctx.translate("noData")), 1)) : createCommentVNode("", true)
|
|
201
190
|
], 2)
|
|
191
|
+
])) : createCommentVNode("", true),
|
|
192
|
+
_ctx.summary ? (openBlock(), createElementBlock("view", _hoisted_8, [
|
|
193
|
+
createElementVNode("span", {
|
|
194
|
+
class: "nut-table__summary__text",
|
|
195
|
+
innerHTML: _ctx.summary().value
|
|
196
|
+
}, null, 8, _hoisted_9)
|
|
202
197
|
])) : createCommentVNode("", true)
|
|
203
198
|
], 2);
|
|
204
199
|
}
|
|
205
|
-
var
|
|
206
|
-
export {
|
|
200
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
201
|
+
export { index as default };
|
|
@@ -1,42 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.6-beta.
|
|
2
|
+
* @nutui/nutui v3.2.6-beta.2 Fri Nov 04 2022 17:24:29 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { T as TypeOfFun, c as createComponent } from "./component.js";
|
|
7
7
|
import { p as pxCheck } from "./pxCheck.js";
|
|
8
|
-
import {
|
|
8
|
+
import { u as useRect } from "./index2.js";
|
|
9
|
+
import { ref, provide, computed, watch, onMounted, onActivated, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, withCtx, createElementVNode, normalizeStyle, renderSlot, Fragment, renderList, createCommentVNode, createVNode, toDisplayString } from "vue";
|
|
9
10
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
11
|
import "../locale/lang";
|
|
11
|
-
function isWindow(val) {
|
|
12
|
-
return val === window;
|
|
13
|
-
}
|
|
14
|
-
const useRect = (elementRef) => {
|
|
15
|
-
const element = unref(elementRef);
|
|
16
|
-
if (isWindow(element)) {
|
|
17
|
-
const width = element.innerWidth;
|
|
18
|
-
const height = element.innerHeight;
|
|
19
|
-
return {
|
|
20
|
-
top: 0,
|
|
21
|
-
left: 0,
|
|
22
|
-
right: width,
|
|
23
|
-
bottom: height,
|
|
24
|
-
width,
|
|
25
|
-
height
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
if (element && element.getBoundingClientRect) {
|
|
29
|
-
return element.getBoundingClientRect();
|
|
30
|
-
}
|
|
31
|
-
return {
|
|
32
|
-
top: 0,
|
|
33
|
-
left: 0,
|
|
34
|
-
right: 0,
|
|
35
|
-
bottom: 0,
|
|
36
|
-
width: 0,
|
|
37
|
-
height: 0
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
12
|
class Title {
|
|
41
13
|
constructor() {
|
|
42
14
|
this.title = "";
|
|
@@ -108,7 +80,7 @@ const component = {
|
|
|
108
80
|
provide("autoHeight", { autoHeight: computed(() => props.autoHeight) });
|
|
109
81
|
const titles = ref([]);
|
|
110
82
|
const renderTitles = (vnodes) => {
|
|
111
|
-
vnodes.forEach((vnode,
|
|
83
|
+
vnodes.forEach((vnode, index2) => {
|
|
112
84
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
113
85
|
let type = vnode.type;
|
|
114
86
|
type = type.name || type;
|
|
@@ -120,7 +92,7 @@ const component = {
|
|
|
120
92
|
let camelPaneKeyType = TypeOfFun((_f = vnode.props) == null ? void 0 : _f["paneKey"]);
|
|
121
93
|
let camelPaneIndex = camelPaneKeyType == "number" || camelPaneKeyType == "string" ? String((_g = vnode.props) == null ? void 0 : _g["paneKey"]) : null;
|
|
122
94
|
title.title = (_h = vnode.props) == null ? void 0 : _h.title;
|
|
123
|
-
title.paneKey = paneIndex || camelPaneIndex || String(
|
|
95
|
+
title.paneKey = paneIndex || camelPaneIndex || String(index2);
|
|
124
96
|
title.disabled = (_i = vnode.props) == null ? void 0 : _i.disabled;
|
|
125
97
|
}
|
|
126
98
|
titles.value.push(title);
|
|
@@ -134,13 +106,13 @@ const component = {
|
|
|
134
106
|
};
|
|
135
107
|
const currentIndex = ref(props.modelValue || 0);
|
|
136
108
|
const findTabsIndex = (value) => {
|
|
137
|
-
let
|
|
109
|
+
let index2 = titles.value.findIndex((item) => item.paneKey == value);
|
|
138
110
|
if (titles.value.length == 0) {
|
|
139
111
|
console.error("[NutUI] <Tabs> \u5F53\u524D\u672A\u627E\u5230 TabPane \u7EC4\u4EF6\u5143\u7D20 , \u8BF7\u68C0\u67E5 .");
|
|
140
|
-
} else if (
|
|
112
|
+
} else if (index2 == -1) {
|
|
141
113
|
console.error("[NutUI] <Tabs> \u8BF7\u68C0\u67E5 v-model \u503C\u662F\u5426\u4E3A paneKey ,\u5982 paneKey \u672A\u8BBE\u7F6E\uFF0C\u8BF7\u91C7\u7528\u4E0B\u6807\u63A7\u5236 .");
|
|
142
114
|
} else {
|
|
143
|
-
currentIndex.value =
|
|
115
|
+
currentIndex.value = index2;
|
|
144
116
|
}
|
|
145
117
|
};
|
|
146
118
|
const init = (vnodes = ((_a) => (_a = slots.default) == null ? void 0 : _a.call(slots))()) => {
|
|
@@ -206,12 +178,12 @@ const component = {
|
|
|
206
178
|
};
|
|
207
179
|
});
|
|
208
180
|
const methods = {
|
|
209
|
-
tabChange: (item,
|
|
181
|
+
tabChange: (item, index2) => {
|
|
210
182
|
emit("click", item);
|
|
211
183
|
if (item.disabled) {
|
|
212
184
|
return;
|
|
213
185
|
}
|
|
214
|
-
currentIndex.value =
|
|
186
|
+
currentIndex.value = index2;
|
|
215
187
|
emit("update:modelValue", item.paneKey);
|
|
216
188
|
emit("change", item);
|
|
217
189
|
}
|
|
@@ -249,11 +221,11 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
249
221
|
class: normalizeClass(["nut-tabs__titles", { [_ctx.type]: _ctx.type, scrollable: _ctx.titleScroll, [_ctx.size]: _ctx.size }]),
|
|
250
222
|
style: normalizeStyle(_ctx.tabsNavStyle)
|
|
251
223
|
}, [
|
|
252
|
-
_ctx.$slots.titles ? renderSlot(_ctx.$slots, "titles", { key: 0 }) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.titles, (item,
|
|
224
|
+
_ctx.$slots.titles ? renderSlot(_ctx.$slots, "titles", { key: 0 }) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.titles, (item, index2) => {
|
|
253
225
|
return openBlock(), createElementBlock("view", {
|
|
254
226
|
class: normalizeClass(["nut-tabs__titles-item", { active: item.paneKey == _ctx.modelValue, disabled: item.disabled }]),
|
|
255
227
|
style: normalizeStyle(_ctx.titleStyle),
|
|
256
|
-
onClick: ($event) => _ctx.tabChange(item,
|
|
228
|
+
onClick: ($event) => _ctx.tabChange(item, index2),
|
|
257
229
|
key: item.paneKey
|
|
258
230
|
}, [
|
|
259
231
|
_ctx.type == "line" ? (openBlock(), createElementBlock("view", {
|
|
@@ -261,7 +233,6 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
261
233
|
class: "nut-tabs__titles-item__line",
|
|
262
234
|
style: normalizeStyle(_ctx.tabsActiveStyle)
|
|
263
235
|
}, null, 4)) : createCommentVNode("", true),
|
|
264
|
-
createTextVNode(),
|
|
265
236
|
_ctx.type == "smile" ? (openBlock(), createElementBlock("view", {
|
|
266
237
|
key: 1,
|
|
267
238
|
class: "nut-tabs__titles-item__smile",
|
|
@@ -272,7 +243,6 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
272
243
|
name: "joy-smile"
|
|
273
244
|
}, null, 8, ["color"])
|
|
274
245
|
], 4)) : createCommentVNode("", true),
|
|
275
|
-
createTextVNode(),
|
|
276
246
|
createElementVNode("view", {
|
|
277
247
|
class: normalizeClass(["nut-tabs__titles-item__text", { ellipsis: _ctx.ellipsis }])
|
|
278
248
|
}, toDisplayString(item.title), 3)
|
|
@@ -286,11 +256,11 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
286
256
|
class: normalizeClass(["nut-tabs__titles", { [_ctx.type]: _ctx.type, scrollable: _ctx.titleScroll, [_ctx.size]: _ctx.size }]),
|
|
287
257
|
style: normalizeStyle(_ctx.tabsNavStyle)
|
|
288
258
|
}, [
|
|
289
|
-
_ctx.$slots.titles ? renderSlot(_ctx.$slots, "titles", { key: 0 }) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.titles, (item,
|
|
259
|
+
_ctx.$slots.titles ? renderSlot(_ctx.$slots, "titles", { key: 0 }) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.titles, (item, index2) => {
|
|
290
260
|
return openBlock(), createElementBlock("view", {
|
|
291
261
|
class: normalizeClass(["nut-tabs__titles-item", { active: item.paneKey == _ctx.modelValue, disabled: item.disabled }]),
|
|
292
262
|
style: normalizeStyle(_ctx.titleStyle),
|
|
293
|
-
onClick: ($event) => _ctx.tabChange(item,
|
|
263
|
+
onClick: ($event) => _ctx.tabChange(item, index2),
|
|
294
264
|
key: item.paneKey
|
|
295
265
|
}, [
|
|
296
266
|
_ctx.type == "line" ? (openBlock(), createElementBlock("view", {
|
|
@@ -298,7 +268,6 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
298
268
|
class: "nut-tabs__titles-item__line",
|
|
299
269
|
style: normalizeStyle(_ctx.tabsActiveStyle)
|
|
300
270
|
}, null, 4)) : createCommentVNode("", true),
|
|
301
|
-
createTextVNode(),
|
|
302
271
|
_ctx.type == "smile" ? (openBlock(), createElementBlock("view", {
|
|
303
272
|
key: 1,
|
|
304
273
|
class: "nut-tabs__titles-item__smile",
|
|
@@ -309,14 +278,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
309
278
|
name: "joy-smile"
|
|
310
279
|
}, null, 8, ["color"])
|
|
311
280
|
], 4)) : createCommentVNode("", true),
|
|
312
|
-
createTextVNode(),
|
|
313
281
|
createElementVNode("view", {
|
|
314
282
|
class: normalizeClass(["nut-tabs__titles-item__text", { ellipsis: _ctx.ellipsis }])
|
|
315
283
|
}, toDisplayString(item.title), 3)
|
|
316
284
|
], 14, _hoisted_2);
|
|
317
285
|
}), 128))
|
|
318
286
|
], 6)),
|
|
319
|
-
createTextVNode(),
|
|
320
287
|
createElementVNode("view", {
|
|
321
288
|
class: "nut-tabs__content",
|
|
322
289
|
style: normalizeStyle(_ctx.contentStyle)
|
|
@@ -327,5 +294,5 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
327
294
|
}
|
|
328
295
|
const { create } = createComponent("tabs");
|
|
329
296
|
const _sfc_main = create(component);
|
|
330
|
-
var
|
|
331
|
-
export {
|
|
297
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", render]]);
|
|
298
|
+
export { index as default };
|
package/dist/packages/_es/Tag.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.6-beta.
|
|
2
|
+
* @nutui/nutui v3.2.6-beta.2 Fri Nov 04 2022 17:24:29 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { toRefs, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot,
|
|
6
|
+
import { toRefs, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot, createBlock, createCommentVNode } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
8
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
@@ -84,15 +84,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
84
84
|
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
|
|
85
85
|
}, [
|
|
86
86
|
renderSlot(_ctx.$slots, "default"),
|
|
87
|
-
createTextVNode(),
|
|
88
87
|
_ctx.closeable ? (openBlock(), createBlock(_component_nut_icon, {
|
|
89
88
|
key: 0,
|
|
90
89
|
class: "nut-tag--close",
|
|
91
90
|
name: "close",
|
|
92
|
-
size: "
|
|
91
|
+
size: "12",
|
|
93
92
|
onClick: _ctx.onClose
|
|
94
93
|
}, null, 8, ["onClick"])) : createCommentVNode("", true)
|
|
95
94
|
], 6);
|
|
96
95
|
}
|
|
97
|
-
var
|
|
98
|
-
export {
|
|
96
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
97
|
+
export { index as default };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.6-beta.
|
|
2
|
+
* @nutui/nutui v3.2.6-beta.2 Fri Nov 04 2022 17:24:29 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { ref, computed, onMounted, nextTick, watch, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, toDisplayString, createCommentVNode } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import Taro from "@tarojs/taro";
|
|
9
8
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
9
|
import "../locale/lang";
|
|
11
10
|
const { componentName, create, translate } = createComponent("textarea");
|
|
@@ -29,7 +28,7 @@ const _sfc_main = create({
|
|
|
29
28
|
},
|
|
30
29
|
rows: {
|
|
31
30
|
type: [String, Number],
|
|
32
|
-
default: ""
|
|
31
|
+
default: "2"
|
|
33
32
|
},
|
|
34
33
|
placeholder: {
|
|
35
34
|
type: String,
|
|
@@ -54,6 +53,7 @@ const _sfc_main = create({
|
|
|
54
53
|
},
|
|
55
54
|
emits: ["update:modelValue", "change", "blur", "focus"],
|
|
56
55
|
setup(props, { emit }) {
|
|
56
|
+
const textareaRef = ref();
|
|
57
57
|
const classes = computed(() => {
|
|
58
58
|
const prefixCls = componentName;
|
|
59
59
|
return {
|
|
@@ -61,16 +61,44 @@ const _sfc_main = create({
|
|
|
61
61
|
[`${prefixCls}--disabled`]: props.disabled
|
|
62
62
|
};
|
|
63
63
|
});
|
|
64
|
+
onMounted(() => {
|
|
65
|
+
if (props.modelValue) {
|
|
66
|
+
emitChange(String(props.modelValue));
|
|
67
|
+
}
|
|
68
|
+
if (props.autosize) {
|
|
69
|
+
nextTick(getContentHeight);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
64
72
|
const styles = computed(() => {
|
|
65
73
|
return {
|
|
66
|
-
textAlign: props.textAlign
|
|
67
|
-
height: props.autosize ? heightSet.value : "null"
|
|
74
|
+
textAlign: props.textAlign
|
|
68
75
|
};
|
|
69
76
|
});
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
77
|
+
const getContentHeight = () => {
|
|
78
|
+
let textarea = textareaRef.value;
|
|
79
|
+
textarea.style.height = "auto";
|
|
80
|
+
let height = textarea.scrollHeight;
|
|
81
|
+
if (typeof props.autosize === "object") {
|
|
82
|
+
const { maxHeight, minHeight } = props.autosize;
|
|
83
|
+
if (maxHeight !== void 0) {
|
|
84
|
+
height = Math.min(height, maxHeight);
|
|
85
|
+
}
|
|
86
|
+
if (minHeight !== void 0) {
|
|
87
|
+
height = Math.max(height, minHeight);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (height) {
|
|
91
|
+
textarea.style.height = height + "px";
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
watch(
|
|
95
|
+
() => props.modelValue,
|
|
96
|
+
() => {
|
|
97
|
+
if (props.autosize) {
|
|
98
|
+
nextTick(getContentHeight);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
);
|
|
74
102
|
const emitChange = (value, event) => {
|
|
75
103
|
if (props.maxLength && value.length > Number(props.maxLength)) {
|
|
76
104
|
value = value.substring(0, Number(props.maxLength));
|
|
@@ -97,116 +125,31 @@ const _sfc_main = create({
|
|
|
97
125
|
const input = event.target;
|
|
98
126
|
let value = input.value;
|
|
99
127
|
emitChange(value, event);
|
|
100
|
-
emit("blur", event);
|
|
101
|
-
};
|
|
102
|
-
const textareaRef = ref(null);
|
|
103
|
-
const textareaHeight = ref();
|
|
104
|
-
const heightSet = ref("auto");
|
|
105
|
-
const getContentHeight = () => {
|
|
106
|
-
heightSet.value = "auto";
|
|
107
|
-
let height = textareaHeight.value;
|
|
108
|
-
if (typeof props.autosize === "object") {
|
|
109
|
-
const { maxHeight, minHeight } = props.autosize;
|
|
110
|
-
if (maxHeight !== void 0) {
|
|
111
|
-
height = Math.min(height, maxHeight);
|
|
112
|
-
}
|
|
113
|
-
if (minHeight !== void 0) {
|
|
114
|
-
height = Math.max(height, minHeight);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
if (height) {
|
|
118
|
-
heightSet.value = height + "px";
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
watch(
|
|
122
|
-
() => props.modelValue,
|
|
123
|
-
() => {
|
|
124
|
-
if (props.autosize) {
|
|
125
|
-
copyHeight();
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
);
|
|
129
|
-
const copyHeight = () => {
|
|
130
|
-
const query = Taro.createSelectorQuery();
|
|
131
|
-
query.select(".cpoyText").boundingClientRect();
|
|
132
|
-
query.exec((res) => {
|
|
133
|
-
if (res[0]) {
|
|
134
|
-
if (props.modelValue == "") {
|
|
135
|
-
textareaHeight.value = 20;
|
|
136
|
-
} else {
|
|
137
|
-
textareaHeight.value = res[0]["height"] || 20;
|
|
138
|
-
}
|
|
139
|
-
setTimeout(() => {
|
|
140
|
-
getContentHeight();
|
|
141
|
-
}, 400);
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
};
|
|
145
|
-
const getRefHeight = () => {
|
|
146
|
-
const query = Taro.createSelectorQuery();
|
|
147
|
-
query.selectAll(".nut-textarea__textarea").boundingClientRect();
|
|
148
|
-
let uid = textareaRef.value ? textareaRef.value.uid : "0";
|
|
149
|
-
query.exec((res) => {
|
|
150
|
-
if (res[0] && textareaRef.value) {
|
|
151
|
-
let _item = Array.from(res[0]).filter((item) => item.id == uid);
|
|
152
|
-
textareaHeight.value = _item[0]["height"] || 20;
|
|
153
|
-
copyTxtStyle.value.width = _item[0]["width"] + "px";
|
|
154
|
-
nextTick(getContentHeight);
|
|
155
|
-
}
|
|
156
|
-
});
|
|
128
|
+
emit("blur", { value, event });
|
|
157
129
|
};
|
|
158
|
-
const getRefWidth = () => {
|
|
159
|
-
const query = Taro.createSelectorQuery();
|
|
160
|
-
query.select(".nut-textarea__textarea").boundingClientRect();
|
|
161
|
-
query.exec((res) => {
|
|
162
|
-
if (res[0] && textareaRef.value) {
|
|
163
|
-
copyTxtStyle.value.width = res[0]["width"] + "px";
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
};
|
|
167
|
-
const env = Taro.getEnv();
|
|
168
|
-
onMounted(() => {
|
|
169
|
-
if (props.autosize) {
|
|
170
|
-
Taro.nextTick(() => {
|
|
171
|
-
if (Taro.getEnv() === "ALIPAY") {
|
|
172
|
-
getRefWidth();
|
|
173
|
-
copyHeight();
|
|
174
|
-
} else {
|
|
175
|
-
getRefHeight();
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
130
|
return {
|
|
181
|
-
env,
|
|
182
131
|
textareaRef,
|
|
183
132
|
classes,
|
|
184
133
|
styles,
|
|
185
134
|
change,
|
|
186
135
|
focus,
|
|
187
136
|
blur,
|
|
188
|
-
translate
|
|
189
|
-
copyTxtStyle
|
|
137
|
+
translate
|
|
190
138
|
};
|
|
191
139
|
}
|
|
192
140
|
});
|
|
193
|
-
const _hoisted_1 =
|
|
141
|
+
const _hoisted_1 = ["rows", "disabled", "readonly", "value", "maxlength", "placeholder", "autofocus"];
|
|
142
|
+
const _hoisted_2 = {
|
|
194
143
|
key: 0,
|
|
195
|
-
class: "nut-textarea__textarea"
|
|
196
|
-
};
|
|
197
|
-
const _hoisted_2 = ["rows", "disabled", "readonly", "value", "maxlength", "placeholder", "auto-focus"];
|
|
198
|
-
const _hoisted_3 = {
|
|
199
|
-
key: 2,
|
|
200
144
|
class: "nut-textarea__limit"
|
|
201
145
|
};
|
|
202
146
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
203
147
|
return openBlock(), createElementBlock("view", {
|
|
204
148
|
class: normalizeClass(_ctx.classes)
|
|
205
149
|
}, [
|
|
206
|
-
|
|
207
|
-
key: 1,
|
|
150
|
+
createElementVNode("textarea", {
|
|
208
151
|
ref: "textareaRef",
|
|
209
|
-
class:
|
|
152
|
+
class: "nut-textarea__textarea",
|
|
210
153
|
style: normalizeStyle(_ctx.styles),
|
|
211
154
|
rows: _ctx.rows,
|
|
212
155
|
disabled: _ctx.disabled,
|
|
@@ -215,20 +158,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
215
158
|
onInput: _cache[0] || (_cache[0] = (...args) => _ctx.change && _ctx.change(...args)),
|
|
216
159
|
onBlur: _cache[1] || (_cache[1] = (...args) => _ctx.blur && _ctx.blur(...args)),
|
|
217
160
|
onFocus: _cache[2] || (_cache[2] = (...args) => _ctx.focus && _ctx.focus(...args)),
|
|
218
|
-
"show-count": false,
|
|
219
161
|
maxlength: _ctx.maxLength,
|
|
220
162
|
placeholder: _ctx.placeholder || _ctx.translate("placeholder"),
|
|
221
|
-
|
|
222
|
-
}, null,
|
|
223
|
-
|
|
224
|
-
_ctx.limitShow ? (openBlock(), createElementBlock("view", _hoisted_3, toDisplayString(_ctx.modelValue ? _ctx.modelValue.length : 0) + "/" + toDisplayString(_ctx.maxLength), 1)) : createCommentVNode("", true),
|
|
225
|
-
createTextVNode(),
|
|
226
|
-
_ctx.autosize ? (openBlock(), createElementBlock("view", {
|
|
227
|
-
key: 3,
|
|
228
|
-
class: "cpoyText",
|
|
229
|
-
style: normalizeStyle(_ctx.copyTxtStyle)
|
|
230
|
-
}, toDisplayString(_ctx.modelValue), 5)) : createCommentVNode("", true)
|
|
163
|
+
autofocus: _ctx.autofocus
|
|
164
|
+
}, null, 44, _hoisted_1),
|
|
165
|
+
_ctx.limitShow ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(_ctx.modelValue ? _ctx.modelValue.length : 0) + "/" + toDisplayString(_ctx.maxLength), 1)) : createCommentVNode("", true)
|
|
231
166
|
], 2);
|
|
232
167
|
}
|
|
233
|
-
var
|
|
234
|
-
export {
|
|
168
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
169
|
+
export { index as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.6-beta.
|
|
2
|
+
* @nutui/nutui v3.2.6-beta.2 Fri Nov 04 2022 17:24:29 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -26,7 +26,6 @@ const _sfc_main = create({
|
|
|
26
26
|
setup: (props, context) => {
|
|
27
27
|
const currentKey = inject("currentKey");
|
|
28
28
|
const currentTime = inject("currentTime");
|
|
29
|
-
inject("muti");
|
|
30
29
|
const state = reactive({
|
|
31
30
|
currentKey,
|
|
32
31
|
currentTime
|
|
@@ -81,5 +80,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
81
80
|
])
|
|
82
81
|
], 2);
|
|
83
82
|
}
|
|
84
|
-
var
|
|
85
|
-
export {
|
|
83
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
84
|
+
export { index as default };
|