@itfin/components 1.4.12 → 1.4.14

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.4.12",
3
+ "version": "1.4.14",
4
4
  "author": "Vitalii Savchuk <esvit666@gmail.com>",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -1,9 +1,3 @@
1
- if (typeof CSS !== 'undefined' && 'paintWorklet' in CSS) {
2
- CSS.paintWorklet.addModule(
3
- "https://www.unpkg.com/css-houdini-squircle@0.1.3/squircle.min.js"
4
- );
5
- }
6
-
7
1
  class ITFSettings {
8
2
  options = {
9
3
  firstDayOfWeek: 'Monday',
@@ -60,7 +60,7 @@ body[data-theme="dark"] {
60
60
 
61
61
  .dropdown-menu {
62
62
  --bs-dropdown-link-color: #{$dark-link-color};
63
- --bs-dropdown-link-hover-color: #1e2125;
64
- --bs-dropdown-link-hover-bg: #{$dark-link-color};
63
+ --bs-dropdown-link-hover-bg: rgba(var(--bs-primary-rgb), .15);
64
+ --bs-dropdown-link-active-bg: rgba(var(--bs-primary-rgb), .5);
65
65
  }
66
66
  }
@@ -45,22 +45,6 @@
45
45
  }
46
46
  }
47
47
 
48
- @supports (-webkit-mask-image:paint(id)) or (-webkit-mask-image:paint(id)) or (mask-image:paint(id)) or (-webkit-mask-image:paint(id)) {
49
- button.itf-button.btn.btn-squircle {
50
- -webkit-mask-image: paint(squircle);
51
- --squircle-smooth: 0.6;
52
- --squircle-radius: 10px;
53
- --squircle-outline: 0px;
54
- --squircle-corners: top-left top-right bottom-left bottom-right;
55
- }
56
- .itf-button.btn-squircle.btn:not(.dropdown-toggle):focus:after {
57
- -webkit-mask-image: paint(squircle);
58
- --squircle-smooth: 0.6;
59
- --squircle-radius: 10px;
60
- --squircle-outline: 3px;
61
- --squircle-corners: top-left top-right bottom-left bottom-right;
62
- }
63
- }
64
48
  .itf-button.btn {
65
49
  display: inline-flex;
66
50
  align-items: center;
@@ -71,9 +55,6 @@
71
55
  &:focus {
72
56
  -webkit-mask-image: none!important;
73
57
  }
74
- &.btn-squircle:focus:after {
75
- border-color: rgb(103, 146, 244);
76
- }
77
58
  &:not(.dropdown-toggle):focus:after {
78
59
  border: 3px solid #6792f4;
79
60
  border-radius: .5rem;
@@ -29,8 +29,8 @@
29
29
  color: $dark-body-color;
30
30
 
31
31
  &.active, &:active {
32
- background-color: $dark-primary;
33
- color: $dark-body-bg;
32
+ background-color: var(--bs-dropdown-link-active-bg);
33
+ color: var(--bs-dropdown-link-color);
34
34
  }
35
35
  }
36
36
  }
