comand-component-library 3.3.84 → 3.3.85

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. package/dist/comand-component-library.js +5630 -3936
  2. package/dist/comand-component-library.umd.cjs +4 -4
  3. package/dist/style.css +1 -1
  4. package/package.json +2 -2
  5. package/src/App.vue +215 -112
  6. package/src/assets/data/component-structure.json +228 -0
  7. package/src/assets/data/form-elements.json +156 -0
  8. package/src/assets/data/opening-hours.json +79 -37
  9. package/src/components/CmdAddressData.vue +187 -201
  10. package/src/components/CmdAddressDataItem.vue +306 -0
  11. package/src/components/CmdBox.vue +1 -0
  12. package/src/components/CmdBoxWrapper.vue +53 -5
  13. package/src/components/CmdFancyBox.vue +31 -4
  14. package/src/components/CmdForm.vue +98 -4
  15. package/src/components/CmdFormElement.vue +5 -1
  16. package/src/components/CmdHeadline.vue +179 -52
  17. package/src/components/CmdImage.vue +150 -21
  18. package/src/components/CmdImageGallery.vue +88 -85
  19. package/src/components/CmdListOfLinks.vue +63 -43
  20. package/src/components/CmdListOfLinksItem.vue +97 -0
  21. package/src/components/CmdLoginForm.vue +3 -6
  22. package/src/components/CmdMultistepFormProgressBar.vue +37 -8
  23. package/src/components/CmdOpeningHours.vue +280 -63
  24. package/src/components/CmdOpeningHoursItem.vue +264 -0
  25. package/src/components/{CmdPager.vue → CmdPagination.vue} +2 -2
  26. package/src/components/CmdSlideshow.vue +137 -10
  27. package/src/components/CmdSocialNetworks.vue +115 -28
  28. package/src/components/CmdSocialNetworksItem.vue +184 -0
  29. package/src/components/CmdTable.vue +0 -1
  30. package/src/components/CmdTextImageBlock.vue +158 -0
  31. package/src/components/CmdThumbnailScroller.vue +132 -12
  32. package/src/components/CmdToggleDarkMode.vue +58 -1
  33. package/src/components/EditComponentWrapper.vue +553 -0
  34. package/src/index.js +2 -2
  35. package/src/mixins/EditMode.vue +28 -9
  36. package/src/utils/editmode.js +30 -5
  37. package/src/components/CmdTextBlock.vue +0 -73
  38. package/src/editmode/editModeContext.js +0 -50
@@ -2,9 +2,8 @@
2
2
  <div class="grid-container-create-columns cmd-image-gallery">
3
3
  <!-- begin cmd-headline -->
4
4
  <CmdHeadline
5
- v-if="cmdHeadline"
6
- :headlineText="cmdHeadline.headlineText"
7
- :headlineLevel="cmdHeadline.headlineLevel"
5
+ v-if="cmdHeadline?.headlineText || editModeContext"
6
+ v-bind="cmdHeadline"
8
7
  />
9
8
  <!-- end cmd-headline -->
10
9
 
@@ -21,49 +20,45 @@
21
20
  <!-- end images linked to fancybox -->
22
21
 
23
22
  <!-- begin images not linked to fancybox -->
24
- <CmdImage v-else :image="image.image" :figcaption="image.figcaption"/>
23
+ <div v-else v-for="(image, index) in images" :key="`i${index}`" class="image-wrapper">
24
+ <CmdImage :image="image.image" :figcaption="image.figcaption"/>
25
+ </div>
25
26
  <!-- end images not linked to fancybox -->
26
27
  </template>
27
28
  <!-- end default view -->
28
29
 
29
30
  <!-- begin edit-mode view -->
