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.
Files changed (212) hide show
  1. package/components/app/index.vue +74 -22
  2. package/components/app/toast/index.vue +76 -71
  3. package/components/app/toast/toast.vue +62 -44
  4. package/components/avatar/index.vue +207 -84
  5. package/components/button/buttonConfirm.vue +53 -26
  6. package/components/button/buttonGroup.js +0 -2
  7. package/components/button/buttonGroup.vue +310 -62
  8. package/components/button/index.vue +584 -100
  9. package/components/calendar/index.js +0 -2
  10. package/components/calendar/index.vue +326 -262
  11. package/components/calendar/month.vue +64 -55
  12. package/components/calendar/year.vue +30 -25
  13. package/components/card/index.vue +139 -59
  14. package/components/codeEditor/highlightCss.vue +38 -39
  15. package/components/codeEditor/highlightHtml.vue +64 -64
  16. package/components/codeEditor/highlightJs.vue +37 -38
  17. package/components/codeEditor/index.vue +129 -79
  18. package/components/codeEditor/run.vue +225 -39
  19. package/components/codeEditor/useCodeFormatter.js +150 -0
  20. package/components/confirm/index.vue +139 -80
  21. package/components/container/col.vue +5 -4
  22. package/components/container/divider.vue +28 -19
  23. package/components/container/index.vue +34 -15
  24. package/components/container/row.vue +26 -9
  25. package/components/container/spacer.vue +2 -4
  26. package/components/container/style.scss +3 -0
  27. package/components/content/index.vue +49 -32
  28. package/components/cropper/index.vue +401 -244
  29. package/components/float/index.vue +542 -415
  30. package/components/form/addressInput/index.vue +184 -109
  31. package/components/form/camInput/index.vue +370 -244
  32. package/components/form/checkInput/index.vue +138 -71
  33. package/components/form/checkboxInput/index.vue +93 -49
  34. package/components/form/colorInput/Alpha.vue +81 -83
  35. package/components/form/colorInput/Hue.vue +91 -68
  36. package/components/form/colorInput/Preview.vue +43 -47
  37. package/components/form/colorInput/Saturation.vue +101 -86
  38. package/components/form/colorInput/index.vue +71 -39
  39. package/components/form/colorInput/picker.vue +111 -106
  40. package/components/form/colorInput/useColor.js +153 -0
  41. package/components/form/dateInput/index.vue +691 -356
  42. package/components/form/dateInput/month.vue +63 -54
  43. package/components/form/dateInput/year.vue +35 -25
  44. package/components/form/fileInput/index.js +0 -1
  45. package/components/form/fileInput/index.vue +263 -106
  46. package/components/form/fileInput/single.vue +332 -168
  47. package/components/form/groupInput/index.vue +199 -101
  48. package/components/form/index.vue +189 -83
  49. package/components/form/input/index.vue +416 -377
  50. package/components/form/jsonInput/JsonView.vue +54 -56
  51. package/components/form/jsonInput/index.vue +247 -165
  52. package/components/form/maskInput/index.vue +252 -132
  53. package/components/form/numberInput/index.js +0 -1
  54. package/components/form/numberInput/index.vue +226 -117
  55. package/components/form/passwordInput/index.js +2 -1
  56. package/components/form/passwordInput/index.vue +269 -102
  57. package/components/form/radioInput/index.vue +143 -72
  58. package/components/form/rangeInput/index.vue +280 -167
  59. package/components/form/ratingInput/index.vue +57 -57
  60. package/components/form/selectInput/index.js +1 -3
  61. package/components/form/selectInput/index.vue +584 -296
  62. package/components/form/switchInput/index.vue +73 -59
  63. package/components/form/telInput/index.js +0 -1
  64. package/components/form/telInput/index.vue +238 -135
  65. package/components/form/textArea/index.vue +72 -35
  66. package/components/form/textEditor/index.vue +739 -0
  67. package/components/form/{text-editor → textEditor}/style.scss +8 -16
  68. package/components/form/textInput/index.vue +54 -32
  69. package/components/form/timeInput/index.vue +82 -55
  70. package/components/form/timeInput/range.vue +115 -94
  71. package/components/form/timeInput/timepicker.vue +382 -449
  72. package/components/form/uniqueInput/index.vue +105 -48
  73. package/components/form/unitInput/index.vue +139 -84
  74. package/components/formCreator/index.js +0 -1
  75. package/components/formCreator/index.vue +314 -148
  76. package/components/highlight/index.vue +41 -25
  77. package/components/highlight/style.scss +2 -2
  78. package/components/highlight/{mixin.js → useHighlight.js} +181 -160
  79. package/components/icon/index.vue +79 -33
  80. package/components/img/index.vue +250 -147
  81. package/components/img/preview.vue +180 -198
  82. package/components/img/svgImg.vue +42 -39
  83. package/components/index.js +5 -20
  84. package/components/infinite/index.js +3 -3
  85. package/components/infinite/index.vue +290 -66
  86. package/components/map/index.vue +428 -261
  87. package/components/map/route.vue +794 -487
  88. package/components/map/select.vue +118 -58
  89. package/components/menu/index.vue +206 -94
  90. package/components/meta/meta.js +26 -3
  91. package/components/modal/index.vue +382 -156
  92. package/components/notify/index.vue +204 -86
  93. package/components/notify/notification.vue +38 -55
  94. package/components/progress/circle.vue +189 -70
  95. package/components/progress/line.vue +266 -46
  96. package/components/searchBox/index.js +1 -3
  97. package/components/searchBox/index.vue +194 -101
  98. package/components/skeleton/index.vue +45 -20
  99. package/components/slider/index.vue +319 -156
  100. package/components/swiper/index.vue +237 -108
  101. package/components/table/crud/footer.vue +77 -53
  102. package/components/table/crud/header.vue +71 -72
  103. package/components/table/crud/index.vue +629 -399
  104. package/components/table/index.vue +721 -278
  105. package/components/timeAgo/index.vue +145 -96
  106. package/components/tour/index.vue +338 -235
  107. package/components/tree/index.vue +235 -89
  108. package/components/tree/tree-element.vue +106 -106
  109. package/directive/animate/index.js +77 -0
  110. package/directive/clickOutSide/index.js +98 -0
  111. package/directive/drag/index.js +153 -0
  112. package/directive/index.js +11 -13
  113. package/directive/intersect/index.js +263 -0
  114. package/directive/mask/index.js +67 -0
  115. package/directive/parallax/index.js +78 -0
  116. package/directive/ripple/index.js +14 -0
  117. package/directive/scroll/index.js +272 -24
  118. package/directive/sortable/index.js +274 -0
  119. package/directive/title/index.js +75 -0
  120. package/directive/touch/index.js +268 -0
  121. package/index.js +11 -19
  122. package/package.json +5 -2
  123. package/plugins/validation/Validate.js +88 -79
  124. package/scripts/generate-docs.mjs +226 -0
  125. package/scripts/menu.mjs +240 -0
  126. package/scripts/parser.mjs +1086 -0
  127. package/style/_index.scss +7 -0
  128. package/style/app.scss +13 -65
  129. package/style/colors.scss +5 -22
  130. package/style/functions/index.scss +8 -0
  131. package/style/mixins/index.scss +17 -5
  132. package/style/variables/base.scss +155 -178
  133. package/style/variables/color.scss +0 -12
  134. package/style/variables/utilities.scss +0 -180
  135. package/tools/helper.js +0 -8
  136. package/tools/icons.js +7 -2
  137. package/tools/root.js +71 -0
  138. package/components/app/style.scss +0 -41
  139. package/components/app/toast/style.scss +0 -20
  140. package/components/avatar/style.scss +0 -32
  141. package/components/bar/bottomNav.js +0 -1
  142. package/components/bar/bottomNav.vue +0 -28
  143. package/components/bar/bottomNavigationCircle.js +0 -2
  144. package/components/bar/bottomNavigationCircle.vue +0 -99
  145. package/components/bar/scss/bottomNav.scss +0 -67
  146. package/components/bar/scss/toolbar.scss +0 -174
  147. package/components/bar/toolbar/index.js +0 -8
  148. package/components/bar/toolbar/index.vue +0 -35
  149. package/components/bar/toolbar/laptop.vue +0 -33
  150. package/components/bar/toolbar/menuChilds.vue +0 -41
  151. package/components/bar/toolbar/menuLaptop.vue +0 -41
  152. package/components/bar/toolbar/menuMob.vue +0 -39
  153. package/components/bar/toolbar/mixin.js +0 -43
  154. package/components/bar/toolbar/mobile.vue +0 -34
  155. package/components/breadcrumb/bredcrumbItem.vue +0 -39
  156. package/components/breadcrumb/index.js +0 -3
  157. package/components/breadcrumb/index.vue +0 -71
  158. package/components/breadcrumb/style.scss +0 -51
  159. package/components/button/style.scss +0 -411
  160. package/components/card/style.scss +0 -86
  161. package/components/chart/chart.js +0 -1
  162. package/components/chart/chart.vue +0 -69
  163. package/components/chart/worldMap.js +0 -2
  164. package/components/chart/worldMap.vue +0 -1112
  165. package/components/chat/MessageList.vue +0 -163
  166. package/components/chat/chatInput.vue +0 -150
  167. package/components/chat/chatMsg.vue +0 -276
  168. package/components/chat/index.js +0 -11
  169. package/components/chat/index.vue +0 -113
  170. package/components/chip/index.js +0 -3
  171. package/components/chip/index.vue +0 -77
  172. package/components/chip/style.scss +0 -199
  173. package/components/codeEditor/mixin.js +0 -145
  174. package/components/countdown/index.js +0 -1
  175. package/components/countdown/index.vue +0 -105
  176. package/components/form/colorInput/mixin.js +0 -132
  177. package/components/form/fileInput/file.js +0 -148
  178. package/components/form/telInput/assets/flags.png +0 -0
  179. package/components/form/telInput/assets/flags@2x.png +0 -0
  180. package/components/form/text-editor/index.vue +0 -705
  181. package/components/icon/style.scss +0 -17
  182. package/components/infinite/div.js +0 -6
  183. package/components/infinite/div.vue +0 -193
  184. package/components/infinite/page.js +0 -3
  185. package/components/infinite/page.vue +0 -105
  186. package/components/list/index.js +0 -3
  187. package/components/list/index.vue +0 -122
  188. package/components/list/style.scss +0 -66
  189. package/components/message/index.js +0 -4
  190. package/components/message/index.vue +0 -40
  191. package/components/modal/style.scss +0 -146
  192. package/components/nestable/NestableItem.vue +0 -307
  193. package/components/nestable/editable.js +0 -44
  194. package/components/nestable/index.js +0 -1
  195. package/components/nestable/index.vue +0 -226
  196. package/components/nestable/methods.js +0 -416
  197. package/components/progress/style.scss +0 -229
  198. package/components/table/style.scss +0 -338
  199. package/components/tabs/index.js +0 -3
  200. package/components/tabs/index.vue +0 -151
  201. package/components/timeline/index.js +0 -6
  202. package/components/timeline/index.vue +0 -76
  203. package/directive/resize/index.js +0 -30
  204. package/directive/skeleton/index.js +0 -27
  205. package/directive/skeleton/style.scss +0 -37
  206. package/plugins/request/Request.js +0 -68
  207. package/style/animation.scss +0 -94
  208. package/style/style.scss +0 -8
  209. package/tools/rootable.js +0 -75
  210. /package/components/form/{text-editor → textEditor}/index.js +0 -0
  211. /package/components/form/{text-editor → textEditor}/preview.js +0 -0
  212. /package/components/form/{text-editor → textEditor}/preview.vue +0 -0
