comand-component-library 4.0.96 → 4.0.97

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "comand-component-library",
3
- "version": "4.0.96",
3
+ "version": "4.0.97",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "GPL-3.0-only",
@@ -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
- hour12 -= 12
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),
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "collapsible": {
46
46
  "comments": [
47
- "activate if box should be collapsible"
47
+ "activate2 if box should be collapsible"
48
48
  ]
49
49
  },
50
50
  "cutoffTextLines": {
@@ -1,5 +1,5 @@
1
1
  {
2
- "link": {
2
+ "cmdLink": {
3
3
  "comments": [
4
4
  "set a link to a detail page"
5
5
  ]
@@ -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
- "toggle orientation for content": {
32
+ "orientation": {
28
33
  "comments": [
29
- "define html-content for box-body"
34
+ "set orientation for inner-content"
30
35
  ],
31
36
  "annotations": {
32
37
  "allowedValues": [
33
- "horizontal, vertical"
38
+ "vertical, horizontal"
34
39
  ]
35
40
  }
36
41
  },
@@ -4,6 +4,11 @@
4
4
  "properties for CmdHeadline-component"
5
5
  ]
6
6
  },
7
+ "activeItemIndex": {
8
+ "comments": [
9
+ "set active (highlighted) item"
10
+ ]
11
+ },
7
12
  "contentType": {
8
13
  "comments": [
9
14
  "define content Type"