@itfin/components 1.2.92 → 1.2.93

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.2.92",
3
+ "version": "1.2.93",
4
4
  "author": "Vitalii Savchuk <esvit666@gmail.com>",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -152,6 +152,9 @@ class itfItemEditor extends Vue {
152
152
  this.$refs.modal.scrollModalTop();
153
153
  return;
154
154
  }
155
+ if (this.loading) {
156
+ return;
157
+ }
155
158
 
156
159
  this.loading = true;
157
160
  this.showError = false;
@@ -0,0 +1,39 @@
1
+ <template>
2
+
3
+ <div class="scrollable scrollable-x big-scrollbar">
4
+ <itf-table-group
5
+ :columns="columns"
6
+ :rows="rows"
7
+ />
8
+ </div>
9
+
10
+ </template>
11
+ <style lang="scss">
12
+ //.scrollable {
13
+ // -webkit-overflow-scrolling: touch;
14
+ // overflow: hidden auto;
15
+ //
16
+ // &.scrollable-x {
17
+ // overflow-x: auto;
18
+ // }
19
+ //}
20
+ </style>
21
+ <script>
22
+ import { Vue, Component, Prop, PropSync } from 'vue-property-decorator';
23
+ import itfButton from '../button/Button.vue';
24
+ import itfIcon from '../icon/Icon.vue';
25
+ import itfTableGroup from './TableGroup.vue';
26
+
27
+ export default @Component({
28
+ name: 'itfTable2',
29
+ components: {
30
+ itfButton,
31
+ itfIcon,
32
+ itfTableGroup
33
+ }
34
+ })
35
+ class itfTable2 extends Vue {
36
+ @Prop({ required: true, type: Array }) columns;
37
+ @Prop({ required: true, type: Array }) rows;
38
+ }
39
+ </script>
@@ -101,6 +101,9 @@
101
101
  background-color: rgb(255 255 255 / 1);
102
102
  border-right: 1px solid rgb(238 238 238 / 1);
103
103
  border-bottom: 1px solid rgb(238 238 238 / 1);
104
+ display: flex;
105
+ align-items: center;
106
+ justify-content: center;
104
107
  }
105
108
 
106
109
  .table-item-inner .boundary {
@@ -174,14 +174,8 @@
174
174
  background-color: rgb(250 251 252 / 1);
175
175
  border-radius: 0.1875rem;
176
176
  }
