renusify 1.4.2 → 1.4.4

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 (53) hide show
  1. package/components/app/index.vue +1 -10
  2. package/components/chart/worldMap.vue +293 -34
  3. package/components/chip/style.scss +0 -1
  4. package/components/codeEditor/highlightCss.vue +10 -112
  5. package/components/codeEditor/highlightHtml.vue +20 -159
  6. package/components/codeEditor/highlightJs.vue +14 -243
  7. package/components/codeEditor/index.vue +37 -57
  8. package/components/codeEditor/mixin.js +186 -0
  9. package/components/cropper/index.vue +2 -1
  10. package/components/form/camInput.vue +6 -2
  11. package/components/form/input.vue +1 -1
  12. package/components/form/json/index.vue +113 -65
  13. package/components/form/mask-input.vue +2 -2
  14. package/components/form/text-area.vue +1 -1
  15. package/components/form/text-editor/index.vue +0 -1
  16. package/components/form/timepicker/index.vue +18 -16
  17. package/components/form/unit-input.vue +1 -0
  18. package/components/formCreator/index.vue +7 -20
  19. package/components/img/index.vue +18 -18
  20. package/components/index.js +2 -2
  21. package/components/infinite/index.vue +9 -6
  22. package/components/map/index.vue +52 -20
  23. package/components/map/leaflet.css +511 -397
  24. package/components/map/route.vue +570 -560
  25. package/components/map/select.vue +64 -48
  26. package/components/message/index.vue +22 -21
  27. package/components/modal/index.vue +76 -17
  28. package/components/modal/style.scss +21 -16
  29. package/components/{app/notify → notify}/index.vue +21 -29
  30. package/components/{app/notify → notify}/notification.vue +10 -10
  31. package/components/notify/notify.js +27 -0
  32. package/components/searchBox/index.vue +30 -12
  33. package/components/slider/index.vue +16 -12
  34. package/components/table/index.vue +378 -379
  35. package/components/table/style.scss +1 -4
  36. package/components/tabs/index.vue +9 -23
  37. package/components/timeAgo/index.vue +4 -1
  38. package/components/tour/index.vue +237 -222
  39. package/components/tree/index.vue +135 -136
  40. package/components/tree/tree-element.vue +17 -3
  41. package/directive/drag/index.js +5 -5
  42. package/directive/index.js +1 -2
  43. package/directive/mask/index.js +1 -4
  44. package/directive/skeleton/index.js +27 -0
  45. package/directive/skeleton/style.scss +37 -0
  46. package/directive/sortable/index.js +3 -3
  47. package/directive/title/index.js +2 -3
  48. package/directive/touch/index.js +2 -4
  49. package/index.js +14 -9
  50. package/package.json +1 -1
  51. package/style/transitions.scss +6 -116
  52. package/tools/helper.js +1 -22
  53. package/components/app/notify/notify.js +0 -28
@@ -1,152 +1,151 @@
1
1
  <template>
2
- <r-container full-width :class="classes" ref="tree">
3
- <r-row v-if="searchLink">
4
- <r-col>
5
- <r-select
6
- :searchLink="searchLink"
7
- :model-value="search"
8
- @update:model-value="change($event)"
9
- :label="$t('search','renusify')"
10
- ></r-select>
11
- </r-col>
12
- </r-row>
13
- <r-float bordered v-if="show" :minZoom="0.01" :zoom="0.7">
14
- <template v-slot="{move,ease,transform}">
15
- <r-container full-width fill :class="{
2
+ <r-container ref="tree" :class="classes" full-width>
3
+ <r-row v-if="searchLink">
4
+ <r-col>
5
+ <r-select
6
+ :label="$t('search','renusify')"
7
+ :model-value="search"
8
+ :searchLink="searchLink"
9
+ @update:model-value="change($event)"
10
+ ></r-select>
11
+ </r-col>
12
+ </r-row>
13
+ <r-float v-if="show" :minZoom="0.01" :zoom="0.7" bordered>
14
+ <template v-slot="{move,ease,transform}">
15
+ <r-container :class="{
16
16
  'tree-rotate':rotate
