renusify 2.5.1 → 3.0.0
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 +208 -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 +140 -81
- 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 +87 -47
- 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 +72 -40
- 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 +323 -164
- 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 +83 -56
- package/components/form/timeInput/range.vue +116 -95
- 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 +249 -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 +1 -2
- package/components/infinite/index.vue +248 -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 +201 -91
- package/components/meta/meta.js +26 -3
- package/components/modal/index.vue +383 -158
- 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 +318 -156
- package/components/swiper/index.vue +254 -106
- package/components/table/crud/footer.vue +77 -53
- package/components/table/crud/header.vue +71 -72
- package/components/table/crud/index.vue +631 -401
- 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 +107 -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 +244 -0
- package/directive/sortable/index.js +274 -0
- package/directive/title/index.js +75 -0
- package/directive/touch/index.js +268 -0
- package/index.js +10 -8
- 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 +154 -175
- package/style/variables/color.scss +0 -12
- package/style/variables/utilities.scss +0 -180
- package/tools/helper.js +0 -8
- package/tools/icons.js +6 -1
- 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 -710
- 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
|
@@ -4,26 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
.#{base.$prefix}text-editor {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
margin-top: 20px;
|
|
7
|
+
> .input-control {
|
|
8
|
+
height: auto;
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
&:not(.input-tile) {
|
|
17
|
-
border-radius: map.get(base.$borders, 'xl');
|
|
18
|
-
|
|
19
|
-
.editor-content {
|
|
20
|
-
border-radius: map.get(base.$borders, 'lg');
|
|
21
|
-
}
|
|
11
|
+
.#{base.$prefix}button-group {
|
|
12
|
+
box-shadow: none;
|
|
13
|
+
border: 1px solid var(--color-sheet-low);
|
|
22
14
|
}
|
|
23
15
|
|
|
24
|
-
.editor-content, .input-control {
|
|
16
|
+
.editor-content, .class-select .input-control {
|
|
25
17
|
border: 1px solid var(--color-sheet-low);
|
|
26
|
-
background-color: var(--color-sheet
|
|
18
|
+
background-color: var(--color-sheet);
|
|
27
19
|
}
|
|
28
20
|
|
|
29
21
|
@include mixins.typography(base.$headings, 'body-2');
|
|
@@ -62,7 +54,7 @@
|
|
|
62
54
|
.img-holder {
|
|
63
55
|
display: inline-block;
|
|
64
56
|
position: relative;
|
|
65
|
-
|
|
57
|
+
border: 1px solid var(--color-sheet-low);
|
|
66
58
|
.#{base.$prefix}btn {
|
|
67
59
|
position: absolute;
|
|
68
60
|
top: 0;
|
|
@@ -1,50 +1,72 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<r-input :active="active"
|
|
3
3
|
v-model="lazyValue"
|
|
4
|
-
@update:model-value="
|
|
4
|
+
@update:model-value="emitValue"
|
|
5
5
|
@click.prevent="handleClick">
|
|
6
|
-
<input :autofocus="autofocus"
|
|
6
|
+
<input :autofocus="$attrs.autofocus"
|
|
7
|
+
:placeholder="$attrs.placeholder"
|
|
7
8
|
:type="type"
|
|
8
9
|
@focusin="active=true"
|
|
9
10
|
@focusout="active=false"
|
|
10
|
-
@input="
|
|
11
|
+
@input="emitValue"
|
|
11
12
|
autocomplete="no"
|
|
12
13
|
ref="input"
|
|
13
14
|
v-model="lazyValue"
|
|
14
15
|
/>
|
|
15
16
|
</r-input>
|
|
16
17
|
</template>
|
|
17
|
-
<script>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
data () {
|
|
30
|
-
return {
|
|
31
|
-
lazyValue: this.modelValue,
|
|
32
|
-
active: false
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
watch: {
|
|
36
|
-
modelValue () {
|
|
37
|
-
this.lazyValue = this.modelValue
|
|
38
|
-
}
|
|
18
|
+
<script setup>
|
|
19
|
+
import {ref, watch} from 'vue'
|
|
20
|
+
|
|
21
|
+
const props = defineProps({
|
|
22
|
+
/**
|
|
23
|
+
* Input type (text, number, email, etc.)
|
|
24
|
+
* @type {String}
|
|
25
|
+
* @default 'text'
|
|
26
|
+
*/
|
|
27
|
+
type: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: 'text'
|
|
39
30
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
31
|
+
/**
|
|
32
|
+
* The model value of the input
|
|
33
|
+
* @type {String|Number}
|
|
34
|
+
*/
|
|
35
|
+
modelValue: [String, Number]
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
const emit = defineEmits([
|
|
39
|
+
/**
|
|
40
|
+
* Emitted when the input value changes
|
|
41
|
+
* @param {String|Number} value - The updated input value
|
|
42
|
+
*/
|
|
43
|
+
'update:modelValue'
|
|
44
|
+
])
|
|
45
|
+
|
|
46
|
+
// Reactive data
|
|
47
|
+
const lazyValue = ref(props.modelValue)
|
|
48
|
+
const active = ref(false)
|
|
49
|
+
const input = ref(null)
|
|
50
|
+
|
|
51
|
+
// Watchers
|
|
52
|
+
watch(() => props.modelValue, (newValue) => {
|
|
53
|
+
lazyValue.value = newValue
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
// Methods
|
|
57
|
+
/**
|
|
58
|
+
* Focuses the input element
|
|
59
|
+
*/
|
|
60
|
+
const handleClick = () => {
|
|
61
|
+
if (input.value) {
|
|
62
|
+
input.value.focus()
|
|
47
63
|
}
|
|
48
64
|
}
|
|
49
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Emits the updated value to the parent component
|
|
68
|
+
*/
|
|
69
|
+
const emitValue = () => {
|
|
70
|
+
emit('update:modelValue', lazyValue.value)
|
|
71
|
+
}
|
|
50
72
|
</script>
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
</r-input>
|
|
2
|
+
<r-input
|
|
3
|
+
:active="active"
|
|
4
|
+
:class="`${$r.prefix}timepicker`"
|
|
5
|
+
:model-value="lazyValue"
|
|
6
|
+
@click.prevent="show_modal = true"
|
|
7
|
+
>
|
|
8
|
+
<input
|
|
9
|
+
ref="inputRef"
|
|
10
|
+
v-model="lazyValue"
|
|
11
|
+
:placeholder="$attrs.placeholder"
|
|
12
|
+
autocomplete="no"
|
|
13
|
+
readonly
|
|
14
|
+
type="text"
|
|
15
|
+
@focusin="active = true"
|
|
16
|
+
@focusout="active = false"
|
|
17
|
+
/>
|
|
19
18
|
<r-modal
|
|
20
19
|
class="modal-timepicker"
|
|
21
20
|
v-model="show_modal"
|
|
22
|
-
|
|
21
|
+
no-close-btn
|
|
23
22
|
:no-overlay="noOverlay"
|
|
24
23
|
>
|
|
25
24
|
<div class="pt-3 pb-1">
|
|
@@ -34,7 +33,7 @@
|
|
|
34
33
|
<r-btn
|
|
35
34
|
class="color-success-text"
|
|
36
35
|
outlined
|
|
37
|
-
@click.prevent="show_modal = false,
|
|
36
|
+
@click.prevent="show_modal = false,emitValue()"
|
|
38
37
|
>
|
|
39
38
|
{{ $t('accept', 'renusify') }}
|
|
40
39
|
</r-btn
|
|
@@ -42,7 +41,7 @@
|
|
|
42
41
|
<r-btn
|
|
43
42
|
class="color-warning-text"
|
|
44
43
|
outlined
|
|
45
|
-
@click.prevent="(show_modal = false), (lazyValue = null),
|
|
44
|
+
@click.prevent="(show_modal = false), (lazyValue = null),emitValue()"
|
|
46
45
|
>
|
|
47
46
|
{{ $t('cancel', 'renusify') }}
|
|
48
47
|
</r-btn
|
|
@@ -50,52 +49,80 @@
|
|
|
50
49
|
</div>
|
|
51
50
|
</div>
|
|
52
51
|
</r-modal>
|
|
53
|
-
</
|
|
52
|
+
</r-input>
|
|
53
|
+
|
|
54
54
|
</template>
|
|
55
55
|
|
|
56
|
-
<script>
|
|
57
|
-
import {
|
|
56
|
+
<script setup>
|
|
57
|
+
import {ref, watch} from 'vue'
|
|
58
|
+
import Timepicker from "./timepicker.vue"
|
|
58
59
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
withSec: Boolean,
|
|
69
|
-
is24Hour: {type: Boolean, default: true},
|
|
70
|
-
noOverlay: Boolean,
|
|
71
|
-
modelValue: String
|
|
72
|
-
},
|
|
73
|
-
emits: ['update:modelValue'],
|
|
74
|
-
data() {
|
|
75
|
-
return {
|
|
76
|
-
active: false,
|
|
77
|
-
show_modal: false,
|
|
78
|
-
lazyValue: this.modelValue
|
|
79
|
-
};
|
|
60
|
+
const props = defineProps({
|
|
61
|
+
/**
|
|
62
|
+
* Function to disable specific times
|
|
63
|
+
* @type {Function}
|
|
64
|
+
* @default () => false
|
|
65
|
+
*/
|
|
66
|
+
disableTime: {
|
|
67
|
+
type: Function,
|
|
68
|
+
default: () => false
|
|
80
69
|
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
70
|
+
/**
|
|
71
|
+
* Show seconds picker in addition to hours and minutes
|
|
72
|
+
* @type {Boolean}
|
|
73
|
+
*/
|
|
74
|
+
withSec: Boolean,
|
|
75
|
+
/**
|
|
76
|
+
* Use 24-hour format instead of 12-hour AM/PM format
|
|
77
|
+
* @type {Boolean}
|
|
78
|
+
* @default true
|
|
79
|
+
*/
|
|
80
|
+
is24Hour: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: true
|
|
85
83
|
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
84
|
+
/**
|
|
85
|
+
* Disable the overlay background when picker is open
|
|
86
|
+
* @type {Boolean}
|
|
87
|
+
*/
|
|
88
|
+
noOverlay: Boolean,
|
|
89
|
+
/**
|
|
90
|
+
* The model value in time string format (HH:MM or HH:MM:SS)
|
|
91
|
+
* @type {String}
|
|
92
|
+
*/
|
|
93
|
+
modelValue: String
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
const emit = defineEmits([
|
|
97
|
+
/**
|
|
98
|
+
* Emitted when the time value changes
|
|
99
|
+
* @param {String} value - The updated time value
|
|
100
|
+
*/
|
|
101
|
+
'update:modelValue'
|
|
102
|
+
])
|
|
103
|
+
|
|
104
|
+
// Reactive data
|
|
105
|
+
const active = ref(false)
|
|
106
|
+
const show_modal = ref(false)
|
|
107
|
+
const lazyValue = ref(props.modelValue || '')
|
|
108
|
+
|
|
109
|
+
// Methods
|
|
110
|
+
/**
|
|
111
|
+
* Emits the updated time value to the parent component
|
|
112
|
+
*/
|
|
113
|
+
const emitValue = () => {
|
|
114
|
+
emit('update:modelValue', lazyValue.value)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Watchers
|
|
118
|
+
watch(() => props.modelValue, (newValue) => {
|
|
119
|
+
lazyValue.value = newValue || ''
|
|
120
|
+
})
|
|
92
121
|
</script>
|
|
93
122
|
|
|
94
123
|
<style lang="scss">
|
|
95
124
|
.modal-timepicker {
|
|
96
125
|
.modal-mini {
|
|
97
|
-
background-color: var(--color-sheet-container-high);
|
|
98
|
-
color: var(--color-on-sheet);
|
|
99
126
|
max-width: 285px !important;
|
|
100
127
|
}
|
|
101
128
|
}
|
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="`${$r.prefix}timepicker-range`">
|
|
3
2
|
<r-input
|
|
4
|
-
|
|
3
|
+
:class="`${$r.prefix}timepicker-range`"
|
|
5
4
|
:active="active"
|
|
6
5
|
:model-value="lazyValue[1]"
|
|
7
|
-
@click.prevent="
|
|
6
|
+
@click.prevent="openPicker('from')"
|
|
8
7
|
>
|
|
9
8
|
<input
|
|
10
9
|
type="text"
|
|
10
|
+
:placeholder="$attrs.placeholder"
|
|
11
11
|
@focusin="active = true"
|
|
12
12
|
@focusout="active = false"
|
|
13
13
|
autocomplete="no"
|
|
14
14
|
ref="input"
|
|
15
15
|
:value="strVal"
|
|
16
16
|
/>
|
|
17
|
-
|
|
18
|
-
<r-modal
|
|
17
|
+
<r-modal
|
|
19
18
|
class="modal-timepicker"
|
|
20
19
|
v-model="show_modal"
|
|
21
|
-
|
|
20
|
+
no-close-btn
|
|
22
21
|
:no-overlay="noOverlay"
|
|
23
22
|
>
|
|
24
23
|
<div class="pt-3">
|
|
25
|
-
<div class="
|
|
24
|
+
<div class="pa-2 title-1 text-center">
|
|
26
25
|
<span>{{ $t('from', 'renusify') }}: </span>
|
|
27
26
|
<span v-if="lazyValue[0]">{{ lazyValue[0] }} - </span>
|
|
28
27
|
<span>{{ $t('to', 'renusify') }}: </span>
|
|
@@ -43,119 +42,141 @@
|
|
|
43
42
|
:disableTime="disableTime"
|
|
44
43
|
v-model="lazyValue[1]"
|
|
45
44
|
></timepicker>
|
|
46
|
-
|
|
45
|
+
|
|
46
|
+
<div class="my-3 d-flex h-space-between px-3">
|
|
47
47
|
<r-btn
|
|
48
48
|
class="color-success-text"
|
|
49
49
|
outlined
|
|
50
50
|
@click.prevent="accept"
|
|
51
51
|
>
|
|
52
|
-
{{ $t('accept', 'renusify') }}
|
|
52
|
+
{{ $t(state === 'to' ? 'accept' : 'next', 'renusify') }}
|
|
53
53
|
</r-btn>
|
|
54
54
|
<r-btn
|
|
55
55
|
class="color-warning-text"
|
|
56
56
|
outlined
|
|
57
|
-
@click.prevent="(show_modal = false),
|
|
57
|
+
@click.prevent="(show_modal = false),clear()"
|
|
58
58
|
>
|
|
59
59
|
{{ $t('cancel', 'renusify') }}
|
|
60
60
|
</r-btn>
|
|
61
61
|
</div>
|
|
62
62
|
</div>
|
|
63
63
|
</r-modal>
|
|
64
|
-
|
|
64
|
+
</r-input>
|
|
65
65
|
</template>
|
|
66
66
|
|
|
67
|
-
<script>
|
|
68
|
-
import {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
67
|
+
<script setup>
|
|
68
|
+
import {ref, watch, computed} from 'vue'
|
|
69
|
+
import Timepicker from "./timepicker.vue";
|
|
70
|
+
|
|
71
|
+
const props = defineProps({
|
|
72
|
+
withSec: Boolean,
|
|
73
|
+
noOverlay: Boolean,
|
|
74
|
+
modelValue: {
|
|
75
|
+
type: Array,
|
|
76
|
+
default: () => []
|
|
77
|
+
}
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
const emit = defineEmits(['update:modelValue'])
|
|
81
|
+
|
|
82
|
+
const state = ref('from') // 'from' or 'to'
|
|
83
|
+
const active = ref(false)
|
|
84
|
+
const show_modal = ref(false)
|
|
85
|
+
const lazyValue = ref(props.modelValue || [])
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
const strVal = computed(() => {
|
|
89
|
+
if (lazyValue.value.length >= 2) {
|
|
90
|
+
return `${lazyValue.value[0] || ''} - ${lazyValue.value[1] || ''}`
|
|
91
|
+
}
|
|
92
|
+
return ''
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
const fromH = computed(() => {
|
|
96
|
+
if (!lazyValue.value[0]) return 0
|
|
97
|
+
return parseInt(lazyValue.value[0].split(':')[0]) || 0
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
const fromM = computed(() => {
|
|
101
|
+
if (!lazyValue.value[0]) return 0
|
|
102
|
+
return parseInt(lazyValue.value[0].split(':')[1]) || 0
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
const fromS = computed(() => {
|
|
106
|
+
if (!lazyValue.value[0]) return 0
|
|
107
|
+
return parseInt(lazyValue.value[0].split(':')[2]) || 0
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
const str2int = (s) => {
|
|
111
|
+
if (!s) return 0
|
|
112
|
+
return parseInt(s.replace(/:/g, '')) || 0
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const disableTime = (n, t, h, m) => {
|
|
116
|
+
if (state.value !== 'to') return false
|
|
117
|
+
|
|
118
|
+
if (t === 'hours24') {
|
|
119
|
+
return n < fromH.value
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (t === 'mins') {
|
|
123
|
+
if (h.toString() === fromH.value.toString()) {
|
|
124
|
+
if (props.withSec) {
|
|
125
|
+
return n < fromM.value
|
|
126
|
+
} else {
|
|
127
|
+
return n <= fromM.value
|
|
114
128
|
}
|
|
115
|
-
return this.lazyValue[0].split(':')[2]
|
|
116
129
|
}
|
|
117
|
-
}
|
|
118
|
-
methods: {
|
|
119
|
-
disableTime(n, t, h, m) {
|
|
120
|
-
if (t === 'hours24' && n < this.fromH && n > 0) {
|
|
121
|
-
return true
|
|
122
|
-
}
|
|
130
|
+
}
|
|
123
131
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
132
|
+
if (props.withSec && t === 'seconds') {
|
|
133
|
+
if (h.toString() === fromH.value.toString() && m.toString() === fromM.value.toString()) {
|
|
134
|
+
return n <= fromS.value
|
|
135
|
+
}
|
|
136
|
+
}
|
|
127
137
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
if (this.state === 'to') {
|
|
142
|
-
if (this.lazyValue.length === 2 && this.str2int(this.lazyValue[0]) < this.str2int(this.lazyValue[1])) {
|
|
143
|
-
this.state = 'from'
|
|
144
|
-
this.show_modal = false
|
|
145
|
-
this.emit()
|
|
146
|
-
} else {
|
|
147
|
-
console.error(`from:${this.str2int(this.lazyValue[0])} > to:${this.str2int(this.lazyValue[1])}`)
|
|
148
|
-
}
|
|
138
|
+
return false
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const accept = () => {
|
|
142
|
+
if (state.value === 'to') {
|
|
143
|
+
if (lazyValue.value.length >= 2) {
|
|
144
|
+
const fromTimeInt = str2int(lazyValue.value[0])
|
|
145
|
+
const toTimeInt = str2int(lazyValue.value[1])
|
|
146
|
+
|
|
147
|
+
if (fromTimeInt < toTimeInt) {
|
|
148
|
+
state.value = 'from'
|
|
149
|
+
show_modal.value = false
|
|
150
|
+
emitValue()
|
|
149
151
|
} else {
|
|
150
|
-
|
|
152
|
+
console.error(`From time (${fromTimeInt}) must be before To time (${toTimeInt})`)
|
|
151
153
|
}
|
|
152
|
-
|
|
153
|
-
},
|
|
154
|
-
emit() {
|
|
155
|
-
this.$emit("update:modelValue", this.lazyValue);
|
|
156
154
|
}
|
|
155
|
+
} else {
|
|
156
|
+
state.value = 'to'
|
|
157
157
|
}
|
|
158
|
-
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const emitValue = () => {
|
|
161
|
+
emit('update:modelValue', lazyValue.value)
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const openPicker = (type = 'from') => {
|
|
165
|
+
state.value = type
|
|
166
|
+
show_modal.value = true
|
|
167
|
+
active.value = true
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const clear = () => {
|
|
171
|
+
lazyValue.value = []
|
|
172
|
+
state.value = 'from'
|
|
173
|
+
emitValue()
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
watch(() => props.modelValue, (newValue) => {
|
|
177
|
+
lazyValue.value = newValue || []
|
|
178
|
+
}, {deep: true})
|
|
179
|
+
|
|
159
180
|
</script>
|
|
160
181
|
|
|
161
182
|
<style lang="scss">
|