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 = (n, i, x) => {
3
+ const W = (o, i, a) => {
4
4
  const f = w(null);
5
5
  return d(() => {
6
- var c, r, a;
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, l = ((r = t == null ? void 0 : t.parentElement) == null ? void 0 : r.offsetHeight) ?? 0, e = (a = t == null ? void 0 : t.parentElement) == null ? void 0 : a.getBoundingClientRect(), s = t.offsetHeight;
10
- if (n) {
11
- if (n === "center") {
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 (n === "bottom") {
16
- t.style.top = l + "px", t.style.opacity = "1";
15
+ if (o === "bottom") {
16
+ t.style.top = n + "px", t.style.opacity = "1";
17
17
  return;
18
18
  }
19
- if (n === "top") {
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 o = h - p;
26
- e.x - Math.abs(o) < 0 ? t.style.left = (o < 0 ? o / 2 : o) + "px" : t.style.left = o + "px";
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 + l ? 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 + l + "px" : t.style.top = l + "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 + l + "px" : t.style.top = l + "px", t.style.opacity = "1";
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
- }, [x, n, i]), f;
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 i, Fragment as k } from "react/jsx-runtime";
2
- import { c as p } from "../../index-DIxK0V-G.js";
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", nr = "_disabled_1kfjr_170", r = {
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: nr
22
- }, er = K(
21
+ disabled: sr
22
+ }, cr = K(
23
23
  ({
24
- min: l,
24
+ min: p,
25
25
  max: j,
26
- value: t,
26
+ value: s,
27
27
  disabled: N,
28
28
  isMinEqualMax: $ = !1,
29
- isSingleSlider: a = !0,
29
+ isSingleSlider: i = !0,
30
30
  onChange: f,
31
- step: x = X,
32
- borderState: h = L.ON,
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(() => (t == null ? void 0 : t.min) ?? l), [d, F] = T(() => (t == null ? void 0 : t.max) ?? j), {
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: A,
43
- minClassName: U
42
+ maxClassName: v,
43
+ minClassName: A
44
44
  } = q ?? {};
45
45
  Q(() => {
46
- t && (t.min && D(t.min), t.max && F(t.max));
47
- }, [t]);
48
- const g = (n) => {
49
- n.preventDefault();
50
- const s = Math.min(
51
- +n.target.value,
52
- a || $ ? d : d - x
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
- t || D(s), _ == null || _({ min: s, max: d }), f == null || f(n);
55
- }, B = (n) => {
56
- n.preventDefault();
57
- const s = Math.max(
58
- +n.target.value,
59
- $ ? m : m + x
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
- t || F(s), _ == null || _({ min: m, max: s }), f == null || f(n);
62
- }, E = (m - l) / (j - l) * w, c = (d - l) / (j - l) * w, e = b === y.LEFT, H = m === d && c !== 0, M = h === L.OFF, v = () => {
63
- const n = {
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: l,
66
+ min: p,
67
67
  max: j,
68
- step: x
69
- }, s = /* @__PURE__ */ i(
68
+ step: h
69
+ }, n = /* @__PURE__ */ a(
70
70
  "input",
71
71
  {
72
- ...n,
73
- className: p(r.input, {
74
- [r["equal-value"]]: H,
75
- [r["is-double-range"]]: !a
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: g
79
+ onChange: U
80
80
  }
81
- ), u = /* @__PURE__ */ i(
81
+ ), u = /* @__PURE__ */ a(
82
82
  "input",
83
83
  {
84
- ...n,
85
- className: p(r.input, {
86
- [r["is-double-range"]]: !a
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: B
90
+ onChange: g
91
91
  }
92
92
  );
93
- return a ? e ? s : u : /* @__PURE__ */ o(k, { children: [
94
- s,
93
+ return i ? c ? n : u : /* @__PURE__ */ o(k, { children: [
94
+ n,
95
95
  u
96
96
  ] });
97
97
  }, z = () => {
98
- const n = /* @__PURE__ */ i(
98
+ const t = /* @__PURE__ */ a(
99
99
  "div",
100
100
  {
101
- className: p(r.control, {
101
+ className: l(r.control, {
102
102
  [r.disabled]: N
103
103
  }),
104
104
  style: {
105
105
  left: `${E}%`
106
106
  }
107
107
  }
108
- ), s = /* @__PURE__ */ i(
108
+ ), n = /* @__PURE__ */ a(
109
109
  "div",
110
110
  {
111
- className: p(r.control, {
111
+ className: l(r.control, {
112
112
  [r.disabled]: N
113
113
  }),
114
114
  style: {
115
- left: `${c}%`
115
+ left: `${e}%`
116
116
  }
117
117
  }
118
- ), u = () => M ? e ? `${E}%` : `${w - c}%` : e ? void 0 : `${w - c}%`, G = a && !e ? "0%" : `${w - c}%`, J = a && !e ? u() : `${c - E}%`, P = /* @__PURE__ */ o(k, { children: [
119
- /* @__PURE__ */ i(
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 && !e ? `${c}%` : u()
123
+ width: !M && !c ? `${e}%` : u()
124
124
  },
125
- className: p(r.rail, r[h], r[b], {
126
- [r["double-range"]]: !a
125
+ className: l(r.rail, r[x], r[b], {
126
+ [r["double-range"]]: !i
127
127
  })
128
128
  }
129
129
  ),
130
- /* @__PURE__ */ i(
130
+ /* @__PURE__ */ a(
131
131
  "div",
132
132
  {
133
133
  style: {
134
134
  right: G,
135
135
  width: J
136
136
  },
137
- className: p(
137
+ className: l(
138
138
  r["inner-rail"],
139
- r[h],
139
+ r[x],
140
140
  r[b],
141
141
  {
142
- [r["double-range"]]: !a
142
+ [r["double-range"]]: !i
143
143
  }
144
144
  )
145
145
  }
146
146
  )
147
147
  ] });
148
- return a ? /* @__PURE__ */ o(k, { children: [
149
- e ? n : s,
148
+ return i ? /* @__PURE__ */ o(k, { children: [
149
+ c ? t : n,
150
150
  P
151
151
  ] }) : /* @__PURE__ */ o(k, { children: [
152
- n,
152
+ t,
153
153
  P,
154
- s
154
+ n
155
155
  ] });
156
156
  };
157
- return /* @__PURE__ */ o("div", { className: p(r["main-wrapper"], O), children: [
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__ */ i("div", { className: U, children: R }),
160
- !!I && /* @__PURE__ */ i("div", { className: A, children: I })
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__ */ i("div", { className: r["control-wrapper"], children: z() }),
164
- /* @__PURE__ */ i("div", { className: r["input-wrapper"], children: v() })
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
- er as InputRangeSlider
170
+ cr as InputRangeSlider
171
171
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.66.1",
4
+ "version": "1.66.3",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {