vdesign-ui 0.1.18 → 0.1.20

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 (33) hide show
  1. package/dist/components/activityviews/index.vue +17 -16
  2. package/dist/components/activityviews/style.less +2 -14
  3. package/dist/components/dialog/index.vue +105 -54
  4. package/dist/components/dialog/overlay-manager.js +18 -0
  5. package/dist/components/dialog/style.less +1 -1
  6. package/dist/components/empty/404-dark.png +0 -0
  7. package/dist/components/empty/index.vue +36 -6
  8. package/dist/components/empty/network-dark.png +0 -0
  9. package/dist/components/empty/nodata-dark.png +0 -0
  10. package/dist/components/empty/style.less +7 -0
  11. package/dist/components/footnav/index.vue +20 -5
  12. package/dist/components/footnav/style.less +2 -1
  13. package/dist/components/headnav/index.vue +78 -54
  14. package/dist/components/headnav/style.less +13 -0
  15. package/dist/components/icon/font/iconfont.css +1050 -1041
  16. package/dist/components/icon/font/iconfont.js +1 -1
  17. package/dist/components/input/index.vue +1 -1
  18. package/dist/components/input/password/index.vue +1 -1
  19. package/dist/components/input/style.less +3 -3
  20. package/dist/components/result/index.vue +9 -0
  21. package/dist/components/tabs/style.less +2 -0
  22. package/dist/img/404-dark.775df5bb.png +0 -0
  23. package/dist/img/network-dark.11a147bb.png +0 -0
  24. package/dist/img/nodata-dark.b0ea0e39.png +0 -0
  25. package/dist/token.css +4 -3
  26. package/dist/vdesign-ui.common.js +426 -247
  27. package/dist/vdesign-ui.css +1 -1
  28. package/dist/vdesign-ui.umd.js +426 -247
  29. package/dist/vdesign-ui.umd.min.js +3 -3
  30. package/package.json +1 -1
  31. /package/dist/components/empty/{empty-404.png → 404.png} +0 -0
  32. /package/dist/components/empty/{empty-network.png → network.png} +0 -0
  33. /package/dist/components/empty/{empty-img.png → nodata.png} +0 -0
@@ -1,9 +1,9 @@
1
1
  <template>
2
2
  <div>
3
- <transition name="vd-fade">
4
- <div class="vd-overlay" v-if="overlay && visible" @click="handleMaskClick"></div>
3
+ <transition name="vd-activityviews-fade">
4
+ <div class="vd-overlay" v-if="overlay && visible" @click="handleOverlayClick"></div>
5
5
  </transition>
6
- <transition name="vd-slide-up">
6
+ <transition name="vd-activityviews-slide-up">
7
7
  <div class="vd-activityviews" v-if="visible">
8
8
  <div class="vd-activityviews__header" v-if="withHeader">
9
9
  <div class="vd-activityviews__wrapper">
@@ -21,17 +21,17 @@
21
21
  <div v-if="withBar" class="vd-activityviews__bar"></div>
22
22
  <div :class="['vd-activityviews__body', { 'vd-activityviews__body--action': actionSheet }]">
23
23
  <div v-if="actionSheet" class="vd-activityviews__action">
24
- <p v-if="title" class="vd-activityviews__action-title">{{ title }}</p>
24
+ <p v-if="title" class="vd-activityviews__action-title vd-hairline--bottom">{{ title }}</p>
25
25
  <div class="vd-activityviews__actions">
26
- <vd-button v-for="(item, index) in actions" block size="large" :type="item.type" :key="index"
27
- :disabled="item.disabled" @click.stop="onSelect(item)">{{ item.name }}</vd-button>
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
28
  </div>
29
29
  <div v-if="cancelText" class="vd-activityviews__gap"></div>
30
30
  <div v-if="cancelText" class="vd-activityviews__cancel" @click="onCancel">
31
31
  <vd-button block type="tertiary" size="large">{{ cancelText }}</vd-button>
32
32
  </div>
33
33
  </div>
34
- <slot></slot>
34
+ <slot v-else></slot>
35
35
  </div>
36
36
  </div>
37
37
  </transition>
@@ -104,7 +104,7 @@ export default {
104
104
  this.$emit('select', item);
105
105
  }
106
106
  },
