@rio-cloud/rio-uikit 0.16.4-beta.21 → 0.16.4-beta.23
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.
- package/AssetTree.d.ts +2 -5
- package/AssetTree.js +2 -2
- package/ButtonDropdown.d.ts +2 -5
- package/ButtonDropdown.js +2 -2
- package/DropdownSubmenu.d.ts +2 -5
- package/DropdownSubmenu.js +2 -2
- package/MenuItem.d.ts +2 -5
- package/MenuItem.js +2 -2
- package/MenuItemList.d.ts +2 -0
- package/MenuItemList.js +2 -0
- package/MenuItems.d.ts +2 -0
- package/MenuItems.js +2 -0
- package/Page.d.ts +2 -0
- package/Page.js +2 -0
- package/Sidebar.d.ts +1 -0
- package/Sidebar.js +1 -0
- package/SimpleButtonDropdown.d.ts +2 -5
- package/SimpleButtonDropdown.js +2 -2
- package/SingleButtonDropdown.d.ts +2 -5
- package/SingleButtonDropdown.js +2 -2
- package/SplitButtonDropdown.d.ts +2 -5
- package/SplitButtonDropdown.js +2 -2
- package/Tree.d.ts +2 -5
- package/Tree.js +2 -2
- package/TreeCategory.d.ts +2 -5
- package/TreeCategory.js +2 -2
- package/TreeOption.d.ts +2 -5
- package/TreeOption.js +2 -2
- package/TreeSearch.d.ts +2 -5
- package/TreeSearch.js +2 -2
- package/TreeSummary.d.ts +2 -5
- package/TreeSummary.js +2 -2
- package/TreeSummaryRow.d.ts +2 -0
- package/TreeSummaryRow.js +2 -0
- package/TypeCounter.d.ts +2 -5
- package/TypeCounter.js +2 -2
- package/components/assetTree/AssetTree.d.ts +84 -2
- package/components/assetTree/AssetTree.js +41 -61
- package/components/assetTree/Tree.d.ts +195 -2
- package/components/assetTree/Tree.js +70 -256
- package/components/assetTree/TreeCategory.d.ts +24 -11
- package/components/assetTree/TreeCategory.js +1 -8
- package/components/assetTree/TreeLeaf.d.ts +1 -1
- package/components/assetTree/TreeLeaf.js +3 -2
- package/components/assetTree/TreeLeafList.d.ts +3 -3
- package/components/assetTree/TreeLeafList.js +4 -3
- package/components/assetTree/TreeNode.d.ts +12 -2
- package/components/assetTree/TreeNode.js +2 -17
- package/components/assetTree/TreeNodeContainer.d.ts +10 -12
- package/components/assetTree/TreeNodeContainer.js +9 -8
- package/components/assetTree/TreeNothingFound.d.ts +3 -2
- package/components/assetTree/TreeNothingFound.js +1 -7
- package/components/assetTree/TreeOption.d.ts +27 -17
- package/components/assetTree/TreeOption.js +5 -14
- package/components/assetTree/TreeOptions.d.ts +9 -13
- package/components/assetTree/TreeOptions.js +4 -11
- package/components/assetTree/TreeRoot.d.ts +9 -11
- package/components/assetTree/TreeRoot.js +8 -8
- package/components/assetTree/TreeSearch.d.ts +23 -2
- package/components/assetTree/TreeSearch.js +4 -12
- package/components/assetTree/TreeSelectAll.d.ts +14 -26
- package/components/assetTree/TreeSelectAll.js +7 -22
- package/components/assetTree/TreeSidebar.d.ts +10 -2
- package/components/assetTree/TreeSidebar.js +4 -35
- package/components/assetTree/TreeSidebarCategories.d.ts +11 -0
- package/components/assetTree/TreeSidebarCategories.js +34 -0
- package/components/assetTree/TreeSummary.d.ts +44 -2
- package/components/assetTree/TreeSummary.js +6 -19
- package/components/assetTree/TreeSummaryRow.d.ts +15 -0
- package/components/assetTree/TreeSummaryRow.js +6 -0
- package/components/assetTree/TypeCounter.d.ts +45 -2
- package/components/assetTree/TypeCounter.js +14 -23
- package/components/assetTree/treeReducer.d.ts +47 -0
- package/components/assetTree/treeReducer.js +34 -0
- package/components/assetTree/treeUtils.d.ts +20 -0
- package/components/assetTree/treeUtils.js +88 -0
- package/components/autosuggest/AutoSuggest.d.ts +19 -2
- package/components/autosuggest/AutoSuggest.js +10 -7
- package/components/button/Button.d.ts +25 -20
- package/components/button/Button.js +7 -7
- package/components/button/ToggleButton.d.ts +5 -1
- package/components/button/ToggleButton.js +1 -0
- package/components/clearableInput/ClearableInput.d.ts +6 -0
- package/components/clearableInput/ClearableInput.js +6 -5
- package/components/datepicker/DatePicker.d.ts +9 -9
- package/components/datepicker/DatePicker.js +4 -2
- package/components/dialog/Dialog.d.ts +5 -2
- package/components/dialog/Dialog.js +41 -6
- package/components/dialog/DialogBody.d.ts +3 -0
- package/components/dialog/DialogFooter.d.ts +3 -1
- package/components/dialog/DialogFooter.js +5 -2
- package/components/dialog/DialogHeader.d.ts +9 -3
- package/components/dialog/DialogHeader.js +9 -5
- package/components/dialog/SplitDialog.d.ts +8 -0
- package/components/dialog/SplitDialog.js +1 -1
- package/components/dialog/dialogContext.d.ts +10 -0
- package/components/dialog/dialogContext.js +17 -0
- package/components/dropdown/ButtonDropdown.d.ts +120 -65
- package/components/dropdown/ButtonDropdown.js +14 -60
- package/components/dropdown/Caret.d.ts +1 -1
- package/components/dropdown/Caret.js +2 -1
- package/components/dropdown/DropdownSubmenu.d.ts +21 -18
- package/components/dropdown/DropdownSubmenu.js +26 -19
- package/components/dropdown/DropdownToggleButton.d.ts +13 -2
- package/components/dropdown/DropdownToggleButton.js +6 -14
- package/components/dropdown/SimpleButtonDropdown.d.ts +3 -1
- package/components/dropdown/SimpleButtonDropdown.js +3 -2
- package/components/dropdown/SingleButtonDropdown.d.ts +3 -1
- package/components/dropdown/SingleButtonDropdown.js +3 -2
- package/components/dropdown/SplitButtonDropdown.d.ts +3 -1
- package/components/dropdown/SplitButtonDropdown.js +3 -2
- package/components/dropdown/SplitCaretButton.d.ts +11 -2
- package/components/dropdown/SplitCaretButton.js +6 -11
- package/components/map/exceptions/MapException.d.ts +2 -6
- package/components/map/exceptions/MapException.js +8 -6
- package/components/menuItems/MenuItem.d.ts +16 -0
- package/components/menuItems/MenuItem.js +1 -0
- package/components/menuItems/MenuItemList.d.ts +7 -0
- package/components/menuItems/MenuItemList.js +10 -0
- package/components/menuItems/MenuItems.d.ts +7 -2
- package/components/menuItems/MenuItems.js +10 -9
- package/components/numberInput/NumberInput.js +1 -1
- package/components/page/Page.d.ts +32 -0
- package/components/page/Page.js +18 -0
- package/components/tag/Tag.d.ts +2 -2
- package/components/timepicker/TimePicker.js +2 -1
- package/hooks/useClickOutside.d.ts +4 -1
- package/hooks/useClickOutside.js +7 -6
- package/hooks/useClipboard.d.ts +6 -5
- package/hooks/useClipboard.js +13 -7
- package/hooks/usePrevious.d.ts +1 -1
- package/hooks/usePrevious.js +6 -7
- package/index.d.ts +36 -28
- package/index.js +36 -28
- package/lib/es/AssetTree.d.ts +2 -5
- package/lib/es/AssetTree.js +3 -2
- package/lib/es/ButtonDropdown.d.ts +2 -5
- package/lib/es/ButtonDropdown.js +3 -2
- package/lib/es/DropdownSubmenu.d.ts +2 -5
- package/lib/es/DropdownSubmenu.js +3 -2
- package/lib/es/MenuItem.d.ts +2 -5
- package/lib/es/MenuItem.js +3 -2
- package/lib/es/MenuItemList.d.ts +2 -0
- package/lib/es/MenuItemList.js +7 -0
- package/lib/es/MenuItems.d.ts +2 -0
- package/lib/es/MenuItems.js +7 -0
- package/lib/es/Page.d.ts +2 -0
- package/lib/es/Page.js +7 -0
- package/lib/es/Sidebar.d.ts +1 -0
- package/lib/es/Sidebar.js +3 -4
- package/lib/es/SimpleButtonDropdown.d.ts +2 -5
- package/lib/es/SimpleButtonDropdown.js +3 -2
- package/lib/es/SingleButtonDropdown.d.ts +2 -5
- package/lib/es/SingleButtonDropdown.js +3 -2
- package/lib/es/SplitButtonDropdown.d.ts +2 -5
- package/lib/es/SplitButtonDropdown.js +3 -2
- package/lib/es/Tree.d.ts +2 -5
- package/lib/es/Tree.js +3 -2
- package/lib/es/TreeCategory.d.ts +2 -5
- package/lib/es/TreeCategory.js +3 -2
- package/lib/es/TreeOption.d.ts +2 -5
- package/lib/es/TreeOption.js +3 -2
- package/lib/es/TreeSearch.d.ts +2 -5
- package/lib/es/TreeSearch.js +3 -2
- package/lib/es/TreeSummary.d.ts +2 -5
- package/lib/es/TreeSummary.js +3 -2
- package/lib/es/TreeSummaryRow.d.ts +2 -0
- package/lib/es/TreeSummaryRow.js +7 -0
- package/lib/es/TypeCounter.d.ts +2 -5
- package/lib/es/TypeCounter.js +3 -2
- package/lib/es/components/assetTree/AssetTree.d.ts +84 -2
- package/lib/es/components/assetTree/AssetTree.js +40 -60
- package/lib/es/components/assetTree/Tree.d.ts +195 -2
- package/lib/es/components/assetTree/Tree.js +103 -286
- package/lib/es/components/assetTree/TreeCategory.d.ts +24 -11
- package/lib/es/components/assetTree/TreeCategory.js +1 -9
- package/lib/es/components/assetTree/TreeLeaf.d.ts +1 -1
- package/lib/es/components/assetTree/TreeLeaf.js +2 -1
- package/lib/es/components/assetTree/TreeLeafList.d.ts +3 -3
- package/lib/es/components/assetTree/TreeLeafList.js +4 -3
- package/lib/es/components/assetTree/TreeNode.d.ts +12 -2
- package/lib/es/components/assetTree/TreeNode.js +2 -17
- package/lib/es/components/assetTree/TreeNodeContainer.d.ts +10 -12
- package/lib/es/components/assetTree/TreeNodeContainer.js +9 -8
- package/lib/es/components/assetTree/TreeNothingFound.d.ts +3 -2
- package/lib/es/components/assetTree/TreeNothingFound.js +1 -7
- package/lib/es/components/assetTree/TreeOption.d.ts +27 -17
- package/lib/es/components/assetTree/TreeOption.js +5 -14
- package/lib/es/components/assetTree/TreeOptions.d.ts +9 -13
- package/lib/es/components/assetTree/TreeOptions.js +4 -11
- package/lib/es/components/assetTree/TreeRoot.d.ts +9 -11
- package/lib/es/components/assetTree/TreeRoot.js +8 -8
- package/lib/es/components/assetTree/TreeSearch.d.ts +23 -2
- package/lib/es/components/assetTree/TreeSearch.js +4 -12
- package/lib/es/components/assetTree/TreeSelectAll.d.ts +14 -26
- package/lib/es/components/assetTree/TreeSelectAll.js +7 -22
- package/lib/es/components/assetTree/TreeSidebar.d.ts +10 -2
- package/lib/es/components/assetTree/TreeSidebar.js +5 -36
- package/lib/es/components/assetTree/TreeSidebarCategories.d.ts +11 -0
- package/lib/es/components/assetTree/TreeSidebarCategories.js +37 -0
- package/lib/es/components/assetTree/TreeSummary.d.ts +44 -2
- package/lib/es/components/assetTree/TreeSummary.js +6 -19
- package/lib/es/components/assetTree/TreeSummaryRow.d.ts +15 -0
- package/lib/es/components/assetTree/TreeSummaryRow.js +10 -0
- package/lib/es/components/assetTree/TypeCounter.d.ts +45 -2
- package/lib/es/components/assetTree/TypeCounter.js +14 -23
- package/lib/es/components/assetTree/autoAnimateFrames.d.ts +1 -0
- package/lib/es/components/assetTree/autoAnimateFrames.js +55 -0
- package/lib/es/components/assetTree/treeReducer.d.ts +47 -0
- package/lib/es/components/assetTree/treeReducer.js +47 -0
- package/lib/es/components/assetTree/treeUtils.d.ts +20 -0
- package/lib/es/components/assetTree/treeUtils.js +106 -0
- package/lib/es/components/autosuggest/AutoSuggest.d.ts +19 -2
- package/lib/es/components/autosuggest/AutoSuggest.js +10 -7
- package/lib/es/components/button/Button.d.ts +25 -20
- package/lib/es/components/button/Button.js +12 -11
- package/lib/es/components/button/ToggleButton.d.ts +5 -1
- package/lib/es/components/button/ToggleButton.js +1 -0
- package/lib/es/components/clearableInput/ClearableInput.d.ts +6 -0
- package/lib/es/components/clearableInput/ClearableInput.js +6 -5
- package/lib/es/components/datepicker/DatePicker.d.ts +9 -9
- package/lib/es/components/datepicker/DatePicker.js +4 -2
- package/lib/es/components/dialog/Dialog.d.ts +5 -2
- package/lib/es/components/dialog/Dialog.js +40 -5
- package/lib/es/components/dialog/DialogBody.d.ts +3 -0
- package/lib/es/components/dialog/DialogFooter.d.ts +3 -1
- package/lib/es/components/dialog/DialogFooter.js +5 -2
- package/lib/es/components/dialog/DialogHeader.d.ts +9 -3
- package/lib/es/components/dialog/DialogHeader.js +9 -5
- package/lib/es/components/dialog/SplitDialog.d.ts +8 -0
- package/lib/es/components/dialog/SplitDialog.js +1 -1
- package/lib/es/components/dialog/dialogContext.d.ts +10 -0
- package/lib/es/components/dialog/dialogContext.js +22 -0
- package/lib/es/components/dropdown/ButtonDropdown.d.ts +120 -65
- package/lib/es/components/dropdown/ButtonDropdown.js +13 -59
- package/lib/es/components/dropdown/Caret.d.ts +1 -1
- package/lib/es/components/dropdown/Caret.js +2 -2
- package/lib/es/components/dropdown/DropdownSubmenu.d.ts +21 -18
- package/lib/es/components/dropdown/DropdownSubmenu.js +26 -19
- package/lib/es/components/dropdown/DropdownToggleButton.d.ts +13 -2
- package/lib/es/components/dropdown/DropdownToggleButton.js +6 -14
- package/lib/es/components/dropdown/SimpleButtonDropdown.d.ts +3 -1
- package/lib/es/components/dropdown/SimpleButtonDropdown.js +3 -2
- package/lib/es/components/dropdown/SingleButtonDropdown.d.ts +3 -1
- package/lib/es/components/dropdown/SingleButtonDropdown.js +3 -2
- package/lib/es/components/dropdown/SplitButtonDropdown.d.ts +3 -1
- package/lib/es/components/dropdown/SplitButtonDropdown.js +3 -2
- package/lib/es/components/dropdown/SplitCaretButton.d.ts +11 -2
- package/lib/es/components/dropdown/SplitCaretButton.js +6 -11
- package/lib/es/components/map/exceptions/MapException.d.ts +2 -6
- package/lib/es/components/map/exceptions/MapException.js +7 -6
- package/lib/es/components/menuItems/MenuItem.d.ts +16 -0
- package/lib/es/components/menuItems/MenuItem.js +1 -0
- package/lib/es/components/menuItems/MenuItemList.d.ts +7 -0
- package/lib/es/components/menuItems/MenuItemList.js +12 -0
- package/lib/es/components/menuItems/MenuItems.d.ts +7 -2
- package/lib/es/components/menuItems/MenuItems.js +9 -7
- package/lib/es/components/numberInput/NumberInput.js +1 -1
- package/lib/es/components/page/Page.d.ts +32 -0
- package/lib/es/components/page/Page.js +21 -0
- package/lib/es/components/tag/Tag.d.ts +2 -2
- package/lib/es/components/timepicker/TimePicker.js +2 -1
- package/lib/es/hooks/useClickOutside.d.ts +4 -1
- package/lib/es/hooks/useClickOutside.js +6 -6
- package/lib/es/hooks/useClipboard.d.ts +6 -5
- package/lib/es/hooks/useClipboard.js +12 -7
- package/lib/es/hooks/usePrevious.d.ts +1 -1
- package/lib/es/hooks/usePrevious.js +5 -6
- package/lib/es/index.d.ts +36 -28
- package/lib/es/index.js +59 -34
- package/lib/es/types.d.ts +1 -149
- package/lib/es/useClickOutside.d.ts +2 -4
- package/lib/es/useClickOutside.js +3 -2
- package/lib/es/useClipboard.d.ts +1 -4
- package/lib/es/useClipboard.js +5 -3
- package/lib/es/utils/SortUtils.d.ts +1 -0
- package/lib/es/utils/colorScheme.d.ts +1 -1
- package/lib/es/utils/darkModeCDN.d.ts +1 -1
- package/lib/es/utils/init.js +1 -0
- package/lib/es/utils/mergeRefs.d.ts +3 -0
- package/lib/es/utils/mergeRefs.js +18 -0
- package/lib/es/utils/searchNormalized.d.ts +2 -2
- package/lib/es/utils/searchNormalized.js +1 -1
- package/lib/es/version.json +1 -1
- package/package.json +40 -37
- package/types.d.ts +1 -149
- package/useClickOutside.d.ts +2 -4
- package/useClickOutside.js +2 -2
- package/useClipboard.d.ts +1 -4
- package/useClipboard.js +1 -2
- package/utils/SortUtils.d.ts +1 -0
- package/utils/colorScheme.d.ts +1 -1
- package/utils/darkModeCDN.d.ts +1 -1
- package/utils/init.js +1 -0
- package/utils/mergeRefs.d.ts +3 -0
- package/utils/mergeRefs.js +16 -0
- package/utils/searchNormalized.d.ts +2 -2
- package/utils/searchNormalized.js +1 -1
- package/version.json +1 -1
|
@@ -1,66 +1,121 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MenuItemProps as MenuItem } from '../menuItems/MenuItem';
|
|
3
|
+
import type { BUTTON_SIZE, BUTTON_STYLE, BUTTON_VARIANT } from '../button/Button';
|
|
4
|
+
export type ButtonDropdownProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Unique button id. If not present a random id is generated.
|
|
7
|
+
*/
|
|
8
|
+
id?: string;
|
|
9
|
+
/**
|
|
10
|
+
* The button title. This may be also a node, like a <span> or a <FormattedMessage>.
|
|
11
|
+
*/
|
|
12
|
+
title: string | React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Defined weather or not the menu is rendered.
|
|
15
|
+
* Use this to control the component from the outside.
|
|
16
|
+
*
|
|
17
|
+
* @default undefined
|
|
18
|
+
*/
|
|
19
|
+
open?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Defines whether the dropdown opens above or below.
|
|
22
|
+
* Set it to "true" additionally disables the automatic position feature.
|
|
23
|
+
*
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
dropup?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Defines whether the dropdown opens right aligned to the dropdown or not.
|
|
29
|
+
*/
|
|
30
|
+
pullRight?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Defines how large the button will be rendered.
|
|
33
|
+
*
|
|
34
|
+
* Possible values are: `xs`, `sm`, `md`, `lg`
|
|
35
|
+
*/
|
|
36
|
+
bsSize?: BUTTON_SIZE;
|
|
37
|
+
/**
|
|
38
|
+
* Defines the button color.
|
|
39
|
+
*
|
|
40
|
+
* Possible values are: `default`, `primary`, `secondary`, `info`, `warning`, `danger`, `success`, `muted`
|
|
41
|
+
*/
|
|
42
|
+
bsStyle?: BUTTON_STYLE;
|
|
43
|
+
/**
|
|
44
|
+
* Defines the variation of the button design.
|
|
45
|
+
*
|
|
46
|
+
* Possible values are: `link`, `link-inline`, `outline`, `action`
|
|
47
|
+
*/
|
|
48
|
+
variant?: BUTTON_VARIANT;
|
|
49
|
+
/**
|
|
50
|
+
* Optional prop to defines whether the dropdown title is icon only which
|
|
51
|
+
* applies different padding so the button is a square.
|
|
52
|
+
*
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
iconOnly?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Defines whether the caret is shown or not.
|
|
58
|
+
*
|
|
59
|
+
* @default false
|
|
60
|
+
*/
|
|
61
|
+
noCaret?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Defines whether the dropdown-toggle (with caret) should be in a separate button.
|
|
64
|
+
*
|
|
65
|
+
* @default false
|
|
66
|
+
*/
|
|
67
|
+
splitButton?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Renders the dropdown into a dedicated react portal
|
|
70
|
+
*
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
usePortal?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Items to display in the dropdown menu. If you use a custom dropdown you can skip this prop.
|
|
76
|
+
*/
|
|
77
|
+
items?: MenuItem[];
|
|
78
|
+
/**
|
|
79
|
+
* Disables the dropdown button.
|
|
80
|
+
*
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
disabled?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Callback for splitButton label button click.
|
|
86
|
+
*/
|
|
87
|
+
onLabelButtonClick?: () => void;
|
|
88
|
+
/**
|
|
89
|
+
* Callback for when the toggle button was clicked to open it.
|
|
90
|
+
* @param event
|
|
91
|
+
* @returns
|
|
92
|
+
*/
|
|
93
|
+
onOpen?: (event?: React.MouseEvent<HTMLButtonElement>) => void;
|
|
94
|
+
/**
|
|
95
|
+
* Callback for when the toggle button was clicked to close it.
|
|
96
|
+
* @returns
|
|
97
|
+
*/
|
|
98
|
+
onClose?: () => void;
|
|
99
|
+
/**
|
|
100
|
+
* Allows to pass in custom dropdown menu content.
|
|
101
|
+
*/
|
|
102
|
+
customDropdown?: React.ReactNode;
|
|
103
|
+
/**
|
|
104
|
+
* Define custom popper.js configuration for dropdown placement and modifiers.
|
|
105
|
+
*/
|
|
106
|
+
popperConfig?: object;
|
|
107
|
+
/**
|
|
108
|
+
* Additional classes to be set on the dropdown-toggle button.
|
|
109
|
+
*/
|
|
110
|
+
toggleClassName?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Additional classes to be set on the dropdown.
|
|
113
|
+
*/
|
|
114
|
+
dropdownClassName?: string;
|
|
115
|
+
/**
|
|
116
|
+
* Additional classes to be set to the wrapper element.
|
|
117
|
+
*/
|
|
118
|
+
className?: string;
|
|
119
|
+
};
|
|
120
|
+
declare const ButtonDropdown: (props: ButtonDropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
121
|
export default ButtonDropdown;
|
|
2
|
-
declare function ButtonDropdown(props: any): import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
declare namespace ButtonDropdown {
|
|
4
|
-
namespace defaultProps {
|
|
5
|
-
export const id: string;
|
|
6
|
-
export const items: never[];
|
|
7
|
-
export const iconOnly: boolean;
|
|
8
|
-
export const noCaret: boolean;
|
|
9
|
-
export const pullRight: boolean;
|
|
10
|
-
export const splitButton: boolean;
|
|
11
|
-
export const dropup: boolean;
|
|
12
|
-
export const bsStyle: string;
|
|
13
|
-
export const disabled: boolean;
|
|
14
|
-
export { noop as onOpen };
|
|
15
|
-
export { noop as onClose };
|
|
16
|
-
export { noop as onLabelButtonClick };
|
|
17
|
-
export const toggleClassName: string;
|
|
18
|
-
export const usePortal: boolean;
|
|
19
|
-
export const className: string;
|
|
20
|
-
}
|
|
21
|
-
namespace propTypes {
|
|
22
|
-
const id_1: PropTypes.Requireable<string>;
|
|
23
|
-
export { id_1 as id };
|
|
24
|
-
export const title: PropTypes.Validator<NonNullable<NonNullable<PropTypes.ReactNodeLike>>>;
|
|
25
|
-
export const open: PropTypes.Requireable<boolean>;
|
|
26
|
-
const dropup_1: PropTypes.Requireable<boolean>;
|
|
27
|
-
export { dropup_1 as dropup };
|
|
28
|
-
const pullRight_1: PropTypes.Requireable<boolean>;
|
|
29
|
-
export { pullRight_1 as pullRight };
|
|
30
|
-
export const bsSize: PropTypes.Requireable<string>;
|
|
31
|
-
const bsStyle_1: PropTypes.Requireable<string>;
|
|
32
|
-
export { bsStyle_1 as bsStyle };
|
|
33
|
-
const iconOnly_1: PropTypes.Requireable<boolean>;
|
|
34
|
-
export { iconOnly_1 as iconOnly };
|
|
35
|
-
const noCaret_1: PropTypes.Requireable<boolean>;
|
|
36
|
-
export { noCaret_1 as noCaret };
|
|
37
|
-
const splitButton_1: PropTypes.Requireable<boolean>;
|
|
38
|
-
export { splitButton_1 as splitButton };
|
|
39
|
-
const usePortal_1: PropTypes.Requireable<boolean>;
|
|
40
|
-
export { usePortal_1 as usePortal };
|
|
41
|
-
const items_1: PropTypes.Validator<(PropTypes.InferProps<{
|
|
42
|
-
value: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
43
|
-
disabled: PropTypes.Requireable<boolean>;
|
|
44
|
-
divider: PropTypes.Requireable<boolean>;
|
|
45
|
-
header: PropTypes.Requireable<boolean>;
|
|
46
|
-
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
47
|
-
}> | null | undefined)[]>;
|
|
48
|
-
export { items_1 as items };
|
|
49
|
-
const disabled_1: PropTypes.Requireable<boolean>;
|
|
50
|
-
export { disabled_1 as disabled };
|
|
51
|
-
const className_1: PropTypes.Requireable<string>;
|
|
52
|
-
export { className_1 as className };
|
|
53
|
-
export const dropdownClassName: PropTypes.Requireable<string>;
|
|
54
|
-
const toggleClassName_1: PropTypes.Requireable<string>;
|
|
55
|
-
export { toggleClassName_1 as toggleClassName };
|
|
56
|
-
export const onLabelButtonClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
57
|
-
export const customDropdown: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
58
|
-
export const popperConfig: PropTypes.Requireable<object>;
|
|
59
|
-
export const enableOnClickOutside: PropTypes.Requireable<(...args: any[]) => any>;
|
|
60
|
-
export const disableOnClickOutside: PropTypes.Requireable<(...args: any[]) => any>;
|
|
61
|
-
export const onOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
62
|
-
export const onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
import noop from "lodash/fp/noop";
|
|
66
|
-
import PropTypes from "prop-types";
|
|
@@ -2,19 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 =
|
|
5
|
+
const react_1 = require("react");
|
|
6
6
|
const react_dom_1 = tslib_1.__importDefault(require("react-dom"));
|
|
7
|
-
const prop_types_1 = tslib_1.__importDefault(require("prop-types"));
|
|
8
7
|
const react_popper_1 = require("react-popper");
|
|
9
8
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
10
9
|
const isNil_1 = tslib_1.__importDefault(require("lodash/fp/isNil"));
|
|
11
10
|
const noop_1 = tslib_1.__importDefault(require("lodash/fp/noop"));
|
|
12
|
-
const logDeprecatedWarnings_1 = tslib_1.__importDefault(require("../../utils/logDeprecatedWarnings"));
|
|
13
11
|
const portalRoot_1 = require("../../utils/portalRoot");
|
|
14
12
|
const useClickOutside_1 = tslib_1.__importDefault(require("../../hooks/useClickOutside"));
|
|
15
|
-
const getMenuItems_1 = tslib_1.__importDefault(require("../menuItems/getMenuItems"));
|
|
16
13
|
const MenuItems_1 = tslib_1.__importDefault(require("../menuItems/MenuItems"));
|
|
17
|
-
const
|
|
14
|
+
const MenuItemList_1 = tslib_1.__importDefault(require("../menuItems/MenuItemList"));
|
|
18
15
|
const DropdownToggleButton_1 = tslib_1.__importDefault(require("./DropdownToggleButton"));
|
|
19
16
|
const SplitCaretButton_1 = tslib_1.__importDefault(require("./SplitCaretButton"));
|
|
20
17
|
const Caret_1 = tslib_1.__importDefault(require("./Caret"));
|
|
@@ -30,12 +27,12 @@ const getPlacement = (pullRight, dropup) => {
|
|
|
30
27
|
}
|
|
31
28
|
return 'bottom-start';
|
|
32
29
|
};
|
|
33
|
-
const ButtonDropdown = props => {
|
|
34
|
-
const { id, items, bsSize, bsStyle, disabled, iconOnly, title, splitButton
|
|
30
|
+
const ButtonDropdown = (props) => {
|
|
31
|
+
const { id = Math.random().toString(36).substr(2, 16), items = [], bsSize = 'md', bsStyle = 'default', disabled = false, iconOnly = false, title, splitButton = false, customDropdown, open, dropup = false, pullRight = false, noCaret = false, onOpen = noop_1.default, onClose = noop_1.default, onLabelButtonClick = noop_1.default, usePortal = false, popperConfig, toggleClassName = '', dropdownClassName, className = '' } = props, remainingProps = tslib_1.__rest(props, ["id", "items", "bsSize", "bsStyle", "disabled", "iconOnly", "title", "splitButton", "customDropdown", "open", "dropup", "pullRight", "noCaret", "onOpen", "onClose", "onLabelButtonClick", "usePortal", "popperConfig", "toggleClassName", "dropdownClassName", "className"]);
|
|
35
32
|
const [internalOpen, setInternalOpen] = (0, react_1.useState)(open);
|
|
36
|
-
const [refDropdownToggle, setRefDropdownToggle] = react_1.
|
|
37
|
-
const [refDropdownMenu, setRefDropdownMenu] = react_1.
|
|
38
|
-
const [refSplitButtonToggle, setRefSplitButtonToggle] = react_1.
|
|
33
|
+
const [refDropdownToggle, setRefDropdownToggle] = (0, react_1.useState)(null);
|
|
34
|
+
const [refDropdownMenu, setRefDropdownMenu] = (0, react_1.useState)(null);
|
|
35
|
+
const [refSplitButtonToggle, setRefSplitButtonToggle] = (0, react_1.useState)(null);
|
|
39
36
|
const defaultPopperConfig = {
|
|
40
37
|
placement: getPlacement(pullRight, dropup),
|
|
41
38
|
modifiers: [],
|
|
@@ -48,20 +45,19 @@ const ButtonDropdown = props => {
|
|
|
48
45
|
const shouldShowCaret = !noCaret && !splitButton && !iconOnly;
|
|
49
46
|
(0, react_1.useEffect)(() => {
|
|
50
47
|
if (!isUncontrolled) {
|
|
51
|
-
// console.log('update open from outside: ' + open);
|
|
52
48
|
setInternalOpen(open);
|
|
53
49
|
}
|
|
54
50
|
}, [isUncontrolled, open]);
|
|
55
|
-
const toggleOpen = event => {
|
|
56
|
-
const
|
|
57
|
-
if (
|
|
51
|
+
const toggleOpen = (event) => {
|
|
52
|
+
const isDropdownOpen = isUncontrolled ? internalOpen : open;
|
|
53
|
+
if (isDropdownOpen) {
|
|
58
54
|
closeMenu();
|
|
59
55
|
}
|
|
60
56
|
else {
|
|
61
57
|
openMenu(event);
|
|
62
58
|
}
|
|
63
59
|
};
|
|
64
|
-
const openMenu = event => {
|
|
60
|
+
const openMenu = (event) => {
|
|
65
61
|
if (isUncontrolled) {
|
|
66
62
|
setInternalOpen(true);
|
|
67
63
|
}
|
|
@@ -81,49 +77,7 @@ const ButtonDropdown = props => {
|
|
|
81
77
|
const isOpen = isUncontrolled ? internalOpen : open;
|
|
82
78
|
const wrapperClasses = (0, classnames_1.default)('dropdown', 'btn-group', isOpen && 'open', className);
|
|
83
79
|
const dropdownClasses = (0, classnames_1.default)(usePortal && 'dropdown-portal', splitButton && pullRight && 'pull-right', dropdownClassName);
|
|
84
|
-
const dropdownMenu = ((0, jsx_runtime_1.jsx)(
|
|
85
|
-
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, remainingProps, { className: wrapperClasses, ref: wrapperRef }, { children: [(0, jsx_runtime_1.jsx)(DropdownToggleButton_1.default, Object.assign({ id: id, splitButton: splitButton, bsStyle: bsStyle, bsSize: bsSize, iconOnly: iconOnly, disabled: disabled, ref: setRefDropdownToggle, onClick: handleDropdownButtonClick, className: toggleClassName }, { children: (0, jsx_runtime_1.jsxs)(
|
|
86
|
-
};
|
|
87
|
-
ButtonDropdown.defaultProps = {
|
|
88
|
-
id: Math.random().toString(36).substr(2, 16),
|
|
89
|
-
items: [],
|
|
90
|
-
iconOnly: false,
|
|
91
|
-
noCaret: false,
|
|
92
|
-
pullRight: false,
|
|
93
|
-
splitButton: false,
|
|
94
|
-
dropup: false,
|
|
95
|
-
bsStyle: 'default',
|
|
96
|
-
disabled: false,
|
|
97
|
-
onOpen: noop_1.default,
|
|
98
|
-
onClose: noop_1.default,
|
|
99
|
-
onLabelButtonClick: noop_1.default,
|
|
100
|
-
toggleClassName: '',
|
|
101
|
-
usePortal: false,
|
|
102
|
-
className: '',
|
|
103
|
-
};
|
|
104
|
-
ButtonDropdown.propTypes = {
|
|
105
|
-
id: prop_types_1.default.string,
|
|
106
|
-
title: prop_types_1.default.oneOfType([prop_types_1.default.node, prop_types_1.default.string]).isRequired,
|
|
107
|
-
open: prop_types_1.default.bool,
|
|
108
|
-
dropup: prop_types_1.default.bool,
|
|
109
|
-
pullRight: prop_types_1.default.bool,
|
|
110
|
-
bsSize: prop_types_1.default.oneOf(['xs', 'sm', 'lg']),
|
|
111
|
-
bsStyle: prop_types_1.default.oneOf(['default', 'primary', 'info', 'warning', 'danger', 'success', 'link', 'muted']),
|
|
112
|
-
iconOnly: prop_types_1.default.bool,
|
|
113
|
-
noCaret: prop_types_1.default.bool,
|
|
114
|
-
splitButton: prop_types_1.default.bool,
|
|
115
|
-
usePortal: prop_types_1.default.bool,
|
|
116
|
-
items: menuItemsPropTypes_1.default.isRequired,
|
|
117
|
-
disabled: prop_types_1.default.bool,
|
|
118
|
-
className: prop_types_1.default.string,
|
|
119
|
-
dropdownClassName: prop_types_1.default.string,
|
|
120
|
-
toggleClassName: prop_types_1.default.string,
|
|
121
|
-
onLabelButtonClick: prop_types_1.default.func,
|
|
122
|
-
customDropdown: prop_types_1.default.node,
|
|
123
|
-
popperConfig: prop_types_1.default.object,
|
|
124
|
-
enableOnClickOutside: prop_types_1.default.func,
|
|
125
|
-
disableOnClickOutside: prop_types_1.default.func,
|
|
126
|
-
onOpen: prop_types_1.default.func,
|
|
127
|
-
onClose: prop_types_1.default.func,
|
|
80
|
+
const dropdownMenu = ((0, jsx_runtime_1.jsx)(MenuItemList_1.default, Object.assign({ className: dropdownClasses, ref: setRefDropdownMenu, style: styles.popper }, attributes.popper, { children: customDropdown ? customDropdown : (0, jsx_runtime_1.jsx)(MenuItems_1.default, { items: items, closeMenu: toggleOpen }) })));
|
|
81
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, remainingProps, { className: wrapperClasses, ref: wrapperRef }, { children: [(0, jsx_runtime_1.jsx)(DropdownToggleButton_1.default, Object.assign({ id: id, splitButton: splitButton, bsStyle: bsStyle, bsSize: bsSize, iconOnly: iconOnly, disabled: disabled, ref: setRefDropdownToggle, onClick: handleDropdownButtonClick, className: toggleClassName }, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [title, shouldShowCaret && (0, jsx_runtime_1.jsx)(Caret_1.default, {})] }) })), splitButton && ((0, jsx_runtime_1.jsx)(SplitCaretButton_1.default, { id: id, bsStyle: bsStyle, bsSize: bsSize, disabled: disabled, className: toggleClassName, onClick: toggleOpen, ref: setRefSplitButtonToggle })), isOpen && usePortal && react_dom_1.default.createPortal(dropdownMenu, dropdownRoot), isOpen && !usePortal && dropdownMenu] })));
|
|
128
82
|
};
|
|
129
83
|
exports.default = ButtonDropdown;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
|
|
4
|
+
// @ts-ignore-next-line importsNotUsedAsValues
|
|
5
|
+
require("react");
|
|
6
6
|
const Caret = () => (0, jsx_runtime_1.jsx)("span", { className: 'caret' });
|
|
7
7
|
exports.default = Caret;
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MenuItemProps as MenuItem } from '../menuItems/MenuItem';
|
|
3
|
+
export type DropdownSubmenuProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Displayed button title.
|
|
6
|
+
*/
|
|
7
|
+
title?: string | React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Items to display in the dropdown sub menu.
|
|
10
|
+
*/
|
|
11
|
+
items?: MenuItem[];
|
|
12
|
+
/**
|
|
13
|
+
* Disables every entry on the title list item.
|
|
14
|
+
*/
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Additional classes to be set on the dropdown-submenu element.
|
|
18
|
+
*/
|
|
19
|
+
className?: string;
|
|
20
|
+
};
|
|
21
|
+
declare const DropdownSubmenu: (props: DropdownSubmenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
22
|
export default DropdownSubmenu;
|
|
2
|
-
declare function DropdownSubmenu(props: any): import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
declare namespace DropdownSubmenu {
|
|
4
|
-
namespace defaultProps {
|
|
5
|
-
const title: string;
|
|
6
|
-
const items: never[];
|
|
7
|
-
const disabled: boolean;
|
|
8
|
-
}
|
|
9
|
-
namespace propTypes {
|
|
10
|
-
const title_1: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
11
|
-
export { title_1 as title };
|
|
12
|
-
export { menuItemsPropTypes as items };
|
|
13
|
-
const disabled_1: PropTypes.Requireable<boolean>;
|
|
14
|
-
export { disabled_1 as disabled };
|
|
15
|
-
export const className: PropTypes.Requireable<string>;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
import PropTypes from "prop-types";
|
|
19
|
-
import menuItemsPropTypes from "./menuItemsPropTypes";
|
|
@@ -2,26 +2,33 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 =
|
|
6
|
-
const prop_types_1 = tslib_1.__importDefault(require("prop-types"));
|
|
5
|
+
const react_1 = require("react");
|
|
7
6
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
8
|
-
const
|
|
9
|
-
const menuItemsPropTypes_1 = tslib_1.__importDefault(require("./menuItemsPropTypes"));
|
|
7
|
+
const react_popper_1 = require("react-popper");
|
|
10
8
|
const MenuItems_1 = tslib_1.__importDefault(require("../menuItems/MenuItems"));
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
const MenuItemList_1 = tslib_1.__importDefault(require("../menuItems/MenuItemList"));
|
|
10
|
+
const DropdownSubmenu = (props) => {
|
|
11
|
+
const { title = '', items = [], disabled = false, className } = props, remainingProps = tslib_1.__rest(props, ["title", "items", "disabled", "className"]);
|
|
12
|
+
const classes = (0, classnames_1.default)('dropdown-submenu', disabled && 'disabled', className);
|
|
13
|
+
const [refParentPopper, setRefParentPopper] = (0, react_1.useState)(null);
|
|
14
|
+
const [refDropdownSubmenu, setRefDropdownSubmenu] = (0, react_1.useState)(null);
|
|
15
|
+
// We have to use the workaround of checking the hover state as popper may render
|
|
16
|
+
// the sub menu on an odd place and fixes it's position on the next render cycle
|
|
17
|
+
const [isHover, setIsHover] = (0, react_1.useState)(false);
|
|
18
|
+
const handleMouseEnter = () => setIsHover(true);
|
|
19
|
+
const handleMouseLeave = () => setIsHover(false);
|
|
20
|
+
const { styles, attributes } = (0, react_popper_1.usePopper)(refParentPopper, refDropdownSubmenu, {
|
|
21
|
+
placement: 'right-start',
|
|
22
|
+
modifiers: [
|
|
23
|
+
{
|
|
24
|
+
name: 'offset',
|
|
25
|
+
options: {
|
|
26
|
+
offset: [-4, 0],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
});
|
|
31
|
+
// return a list item that is also automatically the new toggle for the submenu
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)("li", Object.assign({ ref: setRefParentPopper }, remainingProps, { className: classes, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave }, { children: [(0, jsx_runtime_1.jsxs)("a", Object.assign({ className: 'submenu-title', role: 'menuitem' }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: 'submenu-title-text' }, { children: title })), (0, jsx_runtime_1.jsx)("span", { className: 'rioglyph rioglyph-chevron-right' })] })), isHover && !disabled && ((0, jsx_runtime_1.jsx)(MenuItemList_1.default, Object.assign({ ref: setRefDropdownSubmenu, style: styles.popper }, attributes.popper, { children: (0, jsx_runtime_1.jsx)(MenuItems_1.default, { items: items }) })))] })));
|
|
26
33
|
};
|
|
27
34
|
exports.default = DropdownSubmenu;
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
import React, { type HTMLProps } from 'react';
|
|
2
|
+
import { type BUTTON_SIZE, type BUTTON_STYLE } from '../button/Button';
|
|
3
|
+
export type DropdownToggleButtonProps = HTMLProps<HTMLButtonElement> & {
|
|
4
|
+
id?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
splitButton?: boolean;
|
|
7
|
+
iconOnly?: boolean;
|
|
8
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
9
|
+
bsSize: BUTTON_SIZE;
|
|
10
|
+
bsStyle: BUTTON_STYLE;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
declare const DropdownToggleButton: React.ForwardRefExoticComponent<Omit<React.PropsWithChildren<DropdownToggleButtonProps>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
1
14
|
export default DropdownToggleButton;
|
|
2
|
-
declare const DropdownToggleButton: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
|
3
|
-
import React from "react";
|
|
@@ -2,20 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 =
|
|
6
|
-
const prop_types_1 = tslib_1.__importDefault(require("prop-types"));
|
|
5
|
+
const react_1 = require("react");
|
|
7
6
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const labelButtonClasses = (0, classnames_1.default)(!splitButton && 'dropdown-toggle', 'btn', `btn-${bsStyle}`, getSizeClassName(bsSize), iconOnly && 'btn-icon-only', disabled && 'disabled', className && !splitButton && className);
|
|
14
|
-
return ((0, jsx_runtime_1.jsx)("button", Object.assign({}, remainingProps, { id: splitButton ? `button-${id}` : id, role: 'button', type: 'button', className: labelButtonClasses, ref: ref }, { children: children })));
|
|
7
|
+
const Button_1 = tslib_1.__importDefault(require("../button/Button"));
|
|
8
|
+
const DropdownToggleButton = (0, react_1.forwardRef)((props, ref) => {
|
|
9
|
+
const { id, disabled, bsSize, bsStyle, splitButton = false, onClick, className = '', children } = props, remainingProps = tslib_1.__rest(props, ["id", "disabled", "bsSize", "bsStyle", "splitButton", "onClick", "className", "children"]);
|
|
10
|
+
const labelButtonClasses = (0, classnames_1.default)(!splitButton && 'dropdown-toggle', !splitButton && className);
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(Button_1.default, Object.assign({}, remainingProps, { id: splitButton ? `button-${id}` : id, type: 'button', ref: ref, disabled: disabled, bsStyle: bsStyle, bsSize: bsSize, onClick: onClick, className: labelButtonClasses }, { children: children })));
|
|
15
12
|
});
|
|
16
13
|
exports.default = DropdownToggleButton;
|
|
17
|
-
DropdownToggleButton.propTypes = {
|
|
18
|
-
disabled: prop_types_1.default.bool,
|
|
19
|
-
bsStyle: prop_types_1.default.oneOf(['default', 'primary', 'info', 'warning', 'danger', 'success', 'link', 'muted']),
|
|
20
|
-
className: prop_types_1.default.string,
|
|
21
|
-
};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { type ButtonDropdownProps } from './ButtonDropdown';
|
|
2
|
+
export type SimpleButtonDropdownProps = ButtonDropdownProps;
|
|
3
|
+
declare const SimpleButtonDropdown: (props: SimpleButtonDropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
4
|
export default SimpleButtonDropdown;
|
|
2
|
-
declare function SimpleButtonDropdown(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
|
|
5
|
+
// @ts-ignore-next-line importsNotUsedAsValues
|
|
6
|
+
require("react");
|
|
6
7
|
const ButtonDropdown_1 = tslib_1.__importDefault(require("./ButtonDropdown"));
|
|
7
|
-
const SimpleButtonDropdown = props => (0, jsx_runtime_1.jsx)(ButtonDropdown_1.default, Object.assign({}, props, { noCaret: true }));
|
|
8
|
+
const SimpleButtonDropdown = (props) => (0, jsx_runtime_1.jsx)(ButtonDropdown_1.default, Object.assign({}, props, { noCaret: true }));
|
|
8
9
|
exports.default = SimpleButtonDropdown;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { type ButtonDropdownProps } from './ButtonDropdown';
|
|
2
|
+
export type SingleButtonDropdownProps = ButtonDropdownProps;
|
|
3
|
+
declare const SingleButtonDropdown: (props: SingleButtonDropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
4
|
export default SingleButtonDropdown;
|
|
2
|
-
declare function SingleButtonDropdown(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
|
|
5
|
+
// @ts-ignore-next-line importsNotUsedAsValues
|
|
6
|
+
require("react");
|
|
6
7
|
const ButtonDropdown_1 = tslib_1.__importDefault(require("./ButtonDropdown"));
|
|
7
|
-
const SingleButtonDropdown = props => (0, jsx_runtime_1.jsx)(ButtonDropdown_1.default, Object.assign({}, props));
|
|
8
|
+
const SingleButtonDropdown = (props) => (0, jsx_runtime_1.jsx)(ButtonDropdown_1.default, Object.assign({}, props));
|
|
8
9
|
exports.default = SingleButtonDropdown;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { type ButtonDropdownProps } from './ButtonDropdown';
|
|
2
|
+
export type SplitButtonDropdownProps = ButtonDropdownProps;
|
|
3
|
+
declare const SplitButtonDropdown: (props: SplitButtonDropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
4
|
export default SplitButtonDropdown;
|
|
2
|
-
declare function SplitButtonDropdown(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
|
|
5
|
+
// @ts-ignore-next-line importsNotUsedAsValues
|
|
6
|
+
require("react");
|
|
6
7
|
const ButtonDropdown_1 = tslib_1.__importDefault(require("./ButtonDropdown"));
|
|
7
|
-
const SplitButtonDropdown = props => (0, jsx_runtime_1.jsx)(ButtonDropdown_1.default, Object.assign({}, props, { splitButton: true }));
|
|
8
|
+
const SplitButtonDropdown = (props) => (0, jsx_runtime_1.jsx)(ButtonDropdown_1.default, Object.assign({}, props, { splitButton: true }));
|
|
8
9
|
exports.default = SplitButtonDropdown;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import React, { type HTMLProps } from 'react';
|
|
2
|
+
import { BUTTON_STYLE, type BUTTON_SIZE } from '../button/Button';
|
|
3
|
+
export type SplitCaretButtonProps = HTMLProps<HTMLButtonElement> & {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
iconOnly?: boolean;
|
|
6
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
7
|
+
bsSize: BUTTON_SIZE;
|
|
8
|
+
bsStyle: BUTTON_STYLE;
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
declare const SplitCaretButton: React.ForwardRefExoticComponent<Omit<React.PropsWithChildren<SplitCaretButtonProps>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
1
12
|
export default SplitCaretButton;
|
|
2
|
-
declare const SplitCaretButton: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
|
3
|
-
import React from "react";
|
|
@@ -2,18 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 =
|
|
6
|
-
const prop_types_1 = tslib_1.__importDefault(require("prop-types"));
|
|
5
|
+
const react_1 = require("react");
|
|
7
6
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
8
7
|
const Caret_1 = tslib_1.__importDefault(require("./Caret"));
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
8
|
+
const Button_1 = tslib_1.__importDefault(require("../button/Button"));
|
|
9
|
+
const SplitCaretButton = (0, react_1.forwardRef)((props, ref) => {
|
|
10
|
+
const { disabled = false, bsStyle, bsSize, onClick, className } = props, remainingProps = tslib_1.__rest(props, ["disabled", "bsStyle", "bsSize", "onClick", "className"]);
|
|
11
|
+
const splitCaretButtonClasses = (0, classnames_1.default)('dropdown-toggle', className);
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)(Button_1.default, Object.assign({}, remainingProps, { type: 'button', ref: ref, disabled: disabled, bsStyle: bsStyle, bsSize: bsSize, onClick: onClick, className: splitCaretButtonClasses }, { children: (0, jsx_runtime_1.jsx)(Caret_1.default, {}) })));
|
|
13
13
|
});
|
|
14
14
|
exports.default = SplitCaretButton;
|
|
15
|
-
SplitCaretButton.propTypes = {
|
|
16
|
-
disabled: prop_types_1.default.bool,
|
|
17
|
-
bsStyle: prop_types_1.default.oneOf(['default', 'primary', 'info', 'warning', 'danger', 'success', 'link', 'muted']),
|
|
18
|
-
className: prop_types_1.default.string,
|
|
19
|
-
};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
declare
|
|
2
|
-
|
|
3
|
-
constructor(msg: any);
|
|
4
|
-
name: string;
|
|
5
|
-
message: any;
|
|
6
|
-
constructor: typeof MapException;
|
|
1
|
+
declare class MapException extends Error {
|
|
2
|
+
constructor(msg?: string);
|
|
7
3
|
}
|
|
8
4
|
export default MapException;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
class MapException extends Error {
|
|
4
|
+
constructor(msg) {
|
|
5
|
+
super(msg || 'no error message');
|
|
6
|
+
this.name = 'MapException';
|
|
7
|
+
// Restoring the prototype chain
|
|
8
|
+
Object.setPrototypeOf(this, MapException.prototype);
|
|
9
|
+
}
|
|
7
10
|
}
|
|
8
11
|
exports.default = MapException;
|
|
9
|
-
MapException.prototype = Object.create(Error.prototype);
|
|
10
|
-
MapException.prototype.constructor = MapException;
|
|
@@ -3,9 +3,25 @@ export type MenuItemProps = {
|
|
|
3
3
|
index?: number;
|
|
4
4
|
value?: string | React.ReactNode;
|
|
5
5
|
active?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Setting "disabled" to true will disable the respective item.
|
|
8
|
+
*
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
6
11
|
disabled?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Will add a divider line between the items inside the dropdown.
|
|
14
|
+
*
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
7
17
|
divider?: boolean;
|
|
8
18
|
header?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Callback function triggered when an item is selected.
|
|
21
|
+
* @param value
|
|
22
|
+
* @param event
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
9
25
|
onSelect?: (value: number | undefined, event: React.MouseEvent<HTMLLIElement>) => void;
|
|
10
26
|
closeMenu?: VoidFunction;
|
|
11
27
|
onMouseEnter?: (event: React.MouseEvent<HTMLLIElement>) => void;
|
|
@@ -15,6 +15,7 @@ const MenuItem = (props) => {
|
|
|
15
15
|
}
|
|
16
16
|
const role = divider ? 'separator' : 'presentation';
|
|
17
17
|
const classes = (0, classnames_1.default)(divider && 'divider pointer-events-none', disabled && 'disabled', active && 'active');
|
|
18
|
+
// biome-ignore lint/a11y/useValidAnchor: <explanation>
|
|
18
19
|
const menuLink = (0, jsx_runtime_1.jsx)("a", Object.assign({ role: 'menuitem' }, { children: value }));
|
|
19
20
|
const handleSelectItem = (event) => {
|
|
20
21
|
if (!disabled) {
|