comand-component-library 3.1.44 → 3.1.47

Sign up to get free protection for your applications and to get access to all the features.
Files changed (234) hide show
  1. package/dist/comand-component-library.css +1 -1
  2. package/dist/comand-component-library.umd.min.js +1 -1
  3. package/package.json +47 -41
  4. package/src/App.vue +373 -135
  5. package/src/ComponentDocumentation.vue +156 -0
  6. package/src/ComponentLibraryHelp.vue +20 -0
  7. package/src/assets/data/accordion.json +21 -24
  8. package/src/assets/data/address-data.json +34 -0
  9. package/src/assets/data/bank-account-data.json +22 -0
  10. package/src/assets/data/box-product.json +14 -4
  11. package/src/assets/data/box-user.json +48 -22
  12. package/src/assets/data/breadcrumbs.json +11 -3
  13. package/src/assets/data/cookie-disclaimer.json +4 -4
  14. package/src/assets/data/fake-select-colors.json +4 -0
  15. package/src/assets/data/fake-select-countries.json +12 -12
  16. package/src/assets/data/fake-select-filter-options.json +14 -0
  17. package/src/assets/data/fake-select-options-with-icons.json +6 -12
  18. package/src/assets/data/fake-select-options.json +3 -3
  19. package/src/assets/data/list-of-links-section-anchors.json +23 -0
  20. package/src/assets/data/list-of-links-top-header-navigation.json +20 -0
  21. package/src/assets/data/list-of-links.json +42 -0
  22. package/src/assets/data/main-navigation.json +48 -0
  23. package/src/assets/data/multistep-form-progress-bar.json +33 -0
  24. package/src/assets/data/select-options.json +4 -0
  25. package/src/assets/data/{share-buttons.json → share-buttons-page-by-json.json} +8 -8
  26. package/src/assets/data/share-buttons-page-by-property.json +30 -0
  27. package/src/assets/data/switch-language.json +20 -0
  28. package/src/assets/data/table-large.json +1 -1
  29. package/src/assets/data/table-small.json +1 -1
  30. package/src/assets/styles/global-styles.scss +43 -14
  31. package/src/assets/styles/transitions.scss +21 -1
  32. package/src/components/CmdAccordion.vue +43 -42
  33. package/src/components/CmdAddressData.vue +124 -56
  34. package/src/components/CmdBackToTopButton.vue +3 -3
  35. package/src/components/CmdBankAccountData.vue +104 -0
  36. package/src/components/CmdBox.vue +253 -56
  37. package/src/components/CmdBoxSiteSearch.vue +138 -39
  38. package/src/components/CmdBoxWrapper.vue +206 -0
  39. package/src/components/CmdBreadcrumbs.vue +29 -13
  40. package/src/components/CmdCompanyLogo.vue +6 -4
  41. package/src/components/CmdCookieDisclaimer.vue +99 -75
  42. package/src/components/CmdCopyrightInformation.vue +1 -1
  43. package/src/components/CmdCustomHeadline.vue +93 -0
  44. package/src/components/CmdFakeSelect.vue +330 -66
  45. package/src/components/CmdFancyBox.vue +47 -33
  46. package/src/components/CmdForm.vue +107 -0
  47. package/src/components/CmdFormElement.vue +528 -79
  48. package/src/components/CmdFormFilters.vue +25 -11
  49. package/src/components/CmdGoogleMaps.vue +9 -3
  50. package/src/components/CmdImageGallery.vue +28 -5
  51. package/src/components/CmdImageZoom.vue +9 -1
  52. package/src/components/CmdListOfLinks.vue +169 -0
  53. package/src/components/CmdLoginForm.vue +143 -63
  54. package/src/components/CmdMainNavigation.vue +140 -42
  55. package/src/components/CmdMultipleSwitch.vue +33 -2
  56. package/src/components/CmdMultistepFormProgressBar.vue +60 -10
  57. package/src/components/CmdOpeningHours.vue +36 -10
  58. package/src/components/CmdPager.vue +7 -5
  59. package/src/components/CmdProgressBar.vue +20 -3
  60. package/src/components/CmdShareButtons.vue +64 -9
  61. package/src/components/CmdSiteHeader.vue +25 -12
  62. package/src/components/CmdSlideButton.vue +5 -2
  63. package/src/components/CmdSlideshow.vue +23 -7
  64. package/src/components/CmdSwitchButton.vue +10 -3
  65. package/src/components/CmdSwitchLanguage.vue +18 -10
  66. package/src/components/CmdSystemMessage.vue +30 -17
  67. package/src/components/CmdTable.vue +15 -7
  68. package/src/components/CmdTabs.vue +43 -3
  69. package/src/components/CmdThumbnailScroller.vue +22 -6
  70. package/src/components/CmdTooltip.vue +184 -11
  71. package/src/components/CmdUploadForm.vue +198 -92
  72. package/src/components/CmdWidthLimitationWrapper.vue +9 -6
  73. package/src/composables/event.js +8 -0
  74. package/src/composables/scrollspy.js +52 -0
  75. package/src/directives/focus.js +19 -0
  76. package/src/directives/telephone.js +1 -1
  77. package/src/documentation/commonProps.js +6 -0
  78. package/src/documentation/components/ComponentCode.vue +50 -0
  79. package/src/documentation/components/ComponentProperties.vue +237 -0
  80. package/src/documentation/components/ExampleSectionWrapper.vue +46 -0
  81. package/src/documentation/components/ViewCodeData.vue +113 -0
  82. package/src/documentation/data/CmdAccordionHelp.js +22 -0
  83. package/src/documentation/data/CmdAddressDataHelp.js +17 -0
  84. package/src/documentation/data/CmdBackToTopButtonHelp.js +3 -0
  85. package/src/documentation/data/CmdBankAccountDataHelp.js +8 -0
  86. package/src/documentation/data/CmdBoxHelp.js +45 -0
  87. package/src/documentation/data/CmdBoxSiteSearchHelp.js +11 -0
  88. package/src/documentation/data/CmdBreadcrumbsHelp.js +6 -0
  89. package/src/documentation/data/CmdCompanyLogoHelp.js +8 -0
  90. package/src/documentation/data/CmdCookieDisclaimerHelp.js +9 -0
  91. package/src/documentation/data/CmdCopyrightInformation.js +2 -0
  92. package/src/documentation/data/CmdCustomHeadlineHelp.js +8 -0
  93. package/src/documentation/data/CmdFakeSelectHelp.js +60 -0
  94. package/src/documentation/data/CmdFancyBoxHelp.js +7 -0
  95. package/src/documentation/data/CmdFooterNavigationHelp.js +5 -0
  96. package/src/documentation/data/CmdFormElementHelp.js +189 -0
  97. package/src/documentation/data/CmdFormFiltersHelp.js +6 -0
  98. package/src/documentation/data/CmdFormHelp.js +10 -0
  99. package/src/documentation/data/CmdGoogleMapsHelp.js +5 -0
  100. package/src/documentation/data/CmdImageGalleryHelp.js +5 -0
  101. package/src/documentation/data/CmdImageZoomHelp.js +6 -0
  102. package/src/documentation/data/CmdListOfLinksHelp.js +24 -0
  103. package/src/documentation/data/CmdLoginFormHelp.js +6 -0
  104. package/src/documentation/data/CmdMainNavigationHelp.js +7 -0
  105. package/src/documentation/data/CmdMultistepFormProgressBarHelp.js +6 -0
  106. package/src/documentation/data/CmdOpeningHoursHelp.js +10 -0
  107. package/src/documentation/data/CmdPagerHelp.js +7 -0
  108. package/src/documentation/data/CmdProgressBarHelp.js +13 -0
  109. package/src/documentation/data/CmdShareButtonsHelp.js +13 -0
  110. package/src/documentation/data/CmdSiteHeaderHelp.js +21 -0
  111. package/src/documentation/data/CmdSlideButtonHelp.js +10 -0
  112. package/src/documentation/data/CmdSlideshowHelp.js +7 -0
  113. package/src/documentation/data/CmdSwitchLanguageHelp.js +6 -0
  114. package/src/documentation/data/CmdSystemMessageHelp.js +32 -0
  115. package/src/documentation/data/CmdTableHelp.js +14 -0
  116. package/src/documentation/data/CmdTabsHelp.js +10 -0
  117. package/src/documentation/data/CmdThumbnailScrollerHelp.js +5 -0
  118. package/src/documentation/data/CmdTooltipHelp.js +13 -0
  119. package/src/documentation/data/CmdUploadFormHelp.js +17 -0
  120. package/src/documentation/data/CmdWidthLimitationWrapperHelp.js +7 -0
  121. package/src/documentation/data/componentsDescription.json +158 -0
  122. package/src/documentation/generated/CmdAccordionPropertyDescriptions.json +57 -0
  123. package/src/documentation/generated/CmdAddressDataPropertyDescriptions.json +32 -0
  124. package/src/documentation/generated/CmdBackToTopButtonPropertyDescriptions.json +12 -0
  125. package/src/documentation/generated/CmdBankAccountDataPropertyDescriptions.json +34 -0
  126. package/src/documentation/generated/CmdBoxPropertyDescriptions.json +91 -0
  127. package/src/documentation/generated/CmdBoxSiteSearchPropertyDescriptions.json +41 -0
  128. package/src/documentation/generated/CmdBoxWrapperPropertyDescriptions.json +47 -0
  129. package/src/documentation/generated/CmdBreadcrumbsPropertyDescriptions.json +17 -0
  130. package/src/documentation/generated/CmdCompanyLogoPropertyDescriptions.json +27 -0
  131. package/src/documentation/generated/CmdCookieDisclaimerPropertyDescriptions.json +22 -0
  132. package/src/documentation/generated/CmdCustomHeadlinePropertyDescriptions.json +22 -0
  133. package/src/documentation/generated/CmdFakeSelectPropertyDescriptions.json +79 -0
  134. package/src/documentation/generated/CmdFancyBoxPropertyDescriptions.json +62 -0
  135. package/src/documentation/generated/CmdFooterNavigationPropertyDescriptions.json +17 -0
  136. package/src/documentation/generated/CmdFormElementPropertyDescriptions.json +178 -0
  137. package/src/documentation/generated/CmdFormFiltersPropertyDescriptions.json +32 -0
  138. package/src/documentation/generated/CmdFormPropertyDescriptions.json +40 -0
  139. package/src/documentation/generated/CmdGoogleMapsPropertyDescriptions.json +7 -0
  140. package/src/documentation/generated/CmdImageGalleryPropertyDescriptions.json +22 -0
  141. package/src/documentation/generated/CmdImageZoomPropertyDescriptions.json +12 -0
  142. package/src/documentation/generated/CmdListOfLinksPropertyDescriptions.json +60 -0
  143. package/src/documentation/generated/CmdLoginFormPropertyDescriptions.json +90 -0
  144. package/src/documentation/generated/CmdMainNavigationPropertyDescriptions.json +62 -0
  145. package/src/documentation/generated/CmdMultipleSwitchPropertyDescriptions.json +52 -0
  146. package/src/documentation/generated/CmdMultistepFormProgressBarPropertyDescriptions.json +17 -0
  147. package/src/documentation/generated/CmdOpeningHoursPropertyDescriptions.json +42 -0
  148. package/src/documentation/generated/CmdPagerPropertyDescriptions.json +37 -0
  149. package/src/documentation/generated/CmdProgressBarPropertyDescriptions.json +32 -0
  150. package/src/documentation/generated/CmdShareButtonsPropertyDescriptions.json +34 -0
  151. package/src/documentation/generated/CmdSiteHeaderPropertyDescriptions.json +27 -0
  152. package/src/documentation/generated/CmdSlideButtonPropertyDescriptions.json +25 -0
  153. package/src/documentation/generated/CmdSlideshowPropertyDescriptions.json +42 -0
  154. package/src/documentation/generated/CmdSwitchButtonPropertyDescriptions.json +79 -0
  155. package/src/documentation/generated/CmdSwitchLanguagePropertyDescriptions.json +7 -0
  156. package/src/documentation/generated/CmdSystemMessagePropertyDescriptions.json +40 -0
  157. package/src/documentation/generated/CmdTablePropertyDescriptions.json +62 -0
  158. package/src/documentation/generated/CmdTabsPropertyDescriptions.json +27 -0
  159. package/src/documentation/generated/CmdThumbnailScrollerPropertyDescriptions.json +32 -0
  160. package/src/documentation/generated/CmdTooltipPropertyDescriptions.json +17 -0
  161. package/src/documentation/generated/CmdUploadFormPropertyDescriptions.json +90 -0
  162. package/src/documentation/generated/CmdWidthLimitationWrapperPropertyDescriptions.json +41 -0
  163. package/src/documentation/generated/frameworkIcons.json +730 -0
  164. package/src/documentation/generated/logosIcons.json +110 -0
  165. package/src/documentation/tabs.js +46 -0
  166. package/src/documentation/views/ContainerPage.vue +237 -0
  167. package/src/documentation/views/HelpHome.vue +13 -0
  168. package/src/documentation/views/IconFont.vue +80 -0
  169. package/src/documentation/views/components/CmdAccordionHelp.vue +78 -0
  170. package/src/documentation/views/components/CmdAddressDataHelp.vue +65 -0
  171. package/src/documentation/views/components/CmdBackToTopButtonHelp.vue +62 -0
  172. package/src/documentation/views/components/CmdBankAccountDataHelp.vue +88 -0
  173. package/src/documentation/views/components/CmdBoxHelp.vue +137 -0
  174. package/src/documentation/views/components/CmdBoxSiteSearchHelp.vue +60 -0
  175. package/src/documentation/views/components/CmdBoxWrapperHelp.vue +111 -0
  176. package/src/documentation/views/components/CmdBreadcrumbsHelp.vue +51 -0
  177. package/src/documentation/views/components/CmdCompanyLogoHelp.vue +48 -0
  178. package/src/documentation/views/components/CmdCookieDisclaimerHelp.vue +105 -0
  179. package/src/documentation/views/components/CmdCustomHeadlineHelp.vue +53 -0
  180. package/src/documentation/views/components/CmdFakeSelectHelp.vue +175 -0
  181. package/src/documentation/views/components/CmdFancyBoxHelp.vue +79 -0
  182. package/src/documentation/views/components/CmdFormElementHelp.vue +412 -0
  183. package/src/documentation/views/components/CmdFormFiltersHelp.vue +69 -0
  184. package/src/documentation/views/components/CmdFormHelp.vue +41 -0
  185. package/src/documentation/views/components/CmdGoogleMapsHelp.vue +55 -0
  186. package/src/documentation/views/components/CmdImageGalleryHelp.vue +46 -0
  187. package/src/documentation/views/components/CmdImageZoomHelp.vue +34 -0
  188. package/src/documentation/views/components/CmdListOfLinksHelp.vue +64 -0
  189. package/src/documentation/views/components/CmdLoginFormHelp.vue +117 -0
  190. package/src/documentation/views/components/CmdMainNavigationHelp.vue +94 -0
  191. package/src/documentation/views/components/CmdMultistepFormProgressBarHelp.vue +49 -0
  192. package/src/documentation/views/components/CmdOpeningHoursHelp.vue +49 -0
  193. package/src/documentation/views/components/CmdPagerHelp.vue +57 -0
  194. package/src/documentation/views/components/CmdProgressBarHelp.vue +47 -0
  195. package/src/documentation/views/components/CmdShareButtonsHelp.vue +65 -0
  196. package/src/documentation/views/components/CmdSiteHeaderHelp.vue +72 -0
  197. package/src/documentation/views/components/CmdSlideButtonHelp.vue +90 -0
  198. package/src/documentation/views/components/CmdSlideshowHelp.vue +60 -0
  199. package/src/documentation/views/components/CmdSwitchLanguageHelp.vue +64 -0
  200. package/src/documentation/views/components/CmdSystemMessageHelp.vue +86 -0
  201. package/src/documentation/views/components/CmdTableHelp.vue +84 -0
  202. package/src/documentation/views/components/CmdTabsHelp.vue +52 -0
  203. package/src/documentation/views/components/CmdThumbnailScrollerHelp.vue +50 -0
  204. package/src/documentation/views/components/CmdTooltipHelp.vue +59 -0
  205. package/src/documentation/views/components/CmdUploadFormHelp.vue +59 -0
  206. package/src/documentation/views/components/CmdWidthLimitationWrapperHelp.vue +46 -0
  207. package/src/index.js +7 -3
  208. package/src/main.js +25 -15
  209. package/src/mixins/CmdAddressData/DefaultMessageProperties.js +17 -0
  210. package/src/mixins/CmdBox/DefaultMessageProperties.js +10 -0
  211. package/src/mixins/CmdFakeSelect/DefaultMessageProperties.js +9 -0
  212. package/src/mixins/CmdFormElement/DefaultMessageProperties.js +9 -0
  213. package/src/mixins/CmdImageGallery/DefaultMessageProperties.js +9 -0
  214. package/src/mixins/CmdSiteSearch/DefaultMessageProperties.js +14 -0
  215. package/src/mixins/CmdUploadForm/DefaultMessageProperties.js +5 -1
  216. package/src/mixins/FieldValidation.js +220 -0
  217. package/src/mixins/GlobalDefaultMessageProperties.js +15 -0
  218. package/src/mixins/Tooltip.js +26 -0
  219. package/src/router/index.js +67 -0
  220. package/src/utilities.js +3 -6
  221. package/src/utils/common.js +6 -0
  222. package/src/utils/dom.js +8 -0
  223. package/src/utils/globalSequence.js +13 -0
  224. package/src/utils/string.js +8 -0
  225. package/src/assets/data/address.json +0 -13
  226. package/src/assets/data/footer-navigation.json +0 -38
  227. package/src/assets/data/languages.json +0 -31
  228. package/src/assets/data/multisteps.json +0 -27
  229. package/src/assets/data/navigation.json +0 -47
  230. package/src/assets/data/pager.json +0 -11
  231. package/src/assets/data/top-header-navigation.json +0 -27
  232. package/src/components/CmdFooterNavigation.vue +0 -71
  233. package/src/components/CmdMainHeadline.vue +0 -75
  234. package/src/components/CmdTopHeaderNavigation.vue +0 -88
