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.
- package/components/app/index.vue +74 -22
- package/components/app/toast/index.vue +76 -71
- package/components/app/toast/toast.vue +62 -44
- package/components/avatar/index.vue +208 -84
- package/components/button/buttonConfirm.vue +53 -26
- package/components/button/buttonGroup.js +0 -2
- package/components/button/buttonGroup.vue +310 -62
- package/components/button/index.vue +584 -100
- package/components/calendar/index.js +0 -2
- package/components/calendar/index.vue +326 -262
- package/components/calendar/month.vue +64 -55
- package/components/calendar/year.vue +30 -25
- package/components/card/index.vue +139 -59
- package/components/codeEditor/highlightCss.vue +38 -39
- package/components/codeEditor/highlightHtml.vue +64 -64
- package/components/codeEditor/highlightJs.vue +37 -38
- package/components/codeEditor/index.vue +129 -79
- package/components/codeEditor/run.vue +225 -39
- package/components/codeEditor/useCodeFormatter.js +150 -0
- package/components/confirm/index.vue +139 -80
- package/components/container/col.vue +5 -4
- package/components/container/divider.vue +28 -19
- package/components/container/index.vue +34 -15
- package/components/container/row.vue +26 -9
- package/components/container/spacer.vue +2 -4
- package/components/container/style.scss +3 -0
- package/components/content/index.vue +49 -32
- package/components/cropper/index.vue +401 -244
- package/components/float/index.vue +542 -415
- package/components/form/addressInput/index.vue +184 -109
- package/components/form/camInput/index.vue +370 -244
- package/components/form/checkInput/index.vue +138 -71
- package/components/form/checkboxInput/index.vue +87 -47
- package/components/form/colorInput/Alpha.vue +81 -83
- package/components/form/colorInput/Hue.vue +91 -68
- package/components/form/colorInput/Preview.vue +43 -47
- package/components/form/colorInput/Saturation.vue +101 -86
- package/components/form/colorInput/index.vue +71 -39
- package/components/form/colorInput/picker.vue +111 -106
- package/components/form/colorInput/useColor.js +153 -0
- package/components/form/dateInput/index.vue +691 -356
- package/components/form/dateInput/month.vue +63 -54
- package/components/form/dateInput/year.vue +35 -25
- package/components/form/fileInput/index.js +0 -1
- package/components/form/fileInput/index.vue +263 -106
- package/components/form/fileInput/single.vue +323 -164
- package/components/form/groupInput/index.vue +199 -101
- package/components/form/index.vue +189 -83
- package/components/form/input/index.vue +416 -377
- package/components/form/jsonInput/JsonView.vue +54 -56
- package/components/form/jsonInput/index.vue +247 -165
- package/components/form/maskInput/index.vue +252 -132
- package/components/form/numberInput/index.js +0 -1
- package/components/form/numberInput/index.vue +226 -117
- package/components/form/passwordInput/index.js +2 -1
- package/components/form/passwordInput/index.vue +269 -102
- package/components/form/radioInput/index.vue +143 -72
- package/components/form/rangeInput/index.vue +280 -167
- package/components/form/ratingInput/index.vue +57 -57
- package/components/form/selectInput/index.js +1 -3
- package/components/form/selectInput/index.vue +584 -296
- package/components/form/switchInput/index.vue +73 -59
- package/components/form/telInput/index.js +0 -1
- package/components/form/telInput/index.vue +238 -135
- package/components/form/textArea/index.vue +72 -35
- package/components/form/textEditor/index.vue +739 -0
- package/components/form/{text-editor → textEditor}/style.scss +8 -16
- package/components/form/textInput/index.vue +54 -32
- package/components/form/timeInput/index.vue +82 -55
- package/components/form/timeInput/range.vue +115 -94
- package/components/form/timeInput/timepicker.vue +382 -449
- package/components/form/uniqueInput/index.vue +105 -48
- package/components/form/unitInput/index.vue +139 -84
- package/components/formCreator/index.js +0 -1
- package/components/formCreator/index.vue +314 -148
- package/components/highlight/index.vue +41 -25
- package/components/highlight/style.scss +2 -2
- package/components/highlight/{mixin.js → useHighlight.js} +181 -160
- package/components/icon/index.vue +79 -33
- package/components/img/index.vue +249 -147
- package/components/img/preview.vue +180 -198
- package/components/img/svgImg.vue +42 -39
- package/components/index.js +5 -20
- package/components/infinite/index.js +1 -2
- package/components/infinite/index.vue +248 -66
- package/components/map/index.vue +428 -261
- package/components/map/route.vue +794 -487
- package/components/map/select.vue +118 -58
- package/components/menu/index.vue +201 -91
- package/components/meta/meta.js +26 -3
- package/components/modal/index.vue +382 -156
- package/components/notify/index.vue +204 -86
- package/components/notify/notification.vue +38 -55
- package/components/progress/circle.vue +189 -70
- package/components/progress/line.vue +266 -46
- package/components/searchBox/index.js +1 -3
- package/components/searchBox/index.vue +194 -101
- package/components/skeleton/index.vue +45 -20
- package/components/slider/index.vue +318 -156
- package/components/swiper/index.vue +254 -106
- package/components/table/crud/footer.vue +77 -53
- package/components/table/crud/header.vue +71 -72
- package/components/table/crud/index.vue +629 -399
- package/components/table/index.vue +721 -278
- package/components/timeAgo/index.vue +145 -96
- package/components/tour/index.vue +338 -235
- package/components/tree/index.vue +235 -89
- package/components/tree/tree-element.vue +106 -106
- package/directive/animate/index.js +77 -0
- package/directive/clickOutSide/index.js +98 -0
- package/directive/drag/index.js +153 -0
- package/directive/index.js +11 -13
- package/directive/intersect/index.js +263 -0
- package/directive/mask/index.js +67 -0
- package/directive/parallax/index.js +78 -0
- package/directive/ripple/index.js +14 -0
- package/directive/scroll/index.js +244 -0
- package/directive/sortable/index.js +274 -0
- package/directive/title/index.js +75 -0
- package/directive/touch/index.js +268 -0
- package/index.js +10 -8
- package/package.json +5 -2
- package/plugins/validation/Validate.js +88 -79
- package/scripts/generate-docs.mjs +226 -0
- package/scripts/menu.mjs +240 -0
- package/scripts/parser.mjs +1086 -0
- package/style/_index.scss +7 -0
- package/style/app.scss +13 -65
- package/style/colors.scss +5 -22
- package/style/functions/index.scss +8 -0
- package/style/mixins/index.scss +17 -5
- package/style/variables/base.scss +154 -175
- package/style/variables/color.scss +0 -12
- package/style/variables/utilities.scss +0 -180
- package/tools/helper.js +0 -8
- package/tools/icons.js +6 -1
- package/tools/root.js +71 -0
- package/components/app/style.scss +0 -41
- package/components/app/toast/style.scss +0 -20
- package/components/avatar/style.scss +0 -32
- package/components/bar/bottomNav.js +0 -1
- package/components/bar/bottomNav.vue +0 -28
- package/components/bar/bottomNavigationCircle.js +0 -2
- package/components/bar/bottomNavigationCircle.vue +0 -99
- package/components/bar/scss/bottomNav.scss +0 -67
- package/components/bar/scss/toolbar.scss +0 -174
- package/components/bar/toolbar/index.js +0 -8
- package/components/bar/toolbar/index.vue +0 -35
- package/components/bar/toolbar/laptop.vue +0 -33
- package/components/bar/toolbar/menuChilds.vue +0 -41
- package/components/bar/toolbar/menuLaptop.vue +0 -41
- package/components/bar/toolbar/menuMob.vue +0 -39
- package/components/bar/toolbar/mixin.js +0 -43
- package/components/bar/toolbar/mobile.vue +0 -34
- package/components/breadcrumb/bredcrumbItem.vue +0 -39
- package/components/breadcrumb/index.js +0 -3
- package/components/breadcrumb/index.vue +0 -71
- package/components/breadcrumb/style.scss +0 -51
- package/components/button/style.scss +0 -411
- package/components/card/style.scss +0 -86
- package/components/chart/chart.js +0 -1
- package/components/chart/chart.vue +0 -69
- package/components/chart/worldMap.js +0 -2
- package/components/chart/worldMap.vue +0 -1112
- package/components/chat/MessageList.vue +0 -163
- package/components/chat/chatInput.vue +0 -150
- package/components/chat/chatMsg.vue +0 -276
- package/components/chat/index.js +0 -11
- package/components/chat/index.vue +0 -113
- package/components/chip/index.js +0 -3
- package/components/chip/index.vue +0 -77
- package/components/chip/style.scss +0 -199
- package/components/codeEditor/mixin.js +0 -145
- package/components/countdown/index.js +0 -1
- package/components/countdown/index.vue +0 -105
- package/components/form/colorInput/mixin.js +0 -132
- package/components/form/fileInput/file.js +0 -148
- package/components/form/telInput/assets/flags.png +0 -0
- package/components/form/telInput/assets/flags@2x.png +0 -0
- package/components/form/text-editor/index.vue +0 -705
- package/components/icon/style.scss +0 -17
- package/components/infinite/div.js +0 -6
- package/components/infinite/div.vue +0 -193
- package/components/infinite/page.js +0 -3
- package/components/infinite/page.vue +0 -105
- package/components/list/index.js +0 -3
- package/components/list/index.vue +0 -122
- package/components/list/style.scss +0 -66
- package/components/message/index.js +0 -4
- package/components/message/index.vue +0 -40
- package/components/modal/style.scss +0 -146
- package/components/nestable/NestableItem.vue +0 -307
- package/components/nestable/editable.js +0 -44
- package/components/nestable/index.js +0 -1
- package/components/nestable/index.vue +0 -226
- package/components/nestable/methods.js +0 -416
- package/components/progress/style.scss +0 -229
- package/components/table/style.scss +0 -338
- package/components/tabs/index.js +0 -3
- package/components/tabs/index.vue +0 -151
- package/components/timeline/index.js +0 -6
- package/components/timeline/index.vue +0 -76
- package/directive/resize/index.js +0 -30
- package/directive/skeleton/index.js +0 -27
- package/directive/skeleton/style.scss +0 -37
- package/plugins/request/Request.js +0 -68
- package/style/animation.scss +0 -94
- package/style/style.scss +0 -8
- package/tools/rootable.js +0 -75
- /package/components/form/{text-editor → textEditor}/index.js +0 -0
- /package/components/form/{text-editor → textEditor}/preview.js +0 -0
- /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
2
|
<r-modal :model-value="modelValue" no-close-btn>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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,58 +1,75 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<main :class="{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
|
25
|
-
@use "../../style/mixins";
|
|
47
|
+
@use "../../style" as *;
|
|
26
48
|
|
|
27
49
|
|
|
28
|
-
.#{
|
|
29
|
-
--belowHeader:
|
|
50
|
+
.#{$prefix}content {
|
|
51
|
+
--belowHeader: 80px;
|
|
30
52
|
width: 100%;
|
|
31
53
|
max-width: 100%;
|
|
32
|
-
transition: 0.2s map.get(
|
|
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
|
|
42
|
-
padding-right:
|
|
58
|
+
@include rtl() {
|
|
59
|
+
padding-right: 300px;
|
|
43
60
|
}
|
|
44
|
-
@include
|
|
45
|
-
padding-left:
|
|
61
|
+
@include ltr() {
|
|
62
|
+
padding-left: 300px;
|
|
46
63
|
}
|
|
47
64
|
}
|
|
48
65
|
|
|
49
66
|
&.moved {
|
|
50
|
-
width: calc(100% +
|
|
51
|
-
@include
|
|
52
|
-
margin-right:
|
|
67
|
+
width: calc(100% + 300px);
|
|
68
|
+
@include rtl() {
|
|
69
|
+
margin-right: 300px;
|
|
53
70
|
}
|
|
54
|
-
@include
|
|
55
|
-
margin-left:
|
|
71
|
+
@include ltr() {
|
|
72
|
+
margin-left: 300px;
|
|
56
73
|
}
|
|
57
74
|
}
|
|
58
75
|
|