@rio-cloud/rio-uikit 0.15.0-beta-49 → 0.16.0-beta-1

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 (207) hide show
  1. package/README.md +231 -187
  2. package/lib/components/actionBarItem/ActionBarItem.js +4 -4
  3. package/lib/components/actionBarItem/ActionBarItemPopoverContent.js +43 -0
  4. package/lib/components/actionBarItem/ActionBarOverlay.js +8 -3
  5. package/lib/components/applicationHeader/AppMenuDropdown.js +9 -13
  6. package/lib/components/applicationLayout/ApplicationLayout.js +7 -9
  7. package/lib/components/applicationLayout/ApplicationLayoutBody.js +5 -3
  8. package/lib/components/assetTree/AssetTree.js +1 -1
  9. package/lib/components/assetTree/AssetTree.less +2 -2
  10. package/lib/components/assetTree/Tree.js +2 -2
  11. package/lib/components/assetTree/TreeLeaf.js +9 -9
  12. package/lib/components/bottomSheet/BottomSheet.js +11 -7
  13. package/lib/components/browserWarning/BrowserWarningMessageDE.js +1 -1
  14. package/lib/components/browserWarning/BrowserWarningMessageEN.js +1 -1
  15. package/lib/components/carousel/Carousel.js +7 -426
  16. package/lib/components/checkbox/Checkbox.js +4 -4
  17. package/lib/components/clearableInput/ClearableInput.less +1 -1
  18. package/lib/components/datepicker/DatePicker.js +51 -73
  19. package/lib/components/datepicker/DatePicker.less +31 -5
  20. package/lib/components/dropdown/ButtonDropdown.js +149 -181
  21. package/lib/components/listMenu/ListMenu.js +40 -23
  22. package/lib/components/numberControl/NumberControl.js +4 -0
  23. package/lib/components/numberInput/NumberInput.js +21 -20
  24. package/lib/components/onboarding/OnboardingTip.js +9 -9
  25. package/lib/components/states/NotBookedState.js +2 -2
  26. package/lib/components/table/TableSettingsDialogFooter.js +1 -1
  27. package/lib/components/teaser/Teaser.js +1 -1
  28. package/lib/components/teaser/TeaserContainer.js +8 -8
  29. package/lib/components/tooltip/Tooltip.js +4 -4
  30. package/lib/components/tooltip/Tooltip.less +0 -10
  31. package/lib/es/DeviceUtils.d.ts +4 -2
  32. package/lib/es/SortDirection.d.ts +5 -0
  33. package/lib/es/deviceUtils.js +12 -0
  34. package/lib/hooks/useClipboard.js +2 -2
  35. package/lib/style/css/_exports/man-uikit.less +7 -5
  36. package/lib/style/css/_exports/rio-buyButton.less +30 -41
  37. package/lib/style/css/_exports/rio-uikit-core.less +105 -127
  38. package/lib/style/css/_exports/rio-uikit-print-utilities.less +6 -11
  39. package/lib/style/css/_exports/rio-uikit-responsive-utilities.less +6 -11
  40. package/lib/style/css/_exports/rio-uikit.less +5 -4
  41. package/lib/style/css/_exports/rio-website.less +110 -13
  42. package/lib/style/css/_exports/vw-uikit.less +10 -8
  43. package/lib/style/css/animations/_imports.less +9 -0
  44. package/lib/style/css/animations/collapse.less +16 -0
  45. package/lib/style/css/animations/fade.less +28 -0
  46. package/lib/style/css/animations/pinging.less +7 -0
  47. package/lib/style/css/animations/rotate.less +52 -0
  48. package/lib/style/css/animations/scale.less +35 -0
  49. package/lib/style/css/animations/slide.less +39 -0
  50. package/lib/style/css/animations/spinning.less +4 -0
  51. package/lib/style/css/animations/transition.less +129 -0
  52. package/lib/style/css/animations/translate.less +28 -0
  53. package/lib/style/css/bootstrap/badges.less +0 -12
  54. package/lib/style/css/bootstrap/dropdowns.less +10 -3
  55. package/lib/style/css/bootstrap/forms.less +38 -36
  56. package/lib/style/css/bootstrap/input-groups.less +4 -0
  57. package/lib/style/css/bootstrap/mixins/forms.less +1 -1
  58. package/lib/style/css/bootstrap/type.less +11 -4
  59. package/lib/style/css/components/Activity.less +93 -0
  60. package/lib/style/css/components/ApplicationHeader.less +438 -0
  61. package/lib/style/css/components/ApplicationLayout.less +236 -0
  62. package/lib/style/css/components/AssetTree.less +443 -0
  63. package/lib/style/css/components/AutoSuggest.less +22 -0
  64. package/lib/style/css/components/BottomSheet.less +14 -0
  65. package/lib/style/css/components/Carousel.less +212 -0
  66. package/lib/style/css/components/Checkbox.less +224 -0
  67. package/lib/style/css/components/ClearableInput.less +115 -0
  68. package/lib/style/css/components/Counter.less +142 -0
  69. package/lib/style/css/components/DataTabs.less +100 -0
  70. package/lib/style/css/components/DatePicker.less +391 -0
  71. package/lib/style/css/components/Dialog.less +482 -0
  72. package/lib/style/css/components/Dropdown.less +186 -0
  73. package/lib/style/css/components/Expander.less +196 -0
  74. package/lib/style/css/components/FilePicker.less +8 -0
  75. package/lib/style/css/components/ListMenu.less +77 -0
  76. package/lib/style/css/components/MapHere.less +91 -0
  77. package/lib/style/css/components/MapMarker.less +347 -0
  78. package/lib/style/css/components/MapSettings.less +140 -0
  79. package/lib/style/css/components/NoData.less +8 -0
  80. package/lib/style/css/components/Notification.less +234 -0
  81. package/lib/style/css/components/RadioButton.less +173 -0
  82. package/lib/style/css/components/Resizer.less +43 -0
  83. package/lib/style/css/components/Select.less +274 -0
  84. package/lib/style/css/components/Sidebar.less +157 -0
  85. package/lib/style/css/components/Slider.less +278 -0
  86. package/lib/style/css/components/Spinner.less +49 -0
  87. package/lib/style/css/components/StatsWidget.less +111 -0
  88. package/lib/style/css/components/SteppedProgressBar.less +323 -0
  89. package/lib/style/css/components/SupportMarker.less +34 -0
  90. package/lib/style/css/components/Switch.less +145 -0
  91. package/lib/style/css/components/TableSettingsDialog.less +96 -0
  92. package/lib/style/css/components/TableSortArrows.less +54 -0
  93. package/lib/style/css/components/Tag.less +246 -0
  94. package/lib/style/css/components/TagManager.less +4 -0
  95. package/lib/style/css/components/Teaser.less +12 -0
  96. package/lib/style/css/components/Timeline.less +69 -0
  97. package/lib/style/css/components/Tooltip.less +230 -0
  98. package/lib/style/css/design/alerts.less +55 -0
  99. package/lib/style/css/design/aspect-ratio.less +23 -0
  100. package/lib/style/css/design/badges.less +120 -0
  101. package/lib/style/css/design/blockquote.less +49 -0
  102. package/lib/style/css/design/border.less +192 -0
  103. package/lib/style/css/design/breadcrumbs.less +20 -0
  104. package/lib/style/css/design/button-groups.less +194 -0
  105. package/lib/style/css/design/buttons.less +540 -0
  106. package/lib/style/css/design/callouts.less +27 -0
  107. package/lib/style/css/design/caret.less +28 -0
  108. package/lib/style/css/design/close.less +12 -0
  109. package/lib/style/css/design/code.less +45 -0
  110. package/lib/style/css/design/colors.less +202 -0
  111. package/lib/style/css/design/cols.less +56 -0
  112. package/lib/style/css/design/container.less +29 -0
  113. package/lib/style/css/design/cursors.less +19 -0
  114. package/lib/style/css/design/custom.less +20 -0
  115. package/lib/style/css/design/ellipsis.less +46 -0
  116. package/lib/style/css/design/flexgrid.less +7 -0
  117. package/lib/style/css/design/fonts.less +318 -0
  118. package/lib/style/css/design/form-input-groups.less +245 -0
  119. package/lib/style/css/design/form-inputs.less +655 -0
  120. package/lib/style/css/design/iframe.less +80 -0
  121. package/lib/style/css/design/images.less +47 -0
  122. package/lib/style/css/design/labels.less +66 -0
  123. package/lib/style/css/design/list-group.less +95 -0
  124. package/lib/style/css/design/navs.less +254 -0
  125. package/lib/style/css/design/normalize.less +436 -0
  126. package/lib/style/css/design/opacity.less +26 -0
  127. package/lib/style/css/design/overflow.less +1 -0
  128. package/lib/style/css/design/pagination.less +161 -0
  129. package/lib/style/css/design/panels.less +105 -0
  130. package/lib/style/css/design/popovers.less +117 -0
  131. package/lib/style/css/design/position.less +16 -0
  132. package/lib/style/css/design/progress-bars.less +131 -0
  133. package/lib/style/css/design/responsive/_imports.less +68 -0
  134. package/lib/style/css/design/responsive/backgrounds.less +32 -0
  135. package/lib/style/css/design/responsive/display.less +9 -0
  136. package/lib/style/css/design/responsive/flexgrid.less +75 -0
  137. package/lib/style/css/design/responsive/floating.less +4 -0
  138. package/lib/style/css/design/responsive/gap.less +41 -0
  139. package/lib/style/css/design/responsive/hyphens.less +14 -0
  140. package/lib/style/css/design/responsive/margin.less +127 -0
  141. package/lib/style/css/design/responsive/overflow.less +16 -0
  142. package/lib/style/css/design/responsive/padding.less +71 -0
  143. package/lib/style/css/design/responsive/position.less +102 -0
  144. package/lib/style/css/design/responsive/sizing.less +115 -0
  145. package/lib/style/css/design/responsive/text.less +71 -0
  146. package/lib/style/css/design/responsive/visibility.less +115 -0
  147. package/lib/style/css/design/responsive-embed.less +31 -0
  148. package/lib/style/css/design/responsive-video.less +22 -0
  149. package/lib/style/css/design/rioglyph.less +24 -0
  150. package/lib/style/css/design/rounded.less +44 -0
  151. package/lib/style/css/design/shadows.less +65 -0
  152. package/lib/style/css/design/tables.less +976 -0
  153. package/lib/style/css/design/text.less +201 -0
  154. package/lib/style/css/design/theme.less +200 -0
  155. package/lib/style/css/design/thumbnails.less +29 -0
  156. package/lib/style/css/design/transition.less +33 -0
  157. package/lib/style/css/design/type.less +159 -0
  158. package/lib/style/css/design/utilities.less +75 -0
  159. package/lib/style/css/design/visibilty.less +38 -0
  160. package/lib/style/css/design/wells.less +17 -0
  161. package/lib/style/css/design/z-index.less +21 -0
  162. package/lib/style/css/mapping/breakpoint-map.less +44 -0
  163. package/lib/style/css/mapping/color-map.less +200 -0
  164. package/lib/style/css/mapping/cols-map.less +15 -0
  165. package/lib/style/css/mapping/numbers-map.less +16 -0
  166. package/lib/style/css/mapping/positions-map.less +21 -0
  167. package/lib/style/css/mapping/sizes-map.less +129 -0
  168. package/lib/style/css/mapping/spacings-map.less +28 -0
  169. package/lib/style/css/mixins/_mixins.less +13 -0
  170. package/lib/style/css/mixins/alerts.less +13 -0
  171. package/lib/style/css/mixins/border-radius.less +16 -0
  172. package/lib/style/css/mixins/buttons.less +117 -0
  173. package/lib/style/css/mixins/clearfix.less +9 -0
  174. package/lib/style/css/mixins/cols.less +59 -0
  175. package/lib/style/css/mixins/forms.less +61 -0
  176. package/lib/style/css/mixins/panels.less +27 -0
  177. package/lib/style/css/mixins/placeholder.less +17 -0
  178. package/lib/style/css/mixins/reset.less +27 -0
  179. package/lib/style/css/mixins/sizings.less +21 -0
  180. package/lib/style/css/mixins/spinner.less +30 -0
  181. package/lib/style/css/mixins/table.less +26 -0
  182. package/lib/style/css/mixins/tabs.less +4 -0
  183. package/lib/style/css/mixins/text.less +5 -0
  184. package/lib/style/css/print/print.less +1 -4
  185. package/lib/style/css/rio-theme/alerts.less +23 -61
  186. package/lib/style/css/rio-theme/badges.less +47 -12
  187. package/lib/style/css/rio-theme/blockquote.less +14 -97
  188. package/lib/style/css/rio-theme/buttons.less +32 -46
  189. package/lib/style/css/rio-theme/dropdowns.less +2 -2
  190. package/lib/style/css/rio-theme/forms.less +49 -20
  191. package/lib/style/css/rio-theme/input-groups.less +44 -25
  192. package/lib/style/css/rio-theme/mixins/alerts.less +13 -1
  193. package/lib/style/css/rio-theme/navbar.less +1 -1
  194. package/lib/style/css/rio-theme/variables.less +1 -0
  195. package/lib/style/css/shared/colors.json +1 -1
  196. package/lib/style/css/shared/colors.less +11 -8
  197. package/lib/style/css/shared/text.less +6 -5
  198. package/lib/style/css/utils/responsive/grid.less +15 -6
  199. package/lib/style/css/utils/rounded.less +1 -0
  200. package/lib/style/css/variables.less +179 -0
  201. package/lib/style/fonts/rioglyph/rioglyph.less +1 -11
  202. package/lib/types.ts +45 -59
  203. package/lib/utils/buttonEffect.js +11 -4
  204. package/lib/utils/deviceUtils.js +28 -37
  205. package/lib/utils/init.js +174 -0
  206. package/lib/version.json +1 -1
  207. package/package.json +79 -50