@@ -17,7 +17,6 @@ class itfButton extends Vue {
17
17
  @Prop(Boolean) large;
18
18
  @Prop(Boolean) icon;
19
19
  @Prop(Boolean) block;
20
- @Prop(Boolean) squircle;
21
20
  @Prop(String) loadingText;
22
21
  @Prop(String) color;
23
22
  @Prop(Boolean) disabled;
@@ -28,7 +27,7 @@ class itfButton extends Vue {
28
27
 
29
28
  render (createElement, { data, slots, children, props }) {
30
29
  const {
31
- to, href, target, disabled, color, block, loading, labeled, secondary, primary, small, large, icon, loadingText, squircle, default: defaultStyle,
30
+ to, href, target, disabled, color, block, loading, labeled, secondary, primary, small, large, icon, loadingText, default: defaultStyle,
32
31
  class: classNames
33
32
  } = props;
34
33
  const component = to ? 'nuxt-link' : (props.href ? 'a' : 'button');
@@ -48,7 +47,6 @@ class itfButton extends Vue {
48
47
  'btn-default': defaultStyle,
49
48
  'btn-basic': !primary && !secondary && !color && !defaultStyle,
50
49
  'btn-secondary': secondary,
51
- 'btn-squircle': squircle,
52
50
  'btn-sm': small,
53
51
  'btn-lg': large,
54
52
  // 'px-3': small && !icon,
@@ -7,7 +7,6 @@ const CSS_CLASSES = {
7
7
  small: ['btn-sm'],
8
8
  block: ['itf-button__block'],
9
9
  labeled: ['labeled'],
10
- squircle: ['btn-squircle'],
11
10
  icon: ['btn-icon'],
12
11
  loading: ['loading'],
13
12
  spinner: ['itf-spinner'],
@@ -36,9 +35,6 @@ class Button extends HTMLElement {
36
35
  if (this.hasAttribute('labeled')) {
37
36
  styles.push(CSS_CLASSES.labeled);
38
37
  }
39
- if (this.hasAttribute('squircle')) {
40
- styles.push(CSS_CLASSES.squircle);
41
- }
42
38
  if (this.hasAttribute('icon')) {
43
39
  styles.push(CSS_CLASSES.icon);
44
40
  }
@@ -66,7 +66,7 @@ storiesOf('Common', module)
66
66
 
67
67
  <h3>Standart button</h3>
68
68
 
69
- <itf-button squircle primary>Primary button</itf-button>
69
+ <itf-button primary>Primary button</itf-button>
70
70
  <itf-button secondary>Secondary button</itf-button>
71
71
  <itf-button>Basic button</itf-button>
72
72
  <itf-button icon>
@@ -92,7 +92,7 @@ storiesOf('Common', module)
92
92
 
93
93
  <h3>Large button</h3>
94
94
 
95
- <itf-button squircle large primary>Primary button</itf-button>
95
+ <itf-button large primary>Primary button</itf-button>
96
96
  <itf-button large secondary>Secondary button</itf-button>
97
97
  <itf-button large>Basic button</itf-button>
98
98
  <itf-button large icon>
@@ -27,7 +27,7 @@
27
27
  </div>
28
28
  </template>
29
29
  <script>
30
- import { Vue, Component, Prop, Watch } from 'vue-property-decorator';
30
+ import { Vue, Component, Prop } from 'vue-property-decorator';
31
31
  import itfTextField from '../text-field/TextField.vue';
32
32
  import itfIcon from '../icon/Icon';
33
33
  import itfButton from '../button/Button';
@@ -24,7 +24,7 @@
24
24
  <script>
25
25
  import { Vue, Component, Prop, Inject } from 'vue-property-decorator';
26
26
  import tippy from 'tippy.js';
27
- import itfPeriodPickerInline from "@/components/datepicker/PeriodPickerInline.vue";
27
+ import itfPeriodPickerInline from "./PeriodPickerInline.vue";
28
28
  import {DateTime} from "luxon";
29
29
  import ITFSettings from '../../ITFSettings';
30
30
 
@@ -2,7 +2,7 @@
2
2
  <div>
3
3
  <div class="row mb-3">
4
4
  <div class="col">
5
- <itf-button @click="setYear(prevYear)">
5
+ <itf-button icon @click="setYear(prevYear)">
6
6
  <itf-icon name="chevron_left" />
7
7
  </itf-button>
8
8
  </div>
@@ -22,7 +22,7 @@
22
22
  </itf-button>
23
23
  </div>
24
24
  <div class="col text-end">
25
- <itf-button @click="setYear(nextYear)">
25
+ <itf-button icon @click="setYear(nextYear)">
26
26
  <itf-icon name="chevron_right" />
27
27
  </itf-button>
28
28
  </div>
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import { Vue, Component, Prop, Watch, PropSync } from 'vue-property-decorator';
2
+ import { Vue, Component, Prop, PropSync } from 'vue-property-decorator';
3
3
  import itfButton from '../button/Button';
4
4
  import itfDropdownMenu from './DropdownMenu';
5
5
 
@@ -4,7 +4,7 @@
4
4
  </div>
5
5
  </template>
6
6
  <script>
7
- import { Vue, Component, Prop, Watch, PropSync } from 'vue-property-decorator';
7
+ import { Vue, Component, Prop, PropSync } from 'vue-property-decorator';
8
8
 
9
9
  let globalModalIndex = 0; // base modal z-index
10
10
 
@@ -24,7 +24,7 @@
24
24
  }
25
25
  </style>
26
26
  <script>
27
- import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
27
+ import { Component, Prop, Vue } from 'vue-property-decorator';
28
28
  import itfIcon from '../icon/Icon';
29
29
  import itfButton from '../button/Button';
30
30
 
@@ -31,7 +31,6 @@
31
31
  </template>
32
32
  <template v-else-if="type === 'timeframe'">
33
33
  <itf-period-picker-inline
34
- style="margin: -.5rem"
35
34
  :value="value.value"
36
35
  value-format="yyyy-MM-dd"
37
36
  @input="onFilterChange({ value: $event })"
@@ -84,6 +83,10 @@
84
83
  --filter-badge__padding-y: .5rem;
85
84
  --filter-badge__padding-x: .75rem;
86
85
  }
86
+ body[data-theme="dark"] {
87
+ --filter-badge__default-border-color: #FFFFFF1A;
88
+ --filter-badge__selected-color: #efd877;
89
+ }
87
90
  .filter-pill {
88
91
  align-items: center;
89
92
  font-size: 14px;
@@ -114,7 +117,7 @@
114
117
  }
115
118
  }
116
119
  .filter-pill__label {
117
- color: var(--filter-badge__default-color);
120
+ //color: var(--filter-badge__default-color);
118
121
  padding: var(--filter-badge__padding-y) 0 var(--filter-badge__padding-y) var(--filter-badge__padding-x);
119
122
  max-width: 330px;
120
123
  text-overflow: ellipsis;
@@ -139,7 +142,7 @@
139
142
  padding: 0 calc(var(--filter-badge__padding-x) / 2) 0 calc(var(--filter-badge__padding-x) / 4);
140
143
 
141
144
  svg {
142
- color: var(--filter-badge__default-color);
145
+ //color: var(--filter-badge__default-color);
143
146
  }
144
147
  &.filter-pill__icon-invalid svg {
145
148
  color: var(--filter-badge__invalid-color);
@@ -23,9 +23,9 @@
23
23
  <div v-for="(val, n) of mappedValues" :key="n" class="dropdown-item px-2" :class="{'active': val.isSelected}" @click="onFilterClick(val)">
24
24
  <span class="facet-name text-dark d-flex align-items-center">
25
25
  <itf-checkbox ungrouped :value="val.isSelected" class="m-0" />
26
- <div class="w-100 text-truncate">{{ val.label }}</div>
26
+ <div class="w-100 text-truncate">{{ val.label }} <span v-if="val.description" class="small"><br/>{{ val.description }}</span></div>
27
27
  </span>
28
- <span v-if="val.count" class="facet-stat text-muted">
28
+ <span v-if="val.count" class="facet-stat">
29
29
  {{ val.count }}
30
30
  <span class="facet-bar"><span :style="{'--bar-width': `${getPercent(val)}%`}" class="facet-bar-progress" /></span>
31
31
  </span>
@@ -60,7 +60,7 @@
60
60
  justify-content: space-between;
61
61
  position: relative;
62
62
  box-sizing: border-box;
63
- height: 1.75rem;
63
+ min-height: 1.75rem;
64
64
  width: 100%;
65
65
  font-size: 0.875rem;
66
66
  line-height: 1.25rem;
@@ -76,16 +76,17 @@
76
76
  margin: 1px 0;
77
77
  &.active {
78
78
  .facet-bar-progress {
79
- background-color: var(--bs-blue);
79
+ background-color: var(--bs-primary);
80
80
  }
81
81
  }
82
82
  .facet-name {
83
83
  min-width: 0;
84
84
  text-align: left;
85
+ line-height: 100%;
85
86
  white-space: nowrap;
86
87
 
87
88
  .itf-checkbox {
88
- min-height: auto;
89
+ min-height: 1.25rem;
89
90
  }
90
91
  }
91
92
  .facet-stat {
@@ -104,7 +105,7 @@
104
105
  width: var(--bar-width);
105
106
  min-width: 5px;
106
107
  height: 10px;
107
- background-color: rgba(var(--bs-blue-rgb), 50%);
108
+ background-color: rgba(var(--bs-primary-rgb), 50%);
108
109
  transition: width 0.3s ease 0s;
109
110
  }
110
111
  }
@@ -153,7 +153,7 @@ class FilterPanel extends Vue {
153
153
  isFilterExpanded = false;
154
154
  observer = null;
155
155
 
156
- periodFilters = ['period', 'period-selector'];
156
+ periodFilters = ['period', 'timeframe'];
157
157
  visibleItems = new Set();
158
158
 
159
159
  toggleExpandFilter() {
@@ -19,7 +19,7 @@
19
19
  </div>
20
20
  </template>
21
21
  <script>
22
- import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
22
+ import { Component, Prop, Vue } from 'vue-property-decorator';
23
23
  import itfIcon from '../icon/Icon';
24
24
  import itfButton from '../button/Button';
25
25
  import loading from '../../directives/loading';
@@ -24,7 +24,7 @@
24
24
  }
25
25
  </style>
26
26
  <script>
27
- import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
27
+ import { Component, Prop, Vue } from 'vue-property-decorator';
28
28
  import itfIcon from '../icon/Icon';
29
29
  import itfButton from '../button/Button.vue';
30
30
 
@@ -9,10 +9,10 @@
9
9
  <slot></slot>
10
10
  <div class="py-3 justify-content-end d-flex align-items-center sticky-container">
11
11
  <div v-if="!hideFooter">
12
- <itf-button v-tooltip.delay="'Hot key: Esc'" secondary squircle :loading="loading" :disabled="loading" @click="$emit('cancel')">
12
+ <itf-button v-tooltip.delay="'Hot key: Esc'" secondary :loading="loading" :disabled="loading" @click="$emit('cancel')">
13
13
  <span>{{ $t('components.modal.cancel') }}</span>
14
14
  </itf-button>
15
- <itf-button v-tooltip.delay="'Hot key: Shift + Enter'" primary squircle :loading="loading" :disabled="loading" @click="onSaveClick">
15
+ <itf-button v-tooltip.delay="'Hot key: Shift + Enter'" primary :loading="loading" :disabled="loading" @click="onSaveClick">
16
16
  <span>{{ $t('components.modal.save') }}</span>
17
17
  </itf-button>
18
18
  </div>
@@ -17,7 +17,7 @@
17
17
  <div class="shadow-area"></div>
18
18
  <div class="header-wrapper" :class="{'header-additional-column': showAddColumn}" @click.prevent="toggleGroup">
19
19
  <a class="header-content position-sticky d-flex align-items-center">
20
- <itf-button squircle icon small secondary class="collapse-arrow">
20
+ <itf-button icon small secondary class="collapse-arrow">
21
21
  <itf-icon :name="isShowTable ? 'chevron_down' : 'chevron_right'"/>
22
22
  </itf-button>
23
23
  <span class="d-flex align-items-center line-overflow group-header-value text-primary"
@@ -23,6 +23,8 @@
23
23
  --itf-table-summary-text: var(--bs-tertiary-color);
24
24
  --itf-table-table-border-radius: 1rem;
25
25
  --itf-table-header-height: 2.25rem;
26
+ --itf-table-divider-bg: #F7F8FA;
27
+ --itf-table-divider-border: rgba(238, 238, 238, 1);
26
28
 
27
29
  --group-title-height: 40px;
28
30
  --table-row-height: none;
@@ -43,6 +45,9 @@ body[data-theme="dark"] {
43
45
  --itf-table-selected-bg: #011534;
44
46
  --itf-table-active-bg: #022e72;
45
47
  --itf-table-summary-text: #82909d80;
48
+ --itf-table-border-base-color: var(--itf-table-header-bg);
49
+ --itf-table-divider-bg: #0f0f0f;
50
+ --itf-table-divider-border: rgb(100, 100, 100, .1);
46
51
  }
47
52
  .itf-table2 {
48
53
  font-size: var(--itf-table-content-font-size, var(--itf-table-font-size));
@@ -435,11 +440,11 @@ body[data-theme="dark"] {
435
440
  }
436
441
 
437
442
  &__row-divider {
438
- background-color: #F7F8FA;
443
+ background-color: var(--itf-table-divider-bg);
439
444
  height: 5px;
440
445
  padding: 0;
441
- border-top: 1px solid rgba(238, 238, 238, 1);
442
- border-bottom: 1px solid rgba(238, 238, 238, 1);
446
+ border-top: 1px solid var(--itf-table-divider-border);
447
+ border-bottom: 1px solid var(--itf-table-divider-border);
443
448
  }
444
449
  //&:hover, &.permanent-editable-border {
445
450
  // .table-view-item-value.editable {
@@ -2,16 +2,16 @@
2
2
 
3
3
  <div v-loading="loading || loadingData" class="flex-grow-1 w-100 d-flex flex-column">
4
4
  <itf-filter-panel
5
- :search-placeholder="searchPlaceholder"
6
- :search="currentTab !== 'list'"
7
- :show-filter="currentTab !== 'list'"
8
- class="py-2 px-3"
9
- :static-filters="filters"
10
- :endpoint="filtersEndpoint"
11
- :panel="panel"
12
- v-model="filter"
13
- @input="onFilterSet"
14
- @set-table-schema="setTableSchema"
5
+ :search-placeholder="searchPlaceholder"
6
+ :search="currentTab !== 'list'"
7
+ :show-filter="currentTab !== 'list'"
8
+ class="py-2 px-3"
9
+ :static-filters="filters"
10
+ :endpoint="filtersEndpoint"
11
+ :panel="panel"
12
+ v-model="filter"
13
+ @input="onFilterSet"
14
+ @set-table-schema="setTableSchema"
15
15
  >
16
16
  <template #after-filter-btn>
17
17
  <itf-dropdown v-if="$refs.table && tableSchema" shadow append-to-context :button-options="{ default: true, icon: true }" class="h-100" autoclose="outside">
@@ -42,11 +42,12 @@
42
42
  </itf-dropdown>
43
43
 
44
44
  <itf-segmented-control
45
- v-if="tabs.length"
46
- class="small"
47
- v-model="currentTab"
48
- item-key="value"
49
- :items="tabs"
45
+ v-if="tabs.length > 1"
46
+ class="small"
47
+ :value="currentTab"
48
+ item-key="value"
49
+ :items="tabs"
50
+ @input="updateTabs"
50
51
  >
51
52
  <template #item="{ item }">
52
53
  <div class="d-flex align-items-center">
@@ -65,28 +66,28 @@
65
66
  <div class="flex-grow-1 px-3 d-flex flex-column">
66
67
  <div class="position-relative flex-grow-1">
67
68
  <itf-table
68
- ref="table"
69
- style="--shadow-area-width: 0px;"
70
- absolute
71
- striped
72
- clickable
73
- column-sorting
74
- column-resizing
75
- :indicator-type="indicatorType"
76
- class="permanent-checkboxes"
77
- :state-name="stateName"
78
- id-property="id"
79
- :sort-as-string="sortAsString"
80
- :rows="items"
81
- :schema="tableSchema"
82
- :sorting="sorting"
83
- :active="activeIds"
84
- :no-select-all="noSelectAll"
85
- :show-actions="showActions"
86
- :indicator-width="indicatorWidth"
87
- v-model="selectedIds"
88
- @row-click="$emit('open', $event)"
89
- @update:sorting="updateSorting($event)"
69
+ ref="table"
70
+ style="--shadow-area-width: 0px;"
71
+ absolute
72
+ striped
73
+ clickable
74
+ column-sorting
75
+ column-resizing
76
+ :indicator-type="indicatorType"
77
+ class="permanent-checkboxes"
78
+ :state-name="stateName"
79
+ id-property="id"
80
+ :sort-as-string="sortAsString"
81
+ :rows="items"
82
+ :schema="tableSchema"
83
+ :sorting="sorting"
84
+ :active="activeIds"
85
+ :no-select-all="noSelectAll"
86
+ :show-actions="showActions"
87
+ :indicator-width="indicatorWidth"
88
+ v-model="selectedIds"
89
+ @row-click="$emit('open', $event)"
90
+ @update:sorting="updateSorting($event)"
90
91
  >
91
92
  <template v-for="(_, name) in $slots" #[name]="slotData">
92
93
  <slot :name="name" v-bind="slotData || {}"/>
@@ -100,15 +101,15 @@
100
101
  </slot>
101
102
 
102
103
  <itf-pagination
103
- class="my-2 px-3"
104
- v-if="showPagination"
105
- show-size
106
- :size="size"
107
- :items="items"
108
- :pages="countPages"
109
- :value="page"
110
- @input="updatePage($event)"
111
- @per-page="updateSizePerPage($event)"
104
+ class="my-2 px-3"
105
+ v-if="showPagination"
106
+ show-size
107
+ :size="size"
108
+ :items="items"
109
+ :pages="countPages"
110
+ :value="page"
111
+ @input="updatePage($event)"
112
+ @per-page="updateSizePerPage($event)"
112
113
  >
113
114
  <template #center>
114
115
  <slot name="pagination-center" />
@@ -118,7 +119,7 @@
118
119
 
119
120
  </template>
120
121
  <script>
121
- import { Vue, ModelSync, Component, Prop, Inject } from 'vue-property-decorator';
122
+ import {Vue, ModelSync, Component, Prop, Inject, PropSync, Watch} from 'vue-property-decorator';
122
123
  import loading from '../../directives/loading';
123
124
  import itfTable from '../table/Table2.vue';
124
125
  import itfFilterPanel from '../filter/FilterPanel.vue';
@@ -132,8 +133,7 @@ export default @Component({
132
133
  name: 'itfView',
133
134
  components: {
134
135
  itfSegmentedControl,
135
- itfDropdown,
136
- itfIcon,
136
+ itfDropdown, itfIcon,
137
137
  itfPagination,
138
138
  itfFilterPanel,
139
139
  itfTableBody,
@@ -149,10 +149,7 @@ class itfView extends Vue {
149
149
 
150
150
  @Prop({ type: Boolean }) loading;
151
151
  @Prop({ type: Array }) filters;
152
- // @Prop({ type: Object, required: true }) schema;
153
152
  @Prop({ type: Object }) schema;
154
- // @Prop({ default: 20 }) size;
155
- // @Prop({ default: 1 }) page;
156
153
  @Prop(String) defaultSorting;
157
154
  @Prop(String) endpoint;
158
155
  @Prop(String) filtersEndpoint;
@@ -219,7 +216,6 @@ class itfView extends Vue {
219
216
  }
220
217
 
221
218
  get tableSchema() {
222
- // return this.tableColumns || this.schema;
223
219
  if (this.tableColumns) {
224
220
  return {
225
221
  properties: this.tableColumns
@@ -232,13 +228,12 @@ class itfView extends Vue {
232
228
  }
233
229
 
234
230
  created() {
235
- // const defaultSize = localStorage.getItem('sizePerPage') ?? 20;
236
- //
237
- // const { page, size, sorting } = this.panel.getPayload() ?? {};
238
- // this.page = page ?? 1;
239
- // this.size = size ?? defaultSize;
240
- // this.sorting = sorting ?? this.defaultSorting;
241
- this.sorting = this.defaultSorting;
231
+ const defaultSize = localStorage.getItem('sizePerPage') ?? 20;
232
+
233
+ const { page, size, sorting } = this.panel.getPayload() ?? {};
234
+ this.page = page ?? 1;
235
+ this.size = size ?? defaultSize;
236
+ this.sorting = sorting ?? this.defaultSorting;
242
237
  }
243
238
 
244
239
  mounted() {