its_ui_vite 1.1.10 → 1.1.11
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/package.json
CHANGED
package/src/assets/js/helpers.js
CHANGED
|
@@ -55,12 +55,25 @@ export const CClasses = {
|
|
|
55
55
|
* @param {(positionInfo: any) => void} [closeFn=(positionInfo: any) => {}] fn
|
|
56
56
|
*/
|
|
57
57
|
|
|
58
|
-
export function addTracingElement(target, moveFn = () => {}) {
|
|
59
|
-
let timer
|
|
60
|
-
let debounceTimer
|
|
58
|
+
export function addTracingElement(target, moveFn = () => {}) {
|
|
59
|
+
let timer;
|
|
60
|
+
let debounceTimer;
|
|
61
|
+
let positionInfo;
|
|
62
|
+
let lockPosition = true;
|
|
61
63
|
|
|
62
64
|
const handlesEvents = ['mousemove', 'wheel', 'load', 'fullscreenchange', 'webkitfullscreenchange', 'mozfullscreenchange', 'msfullscreenchange']
|
|
63
65
|
|
|
66
|
+
function setPositionInfo(position, e) {
|
|
67
|
+
positionInfo = {
|
|
68
|
+
x: position.x,
|
|
69
|
+
y: position.y - (e?.deltaY || 0),
|
|
70
|
+
left: position.left,
|
|
71
|
+
top: position.top - (e?.deltaY || 0),
|
|
72
|
+
width: position.width,
|
|
73
|
+
height: position.height,
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
64
77
|
function isVisible(position) {
|
|
65
78
|
if (!position) return false
|
|
66
79
|
|
|
@@ -82,31 +95,48 @@ export function addTracingElement(target, moveFn = () => {}) {
|
|
|
82
95
|
return isVisibleInWindow && isVisibleInScroll
|
|
83
96
|
}
|
|
84
97
|
|
|
85
|
-
function dispatch() {
|
|
86
|
-
const position = target.value?.getBoundingClientRect()
|
|
87
|
-
|
|
98
|
+
function dispatch(position) {
|
|
88
99
|
if (!position) return;
|
|
89
|
-
|
|
100
|
+
|
|
90
101
|
const infoObj = {
|
|
91
102
|
position: position,
|
|
92
103
|
isVisible: isVisible(position)
|
|
93
104
|
}
|
|
94
|
-
|
|
95
|
-
moveFn(infoObj)
|
|
105
|
+
moveFn(infoObj);
|
|
96
106
|
}
|
|
97
107
|
|
|
98
108
|
function targetMoveHandler(e) {
|
|
99
|
-
|
|
109
|
+
const position = target.value?.getBoundingClientRect();
|
|
110
|
+
|
|
111
|
+
if (!position) return;
|
|
112
|
+
|
|
113
|
+
if (lockPosition) {
|
|
114
|
+
setPositionInfo(position, e);
|
|
115
|
+
} else {
|
|
116
|
+
positionInfo.top = positionInfo.top - (e?.deltaY || 0);
|
|
117
|
+
positionInfo.y = positionInfo.y - (e?.deltaY || 0);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
lockPosition = !e?.deltaY;
|
|
121
|
+
|
|
122
|
+
if (timer) return;
|
|
123
|
+
dispatch(positionInfo);
|
|
100
124
|
|
|
101
125
|
timer = setTimeout(() => {
|
|
102
|
-
timer = undefined
|
|
126
|
+
timer = undefined;
|
|
103
127
|
|
|
104
|
-
dispatch()
|
|
128
|
+
dispatch(positionInfo);
|
|
105
129
|
|
|
106
130
|
// здесь debounce т.к. не всегда привязанный элемент встает на место
|
|
107
|
-
clearTimeout(debounceTimer)
|
|
108
|
-
debounceTimer = setTimeout(
|
|
109
|
-
|
|
131
|
+
clearTimeout(debounceTimer);
|
|
132
|
+
debounceTimer = setTimeout(() => {
|
|
133
|
+
const position = target.value?.getBoundingClientRect();
|
|
134
|
+
lockPosition = true;
|
|
135
|
+
|
|
136
|
+
setPositionInfo(position);
|
|
137
|
+
dispatch(positionInfo);
|
|
138
|
+
}, 200);
|
|
139
|
+
}, 100);
|
|
110
140
|
}
|
|
111
141
|
|
|
112
142
|
function addListeners() {
|
|
@@ -987,7 +987,7 @@ $timeWidth: 54px;
|
|
|
987
987
|
|
|
988
988
|
position: fixed;
|
|
989
989
|
z-index: var(--z-index, 999);
|
|
990
|
-
transition:
|
|
990
|
+
transition: all .14s linear 0s;
|
|
991
991
|
// transform: translate(0, 50px);
|
|
992
992
|
pointer-events: none;
|
|
993
993
|
|
|
@@ -1103,7 +1103,7 @@ $timeWidth: 54px;
|
|
|
1103
1103
|
.c-datepicker__content_wrap {
|
|
1104
1104
|
position: fixed;
|
|
1105
1105
|
z-index: var(--z-index, 999);
|
|
1106
|
-
transition:
|
|
1106
|
+
transition: all .14s linear 0s;
|
|
1107
1107
|
pointer-events: none;
|
|
1108
1108
|
|
|
1109
1109
|
.c-datepicker {
|