17
- }">
18
- <slot
19
- :parent-node="nodeParent"
20
- @update:model-value="$emit('update:modelValue',$event)"
21
- :model-value="node"
22
- :link="link"
23
- @select-node="handleSelect"
24
- @expand="handleExpand(ease,move,transform,$event)"
25
- :selected="selected"
26
- :expand="expand"
27
- :openAll="openAll"
28
- >
29
- </slot>
30
- </r-container>
31
- </template>
32
- </r-float>
33
- </r-container>
17
+ }" fill full-width>
18
+ <slot
19
+ :expand="expand"
20
+ :link="link"
21
+ :model-value="node"
22
+ :openAll="openAll"
23
+ :parent-node="nodeParent"
24
+ :selected="selected"
25
+ @expand="handleExpand(ease,move,transform,$event)"
26
+ @select="handleSelect"
27
+ @update:model-value="$emit('update:modelValue',$event)"
28
+ >
29
+ </slot>
30
+ </r-container>
31
+ </template>
32
+ </r-float>
33
+ </r-container>
34
34
 
35
35
  </template>
36
36
  <script>
37
37
 
38
- export default {
39
- name: 'r-tree',
40
-
41
- props: {
42
- modelValue: Object,
43
- link: String,
44
- searchLink: String,
45
- gen: String,
46
- selected: String,
47
- rotate: Boolean,
48
- expand: {
49
- type: Boolean,
50
- default: false
51
- },
52
- childsName: {
53
- type: String,
54
- default: 'childs'
55
- },
56
- openAll: Boolean,
57
- headers: Object
58
- },
59
- emits:['update:modelValue','select-node'],
60
- data() {
61
- return {
62
- show: false,
63
- search: null,
64
- nodeParent: this.gen,
65
- node: this.modelValue
66
- }
67
- },
68
- created() {
69
- if (this.modelValue) {
70
- this.show = true
71
- } else if (this.link) {
72
- this.get()
73
- }
74
- },
75
- watch: {
76
- modelValue: function (newVal) {
77
- this.node = newVal
78
- }
79
- },
80
- computed:{
81
- classes(){
82
- let a={'tree-searchable':this.searchLink}
83
- a[`${this.$r.prefix}tree`]=true
84
- return a
85
- }
86
- },
87
- methods: {
88
- change(e) {
89
- if (e && "value" in e) {
90
- this.nodeParent = e.value
91
- this.show = false
92
- this.get()
93
- }
94
- },
95
- get() {
96
- this.$axios.get(this.link + this.nodeParent, {headers: this.headers})
97
- .then(({data}) => {
98
- this.node = data
99
- this.show = true
100
- })
101
- },
102
- handleExpand(ease, move, transform, $event) {
103
- const el = $event[1].getBoundingClientRect()
104
- ease()
105
- const node_info=$event[1].querySelector('.node-info').getBoundingClientRect()
106
- const card_h = node_info.height
107
- const card_w = node_info.width
108
- const parent = this.$refs.tree.$el
109
- const bb = this.$refs.tree.$el.getBoundingClientRect()
110
- move(parent.offsetWidth / 2 - (el.left - bb.left + ($event[0] ? el.width / 2 : el.width - card_w / 2)),
111
- parent.offsetHeight / 2 - (el.top - bb.top +(this.rotate ? el.height- card_h :card_h/2) ))
112
- },
113
- handleSelect(e) {
114
- this.$emit('select-node', e)
115
- }
116
- }
38
+ export default {
39
+ name: 'r-tree',
40
+ props: {
41
+ modelValue: Object,
42
+ link: String,
43
+ searchLink: String,
44
+ gen: String,
45
+ selected: String,
46
+ rotate: Boolean,
47
+ expand: {
48
+ type: Boolean,
49
+ default: false
50
+ },
51
+ childsName: {
52
+ type: String,
53
+ default: 'childs'
54
+ },
55
+ openAll: Boolean,
56
+ headers: Object
57
+ },
58
+ emits: ['update:modelValue', 'select-node'],
59
+ data() {
60
+ return {
61
+ show: false,
62
+ search: null,
63
+ nodeParent: this.gen,
64
+ node: this.modelValue
65
+ }
66
+ },
67
+ created() {
68
+ if (this.modelValue) {
69
+ this.show = true
70
+ } else if (this.link) {
71
+ this.get()
72
+ }
73
+ },
74
+ watch: {
75
+ modelValue: function (newVal) {
76
+ this.node = newVal
77
+ }
78
+ },
79
+ computed: {
80
+ classes() {
81
+ let a = {'tree-searchable': this.searchLink}
82
+ a[`${this.$r.prefix}tree`] = true
83
+ return a
84
+ }
85
+ },
86
+ methods: {
87
+ change(e) {
88
+ if (e && "value" in e) {
89
+ this.nodeParent = e.value
90
+ this.show = false
91
+ this.get()
92
+ }
93
+ },
94
+ get() {
95
+ this.$axios.get(this.link + this.nodeParent, {headers: this.headers})
96
+ .then(({data}) => {
97
+ this.node = data
98
+ this.show = true
99
+ })
100
+ },
101
+ handleExpand(ease, move, transform, $event) {
102
+ const el = $event[1].getBoundingClientRect()
103
+ ease()
104
+ const node_info = $event[1].querySelector('.node-info').getBoundingClientRect()
105
+ const card_h = node_info.height
106
+ const card_w = node_info.width
107
+ const parent = this.$refs.tree.$el
108
+ const bb = this.$refs.tree.$el.getBoundingClientRect()
109
+ move(parent.offsetWidth / 2 - (el.left - bb.left + ($event[0] ? el.width / 2 : el.width - card_w / 2)),
110
+ parent.offsetHeight / 2 - (el.top - bb.top + (this.rotate ? el.height - card_h : card_h / 2)))
111
+ },
112
+ handleSelect(e) {
113
+ this.$emit('select-node', e)
117
114
  }
115
+ }
116
+ }
118
117
  </script>
119
118
  <style lang="scss">
120
- @import "../../style/include";
119
+ @import "../../style/include";
121
120
 
122
- $distance: 20px;
123
- .#{$prefix}tree {
124
- position: relative;
125
- width: 100%;
126
- height: 100%;
127
- background-color: var(--color-background-one);
121
+ $distance: 20px;
122
+ .#{$prefix}tree {
123
+ position: relative;
124
+ width: 100%;
125
+ height: 100%;
126
+ background-color: var(--color-background-one);
128
127
 
129
- &.tree-searchable {
130
- .#{$prefix}float {
131
- height: calc(100% - 70px)
132
- }
133
- }
134
-
135
- .#{$prefix}float {
136
- direction: ltr;
137
- }
128
+ &.tree-searchable {
129
+ .#{$prefix}float {
130
+ height: calc(100% - 70px)
131
+ }
132
+ }
138
133
 
