comand-component-library 3.1.45 → 3.1.46

Sign up to get free protection for your applications and to get access to all the features.
Files changed (233) 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-filter-options.json +14 -0
  16. package/src/assets/data/fake-select-options-with-icons.json +6 -12
  17. package/src/assets/data/fake-select-options.json +3 -3
  18. package/src/assets/data/list-of-links-section-anchors.json +23 -0
  19. package/src/assets/data/list-of-links-top-header-navigation.json +20 -0
  20. package/src/assets/data/list-of-links.json +42 -0
  21. package/src/assets/data/main-navigation.json +48 -0
  22. package/src/assets/data/multistep-form-progress-bar.json +33 -0
  23. package/src/assets/data/select-options.json +4 -0
  24. package/src/assets/data/{share-buttons.json → share-buttons-page-by-json.json} +8 -8
  25. package/src/assets/data/share-buttons-page-by-property.json +30 -0
  26. package/src/assets/data/switch-language.json +20 -0
  27. package/src/assets/data/table-large.json +1 -1
  28. package/src/assets/data/table-small.json +1 -1
  29. package/src/assets/styles/global-styles.scss +43 -13
  30. package/src/assets/styles/transitions.scss +21 -1
  31. package/src/components/CmdAccordion.vue +43 -42
  32. package/src/components/CmdAddressData.vue +124 -56
  33. package/src/components/CmdBackToTopButton.vue +3 -3
  34. package/src/components/CmdBankAccountData.vue +104 -0
  35. package/src/components/CmdBox.vue +253 -56
  36. package/src/components/CmdBoxSiteSearch.vue +138 -39
  37. package/src/components/CmdBoxWrapper.vue +206 -0
  38. package/src/components/CmdBreadcrumbs.vue +29 -13
  39. package/src/components/CmdCompanyLogo.vue +6 -4
  40. package/src/components/CmdCookieDisclaimer.vue +99 -75
  41. package/src/components/CmdCopyrightInformation.vue +1 -1
  42. package/src/components/CmdCustomHeadline.vue +93 -0
  43. package/src/components/CmdFakeSelect.vue +285 -60
  44. package/src/components/CmdFancyBox.vue +47 -33
  45. package/src/components/CmdForm.vue +107 -0
  46. package/src/components/CmdFormElement.vue +515 -81
  47. package/src/components/CmdFormFilters.vue +25 -11
  48. package/src/components/CmdGoogleMaps.vue +9 -3
  49. package/src/components/CmdImageGallery.vue +28 -5
  50. package/src/components/CmdImageZoom.vue +9 -1
  51. package/src/components/CmdListOfLinks.vue +169 -0
  52. package/src/components/CmdLoginForm.vue +143 -63
  53. package/src/components/CmdMainNavigation.vue +140 -42
  54. package/src/components/CmdMultipleSwitch.vue +33 -2
  55. package/src/components/CmdMultistepFormProgressBar.vue +60 -10
  56. package/src/components/CmdOpeningHours.vue +36 -10
  57. package/src/components/CmdPager.vue +7 -5
  58. package/src/components/CmdProgressBar.vue +20 -3
  59. package/src/components/CmdShareButtons.vue +64 -9
  60. package/src/components/CmdSiteHeader.vue +25 -12
  61. package/src/components/CmdSlideButton.vue +5 -2
  62. package/src/components/CmdSlideshow.vue +23 -7
  63. package/src/components/CmdSwitchButton.vue +10 -3
  64. package/src/components/CmdSwitchLanguage.vue +18 -10
  65. package/src/components/CmdSystemMessage.vue +30 -17
  66. package/src/components/CmdTable.vue +15 -7
  67. package/src/components/CmdTabs.vue +43 -3
  68. package/src/components/CmdThumbnailScroller.vue +22 -6
  69. package/src/components/CmdTooltip.vue +184 -11
  70. package/src/components/CmdUploadForm.vue +198 -92
  71. package/src/components/CmdWidthLimitationWrapper.vue +9 -6
  72. package/src/composables/event.js +8 -0
  73. package/src/composables/scrollspy.js +52 -0
  74. package/src/directives/focus.js +19 -0
  75. package/src/directives/telephone.js +1 -1
  76. package/src/documentation/commonProps.js +6 -0
  77. package/src/documentation/components/ComponentCode.vue +50 -0
  78. package/src/documentation/components/ComponentProperties.vue +237 -0
  79. package/src/documentation/components/ExampleSectionWrapper.vue +46 -0
  80. package/src/documentation/components/ViewCodeData.vue +113 -0
  81. package/src/documentation/data/CmdAccordionHelp.js +22 -0
  82. package/src/documentation/data/CmdAddressDataHelp.js +17 -0
  83. package/src/documentation/data/CmdBackToTopButtonHelp.js +3 -0
  84. package/src/documentation/data/CmdBankAccountDataHelp.js +8 -0
  85. package/src/documentation/data/CmdBoxHelp.js +45 -0
  86. package/src/documentation/data/CmdBoxSiteSearchHelp.js +11 -0
  87. package/src/documentation/data/CmdBreadcrumbsHelp.js +6 -0
  88. package/src/documentation/data/CmdCompanyLogoHelp.js +8 -0
  89. package/src/documentation/data/CmdCookieDisclaimerHelp.js +9 -0
  90. package/src/documentation/data/CmdCopyrightInformation.js +2 -0
  91. package/src/documentation/data/CmdCustomHeadlineHelp.js +8 -0
  92. package/src/documentation/data/CmdFakeSelectHelp.js +60 -0
  93. package/src/documentation/data/CmdFancyBoxHelp.js +7 -0
  94. package/src/documentation/data/CmdFooterNavigationHelp.js +5 -0
  95. package/src/documentation/data/CmdFormElementHelp.js +189 -0
  96. package/src/documentation/data/CmdFormFiltersHelp.js +6 -0
  97. package/src/documentation/data/CmdFormHelp.js +10 -0
  98. package/src/documentation/data/CmdGoogleMapsHelp.js +5 -0
  99. package/src/documentation/data/CmdImageGalleryHelp.js +5 -0
  100. package/src/documentation/data/CmdImageZoomHelp.js +6 -0
  101. package/src/documentation/data/CmdListOfLinksHelp.js +24 -0
  102. package/src/documentation/data/CmdLoginFormHelp.js +6 -0
  103. package/src/documentation/data/CmdMainNavigationHelp.js +7 -0
  104. package/src/documentation/data/CmdMultistepFormProgressBarHelp.js +6 -0
  105. package/src/documentation/data/CmdOpeningHoursHelp.js +10 -0
  106. package/src/documentation/data/CmdPagerHelp.js +7 -0
  107. package/src/documentation/data/CmdProgressBarHelp.js +13 -0
  108. package/src/documentation/data/CmdShareButtonsHelp.js +13 -0
  109. package/src/documentation/data/CmdSiteHeaderHelp.js +21 -0
  110. package/src/documentation/data/CmdSlideButtonHelp.js +10 -0
  111. package/src/documentation/data/CmdSlideshowHelp.js +7 -0
  112. package/src/documentation/data/CmdSwitchLanguageHelp.js +6 -0
  113. package/src/documentation/data/CmdSystemMessageHelp.js +32 -0
  114. package/src/documentation/data/CmdTableHelp.js +14 -0
  115. package/src/documentation/data/CmdTabsHelp.js +10 -0
  116. package/src/documentation/data/CmdThumbnailScrollerHelp.js +5 -0
  117. package/src/documentation/data/CmdTooltipHelp.js +13 -0
  118. package/src/documentation/data/CmdUploadFormHelp.js +17 -0
  119. package/src/documentation/data/CmdWidthLimitationWrapperHelp.js +7 -0
  120. package/src/documentation/data/componentsDescription.json +158 -0
  121. package/src/documentation/generated/CmdAccordionPropertyDescriptions.json +57 -0
  122. package/src/documentation/generated/CmdAddressDataPropertyDescriptions.json +32 -0
  123. package/src/documentation/generated/CmdBackToTopButtonPropertyDescriptions.json +12 -0
  124. package/src/documentation/generated/CmdBankAccountDataPropertyDescriptions.json +34 -0
  125. package/src/documentation/generated/CmdBoxPropertyDescriptions.json +91 -0
  126. package/src/documentation/generated/CmdBoxSiteSearchPropertyDescriptions.json +41 -0
  127. package/src/documentation/generated/CmdBoxWrapperPropertyDescriptions.json +47 -0
  128. package/src/documentation/generated/CmdBreadcrumbsPropertyDescriptions.json +17 -0
  129. package/src/documentation/generated/CmdCompanyLogoPropertyDescriptions.json +27 -0
  130. package/src/documentation/generated/CmdCookieDisclaimerPropertyDescriptions.json +22 -0
  131. package/src/documentation/generated/CmdCustomHeadlinePropertyDescriptions.json +22 -0
  132. package/src/documentation/generated/CmdFakeSelectPropertyDescriptions.json +79 -0
  133. package/src/documentation/generated/CmdFancyBoxPropertyDescriptions.json +62 -0
  134. package/src/documentation/generated/CmdFooterNavigationPropertyDescriptions.json +17 -0
  135. package/src/documentation/generated/CmdFormElementPropertyDescriptions.json +178 -0
  136. package/src/documentation/generated/CmdFormFiltersPropertyDescriptions.json +32 -0
  137. package/src/documentation/generated/CmdFormPropertyDescriptions.json +40 -0
  138. package/src/documentation/generated/CmdGoogleMapsPropertyDescriptions.json +7 -0
  139. package/src/documentation/generated/CmdImageGalleryPropertyDescriptions.json +22 -0
  140. package/src/documentation/generated/CmdImageZoomPropertyDescriptions.json +12 -0
  141. package/src/documentation/generated/CmdListOfLinksPropertyDescriptions.json +60 -0
  142. package/src/documentation/generated/CmdLoginFormPropertyDescriptions.json +90 -0
  143. package/src/documentation/generated/CmdMainNavigationPropertyDescriptions.json +62 -0
  144. package/src/documentation/generated/CmdMultipleSwitchPropertyDescriptions.json +52 -0
  145. package/src/documentation/generated/CmdMultistepFormProgressBarPropertyDescriptions.json +17 -0
  146. package/src/documentation/generated/CmdOpeningHoursPropertyDescriptions.json +42 -0
  147. package/src/documentation/generated/CmdPagerPropertyDescriptions.json +37 -0
  148. package/src/documentation/generated/CmdProgressBarPropertyDescriptions.json +32 -0
  149. package/src/documentation/generated/CmdShareButtonsPropertyDescriptions.json +34 -0
  150. package/src/documentation/generated/CmdSiteHeaderPropertyDescriptions.json +27 -0
  151. package/src/documentation/generated/CmdSlideButtonPropertyDescriptions.json +25 -0
  152. package/src/documentation/generated/CmdSlideshowPropertyDescriptions.json +42 -0
  153. package/src/documentation/generated/CmdSwitchButtonPropertyDescriptions.json +79 -0
  154. package/src/documentation/generated/CmdSwitchLanguagePropertyDescriptions.json +7 -0
  155. package/src/documentation/generated/CmdSystemMessagePropertyDescriptions.json +40 -0
  156. package/src/documentation/generated/CmdTablePropertyDescriptions.json +62 -0
  157. package/src/documentation/generated/CmdTabsPropertyDescriptions.json +27 -0
  158. package/src/documentation/generated/CmdThumbnailScrollerPropertyDescriptions.json +32 -0
  159. package/src/documentation/generated/CmdTooltipPropertyDescriptions.json +17 -0
  160. package/src/documentation/generated/CmdUploadFormPropertyDescriptions.json +90 -0
  161. package/src/documentation/generated/CmdWidthLimitationWrapperPropertyDescriptions.json +41 -0
  162. package/src/documentation/generated/frameworkIcons.json +730 -0
  163. package/src/documentation/generated/logosIcons.json +110 -0
  164. package/src/documentation/tabs.js +46 -0
  165. package/src/documentation/views/ContainerPage.vue +237 -0
  166. package/src/documentation/views/HelpHome.vue +13 -0
  167. package/src/documentation/views/IconFont.vue +80 -0
  168. package/src/documentation/views/components/CmdAccordionHelp.vue +78 -0
  169. package/src/documentation/views/components/CmdAddressDataHelp.vue +65 -0
  170. package/src/documentation/views/components/CmdBackToTopButtonHelp.vue +62 -0
  171. package/src/documentation/views/components/CmdBankAccountDataHelp.vue +88 -0
  172. package/src/documentation/views/components/CmdBoxHelp.vue +137 -0
  173. package/src/documentation/views/components/CmdBoxSiteSearchHelp.vue +60 -0
  174. package/src/documentation/views/components/CmdBoxWrapperHelp.vue +111 -0
  175. package/src/documentation/views/components/CmdBreadcrumbsHelp.vue +51 -0
  176. package/src/documentation/views/components/CmdCompanyLogoHelp.vue +48 -0
  177. package/src/documentation/views/components/CmdCookieDisclaimerHelp.vue +105 -0
  178. package/src/documentation/views/components/CmdCustomHeadlineHelp.vue +53 -0
  179. package/src/documentation/views/components/CmdFakeSelectHelp.vue +175 -0
  180. package/src/documentation/views/components/CmdFancyBoxHelp.vue +79 -0
  181. package/src/documentation/views/components/CmdFormElementHelp.vue +412 -0
  182. package/src/documentation/views/components/CmdFormFiltersHelp.vue +69 -0
  183. package/src/documentation/views/components/CmdFormHelp.vue +41 -0
  184. package/src/documentation/views/components/CmdGoogleMapsHelp.vue +55 -0
  185. package/src/documentation/views/components/CmdImageGalleryHelp.vue +46 -0
  186. package/src/documentation/views/components/CmdImageZoomHelp.vue +34 -0
  187. package/src/documentation/views/components/CmdListOfLinksHelp.vue +64 -0
  188. package/src/documentation/views/components/CmdLoginFormHelp.vue +117 -0
  189. package/src/documentation/views/components/CmdMainNavigationHelp.vue +94 -0
  190. package/src/documentation/views/components/CmdMultistepFormProgressBarHelp.vue +49 -0
  191. package/src/documentation/views/components/CmdOpeningHoursHelp.vue +49 -0
  192. package/src/documentation/views/components/CmdPagerHelp.vue +57 -0
  193. package/src/documentation/views/components/CmdProgressBarHelp.vue +47 -0
  194. package/src/documentation/views/components/CmdShareButtonsHelp.vue +65 -0
  195. package/src/documentation/views/components/CmdSiteHeaderHelp.vue +72 -0
  196. package/src/documentation/views/components/CmdSlideButtonHelp.vue +90 -0
  197. package/src/documentation/views/components/CmdSlideshowHelp.vue +60 -0
  198. package/src/documentation/views/components/CmdSwitchLanguageHelp.vue +64 -0
  199. package/src/documentation/views/components/CmdSystemMessageHelp.vue +86 -0
  200. package/src/documentation/views/components/CmdTableHelp.vue +84 -0
  201. package/src/documentation/views/components/CmdTabsHelp.vue +52 -0
  202. package/src/documentation/views/components/CmdThumbnailScrollerHelp.vue +50 -0
  203. package/src/documentation/views/components/CmdTooltipHelp.vue +59 -0
  204. package/src/documentation/views/components/CmdUploadFormHelp.vue +59 -0
  205. package/src/documentation/views/components/CmdWidthLimitationWrapperHelp.vue +46 -0
  206. package/src/index.js +6 -3
  207. package/src/main.js +25 -15
  208. package/src/mixins/CmdAddressData/DefaultMessageProperties.js +17 -0
  209. package/src/mixins/CmdBox/DefaultMessageProperties.js +10 -0
  210. package/src/mixins/CmdFakeSelect/DefaultMessageProperties.js +9 -0
  211. package/src/mixins/CmdFormElement/DefaultMessageProperties.js +9 -0
  212. package/src/mixins/CmdImageGallery/DefaultMessageProperties.js +9 -0
  213. package/src/mixins/CmdSiteSearch/DefaultMessageProperties.js +14 -0
  214. package/src/mixins/CmdUploadForm/DefaultMessageProperties.js +5 -1
  215. package/src/mixins/FieldValidation.js +220 -0
  216. package/src/mixins/GlobalDefaultMessageProperties.js +15 -0
  217. package/src/mixins/Tooltip.js +26 -0
  218. package/src/router/index.js +67 -0
  219. package/src/utilities.js +3 -6
  220. package/src/utils/common.js +6 -0
  221. package/src/utils/dom.js +8 -0
  222. package/src/utils/globalSequence.js +13 -0
  223. package/src/utils/string.js +8 -0
  224. package/src/assets/data/address.json +0 -13
  225. package/src/assets/data/footer-navigation.json +0 -38
  226. package/src/assets/data/languages.json +0 -31
  227. package/src/assets/data/multisteps.json +0 -27
  228. package/src/assets/data/navigation.json +0 -47
  229. package/src/assets/data/pager.json +0 -11
  230. package/src/assets/data/top-header-navigation.json +0 -27
  231. package/src/components/CmdFooterNavigation.vue +0 -71
  232. package/src/components/CmdMainHeadline.vue +0 -75
  233. package/src/components/CmdTopHeaderNavigation.vue +0 -88
