@rio-cloud/rio-uikit 0.16.4-beta.13 → 0.16.4-beta.15

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 (179) hide show
  1. package/CustomState.d.ts +2 -5
  2. package/CustomState.js +2 -2
  3. package/EmptyState.d.ts +2 -5
  4. package/EmptyState.js +2 -2
  5. package/ErrorState.d.ts +2 -5
  6. package/ErrorState.js +2 -2
  7. package/ForbiddenState.d.ts +2 -5
  8. package/ForbiddenState.js +2 -2
  9. package/MaintenanceState.d.ts +2 -5
  10. package/MaintenanceState.js +2 -2
  11. package/NotBookedState.d.ts +2 -5
  12. package/NotFoundState.d.ts +2 -5
  13. package/NotFoundState.js +2 -2
  14. package/Notification.d.ts +2 -9
  15. package/Notification.js +2 -2
  16. package/NotificationsContainer.d.ts +2 -5
  17. package/NotificationsContainer.js +2 -2
  18. package/Tag.d.ts +2 -5
  19. package/Tag.js +2 -2
  20. package/TagList.d.ts +1 -5
  21. package/TagList.js +1 -2
  22. package/TagManager.d.ts +2 -5
  23. package/TagManager.js +2 -2
  24. package/Teaser.d.ts +2 -5
  25. package/Teaser.js +2 -2
  26. package/TeaserContainer.d.ts +2 -5
  27. package/TeaserContainer.js +2 -2
  28. package/TimePicker.d.ts +2 -5
  29. package/TimePicker.js +2 -2
  30. package/components/expander/ExpanderPanel.d.ts +1 -0
  31. package/components/expander/ExpanderPanel.js +4 -3
  32. package/components/notification/Notification.d.ts +32 -1
  33. package/components/notification/Notification.js +3 -2
  34. package/components/notification/NotificationsContainer.d.ts +7 -13
  35. package/components/notification/NotificationsContainer.js +2 -8
  36. package/components/saveableInput/SaveableInput.d.ts +34 -1
  37. package/components/saveableInput/SaveableInput.js +28 -6
  38. package/components/states/BaseStateProps.d.ts +66 -0
  39. package/components/states/BaseStateProps.js +2 -0
  40. package/components/states/CustomState.d.ts +4 -14
  41. package/components/states/CustomState.js +13 -40
  42. package/components/states/EmptyState.d.ts +4 -8
  43. package/components/states/EmptyState.js +6 -6
  44. package/components/states/ErrorState.d.ts +4 -8
  45. package/components/states/ErrorState.js +6 -6
  46. package/components/states/ForbiddenState.d.ts +4 -8
  47. package/components/states/ForbiddenState.js +6 -6
  48. package/components/states/MaintenanceState.d.ts +4 -8
  49. package/components/states/MaintenanceState.js +6 -6
  50. package/components/states/NotBookedState.d.ts +9 -19
  51. package/components/states/NotBookedState.js +8 -23
  52. package/components/states/NotFoundState.d.ts +4 -8
  53. package/components/states/NotFoundState.js +6 -6
  54. package/components/states/StateButton.d.ts +27 -0
  55. package/components/states/StateButton.js +13 -0
  56. package/components/states/StateIcon.d.ts +7 -0
  57. package/components/states/StateIcon.js +4 -0
  58. package/components/tag/Tag.d.ts +69 -36
  59. package/components/tag/Tag.js +7 -30
  60. package/components/tag/TagList.d.ts +24 -16
  61. package/components/tag/TagList.js +6 -15
  62. package/components/tagManager/CustomSuggestionItem.d.ts +6 -12
  63. package/components/tagManager/CustomSuggestionItem.js +4 -9
  64. package/components/tagManager/TagManager.d.ts +61 -26
  65. package/components/tagManager/TagManager.js +22 -39
  66. package/components/tagManager/TagManagerItemList.d.ts +6 -13
  67. package/components/tagManager/TagManagerItemList.js +3 -13
  68. package/components/tagManager/TagManagerTag.d.ts +5 -0
  69. package/components/tagManager/TagManagerTag.js +1 -0
  70. package/components/teaser/Teaser.d.ts +93 -50
  71. package/components/teaser/Teaser.js +69 -118
  72. package/components/teaser/TeaserContainer.d.ts +25 -12
  73. package/components/teaser/TeaserContainer.js +10 -23
  74. package/components/timepicker/TimePicker.d.ts +34 -26
  75. package/components/timepicker/TimePicker.js +13 -30
  76. package/components/tooltip/Tooltip.d.ts +4 -0
  77. package/components/tooltip/Tooltip.js +2 -2
  78. package/hooks/useDocumentTitle.d.ts +2 -0
  79. package/hooks/useDocumentTitle.js +9 -0
  80. package/hooks/useIsFirstRender.d.ts +2 -0
  81. package/hooks/useIsFirstRender.js +10 -0
  82. package/index.d.ts +28 -25
  83. package/index.js +28 -25
  84. package/lib/es/CustomState.d.ts +2 -5
  85. package/lib/es/CustomState.js +3 -2
  86. package/lib/es/EmptyState.d.ts +2 -5
  87. package/lib/es/EmptyState.js +3 -2
  88. package/lib/es/ErrorState.d.ts +2 -5
  89. package/lib/es/ErrorState.js +3 -2
  90. package/lib/es/ForbiddenState.d.ts +2 -5
  91. package/lib/es/ForbiddenState.js +3 -2
  92. package/lib/es/MaintenanceState.d.ts +2 -5
  93. package/lib/es/MaintenanceState.js +3 -2
  94. package/lib/es/NotBookedState.d.ts +2 -5
  95. package/lib/es/NotFoundState.d.ts +2 -5
  96. package/lib/es/NotFoundState.js +3 -2
  97. package/lib/es/Notification.d.ts +2 -9
  98. package/lib/es/Notification.js +3 -2
  99. package/lib/es/NotificationsContainer.d.ts +2 -5
  100. package/lib/es/NotificationsContainer.js +3 -2
  101. package/lib/es/Tag.d.ts +2 -5
  102. package/lib/es/Tag.js +3 -2
  103. package/lib/es/TagList.d.ts +1 -5
  104. package/lib/es/TagList.js +5 -3
  105. package/lib/es/TagManager.d.ts +2 -5
  106. package/lib/es/TagManager.js +3 -2
  107. package/lib/es/Teaser.d.ts +2 -5
  108. package/lib/es/Teaser.js +3 -2
  109. package/lib/es/TeaserContainer.d.ts +2 -5
  110. package/lib/es/TeaserContainer.js +3 -2
  111. package/lib/es/TimePicker.d.ts +2 -5
  112. package/lib/es/TimePicker.js +3 -2
  113. package/lib/es/components/expander/ExpanderPanel.d.ts +1 -0
  114. package/lib/es/components/expander/ExpanderPanel.js +4 -3
  115. package/lib/es/components/notification/Notification.d.ts +32 -1
  116. package/lib/es/components/notification/Notification.js +3 -2
  117. package/lib/es/components/notification/NotificationsContainer.d.ts +7 -13
  118. package/lib/es/components/notification/NotificationsContainer.js +2 -8
  119. package/lib/es/components/saveableInput/SaveableInput.d.ts +34 -1
  120. package/lib/es/components/saveableInput/SaveableInput.js +28 -6
  121. package/lib/es/components/states/BaseStateProps.d.ts +66 -0
  122. package/lib/es/components/states/BaseStateProps.js +4 -0
  123. package/lib/es/components/states/CustomState.d.ts +4 -14
  124. package/lib/es/components/states/CustomState.js +14 -41
  125. package/lib/es/components/states/EmptyState.d.ts +4 -8
  126. package/lib/es/components/states/EmptyState.js +5 -6
  127. package/lib/es/components/states/ErrorState.d.ts +4 -8
  128. package/lib/es/components/states/ErrorState.js +5 -6
  129. package/lib/es/components/states/ForbiddenState.d.ts +4 -8
  130. package/lib/es/components/states/ForbiddenState.js +5 -6
  131. package/lib/es/components/states/MaintenanceState.d.ts +4 -8
  132. package/lib/es/components/states/MaintenanceState.js +5 -6
  133. package/lib/es/components/states/NotBookedState.d.ts +9 -19
  134. package/lib/es/components/states/NotBookedState.js +7 -22
  135. package/lib/es/components/states/NotFoundState.d.ts +4 -8
  136. package/lib/es/components/states/NotFoundState.js +5 -6
  137. package/lib/es/components/states/StateButton.d.ts +27 -0
  138. package/lib/es/components/states/StateButton.js +16 -0
  139. package/lib/es/components/states/StateIcon.d.ts +7 -0
  140. package/lib/es/components/states/StateIcon.js +6 -0
  141. package/lib/es/components/tag/Tag.d.ts +69 -36
  142. package/lib/es/components/tag/Tag.js +7 -30
  143. package/lib/es/components/tag/TagList.d.ts +24 -16
  144. package/lib/es/components/tag/TagList.js +6 -15
  145. package/lib/es/components/tagManager/CustomSuggestionItem.d.ts +6 -12
  146. package/lib/es/components/tagManager/CustomSuggestionItem.js +4 -9
  147. package/lib/es/components/tagManager/TagManager.d.ts +61 -26
  148. package/lib/es/components/tagManager/TagManager.js +22 -39
  149. package/lib/es/components/tagManager/TagManagerItemList.d.ts +6 -13
  150. package/lib/es/components/tagManager/TagManagerItemList.js +3 -13
  151. package/lib/es/components/tagManager/TagManagerTag.d.ts +5 -0
  152. package/lib/es/components/tagManager/TagManagerTag.js +2 -0
  153. package/lib/es/components/teaser/Teaser.d.ts +93 -50
  154. package/lib/es/components/teaser/Teaser.js +69 -120
  155. package/lib/es/components/teaser/TeaserContainer.d.ts +25 -12
  156. package/lib/es/components/teaser/TeaserContainer.js +10 -23
  157. package/lib/es/components/timepicker/TimePicker.d.ts +34 -26
  158. package/lib/es/components/timepicker/TimePicker.js +13 -30
  159. package/lib/es/components/tooltip/Tooltip.d.ts +4 -0
  160. package/lib/es/components/tooltip/Tooltip.js +2 -2
  161. package/lib/es/hooks/useDocumentTitle.d.ts +2 -0
  162. package/lib/es/hooks/useDocumentTitle.js +11 -0
  163. package/lib/es/hooks/useIsFirstRender.d.ts +2 -0
  164. package/lib/es/hooks/useIsFirstRender.js +12 -0
  165. package/lib/es/index.d.ts +28 -25
  166. package/lib/es/index.js +46 -30
  167. package/lib/es/types.d.ts +1 -112
  168. package/lib/es/useDocumentTitle.d.ts +2 -0
  169. package/lib/es/useDocumentTitle.js +7 -0
  170. package/lib/es/useIsFirstRender.d.ts +2 -0
  171. package/lib/es/useIsFirstRender.js +7 -0
  172. package/lib/es/version.json +1 -1
  173. package/package.json +29 -23
  174. package/types.d.ts +1 -112
  175. package/useDocumentTitle.d.ts +2 -0
  176. package/useDocumentTitle.js +2 -0
  177. package/useIsFirstRender.d.ts +2 -0
  178. package/useIsFirstRender.js +2 -0
  179. package/version.json +1 -1
