@itfin/components 1.3.96 → 2.0.1

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.
Files changed (85) hide show
  1. package/package.json +1 -1
  2. package/src/assets/scss/_css_variables.scss +2 -2
  3. package/src/assets/scss/_variables.scss +18 -7
  4. package/src/assets/scss/components/_button.scss +10 -0
  5. package/src/assets/scss/components/_pagination.scss +4 -1
  6. package/src/assets/scss/components/_select.scss +1 -3
  7. package/src/assets/scss/components/_text-field.scss +17 -7
  8. package/src/assets/scss/main.scss +36 -2
  9. package/src/components/app/message.js +1 -1
  10. package/src/components/button/Button.vue +4 -2
  11. package/src/components/filter/FilterAmountRange.vue +50 -42
  12. package/src/components/filter/FilterBadge.vue +25 -22
  13. package/src/components/filter/FilterFacetsList.vue +1 -1
  14. package/src/components/filter/FilterPanel.vue +82 -27
  15. package/src/components/filter/index.stories.js +0 -2
  16. package/src/components/icon/Icon.vue +3 -1
  17. package/src/components/icon/components/fi_fingerprint.vue +4 -0
  18. package/src/components/icon/components/nomi-arrow-down.vue +4 -0
  19. package/src/components/icon/components/nomi-arrow-right-top.vue +4 -0
  20. package/src/components/icon/components/nomi-arrow-up.vue +4 -0
  21. package/src/components/icon/components/nomi-arrows.vue +7 -0
  22. package/src/components/icon/components/nomi-calendar-alt.vue +4 -0
  23. package/src/components/icon/components/nomi-calendar.vue +11 -0
  24. package/src/components/icon/components/nomi-card.vue +4 -0
  25. package/src/components/icon/components/nomi-close.vue +5 -0
  26. package/src/components/icon/components/nomi-eye-close.vue +4 -0
  27. package/src/components/icon/components/nomi-eye-open.vue +4 -0
  28. package/src/components/icon/components/nomi-filter.vue +4 -0
  29. package/src/components/icon/components/nomi-hide.vue +4 -0
  30. package/src/components/icon/components/nomi-money.vue +4 -0
  31. package/src/components/icon/components/nomi-move-left.vue +4 -0
  32. package/src/components/icon/components/nomi-move-right.vue +4 -0
  33. package/src/components/icon/components/nomi-person.vue +5 -0
  34. package/src/components/icon/components/nomi-pin.vue +7 -0
  35. package/src/components/icon/components/nomi-sort-asc.vue +7 -0
  36. package/src/components/icon/components/nomi-sort-desc.vue +7 -0
  37. package/src/components/icon/components/nomi-table-view.vue +4 -0
  38. package/src/components/icon/components/nomi-tag.vue +4 -0
  39. package/src/components/icon/components/nomi-target.vue +4 -0
  40. package/src/components/icon/components/nomi-text.vue +6 -0
  41. package/src/components/icon/components/nomi-unpin.vue +7 -0
  42. package/src/components/icon/convert-icons.js +11 -0
  43. package/src/components/icon/icons.js +302 -277
  44. package/src/components/icon/new-icons/arrow-down.svg +3 -0
  45. package/src/components/icon/new-icons/arrow-right-top.svg +3 -0
  46. package/src/components/icon/new-icons/arrow-up.svg +3 -0
  47. package/src/components/icon/new-icons/arrows.svg +6 -0
  48. package/src/components/icon/new-icons/calendar-alt.svg +3 -0
  49. package/src/components/icon/new-icons/calendar.svg +10 -0
  50. package/src/components/icon/new-icons/card.svg +3 -0
  51. package/src/components/icon/new-icons/clear.svg +3 -0
  52. package/src/components/icon/new-icons/close.svg +4 -0
  53. package/src/components/icon/new-icons/eye-close.svg +3 -0
  54. package/src/components/icon/new-icons/eye-open.svg +3 -0
  55. package/src/components/icon/new-icons/filter.svg +3 -0
  56. package/src/components/icon/new-icons/hide.svg +3 -0
  57. package/src/components/icon/new-icons/money.svg +3 -0
  58. package/src/components/icon/new-icons/move-left.svg +3 -0
  59. package/src/components/icon/new-icons/move-right.svg +3 -0
  60. package/src/components/icon/new-icons/person.svg +4 -0
  61. package/src/components/icon/new-icons/pin.svg +6 -0
  62. package/src/components/icon/new-icons/sort-asc.svg +6 -0
  63. package/src/components/icon/new-icons/sort-desc.svg +6 -0
  64. package/src/components/icon/new-icons/table-view.svg +3 -0
  65. package/src/components/icon/new-icons/tag.svg +3 -0
  66. package/src/components/icon/new-icons/target.svg +3 -0
  67. package/src/components/icon/new-icons/text.svg +5 -0
  68. package/src/components/icon/new-icons/unpin.svg +6 -0
  69. package/src/components/pagination/Pagination.vue +3 -2
  70. package/src/components/pagination/Pagination2.vue +176 -0
  71. package/src/components/sortable/draggable.js +2 -1
  72. package/src/components/table/Table2.vue +24 -1
  73. package/src/components/table/TableBody.vue +7 -2
  74. package/src/components/table/TableGroup.vue +8 -4
  75. package/src/components/table/TableHeader.vue +101 -24
  76. package/src/components/table/TableRows.vue +3 -1
  77. package/src/components/table/index.stories.js +22 -200
  78. package/src/components/table/table2.scss +178 -49
  79. package/src/components/text-field/TextField.vue +12 -8
  80. package/src/components/view/View.vue +119 -0
  81. package/src/components/view/index.stories.js +588 -0
  82. package/src/helpers/formatters.js +14 -1
  83. package/src/locales/en.js +13 -0
  84. package/src/locales/uk.js +11 -0
  85. package/src/components/table/TableRow.vue +0 -221
