@ogcio/design-system-react 1.12.3 → 1.13.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 (96) hide show
  1. package/dist/accordion/accordion-item.js +1 -1
  2. package/dist/alert/alert.js +1 -1
  3. package/dist/autocomplete/autocomplete.js +124 -198
  4. package/dist/autocomplete/types.d.ts +23 -5
  5. package/dist/autocomplete/use-autocomplete-controller.d.ts +10 -0
  6. package/dist/autocomplete/use-autocomplete-controller.js +125 -0
  7. package/dist/button/helpers.d.ts +1 -1
  8. package/dist/button/helpers.js +14 -12
  9. package/dist/button/types.d.ts +1 -1
  10. package/dist/button-group/button-group.d.ts +1 -0
  11. package/dist/button-group/button-group.js +67 -60
  12. package/dist/card/card-next.js +28 -28
  13. package/dist/checkbox/checkbox.d.ts +7 -1
  14. package/dist/combo-box/dropdown-item.js +30 -30
  15. package/dist/data-grid/editable-table-cell.d.ts +3 -0
  16. package/dist/data-grid/editable-table-cell.js +73 -0
  17. package/dist/data-grid/tanstack/tanstack-helpers.d.ts +11 -0
  18. package/dist/data-grid/tanstack/tanstack-helpers.js +1799 -0
  19. package/dist/data-grid/types.d.ts +20 -0
  20. package/dist/data-grid/types.js +1 -0
  21. package/dist/drawer/drawer.content.js +6 -6
  22. package/dist/drawer/drawer.js +8 -8
  23. package/dist/error-text/error-text.js +1 -1
  24. package/dist/forms/form-field/form-field.js +15 -15
  25. package/dist/forms/form-field-with-tag/form-field-with-tag.js +1 -1
  26. package/dist/header/components/header-slot.js +38 -27
  27. package/dist/header/header.js +5 -5
  28. package/dist/heading/heading.js +1 -1
  29. package/dist/hint-text/hint-text.js +1 -1
  30. package/dist/hooks/use-aria-hider.d.ts +1 -0
  31. package/dist/hooks/use-aria-hider.js +20 -0
  32. package/dist/hooks/use-focus-trap.d.ts +2 -0
  33. package/dist/hooks/use-focus-trap.js +678 -0
  34. package/dist/icon/icon.js +32 -32
  35. package/dist/icon/icons.d.ts +2 -2
  36. package/dist/icon/icons.js +5 -1
  37. package/dist/icon/svgs/placeholder.js +2 -2
  38. package/dist/icon-button/icon-button.js +17 -17
  39. package/dist/index-2sRBqKFV.js +78 -0
  40. package/dist/{index-DNkhmzZp.js → index-CB-zPpNk.js} +44 -44
  41. package/dist/index.d.ts +6 -4
  42. package/dist/index.js +135 -130
  43. package/dist/input-checkbox/input-checkbox.d.ts +9 -2
  44. package/dist/input-checkbox/input-checkbox.js +65 -42
  45. package/dist/input-checkbox/types.d.ts +5 -0
  46. package/dist/input-checkbox-group/input-checkbox-group.js +22 -16
  47. package/dist/input-checkbox-group/types.d.ts +1 -0
  48. package/dist/input-radio/input-radio.js +15 -15
  49. package/dist/input-radio-group/input-radio-group.js +24 -17
  50. package/dist/input-radio-group/types.d.ts +1 -0
  51. package/dist/input-text/input-text.d.ts +22 -0
  52. package/dist/input-text/input-text.js +121 -100
  53. package/dist/input-text/type.d.ts +5 -0
  54. package/dist/label/label.js +1 -1
  55. package/dist/link/link.js +1 -1
  56. package/dist/list/list.js +2 -2
  57. package/dist/lodash-D1c5hFAM.js +3677 -0
  58. package/dist/modal/modal.content.js +1 -1
  59. package/dist/modal/modal.js +141 -127
  60. package/dist/popover/popover.js +464 -466
  61. package/dist/primitives/anchor.js +1 -1
  62. package/dist/progress-bar/progress-bar.js +8 -8
  63. package/dist/progress-stepper/progress-stepper.js +12 -12
  64. package/dist/score-select/score-select.js +3 -3
  65. package/dist/select/select-menu.d.ts +1 -1
  66. package/dist/select/select-menu.js +96 -90
  67. package/dist/select/select-native.d.ts +5 -2
  68. package/dist/select/select-native.js +45 -15
  69. package/dist/select/select-next.d.ts +3 -2
  70. package/dist/select/select-next.js +125 -92
  71. package/dist/select/select-search.d.ts +3 -0
  72. package/dist/select/select-search.js +24 -0
  73. package/dist/select/select.d.ts +4 -2
  74. package/dist/select/select.js +3 -2
  75. package/dist/select/types.d.ts +22 -0
  76. package/dist/side-nav/side-nav.js +23 -23
  77. package/dist/spinner/spinner.js +1 -1
  78. package/dist/stack/stack.js +40 -49
  79. package/dist/styles.css +2 -3
  80. package/dist/table/index.d.ts +8 -0
  81. package/dist/table/index.js +19 -0
  82. package/dist/table/table-data.d.ts +16 -2
  83. package/dist/table/table-data.js +64 -17
  84. package/dist/table/table-header.d.ts +4 -1
  85. package/dist/table/table-header.js +58 -18
  86. package/dist/table/table-pagination.d.ts +8 -0
  87. package/dist/table/table-pagination.js +97 -0
  88. package/dist/table/table-row.js +7 -6
  89. package/dist/table/table.d.ts +4 -1
  90. package/dist/table/table.js +22 -15
  91. package/dist/text-input/text-input.d.ts +1 -0
  92. package/dist/textarea/textarea.js +18 -17
  93. package/dist/toast/ds-toast.js +1 -1
  94. package/dist/tooltip/tooltip.js +1 -1
  95. package/package.json +5 -5
  96. package/dist/index-ntYL1VRC.js +0 -64