@@ -1,15 +1,18 @@
1
1
  <template>
2
- <fieldset :class="['my-sp-upload-form flex-container', { 'upload-initiated': uploadInitiated }]">
3
- <h3 v-if="headline">{{ headline }}</h3>
2
+ <!-- begin advanced mode -->
3
+ <fieldset v-if="advancedMode" :class="['cmd-upload-form flex-container', { 'upload-initiated': uploadInitiated }]">
4
+ <!-- begin CmdCustomHeadline -->
5
+ <CmdCustomHeadline v-if="cmdCustomHeadline"
6
+ v-bind="cmdCustomHeadline"
7
+ />
8
+ <!-- end CmdCustomHeadline -->
9
+
10
+ <!-- begin CmdSystemMessage -->
4
11
  <CmdSystemMessage
5
12
  v-if="systemMessageStatus && allSystemMessages.length"
6
- :closeIcon="{ show: false }"
7
- :status="systemMessageStatus"
8
- :systemMessage="
9
- allSystemMessages.length === 1
10
- ? allSystemMessages[0]
11
- : getMessage('cmduploadform.system_message.the_following_errors_occurred')
12
- "
13
+ :iconClose="{ show: false }"
14
+ :validationStatus="systemMessageStatus"
15
+ :systemMessage="allSystemMessages.length === 1 ? allSystemMessages[0] : getMessage('cmduploadform.system_message.the_following_errors_occurred')"
13
16
  >
