comand-component-library 4.3.27 → 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 (64) hide show
  1. package/dist/comand-component-library.css +1 -1
  2. package/dist/comand-component-library.js +7568 -7448
  3. package/dist/styles/demopage-only.css +35 -1
  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 -1086
  16. package/src/components/CmdBoxWrapper.vue +11 -1
  17. package/src/components/CmdBreadcrumbs.vue +2 -2
  18. package/src/components/CmdCodeOutput.vue +1 -1
  19. package/src/components/CmdContainer.vue +13 -1
  20. package/src/components/CmdCookieDisclaimer.vue +480 -480
  21. package/src/components/CmdFakeSelect.vue +930 -917
  22. package/src/components/CmdFlexibleScrollContainer.vue +42 -42
  23. package/src/components/CmdForm.vue +481 -481
  24. package/src/components/CmdFormElement.vue +1110 -1091
  25. package/src/components/CmdFormFilters.vue +146 -146
  26. package/src/components/CmdGoogleMaps.vue +1 -1
  27. package/src/components/CmdHeadline.vue +21 -4
  28. package/src/components/CmdIcon.vue +8 -2
  29. package/src/components/CmdImage.vue +27 -21
  30. package/src/components/CmdImageZoom.vue +9 -8
  31. package/src/components/CmdInputGroup.vue +436 -435
  32. package/src/components/CmdLink.vue +1 -1
  33. package/src/components/CmdList.vue +3 -3
  34. package/src/components/CmdListOfRequirements.vue +192 -192
  35. package/src/components/CmdLoginForm.vue +618 -618
  36. package/src/components/CmdMailToolFilter.vue +217 -217
  37. package/src/components/CmdMainNavigation.vue +581 -572
  38. package/src/components/CmdMultistepFormProgressBar.vue +9 -9
  39. package/src/components/CmdNewsletterSubscription.vue +199 -199
  40. package/src/components/CmdPagination.vue +4 -2
  41. package/src/components/CmdParagraph.vue +10 -4
  42. package/src/components/CmdProgressBar.vue +72 -72
  43. package/src/components/CmdSiteHeader.vue +382 -389
  44. package/src/components/CmdSiteSearch.vue +420 -420
  45. package/src/components/CmdSiteWrapper.vue +12 -5
  46. package/src/components/CmdSlideshow.vue +519 -519
  47. package/src/components/CmdSmartSearch.vue +291 -291
  48. package/src/components/CmdSystemMessage.vue +3 -2
  49. package/src/components/CmdTable.vue +401 -401
  50. package/src/components/CmdTabs.vue +262 -262
  51. package/src/components/CmdTag.vue +2 -2
  52. package/src/components/CmdTextImageBlock.vue +8 -2
  53. package/src/components/CmdThumbnailScroller.vue +0 -7
  54. package/src/components/CmdToast.vue +1 -1
  55. package/src/components/CmdToggleDarkMode.vue +13 -11
  56. package/src/components/CmdTooltip.vue +305 -301
  57. package/src/components/CmdUploadForm.vue +1299 -1305
  58. package/src/components/CmdWidthLimitationWrapper.vue +1 -1
  59. package/src/components/EditComponentWrapper.vue +5 -5
  60. package/src/index.js +5 -0
  61. package/src/main.js +4 -3
  62. package/src/utils/template.js +57 -0
  63. package/dist/styles/templates/casual.css +0 -3
  64. package/src/assets/styles/template.css +0 -1
