vdesign-ui 0.1.21 → 0.1.23

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 (185) hide show
  1. package/dist/components/actionbar/actionbar-cell/index.vue +34 -0
  2. package/dist/components/actionbar/index.js +8 -0
  3. package/dist/components/actionbar/index.vue +39 -0
  4. package/dist/components/actionbar/style.less +48 -0
  5. package/dist/components/actions-cell/actions/index.js +7 -0
  6. package/dist/components/actions-cell/actions/index.vue +76 -0
  7. package/dist/components/actions-cell/actions/style.less +112 -0
  8. package/dist/components/actions-cell/index.js +7 -0
  9. package/dist/components/actions-cell/index.vue +94 -0
  10. package/dist/components/actions-cell/style.less +39 -0
  11. package/dist/components/activityviews/index.js +8 -0
  12. package/dist/components/activityviews/index.vue +140 -0
  13. package/dist/components/activityviews/style.less +138 -0
  14. package/dist/components/badge/index.js +8 -0
  15. package/dist/components/badge/index.vue +49 -0
  16. package/dist/components/badge/style.less +66 -0
  17. package/dist/components/button/index.js +8 -0
  18. package/dist/components/button/index.vue +89 -0
  19. package/dist/components/button/style.less +563 -0
  20. package/dist/components/calendar/end.png +0 -0
  21. package/dist/components/calendar/index-element.vue +84 -0
  22. package/dist/components/calendar/index.js +8 -0
  23. package/dist/components/calendar/index.vue +52 -0
  24. package/dist/components/calendar/start.png +0 -0
  25. package/dist/components/calendar/style.less +167 -0
  26. package/dist/components/checkbox/assist.js +34 -0
  27. package/dist/components/checkbox/checkbox-group/index.js +8 -0
  28. package/dist/components/checkbox/checkbox-group/index.vue +69 -0
  29. package/dist/components/checkbox/index.js +8 -0
  30. package/dist/components/checkbox/index.vue +184 -0
  31. package/dist/components/checkbox/style.less +291 -0
  32. package/dist/components/common/state/index.vue +80 -0
  33. package/dist/components/data-list/index.js +10 -0
  34. package/dist/components/data-list/index.vue +19 -0
  35. package/dist/components/data-list/style.less +624 -0
  36. package/dist/components/datetime-picker/index.js +8 -0
  37. package/dist/components/datetime-picker/index.vue +37 -0
  38. package/dist/components/datetime-picker/style.less +24 -0
  39. package/dist/components/dialog/index.js +8 -0
  40. package/dist/components/dialog/index.vue +162 -0
  41. package/dist/components/dialog/overlay-manager.js +18 -0
  42. package/dist/components/dialog/style.less +132 -0
  43. package/dist/components/divider/index.js +8 -0
  44. package/dist/components/divider/index.vue +54 -0
  45. package/dist/components/divider/style.less +92 -0
  46. package/dist/components/dropdown/index.js +8 -0
  47. package/dist/components/dropdown/index.vue +210 -0
  48. package/dist/components/dropdown/style.less +418 -0
  49. package/dist/components/empty/404-dark.png +0 -0
  50. package/dist/components/empty/404.png +0 -0
  51. package/dist/components/empty/index.js +8 -0
  52. package/dist/components/empty/index.vue +95 -0
  53. package/dist/components/empty/network-dark.png +0 -0
  54. package/dist/components/empty/network.png +0 -0
  55. package/dist/components/empty/nodata-dark.png +0 -0
  56. package/dist/components/empty/nodata.png +0 -0
  57. package/dist/components/empty/style.less +60 -0
  58. package/dist/components/footer/index.js +7 -0
  59. package/dist/components/footer/index.vue +29 -0
  60. package/dist/components/footer/style.less +22 -0
  61. package/dist/components/footnav/footnav-item/index.js +7 -0
  62. package/dist/components/footnav/footnav-item/index.vue +75 -0
  63. package/dist/components/footnav/footnav-item/style.less +39 -0
  64. package/dist/components/footnav/index.js +7 -0
  65. package/dist/components/footnav/index.vue +97 -0
  66. package/dist/components/footnav/style.less +23 -0
  67. package/dist/components/form/index.js +7 -0
  68. package/dist/components/form/index.vue +12 -0
  69. package/dist/components/headnav/index.js +7 -0
  70. package/dist/components/headnav/index.vue +163 -0
  71. package/dist/components/headnav/style.less +245 -0
  72. package/dist/components/icon/font/iconfont.css +1049 -0
  73. package/dist/components/icon/font/iconfont.js +2 -0
  74. package/dist/components/icon/index.js +9 -0
  75. package/dist/components/icon/index.vue +46 -0
  76. package/dist/components/icon/style.less +44 -0
  77. package/dist/components/input/calcTextareaHeight.js +266 -0
  78. package/dist/components/input/index.js +8 -0
  79. package/dist/components/input/index.vue +343 -0
  80. package/dist/components/input/password/index.js +8 -0
  81. package/dist/components/input/password/index.vue +60 -0
  82. package/dist/components/input/search/index.js +8 -0
  83. package/dist/components/input/search/index.vue +66 -0
  84. package/dist/components/input/stepper/index.js +8 -0
  85. package/dist/components/input/stepper/index.vue +136 -0
  86. package/dist/components/input/style.less +497 -0
  87. package/dist/components/list/index.js +8 -0
  88. package/dist/components/list/index.vue +159 -0
  89. package/dist/components/list/style.less +292 -0
  90. package/dist/components/loading/index.js +7 -0
  91. package/dist/components/loading/index.vue +53 -0
  92. package/dist/components/loading/loading.png +0 -0
  93. package/dist/components/loading/refresh.png +0 -0
  94. package/dist/components/loading/style.less +48 -0
  95. package/dist/components/mixins/clickoutside.js +81 -0
  96. package/dist/components/mixins/dom.js +41 -0
  97. package/dist/components/mixins/languageMixin.js +38 -0
  98. package/dist/components/mixins/outlineConfigPlugin.js +40 -0
  99. package/dist/components/mixins/router-link.js +23 -0
  100. package/dist/components/mixins/themeMixin.js +29 -0
  101. package/dist/components/noticebar/index.js +8 -0
  102. package/dist/components/noticebar/index.vue +247 -0
  103. package/dist/components/noticebar/style.less +332 -0
  104. package/dist/components/overlay/index.js +8 -0
  105. package/dist/components/overlay/index.vue +161 -0
  106. package/dist/components/overlay/style.less +23 -0
  107. package/dist/components/pagebreak/index.js +7 -0
  108. package/dist/components/pagebreak/index.vue +60 -0
  109. package/dist/components/pagebreak/style.less +43 -0
  110. package/dist/components/popover/index.js +8 -0
  111. package/dist/components/popover/index.vue +99 -0
  112. package/dist/components/popover/style.less +346 -0
  113. package/dist/components/popover/vue-popover.vue +314 -0
  114. package/dist/components/radio/assist.js +34 -0
  115. package/dist/components/radio/index.js +8 -0
  116. package/dist/components/radio/index.vue +158 -0
  117. package/dist/components/radio/radio-group/index.vue +70 -0
  118. package/dist/components/radio/style.css +213 -0
  119. package/dist/components/radio/style.less +302 -0
  120. package/dist/components/result/completed-dark.png +0 -0
  121. package/dist/components/result/completed.png +0 -0
  122. package/dist/components/result/error-dark.png +0 -0
  123. package/dist/components/result/error.png +0 -0
  124. package/dist/components/result/index.js +8 -0
  125. package/dist/components/result/index.vue +75 -0
  126. package/dist/components/result/style.less +42 -0
  127. package/dist/components/result/wait-dark.png +0 -0
  128. package/dist/components/result/wait.png +0 -0
  129. package/dist/components/selector/index.js +8 -0
  130. package/dist/components/selector/index.vue +124 -0
  131. package/dist/components/selector/style.less +474 -0
  132. package/dist/components/skeleton/index.js +7 -0
  133. package/dist/components/skeleton/index.vue +142 -0
  134. package/dist/components/skeleton/style.less +192 -0
  135. package/dist/components/slider/draggable.js +49 -0
  136. package/dist/components/slider/index.js +7 -0
  137. package/dist/components/slider/index.vue +173 -0
  138. package/dist/components/slider/style.less +96 -0
  139. package/dist/components/slider/utils.js +60 -0
  140. package/dist/components/step/index.js +7 -0
  141. package/dist/components/step/index.vue +48 -0
  142. package/dist/components/step/style.less +59 -0
  143. package/dist/components/step-item/index.js +7 -0
  144. package/dist/components/step-item/index.vue +117 -0
  145. package/dist/components/step-item/style.less +361 -0
  146. package/dist/components/style/index.vue +42 -0
  147. package/dist/components/switch/index.js +8 -0
  148. package/dist/components/switch/index.vue +72 -0
  149. package/dist/components/switch/style.less +56 -0
  150. package/dist/components/tabs/index.js +8 -0
  151. package/dist/components/tabs/index.vue +145 -0
  152. package/dist/components/tabs/style.less +385 -0
  153. package/dist/components/tabs/tab/index.vue +56 -0
  154. package/dist/components/tag/index.js +7 -0
  155. package/dist/components/tag/index.vue +50 -0
  156. package/dist/components/tag/style.less +211 -0
  157. package/dist/components/title/index.js +8 -0
  158. package/dist/components/title/index.vue +92 -0
  159. package/dist/components/title/style.less +188 -0
  160. package/dist/components/toast/index.js +80 -0
  161. package/dist/components/toast/index.vue +44 -0
  162. package/dist/components/toast/style.less +55 -0
  163. package/dist/components/transition/index.js +8 -0
  164. package/dist/components/transition/index.vue +13 -0
  165. package/dist/components/transition/style.less +208 -0
  166. package/dist/components/upload/index.js +7 -0
  167. package/dist/components/upload/index.vue +103 -0
  168. package/dist/components/upload/index1.vue +225 -0
  169. package/dist/components/upload/style.less +156 -0
  170. package/dist/demo.html +10 -0
  171. package/dist/img/404-dark.775df5bb.png +0 -0
  172. package/dist/img/completed-dark.4183a8a8.png +0 -0
  173. package/dist/img/error-dark.b80857da.png +0 -0
  174. package/dist/img/network-dark.11a147bb.png +0 -0
  175. package/dist/img/nodata-dark.b0ea0e39.png +0 -0
  176. package/dist/img/wait-dark.6aa28731.png +0 -0
  177. package/dist/locale/ar.js +98 -0
  178. package/dist/locale/en.js +98 -0
  179. package/dist/locale/zh.js +98 -0
  180. package/dist/token.css +2982 -0
  181. package/dist/vdesign-ui.common.js +27013 -0
  182. package/dist/vdesign-ui.css +1 -0
  183. package/dist/vdesign-ui.umd.js +27023 -0
  184. package/dist/vdesign-ui.umd.min.js +32 -0
  185. package/package.json +1 -1