@@ -1,30 +1,35 @@
1
1
  :root {
2
- --itf-table-border-color: #e1e1e1;
3
- --itf-table-header-bg: #f8f8f8;
4
- --itf-table-font-size: 1rem;
5
- --itf-table-selected-bg: #f0f0f0;
6
- --itf-table-active-bg: #e0e0e0;
7
- --itf-table-alt-bg: #f9f9f9;
8
- //--itf-table-border-color: #e1e1e1;
9
- //--itf-table-header-bg: #f9faf5;
10
- //--itf-table-selected-bg: #cbd6f4;
11
- --itf-table-header-bg: #f8f8f8;
12
- --itf-table-border-color: #dbddd1;
13
- --itf-table-hover-header-bg: var(--bs-tertiary-bg);
14
- --itf-table-hover-bg: #f2f2f2;
2
+ --itf-primary: #1A4A97;
3
+ --itf-table-header-font-size: 12px;
4
+ --itf-table-content-font-size: 14px;
5
+ --itf-table-selected-bg: #f9fafc;
6
+ --itf-table-active-bg: #1A4A971A;
7
+ --itf-table-alt-bg: #F9FAFB;
8
+ --itf-table-alt-selected-bg: #eff1f3;
9
+ --itf-table-header-bg: #f5f7f8;
10
+ --itf-table-header-color: #8E97A5;
11
+ --itf-table-mirror-bg: #F2F4F7;
12
+ --itf-table-border-color: transparent; //var(--itf-table-header-bg);
13
+ --itf-table-header-border-color: #8E97A533;
14
+ --itf-table-border-base-color: var(--itf-table-header-bg); // кольори границь таблиці без внутрішніх рядків
15
+ --itf-table-border-base-width: 2px;
16
+ --itf-table-hover-header-bg: #1A4A971A;
17
+ --itf-table-hover-bg: #e9edf5;
15
18
  --itf-table-bg: var(--bs-body-bg);
16
19
  --itf-table-min-width: 45px;
17
20
  --itf-table-input-border-color: #aaaba6;
18
21
  --itf-table-input-focus-border-color: #0028aa;
19
22
  --itf-table-header-subtitle-color: #aeafaa;
20
23
  --itf-table-summary-text: var(--bs-tertiary-color);
24
+ --itf-table-table-border-radius: 1rem;
25
+ --itf-table-header-height: 2.25rem;
21
26
 
22
27
  --group-title-height: 40px;
23
- --table-row-height: 36px;
24
- --table-small-row-size: var(--table-row-height);
28
+ --table-row-height: none;
29
+ --table-small-row-size: 3rem;
25
30
  --shadow-area-width: 12px;
26
31
  --indicator-area-width: 38px;
27
- --hover-bg: var(--bs-tertiary-bg);
32
+ --bs-dropdown-item-border-radius: .5rem;
28
33
  }
