comand-component-library 4.0.29 → 4.0.30

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,29 +1,37 @@
1
1
  <template>
2
2
  <div class="cmd-bank-account-data">
3
- <!-- begin CmdHeadline -->
4
- <CmdHeadline v-if="cmdHeadline" v-bind="cmdHeadline" />
5
- <!-- end CmdHeadline -->
3
+ <!-- begin slot -->
4
+ <template v-if="useSlot">
5
+ <slot></slot>
6
+ </template>
7
+ <!-- end slot -->
6
8
 
7
- <!-- begin account data -->
8
- <dl>
9
- <template v-for="(entry, index) in accountData" :key="index">
10
- <dt>{{ entry.text }}</dt>
11
- <dd v-if="allowCopyByClick && entry.allowCopy">
12
- <span>{{ entry.value }}</span>
13
- <a href="#" @click.prevent="copyToClipboard(entry.value)" :title="iconCopy.tooltip">
14
- <!-- begin CmdIcon -->
15
- <CmdIcon :iconClass="iconCopy.iconClass" :type="iconCopy.iconType" />
16
- <!-- end CmdIcon -->
17
- </a>
18
- </dd>
19
- <dd v-else :key="index">{{ entry.value }}</dd>
20
- </template>
21
- </dl>
22
- <!-- end account data -->
9
+ <template v-else>
10
+ <!-- begin CmdHeadline -->
11
+ <CmdHeadline v-if="cmdHeadline" v-bind="cmdHeadline"/>
12
+ <!-- end CmdHeadline -->
23
13
 
24
- <!-- begin additional information -->
25
- <p v-if="additionalInformation">{{ additionalInformation }}</p>
26
- <!-- end additional information -->
14
+ <!-- begin account data -->
15
+ <dl>
16
+ <template v-for="(entry, index) in accountData" :key="index">
17
+ <dt>{{ entry.text }}</dt>
18
+ <dd v-if="allowCopyByClick && entry.allowCopy">
19
+ <span>{{ entry.value }}</span>
20
+ <a href="#" @click.prevent="copyToClipboard(entry.value)" :title="iconCopy.tooltip">
21
+ <!-- begin CmdIcon -->
22
+ <CmdIcon :iconClass="iconCopy.iconClass" :type="iconCopy.iconType"/>
23
+ <!-- end CmdIcon -->
24
+ </a>
25
+ </dd>
26
+ <dd v-else :key="index">{{ entry.value }}</dd>
27
+ </template>
28
+ </dl>
29
+ <!-- end account data -->
30
+
31
+ <!-- begin additional information -->
32
+ <p v-if="additionalInformation">{{ additionalInformation }}</p>
33
+ <!-- end additional information -->
34
+ </template>
27
35
  </div>
28
36
  </template>
29
37
 
@@ -31,6 +39,13 @@
31
39
  export default {
32
40
  name: "CmdBankAccountData",
33
41
  props: {
42
+ /**
43
+ * activate if you want to use slot instead for given structure
44
+ */
45
+ useSlot: {
46
+ type: Boolean,
47
+ default: false
48
+ },
34
49
  /**
35
50
  * bank account data
36
51
  *
@@ -102,5 +117,6 @@ export default {
102
117
  }
103
118
  }
104
119
  }
120
+
105
121
  /* end cmd-bank-account-data ---------------------------------------------------------------------------------------- */
106
122
  </style>
@@ -58,6 +58,7 @@
58
58
 
59
59
  <!-- begin box-body -->
60
60
  <div v-show="open" :class="['box-body', boxBodyClass]" aria-expanded="true" role="article">
61
+ <!-- begin content given slot -->
61
62
  <div v-if="useSlots?.includes('body')"
62
63
  class="inner-box-body-wrapper"
63
64
  :class="{'default-padding': useDefaultPadding, 'allow-scroll': allowContentToScroll}"
@@ -67,12 +68,14 @@
67
68
  <!-- begin slot 'body' -->
68
69
  <slot name="body">
69
70
  <transition-group :name="toggleTransition">
70
- <p :class="{
71
- 'cutoff-text': cutoffTextLines > 0,
72
- 'fade-last-line': fadeLastLine && !showCutOffText,
73
- 'show-text' : showCutOffText
74
- }">
75
- {{ textBody }}
71
+ <p
72
+ :class="{
73
+ 'cutoff-text': cutoffTextLines > 0,
74
+ 'fade-last-line': fadeLastLine && !showCutOffText,
75
+ 'show-text' : showCutOffText
76
+ }"
77
+ v-html='textBody'
78
+ >
76
79
  </p>