30
- <EditComponentWrapper class="image-wrapper" v-else v-for="(image, index) in images" :key="'x' + index" :componentIdentifier="componentIdentifier(index)">
31
- <CmdImage
32
- :image="image.image"
33
- :figcaption="image.figcaption"
34
- :editModeContextData="{imageIndex: index}"
35
- />
36
- </EditComponentWrapper>
31
+ <CmdImage
32
+ v-else-if="images.length"
33
+ v-for="(image, index) in images"
34
+ :key="index"
35
+ class="image-wrapper"
36
+ :image="image.image"
37
+ :figcaption="image.figcaption"
38
+ :componentPath="['props', 'images', index]"
39
+ :editModeConfig="imageStructure()"
40
+ />
37
41
  <!-- end edit-mode view -->
42
+
43
+ <!-- begin show placeholder if no image exists (and component is not edited) -->
44
+ <button v-else type="button" class="button confirm" @click="onAddItem">
45
+ <span class="icon-plus"></span>
46
+ <span>Add new gallery-image</span>
47
+ </button>
48
+ <!-- end show placeholder if no image exists (and component is not edited) -->
38
49
  </div>
39
50
  </template>
40
51
 
41
52
  <script>
42
53
  // import functions
43
54
  import {openFancyBox} from "./CmdFancyBox.vue"
44
- import {useEditModeContext} from "../editmode/editModeContext.js"
45
-
46
- // import mixins
47
- //import I18n from "../mixins/I18n"
48
- //import DefaultMessageProperties from "../mixins/CmdImageGallery/DefaultMessageProperties"
55
+ import EditMode from "../mixins/EditMode.vue"
56
+ import {buildComponentPath, updateHandlerProvider} from "../utils/editmode.js"
49
57
 
