@itfin/components 1.4.13 → 1.4.15

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.13",
3
+ "version": "1.4.15",
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',
@@ -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;
@@ -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';
@@ -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
 
@@ -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"
@@ -42,11 +42,12 @@
42
42
  </itf-dropdown>
43
43
 
44
44
  <itf-segmented-control
45
- v-if="tabs.length"
45
+ v-if="tabs.length > 1"
46
46
  class="small"
47
- v-model="currentTab"
47
+ :value="currentTab"
48
48
  item-key="value"
49
49
  :items="tabs"
50
+ @input="updateTabs"
50
51
  >
51
52
  <template #item="{ item }">
52
53
  <div class="d-flex align-items-center">
@@ -111,14 +112,14 @@
111
112
  @per-page="updateSizePerPage($event)"
112
113
  >
113
114
  <template #center>
114
- <slot name="pagination-center" />
115
+ <slot name="pagination-center" :totals="totals" />
115
116
  </template>
116
117
  </itf-pagination>
117
118
  </div>
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,14 +149,12 @@ 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;
159
156
  @Prop(String) itemsKey;
157
+ @Prop({ type: String, default: 'totals' }) totalsKey;
160
158
  @Prop(String) panelKey;
161
159
  @Prop(String) stateName;
162
160
  @Prop({ type: String, default: 'checkbox' }) indicatorType;
@@ -185,6 +183,7 @@ class itfView extends Vue {
185
183
  activeIds = [];
186
184
  tableColumns = undefined;
187
185
  _currentTab = null;
186
+ totals = null;
188
187
 
189
188
  @Watch('selectedIds', { deep: true, immediate: true })
190
189
  updateSelectedIds() {
@@ -219,7 +218,6 @@ class itfView extends Vue {
219
218
  }
220
219
 
221
220
  get tableSchema() {
222
- // return this.tableColumns || this.schema;
223
221
  if (this.tableColumns) {
224
222
  return {
225
223
  properties: this.tableColumns
@@ -232,13 +230,12 @@ class itfView extends Vue {
232
230
  }
233
231
 
234
232
  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;
233
+ const defaultSize = localStorage.getItem('sizePerPage') ?? 20;
234
+
235
+ const { page, size, sorting } = this.panel.getPayload() ?? {};
236
+ this.page = page ?? 1;
237
+ this.size = size ?? defaultSize;
238
+ this.sorting = sorting ?? this.defaultSorting;
242
239
  }
243
240
 
244
241
  mounted() {
@@ -280,6 +277,7 @@ class itfView extends Vue {
280
277
  this.size = Number(headers['x-size'] ?? 20);
281
278
  } else {
282
279
  this.items = data[this.itemsKey];
280
+ this.totals = data[this.totalsKey];
283
281
  this.page = data.meta.page;
284
282
  this.total = data.meta.total;
285
283
  this.size = data.meta.size;