mimir-ui-kit 1.43.13 → 1.43.15
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/dist/assets/Accordion.css +1 -1
- package/dist/components/Accordion/Accordion.d.ts +3 -1
- package/dist/components/Accordion/Accordion.js +211 -201
- package/dist/components/Accordion/constants.d.ts +4 -0
- package/dist/components/Accordion/constants.js +6 -5
- package/dist/components/Accordion/index.d.ts +1 -1
- package/dist/components/Accordion/index.js +12 -6
- package/dist/components/SelectSearch/SelectSearch.d.ts +1 -0
- package/dist/components/SelectSearch/SelectSearch.js +229 -206
- package/dist/components/SelectSearch/constants.d.ts +2 -0
- package/dist/components/SelectSearch/constants.js +6 -3
- package/dist/components/SelectSearch/types.d.ts +4 -0
- package/dist/components/SelectSearch/utils.d.ts +1 -0
- package/dist/components/SelectSearch/utils.js +23 -18
- package/package.json +1 -1
@@ -1,5 +1,8 @@
|
|
1
|
-
var
|
1
|
+
var p = /* @__PURE__ */ ((o) => (o.S = "s", o.M = "m", o.L = "l", o))(p || {}), r = /* @__PURE__ */ ((o) => (o.Input = "input", o.Dropdown = "dropdown", o.Both = "both", o.None = "none", o))(r || {});
|
2
|
+
const u = 240, H = 320;
|
2
3
|
export {
|
3
|
-
|
4
|
-
r as
|
4
|
+
H as DESKTOP_MENU_HEIGHT,
|
5
|
+
r as ELoadingIndicatorPlacement,
|
6
|
+
p as ESelectSearchSize,
|
7
|
+
u as MOBILE_MENU_HEIGHT
|
5
8
|
};
|
@@ -5,3 +5,4 @@ import { EInputSize } from '../Input';
|
|
5
5
|
export declare const mapSizeToInputSize: (size: ESelectSearchSize) => EInputSize;
|
6
6
|
export declare const getDropdownArrowIcon: (isOpen: boolean, size: ESelectSearchSize) => "DropdownArrowBottom16px" | "DropdownArrowUp16px" | "DropdownArrowUp24px" | "DropdownArrowDown24px";
|
7
7
|
export declare const prepareGroupedItems: (items: TSelectOption[], groupBy: string, getGroupTitle: (value: string) => string) => TSelectOption[];
|
8
|
+
export declare const shouldShowMenuOnTop: (selectRef: React.RefObject<HTMLDivElement>, size: ESelectSearchSize) => boolean;
|
@@ -1,33 +1,38 @@
|
|
1
|
-
import { ESelectSearchSize as t } from "./constants.js";
|
1
|
+
import { ESelectSearchSize as t, MOBILE_MENU_HEIGHT as i, DESKTOP_MENU_HEIGHT as a } from "./constants.js";
|
2
2
|
import "../../Input-BU_6U1CW.js";
|
3
|
-
import { EInputSize as
|
4
|
-
const
|
3
|
+
import { EInputSize as s } from "../Input/constants.js";
|
4
|
+
const h = (r) => {
|
5
5
|
switch (r) {
|
6
6
|
case t.S:
|
7
|
-
return
|
7
|
+
return s.S;
|
8
8
|
case t.M:
|
9
|
-
return
|
9
|
+
return s.M;
|
10
10
|
case t.L:
|
11
|
-
return
|
11
|
+
return s.L;
|
12
12
|
default:
|
13
|
-
return
|
13
|
+
return s.M;
|
14
14
|
}
|
15
|
-
},
|
15
|
+
}, l = (r, o) => r ? o === t.L ? "DropdownArrowUp24px" : "DropdownArrowUp16px" : o === t.L ? "DropdownArrowDown24px" : "DropdownArrowBottom16px", f = (r, o, u) => {
|
16
16
|
if (!r.length || !o) return r;
|
17
|
-
const
|
18
|
-
for (const
|
19
|
-
const e = String(
|
20
|
-
|
17
|
+
const n = [], c = /* @__PURE__ */ new Set();
|
18
|
+
for (const p of r) {
|
19
|
+
const e = String(p[o] || "Без группы");
|
20
|
+
c.has(e) || (c.add(e), n.push({
|
21
21
|
id: `group-header-${e}`,
|
22
|
-
name:
|
22
|
+
name: u(e),
|
23
23
|
isGroupHeader: !0,
|
24
24
|
originalValue: e
|
25
|
-
})),
|
25
|
+
})), n.push(p);
|
26
26
|
}
|
27
|
-
return
|
27
|
+
return n;
|
28
|
+
}, g = (r, o) => {
|
29
|
+
if (!r.current) return !1;
|
30
|
+
const u = r.current.getBoundingClientRect(), n = window.innerHeight, c = o === t.M || o === t.S ? i : a, p = n - u.bottom, e = u.top;
|
31
|
+
return p >= c ? !1 : e > p;
|
28
32
|
};
|
29
33
|
export {
|
30
|
-
|
31
|
-
|
32
|
-
f as prepareGroupedItems
|
34
|
+
l as getDropdownArrowIcon,
|
35
|
+
h as mapSizeToInputSize,
|
36
|
+
f as prepareGroupedItems,
|
37
|
+
g as shouldShowMenuOnTop
|
33
38
|
};
|