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
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
v-if="!noCloseBtn"
|
|
23
23
|
class="color-error-text"
|
|
24
24
|
fab
|
|
25
|
-
size="
|
|
25
|
+
size="sm"
|
|
26
26
|
text
|
|
27
27
|
@click.prevent="close(true)"
|
|
28
28
|
>
|
|
@@ -31,6 +31,10 @@
|
|
|
31
31
|
</div>
|
|
32
32
|
|
|
33
33
|
<div class="modal-content">
|
|
34
|
+
<!-- Default slot for modal content
|
|
35
|
+
@example
|
|
36
|
+
<div class="display-3 pa-12">Title</div>
|
|
37
|
+
-->
|
|
34
38
|
<slot></slot>
|
|
35
39
|
</div>
|
|
36
40
|
</div>
|
|
@@ -39,176 +43,398 @@
|
|
|
39
43
|
</teleport>
|
|
40
44
|
</template>
|
|
41
45
|
|
|
42
|
-
<script>
|
|
43
|
-
import '
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
default: 'center',
|
|
56
|
-
validator: (value) => ['center', 'bottom', 'start', 'end', 'top'].includes(value)
|
|
57
|
-
},
|
|
58
|
-
noOverlay: Boolean,
|
|
59
|
-
fullWidth: Boolean,
|
|
60
|
-
fullHeight: Boolean,
|
|
61
|
-
maxWidth: {
|
|
62
|
-
type: String,
|
|
63
|
-
default: null
|
|
64
|
-
},
|
|
65
|
-
maxHeight: {
|
|
66
|
-
type: String,
|
|
67
|
-
default: null
|
|
68
|
-
},
|
|
69
|
-
minWidth: {
|
|
70
|
-
type: Boolean,
|
|
71
|
-
default: true
|
|
72
|
-
},
|
|
73
|
-
noClosable: Boolean,
|
|
74
|
-
noCloseBtn: Boolean,
|
|
75
|
-
routeHistory: String,
|
|
76
|
-
color: String,
|
|
77
|
-
animation: String
|
|
46
|
+
<script setup>
|
|
47
|
+
import {computed, inject, onMounted, onUnmounted, ref, watch} from 'vue'
|
|
48
|
+
import {useRoute, useRouter} from 'vue-router'
|
|
49
|
+
|
|
50
|
+
const props = defineProps({
|
|
51
|
+
/**
|
|
52
|
+
* Controls the visibility of the modal
|
|
53
|
+
* @type {Boolean}
|
|
54
|
+
* @required
|
|
55
|
+
*/
|
|
56
|
+
modelValue: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
required: true
|
|
78
59
|
},
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Position of the modal on the screen
|
|
62
|
+
* @type {String}
|
|
63
|
+
* @default 'center'
|
|
64
|
+
* @values 'center', 'bottom', 'start', 'end', 'top'
|
|
65
|
+
*/
|
|
66
|
+
position: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: 'center',
|
|
69
|
+
validator: (value) => ['center', 'bottom', 'start', 'end', 'top'].includes(value)
|
|
85
70
|
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Hides the overlay/backdrop behind the modal
|
|
73
|
+
* @type {Boolean}
|
|
74
|
+
*/
|
|
75
|
+
noOverlay: Boolean,
|
|
76
|
+
/**
|
|
77
|
+
* Makes the modal take full width of the screen
|
|
78
|
+
* @type {Boolean}
|
|
79
|
+
*/
|
|
80
|
+
fullWidth: Boolean,
|
|
81
|
+
/**
|
|
82
|
+
* Makes the modal take full height of the screen
|
|
83
|
+
* @type {Boolean}
|
|
84
|
+
*/
|
|
85
|
+
fullHeight: Boolean,
|
|
86
|
+
/**
|
|
87
|
+
* Maximum width of the modal container
|
|
88
|
+
* @type {String}
|
|
89
|
+
* @default null
|
|
90
|
+
*/
|
|
91
|
+
maxWidth: {
|
|
92
|
+
type: String,
|
|
93
|
+
default: null
|
|
91
94
|
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
+
/**
|
|
96
|
+
* Maximum height of the modal container
|
|
97
|
+
* @type {String}
|
|
98
|
+
* @default null
|
|
99
|
+
*/
|
|
100
|
+
maxHeight: {
|
|
101
|
+
type: String,
|
|
102
|
+
default: null
|
|
95
103
|
},
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
return 'slide-down';
|
|
105
|
-
case 'start':
|
|
106
|
-
return 'slide-end';
|
|
107
|
-
case 'end':
|
|
108
|
-
return 'slide-start';
|
|
109
|
-
default:
|
|
110
|
-
return 'scale';
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
modalClasses() {
|
|
114
|
-
return [
|
|
115
|
-
`${this.$r.prefix}modal`,
|
|
116
|
-
`modal-${this.position}`,
|
|
117
|
-
{
|
|
118
|
-
'animate-modal-vibrate': this.runAnimation
|
|
119
|
-
}
|
|
120
|
-
];
|
|
121
|
-
},
|
|
122
|
-
containerClasses() {
|
|
123
|
-
return [
|
|
124
|
-
this.color,
|
|
125
|
-
{
|
|
126
|
-
'modal-full-width': this.fullWidth,
|
|
127
|
-
'modal-full-height': this.fullHeight,
|
|
128
|
-
'modal-mini': this.minWidth,
|
|
129
|
-
[`modal-${this.position}`]: this.position !== 'center'
|
|
130
|
-
}
|
|
131
|
-
];
|
|
132
|
-
},
|
|
133
|
-
containerStyles() {
|
|
134
|
-
return {
|
|
135
|
-
'max-width': this.maxWidth,
|
|
136
|
-
'max-height': this.maxHeight
|
|
137
|
-
};
|
|
138
|
-
}
|
|
104
|
+
/**
|
|
105
|
+
* Applies minimum width styling to the modal
|
|
106
|
+
* @type {Boolean}
|
|
107
|
+
* @default true
|
|
108
|
+
*/
|
|
109
|
+
minWidth: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: true
|
|
139
112
|
},
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
113
|
+
/**
|
|
114
|
+
* Prevents closing the modal by clicking overlay or pressing escape
|
|
115
|
+
* @type {Boolean}
|
|
116
|
+
*/
|
|
117
|
+
noClosable: Boolean,
|
|
118
|
+
/**
|
|
119
|
+
* Hides the close button in the modal header
|
|
120
|
+
* @type {Boolean}
|
|
121
|
+
*/
|
|
122
|
+
noCloseBtn: Boolean,
|
|
123
|
+
/**
|
|
124
|
+
* Route hash value for URL-based modal state management
|
|
125
|
+
* @type {String}
|
|
126
|
+
*/
|
|
127
|
+
routeHistory: String,
|
|
128
|
+
/**
|
|
129
|
+
* Custom CSS animation name for modal transitions
|
|
130
|
+
* @type {String}
|
|
131
|
+
*/
|
|
132
|
+
animation: String
|
|
133
|
+
})
|
|
143
134
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
135
|
+
const emit = defineEmits([
|
|
136
|
+
/**
|
|
137
|
+
* Emitted when modal visibility changes
|
|
138
|
+
* @param {Boolean} isOpen - Whether the modal is open
|
|
139
|
+
*/
|
|
140
|
+
'update:modelValue'
|
|
141
|
+
])
|
|
142
|
+
|
|
143
|
+
const {$r} = inject('renusify')
|
|
144
|
+
|
|
145
|
+
const route = useRoute()
|
|
146
|
+
const router = useRouter()
|
|
147
|
+
|
|
148
|
+
const mounted = ref(false)
|
|
149
|
+
const runAnimation = ref(false)
|
|
150
|
+
|
|
151
|
+
const computedAnimation = computed(() => {
|
|
152
|
+
if (props.animation) return props.animation
|
|
153
|
+
|
|
154
|
+
switch (props.position) {
|
|
155
|
+
case 'bottom':
|
|
156
|
+
return 'slide-up'
|
|
157
|
+
case 'top':
|
|
158
|
+
return 'slide-down'
|
|
159
|
+
case 'start':
|
|
160
|
+
return 'slide-end'
|
|
161
|
+
case 'end':
|
|
162
|
+
return 'slide-start'
|
|
163
|
+
default:
|
|
164
|
+
return 'scale'
|
|
165
|
+
}
|
|
166
|
+
})
|
|
167
|
+
|
|
168
|
+
const modalClasses = computed(() => {
|
|
169
|
+
return [
|
|
170
|
+
`${$r.prefix}modal`,
|
|
171
|
+
`modal-${props.position}`,
|
|
172
|
+
{
|
|
173
|
+
'animate-modal-vibrate': runAnimation.value
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
})
|
|
177
|
+
|
|
178
|
+
const containerClasses = computed(() => {
|
|
179
|
+
return [
|
|
180
|
+
{
|
|
181
|
+
'modal-full-width': props.fullWidth,
|
|
182
|
+
'modal-full-height': props.fullHeight,
|
|
183
|
+
'modal-mini': props.minWidth,
|
|
184
|
+
[`modal-${props.position}`]: props.position !== 'center'
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
const containerStyles = computed(() => {
|
|
190
|
+
const styles = {}
|
|
191
|
+
if (props.maxWidth) styles['max-width'] = props.maxWidth
|
|
192
|
+
if (props.maxHeight) styles['max-height'] = props.maxHeight
|
|
193
|
+
return styles
|
|
194
|
+
})
|
|
195
|
+
|
|
196
|
+
const initFromRoute = () => {
|
|
197
|
+
if (!props.routeHistory) return
|
|
198
|
+
|
|
199
|
+
const hashValues = route.hash.replace('#', '').split('&')
|
|
200
|
+
if (hashValues.includes(props.routeHistory)) {
|
|
201
|
+
emit('update:modelValue', true)
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const handleRouteChange = (newRoute) => {
|
|
206
|
+
if (!props.routeHistory) return
|
|
207
|
+
|
|
208
|
+
const hashValues = newRoute.hash.replace('#', '').split('&')
|
|
209
|
+
emit('update:modelValue', hashValues.includes(props.routeHistory))
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
const handleModelValueChange = (isOpen) => {
|
|
213
|
+
if (isOpen) {
|
|
214
|
+
document.documentElement.style.overflow = 'hidden'
|
|
215
|
+
handleOpenState()
|
|
216
|
+
} else {
|
|
217
|
+
document.documentElement.style.overflow = null
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const handleOpenState = () => {
|
|
222
|
+
if (!props.routeHistory) return
|
|
223
|
+
|
|
224
|
+
const hashValues = route.hash.replace('#', '').split('&')
|
|
225
|
+
if (!hashValues.includes(props.routeHistory)) {
|
|
226
|
+
const newHash = route.hash
|
|
227
|
+
? `${route.hash}&${props.routeHistory}`
|
|
228
|
+
: `#${props.routeHistory}`
|
|
229
|
+
|
|
230
|
+
router.push({
|
|
231
|
+
path: route.fullPath,
|
|
232
|
+
hash: newHash
|
|
233
|
+
})
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Closes the modal
|
|
239
|
+
* @param {Boolean} force - Force close even when noClosable is true
|
|
240
|
+
*/
|
|
241
|
+
const close = (force = false) => {
|
|
242
|
+
if (props.noClosable && !force) {
|
|
243
|
+
runAnimation.value = true
|
|
244
|
+
setTimeout(() => runAnimation.value = false, 300)
|
|
245
|
+
return
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
if (props.routeHistory) {
|
|
249
|
+
handleRouteClose()
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
emit('update:modelValue', false)
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
const handleRouteClose = () => {
|
|
256
|
+
if (history.state.back) {
|
|
257
|
+
router.back()
|
|
258
|
+
return
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
let hashValues = route.hash.replace('#', '').split('&')
|
|
262
|
+
hashValues = hashValues.filter(val => val !== props.routeHistory)
|
|
263
|
+
|
|
264
|
+
const newHash = hashValues.length
|
|
265
|
+
? `#${hashValues.join('&')}`
|
|
266
|
+
: ''
|
|
267
|
+
|
|
268
|
+
router.replace({
|
|
269
|
+
path: route.fullPath,
|
|
270
|
+
hash: newHash
|
|
271
|
+
})
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
onMounted(() => {
|
|
275
|
+
initFromRoute()
|
|
276
|
+
setTimeout(() => {
|
|
277
|
+
mounted.value = true
|
|
278
|
+
}, 10)
|
|
279
|
+
})
|
|
280
|
+
|
|
281
|
+
onUnmounted(() => {
|
|
282
|
+
document.documentElement.style.overflow = null
|
|
283
|
+
})
|
|
284
|
+
|
|
285
|
+
watch(() => route, handleRouteChange, {immediate: true})
|
|
286
|
+
|
|
287
|
+
watch(() => props.modelValue, handleModelValueChange, {immediate: true})
|
|
288
|
+
|
|
289
|
+
defineOptions({
|
|
290
|
+
inheritAttrs: false
|
|
291
|
+
})
|
|
292
|
+
|
|
293
|
+
</script>
|
|
294
|
+
|
|
295
|
+
<style lang="scss">
|
|
296
|
+
@use "sass:map";
|
|
297
|
+
@use "../../style" as *;
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
.#{$prefix}modal-overlay {
|
|
301
|
+
position: fixed;
|
|
302
|
+
inset: 0;
|
|
303
|
+
z-index: map.get($z-index, 'important');
|
|
304
|
+
background-color: var(--color-overlay);
|
|
305
|
+
backdrop-filter: blur(3px) grayscale(30%);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.#{$prefix}modal {
|
|
309
|
+
position: fixed;
|
|
310
|
+
inset: 0;
|
|
311
|
+
display: flex;
|
|
312
|
+
z-index: map.get($z-index, 'important');
|
|
313
|
+
outline: none;
|
|
314
|
+
|
|
315
|
+
// Position variants
|
|
316
|
+
&.modal-center {
|
|
317
|
+
align-items: center;
|
|
318
|
+
justify-content: center;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
&.modal-bottom {
|
|
322
|
+
align-items: flex-end;
|
|
323
|
+
justify-content: center;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
&.modal-top {
|
|
327
|
+
align-items: flex-start;
|
|
328
|
+
justify-content: center;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
&.modal-start {
|
|
332
|
+
align-items: center;
|
|
333
|
+
justify-content: flex-start;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
&.modal-end {
|
|
337
|
+
align-items: center;
|
|
338
|
+
justify-content: flex-end;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.modal-btn {
|
|
342
|
+
width: 100%;
|
|
343
|
+
position: relative;
|
|
344
|
+
|
|
345
|
+
.#{$prefix}btn {
|
|
346
|
+
position: absolute;
|
|
347
|
+
bottom: -40px;
|
|
348
|
+
z-index: map.get($z-index, 'important') + 1;
|
|
349
|
+
|
|
350
|
+
@include rtl() {
|
|
351
|
+
left: 5px;
|
|
176
352
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
this.runAnimation = true;
|
|
181
|
-
setTimeout(() => this.runAnimation = false, 300);
|
|
182
|
-
return;
|
|
353
|
+
|
|
354
|
+
@include ltr() {
|
|
355
|
+
right: 5px;
|
|
183
356
|
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.modal-container {
|
|
361
|
+
width: 95%;
|
|
362
|
+
max-width: 100vw;
|
|
363
|
+
max-height: 90vh;
|
|
364
|
+
z-index: map.get($z-index, 'important');
|
|
365
|
+
background-color: var(--color-sheet-container-low);
|
|
366
|
+
color: var(--color-on-sheet);
|
|
367
|
+
border: 1px solid var(--color-sheet-container);
|
|
368
|
+
border-radius: map.get($borders, 'md');
|
|
369
|
+
overflow: hidden;
|
|
370
|
+
display: flex;
|
|
371
|
+
flex-direction: column;
|
|
184
372
|
|
|
185
|
-
|
|
186
|
-
|
|
373
|
+
&.modal-bottom,
|
|
374
|
+
&.modal-top {
|
|
375
|
+
width: 100%;
|
|
376
|
+
border-radius: map.get($borders, 'md') map.get($borders, 'md') 0 0;
|
|
377
|
+
|
|
378
|
+
&:not(.modal-full-width) {
|
|
379
|
+
max-width: map.get($container-max-widths, 'lg');
|
|
187
380
|
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
&.modal-start,
|
|
384
|
+
&.modal-end {
|
|
385
|
+
height: 100%;
|
|
386
|
+
max-height: 100vh;
|
|
387
|
+
border-radius: 0 map.get($borders, 'md') map.get($borders, 'md') 0;
|
|
188
388
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
handleRouteClose() {
|
|
192
|
-
if (history.state.back) {
|
|
193
|
-
this.$router.back();
|
|
194
|
-
return;
|
|
389
|
+
&:not(.modal-full-height) {
|
|
390
|
+
max-height: 90vh;
|
|
195
391
|
}
|
|
392
|
+
}
|
|
196
393
|
|
|
197
|
-
|
|
198
|
-
|
|
394
|
+
&.modal-start {
|
|
395
|
+
border-radius: map.get($borders, 'md') 0 0 map.get($borders, 'md');
|
|
396
|
+
}
|
|
397
|
+
}
|
|
199
398
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
399
|
+
.modal-content {
|
|
400
|
+
flex: 1;
|
|
401
|
+
overflow-y: auto;
|
|
402
|
+
overflow-x: hidden;
|
|
403
|
+
}
|
|
203
404
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
405
|
+
@include media-breakpoint-up('md') {
|
|
406
|
+
.modal-container:not(.modal-full-width):not(.modal-mini) {
|
|
407
|
+
width: 75%;
|
|
408
|
+
max-width: 75vw;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.modal-mini {
|
|
413
|
+
max-width: 500px;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.modal-full-width {
|
|
417
|
+
width: 100%;
|
|
418
|
+
max-width: 100vw;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
.modal-full-height {
|
|
422
|
+
height: 100%;
|
|
423
|
+
max-height: 100vh;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
// Animations
|
|
428
|
+
.animate-modal-vibrate {
|
|
429
|
+
animation: animate-modal-vibrate 0.15s map.get($transition, 'fast-in-fast-out');
|
|
430
|
+
|
|
431
|
+
@keyframes animate-modal-vibrate {
|
|
432
|
+
0%, 100% {
|
|
433
|
+
transform: scale(1);
|
|
434
|
+
}
|
|
435
|
+
50% {
|
|
436
|
+
transform: scale(1.03);
|
|
208
437
|
}
|
|
209
|
-
},
|
|
210
|
-
beforeUnmount() {
|
|
211
|
-
document.documentElement.style.overflow = null;
|
|
212
438
|
}
|
|
213
439
|
}
|
|
214
|
-
</
|
|
440
|
+
</style>
|