btxui 1.0.1 → 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.
Files changed (197) hide show
  1. package/demo.html +1 -0
  2. package/index.common.js +93 -0
  3. package/index.common.js.map +1 -0
  4. package/index.umd.js +104 -0
  5. package/index.umd.js.map +1 -0
  6. package/index.umd.min.js +2 -0
  7. package/index.umd.min.js.map +1 -0
  8. package/package.json +12 -23
  9. package/README.md +0 -42
  10. package/app.vue +0 -162
  11. package/assets/css/_main.js +0 -73
  12. package/assets/css/btx.min.css +0 -1
  13. package/assets/css/btx.mob.min.css +0 -1
  14. package/assets/css/btx.pad.min.css +0 -1
  15. package/assets/css/btx.webapp.min.css +0 -1
  16. package/assets/css/custom_fonts/iconfont.css +0 -37
  17. package/assets/css/custom_fonts/iconfont.eot +0 -0
  18. package/assets/css/custom_fonts/iconfont.svg +0 -47
  19. package/assets/css/custom_fonts/iconfont.ttf +0 -0
  20. package/assets/css/custom_fonts/iconfont.woff +0 -0
  21. package/assets/css/custom_fonts/iconfont.woff2 +0 -0
  22. package/assets/css/res-l.css +0 -47
  23. package/assets/css/res-m.css +0 -47
  24. package/assets/css/res-s.css +0 -61
  25. package/assets/custom_fonts/iconfont.css +0 -37
  26. package/assets/custom_fonts/iconfont.eot +0 -0
  27. package/assets/custom_fonts/iconfont.svg +0 -47
  28. package/assets/custom_fonts/iconfont.ttf +0 -0
  29. package/assets/custom_fonts/iconfont.woff +0 -0
  30. package/assets/custom_fonts/iconfont.woff2 +0 -0
  31. package/assets/js/Btx.js +0 -196
  32. package/assets/js/Utils.js +0 -421
  33. package/assets/js/fastclick.js +0 -802
  34. package/assets/js/lazy.min.js +0 -2
  35. package/assets/js/touchwipe.js +0 -111
  36. package/assets/server.js +0 -8
  37. package/assets/start_site_code_str.js +0 -119
  38. package/cdn/css/btx.min.css +0 -1
  39. package/cdn/css/btx.min.css.map +0 -1
  40. package/cdn/fonts/iconfont.ttf +0 -0
  41. package/cdn/fonts/iconfont.woff +0 -0
  42. package/cdn/fonts/iconfont.woff2 +0 -0
  43. package/components/BTXUI/app/app-wid.vue +0 -182
  44. package/components/BTXUI/btn/btn-wid.vue +0 -128
  45. package/components/BTXUI/carousel/carousel-wid.vue +0 -138
  46. package/components/BTXUI/checkbox/checkbox-wid.vue +0 -72
  47. package/components/BTXUI/confirm/confirm-wid.vue +0 -279
  48. package/components/BTXUI/content/content-checkbox-wid.vue +0 -44
  49. package/components/BTXUI/content/content-node-wid.vue +0 -114
  50. package/components/BTXUI/content/content-tag-wid.vue +0 -25
  51. package/components/BTXUI/content/content-wid.vue +0 -254
  52. package/components/BTXUI/core/anis/ani-fail.vue +0 -46
  53. package/components/BTXUI/core/anis/ani-loading.vue +0 -32
  54. package/components/BTXUI/core/anis/ani-notic.vue +0 -47
  55. package/components/BTXUI/core/anis/ani-success.vue +0 -48
  56. package/components/BTXUI/core/b-drag.vue +0 -258
  57. package/components/BTXUI/core/b-grid.vue +0 -84
  58. package/components/BTXUI/core/b-hot.vue +0 -171
  59. package/components/BTXUI/core/b-icon.vue +0 -76
  60. package/components/BTXUI/core/b-img.vue +0 -84
  61. package/components/BTXUI/core/b-input.vue +0 -198
  62. package/components/BTXUI/core/b-list.vue +0 -276
  63. package/components/BTXUI/core/b-text/doc.ts +0 -9
  64. package/components/BTXUI/core/b-text/index.vue +0 -16
  65. package/components/BTXUI/core/b-textarea.vue +0 -58
  66. package/components/BTXUI/core/b-video.vue +0 -35
  67. package/components/BTXUI/core/b-view/doc.ts +0 -10
  68. package/components/BTXUI/core/b-view/index.vue +0 -20
  69. package/components/BTXUI/core/b-webview.vue +0 -20
  70. package/components/BTXUI/core/lib/ChapterLink.js +0 -49
  71. package/components/BTXUI/core/lib/Search.vue +0 -60
  72. package/components/BTXUI/core/styles/doc.ts +0 -55
  73. package/components/BTXUI/core/styles/index.vue +0 -98
  74. package/components/BTXUI/core/styles/prestyles.ts +0 -471
  75. package/components/BTXUI/core/styles/theme.ts +0 -29
  76. package/components/BTXUI/drawer/drawer-wid.vue +0 -165
  77. package/components/BTXUI/drawer/title-tag-wid.vue +0 -114
  78. package/components/BTXUI/form/form-select-wid.vue +0 -57
  79. package/components/BTXUI/form/form-wid.vue +0 -324
  80. package/components/BTXUI/formPannel/form-pannel-wid.vue +0 -133
  81. package/components/BTXUI/imgsUpload/imgs-upload-wid.vue +0 -149
  82. package/components/BTXUI/index.js +0 -83
  83. package/components/BTXUI/pageFlip/page-flip-wid.vue +0 -206
  84. package/components/BTXUI/pannel/pannel-wid.vue +0 -167
  85. package/components/BTXUI/range/range-wid.vue +0 -134
  86. package/components/BTXUI/search/search-wid.vue +0 -80
  87. package/components/BTXUI/select/select-wid.vue +0 -186
  88. package/components/BTXUI/slider/slider-wid.vue +0 -444
  89. package/components/BTXUI/tab/tab-wid.vue +0 -109
  90. package/components/BTXUI/table/table-wid.vue +0 -324
  91. package/components/BTXUI/tag/tag-wid.vue +0 -183
  92. package/components/BTXUI/tags/tags-wid.vue +0 -121
  93. package/components/BTXUI/tooltip/tooltip-wid.vue +0 -146
  94. package/components/BTXUI/upload/upload-wid.vue +0 -215
  95. package/components/BTXUI/waterfall/waterfall-wid.vue +0 -166
  96. package/components/header-info.vue +0 -167
  97. package/composables/@types.ts +0 -4
  98. package/composables/api.ts +0 -18
  99. package/env.d.ts +0 -5
  100. package/main.js +0 -6
  101. package/nuxt.config.ts +0 -51
  102. package/pages/article.vue +0 -16
  103. package/pages/download.vue +0 -50
  104. package/pages/example/app_wid/app/data_demo.vue +0 -9
  105. package/pages/example/app_wid/app/download_demo.vue +0 -9
  106. package/pages/example/app_wid/app/list_demo.vue +0 -11
  107. package/pages/example/app_wid/app/system_demo.vue +0 -9
  108. package/pages/example/app_wid/app_wid_demo.vue +0 -198
  109. package/pages/example/app_wid/btn_wid_demo.vue +0 -179
  110. package/pages/example/app_wid/carousel_wid_demo.vue +0 -152
  111. package/pages/example/app_wid/checkbox_wid_demo.vue +0 -65
  112. package/pages/example/app_wid/confirm_wid_demo.vue +0 -197
  113. package/pages/example/app_wid/content_wid_demo.vue +0 -369
  114. package/pages/example/app_wid/drawer_wid_demo.vue +0 -155
  115. package/pages/example/app_wid/form_pannel_wid_demo.vue +0 -338
  116. package/pages/example/app_wid/form_wid_demo.vue +0 -550
  117. package/pages/example/app_wid/imgs_upload_wid_demo.vue +0 -159
  118. package/pages/example/app_wid/index.js +0 -158
  119. package/pages/example/app_wid/page_flip_wid_demo.vue +0 -99
  120. package/pages/example/app_wid/pannel_wid_demo.vue +0 -177
  121. package/pages/example/app_wid/range_wid_demo.vue +0 -101
  122. package/pages/example/app_wid/search_wid_demo.vue +0 -75
  123. package/pages/example/app_wid/select_wid_demo.vue +0 -217
  124. package/pages/example/app_wid/slider_wid_demo.vue +0 -143
  125. package/pages/example/app_wid/tab_wid_demo.vue +0 -170
  126. package/pages/example/app_wid/table_wid_demo.vue +0 -377
  127. package/pages/example/app_wid/tag_wid_demo.vue +0 -133
  128. package/pages/example/app_wid/tags_wid_demo.vue +0 -143
  129. package/pages/example/app_wid/tooltip_wid_demo.vue +0 -117
  130. package/pages/example/app_wid/upload_wid_demo.vue +0 -123
  131. package/pages/example/base_wid/b_drag_demo.vue +0 -159
  132. package/pages/example/base_wid/b_grid_demo.vue +0 -225
  133. package/pages/example/base_wid/b_hot_demo.vue +0 -135
  134. package/pages/example/base_wid/b_icon_demo.vue +0 -80
  135. package/pages/example/base_wid/b_img_demo.vue +0 -95
  136. package/pages/example/base_wid/b_input_demo.vue +0 -171
  137. package/pages/example/base_wid/b_list_demo.vue +0 -241
  138. package/pages/example/base_wid/b_style_demo.vue +0 -928
  139. package/pages/example/base_wid/b_text_demo.vue +0 -36
  140. package/pages/example/base_wid/b_textarea_demo.vue +0 -64
  141. package/pages/example/base_wid/b_video_demo.vue +0 -42
  142. package/pages/example/base_wid/b_view_demo.vue +0 -36
  143. package/pages/example/base_wid/index.js +0 -76
  144. package/pages/example/content.js +0 -49
  145. package/pages/example/global_style/animation.vue +0 -197
  146. package/pages/example/global_style/color.vue +0 -134
  147. package/pages/example/global_style/decoration.vue +0 -546
  148. package/pages/example/global_style/icon.vue +0 -345
  149. package/pages/example/global_style/index.js +0 -52
  150. package/pages/example/global_style/layout.vue +0 -846
  151. package/pages/example/global_style/special.vue +0 -37
  152. package/pages/example/global_style/table.vue +0 -298
  153. package/pages/example/global_style/text.vue +0 -159
  154. package/pages/index.vue +0 -29
  155. package/pages/level_widget.vue +0 -11
  156. package/pages/start.vue +0 -200
  157. package/plugins/index.ts +0 -2
  158. package/public/favicon.gif +0 -0
  159. package/public/fonts/iconfont.ttf +0 -0
  160. package/public/fonts/iconfont.woff +0 -0
  161. package/public/fonts/iconfont.woff2 +0 -0
  162. package/public/img/banner.jpg +0 -0
  163. package/public/img/banner2.jpg +0 -0
  164. package/public/img/bg_pattern.png +0 -0
  165. package/public/img/btx.jpg +0 -0
  166. package/public/img/btx_ui.jpg +0 -0
  167. package/public/img/dir.png +0 -0
  168. package/public/img/f.png +0 -0
  169. package/public/img/head.jpg +0 -0
  170. package/public/img/head2.jpg +0 -0
  171. package/public/img/home_ico.png +0 -0
  172. package/public/img/icons.svg +0 -164
  173. package/public/img/mechanism/b-style.png +0 -0
  174. package/public/img/mechanism/slider-wid.png +0 -0
  175. package/public/img/mechanism/upload-wid.png +0 -0
  176. package/public/img/transform_origin.png +0 -0
  177. package/sass/animation.scss +0 -400
  178. package/sass/btx.mob.scss +0 -10
  179. package/sass/btx.pad.scss +0 -3
  180. package/sass/btx.scss +0 -22
  181. package/sass/btx.webapp.scss +0 -22
  182. package/sass/colors.scss +0 -65
  183. package/sass/decoration.scss +0 -220
  184. package/sass/flex.scss +0 -29
  185. package/sass/icons.scss +0 -100
  186. package/sass/layout.scss +0 -88
  187. package/sass/reset.scss +0 -111
  188. package/sass/response/flex_mixin.scss +0 -91
  189. package/sass/response/layout_mixin.scss +0 -227
  190. package/sass/response/main.scss +0 -59
  191. package/sass/response/text_mixin.scss +0 -65
  192. package/sass/scroll.scss +0 -100
  193. package/sass/special.scss +0 -13
  194. package/sass/table.scss +0 -103
  195. package/sass/text.scss +0 -86
  196. package/sass/webpack.config.js +0 -31
  197. package/tsconfig.json +0 -4
