@gmcb/uv-ui 0.2.26
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 +295 -0
- package/LICENSE +21 -0
- package/README.md +164 -0
- package/components/uv-action-sheet/props.js +50 -0
- package/components/uv-action-sheet/uv-action-sheet.vue +280 -0
- package/components/uv-album/uv-album.vue +312 -0
- package/components/uv-alert/props.js +45 -0
- package/components/uv-alert/uv-alert.vue +246 -0
- package/components/uv-avatar/props.js +85 -0
- package/components/uv-avatar/uv-avatar.vue +182 -0
- package/components/uv-avatar-group/props.js +53 -0
- package/components/uv-avatar-group/uv-avatar-group.vue +106 -0
- package/components/uv-back-top/props.js +58 -0
- package/components/uv-back-top/uv-back-top.vue +116 -0
- package/components/uv-badge/props.js +73 -0
- package/components/uv-badge/uv-badge.vue +176 -0
- package/components/uv-button/nvue.scss +46 -0
- package/components/uv-button/props.js +163 -0
- package/components/uv-button/uv-button.vue +529 -0
- package/components/uv-button/vue.scss +93 -0
- package/components/uv-calendar/calendar.js +546 -0
- package/components/uv-calendar/header.vue +104 -0
- package/components/uv-calendar/month.vue +616 -0
- package/components/uv-calendar/props.js +145 -0
- package/components/uv-calendar/uv-calendar.vue +390 -0
- package/components/uv-calendars/calendar-body.vue +376 -0
- package/components/uv-calendars/calendar-item.vue +248 -0
- package/components/uv-calendars/calendar.js +546 -0
- package/components/uv-calendars/i18n/en.json +12 -0
- package/components/uv-calendars/i18n/index.js +8 -0
- package/components/uv-calendars/i18n/zh-Hans.json +12 -0
- package/components/uv-calendars/i18n/zh-Hant.json +12 -0
- package/components/uv-calendars/util.js +435 -0
- package/components/uv-calendars/uv-calendars.vue +452 -0
- package/components/uv-cell/props.js +116 -0
- package/components/uv-cell/uv-cell.vue +209 -0
- package/components/uv-cell-group/props.js +15 -0
- package/components/uv-cell-group/uv-cell-group.vue +63 -0
- package/components/uv-checkbox/props.js +70 -0
- package/components/uv-checkbox/uv-checkbox.vue +371 -0
- package/components/uv-checkbox-group/props.js +84 -0
- package/components/uv-checkbox-group/uv-checkbox-group.vue +119 -0
- package/components/uv-code/props.js +35 -0
- package/components/uv-code/uv-code.vue +136 -0
- package/components/uv-code-input/props.js +83 -0
- package/components/uv-code-input/uv-code-input.vue +272 -0
- package/components/uv-col/props.js +30 -0
- package/components/uv-col/uv-col.vue +165 -0
- package/components/uv-collapse/props.js +20 -0
- package/components/uv-collapse/uv-collapse.vue +86 -0
- package/components/uv-collapse-item/props.js +60 -0
- package/components/uv-collapse-item/uv-collapse-item.vue +228 -0
- package/components/uv-column-notice/props.js +61 -0
- package/components/uv-column-notice/uv-column-notice.vue +176 -0
- package/components/uv-count-down/props.js +25 -0
- package/components/uv-count-down/utils.js +62 -0
- package/components/uv-count-down/uv-count-down.vue +169 -0
- package/components/uv-count-to/props.js +60 -0
- package/components/uv-count-to/uv-count-to.vue +187 -0
- package/components/uv-datetime-picker/props.js +130 -0
- package/components/uv-datetime-picker/uv-datetime-picker.vue +355 -0
- package/components/uv-divider/props.js +45 -0
- package/components/uv-divider/uv-divider.vue +113 -0
- package/components/uv-drop-down/uv-drop-down.vue +135 -0
- package/components/uv-drop-down-item/uv-drop-down-item.vue +169 -0
- package/components/uv-drop-down-popup/uv-drop-down-popup.vue +242 -0
- package/components/uv-empty/props.js +60 -0
- package/components/uv-empty/uv-empty.vue +126 -0
- package/components/uv-form/props.js +46 -0
- package/components/uv-form/uv-form.vue +209 -0
- package/components/uv-form/valid.js +1343 -0
- package/components/uv-form-item/props.js +49 -0
- package/components/uv-form-item/uv-form-item.vue +226 -0
- package/components/uv-gap/props.js +25 -0
- package/components/uv-gap/uv-gap.vue +36 -0
- package/components/uv-grid/props.js +20 -0
- package/components/uv-grid/uv-grid.vue +100 -0
- package/components/uv-grid-item/props.js +15 -0
- package/components/uv-grid-item/uv-grid-item.vue +223 -0
- package/components/uv-icon/icons.js +160 -0
- package/components/uv-icon/props.js +90 -0
- package/components/uv-icon/uv-icon.vue +226 -0
- package/components/uv-icon/uvicons.ttf +0 -0
- package/components/uv-image/props.js +100 -0
- package/components/uv-image/uv-image.vue +296 -0
- package/components/uv-index-anchor/props.js +30 -0
- package/components/uv-index-anchor/uv-index-anchor.vue +98 -0
- package/components/uv-index-item/uv-index-item.vue +87 -0
- package/components/uv-index-list/props.js +30 -0
- package/components/uv-index-list/uv-index-list.vue +461 -0
- package/components/uv-input/props.js +175 -0
- package/components/uv-input/uv-input.vue +348 -0
- package/components/uv-keyboard/props.js +95 -0
- package/components/uv-keyboard/uv-keyboard.vue +180 -0
- package/components/uv-keyboard-car/props.js +24 -0
- package/components/uv-keyboard-car/uv-keyboard-car.vue +347 -0
- package/components/uv-keyboard-number/props.js +19 -0
- package/components/uv-keyboard-number/uv-keyboard-number.vue +201 -0
- package/components/uv-line/props.js +34 -0
- package/components/uv-line/uv-line.vue +60 -0
- package/components/uv-line-progress/props.js +29 -0
- package/components/uv-line-progress/uv-line-progress.vue +146 -0
- package/components/uv-link/props.js +40 -0
- package/components/uv-link/uv-link.vue +83 -0
- package/components/uv-list/uv-list.vue +147 -0
- package/components/uv-list-item/uv-list-item.vue +535 -0
- package/components/uv-load-more/props.js +95 -0
- package/components/uv-load-more/uv-load-more.vue +152 -0
- package/components/uv-loading-icon/props.js +67 -0
- package/components/uv-loading-icon/uv-loading-icon.vue +347 -0
- package/components/uv-loading-page/props.js +55 -0
- package/components/uv-loading-page/uv-loading-page.vue +96 -0
- package/components/uv-modal/props.js +90 -0
- package/components/uv-modal/uv-modal.vue +245 -0
- package/components/uv-navbar/props.js +89 -0
- package/components/uv-navbar/uv-navbar.vue +245 -0
- package/components/uv-no-network/props.js +20 -0
- package/components/uv-no-network/uv-no-network.vue +222 -0
- package/components/uv-notice-bar/props.js +76 -0
- package/components/uv-notice-bar/uv-notice-bar.vue +110 -0
- package/components/uv-notify/props.js +45 -0
- package/components/uv-notify/uv-notify.vue +220 -0
- package/components/uv-number-box/props.js +118 -0
- package/components/uv-number-box/uv-number-box.vue +397 -0
- package/components/uv-overlay/props.js +25 -0
- package/components/uv-overlay/uv-overlay.vue +85 -0
- package/components/uv-parse/node/node.vue +576 -0
- package/components/uv-parse/parser.js +1335 -0
- package/components/uv-parse/uv-parse.vue +498 -0
- package/components/uv-pick-color/colors.js +217 -0
- package/components/uv-pick-color/props.js +47 -0
- package/components/uv-pick-color/uv-pick-color.vue +551 -0
- package/components/uv-picker/props.js +95 -0
- package/components/uv-picker/uv-picker.vue +329 -0
- package/components/uv-popup/keypress.js +45 -0
- package/components/uv-popup/uv-popup.vue +537 -0
- package/components/uv-preview-video/uv-preview-video.vue +52 -0
- package/components/uv-qrcode/cache.js +1 -0
- package/components/uv-qrcode/gcanvas/bridge/bridge-weex.js +241 -0
- package/components/uv-qrcode/gcanvas/context-2d/FillStyleLinearGradient.js +18 -0
- package/components/uv-qrcode/gcanvas/context-2d/FillStylePattern.js +8 -0
- package/components/uv-qrcode/gcanvas/context-2d/FillStyleRadialGradient.js +17 -0
- package/components/uv-qrcode/gcanvas/context-2d/RenderingContext.js +666 -0
- package/components/uv-qrcode/gcanvas/context-webgl/ActiveInfo.js +11 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Buffer.js +21 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Framebuffer.js +21 -0
- package/components/uv-qrcode/gcanvas/context-webgl/GLenum.js +298 -0
- package/components/uv-qrcode/gcanvas/context-webgl/GLmethod.js +142 -0
- package/components/uv-qrcode/gcanvas/context-webgl/GLtype.js +23 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Program.js +21 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Renderbuffer.js +21 -0
- package/components/uv-qrcode/gcanvas/context-webgl/RenderingContext.js +1191 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Shader.js +22 -0
- package/components/uv-qrcode/gcanvas/context-webgl/ShaderPrecisionFormat.js +11 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Texture.js +22 -0
- package/components/uv-qrcode/gcanvas/context-webgl/UniformLocation.js +22 -0
- package/components/uv-qrcode/gcanvas/context-webgl/classUtils.js +3 -0
- package/components/uv-qrcode/gcanvas/env/canvas.js +74 -0
- package/components/uv-qrcode/gcanvas/env/image.js +96 -0
- package/components/uv-qrcode/gcanvas/env/tool.js +24 -0
- package/components/uv-qrcode/gcanvas/index.js +39 -0
- package/components/uv-qrcode/props.js +85 -0
- package/components/uv-qrcode/qrcode.js +34 -0
- package/components/uv-qrcode/queue.js +41 -0
- package/components/uv-qrcode/uv-qrcode.vue +1038 -0
- package/components/uv-radio/props.js +65 -0
- package/components/uv-radio/uv-radio.vue +349 -0
- package/components/uv-radio-group/props.js +89 -0
- package/components/uv-radio-group/uv-radio-group.vue +115 -0
- package/components/uv-rate/props.js +73 -0
- package/components/uv-rate/uv-rate.vue +274 -0
- package/components/uv-read-more/props.js +62 -0
- package/components/uv-read-more/uv-read-more.vue +162 -0
- package/components/uv-row/props.js +20 -0
- package/components/uv-row/uv-row.vue +95 -0
- package/components/uv-row-notice/props.js +40 -0
- package/components/uv-row-notice/uv-row-notice.vue +341 -0
- package/components/uv-safe-bottom/uv-safe-bottom.vue +67 -0
- package/components/uv-scroll-list/nvue.js +29 -0
- package/components/uv-scroll-list/props.js +35 -0
- package/components/uv-scroll-list/scrollWxs.wxs +51 -0
- package/components/uv-scroll-list/uv-scroll-list.vue +218 -0
- package/components/uv-search/props.js +127 -0
- package/components/uv-search/uv-search.vue +311 -0
- package/components/uv-skeleton/props.js +65 -0
- package/components/uv-skeleton/uv-skeleton.vue +250 -0
- package/components/uv-skeletons/uv-skeletons.vue +247 -0
- package/components/uv-slider/props.js +58 -0
- package/components/uv-slider/uv-slider.vue +58 -0
- package/components/uv-status-bar/props.js +8 -0
- package/components/uv-status-bar/uv-status-bar.vue +54 -0
- package/components/uv-steps/props.js +40 -0
- package/components/uv-steps/uv-steps.vue +83 -0
- package/components/uv-steps-item/props.js +25 -0
- package/components/uv-steps-item/uv-steps-item.vue +347 -0
- package/components/uv-sticky/props.js +41 -0
- package/components/uv-sticky/uv-sticky.vue +223 -0
- package/components/uv-subsection/props.js +54 -0
- package/components/uv-subsection/uv-subsection.vue +269 -0
- package/components/uv-swipe-action/props.js +10 -0
- package/components/uv-swipe-action/uv-swipe-action.vue +65 -0
- package/components/uv-swipe-action-item/index - backup.wxs +256 -0
- package/components/uv-swipe-action-item/index.wxs +225 -0
- package/components/uv-swipe-action-item/nvue - backup.js +264 -0
- package/components/uv-swipe-action-item/nvue.js +182 -0
- package/components/uv-swipe-action-item/props.js +40 -0
- package/components/uv-swipe-action-item/uv-swipe-action-item.vue +200 -0
- package/components/uv-swipe-action-item/wxs.js +15 -0
- package/components/uv-swiper/props.js +136 -0
- package/components/uv-swiper/uv-swiper.vue +263 -0
- package/components/uv-swiper-indicator/props.js +30 -0
- package/components/uv-swiper-indicator/uv-swiper-indicator.vue +112 -0
- package/components/uv-switch/props.js +58 -0
- package/components/uv-switch/uv-switch.vue +182 -0
- package/components/uv-tabbar/props.js +50 -0
- package/components/uv-tabbar/uv-tabbar.vue +146 -0
- package/components/uv-tabbar-item/props.js +40 -0
- package/components/uv-tabbar-item/uv-tabbar-item.vue +146 -0
- package/components/uv-tabs/props.js +71 -0
- package/components/uv-tabs/uv-tabs.vue +391 -0
- package/components/uv-tags/props.js +104 -0
- package/components/uv-tags/uv-tags.vue +379 -0
- package/components/uv-text/props.js +113 -0
- package/components/uv-text/uv-text.vue +218 -0
- package/components/uv-text/value.js +87 -0
- package/components/uv-textarea/props.js +138 -0
- package/components/uv-textarea/uv-textarea.vue +238 -0
- package/components/uv-toast/uv-toast.vue +292 -0
- package/components/uv-toolbar/props.js +40 -0
- package/components/uv-toolbar/uv-toolbar.vue +109 -0
- package/components/uv-tooltip/props.js +60 -0
- package/components/uv-tooltip/uv-tooltip.vue +372 -0
- package/components/uv-transition/createAnimation.js +131 -0
- package/components/uv-transition/props.js +31 -0
- package/components/uv-transition/uv-transition.vue +320 -0
- package/components/uv-upload/mixin.js +22 -0
- package/components/uv-upload/props.js +130 -0
- package/components/uv-upload/utils.js +151 -0
- package/components/uv-upload/uv-upload.vue +488 -0
- package/components/uv-vtabs/props.js +79 -0
- package/components/uv-vtabs/uv-vtabs.vue +438 -0
- package/components/uv-vtabs-item/uv-vtabs-item.vue +68 -0
- package/components/uv-waterfall/props.js +69 -0
- package/components/uv-waterfall/uv-waterfall.vue +265 -0
- package/index.js +82 -0
- package/index.scss +7 -0
- package/libs/config/config.js +34 -0
- package/libs/css/color.scss +32 -0
- package/libs/css/common.scss +100 -0
- package/libs/css/components.scss +23 -0
- package/libs/css/variable.scss +111 -0
- package/libs/css/vue.scss +40 -0
- package/libs/function/colorGradient.js +134 -0
- package/libs/function/compress.js +27 -0
- package/libs/function/debounce.js +29 -0
- package/libs/function/digit.js +167 -0
- package/libs/function/index.js +734 -0
- package/libs/function/platform.js +75 -0
- package/libs/function/test.js +287 -0
- package/libs/function/throttle.js +30 -0
- package/libs/luch-request/adapters/index.js +132 -0
- package/libs/luch-request/core/InterceptorManager.js +51 -0
- package/libs/luch-request/core/Request.js +201 -0
- package/libs/luch-request/core/buildFullPath.js +20 -0
- package/libs/luch-request/core/defaults.js +33 -0
- package/libs/luch-request/core/dispatchRequest.js +6 -0
- package/libs/luch-request/core/mergeConfig.js +126 -0
- package/libs/luch-request/core/settle.js +16 -0
- package/libs/luch-request/helpers/buildURL.js +64 -0
- package/libs/luch-request/helpers/combineURLs.js +14 -0
- package/libs/luch-request/helpers/isAbsoluteURL.js +14 -0
- package/libs/luch-request/index.d.ts +197 -0
- package/libs/luch-request/index.js +2 -0
- package/libs/luch-request/utils/clone.js +264 -0
- package/libs/luch-request/utils.js +135 -0
- package/libs/mixin/button.js +13 -0
- package/libs/mixin/mixin.js +172 -0
- package/libs/mixin/mpMixin.js +8 -0
- package/libs/mixin/mpShare.js +13 -0
- package/libs/mixin/openType.js +47 -0
- package/libs/mixin/touch.js +59 -0
- package/libs/util/dayjs.js +216 -0
- package/libs/util/route.js +126 -0
- package/package.json +28 -0
- package/theme.scss +43 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view
|
|
3
|
+
class="uv-scroll-list"
|
|
4
|
+
ref="uv-scroll-list"
|
|
5
|
+
>
|
|
6
|
+
<!-- #ifdef APP-NVUE -->
|
|
7
|
+
<!-- nvue使用bindingX实现,以得到更好的性能 -->
|
|
8
|
+
<scroller
|
|
9
|
+
class="uv-scroll-list__scroll-view"
|
|
10
|
+
ref="uv-scroll-list__scroll-view"
|
|
11
|
+
scroll-direction="horizontal"
|
|
12
|
+
:show-scrollbar="false"
|
|
13
|
+
:offset-accuracy="1"
|
|
14
|
+
@scroll="nvueScrollHandler"
|
|
15
|
+
>
|
|
16
|
+
<view class="uv-scroll-list__scroll-view__content">
|
|
17
|
+
<slot />
|
|
18
|
+
</view>
|
|
19
|
+
</scroller>
|
|
20
|
+
<!-- #endif -->
|
|
21
|
+
<!-- #ifndef APP-NVUE -->
|
|
22
|
+
<!-- #ifdef MP-WEIXIN || APP-VUE || H5 || MP-QQ -->
|
|
23
|
+
<!-- 以上平台,支持wxs -->
|
|
24
|
+
<scroll-view
|
|
25
|
+
class="uv-scroll-list__scroll-view"
|
|
26
|
+
scroll-x
|
|
27
|
+
@scroll="wxs.scroll"
|
|
28
|
+
@scrolltoupper="wxs.scrolltoupper"
|
|
29
|
+
@scrolltolower="wxs.scrolltolower"
|
|
30
|
+
:data-scrollWidth="scrollWidth"
|
|
31
|
+
:data-barWidth="$uv.getPx(indicatorBarWidth)"
|
|
32
|
+
:data-indicatorWidth="$uv.getPx(indicatorWidth)"
|
|
33
|
+
:show-scrollbar="false"
|
|
34
|
+
:upper-threshold="0"
|
|
35
|
+
:lower-threshold="0"
|
|
36
|
+
:data-unit="$uv.unit"
|
|
37
|
+
>
|
|
38
|
+
<!-- #endif -->
|
|
39
|
+
<!-- #ifndef APP-NVUE || MP-WEIXIN || H5 || APP-VUE || MP-QQ -->
|
|
40
|
+
<!-- 非以上平台,只能使用普通js实现 -->
|
|
41
|
+
<scroll-view
|
|
42
|
+
class="uv-scroll-list__scroll-view"
|
|
43
|
+
scroll-x
|
|
44
|
+
@scroll="scrollHandler"
|
|
45
|
+
@scrolltoupper="scrolltoupperHandler"
|
|
46
|
+
@scrolltolower="scrolltolowerHandler"
|
|
47
|
+
:show-scrollbar="false"
|
|
48
|
+
:upper-threshold="0"
|
|
49
|
+
:lower-threshold="0"
|
|
50
|
+
>
|
|
51
|
+
<!-- #endif -->
|
|
52
|
+
<view class="uv-scroll-list__scroll-view__content">
|
|
53
|
+
<slot />
|
|
54
|
+
</view>
|
|
55
|
+
</scroll-view>
|
|
56
|
+
<!-- #endif -->
|
|
57
|
+
<view
|
|
58
|
+
class="uv-scroll-list__indicator"
|
|
59
|
+
v-if="indicator"
|
|
60
|
+
:style="[$uv.addStyle(indicatorStyle)]"
|
|
61
|
+
>
|
|
62
|
+
<view
|
|
63
|
+
class="uv-scroll-list__indicator__line"
|
|
64
|
+
:style="[lineStyle]"
|
|
65
|
+
>
|
|
66
|
+
<view
|
|
67
|
+
class="uv-scroll-list__indicator__line__bar"
|
|
68
|
+
:style="[barStyle]"
|
|
69
|
+
ref="uv-scroll-list__indicator__line__bar"
|
|
70
|
+
></view>
|
|
71
|
+
</view>
|
|
72
|
+
</view>
|
|
73
|
+
<!-- 避免报错 -->
|
|
74
|
+
<!-- #ifdef H5 -->
|
|
75
|
+
<view v-else class="uv-scroll-list__indicator__line__bar"></view>
|
|
76
|
+
<!-- #endif -->
|
|
77
|
+
</view>
|
|
78
|
+
</template>
|
|
79
|
+
<script src="./scrollWxs.wxs" module="wxs" lang="wxs"></script>
|
|
80
|
+
<script>
|
|
81
|
+
/**
|
|
82
|
+
* scrollList 横向滚动列表
|
|
83
|
+
* @description 该组件一般用于同时展示多个商品、分类的场景,也可以完成左右滑动的列表。
|
|
84
|
+
* @tutorial https://www.uviewui.com/components/scrollList.html
|
|
85
|
+
* @property {String | Number} indicatorWidth 指示器的整体宽度 (默认 50 )
|
|
86
|
+
* @property {String | Number} indicatorBarWidth 滑块的宽度 (默认 20 )
|
|
87
|
+
* @property {Boolean} indicator 是否显示面板指示器 (默认 true )
|
|
88
|
+
* @property {String} indicatorColor 指示器非激活颜色 (默认 '#f2f2f2' )
|
|
89
|
+
* @property {String} indicatorActiveColor 指示器的激活颜色 (默认 '#3c9cff' )
|
|
90
|
+
* @property {String | Object} indicatorStyle 指示器样式,可通过bottom,left,right进行定位
|
|
91
|
+
* @event {Function} left 滑动到左边时触发
|
|
92
|
+
* @event {Function} right 滑动到右边时触发
|
|
93
|
+
* @example
|
|
94
|
+
*/
|
|
95
|
+
// #ifdef APP-NVUE
|
|
96
|
+
const dom = uni.requireNativePlugin('dom')
|
|
97
|
+
import nvueMixin from "./nvue.js"
|
|
98
|
+
// #endif
|
|
99
|
+
import mpMixin from '../../libs/mixin/mpMixin.js'
|
|
100
|
+
import mixin from '../../libs/mixin/mixin.js'
|
|
101
|
+
import props from './props.js';
|
|
102
|
+
export default {
|
|
103
|
+
name: 'uv-scroll-list',
|
|
104
|
+
// #ifndef APP-NVUE
|
|
105
|
+
mixins: [mpMixin, mixin, props],
|
|
106
|
+
// #endif
|
|
107
|
+
// #ifdef APP-NVUE
|
|
108
|
+
mixins: [mpMixin, mixin, nvueMixin, props],
|
|
109
|
+
// #endif
|
|
110
|
+
data() {
|
|
111
|
+
return {
|
|
112
|
+
scrollInfo: {
|
|
113
|
+
scrollLeft: 0,
|
|
114
|
+
scrollWidth: 0
|
|
115
|
+
},
|
|
116
|
+
scrollWidth: 0
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
computed: {
|
|
120
|
+
// 指示器为线型的样式
|
|
121
|
+
barStyle() {
|
|
122
|
+
const style = {}
|
|
123
|
+
// #ifndef APP-NVUE || MP-WEIXIN || H5 || APP-VUE || MP-QQ
|
|
124
|
+
// 此为普通js方案,只有在非nvue和不支持wxs方案的端才使用、
|
|
125
|
+
// 此处的计算理由为:scroll-view的滚动距离与目标滚动距离(scroll-view的实际宽度减去包裹元素的宽度)之比,等于滑块当前移动距离与总需
|
|
126
|
+
// 滑动距离(指示器的总宽度减去滑块宽度)的比值
|
|
127
|
+
const scrollLeft = this.scrollInfo.scrollLeft,
|
|
128
|
+
scrollWidth = this.scrollInfo.scrollWidth,
|
|
129
|
+
barAllMoveWidth = this.indicatorWidth - this.indicatorBarWidth
|
|
130
|
+
const x = scrollLeft / (scrollWidth - this.scrollWidth) * this.$uv.getPx(this.$uv.addUnit(barAllMoveWidth))
|
|
131
|
+
style.transform = `translateX(${ x }px)`
|
|
132
|
+
// #endif
|
|
133
|
+
// 设置滑块的宽度和背景色,是每个平台都需要的
|
|
134
|
+
style.width = this.$uv.addUnit(this.indicatorBarWidth)
|
|
135
|
+
style.backgroundColor = this.indicatorActiveColor
|
|
136
|
+
return style
|
|
137
|
+
},
|
|
138
|
+
lineStyle() {
|
|
139
|
+
const style = {}
|
|
140
|
+
// 指示器整体的样式,需要设置其宽度和背景色
|
|
141
|
+
style.width = this.$uv.addUnit(this.indicatorWidth)
|
|
142
|
+
style.backgroundColor = this.indicatorColor
|
|
143
|
+
return style
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
mounted() {
|
|
147
|
+
this.init()
|
|
148
|
+
},
|
|
149
|
+
methods: {
|
|
150
|
+
init() {
|
|
151
|
+
this.getComponentWidth()
|
|
152
|
+
},
|
|
153
|
+
// #ifndef APP-NVUE || MP-WEIXIN || H5 || APP-VUE || MP-QQ
|
|
154
|
+
// scroll-view触发滚动事件
|
|
155
|
+
scrollHandler(e) {
|
|
156
|
+
this.scrollInfo = e.detail
|
|
157
|
+
},
|
|
158
|
+
scrolltoupperHandler() {
|
|
159
|
+
this.scrollEvent('left')
|
|
160
|
+
this.scrollInfo.scrollLeft = 0
|
|
161
|
+
},
|
|
162
|
+
scrolltolowerHandler() {
|
|
163
|
+
this.scrollEvent('right')
|
|
164
|
+
// 在普通js方案中,滚动到右边时,通过设置this.scrollInfo,模拟出滚动到右边的情况
|
|
165
|
+
// 因为上方是用过computed计算的,设置后,会自动调整滑块的位置
|
|
166
|
+
this.scrollInfo.scrollLeft = this.$uv.getPx(this.indicatorWidth) - this.$uv.getPx(this.indicatorBarWidth)
|
|
167
|
+
},
|
|
168
|
+
// #endif
|
|
169
|
+
scrollEvent(status) {
|
|
170
|
+
this.$emit(status)
|
|
171
|
+
},
|
|
172
|
+
// 获取组件的宽度
|
|
173
|
+
async getComponentWidth() {
|
|
174
|
+
// 延时一定时间,以获取dom尺寸
|
|
175
|
+
await this.$uv.sleep(30)
|
|
176
|
+
// #ifndef APP-NVUE
|
|
177
|
+
this.$uvGetRect('.uv-scroll-list').then(size => {
|
|
178
|
+
this.scrollWidth = size.width
|
|
179
|
+
})
|
|
180
|
+
// #endif
|
|
181
|
+
// #ifdef APP-NVUE
|
|
182
|
+
const ref = this.$refs['uv-scroll-list']
|
|
183
|
+
ref && dom.getComponentRect(ref, (res) => {
|
|
184
|
+
this.scrollWidth = res.size.width
|
|
185
|
+
})
|
|
186
|
+
// #endif
|
|
187
|
+
},
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
</script>
|
|
191
|
+
<style lang="scss" scoped>
|
|
192
|
+
@import '../../libs/css/components.scss';
|
|
193
|
+
.uv-scroll-list {
|
|
194
|
+
padding-bottom: 10px;
|
|
195
|
+
&__scroll-view {
|
|
196
|
+
@include flex;
|
|
197
|
+
&__content {
|
|
198
|
+
@include flex;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
&__indicator {
|
|
202
|
+
@include flex;
|
|
203
|
+
justify-content: center;
|
|
204
|
+
margin-top: 15px;
|
|
205
|
+
&__line {
|
|
206
|
+
width: 60px;
|
|
207
|
+
height: 4px;
|
|
208
|
+
border-radius: 100px;
|
|
209
|
+
overflow: hidden;
|
|
210
|
+
&__bar {
|
|
211
|
+
width: 20px;
|
|
212
|
+
height: 4px;
|
|
213
|
+
border-radius: 100px;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
</style>
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
props: {
|
|
3
|
+
value: {
|
|
4
|
+
type: [String, Number],
|
|
5
|
+
default: ''
|
|
6
|
+
},
|
|
7
|
+
modelValue: {
|
|
8
|
+
type: [String, Number],
|
|
9
|
+
default: ''
|
|
10
|
+
},
|
|
11
|
+
// 搜索框形状,round-圆形,square-方形
|
|
12
|
+
shape: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: 'round'
|
|
15
|
+
},
|
|
16
|
+
// 搜索框背景色,默认值#f2f2f2
|
|
17
|
+
bgColor: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: '#f2f2f2'
|
|
20
|
+
},
|
|
21
|
+
// 占位提示文字
|
|
22
|
+
placeholder: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: '请输入关键字'
|
|
25
|
+
},
|
|
26
|
+
// 是否启用清除控件
|
|
27
|
+
clearabled: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: true
|
|
30
|
+
},
|
|
31
|
+
// 是否自动聚焦
|
|
32
|
+
focus: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false
|
|
35
|
+
},
|
|
36
|
+
// 是否在搜索框右侧显示取消按钮
|
|
37
|
+
showAction: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: true
|
|
40
|
+
},
|
|
41
|
+
// 右边控件的样式
|
|
42
|
+
actionStyle: {
|
|
43
|
+
type: Object,
|
|
44
|
+
default: () => ({})
|
|
45
|
+
},
|
|
46
|
+
// 取消按钮文字
|
|
47
|
+
actionText: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: '搜索'
|
|
50
|
+
},
|
|
51
|
+
// 输入框内容对齐方式,可选值为 left|center|right
|
|
52
|
+
inputAlign: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: 'left'
|
|
55
|
+
},
|
|
56
|
+
// input输入框的样式,可以定义文字颜色,大小等,对象形式
|
|
57
|
+
inputStyle: {
|
|
58
|
+
type: Object,
|
|
59
|
+
default: () => ({})
|
|
60
|
+
},
|
|
61
|
+
// 是否禁用输入框
|
|
62
|
+
disabled: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: false
|
|
65
|
+
},
|
|
66
|
+
// 边框颜色
|
|
67
|
+
borderColor: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: 'transparent'
|
|
70
|
+
},
|
|
71
|
+
// 搜索图标的颜色,默认同输入框字体颜色
|
|
72
|
+
searchIconColor: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: '#909399'
|
|
75
|
+
},
|
|
76
|
+
// 输入框字体颜色
|
|
77
|
+
color: {
|
|
78
|
+
type: String,
|
|
79
|
+
default: '#606266'
|
|
80
|
+
},
|
|
81
|
+
// placeholder的颜色
|
|
82
|
+
placeholderColor: {
|
|
83
|
+
type: String,
|
|
84
|
+
default: '#909399'
|
|
85
|
+
},
|
|
86
|
+
// 左边输入框的图标,可以为uvui图标名称或图片路径
|
|
87
|
+
searchIcon: {
|
|
88
|
+
type: String,
|
|
89
|
+
default: 'search'
|
|
90
|
+
},
|
|
91
|
+
searchIconSize: {
|
|
92
|
+
type: [Number, String],
|
|
93
|
+
default: 22
|
|
94
|
+
},
|
|
95
|
+
// 组件与其他上下左右元素之间的距离,带单位的字符串形式,如"30px"、"30px 20px"等写法
|
|
96
|
+
margin: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: '0'
|
|
99
|
+
},
|
|
100
|
+
// 开启showAction时,是否在input获取焦点时才显示
|
|
101
|
+
animation: {
|
|
102
|
+
type: Boolean,
|
|
103
|
+
default: false
|
|
104
|
+
},
|
|
105
|
+
// 输入框最大能输入的长度,-1为不限制长度(来自uniapp文档)
|
|
106
|
+
maxlength: {
|
|
107
|
+
type: [String, Number],
|
|
108
|
+
default: -1
|
|
109
|
+
},
|
|
110
|
+
// 搜索框高度,单位px
|
|
111
|
+
height: {
|
|
112
|
+
type: [String, Number],
|
|
113
|
+
default: 32
|
|
114
|
+
},
|
|
115
|
+
// 搜索框左侧文本
|
|
116
|
+
label: {
|
|
117
|
+
type: [String, Number, null],
|
|
118
|
+
default: null
|
|
119
|
+
},
|
|
120
|
+
// 搜索框扩展样式
|
|
121
|
+
boxStyle: {
|
|
122
|
+
type: [String, Object],
|
|
123
|
+
default: () => ({})
|
|
124
|
+
},
|
|
125
|
+
...uni.$uv?.props?.search
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view
|
|
3
|
+
class="uv-search"
|
|
4
|
+
@tap="clickHandler"
|
|
5
|
+
:style="[{
|
|
6
|
+
margin: margin,
|
|
7
|
+
}, $uv.addStyle(customStyle)]"
|
|
8
|
+
>
|
|
9
|
+
<view
|
|
10
|
+
class="uv-search__content"
|
|
11
|
+
:style="[{
|
|
12
|
+
backgroundColor: bgColor,
|
|
13
|
+
borderRadius: shape == 'round' ? '100px' : '4px',
|
|
14
|
+
borderColor: borderColor,
|
|
15
|
+
},$uv.addStyle(boxStyle)]"
|
|
16
|
+
>
|
|
17
|
+
<view class="uv-search__content__disabled" v-if="disabled"></view>
|
|
18
|
+
<slot name="prefix">
|
|
19
|
+
<view class="uv-search__content__icon">
|
|
20
|
+
<uv-icon
|
|
21
|
+
@tap="clickIcon"
|
|
22
|
+
:size="searchIconSize"
|
|
23
|
+
:name="searchIcon"
|
|
24
|
+
:color="searchIconColor ? searchIconColor : color"
|
|
25
|
+
></uv-icon>
|
|
26
|
+
</view>
|
|
27
|
+
</slot>
|
|
28
|
+
<input
|
|
29
|
+
confirm-type="search"
|
|
30
|
+
@blur="blur"
|
|
31
|
+
:value="keyword"
|
|
32
|
+
@confirm="search"
|
|
33
|
+
@input="inputChange"
|
|
34
|
+
:disabled="disabled"
|
|
35
|
+
@focus="getFocus"
|
|
36
|
+
:focus="focus"
|
|
37
|
+
:maxlength="maxlength"
|
|
38
|
+
placeholder-class="uv-search__content__input--placeholder"
|
|
39
|
+
:placeholder="placeholder"
|
|
40
|
+
:placeholder-style="`color: ${placeholderColor}`"
|
|
41
|
+
class="uv-search__content__input"
|
|
42
|
+
type="text"
|
|
43
|
+
:style="[{
|
|
44
|
+
textAlign: inputAlign,
|
|
45
|
+
color: color,
|
|
46
|
+
backgroundColor: bgColor,
|
|
47
|
+
height: $uv.addUnit(height)
|
|
48
|
+
}, inputStyle]"
|
|
49
|
+
/>
|
|
50
|
+
<view
|
|
51
|
+
class="uv-search__content__icon uv-search__content__close"
|
|
52
|
+
v-if="keyword && clearabled && focused"
|
|
53
|
+
@tap="clear"
|
|
54
|
+
>
|
|
55
|
+
<uv-icon
|
|
56
|
+
name="close"
|
|
57
|
+
size="11"
|
|
58
|
+
color="#ffffff"
|
|
59
|
+
customStyle="line-height: 12px"
|
|
60
|
+
></uv-icon>
|
|
61
|
+
</view>
|
|
62
|
+
<slot name="suffix"></slot>
|
|
63
|
+
</view>
|
|
64
|
+
<text
|
|
65
|
+
:style="[actionStyle]"
|
|
66
|
+
class="uv-search__action"
|
|
67
|
+
:class="[(showActionBtn || show) && 'uv-search__action--active']"
|
|
68
|
+
@tap.stop.prevent="custom"
|
|
69
|
+
>{{ actionText }}</text>
|
|
70
|
+
</view>
|
|
71
|
+
</template>
|
|
72
|
+
|
|
73
|
+
<script>
|
|
74
|
+
import mpMixin from '../../libs/mixin/mpMixin.js'
|
|
75
|
+
import mixin from '../../libs/mixin/mixin.js'
|
|
76
|
+
import props from './props.js';
|
|
77
|
+
/**
|
|
78
|
+
* search 搜索框
|
|
79
|
+
* @description 搜索组件,集成了常见搜索框所需功能,用户可以一键引入,开箱即用。
|
|
80
|
+
* @tutorial https://www.uvui.cn/components/search.html
|
|
81
|
+
* @property {String} value/v-model 输入框初始值
|
|
82
|
+
* @property {String} shape 搜索框形状,round-圆形,square-方形(默认 'round' )
|
|
83
|
+
* @property {String} bgColor 搜索框背景颜色(默认 '#f2f2f2' )
|
|
84
|
+
* @property {String} placeholder 占位文字内容(默认 '请输入关键字' )
|
|
85
|
+
* @property {Boolean} clearabled 是否启用清除控件(默认 true )
|
|
86
|
+
* @property {Boolean} focus 是否自动获得焦点(默认 false )
|
|
87
|
+
* @property {Boolean} showAction 是否显示右侧控件(默认 true )
|
|
88
|
+
* @property {Object} actionStyle 右侧控件的样式,对象形式
|
|
89
|
+
* @property {String} actionText 右侧控件文字(默认 '搜索' )
|
|
90
|
+
* @property {String} inputAlign 输入框内容水平对齐方式 (默认 'left' )
|
|
91
|
+
* @property {Object} inputStyle 自定义输入框样式,对象形式
|
|
92
|
+
* @property {Boolean} disabled 是否启用输入框(默认 false )
|
|
93
|
+
* @property {String} borderColor 边框颜色,配置了颜色,才会有边框 (默认 'transparent' )
|
|
94
|
+
* @property {String} searchIconColor 搜索图标的颜色,默认同输入框字体颜色 (默认 '#909399' )
|
|
95
|
+
* @property {Number | String} searchIconSize 搜索图标的字体,默认22
|
|
96
|
+
* @property {String} color 输入框字体颜色(默认 '#606266' )
|
|
97
|
+
* @property {String} placeholderColor placeholder的颜色(默认 '#909399' )
|
|
98
|
+
* @property {String} searchIcon 输入框左边的图标,可以为uvui图标名称或图片路径 (默认 'search' )
|
|
99
|
+
* @property {String} margin 组件与其他上下左右元素之间的距离,带单位的字符串形式,如"30px" (默认 '0' )
|
|
100
|
+
* @property {Boolean} animation 是否开启动画,见上方说明(默认 false )
|
|
101
|
+
* @property {String | Number} maxlength 输入框最大能输入的长度,-1为不限制长度 (默认 '-1' )
|
|
102
|
+
* @property {String | Number} height 输入框高度,单位px(默认 64 )
|
|
103
|
+
* @property {String | Number} label 搜索框左边显示内容
|
|
104
|
+
* @property {Object} boxStyle 自定义内容框样式,设置padding
|
|
105
|
+
* @property {Object} customStyle 定义需要用到的外部样式
|
|
106
|
+
*
|
|
107
|
+
* @event {Function} change 输入框内容发生变化时触发
|
|
108
|
+
* @event {Function} search 用户确定搜索时触发,用户按回车键,或者手机键盘右下角的"搜索"键时触发
|
|
109
|
+
* @event {Function} custom 用户点击右侧控件时触发
|
|
110
|
+
* @event {Function} clear 用户点击清除按钮时触发
|
|
111
|
+
* @example <uv-search placeholder="日照香炉生紫烟" v-model="keyword"></uv-search>
|
|
112
|
+
*/
|
|
113
|
+
export default {
|
|
114
|
+
name: "uv-search",
|
|
115
|
+
emits: ['click', 'input', 'change', 'clear', 'search', 'custom', 'focus', 'blur', 'clickIcon', 'update:modelValue'],
|
|
116
|
+
mixins: [mpMixin, mixin, props],
|
|
117
|
+
data() {
|
|
118
|
+
return {
|
|
119
|
+
keyword: '',
|
|
120
|
+
showClear: false, // 是否显示右边的清除图标
|
|
121
|
+
show: false,
|
|
122
|
+
// 标记input当前状态是否处于聚焦中,如果是,才会显示右侧的清除控件
|
|
123
|
+
focused: this.focus
|
|
124
|
+
};
|
|
125
|
+
},
|
|
126
|
+
created() {
|
|
127
|
+
// #ifndef VUE3
|
|
128
|
+
this.keyword = this.value;
|
|
129
|
+
// #endif
|
|
130
|
+
// #ifdef VUE3
|
|
131
|
+
this.keyword = this.modelValue;
|
|
132
|
+
// #endif
|
|
133
|
+
},
|
|
134
|
+
watch: {
|
|
135
|
+
value(nVal){
|
|
136
|
+
this.keyword = nVal;
|
|
137
|
+
},
|
|
138
|
+
modelValue(nVal){
|
|
139
|
+
this.keyword = nVal;
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
computed: {
|
|
143
|
+
showActionBtn() {
|
|
144
|
+
return !this.animation && this.showAction
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
methods: {
|
|
148
|
+
keywordChange(){
|
|
149
|
+
this.$emit('input', this.keyword)
|
|
150
|
+
this.$emit('update:modelValue', this.keyword)
|
|
151
|
+
this.$emit('change', this.keyword);
|
|
152
|
+
},
|
|
153
|
+
// 目前HX2.6.9 v-model双向绑定无效,故监听input事件获取输入框内容的变化
|
|
154
|
+
inputChange(e) {
|
|
155
|
+
this.keyword = e.detail.value;
|
|
156
|
+
this.keywordChange();
|
|
157
|
+
},
|
|
158
|
+
// 清空输入
|
|
159
|
+
// 也可以作为用户通过this.$refs形式调用清空输入框内容
|
|
160
|
+
clear() {
|
|
161
|
+
this.keyword = '';
|
|
162
|
+
this.$nextTick(() => {
|
|
163
|
+
this.$emit('clear');
|
|
164
|
+
})
|
|
165
|
+
this.keywordChange();
|
|
166
|
+
},
|
|
167
|
+
// 确定搜索
|
|
168
|
+
search(e) {
|
|
169
|
+
this.$emit('search', e.detail.value);
|
|
170
|
+
try {
|
|
171
|
+
// 收起键盘
|
|
172
|
+
uni.hideKeyboard();
|
|
173
|
+
} catch (e) {}
|
|
174
|
+
},
|
|
175
|
+
// 点击右边自定义按钮的事件
|
|
176
|
+
custom() {
|
|
177
|
+
this.$emit('custom', this.keyword);
|
|
178
|
+
try {
|
|
179
|
+
// 收起键盘
|
|
180
|
+
uni.hideKeyboard();
|
|
181
|
+
} catch (e) {}
|
|
182
|
+
},
|
|
183
|
+
// 获取焦点
|
|
184
|
+
getFocus() {
|
|
185
|
+
this.focused = true;
|
|
186
|
+
// 开启右侧搜索按钮展开的动画效果
|
|
187
|
+
if (this.animation && this.showAction) this.show = true;
|
|
188
|
+
this.$emit('focus', this.keyword);
|
|
189
|
+
},
|
|
190
|
+
// 失去焦点
|
|
191
|
+
blur() {
|
|
192
|
+
// 最开始使用的是监听图标@touchstart事件,自从hx2.8.4后,此方法在微信小程序出错
|
|
193
|
+
// 这里改为监听点击事件,手点击清除图标时,同时也发生了@blur事件,导致图标消失而无法点击,这里做一个延时
|
|
194
|
+
setTimeout(() => {
|
|
195
|
+
this.focused = false;
|
|
196
|
+
}, 100)
|
|
197
|
+
this.show = false;
|
|
198
|
+
this.$emit('blur', this.keyword);
|
|
199
|
+
},
|
|
200
|
+
// 点击搜索框,只有disabled=true时才发出事件,因为禁止了输入,意味着是想跳转真正的搜索页
|
|
201
|
+
clickHandler() {
|
|
202
|
+
if (this.disabled) this.$emit('click');
|
|
203
|
+
},
|
|
204
|
+
// 点击左边图标
|
|
205
|
+
clickIcon() {
|
|
206
|
+
this.$emit('clickIcon');
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
</script>
|
|
211
|
+
|
|
212
|
+
<style lang="scss" scoped>
|
|
213
|
+
@import '../../libs/css/components.scss';
|
|
214
|
+
@import '../../libs/css/color.scss';
|
|
215
|
+
$uv-search-content-padding: 0 10px !default;
|
|
216
|
+
$uv-search-label-color: $uv-main-color !default;
|
|
217
|
+
$uv-search-label-font-size: 14px !default;
|
|
218
|
+
$uv-search-label-margin: 0 4px !default;
|
|
219
|
+
$uv-search-close-size: 20px !default;
|
|
220
|
+
$uv-search-close-radius: 100px !default;
|
|
221
|
+
$uv-search-close-bgColor: #C6C7CB !default;
|
|
222
|
+
$uv-search-close-transform: scale(0.82) !default;
|
|
223
|
+
$uv-search-input-font-size: 14px !default;
|
|
224
|
+
$uv-search-input-margin: 0 15px 0 5px !default;
|
|
225
|
+
$uv-search-input-color: $uv-main-color !default;
|
|
226
|
+
$uv-search-input-placeholder-color: $uv-tips-color !default;
|
|
227
|
+
$uv-search-action-font-size: 14px !default;
|
|
228
|
+
$uv-search-action-color: $uv-main-color !default;
|
|
229
|
+
$uv-search-action-width: 0 !default;
|
|
230
|
+
$uv-search-action-active-width: 40px !default;
|
|
231
|
+
$uv-search-action-margin-left: 5px !default;
|
|
232
|
+
/* #ifdef H5 */
|
|
233
|
+
// iOS15在H5下,hx的某些版本,input type=search时,会多了一个搜索图标,进行移除
|
|
234
|
+
[type="search"]::-webkit-search-decoration {
|
|
235
|
+
display: none;
|
|
236
|
+
}
|
|
237
|
+
/* #endif */
|
|
238
|
+
.uv-search {
|
|
239
|
+
@include flex(row);
|
|
240
|
+
align-items: center;
|
|
241
|
+
flex: 1;
|
|
242
|
+
&__content {
|
|
243
|
+
position: relative;
|
|
244
|
+
@include flex;
|
|
245
|
+
align-items: center;
|
|
246
|
+
padding: $uv-search-content-padding;
|
|
247
|
+
flex: 1;
|
|
248
|
+
justify-content: space-between;
|
|
249
|
+
border-width: 1px;
|
|
250
|
+
border-color: transparent;
|
|
251
|
+
border-style: solid;
|
|
252
|
+
overflow: hidden;
|
|
253
|
+
&__icon {
|
|
254
|
+
@include flex;
|
|
255
|
+
align-items: center;
|
|
256
|
+
}
|
|
257
|
+
&__label {
|
|
258
|
+
color: $uv-search-label-color;
|
|
259
|
+
font-size: $uv-search-label-font-size;
|
|
260
|
+
margin: $uv-search-label-margin;
|
|
261
|
+
}
|
|
262
|
+
&__close {
|
|
263
|
+
width: $uv-search-close-size;
|
|
264
|
+
height: $uv-search-close-size;
|
|
265
|
+
border-top-left-radius: $uv-search-close-radius;
|
|
266
|
+
border-top-right-radius: $uv-search-close-radius;
|
|
267
|
+
border-bottom-left-radius: $uv-search-close-radius;
|
|
268
|
+
border-bottom-right-radius: $uv-search-close-radius;
|
|
269
|
+
background-color: $uv-search-close-bgColor;
|
|
270
|
+
@include flex(row);
|
|
271
|
+
align-items: center;
|
|
272
|
+
justify-content: center;
|
|
273
|
+
transform: $uv-search-close-transform;
|
|
274
|
+
}
|
|
275
|
+
&__input {
|
|
276
|
+
flex: 1;
|
|
277
|
+
font-size: $uv-search-input-font-size;
|
|
278
|
+
line-height: 1;
|
|
279
|
+
margin: $uv-search-input-margin;
|
|
280
|
+
color: $uv-search-input-color;
|
|
281
|
+
&--placeholder {
|
|
282
|
+
color: $uv-search-input-placeholder-color;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
&__disabled {
|
|
286
|
+
position: absolute;
|
|
287
|
+
left: 0;
|
|
288
|
+
top: 0;
|
|
289
|
+
bottom: 0;
|
|
290
|
+
right: 0;
|
|
291
|
+
z-index: 2;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
&__action {
|
|
295
|
+
font-size: $uv-search-action-font-size;
|
|
296
|
+
color: $uv-search-action-color;
|
|
297
|
+
width: $uv-search-action-width;
|
|
298
|
+
overflow: hidden;
|
|
299
|
+
transition-property: width;
|
|
300
|
+
transition-duration: 0.3s;
|
|
301
|
+
/* #ifndef APP-NVUE */
|
|
302
|
+
white-space: nowrap;
|
|
303
|
+
/* #endif */
|
|
304
|
+
text-align: center;
|
|
305
|
+
&--active {
|
|
306
|
+
width: $uv-search-action-active-width;
|
|
307
|
+
margin-left: $uv-search-action-margin-left;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
</style>
|