renusify 2.0.4 → 2.1.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 (174) hide show
  1. package/components/app/index.js +5 -0
  2. package/components/app/index.vue +0 -2
  3. package/components/avatar/index.js +3 -0
  4. package/components/bar/bottomNav.js +1 -0
  5. package/components/bar/bottomNavigationCircle.js +2 -0
  6. package/components/bar/bottomNavigationCircle.vue +1 -1
  7. package/components/bar/toolbar/index.js +8 -0
  8. package/components/bar/toolbar/laptop.vue +2 -2
  9. package/components/bar/toolbar/menuLaptop.vue +2 -2
  10. package/components/bar/toolbar/menuMob.vue +28 -28
  11. package/components/bar/toolbar/mobile.vue +2 -2
  12. package/components/breadcrumb/index.js +3 -0
  13. package/components/breadcrumb/index.vue +0 -2
  14. package/components/button/buttonConfirm.js +3 -0
  15. package/components/button/buttonConfirm.vue +1 -1
  16. package/components/button/buttonGroup.js +7 -0
  17. package/components/button/index.js +3 -0
  18. package/components/calendar/index.js +10 -0
  19. package/components/calendar/index.vue +4 -7
  20. package/components/card/index.js +3 -0
  21. package/components/card/style.scss +2 -3
  22. package/components/chart/chart.js +1 -0
  23. package/components/chart/chart.vue +8 -5
  24. package/components/chart/worldMap.js +2 -0
  25. package/components/chart/worldMap.vue +1 -1
  26. package/components/chat/MessageList.vue +2 -6
  27. package/components/chat/chatInput.vue +1 -1
  28. package/components/chat/index.js +11 -0
  29. package/components/chat/index.vue +2 -5
  30. package/components/chip/index.js +3 -0
  31. package/components/codeEditor/highlightCss.vue +1 -1
  32. package/components/codeEditor/highlightHtml.vue +1 -1
  33. package/components/codeEditor/highlightJs.vue +1 -1
  34. package/components/codeEditor/index.js +3 -0
  35. package/components/codeEditor/index.vue +206 -199
  36. package/components/confirm/index.js +10 -0
  37. package/components/container/col.js +1 -0
  38. package/components/container/divider.js +1 -0
  39. package/components/container/index.js +1 -0
  40. package/components/container/row.js +1 -0
  41. package/components/container/spacer.js +1 -0
  42. package/components/content/index.js +1 -0
  43. package/components/countdown/index.js +1 -0
  44. package/components/cropper/index.js +3 -0
  45. package/components/cropper/index.vue +1 -1
  46. package/components/float/index.js +1 -0
  47. package/components/form/addressInput/index.js +4 -0
  48. package/components/form/camInput/index.js +4 -0
  49. package/components/form/{camInput.vue → camInput/index.vue} +1 -1
  50. package/components/form/checkInput/index.js +4 -0
  51. package/components/form/{check-input.vue → checkInput/index.vue} +1 -1
  52. package/components/form/checkboxInput/index.js +3 -0
  53. package/components/form/{checkbox.vue → checkboxInput/index.vue} +1 -1
  54. package/components/form/colorInput/index.js +7 -0
  55. package/components/form/{colorPicker → colorInput}/index.vue +2 -2
  56. package/components/form/{colorPicker → colorInput}/picker.vue +5 -9
  57. package/components/form/dateInput/index.js +8 -0
  58. package/components/form/dateInput/index.vue +475 -0
  59. package/components/form/fileInput/index.js +8 -0
  60. package/components/form/{fileUploader → fileInput}/index.vue +2 -2
  61. package/components/form/groupInput/index.js +4 -0
  62. package/components/form/{group-input.vue → groupInput/index.vue} +1 -1
  63. package/components/form/index.js +1 -0
  64. package/components/form/input/index.js +3 -0
  65. package/components/form/{input.vue → input/index.vue} +1 -1
  66. package/components/form/{json → jsonInput}/JsonView.vue +1 -1
  67. package/components/form/jsonInput/index.js +7 -0
  68. package/components/form/{json → jsonInput}/index.vue +7 -7
  69. package/components/form/maskInput/index.js +3 -0
  70. package/components/form/numberInput/index.js +4 -0
  71. package/components/form/{number.vue → numberInput/index.vue} +1 -1
  72. package/components/form/passwordInput/index.js +3 -0
  73. package/components/form/radioInput/index.js +3 -0
  74. package/components/form/{radioInput.vue → radioInput/index.vue} +1 -1
  75. package/components/form/rangeInput/index.js +3 -0
  76. package/components/form/{range.vue → rangeInput/index.vue} +1 -1
  77. package/components/form/ratingInput/index.js +4 -0
  78. package/components/form/{rating.vue → ratingInput/index.vue} +1 -1
  79. package/components/form/selectInput/index.js +8 -0
  80. package/components/form/{select.vue → selectInput/index.vue} +34 -2
  81. package/components/form/switchInput/index.js +2 -0
  82. package/components/form/{switch.vue → switchInput/index.vue} +1 -1
  83. package/components/form/telInput/index.js +7 -0
  84. package/components/form/{inputTel → telInput}/index.vue +5 -5
  85. package/components/form/text-editor/index.js +15 -0
  86. package/components/form/text-editor/preview.js +1 -0
  87. package/components/form/text-editor/preview.vue +14 -13
  88. package/components/form/text-editor/style.scss +4 -2
  89. package/components/form/textArea/index.js +2 -0
  90. package/components/form/{text-area.vue → textArea/index.vue} +1 -1
  91. package/components/form/textInput/index.js +2 -0
  92. package/components/form/timeInput/index.js +5 -0
  93. package/components/form/{timepicker → timeInput}/index.vue +2 -2
  94. package/components/form/timeInput/range.js +5 -0
  95. package/components/form/{timepicker → timeInput}/range.vue +2 -2
  96. package/components/form/uniqueInput/index.js +2 -0
  97. package/components/form/unitInput/index.js +3 -0
  98. package/components/form/{unit-input.vue → unitInput/index.vue} +1 -1
  99. package/components/formCreator/index.js +8 -0
  100. package/components/html2pdf/index.js +4 -0
  101. package/components/html2pdf/pageBreak.js +1 -0
  102. package/components/icon/index.js +1 -0
  103. package/components/img/index.js +2 -0
  104. package/components/img/index.vue +2 -2
  105. package/components/img/svgImg.vue +1 -1
  106. package/components/index.js +100 -191
  107. package/components/infinite/div.js +6 -0
  108. package/components/infinite/index.js +7 -0
  109. package/components/infinite/page.js +3 -0
  110. package/components/list/index.js +3 -0
  111. package/components/map/index.js +5 -0
  112. package/components/map/index.vue +8 -7
  113. package/components/map/route.js +9 -0
  114. package/components/map/route.vue +1 -1
  115. package/components/map/select.js +2 -0
  116. package/components/menu/index.js +5 -0
  117. package/components/message/index.js +4 -0
  118. package/components/meta/index.js +1 -1
  119. package/components/modal/index.js +3 -0
  120. package/components/modal/index.vue +6 -2
  121. package/components/modal/style.scss +1 -0
  122. package/components/nestable/NestableItem.vue +163 -0
  123. package/components/nestable/editable.js +44 -0
  124. package/components/nestable/index.js +1 -0
  125. package/components/nestable/index.vue +109 -0
  126. package/components/nestable/methods.js +397 -0
  127. package/components/notify/index.js +3 -0
  128. package/components/notify/index.vue +2 -2
  129. package/components/progress/circle.js +1 -0
  130. package/components/progress/line.js +1 -0
  131. package/components/searchBox/index.js +8 -0
  132. package/components/searchBox/index.vue +1 -1
  133. package/components/skeleton/index.js +1 -0
  134. package/components/skeleton/index.vue +1 -1
  135. package/components/slider/index.js +6 -0
  136. package/components/swiper/index.js +2 -0
  137. package/components/table/crud/index.js +20 -0
  138. package/components/table/crud/index.vue +459 -453
  139. package/components/table/index.js +11 -0
  140. package/components/table/index.vue +10 -17
  141. package/components/tabs/index.js +3 -0
  142. package/components/timeAgo/index.js +1 -0
  143. package/components/timeline/index.js +6 -0
  144. package/components/timeline/index.vue +1 -1
  145. package/components/tour/index.js +4 -0
  146. package/components/tour/index.vue +225 -221
  147. package/components/tree/index.js +9 -0
  148. package/components/tree/index.vue +120 -120
  149. package/components/tree/tree-element.vue +5 -18
  150. package/directive/index.js +17 -18
  151. package/package.json +1 -1
  152. package/components/form/address_ir.vue +0 -106
  153. package/components/form/datePicker/index.vue +0 -473
  154. package/components/iframe/index.vue +0 -67
  155. /package/components/form/{address.vue → addressInput/index.vue} +0 -0
  156. /package/components/form/{colorPicker → colorInput}/Alpha.vue +0 -0
  157. /package/components/form/{colorPicker → colorInput}/Hue.vue +0 -0
  158. /package/components/form/{colorPicker → colorInput}/Preview.vue +0 -0
  159. /package/components/form/{colorPicker → colorInput}/Saturation.vue +0 -0
  160. /package/components/form/{colorPicker → colorInput}/mixin.js +0 -0
  161. /package/components/form/{datePicker → dateInput}/month.vue +0 -0
  162. /package/components/form/{datePicker → dateInput}/year.vue +0 -0
  163. /package/components/form/{fileUploader → fileInput}/file.js +0 -0
  164. /package/components/form/{fileUploader → fileInput}/single.vue +0 -0
  165. /package/components/form/{form.vue → index.vue} +0 -0
  166. /package/components/form/{mask-input.vue → maskInput/index.vue} +0 -0
  167. /package/components/form/{password.vue → passwordInput/index.vue} +0 -0
  168. /package/components/form/{inputTel → telInput}/assets/all-countries.js +0 -0
  169. /package/components/form/{inputTel → telInput}/assets/flags.png +0 -0
  170. /package/components/form/{inputTel → telInput}/assets/flags@2x.png +0 -0
  171. /package/components/form/{inputTel → telInput}/assets/sprite.css +0 -0
  172. /package/components/form/{text-input.vue → textInput/index.vue} +0 -0
  173. /package/components/form/{timepicker → timeInput}/timepicker.vue +0 -0
  174. /package/components/form/{unique → uniqueInput}/index.vue +0 -0