@@ -1,258 +0,0 @@
1
- <template>
2
- <div :style="{...computed_style, cursor: 'move', visibility: drag_state? 'hidden': 'visible', position: freeDrag? 'absolute': '', left: `${move_pos.x}px`, top: `${move_pos.y}px`}"
3
- :draggable="!freeDrag"
4
- @mousedown = "$_act_target" @touchstart = "$_act_target">
5
- <div :style="{pointerEvents: `${drag_state? 'auto': 'none'}`}">
6
- <slot/>
7
- </div>
8
- </div>
9
- </template>
10
-
11
- <script>
12
-
13
- let desc = ["该组件用于包裹元素以实现拖拽效果。"],
14
- extend = ["b-style"],
15
- dependent = [],
16
- api = {
17
- event: [
18
- {
19
- name: "on_drag_start",
20
- ef: "开始拖拽",
21
- params: "event"
22
- },
23
- {
24
- name: "on_drag_move",
25
- ef: "拖拽移动",
26
- params: "event"
27
- },
28
- {
29
- name: "on_drag_end",
30
- ef: "结束拖拽",
31
- params: "event"
32
- },
33
- {
34
- name: "on_drag_over",
35
- ef: "拖拽预备放入",
36
- params: "event"
37
- },
38
- {
39
- name: "on_drag_leave",
40
- ef: "拖拽离开容器",
41
- params: "event"
42
- },
43
- {
44
- name: "on_drop",
45
- ef: "完成放入",
46
- params: "{you, me}, event"
47
- },
48
- {
49
- name: "on_move",
50
- ef: "拖动位移",
51
- params: "move_pos, move_area"
52
- }
53
- ]
54
- },
55
- init_data = `{
56
- /* styles: "(参照:b-style 组件入参)" */,
57
- /* dataInfo: "绑定数据,缺省则传递元素自身" */,
58
- /* dragStart: "拖拽起始状态样式值" */,
59
- /* dragOver: "拖拽预备放入状态样式值" */,
60
- /* freeDrag: "自由拖动,默认为 false" */,
61
- }`;
62
-
63
- export default {
64
- name: "b-drag",
65
- introduce: { desc, extend, dependent, api, init_data },
66
- props: {
67
- dataInfo: {
68
- type: Object,
69
- required: false,
70
- default: ()=>{
71
- return {}
72
- }
73
- },
74
- dragStart: {
75
- type: String,
76
- required: false,
77
- default: ""
78
- },
79
- dragOver: {
80
- type: String,
81
- required: false,
82
- default: "bg-color-neutral color-rgba(20,20,20,.7) round-sm"
83
- },
84
- freeDrag: {
85
- type: Boolean,
86
- required: false
87
- },
88
- },
89
- data(){
90
- return {
91
-
92
- //拖拽状态
93
- drag_state: false,
94
-
95
- //拖动状态
96
- move_state: false,
97
-
98
- //自由拖动当前位置
99
- move_cur_pos: null,
100
-
101
- //自由拖动显示位置
102
- move_pos: {
103
- x: "auto",
104
- y: "auto"
105
- },
106
-
107
- //自由拖动起始点位置
108
- move_start_point_pos: {
109
- x: 0,
110
- y: 0
111
- },
112
-
113
- //自由拖动区域限制
114
- move_area: null
115
-
116
- }
117
- },
118
- methods: {
119
-
120
- //事件绑定
121
- $_bind_event(){
122
- const $el = this.$el;
123
- if(this.freeDrag){ //自由拖动
124
- $el.ontouchmove = this.$_free_move;
125
- $el.onmouseup = this.$_free_move_end;
126
- $el.ontouchend = this.$_free_move_end;
127
- }else { //拖拽事件
128
- $el.ondragstart = this.$_drag_start;
129
- $el.ondrag = this.$_drag_move;
130
- $el.ondragend = this.$_drag_end;
131
- $el.ondragover = this.$_drag_over;
132
- $el.ondragleave = this.$_drag_leave;
133
- $el.ondrop = this.$_drop;
134
- }
135
- },
136
-
137
- //按下(激活)拖拽目标
138
- $_act_target(e){
139
- this.toggle_style('drag_start');
140
- if(this.freeDrag){
141
- e.preventDefault();
142
- const $el = this.$el,
143
- $offset_parent = $el.offsetParent;
144
- if(!this.move_cur_pos) {
145
- this.move_pos = this.move_cur_pos = {
146
- x: $el.offsetLeft,
147
- y: $el.offsetTop
148
- };
149
- }
150
- if(!this.move_area) this.move_area = {
151
- x: $offset_parent.clientWidth - $el.offsetWidth,
152
- y: $offset_parent.clientHeight - $el.offsetHeight
153
- }
154
- this.move_start_point_pos = {
155
- x: e.screenX,
156
- y: e.screenY
157
- }
158
-
159
- //动态事件绑定
160
- if(!$offset_parent.onmousemove) $offset_parent.onmousemove = this.$_free_move;
161
- if(!$offset_parent.onmouseleave) $offset_parent.onmouseleave = this.$_free_move_end;
162
-
163
- this.move_state = true;
164
- }
165
- },
166
-
167
- //拖拽开始
168
- $_drag_start(e){
169
- this.$emit("on_drag_start", e);
170
- e.dataTransfer.setData("info", e.target.dataset.info);
171
- },
172
-
173
- //拖拽移动
174
- $_drag_move(e){
175
- e.preventDefault();
176
- this.drag_state = true;
177
- },
178
-
179
- //拖拽结束
180
- $_drag_end(e){
181
- this.drag_state = false;
182
- this.$emit("on_drag_end", e);
183
- this.reset_style();
184
- },
185
-
186
- //拖拽预备放入
187
- $_drag_over(e){
188
- e.preventDefault();
189
- this.$emit("on_drag_over", e);
190
- this.toggle_style("drag_over");
191
- },
192
-
193
- //拖拽离开容器
194
- $_drag_leave(e){
195
- this.$emit("on_drag_leave", e);
196
- this.reset_style();
197
- },
198
-
199
- //完成放入
200
- $_drop(e){
201
- this.$emit("on_drop", {
202
- you: JSON.parse(e.dataTransfer.getData("info")),
203
- me: JSON.parse(this.$el.dataset.info)
204
- }, e);
205
- this.reset_style();
206
- },
207
-
208
- //自由拖动
209
- $_free_move(e){
210
- if(this.move_state){
211
- const orig_pos = this.move_start_point_pos,
212
- cur_pos = this.move_cur_pos,
213
- rel_x = e.screenX - orig_pos.x,
214
- rel_y = e.screenY - orig_pos.y,
215
- move_area = this.move_area;
216
- let move_pos_x = cur_pos.x + rel_x,
217
- move_pos_y = cur_pos.y + rel_y;
218
-
219
- //区域限制
220
- if(move_pos_x < 0) move_pos_x = 0;
221
- if(move_pos_y < 0) move_pos_y = 0;
222
- if(move_pos_x > move_area.x) move_pos_x = move_area.x;
223
- if(move_pos_y > move_area.y) move_pos_y = move_area.y;
224
-
225
- this.move_pos = {
226
- x: move_pos_x,
227
- y: move_pos_y,
228
- }
229
- this.$emit("on_move", this.move_pos, move_area);
230
- }
231
- },
232
-
233
- //自由拖动结束
234
- $_free_move_end(){
235
- if(this.move_state){
236
- this.reset_style();
237
- this.move_state = false;
238
- this.move_cur_pos = this.move_pos;
239
- }
240
- },
241
-
242
- },
243
- watch: {
244
-
245
- //数据更新
246
- dataInfo(){
247
- this.$el.dataset.info = JSON.stringify(this.dataInfo);
248
- }
249
-
250
- },
251
- mounted(){
252
- this.append_state(this.dragStart, "drag_start");
253
- this.append_state(this.dragOver, "drag_over");
254
- this.$el.dataset.info = JSON.stringify(this.dataInfo);
255
- this.$_bind_event();
256
- }
257
- }
258
- </script>
@@ -1,84 +0,0 @@
1
- <template>
2
- <b-view :styles="`${styles} rel`">
3
- <!--容器描边-->
4
- <b-view styles="abs max bg-none z1 t-0 l-0"
5
- :states="{
6
- line: {
7
- style: `line line-${outlineColor} thick-${line[1] + 1}`,
8
- state: outlineColor
9
- }
10
- }">
11
- </b-view>
12
-
13
- <!--网格-->
14
- <b-view styles="grid">
15
- <b-view v-for="(item,i) of colData.items" :key="i"
16
- :class="colData.common_plan || item.plan"
17
- :styles="`rel line-b line-r line-${line[0]} thick-${line[1]} h-${gridHeight} pad-${gap}`">
18
- <slot :name="item.id || item.Id" />
19
- </b-view>
20
- </b-view>
21
- </b-view>
22
- </template>
23
-
24
- <script>
25
- import BView from "./b-view";
26
-
27
- let desc = ["该组件可用于实现响应式栅格布局。"],
28
- extend = [],
29
- dependent = ["b-view"],
30
- api = null,
31
- init_data = `{
32
- colData: {
33
- items: [
34
- {
35
- id|Id: "单元格 id",
36
- plan: "局部栅格方案,可参考栅格系统全局样式 .col-*",
37
- ....
38
- },...
39
- ],
40
- common_plan: "公共栅格方案,可参考栅格系统全局样式 .col-*"
41
- },
42
- /* styles: "(参照:b-style 组件入参)" */,
43
- /* gridHeight: "栅格固定高度" */,
44
- /* gap: "栅格内边距,默认为 0" */,
45
- /* line: ["网格描边颜色", "网格描边粗细"] */,
46
- /* outlineColor: "容器描边色" */,
47
- }`;
48
-
49
- export default {
50
- name: "b-grid",
51
- introduce: { desc, extend, dependent, api, init_data },
52
- components: {
53
- BView
54
- },
55
- props: {
56
- colData: {
57
- type: Object,
58
- required: true
59
- },
60
- styles: {
61
- type: String,
62
- required: false
63
- },
64
- gap: {
65
- type: [Number, String],
66
- required: false,
67
- default: 0
68
- },
69
- gridHeight: {
70
- type: [Number, String],
71
- required: false
72
- },
73
- line: {
74
- type: Array,
75
- required: false,
76
- default: () => ["none", 0]
77
- },
78
- outlineColor: {
79
- type: String,
80
- required: false
81
- },
82
- }
83
- }
84
- </script>
@@ -1,171 +0,0 @@
1
- <template>
2
- <a @click="$_click" @dblclick="$_dblclick"
3
- @touchstart="$_enter" @touchend="$_leave"
4
- @mousemove="$emit('on_move', $event)"
5
- :href="url"
6
- :target="target"
7
- :download="download"
8
- :style="computed_style" >
9
- <slot />
10
- </a>
11
- </template>
12
-
13
- <script>
14
- import ChapterLink from "./lib/ChapterLink"
15
-
16
- let desc = ["该组件用于实现热点交互操作。"],
17
- extend = ["b-style"],
18
- dependent = ["ChapterLink"],
19
- api = {
20
- event: [
21
- {
22
- name: "on_click",
23
- ef: "左键单击",
24
- params: "event",
25
- },
26
- {
27
- name: "on_dblclick",
28
- ef: "左键双击",
29
- params: "event",
30
- },
31
- {
32
- name: "on_enter",
33
- ef: "鼠标移入或手指按下(悬停)",
34
- params: "event",
35
- },
36
- {
37
- name: "on_leave",
38
- ef: "鼠标移出或手指抬起",
39
- params: "event",
40
- },
41
- {
42
- name: "on_move",
43
- ef: "鼠标移动",
44
- params: "event",
45
- }
46
- ]
47
- },
48
- init_data = `{
49
- /* styles: "(参照:b-style 组件入参)" */,
50
- /* link: "外部链接 | 组件路由 | 手机拨号 | {
51
- chapter_id: "内部链接元素 id",
52
- chapter_link_data: "(参照:ChapterLink 类构造函数)"
53
- } | {
54
- download: "下载文件名",
55
- res: "下载资源地址"
56
- }" */,
57
- /* hover: "悬停样式值" */,
58
- /* forbid: "鼠标点击事件及链接禁用,默认 false,不禁用" */,
59
- /* newFrame: "强制开启新窗口,默认 false" */,
60
- }`;
61
-
62
- export default {
63
- name: "b-hot",
64
- introduce: { desc, extend, dependent, api, init_data },
65
- props: {
66
- link: {
67
- type: [String, Object],
68
- required: false
69
- },
70
- hover: {
71
- type: String,
72
- required: false
73
- },
74
- forbid: {
75
- type: Boolean,
76
- required: false
77
- },
78
- newFrame: {
79
- type: Boolean,
80
- required: false
81
- },
82
- },
83
- data(){
84
- return {
85
-
86
- //链接开启方式
87
- target: this.newFrame? "_blank": null,
88
-
89
- //下载地址
90
- download: null,
91
-
92
- //内链控制器
93
- chapter_link: this.$_init_chapter_link(),
94
-
95
- }
96
- },
97
- computed: {
98
-
99
- //链接地址
100
- url(){
101
- if(this.forbid) return false; //禁用效果
102
- let link = this.link;
103
- if(!link) return "javascript:;"
104
- if(typeof(link) === "string"){
105
- if(link.search("http") === 0){ //外部链接
106
- this.target = "_blank";
107
- return link;
108
- }else if(link.search("/") === 0){ //组件路由
109
- return (this.$router.mode === "history"? "": "#") + link;
110
- }else if(link.search(/^(tel|mailto):/) === 0){ //手机拨号 | 邮件
111
- return link;
112
- }
113
- } else{
114
- if(link.download){ //文件下载
115
- this.download = link.download;
116
- return link.res;
117
- }else { //内部链接
118
- return `#${this.$route.path}`;
119
- }
120
- }
121
- },
122
-
123
- },
124
- methods: {
125
-
126
- //初始化内链控制器
127
- $_init_chapter_link(){
128
- if(this.link && this.link.chapter_id){
129
- let {ani_speed, offset, callback} = this.link.chapter_link_data || {};
130
- return new ChapterLink(ani_speed, offset, callback);
131
- }else {
132
- return null;
133
- }
134
- },
135
-
136
- //执行点击
137
- $_click(e){
138
- e.stopPropagation();
139
- !this.forbid && this.$emit("on_click", e);
140
- this.chapter_link && this.chapter_link.go_chapter(this.link.chapter_id); //内部链接
141
- },
142
-
143
- //执行双击
144
- $_dblclick(e){
145
- e.stopPropagation();
146
- !this.forbid && this.$emit("on_dblclick", e);
147
- this.target && this.reset_style();
148
- },
149
-
150
- //鼠标移入|触控开始
151
- $_enter(e){
152
- !this.cur_states.length && this.toggle_style("hover"); //仅限默认状态下
153
- this.$emit("on_enter", e);
154
- },
155
-
156
- //鼠标移出|触控结束
157
- $_leave(e){
158
- this.cur_states[0] === "hover" && this.reset_style(); //仅限 hover 状态下
159
- this.$emit("on_leave", e);
160
- },
161
-
162
- },
163
- mounted(){
164
- if(document.createElement("div").ontouchstart !== null) {
165
- this.$el.onmouseenter = this.$_enter;
166
- this.$el.onmouseleave = this.$_leave;
167
- }
168
- this.append_state(this.hover, "hover");
169
- }
170
- }
171
- </script>
@@ -1,76 +0,0 @@
1
- <!--
2
- * @Author: btxstudio btxstudio@163.com
3
- * @Date: 2023-10-28 13:53:44
4
- * @LastEditors: btxstudio btxstudio@163.com
5
- * @LastEditTime: 2023-11-22 15:44:47
6
- * @FilePath: \BTXUI\components\BTXUI\core\b-icon.vue
7
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8
- -->
9
- <template>
10
- <!--动态图标-->
11
- <b-view v-if="icon && icon.search('ani_') === 0" :style="computed_style">
12
- <!--success-->
13
- <ani-success v-if="icon === 'ani_success'" key="success" />
14
-
15
- <!--fail-->
16
- <ani-fail v-if="icon === 'ani_fail'" key="fail" />
17
-
18
- <!--notic-->
19
- <ani-notic v-if="icon === 'ani_notic'" key="notic" />
20
-
21
- <!--loading-->
22
- <ani-loading v-if="icon === 'ani_loading'" key="loading" />
23
- </b-view>
24
-
25
- <!--字体图标-->
26
- <i v-else-if="icon" :class="`ico-${icon}`" :style="computed_style"></i>
27
-
28
- <!--图片图标-->
29
- <b-view v-else-if="bgImg" :bg-img="bgImg" :style="computed_style" />
30
- </template>
31
-
32
- <script>
33
- import BView from "./b-view";
34
- import BText from "./b-text";
35
- import AniSuccess from "./anis/ani-success";
36
- import AniFail from "./anis/ani-fail";
37
- import AniNotic from "./anis/ani-notic";
38
- import AniLoading from "./anis/ani-loading";
39
-
40
- let desc = ["该组件用于显示图标,包括 “字体图标”、“图片图标”、“css 动画图标”。"],
41
- extend = ["b-style"],
42
- dependent = ["b-view", "b-text", "ani-success", "ani-fail", "ani-notic", "ani-loading"],
43
- api = null,
44
- init_data = `{
45
- /* styles: "(参照:b-style 组件入参)" */,
46
- /* icon: "字体图标名(无需 ico 前缀)| 动态图标(ani_success、ani_fail、ani_notic)" */,
47
- /* bgImg: "图片地址" */,
48
- }`;
49
-
50
- export default {
51
- name: "b-icon",
52
- introduce: { desc, extend, dependent, api, init_data },
53
- components: {
54
- BView,
55
- BText,
56
- AniSuccess,
57
- AniFail,
58
- AniNotic,
59
- AniLoading
60
- },
61
- props: {
62
- icon: {
63
- type: String,
64
- required: false
65
- },
66
- imgData: {
67
- type: Object,
68
- required: false
69
- },
70
- bgImg: {
71
- type: String,
72
- required: false
73
- }
74
- }
75
- }
76
- </script>
@@ -1,84 +0,0 @@
1
- <template>
2
- <img :src="src" :style="{...computed_style, objectFit: objFit}" :alt="alt">
3
- </template>
4
-
5
- <script>
6
-
7
- let desc = ["该组件用于实现图片显示。"],
8
- extend = ["b-style"],
9
- dependent = [],
10
- api = {
11
- event: [
12
- {
13
- name: "on_load",
14
- ef: "图片加载完成",
15
- params: "-",
16
- }
17
- ]
18
- },
19
- init_data = `{
20
- img: "图像资源",
21
- /* styles: "(参照:b-style 组件入参)" */,
22
- /* objFit: "object-fit 样式值,默认:cover" */,
23
- /* defaultSrc: "默认图,加载失败或初始加载时显示" */,
24
- /* alt: "图片说明提示" */
25
- }`;
26
-
27
- export default {
28
- name: "b-img",
29
- introduce: { desc, extend, dependent, api, init_data },
30
- props: {
31
- img: {
32
- type: String,
33
- required: false
34
- },
35
- objFit: {
36
- type: String,
37
- required: false,
38
- default: "cover"
39
- },
40
- defaultSrc: {
41
- type: String,
42
- required: false
43
- },
44
- alt: {
45
- type: String,
46
- required: false
47
- }
48
- },
49
- data(){
50
- return {
51
-
52
- //图像显示地址
53
- src: this.defaultSrc,
54
-
55
- }
56
- },
57
- watch: {
58
-
59
- //监听图像源
60
- img(){
61
- this.$_load();
62
- }
63
-
64
- },
65
- methods: {
66
-
67
- //图像源加载
68
- $_load(){
69
- if(this.img && (this.img.match(/\.(jpg|png|gif|jpeg)/) || this.img.search("data:image/png;base64") === 0)){
70
- const img = new Image();
71
- img.onload = ()=>{
72
- this.src = this.img;
73
- this.$emit("on_load");
74
- }
75
- img.src = this.img;
76
- }
77
- }
78
-
79
- },
80
- mounted(){
81
- this.$_load();
82
- }
83
- }
84
- </script>