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,139 +1,259 @@
1
1
  <template>
2
- <r-input :error="error?true:false" ltr :rules="required?['required']:[]" :msg="error?error:undefined"
3
- :modelValue="lazyVal" :active="active">
4
- <input
5
- v-model="lazyVal"
6
- @complete="onComplete"
7
- @accept="onAccept"
8
- @backspace="onBackspace"
9
- autocomplete="no"
10
- @paste.prevent="onPaste"
11
- @focusin="active=true"
12
- @focusout="active=false"
13
- v-mask="mask"
14
- />
15
-
16
- </r-input>
2
+ <r-input :error="error?true:false" ltr :rules="required?['required']:[]" :msg="error?error:undefined"
3
+ :modelValue="lazyVal" :active="active">
4
+ <input
5
+ v-model="lazyVal"
6
+ :autofocus="autofocus"
7
+ :placeholder="placeholder"
8
+ @complete="onComplete"
9
+ @accept="onAccept"
10
+ @backspace="onBackspace"
11
+ autocomplete="no"
12
+ @paste.prevent="onPaste"
13
+ @focusin="active=true"
14
+ @focusout="active=false"
15
+ v-mask="mask"
16
+ />
17
+
18
+ </r-input>
17
19
  </template>
18
20
 
19
- <script>
20
- export default {
21
- name: 'r-mask-input',
22
- props: {
23
- modelValue: String,
24
- mask: {
25
- default: '',
26
- type: String
27
- },
28
- required: {
29
- default: false,
30
- type: Boolean
31
- },
32
- maskedVal: {
33
- default: false,
34
- type: Boolean
35
- },
36
- },
37
- emits:['update:modelValue','complete'],
38
- data() {
39
- return {
40
- lazyVal: this.modelValue?this.build_mask(this.modelValue, this.mask):null,
41
- active: false,
42
- complete: false
43
- }
44
- },
45
- watch: {
46
- modelValue: function () {
47
- this.lazyVal = this.build_mask(this.modelValue, this.mask)
48
- }
49
- },
50
- computed: {
51
- error() {
52
- if (this.required && !this.complete) {
53
- return this.lazyVal!==null?this.$t('required_error','renusify'):false
54
- } else {
55
- return false
56
- }
57
- }
58
- },
59
- methods: {
60
- onPaste(e) {
61
- this.lazyVal = this.build_mask(e.clipboardData.getData('Text')
62
- .replace('\r','')
63
- .replace('\n','')
64
- .trim()
65
- , this.mask)
66
- },
67
- build_mask(data, mask) {
68
- if (this.maskedVal || typeof data !== 'string' || data === '') {
69
- return data
70
- }
71
- let n = 0;
72
- let dataOutput = '';
73
- const lng=mask.length
74
- for (let i = 0; i <lng; i++) {
75
- const dataChar = data.charAt(n);
76
- const maskChar = mask.charAt(i);
77
-
78
- switch (maskChar) {
79
- case 'N':
80
- if (/[0-9]/.test(dataChar)) {
81
- dataOutput += dataChar;
82
- }
83
- n++
84
- break;
85
- case 'A':
86
- if (/[a-z]/i.test(dataChar)) {
87
- dataOutput += dataChar;
88
- }
89
- n++
90
- break;
91
- case 'B':
92
- if (/[a-z0-9]/i.test(dataChar)) {
93
- dataOutput += dataChar;
94
- }
95
- n++
96
- break;
97
- case 'X':
98
- dataOutput += dataChar;
99
- n++
100
- break;
101
- default:
102
- dataOutput += maskChar;
103
- break;
104
- }
105
- }
106
- return dataOutput
107
- },
108
- onAccept(event) {
109
- const e = event.detail
110
- this.complete = false
111
- if (!this.maskedVal) {
112
- this.emit(e.unMasked)
113
- } else {
114
- this.emit(e.masked)
115
- }
116
-
117
- },
118
- onBackspace(event) {
119
- this.complete = false
120
- },
121
- onComplete(event) {
122
- const e = event.detail
123
- this.complete = true
124
- if (!this.maskedVal) {
125
- this.emit(e.unMasked)
126
- } else {
127
- this.emit(e.masked)
128
- }
129
- },
130
-
131
- emit(val) {
132
- this.$emit('update:modelValue', val)
133
-
134
- this.$emit('complete', this.complete)
135
- }
21
+ <script setup>
22
+ import {ref, computed, watch, inject, nextTick, useAttrs} from 'vue'
23
+
24
+ const attr = useAttrs()
25
+ const placeholder = attr.placeholder
26
+ const autofocus = attr.autofocus
27
+
28
+ const props = defineProps({
29
+ /**
30
+ * The input's model value
31
+ * @type {String}
32
+ */
33
+ modelValue: String,
34
+ /**
35
+ * Mask pattern for input formatting
36
+ * @type {String}
37
+ * @default ''
38
+ *
39
+ * Mask characters:
40
+ * - 'N': Numbers only (0-9)
41
+ * - 'A': Letters only (a-z, A-Z)
42
+ * - 'B': Alphanumeric (a-z, A-Z, 0-9)
43
+ * - 'X': Any character
44
+ * - Other characters: Static mask characters
45
+ *
46
+ * Example: "NN-NN-AAAA" formats as "12-34-ABCD"
47
+ */
48
+ mask: {
49
+ default: '',
50
+ type: String
51
+ },
52
+ /**
53
+ * Whether the input is required
54
+ * @type {Boolean}
55
+ * @default false
56
+ */
57
+ required: {
58
+ default: false,
59
+ type: Boolean
60
+ },
61
+ /**
62
+ * Whether to emit masked value instead of unmasked
63
+ * @type {Boolean}
64
+ * @default false
65
+ *
66
+ * When true, emits value with mask characters (e.g., "12-34-ABCD")
67
+ * When false, emits only the unmasked characters (e.g., "1234ABCD")
68
+ */
69
+ maskedVal: {
70
+ default: false,
71
+ type: Boolean
72
+ }
73
+ })
74
+
75
+ const emit = defineEmits([
76
+ /**
77
+ * Emitted when the input value changes
78
+ * @param {String} value - The updated value (masked or unmasked based on maskedVal prop)
79
+ */
80
+ 'update:modelValue',
81
+ /**
82
+ * Emitted when the mask is completely filled
83
+ * @param {Boolean} isComplete - Whether the mask is fully filled
84
+ */
85
+ 'complete'
86
+ ])
87
+
88
+ const {$t} = inject('renusify')
89
+
90
+ // Reactive data
91
+ const lazyVal = ref(props.modelValue ? buildMask(props.modelValue, props.mask) : null)
92
+ const isUpdating = ref(false)
93
+ const active = ref(false)
94
+ const complete = ref(false)
95
+
96
+ // Computed properties
97
+ /**
98
+ * Error message for required validation
99
+ * @returns {String|Boolean} Error message if required and incomplete, otherwise false
100
+ */
101
+ const error = computed(() => {
102
+ if (props.required && !complete.value) {
103
+ return lazyVal.value !== null ? $t('required_error', 'renusify') : false
104
+ }
105
+ return false
106
+ })
107
+
108
+ // Methods
109
+ /**
110
+ * Handles paste event and applies mask to pasted content
111
+ * @param {ClipboardEvent} e - The paste event
112
+ */
113
+ const onPaste = (e) => {
114
+ e.preventDefault()
115
+
116
+ let pastedText = e.clipboardData.getData('Text')
117
+ .replace(/[\r\n]/g, '') // Remove all line breaks
118
+ .trim()
119
+
120
+ lazyVal.value = buildMask(pastedText, props.mask)
121
+ }
122
+
123
+ /**
124
+ * Applies mask pattern to input data
125
+ * @param {String} data - The input data to mask
126
+ * @param {String} mask - The mask pattern
127
+ * @returns {String} Masked string
128
+ */
129
+ const buildMask = (data, mask) => {
130
+ if (props.maskedVal || typeof data !== 'string' || data === '') {
131
+ return data
132
+ }
133
+
134
+ let dataIndex = 0
135
+ let dataOutput = ''
136
+ const maskLength = mask.length
137
+
138
+ for (let i = 0; i < maskLength; i++) {
139
+ const dataChar = data.charAt(dataIndex)
140
+ const maskChar = mask.charAt(i)
141
+
142
+ switch (maskChar) {
143
+ case 'N': // Numbers only
144
+ if (/[0-9]/.test(dataChar)) {
145
+ dataOutput += dataChar
146
+ }
147
+ dataIndex++
148
+ break
149
+
150
+ case 'A': // Letters only
151
+ if (/[a-z]/i.test(dataChar)) {
152
+ dataOutput += dataChar
153
+ }
154
+ dataIndex++
155
+ break
136
156
 
157
+ case 'B': // Alphanumeric
158
+ if (/[a-z0-9]/i.test(dataChar)) {
159
+ dataOutput += dataChar
137
160
  }
161
+ dataIndex++
162
+ break
163
+
164
+ case 'X': // Any character
165
+ dataOutput += dataChar
166
+ dataIndex++
167
+ break
168
+
169
+ default: // Static mask character
170
+ dataOutput += maskChar
171
+ break
138
172
  }
173
+ }
174
+
175
+ return dataOutput
176
+ }
177
+
178
+ /**
179
+ * Handles input acceptance event
180
+ * @param {CustomEvent} event - The acceptance event
181
+ */
182
+ const onAccept = (event) => {
183
+ const detail = event.detail
184
+ complete.value = false
185
+
186
+ const valueToEmit = props.maskedVal ? detail.masked : detail.unMasked
187
+ emitValue(valueToEmit)
188
+ }
189
+
190
+ /**
191
+ * Handles backspace key event
192
+ */
193
+ const onBackspace = () => {
194
+ complete.value = false
195
+ }
196
+
197
+ /**
198
+ * Handles mask completion event
199
+ * @param {CustomEvent} event - The completion event
200
+ */
201
+ const onComplete = (event) => {
202
+ const detail = event.detail
203
+ complete.value = true
204
+
205
+ const valueToEmit = props.maskedVal ? detail.masked : detail.unMasked
206
+ emitValue(valueToEmit)
207
+ }
208
+
209
+ /**
210
+ * Emits the updated value
211
+ * @param {String} value - The value to emit
212
+ */
213
+ const emitValue = (value) => {
214
+ if (isUpdating.value) return
215
+
216
+ isUpdating.value = true
217
+ emit('update:modelValue', value)
218
+ emit('complete', complete.value)
219
+ nextTick(() => {
220
+ isUpdating.value = false
221
+ })
222
+ }
223
+
224
+ /**
225
+ * Extracts unmasked characters from masked value
226
+ * @param {String} maskedValue - The masked string
227
+ * @param {String} mask - The mask pattern
228
+ * @returns {String} Unmasked string
229
+ */
230
+ const extractUnmasked = (maskedValue, mask) => {
231
+ if (!maskedValue || !mask) return maskedValue
232
+
233
+ let result = ''
234
+ for (let i = 0; i < maskedValue.length; i++) {
235
+ const maskChar = mask.charAt(i)
236
+ const valueChar = maskedValue.charAt(i)
237
+
238
+ if (maskChar === 'N' || maskChar === 'A' || maskChar === 'B' || maskChar === 'X') {
239
+ result += valueChar
240
+ }
241
+ }
242
+
243
+ return result
244
+ }
245
+
246
+ // Watchers
247
+ watch(() => props.modelValue, (newValue) => {
248
+ if (isUpdating.value) return
249
+ lazyVal.value = buildMask(newValue, props.mask)
250
+ })
251
+
252
+ watch(lazyVal, (newValue) => {
253
+ if (isUpdating.value) return
254
+ if (newValue !== null && newValue !== undefined) {
255
+ const valueToEmit = props.maskedVal ? newValue : extractUnmasked(newValue, props.mask)
256
+ emitValue(valueToEmit)
257
+ }
258
+ }, {immediate: true})
139
259
  </script>
@@ -1,4 +1,3 @@
1
1
  export * as rNumberInput from './index.vue'
2
2
  export * as l_Input from '../input/index.js'
3
- export * as l_btn from '../../button/index.js'
4
3
  export * as l_icon from '../../icon/index.js'