77
80
  <a v-if="cutoffTextLines > 0" href="#" @click.prevent="toggleCutOffText">
78
81
  {{
@@ -83,11 +86,17 @@
83
86
  </slot>
84
87
  <!-- end slot 'body' -->
85
88
  </div>
89
+ <!-- end content given slot -->
86
90
 
87
- <template v-else>
91
+ <!-- begin content given by properties -->
92
+ <div v-else
93
+ class="inner-box-body-wrapper"
94
+ :class="{'allow-scroll': allowContentToScroll}"
95
+ >
88
96
  <img v-if="image" :src="image.src" :alt="image.altText"/>
89
97
 
90
- <div v-else :class="{'default-padding': useDefaultPadding, 'allow-scroll': allowContentToScroll}">
98
+ <div v-if="textBody"
99
+ :class="{'default-padding': useDefaultPadding, 'allow-scroll': allowContentToScroll}">
91
100
  <!-- begin CmdHeadline -->
92
101
  <CmdHeadline
93
102
  v-if="cmdHeadline?.headlineText && repeatHeadlineInBoxBody"
@@ -95,9 +104,18 @@
95
104
  />
96
105
  <!-- end CmdHeadline -->
97
106
 
98
- <p v-if="textBody">{{ textBody }}</p>
107
+ <!-- begin textBody -->
108
+ <p v-if="textBody" v-html="textBody"></p>
109
+ <!-- end textBody -->
99
110
  </div>
100
- </template>
111
+
112
+ <!-- begin additionalLink in box-footer -->
113
+ <div v-if="cmdLink?.linkType" class="box-footer">
114
+ <CmdLink v-bind="cmdLink" />
115
+ </div>
116
+ <!-- end additionalLink in box-footer -->
117
+ </div>
118
+ <!-- end content given by properties -->
101
119
  </div>
102
120
  <!-- end box-body -->
103
121
 
@@ -159,18 +177,20 @@
159
177
  <div class="box-header flex-container vertical">
160
178
  <figure v-if="user.image">
161
179
  <img :src="user.image.src" :alt="user.image.alt"/>
162
- <figcaption>{{ user.name }} <span v-if="user.age">, {{ user.age }}</span></figcaption>
180
+ <figcaption v-if="!rowView" class="user-name">{{ user.name }}<span v-if="user.age" class="user-age"> ({{
181
+ user.age
182
+ }})</span></figcaption>
163
183
  </figure>
164
184
  <div v-else>
165
185
  <span :class="defaultProfileIconClass" :title="user.name"></span>
166
- <p v-if="!rowView">{{ user.name }}</p>
186
+ <p v-if="!rowView" class="user-name">{{ user.name }}</p>
167
187
  </div>
168
188
  </div>
169
189
  <!-- end box-header -->
170
190
 
171
191
  <!-- begin box-body -->
172
192
  <div class="box-body">
173
- <p v-if="rowView">{{ user.name }}</p>
193
+ <p v-if="rowView" class="user-name">{{ user.name }}</p>
174
194
  <p v-if="user.profession">{{ user.profession }}</p>
175
195
  <p v-if="user.position">{{ user.position }}</p>
176
196
  <p v-if="user.description" class="description">{{ user.description }}</p>
@@ -178,7 +198,7 @@
178
198
  <!-- end box-body -->
179
199
 
180
200
  <!-- begin user-tags -->
181
- <ul v-if="user.tags && user.tags.length" class="tags">
201
+ <ul v-if="user.tags && user.tags.length" class="tags">
182
202
  <li v-for="(tag, index) in user.tags" :key="index">
183
203
  {{ tag }}
184
204
  </li>
@@ -437,6 +457,13 @@ export default {
437
457
  cmdHeadline: {
438
458
  type: Object,
439
459
  required: false
460
+ },
461
+ /**
462
+ * properties for CmdLink-component to set additional link at bottom of box
463
+ */
464
+ cmdLink: {
465
+ type: Object,
466
+ default: {}
440
467
  }
441
468
  },
442
469
  /*
@@ -474,11 +501,11 @@ export default {
474
501
  // set focus on first input if box contains form-elements
475
502
  setFocus() {
476
503
  this.$nextTick(() => {
477
- if(this.open) {
478
- const firstFormElement = this.$refs.cmdBox.querySelector(":is(input, select, textarea):first-of-type")
504
+ if (this.open) {
505
+ const firstFormElement = this.$refs.cmdBox.querySelector(":is(input, select, textarea):first-of-type")
479
506
 
480
- if(firstFormElement) {
481
- firstFormElement.focus()
507
+ if (firstFormElement) {
508
+ firstFormElement.focus()
482
509
  }
483
510
  }
484
511
  })
@@ -542,7 +569,7 @@ export default {
542
569
  overflow-y: auto;
543
570
 
544
571
  & * {
545
- flex-shrink: 0;
572
+ flex-shrink: 0;
546
573
  }
547
574
  }
548
575
  }
@@ -767,6 +794,15 @@ export default {
767
794
 
768
795
  /* boxType === 'user' */
769
796
  &.user {
797
+ .user-name {
798
+ color: var(--color-scheme-text-color);
799
+ font-size: 2rem;
800
+ }
801
+
802
+ .user-age {
803
+ font-size: var(--default-font-size);
804
+ }
805
+
770
806
  > .box-header {
771
807
  --default-icon-size: 6rem;
772
808
  --box-header-text-color: var(--primary-color);
@@ -779,7 +815,7 @@ export default {
779
815
 
780
816
  img, > div:first-child > [class*="icon-"] {
781
817
  display: table;
782
- margin: 0 auto var(--default-margin) auto;
818
+ margin: 0 auto var(--default-margin) auto !important;
783
819
  padding: calc(var(--default-padding) * 3);
784
820
  border-radius: var(--full-circle);
785
821
  background: var(--box-header-background);
@@ -885,14 +921,6 @@ export default {
885
921
  }
886
922
 
887
923
  &.row-view {
888
- [class*="icon"] {
889
- --default-icon-size: 3rem;
890
- }
891
-
892
- .box-header > div:first-child > [class*="icon-"] {
893
- padding: calc(var(--default-padding) * 1.5);
894
- }
895
-
896
924
  .box-body p {
897
925
  text-align: left;
898
926
  }
@@ -920,4 +948,6 @@ export default {
920
948
  }
921
949
 
922
950
  /* end cmd-box ------------------------------------------------------------------------------------------ */
923
- </style>
951
+ </style>
952
+ <script setup>
953
+ </script>
@@ -1,6 +1,8 @@
1
1
  <template>
2
2
  <div class="cmd-container">
3
+ <div v-html="contentAboveSlot"></div>
3
4
  <slot></slot>
5
+ <div v-html="contentBelowSlot"></div>
4
6
  </div>
5
7
  </template>
6
8
 
@@ -9,6 +11,22 @@ import EditMode from "../mixins/EditMode.vue"
9
11
  export default {
10
12
  name: "CmdContainer",
11
13
  mixins: [EditMode],
14
+ props: {
15
+ /**
16
+ * define html-content to display above slot-content
17
+ */
18
+ contentAboveSlot: {
19
+ type: String,
20
+ required: false
21
+ },
22
+ /**
23
+ * define html-content to display below slot-content
24
+ */
25
+ contentBelowSlot: {
26
+ type: String,
27
+ required: false
28
+ }
29
+ },
12
30
  methods: {
13
31
  addHandlerProvider() {
14
32
  return ""
@@ -1,130 +1,138 @@
1
1
  <template>
2
2
  <transition name="fade">
3
3
  <div class="cmd-cookie-disclaimer flex-container vertical">
4
- <!-- begin CmdHeadline -->
5
- <CmdHeadline
6
- v-if="cmdHeadlineCookieDisclaimer?.show && cmdHeadlineCookieDisclaimer?.headlineText && cmdHeadlineCookieDisclaimer?.headlineLevel"
7
- :headlineText="cmdHeadlineCookieDisclaimer.headlineText"
8
- :headlineLevel="cmdHeadlineCookieDisclaimer.headlineLevel"
9
- />
10
- <!-- end CmdHeadline -->
4
+ <!-- begin slot -->
5
+ <template v-if="useSlot">
6
+ <slot></slot>
7
+ </template>
8
+ <!-- end slot -->
11
9
 
12
- <!-- begin slot for cookie-options -->
13
- <slot name="cookie-options">
14
- <!-- begin required cookies -->
15
- <div v-if="cookieOptions?.required" class="flex-container vertical">
16
- <!-- begin CmdHeadline -->
17
- <CmdHeadline
18
- v-if="cmdBoxRequiredCookies?.showHeadline"
19
- :headline-text="cmdBoxRequiredCookies?.headlineText"
20
- :headline-level="cmdBoxRequiredCookies?.headlineLevel "
21
- />
22
- <!-- end CmdHeadline -->
10
+ <template v-else>
11
+ <!-- begin CmdHeadline -->
12
+ <CmdHeadline
13
+ v-if="cmdHeadlineCookieDisclaimer?.show && cmdHeadlineCookieDisclaimer?.headlineText && cmdHeadlineCookieDisclaimer?.headlineLevel"
14
+ :headlineText="cmdHeadlineCookieDisclaimer.headlineText"
15
+ :headlineLevel="cmdHeadlineCookieDisclaimer.headlineLevel"
16
+ />
17
+ <!-- end CmdHeadline -->
23
18
 
24
- <!-- begin CmdBox -->
25
- <CmdBox v-for="(cookie, index) in cookieOptions.required.cookies || []"
26
- :useSlots="['header', 'body']"
27
- :collapsible="cmdBoxRequiredCookies?.collapsible"
28
- :key="index"
29
- >
30
- <template v-slot:header>
31
- <!-- begin CmdFormElement -->
32
- <CmdFormElement
33
- element="input"
34
- type="checkbox"
35
- v-model="acceptedCookies"
36
- :inputValue="cookie.value"
37
- :labelText="cookie.labelText"
38
- :disabled="cookie.disabled"
39
- :id="cookie.id"
40
- :toggleSwitch="true"
41
- :title="getMessage('cmdcookiedisclaimer.title.cookie_cannot_be_disabled')"
42
- />
43
- <!-- end CmdFormElement -->
44
- </template>
45
- <template v-slot:body>
46
- <p v-if="cookie.description">{{ cookie.description }}</p>
47
- <p v-if="cookie.linkDataPrivacy">
48
- {{ cookie.linkDataPrivacy.label }}
49
- <a @click="openDataPrivacy"
50
- :href="cookie.linkDataPrivacy.link"
51
- :target="cookie.linkDataPrivacy.target">
52
- {{ cookie.linkDataPrivacy.linkText }}
53
- </a>
54
- </p>
55
- <div v-if="dataPrivacyContent" v-html="dataPrivacyContent"></div>
56
- </template>
57
- </CmdBox>
58
- <!-- end CmdBox -->
59
- </div>
60
- <!-- end required cookies -->
19
+ <!-- begin slot for cookie-options -->
20
+ <slot name="cookie-options">
21
+ <!-- begin required cookies -->
22
+ <div v-if="cookieOptions?.required" class="flex-container vertical">
23
+ <!-- begin CmdHeadline -->
24
+ <CmdHeadline
25
+ v-if="cmdBoxRequiredCookies?.showHeadline"
26
+ :headline-text="cmdBoxRequiredCookies?.headlineText"
27
+ :headline-level="cmdBoxRequiredCookies?.headlineLevel "
28
+ />
29
+ <!-- end CmdHeadline -->
30
+
31
+ <!-- begin CmdBox -->
32
+ <CmdBox v-for="(cookie, index) in cookieOptions.required.cookies || []"
33
+ :useSlots="['header', 'body']"
34
+ :collapsible="cmdBoxRequiredCookies?.collapsible"
35
+ :key="index"
36
+ >
37
+ <template v-slot:header>
38
+ <!-- begin CmdFormElement -->
39
+ <CmdFormElement
40
+ element="input"
41
+ type="checkbox"
42
+ v-model="acceptedCookies"
43
+ :inputValue="cookie.value"
44
+ :labelText="cookie.labelText"
45
+ :disabled="cookie.disabled"
46
+ :id="cookie.id"
47
+ :toggleSwitch="true"
48
+ :title="getMessage('cmdcookiedisclaimer.title.cookie_cannot_be_disabled')"
49
+ />
50
+ <!-- end CmdFormElement -->
51
+ </template>
52
+ <template v-slot:body>
53
+ <p v-if="cookie.description">{{ cookie.description }}</p>
54
+ <p v-if="cookie.linkDataPrivacy">
55
+ {{ cookie.linkDataPrivacy.label }}
56
+ <a @click="openDataPrivacy"
57
+ :href="cookie.linkDataPrivacy.link"
58
+ :target="cookie.linkDataPrivacy.target">
59
+ {{ cookie.linkDataPrivacy.linkText }}
60
+ </a>
61
+ </p>
62
+ <div v-if="dataPrivacyContent" v-html="dataPrivacyContent"></div>
63
+ </template>
64
+ </CmdBox>
65
+ <!-- end CmdBox -->
66
+ </div>
67
+ <!-- end required cookies -->
61
68
 
62
- <hr/>
69
+ <hr/>
63
70
 
64
- <!-- begin optional cookies -->
65
- <div v-if="cookieOptions?.optional" class="flex-container vertical">
66
- <!-- begin CmdHeadline -->
67
- <CmdHeadline
68
- v-if="cmdBoxOptionalCookies?.showHeadline"
69
- :headline-text="cmdBoxOptionalCookies?.headlineText"
70
- :headline-level="cmdBoxOptionalCookies?.headlineLevel
71
+ <!-- begin optional cookies -->
72
+ <div v-if="cookieOptions?.optional" class="flex-container vertical">
73
+ <!-- begin CmdHeadline -->
74
+ <CmdHeadline
75
+ v-if="cmdBoxOptionalCookies?.showHeadline"
76
+ :headline-text="cmdBoxOptionalCookies?.headlineText"
77
+ :headline-level="cmdBoxOptionalCookies?.headlineLevel
71
78
  "/>
72
- <!-- end CmdHeadline -->
79
+ <!-- end CmdHeadline -->
73
80
 
74
- <!-- begin CmdBox -->
75
- <CmdBox v-for="(cookie, index) in cookieOptions.optional.cookies || []"
76
- :useSlots="['header', 'body']"
77
- :collapsible="cmdBoxOptionalCookies?.collapsible"
78
- :key="index"
79
- >
80
- <template v-slot:header>
81
- <!-- begin CmdFormElement -->
82
- <CmdFormElement
83
- element="input"
84
- type="checkbox"
85
- v-model="acceptedCookies"
86
- :inputValue="cookie.value"
87
- :labelText="cookie.labelText"
88
- :disabled="cookie.disabled"
89
- :id="cookie.id"
90
- :toggleSwitch="true"
91
- :title="getMessage('cmdcookiedisclaimer.title.toggle_to_accept_cookie')"
92
- />
93
- <!-- end CmdFormElement -->
94
- </template>
95
- <template v-slot:body>
96
- <p v-if="cookie.description">{{ cookie.description }}</p>
97
- <p v-if="cookie.linkDataPrivacy">
98
- {{ cookie.linkDataPrivacy.label }}
99
- <a @click="openDataPrivacy"
100
- :href="cookie.linkDataPrivacy.link"
101
- :target="cookie.linkDataPrivacy.target">
102
- {{ cookie.linkDataPrivacy.linkText }}
103
- </a>
104
- </p>
105
- <div v-if="dataPrivacyContent" v-html="dataPrivacyContent"></div>
106
- </template>
107
- </CmdBox>
108
- <!-- end CmdBox -->
109
- </div>
110
- <!-- end optional cookies -->
111
- </slot>
112
- <!-- end slot for cookie-options -->
81
+ <!-- begin CmdBox -->
82
+ <CmdBox v-for="(cookie, index) in cookieOptions.optional.cookies || []"
83
+ :useSlots="['header', 'body']"
84
+ :collapsible="cmdBoxOptionalCookies?.collapsible"
85
+ :key="index"
86
+ >
87
+ <template v-slot:header>
88
+ <!-- begin CmdFormElement -->
89
+ <CmdFormElement
90
+ element="input"
91
+ type="checkbox"
92
+ v-model="acceptedCookies"
93
+ :inputValue="cookie.value"
94
+ :labelText="cookie.labelText"
95
+ :disabled="cookie.disabled"
96
+ :id="cookie.id"
97
+ :toggleSwitch="true"
98
+ :title="getMessage('cmdcookiedisclaimer.title.toggle_to_accept_cookie')"
99
+ />
100
+ <!-- end CmdFormElement -->
101
+ </template>
102
+ <template v-slot:body>
103
+ <p v-if="cookie.description">{{ cookie.description }}</p>
104
+ <p v-if="cookie.linkDataPrivacy">
105
+ {{ cookie.linkDataPrivacy.label }}
106
+ <a @click="openDataPrivacy"
107
+ :href="cookie.linkDataPrivacy.link"
108
+ :target="cookie.linkDataPrivacy.target">
109
+ {{ cookie.linkDataPrivacy.linkText }}
110
+ </a>
111
+ </p>
112
+ <div v-if="dataPrivacyContent" v-html="dataPrivacyContent"></div>
113
+ </template>
114
+ </CmdBox>
115
+ <!-- end CmdBox -->
116
+ </div>
117
+ <!-- end optional cookies -->
118
+ </slot>
119
+ <!-- end slot for cookie-options -->
113
120
 
114
- <!-- begin slot for privacy-text -->
115
- <slot name="privacy-text"></slot>
116
- <!-- end slot for privacy-text -->
121
+ <!-- begin slot for privacy-text -->
122
+ <slot name="privacy-text"></slot>
123
+ <!-- end slot for privacy-text -->
117
124
 
118
- <!-- begin button-wrapper for 'accept'-buttons -->
119
- <div class="button-wrapper align-center">
120
- <button v-if="buttonLabelAcceptCurrentSettings" type="button" @click="acceptCurrentCookies">
121
- <span>{{ buttonLabelAcceptCurrentSettings }}</span>
122
- </button>
123
- <button v-if="buttonLabelAcceptAllCookies" type="button" class="primary" @click="acceptAllCookies">
124
- <span>{{ buttonLabelAcceptAllCookies }}</span>
125
- </button>
126
- </div>
127
- <!-- end button-wrapper for 'accept'-buttons -->
125
+ <!-- begin button-wrapper for 'accept'-buttons -->
126
+ <div class="button-wrapper align-center">
127
+ <button v-if="buttonLabelAcceptCurrentSettings" type="button" @click="acceptCurrentCookies">
128
+ <span>{{ buttonLabelAcceptCurrentSettings }}</span>
129
+ </button>
130
+ <button v-if="buttonLabelAcceptAllCookies" type="button" class="primary" @click="acceptAllCookies">
131
+ <span>{{ buttonLabelAcceptAllCookies }}</span>
132
+ </button>
133
+ </div>
134
+ <!-- end button-wrapper for 'accept'-buttons -->
135
+ </template>
128
136
  </div>
129
137
  </transition>
130
138
  </template>
@@ -144,6 +152,13 @@ export default {
144
152
  }
145
153
  },
146
154
  props: {
155
+ /**
156
+ * activate if you want to use slot instead for given structure
157
+ */
158
+ useSlot: {
159
+ type: Boolean,
160
+ default: false
161
+ },
147
162
  /**
148
163
  * set default v-model (must be named modelValue in Vue3)
149
164
  */
@@ -175,7 +190,7 @@ export default {
175
190
  showHeadline: true,
176
191
  headlineText: "Required cookies",
177
192
  headlineLevel: 3
178
- }
193
+ }
179
194
  }
180
195
  },
181
196
  /**
@@ -220,8 +235,8 @@ export default {
220
235
  const cookies = this.modelValue ? [...this.modelValue] : []
221
236
  const requiredCookies = this.cookieOptions?.required?.cookies || []
222
237
  for (let i = 0; i < requiredCookies.length; i++) {
223
- if(!cookies.includes(requiredCookies[i].value)) {
224
- cookies.push(requiredCookies[i].value)
238
+ if (!cookies.includes(requiredCookies[i].value)) {
239
+ cookies.push(requiredCookies[i].value)
225
240
  }
226
241
  }
227
242
  return cookies