@rio-cloud/rio-uikit 0.16.4-beta.21 → 0.16.4-beta.22

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 (241) hide show
  1. package/AssetTree.d.ts +2 -5
  2. package/AssetTree.js +2 -2
  3. package/ButtonDropdown.d.ts +2 -5
  4. package/ButtonDropdown.js +2 -2
  5. package/DropdownSubmenu.d.ts +2 -5
  6. package/DropdownSubmenu.js +2 -2
  7. package/MenuItem.d.ts +2 -5
  8. package/MenuItem.js +2 -2
  9. package/MenuItemList.d.ts +2 -0
  10. package/MenuItemList.js +2 -0
  11. package/MenuItems.d.ts +2 -0
  12. package/MenuItems.js +2 -0
  13. package/Page.d.ts +2 -0
  14. package/Page.js +2 -0
  15. package/Sidebar.d.ts +1 -0
  16. package/Sidebar.js +1 -0
  17. package/SimpleButtonDropdown.d.ts +2 -5
  18. package/SimpleButtonDropdown.js +2 -2
  19. package/SingleButtonDropdown.d.ts +2 -5
  20. package/SingleButtonDropdown.js +2 -2
  21. package/SplitButtonDropdown.d.ts +2 -5
  22. package/SplitButtonDropdown.js +2 -2
  23. package/Tree.d.ts +2 -5
  24. package/Tree.js +2 -2
  25. package/TreeCategory.d.ts +2 -5
  26. package/TreeCategory.js +2 -2
  27. package/TreeOption.d.ts +2 -5
  28. package/TreeOption.js +2 -2
  29. package/TreeSearch.d.ts +2 -5
  30. package/TreeSearch.js +2 -2
  31. package/TreeSummary.d.ts +2 -5
  32. package/TreeSummary.js +2 -2
  33. package/TreeSummaryRow.d.ts +2 -0
  34. package/TreeSummaryRow.js +2 -0
  35. package/TypeCounter.d.ts +2 -5
  36. package/TypeCounter.js +2 -2
  37. package/components/assetTree/AssetTree.d.ts +84 -2
  38. package/components/assetTree/AssetTree.js +41 -61
  39. package/components/assetTree/Tree.d.ts +195 -2
  40. package/components/assetTree/Tree.js +70 -256
  41. package/components/assetTree/TreeCategory.d.ts +24 -11
  42. package/components/assetTree/TreeCategory.js +1 -8
  43. package/components/assetTree/TreeLeaf.d.ts +1 -1
  44. package/components/assetTree/TreeLeaf.js +3 -2
  45. package/components/assetTree/TreeLeafList.d.ts +3 -3
  46. package/components/assetTree/TreeLeafList.js +4 -3
  47. package/components/assetTree/TreeNode.d.ts +12 -2
  48. package/components/assetTree/TreeNode.js +2 -17
  49. package/components/assetTree/TreeNodeContainer.d.ts +10 -12
  50. package/components/assetTree/TreeNodeContainer.js +9 -8
  51. package/components/assetTree/TreeNothingFound.d.ts +3 -2
  52. package/components/assetTree/TreeNothingFound.js +1 -7
  53. package/components/assetTree/TreeOption.d.ts +27 -17
  54. package/components/assetTree/TreeOption.js +5 -14
  55. package/components/assetTree/TreeOptions.d.ts +9 -13
  56. package/components/assetTree/TreeOptions.js +4 -11
  57. package/components/assetTree/TreeRoot.d.ts +9 -11
  58. package/components/assetTree/TreeRoot.js +8 -8
  59. package/components/assetTree/TreeSearch.d.ts +23 -2
  60. package/components/assetTree/TreeSearch.js +4 -12
  61. package/components/assetTree/TreeSelectAll.d.ts +14 -26
  62. package/components/assetTree/TreeSelectAll.js +7 -22
  63. package/components/assetTree/TreeSidebar.d.ts +10 -2
  64. package/components/assetTree/TreeSidebar.js +4 -35
  65. package/components/assetTree/TreeSidebarCategories.d.ts +11 -0
  66. package/components/assetTree/TreeSidebarCategories.js +34 -0
  67. package/components/assetTree/TreeSummary.d.ts +44 -2
  68. package/components/assetTree/TreeSummary.js +6 -19
  69. package/components/assetTree/TreeSummaryRow.d.ts +15 -0
  70. package/components/assetTree/TreeSummaryRow.js +6 -0
  71. package/components/assetTree/TypeCounter.d.ts +45 -2
  72. package/components/assetTree/TypeCounter.js +14 -23
  73. package/components/assetTree/treeReducer.d.ts +47 -0
  74. package/components/assetTree/treeReducer.js +34 -0
  75. package/components/assetTree/treeUtils.d.ts +20 -0
  76. package/components/assetTree/treeUtils.js +88 -0
  77. package/components/button/Button.d.ts +14 -9
  78. package/components/button/Button.js +7 -7
  79. package/components/button/ToggleButton.d.ts +2 -4
  80. package/components/datepicker/DatePicker.d.ts +9 -9
  81. package/components/datepicker/DatePicker.js +4 -2
  82. package/components/dialog/Dialog.js +6 -2
  83. package/components/dropdown/ButtonDropdown.d.ts +115 -65
  84. package/components/dropdown/ButtonDropdown.js +14 -60
  85. package/components/dropdown/Caret.d.ts +1 -1
  86. package/components/dropdown/Caret.js +2 -1
  87. package/components/dropdown/DropdownSubmenu.d.ts +21 -18
  88. package/components/dropdown/DropdownSubmenu.js +26 -19
  89. package/components/dropdown/DropdownToggleButton.d.ts +14 -2
  90. package/components/dropdown/DropdownToggleButton.js +6 -14
  91. package/components/dropdown/SimpleButtonDropdown.d.ts +3 -1
  92. package/components/dropdown/SimpleButtonDropdown.js +3 -2
  93. package/components/dropdown/SingleButtonDropdown.d.ts +3 -1
  94. package/components/dropdown/SingleButtonDropdown.js +3 -2
  95. package/components/dropdown/SplitButtonDropdown.d.ts +3 -1
  96. package/components/dropdown/SplitButtonDropdown.js +3 -2
  97. package/components/dropdown/SplitCaretButton.d.ts +12 -2
  98. package/components/dropdown/SplitCaretButton.js +6 -11
  99. package/components/menuItems/MenuItem.d.ts +16 -0
  100. package/components/menuItems/MenuItem.js +1 -0
  101. package/components/menuItems/MenuItemList.d.ts +7 -0
  102. package/components/menuItems/MenuItemList.js +10 -0
  103. package/components/menuItems/MenuItems.d.ts +7 -2
  104. package/components/menuItems/MenuItems.js +10 -9
  105. package/components/numberInput/NumberInput.js +1 -1
  106. package/components/page/Page.d.ts +10 -0
  107. package/components/page/Page.js +18 -0
  108. package/components/timepicker/TimePicker.js +2 -1
  109. package/hooks/usePrevious.d.ts +1 -1
  110. package/hooks/usePrevious.js +6 -7
  111. package/index.d.ts +34 -26
  112. package/index.js +34 -26
  113. package/lib/es/AssetTree.d.ts +2 -5
  114. package/lib/es/AssetTree.js +3 -2
  115. package/lib/es/ButtonDropdown.d.ts +2 -5
  116. package/lib/es/ButtonDropdown.js +3 -2
  117. package/lib/es/DropdownSubmenu.d.ts +2 -5
  118. package/lib/es/DropdownSubmenu.js +3 -2
  119. package/lib/es/MenuItem.d.ts +2 -5
  120. package/lib/es/MenuItem.js +3 -2
  121. package/lib/es/MenuItemList.d.ts +2 -0
  122. package/lib/es/MenuItemList.js +7 -0
  123. package/lib/es/MenuItems.d.ts +2 -0
  124. package/lib/es/MenuItems.js +7 -0
  125. package/lib/es/Page.d.ts +2 -0
  126. package/lib/es/Page.js +7 -0
  127. package/lib/es/Sidebar.d.ts +1 -0
  128. package/lib/es/Sidebar.js +3 -4
  129. package/lib/es/SimpleButtonDropdown.d.ts +2 -5
  130. package/lib/es/SimpleButtonDropdown.js +3 -2
  131. package/lib/es/SingleButtonDropdown.d.ts +2 -5
  132. package/lib/es/SingleButtonDropdown.js +3 -2
  133. package/lib/es/SplitButtonDropdown.d.ts +2 -5
  134. package/lib/es/SplitButtonDropdown.js +3 -2
  135. package/lib/es/Tree.d.ts +2 -5
  136. package/lib/es/Tree.js +3 -2
  137. package/lib/es/TreeCategory.d.ts +2 -5
  138. package/lib/es/TreeCategory.js +3 -2
  139. package/lib/es/TreeOption.d.ts +2 -5
  140. package/lib/es/TreeOption.js +3 -2
  141. package/lib/es/TreeSearch.d.ts +2 -5
  142. package/lib/es/TreeSearch.js +3 -2
  143. package/lib/es/TreeSummary.d.ts +2 -5
  144. package/lib/es/TreeSummary.js +3 -2
  145. package/lib/es/TreeSummaryRow.d.ts +2 -0
  146. package/lib/es/TreeSummaryRow.js +7 -0
  147. package/lib/es/TypeCounter.d.ts +2 -5
  148. package/lib/es/TypeCounter.js +3 -2
  149. package/lib/es/components/assetTree/AssetTree.d.ts +84 -2
  150. package/lib/es/components/assetTree/AssetTree.js +40 -60
  151. package/lib/es/components/assetTree/Tree.d.ts +195 -2
  152. package/lib/es/components/assetTree/Tree.js +103 -286
  153. package/lib/es/components/assetTree/TreeCategory.d.ts +24 -11
  154. package/lib/es/components/assetTree/TreeCategory.js +1 -9
  155. package/lib/es/components/assetTree/TreeLeaf.d.ts +1 -1
  156. package/lib/es/components/assetTree/TreeLeaf.js +2 -1
  157. package/lib/es/components/assetTree/TreeLeafList.d.ts +3 -3
  158. package/lib/es/components/assetTree/TreeLeafList.js +4 -3
  159. package/lib/es/components/assetTree/TreeNode.d.ts +12 -2
  160. package/lib/es/components/assetTree/TreeNode.js +2 -17
  161. package/lib/es/components/assetTree/TreeNodeContainer.d.ts +10 -12
  162. package/lib/es/components/assetTree/TreeNodeContainer.js +9 -8
  163. package/lib/es/components/assetTree/TreeNothingFound.d.ts +3 -2
  164. package/lib/es/components/assetTree/TreeNothingFound.js +1 -7
  165. package/lib/es/components/assetTree/TreeOption.d.ts +27 -17
  166. package/lib/es/components/assetTree/TreeOption.js +5 -14
  167. package/lib/es/components/assetTree/TreeOptions.d.ts +9 -13
  168. package/lib/es/components/assetTree/TreeOptions.js +4 -11
  169. package/lib/es/components/assetTree/TreeRoot.d.ts +9 -11
  170. package/lib/es/components/assetTree/TreeRoot.js +8 -8
  171. package/lib/es/components/assetTree/TreeSearch.d.ts +23 -2
  172. package/lib/es/components/assetTree/TreeSearch.js +4 -12
  173. package/lib/es/components/assetTree/TreeSelectAll.d.ts +14 -26
  174. package/lib/es/components/assetTree/TreeSelectAll.js +7 -22
  175. package/lib/es/components/assetTree/TreeSidebar.d.ts +10 -2
  176. package/lib/es/components/assetTree/TreeSidebar.js +5 -36
  177. package/lib/es/components/assetTree/TreeSidebarCategories.d.ts +11 -0
  178. package/lib/es/components/assetTree/TreeSidebarCategories.js +37 -0
  179. package/lib/es/components/assetTree/TreeSummary.d.ts +44 -2
  180. package/lib/es/components/assetTree/TreeSummary.js +6 -19
  181. package/lib/es/components/assetTree/TreeSummaryRow.d.ts +15 -0
  182. package/lib/es/components/assetTree/TreeSummaryRow.js +10 -0
  183. package/lib/es/components/assetTree/TypeCounter.d.ts +45 -2
  184. package/lib/es/components/assetTree/TypeCounter.js +14 -23
  185. package/lib/es/components/assetTree/autoAnimateFrames.d.ts +1 -0
  186. package/lib/es/components/assetTree/autoAnimateFrames.js +55 -0
  187. package/lib/es/components/assetTree/treeReducer.d.ts +47 -0
  188. package/lib/es/components/assetTree/treeReducer.js +47 -0
  189. package/lib/es/components/assetTree/treeUtils.d.ts +20 -0
  190. package/lib/es/components/assetTree/treeUtils.js +106 -0
  191. package/lib/es/components/button/Button.d.ts +14 -9
  192. package/lib/es/components/button/Button.js +12 -11
  193. package/lib/es/components/button/ToggleButton.d.ts +2 -4
  194. package/lib/es/components/datepicker/DatePicker.d.ts +9 -9
  195. package/lib/es/components/datepicker/DatePicker.js +4 -2
  196. package/lib/es/components/dialog/Dialog.js +5 -1
  197. package/lib/es/components/dropdown/ButtonDropdown.d.ts +115 -65
  198. package/lib/es/components/dropdown/ButtonDropdown.js +13 -59
  199. package/lib/es/components/dropdown/Caret.d.ts +1 -1
  200. package/lib/es/components/dropdown/Caret.js +2 -2
  201. package/lib/es/components/dropdown/DropdownSubmenu.d.ts +21 -18
  202. package/lib/es/components/dropdown/DropdownSubmenu.js +26 -19
  203. package/lib/es/components/dropdown/DropdownToggleButton.d.ts +14 -2
  204. package/lib/es/components/dropdown/DropdownToggleButton.js +6 -14
  205. package/lib/es/components/dropdown/SimpleButtonDropdown.d.ts +3 -1
  206. package/lib/es/components/dropdown/SimpleButtonDropdown.js +3 -2
  207. package/lib/es/components/dropdown/SingleButtonDropdown.d.ts +3 -1
  208. package/lib/es/components/dropdown/SingleButtonDropdown.js +3 -2
  209. package/lib/es/components/dropdown/SplitButtonDropdown.d.ts +3 -1
  210. package/lib/es/components/dropdown/SplitButtonDropdown.js +3 -2
  211. package/lib/es/components/dropdown/SplitCaretButton.d.ts +12 -2
  212. package/lib/es/components/dropdown/SplitCaretButton.js +6 -11
  213. package/lib/es/components/menuItems/MenuItem.d.ts +16 -0
  214. package/lib/es/components/menuItems/MenuItem.js +1 -0
  215. package/lib/es/components/menuItems/MenuItemList.d.ts +7 -0
  216. package/lib/es/components/menuItems/MenuItemList.js +12 -0
  217. package/lib/es/components/menuItems/MenuItems.d.ts +7 -2
  218. package/lib/es/components/menuItems/MenuItems.js +9 -7
  219. package/lib/es/components/numberInput/NumberInput.js +1 -1
  220. package/lib/es/components/page/Page.d.ts +10 -0
  221. package/lib/es/components/page/Page.js +21 -0
  222. package/lib/es/components/timepicker/TimePicker.js +2 -1
  223. package/lib/es/hooks/usePrevious.d.ts +1 -1
  224. package/lib/es/hooks/usePrevious.js +5 -6
  225. package/lib/es/index.d.ts +34 -26
  226. package/lib/es/index.js +55 -30
  227. package/lib/es/types.d.ts +1 -140
  228. package/lib/es/utils/init.js +1 -0
  229. package/lib/es/utils/mergeRefs.d.ts +3 -0
  230. package/lib/es/utils/mergeRefs.js +18 -0
  231. package/lib/es/utils/searchNormalized.d.ts +2 -2
  232. package/lib/es/utils/searchNormalized.js +1 -1
  233. package/lib/es/version.json +1 -1
  234. package/package.json +39 -36
  235. package/types.d.ts +1 -140
  236. package/utils/init.js +1 -0
  237. package/utils/mergeRefs.d.ts +3 -0
  238. package/utils/mergeRefs.js +16 -0
  239. package/utils/searchNormalized.d.ts +2 -2
  240. package/utils/searchNormalized.js +1 -1
  241. package/version.json +1 -1