50
58
  export default {
51
59
  name: "CmdImageGallery",
52
- mixins: [],
53
- provide() {
54
- return {
55
- editModeContext: this.context
56
- }
57
- },
58
- inject: {
59
- editModeContext: {
60
- default: null
61
- }
62
- },
60
+ mixins: [EditMode],
63
61
  props: {
64
- editModeContextData: {
65
- type: Object
66
- },
67
62
  /**
68
63
  * properties for CmdHeadline-component
69
64
  */
@@ -97,24 +92,25 @@ export default {
97
92
  default: "bottom"
98
93
  }
99
94
  },
100
- data() {
101
- return {
102
- context: useEditModeContext(this.editModeContext, {}, this.onSave)
103
- }
104
- },
105
95
  methods: {
106
- componentIdentifier(index) {
107
- const identifier = []
108
- identifier.push(this.editModeContext.props.sectionId)
109
- identifier.push(this.editModeContextData.componentIndex)
110
-
111
- if(this.editModeContextData.childComponentIndex != null) {
112
- identifier.push(this.editModeContextData.childComponentIndex)
96
+ itemProvider() {
97
+ return {
98
+ "image": {
99
+ "src": "/media/images/demo-images/medium/landscape-01.jpg",
100
+ "alt": "Alternative Text",
101
+ },
102
+ "figcaption": {
103
+ "text": "Figcaption DE",
104
+ "position": "bottom",
105
+ "textAlign": "center",
106
+ "show": true
107
+ }
113
108
  }
114
-
115
- identifier.push(index)
116
-
117
- return identifier.join(".")
109
+ },
110
+ onAddItem() {
111
+ this.editModeContext.content.addContent(
112
+ buildComponentPath(this, 'props', 'images', -1),
113
+ this.itemProvider)
118
114
  },
119
115
  showFancyBox(index) {
120
116
  openFancyBox({fancyBoxGallery: this.images, defaultGalleryIndex: index})
@@ -122,23 +118,28 @@ export default {
122
118
  getMessage() {
123
119
  return ""
124
120
  },
125
- onSave(data) {
126
- const imageIndex = data[0].editModeContextData.imageIndex
121
+ imageStructure() {
127
122
  return {
128
- editModeContextData: {
129
- ...(this.editModeContextData || {})
130
- },
131
- update(props) {
132
- props.images[imageIndex].image = {
133
- ...props.images[imageIndex].image,
134
- ...data[0].image
123
+ itemProviderOverwrite: () => ({
124
+ "image": {
125
+ "srcImageLarge": "/media/images/demo-images/large/landscape-01.jpg",
126
+ "tooltip": "Tooltip DE"
135
127
  }
136
- props.images[imageIndex].figcaption = {
137
- ...props.images[imageIndex].figcaption,
138
- ...data[0].figcaption
128
+ })
129
+ }
130
+ },
131
+ updateHandlerProvider() {
132
+ const htmlContent = this.editableHtmlContent
133
+ return updateHandlerProvider(this, {
134
+ update(props, childUpdateHandlers) {
135
+ props.htmlContent = htmlContent
136
+ const cmdHeadlineUpdateHandler = childUpdateHandlers?.find(handler => handler.name === "CmdHeadline")
137
+ if (cmdHeadlineUpdateHandler) {
138
+ props.cmdHeadline = props.cmdHeadline || {}
139
+ cmdHeadlineUpdateHandler.update(props.cmdHeadline)
139
140
  }
140
141
  }
141
- }
142
+ })
142
143
  }
143
144
  }
144
145
  }
@@ -147,38 +148,40 @@ export default {
147
148
  <style lang="scss">
148
149
  /* begin cmd-image-gallery ---------------------------------------------------------------------------------------- */
149
150
  .cmd-image-gallery {
150
- > .cmd-headline, > input.edit-mode {
151
- grid-column: span var(--grid-columns);
152
- margin-bottom: 0;
153
- }
154
-
155
- > .image-wrapper {
156
- align-self: center;
157
- justify-self: center;
158
- grid-column: span var(--grid-small-span);
159
-
160
- img {
161
- border: var(--default-border);
162
- border-radius: var(--border-radius);
163
- max-height: 30rem;
151
+ > .cmd-headline, > input.edit-mode, > .edit-component-wrapper {
152
+ grid-column: span var(--grid-columns);
153
+ margin-bottom: 0;
164
154
  }
165
155
 
166
- figcaption {
167
- padding: calc(var(--default-padding) / 2);
168
- }
156
+ .image-wrapper {
157
+ align-self: center;
158
+ justify-self: center;
159
+ grid-column: span var(--grid-small-span);
160
+ width: 100%;
161
+ min-width: 11.1rem; // assure to be as wide as action-buttons in edit-mode
162
+
163
+ img {
164
+ border: var(--default-border);
165
+ border-radius: var(--border-radius);
166
+ max-height: 30rem;
167
+ }
169
168
 
170
- &:hover, &:active, &:focus {
171
- text-decoration: none;
169
+ figcaption {
170
+ padding: calc(var(--default-padding) / 2);
171
+ }
172
172
 
173
- img {
174
- border: var(--primary-border);
175
- }
176
- }
173
+ &:hover, &:active, &:focus {
174
+ text-decoration: none;
177
175
 
178
- & + .pager {
179
- margin-top: calc(var(--default-margin) * 2);
176
+ img {
177
+ border: var(--primary-border);
178
+ }
179
+ }
180
+
181
+ & + .pager {
182
+ margin-top: calc(var(--default-margin) * 2);
183
+ }
180
184
  }
181
- }
182
185
  }
183
186
 
184
187
  /* end cmd-image-gallery ------------------------------------------------------------------------------------------ */
@@ -1,52 +1,60 @@
1
1
  <template>
2
2
  <div :class="['cmd-list-of-links', {box: styleAsBox, horizontal: orientation === 'horizontal', 'section-anchors': sectionAnchors, 'large-icons': largeIcons}]">
3
- <!-- begin CmdHeadline -->
3
+ <!-- begin cmd-headline -->
4
4
  <CmdHeadline
5
- v-if="cmdHeadline"
5
+ v-if="cmdHeadline?.headlineText || editModeContext"
6
6
  v-bind="cmdHeadline"
7
7
  />
8
- <!-- end CmdHeadline -->
8
+ <!-- end cmd-headline -->
9
9
 
10
10
  <!-- begin list of links -->
11
11
  <ul :class="['flex-container', {'no-gap': !useGap},'align-' + align, setStretchClass]">
12
- <li v-for="(link, index) in links" :key="index" :class="{'active': sectionAnchors && activeSection === index}">
13
- <!-- begin use href -->
14
- <a v-if="link.type === 'href' || link.type === undefined"
15
- :href="link.path"
16
- :target="link.target"
17
- @click="executeLink(link, $event)"
18
- :title="link.tooltip && link.tooltip !== undefined ? link.tooltip : undefined">
19
- <!-- begin CmdIcon -->
20
- <CmdIcon v-if="link.iconClass" :iconClass="link.iconClass" :type="link.iconType" />
21
- <!-- end CmdIcon -->
22
- <span v-if="link.text">{{ link.text }}</span>
23
- </a>
24
- <!-- end use href --->
25
-
26
- <!-- begin use router-link -->
27
- <router-link v-else-if="link.type === 'router'"
28
- :to="getRoute(link)"
29
- :title="link.tooltip">
30
- <!-- begin CmdIcon -->
31
- <CmdIcon v-if="link.iconClass" :iconClass="link.iconClass" :type="link.iconType" />
32
- <!-- end CmdIcon -->
33
- <span v-if="link.text">{{ link.text }}</span>
34
- </router-link>
35
- <!-- end use router-link -->
12
+ <CmdListOfLinksItem
13
+ v-if="!editModeContext"
14
+ v-for="(link, index) in links"
15
+ :key="index"
16
+ :class="{'active': sectionAnchors && activeSection === index}"
17
+ :link="link"
18
+ />
19
+
20
+ <!-- begin edit-mode -->
21
+ <li v-else>
22
+ <EditComponentWrapper
23
+ v-for="(link, index) in links"
24
+ :key="'x' + index"
25
+ class="edit-items"
26
+ :showComponentName="false"
27
+ componentTag="ul"
28
+ componentName="CmdLinkItem"
29
+ :componentProps="link"
30
+ :allowedComponentTypes="[]"
31
+ :componentPath="['props', 'links', index]"
32
+ :itemProvider="itemProvider"
33
+ >
34
+ <CmdListOfLinksItem
35
+ :class="{'active': sectionAnchors && activeSection === index}"
36
+ :link="link"
37
+ />
38
+ </EditComponentWrapper>
39
+ <button v-if="links.length === 0" type="button" class="button confirm small" @click="onAddItem">
40
+ <span class="icon-plus"></span>
41
+ <span>Add new entry</span>
42
+ </button>
36
43
  </li>
44
+ <!-- end edit-mode -->
37
45
  </ul>
38
46
  <!-- end list of links -->
39
47
  </div>
40
48
  </template>
41
49
 
42
50
  <script>
43
- // import functions
44
- import {getRoute} from "../utilities.js"
45
- import {openFancyBox} from "./CmdFancyBox.vue"
51
+ import EditMode from "../mixins/EditMode.vue"
52
+ import {buildComponentPath, updateHandlerProvider} from "../utils/editmode.js"
46
53
 
47
54
  export default {
48
55
  name: "CmdListOfLinks",
49
56
  emits: ["click"],
57
+ mixins: [EditMode],
50
58
  props: {
51
59
  /**
52
60
  * activate if component should contain a list of anchors for the section within the page
@@ -133,16 +141,31 @@ export default {
133
141
  }
134
142
  },
135
143
  methods: {
136
- getRoute(link) {
137
- return getRoute(link)
144
+ onAddItem() {
145
+ this.editModeContext.content.addContent(
146
+ buildComponentPath(this, 'props', 'links', -1),
147
+ this.itemProvider)
148
+ },
149
+ itemProvider() {
150
+ return {
151
+ "iconClass": "icon-user-profile",
152
+ "type": "href",
153
+ "text": "Linktext",
154
+ "path": "#",
155
+ "tooltip": "Tooltip",
156
+ "target": "_blank"
157
+ }
138
158
  },
139
- executeLink(link, event) {
140
- if (link.fancybox) {
141
- event.preventDefault()
142
- openFancyBox({url: link.path, showSubmitButtons: link.showSubmitButtons})
143
- return
159
+ updateHandlerProvider() {
160
+ return updateHandlerProvider(this, {
161
+ update(props, childUpdateHandlers) {
162
+ const cmdHeadlineUpdateHandler = childUpdateHandlers?.find(handler => handler.name === "CmdHeadline")
163
+ if (cmdHeadlineUpdateHandler) {
164
+ props.cmdHeadline = props.cmdHeadline || {}
165
+ cmdHeadlineUpdateHandler.update(props.cmdHeadline)
144
166
  }
145
- this.$emit("click", {link, originalEvent: event})
167
+ }
168
+ })
146
169
  }
147
170
  }
148
171
  }
@@ -151,10 +174,7 @@ export default {
151
174
  <style lang="scss">
152
175
  /* begin cmd-list-of-links ---------------------------------------------------------------------------------------- */
153
176
  .cmd-list-of-links {
154
- display: flex;
155
- flex-direction: column;
156
-
157
- ul {
177
+ > ul {
158
178
  flex-direction: column;
159
179
  gap: calc(var(--default-gap) / 2);
160
180
  margin: 0;
@@ -166,7 +186,7 @@ export default {
166
186
  }
167
187
 
168
188
  &.horizontal {
169
- ul {
189
+ > ul {
170
190
  gap: var(--default-gap);
171
191
  flex-direction: row;
172
192
 
@@ -0,0 +1,97 @@
1
+ <template>
2
+ <!-- begin default-view -->
3
+ <li v-if="!editing" class="cmd-list-of-links-item">
4
+ <!-- begin use href -->
5
+ <a v-if="link.type === 'href' || link.type === undefined"
6
+ :href="link.path"
7
+ :target="link.target"
8
+ @click="executeLink(link, $event)"
9
+ :title="link.tooltip && link.tooltip !== undefined ? link.tooltip : undefined">
10
+ <!-- begin CmdIcon -->
11
+ <CmdIcon v-if="link.iconClass" :iconClass="link.iconClass" :type="link.iconType" />
12
+ <!-- end CmdIcon -->
13
+ <span v-if="link.text">{{ link.text }}</span>
14
+ </a>
15
+ <!-- end use href --->
16
+
17
+ <!-- begin use router-link -->
18
+ <router-link v-else-if="link.type === 'router'"
19
+ :to="getRoute(link)"
20
+ :title="link.tooltip">
21
+ <!-- begin CmdIcon -->
22
+ <CmdIcon v-if="link.iconClass" :iconClass="link.iconClass" :type="link.iconType" />
23
+ <!-- end CmdIcon -->
24
+ <span v-if="link.text">{{ link.text }}</span>
25
+ </router-link>
26
+ <!-- end use router-link -->
27
+ </li>
28
+ <!-- end default-view -->
29
+
30
+ <!-- begin edit-mode -->
31
+ <template v-else>
32
+ <div class="input-wrapper">
33
+ <CmdFormElement
34
+ element="input"
35
+ type="text"
36
+ labelText="Linktext"
37
+ :showLabel="false"
38
+ placeholder="Linktext"
39
+ v-model="editableText"
40
+ />
41
+ </div>
42
+ </template>
43
+ <!-- end edit-mode -->
44
+ </template>
45
+
46
+ <script>
47
+ import EditMode from "../mixins/EditMode.vue"
48
+
49
+ // import functions
50
+ //import {getRoute} from 'comand-component-library'
51
+ import {openFancyBox} from "./CmdFancyBox.vue"
52
+ import {buildComponentPath, updateHandlerProvider} from "../utils/editmode.js"
53
+ export default {
54
+ name: "CmdListOfLinksItem",
55
+ inheritAttrs: false,
56
+ mixins: [EditMode],
57
+ data() {
58
+ return {
59
+ editableText: this.link.text
60
+ }
61
+ },
62
+ props: {
63
+ /**
64
+ * single link
65
+ */
66
+ link: {
67
+ type: Object,
68
+ required: false
69
+ }
70
+ },
71
+ methods: {
72
+ updateHandlerProvider() {
73
+ const text = this.editableText
74
+ return updateHandlerProvider(this, {
75
+ update(props) {
76
+ props.text = text
77
+ }
78
+ })
79
+ },
80
+ getRoute(link) {
81
+ return getRoute(link)
82
+ },
83
+ executeLink(link, event) {
84
+ if (link.fancybox) {
85
+ event.preventDefault()
86
+ openFancyBox({url: link.path, showSubmitButtons: link.showSubmitButtons})
87
+ return
88
+ }
89
+ this.$emit("click", {link, originalEvent: event})
90
+ },
91
+ }
92
+ }
93
+ </script>
94
+
95
+ <style lang="scss">
96
+
97
+ </style>
@@ -404,9 +404,10 @@ export default {
404
404
  if (event == null) {
405
405
  return
406
406
  }
407
- if(fieldType === "username") {
407
+
408
+ if (fieldType === "username") {
408
409
  this.usernameValidationStatus = event === "success";
409
- } else if(fieldType === "password") {
410
+ } else if (fieldType === "password") {
410
411
  this.passwordValidationStatus = event === "success";
411
412
  } else {
412
413
  this.emailValidationStatus = event === "success";
@@ -435,10 +436,6 @@ export default {
435
436
  align-items: center;
436
437
  text-decoration: none;
437
438
  flex: none;
438
-
439
- [class*="icon-"] {
440
- text-decoration: none;
441
- }
442
439
  }
443
440
 
444
441
  > .button {
@@ -124,8 +124,8 @@ export default {
124
124
  width: 100%;
125
125
  background: var(--primary-color-reduced-opacity);
126
126
 
127
- span, [class*="icon-"] {
128
- color: var(--default-background-color-reduced-opacity);
127
+ :is(span, [class*="icon-"]) {
128
+ color: var(--pure-white);
129
129
 
130
130
  & + [class*="icon-"] {
131
131
  &:last-child {
@@ -147,11 +147,17 @@ export default {
147
147
  }
148
148
  }
149
149
  }
150
+ }
150
151
 
151
- &:hover, &:active, &:focus {
152
- span, [class*="icon-"] {
153
- color: var(--pure-white);
154
- }
152
+ &:hover, &:active, &:focus {
153
+ background: var(--primary-color);
154
+
155
+ :is(span, [class*="icon-"]) {
156
+ color: var(--pure-white);
157
+ }
158
+
159
+ .number {
160
+ color: var(--primary-color);
155
161
  }
156
162
  }
157
163
 
@@ -165,7 +171,9 @@ export default {
165
171
  justify-content: center;
166
172
  border-radius: var(--full-circle);
167
173
  border: var(--default-border);
168
- color: var(--default-background-color-reduced-opacity);
174
+ border-color: var(--pure-white);
175
+ background: var(--pure-white);
176
+ color: var(--primary-color-reduced-opacity);
169
177
  }
170
178
  }
171
179
 
@@ -190,12 +198,24 @@ export default {
190
198
  span, [class*="icon-"] {
191
199
  color: var(--pure-white);
192
200
  }
201
+
202
+ &:hover, &:active, &:focus {
203
+ span, [class*="icon-"] {
204
+ color: var(--pure-white);
205
+
206
+ & + [class*="icon-"] {
207
+ &:last-child {
208
+ color: var(--text-color);
209
+ }
210
+ }
211
+ }
212
+ }
193
213
  }
194
214
 
195
215
  .number {
196
216
  background: var(--pure-white);
197
217
  border-color: var(--pure-white);
198
- color: var(--primary-color);
218
+ color: var(--primary-color) !important;
199
219
  }
200
220
 
201
221
  & ~ li {
@@ -224,8 +244,17 @@ export default {
224
244
  color: var(--primary-color);
225
245
  }
226
246
  }
247
+
248
+ .number {
249
+ border-color: var(--primary-color);
250
+ }
227
251
  }
228
252
  }
253
+
254
+ .number {
255
+ background: none;
256
+ border-color: var(--border-color);
257
+ }
229
258
  }
230
259
 
231
260
  & + li {