renusify 1.0.3 → 1.0.5

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 (68) hide show
  1. package/LICENSE +1 -1
  2. package/components/app/index.vue +14 -14
  3. package/components/{notify → app/notify}/index.vue +1 -1
  4. package/components/{notify → app/notify}/notification.vue +0 -0
  5. package/components/{notify → app/notify}/notify.js +0 -0
  6. package/components/app/style.scss +0 -1
  7. package/components/{toast → app/toast}/index.vue +0 -0
  8. package/components/{toast → app/toast}/style.scss +1 -1
  9. package/components/{toast → app/toast}/toast.js +0 -0
  10. package/components/{toast → app/toast}/toast.vue +0 -0
  11. package/components/breadcrumb/bredcrumbItem.vue +11 -11
  12. package/components/breadcrumb/index.vue +6 -5
  13. package/components/button/buttonGroup.vue +0 -4
  14. package/components/button/index.vue +0 -2
  15. package/components/card/index.vue +0 -2
  16. package/components/chart/chart.vue +3 -0
  17. package/components/chat/MessageList.vue +0 -2
  18. package/components/chat/chatInput.vue +139 -135
  19. package/components/chat/chatMsg.vue +4 -4
  20. package/components/codeEditor/index.vue +412 -443
  21. package/components/codeEditor/run.vue +76 -80
  22. package/components/content/style.scss +0 -1
  23. package/components/form/address.vue +109 -109
  24. package/components/form/address_ir.vue +106 -0
  25. package/components/form/colorPicker/Alpha.vue +29 -45
  26. package/components/form/colorPicker/Hue.vue +32 -51
  27. package/components/form/colorPicker/Preview.vue +24 -28
  28. package/components/form/colorPicker/Saturation.vue +49 -69
  29. package/components/form/colorPicker/index.vue +53 -38
  30. package/components/form/colorPicker/mixin.js +6 -1
  31. package/components/form/colorPicker/picker.vue +80 -39
  32. package/components/form/group-input.vue +124 -106
  33. package/components/form/inputTel/index.vue +8 -10
  34. package/components/form/json/JsonView.vue +15 -11
  35. package/components/form/json/index.vue +29 -10
  36. package/components/form/mask-input.vue +0 -5
  37. package/components/form/number.vue +1 -1
  38. package/components/form/range.vue +0 -2
  39. package/components/form/select.vue +14 -14
  40. package/components/iframe/index.vue +60 -38
  41. package/components/index.js +189 -93
  42. package/components/infinite/div.vue +2 -3
  43. package/components/infinite/index.vue +0 -2
  44. package/components/infinite/page.vue +2 -3
  45. package/components/list/index.vue +0 -2
  46. package/components/menu/index.vue +160 -131
  47. package/components/modal/index.vue +85 -90
  48. package/components/modal/style.scss +0 -1
  49. package/components/searchBox/index.vue +0 -4
  50. package/components/slider/index.vue +0 -4
  51. package/components/swiper/index.vue +0 -4
  52. package/components/table/crud/index.vue +12 -13
  53. package/components/table/index.vue +0 -4
  54. package/directive/clickOutSide/index.js +2 -3
  55. package/directive/drag/index.js +1 -2
  56. package/directive/index.js +18 -19
  57. package/directive/intersect/index.js +3 -3
  58. package/directive/resize/index.js +3 -4
  59. package/directive/ripple/index.js +4 -6
  60. package/directive/scroll/index.js +3 -4
  61. package/directive/sortable/index.js +1 -2
  62. package/directive/title/index.js +2 -3
  63. package/directive/touch/index.js +32 -20
  64. package/index.js +11 -5
  65. package/package.json +1 -1
  66. package/plugins/trans/Translate.js +9 -14
  67. package/tools/helper.js +23 -0
  68. package/components/form/colorPicker/Box.vue +0 -85
@@ -1,152 +1,181 @@
1
1
  <template>