@@ -0,0 +1,34 @@
1
+ <template>
2
+ <span class="vd-actionbar-cell" :class="wrapClasses">
3
+ <vd-icon v-if="iconName" :name="iconName"></vd-icon>
4
+ <slot></slot>
5
+ </span>
6
+ </template>
7
+ <script>
8
+ const prefixCls = 'vd-actionbar'
9
+ export default {
10
+ name: 'vd-actionbar-cell',
11
+ props: {
12
+ // 实际使用场景不多,为了设计验收
13
+ iconName: String,
14
+ direction: {
15
+ type: String,
16
+ default: 'center'
17
+ }
18
+ },
19
+ data() {
20
+ return {
21
+
22
+ };
23
+ },
24
+ computed: {
25
+ wrapClasses() {
26
+ return [
27
+ {
28
+ [`${prefixCls}-cell--${this.direction}`]: this.direction
29
+ }
30
+ ]
31
+ }
32
+ },
33
+ };
34
+ </script>
@@ -0,0 +1,8 @@
1
+ import Actionbar from './index.vue';
2
+ import './style.less';
3
+
4
+ Actionbar.install = function (Vue) {
5
+ Vue.component(Actionbar.name, Actionbar);
6
+ };
7
+
8
+ export default Actionbar;
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <div class="vd-actionbar" :class="wrapClasses">
3
+ <div class="vd-actionbar__main">
4
+ <slot></slot>
5
+ </div>
6
+ </div>
7
+ </template>
8
+ <script>
9
+ const prefixCls = 'vd-actionbar';
10
+ export default {
11
+ name: 'vd-actionbar',
12
+ props: {
13
+ // 默认左右有间距,但是实际设计稿有的没有间距,
14
+ //block属性预留一个填充,如果使用基础图标按钮组件填充,不太好填充。
15
+ block: {
16
+ type: Boolean,
17
+ default: false
18
+ }
19
+ },
20
+ data() {
21
+ return {
22
+
23
+ }
24
+ },
25
+ computed: {
26
+ wrapClasses() {
27
+ return [
28
+ {
29
+ [`${prefixCls}__block`]: this.block
30
+ }
31
+ ]
32
+ }
33
+ }
34
+ };
35
+ </script>
36
+
37
+ <style lang="less">
38
+ @import './style.less';
39
+ </style>
@@ -0,0 +1,48 @@
1
+
2
+ @actionbar-prefix-cls:vd-actionbar;
3
+
4
+ .@{actionbar-prefix-cls}{
5
+
6
+ display: flex;
7
+ width: 100%;
8
+ height: calc(var(--height-actionbar-content) * 1px);
9
+ background-color: var(--color-actionbar-bg);
10
+ padding-inline-start: calc(var(--spacing-actionbar-padding_y) * 1px);
11
+ padding-inline-end: calc(var(--spacing-actionbar-padding_y) * 1px);
12
+
13
+ &__block{
14
+ padding-inline-start: 0;
15
+ padding-inline-end: 0;
16
+ }
17
+
18
+ &__main{
19
+ display: flex;
20
+ flex: 1;
21
+ justify-content: space-around;
22
+ }
23
+ }
24
+
25
+
26
+
27
+
28
+ .@{actionbar-prefix-cls}-cell {
29
+ display: flex;
30
+ flex: 1;
31
+ align-items: center;
32
+ cursor: pointer;
33
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
34
+ font-size: calc(var(--en-single-f-d-r-fontSize) * 1px);
35
+ font-weight: var(--en-single-f-d-r-fontWeight);
36
+
37
+ &--left {
38
+ justify-content: left;
39
+ }
40
+
41
+ &--center {
42
+ justify-content: center;
43
+ }
44
+
45
+ &--right {
46
+ justify-content: right;
47
+ }
48
+ }
@@ -0,0 +1,7 @@
1
+ import Actions from './index.vue';
2
+ import './style.less';
3
+ Actions.install = function(Vue) {
4
+ Vue.component(Actions.name, Actions)
5
+ }
6
+
7
+ export default Actions;
@@ -0,0 +1,76 @@
1
+ <template>
2
+ <div :class="wrapClasses">
3
+ <span class="vd-actions__text" :class="textClasses" v-if="text">{{ text }}</span>
4
+ <vd-icon v-if="icon && type === 'list'" class="vd-actions__icon" :class="iconClasses" :name="icon" :svg="iconSvg"></vd-icon>
5
+ <span class="vd-actions__content" :class="contentBg" v-if="icon && type === 'card'">
6
+ <vd-icon class="vd-actions__icon" :class="iconClasses" :name="icon" :svg="iconSvg"></vd-icon>
7
+ </span>
8
+ </div>
9
+ </template>
10
+
11
+ <script>
12
+ const prefixCls = 'vd-actions'
13
+ export default {
14
+ name: 'vd-actions',
15
+ props: {
16
+ type: {
17
+ type: String,
18
+ },
19
+ colors: {
20
+ type: String,
21
+ },
22
+ backgrounds: {
23
+ type: String,
24
+ },
25
+ text: {
26
+ type: String,
27
+ },
28
+ icon: {
29
+ type: String,
30
+ },
31
+ iconSvg: {
32
+ type: Boolean,
33
+ default: false,
34
+ },
35
+ disabled:Boolean,
36
+ },
37
+ computed: {
38
+ wrapClasses() {
39
+ return [
40
+ `${prefixCls}`,
41
+ {
42
+ [`${prefixCls}__${this.type}`]: this.type,
43
+ [`${prefixCls}__${this.colors}`]: this.colors,
44
+ [`${prefixCls}__${this.colors}--disabled`]: this.disabled && (this.type ==='list'),
45
+ }
46
+ ]
47
+ },
48
+ contentBg() {
49
+ return [
50
+ {
51
+ [`${prefixCls}__content--${this.backgrounds}`]: this.backgrounds,
52
+ [`${prefixCls}__content--${this.backgrounds}--disabled`]: this.disabled,
53
+ }
54
+ ]
55
+ },
56
+ textClasses(){
57
+ return [
58
+ {
59
+ [`${prefixCls}__text--disabled`]: this.disabled
60
+ }
61
+ ]
62
+ },
63
+ iconClasses(){
64
+ return [
65
+ {
66
+ [`${prefixCls}__icon--disabled`]: this.disabled
67
+ }
68
+ ]
69
+ },
70
+ }
71
+ }
72
+ </script>
73
+
74
+ <style lang="less">
75
+ @import './style.less';
76
+ </style>
@@ -0,0 +1,112 @@
1
+ @actions-prefix-cls:vd-actions;
2
+
3
+ .@{actions-prefix-cls}{
4
+ height: 100%;
5
+ display: inline-flex;
6
+ align-items: center;
7
+ justify-content: center;
8
+
9
+ &__list{
10
+ width: fit-content;
11
+ min-width: calc(var(--width-actions-form_small) * 1px);
12
+ max-width: calc(var(--width-actions-form_large) * 1px);
13
+ padding: 0 calc(var(--spacing-actions-form-padding_y) * 1px);
14
+ }
15
+
16
+ &__card{
17
+ padding: 0 calc(var(--spacing-actions-card_item-margin_y) * 1px);
18
+
19
+ .@{actions-prefix-cls}__content{
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ border-radius: 50%;
24
+ width: calc(var(--width-actions-card) * 1px);
25
+ height: calc(var(--width-actions-card) * 1px);
26
+
27
+ &--green{
28
+ background-color: var(--color-actions-bg-green);
29
+ &--disabled{
30
+ background-color: var(--color-actions-bg-green-disable);
31
+ }
32
+ }
33
+
34
+ &--warning{
35
+ background-color: var(--color-actions-bg-warning);
36
+ &--disabled{
37
+ background-color: var(--color-actions-bg-warning-disable);
38
+ }
39
+ }
40
+
41
+ &--blue{
42
+ background-color: var(--color-actions-bg-blue);
43
+ &--disabled{
44
+ background-color: var(--color-actions-bg-blue-disable);
45
+ }
46
+ }
47
+
48
+ &--gray{
49
+ background-color: var(--color-actions-bg-gray);
50
+ &--disabled{
51
+ background-color: var(--color-actions-bg-gray-disable);
52
+ }
53
+ }
54
+
55
+
56
+ }
57
+
58
+ .@{actions-prefix-cls}__icon{
59
+ color: var(--color-actions-text);
60
+ font-size: calc(var(--icon-actions-card) * 1px);
61
+ &--disabled{
62
+ color: var(--color-actions-text-disable);
63
+ }
64
+ }
65
+ }
66
+
67
+ &__text{
68
+ color: var(--color-actions-text);
69
+ font-size: calc(var(--en-single-f-d-s-fontSize) * 1px);
70
+ font-weight: var(--en-single-f-d-s-fontWeight);
71
+ &--disabled{
72
+ color: var(--color-actions-text-disable);
73
+ }
74
+ }
75
+
76
+ &__icon{
77
+ font-size: calc(var(--icon-actions-size) * 1px);
78
+ color: var(--color-actions-text);
79
+ &--disabled{
80
+ color: var(--color-actions-text-disable);
81
+ }
82
+ }
83
+
84
+ &__green{
85
+ background-color: var(--color-actions-bg-green);
86
+ &--disabled{
87
+ background-color: var(--color-actions-bg-green-disable);
88
+ }
89
+ }
90
+
91
+ &__warning{
92
+ background-color: var(--color-actions-bg-warning);
93
+ &--disabled{
94
+ background-color: var(--color-actions-bg-warning-disable);
95
+ }
96
+ }
97
+
98
+ &__blue{
99
+ background-color: var(--color-actions-bg-blue);
100
+ &--disabled{
101
+ background-color: var(--color-actions-bg-blue-disable);
102
+ }
103
+ }
104
+
105
+ &__gray{
106
+ background-color: var(--color-actions-bg-gray);
107
+ &--disabled{
108
+ background-color: var(--color-actions-bg-gray-disable);
109
+ }
110
+ }
111
+
112
+ }
@@ -0,0 +1,7 @@
1
+ import ActionsCell from './index.vue';
2
+ import './style.less';
3
+ ActionsCell.install = function(Vue) {
4
+ Vue.component(ActionsCell.name, ActionsCell)
5
+ }
6
+
7
+ export default ActionsCell;
@@ -0,0 +1,94 @@
1
+ <template>
2
+ <div class="vd-actions-cell">
3
+ <div class="vd-actions-cell__wrapper" :style="{ transform: `translateX(${offset}px)` }"
4
+ @touchstart="handleTouchStart" @touchmove="handleTouchMove" @touchend="handleTouchEnd" @click="handleClick">
5
+ <div class="vd-actions-cell__left" ref="leftButton">
6
+ <slot name="left"></slot>
7
+ </div>
8
+ <slot name="content"></slot>
9
+ <div class="vd-actions-cell__right" ref="rightButton">
10
+ <slot name="right"></slot>
11
+ </div>
12
+ </div>
13
+ </div>
14
+ </template>
15
+
16
+ <script>
17
+ export default {
18
+ name: 'vd-actions-cell',
19
+ props: {
20
+ },
21
+ data() {
22
+ return {
23
+ offset: 0, // 初始偏移量
24
+ startX: 0, // 按下时的X坐标
25
+ lastX: 0, // 上一次移动的X坐标
26
+ isDragging: false // 是否正在拖动
27
+ }
28
+ },
29
+ computed: {
30
+
31
+ },
32
+ methods: {
33
+ handleTouchStart(event) {
34
+ this.startX = event.touches[0].pageX;
35
+ this.lastX = this.startX;
36
+ this.isDragging = true;
37
+ },
38
+ handleTouchMove(event) {
39
+ if (!this.isDragging) return;
40
+
41
+ const currentX = event.touches[0].pageX;
42
+ const deltaX = currentX - this.lastX;
43
+
44
+ // // 判断滑动的方向
45
+ // if (deltaX > 0) {
46
+ // // 向右侧滑动
47
+ // // 这里可以执行相应的逻辑
48
+ // this.offset = 0;
49
+ // }
50
+
51
+ // this.lastX = currentX;
52
+ // 计算内容区域的新偏移量
53
+ this.offset += deltaX;
54
+
55
+
56
+ // // 限制内容区域的滑动范围在按钮的宽度以内
57
+ // const buttonWidth = this.$refs.rightButton.offsetWidth;
58
+ // const maxOffset = buttonWidth >= 0 ? buttonWidth : 0;
59
+ // this.offset = Math.max(-maxOffset, Math.min(0, this.offset));
60
+
61
+
62
+ const rightButtonWidth = this.$refs.rightButton.offsetWidth;
63
+ const leftButtonWidth = this.$refs.leftButton.offsetWidth;
64
+ this.offset = Math.max(-rightButtonWidth, Math.min(leftButtonWidth, this.offset));
65
+ this.startX = currentX;
66
+ },
67
+ handleTouchEnd() {
68
+ this.isDragging = false;
69
+ const rightButtonWidth = this.$refs.rightButton.offsetWidth;
70
+ const leftButtonWidth = this.$refs.leftButton.offsetWidth;
71
+ const thresholdRight = rightButtonWidth / 3;
72
+ const thresholdLeft = leftButtonWidth / 3;
73
+
74
+ if (this.offset < -thresholdRight) {
75
+ // 向左侧滑动超过三分之一,显示右侧按钮
76
+ this.offset = -rightButtonWidth;
77
+ } else if (this.offset > thresholdLeft) {
78
+ // 向右侧滑动超过三分之一,显示左侧按钮
79
+ this.offset = leftButtonWidth;
80
+ } else {
81
+ // 按钮偏移不超过三分之一,按钮回到原位
82
+ this.offset = 0;
83
+ }
84
+ },
85
+ handleClick() {
86
+ this.offset = 0;
87
+ }
88
+ }
89
+ }
90
+ </script>
91
+
92
+ <style lang="less">
93
+ @import './style.less';
94
+ </style>
@@ -0,0 +1,39 @@
1
+ @actions-cell-prefix-cls:vd-actions-cell;
2
+
3
+ .@{actions-cell-prefix-cls}{
4
+ height: 100%;
5
+ overflow: hidden;
6
+ position: relative;
7
+ cursor: grab;
8
+
9
+ &__left{
10
+ position: absolute;
11
+ top: 0;
12
+ left: 0;
13
+ height: 100%;
14
+ transform: translate3d(-100%, 0, 0);
15
+ display: flex;
16
+ }
17
+
18
+ &__right{
19
+ position: absolute;
20
+ top: 0;
21
+ right: 0;
22
+ height: 100%;
23
+ transform: translate3d(100%, 0, 0);
24
+ display: flex;
25
+
26
+ }
27
+
28
+
29
+ &__wrapper{
30
+ height: 100%;
31
+ -webkit-transition-timing-function: cubic-bezier(0.18, 0.89, 0.32, 1);
32
+ transition-timing-function: cubic-bezier(0.18, 0.89, 0.32, 1);
33
+ -webkit-transition-property: -webkit-transform;
34
+ transition-property: -webkit-transform;
35
+ transition-property: transform;
36
+ transition-property: transform, -webkit-transform;
37
+ transition-duration: 0.6s;
38
+ }
39
+ }
@@ -0,0 +1,8 @@
1
+ import Activityviews from './index.vue';
2
+ import './style.less';
3
+
4
+ Activityviews.install = function (Vue) {
5
+ Vue.component(Activityviews.name, Activityviews);
6
+ };
7
+
8
+ export default Activityviews;
@@ -0,0 +1,140 @@
1
+ <template>
2
+ <div>
3
+ <transition name="vd-activityviews-fade">
4
+ <div class="vd-overlay" v-if="overlay && visible" @click="handleOverlayClick"></div>
5
+ </transition>
6
+ <transition name="vd-activityviews-slide-up">
7
+ <div class="vd-activityviews" v-if="visible">
8
+ <div class="vd-activityviews__header" v-if="withHeader">
9
+ <div class="vd-activityviews__wrapper">
10
+ <vd-icon v-if="backDefault" name="icon_nav_back"></vd-icon>
11
+ <div v-if="title" class="vd-activityviews__title">{{ title }}</div>
12
+ <slot name="close">
13
+ <vd-icon v-if="closeIcon" class="vd-activityviews__close" :name="currentCloseIcon" svg
14
+ @click="onCancel"></vd-icon>
15
+ <vd-button v-if="closeBtn" class="vd-activityviews__done" type="primary_text" size="large"
16
+ @click="onCancel">{{ closeBtn }}</vd-button>
17
+ </slot>
18
+ </div>
19
+ <p v-if="description" class="vd-activityviews__description">{{ description }}</p>
20
+ </div>
21
+ <div v-if="withBar" class="vd-activityviews__bar"></div>
22
+ <div :class="['vd-activityviews__body', { 'vd-activityviews__body--action': actionSheet }]">
23
+ <div v-if="actionSheet" class="vd-activityviews__action">
24
+ <p v-if="title" class="vd-activityviews__action-title vd-hairline--bottom">{{ title }}</p>
25
+ <div class="vd-activityviews__actions">
26
+ <vd-button v-for="(item, index) in actions" block size="large" :type="item.type" :key="index" :class="{ 'vd-hairline--bottom': index !== actions.length - 1 }"
27
+ :disabled="item.disabled" @click.stop="onSelect(item)" >{{ item.name }}</vd-button>
28
+ </div>
29
+ <div v-if="cancelText" class="vd-activityviews__gap"></div>
30
+ <div v-if="cancelText" class="vd-activityviews__cancel" @click="onCancel">
31
+ <vd-button block type="tertiary" size="large">{{ cancelText }}</vd-button>
32
+ </div>
33
+ </div>
34
+ <slot v-else></slot>
35
+ </div>
36
+ </div>
37
+ </transition>
38
+ </div>
39
+ </template>
40
+
41
+ <script>
42
+ import { themeMixin } from '@p/components/mixins/themeMixin';
43
+
44
+ export default {
45
+ name: 'vd-activityviews',
46
+ mixins: [themeMixin], // 引入混入
47
+ props: {
48
+ value: Boolean,
49
+ title: String,
50
+ backDefault:Boolean,
51
+ closeIcon: Boolean,
52
+ closeBtn: String,
53
+ description: String,
54
+ withHeader: {
55
+ type: Boolean,
56
+ default: true
57
+ },
58
+ withBar: Boolean,
59
+ actionSheet: Boolean,
60
+ actions: {
61
+ type: Array,
62
+ default() {
63
+ return [];
64
+ }
65
+ },
66
+ cancelText: String,
67
+ overlay: {
68
+ type: Boolean,
69
+ default: true
70
+ },
71
+ disabled: Boolean,
72
+ closeOnOverlay:{
73
+ type: Boolean,
74
+ default: true
75
+ },
76
+ },
77
+ data() {
78
+ return {
79
+ }
80
+ },
81
+ computed: {
82
+ visible(){
83
+ return this.value
84
+ },
85
+ currentCloseIcon() {
86
+ return this.isDarkTheme ? 'icon_btn_dialogclose_dark' : 'icon_btn_dialogclose';
87
+ },
88
+ isDarkTheme() {
89
+ return this.theme === 'dark';
90
+ }
91
+ },
92
+ watch: {
93
+ },
94
+ methods: {
95
+ closeActivity() {
96
+ this.$emit('input', false);
97
+ },
98
+ onCancel() {
99
+ this.closeActivity();
100
+ this.$emit('cancel');
101
+ },
102
+ onSelect(item) {
103
+ if (!item.disabled) {
104
+ this.$emit('select', item);
105
+ }
106
+ },
107
+ handleOverlayClick() {
108
+ if (this.closeOnOverlay) {
109
+ this.closeActivity();
110
+ }
111
+ }
112
+ },
113
+ mounted() {
114
+ }
115
+
116
+ }
117
+ </script>
118
+
119
+ <style lang="less">
120
+ @import './style.less';
121
+
122
+ .vd-activityviews-fade-enter-active,
123
+ .vd-activityviews-fade-leave-active {
124
+ transition: opacity 0.3s;
125
+ }
126
+ .vd-activityviews-fade-enter,
127
+ .vd-activityviews-fade-leave-to {
128
+ opacity: 0;
129
+ }
130
+
131
+ .vd-activityviews-slide-up-enter-active,
132
+ .vd-activityviews-slide-up-leave-active {
133
+ transition: transform 0.3s;
134
+ }
135
+ .vd-activityviews-slide-up-enter,
136
+ .vd-activityviews-slide-up-leave-to {
137
+ transform: translateY(100%);
138
+ }
139
+
140
+ </style>