@@ -1,263 +1,263 @@
1
- <template>
2
- <!-- begin CmdTabs ---------------------------------------------------------------------------------------- -->
3
- <div :class="['cmd-tabs', highlightLevel]">
4
- <!-- being tab-list -->
5
- <ul :class="{'stretch-tabs' : stretchTabs}" role="tablist">
6
- <li v-for="(tab, index) in tabs" :class="{active : showTab === index}" :key="index" role="tab">
7
- <a href="#" :class="highlightLevel" @click.prevent="setActiveTab(index)" :title="!tab.text ? tab.tooltip : undefined">
8
- <!-- begin CmdIcon -->
9
- <CmdIcon v-if="tab.iconClass" :iconClass="tab.iconClass" :type="tab.iconType" />
10
- <!-- end CmdIcon -->
11
- <span v-if="tab.text">{{ tab.text }}</span>
12
- </a>
13
- </li>
14
- </ul>
15
- <!-- end tab-list -->
16
-
17
- <!-- being tab-content -->
18
- <!-- begin slot -->
19
- <template v-if="useSlot">
20
- <div v-show="showTab === index - 1" v-for="index in tabs.length" :key="index" aria-live="assertive" :class="['tab-content-' + (index - 1), {'no-padding': !useDefaultPadding}]">
21
- <!-- begin named slot-content -->
22
- <slot :name="'tab-content-' + (index - 1)"></slot>
23
- <!-- end named slot-content -->
24
- </div>
25
- </template>
26
- <!-- end slot -->
27
-
28
- <div v-else aria-live="assertive">
29
- <CmdHeadline
30
- v-if="cmdHeadlineProperties.show"
31
- v-bind="cmdHeadlineProperties"
32
- :headlineText="tabs[showTab].headlineText"
33
- />
34
-
35
- <!-- begin html-content -->
36
- <div v-html="tabs[showTab].htmlContent" :class="{'no-padding': !useDefaultPadding}"></div>
37
- <!-- end html-content -->
38
- </div>
39
- <!-- end tab-content -->
40
- </div>
41
- <!-- end CmdTabs ---------------------------------------------------------------------------------------- -->
42
- </template>
43
-
44
- <script>
45
- // import functions
46
- import {addCollection} from "@iconify/vue"
47
-
48
- // import data
49
- import IconData from '@/assets/data/icon.json'
50
-
51
- addCollection(IconData)
52
-
53
- export default {
54
- name: "CmdTabs",
55
- data() {
56
- return {
57
- showTab: this.defaultActiveTab
58
- }
59
- },
60
- emits: ["active-tab"],
61
- props: {
62
- /**
63
- * set if content should use default-padding
64
- */
65
- useDefaultPadding: {
66
- type: Boolean,
67
- default: true
68
- },
69
- /**
70
- * activate if tabs should be (equally) stretched horizontally over full width of tab-content
71
- */
72
- stretchTabs: {
73
- type: Boolean,
74
- default: false
75
- },
76
- /**
77
- * list of tabs (incl. tab-name and tab-content (optional))
78
- */
79
- tabs: {
80
- type: Array,
81
- required: true
82
- },
83
- /**
84
- * activate if content should be given by slot
85
- */
86
- useSlot: {
87
- type: Boolean,
88
- default: false
89
- },
90
- /**
91
- * set highlight-level for tabs
92
- *
93
- * @allowedValues: null, "primary", "secondary", "tertiary"
94
- */
95
- highlightLevel: {
96
- type: String,
97
- default: "primary",
98
- validator(value) {
99
- return value === null ||
100
- value === "primary" ||
101
- value === "secondary" ||
102
- value === "tertiary"
103
- }
104
- },
105
- /**
106
- * set default active/shown tab
107
- */
108
- defaultActiveTab: {
109
- type: Number,
110
- default: 0
111
- },
112
- /**
113
- * properties for CmdHeadline-component
114
- *
115
- * headlineText is provided by tabs-property for each tab
116
- */
117
- cmdHeadline: {
118
- type: Object,
119
- required: false
120
- }
121
- },
122
- computed: {
123
- cmdHeadlineProperties() {
124
- return {
125
- show: true,
126
- headlineLevel: 3,
127
- ...this.cmdHeadline
128
- }
129
- }
130
- },
131
- methods: {
132
- setActiveTab(index) {
133
- this.showTab = index
134
- this.$emit("active-tab", index)
135
- }
136
- },
137
- watch: {
138
- defaultActiveTab() {
139
- this.showTab = this.defaultActiveTab
140
- }
141
- }
142
- }
143
- </script>
144
-
145
- <style>
146
- /* begin cmd-tabs ------------------------------------------------------------------------------------------ */
147
- .cmd-tabs {
148
- > ul {
149
- margin: 0;
150
- display: flex;
151
-
152
- > li {
153
- z-index: 10;
154
- margin-left: 0;
155
- border-top-left-radius: var(--default-border-radius);
156
- border-top-right-radius: var(--default-border-radius);
157
- list-style-type: none;
158
- background: var(--color-scheme-background);
159
-
160
- a {
161
- display: flex;
162
- align-items: center;
163
- justify-content: center;
164
- padding: var(--default-padding);
165
- border: var(--default-border);
166
- border-bottom: 0;
167
- border-top-left-radius: var(--default-border-radius);
168
- border-top-right-radius: var(--default-border-radius);
169
- text-decoration: none !important;
170
-
171
- span, span[class*="icon-"] {
172
- text-decoration: none !important;
173
- }
174
-
175
- &:hover, &:active, &:focus {
176
- cursor: pointer;
177
- color: var(--hyperlink-color-highlighted);
178
- border-color: var(--hyperlink-color);
179
-
180
- span, [class*="icon-"] {
181
- color: inherit;
182
- }
183
- }
184
- }
185
-
186
- &.active {
187
- span, [class*="icon-"] {
188
- color: var(--color-white);
189
- }
190
-
191
- &:hover, &:active {
192
- a, a:focus {
193
- color: var(--hyperlink-color);
194
- background: var(--color-white);
195
-
196
- span, [class*="icon-"] {
197
- color: var(--hyperlink-color-highlighted);
198
- }
199
- }
200
- }
201
-
202
- a:focus {
203
- color: var(--color-white);
204
-
205
- span, span[class*="icon-"], .iconify {
206
- color: inherit !important;
207
- }
208
- }
209
- }
210
- }
211
-
212
- &.stretch-tabs {
213
- > li {
214
- flex: 1;
215
- text-align: center;
216
- }
217
-
218
- > div {
219
- border-top-right-radius: 0;
220
- }
221
- }
222
- }
223
-
224
- .headline {
225
- margin-top: 0;
226
- }
227
-
228
- > div {
229
- padding: var(--default-padding);
230
- border: var(--default-border);
231
- border-radius: var(--default-border-radius);
232
- background: var(--color-scheme-background);
233
- border-top-left-radius: 0;
234
-
235
-
236
- > div {
237
- *:last-child {
238
- margin-bottom: 0;
239
- }
240
- }
241
- }
242
-
243
- &.primary {
244
- & > div {
245
- border-color: var(--primary-color);
246
- }
247
- }
248
-
249
- &.secondary {
250
- & > div {
251
- border-color: var(--secondary-color);
252
- }
253
- }
254
-
255
- &.tertiary {
256
- & > div {
257
- border-color: var(--tertiary-color);
258
- }
259
- }
260
- }
261
-
262
- /* end cmd-tabs ------------------------------------------------------------------------------------------ */
1
+ <template>
2
+ <!-- begin CmdTabs ---------------------------------------------------------------------------------------- -->
3
+ <div :class="['cmd-tabs', highlightLevel]">
4
+ <!-- being tab-list -->
5
+ <ul :class="{'stretch-tabs' : stretchTabs}" role="tablist">
6
+ <li v-for="(tab, index) in tabs" :class="{active : showTab === index}" :key="index" role="presentation">
7
+ <a href="#" role="tab" :aria-selected="showTab === index ? 'true' : 'false'" :class="highlightLevel" @click.prevent="setActiveTab(index)" :title="!tab.text ? tab.tooltip : undefined" :aria-label="!tab.text ? tab.tooltip : undefined">
8
+ <!-- begin CmdIcon -->
9
+ <CmdIcon v-if="tab.iconClass" :iconClass="tab.iconClass" :type="tab.iconType" />
10
+ <!-- end CmdIcon -->
11
+ <span v-if="tab.text">{{ tab.text }}</span>
12
+ </a>
13
+ </li>
14
+ </ul>
15
+ <!-- end tab-list -->
16
+
17
+ <!-- being tab-content -->
18
+ <!-- begin slot -->
19
+ <template v-if="useSlot">
20
+ <div v-show="showTab === index - 1" v-for="index in tabs.length" :key="index" aria-live="assertive" :class="['tab-content-' + (index - 1), {'no-padding': !useDefaultPadding}]">
21
+ <!-- begin named slot-content -->
22
+ <slot :name="'tab-content-' + (index - 1)"></slot>
23
+ <!-- end named slot-content -->
24
+ </div>
25
+ </template>
26
+ <!-- end slot -->
27
+
28
+ <div v-else aria-live="assertive">
29
+ <CmdHeadline
30
+ v-if="cmdHeadlineProperties.show"
31
+ v-bind="cmdHeadlineProperties"
32
+ :headlineText="tabs[showTab].headlineText"
33
+ />
34
+
35
+ <!-- begin html-content -->
36
+ <div v-html="tabs[showTab].htmlContent" :class="{'no-padding': !useDefaultPadding}"></div>
37
+ <!-- end html-content -->
38
+ </div>
39
+ <!-- end tab-content -->
40
+ </div>
41
+ <!-- end CmdTabs ---------------------------------------------------------------------------------------- -->
42
+ </template>
43
+
44
+ <script>
45
+ // import functions
46
+ import {addCollection} from "@iconify/vue"
47
+
48
+ // import data
49
+ import IconData from '@/assets/data/icon.json'
50
+
51
+ addCollection(IconData)
52
+
53
+ export default {
54
+ name: "CmdTabs",
55
+ data() {
56
+ return {
57
+ showTab: this.defaultActiveTab
58
+ }
59
+ },
60
+ emits: ["active-tab"],
61
+ props: {
62
+ /**
63
+ * set if content should use default-padding
64
+ */
65
+ useDefaultPadding: {
66
+ type: Boolean,
67
+ default: true
68
+ },
69
+ /**
70
+ * activate if tabs should be (equally) stretched horizontally over full width of tab-content
71
+ */
72
+ stretchTabs: {
73
+ type: Boolean,
74
+ default: false
75
+ },
76
+ /**
77
+ * list of tabs (incl. tab-name and tab-content (optional))
78
+ */
79
+ tabs: {
80
+ type: Array,
81
+ required: true
82
+ },
83
+ /**
84
+ * activate if content should be given by slot
85
+ */
86
+ useSlot: {
87
+ type: Boolean,
88
+ default: false
89
+ },
90
+ /**
91
+ * set highlight-level for tabs
92
+ *
93
+ * @allowedValues: null, "primary", "secondary", "tertiary"
94
+ */
95
+ highlightLevel: {
96
+ type: String,
97
+ default: "primary",
98
+ validator(value) {
99
+ return value === null ||
100
+ value === "primary" ||
101
+ value === "secondary" ||
102
+ value === "tertiary"
103
+ }
104
+ },
105
+ /**
106
+ * set default active/shown tab
107
+ */
108
+ defaultActiveTab: {
109
+ type: Number,
110
+ default: 0
111
+ },
112
+ /**
113
+ * properties for CmdHeadline-component
114
+ *
115
+ * headlineText is provided by tabs-property for each tab
116
+ */
117
+ cmdHeadline: {
118
+ type: Object,
119
+ required: false
120
+ }
121
+ },
122
+ computed: {
123
+ cmdHeadlineProperties() {
124
+ return {
125
+ show: true,
126
+ headlineLevel: 3,
127
+ ...this.cmdHeadline
128
+ }
129
+ }
130
+ },
131
+ methods: {
132
+ setActiveTab(index) {
133
+ this.showTab = index
134
+ this.$emit("active-tab", index)
135
+ }
136
+ },
137
+ watch: {
138
+ defaultActiveTab() {
139
+ this.showTab = this.defaultActiveTab
140
+ }
141
+ }
142
+ }
143
+ </script>
144
+
145
+ <style>
146
+ /* begin cmd-tabs ------------------------------------------------------------------------------------------ */
147
+ .cmd-tabs {
148
+ > ul {
149
+ margin: 0;
150
+ display: flex;
151
+
152
+ > li {
153
+ z-index: 10;
154
+ margin-left: 0;
155
+ border-top-left-radius: var(--default-border-radius);
156
+ border-top-right-radius: var(--default-border-radius);
157
+ list-style-type: none;
158
+ background: var(--color-scheme-background);
159
+
160
+ a {
161
+ display: flex;
162
+ align-items: center;
163
+ justify-content: center;
164
+ padding: var(--default-padding);
165
+ border: var(--default-border);
166
+ border-bottom: 0;
167
+ border-top-left-radius: var(--default-border-radius);
168
+ border-top-right-radius: var(--default-border-radius);
169
+ text-decoration: none !important;
170
+
171
+ span, span[class*="icon-"] {
172
+ text-decoration: none !important;
173
+ }
174
+
175
+ &:hover, &:active, &:focus {
176
+ cursor: pointer;
177
+ color: var(--hyperlink-color-highlighted);
178
+ border-color: var(--hyperlink-color);
179
+
180
+ span, [class*="icon-"] {
181
+ color: inherit;
182
+ }
183
+ }
184
+ }
185
+
186
+ &.active {
187
+ span, [class*="icon-"] {
188
+ color: var(--hyperlink-color-contrast-text);
189
+ }
190
+
191
+ &:hover, &:active {
192
+ a, a:focus {
193
+ color: var(--hyperlink-color);
194
+ background: var(--color-scheme-background);
195
+
196
+ span, [class*="icon-"] {
197
+ color: var(--hyperlink-color-highlighted);
198
+ }
199
+ }
200
+ }
201
+
202
+ a:focus {
203
+ color: var(--hyperlink-color-contrast-text);
204
+
205
+ span, span[class*="icon-"], .iconify {
206
+ color: inherit !important;
207
+ }
208
+ }
209
+ }
210
+ }
211
+
212
+ &.stretch-tabs {
213
+ > li {
214
+ flex: 1;
215
+ text-align: center;
216
+ }
217
+
218
+ > div {
219
+ border-top-right-radius: 0;
220
+ }
221
+ }
222
+ }
223
+
224
+ .headline {
225
+ margin-top: 0;
226
+ }
227
+
228
+ > div {
229
+ padding: var(--default-padding);
230
+ border: var(--default-border);
231
+ border-radius: var(--default-border-radius);
232
+ background: var(--color-scheme-background);
233
+ border-top-left-radius: 0;
234
+
235
+
236
+ > div {
237
+ *:last-child {
238
+ margin-bottom: 0;
239
+ }
240
+ }
241
+ }
242
+
243
+ &.primary {
244
+ & > div {
245
+ border-color: var(--primary-color);
246
+ }
247
+ }
248
+
249
+ &.secondary {
250
+ & > div {
251
+ border-color: var(--secondary-color);
252
+ }
253
+ }
254
+
255
+ &.tertiary {
256
+ & > div {
257
+ border-color: var(--tertiary-color);
258
+ }
259
+ }
260
+ }
261
+
262
+ /* end cmd-tabs ------------------------------------------------------------------------------------------ */
263
263
  </style>
