vdesign-ui 0.2.11 → 0.2.13

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.
@@ -19,6 +19,7 @@ export default {
19
19
  props: {
20
20
  type: {
21
21
  type: String,
22
+ default:'list'
22
23
  },
23
24
  colors: {
24
25
  type: String,
@@ -1,41 +1,41 @@
1
- /* istanbul ignore next */
2
-
3
- import Vue from 'vue';
4
-
5
- const isServer = Vue.prototype.$isServer;
6
- /* istanbul ignore next */
7
- export const on = (function () {
8
- // 添加事件监听器
9
- if (!isServer && document.addEventListener) {
10
- return function (element, event, handler) {
11
- if (element && event && handler) {
12
- element.addEventListener(event, handler, false);
13
- }
14
- };
15
- } else {
16
- // IE8 及其以下版本没有 addEventListener 方法
17
- return function (element, event, handler) {
18
- if (element && event && handler) {
19
- element.attachEvent('on' + event, handler);
20
- }
21
- };
22
- }
23
- })();
24
-
25
- /* istanbul ignore next */
26
- export const off = (function () {
27
- // 移除事件监听器
28
- if (!isServer && document.removeEventListener) {
29
- return function (element, event, handler) {
30
- if (element && event) {
31
- element.removeEventListener(event, handler, false);
32
- }
33
- };
34
- } else {
35
- return function (element, event, handler) {
36
- if (element && event) {
37
- element.detachEvent('on' + event, handler);
38
- }
39
- };
40
- }
41
- })();
1
+ /* istanbul ignore next */
2
+
3
+ import Vue from 'vue';
4
+
5
+ const isServer = Vue.prototype.$isServer;
6
+ /* istanbul ignore next */
7
+ export const on = (function () {
8
+ // 添加事件监听器
9
+ if (!isServer && document.addEventListener) {
10
+ return function (element, event, handler) {
11
+ if (element && event && handler) {
12
+ element.addEventListener(event, handler, false);
13
+ }
14
+ };
15
+ } else {
16
+ // IE8 及其以下版本没有 addEventListener 方法
17
+ return function (element, event, handler) {
18
+ if (element && event && handler) {
19
+ element.attachEvent('on' + event, handler);
20
+ }
21
+ };
22
+ }
23
+ })();
24
+
25
+ /* istanbul ignore next */
26
+ export const off = (function () {
27
+ // 移除事件监听器
28
+ if (!isServer && document.removeEventListener) {
29
+ return function (element, event, handler) {
30
+ if (element && event) {
31
+ element.removeEventListener(event, handler, false);
32
+ }
33
+ };
34
+ } else {
35
+ return function (element, event, handler) {
36
+ if (element && event) {
37
+ element.detachEvent('on' + event, handler);
38
+ }
39
+ };
40
+ }
41
+ })();
@@ -1,23 +1,23 @@
1
- /**
2
- * add Vue-Router support
3
- */
4
-
5
- export default {
6
- props: {
7
- url: String,
8
- replace: Boolean,
9
- to: [String, Object]
10
- },
11
-
12
- methods: {
13
- routerLink() {
14
- const { to, url, $router, replace } = this;
15
- if (to && $router) {
16
- $router[replace ? 'replace' : 'push'](to);
17
- } else if (url) {
18
- replace ? location.replace(url) : location.href = url;
19
- }
20
- }
21
- }
22
- };
1
+ /**
2
+ * add Vue-Router support
3
+ */
4
+
5
+ export default {
6
+ props: {
7
+ url: String,
8
+ replace: Boolean,
9
+ to: [String, Object]
10
+ },
11
+
12
+ methods: {
13
+ routerLink() {
14
+ const { to, url, $router, replace } = this;
15
+ if (to && $router) {
16
+ $router[replace ? 'replace' : 'push'](to);
17
+ } else if (url) {
18
+ replace ? location.replace(url) : location.href = url;
19
+ }
20
+ }
21
+ }
22
+ };
23
23
 
@@ -194,7 +194,8 @@ export default {
194
194
  );
195
195
  } else {
196
196
  // 返回插槽内容
197
- return this.$slots.default ? this.$slots.default : null;
197
+ return h('div', this.$slots.default || []);
198
+ // return this.$slots.default ? this.$slots.default : null;
198
199
  }
199
200
  },
200
201
  };
