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
@@ -1,163 +0,0 @@
1
- <template>
2
- <div ref="containerMessage"
3
- v-scroll.window="handle" class="container-message-list">
4
- <div v-for="message in messages" :key="message._id" class="message-container">
5
- <r-chat-message :is-me="message.user_id===myself.id" :message="message" :user="message.user_id===myself.id?myself:participants[message.user_id]"
6
- @see="$emit('see', $event)"></r-chat-message>
7
- </div>
8
- </div>
9
- <transition v-if="!hideBottomBtn" name="scale">
10
- <r-btn v-if="!is_bottom" :label="newMsg.num" class="go-buttom" fab @click.prevent="goTo(newMsg.first_id)">
11
- <r-icon v-html="$r.icons.chevron_down"></r-icon>
12
- </r-btn>
13
- </transition>
14
- </template>
15
-
16
- <script>
17
-
18
- export default {
19
- emits: ["see"],
20
- props: {
21
- newMsg: {
22
- type: Object, default: () => {
23
- return {
24
- num: 0,
25
- first_id: null
26
- }
27
- }
28
- },
29
- hideBottomBtn: Boolean,
30
- messages: {type: Array,},
31
- myself: {type: Object},
32
- participants: {type: Object}
33
- },
34
- data() {
35
- return {
36
- timeout_id: null,
37
- timeout_scroll: null,
38
- is_bottom: false
39
- }
40
- },
41
- mounted() {
42
- setTimeout(() => {
43
- this.goTo(this.newMsg.first_id);
44
- }, 10)
45
- },
46
- watch: {
47
- messages: function (n, o) {
48
- clearTimeout(this.timeout_id)
49
- this.timeout_id = setTimeout(() => {
50
- const scrollDiv = this.$refs.containerMessage;
51
- const offset = scrollDiv.scrollHeight - scrollDiv.scrollTop - scrollDiv.clientHeight
52
- if (offset < 100 || o.length === 0) {
53
- this.goToBottom()
54
- }
55
- }, 300)
56
- }
57
- },
58
- methods: {
59
- handle(e) {
60
- clearTimeout(this.timeout_scroll)
61
- this.timeout_scroll = setTimeout(() => {
62
- const scrollDiv = this.$refs.containerMessage;
63
- const offset = scrollDiv.scrollHeight - scrollDiv.scrollTop - scrollDiv.clientHeight
64
- this.is_bottom = offset === 0;
65
- }, 100)
66
- },
67
- goTo(id) {
68
- let f = document.getElementById('msg-' + id)
69
- if (f) {
70
- this.hover(f)
71
- f = f.getBoundingClientRect()
72
- const scrollDiv = this.$refs.containerMessage;
73
- scrollDiv.scrollTop = scrollDiv.scrollTop - scrollDiv.clientHeight + f.top + f.height
74
- } else {
75
- this.goToBottom()
76
- }
77
- },
78
- hover(elm) {
79
- elm.classList.add('msg-select')
80
- setTimeout(() => {
81
- elm.classList.remove('msg-select')
82
- }, 2000)
83
- },
84
- goToBottom() {
85
- let scrollDiv = this.$refs.containerMessage;
86
- if (scrollDiv !== null) {
87
- scrollDiv.scrollTop = scrollDiv.scrollHeight;
88
- }
89
- }
90
- }
91
- }
92
- </script>
93
-
94
- <style lang="scss">
95
- @use "sass:map";
96
- @use "../../style/variables/base";
97
- @use "../../style/mixins";
98
-
99
-
100
- .#{base.$prefix}chat .container-message-list {
101
- scroll-behavior: smooth;
102
- flex: 1;
103
- overflow-y: scroll;
104
- overflow-x: hidden;
105
- display: flex;
106
- flex-direction: column;
107
- padding-bottom: 10px;
108
- max-height: 100%;
109
- /************** Safari 10.1+ ********************/
110
- @media not all and (min-resolution: .001dpcm) {
111
- @supports (-webkit-appearance:none) {
112
-
113
- .message-container {
114
- display: -webkit-box !important;
115
- }
116
-
117
- }
118
- }
119
-
120
- .message-container {
121
- display: flex;
122
- flex-direction: column;
123
- }
124
-
125
- .msg-select {
126
- animation: color .7s;
127
- animation-iteration-count: infinite;
128
- border-radius: map.get(base.$borders, 'sm');
129
-
130
- .message-text {
131
- opacity: .4;
132
- }
133
- }
134
- }
135
-
136
- .go-buttom {
137
- position: absolute;
138
- @include mixins.rtl() {
139
- left: 20px;
140
- bottom: 50px;
141
- }
142
- background-color: #eeeeee;
143
- color: #0b8e6b;
144
-
145
- .label {
146
- background-color: #0b8e6b;
147
- color: white;
148
- }
149
- }
150
-
151
- @keyframes color {
152
- 0% {
153
- background-color: #c6e6f5;
154
- }
155
- 50% {
156
- background-color: #7ad5ff;
157
- }
158
- 100% {
159
- background-color: #0aa6ee;
160
- }
161
- }
162
-
163
- </style>
@@ -1,150 +0,0 @@
1
- <template>
2
- <div :class="{[$r.prefix+'chat-input']:true,'with-file':canFile}">
3
- <r-btn text icon>
4
- <r-icon v-html="$r.icons.sticker"></r-icon>
5
- </r-btn>
6
- <div class="chat-input"
7
- ref="input"
8
- contenteditable="true"
9
- @input="updateText"
10
- @keydown="updateKey"
11
- @paste.prevent="updatePaste"
12
- >
13
- </div>
14
- <div class="action-section d-flex h-end">
15
- <template v-if="canFile">
16
- <r-btn v-if="uploadPercentage===0||uploadPercentage===100" @click.prevent.stop="pickFile"
17
- icon
18
- text>
19
- <r-icon v-html="$r.icons.attachment"></r-icon>
20
- </r-btn>
21
- <r-progress-circle
22
- v-else
23
- @click.prevent="fileDelete()"
24
- :indeterminate=false
25
- :modelValue="uploadPercentage"
26
- :width="2"
27
- size="30"
28
- >
29
- <r-icon v-html="$r.icons.close"></r-icon>
30
- </r-progress-circle>
31
- </template>
32
- <r-btn class="color-success-text"
33
- :disabled="!text"
34
- @click.prevent="send"
35
- icon
36
- text>
37
- <r-icon v-html="$r.icons.send"></r-icon>
38
- </r-btn>
39
- <br>
40
- <span v-if="remain<30" class="label-1 color-error-text">{{ remain }}</span>
41
- </div>
42
- <input accept="*"
43
- @change="addFile()"
44
- ref="file"
45
- style="display: none"
46
- type="file"
47
- v-if="showFile"
48
- >
49
- </div>
50
- </template>
51
- <script>
52
- import file from "../form/fileInput/file.js";
53
-
54
- export default {
55
- name: 'r-chat-input',
56
- mixins: [file],
57
- props: {
58
- maxLenMsg: {type: Number, default: 200},
59
- sendByEnter: Boolean,
60
- placeholder: {type: String, default: 'type here'},
61
- maxFileSize: Number,
62
- uploadLink: String,
63
- canFile: Boolean,
64
- },
65
- emits: ['update:modelValue'],
66
- data() {
67
- return {
68
- text: '',
69
- showFile: true,
70
- }
71
- },
72
- computed: {
73
- remain() {
74
- return this.maxLenMsg - this.text.length
75
- }
76
- },
77
- methods: {
78
- updatePaste(e) {
79
- let text = this.$refs.input.innerText
80
- this.$refs.input.innerText = this.$helper.limiter(text + e.clipboardData.getData('Text'), this.maxLenMsg)
81
- this.updateText()
82
- },
83
- updateKey(e) {
84
- let text = this.$refs.input.innerText
85
-
86
- if (e.keyCode === 13 && this.sendByEnter) {
87
- this.send()
88
- return
89
- }
90
- if (text.length >= this.maxLenMsg && e.keyCode !== 8 && e.keyCode !== 46) {
91
- e.preventDefault();
92
- }
93
- },
94
- updateText() {
95
- this.text = this.$refs.input.innerText
96
- this.$refs.input.scrollTop = this.$refs.input.scrollHeight
97
- },
98
- send() {
99
- if (this.text) {
100
- this.$emit('update:modelValue', {type: "text", content: this.text})
101
- this.$refs.input.innerText = ''
102
- this.text = ''
103
- this.$refs.input.focus()
104
- }
105
- },
106
- emit() {
107
- this.$emit('update:modelValue', {type: "file", content: this.text, link: this.fileLink})
108
- this.$refs.input.innerText = ''
109
- this.text = ''
110
- }
111
- }
112
- }
113
- </script>
114
- <style lang="scss">
115
- @use "../../style/variables/base";
116
-
117
- .#{base.$prefix}chat-input {
118
- display: flex;
119
-
120
- box-shadow: black 0px 8px 15px;
121
- background: var(--color-sheet-container);
122
- color: var(--color-on-sheet);
123
- border-top: 1px solid var(--color-border);
124
-
125
- .chat-input {
126
- margin: 5px 0;
127
- resize: none;
128
- outline: none;
129
- line-height: 25px;
130
- font-size: 14px;
131
- max-height: 80px;
132
- overflow-y: auto;
133
- width: calc(100% - 40px);
134
- }
135
-
136
- .action-section {
137
- width: 40px;
138
- }
139
-
140
- &.with-file {
141
- .action-section {
142
- width: 80px;
143
- }
144
-
145
- .chat-input {
146
- width: calc(100% - 80px);
147
- }
148
- }
149
- }
150
- </style>
@@ -1,276 +0,0 @@
1
- <template>
2
- <div class="message-body" :class="{'is-me':isMe}">
3
- <img class="message-user-img me-1" :src="user.img+'?w=50&h=50'" :alt="user.name"
4
- v-if="!isMe&&!message.in_line_top&&!message.in_line_mid">
5
- <div class="message-holder">
6
- <div class="message-content" v-for="(msg,i) in message.list"
7
- :id="'msg-'+msg._id"
8
- v-intersect.once="{
9
- handler: view,
10
- options: {
11
- id:msg._id,
12
- threshold: 0.05
13
- }
14
- }"
15
- :key="msg._id"
16
- :class="{'in-line-top':i===0&&message.list.length>1,
17
- 'in-line-mid':i!==0&&i<message.list.length-1,
18
- 'in-line-btm':i===message.list.length-1&&message.list.length>1
19
- }">
20
- <div class="message-text body-1">
21
- <div v-if="!isMe" class="message-username title-3">{{ user.name }}
22
- </div>
23
- <div v-if="msg.type==='file'" @click.prevent="$helper.download('/'+msg.link)">
24
- <div class="mx-n2 mt-n1" v-if="isImg(msg.link)">
25
- <r-img class="br-sm" :src="'/'+msg.link" alt="img" width="250" :w-p-h="isImg(msg.link)"></r-img>
26
- </div>
27
- <div v-else class="d-flex cursor-pointer">
28
- <r-icon class="ma-1" v-html="$r.icons.file"></r-icon>
29
- <span>
30
- {{ file_name(msg.link) }}
31
- </span>
32
- </div>
33
- </div>
34
- <div v-html="msg.content"></div>
35
- <div class="message-info text-end label-1">
36
- {{ msg.timestamp }}
37
- </div>
38
- </div>
39
- <div class="is-end" v-if="i===message.list.length-1"></div>
40
- </div>
41
- </div>
42
- </div>
43
- </template>
44
- <script>
45
-
46
-
47
- export default {
48
- name: 'r-chat-msg',
49
-
50
- props: {
51
- isMe: Boolean,
52
- user: {
53
- type: Object,
54
- default: () => {
55
- return {}
56
- }
57
- },
58
- message: {
59
- type: Object,
60
- default: () => {
61
- return {}
62
- }
63
- }
64
- },
65
- emits:['see'],
66
- methods: {
67
- isImg(link) {
68
- const is = link.indexOf('storage/img/') !== -1
69
- if (is) {
70
- link = link.split('/')
71
- link = link[link.length - 1].split('_')
72
- return link[0] / link[1]
73
- }
74
- return is
75
- },
76
- file_name(link) {
77
- let res = link.split('/')
78
- return res[res.length - 1]
79
- },
80
- view(isIntersecting, entries, observer, options) {
81
- if (isIntersecting) {
82
- this.$emit('see', options.id)
83
- }
84
- }
85
- }
86
- }
87
- </script>
88
- <style lang="scss">
89
- @use "sass:map";
90
- @use "../../style/variables/base";
91
- @use "../../style/mixins";
92
-
93
- .message-body {
94
- display: flex;
95
- align-items: flex-end;
96
- position: relative;
97
- padding: 5px;
98
-
99
- .message-holder {
100
- width: 100%;
101
- }
102
-
103
- .message-user-img {
104
- width: 50px;
105
- height: 50px;
106
- border-radius: 50%;
107
- position: sticky;
108
- bottom: 0;
109
- z-index: 1;
110
- }
111
-
112
- .message-content {
113
- display: flex;
114
- flex-direction: column;
115
- flex-grow: 1;
116
- max-width: 1000px;
117
- position: relative;
118
- }
119
-
120
- .message-text {
121
- background: #fff;
122
- color: black;
123
- padding: 5px 10px;
124
- border-radius: map.get(base.$borders, 'lg');
125
- max-width: 80%;
126
- overflow-wrap: break-word;
127
- white-space: pre-wrap;
128
- word-break: break-word;
129
- }
130
-
131
- .message-username {
132
- color: #4f98ec;
133
- }
134
-
135
- .message-info {
136
- color: #444444;
137
- }
138
-
139
- .in-line-top {
140
- .message-text {
141
- border-bottom-left-radius: 4px !important;
142
- border-bottom-right-radius: 4px !important;
143
- margin-bottom: 2px;
144
- }
145
- }
146
-
147
- .in-line-mid {
148
- .message-text {
149
- margin-top: 0px;
150
- margin-bottom: 2px;
151
- border-radius: map.get(base.$borders, 'sm') !important;
152
- }
153
- }
154
-
155
- .in-line-btm {
156
- .message-text {
157
- border-top-left-radius: 4px !important;
158
- border-top-right-radius: 4px !important;
159
- }
160
- }
161
-
162
- .is-end {
163
- width: 15px;
164
- height: 15px;
165
- position: absolute;
166
- bottom: 0;
167
- overflow: hidden;
168
-
169
- &:after {
170
- content: '';
171
- width: 30px;
172
- height: 30px;
173
- border-radius: 50%;
174
-
175
- background-color: var(--color-sheet);
176
-
177
- position: absolute;
178
- top: -15px;
179
- }
180
- }
181
-
182
- &:not(.is-me) {
183
- .is-end {
184
- background-color: #fff;
185
- @include mixins.ltr() {
186
- left: -15px;
187
- }
188
- @include mixins.rtl() {
189
- right: -15px;
190
- }
191
-
192
- &:after {
193
- @include mixins.ltr() {
194
- left: -15px;
195
- }
196
- @include mixins.rtl() {
197
- right: -15px;
198
- }
199
- }
200
- }
201
-
202
- .message-content {
203
- @include mixins.ltr() {
204
- align-items: flex-end;
205
- }
206
- @include mixins.rtl() {
207
- align-items: flex-start;
208
- }
209
- }
210
-
211
- .message-text {
212
- @include mixins.ltr() {
213
- border-bottom-left-radius: 0px;
214
- }
215
- @include mixins.rtl() {
216
- border-bottom-right-radius: 0px;
217
- }
218
- }
219
- }
220
-
221
- &.is-me {
222
- flex-direction: row-reverse;
223
- @include mixins.rtl() {
224
- margin-left: 15px;
225
- }
226
- @include mixins.ltr() {
227
- margin-right: 15px;
228
- }
229
-
230
- .is-end {
231
- background-color: #4f98ec;
232
- @include mixins.rtl() {
233
- left: -15px;
234
- }
235
- @include mixins.ltr() {
236
- right: -15px;
237
- }
238
-
239
- &:after {
240
- @include mixins.rtl() {
241
- left: -15px;
242
- }
243
- @include mixins.ltr() {
244
- right: -15px;
245
- }
246
- }
247
- }
248
-
249
- .message-text {
250
- background-color: #4f98ec;
251
- color: white;
252
- @include mixins.ltr() {
253
- border-bottom-right-radius: 0px;
254
- }
255
- @include mixins.rtl() {
256
- border-bottom-left-radius: 0px;
257
- }
258
- }
259
-
260
- .message-info {
261
- color: #eeeeee;
262
- }
263
-
264
- .message-content {
265
- @include mixins.ltr() {
266
- align-items: flex-start;
267
-
268
- }
269
- @include mixins.rtl() {
270
- align-items: flex-end;
271
-
272
- }
273
- }
274
- }
275
- }
276
- </style>
@@ -1,11 +0,0 @@
1
- export * as rChat from './index.vue'
2
- export * as rChatInput from './chatInput.vue'
3
- export * as rChatMessageList from './MessageList.vue'
4
- export * as rChatMessage from './chatMsg.vue'
5
- export * as l_btn from '../button/index.js'
6
- export * as l_icon from '../icon/index.js'
7
- export * as l_img from '../img/index.js'
8
- export * as l_circle from '../progress/circle.js'
9
-
10
- export * as d_intersect from '../../directive/intersect/index.js'
11
- export * as d_scroll from '../../directive/scroll/index.js'
@@ -1,113 +0,0 @@
1
- <template>
2
- <div :class="$r.prefix+'chat'">
3
- <div class="chat-header" v-if="title">{{ title }}</div>
4
- <r-chat-message-list ref="msgList" @see="$emit('see', $event)" :messages="msgs" :myself="myself"
5
- :participants="participants"
6
- :newMsg="newMsg"
7
- :hideBottomBtn="hideBottomBtn"
8
- >
9
- </r-chat-message-list>
10
- <r-chat-input v-if="!hideSend"
11
- @update:model-value="onMsgSubmit"
12
- :send-by-enter="sendByEnter"
13
- :maxLenMsg="maxLenMsg"
14
- :placeholder="placeholder"
15
- :uploadLink="uploadLink"
16
- :maxFileSize="maxFileSize"
17
- :canFile="canFile"
18
- ></r-chat-input>
19
- </div>
20
- </template>
21
- <script>
22
-
23
- export default {
24
- name: 'r-chat',
25
- props: {
26
- sendByEnter: Boolean,
27
- placeholder: {type: String, default: 'type here'},
28
- hideBottomBtn: Boolean,
29
- hideSend: Boolean,
30
- maxLenMsg: {type: Number, default: 200},
31
- newMsg: {
32
- type: Object, default: () => {
33
- return {
34
- num: 0,
35
- first_id: null
36
- }
37
- }
38
- },
39
- participants: {
40
- type: Object,
41
- required: true
42
- },
43
- messages: {
44
- type: Array,
45
- required: true
46
- },
47
- myself: {
48
- type: Object,
49
- required: true
50
- },
51
- title: String,
52
- canFile: Boolean,
53
- maxFileSize: {type: Number, default: 1024 * 1024},
54
- uploadLink: {
55
- type: String,
56
- default: '/storage/chat'
57
- },
58
- },
59
- emits:['see','msg-submit'],
60
- data() {
61
- return {
62
- timeout_id: null
63
- }
64
- },
65
- computed: {
66
- msgs() {
67
- let res = []
68
- this.messages.forEach((msg, i) => {
69
- let m = Object.assign({}, msg)
70
- delete m.user_id
71
- if (res[res.length - 1] && msg.user_id === res[res.length - 1].user_id) {
72
- res[res.length - 1]['list'].push(m)
73
- } else {
74
- res.push({
75
- '_id': i,
76
- 'user_id': msg.user_id,
77
- 'list': [m]
78
- })
79
- }
80
- })
81
- return res
82
- }
83
- },
84
- methods: {
85
- onMsgSubmit: function (message) {
86
- let d = message
87
- d.id = this.$helper.uniqueId(16)
88
- d.created_at = new Date()
89
-
90
- this.$emit("msg-submit", d)
91
- clearTimeout(this.timeout_id)
92
- this.timeout_id = setTimeout(() => {
93
- this.$refs.msgList.goToBottom()
94
- }, 100)
95
- }
96
- },
97
- }
98
- </script>
99
- <style lang="scss">
100
- @use "../../style/variables/base";
101
-
102
- .#{base.$prefix}chat {
103
- position: relative;
104
- display: flex;
105
- width: 100%;
106
- height: 100%;
107
- flex-direction: column;
108
- align-items: stretch;
109
- overflow: hidden;
110
- background: var(--color-sheet);
111
- color: var(--color-on-sheet);
112
- }
113
- </style>
@@ -1,3 +0,0 @@
1
- export * as rChip from './index.vue'
2
- export * as l_Btn from '../button/index.js'
3
- export * as l_icon from '../icon/index.js'