comand-component-library 3.3.36 → 3.3.38

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": "comand-component-library",
3
- "version": "3.3.36",
3
+ "version": "3.3.38",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -11,7 +11,8 @@
11
11
  "text": "Internal link",
12
12
  "path": "/content/fancybox-content.html",
13
13
  "tooltip": "Open local file in fancybox",
14
- "fancybox": true
14
+ "fancybox": true,
15
+ "showSubmitButtons": false
15
16
  },
16
17
  {
17
18
  "iconClass": "icon-export",
@@ -32,7 +32,7 @@
32
32
  v-telephone="entry.href">
33
33
  {{ entry.href }}
34
34
  </a>
35
- <template v-else>{{ entry.data }}</template>
35
+ <span v-else v-html="entry.data"></span>
36
36
  </dd>
37
37
  <!-- end data (except for address) -->
38
38
 
@@ -121,7 +121,7 @@
121
121
  </template>
122
122
  <template v-else>{{ entry.href }}</template>
123
123
  </a>
124
- <template v-else-if="!showIconsOnly">{{ entry.data }}</template>
124
+ <span v-else-if="!showIconsOnly" v-html="entry.data"></span>
125
125
  <!-- end all entries except address -->
126
126
 
127
127
  <!-- begin address -->
@@ -17,11 +17,15 @@ export default {
17
17
  data() {
18
18
  return {
19
19
  windowInnerHeight: window.innerHeight,
20
- windowScrollY: window.scrollY,
21
- bodyScrollHeight: document.body.scrollHeight
20
+ windowScrollY: window.scrollY ?? (document.querySelector(this.parentSelector)?.scrollTop || 0),
21
+ scrollHeight: document.querySelector(this.parentSelector)?.scrollHeight || 0
22
22
  }
23
23
  },
24
24
  props: {
25
+ parentSelector: {
26
+ type: String,
27
+ default: "body"
28
+ },
25
29
  /**
26
30
  * icon-class (and shown tooltip on hover) for back to top button
27
31
  *
@@ -39,27 +43,27 @@ export default {
39
43
  }
40
44
  },
41
45
  created() {
42
- window.addEventListener('resize', this.onViewportChange);
43
- window.addEventListener('scroll', this.onViewportChange);
46
+ window.addEventListener('resize', this.onViewportChange)
47
+ window.addEventListener('scroll', this.onViewportChange)
44
48
  },
45
49
  unmounted() {
46
- window.removeEventListener('resize', this.onViewportChange);
47
- window.removeEventListener('scroll', this.onViewportChange);
50
+ window.removeEventListener('resize', this.onViewportChange)
51
+ window.removeEventListener('scroll', this.onViewportChange)
48
52
  },
49
53
  /* watch for changes */
50
54
  computed: {
51
55
  show() {
52
- return this.windowScrollY > 0 && this.windowInnerHeight < this.bodyScrollHeight;
56
+ return this.windowScrollY > 0 && this.windowInnerHeight < this.scrollHeight
53
57
  }
54
58
  },
55
59
  methods: {
56
60
  onViewportChange() {
57
61
  this.windowInnerHeight = window.innerHeight;
58
- this.windowScrollY = window.scrollY;
59
- this.bodyScrollHeight = document.body.scrollHeight;
62
+ this.windowScrollY = window.scrollY ?? (document.querySelector(this.parentSelector)?.scrollTop || 0)
63
+ this.scrollHeight = document.querySelector(this.parentSelector)?.scrollHeight || 0
60
64
  },
61
65
  onBackToTop() {
62
- window.scrollTo({top: 0, left: 0, behavior: 'smooth'});
66
+ window.scrollTo({top: 0, left: 0, behavior: 'smooth'})
63
67
  }
64
68
  }
65
69
  }
@@ -80,9 +80,15 @@ export default {
80
80
  methods: {
81
81
  copyToClipboard(entry) {
82
82
  // get data, remove spaces and copy to clipboard
83
- const output = entry.replace(/\s/g, "")
84
- navigator.clipboard.writeText(output)
85
- alert(output + " was copied to clipboard")
83
+ // navigator.permissions.query({name: "clipboard-write"})
84
+ // .then(result => {
85
+ // if (result.state === "granted" || result.state === "prompt") {
86
+ // const output = entry.replace(/\s/g, "")
87
+ // navigator.clipboard.writeText(output)
88
+ // alert(output + " was copied to clipboard")
89
+ // }
90
+ // })
91
+ // .catch(error => console.error(error))
86
92
  }
87
93
  }
88
94
  }
@@ -139,7 +139,7 @@ export default {
139
139
  executeLink(link, event) {
140
140
  if (link.fancybox) {
141
141
  event.preventDefault()
142
- openFancyBox({url: link.path})
142
+ openFancyBox({url: link.path, showSubmitButtons: link.showSubmitButtons})
143
143
  return
144
144
  }
145
145
  this.$emit("click", {link, originalEvent: event})
@@ -31,7 +31,7 @@
31
31
  <!-- begin CmdMainNavigation -->
32
32
  <CmdMainNavigation
33
33
  v-if="cmdMainNavigation?.navigationEntries?.length && navigationInline"
34
- :navigationEntries="cmdMainNavigation.navigationEntries"
34
+ v-bind="cmdMainNavigation"
35
35
  :closeOffcanvas="closeOffcanvas"
36
36
  />
37
37
  <!-- end CmdMainNavigation -->