@ck-ui/component-library 1.0.0 → 1.0.2

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 (123) hide show
  1. package/dist/DropdownFooter-CsDll1Tj.js +96 -0
  2. package/dist/{Grow-D08Iq1uH.js → Grow-wzNsNKt2.js} +41 -41
  3. package/dist/IconSlot-DvUwY6Do.js +33 -0
  4. package/dist/{OptionList-DN1xZbnV.js → OptionList-BM4AleXV.js} +361 -290
  5. package/dist/{Select-Cw96VEHD.js → Select-CiuwMSD7.js} +2366 -2427
  6. package/dist/assets/DropdownFooter-JrU15UnN.css +1 -0
  7. package/dist/assets/IconSlot-BWv5PQN_.css +1 -0
  8. package/dist/assets/ReactToastify-GNLSjkBZ.css +1 -0
  9. package/dist/assets/{ToastContent-PGkBxPUW.css → ToastContent-DpF5zCks.css} +1 -1
  10. package/dist/assets/index-0R9p-l95.css +1 -0
  11. package/dist/assets/index-B3yBTtVQ.css +1 -0
  12. package/dist/assets/index-BXwGxK7I.css +1 -0
  13. package/dist/assets/index-BZgvXFWW.css +1 -0
  14. package/dist/assets/index-BbJZjGLb.css +1 -0
  15. package/dist/assets/index-UphWJR2V.css +1 -0
  16. package/dist/assets/{main-Dv8QUU_o.css → main-3OqLSdPm.css} +1 -1
  17. package/dist/assets/{styles-Chhklrps.css → styles-C5uYY4fL.css} +1 -1
  18. package/dist/assets/styles-CEyiQgVQ.css +1 -0
  19. package/dist/assets/styles-DLJzdWsF.css +1 -0
  20. package/dist/assets/{styles-Bqfs9eXV.css → styles-DngCqCGW.css} +1 -1
  21. package/dist/assets/styles-O-5pBCak.css +1 -0
  22. package/dist/components/CKButton/_helper/ComboLayout.js +1 -1
  23. package/dist/components/CKButton/_helper/IconSlot.js +1 -1
  24. package/dist/components/CKButton/_helper/StandardLayout.js +1 -1
  25. package/dist/components/CKButton/index.js +1 -1
  26. package/dist/components/CardBox/index.js +18 -18
  27. package/dist/components/DateRangePicker/DateRangePicker.js +703 -680
  28. package/dist/components/EmptyState/index.js +7 -7
  29. package/dist/components/FusionChart/_config/builders.d.ts.map +1 -1
  30. package/dist/components/FusionChart/_config/builders.js +207 -192
  31. package/dist/components/FusionChart/_config/helpers.d.ts +3 -0
  32. package/dist/components/FusionChart/_config/helpers.d.ts.map +1 -1
  33. package/dist/components/FusionChart/_config/helpers.js +61 -45
  34. package/dist/components/FusionChart/_types/fusionChart.types.d.ts +2 -0
  35. package/dist/components/FusionChart/_types/fusionChart.types.d.ts.map +1 -1
  36. package/dist/components/FusionChart/_utils/chartHelpers.js +1 -1
  37. package/dist/components/FusionChart/index.d.ts.map +1 -1
  38. package/dist/components/FusionChart/index.js +163 -130
  39. package/dist/components/MenuOptions/_utils/computeMenuPosition.js +1 -1
  40. package/dist/components/MenuOptions/_utils/computeSubmenuPosition.js +1 -1
  41. package/dist/components/MetricCards/Component/CardWithIconAndForecast/index.js +30 -30
  42. package/dist/components/MultiSelect/SimpleMultiSelect.d.ts +3 -1
  43. package/dist/components/MultiSelect/SimpleMultiSelect.d.ts.map +1 -1
  44. package/dist/components/MultiSelect/SimpleMultiSelect.js +150 -136
  45. package/dist/components/MultiSelect/_helpers/DropdownFooter.js +1 -1
  46. package/dist/components/MultiSelect/_helpers/OptionRow.js +1 -1
  47. package/dist/components/MultiSelect/_helpers/OverflowMenu.js +1 -1
  48. package/dist/components/MultiSelect/_helpers/OverflowMenuItem.js +1 -1
  49. package/dist/components/MultiSelect/_helpers/SearchResult.d.ts +1 -1
  50. package/dist/components/MultiSelect/_helpers/SearchResult.d.ts.map +1 -1
  51. package/dist/components/MultiSelect/_helpers/SearchResult.js +31 -21
  52. package/dist/components/MultiSelect/_helpers/TagContent.js +1 -1
  53. package/dist/components/MultiSelect/_helpers/TriggerButton.d.ts.map +1 -1
  54. package/dist/components/MultiSelect/_helpers/TriggerButton.js +95 -74
  55. package/dist/components/MultiSelect/_types/type.d.ts +7 -2
  56. package/dist/components/MultiSelect/_types/type.d.ts.map +1 -1
  57. package/dist/components/MultiSelect/_utils/useDropdownDirection.d.ts +18 -0
  58. package/dist/components/MultiSelect/_utils/useDropdownDirection.d.ts.map +1 -0
  59. package/dist/components/MultiSelect/_utils/useDropdownDirection.js +23 -0
  60. package/dist/components/MultiSelect/index.d.ts +1 -1
  61. package/dist/components/MultiSelect/index.d.ts.map +1 -1
  62. package/dist/components/MultiSelect/index.js +162 -150
  63. package/dist/components/PopupAndDialogBox/components/DialogContent.js +1 -1
  64. package/dist/components/PopupAndDialogBox/components/DialogFooter.js +1 -1
  65. package/dist/components/PopupAndDialogBox/components/DialogHeader.js +1 -1
  66. package/dist/components/PopupAndDialogBox/index.js +1 -1
  67. package/dist/components/RadioButton/index.js +34 -34
  68. package/dist/components/RadioGroup/_types/radioGroup.types.d.ts +1 -0
  69. package/dist/components/RadioGroup/_types/radioGroup.types.d.ts.map +1 -1
  70. package/dist/components/RadioGroup/index.d.ts +1 -1
  71. package/dist/components/RadioGroup/index.d.ts.map +1 -1
  72. package/dist/components/RadioGroup/index.js +19 -17
  73. package/dist/components/Search/index.d.ts.map +1 -1
  74. package/dist/components/Search/index.js +63 -61
  75. package/dist/components/SingleSelectDropdown/_helpers/DropdownFooter.js +3 -3
  76. package/dist/components/SingleSelectDropdown/index.d.ts.map +1 -1
  77. package/dist/components/SingleSelectDropdown/index.js +83 -78
  78. package/dist/components/Table/_helpers/ColumnManager/ColumnConfig.d.ts.map +1 -1
  79. package/dist/components/Table/_helpers/ColumnManager/ColumnConfig.js +22 -19
  80. package/dist/components/Table/_helpers/ColumnManager/index.d.ts.map +1 -1
  81. package/dist/components/Table/_helpers/ColumnManager/index.js +304 -301
  82. package/dist/components/Table/_helpers/GroupedHeader/index.js +1 -1
  83. package/dist/components/Table/_helpers/TableFilterModal/OptionList.js +1 -1
  84. package/dist/components/Table/_helpers/TableFilterModal/RangeSelector.js +133 -142
  85. package/dist/components/Table/_helpers/TableFilterModal/index.d.ts.map +1 -1
  86. package/dist/components/Table/_helpers/TableFilterModal/index.js +43 -42
  87. package/dist/components/Table/_helpers/TableRows.js +1 -1
  88. package/dist/components/Table/index.d.ts.map +1 -1
  89. package/dist/components/Table/index.js +215 -210
  90. package/dist/components/TextField/index.js +331 -328
  91. package/dist/components/Toast/_helper/ToastContent.js +25 -25
  92. package/dist/components/Toast/_helper/ToastProvider.js +9 -9
  93. package/dist/components/Toast/_hooks/useToast.js +1 -1
  94. package/dist/components/Tooltip/index.js +772 -697
  95. package/dist/components/Typography/index.js +30 -30
  96. package/dist/createSimplePaletteValueFilter-BqxST_wX.js +24 -0
  97. package/dist/index-BR6M9zUI.js +382 -0
  98. package/dist/{index-f7TB87Mf.js → index-Bcvmezbu.js} +23 -3
  99. package/dist/main.d.ts +1 -0
  100. package/dist/main.d.ts.map +1 -1
  101. package/dist/main.js +15 -13
  102. package/dist/styles.module-yIHBMSTk.js +53 -0
  103. package/dist/styles.module-yNDMDNO-.js +14 -0
  104. package/dist/{useSlot-ylt7_lTY.js → useSlot-BiMlGawc.js} +656 -623
  105. package/package.json +3 -3
  106. package/dist/DropdownFooter-CYkg2g5d.js +0 -89
  107. package/dist/IconSlot-CFKmSU2_.js +0 -33
  108. package/dist/assets/DropdownFooter-DjdPf69A.css +0 -1
  109. package/dist/assets/IconSlot-CLpdZgmb.css +0 -1
  110. package/dist/assets/ReactToastify-tlSLHgLC.css +0 -1
  111. package/dist/assets/index-B81zpOpq.css +0 -1
  112. package/dist/assets/index-BmQOtMhS.css +0 -1
  113. package/dist/assets/index-CaWXKQ7j.css +0 -1
  114. package/dist/assets/index-CiQd_iRw.css +0 -1
  115. package/dist/assets/index-DNhNBxL9.css +0 -1
  116. package/dist/assets/index-YHUWVH17.css +0 -1
  117. package/dist/assets/styles-BTZL03H2.css +0 -1
  118. package/dist/assets/styles-CYxKrBqL.css +0 -1
  119. package/dist/assets/styles-D8sahtFb.css +0 -1
  120. package/dist/contains-kLLEGdNH.js +0 -41
  121. package/dist/index-C8cPPHJD.js +0 -1196
  122. package/dist/styles.module-BZaUJMlf.js +0 -14
  123. package/dist/styles.module-Dojg5FTS.js +0 -41