14
17
  <ul v-if="allSystemMessages.length > 1">
15
18
  <li v-for="(systemMessage, index) in allSystemMessages" :key="index">
@@ -17,7 +20,9 @@
17
20
  </li>
18
21
  </ul>
19
22
  </CmdSystemMessage>
20
- <div :class="['box', { 'allow-drop': allowDrop }]" v-on="dragAndDropHandler">
23
+ <!-- end CmdSystemMessage -->
24
+
25
+ <div :class="['box drop-area', { 'allow-drop': allowDrop }]" v-on="dragAndDropHandler">
21
26
  <template v-if="!listOfFiles.length">
22
27
  <h4 v-if="allowMultipleFileUploads">
23
28
  {{ getMessage("cmduploadform.no_files_to_upload") }}
@@ -56,13 +61,13 @@
56
61
  </strong>
57
62
  </span>
58
63
  <span class="progressbar" v-if="uploadInitiated">
59
- <span>{{ getPercentage(totalUploadProgress) }}</span>
60
- <progress
61
- max="100"
62
- :value="totalUploadProgress"
63
- :title="totalBytesUploaded"
64
- ></progress>
65
- </span>
64
+ <span>{{ getPercentage(totalUploadProgress) }}</span>
65
+ <progress
66
+ max="100"
67
+ :value="totalUploadProgress"
68
+ :title="totalBytesUploaded"
69
+ ></progress>
70
+ </span>
66
71
  </li>
