@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
@@ -0,0 +1,2 @@
1
+ export { default } from './components/countedInput/CountedInput';
2
+ export * from './components/countedInput/CountedInput';
@@ -0,0 +1,5 @@
1
+ import { default as o } from "./components/countedInput/CountedInput.js";
2
+ export {
3
+ o as default
4
+ };
5
+ //# sourceMappingURL=CountedInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CountedInput.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,2 @@
1
+ export { default } from './components/tabbedPanel/TabbedPanel';
2
+ export * from './components/tabbedPanel/TabbedPanel';
package/TabbedPanel.js ADDED
@@ -0,0 +1,5 @@
1
+ import { default as o } from "./components/tabbedPanel/TabbedPanel.js";
2
+ export {
3
+ o as default
4
+ };
5
+ //# sourceMappingURL=TabbedPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabbedPanel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,66 +1,78 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { useState as m, useRef as b, useEffect as L, useLayoutEffect as V } from "react";
3
- import { isEmpty as j } from "es-toolkit/compat";
4
- import q from "../../utils/classNames.js";
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { useState as o, useRef as p, useLayoutEffect as v } from "react";
3
+ import { isEmpty as V } from "es-toolkit/compat";
4
+ import j from "../../utils/classNames.js";
5
5
  import z from "../../hooks/useClickOutside.js";
