@ck-ui/component-library 2.0.4 → 2.0.5

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.
Files changed (65) hide show
  1. package/dist/{DropdownFooter-W4D9bbd6.js → DropdownFooter-DYusPa5E.js} +4 -3
  2. package/dist/assets/TableChipCell-B2fEKEbC.css +1 -0
  3. package/dist/assets/index-BB_JksPb.css +1 -0
  4. package/dist/assets/{index-BJ3ki-dZ.css → index-C8_uOajQ.css} +1 -1
  5. package/dist/assets/index-Ceh4ivv5.css +1 -0
  6. package/dist/assets/styles-BYpypz4h.css +1 -0
  7. package/dist/assets/{styles-CnUruVcX.css → styles-DU_mFQrB.css} +1 -1
  8. package/dist/assets/styles-Dikgm2G4.css +1 -0
  9. package/dist/components/Breadcrumb/index.js +51 -51
  10. package/dist/components/CKBadge/_types/ckBadge.types.d.ts +3 -1
  11. package/dist/components/CKBadge/_types/ckBadge.types.d.ts.map +1 -1
  12. package/dist/components/CKBadge/index.d.ts +1 -1
  13. package/dist/components/CKBadge/index.d.ts.map +1 -1
  14. package/dist/components/CKBadge/index.js +35 -32
  15. package/dist/components/FusionChart/_config/builders.d.ts.map +1 -1
  16. package/dist/components/FusionChart/_config/builders.js +74 -42
  17. package/dist/components/FusionChart/_config/helpers.d.ts.map +1 -1
  18. package/dist/components/FusionChart/_config/helpers.js +5 -5
  19. package/dist/components/FusionChart/index.d.ts.map +1 -1
  20. package/dist/components/FusionChart/index.js +418 -389
  21. package/dist/components/GroupedMultiSelect/_constant/constants.d.ts +2 -0
  22. package/dist/components/GroupedMultiSelect/_constant/constants.d.ts.map +1 -0
  23. package/dist/components/GroupedMultiSelect/_constant/constants.js +4 -0
  24. package/dist/components/GroupedMultiSelect/_helpers/DropdownFooter.js +1 -1
  25. package/dist/components/GroupedMultiSelect/_helpers/MenuItem.js +1 -1
  26. package/dist/components/GroupedMultiSelect/_helpers/MenuList.js +1 -1
  27. package/dist/components/GroupedMultiSelect/_helpers/OptionRow.js +1 -1
  28. package/dist/components/GroupedMultiSelect/_helpers/OptionsList.js +1 -1
  29. package/dist/components/GroupedMultiSelect/_helpers/SearchResult.js +1 -1
  30. package/dist/components/GroupedMultiSelect/_helpers/TagContent.js +1 -1
  31. package/dist/components/GroupedMultiSelect/_helpers/TriggerButton.d.ts.map +1 -1
  32. package/dist/components/GroupedMultiSelect/_helpers/TriggerButton.js +113 -67
  33. package/dist/components/GroupedMultiSelect/index.d.ts.map +1 -1
  34. package/dist/components/GroupedMultiSelect/index.js +187 -164
  35. package/dist/components/GroupedSingleSelect/_helpers/DropdownFooter.js +1 -1
  36. package/dist/components/GroupedSingleSelect/_helpers/OptionRow.js +1 -1
  37. package/dist/components/GroupedSingleSelect/_helpers/OptionsList.js +1 -1
  38. package/dist/components/GroupedSingleSelect/_helpers/TriggerButton.js +1 -1
  39. package/dist/components/GroupedSingleSelect/index.d.ts.map +1 -1
  40. package/dist/components/GroupedSingleSelect/index.js +113 -97
  41. package/dist/components/SingleSelectDropdown/_helpers/DropdownFooter.js +4 -3
  42. package/dist/components/SingleSelectDropdown/index.js +6 -5
  43. package/dist/components/Table/_helpers/ColumnManager/index.js +1 -1
  44. package/dist/components/Table/_helpers/FilterColumnToolbar.js +1 -1
  45. package/dist/components/Table/_helpers/TableChipCell.d.ts +21 -0
  46. package/dist/components/Table/_helpers/TableChipCell.d.ts.map +1 -0
  47. package/dist/components/Table/_helpers/TableChipCell.js +158 -0
  48. package/dist/components/Table/_types/table.types.d.ts +12 -1
  49. package/dist/components/Table/_types/table.types.d.ts.map +1 -1
  50. package/dist/components/Table/index.d.ts.map +1 -1
  51. package/dist/components/Table/index.js +673 -402
  52. package/dist/main.d.ts +4 -3
  53. package/dist/main.d.ts.map +1 -1
  54. package/dist/main.js +116 -114
  55. package/dist/styles.module-D5ab7LbM.js +40 -0
  56. package/dist/styles.module-Y7TzrS2V.js +51 -0
  57. package/dist/table-filter-BwC2jvAO.js +8 -0
  58. package/package.json +1 -1
  59. package/dist/assets/index-DZaWJ3P3.css +0 -1
  60. package/dist/assets/index-DlcdXqx_.css +0 -1
  61. package/dist/assets/styles-B4HnRCM5.css +0 -1
  62. package/dist/assets/styles-DVAtoUQM.css +0 -1
  63. package/dist/styles.module-DBuEcddZ.js +0 -29
  64. package/dist/styles.module-DKDRix10.js +0 -39
  65. package/dist/table-filter-C0zetUfo.js +0 -6
