@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
@@ -15,7 +15,7 @@
15
15
  data-test="table-header-column"
16
16
  :data-column="n"
17
17
  :data-id="column.Id"
18
- :class="{'sticky': column.pinned, 'last-sticky-column': n === lastPinnedIndex, 'flex-grow-1': column.grow, [`justify-content-${column.align || 'start'}`]: true}"
18
+ :class="{'sticky': column.pinned, 'active': sortColumnParams[column.property], 'last-sticky-column': n === lastPinnedIndex, 'flex-grow-1': column.grow, [`justify-content-${column.align || 'start'}`]: true}"
19
19
  class="table-view-header-value"
20
20
  :style="column.grow ? `left: ${column.left}px; flex-grow: 1` : `width: ${column.width}px; max-width: ${column.width}px; left: ${column.left}px;`">
21
21
  <!-- Не треба видаляти колонки, бо вони потрібні для збереження ширини -->
@@ -29,30 +29,22 @@
29
29
  <div v-if="visibleHeader" group="tablecolumns"
30
30
  class="table-header"
31
31
  @drop="reorderColumns"
32
- v-drag-handle
33
32
  v-draggable="{ handle: true, payload: { index: n, item: column }, mirror: {yAxis:false} }">
34
33
  <itf-dropdown text append-to-body shadow ref="dropdown" class="w-100" :disabled="noColumnMenu">
35
34
  <template #button>
36
- <span class="itf-table2__header-title text-truncate" :title="getTitle(column.title)" :class="{'ms-auto': column.align === 'end'}">
37
- <span v-if="column.icon" :class="column.icon"></span>
38
- {{getTitle(column.title)}}
39
- <div v-if="column.prefix" class="itf-table2__subtitle" v-text="column.prefix" />
40
- </span>
41
- <itf-icon v-if="sortColumnParams[column.property]" :name="sortColumnParams[column.property] === 'asc' ? 'arrow_up' : 'arrow_down'" :size="16" class="ms-1" />
35
+ <div class="itf-table2__header-title d-flex w-100 align-items-start" :title="getTitle(column.title)" :class="{'ms-auto': column.align === 'end'}">
36
+ <itf-icon class="itf-table2__header-icon" new v-if="column.icon" :name="column.icon"></itf-icon>
37
+ <div class="flex-grow-1 w-100 itf-table2__title-container">
38
+ <div class="itf-table2__title text-truncate">{{getTitle(column.title)}}</div>
39
+ <div v-if="column.prefix" class="itf-table2__subtitle text-truncate" v-text="column.prefix" />
40
+ </div>
41
+ </div>
42
+ <itf-icon v-if="sortColumnParams[column.property]" :name="sortColumnParams[column.property] === 'asc' ? 'sort-asc' : 'sort-desc'" new :size="20" class="ms-1" />
42
43
  </template>
43
-
44
- <div v-if="column.sortable">
45
- <a class="dropdown-item d-flex align-items-center" href="javascript:;" @click="sortBy(column, 'asc')">
46
- <itf-icon name="arrow_up" :size="16" class="me-1" />
47
- {{$t('components.table.sortAscending')}}
48
- </a>
49
- </div>
50
- <div v-if="column.sortable">
51
- <a class="dropdown-item d-flex align-items-center" href="javascript:;" @click="sortBy(column, 'desc')">
52
- <itf-icon name="arrow_down" :size="16" class="me-1" />
53
- {{$t('components.table.sortDescending')}}
54
- </a>
44
+ <div class="dropdown-header">
45
+ {{$t('components.table.actions')}}
55
46
  </div>
47
+
56
48
  <div v-if="column.groupable">
57
49
  <a class="dropdown-item d-flex align-items-center" href="javascript:;">
58
50
  <itf-icon name="episodes" :size="16" class="me-1" />
@@ -60,19 +52,84 @@
60
52
  </a>
61
53
  </div>
62
54
  <div>
63
- <a class="dropdown-item d-flex align-items-center" href="javascript:;" @click="togglePinned(n)">
64
- <itf-icon :name="column.pinned ? 'checkbox_checked' : 'checkbox_empty'" :size="16" class="me-1" />
55
+ <a class="dropdown-item d-flex align-items-center gap-1" href="javascript:;" @click="togglePinned(n)">
56
+ <itf-icon v-if="column.pinned" name="pin" new />
57
+ <itf-icon v-else name="pin" new />
58
+
65
59
  <span v-if="column.pinned">{{$t('components.table.unfreezeColumn')}}</span>
