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
@@ -0,0 +1,150 @@
1
+ export function useCodeFormatter() {
2
+ const pretty_html = (text) => {
3
+ if (!text) {
4
+ return ''
5
+ }
6
+ text = text.trim()
7
+ text = text.replace(/ +(?= )/g, '');
8
+ text = text.replace(/[\r\n\t]/g, '');
9
+ let r = ''
10
+ text = text.split('<')
11
+ let numopen = 0
12
+ text.forEach((line) => {
13
+ if (line) {
14
+ const end = line.startsWith('/')
15
+ if (end) {
16
+ numopen -= 1
17
+ }
18
+ r += '\t'.repeat(numopen) + '<' + line + '\n'
19
+ if (!end) {
20
+ numopen += 1
21
+ }
22
+ }
23
+ })
24
+ r = r.replace(/<([^/].*)>+[\r\n\t]+<\//g, '<$1></');
25
+ return r
26
+ }
27
+
28
+ const pretty_js = (text) => {
29
+ if (!text) {
30
+ return ''
31
+ }
32
+ text = text.trim()
33
+ text = text.replace(/ +(?= )/g, '');
34
+ text = text.replace(/[\r\n\t]/g, '');
35
+ text = text.replace(/([,;{(\[])+[\s]/g, '$1');
36
+ let r = ''
37
+ text = text.split('')
38
+ let numopen = 0
39
+ const textLength = text.length
40
+ let inBracket = 0
41
+ let inprantez = 0
42
+ for (let i = 0; i < textLength; i++) {
43
+ const c = text[i]
44
+ const last = i > 0 ? text[i - 1] : ''
45
+ const next = i < textLength - 1 ? text[i + 1] : ''
46
+
47
+ if (c === '(') {
48
+ inprantez += 1
49
+ }
50
+ if (c === ')') {
51
+ inprantez -= 1
52
+ }
53
+ if (c === '[') {
54
+ inBracket += 1
55
+ }
56
+ if (c === ']') {
57
+ inBracket -= 1
58
+ }
59
+ if (c === '}') {
60
+ numopen -= 1
61
+ }
62
+ if (numopen < 0) {
63
+ numopen = 0
64
+ }
65
+ r += c
66
+ if (c === '}' && next !== ',' && next !== ';' && next !== '}' && next !== ')') {
67
+ r += '\n' + '\t'.repeat(numopen)
68
+ }
69
+ if (c === ',' && (!inprantez && !inBracket) && next !== '}') {
70
+ r += '\n' + '\t'.repeat(numopen)
71
+ }
72
+ if (c === ';' && next !== '}') {
73
+ r += '\n' + '\t'.repeat(numopen)
74
+ }
75
+ if (next === '}' && c !== '{' && numopen > 0) {
76
+ r += '\n' + '\t'.repeat(numopen - 1)
77
+ }
78
+
79
+ if (c === '{') {
80
+ numopen += 1
81
+ if (next !== '}') {
82
+ r += '\n' + '\t'.repeat(numopen)
83
+ }
84
+ }
85
+ }
86
+ r = r.replace(/\t /g, '\t');
87
+ r = r.replace(/^\s*\n/gm, '');
88
+ return r
89
+ }
90
+
91
+ const setTab = (event) => {
92
+ if (event.key === "'" || event.key === '"' || event.key === '`') {
93
+ const end = event.target.selectionEnd;
94
+ event.preventDefault()
95
+ document.execCommand('insertText', false, event.key.repeat(2));
96
+ event.target.selectionEnd = end + 1;
97
+ return false;
98
+ }
99
+ if (event.key === "{") {
100
+ const end = event.target.selectionEnd;
101
+ event.preventDefault()
102
+ document.execCommand('insertText', false, '{}');
103
+ event.target.selectionEnd = end + 1;
104
+ return false;
105
+ }
106
+ if (event.key === "(") {
107
+ const end = event.target.selectionEnd;
108
+ event.preventDefault()
109
+ document.execCommand('insertText', false, '()');
110
+ event.target.selectionEnd = end + 1;
111
+ return false;
112
+ }
113
+ if (event.key === "[") {
114
+ const end = event.target.selectionEnd;
115
+ event.preventDefault()
116
+ document.execCommand('insertText', false, '[]');
117
+ event.target.selectionEnd = end + 1;
118
+ return false;
119
+ }
120
+ if (event.keyCode === 9) {
121
+ event.preventDefault()
122
+ document.execCommand('insertText', false, '\t');
123
+ return false;
124
+ }
125
+ if (event.keyCode === 13) {
126
+ event.preventDefault()
127
+ let n = event.target.value.substr(0, event.target.selectionStart).split('\n')
128
+ n = n[n.length - 1].split('\t')
129
+
130
+ let w = ''
131
+ for (let i = 0; i < n.length; i++) {
132
+ if (n[i] === '') {
133
+ w += '\t'
134
+ } else {
135
+ break
136
+ }
137
+ }
138
+
139
+ document.execCommand('insertText', false, '\n' + w);
140
+ return false;
141
+ }
142
+ return true
143
+ }
144
+
145
+ return {
146
+ pretty_html,
147
+ pretty_js,
148
+ setTab
149
+ }
150
+ }
@@ -1,88 +1,147 @@
1
1
  <template>
2
- <r-modal :closebtn="false" :model-value="modelValue">
3
- <r-container class="container-fluid">
4
- <r-row>
5
- <r-col class="col-12 text-center">
6
- <h2 class="title-1">
7
- {{ title || $t('confirm_title', 'renusify') }}
8
- </h2>
9
- <r-divider class="my-3 color-warning"></r-divider>
10
- </r-col>
11
- <r-col class="col-12">
12
- {{text||$t('confirm_body','renusify')}}
13
- </r-col>
14
- <r-col class="col-12 mb-2 pt-0" v-if="hard">
15
- <r-form v-model="valid">
16
- <r-text-input :label="$t(['confirm_code',[inputKey]],'renusify')"
17
- :rules="['required','match:'+inputKey]"
18
- v-model.number="inputVal"></r-text-input>
19
- </r-form>
20
- </r-col>
21
- </r-row>
22
- <r-row class="h-end no-gutters">
23
- <r-btn :loading="this.loading"
24
- @click.stop="cancel"
25
- class="color-error-text mx-1"
26
- outlined
27
- rounded
28
- v-if="!this.loading">
29
- {{cancelText||$t('cancel','renusify')}}
30
- </r-btn>
31
- <r-btn :disabled="hard&&!valid"
32
- :loading="this.loading"
33
- @click.stop="confirm"
34
- class="color-success-text"
35
- outlined
36
- rounded>{{confirmText||$t('accept','renusify')}}
37
- </r-btn>
38
- </r-row>
39
- </r-container>
2
+ <r-modal :model-value="modelValue" no-close-btn>
3
+ <r-container class="container-fluid">
4
+ <r-row>
5
+ <r-col class="col-12 text-center">
6
+ <h2 class="title-1">
7
+ {{ title || $t('confirm_title', 'renusify') }}
8
+ </h2>
9
+ <r-divider class="my-3 color-warning"></r-divider>
10
+ </r-col>
11
+ <r-col class="col-12">
12
+ {{ text || $t('confirm_body', 'renusify') }}
13
+ </r-col>
14
+ <r-col class="col-12 mb-2 pt-0" v-if="hard">
15
+ <r-form v-model="valid">
16
+ <r-text-input :label="$t(['confirm_code',[inputKey]],'renusify')"
17
+ :rules="['required','match:'+inputKey]"
18
+ v-model.number="inputVal"></r-text-input>
19
+ </r-form>
20
+ </r-col>
21
+ </r-row>
22
+ <r-row class="h-end no-gutters">
23
+ <r-btn :loading="this.loading"
24
+ @click.stop="cancel"
25
+ class="color-error-text mx-1"
26
+ outlined
27
+ rounded
28
+ v-if="!this.loading">
29
+ {{ cancelText || $t('cancel', 'renusify') }}
30
+ </r-btn>
31
+ <r-btn :disabled="hard&&!valid"
32
+ :loading="this.loading"
33
+ @click.stop="confirm"
34
+ class="color-success-text"
35
+ outlined
36
+ rounded>{{ confirmText || $t('accept', 'renusify') }}
37
+ </r-btn>
38
+ </r-row>
39
+ </r-container>
40
40
  </r-modal>
41
41
  </template>
42
42
 
43
- <script>
44
- export default {
45
- name: 'r-confirm',
46
- props: {
47
- title: String,
48
- text: String,
49
- cancelText: String,
50
- confirmText: String,
51
- modelValue: Boolean,
52
- hard: Boolean
53
- },
54
- emits:['accept','cancel'],
55
- data () {
56
- return {
57
- valid: false,
58
- inputVal: null,
59
- inputKey: null,
60
- loading: false
61
- }
62
- },
63
- watch: {
64
- modelValue: function () {
65
- this.resetState()
66
- }
67
- },
68
- methods: {
69
- resetState () {
70
- this.inputKey = this.$helper.randomInt(10, 99)
71
- this.inputVal = null
72
- this.loading = false
73
- },
74
- confirm () {
75
- if (this.hard && (this.inputKey !== this.inputVal)) {
76
- this.cancel()
77
- } else {
78
- this.loading = true
79
- this.$emit('accept')
80
- }
81
- },
82
- cancel () {
83
- this.loading = true
84
- this.$emit('cancel')
85
- }
43
+ <script setup>
44
+ import {ref, watch, inject} from 'vue'
45
+
46
+ const props = defineProps({
47
+ /**
48
+ * Dialog title text
49
+ * @type {String}
50
+ */
51
+ title: String,
52
+
53
+ /**
54
+ * Dialog message text
55
+ * @type {String}
56
+ */
57
+ text: String,
58
+
59
+ /**
60
+ * Cancel button text
61
+ * @type {String}
62
+ */
63
+ cancelText: String,
64
+
65
+ /**
66
+ * Confirm button text
67
+ * @type {String}
68
+ */
69
+ confirmText: String,
70
+
71
+ /**
72
+ * Controls dialog visibility
73
+ * @type {Boolean}
74
+ */
75
+ modelValue: Boolean,
76
+
77
+ /**
78
+ * Enables hard confirmation requiring user to type a verification code
79
+ * @type {Boolean}
80
+ */
81
+ hard: Boolean
82
+ })
83
+
84
+ const emit = defineEmits([
85
+ /**
86
+ * Emitted when user confirms the dialog
87
+ */
88
+ 'accept',
89
+
90
+ /**
91
+ * Emitted when user cancels the dialog
92
+ */
93
+ 'cancel',
94
+
95
+ /**
96
+ * Emitted when dialog visibility should be updated
97
+ * @param {Boolean} value - New visibility state
98
+ */
99
+ 'update:modelValue'
100
+ ])
101
+
102
+ const $helper = inject('renusify').$helper
103
+
104
+ const valid = ref(false)
105
+ const inputVal = ref(null)
106
+ const inputKey = ref(null)
107
+ const loading = ref(false)
108
+
109
+ /**
110
+ * Resets dialog state to initial values
111
+ */
112
+ const resetState = () => {
113
+ inputKey.value = $helper?.randomInt(10, 99) || Math.floor(Math.random() * 90) + 10
114
+ inputVal.value = null
115
+ loading.value = false
116
+ }
117
+
118
+ /**
119
+ * Handles confirmation action
120
+ */
121
+ const confirm = () => {
122
+ if (props.hard && (inputKey.value !== inputVal.value)) {
123
+ cancel()
124
+ } else {
125
+ loading.value = true
126
+ emit('accept')
127
+ }
128
+ }
129
+
130
+ /**
131
+ * Handles cancellation action
132
+ */
133
+ const cancel = () => {
134
+ loading.value = true
135
+ emit('cancel')
136
+ }
137
+
138
+ watch(() => props.modelValue, (newValue) => {
139
+ if (newValue) {
140
+ resetState()
86
141
  }
142
+ })
143
+
144
+ if (props.modelValue) {
145
+ resetState()
87
146
  }
88
147
  </script>
@@ -1,11 +1,12 @@
1
1
  <template>
2
2
  <div class="col">
3
+ <!-- Default slot for column content
4
+ @example <div class="color-info">column</div>
5
+ -->
3
6
  <slot></slot>
4
7
  </div>
5
8
  </template>
6
9
 
7
- <script>
8
- export default {
9
- name: 'r-col'
10
- }
10
+ <script setup>
11
+
11
12
  </script>
@@ -2,24 +2,33 @@
2
2
  <hr :class="classes"/>
3
3
  </template>
4
4
 
5
- <script>
6
- export default {
7
- name: 'r-divider',
8
- props: {
9
- inset: Boolean,
10
- vertical: Boolean
11
- },
12
- computed: {
13
- classes () {
14
- let c = this.$r.prefix+'divider'
15
- if (this.inset) {
16
- c += ' divider-inset'
17
- }
18
- if (this.vertical) {
19
- c += ' divider-vertical'
20
- }
21
- return c
22
- }
5
+ <script setup>
6
+ import {computed, inject} from 'vue'
7
+
8
+ const props = defineProps({
9
+ /**
10
+ * Adds inset padding to the divider
11
+ * @type {Boolean}
12
+ */
13
+ inset: Boolean,
14
+
15
+ /**
16
+ * Makes the divider vertical instead of horizontal
17
+ * @type {Boolean}
18
+ */
19
+ vertical: Boolean
20
+ })
21
+
22
+ const $r = inject('renusify').$r
23
+
24
+ const classes = computed(() => {
25
+ let c = [$r.prefix + 'divider']
26
+ if (props.inset) {
27
+ c.push('divider-inset')
28
+ }
29
+ if (props.vertical) {
30
+ c.push('divider-vertical')
23
31
  }
24
- }
32
+ return c
33
+ })
25
34
  </script>
@@ -1,24 +1,43 @@
1
1
  <template>
2
2
  <div :class="classes">
3
+ <!-- Default slot for container content
4
+ @example
5
+ <r-row>
6
+ <r-col class="col-4"> col-1</r-col>
7
+ <r-col class="col-4"> col-2</r-col>
8
+ <r-col class="col-4"> col-3</r-col>
9
+ </r-row>
10
+ -->
3
11
  <slot></slot>
4
12
  </div>
5
13
  </template>
6
14
 
7
- <script>
15
+ <script setup>
16
+ import {computed, inject} from 'vue'
8
17
  import './style.scss'
9
18
 
10
- export default {
11
- name: 'r-container',
12
- props: {
13
- fullWidth: Boolean,
14
- fill: Boolean
15
- },
16
- computed:{
17
- classes(){
18
- let a={'container-fluid':this.fullWidth,'fill':this.fill}
19
- a[`${this.$r.prefix}container`]=true
20
- return a
21
- }
19
+ const props = defineProps({
20
+ /**
21
+ * Makes container full width (fluid)
22
+ * @type {Boolean}
23
+ */
24
+ fullWidth: Boolean,
25
+
26
+ /**
27
+ * Makes container fill available height
28
+ * @type {Boolean}
29
+ */
30
+ fill: Boolean
31
+ })
32
+
33
+ const {$r} = inject('renusify')
34
+
35
+ const classes = computed(() => {
36
+ const prefix = $r.prefix || 'r-'
37
+ return {
38
+ 'container-fluid': props.fullWidth,
39
+ 'fill': props.fill,
40
+ [`${prefix}container`]: true
22
41
  }
23
- }
24
- </script>
42
+ })
43
+ </script>
@@ -1,16 +1,33 @@
1
1
  <template>
2
2
  <section :class="{'row-dense':dense,'no-gutters':noGutters,'row-grid':grid}" class="row">
3
+ <!-- Default slot for row content
4
+ @example
5
+ <r-col class="col-4"> col-1</r-col>
6
+ <r-col class="col-4"> col-2</r-col>
7
+ <r-col class="col-4"> col-3</r-col>
8
+ -->
3
9
  <slot></slot>
4
10
  </section>
5
11
  </template>
6
12
 
7
- <script>
8
- export default {
9
- name: 'r-row',
10
- props:{
11
- dense:Boolean,
12
- grid: Boolean,
13
- noGutters:Boolean
14
- }
15
- }
13
+ <script setup>
14
+ defineProps({
15
+ /**
16
+ * Reduces spacing between grid items
17
+ * @type {Boolean}
18
+ */
19
+ dense: Boolean,
20
+
21
+ /**
22
+ * Enables grid layout mode
23
+ * @type {Boolean}
24
+ */
25
+ grid: Boolean,
26
+
27
+ /**
28
+ * Removes gutters (padding) between grid items
29
+ * @type {Boolean}
30
+ */
31
+ noGutters: Boolean
32
+ })
16
33
  </script>
@@ -1,11 +1,9 @@
1
1
  <template>
2
2
  <div class="flex-grow-1">
3
+ <!-- Default slot for spacer content -->
3
4
  <slot></slot>
4
5
  </div>
5
6
  </template>
6
7
 
7
- <script>
8
- export default {
9
- name: 'r-spacer'
10
- }
8
+ <script setup>
11
9
  </script>
@@ -45,6 +45,9 @@
45
45
 
46
46
  &.row-grid {
47
47
  overflow: hidden;
48
+ margin-right: 0;
49
+ margin-left: 0;
50
+ border: 1px solid var(--color-border-low);
48
51
  }
49
52
 
50
53
  &.row-grid .col {
@@ -1,58 +1,75 @@
1
1
  <template>
2
- <main :class="{[$r.prefix+'content']:true,
3
- 'flipped':flipped,
4
- 'moved':moved,
5
- 'below-header':belowHeader}" :style="{'--belowHeader':belowHeader}">
2
+ <main :class="{
3
+ [$r.prefix+'content']:true,
4
+ 'flipped':flipped,
5
+ 'moved':moved,
6
+ 'below-header':belowHeader
7
+ }"
8
+ :style="{'--belowHeader':belowHeader}">
9
+ <!-- Default slot for main content
10
+ @example
11
+ <r-container>
12
+ <r-row>
13
+ <r-col class="col-4"> col-1</r-col>
14
+ <r-col class="col-4"> col-2</r-col>
15
+ <r-col class="col-4"> col-3</r-col>
16
+ </r-row>
17
+ </r-container>
18
+ -->
6
19
  <slot></slot>
7
20
  </main>
8
21
  </template>
9
22
 
10
- <script>
23
+ <script setup>
24
+ defineProps({
25
+ /**
26
+ * Adds content below the header
27
+ * @type {String}
28
+ */
29
+ belowHeader: String,
11
30
 
12
- export default {
13
- name: 'r-content',
14
- props: {
15
- belowHeader: String,
16
- flipped: Boolean,
17
- moved: Boolean
18
- }
19
- }
31
+ /**
32
+ * Flips the component orientation
33
+ * @type {Boolean}
34
+ */
35
+ flipped: Boolean,
36
+
37
+ /**
38
+ * Moves the component position
39
+ * @type {Boolean}
40
+ */
41
+ moved: Boolean
42
+ })
20
43
  </script>
21
44
 
22
45
  <style lang="scss">
23
46
  @use "sass:map";
24
- @use "../../style/variables/base";
25
- @use "../../style/mixins";
47
+ @use "../../style" as *;
26
48
 
27
49
 
28
- .#{base.$prefix}content {
29
- --belowHeader: #{base.$toolbar-height};
50
+ .#{$prefix}content {
51
+ --belowHeader: 80px;
30
52
  width: 100%;
31
53
  max-width: 100%;
32
- transition: 0.2s map.get(base.$transition, 'fast-out-slow-in');
54
+ transition: 0.2s map.get($transition, 'fast-out-slow-in');
33
55
  position: relative;
34
- @include mixins.firefox() {
35
- @media print {
36
- display: block
37
- }
38
- }
39
56
 
40
57
  &.flipped {
41
- @include mixins.rtl() {
42
- padding-right: base.$navbar-width;
58
+ @include rtl() {
59
+ padding-right: 300px;
43
60
  }
44
- @include mixins.ltr() {
45
- padding-left: base.$navbar-width;
61
+ @include ltr() {
62
+ padding-left: 300px;
46
63
  }
47
64
  }
48
65
 
49
66
  &.moved {
50
- width: calc(100% + #{base.$navbar-width});
51
- @include mixins.rtl() {
52
- margin-right: base.$navbar-width;
67
+ width: calc(100% + 300px);
68
+ @include rtl() {
69
+ margin-right: 300px;
53
70
  }
54
- @include mixins.ltr() {
55
- margin-left: base.$navbar-width;
71
+ @include ltr() {
72
+ margin-left: 300px;
56
73
  }
57
74
  }
58
75