btxui 1.0.2 → 1.0.5

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.
Files changed (194) hide show
  1. package/favicon.png +0 -0
  2. package/index.js +3289 -0
  3. package/index.js.gz +0 -0
  4. package/index.umd.cjs +1 -0
  5. package/package.json +11 -23
  6. package/README.md +0 -42
  7. package/app.vue +0 -162
  8. package/assets/css/_main.js +0 -73
  9. package/assets/css/btx.min.css +0 -1
  10. package/assets/css/btx.mob.min.css +0 -1
  11. package/assets/css/btx.pad.min.css +0 -1
  12. package/assets/css/btx.webapp.min.css +0 -1
  13. package/assets/css/custom_fonts/iconfont.css +0 -37
  14. package/assets/css/custom_fonts/iconfont.eot +0 -0
  15. package/assets/css/custom_fonts/iconfont.svg +0 -47
  16. package/assets/css/custom_fonts/iconfont.ttf +0 -0
  17. package/assets/css/custom_fonts/iconfont.woff +0 -0
  18. package/assets/css/custom_fonts/iconfont.woff2 +0 -0
  19. package/assets/css/res-l.css +0 -47
  20. package/assets/css/res-m.css +0 -47
  21. package/assets/css/res-s.css +0 -61
  22. package/assets/custom_fonts/iconfont.css +0 -37
  23. package/assets/custom_fonts/iconfont.eot +0 -0
  24. package/assets/custom_fonts/iconfont.svg +0 -47
  25. package/assets/custom_fonts/iconfont.ttf +0 -0
  26. package/assets/custom_fonts/iconfont.woff +0 -0
  27. package/assets/custom_fonts/iconfont.woff2 +0 -0
  28. package/assets/js/Btx.js +0 -196
  29. package/assets/js/Utils.js +0 -421
  30. package/assets/js/fastclick.js +0 -802
  31. package/assets/js/lazy.min.js +0 -2
  32. package/assets/js/touchwipe.js +0 -111
  33. package/assets/server.js +0 -8
  34. package/assets/start_site_code_str.js +0 -119
  35. package/cdn/css/btx.min.css +0 -1
  36. package/cdn/css/btx.min.css.map +0 -1
  37. package/cdn/fonts/iconfont.ttf +0 -0
  38. package/cdn/fonts/iconfont.woff +0 -0
  39. package/cdn/fonts/iconfont.woff2 +0 -0
  40. package/components/BTXUI/app/app-wid.vue +0 -182
  41. package/components/BTXUI/btn/btn-wid.vue +0 -128
  42. package/components/BTXUI/carousel/carousel-wid.vue +0 -138
  43. package/components/BTXUI/checkbox/checkbox-wid.vue +0 -72
  44. package/components/BTXUI/confirm/confirm-wid.vue +0 -279
  45. package/components/BTXUI/content/content-checkbox-wid.vue +0 -44
  46. package/components/BTXUI/content/content-node-wid.vue +0 -114
  47. package/components/BTXUI/content/content-tag-wid.vue +0 -25
  48. package/components/BTXUI/content/content-wid.vue +0 -254
  49. package/components/BTXUI/core/anis/ani-fail.vue +0 -46
  50. package/components/BTXUI/core/anis/ani-loading.vue +0 -32
  51. package/components/BTXUI/core/anis/ani-notic.vue +0 -47
  52. package/components/BTXUI/core/anis/ani-success.vue +0 -48
  53. package/components/BTXUI/core/b-drag.vue +0 -258
  54. package/components/BTXUI/core/b-grid.vue +0 -84
  55. package/components/BTXUI/core/b-hot.vue +0 -171
  56. package/components/BTXUI/core/b-icon.vue +0 -76
  57. package/components/BTXUI/core/b-img.vue +0 -84
  58. package/components/BTXUI/core/b-input.vue +0 -198
  59. package/components/BTXUI/core/b-list.vue +0 -276
  60. package/components/BTXUI/core/b-text/doc.ts +0 -9
  61. package/components/BTXUI/core/b-text/index.vue +0 -16
  62. package/components/BTXUI/core/b-textarea.vue +0 -58
  63. package/components/BTXUI/core/b-video.vue +0 -35
  64. package/components/BTXUI/core/b-view/doc.ts +0 -10
  65. package/components/BTXUI/core/b-view/index.vue +0 -20
  66. package/components/BTXUI/core/b-webview.vue +0 -20
  67. package/components/BTXUI/core/lib/ChapterLink.js +0 -49
  68. package/components/BTXUI/core/lib/Search.vue +0 -60
  69. package/components/BTXUI/core/styles/doc.ts +0 -55
  70. package/components/BTXUI/core/styles/index.vue +0 -98
  71. package/components/BTXUI/core/styles/prestyles.ts +0 -471
  72. package/components/BTXUI/core/styles/theme.ts +0 -29
  73. package/components/BTXUI/drawer/drawer-wid.vue +0 -165
  74. package/components/BTXUI/drawer/title-tag-wid.vue +0 -114
  75. package/components/BTXUI/form/form-select-wid.vue +0 -57
  76. package/components/BTXUI/form/form-wid.vue +0 -324
  77. package/components/BTXUI/formPannel/form-pannel-wid.vue +0 -133
  78. package/components/BTXUI/imgsUpload/imgs-upload-wid.vue +0 -149
  79. package/components/BTXUI/index.js +0 -83
  80. package/components/BTXUI/pageFlip/page-flip-wid.vue +0 -206
  81. package/components/BTXUI/pannel/pannel-wid.vue +0 -167
  82. package/components/BTXUI/range/range-wid.vue +0 -134
  83. package/components/BTXUI/search/search-wid.vue +0 -80
  84. package/components/BTXUI/select/select-wid.vue +0 -186
  85. package/components/BTXUI/slider/slider-wid.vue +0 -444
  86. package/components/BTXUI/tab/tab-wid.vue +0 -109
  87. package/components/BTXUI/table/table-wid.vue +0 -324
  88. package/components/BTXUI/tag/tag-wid.vue +0 -183
  89. package/components/BTXUI/tags/tags-wid.vue +0 -121
  90. package/components/BTXUI/tooltip/tooltip-wid.vue +0 -146
  91. package/components/BTXUI/upload/upload-wid.vue +0 -215
  92. package/components/BTXUI/waterfall/waterfall-wid.vue +0 -166
  93. package/components/header-info.vue +0 -167
  94. package/composables/@types.ts +0 -4
  95. package/composables/api.ts +0 -18
  96. package/env.d.ts +0 -5
  97. package/main.js +0 -16
  98. package/nuxt.config.ts +0 -51
  99. package/pages/article.vue +0 -16
  100. package/pages/download.vue +0 -50
  101. package/pages/example/app_wid/app/data_demo.vue +0 -9
  102. package/pages/example/app_wid/app/download_demo.vue +0 -9
  103. package/pages/example/app_wid/app/list_demo.vue +0 -11
  104. package/pages/example/app_wid/app/system_demo.vue +0 -9
  105. package/pages/example/app_wid/app_wid_demo.vue +0 -198
  106. package/pages/example/app_wid/btn_wid_demo.vue +0 -179
  107. package/pages/example/app_wid/carousel_wid_demo.vue +0 -152
  108. package/pages/example/app_wid/checkbox_wid_demo.vue +0 -65
  109. package/pages/example/app_wid/confirm_wid_demo.vue +0 -197
  110. package/pages/example/app_wid/content_wid_demo.vue +0 -369
  111. package/pages/example/app_wid/drawer_wid_demo.vue +0 -155
  112. package/pages/example/app_wid/form_pannel_wid_demo.vue +0 -338
  113. package/pages/example/app_wid/form_wid_demo.vue +0 -550
  114. package/pages/example/app_wid/imgs_upload_wid_demo.vue +0 -159
  115. package/pages/example/app_wid/index.js +0 -158
  116. package/pages/example/app_wid/page_flip_wid_demo.vue +0 -99
  117. package/pages/example/app_wid/pannel_wid_demo.vue +0 -177
  118. package/pages/example/app_wid/range_wid_demo.vue +0 -101
  119. package/pages/example/app_wid/search_wid_demo.vue +0 -75
  120. package/pages/example/app_wid/select_wid_demo.vue +0 -217
  121. package/pages/example/app_wid/slider_wid_demo.vue +0 -143
  122. package/pages/example/app_wid/tab_wid_demo.vue +0 -170
  123. package/pages/example/app_wid/table_wid_demo.vue +0 -377
  124. package/pages/example/app_wid/tag_wid_demo.vue +0 -133
  125. package/pages/example/app_wid/tags_wid_demo.vue +0 -143
  126. package/pages/example/app_wid/tooltip_wid_demo.vue +0 -117
  127. package/pages/example/app_wid/upload_wid_demo.vue +0 -123
  128. package/pages/example/base_wid/b_drag_demo.vue +0 -159
  129. package/pages/example/base_wid/b_grid_demo.vue +0 -225
  130. package/pages/example/base_wid/b_hot_demo.vue +0 -135
  131. package/pages/example/base_wid/b_icon_demo.vue +0 -80
  132. package/pages/example/base_wid/b_img_demo.vue +0 -95
  133. package/pages/example/base_wid/b_input_demo.vue +0 -171
  134. package/pages/example/base_wid/b_list_demo.vue +0 -241
  135. package/pages/example/base_wid/b_style_demo.vue +0 -928
  136. package/pages/example/base_wid/b_text_demo.vue +0 -36
  137. package/pages/example/base_wid/b_textarea_demo.vue +0 -64
  138. package/pages/example/base_wid/b_video_demo.vue +0 -42
  139. package/pages/example/base_wid/b_view_demo.vue +0 -36
  140. package/pages/example/base_wid/index.js +0 -76
  141. package/pages/example/content.js +0 -49
  142. package/pages/example/global_style/animation.vue +0 -197
  143. package/pages/example/global_style/color.vue +0 -134
  144. package/pages/example/global_style/decoration.vue +0 -546
  145. package/pages/example/global_style/icon.vue +0 -345
  146. package/pages/example/global_style/index.js +0 -52
  147. package/pages/example/global_style/layout.vue +0 -846
  148. package/pages/example/global_style/special.vue +0 -37
  149. package/pages/example/global_style/table.vue +0 -298
  150. package/pages/example/global_style/text.vue +0 -159
  151. package/pages/index.vue +0 -43
  152. package/pages/level_widget.vue +0 -11
  153. package/pages/start.vue +0 -200
  154. package/plugins/index.ts +0 -2
  155. package/public/favicon.gif +0 -0
  156. package/public/fonts/iconfont.ttf +0 -0
  157. package/public/fonts/iconfont.woff +0 -0
  158. package/public/fonts/iconfont.woff2 +0 -0
  159. package/public/img/banner.jpg +0 -0
  160. package/public/img/banner2.jpg +0 -0
  161. package/public/img/bg_pattern.png +0 -0
  162. package/public/img/btx.jpg +0 -0
  163. package/public/img/btx_ui.jpg +0 -0
  164. package/public/img/dir.png +0 -0
  165. package/public/img/f.png +0 -0
  166. package/public/img/head.jpg +0 -0
  167. package/public/img/head2.jpg +0 -0
  168. package/public/img/home_ico.png +0 -0
  169. package/public/img/icons.svg +0 -164
  170. package/public/img/mechanism/b-style.png +0 -0
  171. package/public/img/mechanism/slider-wid.png +0 -0
  172. package/public/img/mechanism/upload-wid.png +0 -0
  173. package/public/img/transform_origin.png +0 -0
  174. package/sass/animation.scss +0 -400
  175. package/sass/btx.mob.scss +0 -10
  176. package/sass/btx.pad.scss +0 -3
  177. package/sass/btx.scss +0 -22
  178. package/sass/btx.webapp.scss +0 -22
  179. package/sass/colors.scss +0 -65
  180. package/sass/decoration.scss +0 -220
  181. package/sass/flex.scss +0 -29
  182. package/sass/icons.scss +0 -100
  183. package/sass/layout.scss +0 -88
  184. package/sass/reset.scss +0 -111
  185. package/sass/response/flex_mixin.scss +0 -91
  186. package/sass/response/layout_mixin.scss +0 -227
  187. package/sass/response/main.scss +0 -59
  188. package/sass/response/text_mixin.scss +0 -65
  189. package/sass/scroll.scss +0 -100
  190. package/sass/special.scss +0 -13
  191. package/sass/table.scss +0 -103
  192. package/sass/text.scss +0 -86
  193. package/sass/webpack.config.js +0 -31
  194. package/tsconfig.json +0 -4