@@ -91,7 +91,7 @@ export default {
91
91
  .cmd-tag {
92
92
  align-self: start;
93
93
  /* if used in vertical flex-container */
94
- gap: var(---gap-small);
94
+ gap: var(--gap-small);
95
95
 
96
96
  >span:only-child {
97
97
  margin: 0 auto;
@@ -101,7 +101,7 @@ export default {
101
101
  &.secondary,
102
102
  &.tertiary {
103
103
  span[class*="icon-"] {
104
- color: var(--color-white);
104
+ color: var(--tag-text-color);
105
105
  }
106
106
  }
107
107
  }
@@ -170,11 +170,17 @@ export default {
170
170
  ...this.cmdParagraph
171
171
  }
172
172
  },
173
+ /**
174
+ * html-content of the paragraph (only used in edit-mode)
175
+ */
176
+ htmlContent() {
177
+ return this.cmdParagraph?.content
178
+ },
173
179
  paragraphComponentPath() {
174
180
  /* because paragraph is no component on its own, besides the componentPath (for the property),
175
181
  an additional flag (here $isComponent-key) is used to let the store identify this edge case.
176
182
  the '$'-prefix is set to ensure that the flag is not a generic name, that potentially is used as a property-name in any component */
177
- return [{componentPath: ["props", "htmlContent"], $isComponent: false}]
183
+ return [{componentPath: ["props", "cmdParagraph", "content"], $isComponent: false}]
178
184
  },
179
185
  setInnerClass() {
180
186
  return "inner-text-wrapper " + this.textAlign + " " + (this.innerClass || "")
@@ -194,7 +200,7 @@ export default {
194
200
 
195
201
  return updateHandlerProvider(this, {
196
202
  update(props) {
197
- props.htmlContent = htmlContent
203
+ props.cmdParagraph = {...props.cmdParagraph, content: htmlContent}
198
204
  }
199
205
  })
200
206
  }
@@ -466,13 +466,6 @@ export default {
466
466
  color: inherit
467
467
  }
468
468
 
469
- &:has(figcaption) {
470
- img {
471
- border-bottom-left-radius: 0;
472
- border-bottom-right-radius: 0;
473
- }
474
- }
475
-
476
469
  figcaption {
477
470
  background: none;
478
471
  opacity: 1;
@@ -126,7 +126,7 @@ export default {
126
126
  top: auto;
127
127
  bottom: 7rem;
128
128
  z-index: 1000;
129
- gap: var(---gap-small);
129
+ gap: var(--gap-small);
130
130
 
131
131
  header {
132
132
  display: flex;
@@ -66,8 +66,19 @@ export default {
66
66
  EditMode
67
67
  ],
68
68
  data() {
69
+ // start with the real color-scheme (saved choice of the user or browser/os-setting) instead of 'false':
70
+ // otherwise every instance of this component first announces 'light-mode' (via 'toggle-color-scheme') and
71
+ // switches already initialized instances to light-mode (depending on the creation-order)
72
+ let darkMode = false
73
+ try {
74
+ const savedColorScheme = window.localStorage.getItem("cmd-color-scheme")
75
+ darkMode = savedColorScheme ? savedColorScheme === "dark-mode" : window.matchMedia("(prefers-color-scheme: dark)").matches
76
+ } catch {
77
+ darkMode = window.matchMedia?.("(prefers-color-scheme: dark)").matches || false
78
+ }
79
+
69
80
  return {
70
- darkMode: false,
81
+ darkMode,
71
82
  editableLabelTextLightMode: null,
72
83
  editableLabelTextDarkMode: null
73
84
  }
@@ -146,18 +157,9 @@ export default {
146
157
  }
147
158
  },
148
159
  created() {
160
+ // react on changes of the browser/os-color-scheme (the initial value is already set in data())
149
161
  const mql = window.matchMedia("(prefers-color-scheme: dark)")
150
162
  mql.addEventListener("change", this.onColorSchemeChange)
151
- this.onColorSchemeChange(mql)
152
-
153
- this.$nextTick(() => {
154
- // load color-scheme from local-storage
155
- const savedColorScheme = window.localStorage.getItem("cmd-color-scheme")
156
-
157
- if(savedColorScheme) {
158
- this.darkMode = savedColorScheme === "dark-mode"
159
- }
160
- })
161
163
 
162
164
  // add eventListener on html-tag (= documentElement) to react on 'toggle-color-scheme'-event
163
165
  document.documentElement.addEventListener("toggle-color-scheme", this.onToggleColorScheme)