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,128 +0,0 @@
1
- <template>
2
- <b-hot @on_click="$_click"
3
- v-bind="hotData"
4
- :styles="`flex-5 pad-h-1.4 pad-v-.4 line thick-1 ellipsis ${btnRound? 'round-lg': 'round-sm'} ${btnWidth? 'w-' + btnWidth: ''} color-${btn_color.normal.text} ${$_set_bg(btn_color.normal.bg)} line-${btn_color.normal.line}`"
5
- :hover="`color-${btn_color.hover.text} ${$_set_bg(btn_color.hover.bg)} line-${btn_color.hover.line}`">
6
-
7
- <!--图标-->
8
- <b-icon v-if="iconData" v-bind="iconData" styles="mrg-r-.7" />
9
-
10
- {{btnText}}
11
- </b-hot>
12
- </template>
13
-
14
- <script>
15
- import BHot from "@/components/BTXUI/core/b-hot";
16
- import BIcon from "@/components/BTXUI/core/b-icon";
17
-
18
- const desc = ["该组件用于实现按钮交互操作。"],
19
- extend = [],
20
- dependent = ["b-icon", "b-hot"],
21
- api = {
22
- event: [
23
- {
24
- name: "on_click",
25
- ef: "点击触发",
26
- params: "-"
27
- }
28
- ]
29
- },
30
- init_data = `{
31
- btnText: "按钮文字",
32
- /* btnColor: {
33
- normal: {
34
- text: "默认文字色样式色值",
35
- bg: "默认背景色样式色值",
36
- line: "默认描边色样式色值",
37
- },
38
- hover: {
39
- text: "悬停文字色样式色值",
40
- bg: "悬停背景色样式色值",
41
- line: "悬停描边色样式色值",
42
- },
43
- } */,
44
- /* btnRound: "启用大圆角效果" */,
45
- /* btnWidth: "按钮固定宽度" */,
46
- /* hotData: "(参照:b-hot 组件入参)" */,
47
- /* iconData: "(参照:b-icon 组件入参)" */
48
- }`;
49
-
50
- export default {
51
- name: "btn-wid",
52
- introduce: { desc, extend, dependent, api, init_data },
53
- components: {
54
- BHot,
55
- BIcon
56
- },
57
- props: {
58
- btnText: {
59
- type: String,
60
- required: true,
61
- },
62
- btnColor: {
63
- type: Object,
64
- required: false,
65
- default: () => {
66
- return {
67
- normal:{},
68
- hover:{},
69
- }
70
- }
71
- },
72
- btnRound: {
73
- type: Boolean,
74
- required: false
75
- },
76
- btnWidth: {
77
- type: [String, Number],
78
- required: false
79
- },
80
- hotData: {
81
- type: Object,
82
- required: false
83
- },
84
- iconData: {
85
- type: Object,
86
- required: false
87
- }
88
- },
89
- data(){
90
- return {
91
-
92
- //按钮色彩风格
93
- btn_color: {
94
- normal: {
95
- text: "dgray",
96
- bg: "lgray",
97
- line: "none",
98
- ...this.btnColor.normal
99
- },
100
- hover: {
101
- text: "blue",
102
- bg: "#e7e7e7",
103
- line: "none",
104
- ...this.btnColor.hover
105
- }
106
- }
107
-
108
- }
109
- },
110
- methods: {
111
-
112
- //执行点击
113
- $_click(){
114
- this.$emit("on_click");
115
- },
116
-
117
- //设置背景样式
118
- $_set_bg(color){
119
- if(Array.isArray(color)){ //渐变色
120
- return `bg-gradient-left,${color.join(",")}`;
121
- }else{ //纯色
122
- return `bg-color-${color}`;
123
- }
124
- }
125
-
126
- }
127
- }
128
- </script>
@@ -1,138 +0,0 @@
1
- <template>
2
- <b-view styles="no-scroll"
3
- @on_touchstart="pause"
4
- @on_touchend="play"
5
- @on_leave="play"
6
- @on_enter="pause">
7
- <b-view styles="flex"
8
- :dynamic="`w-${item_box_width}px translateX-f${offset}px`">
9
- <b-view v-for="(item,i) of play_items" :key="i"
10
- :styles="`pad-h-${rule / 2}px`"
11
- :dynamic="`w-${item_width}px`">
12
- <slot :name="item.id" />
13
- </b-view>
14
- </b-view>
15
- </b-view>
16
- </template>
17
-
18
- <script>
19
- import BView from "@/components/BTXUI/core/b-view"
20
-
21
- const desc = ["该组件用于实现自定义元素的走马灯效果。"],
22
- extend = [],
23
- dependent = ["b-view"],
24
- api = {
25
- methods: [
26
- {
27
- name: "play",
28
- ef: "播放走马灯",
29
- params: "-",
30
- return: "-"
31
- },
32
- {
33
- name: "pause",
34
- ef: "暂停走马灯",
35
- params: "-",
36
- return: "-"
37
- }
38
- ]
39
- },
40
- init_data = `{
41
- items: [
42
- {
43
- id: "数据标识",...
44
- },...
45
- ],
46
- /* visiableCount: "项目可见数量,默认为 3" */,
47
- /* rule: "项目间距" */,
48
- /* speed: "播放速度" */
49
- }`;
50
-
51
- export default {
52
- name: "carousel-wid",
53
- introduce: { desc, extend, dependent, api, init_data },
54
- components: {
55
- BView
56
- },
57
- props: {
58
- items: {
59
- required: true,
60
- type: Array
61
- },
62
- visiableCount: {
63
- required: false,
64
- type: Number,
65
- default: 3
66
- },
67
- rule: {
68
- required: false,
69
- type: Number,
70
- default: 0
71
- },
72
- speed: {
73
- required: false,
74
- type: Number,
75
- default: 1
76
- },
77
- },
78
- data(){
79
- return {
80
-
81
- //播放项目
82
- play_items: this.items,
83
-
84
- //播放器宽度
85
- player_width: 0,
86
-
87
- //项目宽度
88
- item_width: 0,
89
-
90
- //项目容器宽度
91
- item_box_width: 0,
92
-
93
- //播放状态
94
- play_state: true,
95
-
96
- //水平位移
97
- offset: 0,
98
-
99
- }
100
- },
101
- methods: {
102
-
103
- //暂停
104
- pause(){
105
- this.play_state = false;
106
- },
107
-
108
- //播放
109
- play(){
110
- this.play_state = true;
111
- this.$_play();
112
- },
113
-
114
- //执行播放
115
- $_play(){
116
- if(!this.play_state) return false;
117
- let speed = this.offset += this.speed;
118
- if(speed >= this.item_width){
119
- this.play_items.push(this.play_items.shift());
120
- this.offset = 0;
121
- }
122
- requestAnimationFrame(this.$_play);
123
- },
124
-
125
- //初始化数据
126
- $_init_data(){
127
- this.player_width = this.$el.clientWidth;
128
- this.item_width = this.player_width / this.visiableCount;
129
- this.item_box_width = this.item_width * this.play_items.length;
130
- this.play_items.length > this.visiableCount && this.$_play();
131
- },
132
-
133
- },
134
- mounted(){
135
- this.$_init_data();
136
- }
137
- }
138
- </script>
@@ -1,72 +0,0 @@
1
- <template>
2
- <b-hot :styles="`flex-4 bg-color-neutral round-sm ${tag_text? 'pad-r-1 pad-v-.4 pad-l-.4': ''}`"
3
- hover="bg-color-rgba(134,134,134,.24)"
4
- :states="{
5
- act: {
6
- style: 'color-blue',
7
- state: selected
8
- }
9
- }"
10
- @on_click="$_click">
11
-
12
- <!--选框-->
13
- <b-view styles="w-1.7 h-1.7 bg-color-neutral round-sm flex-5"
14
- :states="{
15
- act: {
16
- style: 'bg-color-blue color-light',
17
- state: selected
18
- }
19
- }">
20
- <b-icon icon="success" styles="alpha-.3"
21
- :states="{
22
- act: {
23
- style: 'alpha-1',
24
- state: selected
25
- }
26
- }"/>
27
- </b-view>
28
-
29
- <!--文字-->
30
- <b-view v-if="tag_text" styles="mrg-l-1 ellipsis">
31
- {{tag_text}}
32
- </b-view>
33
-
34
- </b-hot>
35
- </template>
36
-
37
- <script>
38
- import TagWid from "@/components/BTXUI/tag/tag-wid"
39
- import BHot from "@/components/BTXUI/core/b-hot"
40
- import BView from "@/components/BTXUI/core/b-view"
41
- import BIcon from "@/components/BTXUI/core/b-icon"
42
-
43
- let desc = ["该组件用于复选框切换选择操作。"],
44
- extend = ["tag-wid"],
45
- dependent = ["b-hot", "b-icon", "b-view"],
46
- api = {
47
- extend: "继承自:<code>tag-wid</code> 组件"
48
- },
49
- init_data = "继承自:tag-wid 组件入参。text 为非必须参数,colors、mode 入参无效";
50
-
51
- export default {
52
- extends: TagWid,
53
- name: "checkbox-wid",
54
- introduce: { desc, extend, dependent, api, init_data },
55
- components: {
56
- BView,
57
- BHot,
58
- BIcon
59
- },
60
- props: {
61
- text: {
62
- type: String,
63
- required: false
64
- },
65
- mode: {
66
- type: String,
67
- required: false,
68
- default: "checkbox"
69
- },
70
- }
71
- }
72
- </script>
@@ -1,279 +0,0 @@
1
- <template>
2
- <pannel-wid v-model="visible" v-bind="pannel_data">
3
- <b-view :styles="`round-sm pcenter fsize-1.1 shadow color-rgba(24,24,24,.34) bg-color-${wid_colors.pannel}`">
4
- <b-view :styles="`flex-column flex-5 pad-v-2.5 pad-h-4 color-${wid_colors.text}`">
5
- <!--图标-->
6
- <b-view styles="mrg-b-1 flex-2" v-if="pannel.state">
7
- <b-view styles="w-3.2 h-3.2 round fsize-1.7 flex-5"
8
- :states="{
9
- success: {
10
- style: `bg-color-${wid_colors.success}`,
11
- state: pannel.state === 'success'
12
- },
13
- fail: {
14
- style: `bg-color-${wid_colors.fail}`,
15
- state: pannel.state === 'fail'
16
- },
17
- notic: {
18
- style: `bg-color-${wid_colors.notic}`,
19
- state: pannel.state === 'notic'
20
- },
21
- loading: {
22
- style: `bg-color-${wid_colors.loading}`,
23
- state: pannel.state === 'loading'
24
- },
25
- }">
26
- <b-icon :icon="pannel_icon" />
27
- </b-view>
28
- </b-view>
29
-
30
- <!--文字-->
31
- <b-view styles="alpha-.9" v-html="pannel.text"></b-view>
32
- </b-view>
33
-
34
- <!--按钮-->
35
- <b-view v-if="pannel.mode !== 'toast'" :styles="`flex pad-3px color-${wid_colors.text}`">
36
- <!--alert-->
37
- <template v-if="pannel.mode === 'alert'">
38
- <b-hot key="a" @on_click="$_close()"
39
- styles="bg-color-neutral round-sm pad-h-1.2 pad-v-.7 grow-1"
40
- hover="bg-color-rgba(134,134,134,0.24)">
41
- {{btn_cname[0]}}
42
- </b-hot>
43
- </template>
44
-
45
- <!--confirm-->
46
- <template v-else-if="pannel.mode === 'confirm'">
47
- <b-hot key="b" @on_click="$_click('ok')"
48
- styles="bg-color-neutral round-sm round-l pad-h-1.2 pad-v-.7 grow-1 mrg-r-1px"
49
- hover="bg-color-rgba(134,134,134,0.24)">
50
- {{btn_cname[0]}}
51
- </b-hot>
52
- <b-hot @on_click="$_click('cancel')"
53
- styles="bg-color-neutral round-sm round-r pad-h-1.2 pad-v-.7 grow-1"
54
- hover="bg-color-rgba(134,134,134,0.24)">
55
- {{btn_cname[1]}}
56
- </b-hot>
57
- </template>
58
- </b-view>
59
- </b-view>
60
- </pannel-wid>
61
- </template>
62
-
63
- <script>
64
- import BView from "@/components/BTXUI/core/b-view";
65
- import BHot from "@/components/BTXUI/core/b-hot";
66
- import BIcon from "@/components/BTXUI/core/b-icon";
67
- import PannelWid from "@/components/BTXUI/pannel/pannel-wid";
68
-
69
- const desc = ["该组件用于显示弹窗提示。", "通常在入口页进行全局实例化绑定,之后可通过相关 API 进行使用:<code>this.$confirm['method']()</code>。"],
70
- extend = [],
71
- dependent = ["pannel-wid", "b-icon", "b-hot", "b-view"],
72
- api = {
73
- methods: [
74
- {
75
- name: "toast",
76
- ef: "显示提示弹窗",
77
- params: "text, <span class=\"alpha-d7\">[duration=2000, state=\"\"]</span>",
78
- return: "-"
79
- },
80
- {
81
- name: "alert",
82
- ef: "显示警示弹窗",
83
- params: "text, <span class=\"alpha-d7\">[state=\"\", btn_cname=\"确认\"]</span>",
84
- return: "-"
85
- },
86
- {
87
- name: "confirm",
88
- ef: "显示确认弹窗",
89
- params: "text, <span class=\"alpha-d7\">[success=null, error=null, state=\"\", btn_cname=[\"确认,取消\"]]</span>",
90
- return: "-"
91
- },
92
- {
93
- name: "prograss",
94
- ef: "显示加载弹窗",
95
- params: "text, <span class=\"alpha-d7\">[result=false]</span>",
96
- return: "-"
97
- }
98
- ]
99
- },
100
- init_data = `{
101
- /* colors: {
102
- matte: "遮罩颜色",
103
- text: "文字颜色(同时支持富文本)",
104
- pannel: "面板颜色",
105
- suucees: "成功提示图标背景色",
106
- fail: "失败提示图标背景色",
107
- notic: "信息提示图标背景色",
108
- loading: "加载提示图标背景色"
109
- } */
110
- }`;
111
-
112
- export default {
113
- name: "confirm-wid",
114
- introduce: { desc, extend, dependent, api, init_data },
115
- components: {
116
- PannelWid,
117
- BView,
118
- BHot,
119
- BIcon
120
- },
121
- props: {
122
- colors: {
123
- type: Object,
124
- required: false
125
- },
126
- },
127
- data() {
128
- return {
129
-
130
- //组件配色
131
- wid_colors: {
132
- text: "dgray",
133
- pannel: "light",
134
- success: "#e6fff2",
135
- fail: "#f9f2f4",
136
- notic: "#e6f5ff",
137
- loading: "lgray",
138
- ...this.colors
139
- },
140
-
141
- //pannel-wid 入参
142
- pannel_data: {
143
- matte: true,
144
- matteColor: this.colors.matte,
145
- matteZIndex: 10
146
- },
147
-
148
- //弹窗显示状态
149
- visible: false,
150
-
151
- //弹窗状态
152
- pannel: {
153
- mode: "",
154
- text: "",
155
- state: "",
156
- close_t: null,
157
- },
158
-
159
- //按钮别名
160
- btn_cname: null,
161
-
162
- //点击回调
163
- callbacks: {
164
- ok: null,
165
- cancel: null
166
- },
167
-
168
- }
169
- },
170
- computed: {
171
-
172
- //面板图标
173
- pannel_icon(){
174
- let state = this.pannel.state;
175
- return (state === "success" || state === "fail" || state === "notic" || state === "loading")? `ani_${state}`: state;
176
- }
177
-
178
- },
179
- methods: {
180
-
181
- //提示弹窗
182
- toast(text, duration=2000, state="") {
183
- this.$_show();
184
- this.pannel = {
185
- mode: "toast",
186
- state,
187
- text
188
- }
189
- setTimeout(() => {
190
- this.$_close();
191
- }, duration)
192
- },
193
-
194
- //警示弹窗
195
- alert(text, state="", btn_cname="确认") {
196
- this.$_show();
197
- this.pannel = {
198
- mode: "alert",
199
- state,
200
- text
201
- }
202
- this.btn_cname = [btn_cname];
203
- this.$_bind_keyboard_event();
204
- },
205
-
206
- //确认弹窗
207
- confirm(text, success=null, error=null, state="", btn_cname=["确认","取消"]) {
208
- this.$_show();
209
- this.pannel = {
210
- mode: "confirm",
211
- text,
212
- state
213
- }
214
- this.btn_cname = btn_cname;
215
- this.callbacks.ok = success;
216
- this.callbacks.cancel = error;
217
- this.$_bind_keyboard_event();
218
- },
219
-
220
- //加载弹窗
221
- prograss(text, result=false) {
222
- if(result === true){ //直接关闭
223
- this.toast("", 0);
224
- } else if(typeof(result) === "string") { //状态关闭
225
- this.toast(text, 2000, result);
226
- } else { //开启弹窗
227
- this.$_show();
228
- this.pannel = {
229
- mode: "toast",
230
- state: "loading",
231
- text
232
- }
233
- }
234
- },
235
-
236
- //关闭窗口
237
- $_close(callback) {
238
- callback && callback();
239
- this.visible = false;
240
- this.$_cancel_bind_keyboard_event();
241
- },
242
-
243
- //显示窗口
244
- $_show() {
245
- this.visible = true;
246
- },
247
-
248
- //执行点击操作
249
- $_click(operate) {
250
- this.$_close(this.callbacks[operate]);
251
- },
252
-
253
- //绑定键盘事件
254
- $_bind_keyboard_event() {
255
- window.focus();
256
- window.addEventListener("keyup", this.$_keyboard_enter);
257
- },
258
-
259
- //回车输入
260
- $_keyboard_enter(e) {
261
- if (e.key === "Enter") {
262
- this.$_close(this.callbacks.ok);
263
- }
264
- },
265
-
266
- //销毁键盘事件
267
- $_cancel_bind_keyboard_event() {
268
- window.removeEventListener("keyup", this.$_keyboard_enter);
269
- }
270
-
271
- },
272
- mounted() {
273
- // this.$root.__proto__.$confirm = this; // 扩展为全局工具组件
274
- },
275
- beforeDestroy() {
276
- this.$_close();
277
- }
278
- }
279
- </script>
@@ -1,44 +0,0 @@
1
- <template>
2
- <b-hot :styles="`flex-4 bg-color-neutral round-sm ${tag_text? 'pad-r-1 pad-v-.4 pad-l-.4': ''} color-${tag_colors.normal.text} bg-color-${tag_colors.normal.bg}`"
3
- :hover="`bg-color-${tag_colors.hover.bg} color-${tag_colors.hover.text}`"
4
- :states="{
5
- act: {
6
- style: `bg-color-${tag_colors.act.bg} color-${tag_colors.act.text}`,
7
- state: selected
8
- }
9
- }"
10
- @on_click="$_click">
11
-
12
- <!--选框-->
13
- <b-view styles="w-1.7 h-1.7 bg-color-neutral round-sm flex-5"
14
- :states="{
15
- act: {
16
- style: `bg-color-${tag_colors.act.text} color-${tag_colors.act.bg}`,
17
- state: selected
18
- }
19
- }">
20
- <b-icon icon="success" styles="alpha-.3"
21
- :states="{
22
- act: {
23
- style: 'alpha-1',
24
- state: selected
25
- }
26
- }"/>
27
- </b-view>
28
-
29
- <!--文字-->
30
- <b-view v-if="tag_text" styles="mrg-l-1">
31
- {{tag_text}}
32
- </b-view>
33
-
34
- </b-hot>
35
- </template>
36
-
37
- <script>
38
- import CheckboxWid from "@/components/BTXUI/checkbox/checkbox-wid"
39
-
40
- export default {
41
- extends: CheckboxWid,
42
- name: "content-checkbox-wid"
43
- }
44
- </script>