renusify 2.5.2 → 3.0.1
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/components/app/index.vue +74 -22
- package/components/app/toast/index.vue +76 -71
- package/components/app/toast/toast.vue +62 -44
- package/components/avatar/index.vue +207 -84
- package/components/button/buttonConfirm.vue +53 -26
- package/components/button/buttonGroup.js +0 -2
- package/components/button/buttonGroup.vue +310 -62
- package/components/button/index.vue +584 -100
- package/components/calendar/index.js +0 -2
- package/components/calendar/index.vue +326 -262
- package/components/calendar/month.vue +64 -55
- package/components/calendar/year.vue +30 -25
- package/components/card/index.vue +139 -59
- package/components/codeEditor/highlightCss.vue +38 -39
- package/components/codeEditor/highlightHtml.vue +64 -64
- package/components/codeEditor/highlightJs.vue +37 -38
- package/components/codeEditor/index.vue +129 -79
- package/components/codeEditor/run.vue +225 -39
- package/components/codeEditor/useCodeFormatter.js +150 -0
- package/components/confirm/index.vue +139 -80
- package/components/container/col.vue +5 -4
- package/components/container/divider.vue +28 -19
- package/components/container/index.vue +34 -15
- package/components/container/row.vue +26 -9
- package/components/container/spacer.vue +2 -4
- package/components/container/style.scss +3 -0
- package/components/content/index.vue +49 -32
- package/components/cropper/index.vue +401 -244
- package/components/float/index.vue +542 -415
- package/components/form/addressInput/index.vue +184 -109
- package/components/form/camInput/index.vue +370 -244
- package/components/form/checkInput/index.vue +138 -71
- package/components/form/checkboxInput/index.vue +93 -49
- package/components/form/colorInput/Alpha.vue +81 -83
- package/components/form/colorInput/Hue.vue +91 -68
- package/components/form/colorInput/Preview.vue +43 -47
- package/components/form/colorInput/Saturation.vue +101 -86
- package/components/form/colorInput/index.vue +71 -39
- package/components/form/colorInput/picker.vue +111 -106
- package/components/form/colorInput/useColor.js +153 -0
- package/components/form/dateInput/index.vue +691 -356
- package/components/form/dateInput/month.vue +63 -54
- package/components/form/dateInput/year.vue +35 -25
- package/components/form/fileInput/index.js +0 -1
- package/components/form/fileInput/index.vue +263 -106
- package/components/form/fileInput/single.vue +332 -168
- package/components/form/groupInput/index.vue +199 -101
- package/components/form/index.vue +189 -83
- package/components/form/input/index.vue +416 -377
- package/components/form/jsonInput/JsonView.vue +54 -56
- package/components/form/jsonInput/index.vue +247 -165
- package/components/form/maskInput/index.vue +252 -132
- package/components/form/numberInput/index.js +0 -1
- package/components/form/numberInput/index.vue +226 -117
- package/components/form/passwordInput/index.js +2 -1
- package/components/form/passwordInput/index.vue +269 -102
- package/components/form/radioInput/index.vue +143 -72
- package/components/form/rangeInput/index.vue +280 -167
- package/components/form/ratingInput/index.vue +57 -57
- package/components/form/selectInput/index.js +1 -3
- package/components/form/selectInput/index.vue +584 -296
- package/components/form/switchInput/index.vue +73 -59
- package/components/form/telInput/index.js +0 -1
- package/components/form/telInput/index.vue +238 -135
- package/components/form/textArea/index.vue +72 -35
- package/components/form/textEditor/index.vue +739 -0
- package/components/form/{text-editor → textEditor}/style.scss +8 -16
- package/components/form/textInput/index.vue +54 -32
- package/components/form/timeInput/index.vue +82 -55
- package/components/form/timeInput/range.vue +115 -94
- package/components/form/timeInput/timepicker.vue +382 -449
- package/components/form/uniqueInput/index.vue +105 -48
- package/components/form/unitInput/index.vue +139 -84
- package/components/formCreator/index.js +0 -1
- package/components/formCreator/index.vue +314 -148
- package/components/highlight/index.vue +41 -25
- package/components/highlight/style.scss +2 -2
- package/components/highlight/{mixin.js → useHighlight.js} +181 -160
- package/components/icon/index.vue +79 -33
- package/components/img/index.vue +250 -147
- package/components/img/preview.vue +180 -198
- package/components/img/svgImg.vue +42 -39
- package/components/index.js +5 -20
- package/components/infinite/index.js +3 -3
- package/components/infinite/index.vue +290 -66
- package/components/map/index.vue +428 -261
- package/components/map/route.vue +794 -487
- package/components/map/select.vue +118 -58
- package/components/menu/index.vue +206 -94
- package/components/meta/meta.js +26 -3
- package/components/modal/index.vue +382 -156
- package/components/notify/index.vue +204 -86
- package/components/notify/notification.vue +38 -55
- package/components/progress/circle.vue +189 -70
- package/components/progress/line.vue +266 -46
- package/components/searchBox/index.js +1 -3
- package/components/searchBox/index.vue +194 -101
- package/components/skeleton/index.vue +45 -20
- package/components/slider/index.vue +319 -156
- package/components/swiper/index.vue +237 -108
- package/components/table/crud/footer.vue +77 -53
- package/components/table/crud/header.vue +71 -72
- package/components/table/crud/index.vue +629 -399
- package/components/table/index.vue +721 -278
- package/components/timeAgo/index.vue +145 -96
- package/components/tour/index.vue +338 -235
- package/components/tree/index.vue +235 -89
- package/components/tree/tree-element.vue +106 -106
- package/directive/animate/index.js +77 -0
- package/directive/clickOutSide/index.js +98 -0
- package/directive/drag/index.js +153 -0
- package/directive/index.js +11 -13
- package/directive/intersect/index.js +263 -0
- package/directive/mask/index.js +67 -0
- package/directive/parallax/index.js +78 -0
- package/directive/ripple/index.js +14 -0
- package/directive/scroll/index.js +272 -24
- package/directive/sortable/index.js +274 -0
- package/directive/title/index.js +75 -0
- package/directive/touch/index.js +268 -0
- package/index.js +11 -19
- package/package.json +5 -2
- package/plugins/validation/Validate.js +88 -79
- package/scripts/generate-docs.mjs +226 -0
- package/scripts/menu.mjs +240 -0
- package/scripts/parser.mjs +1086 -0
- package/style/_index.scss +7 -0
- package/style/app.scss +13 -65
- package/style/colors.scss +5 -22
- package/style/functions/index.scss +8 -0
- package/style/mixins/index.scss +17 -5
- package/style/variables/base.scss +155 -178
- package/style/variables/color.scss +0 -12
- package/style/variables/utilities.scss +0 -180
- package/tools/helper.js +0 -8
- package/tools/icons.js +7 -2
- package/tools/root.js +71 -0
- package/components/app/style.scss +0 -41
- package/components/app/toast/style.scss +0 -20
- package/components/avatar/style.scss +0 -32
- package/components/bar/bottomNav.js +0 -1
- package/components/bar/bottomNav.vue +0 -28
- package/components/bar/bottomNavigationCircle.js +0 -2
- package/components/bar/bottomNavigationCircle.vue +0 -99
- package/components/bar/scss/bottomNav.scss +0 -67
- package/components/bar/scss/toolbar.scss +0 -174
- package/components/bar/toolbar/index.js +0 -8
- package/components/bar/toolbar/index.vue +0 -35
- package/components/bar/toolbar/laptop.vue +0 -33
- package/components/bar/toolbar/menuChilds.vue +0 -41
- package/components/bar/toolbar/menuLaptop.vue +0 -41
- package/components/bar/toolbar/menuMob.vue +0 -39
- package/components/bar/toolbar/mixin.js +0 -43
- package/components/bar/toolbar/mobile.vue +0 -34
- package/components/breadcrumb/bredcrumbItem.vue +0 -39
- package/components/breadcrumb/index.js +0 -3
- package/components/breadcrumb/index.vue +0 -71
- package/components/breadcrumb/style.scss +0 -51
- package/components/button/style.scss +0 -411
- package/components/card/style.scss +0 -86
- package/components/chart/chart.js +0 -1
- package/components/chart/chart.vue +0 -69
- package/components/chart/worldMap.js +0 -2
- package/components/chart/worldMap.vue +0 -1112
- package/components/chat/MessageList.vue +0 -163
- package/components/chat/chatInput.vue +0 -150
- package/components/chat/chatMsg.vue +0 -276
- package/components/chat/index.js +0 -11
- package/components/chat/index.vue +0 -113
- package/components/chip/index.js +0 -3
- package/components/chip/index.vue +0 -77
- package/components/chip/style.scss +0 -199
- package/components/codeEditor/mixin.js +0 -145
- package/components/countdown/index.js +0 -1
- package/components/countdown/index.vue +0 -105
- package/components/form/colorInput/mixin.js +0 -132
- package/components/form/fileInput/file.js +0 -148
- package/components/form/telInput/assets/flags.png +0 -0
- package/components/form/telInput/assets/flags@2x.png +0 -0
- package/components/form/text-editor/index.vue +0 -705
- package/components/icon/style.scss +0 -17
- package/components/infinite/div.js +0 -6
- package/components/infinite/div.vue +0 -193
- package/components/infinite/page.js +0 -3
- package/components/infinite/page.vue +0 -105
- package/components/list/index.js +0 -3
- package/components/list/index.vue +0 -122
- package/components/list/style.scss +0 -66
- package/components/message/index.js +0 -4
- package/components/message/index.vue +0 -40
- package/components/modal/style.scss +0 -146
- package/components/nestable/NestableItem.vue +0 -307
- package/components/nestable/editable.js +0 -44
- package/components/nestable/index.js +0 -1
- package/components/nestable/index.vue +0 -226
- package/components/nestable/methods.js +0 -416
- package/components/progress/style.scss +0 -229
- package/components/table/style.scss +0 -338
- package/components/tabs/index.js +0 -3
- package/components/tabs/index.vue +0 -151
- package/components/timeline/index.js +0 -6
- package/components/timeline/index.vue +0 -76
- package/directive/resize/index.js +0 -30
- package/directive/skeleton/index.js +0 -27
- package/directive/skeleton/style.scss +0 -37
- package/plugins/request/Request.js +0 -68
- package/style/animation.scss +0 -94
- package/style/style.scss +0 -8
- package/tools/rootable.js +0 -75
- /package/components/form/{text-editor → textEditor}/index.js +0 -0
- /package/components/form/{text-editor → textEditor}/preview.js +0 -0
- /package/components/form/{text-editor → textEditor}/preview.vue +0 -0
|
@@ -2,66 +2,75 @@
|
|
|
2
2
|
<div class="d-flex flex-wrap h-space-around">
|
|
3
3
|
<r-btn v-for="i in ls"
|
|
4
4
|
:key="i"
|
|
5
|
-
|
|
6
|
-
class="w-25 ma-1"
|
|
5
|
+
class="btn-month ma-1"
|
|
7
6
|
:class="{'color-one':i===modelValue}"
|
|
8
|
-
@click.prevent="
|
|
7
|
+
@click.prevent="emitValue(i)">
|
|
9
8
|
{{
|
|
10
9
|
$d(new Date(year, i, 1, 0, timezoneOffset), 'month', locale)
|
|
11
10
|
}}
|
|
12
11
|
</r-btn>
|
|
13
12
|
</div>
|
|
14
13
|
</template>
|
|
15
|
-
<script>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
emit(n) {
|
|
63
|
-
this.$emit('update:modelValue', n)
|
|
64
|
-
}
|
|
14
|
+
<script setup>
|
|
15
|
+
import {ref, inject, onBeforeMount} from 'vue'
|
|
16
|
+
|
|
17
|
+
const props = defineProps({
|
|
18
|
+
modelValue: Number,
|
|
19
|
+
timezoneOffset: Number,
|
|
20
|
+
locale: String,
|
|
21
|
+
month: Number,
|
|
22
|
+
year: Number
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const emit = defineEmits(['update:modelValue'])
|
|
26
|
+
|
|
27
|
+
const $d = inject('renusify').$d
|
|
28
|
+
|
|
29
|
+
const ls = ref([])
|
|
30
|
+
|
|
31
|
+
const emitValue = (n) => {
|
|
32
|
+
emit('update:modelValue', n)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const yearValue = $d(new Date(props.year, props.month, 5, 0, props.timezoneOffset), 'ye', props.locale)
|
|
36
|
+
let list = []
|
|
37
|
+
let first = 0
|
|
38
|
+
let n = 0
|
|
39
|
+
|
|
40
|
+
while (true) {
|
|
41
|
+
n++
|
|
42
|
+
if (n > 100) {
|
|
43
|
+
break
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const y = $d(new Date(props.year, first, 5, 0, props.timezoneOffset), 'ye', props.locale)
|
|
47
|
+
const m = parseInt($d(new Date(props.year, first, 5, 0, props.timezoneOffset), 'me', props.locale))
|
|
48
|
+
|
|
49
|
+
if (y === yearValue && m === 1) {
|
|
50
|
+
break
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (y > yearValue) {
|
|
54
|
+
first--
|
|
55
|
+
} else if (y < yearValue) {
|
|
56
|
+
first++
|
|
57
|
+
} else if (m > 1) {
|
|
58
|
+
first--
|
|
59
|
+
} else {
|
|
60
|
+
first++
|
|
65
61
|
}
|
|
66
62
|
}
|
|
67
|
-
|
|
63
|
+
|
|
64
|
+
for (let i = 0; i < 12; i++) {
|
|
65
|
+
list.push(first + i)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
ls.value = list
|
|
69
|
+
</script>
|
|
70
|
+
<style lang="scss">
|
|
71
|
+
.btn-month {
|
|
72
|
+
width: 25%;
|
|
73
|
+
background-color: var(--color-sheet-container);
|
|
74
|
+
border: 1px solid var(--color-border-low);
|
|
75
|
+
}
|
|
76
|
+
</style>
|
|
@@ -1,37 +1,47 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
2
|
+
<div class="year-tab d-flex flex-wrap h-space-around">
|
|
3
3
|
<r-btn v-for="i in 200"
|
|
4
4
|
:key="i"
|
|
5
|
-
class="
|
|
5
|
+
class="btn-year ma-1"
|
|
6
6
|
:class="{'color-one year-select':modelValue+i-100===modelValue}"
|
|
7
|
-
|
|
8
|
-
@click.prevent="emit(modelValue+i-100)">
|
|
7
|
+
@click.prevent="emitValue(modelValue+i-100)">
|
|
9
8
|
{{
|
|
10
9
|
$d(new Date(modelValue + i - 100, month, 5, 0, timezoneOffset), 'year', locale)
|
|
11
10
|
}}
|
|
12
11
|
</r-btn>
|
|
13
12
|
</div>
|
|
14
13
|
</template>
|
|
15
|
-
<script>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
methods: {
|
|
32
|
-
emit(n) {
|
|
33
|
-
this.$emit('update:modelValue', n - this.modelValue)
|
|
34
|
-
}
|
|
35
|
-
}
|
|
14
|
+
<script setup>
|
|
15
|
+
import {onMounted} from 'vue'
|
|
16
|
+
|
|
17
|
+
const props = defineProps({
|
|
18
|
+
modelValue: Number,
|
|
19
|
+
timezoneOffset: Number,
|
|
20
|
+
locale: String,
|
|
21
|
+
month: Number
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const emit = defineEmits(['update:modelValue'])
|
|
25
|
+
|
|
26
|
+
const emitValue = (n) => {
|
|
27
|
+
emit('update:modelValue', n - props.modelValue)
|
|
36
28
|
}
|
|
29
|
+
|
|
30
|
+
onMounted(() => {
|
|
31
|
+
let el = document.querySelector('.year-select')
|
|
32
|
+
if (el) {
|
|
33
|
+
el.scrollIntoView(true)
|
|
34
|
+
}
|
|
35
|
+
})
|
|
37
36
|
</script>
|
|
37
|
+
<style lang="scss">
|
|
38
|
+
.year-tab {
|
|
39
|
+
max-height: 300px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.btn-year {
|
|
43
|
+
width: 25%;
|
|
44
|
+
background-color: var(--color-sheet-container);
|
|
45
|
+
border: 1px solid var(--color-border-low);
|
|
46
|
+
}
|
|
47
|
+
</style>
|
|
@@ -4,5 +4,4 @@ export * as l_textInput from '../textInput/index.js'
|
|
|
4
4
|
export * as l_btn from '../../button/index.js'
|
|
5
5
|
export * as l_icon from '../../icon/index.js'
|
|
6
6
|
export * as l_cropper from '../../cropper/index.js'
|
|
7
|
-
export * as l_row from '../../container/row.js'
|
|
8
7
|
export * as l_circle from '../../progress/circle.js'
|
|
@@ -1,122 +1,279 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<r-input
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
<r-input
|
|
3
|
+
:class="[`${$r.prefix}file-input`]"
|
|
4
|
+
:label="labelFile"
|
|
5
|
+
:model-value="filesLinks.length > 0 ? filesLinks : null"
|
|
6
|
+
class="label-active"
|
|
7
|
+
label-active
|
|
8
|
+
v-bind="attrs"
|
|
9
|
+
>
|
|
10
|
+
<div class="d-flex">
|
|
11
|
+
<template v-for="(file, n) in filesLinks" :key="meta ? file['url'] : file">
|
|
12
|
+
<single
|
|
13
|
+
:accept="accept"
|
|
14
|
+
:max-file-size="maxFileSize"
|
|
15
|
+
:meta="meta"
|
|
16
|
+
:meta-required="metaRequired"
|
|
17
|
+
:model-value="file"
|
|
18
|
+
:upload-link="uploadLink"
|
|
19
|
+
:w-p-h="wPH"
|
|
20
|
+
class="ma-1"
|
|
21
|
+
@select="$emit('add', true)"
|
|
22
|
+
@file-link="setLink(n, $event)"
|
|
20
23
|
></single>
|
|
21
24
|
</template>
|
|
22
|
-
<single
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
<single
|
|
26
|
+
v-if="filesLinks.length < size"
|
|
27
|
+
:key="'add-' + keyAdd"
|
|
28
|
+
:accept="accept"
|
|
29
|
+
:max-file-size="maxFileSize"
|
|
30
|
+
:meta="meta"
|
|
31
|
+
:meta-required="metaRequired"
|
|
32
|
+
:model-value="null"
|
|
33
|
+
:upload-link="uploadLink"
|
|
34
|
+
:w-p-h="wPH"
|
|
35
|
+
class="ma-1"
|
|
36
|
+
@select="$emit('add', true)"
|
|
37
|
+
@file-link="setLink(filesLinks.length, $event)"
|
|
32
38
|
></single>
|
|
33
|
-
</
|
|
39
|
+
</div>
|
|
34
40
|
</r-input>
|
|
35
41
|
</template>
|
|
36
42
|
|
|
37
|
-
<script>
|
|
38
|
-
import {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
type: String
|
|
51
|
-
},
|
|
52
|
-
size: {
|
|
53
|
-
default: 3,
|
|
54
|
-
type: Number
|
|
55
|
-
},
|
|
56
|
-
wPH: [Number, String, Array],
|
|
57
|
-
maxFileSize: Number,
|
|
58
|
-
modelValue: {
|
|
59
|
-
default: () => {
|
|
60
|
-
return []
|
|
61
|
-
},
|
|
62
|
-
type: Array
|
|
63
|
-
},
|
|
64
|
-
meta: Array,
|
|
65
|
-
metaRequired: {type: Boolean, default: true}
|
|
43
|
+
<script setup>
|
|
44
|
+
import {ref, computed, watch, useAttrs, inject} from 'vue'
|
|
45
|
+
import Single from "./single.vue";
|
|
46
|
+
|
|
47
|
+
const props = defineProps({
|
|
48
|
+
/**
|
|
49
|
+
* API endpoint URL for file upload
|
|
50
|
+
* @type {String}
|
|
51
|
+
* @required
|
|
52
|
+
*/
|
|
53
|
+
uploadLink: {
|
|
54
|
+
type: String,
|
|
55
|
+
required: true
|
|
66
56
|
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Accepted file types (MIME types or extensions)
|
|
60
|
+
* @type {String}
|
|
61
|
+
* @default '*'
|
|
62
|
+
*/
|
|
63
|
+
accept: {
|
|
64
|
+
default: '*',
|
|
65
|
+
type: String
|
|
70
66
|
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Number of files allowed to upload simultaneously
|
|
70
|
+
* @type {Number}
|
|
71
|
+
* @default 3
|
|
72
|
+
*/
|
|
73
|
+
size: {
|
|
74
|
+
default: 3,
|
|
75
|
+
type: Number
|
|
76
76
|
},
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Width/Height requirements for images
|
|
80
|
+
* @type {Number|String|Array}
|
|
81
|
+
*/
|
|
82
|
+
wPH: [Number, String, Array],
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Maximum file size in bytes
|
|
86
|
+
* @type {Number}
|
|
87
|
+
*/
|
|
88
|
+
maxFileSize: Number,
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The model value for uploaded files (v-model)
|
|
92
|
+
* @type {Array}
|
|
93
|
+
* @default () => []
|
|
94
|
+
*/
|
|
95
|
+
modelValue: {
|
|
96
|
+
default: () => [],
|
|
97
|
+
type: Array
|
|
79
98
|
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Additional metadata fields for files
|
|
102
|
+
* @type {Array[String]}
|
|
103
|
+
*/
|
|
104
|
+
meta: Array,
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Whether metadata is required for each file
|
|
108
|
+
* @type {Boolean}
|
|
109
|
+
* @default true
|
|
110
|
+
*/
|
|
111
|
+
metaRequired: {
|
|
112
|
+
type: Boolean,
|
|
113
|
+
default: true
|
|
114
|
+
}
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
const emit = defineEmits([
|
|
118
|
+
/**
|
|
119
|
+
* Emitted when the uploaded files array changes
|
|
120
|
+
* @param {Array} files - Array of uploaded file links/objects
|
|
121
|
+
*/
|
|
122
|
+
'update:modelValue',
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Emitted when a new file is added
|
|
126
|
+
* @param {Object} file - The added file object
|
|
127
|
+
*/
|
|
128
|
+
'add'
|
|
129
|
+
])
|
|
130
|
+
|
|
131
|
+
const {$t, $helper, $r} = inject('renusify')
|
|
132
|
+
|
|
133
|
+
const keyAdd = ref(0)
|
|
134
|
+
const filesLinks = ref([])
|
|
135
|
+
|
|
136
|
+
const attrs = useAttrs()
|
|
137
|
+
|
|
138
|
+
const labelFile = computed(() => {
|
|
139
|
+
let label = attrs.label || ''
|
|
140
|
+
|
|
141
|
+
if (props.maxFileSize) {
|
|
142
|
+
const sizeInKB = props.maxFileSize / 1024
|
|
143
|
+
label += ' (' + $t(['max_allow_size', [sizeInKB]], 'renusify') + ')'
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (props.wPH) {
|
|
147
|
+
label += ' (' + $t(['image_w_p_h', [props.wPH]], 'renusify') + ')'
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return label
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Initializes filesLinks from modelValue
|
|
155
|
+
*/
|
|
156
|
+
const setValue = () => {
|
|
157
|
+
if (props.modelValue && Array.isArray(props.modelValue)) {
|
|
158
|
+
filesLinks.value = props.modelValue
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Updates files links array and emits changes
|
|
164
|
+
* @param {Number} index - Index of the file to update
|
|
165
|
+
* @param {Object} event - File link/object
|
|
166
|
+
*/
|
|
167
|
+
const setLink = (index, event) => {
|
|
168
|
+
if (index >= filesLinks.value.length) {
|
|
169
|
+
filesLinks.value.push(event)
|
|
170
|
+
} else {
|
|
171
|
+
filesLinks.value[index] = event
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const cleaned = $helper.cleanArray(filesLinks.value)
|
|
175
|
+
|
|
176
|
+
filesLinks.value = cleaned
|
|
177
|
+
emit('update:modelValue', cleaned)
|
|
178
|
+
keyAdd.value++
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
watch(() => props.modelValue, () => {
|
|
182
|
+
setValue()
|
|
183
|
+
}, {immediate: true, deep: true})
|
|
184
|
+
</script>
|
|
185
|
+
|
|
186
|
+
<style lang="scss">
|
|
187
|
+
@use "../../../style" as *;
|
|
188
|
+
|
|
189
|
+
.#{$prefix}file-input {
|
|
190
|
+
.input-control {
|
|
191
|
+
height: auto;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.pick-icon {
|
|
195
|
+
width: 100%;
|
|
196
|
+
height: 100%;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.image-card {
|
|
200
|
+
position: relative;
|
|
201
|
+
width: auto;
|
|
202
|
+
min-width: 150px;
|
|
203
|
+
min-height: 150px;
|
|
204
|
+
background-color: white;
|
|
205
|
+
|
|
206
|
+
.file-meta {
|
|
207
|
+
width: 250px;
|
|
83
208
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
for (let k in this.$attrs) {
|
|
89
|
-
if (k !== 'label') {
|
|
90
|
-
l[k] = this.$attrs[k]
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return l
|
|
94
|
-
},
|
|
95
|
-
labelFile() {
|
|
96
|
-
let l = this.$attrs.label || ''
|
|
97
|
-
if (this.maxFileSize) {
|
|
98
|
-
l += ' (' + this.$t(['max_allow_size', [this.maxFileSize / 1024]], 'renusify') + ')'
|
|
99
|
-
}
|
|
100
|
-
if (this.wPH) {
|
|
101
|
-
l += ' (' + this.$t(['image_w_p_h', [this.wPH]], 'renusify') + ')'
|
|
102
|
-
}
|
|
103
|
-
return l
|
|
209
|
+
|
|
210
|
+
.fails {
|
|
211
|
+
-webkit-filter: grayscale(100%);
|
|
212
|
+
filter: grayscale(100%);
|
|
104
213
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
214
|
+
|
|
215
|
+
.inProgress {
|
|
216
|
+
-webkit-filter: blur(2px);
|
|
217
|
+
filter: blur(2px);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.finished {
|
|
221
|
+
-webkit-filter: blur(0px);
|
|
222
|
+
filter: blur(0px);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.file {
|
|
226
|
+
left: 0;
|
|
227
|
+
right: 0;
|
|
228
|
+
position: absolute;
|
|
229
|
+
top: 0;
|
|
230
|
+
bottom: 0;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.image {
|
|
234
|
+
width: auto;
|
|
235
|
+
min-width: 150px;
|
|
236
|
+
height: 150px;
|
|
237
|
+
z-index: -2;
|
|
238
|
+
opacity: 0.8;
|
|
239
|
+
max-width: 100%;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.icon-100 {
|
|
243
|
+
width: 100px;
|
|
244
|
+
height: 100px;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.image-canvas {
|
|
248
|
+
width: auto;
|
|
249
|
+
min-width: 150px;
|
|
250
|
+
height: 150px;
|
|
251
|
+
position: relative;
|
|
252
|
+
background-image: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.image-close {
|
|
256
|
+
cursor: pointer;
|
|
257
|
+
position: absolute;
|
|
258
|
+
left: 5px;
|
|
259
|
+
top: 5px;
|
|
260
|
+
z-index: 1;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.image-progress {
|
|
264
|
+
z-index: 1;
|
|
265
|
+
position: absolute;
|
|
266
|
+
right: 5px;
|
|
267
|
+
top: 5px;
|
|
268
|
+
color: white;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.image-copy {
|
|
272
|
+
z-index: 1;
|
|
273
|
+
position: absolute;
|
|
274
|
+
left: 5px;
|
|
275
|
+
bottom: 5px;
|
|
118
276
|
}
|
|
119
277
|
}
|
|
120
278
|
}
|
|
121
|
-
</
|
|
122
|
-
|
|
279
|
+
</style>
|