comand-component-library 3.3.10 → 3.3.11

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "comand-component-library",
3
- "version": "3.3.10",
3
+ "version": "3.3.11",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "publish": "npm publish",
package/src/App.vue CHANGED
@@ -998,16 +998,8 @@
998
998
  <CmdWidthLimitationWrapper>
999
999
  <h2 class="headline-demopage">Image-Zoom</h2>
1000
1000
  <CmdImageZoom
1001
- :imageSmall="{
1002
- src: 'media/images/content-images/logo-business-edition-landscape.jpg',
1003
- alt: 'Alternative text',
1004
- tooltip: 'Tooltip'
1005
- }"
1006
- :imageLarge="{
1007
- src: 'media/images/content-images/logo-business-edition-landscape.jpg',
1008
- alt: 'Alternative text',
1009
- tooltip: 'Tooltip'
1010
- }"
1001
+ :imageSmall="imageData[0]"
1002
+ :imageLarge="imageData[0]"
1011
1003
  />
1012
1004
  </CmdWidthLimitationWrapper>
1013
1005
  <!-- end image-zoom ------------------------------------------------------------------------------------------------------------------------------------------------------->
@@ -1516,7 +1508,6 @@ export default {
1516
1508
  CmdUploadForm,
1517
1509
  CmdWidthLimitationWrapper
1518
1510
  },