@@ -13,6 +13,7 @@ type ButtonGroupProps = PropsWithChildren<{
13
13
  appearance?: ButtonAppearance;
14
14
  onChange?: (value: string) => void;
15
15
  defaultValue?: string;
16
+ value?: string;
16
17
  role?: string;
17
18
  'aria-labelledby'?: string;
18
19
  'aria-describedby'?: string;
@@ -1,85 +1,92 @@
1
1
  "use client";
2
- import { jsx as p } from "react/jsx-runtime";
3
- import { createContext as x, useContext as B, useState as I } from "react";
4
- import { Button as G } from "../button/button.js";
5
- import { useDomId as g } from "../hooks/use-dom-id.js";
6
- const b = x(
2
+ import { jsx as f } from "react/jsx-runtime";
3
+ import { createContext as x, useState as B, useEffect as G, useContext as V } from "react";
4
+ import { Button as k } from "../button/button.js";
5
+ import { useDomId as S } from "../hooks/use-dom-id.js";
6
+ const I = x(
7
7
  void 0
8
- ), w = ({
9
- value: e,
10
- children: a,
11
- role: n,
12
- "aria-checked": r,
13
- "aria-label": i
8
+ ), v = ({
9
+ value: r,
10
+ children: d,
11
+ role: s,
12
+ "aria-checked": e,
13
+ "aria-label": a
14
14
  }) => {
15
- const o = B(b);
16
- if (!o)
15
+ const t = V(I);
16
+ if (!t)
17
17
  throw new Error("ButtonGroupItem must be used within a ButtonGroup");
18
18
  const {
19
- selectedValue: d,
20
- setSelectedValue: c,
19
+ selectedValue: n,
20
+ setSelectedValue: l,
21
21
  size: u,
22
- onChange: t,
23
- groupId: s,
24
- appearance: l
25
- } = o, m = d === e, f = () => {
26
- c(e), t == null || t(e);
27
- }, y = `${s}-${e}`;
28
- return /* @__PURE__ */ p(
29
- G,
22
+ onChange: o,
23
+ groupId: p,
24
+ appearance: i
25
+ } = t, c = n === r, m = () => {
26
+ l(r), o == null || o(r);
27
+ }, b = `${p}-${r}`;
28
+ return /* @__PURE__ */ f(
29
+ k,
30
30
  {
31
- variant: m ? "primary" : "secondary",
31
+ variant: c ? "primary" : "secondary",
32
32
  size: u,
33
- appearance: l,
34
- onClick: f,
35
- id: y,
36
- role: n || "radio",
37
- "aria-checked": r === void 0 ? m : r,
38
- "aria-label": i,
33
+ appearance: i,
34
+ onClick: m,
35
+ id: b,
36
+ role: s || "radio",
37
+ "aria-checked": e === void 0 ? c : e,
38
+ "aria-label": a,
39
39
  type: "button",
40
- children: a
40
+ children: d
41
41
  }
42
42
  );
43
- }, C = ({
44
- name: e,
45
- size: a = "medium",
46
- appearance: n = "dark",
47
- onChange: r,
48
- defaultValue: i,
49
- children: o,
50
- role: d,
51
- "aria-labelledby": c,
52
- "aria-describedby": u
43
+ }, z = ({
44
+ name: r,
45
+ size: d = "medium",
46
+ appearance: s = "dark",
47
+ onChange: e,
48
+ defaultValue: a,
49
+ value: t,
50
+ children: n,
51
+ role: l,
52
+ "aria-labelledby": u,
53
+ "aria-describedby": o
53
54
  }) => {
54
- const [t, s] = I(
55
- i
56
- ), l = g();
57
- return /* @__PURE__ */ p(
58
- b.Provider,
55
+ const [p, i] = B(
56
+ a
57
+ ), c = t === void 0 ? p : t;
58
+ G(() => {
59
+ t !== void 0 && i(t);
60
+ }, [t]);
61
+ const m = (y) => {
62
+ t === void 0 && i(y), e == null || e(y);
63
+ }, b = S();
64
+ return /* @__PURE__ */ f(
65
+ I.Provider,
59
66
  {
60
67
  value: {
61
- selectedValue: t,
62
- setSelectedValue: s,
63
- name: e,
64
- size: a,
65
- onChange: r,
66
- groupId: l,
67
- appearance: n
68
+ selectedValue: c,
69
+ setSelectedValue: m,
70
+ name: r,
71
+ size: d,
72
+ onChange: e,
73
+ groupId: b,
74
+ appearance: s
68
75
  },
69
- children: /* @__PURE__ */ p(
76
+ children: /* @__PURE__ */ f(
70
77
  "div",
71
78
  {
72
79
  className: "gi-btn-group",
73
- role: d || "radiogroup",
74
- "aria-labelledby": c,
75
- "aria-describedby": u,
76
- children: o
80
+ role: l || "radiogroup",
81
+ "aria-labelledby": u,
82
+ "aria-describedby": o,
83
+ children: n
77
84
  }
78
85
  )
79
86
  }
80
87
  );
81
88
  };
82
89
  export {
83
- C as ButtonGroup,
84
- w as ButtonGroupItem
90
+ z as ButtonGroup,
91
+ v as ButtonGroupItem
85
92
  };
@@ -1,39 +1,39 @@
1
1
  "use client";
2
2
  import { jsx as r, jsxs as g } from "react/jsx-runtime";
3
- import { createContext as l, useContext as m, useMemo as f, Children as p, isValidElement as v } from "react";
3
+ import { createContext as l, Children as m, isValidElement as f, useContext as p, useMemo as v } from "react";
4
4
  import { Icon as N } from "../icon/icon.js";
5
5
  import { Paragraph as h } from "../paragraph/paragraph.js";
6
6
  import { Tag as x } from "../tag/tag.js";
7
- const u = l(!1), c = l(!1), o = l(!1);
8
- function i(e, a, t) {
9
- if (!m(e))
10
- throw new Error(`${a} must be used inside <${t}>`);
7
+ const u = l(!1), o = l(!1), c = l(!1);
8
+ function i(e, a, n) {
9
+ if (!p(e))
10
+ throw new Error(`${a} must be used inside <${n}>`);
11
11
  return !0;
12
12
  }
13
13
  const P = ({
14
14
  children: e,
15
15
  inset: a,
16
- type: t = "vertical",
17
- dataTestid: n
16
+ type: n = "vertical",
17
+ dataTestid: t
18
18
  }) => {
19
- const d = f(() => {
20
- const s = `gi-card-inset-${a || "none"}`;
21
- return `gi-card gi-card-${t} ${s} gi-not-prose`;
22
- }, [t, a]);
23
- return /* @__PURE__ */ r(u.Provider, { value: !0, children: /* @__PURE__ */ r("div", { className: d, "data-testid": n, children: e }) });
19
+ const s = v(() => {
20
+ const d = `gi-card-inset-${a || "none"}`;
21
+ return `gi-card gi-card-${n} ${d} gi-not-prose`;
22
+ }, [n, a]);
23
+ return /* @__PURE__ */ r(u.Provider, { value: !0, children: /* @__PURE__ */ r("div", { className: s, "data-testid": t, children: e }) });
24
24
  }, j = ({ media: e, href: a }) => {
25
25
  if (i(u, "CardMedia", "Card"), !e)
26
26
  return null;
27
27
  switch (e.type) {
28
28
  case "image": {
29
- const { src: t, alt: n, aspectRatio: d } = e.config;
29
+ const { src: n, alt: t, aspectRatio: s } = e.config;
30
30
  return /* @__PURE__ */ r("div", { className: "gi-card-image", children: /* @__PURE__ */ r("a", { href: a, children: /* @__PURE__ */ r(
31
31
  "img",
32
32
  {
33
- src: t,
34
- alt: n,
35
- style: d ? { aspectRatio: d } : void 0,
36
- className: d ? "gi-w-full" : void 0
33
+ src: n,
34
+ alt: t,
35
+ style: s ? { aspectRatio: s } : void 0,
36
+ className: s ? "gi-w-full" : void 0
37
37
  }
38
38
  ) }) });
39
39
  }
@@ -47,29 +47,29 @@ const P = ({
47
47
  }, E = ({
48
48
  children: e,
49
49
  inset: a = "none"
50
- }) => (i(u, "CardContainer", "Card"), /* @__PURE__ */ r(o.Provider, { value: !0, children: /* @__PURE__ */ r("div", { className: `gi-card-content gi-card-inset-${a || "none"}`, children: e }) })), M = ({ children: e }) => (i(c, "CardTitle", "CardHeader"), e ? /* @__PURE__ */ r("div", { className: "gi-card-title", children: e }) : null), A = ({ children: e }) => (i(c, "CardSubtitle", "CardHeader"), e ? /* @__PURE__ */ r("div", { className: "gi-card-subheading", children: e }) : null), T = ({ text: e, type: a }) => (i(c, "CardTag", "CardHeader"), /* @__PURE__ */ r("div", { className: "gi-card-tag", children: /* @__PURE__ */ r(x, { text: e, type: a }) }));
50
+ }) => (i(u, "CardContainer", "Card"), /* @__PURE__ */ r(c.Provider, { value: !0, children: /* @__PURE__ */ r("div", { className: `gi-card-content gi-card-inset-${a || "none"}`, children: e }) })), M = ({ children: e }) => (i(o, "CardTitle", "CardHeader"), e ? /* @__PURE__ */ r("div", { className: "gi-card-title", children: e }) : null), A = ({ children: e }) => (i(o, "CardSubtitle", "CardHeader"), e ? /* @__PURE__ */ r("div", { className: "gi-card-subheading", children: e }) : null), T = ({ text: e, type: a }) => (i(o, "CardTag", "CardHeader"), /* @__PURE__ */ r("div", { className: "gi-card-tag", children: /* @__PURE__ */ r(x, { text: e, type: a }) }));
51
51
  Object.defineProperty(T, "componentType", {
52
52
  value: "CardTag",
53
53
  writable: !1,
54
54
  enumerable: !1
55
55
  });
56
56
  const D = ({ children: e }) => {
57
- i(o, "CardHeader", "CardContainer");
58
- const a = [], t = [];
59
- return p.forEach(e, (n) => {
60
- var s, C;
61
- if (!v(n))
57
+ i(c, "CardHeader", "CardContainer");
58
+ const a = [], n = [];
59
+ return m.forEach(e, (t) => {
60
+ var d, C;
61
+ if (!f(t))
62
62
  return;
63
- (((s = n == null ? void 0 : n.type) == null ? void 0 : s.componentType) || ((C = n.props) == null ? void 0 : C.__mdxType)) === "CardTag" ? t.push(n) : a.push(n);
64
- }), /* @__PURE__ */ r(c.Provider, { value: !0, children: /* @__PURE__ */ g("div", { className: "gi-card-header", children: [
63
+ (((d = t == null ? void 0 : t.type) == null ? void 0 : d.componentType) || ((C = t.props) == null ? void 0 : C.__mdxType)) === "CardTag" ? n.push(t) : a.push(t);
64
+ }), /* @__PURE__ */ r(o.Provider, { value: !0, children: /* @__PURE__ */ g("div", { className: "gi-card-header", children: [
65
65
  /* @__PURE__ */ r("div", { className: "gi-card-heading", children: a }),
66
- t
66
+ n
67
67
  ] }) });
68
68
  }, R = ({
69
69
  children: e
70
- }) => (i(o, "CardDescription", "CardContainer"), e ? /* @__PURE__ */ r("div", { className: "gi-card-paragraph", children: /* @__PURE__ */ r(h, { size: "sm", children: e }) }) : null), S = ({
70
+ }) => (i(c, "CardDescription", "CardContainer"), e ? /* @__PURE__ */ r("div", { className: "gi-card-paragraph", children: /* @__PURE__ */ r(h, { size: "sm", children: e }) }) : null), S = ({
71
71
  children: e
72
- }) => (i(o, "CardAction", "CardContainer"), /* @__PURE__ */ r("div", { className: "gi-card-action", children: e }));
72
+ }) => (i(c, "CardAction", "CardContainer"), /* @__PURE__ */ r("div", { className: "gi-card-action", children: e }));
73
73
  export {
74
74
  S as CardAction,
75
75
  E as CardContainer,
@@ -1,4 +1,10 @@
1
1
  /**
2
2
  * @deprecated Use <InputCheckbox /> instead of <Checkbox />.
3
3
  */
4
- export declare const Checkbox: import('react').FC<import('../index.js').InputCheckboxProps>;
4
+ export declare const Checkbox: import('react').ForwardRefExoticComponent<{
5
+ size?: import('../index.js').InputCheckboxSizeEnumType;
6
+ label?: string;
7
+ hint?: string;
8
+ indeterminate?: boolean;
9
+ containerProps?: any;
10
+ } & Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "size"> & import('react').RefAttributes<HTMLInputElement>>;
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsxs as i, jsx as s } from "react/jsx-runtime";
2
+ import { jsxs as n, jsx as s } from "react/jsx-runtime";
3
3
  import { useState as u, useId as j, useEffect as q } from "react";
4
4
  import { Button as B } from "../button/button.js";
5
5
  import { cn as x } from "../cn.js";
@@ -11,7 +11,7 @@ import { InputText as O } from "../input-text/input-text.js";
11
11
  import { Paragraph as y } from "../paragraph/paragraph.js";
12
12
  import { Tag as A, TagTypeEnum as F } from "../tag/tag.js";
13
13
  import { slugify as P } from "../utilities.js";
14
- const ee = ({
14
+ const oo = ({
15
15
  children: c,
16
16
  noSearch: h,
17
17
  options: p,
@@ -26,40 +26,40 @@ const ee = ({
26
26
  )
27
27
  ];
28
28
  q(() => {
29
- var a, n;
30
- let e = 0;
31
- const o = z();
32
- for (const b of o) {
29
+ var a, i;
30
+ let o = 0;
31
+ const e = z();
32
+ for (const b of e) {
33
33
  const f = (a = b.querySelector("label")) == null ? void 0 : a.textContent;
34
- (n = f == null ? void 0 : f.toLowerCase()) != null && n.includes(d.toLowerCase()) ? b.style.display = "flex" : (b.style.display = "none", e++);
34
+ (i = f == null ? void 0 : f.toLowerCase()) != null && i.includes(d.toLowerCase()) ? b.style.display = "flex" : (b.style.display = "none", o++);
35
35
  }
36
- _(e === p.length);
36
+ _(o === p.length);
37
37
  }, [d, p.length]);
38
- const R = (e, o) => {
39
- const a = o ? [...t || [], e] : (t || []).filter((n) => n !== e);
38
+ const R = (o, e) => {
39
+ const a = e ? [...t || [], o] : (t || []).filter((i) => i !== o);
40
40
  w || V(a), g == null || g(a);
41
41
  };
42
- return /* @__PURE__ */ i(
42
+ return /* @__PURE__ */ n(
43
43
  "div",
44
44
  {
45
45
  role: "group",
46
46
  "aria-label": `${c} dropdown`,
47
47
  className: "gi-combobox-dropdown-item",
48
48
  children: [
49
- /* @__PURE__ */ i(
49
+ /* @__PURE__ */ n(
50
50
  B,
51
51
  {
52
52
  variant: "flat",
53
53
  appearance: "dark",
54
54
  size: "large",
55
- onClick: (e) => {
56
- e.preventDefault(), C(!m);
55
+ onClick: (o) => {
56
+ o.preventDefault(), C(!m);
57
57
  },
58
58
  className: x("gi-combobox-toggle", {
59
59
  "gi-combobox-toggle-open": m
60
60
  }),
61
61
  children: [
62
- /* @__PURE__ */ i("div", { className: "gi-combobox-toggle-content", children: [
62
+ /* @__PURE__ */ n("div", { className: "gi-combobox-toggle-content", children: [
63
63
  /* @__PURE__ */ s(y, { size: "md", children: c }),
64
64
  (t == null ? void 0 : t.length) > 0 && /* @__PURE__ */ s(A, { type: F.Counter, text: t.length.toString() })
65
65
  ] }),
@@ -73,22 +73,22 @@ const ee = ({
73
73
  ]
74
74
  }
75
75
  ),
76
- /* @__PURE__ */ i(
76
+ /* @__PURE__ */ n(
77
77
  "div",
78
78
  {
79
79
  className: m ? "gi-combobox-dropdown-container-open" : "gi-hidden",
80
80
  id: `${r}-search`,
81
81
  children: [
82
- !h && /* @__PURE__ */ i("div", { className: "gi-combobox-search", children: [
82
+ !h && /* @__PURE__ */ n("div", { className: "gi-combobox-search", children: [
83
83
  /* @__PURE__ */ s(
84
84
  O,
85
85
  {
86
86
  placeholder: N("dropdownItem.search", { defaultValue: "Search" }),
87
87
  className: "gi-combobox-search-input",
88
88
  value: d,
89
- onChange: (e) => {
90
- const o = e.target.value;
91
- $(o), l == null || l(o);
89
+ onChange: (o) => {
90
+ const e = o.target.value;
91
+ $(e), l == null || l(e);
92
92
  }
93
93
  }
94
94
  ),
@@ -108,7 +108,7 @@ const ee = ({
108
108
  }
109
109
  )
110
110
  ] }),
111
- /* @__PURE__ */ i(
111
+ /* @__PURE__ */ n(
112
112
  "div",
113
113
  {
114
114
  className: x("gi-combobox-checkbox-container", {
@@ -118,8 +118,8 @@ const ee = ({
118
118
  I && /* @__PURE__ */ s(y, { className: "gi-combobox-checkbox-paragraph", children: N("dropdownItem.noResultFound", {
119
119
  defaultValue: "No results found."
120
120
  }) }),
121
- p.map((e, o) => {
122
- const a = t == null ? void 0 : t.includes(e.value);
121
+ p.map((o, e) => {
122
+ const a = t == null ? void 0 : t.includes(o.value);
123
123
  return /* @__PURE__ */ s(
124
124
  "div",
125
125
  {
@@ -127,16 +127,16 @@ const ee = ({
127
127
  children: /* @__PURE__ */ s(
128
128
  L,
129
129
  {
130
- onChange: (n) => R(e.value, n.target.checked),
130
+ onChange: (i) => R(o.value, i.target.checked),
131
131
  checked: a,
132
- id: `${o}_${r}_${e.value}`,
133
- label: e.label,
134
- name: `${o}_${e.label}_${r}`,
135
- value: e.value
132
+ id: `${e}_${r}_${o.value}`,
133
+ label: o.label,
134
+ name: `${e}_${o.label}_${r}`,
135
+ value: o.value
136
136
  }
137
137
  )
138
138
  },
139
- `${o}_${r}_${e.value}`
139
+ `${e}_${r}_${o.value}`
140
140
  );
141
141
  })
142
142
  ]
@@ -150,5 +150,5 @@ const ee = ({
150
150
  );
151
151
  };
152
152
  export {
153
- ee as DropdownItem
153
+ oo as DropdownItem
154
154
  };
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { EditorTableCellProps } from './types.js';
3
+ export declare const EditableTableCell: FC<EditorTableCellProps<any>>;
@@ -0,0 +1,73 @@
1
+ "use client";
2
+ import { jsx as o } from "react/jsx-runtime";
3
+ import { l as O } from "../lodash-D1c5hFAM.js";
4
+ import { useState as g, useMemo as S, useEffect as k } from "react";
5
+ import { InputCheckboxTableCell as V } from "../input-checkbox/input-checkbox.js";
6
+ import { InputTextTableCell as j } from "../input-text/input-text.js";
7
+ import { SelectTableCell as y } from "../select/select-native.js";
8
+ const A = ({
9
+ value: l,
10
+ rowIndex: h,
11
+ columnId: C,
12
+ setData: x,
13
+ editor: e
14
+ }) => {
15
+ var b;
16
+ const [t, m] = g(l), [u, T] = g(!!t), E = (s, n, a) => {
17
+ x(
18
+ (c) => c.map((r, D) => D === s ? {
19
+ ...r,
20
+ [n]: a
21
+ } : r)
22
+ );
23
+ }, p = S(
24
+ () => O.debounce((s) => E(h, C, s), 500),
25
+ [h, C]
26
+ );
27
+ k(() => () => {
28
+ p.cancel();
29
+ }, [p]);
30
+ const f = (s) => {
31
+ var a, c;
32
+ const n = s.target.value;
33
+ m(n), p(n), (c = (a = e == null ? void 0 : e.props) == null ? void 0 : a.onChange) == null || c.call(a, s);
34
+ }, v = (s) => {
35
+ var n, a;
36
+ T(!u), p(!u), (a = (n = e == null ? void 0 : e.props) == null ? void 0 : n.onChange) == null || a.call(n, s);
37
+ };
38
+ switch (k(() => {
39
+ m(l);
40
+ }, [l]), e.type) {
41
+ case "select":
42
+ return /* @__PURE__ */ o(
43
+ y,
44
+ {
45
+ ...e.props,
46
+ defaultValue: t,
47
+ onChange: f,
48
+ options: ((b = e == null ? void 0 : e.props) == null ? void 0 : b.options) || []
49
+ }
50
+ );
51
+ case "checkbox":
52
+ return /* @__PURE__ */ o(
53
+ V,
54
+ {
55
+ checked: u,
56
+ ...e == null ? void 0 : e.props,
57
+ onChange: v
58
+ }
59
+ );
60
+ default:
61
+ return /* @__PURE__ */ o(
62
+ j,
63
+ {
64
+ ...e.props,
65
+ value: t,
66
+ onChange: f
67
+ }
68
+ );
69
+ }
70
+ };
71
+ export {
72
+ A as EditableTableCell
73
+ };
@@ -0,0 +1,11 @@
1
+ export type Person = {
2
+ firstName: string;
3
+ lastName: string;
4
+ email: string;
5
+ age: number;
6
+ city: string;
7
+ isActive: boolean;
8
+ status: 'pending' | 'in progress' | 'accepted' | 'declined';
9
+ disabledFields?: string[];
10
+ };
11
+ export declare function makeData(...lens: number[]): Person[];