@@ -1,37 +1,82 @@
1
1
  <template>
2
- <div v-if="boxType === 'content'" class="cmd-box box content">
3
- <div>
2
+ <!-- begin boxType 'content' -->
3
+ <div v-if="boxType === 'content'" :class="['cmd-box box content', {open : open, collapsible: collapsible}]">
4
+ <header v-if="useSlots?.includes('header')">
5
+ <!-- begin slot 'header' -->
4
6
  <slot name="header"></slot>
7
+ <!-- end slot 'header' -->
8
+ </header>
9
+ <template v-else>
10
+ <!-- begin header for collapsible -->
11
+ <a v-if="collapsible" href="#" :title="open ? iconOpen.tooltip : iconClosed.tooltip" @click.prevent="toggleContentVisibility">
12
+ <!-- begin CmdCustomHeadline -->
13
+ <CmdCustomHeadline v-if="cmdCustomHeadline?.headlineText"
14
+ v-bind="cmdCustomHeadline"/>
15
+ <!-- end CmdCustomHeadline -->
16
+ <span class="toggle-icon" :class="[open ? iconOpen.iconClass : iconClosed.iconClass]"></span>
17
+ </a>
18
+ <!-- end header for collapsible -->
19
+
20
+ <!-- begin CmdCustomHeadline -->
21
+ <CmdCustomHeadline v-else-if="!collapsible && cmdCustomHeadline?.headlineText"
22
+ v-bind="cmdCustomHeadline"/>
23
+ <!-- end CmdCustomHeadline -->
24
+ </template>
25
+
26
+ <!-- begin box-body -->
27
+ <div v-if="open" class="box-body" aria-expanded="true">
28
+ <!-- begin slot 'body' -->
29
+ <slot name="body">
30
+ <transition :name="toggleTransition">
31
+ <p class="padding">{{ textBody }}</p>
32
+ </transition>
33
+ </slot>
34
+ <!-- end slot 'body' -->
5
35
  </div>