@@ -1,72 +1,296 @@
1
1
  <template>
2
- <r-card class="overflow-hidden">
3
- <r-container full-width class="pa-0">
4
- <r-row class="v-center h-space-between" :class="color">
5
- <r-col class="col-auto">
6
- <h3 class="title-1 px-2">{{ title }}</h3>
7
- </r-col>
8
- <r-col class="col-auto mx-1">
9
- <r-switch-input
10
- label="live"
11
- v-model="live"
12
- ></r-switch-input>
13
- </r-col>
14
- </r-row>
15
- </r-container>
16
- <r-infinite-div class="pt-0"
17
- :url="url"
18
- :height="height"
19
- :query="query"
20
- :live-timer="liveTimer"
21
- :is-chat="isChat"
22
- :headers="headers"
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="{handler:onScroll,target:target}"
5
+ :style="{'max-height': height,'height': height}"
6
+ class="infinite-page-container" :class="{'overflow-div':height}">
7
+ <transition-group :class="{'flex-column-reverse':isChat}"
8
+ :name="isChat?'slide-up':'slide-down'"
9
+ class="row"
10
+ tag="div">
11
+ <!-- Default slot for contents. Provide items, total props -->
12
+ <slot :items="datacollection" :total="total">{{ datacollection }}</slot>
13
+ <r-col class="col-12" key="loading">
14
+ <r-progress-line color="color-two"
15
+ v-show="loading"></r-progress-line>
16
+ </r-col>
17
+ </transition-group>
18
+ </div>
19
+ <div v-if="noItem"
20
+ class="text-center title-2"
21
+ >{{ noItemMsg }}
22
+ </div>
23
+ </r-container>
32
24
  </template>