29
34
  // dark
30
35
  body[data-theme="dark"] {
@@ -40,7 +45,8 @@ body[data-theme="dark"] {
40
45
  --itf-table-summary-text: #82909d80;
41
46
  }
42
47
  .itf-table2 {
43
- font-size: var(--itf-table-font-size);
48
+ font-size: var(--itf-table-content-font-size, var(--itf-table-font-size));
49
+ position: relative;
44
50
 
45
51
  .scrollable {
46
52
  -webkit-overflow-scrolling: touch;
@@ -50,6 +56,7 @@ body[data-theme="dark"] {
50
56
  .scrollable-x {
51
57
  overflow-x: scroll;
52
58
  padding-right: 4px;
59
+ padding-top: 10px; // щоб drag для колонок був видимий
53
60
  }
54
61
  &.table-absolute {
55
62
  position: absolute;
@@ -92,16 +99,58 @@ body[data-theme="dark"] {
92
99
  pointer-events: none;
93
100
  }
94
101
  .table-header-add-column {
95
- background-image: linear-gradient(90deg, transparent 0, var(--itf-table-header-bg) 10px);
102
+ border-top-right-radius: var(--itf-table-table-border-radius);
103
+ background-image: linear-gradient(90deg, var(--itf-table2-row-bg) 0, var(--itf-table-header-bg) 10px);
96
104
  }
97
105
 
106
+ &__header-icon {
107
+ margin-top: -1px;
108
+ }
109
+ &__drag-column {
110
+ position: absolute;
111
+ top: -.5rem;
112
+ left: 50%;
113
+ transform: translateX(-50%);
114
+ z-index: 100;
115
+ opacity: 0;
116
+ transition: opacity 0.2s;
117
+ cursor: move;
118
+ height: 1.5rem !important;
119
+ padding: 0 !important;
120
+ min-height: auto !important;
121
+ }
122
+ .last-sticky-column {
123
+ position: relative;
124
+ &:after {
125
+ content: "";
126
+ position: absolute;
127
+ right: 0;
128
+ top: 0;
129
+ width: 20px;
130
+ z-index: 1;
131
+ bottom: 5px;
132
+ box-shadow: 0px 4px 20px 0px #0000001A;
133
+ }
134
+ }
98
135
  &__header {
99
- --itf-table2-row-bg: --itf-table-header-bg;
100
- background-color: var(--itf-table-header-bg);
136
+ --itf-table2-row-bg: var(--itf-table-header-bg);
137
+ //background-color: var(--itf-table-header-bg);
101
138
  position: sticky;
102
139
  top: 0;
103
140
  z-index: calc(var(--row-count) + 1);
141
+ font-size: var(--itf-table-header-font-size, var(--itf-table-font-size));
142
+ color: var(--itf-table-header-color);
143
+ text-transform: uppercase;
104
144
 
145
+ .table-view-header-value:hover {
146
+ .itf-table2__drag-column {
147
+ opacity: 1;
148
+ }
149
+ }
150
+
151
+ .table-view-item-value.extra {
152
+ border-top-right-radius: var(--itf-table-table-border-radius);
153
+ }
105
154
  &.no-header {
106
155
  --table-row-height: 0px;
107
156
  --table-small-row-size: 0px;
@@ -113,10 +162,21 @@ body[data-theme="dark"] {
113
162
  }
114
163
  .table-header.draggable-mirror{
115
164
  z-index: 100000001;
116
- background: rgba(235,237,239,0.75);
165
+ border-radius: .25rem;
166
+ border: 1px solid var(--itf-primary);
167
+ color: var(--itf-primary);
168
+ background-color: var(--itf-table-hover-header-bg);
169
+
170
+ .itf-table2__drag-column {
171
+ opacity: 1;
172
+ display: block;
173
+ }
174
+ }
175
+ .itf-table2 & .boundary.right {
176
+ top: var(--itf-table-table-border-radius);
117
177
  }
118
178
  .itf-table2 & .boundary.top, .itf-table2 & .boundary.bottom {
119
- border-color: var(--itf-table-border-color)
179
+ border-color: transparent;// var(--itf-table-border-color)
120
180
  }
121
181
  .table-row-template {
122
182
  display: flex;
@@ -124,6 +184,23 @@ body[data-theme="dark"] {
124
184
  align-items: stretch;
125
185
  height: auto;
126
186
  user-select: none;
187
+ background: var(--itf-table-bg);
188
+ min-height: var(--itf-table-header-height);
189
+
190
+ &:not(.draggable-container--is-dragging) .table-view-header-value {
191
+ z-index: 9;
192
+ }
193
+ &:after {
194
+ content: "";
195
+ position: absolute;
196
+ display: block;
197
+ height: 20px;
198
+ left: 0;
199
+ right: 0;
200
+ top: -20px;
201
+ z-index: 4;
202
+ background: var(--itf-table-bg);
203
+ }
127
204
  }
128
205
  .table-view-header-value {
129
206
  cursor: pointer;
@@ -132,10 +209,9 @@ body[data-theme="dark"] {
132
209
  height: auto;
133
210
  white-space: nowrap;
134
211
  //border-top: 0;
135
- border-top: 1px solid var(--itf-table-border-color);
212
+ //border-top: 1px solid var(--itf-table-border-color);
136
213
  border-left: 0;
137
- border-right: 1px solid var(--itf-table-border-color);
138
- border-bottom: 1px solid var(--itf-table-border-color);
214
+ //border-bottom: 1px solid var(--itf-table-border-color);
139
215
  position: relative;
140
216
  display: flex;
141
217
  min-width: var(--itf-table-min-width);
@@ -143,14 +219,25 @@ body[data-theme="dark"] {
143
219
  //background-color: var(--bs-body-bg);
144
220
  //background-color: rgb(238 238 238 / 1);
145
221
  //font-weight: 500;
146
-
147
- &.last-sticky-column {
148
- border-right-color: var(--bs-border-color);
222
+ &:not(.reserved) {
223
+ border-right: 1px solid var(--itf-table-header-border-color);
224
+ }
225
+ &.active .table-header {
226
+ color: var(--itf-primary);
227
+ background-color: var(--itf-table-hover-header-bg);
149
228
  }
229
+
230
+ //&.last-sticky-column {
231
+ // border-right-color: var(--bs-border-color);
232
+ //}
150
233
  &.reserved {
151
- border-left: 1px solid var(--itf-table-border-color);
234
+ border-left: var(--itf-table-border-base-width) solid var(--itf-table-border-base-color);
152
235
  left: var(--shadow-area-width);
153
236
  width: var(--indicator-area-width);
237
+
238
+ &.sticky {
239
+ border-top-left-radius: var(--itf-table-table-border-radius);
240
+ }
154
241
  }
155
242
  &.sticky {
156
243
  position: sticky;
@@ -160,16 +247,21 @@ body[data-theme="dark"] {
160
247
  }
161
248
  .table-header {
162
249
  flex: 0 0 auto;
163
- overflow: hidden;
250
+ //overflow: hidden;
164
251
  width: 100%;
252
+ height: 100%;
165
253
  text-overflow: ellipsis;
166
- padding-left: 0.75rem;
167
- padding-right: 0.5rem;
168
254
  gap: 0.25rem;
169
255
  align-items: center;
256
+ position: relative;
257
+ z-index: 2;
258
+ background: var(--itf-table-header-bg);
259
+
170
260
  & > div {
261
+ padding: .5rem .75rem;
262
+ height: 100%;
171
263
  min-height: var(--table-row-height);
172
- align-items: center;
264
+ align-items: start;
173
265
  justify-content: space-between;
174
266
  display: flex;
175
267
  }
@@ -179,12 +271,12 @@ body[data-theme="dark"] {
179
271
  }
180
272
  }
181
273
  .resize-handle {
182
- width: 4px;
274
+ width: 2px;
183
275
  bottom: 0;
184
276
  position: absolute;
185
- right: -2px;
277
+ right: -1px;
186
278
  top: 0;
187
- background: #29ACE1;
279
+ background: var(--itf-primary);
188
280
  border-radius: 2px;
189
281
  z-index: 100;
190
282
  opacity: 0;
@@ -226,19 +318,20 @@ body[data-theme="dark"] {
226
318
  }
227
319
  &.active {
228
320
  display: block;
321
+
322
+ .drag-handle {
323
+ opacity: 1;
324
+ }
229
325
  &.over {
230
- background: #47BEFF;
326
+ background: var(--itf-primary);
231
327
  }
232
328
  }
233
329
  }
234
- .draggable-mirror {
235
- opacity: .5;
236
- }
237
330
  .draggable-container--over .table-view-header-space {
238
331
  display: block;
239
332
  }
240
333
  .draggable-container--over .draggable--over .table-view-header-space {
241
- background: #47BEFF;
334
+ background: var(--itf-primary);
242
335
  }
243
336
  .table-view-header-space > .table-view-header-dropzone {
244
337
  position: absolute;
@@ -247,32 +340,61 @@ body[data-theme="dark"] {
247
340
  bottom: 0;
248
341
  left: -50px;
249
342
  }
250
- .table-view-header-value:not(.reserved):hover {
251
- background-color: var(--itf-table-hover-header-bg);
343
+ .table-view-header-value:not(.reserved):hover .table-header {
344
+ color: var(--itf-primary);
345
+ //background-color: var(--itf-table-hover-header-bg);
252
346
  }
253
347
  .draggable-source--is-dragging {
254
- z-index: 100;
348
+ z-index: 1000;
349
+ color: transparent;
350
+ background: var(--itf-table-mirror-bg);
351
+ }
352
+ .draggable-container--is-dragging {
353
+ .itf-table2__drag-column, .resize-handle {
354
+ display: none;
355
+ }
255
356
  }
256
357
  }
257
358
 
359
+ &__title-container, &__header-title, &__title, &__subtitle {
360
+ min-width: 0; // for text ellipsis
361
+ }
258
362
  &__subtitle {
259
363
  color: var(--itf-table-header-subtitle-color);
364
+
365
+ .draggable-source--is-dragging & {
366
+ color: transparent;
367
+ }
260
368
  }
261
369
 
262
370
  .table-view-item {
263
371
  --itf-table2-row-bg: var(--itf-table-bg);
372
+ --itf-table2-border-color: var(--itf-table-border-base-color);
264
373
 
265
374
  background-color: var(--itf-table2-row-bg);
266
375
 
267
- &.selected, &:hover {
376
+ &.selected {
377
+ --itf-table2-border-color: var(--bs-body-color);
378
+ }
379
+ &:hover {
380
+ --itf-table2-row-bg: var(--itf-table-hover-bg) !important;
381
+ }
382
+ &.selected {
268
383
  --itf-table2-row-bg: var(--itf-table-selected-bg) !important;
384
+ &:nth-child(even) {
385
+ --itf-table2-row-bg: var(--itf-table-alt-selected-bg) !important;
386
+ }
387
+
388
+ &:hover {
389
+ --itf-table2-row-bg: var(--itf-table-hover-bg) !important;
390
+ }
269
391
  }
270
392
  &.active {
271
393
  --itf-table2-row-bg: var(--itf-table-active-bg) !important;
272
394
  }
273
395
 
274
396
  .indicator {
275
- border-left: 1px solid var(--itf-table-border-color);
397
+ border-left: var(--itf-table-border-base-width) solid var(--itf-table2-border-color);
276
398
  }
277
399
  }
278
400
 
@@ -283,6 +405,13 @@ body[data-theme="dark"] {
283
405
  }
284
406
  }
285
407
  }
408
+ .table-view-item-value-content {
409
+ position: relative;
410
+ z-index: 2;
411
+ width: 100%;
412
+ height: 100%;
413
+ background: var(--itf-table2-row-bg)
414
+ }
286
415
  .table-view-item-value {
287
416
  text-overflow: ellipsis;
288
417
  align-items: stretch;
@@ -316,9 +445,9 @@ body[data-theme="dark"] {
316
445
  &:after {
317
446
  content: "";
318
447
  height: 100%;
319
- z-index: 100;
448
+ z-index: 1000;
320
449
  width: 2px;
321
- background: #47beff;
450
+ background: var(--itf-primary);
322
451
  margin-left: -1px;
323
452
  position: absolute;
324
453
  left: 0;
@@ -355,7 +484,7 @@ body[data-theme="dark"] {
355
484
 
356
485
  &.right {
357
486
  left: auto;
358
- border-right: 1px solid var(--itf-table-border-color);
487
+ border-right: var(--itf-table-border-base-width) solid var(--itf-table-border-base-color);
359
488
  right: 0;
360
489
  }
361
490
 
@@ -1,9 +1,9 @@
1
1
  <template>
2
2
 
3
- <div class="itf-text-field input-group" :class="{ 'with-addon addon-start': prependIcon, 'with-addon addon-end': clearable }">
3
+ <div class="itf-text-field input-group form-control p-0" :class="{ 'is-invalid': isInvalid(), 'is-valid': isSuccess() }">
4
4
  <slot name="addon">
5
- <div class="addon" v-if="prependIcon">
6
- <itf-icon :name="prependIcon"/>
5
+ <div class="input-group-text" v-if="prependIcon">
6
+ <itf-icon :size="small ? 18 : 20" :name="prependIcon"/>
7
7
  </div>
8
8
  </slot>
9
9
 
@@ -11,7 +11,7 @@
11
11
  ref="input"
12
12
  autocomplete="off"
13
13
  :placeholder="placeholder"
14
- :class="{ 'is-invalid': isInvalid(), 'is-valid': isSuccess(), 'form-control-sm': small }"
14
+ :class="{ 'form-control-sm': small }"
15
15
  class="itf-text-field__input form-control"
16
16
  :type="type"
17
17
  :value="value"
@@ -24,12 +24,13 @@
24
24
  @blur="$emit('blur', $event)"
25
25
  @focus="$emit('focus', $event)"
26
26
  @change="$emit('change', $event.target.value)"
27
+ :maxlength="maxlength"
27
28
  :min="min"
28
29
  :max="max"
29
30
  :step="step"
30
31
  />
31
32
 
32
- <div class="addon-end" v-if="clearable && value">
33
+ <template v-if="clearable && value">
33
34
  <slot name="clear">
34
35
  <itf-button
35
36
  icon
@@ -39,7 +40,7 @@
39
40
  <itf-icon name="close" />
40
41
  </itf-button>
41
42
  </slot>
42
- </div>
43
+ </template>
43
44
  </div>
44
45
 
45
46
  </template>
@@ -64,10 +65,13 @@ class itfTextField extends Vue {
64
65
  @Prop() step;
65
66
  @Prop() min;
66
67
  @Prop() max;
68
+ @Prop() maxlength;
67
69
  @Prop(Boolean) clearable;
68
70
  @Prop(Boolean) disabled;
69
71
  @Prop(Boolean) readonly;
70
72
  @Prop(Boolean) small;
73
+ @Prop(Boolean) invalid;
74
+ @Prop(Boolean) valid;
71
75
  @Prop({ type: String, default: 'text' }) type;
72
76
  @Prop({ type: [Number, String], default: 0 }) delayInput;
73
77
 
@@ -78,11 +82,11 @@ class itfTextField extends Vue {
78
82
  }
79
83
 
80
84
  isInvalid() {
81
- return this.itemLabel && this.itemLabel.isHasError();
85
+ return typeof this.invalid !== 'undefined' ? this.invalid : (this.itemLabel && this.itemLabel.isHasError());
82
86
  }
83
87
 
84
88
  isSuccess() {
85
- return this.itemLabel && this.itemLabel.isHasSuccess();
89
+ return typeof this.valid !== 'undefined' ? this.valid : (this.itemLabel && this.itemLabel.isHasSuccess());
86
90
  }
87
91
 
88
92
  insertTextToCurrentPosition(text) {
@@ -0,0 +1,119 @@
1
+ <template>
2
+
3
+ <div v-loading="loading" class="flex-grow-1 w-100 d-flex flex-column">
4
+ {{filter}}
5
+ <itf-filter-panel
6
+ search-placeholder="Search by text"
7
+ search
8
+ class="py-2 px-3"
9
+ :static-filters="filters"
10
+ v-model="filter"
11
+ @input="$emit('load')"
12
+ >
13
+ <template #after-filter-btn>
14
+ <itf-dropdown v-if="$refs.table" shadow :button-options="{ default: true, icon: true }" autoclose="outside">
15
+ <template #button>
16
+ <itf-icon new name="table-view" />
17
+ </template>
18
+ <div class="dropdown-header">
19
+ {{ $t('components.table.columns') }}
20
+ </div>
21
+ <a v-for="(property, n) of schema.properties" :key="n" href="" @click.stop.prevent="$refs.table.toggleVisibility(property.property)" class="dropdown-item justify-content-between d-flex gap-3">
22
+ <div class="d-flex align-items-center gap-1">
23
+ <itf-icon v-if="property.icon" :size="24" new :name="property.icon" />
24
+ {{property.title.en_US}}
25
+ </div>
26
+
27
+ <itf-icon v-if="$refs.table.getColumnVisibility(property.property)" new :size="24" name="eye-open" />
28
+ <itf-icon v-else new name="eye-close" />
29
+ </a>
30
+ <div class="dropdown-header">
31
+ {{ $t('components.table.actions') }}
32
+ </div>
33
+ <a href="" @click.stop.prevent="$refs.table.resetSettings()" class="dropdown-item justify-content-between d-flex gap-3">
34
+ <div class="d-flex align-items-center gap-1">
35
+ <itf-icon new :size="24" name="download" />
36
+ {{ $t('components.table.resetTableSettings') }}
37
+ </div>
38
+ </a>
39
+ </itf-dropdown>
40
+ </template>
41
+ </itf-filter-panel>
42
+
43
+ <div class="flex-grow-1 px-3 d-flex flex-column">
44
+ <div class="position-relative flex-grow-1">
45
+ <itf-table
46
+ ref="table"
47
+ style="--shadow-area-width: 0px;"
48
+ absolute
49
+ striped
50
+ column-sorting
51
+ column-resizing
52
+ :rows="items"
53
+ :schema="schema"
54
+ >
55
+ <template v-for="(_, name) in $slots" #[name]="slotData">
56
+ <slot :name="name" v-bind="slotData || {}"/>
57
+ </template>
58
+ <template v-for="(_, name) in $scopedSlots" #[name]="slotData">
59
+ <slot :name="name" v-bind="slotData || {}"/>
60
+ </template>
61
+ </itf-table>
62
+ </div>
63
+ </div>
64
+
65
+ <itf-pagination
66
+ class="my-2 px-3"
67
+ show-size
68
+ :size="size"
69
+ :items="items"
70
+ :pages="countPages"
71
+ :value="page"
72
+ @input="$emit('update:page', $event)"
73
+ >
74
+ <template #center>
75
+ <slot name="pagination-center" />
76
+ </template>
77
+ </itf-pagination>
78
+ </div>
79
+
80
+ </template>
81
+ <script>
82
+ import { Vue, Component, Prop } from 'vue-property-decorator';
83
+ import loading from '../../directives/loading';
84
+ import itfTable from '../table/Table2.vue';
85
+ import itfFilterPanel from '../filter/FilterPanel.vue';
86
+ import itfPagination from '../pagination/Pagination2.vue';
87
+ import itfTableBody from "@/components/table/TableBody.vue";
88
+ import itfIcon from "@/components/icon/Icon.vue";
89
+ import itfDropdown from "@/components/dropdown/Dropdown.vue";
90
+
91
+ export default @Component({
92
+ name: 'itfView',
93
+ components: {
94
+ itfDropdown, itfIcon,
95
+ itfPagination,
96
+ itfFilterPanel,
97
+ itfTableBody,
98
+ itfTable
99
+ },
100
+ directives: {
101
+ loading
102
+ }
103
+ })
104
+ class itfView extends Vue {
105
+ @Prop({ type: Boolean }) loading;
106
+ @Prop({ type: Array, required: true }) items;
107
+ @Prop({ type: Array }) filters;
108
+ @Prop({ type: Object, required: true }) schema;
109
+ @Prop({ default: 20 }) size;
110
+ @Prop({ default: 100 }) total;
111
+ @Prop({ default: 1 }) page;
112
+
113
+ filter = {};
114
+
115
+ get countPages() {
116
+ return Math.ceil(this.total / this.size);
117
+ }
118
+ }
119
+ </script>