6
- <div class="box-body">
7
- <slot name="body"></slot>
8
- </div>
9
- <footer>
36
+ <!-- end box-body -->
37
+
38
+ <footer v-if="useSlots?.includes('footer')">
39
+ <!-- begin slot 'footer' -->
10
40
  <slot name="footer"></slot>
41
+ <!-- end slot 'footer' -->
11
42
  </footer>
12
43
  </div>
13
- <a v-else-if="boxType === 'product'" class="cmd-box box product" href="#" @click.prevent="">
44
+ <!-- end boxType 'content' -->
45
+
46
+ <!-- begin boxType 'product' -->
47
+ <a v-else-if="boxType === 'product' && product" class="cmd-box box product" href="#" @click.prevent="clickOnProduct(product)">
14
48
  <div>
15
- <img v-if="product.img" :src="product.img.src" :alt="product.img.alt"/>
49
+ <img v-if="product.image" :src="product.image.src" :alt="product.image.alt"/>
16
50
  <div class="ribbon-new" v-if="product.new">
17
- <span>New</span>
51
+ <span>{{ getMessage("cmdbox.productbox.new") }}</span>
18
52
  </div>
19
- <div class="ribbon-discount" v-if="product.discount">
53
+ <div v-if="product.discount" class="ribbon-discount">
20
54
  <span>{{ product.discount }}</span>
