@rio-cloud/rio-uikit 2.5.0-beta.1 → 2.5.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 (119) hide show
  1. package/CountedInput.d.ts +2 -0
  2. package/CountedInput.js +5 -0
  3. package/CountedInput.js.map +1 -0
  4. package/TabbedPanel.d.ts +2 -0
  5. package/TabbedPanel.js +5 -0
  6. package/TabbedPanel.js.map +1 -0
  7. package/components/applicationHeader/NavItems.js +58 -46
  8. package/components/applicationHeader/NavItems.js.map +1 -1
  9. package/components/applicationLayout/ApplicationLayoutBody.d.ts +1 -1
  10. package/components/applicationLayout/ApplicationLayoutBody.js +29 -29
  11. package/components/applicationLayout/ApplicationLayoutBody.js.map +1 -1
  12. package/components/applicationLayout/ApplicationLayoutHeader.js +22 -7
  13. package/components/applicationLayout/ApplicationLayoutHeader.js.map +1 -1
  14. package/components/assetTree/useTreeHeight.js.map +1 -1
  15. package/components/button/Button.d.ts +11 -3
  16. package/components/button/Button.js.map +1 -1
  17. package/components/clearableInput/ClearableInput.d.ts +4 -0
  18. package/components/clearableInput/ClearableInput.js.map +1 -1
  19. package/components/countedInput/CountedInput.d.ts +91 -0
  20. package/components/countedInput/CountedInput.js +65 -0
  21. package/components/countedInput/CountedInput.js.map +1 -0
  22. package/components/datepicker/DatePicker.d.ts +1 -1
  23. package/components/datepicker/DatePicker.js +1 -1
  24. package/components/datepicker/DatePicker.js.map +1 -1
  25. package/components/datepicker/DayPicker.js +3 -2
  26. package/components/datepicker/DayPicker.js.map +1 -1
  27. package/components/datepicker/DayPickerInput.d.ts +1 -1
  28. package/components/datepicker/DayPickerInput.js.map +1 -1
  29. package/components/datepicker/dayPickerTypes.d.ts +3 -2
  30. package/components/datepicker/dayPickerTypes.js.map +1 -1
  31. package/components/datepicker/dayPickerUtils.d.ts +1 -1
  32. package/components/datepicker/dayPickerUtils.js +45 -22
  33. package/components/datepicker/dayPickerUtils.js.map +1 -1
  34. package/components/datepicker/useDayPickerInputState.d.ts +1 -1
  35. package/components/dialog/ConfirmationDialog.d.ts +17 -0
  36. package/components/dialog/ConfirmationDialog.js +43 -19
  37. package/components/dialog/ConfirmationDialog.js.map +1 -1
  38. package/components/dialog/DialogHeader.js +20 -19
  39. package/components/dialog/DialogHeader.js.map +1 -1
  40. package/components/dropdown/ButtonDropdown.d.ts +5 -0
  41. package/components/dropdown/ButtonDropdown.js +63 -61
  42. package/components/dropdown/ButtonDropdown.js.map +1 -1
  43. package/components/dropdown/DropdownToggleButton.d.ts +2 -0
  44. package/components/dropdown/DropdownToggleButton.js +39 -35
  45. package/components/dropdown/DropdownToggleButton.js.map +1 -1
  46. package/components/map/components/features/settings/builtinSettings/MapTypeSettings.js +103 -105
  47. package/components/map/components/features/settings/builtinSettings/MapTypeSettings.js.map +1 -1
  48. package/components/map/utils/eventHandling.js.map +1 -1
  49. package/components/map/utils/mapTypes.d.ts +7 -0
  50. package/components/map/utils/mapTypes.js.map +1 -1
  51. package/components/map/utils/rendering.js +5 -5
  52. package/components/numberControl/NumberControl.js.map +1 -1
  53. package/components/page/Page.d.ts +2 -0
  54. package/components/page/Page.js.map +1 -1
  55. package/components/rioglyph/Rioglyph.d.ts +8 -2
  56. package/components/rioglyph/Rioglyph.js.map +1 -1
  57. package/components/rioglyph/RioglyphIconType.d.ts +1 -1
  58. package/components/selects/BaseSelectDropdown.d.ts +8 -0
  59. package/components/selects/BaseSelectDropdown.js +76 -60
  60. package/components/selects/BaseSelectDropdown.js.map +1 -1
  61. package/components/selects/Multiselect.d.ts +5 -0
  62. package/components/selects/Multiselect.js +60 -58
  63. package/components/selects/Multiselect.js.map +1 -1
  64. package/components/selects/Select.d.ts +5 -0
  65. package/components/selects/Select.js +60 -58
  66. package/components/selects/Select.js.map +1 -1
  67. package/components/sidebars/Sidebar.js +40 -40
  68. package/components/sidebars/Sidebar.js.map +1 -1
  69. package/components/sidebars/SidebarCloseButton.d.ts +3 -1
  70. package/components/sidebars/SidebarCloseButton.js +19 -5
  71. package/components/sidebars/SidebarCloseButton.js.map +1 -1
  72. package/components/states/CustomState.d.ts +7 -1
  73. package/components/states/CustomState.js.map +1 -1
  74. package/components/states/StateButton.d.ts +11 -1
  75. package/components/states/StateButton.js +46 -10
  76. package/components/states/StateButton.js.map +1 -1
  77. package/components/statsWidget/StatsWidgetNumber.d.ts +16 -1
  78. package/components/statsWidget/StatsWidgetNumber.js +29 -12
  79. package/components/statsWidget/StatsWidgetNumber.js.map +1 -1
  80. package/components/tabbedPanel/TabbedPanel.d.ts +99 -0
  81. package/components/tabbedPanel/TabbedPanel.js +119 -0
  82. package/components/tabbedPanel/TabbedPanel.js.map +1 -0
  83. package/components/table/Table.types.d.ts +9 -1
  84. package/components/table/TableColumn.js +20 -19
  85. package/components/table/TableColumn.js.map +1 -1
  86. package/components/table/TableHeaderColumn.d.ts +4 -0
  87. package/components/table/TableHeaderColumn.js +50 -53
  88. package/components/table/TableHeaderColumn.js.map +1 -1
  89. package/components/table/TableToolbar.d.ts +4 -0
  90. package/components/table/TableToolbar.js.map +1 -1
  91. package/components/table/TableToolbarColumn.d.ts +3 -0
  92. package/components/table/TableToolbarColumn.js.map +1 -1
  93. package/components/table/render/header/resolveHeaderCellStyle.d.ts +87 -55
  94. package/components/timepicker/TimePicker.d.ts +6 -0
  95. package/components/timepicker/TimePicker.js +57 -56
  96. package/components/timepicker/TimePicker.js.map +1 -1
  97. package/hooks/useClickOutside.js +3 -3
  98. package/hooks/useClipboard.js.map +1 -1
  99. package/hooks/useScrollPosition.js.map +1 -1
  100. package/package.json +2 -4
  101. package/themes/Volkswagen/components/applicationHeader/VolkswagenApplicationHeader.js +23 -22
  102. package/themes/Volkswagen/components/applicationHeader/VolkswagenApplicationHeader.js.map +1 -1
  103. package/utils/analytics/getTrackingLabelFromNode.d.ts +2 -0
  104. package/utils/analytics/getTrackingLabelFromNode.js +24 -0
  105. package/utils/analytics/getTrackingLabelFromNode.js.map +1 -0
  106. package/utils/analytics/googleAnalyticsUtils.js +21 -28
  107. package/utils/analytics/googleAnalyticsUtils.js.map +1 -1
  108. package/utils/getNodeTextContent.d.ts +2 -0
  109. package/utils/getNodeTextContent.js +22 -0
  110. package/utils/getNodeTextContent.js.map +1 -0
  111. package/utils/init/initCSS.js +5 -5
  112. package/utils/init/initCSS.js.map +1 -1
  113. package/utils/init/initConfig.js +4 -7
  114. package/utils/init/initConfig.js.map +1 -1
  115. package/utils/init/initDocumentBootstrapping.js +14 -14
  116. package/utils/init/initDocumentBootstrapping.js.map +1 -1
  117. package/version.d.ts +1 -1
  118. package/version.js +2 -2
  119. package/version.js.map +1 -1
