comand-component-library 3.3.85 → 3.3.87

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div
3
- :class="['cmd-table-wrapper', {'collapsed': !showTableData, 'full-width': fullWidth, 'has-caption': hasCaption}]">
3
+ :class="['cmd-table-wrapper', {'collapsed': !showTableData, 'full-width': fullWidth, 'has-caption': hasCaption, 'has-overflow': hasOverflow}]">
4
4
  <div v-if="collapsible || userCanToggleWidth" class="button-wrapper">
5
5
  <a v-if="userCanToggleWidth" class="button"
6
6
  href="#" @click.prevent="fullWidth = !fullWidth"
@@ -20,7 +20,7 @@
20
20
  <!-- end CmdIcon -->
21
21
  </a>
22
22
  </div>
23
- <div class="inner-wrapper">
23
+ <div class="inner-wrapper" ref="innerWrapper">
24
24
  <!-- begin CmdSlideButton -->
25
25
  <CmdSlideButton
26
26
  v-if="showSlideButtons"
@@ -30,7 +30,7 @@
30
30
  <!-- end CmdSlideButton -->
31
31
 
32
32
  <!-- begin table -->
33
- <table ref="table" :class="{'full-width': fullWidth, 'has-overflow': hasOverflow}">
33
+ <table ref="table" :class="{'full-width': fullWidth}">
34
34
  <caption v-if="tableData.caption?.text || caption?.text" :class="{ hidden: hideCaption }">
35
35
  {{ caption?.text || tableData.caption?.text }}
36
36
  </caption>
@@ -76,13 +76,15 @@
76
76
  </template>
77
77
 
78
78
  <script>
79
- import { ref } from 'vue'
79
+ import {ref} from 'vue'
80
+
80
81
  export default {
81
82
  name: "CmdTable",
82
83
  data() {
83
84
  return {
84
85
  showTableData: true,
85
- fullWidth: this.fullWidthOnDefault
86
+ fullWidth: this.fullWidthOnDefault,
87
+ hasOverflow: false
86
88
  }
87
89
  },
88
90
  props: {
@@ -187,6 +189,11 @@ export default {
187
189
  }
188
190
  }
189
191
  },
192
+ mounted() {
193
+ console.log("this.$refs.innerWrapper.clientWidth", this.$refs.innerWrapper.clientWidth)
194
+ console.log("this.$refs.table.clientWidth", this.$refs.table.clientWidth)
195
+ this.hasOverflow = this.$refs.table.clientWidth > this.$refs.innerWrapper.clientWidth
196
+ },
190
197
  computed: {
191
198
  hasCaption() {
192
199
  if (this.hideCaption) {
@@ -198,10 +205,6 @@ export default {
198
205
  },
199
206
  hideCaption() {
200
207
  return this.caption?.show === false || (this.caption?.show !== true && !this.tableData.caption?.show)
201
- },
202
- hasOverflow() {
203
- console.log("this.$refs.table", this.$refs.table)
204
- // return this.$refs.table.scrollWidth > this.$refs.table.clientWidth
205
208
  }
206
209
  },
207
210
  methods: {
@@ -250,11 +253,14 @@ export default {
250
253
  }
251
254
  }
252
255
 
256
+ .cmd-slide-button {
257
+ display: none;
258
+ }
259
+
253
260
  .inner-wrapper {
254
261
  display: flex;
255
262
  overflow-x: auto;
256
263
  width: 100%;
257
- padding: 0 4rem;
258
264
 
259
265
  .cmd-slide-button {
260
266
  left: 0;
@@ -292,6 +298,15 @@ export default {
292
298
  }
293
299
  }
294
300
 
301
+ &.has-overflow {
302
+ .cmd-slide-button {
303
+ display: block;
304
+ }
305
+
306
+ .inner-wrapper {
307
+ padding: 0 4rem;
308
+ }
309
+ }
295
310
  }
296
311
 
297
312
  /* end cmd-table-wrapper ------------------------------------------------------------------------------------------ */
package/src/index.js CHANGED
@@ -6,6 +6,7 @@ export { default as CmdBox } from '@/components/CmdBox.vue'
6
6
  export { default as CmdBoxWrapper } from '@/components/CmdBoxWrapper.vue'
7
7
  export { default as CmdBreadcrumbs } from '@/components/CmdBreadcrumbs.vue'
8
8
  export { default as CmdCompanyLogo } from '@/components/CmdCompanyLogo.vue'
9
+ export { default as CmdContainer } from '@/components/CmdContainer.vue'
9
10
  export { default as CmdCookieDisclaimer } from '@/components/CmdCookieDisclaimer.vue'
10
11
  export { default as CmdCopyrightInformation } from '@/components/CmdCopyrightInformation.vue'
11
12
  export { default as CmdFakeSelect } from '@/components/CmdFakeSelect.vue'