comand-component-library 4.3.28 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/comand-component-library.css +1 -1
  2. package/dist/comand-component-library.js +9587 -9482
  3. package/dist/styles/demopage-only.css +12 -2
  4. package/package.json +47 -46
  5. package/src/ComponentLibrary.vue +2697 -2688
  6. package/src/assets/data/component-structure.json +1 -1
  7. package/src/assets/data/form-elements.json +224 -224
  8. package/src/assets/data/social-networks-page-by-json.json +43 -43
  9. package/src/assets/styles/component-library-global-styles.scss +296 -295
  10. package/src/componentSettingsDataAndControls.vue +1 -18
  11. package/src/components/CmdAccordion.vue +1 -1
  12. package/src/components/CmdAddressData.vue +6 -1
  13. package/src/components/CmdAddressDataItem.vue +6 -1
  14. package/src/components/CmdBasicForm.vue +2 -2
  15. package/src/components/CmdBox.vue +1103 -1092
  16. package/src/components/CmdBoxWrapper.vue +7 -1
  17. package/src/components/CmdBreadcrumbs.vue +2 -2
  18. package/src/components/CmdCodeOutput.vue +1 -1
  19. package/src/components/CmdCookieDisclaimer.vue +480 -480
  20. package/src/components/CmdFakeSelect.vue +930 -916
  21. package/src/components/CmdFlexibleScrollContainer.vue +42 -42
  22. package/src/components/CmdForm.vue +481 -481
  23. package/src/components/CmdFormElement.vue +1110 -1091
  24. package/src/components/CmdFormFilters.vue +146 -146
  25. package/src/components/CmdGoogleMaps.vue +1 -1
  26. package/src/components/CmdHeadline.vue +21 -4
  27. package/src/components/CmdIcon.vue +8 -2
  28. package/src/components/CmdImage.vue +14 -16
  29. package/src/components/CmdImageZoom.vue +9 -8
  30. package/src/components/CmdInputGroup.vue +436 -435
  31. package/src/components/CmdLink.vue +1 -1
  32. package/src/components/CmdList.vue +1 -1
  33. package/src/components/CmdListOfRequirements.vue +192 -192
  34. package/src/components/CmdLoginForm.vue +618 -618
  35. package/src/components/CmdMailToolFilter.vue +217 -217
  36. package/src/components/CmdMainNavigation.vue +581 -572
  37. package/src/components/CmdMultistepFormProgressBar.vue +9 -9
  38. package/src/components/CmdNewsletterSubscription.vue +199 -199
  39. package/src/components/CmdPagination.vue +4 -2
  40. package/src/components/CmdParagraph.vue +10 -4
  41. package/src/components/CmdProgressBar.vue +72 -72
  42. package/src/components/CmdSiteHeader.vue +382 -389
  43. package/src/components/CmdSiteSearch.vue +420 -420
  44. package/src/components/CmdSiteWrapper.vue +12 -5
  45. package/src/components/CmdSlideshow.vue +519 -519
  46. package/src/components/CmdSmartSearch.vue +291 -291
  47. package/src/components/CmdSystemMessage.vue +3 -2
  48. package/src/components/CmdTable.vue +401 -401
  49. package/src/components/CmdTabs.vue +262 -262
  50. package/src/components/CmdTag.vue +1 -1
  51. package/src/components/CmdTextImageBlock.vue +8 -2
  52. package/src/components/CmdThumbnailScroller.vue +0 -7
  53. package/src/components/CmdToggleDarkMode.vue +13 -11
  54. package/src/components/CmdTooltip.vue +305 -301
  55. package/src/components/CmdUploadForm.vue +1299 -1305
  56. package/src/components/CmdWidthLimitationWrapper.vue +1 -1
  57. package/src/components/EditComponentWrapper.vue +5 -5
  58. package/src/index.js +5 -0
  59. package/src/main.js +4 -3
  60. package/src/utils/template.js +57 -0
  61. package/src/assets/styles/template.css +0 -1
@@ -2,7 +2,7 @@
2
2
  <!-- begin CmdWidthLimitationWrapper ---------------------------------------------------------------------------------------- -->
3
3
  <div class="cmd-width-limitation-wrapper" :class="{'sticky': sticky}" ref="width-limitation-wrapper">
4
4
  <!-- begin slot-content in section -->
5
- <section v-if="useInnerSection" :class="sectionClasses" :id="anchorId">
5
+ <section v-if="useInnerSection" :class="sectionClasses" :id="anchorId || null">
6
6
  <CmdHeadline
