@itfin/components 1.0.66 → 1.0.67

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itfin/components",
3
- "version": "1.0.66",
3
+ "version": "1.0.67",
4
4
  "main": "dist/itfin-components.umd.js",
5
5
  "unpkg": "dist/itfin-components.common.js",
6
6
  "author": "Vitalii Savchuk <esvit666@gmail.com>",
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="itf-tab" :data-test="`itf-tab-${id}`" @click="tabsManager.setValue(id)" :class="{ 'active': tabsManager && tabsManager.getValue() === id }">
2
+ <div class="itf-tab" :data-test="`itf-tab-${id}`" @click="setActive" :class="{ active }">
3
3
  <span><slot /></span>
4
4
  </div>
5
5
  </template>
@@ -19,5 +19,21 @@ export default @Component({
19
19
  class itfTab extends Vue {
20
20
  @Inject() tabsManager;
21
21
  @Prop() id;
22
+ @Prop() to;
23
+
24
+ get active() {
25
+ if (this.to) {
26
+ const route = this.$router.resolve(this.to);
27
+ return this.$route.path === (route && route.href);
28
+ }
29
+ return this.tabsManager && this.tabsManager.getValue() === this.id;
30
+ }
31
+
32
+ setActive() {
33
+ if (this.to) {
34
+ this.$router.push(this.to);
35
+ }
36
+ this.tabsManager.setValue(id);
37
+ }
22
38
  }
23
39
  </script>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div v-show="tabsManager && tabsManager.getValue() === id" class="itf-tab-content" :data-test="`itf-tab-content-${id}`">
2
+ <div v-show="tabsManager && tabsManager.getValue() === id" :class="{ filled }" class="itf-tab-content" :data-test="`itf-tab-content-${id}`">
3
3
  <slot />
4
4
  </div>
5
5
  </template>
@@ -19,5 +19,6 @@ export default @Component({
19
19
  class itfTabContent extends Vue {
20
20
  @Inject({ default: null }) tabsManager;
21
21
  @Prop() id;
22
+ @Prop(Boolean) filled;
22
23
  }
23
24
  </script>
@@ -13,6 +13,8 @@
13
13
  --itf-tabs-hover-color: #222;
14
14
  --itf-tabs-hover-border-color: rgba(0, 0, 0, .5);
15
15
  --itf-tabs-tab-padding: 10px;
16
+
17
+ --itf-tabs-content-bg: #fff;
16
18
  }
17
19
 
18
20
  .itf-tabs {
@@ -37,6 +39,7 @@
37
39
  background-color: var(--itf-tabs-inactive-bg);
38
40
  color: var(--itf-tabs-inactive-color);
39
41
  border-top: 1px solid var(--itf-tabs-inactive-border-color);
42
+ border-bottom: 1px solid var(--itf-tabs-inactive-border-color);
40
43
 
41
44
  & > span {
42
45
  position: relative;
@@ -78,13 +81,20 @@
78
81
  background-color: var(--itf-tabs-active-bg);
79
82
  color: var(--itf-tabs-active-color);
80
83
  border-top: 1px solid var(--itf-tabs-active-border-color);
84
+ border-bottom: 0 none;
81
85
  }
82
86
  }
83
87
  }
84
88
  }
85
89
  .itf-tabs-content {
86
90
  .itf-tab-content {
87
-
91
+ &.filled {
92
+ background: var(--itf-tabs-content-bg);
93
+ border: 1px solid var(--itf-tabs-inactive-border-color);
94
+ margin-top: -1px;
95
+ border-bottom-left-radius: $border-radius;
96
+ border-bottom-right-radius: $border-radius;
97
+ }
88
98
  }
89
99
  }
90
100
  }