vdesign-ui 0.2.4 → 0.2.6

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 (195) hide show
  1. package/package.json +1 -1
  2. package/dist/components/actionbar/index.js +0 -8
  3. package/dist/components/actionbar/index.vue +0 -39
  4. package/dist/components/actionbar/style.less +0 -44
  5. package/dist/components/actionbar-cell/index.js +0 -7
  6. package/dist/components/actionbar-cell/index.vue +0 -38
  7. package/dist/components/actions/index.js +0 -7
  8. package/dist/components/actions/index.vue +0 -76
  9. package/dist/components/actions/style.less +0 -109
  10. package/dist/components/actions-cell/index.js +0 -7
  11. package/dist/components/actions-cell/index.vue +0 -94
  12. package/dist/components/actions-cell/style.less +0 -39
  13. package/dist/components/activityviews/index.js +0 -8
  14. package/dist/components/activityviews/index.vue +0 -192
  15. package/dist/components/activityviews/style.less +0 -152
  16. package/dist/components/badge/index.js +0 -8
  17. package/dist/components/badge/index.vue +0 -49
  18. package/dist/components/badge/style.less +0 -54
  19. package/dist/components/button/index.js +0 -8
  20. package/dist/components/button/index.vue +0 -93
  21. package/dist/components/button/style.less +0 -558
  22. package/dist/components/calendar/end.png +0 -0
  23. package/dist/components/calendar/index-element.vue +0 -84
  24. package/dist/components/calendar/index.js +0 -8
  25. package/dist/components/calendar/index.vue +0 -52
  26. package/dist/components/calendar/start.png +0 -0
  27. package/dist/components/calendar/style.less +0 -138
  28. package/dist/components/checkbox/index.js +0 -8
  29. package/dist/components/checkbox/index.vue +0 -161
  30. package/dist/components/checkbox/style.less +0 -289
  31. package/dist/components/checkbox-group/index.js +0 -7
  32. package/dist/components/checkbox-group/index.vue +0 -69
  33. package/dist/components/common/state/index.vue +0 -33
  34. package/dist/components/common/state/style.less +0 -48
  35. package/dist/components/data-list/index.js +0 -10
  36. package/dist/components/data-list/index.vue +0 -19
  37. package/dist/components/data-list/style.less +0 -623
  38. package/dist/components/datetime-picker/index.js +0 -8
  39. package/dist/components/datetime-picker/index.vue +0 -37
  40. package/dist/components/datetime-picker/style.less +0 -24
  41. package/dist/components/dialog/index.js +0 -8
  42. package/dist/components/dialog/index.vue +0 -174
  43. package/dist/components/dialog/overlay-manager.js +0 -18
  44. package/dist/components/dialog/style.less +0 -128
  45. package/dist/components/divider/index.js +0 -8
  46. package/dist/components/divider/index.vue +0 -54
  47. package/dist/components/divider/style.less +0 -92
  48. package/dist/components/dropdown/index.js +0 -8
  49. package/dist/components/dropdown/index.vue +0 -218
  50. package/dist/components/dropdown/style.less +0 -432
  51. package/dist/components/empty/404-dark.png +0 -0
  52. package/dist/components/empty/404.png +0 -0
  53. package/dist/components/empty/index.js +0 -8
  54. package/dist/components/empty/index.vue +0 -138
  55. package/dist/components/empty/network-dark.png +0 -0
  56. package/dist/components/empty/network.png +0 -0
  57. package/dist/components/empty/nocoupons-dark.png +0 -0
  58. package/dist/components/empty/nocoupons.png +0 -0
  59. package/dist/components/empty/nodata-dark.png +0 -0
  60. package/dist/components/empty/nodata.png +0 -0
  61. package/dist/components/empty/nomargin-dark.png +0 -0
  62. package/dist/components/empty/nomargin.png +0 -0
  63. package/dist/components/empty/nonotice-dark.png +0 -0
  64. package/dist/components/empty/nonotice.png +0 -0
  65. package/dist/components/empty/noocomments-dark.png +0 -0
  66. package/dist/components/empty/noocomments.png +0 -0
  67. package/dist/components/empty/noorders-dark.png +0 -0
  68. package/dist/components/empty/noorders.png +0 -0
  69. package/dist/components/empty/noposition-dark.png +0 -0
  70. package/dist/components/empty/noposition.png +0 -0
  71. package/dist/components/empty/nosearch-dark.png +0 -0
  72. package/dist/components/empty/nosearch.png +0 -0
  73. package/dist/components/empty/style.less +0 -61
  74. package/dist/components/footer/index.js +0 -7
  75. package/dist/components/footer/index.vue +0 -33
  76. package/dist/components/footer/style.less +0 -21
  77. package/dist/components/footnav/index.js +0 -7
  78. package/dist/components/footnav/index.vue +0 -93
  79. package/dist/components/footnav/style.less +0 -23
  80. package/dist/components/footnav-item/index.js +0 -7
  81. package/dist/components/footnav-item/index.vue +0 -50
  82. package/dist/components/footnav-item/style.less +0 -39
  83. package/dist/components/form/index.js +0 -7
  84. package/dist/components/form/index.vue +0 -12
  85. package/dist/components/headnav/index.js +0 -7
  86. package/dist/components/headnav/index.vue +0 -185
  87. package/dist/components/headnav/style.less +0 -232
  88. package/dist/components/icon/font/iconfont.css +0 -159
  89. package/dist/components/icon/font/iconfont.js +0 -6
  90. package/dist/components/icon/index.js +0 -9
  91. package/dist/components/icon/index.vue +0 -54
  92. package/dist/components/icon/style.less +0 -44
  93. package/dist/components/input/calcTextareaHeight.js +0 -162
  94. package/dist/components/input/index.js +0 -8
  95. package/dist/components/input/index.vue +0 -345
  96. package/dist/components/input/style.less +0 -471
  97. package/dist/components/list/index.js +0 -8
  98. package/dist/components/list/index.vue +0 -152
  99. package/dist/components/list/style.less +0 -213
  100. package/dist/components/loading/index.js +0 -7
  101. package/dist/components/loading/index.vue +0 -68
  102. package/dist/components/loading/style.less +0 -54
  103. package/dist/components/mixins/clickoutside.js +0 -81
  104. package/dist/components/mixins/dom.js +0 -41
  105. package/dist/components/mixins/languageMixin.js +0 -41
  106. package/dist/components/mixins/outlineConfigPlugin.js +0 -45
  107. package/dist/components/mixins/router-link.js +0 -23
  108. package/dist/components/mixins/themeMixin.js +0 -43
  109. package/dist/components/noticebar/index.js +0 -8
  110. package/dist/components/noticebar/index.vue +0 -258
  111. package/dist/components/noticebar/style.less +0 -328
  112. package/dist/components/overlay/index.js +0 -8
  113. package/dist/components/overlay/index.vue +0 -184
  114. package/dist/components/overlay/style.less +0 -23
  115. package/dist/components/pagebreak/index.js +0 -7
  116. package/dist/components/pagebreak/index.vue +0 -67
  117. package/dist/components/pagebreak/style.less +0 -42
  118. package/dist/components/password/index.js +0 -8
  119. package/dist/components/password/index.vue +0 -60
  120. package/dist/components/popover/index.js +0 -8
  121. package/dist/components/popover/index.vue +0 -100
  122. package/dist/components/popover/style.less +0 -346
  123. package/dist/components/popover/vue-popover.vue +0 -314
  124. package/dist/components/popup/index.js +0 -7
  125. package/dist/components/popup/index.vue +0 -243
  126. package/dist/components/radio/index.js +0 -8
  127. package/dist/components/radio/index.vue +0 -184
  128. package/dist/components/radio/style.less +0 -294
  129. package/dist/components/radio-group/index.js +0 -6
  130. package/dist/components/radio-group/index.vue +0 -58
  131. package/dist/components/result/completed-dark.png +0 -0
  132. package/dist/components/result/completed.png +0 -0
  133. package/dist/components/result/error-dark.png +0 -0
  134. package/dist/components/result/error.png +0 -0
  135. package/dist/components/result/index.js +0 -8
  136. package/dist/components/result/index.vue +0 -73
  137. package/dist/components/result/style.less +0 -44
  138. package/dist/components/result/wait-dark.png +0 -0
  139. package/dist/components/result/wait.png +0 -0
  140. package/dist/components/search/index.js +0 -8
  141. package/dist/components/search/index.vue +0 -66
  142. package/dist/components/selector/index.js +0 -8
  143. package/dist/components/selector/index.vue +0 -161
  144. package/dist/components/selector/style.less +0 -484
  145. package/dist/components/skeleton/index.js +0 -7
  146. package/dist/components/skeleton/index.vue +0 -206
  147. package/dist/components/skeleton/style.less +0 -197
  148. package/dist/components/slider/draggable.js +0 -49
  149. package/dist/components/slider/index.js +0 -7
  150. package/dist/components/slider/index.vue +0 -167
  151. package/dist/components/slider/style.less +0 -100
  152. package/dist/components/slider/utils.js +0 -60
  153. package/dist/components/step/index.js +0 -7
  154. package/dist/components/step/index.vue +0 -48
  155. package/dist/components/step/style.less +0 -58
  156. package/dist/components/step-item/index.js +0 -7
  157. package/dist/components/step-item/index.vue +0 -126
  158. package/dist/components/step-item/style.less +0 -362
  159. package/dist/components/stepper/index.js +0 -8
  160. package/dist/components/stepper/index.vue +0 -146
  161. package/dist/components/style/index.vue +0 -42
  162. package/dist/components/switch/index.js +0 -8
  163. package/dist/components/switch/index.vue +0 -72
  164. package/dist/components/switch/style.less +0 -56
  165. package/dist/components/tab/index.js +0 -7
  166. package/dist/components/tab/index.vue +0 -53
  167. package/dist/components/tabs/index.js +0 -8
  168. package/dist/components/tabs/index.vue +0 -172
  169. package/dist/components/tabs/style.less +0 -377
  170. package/dist/components/tag/index.js +0 -7
  171. package/dist/components/tag/index.vue +0 -64
  172. package/dist/components/tag/style.less +0 -211
  173. package/dist/components/title/index.js +0 -8
  174. package/dist/components/title/index.vue +0 -99
  175. package/dist/components/title/style.less +0 -188
  176. package/dist/components/toast/index.js +0 -86
  177. package/dist/components/toast/index.vue +0 -44
  178. package/dist/components/toast/style.less +0 -55
  179. package/dist/components/transition/index.js +0 -8
  180. package/dist/components/transition/index.vue +0 -13
  181. package/dist/components/transition/style.less +0 -208
  182. package/dist/components/upload/index.js +0 -7
  183. package/dist/components/upload/index.vue +0 -106
  184. package/dist/components/upload/style.less +0 -147
  185. package/dist/components/utils/assist.js +0 -34
  186. package/dist/components/utils/env.js +0 -2
  187. package/dist/demo.html +0 -10
  188. package/dist/locale/ar.js +0 -98
  189. package/dist/locale/en.js +0 -98
  190. package/dist/locale/zh.js +0 -98
  191. package/dist/token.css +0 -2990
  192. package/dist/vdesign-ui.common.js +0 -27471
  193. package/dist/vdesign-ui.css +0 -1
  194. package/dist/vdesign-ui.umd.js +0 -27481
  195. package/dist/vdesign-ui.umd.min.js +0 -32
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vdesign-ui",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "private": false,
5
5
  "main": "dist/vdesign-ui.umd.js",