@@ -2,7 +2,7 @@
2
2
 
3
3
  @font-face {
4
4
  font-family: "rioglyph";
5
- src: url("rioglyph.woff?42f54bea5465197e01760c2a6ef8fc1d") format("woff");
5
+ src: url("rioglyph.woff?4f89ef51d7bec2188389c1c1ee44ac59") format("woff");
6
6
  font-weight: normal;
7
7
  font-style: normal;
8
8
  }
@@ -24,16 +24,6 @@
24
24
  -moz-osx-font-smoothing: grayscale;
25
25
  }
26
26
 
27
- .rioglyph.spinning:before {
28
- display: inline-block;
29
- animation: spinning 1s linear infinite;
30
- }
31
-
32
- @keyframes spinning {
33
- from { transform: rotate(0deg) }
34
- to { transform: rotate(359deg) }
35
- }
36
-
37
27
  @rioglyph-addressbook: "\f16b";
38
28
  .rioglyph-addressbook:before,
39
29
  .hover-rioglyph-addressbook:hover:before {
package/lib/types.ts CHANGED
@@ -60,11 +60,14 @@ export interface AnimatedNumberProps {
60
60
  export interface ApplicationHeaderProps {
61
61
  label?: React.ReactNode;
62
62
  homeRoute?: React.ReactNode;
63
+ showHomeIcon?: boolean;
63
64
  appNavigator?: React.ReactNode;
64
65
  appNavigatorClassName?: string;
65
66
  appMenuItems?: ModulePropTypes[];
66
67
  navItems?: ModulePropTypes[];
67
68
  actionBarItems: React.ReactNode[];
69
+ onMount?: Function;
70
+ onUnmount?: Function;
68
71
  className?: string;
69
72
  }
70
73
 
@@ -502,6 +505,8 @@ export interface DatePickerProps extends DatetimepickerProps {
502
505
  clearableInput?: boolean;
503
506
  minWidth?: number;
504
507
  onChange?: (value: Moment | string) => void;
508
+ mandatory?: boolean;
509
+ dateValidation?: (date: Date | string | Moment) => boolean;
505
510
  }
506
511
 
507
512
  export interface DateRangePickerCustomPresets {
@@ -693,7 +698,20 @@ export interface Line {
693
698
  dataUnit?: string;
694
699
  strokeColor: string;
695
700
  legendType: 'line' | 'plainline' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye';
696
- type: 'basis' | 'basisClosed' | 'basisOpen' | 'linear' | 'linearClosed' | 'natural' | 'monotoneX' | 'monotoneY' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter' | Function;
701
+ type:
702
+ | 'basis'
703
+ | 'basisClosed'
704
+ | 'basisOpen'
705
+ | 'linear'
706
+ | 'linearClosed'
707
+ | 'natural'
708
+ | 'monotoneX'
709
+ | 'monotoneY'
710
+ | 'monotone'
711
+ | 'step'
712
+ | 'stepBefore'
713
+ | 'stepAfter'
714
+ | Function;
697
715
  isAnimationActive?: boolean;
698
716
  onClick?: Function;
699
717
  }
@@ -720,12 +738,14 @@ export interface ListMenuItems {
720
738
  group?: string | React.ReactNode;
721
739
  groupNavItem?: React.ReactNode;
722
740
  navItems: NavItems[];
741
+ isSubItem?: boolean;
723
742
  }
724
743
 
725
744
  export interface ListMenuProps {
726
745
  menuItems: ListMenuItems[];
727
746
  enableFilter?: boolean;
728
747
  focusFilter?: boolean;
748
+ filterKey?: string;
729
749
  filterPlaceholder?: string;
730
750
  notFoundMessage?: string | React.ReactNode;
731
751
  groupClassName?: string;
@@ -1013,7 +1033,7 @@ export interface NotBookedStateProps {
1013
1033
  headline: string | React.ReactNode;
1014
1034
  message: string | React.ReactNode;
1015
1035
  buttons?: object[];
1016
- features?: Array<React.ReactNode>;
1036
+ features?: React.ReactNode[];
1017
1037
  condensed?: boolean;
1018
1038
  fullWidth?: boolean;
1019
1039
  image?: React.ReactNode;
@@ -1123,7 +1143,7 @@ export interface OnboardingTipProps {
1123
1143
  children?: any;
1124
1144
  width?: tooltipWidth;
1125
1145
  preventOverflow?: boolean;
1126
- popperConfig?: any;
1146
+ popperConfig?: object;
1127
1147
  }
1128
1148
 
1129
1149
  interface delayProp {
@@ -1283,7 +1303,7 @@ export interface ReleaseNotesProps {
1283
1303
  releaseNotes: {
1284
1304
  [key: string]: {
1285
1305
  date: string;
1286
- content: Array<HTMLElement | React.ReactElement>;
1306
+ content: (HTMLElement | React.ReactElement)[];
1287
1307
  };
1288
1308
  };
1289
1309
  }
@@ -1297,7 +1317,7 @@ export interface ReleaseNotesDialogProps {
1297
1317
  translatedReleaseNotes: {
1298
1318
  [key: string]: {
1299
1319
  date: string;
1300
- content: Array<HTMLElement | React.ReactElement>;
1320
+ content: (HTMLElement | React.ReactElement)[];
1301
1321
  };
1302
1322
  };
1303
1323
  currentVersion: string;
@@ -1462,7 +1482,7 @@ export interface SimpleButtonDropdownProps {
1462
1482
  iconOnly?: boolean;
1463
1483
  noCaret?: boolean;
1464
1484
  splitButton?: boolean;
1465
- autoDropDirection?: boolean;
1485
+ usePortal?: boolean;
1466
1486
  items: MenuItemProps[];
1467
1487
  className?: string;
1468
1488
  dropdownClassName?: string;
@@ -1472,6 +1492,7 @@ export interface SimpleButtonDropdownProps {
1472
1492
  onOpen?: Function;
1473
1493
  onClose?: Function;
1474
1494
  customDropdown?: React.ReactNode;
1495
+ popperConfig?: object;
1475
1496
  }
1476
1497
 
1477
1498
  export interface SimpleClusterLayerProps {
@@ -1565,8 +1586,10 @@ export interface SimpleTooltipProps {
1565
1586
  | OverlayTriggerPlacement.LEFT_START
1566
1587
  | OverlayTriggerPlacement.LEFT
1567
1588
  | OverlayTriggerPlacement.LEFT_END;
1568
- overlay: React.ReactNode;
1589
+ content: string | React.ReactNode;
1569
1590
  trigger?: 'click' | 'hover' | 'focus';
1591
+ targetRef?: React.MutableRefObject<object>;
1592
+ children: React.ReactNode;
1570
1593
  }
1571
1594
 
1572
1595
  export interface SaveDialogProps {
@@ -1598,18 +1621,6 @@ export interface SpinnerProps {
1598
1621
  text?: string;
1599
1622
  }
1600
1623
 
1601
- export interface SingleMapMarkerProps {
1602
- bearing?: number;
1603
- name?: string | React.ReactNode;
1604
- warningCount?: number;
1605
- exceptionCount?: number;
1606
- active?: boolean;
1607
- clickable?: boolean;
1608
- moving?: boolean;
1609
- iconNames?: string[];
1610
- markerColor?: markerColor;
1611
- }
1612
-
1613
1624
  export enum SortDirection {
1614
1625
  ASCENDING = 'asc',
1615
1626
  DESCENDING = 'desc',
@@ -1999,10 +2010,7 @@ export interface TypeCounterProps {
1999
2010
 
2000
2011
  // U --------------------------------------------------------------------------------------------------
2001
2012
 
2002
- export type UseAfterMount = (
2003
- callback: () => void,
2004
- deps?: any[]
2005
- ) => void;
2013
+ export type UseAfterMount = (callback: () => void, deps?: any[]) => void;
2006
2014
 
2007
2015
  export type UseClickOutside<T extends HTMLElement = any> = (
2008
2016
  callback: () => void,
@@ -2020,19 +2028,15 @@ export type UseDebugInfo = (
2020
2028
  componentName: string,
2021
2029
  props: object
2022
2030
  ) => {
2023
- count: number,
2024
- changedProps: any,
2025
- timeSinceLastRender: number,
2026
- lastRenderTimestamp: number,
2031
+ count: number;
2032
+ changedProps: any;
2033
+ timeSinceLastRender: number;
2034
+ lastRenderTimestamp: number;
2027
2035
  };
2028
2036
 
2029
- export type UseEffectOnce = (
2030
- callback: () => void
2031
- ) => void;
2037
+ export type UseEffectOnce = (callback: () => void) => void;
2032
2038
 
2033
- export type UseElementSize = (
2034
- elementRef: { current: Element; }
2035
- ) => [number, number];
2039
+ export type UseElementSize = (elementRef: { current: Element }) => [number, number];
2036
2040
 
2037
2041
  export type UseEsc<T extends keyof WindowEventMap> = (callback: (event: WindowEventMap[T]) => any) => void;
2038
2042
 
@@ -2043,10 +2047,7 @@ export type UseEvent<T extends keyof WindowEventMap> = (
2043
2047
  target?: HTMLElement
2044
2048
  ) => void;
2045
2049
 
2046
- export type UseInterval = (
2047
- callback: () => void,
2048
- delay?: number
2049
- ) => React.MutableRefObject<object>;
2050
+ export type UseInterval = (callback: () => void, delay?: number) => React.MutableRefObject<object>;
2050
2051
 
2051
2052
  export type UseKey<T extends keyof WindowEventMap> = (
2052
2053
  callback: (event: WindowEventMap[T]) => any,
@@ -2059,34 +2060,19 @@ export type UseOnlineStatus = () => boolean;
2059
2060
  export type UseOnScreen = (
2060
2061
  ref: React.MutableRefObject<object>,
2061
2062
  options?: {
2062
- rootMargins?: string,
2063
- threshold?: number | number[]
2063
+ rootMargins?: string;
2064
+ threshold?: number | number[];
2064
2065
  }
2065
2066
  ) => boolean;
2066
2067
 
2067
2068
  export type UseRenderCount = () => number;
2068
2069
 
2069
- export type UseStateWithValidation = (
2070
- validationFn: Function,
2071
- initialValue: any
2072
- ) => [any, Function, boolean];
2070
+ export type UseStateWithValidation = (validationFn: Function, initialValue: any) => [any, Function, boolean];
2073
2071
 
2074
- export type UseLocalStorage = (
2075
- key: string,
2076
- defaultValue: any
2077
- ) => [any, Function, Function];
2072
+ export type UseLocalStorage = (key: string, defaultValue: any) => [any, Function, Function];
2078
2073
 
2079
- export type UseSessionStorage = (
2080
- key: string,
2081
- defaultValue: any
2082
- ) => [any, Function, Function];
2074
+ export type UseSessionStorage = (key: string, defaultValue: any) => [any, Function, Function];
2083
2075
 
2084
- export type UseTimeout = (
2085
- callback: () => void,
2086
- delay?: number
2087
- ) => React.MutableRefObject<object>;
2076
+ export type UseTimeout = (callback: () => void, delay?: number) => React.MutableRefObject<object>;
2088
2077
 
2089
- export type UseWindowResize = (
2090
- callback: () => void,
2091
- timeout?: number
2092
- ) => void;
2078
+ export type UseWindowResize = (callback: () => void, timeout?: number) => void;
@@ -37,10 +37,17 @@ var isTargetEligibleForEffect = function isTargetEligibleForEffect(target) {
37
37
  }
38
38
 
39
39
  var className = target.className;
40
- var isButton = className.includes('btn ');
41
- var isNotButtonComponent = !className.includes('btn-component');
42
- var isNotDisabled = !className.includes('disabled');
43
- return isButton && isNotButtonComponent && isNotDisabled;
40
+
41
+ if (typeof className === 'string' || typeof className === 'array') {
42
+ var isButton = className.includes('btn ');
43
+ var isNotButtonComponent = !className.includes('btn-component');
44
+ var isNotLinkButton = !className.includes('btn-link');
45
+ var isNotActionButton = !className.includes('btn-action');
46
+ var isNotDisabled = !className.includes('disabled');
47
+ return isButton && isNotButtonComponent && isNotDisabled && isNotLinkButton && isNotActionButton;
48
+ }
49
+
50
+ return false;
44
51
  };
45
52
 
46
53
  var enableButtonRipple = function enableButtonRipple(event) {
@@ -1,13 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
- exports.isDesktop = exports.initdocumentBootstrapping = exports.inIframe = exports.hasTouch = exports.autoInitDocumentBootstrapping = void 0;
9
-
10
- var _throttle = _interopRequireDefault(require("lodash/fp/throttle"));
6
+ exports.toggleZoomOnMobile = exports.isMobile = exports.isDesktop = exports.inIframe = exports.hasTouch = void 0;
11
7
 
12
8
  // As "cssuseragent" is accessing the html dom object directly without checking whether it exists or not, we need to
13
9
  // use old shool require() to have a conditional import only when html really exists. This avoids issues when
@@ -42,6 +38,12 @@ var hasTouch = function hasTouch() {
42
38
 
43
39
  exports.hasTouch = hasTouch;
44
40
 
41
+ var isMobile = function isMobile() {
42
+ return document && document.documentElement.classList.contains('ua-mobile');
43
+ };
44
+
45
+ exports.isMobile = isMobile;
46
+
45
47
  var isDesktop = function isDesktop() {
46
48
  return document && document.documentElement.classList.contains('ua-desktop');
47
49
  };
@@ -51,51 +53,40 @@ exports.isDesktop = isDesktop;
51
53
  var inIframe = function inIframe() {
52
54
  try {
53
55
  return window.self !== window.top;
54
- } catch (e) {
56
+ } catch (_) {
55
57
  return true;
56
58
  }
57
- }; // https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
59
+ }; // Disables the Zoom for the mobile devices.
60
+ // This is not good for accessibility but makes the webpage feel more like a native app.
61
+ // <meta name="viewport" content="user-scalable=0 ..." />
58
62
 
59
63
 
60
64
  exports.inIframe = inIframe;
65
+ var USER_SCALABLE = 'user-scalable=0 maximum-scale=1';
61
66
 
62
- var calcViewportUnits = function calcViewportUnits() {
63
- var vh = window.innerHeight * 0.01;
64
- return "--vh: ".concat(vh, "px");
65
- };
66
-
67
- var initdocumentBootstrapping = function initdocumentBootstrapping(document) {
68
- if (!document || !document.documentElement) {
67
+ var toggleZoomOnMobile = function toggleZoomOnMobile() {
68
+ if (!document) {
69
69
  return;
70
70
  }
71
71
 
72
- var html = document.documentElement;
72
+ var viewportMeta = document.head.querySelector('[name="viewport"]');
73
73
 
74
- var setViewportUnits = function setViewportUnits() {
75
- // eslint-disable-next-line max-len
76
- // https://stackoverflow.com/questions/43054620/strict-mode-error-only-in-ie11-can-i-take-off-strict-mode-just-for-this-browser?rq=1
77
- // IE11 does not allow to set style directly as it's read only
78
- //html.style = calcViewportUnits();
79
- html.setAttribute('style', calcViewportUnits());
80
- };
74
+ if (!viewportMeta) {
75
+ return;
76
+ }
81
77
 
82
- window.addEventListener('orientationchange', (0, _throttle.default)(1000, setViewportUnits));
83
- window.addEventListener('resize', (0, _throttle.default)(1000, setViewportUnits));
84
- setViewportUnits();
78
+ var isScalable = viewportMeta.content.includes(USER_SCALABLE); // Restrict the zoom for mobile if not yet set
79
+
80
+ if (isMobile() && !isScalable) {
81
+ viewportMeta.content += " ".concat(USER_SCALABLE);
82
+ return;
83
+ } // Remove the setting, for non mobile cases
85
84
 
86
- if (!window.CSS || !window.CSS.supports || !window.CSS.supports('gap: 1px')) {
87
- html.classList.add('css-no-gap');
88
- }
89
85
 
90
- if (html && inIframe()) {
91
- html.classList.add('window-iframe');
86
+ if (!isMobile() && isScalable) {
87
+ viewportMeta.content = viewportMeta.content.replace(USER_SCALABLE, '').trim();
88
+ return;
92
89
  }
93
90
  };
94
91
 
95
- exports.initdocumentBootstrapping = initdocumentBootstrapping;
96
-
97
- var autoInitDocumentBootstrapping = function (document) {
98
- initdocumentBootstrapping(document);
99
- }(document);
100
-
101
- exports.autoInitDocumentBootstrapping = autoInitDocumentBootstrapping;
92
+ exports.toggleZoomOnMobile = toggleZoomOnMobile;
@@ -0,0 +1,174 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.initDocumentBootstrapping = exports.autoInitDocumentBootstrapping = void 0;
9
+
10
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
+
12
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
+
14
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
15
+
16
+ var _throttle = _interopRequireDefault(require("lodash/fp/throttle"));
17
+
18
+ var _deviceUtils = require("./deviceUtils");
19
+
20
+ var _version = _interopRequireDefault(require("../version.json"));
21
+
22
+ var uikitVersion = _version.default.version;
23
+
24
+ var isProdEnv = function isProdEnv() {
25
+ return process.env.NODE_ENV === 'production';
26
+ };
27
+
28
+ var isTestEnv = function isTestEnv() {
29
+ return process.env.NODE_ENV === 'test';
30
+ };
31
+
32
+ var isLocalhost = function isLocalhost() {
33
+ var _window, _window$location;
34
+
35
+ return ((_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.hostname) === 'localhost';
36
+ }; // https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
37
+
38
+
39
+ var calcViewportUnits = function calcViewportUnits() {
40
+ var vh = window.innerHeight * 0.01;
41
+ return "--vh: ".concat(vh, "px");
42
+ };
43
+
44
+ var logStyled = function logStyled(log) {
45
+ return console.log('%c%s', 'color: #697a8b;', log);
46
+ };
47
+
48
+ var printPoweredByRIO = function printPoweredByRIO() {
49
+ logStyled('- - - - - - - - - - - - - - - - - - - - - - -');
50
+ !isLocalhost() && logStyled(" ____ ___ ___ _ _ ___ _ _____ _____\n | _ \\|_ _/ _ \\ | | | |_ _| |/ /_ _|_ _|\n | |_) || | | | | | | | || || ' / | | | |\n | _ < | | |_| | | |_| || || . \\ | | | |\n |_| \\_\\___\\___/ \\___/|___|_|\\_\\___| |_|\n");
51
+ var message = [" Version ".concat(uikitVersion, " | https://uikit.developers.rio.cloud")];
52
+ isProdEnv() && message.push('\n\n You are a Developer? RIO is hiring! | https://rio.cloud/en/career');
53
+ logStyled(message.join(''));
54
+ logStyled('- - - - - - - - - - - - - - - - - - - - - -');
55
+ };
56
+
57
+ var checkForReleaseVersion = /*#__PURE__*/function () {
58
+ var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
59
+ var remoteVersionsListUrl, response, data;
60
+ return _regenerator.default.wrap(function _callee$(_context) {
61
+ while (1) {
62
+ switch (_context.prev = _context.next) {
63
+ case 0:
64
+ if (isProdEnv()) {
65
+ _context.next = 2;
66
+ break;
67
+ }
68
+
69
+ return _context.abrupt("return");
70
+
71
+ case 2:
72
+ remoteVersionsListUrl = 'https://uikit.developers.rio.cloud/versionsList.json';
73
+ _context.prev = 3;
74
+ _context.next = 6;
75
+ return fetch(remoteVersionsListUrl, {
76
+ method: 'get',
77
+ mode: 'no-cors'
78
+ });
79
+
80
+ case 6:
81
+ response = _context.sent;
82
+ _context.next = 9;
83
+ return response.json();
84
+
85
+ case 9:
86
+ data = _context.sent;
87
+
88
+ if (data.latest_release !== uikitVersion) {
89
+ console.log("\uD83C\uDD95 UIKIT version ".concat(data.latest_release, " is the latest released version! Your are using ").concat(uikitVersion));
90
+ }
91
+
92
+ _context.next = 16;
93
+ break;
94
+
95
+ case 13:
96
+ _context.prev = 13;
97
+ _context.t0 = _context["catch"](3);
98
+ // console.warn(error);
99
+ console.warn("Faild to fetch versionsList from ".concat(remoteVersionsListUrl));
100
+
101
+ case 16:
102
+ case "end":
103
+ return _context.stop();
104
+ }
105
+ }
106
+ }, _callee, null, [[3, 13]]);
107
+ }));
108
+
109
+ return function checkForReleaseVersion() {
110
+ return _ref.apply(this, arguments);
111
+ };
112
+ }();
113
+
114
+ var checkMatchingUkitVersions = function checkMatchingUkitVersions() {
115
+ Array.from(document.querySelectorAll('link[rel="stylesheet"]')).forEach(function (cssLink) {
116
+ var href = cssLink.href;
117
+
118
+ if (href.includes('uikit.developers.rio.cloud')) {
119
+ var _URL$pathname$split = new URL(href).pathname.split('/'),
120
+ _URL$pathname$split2 = (0, _slicedToArray2.default)(_URL$pathname$split, 2),
121
+ uikitVersionCSS = _URL$pathname$split2[1];
122
+
123
+ if (!href.includes(uikitVersion)) {
124
+ console.warn(['You are using different UIKIT JS and CSS versions.\n', "Your current JS version is ".concat(uikitVersion, " and "), "your current CSS version is ".concat(uikitVersionCSS, ".\n"), 'If this is not on purpose, please fix it. Otherwise, this may lead to UI bugs.'].join(''));
125
+ }
126
+ } else if (href.includes('cdn.rio.cloud/libs/rio-uikit')) {
127
+ console.error('You are still using an old "cdn.rio.cloud" css import. This will lead to mayor UI bugs!');
128
+ }
129
+ });
130
+ };
131
+
132
+ var initDocumentBootstrapping = function initDocumentBootstrapping(document) {
133
+ if (!document || !document.documentElement) {
134
+ return;
135
+ }
136
+
137
+ if (!isTestEnv()) {
138
+ console.group('UIKIT');
139
+ console.log('Init document bootstrapping');
140
+ }
141
+
142
+ var html = document.documentElement;
143
+
144
+ var setViewportUnits = function setViewportUnits() {
145
+ return html.setAttribute('style', calcViewportUnits());
146
+ };
147
+
148
+ window.addEventListener('orientationchange', (0, _throttle.default)(1000, setViewportUnits));
149
+ window.addEventListener('resize', (0, _throttle.default)(1000, setViewportUnits));
150
+ setViewportUnits();
151
+
152
+ if (!window.CSS || !window.CSS.supports || !window.CSS.supports('gap: 1px')) {
153
+ html.classList.add('css-no-gap');
154
+ }
155
+
156
+ if (html && (0, _deviceUtils.inIframe)()) {
157
+ html.classList.add('window-iframe');
158
+ }
159
+
160
+ if (!isTestEnv()) {
161
+ printPoweredByRIO();
162
+ checkForReleaseVersion();
163
+ checkMatchingUkitVersions();
164
+ console.groupEnd('UIKIT');
165
+ }
166
+ };
167
+
168
+ exports.initDocumentBootstrapping = initDocumentBootstrapping;
169
+
170
+ var autoInitDocumentBootstrapping = function (document) {
171
+ initDocumentBootstrapping(document);
172
+ }(document);
173
+
174
+ exports.autoInitDocumentBootstrapping = autoInitDocumentBootstrapping;
package/lib/version.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "0.15.0-beta-49"
2
+ "version": "0.16.0-beta-1"
3
3
  }