@@ -1,198 +0,0 @@
1
- <template>
2
- <input :style="computed_style" :type="type" :name="name" :readonly="readonly"
3
- @focus="$_focus"
4
- @blur="$_blur"
5
- @change="$_check"
6
- @keyup.enter="$_enter"
7
- v-model="value"
8
- autocomplete="off" />
9
- </template>
10
-
11
- <script>
12
-
13
- let desc = ["该组件用于实现输入型表单元素。"],
14
- extend = ["b-style"],
15
- dependent = [],
16
- api = {
17
- methods: [
18
- {
19
- name: "check",
20
- ef: "表单验证",
21
- params: "-",
22
- return: "{name:'表单项属性', notic:'报错提示', pass:'是否通过'}"
23
- }
24
- ],
25
- event: [
26
- {
27
- name: "on_check",
28
- ef: "表单输入变化",
29
- params: "{name:'表单项属性', notic:'报错提示', pass:'是否通过'}",
30
- },
31
- {
32
- name: "on_focus",
33
- ef: "表单聚焦",
34
- params: "-",
35
- },
36
- {
37
- name: "on_blur",
38
- ef: "表单失焦",
39
- params: "-",
40
- },
41
- {
42
- name: "on_enter",
43
- ef: "聚焦时键盘按下回车",
44
- params: "text、event",
45
- }
46
- ]
47
- },
48
- init_data = `{
49
- type: "表单元素类型(text:单行文本、password:密码、textarea:多行文本)",
50
- name: "表单元素数据键名",
51
- /* styles: "(参照:b-style 组件入参)" */,
52
- /* inpVal: "(model) 表单输入内容" */,
53
- /* maxlength: "字符数上限(限输入型表单元素)" */,
54
- /* placeholder: "输入提示(限输入型表单元素)" */,
55
- /* readonly: "只读,默认 false" */,
56
- /* rule: {
57
- type: "自定义正则验证,或预置正则验证(包括:required、tel、email、url、uname、zh、uid)",
58
- notic: "验证报错提示"
59
- } */,
60
- /* focus: "激活样式值" */,
61
- }`;
62
-
63
- export default {
64
- name: "b-input",
65
- introduce: { desc, extend, dependent, api, init_data },
66
- model: {
67
- prop: "inpVal",
68
- event: "on_input"
69
- },
70
- props: {
71
- type: {
72
- type: String,
73
- required: true,
74
- },
75
- name: {
76
- type: String,
77
- required: true,
78
- },
79
- inpVal: {
80
- type: [String, Number],
81
- required: false,
82
- default: ""
83
- },
84
- readonly: {
85
- type: Boolean,
86
- required: false,
87
- },
88
- rule: {
89
- type: Object,
90
- required: false,
91
- },
92
- focus: {
93
- type: String,
94
- required: false,
95
- default: "color-dark bg-color-rgba(134,134,134,.24)"
96
- }
97
- },
98
- data(){
99
- return {
100
-
101
- //输入文字
102
- value: this.inpVal,
103
-
104
- //预置正则
105
- preset_rules: {
106
- required: {
107
- regexp: /[\w\.\-_\u4e00-\u9fa5]+/,
108
- notic: "输入内容为空!"
109
- },
110
- tel: {
111
- regexp: /^1[3-9]\d{9}$/,
112
- notic: "手机号格式有误!"
113
- },
114
- email: {
115
- regexp: /^[\w\.]+@(\w+\.)+(com|net|org|wiki|cn|cc)$/,
116
- notic: "邮箱格式有误!"
117
- },
118
- url: {
119
- regexp: /^((http|https):\/\/)?(wwww\.)?(\w+\.)+(com|net|org|wiki|cn|cc)$/,
120
- notic: "url 格式有误!"
121
- },
122
- uname: {
123
- regexp: /^[\w_]+$/,
124
- notic: "请输入英文字母、数字或下划线!"
125
- },
126
- zh: {
127
- regexp: /^[\u4e00-\u9fa5]+$/,
128
- notic: "请输入中文字符!"
129
- },
130
- uid: {
131
- regexp: /^\d{15}(\d{2}[0-9x])?$/i,
132
- notic: "身份证号输入有误!"
133
- }
134
- },
135
-
136
- }
137
- },
138
- watch: {
139
-
140
- //监听输入
141
- inpVal(val){
142
- this.value = val;
143
- },
144
-
145
- //监听输出
146
- value(val){
147
- this.$emit("on_input", val? val.trim(): "");
148
- }
149
-
150
- },
151
- methods: {
152
-
153
- //执行验证
154
- check(){
155
- let rule = this.rule;
156
- if(rule){
157
- let pre_rule = this.preset_rules[rule.type],
158
- regexp = pre_rule? pre_rule.regexp: rule.type,
159
- pre_notic = pre_rule? pre_rule.notic: "输入格式有误!",
160
- val = this.inpVal;
161
- return {
162
- name: this.name,
163
- notic: rule.notic || pre_notic,
164
- pass: regexp.test(val)
165
- };
166
- }
167
- },
168
-
169
- //输入验证
170
- $_check(){
171
- this.$emit("on_check", this.check());
172
- },
173
-
174
- //表单聚焦
175
- $_focus(){
176
- if(this.readonly) return;
177
- this.toggle_style("focus");
178
- this.$emit("on_focus");
179
- },
180
-
181
- //表单失焦
182
- $_blur(){
183
- if(this.readonly) return;
184
- this.reset_style();
185
- this.$emit("on_blur");
186
- },
187
-
188
- //表单回车
189
- $_enter(e){
190
- this.$emit("on_enter", this.inpVal, e);
191
- },
192
-
193
- },
194
- mounted(){
195
- this.append_state(this.focus, "focus");
196
- }
197
- }
198
- </script>
@@ -1,276 +0,0 @@
1
- <template>
2
- <b-view :styles="`rel grow-1 max ${styles} over-hide`">
3
-
4
- <!--置顶按钮-->
5
- <b-hot :styles="`abs w-3.7 h-3.7 transform-rotate(180deg) z2 round flex-5 line thick-2 line-neutral trans-fast fsize-1.7 r-${go_top_btn.pos.right} b-${go_top_btn.pos.bottom} color-${go_top_btn.colors.normal.icon} bg-color-${go_top_btn.colors.normal.bg}`"
6
- :hover="`line-none color-${go_top_btn.colors.hover.icon} bg-color-${go_top_btn.colors.hover.bg}`"
7
- :states="{
8
- hide: {
9
- state: top_btn_hide,
10
- style: 'b-f5'
11
- }
12
- }"
13
- @on_click="reset">
14
- <b-icon icon="xiala" />
15
- </b-hot>
16
-
17
- <!--滚动区域-->
18
- <b-view styles="max"
19
- ref="list"
20
- :states="{
21
- scroll_x: {
22
- style: 'over-scroll no-wrap',
23
- state: scroll === 'x'
24
- },
25
- scroll_y: {
26
- style: 'over-scroll',
27
- state: scroll === 'y'
28
- },
29
- scroll_hide: {
30
- style: 'over-hide',
31
- state: scroll === 'hide'
32
- }
33
- }"
34
- @on_touchmove="$_touch_move"
35
- :class="scroll_class">
36
- <slot />
37
- </b-view>
38
-
39
- </b-view>
40
- </template>
41
-
42
- <script>
43
- import ChapterLink from "./lib/ChapterLink"
44
- import BView from "./b-view"
45
- import BHot from "./b-hot"
46
- import BIcon from "./b-icon"
47
-
48
- const desc = ["该组件用于实现长内容的溢出滚动及隐藏效果,此外还具备滚动条定位监听及懒加载接口。"],
49
- extend = [],
50
- dependent = ["ChapterLink", "b-view", "b-hot", "b-icon"],
51
- api = {
52
- methods: [
53
- {
54
- name: "reset",
55
- ef: "重置定位",
56
- params: "-",
57
- return: "-"
58
- }
59
- ],
60
- event: [
61
- {
62
- name: "on_to_top",
63
- ef: "滚动置顶",
64
- params: "spread"
65
- },
66
- {
67
- name: "on_to_bottom",
68
- ef: "滚动置底",
69
- params: "event"
70
- },
71
- {
72
- name: "on_scroll",
73
- ef: "滚动",
74
- params: "{dir:scroll_direction, left:scroll_left, top:scroll_top}"
75
- }
76
- ]
77
- },
78
- init_data = `{
79
- /* styles: "(参照:b-style 组件入参)" */,
80
- /* wide: "加宽滚动条,默认 false" */,
81
- /* scroll: "溢出滚动。y:垂直溢出滚动(默认);x:水平溢出滚动;hide:溢出隐藏" */,
82
- /* goTopBtn: {
83
- show_distance: "按钮显示时距离视口顶部的距离,默认为:false 不显示;可基于容器高度进行倍数设置:'1scr(即 1 屏的高度)',也支持具体数值",
84
- response_direction: "按钮基于滑动方向响应式显示,默认关闭",
85
- pos: {
86
- right: "距离右侧距离,默认 1rem",
87
- bottom: "距离底部距离,默认 2rem"
88
- },
89
- colors: {
90
- normal: {
91
- icon: "常规状态图标色,默认 #777",
92
- bg: "常规状态背景色,默认 dark",
93
- },
94
- hover: {
95
- icon: "悬停状态图标色,默认 light",
96
- bg: "悬停状态背景色,默认 rgba(0,0,0,.6)",
97
- }
98
- }
99
- } */
100
- }`;
101
-
102
- let orig_scroll_pos = {x:0, y:0}; //滚动原始定位
103
-
104
- export default {
105
- name: "b-list",
106
- introduce: { desc, extend, dependent, api, init_data },
107
- components: {
108
- BView,
109
- BHot,
110
- BIcon
111
- },
112
- props: {
113
- styles: {
114
- type: String,
115
- required: false
116
- },
117
- scroll: {
118
- type: String,
119
- required: false,
120
- default: "y"
121
- },
122
- wide: {
123
- type: Boolean,
124
- required: false
125
- },
126
- goTopBtn: {
127
- type: Object,
128
- required: false,
129
- default: ()=>{
130
- return {}
131
- }
132
- }
133
- },
134
- watch: {
135
-
136
- //监听路由
137
- $route(){
138
- this.reset();
139
- }
140
-
141
- },
142
- data(){
143
- return {
144
-
145
- //定位器
146
- chapter_link: new ChapterLink(0),
147
-
148
- //触控滑动方向
149
- touch_move_dir: "v",
150
-
151
- //置顶按钮隐藏状态
152
- top_btn_hide: true,
153
-
154
- //置顶按钮显示,距离容器顶部距离
155
- show_distance: 0
156
-
157
- }
158
- },
159
- computed: {
160
-
161
- //滚动容器
162
- $list(){
163
- return this.$refs.list.$el;
164
- },
165
-
166
- //溢出样式
167
- scroll_class(){
168
- switch(this.scroll){
169
- case "x":
170
- return "auto-h-scroll no-wrap";
171
- break;
172
- case "y":
173
- return this.wide? "wide-auto-scroll": "auto-scroll";
174
- break;
175
- case "hide":
176
- return "over-hide";
177
- }
178
- },
179
-
180
- //置顶按钮配置
181
- go_top_btn(){
182
- return {
183
- show_distance: false,
184
- response_direction: false,
185
- pos: {
186
- right: "1",
187
- bottom: "2"
188
- },
189
- colors: {
190
- normal: {
191
- icon: "#777",
192
- bg: "dark",
193
- },
194
- hover: {
195
- icon: "light",
196
- bg: "rgba(0,0,0,.6)",
197
- }
198
- },
199
- ...this.goTopBtn
200
- }
201
- }
202
-
203
- },
204
- methods: {
205
-
206
- //重置定位
207
- reset(){
208
- this.chapter_link.go_top(this.$list, 0);
209
- },
210
-
211
- //滚动定位监听
212
- $_watch_pos(){
213
- this.$list.onscroll = (e)=>{
214
- const st = e.target.scrollTop,
215
- sl = e.target.scrollLeft,
216
- h_offset = sl - orig_scroll_pos.x,
217
- v_offset = st - orig_scroll_pos.y;
218
- let dir;
219
- if(Math.abs(h_offset) >= Math.abs(v_offset)){ //水平方向
220
- e.stopPropagation();
221
- dir = h_offset >= 0? "l2r": "r2l";
222
- }else { //垂直方向
223
- dir = v_offset >= 0? "t2b": "b2t";
224
- }
225
- orig_scroll_pos.x = sl;
226
- orig_scroll_pos.y = st;
227
- this.$emit("on_scroll", {dir, left:sl, top:st});
228
-
229
- st === 0 && this.$emit("on_to_top", e); //滚动置顶
230
- st === e.target.scrollHeight - e.target.offsetHeight && this.$emit("on_to_bottom", e); //滚动置底
231
- this.go_top_btn.show_distance && this.$_set_top_btn(dir, st); //设置置顶按钮
232
- }
233
- },
234
-
235
- //触控移动
236
- $_touch_move(e){
237
- this.scroll === "x" && e.stopPropagation();
238
- },
239
-
240
- //设置置顶按钮显示,距离容器顶部距离
241
- $_set_show_distance(){
242
- const show_distance = this.go_top_btn.show_distance;
243
- if(!show_distance) return;
244
- const distance = this.go_top_btn.show_distance.split("scr");
245
- if(distance.length > 1){ //基于容器高度的倍数
246
- this.show_distance = distance[0] * this.$el.clientHeight;
247
- }else { //具体值
248
- this.show_distance = distance[0];
249
- }
250
- },
251
-
252
- //设置置顶按钮
253
- $_set_top_btn(dir, top){
254
- if(top > this.show_distance) { //显示
255
- this.top_btn_hide = false;
256
- if(this.go_top_btn.response_direction){ //滚动方向响应显示状态
257
- if(dir === "b2t"){
258
- this.top_btn_hide = false;
259
- }else {
260
- this.top_btn_hide = true;
261
- }
262
- }
263
- }else { //隐藏
264
- this.top_btn_hide = true;
265
- }
266
- },
267
-
268
- },
269
- mounted(){
270
- this.$_watch_pos();
271
- setTimeout(()=>{
272
- this.$_set_show_distance();
273
- }, 1000);
274
- }
275
- }
276
- </script>
@@ -1,9 +0,0 @@
1
- export default {
2
- name: "b-text",
3
- desc: ["该组件用于标记富文本片段,相当于 html 中 span 的作用,可以接收 <code>class</code> 属性来应用框架样式体系。"],
4
- extend: ["b-style"],
5
- dependent: [],
6
- initData: [
7
- ["class", "string", "参照:styles 组件入参"]
8
- ]
9
- };
@@ -1,16 +0,0 @@
1
- <template>
2
- <styles :class="class">
3
- <span :class="class">
4
- <slot/>
5
- </span>
6
- </styles>
7
- </template>
8
-
9
- <script setup lang="ts">
10
- import styles from "@/components/BTXUI/core/styles/index.vue"
11
-
12
- defineProps<{
13
- // 样式集
14
- class?: string
15
- }>()
16
- </script>
@@ -1,58 +0,0 @@
1
- <template>
2
- <textarea :style="computed_style" :type="type" :name="name"
3
- class="auto-scroll"
4
- @focus="$_focus"
5
- @blur="$_blur"
6
- @change="$_check"
7
- v-model="value"
8
- autocomplete="off"
9
- :rows="rows"/>
10
- </template>
11
-
12
- <script>
13
- import BInput from "./b-input";
14
-
15
- let desc = ["该组件用于实现多行输入型表单元素。"],
16
- extend = ["b-input"],
17
- dependent = [],
18
- api = {
19
- extend: "继承自:<code>b-input</code> 组件",
20
- methods: [
21
- {
22
- name: "to_html",
23
- ef: "将换行符转换为 html <br> 标签",
24
- params: "-",
25
- return: "html_str"
26
- }
27
- ]
28
- },
29
- init_data = `{
30
- "(继承自:b-input 组件入参,type 入参无效)",
31
- /* rows: "显示最大行数,默认 7 行" */
32
- }`;
33
-
34
- export default {
35
- extends: BInput,
36
- name: "b-textarea",
37
- introduce: { desc, extend, dependent, api, init_data },
38
- props: {
39
- type: {
40
- type: String,
41
- required: false,
42
- },
43
- rows: {
44
- type: Number,
45
- required: false,
46
- default: 7
47
- }
48
- },
49
- methods: {
50
-
51
- //将换行符转换为 html <br> 标签
52
- to_html(){
53
- return this.inpVal.replace(/[\n\r]/g, "<br>")
54
- }
55
-
56
- }
57
- }
58
- </script>
@@ -1,35 +0,0 @@
1
- <template>
2
- <video :style="computed_style" muted
3
- :src="video"></video>
4
- </template>
5
-
6
- <script>
7
-
8
- let desc = ["该组件用于实现视频播放器。"],
9
- extend = ["b-style"],
10
- dependent = [],
11
- api = null,
12
- init_data = `{
13
- video: "视频资源",
14
- /* styles: "(参照:b-style 组件入参)" */,
15
- }`;
16
-
17
- export default {
18
- name: "b-video",
19
- introduce: { desc, extend, dependent, api, init_data },
20
- props: {
21
- video: {
22
- type: String,
23
- required: true
24
- },
25
- },
26
- methods: {
27
-
28
- //播放
29
- play(){
30
- this.$el.play();
31
- }
32
-
33
- }
34
- }
35
- </script>
@@ -1,10 +0,0 @@
1
- export default {
2
- name: "b-view",
3
- desc: ["该组件是用于布局的基础组件,相当于 html 中 div 的作用,可以接收 <code>class</code> 属性来应用框架样式体系。"],
4
- extend: ["b-style"],
5
- dependent: [],
6
- initData: [
7
- ["class", "string", "参照:styles 组件入参"],
8
- ["bgImg", "string", "背景图地址"]
9
- ]
10
- };
@@ -1,20 +0,0 @@
1
- <template>
2
- <styles :class="class">
3
- <div :class="class"
4
- :style="{backgroundImage: `url(${ bgImg })`}">
5
- <slot/>
6
- </div>
7
- </styles>
8
- </template>
9
-
10
- <script setup lang="ts">
11
- import styles from "@/components/BTXUI/core/styles/index.vue"
12
-
13
- defineProps<{
14
- // 样式集
15
- class?: string,
16
-
17
- // 背景图
18
- bgImg?: string,
19
- }>()
20
- </script>
@@ -1,20 +0,0 @@
1
- <template>
2
- <iframe width="100%" height="100%" frameborder="0" :src="src"></iframe>
3
- </template>
4
-
5
- <script>
6
- export default {
7
- name: "b-webview",
8
- /*
9
- * init-data{
10
- * src: "web 地址",
11
- * }
12
- * */
13
- props: {
14
- src: {
15
- type: String,
16
- required: true
17
- },
18
- }
19
- }
20
- </script>
@@ -1,49 +0,0 @@
1
- class ChapterLink {
2
- constructor(ani_speed=.2, offset=0, callback=null){
3
- this.ani_speed = ani_speed; //平移动画缓动速率:0 - 1,默认:0.2,0 为硬切换"
4
- this.offset = offset; //位移偏移
5
- this.callback = callback; //滚动完成回调函数
6
- }
7
-
8
- //跳转指定 dom 章节
9
- go_chapter(id){
10
- let $chapter = document.querySelector("#" + id);
11
- $chapter && this.go_top($chapter.offsetParent, $chapter.offsetTop + this.offset);
12
- }
13
-
14
- //跳转指定位置
15
- go_top($box, top){
16
- top = Math.min(Math.max(0, top), $box.scrollHeight - $box.offsetHeight); //校正滚动范围
17
- if($box.nodeName === "BODY") $box = document.documentElement;
18
- if(this.ani_speed > 0){ //平滑跳转
19
- let offset;
20
- this.$_stop_scroll();
21
- ChapterLink.t = setInterval(()=>{
22
- offset = (top - $box.scrollTop) * this.ani_speed;
23
- if(offset === 0){
24
- this.$_scroll_over();
25
- return;
26
- }
27
- if(Math.abs(offset) < 1) offset = offset < 0? -1: 1;
28
- $box.scrollTop += offset;
29
- }, 17);
30
- }else { //硬跳转
31
- $box.scrollTop = top;
32
- }
33
- }
34
-
35
- //终止滚动
36
- $_stop_scroll(){
37
- clearInterval(ChapterLink.t);
38
- }
39
-
40
- //滚动停止
41
- $_scroll_over(){
42
- this.$_stop_scroll();
43
- this.callback && this.callback();
44
- }
45
- }
46
-
47
- ChapterLink.t = null; //滚动计时器
48
-
49
- export default ChapterLink