66
60
  <span v-else>{{$t('components.table.freezeColumn')}}</span>
67
61
  </a>
68
62
  </div>
69
63
  <div v-if="showAddColumn">
70
- <a class="dropdown-item d-flex align-items-center" href="javascript:;" @click="hideColumn(n)">
71
- <itf-icon name="eye_no" :size="16" class="me-1" />
64
+ <a class="dropdown-item d-flex align-items-center gap-1" href="javascript:;" @click="hideColumn(n)">
65
+ <itf-icon name="hide" new />
66
+
72
67
  {{$t('components.table.hideColumn')}}
73
68
  </a>
74
69
  </div>
70
+ <div v-if="column.filtrable">
71
+ <a class="dropdown-item d-flex align-items-center gap-1" href="javascript:;" @click="$emit('filter', column)">
72
+ <itf-icon name="filter" new />
73
+
74
+ {{$t('components.table.filter')}}
75
+ </a>
76
+ </div>
77
+ <div v-if="canMoveColumn(1, column)">
78
+ <a class="dropdown-item d-flex align-items-center gap-1" href="javascript:;" @click="moveColumn(1, column)">
79
+ <itf-icon name="move-right" new />
80
+
81
+ {{$t('components.table.moveRight')}}
82
+ </a>
83
+ </div>
84
+
85
+ <div v-if="canMoveColumn(-1, column)">
86
+ <a class="dropdown-item d-flex align-items-center gap-1" href="javascript:;" @click="moveColumn(-1, column)">
87
+ <itf-icon name="move-left" new />
88
+
89
+ {{$t('components.table.moveLeft')}}
90
+ </a>
91
+ </div>
92
+
93
+ <template v-if="column.sortable">
94
+ <div class="dropdown-header">
95
+ {{$t('components.table.sorting')}}
96
+ </div>
97
+ <div>
98
+ <a class="dropdown-item d-flex align-items-center gap-1" href="javascript:;" @click="sortBy(column, 'asc')">
99
+ <itf-icon name="sort-asc" new />
100
+ {{$t('components.table.sortAscending')}}
101
+ </a>
102
+ </div>
103
+ <div>
104
+ <a class="dropdown-item d-flex align-items-center gap-1" href="javascript:;" @click="sortBy(column, 'desc')">
105
+ <itf-icon name="sort-desc" new />
106
+ {{$t('components.table.sortDescending')}}
107
+ </a>
108
+ </div>
109
+ </template>
75
110
  </itf-dropdown>
111
+ <div v-if="columnSorting" v-drag-handle class="itf-table2__drag-column">
112
+ <svg width="35" height="23" viewBox="0 0 35 23" fill="none" xmlns="http://www.w3.org/2000/svg">
113
+ <g filter="url(#filter0_d_1081_25763)">
114
+ <rect x="4" y="2" width="27" height="15" rx="4" fill="#1A4A97"/>
115
+ <circle cx="23.5" cy="9.5" r="1.5" fill="white"/>
116
+ <circle cx="17.5" cy="9.5" r="1.5" fill="white"/>
117
+ <circle cx="11.5" cy="9.5" r="1.5" fill="white"/>
118
+ </g>
119
+ <defs>
120
+ <filter id="filter0_d_1081_25763" x="0" y="0" width="35" height="23" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
121
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
122
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
123
+ <feOffset dy="2"/>
124
+ <feGaussianBlur stdDeviation="2"/>
125
+ <feComposite in2="hardAlpha" operator="out"/>
126
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
127
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1081_25763"/>
128
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1081_25763" result="shape"/>
129
+ </filter>
130
+ </defs>
131
+ </svg>
132
+ </div>
76
133
  </div>
77
134
  <div v-if="visibleHeader && n === sortedColumns.length - 1"
78
135
  @enter="columnHighlightLast('enter')"
@@ -238,6 +295,26 @@ class itfTableHeader extends Vue {
238
295
  return this.sortedColumns.findIndex((column) => column.lastPinned);
239
296
  }
240
297
 