107
- handleMaskClick() {
107
+ handleOverlayClick() {
108
108
  if (this.closeOnOverlay) {
109
109
  this.closeActivity();
110
110
  }
@@ -119,21 +119,22 @@ export default {
119
119
  <style lang="less">
120
120
  @import './style.less';
121
121
 
122
- .vd-fade-enter-active,
123
- .vd-fade-leave-active {
122
+ .vd-activityviews-fade-enter-active,
123
+ .vd-activityviews-fade-leave-active {
124
124
  transition: opacity 0.3s;
125
125
  }
126
- .vd-fade-enter,
127
- .vd-fade-leave-to {
126
+ .vd-activityviews-fade-enter,
127
+ .vd-activityviews-fade-leave-to {
128
128
  opacity: 0;
129
129
  }
130
130
 
131
- .vd-slide-up-enter-active,
132
- .vd-slide-up-leave-active {
131
+ .vd-activityviews-slide-up-enter-active,
132
+ .vd-activityviews-slide-up-leave-active {
133
133
  transition: transform 0.3s;
134
134
  }
135
- .vd-slide-up-enter,
136
- .vd-slide-up-leave-to {
135
+ .vd-activityviews-slide-up-enter,
136
+ .vd-activityviews-slide-up-leave-to {
137
137
  transform: translateY(100%);
138
138
  }
139
+
139
140
  </style>
@@ -112,6 +112,8 @@
112
112
  .vd-btn{
113
113
  border-radius: 0;
114
114
  background-color: var(--color-activityviews-bg);
115
+ height: calc(var(--height-activityviews-actionsheet) * 1px);
116
+
115
117
  }
116
118
  }
117
119
 
@@ -131,20 +133,6 @@
131
133
  background-color: var(--color-activityviews-bg);
132
134
  height: calc(var(--height-activityviews-actionsheet) * 1px);
133
135
  border-radius: 0;
134
-
135
- &::before{
136
- position: absolute;
137
- box-sizing: border-box;
138
- content: ' ';
139
- pointer-events: none;
140
- top: -50%;
141
- right: -50%;
142
- bottom: -50%;
143
- left: -50%;
144
- border: 0 solid var(--divider-color-default-1);
145
- transform: scale(0.5);
146
- border-top-width: 1px;
147
- }
148
136
  }
149
137
  }
150
138
  }
@@ -1,57 +1,63 @@
1
1
  <template>
2
- <div class="vd-dialog-wrap" v-if="visible">
3
- <div class="vd-overlay" v-if="visible && overlay" @click="close()"></div>
4
- <div class="vd-dialog" :class="className ? `vd-dialog--${className}` : ''">
5
- <header class="vd-dialog__header" :class="{ 'vd-dialog__header--img': $slots.imgs }">
6
- <div class="vd-dialog__header--img-content" v-if="$slots.imgs">
7
- <slot name="imgs"></slot>
8
- </div>
9
- <div class="vd-dialog__title">{{ title }}</div>
10
- </header>
11
- <div class="vd-dialog__content">
12
- <div class="vd-dialog__message" :class="{ 'vd-dialog__message--head': !title }"
13
- v-if="message || $slots.content">
14
- <slot name="content">{{
15
- message
16
- }}</slot>
2
+ <div class="vd-dialog-wrap">
3
+ <div class="vd-overlay" v-if="visible && isOverlayVisible && overlay" :style="{ zIndex: overlayZIndex }"
4
+ @click="handleOverlayClick()"></div>
5
+ <transition name="vd-dialog-fade">
6
+ <div class="vd-dialog" v-if="visible" :class="className ? `vd-dialog--${className}` : ''" :style="{width : width, zIndex: overlayZIndex + 1}">
7
+ <header class="vd-dialog__header" :class="{ 'vd-dialog__header--img': $slots.imgs }">
8
+ <div class="vd-dialog__header--img-content" v-if="$slots.imgs">
9
+ <slot name="imgs"></slot>
10
+ </div>
11
+ <div class="vd-dialog__title">{{ title }}</div>
12
+ </header>
13
+ <div class="vd-dialog__content">
14
+ <div class="vd-dialog__message" :class="{ 'vd-dialog__message--head': !title }"
15
+ v-if="message || $slots.content">
16
+ <slot name="content">{{
17
+ message
18
+ }}</slot>
19
+ </div>
17
20
  </div>
21
+ <footer class="vd-dialog__footer">
22
+ <div class="vd-dialog__btns" v-if="btns">
23
+ <vd-button type="tertiary_grey" size="large" @click="cancel">{{ cancelButtonText ||
24
+ $t("alert.cancel") }}</vd-button>
25
+ <vd-button type="large" @click="confirm">{{ confirmButtonText || $t("alert.confirm") }} </vd-button>
26
+ </div>
27
+ <div class="vd-dialog__btn" v-if="btn">
28
+ <vd-button type="large" @click="confirm" block>{{ confirmButtonText || $t("alert.confirm")
29
+ }}</vd-button>
30
+ </div>
31
+ <div class="vd-dialog__btns--text" v-if="btnsText">
32
+ <vd-button type="tertiary_text" size="large" @click="cancel">{{ cancelButtonText ||
33
+ $t("alert.cancel")
34
+ }}</vd-button>
35
+ <vd-button type="primary_text" size="large" @click="confirm">{{ confirmButtonText ||
36
+ $t("alert.confirm") }}</vd-button>
37
+ </div>
38
+ <div class="vd-dialog__btn--text-block" v-if="btnTextBlock">
39
+ <vd-button type="primary_text" size="large" block @click="confirm">{{ confirmButtonText ||
40
+ $t("alert.confirm") }}</vd-button>
41
+ </div>
42
+ <div class="vd-dialog__btns-block" v-if="btnsBlock">
43
+ <vd-button type="primary" block size="large" @click="confirm">{{ confirmButtonText ||
44
+ $t("alert.confirm") }}</vd-button>
45
+ <vd-button type="primary_text" block size="large" @click="cancel">{{ cancelButtonText ||
46
+ $t("alert.cancel") }}</vd-button>
47
+ </div>
48
+ <div class="vd-dialog__btns--text" v-if="$slots['extra-btn']">
49
+ <slot name="extra-btn"></slot>
50
+ </div>
51
+ </footer>
18
52
  </div>
19
- <footer class="vd-dialog__footer">
20
- <div class="vd-dialog__btns" v-if="btns">
21
- <vd-button type="tertiary_grey" size="large" @click="cancel">{{ cancelButtonText ||
22
- $t("alert.cancel") }}</vd-button>
23
- <vd-button type="large" @click="confirm">{{ confirmButtonText || $t("alert.confirm") }} </vd-button>
24
- </div>
25
- <div class="vd-dialog__btn" v-if="btn">
26
- <vd-button type="large" @click="confirm" block>{{ confirmButtonText || $t("alert.confirm")
27
- }}</vd-button>
28
- </div>
29
- <div class="vd-dialog__btns--text" v-if="btnsText">
30
- <vd-button type="tertiary_text" size="large" @click="cancel">{{ cancelButtonText ||
31
- $t("alert.cancel")
32
- }}</vd-button>
33
- <vd-button type="primary_text" size="large" @click="confirm">{{ confirmButtonText ||
34
- $t("alert.confirm") }}</vd-button>
35
- </div>
36
- <div class="vd-dialog__btn--text-block" v-if="btnTextBlock">
37
- <vd-button type="primary_text" size="large" block @click="confirm">{{ confirmButtonText ||
38
- $t("alert.confirm") }}</vd-button>
39
- </div>
40
- <div class="vd-dialog__btns-block" v-if="btnsBlock">
41
- <vd-button type="primary" block size="large" @click="confirm">{{ confirmButtonText ||
42
- $t("alert.confirm") }}</vd-button>
43
- <vd-button type="primary_text" block size="large" @click="cancel">{{ cancelButtonText ||
44
- $t("alert.cancel") }}</vd-button>
45
- </div>
46
- <div class="vd-dialog__btns--text" v-if="$slots['extra-btn']">
47
- <slot name="extra-btn"></slot>
48
- </div>
49
- </footer>
50
- </div>
53
+ </transition>
51
54
  </div>
52
55
  </template>
53
56
 
54
57
  <script>
58
+
59
+ import { OverlayManager } from './overlay-manager.js';
60
+
55
61
  export default {
56
62
  name: 'vd-dialog',
57
63
  props: {
@@ -74,14 +80,22 @@ export default {
74
80
  type: Boolean,
75
81
  default: true
76
82
  },
83
+ width: [Number, String],
77
84
  },
78
85
  data() {
79
86
  return {
80
-
87
+ isOverlayVisible: false,
88
+ overlayZIndex: 2000
81
89
  }
82
90
  },
83
91
  watch: {
84
-
92
+ visible(val) {
93
+ if (val) {
94
+ this.showOverlayLayer();
95
+ } else {
96
+ this.hideOverlayLayer();
97
+ }
98
+ }
85
99
  },
86
100
  computed: {
87
101
  visible() {
@@ -89,23 +103,60 @@ export default {
89
103
  }
90
104
  },
91
105
  methods: {
92
- close(force = false) {
93
- if (force || this.closeOnOverlay) {
94
- this.$emit('input', false);
106
+ showOverlayLayer() {
107
+ if (this.overlay) {
108
+ OverlayManager.increment();
109
+ this.isOverlayVisible = OverlayManager.isOverlayVisible();
110
+ this.overlayZIndex = OverlayManager.getZIndex();
95
111
  }
96
112
  },
113
+ hideOverlayLayer() {
114
+ if (this.overlay) {
115
+ OverlayManager.decrement();
116
+ this.isOverlayVisible = OverlayManager.isOverlayVisible();
117
+ this.overlayZIndex = OverlayManager.getZIndex(); // 更新 z-index,以便其他遮罩正确显示
118
+ }
119
+ },
120
+ handleOverlayClick() {
121
+ if (this.closeOnOverlay) {
122
+ this.closeDialog();
123
+ }
124
+ },
125
+ closeDialog() {
126
+ this.$emit('input', false);
127
+ },
97
128
  cancel() {
98
- this.close(true); // 调用 close 方法关闭对话框
99
- // 触发取消事件,让父组件知道用户点击了取消
129
+ this.closeDialog();
100
130
  this.$emit('cancel');
101
131
  },
102
132
  confirm() {
133
+ this.closeDialog();
103
134
  this.$emit('confirm');
104
135
  },
136
+ },
137
+ mounted() {
138
+ if (this.visible) {
139
+ this.showOverlayLayer();
140
+ }
141
+ },
142
+ beforeDestroy() {
143
+ if (this.visible) {
144
+ this.hideOverlayLayer();
145
+ }
105
146
  }
106
147
  }
107
148
  </script>
108
149
 
109
150
  <style lang="less">
110
151
  @import './style.less';
152
+
153
+ .vd-dialog-fade-enter-active,
154
+ .vd-dialog-fade-leave-active {
155
+ transition: transform 0.3s, opacity 0.3s;
156
+ }
157
+ .vd-dialog-fade-enter,
158
+ .vd-dialog-fade-leave-to {
159
+ transform: translate(-50%, -50%) scale(.8);
160
+ opacity: 0;
161
+ }
111
162
  </style>
@@ -0,0 +1,18 @@
1
+
2
+ let overlayCount = 0;
3
+
4
+ export const OverlayManager = {
5
+ increment() {
6
+ overlayCount += 1;
7
+ },
8
+ decrement() {
9
+ overlayCount -= 1;
10
+ if (overlayCount < 0) overlayCount = 0;
11
+ },
12
+ isOverlayVisible() {
13
+ return overlayCount > 0;
14
+ },
15
+ getZIndex() {
16
+ return 2000 + overlayCount; // 每个遮罩层递增的 z-index
17
+ }
18
+ };
@@ -1,7 +1,7 @@
1
1
  @dialog-prefix-cls: vd-dialog;
2
2
 
3
3
  .@{dialog-prefix-cls} {
4
- position: absolute;
4
+ position: fixed;
5
5
  left: 50%;
6
6
  top: 50%;
7
7
  z-index: 2111;
@@ -9,31 +9,48 @@
9
9
  </template>
10
10
 
11
11
  <script>
12
+ import { themeMixin } from '@p/components/mixins/themeMixin';
13
+
12
14
  const prefixCls = 'vd-empty';
13
15
 
14
16
  export default {
15
17
  name: 'vd-empty',
18
+ mixins: [themeMixin], // 引入混入
16
19
  props: {
17
20
  imgs: String,
18
21
  description: String,
19
22
  size: String,
20
23
  type: {
21
24
  type: String,
22
- default: 'default' // 默认类型
25
+ default: 'nodata', // 默认类型
26
+ validator(value) {
27
+ // 只接受以下类型值
28
+ return ['nodata', 'network', 'not-found'].includes(value);
29
+ }
23
30
  },
24
31
  },
25
32
  data() {
26
33
  return {
27
34
  defaultImgs: {
28
- default: require('./empty-img.png'),
29
- network: require('./empty-network.png'),
30
- 'not-found': require('./empty-404.png'),
35
+ nodata: {
36
+ light: require('./nodata.png'),
37
+ dark: require('./nodata-dark.png')
38
+ },
39
+ network: {
40
+ light: require('./network.png'),
41
+ dark: require('./network-dark.png')
42
+ },
43
+ 'not-found': {
44
+ light: require('./404.png'),
45
+ dark: require('./404-dark.png')
46
+ }
31
47
  }
32
48
  }
33
49
  },
34
50
  computed: {
35
51
  currentImg() {
36
- return this.imgs || this.defaultImgs[this.type];
52
+ if (this.imgs) return this.imgs;
53
+ return this.defaultImgs[this.type][this.theme];
37
54
  },
38
55
  wrapClasses() {
39
56
  return [
@@ -56,7 +73,20 @@ export default {
56
73
  }
57
74
  ]
58
75
  }
59
- }
76
+ },
77
+ methods: {
78
+ preloadImages() {
79
+ Object.values(this.defaultImgs).forEach((modes) => {
80
+ Object.values(modes).forEach((src) => {
81
+ const img = new Image();
82
+ img.src = src;
83
+ });
84
+ });
85
+ }
86
+ },
87
+ mounted() {
88
+ this.preloadImages();
89
+ },
60
90
  }
61
91
  </script>
62
92
 
@@ -9,6 +9,13 @@
9
9
  flex-direction: column;
10
10
  justify-content: center;
11
11
 
12
+ &-img{
13
+ width: 164px;
14
+ height: 118px;
15
+ margin: 0 auto;
16
+ }
17
+
18
+
12
19
  &-txt{
13
20
  margin-block-start: calc(var(--spacing-empty-large-text-margin_top) * 1px);
14
21
  font-size: calc(var(--en-single-f-d-r-fontSize) * 1px);
@@ -1,8 +1,10 @@
1
1
  <template>
2
- <div class="vd-foot-nav"
3
- :class="{ 'vd-foot-nav--fixed': fixed, 'vd-hairline--top': border, 'vd-foot-nav--unfit': !this.fit }"
4
- :style="style">
5
- <slot></slot>
2
+ <div class="vd-foot-nav--placeholder" :style="{height:height + 'px'}">
3
+ <div class="vd-foot-nav" ref="footNav"
4
+ :class="{ 'vd-foot-nav--fixed': fixed, 'vd-hairline--top': border, 'vd-foot-nav--unfit': !this.fit }"
5
+ :style="style">
6
+ <slot></slot>
7
+ </div>
6
8
  </div>
7
9
  </template>
8
10
 
@@ -24,6 +26,7 @@ export default {
24
26
  type: Boolean,
25
27
  default: null,
26
28
  },
29
+ placeholder: Boolean,
27
30
  },
28
31
  computed: {
29
32
  fit() {
@@ -42,7 +45,8 @@ export default {
42
45
  data() {
43
46
  return {
44
47
  // active: 0,
45
- items: []
48
+ items: [],
49
+ height: null,
46
50
  }
47
51
  },
48
52
  watch: {
@@ -73,7 +77,18 @@ export default {
73
77
  // handleClick() {
74
78
  // this.$emit('click',this.active)
75
79
  // }
80
+ },
81
+ mounted() {
82
+ if (this.placeholder && this.fixed) {
83
+ const setHeight = () => {
84
+ this.height = this.$refs.footNav.getBoundingClientRect().height;
85
+ };
86
+
87
+ setHeight();
88
+ setTimeout(setHeight, 100);
89
+ }
76
90
  }
91
+
77
92
  }
78
93
  </script>
79
94
 
@@ -3,7 +3,6 @@
3
3
 
4
4
  .@{footnav-prefix-cls}{
5
5
  width: 100%;
6
- z-index: 1;
7
6
  display: flex;
8
7
  padding: 4px calc(var(--spacing-footnav-icon-margin_bottom) * 1px);
9
8
  height: calc(var(--height-footnav-content) * 1px);
@@ -15,6 +14,8 @@
15
14
  position: fixed;
16
15
  bottom: 0;
17
16
  left: 0;
17
+ width: 100%;
18
+ z-index: 1;
18
19
  }
19
20
  &--unfit {
20
21
  padding-bottom: 0;