package/AssetTree.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/AssetTree' {
2
- import React from 'react';
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
- import { default as _AssetTree } from './components/assetTree/AssetTree';
2
- export { _AssetTree as default };
1
+ export { default } from './components/assetTree/AssetTree';
2
+ export * from './components/assetTree/AssetTree';
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/ButtonDropdown' {
2
- import React from 'react';
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
- import { default as _ButtonDropdown } from './components/dropdown/ButtonDropdown';
2
- export { _ButtonDropdown as default };
1
+ export { default } from './components/dropdown/ButtonDropdown';
2
+ export * from './components/dropdown/ButtonDropdown';
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/DropdownSubmenu' {
2
- import React from 'react';
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';
@@ -1,2 +1,2 @@
1
- import { default as _DropdownSubmenu } from './components/dropdown/DropdownSubmenu';
2
- export { _DropdownSubmenu as default };
1
+ export { default } from './components/dropdown/DropdownSubmenu';
2
+ export * from './components/dropdown/DropdownSubmenu';
package/MenuItem.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/MenuItem' {
2
- import React from 'react';
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
- import { default as _MenuItem } from './components/menuItems/MenuItem';
2
- export { _MenuItem as default };
1
+ export { default } from './components/menuItems/MenuItem';
2
+ export * from './components/menuItems/MenuItem';
@@ -0,0 +1,2 @@
1
+ export { default } from './components/menuItems/MenuItemList';
2
+ export * from './components/menuItems/MenuItemList';
@@ -0,0 +1,2 @@
1
+ export { default } from './components/menuItems/MenuItemList';
2
+ export * from './components/menuItems/MenuItemList';
package/MenuItems.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { default } from './components/menuItems/MenuItems';
2
+ export * from './components/menuItems/MenuItems';
package/MenuItems.js ADDED
@@ -0,0 +1,2 @@
1
+ export { default } from './components/menuItems/MenuItems';
2
+ export * from './components/menuItems/MenuItems';
package/Page.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { default } from './components/page/Page';
2
+ export * from './components/page/Page';
package/Page.js ADDED
@@ -0,0 +1,2 @@
1
+ export { default } from './components/page/Page';
2
+ export * from './components/page/Page';
package/Sidebar.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export { default } from './components/sidebars/Sidebar';
2
+ export * from './components/sidebars/Sidebar';
package/Sidebar.js CHANGED
@@ -1 +1,2 @@
1
1
  export { default } from './components/sidebars/Sidebar';
