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