@itfin/components 2.0.92 → 2.0.94

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": "2.0.92",
3
+ "version": "2.0.94",
4
4
  "author": "Vitalii Savchuk <esvit666@gmail.com>",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -185,6 +185,7 @@ export interface IPanel {
185
185
  payload: any;
186
186
  nocard?: boolean;
187
187
  isCollapsed: boolean;
188
+ isExpanded: boolean;
188
189
  isCloseable: boolean;
189
190
  isAnimate: boolean;
190
191
  open: (type: string, visOptions: VisualOptions, payload: any) => void;
@@ -258,6 +259,7 @@ export default class PanelList extends Vue {
258
259
  const newStack = [...this.panelsStack];
259
260
  const index = newStack.findIndex(p => p.id === panel.id);
260
261
  newStack[index].isCollapsed = false;
262
+ newStack[index].isExpanded = true;
261
263
  this.panelsStack = newStack;
262
264
  this.ensureOnlyTwoOpenPanels(panel.id);
263
265
  this.setPanelHash();
@@ -279,10 +281,12 @@ export default class PanelList extends Vue {
279
281
  keepOpenIds.push(panel2.id);
280
282
  }
281
283
  if (keepOpenIds.length === 1) {
282
- if (newStack.length - 1 === indexKeep) {
283
- keepOpenIds.push(newStack[indexKeep - 1].id);
284
- } else {
285
- keepOpenIds.push(newStack[indexKeep + 1].id);
284
+ if (!openPanels.find(p => p.id === keepOpenId).isExpanded) {
285
+ if (newStack.length - 1 === indexKeep) {
286
+ keepOpenIds.push(newStack[indexKeep - 1].id);
287
+ } else {
288
+ keepOpenIds.push(newStack[indexKeep + 1].id);
289
+ }
286
290
  }
287
291
  }
288
292
  for (const panel of newStack) {
@@ -292,7 +296,7 @@ export default class PanelList extends Vue {
292
296
  this.panelsStack = newStack;
293
297
  }
294
298
 
295
- async internalOpenPanel(type: string, payload: any = {}, openIndex?: number, noEvents = false) {
299
+ async internalOpenPanel(type: string, payload: any = {}, openIndex?: number, noEvents = false, noExpand = false) {
296
300
  let panel = this.panels[type];
297
301
  if (!panel) {
298
302
  panel = await this.searchPanel(type, this.panels);
@@ -337,7 +341,7 @@ export default class PanelList extends Vue {
337
341
  isAnimation = newStack.length === openIndex;
338
342
  newStack = newStack.slice(0, openIndex);
339
343
  }
340
- if (newStack.length > 0 && !newStack.find(p => !p.isCollapsed)) {
344
+ if (newStack.length > 0 && !newStack.find(p => !p.isCollapsed) && !noExpand) {
341
345
  // якщо немає відкритих панелей, то перша панель має бути розгорнута
342
346
  newStack[0].isCollapsed = false;
343
347
  }
@@ -431,7 +435,7 @@ export default class PanelList extends Vue {
431
435
  openPanel.isCollapsed = false;
432
436
  }
433
437
  const openPanelIndex = this.panelsStack.findIndex(p => p === openPanel);
434
- if (openPanelIndex > 0 && !openPanel?.permanentExpanded) {
438
+ if (openPanelIndex > 0 && !openPanel?.permanentExpanded && !openPanel.isExpanded) {
435
439
  this.panelsStack[openPanelIndex - 1].isCollapsed = false;
436
440
  }
437
441
  this.ensureOnlyTwoOpenPanels(openPanel.id);
@@ -446,6 +450,9 @@ export default class PanelList extends Vue {
446
450
  for (const p of newStack) {
447
451
  p.isLastOpened = !p.isCollapsed && p !== panel;
448
452
  p.isCollapsed = p !== panel;
453
+ if (!p.isCollapsed) {
454
+ p.isExpanded = true;
455
+ }
449
456
  }
450
457
  this.panelsStack = newStack;
451
458
  this.setPanelHash();
@@ -460,6 +467,9 @@ export default class PanelList extends Vue {
460
467
  const newStack = [...this.panelsStack];
461
468
  const index = newStack.findIndex(p => p.id === panel.id);
462
469
  newStack[index].isCollapsed = false;
470
+ for (const p of newStack) {
471
+ p.isExpanded = false;
472
+ }
463
473
  this.panelsStack = newStack;
464
474
  this.ensureOnlyTwoOpenPanels(panel.id);
465
475
  this.setPanelHash();
@@ -471,10 +481,13 @@ export default class PanelList extends Vue {
471
481
  const currenctIndex = newStack.findIndex(p => p.id === panel.id);
472
482
  const lastOpenedIndex = newStack.findIndex(p => p.isLastOpened);
473
483
  if (lastOpenedIndex !== -1) { // якщо зебрежена остання відкрита панель
474
- newStack[lastOpenedIndex].isCollapsed = false
484
+ newStack[lastOpenedIndex].isCollapsed = false;
475
485
  } else if (newStack[currenctIndex-1]) { // якщо після оновлення сторінки відсутнє значення "остання відкрита", то відкриваємо ту, що зліва
476
486
  newStack[currenctIndex-1].isCollapsed = false;
477
487
  }
488
+ for (const p of newStack) {
489
+ p.isExpanded = false;
490
+ }
478
491
  this.panelsStack = newStack;
479
492
  this.ensureOnlyTwoOpenPanels(panel.id);
480
493
  this.setPanelHash();
@@ -511,16 +524,22 @@ export default class PanelList extends Vue {
511
524
  // reuse panel
512
525
  this.panelsStack[panelIndex].payload = panel.payload;
513
526
  this.panelsStack[panelIndex].isCollapsed = panel.isCollapsed;
527
+ this.panelsStack[panelIndex].isExpanded = false;
514
528
  newStack.push(this.panelsStack[panelIndex]);
515
529
  } else {
516
- const resPanel = await this.internalOpenPanel(panel.type, panel.payload, undefined, true);
530
+ const resPanel = await this.internalOpenPanel(panel.type, panel.payload, undefined, true, true);
517
531
  if (resPanel) {
518
532
  resPanel.isCollapsed = panel.isCollapsed;
533
+ resPanel.isExpanded = false;
519
534
  resPanel.isAnimate = false;
520
535
  newStack.push(resPanel);
521
536
  }
522
537
  }
523
538
  }
539
+ const hasExpanded = newStack.length > 1 && newStack.filter(p => !p.isCollapsed).length === 1;
540
+ if (hasExpanded) {
541
+ newStack[newStack.findIndex(p => !p.isCollapsed)].isExpanded = true;
542
+ }
524
543
  this.panelsStack = newStack;
525
544
  this.emitEvent('panels.changed', this.panelsStack);
526
545
  this.updateTitle();
@@ -240,6 +240,9 @@ body[data-theme="dark"] {
240
240
  &:not(.draggable-container--is-dragging):hover .table-view-header-value {
241
241
  z-index: 39;
242
242
  }
243
+ &:not(.draggable-container--is-dragging):hover .sticky {
244
+ z-index: 40;
245
+ }
243
246
  &:after {
244
247
  content: "";
245
248
  position: absolute;