2
- <div :class="$r.prefix+'menu'" v-click-outside="close" ref="menu">
3
- <div class="d-flex h-start flex-row v-center">
4
- <span class="menu-label" v-if="label" @click.prevent="open">{{label}}</span>
5
- <transition name="fade" mode="out-in">
6
- <!-- Header Navigation Menu Icons -->
7
- <r-btn icon text v-if="modelValue" key="on" @click.prevent="close">
8
- <r-icon v-html="$r.icons.close"></r-icon>
9
- </r-btn>
10
- <r-btn icon text v-else key="off" @click.prevent="open">
11
- <r-icon v-html="icon||$r.icons.menu_dot"></r-icon>
12
- </r-btn>
13
-
14
- </transition>
15
- <div class="dropdown-menu mt-1"
16
- v-if="modelValue"
17
- :style="{
2
+ <div :class="$r.prefix+'menu'" v-click-outside="close" ref="menu">
3
+ <div class="d-flex h-start flex-row v-center">
4
+ <span class="menu-label" v-if="label" @click.prevent="open">{{ label }}</span>
5
+ <transition name="fade" mode="out-in">
6
+ <!-- Header Navigation Menu Icons -->
7
+ <r-btn icon text v-if="show" key="on" @click.prevent="close">
8
+ <r-icon v-html="$r.icons.chevron_up"></r-icon>
9
+ </r-btn>
10
+ <r-btn icon text v-else key="off" @click.prevent="open">
11
+ <r-icon v-html="icon||$r.icons.chevron_down"></r-icon>
12
+ </r-btn>
13
+
14
+ </transition>
15
+ <div class="dropdown-menu mt-1"
16
+ v-if="show"
17
+ :style="{
18
18
  'top':top+'px',
19
19
  'left':left,
20
20
  'right':right,
21
21
  'opacity':opacity
22
22
  }">
23
- <r-card>
24
- <div class="dropdown-menu-item pa-2" v-for="(item,i) in list" :key="i">
25
- <slot :item="item">
26
- {{ item }}
27
- </slot>
28
- </div>
29
- </r-card>
30
- </div>
31
-
32
- </div>
23
+ <r-card>
24
+ <div class="dropdown-menu-item pa-2" v-for="(item,i) in list" :key="i"
25
+ :class="{'color-one-text':selected===item[value]}"
26
+ @click="emit(item)">
27
+ <slot :item="item">
28
+ {{ item }}
29
+ </slot>
30
+ </div>
31
+ </r-card>
32
+ </div>
33
+
33
34
  </div>
35
+ </div>
34
36
  </template>
35
37
  <script>