6
6
  "files": [
@@ -1,8 +0,0 @@
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;
@@ -1,39 +0,0 @@
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>
@@ -1,44 +0,0 @@
1
- @actionbar-prefix-cls: vd-actionbar;
2
-
3
- .@{actionbar-prefix-cls} {
4
-
5
- display: flex;
6
- width: 100%;
7
- height: var(--height-actionbar-content);
8
- background-color: var(--color-actionbar-bg);
9
- padding-inline-start: var(--spacing-actionbar-padding_y);
10
- padding-inline-end: var(--spacing-actionbar-padding_y);
11
-
12
- &__block {
13
- padding-inline-start: 0;
14
- padding-inline-end: 0;
15
- }
16
-
17
- &__main {
18
- display: flex;
19
- flex: 1;
20
- justify-content: space-around;
21
- }
22
- }
23
-
24
- .@{actionbar-prefix-cls}-cell {
25
- display: flex;
26
- flex: 1;
27
- align-items: center;
28
- cursor: pointer;
29
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
30
- font-size: var(--en-single-f-d-r-fontSize);
31
- font-weight: var(--en-single-f-d-r-fontWeight);
32
-
33
- &--left {
34
- justify-content: left;
35
- }
36
-
37
- &--center {
38
- justify-content: center;
39
- }
40
-
41
- &--right {
42
- justify-content: right;
43
- }
44
- }
@@ -1,7 +0,0 @@
1
- import ActionbarCell from './index.vue';
2
-
3
- ActionbarCell.install = function (Vue) {
4
- Vue.component(ActionbarCell.name, ActionbarCell);
5
- };
6
-
7
- export default ActionbarCell;
@@ -1,38 +0,0 @@
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
- import VdIcon from '../icon';
9
- const prefixCls = 'vd-actionbar'
10
- export default {
11
- name: 'vd-actionbar-cell',
12
- components: {
13
- VdIcon
14
- },
15
- props: {
16
- // 实际使用场景不多,为了设计验收
17
- iconName: String,
18
- direction: {
19
- type: String,
20
- default: 'center'
21
- }
22
- },
23
- data() {
24
- return {
25
-
26
- };
27
- },
28
- computed: {
29
- wrapClasses() {
30
- return [
31
- {
32
- [`${prefixCls}-cell--${this.direction}`]: this.direction
33
- }
34
- ]
35
- }
36
- },
37
- };
38
- </script>
@@ -1,7 +0,0 @@
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;
@@ -1,76 +0,0 @@
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"></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"></vd-icon>
7
- </span>
8
- </div>
9
- </template>
10
-
11
- <script>
12
- import VdIcon from '../icon';
13
- const prefixCls = 'vd-actions'
14
- export default {
15
- name: 'vd-actions',
16
- components: {
17
- VdIcon
18
- },
19
- props: {
20
- type: {
21
- type: String,
22
- },
23
- colors: {
24
- type: String,
25
- },
26
- backgrounds: {
27
- type: String,
28
- },
29
- text: {
30
- type: String,
31
- },
32
- icon: {
33
- type: String,
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>
@@ -1,109 +0,0 @@
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: var(--width-actions-form_small);
12
- max-width: var(--width-actions-form_large);
13
- padding: 0 var(--spacing-actions-form-padding_y);
14
- }
15
-
16
- &__card {
17
- padding: 0 var(--spacing-actions-card_item-margin_y);
18
-
19
- .@{actions-prefix-cls}__content {
20
- display: flex;
21
- align-items: center;
22
- justify-content: center;
23
- border-radius: 50%;
24
- width: var(--width-actions-card);
25
- height: var(--width-actions-card);
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
- .@{actions-prefix-cls}__icon {
57
- color: var(--color-actions-text);
58
- font-size: var(--icon-actions-card);
59
- &--disabled {
60
- color: var(--color-actions-text-disable);
61
- }
62
- }
63
- }
64
-
65
- &__text {
66
- color: var(--color-actions-text);
67
- font-size: var(--en-single-f-d-s-fontSize);
68
- font-weight: var(--en-single-f-d-s-fontWeight);
69
- &--disabled {
70
- color: var(--color-actions-text-disable);
71
- }
72
- }
73
-
74
- &__icon {
75
- font-size: var(--icon-actions-size);
76
- color: var(--color-actions-text);
77
- &--disabled {
78
- color: var(--color-actions-text-disable);
79
- }
80
- }
81
-
82
- &__green {
83
- background-color: var(--color-actions-bg-green);
84
- &--disabled {
85
- background-color: var(--color-actions-bg-green-disable);
86
- }
87
- }
88
-
89
- &__warning {
90
- background-color: var(--color-actions-bg-warning);
91
- &--disabled {
92
- background-color: var(--color-actions-bg-warning-disable);
93
- }
94
- }
95
-
96
- &__blue {
97
- background-color: var(--color-actions-bg-blue);
98
- &--disabled {
99
- background-color: var(--color-actions-bg-blue-disable);
100
- }
101
- }
102
-
103
- &__gray {
104
- background-color: var(--color-actions-bg-gray);
105
- &--disabled {
106
- background-color: var(--color-actions-bg-gray-disable);
107
- }
108
- }
109
- }
@@ -1,7 +0,0 @@
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;
@@ -1,94 +0,0 @@
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>
@@ -1,39 +0,0 @@
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
- }
@@ -1,8 +0,0 @@
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;
@@ -1,192 +0,0 @@
1
- <template>
2
- <div>
3
- <div class="vd-overlay" v-if="overlay && visible" @click="handleOverlayClick"></div>
4
- <transition name="vd-activityviews-slide-up">
5
- <div :class="['vd-activityviews',{'vd-activityviews--safe-area-inset-bottom':safeAreaInsetBottom}]" :style="transitionStyle" v-if="visible">
6
- <div class="vd-activityviews__header" v-if="withHeader">
7
- <div class="vd-activityviews__wrapper">
8
- <vd-icon v-if="backDefault" name="icon_nav_back"></vd-icon>
9
- <div v-if="title || $slots.title" class="vd-activityviews__title">
10
- <slot name="title">{{ title }}</slot>
11
- </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 || $slots.title" class="vd-activityviews__action-title vd-hairline--bottom">
25
- <slot name="title">{{ title }}</slot>
26
- </p>
27
- <div class="vd-activityviews__actions">
28
- <vd-button v-for="(item, index) in actions" block size="large" :type="item.type"
29
- :key="index" :class="{ 'vd-hairline--bottom': index !== actions.length - 1 }"
30
- :disabled="item.disabled" @click.stop="onSelect(item)">{{ item.name }}</vd-button>
31
- </div>
32
- <div v-if="cancelText" class="vd-activityviews__gap"></div>
33
- <div v-if="cancelText" class="vd-activityviews__cancel" @click="onCancel">
34
- <vd-button block type="tertiary" size="large">{{ cancelText }}</vd-button>
35
- </div>
36
- </div>
37
- <slot v-else></slot>
38
- </div>
39
- </div>
40
- </transition>
41
- </div>
42
- </template>
43
-
44
- <script>
45
- import { inBrowser } from '../utils/env';
46
- import { themeMixin } from '../mixins/themeMixin';
47
- import VdIcon from '../icon';
48
- import VdButton from '../button';
49
-
50
- export default {
51
- name: 'vd-activity-views',
52
- mixins: [themeMixin], // 引入混入
53
- components: {
54
- VdIcon,
55
- VdButton
56
- },
57
- props: {
58
- value: Boolean,
59
- title: String,
60
- backDefault: Boolean,
61
- closeIcon: Boolean,
62
- closeBtn: String,
63
- description: String,
64
- withHeader: {
65
- type: Boolean,
66
- default: true
67
- },
68
- withBar: Boolean,
69
- actionSheet: Boolean,
70
- actions: {
71
- type: Array,
72
- default() {
73
- return [];
74
- }
75
- },
76
- cancelText: String,
77
- overlay: {
78
- type: Boolean,
79
- default: true
80
- },
81
- disabled: Boolean,
82
- closeOnOverlay: {
83
- type: Boolean,
84
- default: true
85
- },
86
- safeAreaInsetBottom: {
87
- type: Boolean,
88
- default: true,
89
- },
90
- lockScroll: {
91
- type: Boolean,
92
- default: true
93
- },
94
- duration: {
95
- type: Number,
96
- },
97
- // 指定挂载的容器,可以是选择器字符串或返回元素的函数
98
- getContainer: {
99
- type: [String, Function],
100
- default: 'body',
101
- },
102
- },
103
- data() {
104
- return {
105
- }
106
- },
107
- computed: {
108
- visible() {
109
- return this.value
110
- },
111
- currentCloseIcon() {
112
- return this.isDarkTheme ? 'icon_btn_dialogclose_dark_svg' : 'icon_btn_dialogclose_svg';
113
- },
114
- isDarkTheme() {
115
- return this.theme === 'dark';
116
- },
117
- // 动态设置过渡持续时间的样式
118
- transitionStyle() {
119
- return {
120
- transitionDuration: `${this.duration}s`,
121
- };
122
- },
123
- },
124
- watch: {
125
- visible(val) {
126
- if (inBrowser) {
127
- if (this.lockScroll) {
128
- if (val) {
129
- document.body.style.overflow = 'hidden';
130
- } else {
131
- document.body.style.overflow = '';
132
- }
133
- }
134
- }
135
- }
136
- },
137
- methods: {
138
- closeActivity() {
139
- this.$emit('input', false);
140
- },
141
- onCancel() {
142
- this.closeActivity();
143
- this.$emit('cancel');
144
- },
145
- onSelect(item) {
146
- if (!item.disabled) {
147
- this.$emit('select', item);
148
- }
149
- },
150
- handleOverlayClick() {
151
- if (this.closeOnOverlay) {
152
- this.closeActivity();
153
- }
154
- },
155
- // 将弹出层添加到指定的容器中
156
- appendToContainer() {
157
- const container =
158
- typeof this.getContainer === 'function'
159
- ? this.getContainer()
160
- : document.querySelector(this.getContainer);
161
- if (container && container !== this.$el.parentNode) {
162
- container.appendChild(this.$el);
163
- }
164
- },
165
- },
166
- mounted() {
167
- if (inBrowser) {
168
- this.appendToContainer();
169
- if (this.lockScroll && this.visible) {
170
- document.body.style.overflow = 'hidden';
171
- }
172
- }
173
- },
174
- beforeDestroy() {
175
- if (inBrowser){
176
- if(this.lockScroll) {
177
- document.body.style.overflow = '';
178
- }
179
- // 从容器中移除弹出层元素
180
- if (this.$el.parentNode) {
181
- this.$el.parentNode.removeChild(this.$el);
182
- }
183
- }
184
- }
185
-
186
- }
187
- </script>
188
-
189
- <style lang="less">
190
- @import './style.less';
191
-
192
- </style>