@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,221 +0,0 @@
1
- <template>
2
-
3
- <div
4
- class="table-row-template flex items-stretch" view-settings="[object Object]">
5
- <div accept-group="items" class="table-view-body-space"
6
- ></div>
7
- <div class="bg-light dark:bg-light-invert shadow-area">
8
- <div class="toggler-wrapper"><!----></div>
9
- <div class="handle-wrapper hover-only"><a
10
- href="" class="context-menu-toggle table-item-options-menu"
11
- >
12
- <div class="v-popper--has-tooltip drag-handle"><i
13
- data-test="table-item-options"
14
- class="ic-drag"></i>
15
- </div> <!----></a></div>
16
- </div>
17
- <div class="indicator">
18
- <div class="fill on-rest table-view-row-count"><span
19
- >1</span></div>
20
- <div class="fill on-hover"><a
21
- href=""
22
- data-test="table-item-expand"><i
23
- class="ic-expand"></i></a>
24
- <div class="top"><a
25
- data-test="table-row-generator" href=""><i
26
- class="ic-plus"></i></a>
27
- </div>
28
- <div class=""><a
29
- data-test="table-row-generator"
30
- href=""><i
31
- class="ic-plus"></i></a></div>
32
- </div>
33
- </div>
34
- <div accept-group="items" class="hbox table-item-inner">
35
- <div data-column="0" class="sticky last-sticky-column"
36
- style="width: 240px; left: 83px;">
37
- <div
38
- class="table-view-item-value flex relative h-full border-b border-r border-gray bg-white dark:bg-white-invert dark:border-gray-invert hover:bg-light dark:hover:bg-gray-invert items-stretch"
39
- >
40
- <div
41
- class="flex-auto flex gap-2 items-start p-3 show-hidden-hover overflow-hidden">
42
- <a href=""
43
- class="context-menu-toggle h-full line-overflow cursor-pointer flex-auto"><span>
44
- Jun 30th
45
- </span> <!----></a> <!---->
46
- <div class="flex items-center justify-end hover-show"><a href="" tabindex="0"
47
- class="text-sm p-2 ic-exit"></a>
48
- </div>
49
- </div>
50
- </div>
51
- </div>
52
- <div data-column="1" class="" style="width: 400px;">
53
- <div
54
- class="table-view-item-value flex relative h-full border-b border-r border-gray bg-white dark:bg-white-invert dark:border-gray-invert hover:bg-light dark:hover:bg-gray-invert items-stretch"
55
- ><textarea
56
- data-test="table-text-value" rows="2" type="text"
57
- wrap="hard"
58
- class="h-full px-3 input-inline text-value w-full hide-scrollbar !leading-[35px] whitespace-nowrap"></textarea>
59
- </div>
60
- </div>
61
- <div data-column="2" class="" style="width: 240px;">
62
- <div
63
- class="table-view-item-value flex relative h-full border-b border-r border-gray bg-white dark:bg-white-invert dark:border-gray-invert hover:bg-light dark:hover:bg-gray-invert items-stretch"
64
- >
65
- <div
66
- class="flex-auto flex gap-2 items-start p-3 show-hidden-hover overflow-hidden">
67
- <a href=""
68
- class="context-menu-toggle h-full line-overflow cursor-pointer flex-auto"><span>
69
- Jul 13th
70
- </span> <!----></a> <!---->
71
- <div class="flex items-center justify-end hover-show"><a href="" tabindex="0"
72
- class="text-sm p-2 ic-exit"></a>
73
- </div>
74
- </div>
75
- </div>
76
- </div>
77
- <div data-column="3" class="" style="width: 120px;">
78
- <div
79
- class="table-view-item-value flex relative h-full border-b border-r border-gray bg-white dark:bg-white-invert dark:border-gray-invert hover:bg-light dark:hover:bg-gray-invert items-stretch"
80
- ><a href=""
81
- class="context-menu-toggle table-value-label flex flex-auto p-3 w-full"><span
82
- class="table-value-label-selected w-full h-full vbox"><span
83
- class="flex gap-2 hide-scrollbar overflow-auto"><span
84
- title="Upcoming"
85
- class="label-value"
86
- style="--label-color: #A7E6FF; --label-text: #4C4E69;">
87
- Upcoming
88
- <!----></span></span></span> <!----></a></div>
89
- </div>
90
- <div
91
- class="extra border-b border-r border-gray dark:border-gray-invert"></div>
92
- <div class="boundary top"></div>
93
- <div class="boundary right"></div>
94
- <div class="boundary bottom"></div>
95
- <div class="boundary left"></div> <!----></div>
96
- </div>
97
-
98
- </template>
99
- <script>
100
- import { Vue, Component, Prop, PropSync } from 'vue-property-decorator';
101
- import itfButton from '../button/Button.vue';
102
- import itfIcon from '../icon/Icon.vue';
103
-
104
- export default @Component({
105
- name: 'itfTable',
106
- components: {
107
- itfButton,
108
- itfIcon,
109
- }
110
- })
111
- class itfTable extends Vue {
112
- @PropSync('sorting', { type: Object, default: () => ({}) }) sortedColumns;
113
- @Prop({ required: true, type: Array }) columns;
114
- @Prop({ required: true, type: Array }) rows;
115
- @Prop({ default: false, type: Boolean }) stickyHeader;
116
- @Prop({ default: false, type: Boolean }) stickyColumn;
117
- @Prop({ default: false, type: Boolean }) stickyLastColumn;
118
- @Prop({ default: false, type: Boolean }) loading;
119
- @Prop({ default: false, type: Boolean }) striped;
120
- @Prop({ default: false, type: Boolean }) hoverable;
121
- @Prop({ default: false, type: Boolean }) small;
122
-
123
- sortDirection = 'asc';
124
- scrolledX = false;
125
- scrolledEnd = false;
126
- scrolledY = false;
127
- stickyObserver = null;
128
-
129
- scrollFunc = null;
130
-
131
- mounted() {
132
- if (this.$refs.scrollContainer && this.$refs.scrollContainer2) {
133
- this.scrollFunc = initSyncScroll(this.$refs.scrollContainer, this.$refs.scrollContainer2, (isEnd) => {
134
- this.scrolledX = true;
135
- this.scrolledEnd = isEnd;
136
- }, () => {
137
- this.scrolledX = false;
138
- });
139
- } else {
140
- setTimeout(() => {
141
- this.scrollFunc = initSyncScroll(this.$refs.scrollContainer, this.$refs.scrollContainer2, (isEnd) => {
142
- this.scrolledX = true;
143
- this.scrolledEnd = isEnd;
144
- }, () => {
145
- this.scrolledX = false;
146
- });
147
- }, 1000);
148
- }
149
-
150
- if (this.$refs.stickyHeader) {
151
- this.stickyObserver = new IntersectionObserver(([e]) => {
152
- return this.scrolledY = e.intersectionRatio < 1;
153
- }, {
154
- rootMargin: `-${this.$refs.stickyHeader.offsetHeight + 5}px 0px 0px 0px`,
155
- threshold: [1]
156
- });
157
- this.stickyObserver.observe(this.$refs.stickyHeader);
158
- }
159
- function initSyncScroll(el1, el2, stuck, unstuck) {
160
- function isScrolledEnd(el) {
161
- return el.scrollWidth === el.getBoundingClientRect().width // якщо контейнер менший ширини екрану
162
- || el.scrollLeft === el.scrollWidth - el.getBoundingClientRect().width; // якщо контейнер більший ширини екрану
163
- }
164
-
165
- function func1() {
166
- el2.scrollLeft = el1.scrollLeft;
167
- if (el1.scrollLeft > 0) {
168
- stuck(isScrolledEnd(el1));
169
- } else {
170
- unstuck();
171
- }
172
- }
173
-
174
- function func2() {
175
- el1.scrollLeft = el2.scrollLeft;
176
- if (el2.scrollLeft > 0) {
177
- stuck(isScrolledEnd(el2));
178
- } else {
179
- unstuck();
180
- }
181
- }
182
-
183
- if (isScrolledEnd(el1)) {
184
- stuck(true);
185
- unstuck();
186
- }
187
-
188
- el1.addEventListener('scroll', func1);
189
- el2.addEventListener('scroll', func2);
190
-
191
- return [func1, func2];
192
- }
193
- }
194
-
195
- beforeDestroy() {
196
- if (this.scrollFunc) {
197
- const [func1, func2] = this.scrollFunc;
198
- this.$refs.scrollContainer.removeEventListener('scroll', func1);
199
- this.$refs.scrollContainer2.removeEventListener('scroll', func2);
200
- }
201
- }
202
-
203
- get columnsGridStyle() {
204
- return this.columns.map((column) => {
205
- if (column.min) {
206
- return `minmax(${column.min}px, ${column.max ? `${column.max}px` : 'auto'})`;
207
- }
208
- return `${column.fraction || 1}fr`;
209
- }).join(' ');
210
- }
211
-
212
- sortBy(column, index) {
213
- if (!column.sortable) {
214
- return;
215
- }
216
- const { name } = this.columns[index];
217
- const direction = this.sortedColumns[name] === 'asc' ? 'desc' : 'asc';
218
- this.sortedColumns = { [name]: direction };
219
- }
220
- }
221
- </script>