177
- .vue-recycle-scroller__item-wrapper {
178
- -webkit-box-flex: 1;
179
- -ms-flex: 1;
180
- flex: 1;
181
- -webkit-box-sizing: border-box;
182
- box-sizing: border-box;
183
- overflow: hidden;
184
- position: relative;
177
+ .table-view-wrapper .vue-recycle-scroller__item-wrapper {
178
+ overflow: visible;
185
179
  }
186
180
  .vue-recycle-scroller.direction-vertical .vue-recycle-scroller__item-wrapper {
187
181
  width: 100%;
@@ -7,14 +7,14 @@
7
7
  <div class="table-view-header-value reserved sticky"></div>
8
8
 
9
9
  <div v-for="(column, n) in sortedColumns" :key="n" data-test="table-header-column" :data-column="n" :data-id="column.Id"
10
- class="table-view-header-value" style="width: 100px; left: 0px;">
10
+ class="table-view-header-value" :style="`width: ${column.width}px; left: 0px;`">
11
11
  <div accept-group="tablecolumns" class="table-view-header-space">
12
12
  <div class="table-view-header-dropzone"></div>
13
13
  </div>
14
14
  <div group="tablecolumns" class="table-header draggable-item drag-handle" data-draggable-mirror="{&quot;yAxis&quot;:false}">
15
15
  <a href="" class="context-menu-toggle tw-flex-auto line-overflow">
16
16
  <span title="Name">
17
- <itf-icon name="type_select" :size="16" /> {{n}}
17
+ <itf-icon name="type_select" :size="16" /> {{column.text}}
18
18
  </span>
19
19
  </a>
20
20
  </div>
@@ -161,7 +161,7 @@
161
161
  import { Vue, Component, Prop, PropSync } from 'vue-property-decorator';
162
162
  import itfButton from '../button/Button.vue';
163
163
  import itfIcon from '../icon/Icon.vue';
164
- import { Draggable, Droppable } from '@shopify/draggable';
164
+ import { Draggable, Droppable, Sortable } from '@shopify/draggable';
165
165
 
166
166
  export default @Component({
167
167
  name: 'itfTableHeader',
@@ -172,24 +172,28 @@ export default @Component({
172
172
  })
173
173
  class itfTable extends Vue {
174
174
  @PropSync('columns', { type: Array, default: () => ([]) }) sortedColumns;
175
+ @Prop(Boolean) columnSorting;
176
+ @Prop(Boolean) columnResizing;
175
177
 
176
- mounted() {
177
- const draggable = new Draggable(this.$refs.container, {
178
- draggable: '[group="tablecolumns"]',
178
+ initDraggable() {
179
+ const draggable = new Sortable(this.$refs.container, {
180
+ // draggable: '[group="tablecolumns"]',
181
+ draggable: '[data-test="table-header-column"]',
179
182
  mirror: {
180
183
  yAxis: false,
181
184
  appendTo: this.$refs.container
182
185
  }
183
186
  });
184
- const droppable = new Droppable(this.$refs.container, {
185
- draggable: '[group="tablecolumns"]',
186
- dropzone: '[accept-group="tablecolumns"]'
187
- });
187
+ // const droppable = new Droppable(this.$refs.container, {
188
+ // draggable: '[group="tablecolumns"]',
189
+ // dropzone: '[accept-group="tablecolumns"]'
190
+ // });
188
191
  draggable.on('drag:stop', (event) => {
189
192
  console.info('dropped', event);
190
193
  });
194
+ }
191
195
 
192
- // resize
196
+ initResizing() {
193
197
  const resizeHandle = this.$refs.resizeHandle;
194
198
  resizeHandle.forEach((handle) => {
195
199
  handle.addEventListener('mousedown', (event) => {
@@ -216,6 +220,15 @@ class itfTable extends Vue {
216
220
  });
217
221
  }
218
222
 
223
+ mounted() {
224
+ if (this.columnSorting) {
225
+ this.initDraggable();
226
+ }
227
+ if (this.columnResizing) {
228
+ this.initResizing();
229
+ }
230
+ }
231
+
219
232
  changeColumn(index, params) {
220
233
  console.info(index, params);
221
234
  }
@@ -14,8 +14,7 @@
14
14
  class="ic-drag"></i>
15
15
  </div> <!----></a></div>
16
16
  </div>
17
- <div
18
- class="indicator sticky border-gray dark:border-gray-invert border-r bg-white dark:bg-white-invert border-b ">
17
+ <div class="indicator">
19
18
  <div class="fill on-rest table-view-row-count"><span
20
19
  >1</span></div>
21
20
  <div class="fill on-hover"><a
@@ -2,7 +2,7 @@ import { storiesOf } from '@storybook/vue';
2
2
  import itfApp from '../app/App.vue';
3
3
  import itfButton from '../button/Button.vue';
4
4
  import itfTable from './Table.vue';
5
- import itfTableGroup from './TableGroup.vue';
5
+ import itfTable2 from './Table2.vue';
6
6
 
7
7
  const exampleData = [{
8
8
  Employee: 'Cool',
@@ -77,7 +77,7 @@ storiesOf('Common', module)
77
77
  components: {
78
78
  itfTable,
79
79
  itfButton,
80
- itfTableGroup
80
+ itfTable2
81
81
  },
82
82
  data() {
83
83
  return {
@@ -172,9 +172,7 @@ storiesOf('Common', module)
172
172
 
173
173
  <h3>Example</h3>
174
174
 
175
- <itf-table-group :columns="columns" :rows="list" />
176
-
177
- <itf-table-group :columns="columns" :rows="list" />
175
+ <itf-table2 :columns="columns" :rows="list" />
178
176
 
179
177
  <!--itf-table
180
178
  :columns="columns"