@mixd-id/web-scaffold 0.1.230406039 → 0.1.230406041
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.
- package/package.json +1 -1
- package/src/components/Countdown.vue +7 -5
- package/src/utils/helpers.js +20 -1
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<div></div>
|
|
7
7
|
<div></div>
|
|
8
8
|
</div>
|
|
9
|
-
<div v-if="display >= 4" class="mr-2">hari</div>
|
|
9
|
+
<div v-if="display >= 4" class="mr-2" :style="labelStyle">hari</div>
|
|
10
10
|
|
|
11
11
|
<slot v-if="display >= 3 && $slots.hour" name="hour" :hour="hour"></slot>
|
|
12
12
|
<div ref="hour" v-else-if="display >= 3" :class="$style.lap">
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<div></div>
|
|
15
15
|
</div>
|
|
16
16
|
|
|
17
|
-
<div>:</div>
|
|
17
|
+
<div :style="labelStyle">:</div>
|
|
18
18
|
|
|
19
19
|
<slot v-if="display >= 2 && $slots.minute" name="minute" :minute="minute"></slot>
|
|
20
20
|
<div ref="minute" v-else-if="display >= 2" :class="$style.lap">
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<div></div>
|
|
23
23
|
</div>
|
|
24
24
|
|
|
25
|
-
<div>:</div>
|
|
25
|
+
<div :style="labelStyle">:</div>
|
|
26
26
|
|
|
27
27
|
<slot v-if="display >= 1 && $slots.second" name="second" :second="second"></slot>
|
|
28
28
|
<div ref="second" v-else-if="display >= 1" :class="$style.lap">
|
|
@@ -44,7 +44,9 @@ export default{
|
|
|
44
44
|
default: 3
|
|
45
45
|
},
|
|
46
46
|
|
|
47
|
-
value: [ String, Number ] // value in second
|
|
47
|
+
value: [ String, Number ], // value in second,
|
|
48
|
+
|
|
49
|
+
labelStyle: Object
|
|
48
50
|
|
|
49
51
|
},
|
|
50
52
|
|
|
@@ -122,7 +124,7 @@ export default{
|
|
|
122
124
|
},
|
|
123
125
|
|
|
124
126
|
setInitial(){
|
|
125
|
-
if(this.$refs.day) this.$refs.day.lastElementChild.innerHTML = '
|
|
127
|
+
if(this.$refs.day) this.$refs.day.lastElementChild.innerHTML = Math.floor(this.timer / 86400).toString().padStart(2, '0')
|
|
126
128
|
if(this.$refs.hour) this.$refs.hour.lastElementChild.innerHTML = (Math.floor(this.timer / 3600) % 24).toString().padStart(2, '0')
|
|
127
129
|
if(this.$refs.minute) this.$refs.minute.lastElementChild.innerHTML = (Math.floor(this.timer / 60) % 60).toString().padStart(2, '0')
|
|
128
130
|
if(this.$refs.second) this.$refs.second.lastElementChild.innerHTML = (this.timer % 60).toString().padStart(2, '0')
|
package/src/utils/helpers.js
CHANGED
|
@@ -256,6 +256,24 @@ const unflatten = (flatObject) => {
|
|
|
256
256
|
return nestedObject;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
+
const accessNestedObject = function(obj, path) {
|
|
260
|
+
if(!obj || typeof path !== 'string') return undefined
|
|
261
|
+
|
|
262
|
+
const keys = path.split('.');
|
|
263
|
+
let nestedObj = obj;
|
|
264
|
+
|
|
265
|
+
for (let key of keys) {
|
|
266
|
+
if (nestedObj && nestedObj.hasOwnProperty(key)) {
|
|
267
|
+
nestedObj = nestedObj[key];
|
|
268
|
+
} else {
|
|
269
|
+
// Return undefined if any key in the path is missing
|
|
270
|
+
return undefined;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
return nestedObj;
|
|
275
|
+
}
|
|
276
|
+
|
|
259
277
|
|
|
260
278
|
module.exports = {
|
|
261
279
|
ceil,
|
|
@@ -274,5 +292,6 @@ module.exports = {
|
|
|
274
292
|
bufferToStream,
|
|
275
293
|
sequelizeChunk,
|
|
276
294
|
getPresetSortWhereParams,
|
|
277
|
-
unflatten
|
|
295
|
+
unflatten,
|
|
296
|
+
accessNestedObject
|
|
278
297
|
}
|