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.
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 +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 +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 +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 +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 +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 +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 +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 +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 +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 +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 -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
@@ -5,60 +5,117 @@
5
5
  :model-value="modelValue"
6
6
  :error="error"
7
7
  :msg="msg"
8
- :msgShake="false"
9
8
  ></r-text-input>
10
9
  </template>
11
10
 
12
- <script>
13
- export default {
14
- name: 'r-unique-input',
15
- props: {
16
- link: {
17
- type: String,
18
- required: true
19
- },
11
+ <script setup>
12
+ import {ref, watch, inject} from 'vue'
20
13
 
21
- modelValue: {
22
- default: null,
23
- type: String
24
- },
25
- headers: Object
14
+ const props = defineProps({
15
+ /**
16
+ * API endpoint URL for uniqueness validation
17
+ * @type {String}
18
+ * @required
19
+ */
20
+ link: {
21
+ type: String,
22
+ required: true
26
23
  },
27
- emits:['update:modelValue'],
28
- data() {
29
- return {
30
- item: null,
31
- color: null,
32
- msg: null,
33
- error: false
34
- }
24
+ /**
25
+ * The model value to validate for uniqueness
26
+ * @type {String}
27
+ * @default null
28
+ */
29
+ modelValue: {
30
+ default: null,
31
+ type: String
35
32
  },
36
- methods: {
37
- check(e) {
38
- this.item = e
39
- this.error = true
40
- this.color = 'color-error-text'
41
- this.$emit('update:modelValue', this.item)
42
- if (this.item) {
43
- this.$axios.post(this.link, {
44
- 'unique_name': this.item
45
- }, {headers: this.headers})
46
- .then((res) => {
47
- if (res.data) {
48
- this.color = 'color-success-text'
49
- this.error = false
50
- this.msg = null
51
- }
52
- }, (res) => {
53
- this.msg = this.$t(res.response.data.msg)
54
- this.color = 'color-error-text'
55
- this.error = true
56
- })
57
- } else {
58
- this.error = false
59
- this.color = ''
60
- }
61
- }
33
+ /**
34
+ * Additional headers for the validation request
35
+ * @type {Object}
36
+ */
37
+ headers: Object
38
+ })
39
+
40
+ const emit = defineEmits([
41
+ /**
42
+ * Emitted when the value changes
43
+ * @param {String} value - The updated value
44
+ */
45
+ 'update:modelValue'
46
+ ])
47
+
48
+ // Inject dependencies
49
+ const $axios = inject('axios')
50
+ const $t = inject('renusify').$t
51
+
52
+ // Reactive data
53
+ const item = ref(props.modelValue)
54
+ const color = ref(null)
55
+ const msg = ref(null)
56
+ const error = ref(false)
57
+ const isLoading = ref(false)
58
+
59
+ // Methods
60
+ /**
61
+ * Validates the input value for uniqueness against the API
62
+ * @param {String} value - The value to validate
63
+ */
64
+ const check = (value) => {
65
+ item.value = value
66
+ error.value = true
67
+ color.value = 'color-error-text'
68
+
69
+ emit('update:modelValue', item.value)
70
+
71
+ if (item.value) {
72
+ isLoading.value = true
73
+
74
+ $axios.post(props.link, {
75
+ 'unique_name': item.value
76
+ }, {headers: props.headers})
77
+ .then((res) => {
78
+ if (res.data) {
79
+ color.value = 'color-success-text'
80
+ error.value = false
81
+ msg.value = null
82
+ } else {
83
+ color.value = 'color-error-text'
84
+ error.value = true
85
+ msg.value = $t('validation.unique')
86
+ }
87
+ })
88
+ .catch((errorResponse) => {
89
+ color.value = 'color-error-text'
90
+ error.value = true
91
+
92
+ const errorMsg = errorResponse?.response?.data?.msg ||
93
+ 'Validation failed'
94
+
95
+ msg.value = $t(errorMsg)
96
+
97
+ console.error('Unique validation error:', errorResponse)
98
+ })
99
+ .finally(() => {
100
+ isLoading.value = false
101
+ })
102
+ } else {
103
+ error.value = false
104
+ color.value = ''
105
+ msg.value = null
62
106
  }
63
107
  }
108
+
109
+ // Initialize validation if modelValue exists
110
+ if (props.modelValue) {
111
+ check(props.modelValue)
112
+ }
113
+
114
+ // Watchers
115
+ watch(() => props.modelValue, (newValue) => {
116
+ if (newValue !== item.value) {
117
+ item.value = newValue
118
+ check(newValue)
119
+ }
120
+ })
64
121
  </script>
@@ -2,116 +2,171 @@
2
2
  <r-input :class="`${$r.prefix}unit-input`" :active="active"
3
3
  :model-value="lazyValue"
4
4
  @click.prevent="handleClick">
5
- <input :autofocus="autofocus"
6
- :type="type"
7
- @focusin="active=true"
8
- @focusout="active=false"
9
- @input="emit"
10
- autocomplete="no"
11
- ref="input"
12
- v-model="lazyValue"
13
- :readonly="disableInput"
14
- :class="{'input-shadow':disableInput}"
15
- class="me-1"
16
- />
17
- <div class="select-unit" :class="{'input-shadow':disableUnit}">
18
- <r-select-input :readonly="disableUnit" :items="units" v-model="unit"
19
- @update:model-value="emit" hide justValue :translate="translate"
20
- class="mt-0"
21
- disableSearch
22
- firstSelect></r-select-input>
5
+ <div class="d-flex v-center">
6
+ <input ref="inputRef"
7
+ :autofocus="$attrs.autofocus"
8
+ :type="type"
9
+ @focusin="active=true"
10
+ @focusout="active=false"
11
+ :placeholder="$attrs.placeholder"
12
+ autocomplete="no"
13
+ @input="emitValue"
14
+ v-model="lazyValue"
15
+ :readonly="disableInput"
16
+ :class="{'input-shadow':disableInput}"
17
+ class="me-1"
18
+ />
19
+ <div class="select-unit" :class="{'input-shadow':disableUnit}">
20
+ <r-select-input :readonly="disableUnit" :items="units" v-model="unit"
21
+ :translate="translate" hide justValue @update:model-value="emitValue"
22
+ class="mt-0"
23
+ disableSearch
24
+ firstSelect></r-select-input>
25
+ </div>
23
26
  </div>
24
27
  </r-input>
25
28
  </template>
26
- <script>
27
- export default {
28
- name: 'r-unit-input',
29
- props: {
30
- type: {
31
- type: String,
32
- default: 'text'
33
- },
34
- units: {
35
- type: Array,
36
- required: true
37
- },
38
- modelValue: {
39
- type: Object, default: () => {
40
- return {
41
- value: null,
42
- unit: null
43
- }
44
- }
45
- },
46
- disableInput: Boolean,
47
- disableUnit: Boolean,
48
- autofocus: Boolean,
49
- translate: Boolean
29
+ <script setup>
30
+ import {ref, watch, computed} from 'vue'
31
+
32
+ const props = defineProps({
33
+ /**
34
+ * Input type (text, number, etc.)
35
+ * @type {String}
36
+ * @default 'text'
37
+ */
38
+ type: {
39
+ type: String,
40
+ default: 'text'
50
41
  },
51
- emits:['update:modelValue'],
52
- data() {
53
- return {
54
- lazyValue: this.modelValue ? this.modelValue.value : null,
55
- active: false,
56
- unit: this.modelValue ? this.modelValue.unit : null
57
- }
42
+ /**
43
+ * Array of available unit options
44
+ * @type {Array}
45
+ * @required
46
+ */
47
+ units: {
48
+ type: Array,
49
+ required: true
58
50
  },
59
- watch: {
60
- modelValue() {
61
- this.lazyValue = this.modelValue.value
62
- this.unit = this.modelValue.unit
63
- }
51
+ /**
52
+ * The model value object containing value and unit
53
+ * @type {Object}
54
+ * @default () => ({ value: null, unit: null })
55
+ */
56
+ modelValue: {
57
+ type: Object,
58
+ default: () => ({
59
+ value: null,
60
+ unit: null
61
+ })
64
62
  },
65
- methods: {
66
- handleClick(e) {
67
- this.$refs.input.focus()
68
- },
69
- emit() {
70
- if (this.unit === null) {
71
- this.unit = this.units[0]
72
- }
73
- this.$emit('update:modelValue', {value: this.lazyValue, unit: this.unit})
74
- }
63
+ /**
64
+ * Disable the value input field
65
+ * @type {Boolean}
66
+ */
67
+ disableInput: Boolean,
68
+ /**
69
+ * Disable the unit selector
70
+ * @type {Boolean}
71
+ */
72
+ disableUnit: Boolean,
73
+ /**
74
+ * Enable translation for unit labels
75
+ * @type {Boolean}
76
+ */
77
+ translate: Boolean
78
+ })
79
+
80
+ const emit = defineEmits([
81
+ /**
82
+ * Emitted when the value or unit changes
83
+ * @param {Object} value - The updated object with value and unit properties
84
+ */
85
+ 'update:modelValue'
86
+ ])
87
+
88
+ // Reactive data
89
+ const lazyValue = ref(props.modelValue?.value ?? null)
90
+ const active = ref(false)
91
+ const unit = ref(props.modelValue?.unit ?? null)
92
+ const inputRef = ref(null)
93
+
94
+ // Computed properties
95
+ /**
96
+ * Gets the currently selected unit or defaults to first unit in array
97
+ * @returns {any|null} The selected unit
98
+ */
99
+ const selectedUnit = computed(() => {
100
+ return unit.value || (props.units.length > 0 ? props.units[0] : null)
101
+ })
102
+
103
+ // Methods
104
+ /**
105
+ * Focuses the input element
106
+ */
107
+ const handleClick = () => {
108
+ inputRef.value?.focus()
109
+ }
110
+
111
+ /**
112
+ * Emits the updated value and unit to the parent component
113
+ */
114
+ const emitValue = () => {
115
+ const value = {
116
+ value: lazyValue.value,
117
+ unit: selectedUnit.value
75
118
  }
119
+
120
+ emit('update:modelValue', value)
76
121
  }
77
122
 
123
+ // Watchers
124
+ watch(() => props.modelValue, (newValue) => {
125
+ if (newValue) {
126
+ lazyValue.value = newValue.value ?? null
127
+ unit.value = newValue.unit ?? null
128
+ } else {
129
+ lazyValue.value = null
130
+ unit.value = null
131
+ }
132
+ }, {deep: true})
78
133
  </script>
134
+
79
135
  <style lang="scss">
80
- @use "../../../style/variables/base";
81
- @use "../../../style/mixins";
82
- @use "../../../style/functions";
136
+ @use "../../../style" as *;
83
137
 
84
- .#{base.$prefix}unit-input {
138
+ .#{$prefix}unit-input {
85
139
  .input-shadow, .input-shadow * {
86
- @include mixins.disable-states()
140
+ @include disable-states()
87
141
  }
88
142
 
89
- input {
90
- width: calc(65% - 4px);
143
+ > .input-control {
144
+ @include rtl() {
145
+ padding-left: 0;
146
+ }
147
+ @include ltr() {
148
+ padding-right: 0;
149
+ }
91
150
  }
92
151
 
93
-
94
- --c-unit: var(--color-sheet-low);
95
-
152
+ input {
153
+ flex-grow: 1;
154
+ }
96
155
 
97
156
  .select-unit {
98
157
  width: calc(35% + 16px);
99
158
  overflow-x: clip;
100
159
 
101
- * {
102
- font-size: functions.map-metro-get(base.$headings, 'label-3', 'size') !important;
160
+ @include rtl() {
161
+ border-right: 1px solid var(--color-border-low);
162
+ }
163
+
164
+ @include ltr() {
165
+ border-left: 1px solid var(--color-border-low);
103
166
  }
104
167
 
105
168
  .input-control {
106
- border-radius: 0;
107
169
  padding: 4px;
108
- @include mixins.rtl() {
109
- border-right: 1px solid var(--c-unit) !important;
110
- }
111
-
112
- @include mixins.ltr() {
113
- border-left: 1px solid var(--c-unit) !important;
114
- }
115
170
  }
116
171
 
117
172
 
@@ -4,5 +4,4 @@ export * as l_card from '../card/index.js'
4
4
  export * as l_container from '../container/index.js'
5
5
  export * as l_row from '../container/row.js'
6
6
  export * as l_col from '../container/col.js'
7
- export * as l_message from '../message/index.js'
8
7
  export * as l_form from '../form/index.js'