comand-component-library 4.0.96 → 4.0.98
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/comand-component-library.js +29 -13
- package/dist/comand-component-library.umd.cjs +1 -1
- package/package.json +1 -1
- package/src/ComponentLibrary.vue +9 -0
- package/src/components/CmdOpeningHours.vue +9 -0
- package/src/components/CmdOpeningHoursItem.vue +13 -4
- package/src/documentation/generated/CmdBoxPropertyDescriptions.json +1 -1
- package/src/documentation/generated/CmdOpeningHoursPropertyDescriptions.json +8 -3
- package/src/documentation/generated/CmdTextImageBlockPropertyDescriptions.json +8 -3
- package/src/documentation/generated/CmdThumbnailScrollerPropertyDescriptions.json +5 -0
- package/src/documentation/generated/CmdToggleDarkModePropertyDescriptions.json +10 -0
package/package.json
CHANGED
package/src/ComponentLibrary.vue
CHANGED
@@ -1658,6 +1658,15 @@
|
|
1658
1658
|
v-bind="cmdOpeningHoursSettingsData"
|
1659
1659
|
:openingHours="openingHoursData"
|
1660
1660
|
:checkInterval="0"
|
1661
|
+
abbreviationTextAm="h"
|
1662
|
+
abbreviationTextPm="h"
|
1663
|
+
/>
|
1664
|
+
<CmdOpeningHours
|
1665
|
+
ref="CmdOpeningHours"
|
1666
|
+
v-bind="cmdOpeningHoursSettingsData"
|
1667
|
+
:openingHours="openingHoursData"
|
1668
|
+
:checkInterval="0"
|
1669
|
+
:use24HoursFormat="false"
|
1661
1670
|
/>
|
1662
1671
|
</CmdWidthLimitationWrapper>
|
1663
1672
|
<!-- end opening-hours ------------------------------------------------------------------------------------------------------------------------------------------------------->
|
@@ -49,6 +49,7 @@
|
|
49
49
|
:separator="separator"
|
50
50
|
:abbreviationTextAm="abbreviationTextAm"
|
51
51
|
:abbreviationTextPm="abbreviationTextPm"
|
52
|
+
:use24HoursFormat="use24HoursFormat"
|
52
53
|
/>
|
53
54
|
</dl>
|
54
55
|
<!-- end default view -->
|
@@ -78,6 +79,7 @@
|
|
78
79
|
:separator="separator"
|
79
80
|
:abbreviationTextAm="abbreviationTextAm"
|
80
81
|
:abbreviationTextPm="abbreviationTextPm"
|
82
|
+
:use24HoursFormat="use24HoursFormat"
|
81
83
|
/>
|
82
84
|
</dl>
|
83
85
|
</EditComponentWrapper>
|
@@ -257,6 +259,13 @@ export default {
|
|
257
259
|
type: Boolean,
|
258
260
|
default: true
|
259
261
|
},
|
262
|
+
/**
|
263
|
+
* toggle 24- and 12-hours format
|
264
|
+
*/
|
265
|
+
use24HoursFormat: {
|
266
|
+
type: Boolean,
|
267
|
+
default: true
|
268
|
+
},
|
260
269
|
/**
|
261
270
|
* properties for CmdLink-component
|
262
271
|
*/
|
@@ -126,7 +126,7 @@
|
|
126
126
|
import EditMode from "../mixins/EditMode.vue"
|
127
127
|
import {updateHandlerProvider} from "../utils/editmode.js"
|
128
128
|
|
129
|
-
function timeFormatting(separator, suffix1, suffix2, hoursLeadingZero = true) {
|
129
|
+
function timeFormatting(separator, suffix1, suffix2, hoursLeadingZero = true, use24HoursFormat = true) {
|
130
130
|
function addLeadingZero(time, addLeadingZero) {
|
131
131
|
if (addLeadingZero && time < 10) {
|
132
132
|
return "0" + time
|
@@ -139,7 +139,9 @@ function timeFormatting(separator, suffix1, suffix2, hoursLeadingZero = true) {
|
|
139
139
|
let hour12 = hour
|
140
140
|
let currentSuffix = suffix1
|
141
141
|
if (hour12 > 12) {
|
142
|
-
|
142
|
+
if(!use24HoursFormat) {
|
143
|
+
hour12 -= 12
|
144
|
+
}
|
143
145
|
currentSuffix = suffix2
|
144
146
|
}
|
145
147
|
return addLeadingZero(hour12, hoursLeadingZero) + separator + addLeadingZero(minute, true) + currentSuffix
|
@@ -157,6 +159,13 @@ export default {
|
|
157
159
|
}
|
158
160
|
},
|
159
161
|
props: {
|
162
|
+
/**
|
163
|
+
* toggle 24- and 12-hours format
|
164
|
+
*/
|
165
|
+
use24HoursFormat: {
|
166
|
+
type: Boolean,
|
167
|
+
required: false
|
168
|
+
},
|
160
169
|
/**
|
161
170
|
* list of opening-hours
|
162
171
|
*/
|
@@ -202,7 +211,7 @@ export default {
|
|
202
211
|
return this.timeFormatter(time.hours, time.mins)
|
203
212
|
}
|
204
213
|
|
205
|
-
return timeFormatting(":", " " + this.abbreviationTextAm, " " + this.abbreviationTextPm, false)(time.hours, time.mins)
|
214
|
+
return timeFormatting(":", " " + this.abbreviationTextAm, " " + this.abbreviationTextPm, false, this.use24HoursFormat)(time.hours, time.mins)
|
206
215
|
},
|
207
216
|
updateHandlerProvider() {
|
208
217
|
const data = this.editableDay
|
@@ -228,7 +237,7 @@ export default {
|
|
228
237
|
watch: {
|
229
238
|
day: {
|
230
239
|
handler() {
|
231
|
-
const timeFormatter = timeFormatting(":", "", "", true)
|
240
|
+
const timeFormatter = timeFormatting(":", "", "", true, this.use24HoursFormat)
|
232
241
|
this.editableDay = {
|
233
242
|
day: this.day.day,
|
234
243
|
amFrom: timeFormatter(this.day.am.fromTime.hours, this.day.am.fromTime.mins),
|
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"
|
2
|
+
"cmdLink": {
|
3
3
|
"comments": [
|
4
4
|
"set a link to a detail page"
|
5
5
|
]
|
@@ -39,9 +39,9 @@
|
|
39
39
|
"list of opening-hours"
|
40
40
|
]
|
41
41
|
},
|
42
|
-
"
|
42
|
+
"textHolidays": {
|
43
43
|
"comments": [
|
44
|
-
"text to show
|
44
|
+
"text to show for holidays"
|
45
45
|
]
|
46
46
|
},
|
47
47
|
"textMiscInfo": {
|
@@ -49,6 +49,11 @@
|
|
49
49
|
"additional/miscellaneous text (shown below holiday-closed-text/opening hours)"
|
50
50
|
]
|
51
51
|
},
|
52
|
+
"use24HoursFormat": {
|
53
|
+
"comments": [
|
54
|
+
"Toggle if 24- or 12-hour format should be used"
|
55
|
+
]
|
56
|
+
},
|
52
57
|
"cmdHeadline": {
|
53
58
|
"comments": [
|
54
59
|
"properties for CmdHeadline-component"
|
@@ -19,18 +19,23 @@
|
|
19
19
|
]
|
20
20
|
}
|
21
21
|
},
|
22
|
+
"editModeContextData": {
|
23
|
+
"comments": [
|
24
|
+
"data for edit-mode"
|
25
|
+
]
|
26
|
+
},
|
22
27
|
"htmlContent": {
|
23
28
|
"comments": [
|
24
29
|
"define html-content for box-body"
|
25
30
|
]
|
26
31
|
},
|
27
|
-
"
|
32
|
+
"orientation": {
|
28
33
|
"comments": [
|
29
|
-
"
|
34
|
+
"set orientation for inner-content"
|
30
35
|
],
|
31
36
|
"annotations": {
|
32
37
|
"allowedValues": [
|
33
|
-
"
|
38
|
+
"vertical, horizontal"
|
34
39
|
]
|
35
40
|
}
|
36
41
|
},
|
@@ -18,6 +18,16 @@
|
|
18
18
|
"toggle visibility of label"
|
19
19
|
]
|
20
20
|
},
|
21
|
+
"styledAsButton": {
|
22
|
+
"comments": [
|
23
|
+
"activate if checkbox should be displayed as button"
|
24
|
+
],
|
25
|
+
"annotations": {
|
26
|
+
"affectsStyling": [
|
27
|
+
"true"
|
28
|
+
]
|
29
|
+
}
|
30
|
+
},
|
21
31
|
"useStyledLayout": {
|
22
32
|
"comments": [
|
23
33
|
"activate if styled layout should be used"
|