renusify 2.5.1 → 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.
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 +208 -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 +140 -81
  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 +87 -47
  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 +72 -40
  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 +323 -164
  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 +83 -56
  70. package/components/form/timeInput/range.vue +116 -95
  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 +249 -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 +1 -2
  85. package/components/infinite/index.vue +248 -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 +201 -91
  90. package/components/meta/meta.js +26 -3
  91. package/components/modal/index.vue +383 -158
  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 +318 -156
  100. package/components/swiper/index.vue +254 -106
  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 +631 -401
  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 +107 -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 +244 -0
  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 +10 -8
  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 +154 -175
  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 +6 -1
  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 -710
  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,3 +1,271 @@
1
+ /**
2
+ * @example // v-touch usage
3
+ * <template>
4
+ * <div class="touch-container">
5
+ * <h1>Touch Gesture Directive</h1>
6
+ *
7
+ * <div class="gesture-areas">
8
+ * <div class="gesture-area">
9
+ * <h2>Swipe Detection</h2>
10
+ * <div
11
+ * v-touch="swipeHandlers"
12
+ * class="swipe-box"
13
+ * >
14
+ * <div class="gesture-info">
15
+ * <div class="info-item">
16
+ * <span>Direction:</span>
17
+ * <span class="value direction" :class="swipeDirection">
18
+ * {{ swipeDirection }}
19
+ * </span>
20
+ * </div>
21
+ * <div class="info-item">
22
+ * <span>Distance X:</span>
23
+ * <span class="value">{{ swipeDistanceX }}px</span>
24
+ * </div>
25
+ * <div class="info-item">
26
+ * <span>Distance Y:</span>
27
+ * <span class="value">{{ swipeDistanceY }}px</span>
28
+ * </div>
29
+ * <div class="info-item">
30
+ * <span>Swipe Count:</span>
31
+ * <span class="value counter">{{ swipeCount }}</span>
32
+ * </div>
33
+ * </div>
34
+ * <div class="instruction">
35
+ * Swipe in any direction
36
+ * </div>
37
+ * </div>
38
+ * </div>
39
+ *
40
+ * <div class="gesture-area">
41
+ * <h2>Touch Position</h2>
42
+ * <div
43
+ * v-touch="touchHandlers"
44
+ * class="position-box"
45
+ * >
46
+ * <div class="gesture-info">
47
+ * <div class="info-item">
48
+ * <span>Current X:</span>
49
+ * <span class="value">{{ currentX }}px</span>
50
+ * </div>
51
+ * <div class="info-item">
52
+ * <span>Current Y:</span>
53
+ * <span class="value">{{ currentY }}px</span>
54
+ * </div>
55
+ * <div class="info-item">
56
+ * <span>Move Count:</span>
57
+ * <span class="value counter">{{ moveCount }}</span>
58
+ * </div>
59
+ * </div>
60
+ * <div class="touch-indicator" :style="{ left: indicatorX + 'px', top: indicatorY + 'px' }"></div>
61
+ * <div class="instruction">
62
+ * Touch and move
63
+ * </div>
64
+ * </div>
65
+ * </div>
66
+ * </div>
67
+ * </div>
68
+ * </template>
69
+ *
70
+ * <script>
71
+ * import { ref } from 'vue'
72
+ *
73
+ * const swipeDirection = ref('none')
74
+ * const swipeDistanceX = ref(0)
75
+ * const swipeDistanceY = ref(0)
76
+ * const swipeCount = ref(0)
77
+ *
78
+ * const currentX = ref(0)
79
+ * const currentY = ref(0)
80
+ * const moveCount = ref(0)
81
+ *
82
+ * const indicatorX = ref(150)
83
+ * const indicatorY = ref(150)
84
+ *
85
+ * const swipeHandlers = ref({
86
+ * left: (wrapper) => {
87
+ * swipeDirection.value = 'left'
88
+ * swipeDistanceX.value = Math.abs(wrapper.goX)
89
+ * swipeDistanceY.value = Math.abs(wrapper.goY)
90
+ * swipeCount.value++
91
+ * },
92
+ * right: (wrapper) => {
93
+ * swipeDirection.value = 'right'
94
+ * swipeDistanceX.value = wrapper.goX
95
+ * swipeDistanceY.value = Math.abs(wrapper.goY)
96
+ * swipeCount.value++
97
+ * },
98
+ * up: (wrapper) => {
99
+ * swipeDirection.value = 'up'
100
+ * swipeDistanceX.value = Math.abs(wrapper.goX)
101
+ * swipeDistanceY.value = Math.abs(wrapper.goY)
102
+ * swipeCount.value++
103
+ * },
104
+ * down: (wrapper) => {
105
+ * swipeDirection.value = 'down'
106
+ * swipeDistanceX.value = Math.abs(wrapper.goX)
107
+ * swipeDistanceY.value = wrapper.goY
108
+ * swipeCount.value++
109
+ * }
110
+ * })
111
+ *
112
+ * const touchHandlers = ref({
113
+ * move: (wrapper) => {
114
+ * currentX.value = wrapper.current.x
115
+ * currentY.value = wrapper.current.y
116
+ * moveCount.value++
117
+ *
118
+ * indicatorX.value = wrapper.current.x
119
+ * indicatorY.value = wrapper.current.y
120
+ * }
121
+ * })
122
+ * <//script>
123
+ *
124
+ * <style>
125
+ * .touch-container {
126
+ * font-family: Arial, sans-serif;
127
+ * padding: 20px;
128
+ * max-width: 800px;
129
+ * margin: 0 auto;
130
+ * }
131
+ *
132
+ * h1 {
133
+ * text-align: center;
134
+ * color: #333;
135
+ * margin-bottom: 40px;
136
+ * font-size: 2rem;
137
+ * }
138
+ *
139
+ * .gesture-areas {
140
+ * display: grid;
141
+ * grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
142
+ * gap: 20px;
143
+ * }
144
+ *
145
+ * .gesture-area {
146
+ * background: white;
147
+ * border-radius: 8px;
148
+ * padding: 20px;
149
+ * box-shadow: 0 2px 8px rgba(0,0,0,0.1);
150
+ * }
151
+ *
152
+ * .gesture-area h2 {
153
+ * margin-top: 0;
154
+ * color: #667eea;
155
+ * font-size: 1.2rem;
156
+ * margin-bottom: 15px;
157
+ * text-align: center;
158
+ * }
159
+ *
160
+ * .swipe-box,
161
+ * .position-box {
162
+ * height: 250px;
163
+ * border: 2px solid #dee2e6;
164
+ * border-radius: 6px;
165
+ * padding: 15px;
166
+ * display: flex;
167
+ * flex-direction: column;
168
+ * position: relative;
169
+ * overflow: hidden;
170
+ * cursor: pointer;
171
+ * user-select: none;
172
+ * }
173
+ *
174
+ * .swipe-box {
175
+ * background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
176
+ * }
177
+ *
178
+ * .position-box {
179
+ * background: linear-gradient(135deg, #f0f4ff 0%, #e6e9ff 100%);
180
+ * }
181
+ *
182
+ * .gesture-info {
183
+ * background: white;
184
+ * border-radius: 4px;
185
+ * padding: 10px;
186
+ * margin-bottom: 15px;
187
+ * box-shadow: 0 1px 4px rgba(0,0,0,0.1);
188
+ * }
189
+ *
190
+ * .info-item {
191
+ * display: flex;
192
+ * justify-content: space-between;
193
+ * align-items: center;
194
+ * margin-bottom: 8px;
195
+ * padding: 6px 0;
196
+ * border-bottom: 1px solid #eee;
197
+ * }
198
+ *
199
+ * .info-item:last-child {
200
+ * margin-bottom: 0;
201
+ * border-bottom: none;
202
+ * }
203
+ *
204
+ * .info-item span:first-child {
205
+ * color: #555;
206
+ * font-weight: bold;
207
+ * font-size: 14px;
208
+ * }
209
+ *
210
+ * .value {
211
+ * font-family: monospace;
212
+ * font-weight: bold;
213
+ * padding: 3px 8px;
214
+ * border-radius: 3px;
215
+ * background: #f8f9fa;
216
+ * min-width: 60px;
217
+ * text-align: center;
218
+ * font-size: 13px;
219
+ * }
220
+ *
221
+ * .counter {
222
+ * background: #667eea;
223
+ * color: white;
224
+ * }
225
+ *
226
+ * .direction {
227
+ * background: #ff6b6b;
228
+ * color: white;
229
+ * }
230
+ *
231
+ * .direction.left {
232
+ * background: #4ecdc4;
233
+ * }
234
+ *
235
+ * .direction.right {
236
+ * background: #ffa726;
237
+ * }
238
+ *
239
+ * .direction.up {
240
+ * background: #43e97b;
241
+ * }
242
+ *
243
+ * .direction.down {
244
+ * background: #f093fb;
245
+ * }
246
+ *
247
+ * .instruction {
248
+ * text-align: center;
249
+ * color: #666;
250
+ * font-size: 1rem;
251
+ * margin-top: auto;
252
+ * padding: 15px;
253
+ * background: rgba(255,255,255,0.8);
254
+ * border-radius: 4px;
255
+ * }
256
+ *
257
+ * .touch-indicator {
258
+ * position: absolute;
259
+ * width: 20px;
260
+ * height: 20px;
261
+ * background: #667eea;
262
+ * border-radius: 50%;
263
+ * transform: translate(-50%, -50%);
264
+ * pointer-events: none;
265
+ * box-shadow: 0 0 6px rgba(102, 126, 234, 0.5);
266
+ * }
267
+ * </style>
268
+ * */
1
269
  const handleGesture = wrapper => {
2
270
  const {
3
271
  startX,
package/index.js CHANGED
@@ -19,10 +19,10 @@ function breakpoint() {
19
19
  const height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
20
20
  const points = {
21
21
  'xs': 0,
22
- 'sm': 600,
23
- 'md': 960,
24
- 'lg': 1280,
25
- 'xl': 1620
22
+ 'sm': 576,
23
+ 'md': 768,
24
+ 'lg': 1024,
25
+ 'xl': 1440
26
26
  }
27
27
  let data = {
28
28
  points: points,
@@ -61,7 +61,6 @@ export default {
61
61
  app.config.globalProperties.$r = reactive(Object.assign({}, {
62
62
  prefix: 'r-',
63
63
  rtl: false,
64
- inputs: {tile: false},
65
64
  lang: 'en',
66
65
  langs:
67
66
  {
@@ -118,8 +117,7 @@ export default {
118
117
  // renusify validation
119
118
  const v = new valid(app.config.globalProperties.$t)
120
119
  app.config.globalProperties.$v = (names) => v.checkType(names)
121
-
122
- app.provide('renusify', {
120
+ let provide = {
123
121
  $r: app.config.globalProperties.$r,
124
122
  $toast: app.config.globalProperties.$toast,
125
123
  $storage: app.config.globalProperties.$storage,
@@ -130,7 +128,11 @@ export default {
130
128
  $d: app.config.globalProperties.$d,
131
129
  $n: app.config.globalProperties.$n,
132
130
  $v: app.config.globalProperties.$v,
133
- })
131
+ }
132
+ if (app.config.globalProperties.$r.useNotify) {
133
+ provide.$notify = app.config.globalProperties.$notify
134
+ }
135
+ app.provide('renusify', provide)
134
136
 
135
137
  // install components
136
138
  let required_directive = _register(app, options['components'] || {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "renusify",
3
- "version": "2.5.1",
3
+ "version": "3.0.0",
4
4
  "description": "Vue3 Framework",
5
5
  "keywords": [
6
6
  "vuejs",
@@ -23,5 +23,8 @@
23
23
  "email": "ba.smko@gmail.com"
24
24
  },
25
25
  "license": "BSD",
26
- "private": false
26
+ "private": false,
27
+ "scripts": {
28
+ "docs:generate": "node scripts/generate-docs.mjs"
29
+ }
27
30
  }
@@ -4,8 +4,17 @@ export default class Validate {
4
4
  }
5
5
 
6
6
  required() {
7
- let msg = this.$t('required_error', 'renusify');
8
- return (v) => !!(v !== undefined && v !== null && v !== '') || msg
7
+ const msg = this.$t('required_error', 'renusify');
8
+
9
+ return (v) => {
10
+ const isEmpty =
11
+ v == null ||
12
+ (typeof v === 'string' && v.trim() === '') ||
13
+ (Array.isArray(v) && v.length === 0) ||
14
+ (typeof v === 'object' && Object.keys(v).length === 0);
15
+
16
+ return !isEmpty || msg;
17
+ }
9
18
  }
10
19
 
11
20
  requiredArray() {
@@ -14,83 +23,83 @@ export default class Validate {
14
23
 
15
24
  email() {
16
25
  return (v) => (v && v.length > 0 ? /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(v) : true) || this.$t('validate_email', 'renusify');
17
- }
18
-
19
- url() {
20
- return (v) => (v && v.length > 0 ? /^((https?|ftp|smtp):\/\/)?(www.)?[a-z0-9]+\.[a-z]+(\/[a-zA-Z0-9#]+\/?)*$/.test(v) : true) || this.$t('validate_url', 'renusify');
21
- }
22
-
23
- match(val) {
24
- return (v) => {
25
- if (v == val) {
26
- return true
27
- } else {
28
- return this.$t(['validate_match', [val]], 'renusify');
29
- }
30
- }
31
- }
32
-
33
- phone() {
34
- return (v) => (v && v.length > 0 ? /^[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4}$/.test(v) : true) || this.$t('validate_phone', 'renusify');
35
- }
36
-
37
- number() {
38
- return (v) => (v && v.length > 0 ? /^([0-9.])*$/.test(v) : true) || this.$t('numeric_error', 'renusify');
39
- }
40
-
41
- english() {
42
- return (v) => (v && v.length > 0 ? /^([0-9a-zA-Z])*$/.test(v) : true) || this.$t('english_error', 'renusify');
43
- }
44
-
45
- min_len(num) {
46
- return v => (v && v.length > 0 ? v.length >= parseInt(num) ? true : this.$t(['min_len_error', [num, v.length]], 'renusify') : true)
47
- }
48
-
49
- max_len(num) {
50
- return v => (v && v.length > 0 ? v.length <= parseInt(num) ? true : this.$t(['max_len_error', [num, v.length]], 'renusify') : true)
51
- }
52
-
53
- len(num) {
54
- return v => (v && v.length > 0 ? v.length === parseInt(num) ? true : this.$t(['len_error', [num, v.length]], 'renusify') : true) || msg
55
- }
56
-
57
- min(num) {
58
- return v => (v ? parseFloat(v) >= parseFloat(num) ? true : this.$t(['min_error', [num, parseFloat(v)]], 'renusify') : true)
59
- }
60
-
61
- max(num) {
62
- return v => (v ? parseFloat(v) <= parseFloat(num) ? true : this.$t(['max_error', [num, parseFloat(v)]], 'renusify') : true)
63
- }
64
-
65
- eq(num) {
66
- return v => (v ? parseFloat(v) === parseFloat(num) : true) || this.$t(['validate_eq', [num]], 'renusify');
67
- }
68
-
69
- notDefined(name) {
70
- return v => this.$t(['validate_notDefined', [name]], 'renusify');
71
- }
72
-
73
- checkType(names) {
74
- let filters = [];
75
- if (Array.isArray(names)) {
76
- names.forEach((name) => {
77
- let res = name.split(':');
78
- let par1 = res[1] ? res[1] : null;
79
- let par2 = res[2] ? res[2] : null;
80
- let par3 = res[3] ? res[3] : null;
81
- if (this[res[0]]) {
82
- if (par3 === null && par2 === null) {
83
- filters.push(this[res[0]](par1))
84
- } else if (par3 === null) {
85
- filters.push(this[res[0]](par1, par2))
86
- } else {
87
- filters.push(this[res[0]](par1, par2, par3))
88
- }
89
- } else {
90
- filters.push(this.notDefined(name))
26
+ }
27
+
28
+ url() {
29
+ return (v) => (v && v.length > 0 ? /^((https?|ftp|smtp):\/\/)?(www.)?[a-z0-9]+\.[a-z]+(\/[a-zA-Z0-9#]+\/?)*$/.test(v) : true) || this.$t('validate_url', 'renusify');
30
+ }
31
+
32
+ match(val) {
33
+ return (v) => {
34
+ if (v == val) {
35
+ return true
36
+ } else {
37
+ return this.$t(['validate_match', [val]], 'renusify');
38
+ }
39
+ }
40
+ }
41
+
42
+ phone() {
43
+ return (v) => (v && v.length > 0 ? /^[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4}$/.test(v) : true) || this.$t('validate_phone', 'renusify');
44
+ }
45
+
46
+ number() {
47
+ return (v) => (v && v.length > 0 ? /^([0-9.])*$/.test(v) : true) || this.$t('numeric_error', 'renusify');
48
+ }
49
+
50
+ english() {
51
+ return (v) => (v && v.length > 0 ? /^([0-9a-zA-Z])*$/.test(v) : true) || this.$t('english_error', 'renusify');
52
+ }
53
+
54
+ min_len(num) {
55
+ return v => (v && v.length > 0 ? v.length >= parseInt(num) ? true : this.$t(['min_len_error', [num, v.length]], 'renusify') : true)
56
+ }
57
+
58
+ max_len(num) {
59
+ return v => (v && v.length > 0 ? v.length <= parseInt(num) ? true : this.$t(['max_len_error', [num, v.length]], 'renusify') : true)
60
+ }
61
+
62
+ len(num) {
63
+ return v => (v && v.length > 0 ? v.length === parseInt(num) ? true : this.$t(['len_error', [num, v.length]], 'renusify') : true) || msg
64
+ }
65
+
66
+ min(num) {
67
+ return v => (v ? parseFloat(v) >= parseFloat(num) ? true : this.$t(['min_error', [num, parseFloat(v)]], 'renusify') : true)
68
+ }
69
+
70
+ max(num) {
71
+ return v => (v ? parseFloat(v) <= parseFloat(num) ? true : this.$t(['max_error', [num, parseFloat(v)]], 'renusify') : true)
72
+ }
73
+
74
+ eq(num) {
75
+ return v => (v ? parseFloat(v) === parseFloat(num) : true) || this.$t(['validate_eq', [num]], 'renusify');
76
+ }
77
+
78
+ notDefined(name) {
79
+ return v => this.$t(['validate_notDefined', [name]], 'renusify');
80
+ }
81
+
82
+ checkType(names) {
83
+ let filters = [];
84
+ if (Array.isArray(names)) {
85
+ names.forEach((name) => {
86
+ let res = name.split(':');
87
+ let par1 = res[1] ? res[1] : null;
88
+ let par2 = res[2] ? res[2] : null;
89
+ let par3 = res[3] ? res[3] : null;
90
+ if (this[res[0]]) {
91
+ if (par3 === null && par2 === null) {
92
+ filters.push(this[res[0]](par1))
93
+ } else if (par3 === null) {
94
+ filters.push(this[res[0]](par1, par2))
95
+ } else {
96
+ filters.push(this[res[0]](par1, par2, par3))
97
+ }
98
+ } else {
99
+ filters.push(this.notDefined(name))
100
+ }
101
+ })
91
102
  }
92
- })
103
+ return filters
93
104
  }
94
- return filters
95
- }
96
105
  }