comand-component-library 4.3.9 → 4.3.11

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": "4.3.9",
3
+ "version": "4.3.11",
4
4
  "license": "GPL-3.0-only",
5
5
  "author": "CoManD-UI",
6
6
  "private": false,
@@ -1855,20 +1855,16 @@
1855
1855
  @click.prevent="openSettingsSidebar('CmdToast')">
1856
1856
  </a>
1857
1857
  </h2>
1858
- <div class="button-wrapper">
1859
- <button type="button" class="button" @click.prevent="toggleToast('modal')">
1860
- <span>Open Toast (as modal)</span>
1861
- </button>
1862
- <button type="button" class="button" @click.prevent="toggleToast">
1863
- <span>Toggle Toast (default)</span>
1864
- </button>
1865
- </div>
1866
- this.showToast: {{ this.showToast }}
1867
1858
  <CmdToast
1868
1859
  message="This is a message!"
1869
- ref="cmdToast"
1870
- @close="toggleToast"
1860
+ ref="CmdToast"
1871
1861
  />
1862
+ <div class="button-wrapper">
1863
+ <button type="button" class="button" @click="$refs.CmdToast.toggleToast()">
1864
+ <span>Toggle Toast</span>
1865
+ </button>
1866
+ </div>
1867
+
1872
1868
  </CmdWidthLimitationWrapper>
1873
1869
  <!-- end toast --------------------------------------------------------------------------------------------------->
1874
1870
 
