renusify 2.5.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/app/index.vue +74 -22
- package/components/app/toast/index.vue +76 -71
- package/components/app/toast/toast.vue +62 -44
- package/components/avatar/index.vue +208 -84
- package/components/button/buttonConfirm.vue +53 -26
- package/components/button/buttonGroup.js +0 -2
- package/components/button/buttonGroup.vue +310 -62
- package/components/button/index.vue +584 -100
- package/components/calendar/index.js +0 -2
- package/components/calendar/index.vue +326 -262
- package/components/calendar/month.vue +64 -55
- package/components/calendar/year.vue +30 -25
- package/components/card/index.vue +139 -59
- package/components/codeEditor/highlightCss.vue +38 -39
- package/components/codeEditor/highlightHtml.vue +64 -64
- package/components/codeEditor/highlightJs.vue +37 -38
- package/components/codeEditor/index.vue +129 -79
- package/components/codeEditor/run.vue +225 -39
- package/components/codeEditor/useCodeFormatter.js +150 -0
- package/components/confirm/index.vue +140 -81
- package/components/container/col.vue +5 -4
- package/components/container/divider.vue +28 -19
- package/components/container/index.vue +34 -15
- package/components/container/row.vue +26 -9
- package/components/container/spacer.vue +2 -4
- package/components/container/style.scss +3 -0
- package/components/content/index.vue +49 -32
- package/components/cropper/index.vue +401 -244
- package/components/float/index.vue +542 -415
- package/components/form/addressInput/index.vue +184 -109
- package/components/form/camInput/index.vue +370 -244
- package/components/form/checkInput/index.vue +138 -71
- package/components/form/checkboxInput/index.vue +87 -47
- package/components/form/colorInput/Alpha.vue +81 -83
- package/components/form/colorInput/Hue.vue +91 -68
- package/components/form/colorInput/Preview.vue +43 -47
- package/components/form/colorInput/Saturation.vue +101 -86
- package/components/form/colorInput/index.vue +72 -40
- package/components/form/colorInput/picker.vue +111 -106
- package/components/form/colorInput/useColor.js +153 -0
- package/components/form/dateInput/index.vue +691 -356
- package/components/form/dateInput/month.vue +63 -54
- package/components/form/dateInput/year.vue +35 -25
- package/components/form/fileInput/index.js +0 -1
- package/components/form/fileInput/index.vue +263 -106
- package/components/form/fileInput/single.vue +323 -164
- package/components/form/groupInput/index.vue +199 -101
- package/components/form/index.vue +189 -83
- package/components/form/input/index.vue +416 -377
- package/components/form/jsonInput/JsonView.vue +54 -56
- package/components/form/jsonInput/index.vue +247 -165
- package/components/form/maskInput/index.vue +252 -132
- package/components/form/numberInput/index.js +0 -1
- package/components/form/numberInput/index.vue +226 -117
- package/components/form/passwordInput/index.js +2 -1
- package/components/form/passwordInput/index.vue +269 -102
- package/components/form/radioInput/index.vue +143 -72
- package/components/form/rangeInput/index.vue +280 -167
- package/components/form/ratingInput/index.vue +57 -57
- package/components/form/selectInput/index.js +1 -3
- package/components/form/selectInput/index.vue +584 -296
- package/components/form/switchInput/index.vue +73 -59
- package/components/form/telInput/index.js +0 -1
- package/components/form/telInput/index.vue +238 -135
- package/components/form/textArea/index.vue +72 -35
- package/components/form/textEditor/index.vue +739 -0
- package/components/form/{text-editor → textEditor}/style.scss +8 -16
- package/components/form/textInput/index.vue +54 -32
- package/components/form/timeInput/index.vue +83 -56
- package/components/form/timeInput/range.vue +116 -95
- package/components/form/timeInput/timepicker.vue +382 -449
- package/components/form/uniqueInput/index.vue +105 -48
- package/components/form/unitInput/index.vue +139 -84
- package/components/formCreator/index.js +0 -1
- package/components/formCreator/index.vue +314 -148
- package/components/highlight/index.vue +41 -25
- package/components/highlight/style.scss +2 -2
- package/components/highlight/{mixin.js → useHighlight.js} +181 -160
- package/components/icon/index.vue +79 -33
- package/components/img/index.vue +249 -147
- package/components/img/preview.vue +180 -198
- package/components/img/svgImg.vue +42 -39
- package/components/index.js +5 -20
- package/components/infinite/index.js +1 -2
- package/components/infinite/index.vue +248 -66
- package/components/map/index.vue +428 -261
- package/components/map/route.vue +794 -487
- package/components/map/select.vue +118 -58
- package/components/menu/index.vue +201 -91
- package/components/meta/meta.js +26 -3
- package/components/modal/index.vue +383 -158
- package/components/notify/index.vue +204 -86
- package/components/notify/notification.vue +38 -55
- package/components/progress/circle.vue +189 -70
- package/components/progress/line.vue +266 -46
- package/components/searchBox/index.js +1 -3
- package/components/searchBox/index.vue +194 -101
- package/components/skeleton/index.vue +45 -20
- package/components/slider/index.vue +318 -156
- package/components/swiper/index.vue +254 -106
- package/components/table/crud/footer.vue +77 -53
- package/components/table/crud/header.vue +71 -72
- package/components/table/crud/index.vue +631 -401
- package/components/table/index.vue +721 -278
- package/components/timeAgo/index.vue +145 -96
- package/components/tour/index.vue +338 -235
- package/components/tree/index.vue +235 -89
- package/components/tree/tree-element.vue +107 -106
- package/directive/animate/index.js +77 -0
- package/directive/clickOutSide/index.js +98 -0
- package/directive/drag/index.js +153 -0
- package/directive/index.js +11 -13
- package/directive/intersect/index.js +263 -0
- package/directive/mask/index.js +67 -0
- package/directive/parallax/index.js +78 -0
- package/directive/ripple/index.js +14 -0
- package/directive/scroll/index.js +244 -0
- package/directive/sortable/index.js +274 -0
- package/directive/title/index.js +75 -0
- package/directive/touch/index.js +268 -0
- package/index.js +10 -8
- package/package.json +5 -2
- package/plugins/validation/Validate.js +88 -79
- package/scripts/generate-docs.mjs +226 -0
- package/scripts/menu.mjs +240 -0
- package/scripts/parser.mjs +1086 -0
- package/style/_index.scss +7 -0
- package/style/app.scss +13 -65
- package/style/colors.scss +5 -22
- package/style/functions/index.scss +8 -0
- package/style/mixins/index.scss +17 -5
- package/style/variables/base.scss +154 -175
- package/style/variables/color.scss +0 -12
- package/style/variables/utilities.scss +0 -180
- package/tools/helper.js +0 -8
- package/tools/icons.js +6 -1
- package/tools/root.js +71 -0
- package/components/app/style.scss +0 -41
- package/components/app/toast/style.scss +0 -20
- package/components/avatar/style.scss +0 -32
- package/components/bar/bottomNav.js +0 -1
- package/components/bar/bottomNav.vue +0 -28
- package/components/bar/bottomNavigationCircle.js +0 -2
- package/components/bar/bottomNavigationCircle.vue +0 -99
- package/components/bar/scss/bottomNav.scss +0 -67
- package/components/bar/scss/toolbar.scss +0 -174
- package/components/bar/toolbar/index.js +0 -8
- package/components/bar/toolbar/index.vue +0 -35
- package/components/bar/toolbar/laptop.vue +0 -33
- package/components/bar/toolbar/menuChilds.vue +0 -41
- package/components/bar/toolbar/menuLaptop.vue +0 -41
- package/components/bar/toolbar/menuMob.vue +0 -39
- package/components/bar/toolbar/mixin.js +0 -43
- package/components/bar/toolbar/mobile.vue +0 -34
- package/components/breadcrumb/bredcrumbItem.vue +0 -39
- package/components/breadcrumb/index.js +0 -3
- package/components/breadcrumb/index.vue +0 -71
- package/components/breadcrumb/style.scss +0 -51
- package/components/button/style.scss +0 -411
- package/components/card/style.scss +0 -86
- package/components/chart/chart.js +0 -1
- package/components/chart/chart.vue +0 -69
- package/components/chart/worldMap.js +0 -2
- package/components/chart/worldMap.vue +0 -1112
- package/components/chat/MessageList.vue +0 -163
- package/components/chat/chatInput.vue +0 -150
- package/components/chat/chatMsg.vue +0 -276
- package/components/chat/index.js +0 -11
- package/components/chat/index.vue +0 -113
- package/components/chip/index.js +0 -3
- package/components/chip/index.vue +0 -77
- package/components/chip/style.scss +0 -199
- package/components/codeEditor/mixin.js +0 -145
- package/components/countdown/index.js +0 -1
- package/components/countdown/index.vue +0 -105
- package/components/form/colorInput/mixin.js +0 -132
- package/components/form/fileInput/file.js +0 -148
- package/components/form/telInput/assets/flags.png +0 -0
- package/components/form/telInput/assets/flags@2x.png +0 -0
- package/components/form/text-editor/index.vue +0 -710
- package/components/icon/style.scss +0 -17
- package/components/infinite/div.js +0 -6
- package/components/infinite/div.vue +0 -193
- package/components/infinite/page.js +0 -3
- package/components/infinite/page.vue +0 -105
- package/components/list/index.js +0 -3
- package/components/list/index.vue +0 -122
- package/components/list/style.scss +0 -66
- package/components/message/index.js +0 -4
- package/components/message/index.vue +0 -40
- package/components/modal/style.scss +0 -146
- package/components/nestable/NestableItem.vue +0 -307
- package/components/nestable/editable.js +0 -44
- package/components/nestable/index.js +0 -1
- package/components/nestable/index.vue +0 -226
- package/components/nestable/methods.js +0 -416
- package/components/progress/style.scss +0 -229
- package/components/table/style.scss +0 -338
- package/components/tabs/index.js +0 -3
- package/components/tabs/index.vue +0 -151
- package/components/timeline/index.js +0 -6
- package/components/timeline/index.vue +0 -76
- package/directive/resize/index.js +0 -30
- package/directive/skeleton/index.js +0 -27
- package/directive/skeleton/style.scss +0 -37
- package/plugins/request/Request.js +0 -68
- package/style/animation.scss +0 -94
- package/style/style.scss +0 -8
- package/tools/rootable.js +0 -75
- /package/components/form/{text-editor → textEditor}/index.js +0 -0
- /package/components/form/{text-editor → textEditor}/preview.js +0 -0
- /package/components/form/{text-editor → textEditor}/preview.vue +0 -0
|
@@ -1,416 +0,0 @@
|
|
|
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 = JSON.parse(JSON.stringify(this.modelValue));
|
|
48
|
-
|
|
49
|
-
const {clientX, clientY} = this.getXandYFromEvent(event);
|
|
50
|
-
this.mouse.last = {x: clientX, y: clientY};
|
|
51
|
-
this.mouse.shift = {x: 0, y: 0};
|
|
52
|
-
|
|
53
|
-
this.$nextTick(() => {
|
|
54
|
-
this.onMouseMove(event);
|
|
55
|
-
});
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
onDragEnd(event, isCancel) {
|
|
59
|
-
event && event.preventDefault();
|
|
60
|
-
|
|
61
|
-
this.stopTrackMouse();
|
|
62
|
-
|
|
63
|
-
isCancel ? this.dragRevert() : this.dragApply();
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
onKeyDown(event) {
|
|
67
|
-
if (event.which === 27) {
|
|
68
|
-
// ESC
|
|
69
|
-
this.onDragEnd(null, true);
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
getXandYFromEvent(event) {
|
|
74
|
-
let {clientX, clientY} = event;
|
|
75
|
-
|
|
76
|
-
const {targetTouches} = event;
|
|
77
|
-
|
|
78
|
-
if (targetTouches) {
|
|
79
|
-
const touch = targetTouches[0];
|
|
80
|
-
clientX = touch.clientX;
|
|
81
|
-
clientY = touch.clientY;
|
|
82
|
-
const event = new Event("mouseenter");
|
|
83
|
-
const element = document.elementFromPoint(clientX, clientY);
|
|
84
|
-
const touchElement =
|
|
85
|
-
element && element.closest(".nestable-item-content");
|
|
86
|
-
if (touchElement) touchElement.dispatchEvent(event);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return {clientX, clientY};
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
onMouseMove(event) {
|
|
93
|
-
event && event.preventDefault();
|
|
94
|
-
|
|
95
|
-
const {clientX} = this.getXandYFromEvent(event);
|
|
96
|
-
|
|
97
|
-
if (this.mouse.last.x === 0) {
|
|
98
|
-
this.mouse.last.x = clientX;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const diffX = this.$r.rtl
|
|
102
|
-
? this.mouse.last.x - clientX
|
|
103
|
-
: clientX - this.mouse.last.x;
|
|
104
|
-
if (
|
|
105
|
-
(diffX >= 0 && this.mouse.shift.x >= 0) ||
|
|
106
|
-
(diffX <= 0 && this.mouse.shift.x <= 0)
|
|
107
|
-
) {
|
|
108
|
-
this.mouse.shift.x += diffX;
|
|
109
|
-
} else {
|
|
110
|
-
this.mouse.shift.x = 0;
|
|
111
|
-
}
|
|
112
|
-
this.mouse.last.x = clientX;
|
|
113
|
-
|
|
114
|
-
if (Math.abs(this.mouse.shift.x) > this.threshold) {
|
|
115
|
-
if (this.mouse.shift.x > 0) {
|
|
116
|
-
this.tryIncreaseDepth(this.dragItem);
|
|
117
|
-
} else {
|
|
118
|
-
this.tryDecreaseDepth(this.dragItem);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
this.mouse.shift.x = 0;
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
moveItem({dragItem, pathFrom, pathTo}) {
|
|
126
|
-
if (JSON.stringify(pathFrom) === JSON.stringify(pathTo)) {
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
const newDepth = pathTo.length + this.getItemDepth(dragItem);
|
|
131
|
-
if (newDepth > this.maxDepth) {
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
const realPathTo = this.getRealNextPath(pathFrom, pathTo);
|
|
136
|
-
|
|
137
|
-
const removePath = this.getSplicePath(pathFrom, {
|
|
138
|
-
numToRemove: 1,
|
|
139
|
-
childrenProp: this.childrenProp,
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
const insertPath = this.getSplicePath(realPathTo, {
|
|
143
|
-
numToRemove: 0,
|
|
144
|
-
itemsToInsert: [dragItem],
|
|
145
|
-
childrenProp: this.childrenProp,
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
let items = this.modelValue;
|
|
149
|
-
items = this.update(items, removePath);
|
|
150
|
-
items = this.update(items, insertPath);
|
|
151
|
-
|
|
152
|
-
this.pathTo = realPathTo;
|
|
153
|
-
this.$emit("update:model-value", items);
|
|
154
|
-
this.$emit("change", {
|
|
155
|
-
movedItem: dragItem,
|
|
156
|
-
fromPath: pathFrom,
|
|
157
|
-
toPath: pathTo,
|
|
158
|
-
items
|
|
159
|
-
});
|
|
160
|
-
},
|
|
161
|
-
isEquals(x, y) {
|
|
162
|
-
return x === y;
|
|
163
|
-
},
|
|
164
|
-
copy(o) {
|
|
165
|
-
return JSON.parse(JSON.stringify(o));
|
|
166
|
-
},
|
|
167
|
-
update(object, $spec) {
|
|
168
|
-
if (!object) {
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
const that = this;
|
|
172
|
-
const commands = {
|
|
173
|
-
$splice(value, nextObject, spec, originalObject) {
|
|
174
|
-
value.forEach((args) => {
|
|
175
|
-
if (nextObject === originalObject && args.length) {
|
|
176
|
-
nextObject = that.copy(originalObject);
|
|
177
|
-
}
|
|
178
|
-
Array.prototype.splice.apply(nextObject, args);
|
|
179
|
-
});
|
|
180
|
-
return nextObject;
|
|
181
|
-
},
|
|
182
|
-
};
|
|
183
|
-
const spec = typeof $spec === "function" ? {$apply: $spec} : $spec;
|
|
184
|
-
let nextObject = object;
|
|
185
|
-
Object.keys(spec).forEach((key) => {
|
|
186
|
-
if (commands[key]) {
|
|
187
|
-
const objectWasNextObject = object === nextObject;
|
|
188
|
-
nextObject = commands[key](spec[key], nextObject, spec, object);
|
|
189
|
-
if (objectWasNextObject && this.isEquals(nextObject, object)) {
|
|
190
|
-
nextObject = object;
|
|
191
|
-
}
|
|
192
|
-
} else {
|
|
193
|
-
const nextValueForKey = this.update(object[key], spec[key]);
|
|
194
|
-
const nextObjectValue = nextObject[key];
|
|
195
|
-
if (
|
|
196
|
-
!this.isEquals(nextValueForKey, nextObjectValue) ||
|
|
197
|
-
(typeof nextValueForKey === "undefined" && !object[key])
|
|
198
|
-
) {
|
|
199
|
-
if (nextObject === object) {
|
|
200
|
-
nextObject = this.copy(object);
|
|
201
|
-
}
|
|
202
|
-
nextObject[key] = nextValueForKey;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
return nextObject;
|
|
207
|
-
},
|
|
208
|
-
tryIncreaseDepth(dragItem) {
|
|
209
|
-
let pathFrom;
|
|
210
|
-
try {
|
|
211
|
-
pathFrom = this.getPathById(dragItem[this.keyProp]);
|
|
212
|
-
} catch (e) {
|
|
213
|
-
this.dragRevert();
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
const itemIndex = pathFrom[pathFrom.length - 1];
|
|
217
|
-
const newDepth = pathFrom.length + this.getItemDepth(dragItem);
|
|
218
|
-
if (itemIndex > 0 && newDepth <= this.maxDepth) {
|
|
219
|
-
const prevSibling = this.getItemByPath(
|
|
220
|
-
pathFrom.slice(0, -1).concat(itemIndex - 1)
|
|
221
|
-
);
|
|
222
|
-
|
|
223
|
-
if (
|
|
224
|
-
prevSibling[this.childrenProp] &&
|
|
225
|
-
(!prevSibling[this.childrenProp].length || true)
|
|
226
|
-
) {
|
|
227
|
-
const pathTo = pathFrom
|
|
228
|
-
.slice(0, -1)
|
|
229
|
-
.concat(itemIndex - 1)
|
|
230
|
-
.concat(prevSibling[this.childrenProp].length);
|
|
231
|
-
|
|
232
|
-
this.moveItem({dragItem, pathFrom, pathTo});
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
},
|
|
236
|
-
|
|
237
|
-
tryDecreaseDepth(dragItem) {
|
|
238
|
-
let pathFrom;
|
|
239
|
-
try {
|
|
240
|
-
pathFrom = this.getPathById(dragItem[this.keyProp]);
|
|
241
|
-
} catch (e) {
|
|
242
|
-
this.dragRevert();
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
const itemIndex = pathFrom[pathFrom.length - 1];
|
|
246
|
-
|
|
247
|
-
if (pathFrom.length > 1) {
|
|
248
|
-
const parent = this.getItemByPath(pathFrom.slice(0, -1));
|
|
249
|
-
|
|
250
|
-
if (itemIndex + 1 === parent[this.childrenProp].length) {
|
|
251
|
-
const pathTo = pathFrom.slice(0, -1);
|
|
252
|
-
pathTo[pathTo.length - 1] += 1;
|
|
253
|
-
|
|
254
|
-
this.moveItem({dragItem, pathFrom, pathTo});
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
},
|
|
258
|
-
|
|
259
|
-
onMouseEnter(event, item) {
|
|
260
|
-
if (event) {
|
|
261
|
-
event.preventDefault();
|
|
262
|
-
event.stopPropagation();
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
if (!this.dragItem) return;
|
|
266
|
-
|
|
267
|
-
if (item !== null && this.dragItem[this.keyProp] === item[this.keyProp])
|
|
268
|
-
return;
|
|
269
|
-
let pathFrom;
|
|
270
|
-
try {
|
|
271
|
-
pathFrom = this.getPathById(this.dragItem[this.keyProp]);
|
|
272
|
-
} catch (e) {
|
|
273
|
-
this.dragRevert();
|
|
274
|
-
return;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
if (pathFrom.length === 0) return;
|
|
278
|
-
|
|
279
|
-
let pathTo = null;
|
|
280
|
-
if (item === null) {
|
|
281
|
-
pathTo = pathFrom.length > 0 ? [] : [0];
|
|
282
|
-
} else {
|
|
283
|
-
pathTo = this.getPathById(item[this.keyProp]);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
const newDepth =
|
|
287
|
-
this.getRealNextPath(pathFrom, pathTo).length +
|
|
288
|
-
(this.getItemDepth(this.dragItem) - 1);
|
|
289
|
-
if (newDepth > this.maxDepth) {
|
|
290
|
-
return;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
this.moveItem({dragItem: this.dragItem, pathFrom, pathTo});
|
|
294
|
-
},
|
|
295
|
-
|
|
296
|
-
dragApply() {
|
|
297
|
-
this.$emit("change", this.dragItem, {
|
|
298
|
-
items: this.modelValue,
|
|
299
|
-
pathTo: this.pathTo,
|
|
300
|
-
});
|
|
301
|
-
|
|
302
|
-
this.pathTo = null;
|
|
303
|
-
this.itemsOld = null;
|
|
304
|
-
this.dragItem = null;
|
|
305
|
-
},
|
|
306
|
-
|
|
307
|
-
dragRevert() {
|
|
308
|
-
if (this.itemsOld) {
|
|
309
|
-
this.$emit("update:model-value", this.itemsOld);
|
|
310
|
-
}
|
|
311
|
-
this.pathTo = null;
|
|
312
|
-
this.itemsOld = null;
|
|
313
|
-
this.dragItem = null;
|
|
314
|
-
},
|
|
315
|
-
getPathById(id, items = this.modelValue) {
|
|
316
|
-
let path = [];
|
|
317
|
-
items.every((item, i) => {
|
|
318
|
-
if (item[this.keyProp] === id) {
|
|
319
|
-
path.push(i);
|
|
320
|
-
} else if (item[this.childrenProp]) {
|
|
321
|
-
const childrenPath = this.getPathById(id, item[this.childrenProp]);
|
|
322
|
-
|
|
323
|
-
if (childrenPath.length) {
|
|
324
|
-
path = path.concat(i).concat(childrenPath);
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
return path.length === 0;
|
|
329
|
-
});
|
|
330
|
-
|
|
331
|
-
return path;
|
|
332
|
-
},
|
|
333
|
-
|
|
334
|
-
getItemByPath(path, items = this.modelValue) {
|
|
335
|
-
let item = null;
|
|
336
|
-
|
|
337
|
-
path.forEach((index) => {
|
|
338
|
-
const list =
|
|
339
|
-
item && item[this.childrenProp] ? item[this.childrenProp] : items;
|
|
340
|
-
item = list[index];
|
|
341
|
-
});
|
|
342
|
-
|
|
343
|
-
return item;
|
|
344
|
-
},
|
|
345
|
-
|
|
346
|
-
getItemDepth(item) {
|
|
347
|
-
let level = 1;
|
|
348
|
-
|
|
349
|
-
if (item[this.childrenProp] && item[this.childrenProp].length > 0) {
|
|
350
|
-
const childrenDepths = item[this.childrenProp].map(this.getItemDepth);
|
|
351
|
-
level += Math.max(...childrenDepths);
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
return level;
|
|
355
|
-
},
|
|
356
|
-
|
|
357
|
-
getSplicePath(path, options = {}) {
|
|
358
|
-
const splicePath = {};
|
|
359
|
-
const numToRemove = options.numToRemove || 0;
|
|
360
|
-
const itemsToInsert = options.itemsToInsert || [];
|
|
361
|
-
const lastIndex = path.length - 1;
|
|
362
|
-
let currentPath = splicePath;
|
|
363
|
-
|
|
364
|
-
path.forEach((index, i) => {
|
|
365
|
-
if (i === lastIndex) {
|
|
366
|
-
currentPath.$splice = [[index, numToRemove, ...itemsToInsert]];
|
|
367
|
-
} else {
|
|
368
|
-
const nextPath = {};
|
|
369
|
-
currentPath[index] = {[options.childrenProp]: nextPath};
|
|
370
|
-
currentPath = nextPath;
|
|
371
|
-
}
|
|
372
|
-
});
|
|
373
|
-
|
|
374
|
-
return splicePath;
|
|
375
|
-
},
|
|
376
|
-
|
|
377
|
-
getRealNextPath(prevPath, nextPath) {
|
|
378
|
-
const ppLastIndex = prevPath.length - 1;
|
|
379
|
-
const npLastIndex = nextPath.length - 1;
|
|
380
|
-
|
|
381
|
-
if (prevPath.length < nextPath.length) {
|
|
382
|
-
let wasShifted = false;
|
|
383
|
-
|
|
384
|
-
return nextPath.map((nextIndex, i) => {
|
|
385
|
-
if (wasShifted) {
|
|
386
|
-
return i === npLastIndex ? nextIndex + 1 : nextIndex;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
if (typeof prevPath[i] !== "number") {
|
|
390
|
-
return nextIndex;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
if (nextPath[i] > prevPath[i] && i === ppLastIndex) {
|
|
394
|
-
wasShifted = true;
|
|
395
|
-
return nextIndex - 1;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
return nextIndex;
|
|
399
|
-
});
|
|
400
|
-
} else if (prevPath.length === nextPath.length) {
|
|
401
|
-
if (nextPath[npLastIndex] > prevPath[npLastIndex]) {
|
|
402
|
-
const target = this.getItemByPath(nextPath);
|
|
403
|
-
|
|
404
|
-
if (target[this.childrenProp] && target[this.childrenProp].length) {
|
|
405
|
-
return nextPath
|
|
406
|
-
.slice(0, -1)
|
|
407
|
-
.concat(nextPath[npLastIndex] - 1)
|
|
408
|
-
.concat(0);
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
return nextPath;
|
|
414
|
-
},
|
|
415
|
-
},
|
|
416
|
-
};
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
@use "sass:map";
|
|
2
|
-
@use "../../style/variables/base";
|
|
3
|
-
@use "../../style/variables/color";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
$progress-circle-rotate-animation: progress-circle-rotate 1.4s linear infinite !default;
|
|
7
|
-
$progress-circle-rotate-dash: progress-circle-dash 1.4s ease-in-out infinite !default;
|
|
8
|
-
$process-circle-intermediate-svg-transition: all .2s ease-in-out !default;
|
|
9
|
-
$progress-circle-underlay-stroke: rgba(map.get(color.$shades, 'black'), 0.1) !default;
|
|
10
|
-
$progress-circle-overlay-transition: all .6s ease-in-out !default;
|
|
11
|
-
|
|
12
|
-
.#{base.$prefix}progress-circle {
|
|
13
|
-
position: relative;
|
|
14
|
-
display: inline-flex;
|
|
15
|
-
vertical-align: middle;
|
|
16
|
-
justify-content: center;
|
|
17
|
-
align-items: center;
|
|
18
|
-
|
|
19
|
-
svg {
|
|
20
|
-
width: 100%;
|
|
21
|
-
height: 100%;
|
|
22
|
-
margin: auto;
|
|
23
|
-
position: absolute;
|
|
24
|
-
top: 0;
|
|
25
|
-
bottom: 0;
|
|
26
|
-
left: 0;
|
|
27
|
-
right: 0;
|
|
28
|
-
z-index: 0;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&-indeterminate {
|
|
32
|
-
svg {
|
|
33
|
-
animation: $progress-circle-rotate-animation;
|
|
34
|
-
transform-origin: center center;
|
|
35
|
-
transition: $process-circle-intermediate-svg-transition;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.#{base.$prefix}progress-circle-overlay {
|
|
39
|
-
animation: $progress-circle-rotate-dash;
|
|
40
|
-
stroke-linecap: round;
|
|
41
|
-
stroke-dasharray: 80, 200;
|
|
42
|
-
stroke-dashoffset: 0px;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
&-info {
|
|
47
|
-
align-items: center;
|
|
48
|
-
display: flex;
|
|
49
|
-
justify-content: center
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
&-underlay {
|
|
53
|
-
stroke: $progress-circle-underlay-stroke;
|
|
54
|
-
z-index: 1
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&-overlay {
|
|
58
|
-
stroke: currentColor;
|
|
59
|
-
z-index: 2;
|
|
60
|
-
transition: $progress-circle-overlay-transition
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
@keyframes progress-circle-dash {
|
|
65
|
-
0% {
|
|
66
|
-
stroke-dasharray: 1, 200;
|
|
67
|
-
stroke-dashoffset: 0px
|
|
68
|
-
}
|
|
69
|
-
50% {
|
|
70
|
-
stroke-dasharray: 100, 200;
|
|
71
|
-
stroke-dashoffset: -15px
|
|
72
|
-
}
|
|
73
|
-
100% {
|
|
74
|
-
stroke-dasharray: 100, 200;
|
|
75
|
-
stroke-dashoffset: -125px
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
@keyframes progress-circle-rotate {
|
|
80
|
-
100% {
|
|
81
|
-
transform: rotate(360deg)
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
//line
|
|
87
|
-
|
|
88
|
-
.#{base.$prefix}progress {
|
|
89
|
-
text-align: center;
|
|
90
|
-
|
|
91
|
-
.progress-outlined {
|
|
92
|
-
color: var(--color-sheet-container-highest)
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.line-determinate {
|
|
96
|
-
background-color: var(--color-on-sheet);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.line-indeterminate {
|
|
100
|
-
background-color: var(--color-on-sheet);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.progress-background {
|
|
104
|
-
background-color: var(--color-sheet-container-highest);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
&.progress-outlined {
|
|
108
|
-
border: 1px solid;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
&.progress-rounded {
|
|
112
|
-
border-radius: 20px;
|
|
113
|
-
overflow: hidden;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.progress-container {
|
|
117
|
-
position: relative;
|
|
118
|
-
display: block;
|
|
119
|
-
width: 100%;
|
|
120
|
-
background-clip: padding-box;
|
|
121
|
-
overflow: hidden;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
&.size {
|
|
125
|
-
&-small {
|
|
126
|
-
.progress-container {
|
|
127
|
-
height: 4px;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
&-medium {
|
|
132
|
-
.progress-container {
|
|
133
|
-
height: 8px;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
&.progress-outlined {
|
|
137
|
-
border-width: 2px;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
&-large {
|
|
142
|
-
.progress-container {
|
|
143
|
-
height: 12px;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
&.progress-outlined {
|
|
147
|
-
border-width: 3px;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
&-x-large {
|
|
152
|
-
.progress-container {
|
|
153
|
-
height: 16px;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
&.progress-outlined {
|
|
157
|
-
border-width: 4px;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.line-determinate {
|
|
163
|
-
position: absolute;
|
|
164
|
-
top: 0;
|
|
165
|
-
bottom: 0;
|
|
166
|
-
transition: width .3s linear;
|
|
167
|
-
border-radius: 2px;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.line-indeterminate {
|
|
171
|
-
border-radius: 2px;
|
|
172
|
-
|
|
173
|
-
&:before {
|
|
174
|
-
content: '';
|
|
175
|
-
position: absolute;
|
|
176
|
-
background-color: inherit;
|
|
177
|
-
top: 0;
|
|
178
|
-
left: 0;
|
|
179
|
-
bottom: 0;
|
|
180
|
-
will-change: left, right;
|
|
181
|
-
animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
:after {
|
|
185
|
-
content: '';
|
|
186
|
-
position: absolute;
|
|
187
|
-
background-color: inherit;
|
|
188
|
-
top: 0;
|
|
189
|
-
left: 0;
|
|
190
|
-
bottom: 0;
|
|
191
|
-
will-change: left, right;
|
|
192
|
-
animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
|
|
193
|
-
animation-delay: 1.15s;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
@keyframes indeterminate {
|
|
199
|
-
0% {
|
|
200
|
-
left: -35%;
|
|
201
|
-
right: 100%;
|
|
202
|
-
}
|
|
203
|
-
60% {
|
|
204
|
-
left: 100%;
|
|
205
|
-
right: -90%;
|
|
206
|
-
}
|
|
207
|
-
100% {
|
|
208
|
-
left: 100%;
|
|
209
|
-
right: -90%;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
@keyframes indeterminate-short {
|
|
214
|
-
0% {
|
|
215
|
-
left: -200%;
|
|
216
|
-
right: 100%;
|
|
217
|
-
}
|
|
218
|
-
60% {
|
|
219
|
-
left: 107%;
|
|
220
|
-
right: -8%;
|
|
221
|
-
}
|
|
222
|
-
100% {
|
|
223
|
-
left: 107%;
|
|
224
|
-
right: -8%;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
|