@itfin/components 2.0.1 → 2.0.3

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": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "author": "Vitalii Savchuk <esvit666@gmail.com>",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -26,7 +26,8 @@ $success: #10834e;
26
26
  $warning: #cda277;
27
27
  $danger: #cb4839;
28
28
 
29
- $primary: #1A4A97 !default;
29
+ $primary: #0B1315 !default;
30
+ $secondary: #f2f2f2;
30
31
  $link-color: #1A4A97 !default;
31
32
  $input-btn-focus-width: .125rem;
32
33
 
@@ -49,8 +50,6 @@ $modal-backdrop-bg: #999;
49
50
  $modal-backdrop-opacity: .25;
50
51
  $modal-content-border-radius: 0;
51
52
 
52
- $secondary: #dfe1e6;
53
-
54
53
  // popover
55
54
  $popover-border-width: 2px;
56
55
 
@@ -88,6 +87,16 @@ $baseText: #1e1e1e;
88
87
  $gray5: #F0F0F1;
89
88
  $gray50: #787885;
90
89
 
90
+ $theme-colors: (
91
+ "primary": $primary,
92
+ "secondary": $secondary,
93
+ "success": $success,
94
+ "info": $info,
95
+ "warning": $warning,
96
+ "danger": $danger,
97
+ "blue": $link-color
98
+ );
99
+
91
100
  // згідно з дизайном
92
101
  $body-color: #22222B;
93
102
  $dropdown-border-radius: .75rem;
@@ -96,5 +105,7 @@ $dropdown-item-padding-x: .5rem;
96
105
  $dropdown-link-hover-bg: #F1F2F4;
97
106
  $border-color-translucent: #00000014;
98
107
  $dropdown-header-color: #A5A5A9;
108
+ $input-group-addon-bg: $input-bg;
99
109
  $form-check-input-checked-bg-color: #22222B;
100
110
  $form-check-input-indeterminate-bg-color: #22222B;
111
+ $nav-link-color: $primary;
@@ -114,7 +114,7 @@
114
114
  --adp-transition-ease: ease-out;
115
115
  --adp-transition-offset: 8px;
116
116
 
117
- --adp-background-color: #{$body-bg};
117
+ --adp-background-color: transparent;
118
118
  --adp-background-color-hover: #f0f0f0;
119
119
  --adp-background-color-active: #eaeaea;
120
120
  --adp-background-color-in-range: rgba(92, 196, 239, .1);
@@ -123,7 +123,7 @@
123
123
  --adp-background-color-selected-other-month: #a2ddf6;
124
124
 
125
125
  --adp-color: #4a4a4a;
126
- --adp-color-secondary: #9c9c9c;
126
+ --adp-color-secondary: #A5A5A9;
127
127
  --adp-accent-color: #4eb5e6;
128
128
  --adp-color-current-date: #{$primary};
129
129
  --adp-color-other-month: #dedede;
@@ -132,7 +132,7 @@
132
132
  --adp-color-other-month-hover: #c5c5c5;
133
133
 
134
134
  --adp-border-color: #dbdbdb;
135
- --adp-border-color-inner: #efefef;
135
+ --adp-border-color-inner: #00000014;
136
136
  --adp-border-radius: 4px;
137
137
  //--adp-border-color-inline: #d7d7d7;
138
138
  --adp-border-color-inline: transparent;
@@ -58,9 +58,9 @@
58
58
  padding-bottom: 0.125rem;
59
59
  }
60
60
  &.vs--open .form-control {
61
- box-shadow: 0 0 0 0.125rem $input-focus-border;
62
- border-color: $body-bg;
63
- background: $body-bg;
61
+ //box-shadow: 0 0 0 0.125rem $input-focus-border;
62
+ //border-color: $body-bg;
63
+ //background: $body-bg;
64
64
  }
65
65
  &__dropdown-menu {
66
66
  background-color: $body-bg;
@@ -40,10 +40,8 @@
40
40
  z-index: 10;
41
41
  }
42
42
  &__input {
43
- .addon + & {
44
- border-top-left-radius: $input-border-radius !important;
45
- border-bottom-left-radius: $input-border-radius !important;
46
- }
43
+ border: 0 none;
44
+ //background-color: transparent !important;
47
45
  resize: none;
48
46
  }
49
47
  &__autogrow &__input {
@@ -84,13 +84,18 @@ kbd {
84
84
  color: var(--bs-body-color);
85
85
  }
86
86
  }