@@ -4,7 +4,7 @@ function G(i) {
4
4
  function g(i, r, c) {
5
5
  const n = i.getBoundingClientRect(), o = G(c), e = Math.min(
6
6
  r * 32 + 16,
7
- o.height - 16
7
+ o.height - 8 * 2
8
8
  );
9
9
  let t = n.bottom + 4;
10
10
  return t + e > o.bottom - 8 && (t = n.top - e - 4), t < o.top + 8 && (t = o.top + 8), n.left + 238 > o.right - 8 ? { top: t, right: window.innerWidth - n.right } : { top: t, left: n.left };
@@ -1,5 +1,5 @@
1
1
  function N(t, i) {
2
- const E = window.innerWidth, o = window.innerHeight, G = Math.min(i * 32 + 16, o - 16);
2
+ const E = window.innerWidth, o = window.innerHeight, G = Math.min(i * 32 + 16, o - 8 * 2);
3
3
  let n = t.top;
4
4
  return n + G > o - 8 && (n = o - G - 8), n < 8 && (n = 8), t.right + 12 + 238 > E - 8 ? { top: n, right: E - t.left + 12 } : { top: n, left: t.right + 12 };
5
5
  }
@@ -1,43 +1,43 @@
1
- import { jsxs as a, Fragment as _, jsx as r } from "react/jsx-runtime";
2
- import { DeviationTag as m } from "../../../DeviationTag/index.js";
3
- import '../../../../assets/index-YHUWVH17.css';const g = "data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2177_11954)'%3e%3cpath%20d='M6.5001%205.5L10.6001%201.4'%20stroke='%233060C1'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11%203.41504V1.00005H8.585'%20stroke='%233060C1'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5.5%201H4.5C2%201%201%202%201%204.5V7.5C1%2010%202%2011%204.5%2011H7.5C10%2011%2011%2010%2011%207.5V6.5'%20stroke='%233060C1'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2177_11954'%3e%3crect%20width='12'%20height='12'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e", v = "_card_12h7m_1", f = "_icon_12h7m_19", p = "_title_12h7m_22", u = "_value_12h7m_36", N = "_forecast_12h7m_48", e = {
4
- card: v,
5
- icon: f,
6
- title: p,
7
- "action-link": "_action-link_12h7m_29",
8
- value: u,
9
- "date-range": "_date-range_12h7m_43",
10
- "forecast-card": "_forecast-card_12h7m_48",
1
+ import { jsxs as a, Fragment as g, jsx as r } from "react/jsx-runtime";
2
+ import { DeviationTag as h } from "../../../DeviationTag/index.js";
3
+ import '../../../../assets/index-0R9p-l95.css';const u = "data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2177_11954)'%3e%3cpath%20d='M6.5001%205.5L10.6001%201.4'%20stroke='%233060C1'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11%203.41504V1.00005H8.585'%20stroke='%233060C1'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5.5%201H4.5C2%201%201%202%201%204.5V7.5C1%2010%202%2011%204.5%2011H7.5C10%2011%2011%2010%2011%207.5V6.5'%20stroke='%233060C1'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2177_11954'%3e%3crect%20width='12'%20height='12'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e", m = "_card_4gun4_1", v = "_icon_4gun4_19", f = "_title_4gun4_22", p = "_value_4gun4_36", N = "_forecast_4gun4_48", e = {
4
+ card: m,
5
+ icon: v,
6
+ title: f,
7
+ "action-link": "_action-link_4gun4_29",
8
+ value: p,
9
+ "date-range": "_date-range_4gun4_43",
10
+ "forecast-card": "_forecast-card_4gun4_48",
11
11
  forecast: N,
12
- "regular-card": "_regular-card_12h7m_54",
13
- "secondary-section": "_secondary-section_12h7m_58"
12
+ "regular-card": "_regular-card_4gun4_54",
13
+ "secondary-section": "_secondary-section_4gun4_58"
14
14
  };
15
15
  function x({
16
- icon: t,
17
- title: l,
16
+ icon: s,
17
+ title: t,
18
18
  value: i,
19
19
  dateRange: o,
20
20
  deviationChip: c,
21
- forecastValue: n,
22
- className: h,
23
- actionLink: s,
21
+ forecastValue: l,
22
+ className: _,
23
+ actionLink: n,
24
24
  secondarySection: d
25
25
  }) {
26
- return /* @__PURE__ */ a(_, { children: [
26
+ return /* @__PURE__ */ a(g, { children: [
27
27
  /* @__PURE__ */ a(
28
28
  "div",
29
29
  {
30
- className: `${e.card} ${n ? e.forecast : ""} ${h}`,
30
+ className: `${e.card} ${l ? e.forecast : ""} ${_}`,
31
31
  children: [
32
32
  /* @__PURE__ */ a("div", { className: e["regular-card"], children: [
33
- (t || l) && /* @__PURE__ */ a("div", { className: e.header, children: [
34
- t && /* @__PURE__ */ r("div", { className: e.icon, children: t }),
35
- l && /* @__PURE__ */ r("div", { className: e.title, children: l })
33
+ (s || t) && /* @__PURE__ */ a("div", { className: e.header, children: [
34
+ s && /* @__PURE__ */ r("div", { className: e.icon, children: s }),
35
+ t && /* @__PURE__ */ r("div", { className: e.title, children: t })
36
36
  ] }),
37
37
  i && /* @__PURE__ */ r("div", { className: e.value, children: i }),
38
38
  o && /* @__PURE__ */ r("div", { className: e["date-range"], children: o }),
39
39
  c && /* @__PURE__ */ r(
40
- m,
40
+ h,
41
41
  {
42
42
  price: c.price ?? "",
43
43
  percentage: c.percentage ?? "",
@@ -46,18 +46,18 @@ function x({
46
46
  }
47
47
  )
48
48
  ] }),
49
- n && /* @__PURE__ */ a("div", { className: e["forecast-card"], children: [
49
+ l && /* @__PURE__ */ a("div", { className: e["forecast-card"], children: [
50
50
  /* @__PURE__ */ r("div", { className: e.title, children: "Forecast" }),
51
- /* @__PURE__ */ r("div", { className: e.value, children: n })
51
+ /* @__PURE__ */ r("div", { className: e.value, children: l })
52
52
  ] }),
53
- s?.href && /* @__PURE__ */ r(
53
+ n?.href && /* @__PURE__ */ r(
54
54
  "a",
55
55
  {
56
- href: s?.href,
57
- target: s?.target ?? "_blank",
56
+ href: n?.href,
57
+ target: n?.target ?? "_blank",
58
58
  rel: "noreferrer",
59
- className: `${e["action-link"]} ${s?.className}`,
60
- children: /* @__PURE__ */ r("img", { src: g, alt: "Redirection Link" })
59
+ className: `${e["action-link"]} ${n?.className}`,
60
+ children: /* @__PURE__ */ r("img", { src: u, alt: "Redirection Link" })
61
61
  }
62
62
  )
63
63
  ]
@@ -16,7 +16,9 @@ export interface SimpleMultiSelectProps {
16
16
  onClear?: () => void;
17
17
  classNames?: ClassNames;
18
18
  showExcludeBtn?: boolean;
19
+ /** Max number of chips to show inline before collapsing into +N. Defaults to 1. */
20
+ maxChips?: 1 | 2 | 3;
19
21
  width?: string | number;
20
22
  }
21
- export declare function SimpleMultiSelect({ label, helperText, required, placeholder, searchPlaceholder, selectAllLabel, options, defaultSelected, onApply, exclude, setExclude, onSelect, onClear, classNames, showExcludeBtn, width, }: SimpleMultiSelectProps): import("react/jsx-runtime").JSX.Element;
23
+ export declare function SimpleMultiSelect({ label, helperText, required, placeholder, searchPlaceholder, selectAllLabel, options, defaultSelected, onApply, exclude, setExclude, onSelect, onClear, classNames, showExcludeBtn, width, maxChips, }: SimpleMultiSelectProps): import("react/jsx-runtime").JSX.Element;
22
24
  //# sourceMappingURL=SimpleMultiSelect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SimpleMultiSelect.d.ts","sourceRoot":"","sources":["../../../lib/components/MultiSelect/SimpleMultiSelect.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAgB,MAAM,eAAe,CAAC;AAKjF,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,eAAe,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACtC,OAAO,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACnE,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1D,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CACxB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,UAAU,EACV,QAAQ,EACN,WAAgC,EAClC,iBAA4B,EAC5B,cAA6B,EAC7B,OAAO,EACP,eAAoB,EACpB,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,OAAO,EACP,UAAe,EACf,cAAc,EACd,KAAU,GACX,EAAE,sBAAsB,2CAiPxB"}
1
+ {"version":3,"file":"SimpleMultiSelect.d.ts","sourceRoot":"","sources":["../../../lib/components/MultiSelect/SimpleMultiSelect.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAgB,MAAM,eAAe,CAAC;AAOjF,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,eAAe,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACtC,OAAO,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACnE,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1D,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mFAAmF;IACnF,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CACxB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,UAAU,EACV,QAAQ,EACN,WAAgC,EAClC,iBAA4B,EAC5B,cAA6B,EAC7B,OAAO,EACP,eAAoB,EACpB,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,OAAO,EACP,UAAe,EACf,cAAc,EACd,KAAU,EACV,QAAY,GACb,EAAE,sBAAsB,2CAyQxB"}
@@ -1,214 +1,228 @@
1
- import { jsxs as c, jsx as t, Fragment as te } from "react/jsx-runtime";
2
- import { useState as u, useRef as re, useEffect as ne, useMemo as ae, useCallback as i } from "react";
3
- import { s as r } from "../../styles.module-Dojg5FTS.js";
4
- import { Search as oe } from "../Search/index.js";
5
- import { S as ce } from "../../info-icon-ooYw3va_.js";
6
- import { CKCheckbox as ie } from "../CKCheckbox/index.js";
7
- import de from "./_helpers/TriggerButton.js";
8
- import me from "./_helpers/OptionRow.js";
9
- import he from "./_helpers/SearchResult.js";
10
- import ue from "./_helpers/DropdownFooter.js";
11
- import { getInitialSelected as J } from "./_utils/getInitialSelected.js";
12
- import { filterOptions as ge } from "./_utils/filterOptions.js";
13
- import { mergeClasses as d } from "../../utils/mergeClasses.js";
14
- function Me({
15
- label: x,
16
- helperText: S,
17
- required: L,
18
- placeholder: Q = "Choose parameter",
19
- searchPlaceholder: W = "Search",
20
- selectAllLabel: M = "Select all",
1
+ import { jsxs as i, jsx as r, Fragment as ae } from "react/jsx-runtime";
2
+ import { useState as v, useRef as ce, useEffect as de, useMemo as ie, useCallback as u } from "react";
3
+ import { s as t } from "../../styles.module-yIHBMSTk.js";
4
+ import { Search as ue } from "../Search/index.js";
5
+ import { S as me } from "../../info-icon-ooYw3va_.js";
6
+ import { CKCheckbox as he } from "../CKCheckbox/index.js";
7
+ import ge from "./_helpers/TriggerButton.js";
8
+ import fe from "./_helpers/OptionRow.js";
9
+ import pe from "./_helpers/SearchResult.js";
10
+ import ve from "./_helpers/DropdownFooter.js";
11
+ import { getInitialSelected as W } from "./_utils/getInitialSelected.js";
12
+ import { filterOptions as Ce } from "./_utils/filterOptions.js";
13
+ import { useDropdownDirection as we } from "./_utils/useDropdownDirection.js";
14
+ import { mergeClasses as m } from "../../utils/mergeClasses.js";
15
+ function je({
16
+ label: T,
17
+ helperText: b,
18
+ required: q,
19
+ placeholder: x = "Choose parameter",
20
+ searchPlaceholder: B = "Search",
21
+ selectAllLabel: j = "Select all",
21
22
  options: s,
22
- defaultSelected: A = [],
23
- onApply: T,
24
- exclude: b,
25
- setExclude: q,
26
- onSelect: D,
27
- onClear: E,
28
- classNames: m = {},
29
- showExcludeBtn: B,
30
- width: K = ""
23
+ defaultSelected: F = [],
24
+ onApply: k,
25
+ exclude: C,
26
+ setExclude: K,
27
+ onSelect: I,
28
+ onClear: J,
29
+ classNames: h = {},
30
+ showExcludeBtn: P,
31
+ width: $ = "",
32
+ maxChips: N = 1
31
33
  }) {
32
- const { labelWrapperClass: P, helperClass: G } = m, [w, p] = u(!1), [C, v] = u(""), [n, I] = u(
33
- () => J(A)
34
- ), [a, g] = u(
35
- () => J(A)
36
- ), [H, f] = u(!1), [U, o] = u(!1), k = re(null);
37
- ne(() => {
34
+ const { labelWrapperClass: G, helperClass: H } = h, [y, O] = v(!1), [R, D] = v(""), [n, L] = v(
35
+ () => W(F)
36
+ ), [o, g] = v(
37
+ () => W(F)
38
+ ), [U, f] = v(!1), [V, c] = v(!1), M = ce(null), { vertical: z, horizontal: X } = we(M, y);
39
+ de(() => {
38
40
  const e = (l) => {
39
- k.current && !k.current.contains(l.target) && (g(n), f(n?.length === s?.length), p(!1), o(!1), v(""));
41
+ M.current && !M.current.contains(l.target) && (g(n), f(n?.length === s?.length), O(!1), c(!1), D(""));
40
42
  };
41
43
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
42
44
  }, [n, s.length]);
43
- const y = ae(
44
- () => ge(s, C),
45
- [s, C]
46
- ), j = 2, z = i(
47
- (e, l, h, se) => {
48
- h || o(!1);
49
- const F = (N) => {
50
- const O = N?.some((R) => R?.value === e) ? N?.filter((R) => R?.value !== e) : [...N, { value: e, label: l }];
51
- return f(O?.length === s?.length), O?.length <= j && o(!1), O;
45
+ const A = ie(
46
+ () => Ce(s, R),
47
+ [s, R]
48
+ ), Q = u(
49
+ (e, l, p, ne) => {
50
+ p || c(!1);
51
+ const oe = (E) => {
52
+ const a = E?.some((w) => w?.value === e) ? E?.filter((w) => w?.value !== e) : [...E, { value: e, label: l }];
53
+ return f(a?.length === s?.length), a?.length <= N && c(!1), a;
52
54
  };
53
- se && I(F), g(F), D?.();
55
+ if (ne) {
56
+ const a = ((d) => d?.some((S) => S?.value === e) ? d?.filter((S) => S?.value !== e) : [...d, { value: e, label: l }])(n), w = s?.filter((d) => a?.some((S) => S?.value === d?.value))?.map((d) => ({ ...d, isChecked: !0 }));
57
+ f(a?.length === s?.length), a?.length <= N && c(!1), L(a), g(a), k(w, C), I?.();
58
+ return;
59
+ }
60
+ g(oe), I?.();
54
61
  },
55
- [s.length, D]
56
- ), V = i(() => {
57
- o(!1), f((e) => {
62
+ [s, I, k, C, n, N]
63
+ ), Y = u(() => {
64
+ c(!1), f((e) => {
58
65
  const l = !e;
59
66
  return g(
60
- l ? s?.map((h) => ({ value: h?.value, label: h?.label })) : []
67
+ l ? s?.map((p) => ({ value: p?.value, label: p?.label })) : []
61
68
  ), l;
62
69
  });
63
- }, [s]), X = i(() => {
64
- g([]), f(!1), E?.();
65
- }, [E]), Y = i(() => {
66
- const e = s?.filter((l) => a?.some((h) => h?.value === l?.value))?.map((l) => ({ ...l, isChecked: !0 }));
67
- T(e, b), I(a), p(!1);
68
- }, [s, a, b, T]), Z = i(() => {
69
- g(n), f(n?.length === s?.length), o(!1), p(!1), v("");
70
- }, [n, s.length]), _ = i(() => {
71
- p((e) => !e), o(!1);
72
- }, []), $ = i((e) => {
73
- e.stopPropagation(), o((l) => !l);
74
- }, []), ee = JSON.stringify(a) === JSON.stringify(n), le = w ? a : n;
75
- return /* @__PURE__ */ c("div", { className: r["ckds-wrapper"], style: { width: K }, children: [
76
- x && /* @__PURE__ */ c(
70
+ }, [s]), Z = u(() => {
71
+ g([]), f(!1), J?.();
72
+ }, [J]), _ = u(() => {
73
+ const e = s?.filter((l) => o?.some((p) => p?.value === l?.value))?.map((l) => ({ ...l, isChecked: !0 }));
74
+ k(e, C), L(o), O(!1);
75
+ }, [s, o, C, k]), ee = u(() => {
76
+ g(n), f(n?.length === s?.length), c(!1), O(!1), D("");
77
+ }, [n, s.length]), le = u(() => {
78
+ O((e) => !e), c(!1);
79
+ }, []), te = u((e) => {
80
+ e.stopPropagation(), c((l) => !l);
81
+ }, []), se = JSON.stringify(o) === JSON.stringify(n), re = y ? o : n;
82
+ return /* @__PURE__ */ i("div", { className: t["ckds-wrapper"], style: { width: $ }, children: [
83
+ T && /* @__PURE__ */ i(
77
84
  "span",
78
85
  {
79
- className: d(
86
+ className: m(
80
87
  "ckds-body-xs-med",
81
- r["label-wrapper"],
82
- P ?? ""
88
+ t["label-wrapper"],
89
+ G ?? ""
83
90
  ),
84
91
  children: [
85
- x,
86
- L && /* @__PURE__ */ t("span", { className: r.required, children: " *" })
92
+ T,
93
+ q && /* @__PURE__ */ r("span", { className: t.required, children: " *" })
87
94
  ]
88
95
  }
89
96
  ),
90
- /* @__PURE__ */ c("div", { className: r["trigger-wrapper"], ref: k, children: [
91
- /* @__PURE__ */ t(
92
- de,
97
+ /* @__PURE__ */ i("div", { className: t["trigger-wrapper"], ref: M, children: [
98
+ /* @__PURE__ */ r(
99
+ ge,
93
100
  {
94
- open: w,
95
- selected: le,
96
- placeholder: Q,
97
- showMenu: U,
101
+ open: y,
102
+ selected: re,
103
+ placeholder: x,
104
+ showMenu: V,
98
105
  isAllSelected: !1,
99
- selectAllLabel: M,
100
- onToggleOpen: _,
101
- onToggleMenu: $,
102
- onRemove: z,
103
- classNames: m,
104
- maxChips: j
106
+ selectAllLabel: j,
107
+ onToggleOpen: le,
108
+ onToggleMenu: te,
109
+ onRemove: Q,
110
+ classNames: h,
111
+ maxChips: N
105
112
  }
106
113
  ),
107
- S && /* @__PURE__ */ t(
114
+ b && /* @__PURE__ */ r(
108
115
  "div",
109
116
  {
110
- className: d(
117
+ className: m(
111
118
  "ckds-body-xs-reg",
112
- r["helper-text"],
113
- G ?? ""
119
+ t["helper-text"],
120
+ H ?? ""
114
121
  ),
115
- children: /* @__PURE__ */ c(te, { children: [
116
- /* @__PURE__ */ t(ce, { width: "12", height: "12" }),
122
+ children: /* @__PURE__ */ i(ae, { children: [
123
+ /* @__PURE__ */ r(me, { width: "12", height: "12" }),
117
124
  " ",
118
- S
125
+ b
119
126
  ] })
120
127
  }
121
128
  ),
122
- w && /* @__PURE__ */ c("div", { className: d(r.dropdown, S ? r["dropdown-helper"] : ""), children: [
123
- /* @__PURE__ */ t(
124
- oe,
129
+ y && /* @__PURE__ */ i("div", { className: m(
130
+ t.dropdown,
131
+ t[`dropdown-align-${X}`],
132
+ z === "up" ? t["dropdown-up"] : "",
133
+ b && z === "down" ? t["dropdown-helper"] : "",
134
+ b && z === "up" ? t["dropdown-helper-up"] : ""
135
+ ), children: [
136
+ /* @__PURE__ */ r(
137
+ ue,
125
138
  {
126
139
  size: "medium",
127
- value: C,
128
- placeholder: W,
129
- onChange: v,
130
- onClear: () => v(""),
140
+ value: R,
141
+ placeholder: B,
142
+ onChange: D,
143
+ onClear: () => D(""),
131
144
  wrapperClassName: "",
132
145
  inputClassName: ""
133
146
  }
134
147
  ),
135
- /* @__PURE__ */ t(
136
- he,
148
+ /* @__PURE__ */ r(
149
+ pe,
137
150
  {
138
- totalResults: y?.length,
139
- exclude: b,
140
- setExclude: q,
141
- isToggleDisable: a?.length === 0,
142
- showExcludeBtn: B,
143
- hideExclude: !1
151
+ totalResults: A?.length,
152
+ exclude: C,
153
+ setExclude: K,
154
+ isToggleDisable: o?.length === 0,
155
+ showExcludeBtn: P,
156
+ hideExclude: !1,
157
+ selectedCount: o?.length
144
158
  }
145
159
  ),
146
- /* @__PURE__ */ t("div", { className: r.divider }),
147
- /* @__PURE__ */ c(
160
+ /* @__PURE__ */ r("div", { className: t.divider }),
161
+ /* @__PURE__ */ i(
148
162
  "div",
149
163
  {
150
- className: d(
151
- r["ckds-options-list"],
152
- m?.optionsListWrapperClass ?? ""
164
+ className: m(
165
+ t["ckds-options-list"],
166
+ h?.optionsListWrapperClass ?? ""
153
167
  ),
154
168
  children: [
155
- C.length === 0 && /* @__PURE__ */ c(
169
+ R.length === 0 && /* @__PURE__ */ i(
156
170
  "div",
157
171
  {
158
- className: d(
159
- r["option-row"],
160
- m?.optionRowClass ?? ""
172
+ className: m(
173
+ t["option-row"],
174
+ h?.optionRowClass ?? ""
161
175
  ),
162
- onClick: V,
176
+ onClick: Y,
163
177
  children: [
164
- /* @__PURE__ */ t(ie, { checked: H, size: "md" }),
165
- /* @__PURE__ */ t(
178
+ /* @__PURE__ */ r(he, { checked: U, size: "md" }),
179
+ /* @__PURE__ */ r(
166
180
  "span",
167
181
  {
168
- className: d(
182
+ className: m(
169
183
  "ckds-body-sm-reg",
170
- r["option-label"]
184
+ t["option-label"]
171
185
  ),
172
- children: M
186
+ children: j
173
187
  }
174
188
  )
175
189
  ]
176
190
  }
177
191
  ),
178
- y?.length === 0 ? /* @__PURE__ */ t(
192
+ A?.length === 0 ? /* @__PURE__ */ r(
179
193
  "span",
180
194
  {
181
- className: d(
195
+ className: m(
182
196
  "ckds-body-sm-reg",
183
- r["no-results"]
197
+ t["no-results"]
184
198
  ),
185
199
  children: "No results found"
186
200
  }
187
- ) : y?.map((e) => /* @__PURE__ */ t(
188
- me,
201
+ ) : A?.map((e) => /* @__PURE__ */ r(
202
+ fe,
189
203
  {
190
204
  value: e?.value,
191
205
  label: e?.label,
192
- checked: a?.some(
206
+ checked: o?.some(
193
207
  (l) => l?.value === e?.value
194
208
  ),
195
- onToggle: z,
196
- classNames: m
209
+ onToggle: Q,
210
+ classNames: h
197
211
  },
198
212
  e?.value
199
213
  ))
200
214
  ]
201
215
  }
202
216
  ),
203
- /* @__PURE__ */ t(
204
- ue,
217
+ /* @__PURE__ */ r(
218
+ ve,
205
219
  {
206
- onClear: X,
207
- onCancel: Z,
208
- onApply: Y,
209
- classNames: m,
210
- isClearDisabled: a?.length === 0,
211
- isApplyDisabled: ee,
220
+ onClear: Z,
221
+ onCancel: ee,
222
+ onApply: _,
223
+ classNames: h,
224
+ isClearDisabled: o?.length === 0,
225
+ isApplyDisabled: se,
212
226
  hideClear: !1
213
227
  }
214
228
  )
@@ -217,5 +231,5 @@ function Me({
217
231
  ] });
218
232
  }
219
233
  export {
220
- Me as SimpleMultiSelect
234
+ je as SimpleMultiSelect
221
235
  };
@@ -1,5 +1,5 @@
1
1
  import { jsxs as t, jsx as s } from "react/jsx-runtime";
2
- import { s as l } from "../../../styles.module-Dojg5FTS.js";
2
+ import { s as l } from "../../../styles.module-yIHBMSTk.js";
3
3
  import { CKButton as r } from "../../CKButton/index.js";
4
4
  import { mergeClasses as e } from "../../../utils/mergeClasses.js";
5
5
  const y = ({
@@ -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-Dojg5FTS.js";
3
+ import { s as m } from "../../../styles.module-yIHBMSTk.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 { jsx as r } from "react/jsx-runtime";
2
- import { s } from "../../../styles.module-Dojg5FTS.js";
2
+ import { s } from "../../../styles.module-yIHBMSTk.js";
3
3
  import o from "./OverflowMenuItem.js";
4
4
  const a = ({ selected: m, maxChips: t = 2 }) => /* @__PURE__ */ r("div", { className: s["menu-list"], children: m?.map((e, l) => l < t ? null : /* @__PURE__ */ r(o, { item: e }, e?.value)) });
5
5
  export {
@@ -1,5 +1,5 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { s as i } from "../../../styles.module-Dojg5FTS.js";
2
+ import { s as i } from "../../../styles.module-yIHBMSTk.js";
3
3
  import { Tooltip as f } from "../../Tooltip/index.js";
4
4
  import { useRef as a, useState as d, useLayoutEffect as u } from "react";
5
5
  import { mergeClasses as p } from "../../../utils/mergeClasses.js";
@@ -1,4 +1,4 @@
1
1
  import { ResultProps } from '../_types/type';
2
- declare const SearchResult: ({ totalResults, exclude, setExclude, isToggleDisable, showExcludeBtn, hideExclude, }: ResultProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const SearchResult: ({ totalResults, exclude, setExclude, isToggleDisable, showExcludeBtn, hideExclude, selectedCount, }: ResultProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default SearchResult;
4
4
  //# sourceMappingURL=SearchResult.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SearchResult.d.ts","sourceRoot":"","sources":["../../../../lib/components/MultiSelect/_helpers/SearchResult.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,QAAA,MAAM,YAAY,GAAI,sFAOnB,WAAW,4CAmBb,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"SearchResult.d.ts","sourceRoot":"","sources":["../../../../lib/components/MultiSelect/_helpers/SearchResult.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,QAAA,MAAM,YAAY,GAAI,qGAQnB,WAAW,4CA6Bb,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,33 +1,43 @@
1
- import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
- import { s as e } from "../../../styles.module-Dojg5FTS.js";
3
- import { Toggle as p } from "../../Toggle/index.js";
4
- import { mergeClasses as a } from "../../../utils/mergeClasses.js";
5
- const g = ({
6
- totalResults: l,
7
- exclude: c,
8
- setExclude: d,
1
+ import { jsxs as s, Fragment as t, jsx as a } from "react/jsx-runtime";
2
+ import { s as e } from "../../../styles.module-yIHBMSTk.js";
3
+ import { Toggle as o } from "../../Toggle/index.js";
4
+ import { mergeClasses as r } from "../../../utils/mergeClasses.js";
5
+ const f = ({
6
+ totalResults: c,
7
+ exclude: d,
8
+ setExclude: i,
9
9
  isToggleDisable: m,
10
- showExcludeBtn: o,
11
- hideExclude: i
10
+ showExcludeBtn: p,
11
+ hideExclude: n,
12
+ selectedCount: l
12
13
  }) => /* @__PURE__ */ s("div", { className: e["result-wrapper"], children: [
13
- /* @__PURE__ */ s("span", { className: a("ckds-cap-reg", e["result-count"]), children: [
14
- l,
15
- " ",
16
- l === 1 ? "Result" : "Results"
14
+ /* @__PURE__ */ s("div", { className: e["result-left"], children: [
15
+ /* @__PURE__ */ s("span", { className: r("ckds-cap-reg", e["result-count"]), children: [
16
+ c,
17
+ " ",
18
+ c === 1 ? "Result" : "Results"
19
+ ] }),
20
+ l !== void 0 && l > 0 && /* @__PURE__ */ s(t, { children: [
21
+ /* @__PURE__ */ a("span", { className: e["result-pipe"] }),
22
+ /* @__PURE__ */ s("span", { className: r("ckds-cap-reg", e["result-selected"]), children: [
23
+ l,
24
+ " Selected"
25
+ ] })
26
+ ] })
17
27
  ] }),
18
- o && !i && /* @__PURE__ */ s("div", { className: e["exclude-row"], children: [
19
- /* @__PURE__ */ r("span", { className: a("ckds-cap-reg", e["exclude-label"]), children: "Exclude" }),
20
- /* @__PURE__ */ r(
21
- p,
28
+ p && !n && /* @__PURE__ */ s("div", { className: e["exclude-row"], children: [
29
+ /* @__PURE__ */ a("span", { className: r("ckds-cap-reg", e["exclude-label"]), children: "Exclude" }),
30
+ /* @__PURE__ */ a(
31
+ o,
22
32
  {
23
33
  size: "small",
24
- checked: c,
25
- onChange: d,
34
+ checked: d,
35
+ onChange: i,
26
36
  disabled: m
27
37
  }
28
38
  )
29
39
  ] })
30
40
  ] });
31
41
  export {
32
- g as default
42
+ f as default
33
43
  };
@@ -1,7 +1,7 @@
1
1
  import { jsxs as h, jsx as o } from "react/jsx-runtime";
2
2
  import v, { useRef as g, useState as w, useLayoutEffect as C, useCallback as l } from "react";
3
3
  import { S as O } from "../../../cancel-BAgTEOGD.js";
4
- import { s } from "../../../styles.module-Dojg5FTS.js";
4
+ import { s } from "../../../styles.module-yIHBMSTk.js";
5
5
  import { Tooltip as R } from "../../Tooltip/index.js";
6
6
  const j = v.memo(function({
7
7
  label: t,
@@ -1 +1 @@
1
- {"version":3,"file":"TriggerButton.d.ts","sourceRoot":"","sources":["../../../../lib/components/MultiSelect/_helpers/TriggerButton.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAIzD,QAAA,MAAM,aAAa,GAAI,yJAapB,kBAAkB,4CA6DpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"TriggerButton.d.ts","sourceRoot":"","sources":["../../../../lib/components/MultiSelect/_helpers/TriggerButton.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAKzD,QAAA,MAAM,aAAa,GAAI,yJAapB,kBAAkB,4CAuFpB,CAAC;AAEF,eAAe,aAAa,CAAC"}