298
+ canMoveColumn(direction, column) {
299
+ if (!this.columnSorting) {
300
+ return false;
301
+ }
302
+ const index = this.sortedColumns.findIndex((c) => c === column);
303
+ return (index + direction >= 0 && index + direction < this.sortedColumns.length);
304
+ }
305
+
306
+ moveColumn(direction, column) {
307
+ const index = this.sortedColumns.findIndex((c) => c === column);
308
+ const newIndex = index + direction;
309
+ if (newIndex < 0 || newIndex >= this.sortedColumns.length) {
310
+ return;
311
+ }
312
+ const newValue = [...this.sortedColumns];
313
+ newValue.splice(index, 1);
314
+ newValue.splice(newIndex, 0, column);
315
+ this.$emit('update:columns', newValue);
316
+ }
317
+
241
318
  reorderColumns({ detail }) {
242
319
  const { index: fromIndex } = detail.draggablePayload;
243
320
  const { index: toIndex, last } = detail.dropzonePayload;
@@ -51,8 +51,9 @@
51
51
  v-if="column.visible !== false"
52
52
  :data-column="k"
53
53
  :style="column.grow ? `left: ${column.left}px; flex-grow: 1` : `width: ${column.width}px; max-width: ${column.width}px; left: ${column.left}px;`"
54
- :class="{'justify-content-end': column.align === 'end', 'sticky': column.pinned, 'last-sticky-column': k === lastPinnedIndex, 'flex-grow-1': column.grow, 'px-2': !(column.editable && editable), 'editable': column.editable && editable}"
54
+ :class="{'justify-content-end': column.align === 'end', 'sticky': column.pinned, 'last-sticky-column': k === lastPinnedIndex, 'flex-grow-1': column.grow, 'editable': column.editable && editable}"
55
55
  class="table-view-item-value d-flex h-100">
56
+ <div class="table-view-item-value-content" :class="{'px-2': !(column.editable && editable)}">
56
57
  <slot :name="`column.${column.property}`" :toggle="() => $emit('toggle', item)" :level="level" :editable="column.editable && editable" :item="item" :column="column" :update="(val) => updateValue(item, val, n, column)" :value="getValue(item, column)">
57
58
  <template v-if="column.editable && editable && (!editableProperty || item[editableProperty])">
58
59
  <slot :name="`edit.${column.type}`" :level="level" :toggle="() => $emit('toggle', item)" :update="(val) => updateValue(item, val, n, column)" :value="getValue(item, column)" :item="item" :column="column">
@@ -76,6 +77,7 @@
76
77
  </slot>
77
78
  </div>
78
79
  </slot>
80
+ </div>
79
81
  </div>
80
82
  </template>
81
83
  <div class="table-view-item-value extra"></div>
@@ -2,8 +2,7 @@ import { storiesOf } from '@storybook/vue';
2
2
  import ITFSettings from '../../ITFSettings';
3
3
  import itfApp from '../app/App.vue';
4
4
  import itfButton from '../button/Button.vue';
5
- import itfTable from './Table.vue';
6
- import itfTable2 from './Table2.vue';
5
+ import itfTable from './Table2.vue';
7
6
  import itfSelect from '../select/Select.vue';
8
7
 
9
8
  const exampleData = [{
@@ -79,15 +78,16 @@ ITFSettings.currencies = [
79
78
  ];
80
79
 
81
80
  storiesOf('Common', module)
82
- .add('Simple Table', () => ({
81
+ .add('Table', () => ({
83
82
  components: {
84
- itfTable,
85
83
  itfButton,
86
- itfTable2,
84
+ itfTable,
87
85
  itfSelect
88
86
  },
89
87
  data() {
90
88
  return {
89
+ selectedIds: [],
90
+ sorting: 'Description',
91
91
  list: Array.from({length: 20}).map((_, i) => ({
92
92
  Id: i,
93
93
  text: `Рахунок ✅`,
@@ -140,7 +140,9 @@ storiesOf('Common', module)
140
140
  "title": { "en_US": "Description", "uk_UA": "Прізвище" },
141
141
  "type": "text",
142
142
  "editable": true,
143
- "sortable": false,
143
+ "sortable": true,
144
+ "filtrable": true,
145
+ icon: 'money',
144
146
  width: 200,
145
147
  minWidth: 100,
146
148
  maxWidth: 300
@@ -153,7 +155,7 @@ storiesOf('Common', module)
153
155
  "copy": true,
154
156
  "editable": true,
155
157
  "sortable": false,
156
- icon: 'nom-person',
158
+ icon: 'card',
157
159
  width: 200,
158
160
  minWidth: 100,
159
161
  maxWidth: 300
@@ -164,6 +166,7 @@ storiesOf('Common', module)
164
166
  "type": "money",
165
167
  "editable": true,
166
168
  "sortable": false,
169
+ icon: 'calendar',
167
170
  width: 200,
168
171
  minWidth: 100,
169
172
  maxWidth: 300
@@ -174,6 +177,7 @@ storiesOf('Common', module)
174
177
  "type": "time",
175
178
  "editable": true,
176
179
  "sortable": false,
180
+ icon: 'person',
177
181
  width: 200,
178
182
  minWidth: 100,
179
183
  maxWidth: 300
@@ -182,6 +186,7 @@ storiesOf('Common', module)
182
186
  "property": "Amount",
183
187
  "title": { "en_US": "Amount", "uk_UA": "Прізвище" },
184
188
  "type": "money",
189
+ icon: 'text',
185
190
  "sortable": false,
186
191
  width: 200,
187
192
  minWidth: 100,
@@ -327,13 +332,18 @@ storiesOf('Common', module)
327
332
  }
328
333
  </pre>
329
334
  <h3>Example</h3>
330
- <itf-table2
335
+
336
+ <itf-table
331
337
  add-new-rows
338
+ striped
332
339
  @new="onAdd"
333
340
  state-name="test"
334
341
  :schema="schema"
335
342
  :columns.sync="columns2" :rows="list2"
343
+ v-model="selectedIds"
336
344
  show-summary
345
+ id-property="Id"
346
+ :sorting.sync="sorting"
337
347
  column-sorting column-resizing show-add-column show-grouping @add-column="onAdd">
338
348
  <template #format.employee="{ item }">
339
349
  {{item.EmployeeId}}
@@ -346,14 +356,15 @@ storiesOf('Common', module)
346
356
  :get-option-label="item => item.Name"
347
357
  :options="[{ Id: 1, Name: 'Vitalii Savchuk' }]" />
348
358
  </template>
349
- </itf-table2>
359
+ </itf-table>
350
360
 
351
- <itf-table2
361
+ <itf-table
352
362
  editable
353
363
  add-new-rows
354
364
  @new="onAdd"
355
365
  state-name="test"
356
366
  :schema="schema"
367
+ v-model="selectedIds"
357
368
  :columns.sync="columns2" :rows="list2"
358
369
  show-summary
359
370
  column-sorting column-resizing show-add-column show-grouping @add-column="onAdd">
@@ -368,7 +379,7 @@ storiesOf('Common', module)
368
379
  :get-option-label="item => item.Name"
369
380
  :options="[{ Id: 1, Name: 'Vitalii Savchuk' }]" />
370
381
  </template>
371
- </itf-table2>
382
+ </itf-table>
372
383
 
373
384
  <br />
374
385
  <br />
@@ -396,192 +407,3 @@ storiesOf('Common', module)
396
407
 
397
408
  </div>`,
398
409
  }))
399
-
400
- .add('Table', () => ({
401
- components: {
402
- itfApp,
403
- itfTable,
404
- itfButton
405
- },
406
- data() {
407
- return {
408
- from: '2021-01-16',
409
- to: null,
410
- dates: [],
411
- customDays: {
412
- '2021-10-21': { text: '🎉', class: 'test' }
413
- },
414
-
415
- sorting: {},
416
- columns: [{
417
- text: 'Employee',
418
- name: 'Employee',
419
- min: 250,
420
- max: 250
421
- }, {
422
- text: 'Total',
423
- name: 'Total',
424
- min: 150,
425
- max: 150
426
- }, {
427
- text: 'FTE',
428
- name: 'FTE',
429
- min: 100,
430
- max: 100
431
- }, {
432
- text: 'Position',
433
- name: 'Position',
434
- min: 200,
435
- max: 200
436
- }, {
437
- text: 'Office',
438
- name: 'Office',
439
- min: 150,
440
- max: 150
441
- }, {
442
- text: 'Internal',
443
- name: 'MinutesInternal',
444
- min: 150,
445
- max: 150,
446
- sortable: true
447
- }, {
448
- text: 'External',
449
- name: 'MinutesExternal',
450
- min: 150,
451
- max: 150,
452
- sortable: true
453
- }, {
454
- text: 'Compensation (Internal)',
455
- name: 'AmountInternal',
456
- min: 200,
457
- max: 200
458
- }, {
459
- text: 'Compensation (External)',
460
- name: 'AmountExternal',
461
- min: 150,
462
- max: 150
463
- }, {
464
- text: 'Bonus/Commission',
465
- name: 'AmountShare',
466
- min: 150,
467
- max: 150
468
- }, {
469
- text: 'Actions',
470
- name: 'Notes',
471
- min: 80,
472
- max: 80
473
- }],
474
- list2: [
475
- {
476
- summary: true,
477
- Employee: 'Total asda das dasd ada dad adaddas',
478
- Total: 100,
479
- FTE: 1.0,
480
- Position: 'Developer',
481
- MinutesInternal: '10h 20m',
482
- MinutesExternal: '10h 20m',
483
- AmountInternal: 1000,
484
- AmountExternal: 2000,
485
- AmountShare: 200,
486
- Notes: 'Test'
487
- }
488
- ],
489
- list: [
490
- {
491
- summary: true,
492
- Employee: 'Total',
493
- Total: 100,
494
- FTE: 1.0,
495
- Position: 'Developer',
496
- MinutesInternal: '10h 20m',
497
- MinutesExternal: '10h 20m',
498
- AmountInternal: 1000,
499
- AmountExternal: 2000,
500
- AmountShare: 200,
501
- Notes: 'Test'
502
- },
503
- ...exampleData,
504
- {
505
- summary: true,
506
- Employee: 'Subtotal',
507
- Total: 100,
508
- FTE: 1.0,
509
- Position: 'Developer',
510
- MinutesInternal: '10h 20m',
511
- MinutesExternal: '10h 20m',
512
- AmountInternal: 1000,
513
- AmountExternal: 2000,
514
- AmountShare: 200,
515
- Notes: 'Test'
516
- },
517
- ...exampleData,
518
- {
519
- summary: true,
520
- Employee: 'Subtotal',
521
- Total: 100,
522
- FTE: 1.0,
523
- Position: 'Developer',
524
- MinutesInternal: '10h 20m',
525
- MinutesExternal: '10h 20m',
526
- AmountInternal: 1000,
527
- AmountExternal: 2000,
528
- AmountShare: 200,
529
- Notes: 'Test'
530
- },
531
- ...exampleData
532
- ]
533
- }
534
- },
535
- methods: {
536
- submit() {
537
- this.$refs.form.doValidation();
538
- },
539
- reset() {
540
- this.$refs.form.resetValidation();
541
- }
542
- },
543
- template: `<div>
544
- <p>You need wrap whole application with this tag</p>
545
-
546
- <h2>Usage</h2>
547
-
548
- <pre>
549
-
550
- &lt;itf-datepicker>&lt;/itf-datepicker>
551
-
552
- &lt;button @click="$showSuccess('Success')">Show success&lt;/button>
553
- &lt;button @click="$showError('Error')">Show error&lt;/button>
554
- &lt;button @click="$try(() => { throw new Error('Invalid function'); })">Try function with error&lt;/button>
555
- </pre>
556
-
557
- <h2>With Scroll</h2>
558
-
559
- {{sorting}}
560
-
561
- <itf-button secondary>
562
- <svg height="21" viewBox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" transform="translate(2 5)"><path d="m8.5 11c3.1296136 0 5.9629469-1.83333333 8.5-5.5-2.5370531-3.66666667-5.3703864-5.5-8.5-5.5-3.12961358 0-5.96294692 1.83333333-8.5 5.5 2.53705308 3.66666667 5.37038642 5.5 8.5 5.5z"/><path d="m8.5 2c.18463928 0 .36593924.01429736.54285316.04184538-.02850842.148891-.04285316.30184762-.04285316.45815462 0 1.38071187 1.1192881 2.5 2.5 2.5.156307 0 .3092636-.01434474.4576252-.04178957.0280774.17585033.0423748.35715029.0423748.54178957 0 1.93299662-1.5670034 3.5-3.5 3.5-1.93299662 0-3.5-1.56700338-3.5-3.5s1.56700338-3.5 3.5-3.5z"/></g></svg>
563
- Export
564
- </itf-button>
565
-
566
- <itf-table
567
- small
568
- :sorting.sync="sorting"
569
- sticky-header
570
- sticky-column
571
- sticky-last-column
572
- :columns="columns"
573
- :rows="list"
574
- hoverable
575
- striped
576
- >
577
- <template #column.Employee="{ item }">
578
- {{item.Employee}}
579
- </template>
580
- <template #column.Total.summary="{ item }">
581
- <strong>12</strong><br/>
582
- <small>50% від загальної кількості</small>
583
- </template>
584
- </itf-table>
585
-
586
- </div>`,
587
- }));