@@ -2417,21 +2413,6 @@ export default {
2417
2413
  showError() {
2418
2414
  alert("Error")
2419
2415
  },
2420
- toggleToast(type) {
2421
- const dialog = this.$refs.cmdToast
2422
-
2423
- if (!this.showToast) {
2424
- if (type === "modal") {
2425
- dialog.showModal()
2426
- } else {
2427
- dialog.show()
2428
- }
2429
- this.showToast = true
2430
- } else {
2431
- dialog.closeDialog()
2432
- this.showToast = false
2433
- }
2434
- },
2435
2416
  showFancyBox(type, content, ariaLabelText) {
2436
2417
  if (type === "text") {
2437
2418
  openFancyBox({
@@ -288,6 +288,12 @@ a img.flag {
288
288
  }
289
289
  /* end tooltip for cmd-form-element and cmd-fake-select -------------------------------------------------------------------------------------------------------------------- */
290
290
 
291
+ .flex-direction-column {
292
+ > .cmd-form-element, > .cmd-fake-select, > .cmd-input-group {
293
+ align-self: flex-start;
294
+ }
295
+ }
296
+
291
297
  /* ----------------------------------------------- END COMPONENTS AND GLOBAL STYLES --------------------------------------------------- */
292
298
 
293
299
  /* ---------------------------------------------- BEGIN MEDIA QUERIES AND BROWSER SPECIFIC STYLES -------------------------------------------------- */
@@ -22,26 +22,29 @@
22
22
  <span :id="htmlId">{{ labelText }}<sup v-if="$attrs.required !== undefined" aria-hidden="true">*</sup></span>
23
23
 
24
24
  <!-- begin status-icon (linked with tooltip) -->
25
- <a v-if="($attrs.required || inputRequirements.length) && showStatusIcon"
25
+ <button v-if="($attrs.required || inputRequirements.length) && showStatusIcon"
26
26
  href="#"
27
27
  @click.prevent
28
28
  :title="validationTooltip"
29
+ :popovertarget="tooltipPopoverTargetName"
30
+ :aria-describedby="tooltipPopoverTargetName"
29
31
  :aria-errormessage="tooltipId"
30
32
  aria-live="assertive"
31
33
  :id="tooltipId">
32
34
  <!-- begin CmdIcon -->
33
35
  <CmdIcon :iconClass="getStatusIconClass"/>
34
36
  <!-- end CmdIcon -->
35
- </a>
37
+ </button>
36
38
  <!-- end status-icon (linked with tooltip) -->
37
39
 
38
40
  <!-- begin CmdTooltipForFormElements -->
39
41
  <CmdTooltipForFormElements
40
- v-if="useCustomTooltip && (validationStatus === '' || validationStatus === 'error')"
42
+ style="border: 1px solid red;"
41
43
  ref="tooltip"
42
44
  :validationStatus="validationStatus"
43
45
  :validationMessage="getValidationMessage"
44
46
  :relatedId="tooltipId"
47
+ :tooltipPopoverTargetName="tooltipPopoverTargetName"
45
48
  :cmdListOfRequirements="listOfRequirements"
46
49
  :role="validationStatus === 'error' ? 'alert' : 'dialog'"
47
50
  />
@@ -185,6 +188,7 @@ import DefaultMessageProperties from "../mixins/CmdFakeSelect/DefaultMessageProp
185
188
  import FieldValidation from "../mixins/FieldValidation"
186
189
  import Identifier from "../mixins/Identifier"
187
190
  import Tooltip from "../mixins/Tooltip"
191
+ import {createUuid} from "../utils/common.js"
188
192
 
189
193
  export default {
190
194
  name: 'CmdFakeSelect',
@@ -204,6 +208,13 @@ export default {
204
208
  }
205
209
  },
206
210
  props: {
211
+ /**
212
+ * name for popover-target (will be set as id for popover and must correspond popovertarget-value of button that opens the popup)
213
+ */
214
+ tooltipPopoverTargetName: {
215
+ type: String,
216
+ default: 'tooltip-target-' + createUuid()
217
+ },
207
218
  /**
208
219
  * set different default selectbox-types for
209
220
  *
@@ -321,6 +332,15 @@ export default {
321
332
  type: String,
322
333
  default: "/media/images/flags"
323
334
  },
335
+ /**
336
+ * limits drodpwon height of provided value (and lets contentscroll inside)
337
+ *
338
+ * @allowedValues: "none", "an< height in pixels/rem"
339
+ */
340
+ dropdownMaxHeight: {
341
+ type: String,
342
+ default: "20rem"
343
+ },
324
344
  /**
325
345
  * default text if no option is selected (and first option is not used)
326
346
  */
@@ -606,6 +626,11 @@ export default {
606
626
  }
607
627
  }
608
628
  }
629
+
630
+ ul {
631
+ max-height: v-bind(dropdownMaxHeight);
632
+ overflow-y: auto;
633
+ }
609
634
  }
610
635
 
611
636
  &.open {
@@ -38,11 +38,11 @@
38
38
  <!-- end CmdIcon -->
39
39
 
40
40
  <!-- begin default headline-text without slot -->
41
- <span v-if="headlineText" v-html="headlineText"></span>
41
+ <span v-if="headlineText" v-html="headlineText" :class="['text-align-' + textAlign]"></span>
42
42
  <!-- end default headline-text without slot -->
43
43
 
44
44
  <!-- begin headline-text with slot -->
45
- <span v-else>
45
+ <span v-else :class="['text-align-' + textAlign]">
46
46
  <!-- begin slot -->
47
47
  <slot></slot>
48
48
  <!-- end slot -->
@@ -91,13 +91,15 @@
91
91
  <CmdIcon v-if="cmdIcon" v-bind="cmdIcon"/>
92
92
  <!-- end CmdIcon -->
93
93
 
94
- <!-- begin pre-headline-text -->
95
- <span class="pre-headline-text">{{ preHeadlineText }}</span>
96
- <!-- end pre-headline-text -->
94
+ <span :class="['pre-headline-text-wrapper', 'text-align-' + textAlign]">
95
+ <!-- begin pre-headline-text -->
96
+ <span class="pre-headline-text">{{ preHeadlineText }}</span>
97
+ <!-- end pre-headline-text -->
97
98
 
98
- <!-- begin slot -->
99
- <slot>{{ headlineText }}</slot>
100
- <!-- end slot -->
99
+ <!-- begin slot -->
100
+ <slot>{{ headlineText }}</slot>
101
+ <!-- end slot -->
102
+ </span>
101
103
  </component>
102
104
  </template>
103
105
  <component v-else-if="headlineText" :is="headlineTag">
@@ -50,9 +50,10 @@
50
50
 
51
51
  <!-- begin default-login-button -->
52
52
  <button v-if="!showLogin"
53
+ type="button"
53
54
  class="button stretch-on-small-devices"
54
55
  v-bind="buttonLoginWithYourDataDefaultOptions"
55
- @click.prevent="showLogin = true">
56
+ @click="showLogin = true">
56
57
  <!-- begin CmdIcon -->
57
58
  <CmdIcon
58
59
  v-if="buttonLoginWithYourDataDefaultOptions.icon?.iconClass"
@@ -1,22 +1,16 @@
1
1
  <template>
2
2
  <!-- begin CmdToast ---------------------------------------------------------------------------------------- -->
3
- <transition :name="transition">
4
- <dialog class="cmd-toast box" ref="cmdToast">
5
- <slot>
6
- <header>
7
- <CmdHeadline
8
- v-if="cmdHeadlineProps"
9
- v-bind="cmdHeadlineProps"
10
- />
11
- <a href="#" @click.prevent="closeModal">
12
- <CmdIcon v-bind="cmdIconProps" />
13
- </a>
14
- </header>
15
- <p>{{ message }}</p>
16
- this.dialogIsOpen: {{ this.dialogIsOpen }}
17
- </slot>
18
- </dialog>
19
- </transition>
3
+ <div v-if="showToast" class="cmd-toast box" role="status" aria-live="assertive" aria-atomic="true">
4
+ <slot>
5
+ <header>
6
+ <CmdHeadline v-if="cmdHeadlineProps" v-bind="cmdHeadlineProps" />
7
+ <a href="#" @click.prevent="close" :aria-label="cmdIconProps.tooltip">
8
+ <CmdIcon v-bind="cmdIconProps" />
9
+ </a>
10
+ </header>
11
+ <p>{{ message }}</p>
12
+ </slot>
13
+ </div>
20
14
  <!-- end CmdToast ---------------------------------------------------------------------------------------- -->
21
15
  </template>
22
16
 
@@ -25,12 +19,12 @@ export default {
25
19
  name: 'CmdToast',
26
20
  data() {
27
21
  return {
28
- dialogIsOpen: true
22
+ showToast: false
29
23
  }
30
24
  },
31
25
  props: {
32
26
  /**
33
- * message shown in toast
27
+ * message shown inside the toast
34
28
  */
35
29
  message: {
36
30
  type: String,
@@ -65,30 +59,22 @@ export default {
65
59
  tooltip: "Close Toast",
66
60
  ...this?.cmdIcon
67
61
  }
68
- },
69
- transition() {
70
- return this.dialogIsOpen ? 'fade-in' : 'fade-out'
71
62
  }
72
63
  },
73
64
  methods: {
74
- closeModal() {
75
- this.dialogIsOpen = false
76
- this.$emit("close", true);
77
- },
78
- showModal() {
79
- this.dialogIsOpen = true
80
- this.$refs.cmdToast.showModal()
81
- },
82
65
  show() {
83
- this.dialogIsOpen = true
84
- this.$refs.cmdToast.show()
66
+ this.showToast = true
85
67
  },
86
- closeDialog() {
87
- // Close only if the dialog is open; avoids immediate reopen if already closed.
88
- const dialog = this.$refs.cmdToast
89
- if (this.dialogIsOpen === true && dialog && (dialog.open || dialog.hasAttribute?.('open'))) {
90
- dialog.close()
91
- }
68
+ close() {
69
+ this.showToast = false
70
+ },
71
+ toggleToast() {
72
+ this.showToast = !this.showToast
73
+ }
74
+ },
75
+ watch: {
76
+ showToast() {
77
+ this.$emit('status-changed', this.showToast)
92
78
  }
93
79
  }
94
80
  }
@@ -98,12 +84,11 @@ export default {
98
84
  /* begin cmd-toast ---------------------------------------------------------------------------------------- */
99
85
  .cmd-toast {
100
86
  position: fixed;
101
- margin-right: 2rem;
102
- margin-left: auto;
87
+ right: 2rem;
88
+ left: auto;
103
89
  top: auto;
104
90
  bottom: 7rem;
105
91
  z-index: 1000;
106
- transition: margin-right linear 3s;
107
92
 
108
93
  header {
109
94
  display: flex;
@@ -114,12 +99,5 @@ export default {
114
99
  }
115
100
  }
116
101
 
117
- .fade-in {
118
- margin-right: 2rem;
119
- }
120
-
121
- .fade-out {
122
- margin-right: 100%;
123
- }
124
102
  /* end cmd-toast ---------------------------------------------------------------------------------------- */
125
103
  </style>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <!-- begin CmdTooltip ---------------------------------------------------------------------------------------- -->
3
- <div v-if="tooltipVisibility" :class="['cmd-tooltip', validationStatus]" ref="tooltip">
3
+ <div v-if="tooltipVisibility" :class="['cmd-tooltip', validationStatus]" popover ref="tooltip" role="tooltip" :id="popoverTargetName">
4
4
  <div v-if="cmdHeadline || iconClose.show" class="headline-wrapper">
5
5
  <!-- begin CmdHeadline -->
6
6
  <CmdHeadline
@@ -10,12 +10,18 @@
10
10
  <!-- end CmdHeadline -->
11
11
 
12
12
  <!-- begin icon to close tooltip -->
13
- <a v-if="iconClose.show && toggleVisibilityByClick" href="#" @click.prevent="hideTooltip"
14
- :title="iconClose.tooltip">
13
+ <button
14
+ v-if="iconClose.show && toggleVisibilityByClick"
15
+ type="button"
16
+ class="close-tooltip no-style"
17
+ popovertargetaction="hide"
18
+ :popovertarget="popoverTargetName"
19
+ :title="iconClose.tooltip"
20
+ >
15
21
  <!-- begin CmdIcon -->
16
22
  <CmdIcon :iconClass="iconClose.iconClass" :type="iconClose.iconType"/>
17
23
  <!-- end CmdIcon -->
18
- </a>
24
+ </button>
19
25
  <!-- end icon to close tooltip -->
20
26
  </div>
21
27
 
@@ -44,6 +50,13 @@ export default {
44
50
  }
45
51
  },
46
52
  props: {
53
+ /**
54
+ * name for popover-target (will be set as id for popover and must correspond popovertarget-value of button that opens the popup)
55
+ */
56
+ popoverTargetName: {
57
+ type: String,
58
+ required: true
59
+ },
47
60
  /**
48
61
  * properties for CmdHeadline-component
49
62
  */
@@ -122,6 +135,7 @@ export default {
122
135
  }
123
136
  },
124
137
  mounted() {
138
+ /*
125
139
  if (this.relatedId) {
126
140
  const relatedElement = document.getElementById(this.relatedId)
127
141
 
@@ -148,6 +162,7 @@ export default {
148
162
  }
149
163
  }
150
164
  }
165
+ */
151
166
  },
152
167
  methods: {
153
168
  toggleTooltipVisibility(event) {
@@ -203,6 +218,7 @@ export default {
203
218
  }
204
219
  },
205
220
  watch: {
221
+ /*
206
222
  tooltipVisibility() {
207
223
  if (this.tooltipVisibility) {
208
224
  this.$nextTick(() => {
@@ -212,7 +228,7 @@ export default {
212
228
  this.$refs.tooltip.style.top = ((this.pointerY + verticalOffset) / 10) + "rem"
213
229
  })
214
230
  }
215
- }
231
+ }*/
216
232
  }
217
233
  }
218
234
  </script>
@@ -7,6 +7,7 @@
7
7
  :class="validationStatus"
8
8
  :relatedId="relatedId"
9
9
  :scrollContainer="scrollContainerForTooltip"
10
+ :popoverTargetName="popoverTargetName"
10
11
  :toggle-visibility-by-click="true">
11
12
 
12
13
  <!-- begin CmdListOfRequirements -->
@@ -24,6 +25,12 @@
24
25
  export default {
25
26
  name: "CmdTooltipForFormElements",
26
27
  props: {
28
+ /**
29
+ * name for popover-target (will be set as id for popover and must correspond popovertarget-value of button that opens the popup)
30
+ */
31
+ popoverTargetName: {
32
+ type: String
33
+ },
27
34
  /**
28
35
  * specify a scroll-container which scrolling hides the tooltip
29
36
  */