@rio-cloud/rio-uikit 0.15.0 → 0.16.0-beta-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -3
- package/lib/components/actionBarItem/ActionBarItem.js +4 -4
- package/lib/components/actionBarItem/ActionBarItemPopoverContent.js +43 -0
- package/lib/components/actionBarItem/ActionBarOverlay.js +8 -3
- package/lib/components/applicationHeader/AppMenuDropdown.js +9 -13
- package/lib/components/applicationLayout/ApplicationLayout.js +7 -9
- package/lib/components/applicationLayout/ApplicationLayoutBody.js +5 -3
- package/lib/components/assetTree/AssetTree.js +1 -1
- package/lib/components/assetTree/Tree.js +2 -2
- package/lib/components/assetTree/TreeLeaf.js +9 -9
- package/lib/components/bottomSheet/BottomSheet.js +11 -7
- package/lib/components/browserWarning/BrowserIcons.js +76 -0
- package/lib/components/browserWarning/BrowserWarning.js +4 -4
- package/lib/components/browserWarning/BrowserWarningMessageDE.js +20 -22
- package/lib/components/browserWarning/BrowserWarningMessageEN.js +20 -22
- package/lib/components/carousel/Carousel.js +7 -426
- package/lib/components/checkbox/Checkbox.js +4 -4
- package/lib/components/datepicker/DatePicker.js +15 -6
- package/lib/components/dialog/ConfirmationDialog.js +8 -6
- package/lib/components/dialog/SaveDialog.js +3 -1
- package/lib/components/dropdown/ButtonDropdown.js +149 -181
- package/lib/components/listMenu/ListMenu.js +40 -23
- package/lib/components/map/components/features/old/MapSettings.js +5 -5
- package/lib/components/map/components/features/old/settings/MapClusterSettings.js +13 -13
- package/lib/components/map/components/features/old/settings/MapLayerSettings.js +15 -15
- package/lib/components/map/components/features/old/settings/MapTypeSettings.js +20 -20
- package/lib/components/map/components/features/settings/ZoomButtons.js +10 -10
- package/lib/components/map/components/features/settings/builtinSettings/MapClusterSettings.js +20 -18
- package/lib/components/map/components/features/settings/builtinSettings/MapLayerSettings.js +8 -8
- package/lib/components/map/components/features/settings/builtinSettings/MapTypeSettings.js +42 -32
- package/lib/components/map/components/features/settings/buttons/MapBoundingBoxButton.js +8 -8
- package/lib/components/map/components/features/settings/buttons/MapCenterMarkerButton.js +8 -8
- package/lib/components/map/components/features/settings/buttons/MapLockMarkerButton.js +8 -8
- package/lib/components/map/components/features/settings/items/MapCustomerPoiSettingsItem.js +8 -8
- package/lib/components/map/components/features/settings/items/MapLayerIncidentsItem.js +8 -6
- package/lib/components/map/components/features/settings/items/MapLayerRoadRestrictionsItem.js +8 -6
- package/lib/components/map/components/features/settings/items/MapLayerTrafficItem.js +8 -6
- package/lib/components/map/components/features/settings/items/MapWorkshopPoiSettingsItem.js +8 -8
- package/lib/components/map/icons/MapIcon.js +500 -0
- package/lib/components/numberInput/NumberInput.js +6 -6
- package/lib/components/onboarding/OnboardingTip.js +9 -9
- package/lib/components/states/NotBookedState.js +2 -2
- package/lib/components/table/TableSettingsDialogFooter.js +1 -1
- package/lib/components/teaser/Teaser.js +1 -1
- package/lib/components/teaser/TeaserContainer.js +8 -8
- package/lib/components/tooltip/Tooltip.js +5 -5
- package/lib/es/DeviceUtils.d.ts +4 -2
- package/lib/es/SortDirection.d.ts +5 -0
- package/lib/es/deviceUtils.js +12 -0
- package/lib/es/useFullscreen.js +15 -0
- package/lib/hooks/useClipboard.js +2 -2
- package/lib/hooks/useFullscreen.js +244 -0
- package/lib/style/css/_exports/man-uikit.less +7 -5
- package/lib/style/css/_exports/rio-buyButton.less +30 -41
- package/lib/style/css/_exports/rio-uikit-core.less +106 -127
- package/lib/style/css/_exports/rio-uikit-print-utilities.less +6 -11
- package/lib/style/css/_exports/rio-uikit-responsive-utilities.less +6 -11
- package/lib/style/css/_exports/rio-uikit.less +5 -4
- package/lib/style/css/_exports/rio-website.less +49 -13
- package/lib/style/css/_exports/vw-uikit.less +10 -8
- package/lib/style/css/animations/_imports.less +9 -0
- package/lib/style/css/animations/collapse.less +16 -0
- package/lib/style/css/animations/fade.less +28 -0
- package/lib/style/css/animations/pinging.less +7 -0
- package/lib/style/css/animations/rotate.less +52 -0
- package/lib/style/css/animations/scale.less +35 -0
- package/lib/style/css/animations/slide.less +39 -0
- package/lib/style/css/animations/spinning.less +4 -0
- package/lib/style/css/animations/transition.less +129 -0
- package/lib/style/css/animations/translate.less +28 -0
- package/lib/style/css/bootstrap/dropdowns.less +10 -3
- package/lib/style/css/bootstrap/forms.less +38 -36
- package/lib/style/css/bootstrap/input-groups.less +4 -0
- package/lib/style/css/bootstrap/mixins/forms.less +1 -1
- package/lib/style/css/components/Activity.less +93 -0
- package/lib/style/css/components/ApplicationHeader.less +438 -0
- package/lib/style/css/components/ApplicationLayout.less +236 -0
- package/lib/style/css/components/AssetTree.less +443 -0
- package/lib/style/css/components/AutoSuggest.less +22 -0
- package/lib/style/css/components/BottomSheet.less +14 -0
- package/lib/style/css/components/Carousel.less +212 -0
- package/lib/style/css/components/Checkbox.less +224 -0
- package/lib/style/css/components/ClearableInput.less +115 -0
- package/lib/style/css/components/Counter.less +142 -0
- package/lib/style/css/components/DataTabs.less +100 -0
- package/lib/style/css/components/DatePicker.less +391 -0
- package/lib/style/css/components/Dialog.less +482 -0
- package/lib/style/css/components/Dropdown.less +186 -0
- package/lib/style/css/components/Expander.less +196 -0
- package/lib/style/css/components/FilePicker.less +8 -0
- package/lib/style/css/components/ListMenu.less +77 -0
- package/lib/style/css/components/MapHere.less +91 -0
- package/lib/style/css/components/MapMarker.less +347 -0
- package/lib/style/css/components/MapSettings.less +140 -0
- package/lib/style/css/components/NoData.less +8 -0
- package/lib/style/css/components/Notification.less +234 -0
- package/lib/style/css/components/RadioButton.less +173 -0
- package/lib/style/css/components/Resizer.less +43 -0
- package/lib/style/css/components/Select.less +272 -0
- package/lib/style/css/components/Sidebar.less +157 -0
- package/lib/style/css/components/Slider.less +278 -0
- package/lib/style/css/components/Spinner.less +49 -0
- package/lib/style/css/components/StatsWidget.less +111 -0
- package/lib/style/css/components/SteppedProgressBar.less +323 -0
- package/lib/style/css/components/SupportMarker.less +34 -0
- package/lib/style/css/components/Switch.less +145 -0
- package/lib/style/css/components/TableSettingsDialog.less +96 -0
- package/lib/style/css/components/TableSortArrows.less +54 -0
- package/lib/style/css/components/TableToolbar.less +121 -0
- package/lib/style/css/components/Tag.less +246 -0
- package/lib/style/css/components/TagManager.less +4 -0
- package/lib/style/css/components/Teaser.less +12 -0
- package/lib/style/css/components/Timeline.less +69 -0
- package/lib/style/css/components/Tooltip.less +261 -0
- package/lib/style/css/design/alerts.less +55 -0
- package/lib/style/css/design/aspect-ratio.less +23 -0
- package/lib/style/css/design/badges.less +120 -0
- package/lib/style/css/design/blockquote.less +49 -0
- package/lib/style/css/design/border.less +192 -0
- package/lib/style/css/design/breadcrumbs.less +20 -0
- package/lib/style/css/design/button-groups.less +194 -0
- package/lib/style/css/design/buttons.less +540 -0
- package/lib/style/css/design/callouts.less +27 -0
- package/lib/style/css/design/caret.less +28 -0
- package/lib/style/css/design/close.less +12 -0
- package/lib/style/css/design/code.less +45 -0
- package/lib/style/css/design/colors.less +202 -0
- package/lib/style/css/design/cols.less +56 -0
- package/lib/style/css/design/container.less +29 -0
- package/lib/style/css/design/cursors.less +19 -0
- package/lib/style/css/design/custom.less +20 -0
- package/lib/style/css/design/ellipsis.less +46 -0
- package/lib/style/css/design/flexgrid.less +7 -0
- package/lib/style/css/design/fonts.less +318 -0
- package/lib/style/css/design/form-input-groups.less +245 -0
- package/lib/style/css/design/form-inputs.less +655 -0
- package/lib/style/css/design/iframe.less +80 -0
- package/lib/style/css/design/images.less +47 -0
- package/lib/style/css/design/labels.less +66 -0
- package/lib/style/css/design/list-group.less +95 -0
- package/lib/style/css/design/navs.less +254 -0
- package/lib/style/css/design/normalize.less +436 -0
- package/lib/style/css/design/opacity.less +26 -0
- package/lib/style/css/design/overflow.less +1 -0
- package/lib/style/css/design/pagination.less +161 -0
- package/lib/style/css/design/panels.less +105 -0
- package/lib/style/css/design/popovers.less +117 -0
- package/lib/style/css/design/position.less +16 -0
- package/lib/style/css/design/progress-bars.less +131 -0
- package/lib/style/css/design/responsive/_imports.less +68 -0
- package/lib/style/css/design/responsive/backgrounds.less +32 -0
- package/lib/style/css/design/responsive/display.less +9 -0
- package/lib/style/css/design/responsive/flexgrid.less +75 -0
- package/lib/style/css/design/responsive/floating.less +4 -0
- package/lib/style/css/design/responsive/gap.less +41 -0
- package/lib/style/css/design/responsive/hyphens.less +14 -0
- package/lib/style/css/design/responsive/margin.less +127 -0
- package/lib/style/css/design/responsive/overflow.less +16 -0
- package/lib/style/css/design/responsive/padding.less +71 -0
- package/lib/style/css/design/responsive/position.less +102 -0
- package/lib/style/css/design/responsive/sizing.less +115 -0
- package/lib/style/css/design/responsive/text.less +71 -0
- package/lib/style/css/design/responsive/visibility.less +115 -0
- package/lib/style/css/design/responsive-embed.less +31 -0
- package/lib/style/css/design/responsive-video.less +22 -0
- package/lib/style/css/design/rioglyph.less +24 -0
- package/lib/style/css/design/rounded.less +44 -0
- package/lib/style/css/design/shadows.less +65 -0
- package/lib/style/css/design/tables.less +854 -0
- package/lib/style/css/design/text.less +201 -0
- package/lib/style/css/design/theme.less +200 -0
- package/lib/style/css/design/thumbnails.less +29 -0
- package/lib/style/css/design/transition.less +33 -0
- package/lib/style/css/design/type.less +159 -0
- package/lib/style/css/design/utilities.less +75 -0
- package/lib/style/css/design/visibilty.less +38 -0
- package/lib/style/css/design/wells.less +17 -0
- package/lib/style/css/design/z-index.less +21 -0
- package/lib/style/css/mapping/breakpoint-map.less +44 -0
- package/lib/style/css/mapping/color-map.less +200 -0
- package/lib/style/css/mapping/cols-map.less +15 -0
- package/lib/style/css/mapping/numbers-map.less +16 -0
- package/lib/style/css/mapping/positions-map.less +21 -0
- package/lib/style/css/mapping/sizes-map.less +129 -0
- package/lib/style/css/mapping/spacings-map.less +28 -0
- package/lib/style/css/mixins/_mixins.less +13 -0
- package/lib/style/css/mixins/alerts.less +13 -0
- package/lib/style/css/mixins/border-radius.less +16 -0
- package/lib/style/css/mixins/buttons.less +117 -0
- package/lib/style/css/mixins/clearfix.less +9 -0
- package/lib/style/css/mixins/cols.less +59 -0
- package/lib/style/css/mixins/forms.less +61 -0
- package/lib/style/css/mixins/panels.less +27 -0
- package/lib/style/css/mixins/placeholder.less +17 -0
- package/lib/style/css/mixins/reset.less +27 -0
- package/lib/style/css/mixins/sizings.less +21 -0
- package/lib/style/css/mixins/spinner.less +30 -0
- package/lib/style/css/mixins/table.less +26 -0
- package/lib/style/css/mixins/tabs.less +4 -0
- package/lib/style/css/mixins/text.less +5 -0
- package/lib/style/css/print/print.less +1 -4
- package/lib/style/css/rio-theme/alerts.less +23 -61
- package/lib/style/css/rio-theme/badges.less +16 -28
- package/lib/style/css/rio-theme/blockquote.less +14 -97
- package/lib/style/css/rio-theme/dropdowns.less +2 -2
- package/lib/style/css/rio-theme/forms.less +49 -20
- package/lib/style/css/rio-theme/input-groups.less +44 -25
- package/lib/style/css/rio-theme/mixins/alerts.less +13 -1
- package/lib/style/css/rio-theme/variables.less +1 -0
- package/lib/style/css/shared/colors.json +1 -1
- package/lib/style/css/shared/colors.less +11 -8
- package/lib/style/css/shared/text.less +6 -5
- package/lib/style/css/utils/responsive/grid.less +15 -6
- package/lib/style/css/utils/rounded.less +1 -0
- package/lib/style/css/variables.less +179 -0
- package/lib/style/fonts/rioglyph/rioglyph.less +1 -11
- package/lib/types.ts +42 -59
- package/lib/utils/buttonEffect.js +11 -4
- package/lib/utils/deviceUtils.js +28 -33
- package/lib/utils/init.js +174 -0
- package/lib/version.json +1 -1
- package/package.json +61 -34
package/lib/types.ts
CHANGED
|
@@ -505,6 +505,8 @@ export interface DatePickerProps extends DatetimepickerProps {
|
|
|
505
505
|
clearableInput?: boolean;
|
|
506
506
|
minWidth?: number;
|
|
507
507
|
onChange?: (value: Moment | string) => void;
|
|
508
|
+
mandatory?: boolean;
|
|
509
|
+
dateValidation?: (date: Date | string | Moment) => boolean;
|
|
508
510
|
}
|
|
509
511
|
|
|
510
512
|
export interface DateRangePickerCustomPresets {
|
|
@@ -696,7 +698,20 @@ export interface Line {
|
|
|
696
698
|
dataUnit?: string;
|
|
697
699
|
strokeColor: string;
|
|
698
700
|
legendType: 'line' | 'plainline' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye';
|
|
699
|
-
type:
|
|
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;
|
|
700
715
|
isAnimationActive?: boolean;
|
|
701
716
|
onClick?: Function;
|
|
702
717
|
}
|
|
@@ -723,12 +738,14 @@ export interface ListMenuItems {
|
|
|
723
738
|
group?: string | React.ReactNode;
|
|
724
739
|
groupNavItem?: React.ReactNode;
|
|
725
740
|
navItems: NavItems[];
|
|
741
|
+
isSubItem?: boolean;
|
|
726
742
|
}
|
|
727
743
|
|
|
728
744
|
export interface ListMenuProps {
|
|
729
745
|
menuItems: ListMenuItems[];
|
|
730
746
|
enableFilter?: boolean;
|
|
731
747
|
focusFilter?: boolean;
|
|
748
|
+
filterKey?: string;
|
|
732
749
|
filterPlaceholder?: string;
|
|
733
750
|
notFoundMessage?: string | React.ReactNode;
|
|
734
751
|
groupClassName?: string;
|
|
@@ -1016,7 +1033,7 @@ export interface NotBookedStateProps {
|
|
|
1016
1033
|
headline: string | React.ReactNode;
|
|
1017
1034
|
message: string | React.ReactNode;
|
|
1018
1035
|
buttons?: object[];
|
|
1019
|
-
features?:
|
|
1036
|
+
features?: React.ReactNode[];
|
|
1020
1037
|
condensed?: boolean;
|
|
1021
1038
|
fullWidth?: boolean;
|
|
1022
1039
|
image?: React.ReactNode;
|
|
@@ -1126,7 +1143,7 @@ export interface OnboardingTipProps {
|
|
|
1126
1143
|
children?: any;
|
|
1127
1144
|
width?: tooltipWidth;
|
|
1128
1145
|
preventOverflow?: boolean;
|
|
1129
|
-
popperConfig?:
|
|
1146
|
+
popperConfig?: object;
|
|
1130
1147
|
}
|
|
1131
1148
|
|
|
1132
1149
|
interface delayProp {
|
|
@@ -1286,7 +1303,7 @@ export interface ReleaseNotesProps {
|
|
|
1286
1303
|
releaseNotes: {
|
|
1287
1304
|
[key: string]: {
|
|
1288
1305
|
date: string;
|
|
1289
|
-
content:
|
|
1306
|
+
content: (HTMLElement | React.ReactElement)[];
|
|
1290
1307
|
};
|
|
1291
1308
|
};
|
|
1292
1309
|
}
|
|
@@ -1300,7 +1317,7 @@ export interface ReleaseNotesDialogProps {
|
|
|
1300
1317
|
translatedReleaseNotes: {
|
|
1301
1318
|
[key: string]: {
|
|
1302
1319
|
date: string;
|
|
1303
|
-
content:
|
|
1320
|
+
content: (HTMLElement | React.ReactElement)[];
|
|
1304
1321
|
};
|
|
1305
1322
|
};
|
|
1306
1323
|
currentVersion: string;
|
|
@@ -1465,7 +1482,7 @@ export interface SimpleButtonDropdownProps {
|
|
|
1465
1482
|
iconOnly?: boolean;
|
|
1466
1483
|
noCaret?: boolean;
|
|
1467
1484
|
splitButton?: boolean;
|
|
1468
|
-
|
|
1485
|
+
usePortal?: boolean;
|
|
1469
1486
|
items: MenuItemProps[];
|
|
1470
1487
|
className?: string;
|
|
1471
1488
|
dropdownClassName?: string;
|
|
@@ -1475,6 +1492,7 @@ export interface SimpleButtonDropdownProps {
|
|
|
1475
1492
|
onOpen?: Function;
|
|
1476
1493
|
onClose?: Function;
|
|
1477
1494
|
customDropdown?: React.ReactNode;
|
|
1495
|
+
popperConfig?: object;
|
|
1478
1496
|
}
|
|
1479
1497
|
|
|
1480
1498
|
export interface SimpleClusterLayerProps {
|
|
@@ -1568,8 +1586,10 @@ export interface SimpleTooltipProps {
|
|
|
1568
1586
|
| OverlayTriggerPlacement.LEFT_START
|
|
1569
1587
|
| OverlayTriggerPlacement.LEFT
|
|
1570
1588
|
| OverlayTriggerPlacement.LEFT_END;
|
|
1571
|
-
|
|
1589
|
+
content: string | React.ReactNode;
|
|
1572
1590
|
trigger?: 'click' | 'hover' | 'focus';
|
|
1591
|
+
targetRef?: React.MutableRefObject<object>;
|
|
1592
|
+
children: React.ReactNode;
|
|
1573
1593
|
}
|
|
1574
1594
|
|
|
1575
1595
|
export interface SaveDialogProps {
|
|
@@ -1601,18 +1621,6 @@ export interface SpinnerProps {
|
|
|
1601
1621
|
text?: string;
|
|
1602
1622
|
}
|
|
1603
1623
|
|
|
1604
|
-
export interface SingleMapMarkerProps {
|
|
1605
|
-
bearing?: number;
|
|
1606
|
-
name?: string | React.ReactNode;
|
|
1607
|
-
warningCount?: number;
|
|
1608
|
-
exceptionCount?: number;
|
|
1609
|
-
active?: boolean;
|
|
1610
|
-
clickable?: boolean;
|
|
1611
|
-
moving?: boolean;
|
|
1612
|
-
iconNames?: string[];
|
|
1613
|
-
markerColor?: markerColor;
|
|
1614
|
-
}
|
|
1615
|
-
|
|
1616
1624
|
export enum SortDirection {
|
|
1617
1625
|
ASCENDING = 'asc',
|
|
1618
1626
|
DESCENDING = 'desc',
|
|
@@ -2002,10 +2010,7 @@ export interface TypeCounterProps {
|
|
|
2002
2010
|
|
|
2003
2011
|
// U --------------------------------------------------------------------------------------------------
|
|
2004
2012
|
|
|
2005
|
-
export type UseAfterMount = (
|
|
2006
|
-
callback: () => void,
|
|
2007
|
-
deps?: any[]
|
|
2008
|
-
) => void;
|
|
2013
|
+
export type UseAfterMount = (callback: () => void, deps?: any[]) => void;
|
|
2009
2014
|
|
|
2010
2015
|
export type UseClickOutside<T extends HTMLElement = any> = (
|
|
2011
2016
|
callback: () => void,
|
|
@@ -2023,19 +2028,15 @@ export type UseDebugInfo = (
|
|
|
2023
2028
|
componentName: string,
|
|
2024
2029
|
props: object
|
|
2025
2030
|
) => {
|
|
2026
|
-
count: number
|
|
2027
|
-
changedProps: any
|
|
2028
|
-
timeSinceLastRender: number
|
|
2029
|
-
lastRenderTimestamp: number
|
|
2031
|
+
count: number;
|
|
2032
|
+
changedProps: any;
|
|
2033
|
+
timeSinceLastRender: number;
|
|
2034
|
+
lastRenderTimestamp: number;
|
|
2030
2035
|
};
|
|
2031
2036
|
|
|
2032
|
-
export type UseEffectOnce = (
|
|
2033
|
-
callback: () => void
|
|
2034
|
-
) => void;
|
|
2037
|
+
export type UseEffectOnce = (callback: () => void) => void;
|
|
2035
2038
|
|
|
2036
|
-
export type UseElementSize = (
|
|
2037
|
-
elementRef: { current: Element; }
|
|
2038
|
-
) => [number, number];
|
|
2039
|
+
export type UseElementSize = (elementRef: { current: Element }) => [number, number];
|
|
2039
2040
|
|
|
2040
2041
|
export type UseEsc<T extends keyof WindowEventMap> = (callback: (event: WindowEventMap[T]) => any) => void;
|
|
2041
2042
|
|
|
@@ -2046,10 +2047,7 @@ export type UseEvent<T extends keyof WindowEventMap> = (
|
|
|
2046
2047
|
target?: HTMLElement
|
|
2047
2048
|
) => void;
|
|
2048
2049
|
|
|
2049
|
-
export type UseInterval = (
|
|
2050
|
-
callback: () => void,
|
|
2051
|
-
delay?: number
|
|
2052
|
-
) => React.MutableRefObject<object>;
|
|
2050
|
+
export type UseInterval = (callback: () => void, delay?: number) => React.MutableRefObject<object>;
|
|
2053
2051
|
|
|
2054
2052
|
export type UseKey<T extends keyof WindowEventMap> = (
|
|
2055
2053
|
callback: (event: WindowEventMap[T]) => any,
|
|
@@ -2062,34 +2060,19 @@ export type UseOnlineStatus = () => boolean;
|
|
|
2062
2060
|
export type UseOnScreen = (
|
|
2063
2061
|
ref: React.MutableRefObject<object>,
|
|
2064
2062
|
options?: {
|
|
2065
|
-
rootMargins?: string
|
|
2066
|
-
threshold?: number | number[]
|
|
2063
|
+
rootMargins?: string;
|
|
2064
|
+
threshold?: number | number[];
|
|
2067
2065
|
}
|
|
2068
2066
|
) => boolean;
|
|
2069
2067
|
|
|
2070
2068
|
export type UseRenderCount = () => number;
|
|
2071
2069
|
|
|
2072
|
-
export type UseStateWithValidation = (
|
|
2073
|
-
validationFn: Function,
|
|
2074
|
-
initialValue: any
|
|
2075
|
-
) => [any, Function, boolean];
|
|
2070
|
+
export type UseStateWithValidation = (validationFn: Function, initialValue: any) => [any, Function, boolean];
|
|
2076
2071
|
|
|
2077
|
-
export type UseLocalStorage = (
|
|
2078
|
-
key: string,
|
|
2079
|
-
defaultValue: any
|
|
2080
|
-
) => [any, Function, Function];
|
|
2072
|
+
export type UseLocalStorage = (key: string, defaultValue: any) => [any, Function, Function];
|
|
2081
2073
|
|
|
2082
|
-
export type UseSessionStorage = (
|
|
2083
|
-
key: string,
|
|
2084
|
-
defaultValue: any
|
|
2085
|
-
) => [any, Function, Function];
|
|
2074
|
+
export type UseSessionStorage = (key: string, defaultValue: any) => [any, Function, Function];
|
|
2086
2075
|
|
|
2087
|
-
export type UseTimeout = (
|
|
2088
|
-
callback: () => void,
|
|
2089
|
-
delay?: number
|
|
2090
|
-
) => React.MutableRefObject<object>;
|
|
2076
|
+
export type UseTimeout = (callback: () => void, delay?: number) => React.MutableRefObject<object>;
|
|
2091
2077
|
|
|
2092
|
-
export type UseWindowResize = (
|
|
2093
|
-
callback: () => void,
|
|
2094
|
-
timeout?: number
|
|
2095
|
-
) => 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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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) {
|
package/lib/utils/deviceUtils.js
CHANGED
|
@@ -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.
|
|
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,47 +53,40 @@ exports.isDesktop = isDesktop;
|
|
|
51
53
|
var inIframe = function inIframe() {
|
|
52
54
|
try {
|
|
53
55
|
return window.self !== window.top;
|
|
54
|
-
} catch (
|
|
56
|
+
} catch (_) {
|
|
55
57
|
return true;
|
|
56
58
|
}
|
|
57
|
-
}; //
|
|
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
|
|
63
|
-
|
|
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
|
|
72
|
+
var viewportMeta = document.head.querySelector('[name="viewport"]');
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
74
|
+
if (!viewportMeta) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
|
81
84
|
|
|
82
|
-
if (!window.CSS || !window.CSS.supports || !window.CSS.supports('gap: 1px')) {
|
|
83
|
-
html.classList.add('css-no-gap');
|
|
84
|
-
}
|
|
85
85
|
|
|
86
|
-
if (
|
|
87
|
-
|
|
86
|
+
if (!isMobile() && isScalable) {
|
|
87
|
+
viewportMeta.content = viewportMeta.content.replace(USER_SCALABLE, '').trim();
|
|
88
|
+
return;
|
|
88
89
|
}
|
|
89
90
|
};
|
|
90
91
|
|
|
91
|
-
exports.
|
|
92
|
-
|
|
93
|
-
var autoInitDocumentBootstrapping = function (document) {
|
|
94
|
-
initdocumentBootstrapping(document);
|
|
95
|
-
}(document);
|
|
96
|
-
|
|
97
|
-
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