@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,12 +1,12 @@
|
|
|
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 { ref, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, Fragment, renderList, normalizeStyle, createVNode, createBlock, createCommentVNode } from "vue";
|
|
7
|
+
import { ref, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, Fragment, renderList, normalizeStyle, createVNode, createTextVNode, createBlock, createCommentVNode } from "vue";
|
|
8
8
|
import { p as pxCheck } from "./pxCheck.js";
|
|
9
|
-
import { u as useTouch } from "./
|
|
9
|
+
import { u as useTouch } from "./index3.js";
|
|
10
10
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
11
11
|
import "../locale/lang";
|
|
12
12
|
const { componentName } = createComponent("rate");
|
|
@@ -83,14 +83,14 @@ const useComponent = (touchable = true) => {
|
|
|
83
83
|
emit("update:modelValue", value);
|
|
84
84
|
emit("change", value);
|
|
85
85
|
};
|
|
86
|
-
const onClick = (e,
|
|
86
|
+
const onClick = (e, index) => {
|
|
87
87
|
if (props.disabled || props.readonly)
|
|
88
88
|
return;
|
|
89
89
|
let value = 0;
|
|
90
|
-
if (
|
|
90
|
+
if (index === 1 && props.modelValue === index)
|
|
91
91
|
;
|
|
92
92
|
else {
|
|
93
|
-
value =
|
|
93
|
+
value = index;
|
|
94
94
|
if (props.allowHalf && e == 2) {
|
|
95
95
|
value -= 0.5;
|
|
96
96
|
}
|
|
@@ -99,13 +99,13 @@ const useComponent = (touchable = true) => {
|
|
|
99
99
|
};
|
|
100
100
|
const getScoreByPosition = (x, rateRefs2, allowHalf) => {
|
|
101
101
|
let v = 0;
|
|
102
|
-
for (let
|
|
103
|
-
const item = rateRefs2.value[
|
|
102
|
+
for (let index = rateRefs2.value.length - 1; index >= 0; index--) {
|
|
103
|
+
const item = rateRefs2.value[index];
|
|
104
104
|
if (x > item.offsetLeft) {
|
|
105
105
|
if (allowHalf) {
|
|
106
|
-
v =
|
|
106
|
+
v = index + (x > item.offsetLeft + item.clientWidth / 2 ? 1 : 0.5);
|
|
107
107
|
} else {
|
|
108
|
-
v =
|
|
108
|
+
v = index + 1;
|
|
109
109
|
}
|
|
110
110
|
break;
|
|
111
111
|
}
|
|
@@ -143,7 +143,7 @@ const useComponent = (touchable = true) => {
|
|
|
143
143
|
}
|
|
144
144
|
};
|
|
145
145
|
};
|
|
146
|
-
const
|
|
146
|
+
const taroComponent = useComponent(false);
|
|
147
147
|
const _hoisted_1 = ["id"];
|
|
148
148
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
149
149
|
const _component_nut_icon = resolveComponent("nut-icon");
|
|
@@ -170,6 +170,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
170
170
|
"class-prefix": _ctx.classPrefix,
|
|
171
171
|
name: n <= _ctx.modelValue ? _ctx.checkedIcon : _ctx.uncheckedIcon
|
|
172
172
|
}, null, 8, ["size", "onClick", "class", "color", "font-class-name", "class-prefix", "name"]),
|
|
173
|
+
createTextVNode(),
|
|
173
174
|
_ctx.allowHalf && Number(_ctx.modelValue) + 1 > n ? (openBlock(), createBlock(_component_nut_icon, {
|
|
174
175
|
key: 0,
|
|
175
176
|
class: "nut-rate-item__icon nut-rate-item__icon--half",
|
|
@@ -194,6 +195,6 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
194
195
|
], 34);
|
|
195
196
|
}
|
|
196
197
|
const { create } = createComponent("rate");
|
|
197
|
-
const _sfc_main = create(
|
|
198
|
-
var
|
|
199
|
-
export {
|
|
198
|
+
const _sfc_main = create(taroComponent);
|
|
199
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", render]]);
|
|
200
|
+
export { index_taro as default };
|
package/dist/packages/_es/Row.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 { reactive, computed, ref, onMounted, toRefs, resolveComponent, openBlock, createElementBlock, normalizeStyle,
|
|
6
|
+
import { reactive, computed, ref, onMounted, toRefs, resolveComponent, openBlock, createElementBlock, normalizeStyle, renderSlot, createCommentVNode, createTextVNode, createElementVNode, withModifiers, withDirectives, createVNode, vShow } 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";
|
|
@@ -16,11 +16,7 @@ const _sfc_main = create({
|
|
|
16
16
|
},
|
|
17
17
|
inputType: {
|
|
18
18
|
type: String,
|
|
19
|
-
default: "
|
|
20
|
-
},
|
|
21
|
-
label: {
|
|
22
|
-
type: String,
|
|
23
|
-
default: ""
|
|
19
|
+
default: "text"
|
|
24
20
|
},
|
|
25
21
|
maxLength: {
|
|
26
22
|
type: [String, Number],
|
|
@@ -46,15 +42,19 @@ const _sfc_main = create({
|
|
|
46
42
|
type: String,
|
|
47
43
|
default: ""
|
|
48
44
|
},
|
|
49
|
-
|
|
50
|
-
type:
|
|
51
|
-
default:
|
|
52
|
-
}
|
|
45
|
+
confirmType: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: "done"
|
|
53
48
|
},
|
|
54
49
|
autofocus: {
|
|
55
50
|
type: Boolean,
|
|
56
51
|
default: false
|
|
57
52
|
},
|
|
53
|
+
focusStyle: {
|
|
54
|
+
type: Object,
|
|
55
|
+
default: () => {
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
58
|
disabled: {
|
|
59
59
|
type: Boolean,
|
|
60
60
|
default: false
|
|
@@ -172,16 +172,20 @@ const _sfc_main = create({
|
|
|
172
172
|
});
|
|
173
173
|
const _hoisted_1 = {
|
|
174
174
|
key: 0,
|
|
175
|
-
class: "nut-searchbar__search-
|
|
175
|
+
class: "nut-searchbar__search-icon nut-searchbar__left-search-icon"
|
|
176
176
|
};
|
|
177
177
|
const _hoisted_2 = {
|
|
178
|
-
key:
|
|
179
|
-
class: "nut-searchbar__search-icon nut-
|
|
178
|
+
key: 0,
|
|
179
|
+
class: "nut-searchbar__search-icon nut-searchbar__iptleft-search-icon"
|
|
180
180
|
};
|
|
181
181
|
const _hoisted_3 = { class: "nut-searchbar__input-inner" };
|
|
182
|
-
const _hoisted_4 = ["type", "maxlength", "placeholder", "value", "disabled", "readonly"];
|
|
182
|
+
const _hoisted_4 = ["type", "maxlength", "placeholder", "value", "confirm-type", "disabled", "readonly"];
|
|
183
183
|
const _hoisted_5 = {
|
|
184
|
-
key:
|
|
184
|
+
key: 1,
|
|
185
|
+
class: "nut-searchbar__search-icon nut-searchbar__iptright-sarch-icon"
|
|
186
|
+
};
|
|
187
|
+
const _hoisted_6 = {
|
|
188
|
+
key: 1,
|
|
185
189
|
class: "nut-searchbar__search-icon nut-searchbar__right-search-icon"
|
|
186
190
|
};
|
|
187
191
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
@@ -190,24 +194,22 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
190
194
|
class: "nut-searchbar",
|
|
191
195
|
style: normalizeStyle(_ctx.searchbarStyle)
|
|
192
196
|
}, [
|
|
193
|
-
_ctx.
|
|
194
|
-
_ctx.$slots.leftout ? (openBlock(), createElementBlock("view", _hoisted_2, [
|
|
197
|
+
_ctx.$slots.leftout ? (openBlock(), createElementBlock("view", _hoisted_1, [
|
|
195
198
|
renderSlot(_ctx.$slots, "leftout")
|
|
196
199
|
])) : createCommentVNode("", true),
|
|
200
|
+
createTextVNode(),
|
|
197
201
|
createElementVNode("view", {
|
|
198
202
|
class: "nut-searchbar__search-input",
|
|
199
203
|
style: normalizeStyle({ ..._ctx.inputSearchbarStyle, ..._ctx.focusCss })
|
|
200
204
|
}, [
|
|
201
|
-
_ctx.$slots.leftin ? (openBlock(), createElementBlock("view",
|
|
202
|
-
key: 0,
|
|
203
|
-
class: "nut-searchbar__search-icon nut-searchbar__iptleft-search-icon",
|
|
204
|
-
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.leftIconClick && _ctx.leftIconClick(...args))
|
|
205
|
-
}, [
|
|
205
|
+
_ctx.$slots.leftin ? (openBlock(), createElementBlock("view", _hoisted_2, [
|
|
206
206
|
renderSlot(_ctx.$slots, "leftin")
|
|
207
207
|
])) : createCommentVNode("", true),
|
|
208
|
+
createTextVNode(),
|
|
208
209
|
createElementVNode("view", _hoisted_3, [
|
|
209
210
|
createElementVNode("form", {
|
|
210
211
|
action: "#",
|
|
212
|
+
onsubmit: "return false",
|
|
211
213
|
onSubmit: _cache[5] || (_cache[5] = withModifiers((...args) => _ctx.handleSubmit && _ctx.handleSubmit(...args), ["prevent"]))
|
|
212
214
|
}, [
|
|
213
215
|
createElementVNode("input", {
|
|
@@ -217,15 +219,18 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
217
219
|
maxlength: _ctx.maxLength,
|
|
218
220
|
placeholder: _ctx.placeholder || _ctx.translate("placeholder"),
|
|
219
221
|
value: _ctx.modelValue,
|
|
222
|
+
"confirm-type": _ctx.confirmType,
|
|
220
223
|
disabled: _ctx.disabled,
|
|
221
224
|
readonly: _ctx.readonly,
|
|
222
|
-
onClick: _cache[
|
|
223
|
-
onInput: _cache[
|
|
224
|
-
onFocus: _cache[
|
|
225
|
-
onBlur: _cache[
|
|
225
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.clickInput && _ctx.clickInput(...args)),
|
|
226
|
+
onInput: _cache[1] || (_cache[1] = (...args) => _ctx.valueChange && _ctx.valueChange(...args)),
|
|
227
|
+
onFocus: _cache[2] || (_cache[2] = (...args) => _ctx.valueFocus && _ctx.valueFocus(...args)),
|
|
228
|
+
onBlur: _cache[3] || (_cache[3] = (...args) => _ctx.valueBlur && _ctx.valueBlur(...args)),
|
|
229
|
+
onConfirm: _cache[4] || (_cache[4] = (...args) => _ctx.handleSubmit && _ctx.handleSubmit(...args)),
|
|
226
230
|
style: normalizeStyle(_ctx.styleSearchbar)
|
|
227
231
|
}, null, 44, _hoisted_4)
|
|
228
232
|
], 32),
|
|
233
|
+
createTextVNode(),
|
|
229
234
|
_ctx.clearable ? withDirectives((openBlock(), createElementBlock("view", {
|
|
230
235
|
key: 0,
|
|
231
236
|
onClick: _cache[6] || (_cache[6] = (...args) => _ctx.handleClear && _ctx.handleClear(...args)),
|
|
@@ -237,21 +242,19 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
237
242
|
color: "#555"
|
|
238
243
|
}, null, 8, ["name"])
|
|
239
244
|
], 512)), [
|
|
240
|
-
[vShow,
|
|
245
|
+
[vShow, _ctx.modelValue.length > 0]
|
|
241
246
|
]) : createCommentVNode("", true)
|
|
242
247
|
]),
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
class: "nut-searchbar__search-icon nut-searchbar__iptright-sarch-icon",
|
|
246
|
-
onClick: _cache[7] || (_cache[7] = (...args) => _ctx.rightIconClick && _ctx.rightIconClick(...args))
|
|
247
|
-
}, [
|
|
248
|
+
createTextVNode(),
|
|
249
|
+
_ctx.$slots.rightin ? (openBlock(), createElementBlock("view", _hoisted_5, [
|
|
248
250
|
renderSlot(_ctx.$slots, "rightin")
|
|
249
251
|
])) : createCommentVNode("", true)
|
|
250
252
|
], 4),
|
|
251
|
-
|
|
253
|
+
createTextVNode(),
|
|
254
|
+
_ctx.$slots.rightout ? (openBlock(), createElementBlock("view", _hoisted_6, [
|
|
252
255
|
renderSlot(_ctx.$slots, "rightout")
|
|
253
256
|
])) : createCommentVNode("", true)
|
|
254
257
|
], 4);
|
|
255
258
|
}
|
|
256
|
-
var
|
|
257
|
-
export {
|
|
259
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
260
|
+
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, computed, watch, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, createElementVNode, toDisplayString,
|
|
6
|
+
import { ref, computed, watch, onMounted, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, createElementVNode, toDisplayString, createTextVNode, withDirectives, vModelText, createCommentVNode, Fragment, renderList } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
+
import Taro, { eventCenter, getCurrentInstance } from "@tarojs/taro";
|
|
8
9
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
10
|
import "../locale/lang";
|
|
10
11
|
const { create, translate } = createComponent("shortpassword");
|
|
@@ -45,10 +46,6 @@ const _sfc_main = create({
|
|
|
45
46
|
length: {
|
|
46
47
|
type: [String, Number],
|
|
47
48
|
default: 6
|
|
48
|
-
},
|
|
49
|
-
isWrapTeleport: {
|
|
50
|
-
type: Boolean,
|
|
51
|
-
default: true
|
|
52
49
|
}
|
|
53
50
|
},
|
|
54
51
|
emits: ["update:modelValue", "update:visible", "complete", "change", "ok", "tips", "close", "cancel"],
|
|
@@ -57,27 +54,47 @@ const _sfc_main = create({
|
|
|
57
54
|
const realpwd = ref();
|
|
58
55
|
const comLen = computed(() => range(Number(props.length)));
|
|
59
56
|
const show = ref(props.visible);
|
|
57
|
+
const refRandomId = Math.random().toString(36).slice(-8);
|
|
58
|
+
const randRef = ref(refRandomId);
|
|
59
|
+
const isWx = ref(false);
|
|
60
60
|
function sureClick() {
|
|
61
61
|
emit("ok", realInput.value);
|
|
62
62
|
}
|
|
63
63
|
function focus() {
|
|
64
|
-
|
|
64
|
+
let dom = "";
|
|
65
|
+
if (isWx.value) {
|
|
66
|
+
setTimeout(() => {
|
|
67
|
+
if (!document.getElementById("nut-input-real-taro-" + randRef.value))
|
|
68
|
+
return;
|
|
69
|
+
dom = document.getElementById("nut-input-real-taro-" + randRef.value);
|
|
70
|
+
if (!dom)
|
|
71
|
+
return;
|
|
72
|
+
dom.focus();
|
|
73
|
+
}, 150);
|
|
74
|
+
} else {
|
|
75
|
+
dom = document.getElementsByClassName("nut-input-real")[0];
|
|
76
|
+
let h = dom.children[0];
|
|
77
|
+
h.focus();
|
|
78
|
+
}
|
|
65
79
|
}
|
|
66
80
|
watch(
|
|
67
81
|
() => props.visible,
|
|
68
82
|
(value) => {
|
|
69
83
|
show.value = value;
|
|
84
|
+
if (value) {
|
|
85
|
+
randRef.value = Math.random().toString(36).slice(-8);
|
|
86
|
+
if (Taro.getEnv() === "WEB") {
|
|
87
|
+
isWx.value = false;
|
|
88
|
+
} else {
|
|
89
|
+
isWx.value = true;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
70
92
|
}
|
|
71
93
|
);
|
|
72
94
|
watch(
|
|
73
95
|
() => props.modelValue,
|
|
74
96
|
(value) => {
|
|
75
97
|
realInput.value = value;
|
|
76
|
-
emit("update:modelValue", value);
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
deep: true,
|
|
80
|
-
immediate: true
|
|
81
98
|
}
|
|
82
99
|
);
|
|
83
100
|
function changeValue(e) {
|
|
@@ -107,55 +124,47 @@ const _sfc_main = create({
|
|
|
107
124
|
function onTips() {
|
|
108
125
|
emit("tips");
|
|
109
126
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
if (isAndroid) {
|
|
120
|
-
return {
|
|
121
|
-
opacity: 0,
|
|
122
|
-
zindex: 10
|
|
123
|
-
};
|
|
127
|
+
onMounted(() => {
|
|
128
|
+
eventCenter.once(getCurrentInstance().router.onReady, () => {
|
|
129
|
+
});
|
|
130
|
+
if (Taro.getEnv() === "WEB") {
|
|
131
|
+
isWx.value = false;
|
|
132
|
+
} else {
|
|
133
|
+
isWx.value = true;
|
|
124
134
|
}
|
|
125
|
-
}
|
|
135
|
+
});
|
|
126
136
|
return {
|
|
127
137
|
comLen,
|
|
128
138
|
sureClick,
|
|
129
139
|
realInput,
|
|
130
140
|
realpwd,
|
|
131
|
-
focus,
|
|
132
141
|
range,
|
|
133
142
|
changeValue,
|
|
134
143
|
close,
|
|
135
144
|
onTips,
|
|
145
|
+
focus,
|
|
136
146
|
show,
|
|
137
|
-
systemStyle,
|
|
138
147
|
closeIcon,
|
|
148
|
+
isWx,
|
|
149
|
+
refRandomId,
|
|
150
|
+
randRef,
|
|
139
151
|
translate
|
|
140
152
|
};
|
|
141
153
|
}
|
|
142
154
|
});
|
|
143
155
|
const _hoisted_1 = { class: "nut-shortpsd-title" };
|
|
144
156
|
const _hoisted_2 = { class: "nut-shortpsd-subtitle" };
|
|
145
|
-
const _hoisted_3 =
|
|
146
|
-
const _hoisted_4 =
|
|
147
|
-
const _hoisted_5 = {
|
|
157
|
+
const _hoisted_3 = ["id", "maxlength"];
|
|
158
|
+
const _hoisted_4 = { class: "nut-input-w" };
|
|
159
|
+
const _hoisted_5 = /* @__PURE__ */ createElementVNode("view", { class: "nut-input-site" }, null, -1);
|
|
160
|
+
const _hoisted_6 = {
|
|
148
161
|
key: 0,
|
|
149
162
|
class: "nut-shortpsd-icon"
|
|
150
163
|
};
|
|
151
|
-
const
|
|
152
|
-
const
|
|
153
|
-
const _hoisted_8 = {
|
|
154
|
-
key: 0,
|
|
155
|
-
class: "nut-shortpsd-forget"
|
|
156
|
-
};
|
|
164
|
+
const _hoisted_7 = { class: "nut-shortpsd-message" };
|
|
165
|
+
const _hoisted_8 = { class: "nut-shortpsd-error" };
|
|
157
166
|
const _hoisted_9 = {
|
|
158
|
-
key:
|
|
167
|
+
key: 1,
|
|
159
168
|
class: "nut-shortpsd-footer"
|
|
160
169
|
};
|
|
161
170
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
@@ -169,70 +178,92 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
169
178
|
textAlign: "center"
|
|
170
179
|
},
|
|
171
180
|
visible: _ctx.show,
|
|
172
|
-
"onUpdate:visible": _cache[
|
|
181
|
+
"onUpdate:visible": _cache[8] || (_cache[8] = ($event) => _ctx.show = $event),
|
|
173
182
|
closeable: true,
|
|
174
183
|
onClickCloseIcon: _ctx.closeIcon,
|
|
175
184
|
"close-on-click-overlay": _ctx.closeOnClickOverlay,
|
|
176
|
-
onClickOverlay: _ctx.close
|
|
177
|
-
isWrapTeleport: _ctx.isWrapTeleport
|
|
185
|
+
onClickOverlay: _ctx.close
|
|
178
186
|
}, {
|
|
179
187
|
default: withCtx(() => [
|
|
180
188
|
createElementVNode("view", _hoisted_1, toDisplayString(_ctx.title || _ctx.translate("title")), 1),
|
|
189
|
+
createTextVNode(),
|
|
181
190
|
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.desc || _ctx.translate("desc")), 1),
|
|
182
|
-
|
|
183
|
-
|
|
191
|
+
createTextVNode(),
|
|
192
|
+
_ctx.isWx && _ctx.visible ? withDirectives((openBlock(), createElementBlock("input", {
|
|
193
|
+
key: 0,
|
|
194
|
+
class: "nut-input-real-taro",
|
|
195
|
+
id: "nut-input-real-taro-" + _ctx.randRef,
|
|
196
|
+
type: "number",
|
|
197
|
+
maxlength: _ctx.length,
|
|
198
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.realInput = $event),
|
|
199
|
+
onInput: _cache[1] || (_cache[1] = (...args) => _ctx.changeValue && _ctx.changeValue(...args))
|
|
200
|
+
}, null, 40, _hoisted_3)), [
|
|
201
|
+
[vModelText, _ctx.realInput]
|
|
202
|
+
]) : createCommentVNode("", true),
|
|
203
|
+
createTextVNode(),
|
|
204
|
+
createElementVNode("view", _hoisted_4, [
|
|
205
|
+
!_ctx.isWx ? withDirectives((openBlock(), createElementBlock("input", {
|
|
206
|
+
key: 0,
|
|
184
207
|
ref: "realpwd",
|
|
185
208
|
class: "nut-input-real",
|
|
186
209
|
type: "number",
|
|
187
210
|
maxlength: "6",
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}, null, 36), [
|
|
211
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.realInput = $event),
|
|
212
|
+
onInput: _cache[3] || (_cache[3] = (...args) => _ctx.changeValue && _ctx.changeValue(...args))
|
|
213
|
+
}, null, 544)), [
|
|
192
214
|
[vModelText, _ctx.realInput]
|
|
193
|
-
]),
|
|
194
|
-
|
|
215
|
+
]) : createCommentVNode("", true),
|
|
216
|
+
createTextVNode(),
|
|
217
|
+
_hoisted_5,
|
|
218
|
+
createTextVNode(),
|
|
195
219
|
createElementVNode("view", {
|
|
196
|
-
class: "nut-shortpsd-fake",
|
|
197
|
-
onClick: _cache[
|
|
220
|
+
class: "nut-shortpsd-fake-taro",
|
|
221
|
+
onClick: _cache[4] || (_cache[4] = (...args) => _ctx.focus && _ctx.focus(...args))
|
|
198
222
|
}, [
|
|
199
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(new Array(_ctx.comLen), (sublen,
|
|
223
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(new Array(_ctx.comLen), (sublen, index) => {
|
|
200
224
|
return openBlock(), createElementBlock("view", {
|
|
201
225
|
class: "nut-shortpsd-li",
|
|
202
|
-
key:
|
|
226
|
+
key: index
|
|
203
227
|
}, [
|
|
204
|
-
String(_ctx.realInput).length >
|
|
228
|
+
String(_ctx.realInput).length > index ? (openBlock(), createElementBlock("view", _hoisted_6)) : createCommentVNode("", true)
|
|
205
229
|
]);
|
|
206
230
|
}), 128))
|
|
207
231
|
])
|
|
208
232
|
]),
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
233
|
+
createTextVNode(),
|
|
234
|
+
createElementVNode("view", _hoisted_7, [
|
|
235
|
+
createElementVNode("view", _hoisted_8, toDisplayString(_ctx.errorMsg), 1),
|
|
236
|
+
createTextVNode(),
|
|
237
|
+
_ctx.tips || _ctx.translate("tips") ? (openBlock(), createElementBlock("view", {
|
|
238
|
+
key: 0,
|
|
239
|
+
class: "nut-shortpsd-forget",
|
|
240
|
+
onClick: _cache[5] || (_cache[5] = (...args) => _ctx.onTips && _ctx.onTips(...args))
|
|
241
|
+
}, [
|
|
212
242
|
createVNode(_component_nut_icon, {
|
|
213
243
|
class: "icon",
|
|
214
244
|
size: "11px",
|
|
215
245
|
name: "tips"
|
|
216
246
|
}),
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}, toDisplayString(_ctx.tips || _ctx.translate("tips")), 1)
|
|
247
|
+
createTextVNode(),
|
|
248
|
+
createElementVNode("view", null, toDisplayString(_ctx.tips || _ctx.translate("tips")), 1)
|
|
220
249
|
])) : createCommentVNode("", true)
|
|
221
250
|
]),
|
|
251
|
+
createTextVNode(),
|
|
222
252
|
!_ctx.noButton ? (openBlock(), createElementBlock("view", _hoisted_9, [
|
|
223
253
|
createElementVNode("view", {
|
|
224
254
|
class: "nut-shortpsd-cancle",
|
|
225
|
-
onClick: _cache[
|
|
255
|
+
onClick: _cache[6] || (_cache[6] = (...args) => _ctx.close && _ctx.close(...args))
|
|
226
256
|
}, toDisplayString(_ctx.translate("cancel")), 1),
|
|
257
|
+
createTextVNode(),
|
|
227
258
|
createElementVNode("view", {
|
|
228
259
|
class: "nut-shortpsd-sure",
|
|
229
|
-
onClick: _cache[
|
|
260
|
+
onClick: _cache[7] || (_cache[7] = (...args) => _ctx.sureClick && _ctx.sureClick(...args))
|
|
230
261
|
}, toDisplayString(_ctx.translate("confirm")), 1)
|
|
231
262
|
])) : createCommentVNode("", true)
|
|
232
263
|
]),
|
|
233
264
|
_: 1
|
|
234
|
-
}, 8, ["visible", "onClickCloseIcon", "close-on-click-overlay", "onClickOverlay"
|
|
265
|
+
}, 8, ["visible", "onClickCloseIcon", "close-on-click-overlay", "onClickOverlay"])
|
|
235
266
|
]);
|
|
236
267
|
}
|
|
237
|
-
var
|
|
238
|
-
export {
|
|
268
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
269
|
+
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
|
*/
|
|
@@ -16,11 +16,10 @@ const _sfc_main = create({
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
emits: [],
|
|
19
|
-
setup: (props) => {
|
|
19
|
+
setup: (props, context) => {
|
|
20
20
|
const list = ref(null);
|
|
21
21
|
const state = reactive({
|
|
22
|
-
count: 1
|
|
23
|
-
observer: null
|
|
22
|
+
count: 1
|
|
24
23
|
});
|
|
25
24
|
const classes = computed(() => {
|
|
26
25
|
const prefixCls = componentName;
|
|
@@ -31,7 +30,7 @@ const _sfc_main = create({
|
|
|
31
30
|
const setPaddingLeft = (nodeList, level = 1) => {
|
|
32
31
|
for (let i = 0; i < nodeList.length; i++) {
|
|
33
32
|
let item = nodeList[i];
|
|
34
|
-
item.children[0].style.paddingLeft =
|
|
33
|
+
item.children[0].style.paddingLeft = props.offset * level + "px";
|
|
35
34
|
if (!item.className.includes("nut-sidenavbaritem")) {
|
|
36
35
|
setPaddingLeft(Array.from(item.children[1].children), ++state.count);
|
|
37
36
|
}
|
|
@@ -40,7 +39,7 @@ const _sfc_main = create({
|
|
|
40
39
|
};
|
|
41
40
|
const handleSlots = () => {
|
|
42
41
|
let childNodes = list.value.childNodes;
|
|
43
|
-
if (childNodes.length) {
|
|
42
|
+
if (childNodes && childNodes.length) {
|
|
44
43
|
childNodes = Array.from(childNodes).filter((item) => item.nodeType !== 3).map((item) => {
|
|
45
44
|
return item;
|
|
46
45
|
});
|
|
@@ -49,16 +48,6 @@ const _sfc_main = create({
|
|
|
49
48
|
};
|
|
50
49
|
onMounted(() => {
|
|
51
50
|
handleSlots();
|
|
52
|
-
state.observer = new MutationObserver(function() {
|
|
53
|
-
state.count = 1;
|
|
54
|
-
handleSlots();
|
|
55
|
-
});
|
|
56
|
-
state.observer.observe(list.value, {
|
|
57
|
-
attributes: false,
|
|
58
|
-
childList: true,
|
|
59
|
-
characterData: false,
|
|
60
|
-
subtree: false
|
|
61
|
-
});
|
|
62
51
|
});
|
|
63
52
|
return {
|
|
64
53
|
...toRefs(state),
|
|
@@ -83,5 +72,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
83
72
|
])
|
|
84
73
|
], 2);
|
|
85
74
|
}
|
|
86
|
-
var
|
|
87
|
-
export {
|
|
75
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
76
|
+
export { index_taro as default };
|