@itfin/components 1.4.13 → 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.13",
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',
@@ -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"
@@ -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() {