@itfin/components 1.3.65 → 1.3.66

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": "1.3.65",
3
+ "version": "1.3.66",
4
4
  "author": "Vitalii Savchuk <esvit666@gmail.com>",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -14,12 +14,13 @@ $dark-tooltip-color: #7b52eb;
14
14
  --itf-tooltip-shadow: 0 0 20px 4px rgba(87, 78, 101, 0.15), 0 4px 80px -8px rgba(211, 208, 219, 0.25), 0 4px 4px -2px rgba(156, 150, 164, 0.15);
15
15
  --itf-tooltip-color: #{$dark-body-color};
16
16
  --itf-tooltip-bg-color: #{$dark-tooltip-color};
17
+ --itf-tooltip-font-size: 0.875rem;
17
18
  }
18
19
 
19
20
  .tippy-box[data-theme~=itfin] {
20
21
  color: var(--itf-tooltip-color);
21
22
  background-color: var(--itf-tooltip-bg-color);
22
- font-size: 12px;
23
+ font-size: var(--itf-tooltip-font-size);
23
24
  border-radius: 5px;
24
25
  box-shadow: var(--itf-tooltip-shadow);
25
26
  padding: 5px;
@@ -140,6 +140,7 @@ class Panel extends Vue {
140
140
  @Prop(Boolean) collapsed;
141
141
  @Prop(Boolean) closeable;
142
142
  @Prop(Boolean) expandable;
143
+ @Prop(Boolean) animate;
143
144
 
144
145
  expandPanel() {
145
146
  this.$emit('expand');
@@ -1,6 +1,12 @@
1
1
  <template>
2
2
  <div class="b-panel-list-container">
3
- <div class="b-panel-list">
3
+ <transition-group
4
+ name="slide"
5
+ tag="div"
6
+ class="b-panel-list"
7
+ @before-enter="addAnimateClass"
8
+ @before-leave="beforeLeave"
9
+ >
4
10
  <template v-for="(panel, n) of panelsStack">
5
11
  <panel
6
12
  :key="n"
@@ -10,6 +16,7 @@
10
16
  :expandable="panelsStack.length > 1"
11
17
  :collapsed="panel.isCollapsed"
12
18
  :closeable="panel.isCloseable"
19
+ :animate="panel.isAnimate"
13
20
  @expand="expandPanel(panel)"
14
21
  @fullsize="fullsizePanel(panel)"
15
22
  @close="closePanel(panel)"
@@ -66,10 +73,10 @@
66
73
  </template>
67
74
  </panel>
68
75
  </template>
69
- </div>
76
+ </transition-group>
70
77
  </div>
71
78
  </template>
72
- <style>
79
+ <style lang="scss">
73
80
  .b-panel-list-container {
74
81
  width: 100%;
75
82
  height: 100%;
@@ -88,6 +95,45 @@
88
95
  right: 0;
89
96
  top: 0;
90
97
  }
98
+
99
+ $an-time: .1s;
100
+ $double-an-time: $an-time * 2;
101
+
102
+ .animate.slide-enter-active {
103
+ min-width: 0 !important;
104
+ /* подвоюємо час, для коректної швидкості анімації, у випадку якщо max-width застосовуємо тільки на половину */
105
+ animation: $double-an-time linear slidein forwards;
106
+ }
107
+ .animate.slide-leave-active {
108
+ min-width: 0 !important;
109
+ /* подвоюємо час, для коректної швидкості анімації, у випадку якщо max-width застосовуємо тільки на половину */
110
+ animation: $double-an-time linear slidein reverse;
111
+ }
112
+
113
+ @keyframes slidein {
114
+ 0% {
115
+ max-width: 0;
116
+ }
117
+ 100% {
118
+ max-width: 100%;
119
+ }
120
+ }
121
+
122
+ .b-panel {
123
+ transition: min-width $an-time linear, flex-grow $an-time linear;
124
+
125
+ > div {
126
+ transition: opacity $an-time linear;
127
+ }
128
+ }
129
+
130
+ .slide-enter-active > div {
131
+ opacity: 0;
132
+ }
133
+
134
+ .opacity-null > div {
135
+ opacity: 0 !important;
136
+ }
91
137
  </style>
92
138
  <script lang="ts">
93
139
  import { Vue, Component, Prop } from 'vue-property-decorator';
@@ -137,6 +183,7 @@ export default class PanelList extends Vue {
137
183
 
138
184
  nextId:number = 0;
139
185
 
186
+
140
187
  created() {
141
188
  if (this.firstPanel) {
142
189
  this.internalOpenPanel(this.firstPanel.type, this.firstPanel.payload);
@@ -211,13 +258,16 @@ export default class PanelList extends Vue {
211
258
  newPanel.isCloseable = false;
212
259
  }
213
260
  let newStack = [...this.panelsStack];
261
+ let isAnimation = true;
214
262
  if (openIndex) {
263
+ isAnimation = newStack.length === openIndex;
215
264
  newStack = newStack.slice(0, openIndex);
216
265
  }
217
266
  this.panelsStack = newStack;
218
267
  return new Promise(res => {
219
268
  this.$nextTick(() => { // щоб панелі змінювались при редагуванні
220
269
  const n = newStack.length;
270
+ newPanel.isAnimate = isAnimation;
221
271
  newPanel.emit = (event, ...args) => this.emitEvent(event, ...args);
222
272
  newPanel.open = (type, payload) => this.openPanel(type, payload, n + 1);
223
273
  newPanel.close = () => this.closePanel(newPanel);
@@ -332,5 +382,16 @@ export default class PanelList extends Vue {
332
382
  this.panelsStack = this.panelsStack.slice(0, 1);
333
383
  }
334
384
  }
385
+
386
+ beforeLeave (element) {
387
+ element.classList.add('opacity-null');
388
+ this.addAnimateClass(element);
389
+ }
390
+
391
+ addAnimateClass(element) {
392
+ if (element.__vue__.$options.propsData.animate) {
393
+ element.classList.add('animate');
394
+ }
395
+ }
335
396
  }
336
397
  </script>
@@ -1,6 +1,11 @@
1
1
  <template>
2
2
 
3
- <div class="itf-table2 scrollable scrollable-x" :class="{'table-striped': striped, 'table-absolute': absolute, 'permanent-checkboxes': selectedIds.length}" :style="{ '--indicator-area-width': `${indicatorType === 'none' ? 1 : indicatorWidth}px` }">
3
+ <div class="itf-table2 scrollable scrollable-x" :class="{
4
+ 'table-striped': striped,
5
+ 'table-absolute': absolute,
6
+ 'table-clickable': clickable,
7
+ 'permanent-checkboxes': selectedIds.length
8
+ }" :style="{ '--indicator-area-width': `${indicatorType === 'none' ? 1 : indicatorWidth}px` }">
4
9
  <itf-checkbox-group v-model="selectedIds">
5
10
  <template v-for="(group, index) in groups">
6
11
  <div class="table-view-body">
@@ -103,6 +108,7 @@ class itfTable2 extends Vue {
103
108
  @Prop(Boolean) expandedAll;
104
109
  @Prop(Boolean) striped;
105
110
  @Prop(Boolean) absolute;
111
+ @Prop(Boolean) clickable;
106
112
 
107
113
  state = {
108
114
  selectedIds: [],
@@ -57,6 +57,11 @@ body[data-theme="dark"] {
57
57
  --itf-table2-row-bg: var(--itf-table-alt-bg);
58
58
  }
59
59
  }
60
+ &.table-clickable {
61
+ .table-view-item {
62
+ cursor: pointer;
63
+ }
64
+ }
60
65
 
61
66
  &__header {
62
67
  background-color: var(--itf-table-header-bg);