36
- import clickOutside from '../../directive/clickOutSide/index'
37
-
38
- export default {
39
- name: 'r-menu',
40
- directives: {
41
- 'click-outside': clickOutside
42
- },
43
- props: {
44
- modelValue: {
45
- type: Boolean,
46
- default: false
47
- },
48
- label: String,
49
- icon: {
50
- type: String
51
- },
52
- reverse: Boolean,
53
- overlay: Boolean,
54
- list: [Array, Object]
55
- },
56
- data() {
57
- return {
58
- top: null,
59
- left: null,
60
- right: null,
61
- opacity: 0
62
- }
63
- },
64
- methods: {
65
- open() {
66
- const elm = this.$refs.menu.getBoundingClientRect()
67
- this.top = -20
68
- if (!this.overlay) {
69
- this.top += elm.height
70
- }
71
- this.opacity = 0
72
- let n = 80
73
- if (!this.$r.rtl) {
74
- this.left = 0
75
- } else {
76
- this.right = 0
77
- }
78
- if (this.reverse) {
79
- if (!this.$r.rtl) {
80
- this.right = 0
81
- } else {
82
- this.left = 0
83
- }
84
- }
85
-
86
- this.$emit('update:modelValue', true)
87
- setTimeout(() => {
88
- this.top = this.top + 20
89
- this.opacity = 1
90
- }, 10)
91
-
92
- }, close() {
93
- this.top = this.top - 20
94
- this.opacity = 0
95
- setTimeout(() => {
96
- this.$emit('update:modelValue', false)
97
- }, 200)
98
-
99
- }
100
- }
38
+
39
+ export default {
40
+ name: 'r-menu',
41
+
42
+ props: {
43
+ modelValue: {
44
+ type: [String, Number, Object]
45
+ },
46
+ label: String,
47
+ icon: {
48
+ type: String
49
+ },
50
+ value: {
51
+ type: String,
52
+ default: 'value'
53
+ },
54
+ justValue: Boolean,
55
+ reverse: Boolean,
56
+ overlay: Boolean,
57
+ items: Array
58
+ },
59
+ data() {
60
+ return {
61
+ show: false,
62
+ top: null,
63
+ left: null,
64
+ right: null,
65
+ opacity: 0
101
66
  }
102
- </script>
103
- <style lang="scss">
104
- @import "../../style/include";
67
+ },
68
+ computed: {
69
+ list() {
70
+ let r = []
71
+ if (this.items) {
72
+ this.items.forEach((item) => {
73
+ if (typeof item === 'object') {
74
+ r.push(item)
75
+ } else {
76
+ r.push({'name': item, [this.value]: item})
77
+ }
78
+ })
79
+ }
80
+ return r
81
+ },
82
+ selected() {
83
+ if (!this.modelValue) {
84
+ return null
85
+ }
86
+ return this.justValue ? this.modelValue : this.modelValue[this.value]
87
+ }
88
+ },
89
+ methods: {
90
+ emit(item) {
91
+ this.$emit('update:modelValue', this.justValue ? item[this.value] : item)
92
+ this.close()
93
+ },
94
+ open() {
95
+ const elm = this.$refs.menu.getBoundingClientRect()
96
+ this.top = -20
97
+ if (!this.overlay) {
98
+ this.top += elm.height
99
+ }
100
+ this.opacity = 0
101
+ let n = 80
102
+ if (!this.$r.rtl) {
103
+ this.left = 0
104
+ } else {
105
+ this.right = 0
106
+ }
107
+ if (this.reverse) {
108
+ if (!this.$r.rtl) {
109
+ this.right = 0
110
+ } else {
111
+ this.left = 0
112
+ }
113
+ }
105
114
 
115
+ this.show = true
116
+ setTimeout(() => {
117
+ this.top = this.top + 20
118
+ this.opacity = 1
119
+ }, 10)
106
120
 
107
- .#{$prefix}menu {
108
- position: relative;
121
+ }, close() {
122
+ this.top = this.top - 20
123
+ this.opacity = 0
124
+ setTimeout(() => {
125
+ this.show = false
126
+ }, 200)
109
127
 
110
- @include light() {
111
- .dropdown-menu {
112
- border: 1px solid var(--color-border-light);
128
+ }
129
+ }
130
+ }
131
+ </script>
132
+ <style lang="scss">
133
+ @import "../../style/include";
113
134
 
114
- &-item:hover {
115
- background-color: var(--color-table-hover-light);
116
- }
117
- }
118
- }
119
- @include dark() {
120
- .dropdown-menu {
121
- border: 1px solid var(--color-border-dark);
122
-
123
- &-item:hover {
124
- background-color: var(--color-table-hover-dark);
125
- }
126
- }
127
- }
128
135
 
129
- .menu-label {
130
- cursor: pointer;
131
- }
136
+ .#{$prefix}menu {
137
+ position: relative;
132
138
 
133
- .dropdown-menu {
134
- scroll-behavior: smooth;
135
- transition: all .3s ease;
136
- position: absolute;
137
- z-index: 10;
138
- min-width: 150px;
139
- max-height: 200px;
140
- overflow-y: auto;
141
- background-clip: padding-box;
142
- border-radius: 4px;
143
-
144
- &-item {
145
- cursor: pointer;
146
- }
139
+ @include light() {
140
+ .dropdown-menu {
141
+ border: 1px solid var(--color-border-light);
147
142
 
148
- }
143
+ &-item:hover {
144
+ background-color: var(--color-table-hover-light);
145
+ }
146
+ }
147
+ }
148
+ @include dark() {
149
+ .dropdown-menu {
150
+ border: 1px solid var(--color-border-dark);
151
+
152
+ &-item:hover {
153
+ background-color: var(--color-table-hover-dark);
154
+ }
149
155
  }
156
+ }
157
+
158
+ .menu-label {
159
+ cursor: pointer;
160
+ }
161
+
162
+ .dropdown-menu {
163
+ scroll-behavior: smooth;
164
+ transition: all .3s ease;
165
+ position: absolute;
166
+ z-index: 10;
167
+ min-width: 150px;
168
+ max-height: 200px;
169
+ overflow-y: auto;
170
+ background-clip: padding-box;
171
+ border-radius: 4px;
172
+
173
+ &-item {
174
+ cursor: pointer;
175
+ }
176
+
177
+ }
178
+ }
150
179
 
