@caspeco/casper-ui-library 6.0.0 → 7.0.0

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 (74) hide show
  1. package/dist/components/alert/alert.js +25 -25
  2. package/dist/components/button/types.d.ts +1 -1
  3. package/dist/components/button/types.d.ts.map +1 -1
  4. package/dist/components/combobox/combobox-button.d.ts.map +1 -1
  5. package/dist/components/combobox/combobox-button.js +57 -57
  6. package/dist/components/combobox/combobox-menu.d.ts.map +1 -1
  7. package/dist/components/combobox/combobox-menu.js +58 -56
  8. package/dist/components/combobox/combobox.d.ts.map +1 -1
  9. package/dist/components/combobox/combobox.js +34 -34
  10. package/dist/components/combobox/types.d.ts +2 -2
  11. package/dist/components/combobox/types.d.ts.map +1 -1
  12. package/dist/components/date-picker/base-date-picker.d.ts.map +1 -1
  13. package/dist/components/date-picker/base-date-picker.js +129 -129
  14. package/dist/components/date-picker/types.d.ts +3 -2
  15. package/dist/components/date-picker/types.d.ts.map +1 -1
  16. package/dist/components/drawer/use-drawer-key-down.js +8 -6
  17. package/dist/components/icon/icon.d.ts.map +1 -1
  18. package/dist/components/icon/icon.js +13 -12
  19. package/dist/components/icon-button/icon-button.d.ts +1 -1
  20. package/dist/components/icon-button/types.d.ts +3 -2
  21. package/dist/components/icon-button/types.d.ts.map +1 -1
  22. package/dist/components/image-upload/image-cropper.d.ts.map +1 -1
  23. package/dist/components/image-upload/image-upload-dropzone.d.ts.map +1 -1
  24. package/dist/components/image-upload/image-upload-dropzone.js +24 -24
  25. package/dist/components/image-upload/image-upload-modal.d.ts.map +1 -1
  26. package/dist/components/image-upload/image-upload-modal.js +61 -58
  27. package/dist/components/menu/menu-item.d.ts +2 -1
  28. package/dist/components/menu/menu-item.d.ts.map +1 -1
  29. package/dist/components/menu/menu.composition.d.ts.map +1 -1
  30. package/dist/components/modal/modal-footer.d.ts.map +1 -1
  31. package/dist/components/modal/modal-footer.js +16 -13
  32. package/dist/components/table/index.d.ts +1 -0
  33. package/dist/components/table/index.d.ts.map +1 -1
  34. package/dist/components/table/table-cell.js +18 -18
  35. package/dist/components/table/table-content.d.ts.map +1 -1
  36. package/dist/components/table/table-content.js +21 -19
  37. package/dist/components/table/table-context-provider.d.ts +8 -4
  38. package/dist/components/table/table-context-provider.d.ts.map +1 -1
  39. package/dist/components/table/table-context-provider.js +96 -94
  40. package/dist/components/table/table-filter.d.ts +27 -0
  41. package/dist/components/table/table-filter.d.ts.map +1 -0
  42. package/dist/components/table/table-filter.js +140 -0
  43. package/dist/components/table/table-filter.spec.d.ts +2 -0
  44. package/dist/components/table/table-filter.spec.d.ts.map +1 -0
  45. package/dist/components/table/table-header-dropdown.d.ts +1 -1
  46. package/dist/components/table/table-header-dropdown.d.ts.map +1 -1
  47. package/dist/components/table/table-header-dropdown.js +71 -59
  48. package/dist/components/table/table-row.js +40 -40
  49. package/dist/components/table/table-toolbar.d.ts.map +1 -1
  50. package/dist/components/table/table-toolbar.js +111 -81
  51. package/dist/components/table/table.composition.d.ts +1 -1
  52. package/dist/components/table/table.composition.d.ts.map +1 -1
  53. package/dist/components/table/table.d.ts +1 -1
  54. package/dist/components/table/table.d.ts.map +1 -1
  55. package/dist/components/table/table.js +22 -24
  56. package/dist/components/table/translations.d.ts +10 -0
  57. package/dist/components/table/translations.d.ts.map +1 -1
  58. package/dist/components/table/translations.js +17 -9
  59. package/dist/components/table/types.d.ts +1 -5
  60. package/dist/components/table/types.d.ts.map +1 -1
  61. package/dist/components/tabs/tabs.composition.d.ts +1 -1
  62. package/dist/index.js +168 -165
  63. package/dist/theme/index.d.ts +2 -1
  64. package/dist/theme/index.d.ts.map +1 -1
  65. package/dist/theme/theme-config/components/button-theme.d.ts.map +1 -1
  66. package/dist/theme/theme-config/components/button-theme.js +35 -20
  67. package/dist/theme/theme-context.d.ts +10 -0
  68. package/dist/theme/theme-context.d.ts.map +1 -0
  69. package/dist/theme/theme-context.js +11 -0
  70. package/dist/theme/theme-provider-context.composition.d.ts.map +1 -1
  71. package/dist/theme/theme-provider.d.ts +0 -8
  72. package/dist/theme/theme-provider.d.ts.map +1 -1
  73. package/dist/theme/theme-provider.js +21 -27
  74. package/package.json +16 -11
@@ -1,23 +1,24 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { createIcon as d } from "@chakra-ui/react";
3
- import { Icons as i } from "./types.js";
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { createIcon as m } from "@chakra-ui/react";
3
+ import { Icons as d } from "./types.js";
4
4
  import { ThemeIconSizeVariable as p } from "../../theme/theme-types.js";
