@itfin/components 1.2.50 → 1.2.52

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.2.50",
3
+ "version": "1.2.52",
4
4
  "author": "Vitalii Savchuk <esvit666@gmail.com>",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -18,6 +18,22 @@
18
18
 
19
19
  .itf-tabs {
20
20
 
21
+ &.itf-tabs__simple > .itf-tabs-panel {
22
+ padding-left: 0 !important;
23
+ }
24
+ .itf-tab__simple {
25
+ text-decoration: none;
26
+ padding-right: 2rem;
27
+ color: var(--bs-gray-500);
28
+
29
+ [data-theme="dark"] & {
30
+ color: var(--bs-gray-700);
31
+ }
32
+
33
+ &.active {
34
+ color: var(--bs-body-color);
35
+ }
36
+ }
21
37
  &.itf-tabs__vertical {
22
38
  display: flex;
23
39
  flex-direction: row-reverse;
@@ -81,7 +97,7 @@
81
97
  flex-grow: 1;
82
98
  z-index: 1;
83
99
  margin-right: -1px;
84
-
100
+
85
101
  @include media-breakpoint-up(lg) {
86
102
  max-width: calc(100% - var(--itf-tabs-panel-width));
87
103
  }
@@ -1,5 +1,8 @@
1
1
  <template>
2
- <div v-if="active || (tabsManager && tabsManager.getValue() === id)" :class="{ filled }" class="itf-tab-content" :data-test="`itf-tab-content-${id || _uid}`">
2
+ <div
3
+ v-if="active || (tabsManager && tabsManager.getValue() === id)"
4
+ :class="{ filled }"
5
+ :data-test="`itf-tab-content-${id || _uid}`">
3
6
  <slot />
4
7
  </div>
5
8
  </template>
@@ -18,6 +18,7 @@ export default @Component({
18
18
  class itfTabs extends Vue {
19
19
  @Model('input') value;
20
20
  @Prop(Boolean) vertical;
21
+ @Prop(Boolean) simple;
21
22
 
22
23
  tabNodes;
23
24
 
@@ -29,6 +30,9 @@ class itfTabs extends Vue {
29
30
  if (this.vertical) {
30
31
  staticClass += ' itf-tabs__vertical';
31
32
  }
33
+ if (this.simple) {
34
+ staticClass += ' itf-tabs__simple';
35
+ }
32
36
 
33
37
  const list = (this.vertical ? tabNodes : [...tabNodes].reverse());
34
38
  const tabs = list.map((node) => createElement('a', this.createTab(node), [node]));
@@ -86,7 +90,7 @@ class itfTabs extends Vue {
86
90
  }
87
91
 
88
92
  return {
89
- staticClass: 'itf-tab',
93
+ staticClass: this.simple ? 'itf-tab__simple' : 'itf-tab',
90
94
  class: {
91
95
  'active': this.isActive(node)
92
96
  },
@@ -63,5 +63,27 @@ storiesOf('Common', module)
63
63
  asd123
64
64
  </itf-tab-content>
65
65
  </itf-tabs>
66
+
67
+ <itf-tabs v-model="tab" simple>
68
+ <itf-tab id="Test1">
69
+ Content 1
70
+ <div class="text-muted">Coming soon...</div>
71
+ </itf-tab>
72
+ <itf-tab id="Test2">
73
+ Content 2
74
+ </itf-tab>
75
+ <itf-tab id="Test3">
76
+ Content 3
77
+ </itf-tab>
78
+ <itf-tab id="Test4">
79
+ Content 4
80
+ </itf-tab>
81
+ <itf-tab-content id="Test1" filled>
82
+ asd
83
+ </itf-tab-content>
84
+ <itf-tab-content id="Test2" filled>
85
+ asd123
86
+ </itf-tab-content>
87
+ </itf-tabs>
66
88
  </div>`,
67
89
  }));
@@ -62,8 +62,8 @@ export function formatRangeDates(begin, end = null) {
62
62
 
63
63
  export function firstLetters(name) {
64
64
  let [first, second] = (name || '').trim()
65
- .replace(/[\u0250-\u0400\u04FF-\ue0070-9]/g, '')
66
- .replace(/ +/g, ' ')
65
+ .replace(/[\u0250-\u0400\u04FF-\ue007]/g, '')
66
+ .replace(/[ \.,_!@#$%^&*()«»]+/g, ' ')
67
67
  .split(' ');
68
68
 
69
69
  if (first === 'undefined') {
@@ -73,7 +73,7 @@ export function firstLetters(name) {
73
73
  second = '';
74
74
  }
75
75
  if (!second) {
76
- return first[0] || '';
76
+ return (first[0] || '').toUpperCase();
77
77
  }
78
- return (first[0] || '') + (second[0] || '');
78
+ return ((first[0] || '') + (second[0] || '')).toUpperCase();
79
79
  }