151
180
 
152
181
  </style>
@@ -1,8 +1,14 @@
1
1
  <template>
2
- <teleport :to="`.${$r.prefix}app`">
3
- <transition :name="animate">
4
- <div v-bind="$attrs" :class="classes" @click.self="close" v-if="modelValue">
5
- <div class="modal-container" :style="{'max-width':maxWidth,'max-height':maxHeight}" :class="{
2
+ <teleport :to="`.${$r.prefix}app`">
3
+ <transition :name="animate">
4
+ <div v-bind="$attrs" :class="{
5
+ [`${$r.prefix}modal`]:true,
6
+ 'h-end': bottom,
7
+ 'modal-no-overlay': noOverlay,
8
+ 'animate-modal-vibrate': run_animate,
9
+ }" :style="{'height':$r.breakpoint.height+'px'}" @click.self="close"
10
+ v-if="modelValue">
11
+ <div class="modal-container" :style="{'max-width':maxWidth,'max-height':maxHeight}" :class="{
6
12
  'modal-bottom':bottom,
7
13
  [color]:color,
8
14
  ['animate-modal-' +animate]:animate,
@@ -12,97 +18,86 @@
12
18
  'modal-flat':flat
13
19
 
14
20
  }">
15
- <div class="modal-btn text-end">
16
- <r-btn class="color-error-text"
17
- text
18
- @click.prevent="close(true)"
19
- fab
20
- size="small"
21
- v-if="closebtn">
22
- <r-icon v-html="$r.icons.close"></r-icon>
23
- </r-btn>
24
- </div>
25
- <div class="modal-content">
26
- <slot></slot>
27
- </div>
28
- </div>
29
- </div>
30
- </transition>
31
- </teleport>
21
+ <div class="modal-btn text-end">
22
+ <r-btn class="color-error-text"
23
+ text
24
+ @click.prevent="close(true)"
25
+ fab
26
+ size="small"
27
+ v-if="closebtn">
28
+ <r-icon v-html="$r.icons.close"></r-icon>
29
+ </r-btn>
30
+ </div>
31
+ <div class="modal-content">
32
+ <slot></slot>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </transition>
37
+ </teleport>
32
38
  </template>
33
39
 
34
40
  <script>
35
- import './style.scss'
41
+ import './style.scss'
36
42
 