67
72
  </ul>
68
73
  <hr/>
@@ -95,7 +100,7 @@
95
100
  <template v-if="uploadInitiated && !uploadFile.error">
96
101
  <span class="progressbar">
97
102
  <span>{{ getPercentage(uploadFile.progress) }}</span>
98
- <!-- do not place inside progress-tag (will not be displayed then) -->
103
+ <!-- do not place inside progress-tag (will not be displayed then) -->
99
104
  <progress
100
105
  max="100"
101
106
  :value="uploadFile.progress"
@@ -131,14 +136,14 @@
131
136
  {{ getMessage("cmduploadform.max_total_upload_size") }}
132
137
  </dt>
133
138
  <dd :class="['text-align-right', { error: totalSize > maxTotalUploadSize }]">
134
- {{ formatSize(this.maxTotalUploadSize) }}
139
+ {{ formatSize(maxTotalUploadSize) }}
135
140
  </dd>
136
141
  </template>
137
142
  <dt :class="{ error: errors.fileSize }">
138
143
  {{ getMessage("cmduploadform.max_file_upload_size") }}
139
144
  </dt>
140
145
  <dd :class="['text-align-right', { error: errors.fileSize }]">
141
- {{ formatSize(this.maxFileUploadSize) }}
146
+ {{ formatSize(maxFileUploadSize) }}
142
147
  </dd>