@@ -24,7 +24,8 @@
24
24
  &:last-child {
25
25
  .vd-step-u-line {
26
26
  width: 50%;
27
- inset-inline-end: 50%;
27
+ // inset-inline-end: 50%;
28
+ right: 50%;
28
29
 
29
30
  &::after {
30
31
  width: 100%;
@@ -55,4 +56,11 @@
55
56
  display: flex;
56
57
  justify-content: space-between;
57
58
  }
58
- }
59
+ }
60
+
61
+ [lang='ar'] {
62
+ .vd-step.vd-step-horizontal .vd-step-item:last-child .vd-step-u-line {
63
+ right: inherit;
64
+ left: 50%;
65
+ }
66
+ }
@@ -12,7 +12,8 @@
12
12
 
13
13
  .vd-step-u-dot {
14
14
  position: absolute;
15
- inset-inline-end: 50%;
15
+ // inset-inline-end: 50%;
16
+ right: 50%;
16
17
  transform: translateX(50%);
17
18
  z-index: 2;
18
19
  display: flex;
@@ -21,7 +22,7 @@
21
22
  color: inherit;
22
23
  width: var(--icon-steps-size);
23
24
  height: var(--icon-steps-size);
24
- inset-block-start: var(--spacing-steps-horizontal-padding_x);
25
+ top: var(--spacing-steps-horizontal-padding_x);
25
26
 
26
27
  .vd-iconfont {
27
28
  color: inherit;
@@ -42,8 +43,9 @@
42
43
 
43
44
  .vd-step-u-line {
44
45
  position: absolute;
45
- inset-block-start: calc(var(--spacing-steps-horizontal-padding_x) + var(--icon-steps-size)/2);
46
- inset-inline-end: 0;
46
+ top: calc(var(--spacing-steps-horizontal-padding_x) + var(--icon-steps-size)/2);
47
+ // inset-inline-end: 0;
48
+ right: 0;
47
49
  z-index: 1;
48
50
  width: 100%;
49
51
  height: var(--height-steps-border-default);
@@ -123,8 +125,9 @@
123
125
  .vd-step-u-line::after {
124
126
  content: "";
125
127
  position: absolute;
126
- inset-block-start: 0;
127
- inset-inline-start: 0;
128
+ top: 0;
129
+ // inset-inline-start: 0;
130
+ left: 0;
128
131
  width: 50%;
129
132
  height: var(--height-steps-border-hover);
130
133
  background: var(--color-steps-border-hover);
@@ -147,8 +150,9 @@
147
150
  .vd-step-u-line::after {
148
151
  content: "";
149
152
  position: absolute;
150
- inset-block-start: 0;
151
- inset-inline-start: 0;
153
+ top: 0;
154
+ // inset-inline-start: 0;
155
+ left: 0;
152
156
  width: 50%;
153
157
  height: var(--height-steps-border-hover);
154
158
  background: var(--color-steps-border-hover);
@@ -167,8 +171,9 @@
167
171
 
168
172
  .vd-step-u-dot {
169
173
  position: absolute;
170
- inset-block-start: 0;
171
- inset-inline-start: var(--spacing-steps-vertical-padding_y);
174
+ top: 0;
175
+ // inset-inline-start: var(--spacing-steps-vertical-padding_y);
176
+ left: var(--spacing-steps-vertical-padding_y);
172
177
  z-index: 2;
173
178
  display: flex;
174
179
  justify-content: center;
@@ -197,8 +202,9 @@
197
202
  .vd-step-u-line {
198
203
  position: absolute;
199
204
  z-index: 1;
200
- inset-block-start: calc(var(--icon-steps-size)/2);
201
- inset-inline-start: calc(var(--spacing-steps-vertical-padding_y) + var(--icon-steps-size)/2);
205
+ top: calc(var(--icon-steps-size)/2);
206
+ // inset-inline-start: calc(var(--spacing-steps-vertical-padding_y) + var(--icon-steps-size)/2);
207
+ left: calc(var(--spacing-steps-vertical-padding_y) + var(--icon-steps-size)/2);
202
208
  width: var(--height-steps-border-default);
203
209
  height: 100%;
204
210
  background: linear-gradient(to bottom,
@@ -260,8 +266,9 @@
260
266
  content: "";
261
267
  position: absolute;
262
268
  z-index: 1;
263
- inset-block-start: 0;
264
- inset-inline-start: 0;
269
+ top: 0;
270
+ // inset-inline-start: 0;
271
+ left: 0;
265
272
  height: 100%;
266
273
  width: var(--height-steps-border-default);
267
274
  background: var(--color-steps-border-hover);
@@ -358,5 +365,35 @@
358
365
  [lang='ar'] {
359
366
  .vd-step-horizontal .vd-step-u-dot {
360
367
  transform: translateX(-50%);
368
+ right: inherit;
369
+ left: 50%;
361
370
  }
371
+ .vd-step-item.vd-step-horizontal .vd-step-u-line {
372
+ right: inherit;
373
+ left: 0;
374
+ }
375
+ .vd-step-item.vd-step-horizontal.vd-step-afoot .vd-step-u-line::after {
376
+ left: inherit;
377
+ right: 0;
378
+ }
379
+ .vd-step-item.vd-step-horizontal.vd-step-warning .vd-step-u-line::after {
380
+ left: inherit;
381
+ right: 0;
382
+ }
383
+ // vertical
384
+ .vd-step-item.vd-step-vertical .vd-step-u-dot {
385
+ left: inherit;
386
+ right: var(--spacing-steps-vertical-padding_y);
387
+ }
388
+ .vd-step-item.vd-step-vertical .vd-step-u-line {
389
+ left: inherit;
390
+ right: calc(var(--spacing-steps-vertical-padding_y) + var(--icon-steps-size) / 2);
391
+ }
392
+ .vd-step-item.vd-step-vertical.vd-step-active .vd-step-u-line::after {
393
+ left: inherit;
394
+ right: 0;
395
+ }
396
+ // .vd-step-u-dot .vd-svg-icon {
397
+ // transform: scaleX(1);
398
+ // }
362
399
  }
@@ -25,17 +25,18 @@
25
25
  paneClasses() {
26
26
  return {
27
27
  'vd-tab__pane': true,
28
+ 'vd-tab__pane--inactive': !this.isActive,
28
29
  };
29
30
  },
30
31
  isActive() {
31
- if (!this.parent) return false;
32
- if (this.name !== undefined) {
33
- return this.name === this.parent.currentName;
34
- } else {
35
- const index = this.parent.tabs.indexOf(this);
36
- return index === Number(this.parent.currentName);
37
- }
38
- },
32
+ if (!this.parent) return false;
33
+ if (this.name !== undefined) {
34
+ return this.name === this.parent.currentName;
35
+ } else {
36
+ const index = this.parent.tabs.indexOf(this);
37
+ return index === Number(this.parent.currentName);
38
+ }
39
+ },
39
40
  shouldShow() {
40
41
  // 当 animated 为 true 时,所有标签页都需要渲染(用于动画效果)
41
42
  // 当 animated 为 false 时,只渲染当前激活的标签页
@@ -393,6 +393,10 @@
393
393
  &__pane {
394
394
  flex-shrink: 0;
395
395
  width: 100%;
396
+ &--inactive {
397
+ height: 0;
398
+ overflow: hidden;
399
+ }
396
400
  }
397
401
 
398
402
  }