37
- export default {
38
- name: 'r-modal',
39
- inheritAttrs: false,
40
- props: {
41
- modelValue: Boolean,
42
- bottom: Boolean,
43
- noOverlay: Boolean,
44
- fullWidth: Boolean,
45
- fullHeight: Boolean,
46
- maxWidth: String,
47
- maxHeight: String,
48
- minWidth: {type: Boolean, default: true},
49
- flat: Boolean,
50
- closable: Boolean,
51
- closebtn: {type: Boolean, default: true},
52
- color: String,
53
- animate: {
54
- type: String,
55
- default: 'slide-up'
56
- }
43
+ export default {
44
+ name: 'r-modal',
45
+ inheritAttrs: false,
46
+ props: {
47
+ modelValue: Boolean,
48
+ bottom: Boolean,
49
+ noOverlay: Boolean,
50
+ fullWidth: Boolean,
51
+ fullHeight: Boolean,
52
+ maxWidth: String,
53
+ maxHeight: String,
54
+ minWidth: {type: Boolean, default: true},
55
+ flat: Boolean,
56
+ closable: Boolean,
57
+ closebtn: {type: Boolean, default: true},
58
+ color: String,
59
+ animate: {
60
+ type: String,
61
+ default: 'slide-up'
62
+ }
57
63
 
58
- },
59
- data() {
60
- return {
61
- state: null,
62
- run_animate: false
63
- }
64
- },
65
- watch: {
66
- modelValue: {
67
- // immediate: true, watch at created component
68
- handler: function (newVal, oldVal) {
69
- if (newVal === true) {
70
- document.documentElement.style.overflow = 'hidden'
71
- const that = this
72
- window.onpopstate = function (event) {
73
- that.$emit('update:modelValue', false)
74
- }
75
- } else {
76
- document.documentElement.style.overflow = null
77
- }
78
- }
79
- }
80
- },
81
- computed: {
82
- classes() {
83
- let a = {
84
- 'h-end': this.bottom,
85
- 'modal-no-overlay': this.noOverlay,
86
- 'animate-modal-vibrate': this.run_animate,
87
- }
88
- a[`${this.$r.prefix}modal`]=true
89
- return a
90
- }
91
- },
92
- methods: {
93
- close(force = false) {
94
- if (this.closable || force === true) {
95
- this.$emit('update:modelValue', !this.modelValue)
96
- } else {
97
- this.run_animate = true
98
- setTimeout(() => {
99
- this.run_animate = false
100
- }, 300)
101
- }
102
- }
103
- },
104
- beforeUnmount() {
105
- document.documentElement.style.overflow = null
64
+ },
65
+ data() {
66
+ return {
67
+ state: null,
68
+ run_animate: false
69
+ }
70
+ },
71
+ watch: {
72
+ modelValue: {
73
+ // immediate: true, watch at created component
74
+ handler: function (newVal, oldVal) {
75
+ if (newVal === true) {
76
+ document.documentElement.style.overflow = 'hidden'
77
+ const that = this
78
+ window.onpopstate = function (event) {
79
+ that.$emit('update:modelValue', false)
80
+ }
81
+ } else {
82
+ document.documentElement.style.overflow = null
106
83
  }
84
+ }
85
+ }
86
+ },
87
+ methods: {
88
+ close(force = false) {
89
+ if (this.closable || force === true) {
90
+ this.$emit('update:modelValue', !this.modelValue)
91
+ } else {
92
+ this.run_animate = true
93
+ setTimeout(() => {
94
+ this.run_animate = false
95
+ }, 300)
96
+ }
107
97
  }
98
+ },
99
+ beforeUnmount() {
100
+ document.documentElement.style.overflow = null
101
+ }
102
+ }
108
103
  </script>
@@ -11,7 +11,6 @@
11
11
  z-index: map_get($z-index, 'important');
12
12
  outline: none;
13
13
  bottom: 0;
14
- height: 100vh;
15
14
 
16
15
  @include light() {
17
16
  &:not(.modal-no-overlay) {
@@ -47,14 +47,10 @@
47
47
  </div>
48
48
  </template>
49
49
  <script>
50
- import clickOutside from '../../directive/clickOutSide/index'
51
50
 
52
51
  export default {
53
52
  name: 'r-search-box',
54
53
  inheritAttrs: false,
55
- directives: {
56
- 'click-outside': clickOutside
57
- },
58
54
  props: {
59
55
  closable: Boolean,
60
56
  notFoundMsg: {
@@ -40,13 +40,9 @@
40
40
  </template>
41
41
 
42
42
  <script>
43
- import Touch from "../../directive/touch";
44
43
 
45
44
  export default {
46
45
  name: 'r-slider',
47
- directives: {
48
- 'touch': Touch
49
- },
50
46
  props: {
51
47
  slides: {
52
48
  type: Array,
@@ -37,13 +37,9 @@
37
37
  </template>
38
38
 
39
39
  <script>
40
- import Touch from "../../directive/touch";
41
40
 
42
41
  export default {
43
42
  name: 'r-swiper',
44
- directives: {
45
- 'touch': Touch
46
- },
47
43
  props: {
48
44
  items: Array,
49
45
  widthItem: Number,
@@ -157,21 +157,20 @@
157
157
  <script>
158
158
  import ManageFooter from "./footer";
159
159
  import ManageHeader from "./header";
160
- import RDivider from "../../container/divider";
161
160
 
162
161
  export default {
163
- name: 'r-table-crud',
164
- components: {RDivider, ManageHeader, ManageFooter},
165
- props: {
166
- link: {
167
- required: true,
168
- type: String
169
- },
170
- actions: {
171
- default: function () {
172
- return []
173
- },
174
- type: Array
162
+ name: 'r-table-crud',
163
+ components: {ManageHeader, ManageFooter},
164
+ props: {
165
+ link: {
166
+ required: true,
167
+ type: String
168
+ },
169
+ actions: {
170
+ default: function () {
171
+ return []
172
+ },
173
+ type: Array
175
174
  },
176
175
  cast: {
177
176
  default: function () {
@@ -105,13 +105,9 @@
105
105
 
106
106
  <script>
107
107
  import './style.scss'
108
- import Sortable from "../../directive/sortable";
109
108
 
110
109
  export default {
111
110
  name: 'r-table',
112
- directives: {
113
- 'sortable': Sortable
114
- },
115
111
  props: {
116
112
  transition: {
117
113
  type: String,
@@ -40,8 +40,7 @@ function unmounted(el, binding) {
40
40
  delete el['click_outside']
41
41
  }
42
42
 
43
- export const clickOutside = {
43
+ export default {
44
44
  mounted,
45
45
  unmounted
46
- }
47
- export default clickOutside
46
+ }
@@ -105,8 +105,7 @@ function unmounted(el, binding) {
105
105
  delete el.eventsHandler
106
106
  }
107
107
 
108
- export const Drag = {
108
+ export default {
109
109
  mounted,
110
110
  unmounted
111
111
  }
112
- export default Drag
@@ -1,22 +1,21 @@
1
- import Ripple from './ripple/index'
2
- import clickOutside from './clickOutSide/index'
3
- import Title from "renusify/directive/title";
4
- import Scroll from "renusify/directive/scroll";
5
- import Sortable from "renusify/directive/sortable";
6
- import parallax from "renusify/directive/parallax";
7
- import Animate from "renusify/directive/animate";
1
+ const list = {
2
+ 'animate': 'animate',
3
+ 'click-outside': 'clickOutSide',
4
+ 'drag': 'drag',
5
+ 'intersect': 'intersect',
6
+ 'mask': 'mask',
7
+ 'parallax': 'parallax',
8
+ 'resize': 'resize',
9
+ 'ripple': 'ripple',
10
+ 'scroll': 'scroll',
11
+ 'sortable': 'sortable',
12
+ 'touch': 'touch',
13
+ 'title': 'title',
14
+
8
15
 
9
- const list={
10
- 'ripple':Ripple,
11
- 'click-outside':clickOutside,
12
- 'title':Title,
13
- 'scroll':Scroll,
14
- 'sortable':Sortable,
15
- 'parallax':parallax,
16
- 'animate':Animate,
17
16
  }
18
- export const registers = (app,directives) => {
19
- directives.forEach((item)=>{
20
- app.directive(item, list[item])
21
- })
17
+ export const registers = (app, directives) => {
18
+ directives.forEach((item) => {
19
+ app.directive(item, require('./' + list[item]).default)
20
+ })
22
21
  }