renusify 2.5.2 → 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 +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 +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 +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 +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 +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 +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 +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 +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 +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 +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 -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
|
@@ -1,72 +1,254 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
:live="live"
|
|
24
|
-
>
|
|
25
|
-
|
|
26
|
-
<template v-slot="{item}">
|
|
27
|
-
<slot v-bind:item="item"></slot>
|
|
28
|
-
</template>
|
|
29
|
-
|
|
30
|
-
</r-infinite-div>
|
|
31
|
-
</r-card>
|
|
2
|
+
<r-container :class="[$r.prefix+'infinite']">
|
|
3
|
+
<div ref="chat"
|
|
4
|
+
v-scroll.[modifier]="onScroll"
|
|
5
|
+
:style="{'max-height': height,'height': height}"
|
|
6
|
+
class="infinite-page-container">
|
|
7
|
+
<transition-group :class="{'flex-column-reverse':isChat}"
|
|
8
|
+
:name="isChat?'slide-up':'slide-down'"
|
|
9
|
+
class="row" tag="div">
|
|
10
|
+
<!-- Default slot for contents. Provide items, total props -->
|
|
11
|
+
<slot :items="datacollection" :total="total">{{ datacollection }}</slot>
|
|
12
|
+
</transition-group>
|
|
13
|
+
</div>
|
|
14
|
+
<r-progress-line v-show="loading"
|
|
15
|
+
color="color-two"
|
|
16
|
+
|
|
17
|
+
></r-progress-line>
|
|
18
|
+
<div v-if="noItem"
|
|
19
|
+
class="text-center title-2"
|
|
20
|
+
>{{ noItemMsg }}
|
|
21
|
+
</div>
|
|
22
|
+
</r-container>
|
|
32
23
|
</template>
|
|
24
|
+
<script setup>
|
|
25
|
+
import {ref, computed, onMounted, onUnmounted, onActivated, onDeactivated, watch, inject} from 'vue'
|
|
26
|
+
|
|
27
|
+
const props = defineProps({
|
|
28
|
+
/**
|
|
29
|
+
* API endpoint URL for fetching data
|
|
30
|
+
* @required
|
|
31
|
+
* @description The URL to fetch data from. Can be a relative or absolute URL.
|
|
32
|
+
* @example '/api/users'
|
|
33
|
+
*/
|
|
34
|
+
url: {
|
|
35
|
+
required: true,
|
|
36
|
+
type: String
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Query parameters for the API request
|
|
41
|
+
* @description Query parameters to be sent with the request.
|
|
42
|
+
* Supports dynamic parameters for filtering, pagination, etc.
|
|
43
|
+
* @example { sortBy: 'created_at', sortOrder: 'desc' }
|
|
44
|
+
*/
|
|
45
|
+
query: {
|
|
46
|
+
type: Object
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Message to display when no items are found
|
|
51
|
+
* @description The text displayed in the UI when the data fetch returns an empty result.
|
|
52
|
+
* Can be overridden for localization or custom messaging.
|
|
53
|
+
* @example 'No records found'
|
|
54
|
+
*/
|
|
55
|
+
noItemMsg: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: 'ITEMS NOT FOUND'
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Distance from bottom to trigger infinite loading
|
|
62
|
+
* @description Distance in pixels from the bottom of the scroll container
|
|
63
|
+
* that triggers loading more items (infinite scrolling).
|
|
64
|
+
* Smaller values trigger loading earlier, larger values trigger later.
|
|
65
|
+
* @example 200 // Triggers loading when 200px from bottom
|
|
66
|
+
*/
|
|
67
|
+
distanceLoad: {
|
|
68
|
+
type: Number,
|
|
69
|
+
default: 150
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Custom HTTP headers for the request
|
|
74
|
+
* @description Additional HTTP headers to include with the request.
|
|
75
|
+
* Useful for authentication, content-type specification, etc.
|
|
76
|
+
* @example { 'Authorization': 'Bearer token123' }
|
|
77
|
+
*/
|
|
78
|
+
headers: Object,
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Chat mode toggle
|
|
82
|
+
* When true, applies chat UI patterns like reverse order
|
|
83
|
+
*/
|
|
84
|
+
isChat: Boolean,
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Container height
|
|
88
|
+
* @description CSS height value for the container element.
|
|
89
|
+
* Accepts any valid CSS height value (px, %, vh, etc.).
|
|
90
|
+
* @example '500px'
|
|
91
|
+
*/
|
|
92
|
+
height: String,
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Live updates toggle
|
|
96
|
+
* @description Enables automatic polling for live updates.
|
|
97
|
+
* When true, periodically fetches new data based on `liveTimer` interval.
|
|
98
|
+
*/
|
|
99
|
+
live: Boolean,
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Live update interval in milliseconds
|
|
103
|
+
* @description Time interval (in milliseconds) between automatic live updates.
|
|
104
|
+
* Only applies when `live` prop is true.
|
|
105
|
+
* @example 5000 // Update every 5 seconds
|
|
106
|
+
*/
|
|
107
|
+
liveTimer: {
|
|
108
|
+
default: 10000,
|
|
109
|
+
type: Number
|
|
110
|
+
}
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
const emit = defineEmits(['update:modelValue'])
|
|
114
|
+
|
|
115
|
+
const $axios = inject('axios')
|
|
116
|
+
const $helper = inject('renusify').$helper
|
|
117
|
+
|
|
118
|
+
// Reactive state
|
|
119
|
+
const datacollection = ref([])
|
|
120
|
+
const page = ref(1)
|
|
121
|
+
const first = ref(true)
|
|
122
|
+
const chat = ref(null)
|
|
123
|
+
const active = ref(true)
|
|
124
|
+
const loading = ref(false)
|
|
125
|
+
const total = ref(0)
|
|
126
|
+
const noItem = ref(false)
|
|
127
|
+
|
|
128
|
+
const modifier = computed(() => props.height ? 'div' : 'window')
|
|
129
|
+
|
|
130
|
+
// Methods
|
|
131
|
+
const onScroll = (e) => {
|
|
132
|
+
if (props.height) {
|
|
133
|
+
let offset = 0
|
|
134
|
+
if (props.isChat) {
|
|
135
|
+
offset = e.target.scrollTop
|
|
136
|
+
} else {
|
|
137
|
+
offset = e.target.scrollHeight - e.target.scrollTop - e.target.clientHeight
|
|
138
|
+
}
|
|
139
|
+
if (offset < 200) {
|
|
140
|
+
if (!loading.value) {
|
|
141
|
+
if (datacollection.value.length < total.value) {
|
|
142
|
+
page.value++
|
|
143
|
+
get()
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
} else {
|
|
148
|
+
if (active.value && document.body.offsetHeight < ((window.innerHeight + window.scrollY) + props.distanceLoad)) {
|
|
149
|
+
if (!loading.value) {
|
|
150
|
+
page.value++
|
|
151
|
+
if (datacollection.value.length < total.value) {
|
|
152
|
+
get()
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const get = () => {
|
|
160
|
+
$helper.log('infinite page get')
|
|
161
|
+
loading.value = true
|
|
162
|
+
noItem.value = false
|
|
163
|
+
|
|
164
|
+
const params = {page: page.value}
|
|
165
|
+
if (typeof props.query === 'object') {
|
|
166
|
+
Object.assign(params, props.query)
|
|
167
|
+
}
|
|
33
168
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
type:String,
|
|
41
|
-
default: 'color-two'
|
|
42
|
-
},
|
|
43
|
-
isChat:Boolean,
|
|
44
|
-
title: {
|
|
45
|
-
default: 'title',
|
|
46
|
-
type: String
|
|
47
|
-
},
|
|
48
|
-
url: {
|
|
49
|
-
required: true,
|
|
50
|
-
type: String
|
|
51
|
-
},
|
|
52
|
-
height: {
|
|
53
|
-
default: '400px',
|
|
54
|
-
type: String
|
|
55
|
-
},
|
|
56
|
-
query: {
|
|
57
|
-
type: Object
|
|
58
|
-
},
|
|
59
|
-
isLive:Boolean,
|
|
60
|
-
liveTimer: {
|
|
61
|
-
default: 10000,
|
|
62
|
-
type: Number
|
|
63
|
-
},
|
|
64
|
-
headers: Object
|
|
65
|
-
},
|
|
66
|
-
data() {
|
|
67
|
-
return {
|
|
68
|
-
live: this.isLive||false
|
|
69
|
-
}
|
|
169
|
+
$axios.get(props.url, {params, headers: props.headers})
|
|
170
|
+
.then((res) => {
|
|
171
|
+
push(res.data.data)
|
|
172
|
+
total.value = res.data.total
|
|
173
|
+
if (total.value === 0) {
|
|
174
|
+
noItem.value = true
|
|
70
175
|
}
|
|
176
|
+
loading.value = false
|
|
177
|
+
})
|
|
178
|
+
.catch(() => {
|
|
179
|
+
loading.value = false
|
|
180
|
+
})
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const push = (data) => {
|
|
184
|
+
const lng = data.length
|
|
185
|
+
for (let key = 0; key < lng; key++) {
|
|
186
|
+
datacollection.value.push(data[key])
|
|
187
|
+
}
|
|
188
|
+
let el = chat.value
|
|
189
|
+
let can = false
|
|
190
|
+
if (isChat.value) {
|
|
191
|
+
can = el.scrollHeight <= el.scrollTop + el.clientHeight
|
|
192
|
+
} else {
|
|
193
|
+
can = el.scrollTop === 0
|
|
194
|
+
}
|
|
195
|
+
if (props.isChat) {
|
|
196
|
+
|
|
197
|
+
if (first.value || can) {
|
|
198
|
+
el.scrollTop = el.scrollHeight;
|
|
199
|
+
first.value = false
|
|
71
200
|
}
|
|
201
|
+
} else if (can) {
|
|
202
|
+
el.scrollTop = 0;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
let liveInterval = null
|
|
207
|
+
const setupLiveUpdates = () => {
|
|
208
|
+
if (props.live) {
|
|
209
|
+
clearInterval(liveInterval)
|
|
210
|
+
liveInterval = setInterval(() => {
|
|
211
|
+
if (active.value && !loading.value) {
|
|
212
|
+
get()
|
|
213
|
+
}
|
|
214
|
+
}, props.liveTimer)
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
onMounted(() => {
|
|
219
|
+
get()
|
|
220
|
+
|
|
221
|
+
setupLiveUpdates()
|
|
222
|
+
})
|
|
223
|
+
|
|
224
|
+
onActivated(() => {
|
|
225
|
+
active.value = true
|
|
226
|
+
})
|
|
227
|
+
|
|
228
|
+
onDeactivated(() => {
|
|
229
|
+
active.value = false
|
|
230
|
+
})
|
|
231
|
+
|
|
232
|
+
watch(() => props.live, (newValue) => {
|
|
233
|
+
if (newValue) {
|
|
234
|
+
setupLiveUpdates()
|
|
235
|
+
} else {
|
|
236
|
+
clearInterval(liveInterval)
|
|
237
|
+
}
|
|
238
|
+
})
|
|
239
|
+
|
|
240
|
+
onUnmounted(() => {
|
|
241
|
+
clearInterval(liveInterval)
|
|
242
|
+
})
|
|
243
|
+
|
|
72
244
|
</script>
|
|
245
|
+
|
|
246
|
+
<style lang="scss">
|
|
247
|
+
@use "sass:map";
|
|
248
|
+
@use "../../style" as *;
|
|
249
|
+
|
|
250
|
+
.#{$prefix}infinite {
|
|
251
|
+
margin-bottom: 100px;
|
|
252
|
+
width: 100%
|
|
253
|
+
}
|
|
254
|
+
</style>
|