@@ -1,14 +1,50 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import r from "../../utils/classNames.js";
3
- const p = (o) => {
4
- const { text: t, bsStyle: m = "primary", className: s, onClick: a = () => {
5
- }, href: e } = o;
6
- if (e)
7
- return /* @__PURE__ */ n("a", { className: r("margin-top-15", s), href: e, onClick: a, children: t });
8
- const c = r("btn", "margin-top-10", `btn-${m}`, s);
9
- return /* @__PURE__ */ n("button", { className: c, type: "button", onClick: a, children: t });
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { getAutoTrackingAttributes as b } from "../../utils/analytics/autoTracking.js";
3
+ import c from "../../utils/classNames.js";
4
+ const N = (m) => {
5
+ const {
6
+ text: o,
7
+ bsStyle: u = "primary",
8
+ className: s,
9
+ onClick: a = () => {
10
+ },
11
+ href: t,
12
+ autoTrackingKey: l,
13
+ trackingAttributes: r,
14
+ ...n
15
+ } = m, e = b({
16
+ autoTrackingKey: l,
17
+ props: { ...r, ...n },
18
+ source: t ? "link" : "button"
19
+ });
20
+ if (t)
21
+ return /* @__PURE__ */ i(
22
+ "a",
23
+ {
24
+ className: c("margin-top-15", s),
25
+ href: t,
26
+ onClick: a,
27
+ ...e,
28
+ ...r,
29
+ ...n,
30
+ children: o
31
+ }
32
+ );
33
+ const p = c("btn", "margin-top-10", `btn-${u}`, s);
34
+ return /* @__PURE__ */ i(
35
+ "button",
36
+ {
37
+ className: p,
38
+ type: "button",
39
+ onClick: a,
40
+ ...e,
41
+ ...r,
42
+ ...n,
43
+ children: o
44
+ }
45
+ );
10
46
  };
11
47
  export {
12
- p as default
48
+ N as default
13
49
  };
14
50
  //# sourceMappingURL=StateButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StateButton.js","sources":["../../../src/components/states/StateButton.tsx"],"sourcesContent":["import type React from 'react';\n\nimport classNames from '../../utils/classNames';\nimport type { BUTTON_STYLE } from '../../Button';\n\nexport type StateButtonProps = {\n /**\n * The button text.\n *\n * This can also be a node with an icon to be shown on the button.\n */\n text: string | React.ReactNode;\n\n /**\n * Callback fired after the component starts to collapse.\n *\n * @default () => {}\n */\n onClick?: VoidFunction;\n\n /**\n * Instead of a callback for the button you can specify a \"href\".\n *\n * This way it will render a link button instead.\n */\n href?: string;\n\n /**\n * The style of the button.\n *\n * @default 'primary'\n */\n bsStyle?: BUTTON_STYLE;\n\n /**\n * Additional classes assigned to the button.\n */\n className?: string;\n};\n\nconst StateButton = (props: StateButtonProps) => {\n const { text, bsStyle = 'primary', className, onClick = () => {}, href } = props;\n\n // In case a href is given, render a link instead\n if (href) {\n return (\n <a className={classNames('margin-top-15', className)} href={href} onClick={onClick}>\n {text}\n </a>\n );\n }\n\n const buttonClassNames = classNames('btn', 'margin-top-10', `btn-${bsStyle}`, className);\n\n return (\n <button className={buttonClassNames} type='button' onClick={onClick}>\n {text}\n </button>\n );\n};\n\nexport default StateButton;\n"],"names":["StateButton","props","text","bsStyle","className","onClick","href","jsx","classNames","buttonClassNames"],"mappings":";;AAwCA,MAAMA,IAAc,CAACC,MAA4B;AAC7C,QAAM,EAAE,MAAAC,GAAM,SAAAC,IAAU,WAAW,WAAAC,GAAW,SAAAC,IAAU,MAAM;AAAA,EAAC,GAAG,MAAAC,MAASL;AAG3E,MAAIK;AACA,WACI,gBAAAC,EAAC,OAAE,WAAWC,EAAW,iBAAiBJ,CAAS,GAAG,MAAAE,GAAY,SAAAD,GAC7D,UAAAH,EAAA,CACL;AAIR,QAAMO,IAAmBD,EAAW,OAAO,iBAAiB,OAAOL,CAAO,IAAIC,CAAS;AAEvF,2BACK,UAAA,EAAO,WAAWK,GAAkB,MAAK,UAAS,SAAAJ,GAC9C,UAAAH,GACL;AAER;"}
1
+ {"version":3,"file":"StateButton.js","sources":["../../../src/components/states/StateButton.tsx"],"sourcesContent":["import type React from 'react';\n\nimport { getAutoTrackingAttributes, type AutoTrackingAttributes } from '../../utils/analytics/autoTracking';\nimport classNames from '../../utils/classNames';\nimport type { BUTTON_STYLE } from '../../Button';\n\nexport type StateButtonProps = AutoTrackingAttributes & {\n /**\n * The button text.\n *\n * This can also be a node with an icon to be shown on the button.\n */\n text: string | React.ReactNode;\n\n /**\n * Callback fired after the component starts to collapse.\n *\n * @default () => {}\n */\n onClick?: VoidFunction;\n\n /**\n * Instead of a callback for the button you can specify a \"href\".\n *\n * This way it will render a link button instead.\n */\n href?: string;\n\n /**\n * The style of the button.\n *\n * @default 'primary'\n */\n bsStyle?: BUTTON_STYLE;\n\n /**\n * Additional classes assigned to the button.\n */\n className?: string;\n\n /**\n * Optional key used to generate automatic GA tracking attributes when no explicit\n * tracking attributes are provided.\n */\n autoTrackingKey?: string;\n\n /**\n * Optional tracking attributes (e.g. from `getTrackingAttributes`) added to the button or link element.\n */\n trackingAttributes?: AutoTrackingAttributes;\n};\n\nconst StateButton = (props: StateButtonProps) => {\n const {\n text,\n bsStyle = 'primary',\n className,\n onClick = () => {},\n href,\n autoTrackingKey,\n trackingAttributes,\n ...remainingProps\n } = props;\n\n const autoTrackingAttributes = getAutoTrackingAttributes({\n autoTrackingKey,\n props: { ...trackingAttributes, ...remainingProps },\n source: href ? 'link' : 'button',\n });\n\n // In case a href is given, render a link instead\n if (href) {\n return (\n <a\n className={classNames('margin-top-15', className)}\n href={href}\n onClick={onClick}\n {...autoTrackingAttributes}\n {...trackingAttributes}\n {...remainingProps}\n >\n {text}\n </a>\n );\n }\n\n const buttonClassNames = classNames('btn', 'margin-top-10', `btn-${bsStyle}`, className);\n\n return (\n <button\n className={buttonClassNames}\n type='button'\n onClick={onClick}\n {...autoTrackingAttributes}\n {...trackingAttributes}\n {...remainingProps}\n >\n {text}\n </button>\n );\n};\n\nexport default StateButton;\n"],"names":["StateButton","props","text","bsStyle","className","onClick","href","autoTrackingKey","trackingAttributes","remainingProps","autoTrackingAttributes","getAutoTrackingAttributes","jsx","classNames","buttonClassNames"],"mappings":";;;AAoDA,MAAMA,IAAc,CAACC,MAA4B;AAC7C,QAAM;AAAA,IACF,MAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,WAAAC;AAAA,IACA,SAAAC,IAAU,MAAM;AAAA,IAAC;AAAA,IACjB,MAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHR,GAEES,IAAyBC,EAA0B;AAAA,IACrD,iBAAAJ;AAAA,IACA,OAAO,EAAE,GAAGC,GAAoB,GAAGC,EAAA;AAAA,IACnC,QAAQH,IAAO,SAAS;AAAA,EAAA,CAC3B;AAGD,MAAIA;AACA,WACI,gBAAAM;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,WAAWC,EAAW,iBAAiBT,CAAS;AAAA,QAChD,MAAAE;AAAA,QACA,SAAAD;AAAA,QACC,GAAGK;AAAA,QACH,GAAGF;AAAA,QACH,GAAGC;AAAA,QAEH,UAAAP;AAAA,MAAA;AAAA,IAAA;AAKb,QAAMY,IAAmBD,EAAW,OAAO,iBAAiB,OAAOV,CAAO,IAAIC,CAAS;AAEvF,SACI,gBAAAQ;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAWE;AAAA,MACX,MAAK;AAAA,MACL,SAAAT;AAAA,MACC,GAAGK;AAAA,MACH,GAAGF;AAAA,MACH,GAAGC;AAAA,MAEH,UAAAP;AAAA,IAAA;AAAA,EAAA;AAGb;"}
@@ -1,4 +1,5 @@
1
1
  import { ReactNode, MouseEventHandler } from 'react';
2
+ export type StatsWidgetNumberLabelPosition = 'top' | 'bottom';
2
3
  export type StatsWidgetNumberProps = {
3
4
  /**
4
5
  * The value to be shown.
@@ -11,9 +12,23 @@ export type StatsWidgetNumberProps = {
11
12
  */
12
13
  total?: string | number | ReactNode;
13
14
  /**
14
- * The label shown below the number.
15
+ * The label shown next to the number.
15
16
  */
16
17
  label?: string | ReactNode;
18
+ /**
19
+ * Position of the label relative to the number.
20
+ *
21
+ * @default 'bottom'
22
+ */
23
+ labelPosition?: StatsWidgetNumberLabelPosition;
24
+ /**
25
+ * Additional class names to be added to the label element.
26
+ */
27
+ labelClassName?: string;
28
+ /**
29
+ * Additional class names to be added to the value element.
30
+ */
31
+ valueClassName?: string;
17
32
  /**
18
33
  * Defines whether the number is clickable i.e. in combination with a filter.
19
34
  *
@@ -1,17 +1,34 @@
1
- import { jsxs as t, jsx as s } from "react/jsx-runtime";
2
- import n from "../../utils/classNames.js";
3
- const b = (l) => {
4
- const { value: r = 0, total: e, label: a, className: i, clickable: c = !1, onClick: m = () => {
5
- }, ...d } = l, o = n("StatsWidgetNumber", c && "cursor-pointer", i);
6
- return /* @__PURE__ */ t("div", { ...d, onClick: m, className: o, children: [
7
- /* @__PURE__ */ t("div", { className: "StatsWidgetNumber-counter", children: [
8
- /* @__PURE__ */ s("div", { className: "StatsWidgetNumber-value", children: r }),
9
- (e || e === 0) && /* @__PURE__ */ s("div", { className: "StatsWidgetNumber-total", children: e })
10
- ] }),
11
- a && /* @__PURE__ */ s("div", { className: "StatsWidgetNumber-label", children: a })
1
+ import { jsx as a, jsxs as i } from "react/jsx-runtime";
2
+ import s from "../../utils/classNames.js";
3
+ const W = (r) => {
4
+ const {
5
+ value: m = 0,
6
+ total: e,
7
+ label: l,
8
+ labelPosition: t = "bottom",
9
+ labelClassName: c,
10
+ valueClassName: n,
11
+ className: d,
12
+ clickable: b = !1,
13
+ onClick: N = () => {
14
+ },
15
+ ...u
16
+ } = r, p = s(
17
+ "StatsWidgetNumber",
18
+ t === "top" && "label-position-top",
19
+ b && "cursor-pointer",
20
+ d
21
+ ), o = l && /* @__PURE__ */ a("div", { className: s("StatsWidgetNumber-label", c), children: l }), v = /* @__PURE__ */ i("div", { className: "StatsWidgetNumber-counter", children: [
22
+ /* @__PURE__ */ a("div", { className: s("StatsWidgetNumber-value", n), children: m }),
23
+ (e || e === 0) && /* @__PURE__ */ a("div", { className: "StatsWidgetNumber-total", children: e })
24
+ ] });
25
+ return /* @__PURE__ */ i("div", { ...u, onClick: N, className: p, children: [
26
+ t === "top" && o,
27
+ v,
28
+ t === "bottom" && o
12
29
  ] });
13
30
  };
14
31
  export {
15
- b as default
32
+ W as default
16
33
  };
17
34
  //# sourceMappingURL=StatsWidgetNumber.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StatsWidgetNumber.js","sources":["../../../src/components/statsWidget/StatsWidgetNumber.tsx"],"sourcesContent":["import type { ReactNode, MouseEventHandler } from 'react';\n\nimport classNames from '../../utils/classNames';\n\nexport type StatsWidgetNumberProps = {\n /**\n * The value to be shown.\n *\n * @default 0\n */\n value: string | number | ReactNode;\n\n /**\n * The total value to be shown i.e. in combination with an active filter.\n */\n total?: string | number | ReactNode;\n\n /**\n * The label shown below the number.\n */\n label?: string | ReactNode;\n\n /**\n * Defines whether the number is clickable i.e. in combination with a filter.\n *\n * @default false\n */\n clickable?: boolean;\n\n /**\n * Callback for when the user clicks the number widget.\n */\n onClick?: MouseEventHandler;\n\n /**\n * Additional class names to be added to the element.\n */\n className?: string;\n};\n\nconst StatsWidgetNumber = (props: StatsWidgetNumberProps) => {\n const { value = 0, total, label, className, clickable = false, onClick = () => {}, ...remainingProps } = props;\n\n const wrapperClasses = classNames('StatsWidgetNumber', clickable && 'cursor-pointer', className);\n\n return (\n <div {...remainingProps} onClick={onClick} className={wrapperClasses}>\n <div className='StatsWidgetNumber-counter'>\n <div className='StatsWidgetNumber-value'>{value}</div>\n {(total || total === 0) && <div className='StatsWidgetNumber-total'>{total}</div>}\n </div>\n {label && <div className='StatsWidgetNumber-label'>{label}</div>}\n </div>\n );\n};\n\nexport default StatsWidgetNumber;\n"],"names":["StatsWidgetNumber","props","value","total","label","className","clickable","onClick","remainingProps","wrapperClasses","classNames","jsxs","jsx"],"mappings":";;AAwCA,MAAMA,IAAoB,CAACC,MAAkC;AACzD,QAAM,EAAE,OAAAC,IAAQ,GAAG,OAAAC,GAAO,OAAAC,GAAO,WAAAC,GAAW,WAAAC,IAAY,IAAO,SAAAC,IAAU,MAAM;AAAA,EAAC,GAAG,GAAGC,EAAA,IAAmBP,GAEnGQ,IAAiBC,EAAW,qBAAqBJ,KAAa,kBAAkBD,CAAS;AAE/F,2BACK,OAAA,EAAK,GAAGG,GAAgB,SAAAD,GAAkB,WAAWE,GAClD,UAAA;AAAA,IAAA,gBAAAE,EAAC,OAAA,EAAI,WAAU,6BACX,UAAA;AAAA,MAAA,gBAAAC,EAAC,OAAA,EAAI,WAAU,2BAA2B,UAAAV,GAAM;AAAA,OAC9CC,KAASA,MAAU,wBAAO,OAAA,EAAI,WAAU,2BAA2B,UAAAA,EAAA,CAAM;AAAA,IAAA,GAC/E;AAAA,IACCC,KAAS,gBAAAQ,EAAC,OAAA,EAAI,WAAU,2BAA2B,UAAAR,EAAA,CAAM;AAAA,EAAA,GAC9D;AAER;"}
1
+ {"version":3,"file":"StatsWidgetNumber.js","sources":["../../../src/components/statsWidget/StatsWidgetNumber.tsx"],"sourcesContent":["import type { ReactNode, MouseEventHandler } from 'react';\n\nimport classNames from '../../utils/classNames';\n\nexport type StatsWidgetNumberLabelPosition = 'top' | 'bottom';\n\nexport type StatsWidgetNumberProps = {\n /**\n * The value to be shown.\n *\n * @default 0\n */\n value: string | number | ReactNode;\n\n /**\n * The total value to be shown i.e. in combination with an active filter.\n */\n total?: string | number | ReactNode;\n\n /**\n * The label shown next to the number.\n */\n label?: string | ReactNode;\n\n /**\n * Position of the label relative to the number.\n *\n * @default 'bottom'\n */\n labelPosition?: StatsWidgetNumberLabelPosition;\n\n /**\n * Additional class names to be added to the label element.\n */\n labelClassName?: string;\n\n /**\n * Additional class names to be added to the value element.\n */\n valueClassName?: string;\n\n /**\n * Defines whether the number is clickable i.e. in combination with a filter.\n *\n * @default false\n */\n clickable?: boolean;\n\n /**\n * Callback for when the user clicks the number widget.\n */\n onClick?: MouseEventHandler;\n\n /**\n * Additional class names to be added to the element.\n */\n className?: string;\n};\n\nconst StatsWidgetNumber = (props: StatsWidgetNumberProps) => {\n const {\n value = 0,\n total,\n label,\n labelPosition = 'bottom',\n labelClassName,\n valueClassName,\n className,\n clickable = false,\n onClick = () => {},\n ...remainingProps\n } = props;\n\n const wrapperClasses = classNames(\n 'StatsWidgetNumber',\n labelPosition === 'top' && 'label-position-top',\n clickable && 'cursor-pointer',\n className\n );\n\n const labelElement = label && <div className={classNames('StatsWidgetNumber-label', labelClassName)}>{label}</div>;\n\n const counterElement = (\n <div className='StatsWidgetNumber-counter'>\n <div className={classNames('StatsWidgetNumber-value', valueClassName)}>{value}</div>\n {(total || total === 0) && <div className='StatsWidgetNumber-total'>{total}</div>}\n </div>\n );\n\n return (\n <div {...remainingProps} onClick={onClick} className={wrapperClasses}>\n {labelPosition === 'top' && labelElement}\n {counterElement}\n {labelPosition === 'bottom' && labelElement}\n </div>\n );\n};\n\nexport default StatsWidgetNumber;\n"],"names":["StatsWidgetNumber","props","value","total","label","labelPosition","labelClassName","valueClassName","className","clickable","onClick","remainingProps","wrapperClasses","classNames","labelElement","jsx","counterElement","jsxs"],"mappings":";;AA2DA,MAAMA,IAAoB,CAACC,MAAkC;AACzD,QAAM;AAAA,IACF,OAAAC,IAAQ;AAAA,IACR,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,SAAAC,IAAU,MAAM;AAAA,IAAC;AAAA,IACjB,GAAGC;AAAA,EAAA,IACHV,GAEEW,IAAiBC;AAAA,IACnB;AAAA,IACAR,MAAkB,SAAS;AAAA,IAC3BI,KAAa;AAAA,IACbD;AAAA,EAAA,GAGEM,IAAeV,KAAS,gBAAAW,EAAC,OAAA,EAAI,WAAWF,EAAW,2BAA2BP,CAAc,GAAI,UAAAF,EAAA,CAAM,GAEtGY,IACF,gBAAAC,EAAC,OAAA,EAAI,WAAU,6BACX,UAAA;AAAA,IAAA,gBAAAF,EAAC,SAAI,WAAWF,EAAW,2BAA2BN,CAAc,GAAI,UAAAL,GAAM;AAAA,KAC5EC,KAASA,MAAU,wBAAO,OAAA,EAAI,WAAU,2BAA2B,UAAAA,EAAA,CAAM;AAAA,EAAA,GAC/E;AAGJ,2BACK,OAAA,EAAK,GAAGQ,GAAgB,SAAAD,GAAkB,WAAWE,GACjD,UAAA;AAAA,IAAAP,MAAkB,SAASS;AAAA,IAC3BE;AAAA,IACAX,MAAkB,YAAYS;AAAA,EAAA,GACnC;AAER;"}
@@ -0,0 +1,99 @@
1
+ import { default as React } from 'react';
2
+ export type TabbedPanelTab = {
3
+ /**
4
+ * Unique key of the tab.
5
+ */
6
+ key: string;
7
+ /**
8
+ * Title rendered inside the panel header navigation.
9
+ */
10
+ title: React.ReactNode;
11
+ /**
12
+ * Whether the tab can be selected.
13
+ *
14
+ * @default false
15
+ */
16
+ disabled?: boolean;
17
+ /**
18
+ * Additional classes to be set on the tab list item.
19
+ */
20
+ className?: string;
21
+ /**
22
+ * Additional classes to be set on this tab's content wrapper.
23
+ */
24
+ contentClassName?: string;
25
+ /**
26
+ * Content rendered inside the panel body when the tab is active.
27
+ */
28
+ content: React.ReactNode;
29
+ };
30
+ export type TabbedPanelProps = {
31
+ /**
32
+ * The selected tab key for controlled usage.
33
+ */
34
+ activeKey?: string;
35
+ /**
36
+ * The initially selected tab key for uncontrolled usage.
37
+ */
38
+ defaultActiveKey?: string;
39
+ /**
40
+ * Available tabs and their panel body content.
41
+ */
42
+ tabs: TabbedPanelTab[];
43
+ /**
44
+ * Panel style variant. TabbedPanel supports the default bordered panel and the blank panel only.
45
+ *
46
+ * @default 'default'
47
+ */
48
+ bsStyle?: 'blank' | 'default';
49
+ /**
50
+ * Body transition used when switching tabs.
51
+ *
52
+ * @default 'height-fade'
53
+ */
54
+ bodyTransition?: 'none' | 'fade' | 'height-fade';
55
+ /**
56
+ * Animation duration in seconds.
57
+ *
58
+ * @default 0.16
59
+ */
60
+ duration?: number;
61
+ /**
62
+ * Optional content rendered on the right side of the panel header.
63
+ */
64
+ headerRight?: React.ReactNode | ((activeTab: TabbedPanelTab) => React.ReactNode);
65
+ /**
66
+ * Callback called when a tab is selected.
67
+ */
68
+ onSelectTab?: (tabKey: string) => void;
69
+ /**
70
+ * Additional classes to be set on the wrapper element.
71
+ */
72
+ className?: string;
73
+ /**
74
+ * Additional classes to be set on the panel header.
75
+ */
76
+ headerClassName?: string;
77
+ /**
78
+ * Additional classes to be set on the tab navigation.
79
+ */
80
+ navClassName?: string;
81
+ /**
82
+ * Additional classes to be set on each tab link.
83
+ */
84
+ tabLinkClassName?: string;
85
+ /**
86
+ * Additional classes to be set on the panel body.
87
+ */
88
+ bodyClassName?: string;
89
+ /**
90
+ * Additional classes to be set on the active tab content wrapper.
91
+ */
92
+ activeContentClassName?: string;
93
+ /**
94
+ * Additional classes to be set on the header-right wrapper.
95
+ */
96
+ headerRightClassName?: string;
97
+ };
98
+ declare const TabbedPanel: (props: TabbedPanelProps) => import("react/jsx-runtime").JSX.Element;
99
+ export default TabbedPanel;
@@ -0,0 +1,119 @@
1
+ import { jsxs as g, jsx as a } from "react/jsx-runtime";
2
+ import { useId as Z, useState as k } from "react";
3
+ import { useReducedMotion as _, motion as u, AnimatePresence as C } from "motion/react";
4
+ import { noop as ee } from "es-toolkit/function";
5
+ import r from "../../utils/classNames.js";
6
+ import { mergeClassNameOverrides as c } from "../../utils/mergeClassNameOverrides.js";
7
+ import ae from "../../hooks/useResizeObserver.js";
8
+ const A = (t) => t.find((s) => !s.disabled) ?? t[0], re = (t) => {
9
+ const {
10
+ activeKey: s,
11
+ defaultActiveKey: T,
12
+ tabs: l,
13
+ bsStyle: $ = "default",
14
+ bodyTransition: x = "height-fade",
15
+ duration: m = 0.16,
16
+ headerRight: y,
17
+ onSelectTab: B = ee,
18
+ className: R,
19
+ headerClassName: K,
20
+ navClassName: w,
21
+ tabLinkClassName: I,
22
+ bodyClassName: S,
23
+ activeContentClassName: D,
24
+ headerRightClassName: j,
25
+ ...P
26
+ } = t, o = Z(), z = _(), [E, , { blockSize: H }] = ae(), [L, N] = k(!1), [M, O] = k(T ?? A(l)?.key), F = s ?? M, n = l.find((e) => e.key === F) ?? A(l), p = z ? "none" : x, b = (e) => {
27
+ e.disabled || e.key === n?.key || (s === void 0 && O(e.key), B(e.key));
28
+ }, q = (e, i) => {
29
+ i.preventDefault(), b(e);
30
+ }, G = (e, i) => {
31
+ (i.key === "Enter" || i.key === " ") && (i.preventDefault(), b(e));
32
+ }, J = c(`tabbed-panel panel panel-${$} margin-bottom-20`, R), Q = c(
33
+ "panel-heading display-flex align-items-center justify-content-between gap-15 padding-0 margin-bottom-0",
34
+ K
35
+ ), h = r("panel-body", S), U = c("nav nav-pills align-items-end margin-0 shadow-none", w), V = c("padding-right-10", j), W = r(D, n?.contentClassName);
36
+ let d = null;
37
+ typeof y == "function" ? d = n ? y(n) : null : d = y;
38
+ const f = () => /* @__PURE__ */ a(
39
+ "div",
40
+ {
41
+ className: W,
42
+ role: "tabpanel",
43
+ id: `${o}-${n?.key}-panel`,
44
+ "aria-labelledby": `${o}-${n?.key}-tab`,
45
+ children: n?.content
46
+ }
47
+ ), X = () => p === "none" ? /* @__PURE__ */ a("div", { className: h, children: f() }) : p === "height-fade" ? /* @__PURE__ */ a("div", { className: h, children: /* @__PURE__ */ a(
48
+ u.div,
49
+ {
50
+ initial: !1,
51
+ animate: { height: H ?? "auto" },
52
+ className: r(L && "overflow-hidden"),
53
+ transition: { duration: m },
54
+ onAnimationStart: () => N(!0),
55
+ onAnimationComplete: () => N(!1),
56
+ children: /* @__PURE__ */ a("div", { ref: E, children: /* @__PURE__ */ a(C, { initial: !1, mode: "popLayout", children: /* @__PURE__ */ a(
57
+ u.div,
58
+ {
59
+ initial: { opacity: 0 },
60
+ animate: { opacity: 1 },
61
+ exit: { opacity: 0 },
62
+ transition: { duration: m },
63
+ children: f()
64
+ },
65
+ n?.key
66
+ ) }) })
67
+ }
68
+ ) }) : p === "fade" ? /* @__PURE__ */ a("div", { className: h, children: /* @__PURE__ */ a(C, { initial: !1, mode: "wait", children: /* @__PURE__ */ a(
69
+ u.div,
70
+ {
71
+ transition: { duration: m },
72
+ initial: { opacity: 0 },
73
+ animate: { opacity: 1 },
74
+ exit: { opacity: 0 },
75
+ children: f()
76
+ },
77
+ n?.key
78
+ ) }) }) : null;
79
+ return /* @__PURE__ */ g("div", { ...P, className: J, children: [
80
+ /* @__PURE__ */ g("div", { className: Q, children: [
81
+ /* @__PURE__ */ a("ul", { className: U, role: "tablist", children: l.map((e) => {
82
+ const i = e.key === n?.key, Y = `${o}-${e.key}-tab`;
83
+ return /* @__PURE__ */ a(
84
+ "li",
85
+ {
86
+ className: r(
87
+ i && "active text-medium",
88
+ e.disabled && "disabled",
89
+ e.className
90
+ ),
91
+ role: "presentation",
92
+ children: /* @__PURE__ */ a(
93
+ "span",
94
+ {
95
+ id: Y,
96
+ role: "tab",
97
+ "aria-selected": i,
98
+ "aria-controls": `${o}-${e.key}-panel`,
99
+ "aria-disabled": e.disabled,
100
+ tabIndex: e.disabled ? -1 : 0,
101
+ className: I,
102
+ onClick: (v) => q(e, v),
103
+ onKeyDown: (v) => G(e, v),
104
+ children: e.title
105
+ }
106
+ )
107
+ },
108
+ e.key
109
+ );
110
+ }) }),
111
+ d && /* @__PURE__ */ a("div", { className: V, children: d })
112
+ ] }),
113
+ X()
114
+ ] });
115
+ };
116
+ export {
117
+ re as default
118
+ };
119
+ //# sourceMappingURL=TabbedPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabbedPanel.js","sources":["../../../src/components/tabbedPanel/TabbedPanel.tsx"],"sourcesContent":["import type React from 'react';\nimport { useId, useState } from 'react';\nimport { AnimatePresence, motion, useReducedMotion } from 'motion/react';\nimport { noop } from 'es-toolkit/function';\n\nimport classNames from '../../utils/classNames';\nimport { mergeClassNameOverrides } from '../../utils/mergeClassNameOverrides';\nimport useResizeObserver from '../../hooks/useResizeObserver';\n\nexport type TabbedPanelTab = {\n /**\n * Unique key of the tab.\n */\n key: string;\n\n /**\n * Title rendered inside the panel header navigation.\n */\n title: React.ReactNode;\n\n /**\n * Whether the tab can be selected.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Additional classes to be set on the tab list item.\n */\n className?: string;\n\n /**\n * Additional classes to be set on this tab's content wrapper.\n */\n contentClassName?: string;\n\n /**\n * Content rendered inside the panel body when the tab is active.\n */\n content: React.ReactNode;\n};\n\nexport type TabbedPanelProps = {\n /**\n * The selected tab key for controlled usage.\n */\n activeKey?: string;\n\n /**\n * The initially selected tab key for uncontrolled usage.\n */\n defaultActiveKey?: string;\n\n /**\n * Available tabs and their panel body content.\n */\n tabs: TabbedPanelTab[];\n\n /**\n * Panel style variant. TabbedPanel supports the default bordered panel and the blank panel only.\n *\n * @default 'default'\n */\n bsStyle?: 'blank' | 'default';\n\n /**\n * Body transition used when switching tabs.\n *\n * @default 'height-fade'\n */\n bodyTransition?: 'none' | 'fade' | 'height-fade';\n\n /**\n * Animation duration in seconds.\n *\n * @default 0.16\n */\n duration?: number;\n\n /**\n * Optional content rendered on the right side of the panel header.\n */\n headerRight?: React.ReactNode | ((activeTab: TabbedPanelTab) => React.ReactNode);\n\n /**\n * Callback called when a tab is selected.\n */\n onSelectTab?: (tabKey: string) => void;\n\n /**\n * Additional classes to be set on the wrapper element.\n */\n className?: string;\n\n /**\n * Additional classes to be set on the panel header.\n */\n headerClassName?: string;\n\n /**\n * Additional classes to be set on the tab navigation.\n */\n navClassName?: string;\n\n /**\n * Additional classes to be set on each tab link.\n */\n tabLinkClassName?: string;\n\n /**\n * Additional classes to be set on the panel body.\n */\n bodyClassName?: string;\n\n /**\n * Additional classes to be set on the active tab content wrapper.\n */\n activeContentClassName?: string;\n\n /**\n * Additional classes to be set on the header-right wrapper.\n */\n headerRightClassName?: string;\n};\n\nconst getFirstEnabledTab = (tabs: TabbedPanelTab[]) => tabs.find(tab => !tab.disabled) ?? tabs[0];\n\nconst TabbedPanel = (props: TabbedPanelProps) => {\n const {\n activeKey,\n defaultActiveKey,\n tabs,\n bsStyle = 'default',\n bodyTransition = 'height-fade',\n duration = 0.16,\n headerRight,\n onSelectTab = noop,\n className,\n headerClassName,\n navClassName,\n tabLinkClassName,\n bodyClassName,\n activeContentClassName,\n headerRightClassName,\n ...remainingProps\n } = props;\n\n const componentId = useId();\n const shouldReduceMotion = useReducedMotion();\n\n const [activeBodyRef, , { blockSize: activeBodyHeight }] = useResizeObserver<HTMLDivElement>();\n\n const [isBodyAnimating, setIsBodyAnimating] = useState(false);\n const [internalActiveKey, setInternalActiveKey] = useState(defaultActiveKey ?? getFirstEnabledTab(tabs)?.key);\n\n const selectedKey = activeKey ?? internalActiveKey;\n const activeTab = tabs.find(tab => tab.key === selectedKey) ?? getFirstEnabledTab(tabs);\n const effectiveBodyTransition = shouldReduceMotion ? 'none' : bodyTransition;\n\n const selectTab = (tab: TabbedPanelTab) => {\n if (tab.disabled || tab.key === activeTab?.key) {\n return;\n }\n\n if (activeKey === undefined) {\n setInternalActiveKey(tab.key);\n }\n\n onSelectTab(tab.key);\n };\n\n const handleSelectTab = (tab: TabbedPanelTab, event: React.MouseEvent<HTMLElement>) => {\n event.preventDefault();\n selectTab(tab);\n };\n\n const handleTabKeyDown = (tab: TabbedPanelTab, event: React.KeyboardEvent<HTMLElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n selectTab(tab);\n }\n };\n\n const panelClassNames = mergeClassNameOverrides(`tabbed-panel panel panel-${bsStyle} margin-bottom-20`, className);\n\n const headerClassNames = mergeClassNameOverrides(\n 'panel-heading display-flex align-items-center justify-content-between gap-15 padding-0 margin-bottom-0',\n headerClassName\n );\n\n const panelBodyClassNames = classNames('panel-body', bodyClassName);\n\n const navClassNames = mergeClassNameOverrides('nav nav-pills align-items-end margin-0 shadow-none', navClassName);\n const headerRightClassNames = mergeClassNameOverrides('padding-right-10', headerRightClassName);\n\n const activeContentClassNames = classNames(activeContentClassName, activeTab?.contentClassName);\n\n let renderedHeaderRight: React.ReactNode = null;\n\n if (typeof headerRight === 'function') {\n renderedHeaderRight = activeTab ? headerRight(activeTab) : null;\n } else {\n renderedHeaderRight = headerRight;\n }\n\n const renderBodyContent = () => (\n <div\n className={activeContentClassNames}\n role='tabpanel'\n id={`${componentId}-${activeTab?.key}-panel`}\n aria-labelledby={`${componentId}-${activeTab?.key}-tab`}\n >\n {activeTab?.content}\n </div>\n );\n\n const renderBody = () => {\n if (effectiveBodyTransition === 'none') {\n return <div className={panelBodyClassNames}>{renderBodyContent()}</div>;\n }\n\n if (effectiveBodyTransition === 'height-fade') {\n return (\n <div className={panelBodyClassNames}>\n <motion.div\n initial={false}\n animate={{ height: activeBodyHeight ?? 'auto' }}\n className={classNames(isBodyAnimating && 'overflow-hidden')}\n transition={{ duration }}\n onAnimationStart={() => setIsBodyAnimating(true)}\n onAnimationComplete={() => setIsBodyAnimating(false)}\n >\n <div ref={activeBodyRef}>\n <AnimatePresence initial={false} mode='popLayout'>\n <motion.div\n key={activeTab?.key}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration }}\n >\n {renderBodyContent()}\n </motion.div>\n </AnimatePresence>\n </div>\n </motion.div>\n </div>\n );\n }\n\n if (effectiveBodyTransition === 'fade') {\n return (\n <div className={panelBodyClassNames}>\n <AnimatePresence initial={false} mode='wait'>\n <motion.div\n key={activeTab?.key}\n transition={{ duration }}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n >\n {renderBodyContent()}\n </motion.div>\n </AnimatePresence>\n </div>\n );\n }\n\n return null;\n };\n\n return (\n <div {...remainingProps} className={panelClassNames}>\n <div className={headerClassNames}>\n <ul className={navClassNames} role='tablist'>\n {tabs.map(tab => {\n const isActive = tab.key === activeTab?.key;\n const tabId = `${componentId}-${tab.key}-tab`;\n\n return (\n <li\n key={tab.key}\n className={classNames(\n isActive && 'active text-medium',\n tab.disabled && 'disabled',\n tab.className\n )}\n role='presentation'\n >\n <span\n id={tabId}\n role='tab'\n aria-selected={isActive}\n aria-controls={`${componentId}-${tab.key}-panel`}\n aria-disabled={tab.disabled}\n tabIndex={tab.disabled ? -1 : 0}\n className={tabLinkClassName}\n onClick={event => handleSelectTab(tab, event)}\n onKeyDown={event => handleTabKeyDown(tab, event)}\n >\n {tab.title}\n </span>\n </li>\n );\n })}\n </ul>\n {renderedHeaderRight && <div className={headerRightClassNames}>{renderedHeaderRight}</div>}\n </div>\n {renderBody()}\n </div>\n );\n};\n\nexport default TabbedPanel;\n"],"names":["getFirstEnabledTab","tabs","tab","TabbedPanel","props","activeKey","defaultActiveKey","bsStyle","bodyTransition","duration","headerRight","onSelectTab","noop","className","headerClassName","navClassName","tabLinkClassName","bodyClassName","activeContentClassName","headerRightClassName","remainingProps","componentId","useId","shouldReduceMotion","useReducedMotion","activeBodyRef","activeBodyHeight","useResizeObserver","isBodyAnimating","setIsBodyAnimating","useState","internalActiveKey","setInternalActiveKey","selectedKey","activeTab","effectiveBodyTransition","selectTab","handleSelectTab","event","handleTabKeyDown","panelClassNames","mergeClassNameOverrides","headerClassNames","panelBodyClassNames","classNames","navClassNames","headerRightClassNames","activeContentClassNames","renderedHeaderRight","renderBodyContent","jsx","renderBody","motion","AnimatePresence","jsxs","isActive","tabId"],"mappings":";;;;;;;AA8HA,MAAMA,IAAqB,CAACC,MAA2BA,EAAK,KAAK,CAAAC,MAAO,CAACA,EAAI,QAAQ,KAAKD,EAAK,CAAC,GAE1F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AAI,WAAW,KAAK;AAAA,gBAC9B,WAAWc;AAAA,gBACX,SAAS,CAAAsB,MAASD,EAAgBnC,GAAKoC,CAAK;AAAA,gBAC5C,WAAW,CAAAA,MAASC,EAAiBrC,GAAKoC,CAAK;AAAA,gBAE9C,UAAApC,EAAI;AAAA,cAAA;AAAA,YAAA;AAAA,UACT;AAAA,UApBKA,EAAI;AAAA,QAAA;AAAA,MAuBrB,CAAC,EAAA,CACL;AAAA,MACC8C,KAAuB,gBAAAE,EAAC,OAAA,EAAI,WAAWJ,GAAwB,UAAAE,EAAA,CAAoB;AAAA,IAAA,GACxF;AAAA,IACCG,EAAA;AAAA,EAAW,GAChB;AAER;"}
@@ -142,6 +142,10 @@ export type TableColumnDefinition<RowType extends TableRowData> = {
142
142
  /**
143
143
  * Enables resize handles for this column in `TABLE` view.
144
144
  *
145
+ * Resize handles can look like vertical separators in the table header. Use `resizeable` when a design
146
+ * shows header-only vertical handles between columns, especially when body rows do not show vertical
147
+ * grid lines.
148
+ *
145
149
  * When `onColumnResize` is provided, resized widths are controlled from the outside.
146
150
  * When it is omitted, the table keeps resized widths internally.
147
151
  *
@@ -261,7 +265,11 @@ export type TableProps<RowType extends TableRowData> = Omit<HTMLAttributes<HTMLD
261
265
  */
262
266
  rounded?: boolean;
263
267
  /**
264
- * Show vertical and header row grid lines.
268
+ * Show table grid separators through the header and body.
269
+ *
270
+ * Do not use `gridLines` only to reproduce header-only vertical divider or handle lines.
271
+ * If a design shows vertical separators only in the header while body rows do not show vertical
272
+ * grid lines, use `TableHeaderColumn` `resizeable` and optionally `onColumnResize` instead.
265
273
  *
266
274
  * @default false
267
275
  */
@@ -1,14 +1,15 @@
1
1
  import { jsx as b, jsxs as j } from "react/jsx-runtime";
2
2
  import c from "../../utils/classNames.js";
3
- import { getVerticalAlignClassName as I, getHorizontalAlignClassName as L } from "./shared/getAlignClassName.js";
4
- import T from "./shared/getCellContentOverflowClassName.js";
5
- import { resolveAriaSpan as H, resolveAriaColIndex as D } from "./shared/resolveTableAria.js";
6
- import { useOptionalTableInteractionContext as P } from "./context/TableInteractionContext.js";
7
- import { useOptionalTableLayoutContext as $ } from "./context/TableLayoutContext.js";
8
- import { useOptionalTableRenderConfigContext as q } from "./context/TableRenderConfigContext.js";
9
- import { useOptionalTableSection as E, useTableRowContext as G } from "./context/TableStructureContext.js";
10
- import { useOptionalTableRenderContext as J } from "./context/TableRenderContext.js";
11
- const ne = (F) => {
3
+ import { getNodeTextContent as H } from "../../utils/getNodeTextContent.js";
4
+ import { getVerticalAlignClassName as T, getHorizontalAlignClassName as I } from "./shared/getAlignClassName.js";
5
+ import L from "./shared/getCellContentOverflowClassName.js";
6
+ import { resolveAriaSpan as P, resolveAriaColIndex as D } from "./shared/resolveTableAria.js";
7
+ import { useOptionalTableInteractionContext as $ } from "./context/TableInteractionContext.js";
8
+ import { useOptionalTableLayoutContext as q } from "./context/TableLayoutContext.js";
9
+ import { useOptionalTableRenderConfigContext as E } from "./context/TableRenderConfigContext.js";
10
+ import { useOptionalTableSection as G, useTableRowContext as J } from "./context/TableStructureContext.js";
11
+ import { useOptionalTableRenderContext as Q } from "./context/TableRenderContext.js";
12
+ const ae = (F) => {
12
13
  const {
13
14
  children: f,
14
15
  className: g,
@@ -20,7 +21,7 @@ const ne = (F) => {
20
21
  value: p,
21
22
  verticalAlign: W,
22
23
  ...x
23
- } = F, n = q(), o = J(), d = P(), i = $(), v = E(), a = G(), s = v === "body", r = v === "footer";
24
+ } = F, n = E(), o = Q(), d = $(), i = q(), v = G(), a = J(), s = v === "body", r = v === "footer";
24
25
  if (!o || !n || !d || !i || o.columns.length === 0 || !s && !r || s && !a)
25
26
  return null;
26
27
  const N = t !== void 0 ? o.columnIndexByKey.get(t) : void 0, u = a?.nextColumnIndex(N, h) ?? N ?? -1;
@@ -47,7 +48,7 @@ const ne = (F) => {
47
48
  },
48
49
  a.rowIndex,
49
50
  u
50
- ), z = i.stickyLeftColumnCount ?? 0, A = i.stickyRightColumnCount ?? 0, R = z > 0 && l <= z, O = A > 0 && l > o.columns.length - A, K = e?.mobileLabel ?? (typeof e?.label == "string" ? e.label : ""), C = (V) => {
51
+ ), z = i.stickyLeftColumnCount ?? 0, A = i.stickyRightColumnCount ?? 0, R = z > 0 && l <= z, O = A > 0 && l > o.columns.length - A, K = e?.mobileLabel ?? H(e?.label) ?? "", C = (V) => {
51
52
  V.stopPropagation();
52
53
  };
53
54
  return r && (o.renderDraft.hasFooterCells = !0), n.isTableView ? /* @__PURE__ */ b(
@@ -61,8 +62,8 @@ const ne = (F) => {
61
62
  s && O && "table-cell-sticky-right-column",
62
63
  r && i.stickyFooter && R && "table-footer-cell-sticky-left-column",
63
64
  r && i.stickyFooter && O && "table-footer-cell-sticky-right-column",
64
- L(w),
65
- I(k),
65
+ I(w),
66
+ T(k),
66
67
  e?.hideOnMobile && "table-hide-mobile",
67
68
  S,
68
69
  g
@@ -70,11 +71,11 @@ const ne = (F) => {
70
71
  "data-column": e?.columnKey ?? t ?? l,
71
72
  role: "cell",
72
73
  "aria-colindex": D(l, d.showSelectionColumn),
73
- "aria-colspan": H(h),
74
+ "aria-colspan": P(h),
74
75
  onClick: m ? C : void 0,
75
76
  onKeyDown: m ? C : void 0,
76
77
  style: { gridColumn: `${B} / span ${h}`, gridRow: "1 / span 1" },
77
- children: /* @__PURE__ */ b("div", { className: c("table-cell-content", T(y)), children: p ?? f ?? "" })
78
+ children: /* @__PURE__ */ b("div", { className: c("table-cell-content", L(y)), children: p ?? f ?? "" })
78
79
  }
79
80
  ) : /* @__PURE__ */ j(
80
81
  "div",
@@ -83,8 +84,8 @@ const ne = (F) => {
83
84
  className: c(
84
85
  "table-cell",
85
86
  n.cardClasses.cellClassName,
86
- L(w),
87
- I(k),
87
+ I(w),
88
+ T(k),
88
89
  e?.hideOnMobile && "table-hide-mobile",
89
90
  S,
90
91
  g
@@ -102,7 +103,7 @@ const ne = (F) => {
102
103
  className: c(
103
104
  "table-cell-content",
104
105
  n.cardClasses.contentClassName,
105
- T(y)
106
+ L(y)
106
107
  ),
107
108
  children: p ?? f ?? ""
108
109
  }
@@ -112,6 +113,6 @@ const ne = (F) => {
112
113
  );
113
114
  };
114
115
  export {
115
- ne as default
116
+ ae as default
116
117
  };
117
118
  //# sourceMappingURL=TableColumn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableColumn.js","sources":["../../../src/components/table/TableColumn.tsx"],"sourcesContent":["import type { KeyboardEvent, MouseEvent, ReactNode } from 'react';\n\nimport classNames from '../../utils/classNames';\nimport { getHorizontalAlignClassName, getVerticalAlignClassName } from './shared/getAlignClassName';\nimport getCellContentOverflowClassName from './shared/getCellContentOverflowClassName';\nimport { resolveAriaColIndex, resolveAriaSpan } from './shared/resolveTableAria';\nimport type { TableCellOverflow, TableHorizontalAlign, TableHtmlAttributes, TableVerticalAlign } from './Table.types';\nimport { useOptionalTableInteractionContext } from './context/TableInteractionContext';\nimport { useOptionalTableLayoutContext } from './context/TableLayoutContext';\nimport { useOptionalTableRenderConfigContext } from './context/TableRenderConfigContext';\nimport { useOptionalTableSection, useTableRowContext } from './context/TableStructureContext';\nimport { useOptionalTableRenderContext } from './context/TableRenderContext';\n\nexport type TableColumnProps = TableHtmlAttributes & {\n /**\n * `TableColumn` may be rendered directly inside `TableFooter`.\n *\n * In `TableBody`, columns must be rendered inside a row component such as\n * `TableRow` or `TableExpandedRow`. Direct `TableColumn` children of\n * `TableBody` are ignored.\n */\n children?: ReactNode;\n\n /**\n * Optional explicit column key.\n *\n * In `TableBody`, this should usually match the `columnKey` of the corresponding\n * `TableHeaderColumn` for the same data column. If omitted, the cell is matched by its position inside\n * the current row.\n *\n * Position-based matching is mainly useful for simple rows that mirror the header\n * order exactly. For spanned cells, reordered columns, or more complex row layouts,\n * prefer an explicit `columnKey`.\n */\n columnKey?: string;\n\n /**\n * Optional explicit value.\n */\n value?: ReactNode;\n\n /**\n * Additional classes for this cell only.\n */\n className?: string;\n\n /**\n * Horizontal alignment override for this cell.\n */\n horizontalAlign?: TableHorizontalAlign;\n\n /**\n * Vertical alignment override for this cell.\n */\n verticalAlign?: TableVerticalAlign;\n\n /**\n * Overflow behavior for the cell content wrapper.\n *\n * @default 'hidden'\n */\n overflow?: TableCellOverflow;\n\n /**\n * Number of columns this cell should span.\n *\n * Currently used by header and footer-style declarative table sections.\n */\n colSpan?: number;\n\n /**\n * Prevents clicks and keyboard interactions inside this cell from triggering the parent row click handler.\n *\n * Useful for interactive cell content such as dropdowns, inputs, or buttons.\n *\n * @default false\n */\n preventRowClick?: boolean;\n};\n\nconst TableColumn = (props: TableColumnProps) => {\n const {\n children,\n className,\n colSpan = 1,\n columnKey,\n horizontalAlign,\n overflow = 'hidden',\n preventRowClick = false,\n value,\n verticalAlign,\n ...remainingProps\n } = props;\n\n const renderConfigContext = useOptionalTableRenderConfigContext();\n const renderContext = useOptionalTableRenderContext();\n const interactionContext = useOptionalTableInteractionContext();\n const layoutContext = useOptionalTableLayoutContext();\n const section = useOptionalTableSection();\n const rowContext = useTableRowContext();\n\n const isBodySection = section === 'body';\n const isFooterSection = section === 'footer';\n\n if (\n !renderContext ||\n !renderConfigContext ||\n !interactionContext ||\n !layoutContext ||\n renderContext.columns.length === 0 ||\n (!isBodySection && !isFooterSection)\n ) {\n return null;\n }\n\n if (isBodySection && !rowContext) {\n return null;\n }\n\n const explicitColumnIndex = columnKey !== undefined ? renderContext.columnIndexByKey.get(columnKey) : undefined;\n const columnIndex = rowContext?.nextColumnIndex(explicitColumnIndex, colSpan) ?? explicitColumnIndex ?? -1;\n\n if (columnIndex < 0) {\n return null;\n }\n\n const renderColumn = renderContext.columns[columnIndex];\n const baseColumnStart = columnIndex + 1;\n const resolvedColumnStart = baseColumnStart + (interactionContext.showSelectionColumn ? 1 : 0);\n const resolvedHorizontalAlign = horizontalAlign ?? renderColumn?.horizontalAlign;\n const resolvedVerticalAlign = verticalAlign ?? renderColumn?.verticalAlign;\n\n const resolvedCellClassName =\n isBodySection &&\n rowContext?.rowData &&\n renderConfigContext.cellClassName?.(\n rowContext.rowData,\n renderContext.columnDefinitionsByKey.get(renderColumn?.columnKey ?? columnKey ?? '') ?? {\n key: renderColumn?.columnKey ?? columnKey ?? String(baseColumnStart),\n label: renderColumn?.label ?? '',\n icon: renderColumn?.icon,\n filter: renderColumn?.filter,\n hideLabel: renderColumn?.hideLabel,\n width: renderColumn?.width,\n minResizeWidth: renderColumn?.minResizeWidth,\n maxResizeWidth: renderColumn?.maxResizeWidth,\n draggable: renderColumn?.draggable,\n resizeable: renderColumn?.resizeable,\n horizontalAlign: renderColumn?.horizontalAlign,\n className: undefined,\n headerClassName: renderColumn?.headerClassName,\n hideOnMobile: renderColumn?.hideOnMobile,\n sortable: renderColumn?.sortable,\n },\n rowContext.rowIndex,\n columnIndex\n );\n\n const stickyLeftColumns = layoutContext.stickyLeftColumnCount ?? 0;\n const stickyRightColumns = layoutContext.stickyRightColumnCount ?? 0;\n const isStickyLeftColumn = stickyLeftColumns > 0 && baseColumnStart <= stickyLeftColumns;\n const isStickyRightColumn =\n stickyRightColumns > 0 && baseColumnStart > renderContext.columns.length - stickyRightColumns;\n\n const mobileLabel =\n renderColumn?.mobileLabel ?? (typeof renderColumn?.label === 'string' ? renderColumn.label : '');\n\n const handleCellInteraction = (event: KeyboardEvent<HTMLDivElement> | MouseEvent<HTMLDivElement>) => {\n event.stopPropagation();\n };\n\n if (isFooterSection) {\n renderContext.renderDraft.hasFooterCells = true;\n }\n\n if (renderConfigContext.isTableView) {\n return (\n <div\n {...remainingProps}\n className={classNames(\n 'table-cell',\n isFooterSection && 'table-footer-cell',\n isBodySection && isStickyLeftColumn && 'table-cell-sticky-left-column',\n isBodySection && isStickyRightColumn && 'table-cell-sticky-right-column',\n isFooterSection &&\n layoutContext.stickyFooter &&\n isStickyLeftColumn &&\n 'table-footer-cell-sticky-left-column',\n isFooterSection &&\n layoutContext.stickyFooter &&\n isStickyRightColumn &&\n 'table-footer-cell-sticky-right-column',\n getHorizontalAlignClassName(resolvedHorizontalAlign),\n getVerticalAlignClassName(resolvedVerticalAlign),\n renderColumn?.hideOnMobile && 'table-hide-mobile',\n resolvedCellClassName,\n className\n )}\n data-column={renderColumn?.columnKey ?? columnKey ?? baseColumnStart}\n role='cell'\n aria-colindex={resolveAriaColIndex(baseColumnStart, interactionContext.showSelectionColumn)}\n aria-colspan={resolveAriaSpan(colSpan)}\n onClick={preventRowClick ? handleCellInteraction : undefined}\n onKeyDown={preventRowClick ? handleCellInteraction : undefined}\n style={{ gridColumn: `${resolvedColumnStart} / span ${colSpan}`, gridRow: '1 / span 1' }}\n >\n <div className={classNames('table-cell-content', getCellContentOverflowClassName(overflow))}>\n {value ?? children ?? ''}\n </div>\n </div>\n );\n }\n\n return (\n <div\n {...remainingProps}\n className={classNames(\n 'table-cell',\n renderConfigContext.cardClasses.cellClassName,\n getHorizontalAlignClassName(resolvedHorizontalAlign),\n getVerticalAlignClassName(resolvedVerticalAlign),\n renderColumn?.hideOnMobile && 'table-hide-mobile',\n resolvedCellClassName,\n className\n )}\n data-column={renderColumn?.columnKey ?? columnKey ?? baseColumnStart}\n role='cell'\n aria-colindex={resolveAriaColIndex(baseColumnStart, interactionContext.showSelectionColumn)}\n onClick={preventRowClick ? handleCellInteraction : undefined}\n onKeyDown={preventRowClick ? handleCellInteraction : undefined}\n >\n {mobileLabel && (\n <div className={classNames('table-cell-label', renderConfigContext.cardClasses.labelClassName)}>\n {mobileLabel}\n </div>\n )}\n <div\n className={classNames(\n 'table-cell-content',\n renderConfigContext.cardClasses.contentClassName,\n getCellContentOverflowClassName(overflow)\n )}\n >\n {value ?? children ?? ''}\n </div>\n </div>\n );\n};\n\nexport default TableColumn;\n"],"names":["TableColumn","props","children","className","colSpan","columnKey","horizontalAlign","overflow","preventRowClick","value","verticalAlign","remainingProps","renderConfigContext","useOptionalTableRenderConfigContext","renderContext","useOptionalTableRenderContext","interactionContext","useOptionalTableInteractionContext","layoutContext","useOptionalTableLayoutContext","section","useOptionalTableSection","rowContext","useTableRowContext","isBodySection","isFooterSection","explicitColumnIndex","columnIndex","renderColumn","baseColumnStart","resolvedColumnStart","resolvedHorizontalAlign","resolvedVerticalAlign","resolvedCellClassName","stickyLeftColumns","stickyRightColumns","isStickyLeftColumn","isStickyRightColumn","mobileLabel","handleCellInteraction","event","jsx","classNames","getHorizontalAlignClassName","getVerticalAlignClassName","resolveAriaColIndex","resolveAriaSpan","getCellContentOverflowClassName","jsxs"],"mappings":";;;;;;;;;;AAgFA,MAAMA,KAAc,CAACC,MAA4B;AAC7C,QAAM;AAAA,IACF,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,WAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,iBAAAC,IAAkB;AAAA,IAClB,OAAAC;AAAA,IACA,eAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHV,GAEEW,IAAsBC,EAAA,GACtBC,IAAgBC,EAAA,GAChBC,IAAqBC,EAAA,GACrBC,IAAgBC,EAAA,GAChBC,IAAUC,EAAA,GACVC,IAAaC,EAAA,GAEbC,IAAgBJ,MAAY,QAC5BK,IAAkBL,MAAY;AAapC,MAVI,CAACN,KACD,CAACF,KACD,CAACI,KACD,CAACE,KACDJ,EAAc,QAAQ,WAAW,KAChC,CAACU,KAAiB,CAACC,KAKpBD,KAAiB,CAACF;AAClB,WAAO;AAGX,QAAMI,IAAsBrB,MAAc,SAAYS,EAAc,iBAAiB,IAAIT,CAAS,IAAI,QAChGsB,IAAcL,GAAY,gBAAgBI,GAAqBtB,CAAO,KAAKsB,KAAuB;AAExG,MAAIC,IAAc;AACd,WAAO;AAGX,QAAMC,IAAed,EAAc,QAAQa,CAAW,GAChDE,IAAkBF,IAAc,GAChCG,IAAsBD,KAAmBb,EAAmB,sBAAsB,IAAI,IACtFe,IAA0BzB,KAAmBsB,GAAc,iBAC3DI,IAAwBtB,KAAiBkB,GAAc,eAEvDK,IACFT,KACAF,GAAY,WACZV,EAAoB;AAAA,IA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AAY;AAAA,UAAA;AAAA,QAAA;AAAA,MAC1B;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
1
+ {"version":3,"file":"TableColumn.js","sources":["../../../src/components/table/TableColumn.tsx"],"sourcesContent":["import type { KeyboardEvent, MouseEvent, ReactNode } from 'react';\n\nimport classNames from '../../utils/classNames';\nimport { getNodeTextContent } from '../../utils/getNodeTextContent';\nimport { getHorizontalAlignClassName, getVerticalAlignClassName } from './shared/getAlignClassName';\nimport getCellContentOverflowClassName from './shared/getCellContentOverflowClassName';\nimport { resolveAriaColIndex, resolveAriaSpan } from './shared/resolveTableAria';\nimport type { TableCellOverflow, TableHorizontalAlign, TableHtmlAttributes, TableVerticalAlign } from './Table.types';\nimport { useOptionalTableInteractionContext } from './context/TableInteractionContext';\nimport { useOptionalTableLayoutContext } from './context/TableLayoutContext';\nimport { useOptionalTableRenderConfigContext } from './context/TableRenderConfigContext';\nimport { useOptionalTableSection, useTableRowContext } from './context/TableStructureContext';\nimport { useOptionalTableRenderContext } from './context/TableRenderContext';\n\nexport type TableColumnProps = TableHtmlAttributes & {\n /**\n * `TableColumn` may be rendered directly inside `TableFooter`.\n *\n * In `TableBody`, columns must be rendered inside a row component such as\n * `TableRow` or `TableExpandedRow`. Direct `TableColumn` children of\n * `TableBody` are ignored.\n */\n children?: ReactNode;\n\n /**\n * Optional explicit column key.\n *\n * In `TableBody`, this should usually match the `columnKey` of the corresponding\n * `TableHeaderColumn` for the same data column. If omitted, the cell is matched by its position inside\n * the current row.\n *\n * Position-based matching is mainly useful for simple rows that mirror the header\n * order exactly. For spanned cells, reordered columns, or more complex row layouts,\n * prefer an explicit `columnKey`.\n */\n columnKey?: string;\n\n /**\n * Optional explicit value.\n */\n value?: ReactNode;\n\n /**\n * Additional classes for this cell only.\n */\n className?: string;\n\n /**\n * Horizontal alignment override for this cell.\n */\n horizontalAlign?: TableHorizontalAlign;\n\n /**\n * Vertical alignment override for this cell.\n */\n verticalAlign?: TableVerticalAlign;\n\n /**\n * Overflow behavior for the cell content wrapper.\n *\n * @default 'hidden'\n */\n overflow?: TableCellOverflow;\n\n /**\n * Number of columns this cell should span.\n *\n * Currently used by header and footer-style declarative table sections.\n */\n colSpan?: number;\n\n /**\n * Prevents clicks and keyboard interactions inside this cell from triggering the parent row click handler.\n *\n * Useful for interactive cell content such as dropdowns, inputs, or buttons.\n *\n * @default false\n */\n preventRowClick?: boolean;\n};\n\nconst TableColumn = (props: TableColumnProps) => {\n const {\n children,\n className,\n colSpan = 1,\n columnKey,\n horizontalAlign,\n overflow = 'hidden',\n preventRowClick = false,\n value,\n verticalAlign,\n ...remainingProps\n } = props;\n\n const renderConfigContext = useOptionalTableRenderConfigContext();\n const renderContext = useOptionalTableRenderContext();\n const interactionContext = useOptionalTableInteractionContext();\n const layoutContext = useOptionalTableLayoutContext();\n const section = useOptionalTableSection();\n const rowContext = useTableRowContext();\n\n const isBodySection = section === 'body';\n const isFooterSection = section === 'footer';\n\n if (\n !renderContext ||\n !renderConfigContext ||\n !interactionContext ||\n !layoutContext ||\n renderContext.columns.length === 0 ||\n (!isBodySection && !isFooterSection)\n ) {\n return null;\n }\n\n if (isBodySection && !rowContext) {\n return null;\n }\n\n const explicitColumnIndex = columnKey !== undefined ? renderContext.columnIndexByKey.get(columnKey) : undefined;\n const columnIndex = rowContext?.nextColumnIndex(explicitColumnIndex, colSpan) ?? explicitColumnIndex ?? -1;\n\n if (columnIndex < 0) {\n return null;\n }\n\n const renderColumn = renderContext.columns[columnIndex];\n const baseColumnStart = columnIndex + 1;\n const resolvedColumnStart = baseColumnStart + (interactionContext.showSelectionColumn ? 1 : 0);\n const resolvedHorizontalAlign = horizontalAlign ?? renderColumn?.horizontalAlign;\n const resolvedVerticalAlign = verticalAlign ?? renderColumn?.verticalAlign;\n\n const resolvedCellClassName =\n isBodySection &&\n rowContext?.rowData &&\n renderConfigContext.cellClassName?.(\n rowContext.rowData,\n renderContext.columnDefinitionsByKey.get(renderColumn?.columnKey ?? columnKey ?? '') ?? {\n key: renderColumn?.columnKey ?? columnKey ?? String(baseColumnStart),\n label: renderColumn?.label ?? '',\n icon: renderColumn?.icon,\n filter: renderColumn?.filter,\n hideLabel: renderColumn?.hideLabel,\n width: renderColumn?.width,\n minResizeWidth: renderColumn?.minResizeWidth,\n maxResizeWidth: renderColumn?.maxResizeWidth,\n draggable: renderColumn?.draggable,\n resizeable: renderColumn?.resizeable,\n horizontalAlign: renderColumn?.horizontalAlign,\n className: undefined,\n headerClassName: renderColumn?.headerClassName,\n hideOnMobile: renderColumn?.hideOnMobile,\n sortable: renderColumn?.sortable,\n },\n rowContext.rowIndex,\n columnIndex\n );\n\n const stickyLeftColumns = layoutContext.stickyLeftColumnCount ?? 0;\n const stickyRightColumns = layoutContext.stickyRightColumnCount ?? 0;\n const isStickyLeftColumn = stickyLeftColumns > 0 && baseColumnStart <= stickyLeftColumns;\n const isStickyRightColumn =\n stickyRightColumns > 0 && baseColumnStart > renderContext.columns.length - stickyRightColumns;\n\n const mobileLabel = renderColumn?.mobileLabel ?? getNodeTextContent(renderColumn?.label) ?? '';\n\n const handleCellInteraction = (event: KeyboardEvent<HTMLDivElement> | MouseEvent<HTMLDivElement>) => {\n event.stopPropagation();\n };\n\n if (isFooterSection) {\n renderContext.renderDraft.hasFooterCells = true;\n }\n\n if (renderConfigContext.isTableView) {\n return (\n <div\n {...remainingProps}\n className={classNames(\n 'table-cell',\n isFooterSection && 'table-footer-cell',\n isBodySection && isStickyLeftColumn && 'table-cell-sticky-left-column',\n isBodySection && isStickyRightColumn && 'table-cell-sticky-right-column',\n isFooterSection &&\n layoutContext.stickyFooter &&\n isStickyLeftColumn &&\n 'table-footer-cell-sticky-left-column',\n isFooterSection &&\n layoutContext.stickyFooter &&\n isStickyRightColumn &&\n 'table-footer-cell-sticky-right-column',\n getHorizontalAlignClassName(resolvedHorizontalAlign),\n getVerticalAlignClassName(resolvedVerticalAlign),\n renderColumn?.hideOnMobile && 'table-hide-mobile',\n resolvedCellClassName,\n className\n )}\n data-column={renderColumn?.columnKey ?? columnKey ?? baseColumnStart}\n role='cell'\n aria-colindex={resolveAriaColIndex(baseColumnStart, interactionContext.showSelectionColumn)}\n aria-colspan={resolveAriaSpan(colSpan)}\n onClick={preventRowClick ? handleCellInteraction : undefined}\n onKeyDown={preventRowClick ? handleCellInteraction : undefined}\n style={{ gridColumn: `${resolvedColumnStart} / span ${colSpan}`, gridRow: '1 / span 1' }}\n >\n <div className={classNames('table-cell-content', getCellContentOverflowClassName(overflow))}>\n {value ?? children ?? ''}\n </div>\n </div>\n );\n }\n\n return (\n <div\n {...remainingProps}\n className={classNames(\n 'table-cell',\n renderConfigContext.cardClasses.cellClassName,\n getHorizontalAlignClassName(resolvedHorizontalAlign),\n getVerticalAlignClassName(resolvedVerticalAlign),\n renderColumn?.hideOnMobile && 'table-hide-mobile',\n resolvedCellClassName,\n className\n )}\n data-column={renderColumn?.columnKey ?? columnKey ?? baseColumnStart}\n role='cell'\n aria-colindex={resolveAriaColIndex(baseColumnStart, interactionContext.showSelectionColumn)}\n onClick={preventRowClick ? handleCellInteraction : undefined}\n onKeyDown={preventRowClick ? handleCellInteraction : undefined}\n >\n {mobileLabel && (\n <div className={classNames('table-cell-label', renderConfigContext.cardClasses.labelClassName)}>\n {mobileLabel}\n </div>\n )}\n <div\n className={classNames(\n 'table-cell-content',\n renderConfigContext.cardClasses.contentClassName,\n getCellContentOverflowClassName(overflow)\n )}\n >\n {value ?? children ?? ''}\n </div>\n </div>\n );\n};\n\nexport default TableColumn;\n"],"names":["TableColumn","props","children","className","colSpan","columnKey","horizontalAlign","overflow","preventRowClick","value","verticalAlign","remainingProps","renderConfigContext","useOptionalTableRenderConfigContext","renderContext","useOptionalTableRenderContext","interactionContext","useOptionalTableInteractionContext","layoutContext","useOptionalTableLayoutContext","section","useOptionalTableSection","rowContext","useTableRowContext","isBodySection","isFooterSection","explicitColumnIndex","columnIndex","renderColumn","baseColumnStart","resolvedColumnStart","resolvedHorizontalAlign","resolvedVerticalAlign","resolvedCellClassName","stickyLeftColumns","stickyRightColumns","isStickyLeftColumn","isStickyRightColumn","mobileLabel","getNodeTextContent","handleCellInteraction","event","jsx","classNames","getHorizontalAlignClassName","getVerticalAlignClassName","resolveAriaColIndex","resolveAriaSpan","getCellContentOverflowClassName","jsxs"],"mappings":";;;;;;;;;;;AAiFA,MAAMA,KAAc,CAACC,MAA4B;AAC7C,QAAM;AAAA,IACF,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,WAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,iBAAAC,IAAkB;AAAA,IAClB,OAAAC;AAAA,IACA,eAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHV,GAEEW,IAAsBC,EAAA,GACtBC,IAAgBC,EAAA,GAChBC,IAAqBC,EAAA,GACrBC,IAAgBC,EAAA,GAChBC,IAAUC,EAAA,GACVC,IAAaC,EAAA,GAEbC,IAAgBJ,MAAY,QAC5BK,IAAkBL,MAAY;AAapC,MAVI,CAACN,KACD,CAACF,KACD,CAACI,KACD,CAACE,KACDJ,EAAc,QAAQ,WAAW,KAChC,CAACU,KAAiB,CAACC,KAKpBD,KAAiB,CAACF;AAClB,WAAO;AAGX,QAAMI,IAAsBrB,MAAc,SAAYS,EAAc,iBAAiB,IAAIT,CAAS,IAAI,QAChGsB,IAAcL,GAAY,gBAAgBI,GAAqBtB,CAAO,KAAKsB,KAAuB;AAExG,MAAIC,IAAc;AACd,WAAO;AAGX,QAAMC,IAAed,EAAc,QAAQa,CAAW,GAChDE,IAAkBF,IAAc,GAChCG,IAAsBD,KAAmBb,EAAmB,sBAAsB,IAAI,IACtFe,IAA0BzB,KAAmBsB,GAAc,iBAC3DI,IAAwBtB,KAAiBkB,GAAc,eAEvDK,IACFT,KACAF,GAAY,WACZV,EAAoB;AAAA,IAChBU,EAAW;AAAA,IACXR,EAAc,uBAAuB,IAAIc,GAAc,aAAavB,KAAa,EAAE,KA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