7
7
  v-if="(cmdHeadlineProperties?.show && cmdHeadlineProperties?.headlineText) || editModeContext"
8
8
  v-bind="cmdHeadlineProperties"
@@ -459,7 +459,7 @@ function buildComponentPath(component) {
459
459
 
460
460
  .edit-items {
461
461
  .action-buttons {
462
- gap: var(--default-gap-third);
462
+ gap: calc(var(--default-gap) / 3);
463
463
  top: -2.3rem;
464
464
  left: 0;
465
465
  right: auto; /* avoids container to be stretched */
@@ -480,19 +480,19 @@ function buildComponentPath(component) {
480
480
  }
481
481
 
482
482
  &:nth-child(4) {
483
- right: var(--icon-font-size);
483
+ right: var(--default-icon-size);
484
484
  }
485
485
 
486
486
  &:nth-child(3) {
487
- right: calc(var(--icon-font-size) * 2);
487
+ right: calc(var(--default-icon-size) * 2);
488
488
  }
489
489
 
490
490
  &:nth-child(2) {
491
- right: calc(var(--icon-font-size) * 3);
491
+ right: calc(var(--default-icon-size) * 3);
492
492
  }
493
493
 
494
494
  &:nth-child(1) {
495
- right: calc(var(--icon-font-size) * 4);
495
+ right: calc(var(--default-icon-size) * 4);
496
496
  }
497
497
 
498
498
  a.button {
package/src/index.js CHANGED
@@ -23,6 +23,7 @@ export { default as CmdFormFilters } from '@/components/CmdFormFilters.vue'
23
23
  export { default as CmdGoogleMaps } from '@/components/CmdGoogleMaps.vue'
24
24
  export { default as CmdHeadline } from '@/components/CmdHeadline.vue'
25
25
  export { default as CmdIcon } from '@/components/CmdIcon.vue'
26
+ export { default as CmdListOfRequirements } from '@/components/CmdListOfRequirements.vue'
26
27
  export { default as CmdImage } from '@/components/CmdImage.vue'
27
28
  export { default as CmdImageGallery } from '@/components/CmdImageGallery.vue'
28
29
  export { default as CmdImageZoom } from '@/components/CmdImageZoom.vue'
@@ -30,6 +31,7 @@ export { default as CmdInputGroup } from '@/components/CmdInputGroup.vue'
30
31
  export { default as CmdLink } from '@/components/CmdLink.vue'
31
32
  export { default as CmdList } from '@/components/CmdList.vue'
32
33
  export { default as CmdLoginForm } from '@/components/CmdLoginForm.vue'
34
+ export { default as CmdMailTool } from '@/components/CmdMailTool.vue'
33
35
  export { default as CmdMainNavigation } from '@/components/CmdMainNavigation.vue'
34
36
  export { default as CmdMultistepFormWrapper } from '@/components/CmdMultistepFormWrapper.vue'
35
37
  export { default as CmdMultistepFormProgressBar } from '@/components/CmdMultistepFormProgressBar.vue'
@@ -53,9 +55,11 @@ export { default as CmdSocialNetworks } from '@/components/CmdSocialNetworks.vue
53
55
  export { default as CmdSwitchLanguage } from '@/components/CmdSwitchLanguage.vue'
54
56
  export { default as CmdSystemMessage } from '@/components/CmdSystemMessage.vue'
55
57
  export { default as CmdTable } from '@/components/CmdTable.vue'
58
+ export { default as CmdTag } from '@/components/CmdTag.vue'
56
59
  export { default as CmdTabs } from '@/components/CmdTabs.vue'
57
60
  export { default as CmdTextImageBlock } from '@/components/CmdTextImageBlock.vue'
58
61
  export { default as CmdThumbnailScroller } from '@/components/CmdThumbnailScroller.vue'
62
+ export { default as CmdToast } from '@/components/CmdToast.vue'
59
63
  export { default as CmdToggleDarkMode } from '@/components/CmdToggleDarkMode.vue'
60
64
  export { default as CmdTooltip } from '@/components/CmdTooltip.vue'
61
65
  export { default as CmdUploadForm } from '@/components/CmdUploadForm.vue'
@@ -78,6 +82,7 @@ export { createUuid, createHtmlId } from '@/utils/common'
78
82
  export { getFileExtension } from '@/utils/getFileExtension'
79
83
  export { capitalizeFirstLetter, lowercaseFirstLetter, fullName } from '@/utils/string'
80
84
  export { responsiveBodyClasses } from '@/utils/dom'
85
+ export { applyTemplate, setTemplateUrls, TEMPLATES, TEMPLATE_LINK_ID } from '@/utils/template'
81
86
  export { setCookieDisclaimerCookie, getCookieDisclaimerCookie } from '@/utils/cookie'
82
87
  export { currentDate, currentTime, getDate, getWeekday, formatDate, formatTime } from "@/utils/date"
83
88
 
package/src/main.js CHANGED
@@ -16,9 +16,6 @@ import directiveFocus from "./directives/focus"
16
16
  import directiveFancybox from "./directives/fancybox"
17
17
  /* end import directives ---------------------------------------------------------------------------------------- */
18
18
 
19
- /* import css-example for your custom styles */
20
- import '@/assets/styles/template.css'
21
-
22
19
  /* import css for prism-library (for styling syntax) */
23
20
  import "prismjs/themes/prism.css"
24
21
 
@@ -28,6 +25,10 @@ import 'comand-frontend-framework/demopage-only.css'
28
25
 
29
26
  import router from "./router"
30
27
 
28
+ /* tell the library where the template-css of the installed comand-frontend-framework is */
29
+ import { setTemplateUrls } from "@/utils/template"
30
+ setTemplateUrls(import.meta.glob("/node_modules/comand-frontend-framework/dist/templates/*.css", {query: "?url", import: "default", eager: true}))
31
+
31
32
  // const router = createRouter({
32
33
  // history: createWebHistory(process.env.BASE_URL),
33
34
  // routes: [
@@ -0,0 +1,57 @@
1
+ /*
2
+ template.js - activates the template-css (look and feel) of comand-frontend-framework
3
+
4
+ The template-css files are NEVER copied or bundled into this library. They stay in comand-frontend-framework
5
+ (dist/templates/*.css). The application (which can resolve its installed framework) tells the library where they are:
6
+
7
+ // in the app (Vite): URLs of the installed framework-templates
8
+ import { setTemplateUrls } from "comand-component-library"
9
+ setTemplateUrls(import.meta.glob("/node_modules/comand-frontend-framework/dist/templates/*.css", {query: "?url", import: "default", eager: true}))
10
+
11
+ Without setTemplateUrls() the templates are expected at "/templates/<name>.css" (i.e. copied to the public-folder by the app).
12
+ "blank" means: no template-stylesheet. Templates are looks only (they override framework-tokens) - nothing may depend on a specific template.
13
+ */
14
+
15
+ export const TEMPLATE_LINK_ID = "cmd-template-stylesheet"
16
+
17
+ /** supported templates ("blank" = no template-stylesheet) */
18
+ export const TEMPLATES = ["blank", "material-web", "neumorphic", "tailwind"]
19
+
20
+ let templateUrls = {}
21
+
22
+ /**
23
+ * set the URLs of the template-stylesheets
24
+ *
25
+ * @param {Object} urls either {templateName: url} or the result of import.meta.glob (keys are file-paths, name is taken from the filename)
26
+ */
27
+ export function setTemplateUrls(urls = {}) {
28
+ templateUrls = {}
29
+
30
+ Object.entries(urls).forEach(([key, value]) => {
31
+ const name = key.split("/").pop().replace(/\.css$/, "")
32
+ templateUrls[name] = typeof value === "string" ? value : value?.default
33
+ })
34
+ }
35
+
36
+ /**
37
+ * activate a template: removes the previously activated template-stylesheet (only the one added by this function) and appends the new one
38
+ *
39
+ * @param {string} templateName "blank", "material-web", "neumorphic" or "tailwind"
40
+ * @returns {HTMLLinkElement|null} the added link-element or null (for "blank" and unknown names)
41
+ */
42
+ export function applyTemplate(templateName) {
43
+ document.getElementById(TEMPLATE_LINK_ID)?.remove()
44
+
45
+ if (!TEMPLATES.includes(templateName) || templateName === "blank") {
46
+ return null
47
+ }
48
+
49
+ const link = document.createElement("link")
50
+ link.id = TEMPLATE_LINK_ID
51
+ link.rel = "stylesheet"
52
+ link.href = templateUrls[templateName] || "/templates/" + templateName + ".css"
53
+ link.dataset.template = templateName
54
+ document.head.appendChild(link)
55
+
56
+ return link
57
+ }
@@ -1 +0,0 @@
1
- /* template.css - ADD OVERWRITES AND YOUR CUSTOM STYLES IN THIS FILE */