mimir-ui-kit 1.66.1 → 1.66.3
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.
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { useRef as w, useEffect as d } from "react";
|
|
2
2
|
import { BLOCK_WIDTH as p, MAX_MOBILE_WIDTH as m } from "./constants.js";
|
|
3
|
-
const W = (
|
|
3
|
+
const W = (o, i, a) => {
|
|
4
4
|
const f = w(null);
|
|
5
5
|
return d(() => {
|
|
6
|
-
var c, r,
|
|
6
|
+
var c, r, x;
|
|
7
7
|
const u = window.innerHeight, y = window.innerWidth, t = f.current;
|
|
8
8
|
if (t && t !== null) {
|
|
9
|
-
const h = ((c = t == null ? void 0 : t.parentElement) == null ? void 0 : c.offsetWidth) ?? 0,
|
|
10
|
-
if (
|
|
11
|
-
if (
|
|
9
|
+
const h = ((c = t == null ? void 0 : t.parentElement) == null ? void 0 : c.offsetWidth) ?? 0, n = ((r = t == null ? void 0 : t.parentElement) == null ? void 0 : r.offsetHeight) ?? 0, e = (x = t == null ? void 0 : t.parentElement) == null ? void 0 : x.getBoundingClientRect(), s = t.offsetHeight;
|
|
10
|
+
if (o) {
|
|
11
|
+
if (o === "center") {
|
|
12
12
|
t.style.position = "fixed", t.style.top = `calc(50vh - ${s / 2}px)`, t.style.left = `calc(50vw - ${p / 2}px)`, t.style.opacity = "1";
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
|
-
if (
|
|
16
|
-
t.style.top =
|
|
15
|
+
if (o === "bottom") {
|
|
16
|
+
t.style.top = n + "px", t.style.opacity = "1";
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
if (
|
|
19
|
+
if (o === "top") {
|
|
20
20
|
t.style.top = -s + "px", t.style.opacity = "1";
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
} else {
|
|
24
24
|
if (y < e.x + p) {
|
|
25
|
-
const
|
|
26
|
-
e.x - Math.abs(
|
|
25
|
+
const l = h - p;
|
|
26
|
+
i ? e.x - Math.abs(l) < 0 ? t.style.left = e.x - (l < 0 ? l / 2 : l) + "px" : t.style.left = e.x + l + "px" : e.x - Math.abs(l) < 0 ? t.style.left = (l < 0 ? l / 2 : l) + "px" : t.style.left = l + "px";
|
|
27
27
|
}
|
|
28
|
-
u < e.y + s +
|
|
28
|
+
u < e.y + s + n ? e.y - s > 0 ? i ? t.style.top = e.y - s + "px" : t.style.top = -s + "px" : y > m ? i ? t.style.top = e.y + n + "px" : t.style.top = n + "px" : (t.style.position = "fixed", t.style.top = `calc(50vh - ${s / 2}px)`, t.style.left = `calc(50vw - ${p / 2}px)`) : i ? t.style.top = e.y + n + "px" : t.style.top = n + "px", t.style.opacity = "1";
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
}, [
|
|
31
|
+
}, [a, o, i]), f;
|
|
32
32
|
};
|
|
33
33
|
export {
|
|
34
34
|
W as useDatePickerPosition
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as o, jsx as
|
|
2
|
-
import { c as
|
|
1
|
+
import { jsxs as o, jsx as a, Fragment as k } from "react/jsx-runtime";
|
|
2
|
+
import { c as l } from "../../index-DIxK0V-G.js";
|
|
3
3
|
import { memo as K, useState as T, useEffect as Q } from "react";
|
|
4
4
|
import { EInputRangeSliderPositions as y, EInputRangeSliderBorderState as L, DEFAULT_STEP as X, DEFAULT_WIDTH as w } from "./constants.js";
|
|
5
|
-
import '../../assets/InputRangeSlider.css';const Y = "_wrapper_1kfjr_8", Z = "_input_1kfjr_18", V = "_rail_1kfjr_115", C = "_off_1kfjr_124", S = "_right_1kfjr_124", rr = "_left_1kfjr_145", tr = "_control_1kfjr_36",
|
|
5
|
+
import '../../assets/InputRangeSlider.css';const Y = "_wrapper_1kfjr_8", Z = "_input_1kfjr_18", V = "_rail_1kfjr_115", C = "_off_1kfjr_124", S = "_right_1kfjr_124", rr = "_left_1kfjr_145", tr = "_control_1kfjr_36", sr = "_disabled_1kfjr_170", r = {
|
|
6
6
|
"main-wrapper": "_main-wrapper_1kfjr_2",
|
|
7
7
|
wrapper: Y,
|
|
8
8
|
"input-wrapper": "_input-wrapper_1kfjr_18",
|
|
@@ -18,154 +18,154 @@ import '../../assets/InputRangeSlider.css';const Y = "_wrapper_1kfjr_8", Z = "_i
|
|
|
18
18
|
"inner-rail": "_inner-rail_1kfjr_134",
|
|
19
19
|
left: rr,
|
|
20
20
|
control: tr,
|
|
21
|
-
disabled:
|
|
22
|
-
},
|
|
21
|
+
disabled: sr
|
|
22
|
+
}, cr = K(
|
|
23
23
|
({
|
|
24
|
-
min:
|
|
24
|
+
min: p,
|
|
25
25
|
max: j,
|
|
26
|
-
value:
|
|
26
|
+
value: s,
|
|
27
27
|
disabled: N,
|
|
28
28
|
isMinEqualMax: $ = !1,
|
|
29
|
-
isSingleSlider:
|
|
29
|
+
isSingleSlider: i = !0,
|
|
30
30
|
onChange: f,
|
|
31
|
-
step:
|
|
32
|
-
borderState:
|
|
31
|
+
step: h = X,
|
|
32
|
+
borderState: x = L.ON,
|
|
33
33
|
positions: b = y.LEFT,
|
|
34
34
|
minMaxDescriptions: q,
|
|
35
35
|
onChangeValue: _,
|
|
36
36
|
wrapperClassName: O,
|
|
37
37
|
...W
|
|
38
38
|
}) => {
|
|
39
|
-
const [m, D] = T(() => (
|
|
39
|
+
const [m, D] = T(() => (s == null ? void 0 : s.min) ?? p), [d, F] = T(() => (s == null ? void 0 : s.max) ?? j), {
|
|
40
40
|
max: I,
|
|
41
41
|
min: R,
|
|
42
|
-
maxClassName:
|
|
43
|
-
minClassName:
|
|
42
|
+
maxClassName: v,
|
|
43
|
+
minClassName: A
|
|
44
44
|
} = q ?? {};
|
|
45
45
|
Q(() => {
|
|
46
|
-
|
|
47
|
-
}, [
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
+
|
|
52
|
-
|
|
46
|
+
s && (D(s.min), F(s.max));
|
|
47
|
+
}, [s]);
|
|
48
|
+
const U = (t) => {
|
|
49
|
+
t.preventDefault();
|
|
50
|
+
const n = Math.min(
|
|
51
|
+
+t.target.value,
|
|
52
|
+
i || $ ? d : d - h
|
|
53
53
|
);
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
+
|
|
59
|
-
$ ? m : m +
|
|
54
|
+
s || D(n), _ == null || _({ min: n, max: d }), f == null || f(t);
|
|
55
|
+
}, g = (t) => {
|
|
56
|
+
t.preventDefault();
|
|
57
|
+
const n = Math.max(
|
|
58
|
+
+t.target.value,
|
|
59
|
+
$ ? m : m + h
|
|
60
60
|
);
|
|
61
|
-
|
|
62
|
-
}, E = (m -
|
|
63
|
-
const
|
|
61
|
+
s || F(n), _ == null || _({ min: m, max: n }), f == null || f(t);
|
|
62
|
+
}, E = (m - p) / (j - p) * w, e = (d - p) / (j - p) * w, c = b === y.LEFT, B = m === d && e !== 0, M = x === L.OFF, H = () => {
|
|
63
|
+
const t = {
|
|
64
64
|
...W,
|
|
65
65
|
type: "range",
|
|
66
|
-
min:
|
|
66
|
+
min: p,
|
|
67
67
|
max: j,
|
|
68
|
-
step:
|
|
69
|
-
},
|
|
68
|
+
step: h
|
|
69
|
+
}, n = /* @__PURE__ */ a(
|
|
70
70
|
"input",
|
|
71
71
|
{
|
|
72
|
-
...
|
|
73
|
-
className:
|
|
74
|
-
[r["equal-value"]]:
|
|
75
|
-
[r["is-double-range"]]: !
|
|
72
|
+
...t,
|
|
73
|
+
className: l(r.input, {
|
|
74
|
+
[r["equal-value"]]: B,
|
|
75
|
+
[r["is-double-range"]]: !i
|
|
76
76
|
}),
|
|
77
77
|
disabled: N,
|
|
78
78
|
value: m,
|
|
79
|
-
onChange:
|
|
79
|
+
onChange: U
|
|
80
80
|
}
|
|
81
|
-
), u = /* @__PURE__ */
|
|
81
|
+
), u = /* @__PURE__ */ a(
|
|
82
82
|
"input",
|
|
83
83
|
{
|
|
84
|
-
...
|
|
85
|
-
className:
|
|
86
|
-
[r["is-double-range"]]: !
|
|
84
|
+
...t,
|
|
85
|
+
className: l(r.input, {
|
|
86
|
+
[r["is-double-range"]]: !i
|
|
87
87
|
}),
|
|
88
88
|
disabled: N,
|
|
89
89
|
value: d,
|
|
90
|
-
onChange:
|
|
90
|
+
onChange: g
|
|
91
91
|
}
|
|
92
92
|
);
|
|
93
|
-
return
|
|
94
|
-
|
|
93
|
+
return i ? c ? n : u : /* @__PURE__ */ o(k, { children: [
|
|
94
|
+
n,
|
|
95
95
|
u
|
|
96
96
|
] });
|
|
97
97
|
}, z = () => {
|
|
98
|
-
const
|
|
98
|
+
const t = /* @__PURE__ */ a(
|
|
99
99
|
"div",
|
|
100
100
|
{
|
|
101
|
-
className:
|
|
101
|
+
className: l(r.control, {
|
|
102
102
|
[r.disabled]: N
|
|
103
103
|
}),
|
|
104
104
|
style: {
|
|
105
105
|
left: `${E}%`
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
),
|
|
108
|
+
), n = /* @__PURE__ */ a(
|
|
109
109
|
"div",
|
|
110
110
|
{
|
|
111
|
-
className:
|
|
111
|
+
className: l(r.control, {
|
|
112
112
|
[r.disabled]: N
|
|
113
113
|
}),
|
|
114
114
|
style: {
|
|
115
|
-
left: `${
|
|
115
|
+
left: `${e}%`
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
), u = () => M ?
|
|
119
|
-
/* @__PURE__ */
|
|
118
|
+
), u = () => M ? c ? `${E}%` : `${w - e}%` : c ? void 0 : `${w - e}%`, G = i && !c ? "0%" : `${w - e}%`, J = i && !c ? u() : `${e - E}%`, P = /* @__PURE__ */ o(k, { children: [
|
|
119
|
+
/* @__PURE__ */ a(
|
|
120
120
|
"div",
|
|
121
121
|
{
|
|
122
122
|
style: {
|
|
123
|
-
width: !M && !
|
|
123
|
+
width: !M && !c ? `${e}%` : u()
|
|
124
124
|
},
|
|
125
|
-
className:
|
|
126
|
-
[r["double-range"]]: !
|
|
125
|
+
className: l(r.rail, r[x], r[b], {
|
|
126
|
+
[r["double-range"]]: !i
|
|
127
127
|
})
|
|
128
128
|
}
|
|
129
129
|
),
|
|
130
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ a(
|
|
131
131
|
"div",
|
|
132
132
|
{
|
|
133
133
|
style: {
|
|
134
134
|
right: G,
|
|
135
135
|
width: J
|
|
136
136
|
},
|
|
137
|
-
className:
|
|
137
|
+
className: l(
|
|
138
138
|
r["inner-rail"],
|
|
139
|
-
r[
|
|
139
|
+
r[x],
|
|
140
140
|
r[b],
|
|
141
141
|
{
|
|
142
|
-
[r["double-range"]]: !
|
|
142
|
+
[r["double-range"]]: !i
|
|
143
143
|
}
|
|
144
144
|
)
|
|
145
145
|
}
|
|
146
146
|
)
|
|
147
147
|
] });
|
|
148
|
-
return
|
|
149
|
-
|
|
148
|
+
return i ? /* @__PURE__ */ o(k, { children: [
|
|
149
|
+
c ? t : n,
|
|
150
150
|
P
|
|
151
151
|
] }) : /* @__PURE__ */ o(k, { children: [
|
|
152
|
-
|
|
152
|
+
t,
|
|
153
153
|
P,
|
|
154
|
-
|
|
154
|
+
n
|
|
155
155
|
] });
|
|
156
156
|
};
|
|
157
|
-
return /* @__PURE__ */ o("div", { className:
|
|
157
|
+
return /* @__PURE__ */ o("div", { className: l(r["main-wrapper"], O), children: [
|
|
158
158
|
/* @__PURE__ */ o("div", { className: r["info-wrapper"], children: [
|
|
159
|
-
!!R && /* @__PURE__ */
|
|
160
|
-
!!I && /* @__PURE__ */
|
|
159
|
+
!!R && /* @__PURE__ */ a("div", { className: A, children: R }),
|
|
160
|
+
!!I && /* @__PURE__ */ a("div", { className: v, children: I })
|
|
161
161
|
] }),
|
|
162
162
|
/* @__PURE__ */ o("div", { className: r.wrapper, children: [
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ a("div", { className: r["control-wrapper"], children: z() }),
|
|
164
|
+
/* @__PURE__ */ a("div", { className: r["input-wrapper"], children: H() })
|
|
165
165
|
] })
|
|
166
166
|
] });
|
|
167
167
|
}
|
|
168
168
|
);
|
|
169
169
|
export {
|
|
170
|
-
|
|
170
|
+
cr as InputRangeSlider
|
|
171
171
|
};
|