25
+ <script setup>
26
+ import {
27
+ ref,
28
+ computed,
29
+ onMounted,
30
+ onUnmounted,
31
+ onActivated,
32
+ onDeactivated,
33
+ watch,
34
+ inject,nextTick
35
+ } from 'vue'
33
36
 
34
- <script>
35
-
36
- export default {
37
- name: 'r-infinite-box',
38
- props: {
39
- color:{
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
- }
37
+ const props = defineProps({
38
+ /**
39
+ * API endpoint URL for fetching data
40
+ * @required
41
+ * @description The URL to fetch data from. Can be a relative or absolute URL.
42
+ * @example '/api/users'
43
+ */
44
+ url: {
45
+ required: true,
46
+ type: String
47
+ },
48
+
49
+ /**
50
+ * Query parameters for the API request
51
+ * @description Query parameters to be sent with the request.
52
+ * Supports dynamic parameters for filtering, pagination, etc.
53
+ * @example { sortBy: 'created_at', sortOrder: 'desc' }
54
+ */
55
+ query: {
56
+ type: Object
57
+ },
58
+
59
+ /**
60
+ * Message to display when no items are found
61
+ * @description The text displayed in the UI when the data fetch returns an empty result.
62
+ * Can be overridden for localization or custom messaging.
63
+ * @example 'No records found'
64
+ */
65
+ noItemMsg: {
66
+ type: String,
67
+ default: 'ITEMS NOT FOUND'
68
+ },
69
+
70
+ /**
71
+ * Distance from bottom to trigger infinite loading
72
+ * @description Distance in pixels from the bottom of the scroll container
73
+ * that triggers loading more items (infinite scrolling).
74
+ * Smaller values trigger loading earlier, larger values trigger later.
75
+ * @example 200 // Triggers loading when 200px from bottom
76
+ */
77
+ distanceLoad: {
78
+ type: Number,
79
+ default: 150
80
+ },
81
+
82
+ /**
83
+ * Custom HTTP headers for the request
84
+ * @description Additional HTTP headers to include with the request.
85
+ * Useful for authentication, content-type specification, etc.
86
+ * @example { 'Authorization': 'Bearer token123' }
87
+ */
88
+ headers: Object,
89
+
90
+ /**
91
+ * Chat mode toggle
92
+ * When true, applies chat UI patterns like reverse order
93
+ */
94
+ isChat: Boolean,
95
+
96
+ /**
97
+ * Container height
98
+ * @description CSS height value for the container element.
99
+ * Accepts any valid CSS height value (px, %, vh, etc.).
100
+ * @example '500px'
101
+ */
102
+ height: String,
103
+
104
+ /**
105
+ * Live updates toggle
106
+ * @description Enables automatic polling for live updates.
107
+ * When true, periodically fetches new data based on `liveTimer` interval.
108
+ */
109
+ live: Boolean,
110
+
111
+ /**
112
+ * Live update interval in milliseconds
113
+ * @description Time interval (in milliseconds) between automatic live updates.
114
+ * Only applies when `live` prop is true.
115
+ * @example 5000 // Update every 5 seconds
116
+ */
117
+ liveTimer: {
118
+ default: 10000,
119
+ type: Number
120
+ }
121
+ })
122
+
123
+ const emit = defineEmits(['update:modelValue'])
124
+
125
+ const $axios = inject('axios')
126
+ const $helper = inject('renusify').$helper
127
+
128
+ // Reactive state
129
+ const datacollection = ref([])
130
+ const page = ref(1)
131
+ const first = ref(true)
132
+ const chat = ref(null)
133
+ const active = ref(true)
134
+ const loading = ref(false)
135
+ const total = ref(0)
136
+ const noItem = ref(false)
137
+
138
+ const target = computed(() => props.height ? false : 'window')
139
+
140
+ // Methods
141
+ const onScroll = (e) => {
142
+ if (props.height) {
143
+ let offset = 0
144
+ if (props.isChat) {
145
+ offset = e.target.scrollTop
146
+ } else {
147
+ offset = e.target.scrollHeight - e.target.scrollTop - e.target.clientHeight
148
+ }
149
+ if (offset < 200) {
150
+ if (!loading.value) {
151
+ if (datacollection.value.length < total.value) {
152
+ page.value++
153
+ get()
154
+ }
155
+ }
156
+ }
157
+ } else {
158
+ if (active.value &&
159
+ (document.body.offsetHeight < ((window.innerHeight + window.scrollY) + props.distanceLoad)) &&
160
+ !loading.value &&
161
+ (datacollection.value.length < total.value)
162
+ ) {
163
+ page.value++
164
+ get()
165
+ }
166
+ }
167
+ }
168
+
169
+ const get = () => {
170
+ $helper.log('infinite page get')
171
+ loading.value = true
172
+ noItem.value = false
173
+
174
+ let end = true
175
+ let params = {'page': page.value}
176
+
177
+ if (props.live === true) {
178
+ params = {'page': 1}
179
+ end = false
180
+ }
181
+ if (typeof props.query === 'object') {
182
+ Object.assign(params, props.query)
183
+ }
184
+
185
+ $axios.get(props.url, {params, headers: props.headers})
186
+ .then(({data}) => {
187
+ push(data.data, end)
188
+ total.value = data.total
189
+ if (total.value === 0) {
190
+ noItem.value = true
70
191
  }
192
+ loading.value = false
193
+ })
194
+ .catch(() => {
195
+ loading.value = false
196
+ })
197
+ }
198
+
199
+ const push = (data, end = false) => {
200
+ if (!end) {
201
+ let d = data
202
+ const lng = datacollection.value.length
203
+ for (let key = 0; key < lng; key++) {
204
+ if (key <= data.length) {
205
+ if ($helper.searchArray(d, '_id', datacollection.value[key]['_id']) === false) {
206
+ d.push(datacollection.value[key])
207
+ }
208
+ } else {
209
+ d.push(datacollection.value[key])
210
+ }
211
+ }
212
+ datacollection.value = d
213
+ } else {
214
+ let d = datacollection.value
215
+ const lng = data.length
216
+ for (let key = 0; key < lng; key++) {
217
+ if ($helper.searchArray(d, '_id', data[key]['_id']) === false) {
218
+ d.push(data[key])
219
+ }
71
220
  }
221
+ datacollection.value = d
222
+ }
223
+ nextTick(() => {
224
+ let el = chat.value
225
+ let can = false
226
+ if (props.isChat) {
227
+ can = el.scrollHeight <= el.scrollTop + el.clientHeight
228
+ } else {
229
+ can = el.scrollTop === 0
230
+ }
231
+
232
+ if (props.isChat) {
233
+ if (first.value || can) {
234
+ el.scrollTop = el.scrollHeight
235
+ first.value = false
236
+ }
237
+ } else if (can) {
238
+ el.scrollTop = 0
239
+ }
240
+ })
241
+ }
242
+
243
+ let liveInterval = null
244
+ const setupLiveUpdates = () => {
245
+ if (props.live) {
246
+ clearInterval(liveInterval)
247
+ liveInterval = setInterval(() => {
248
+ if (active.value && !loading.value) {
249
+ get()
250
+ }
251
+ }, props.liveTimer)
252
+ }
253
+ }
254
+
255
+ onMounted(() => {
256
+ get()
257
+
258
+ setupLiveUpdates()
259
+ })
260
+
261
+ onActivated(() => {
262
+ active.value = true
263
+ })
264
+
265
+ onDeactivated(() => {
266
+ active.value = false
267
+ })
268
+
269
+ watch(() => props.live, (newValue) => {
270
+ if (newValue) {
271
+ get()
272
+ setupLiveUpdates()
273
+ } else {
274
+ clearInterval(liveInterval)
275
+ }
276
+ })
277
+
278
+ onUnmounted(() => {
279
+ clearInterval(liveInterval)
280
+ })
281
+
72
282
  </script>
283
+
284
+ <style lang="scss">
285
+ @use "sass:map";
286
+ @use "../../style" as *;
287
+
288
+ .#{$prefix}infinite {
289
+ width: 100%;
290
+
291
+ .overflow-div {
292
+ overflow-y: auto;
293
+ overflow-x: hidden;
294
+ }
295
+ }
296
+ </style>