21
55
  </div>
56
+ <!-- begin CmdCustomHeadline -->
57
+ <CmdCustomHeadline v-if="cmdCustomHeadline?.headlineText || product.name"
58
+ v-bind="cmdCustomHeadline || {}"
59
+ :headlineText="cmdCustomHeadline?.headlineText ? cmdCustomHeadline?.headlineText : product.name"/>
60
+ <!-- end CmdCustomHeadline -->
22
61
  </div>
23
62
  <div class="box-body">
24
- <h3>{{ product.name }}</h3>
25
- <p v-if="product.articleNumber">Article No.: {{ product.articleNumber }}</p>
63
+ <p v-if="product.articleNumber">{{ getMessage("cmdbox.productbox.article_no") }} {{ product.articleNumber }}</p>
26
64
  <p v-if="product.price" class="price">{{ product.price }}</p>
27
65
  <p v-if="product.description">{{ product.description }}</p>
28
66
  </div>
29
67
  </a>
30
- <div v-else-if="boxType === 'user'" class="cmd-box box user">
68
+ <!-- end boxType 'product' -->
69
+
70
+ <!-- begin boxType 'user' -->
71
+ <div v-else-if="boxType === 'user' && user" class="cmd-box box user">
31
72
  <div>
32
- <img v-if="user.image" src="" alt=""/>
33
- <div v-else class="icon-user-profile"></div>
34
- <h3 v-if="user.name">{{ user.name }}</h3>
73
+ <img v-if="user.image" :src="user.image.src" :alt="user.image.alt"/>
74
+ <div v-else :class="defaultProfileIconClass" :title="user.name"></div>
75
+ <!-- begin CmdCustomHeadline -->
76
+ <CmdCustomHeadline v-if="cmdCustomHeadline?.headlineText || user.name"
77
+ v-bind="cmdCustomHeadline || {}"
78
+ :headlineText="cmdCustomHeadline?.headlineText ? cmdCustomHeadline?.headlineText : user.name"/>
79
+ <!-- end CmdCustomHeadline -->
35
80
  </div>