143
148
  <dt :class="{ error: errors.fileType }">
144
149
  {{ getMessage("cmduploadform.allowed_file_types") }}
@@ -176,30 +181,21 @@
176
181
  }}</span>
177
182
  <span v-else>{{ getMessage("cmduploadform.labeltext.select_file") }}</span>
178
183
  </button>
179
- <CmdFormElement
180
- element="input"
181
- type="file"
182
- :labelText="getMessage('cmduploadform.labeltext.select_files')"
183
- :disabled="uploadInitiated"
184
- :multiple="allowMultipleFileUploads"
185
- @change="filesSelected"
186
- />
187
184
  <p v-if="enableDragAndDrop" :class="['text-drag-and-drop', { disabled: uploadInitiated }]">
188
185
  <span>{{ getMessage("cmduploadform.or") }}</span>
189
186
  <strong>
190
187
  {{ getMessage("cmduploadform.drag_and_drop") }}
191
188
  <template v-if="allowMultipleFileUploads && listOfFiles.length">
192
189
  {{ getMessage("cmduploadform.additional") }}
193
- </template
194
- >
190
+ </template>
195
191
  <template v-if="!allowMultipleFileUploads && listOfFiles.length">
196
192
  {{ getMessage("cmduploadform.new") }}
197
- </template
198
- >
193
+ </template>
199
194
  {{ getMessage("cmduploadform.files_to_this_area") }}
200
195
  </strong>
201
196
  </p>
202
197
  </div>
198
+ <!-- begin CmdFormElement -->
203
199
  <CmdFormElement
204
200
  v-if="enableComment"
205
201
  element="textarea"
@@ -210,50 +206,109 @@
210
206
  :placeholder="getMessage('cmduploadform.placeholder.comment')"
211
207
  :status="commentStatusMessage ? 'error' : ''"
212
208
  />
209
+ <!-- end CmdFormElement -->
210
+
213
211
  <div class="button-wrapper no-flex">
214
212
  <button
215
213
  :class="[
216
- 'button primary',
217
- {
218
- disabled:
219
- listOfFiles.length === 0 ||
220
- (maxTotalUploadSize > 0 && totalSize > maxTotalUploadSize) ||
221
- uploadInitiated
222
- }
223
- ]"
214
+ 'button primary',
215
+ {
216
+ disabled:
217
+ listOfFiles.length === 0 ||
218
+ (maxTotalUploadSize > 0 && totalSize > maxTotalUploadSize) ||
219
+ uploadInitiated
220
+ }
221
+ ]"
224
222
  :disabled="
225
- listOfFiles.length === 0 ||
226
- (maxTotalUploadSize > 0 && totalSize > maxTotalUploadSize) ||
227
- uploadInitiated
228
- "
223
+ listOfFiles.length === 0 ||
224
+ (maxTotalUploadSize > 0 && totalSize > maxTotalUploadSize) ||
225
+ uploadInitiated
226
+ "
229
227
  @click="uploadFiles"
230
228
  >
231
- <span class="icon-upload"></span
232
- ><span v-if="listOfFiles.length === 1 || !allowMultipleFileUploads">{{
233
- getMessage("cmduploadform.buttontext.upload_file")
234
- }}</span>
229
+ <span class="icon-upload"></span>
230
+ <span v-if="listOfFiles.length === 1 || !allowMultipleFileUploads">
231
+ {{ getMessage("cmduploadform.buttontext.upload_file") }}
232
+ </span>
235
233
  <span v-else>{{ getMessage("cmduploadform.buttontext.upload_files") }}</span>
236
234
  </button>
237
235
  <button :class="['button', { disabled: listOfFiles.length === 0 }]" @click="cancel">
238
- <span class="icon-cancel"></span
239
- ><span>{{ getMessage("cmduploadform.buttontext.cancel") }}</span>
236
+ <span class="icon-cancel"></span>
237
+ <span>{{ getMessage("cmduploadform.buttontext.cancel") }}</span>
240
238
  </button>
241
239
  </div>
242
240
  </fieldset>
241
+ <!-- end advanced mode -->
242
+
243
+ <!-- begin simple mode -->
244
+ <a v-else href="#" @click.prevent="selectFiles" :class="['cmd-upload-form drop-area', {'allow-drop': allowDrop }]" v-on="dragAndDropHandler">
245
+ <span class="progressbar" v-if="uploadInitiated">
246
+ <span>{{ getPercentage(totalUploadProgress) }}</span>
247
+ <progress
248
+ max="100"
249
+ :value="totalUploadProgress"
250
+ :title="totalBytesUploaded">
251
+ </progress>
252
+ </span>
253
+
254
+ <!-- begin slot-content -->
255
+ <slot>
256
+ <template v-if="enableDragAndDrop">
257
+ <template v-if="fileTypeImage">
258
+ <span>{{ getMessage("cmduploadform.select_image") }}</span>
259
+ <span class="icon-image"></span>
260
+ </template>
261
+ <template v-else>
262
+ <span>{{ getMessage("cmduploadform.select_file") }}</span>
263
+ <span class="icon-file"></span>
264
+ </template>
265
+ </template>
266
+ <template v-else>
267
+ <span>{{ getMessage("cmduploadform.drag_and_drop_file_here") }}</span>
268
+ <span class="icon-drag-and-drop"></span>
269
+ </template>
270
+ <small>{{ getMessage("cmduploadform.max_upload_size") }} {{ formatSize(maxFileUploadSize) }}</small>
271
+ <small>{{ getMessage("cmduploadform.allowed_file_types") }} {{ allowedFileExtensions }}</small>
272
+ </slot>
273
+ <!-- end slot-content -->
274
+ </a>
275
+ <!-- end simple mode -->
276
+
277
+ <!-- begin CmdFormElement -->
278
+ <CmdFormElement
279
+ element="input"
280
+ type="file"
281
+ :labelText="getMessage('cmduploadform.labeltext.select_files')"
282
+ :disabled="uploadInitiated"
283
+ :multiple="allowMultipleFileUploads"
284
+ @change="filesSelected"
285
+ ref="formElement"
286
+ />
287
+ <!-- end CmdFormElement -->
243
288
  </template>
