@itfin/components 2.0.7 → 2.0.9

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 (36) hide show
  1. package/package.json +1 -1
  2. package/src/assets/scss/_css_variables.scss +0 -5
  3. package/src/assets/scss/_variables.scss +7 -5
  4. package/src/components/button/Button.vue +1 -1
  5. package/src/components/filter/FilterPanel.vue +15 -3
  6. package/src/components/icon/components/nomi-ai.vue +6 -0
  7. package/src/components/icon/components/nomi-expand.vue +7 -0
  8. package/src/components/icon/components/nomi-eye.vue +4 -0
  9. package/src/components/icon/components/nomi-help.vue +5 -0
  10. package/src/components/icon/components/nomi-logout.vue +5 -0
  11. package/src/components/icon/components/nomi-settings.vue +4 -0
  12. package/src/components/icon/icons.js +302 -296
  13. package/src/components/icon/new-icons/ai.svg +5 -0
  14. package/src/components/icon/new-icons/expand.svg +6 -0
  15. package/src/components/icon/new-icons/eye.svg +3 -0
  16. package/src/components/icon/new-icons/help.svg +4 -0
  17. package/src/components/icon/new-icons/logout.svg +4 -0
  18. package/src/components/icon/new-icons/settings.svg +3 -0
  19. package/src/components/pagination/Pagination2.vue +5 -1
  20. package/src/components/panels/Panel.vue +6 -5
  21. package/src/components/panels/PanelLink.vue +26 -6
  22. package/src/components/panels/PanelList.vue +15 -25
  23. package/src/components/panels/helpers.spec.ts +27 -0
  24. package/src/components/panels/helpers.ts +37 -0
  25. package/src/components/table/Table2.vue +5 -1
  26. package/src/components/table/TableBody.vue +3 -16
  27. package/src/components/table/TableGroup.vue +5 -2
  28. package/src/components/table/TableHeader.vue +20 -8
  29. package/src/components/table/TableRowToggle.vue +50 -0
  30. package/src/components/table/TableRows.vue +13 -24
  31. package/src/components/table/table2.scss +13 -4
  32. package/src/components/tree/TreeEditor.vue +2 -3
  33. package/src/components/view/View.vue +42 -4
  34. package/src/helpers/tree.js +3 -3
  35. package/src/locales/en.js +1 -0
  36. package/src/locales/uk.js +3 -0
@@ -13,7 +13,7 @@
13
13
  --itf-table-header-border-color: #8E97A533;
14
14
  --itf-table-border-base-color: var(--itf-table-header-bg); // кольори границь таблиці без внутрішніх рядків
15
15
  --itf-table-border-base-width: 2px;
16
- --itf-table-hover-header-bg: #1A4A971A;
16
+ --itf-table-hover-header-bg: #dfe5ef;
17
17
  --itf-table-hover-bg: #e9edf5;
18
18
  --itf-table-bg: var(--bs-body-bg);
19
19
  --itf-table-min-width: 45px;
