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