package/CustomState.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/CustomState' {
2
- import React from 'react';
3
- import { CustomStateProps } from './types';
4
- export default class CustomState extends React.Component<CustomStateProps> {}
5
- }
1
+ export { default } from './components/states/CustomState';
2
+ export * from './components/states/CustomState';
package/CustomState.js CHANGED
@@ -1,2 +1,2 @@
1
- import { default as _CustomState } from './components/states/CustomState';
2
- export { _CustomState as default };
1
+ export { default } from './components/states/CustomState';
2
+ export * from './components/states/CustomState';
package/EmptyState.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/EmptyState' {
2
- import React from 'react';
3
- import { EmptyStateProps } from './types';
4
- export default class EmptyState extends React.Component<EmptyStateProps> {}
5
- }
1
+ export { default } from './components/states/EmptyState';
2
+ export * from './components/states/EmptyState';
package/EmptyState.js CHANGED
@@ -1,2 +1,2 @@
1
- import { default as _EmptyState } from './components/states/EmptyState';
2
- export { _EmptyState as default };
1
+ export { default } from './components/states/EmptyState';
2
+ export * from './components/states/EmptyState';
package/ErrorState.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/ErrorState' {
2
- import React from 'react';
3
- import { ErrorStateProps } from './types';
4
- export default class ErrorState extends React.Component<ErrorStateProps> {}
5
- }
1
+ export { default } from './components/states/ErrorState';
2
+ export * from './components/states/ErrorState';
package/ErrorState.js CHANGED
@@ -1,2 +1,2 @@
1
- import { default as _ErrorState } from './components/states/ErrorState';
2
- export { _ErrorState as default };
1
+ export { default } from './components/states/ErrorState';
2
+ export * from './components/states/ErrorState';
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/ForbiddenState' {
2
- import React from 'react';
3
- import { ForbiddenStateProps } from './types';
4
- export default class ForbiddenState extends React.Component<ForbiddenStateProps> {}
5
- }
1
+ export { default } from './components/states/ForbiddenState';
2
+ export * from './components/states/ForbiddenState';
package/ForbiddenState.js CHANGED
@@ -1,2 +1,2 @@
1
- import { default as _ForbiddenState } from './components/states/ForbiddenState';
2
- export { _ForbiddenState as default };
1
+ export { default } from './components/states/ForbiddenState';
2
+ export * from './components/states/ForbiddenState';
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/MaintenanceState' {
2
- import React from 'react';
3
- import { MaintenanceStateProps } from './types';
4
- export default class MaintenanceState extends React.Component<MaintenanceStateProps> {}
5
- }
1
+ export { default } from './components/states/MaintenanceState';
2
+ export * from './components/states/MaintenanceState';
@@ -1,2 +1,2 @@
1
- import { default as _MaintenanceState } from './components/states/MaintenanceState';
2
- export { _MaintenanceState as default };
1
+ export { default } from './components/states/MaintenanceState';
2
+ export * from './components/states/MaintenanceState';
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/NotBookedState' {
2
- import React from 'react';
3
- import { NotBookedStateProps } from './types';
4
- export default class NotBookedState extends React.Component<NotBookedStateProps> {}
5
- }
1
+ import { default as _NotBookedState } from './components/states/NotBookedState';
2
+ export { _NotBookedState as default };
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/NotFoundState' {
2
- import React from 'react';
3
- import { NotFoundStateProps } from './types';
4
- export default class NotFoundState extends React.Component<NotFoundStateProps> {}
5
- }
1
+ export { default } from './components/states/NotFoundState';
2
+ export * from './components/states/NotFoundState';
package/NotFoundState.js CHANGED
@@ -1,2 +1,2 @@
1
- import { default as _NotFoundState } from './components/states/NotFoundState';
2
- export { _NotFoundState as default };
1
+ export { default } from './components/states/NotFoundState';
2
+ export * from './components/states/NotFoundState';
package/Notification.d.ts CHANGED
@@ -1,9 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/Notification' {
2
- import { notificationTriggerFunction } from './types';
3
- export default class Notification {
4
- static success: notificationTriggerFunction;
5
- static info: notificationTriggerFunction;
6
- static warning: notificationTriggerFunction;
7
- static error: notificationTriggerFunction;
8
- }
9
- }
1
+ export { default } from './components/notification/Notification';
2
+ export * from './components/notification/Notification';
package/Notification.js CHANGED
@@ -1,2 +1,2 @@
1
- import { default as _Notification } from './components/notification/Notification';
2
- export { _Notification as default };
1
+ export { default } from './components/notification/Notification';
2
+ export * from './components/notification/Notification';
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/NotificationsContainer' {
2
- import React from 'react';
3
- import { NotificationsContainerProps } from './types';
4
- export default class NotificationsContainer extends React.Component<NotificationsContainerProps> {}
5
- }
1
+ export { default } from './components/notification/NotificationsContainer';
2
+ export * from './components/notification/NotificationsContainer';
@@ -1,2 +1,2 @@
1
- import { default as _NotificationsContainer } from './components/notification/NotificationsContainer';
2
- export { _NotificationsContainer as default };
1
+ export { default } from './components/notification/NotificationsContainer';
2
+ export * from './components/notification/NotificationsContainer';
package/Tag.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/Tag' {
2
- import React from 'react';
3
- import { TagProps } from './types';
4
- export default class Tag extends React.Component<TagProps> {}
5
- }
1
+ export { default } from './components/tag/Tag';
2
+ export * from './components/tag/Tag';
package/Tag.js CHANGED
@@ -1,2 +1,2 @@
1
- import { default as _Tag } from './components/tag/Tag';
2
- export { _Tag as default };
1
+ export { default } from './components/tag/Tag';
2
+ export * from './components/tag/Tag';
package/TagList.d.ts CHANGED
@@ -1,5 +1 @@
1
- declare module '@rio-cloud/rio-uikit/TagList' {
2
- import React from 'react';
3
- import { TagListProps } from './types';
4
- export default class TagList extends React.Component<TagListProps> {}
5
- }
1
+ export { default } from './components/tag/TagList';
package/TagList.js CHANGED
@@ -1,2 +1 @@
1
- import { default as _TagList } from './components/tag/TagList';
2
- export { _TagList as default };
1
+ export { default } from './components/tag/TagList';
package/TagManager.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- import React from 'react';
2
- import { TagManagerProps } from './types';
3
-
4
- export { TagManagerTag } from './types';
5
- export default class TagManager extends React.Component<TagManagerProps> {}
1
+ export { default } from './components/tagManager/TagManager';
2
+ export * from './components/tagManager/TagManager';
package/TagManager.js CHANGED
@@ -1,2 +1,2 @@
1
- import { default as _TagManager } from './components/tagManager/TagManager';
2
- export { _TagManager as default };
1
+ export { default } from './components/tagManager/TagManager';
2
+ export * from './components/tagManager/TagManager';
package/Teaser.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/Teaser' {
2
- import React from 'react';
3
- import { TeaserProps } from './types';
4
- export default class Teaser extends React.Component<TeaserProps> {}
5
- }
1
+ export { default } from './components/teaser/Teaser';
2
+ export * from './components/teaser/Teaser';
package/Teaser.js CHANGED
@@ -1,2 +1,2 @@
1
- import { default as _Teaser } from './components/teaser/Teaser';
2
- export { _Teaser as default };
1
+ export { default } from './components/teaser/Teaser';
2
+ export * from './components/teaser/Teaser';
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/TeaserContainer' {
2
- import React from 'react';
3
- import { TeaserContainerProps } from './types';
4
- export default class TeaserContainer extends React.Component<TeaserContainerProps> {}
5
- }
1
+ export { default } from './components/teaser/TeaserContainer';
2
+ export * from './components/teaser/TeaserContainer';
@@ -1,2 +1,2 @@
1
- import { default as _TeaserContainer } from './components/teaser/TeaserContainer';
2
- export { _TeaserContainer as default };
1
+ export { default } from './components/teaser/TeaserContainer';
2
+ export * from './components/teaser/TeaserContainer';
package/TimePicker.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/TimePicker' {
2
- import React from 'react';
3
- import { TimePickerProps } from './types';
4
- export default class TimePicker extends React.Component<TimePickerProps> {}
5
- }
1
+ export { default } from './components/timepicker/TimePicker';
2
+ export * from './components/timepicker/TimePicker';
package/TimePicker.js CHANGED
@@ -1,2 +1,2 @@
1
- import { default as _TimePicker } from './components/timepicker/TimePicker';
2
- export { _TimePicker as default };
1
+ export { default } from './components/timepicker/TimePicker';
2
+ export * from './components/timepicker/TimePicker';
@@ -19,6 +19,7 @@ declare namespace ExpanderPanel {
19
19
  export const className: PropTypes.Requireable<string>;
20
20
  export const headerClassName: PropTypes.Requireable<string>;
21
21
  export const titleClassName: PropTypes.Requireable<string>;
22
+ export const iconClassName: PropTypes.Requireable<string>;
22
23
  export const bodyClassName: PropTypes.Requireable<string>;
23
24
  export const title: PropTypes.Validator<NonNullable<NonNullable<PropTypes.ReactNodeLike>>>;
24
25
  const bsStyle_1: PropTypes.Requireable<string>;
@@ -2,10 +2,10 @@ import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import React, { useEffect, useState } from 'react';
4
4
  import PropTypes from 'prop-types';
5
- import Collapse from '../collapse/Collapse';
6
5
  import classNames from 'classnames';
6
+ import Collapse from '../collapse/Collapse';
7
7
  const ExpanderPanel = props => {
8
- const { bsStyle, className, iconLeft, title, headerClassName, titleClassName, bodyClassName, mountOnEnter, unmountOnExit, onEnter, onEntering, onEntered, onExit, onExiting, onExited, children, onToggle, open } = props, remainingProps = __rest(props, ["bsStyle", "className", "iconLeft", "title", "headerClassName", "titleClassName", "bodyClassName", "mountOnEnter", "unmountOnExit", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "children", "onToggle", "open"]);
8
+ const { bsStyle, className, iconLeft, title, headerClassName, titleClassName, bodyClassName, iconClassName, mountOnEnter, unmountOnExit, onEnter, onEntering, onEntered, onExit, onExiting, onExited, children, onToggle, open } = props, remainingProps = __rest(props, ["bsStyle", "className", "iconLeft", "title", "headerClassName", "titleClassName", "bodyClassName", "iconClassName", "mountOnEnter", "unmountOnExit", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "children", "onToggle", "open"]);
9
9
  const [isOpen, setIsOpen] = useState(open);
10
10
  // Update internal state from external prop change
11
11
  useEffect(() => {
@@ -17,7 +17,7 @@ const ExpanderPanel = props => {
17
17
  onToggle(newState);
18
18
  };
19
19
  const wrapperClassNames = classNames('expander-panel panel', `panel-${bsStyle}`, className);
20
- const iconClassNames = classNames('expander-icon', 'rioglyph', 'rioglyph-chevron-down');
20
+ const iconClassNames = classNames('expander-icon', iconClassName, 'rioglyph', 'rioglyph-chevron-down');
21
21
  const headerClassNames = classNames('panel-heading', isOpen && 'open', iconLeft && 'icon-left', headerClassName && headerClassName);
22
22
  const titleClassNames = classNames('title', titleClassName && titleClassName);
23
23
  const bodyClassNames = classNames('panel-body', bodyClassName && bodyClassName);
@@ -42,6 +42,7 @@ ExpanderPanel.propTypes = {
42
42
  className: PropTypes.string,
43
43
  headerClassName: PropTypes.string,
44
44
  titleClassName: PropTypes.string,
45
+ iconClassName: PropTypes.string,
45
46
  bodyClassName: PropTypes.string,
46
47
  title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
47
48
  bsStyle: PropTypes.oneOf([
@@ -1 +1,32 @@
1
- export default Notification;
1
+ import React from 'react';
2
+ type TriggerFunction = (
3
+ /**
4
+ * The message to be shown.
5
+ */
6
+ message: string | React.ReactNode,
7
+ /**
8
+ * The title to be shown.
9
+ */
10
+ title?: string | React.ReactNode,
11
+ /**
12
+ * The popup timeout in milliseconds.
13
+ *
14
+ * If you do not want it to automatically disappear you can define a very high timeOut.
15
+ */
16
+ timeOut?: number,
17
+ /**
18
+ * A function that gets invoked when the notification is clicked.
19
+ */
20
+ callback?: VoidFunction,
21
+ /**
22
+ * If true, the message gets inserted at the top of the notification stack.
23
+ */
24
+ priority?: boolean) => void;
25
+ type NotificationTypeStub = {
26
+ success: TriggerFunction;
27
+ info: TriggerFunction;
28
+ warning: TriggerFunction;
29
+ error: TriggerFunction;
30
+ };
31
+ declare const _default: NotificationTypeStub;
32
+ export default _default;
@@ -1,4 +1,5 @@
1
+ // @ts-ignore-next-line importsNotUsedAsValues
2
+ import 'react';
3
+ // @ts-ignore-next-line 7016
1
4
  import { NotificationManager as Notification } from 'react-notifications';
2
- // TODO: implement: if callback + missing time => sticky
3
- //const STICKY_TIME = 10000;
4
5
  export default Notification;
@@ -1,14 +1,8 @@
1
+ export type NotificationsContainerProps = {
2
+ /**
3
+ * Defines whether the notification are stacked.
4
+ */
5
+ stacked?: boolean;
6
+ };
7
+ declare const NotificationsContainer: ({ stacked }: NotificationsContainerProps) => import("react/jsx-runtime").JSX.Element;
1
8
  export default NotificationsContainer;
2
- declare function NotificationsContainer({ stacked }: {
3
- stacked: any;
4
- }): import("react/jsx-runtime").JSX.Element;
5
- declare namespace NotificationsContainer {
6
- namespace defaultProps {
7
- const stacked: boolean;
8
- }
9
- namespace propTypes {
10
- const stacked_1: PropTypes.Requireable<boolean>;
11
- export { stacked_1 as stacked };
12
- }
13
- }
14
- import PropTypes from "prop-types";
@@ -1,16 +1,10 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import React from 'react';
3
- import PropTypes from 'prop-types';
2
+ import 'react';
4
3
  import classNames from 'classnames';
4
+ // @ts-ignore-next-line 7016
5
5
  import { NotificationContainer } from 'react-notifications';
6
6
  const NotificationsContainer = ({ stacked }) => {
7
7
  const wrapperClasses = classNames('notification-container-wrapper', stacked && 'stacked');
8
8
  return (_jsx("div", Object.assign({ className: wrapperClasses }, { children: _jsx(NotificationContainer, {}) })));
9
9
  };
10
- NotificationsContainer.defaultProps = {
11
- stacked: false,
12
- };
13
- NotificationsContainer.propTypes = {
14
- stacked: PropTypes.bool,
15
- };
16
10
  export default NotificationsContainer;
@@ -1,4 +1,4 @@
1
- import { type Attributes } from 'react';
1
+ import React, { type Attributes } from 'react';
2
2
  export type SaveableInputProps = {
3
3
  /**
4
4
  * The input placeholder.
@@ -25,6 +25,26 @@ export type SaveableInputProps = {
25
25
  * @returns
26
26
  */
27
27
  onValueChanged?: (value: string, previousValue: string) => void;
28
+ /**
29
+ * Callback function that gets triggered on every input change. Use this to control the component
30
+ * or when implementing key validation.
31
+ * @param keyValue the key value that has been entered
32
+ * @param inputValue the current complete value of the input
33
+ * @returns
34
+ */
35
+ onInputChange?: (keyValue: string, inputValue: string) => void;
36
+ /**
37
+ * Callback function that gets triggered when the user aborts the edit mode. Use this
38
+ * to control the component and handle the resetting of previous value on the outside.
39
+ * @returns
40
+ */
41
+ onEsc?: () => void;
42
+ /**
43
+ * Callback function that gets triggered when the input is in edit mode. Use this
44
+ * to control the component dna to handle the previous value on the outside.
45
+ * @returns
46
+ */
47
+ onEnterEdit?: () => void;
28
48
  /**
29
49
  * Defines the button style: `default` or `primary`.
30
50
  */
@@ -33,6 +53,19 @@ export type SaveableInputProps = {
33
53
  * Additional HTML attributes to be set on the input element.
34
54
  */
35
55
  inputProps?: Attributes;
56
+ /**
57
+ * Adds a given unit to the input.
58
+ */
59
+ unit?: string | React.ReactNode;
60
+ /**
61
+ * Icon class name that shall be used. If defined, the input element is wrapped in an input-group
62
+ * and the icon will be set in an input-addon. Example: `rioglyph-search`.
63
+ */
64
+ icon?: string;
65
+ /**
66
+ * Disables the component so the user cannot enter the edit mode.
67
+ */
68
+ disabled?: boolean;
36
69
  /**
37
70
  * Additional classes to be set on the input itself.
38
71
  */
@@ -9,15 +9,19 @@ import Button from '../../Button';
9
9
  import useKey from '../../hooks/useKey';
10
10
  import useEsc from '../../hooks/useEsc';
11
11
  const DEFAULT_BUTTON_STYLE = 'primary';
12
- // TODO:
12
+ // Features:
13
13
  // [ ] what shall happen when user leaves component while in edit mode (click outside or tab) - close on blur?
14
14
  // [x] avoid save without change
15
15
  // [x] use fixed previous value
16
16
  // [x] enter = save
17
17
  // [x] esc key to abort and leave edit mode
18
18
  // [x] tab focus + enter = go into edit mode
19
+ // [x] validate after each key, i.e for number inputs - use onInputChange callback
20
+ // [x] support form feedback error - wrap it with form-group and feedback classes
21
+ // [x] allow for unit and icon
22
+ // [x] disabled input
19
23
  const SaveableInput = (props) => {
20
- const { placeholder, fixedPreviousValue = '', previousValue = '', value: externalValue = '', onValueChanged = noop, buttonStyle = DEFAULT_BUTTON_STYLE, inputClassName, className, inputProps } = props, remainingProps = __rest(props, ["placeholder", "fixedPreviousValue", "previousValue", "value", "onValueChanged", "buttonStyle", "inputClassName", "className", "inputProps"]);
24
+ const { placeholder, fixedPreviousValue = '', previousValue = '', value: externalValue = '', onValueChanged = noop, onInputChange, onEsc = noop, onEnterEdit = noop, buttonStyle = DEFAULT_BUTTON_STYLE, inputClassName, inputProps, icon, unit, disabled = false, className } = props, remainingProps = __rest(props, ["placeholder", "fixedPreviousValue", "previousValue", "value", "onValueChanged", "onInputChange", "onEsc", "onEnterEdit", "buttonStyle", "inputClassName", "inputProps", "icon", "unit", "disabled", "className"]);
21
25
  const externalOldValue = previousValue || fixedPreviousValue;
22
26
  const [inputValue, setInputValue] = useState(externalValue);
23
27
  const [oldInputValue, setOldInputValue] = useState(externalOldValue);
@@ -57,6 +61,7 @@ const SaveableInput = (props) => {
57
61
  setInputValue(initialInputValueRef.current);
58
62
  setOldInputValue(initialOldInputValueRef.current);
59
63
  setEditInput(false);
64
+ onEsc();
60
65
  }
61
66
  });
62
67
  const handleToggleInput = () => {
@@ -68,23 +73,40 @@ const SaveableInput = (props) => {
68
73
  initialInputValueRef.current = inputValue;
69
74
  initialOldInputValueRef.current = oldInputValue;
70
75
  }
76
+ onEnterEdit();
71
77
  }
72
78
  else {
73
79
  setEditInput(false);
80
+ // In case the new input value has not changed to the initial value
81
+ // reset the internal old value to the initial
74
82
  if (initialInputValueRef.current !== inputValue) {
75
83
  setOldInputValue(initialInputValueRef.current);
76
84
  onValueChanged(inputValue, oldInputValue);
77
85
  }
78
86
  }
79
87
  };
80
- const handleInputChange = (event) => setInputValue(event.target.value);
88
+ const handleInputChange = (event) => {
89
+ var _a;
90
+ // Only update internal value if the external "InputChange" callback function is not defined
91
+ // as it will be used in a controlled way
92
+ if (onInputChange) {
93
+ // Use type assertion to access nativeEvent.data
94
+ const nativeEventData = (_a = event.nativeEvent) === null || _a === void 0 ? void 0 : _a.data;
95
+ if (nativeEventData) {
96
+ onInputChange(nativeEventData, event.currentTarget.value);
97
+ }
98
+ return;
99
+ }
100
+ setInputValue(event.target.value);
101
+ };
81
102
  const handleFocus = () => setIsFocused(true);
82
103
  const handleBlur = () => setIsFocused(false);
83
104
  const showOldValue = !isEmpty(oldInputValue) && oldInputValue !== inputValue && !editInput;
84
105
  const wrapperClasses = classNames('form-group', className);
85
- const inputClasses = classNames('form-control', showOldValue && 'padding-bottom-0 padding-top-10 text-size-12', inputClassName);
106
+ const inputClasses = classNames('form-control', showOldValue && 'padding-bottom-0 padding-top-10 text-size-12', unit && 'padding-right-50', // This value is not perfect as with longer units it might conflict with the value
107
+ inputClassName);
108
+ const oldValueClasses = classNames('position-absolute', 'top-2', 'left-10', 'margin-left-3', 'text-size-10', 'text-decoration-line-through', icon && 'padding-left-20');
86
109
  const buttonIconClasses = classNames('rioglyph', editInput ? 'rioglyph-ok' : 'rioglyph-pencil');
87
- return (_jsx("div", Object.assign({}, remainingProps, { className: wrapperClasses }, { children: _jsxs("div", Object.assign({ className: 'input-group' }, { children: [_jsx("input", Object.assign({ type: 'text', ref: inputRef, placeholder: placeholder, className: inputClasses, value: inputValue, onChange: handleInputChange, onFocus: handleFocus, onBlur: handleBlur, disabled: !editInput }, inputProps)), showOldValue && (_jsx("div", Object.assign({ className: 'position-absolute top-2 left-10 ' +
88
- 'margin-left-3 text-size-10 text-decoration-line-through' }, { children: oldInputValue }))), _jsx("div", Object.assign({ className: 'input-group-btn' }, { children: _jsx(Button, Object.assign({ bsStyle: buttonStyle, iconOnly: true, onClick: handleToggleInput }, { children: _jsx("span", { className: buttonIconClasses }) })) }))] })) })));
110
+ return (_jsx("div", Object.assign({}, remainingProps, { className: wrapperClasses }, { children: _jsxs("div", Object.assign({ className: 'input-group' }, { children: [icon && (_jsx("span", Object.assign({ className: 'input-group-addon' }, { children: _jsx("span", { className: `rioglyph ${icon}`, "aria-hidden": 'true' }) }))), _jsx("input", Object.assign({ type: 'text', ref: inputRef, placeholder: placeholder, className: inputClasses, value: inputValue, onChange: handleInputChange, onFocus: handleFocus, onBlur: handleBlur, disabled: !editInput }, inputProps)), unit && _jsx("div", Object.assign({ className: 'position-absolute right-0 margin-right-50' }, { children: unit })), showOldValue && _jsx("div", Object.assign({ className: oldValueClasses }, { children: oldInputValue })), _jsx("div", Object.assign({ className: 'input-group-btn' }, { children: _jsx(Button, Object.assign({ bsStyle: buttonStyle, iconOnly: true, onClick: handleToggleInput, disabled: disabled }, { children: _jsx("span", { className: buttonIconClasses }) })) }))] })) })));
89
111
  };
90
112
  export default SaveableInput;
@@ -0,0 +1,66 @@
1
+ import React from 'react';
2
+ import type { TextAlignment } from '../../values/TextAlignment';
3
+ import type { StateButtonProps } from './StateButton';
4
+ import type { StateIconProps } from './StateIcon';
5
+ export type BaseStateProps = {
6
+ /**
7
+ * The icon to be shown.
8
+ *
9
+ * Default icons are defined for all states.
10
+ */
11
+ icon?: string;
12
+ /**
13
+ * List of icons to show instead a single icon.
14
+ *
15
+ * @default []
16
+ */
17
+ icons?: StateIconProps[];
18
+ /**
19
+ * Custom Image if needed.
20
+ */
21
+ image?: React.ReactNode;
22
+ /**
23
+ * The headline to be shown.
24
+ */
25
+ headline?: string | React.ReactNode;
26
+ /**
27
+ * The text to display.
28
+ */
29
+ message?: string | React.ReactNode;
30
+ /**
31
+ * Definitions for the buttons to show.
32
+ *
33
+ * @default []
34
+ */
35
+ buttons?: StateButtonProps[];
36
+ /**
37
+ * Defines whether to use 100% width or default width.
38
+ *
39
+ * Note: Only to be used for special cases on the CustomState component.
40
+ *
41
+ * @default false
42
+ */
43
+ fullWidth?: boolean;
44
+ /**
45
+ * Smaller icon and headline size.
46
+ *
47
+ * @default false
48
+ */
49
+ condensed?: boolean;
50
+ /**
51
+ * Defines where the panel is aligned.
52
+ *
53
+ * Possible values are: 'left', 'center' and 'right'.
54
+ *
55
+ * @default 'center'
56
+ */
57
+ alignment?: TextAlignment;
58
+ /**
59
+ * Optional class names for the wrapper.
60
+ */
61
+ outerClassName?: string;
62
+ /**
63
+ * Optional class names for the content.
64
+ */
65
+ innerClassName?: string;
66
+ };
@@ -0,0 +1,2 @@
1
+ // @ts-ignore-next-line importsNotUsedAsValues
2
+ import 'react';
@@ -1,15 +1,5 @@
1
+ import { type PropsWithChildren } from 'react';
2
+ import type { BaseStateProps } from './BaseStateProps';
3
+ export type CustomStateProps = BaseStateProps;
4
+ declare const CustomState: (props: PropsWithChildren<CustomStateProps>) => import("react/jsx-runtime").JSX.Element;
1
5
  export default CustomState;
2
- declare function CustomState(props: any): import("react/jsx-runtime").JSX.Element;
3
- declare namespace CustomState {
4
- export namespace defaultProps {
5
- export const icon: string;
6
- export const icons: never[];
7
- export const buttons: never[];
8
- export { ALIGN_CENTER as alignment };
9
- export const fullWidth: boolean;
10
- export const condensed: boolean;
11
- }
12
- export { baseStatePropTypes as propTypes };
13
- }
14
- import { ALIGN_CENTER } from "./baseStatePropTypes";
15
- import { baseStatePropTypes } from "./baseStatePropTypes";