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
|
@@ -4,67 +4,127 @@
|
|
|
4
4
|
:height="height"
|
|
5
5
|
:zoom="zoom" search-box @leaflet="handleLEvent"
|
|
6
6
|
@map="handleMapEvent"
|
|
7
|
-
@update:model-value="
|
|
7
|
+
@update:model-value="emitValue"
|
|
8
8
|
></r-map>
|
|
9
9
|
</div>
|
|
10
10
|
</template>
|
|
11
|
-
<script>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
11
|
+
<script setup>
|
|
12
|
+
import {ref, inject, computed} from 'vue'
|
|
13
|
+
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
/**
|
|
16
|
+
* Selected location coordinates
|
|
17
|
+
* @type {Array<Number>}
|
|
18
|
+
* @model
|
|
19
|
+
* @description Two-way binding for the selected [latitude, longitude] coordinates.
|
|
20
|
+
* Updates when user clicks or drags the marker on the map.
|
|
21
|
+
* @example [35.6997, 51.3380] // Tehran coordinates
|
|
22
|
+
* @example [40.7128, -74.0060] // New York coordinates
|
|
23
|
+
*/
|
|
24
|
+
modelValue: Array,
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Map container height
|
|
28
|
+
* @type {String}
|
|
29
|
+
* @default '500px'
|
|
30
|
+
* @description CSS height for the map container.
|
|
31
|
+
* Accepts any valid CSS height value.
|
|
32
|
+
* @example '300px'
|
|
33
|
+
* @example '70vh'
|
|
34
|
+
* @example '100%'
|
|
35
|
+
*/
|
|
36
|
+
height: {type: String, default: "500px"},
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Initial zoom level
|
|
40
|
+
* @type {Number}
|
|
41
|
+
* @default 13
|
|
42
|
+
* @description Initial zoom level of the map (0-20 typical range).
|
|
43
|
+
* Higher values = more zoomed in.
|
|
44
|
+
* @example 10 // City overview
|
|
45
|
+
* @example 15 // Neighborhood view
|
|
46
|
+
* @example 18 // Street view
|
|
47
|
+
*/
|
|
48
|
+
zoom: {type: Number, default: 13},
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Custom marker icon image URL
|
|
52
|
+
* @type {String}
|
|
53
|
+
* @description URL to a custom marker icon image.
|
|
54
|
+
* Overrides the default marker icon.
|
|
55
|
+
* Recommended size: 30x30 pixels with anchor at bottom center.
|
|
56
|
+
* @example '/assets/custom-marker.png'
|
|
57
|
+
* @example 'https://example.com/pin-icon.png'
|
|
58
|
+
*/
|
|
59
|
+
mapImageMarker: String
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
const emit = defineEmits([
|
|
63
|
+
/**
|
|
64
|
+
* Updated [latitude, longitude] coordinates
|
|
65
|
+
*/
|
|
66
|
+
'update:modelValue'
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
const {$t, $r} = inject('renusify')
|
|
70
|
+
|
|
71
|
+
const map = ref(null)
|
|
72
|
+
const L = ref(null)
|
|
73
|
+
const marker = ref(null)
|
|
74
|
+
const center = ref(props.modelValue || [35.69973857757377, 51.33806092139637])
|
|
75
|
+
|
|
76
|
+
const iconMarker = computed(() => {
|
|
77
|
+
if (props.mapImageMarker) {
|
|
78
|
+
return props.mapImageMarker
|
|
79
|
+
}
|
|
80
|
+
return require('./images/marker-icon.png')
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
const handleLEvent = (e) => {
|
|
84
|
+
L.value = e
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const handleMapEvent = (e) => {
|
|
88
|
+
map.value = e
|
|
89
|
+
selection()
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const selection = () => {
|
|
93
|
+
emit("update:modelValue", center.value);
|
|
94
|
+
|
|
95
|
+
marker.value = new L.value.Marker(center.value, {
|
|
96
|
+
icon: new L.value.icon({
|
|
97
|
+
iconUrl: iconMarker.value,
|
|
98
|
+
iconSize: [30, 30],
|
|
99
|
+
iconAnchor: [15, 30],
|
|
100
|
+
popupAnchor: [0, -30]
|
|
101
|
+
}),
|
|
102
|
+
draggable: true
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
map.value.addLayer(marker.value);
|
|
106
|
+
|
|
107
|
+
marker.value.bindPopup($t("map_move_to_location", 'renusify')).openPopup();
|
|
108
|
+
|
|
109
|
+
marker.value.on('dragend', function (event) {
|
|
110
|
+
const marker = event.target;
|
|
111
|
+
const position = marker.getLatLng();
|
|
112
|
+
emitValue([position.lat, position.lng]);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
map.value.on('click', function (event) {
|
|
116
|
+
emitValue([event.latlng.lat, event.latlng.lng]);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const emitValue = (e) => {
|
|
121
|
+
center.value = e
|
|
122
|
+
emit("update:modelValue", center.value);
|
|
123
|
+
|
|
124
|
+
if (marker.value) {
|
|
125
|
+
marker.value.setLatLng(center.value);
|
|
126
|
+
map.value.closePopup();
|
|
68
127
|
}
|
|
69
128
|
}
|
|
70
129
|
</script>
|
|
130
|
+
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div ref="menuRef" v-click-outside="close" :class="$r.prefix+'menu'">
|
|
3
3
|
<div class="d-flex h-start flex-row v-center">
|
|
4
|
-
<
|
|
4
|
+
<slot name="label">
|
|
5
|
+
<span class="menu-label" v-if="label" @click.prevent="open">{{ label }}</span>
|
|
6
|
+
</slot>
|
|
5
7
|
<transition name="fade" mode="out-in">
|
|
6
8
|
<!-- Header Navigation Menu Icons -->
|
|
7
|
-
<r-btn icon text v-if="show" key="on" @click.prevent="close">
|
|
9
|
+
<r-btn icon text v-if="show" key="on" size="sm" @click.prevent="close">
|
|
8
10
|
<r-icon v-html="$r.icons.chevron_up"></r-icon>
|
|
9
11
|
</r-btn>
|
|
10
|
-
<r-btn icon text v-else key="off" @click.prevent="open">
|
|
12
|
+
<r-btn icon text v-else key="off" size="sm" @click.prevent="open">
|
|
11
13
|
<r-icon v-html="icon||$r.icons.chevron_down"></r-icon>
|
|
12
14
|
</r-btn>
|
|
13
15
|
|
|
@@ -23,7 +25,11 @@
|
|
|
23
25
|
<r-card>
|
|
24
26
|
<div class="dropdown-menu-item pa-2" v-for="(item,i) in list" :key="i"
|
|
25
27
|
:class="{'menu-selected':selected===item[value]}"
|
|
26
|
-
@click.prevent="
|
|
28
|
+
@click.prevent="emitItem(item)">
|
|
29
|
+
<!--
|
|
30
|
+
Default slot for custom menu item rendering
|
|
31
|
+
@binding {Object|String|Number} item - The current menu item
|
|
32
|
+
-->
|
|
27
33
|
<slot :item="item">
|
|
28
34
|
{{ item }}
|
|
29
35
|
</slot>
|
|
@@ -34,102 +40,208 @@
|
|
|
34
40
|
</div>
|
|
35
41
|
</div>
|
|
36
42
|
</template>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
43
|
+
|
|
44
|
+
<script setup>
|
|
45
|
+
import {ref, computed, inject, nextTick} from 'vue'
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @example // Menu usage
|
|
50
|
+
* <template>
|
|
51
|
+
* <r-menu
|
|
52
|
+
* v-model="modelValue"
|
|
53
|
+
* :label="modelValue?modelValue.name:label"
|
|
54
|
+
* :icon="icon"
|
|
55
|
+
* :value="value"
|
|
56
|
+
* :just-Value="justValue"
|
|
57
|
+
* :reverse="reverse"
|
|
58
|
+
* :overlay="overlay"
|
|
59
|
+
* :items="items"
|
|
60
|
+
* @update:model-Value="log(`update:modelValue`,$event)" ></r-menu>
|
|
61
|
+
* </template>
|
|
62
|
+
* <script>
|
|
63
|
+
* import { ref } from 'vue'
|
|
64
|
+
*
|
|
65
|
+
* const modelValue=ref(null)
|
|
66
|
+
* const icon=ref(null)
|
|
67
|
+
* const label=ref("label")
|
|
68
|
+
* const value=ref("value")
|
|
69
|
+
* const justValue=ref(false)
|
|
70
|
+
* const reverse=ref(false)
|
|
71
|
+
* const overlay=ref(false)
|
|
72
|
+
* const items=ref([
|
|
73
|
+
* { name: `home`,value:1 },
|
|
74
|
+
* { name: `blog`,value:2 },
|
|
75
|
+
* { name: `contact`,value:3 },
|
|
76
|
+
* { name: `about`,value:4 },
|
|
77
|
+
* ])
|
|
78
|
+
* const log=(name,e)=>{
|
|
79
|
+
* console.log(name,e)
|
|
80
|
+
* }
|
|
81
|
+
* <//script>
|
|
82
|
+
*
|
|
83
|
+
* */
|
|
84
|
+
const props = defineProps({
|
|
85
|
+
/**
|
|
86
|
+
* Currently selected value (v-model)
|
|
87
|
+
* @model
|
|
88
|
+
* @type {String|Number|Object}
|
|
89
|
+
*/
|
|
90
|
+
modelValue: {
|
|
91
|
+
type: [String, Number, Object]
|
|
58
92
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Menu label text
|
|
96
|
+
* @type {String}
|
|
97
|
+
*/
|
|
98
|
+
label: String,
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Custom icon for the open button
|
|
102
|
+
* @type {String}
|
|
103
|
+
* @default Chevron down icon from Renusify icons
|
|
104
|
+
*/
|
|
105
|
+
icon: {
|
|
106
|
+
type: String
|
|
68
107
|
},
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
})
|
|
80
|
-
}
|
|
81
|
-
return r
|
|
82
|
-
},
|
|
83
|
-
selected() {
|
|
84
|
-
if (!this.modelValue) {
|
|
85
|
-
return null
|
|
86
|
-
}
|
|
87
|
-
return this.justValue ? this.modelValue : this.modelValue[this.value]
|
|
88
|
-
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Property name to use as value key in item objects
|
|
111
|
+
* @type {String}
|
|
112
|
+
* @default 'value'
|
|
113
|
+
*/
|
|
114
|
+
value: {
|
|
115
|
+
type: String,
|
|
116
|
+
default: 'value'
|
|
89
117
|
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* If true, emits only the value property instead of the whole item object
|
|
121
|
+
* @type {Boolean}
|
|
122
|
+
* @default false
|
|
123
|
+
*/
|
|
124
|
+
justValue: Boolean,
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* If true, reverses the menu positioning
|
|
128
|
+
* @type {Boolean}
|
|
129
|
+
* @default false
|
|
130
|
+
*/
|
|
131
|
+
reverse: Boolean,
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* If true, menu overlays the trigger instead of pushing content down
|
|
135
|
+
* @type {Boolean}
|
|
136
|
+
* @default false
|
|
137
|
+
*/
|
|
138
|
+
overlay: Boolean,
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Array of menu items
|
|
142
|
+
* Can be array of objects or primitives (strings/numbers)
|
|
143
|
+
* @type {Array}
|
|
144
|
+
* @example
|
|
145
|
+
* // Array of objects
|
|
146
|
+
* [{ value: 1, name: 'Option 1' }, { value: 2, name: 'Option 2' }]
|
|
147
|
+
* // Array of primitives
|
|
148
|
+
* ['Option 1', 'Option 2']
|
|
149
|
+
*/
|
|
150
|
+
items: Array
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
const emit = defineEmits([
|
|
154
|
+
/**
|
|
155
|
+
* Emitted when selected value changes
|
|
156
|
+
* @event update:modelValue
|
|
157
|
+
* @param {String|Number|Object} value - Selected value
|
|
158
|
+
*/
|
|
159
|
+
'update:modelValue'
|
|
160
|
+
])
|
|
161
|
+
|
|
162
|
+
const {$r} = inject('renusify')
|
|
163
|
+
|
|
164
|
+
const show = ref(false)
|
|
165
|
+
const top = ref(null)
|
|
166
|
+
const left = ref(null)
|
|
167
|
+
const right = ref(null)
|
|
168
|
+
const opacity = ref(0)
|
|
169
|
+
const menuRef = ref(null)
|
|
170
|
+
|
|
171
|
+
const list = computed(() => {
|
|
172
|
+
const result = []
|
|
173
|
+
if (props.items) {
|
|
174
|
+
props.items.forEach((item) => {
|
|
175
|
+
if (typeof item === 'object') {
|
|
176
|
+
result.push(item)
|
|
108
177
|
} else {
|
|
109
|
-
|
|
110
|
-
this.left = 0
|
|
111
|
-
} else {
|
|
112
|
-
this.right = 0
|
|
113
|
-
}
|
|
178
|
+
result.push({'name': item, [props.value]: item})
|
|
114
179
|
}
|
|
180
|
+
})
|
|
181
|
+
}
|
|
182
|
+
return result
|
|
183
|
+
})
|
|
184
|
+
|
|
185
|
+
const selected = computed(() => {
|
|
186
|
+
if (!props.modelValue) {
|
|
187
|
+
return null
|
|
188
|
+
}
|
|
189
|
+
return props.justValue ? props.modelValue : props.modelValue[props.value]
|
|
190
|
+
})
|
|
191
|
+
|
|
192
|
+
const emitItem = (item) => {
|
|
193
|
+
emit('update:modelValue', props.justValue ? item[props.value] : item)
|
|
194
|
+
close()
|
|
195
|
+
}
|
|
115
196
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
this.top = this.top + 20
|
|
119
|
-
this.opacity = 1
|
|
120
|
-
}, 10)
|
|
197
|
+
const open = () => {
|
|
198
|
+
if (!menuRef.value) return
|
|
121
199
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
this.opacity = 0
|
|
125
|
-
setTimeout(() => {
|
|
126
|
-
this.show = false
|
|
127
|
-
}, 200)
|
|
200
|
+
const elm = menuRef.value.getBoundingClientRect()
|
|
201
|
+
top.value = -20
|
|
128
202
|
|
|
203
|
+
if (!props.overlay) {
|
|
204
|
+
top.value += elm.height
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
opacity.value = 0
|
|
208
|
+
|
|
209
|
+
if (props.reverse) {
|
|
210
|
+
if (!$r.rtl) {
|
|
211
|
+
right.value = 0
|
|
212
|
+
left.value = null
|
|
213
|
+
} else {
|
|
214
|
+
left.value = 0
|
|
215
|
+
right.value = null
|
|
216
|
+
}
|
|
217
|
+
} else {
|
|
218
|
+
if (!$r.rtl) {
|
|
219
|
+
left.value = 0
|
|
220
|
+
right.value = null
|
|
221
|
+
} else {
|
|
222
|
+
right.value = 0
|
|
223
|
+
left.value = null
|
|
129
224
|
}
|
|
130
225
|
}
|
|
226
|
+
|
|
227
|
+
show.value = true
|
|
228
|
+
|
|
229
|
+
nextTick(() => {
|
|
230
|
+
top.value = top.value + 20
|
|
231
|
+
opacity.value = 1
|
|
232
|
+
})
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
const close = () => {
|
|
236
|
+
top.value = top.value - 20
|
|
237
|
+
opacity.value = 0
|
|
238
|
+
|
|
239
|
+
setTimeout(() => {
|
|
240
|
+
show.value = false
|
|
241
|
+
}, 200)
|
|
131
242
|
}
|
|
132
243
|
</script>
|
|
244
|
+
|
|
133
245
|
<style lang="scss">
|
|
134
246
|
@use "sass:map";
|
|
135
247
|
@use "../../style/variables/base";
|
|
@@ -154,13 +266,13 @@ export default {
|
|
|
154
266
|
}
|
|
155
267
|
}
|
|
156
268
|
|
|
157
|
-
|
|
158
|
-
|
|
269
|
+
.dropdown-menu {
|
|
270
|
+
border: 1px solid var(--color-border-low);
|
|
159
271
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
272
|
+
&-item:hover {
|
|
273
|
+
background-color: var(--color-sheet-container-high);
|
|
163
274
|
}
|
|
275
|
+
}
|
|
164
276
|
|
|
165
277
|
.menu-label {
|
|
166
278
|
cursor: pointer;
|
package/components/meta/meta.js
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example // Basic usage
|
|
3
|
+
* <template>
|
|
4
|
+
* <r-meta
|
|
5
|
+
* title="pageTitle"
|
|
6
|
+
* description="pageDescription"
|
|
7
|
+
* keywords="test,test2"
|
|
8
|
+
* />
|
|
9
|
+
* </template>
|
|
10
|
+
*
|
|
11
|
+
* @example // Advanced usage with HTML and HEAD attributes
|
|
12
|
+
* <template>
|
|
13
|
+
* <r-meta
|
|
14
|
+
* :html="{ body: { id: 'page-id', class: 'home-page' } }"
|
|
15
|
+
* :head="{ 'meta[charset]': { charset: 'utf-8' } }"
|
|
16
|
+
* title="Dynamic Page Title"
|
|
17
|
+
* description="Dynamic page description for SEO"
|
|
18
|
+
* image="https://example.com/og-image.jpg"
|
|
19
|
+
* url="https://example.com/current-page"
|
|
20
|
+
* lang="en-US"
|
|
21
|
+
* />
|
|
22
|
+
*</template>
|
|
23
|
+
*/
|
|
1
24
|
//https://github.com/troxler/headful/blob/master/src/headful.js
|
|
2
25
|
export default {
|
|
3
26
|
name: "r-meta",
|
|
@@ -84,9 +107,9 @@ export default {
|
|
|
84
107
|
let property = selector;
|
|
85
108
|
property = property.split("[");
|
|
86
109
|
const name = property[0];
|
|
87
|
-
property =
|
|
88
|
-
property =
|
|
89
|
-
property =
|
|
110
|
+
property = property[1].replaceAll("]", "");
|
|
111
|
+
property = property.replaceAll('"', "");
|
|
112
|
+
property = property.replaceAll("'", "");
|
|
90
113
|
property = property.trim(" ");
|
|
91
114
|
property = property.split("=");
|
|
92
115
|
let meta = document.createElement(name);
|