87
- .form-check-input:checked[type=checkbox] {
87
+ body .form-check-input:checked[type=checkbox] {
88
88
  --bs-form-check-bg-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 10 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 1L3.5 6.5L1 4' stroke='white' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
89
89
  box-shadow: 0px 2px 3px 0px #00000026;
90
90
  }
91
- .form-check-input:indeterminate[type=checkbox] {
91
+ body .form-check-input:indeterminate[type=checkbox] {
92
92
  box-shadow: 0px 2px 3px 0px #00000026;
93
93
  }
94
94
  .text-muted {
95
95
  color: #666770;
96
96
  }
97
+ body .form-control {
98
+ &:focus {
99
+ box-shadow: none !important;
100
+ }
101
+ }
@@ -38,7 +38,7 @@ const Message = function (options) {
38
38
  const parent = document.getElementById('itf-app');
39
39
 
40
40
  const instance = new ToastContainer({
41
- // parent: $nuxt.$el.__vue__,
41
+ parent: $nuxt.$el.__vue__,
42
42
  el: document.createElement('itf-toast-container'),
43
43
  data: options
44
44
  });
@@ -24,12 +24,14 @@
24
24
  </template>
25
25
  <template v-else-if="type === 'period'">
26
26
  <itf-date-range-picker-inline
27
+ style="margin: -.5rem"
27
28
  :value="value.value"
28
29
  @input="onFilterChange({ value: $event })"
29
30
  />
30
31
  </template>
31
32
  <template v-else-if="type === 'date'">
32
33
  <itf-date-picker-inline
34
+ style="margin: -.5rem"
33
35
  :value="value.value"
34
36
  @input="onFilterChange({ value: $event })"
35
37
  />
@@ -1,23 +1,25 @@
1
1
  <template>
2
2
  <div>
3
3
  <div class="px-1">
4
- <div v-if="title" class="fw-bold mb-1">{{title}}</div>
4
+ <div class="facets-filter-header">
5
+ <div v-if="title">{{title}}</div>
6
+ </div>
5
7
 
6
8
  <itf-text-field small v-model="query" class="mb-2" :placeholder="$t('components.filter.search')" clearable />
7
9
 
8
- <div v-if="mappedValues.length" class="d-flex justify-content-between small mb-2">
10
+ <div class="d-flex justify-content-between small mb-2">
9
11
  <a v-if="isSelectedAll" href="" @click.stop.prevent="onSelectAll(false)">{{$t('components.filter.deselectAll')}}</a>
10
12
  <a v-else href="" @click.stop.prevent="onSelectAll(true)">{{$t('components.filter.selectAll')}}</a>
11
13
 
12
14
  <span class="text-muted" v-if="!isHasSelected" href="" @click.stop.prevent="onShowSelected(true)">{{$t('components.filter.showSelected')}}</span>
13
15
  <a v-else-if="!isShowSelected" href="" @click.stop.prevent="onShowSelected(true)">{{$t('components.filter.showSelected')}}</a>
14
- <a v-else href="" @click.stop.prevent="onShowSelected(false)">{{$t('components.filter.showSelected')}}</a>
16
+ <a v-else href="" @click.stop.prevent="onShowSelected(false)">{{$t('components.filter.showAll')}}</a>
15
17
  </div>
16
- <div v-else>
18
+ <div v-if="!mappedValues.length">
17
19
  <div class="text-muted text-center py-4">{{ $t('components.filter.noResults') }}</div>
18
20
  </div>
19
21
  </div>
20
- <div v-for="(val, n) of mappedValues" :key="n" class="facet-item" :class="{'active': val.isSelected}" @click="onFilterClick(val)">
22
+ <div v-for="(val, n) of mappedValues" :key="n" class="dropdown-item" :class="{'active': val.isSelected}" @click="onFilterClick(val)">
21
23
  <span class="facet-name text-dark d-flex align-items-center">
22
24
  <itf-checkbox ungrouped :value="val.isSelected" class="m-0" />
23
25
  <div class="w-100 text-truncate">{{ val.label }}</div>
@@ -28,15 +30,20 @@
28
30
  </span>
29
31
  </div>
30
32
 
31
- <itf-button class="mt-1" v-if="hasMore" small block @click="toggleMore">
33
+ <itf-button default class="mt-1" v-if="hasMore" small block @click="toggleMore">
32
34
  <span v-if="showMore">{{ $t('components.filter.hideMore', { count: visibleList.length }) }}</span>
33
35
  <span v-else>{{ $t('components.filter.showMore', { count: visibleList.length }) }}</span>
34
36
  </itf-button>
35
37
  </div>
36
38
  </template>
37
39
  <style lang="scss" scoped>
38
- .facet-item {
39
- background: transparent;
40
+ .facets-filter-header {
41
+ border-bottom: 1px solid var(--bs-border-color-translucent);
42
+ color: #A5A5A9;
43
+ padding: 0 0.75rem .5rem;
44
+ margin: 0 -.75rem .75rem;
45
+ }
46
+ .dropdown-item {
40
47
  cursor: pointer;
41
48
  display: inline-flex;
42
49
  -webkit-box-align: center;
@@ -47,8 +54,6 @@
47
54
  box-sizing: border-box;
48
55
  height: 1.75rem;
49
56
  width: 100%;
50
- padding-left: 0.25rem;
51
- padding-right: 0.25rem;
52
57
  font-size: 0.875rem;
53
58
  line-height: 1.25rem;
54
59
  font-weight: 400;
@@ -62,16 +67,12 @@
62
67
  transition: none 0s ease 0s;
63
68
  margin: 1px 0;
64
69
  &.active {
65
- background-color: rgba(var(--bs-primary-rgb), 10%);
66
-
67
70
  .facet-bar-progress {
68
- background-color: rgba(var(--bs-primary-rgb), 75%);
71
+ background-color: var(--bs-blue);
69
72
  }
70
73
  }
71
- &:hover, &:focus, &.active {
72
- border-color: var(--bs-primary);
73
- }
74
74
  .facet-name {
75
+ min-width: 0;
75
76
  text-align: left;
76
77
  white-space: nowrap;
77
78
 
@@ -95,7 +96,7 @@
95
96
  width: var(--bar-width);
96
97
  min-width: 5px;
97
98
  height: 10px;
98
- background-color: rgb(197, 205, 223);
99
+ background-color: rgba(var(--bs-blue-rgb), 50%);
99
100
  transition: width 0.3s ease 0s;
100
101
  }
101
102
  }
@@ -200,6 +201,9 @@ class FilterFacetsList extends Vue {
200
201
  }
201
202
 
202
203
  onShowSelected(isShow = false) {
204
+ if (!this.value.length && isShow) { // не показувати, якщо нічого не вибрано
205
+ return;
206
+ }
203
207
  this.isShowSelected = isShow;
204
208
  }
205
209
  }
@@ -13,7 +13,7 @@ export default @Component({
13
13
  }
14
14
  })
15
15
  class itfIcon extends Vue {
16
- @Prop({ type: String, validator: (value) => !!icons[value] }) name;
16
+ @Prop({ type: String }) name;
17
17
  @Prop([Number, String]) size;
18
18
  @Prop(Boolean) new;
19
19
 
@@ -0,0 +1,4 @@
1
+ <template><svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M10 4.16675C10.4602 4.16675 10.8333 4.53984 10.8333 5.00008L10.8333 7.91675C10.8333 8.14687 11.0199 8.33341 11.25 8.33341H14.1667C14.6269 8.33341 15 8.70651 15 9.16675V9.91674C15 10.1469 14.8135 10.3334 14.5833 10.3334H5.41667C5.18655 10.3334 5 10.1469 5 9.91674V9.16675C5 8.70651 5.3731 8.33341 5.83333 8.33341H8.75C8.98012 8.33341 9.16667 8.14687 9.16667 7.91675V5.00008C9.16667 4.53984 9.53976 4.16675 10 4.16675ZM5.41667 11.3334C5.18655 11.3334 5 11.52 5 11.7501V15.3663C5 15.566 5.22254 15.6851 5.38868 15.5743L5.78775 15.3082C6.06767 15.1216 6.43233 15.1216 6.71225 15.3082L7.03775 15.5252C7.31767 15.7119 7.68233 15.7119 7.96225 15.5252L8.28775 15.3082C8.56767 15.1216 8.93233 15.1216 9.21225 15.3082L9.53775 15.5252C9.81767 15.7119 10.1823 15.7119 10.4623 15.5252L10.7877 15.3082C11.0677 15.1216 11.4323 15.1216 11.7123 15.3082L12.0377 15.5252C12.3177 15.7119 12.6823 15.7119 12.9623 15.5252L13.2877 15.3082C13.5677 15.1216 13.9323 15.1216 14.2122 15.3082L14.6113 15.5743C14.7775 15.6851 15 15.566 15 15.3663V11.7501C15 11.52 14.8135 11.3334 14.5833 11.3334H5.41667Z" fill="currentColor"/>
3
+ </svg>
4
+ </template>
@@ -0,0 +1,4 @@
1
+ <template><svg style="transform: rotate(-90deg);" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="-1 -1 19 19">
2
+ <path d="M3.5 3.5c-.614-.884-.074-1.962.858-2.5L8 7.226 11.642 1c.932.538 1.472 1.616.858 2.5L8.81 8.61l1.556 2.661a2.5 2.5 0 1 1-.794.637L8 9.73l-1.572 2.177a2.5 2.5 0 1 1-.794-.637L7.19 8.61zm2.5 10a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0m7 0a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0"/>
3
+ </svg>
4
+ </template>