36
81
  <div class="box-body">
37
82
  <p v-if="user.profession">{{ user.profession }}</p>
@@ -39,32 +84,79 @@
39
84
  <p v-if="user.description" class="description">{{ user.description }}</p>
40
85
  </div>
41
86
  <footer v-if="user.links">
42
- <ul class="flex-container no-gap">
43
- <li v-for="(link, linkIndex) in user.links" :key="linkIndex">
44
- <a :href="link.href" :target="link.target" :title="link.title" :class="link.iconClass"></a>
45
- </li>
46
- </ul>
87
+ <CmdListOfLinks :links="user.links" orientation="horizontal" :useGap="false"/>
47
88
  </footer>
48
89
  </div>
90
+ <!-- end boxType 'user' -->
49
91
  </template>
50
92
 
51
93
  <script>
94
+ // import mixins
95
+ import I18n from "../mixins/I18n"
96
+ import DefaultMessageProperties from "../mixins/CmdBox/DefaultMessageProperties"
97
+
98
+ // import components
99
+ import CmdCustomHeadline from "./CmdCustomHeadline"
100
+ import CmdListOfLinks from "./CmdListOfLinks"
101
+
52
102
  export default {
53
103
  name: "CmdBox",
104
+ components: {
105
+ CmdCustomHeadline,
106
+ CmdListOfLinks,
107
+ },
108
+ mixins: [
109
+ I18n, DefaultMessageProperties
110
+ ],
111
+ data() {
112
+ return {
113
+ open: this.collapsible ? this.collapsingBoxesOpen : true,
114
+ active: true
115
+ }
116
+ },
117
+ emits: ['click'],
54
118
  props: {
119
+ collapsingBoxesOpen: {
120
+ type: Boolean,
121
+ required: false
122
+ },
55
123
  /**
56
- * set boxtype to show different types of boxes/contents
124
+ * set boyType to show different types of boxes/contents
57
125
  *
58
- * values: "content, product, user"
126
+ * @allowedValues: content, product, user
127
+ * @affectsStyling: true
59
128
  */
60
129
  boxType: {
61
130
  type: String,
62
131
  default: "content"
63
132
  },
133
+ /**
134
+ * activate if box should be collapsible
135
+ */
136
+ collapsible: {
137
+ type: Boolean,
138
+ default: false
139
+ },
140
+ /**
141
+ * use transition to expand and collapse box-body
142
+ *
143
+ * boyType must be 'content' and 'collapsible' must be activated
144
+ */
145
+ useTransition: {
146
+ type: Boolean,
147
+ default: true
148
+ },
149
+ /**
150
+ * set default profile-icon (will eb shown if no user-image exists)
151
+ */
152
+ defaultProfileIconClass: {
153
+ type: String,
154
+ default: "icon-user-profile"
155
+ },
64
156
  /**
65
157
  * the shown product (incl. name, price, image, description)
66
158
  *
67
- * limitations: only available for boxtype===product
159
+ * @required: only available for boxtype===product
68
160
  */
69
161
  product: {
70
162
  type: Object,
@@ -73,11 +165,93 @@ export default {
73
165
  /**
74
166
  * the shown user-profile (incl. name, image, contact-data)
75
167
  *
76
- * limitations: only available for boxtype===user
168
+ * @required: only available for boxtype===user
77
169
  */
78
170
  user: {
79
171
  type: Object,
80
172
  required: false
173
+ },
174
+ /**
175
+ * activated if all content (incl. headline) is given by slot
176
+ *
177
+ * if false textBody-property must be set
178
+ */
179
+ useSlots: {
180
+ type: Array,
181
+ required: false
182
+ },
183
+ /**
184
+ * String used as content (placed in a paragraph-tag) for box-body
185
+ *
186
+ * should only be used, if no further html-structure is required for box-body
187
+ */
188
+ textBody: {
189
+ type: String,
190
+ default: ""
191
+ },
192
+ /**
193
+ * icon to expand an accordion
194
+ *
195
+ * @requiredForAccessibility: partial
196
+ */
197
+ iconOpen: {
198
+ type: Object,
199
+ default: function () {
200
+ return {
201
+ iconClass: "icon-single-arrow-up",
202
+ tooltip: "Close content"
203
+ }
204
+ },
205
+ },
206
+ /**
207
+ * icon to collapse an accordion
208
+ *
209
+ * @requiredForAccessibility: partial
210
+ */
211
+ iconClosed: {
212
+ type: Object,
213
+ default: function () {
214
+ return {
215
+ iconClass: "icon-single-arrow-down",
216
+ tooltip: "Show content"
217
+ }
218
+ }
219
+ },
220
+ /**
221
+ * properties for CmdCustomHeadline-component
222
+ */
223
+ cmdCustomHeadline: {
224
+ type: Object,
225
+ required: false
226
+ }
227
+ },
228
+ computed: {
229
+ toggleTransition() {
230
+ if (this.useTransition) {
231
+ return "fade"
232
+ }
233
+ return ""
234
+ }
235
+ },
236
+ methods: {
237
+ // for collapsible boxes of boxType === content
238
+ toggleContentVisibility() {
239
+ this.open = !this.open
240
+ this.active = !this.active
241
+
242
+ this.$emit('toggle-collapse', this.open)
243
+ },
244
+ // for boxType === product
245
+ clickOnProduct(product) {
246
+ this.$emit('click', product)
247
+ }
248
+ },
249
+ watch: {
250
+ collapsingBoxesOpen() {
251
+ // toggle collapse-status of all boxes if changed in outer component
252
+ if (this.collapsible) {
253
+ this.open = this.collapsingBoxesOpen
254
+ }
81
255
  }
82
256
  }
83
257
  }
@@ -88,9 +262,12 @@ export default {
88
262
  .cmd-box {
89
263
  display: flex;
90
264
  flex-direction: column;
91
- height: 100%;
92
265
  padding: 0;
93
266
 
267
+ > .cmd-custom-headline {
268
+ margin-bottom: 0;
269
+ }
270
+
94
271
  .box-body {
95
272
  padding: var(--default-padding);
96
273
  }
@@ -106,15 +283,28 @@ export default {
106
283
  }
107
284
  }
108
285
 
109
- > div:first-child {
286
+ > header, > a {
287
+ display: flex;
288
+ align-items: center;
110
289
  border-top-left-radius: var(--border-radius);
111
290
  border-top-right-radius: var(--border-radius);
112
291
  padding: calc(var(--default-padding) / 2) var(--default-padding);
113
292
  background: var(--primary-color);
293
+ color: var(--pure-white);
294
+ text-decoration: none;
114
295
 
115
- > * {
296
+ > .cmd-custom-headline {
297
+ margin-bottom: 0;
298
+ }
299
+
300
+ * {
116
301
  color: var(--pure-white);
117
302
  }
303
+
304
+ > [class*="icon"]:last-child {
305
+ font-size: 1rem;
306
+ margin-left: auto;
307
+ }
118
308
  }
119
309
 
120
310
  .box-body {
@@ -123,6 +313,7 @@ export default {
123
313
 
124
314
  .padding {
125
315
  padding: var(--default-padding);
316
+ margin: 0;
126
317
  }
127
318
 
128
319
  img {
@@ -168,6 +359,15 @@ export default {
168
359
  }
169
360
  }
170
361
 
362
+ &.product, &.user {
363
+ > div {
364
+ > .cmd-custom-headline {
365
+ margin-top: var(--default-margin);
366
+ justify-content: center;
367
+ }
368
+ }
369
+ }
370
+
171
371
  &.product {
172
372
  text-decoration: none;
173
373
  overflow: hidden;
@@ -246,12 +446,6 @@ export default {
246
446
  font-size: 6rem;
247
447
  color: var(--pure-white);
248
448
  }
249
-
250
- h3 {
251
- margin-top: var(--default-margin);
252
- margin-bottom: 0;
253
- text-align: center;
254
- }
255
449
  }
256
450
 
257
451
  .box-body {
@@ -273,34 +467,37 @@ export default {
273
467
  margin-top: auto;
274
468
  border-top: var(--default-border);
275
469
 
276
- ul {
277
- margin: 0;
278
-
279
- li {
280
- flex: 1;
281
- margin: 0;
282
- list-style-type: none;
283
-
284
- a {
285
- display: block;
286
- padding: var(--default-padding);
287
- text-align: center;
288
- background: var(--pure-white);
289
- border-left: var(--default-border);
290
470
 
471
+ .cmd-list-of-links {
472
+ ul {
473
+ margin-bottom: 0;
291
474
 
292
- }
475
+ li {
476
+ flex: 1;
293
477
 
294
- &:hover, &:active, &:focus {
295
478
  a {
296
- background: var(--primary-color);
297
- color: var(--pure-white);
479
+ flex: 1;
480
+ padding: var(--default-padding);
481
+ text-align: center;
482
+ background: var(--pure-white);
483
+ border-left: var(--default-border);
298
484
  }
299
- }
300
485
 
301
- &:first-child {
302
- a {
303
- border: 0;
486
+ &:hover, &:active, &:focus {
487
+ a {
488
+ background: var(--primary-color);
489
+ color: var(--pure-white);
490
+
491
+ span, span[class*="icon"] {
492
+ color: var(--pure-white);
493
+ }
494
+ }
495
+ }
496
+
497
+ &:first-child {
498
+ a {
499
+ border: 0;
500
+ }
304
501
  }
305
502
  }
306
503
  }
@@ -1,63 +1,152 @@
1
1
  <template>
2
- <fieldset class="cmd-box-sitesearch flex-container">
3
- <h3>Headline</h3>
2
+ <fieldset class="cmd-box-site-search flex-container">
3
+ <!-- begin legend -->
4
+ <legend v-if="showLegend">{{ textLegend }}</legend>
5
+ <!-- begin legend -->
6
+
7
+ <!-- begin CmdCustomHeadline -->
8
+ <CmdCustomHeadline
9
+ v-if="cmdCustomHeadline"
10
+ v-bind="cmdCustomHeadline"
11
+ />
12
+ <!-- end CmdCustomHeadline -->
13
+
14
+ <!-- begin form-elements -->
4
15
  <div class="flex-container">
5
- <CmdFormElement element="input" type="text" labelText="What do you like to search for?"
6
- placeholder="Search"/>
7
- <CmdFormElement element="input" type="text" labelText="Where do you want to search?"
8
- placeholder="Zip, City"/>
9
- <CmdFormElement element="button" :buttonText="buttonText"
10
- :buttonIcon="{iconClass: 'icon-search', iconPosition: 'before'}"
11
- @click="$emit('click', $event)" aria-live="assertive"/>
16
+ <!-- begin CmdFormElement -->
17
+ <CmdFormElement
18
+ element="input"
19
+ type="text"
20
+ :labelText="getMessage('cmdsitesearch.labeltext.what_to_search')"
21
+ :placeholder="getMessage('cmdsitesearch.placeholder.what_to_search')"
22
+ />
23
+ <!-- end CmdFormElement -->
24
+
25
+ <!-- begin CmdFormElement -->
26
+ <CmdFormElement
27
+ element="input"
28
+ type="text"
29
+ :labelText="getMessage('cmdsitesearch.labeltext.where_to_search')"
30
+ :placeholder="getMessage('cmdsitesearch.placeholder.where_to_search')"
31
+ />
32
+ <!-- end CmdFormElement -->
33
+
34
+ <!-- begin CmdFormElement -->
35
+ <CmdFormElement
36
+ element="button"
37
+ :buttonText="buttonText"
38
+ :buttonIcon="{iconClass: 'icon-search', iconPosition: 'before'}"
39
+ @click="$emit('click', $event)"
40
+ aria-live="assertive"
41
+ />
42
+ <!-- end CmdFormElement -->
12
43
  </div>
13
- <a href="#" @click.prevent="showFilter = !showFilter">
14
- <span :class="showFilter ? 'icon-single-arrow-up' : 'icon-single-arrow-down'"></span>
15
- <span v-if="showFilter">Hide filter options</span>
16
- <span v-else>Show filter options</span>
17
- </a>
18
- <transition name="fade">
19
- <div class="flex-container no-flex" v-if="showFilter" aria-expanded="true">
20
- <CmdFormElement v-for="(filter, index) in filters" element="input" type="checkbox"
21
- :labelText="filter.labelText" :inputValue="filter.value" :key="index"/>
22
- </div>
23
- </transition>
44
+ <!-- end form-elements -->
45
+
46
+ <!-- begin filters -->
47
+ <template v-if="useFilters">
48
+ <a href="#" @click.prevent="showFilters = !showFilters">
49
+ <span :class="showFilters ? 'icon-single-arrow-up' : 'icon-single-arrow-down'"></span>
50
+ <span v-if="showFilters">{{ getMessage("cmdsitesearch.hide_filter_options") }}</span>
51
+ <span v-else>{{ getMessage("cmdsitesearch.show_filter_options") }}</span>
52
+ </a>
53
+ <transition name="fade">
54
+ <div v-if="showFilters && listOfFilters.length" class="flex-container no-flex" aria-expanded="true">
55
+ <!-- begin CmdFakeSelect -->
56
+ <CmdFakeSelect
57
+ :selectData="listOfFilters"
58
+ v-model="fakeSelectFilters"
59
+ defaultOptionName="Select filters:"
60
+ type="checkboxOptions"
61
+ labelText="Filters:"
62
+ />
63
+ <!-- end CmdFakeSelect -->
64
+ </div>
65
+ </transition>
66
+ </template>
67
+ <!-- end filters -->
24
68
  </fieldset>
69
+ <CmdFormFilters v-if="useFilters" v-model="fakeSelectFilters" :selectedOptionsName="getOptionName"/>
25
70
  </template>
26
71
 
27
72
  <script>
28
- import CmdFormElement from "./CmdFormElement.vue"
73
+ // import mixins
74
+ import I18n from "../mixins/I18n"
75
+ import DefaultMessageProperties from "../mixins/CmdSiteSearch/DefaultMessageProperties"
76
+
77
+ // import files for components
78
+ import CmdCustomHeadline from "./CmdCustomHeadline"
79
+ import CmdFakeSelect from "./CmdFakeSelect"
80
+ import CmdFormElement from "./CmdFormElement"
81
+ import CmdFormFilters from "./CmdFormFilters"
29
82
 
30
83
  export default {
31
- name: "CmdBoxSiteSearch.vue",
84
+ name: "CmdBoxSiteSearch",
85
+ mixins: [I18n, DefaultMessageProperties],
32
86
  components: {
33
- CmdFormElement
87
+ CmdCustomHeadline,
88
+ CmdFakeSelect,
89
+ CmdFormElement,
90
+ CmdFormFilters
34
91
  },
35
92
  data() {
36
93
  return {
37
- showFilter: false,
38
- filters: [
39
- {
40
- labelText: "Filter 1",
41
- value: "1"
42
- },
43
- {
44
- labelText: "Filter 2",
45
- value: "2"
46
- },
47
- {
48
- labelText: "Filter 3",
49
- value: "3"
50
- }
51
- ]
94
+ showFilters: false,
95
+ fakeSelectFilters: []
52
96
  }
53
97
  },
54
98
  props: {
99
+ modelValue: {
100
+ type: Array,
101
+ required: false
102
+ },
103
+ /**
104
+ * toggle use of filters (must configured)
105
+ */
106
+ useFilters: {
107
+ type: Boolean,
108
+ default: true
109
+ },
110
+ /**
111
+ * set list of filters
112
+ *
113
+ * useFilters-property must be activated
114
+ */
115
+ listOfFilters: {
116
+ type: Array,
117
+ required: false
118
+ },
119
+ /**
120
+ * text for legend
121
+ *
122
+ * @requiredForAccessibility: true
123
+ */
124
+ textLegend: {
125
+ type: String,
126
+ required: true
127
+ },
128
+ /**
129
+ * toggle legend visibility
130
+ *
131
+ * textLegend must be set
132
+ */
133
+ showLegend: {
134
+ type: Boolean,
135
+ default: true
136
+ },
55
137
  /**
56
138
  * send search result from outside to display inside this component
57
139
  */
58
140
  results: {
59
141
  type: [Function, Number],
60
142
  required: false
143
+ },
144
+ /**
145
+ * properties for CmdCustomHeadline-component
146
+ */
147
+ cmdCustomHeadline: {
148
+ type: Object,
149
+ required: false
61
150
  }
62
151
  },
63
152
  computed: {
@@ -67,12 +156,22 @@ export default {
67
156
  }
68
157
  return "Search"
69
158
  }
159
+ },
160
+ methods: {
161
+ getOptionName(option) {
162
+ for (let i = 0; i < this.listOfFilters.length; i++) {
163
+ if (option === this.listOfFilters[i].value) {
164
+ return this.listOfFilters[i].text
165
+ }
166
+ }
167
+ return null
168
+ }
70
169
  }
71
170
  }
72
171
  </script>
73
172
 
74
173
  <style lang="scss">
75
- .cmd-box-sitesearch {
174
+ .cmd-box-site-search {
76
175
  > a {
77
176
  [class*='icon'] {
78
177
  font-size: 1rem;