@@ -211,8 +211,8 @@ body[data-theme="dark"] {
211
211
  background: var(--itf-table-bg);
212
212
  min-height: var(--itf-table-header-height);
213
213
 
214
- &:not(.draggable-container--is-dragging) .table-view-header-value {
215
- z-index: 9;
214
+ &:not(.draggable-container--is-dragging):hover .table-view-header-value {
215
+ z-index: 39;
216
216
  }
217
217
  &:after {
218
218
  content: "";
@@ -258,9 +258,11 @@ body[data-theme="dark"] {
258
258
  border-left: var(--itf-table-border-base-width) solid var(--itf-table-border-base-color);
259
259
  left: var(--shadow-area-width);
260
260
  width: var(--indicator-area-width);
261
+ min-width: 1rem;
261
262
 
262
263
  &.sticky {
263
- border-top-left-radius: var(--itf-table-table-border-radius);
264
+ border-top-left-radius: var(--itf-table-table-border-radius);
265
+ z-index: 13;
264
266
  }
265
267
  }
266
268
  &.sticky {
@@ -422,6 +424,13 @@ body[data-theme="dark"] {
422
424
  }
423
425
  }
424
426
 
427
+ &__row-divider {
428
+ background-color: #F7F8FA;
429
+ height: 5px;
430
+ padding: 0;
431
+ border-top: 1px solid rgba(238, 238, 238, 1);
432
+ border-bottom: 1px solid rgba(238, 238, 238, 1);
433
+ }
425
434
  //&:hover, &.permanent-editable-border {
426
435
  // .table-view-item-value.editable {
427
436
  // .form-control {
@@ -457,11 +457,10 @@ export default {
457
457
 
458
458
  let newItems = this.moveItem(this.itemsTrans, nkFrom, nkTo, modeDir, modeInsert);
459
459
  if (this.flat) {
460
- newItems = flattenTree(newItems).map(node => {
461
- node.parentId = node.parentNode ? node.parentNode.id : null;
460
+ newItems = flattenTree(newItems, 4, 0, null, [], this.itemChildren).map(node => {
461
+ node.parentId = node.parentNode ? node.parentNode[this.itemKey] : null;
462
462
  return node;
463
463
  });
464
- console.info(2, newItems);
465
464
  }
466
465
  this.$emit('update:items', newItems);
467
466
  });
@@ -2,12 +2,13 @@
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="Search by text"
5
+ :search-placeholder="searchPlaceholder"
6
6
  search
7
7
  class="py-2 px-3"
8
8
  :endpoint="filtersEndpoint"
9
+ :panel="panel"
9
10
  v-model="filter"
10
- @input="loadData"
11
+ @input="onFilterSet"
11
12
  >
12
13
  <template #after-filter-btn>
13
14
  <itf-dropdown v-if="$refs.table && schema" shadow append-to-context :button-options="{ default: true, icon: true }" class="h-100" autoclose="outside">
@@ -122,6 +123,8 @@ class itfView extends Vue {
122
123
  @Prop(String) filtersEndpoint;
123
124
  @Prop(String) itemsKey;
124
125
  @Prop(String) panelKey;
126
+ @Prop({ type: String, default () { return this.$t('components.table.search'); } }) searchPlaceholder;
127
+ @Prop() panel;
125
128
 
126
129
  page = 1;
127
130
  total = 0;
@@ -134,7 +137,12 @@ class itfView extends Vue {
134
137
  selectedIds = [];
135
138
 
136
139
  created() {
137
- this.sorting = this.defaultSorting;
140
+ const defaultSize = localStorage.getItem('sizePerPage') ?? 20;
141
+
142
+ const { page, size, sorting } = this.panel.getPayload() ?? {};
143
+ this.page = page ?? 1;
144
+ this.size = size ?? defaultSize;
145
+ this.sorting = sorting ?? this.defaultSorting;
138
146
  }
139
147
 
140
148
  mounted() {
@@ -154,6 +162,7 @@ class itfView extends Vue {
154
162
  this.$emit('load', this.filter);
155
163
  this.loadingData = true;
156
164
  await this.$try(async () => {
165
+ console.info('filter', this.filter)
157
166
  const res = await this.$axios.$get(this.endpoint, {
158
167
  params: {
159
168
  ...this.filter,
@@ -179,21 +188,50 @@ class itfView extends Vue {
179
188
  }
180
189
 
181
190
  get countPages() {
182
- return Math.ceil(this.total / this.size);
191
+ return Math.ceil(this.total / this.size) ?? 1;
183
192
  }
184
193
 
185
194
  updateSorting (val) {
186
195
  this.sorting = val;
196
+ this.setPanelPayload({ sorting: val });
187
197
  this.loadData();
188
198
  }
189
199
 
190
200
  updatePage (val) {
191
201
  this.page = val;
202
+ this.setPanelPayload({ page: val });
192
203
  this.loadData();
193
204
  }
194
205
 
195
206
  updateSizePerPage (val) {
207
+ this.page = 1;
196
208
  this.size = val;
209
+ this.setPanelPayload({ page: 1, size: val });
210
+ this.loadData();
211
+ localStorage.setItem('sizePerPage', val);
212
+ }
213
+
214
+ setPanelPayload(payload) {
215
+ this.panel.setPayload(assignWithoutUndefined(this.panel.getPayload(), payload));
216
+
217
+ function assignWithoutUndefined(...sources) {
218
+ const target = {};
219
+ sources.forEach(source => {
220
+ if (source && typeof source === 'object') {
221
+ Object.entries(source).forEach(([key, value]) => {
222
+ if (value !== undefined) {
223
+ target[key] = value;
224
+ }
225
+ });
226
+ }
227
+ });
228
+ return target;
229
+ }
230
+ }
231
+
232
+ onFilterSet(filter) {
233
+ this.page = 1;
234
+ this.setPanelPayload({ ...filter, page: 1 });
197
235
  this.loadData();
198
236
  }
199
237
  }
@@ -6,7 +6,7 @@ function flattenTree (items, spaces = 4, level = 0, parentNode = null, path = []
6
6
  parentNode,
7
7
  level,
8
8
  levelPrefix: String.fromCharCode(0xA0).repeat(level * spaces)
9
- }, ...flattenTree(val[childrenKey] || [], spaces, level + 1, val, [...path, childrenKey, index])), []);
9
+ }, ...flattenTree(val[childrenKey] || [], spaces, level + 1, val, [...path, childrenKey, index], childrenKey)), []);
10
10
  }
11
11
 
12
12
  export
@@ -14,9 +14,9 @@ function buildTree (items, idKey = 'id', parentKey = 'parentId', childrenKey = '
14
14
 
15
15
  const buildNode = (items, id, parent) => items
16
16
  .filter(item => item[parentKey] === parent)
17
- .map(item => ({ ...item, [childrenKey]: buildNode(items, item[idKey], item[idKey]) }));
17
+ .map(item => ({ ...item, [childrenKey]: buildNode(items, item[idKey], item[idKey], childrenKey) }));
18
18
 
19
- return buildNode(items, null, null);
19
+ return buildNode(items, null, null, childrenKey);
20
20
  }
21
21
 
22
22
  export
package/src/locales/en.js CHANGED
@@ -127,6 +127,7 @@ module.exports = {
127
127
  moveLeft: 'Move left',
128
128
  columns: 'Columns',
129
129
  resetTableSettings: 'Reset table settings',
130
+ search: 'Search',
130
131
  },
131
132
  pagination: {
132
133
  itemsPerPage: 'Items per page',
package/src/locales/uk.js CHANGED
@@ -132,6 +132,7 @@ module.exports = {
132
132
  moveLeft: 'Посунути вліво',
133
133
  columns: 'Колонки',
134
134
  resetTableSettings: 'Скинути налаштування таблиці',
135
+ search: 'Пошук',
135
136
  },
136
137
  filter: {
137
138
  search: 'Пошук',
@@ -142,6 +143,8 @@ module.exports = {
142
143
  noResults: 'Немає результатів',
143
144
  showMore: 'показати всі ({count})',
144
145
  hideMore: 'сховати',
146
+ exact: 'Точне значення',
147
+ range: 'Діапазон',
145
148
  filterBy: 'Фільтрувати за',
146
149
  from: 'Від',
147
150
  to: 'До',