@rio-cloud/rio-uikit 2.0.0 → 2.1.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 (205) hide show
  1. package/components/actionBarItem/ActionBarItem.d.ts +2 -2
  2. package/components/actionBarItem/ActionBarItem.js.map +1 -1
  3. package/components/applicationHeader/ApplicationHeader.d.ts +6 -7
  4. package/components/applicationHeader/ApplicationHeader.js.map +1 -1
  5. package/components/applicationLayout/SubNavigation.d.ts +7 -0
  6. package/components/applicationLayout/SubNavigation.js.map +1 -1
  7. package/components/assetTree/AssetTree.d.ts +7 -0
  8. package/components/assetTree/AssetTree.js.map +1 -1
  9. package/components/assetTree/Tree.d.ts +15 -0
  10. package/components/assetTree/Tree.js.map +1 -1
  11. package/components/assetTree/TreeIcon.d.ts +30 -0
  12. package/components/assetTree/TreeIcon.js +16 -0
  13. package/components/assetTree/TreeIcon.js.map +1 -0
  14. package/components/assetTree/TreeLeaf.js +22 -22
  15. package/components/assetTree/TreeLeaf.js.map +1 -1
  16. package/components/assetTree/TreeNode.js +25 -25
  17. package/components/assetTree/TreeNode.js.map +1 -1
  18. package/components/assetTree/TreeSearch.d.ts +2 -0
  19. package/components/assetTree/TreeSearch.js.map +1 -1
  20. package/components/barList/BarList.d.ts +26 -0
  21. package/components/barList/BarList.js.map +1 -1
  22. package/components/bottomSheet/BottomSheet.d.ts +17 -3
  23. package/components/bottomSheet/BottomSheet.js.map +1 -1
  24. package/components/bottomSheet/TimedBottomSheet.d.ts +10 -0
  25. package/components/bottomSheet/TimedBottomSheet.js.map +1 -1
  26. package/components/calendarStripe/CalendarStripe.d.ts +1 -1
  27. package/components/calendarStripe/CalendarStripe.js +34 -36
  28. package/components/calendarStripe/CalendarStripe.js.map +1 -1
  29. package/components/charts/Area.d.ts +2 -2
  30. package/components/charts/Area.js.map +1 -1
  31. package/components/charts/Line.d.ts +2 -2
  32. package/components/charts/Line.js.map +1 -1
  33. package/components/checkbox/Checkbox.d.ts +0 -3
  34. package/components/checkbox/Checkbox.js.map +1 -1
  35. package/components/clearableInput/ClearableInput.d.ts +21 -20
  36. package/components/clearableInput/ClearableInput.js.map +1 -1
  37. package/components/collapse/Collapse.d.ts +3 -0
  38. package/components/collapse/Collapse.js +12 -12
  39. package/components/collapse/Collapse.js.map +1 -1
  40. package/components/contentLoader/ContentLoader.d.ts +10 -2
  41. package/components/contentLoader/ContentLoader.js.map +1 -1
  42. package/components/dataTabs/DataTabs.d.ts +6 -0
  43. package/components/dataTabs/DataTabs.js.map +1 -1
  44. package/components/datepicker/DatePicker.d.ts +2 -2
  45. package/components/datepicker/DatePicker.js +31 -31
  46. package/components/datepicker/DatePicker.js.map +1 -1
  47. package/components/dialog/ConfirmationDialog.d.ts +22 -0
  48. package/components/dialog/ConfirmationDialog.js.map +1 -1
  49. package/components/dialog/Dialog.d.ts +13 -1
  50. package/components/dialog/Dialog.js.map +1 -1
  51. package/components/dialog/ReleaseNotesDialog.d.ts +3 -3
  52. package/components/dialog/ReleaseNotesDialog.js.map +1 -1
  53. package/components/dropdown/ButtonDropdown.d.ts +4 -0
  54. package/components/dropdown/ButtonDropdown.js +51 -51
  55. package/components/dropdown/ButtonDropdown.js.map +1 -1
  56. package/components/dropdown/DropdownSubmenu.d.ts +4 -0
  57. package/components/dropdown/DropdownSubmenu.js.map +1 -1
  58. package/components/editableContent/EditableContent.d.ts +6 -0
  59. package/components/editableContent/EditableContent.js.map +1 -1
  60. package/components/expander/ExpanderList.d.ts +3 -0
  61. package/components/expander/ExpanderList.js.map +1 -1
  62. package/components/expander/ExpanderPanel.d.ts +14 -4
  63. package/components/expander/ExpanderPanel.js.map +1 -1
  64. package/components/fade/Fade.d.ts +1 -1
  65. package/components/fade/Fade.js.map +1 -1
  66. package/components/filepicker/FilePicker.d.ts +0 -2
  67. package/components/filepicker/FilePicker.js.map +1 -1
  68. package/components/groupedItemList/GroupedItemList.d.ts +10 -7
  69. package/components/groupedItemList/GroupedItemList.js.map +1 -1
  70. package/components/listMenu/ListMenu.js.map +1 -1
  71. package/components/listMenu/ListMenuGroup.d.ts +2 -1
  72. package/components/listMenu/ListMenuGroup.js.map +1 -1
  73. package/components/map/components/Map.js.map +1 -1
  74. package/components/map/components/constants.js.map +1 -1
  75. package/components/map/components/features/ContextMenuItem.d.ts +1 -1
  76. package/components/map/components/features/ContextMenuItem.js +2 -17
  77. package/components/map/components/features/ContextMenuItem.js.map +1 -1
  78. package/components/map/components/features/basics/Polyline.d.ts +4 -1
  79. package/components/map/components/features/basics/Polyline.js +1 -1
  80. package/components/map/components/features/basics/Polyline.js.map +1 -1
  81. package/components/map/components/features/layers/MarkerLayer.d.ts +3 -1
  82. package/components/map/components/features/layers/MarkerLayer.js.map +1 -1
  83. package/components/map/components/features/layers/clustering/ClusterLayer.js +1 -1
  84. package/components/map/components/features/layers/clustering/ClusterLayer.js.map +1 -1
  85. package/components/map/components/features/layers/clustering/SimpleClusterLayer.d.ts +3 -2
  86. package/components/map/components/features/layers/clustering/SimpleClusterLayer.js.map +1 -1
  87. package/components/map/components/features/layers/overlayLayers/RoadRestrictionLayer.js +7 -7
  88. package/components/map/components/features/layers/overlayLayers/RoadRestrictionLayer.js.map +1 -1
  89. package/components/map/components/features/layers/overlayLayers/TrafficLayer.js +4 -4
  90. package/components/map/components/features/layers/overlayLayers/TrafficLayer.js.map +1 -1
  91. package/components/map/utils/clustering.d.ts +6 -1
  92. package/components/map/utils/clustering.js +25 -19
  93. package/components/map/utils/clustering.js.map +1 -1
  94. package/components/map/utils/rendering.d.ts +1 -1
  95. package/components/map/utils/rendering.js +23 -23
  96. package/components/map/utils/rendering.js.map +1 -1
  97. package/components/menuItems/MenuItem.d.ts +23 -0
  98. package/components/menuItems/MenuItem.js.map +1 -1
  99. package/components/notification/Notification.js +4 -4
  100. package/components/notification/Notification.js.map +1 -1
  101. package/components/onboarding/OnboardingTip.d.ts +18 -12
  102. package/components/onboarding/OnboardingTip.js.map +1 -1
  103. package/components/overlay/OverlayTrigger.d.ts +43 -1
  104. package/components/overlay/OverlayTrigger.js.map +1 -1
  105. package/components/pager/Pager.d.ts +3 -0
  106. package/components/pager/Pager.js.map +1 -1
  107. package/components/popover/Popover.d.ts +1 -0
  108. package/components/popover/Popover.js.map +1 -1
  109. package/components/preloader/ImagePreloader.d.ts +1 -1
  110. package/components/preloader/ImagePreloader.js.map +1 -1
  111. package/components/radiobutton/RadioButton.d.ts +9 -5
  112. package/components/radiobutton/RadioButton.js.map +1 -1
  113. package/components/releaseNotes/ReleaseNotes.d.ts +0 -3
  114. package/components/releaseNotes/ReleaseNotes.js.map +1 -1
  115. package/components/resizer/Resizer.d.ts +17 -3
  116. package/components/resizer/Resizer.js.map +1 -1
  117. package/components/rioglyph/Rioglyph.d.ts +20 -8
  118. package/components/rioglyph/Rioglyph.js.map +1 -1
  119. package/components/rules/RulesWrapper.js +1 -1
  120. package/components/rules/RulesWrapper.js.map +1 -1
  121. package/components/saveableInput/SaveableDateInput.d.ts +20 -2
  122. package/components/saveableInput/SaveableDateInput.js.map +1 -1
  123. package/components/saveableInput/SaveableInput.d.ts +10 -2
  124. package/components/saveableInput/SaveableInput.js.map +1 -1
  125. package/components/selects/BaseSelectDropdown.js +90 -79
  126. package/components/selects/BaseSelectDropdown.js.map +1 -1
  127. package/components/selects/Select.d.ts +5 -0
  128. package/components/selects/Select.js +94 -94
  129. package/components/selects/Select.js.map +1 -1
  130. package/components/sidebars/Sidebar.d.ts +19 -3
  131. package/components/sidebars/Sidebar.js.map +1 -1
  132. package/components/slider/RangeSlider.d.ts +15 -0
  133. package/components/slider/RangeSlider.js.map +1 -1
  134. package/components/slider/Slider.d.ts +9 -0
  135. package/components/slider/Slider.js.map +1 -1
  136. package/components/smoothScrollbars/SmoothScrollbars.d.ts +44 -0
  137. package/components/smoothScrollbars/SmoothScrollbars.js.map +1 -1
  138. package/components/spinner/Spinner.d.ts +3 -3
  139. package/components/spinner/Spinner.js.map +1 -1
  140. package/components/states/BaseStateProps.d.ts +6 -2
  141. package/components/states/StateIcon.d.ts +14 -1
  142. package/components/states/StateIcon.js.map +1 -1
  143. package/components/statsWidget/StatsWidget.d.ts +2 -0
  144. package/components/statsWidget/StatsWidget.js.map +1 -1
  145. package/components/statsWidget/StatsWidgetBody.d.ts +1 -0
  146. package/components/statsWidget/StatsWidgetBody.js.map +1 -1
  147. package/components/statsWidget/StatsWidgetNumber.d.ts +2 -0
  148. package/components/statsWidget/StatsWidgetNumber.js.map +1 -1
  149. package/components/statusBar/StatusBar.d.ts +2 -31
  150. package/components/statusBar/StatusBar.js.map +1 -1
  151. package/components/statusBar/StatusBarIcon.d.ts +2 -2
  152. package/components/statusBar/StatusBarIcon.js.map +1 -1
  153. package/components/statusBar/StatusBarLabel.d.ts +2 -2
  154. package/components/statusBar/StatusBarLabel.js.map +1 -1
  155. package/components/statusBar/StatusBarProgressBar.d.ts +1 -1
  156. package/components/statusBar/StatusBarProgressBar.js.map +1 -1
  157. package/components/statusBar/{StatusBar.types.d.ts → StatusBarProps.d.ts} +44 -2
  158. package/components/steppedProgressBar/SteppedProgressBar.d.ts +1 -1
  159. package/components/steppedProgressBar/SteppedProgressBar.js.map +1 -1
  160. package/components/switch/Switch.d.ts +13 -1
  161. package/components/switch/Switch.js.map +1 -1
  162. package/components/table/SortArrowDown.d.ts +1 -1
  163. package/components/table/SortArrowDown.js.map +1 -1
  164. package/components/table/SortArrowUp.d.ts +1 -1
  165. package/components/table/SortArrowUp.js.map +1 -1
  166. package/components/table/TableSettingsDialog.d.ts +5 -0
  167. package/components/table/TableSettingsDialog.js +119 -109
  168. package/components/table/TableSettingsDialog.js.map +1 -1
  169. package/components/table/TableSettingsDialogFooter.js +9 -9
  170. package/components/table/TableSettingsDialogFooter.js.map +1 -1
  171. package/components/table/TableViewToggles.d.ts +21 -1
  172. package/components/table/TableViewToggles.js.map +1 -1
  173. package/components/tag/Tag.d.ts +7 -2
  174. package/components/tag/Tag.js.map +1 -1
  175. package/components/tagManager/TagManager.d.ts +15 -0
  176. package/components/tagManager/TagManager.js.map +1 -1
  177. package/components/tagManager/TagManagerTag.d.ts +9 -0
  178. package/components/teaser/Teaser.d.ts +57 -55
  179. package/components/teaser/Teaser.js.map +1 -1
  180. package/components/teaser/TeaserContainer.d.ts +1 -1
  181. package/components/teaser/TeaserContainer.js.map +1 -1
  182. package/components/tooltip/SimpleTooltip.d.ts +22 -4
  183. package/components/tooltip/SimpleTooltip.js.map +1 -1
  184. package/components/tooltip/Tooltip.d.ts +22 -2
  185. package/components/tooltip/Tooltip.js.map +1 -1
  186. package/components/video/ResponsiveVideo.d.ts +8 -3
  187. package/components/video/ResponsiveVideo.js.map +1 -1
  188. package/hooks/useKey.d.ts +1 -1
  189. package/hooks/useKey.js.map +1 -1
  190. package/hooks/useOnboarding.d.ts +86 -80
  191. package/hooks/useOnboarding.js.map +1 -1
  192. package/hooks/useTableExport.js.map +1 -1
  193. package/hooks/useUncontrollable.d.ts +1 -1
  194. package/hooks/useUncontrollable.js.map +1 -1
  195. package/package.json +12 -14
  196. package/utils/colorScheme.js +14 -13
  197. package/utils/colorScheme.js.map +1 -1
  198. package/utils/cssuseragent.js.map +1 -1
  199. package/utils/scrollItemIntoView.js +12 -11
  200. package/utils/scrollItemIntoView.js.map +1 -1
  201. package/utils/urlFeatureToggles.js +19 -20
  202. package/utils/urlFeatureToggles.js.map +1 -1
  203. package/version.d.ts +1 -1
  204. package/version.js +1 -1
  205. package/version.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.js","sources":["../../../src/components/datepicker/DatePicker.tsx"],"sourcesContent":["import type React from 'react';\nimport { useState, forwardRef } from 'react';\nimport classNames from 'classnames';\nimport type { Moment } from 'moment';\nimport Datetime, { type DatetimepickerProps } from 'react-datetime';\nimport { noop } from 'es-toolkit/function';\n\nconst DEFAULT_LOCALE = 'en-GB';\nconst DEFAULT_MIN_WIDTH = 0;\n\nexport type DatePickerProps = Omit<DatetimepickerProps, 'onChange' | 'initialValue'> & {\n /**\n * An id used for the internal input element.\n */\n id?: string;\n\n /**\n * The moment locale to be used for the date picker.\n * Make sure to import the respective moment locale files.\n *\n * @default 'en-GB'\n * @example import 'moment/dist/locale/de';\n */\n locale?: string;\n\n /**\n * Once the day has been selected, the date picker will be closed automatically.\n *\n * @default true\n */\n closeOnSelect?: boolean;\n\n /**\n * Default value of the DatePicker (date or moment).\n */\n initialValue?: Date | Moment;\n\n /**\n * Value of the DatePicker (date or moment). Use this only if you want to use\n * this component as a controlled component\n */\n value?: Date | string | Moment;\n\n /*\n * Defines the format for the date. It accepts any moment.js date format.\n * If true the date will be displayed using the defaults for the current locale.\n * If false the date picker is disabled and the component can be used as time picker.\n */\n dateFormat?: boolean | string;\n\n /*\n * Defines the format for the time. It accepts any moment.js time format.\n * If true the time will be displayed using the defaults for the current locale.\n * If false the time picker is disabled and the component can be used as date picker.\n */\n timeFormat?: boolean | string;\n\n /*\n * Defines additional attributes for the input element of the component.\n */\n inputProps?: React.HTMLProps<HTMLInputElement>;\n\n /**\n * Defines whether the dropdown opens upwards or not.\n *\n * @default false\n */\n dropup?: boolean;\n\n /**\n * Opens the picker right aligned.\n *\n * @default false\n */\n\n alignRight?: boolean;\n\n /**\n * Defines whether the clearableInput button is shown.\n *\n * @default false\n */\n clearableInput?: boolean;\n\n /**\n * Optional min-width value (without px). Since the DatePicker has a max-width of 100%\n * you can also set a high minWidth number to use 100% with of the parent element.\n * A value of \"0\" means no extra width is set and it becomes 100% width of the parent.\n *\n * @default 0\n */\n minWidth?: number;\n\n /**\n * Callback function when the value changes. Receives the new date (moment)\n * and a boolean (whether date is valid or not) as arguments.\n *\n * @param value\n * @param isValid\n * @returns\n */\n onChange?: (value: Moment | string, isValid: boolean) => void;\n\n /**\n * Defines whether the input shows an error when the date is invalid or cleared.\n *\n * @default true\n */\n mandatory?: boolean;\n\n /**\n * Overwrites the internal date validation function in case you need to customize it.\n *\n * @param date\n * @returns\n */\n dateValidation?: (date: Moment | string) => boolean;\n\n /**\n * Additional classes to be set on the DatePicker element.\n */\n className?: string;\n};\n\nconst DatePicker = forwardRef((props: DatePickerProps, ref) => {\n const {\n id,\n dropup = false,\n alignRight = false,\n locale = DEFAULT_LOCALE,\n minWidth = DEFAULT_MIN_WIDTH,\n onChange = noop,\n mandatory = true,\n dateValidation,\n clearableInput = false,\n closeOnSelect = true,\n inputProps,\n className,\n ...remainingProp\n } = props;\n\n const [hasError, setHasError] = useState(false);\n\n const validateDate = (dateToValidate: Moment | string) => {\n // If the entered date complies with the defined dateFormat, the Datetime component\n // returns a moment object, otherwise the return value is a string.\n // Note, using a isValid() function from moment or the Date object itself will result in\n // different outcome in various browsers.\n // For instance `new Date('1')` or `moment('1')` are valid dates in Chrome where it defaults\n // to \"01/01/2001\" whereas in Firefox it is an invalid date.\n // The solution is to compare the entered value to the date format which is done by React Datetime.\n const isDateObject = typeof dateToValidate === 'object';\n\n return dateValidation ? dateValidation(dateToValidate) : isDateObject;\n };\n\n const handleChange = (date: Moment | string) => {\n const isValid = mandatory ? validateDate(date) : true;\n setHasError(!isValid);\n onChange(date, isValid);\n };\n\n const classes = classNames(\n 'DatePicker',\n 'form-group',\n hasError && 'has-error',\n dropup && 'dropup',\n alignRight && 'align-right',\n className && className\n );\n\n // This way we can expose the \"id\" as top level prop and not as part of the inputProps which\n // makes the use of the id much more convenient\n const enhancedInputProps = { id, ...inputProps };\n\n return (\n <Datetime\n // TODO: add support for setting ref to the input. Maybe add a \"inputRef\" prop to react-datetime\n // ref={ref}\n {...remainingProp}\n locale={locale}\n clearableInput={clearableInput}\n closeOnSelect={closeOnSelect}\n onChange={handleChange}\n minWidth={minWidth}\n inputProps={enhancedInputProps}\n className={classes}\n />\n );\n});\n\nexport default DatePicker;\n"],"names":["DEFAULT_LOCALE","DEFAULT_MIN_WIDTH","DatePicker","forwardRef","props","ref","id","dropup","alignRight","locale","minWidth","onChange","noop","mandatory","dateValidation","clearableInput","closeOnSelect","inputProps","className","remainingProp","hasError","setHasError","useState","validateDate","dateToValidate","handleChange","date","isValid","classes","classNames","enhancedInputProps","jsx","Datetime"],"mappings":";;;;;AAOA,MAAMA,IAAiB,SACjBC,IAAoB,GAoHpBC,IAAaC,EAAW,CAACC,GAAwBC,MAAQ;AAC3D,QAAM;AAAA,IACF,IAAAC;AAAA,IACA,QAAAC,IAAS;AAAA,IACT,YAAAC,IAAa;AAAA,IACb,QAAAC,IAAST;AAAA,IACT,UAAAU,IAAWT;AAAA,IACX,UAAAU,IAAWC;AAAA,IACX,WAAAC,IAAY;AAAA,IACZ,gBAAAC;AAAA,IACA,gBAAAC,IAAiB;AAAA,IACjB,eAAAC,IAAgB;AAAA,IAChB,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHf,GAEE,CAACgB,GAAUC,CAAW,IAAIC,EAAS,EAAK,GAExCC,IAAe,CAACC,MAUXV,IAAiBA,EAAeU,CAAc,IAFhC,OAAOA,KAAmB,UAK7CC,IAAe,CAACC,MAA0B;AAC5C,UAAMC,IAAUd,IAAYU,EAAaG,CAAI,IAAI;AACjD,IAAAL,EAAY,CAACM,CAAO,GACpBhB,EAASe,GAAMC,CAAO;AAAA,EAC1B,GAEMC,IAAUC;AAAA,IACZ;AAAA,IACA;AAAA,IACAT,KAAY;AAAA,IACZb,KAAU;AAAA,IACVC,KAAc;AAAA,IACdU,KAAaA;AAAA,EAAA,GAKXY,IAAqB,EAAE,IAAAxB,GAAI,GAAGW,EAAA;AAEpC,SACI,gBAAAc;AAAA,IAACC;AAAA,IAAA;AAAA,MAGI,GAAGb;AAAA,MACJ,QAAAV;AAAA,MACA,gBAAAM;AAAA,MACA,eAAAC;AAAA,MACA,UAAUS;AAAA,MACV,UAAAf;AAAA,MACA,YAAYoB;AAAA,MACZ,WAAWF;AAAA,IAAA;AAAA,EAAA;AAGvB,CAAC;"}
1
+ {"version":3,"file":"DatePicker.js","sources":["../../../src/components/datepicker/DatePicker.tsx"],"sourcesContent":["import type React from 'react';\nimport { useState, forwardRef } from 'react';\nimport classNames from 'classnames';\nimport type { Moment } from 'moment';\nimport DatetimeImport, { type DatetimepickerProps } from 'react-datetime';\nimport { noop } from 'es-toolkit/function';\n\n// Fix: Handle ESM/CJS interop by unwrapping default if necessary\n// @ts-expect-error\nconst Datetime = DatetimeImport?.default ? DatetimeImport.default : DatetimeImport;\n\nconst DEFAULT_LOCALE = 'en-GB';\nconst DEFAULT_MIN_WIDTH = 0;\n\nexport type DatePickerProps = Omit<DatetimepickerProps, 'onChange' | 'initialValue'> & {\n /**\n * An id used for the internal input element.\n */\n id?: string;\n\n /**\n * The moment locale to be used for the date picker.\n * Make sure to import the respective moment locale files.\n *\n * @default 'en-GB'\n * @example import 'moment/dist/locale/de';\n */\n locale?: string;\n\n /**\n * Once the day has been selected, the date picker will be closed automatically.\n *\n * @default true\n */\n closeOnSelect?: boolean;\n\n /**\n * Default value of the DatePicker (date or moment).\n */\n initialValue?: Date | Moment;\n\n /**\n * Value of the DatePicker (date or moment). Use this only if you want to use\n * this component as a controlled component\n */\n value?: Date | string | Moment;\n\n /*\n * Defines the format for the date. It accepts any moment.js date format.\n * If true the date will be displayed using the defaults for the current locale.\n * If false the date picker is disabled and the component can be used as time picker.\n */\n dateFormat?: boolean | string;\n\n /*\n * Defines the format for the time. It accepts any moment.js time format.\n * If true the time will be displayed using the defaults for the current locale.\n * If false the time picker is disabled and the component can be used as date picker.\n */\n timeFormat?: boolean | string;\n\n /*\n * Defines additional attributes for the input element of the component.\n */\n inputProps?: React.HTMLProps<HTMLInputElement>;\n\n /**\n * Defines whether the dropdown opens upwards or not.\n *\n * @default false\n */\n dropup?: boolean;\n\n /**\n * Opens the picker right aligned.\n *\n * @default false\n */\n\n alignRight?: boolean;\n\n /**\n * Defines whether the clearableInput button is shown.\n *\n * @default false\n */\n clearableInput?: boolean;\n\n /**\n * Optional min-width value (without px). Since the DatePicker has a max-width of 100%\n * you can also set a high minWidth number to use 100% with of the parent element.\n * A value of \"0\" means no extra width is set and it becomes 100% width of the parent.\n *\n * @default 0\n */\n minWidth?: number;\n\n /**\n * Callback function when the value changes. Receives the new date (moment)\n * and a boolean (whether date is valid or not) as arguments.\n *\n * @param value\n * @param isValid\n * @returns\n */\n onChange?: (value: Moment | string, isValid: boolean) => void;\n\n /**\n * Defines whether the input shows an error when the date is invalid or cleared.\n *\n * @default true\n */\n mandatory?: boolean;\n\n /**\n * Overwrites the internal date validation function in case you need to customize it.\n *\n * @param date\n * @returns\n */\n dateValidation?: (date: Moment | string) => boolean;\n\n /**\n * Additional classes to be set on the DatePicker element.\n */\n className?: string;\n};\n\nconst DatePicker = forwardRef((props: DatePickerProps, ref) => {\n const {\n id,\n dropup = false,\n alignRight = false,\n locale = DEFAULT_LOCALE,\n minWidth = DEFAULT_MIN_WIDTH,\n onChange = noop,\n mandatory = true,\n dateValidation,\n clearableInput = false,\n closeOnSelect = true,\n inputProps,\n className,\n ...remainingProp\n } = props;\n\n const [hasError, setHasError] = useState(false);\n\n const validateDate = (dateToValidate: Moment | string) => {\n // If the entered date complies with the defined dateFormat, the Datetime component\n // returns a moment object, otherwise the return value is a string.\n // Note, using a isValid() function from moment or the Date object itself will result in\n // different outcome in various browsers.\n // For instance `new Date('1')` or `moment('1')` are valid dates in Chrome where it defaults\n // to \"01/01/2001\" whereas in Firefox it is an invalid date.\n // The solution is to compare the entered value to the date format which is done by React Datetime.\n const isDateObject = typeof dateToValidate === 'object';\n\n return dateValidation ? dateValidation(dateToValidate) : isDateObject;\n };\n\n const handleChange = (date: Moment | string) => {\n const isValid = mandatory ? validateDate(date) : true;\n setHasError(!isValid);\n onChange(date, isValid);\n };\n\n const classes = classNames(\n 'DatePicker',\n 'form-group',\n hasError && 'has-error',\n dropup && 'dropup',\n alignRight && 'align-right',\n className && className\n );\n\n // This way we can expose the \"id\" as top level prop and not as part of the inputProps which\n // makes the use of the id much more convenient\n const enhancedInputProps = { id, ...inputProps };\n\n return (\n <Datetime\n // TODO: add support for setting ref to the input. Maybe add a \"inputRef\" prop to react-datetime\n // ref={ref}\n {...remainingProp}\n locale={locale}\n clearableInput={clearableInput}\n closeOnSelect={closeOnSelect}\n onChange={handleChange}\n minWidth={minWidth}\n inputProps={enhancedInputProps}\n className={classes}\n />\n );\n});\n\nexport default DatePicker;\n"],"names":["Datetime","DatetimeImport","DEFAULT_LOCALE","DEFAULT_MIN_WIDTH","DatePicker","forwardRef","props","ref","id","dropup","alignRight","locale","minWidth","onChange","noop","mandatory","dateValidation","clearableInput","closeOnSelect","inputProps","className","remainingProp","hasError","setHasError","useState","validateDate","dateToValidate","handleChange","date","isValid","classes","classNames","enhancedInputProps","jsx"],"mappings":";;;;;AASA,MAAMA,IAAWC,GAAgB,UAAUA,EAAe,UAAUA,GAE9DC,IAAiB,SACjBC,IAAoB,GAoHpBC,IAAaC,EAAW,CAACC,GAAwBC,MAAQ;AAC3D,QAAM;AAAA,IACF,IAAAC;AAAA,IACA,QAAAC,IAAS;AAAA,IACT,YAAAC,IAAa;AAAA,IACb,QAAAC,IAAST;AAAA,IACT,UAAAU,IAAWT;AAAA,IACX,UAAAU,IAAWC;AAAA,IACX,WAAAC,IAAY;AAAA,IACZ,gBAAAC;AAAA,IACA,gBAAAC,IAAiB;AAAA,IACjB,eAAAC,IAAgB;AAAA,IAChB,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHf,GAEE,CAACgB,GAAUC,CAAW,IAAIC,EAAS,EAAK,GAExCC,IAAe,CAACC,MAUXV,IAAiBA,EAAeU,CAAc,IAFhC,OAAOA,KAAmB,UAK7CC,IAAe,CAACC,MAA0B;AAC5C,UAAMC,IAAUd,IAAYU,EAAaG,CAAI,IAAI;AACjD,IAAAL,EAAY,CAACM,CAAO,GACpBhB,EAASe,GAAMC,CAAO;AAAA,EAC1B,GAEMC,IAAUC;AAAA,IACZ;AAAA,IACA;AAAA,IACAT,KAAY;AAAA,IACZb,KAAU;AAAA,IACVC,KAAc;AAAA,IACdU,KAAaA;AAAA,EAAA,GAKXY,IAAqB,EAAE,IAAAxB,GAAI,GAAGW,EAAA;AAEpC,SACI,gBAAAc;AAAA,IAACjC;AAAA,IAAA;AAAA,MAGI,GAAGqB;AAAA,MACJ,QAAAV;AAAA,MACA,gBAAAM;AAAA,MACA,eAAAC;AAAA,MACA,UAAUS;AAAA,MACV,UAAAf;AAAA,MACA,YAAYoB;AAAA,MACZ,WAAWF;AAAA,IAAA;AAAA,EAAA;AAGvB,CAAC;"}
@@ -1,11 +1,33 @@
1
1
  import { default as React } from 'react';
2
2
  import { BaseDialogProps } from './Dialog';
3
3
  export type ConfirmationDialogProps = BaseDialogProps & {
4
+ /**
5
+ * The content of the dialog body itself
6
+ */
4
7
  content?: string | React.ReactNode;
8
+ /**
9
+ * A callback fired when the confirmation button is clicked.
10
+ *
11
+ * @default () => {}
12
+ */
5
13
  onClickConfirm?: VoidFunction;
14
+ /**
15
+ * A callback fired when the cancel button is clicked or the dialog is closed.
16
+ *
17
+ * @default () => {}
18
+ */
6
19
  onClickCancel?: VoidFunction;
20
+ /**
21
+ * The content of the cancel button. (Usually a text, can also be a FormattedMessage component).
22
+ */
7
23
  cancelButtonText?: string | React.ReactNode;
24
+ /**
25
+ * The content of the confirmation button. Since it is a node, it can be a simple text or any JSX node like a div element with an icon and a text.
26
+ */
8
27
  confirmButtonText?: string | React.ReactNode;
28
+ /**
29
+ * When set to `true` the confirmation button will be disabled.
30
+ */
9
31
  disableConfirm?: boolean;
10
32
  };
11
33
  declare const ConfirmationDialog: (props: ConfirmationDialogProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmationDialog.js","sources":["../../../src/components/dialog/ConfirmationDialog.tsx"],"sourcesContent":["import type React from 'react';\nimport { noop } from 'es-toolkit/function';\n\nimport Button from '../button/Button';\nimport Dialog, { type BaseDialogProps } from './Dialog';\n\nexport type ConfirmationDialogProps = BaseDialogProps & {\n content?: string | React.ReactNode;\n onClickConfirm?: VoidFunction;\n onClickCancel?: VoidFunction;\n cancelButtonText?: string | React.ReactNode;\n confirmButtonText?: string | React.ReactNode;\n disableConfirm?: boolean;\n};\n\nconst ConfirmationDialog = (props: ConfirmationDialogProps) => {\n const {\n content,\n onClickCancel = noop,\n cancelButtonText,\n onClickConfirm = noop,\n confirmButtonText,\n disableConfirm,\n ...remainingProps\n } = props;\n\n const footer = (\n <div className='btn-toolbar'>\n <Button className='CancelButton' onClick={onClickCancel}>\n {cancelButtonText}\n </Button>\n <Button bsStyle='primary' className='ConfirmationButton' onClick={onClickConfirm} disabled={disableConfirm}>\n {confirmButtonText}\n </Button>\n </div>\n );\n\n return (\n <Dialog\n {...remainingProps}\n body={content}\n footer={footer}\n onClose={onClickCancel}\n showCloseButton={false}\n className='confirmation-dialog'\n disableEsc\n />\n );\n};\n\nexport default ConfirmationDialog;\n"],"names":["ConfirmationDialog","props","content","onClickCancel","noop","cancelButtonText","onClickConfirm","confirmButtonText","disableConfirm","remainingProps","jsx","Dialog","jsxs","Button"],"mappings":";;;;AAeA,MAAMA,IAAqB,CAACC,MAAmC;AAC3D,QAAM;AAAA,IACF,SAAAC;AAAA,IACA,eAAAC,IAAgBC;AAAA,IAChB,kBAAAC;AAAA,IACA,gBAAAC,IAAiBF;AAAA,IACjB,mBAAAG;AAAA,IACA,gBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHR;AAaJ,SACI,gBAAAS;AAAA,IAACC;AAAA,IAAA;AAAA,MACI,GAAGF;AAAA,MACJ,MAAMP;AAAA,MACN,QAdJ,gBAAAU,EAAC,OAAA,EAAI,WAAU,eACX,UAAA;AAAA,QAAA,gBAAAF,EAACG,GAAA,EAAO,WAAU,gBAAe,SAASV,GACrC,UAAAE,GACL;AAAA,QACA,gBAAAK,EAACG,GAAA,EAAO,SAAQ,WAAU,WAAU,sBAAqB,SAASP,GAAgB,UAAUE,GACvF,UAAAD,EAAA,CACL;AAAA,MAAA,GACJ;AAAA,MAQI,SAASJ;AAAA,MACT,iBAAiB;AAAA,MACjB,WAAU;AAAA,MACV,YAAU;AAAA,IAAA;AAAA,EAAA;AAGtB;"}
1
+ {"version":3,"file":"ConfirmationDialog.js","sources":["../../../src/components/dialog/ConfirmationDialog.tsx"],"sourcesContent":["import type React from 'react';\nimport { noop } from 'es-toolkit/function';\n\nimport Button from '../button/Button';\nimport Dialog, { type BaseDialogProps } from './Dialog';\n\nexport type ConfirmationDialogProps = BaseDialogProps & {\n /**\n * The content of the dialog body itself\n */\n content?: string | React.ReactNode;\n\n /**\n * A callback fired when the confirmation button is clicked.\n *\n * @default () => {}\n */\n onClickConfirm?: VoidFunction;\n\n /**\n * A callback fired when the cancel button is clicked or the dialog is closed.\n *\n * @default () => {}\n */\n onClickCancel?: VoidFunction;\n\n /**\n * The content of the cancel button. (Usually a text, can also be a FormattedMessage component).\n */\n cancelButtonText?: string | React.ReactNode;\n\n /**\n * The content of the confirmation button. Since it is a node, it can be a simple text or any JSX node like a div element with an icon and a text.\n */\n confirmButtonText?: string | React.ReactNode;\n\n /**\n * When set to `true` the confirmation button will be disabled.\n */\n disableConfirm?: boolean;\n};\n\nconst ConfirmationDialog = (props: ConfirmationDialogProps) => {\n const {\n content,\n onClickCancel = noop,\n cancelButtonText,\n onClickConfirm = noop,\n confirmButtonText,\n disableConfirm,\n ...remainingProps\n } = props;\n\n const footer = (\n <div className='btn-toolbar'>\n <Button className='CancelButton' onClick={onClickCancel}>\n {cancelButtonText}\n </Button>\n <Button bsStyle='primary' className='ConfirmationButton' onClick={onClickConfirm} disabled={disableConfirm}>\n {confirmButtonText}\n </Button>\n </div>\n );\n\n return (\n <Dialog\n {...remainingProps}\n body={content}\n footer={footer}\n onClose={onClickCancel}\n showCloseButton={false}\n className='confirmation-dialog'\n disableEsc\n />\n );\n};\n\nexport default ConfirmationDialog;\n"],"names":["ConfirmationDialog","props","content","onClickCancel","noop","cancelButtonText","onClickConfirm","confirmButtonText","disableConfirm","remainingProps","jsx","Dialog","jsxs","Button"],"mappings":";;;;AA0CA,MAAMA,IAAqB,CAACC,MAAmC;AAC3D,QAAM;AAAA,IACF,SAAAC;AAAA,IACA,eAAAC,IAAgBC;AAAA,IAChB,kBAAAC;AAAA,IACA,gBAAAC,IAAiBF;AAAA,IACjB,mBAAAG;AAAA,IACA,gBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHR;AAaJ,SACI,gBAAAS;AAAA,IAACC;AAAA,IAAA;AAAA,MACI,GAAGF;AAAA,MACJ,MAAMP;AAAA,MACN,QAdJ,gBAAAU,EAAC,OAAA,EAAI,WAAU,eACX,UAAA;AAAA,QAAA,gBAAAF,EAACG,GAAA,EAAO,WAAU,gBAAe,SAASV,GACrC,UAAAE,GACL;AAAA,QACA,gBAAAK,EAACG,GAAA,EAAO,SAAQ,WAAU,WAAU,sBAAqB,SAASP,GAAgB,UAAUE,GACvF,UAAAD,EAAA,CACL;AAAA,MAAA,GACJ;AAAA,MAQI,SAASJ;AAAA,MACT,iBAAiB;AAAA,MACjB,WAAU;AAAA,MACV,YAAU;AAAA,IAAA;AAAA,EAAA;AAGtB;"}
@@ -30,7 +30,17 @@ export type BaseDialogProps = {
30
30
  *
31
31
  * By default, the dialog has a medium size, and thus it can be omitted.
32
32
  *
33
- * Possible values are: `xs`, `sm`, `lg` `xl` `fullwidth` `fullheight` 'fullheight-lg' 'fullheight-xl' `fullscreen`
33
+ * Possible values are:
34
+ *
35
+ * - `'xs'`
36
+ * - `'sm'`
37
+ * - `'lg'`
38
+ * - `'xl'`
39
+ * - `'fullwidth'`
40
+ * - `'fullheight'`
41
+ * - `'fullheight-lg'`
42
+ * - `'fullheight-xl'`
43
+ * - `'fullscreen'`
34
44
  *
35
45
  * @default 'md'
36
46
  */
@@ -87,6 +97,8 @@ export type DialogProps = BaseDialogProps & {
87
97
  * A callback function to be executed before closing the dialog.
88
98
  *
89
99
  * If the function returns `false`, the dialog will not be closed
100
+ *
101
+ * @default () => true
90
102
  */
91
103
  onCloseValidation?: () => boolean;
92
104
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.js","sources":["../../../src/components/dialog/Dialog.tsx"],"sourcesContent":["import React, { useState, useRef, type PropsWithChildren } from 'react';\nimport ReactDOM from 'react-dom';\nimport classNames from 'classnames';\nimport { noop } from 'es-toolkit/function';\nimport { AnimatePresence, type AnimationDefinition, motion, type Transition, useReducedMotion } from 'motion/react';\n\nimport { getOrCreatePortalRoot } from '../../utils/portalRoot';\nimport useEsc from '../../hooks/useEsc';\nimport DialogHeader from './DialogHeader';\nimport DialogBody from './DialogBody';\nimport DialogFooter from './DialogFooter';\nimport useFocusTrap from '../../hooks/useFocusTrap';\nimport { DialogContextProvider } from './dialogContext';\n\nconst MODAL_DIALOG_CLASS = 'modal-dialog';\nconst MODAL_OPEN_CLASS = 'modal-open';\n\nexport type DialogSize =\n | 'xs'\n | 'sm'\n | 'md'\n | 'lg'\n | 'xl'\n | 'full'\n | 'fullwidth'\n | 'fullheight'\n | 'fullheight-lg'\n | 'fullheight-xl'\n | 'fullscreen';\n\nexport type BaseDialogProps = {\n /**\n * Opens the dialog when set to `true`.\n *\n * @default false\n */\n show: boolean;\n\n /**\n * The dialog title (can also be a FormattedMessage component).\n */\n title?: React.ReactNode;\n\n /**\n * The dialog header subtitle content.\n */\n subtitle?: React.ReactNode;\n\n /**\n * Shows a close button when set to `true`.\n *\n * @default true\n */\n showCloseButton?: boolean;\n\n /**\n * A callback function invoked when the dialog closes.\n */\n onClose?: () => void;\n\n /**\n * Defined how large the dialog will be rendered.\n *\n * By default, the dialog has a medium size, and thus it can be omitted.\n *\n * Possible values are: `xs`, `sm`, `lg` `xl` `fullwidth` `fullheight` 'fullheight-lg' 'fullheight-xl' `fullscreen`\n *\n * @default 'md'\n */\n bsSize?: DialogSize;\n\n /**\n * Enables or disabled closing the dialog via esc key.\n *\n * @default false\n */\n disableEsc?: boolean;\n\n /**\n * Enables the modal body to overflow and use inline scrolling if needed.\n *\n * @default false\n */\n useOverflow?: boolean;\n\n /**\n * Show Header and Footer Borders for the \"xs\" dialog\n *\n * @default false\n */\n showXsDialogBorders?: boolean;\n\n /**\n * Additional classes for the modal element.\n */\n className?: string;\n};\n\nexport type DialogProps = BaseDialogProps & {\n /**\n * The dialog body content.\n */\n body?: React.ReactNode;\n\n /**\n * The dialog body content.\n */\n footer?: React.ReactNode;\n\n /**\n * Additional classes for the modal-body element.\n */\n bodyClassName?: string;\n\n /**\n * Additional classes for the modal-footer element.\n */\n footerClassName?: string;\n\n /**\n * Allows to add additional buttons to the dialog header.\n */\n headerButtons?: React.ReactNode;\n\n /**\n * A callback fired when esc key is pressed and the dialog is about to close.\n */\n onEsc?: VoidFunction;\n\n /**\n * A callback function to be executed before closing the dialog.\n *\n * If the function returns `false`, the dialog will not be closed\n */\n onCloseValidation?: () => boolean;\n};\n\nconst Dialog = (props: PropsWithChildren<DialogProps>) => {\n const {\n title,\n subtitle,\n body,\n footer,\n headerButtons,\n className = '',\n bodyClassName,\n footerClassName,\n showXsDialogBorders = false,\n showCloseButton = true,\n useOverflow = false,\n bsSize,\n show = false,\n onClose: onCloseCallback = noop,\n disableEsc = false,\n onEsc = noop,\n onCloseValidation = () => true,\n children,\n ...remainingProps\n } = props;\n\n const [open, setOpen] = useState(show);\n const dialogWrapperRef = useRef<HTMLDivElement>(null);\n\n const modalRoot = getOrCreatePortalRoot();\n\n const shouldReduceMotion = useReducedMotion();\n\n // Use a setter function for the focus trap as it would not re-render\n // and fails to set the focus listener\n const [focusTrapRef, setFocusTrapRef] = useState<HTMLDivElement>();\n useFocusTrap(focusTrapRef);\n\n const toggleBodyClass = (add: boolean) => {\n // We need to set a body class to fix the -webkit-overflow-scrolling on safari and iOS\n\n // Remove \"modal-open\" from body only when there is no other dialog in the DOM\n // in order to support multiple dialogs\n const hasOtherDialogs = modalRoot.getElementsByClassName(MODAL_DIALOG_CLASS).length > 1;\n\n if (add) {\n document.body.classList.add(MODAL_OPEN_CLASS);\n } else if (!add && !hasOtherDialogs) {\n document.body.classList.remove(MODAL_OPEN_CLASS);\n }\n };\n\n const handleCloseButton = () => closeDialog(true);\n\n const closeDialog = (usedEscapeKey: boolean) => {\n if (onCloseValidation()) {\n setOpen(false);\n onCloseCallback();\n\n usedEscapeKey && onEsc();\n }\n };\n\n const [previousShow, setPreviousShow] = useState(show);\n if (show !== previousShow) {\n setOpen(show);\n toggleBodyClass(show);\n setPreviousShow(show);\n }\n\n useEsc(() => {\n if (!dialogWrapperRef || !dialogWrapperRef.current) {\n return;\n }\n\n const dialogElement = dialogWrapperRef.current;\n const currentActiveElement = document.activeElement;\n\n // Only allow to close the dialog when the focus is inside the dialog\n if (!disableEsc && dialogElement.contains(currentActiveElement)) {\n closeDialog(true);\n }\n });\n\n const handleAnimationComplete = (definition: AnimationDefinition) => {\n // The animation complete callback is invoked too when closing the dialog.\n // For that we check the animation props like the \"opacity\" to skip focusing\n // on the way out when closing the dialog.\n // @ts-ignore\n if (definition.opacity === 0) {\n return;\n }\n\n const dialogElement = dialogWrapperRef.current;\n const currentActiveElement = document.activeElement;\n\n // Set the focus to the dialog if no element inside has focus already. Otherwise, focused\n // elements like inputs would lose their focus to the dialog.\n // Note that in order to focus the dialog itself, the tabindex has to be set on that element\n // IMPORTANT: make sure the dialog has a tabIndex prop\n if (!dialogElement?.contains(currentActiveElement)) {\n dialogWrapperRef?.current?.focus();\n }\n };\n\n const modalClasses = classNames('modal', 'show', className);\n\n const isSmallestDialog = bsSize === 'xs';\n\n const hasChildren = !!children;\n\n const modalDialogClasses = classNames(\n MODAL_DIALOG_CLASS,\n useOverflow && 'modal-overflow',\n bsSize === 'xs' && 'modal-xs',\n bsSize === 'sm' && 'modal-sm',\n bsSize === 'lg' && 'modal-lg',\n bsSize === 'xl' && 'modal-xl',\n bsSize === 'full' && 'modal-full-width',\n bsSize === 'fullwidth' && 'modal-full-width',\n bsSize === 'fullheight' && 'modal-full-height',\n bsSize === 'fullheight-lg' && 'modal-full-height modal-lg',\n bsSize === 'fullheight-xl' && 'modal-full-height modal-xl',\n bsSize === 'fullscreen' && 'modal-fullscreen'\n );\n\n const spring: Transition = {\n type: 'spring',\n damping: 33,\n stiffness: 500,\n };\n\n const springXs: Transition = {\n type: 'spring',\n damping: 25,\n stiffness: 400,\n };\n\n return ReactDOM.createPortal(\n <DialogContextProvider\n value={{ onClose: handleCloseButton, isSmallestDialog, showXsDialogBorders, showCloseButton }}\n >\n {/* @ts-ignore-next-line */}\n <AnimatePresence\n // Disable any initial animations on children that\n // are present when the component is first rendered\n initial={false}\n // Only render one component at a time.\n // The exiting component will finish its exit\n // animation before entering component is rendered\n mode='wait'\n >\n {open && (\n <div\n {...remainingProps}\n className={modalClasses}\n role='dialog'\n ref={dialogWrapperRef}\n aria-label='dialog'\n // Make sure it has a tabIndex to focus the dialog so the close on esc works.\n // biome-ignore lint/a11y/noNoninteractiveTabindex: <explanation>\n tabIndex={0}\n >\n <motion.div\n initial={shouldReduceMotion ? false : { opacity: 0, y: '-50%' }}\n animate={\n shouldReduceMotion\n ? { opacity: 1 }\n : { opacity: 1, y: 0, transition: isSmallestDialog ? springXs : spring }\n }\n exit={shouldReduceMotion ? undefined : { opacity: 0, y: '-150%' }}\n transition={\n shouldReduceMotion\n ? { duration: 0 }\n : {\n opacity: { duration: 0.2 },\n y: { duration: 0.3 },\n }\n }\n onAnimationComplete={handleAnimationComplete}\n // @ts-ignore\n ref={setFocusTrapRef}\n className={modalDialogClasses}\n role='document'\n >\n <div className='modal-content'>\n {hasChildren && children}\n {!hasChildren && (\n <>\n {title && (\n <DialogHeader\n title={title}\n subtitle={subtitle}\n headerButtons={headerButtons}\n />\n )}\n {body && <DialogBody className={bodyClassName}>{body}</DialogBody>}\n {footer && <DialogFooter className={footerClassName}>{footer}</DialogFooter>}\n </>\n )}\n </div>\n </motion.div>\n <motion.div\n initial={shouldReduceMotion ? false : { opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={shouldReduceMotion ? undefined : { opacity: 0 }}\n transition={shouldReduceMotion ? { duration: 0 } : { duration: 0.1 }}\n className='modal-backdrop'\n />\n </div>\n )}\n </AnimatePresence>\n </DialogContextProvider>,\n modalRoot\n );\n};\n\nDialog.Title = DialogHeader;\nDialog.Body = DialogBody;\nDialog.Footer = DialogFooter;\n\nDialog.SIZE_XS = 'xs' as const;\nDialog.SIZE_SM = 'sm' as const;\nDialog.SIZE_MD = 'md' as const; // default\nDialog.SIZE_LG = 'lg' as const;\nDialog.SIZE_XL = 'xl' as const;\nDialog.SIZE_FULL = 'full' as const;\nDialog.SIZE_FULL_WIDTH = 'fullwidth' as const;\nDialog.SIZE_FULL_HEIGHT = 'fullheight' as const;\nDialog.SIZE_FULL_HEIGHT_LG = 'fullheight-lg' as const;\nDialog.SIZE_FULL_HEIGHT_XL = 'fullheight-xl' as const;\nDialog.SIZE_FULL_SCREEN = 'fullscreen' as const;\n\nexport default Dialog;\n"],"names":["MODAL_DIALOG_CLASS","MODAL_OPEN_CLASS","Dialog","props","title","subtitle","body","footer","headerButtons","className","bodyClassName","footerClassName","showXsDialogBorders","showCloseButton","useOverflow","bsSize","show","onCloseCallback","noop","disableEsc","onEsc","onCloseValidation","children","remainingProps","open","setOpen","useState","dialogWrapperRef","useRef","modalRoot","getOrCreatePortalRoot","shouldReduceMotion","useReducedMotion","focusTrapRef","setFocusTrapRef","useFocusTrap","toggleBodyClass","add","hasOtherDialogs","handleCloseButton","closeDialog","usedEscapeKey","previousShow","setPreviousShow","useEsc","dialogElement","currentActiveElement","handleAnimationComplete","definition","modalClasses","classNames","isSmallestDialog","hasChildren","modalDialogClasses","spring","springXs","ReactDOM","jsx","DialogContextProvider","AnimatePresence","jsxs","motion","Fragment","DialogHeader","DialogBody","DialogFooter"],"mappings":";;;;;;;;;;;;;AAcA,MAAMA,IAAqB,gBACrBC,IAAmB,cA0HnBC,IAAS,CAACC,MAA0C;AACtD,QAAM;AAAA,IACF,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,QAAAC;AAAA,IACA,eAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,eAAAC;A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;AAAA,sBAC/D,WAAU;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACd;AAAA,cAAA;AAAA,YAAA;AAAA,UACJ;AAAA,QAAA;AAAA,MAER;AAAA,IAAA;AAAA,IAEJF;AAAA,EAAA;AAER;AAEA3B,EAAO,QAAQ6D;AACf7D,EAAO,OAAO8D;AACd9D,EAAO,SAAS+D;AAEhB/D,EAAO,UAAU;AACjBA,EAAO,UAAU;AACjBA,EAAO,UAAU;AACjBA,EAAO,UAAU;AACjBA,EAAO,UAAU;AACjBA,EAAO,YAAY;AACnBA,EAAO,kBAAkB;AACzBA,EAAO,mBAAmB;AAC1BA,EAAO,sBAAsB;AAC7BA,EAAO,sBAAsB;AAC7BA,EAAO,mBAAmB;"}
1
+ {"version":3,"file":"Dialog.js","sources":["../../../src/components/dialog/Dialog.tsx"],"sourcesContent":["import React, { useState, useRef, type PropsWithChildren } from 'react';\nimport ReactDOM from 'react-dom';\nimport classNames from 'classnames';\nimport { noop } from 'es-toolkit/function';\nimport { AnimatePresence, type AnimationDefinition, motion, type Transition, useReducedMotion } from 'motion/react';\n\nimport { getOrCreatePortalRoot } from '../../utils/portalRoot';\nimport useEsc from '../../hooks/useEsc';\nimport DialogHeader from './DialogHeader';\nimport DialogBody from './DialogBody';\nimport DialogFooter from './DialogFooter';\nimport useFocusTrap from '../../hooks/useFocusTrap';\nimport { DialogContextProvider } from './dialogContext';\n\nconst MODAL_DIALOG_CLASS = 'modal-dialog';\nconst MODAL_OPEN_CLASS = 'modal-open';\n\nexport type DialogSize =\n | 'xs'\n | 'sm'\n | 'md'\n | 'lg'\n | 'xl'\n | 'full'\n | 'fullwidth'\n | 'fullheight'\n | 'fullheight-lg'\n | 'fullheight-xl'\n | 'fullscreen';\n\nexport type BaseDialogProps = {\n /**\n * Opens the dialog when set to `true`.\n *\n * @default false\n */\n show: boolean;\n\n /**\n * The dialog title (can also be a FormattedMessage component).\n */\n title?: React.ReactNode;\n\n /**\n * The dialog header subtitle content.\n */\n subtitle?: React.ReactNode;\n\n /**\n * Shows a close button when set to `true`.\n *\n * @default true\n */\n showCloseButton?: boolean;\n\n /**\n * A callback function invoked when the dialog closes.\n */\n onClose?: () => void;\n\n /**\n * Defined how large the dialog will be rendered.\n *\n * By default, the dialog has a medium size, and thus it can be omitted.\n *\n * Possible values are:\n *\n * - `'xs'`\n * - `'sm'`\n * - `'lg'`\n * - `'xl'`\n * - `'fullwidth'`\n * - `'fullheight'`\n * - `'fullheight-lg'`\n * - `'fullheight-xl'`\n * - `'fullscreen'`\n *\n * @default 'md'\n */\n bsSize?: DialogSize;\n\n /**\n * Enables or disabled closing the dialog via esc key.\n *\n * @default false\n */\n disableEsc?: boolean;\n\n /**\n * Enables the modal body to overflow and use inline scrolling if needed.\n *\n * @default false\n */\n useOverflow?: boolean;\n\n /**\n * Show Header and Footer Borders for the \"xs\" dialog\n *\n * @default false\n */\n showXsDialogBorders?: boolean;\n\n /**\n * Additional classes for the modal element.\n */\n className?: string;\n};\n\nexport type DialogProps = BaseDialogProps & {\n /**\n * The dialog body content.\n */\n body?: React.ReactNode;\n\n /**\n * The dialog body content.\n */\n footer?: React.ReactNode;\n\n /**\n * Additional classes for the modal-body element.\n */\n bodyClassName?: string;\n\n /**\n * Additional classes for the modal-footer element.\n */\n footerClassName?: string;\n\n /**\n * Allows to add additional buttons to the dialog header.\n */\n headerButtons?: React.ReactNode;\n\n /**\n * A callback fired when esc key is pressed and the dialog is about to close.\n */\n onEsc?: VoidFunction;\n\n /**\n * A callback function to be executed before closing the dialog.\n *\n * If the function returns `false`, the dialog will not be closed\n *\n * @default () => true\n */\n onCloseValidation?: () => boolean;\n};\n\nconst Dialog = (props: PropsWithChildren<DialogProps>) => {\n const {\n title,\n subtitle,\n body,\n footer,\n headerButtons,\n className = '',\n bodyClassName,\n footerClassName,\n showXsDialogBorders = false,\n showCloseButton = true,\n useOverflow = false,\n bsSize,\n show = false,\n onClose: onCloseCallback = noop,\n disableEsc = false,\n onEsc = noop,\n onCloseValidation = () => true,\n children,\n ...remainingProps\n } = props;\n\n const [open, setOpen] = useState(show);\n const dialogWrapperRef = useRef<HTMLDivElement>(null);\n\n const modalRoot = getOrCreatePortalRoot();\n\n const shouldReduceMotion = useReducedMotion();\n\n // Use a setter function for the focus trap as it would not re-render\n // and fails to set the focus listener\n const [focusTrapRef, setFocusTrapRef] = useState<HTMLDivElement>();\n useFocusTrap(focusTrapRef);\n\n const toggleBodyClass = (add: boolean) => {\n // We need to set a body class to fix the -webkit-overflow-scrolling on safari and iOS\n\n // Remove \"modal-open\" from body only when there is no other dialog in the DOM\n // in order to support multiple dialogs\n const hasOtherDialogs = modalRoot.getElementsByClassName(MODAL_DIALOG_CLASS).length > 1;\n\n if (add) {\n document.body.classList.add(MODAL_OPEN_CLASS);\n } else if (!add && !hasOtherDialogs) {\n document.body.classList.remove(MODAL_OPEN_CLASS);\n }\n };\n\n const handleCloseButton = () => closeDialog(true);\n\n const closeDialog = (usedEscapeKey: boolean) => {\n if (onCloseValidation()) {\n setOpen(false);\n onCloseCallback();\n\n usedEscapeKey && onEsc();\n }\n };\n\n const [previousShow, setPreviousShow] = useState(show);\n if (show !== previousShow) {\n setOpen(show);\n toggleBodyClass(show);\n setPreviousShow(show);\n }\n\n useEsc(() => {\n if (!dialogWrapperRef || !dialogWrapperRef.current) {\n return;\n }\n\n const dialogElement = dialogWrapperRef.current;\n const currentActiveElement = document.activeElement;\n\n // Only allow to close the dialog when the focus is inside the dialog\n if (!disableEsc && dialogElement.contains(currentActiveElement)) {\n closeDialog(true);\n }\n });\n\n const handleAnimationComplete = (definition: AnimationDefinition) => {\n // The animation complete callback is invoked too when closing the dialog.\n // For that we check the animation props like the \"opacity\" to skip focusing\n // on the way out when closing the dialog.\n // @ts-ignore\n if (definition.opacity === 0) {\n return;\n }\n\n const dialogElement = dialogWrapperRef.current;\n const currentActiveElement = document.activeElement;\n\n // Set the focus to the dialog if no element inside has focus already. Otherwise, focused\n // elements like inputs would lose their focus to the dialog.\n // Note that in order to focus the dialog itself, the tabindex has to be set on that element\n // IMPORTANT: make sure the dialog has a tabIndex prop\n if (!dialogElement?.contains(currentActiveElement)) {\n dialogWrapperRef?.current?.focus();\n }\n };\n\n const modalClasses = classNames('modal', 'show', className);\n\n const isSmallestDialog = bsSize === 'xs';\n\n const hasChildren = !!children;\n\n const modalDialogClasses = classNames(\n MODAL_DIALOG_CLASS,\n useOverflow && 'modal-overflow',\n bsSize === 'xs' && 'modal-xs',\n bsSize === 'sm' && 'modal-sm',\n bsSize === 'lg' && 'modal-lg',\n bsSize === 'xl' && 'modal-xl',\n bsSize === 'full' && 'modal-full-width',\n bsSize === 'fullwidth' && 'modal-full-width',\n bsSize === 'fullheight' && 'modal-full-height',\n bsSize === 'fullheight-lg' && 'modal-full-height modal-lg',\n bsSize === 'fullheight-xl' && 'modal-full-height modal-xl',\n bsSize === 'fullscreen' && 'modal-fullscreen'\n );\n\n const spring: Transition = {\n type: 'spring',\n damping: 33,\n stiffness: 500,\n };\n\n const springXs: Transition = {\n type: 'spring',\n damping: 25,\n stiffness: 400,\n };\n\n return ReactDOM.createPortal(\n <DialogContextProvider\n value={{ onClose: handleCloseButton, isSmallestDialog, showXsDialogBorders, showCloseButton }}\n >\n {/* @ts-ignore-next-line */}\n <AnimatePresence\n // Disable any initial animations on children that\n // are present when the component is first rendered\n initial={false}\n // Only render one component at a time.\n // The exiting component will finish its exit\n // animation before entering component is rendered\n mode='wait'\n >\n {open && (\n <div\n {...remainingProps}\n className={modalClasses}\n role='dialog'\n ref={dialogWrapperRef}\n aria-label='dialog'\n // Make sure it has a tabIndex to focus the dialog so the close on esc works.\n // biome-ignore lint/a11y/noNoninteractiveTabindex: <explanation>\n tabIndex={0}\n >\n <motion.div\n initial={shouldReduceMotion ? false : { opacity: 0, y: '-50%' }}\n animate={\n shouldReduceMotion\n ? { opacity: 1 }\n : { opacity: 1, y: 0, transition: isSmallestDialog ? springXs : spring }\n }\n exit={shouldReduceMotion ? undefined : { opacity: 0, y: '-150%' }}\n transition={\n shouldReduceMotion\n ? { duration: 0 }\n : {\n opacity: { duration: 0.2 },\n y: { duration: 0.3 },\n }\n }\n onAnimationComplete={handleAnimationComplete}\n // @ts-ignore\n ref={setFocusTrapRef}\n className={modalDialogClasses}\n role='document'\n >\n <div className='modal-content'>\n {hasChildren && children}\n {!hasChildren && (\n <>\n {title && (\n <DialogHeader\n title={title}\n subtitle={subtitle}\n headerButtons={headerButtons}\n />\n )}\n {body && <DialogBody className={bodyClassName}>{body}</DialogBody>}\n {footer && <DialogFooter className={footerClassName}>{footer}</DialogFooter>}\n </>\n )}\n </div>\n </motion.div>\n <motion.div\n initial={shouldReduceMotion ? false : { opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={shouldReduceMotion ? undefined : { opacity: 0 }}\n transition={shouldReduceMotion ? { duration: 0 } : { duration: 0.1 }}\n className='modal-backdrop'\n />\n </div>\n )}\n </AnimatePresence>\n </DialogContextProvider>,\n modalRoot\n );\n};\n\nDialog.Title = DialogHeader;\nDialog.Body = DialogBody;\nDialog.Footer = DialogFooter;\n\nDialog.SIZE_XS = 'xs' as const;\nDialog.SIZE_SM = 'sm' as const;\nDialog.SIZE_MD = 'md' as const; // default\nDialog.SIZE_LG = 'lg' as const;\nDialog.SIZE_XL = 'xl' as const;\nDialog.SIZE_FULL = 'full' as const;\nDialog.SIZE_FULL_WIDTH = 'fullwidth' as const;\nDialog.SIZE_FULL_HEIGHT = 'fullheight' as const;\nDialog.SIZE_FULL_HEIGHT_LG = 'fullheight-lg' as const;\nDialog.SIZE_FULL_HEIGHT_XL = 'fullheight-xl' as const;\nDialog.SIZE_FULL_SCREEN = 'fullscreen' as const;\n\nexport default Dialog;\n"],"names":["MODAL_DIALOG_CLASS","MODAL_OPEN_CLASS","Dialog","props","title","subtitle","body","footer","headerButtons","className","bodyClassName","footerClassName","showXsDialogBorders","showCloseButton","useOverflow","bsSize","show","onCloseCallback","noop","disableEsc","onEsc","onCloseValidation","children","remainingProps","open","setOpen","useState","dialogWrapperRef","useRef","modalRoot","getOrCreatePortalRoot","shouldReduceMotion","useReducedMotion","focusTrapRef","setFocusTrapRef","useFocusTrap","toggleBodyClass","add","hasOtherDialogs","handleCloseButton","closeDialog","usedEscapeKey","previousShow","setPreviousShow","useEsc","dialogElement","currentActiveElement","handleAnimationComplete","definition","modalClasses","classNames","isSmallestDialog","hasChildren","modalDialogClasses","spring","springXs","ReactDOM","jsx","DialogContextProvider","AnimatePresence","jsxs","motion","Fragment","DialogHeader","DialogBody","DialogFooter"],"mappings":";;;;;;;;;;;;;AAcA,MAAMA,IAAqB,gBACrBC,IAAmB,cAsInBC,IAAS,CAACC,MAA0C;AACtD,QAAM;AAAA,IACF,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,QAAAC;AAAA,IACA,eAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,eAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,qBAAAC,IAAsB;AAAA,IACtB,iBAAAC,IAAkB;AAAA,IAClB,aAAAC,IAAc;AAAA,IACd,QAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,SAASC,IAAkBC;AAAA,IAC3B,YAAAC,IAAa;AAAA,IACb,OAAAC,IAAQF;AAAA,IACR,mBAAAG,IAAoB,MAAM;AAAA,IAC1B,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHpB,GAEE,CAACqB,GAAMC,CAAO,IAAIC,EAASV,CAAI,GAC/BW,IAAmBC,GAAuB,IAAI,GAE9CC,IAAYC,GAAA,GAEZC,IAAqBC,GAAA,GAIrB,CAACC,GAAcC,CAAe,IAAIR,EAAA;AACxC,EAAAS,GAAaF,CAAY;AAEzB,QAAMG,IAAkB,CAACC,MAAiB;AAKtC,UAAMC,IAAkBT,EAAU,uBAAuB7B,CAAkB,EAAE,SAAS;AAEtF,IAAIqC,IACA,SAAS,KAAK,UAAU,IAAIpC,CAAgB,IACrC,CAACoC,KAAO,CAACC,KAChB,SAAS,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UAAAC;AAAA,8BACA,eAAAG;AAAA,4BAAA;AAAA,0BAAA;AAAA,0BAGPF,KAAQ,gBAAAmD,EAACO,GAAA,EAAW,WAAWtD,GAAgB,UAAAJ,GAAK;AAAA,0BACpDC,KAAU,gBAAAkD,EAACQ,GAAA,EAAa,WAAWtD,GAAkB,UAAAJ,EAAA,CAAO;AAAA,wBAAA,EAAA,CACjE;AAAA,sBAAA,EAAA,CAER;AAAA,oBAAA;AAAA,kBAAA;AAAA,kBAEJ,gBAAAkD;AAAA,oBAACI,EAAO;AAAA,oBAAP;AAAA,sBACG,SAAS9B,IAAqB,KAAQ,EAAE,SAAS,EAAA;AAAA,sBACjD,SAAS,EAAE,SAAS,EAAA;AAAA,sBACpB,MAAMA,IAAqB,SAAY,EAAE,SAAS,EAAA;AAAA,sBAClD,YAAYA,IAAqB,EAAE,UAAU,MAAM,EAAE,UAAU,IAAA;AAAA,sBAC/D,WAAU;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACd;AAAA,cAAA;AAAA,YAAA;AAAA,UACJ;AAAA,QAAA;AAAA,MAER;AAAA,IAAA;AAAA,IAEJF;AAAA,EAAA;AAER;AAEA3B,EAAO,QAAQ6D;AACf7D,EAAO,OAAO8D;AACd9D,EAAO,SAAS+D;AAEhB/D,EAAO,UAAU;AACjBA,EAAO,UAAU;AACjBA,EAAO,UAAU;AACjBA,EAAO,UAAU;AACjBA,EAAO,UAAU;AACjBA,EAAO,YAAY;AACnBA,EAAO,kBAAkB;AACzBA,EAAO,mBAAmB;AAC1BA,EAAO,sBAAsB;AAC7BA,EAAO,sBAAsB;AAC7BA,EAAO,mBAAmB;"}
@@ -6,6 +6,7 @@ export type ReleaseNotesDialogProps = {
6
6
  showReleaseNotes: boolean;
7
7
  /**
8
8
  * Callback set showReleaseNotes state
9
+ *
9
10
  * @param show
10
11
  * @returns
11
12
  */
@@ -26,8 +27,6 @@ export type ReleaseNotesDialogProps = {
26
27
  * Translated release notes.
27
28
  *
28
29
  * @example
29
- *
30
- * ```tsx
31
30
  * {
32
31
  * "0.1.2": {
33
32
  * date: '20.10.2023',
@@ -40,7 +39,6 @@ export type ReleaseNotesDialogProps = {
40
39
  * ),
41
40
  * }
42
41
  * }
43
- * ```
44
42
  */
45
43
  translatedReleaseNotes: ReleaseNotesData;
46
44
  /**
@@ -54,6 +52,8 @@ export type ReleaseNotesDialogProps = {
54
52
  /**
55
53
  * Enables the content of the dialog to scroll when it overflows.
56
54
  * This means the dialog body scrolls instead of the entire dialog.
55
+ *
56
+ * @default true
57
57
  */
58
58
  useOverflow?: boolean;
59
59
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ReleaseNotesDialog.js","sources":["../../../src/components/dialog/ReleaseNotesDialog.tsx"],"sourcesContent":["import ReleaseNotes, { type ReleaseNotesData } from '../releaseNotes/ReleaseNotes';\n\nimport Button from '../button/Button';\nimport Dialog from './Dialog';\n\nconst setReleaseNotesItem = (props: ReleaseNotesDialogProps) => {\n window.localStorage.setItem(props.RELEASE_NOTES_ITEM, props.currentVersion);\n props.setShowReleaseNotes(false);\n};\n\nconst getModuleName = (moduleName: string | undefined, whatsNew: string | undefined) => (\n <span>{moduleName ? moduleName : whatsNew}</span>\n);\n\nexport type ReleaseNotesDialogProps = {\n /**\n * Decides if the dialog is opened.\n */\n showReleaseNotes: boolean;\n\n /**\n * Callback set showReleaseNotes state\n * @param show\n * @returns\n */\n setShowReleaseNotes: (show: boolean) => void;\n\n /**\n * Translated text for \"What`s new?\"\n */\n whatsNewTitle?: string;\n\n /**\n * The translated modulename.\n */\n moduleName?: string;\n\n /**\n * Translated text for the close button.\n */\n closeButtonText?: string;\n\n /**\n * Translated release notes.\n *\n * @example\n *\n * ```tsx\n * {\n * \"0.1.2\": {\n * date: '20.10.2023',\n * content: (\n * <div className='padding-left-15'>\n * Summary\n * • Feature 1\n * • Feature 2\n * </div>\n * ),\n * }\n * }\n * ```\n */\n translatedReleaseNotes: ReleaseNotesData;\n\n /**\n * Specifies the current module version.\n */\n currentVersion: string;\n\n /**\n * Specifies the item in the localStorage that is used to save the last read module version.\n */\n RELEASE_NOTES_ITEM: string;\n\n /**\n * Enables the content of the dialog to scroll when it overflows.\n * This means the dialog body scrolls instead of the entire dialog.\n */\n useOverflow?: boolean;\n};\n\nconst ReleaseNotesDialog = (props: ReleaseNotesDialogProps) => {\n const { moduleName, whatsNewTitle, closeButtonText, translatedReleaseNotes, useOverflow = true } = props;\n\n return (\n <Dialog\n show={props.showReleaseNotes}\n useOverflow={useOverflow}\n title={getModuleName(moduleName, whatsNewTitle)}\n subtitle={moduleName && whatsNewTitle}\n body={<ReleaseNotes releaseNotes={translatedReleaseNotes} />}\n footer={<Button onClick={() => setReleaseNotesItem(props)}>{closeButtonText || 'Close'}</Button>}\n onClose={() => setReleaseNotesItem(props)}\n />\n );\n};\n\nexport default ReleaseNotesDialog;\n"],"names":["setReleaseNotesItem","props","getModuleName","moduleName","whatsNew","ReleaseNotesDialog","whatsNewTitle","closeButtonText","translatedReleaseNotes","useOverflow","jsx","Dialog","ReleaseNotes","Button"],"mappings":";;;;AAKA,MAAMA,IAAsB,CAACC,MAAmC;AAC5D,SAAO,aAAa,QAAQA,EAAM,oBAAoBA,EAAM,cAAc,GAC1EA,EAAM,oBAAoB,EAAK;AACnC,GAEMC,IAAgB,CAACC,GAAgCC,wBAClD,QAAA,EAAM,UAAAD,KAA0BC,GAAS,GAsExCC,IAAqB,CAACJ,MAAmC;AAC3D,QAAM,EAAE,YAAAE,GAAY,eAAAG,GAAe,iBAAAC,GAAiB,wBAAAC,GAAwB,aAAAC,IAAc,OAASR;AAEnG,SACI,gBAAAS;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,MAAMV,EAAM;AAAA,MACZ,aAAAQ;AAAA,MACA,OAAOP,EAAcC,GAAYG,CAAa;AAAA,MAC9C,UAAUH,KAAcG;AAAA,MACxB,MAAM,gBAAAI,EAACE,GAAA,EAAa,cAAcJ,EAAA,CAAwB;AAAA,MAC1D,0BAASK,GAAA,EAAO,SAAS,MAAMb,EAAoBC,CAAK,GAAI,UAAAM,KAAmB,QAAA,CAAQ;AAAA,MACvF,SAAS,MAAMP,EAAoBC,CAAK;AAAA,IAAA;AAAA,EAAA;AAGpD;"}
1
+ {"version":3,"file":"ReleaseNotesDialog.js","sources":["../../../src/components/dialog/ReleaseNotesDialog.tsx"],"sourcesContent":["import ReleaseNotes, { type ReleaseNotesData } from '../releaseNotes/ReleaseNotes';\n\nimport Button from '../button/Button';\nimport Dialog from './Dialog';\n\nconst setReleaseNotesItem = (props: ReleaseNotesDialogProps) => {\n window.localStorage.setItem(props.RELEASE_NOTES_ITEM, props.currentVersion);\n props.setShowReleaseNotes(false);\n};\n\nconst getModuleName = (moduleName: string | undefined, whatsNew: string | undefined) => (\n <span>{moduleName ? moduleName : whatsNew}</span>\n);\n\nexport type ReleaseNotesDialogProps = {\n /**\n * Decides if the dialog is opened.\n */\n showReleaseNotes: boolean;\n\n /**\n * Callback set showReleaseNotes state\n *\n * @param show\n * @returns\n */\n setShowReleaseNotes: (show: boolean) => void;\n\n /**\n * Translated text for \"What`s new?\"\n */\n whatsNewTitle?: string;\n\n /**\n * The translated modulename.\n */\n moduleName?: string;\n\n /**\n * Translated text for the close button.\n */\n closeButtonText?: string;\n\n /**\n * Translated release notes.\n *\n * @example\n * {\n * \"0.1.2\": {\n * date: '20.10.2023',\n * content: (\n * <div className='padding-left-15'>\n * Summary\n * • Feature 1\n * • Feature 2\n * </div>\n * ),\n * }\n * }\n */\n translatedReleaseNotes: ReleaseNotesData;\n\n /**\n * Specifies the current module version.\n */\n currentVersion: string;\n\n /**\n * Specifies the item in the localStorage that is used to save the last read module version.\n */\n RELEASE_NOTES_ITEM: string;\n\n /**\n * Enables the content of the dialog to scroll when it overflows.\n * This means the dialog body scrolls instead of the entire dialog.\n *\n * @default true\n */\n useOverflow?: boolean;\n};\n\nconst ReleaseNotesDialog = (props: ReleaseNotesDialogProps) => {\n const { moduleName, whatsNewTitle, closeButtonText, translatedReleaseNotes, useOverflow = true } = props;\n\n return (\n <Dialog\n show={props.showReleaseNotes}\n useOverflow={useOverflow}\n title={getModuleName(moduleName, whatsNewTitle)}\n subtitle={moduleName && whatsNewTitle}\n body={<ReleaseNotes releaseNotes={translatedReleaseNotes} />}\n footer={<Button onClick={() => setReleaseNotesItem(props)}>{closeButtonText || 'Close'}</Button>}\n onClose={() => setReleaseNotesItem(props)}\n />\n );\n};\n\nexport default ReleaseNotesDialog;\n"],"names":["setReleaseNotesItem","props","getModuleName","moduleName","whatsNew","ReleaseNotesDialog","whatsNewTitle","closeButtonText","translatedReleaseNotes","useOverflow","jsx","Dialog","ReleaseNotes","Button"],"mappings":";;;;AAKA,MAAMA,IAAsB,CAACC,MAAmC;AAC5D,SAAO,aAAa,QAAQA,EAAM,oBAAoBA,EAAM,cAAc,GAC1EA,EAAM,oBAAoB,EAAK;AACnC,GAEMC,IAAgB,CAACC,GAAgCC,wBAClD,QAAA,EAAM,UAAAD,KAA0BC,GAAS,GAsExCC,IAAqB,CAACJ,MAAmC;AAC3D,QAAM,EAAE,YAAAE,GAAY,eAAAG,GAAe,iBAAAC,GAAiB,wBAAAC,GAAwB,aAAAC,IAAc,OAASR;AAEnG,SACI,gBAAAS;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,MAAMV,EAAM;AAAA,MACZ,aAAAQ;AAAA,MACA,OAAOP,EAAcC,GAAYG,CAAa;AAAA,MAC9C,UAAUH,KAAcG;AAAA,MACxB,MAAM,gBAAAI,EAACE,GAAA,EAAa,cAAcJ,EAAA,CAAwB;AAAA,MAC1D,0BAASK,GAAA,EAAO,SAAS,MAAMb,EAAoBC,CAAK,GAAI,UAAAM,KAAmB,QAAA,CAAQ;AAAA,MACvF,SAAS,MAAMP,EAAoBC,CAAK;AAAA,IAAA;AAAA,EAAA;AAGpD;"}
@@ -33,12 +33,16 @@ export type ButtonDropdownProps<T extends DropdownToggleButtonType = 'button'> =
33
33
  * Defines how large the button will be rendered.
34
34
  *
35
35
  * Possible values are: `xs`, `sm`, `md`, `lg`
36
+ *
37
+ * @default 'md'
36
38
  */
37
39
  bsSize?: BUTTON_SIZE;
38
40
  /**
39
41
  * Defines the button color.
40
42
  *
41
43
  * Possible values are: `default`, `primary`, `secondary`, `info`, `warning`, `danger`, `success`, `muted`
44
+ *
45
+ * @default 'default'
42
46
  */
43
47
  bsStyle?: BUTTON_STYLE;
44
48
  /**
@@ -1,18 +1,18 @@
1
- import { jsx as l, jsxs as N, Fragment as ro } from "react/jsx-runtime";
2
- import { forwardRef as so, useState as c, useEffect as lo } from "react";
3
- import po from "react-dom";
4
- import { usePopper as ao } from "react-popper";
1
+ import { jsx as i, jsxs as h } from "react/jsx-runtime";
2
+ import { forwardRef as ro, useState as f, useEffect as so } from "react";
3
+ import lo from "react-dom";
4
+ import { usePopper as po } from "react-popper";
5
5
  import P from "classnames";
6
6
  import { noop as u } from "es-toolkit/function";
7
- import { isNil as io } from "es-toolkit/predicate";
8
- import { getOrCreatePortalRoot as co } from "../../utils/portalRoot.js";
9
- import fo, { DEFAULT_EVENT_TYPES as mo } from "../../hooks/useClickOutside.js";
10
- import uo from "../menuItems/MenuItems.js";
11
- import go from "../menuItems/MenuItemList.js";
12
- import wo from "./DropdownToggleButton.js";
13
- import Co from "./SplitCaretButton.js";
14
- import Bo from "./Caret.js";
15
- const Do = (r, s) => r && s ? "top-end" : !r && s ? "top-start" : r && !s ? "bottom-end" : "bottom-start", Oo = () => so((r, s) => {
7
+ import { isNil as ao } from "es-toolkit/predicate";
8
+ import { getOrCreatePortalRoot as io } from "../../utils/portalRoot.js";
9
+ import fo, { DEFAULT_EVENT_TYPES as co } from "../../hooks/useClickOutside.js";
10
+ import mo from "../menuItems/MenuItems.js";
11
+ import uo from "../menuItems/MenuItemList.js";
12
+ import go from "./DropdownToggleButton.js";
13
+ import wo from "./SplitCaretButton.js";
14
+ import Co from "./Caret.js";
15
+ const Bo = (r, s) => r && s ? "top-end" : !r && s ? "top-start" : r && !s ? "bottom-end" : "bottom-start", Do = () => ro((r, s) => {
16
16
  const {
17
17
  id: g = Math.random().toString(36).slice(2, 16),
18
18
  items: R = [],
@@ -26,61 +26,61 @@ const Do = (r, s) => r && s ? "top-end" : !r && s ? "top-start" : r && !s ? "bot
26
26
  customDropdown: O,
27
27
  open: e,
28
28
  dropup: y = !1,
29
- pullRight: f = !1,
29
+ pullRight: c = !1,
30
30
  noCaret: E = !1,
31
31
  onOpen: L = u,
32
32
  onClose: x = u,
33
33
  onLabelButtonClick: I = u,
34
- usePortal: p = !1,
34
+ usePortal: l = !1,
35
35
  popperConfig: j,
36
- toggleButtonType: F = "button",
36
+ toggleButtonType: U = "button",
37
37
  toggleClassName: S = "",
38
- dropdownClassName: U,
39
- className: _ = "",
40
- ...v
41
- } = r, [b, m] = c(e), [z, A] = c(null), [h, V] = c(null), [Y, q] = c(null), G = {
42
- placement: Do(f, y),
38
+ dropdownClassName: _,
39
+ className: v = "",
40
+ ...z
41
+ } = r, [b, m] = f(e), [A, F] = f(null), [M, V] = f(null), [Y, q] = f(null), G = {
42
+ placement: Bo(c, y),
43
43
  modifiers: []
44
- }, H = t && f ? Y : z, { styles: J, attributes: K } = ao(H, h, j || G), n = io(e), a = n ? b : e, Q = fo(
44
+ }, H = t && c ? Y : A, { styles: J, attributes: K } = po(H, M, j || G), n = ao(e), p = n ? b : e, Q = fo(
45
45
  (o) => {
46
- p && h?.contains(o.target) || i();
46
+ l && M?.contains(o.target) || a();
47
47
  },
48
- mo,
49
- !!a
48
+ co,
49
+ !!p
50
50
  // only listen to clicks outside when the dropdown is open
51
- ), W = co(), X = !E && !t && !D;
52
- lo(() => {
51
+ ), W = io(), X = !E && !t && !D;
52
+ so(() => {
53
53
  n || m(e);
54
54
  }, [n, e]);
55
55
  const d = (o) => {
56
- (n ? b : e) ? i() : Z(o);
56
+ (n ? b : e) ? a() : Z(o);
57
57
  }, Z = (o) => {
58
58
  n && m(!0), o && L(o);
59
- }, i = () => {
59
+ }, a = () => {
60
60
  n && m(!1), x();
61
61
  }, $ = () => {
62
- i(), I();
62
+ a(), I();
63
63
  }, oo = (o) => {
64
64
  d(o);
65
65
  }, to = (o) => {
66
66
  t ? $() : d(o);
67
- }, eo = P("dropdown", "btn-group", a && "open", _), no = P(
68
- p && "dropdown-portal",
69
- t && f && "pull-right",
70
- U
71
- ), M = /* @__PURE__ */ l(
72
- go,
67
+ }, eo = P("dropdown", "btn-group", p && "open", v), no = P(
68
+ l && "dropdown-portal",
69
+ t && c && "pull-right",
70
+ _
71
+ ), N = /* @__PURE__ */ i(
72
+ uo,
73
73
  {
74
74
  className: no,
75
75
  ref: V,
76
76
  style: J.popper,
77
77
  ...K.popper,
78
- children: O || /* @__PURE__ */ l(uo, { items: R, closeMenu: d })
78
+ children: O || /* @__PURE__ */ i(mo, { items: R, closeMenu: d })
79
79
  }
80
80
  );
81
- return /* @__PURE__ */ N("div", { ...v, className: eo, ref: Q, children: [
82
- /* @__PURE__ */ l(
83
- wo,
81
+ return /* @__PURE__ */ h("div", { ...z, className: eo, ref: Q, children: [
82
+ /* @__PURE__ */ h(
83
+ go,
84
84
  {
85
85
  id: g,
86
86
  splitButton: t,
@@ -89,19 +89,19 @@ const Do = (r, s) => r && s ? "top-end" : !r && s ? "top-start" : r && !s ? "bot
89
89
  variant: T,
90
90
  iconOnly: D,
91
91
  disabled: B,
92
- ref: A,
92
+ ref: F,
93
93
  onClick: to,
94
94
  outerRef: s,
95
- toggleButtonType: F,
95
+ toggleButtonType: U,
96
96
  className: S,
97
- children: /* @__PURE__ */ N(ro, { children: [
97
+ children: [
98
98
  k,
99
- X && /* @__PURE__ */ l(Bo, {})
100
- ] })
99
+ X && /* @__PURE__ */ i(Co, {})
100
+ ]
101
101
  }
102
102
  ),
103
- t && /* @__PURE__ */ l(
104
- Co,
103
+ t && /* @__PURE__ */ i(
104
+ wo,
105
105
  {
106
106
  id: g,
107
107
  bsStyle: C,
@@ -112,11 +112,11 @@ const Do = (r, s) => r && s ? "top-end" : !r && s ? "top-start" : r && !s ? "bot
112
112
  ref: q
113
113
  }
114
114
  ),
115
- a && p && po.createPortal(M, W),
116
- a && !p && M
115
+ p && l && lo.createPortal(N, W),
116
+ p && !l && N
117
117
  ] });
118
- }), Fo = Oo();
118
+ }), jo = Do();
119
119
  export {
120
- Fo as default
120
+ jo as default
121
121
  };
122
122
  //# sourceMappingURL=ButtonDropdown.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonDropdown.js","sources":["../../../src/components/dropdown/ButtonDropdown.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: <explanation>\nimport React, { useState, useEffect, forwardRef, type PropsWithChildren } from 'react';\nimport ReactDOM from 'react-dom';\nimport { usePopper } from 'react-popper';\nimport classNames from 'classnames';\nimport { noop } from 'es-toolkit/function';\nimport { isNil } from 'es-toolkit/predicate';\n\nimport { getOrCreatePortalRoot } from '../../utils/portalRoot';\nimport useClickOutside, { DEFAULT_EVENT_TYPES } from '../../hooks/useClickOutside';\nimport MenuItems from '../menuItems/MenuItems';\nimport MenuItemList from '../menuItems/MenuItemList';\nimport DropdownToggleButton, { type DropdownToggleEvent, type DropdownToggleButtonType } from './DropdownToggleButton';\nimport SplitCaretButton from './SplitCaretButton';\nimport Caret from './Caret';\nimport type { MenuItemProps as MenuItem } from '../menuItems/MenuItem';\nimport type { BUTTON_SIZE, BUTTON_STYLE, BUTTON_VARIANT } from '../button/Button';\n\nconst getPlacement = (pullRight: boolean, dropup: boolean) => {\n if (pullRight && dropup) {\n return 'top-end';\n }\n if (!pullRight && dropup) {\n return 'top-start';\n }\n if (pullRight && !dropup) {\n return 'bottom-end';\n }\n return 'bottom-start';\n};\n\nexport type ButtonDropdownProps<T extends DropdownToggleButtonType = 'button'> = {\n /**\n * Unique button id. If not present a random id is generated.\n */\n id?: string;\n\n /**\n * The button title. This may be also a node, like a <span> or a <FormattedMessage>.\n */\n title: string | React.ReactNode;\n\n /**\n * Defined weather or not the menu is rendered.\n * Use this to control the component from the outside.\n *\n * @default undefined\n */\n open?: boolean;\n\n /**\n * Defines whether the dropdown opens above or below.\n * Set it to \"true\" additionally disables the automatic position feature.\n *\n * @default false\n */\n dropup?: boolean;\n\n /**\n * Defines whether the dropdown opens right aligned to the dropdown or not.\n */\n pullRight?: boolean;\n\n /**\n * Defines how large the button will be rendered.\n *\n * Possible values are: `xs`, `sm`, `md`, `lg`\n */\n bsSize?: BUTTON_SIZE;\n\n /**\n * Defines the button color.\n *\n * Possible values are: `default`, `primary`, `secondary`, `info`, `warning`, `danger`, `success`, `muted`\n */\n bsStyle?: BUTTON_STYLE;\n\n /**\n * Defines the variation of the button design.\n *\n * Possible values are: `link`, `link-inline`, `outline`, `action`\n */\n variant?: BUTTON_VARIANT;\n\n /**\n * Specify the toggle element type.\n * It supports the following types: \"button\" | \"tag\" | \"label\"\n *\n * @default 'button'\n */\n toggleButtonType?: DropdownToggleButtonType;\n\n /**\n * Optional prop to defines whether the dropdown title is icon only which\n * applies different padding so the button is a square.\n *\n * @default false\n */\n iconOnly?: boolean;\n\n /**\n * Defines whether the caret is shown or not.\n *\n * @default false\n */\n noCaret?: boolean;\n\n /**\n * Defines whether the dropdown-toggle (with caret) should be in a separate button.\n *\n * @default false\n */\n splitButton?: boolean;\n\n /**\n * Renders the dropdown into a dedicated react portal\n *\n * @default false\n */\n usePortal?: boolean;\n\n /**\n * Items to display in the dropdown menu. If you use a custom dropdown you can skip this prop.\n */\n items?: MenuItem[];\n\n /**\n * Disables the dropdown button.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Callback for splitButton label button click.\n */\n onLabelButtonClick?: () => void;\n\n /**\n * Callback for when the toggle button was clicked to open it.\n * @param event\n * @returns\n */\n onOpen?: (event: DropdownToggleEvent<T>) => void;\n\n /**\n * Callback for when the toggle button was clicked to close it.\n * @returns\n */\n onClose?: () => void;\n\n /**\n * Allows to pass in custom dropdown menu content.\n */\n customDropdown?: React.ReactNode;\n\n /**\n * Define custom popper.js configuration for dropdown placement and modifiers.\n */\n popperConfig?: object;\n\n /**\n * Additional classes to be set on the dropdown-toggle button.\n */\n toggleClassName?: string;\n\n /**\n * Additional classes to be set on the dropdown.\n */\n dropdownClassName?: string;\n\n /**\n * Additional classes to be set to the wrapper element.\n */\n className?: string;\n};\n\nconst createButtonDropdown = <T extends DropdownToggleButtonType = 'button'>() => {\n return forwardRef<\n T extends 'button' ? HTMLButtonElement : HTMLDivElement,\n PropsWithChildren<ButtonDropdownProps<T>>\n >((props, ref) => {\n const {\n id = Math.random().toString(36).slice(2, 16),\n items = [],\n bsSize = 'md',\n bsStyle = 'default',\n variant,\n disabled = false,\n iconOnly = false,\n title,\n splitButton = false,\n customDropdown,\n open,\n dropup = false,\n pullRight = false,\n noCaret = false,\n onOpen = noop,\n onClose = noop,\n onLabelButtonClick = noop,\n usePortal = false,\n popperConfig,\n toggleButtonType = 'button',\n toggleClassName = '',\n dropdownClassName,\n className = '',\n ...remainingProps\n } = props;\n\n const [internalOpen, setInternalOpen] = useState(open);\n\n const [refDropdownToggle, setRefDropdownToggle] = useState<HTMLButtonElement | HTMLDivElement | null>(null);\n const [refDropdownMenu, setRefDropdownMenu] = useState<HTMLUListElement | null>(null);\n const [refSplitButtonToggle, setRefSplitButtonToggle] = useState<HTMLButtonElement | null>(null);\n\n const defaultPopperConfig = {\n placement: getPlacement(pullRight, dropup),\n modifiers: [],\n };\n\n const popperParentRef = splitButton && pullRight ? refSplitButtonToggle : refDropdownToggle;\n\n const { styles, attributes } = usePopper(popperParentRef, refDropdownMenu, popperConfig || defaultPopperConfig);\n\n const isUncontrolled = isNil(open);\n const isOpen = isUncontrolled ? internalOpen : open;\n\n const wrapperRef = useClickOutside(\n event => {\n if (usePortal) {\n // In case the dropdown is rendered via portal the clickOutside the toggle button element is\n // triggered since the dropdown is not a child of the wrapper element.\n // In this case we need to check if the event target is inside the dropdown-menu and prevent closing\n // the dropdown\n if (!refDropdownMenu?.contains(event.target as Node)) {\n closeMenu();\n }\n } else {\n closeMenu();\n }\n },\n DEFAULT_EVENT_TYPES,\n Boolean(isOpen) // only listen to clicks outside when the dropdown is open\n );\n\n const dropdownRoot = getOrCreatePortalRoot();\n\n const shouldShowCaret = !noCaret && !splitButton && !iconOnly;\n\n useEffect(() => {\n if (!isUncontrolled) {\n setInternalOpen(open);\n }\n }, [isUncontrolled, open]);\n\n const toggleOpen = (event?: DropdownToggleEvent<T>) => {\n const isDropdownOpen = isUncontrolled ? internalOpen : open;\n\n if (isDropdownOpen) {\n closeMenu();\n } else {\n openMenu(event);\n }\n };\n\n const openMenu = (event?: DropdownToggleEvent<T>) => {\n if (isUncontrolled) {\n setInternalOpen(true);\n }\n if (event) {\n onOpen(event);\n }\n };\n\n const closeMenu = () => {\n if (isUncontrolled) {\n setInternalOpen(false);\n }\n onClose();\n };\n\n const handleSplitLabelButtonClick = () => {\n closeMenu();\n onLabelButtonClick();\n };\n\n const handleSplitCaretButtonClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n toggleOpen(event as any);\n };\n\n const handleDropdownButtonClick = (event: React.MouseEvent<HTMLButtonElement | HTMLDivElement>) => {\n if (splitButton) {\n handleSplitLabelButtonClick();\n } else {\n toggleOpen(event as DropdownToggleEvent<T>);\n }\n };\n\n const wrapperClasses = classNames('dropdown', 'btn-group', isOpen && 'open', className);\n\n const dropdownClasses = classNames(\n usePortal && 'dropdown-portal',\n splitButton && pullRight && 'pull-right',\n dropdownClassName\n );\n\n const dropdownMenu = (\n <MenuItemList\n className={dropdownClasses}\n ref={setRefDropdownMenu}\n style={styles.popper}\n {...attributes.popper}\n >\n {customDropdown ? customDropdown : <MenuItems items={items} closeMenu={toggleOpen} />}\n </MenuItemList>\n );\n\n return (\n <div {...remainingProps} className={wrapperClasses} ref={wrapperRef}>\n <DropdownToggleButton\n id={id}\n splitButton={splitButton}\n bsStyle={bsStyle}\n bsSize={bsSize}\n variant={variant}\n iconOnly={iconOnly}\n disabled={disabled}\n ref={setRefDropdownToggle}\n onClick={handleDropdownButtonClick}\n outerRef={ref}\n toggleButtonType={toggleButtonType}\n className={toggleClassName}\n >\n <>\n {title}\n {shouldShowCaret && <Caret />}\n </>\n </DropdownToggleButton>\n {splitButton && (\n <SplitCaretButton\n id={id}\n bsStyle={bsStyle}\n bsSize={bsSize}\n disabled={disabled}\n className={toggleClassName}\n onClick={handleSplitCaretButtonClick}\n ref={setRefSplitButtonToggle}\n />\n )}\n {isOpen && usePortal && ReactDOM.createPortal(dropdownMenu, dropdownRoot)}\n {isOpen && !usePortal && dropdownMenu}\n </div>\n );\n });\n};\n\nconst ButtonDropdown = createButtonDropdown();\n\nexport default ButtonDropdown;\n"],"names":["getPlacement","pullRight","dropup","createButtonDropdown","forwardRef","props","ref","id","items","bsSize","bsStyle","variant","disabled","iconOnly","title","splitButton","customDropdown","open","noCaret","onOpen","noop","onClose","onLabelButtonClick","usePortal","popperConfig","toggleButtonType","toggleClassName","dropdownClassName","className","remainingProps","internalOpen","setInternalOpen","useState","refDropdownToggle","setRefDropdownToggle","refDropdownMenu","setRefDropdownMenu","refSplitButtonToggle","setRefSplitButtonToggle","defaultPopperConfig","popperParentRef","styles","attributes","usePopper","isUncontrolled","isNil","isOpen","wrapperRef","useClickOutside","event","closeMenu","DEFAULT_EVENT_TYPES","dropdownRoot","getOrCreatePortalRoot","shouldShowCaret","useEffect","toggleOpen","openMenu","handleSplitLabelButtonClick","handleSplitCaretButtonClick","handleDropdownButtonClick","wrapperClasses","classNames","dropdownClasses","dropdownMenu","jsx","MenuItemList","MenuItems","DropdownToggleButton","jsxs","Fragment","Caret","SplitCaretButton","ReactDOM","ButtonDropdown"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAMA,KAAe,CAACC,GAAoBC,MAClCD,KAAaC,IACN,YAEP,CAACD,KAAaC,IACP,cAEPD,KAAa,CAACC,IACP,eAEJ,gBAqJLC,KAAuB,MAClBC,GAGL,CAACC,GAAOC,MAAQ;AACd,QAAM;AAAA,IACF,IAAAC,IAAK,KAAK,SAAS,SAAS,EAAE,EAAE,MAAM,GAAG,EAAE;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A,QAAAD;AAAA,QACA,SAAAE;AAAA,QACA,UAAAE;AAAA,QACA,UAAAD;AAAA,QACA,KAAKsB;AAAA,QACL,SAAS0B;AAAA,QACT,UAAUtD;AAAA,QACV,kBAAAmB;AAAA,QACA,WAAWC;AAAA,QAEX,UAAA,gBAAA2C,EAAAC,IAAA,EACK,UAAA;AAAA,UAAAxD;AAAA,UACAwC,uBAAoBiB,IAAA,CAAA,CAAM;AAAA,QAAA,EAAA,CAC/B;AAAA,MAAA;AAAA,IAAA;AAAA,IAEHxD,KACG,gBAAAkD;AAAA,MAACO;AAAA,MAAA;AAAA,QACG,IAAAjE;AAAA,QACA,SAAAG;AAAA,QACA,QAAAD;AAAA,QACA,UAAAG;AAAA,QACA,WAAWc;AAAA,QACX,SAASiC;AAAA,QACT,KAAKrB;AAAA,MAAA;AAAA,IAAA;AAAA,IAGZQ,KAAUvB,KAAakD,GAAS,aAAaT,GAAcZ,CAAY;AAAA,IACvEN,KAAU,CAACvB,KAAayC;AAAA,EAAA,GAC7B;AAER,CAAC,GAGCU,KAAiBvE,GAAA;"}
1
+ {"version":3,"file":"ButtonDropdown.js","sources":["../../../src/components/dropdown/ButtonDropdown.tsx"],"sourcesContent":["import React, { useState, useEffect, forwardRef, type PropsWithChildren } from 'react';\nimport ReactDOM from 'react-dom';\nimport { usePopper } from 'react-popper';\nimport classNames from 'classnames';\nimport { noop } from 'es-toolkit/function';\nimport { isNil } from 'es-toolkit/predicate';\n\nimport { getOrCreatePortalRoot } from '../../utils/portalRoot';\nimport useClickOutside, { DEFAULT_EVENT_TYPES } from '../../hooks/useClickOutside';\nimport MenuItems from '../menuItems/MenuItems';\nimport MenuItemList from '../menuItems/MenuItemList';\nimport DropdownToggleButton, { type DropdownToggleEvent, type DropdownToggleButtonType } from './DropdownToggleButton';\nimport SplitCaretButton from './SplitCaretButton';\nimport Caret from './Caret';\nimport type { MenuItemProps as MenuItem } from '../menuItems/MenuItem';\nimport type { BUTTON_SIZE, BUTTON_STYLE, BUTTON_VARIANT } from '../button/Button';\n\nconst getPlacement = (pullRight: boolean, dropup: boolean) => {\n if (pullRight && dropup) {\n return 'top-end';\n }\n if (!pullRight && dropup) {\n return 'top-start';\n }\n if (pullRight && !dropup) {\n return 'bottom-end';\n }\n return 'bottom-start';\n};\n\nexport type ButtonDropdownProps<T extends DropdownToggleButtonType = 'button'> = {\n /**\n * Unique button id. If not present a random id is generated.\n */\n id?: string;\n\n /**\n * The button title. This may be also a node, like a <span> or a <FormattedMessage>.\n */\n title: string | React.ReactNode;\n\n /**\n * Defined weather or not the menu is rendered.\n * Use this to control the component from the outside.\n *\n * @default undefined\n */\n open?: boolean;\n\n /**\n * Defines whether the dropdown opens above or below.\n * Set it to \"true\" additionally disables the automatic position feature.\n *\n * @default false\n */\n dropup?: boolean;\n\n /**\n * Defines whether the dropdown opens right aligned to the dropdown or not.\n */\n pullRight?: boolean;\n\n /**\n * Defines how large the button will be rendered.\n *\n * Possible values are: `xs`, `sm`, `md`, `lg`\n *\n * @default 'md'\n */\n bsSize?: BUTTON_SIZE;\n\n /**\n * Defines the button color.\n *\n * Possible values are: `default`, `primary`, `secondary`, `info`, `warning`, `danger`, `success`, `muted`\n *\n * @default 'default'\n */\n bsStyle?: BUTTON_STYLE;\n\n /**\n * Defines the variation of the button design.\n *\n * Possible values are: `link`, `link-inline`, `outline`, `action`\n */\n variant?: BUTTON_VARIANT;\n\n /**\n * Specify the toggle element type.\n * It supports the following types: \"button\" | \"tag\" | \"label\"\n *\n * @default 'button'\n */\n toggleButtonType?: DropdownToggleButtonType;\n\n /**\n * Optional prop to defines whether the dropdown title is icon only which\n * applies different padding so the button is a square.\n *\n * @default false\n */\n iconOnly?: boolean;\n\n /**\n * Defines whether the caret is shown or not.\n *\n * @default false\n */\n noCaret?: boolean;\n\n /**\n * Defines whether the dropdown-toggle (with caret) should be in a separate button.\n *\n * @default false\n */\n splitButton?: boolean;\n\n /**\n * Renders the dropdown into a dedicated react portal\n *\n * @default false\n */\n usePortal?: boolean;\n\n /**\n * Items to display in the dropdown menu. If you use a custom dropdown you can skip this prop.\n */\n items?: MenuItem[];\n\n /**\n * Disables the dropdown button.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Callback for splitButton label button click.\n */\n onLabelButtonClick?: () => void;\n\n /**\n * Callback for when the toggle button was clicked to open it.\n * @param event\n * @returns\n */\n onOpen?: (event: DropdownToggleEvent<T>) => void;\n\n /**\n * Callback for when the toggle button was clicked to close it.\n * @returns\n */\n onClose?: () => void;\n\n /**\n * Allows to pass in custom dropdown menu content.\n */\n customDropdown?: React.ReactNode;\n\n /**\n * Define custom popper.js configuration for dropdown placement and modifiers.\n */\n popperConfig?: object;\n\n /**\n * Additional classes to be set on the dropdown-toggle button.\n */\n toggleClassName?: string;\n\n /**\n * Additional classes to be set on the dropdown.\n */\n dropdownClassName?: string;\n\n /**\n * Additional classes to be set to the wrapper element.\n */\n className?: string;\n};\n\nconst createButtonDropdown = <T extends DropdownToggleButtonType = 'button'>() => {\n return forwardRef<\n T extends 'button' ? HTMLButtonElement : HTMLDivElement,\n PropsWithChildren<ButtonDropdownProps<T>>\n >((props, ref) => {\n const {\n id = Math.random().toString(36).slice(2, 16),\n items = [],\n bsSize = 'md',\n bsStyle = 'default',\n variant,\n disabled = false,\n iconOnly = false,\n title,\n splitButton = false,\n customDropdown,\n open,\n dropup = false,\n pullRight = false,\n noCaret = false,\n onOpen = noop,\n onClose = noop,\n onLabelButtonClick = noop,\n usePortal = false,\n popperConfig,\n toggleButtonType = 'button',\n toggleClassName = '',\n dropdownClassName,\n className = '',\n ...remainingProps\n } = props;\n\n const [internalOpen, setInternalOpen] = useState(open);\n\n const [refDropdownToggle, setRefDropdownToggle] = useState<HTMLButtonElement | HTMLDivElement | null>(null);\n const [refDropdownMenu, setRefDropdownMenu] = useState<HTMLUListElement | null>(null);\n const [refSplitButtonToggle, setRefSplitButtonToggle] = useState<HTMLButtonElement | null>(null);\n\n const defaultPopperConfig = {\n placement: getPlacement(pullRight, dropup),\n modifiers: [],\n };\n\n const popperParentRef = splitButton && pullRight ? refSplitButtonToggle : refDropdownToggle;\n\n const { styles, attributes } = usePopper(popperParentRef, refDropdownMenu, popperConfig || defaultPopperConfig);\n\n const isUncontrolled = isNil(open);\n const isOpen = isUncontrolled ? internalOpen : open;\n\n const wrapperRef = useClickOutside(\n event => {\n if (usePortal) {\n // In case the dropdown is rendered via portal the clickOutside the toggle button element is\n // triggered since the dropdown is not a child of the wrapper element.\n // In this case we need to check if the event target is inside the dropdown-menu and prevent closing\n // the dropdown\n if (!refDropdownMenu?.contains(event.target as Node)) {\n closeMenu();\n }\n } else {\n closeMenu();\n }\n },\n DEFAULT_EVENT_TYPES,\n Boolean(isOpen) // only listen to clicks outside when the dropdown is open\n );\n\n const dropdownRoot = getOrCreatePortalRoot();\n\n const shouldShowCaret = !noCaret && !splitButton && !iconOnly;\n\n useEffect(() => {\n if (!isUncontrolled) {\n setInternalOpen(open);\n }\n }, [isUncontrolled, open]);\n\n const toggleOpen = (event?: DropdownToggleEvent<T>) => {\n const isDropdownOpen = isUncontrolled ? internalOpen : open;\n\n if (isDropdownOpen) {\n closeMenu();\n } else {\n openMenu(event);\n }\n };\n\n const openMenu = (event?: DropdownToggleEvent<T>) => {\n if (isUncontrolled) {\n setInternalOpen(true);\n }\n if (event) {\n onOpen(event);\n }\n };\n\n const closeMenu = () => {\n if (isUncontrolled) {\n setInternalOpen(false);\n }\n onClose();\n };\n\n const handleSplitLabelButtonClick = () => {\n closeMenu();\n onLabelButtonClick();\n };\n\n const handleSplitCaretButtonClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n toggleOpen(event as any);\n };\n\n const handleDropdownButtonClick = (event: React.MouseEvent<HTMLButtonElement | HTMLDivElement>) => {\n if (splitButton) {\n handleSplitLabelButtonClick();\n } else {\n toggleOpen(event as DropdownToggleEvent<T>);\n }\n };\n\n const wrapperClasses = classNames('dropdown', 'btn-group', isOpen && 'open', className);\n\n const dropdownClasses = classNames(\n usePortal && 'dropdown-portal',\n splitButton && pullRight && 'pull-right',\n dropdownClassName\n );\n\n const dropdownMenu = (\n <MenuItemList\n className={dropdownClasses}\n ref={setRefDropdownMenu}\n style={styles.popper}\n {...attributes.popper}\n >\n {customDropdown ? customDropdown : <MenuItems items={items} closeMenu={toggleOpen} />}\n </MenuItemList>\n );\n\n return (\n <div {...remainingProps} className={wrapperClasses} ref={wrapperRef}>\n <DropdownToggleButton\n id={id}\n splitButton={splitButton}\n bsStyle={bsStyle}\n bsSize={bsSize}\n variant={variant}\n iconOnly={iconOnly}\n disabled={disabled}\n ref={setRefDropdownToggle}\n onClick={handleDropdownButtonClick}\n outerRef={ref}\n toggleButtonType={toggleButtonType}\n className={toggleClassName}\n >\n {title}\n {shouldShowCaret && <Caret />}\n </DropdownToggleButton>\n {splitButton && (\n <SplitCaretButton\n id={id}\n bsStyle={bsStyle}\n bsSize={bsSize}\n disabled={disabled}\n className={toggleClassName}\n onClick={handleSplitCaretButtonClick}\n ref={setRefSplitButtonToggle}\n />\n )}\n {isOpen && usePortal && ReactDOM.createPortal(dropdownMenu, dropdownRoot)}\n {isOpen && !usePortal && dropdownMenu}\n </div>\n );\n });\n};\n\nconst ButtonDropdown = createButtonDropdown();\n\nexport default ButtonDropdown;\n"],"names":["getPlacement","pullRight","dropup","createButtonDropdown","forwardRef","props","ref","id","items","bsSize","bsStyle","variant","disabled","iconOnly","title","splitButton","customDropdown","open","noCaret","onOpen","noop","onClose","onLabelButtonClick","usePortal","popperConfig","toggleButtonType","toggleClassName","dropdownClassName","className","remainingProps","internalOpen","setInternalOpen","useState","refDropdownToggle","setRefDropdownToggle","refDropdownMenu","setRefDropdownMenu","refSplitButtonToggle","setRefSplitButtonToggle","defaultPopperConfig","popperParentRef","styles","attributes","usePopper","isUncontrolled","isNil","isOpen","wrapperRef","useClickOutside","event","closeMenu","DEFAULT_EVENT_TYPES","dropdownRoot","getOrCreatePortalRoot","shouldShowCaret","useEffect","toggleOpen","openMenu","handleSplitLabelButtonClick","handleSplitCaretButtonClick","handleDropdownButtonClick","wrapperClasses","classNames","dropdownClasses","dropdownMenu","jsx","MenuItemList","MenuItems","jsxs","DropdownToggleButton","Caret","SplitCaretButton","ReactDOM","ButtonDropdown"],"mappings":";;;;;;;;;;;;;;AAiBA,MAAMA,KAAe,CAACC,GAAoBC,MAClCD,KAAaC,IACN,YAEP,CAACD,KAAaC,IACP,cAEPD,KAAa,CAACC,IACP,eAEJ,gBAyJLC,KAAuB,MAClBC,GAGL,CAACC,GAAOC,MAAQ;AACd,QAAM;AAAA,IACF,IAAAC,IAAK,KAAK,SAAS,SAAS,EAAE,EAAE,MAAM,GAAG,EAAE;AAAA,IAC3C,OAAAC,IAAQ,CAAA;AAAA,IACR,QAAAC,IAAS;AAAA,IACT,SAAAC,IAAU;AAAA,IACV,SAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,OAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,gBAAAC;AAAA,IACA,MAAAC;AAAA,IACA,QAAAf,IAAS;AAAA,IACT,WAAAD,IAAY;AAAA,IACZ,SAAAiB,IAAU;AAAA,IACV,QAAAC,IAASC;AAAA,IACT,SAAAC,IAAUD;AAAA,IACV,oBAAAE,IAAqBF;AAAA,IACrB,WAAAG,IAAY;AAAA,IACZ,cAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,iBAAAC,IAAkB;AAAA,IAClB,mBAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,GAAGC;AAAA,EAAA,IACHxB,GAEE,CAACyB,GAAcC,CAAe,IAAIC,EAASf,CAAI,GAE/C,CAACgB,GAAmBC,CAAoB,IAAIF,EAAoD,IAAI,GACpG,CAACG,GAAiBC,CAAkB,IAAIJ,EAAkC,IAAI,GAC9E,CAACK,GAAsBC,CAAuB,IAAIN,EAAmC,IAAI,GAEzFO,IAAsB;AAAA,IACxB,WAAWvC,GAAaC,GAAWC,CAAM;AAAA,IACz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gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,WAAWH;AAAA,MACX,KAAK3B;AAAA,MACL,OAAOK,EAAO;AAAA,MACb,GAAGC,EAAW;AAAA,MAEd,eAAkC,gBAAAuB,EAACE,IAAA,EAAU,OAAA3D,GAAc,WAAWgD,EAAA,CAAY;AAAA,IAAA;AAAA,EAAA;AAI3F,2BACK,OAAA,EAAK,GAAG3B,GAAgB,WAAWgC,IAAgB,KAAKd,GACrD,UAAA;AAAA,IAAA,gBAAAqB;AAAA,MAACC;AAAA,MAAA;AAAA,QACG,IAAA9D;AAAA,QACA,aAAAQ;AAAA,QACA,SAAAL;AAAA,QACA,QAAAD;AAAA,QACA,SAAAE;AAAA,QACA,UAAAE;AAAA,QACA,UAAAD;AAAA,QACA,KAAKsB;AAAA,QACL,SAAS0B;AAAA,QACT,UAAUtD;AAAA,QACV,kBAAAmB;AAAA,QACA,WAAWC;AAAA,QAEV,UAAA;AAAA,UAAAZ;AAAA,UACAwC,uBAAoBgB,IAAA,CAAA,CAAM;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAE9BvD,KACG,gBAAAkD;AAAA,MAACM;AAAA,MAAA;AAAA,QACG,IAAAhE;AAAA,QACA,SAAAG;AAAA,QACA,QAAAD;AAAA,QACA,UAAAG;AAAA,QACA,WAAWc;AAAA,QACX,SAASiC;AAAA,QACT,KAAKrB;AAAA,MAAA;AAAA,IAAA;AAAA,IAGZQ,KAAUvB,KAAaiD,GAAS,aAAaR,GAAcZ,CAAY;AAAA,IACvEN,KAAU,CAACvB,KAAayC;AAAA,EAAA,GAC7B;AAER,CAAC,GAGCS,KAAiBtE,GAAA;"}
@@ -3,6 +3,8 @@ import { MenuItemProps as MenuItem } from '../menuItems/MenuItem';
3
3
  export type DropdownSubmenuProps = {
4
4
  /**
5
5
  * Displayed button title.
6
+ *
7
+ * @default ''
6
8
  */
7
9
  title?: string | React.ReactNode;
8
10
  /**
@@ -11,6 +13,8 @@ export type DropdownSubmenuProps = {
11
13
  items?: MenuItem[];
12
14
  /**
13
15
  * Disables every entry on the title list item.
16
+ *
17
+ * @default false
14
18
  */
15
19
  disabled?: boolean;
16
20
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownSubmenu.js","sources":["../../../src/components/dropdown/DropdownSubmenu.tsx"],"sourcesContent":["import type React from 'react';\nimport { useState } from 'react';\nimport classNames from 'classnames';\nimport { usePopper } from 'react-popper';\n\nimport MenuItems from '../menuItems/MenuItems';\nimport MenuItemList from '../menuItems/MenuItemList';\nimport type { MenuItemProps as MenuItem } from '../menuItems/MenuItem';\n\nexport type DropdownSubmenuProps = {\n /**\n * Displayed button title.\n */\n title?: string | React.ReactNode;\n\n /**\n * Items to display in the dropdown sub menu.\n */\n items?: MenuItem[];\n\n /**\n * Disables every entry on the title list item.\n */\n disabled?: boolean;\n\n /**\n * Additional classes to be set on the dropdown-submenu element.\n */\n className?: string;\n};\n\nconst DropdownSubmenu = (props: DropdownSubmenuProps) => {\n const { title = '', items = [], disabled = false, className, ...remainingProps } = props;\n\n const classes = classNames('dropdown-submenu', disabled && 'disabled', className);\n\n const [refParentPopper, setRefParentPopper] = useState<HTMLLIElement | null>(null);\n const [refDropdownSubmenu, setRefDropdownSubmenu] = useState<HTMLUListElement | null>(null);\n\n // We have to use the workaround of checking the hover state as popper may render\n // the sub menu on an odd place and fixes it's position on the next render cycle\n const [isHover, setIsHover] = useState(false);\n const handleMouseEnter = () => setIsHover(true);\n const handleMouseLeave = () => setIsHover(false);\n\n const { styles, attributes } = usePopper(refParentPopper, refDropdownSubmenu, {\n placement: 'right-start',\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [-4, 0],\n },\n },\n ],\n });\n\n // return a list item that is also automatically the new toggle for the submenu\n return (\n <li\n ref={setRefParentPopper}\n {...remainingProps}\n className={classes}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {/* biome-ignore lint/a11y/useValidAnchor: <explanation> */}\n <a className='submenu-title' role='menuitem'>\n <span className='submenu-title-text'>{title}</span>\n <span className='rioglyph rioglyph-chevron-right' />\n </a>\n {/* The actual submenu items */}\n {isHover && !disabled && (\n <MenuItemList ref={setRefDropdownSubmenu} style={styles.popper} {...attributes.popper}>\n <MenuItems items={items} />\n </MenuItemList>\n )}\n </li>\n );\n};\n\nexport default DropdownSubmenu;\n"],"names":["DropdownSubmenu","props","title","items","disabled","className","remainingProps","classes","classNames","refParentPopper","setRefParentPopper","useState","refDropdownSubmenu","setRefDropdownSubmenu","isHover","setIsHover","handleMouseEnter","handleMouseLeave","styles","attributes","usePopper","jsxs","jsx","MenuItemList","MenuItems"],"mappings":";;;;;;AA+BA,MAAMA,IAAkB,CAACC,MAAgC;AACrD,QAAM,EAAE,OAAAC,IAAQ,IAAI,OAAAC,IAAQ,CAAA,GAAI,UAAAC,IAAW,IAAO,WAAAC,GAAW,GAAGC,EAAA,IAAmBL,GAE7EM,IAAUC,EAAW,oBAAoBJ,KAAY,YAAYC,CAAS,GAE1E,CAACI,GAAiBC,CAAkB,IAAIC,EAA+B,IAAI,GAC3E,CAACC,GAAoBC,CAAqB,IAAIF,EAAkC,IAAI,GAIpF,CAACG,GAASC,CAAU,IAAIJ,EAAS,EAAK,GACtCK,IAAmB,MAAMD,EAAW,EAAI,GACxCE,IAAmB,MAAMF,EAAW,EAAK,GAEzC,EAAE,QAAAG,GAAQ,YAAAC,EAAA,IAAeC,EAAUX,GAAiBG,GAAoB;AAAA,IAC1E,WAAW;AAAA,IACX,WAAW;AAAA,MACP;AAAA,QACI,MAAM;AAAA,QACN,SAAS;AAAA,UACL,QAAQ,CAAC,IAAI,CAAC;AAAA,QAAA;AAAA,MAClB;AAAA,IACJ;AAAA,EACJ,CACH;AAGD,SACI,gBAAAS;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,KAAKX;AAAA,MACJ,GAAGJ;AAAA,MACJ,WAAWC;AAAA,MACX,cAAcS;AAAA,MACd,cAAcC;AAAA,MAGd,UAAA;AAAA,QAAA,gBAAAI,EAAC,KAAA,EAAE,WAAU,iBAAgB,MAAK,YAC9B,UAAA;AAAA,UAAA,gBAAAC,EAAC,QAAA,EAAK,WAAU,sBAAsB,UAAApB,GAAM;AAAA,UAC5C,gBAAAoB,EAAC,QAAA,EAAK,WAAU,kCAAA,CAAkC;AAAA,QAAA,GACtD;AAAA,QAECR,KAAW,CAACV,KACT,gBAAAkB,EAACC,GAAA,EAAa,KAAKV,GAAuB,OAAOK,EAAO,QAAS,GAAGC,EAAW,QAC3E,UAAA,gBAAAG,EAACE,GAAA,EAAU,OAAArB,GAAc,EAAA,CAC7B;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIhB;"}
1
+ {"version":3,"file":"DropdownSubmenu.js","sources":["../../../src/components/dropdown/DropdownSubmenu.tsx"],"sourcesContent":["import type React from 'react';\nimport { useState } from 'react';\nimport classNames from 'classnames';\nimport { usePopper } from 'react-popper';\n\nimport MenuItems from '../menuItems/MenuItems';\nimport MenuItemList from '../menuItems/MenuItemList';\nimport type { MenuItemProps as MenuItem } from '../menuItems/MenuItem';\n\nexport type DropdownSubmenuProps = {\n /**\n * Displayed button title.\n *\n * @default ''\n */\n title?: string | React.ReactNode;\n\n /**\n * Items to display in the dropdown sub menu.\n */\n items?: MenuItem[];\n\n /**\n * Disables every entry on the title list item.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Additional classes to be set on the dropdown-submenu element.\n */\n className?: string;\n};\n\nconst DropdownSubmenu = (props: DropdownSubmenuProps) => {\n const { title = '', items = [], disabled = false, className, ...remainingProps } = props;\n\n const classes = classNames('dropdown-submenu', disabled && 'disabled', className);\n\n const [refParentPopper, setRefParentPopper] = useState<HTMLLIElement | null>(null);\n const [refDropdownSubmenu, setRefDropdownSubmenu] = useState<HTMLUListElement | null>(null);\n\n // We have to use the workaround of checking the hover state as popper may render\n // the sub menu on an odd place and fixes it's position on the next render cycle\n const [isHover, setIsHover] = useState(false);\n const handleMouseEnter = () => setIsHover(true);\n const handleMouseLeave = () => setIsHover(false);\n\n const { styles, attributes } = usePopper(refParentPopper, refDropdownSubmenu, {\n placement: 'right-start',\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [-4, 0],\n },\n },\n ],\n });\n\n // return a list item that is also automatically the new toggle for the submenu\n return (\n <li\n ref={setRefParentPopper}\n {...remainingProps}\n className={classes}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {/* biome-ignore lint/a11y/useValidAnchor: <explanation> */}\n <a className='submenu-title' role='menuitem'>\n <span className='submenu-title-text'>{title}</span>\n <span className='rioglyph rioglyph-chevron-right' />\n </a>\n {/* The actual submenu items */}\n {isHover && !disabled && (\n <MenuItemList ref={setRefDropdownSubmenu} style={styles.popper} {...attributes.popper}>\n <MenuItems items={items} />\n </MenuItemList>\n )}\n </li>\n );\n};\n\nexport default DropdownSubmenu;\n"],"names":["DropdownSubmenu","props","title","items","disabled","className","remainingProps","classes","classNames","refParentPopper","setRefParentPopper","useState","refDropdownSubmenu","setRefDropdownSubmenu","isHover","setIsHover","handleMouseEnter","handleMouseLeave","styles","attributes","usePopper","jsxs","jsx","MenuItemList","MenuItems"],"mappings":";;;;;;AAmCA,MAAMA,IAAkB,CAACC,MAAgC;AACrD,QAAM,EAAE,OAAAC,IAAQ,IAAI,OAAAC,IAAQ,CAAA,GAAI,UAAAC,IAAW,IAAO,WAAAC,GAAW,GAAGC,EAAA,IAAmBL,GAE7EM,IAAUC,EAAW,oBAAoBJ,KAAY,YAAYC,CAAS,GAE1E,CAACI,GAAiBC,CAAkB,IAAIC,EAA+B,IAAI,GAC3E,CAACC,GAAoBC,CAAqB,IAAIF,EAAkC,IAAI,GAIpF,CAACG,GAASC,CAAU,IAAIJ,EAAS,EAAK,GACtCK,IAAmB,MAAMD,EAAW,EAAI,GACxCE,IAAmB,MAAMF,EAAW,EAAK,GAEzC,EAAE,QAAAG,GAAQ,YAAAC,EAAA,IAAeC,EAAUX,GAAiBG,GAAoB;AAAA,IAC1E,WAAW;AAAA,IACX,WAAW;AAAA,MACP;AAAA,QACI,MAAM;AAAA,QACN,SAAS;AAAA,UACL,QAAQ,CAAC,IAAI,CAAC;AAAA,QAAA;AAAA,MAClB;AAAA,IACJ;AAAA,EACJ,CACH;AAGD,SACI,gBAAAS;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,KAAKX;AAAA,MACJ,GAAGJ;AAAA,MACJ,WAAWC;AAAA,MACX,cAAcS;AAAA,MACd,cAAcC;AAAA,MAGd,UAAA;AAAA,QAAA,gBAAAI,EAAC,KAAA,EAAE,WAAU,iBAAgB,MAAK,YAC9B,UAAA;AAAA,UAAA,gBAAAC,EAAC,QAAA,EAAK,WAAU,sBAAsB,UAAApB,GAAM;AAAA,UAC5C,gBAAAoB,EAAC,QAAA,EAAK,WAAU,kCAAA,CAAkC;AAAA,QAAA,GACtD;AAAA,QAECR,KAAW,CAACV,KACT,gBAAAkB,EAACC,GAAA,EAAa,KAAKV,GAAuB,OAAOK,EAAO,QAAS,GAAGC,EAAW,QAC3E,UAAA,gBAAAG,EAACE,GAAA,EAAU,OAAArB,GAAc,EAAA,CAC7B;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIhB;"}
@@ -2,11 +2,13 @@ import { default as React, PropsWithChildren } from 'react';
2
2
  export type EditableContentProps = {
3
3
  /**
4
4
  * Visibility flag used to control edit mode from outside.
5
+ *
5
6
  * @default undefined
6
7
  */
7
8
  show?: boolean;
8
9
  /**
9
10
  * Callback function triggered when the save button is clicked.
11
+ *
10
12
  * @param value
11
13
  * @returns
12
14
  */
@@ -50,23 +52,27 @@ export type EditableContentProps = {
50
52
  /**
51
53
  * Offset value to control the vertical position for the editor in case the text element has
52
54
  * borders, spacings different text sizes.
55
+ *
53
56
  * @default 0
54
57
  */
55
58
  editorOffsetTop?: number;
56
59
  /**
57
60
  * Offset value to control the horizontal position for the editor in case the text element has
58
61
  * borders, spacings different text sizes.
62
+ *
59
63
  * @default 0
60
64
  */
61
65
  editorOffsetLeft?: number;
62
66
  /**
63
67
  * Defines the input and button size. Use 'lg' for headlines.
68
+ *
64
69
  * @default 'md'
65
70
  */
66
71
  size?: 'md' | 'lg';
67
72
  /**
68
73
  * Defines if the internal textarea is allowed to resize vertically.
69
74
  * This comes in handy for larger text and when using multiple input rows.
75
+ *
70
76
  * @default false
71
77
  */
72
78
  allowResize?: boolean;