5
- function f(e, o) {
6
- return Object.keys(i).find((n) => o[n] === e) ?? "";
5
+ function s(o) {
6
+ const [e] = Object.entries(d).find(([, n]) => n === o) ?? [];
7
+ return e ?? "";
7
8
  }
8
- const I = ({ icon: e, size: o = p.Medium, ...n }) => {
9
- const r = f(e, i), t = {
10
- width: o,
11
- height: o
9
+ const I = ({ icon: o, size: e = p.Medium, ...n }) => {
10
+ const r = s(o), t = {
11
+ width: e,
12
+ height: e
12
13
  };
13
14
  r === "Caspeco" && (t.fillRule = "evenodd", t.clipRule = "evenodd");
14
- const c = d({
15
+ const c = m({
15
16
  displayName: r,
16
17
  viewBox: "0 0 20 20",
17
- d: e,
18
+ d: o,
18
19
  defaultProps: t
19
20
  });
20
- return /* @__PURE__ */ m(c, { ...n });
21
+ return /* @__PURE__ */ i(c, { ...n });
21
22
  };
22
23
  export {
23
24
  I as Icon
@@ -7,7 +7,7 @@
7
7
  */
8
8
  export declare const IconButton: import('react').ForwardRefExoticComponent<{
9
9
  icon: import('../icon/index.js').Icons;
10
- variant?: "primary" | "secondary" | "ghost" | "tertiary";
10
+ variant?: Exclude<import('../button/index.js').ButtonProps["variant"], "link" | "segmentedControl" | import('@chakra-ui/styled-system').ResponsiveArray<unknown> | Partial<Record<string, unknown>>>;
11
11
  size?: import('@chakra-ui/styled-system').ResponsiveValue<"lg" | "sm" | "md">;
12
12
  } & {
13
13
  "aria-label": string;
@@ -1,6 +1,7 @@
1
1
  import { Icons } from '../icon/index.js';
2
2
  import { CustomChakraBoxProps, MarginProps, PaddingProps } from '../../theme/index.js';
3
- import { IconButtonProps as ChakraIconButtonProps, ResponsiveValue } from '@chakra-ui/react';
3
+ import { IconButtonProps as ChakraIconButtonProps, ResponsiveArray, ResponsiveValue } from '@chakra-ui/react';
4
+ import { ButtonProps } from '../button/index.js';
4
5
  type CustomStyleProps = CustomChakraBoxProps & MarginProps & PaddingProps;
5
6
  type CustomProperties = {
6
7
  /**
@@ -10,7 +11,7 @@ type CustomProperties = {
10
11
  /**
11
12
  * Appearance variant for Button.
12
13
  */
13
- variant?: "primary" | "secondary" | "ghost" | "tertiary";
14
+ variant?: Exclude<ButtonProps["variant"], "link" | "segmentedControl" | ResponsiveArray<unknown> | Partial<Record<string, unknown>>>;
14
15
  /**
15
16
  * The size of the button, defaults to md
16
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/icon-button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC/E,OAAO,KAAK,EAAE,eAAe,IAAI,qBAAqB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAElG,KAAK,gBAAgB,GAAG,oBAAoB,GAAG,WAAW,GAAG,YAAY,CAAC;AAE1E,KAAK,gBAAgB,GAAG;IACvB;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC;IACZ;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,UAAU,CAAC;IACzD;;OAEG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;CAC3C,CAAC;AAEF,KAAK,0BAA0B,GAAG,IAAI,CACrC,qBAAqB,EACrB,YAAY,GAAG,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,GAAG,WAAW,CAC5E,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,0BAA0B,GAAG,gBAAgB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/icon-button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC/E,OAAO,KAAK,EACX,eAAe,IAAI,qBAAqB,EACxC,eAAe,EACf,eAAe,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,KAAK,gBAAgB,GAAG,oBAAoB,GAAG,WAAW,GAAG,YAAY,CAAC;AAE1E,KAAK,gBAAgB,GAAG;IACvB;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC;IACZ;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAChB,WAAW,CAAC,SAAS,CAAC,EACtB,MAAM,GAAG,kBAAkB,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CACzF,CAAC;IACF;;OAEG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;CAC3C,CAAC;AAEF,KAAK,0BAA0B,GAAG,IAAI,CACrC,qBAAqB,EACrB,YAAY,GAAG,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,GAAG,WAAW,CAC5E,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,0BAA0B,GAAG,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"image-cropper.d.ts","sourceRoot":"","sources":["../../../lib/components/image-upload/image-cropper.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAqB,KAAK,IAAI,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAE/E,UAAU,iBAAiB;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,cAAc,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACrC,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,WAAW,EAAE,sBAAsB,CAAC;CACpC;AAED,wBAAgB,YAAY,CAAC,EAC5B,GAAG,EACH,IAAI,EAAE,WAAW,EACjB,cAAc,EACd,eAAe,EACf,WAAW,GACX,EAAE,iBAAiB,2CA2fnB"}
1
+ {"version":3,"file":"image-cropper.d.ts","sourceRoot":"","sources":["../../../lib/components/image-upload/image-cropper.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAqB,KAAK,IAAI,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAE/E,UAAU,iBAAiB;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,cAAc,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACrC,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,WAAW,EAAE,sBAAsB,CAAC;CACpC;AAED,wBAAgB,YAAY,CAAC,EAC5B,GAAG,EACH,IAAI,EAAE,WAAW,EACjB,cAAc,EACd,eAAe,EACf,WAAW,GACX,EAAE,iBAAiB,2CA+fnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"image-upload-dropzone.d.ts","sourceRoot":"","sources":["../../../lib/components/image-upload/image-upload-dropzone.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,UAAU,cAAc;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC1C,kBAAkB,EAAE,CAAC,eAAe,EAAE,OAAO,KAAK,IAAI,CAAC;CACvD;AAED,MAAM,MAAM,QAAQ,GAAG;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,iBAAS,QAAQ,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,kBAAkB,EAAE,EAAE,cAAc,2CA0H5E;AAED,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"image-upload-dropzone.d.ts","sourceRoot":"","sources":["../../../lib/components/image-upload/image-upload-dropzone.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,UAAU,cAAc;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC1C,kBAAkB,EAAE,CAAC,eAAe,EAAE,OAAO,KAAK,IAAI,CAAC;CACvD;AAED,MAAM,MAAM,QAAQ,GAAG;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,iBAAS,QAAQ,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,kBAAkB,EAAE,EAAE,cAAc,2CA4H5E;AAED,eAAe,QAAQ,CAAC"}
@@ -1,4 +1,4 @@
1
- import { jsxs as l, Fragment as E, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as l, Fragment as E, jsx as a } from "react/jsx-runtime";
2
2
  import { Box as u, Text as g, Input as U } from "@chakra-ui/react";
3
3
  import k, { useState as f } from "react";
4
4
  import { sanitizeFilename as B } from "./image-upload-helper.js";
@@ -6,16 +6,16 @@ import { ImageIconLarge as L } from "./image-upload-icons.js";
6
6
  import { translations as o } from "./translations.js";
7
7
  import { Alert as h } from "../alert/alert.js";
8
8
  import { ThemeRadiusVariable as V, ThemeColorVariable as d, ThemeSpaceVariable as x } from "../../theme/theme-types.js";
9
- function Q({ locale: i, setFileItem: D, setHasImageChanged: b }) {
10
- const [F, s] = f(!1), [T, c] = f(!1), [y, m] = f(!1), a = k.createRef();
11
- function R(e, t) {
12
- const r = new FileReader();
13
- r.onload = t, r.readAsDataURL(e);
9
+ function P({ locale: i, setFileItem: D, setHasImageChanged: b }) {
10
+ const [F, s] = f(!1), [T, c] = f(!1), [y, m] = f(!1), t = k.createRef();
11
+ function R(e, r) {
12
+ const n = new FileReader();
13
+ n.onload = r, n.readAsDataURL(e);
14
14
  }
15
- const z = ["image/jpeg", "image/png", "image/webp", "image/gif", "image/svg+xml"], p = (e) => {
16
- const t = e.target;
17
- if (!t || !t.files) return;
18
- const r = t.files[0];
15
+ const z = ["image/jpeg", "image/png", "image/webp", "image/gif", "image/svg+xml"], p = ({ target: e }) => {
16
+ if (!e || !e.files || !e.files[0])
17
+ return;
18
+ const r = e.files[0];
19
19
  if (!z.includes(r.type)) {
20
20
  m(!0);
21
21
  return;
@@ -25,18 +25,18 @@ function Q({ locale: i, setFileItem: D, setHasImageChanged: b }) {
25
25
  D(j), b(!0);
26
26
  }));
27
27
  }, C = () => {
28
- a.current && a.current.click();
28
+ t.current && t.current.click();
29
29
  }, I = (e) => {
30
30
  e.preventDefault(), e.dataTransfer.items && e.dataTransfer.items.length > 0 && s(!0);
31
31
  }, w = () => {
32
32
  s(!1);
33
33
  }, A = (e) => {
34
- if (e.preventDefault(), !!a.current && e.dataTransfer.files && e.dataTransfer.files.length > 0) {
35
- const t = new DataTransfer();
36
- Array.from(e.dataTransfer.files).forEach((r) => {
37
- t.items.add(r);
38
- }), a.current.files = t.files, p({
39
- target: a.current
34
+ if (e.preventDefault(), !!t.current && e.dataTransfer.files && e.dataTransfer.files.length > 0) {
35
+ const r = new DataTransfer();
36
+ Array.from(e.dataTransfer.files).forEach((n) => {
37
+ r.items.add(n);
38
+ }), t.current.files = r.files, p({
39
+ target: t.current
40
40
  }), e.dataTransfer.clearData(), s(!1);
41
41
  }
42
42
  };
@@ -60,22 +60,22 @@ function Q({ locale: i, setFileItem: D, setHasImageChanged: b }) {
60
60
  onClick: C,
61
61
  cursor: "pointer",
62
62
  children: [
63
- /* @__PURE__ */ n(L, {}),
64
- /* @__PURE__ */ n(g, { children: o[i].pullAndDrop }),
63
+ /* @__PURE__ */ a(L, {}),
64
+ /* @__PURE__ */ a(g, { children: o[i].pullAndDrop }),
65
65
  /* @__PURE__ */ l(g, { children: [
66
66
  "eller",
67
67
  " ",
68
- /* @__PURE__ */ n(u, { as: "span", color: d.Accent, textDecoration: "underline", children: o[i].upload }),
68
+ /* @__PURE__ */ a(u, { as: "span", color: d.Accent, textDecoration: "underline", children: o[i].upload }),
69
69
  "."
70
70
  ] }),
71
- /* @__PURE__ */ n(U, { type: "file", ref: a, display: "none", onChange: p })
71
+ /* @__PURE__ */ a(U, { type: "file", ref: t, display: "none", onChange: p })
72
72
  ]
73
73
  }
74
74
  ),
75
- y && /* @__PURE__ */ n(h, { mt: x.Medium, type: "error", children: o[i].unsupportedFormat }),
76
- T && /* @__PURE__ */ n(h, { mt: x.Medium, type: "error", children: o[i].sizeExceeded })
75
+ y && /* @__PURE__ */ a(h, { mt: x.Medium, type: "error", children: o[i].unsupportedFormat }),
76
+ T && /* @__PURE__ */ a(h, { mt: x.Medium, type: "error", children: o[i].sizeExceeded })
77
77
  ] });
78
78
  }
79
79
  export {
80
- Q as default
80
+ P as default
81
81
  };
@@ -1 +1 @@
1
- {"version":3,"file":"image-upload-modal.d.ts","sourceRoot":"","sources":["../../../lib/components/image-upload/image-upload-modal.tsx"],"names":[],"mappings":"AAOA,OAAiB,EAAE,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAIlE,OAAO,EAAE,KAAK,IAAI,EAAE,sBAAsB,EAAE,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AAE1E,UAAU,uBAAuB;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,SAAS,EAAE,IAAI,GAAG,SAAS,CAAC;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,sBAAsB,CAAC;IACpC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,eAAe,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,eAAe,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3F,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;CACrC;AAED,wBAAgB,gBAAgB,CAAC,EAChC,KAAK,EACL,GAAG,EACH,SAAS,EACT,MAAM,EACN,WAAW,EACX,IAAI,EACJ,MAAM,EACN,OAAO,EACP,eAAe,EACf,eAAe,EACf,OAAO,GACP,EAAE,uBAAuB,2CA8GzB"}
1
+ {"version":3,"file":"image-upload-modal.d.ts","sourceRoot":"","sources":["../../../lib/components/image-upload/image-upload-modal.tsx"],"names":[],"mappings":"AAOA,OAAiB,EAAE,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAIlE,OAAO,EAAE,KAAK,IAAI,EAAE,sBAAsB,EAAE,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AAE1E,UAAU,uBAAuB;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,SAAS,EAAE,IAAI,GAAG,SAAS,CAAC;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,sBAAsB,CAAC;IACpC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,eAAe,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,eAAe,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3F,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;CACrC;AAED,wBAAgB,gBAAgB,CAAC,EAChC,KAAK,EACL,GAAG,EACH,SAAS,EACT,MAAM,EACN,WAAW,EACX,IAAI,EACJ,MAAM,EACN,OAAO,EACP,eAAe,EACf,eAAe,EACf,OAAO,GACP,EAAE,uBAAuB,2CAqHzB"}
@@ -1,62 +1,65 @@
1
1
  import { jsxs as t, jsx as e, Fragment as D } from "react/jsx-runtime";
2
2
  import { ButtonGroup as H } from "@chakra-ui/react";
3
- import { useState as u, useEffect as L } from "react";
4
- import { ImageCropper as R } from "./image-cropper.js";
5
- import V from "./image-upload-dropzone.js";
6
- import { sanitizeFilename as j } from "./image-upload-helper.js";
7
- import { RemoveIcon as O } from "./image-upload-icons.js";
8
- import { translations as f } from "./translations.js";
9
- import { Modal as $ } from "../modal/modal.js";
10
- import { ModalHeader as w } from "../modal/modal-header.js";
11
- import { Text as U } from "../text/text.js";
12
- import { ModalCloseButton as W } from "../modal/modal-close-button.js";
13
- import { ModalBody as X } from "../modal/modal-body.js";
3
+ import { useState as u, useCallback as L, useEffect as R } from "react";
4
+ import { ImageCropper as V } from "./image-cropper.js";
5
+ import j from "./image-upload-dropzone.js";
6
+ import { sanitizeFilename as O } from "./image-upload-helper.js";
7
+ import { RemoveIcon as $ } from "./image-upload-icons.js";
8
+ import { translations as s } from "./translations.js";
9
+ import { Modal as w } from "../modal/modal.js";
10
+ import { ModalHeader as U } from "../modal/modal-header.js";
11
+ import { Text as W } from "../text/text.js";
12
+ import { ModalCloseButton as X } from "../modal/modal-close-button.js";
13
+ import { ModalBody as A } from "../modal/modal-body.js";
14
14
  import { Button as p } from "../button/button.js";
15
- import { ModalFooter as A } from "../modal/modal-footer.js";
16
- import { ThemeSpaceVariable as r, ThemeFontSizeVariable as E, ThemeFontVariable as G, ThemeColorVariable as b } from "../../theme/theme-types.js";
17
- function de({
18
- title: g,
15
+ import { ModalFooter as E } from "../modal/modal-footer.js";
16
+ import { ThemeSpaceVariable as r, ThemeFontSizeVariable as G, ThemeFontVariable as q, ThemeColorVariable as g } from "../../theme/theme-types.js";
17
+ function se({
18
+ title: b,
19
19
  src: a,
20
20
  savedCrop: C,
21
21
  isOpen: S,
22
22
  aspectRatio: x,
23
- crop: s,
24
- locale: i,
25
- onClose: M,
26
- handleSaveImage: y,
27
- setPreviewImage: n,
23
+ crop: c,
24
+ locale: n,
25
+ onClose: y,
26
+ handleSaveImage: I,
27
+ setPreviewImage: i,
28
28
  setCrop: l
29
29
  }) {
30
- const [F, I] = u(!1), [o, m] = u({
30
+ const [M, F] = u(!1), [o, m] = u({
31
31
  data: "",
32
32
  fileName: ""
33
- }), c = async () => {
34
- if (!a) return;
35
- const B = await (await fetch(a)).blob(), d = new FileReader();
36
- d.readAsDataURL(B), d.onloadend = () => {
37
- const k = d.result;
38
- m({
39
- data: k,
40
- fileName: j(a)
41
- });
42
- };
43
- };
44
- L(() => {
45
- c();
33
+ }), d = L(() => {
34
+ (async () => {
35
+ if (!a)
36
+ return;
37
+ const z = await (await fetch(a)).blob(), f = new FileReader();
38
+ f.readAsDataURL(z), f.onloadend = () => {
39
+ const B = f.result;
40
+ m({
41
+ data: B,
42
+ fileName: O(a)
43
+ });
44
+ };
45
+ })().catch(console.error);
46
46
  }, [a]);
47
+ R(() => {
48
+ d();
49
+ }, [d]);
47
50
  const T = () => {
48
- y(o, s, F);
51
+ I(o, c, M);
49
52
  }, N = (!o.data || !o.fileName) && !a, v = (!o.data || !o.fileName) && a, h = () => {
50
- m({ data: "", fileName: "" }), n(""), a && (c(), n(a)), l(C || null), M();
51
- }, z = () => {
53
+ m({ data: "", fileName: "" }), i(""), a && (d(), i(a)), l(C || null), y();
54
+ }, k = () => {
52
55
  m({
53
56
  data: "",
54
57
  fileName: ""
55
- }), n(""), l(null);
58
+ }), i(""), l(null);
56
59
  };
57
- return /* @__PURE__ */ t($, { isOpen: S, onClose: h, size: "md", children: [
60
+ return /* @__PURE__ */ t(w, { isOpen: S, onClose: h, size: "md", children: [
58
61
  /* @__PURE__ */ t(
59
- w,
62
+ U,
60
63
  {
61
64
  display: "flex",
62
65
  alignItems: "center",
@@ -64,57 +67,57 @@ function de({
64
67
  p: r.Medium,
65
68
  children: [
66
69
  /* @__PURE__ */ e(
67
- U,
70
+ W,
68
71
  {
69
- color: b.OnSurfaceHeader,
70
- fontFamily: G.SubHeader,
72
+ color: g.OnSurfaceHeader,
73
+ fontFamily: q.SubHeader,
71
74
  fontWeight: "medium",
72
- fontSize: E.XLarge,
73
- children: g
75
+ fontSize: G.XLarge,
76
+ children: b
74
77
  }
75
78
  ),
76
- /* @__PURE__ */ e(W, {})
79
+ /* @__PURE__ */ e(X, {})
77
80
  ]
78
81
  }
79
82
  ),
80
83
  /* @__PURE__ */ e(
81
- X,
84
+ A,
82
85
  {
83
86
  display: "flex",
84
87
  flexDirection: "column",
85
88
  p: `${r.Large} ${r.Medium}`,
86
89
  children: o.data && o.fileName ? /* @__PURE__ */ t(D, { children: [
87
90
  /* @__PURE__ */ e(
88
- R,
91
+ V,
89
92
  {
90
93
  src: o.data,
91
- crop: s,
94
+ crop: c,
92
95
  onCropCallback: l,
93
96
  aspectRatio: x,
94
- setPreviewImage: n
97
+ setPreviewImage: i
95
98
  }
96
99
  ),
97
- /* @__PURE__ */ e(H, { gap: r.Small, mt: r.Large, flexWrap: "wrap", children: /* @__PURE__ */ t(p, { variant: "ghost", onClick: z, gap: r.XSmall, children: [
98
- /* @__PURE__ */ e(O, {}),
100
+ /* @__PURE__ */ e(H, { gap: r.Small, mt: r.Large, flexWrap: "wrap", children: /* @__PURE__ */ t(p, { variant: "ghost", onClick: k, gap: r.XSmall, children: [
101
+ /* @__PURE__ */ e($, {}),
99
102
  "Ta bort bild"
100
103
  ] }) })
101
- ] }) : /* @__PURE__ */ e(V, { locale: i, setFileItem: m, setHasImageChanged: I })
104
+ ] }) : /* @__PURE__ */ e(j, { locale: n, setFileItem: m, setHasImageChanged: F })
102
105
  }
103
106
  ),
104
107
  /* @__PURE__ */ t(
105
- A,
108
+ E,
106
109
  {
107
110
  p: r.Medium,
108
111
  gap: r.Medium,
109
- borderTop: `1px solid ${b.OnSurfaceBorder}`,
112
+ borderTop: `1px solid ${g.OnSurfaceBorder}`,
110
113
  children: [
111
- /* @__PURE__ */ e(p, { variant: "ghost", onClick: h, children: f[i].secondary }),
112
- /* @__PURE__ */ e(p, { variant: "primary", onClick: T, isDisabled: N, children: v ? f[i].remove : f[i].primary })
114
+ /* @__PURE__ */ e(p, { variant: "ghost", onClick: h, children: s[n].secondary }),
115
+ /* @__PURE__ */ e(p, { variant: "primary", onClick: T, isDisabled: N, children: v ? s[n].remove : s[n].primary })
113
116
  ]
114
117
  }
115
118
  )
116
119
  ] });
117
120
  }
118
121
  export {
119
- de as ImageUploadModal
122
+ se as ImageUploadModal
120
123
  };
@@ -1,6 +1,7 @@
1
1
  import { Icons } from '../icon/index.js';
2
2
  import { MenuItemProps as ChakraMenuItemProps } from '@chakra-ui/react';
3
3
  import { MenuItemType } from './types.js';
4
+ import { ElementType } from 'react';
4
5
  type CustomMenuItemProps = {
5
6
  /**
6
7
  * Type based on what element is used within the MenuItem.
@@ -25,7 +26,7 @@ type CustomMenuItemProps = {
25
26
  * Should only be used when the itemType prop is not sufficient, for example when using a custom Routing component
26
27
  * and rendering the MenuItem as a Link-component from a routing library.
27
28
  */
28
- as?: any;
29
+ as?: ElementType;
29
30
  /**
30
31
  * For usage with routing libraries. If the MenuItem is a custom Link component, this prop can be used to specify the route.
31
32
  */
@@ -1 +1 @@
1
- {"version":3,"file":"menu-item.d.ts","sourceRoot":"","sources":["../../../lib/components/menu/menu-item.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAA8B,KAAK,aAAa,IAAI,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEzG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,KAAK,mBAAmB,GAAG;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,EAAE,CAAC,EAAE,GAAG,CAAC;IACT;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,mBAAmB,EAAE,UAAU,GAAG,YAAY,GAAG,SAAS,GAAG,SAAS,CAAC,GACvG,mBAAmB,CAAC;AAErB,eAAO,MAAM,QAAQ,GAAI,gFAStB,aAAa,4CAsBf,CAAC"}
1
+ {"version":3,"file":"menu-item.d.ts","sourceRoot":"","sources":["../../../lib/components/menu/menu-item.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAA8B,KAAK,aAAa,IAAI,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEzG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEzC,KAAK,mBAAmB,GAAG;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,mBAAmB,EAAE,UAAU,GAAG,YAAY,GAAG,SAAS,GAAG,SAAS,CAAC,GACvG,mBAAmB,CAAC;AAErB,eAAO,MAAM,QAAQ,GAAI,gFAStB,aAAa,4CAsBf,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"menu.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/menu/menu.composition.tsx"],"names":[],"mappings":"AAuBA,eAAO,MAAM,SAAS,+CAgBrB,CAAC;AAQF,eAAO,MAAM,UAAU,+CAqEtB,CAAC;AAEF,eAAO,MAAM,mBAAmB,+CAoB/B,CAAC;AAEF,eAAO,MAAM,QAAQ,+CAqBpB,CAAC;AAEF,eAAO,MAAM,iBAAiB,+CAgB7B,CAAC;AAEF,eAAO,MAAM,QAAQ,+CAmBpB,CAAC;AAEF,eAAO,MAAM,UAAU,+CAyBtB,CAAC;AAEF,eAAO,MAAM,aAAa,+CAoBzB,CAAC;AAEF,eAAO,MAAM,WAAW,+CAkBvB,CAAC;AAEF,eAAO,MAAM,SAAS,+CAgBrB,CAAC"}
1
+ {"version":3,"file":"menu.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/menu/menu.composition.tsx"],"names":[],"mappings":"AAsBA,eAAO,MAAM,SAAS,+CAgBrB,CAAC;AAQF,eAAO,MAAM,UAAU,+CAoEtB,CAAC;AAEF,eAAO,MAAM,mBAAmB,+CAoB/B,CAAC;AAEF,eAAO,MAAM,QAAQ,+CAqBpB,CAAC;AAEF,eAAO,MAAM,iBAAiB,+CAgB7B,CAAC;AAEF,eAAO,MAAM,QAAQ,+CAmBpB,CAAC;AAEF,eAAO,MAAM,UAAU,+CAyBtB,CAAC;AAEF,eAAO,MAAM,aAAa,+CAoBzB,CAAC;AAEF,eAAO,MAAM,WAAW,+CAkBvB,CAAC;AAEF,eAAO,MAAM,SAAS,+CAgBrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"modal-footer.d.ts","sourceRoot":"","sources":["../../../lib/components/modal/modal-footer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAEN,KAAK,gBAAgB,IAAI,sBAAsB,EAC/C,MAAM,kBAAkB,CAAC;AAG1B,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,sBAAsB,EAAE,UAAU,CAAC,GAAG,eAAe,CAAC;AAE1F;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,2CA2BnE"}
1
+ {"version":3,"file":"modal-footer.d.ts","sourceRoot":"","sources":["../../../lib/components/modal/modal-footer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAEN,KAAK,gBAAgB,IAAI,sBAAsB,EAC/C,MAAM,kBAAkB,CAAC;AAG1B,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,sBAAsB,EAAE,UAAU,CAAC,GAAG,eAAe,CAAC;AAE1F;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,2CAqCnE"}
@@ -1,18 +1,21 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { ModalFooter as c } from "@chakra-ui/react";
3
- import { useState as l, useEffect as f } from "react";
4
- function w({ children: r, ...s }) {
5
- const [n, a] = l(!1), e = new ResizeObserver((o) => {
6
- const t = o[0].target, d = t.scrollHeight > t.clientHeight;
7
- a(d);
8
- });
9
- return f(() => {
10
- const o = document.querySelector("[id^='chakra-modal--body']");
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { ModalFooter as f } from "@chakra-ui/react";
3
+ import { useState as m, useEffect as h } from "react";
4
+ function x({ children: n, ...s }) {
5
+ const [a, d] = m(!1);
6
+ return h(() => {
7
+ const e = new ResizeObserver((i) => {
8
+ const t = i[0];
9
+ if (!t)
10
+ return;
11
+ const r = t.target, c = r.scrollHeight > r.clientHeight;
12
+ d(c);
13
+ }), o = document.querySelector("[id^='chakra-modal--body']");
11
14
  return o && e.observe(o), () => {
12
- o && e.unobserve(o);
15
+ o && e.unobserve(o), e.disconnect();
13
16
  };
14
- }, []), /* @__PURE__ */ i(c, { boxShadow: n ? "0px 0px 16px rgba(0, 0, 0, 0.24)" : "none", ...s, children: r });
17
+ }, []), /* @__PURE__ */ l(f, { boxShadow: a ? "0px 0px 16px rgba(0, 0, 0, 0.24)" : "none", ...s, children: n });
15
18
  }
16
19
  export {
17
- w as ModalFooter
20
+ x as ModalFooter
18
21
  };
@@ -2,6 +2,7 @@ export { createColumnHelper } from '@tanstack/react-table';
2
2
  export { Table } from './table.js';
3
3
  export { TableContent } from './table-content.js';
4
4
  export { useTableContext } from './table-context.js';
5
+ export { TableFilter } from './table-filter.js';
5
6
  export { TableToolbar } from './table-toolbar.js';
6
7
  export type { CellContext, ColumnDef, ExpandedState, Row, RowSelectionState, TableContentProps, TableProps, TableRow, TableToolbarProps, VisibilityState, } from './types.js';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,YAAY,EACX,WAAW,EACX,SAAS,EACT,aAAa,EACb,GAAG,EACH,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,eAAe,GACf,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,YAAY,EACX,WAAW,EACX,SAAS,EACT,aAAa,EACb,GAAG,EACH,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,eAAe,GACf,MAAM,SAAS,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as i, jsxs as g, Fragment as I } from "react/jsx-runtime";
2
2
  import { Divider as R, Td as S, Flex as B, Box as b } from "@chakra-ui/react";
3
3
  import { flexRender as $ } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
4
- import { memo as F, useMemo as d, useCallback as k } from "react";
4
+ import { memo as F, useMemo as c, useCallback as k } from "react";
5
5
  import { useTableContext as z } from "./table-context.js";
6
6
  import { TableRowExpandToggleButton as E } from "./table-row-expand-toggle-button.js";
7
7
  import { translations as V } from "./translations.js";
@@ -14,34 +14,34 @@ const K = ({
14
14
  row: n,
15
15
  rowIsExpanded: x,
16
16
  visibleCells: v,
17
- breakingContentState: c,
18
- localeString: m,
17
+ breakingContentState: m,
18
+ localeString: p,
19
19
  actionMenu: l
20
20
  }) => {
21
- const C = z(), { column: t } = r, y = V[m], T = d(() => {
21
+ const C = z(), { column: t } = r, y = V[p], T = c(() => {
22
22
  const e = {
23
23
  width: "100%"
24
24
  };
25
- return c[t.id] || (e.overflow = "hidden", e.whiteSpace = "nowrap"), e;
26
- }, [c]), p = d(() => t.getIndex() === 0, []), u = n.getCanExpand(), s = v[0].id === r.id, f = u && s, h = l || p && !!C.getRowActions, w = d(() => {
25
+ return m[t.id] || (e.overflow = "hidden", e.whiteSpace = "nowrap"), e;
26
+ }, [m, t.id]), u = c(() => t.getIndex() === 0, [t]), f = n.getCanExpand(), s = v[0]?.id === r.id, h = f && s, a = l || u && !!C.getRowActions, P = c(() => {
27
27
  const e = [];
28
28
  for (let o = 0; o < n.depth; o += 1) {
29
- let a = `${o * 2 + 0.7}rem`;
30
- h && (a = `calc(${a} + 24px)`), e.push(
29
+ let d = `${o * 2 + 0.7}rem`;
30
+ a && (d = `calc(${d} + 24px)`), e.push(
31
31
  /* @__PURE__ */ i(
32
32
  R,
33
33
  {
34
34
  orientation: "vertical",
35
35
  position: "absolute",
36
36
  top: "0",
37
- left: a
37
+ left: d
38
38
  },
39
39
  `nestedTableDivider${o}`
40
40
  )
41
41
  );
42
42
  }
43
43
  return e;
44
- }, []), P = k(() => {
44
+ }, [n.depth, a]), w = k(() => {
45
45
  const e = t.getIsPinned();
46
46
  return {
47
47
  position: e ? "sticky" : "relative",
@@ -51,10 +51,10 @@ const K = ({
51
51
  width: t.getSize(),
52
52
  maxWidth: t.getSize()
53
53
  };
54
- }, []);
54
+ }, [t]);
55
55
  function D() {
56
- const e = n.depth && s || f ? `${n.depth * 2}rem` : _.Small;
57
- return h ? `calc(${e} + 24px)` : e;
56
+ const e = n.depth && s || h ? `${n.depth * 2}rem` : _.Small;
57
+ return a ? `calc(${e} + 24px)` : e;
58
58
  }
59
59
  return /* @__PURE__ */ i(
60
60
  S,
@@ -62,7 +62,7 @@ const K = ({
62
62
  id: r.id,
63
63
  isNumeric: t.columnDef.meta?.isNumeric,
64
64
  style: {
65
- ...P(),
65
+ ...w(),
66
66
  borderBottom: 0,
67
67
  paddingLeft: D()
68
68
  },
@@ -100,16 +100,16 @@ const K = ({
100
100
  ]
101
101
  }
102
102
  ) }),
103
- f || n.depth > 0 && s ? /* @__PURE__ */ i(
103
+ h || n.depth > 0 && s ? /* @__PURE__ */ i(
104
104
  E,
105
105
  {
106
106
  row: n,
107
- localeString: m,
108
- hidden: !u,
107
+ localeString: p,
108
+ hidden: !f,
109
109
  rowIsExpanded: x
110
110
  }
111
111
  ) : /* @__PURE__ */ i(I, {}),
112
- p && w,
112
+ u && P,
113
113
  /* @__PURE__ */ i("div", { style: T, children: $(t.columnDef.cell, r.getContext()) })
114
114
  ] })
115
115
  },
@@ -1 +1 @@
1
- {"version":3,"file":"table-content.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAM/C,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnE,MAAM,WAAW,iBAAiB,CAAC,KAAK,SAAS,SAAS,GAAG,SAAS;IACrE;;OAEG;IACH,UAAU,CAAC,EAAE,CACZ,GAAG,EAAE,YAAY,CAAC,KAAK,CAAC,EACxB,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAAC,KACnF,IAAI,CAAC;IAEV;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B;;OAEG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,QAAA,MAAM,iBAAiB,GAAI,KAAK,SAAS,SAAS,EAAE,2GAOjD,iBAAiB,CAAC,KAAK,CAAC,GAAG,eAAe,4CAqD5C,CAAC;AAEF,eAAO,MAAM,YAAY,EAA8B,OAAO,iBAAiB,CAAC"}
1
+ {"version":3,"file":"table-content.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAM/C,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnE,MAAM,WAAW,iBAAiB,CAAC,KAAK,SAAS,SAAS,GAAG,SAAS;IACrE;;OAEG;IACH,UAAU,CAAC,EAAE,CACZ,GAAG,EAAE,YAAY,CAAC,KAAK,CAAC,EACxB,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAAC,KACnF,IAAI,CAAC;IAEV;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B;;OAEG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,QAAA,MAAM,iBAAiB,GAAI,KAAK,SAAS,SAAS,EAAE,2GAOjD,iBAAiB,CAAC,KAAK,CAAC,GAAG,eAAe,4CAsD5C,CAAC;AAEF,eAAO,MAAM,YAAY,EAA8B,OAAO,iBAAiB,CAAC"}
@@ -1,23 +1,25 @@
1
- import { jsxs as p, jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as c, jsx as o } from "react/jsx-runtime";
2
2
  import { Table as u, Thead as T, Tbody as f } from "@chakra-ui/react";
3
3
  import { memo as g, useMemo as r } from "react";
4
4
  import { useTableContext as x } from "./table-context.js";
5
- import { TableHeaderRow as y } from "./table-header-row.js";
6
- import { TableRow as C } from "./table-row.js";
5
+ import { TableHeaderRow as C } from "./table-header-row.js";
6
+ import { TableRow as y } from "./table-row.js";
7
7
  const R = ({
8
8
  onClickRow: i,
9
- onRowClickIndication: n,
10
- hideTableHeaderDropdown: l,
11
- showRowHoverStyle: s = !0,
12
- stickyHeaders: a,
9
+ onRowClickIndication: l,
10
+ hideTableHeaderDropdown: s,
11
+ showRowHoverStyle: a = !0,
12
+ stickyHeaders: n,
13
13
  ...m
14
14
  }) => {
15
- const e = x(), d = r(() => a ? {
15
+ const e = x(), b = r(() => n ? {
16
16
  position: "sticky",
17
17
  top: 0,
18
18
  zIndex: 1
19
- } : {}, []), b = r(
19
+ } : {}, [n]), d = r(
20
20
  () => e.table.getRowModel().rows,
21
+ // The dependencies are needed to ensure that the rows are recalculated when any of these change
22
+ // eslint-disable-next-line react-hooks/exhaustive-deps
21
23
  [
22
24
  e.expanded,
23
25
  e.breakingContentState,
@@ -26,25 +28,25 @@ const R = ({
26
28
  e.data
27
29
  ]
28
30
  );
29
- return /* @__PURE__ */ p(u, { ...m, id: e.id, children: [
30
- /* @__PURE__ */ o(T, { style: d, children: e.table.getHeaderGroups().map((t) => /* @__PURE__ */ o(
31
- y,
31
+ return /* @__PURE__ */ c(u, { ...m, id: e.id, children: [
32
+ /* @__PURE__ */ o(T, { style: b, children: e.table.getHeaderGroups().map((t) => /* @__PURE__ */ o(
33
+ C,
32
34
  {
33
35
  headerGroup: t,
34
- hideTableHeaderDropdown: l
36
+ hideTableHeaderDropdown: s
35
37
  },
36
38
  t.id
37
39
  )) }),
38
- /* @__PURE__ */ o(f, { children: b.map((t) => {
39
- const c = t.getVisibleCells();
40
+ /* @__PURE__ */ o(f, { children: d.map((t) => {
41
+ const p = t.getVisibleCells();
40
42
  return /* @__PURE__ */ o(
41
- C,
43
+ y,
42
44
  {
43
45
  row: t,
44
- visibleCells: c,
46
+ visibleCells: p,
45
47
  onClickRow: i,
46
- onRowClickIndication: n,
47
- showRowHoverStyle: s
48
+ onRowClickIndication: l,
49
+ showRowHoverStyle: a
48
50
  },
49
51
  t.id
50
52
  );