@mixd-id/web-scaffold 0.1.240411037 → 0.1.240411040
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/List.vue +6 -1
- package/src/index.js +2 -16
- package/src/utils/helpers.mjs +18 -1
- package/src/utils/preset-selector.mjs +3 -3
package/package.json
CHANGED
package/src/components/List.vue
CHANGED
|
@@ -433,7 +433,12 @@ export default{
|
|
|
433
433
|
}
|
|
434
434
|
})
|
|
435
435
|
}
|
|
436
|
-
|
|
436
|
+
else{
|
|
437
|
+
const defaultConfig = setupConfig(await this.defaultConfig())
|
|
438
|
+
Object.assign(this.cConfig, defaultConfig)
|
|
439
|
+
|
|
440
|
+
return new Promise(resolve => resolve())
|
|
441
|
+
}
|
|
437
442
|
}
|
|
438
443
|
else{
|
|
439
444
|
const defaultConfig = setupConfig(await this.defaultConfig())
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {defineAsyncComponent, ref} from "vue"
|
|
2
|
-
import {arrayPush, arrayRemove, arrayUnshift, invokeAfterIdle, observeInit} from './utils/helpers.mjs'
|
|
2
|
+
import {arrayPush, arrayRemove, arrayUnshift, invokeAfterIdle, observeInit, downloadUrl} from './utils/helpers.mjs'
|
|
3
3
|
import dayjs from "dayjs";
|
|
4
4
|
import {useDevice} from './hooks/device.js'
|
|
5
5
|
|
|
@@ -17,21 +17,7 @@ const mediaBreakpoints = [
|
|
|
17
17
|
|
|
18
18
|
const { device } = useDevice()
|
|
19
19
|
|
|
20
|
-
const download = (url, as) => {
|
|
21
|
-
url = url + (url.indexOf('?') >= 0 ? '&' : '?') + 'nocache=' + new Date().getTime()
|
|
22
20
|
|
|
23
|
-
const downloader = document.createElement('a')
|
|
24
|
-
downloader.setAttribute('href', url)
|
|
25
|
-
downloader.target = '_blank'
|
|
26
|
-
if(as) downloader.download = as
|
|
27
|
-
document.body.appendChild(downloader)
|
|
28
|
-
|
|
29
|
-
downloader.click()
|
|
30
|
-
|
|
31
|
-
window.setTimeout(() => {
|
|
32
|
-
document.body.removeChild(downloader)
|
|
33
|
-
}, 100)
|
|
34
|
-
}
|
|
35
21
|
|
|
36
22
|
let preloads = []
|
|
37
23
|
|
|
@@ -330,7 +316,7 @@ export default{
|
|
|
330
316
|
app.config.globalProperties.$t = t => t
|
|
331
317
|
app.config.globalProperties.uniqid = uniqid
|
|
332
318
|
app.config.globalProperties.formatDate = formatDate
|
|
333
|
-
app.config.globalProperties.$download =
|
|
319
|
+
app.config.globalProperties.$download = downloadUrl
|
|
334
320
|
app.config.globalProperties.$preload = preload
|
|
335
321
|
app.config.globalProperties.$popPreloads = popPreloads
|
|
336
322
|
app.config.globalProperties.$util = util
|
package/src/utils/helpers.mjs
CHANGED
|
@@ -604,6 +604,22 @@ function addHash(hash, newHash, prefix = '_'){
|
|
|
604
604
|
return cleaned.join('')
|
|
605
605
|
}
|
|
606
606
|
|
|
607
|
+
const downloadUrl = (url, as) => {
|
|
608
|
+
url = url + (url.indexOf('?') >= 0 ? '&' : '?') + 'nocache=' + new Date().getTime()
|
|
609
|
+
|
|
610
|
+
const downloader = document.createElement('a')
|
|
611
|
+
downloader.setAttribute('href', url)
|
|
612
|
+
downloader.target = '_blank'
|
|
613
|
+
if(as) downloader.download = as
|
|
614
|
+
document.body.appendChild(downloader)
|
|
615
|
+
|
|
616
|
+
downloader.click()
|
|
617
|
+
|
|
618
|
+
window.setTimeout(() => {
|
|
619
|
+
document.body.removeChild(downloader)
|
|
620
|
+
}, 100)
|
|
621
|
+
}
|
|
622
|
+
|
|
607
623
|
export {
|
|
608
624
|
capitalize,
|
|
609
625
|
round,
|
|
@@ -638,7 +654,8 @@ export {
|
|
|
638
654
|
arrayPush,
|
|
639
655
|
arrayRemove,
|
|
640
656
|
arrayUnshift,
|
|
641
|
-
addHash
|
|
657
|
+
addHash,
|
|
658
|
+
downloadUrl
|
|
642
659
|
}
|
|
643
660
|
|
|
644
661
|
function observeInit(){
|
|
@@ -60,7 +60,6 @@ const pickColumns = function(columns, keys){
|
|
|
60
60
|
const setupConfig = (config) => {
|
|
61
61
|
|
|
62
62
|
if(config.domains && !Array.isArray(config.presets)){
|
|
63
|
-
|
|
64
63
|
let defaultConfig
|
|
65
64
|
for(let key in config.domains){
|
|
66
65
|
if(location.host.indexOf(key) >= 0){
|
|
@@ -68,9 +67,10 @@ const setupConfig = (config) => {
|
|
|
68
67
|
break
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
if(!defaultConfig)
|
|
71
|
+
defaultConfig = config.domains['default'] ?? {}
|
|
73
72
|
|
|
73
|
+
Object.assign(config, JSON.parse(JSON.stringify(defaultConfig)))
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
if(Array.isArray(config.presets)){
|