2
+ export * from './components/sidebars/Sidebar';
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/SimpleButtonDropdown' {
2
- import React from 'react';
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';
@@ -1,2 +1,2 @@
1
- import { default as _SimpleButtonDropdown } from './components/dropdown/SimpleButtonDropdown';
2
- export { _SimpleButtonDropdown as default };
1
+ export { default } from './components/dropdown/SimpleButtonDropdown';
2
+ export * from './components/dropdown/SimpleButtonDropdown';
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/SingleButtonDropdown' {
2
- import React from 'react';
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';
@@ -1,2 +1,2 @@
1
- import { default as _SingleButtonDropdown } from './components/dropdown/SingleButtonDropdown';
2
- export { _SingleButtonDropdown as default };
1
+ export { default } from './components/dropdown/SingleButtonDropdown';
2
+ export * from './components/dropdown/SingleButtonDropdown';
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/SplitButtonDropdown' {
2
- import React from 'react';
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';
@@ -1,2 +1,2 @@
1
- import { default as _SplitButtonDropdown } from './components/dropdown/SplitButtonDropdown';
2
- export { _SplitButtonDropdown as default };
1
+ export { default } from './components/dropdown/SplitButtonDropdown';
2
+ export * from './components/dropdown/SplitButtonDropdown';
package/Tree.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/Tree' {
2
- import React from 'react';
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
- import { default as _Tree } from './components/assetTree/Tree';
2
- export { _Tree as default };
1
+ export { default } from './components/assetTree/Tree';
2
+ export * from './components/assetTree/Tree';
package/TreeCategory.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/TreeCategory' {
2
- import React from 'react';
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
- import { default as _TreeCategory } from './components/assetTree/TreeCategory';
2
- export { _TreeCategory as default };
1
+ export { default } from './components/assetTree/TreeCategory';
2
+ export * from './components/assetTree/TreeCategory';
package/TreeOption.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/TreeOption' {
2
- import React from 'react';
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
- import { default as _TreeOption } from './components/assetTree/TreeOption';
2
- export { _TreeOption as default };
1
+ export { default } from './components/assetTree/TreeOption';
2
+ export * from './components/assetTree/TreeOption';
package/TreeSearch.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/TreeSearch' {
2
- import React from 'react';
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
- import { default as _TreeSearch } from './components/assetTree/TreeSearch';
2
- export { _TreeSearch as default };
1
+ export { default } from './components/assetTree/TreeSearch';
2
+ export * from './components/assetTree/TreeSearch';
package/TreeSummary.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/TreeSummary' {
2
- import React from 'react';
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
- import { default as _TreeSummary } from './components/assetTree/TreeSummary';
2
- export { _TreeSummary as default };
1
+ export { default } from './components/assetTree/TreeSummary';
2
+ export * from './components/assetTree/TreeSummary';
@@ -0,0 +1,2 @@
1
+ export { default } from './components/assetTree/TreeSummaryRow';
2
+ export * from './components/assetTree/TreeSummaryRow';
@@ -0,0 +1,2 @@
1
+ export { default } from './components/assetTree/TreeSummaryRow';
2
+ export * from './components/assetTree/TreeSummaryRow';
package/TypeCounter.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/TypeCounter' {
2
- import React from 'react';
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
- import { default as _TypeCounter } from './components/assetTree/TypeCounter';
2
- export { _TypeCounter as default };
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, useEffect, useRef, forwardRef, useImperativeHandle } from 'react';
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
- const getSidebarBodyRef = sidebarRef => head(sidebarRef.current.getElementsByClassName('AssetTreeBody'));
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, maxWidth, minWidth, height, bordered, currentCategoryId, isOpen, useOffscreen, fly, onCategoryChange, onToggleTree, onResizeEnd, children } = props, remainingProps = __rest(props, ["className", "resizable", "width", "maxWidth", "minWidth", "height", "bordered", "currentCategoryId", "isOpen", "useOffscreen", "fly", "onCategoryChange", "onToggleTree", "onResizeEnd", "children"]);
24
- const getSidebarMode = isFly => (isFly ? AssetTree.MODE_FLY : AssetTree.MODE_FLUID);
25
- const [treeWidth, setTreeWidth] = useState(parseInt(width, 10));
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
- useImperativeHandle(ref, () => sidebarRef, []);
42
+ const sidebarRef = useRef(null);
43
+ const mergedRefs = mergeRefs([ref, sidebarRef]);
30
44
  // Update internal state when props change
31
- useEffect(() => setTreeWidth(width), [width]);
32
- useEffect(() => setSidebarMode(getSidebarMode(fly)), [fly]);
33
- const classes = classNames('AssetTree', className, !isOpen && 'closed', bordered && 'panel panel-default', sidebarMode === AssetTree.MODE_FLY ? 'fly' : 'fluid');
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 categoryId = currentCategoryId || 0;
38
- const firstChild = head(children);
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: sidebarRef }, { 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(children, categoryId) : category }))] })), resizable && isOpen && (_jsx(Resizer, { onResizeStart: handleResizeStart, onResize: handleResize, onResizeEnd: handleResizeEnd, direction: Resizer.HORIZONTAL, position: Resizer.RIGHT }))] })));
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.MODE_FLY = 'fly';
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;