@@ -0,0 +1,2 @@
1
+ export declare const HOVER_CLOSE_DELAY = 150;
2
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../lib/components/GroupedMultiSelect/_constant/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,MAAM,CAAC"}
@@ -0,0 +1,4 @@
1
+ const E = 150;
2
+ export {
3
+ E as HOVER_CLOSE_DELAY
4
+ };
@@ -1,5 +1,5 @@
1
1
  import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
- import { s as a } from "../../../styles.module-DKDRix10.js";
2
+ import { s as a } from "../../../styles.module-Y7TzrS2V.js";
3
3
  import { CKButton as o } from "../../CKButton/index.js";
4
4
  import { mergeClasses as r } from "../../../utils/mergeClasses.js";
5
5
  const f = ({
@@ -1,7 +1,7 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import { useRef as f, useState as l, useLayoutEffect as d } from "react";
3
3
  import { Tooltip as u } from "../../Tooltip/index.js";
4
- import { s as a } from "../../../styles.module-DKDRix10.js";
4
+ import { s as a } from "../../../styles.module-Y7TzrS2V.js";
5
5
  import { mergeClasses as p } from "../../../utils/mergeClasses.js";
6
6
  const k = ({ item: { value: c, label: t } }) => {
7
7
  const s = f(null), [m, i] = l(!1);
@@ -1,5 +1,5 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { s } from "../../../styles.module-DKDRix10.js";
2
+ import { s } from "../../../styles.module-Y7TzrS2V.js";
3
3
  import i from "./MenuItem.js";
4
4
  const a = ({ selected: t }) => /* @__PURE__ */ r("div", { className: s["menu-list"], children: t?.map((e, m) => m < 2 ? null : /* @__PURE__ */ r(i, { item: e }, e?.value)) });
5
5
  export {
@@ -1,6 +1,6 @@
1
1
  import { jsxs as p, jsx as i } from "react/jsx-runtime";
2
2
  import { memo as a, useCallback as l } from "react";
3
- import { s as m } from "../../../styles.module-DKDRix10.js";
3
+ import { s as m } from "../../../styles.module-Y7TzrS2V.js";
4
4
  import { CKCheckbox as d } from "../../CKCheckbox/index.js";
5
5
  import { mergeClasses as t } from "../../../utils/mergeClasses.js";
6
6
  const u = a(function({
@@ -1,5 +1,5 @@
1
1
  import { jsxs as r, jsx as o } from "react/jsx-runtime";
2
- import { s as e } from "../../../styles.module-DKDRix10.js";
2
+ import { s as e } from "../../../styles.module-Y7TzrS2V.js";
3
3
  import { CKCheckbox as u } from "../../CKCheckbox/index.js";
4
4
  import b from "./OptionRow.js";
5
5
  import { mergeClasses as s } from "../../../utils/mergeClasses.js";
@@ -1,5 +1,5 @@
1
1
  import { jsxs as s, jsx as l } from "react/jsx-runtime";
2
- import { s as e } from "../../../styles.module-DKDRix10.js";
2
+ import { s as e } from "../../../styles.module-Y7TzrS2V.js";
3
3
  import { Toggle as t } from "../../Toggle/index.js";
4
4
  import { mergeClasses as r } from "../../../utils/mergeClasses.js";
5
5
  const h = ({
@@ -1,7 +1,7 @@
1
1
  import { jsxs as u, jsx as o } from "react/jsx-runtime";
2
2
  import h, { useCallback as l, useRef as v, useState as g, useLayoutEffect as w } from "react";
3
3
  import { S as C } from "../../../cancel-BAgTEOGD.js";
4
- import { s } from "../../../styles.module-DKDRix10.js";
4
+ import { s } from "../../../styles.module-Y7TzrS2V.js";
5
5
  import { Tooltip as O } from "../../Tooltip/index.js";
6
6
  const T = h.memo(function({
7
7
  label: t,
@@ -1 +1 @@
1
- {"version":3,"file":"TriggerButton.d.ts","sourceRoot":"","sources":["../../../../lib/components/GroupedMultiSelect/_helpers/TriggerButton.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGzD,QAAA,MAAM,aAAa,GAAI,8FASpB,kBAAkB,4CAmDpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"TriggerButton.d.ts","sourceRoot":"","sources":["../../../../lib/components/GroupedMultiSelect/_helpers/TriggerButton.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAIzD,QAAA,MAAM,aAAa,GAAI,8FASpB,kBAAkB,4CAsHpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,73 +1,119 @@
1
- import { jsxs as n, jsx as a } from "react/jsx-runtime";
2
- import { s as r } from "../../../styles.module-DKDRix10.js";
3
- import { CKTag as d } from "../../CKTag/index.js";
4
- import { S as u } from "../../../chevron-down-Cm9R64Fe.js";
5
- import f from "./TagContent.js";
6
- import v from "./MenuList.js";
7
- import { mergeClasses as l } from "../../../utils/mergeClasses.js";
8
- const T = ({
9
- open: s,
10
- selected: e,
11
- placeholder: m,
12
- showMenu: p,
13
- onToggleOpen: c,
14
- onToggleMenu: h,
15
- onRemove: t,
16
- classNames: i
17
- }) => /* @__PURE__ */ n(
18
- "button",
19
- {
20
- className: l(
21
- r.trigger,
22
- s ? r["trigger-open"] : "",
23
- i?.dropdownOpenerWrapperClass
24
- ),
25
- onClick: c,
26
- type: "button",
27
- children: [
28
- e?.length > 0 ? /* @__PURE__ */ n("div", { className: r["selected-tags-container"], children: [
29
- e?.map((o, g) => g > 1 ? null : /* @__PURE__ */ a(d, { variation: "INFO", size: "small", fill: "soft", children: /* @__PURE__ */ a(
30
- f,
31
- {
32
- label: o?.label,
33
- value: o?.value,
34
- onRemove: t
35
- }
36
- ) }, o?.value)),
37
- e?.length > 2 && /* @__PURE__ */ n(
1
+ import { jsxs as l, jsx as r, Fragment as T } from "react/jsx-runtime";
2
+ import { useState as w, useRef as C, useCallback as M, useLayoutEffect as y } from "react";
3
+ import { s as e } from "../../../styles.module-Y7TzrS2V.js";
4
+ import { CKTag as B } from "../../CKTag/index.js";
5
+ import { S as R } from "../../../chevron-down-Cm9R64Fe.js";
6
+ import S from "./TagContent.js";
7
+ import x from "./MenuList.js";
8
+ import { mergeClasses as t } from "../../../utils/mergeClasses.js";
9
+ import { HOVER_CLOSE_DELAY as H } from "../_constant/constants.js";
10
+ const K = ({
11
+ open: u,
12
+ selected: n,
13
+ placeholder: b,
14
+ showMenu: E,
15
+ onToggleOpen: L,
16
+ onToggleMenu: k,
17
+ onRemove: p,
18
+ classNames: m
19
+ }) => {
20
+ const [N, f] = w(!1), [O, h] = w(!1), a = C(null), s = C(null), d = M((o) => {
21
+ o.stopPropagation(), s.current && (clearTimeout(s.current), s.current = null), f(!0);
22
+ }, []), g = M((o) => {
23
+ o.stopPropagation(), s.current = setTimeout(() => {
24
+ f(!1);
25
+ }, H);
26
+ }, []), c = E || N, v = n?.length > 2;
27
+ return y(() => {
28
+ if (!c || !a.current) return;
29
+ const i = a.current.getBoundingClientRect();
30
+ window.innerHeight - i.bottom < 0 ? h(!0) : h(!1);
31
+ }, [c]), /* @__PURE__ */ l(
32
+ "button",
33
+ {
34
+ className: t(
35
+ e.trigger,
36
+ u ? e["trigger-open"] : "",
37
+ m?.dropdownOpenerWrapperClass
38
+ ),
39
+ onClick: L,
40
+ type: "button",
41
+ children: [
42
+ n?.length > 0 ? /* @__PURE__ */ l(T, { children: [
43
+ /* @__PURE__ */ l("div", { className: e["selected-tags-container"], children: [
44
+ n?.map((o, i) => i > 1 ? null : /* @__PURE__ */ r(
45
+ B,
46
+ {
47
+ variation: "INFO",
48
+ size: "small",
49
+ fill: "soft",
50
+ children: /* @__PURE__ */ r(
51
+ S,
52
+ {
53
+ label: o?.label,
54
+ value: o?.value,
55
+ onRemove: p
56
+ }
57
+ )
58
+ },
59
+ o?.value
60
+ )),
61
+ v && /* @__PURE__ */ l(
62
+ "span",
63
+ {
64
+ className: t(
65
+ "ckds-cap-med",
66
+ e["overflow-count"]
67
+ ),
68
+ onMouseEnter: d,
69
+ onMouseLeave: g,
70
+ onClick: k,
71
+ children: [
72
+ "...+",
73
+ n?.length - 2
74
+ ]
75
+ }
76
+ )
77
+ ] }),
78
+ v && c && /* @__PURE__ */ r(
79
+ "div",
80
+ {
81
+ ref: a,
82
+ className: t(
83
+ e["overflow-menu-portal"],
84
+ O ? e["overflow-menu-portal-up"] : ""
85
+ ),
86
+ onMouseEnter: d,
87
+ onMouseLeave: g,
88
+ children: /* @__PURE__ */ r(x, { selected: n, handleChecked: p })
89
+ }
90
+ )
91
+ ] }) : /* @__PURE__ */ r(
38
92
  "span",
39
93
  {
40
- className: l("ckds-cap-med", r["overflow-count"]),
41
- onClick: h,
42
- children: [
43
- "...+",
44
- e?.length - 2
45
- ]
94
+ className: t(
95
+ "ckds-body-sm-reg",
96
+ e.placeholder,
97
+ m?.placeholderClass
98
+ ),
99
+ children: b
46
100
  }
47
101
  ),
48
- p && /* @__PURE__ */ a(v, { selected: e, handleChecked: t })
49
- ] }) : /* @__PURE__ */ a(
50
- "span",
51
- {
52
- className: l(
53
- "ckds-body-sm-reg",
54
- r.placeholder,
55
- i?.placeholderClass
56
- ),
57
- children: m
58
- }
59
- ),
60
- /* @__PURE__ */ a(
61
- u,
62
- {
63
- className: l(r.chevron, s ? r["chevron-up"] : ""),
64
- width: "14",
65
- height: "14"
66
- }
67
- )
68
- ]
69
- }
70
- );
102
+ /* @__PURE__ */ r(
103
+ R,
104
+ {
105
+ className: t(
106
+ e.chevron,
107
+ u ? e["chevron-up"] : ""
108
+ ),
109
+ width: "14",
110
+ height: "14"
111
+ }
112
+ )
113
+ ]
114
+ }
115
+ );
116
+ };
71
117
  export {
72
- T as default
118
+ K as default
73
119
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/GroupedMultiSelect/index.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,uBAAuB,EAAgB,MAAM,eAAe,CAAC;AAC3E,YAAY,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAI/E,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,UAAU,EACV,QAAQ,EACR,WAAgC,EAChC,iBAA4B,EAC5B,MAAM,EACN,eAAe,EACf,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,OAAO,EACP,UAAe,EACf,cAAc,GACf,EAAE,uBAAuB,2CA+MzB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/GroupedMultiSelect/index.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,uBAAuB,EAAgB,MAAM,eAAe,CAAC;AAC3E,YAAY,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAI/E,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,UAAU,EACV,QAAQ,EACR,WAAgC,EAChC,iBAA4B,EAC5B,MAAM,EACN,eAAe,EACf,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,OAAO,EACP,UAAe,EACf,cAAc,GACf,EAAE,uBAAuB,2CAiOzB"}
@@ -1,176 +1,199 @@
1
- import { jsxs as h, jsx as n } from "react/jsx-runtime";
2
- import { useState as f, useRef as se, useEffect as ne, useMemo as b, useCallback as o } from "react";
3
- import { s as d } from "../../styles.module-DKDRix10.js";
4
- import { Search as re } from "../Search/index.js";
5
- import ae from "./_helpers/SearchResult.js";
6
- import ce from "./_helpers/TriggerButton.js";
7
- import ie from "./_helpers/OptionsList.js";
8
- import de from "./_helpers/DropdownFooter.js";
9
- import { getDefaultSelected as me } from "./_utils/getDefaultSelected.js";
10
- import { selectAllOptions as fe } from "./_utils/selectAllOptions.js";
11
- import { getResponsePayload as he } from "./_utils/getResponsePayload.js";
12
- import { filterSeachedGroups as pe } from "./_utils/filterSeachedGroups.js";
13
- import { computeApplyDisabled as ue } from "./_utils/computeApplyDisabled.js";
14
- import { S as ge } from "../../info-icon-ooYw3va_.js";
15
- import { mergeClasses as I } from "../../utils/mergeClasses.js";
16
- function Ge({
17
- label: M,
18
- helperText: L,
19
- required: N,
20
- placeholder: j = "Choose parameter",
21
- searchPlaceholder: P = "Search",
22
- groups: s,
23
- defaultSelected: Q,
24
- onApply: O,
1
+ import { jsxs as f, jsx as s } from "react/jsx-runtime";
2
+ import { useState as m, useRef as z, useEffect as ce, useMemo as b, useCallback as r } from "react";
3
+ import { s as t } from "../../styles.module-Y7TzrS2V.js";
4
+ import { Search as ie } from "../Search/index.js";
5
+ import de from "./_helpers/SearchResult.js";
6
+ import pe from "./_helpers/TriggerButton.js";
7
+ import me from "./_helpers/OptionsList.js";
8
+ import fe from "./_helpers/DropdownFooter.js";
9
+ import { getDefaultSelected as ue } from "./_utils/getDefaultSelected.js";
10
+ import { selectAllOptions as he } from "./_utils/selectAllOptions.js";
11
+ import { getResponsePayload as ge } from "./_utils/getResponsePayload.js";
12
+ import { filterSeachedGroups as Se } from "./_utils/filterSeachedGroups.js";
13
+ import { computeApplyDisabled as we } from "./_utils/computeApplyDisabled.js";
14
+ import { useDropdownDirection as Ce } from "../MultiSelect/_utils/useDropdownDirection.js";
15
+ import { S as be } from "../../info-icon-ooYw3va_.js";
16
+ import { mergeClasses as O } from "../../utils/mergeClasses.js";
17
+ function ze({
18
+ label: k,
19
+ helperText: v,
20
+ required: P,
21
+ placeholder: Q = "Choose parameter",
22
+ searchPlaceholder: W = "Search",
23
+ groups: n,
24
+ defaultSelected: q,
25
+ onApply: N,
25
26
  exclude: y,
26
- setExclude: $,
27
- onSelect: R,
28
- onClear: T,
29
- classNames: p = {},
30
- showExcludeBtn: q
27
+ setExclude: x,
28
+ onSelect: T,
29
+ onClear: E,
30
+ classNames: u = {},
31
+ showExcludeBtn: B
31
32
  }) {
32
- const { labelWrapperClass: z, helperClass: B, dividerClass: F } = p, [v, u] = f(!1), [g, k] = f(""), x = () => me(Q), [m, E] = f(x), [r, S] = f(x), [W, l] = f(!1), [H, C] = f(!1), w = se(null);
33
- ne(() => {
34
- const e = (t) => {
35
- w?.current && !w?.current?.contains(t.target) && (u(!1), l(!1));
33
+ const { labelWrapperClass: F, helperClass: H, dividerClass: J } = u, [h, g] = m(!1), [S, G] = m(""), I = () => ue(q), [p, L] = m(I), [a, w] = m(I), [K, l] = m(!1), [U, C] = m(!1), D = z(null), $ = z(null), { vertical: A, horizontal: V } = Ce(
34
+ $,
35
+ h
36
+ );
37
+ ce(() => {
38
+ const e = (o) => {
39
+ D?.current && !D?.current?.contains(o.target) && (g(!1), l(!1));
36
40
  };
37
41
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
38
42
  }, []);
39
- const A = b(
40
- () => pe(s, g),
41
- [s, g]
42
- ), J = b(
43
- () => A?.reduce((e, t) => e + t?.options?.length, 0),
44
- [A]
45
- ), K = o(() => {
46
- k("");
47
- }, []), D = b(
48
- () => s?.reduce((e, t) => e + t?.options?.length, 0),
49
- [s]
50
- ), G = o(
51
- (e, t, le, oe) => {
52
- le || l(!1), oe && E((a) => {
53
- const c = a?.some((i) => i?.value === e) ? a?.filter((i) => i?.value !== e) : [...a, { value: e, label: t }];
54
- return C(c?.length === D), c?.length <= 2 && l(!1), c;
55
- }), S((a) => {
56
- const c = a?.some((i) => i?.value === e) ? a?.filter((i) => i?.value !== e) : [...a, { value: e, label: t }];
57
- return C(c?.length === D), c?.length <= 2 && l(!1), c;
58
- }), R?.();
43
+ const R = b(
44
+ () => Se(n, S),
45
+ [n, S]
46
+ ), X = b(
47
+ () => R?.reduce((e, o) => e + o?.options?.length, 0),
48
+ [R]
49
+ ), Y = r(() => {
50
+ G("");
51
+ }, []), M = b(
52
+ () => n?.reduce((e, o) => e + o?.options?.length, 0),
53
+ [n]
54
+ ), j = r(
55
+ (e, o, se, ae) => {
56
+ se || l(!1), ae && L((c) => {
57
+ const i = c?.some((d) => d?.value === e) ? c?.filter((d) => d?.value !== e) : [...c, { value: e, label: o }];
58
+ return C(i?.length === M), i?.length <= 2 && l(!1), i;
59
+ }), w((c) => {
60
+ const i = c?.some((d) => d?.value === e) ? c?.filter((d) => d?.value !== e) : [...c, { value: e, label: o }];
61
+ return C(i?.length === M), i?.length <= 2 && l(!1), i;
62
+ }), T?.();
59
63
  },
60
- [R, D]
61
- ), U = o(() => {
62
- l(!1), C((e) => (S(() => e ? [] : fe(s)), !e));
63
- }, [s]), V = o(() => {
64
- S([]), C(!1), T?.();
65
- }, [T]), X = o(() => {
66
- O(he(s, r), y), u(!1), E(r);
67
- }, [s, r, y, O]), Y = o(() => {
68
- u((e) => !e), l(!1);
69
- }, []), Z = o((e) => {
70
- e.stopPropagation(), l((t) => !t);
71
- }, []), _ = o(() => {
72
- l(!1), S(m), u(!1);
73
- }, [m]), ee = o((e) => {
74
- k(e);
75
- }, []), te = b(
76
- () => ue(r, m),
77
- [r, m]
64
+ [T, M]
65
+ ), Z = r(() => {
66
+ l(!1), C((e) => (w(() => e ? [] : he(n)), !e));
67
+ }, [n]), _ = r(() => {
68
+ w([]), C(!1), E?.();
69
+ }, [E]), ee = r(() => {
70
+ N(ge(n, a), y), g(!1), L(a);
71
+ }, [n, a, y, N]), te = r(() => {
72
+ g((e) => !e), l(!1);
73
+ }, []), oe = r((e) => {
74
+ e.stopPropagation(), l((o) => !o);
75
+ }, []), le = r(() => {
76
+ l(!1), w(p), g(!1);
77
+ }, [p]), re = r((e) => {
78
+ G(e);
79
+ }, []), ne = b(
80
+ () => we(a, p),
81
+ [a, p]
78
82
  );
79
- return /* @__PURE__ */ h("div", { className: d["ckds-group-multi-select-wrapper"], ref: w, children: [
80
- M && /* @__PURE__ */ h(
81
- "span",
82
- {
83
- className: I(
84
- "ckds-body-xs-med",
85
- d["label-wrapper"],
86
- z
83
+ return /* @__PURE__ */ f(
84
+ "div",
85
+ {
86
+ className: t["ckds-group-multi-select-wrapper"],
87
+ ref: D,
88
+ children: [
89
+ k && /* @__PURE__ */ f(
90
+ "span",
91
+ {
92
+ className: O(
93
+ "ckds-body-xs-med",
94
+ t["label-wrapper"],
95
+ F
96
+ ),
97
+ children: [
98
+ k,
99
+ P && /* @__PURE__ */ s("span", { className: t.required, children: " *" })
100
+ ]
101
+ }
87
102
  ),
88
- children: [
89
- M,
90
- N && /* @__PURE__ */ n("span", { className: d.required, children: " *" })
91
- ]
92
- }
93
- ),
94
- /* @__PURE__ */ h("div", { children: [
95
- /* @__PURE__ */ n(
96
- ce,
97
- {
98
- open: v,
99
- selected: m,
100
- placeholder: j,
101
- showMenu: W,
102
- onToggleOpen: Y,
103
- onToggleMenu: Z,
104
- onRemove: G,
105
- classNames: p
106
- }
107
- ),
108
- /* @__PURE__ */ h(
109
- "div",
110
- {
111
- className: I(
112
- "ckds-body-xs-reg",
113
- d["helper-text"],
114
- v ? d["helper-hide"] : "",
115
- B
103
+ /* @__PURE__ */ f("div", { className: t["trigger-wrapper"], ref: $, children: [
104
+ /* @__PURE__ */ s(
105
+ pe,
106
+ {
107
+ open: h,
108
+ selected: p,
109
+ placeholder: Q,
110
+ showMenu: K,
111
+ onToggleOpen: te,
112
+ onToggleMenu: oe,
113
+ onRemove: j,
114
+ classNames: u
115
+ }
116
+ ),
117
+ /* @__PURE__ */ f(
118
+ "div",
119
+ {
120
+ className: O(
121
+ "ckds-body-xs-reg",
122
+ t["helper-text"],
123
+ h ? t["helper-hide"] : "",
124
+ H
125
+ ),
126
+ children: [
127
+ /* @__PURE__ */ s(be, { width: "12", height: "12" }),
128
+ " ",
129
+ v
130
+ ]
131
+ }
116
132
  ),
117
- children: [
118
- /* @__PURE__ */ n(ge, { width: "12", height: "12" }),
119
- " ",
120
- L
121
- ]
122
- }
123
- )
124
- ] }),
125
- v && /* @__PURE__ */ h("div", { className: d.dropdown, children: [
126
- /* @__PURE__ */ n(
127
- re,
128
- {
129
- size: "medium",
130
- value: g,
131
- placeholder: P,
132
- onChange: ee,
133
- onClear: K
134
- }
135
- ),
136
- /* @__PURE__ */ n(
137
- ae,
138
- {
139
- totalSearchResults: J,
140
- exclude: y,
141
- setExclude: $,
142
- isToggleDisable: m?.length === 0,
143
- showExcludeBtn: q
144
- }
145
- ),
146
- /* @__PURE__ */ n("div", { className: `${d.divider} ${F}` }),
147
- /* @__PURE__ */ n(
148
- ie,
149
- {
150
- filteredGroups: A,
151
- selected: r,
152
- isAllSelected: H,
153
- searchQuery: g,
154
- onToggle: G,
155
- onSelectAll: U,
156
- setShowMenu: l,
157
- classNames: p
158
- }
159
- ),
160
- /* @__PURE__ */ n(
161
- de,
162
- {
163
- onClear: V,
164
- onCancel: _,
165
- onApply: X,
166
- classNames: p,
167
- isClearDisabled: r?.length === 0,
168
- isApplyDisabled: te
169
- }
170
- )
171
- ] })
172
- ] });
133
+ h && /* @__PURE__ */ f(
134
+ "div",
135
+ {
136
+ className: O(
137
+ t.dropdown,
138
+ t[`dropdown-align-${V}`],
139
+ A === "up" ? t["dropdown-up"] : "",
140
+ v && A === "down" ? t["dropdown-helper"] : "",
141
+ v && A === "up" ? t["dropdown-helper-up"] : ""
142
+ ),
143
+ children: [
144
+ /* @__PURE__ */ s(
145
+ ie,
146
+ {
147
+ size: "medium",
148
+ value: S,
149
+ placeholder: W,
150
+ onChange: re,
151
+ onClear: Y
152
+ }
153
+ ),
154
+ /* @__PURE__ */ s(
155
+ de,
156
+ {
157
+ totalSearchResults: X,
158
+ exclude: y,
159
+ setExclude: x,
160
+ isToggleDisable: p?.length === 0,
161
+ showExcludeBtn: B
162
+ }
163
+ ),
164
+ /* @__PURE__ */ s("div", { className: `${t.divider} ${J}` }),
165
+ /* @__PURE__ */ s(
166
+ me,
167
+ {
168
+ filteredGroups: R,
169
+ selected: a,
170
+ isAllSelected: U,
171
+ searchQuery: S,
172
+ onToggle: j,
173
+ onSelectAll: Z,
174
+ setShowMenu: l,
175
+ classNames: u
176
+ }
177
+ ),
178
+ /* @__PURE__ */ s(
179
+ fe,
180
+ {
181
+ onClear: _,
182
+ onCancel: le,
183
+ onApply: ee,
184
+ classNames: u,
185
+ isClearDisabled: a?.length === 0,
186
+ isApplyDisabled: ne
187
+ }
188
+ )
189
+ ]
190
+ }
191
+ )
192
+ ] })
193
+ ]
194
+ }
195
+ );
173
196
  }
174
197
  export {
175
- Ge as GroupedMultiSelect
198
+ ze as GroupedMultiSelect
176
199
  };