@@ -0,0 +1,44 @@
1
+ export default {
2
+ data() {
3
+ return {
4
+ name: null,
5
+ };
6
+ },
7
+ methods: {
8
+ lastId(list) {
9
+ let r = 0;
10
+ list.map((item) => {
11
+ if (typeof item.id === "number" && item.id > r) {
12
+ r = item.id;
13
+ }
14
+ let d = this.lastId(item[this.childrenProp]);
15
+ if (d > r) {
16
+ r = d;
17
+ }
18
+ });
19
+ return r;
20
+ },
21
+ add() {
22
+ let items = this.modelValue;
23
+ items.push({
24
+ title: this.name,
25
+ [this.keyProp]: this.lastId(items) + 1,
26
+ [this.childrenProp]: [],
27
+ });
28
+ this.$emit("update:model-value", items);
29
+ this.name = null;
30
+ },
31
+ del(item) {
32
+ const removePath = this.getSplicePath(
33
+ this.getPathById(item[this.keyProp]),
34
+ {
35
+ numToRemove: 1,
36
+ childrenProp: this.childrenProp,
37
+ }
38
+ );
39
+ let items = this.modelValue;
40
+ items = this.update(items, removePath);
41
+ this.$emit("update:model-value", items);
42
+ },
43
+ },
44
+ };
@@ -0,0 +1 @@
1
+ export * as rNestable from './index.vue'
@@ -0,0 +1,109 @@
1
+ <template>
2
+ <div ref="nestable" :class="`${$r.prefix}nestable`">
3
+ <div class="nestable-list nestable-group">
4
+ <template v-for="(item, index) in modelValue" :key="index">
5
+ <nestable-item
6
+ :childrenProp="childrenProp"
7
+ :dragItem="dragItem"
8
+ :editable="editable"
9
+ :index="index"
10
+ :item="item"
11
+ :keyProp="keyProp"
12
+ @delete="del"
13
+ @drag-start="dragstart"
14
+ @touch-move="touchmove"
15
+ @mouse-enter="mouseenter"
16
+ @drag-end="onDragEnd"
17
+ >
18
+ <template v-slot="{ item }">
19
+ <slot :item="item">{{ item }}</slot>
20
+ </template>
21
+ </nestable-item>
22
+ </template>
23
+ </div>
24
+ <div v-if="editable" class="d-flex v-end w-full">
25
+ <div class="pe-1 flex-grow-1">
26
+ <r-text-input v-model="name" :label="labelInput"></r-text-input>
27
+ </div>
28
+ <r-btn :disabled="!name" class="color-success" icon @click="add">
29
+ <r-icon v-html="$r.icons.plus"></r-icon>
30
+ </r-btn>
31
+ </div>
32
+ </div>
33
+ </template>
34
+
35
+ <script>
36
+ import {defineAsyncComponent} from 'vue'
37
+ import methods from "./methods";
38
+ import editable from "./editable";
39
+
40
+ export default {
41
+ name: "r-nestable",
42
+ components: {
43
+ NestableItem:defineAsyncComponent(()=>import('./NestableItem.vue')),
44
+ },
45
+ mixins: [methods, editable],
46
+ props: {
47
+ labelInput: String,
48
+ editable: Boolean,
49
+ modelValue: {
50
+ type: Array,
51
+ default: () => [],
52
+ },
53
+ threshold: {
54
+ type: Number,
55
+ default: 30,
56
+ },
57
+ maxDepth: {
58
+ type: Number,
59
+ default: 7,
60
+ },
61
+ keyProp: {
62
+ type: String,
63
+ default: "id",
64
+ },
65
+ childrenProp: {
66
+ type: String,
67
+ default: "children",
68
+ },
69
+ },
70
+ data() {
71
+ return {
72
+ itemsOld: null,
73
+ dragItem: null,
74
+ mouse: {
75
+ last: {x: 0},
76
+ shift: {x: 0},
77
+ },
78
+ };
79
+ },
80
+ mounted() {
81
+ const items = this.listAddChildren(this.modelValue, this.childrenProp);
82
+ this.$emit("update:model-value", items);
83
+ },
84
+ beforeUnmount() {
85
+ this.stopTrackMouse();
86
+ },
87
+ };
88
+ </script>
89
+ <style lang="scss">
90
+ @import "../../style/include";
91
+
92
+ .#{$prefix}nestable {
93
+ .nestable-handle {
94
+ cursor: grab;
95
+ }
96
+
97
+ .is-dragging {
98
+ cursor: grabbing !important;
99
+ }
100
+
101
+ .nestable-drag-item {
102
+ display: none;
103
+ }
104
+
105
+ .nestable-item-content {
106
+ display: flex;
107
+ }
108
+ }
109
+ </style>
@@ -0,0 +1,397 @@
1
+ export default {
2
+ methods: {
3
+ listAddChildren(list, childrenProp) {
4
+ return list.map((item) => {
5
+ return {
6
+ ...item,
7
+ [childrenProp]: item[childrenProp]
8
+ ? this.listAddChildren(item[childrenProp], childrenProp)
9
+ : [],
10
+ };
11
+ });
12
+ },
13
+ mouseenter(e) {
14
+ this.onMouseEnter(e[0], e[1]);
15
+ },
16
+ touchmove(e) {
17
+ this.onMouseMove(e);
18
+ },
19
+ dragstart(e) {
20
+ this.onDragStart(e[0], e[1]);
21
+ },
22
+ startTrackMouse() {
23
+ document.addEventListener("mousemove", this.onMouseMove);
24
+ document.addEventListener("mouseup", this.onDragEnd);
25
+ document.addEventListener("touchend", this.onDragEnd);
26
+ document.addEventListener("touchcancel", this.onDragEnd);
27
+ document.addEventListener("keydown", this.onKeyDown);
28
+ },
29
+
30
+ stopTrackMouse() {
31
+ document.removeEventListener("mousemove", this.onMouseMove);
32
+ document.removeEventListener("mouseup", this.onDragEnd);
33
+ document.removeEventListener("touchend", this.onDragEnd);
34
+ document.removeEventListener("touchcancel", this.onDragEnd);
35
+ document.removeEventListener("keydown", this.onKeyDown);
36
+ },
37
+
38
+ onDragStart(event, item) {
39
+ if (event) {
40
+ event.preventDefault();
41
+ event.stopPropagation();
42
+ }
43
+
44
+ this.startTrackMouse();
45
+
46
+ this.dragItem = item;
47
+ this.itemsOld = this.modelValue;
48
+
49
+ this.$nextTick(() => {
50
+ this.onMouseMove(event);
51
+ });
52
+ },
53
+
54
+ onDragEnd(event, isCancel) {
55
+ event && event.preventDefault();
56
+
57
+ this.stopTrackMouse();
58
+
59
+ isCancel ? this.dragRevert() : this.dragApply();
60
+ },
61
+
62
+ onKeyDown(event) {
63
+ if (event.which === 27) {
64
+ // ESC
65
+ this.onDragEnd(null, true);
66
+ }
67
+ },
68
+
69
+ getXandYFromEvent(event) {
70
+ let {clientX, clientY} = event;
71
+
72
+ const {targetTouches} = event;
73
+
74
+ if (targetTouches) {
75
+ const touch = targetTouches[0];
76
+ clientX = touch.clientX;
77
+ clientY = touch.clientY;
78
+ const event = new Event("mouseenter");
79
+ const element = document.elementFromPoint(clientX, clientY);
80
+ const touchElement =
81
+ element && element.closest(".nestable-item-content");
82
+ if (touchElement) touchElement.dispatchEvent(event);
83
+ }
84
+
85
+ return {clientX, clientY};
86
+ },
87
+
88
+ onMouseMove(event) {
89
+ event && event.preventDefault();
90
+
91
+ const {clientX} = this.getXandYFromEvent(event);
92
+
93
+ if (this.mouse.last.x === 0) {
94
+ this.mouse.last.x = clientX;
95
+ }
96
+
97
+ const diffX = this.$r.rtl
98
+ ? this.mouse.last.x - clientX
99
+ : clientX - this.mouse.last.x;
100
+ if (
101
+ (diffX >= 0 && this.mouse.shift.x >= 0) ||
102
+ (diffX <= 0 && this.mouse.shift.x <= 0)
103
+ ) {
104
+ this.mouse.shift.x += diffX;
105
+ } else {
106
+ this.mouse.shift.x = 0;
107
+ }
108
+ this.mouse.last.x = clientX;
109
+
110
+ if (Math.abs(this.mouse.shift.x) > this.threshold) {
111
+ if (this.mouse.shift.x > 0) {
112
+ this.tryIncreaseDepth(this.dragItem);
113
+ } else {
114
+ this.tryDecreaseDepth(this.dragItem);
115
+ }
116
+
117
+ this.mouse.shift.x = 0;
118
+ }
119
+ },
120
+
121
+ moveItem({dragItem, pathFrom, pathTo}) {
122
+ const realPathTo = this.getRealNextPath(pathFrom, pathTo);
123
+
124
+ const removePath = this.getSplicePath(pathFrom, {
125
+ numToRemove: 1,
126
+ childrenProp: this.childrenProp,
127
+ });
128
+
129
+ const insertPath = this.getSplicePath(realPathTo, {
130
+ numToRemove: 0,
131
+ itemsToInsert: [dragItem],
132
+ childrenProp: this.childrenProp,
133
+ });
134
+
135
+ let items = this.modelValue;
136
+ items = this.update(items, removePath);
137
+ items = this.update(items, insertPath);
138
+
139
+ this.pathTo = realPathTo;
140
+ this.$emit("update:model-value", items);
141
+ },
142
+ isEquals(x, y) {
143
+ return x === y;
144
+ },
145
+ copy(o) {
146
+ return JSON.parse(JSON.stringify(o));
147
+ },
148
+ update(object, $spec) {
149
+ if (!object) {
150
+ return;
151
+ }
152
+ const that = this;
153
+ const commands = {
154
+ $splice(value, nextObject, spec, originalObject) {
155
+ value.forEach((args) => {
156
+ if (nextObject === originalObject && args.length) {
157
+ nextObject = that.copy(originalObject);
158
+ }
159
+ Array.prototype.splice.apply(nextObject, args);
160
+ });
161
+ return nextObject;
162
+ },
163
+ };
164
+ const spec = typeof $spec === "function" ? {$apply: $spec} : $spec;
165
+ let nextObject = object;
166
+ Object.keys(spec).forEach((key) => {
167
+ if (commands[key]) {
168
+ const objectWasNextObject = object === nextObject;
169
+ nextObject = commands[key](spec[key], nextObject, spec, object);
170
+ if (objectWasNextObject && this.isEquals(nextObject, object)) {
171
+ nextObject = object;
172
+ }
173
+ } else {
174
+ const nextValueForKey = this.update(object[key], spec[key]);
175
+ const nextObjectValue = nextObject[key];
176
+ if (
177
+ !this.isEquals(nextValueForKey, nextObjectValue) ||
178
+ (typeof nextValueForKey === "undefined" && !object[key])
179
+ ) {
180
+ if (nextObject === object) {
181
+ nextObject = this.copy(object);
182
+ }
183
+ nextObject[key] = nextValueForKey;
184
+ }
185
+ }
186
+ });
187
+ return nextObject;
188
+ },
189
+ tryIncreaseDepth(dragItem) {
190
+ let pathFrom;
191
+ try {
192
+ pathFrom = this.getPathById(dragItem[this.keyProp]);
193
+ } catch (e) {
194
+ this.dragRevert();
195
+ return;
196
+ }
197
+ const itemIndex = pathFrom[pathFrom.length - 1];
198
+ const newDepth = pathFrom.length + this.getItemDepth(dragItem);
199
+ if (itemIndex > 0 && newDepth <= this.maxDepth) {
200
+ const prevSibling = this.getItemByPath(
201
+ pathFrom.slice(0, -1).concat(itemIndex - 1)
202
+ );
203
+
204
+ if (
205
+ prevSibling[this.childrenProp] &&
206
+ (!prevSibling[this.childrenProp].length || true)
207
+ ) {
208
+ const pathTo = pathFrom
209
+ .slice(0, -1)
210
+ .concat(itemIndex - 1)
211
+ .concat(prevSibling[this.childrenProp].length);
212
+
213
+ this.moveItem({dragItem, pathFrom, pathTo});
214
+ }
215
+ }
216
+ },
217
+
218
+ tryDecreaseDepth(dragItem) {
219
+ let pathFrom;
220
+ try {
221
+ pathFrom = this.getPathById(dragItem[this.keyProp]);
222
+ } catch (e) {
223
+ this.dragRevert();
224
+ return;
225
+ }
226
+ const itemIndex = pathFrom[pathFrom.length - 1];
227
+
228
+ if (pathFrom.length > 1) {
229
+ const parent = this.getItemByPath(pathFrom.slice(0, -1));
230
+
231
+ if (itemIndex + 1 === parent[this.childrenProp].length) {
232
+ const pathTo = pathFrom.slice(0, -1);
233
+ pathTo[pathTo.length - 1] += 1;
234
+
235
+ this.moveItem({dragItem, pathFrom, pathTo});
236
+ }
237
+ }
238
+ },
239
+
240
+ onMouseEnter(event, item) {
241
+ if (event) {
242
+ event.preventDefault();
243
+ event.stopPropagation();
244
+ }
245
+
246
+ if (!this.dragItem) return;
247
+
248
+ if (item !== null && this.dragItem[this.keyProp] === item[this.keyProp])
249
+ return;
250
+ let pathFrom;
251
+ try {
252
+ pathFrom = this.getPathById(this.dragItem[this.keyProp]);
253
+ } catch (e) {
254
+ this.dragRevert();
255
+ return;
256
+ }
257
+
258
+ if (pathFrom.length === 0) return;
259
+
260
+ let pathTo = null;
261
+ if (item === null) {
262
+ pathTo = pathFrom.length > 0 ? [] : [0];
263
+ } else {
264
+ pathTo = this.getPathById(item[this.keyProp]);
265
+ }
266
+
267
+ const newDepth =
268
+ this.getRealNextPath(pathFrom, pathTo).length +
269
+ (this.getItemDepth(this.dragItem) - 1);
270
+ if (newDepth > this.maxDepth) {
271
+ return;
272
+ }
273
+
274
+ this.moveItem({dragItem: this.dragItem, pathFrom, pathTo});
275
+ },
276
+
277
+ dragApply() {
278
+ this.$emit("change", this.dragItem, {
279
+ items: this.modelValue,
280
+ pathTo: this.pathTo,
281
+ });
282
+
283
+ this.pathTo = null;
284
+ this.itemsOld = null;
285
+ this.dragItem = null;
286
+ },
287
+
288
+ dragRevert() {
289
+ if (this.itemsOld) {
290
+ this.$emit("update:model-value", this.itemsOld);
291
+ }
292
+ this.pathTo = null;
293
+ this.itemsOld = null;
294
+ this.dragItem = null;
295
+ },
296
+ getPathById(id, items = this.modelValue) {
297
+ let path = [];
298
+ items.every((item, i) => {
299
+ if (item[this.keyProp] === id) {
300
+ path.push(i);
301
+ } else if (item[this.childrenProp]) {
302
+ const childrenPath = this.getPathById(id, item[this.childrenProp]);
303
+
304
+ if (childrenPath.length) {
305
+ path = path.concat(i).concat(childrenPath);
306
+ }
307
+ }
308
+
309
+ return path.length === 0;
310
+ });
311
+
312
+ return path;
313
+ },
314
+
315
+ getItemByPath(path, items = this.modelValue) {
316
+ let item = null;
317
+
318
+ path.forEach((index) => {
319
+ const list =
320
+ item && item[this.childrenProp] ? item[this.childrenProp] : items;
321
+ item = list[index];
322
+ });
323
+
324
+ return item;
325
+ },
326
+
327
+ getItemDepth(item) {
328
+ let level = 1;
329
+
330
+ if (item[this.childrenProp] && item[this.childrenProp].length > 0) {
331
+ const childrenDepths = item[this.childrenProp].map(this.getItemDepth);
332
+ level += Math.max(...childrenDepths);
333
+ }
334
+
335
+ return level;
336
+ },
337
+
338
+ getSplicePath(path, options = {}) {
339
+ const splicePath = {};
340
+ const numToRemove = options.numToRemove || 0;
341
+ const itemsToInsert = options.itemsToInsert || [];
342
+ const lastIndex = path.length - 1;
343
+ let currentPath = splicePath;
344
+
345
+ path.forEach((index, i) => {
346
+ if (i === lastIndex) {
347
+ currentPath.$splice = [[index, numToRemove, ...itemsToInsert]];
348
+ } else {
349
+ const nextPath = {};
350
+ currentPath[index] = {[options.childrenProp]: nextPath};
351
+ currentPath = nextPath;
352
+ }
353
+ });
354
+
355
+ return splicePath;
356
+ },
357
+
358
+ getRealNextPath(prevPath, nextPath) {
359
+ const ppLastIndex = prevPath.length - 1;
360
+ const npLastIndex = nextPath.length - 1;
361
+
362
+ if (prevPath.length < nextPath.length) {
363
+ let wasShifted = false;
364
+
365
+ return nextPath.map((nextIndex, i) => {
366
+ if (wasShifted) {
367
+ return i === npLastIndex ? nextIndex + 1 : nextIndex;
368
+ }
369
+
370
+ if (typeof prevPath[i] !== "number") {
371
+ return nextIndex;
372
+ }
373
+
374
+ if (nextPath[i] > prevPath[i] && i === ppLastIndex) {
375
+ wasShifted = true;
376
+ return nextIndex - 1;
377
+ }
378
+
379
+ return nextIndex;
380
+ });
381
+ } else if (prevPath.length === nextPath.length) {
382
+ if (nextPath[npLastIndex] > prevPath[npLastIndex]) {
383
+ const target = this.getItemByPath(nextPath);
384
+
385
+ if (target[this.childrenProp] && target[this.childrenProp].length) {
386
+ return nextPath
387
+ .slice(0, -1)
388
+ .concat(nextPath[npLastIndex] - 1)
389
+ .concat(0);
390
+ }
391
+ }
392
+ }
393
+
394
+ return nextPath;
395
+ },
396
+ },
397
+ };
@@ -0,0 +1,3 @@
1
+ export * as rNotify from './index.vue'
2
+ export * as l_btn from '../button/index.js'
3
+ export * as l_icon from '../icon/index.js'
@@ -30,11 +30,11 @@
30
30
  </div>
