@nutui/nutui 3.1.19 → 3.1.21-beta.0
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/package.json +1 -1
- package/dist/nutui.es.js +0 -18271
- package/dist/nutui.umd.js +0 -18375
- package/dist/packages/_es/ActionSheet.js +0 -175
- package/dist/packages/_es/Address.js +0 -568
- package/dist/packages/_es/AddressList.js +0 -616
- package/dist/packages/_es/Audio.js +0 -290
- package/dist/packages/_es/AudioOperate.js +0 -126
- package/dist/packages/_es/Avatar.js +0 -183
- package/dist/packages/_es/AvatarGroup.js +0 -78
- package/dist/packages/_es/BackTop.js +0 -163
- package/dist/packages/_es/Badge.js +0 -91
- package/dist/packages/_es/Barrage.js +0 -119
- package/dist/packages/_es/Button.js +0 -134
- package/dist/packages/_es/Calendar.js +0 -243
- package/dist/packages/_es/CalendarItem.js +0 -11
- package/dist/packages/_es/Card.js +0 -112
- package/dist/packages/_es/Cascader.js +0 -546
- package/dist/packages/_es/Category.js +0 -63
- package/dist/packages/_es/CategoryPane.js +0 -116
- package/dist/packages/_es/Cell.js +0 -103
- package/dist/packages/_es/CellGroup.js +0 -49
- package/dist/packages/_es/Checkbox.js +0 -120
- package/dist/packages/_es/CheckboxGroup.js +0 -63
- package/dist/packages/_es/CircleProgress.js +0 -156
- package/dist/packages/_es/Col.js +0 -61
- package/dist/packages/_es/Collapse.js +0 -90
- package/dist/packages/_es/CollapseItem.js +0 -279
- package/dist/packages/_es/Comment.js +0 -440
- package/dist/packages/_es/CountDown.js +0 -264
- package/dist/packages/_es/CountUp.js +0 -568
- package/dist/packages/_es/DatePicker.js +0 -343
- package/dist/packages/_es/Dialog.js +0 -286
- package/dist/packages/_es/Divider.js +0 -50
- package/dist/packages/_es/Drag.js +0 -204
- package/dist/packages/_es/Ecard.js +0 -164
- package/dist/packages/_es/Elevator.js +0 -215
- package/dist/packages/_es/Empty.js +0 -76
- package/dist/packages/_es/FixedNav.js +0 -127
- package/dist/packages/_es/Form.js +0 -153
- package/dist/packages/_es/FormItem.js +0 -115
- package/dist/packages/_es/Grid.js +0 -13
- package/dist/packages/_es/GridItem.js +0 -150
- package/dist/packages/_es/Icon.js +0 -45
- package/dist/packages/_es/ImagePreview.js +0 -326
- package/dist/packages/_es/Indicator.js +0 -67
- package/dist/packages/_es/InfiniteLoading.js +0 -268
- package/dist/packages/_es/Input.js +0 -420
- package/dist/packages/_es/InputNumber.js +0 -165
- package/dist/packages/_es/Layout.js +0 -11
- package/dist/packages/_es/List.js +0 -128
- package/dist/packages/_es/Menu.js +0 -120
- package/dist/packages/_es/MenuItem.js +0 -169
- package/dist/packages/_es/Navbar.js +0 -100
- package/dist/packages/_es/NoticeBar.js +0 -404
- package/dist/packages/_es/Notify.js +0 -255
- package/dist/packages/_es/NumberKeyboard.js +0 -261
- package/dist/packages/_es/OldPicker.js +0 -485
- package/dist/packages/_es/OverLay.js +0 -119
- package/dist/packages/_es/Pagination.js +0 -165
- package/dist/packages/_es/Picker.js +0 -477
- package/dist/packages/_es/Popover.js +0 -208
- package/dist/packages/_es/Popup.js +0 -317
- package/dist/packages/_es/Price.js +0 -123
- package/dist/packages/_es/Progress.js +0 -151
- package/dist/packages/_es/PullRefresh.js +0 -364
- package/dist/packages/_es/Radio.js +0 -96
- package/dist/packages/_es/RadioGroup.js +0 -42
- package/dist/packages/_es/Range.js +0 -433
- package/dist/packages/_es/Rate.js +0 -144
- package/dist/packages/_es/Row.js +0 -69
- package/dist/packages/_es/SearchBar.js +0 -196
- package/dist/packages/_es/ShortPassword.js +0 -231
- package/dist/packages/_es/SideNavBar.js +0 -105
- package/dist/packages/_es/SideNavBarItem.js +0 -51
- package/dist/packages/_es/Signature.js +0 -185
- package/dist/packages/_es/Skeleton.js +0 -141
- package/dist/packages/_es/Sku.js +0 -517
- package/dist/packages/_es/Step.js +0 -138
- package/dist/packages/_es/Steps.js +0 -58
- package/dist/packages/_es/Sticky.js +0 -144
- package/dist/packages/_es/SubSideNavBar.js +0 -105
- package/dist/packages/_es/Swipe.js +0 -207
- package/dist/packages/_es/Swiper.js +0 -430
- package/dist/packages/_es/SwiperItem.js +0 -56
- package/dist/packages/_es/Switch.js +0 -121
- package/dist/packages/_es/TabPane.js +0 -40
- package/dist/packages/_es/Tabbar.js +0 -78
- package/dist/packages/_es/TabbarItem.js +0 -158
- package/dist/packages/_es/Table.js +0 -201
- package/dist/packages/_es/Tabs.js +0 -221
- package/dist/packages/_es/Tag.js +0 -102
- package/dist/packages/_es/TextArea.js +0 -166
- package/dist/packages/_es/TimeDetail.js +0 -103
- package/dist/packages/_es/TimePannel.js +0 -71
- package/dist/packages/_es/TimeSelect.js +0 -108
- package/dist/packages/_es/Toast.js +0 -335
- package/dist/packages/_es/Uploader.js +0 -494
- package/dist/packages/_es/Video.js +0 -357
- package/dist/packages/_es/common.js +0 -136
- package/dist/packages/_es/component.js +0 -102
- package/dist/packages/_es/index.js +0 -11
- package/dist/packages/_es/index2.js +0 -36
- package/dist/packages/_es/index3.js +0 -13
- package/dist/packages/_es/index4.js +0 -64
- package/dist/packages/_es/index5.js +0 -692
- package/dist/packages/_es/plugin-vue_export-helper.js +0 -13
- package/dist/packages/_es/pxCheck.js +0 -9
- package/dist/packages/_es/raf.js +0 -19
- package/dist/packages/_es/style.css +0 -111
- package/dist/packages/actionsheet/index.scss +0 -73
- package/dist/packages/address/index.scss +0 -155
- package/dist/packages/addresslist/index.scss +0 -144
- package/dist/packages/audio/index.scss +0 -66
- package/dist/packages/audiooperate/index.scss +0 -13
- package/dist/packages/avatar/index.scss +0 -53
- package/dist/packages/avatargroup/index.scss +0 -14
- package/dist/packages/backtop/index.scss +0 -20
- package/dist/packages/badge/index.scss +0 -33
- package/dist/packages/barrage/index.scss +0 -48
- package/dist/packages/button/index.scss +0 -169
- package/dist/packages/calendar/index.scss +0 -212
- package/dist/packages/calendaritem/index.scss +0 -0
- package/dist/packages/card/index.scss +0 -97
- package/dist/packages/cascader/index.scss +0 -81
- package/dist/packages/category/index.scss +0 -38
- package/dist/packages/categorypane/index.scss +0 -124
- package/dist/packages/cell/index.scss +0 -76
- package/dist/packages/cellgroup/index.scss +0 -38
- package/dist/packages/checkbox/index.scss +0 -31
- package/dist/packages/checkboxgroup/index.scss +0 -0
- package/dist/packages/circleprogress/index.scss +0 -24
- package/dist/packages/col/index.scss +0 -24
- package/dist/packages/collapse/index.scss +0 -0
- package/dist/packages/collapseitem/index.scss +0 -143
- package/dist/packages/comment/index.scss +0 -353
- package/dist/packages/countdown/index.scss +0 -5
- package/dist/packages/countup/index.scss +0 -67
- package/dist/packages/datepicker/index.scss +0 -2
- package/dist/packages/dialog/index.scss +0 -65
- package/dist/packages/divider/index.scss +0 -54
- package/dist/packages/drag/index.scss +0 -18
- package/dist/packages/ecard/index.scss +0 -83
- package/dist/packages/elevator/index.scss +0 -73
- package/dist/packages/empty/index.scss +0 -33
- package/dist/packages/fixednav/index.scss +0 -134
- package/dist/packages/form/index.scss +0 -2
- package/dist/packages/formitem/index.scss +0 -70
- package/dist/packages/grid/index.scss +0 -10
- package/dist/packages/griditem/index.scss +0 -92
- package/dist/packages/icon/index.scss +0 -131
- package/dist/packages/imagepreview/index.scss +0 -49
- package/dist/packages/indicator/index.scss +0 -48
- package/dist/packages/infiniteloading/index.scss +0 -47
- package/dist/packages/input/index.scss +0 -126
- package/dist/packages/inputnumber/index.scss +0 -38
- package/dist/packages/layout/index.scss +0 -0
- package/dist/packages/list/index.scss +0 -24
- package/dist/packages/locale/index.d.ts +0 -3
- package/dist/packages/locale/index.scss +0 -1
- package/dist/packages/locale/lang/baseLang.js +0 -8
- package/dist/packages/locale/lang/en-US.js +0 -91
- package/dist/packages/locale/lang/index.js +0 -48
- package/dist/packages/locale/lang/index.scss +0 -1
- package/dist/packages/locale/lang/zh-CN.js +0 -91
- package/dist/packages/locale/lang/zh-TW.js +0 -91
- package/dist/packages/locale/locale/index.d.ts +0 -8
- package/dist/packages/locale/locale/lang/baseLang.d.ts +0 -82
- package/dist/packages/locale/locale/lang/en-US.d.ts +0 -83
- package/dist/packages/locale/locale/lang/zh-CN.d.ts +0 -83
- package/dist/packages/locale/locale/lang/zh-TW.d.ts +0 -83
- package/dist/packages/menu/index.scss +0 -49
- package/dist/packages/menuitem/index.scss +0 -47
- package/dist/packages/navbar/index.scss +0 -124
- package/dist/packages/noticebar/index.scss +0 -114
- package/dist/packages/notify/index.scss +0 -62
- package/dist/packages/numberkeyboard/index.scss +0 -109
- package/dist/packages/oldpicker/index.scss +0 -131
- package/dist/packages/overlay/index.scss +0 -22
- package/dist/packages/pagination/index.scss +0 -50
- package/dist/packages/picker/index.scss +0 -128
- package/dist/packages/popover/index.scss +0 -133
- package/dist/packages/popup/index.scss +0 -132
- package/dist/packages/price/index.scss +0 -59
- package/dist/packages/progress/index.scss +0 -104
- package/dist/packages/pullrefresh/index.scss +0 -71
- package/dist/packages/radio/index.scss +0 -59
- package/dist/packages/radiogroup/index.scss +0 -22
- package/dist/packages/range/index.scss +0 -202
- package/dist/packages/rate/index.scss +0 -35
- package/dist/packages/row/index.scss +0 -54
- package/dist/packages/searchbar/index.scss +0 -98
- package/dist/packages/shortpassword/index.scss +0 -169
- package/dist/packages/sidenavbar/index.scss +0 -14
- package/dist/packages/sidenavbaritem/index.scss +0 -10
- package/dist/packages/signature/index.scss +0 -14
- package/dist/packages/skeleton/index.scss +0 -57
- package/dist/packages/sku/index.scss +0 -147
- package/dist/packages/step/index.scss +0 -190
- package/dist/packages/steps/index.scss +0 -7
- package/dist/packages/sticky/index.scss +0 -5
- package/dist/packages/subsidenavbar/index.scss +0 -41
- package/dist/packages/swipe/index.scss +0 -22
- package/dist/packages/swiper/index.scss +0 -45
- package/dist/packages/swiperitem/index.scss +0 -3
- package/dist/packages/switch/index.scss +0 -60
- package/dist/packages/tabbar/index.scss +0 -27
- package/dist/packages/tabbaritem/index.scss +0 -79
- package/dist/packages/table/index.scss +0 -81
- package/dist/packages/tabpane/index.scss +0 -12
- package/dist/packages/tabs/index.scss +0 -166
- package/dist/packages/tag/index.scss +0 -48
- package/dist/packages/textarea/index.scss +0 -40
- package/dist/packages/timedetail/index.scss +0 -38
- package/dist/packages/timepannel/index.scss +0 -16
- package/dist/packages/timeselect/index.scss +0 -37
- package/dist/packages/toast/index.scss +0 -98
- package/dist/packages/uploader/index.scss +0 -157
- package/dist/packages/video/index.scss +0 -205
- package/dist/smartips/attributes.json +0 -2542
- package/dist/smartips/tags.json +0 -955
- package/dist/style.css +0 -1
- package/dist/style.es.js +0 -2
- package/dist/styles/animation/drop.scss +0 -24
- package/dist/styles/animation/ease.scss +0 -23
- package/dist/styles/animation/fade.scss +0 -20
- package/dist/styles/animation/icon.scss +0 -245
- package/dist/styles/animation/index.scss +0 -7
- package/dist/styles/animation/rotate.scss +0 -10
- package/dist/styles/animation/zoom.scss +0 -26
- package/dist/styles/font/config.json +0 -167
- package/dist/styles/font/demo.css +0 -539
- package/dist/styles/font/demo_index.html +0 -2879
- package/dist/styles/font/iconfont.css +0 -483
- package/dist/styles/font/iconfont.eot +0 -0
- package/dist/styles/font/iconfont.js +0 -63
- package/dist/styles/font/iconfont.json +0 -828
- package/dist/styles/font/iconfont.svg +0 -356
- package/dist/styles/font/iconfont.ttf +0 -0
- package/dist/styles/font/iconfont.woff +0 -0
- package/dist/styles/font/iconfont.woff2 +0 -0
- package/dist/styles/mixins/index.scss +0 -2
- package/dist/styles/mixins/make-animation.scss +0 -24
- package/dist/styles/mixins/text-ellipsis.scss +0 -20
- package/dist/styles/themes/default.scss +0 -97
- package/dist/styles/themes/jdt.scss +0 -97
- package/dist/styles/variables-jdt.scss +0 -750
- package/dist/styles/variables.scss +0 -774
- package/dist/types/__VUE/actionsheet/index.d.ts +0 -273
- package/dist/types/__VUE/address/index.d.ts +0 -394
- package/dist/types/__VUE/addresslist/components/GeneralShell.d.ts +0 -28
- package/dist/types/__VUE/addresslist/components/ItemContents.d.ts +0 -35
- package/dist/types/__VUE/addresslist/components/LongPressShell.d.ts +0 -40
- package/dist/types/__VUE/addresslist/components/SwipeShell.d.ts +0 -30
- package/dist/types/__VUE/addresslist/index.d.ts +0 -74
- package/dist/types/__VUE/audio/index.d.ts +0 -85
- package/dist/types/__VUE/audiooperate/index.d.ts +0 -61
- package/dist/types/__VUE/avatar/index.d.ts +0 -103
- package/dist/types/__VUE/avatargroup/index.d.ts +0 -86
- package/dist/types/__VUE/backtop/index.d.ts +0 -98
- package/dist/types/__VUE/badge/index.d.ts +0 -87
- package/dist/types/__VUE/barrage/index.d.ts +0 -73
- package/dist/types/__VUE/button/index.d.ts +0 -113
- package/dist/types/__VUE/calendar/index.d.ts +0 -148
- package/dist/types/__VUE/calendaritem/index.d.ts +0 -200
- package/dist/types/__VUE/card/index.d.ts +0 -83
- package/dist/types/__VUE/cascader/cascader-item.d.ts +0 -71
- package/dist/types/__VUE/cascader/helper.d.ts +0 -8
- package/dist/types/__VUE/cascader/index.d.ts +0 -235
- package/dist/types/__VUE/cascader/tree.d.ts +0 -16
- package/dist/types/__VUE/cascader/types.d.ts +0 -30
- package/dist/types/__VUE/category/index.d.ts +0 -32
- package/dist/types/__VUE/categorypane/index.d.ts +0 -38
- package/dist/types/__VUE/cell/index.d.ts +0 -102
- package/dist/types/__VUE/cellgroup/index.d.ts +0 -31
- package/dist/types/__VUE/checkbox/index.d.ts +0 -95
- package/dist/types/__VUE/checkboxgroup/index.d.ts +0 -32
- package/dist/types/__VUE/circleprogress/index.d.ts +0 -87
- package/dist/types/__VUE/col/index.d.ts +0 -38
- package/dist/types/__VUE/collapse/index.d.ts +0 -97
- package/dist/types/__VUE/collapseitem/index.d.ts +0 -76
- package/dist/types/__VUE/comment/components/CmtBottom.d.ts +0 -45
- package/dist/types/__VUE/comment/components/CmtHeader.d.ts +0 -40
- package/dist/types/__VUE/comment/components/CmtImages.d.ts +0 -44
- package/dist/types/__VUE/comment/index.d.ts +0 -103
- package/dist/types/__VUE/countdown/index.d.ts +0 -98
- package/dist/types/__VUE/countdown/util.d.ts +0 -6
- package/dist/types/__VUE/countup/index.d.ts +0 -209
- package/dist/types/__VUE/datepicker/index.d.ts +0 -354
- package/dist/types/__VUE/datepicker/utils.d.ts +0 -5
- package/dist/types/__VUE/dialog/index.d.ts +0 -299
- package/dist/types/__VUE/divider/index.d.ts +0 -40
- package/dist/types/__VUE/drag/index.d.ts +0 -54
- package/dist/types/__VUE/ecard/index.d.ts +0 -118
- package/dist/types/__VUE/elevator/index.d.ts +0 -70
- package/dist/types/__VUE/empty/index.d.ts +0 -40
- package/dist/types/__VUE/fixednav/index.d.ts +0 -89
- package/dist/types/__VUE/form/common.d.ts +0 -20
- package/dist/types/__VUE/form/index.d.ts +0 -25
- package/dist/types/__VUE/form/types.d.ts +0 -13
- package/dist/types/__VUE/formitem/index.d.ts +0 -115
- package/dist/types/__VUE/formitem/types.d.ts +0 -10
- package/dist/types/__VUE/grid/common.d.ts +0 -91
- package/dist/types/__VUE/grid/index.d.ts +0 -93
- package/dist/types/__VUE/griditem/index.d.ts +0 -74
- package/dist/types/__VUE/icon/index.d.ts +0 -68
- package/dist/types/__VUE/imagepreview/index.d.ts +0 -118
- package/dist/types/__VUE/indicator/index.d.ts +0 -63
- package/dist/types/__VUE/infiniteloading/index.d.ts +0 -133
- package/dist/types/__VUE/input/index.d.ts +0 -339
- package/dist/types/__VUE/input/util.d.ts +0 -5
- package/dist/types/__VUE/inputnumber/index.d.ts +0 -110
- package/dist/types/__VUE/layout/index.d.ts +0 -6
- package/dist/types/__VUE/list/index.d.ts +0 -50
- package/dist/types/__VUE/menu/index.d.ts +0 -45
- package/dist/types/__VUE/menuitem/index.d.ts +0 -75
- package/dist/types/__VUE/navbar/index.d.ts +0 -76
- package/dist/types/__VUE/noticebar/index.d.ts +0 -202
- package/dist/types/__VUE/notify/index.d.ts +0 -106
- package/dist/types/__VUE/numberkeyboard/index.d.ts +0 -118
- package/dist/types/__VUE/oldpicker/Column.d.ts +0 -89
- package/dist/types/__VUE/oldpicker/commonProps.d.ts +0 -22
- package/dist/types/__VUE/oldpicker/index.d.ts +0 -363
- package/dist/types/__VUE/oldpicker/types.d.ts +0 -24
- package/dist/types/__VUE/overlay/index.d.ts +0 -1638
- package/dist/types/__VUE/pagination/index.d.ts +0 -105
- package/dist/types/__VUE/picker/Column.d.ts +0 -85
- package/dist/types/__VUE/picker/index.d.ts +0 -347
- package/dist/types/__VUE/picker/types.d.ts +0 -26
- package/dist/types/__VUE/popover/index.d.ts +0 -238
- package/dist/types/__VUE/popup/index.d.ts +0 -1817
- package/dist/types/__VUE/popup/use-lock-scroll.d.ts +0 -5
- package/dist/types/__VUE/price/index.d.ts +0 -80
- package/dist/types/__VUE/progress/index.d.ts +0 -131
- package/dist/types/__VUE/pullrefresh/index.d.ts +0 -122
- package/dist/types/__VUE/pullrefresh/use-touch.d.ts +0 -20
- package/dist/types/__VUE/pullrefresh/util.d.ts +0 -6
- package/dist/types/__VUE/radio/index.d.ts +0 -83
- package/dist/types/__VUE/radiogroup/index.d.ts +0 -41
- package/dist/types/__VUE/range/index.d.ts +0 -151
- package/dist/types/__VUE/rate/index.d.ts +0 -135
- package/dist/types/__VUE/row/index.d.ts +0 -59
- package/dist/types/__VUE/searchbar/index.d.ts +0 -93
- package/dist/types/__VUE/shortpassword/index.d.ts +0 -130
- package/dist/types/__VUE/sidenavbar/index.d.ts +0 -30
- package/dist/types/__VUE/sidenavbaritem/index.d.ts +0 -34
- package/dist/types/__VUE/signature/index.d.ts +0 -67
- package/dist/types/__VUE/skeleton/common.d.ts +0 -63
- package/dist/types/__VUE/skeleton/index.d.ts +0 -110
- package/dist/types/__VUE/sku/components/SkuHeader.d.ts +0 -21
- package/dist/types/__VUE/sku/components/SkuOperate.d.ts +0 -63
- package/dist/types/__VUE/sku/components/SkuSelect.d.ts +0 -23
- package/dist/types/__VUE/sku/components/SkuStepper.d.ts +0 -60
- package/dist/types/__VUE/sku/index.d.ts +0 -303
- package/dist/types/__VUE/step/index.d.ts +0 -63
- package/dist/types/__VUE/steps/index.d.ts +0 -40
- package/dist/types/__VUE/sticky/index.d.ts +0 -57
- package/dist/types/__VUE/subsidenavbar/index.d.ts +0 -47
- package/dist/types/__VUE/swipe/index.d.ts +0 -64
- package/dist/types/__VUE/swiper/index.d.ts +0 -157
- package/dist/types/__VUE/swiper/use-touch.d.ts +0 -20
- package/dist/types/__VUE/swiperitem/index.d.ts +0 -22
- package/dist/types/__VUE/switch/index.d.ts +0 -129
- package/dist/types/__VUE/tabbar/index.d.ts +0 -77
- package/dist/types/__VUE/tabbaritem/index.d.ts +0 -101
- package/dist/types/__VUE/table/common.d.ts +0 -56
- package/dist/types/__VUE/table/index.d.ts +0 -69
- package/dist/types/__VUE/table/renderColumn.d.ts +0 -21
- package/dist/types/__VUE/table/types.d.ts +0 -19
- package/dist/types/__VUE/tabpane/index.d.ts +0 -40
- package/dist/types/__VUE/tabs/common.d.ts +0 -78
- package/dist/types/__VUE/tabs/index.d.ts +0 -119
- package/dist/types/__VUE/tag/index.d.ts +0 -84
- package/dist/types/__VUE/textarea/index.d.ts +0 -114
- package/dist/types/__VUE/timedetail/index.d.ts +0 -41
- package/dist/types/__VUE/timepannel/index.d.ts +0 -36
- package/dist/types/__VUE/timeselect/index.d.ts +0 -76
- package/dist/types/__VUE/toast/index.d.ts +0 -142
- package/dist/types/__VUE/uploader/index.d.ts +0 -262
- package/dist/types/__VUE/uploader/uploader.d.ts +0 -25
- package/dist/types/__VUE/video/index.d.ts +0 -116
- package/dist/types/index.d.ts +0 -3
- package/dist/types/nutui.d.ts +0 -99
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
/*!
|
|
21
|
-
* @nutui/nutui v3.1.19 Mon Apr 25 2022 17:26:38 GMT+0800 (中国标准时间)
|
|
22
|
-
* (c) 2022 @jdf2e.
|
|
23
|
-
* Released under the MIT License.
|
|
24
|
-
*/
|
|
25
|
-
import { ref, reactive, onMounted, watch, provide, toRefs, resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, createVNode, withCtx, createCommentVNode, normalizeClass, createBlock, renderSlot } from "vue";
|
|
26
|
-
import { c as createComponent } from "./component.js";
|
|
27
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
28
|
-
import "../locale/lang";
|
|
29
|
-
const { componentName, create } = createComponent("audio");
|
|
30
|
-
const _sfc_main = create({
|
|
31
|
-
props: {
|
|
32
|
-
url: {
|
|
33
|
-
type: String,
|
|
34
|
-
default() {
|
|
35
|
-
return "";
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
muted: {
|
|
39
|
-
type: Boolean,
|
|
40
|
-
default() {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
autoplay: {
|
|
45
|
-
type: Boolean,
|
|
46
|
-
default() {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
loop: {
|
|
51
|
-
type: Boolean,
|
|
52
|
-
default() {
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
preload: {
|
|
57
|
-
type: String,
|
|
58
|
-
default() {
|
|
59
|
-
return "auto";
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
second: {
|
|
63
|
-
type: Number,
|
|
64
|
-
default() {
|
|
65
|
-
return 0;
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
type: {
|
|
69
|
-
type: String,
|
|
70
|
-
default() {
|
|
71
|
-
return "progress";
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
components: {},
|
|
76
|
-
emits: ["fastBack", "play", "forward", "ended", "changeProgress", "mute"],
|
|
77
|
-
setup(props, { emit }) {
|
|
78
|
-
const audioRef = ref(null);
|
|
79
|
-
const audioData = reactive({
|
|
80
|
-
currentTime: 0,
|
|
81
|
-
currentDuration: "00:00:00",
|
|
82
|
-
percent: 0,
|
|
83
|
-
duration: "00:00:00",
|
|
84
|
-
second: 0,
|
|
85
|
-
hanMuted: props.muted,
|
|
86
|
-
playing: props.autoplay
|
|
87
|
-
});
|
|
88
|
-
onMounted(() => {
|
|
89
|
-
var arr = ["webkitVisibilityState", "visibilitychange"];
|
|
90
|
-
try {
|
|
91
|
-
for (let i = 0; i < arr.length; i++) {
|
|
92
|
-
document.addEventListener(arr[i], () => {
|
|
93
|
-
if (document.hidden) {
|
|
94
|
-
audioRef.value.pause();
|
|
95
|
-
} else {
|
|
96
|
-
if (audioData.playing) {
|
|
97
|
-
setTimeout(() => {
|
|
98
|
-
audioRef.value.play();
|
|
99
|
-
}, 200);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
} catch (e) {
|
|
105
|
-
console.log(e.message);
|
|
106
|
-
}
|
|
107
|
-
setTimeout(() => {
|
|
108
|
-
if (props.autoplay) {
|
|
109
|
-
if (audioRef.value && audioRef.value.paused) {
|
|
110
|
-
audioRef.value.play();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
audioData.second = audioRef.value.duration;
|
|
114
|
-
audioData.duration = formatSeconds(audioRef.value.duration);
|
|
115
|
-
}, 500);
|
|
116
|
-
});
|
|
117
|
-
const onTimeupdate = (e) => {
|
|
118
|
-
audioData.currentTime = parseInt(e.target.currentTime);
|
|
119
|
-
};
|
|
120
|
-
const fastBack = () => {
|
|
121
|
-
audioData.currentTime--;
|
|
122
|
-
audioRef.value.currentTime = audioData.currentTime;
|
|
123
|
-
emit("fastBack", audioData.currentTime);
|
|
124
|
-
};
|
|
125
|
-
const changeStatus = () => {
|
|
126
|
-
if (audioData.playing) {
|
|
127
|
-
audioRef.value.pause();
|
|
128
|
-
audioData.handPlaying = false;
|
|
129
|
-
} else {
|
|
130
|
-
audioRef.value.play();
|
|
131
|
-
audioData.handPlaying = true;
|
|
132
|
-
}
|
|
133
|
-
audioData.playing = !audioData.playing;
|
|
134
|
-
emit("play", audioData.playing);
|
|
135
|
-
};
|
|
136
|
-
const forward = () => {
|
|
137
|
-
audioData.currentTime++;
|
|
138
|
-
audioRef.value.currentTime = audioData.currentTime;
|
|
139
|
-
emit("forward", audioData.currentTime);
|
|
140
|
-
};
|
|
141
|
-
const handle = (val) => {
|
|
142
|
-
audioData.currentDuration = formatSeconds(val);
|
|
143
|
-
audioData.percent = val / audioData.second * 100;
|
|
144
|
-
};
|
|
145
|
-
const audioEnd = () => {
|
|
146
|
-
audioData.playing = false;
|
|
147
|
-
emit("ended");
|
|
148
|
-
};
|
|
149
|
-
const progressChange = (val) => {
|
|
150
|
-
audioRef.value.currentTime = audioData.second * val / 100;
|
|
151
|
-
emit("changeProgress", audioRef.value.currentTime);
|
|
152
|
-
};
|
|
153
|
-
const handleMute = () => {
|
|
154
|
-
audioData.hanMuted = !audioData.hanMuted;
|
|
155
|
-
emit("mute", audioData.hanMuted);
|
|
156
|
-
};
|
|
157
|
-
const formatSeconds = (value) => {
|
|
158
|
-
let theTime = parseInt(value);
|
|
159
|
-
let theTime1 = 0;
|
|
160
|
-
let theTime2 = 0;
|
|
161
|
-
if (theTime > 60) {
|
|
162
|
-
theTime1 = parseInt(theTime / 60);
|
|
163
|
-
theTime = parseInt(theTime % 60);
|
|
164
|
-
if (theTime1 > 60) {
|
|
165
|
-
theTime2 = parseInt(theTime1 / 60);
|
|
166
|
-
theTime1 = parseInt(theTime1 % 60);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
let result = "" + parseInt(theTime);
|
|
170
|
-
if (result < 10) {
|
|
171
|
-
result = "0" + result;
|
|
172
|
-
}
|
|
173
|
-
if (theTime1 > 0) {
|
|
174
|
-
result = "" + parseInt(theTime1) + ":" + result;
|
|
175
|
-
if (theTime1 < 10) {
|
|
176
|
-
result = "0" + result;
|
|
177
|
-
}
|
|
178
|
-
} else {
|
|
179
|
-
result = "00:" + result;
|
|
180
|
-
}
|
|
181
|
-
if (theTime2 > 0) {
|
|
182
|
-
result = "" + parseInt(theTime2) + ":" + result;
|
|
183
|
-
if (theTime2 < 10) {
|
|
184
|
-
result = "0" + result;
|
|
185
|
-
}
|
|
186
|
-
} else {
|
|
187
|
-
result = "00:" + result;
|
|
188
|
-
}
|
|
189
|
-
return result;
|
|
190
|
-
};
|
|
191
|
-
watch(() => audioData.currentTime, (value) => {
|
|
192
|
-
handle(value);
|
|
193
|
-
});
|
|
194
|
-
provide("audioParent", {
|
|
195
|
-
children: [],
|
|
196
|
-
props,
|
|
197
|
-
audioData,
|
|
198
|
-
handleMute,
|
|
199
|
-
forward,
|
|
200
|
-
fastBack,
|
|
201
|
-
changeStatus
|
|
202
|
-
});
|
|
203
|
-
return __spreadProps(__spreadValues(__spreadValues({}, toRefs(props)), toRefs(audioData)), {
|
|
204
|
-
audioRef,
|
|
205
|
-
fastBack,
|
|
206
|
-
forward,
|
|
207
|
-
changeStatus,
|
|
208
|
-
progressChange,
|
|
209
|
-
audioEnd,
|
|
210
|
-
onTimeupdate,
|
|
211
|
-
handleMute
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
const _hoisted_1 = { class: "nut-audio" };
|
|
216
|
-
const _hoisted_2 = {
|
|
217
|
-
key: 0,
|
|
218
|
-
class: "progress-wrapper"
|
|
219
|
-
};
|
|
220
|
-
const _hoisted_3 = { class: "time" };
|
|
221
|
-
const _hoisted_4 = { class: "progress-bar-wrapper" };
|
|
222
|
-
const _hoisted_5 = /* @__PURE__ */ createElementVNode("div", { class: "custom-button" }, null, -1);
|
|
223
|
-
const _hoisted_6 = { class: "time" };
|
|
224
|
-
const _hoisted_7 = {
|
|
225
|
-
key: 1,
|
|
226
|
-
class: "nut-audio-icon"
|
|
227
|
-
};
|
|
228
|
-
const _hoisted_8 = ["controls", "src", "preload", "autoplay", "loop", "muted"];
|
|
229
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
230
|
-
const _component_nut_range = resolveComponent("nut-range");
|
|
231
|
-
const _component_nut_icon = resolveComponent("nut-icon");
|
|
232
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
233
|
-
_ctx.type == "progress" ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
234
|
-
createElementVNode("div", _hoisted_3, toDisplayString(_ctx.currentDuration), 1),
|
|
235
|
-
createElementVNode("div", _hoisted_4, [
|
|
236
|
-
createVNode(_component_nut_range, {
|
|
237
|
-
modelValue: _ctx.percent,
|
|
238
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.percent = $event),
|
|
239
|
-
"hidden-range": "",
|
|
240
|
-
onChange: _ctx.progressChange,
|
|
241
|
-
"inactive-color": "#cccccc",
|
|
242
|
-
"active-color": "#fa2c19"
|
|
243
|
-
}, {
|
|
244
|
-
button: withCtx(() => [
|
|
245
|
-
_hoisted_5
|
|
246
|
-
]),
|
|
247
|
-
_: 1
|
|
248
|
-
}, 8, ["modelValue", "onChange"])
|
|
249
|
-
]),
|
|
250
|
-
createElementVNode("div", _hoisted_6, toDisplayString(_ctx.duration), 1)
|
|
251
|
-
])) : createCommentVNode("", true),
|
|
252
|
-
_ctx.type == "icon" ? (openBlock(), createElementBlock("div", _hoisted_7, [
|
|
253
|
-
createElementVNode("div", {
|
|
254
|
-
class: normalizeClass(["nut-audio-icon-box", _ctx.playing ? "nut-audio-icon-play" : "nut-audio-icon-stop"]),
|
|
255
|
-
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.changeStatus && _ctx.changeStatus(...args))
|
|
256
|
-
}, [
|
|
257
|
-
_ctx.playing ? (openBlock(), createBlock(_component_nut_icon, {
|
|
258
|
-
key: 0,
|
|
259
|
-
name: "service",
|
|
260
|
-
class: "nut-icon-am-rotate nut-icon-am-infinite"
|
|
261
|
-
})) : createCommentVNode("", true),
|
|
262
|
-
!_ctx.playing ? (openBlock(), createBlock(_component_nut_icon, {
|
|
263
|
-
key: 1,
|
|
264
|
-
name: "service"
|
|
265
|
-
})) : createCommentVNode("", true)
|
|
266
|
-
], 2)
|
|
267
|
-
])) : createCommentVNode("", true),
|
|
268
|
-
_ctx.type == "none" ? (openBlock(), createElementBlock("div", {
|
|
269
|
-
key: 2,
|
|
270
|
-
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.changeStatus && _ctx.changeStatus(...args))
|
|
271
|
-
}, [
|
|
272
|
-
renderSlot(_ctx.$slots, "default")
|
|
273
|
-
])) : createCommentVNode("", true),
|
|
274
|
-
_ctx.type != "none" ? renderSlot(_ctx.$slots, "default", { key: 3 }) : createCommentVNode("", true),
|
|
275
|
-
createElementVNode("audio", {
|
|
276
|
-
class: "audioMain",
|
|
277
|
-
controls: _ctx.type == "controls",
|
|
278
|
-
ref: "audioRef",
|
|
279
|
-
src: _ctx.url,
|
|
280
|
-
preload: _ctx.preload,
|
|
281
|
-
autoplay: _ctx.autoplay,
|
|
282
|
-
loop: _ctx.loop,
|
|
283
|
-
onTimeupdate: _cache[3] || (_cache[3] = (...args) => _ctx.onTimeupdate && _ctx.onTimeupdate(...args)),
|
|
284
|
-
onEnded: _cache[4] || (_cache[4] = (...args) => _ctx.audioEnd && _ctx.audioEnd(...args)),
|
|
285
|
-
muted: _ctx.hanMuted
|
|
286
|
-
}, null, 40, _hoisted_8)
|
|
287
|
-
]);
|
|
288
|
-
}
|
|
289
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
290
|
-
export { index as default };
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
/*!
|
|
21
|
-
* @nutui/nutui v3.1.19 Mon Apr 25 2022 17:26:38 GMT+0800 (中国标准时间)
|
|
22
|
-
* (c) 2022 @jdf2e.
|
|
23
|
-
* Released under the MIT License.
|
|
24
|
-
*/
|
|
25
|
-
import { inject, reactive, ref, useSlots, toRefs, resolveComponent, openBlock, createElementBlock, createBlock, withCtx, createCommentVNode, renderSlot, createTextVNode, toDisplayString } from "vue";
|
|
26
|
-
import { c as createComponent } from "./component.js";
|
|
27
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
28
|
-
import "../locale/lang";
|
|
29
|
-
const { componentName, create } = createComponent("audio-operate");
|
|
30
|
-
const _sfc_main = create({
|
|
31
|
-
props: {
|
|
32
|
-
type: {
|
|
33
|
-
type: String,
|
|
34
|
-
default() {
|
|
35
|
-
return "play";
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
components: {},
|
|
40
|
-
emits: ["click"],
|
|
41
|
-
setup(props, { emit }) {
|
|
42
|
-
const audio = inject("audioParent");
|
|
43
|
-
const parent = reactive(audio);
|
|
44
|
-
const customSlot = ref(useSlots().default);
|
|
45
|
-
return __spreadProps(__spreadValues(__spreadValues({}, toRefs(props)), toRefs(parent)), { customSlot });
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
const _hoisted_1 = { class: "nut-audio-operate" };
|
|
49
|
-
const _hoisted_2 = /* @__PURE__ */ createTextVNode("\u5012\u9000");
|
|
50
|
-
const _hoisted_3 = /* @__PURE__ */ createTextVNode("\u5FEB\u8FDB");
|
|
51
|
-
const _hoisted_4 = /* @__PURE__ */ createTextVNode("\u9759\u97F3");
|
|
52
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
53
|
-
const _component_nut_button = resolveComponent("nut-button");
|
|
54
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
55
|
-
_ctx.type == "back" ? (openBlock(), createElementBlock("div", {
|
|
56
|
-
key: 0,
|
|
57
|
-
class: "nut-audio-operate-item",
|
|
58
|
-
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.fastBack && _ctx.fastBack(...args))
|
|
59
|
-
}, [
|
|
60
|
-
!_ctx.customSlot ? (openBlock(), createBlock(_component_nut_button, {
|
|
61
|
-
key: 0,
|
|
62
|
-
type: "primary",
|
|
63
|
-
size: "small"
|
|
64
|
-
}, {
|
|
65
|
-
default: withCtx(() => [
|
|
66
|
-
_hoisted_2
|
|
67
|
-
]),
|
|
68
|
-
_: 1
|
|
69
|
-
})) : createCommentVNode("", true),
|
|
70
|
-
renderSlot(_ctx.$slots, "default")
|
|
71
|
-
])) : createCommentVNode("", true),
|
|
72
|
-
_ctx.type == "play" ? (openBlock(), createElementBlock("div", {
|
|
73
|
-
key: 1,
|
|
74
|
-
class: "nut-audio-operate-item",
|
|
75
|
-
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.changeStatus && _ctx.changeStatus(...args))
|
|
76
|
-
}, [
|
|
77
|
-
!_ctx.customSlot ? (openBlock(), createBlock(_component_nut_button, {
|
|
78
|
-
key: 0,
|
|
79
|
-
type: "primary",
|
|
80
|
-
size: "small"
|
|
81
|
-
}, {
|
|
82
|
-
default: withCtx(() => [
|
|
83
|
-
createTextVNode(toDisplayString(!_ctx.audioData.playing ? "\u5F00\u59CB" : "\u6682\u505C"), 1)
|
|
84
|
-
]),
|
|
85
|
-
_: 1
|
|
86
|
-
})) : createCommentVNode("", true),
|
|
87
|
-
renderSlot(_ctx.$slots, "default")
|
|
88
|
-
])) : createCommentVNode("", true),
|
|
89
|
-
_ctx.type == "forward" ? (openBlock(), createElementBlock("div", {
|
|
90
|
-
key: 2,
|
|
91
|
-
class: "nut-audio-operate-item",
|
|
92
|
-
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.forward && _ctx.forward(...args))
|
|
93
|
-
}, [
|
|
94
|
-
!_ctx.customSlot ? (openBlock(), createBlock(_component_nut_button, {
|
|
95
|
-
key: 0,
|
|
96
|
-
type: "primary",
|
|
97
|
-
size: "small"
|
|
98
|
-
}, {
|
|
99
|
-
default: withCtx(() => [
|
|
100
|
-
_hoisted_3
|
|
101
|
-
]),
|
|
102
|
-
_: 1
|
|
103
|
-
})) : createCommentVNode("", true),
|
|
104
|
-
renderSlot(_ctx.$slots, "default")
|
|
105
|
-
])) : createCommentVNode("", true),
|
|
106
|
-
_ctx.type == "mute" ? (openBlock(), createElementBlock("div", {
|
|
107
|
-
key: 3,
|
|
108
|
-
class: "nut-audio-operate-item",
|
|
109
|
-
onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleMute && _ctx.handleMute(...args))
|
|
110
|
-
}, [
|
|
111
|
-
!_ctx.customSlot ? (openBlock(), createBlock(_component_nut_button, {
|
|
112
|
-
key: 0,
|
|
113
|
-
type: !_ctx.audioData.hanMuted ? "primary" : "default",
|
|
114
|
-
size: "small"
|
|
115
|
-
}, {
|
|
116
|
-
default: withCtx(() => [
|
|
117
|
-
_hoisted_4
|
|
118
|
-
]),
|
|
119
|
-
_: 1
|
|
120
|
-
}, 8, ["type"])) : createCommentVNode("", true),
|
|
121
|
-
renderSlot(_ctx.$slots, "default")
|
|
122
|
-
])) : createCommentVNode("", true)
|
|
123
|
-
]);
|
|
124
|
-
}
|
|
125
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
126
|
-
export { index as default };
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
|
-
/*!
|
|
18
|
-
* @nutui/nutui v3.1.19 Mon Apr 25 2022 17:26:38 GMT+0800 (中国标准时间)
|
|
19
|
-
* (c) 2022 @jdf2e.
|
|
20
|
-
* Released under the MIT License.
|
|
21
|
-
*/
|
|
22
|
-
import { toRefs, inject, ref, reactive, onMounted, computed, resolveComponent, openBlock, createElementBlock, normalizeStyle, normalizeClass, Fragment, createBlock, createCommentVNode, renderSlot, toDisplayString } from "vue";
|
|
23
|
-
import { c as createComponent } from "./component.js";
|
|
24
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
25
|
-
import "../locale/lang";
|
|
26
|
-
const { componentName, create } = createComponent("avatar");
|
|
27
|
-
const _sfc_main = create({
|
|
28
|
-
props: {
|
|
29
|
-
size: {
|
|
30
|
-
type: String,
|
|
31
|
-
default: ""
|
|
32
|
-
},
|
|
33
|
-
shape: {
|
|
34
|
-
type: String,
|
|
35
|
-
default: "round"
|
|
36
|
-
},
|
|
37
|
-
bgColor: {
|
|
38
|
-
type: String,
|
|
39
|
-
default: "#eee"
|
|
40
|
-
},
|
|
41
|
-
color: {
|
|
42
|
-
type: String,
|
|
43
|
-
default: "#666"
|
|
44
|
-
},
|
|
45
|
-
url: {
|
|
46
|
-
type: String,
|
|
47
|
-
default: ""
|
|
48
|
-
},
|
|
49
|
-
alt: {
|
|
50
|
-
type: String,
|
|
51
|
-
default: ""
|
|
52
|
-
},
|
|
53
|
-
icon: {
|
|
54
|
-
type: String,
|
|
55
|
-
default: ""
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
emits: ["active-avatar", "onError"],
|
|
59
|
-
setup(props, { emit, slots }) {
|
|
60
|
-
const { size, shape, bgColor, color, icon } = toRefs(props);
|
|
61
|
-
const sizeValue = ["large", "normal", "small"];
|
|
62
|
-
const avatarGroup = inject("avatarGroup", null);
|
|
63
|
-
const avatarRef = ref(null);
|
|
64
|
-
const visible = reactive({
|
|
65
|
-
lightTheme: false
|
|
66
|
-
});
|
|
67
|
-
const state = reactive({
|
|
68
|
-
index: 1,
|
|
69
|
-
showMax: false,
|
|
70
|
-
maxIndex: 0
|
|
71
|
-
});
|
|
72
|
-
onMounted(() => {
|
|
73
|
-
var _a, _b;
|
|
74
|
-
const children = (_b = (_a = avatarGroup == null ? void 0 : avatarGroup.avatarGroupRef) == null ? void 0 : _a.value) == null ? void 0 : _b.children;
|
|
75
|
-
if (children) {
|
|
76
|
-
avatarLength(children);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
const classes = computed(() => {
|
|
80
|
-
var _a, _b;
|
|
81
|
-
const prefixCls = componentName;
|
|
82
|
-
return {
|
|
83
|
-
[prefixCls]: true,
|
|
84
|
-
[`nut-avatar-${size.value || ((_a = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _a.size) || "normal"}`]: true,
|
|
85
|
-
[`nut-avatar-${shape.value || ((_b = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _b.shape) || "normal"}`]: true
|
|
86
|
-
};
|
|
87
|
-
});
|
|
88
|
-
const styles = computed(() => {
|
|
89
|
-
var _a, _b, _c;
|
|
90
|
-
return {
|
|
91
|
-
width: sizeValue.indexOf(size.value) > -1 ? "" : `${size.value}px`,
|
|
92
|
-
height: sizeValue.indexOf(size.value) > -1 ? "" : `${size.value}px`,
|
|
93
|
-
backgroundColor: `${bgColor.value}`,
|
|
94
|
-
color: `${color.value}`,
|
|
95
|
-
marginLeft: state.index != 1 && (((_a = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _a.span) ? `${(_b = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _b.span}px` : ""),
|
|
96
|
-
zIndex: ((_c = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _c.zIndex) == "right" ? `${Math.abs(state.maxIndex - state.index)}` : ""
|
|
97
|
-
};
|
|
98
|
-
});
|
|
99
|
-
const maxStyles = computed(() => {
|
|
100
|
-
var _a, _b;
|
|
101
|
-
return {
|
|
102
|
-
backgroundColor: `${(_a = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _a.maxBgColor}`,
|
|
103
|
-
color: `${(_b = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _b.maxColor}`
|
|
104
|
-
};
|
|
105
|
-
});
|
|
106
|
-
const iconStyles = computed(() => {
|
|
107
|
-
return !!icon.value ? icon.value : "";
|
|
108
|
-
});
|
|
109
|
-
const isShowText = computed(() => {
|
|
110
|
-
return slots.default;
|
|
111
|
-
});
|
|
112
|
-
const avatarLength = (children) => {
|
|
113
|
-
var _a, _b, _c;
|
|
114
|
-
state.maxIndex = children.length;
|
|
115
|
-
for (let i = 0; i < children.length; i++) {
|
|
116
|
-
if (children[i] && children[i].classList && children[i].classList[0] == "nut-avatar") {
|
|
117
|
-
children[i].setAttribute("data-index", i + 1);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
state.index = (_b = (_a = avatarRef == null ? void 0 : avatarRef.value) == null ? void 0 : _a.dataset) == null ? void 0 : _b.index;
|
|
121
|
-
if (state.index == state.maxIndex && state.index != ((_c = avatarGroup == null ? void 0 : avatarGroup.props) == null ? void 0 : _c.maxCount)) {
|
|
122
|
-
state.showMax = true;
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
const activeAvatar = (event) => {
|
|
126
|
-
emit("active-avatar", event);
|
|
127
|
-
};
|
|
128
|
-
const onError = (event) => {
|
|
129
|
-
emit("onError", event);
|
|
130
|
-
};
|
|
131
|
-
return __spreadValues({
|
|
132
|
-
classes,
|
|
133
|
-
styles,
|
|
134
|
-
iconStyles,
|
|
135
|
-
isShowText,
|
|
136
|
-
maxStyles,
|
|
137
|
-
activeAvatar,
|
|
138
|
-
onError,
|
|
139
|
-
avatarGroup,
|
|
140
|
-
visible,
|
|
141
|
-
avatarRef
|
|
142
|
-
}, toRefs(state));
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
const _hoisted_1 = ["src", "alt"];
|
|
146
|
-
const _hoisted_2 = {
|
|
147
|
-
key: 2,
|
|
148
|
-
class: "text"
|
|
149
|
-
};
|
|
150
|
-
const _hoisted_3 = {
|
|
151
|
-
key: 1,
|
|
152
|
-
class: "text"
|
|
153
|
-
};
|
|
154
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
155
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
156
|
-
const _component_nut_icon = resolveComponent("nut-icon");
|
|
157
|
-
return _ctx.showMax || !((_b = (_a = _ctx.avatarGroup) == null ? void 0 : _a.props) == null ? void 0 : _b.maxCount) || _ctx.index <= ((_d = (_c = _ctx.avatarGroup) == null ? void 0 : _c.props) == null ? void 0 : _d.maxCount) ? (openBlock(), createElementBlock("view", {
|
|
158
|
-
key: 0,
|
|
159
|
-
style: normalizeStyle(!_ctx.showMax ? _ctx.styles : _ctx.maxStyles),
|
|
160
|
-
class: normalizeClass(_ctx.classes),
|
|
161
|
-
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.activeAvatar(_ctx.e)),
|
|
162
|
-
ref: "avatarRef"
|
|
163
|
-
}, [
|
|
164
|
-
!((_f = (_e = _ctx.avatarGroup) == null ? void 0 : _e.props) == null ? void 0 : _f.maxCount) || _ctx.index <= ((_h = (_g = _ctx.avatarGroup) == null ? void 0 : _g.props) == null ? void 0 : _h.maxCount) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
165
|
-
_ctx.url ? (openBlock(), createElementBlock("img", {
|
|
166
|
-
key: 0,
|
|
167
|
-
src: _ctx.url,
|
|
168
|
-
alt: _ctx.alt,
|
|
169
|
-
onError: _cache[0] || (_cache[0] = (...args) => _ctx.onError && _ctx.onError(...args))
|
|
170
|
-
}, null, 40, _hoisted_1)) : _ctx.icon ? (openBlock(), createBlock(_component_nut_icon, {
|
|
171
|
-
key: 1,
|
|
172
|
-
class: "icon",
|
|
173
|
-
name: _ctx.iconStyles
|
|
174
|
-
}, null, 8, ["name"])) : createCommentVNode("", true),
|
|
175
|
-
_ctx.isShowText ? (openBlock(), createElementBlock("view", _hoisted_2, [
|
|
176
|
-
renderSlot(_ctx.$slots, "default")
|
|
177
|
-
])) : createCommentVNode("", true)
|
|
178
|
-
], 64)) : createCommentVNode("", true),
|
|
179
|
-
_ctx.showMax ? (openBlock(), createElementBlock("view", _hoisted_3, toDisplayString(((_j = (_i = _ctx.avatarGroup) == null ? void 0 : _i.props) == null ? void 0 : _j.maxContent) ? (_l = (_k = _ctx.avatarGroup) == null ? void 0 : _k.props) == null ? void 0 : _l.maxContent : `+ ${_ctx.maxIndex - ((_n = (_m = _ctx.avatarGroup) == null ? void 0 : _m.props) == null ? void 0 : _n.maxCount)}`), 1)) : createCommentVNode("", true)
|
|
180
|
-
], 6)) : createCommentVNode("", true);
|
|
181
|
-
}
|
|
182
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
183
|
-
export { index as default };
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* @nutui/nutui v3.1.19 Mon Apr 25 2022 17:26:38 GMT+0800 (中国标准时间)
|
|
3
|
-
* (c) 2022 @jdf2e.
|
|
4
|
-
* Released under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
import { toRefs, ref, computed, onMounted, provide, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
|
|
7
|
-
import { c as createComponent } from "./component.js";
|
|
8
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
|
-
import "../locale/lang";
|
|
10
|
-
const { componentName, create } = createComponent("avatar-group");
|
|
11
|
-
const _sfc_main = create({
|
|
12
|
-
props: {
|
|
13
|
-
maxContent: {
|
|
14
|
-
type: String,
|
|
15
|
-
default: ""
|
|
16
|
-
},
|
|
17
|
-
maxCount: {
|
|
18
|
-
type: [Number, String],
|
|
19
|
-
default: ""
|
|
20
|
-
},
|
|
21
|
-
maxBgColor: {
|
|
22
|
-
type: String,
|
|
23
|
-
default: "#eee"
|
|
24
|
-
},
|
|
25
|
-
maxColor: {
|
|
26
|
-
type: String,
|
|
27
|
-
default: "#666"
|
|
28
|
-
},
|
|
29
|
-
size: {
|
|
30
|
-
type: String,
|
|
31
|
-
default: ""
|
|
32
|
-
},
|
|
33
|
-
shape: {
|
|
34
|
-
type: String,
|
|
35
|
-
default: ""
|
|
36
|
-
},
|
|
37
|
-
span: {
|
|
38
|
-
type: String,
|
|
39
|
-
default: "-8"
|
|
40
|
-
},
|
|
41
|
-
zIndex: {
|
|
42
|
-
type: String,
|
|
43
|
-
default: "left"
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
setup(props, { emit, slots }) {
|
|
47
|
-
toRefs(props);
|
|
48
|
-
const avatarGroupRef = ref(null);
|
|
49
|
-
const index2 = ref(0);
|
|
50
|
-
const classes = computed(() => {
|
|
51
|
-
const prefixCls = componentName;
|
|
52
|
-
return {
|
|
53
|
-
[prefixCls]: true
|
|
54
|
-
};
|
|
55
|
-
});
|
|
56
|
-
onMounted(() => {
|
|
57
|
-
});
|
|
58
|
-
provide("avatarGroup", {
|
|
59
|
-
props,
|
|
60
|
-
avatarGroupRef,
|
|
61
|
-
index: index2
|
|
62
|
-
});
|
|
63
|
-
return {
|
|
64
|
-
classes,
|
|
65
|
-
avatarGroupRef
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
70
|
-
return openBlock(), createElementBlock("view", {
|
|
71
|
-
class: normalizeClass(_ctx.classes),
|
|
72
|
-
ref: "avatarGroupRef"
|
|
73
|
-
}, [
|
|
74
|
-
renderSlot(_ctx.$slots, "default")
|
|
75
|
-
], 2);
|
|
76
|
-
}
|
|
77
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
78
|
-
export { index as default };
|