139
- .tree-rotate {
140
- transform: rotateX(180deg);
134
+ .#{$prefix}float {
135
+ direction: ltr;
136
+ }
141
137
 
142
- .node-info {
143
- transform: rotateX(-180deg);
144
- }
138
+ .tree-rotate {
139
+ transform: rotateX(180deg);
145
140
 
146
- .tree-btn-expand {
147
- transform: rotateX(-180deg);
148
- }
149
- }
141
+ .node-info {
142
+ transform: rotateX(-180deg);
143
+ }
150
144
 
145
+ .tree-btn-expand {
146
+ transform: rotateX(-180deg);
151
147
  }
152
- </style>
148
+ }
149
+
150
+ }
151
+ </style>
@@ -3,7 +3,7 @@
3
3
  <r-row class="h-center flex-nowrap no-gutters">
4
4
  <r-col class="text-center">
5
5
  <div class="d-flex h-center mb-1 node-info">
6
- <component :is="componentName" :node="node[nodeKey]"
6
+ <component :is="componentElm" :node="node[nodeKey]"
7
7
  @fire="$emit('fire',$event)"
8
8
  @click.prevent="$emit('select',{key:nodeKey,item:node[nodeKey]})"
9
9
  ></component>
@@ -32,7 +32,7 @@
32
32
  @expand="handleExpand"
