btxui 1.0.2 → 1.0.3
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/demo.html +1 -0
- package/index.common.js +93 -0
- package/index.common.js.map +1 -0
- package/index.umd.js +104 -0
- package/index.umd.js.map +1 -0
- package/index.umd.min.js +2 -0
- package/index.umd.min.js.map +1 -0
- package/package.json +12 -23
- package/README.md +0 -42
- package/app.vue +0 -162
- package/assets/css/_main.js +0 -73
- package/assets/css/btx.min.css +0 -1
- package/assets/css/btx.mob.min.css +0 -1
- package/assets/css/btx.pad.min.css +0 -1
- package/assets/css/btx.webapp.min.css +0 -1
- package/assets/css/custom_fonts/iconfont.css +0 -37
- package/assets/css/custom_fonts/iconfont.eot +0 -0
- package/assets/css/custom_fonts/iconfont.svg +0 -47
- package/assets/css/custom_fonts/iconfont.ttf +0 -0
- package/assets/css/custom_fonts/iconfont.woff +0 -0
- package/assets/css/custom_fonts/iconfont.woff2 +0 -0
- package/assets/css/res-l.css +0 -47
- package/assets/css/res-m.css +0 -47
- package/assets/css/res-s.css +0 -61
- package/assets/custom_fonts/iconfont.css +0 -37
- package/assets/custom_fonts/iconfont.eot +0 -0
- package/assets/custom_fonts/iconfont.svg +0 -47
- package/assets/custom_fonts/iconfont.ttf +0 -0
- package/assets/custom_fonts/iconfont.woff +0 -0
- package/assets/custom_fonts/iconfont.woff2 +0 -0
- package/assets/js/Btx.js +0 -196
- package/assets/js/Utils.js +0 -421
- package/assets/js/fastclick.js +0 -802
- package/assets/js/lazy.min.js +0 -2
- package/assets/js/touchwipe.js +0 -111
- package/assets/server.js +0 -8
- package/assets/start_site_code_str.js +0 -119
- package/cdn/css/btx.min.css +0 -1
- package/cdn/css/btx.min.css.map +0 -1
- package/cdn/fonts/iconfont.ttf +0 -0
- package/cdn/fonts/iconfont.woff +0 -0
- package/cdn/fonts/iconfont.woff2 +0 -0
- package/components/BTXUI/app/app-wid.vue +0 -182
- package/components/BTXUI/btn/btn-wid.vue +0 -128
- package/components/BTXUI/carousel/carousel-wid.vue +0 -138
- package/components/BTXUI/checkbox/checkbox-wid.vue +0 -72
- package/components/BTXUI/confirm/confirm-wid.vue +0 -279
- package/components/BTXUI/content/content-checkbox-wid.vue +0 -44
- package/components/BTXUI/content/content-node-wid.vue +0 -114
- package/components/BTXUI/content/content-tag-wid.vue +0 -25
- package/components/BTXUI/content/content-wid.vue +0 -254
- package/components/BTXUI/core/anis/ani-fail.vue +0 -46
- package/components/BTXUI/core/anis/ani-loading.vue +0 -32
- package/components/BTXUI/core/anis/ani-notic.vue +0 -47
- package/components/BTXUI/core/anis/ani-success.vue +0 -48
- package/components/BTXUI/core/b-drag.vue +0 -258
- package/components/BTXUI/core/b-grid.vue +0 -84
- package/components/BTXUI/core/b-hot.vue +0 -171
- package/components/BTXUI/core/b-icon.vue +0 -76
- package/components/BTXUI/core/b-img.vue +0 -84
- package/components/BTXUI/core/b-input.vue +0 -198
- package/components/BTXUI/core/b-list.vue +0 -276
- package/components/BTXUI/core/b-text/doc.ts +0 -9
- package/components/BTXUI/core/b-text/index.vue +0 -16
- package/components/BTXUI/core/b-textarea.vue +0 -58
- package/components/BTXUI/core/b-video.vue +0 -35
- package/components/BTXUI/core/b-view/doc.ts +0 -10
- package/components/BTXUI/core/b-view/index.vue +0 -20
- package/components/BTXUI/core/b-webview.vue +0 -20
- package/components/BTXUI/core/lib/ChapterLink.js +0 -49
- package/components/BTXUI/core/lib/Search.vue +0 -60
- package/components/BTXUI/core/styles/doc.ts +0 -55
- package/components/BTXUI/core/styles/index.vue +0 -98
- package/components/BTXUI/core/styles/prestyles.ts +0 -471
- package/components/BTXUI/core/styles/theme.ts +0 -29
- package/components/BTXUI/drawer/drawer-wid.vue +0 -165
- package/components/BTXUI/drawer/title-tag-wid.vue +0 -114
- package/components/BTXUI/form/form-select-wid.vue +0 -57
- package/components/BTXUI/form/form-wid.vue +0 -324
- package/components/BTXUI/formPannel/form-pannel-wid.vue +0 -133
- package/components/BTXUI/imgsUpload/imgs-upload-wid.vue +0 -149
- package/components/BTXUI/index.js +0 -83
- package/components/BTXUI/pageFlip/page-flip-wid.vue +0 -206
- package/components/BTXUI/pannel/pannel-wid.vue +0 -167
- package/components/BTXUI/range/range-wid.vue +0 -134
- package/components/BTXUI/search/search-wid.vue +0 -80
- package/components/BTXUI/select/select-wid.vue +0 -186
- package/components/BTXUI/slider/slider-wid.vue +0 -444
- package/components/BTXUI/tab/tab-wid.vue +0 -109
- package/components/BTXUI/table/table-wid.vue +0 -324
- package/components/BTXUI/tag/tag-wid.vue +0 -183
- package/components/BTXUI/tags/tags-wid.vue +0 -121
- package/components/BTXUI/tooltip/tooltip-wid.vue +0 -146
- package/components/BTXUI/upload/upload-wid.vue +0 -215
- package/components/BTXUI/waterfall/waterfall-wid.vue +0 -166
- package/components/header-info.vue +0 -167
- package/composables/@types.ts +0 -4
- package/composables/api.ts +0 -18
- package/env.d.ts +0 -5
- package/main.js +0 -16
- package/nuxt.config.ts +0 -51
- package/pages/article.vue +0 -16
- package/pages/download.vue +0 -50
- package/pages/example/app_wid/app/data_demo.vue +0 -9
- package/pages/example/app_wid/app/download_demo.vue +0 -9
- package/pages/example/app_wid/app/list_demo.vue +0 -11
- package/pages/example/app_wid/app/system_demo.vue +0 -9
- package/pages/example/app_wid/app_wid_demo.vue +0 -198
- package/pages/example/app_wid/btn_wid_demo.vue +0 -179
- package/pages/example/app_wid/carousel_wid_demo.vue +0 -152
- package/pages/example/app_wid/checkbox_wid_demo.vue +0 -65
- package/pages/example/app_wid/confirm_wid_demo.vue +0 -197
- package/pages/example/app_wid/content_wid_demo.vue +0 -369
- package/pages/example/app_wid/drawer_wid_demo.vue +0 -155
- package/pages/example/app_wid/form_pannel_wid_demo.vue +0 -338
- package/pages/example/app_wid/form_wid_demo.vue +0 -550
- package/pages/example/app_wid/imgs_upload_wid_demo.vue +0 -159
- package/pages/example/app_wid/index.js +0 -158
- package/pages/example/app_wid/page_flip_wid_demo.vue +0 -99
- package/pages/example/app_wid/pannel_wid_demo.vue +0 -177
- package/pages/example/app_wid/range_wid_demo.vue +0 -101
- package/pages/example/app_wid/search_wid_demo.vue +0 -75
- package/pages/example/app_wid/select_wid_demo.vue +0 -217
- package/pages/example/app_wid/slider_wid_demo.vue +0 -143
- package/pages/example/app_wid/tab_wid_demo.vue +0 -170
- package/pages/example/app_wid/table_wid_demo.vue +0 -377
- package/pages/example/app_wid/tag_wid_demo.vue +0 -133
- package/pages/example/app_wid/tags_wid_demo.vue +0 -143
- package/pages/example/app_wid/tooltip_wid_demo.vue +0 -117
- package/pages/example/app_wid/upload_wid_demo.vue +0 -123
- package/pages/example/base_wid/b_drag_demo.vue +0 -159
- package/pages/example/base_wid/b_grid_demo.vue +0 -225
- package/pages/example/base_wid/b_hot_demo.vue +0 -135
- package/pages/example/base_wid/b_icon_demo.vue +0 -80
- package/pages/example/base_wid/b_img_demo.vue +0 -95
- package/pages/example/base_wid/b_input_demo.vue +0 -171
- package/pages/example/base_wid/b_list_demo.vue +0 -241
- package/pages/example/base_wid/b_style_demo.vue +0 -928
- package/pages/example/base_wid/b_text_demo.vue +0 -36
- package/pages/example/base_wid/b_textarea_demo.vue +0 -64
- package/pages/example/base_wid/b_video_demo.vue +0 -42
- package/pages/example/base_wid/b_view_demo.vue +0 -36
- package/pages/example/base_wid/index.js +0 -76
- package/pages/example/content.js +0 -49
- package/pages/example/global_style/animation.vue +0 -197
- package/pages/example/global_style/color.vue +0 -134
- package/pages/example/global_style/decoration.vue +0 -546
- package/pages/example/global_style/icon.vue +0 -345
- package/pages/example/global_style/index.js +0 -52
- package/pages/example/global_style/layout.vue +0 -846
- package/pages/example/global_style/special.vue +0 -37
- package/pages/example/global_style/table.vue +0 -298
- package/pages/example/global_style/text.vue +0 -159
- package/pages/index.vue +0 -43
- package/pages/level_widget.vue +0 -11
- package/pages/start.vue +0 -200
- package/plugins/index.ts +0 -2
- package/public/favicon.gif +0 -0
- package/public/fonts/iconfont.ttf +0 -0
- package/public/fonts/iconfont.woff +0 -0
- package/public/fonts/iconfont.woff2 +0 -0
- package/public/img/banner.jpg +0 -0
- package/public/img/banner2.jpg +0 -0
- package/public/img/bg_pattern.png +0 -0
- package/public/img/btx.jpg +0 -0
- package/public/img/btx_ui.jpg +0 -0
- package/public/img/dir.png +0 -0
- package/public/img/f.png +0 -0
- package/public/img/head.jpg +0 -0
- package/public/img/head2.jpg +0 -0
- package/public/img/home_ico.png +0 -0
- package/public/img/icons.svg +0 -164
- package/public/img/mechanism/b-style.png +0 -0
- package/public/img/mechanism/slider-wid.png +0 -0
- package/public/img/mechanism/upload-wid.png +0 -0
- package/public/img/transform_origin.png +0 -0
- package/sass/animation.scss +0 -400
- package/sass/btx.mob.scss +0 -10
- package/sass/btx.pad.scss +0 -3
- package/sass/btx.scss +0 -22
- package/sass/btx.webapp.scss +0 -22
- package/sass/colors.scss +0 -65
- package/sass/decoration.scss +0 -220
- package/sass/flex.scss +0 -29
- package/sass/icons.scss +0 -100
- package/sass/layout.scss +0 -88
- package/sass/reset.scss +0 -111
- package/sass/response/flex_mixin.scss +0 -91
- package/sass/response/layout_mixin.scss +0 -227
- package/sass/response/main.scss +0 -59
- package/sass/response/text_mixin.scss +0 -65
- package/sass/scroll.scss +0 -100
- package/sass/special.scss +0 -13
- package/sass/table.scss +0 -103
- package/sass/text.scss +0 -86
- package/sass/webpack.config.js +0 -31
- package/tsconfig.json +0 -4
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<b-view :styles="`fixed max t-0 l-0 trans-fast flex-${pos} ${matte? '': 'bg-none'} z${matteZIndex} alpha-0`"
|
|
3
|
-
:states="{
|
|
4
|
-
show: {
|
|
5
|
-
style: 'alpha-1',
|
|
6
|
-
state: visible
|
|
7
|
-
}
|
|
8
|
-
}"
|
|
9
|
-
>
|
|
10
|
-
|
|
11
|
-
<!--遮罩背景-->
|
|
12
|
-
<b-hot @on_click="matteClose === 'click' && $_close()"
|
|
13
|
-
@on_dblclick="matteClose === 'dblclick' && $_close()"
|
|
14
|
-
:forbid="matteClose? false: true"
|
|
15
|
-
:styles="`abs max t-0 l-0 bg-color-${matteColor}`">
|
|
16
|
-
<b-view styles="max bg-repeat" :bg-img="mattePattern"></b-view>
|
|
17
|
-
</b-hot>
|
|
18
|
-
|
|
19
|
-
<b-view :styles="`rel trans-fast bg-use ${max_pannel_styles} l-${offset.x} t-${offset.y} ${transition.out_styles}`"
|
|
20
|
-
:states="{
|
|
21
|
-
show: {
|
|
22
|
-
style: `${matte? 'trans-delay-.4': ''} ${transition.in_styles}`,
|
|
23
|
-
state: visible
|
|
24
|
-
}
|
|
25
|
-
}">
|
|
26
|
-
|
|
27
|
-
<!--关闭按钮-->
|
|
28
|
-
<b-hot v-if="closeBtn" @on_click="$_close" styles="abs flex-5 r-.4 t-.4 w-2 h-2 bg-color-neutral color-dark round z1"
|
|
29
|
-
hover="bg-color-red color-light">
|
|
30
|
-
<b-icon icon="close" />
|
|
31
|
-
</b-hot>
|
|
32
|
-
|
|
33
|
-
<slot/>
|
|
34
|
-
</b-view>
|
|
35
|
-
</b-view>
|
|
36
|
-
</template>
|
|
37
|
-
|
|
38
|
-
<script>
|
|
39
|
-
import BView from "@/components/BTXUI/core/b-view";
|
|
40
|
-
import BHot from "@/components/BTXUI/core/b-hot";
|
|
41
|
-
import BIcon from "@/components/BTXUI/core/b-icon";
|
|
42
|
-
|
|
43
|
-
const desc = ["该组件用于自定义弹窗交互操作。"],
|
|
44
|
-
extend = [],
|
|
45
|
-
dependent = ["b-icon", "b-hot", "b-view"],
|
|
46
|
-
api = null,
|
|
47
|
-
init_data = `{
|
|
48
|
-
visible: "(model)面板显示状态",
|
|
49
|
-
/* pos: "面板定位(基于视口九宫格定位: 1-9)" */,
|
|
50
|
-
/* offset: {
|
|
51
|
-
x: "水平方向位移样式值,默认单位 rem",
|
|
52
|
-
y: "垂直方向位移样式值,默认单位 rem",
|
|
53
|
-
} */,
|
|
54
|
-
/* transition: {
|
|
55
|
-
in_styles: "入场样式值",
|
|
56
|
-
out_styles: "出场样式值"
|
|
57
|
-
} */,
|
|
58
|
-
/* matte: "是否启用遮罩,默认不启用" */,
|
|
59
|
-
/* matteColor: "遮罩颜色" */,
|
|
60
|
-
/* mattePattern: "遮罩图案" */,
|
|
61
|
-
/* matteZIndex: "遮罩 z 轴层级,默认为 9" */,
|
|
62
|
-
/* closeBtn: "是否启用关闭按钮" */,
|
|
63
|
-
/* matteClose: "遮罩自身点击关闭面板:click 单击、dblclick 双击" */,
|
|
64
|
-
/* maxEnable: "{
|
|
65
|
-
width: "满屏弹窗宽度样式数值",
|
|
66
|
-
height: "满屏弹窗高度样式数值",
|
|
67
|
-
bg: "弹窗背景色样式色值",
|
|
68
|
-
}" */,
|
|
69
|
-
}`;
|
|
70
|
-
|
|
71
|
-
export default {
|
|
72
|
-
name: "pannel-wid",
|
|
73
|
-
introduce: { desc, extend, dependent, api, init_data },
|
|
74
|
-
components: {
|
|
75
|
-
BView,
|
|
76
|
-
BHot,
|
|
77
|
-
BIcon
|
|
78
|
-
},
|
|
79
|
-
model:{
|
|
80
|
-
prop: "visible",
|
|
81
|
-
event: "on_click"
|
|
82
|
-
},
|
|
83
|
-
props: {
|
|
84
|
-
pos: {
|
|
85
|
-
type: [Number, String],
|
|
86
|
-
required: false,
|
|
87
|
-
default: 5
|
|
88
|
-
},
|
|
89
|
-
offset: {
|
|
90
|
-
type: Object,
|
|
91
|
-
required: false,
|
|
92
|
-
default: ()=>{
|
|
93
|
-
return {x:0, y:0}
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
transition: {
|
|
97
|
-
type: Object,
|
|
98
|
-
required: false,
|
|
99
|
-
default: ()=>{
|
|
100
|
-
return {
|
|
101
|
-
in_styles: "alpha-1 scale-1",
|
|
102
|
-
out_styles: "alpha-0 scale-0"
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
visible: {
|
|
107
|
-
type: Boolean,
|
|
108
|
-
required: false
|
|
109
|
-
},
|
|
110
|
-
matte: {
|
|
111
|
-
type: Boolean,
|
|
112
|
-
required: false
|
|
113
|
-
},
|
|
114
|
-
matteColor: {
|
|
115
|
-
type: String,
|
|
116
|
-
required: false
|
|
117
|
-
},
|
|
118
|
-
mattePattern: {
|
|
119
|
-
type: String,
|
|
120
|
-
required: false
|
|
121
|
-
},
|
|
122
|
-
matteZIndex: {
|
|
123
|
-
type: [String, Number],
|
|
124
|
-
required: false,
|
|
125
|
-
default: 9
|
|
126
|
-
},
|
|
127
|
-
closeBtn: {
|
|
128
|
-
type: Boolean,
|
|
129
|
-
required: false,
|
|
130
|
-
},
|
|
131
|
-
matteClose: {
|
|
132
|
-
type: String,
|
|
133
|
-
required: false,
|
|
134
|
-
},
|
|
135
|
-
maxEnable: {
|
|
136
|
-
type: Object,
|
|
137
|
-
required: false
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
data(){
|
|
141
|
-
return {
|
|
142
|
-
|
|
143
|
-
//满屏弹窗样式
|
|
144
|
-
max_pannel_styles: this.maxEnable? `w-${this.maxEnable.width} h-${this.maxEnable.height} bg-color-${this.maxEnable.bg}`: ''
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
watch: {
|
|
149
|
-
|
|
150
|
-
//含遮罩或全屏状态时禁止 body 滚动
|
|
151
|
-
visible(state){
|
|
152
|
-
if(this.matte || this.maxEnable){
|
|
153
|
-
document.body.style.overflow = state === true? "hidden": "auto";
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
},
|
|
158
|
-
methods: {
|
|
159
|
-
|
|
160
|
-
//关闭面板
|
|
161
|
-
$_close(){
|
|
162
|
-
this.$emit("on_click", false);
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
</script>
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<b-view :styles="`max-w rel flex-4 round-lg bg-color-${colors.track} pad-r-${blockSize.width} h-${blockSize.height}`">
|
|
3
|
-
|
|
4
|
-
<!--刻度-->
|
|
5
|
-
<b-view v-if="tick" styles="rel t-.6 h-1.2"></b-view>
|
|
6
|
-
|
|
7
|
-
<!--轨道线-->
|
|
8
|
-
<b-view :styles="`rel max-w h-2px round-lg bg-color-neutral l-${blockSize.width / 2}`"></b-view>
|
|
9
|
-
|
|
10
|
-
<!--滑块-->
|
|
11
|
-
<b-drag :styles="`color-neutral round-lg line thick-1 line-${colors.normal.line} w-${blockSize.width} h-${blockSize.height} bg-color-${colors.normal.bg}`"
|
|
12
|
-
:drag-start="`shadow line-${colors.act.line} bg-color-${colors.act.bg}`"
|
|
13
|
-
@on_move="$_drag_move"
|
|
14
|
-
:free-drag="true"></b-drag>
|
|
15
|
-
|
|
16
|
-
</b-view>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<script>
|
|
20
|
-
import BView from "@/components/BTXUI/core/b-view"
|
|
21
|
-
import BDrag from "@/components/BTXUI/core/b-drag"
|
|
22
|
-
import BHot from "@/components/BTXUI/core/b-hot"
|
|
23
|
-
|
|
24
|
-
const desc = ["该组件用于实现区间值拖动选取。"],
|
|
25
|
-
extend = [],
|
|
26
|
-
dependent = ["b-drag", "b-view", "b-hot"],
|
|
27
|
-
api = null,
|
|
28
|
-
init_data = `{
|
|
29
|
-
curVal: "(model) 当前拖动数值",
|
|
30
|
-
min: "拖动区间最小值",
|
|
31
|
-
max: "拖动区间最大值",
|
|
32
|
-
/* step: "拖动步进值" */,
|
|
33
|
-
/* tick: "是否显示刻度,默认 false" */,
|
|
34
|
-
/* blockSize: {
|
|
35
|
-
width: "滑块宽度",
|
|
36
|
-
height: "滑块高度",
|
|
37
|
-
} */,
|
|
38
|
-
/* colors: {
|
|
39
|
-
normal: {
|
|
40
|
-
bg: "滑块颜色",
|
|
41
|
-
line: "滑块描边色"
|
|
42
|
-
},
|
|
43
|
-
act: {
|
|
44
|
-
bg: "滑块激活颜色",
|
|
45
|
-
line: "滑块激活描边色"
|
|
46
|
-
},
|
|
47
|
-
track: "轨道颜色"
|
|
48
|
-
} */
|
|
49
|
-
}`;
|
|
50
|
-
|
|
51
|
-
export default {
|
|
52
|
-
name: "range-wid",
|
|
53
|
-
introduce: { desc, extend, dependent, api, init_data },
|
|
54
|
-
components: {
|
|
55
|
-
BView,
|
|
56
|
-
BDrag,
|
|
57
|
-
BHot
|
|
58
|
-
},
|
|
59
|
-
model: {
|
|
60
|
-
prop: "curVal",
|
|
61
|
-
event: "on_drag"
|
|
62
|
-
},
|
|
63
|
-
props: {
|
|
64
|
-
curVal: {
|
|
65
|
-
type: Number,
|
|
66
|
-
required: true,
|
|
67
|
-
},
|
|
68
|
-
min: {
|
|
69
|
-
type: Number,
|
|
70
|
-
required: true,
|
|
71
|
-
},
|
|
72
|
-
max: {
|
|
73
|
-
type: Number,
|
|
74
|
-
required: true,
|
|
75
|
-
},
|
|
76
|
-
step: {
|
|
77
|
-
type: Number,
|
|
78
|
-
required: false
|
|
79
|
-
},
|
|
80
|
-
blockSize: {
|
|
81
|
-
type: Object,
|
|
82
|
-
required: false,
|
|
83
|
-
default: ()=>{
|
|
84
|
-
return {
|
|
85
|
-
width: 5,
|
|
86
|
-
height: 2
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
tick: {
|
|
91
|
-
type: Boolean,
|
|
92
|
-
required: false
|
|
93
|
-
},
|
|
94
|
-
colors: {
|
|
95
|
-
type: Object,
|
|
96
|
-
required: false,
|
|
97
|
-
default: ()=>{
|
|
98
|
-
return {
|
|
99
|
-
normal: {
|
|
100
|
-
bg: "lgray",
|
|
101
|
-
line: "mgray",
|
|
102
|
-
},
|
|
103
|
-
act: {
|
|
104
|
-
bg: "light",
|
|
105
|
-
line: "neutral",
|
|
106
|
-
},
|
|
107
|
-
track: "neutral",
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
data(){
|
|
113
|
-
return {
|
|
114
|
-
|
|
115
|
-
//滑动长度
|
|
116
|
-
drag_len: 0,
|
|
117
|
-
|
|
118
|
-
//当前滑动距离
|
|
119
|
-
cur_drag_len: 0,
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
methods: {
|
|
124
|
-
|
|
125
|
-
//拖动
|
|
126
|
-
$_drag_move(cur_pos, limit_area){
|
|
127
|
-
const max = Math.round(this.max),
|
|
128
|
-
min = Math.round(this.min);
|
|
129
|
-
this.$emit("on_drag", Math.round(max * cur_pos.x / limit_area.x) + min);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
</script>
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<b-view :styles="`flex-4 round-lg pad-v-.7 pad-h-1.4 bg-color-${colors.bg} color-${colors.text} ${colors.line? 'thick-1 line line-' + colors.line: ''}`">
|
|
3
|
-
<b-icon v-if="icon === 'left'" icon="sousuo" styles="mrg-r-1 scale-1.7" />
|
|
4
|
-
<b-input type="text" name="keyword" :placeholder="notic" focus="bg-color-none" v-model="search_text" />
|
|
5
|
-
<b-icon v-if="icon === 'right'" icon="sousuo" styles="mrg-l-1 scale-1.7" />
|
|
6
|
-
</b-view>
|
|
7
|
-
</template>
|
|
8
|
-
|
|
9
|
-
<script>
|
|
10
|
-
import BView from "@/components/BTXUI/core/b-view"
|
|
11
|
-
import BIcon from "@/components/BTXUI/core/b-icon"
|
|
12
|
-
import BInput from "@/components/BTXUI/core/b-input"
|
|
13
|
-
|
|
14
|
-
const desc = ["该组件用于搜索栏构建及操作。"],
|
|
15
|
-
extend = [],
|
|
16
|
-
dependent = ["b-input", "b-icon", "b-view"],
|
|
17
|
-
api = {
|
|
18
|
-
event: [
|
|
19
|
-
{
|
|
20
|
-
name: "on_search",
|
|
21
|
-
ef: "搜索字符串",
|
|
22
|
-
params: "search_text"
|
|
23
|
-
}
|
|
24
|
-
]
|
|
25
|
-
},
|
|
26
|
-
init_data = `{
|
|
27
|
-
/* notic: "提示文字" */,
|
|
28
|
-
/* icon: "搜索图标显示:left(默认)、right、none" */,
|
|
29
|
-
/* colors: {
|
|
30
|
-
text: "常规状态文字颜色",
|
|
31
|
-
bg: "常规状态背景颜色",
|
|
32
|
-
line: "常规状态描边颜色"
|
|
33
|
-
} */
|
|
34
|
-
}`;
|
|
35
|
-
|
|
36
|
-
export default {
|
|
37
|
-
name: "search-wid",
|
|
38
|
-
introduce: { desc, extend, dependent, api, init_data },
|
|
39
|
-
components: {
|
|
40
|
-
BView,
|
|
41
|
-
BInput,
|
|
42
|
-
BIcon,
|
|
43
|
-
},
|
|
44
|
-
props: {
|
|
45
|
-
notic: {
|
|
46
|
-
type: String,
|
|
47
|
-
required: false,
|
|
48
|
-
},
|
|
49
|
-
icon: {
|
|
50
|
-
type: String,
|
|
51
|
-
required: false,
|
|
52
|
-
default: "left"
|
|
53
|
-
},
|
|
54
|
-
colors: {
|
|
55
|
-
type: Object,
|
|
56
|
-
required: false,
|
|
57
|
-
default: ()=>{
|
|
58
|
-
return {
|
|
59
|
-
text: "dgray",
|
|
60
|
-
bg: "neutral",
|
|
61
|
-
line: "neutral"
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
data(){
|
|
67
|
-
return {
|
|
68
|
-
|
|
69
|
-
//搜索内容
|
|
70
|
-
search_text: ""
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
watch: {
|
|
75
|
-
search_text(val){
|
|
76
|
-
this.$emit("on_search", val);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
</script>
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<b-view styles="rel color-rgba(70,70,70,.2) z2">
|
|
3
|
-
<!--热点区-->
|
|
4
|
-
<b-hot styles="flex-4 round-lg line thick-1 pad-v-.5 pad-h-1.4" @on_click="$_toggle_options">
|
|
5
|
-
<b-text v-if="selected_text" :styles="`grow-1 color-${option_color.text}`" key="val">
|
|
6
|
-
{{selected_text}}
|
|
7
|
-
</b-text>
|
|
8
|
-
<b-text v-else :styles="`alpha-.7 grow-1 color-${option_color.text}`" key="notic">
|
|
9
|
-
{{placeholder}}
|
|
10
|
-
</b-text>
|
|
11
|
-
<b-icon icon="arrow-right"
|
|
12
|
-
styles="trans-fast color-#aaa"
|
|
13
|
-
:states="{
|
|
14
|
-
spread: {
|
|
15
|
-
state: spread,
|
|
16
|
-
style: 'rotate-90'
|
|
17
|
-
}
|
|
18
|
-
}" />
|
|
19
|
-
</b-hot>
|
|
20
|
-
|
|
21
|
-
<!--下拉区-->
|
|
22
|
-
<b-view :styles="`abs transform-translateY(f1.5rem) alpha-0 round-sm mrg-t-1 shadow-lg max-w no-scroll bg-color-${option_color.normal.bg}`"
|
|
23
|
-
:states="{
|
|
24
|
-
spread: {
|
|
25
|
-
state: spread,
|
|
26
|
-
style: 'trans-fast alpha-1 transform-translateY(0)'
|
|
27
|
-
}
|
|
28
|
-
}">
|
|
29
|
-
<b-list :styles="`color-${option_color.normal.text} h-${rows? Math.min(rows, listData.length) * 2.7: 'auto'}`">
|
|
30
|
-
<b-hot v-for="(item,index) of listData" :key="index"
|
|
31
|
-
@on_click="$_select(item.val)"
|
|
32
|
-
styles="flex pad-h-1"
|
|
33
|
-
:states="{
|
|
34
|
-
selected: {
|
|
35
|
-
state: selected === item.val,
|
|
36
|
-
style: `color-${option_color.act.text} bg-color-${option_color.act.bg}`
|
|
37
|
-
}
|
|
38
|
-
}"
|
|
39
|
-
:hover="`color-${option_color.hover.text} bg-color-${option_color.hover.bg}`">
|
|
40
|
-
<b-view :styles="`flex-4 grow-1 h-2.7 ${index>0? 'line-t thick-1 line-neutral': ''}`">
|
|
41
|
-
<b-text styles="bold mrg-r-1">·</b-text>
|
|
42
|
-
<b-text>{{item.text}}</b-text>
|
|
43
|
-
</b-view>
|
|
44
|
-
</b-hot>
|
|
45
|
-
</b-list>
|
|
46
|
-
</b-view>
|
|
47
|
-
</b-view>
|
|
48
|
-
</template>
|
|
49
|
-
|
|
50
|
-
<script>
|
|
51
|
-
import BView from "@/components/BTXUI/core/b-view";
|
|
52
|
-
import BText from "@/components/BTXUI/core/b-text";
|
|
53
|
-
import BHot from "@/components/BTXUI/core/b-hot";
|
|
54
|
-
import BIcon from "@/components/BTXUI/core/b-icon";
|
|
55
|
-
import BList from "@/components/BTXUI/core/b-list";
|
|
56
|
-
|
|
57
|
-
const desc = ["该组件用于实现表单项的下拉选择。"],
|
|
58
|
-
extend = [],
|
|
59
|
-
dependent = ["b-list", "b-icon", "b-text", "b-hot", "b-view"],
|
|
60
|
-
api = null,
|
|
61
|
-
init_data = `{
|
|
62
|
-
listData: [
|
|
63
|
-
{
|
|
64
|
-
text: "文本显示",
|
|
65
|
-
val: "实际传值",
|
|
66
|
-
}...
|
|
67
|
-
],
|
|
68
|
-
/* selected: "(model)所选数据值" */,
|
|
69
|
-
/* placeholder: "选择提示" */,
|
|
70
|
-
/* rows: "显示" */,
|
|
71
|
-
/* colors: {
|
|
72
|
-
text: "显示所选文字颜色",
|
|
73
|
-
normal: {
|
|
74
|
-
text: "默认文字色",
|
|
75
|
-
bg: "默认背景色"
|
|
76
|
-
},
|
|
77
|
-
hover: {
|
|
78
|
-
text: "悬停文字色",
|
|
79
|
-
bg: "悬停背景色"
|
|
80
|
-
},
|
|
81
|
-
act: {
|
|
82
|
-
text: "激活文字色",
|
|
83
|
-
bg: "激活背景色"
|
|
84
|
-
}
|
|
85
|
-
} */,
|
|
86
|
-
}`;
|
|
87
|
-
|
|
88
|
-
export default {
|
|
89
|
-
name: "select-wid",
|
|
90
|
-
introduce: { desc, extend, dependent, api, init_data },
|
|
91
|
-
components: {
|
|
92
|
-
BView,
|
|
93
|
-
BText,
|
|
94
|
-
BHot,
|
|
95
|
-
BIcon,
|
|
96
|
-
BList
|
|
97
|
-
},
|
|
98
|
-
model: {
|
|
99
|
-
prop: "selected",
|
|
100
|
-
event: "on_select"
|
|
101
|
-
},
|
|
102
|
-
props: {
|
|
103
|
-
listData: {
|
|
104
|
-
type: Array,
|
|
105
|
-
required: true
|
|
106
|
-
},
|
|
107
|
-
selected: {
|
|
108
|
-
type: String,
|
|
109
|
-
required: false
|
|
110
|
-
},
|
|
111
|
-
placeholder: {
|
|
112
|
-
type: String,
|
|
113
|
-
required: false
|
|
114
|
-
},
|
|
115
|
-
rows: {
|
|
116
|
-
type: Number,
|
|
117
|
-
required: false
|
|
118
|
-
},
|
|
119
|
-
colors: {
|
|
120
|
-
type: Object,
|
|
121
|
-
required: false
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
computed: {
|
|
125
|
-
|
|
126
|
-
//所选项文字
|
|
127
|
-
selected_text(){
|
|
128
|
-
let selected = this.listData.find(item=>{
|
|
129
|
-
return item.val === this.selected
|
|
130
|
-
});
|
|
131
|
-
if(selected) return selected.text;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
},
|
|
135
|
-
data() {
|
|
136
|
-
return {
|
|
137
|
-
|
|
138
|
-
//展开状态
|
|
139
|
-
spread: false,
|
|
140
|
-
|
|
141
|
-
//下拉项颜色
|
|
142
|
-
option_color: {
|
|
143
|
-
text: "dgray",
|
|
144
|
-
normal: {
|
|
145
|
-
text: "mgray",
|
|
146
|
-
bg: "light"
|
|
147
|
-
},
|
|
148
|
-
hover: {
|
|
149
|
-
text: "dgray",
|
|
150
|
-
bg: "#f4f4f4"
|
|
151
|
-
},
|
|
152
|
-
act: {
|
|
153
|
-
text: "blue",
|
|
154
|
-
bg: "light"
|
|
155
|
-
},
|
|
156
|
-
...this.colors
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
};
|
|
160
|
-
},
|
|
161
|
-
methods: {
|
|
162
|
-
|
|
163
|
-
//切换面板显示
|
|
164
|
-
$_toggle_options() {
|
|
165
|
-
this[(this.spread ? "hide" : "show") + "_options"]();
|
|
166
|
-
},
|
|
167
|
-
|
|
168
|
-
//显示切换面板
|
|
169
|
-
show_options() {
|
|
170
|
-
this.spread = true;
|
|
171
|
-
},
|
|
172
|
-
|
|
173
|
-
//隐藏切换面板
|
|
174
|
-
hide_options() {
|
|
175
|
-
this.spread = false;
|
|
176
|
-
},
|
|
177
|
-
|
|
178
|
-
//下拉选择
|
|
179
|
-
$_select(data) {
|
|
180
|
-
this.hide_options();
|
|
181
|
-
this.$emit("on_select", data);
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
</script>
|