1519
-
1520
1511
  data() {
1521
1512
  return {
1522
1513
  acceptedCookies: ["google-maps"],
@@ -1,13 +1,17 @@
1
1
  [
2
2
  {
3
3
  "name": "User name 1",
4
- "image": {
5
- "src": "/media/images/user-images/fake-user-1.jpg",
6
- "alt": "Alternative text"
7
- },
4
+ "age": 35,
5
+ "gender": "m",
6
+ "imageSrc": "/media/images/user-images/fake-user-1.jpg",
8
7
  "profession": "User profession",
9
8
  "position": "User position",
10
9
  "description": "User profile with image",
10
+ "tag": [
11
+ "Tagname",
12
+ "Long tag",
13
+ "One more tag"
14
+ ],
11
15
  "links": [
12
16
  {
13
17
  "path": "mailto:",
@@ -18,6 +22,9 @@
18
22
  },
19
23
  {
20
24
  "name": "User name 2",
25
+ "age": 35,
26
+ "gender": "m",
27
+ "imageSrc": "/media/images/user-images/fake-user-2.jpg",
21
28
  "profession": "User profession",
22
29
  "position": "User position",
23
30
  "description": "User description",
@@ -37,6 +44,9 @@
37
44
  },
38
45
  {
39
46
  "name": "User name 3",
47
+ "age": 35,
48
+ "gender": "m",
49
+ "imageSrc": "/media/images/user-images/fake-user-3.jpg",
40
50
  "profession": "User profession",
41
51
  "position": "User position",
42
52
  "description": "User with a long text as description that wraps over multiple lines",
@@ -61,6 +71,9 @@
61
71
  },
62
72
  {
63
73
  "name": "User name 4",
74
+ "age": 35,
75
+ "gender": "m",
76
+ "imageSrc": "/media/images/user-images/fake-user-4.jpg",
64
77
  "profession": "User profession",
65
78
  "position": "User position",
66
79
  "description": "User description",
@@ -85,6 +98,9 @@
85
98
  },
86
99
  {
87
100
  "name": "User name 5",
101
+ "age": 35,
102
+ "gender": "m",
103
+ "imageSrc": "/media/images/user-images/fake-user-5.jpg",
88
104
  "profession": "User profession",
89
105
  "position": "User position",
90
106
  "description": "User description",
@@ -1,8 +1,8 @@
1
1
  [
2
2
  {
3
3
  "image": {
4
- "src": "media/images/thumbnail-scroller/thumbnail/logo-cmd-blue-landscape.jpg",
5
- "srcImageLarge": "media/images/thumbnail-scroller/original/logo-cmd-blue-landscape.jpg",
4
+ "src": "media/images/gallery-images/large/landscape-01.jpg",
5
+ "srcImageLarge": "media/images/gallery-images/large/landscape-01.jpg",
6
6
  "alt": "Alternative text 1"
7
7
  },
8
8
  "figcaption": {
@@ -14,8 +14,8 @@
14
14
  },
15
15
  {
16
16
  "image": {
17
- "src": "media/images/thumbnail-scroller/thumbnail/logo-cmd-blue-landscape.jpg",
18
- "srcImageLarge": "media/images/thumbnail-scroller/original/logo-cmd-blue-landscape.jpg",
17
+ "src": "media/images/gallery-images/large/landscape-02.jpg",
18
+ "srcImageLarge": "media/images/gallery-images/large/landscape-02.jpg",
19
19
  "alt": "Alternative text 2"
20
20
  },
21
21
  "figcaption": {
@@ -27,8 +27,8 @@
27
27
  },
28
28
  {
29
29
  "image": {
30
- "src": "media/images/thumbnail-scroller/thumbnail/logo-cmd-blue-landscape.jpg",
31
- "srcImageLarge": "media/images/thumbnail-scroller/original/logo-cmd-blue-landscape.jpg",
30
+ "src": "media/images/gallery-images/large/landscape-03.jpg",
31
+ "srcImageLarge": "media/images/gallery-images/large/landscape-03.jpg",
32
32
  "alt": "Alternative text 3"
33
33
  },
34
34
  "figcaption": {
@@ -40,8 +40,8 @@
40
40
  },
41
41
  {
42
42
  "image": {
43
- "src": "media/images/thumbnail-scroller/thumbnail/logo-cmd-blue-landscape.jpg",
44
- "srcImageLarge": "media/images/thumbnail-scroller/original/logo-cmd-blue-landscape.jpg",
43
+ "src": "media/images/gallery-images/large/landscape-04.jpg",
44
+ "srcImageLarge": "media/images/gallery-images/large/landscape-04.jpg",
45
45
  "alt": "Alternative text 4"
46
46
  },
47
47
  "figcaption": {
@@ -123,11 +123,19 @@
123
123
  <!-- end boxType 'product' -->
124
124
 
125
125
  <!-- begin boxType 'user' -->
126
- <div v-else-if="boxType === 'user' && user" :class="['cmd-box box user', {'stretch-vertically': stretchVertically,'stretch-horizontally': stretchHorizontally}]">
126
+ <div v-else-if="boxType === 'user' && user"
127
+ :class="[
128
+ 'cmd-box box user',
129
+ profileType,
130
+ {
131
+ 'stretch-vertically': stretchVertically,
132
+ 'stretch-horizontally': stretchHorizontally
133
+ }
134
+ ]">
127
135
  <div class="box-header flex-container vertical">
128
136
  <figure v-if="user.image">
129
137
  <img :src="user.image.src" :alt="user.image.alt"/>
130
- <figcaption>{{ user.name }}</figcaption>
138
+ <figcaption>{{ user.name }} <span v-if="user.age">, {{user.age}}</span></figcaption>
131
139
  </figure>
132
140
  <div v-else>
133
141
  <span :class="defaultProfileIconClass" :title="user.name"></span>
@@ -139,6 +147,11 @@
139
147
  <p v-if="user.position">{{ user.position }}</p>
140
148
  <p v-if="user.description" class="description">{{ user.description }}</p>
141
149
  </div>
150
+ <ul class="tags">
151
+ <li v-for="(tag, index) in user.tags" :key="index">
152
+ {{tag}}
153
+ </li>
154
+ </ul>
142
155
  <div v-if="user.links" class="box-footer">
143
156
  <CmdListOfLinks :links="user.links" orientation="horizontal" :useGap="false"/>
144
157
  </div>
@@ -249,6 +262,17 @@ export default {
249
262
  type: Object,
250
263
  required: false
251
264
  },
265
+ /**
266
+ * profile types for user-boxes
267
+ *
268
+ * @required: only available for boxtype===user
269
+ *
270
+ * @allowedValues: 'business', 'influencer', 'dating'
271
+ */
272
+ profileType: {
273
+ type: String,
274
+ default: 'business'
275
+ },
252
276
  /**
253
277
  * activated if all content (incl. headline) is given by slot
254
278
  *
@@ -266,7 +266,7 @@ export default {
266
266
  /**
267
267
  * label-text for fake-select
268
268
  *
269
- * @requiredForAccessibility: true
269
+ * @requiredForAccessibility: true
270
270
  */
271
271
  labelText: {
272
272
  type: String,
@@ -17,25 +17,31 @@
17
17
 
18
18
  <!-- begin button-wrapper -->
19
19
  <div
20
- v-if="(fancyboxOptions.printButtons && (fancyboxOptions.printButtons.color || fancyboxOptions.printButtons.grayscale)) || fancyboxOptions.closeIcon"
20
+ v-if="(fancyboxOptions.printButtons?.color || fancyboxOptions.printButtons?.grayscale) || fancyboxOptions.closeIcon"
21
21
  class="button-wrapper no-flex"
22
22
  > <!-- begin print buttons -->
23
- <a v-if="fancyboxOptions.printButtons && fancyboxOptions.printButtons.color && fancyboxOptions.printButtons.color.show"
23
+ <a v-if="showPrintButtons && fancyboxOptions.printButtons?.color"
24
24
  href="#"
25
25
  class="button print-color"
26
- :title="fancyboxOptions.printButtons.color.tooltip"
26
+ :title="fancyboxOptions.printButtons.color?.tooltip"
27
27
  @click.prevent="printInGrayscale = false">
28
28
  <!-- begin CmdIcon -->
29
- <CmdIcon :iconClass="fancyboxOptions.printButtons.color.iconClass" :type="fancyboxOptions.printButtons.color.iconType" />
29
+ <CmdIcon
30
+ :iconClass="fancyboxOptions.printButtons.color?.iconClass"
31
+ :type="fancyboxOptions.printButtons.color?.iconType"
32
+ />
30
33
  <!-- end CmdIcon -->
31
34
  </a>
32
- <a v-if="fancyboxOptions.printButtons && fancyboxOptions.printButtons.grayscale && fancyboxOptions.printButtons.grayscale.show"
35
+ <a v-if="showPrintButtons && fancyboxOptions.printButtons?.grayscale"
33
36
  href="#"
34
37
  class="button print-grayscale"
35
- :title="fancyboxOptions.printButtons.grayscale.tooltip"
38
+ :title="fancyboxOptions.printButtons.grayscale?.tooltip"
36
39
  @click.prevent="printInGrayscale = true">
37
40
  <!-- begin CmdIcon -->
38
- <CmdIcon :iconClass="fancyboxOptions.printButtons.grayscale.iconClass" :type="fancyboxOptions.printButtons.grayscale.iconType" />
41
+ <CmdIcon
42
+ :iconClass="fancyboxOptions.printButtons.grayscale?.iconClass"
43
+ :type="fancyboxOptions.printButtons.grayscale?.iconType"
44
+ />
39
45
  <!-- end CmdIcon -->
40
46
  </a>
41
47
  <!-- end print buttons -->
@@ -49,7 +55,10 @@
49
55
  ref="close-dialog"
50
56
  @click.prevent="close">
51
57
  <!-- begin CmdIcon -->
52
- <CmdIcon :iconClass="fancyboxOptions.closeIcon.iconClass" :type="fancyboxOptions.closeIcon.iconType" />
58
+ <CmdIcon
59
+ :iconClass="fancyboxOptions.closeIcon.iconClass"
60
+ :type="fancyboxOptions.closeIcon.iconType"
61
+ />
53
62
  <!-- end CmdIcon -->
54
63
  </a>
55
64
  <!-- end close-icon -->
@@ -86,6 +95,37 @@
86
95
  <!-- end slot-content -->
87
96
  </div>
88
97
  </div>
98
+
99
+ <footer v-if="showSubmitButtons && fancyboxOptions.submitButtons" class="flex-container no-flex">
100
+ <!-- begin cancel-button -->
101
+ <button
102
+ v-if="fancyboxOptions.submitButtons?.cancel"
103
+ @click="cancel"
104
+ :title="fancyboxOptions.submitButtons.cancel?.tooltip">
105
+ <CmdIcon
106
+ v-if="fancyboxOptions.submitButtons.cancel?.iconClass"
107
+ :iconClass="fancyboxOptions.submitButtons.cancel?.iconClass"
108
+ :type="fancyboxOptions.submitButtons.cancel?.iconType"
109
+ />
110
+ <span v-if="fancyboxOptions.submitButtons.cancel?.buttonText">{{fancyboxOptions.submitButtons.cancel?.buttonText}}</span>
111
+ </button>
112
+ <!-- end cancel-button -->
113
+
114
+ <!-- begin confirm-button -->
115
+ <button
116
+ v-if="fancyboxOptions.submitButtons?.confirm"
117
+ @click="confirm"
118
+ :title="fancyboxOptions.submitButtons.cancel?.tooltip">
119
+ <CmdIcon
120
+ v-if="fancyboxOptions.submitButtons.confirm?.iconClass"
121
+ :iconClass="fancyboxOptions.submitButtons.confirm?.iconClass"
122
+ :type="fancyboxOptions.submitButtons.confirm?.iconType"
123
+ />
124
+ <span v-if="fancyboxOptions.submitButtons.confirm?.buttonText">{{fancyboxOptions.submitButtons.confirm?.buttonText}}</span>
125
+ </button>
126
+ <!-- end confirm-button -->
127
+ </footer>
128
+
89
129
  <!-- begin CmdThumbnailScroller -->
90
130
  <CmdThumbnailScroller
91
131
  v-if="fancyBoxGallery"
@@ -134,6 +174,7 @@ const FancyBox = defineComponent({
134
174
  mixins: [
135
175
  Identifier
136
176
  ],
177
+ emits: ['cancel', 'confirm'],
137
178
  data() {
138
179
  return {
139
180
  fancyBoxContent: null,
@@ -161,6 +202,20 @@ const FancyBox = defineComponent({
161
202
  type: String,
162
203
  required: false
163
204
  },
205
+ /**
206
+ * toggle visibility of print-buttons
207
+ */
208
+ showPrintButtons: {
209
+ type: Boolean,
210
+ default: false
211
+ },
212
+ /**
213
+ * toggle visibility of print-buttons
214
+ */
215
+ showSubmitButtons: {
216
+ type: Boolean,
217
+ default: true
218
+ },
164
219
  /**
165
220
  * options to show at top (closeIcon, printButtons)
166
221
  */
@@ -169,19 +224,35 @@ const FancyBox = defineComponent({
169
224
  default() {
170
225
  return {
171
226
  closeIcon: {
172
- "iconClass": "icon-cancel",
173
- "tooltip": "Close"
227
+ iconClass: "icon-cancel",
228
+ iconType: "auto",
229
+ tooltip: "Close"
174
230
  },
175
231
  printButtons: {
176
- "color": {
177
- show: true,
178
- "iconClass": "icon-print",
179
- "tooltip": "print in color"
232
+ color: {
233
+ iconClass: "icon-print",
234
+ iconType: "auto",
235
+ tooltip: "print in color"
236
+ },
237
+ grayscale: {
238
+ iconClass: "icon-print",
239
+ iconType: "auto",
240
+ tooltip: "print in grayscale"
241
+ }
242
+ },
243
+ submitButtons: {
244
+ cancel: {
245
+ iconClass: "icon-cancel",
246
+ iconType: "auto",
247
+ tooltip: "Cancel",
248
+ buttonText: "Cancel"
180
249
  },
181
- "grayscale": {
182
- show: true,
183
- "iconClass": "icon-print",
184
- "tooltip": "print in grayscale"
250
+ confirm: {
251
+ iconClass: "icon-check",
252
+ iconType: "auto",
253
+ buttonText: "Confirm",
254
+ tooltip: "Confirm",
255
+ buttonType: "primary"
185
256
  }
186
257
  }
187
258
  }
@@ -368,6 +439,14 @@ const FancyBox = defineComponent({
368
439
 
369
440
  // remove class to re-enable scrolling
370
441
  document.querySelector("body").classList.remove("avoid-scrolling")
442
+ },
443
+ cancel() {
444
+ this.$emit("cancel", true)
445
+ this.close()
446
+ },
447
+ confirm() {
448
+ this.$emit("confirm", true)
449
+ this.close()
371
450
  }
372
451
  },
373
452
  watch: {
@@ -502,6 +581,11 @@ export default FancyBox
502
581
  }
503
582
  }
504
583
 
584
+ > footer {
585
+ margin-top: auto;
586
+ justify-content: flex-end;
587
+ }
588
+
505
589
  .outer-content-wrapper {
506
590
  max-height: 85vh;
507
591
  overflow-x: hidden;
@@ -5,7 +5,8 @@
5
5
  <a href="#" class="thumbnails-imagezoom">
6
6
  <!-- begin CmdImage -->
7
7
  <CmdImage
8
- :image="imageSmall"
8
+ :image="imageSmall.image"
9
+ :figcaption="imageSmall.figcaption"
9
10
  @mouseover="onMouseOver"
10
11
  @mousemove="onMouseMove"
11
12
  @mouseout="onMouseOut"
@@ -19,7 +20,8 @@
19
20
  <div v-if="showLargeImage" class="zoom-container grid-large-item">
20
21
  <!-- begin CmdImage -->
21
22
  <CmdImage
22
- :image="imageLarge"
23
+ :image="imageLarge.image"
24
+ :figcaption="imageLarge.figcaption"
23
25
  @mouseover="onMouseOver"
24
26
  @mousemove="onMouseMove"
25
27
  @mouseout="onMouseOut"
@@ -6,10 +6,10 @@
6
6
  </div>
7
7
  <!-- end slot for elements above header -->
8
8
 
9
- <header :class="[
10
- useGrid ? 'grid-container-create-columns': 'flex-container',
11
- {'has-navigation': (cmdMainNavigation?.navigationEntries?.length && navigationInline) || $slots.navigation,
12
- 'one-child-only' : oneChildOnly}
9
+ <header
10
+ :class="[
11
+ useGrid ? 'grid-container-create-columns': 'flex-container',
12
+ {'has-navigation': (cmdMainNavigation?.navigationEntries?.length && navigationInline) || $slots.navigation}
13
13
  ]">
14
14
  <!-- begin slots for logo and other header elements -->
15
15
  <template v-if="$slots.logo || $slots.header || $slots.navigation">
@@ -107,12 +107,6 @@ export default {
107
107
  type: Object,
108
108
  required: false
109
109
  }
110
- },
111
- computed: {
112
- oneChildOnly() {
113
- // check if sum of children equals "1" by turning objects into booleans, which will be converted to numbers by using "+".
114
- return (!!this.cmdCompanyLogo + !!this.cmdMainNavigation + !!this.$slots.logo + !!this.$slots.header + !!this.$slots.navigation) === 1
115
- }
116
110
  }
117
111
  }
118
112
  </script>
@@ -171,10 +165,6 @@ export default {
171
165
  padding-bottom: 0;
172
166
  }
173
167
 
174
- &.one-child-only {
175
- gap: 0;
176
- }
177
-
178
168
  &.flex-container {
179
169
  width: 100%;
180
170
 
@@ -197,10 +187,6 @@ export default {
197
187
  .cmd-company-logo {
198
188
  grid-column: span var(--grid-small-span);
199
189
  }
200
-
201
- > *:only-child {
202
- gap: 0;
203
- }
204
190
  }
205
191
 
206
192
  &.navigation-inline {
@@ -61,6 +61,20 @@
61
61
  ]
62
62
  }
63
63
  },
64
+ "profileType": {
65
+ "comments": [
66
+ "profile types for user-boxes"
67
+ ],
68
+ "annotations": {
69
+ "required": [
70
+ "only available for boxtype===user",
71
+ ""
72
+ ],
73
+ "allowedValues": [
74
+ "'business', 'influencer', 'dating'"
75
+ ]
76
+ }
77
+ },
64
78
  "useSlots": {
65
79
  "comments": [
66
80
  "activated if all content (incl. headline) is given by slot",
@@ -66,10 +66,13 @@
66
66
  },
67
67
  "labelText": {
68
68
  "comments": [
69
- "label-text for fake-select",
70
- "",
71
- " @requiredForAccessibility: true"
72
- ]
69
+ "label-text for fake-select"
70
+ ],
71
+ "annotations": {
72
+ "requiredForAccessibility": [
73
+ "true"
74
+ ]
75
+ }
73
76
  },
74
77
  "showLabel": {
75
78
  "comments": [
@@ -14,6 +14,16 @@
14
14
  "set if content should be loaded by url"
15
15
  ]
16
16
  },
17
+ "showPrintButtons": {
18
+ "comments": [
19
+ "toggle visibility of print-buttons"
20
+ ]
21
+ },
22
+ "showSubmitButtons": {
23
+ "comments": [
24
+ "toggle visibility of print-buttons"
25
+ ]
26
+ },
17
27
  "fancyboxOptions": {
18
28
  "comments": [
19
29
  "options to show at top (closeIcon, printButtons)"