webcake-ui-kit 1.0.20 → 1.0.22

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": "webcake-ui-kit",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "UI Kit for Vue 2 && 3 - Pure Options API",
5
5
  "main": "src/index.js",
6
6
  "module": "src/index.js",
@@ -7,14 +7,23 @@
7
7
  class="ui-tabs__item"
8
8
  :class="{
9
9
  'ui-tabs__item--active': tab.value === value,
10
- 'ui-tabs__item--disabled': tab.disabled
10
+ 'ui-tabs__item--disabled': tab.disabled,
11
+ 'ui-tabs__item--stretch': this.stretchItems
11
12
  }"
12
13
  :disabled="tab.disabled || undefined"
13
14
  @click="select(tab.value)"
14
15
  >
15
- <span v-if="hasIconSlot" class="ui-tabs__icon"><slot name="tab-icon" :tab="tab" /></span>
16
- <span v-if="tab.label" class="ui-tabs__label">{{ tab.label }}</span>
17
- <span v-if="tab.counter > 0" class="ui-tabs__counter">{{ tab.counter }}</span>
16
+ <div class="ui-tabs__item-inner">
17
+ <slot name="label" :tab="tab">
18
+ <span v-if="tab.icon" class="ui-tabs__icon">
19
+ <slot name="icon" :tab="tab">
20
+ <component :is="tab.icon" />
21
+ </slot>
22
+ </span>
23
+ <span v-if="tab.label" class="ui-tabs__label">{{ tab.label }}</span>
24
+ <span v-if="tab.counter > 0" class="ui-tabs__counter">{{ tab.counter }}</span>
25
+ </slot>
26
+ </div>
18
27
  </button>
19
28
  </div>
20
29
  </template>
@@ -36,14 +45,13 @@ export default {
36
45
  validator: function (v) {
37
46
  return ['xs', 'sm', 'md', 'lg'].includes(v)
38
47
  }
48
+ },
49
+ stretchItems: {
50
+ type: Boolean,
51
+ default: () => false
39
52
  }
40
53
  },
41
54
  emits: ['input', 'change'],
42
- computed: {
43
- hasIconSlot: function () {
44
- return !!((this.$scopedSlots && this.$scopedSlots['tab-icon']) || this.$slots['tab-icon'])
45
- }
46
- },
47
55
  methods: {
48
56
  select: function (val) {
49
57
  if (val === this.value) return
@@ -19,12 +19,10 @@
19
19
 
20
20
  /* — tab item — */
21
21
  .ui-tabs__item {
22
- display: inline-flex;
22
+ display: flex;
23
23
  align-items: center;
24
24
  justify-content: center;
25
- gap: 6px;
26
25
  height: 26px;
27
- padding: 0 var(--spacing-xs);
28
26
  border: none;
29
27
  background: none;
30
28
  border-radius: var(--radius);
@@ -40,7 +38,19 @@
40
38
  box-sizing: border-box;
41
39
  flex-shrink: 0;
42
40
  transition: color 0.1s;
43
- flex: 1;
41
+
42
+ .ui-tabs__item--stretch {
43
+ flex: 1;
44
+ }
45
+ }
46
+
47
+ .ui-tabs__item-inner {
48
+ height: 100%;
49
+ display: inline-flex;
50
+ align-items: center;
51
+ justify-content: center;
52
+ gap: 6px;
53
+ padding: 0 var(--spacing-xs);
44
54
  }
45
55
 
46
56
  .ui-tabs__item:hover:not(.ui-tabs__item--active):not(.ui-tabs__item--disabled) {
@@ -89,6 +99,11 @@
89
99
  width: 20px;
90
100
  height: 20px;
91
101
  flex-shrink: 0;
102
+
103
+ svg {
104
+ width: 20px;
105
+ height: 20px;
106
+ }
92
107
  }
93
108
 
94
109
  .ui-tabs--xs .ui-tabs__icon {