244
289
 
245
290
  <script>
291
+ // import mixins
246
292
  import I18n from "../mixins/I18n"
247
293
  import DefaultMessageProperties from "../mixins/CmdUploadForm/DefaultMessageProperties"
294
+
248
295
  import {getFileExtension} from "../utils/GetFileExtension.js"
249
296
  import axios from "axios"
250
297
 
298
+ // import components
299
+ import CmdCustomHeadline from "./CmdCustomHeadline"
251
300
  import CmdFormElement from "./CmdFormElement"
252
301
  import CmdSystemMessage from "./CmdSystemMessage"
253
302
 
254
-
255
303
  export default {
256
304
  name: "CmdUploadForm",
305
+ emits: ["click", "error", "upload-complete", "upload-file-success"],
306
+ mixins: [I18n, DefaultMessageProperties],
307
+ components: {
308
+ CmdCustomHeadline,
309
+ CmdFormElement,
310
+ CmdSystemMessage,
311
+ },
257
312
  data() {
258
313
  return {
259
314
  comment: "",
@@ -267,11 +322,6 @@ export default {
267
322
  errors: {}
268
323
  }
269
324
  },
270
- mixins: [I18n, DefaultMessageProperties],
271
- components: {
272
- CmdSystemMessage,
273
- CmdFormElement
274
- },
275
325
  created() {
276
326
  // Set initial data for resetForm.
277
327
  this.resetForm.comment = this.presetComment
@@ -309,19 +359,29 @@ export default {
309
359
  type: Array,
310
360
  required: true
311
361
  },
362
+ /**
363
+ * activate if the comment given by the user should be mandatory
364
+ *
365
+ * enableComment-property must be set to true
366
+ */
312
367
  commentRequired: {
313
368
  type: Boolean,
314
369
  default: true
315
370
  },
371
+ /**
372
+ * show a message if mandatory comment-textarea is not filled
373
+ *
374
+ * enableComment-property and commentRequired-property must be set to true
375
+ */
316
376
  commentStatusMessage: {
317
377
  type: String,
318
378
  default: ""
319
379
  },
320
380
  /**
321
- * set an optional headlien for the fieldset
381
+ * properties for CmdCustomHeadline-component
322
382
  */
323
- headline: {
324
- type: String,
383
+ cmdCustomHeadline: {
384
+ type: Object,
325
385
  required: false
326
386
  },
327
387
  /**
@@ -331,10 +391,22 @@ export default {
331
391
  type: Boolean,
332
392
  default: false
333
393
  },
394
+ /**
395
+ * enable if a comment should be possible to left by the user
396
+ */
334
397
  enableComment: {
335
398
  type: Boolean,
336
399
  default: true
337
400
  },
401
+ /**
402
+ * preset the comment-textarea
403
+ *
404
+ * enableComment-property must be set to true
405
+ */
406
+ presetComment: {
407
+ type: String,
408
+ default: ""
409
+ },
338
410
  /**
339
411
  * set to 0 if no maximum for total upload size should be set
340
412
  */
@@ -349,31 +421,37 @@ export default {
349
421
  type: Number,
350
422
  default: 10485760
351
423
  },
424
+ /**
425
+ * enable if more than file should be enabled to be selected for upload
426
+ */
352
427
  allowMultipleFileUploads: {
353
428
  type: Boolean,
354
429
  default: false
355
430
  },
356
- presetComment: {
357
- type: String,
358
- default: ""
359
- },
360
431
  /**
361
- * defines upload options if component handles upload itself
362
- * (componentHandlesUpload-property must be true)
432
+ * defines upload options if component handles upload itself
363
433
  *
364
- * Example:
365
- * <pre>
366
- * url: String,
367
- * filesParam: String,
368
- * additionalParams: {}
369
- * </pre>
434
+ * componentHandlesUpload-property must be true
370
435
  */
371
436
  uploadOptions: {
372
437
  type: Object,
373
438
  required: false
439
+ },
440
+ /**
441
+ * activate to use full upload-form-style and -functionality
442
+ *
443
+ * @affectsStyling: true
444
+ */
445
+ advancedMode: {
446
+ type: Boolean,
447
+ default: true
374
448
  }
375
449
  },
376
450
  computed: {
451
+ fileTypeImage() {
452
+ return this.allowedFileExtensions.some(extension => extension.includes('jpg'));
453
+
454
+ },
377
455
  failedUpload() {
378
456
  return this.listOfFiles.some(file => file.error)
379
457
  },
@@ -447,7 +525,7 @@ export default {
447
525
  return getFileExtension(filename)
448
526
  },
449
527
  selectFiles() {
450
- let inputFile = this.$el.querySelector('input[type="file"]')
528
+ let inputFile = this.$refs.formElement.getDomElement().querySelector("input[type='file']")
451
529
  inputFile.click()
452
530
  },
453
531
  dragEnter(event) {
@@ -514,7 +592,11 @@ export default {
514
592
  this.checkFiles(event.target.files)
515
593
  },
516
594
  checkFiles(files) {
517
- this.defaultSystemMessageStatus = "" // hide systemMessage if already is shown
595
+ if (!files.length) {
596
+ return
597
+ }
598
+
599
+ this.defaultSystemMessageStatus = ""; // hide systemMessage if already is shown
518
600
  this.systemMessages = [] // hide systemMessage if already is shown
519
601
  this.errors = {}
520
602
 
@@ -584,6 +666,16 @@ export default {
584
666
  break
585
667
  }
586
668
  }
669
+
670
+ if (!this.advancedMode) {
671
+ if (this.systemMessages.length) {
672
+ this.$emit("error", {messages: this.systemMessages})
673
+ return
674
+ }
675
+ if (this.listOfFiles.length) {
676
+ this.uploadFiles()
677
+ }
678
+ }
587
679
  },
588
680
  compareFiles(file1, file2) {
589
681
  return (
@@ -763,19 +855,11 @@ export default {
763
855
  </script>
764
856
 
765
857
  <style lang="scss">
766
- /* begin my-sp-upload-form -------------------------------------------------------------------------------------------- */
767
- .my-sp-upload-form {
858
+ /* begin cmd-upload-form -------------------------------------------------------------------------------------------- */
859
+ .cmd-upload-form {
768
860
  .box {
769
- padding: (var(--default-padding));
770
- text-align: center;
771
- border-style: dashed;
772
861
  background: var(--pure-white-reduced-opacity);
773
862
 
774
- &.allow-drop {
775
- border-style: solid;
776
- background: var(--pure-white);
777
- }
778
-
779
863
  dl {
780
864
  justify-content: center;
781
865
  text-align: left;
@@ -864,17 +948,9 @@ export default {
864
948
  }
865
949
  }
866
950
 
867
- textarea {
868
- min-height: 0;
869
- }
870
-
871
951
  .button.upload {
872
952
  align-self: center;
873
953
 
874
- & + .cmd-form-element {
875
- display: none;
876
- }
877
-
878
954
  & ~ p {
879
955
  & > * {
880
956
  display: block;
@@ -885,7 +961,37 @@ export default {
885
961
  .error {
886
962
  color: var(--error-color);
887
963
  }
964
+
965
+ & + .cmd-form-element {
966
+ display: none;
967
+ }
888
968
  }
889
969
 
890
- /* end my-sp-upload-form ---------------------------------------------------------------------------------------------- */
970
+ .drop-area {
971
+ border: var(--default-border);
972
+ border-style: dashed;
973
+ background: var(--pure-white);
974
+ padding: (var(--default-padding));
975
+ text-align: center;
976
+
977
+ &.allow-drop {
978
+ border-style: solid;
979
+ }
980
+
981
+ > span[class*="icon"] {
982
+ font-size: 5rem;
983
+ }
984
+ }
985
+
986
+ a.drop-area {
987
+ display: inline-flex;
988
+ flex-direction: column;
989
+ text-decoration: none;
990
+ background: var(--default-background-color);
991
+
992
+ span {
993
+ margin: 0;
994
+ }
995
+ }
996
+ /* end cmd-upload-form ---------------------------------------------------------------------------------------------- */
891
997
  </style>
@@ -2,11 +2,15 @@
2
2
  <div class="cmd-width-limitation-wrapper" :class="{'sticky': sticky}">
3
3
  <component v-if="innerWrapper" :is="innerComponent" :class="setInnerClass">
4
4
  <a v-if="anchorId" :id="anchorId"></a>
5
+ <!-- begin slot-content -->
5
6
  <slot></slot>
7
+ <!-- end slot-content -->
6
8
  </component>
7
9
  <template v-else>
10
+ <!-- begin slot-content -->
8
11
  <a v-if="anchorId" :id="anchorId"></a>
9
12
  <slot></slot>
13
+ <!-- end slot-content -->
10
14
  </template>
11
15
  </div>
12
16
  </template>
@@ -17,6 +21,8 @@ export default {
17
21
  props: {
18
22
  /**
19
23
  * set a html-tag as inner tag
24
+ *
25
+ * @allowedValues: section, div
20
26
  */
21
27
  innerComponent: {
22
28
  type: String,
@@ -26,16 +32,17 @@ export default {
26
32
  }
27
33
  },
28
34
  /**
29
- * activate if the inner content should be wrapped in inner component tag
35
+ * activate if the inner content should be wrapped in inner component tag (recommended)
30
36
  *
31
37
  * (if deactivated, content will be directly placed inside cmd-width-limitation-wrapper)
38
+ *
32
39
  */
33
40
  innerWrapper: {
34
41
  type: Boolean,
35
42
  default: true
36
43
  },
37
44
  /**
38
- * activate if wrapper (and its content) should be sticky (=postion remains the same if content below is scrolled)
45
+ * activate if wrapper (and its content) should be sticky (=position remains the same if content below is scrolled)
39
46
  *
40
47
  * i.e. use for site-header
41
48
  *
@@ -104,10 +111,6 @@ export default {
104
111
  top: 0;
105
112
  }
106
113
 
107
- &#site-footer {
108
-
109
- }
110
-
111
114
  &#site-footer {
112
115
  padding: var(--grid-gap) 0;
113
116
  border-top: var(--default-border);
@@ -0,0 +1,8 @@
1
+ import {onMounted, onUnmounted} from "vue"
2
+
3
+ function useEventListener(target, event, listener) {
4
+ onMounted(() => target.addEventListener(event, listener))
5
+ onUnmounted(() => target.removeEventListener(event, listener))
6
+ }
7
+
8
+ export {useEventListener}
@@ -0,0 +1,52 @@
1
+ import {reactive} from "vue"
2
+ import {useEventListener} from "./event"
3
+ import {getOffsetTop} from "../utils/dom"
4
+
5
+ function toArray(items) {
6
+ if (items instanceof NodeList) {
7
+ return Array.from(items)
8
+ }
9
+ if (Array.isArray(items)) {
10
+ return items
11
+ }
12
+ return []
13
+ }
14
+
15
+ function buildItemList(itemSupplier, itemList) {
16
+ if (!itemList.length) {
17
+ const items = itemSupplier()
18
+ toArray(items).map((item, index) => {
19
+ const itemData = {
20
+ offsetTop: getOffsetTop(item)
21
+ }
22
+ if (index + 1 < items.length) {
23
+ itemData.height = getOffsetTop(items.item(index + 1)) - itemData.offsetTop
24
+ } else {
25
+ itemData.height = document.documentElement.scrollHeight - itemData.offsetTop
26
+ }
27
+ return itemData
28
+ }).forEach(item => itemList.push(item))
29
+ }
30
+ }
31
+
32
+ export function useScrollspy(itemSupplier, initialActiveItem = 0) {
33
+ const itemList = []
34
+ const scrollSpy = reactive({
35
+ activeItem: initialActiveItem,
36
+ reset() {
37
+ this.activeItem = 0
38
+ itemList.length = 0
39
+ }
40
+ })
41
+ useEventListener(window, "scroll", () => {
42
+ const sy = window.scrollY
43
+ buildItemList(itemSupplier, itemList)
44
+ for (let i = 0, c = itemList.length; i < c; i++) {
45
+ if (sy < itemList[i].offsetTop + itemList[i].height / 2) {
46
+ scrollSpy.activeItem = i
47
+ break
48
+ }
49
+ }
50
+ })
51
+ return scrollSpy
52
+ }
@@ -0,0 +1,19 @@
1
+ export default {
2
+ // el = real dom-element
3
+ mounted(el) {
4
+ // check if element is native input-element
5
+ if(el.tagName === "INPUT" || el.tagName === "SELECT" || el.tagName === "TEXTAREA") {
6
+ el.focus()
7
+ } else {
8
+ // check if component is used, which contains a native input-element
9
+ const innerInputElement = el.querySelector("input, select, textarea")
10
+ if(innerInputElement) {
11
+ innerInputElement.focus()
12
+ }
13
+ // no input-element found
14
+ else {
15
+ console.warn("No input-element for focus-directive on element " + el.tagName + " found!")
16
+ }
17
+ }
18
+ }
19
+ }
@@ -2,7 +2,7 @@ export default {
2
2
  // el = real dom-element
3
3
  // binding.value = value of v-directive
4
4
  mounted(el, binding) {
5
- if (binding.value) {
5
+ if (binding.value && typeof binding.value === "string") {
6
6
  let regex = /[^\d]/g // match everything except all digits (and continue (/g) after first match is found)
7
7
  let phonenumber = binding.value.replace(/^\s*\+/, "00")
8
8
  el.href = "tel:" + phonenumber.replace(regex, "")
@@ -0,0 +1,6 @@
1
+ export default {
2
+ activeTab: {
3
+ type: Number,
4
+ default: 0
5
+ }
6
+ }
@@ -0,0 +1,50 @@
1
+ <template>
2
+ <pre :class="classLanguage"><code :class="classLanguage" v-html="codeFormatted"></code></pre>
3
+ <p v-if="codeCopied">Code was copied to clipboard!</p>
4
+ <a href="#" @click.prevent="copyToClipboard">
5
+ <span class="icon-duplicate-content"></span>
6
+ <span>Copy code</span>
7
+ </a>
8
+ </template>
9
+
10
+ <script>
11
+ import Prism from "prismjs"
12
+ import "prismjs/components/prism-json"
13
+
14
+ export default {
15
+ name: "ComponentCode",
16
+ data() {
17
+ return {
18
+ codeCopied: false
19
+ }
20
+ },
21
+ props: {
22
+ code: {
23
+ type: [String, Object, Array],
24
+ required: true
25
+ },
26
+ language: {
27
+ type: String,
28
+ default: "markup"
29
+ }
30
+ },
31
+ computed: {
32
+ codeFormatted() {
33
+ let codeUnformatted = this.code
34
+ if(typeof this.code !== "string") {
35
+ codeUnformatted = JSON.stringify(codeUnformatted, null, 2)
36
+ }
37
+ return Prism.highlight(codeUnformatted, Prism.languages[this.language], this.language)
38
+ },
39
+ classLanguage() {
40
+ return "language-" + this.language
41
+ }
42
+ },
43
+ methods: {
44
+ copyToClipboard() {
45
+ navigator.clipboard.writeText(this.code)
46
+ this.codeCopied = true
47
+ }
48
+ }
49
+ }
50
+ </script>