31
31
  </template>
32
32
  <script>
33
- import Notification from './notification.vue'
33
+ import {defineAsyncComponent} from 'vue'
34
34
 
35
35
  export default {
36
36
  components: {
37
- notification: Notification
37
+ notification: defineAsyncComponent(()=>import('./notification.vue'))
38
38
  },
39
39
  props: {
40
40
  permanent: {
@@ -0,0 +1 @@
1
+ export * as rProgressCircle from './circle.vue'
@@ -0,0 +1 @@
1
+ export * as rProgressLine from './line.vue'
@@ -0,0 +1,8 @@
1
+ export * as rSearchBox from './index.vue'
2
+ export * as l_line from '../progress/line.js'
3
+ export * as l_btn from '../button/index.js'
4
+ export * as l_card from '../card/index.js'
5
+ export * as l_list from '../list/index.js'
6
+ export * as l_icon from '../icon/index.js'
7
+ export * as l_select from '../form/selectInput/index.js'
8
+ export * as d_clickOutside from '../../directive/clickOutSide/index.js'
@@ -158,7 +158,7 @@ export default {
158
158
  };
159
159
  </script>
160
160
  <style lang="scss">
161
- @import "~renusify/style/include";
161
+ @import "../../style/include";
162
162
 
163
163
  .#{$prefix}search-box {
164
164
  position: relative;
@@ -0,0 +1 @@
1
+ export * as rSkeleton from './index.vue'
@@ -27,7 +27,7 @@ export default {
27
27
  </script>
28
28
 
29
29
  <style lang="scss">
30
- @import "~renusify/style/include";
30
+ @import "../../style/include";
31
31
 
32
32
  .#{$prefix}skeleton {
33
33
  .sk-card, .sk-line, .sk-avatar {
@@ -0,0 +1,6 @@
1
+ export * as rSlider from './index.vue'
2
+
3
+ export * as l_btn from '../button/index.js'
4
+ export * as l_icon from '../icon/index.js'
5
+ export * as l_line from '../progress/line.js'
6
+ export * as d_touch from '../../directive/touch/index.js'
@@ -0,0 +1,2 @@
1
+ export * as rSwiper from './index.vue'
2
+ export * as d_touch from '../../directive/touch/index.js'
@@ -0,0 +1,20 @@
1
+ export * as rTableCrud from './index.vue'
2
+ export * as l_table from '../index.js'
3
+ export * as l_modal from '../../modal/index.js'
4
+ export * as l_card from '../../card/index.js'
5
+ export * as l_form from '../../formCreator/index.js'
6
+ export * as l_btn from '../../button/index.js'
7
+ export * as l_icon from '../../icon/index.js'
8
+ export * as l_time from '../../timeAgo/index.js'
9
+ export * as l_confirm from '../../confirm/index.js'
10
+ export * as l_line from '../../progress/line.js'
11
+ export * as l_container from '../../container/index.js'
12
+ export * as l_row from '../../container/row.js'
13
+ export * as l_col from '../../container/col.js'
14
+ export * as l_divider from '../../container/divider.js'
15
+ export * as l_json from '../../form/jsonInput/index.js'
16
+ export * as l_text from '../../form/textInput/index.js'
17
+ export * as l_select from '../../form/selectInput/index.js'
18
+ export * as l_date from '../../form/dateInput/index.js'
19
+ export * as l_number from '../../form/numberInput/index.js'
20
+ export * as l_switch from '../../form/switchInput/index.js'