33
33
  :expand="expand"
34
34
  :openAll="openAll"
35
- :component-name="componentName"
35
+ :component-name="componentElm"
36
36
  @fire="$emit('fire',$event)"
37
37
  @select="$emit('select',$event)"
38
38
  >
@@ -42,6 +42,7 @@
42
42
  </r-container>
43
43
  </template>
44
44
  <script>
45
+ import {markRaw} from "vue";
45
46
 
46
47
  export default {
47
48
  name: 'r-tree-element',
@@ -83,6 +84,15 @@ export default {
83
84
  }
84
85
  },
85
86
  computed: {
87
+ componentElm() {
88
+ if (!this.componentName) {
89
+ return
90
+ }
91
+ if (this.componentName.__v_skip) {
92
+ return this.componentName
93
+ }
94
+ return markRaw(this.componentName)
95
+ },
86
96
  node() {
87
97
  return this.modelValue
88
98
  },
@@ -99,6 +109,9 @@ export default {
99
109
  let s = []
100
110
  for (const key in childs) {
101
111
  if (this.$helper.hasKey(childs, key)) {
112
+ if (childs[key]['gen'] === undefined) {
113
+ childs[key]['gen'] = key
114
+ }
102
115
  s.push({
103
116
  'key': key,
104
117
  'value': childs[key]
@@ -169,6 +182,7 @@ $distance: 20px;
169
182
  direction: ltr;
170
183
  position: relative;
171
184
  display: table;
185
+ user-select: none;
172
186
 
173
187
  .btn-extend {
174
188
  position: relative;
@@ -266,4 +280,4 @@ $distance: 20px;
266
280
  }
267
281
  }
268
282
  }
269
- </style>
283
+ </style>
@@ -1,4 +1,4 @@
1
- import {keys,ifHas} from '../../tools/helper'
1
+ import {ifHas} from '../../tools/helper'
2
2
 
3
3
  let wrapper = {}
4
4
  let current=null
@@ -82,7 +82,7 @@ function mounted(el, binding) {
82
82
 
83
83
  el.eventsHandler = createHandlers(el, value,uid)
84
84
 
85
- keys(el.eventsHandler).forEach(eventName => {
85
+ Object.keys(el.eventsHandler).forEach(eventName => {
86
86
  el.addEventListener(eventName, el.eventsHandler[eventName], options)
87
87
  })
88
88
  }
@@ -98,10 +98,10 @@ function unmounted(el, binding) {
98
98
  if (!el.eventsHandler){
99
99
  return
100
100
  }
101
- keys(el.eventsHandler).forEach(eventName => {
102
- el.removeEventListener(eventName, el.eventsHandler[eventName]),options
101
+ Object.keys(el.eventsHandler).forEach(eventName => {
102
+ el.removeEventListener(eventName, el.eventsHandler[eventName]), options
103
103
  })
104
- wrapper[uid]={}
104
+ wrapper[uid] = {}
105
105
  delete el.eventsHandler
106
106
  }
107
107
 
@@ -11,8 +11,7 @@ const list = {
11
11
  'sortable': 'sortable',
12
12
  'touch': 'touch',
13
13
  'title': 'title',
14
-
15
-
14
+ 'skeleton': 'skeleton',
16
15
  }
17
16
  export const registers = (app, directives) => {
18
17
  directives.forEach((item) => {
@@ -4,7 +4,7 @@ function fireEvent(el, eventName, data) {
4
4
  el.dispatchEvent(e);
5
5
  }
6
6
 
7
- const maskStart = /^([^0ANX]+)/;
7
+ const maskStart = /^([^BANX]+)/;
8
8
 
9
9
  function getInputElement(element) {
10
10
  if (element.tagName.toLocaleUpperCase() === 'INPUT') {
@@ -60,9 +60,6 @@ function format(data, mask = '') {
60
60
  }
61
61
 
62
62
  break loop;
63
- case '?':
64
- dataOffset++;
65
- break;
66
63
  case 'X':
67
64
  dataOutput += dataChar;
68
65
  unmask += dataChar
@@ -0,0 +1,27 @@
1
+ import "./style.scss";
2
+
3
+ function mounted(el, binding) {
4
+ let data = binding.value;
5
+ if (!data.loading) {
6
+ el.classList.add("r-skeleton");
7
+ }
8
+ }
9
+
10
+ function updated(el, binding) {
11
+ if (binding.value === binding.oldValue) {
12
+ return null;
13
+ }
14
+
15
+ unmounted(el);
16
+ mounted(el, binding);
17
+ }
18
+
19
+ function unmounted(el) {
20
+ el.classList.remove("r-skeleton");
21
+ }
22
+
23
+ export default {
24
+ mounted,
25
+ updated,
26
+ unmounted,
27
+ };
@@ -0,0 +1,37 @@
1
+ @import "~renusify/style/include";
2
+
3
+ .r-skeleton {
4
+ * {
5
+ opacity: 0 !important;
6
+ }
7
+
8
+ -webkit-text-fill-color: transparent !important;
9
+
10
+ background-color: rgba(0, 0, 0, 0.12) !important;
11
+ overflow: hidden !important;
12
+ position: relative !important;
13
+
14
+ &:after {
15
+ animation: skeletonloading 1.5s infinite;
16
+ content: "";
17
+ height: 100%;
18
+ left: 0;
19
+ position: absolute;
20
+ right: 0;
21
+ top: 0;
22
+ transform: translateX(-100%);
23
+ z-index: 1;
24
+ background: linear-gradient(
25
+ 90deg,
26
+ hsla(0, 0%, 100%, 0),
27
+ hsla(0, 0%, 100%, 0.3),
28
+ hsla(0, 0%, 100%, 0)
29
+ );
30
+ }
31
+
32
+ @keyframes skeletonloading {
33
+ 100% {
34
+ transform: translateX(100%);
35
+ }
36
+ }
37
+ }
@@ -1,5 +1,5 @@
1
1
  import './style.scss'
2
- import {cleanArray, ifHas, keys} from '../../tools/helper'
2
+ import {cleanArray, ifHas} from '../../tools/helper'
3
3
 
4
4
  let scopeObj;
5
5
 
@@ -153,7 +153,7 @@ function mounted(el, binding) {
153
153
  c = grab
154
154
  }
155
155
  c.classList.add("grab");
156
- keys(el.eventsHandler).forEach(eventName => {
156
+ Object.keys(el.eventsHandler).forEach(eventName => {
157
157
  c.addEventListener(eventName, el.eventsHandler[eventName], {
158
158
  passive: true
159
159
  })
@@ -188,7 +188,7 @@ function unmounted(el, binding) {
188
188
  if (!el.eventsHandler) {
189
189
  return
190
190
  }
191
- keys(el.eventsHandler).forEach(eventName => {
191
+ Object.keys(el.eventsHandler).forEach(eventName => {
192
192
  c.removeEventListener(eventName, el.eventsHandler[eventName], {
193
193
  passive: true
194
194
  })
@@ -1,5 +1,4 @@
1
1
  import './style.scss'
2
- import {keys} from '../../tools/helper'
3
2
 
4
3
  function mousestart(el, binding) {
5
4
  let d = 'top'
@@ -91,7 +90,7 @@ function mounted(el, binding) {
91
90
 
92
91
  el.eventsHandler= createHandlers(el, binding)
93
92
 
94
- keys(el.eventsHandler).forEach(eventName => {
93
+ Object.keys(el.eventsHandler).forEach(eventName => {
95
94
  el.addEventListener(eventName, el.eventsHandler[eventName], options)
96
95
  })
97
96
  }
@@ -110,7 +109,7 @@ function unmounted(el, binding) {
110
109
  if (!el.eventsHandler){
111
110
  return
112
111
  }
113
- keys(el.eventsHandler).forEach(eventName => {
112
+ Object.keys(el.eventsHandler).forEach(eventName => {
114
113
  el.removeEventListener(eventName, el.eventsHandler[eventName])
115
114
  })
116
115
  delete el.eventsHandler
@@ -1,5 +1,3 @@
1
- import {keys} from '../../tools/helper'
2
-
3
1
  const handleGesture = wrapper => {
4
2
  const {
5
3
  startX,
@@ -159,7 +157,7 @@ function mounted(el, binding) {
159
157
  }
160
158
 
161
159
  el.eventsHandler = createHandlers(value)
162
- keys(el.eventsHandler).forEach(eventName => {
160
+ Object.keys(el.eventsHandler).forEach(eventName => {
163
161
  el.addEventListener(eventName, el.eventsHandler[eventName], options)
164
162
  })
165
163
  }, 1000)
@@ -171,7 +169,7 @@ function unmounted(el, binding) {
171
169
  if (!el.eventsHandler) {
172
170
  return
173
171
  }
174
- keys(el.eventsHandler).forEach(eventName => {
172
+ Object.keys(el.eventsHandler).forEach(eventName => {
175
173
  el.removeEventListener(eventName, el.eventsHandler[eventName])
176
174
  })
177
175
  delete el.eventsHandler
package/index.js CHANGED
@@ -4,7 +4,7 @@ import Translate from './plugins/trans/Translate';
4
4
  import Storage from './plugins/storage/index';
5
5
  import DateTime from './plugins/trans/DateTime';
6
6
  import Currency from './plugins/trans/Currency';
7
- import Notify from './components/app/notify/notify.js';
7
+ import Notify from './components/notify/notify.js';
8
8
  import valid from './plugins/validation/Validate';
9
9
  import Toast from './components/app/toast/toast.js';
10
10
  import event from './plugins/event';
@@ -84,19 +84,24 @@ export default {
84
84
  },
85
85
  },
86
86
  autoAddTranslate: true,
87
+ useNotify: false,
87
88
  package: null,
88
89
  store: {},
89
- icons: Icons,
90
- breakpoint: breakpointData
90
+ icons: Icons
91
91
  }, options))
92
- // renusify notify
93
- app.config.globalProperties.$notify = function (message = null) {
94
- if (message === null) {
95
- Notify.hide();
96
- } else {
97
- Notify.show(message);
92
+ app.config.globalProperties.$r.breakpoint = breakpointData
93
+ if (app.config.globalProperties.$r.useNotify) {
94
+ // renusify notify
95
+ app.config.globalProperties.$notify = function (message = null, settings = {}) {
96
+ if (message === null) {
97
+ Notify.hide();
98
+ } else {
99
+ settings['data'] = message
100
+ Notify.show(settings);
101
+ }
98
102
  }
99
103
  }
104
+
100
105
  // renusify toast
101
106
  app.config.globalProperties.$toast = function (message, options) {
102
107
  Toast.show(message, options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "renusify",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "description": "Vue3 Framework",
5
5
  "keywords": [
6
6
  "vuejs",