@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,13 +1,13 @@
|
|
|
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, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, Fragment, renderList, normalizeClass, withDirectives, vModelText,
|
|
6
|
+
import { ref, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, createTextVNode, Fragment, renderList, normalizeClass, withDirectives, vModelText, createVNode } 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";
|
|
10
|
-
const { create, translate } = createComponent("ecard");
|
|
10
|
+
const { componentName, create, translate } = createComponent("ecard");
|
|
11
11
|
const _sfc_main = create({
|
|
12
12
|
props: {
|
|
13
13
|
chooseText: {
|
|
@@ -41,7 +41,7 @@ const _sfc_main = create({
|
|
|
41
41
|
default: 9999
|
|
42
42
|
},
|
|
43
43
|
modelValue: {
|
|
44
|
-
type:
|
|
44
|
+
type: Number,
|
|
45
45
|
default: 0
|
|
46
46
|
},
|
|
47
47
|
placeholder: {
|
|
@@ -57,15 +57,15 @@ const _sfc_main = create({
|
|
|
57
57
|
setup(props, { emit }) {
|
|
58
58
|
const currentIndex = ref(null);
|
|
59
59
|
const currentValue = ref(null);
|
|
60
|
-
const inputValue = ref(
|
|
60
|
+
const inputValue = ref();
|
|
61
61
|
const stepValue = ref(props.cardAmountMin);
|
|
62
62
|
const money = ref(props.modelValue);
|
|
63
|
-
const handleClick = (item,
|
|
64
|
-
currentIndex.value =
|
|
63
|
+
const handleClick = (item, index) => {
|
|
64
|
+
currentIndex.value = index;
|
|
65
|
+
inputValue.value = "";
|
|
65
66
|
stepValue.value = props.cardAmountMin;
|
|
66
67
|
currentValue.value = item.price;
|
|
67
68
|
emit("change", item);
|
|
68
|
-
emit("update:modelValue", item.price);
|
|
69
69
|
};
|
|
70
70
|
const change = (event) => {
|
|
71
71
|
let input = event.target;
|
|
@@ -81,13 +81,11 @@ const _sfc_main = create({
|
|
|
81
81
|
currentValue.value = props.cardAmountMin;
|
|
82
82
|
}
|
|
83
83
|
emit("inputChange", Number(inputValue.value));
|
|
84
|
-
emit("update:modelValue", Number(inputValue.value));
|
|
85
84
|
};
|
|
86
85
|
const inputClick = () => {
|
|
87
86
|
currentIndex.value = "input";
|
|
88
87
|
stepValue.value = props.cardAmountMin;
|
|
89
|
-
|
|
90
|
-
emit("update:modelValue", inputValue.value);
|
|
88
|
+
emit("update:modelValue", 0);
|
|
91
89
|
emit("inputClick");
|
|
92
90
|
};
|
|
93
91
|
const changeStep = (value) => {
|
|
@@ -124,22 +122,24 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
124
122
|
const _component_nut_inputnumber = resolveComponent("nut-inputnumber");
|
|
125
123
|
return openBlock(), createElementBlock("view", _hoisted_1, [
|
|
126
124
|
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.chooseText || _ctx.translate("chooseText")), 1),
|
|
125
|
+
createTextVNode(),
|
|
127
126
|
createElementVNode("view", _hoisted_3, [
|
|
128
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.dataList, (item,
|
|
127
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.dataList, (item, index) => {
|
|
129
128
|
return openBlock(), createElementBlock("view", {
|
|
130
|
-
key:
|
|
131
|
-
class: normalizeClass(["nut-ecard__list__item", _ctx.currentIndex ==
|
|
132
|
-
onClick: ($event) => _ctx.handleClick(item,
|
|
129
|
+
key: index,
|
|
130
|
+
class: normalizeClass(["nut-ecard__list__item", _ctx.currentIndex == index ? "active" : ""]),
|
|
131
|
+
onClick: ($event) => _ctx.handleClick(item, index)
|
|
133
132
|
}, toDisplayString(item.price), 11, _hoisted_4);
|
|
134
133
|
}), 128)),
|
|
134
|
+
createTextVNode(),
|
|
135
135
|
createElementVNode("view", {
|
|
136
136
|
class: normalizeClass(["nut-ecard__list__input", _ctx.currentIndex == "input" ? "active" : ""]),
|
|
137
137
|
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.inputClick && _ctx.inputClick(...args))
|
|
138
138
|
}, [
|
|
139
139
|
createElementVNode("view", null, toDisplayString(_ctx.otherValueText || _ctx.translate("otherValueText")), 1),
|
|
140
|
+
createTextVNode(),
|
|
140
141
|
createElementVNode("view", _hoisted_5, [
|
|
141
142
|
withDirectives(createElementVNode("input", {
|
|
142
|
-
class: "nut-ecard__list__input--input",
|
|
143
143
|
type: "text",
|
|
144
144
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.inputValue = $event),
|
|
145
145
|
onInput: _cache[1] || (_cache[1] = (...args) => _ctx.change && _ctx.change(...args)),
|
|
@@ -150,8 +150,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
150
150
|
createTextVNode(" " + toDisplayString(_ctx.suffix), 1)
|
|
151
151
|
])
|
|
152
152
|
], 2),
|
|
153
|
+
createTextVNode(),
|
|
153
154
|
createElementVNode("view", _hoisted_7, [
|
|
154
155
|
createElementVNode("view", null, toDisplayString(_ctx.suffix) + toDisplayString(_ctx.money), 1),
|
|
156
|
+
createTextVNode(),
|
|
155
157
|
createVNode(_component_nut_inputnumber, {
|
|
156
158
|
modelValue: _ctx.stepValue,
|
|
157
159
|
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.stepValue = $event),
|
|
@@ -163,5 +165,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
163
165
|
])
|
|
164
166
|
]);
|
|
165
167
|
}
|
|
166
|
-
var
|
|
167
|
-
export {
|
|
168
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
169
|
+
export { index_taro as default };
|
|
@@ -1,11 +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
|
-
import { ref, reactive, computed,
|
|
6
|
+
import { ref, reactive, computed, watch, toRefs, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, normalizeStyle, withCtx, Fragment, renderList, createElementVNode, toDisplayString, createTextVNode, renderSlot, withDirectives, vShow, createCommentVNode, withModifiers } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import { u as useExpose } from "./
|
|
8
|
+
import { u as useExpose } from "./index2.js";
|
|
9
|
+
import Taro from "@tarojs/taro";
|
|
9
10
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
11
|
import "../locale/lang";
|
|
11
12
|
const { componentName, create } = createComponent("elevator");
|
|
@@ -40,7 +41,8 @@ const _sfc_main = create({
|
|
|
40
41
|
},
|
|
41
42
|
emits: ["click-item", "click-index"],
|
|
42
43
|
setup(props, context) {
|
|
43
|
-
const
|
|
44
|
+
const spaceHeight = 23;
|
|
45
|
+
const listview = ref();
|
|
44
46
|
const state = reactive({
|
|
45
47
|
anchorIndex: 0,
|
|
46
48
|
codeIndex: 0,
|
|
@@ -52,6 +54,8 @@ const _sfc_main = create({
|
|
|
52
54
|
},
|
|
53
55
|
scrollStart: false,
|
|
54
56
|
currentIndex: 0,
|
|
57
|
+
query: Taro.createSelectorQuery(),
|
|
58
|
+
scrollTop: 0,
|
|
55
59
|
currentData: {},
|
|
56
60
|
currentKey: "",
|
|
57
61
|
scrollY: 0,
|
|
@@ -72,9 +76,11 @@ const _sfc_main = create({
|
|
|
72
76
|
const clientHeight = computed(() => {
|
|
73
77
|
return listview.value.clientHeight;
|
|
74
78
|
});
|
|
75
|
-
const getData = (el
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
const getData = (el) => {
|
|
80
|
+
if (!el.dataset.index) {
|
|
81
|
+
return "0";
|
|
82
|
+
}
|
|
83
|
+
return el.dataset.index;
|
|
78
84
|
};
|
|
79
85
|
const setListGroup = (el) => {
|
|
80
86
|
nextTick(() => {
|
|
@@ -84,40 +90,43 @@ const _sfc_main = create({
|
|
|
84
90
|
});
|
|
85
91
|
};
|
|
86
92
|
const calculateHeight = () => {
|
|
93
|
+
state.listHeight = [];
|
|
87
94
|
let height = 0;
|
|
88
95
|
state.listHeight.push(height);
|
|
89
96
|
for (let i = 0; i < state.listGroup.length; i++) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
97
|
+
state.query.selectAll(`.elevator__item__${i}`).boundingClientRect();
|
|
98
|
+
state.query.exec((res) => {
|
|
99
|
+
height += res[i][0].height;
|
|
100
|
+
state.listHeight.push(height);
|
|
101
|
+
});
|
|
93
102
|
}
|
|
94
103
|
};
|
|
95
|
-
const scrollTo = (
|
|
96
|
-
if (!
|
|
104
|
+
const scrollTo = (index) => {
|
|
105
|
+
if (!index && index !== 0) {
|
|
97
106
|
return;
|
|
98
107
|
}
|
|
99
|
-
if (
|
|
100
|
-
|
|
101
|
-
if (
|
|
102
|
-
|
|
103
|
-
state.codeIndex =
|
|
104
|
-
|
|
108
|
+
if (index < 0)
|
|
109
|
+
index = 0;
|
|
110
|
+
if (index > state.listHeight.length - 2)
|
|
111
|
+
index = state.listHeight.length - 2;
|
|
112
|
+
state.codeIndex = index;
|
|
113
|
+
state.scrollTop = state.listHeight[index];
|
|
105
114
|
};
|
|
106
115
|
const touchStart = (e) => {
|
|
107
116
|
state.scrollStart = true;
|
|
108
|
-
let
|
|
117
|
+
let index = getData(e.target);
|
|
109
118
|
let firstTouch = e.touches[0];
|
|
110
119
|
state.touchState.y1 = firstTouch.pageY;
|
|
111
|
-
state.anchorIndex = +
|
|
112
|
-
state.codeIndex = +
|
|
113
|
-
scrollTo(+
|
|
120
|
+
state.anchorIndex = +index;
|
|
121
|
+
state.codeIndex = +index;
|
|
122
|
+
scrollTo(+index);
|
|
114
123
|
};
|
|
115
124
|
const touchMove = (e) => {
|
|
116
125
|
let firstTouch = e.touches[0];
|
|
117
126
|
state.touchState.y2 = firstTouch.pageY;
|
|
118
|
-
let delta = (state.touchState.y2 - state.touchState.y1) /
|
|
127
|
+
let delta = (state.touchState.y2 - state.touchState.y1) / spaceHeight | 0;
|
|
119
128
|
state.codeIndex = state.anchorIndex + delta;
|
|
120
|
-
scrollTo(state.
|
|
129
|
+
scrollTo(state.currentIndex);
|
|
121
130
|
};
|
|
122
131
|
const touchEnd = () => {
|
|
123
132
|
state.scrollStart = false;
|
|
@@ -134,7 +143,7 @@ const _sfc_main = create({
|
|
|
134
143
|
let target = e.target;
|
|
135
144
|
let scrollTop = target.scrollTop;
|
|
136
145
|
const listHeight = state.listHeight;
|
|
137
|
-
state.scrollY = scrollTop;
|
|
146
|
+
state.scrollY = Math.floor(scrollTop);
|
|
138
147
|
for (let i = 0; i < listHeight.length - 1; i++) {
|
|
139
148
|
let height1 = listHeight[i];
|
|
140
149
|
let height2 = listHeight[i + 1];
|
|
@@ -146,17 +155,13 @@ const _sfc_main = create({
|
|
|
146
155
|
}
|
|
147
156
|
state.currentIndex = listHeight.length - 2;
|
|
148
157
|
};
|
|
149
|
-
onMounted(() => {
|
|
150
|
-
listview.value.addEventListener("scroll", listViewScroll);
|
|
151
|
-
});
|
|
152
158
|
useExpose({
|
|
153
159
|
scrollTo
|
|
154
160
|
});
|
|
155
161
|
watch(
|
|
156
162
|
() => state.listGroup.length,
|
|
157
163
|
() => {
|
|
158
|
-
|
|
159
|
-
nextTick(calculateHeight);
|
|
164
|
+
Taro.nextTick(calculateHeight);
|
|
160
165
|
}
|
|
161
166
|
);
|
|
162
167
|
watch(
|
|
@@ -184,7 +189,8 @@ const _sfc_main = create({
|
|
|
184
189
|
touchMove,
|
|
185
190
|
touchEnd,
|
|
186
191
|
handleClickItem,
|
|
187
|
-
handleClickIndex
|
|
192
|
+
handleClickIndex,
|
|
193
|
+
listViewScroll
|
|
188
194
|
};
|
|
189
195
|
}
|
|
190
196
|
});
|
|
@@ -195,57 +201,76 @@ const _hoisted_4 = { class: "fixed-title" };
|
|
|
195
201
|
const _hoisted_5 = { class: "nut-elevator__bars__inner" };
|
|
196
202
|
const _hoisted_6 = ["data-index", "onClick"];
|
|
197
203
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
204
|
+
const _component_scroll_view = resolveComponent(function() {
|
|
205
|
+
if (process.env.TARO_ENV === "h5") {
|
|
206
|
+
return "taro-scroll-view";
|
|
207
|
+
} else {
|
|
208
|
+
return "scroll-view";
|
|
209
|
+
}
|
|
210
|
+
}());
|
|
198
211
|
return openBlock(), createElementBlock("view", {
|
|
199
212
|
class: normalizeClass(_ctx.classes)
|
|
200
213
|
}, [
|
|
201
|
-
|
|
202
|
-
class: "nut-elevator__list",
|
|
214
|
+
createVNode(_component_scroll_view, {
|
|
215
|
+
class: "nut-elevator__list scrollview",
|
|
216
|
+
"scroll-top": _ctx.scrollTop,
|
|
217
|
+
"scroll-y": true,
|
|
218
|
+
"scroll-with-animation": true,
|
|
219
|
+
"scroll-anchoring": true,
|
|
203
220
|
ref: "listview",
|
|
204
|
-
style: normalizeStyle({ height: isNaN(+_ctx.height) ? _ctx.height : `${_ctx.height}px` })
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
221
|
+
style: normalizeStyle({ height: isNaN(+_ctx.height) ? _ctx.height : `${_ctx.height}px` }),
|
|
222
|
+
onScroll: _ctx.listViewScroll
|
|
223
|
+
}, {
|
|
224
|
+
default: withCtx(() => [
|
|
225
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item, index) => {
|
|
226
|
+
return openBlock(), createElementBlock("view", {
|
|
227
|
+
class: normalizeClass(["nut-elevator__list__item", `elevator__item__${index}`]),
|
|
228
|
+
key: item[_ctx.acceptKey],
|
|
229
|
+
ref_for: true,
|
|
230
|
+
ref: _ctx.setListGroup
|
|
231
|
+
}, [
|
|
232
|
+
createElementVNode("view", _hoisted_1, toDisplayString(item[_ctx.acceptKey]), 1),
|
|
233
|
+
createTextVNode(),
|
|
234
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (subitem) => {
|
|
235
|
+
return openBlock(), createElementBlock("view", {
|
|
236
|
+
class: normalizeClass(["nut-elevator__list__item__name", {
|
|
237
|
+
"nut-elevator__list__item__name--highcolor": _ctx.currentData.id === subitem.id && _ctx.currentKey === item[_ctx.acceptKey]
|
|
238
|
+
}]),
|
|
239
|
+
key: subitem["id"],
|
|
240
|
+
onClick: ($event) => _ctx.handleClickItem(item[_ctx.acceptKey], subitem)
|
|
241
|
+
}, [
|
|
242
|
+
!_ctx.$slots.default ? (openBlock(), createElementBlock("span", {
|
|
243
|
+
key: 0,
|
|
244
|
+
innerHTML: subitem.name
|
|
245
|
+
}, null, 8, _hoisted_3)) : renderSlot(_ctx.$slots, "default", {
|
|
246
|
+
key: 1,
|
|
247
|
+
item: subitem
|
|
248
|
+
})
|
|
249
|
+
], 10, _hoisted_2);
|
|
250
|
+
}), 128))
|
|
251
|
+
], 2);
|
|
252
|
+
}), 128)),
|
|
253
|
+
createTextVNode(),
|
|
254
|
+
_ctx.isSticky ? withDirectives((openBlock(), createElementBlock("view", {
|
|
255
|
+
key: 0,
|
|
256
|
+
class: "nut-elevator__list__fixed",
|
|
257
|
+
style: normalizeStyle(_ctx.fixedStyle)
|
|
212
258
|
}, [
|
|
213
|
-
createElementVNode("
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
!_ctx.$slots.default ? (openBlock(), createElementBlock("span", {
|
|
223
|
-
key: 0,
|
|
224
|
-
innerHTML: subitem.name
|
|
225
|
-
}, null, 8, _hoisted_3)) : renderSlot(_ctx.$slots, "default", {
|
|
226
|
-
key: 1,
|
|
227
|
-
item: subitem
|
|
228
|
-
})
|
|
229
|
-
], 10, _hoisted_2);
|
|
230
|
-
}), 128))
|
|
231
|
-
]);
|
|
232
|
-
}), 128)),
|
|
233
|
-
_ctx.isSticky ? withDirectives((openBlock(), createElementBlock("view", {
|
|
234
|
-
key: 0,
|
|
235
|
-
class: "nut-elevator__list__fixed",
|
|
236
|
-
style: normalizeStyle(_ctx.fixedStyle)
|
|
237
|
-
}, [
|
|
238
|
-
createElementVNode("span", _hoisted_4, toDisplayString(_ctx.indexList[_ctx.currentIndex][_ctx.acceptKey]), 1)
|
|
239
|
-
], 4)), [
|
|
240
|
-
[vShow, _ctx.scrollY > 0]
|
|
241
|
-
]) : createCommentVNode("", true)
|
|
242
|
-
], 4),
|
|
243
|
-
_ctx.indexList.length ? withDirectives((openBlock(), createElementBlock("view", {
|
|
259
|
+
createElementVNode("span", _hoisted_4, toDisplayString(_ctx.indexList[_ctx.currentIndex][_ctx.acceptKey]), 1)
|
|
260
|
+
], 4)), [
|
|
261
|
+
[vShow, _ctx.scrollY > 0]
|
|
262
|
+
]) : createCommentVNode("", true)
|
|
263
|
+
]),
|
|
264
|
+
_: 3
|
|
265
|
+
}, 8, ["scroll-top", "style", "onScroll"]),
|
|
266
|
+
createTextVNode(),
|
|
267
|
+
_ctx.indexList.length > 0 ? withDirectives((openBlock(), createElementBlock("view", {
|
|
244
268
|
key: 0,
|
|
245
269
|
class: "nut-elevator__code--current"
|
|
246
270
|
}, toDisplayString(_ctx.indexList[_ctx.codeIndex][_ctx.acceptKey]), 513)), [
|
|
247
271
|
[vShow, _ctx.scrollStart]
|
|
248
272
|
]) : createCommentVNode("", true),
|
|
273
|
+
createTextVNode(),
|
|
249
274
|
createElementVNode("view", {
|
|
250
275
|
class: "nut-elevator__bars",
|
|
251
276
|
onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.touchStart && _ctx.touchStart(...args)),
|
|
@@ -253,10 +278,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
253
278
|
onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.touchEnd && _ctx.touchEnd(...args))
|
|
254
279
|
}, [
|
|
255
280
|
createElementVNode("view", _hoisted_5, [
|
|
256
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item,
|
|
281
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item, index) => {
|
|
257
282
|
return openBlock(), createElementBlock("view", {
|
|
258
283
|
class: normalizeClass(["nut-elevator__bars__inner__item", { active: item[_ctx.acceptKey] === _ctx.indexList[_ctx.currentIndex][_ctx.acceptKey] }]),
|
|
259
|
-
"data-index":
|
|
284
|
+
"data-index": index,
|
|
260
285
|
key: item[_ctx.acceptKey],
|
|
261
286
|
onClick: ($event) => _ctx.handleClickIndex(item[_ctx.acceptKey])
|
|
262
287
|
}, toDisplayString(item[_ctx.acceptKey]), 11, _hoisted_6);
|
|
@@ -265,5 +290,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
265
290
|
], 32)
|
|
266
291
|
], 2);
|
|
267
292
|
}
|
|
268
|
-
var
|
|
269
|
-
export {
|
|
293
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
294
|
+
export { index_taro as default };
|