@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
package/AssetTree.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { AssetTreeProps } from './types';
|
|
4
|
-
export default class AssetTree extends React.Component<AssetTreeProps> {}
|
|
5
|
-
}
|
|
1
|
+
export { default } from './components/assetTree/AssetTree';
|
|
2
|
+
export * from './components/assetTree/AssetTree';
|
package/AssetTree.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
export { default } from './components/assetTree/AssetTree';
|
|
2
|
+
export * from './components/assetTree/AssetTree';
|
package/ButtonDropdown.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { ButtonDropdownProps } from './types';
|
|
4
|
-
export default class ButtonDropdown extends React.Component<ButtonDropdownProps> {}
|
|
5
|
-
}
|
|
1
|
+
export { default } from './components/dropdown/ButtonDropdown';
|
|
2
|
+
export * from './components/dropdown/ButtonDropdown';
|
package/ButtonDropdown.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
export { default } from './components/dropdown/ButtonDropdown';
|
|
2
|
+
export * from './components/dropdown/ButtonDropdown';
|
package/DropdownSubmenu.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { DropdownSubmenuProps } from './types';
|
|
4
|
-
export default class DropdownSubmenu extends React.Component<DropdownSubmenuProps> {}
|
|
5
|
-
}
|
|
1
|
+
export { default } from './components/dropdown/DropdownSubmenu';
|
|
2
|
+
export * from './components/dropdown/DropdownSubmenu';
|
package/DropdownSubmenu.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
export { default } from './components/dropdown/DropdownSubmenu';
|
|
2
|
+
export * from './components/dropdown/DropdownSubmenu';
|
package/MenuItem.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { MenuItem as MenuItemProps } from './types';
|
|
4
|
-
export default class MenuItem extends React.Component<MenuItemProps> {}
|
|
5
|
-
}
|
|
1
|
+
export { default } from './components/menuItems/MenuItem';
|
|
2
|
+
export * from './components/menuItems/MenuItem';
|
package/MenuItem.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
export { default } from './components/menuItems/MenuItem';
|
|
2
|
+
export * from './components/menuItems/MenuItem';
|
package/MenuItemList.js
ADDED
package/MenuItems.d.ts
ADDED
package/MenuItems.js
ADDED
package/Page.d.ts
ADDED
package/Page.js
ADDED
package/Sidebar.d.ts
CHANGED
package/Sidebar.js
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { SimpleButtonDropdownProps } from './types';
|
|
4
|
-
export default class SimpleButtonDropdown extends React.Component<SimpleButtonDropdownProps> {}
|
|
5
|
-
}
|
|
1
|
+
export { default } from './components/dropdown/SimpleButtonDropdown';
|
|
2
|
+
export * from './components/dropdown/SimpleButtonDropdown';
|
package/SimpleButtonDropdown.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
export { default } from './components/dropdown/SimpleButtonDropdown';
|
|
2
|
+
export * from './components/dropdown/SimpleButtonDropdown';
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { SingleButtonDropdownProps } from './types';
|
|
4
|
-
export default class SingleButtonDropdown extends React.Component<SingleButtonDropdownProps> {}
|
|
5
|
-
}
|
|
1
|
+
export { default } from './components/dropdown/SingleButtonDropdown';
|
|
2
|
+
export * from './components/dropdown/SingleButtonDropdown';
|
package/SingleButtonDropdown.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
export { default } from './components/dropdown/SingleButtonDropdown';
|
|
2
|
+
export * from './components/dropdown/SingleButtonDropdown';
|
package/SplitButtonDropdown.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { SplitButtonDropdownProps } from './types';
|
|
4
|
-
export default class SplitButtonDropdown extends React.Component<SplitButtonDropdownProps> {}
|
|
5
|
-
}
|
|
1
|
+
export { default } from './components/dropdown/SplitButtonDropdown';
|
|
2
|
+
export * from './components/dropdown/SplitButtonDropdown';
|
package/SplitButtonDropdown.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
export { default } from './components/dropdown/SplitButtonDropdown';
|
|
2
|
+
export * from './components/dropdown/SplitButtonDropdown';
|
package/Tree.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { TreeProps } from './types';
|
|
4
|
-
export default class Tree extends React.Component<TreeProps> {}
|
|
5
|
-
}
|
|
1
|
+
export { default } from './components/assetTree/Tree';
|
|
2
|
+
export * from './components/assetTree/Tree';
|
package/Tree.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
export { default } from './components/assetTree/Tree';
|
|
2
|
+
export * from './components/assetTree/Tree';
|
package/TreeCategory.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { TreeCategoryProps } from './types';
|
|
4
|
-
export default class TreeCategory extends React.Component<TreeCategoryProps> {}
|
|
5
|
-
}
|
|
1
|
+
export { default } from './components/assetTree/TreeCategory';
|
|
2
|
+
export * from './components/assetTree/TreeCategory';
|
package/TreeCategory.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
export { default } from './components/assetTree/TreeCategory';
|
|
2
|
+
export * from './components/assetTree/TreeCategory';
|
package/TreeOption.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { TreeOptionProps } from './types';
|
|
4
|
-
export default class TreeOption extends React.Component<TreeOptionProps> {}
|
|
5
|
-
}
|
|
1
|
+
export { default } from './components/assetTree/TreeOption';
|
|
2
|
+
export * from './components/assetTree/TreeOption';
|
package/TreeOption.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
export { default } from './components/assetTree/TreeOption';
|
|
2
|
+
export * from './components/assetTree/TreeOption';
|
package/TreeSearch.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { TreeSearchProps } from './types';
|
|
4
|
-
export default class TreeSearch extends React.Component<TreeSearchProps> {}
|
|
5
|
-
}
|
|
1
|
+
export { default } from './components/assetTree/TreeSearch';
|
|
2
|
+
export * from './components/assetTree/TreeSearch';
|
package/TreeSearch.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
export { default } from './components/assetTree/TreeSearch';
|
|
2
|
+
export * from './components/assetTree/TreeSearch';
|
package/TreeSummary.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { TreeSummaryProps } from './types';
|
|
4
|
-
export default class TreeSummary extends React.Component<TreeSummaryProps> {}
|
|
5
|
-
}
|
|
1
|
+
export { default } from './components/assetTree/TreeSummary';
|
|
2
|
+
export * from './components/assetTree/TreeSummary';
|
package/TreeSummary.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
export { default } from './components/assetTree/TreeSummary';
|
|
2
|
+
export * from './components/assetTree/TreeSummary';
|
package/TypeCounter.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { TypeCounterProps } from './types';
|
|
4
|
-
export default class TypeCounter extends React.Component<TypeCounterProps> {}
|
|
5
|
-
}
|
|
1
|
+
export { default } from './components/assetTree/TypeCounter';
|
|
2
|
+
export * from './components/assetTree/TypeCounter';
|
package/TypeCounter.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
export { default } from './components/assetTree/TypeCounter';
|
|
2
|
+
export * from './components/assetTree/TypeCounter';
|
|
@@ -1,3 +1,85 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type AssetTreeProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Defines if the component will overlap the body content.
|
|
5
|
+
*
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
8
|
+
fly?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Defines whether or not the sidebar is resizable.
|
|
11
|
+
*
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
14
|
+
resizable?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Defines whether the component has a border or not.
|
|
17
|
+
*
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
bordered?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Defines the width of the component. The value is set as inline style.
|
|
23
|
+
* Note: when component is resizable it will take the provided
|
|
24
|
+
* width in px only and convert it to number in case.
|
|
25
|
+
*
|
|
26
|
+
* @default 350
|
|
27
|
+
*/
|
|
28
|
+
width?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Defines the minimum width of the component in px that will take effect when resizing.
|
|
31
|
+
*
|
|
32
|
+
* @default 100
|
|
33
|
+
*/
|
|
34
|
+
minWidth?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Defines the maximum width of the component in px that will take effect when resizing.
|
|
37
|
+
*
|
|
38
|
+
* @default 0
|
|
39
|
+
*/
|
|
40
|
+
maxWidth?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Defines the height of the component in px.
|
|
43
|
+
*/
|
|
44
|
+
height?: number;
|
|
45
|
+
/**
|
|
46
|
+
* Defines whether the component is open or not.
|
|
47
|
+
*
|
|
48
|
+
* @default true
|
|
49
|
+
*/
|
|
50
|
+
isOpen?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Callback for when the tree visibility is toggled.
|
|
53
|
+
* @param isOpen
|
|
54
|
+
* @returns
|
|
55
|
+
*/
|
|
56
|
+
onToggleTree?: (isOpen: boolean) => void;
|
|
57
|
+
/**
|
|
58
|
+
* The id of the category which is currently active and shall be shown.
|
|
59
|
+
*/
|
|
60
|
+
currentCategoryId: string;
|
|
61
|
+
/**
|
|
62
|
+
* Callback for handling change of category.
|
|
63
|
+
* @param selectedCategoryId
|
|
64
|
+
* @returns
|
|
65
|
+
*/
|
|
66
|
+
onCategoryChange: (selectedCategoryId: string) => void;
|
|
67
|
+
/**
|
|
68
|
+
* Callback for when the resize is done.
|
|
69
|
+
*/
|
|
70
|
+
onResizeEnd: VoidFunction;
|
|
71
|
+
/**
|
|
72
|
+
* Defines whether the tree components are rendered offscreen and kept mounted in the DOM.
|
|
73
|
+
*
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
useOffscreen: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Additional classes added on the wrapper element.
|
|
79
|
+
*/
|
|
80
|
+
className?: string;
|
|
81
|
+
};
|
|
82
|
+
declare const AssetTree: React.MemoExoticComponent<React.ForwardRefExoticComponent<AssetTreeProps & {
|
|
83
|
+
children?: React.ReactNode;
|
|
84
|
+
} & React.RefAttributes<HTMLDivElement>>>;
|
|
1
85
|
export default AssetTree;
|
|
2
|
-
declare const AssetTree: React.MemoExoticComponent<React.ForwardRefExoticComponent<React.RefAttributes<any>>>;
|
|
3
|
-
import React from "react";
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import React, { memo, useState,
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
3
|
+
import React, { memo, useState, useRef, forwardRef } from 'react';
|
|
5
4
|
import classNames from 'classnames';
|
|
6
5
|
import head from 'lodash/fp/head';
|
|
7
6
|
import isArray from 'lodash/fp/isArray';
|
|
7
|
+
import noop from 'lodash/fp/noop';
|
|
8
|
+
import invariant from 'tiny-invariant';
|
|
9
|
+
import TreeCategory from './TreeCategory';
|
|
8
10
|
import Resizer from '../resizer/Resizer';
|
|
9
11
|
import TreeSidebar from './TreeSidebar';
|
|
10
|
-
import TreeCategory from './TreeCategory';
|
|
11
12
|
import getWidthInBoundaries from '../../utils/getWidthInBoundaries';
|
|
12
|
-
|
|
13
|
+
import mergeRefs from '../../utils/mergeRefs';
|
|
14
|
+
import usePrevious from '../../usePrevious';
|
|
15
|
+
const DEFAULT_WIDTH = 350;
|
|
16
|
+
const DEFAULT_MIN_WIDTH = 100;
|
|
17
|
+
const DEFAULT_MAX_WIDTH = 0;
|
|
18
|
+
const TreeMode = {
|
|
19
|
+
MODE_FLY: 'fly',
|
|
20
|
+
MODE_FLUID: 'fluid',
|
|
21
|
+
};
|
|
22
|
+
const getSidebarBodyRef = (sidebarRef) => { var _a; return head((_a = sidebarRef === null || sidebarRef === void 0 ? void 0 : sidebarRef.current) === null || _a === void 0 ? void 0 : _a.getElementsByClassName('AssetTreeBody')); };
|
|
13
23
|
const getCurrentCategoryElement = (children, currentCategoryId) => {
|
|
14
24
|
return isArray(children) ? children.find(child => child && child.props.id === currentCategoryId) : children;
|
|
15
25
|
};
|
|
@@ -19,30 +29,42 @@ const renderTreesOffscreen = (children, categoryId) => {
|
|
|
19
29
|
return _jsx("div", Object.assign({ className: offscreenClasses }, { children: child }));
|
|
20
30
|
});
|
|
21
31
|
};
|
|
32
|
+
// Check if the child is a React element and if it has the type TreeCategory
|
|
33
|
+
const isTreeCategory = (child) => {
|
|
34
|
+
return React.isValidElement(child) && child.type === TreeCategory;
|
|
35
|
+
};
|
|
22
36
|
const AssetTree = memo(forwardRef((props, ref) => {
|
|
23
|
-
const { className, resizable, width
|
|
24
|
-
const getSidebarMode = isFly => (isFly ?
|
|
25
|
-
const [treeWidth, setTreeWidth] = useState(
|
|
37
|
+
const { className, resizable = true, width = DEFAULT_WIDTH, minWidth = DEFAULT_MIN_WIDTH, maxWidth = DEFAULT_MAX_WIDTH, height, bordered = false, currentCategoryId, isOpen = true, useOffscreen = false, fly = false, onCategoryChange = noop, onToggleTree = noop, onResizeEnd = noop, children = [] } = props, remainingProps = __rest(props, ["className", "resizable", "width", "minWidth", "maxWidth", "height", "bordered", "currentCategoryId", "isOpen", "useOffscreen", "fly", "onCategoryChange", "onToggleTree", "onResizeEnd", "children"]);
|
|
38
|
+
const getSidebarMode = (isFly) => (isFly ? TreeMode.MODE_FLY : TreeMode.MODE_FLUID);
|
|
39
|
+
const [treeWidth, setTreeWidth] = useState(width);
|
|
26
40
|
const [isResize, setIsResize] = useState(false);
|
|
27
41
|
const [sidebarMode, setSidebarMode] = useState(getSidebarMode(fly));
|
|
28
|
-
const sidebarRef = useRef();
|
|
29
|
-
|
|
42
|
+
const sidebarRef = useRef(null);
|
|
43
|
+
const mergedRefs = mergeRefs([ref, sidebarRef]);
|
|
30
44
|
// Update internal state when props change
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
45
|
+
const previousWidth = usePrevious(width);
|
|
46
|
+
if (previousWidth !== width) {
|
|
47
|
+
setTreeWidth(width);
|
|
48
|
+
}
|
|
49
|
+
const previousMode = usePrevious(fly);
|
|
50
|
+
if (previousMode !== fly) {
|
|
51
|
+
setSidebarMode(getSidebarMode(fly));
|
|
52
|
+
}
|
|
53
|
+
const childrenArray = React.Children.toArray(children);
|
|
54
|
+
// check for children type of TreeCategory and throw error in case
|
|
55
|
+
invariant(childrenArray.every(isTreeCategory), 'AssetTree only excepts children of type "TreeCategory"');
|
|
56
|
+
const classes = classNames('AssetTree', className, !isOpen && 'closed', bordered && 'panel panel-default', sidebarMode === TreeMode.MODE_FLY ? 'fly' : 'fluid');
|
|
34
57
|
const resizeLimitClasses = classNames('AssetTreeResizeLimit', isResize && 'display-block');
|
|
35
58
|
const resizeIndicatorPosition = maxWidth || window.innerWidth * 0.5;
|
|
36
59
|
const resizeLimitStyle = { left: resizeIndicatorPosition };
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const category = currentCategoryId ? getCurrentCategoryElement(children, currentCategoryId) : firstChild;
|
|
60
|
+
const firstChild = head(childrenArray);
|
|
61
|
+
const category = currentCategoryId ? getCurrentCategoryElement(childrenArray, currentCategoryId) : firstChild;
|
|
40
62
|
const style = {
|
|
41
63
|
width: treeWidth,
|
|
42
64
|
height,
|
|
43
65
|
};
|
|
44
66
|
const handleToggleTreeContent = () => onToggleTree(!isOpen);
|
|
45
|
-
const handleSelectCategory = selectedCategoryId => {
|
|
67
|
+
const handleSelectCategory = (selectedCategoryId) => {
|
|
46
68
|
onCategoryChange(selectedCategoryId);
|
|
47
69
|
if (!isOpen) {
|
|
48
70
|
handleToggleTreeContent();
|
|
@@ -51,7 +73,7 @@ const AssetTree = memo(forwardRef((props, ref) => {
|
|
|
51
73
|
handleToggleTreeContent();
|
|
52
74
|
}
|
|
53
75
|
};
|
|
54
|
-
const handleResize = diff => {
|
|
76
|
+
const handleResize = (diff) => {
|
|
55
77
|
const halfWindowWidth = window.innerWidth * 0.5;
|
|
56
78
|
const usedMaxWidth = maxWidth || halfWindowWidth;
|
|
57
79
|
// Check for sidebar width if it is half window size. If it was before but the sidebar was resized so it is
|
|
@@ -77,50 +99,8 @@ const AssetTree = memo(forwardRef((props, ref) => {
|
|
|
77
99
|
setIsResize(false);
|
|
78
100
|
onResizeEnd();
|
|
79
101
|
};
|
|
80
|
-
return (_jsxs("div", Object.assign({}, remainingProps, { className: classes, style: style, ref:
|
|
102
|
+
return (_jsxs("div", Object.assign({}, remainingProps, { className: classes, style: style, ref: mergedRefs }, { children: [_jsx("div", { className: resizeLimitClasses, style: resizeLimitStyle }), _jsxs("div", Object.assign({ className: 'AssetTreeContent' }, { children: [_jsx(TreeSidebar, Object.assign({ onSelectCategory: handleSelectCategory, currentCategoryId: currentCategoryId, onClick: handleToggleTreeContent }, { children: isArray(children) ? children : [children] })), _jsx("div", Object.assign({ className: 'AssetTreeBody' }, { children: useOffscreen ? renderTreesOffscreen(childrenArray, currentCategoryId) : category }))] })), resizable && isOpen && (_jsx(Resizer, { onResizeStart: handleResizeStart, onResize: handleResize, onResizeEnd: handleResizeEnd, direction: Resizer.HORIZONTAL, position: Resizer.RIGHT }))] })));
|
|
81
103
|
}));
|
|
82
104
|
AssetTree.displayName = 'AssetTree';
|
|
83
|
-
AssetTree
|
|
84
|
-
AssetTree.MODE_FLUID = 'fluid';
|
|
85
|
-
AssetTree.defaultProps = {
|
|
86
|
-
width: 350,
|
|
87
|
-
minWidth: 100,
|
|
88
|
-
maxWidth: 0,
|
|
89
|
-
resizable: true,
|
|
90
|
-
bordered: false,
|
|
91
|
-
fly: false,
|
|
92
|
-
isOpen: true,
|
|
93
|
-
onToggleTree: () => { },
|
|
94
|
-
children: [],
|
|
95
|
-
onCategoryChange: () => { },
|
|
96
|
-
onResizeEnd: () => { },
|
|
97
|
-
useOffscreen: false,
|
|
98
|
-
};
|
|
99
|
-
AssetTree.propTypes = {
|
|
100
|
-
fly: PropTypes.bool,
|
|
101
|
-
resizable: PropTypes.bool,
|
|
102
|
-
bordered: PropTypes.bool,
|
|
103
|
-
// When sidebar is resizable it will take the provided width in px only
|
|
104
|
-
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
105
|
-
minWidth: PropTypes.number,
|
|
106
|
-
maxWidth: PropTypes.number,
|
|
107
|
-
height: PropTypes.number,
|
|
108
|
-
isOpen: PropTypes.bool,
|
|
109
|
-
onToggleTree: PropTypes.func,
|
|
110
|
-
currentCategoryId: PropTypes.string.isRequired,
|
|
111
|
-
onCategoryChange: PropTypes.func,
|
|
112
|
-
className: PropTypes.string,
|
|
113
|
-
onResizeEnd: PropTypes.func,
|
|
114
|
-
useOffscreen: PropTypes.bool,
|
|
115
|
-
children: (props, propName, componentName) => {
|
|
116
|
-
const prop = props[propName];
|
|
117
|
-
let error = null;
|
|
118
|
-
React.Children.forEach(prop, child => {
|
|
119
|
-
if (child.type !== TreeCategory) {
|
|
120
|
-
error = new Error(`\`${componentName}\` children should be of type \`TreeCategory\`.`);
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
return error;
|
|
124
|
-
},
|
|
125
|
-
};
|
|
105
|
+
Object.assign(AssetTree, TreeMode);
|
|
126
106
|
export default AssetTree;
|