6
- import B from "./CollapsedNavItem.js";
7
- const $ = 50, F = 15, Q = (C) => {
8
- const { navItems: n = [], actionBarItems: d = [], containerWidth: k } = C, [o, a] = m(!1), [u, W] = m([]), [y, g] = m([]), w = z(() => a(!1)), f = b(null), t = b(!0);
9
- L(() => {
10
- t.current = !0;
11
- }, [n, d, k]), V(() => {
12
- t.current && E();
6
+ import $ from "./CollapsedNavItem.js";
7
+ const G = 50, H = 15, J = [], K = [], Z = (M) => {
8
+ const {
9
+ navItems: n = J,
10
+ actionBarItems: I = K,
11
+ containerWidth: S
12
+ } = M, [i, r] = o(!1), [N, h] = o([]), [D, b] = o([]), [l, s] = o(!0), F = z(() => r(!1)), C = p(null), a = p(null), c = p(1), w = () => {
13
+ a.current !== null && (window.cancelAnimationFrame(a.current), a.current = null);
14
+ };
15
+ v(() => {
16
+ w(), c.current = 1, s(!0);
17
+ }, [n, I, S]), v(() => () => w(), []), v(() => {
18
+ l && (x(), c.current > 0 && (c.current -= 1, a.current = window.requestAnimationFrame(() => {
19
+ a.current = null, s(!0);
20
+ })));
13
21
  });
14
- const D = (e) => e.scrollWidth - $ - F, E = () => {
15
- const e = f.current;
16
- if (!e)
22
+ const R = (e) => e.scrollWidth - G - H, x = () => {
23
+ const e = C.current;
24
+ if (!e) {
25
+ s(!1);
17
26
  return;
18
- const s = [...e.children || []], v = D(e);
19
- if (v < 0)
27
+ }
28
+ const t = [...e.children || []], k = R(e);
29
+ if (k < 0) {
30
+ b([]), h(n), s(!1);
20
31
  return;
21
- let r = 0;
22
- const I = [], N = [];
23
- s.forEach((l) => {
24
- if (!l.className)
32
+ }
33
+ let m = 0;
34
+ const y = [], W = [];
35
+ t.forEach((u) => {
36
+ if (!u.className)
25
37
  return;
26
- r = r + l.scrollWidth;
27
- const c = n.find((A) => {
28
- const h = l.attributes.getNamedItem("data-nav-item-key");
29
- return h && A.key === h.value;
38
+ m = m + u.scrollWidth;
39
+ const d = n.find((B) => {
40
+ const A = u.attributes.getNamedItem("data-nav-item-key");
41
+ return A && B.key === A.value;
30
42
  });
31
- c && (v > r ? I.push(c) : N.push(c));
32
- }), t.current = !1, g(I), W(N);
33
- }, O = () => {
34
- a(!o);
35
- }, S = () => {
36
- o && a(!1);
37
- }, p = (e, s) => /* @__PURE__ */ i(
43
+ d && (k > m ? y.push(d) : W.push(d));
44
+ }), b(y), h(W), s(!1);
45
+ }, E = () => {
46
+ r(!i);
47
+ }, L = () => {
48
+ i && r(!1);
49
+ }, g = (e, t) => /* @__PURE__ */ f(
38
50
  "li",
39
51
  {
40
- className: `submodule ${s ? "offscreen" : ""}`,
52
+ className: `submodule ${t ? "offscreen" : ""}`,
41
53
  "data-nav-item-key": e.key,
42
54
  children: e.route
43
55
  },
44
56
  e.key
45
- ), x = () => !t.current && !j(u) ? [
46
- ...y.map((s) => p(s, t.current)),
47
- /* @__PURE__ */ i(
48
- B,
57
+ ), O = () => !l && !V(N) ? [
58
+ ...D.map((t) => g(t, l)),
59
+ /* @__PURE__ */ f(
60
+ $,
49
61
  {
50
- ref: w,
51
- show: o,
52
- navItems: u,
53
- actionBarItems: d,
54
- onDropdownClick: O,
55
- onItemClick: S
62
+ ref: F,
63
+ show: i,
64
+ navItems: N,
65
+ actionBarItems: I,
66
+ onDropdownClick: E,
67
+ onItemClick: L
56
68
  },
57
69
  "CollapsedNavItem"
58
70
  )
59
- ] : n.map((e) => p(e, t.current)), R = q("SubmoduleNavigation", "nav");
60
- return /* @__PURE__ */ i("ul", { className: R, ref: f, children: x() });
71
+ ] : n.map((e) => g(e, l)), q = j("SubmoduleNavigation", "nav");
72
+ return /* @__PURE__ */ f("ul", { className: q, ref: C, children: O() });
61
73
  };
62
74
  export {
63
- Q as NavItems,
64
- Q as default
75
+ Z as NavItems,
76
+ Z as default
65
77
  };
66
78
  //# sourceMappingURL=NavItems.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NavItems.js","sources":["../../../src/components/applicationHeader/NavItems.tsx"],"sourcesContent":["import type React from 'react';\nimport { useState, useEffect, useLayoutEffect, useRef } from 'react';\nimport { isEmpty } from 'es-toolkit/compat';\n\nimport classNames from '../../utils/classNames';\nimport useClickOutside from '../../hooks/useClickOutside';\nimport CollapsedNavItem from './CollapsedNavItem';\nimport type { ModulePropType } from './ApplicationHeader';\n\nconst collapsedDropdownWidth = 50;\nconst paddingLeft = 15;\n\nexport type NavItemsProps = {\n navItems?: ModulePropType[];\n containerWidth: number;\n actionBarItems?: React.ReactNode[];\n};\n\nexport const NavItems = (props: NavItemsProps) => {\n const { navItems: externalNavItems = [], actionBarItems = [], containerWidth } = props;\n\n const [isCollapsedNavItemOpen, setIsCollapsedNavItemOpen] = useState(false);\n const [collapsedNavItems, setCollapsedNavItems] = useState<ModulePropType[]>([]);\n const [visibleNavItems, setVisibleNavItems] = useState<ModulePropType[]>([]);\n\n const collapsedDropdownRef = useClickOutside(() => setIsCollapsedNavItemOpen(false));\n\n const navigationRef = useRef(null);\n const isOffscreen = useRef(true);\n\n // console.log({ containerWidth });\n\n // Before any new changes are applied\n useEffect(() => {\n // After the component received new props, every nav item has to be rendered offscreen\n // again without collapsing them into the dropdown to measure its width\n isOffscreen.current = true;\n }, [externalNavItems, actionBarItems, containerWidth]);\n\n // After the component has been rendered\n useLayoutEffect(() => {\n // After every nav item was rendered offscreen again we need to recalculate the width\n // of the items again and render the result with possible collapsible dropdown.\n if (isOffscreen.current) {\n computeNavItems();\n }\n });\n\n const getAvailableWidth = (element: HTMLElement) => {\n // Get relevant elements\n // const parent = element.parentNode;\n\n // const actionBar = head(parent.getElementsByClassName('ApplicationActionBar'));\n // const actionBarWidth = actionBar && actionBar.childElementCount > 0 ? actionBar.scrollWidth : 0;\n\n // Since the collapsed dropdown has not been rendered yet,\n // use the fixed with for it to compute available width\n const availableWidth = element.scrollWidth - collapsedDropdownWidth - paddingLeft;\n return availableWidth;\n };\n\n const computeNavItems = () => {\n const element: HTMLElement | null = navigationRef.current;\n\n if (!element) {\n return;\n }\n\n const navItems = [...((element as HTMLElement).children || [])];\n\n const availableWidth = getAvailableWidth(element);\n\n if (availableWidth < 0) {\n return;\n }\n\n // Iterate over all rendered navItems to figure out their widths in order to figure out\n // which navItems need to be rendered in the collapsed dropdown\n let requiredNavItemsSize = 0;\n\n const updatedVisibleItems: ModulePropType[] = [];\n const updatedCollapsedItems: ModulePropType[] = [];\n\n navItems.forEach(item => {\n if (!item.className) {\n return;\n }\n\n // Calculate the remaining width\n requiredNavItemsSize = requiredNavItemsSize + item.scrollWidth;\n\n // console.log({ requiredNavItemsSize });\n\n // Use the navItems.key to find corresponding navItems for each DOM node\n const matchedNavItem = externalNavItems.find(navItem => {\n const dataAttr = item.attributes.getNamedItem('data-nav-item-key');\n return dataAttr && navItem.key === dataAttr.value;\n });\n\n if (!matchedNavItem) {\n return;\n }\n\n // Add navItems to the visible group until the available with exceeds.\n // All other navItems will be added to the collapsed group\n if (availableWidth > requiredNavItemsSize) {\n updatedVisibleItems.push(matchedNavItem);\n } else {\n updatedCollapsedItems.push(matchedNavItem);\n }\n });\n\n // Set the state to render the navItems again\n isOffscreen.current = false;\n\n setVisibleNavItems(updatedVisibleItems);\n setCollapsedNavItems(updatedCollapsedItems);\n };\n\n const handleCollapsedDropdown = () => {\n // When the dropdown is open, set showCollapsedNavItems to false so all submodule items\n // are rendered and their size can be computed\n if (isCollapsedNavItemOpen) {\n setIsCollapsedNavItemOpen(false);\n } else {\n // When the dropdown is closed, just set the flag to open is enough\n setIsCollapsedNavItemOpen(true);\n }\n };\n\n const handleCollapsedNavItemSelected = () => {\n // Close collapsed dropdown on item select\n if (isCollapsedNavItemOpen) {\n setIsCollapsedNavItemOpen(false);\n }\n };\n\n const renderNavItem = (navItem: ModulePropType, isItemOffscreen: boolean) => (\n <li\n key={navItem.key}\n className={`submodule ${isItemOffscreen ? 'offscreen' : ''}`}\n data-nav-item-key={navItem.key}\n >\n {navItem.route}\n </li>\n );\n\n const renderNavItems = () => {\n if (!isOffscreen.current && !isEmpty(collapsedNavItems)) {\n const visibleItems = visibleNavItems.map(navItem => renderNavItem(navItem, isOffscreen.current));\n\n return [\n ...visibleItems,\n <CollapsedNavItem\n key='CollapsedNavItem'\n ref={collapsedDropdownRef}\n show={isCollapsedNavItemOpen}\n navItems={collapsedNavItems}\n actionBarItems={actionBarItems}\n onDropdownClick={handleCollapsedDropdown}\n onItemClick={handleCollapsedNavItemSelected}\n />,\n ];\n }\n\n return externalNavItems.map(navItem => renderNavItem(navItem, isOffscreen.current));\n };\n\n // As all navItems need to be added to the DOM first in order to get their real size\n // the computation whether a navItem need to be shown under the collapsed dropdown or not\n // needs to be done after the component did mount to the DOM.\n\n const classes = classNames('SubmoduleNavigation', 'nav');\n\n return (\n <ul className={classes} ref={navigationRef}>\n {renderNavItems()}\n </ul>\n );\n};\n\nexport default NavItems;\n"],"names":["collapsedDropdownWidth","paddingLeft","NavItems","props","externalNavItems","actionBarItems","containerWidth","isCollapsedNavItemOpen","setIsCollapsedNavItemOpen","useState","collapsedNavItems","setCollapsedNavItems","visibleNavItems","setVisibleNavItems","collapsedDropdownRef","useClickOutside","navigationRef","useRef","isOffscreen","useEffect","useLayoutEffect","computeNavItems","getAvailableWidth","element","navItems","availableWidth","requiredNavItemsSize","updatedVisibleItems","updatedCollapsedItems","item","matchedNavItem","navItem","dataAttr","handleCollapsedDropdown","handleCollapsedNavItemSelected","renderNavItem","isItemOffscreen","jsx","renderNavItems","isEmpty","CollapsedNavItem","classes","classNames"],"mappings":";;;;;;AASA,MAAMA,IAAyB,IACzBC,IAAc,IAQPC,IAAW,CAACC,MAAyB;AAC9C,QAAM,EAAE,UAAUC,IAAmB,CAAA,GAAI,gBAAAC,IAAiB,CAAA,GAAI,gBAAAC,EAAA,IAAmBH,GAE3E,CAACI,GAAwBC,CAAyB,IAAIC,EAAS,EAAK,GACpE,CAACC,GAAmBC,CAAoB,IAAIF,EAA2B,CAAA,CAAE,GACzE,CAACG,GAAiBC,CAAkB,IAAIJ,EAA2B,CAAA,CA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gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MAEG,WAAW,aAAaD,IAAkB,cAAc,EAAE;AAAA,MAC1D,qBAAmBL,EAAQ;AAAA,MAE1B,UAAAA,EAAQ;AAAA,IAAA;AAAA,IAJJA,EAAQ;AAAA,EAAA,GAQfO,IAAiB,MACf,CAACpB,EAAY,WAAW,CAACqB,EAAQ7B,CAAiB,IAG3C;AAAA,IACH,GAHiBE,EAAgB,IAAI,CAAAmB,MAAWI,EAAcJ,GAASb,EAAY,OAAO,CAAC;AAAA,IAI3F,gBAAAmB;AAAA,MAACG;AAAA,MAAA;AAAA,QAEG,KAAK1B;AAAA,QACL,MAAMP;AAAA,QACN,UAAUG;AAAA,QACV,gBAAAL;AAAA,QACA,iBAAiB4B;AAAA,QACjB,aAAaC;AAAA,MAAA;AAAA,MANT;AAAA,IAAA;AAAA,EAOR,IAID9B,EAAiB,IAAI,CAAA2B,MAAWI,EAAcJ,GAASb,EAAY,OAAO,CAAC,GAOhFuB,IAAUC,EAAW,uBAAuB,KAAK;AAEvD,2BACK,MAAA,EAAG,WAAWD,GAAS,KAAKzB,GACxB,eACL;AAER;"}
1
+ {"version":3,"file":"NavItems.js","sources":["../../../src/components/applicationHeader/NavItems.tsx"],"sourcesContent":["import type React from 'react';\nimport { useState, useLayoutEffect, useRef } from 'react';\nimport { isEmpty } from 'es-toolkit/compat';\n\nimport classNames from '../../utils/classNames';\nimport useClickOutside from '../../hooks/useClickOutside';\nimport CollapsedNavItem from './CollapsedNavItem';\nimport type { ModulePropType } from './ApplicationHeader';\n\nconst collapsedDropdownWidth = 50;\nconst paddingLeft = 15;\nconst defaultNavItems: ModulePropType[] = [];\nconst defaultActionBarItems: React.ReactNode[] = [];\n\nexport type NavItemsProps = {\n navItems?: ModulePropType[];\n containerWidth: number;\n actionBarItems?: React.ReactNode[];\n};\n\nexport const NavItems = (props: NavItemsProps) => {\n const {\n navItems: externalNavItems = defaultNavItems,\n actionBarItems = defaultActionBarItems,\n containerWidth,\n } = props;\n\n const [isCollapsedNavItemOpen, setIsCollapsedNavItemOpen] = useState(false);\n const [collapsedNavItems, setCollapsedNavItems] = useState<ModulePropType[]>([]);\n const [visibleNavItems, setVisibleNavItems] = useState<ModulePropType[]>([]);\n const [isMeasuring, setIsMeasuring] = useState(true);\n\n const collapsedDropdownRef = useClickOutside(() => setIsCollapsedNavItemOpen(false));\n\n const navigationRef = useRef(null);\n const scheduledMeasurementFrame = useRef<number | null>(null);\n const postLayoutMeasurementsRemaining = useRef(1);\n\n const cancelScheduledMeasurementFrame = () => {\n if (scheduledMeasurementFrame.current !== null) {\n window.cancelAnimationFrame(scheduledMeasurementFrame.current);\n scheduledMeasurementFrame.current = null;\n }\n };\n\n // Before any new changes are applied\n useLayoutEffect(() => {\n // After the component received new props, every nav item has to be rendered offscreen\n // again without collapsing them into the dropdown to measure its width\n cancelScheduledMeasurementFrame();\n postLayoutMeasurementsRemaining.current = 1;\n setIsMeasuring(true);\n }, [externalNavItems, actionBarItems, containerWidth]);\n\n useLayoutEffect(() => () => cancelScheduledMeasurementFrame(), []);\n\n // After the component has been rendered\n useLayoutEffect(() => {\n // After every nav item was rendered offscreen again we need to recalculate the width\n // of the items again and render the result with possible collapsible dropdown.\n if (isMeasuring) {\n computeNavItems();\n\n if (postLayoutMeasurementsRemaining.current > 0) {\n postLayoutMeasurementsRemaining.current -= 1;\n scheduledMeasurementFrame.current = window.requestAnimationFrame(() => {\n scheduledMeasurementFrame.current = null;\n setIsMeasuring(true);\n });\n }\n }\n });\n\n const getAvailableWidth = (element: HTMLElement) => {\n // Get relevant elements\n // const parent = element.parentNode;\n\n // const actionBar = head(parent.getElementsByClassName('ApplicationActionBar'));\n // const actionBarWidth = actionBar && actionBar.childElementCount > 0 ? actionBar.scrollWidth : 0;\n\n // Since the collapsed dropdown has not been rendered yet,\n // use the fixed with for it to compute available width\n const availableWidth = element.scrollWidth - collapsedDropdownWidth - paddingLeft;\n return availableWidth;\n };\n\n const computeNavItems = () => {\n const element: HTMLElement | null = navigationRef.current;\n\n if (!element) {\n setIsMeasuring(false);\n return;\n }\n\n const navItems = [...((element as HTMLElement).children || [])];\n\n const availableWidth = getAvailableWidth(element);\n\n if (availableWidth < 0) {\n setVisibleNavItems([]);\n setCollapsedNavItems(externalNavItems);\n setIsMeasuring(false);\n return;\n }\n\n // Iterate over all rendered navItems to figure out their widths in order to figure out\n // which navItems need to be rendered in the collapsed dropdown\n let requiredNavItemsSize = 0;\n\n const updatedVisibleItems: ModulePropType[] = [];\n const updatedCollapsedItems: ModulePropType[] = [];\n\n navItems.forEach(item => {\n if (!item.className) {\n return;\n }\n\n // Calculate the remaining width\n requiredNavItemsSize = requiredNavItemsSize + item.scrollWidth;\n\n // console.log({ requiredNavItemsSize });\n\n // Use the navItems.key to find corresponding navItems for each DOM node\n const matchedNavItem = externalNavItems.find(navItem => {\n const dataAttr = item.attributes.getNamedItem('data-nav-item-key');\n return dataAttr && navItem.key === dataAttr.value;\n });\n\n if (!matchedNavItem) {\n return;\n }\n\n // Add navItems to the visible group until the available with exceeds.\n // All other navItems will be added to the collapsed group\n if (availableWidth > requiredNavItemsSize) {\n updatedVisibleItems.push(matchedNavItem);\n } else {\n updatedCollapsedItems.push(matchedNavItem);\n }\n });\n\n // Set the state to render the navItems again\n setVisibleNavItems(updatedVisibleItems);\n setCollapsedNavItems(updatedCollapsedItems);\n setIsMeasuring(false);\n };\n\n const handleCollapsedDropdown = () => {\n // When the dropdown is open, set showCollapsedNavItems to false so all submodule items\n // are rendered and their size can be computed\n if (isCollapsedNavItemOpen) {\n setIsCollapsedNavItemOpen(false);\n } else {\n // When the dropdown is closed, just set the flag to open is enough\n setIsCollapsedNavItemOpen(true);\n }\n };\n\n const handleCollapsedNavItemSelected = () => {\n // Close collapsed dropdown on item select\n if (isCollapsedNavItemOpen) {\n setIsCollapsedNavItemOpen(false);\n }\n };\n\n const renderNavItem = (navItem: ModulePropType, isItemOffscreen: boolean) => (\n <li\n key={navItem.key}\n className={`submodule ${isItemOffscreen ? 'offscreen' : ''}`}\n data-nav-item-key={navItem.key}\n >\n {navItem.route}\n </li>\n );\n\n const renderNavItems = () => {\n if (!isMeasuring && !isEmpty(collapsedNavItems)) {\n const visibleItems = visibleNavItems.map(navItem => renderNavItem(navItem, isMeasuring));\n\n return [\n ...visibleItems,\n <CollapsedNavItem\n key='CollapsedNavItem'\n ref={collapsedDropdownRef}\n show={isCollapsedNavItemOpen}\n navItems={collapsedNavItems}\n actionBarItems={actionBarItems}\n onDropdownClick={handleCollapsedDropdown}\n onItemClick={handleCollapsedNavItemSelected}\n />,\n ];\n }\n\n return externalNavItems.map(navItem => renderNavItem(navItem, isMeasuring));\n };\n\n // As all navItems need to be added to the DOM first in order to get their real size\n // the computation whether a navItem need to be shown under the collapsed dropdown or not\n // needs to be done after the component did mount to the DOM.\n\n const classes = classNames('SubmoduleNavigation', 'nav');\n\n return (\n <ul className={classes} ref={navigationRef}>\n {renderNavItems()}\n </ul>\n );\n};\n\nexport default NavItems;\n"],"names":["collapsedDropdownWidth","paddingLeft","defaultNavItems","defaultActionBarItems","NavItems","props","externalNavItems","actionBarItems","containerWidth","isCollapsedNavItemOpen","setIsCollapsedNavItemOpen","useState","collapsedNavItems","setCollapsedNavItems","visibleNavItems","setVisibleNavItems","isMeasuring","setIsMeasuring","collapsedDropdownRef","useClickOutside","navigationRef","useRef","scheduledMeasurementFrame","postLayoutMeasurementsRemaining","cancelScheduledMeasurementFrame","useLayoutEffect","computeNavItems","getAvailableWidth","element","navItems","availableWidth","requiredNavItemsSize","updatedVisibleItems","updatedCollapsedItems","item","matchedNavItem","navItem","dataAttr","handleCollapsedDropdown","handleCollapsedNavItemSelected","renderNavItem","isItemOffscreen","jsx","renderNavItems","isEmpty","CollapsedNavItem","classes","classNames"],"mappings":";;;;;;AASA,MAAMA,IAAyB,IACzBC,IAAc,IACdC,IAAoC,CAAA,GACpCC,IAA2C,CAAA,GAQpCC,IAAW,CAACC,MAAyB;AAC9C,QAAM;AAAA,IAC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AAAA,QACA,iBAAiB+B;AAAA,QACjB,aAAaC;AAAA,MAAA;AAAA,MANT;AAAA,IAAA;AAAA,EAOR,IAIDjC,EAAiB,IAAI,CAAA8B,MAAWI,EAAcJ,GAASpB,CAAW,CAAC,GAOxE8B,IAAUC,EAAW,uBAAuB,KAAK;AAEvD,2BACK,MAAA,EAAG,WAAWD,GAAS,KAAK1B,GACxB,eACL;AAER;"}
@@ -32,7 +32,7 @@ export type ApplicationLayoutBodyProps = {
32
32
  /**
33
33
  * Height of the bottomBar in pixel.
34
34
  *
35
- * @default 54
35
+ * @default 54 when bottomBar is set
36
36
  */
37
37
  bottomBarHeight?: number;
38
38
  /**
@@ -1,62 +1,62 @@
1
- import { jsxs as c, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
2
  import I, { forwardRef as O, useState as x, useRef as h, useImperativeHandle as _, useEffect as T } from "react";
3
3
  import { debounce as k } from "es-toolkit/compat";
4
4
  import a from "../../utils/classNames.js";
5
5
  import F from "../smoothScrollbars/SmoothScrollbars.js";
6
- const j = 200, G = 54, Z = O((g, y) => {
6
+ const P = 200, j = 54, Z = O((y, g) => {
7
7
  const {
8
- className: b,
8
+ className: N,
9
9
  innerClassName: i,
10
- forceScrollbar: N = !0,
10
+ forceScrollbar: b = !0,
11
11
  enableScrollToTop: B = !0,
12
12
  banner: p,
13
13
  navigation: m,
14
- bottomBar: s,
15
- bottomBarHeight: u = G,
14
+ bottomBar: e,
15
+ bottomBarHeight: u = j,
16
16
  scrollResetTrigger: S,
17
- children: R,
18
- ...E
19
- } = g, [H, n] = x(0), o = h(null), r = h(null);
20
- _(y, () => r?.current, []), T(() => {
21
- o.current && (o.current.scrollTop(0), n(0));
17
+ children: H,
18
+ ...L
19
+ } = y, [R, s] = x(0), o = h(null), r = h(null);
20
+ _(g, () => r?.current, []), T(() => {
21
+ o.current && (o.current.scrollTop(0), s(0));
22
22
  }, [S]), T(() => {
23
- r.current?.parentNode instanceof HTMLElement && r.current.parentNode.style.setProperty(
23
+ r.current?.parentNode instanceof HTMLElement && (e ? r.current.parentNode.style.setProperty(
24
24
  "--ApplicationLayoutBodyBottomBarHeight",
25
25
  `${u}px`
26
- );
27
- }, [u]);
28
- const L = k(() => {
29
- o.current && n(o.current.getScrollTop());
30
- }, j), d = () => {
26
+ ) : r.current.parentNode.style.removeProperty("--ApplicationLayoutBodyBottomBarHeight"));
27
+ }, [e, u]);
28
+ const E = k(() => {
29
+ o.current && s(o.current.getScrollTop());
30
+ }, P), d = () => {
31
31
  if (!o.current)
32
32
  return;
33
- const l = o.current.container, f = l.firstElementChild, t = f?.scrollTop ?? 0;
34
- t > 10 ? (window.requestAnimationFrame(d), f?.scrollTo(0, t - t / 5), l.classList.add("is-scrolling-to-top"), n(t)) : l.classList.remove("is-scrolling-to-top");
35
- }, w = a("ApplicationLayoutBody", s ? "has-footer" : "", b), v = a(
33
+ const l = o.current.container, f = l.firstElementChild, n = f?.scrollTop ?? 0;
34
+ n > 10 ? (window.requestAnimationFrame(d), f?.scrollTo(0, n - n / 5), l.classList.add("is-scrolling-to-top"), s(n)) : l.classList.remove("is-scrolling-to-top");
35
+ }, v = a("ApplicationLayoutBody", e ? "has-footer" : "", N), w = a(
36
36
  "module-content",
37
37
  i && i
38
- ), A = window.innerHeight * 0.1, C = a("scroll-to-top", H > A && "in");
38
+ ), A = window.innerHeight * 0.1, C = a("scroll-to-top", R > A && "in");
39
39
  return /* @__PURE__ */ c(I.Fragment, { children: [
40
- /* @__PURE__ */ c("div", { ...E, ref: r, className: w, children: [
40
+ /* @__PURE__ */ c("div", { ...L, ref: r, className: v, children: [
41
41
  /* @__PURE__ */ c("div", { className: "module-content-wrapper", children: [
42
42
  m && m,
43
43
  p && p,
44
- /* @__PURE__ */ e(
44
+ /* @__PURE__ */ t(
45
45
  F,
46
46
  {
47
47
  ref: o,
48
- slideIn: !N,
48
+ slideIn: !b,
49
49
  largeTrack: !0,
50
50
  trackOffset: !0,
51
- className: v,
52
- onScroll: L,
53
- children: /* @__PURE__ */ e("div", { className: "scrollbar-content", children: R })
51
+ className: w,
52
+ onScroll: E,
53
+ children: /* @__PURE__ */ t("div", { className: "scrollbar-content", children: H })
54
54
  }
55
55
  )
56
56
  ] }),
57
- B && /* @__PURE__ */ e("span", { className: C, children: /* @__PURE__ */ e("button", { type: "button", className: "btn btn-primary btn-icon-only", onClick: d, children: /* @__PURE__ */ e("span", { className: "rioglyph rioglyph-arrow-up" }) }) })
57
+ B && /* @__PURE__ */ t("span", { className: C, children: /* @__PURE__ */ t("button", { type: "button", className: "btn btn-primary btn-icon-only", onClick: d, children: /* @__PURE__ */ t("span", { className: "rioglyph rioglyph-arrow-up" }) }) })
58
58
  ] }),
59
- s && s
59
+ e && e
60
60
  ] });
61
61
  });
62
62
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"ApplicationLayoutBody.js","sources":["../../../src/components/applicationLayout/ApplicationLayoutBody.tsx"],"sourcesContent":["import React, {\n useState,\n useRef,\n useEffect,\n forwardRef,\n useImperativeHandle,\n type PropsWithChildren,\n type ForwardedRef,\n} from 'react';\nimport { debounce } from 'es-toolkit/compat';\n\nimport type Scrollbars from 'react-custom-scrollbars-4';\n\nimport classNames from '../../utils/classNames';\nimport SmoothScrollbars from '../smoothScrollbars/SmoothScrollbars';\n\nconst RESIZE_THROTTLING = 200;\nconst DEFAULT_BOTTOM_BAR_HEIGHT = 54;\n\nexport type ApplicationLayoutBodyProps = {\n /**\n * Show scroll to top button after scrolling the content.\n *\n * @default true\n */\n enableScrollToTop?: boolean;\n\n /**\n * Always show vertical scrollbar to prevent the content from jumping.\n *\n * @default true\n */\n forceScrollbar?: boolean;\n\n /**\n * Prop to trigger scroll reset from outside. This comes in handy when changing the body content\n * and to reset the scrolling like when the pathname changes from an body internal menu.\n */\n scrollResetTrigger?: any;\n\n /**\n * The ApplicationLayoutBodyBanner component.\n */\n banner?: React.ReactNode;\n\n /**\n * The `ApplicationLayoutBodyNavigation` component.\n */\n navigation?: React.ReactNode;\n\n /**\n * Optional bottom bar component or a simple string.\n */\n bottomBar?: React.ReactNode;\n\n /**\n * Height of the bottomBar in pixel.\n *\n * @default 54\n */\n bottomBarHeight?: number;\n\n /**\n * Additional class names that are added to the inner module-content component.\n */\n innerClassName?: string;\n\n /**\n * Additional class names that are added to the respective component.\n */\n className?: string;\n};\n\ntype Ref = ForwardedRef<HTMLDivElement>;\ntype Props = PropsWithChildren<ApplicationLayoutBodyProps>;\n\nconst ApplicationLayoutBody = forwardRef((props: Props, ref: Ref) => {\n const {\n className,\n innerClassName,\n forceScrollbar = true,\n enableScrollToTop = true,\n banner,\n navigation,\n bottomBar,\n bottomBarHeight = DEFAULT_BOTTOM_BAR_HEIGHT,\n scrollResetTrigger,\n children,\n ...remainingProps\n } = props;\n\n const [offset, setOffset] = useState(0);\n const moduleContentRef = useRef<Scrollbars>(null);\n const layoutBodyRef = useRef<HTMLDivElement | null>(null);\n\n // Use imperative handle to expose the internal layout ref. Usually this is used to\n // expose internal function without exposing the underlying DOM element.\n // In this case however, we want access to the element to trigger functions like scrollIntoView()\n useImperativeHandle<HTMLDivElement, any>(ref, () => layoutBodyRef?.current, []);\n\n // Reset scroll position when children are different. This fixes the issue of\n // changing body content (like in another route) and still having the same scroll position\n // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>\n useEffect(() => {\n if (moduleContentRef.current) {\n moduleContentRef.current.scrollTop(0);\n setOffset(0);\n }\n }, [scrollResetTrigger]);\n\n useEffect(() => {\n if (layoutBodyRef.current?.parentNode instanceof HTMLElement) {\n layoutBodyRef.current.parentNode.style.setProperty(\n '--ApplicationLayoutBodyBottomBarHeight',\n `${bottomBarHeight}px`\n );\n }\n }, [bottomBarHeight]);\n\n const handleScroll = debounce(() => {\n if (moduleContentRef.current) {\n setOffset(moduleContentRef.current.getScrollTop());\n }\n }, RESIZE_THROTTLING);\n\n const handleToTop = () => {\n if (!moduleContentRef.current) {\n return;\n }\n\n const scrollWrapper = moduleContentRef.current.container;\n const scrollingElement = scrollWrapper.firstElementChild;\n const currentScroll = scrollingElement?.scrollTop ?? 0;\n const scrollThreshold = 10;\n\n if (currentScroll > scrollThreshold) {\n window.requestAnimationFrame(handleToTop);\n scrollingElement?.scrollTo(0, currentScroll - currentScroll / 5);\n scrollWrapper.classList.add('is-scrolling-to-top');\n setOffset(currentScroll);\n } else {\n scrollWrapper.classList.remove('is-scrolling-to-top');\n }\n };\n\n const classes = classNames('ApplicationLayoutBody', bottomBar ? 'has-footer' : '', className);\n\n const innerClasses = classNames(\n 'module-content',\n\n innerClassName && innerClassName\n );\n\n const offsetThreshold = window.innerHeight * 0.1;\n\n const scrollToTopClasses = classNames('scroll-to-top', offset > offsetThreshold && 'in');\n\n return (\n <React.Fragment>\n <div {...remainingProps} ref={layoutBodyRef} className={classes}>\n <div className='module-content-wrapper'>\n {navigation && navigation}\n {banner && banner}\n\n <SmoothScrollbars\n ref={moduleContentRef}\n slideIn={!forceScrollbar}\n largeTrack\n trackOffset\n className={innerClasses}\n onScroll={handleScroll}\n >\n <div className='scrollbar-content'>{children}</div>\n </SmoothScrollbars>\n </div>\n\n {enableScrollToTop && (\n <span className={scrollToTopClasses}>\n <button type='button' className='btn btn-primary btn-icon-only' onClick={handleToTop}>\n <span className='rioglyph rioglyph-arrow-up' />\n </button>\n </span>\n )}\n </div>\n\n {bottomBar && bottomBar}\n </React.Fragment>\n );\n});\n\nexport default ApplicationLayoutBody;\n"],"names":["RESIZE_THROTTLING","DEFAULT_BOTTOM_BAR_HEIGHT","ApplicationLayoutBody","forwardRef","props","ref","className","innerClassName","forceScrollbar","enableScrollToTop","banner","navigation","bottomBar","bottomBarHeight","scrollResetTrigger","children","remainingProps","offset","setOffset","useState","moduleContentRef","useRef","layoutBodyRef","useImperativeHandle","useEffect","handleScroll","debounce","handleToTop","scrollWrapper","scrollingElement","currentScroll","classes","classNames","innerClasses","offsetThreshold","scrollToTopClasses","jsxs","React","jsx","SmoothScrollbars"],"mappings":";;;;;AAg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BF,EAAc,UAAU,OAAO,qBAAqB;AAAA,EAE5D,GAEMG,IAAUC,EAAW,yBAAyBpB,IAAY,eAAe,IAAIN,CAAS,GAEtF2B,IAAeD;AAAA,IACjB;AAAA,IAEAzB,KAAkBA;AAAA,EAAA,GAGhB2B,IAAkB,OAAO,cAAc,KAEvCC,IAAqBH,EAAW,iBAAiBf,IAASiB,KAAmB,IAAI;AAEvF,SACI,gBAAAE,EAACC,EAAM,UAAN,EACG,UAAA;AAAA,IAAA,gBAAAD,EAAC,SAAK,GAAGpB,GAAgB,KAAKM,GAAe,WAAWS,GACpD,UAAA;AAAA,MAAA,gBAAAK,EAAC,OAAA,EAAI,WAAU,0BACV,UAAA;AAAA,QAAAzB,KAAcA;AAAA,QACdD,KAAUA;AAAA,QAEX,gBAAA4B;AAAA,UAACC;AAAA,UAAA;AAAA,YACG,KAAKnB;AAAA,YACL,SAAS,CAACZ;AAAA,YACV,YAAU;AAAA,YACV,aAAW;AAAA,YACX,WAAWyB;AAAA,YACX,UAAUR;AAAA,YAEV,UAAA,gBAAAa,EAAC,OAAA,EAAI,WAAU,qBAAqB,UAAAvB,EAAA,CAAS;AAAA,UAAA;AAAA,QAAA;AAAA,MACjD,GACJ;AAAA,MAECN,KACG,gBAAA6B,EAAC,QAAA,EAAK,WAAWH,GACb,UAAA,gBAAAG,EAAC,YAAO,MAAK,UAAS,WAAU,iCAAgC,SAASX,GACrE,UAAA,gBAAAW,EAAC,UAAK,WAAU,8BAA6B,GACjD,EAAA,CACJ;AAAA,IAAA,GAER;AAAA,IAEC1B,KAAaA;AAAA,EAAA,GAClB;AAER,CAAC;"}
1
+ {"version":3,"file":"ApplicationLayoutBody.js","sources":["../../../src/components/applicationLayout/ApplicationLayoutBody.tsx"],"sourcesContent":["import React, {\n useState,\n useRef,\n useEffect,\n forwardRef,\n useImperativeHandle,\n type PropsWithChildren,\n type ForwardedRef,\n} from 'react';\nimport { debounce } from 'es-toolkit/compat';\n\nimport type Scrollbars from 'react-custom-scrollbars-4';\n\nimport classNames from '../../utils/classNames';\nimport SmoothScrollbars from '../smoothScrollbars/SmoothScrollbars';\n\nconst RESIZE_THROTTLING = 200;\nconst DEFAULT_BOTTOM_BAR_HEIGHT = 54;\n\nexport type ApplicationLayoutBodyProps = {\n /**\n * Show scroll to top button after scrolling the content.\n *\n * @default true\n */\n enableScrollToTop?: boolean;\n\n /**\n * Always show vertical scrollbar to prevent the content from jumping.\n *\n * @default true\n */\n forceScrollbar?: boolean;\n\n /**\n * Prop to trigger scroll reset from outside. This comes in handy when changing the body content\n * and to reset the scrolling like when the pathname changes from an body internal menu.\n */\n scrollResetTrigger?: any;\n\n /**\n * The ApplicationLayoutBodyBanner component.\n */\n banner?: React.ReactNode;\n\n /**\n * The `ApplicationLayoutBodyNavigation` component.\n */\n navigation?: React.ReactNode;\n\n /**\n * Optional bottom bar component or a simple string.\n */\n bottomBar?: React.ReactNode;\n\n /**\n * Height of the bottomBar in pixel.\n *\n * @default 54 when bottomBar is set\n */\n bottomBarHeight?: number;\n\n /**\n * Additional class names that are added to the inner module-content component.\n */\n innerClassName?: string;\n\n /**\n * Additional class names that are added to the respective component.\n */\n className?: string;\n};\n\ntype Ref = ForwardedRef<HTMLDivElement>;\ntype Props = PropsWithChildren<ApplicationLayoutBodyProps>;\n\nconst ApplicationLayoutBody = forwardRef((props: Props, ref: Ref) => {\n const {\n className,\n innerClassName,\n forceScrollbar = true,\n enableScrollToTop = true,\n banner,\n navigation,\n bottomBar,\n bottomBarHeight = DEFAULT_BOTTOM_BAR_HEIGHT,\n scrollResetTrigger,\n children,\n ...remainingProps\n } = props;\n\n const [offset, setOffset] = useState(0);\n const moduleContentRef = useRef<Scrollbars>(null);\n const layoutBodyRef = useRef<HTMLDivElement | null>(null);\n\n // Use imperative handle to expose the internal layout ref. Usually this is used to\n // expose internal function without exposing the underlying DOM element.\n // In this case however, we want access to the element to trigger functions like scrollIntoView()\n useImperativeHandle<HTMLDivElement, any>(ref, () => layoutBodyRef?.current, []);\n\n // Reset scroll position when children are different. This fixes the issue of\n // changing body content (like in another route) and still having the same scroll position\n // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>\n useEffect(() => {\n if (moduleContentRef.current) {\n moduleContentRef.current.scrollTop(0);\n setOffset(0);\n }\n }, [scrollResetTrigger]);\n\n useEffect(() => {\n if (layoutBodyRef.current?.parentNode instanceof HTMLElement) {\n if (bottomBar) {\n layoutBodyRef.current.parentNode.style.setProperty(\n '--ApplicationLayoutBodyBottomBarHeight',\n `${bottomBarHeight}px`\n );\n } else {\n layoutBodyRef.current.parentNode.style.removeProperty('--ApplicationLayoutBodyBottomBarHeight');\n }\n }\n }, [bottomBar, bottomBarHeight]);\n\n const handleScroll = debounce(() => {\n if (moduleContentRef.current) {\n setOffset(moduleContentRef.current.getScrollTop());\n }\n }, RESIZE_THROTTLING);\n\n const handleToTop = () => {\n if (!moduleContentRef.current) {\n return;\n }\n\n const scrollWrapper = moduleContentRef.current.container;\n const scrollingElement = scrollWrapper.firstElementChild;\n const currentScroll = scrollingElement?.scrollTop ?? 0;\n const scrollThreshold = 10;\n\n if (currentScroll > scrollThreshold) {\n window.requestAnimationFrame(handleToTop);\n scrollingElement?.scrollTo(0, currentScroll - currentScroll / 5);\n scrollWrapper.classList.add('is-scrolling-to-top');\n setOffset(currentScroll);\n } else {\n scrollWrapper.classList.remove('is-scrolling-to-top');\n }\n };\n\n const classes = classNames('ApplicationLayoutBody', bottomBar ? 'has-footer' : '', className);\n\n const innerClasses = classNames(\n 'module-content',\n\n innerClassName && innerClassName\n );\n\n const offsetThreshold = window.innerHeight * 0.1;\n\n const scrollToTopClasses = classNames('scroll-to-top', offset > offsetThreshold && 'in');\n\n return (\n <React.Fragment>\n <div {...remainingProps} ref={layoutBodyRef} className={classes}>\n <div className='module-content-wrapper'>\n {navigation && navigation}\n {banner && banner}\n\n <SmoothScrollbars\n ref={moduleContentRef}\n slideIn={!forceScrollbar}\n largeTrack\n trackOffset\n className={innerClasses}\n onScroll={handleScroll}\n >\n <div className='scrollbar-content'>{children}</div>\n </SmoothScrollbars>\n </div>\n\n {enableScrollToTop && (\n <span className={scrollToTopClasses}>\n <button type='button' className='btn btn-primary btn-icon-only' onClick={handleToTop}>\n <span className='rioglyph rioglyph-arrow-up' />\n </button>\n </span>\n )}\n </div>\n\n {bottomBar && bottomBar}\n </React.Fragment>\n );\n});\n\nexport default ApplicationLayoutBody;\n"],"names":["RESIZE_THROTTLING","DEFAULT_BOTTOM_BAR_HEIGHT","ApplicationLayoutBody","forwardRef","props","ref","className","innerClassName","forceScrollbar","enableScrollToTop","banner","navigation","bottomBar","bottomBarHeight","scrollResetTrigger","children","remainingProps","offset","setOffset","useState","moduleContentRef","useRef","layoutBodyRef","useImperativeHandle","useEffect","handleScroll","debounce","handleToTop","scrollWrapper","scrollingElement","currentScroll","classes","classNames","innerClasses","offsetThreshold","scrollToTopClasses","jsxs","React","jsx","SmoothScrollbars"],"mappings":";;;;;AAgBA,MAAMA,IAAoB,KACpBC,IAA4B,IA2D5BC,IAAwBC,EAAW,CAACC,GAAcC,MAAa;AACjE,QAAM;AAAA,IACF,WAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC,IAAiB;AAAA,IACjB,mBAAAC,IAAoB;AAAA,IACpB,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,iBAAAC,IAAkBZ;AAAA,IAClB,oBAAAa;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHZ,GAEE,CAACa,GAAQC,CAAS,IAAIC,EAAS,CAAC,GAChCC,IAAmBC,EAAmB,IAAI,GAC1CC,IAAgBD,EAA8B,IAAI;AAKxD,EAAAE,EAAyClB,GAAK,MAAMiB,GAAe,SAAS,CAAA,CAAE,GAK9EE,EAAU,MAAM;AACZ,IAAIJ,EAAiB,YACjBA,EAAiB,QAAQ,UAAU,CAAC,GACpCF,EAAU,CAAC;AAAA,EAEnB,GAAG,CAACJ,CAAkB,CAAC,GA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AAA,YACV,aAAW;AAAA,YACX,WAAWyB;AAAA,YACX,UAAUR;AAAA,YAEV,UAAA,gBAAAa,EAAC,OAAA,EAAI,WAAU,qBAAqB,UAAAvB,EAAA,CAAS;AAAA,UAAA;AAAA,QAAA;AAAA,MACjD,GACJ;AAAA,MAECN,KACG,gBAAA6B,EAAC,QAAA,EAAK,WAAWH,GACb,UAAA,gBAAAG,EAAC,YAAO,MAAK,UAAS,WAAU,iCAAgC,SAASX,GACrE,UAAA,gBAAAW,EAAC,UAAK,WAAU,8BAA6B,GACjD,EAAA,CACJ;AAAA,IAAA,GAER;AAAA,IAEC1B,KAAaA;AAAA,EAAA,GAClB;AAER,CAAC;"}
@@ -1,11 +1,26 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { forwardRef as c } from "react";
3
- import p from "../../utils/classNames.js";
4
- const d = c((a, o) => {
5
- const { className: r, children: e, ...s } = a, t = p("ApplicationLayoutHeader", r);
6
- return /* @__PURE__ */ i("div", { ref: o, ...s, className: t, id: "ApplicationLayoutHeader", children: e });
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { forwardRef as H, useRef as c, useImperativeHandle as y, useLayoutEffect as L } from "react";
3
+ import g from "../../utils/classNames.js";
4
+ const N = H((d, l) => {
5
+ const { className: m, children: r, ...u } = d, e = c(null), a = c(null);
6
+ y(l, () => e.current, [e]), L(() => {
7
+ const t = e.current?.parentNode;
8
+ if (!(t instanceof HTMLElement))
9
+ return;
10
+ t.style.removeProperty("--ApplicationLayoutHeaderHeight");
11
+ const f = window.requestAnimationFrame(() => {
12
+ const o = a.current, h = o?.firstElementChild instanceof HTMLElement && Number.parseFloat(window.getComputedStyle(o.firstElementChild).borderBottomWidth) || 0, n = o?.offsetHeight ?? e.current?.offsetHeight, i = n ? Math.max(0, n - h) : 0;
13
+ i && t.style.setProperty(
14
+ "--ApplicationLayoutHeaderHeight",
15
+ `${i}px`
16
+ );
17
+ });
18
+ return () => window.cancelAnimationFrame(f);
19
+ }, [r]);
20
+ const p = g("ApplicationLayoutHeader", m);
21
+ return /* @__PURE__ */ s("div", { ref: e, ...u, className: p, id: "ApplicationLayoutHeader", children: /* @__PURE__ */ s("div", { ref: a, className: "ApplicationLayoutHeaderContent", children: r }) });
7
22
  });
8
23
  export {
9
- d as default
24
+ N as default
10
25
  };
11
26
  //# sourceMappingURL=ApplicationLayoutHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ApplicationLayoutHeader.js","sources":["../../../src/components/applicationLayout/ApplicationLayoutHeader.tsx"],"sourcesContent":["import { type ForwardedRef, type PropsWithChildren, forwardRef } from 'react';\n\nimport classNames from '../../utils/classNames';\n\nexport type ApplicationLayoutHeaderProps = {\n /**\n * Additional class names that are added to the respective component.\n */\n className?: string;\n};\n\ntype Ref = ForwardedRef<HTMLDivElement>;\ntype Props = PropsWithChildren<ApplicationLayoutHeaderProps>;\n\nconst ApplicationLayoutHeader = forwardRef((props: Props, ref: Ref) => {\n const { className, children, ...remainingProps } = props;\n\n const classes = classNames('ApplicationLayoutHeader', className);\n\n return (\n <div ref={ref} {...remainingProps} className={classes} id='ApplicationLayoutHeader'>\n {children}\n </div>\n );\n});\n\nexport default ApplicationLayoutHeader;\n"],"names":["ApplicationLayoutHeader","forwardRef","props","ref","className","children","remainingProps","classes","classNames","jsx"],"mappings":";;;AAcA,MAAMA,IAA0BC,EAAW,CAACC,GAAcC,MAAa;AACnE,QAAM,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,MAAmBJ,GAE7CK,IAAUC,EAAW,2BAA2BJ,CAAS;AAE/D,SACI,gBAAAK,EAAC,SAAI,KAAAN,GAAW,GAAGG,GAAgB,WAAWC,GAAS,IAAG,2BACrD,UAAAF,EAAA,CACL;AAER,CAAC;"}
1
+ {"version":3,"file":"ApplicationLayoutHeader.js","sources":["../../../src/components/applicationLayout/ApplicationLayoutHeader.tsx"],"sourcesContent":["import {\n type ForwardedRef,\n type PropsWithChildren,\n forwardRef,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n} from 'react';\n\nimport classNames from '../../utils/classNames';\n\nexport type ApplicationLayoutHeaderProps = {\n /**\n * Additional class names that are added to the respective component.\n */\n className?: string;\n};\n\ntype Ref = ForwardedRef<HTMLDivElement>;\ntype Props = PropsWithChildren<ApplicationLayoutHeaderProps>;\n\nconst ApplicationLayoutHeader = forwardRef((props: Props, ref: Ref) => {\n const { className, children, ...remainingProps } = props;\n\n const layoutHeaderRef = useRef<HTMLDivElement | null>(null);\n const layoutHeaderContentRef = useRef<HTMLDivElement | null>(null);\n\n useImperativeHandle(ref, () => layoutHeaderRef.current as HTMLDivElement, [layoutHeaderRef]);\n\n useLayoutEffect(() => {\n const applicationLayout = layoutHeaderRef.current?.parentNode;\n\n if (!(applicationLayout instanceof HTMLElement)) {\n return;\n }\n\n applicationLayout.style.removeProperty('--ApplicationLayoutHeaderHeight');\n\n const animationFrameId = window.requestAnimationFrame(() => {\n const headerContent = layoutHeaderContentRef.current;\n const headerBorderWidth =\n headerContent?.firstElementChild instanceof HTMLElement\n ? Number.parseFloat(window.getComputedStyle(headerContent.firstElementChild).borderBottomWidth) || 0\n : 0;\n const headerHeight = headerContent?.offsetHeight ?? layoutHeaderRef.current?.offsetHeight;\n const headerHeightWithoutBorder = headerHeight ? Math.max(0, headerHeight - headerBorderWidth) : 0;\n\n if (headerHeightWithoutBorder) {\n applicationLayout.style.setProperty(\n '--ApplicationLayoutHeaderHeight',\n `${headerHeightWithoutBorder}px`\n );\n }\n });\n\n return () => window.cancelAnimationFrame(animationFrameId);\n }, [children]);\n\n const classes = classNames('ApplicationLayoutHeader', className);\n\n return (\n <div ref={layoutHeaderRef} {...remainingProps} className={classes} id='ApplicationLayoutHeader'>\n <div ref={layoutHeaderContentRef} className='ApplicationLayoutHeaderContent'>\n {children}\n </div>\n </div>\n );\n});\n\nexport default ApplicationLayoutHeader;\n"],"names":["ApplicationLayoutHeader","forwardRef","props","ref","className","children","remainingProps","layoutHeaderRef","useRef","layoutHeaderContentRef","useImperativeHandle","useLayoutEffect","applicationLayout","animationFrameId","headerContent","headerBorderWidth","headerHeight","headerHeightWithoutBorder","classes","classNames"],"mappings":";;;AAqBA,MAAMA,IAA0BC,EAAW,CAACC,GAAcC,MAAa;AACnE,QAAM,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,MAAmBJ,GAE7CK,IAAkBC,EAA8B,IAAI,GACpDC,IAAyBD,EAA8B,IAAI;AAEjE,EAAAE,EAAoBP,GAAK,MAAMI,EAAgB,SAA2B,CAACA,CAAe,CAAC,GAE3FI,EAAgB,MAAM;AAClB,UAAMC,IAAoBL,EAAgB,SAAS;AAEnD,QAAI,EAAEK,aAA6B;AAC/B;AAGJ,IAAAA,EAAkB,MAAM,eAAe,iCAAiC;AAExE,UAAMC,IAAmB,OAAO,sBAAsB,MAAM;AACxD,YAAMC,IAAgBL,EAAuB,SACvCM,IACFD,GAAe,6BAA6B,eACtC,OAAO,WAAW,OAAO,iBAAiBA,EAAc,iBAAiB,EAAE,iBAAiB,KAAK,GAErGE,IAAeF,GAAe,gBAAgBP,EAAgB,SAAS,cACvEU,IAA4BD,IAAe,KAAK,IAAI,GAAGA,IAAeD,CAAiB,IAAI;AAEjG,MAAIE,KACAL,EAAkB,MAAM;AAAA,QACpB;AAAA,QACA,GAAGK,CAAyB;AAAA,MAAA;AAAA,IAGxC,CAAC;AAED,WAAO,MAAM,OAAO,qBAAqBJ,CAAgB;AAAA,EAC7D,GAAG,CAACR,CAAQ,CAAC;AAEb,QAAMa,IAAUC,EAAW,2BAA2Bf,CAAS;AAE/D,2BACK,OAAA,EAAI,KAAKG,GAAkB,GAAGD,GAAgB,WAAWY,GAAS,IAAG,2BAClE,4BAAC,OAAA,EAAI,KAAKT,GAAwB,WAAU,kCACvC,UAAAJ,GACL,GACJ;AAER,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTreeHeight.js","sources":["../../../src/components/assetTree/useTreeHeight.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nconst DEFAULT_TREE_ROOT_HEIGHT = 300;\n\nexport const useTreeHeight = (treeRef: React.RefObject<HTMLDivElement>, scrollHeight?: number) => {\n const [containerHeight, setContainerHeight] = useState<number>(350);\n\n // Enhanced height calculation with multiple fallback strategies\n useEffect(() => {\n const calculateHeight = () => {\n if (!treeRef.current) {\n return DEFAULT_TREE_ROOT_HEIGHT;\n }\n\n const parentElement = treeRef.current;\n const treeHeaderElement = parentElement.querySelector('.TreeHeader');\n\n if (scrollHeight) {\n // Use scrollHeight prop if provided\n return scrollHeight;\n }\n\n const treeRoot = treeRef.current.querySelector('.TreeRoot');\n return treeRoot?.clientHeight ?? DEFAULT_TREE_ROOT_HEIGHT;\n };\n\n const updateHeight = () => {\n const newHeight = calculateHeight();\n setContainerHeight(newHeight);\n };\n\n // Debounce height updates to avoid excessive recalculations\n let timeoutId: NodeJS.Timeout;\n const debouncedUpdate = () => {\n clearTimeout(timeoutId);\n timeoutId = setTimeout(updateHeight, 16); // ~60fps\n };\n\n // Initial calculation with small delay to ensure DOM is ready\n const initialTimeout = setTimeout(updateHeight, 50);\n\n // Set up observers\n const resizeObserver = new ResizeObserver(debouncedUpdate);\n const mutationObserver = new MutationObserver(debouncedUpdate);\n\n if (treeRef.current) {\n // Watch parent for size changes\n resizeObserver.observe(treeRef.current);\n if (treeRef.current.parentElement) {\n resizeObserver.observe(treeRef.current.parentElement);\n }\n\n // Watch for DOM changes that might affect layout\n mutationObserver.observe(treeRef.current, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['style', 'class'],\n });\n }\n\n // Window resize listener\n window.addEventListener('resize', debouncedUpdate);\n\n return () => {\n clearTimeout(initialTimeout);\n clearTimeout(timeoutId);\n resizeObserver.disconnect();\n mutationObserver.disconnect();\n window.removeEventListener('resize', debouncedUpdate);\n };\n }, [scrollHeight, treeRef]); // Re-run if scrollHeight prop changes or treeRef changes\n\n return containerHeight;\n};\n"],"names":["DEFAULT_TREE_ROOT_HEIGHT","useTreeHeight","treeRef","scrollHeight","containerHeight","setContainerHeight","useState","useEffect","calculateHeight","updateHeight","newHeight","timeoutId","debouncedUpdate","initialTimeout","resizeObserver","mutationObserver"],"mappings":";AAEA,MAAMA,IAA2B,KAEpBC,IAAgB,CAACC,GAA0CC,MAA0B;AAC9F,QAAM,CAACC,GAAiBC,CAAkB,IAAIC,EAAiB,GAAG;AAGlE,SAAAC,EAAU,MAAM;AACZ,UAAMC,IAAkB,MACfN,EAAQ,WAISA,EAAQ,QACU,cAAc,aAAa,GAE/DC,MAKaD,EAAQ,QAAQ,cAAc,WAAW,GACzC,gBAAgBF,MAZtBA,GAeTS,IAAe,MAAM;AACvB,YAAMC,IAAYF,EAAA;AAClB,MAAAH,EAAmBK,CAAS;AAAA,IAChC;AAGA,QAAIC;AACJ,UAAMC,IAAkB,MAAM;AAC1B,mBAAaD,CAAS,GACtBA,IAAY,WAAWF,GAAc,EAAE;AAAA,IAC3C,GAGMI,IAAiB,WAAWJ,GAAc,EAAE,GAG5CK,IAAiB,IAAI,eAAeF,CAAe,GACnDG,IAAmB,IAAI,iBAAiBH,CAAe;AAE7D,WAAIV,EAAQ,YAERY,EAAe,QAAQZ,EAAQ,OAAO,GAClCA,EAAQ,QAAQ,iBAChBY,EAAe,QAAQZ,EAAQ,QAAQ,aAAa,GAIxDa,EAAiB,QAAQb,EAAQ,SAAS;AAAA,MACtC,WAAW;AAAA,MACX,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,iBAAiB,CAAC,SAAS,OAAO;AAAA,IAAA,CACrC,IAIL,OAAO,iBAAiB,UAAUU,CAAe,GAE1C,MAAM;AACT,mBAAaC,CAAc,GAC3B,aAAaF,CAAS,GACtBG,EAAe,WAAA,GACfC,EAAiB,WAAA,GACjB,OAAO,oBAAoB,UAAUH,CAAe;AAAA,IACxD;AAAA,EACJ,GAAG,CAACT,GAAcD,CAAO,CAAC,GAEnBE;AACX;"}
1
+ {"version":3,"file":"useTreeHeight.js","sources":["../../../src/components/assetTree/useTreeHeight.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nconst DEFAULT_TREE_ROOT_HEIGHT = 300;\n\nexport const useTreeHeight = (treeRef: React.RefObject<HTMLDivElement>, scrollHeight?: number) => {\n const [containerHeight, setContainerHeight] = useState<number>(350);\n\n // Enhanced height calculation with multiple fallback strategies\n useEffect(() => {\n const calculateHeight = () => {\n if (!treeRef.current) {\n return DEFAULT_TREE_ROOT_HEIGHT;\n }\n\n const parentElement = treeRef.current;\n const treeHeaderElement = parentElement.querySelector('.TreeHeader');\n\n if (scrollHeight) {\n // Use scrollHeight prop if provided\n return scrollHeight;\n }\n\n const treeRoot = treeRef.current.querySelector('.TreeRoot');\n return treeRoot?.clientHeight ?? DEFAULT_TREE_ROOT_HEIGHT;\n };\n\n const updateHeight = () => {\n const newHeight = calculateHeight();\n setContainerHeight(newHeight);\n };\n\n // Debounce height updates to avoid excessive recalculations\n let timeoutId: number | undefined;\n const debouncedUpdate = () => {\n clearTimeout(timeoutId);\n timeoutId = setTimeout(updateHeight, 16); // ~60fps\n };\n\n // Initial calculation with small delay to ensure DOM is ready\n const initialTimeout = setTimeout(updateHeight, 50);\n\n // Set up observers\n const resizeObserver = new ResizeObserver(debouncedUpdate);\n const mutationObserver = new MutationObserver(debouncedUpdate);\n\n if (treeRef.current) {\n // Watch parent for size changes\n resizeObserver.observe(treeRef.current);\n if (treeRef.current.parentElement) {\n resizeObserver.observe(treeRef.current.parentElement);\n }\n\n // Watch for DOM changes that might affect layout\n mutationObserver.observe(treeRef.current, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['style', 'class'],\n });\n }\n\n // Window resize listener\n window.addEventListener('resize', debouncedUpdate);\n\n return () => {\n clearTimeout(initialTimeout);\n clearTimeout(timeoutId);\n resizeObserver.disconnect();\n mutationObserver.disconnect();\n window.removeEventListener('resize', debouncedUpdate);\n };\n }, [scrollHeight, treeRef]); // Re-run if scrollHeight prop changes or treeRef changes\n\n return containerHeight;\n};\n"],"names":["DEFAULT_TREE_ROOT_HEIGHT","useTreeHeight","treeRef","scrollHeight","containerHeight","setContainerHeight","useState","useEffect","calculateHeight","updateHeight","newHeight","timeoutId","debouncedUpdate","initialTimeout","resizeObserver","mutationObserver"],"mappings":";AAEA,MAAMA,IAA2B,KAEpBC,IAAgB,CAACC,GAA0CC,MAA0B;AAC9F,QAAM,CAACC,GAAiBC,CAAkB,IAAIC,EAAiB,GAAG;AAGlE,SAAAC,EAAU,MAAM;AACZ,UAAMC,IAAkB,MACfN,EAAQ,WAISA,EAAQ,QACU,cAAc,aAAa,GAE/DC,MAKaD,EAAQ,QAAQ,cAAc,WAAW,GACzC,gBAAgBF,MAZtBA,GAeTS,IAAe,MAAM;AACvB,YAAMC,IAAYF,EAAA;AAClB,MAAAH,EAAmBK,CAAS;AAAA,IAChC;AAGA,QAAIC;AACJ,UAAMC,IAAkB,MAAM;AAC1B,mBAAaD,CAAS,GACtBA,IAAY,WAAWF,GAAc,EAAE;AAAA,IAC3C,GAGMI,IAAiB,WAAWJ,GAAc,EAAE,GAG5CK,IAAiB,IAAI,eAAeF,CAAe,GACnDG,IAAmB,IAAI,iBAAiBH,CAAe;AAE7D,WAAIV,EAAQ,YAERY,EAAe,QAAQZ,EAAQ,OAAO,GAClCA,EAAQ,QAAQ,iBAChBY,EAAe,QAAQZ,EAAQ,QAAQ,aAAa,GAIxDa,EAAiB,QAAQb,EAAQ,SAAS;AAAA,MACtC,WAAW;AAAA,MACX,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,iBAAiB,CAAC,SAAS,OAAO;AAAA,IAAA,CACrC,IAIL,OAAO,iBAAiB,UAAUU,CAAe,GAE1C,MAAM;AACT,mBAAaC,CAAc,GAC3B,aAAaF,CAAS,GACtBG,EAAe,WAAA,GACfC,EAAiB,WAAA,GACjB,OAAO,oBAAoB,UAAUH,CAAe;AAAA,IACxD;AAAA,EACJ,GAAG,CAACT,GAAcD,CAAO,CAAC,GAEnBE;AACX;"}
@@ -82,8 +82,12 @@ type BaseButtonProps = {
82
82
  */
83
83
  iconRight?: boolean;
84
84
  /**
85
- * Optional rio-glyph icon name that comes in handy for icon only buttons for not adding
86
- * a span tag for the icon which reduces boilerplate code.
85
+ * Optional RIOglyph icon class name that comes in handy for icon-only buttons without adding
86
+ * a separate icon span.
87
+ *
88
+ * Use only exact existing `rioglyph-*` classes from the generated UIKIT icon contract,
89
+ * for example `rioglyph-download`. Do not compose or guess semantic icon names; an unknown
90
+ * icon class renders as a filled rectangle.
87
91
  */
88
92
  iconName?: string;
89
93
  /**
@@ -143,7 +147,11 @@ type NativeButtonProps = Omit<HTMLProps<HTMLButtonElement>, 'as' | 'type' | 'onC
143
147
  */
144
148
  as?: 'button';
145
149
  /**
146
- * Defines the type of the button. This may be used for form submit buttons.
150
+ * Defines the native button type.
151
+ *
152
+ * The Button component renders a native `<button>` with `type="button"` by default.
153
+ * Only set `type="submit"` when the button should submit a form. Do not add
154
+ * `type="button"` defensively unless local code style requires explicit defaults.
147
155
  *
148
156
  * @default 'button'
149
157
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../src/components/button/Button.tsx"],"sourcesContent":["import React, {\n forwardRef,\n type ForwardRefExoticComponent,\n type HTMLProps,\n type PropsWithChildren,\n type RefAttributes,\n useRef,\n useState,\n} from 'react';\nimport { noop } from 'es-toolkit/function';\n\nimport classNames from '../../utils/classNames';\nimport { createButtonRipple } from '../../utils/buttonEffect';\nimport useMergeRefs from '../../hooks/useMergeRefs';\nimport type { ObjectValues } from '../../utils/ObjectValues';\nimport { getAutoTrackingAttributes } from '../../utils/analytics/autoTracking';\n\nexport const STYLES_MAP = {\n DEFAULT: 'default',\n UNSTYLED: 'unstyled',\n PRIMARY: 'primary',\n SECONDARY: 'secondary',\n INFO: 'info',\n WARNING: 'warning',\n DANGER: 'danger',\n SUCCESS: 'success',\n MUTED: 'muted',\n MUTED_FILLED: 'muted-filled',\n} as const;\n\n// export for convenient usage on client side\nexport type BUTTON_STYLE = ObjectValues<typeof STYLES_MAP>;\n\nexport const VARIANTS_MAP = {\n VARIANT_LINK: 'link',\n VARIANT_LINK_INLINE: 'link-inline',\n VARIANT_OUTLINE: 'outline',\n VARIANT_ACTION: 'action',\n} as const;\n\nexport type BUTTON_VARIANT = ObjectValues<typeof VARIANTS_MAP>;\n\nexport const SIZES_MAP = {\n XS: 'xs',\n SM: 'sm',\n MD: 'md',\n LG: 'lg',\n} as const;\n\nexport type BUTTON_SIZE = ObjectValues<typeof SIZES_MAP>;\n\n/*\n * ATTENTION: We're typing the onClick handler based on the value of `asToggle`.\n *\n * It does not fully work here inside of this file, though. Therefore, we have to apply some explicit casts below.\n * In code _using_ the Button component, however, the parameter type of the onClick handler must either be a boolean or\n * a React.MouseEvent, respectively.\n */\n\ntype RegularButton = {\n /**\n * Use the button as a toggle button. The toggle state can be controlled via the `active` prop.\n *\n * @default false\n */\n asToggle?: false;\n\n /**\n * Callback function triggered when clicking the button.\n *\n * @param event The MouseEvent that triggered the click.\n */\n onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n};\n\ntype ToggleButton = {\n /**\n * Use the button as a toggle button. The toggle state can be controlled via the `active` prop.\n *\n * @default false\n */\n asToggle: true;\n\n /**\n * Callback function triggered when clicking the button.\n *\n * @param value The new value of the toggle button.\n */\n onClick?: (value: boolean) => void;\n};\n\ntype BaseButtonProps = {\n /**\n * Whether the button should be disabled.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Set the button toggled. Should be used in combination with \"asToggle\" prop.\n *\n * @default false\n */\n active?: boolean;\n\n /**\n * Use when the content of the button is an icon only to adapt the button spacing accordingly.\n *\n * @default false\n */\n iconOnly?: boolean;\n\n /**\n * Adds right side spacing for an icon. This should be used when having navigation buttons\n * that use an icon on the right side.\n *\n * @default false\n */\n iconRight?: boolean;\n\n /**\n * Optional rio-glyph icon name that comes in handy for icon only buttons for not adding\n * a span tag for the icon which reduces boilerplate code.\n */\n iconName?: string;\n\n /**\n * Defines whether the button text break into multiple lines when the button space exceeds.\n *\n * Multiline buttons should be used as exception only.\n *\n * @default false\n */\n multiline?: boolean;\n\n /**\n * Defines whether the button takes up the full width of the parent element.\n *\n * @default false\n */\n block?: boolean;\n\n /**\n * Sets the button style.\n * @default 'default'\n */\n bsStyle?: BUTTON_STYLE;\n\n /**\n * Sets the button size.\n */\n bsSize?: BUTTON_SIZE;\n\n /**\n * Sets the button variant.\n */\n variant?: BUTTON_VARIANT;\n\n /**\n * Whether the \"ripple\" effect should be suppressed on this button.\n */\n noRippleEffect?: boolean;\n\n /**\n * Optional key used to generate automatic GA tracking attributes when no explicit\n * tracking attributes are provided.\n *\n * Resulting label format: `button::<autoTrackingKey>`.\n */\n autoTrackingKey?: string;\n\n /**\n * Number of the index used for keyboard support.\n *\n * @default 0\n */\n tabIndex?: number;\n\n /**\n * Additional classes to be set on the button element.\n */\n className?: string;\n};\n\ntype NativeButtonProps = Omit<HTMLProps<HTMLButtonElement>, 'as' | 'type' | 'onClick' | 'ref'> &\n BaseButtonProps & {\n /**\n * Defines this component as a native button element.\n *\n * @default 'button'\n */\n as?: 'button';\n\n /**\n * Defines the type of the button. This may be used for form submit buttons.\n *\n * @default 'button'\n */\n type?: 'button' | 'submit';\n } & (RegularButton | ToggleButton);\n\ntype LinkButtonProps = Omit<HTMLProps<HTMLAnchorElement>, 'as' | 'type' | 'onClick' | 'ref'> &\n BaseButtonProps & {\n /**\n * Defines this component as a link element.\n */\n as: 'a';\n\n /**\n * Native button type is not supported when using `as=\"a\"`.\n */\n type?: never;\n\n /**\n * Defines the destination URL for the link button.\n */\n href: string;\n\n /**\n * Toggle behavior is not supported when using `as=\"a\"`.\n *\n * @default false\n */\n asToggle?: false;\n\n /**\n * Callback function triggered when clicking the link.\n *\n * @param event The MouseEvent that triggered the click.\n */\n onClick?: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;\n };\n\nexport type ButtonProps = NativeButtonProps | LinkButtonProps;\n\ntype Props = PropsWithChildren<ButtonProps>;\n\n// Define statics to be used as \"Button.PRIMARY\"\ntype ButtonType = ForwardRefExoticComponent<Props & RefAttributes<HTMLButtonElement>> & {\n DEFAULT: 'default';\n UNSTYLED: 'unstyled';\n PRIMARY: 'primary';\n SECONDARY: 'secondary';\n INFO: 'info';\n WARNING: 'warning';\n DANGER: 'danger';\n SUCCESS: 'success';\n MUTED: 'muted';\n MUTED_FILLED: 'muted-filled';\n\n VARIANT_LINK: 'link';\n VARIANT_LINK_INLINE: 'link-inline';\n VARIANT_OUTLINE: 'outline';\n VARIANT_ACTION: 'action';\n\n XS: 'xs';\n SM: 'sm';\n MD: 'md';\n LG: 'lg';\n};\n\nconst Button = forwardRef<HTMLButtonElement, Props>((props, ref) => {\n const {\n as = 'button',\n active = false,\n disabled = false,\n asToggle = false,\n onClick = noop,\n bsStyle = 'default',\n bsSize,\n variant,\n iconOnly = false,\n iconName,\n iconRight = false,\n multiline = false,\n block = false,\n className = '',\n noRippleEffect = false,\n autoTrackingKey,\n type = 'button',\n tabIndex = 0,\n children,\n ...remainingProps\n } = props;\n\n const autoTrackingAttributes = getAutoTrackingAttributes({\n autoTrackingKey,\n props: remainingProps as Record<string, unknown>,\n source: 'button',\n });\n\n const [isToggled, setIsToggled] = useState(active);\n\n const btnRef = useRef<HTMLButtonElement>(null);\n\n const buttonRef = useMergeRefs(btnRef, ref);\n\n // Update internal toggle state when used as controlled component and outside toggle state changes\n // Note, using the usePrevious hook resulted in an endless loop, hence the useState here\n const [previousActive, setPreviousActive] = useState(active);\n if (active !== previousActive) {\n setIsToggled(active);\n setPreviousActive(active);\n }\n\n const handleButtonClick = (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n if (!noRippleEffect) {\n createButtonRipple(event.nativeEvent, event.currentTarget);\n }\n\n if (asToggle) {\n // Intercept click handler only for toggle button to update internal state and blur after click\n const newIsToggled = !isToggled;\n setIsToggled(newIsToggled);\n\n if (newIsToggled) {\n btnRef.current?.blur();\n }\n\n (onClick as (x: boolean) => void)(newIsToggled);\n } else {\n (onClick as (x: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void)(event);\n }\n };\n\n const handleLinkClick = (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n\n if (!noRippleEffect) {\n createButtonRipple(event.nativeEvent, event.currentTarget);\n }\n\n (onClick as (x: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void)(event);\n };\n\n const buttonClassNames = classNames(\n 'btn',\n `btn-${bsStyle}`,\n variant === VARIANTS_MAP.VARIANT_LINK && 'btn-link',\n variant === VARIANTS_MAP.VARIANT_LINK_INLINE && 'btn-link btn-link-inline',\n variant === VARIANTS_MAP.VARIANT_OUTLINE && 'btn-outline',\n variant === VARIANTS_MAP.VARIANT_ACTION && 'btn-action',\n bsSize && `btn-${bsSize}`,\n asToggle && 'btn-toggle',\n isToggled && 'active',\n iconOnly && 'btn-icon-only',\n iconRight && 'btn-icon-right',\n multiline && 'btn-multiline',\n block && 'btn-block',\n as === 'a' && 'gap-0',\n as === 'a' && disabled && 'disabled',\n 'btn-component',\n className\n );\n\n if (as === 'a') {\n return (\n <a\n ref={buttonRef as React.Ref<HTMLAnchorElement>}\n {...(remainingProps as Omit<HTMLProps<HTMLAnchorElement>, 'as' | 'type' | 'onClick' | 'ref'>)}\n {...autoTrackingAttributes}\n className={buttonClassNames}\n onClick={handleLinkClick}\n aria-disabled={disabled || undefined}\n tabIndex={disabled ? -1 : tabIndex}\n >\n {iconName && <span className={`rioglyph ${iconName}`} />}\n {children}\n </a>\n );\n }\n\n return (\n <button\n ref={buttonRef}\n type={type}\n {...(remainingProps as Omit<HTMLProps<HTMLButtonElement>, 'as' | 'type' | 'onClick' | 'ref'>)}\n {...autoTrackingAttributes}\n className={buttonClassNames}\n onClick={handleButtonClick}\n disabled={disabled}\n tabIndex={tabIndex}\n >\n {iconName && <span className={`rioglyph ${iconName}`} />}\n {children}\n </button>\n );\n}) as ButtonType;\n\nObject.assign(Button, STYLES_MAP);\nObject.assign(Button, VARIANTS_MAP);\nObject.assign(Button, SIZES_MAP);\n\nexport default Button;\n"],"names":["STYLES_MAP","VARIANTS_MAP","SIZES_MAP","Button","forwardRef","props","ref","as","active","disabled","asToggle","onClick","noop","bsStyle","bsSize","variant","iconOnly","iconName","iconRight","multiline","block","className","noRippleEffect","autoTrackingKey","type","tabIndex","children","remainingProps","autoTrackingAttributes","getAutoTrackingAttributes","isToggled","setIsToggled","useState","btnRef","useRef","buttonRef","useMergeRefs","previousActive","setPreviousActive","handleButtonClick","event","createButtonRipple","newIsToggled","handleLinkClick","buttonClassNames","classNames","jsxs","jsx"],"mappings":";;;;;;;AAiBO,MAAMA,IAAa;AAAA,EACtB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS;AAAA,EACT,WAAW;AAAA,EACX,MAAM;AAAA,EACN,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,OAAO;AAAA,EACP,cAAc;AAClB,GAKaC,IAAe;AAAA,EACxB,cAAc;AAAA,EACd,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,gBAAgB;AACpB,GAIaC,IAAY;AAAA,EACrB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACR,GAuNMC,IAASC,EAAqC,CAACC,GAAOC,MAAQ;AAChE,QAAM;AAAA,IACF,IAAAC,IAAK;AAAA,IACL,QAAAC,IAAS;AAAA,IACT,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,SAAAC,IAAUC;AAAA,IACV,SAAAC,IAAU;AAAA,IACV,QAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,WAAAC,IAAY;AAAA,IACZ,OAAAC,IAAQ;AAAA,IACR,WAAAC,IAAY;AAAA,IACZ,gBAAAC,IAAiB;AAAA,IACjB,iBAAAC;AAAA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Tb,MAAO,OAAO;AAAA,IACdA,MAAO,OAAOE,KAAY;AAAA,IAC1B;AAAA,IACAY;AAAA,EAAA;AAGJ,SAAId,MAAO,MAEH,gBAAAuC;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,KAAKX;AAAA,MACJ,GAAIR;AAAA,MACJ,GAAGC;AAAA,MACJ,WAAWgB;AAAA,MACX,SAASD;AAAA,MACT,iBAAelC,KAAY;AAAA,MAC3B,UAAUA,IAAW,KAAKgB;AAAA,MAEzB,UAAA;AAAA,QAAAR,KAAY,gBAAA8B,EAAC,QAAA,EAAK,WAAW,YAAY9B,CAAQ,IAAI;AAAA,QACrDS;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IAMT,gBAAAoB;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,KAAKX;AAAA,MACL,MAAAX;AAAA,MACC,GAAIG;AAAA,MACJ,GAAGC;AAAA,MACJ,WAAWgB;AAAA,MACX,SAASL;AAAA,MACT,UAAA9B;AAAA,MACA,UAAAgB;AAAA,MAEC,UAAA;AAAA,QAAAR,KAAY,gBAAA8B,EAAC,QAAA,EAAK,WAAW,YAAY9B,CAAQ,IAAI;AAAA,QACrDS;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGb,CAAC;AAED,OAAO,OAAOvB,GAAQH,CAAU;AAChC,OAAO,OAAOG,GAAQF,CAAY;AAClC,OAAO,OAAOE,GAAQD,CAAS;"}
1
+ {"version":3,"file":"Button.js","sources":["../../../src/components/button/Button.tsx"],"sourcesContent":["import React, {\n forwardRef,\n type ForwardRefExoticComponent,\n type HTMLProps,\n type PropsWithChildren,\n type RefAttributes,\n useRef,\n useState,\n} from 'react';\nimport { noop } from 'es-toolkit/function';\n\nimport classNames from '../../utils/classNames';\nimport { createButtonRipple } from '../../utils/buttonEffect';\nimport useMergeRefs from '../../hooks/useMergeRefs';\nimport type { ObjectValues } from '../../utils/ObjectValues';\nimport { getAutoTrackingAttributes } from '../../utils/analytics/autoTracking';\n\nexport const STYLES_MAP = {\n DEFAULT: 'default',\n UNSTYLED: 'unstyled',\n PRIMARY: 'primary',\n SECONDARY: 'secondary',\n INFO: 'info',\n WARNING: 'warning',\n DANGER: 'danger',\n SUCCESS: 'success',\n MUTED: 'muted',\n MUTED_FILLED: 'muted-filled',\n} as const;\n\n// export for convenient usage on client side\nexport type BUTTON_STYLE = ObjectValues<typeof STYLES_MAP>;\n\nexport const VARIANTS_MAP = {\n VARIANT_LINK: 'link',\n VARIANT_LINK_INLINE: 'link-inline',\n VARIANT_OUTLINE: 'outline',\n VARIANT_ACTION: 'action',\n} as const;\n\nexport type BUTTON_VARIANT = ObjectValues<typeof VARIANTS_MAP>;\n\nexport const SIZES_MAP = {\n XS: 'xs',\n SM: 'sm',\n MD: 'md',\n LG: 'lg',\n} as const;\n\nexport type BUTTON_SIZE = ObjectValues<typeof SIZES_MAP>;\n\n/*\n * ATTENTION: We're typing the onClick handler based on the value of `asToggle`.\n *\n * It does not fully work here inside of this file, though. Therefore, we have to apply some explicit casts below.\n * In code _using_ the Button component, however, the parameter type of the onClick handler must either be a boolean or\n * a React.MouseEvent, respectively.\n */\n\ntype RegularButton = {\n /**\n * Use the button as a toggle button. The toggle state can be controlled via the `active` prop.\n *\n * @default false\n */\n asToggle?: false;\n\n /**\n * Callback function triggered when clicking the button.\n *\n * @param event The MouseEvent that triggered the click.\n */\n onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n};\n\ntype ToggleButton = {\n /**\n * Use the button as a toggle button. The toggle state can be controlled via the `active` prop.\n *\n * @default false\n */\n asToggle: true;\n\n /**\n * Callback function triggered when clicking the button.\n *\n * @param value The new value of the toggle button.\n */\n onClick?: (value: boolean) => void;\n};\n\ntype BaseButtonProps = {\n /**\n * Whether the button should be disabled.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Set the button toggled. Should be used in combination with \"asToggle\" prop.\n *\n * @default false\n */\n active?: boolean;\n\n /**\n * Use when the content of the button is an icon only to adapt the button spacing accordingly.\n *\n * @default false\n */\n iconOnly?: boolean;\n\n /**\n * Adds right side spacing for an icon. This should be used when having navigation buttons\n * that use an icon on the right side.\n *\n * @default false\n */\n iconRight?: boolean;\n\n /**\n * Optional RIOglyph icon class name that comes in handy for icon-only buttons without adding\n * a separate icon span.\n *\n * Use only exact existing `rioglyph-*` classes from the generated UIKIT icon contract,\n * for example `rioglyph-download`. Do not compose or guess semantic icon names; an unknown\n * icon class renders as a filled rectangle.\n */\n iconName?: string;\n\n /**\n * Defines whether the button text break into multiple lines when the button space exceeds.\n *\n * Multiline buttons should be used as exception only.\n *\n * @default false\n */\n multiline?: boolean;\n\n /**\n * Defines whether the button takes up the full width of the parent element.\n *\n * @default false\n */\n block?: boolean;\n\n /**\n * Sets the button style.\n * @default 'default'\n */\n bsStyle?: BUTTON_STYLE;\n\n /**\n * Sets the button size.\n */\n bsSize?: BUTTON_SIZE;\n\n /**\n * Sets the button variant.\n */\n variant?: BUTTON_VARIANT;\n\n /**\n * Whether the \"ripple\" effect should be suppressed on this button.\n */\n noRippleEffect?: boolean;\n\n /**\n * Optional key used to generate automatic GA tracking attributes when no explicit\n * tracking attributes are provided.\n *\n * Resulting label format: `button::<autoTrackingKey>`.\n */\n autoTrackingKey?: string;\n\n /**\n * Number of the index used for keyboard support.\n *\n * @default 0\n */\n tabIndex?: number;\n\n /**\n * Additional classes to be set on the button element.\n */\n className?: string;\n};\n\ntype NativeButtonProps = Omit<HTMLProps<HTMLButtonElement>, 'as' | 'type' | 'onClick' | 'ref'> &\n BaseButtonProps & {\n /**\n * Defines this component as a native button element.\n *\n * @default 'button'\n */\n as?: 'button';\n\n /**\n * Defines the native button type.\n *\n * The Button component renders a native `<button>` with `type=\"button\"` by default.\n * Only set `type=\"submit\"` when the button should submit a form. Do not add\n * `type=\"button\"` defensively unless local code style requires explicit defaults.\n *\n * @default 'button'\n */\n type?: 'button' | 'submit';\n } & (RegularButton | ToggleButton);\n\ntype LinkButtonProps = Omit<HTMLProps<HTMLAnchorElement>, 'as' | 'type' | 'onClick' | 'ref'> &\n BaseButtonProps & {\n /**\n * Defines this component as a link element.\n */\n as: 'a';\n\n /**\n * Native button type is not supported when using `as=\"a\"`.\n */\n type?: never;\n\n /**\n * Defines the destination URL for the link button.\n */\n href: string;\n\n /**\n * Toggle behavior is not supported when using `as=\"a\"`.\n *\n * @default false\n */\n asToggle?: false;\n\n /**\n * Callback function triggered when clicking the link.\n *\n * @param event The MouseEvent that triggered the click.\n */\n onClick?: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;\n };\n\nexport type ButtonProps = NativeButtonProps | LinkButtonProps;\n\ntype Props = PropsWithChildren<ButtonProps>;\n\n// Define statics to be used as \"Button.PRIMARY\"\ntype ButtonType = ForwardRefExoticComponent<Props & RefAttributes<HTMLButtonElement>> & {\n DEFAULT: 'default';\n UNSTYLED: 'unstyled';\n PRIMARY: 'primary';\n SECONDARY: 'secondary';\n INFO: 'info';\n WARNING: 'warning';\n DANGER: 'danger';\n SUCCESS: 'success';\n MUTED: 'muted';\n MUTED_FILLED: 'muted-filled';\n\n VARIANT_LINK: 'link';\n VARIANT_LINK_INLINE: 'link-inline';\n VARIANT_OUTLINE: 'outline';\n VARIANT_ACTION: 'action';\n\n XS: 'xs';\n SM: 'sm';\n MD: 'md';\n LG: 'lg';\n};\n\nconst Button = forwardRef<HTMLButtonElement, Props>((props, ref) => {\n const {\n as = 'button',\n active = false,\n disabled = false,\n asToggle = false,\n onClick = noop,\n bsStyle = 'default',\n bsSize,\n variant,\n iconOnly = false,\n iconName,\n iconRight = false,\n multiline = false,\n block = false,\n className = '',\n noRippleEffect = false,\n autoTrackingKey,\n type = 'button',\n tabIndex = 0,\n children,\n ...remainingProps\n } = props;\n\n const autoTrackingAttributes = getAutoTrackingAttributes({\n autoTrackingKey,\n props: remainingProps as Record<string, unknown>,\n source: 'button',\n });\n\n const [isToggled, setIsToggled] = useState(active);\n\n const btnRef = useRef<HTMLButtonElement>(null);\n\n const buttonRef = useMergeRefs(btnRef, ref);\n\n // Update internal toggle state when used as controlled component and outside toggle state changes\n // Note, using the usePrevious hook resulted in an endless loop, hence the useState here\n const [previousActive, setPreviousActive] = useState(active);\n if (active !== previousActive) {\n setIsToggled(active);\n setPreviousActive(active);\n }\n\n const handleButtonClick = (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n if (!noRippleEffect) {\n createButtonRipple(event.nativeEvent, event.currentTarget);\n }\n\n if (asToggle) {\n // Intercept click handler only for toggle button to update internal state and blur after click\n const newIsToggled = !isToggled;\n setIsToggled(newIsToggled);\n\n if (newIsToggled) {\n btnRef.current?.blur();\n }\n\n (onClick as (x: boolean) => void)(newIsToggled);\n } else {\n (onClick as (x: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void)(event);\n }\n };\n\n const handleLinkClick = (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n\n if (!noRippleEffect) {\n createButtonRipple(event.nativeEvent, event.currentTarget);\n }\n\n (onClick as (x: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void)(event);\n };\n\n const buttonClassNames = classNames(\n 'btn',\n `btn-${bsStyle}`,\n variant === VARIANTS_MAP.VARIANT_LINK && 'btn-link',\n variant === VARIANTS_MAP.VARIANT_LINK_INLINE && 'btn-link btn-link-inline',\n variant === VARIANTS_MAP.VARIANT_OUTLINE && 'btn-outline',\n variant === VARIANTS_MAP.VARIANT_ACTION && 'btn-action',\n bsSize && `btn-${bsSize}`,\n asToggle && 'btn-toggle',\n isToggled && 'active',\n iconOnly && 'btn-icon-only',\n iconRight && 'btn-icon-right',\n multiline && 'btn-multiline',\n block && 'btn-block',\n as === 'a' && 'gap-0',\n as === 'a' && disabled && 'disabled',\n 'btn-component',\n className\n );\n\n if (as === 'a') {\n return (\n <a\n ref={buttonRef as React.Ref<HTMLAnchorElement>}\n {...(remainingProps as Omit<HTMLProps<HTMLAnchorElement>, 'as' | 'type' | 'onClick' | 'ref'>)}\n {...autoTrackingAttributes}\n className={buttonClassNames}\n onClick={handleLinkClick}\n aria-disabled={disabled || undefined}\n tabIndex={disabled ? -1 : tabIndex}\n >\n {iconName && <span className={`rioglyph ${iconName}`} />}\n {children}\n </a>\n );\n }\n\n return (\n <button\n ref={buttonRef}\n type={type}\n {...(remainingProps as Omit<HTMLProps<HTMLButtonElement>, 'as' | 'type' | 'onClick' | 'ref'>)}\n {...autoTrackingAttributes}\n className={buttonClassNames}\n onClick={handleButtonClick}\n disabled={disabled}\n tabIndex={tabIndex}\n >\n {iconName && <span className={`rioglyph ${iconName}`} />}\n {children}\n </button>\n );\n}) as ButtonType;\n\nObject.assign(Button, STYLES_MAP);\nObject.assign(Button, VARIANTS_MAP);\nObject.assign(Button, SIZES_MAP);\n\nexport default Button;\n"],"names":["STYLES_MAP","VARIANTS_MAP","SIZES_MAP","Button","forwardRef","props","ref","as","active","disabled","asToggle","onClick","noop","bsStyle","bsSize","variant","iconOnly","iconName","iconRight","multiline","block","className","noRippleEffect","autoTrackingKey","type","tabIndex","children","remainingProps","autoTrackingAttributes","getAutoTrackingAttributes","isToggled","setIsToggled","useState","btnRef","useRef","buttonRef","useMergeRefs","previousActive","setPreviousActive","handleButtonClick","event","createButtonRipple","newIsToggled","handleLinkClick","buttonClassNames","classNames","jsxs","jsx"],"mappings":";;;;;;;AAiBO,MAAMA,IAAa;AAAA,EACtB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS;AAAA,EACT,WAAW;AAAA,EACX,MAAM;AAAA,EACN,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,OAAO;AAAA,EACP,cAAc;AAClB,GAKaC,IAAe;AAAA,EACxB,cAAc;AAAA,EACd,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,gBAAgB;AACpB,GAIaC,IAAY;AAAA,EACrB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACR,GA+NMC,IAAS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U;AAChC,OAAO,OAAOG,GAAQF,CAAY;AAClC,OAAO,OAAOE,GAAQD,CAAS;"}
@@ -163,6 +163,10 @@ export type ClearableInputProps = {
163
163
  * Parses the masked string representation back to a typed date value.
164
164
  */
165
165
  parse?: (value: string, masked: unknown) => Date | null;
166
+ /**
167
+ * Custom IMask blocks for pattern masks.
168
+ */
169
+ blocks?: Record<string, unknown>;
166
170
  /**
167
171
  * Enables IMask autofix behavior for date and number masks.
168
172
  */