bootstrap-rn 0.2.11 → 0.2.13
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/dist/bootstrap-rn.cjs.js +94 -54
- package/dist/bootstrap-rn.esm.js +95 -55
- package/dist/bootstrap-rn.umd.js +153 -65
- package/dist/bootstrap-rn.umd.min.js +3 -3
- package/package.json +6 -6
package/dist/bootstrap-rn.cjs.js
CHANGED
|
@@ -678,23 +678,10 @@ var UnitValue = /*#__PURE__*/function () {
|
|
|
678
678
|
}
|
|
679
679
|
|
|
680
680
|
_createClass(UnitValue, [{
|
|
681
|
-
key: "toPercentage",
|
|
682
|
-
value: function toPercentage() {
|
|
683
|
-
if (!['number', 'percent'].includes(this.unit)) {
|
|
684
|
-
throw new Error("Unexpected unit \"".concat(this.unit, "\"."));
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
if (this.unit === 'percent') {
|
|
688
|
-
return this.value / 100;
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
return this.value;
|
|
692
|
-
}
|
|
693
|
-
}, {
|
|
694
681
|
key: "toNumber",
|
|
695
682
|
value: function toNumber() {
|
|
696
|
-
if (
|
|
697
|
-
|
|
683
|
+
if (this.unit === 'percent') {
|
|
684
|
+
return this.value / 100;
|
|
698
685
|
}
|
|
699
686
|
|
|
700
687
|
if (this.unit === 'rem') {
|
|
@@ -706,7 +693,15 @@ var UnitValue = /*#__PURE__*/function () {
|
|
|
706
693
|
}, {
|
|
707
694
|
key: "toString",
|
|
708
695
|
value: function toString() {
|
|
709
|
-
|
|
696
|
+
if (this.unit === 'number') {
|
|
697
|
+
return this.value;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
if (this.unit === 'percent') {
|
|
701
|
+
return "".concat(this.value, "%");
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
return "".concat(this.value).concat(this.unit);
|
|
710
705
|
}
|
|
711
706
|
}], [{
|
|
712
707
|
key: "parse",
|
|
@@ -733,12 +728,28 @@ var UnitValue = /*#__PURE__*/function () {
|
|
|
733
728
|
}();
|
|
734
729
|
|
|
735
730
|
var POWER = Math.pow(10, 8);
|
|
731
|
+
var UNIT_ORDER = ['percent', 'number', 'px', 'rem'];
|
|
736
732
|
|
|
737
733
|
var fixRounding = function fixRounding(value) {
|
|
738
734
|
return Math.round(value * POWER) / POWER;
|
|
739
735
|
};
|
|
740
736
|
|
|
741
|
-
var
|
|
737
|
+
var normalizeValue$1 = function normalizeValue(number1, number2) {
|
|
738
|
+
if (number1.unit === 'px' && number2.unit === 'rem') {
|
|
739
|
+
return number1.value / (reactNative.PixelRatio.getFontScale() * 16);
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
if (number1.unit === 'percent' && number2.unit !== 'percent') {
|
|
743
|
+
return number1.value / 100;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
return number1.value;
|
|
747
|
+
};
|
|
748
|
+
|
|
749
|
+
var calculateValue = function calculateValue(number1, operator, number2) {
|
|
750
|
+
var value1 = normalizeValue$1(number1, number2);
|
|
751
|
+
var value2 = normalizeValue$1(number2, number1);
|
|
752
|
+
|
|
742
753
|
switch (operator) {
|
|
743
754
|
case '+':
|
|
744
755
|
return value1 + value2;
|
|
@@ -760,24 +771,18 @@ var calculateValue = function calculateValue(value1, operator, value2) {
|
|
|
760
771
|
}
|
|
761
772
|
};
|
|
762
773
|
|
|
763
|
-
var
|
|
764
|
-
|
|
774
|
+
var determineUnit = function determineUnit(number1, number2) {
|
|
775
|
+
var index1 = UNIT_ORDER.indexOf(number1.unit);
|
|
776
|
+
var index2 = UNIT_ORDER.indexOf(number2.unit);
|
|
777
|
+
return index1 > index2 ? number1.unit : number2.unit;
|
|
765
778
|
};
|
|
766
779
|
|
|
767
780
|
function calculate(value1, operator, value2) {
|
|
768
781
|
var number1 = UnitValue.parse(value1);
|
|
769
782
|
var number2 = UnitValue.parse(value2);
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
if (number1.unit === 'rem' && number2.unit === 'px') {
|
|
776
|
-
return "".concat(calculateValue(number1.value, operator, pxToRem(number2.value)), "rem");
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
var unit = number1.unit === 'number' ? number2.unit : number1.unit;
|
|
780
|
-
return "".concat(calculateValue(number1.value, operator, number2.value)).concat(unit === 'number' ? '' : unit);
|
|
783
|
+
var value = calculateValue(number1, operator, number2);
|
|
784
|
+
var unit = determineUnit(number1, number2);
|
|
785
|
+
return new UnitValue(value, unit).toString();
|
|
781
786
|
}
|
|
782
787
|
function normalizeNumber(value) {
|
|
783
788
|
return UnitValue.parse(value).toNumber();
|
|
@@ -1083,7 +1088,7 @@ function mix(color1, color2) {
|
|
|
1083
1088
|
var weight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.5;
|
|
1084
1089
|
var rgb1 = RgbaValue.parse(color1).toRgb();
|
|
1085
1090
|
var rgb2 = RgbaValue.parse(color2).toRgb();
|
|
1086
|
-
var percentage = UnitValue.parse(weight).
|
|
1091
|
+
var percentage = UnitValue.parse(weight).toNumber();
|
|
1087
1092
|
|
|
1088
1093
|
var _rgb1$map = rgb1.map(function (value, key) {
|
|
1089
1094
|
return Math.round(rgb2[key] + (value - rgb2[key]) * percentage);
|
|
@@ -2542,7 +2547,7 @@ var shiftColor = fn(function (_ref9, t) {
|
|
|
2542
2547
|
color = _ref10[0],
|
|
2543
2548
|
weight = _ref10[1];
|
|
2544
2549
|
|
|
2545
|
-
var percentage = UnitValue.parse(weight).
|
|
2550
|
+
var percentage = UnitValue.parse(weight).toNumber();
|
|
2546
2551
|
var handle = percentage > 0 ? shadeColor(color, percentage) : tintColor(color, -percentage);
|
|
2547
2552
|
return handle(t);
|
|
2548
2553
|
});
|
|
@@ -3662,7 +3667,7 @@ function useModifier(name, props, ref) {
|
|
|
3662
3667
|
}
|
|
3663
3668
|
|
|
3664
3669
|
var _excluded$1p = ["toggle", "dismiss"],
|
|
3665
|
-
_excluded2$
|
|
3670
|
+
_excluded2$3 = ["ref"];
|
|
3666
3671
|
|
|
3667
3672
|
var getActionHook = function getActionHook(toggle, dismiss) {
|
|
3668
3673
|
if (toggle) {
|
|
@@ -3693,7 +3698,7 @@ function useAction(props, ref) {
|
|
|
3693
3698
|
|
|
3694
3699
|
var _useActionHook = useActionHook(restProps),
|
|
3695
3700
|
actionRef = _useActionHook.ref,
|
|
3696
|
-
actionProps = _objectWithoutProperties(_useActionHook, _excluded2$
|
|
3701
|
+
actionProps = _objectWithoutProperties(_useActionHook, _excluded2$3);
|
|
3697
3702
|
|
|
3698
3703
|
return [actionProps, concatRefs(actionRef, ref)];
|
|
3699
3704
|
}
|
|
@@ -5274,21 +5279,32 @@ var Overlay = function Overlay(props) {
|
|
|
5274
5279
|
overlayRef: overlayRef,
|
|
5275
5280
|
offset: offset,
|
|
5276
5281
|
isOpen: visible
|
|
5277
|
-
}); // Remove
|
|
5282
|
+
}); // Remove unnecessary arrow styles and adjust arrow offset.
|
|
5278
5283
|
|
|
5279
|
-
if (
|
|
5284
|
+
if (placement === 'top' || placement === 'bottom') {
|
|
5285
|
+
delete overlay.arrowProps.style.top;
|
|
5286
|
+
|
|
5287
|
+
if (typeof overlay.arrowProps.style.left === 'number') {
|
|
5288
|
+
overlay.arrowProps.style.left -= arrowOffset;
|
|
5289
|
+
}
|
|
5290
|
+
}
|
|
5291
|
+
|
|
5292
|
+
if (placement === 'left' || placement === 'right') {
|
|
5280
5293
|
delete overlay.arrowProps.style.left;
|
|
5281
5294
|
|
|
5282
|
-
if (overlay.arrowProps.style.top) {
|
|
5295
|
+
if (typeof overlay.arrowProps.style.top === 'number') {
|
|
5283
5296
|
overlay.arrowProps.style.top -= arrowOffset;
|
|
5284
5297
|
}
|
|
5285
|
-
}
|
|
5298
|
+
} // Adjust top value by status bar height on Android
|
|
5286
5299
|
|
|
5287
|
-
if (overlay.arrowProps.style.top === undefined) {
|
|
5288
|
-
delete overlay.arrowProps.style.top;
|
|
5289
5300
|
|
|
5290
|
-
|
|
5291
|
-
|
|
5301
|
+
if (reactNative.Platform.OS === 'android' && reactNative.StatusBar.currentHeight) {
|
|
5302
|
+
if (typeof overlay.overlayProps.style.top === 'number') {
|
|
5303
|
+
overlay.overlayProps.style.top -= reactNative.StatusBar.currentHeight;
|
|
5304
|
+
}
|
|
5305
|
+
|
|
5306
|
+
if (typeof overlay.arrowProps.style.top === 'number') {
|
|
5307
|
+
overlay.arrowProps.style.top -= reactNative.StatusBar.currentHeight;
|
|
5292
5308
|
}
|
|
5293
5309
|
}
|
|
5294
5310
|
|
|
@@ -6524,7 +6540,7 @@ Popover.Header = PopoverHeader;
|
|
|
6524
6540
|
Popover.Body = PopoverBody;
|
|
6525
6541
|
|
|
6526
6542
|
var _excluded$M = ["title", "content", "autoClose", "trigger", "placement"],
|
|
6527
|
-
_excluded2$
|
|
6543
|
+
_excluded2$2 = ["popover"];
|
|
6528
6544
|
var propTypes$O = {
|
|
6529
6545
|
popover: PropTypes__default["default"].shape(_objectSpread2({
|
|
6530
6546
|
title: PropTypes__default["default"].node,
|
|
@@ -6545,7 +6561,7 @@ function injectPopover(Target) {
|
|
|
6545
6561
|
_props$popover$placem = _props$popover.placement,
|
|
6546
6562
|
placement = _props$popover$placem === void 0 ? 'right' : _props$popover$placem,
|
|
6547
6563
|
tooltipProps = _objectWithoutProperties(_props$popover, _excluded$M),
|
|
6548
|
-
elementProps = _objectWithoutProperties(props, _excluded2$
|
|
6564
|
+
elementProps = _objectWithoutProperties(props, _excluded2$2);
|
|
6549
6565
|
/* eslint-enable */
|
|
6550
6566
|
|
|
6551
6567
|
|
|
@@ -6721,7 +6737,7 @@ Tooltip.Arrow = TooltipArrow;
|
|
|
6721
6737
|
Tooltip.Inner = TooltipInner;
|
|
6722
6738
|
|
|
6723
6739
|
var _excluded$I = ["title", "autoClose", "trigger", "placement"],
|
|
6724
|
-
_excluded2 = ["tooltip"];
|
|
6740
|
+
_excluded2$1 = ["tooltip"];
|
|
6725
6741
|
var propTypes$K = {
|
|
6726
6742
|
tooltip: PropTypes__default["default"].shape(_objectSpread2({
|
|
6727
6743
|
title: PropTypes__default["default"].node.isRequired,
|
|
@@ -6740,7 +6756,7 @@ function injectTooltip(Target) {
|
|
|
6740
6756
|
_props$tooltip$placem = _props$tooltip.placement,
|
|
6741
6757
|
placement = _props$tooltip$placem === void 0 ? 'top' : _props$tooltip$placem,
|
|
6742
6758
|
tooltipProps = _objectWithoutProperties(_props$tooltip, _excluded$I),
|
|
6743
|
-
elementProps = _objectWithoutProperties(props, _excluded2);
|
|
6759
|
+
elementProps = _objectWithoutProperties(props, _excluded2$1);
|
|
6744
6760
|
/* eslint-enable */
|
|
6745
6761
|
|
|
6746
6762
|
|
|
@@ -7033,11 +7049,14 @@ ListGroup.propTypes = propTypes$F;
|
|
|
7033
7049
|
ListGroup.Item = ListGroupItem;
|
|
7034
7050
|
ListGroup.ItemAction = ListGroupItemAction;
|
|
7035
7051
|
|
|
7036
|
-
var _excluded$C = ["children", "style"]
|
|
7052
|
+
var _excluded$C = ["children", "onHoverIn", "onHoverOut", "onMouseEnter", "onMouseLeave", "style"],
|
|
7053
|
+
_excluded2 = ["onHoverIn", "onHoverOut"];
|
|
7037
7054
|
|
|
7038
7055
|
var _templateObject$w;
|
|
7039
7056
|
var propTypes$E = {
|
|
7040
7057
|
children: PropTypes__default["default"].node.isRequired,
|
|
7058
|
+
onMouseEnter: PropTypes__default["default"].func,
|
|
7059
|
+
onMouseLeave: PropTypes__default["default"].func,
|
|
7041
7060
|
// eslint-disable-next-line react/forbid-prop-types
|
|
7042
7061
|
style: PropTypes__default["default"].any
|
|
7043
7062
|
};
|
|
@@ -7055,7 +7074,13 @@ var Link = /*#__PURE__*/React__default["default"].forwardRef(function (props, re
|
|
|
7055
7074
|
actionProps = _useAction2[0],
|
|
7056
7075
|
actionRef = _useAction2[1];
|
|
7057
7076
|
|
|
7058
|
-
var children = actionProps.children
|
|
7077
|
+
var children = actionProps.children;
|
|
7078
|
+
actionProps.onHoverIn;
|
|
7079
|
+
actionProps.onHoverOut;
|
|
7080
|
+
var _actionProps$onMouseE = actionProps.onMouseEnter,
|
|
7081
|
+
handleMouseEnter = _actionProps$onMouseE === void 0 ? function () {} : _actionProps$onMouseE,
|
|
7082
|
+
_actionProps$onMouseL = actionProps.onMouseLeave,
|
|
7083
|
+
handleMouseLeave = _actionProps$onMouseL === void 0 ? function () {} : _actionProps$onMouseL,
|
|
7059
7084
|
style = actionProps.style,
|
|
7060
7085
|
elementProps = _objectWithoutProperties(actionProps, _excluded$C);
|
|
7061
7086
|
|
|
@@ -7065,9 +7090,20 @@ var Link = /*#__PURE__*/React__default["default"].forwardRef(function (props, re
|
|
|
7065
7090
|
|
|
7066
7091
|
var _useInteractionState = useInteractionState(elementProps),
|
|
7067
7092
|
interaction = _useInteractionState.interaction,
|
|
7068
|
-
|
|
7093
|
+
_useInteractionState$ = _useInteractionState.interactionProps,
|
|
7094
|
+
handleMouseEnterInteraction = _useInteractionState$.onHoverIn,
|
|
7095
|
+
handleMouseLeaveInteraction = _useInteractionState$.onHoverOut,
|
|
7096
|
+
interactionProps = _objectWithoutProperties(_useInteractionState$, _excluded2);
|
|
7069
7097
|
|
|
7070
7098
|
return /*#__PURE__*/React__default["default"].createElement(Text, _extends({}, elementProps, interactionProps, {
|
|
7099
|
+
onMouseEnter: function onMouseEnter(event) {
|
|
7100
|
+
handleMouseEnter(event);
|
|
7101
|
+
handleMouseEnterInteraction(event);
|
|
7102
|
+
},
|
|
7103
|
+
onMouseLeave: function onMouseLeave(event) {
|
|
7104
|
+
handleMouseLeave(event);
|
|
7105
|
+
handleMouseLeaveInteraction(event);
|
|
7106
|
+
},
|
|
7071
7107
|
ref: actionRef,
|
|
7072
7108
|
accessibilityRole: getRole$2(actionProps),
|
|
7073
7109
|
accessible: true,
|
|
@@ -8011,6 +8047,14 @@ var Offcanvas = /*#__PURE__*/React__default["default"].forwardRef(function (prop
|
|
|
8011
8047
|
transparent: true,
|
|
8012
8048
|
visible: navbar ? navbar.expanded : visible,
|
|
8013
8049
|
onRequestClose: handleToggle
|
|
8050
|
+
}, placement !== 'bottom' && /*#__PURE__*/React__default["default"].createElement(reactNative.SafeAreaView, {
|
|
8051
|
+
style: {
|
|
8052
|
+
flexGrow: 0
|
|
8053
|
+
}
|
|
8054
|
+
}), /*#__PURE__*/React__default["default"].createElement(reactNative.SafeAreaView, {
|
|
8055
|
+
style: {
|
|
8056
|
+
flexGrow: 1
|
|
8057
|
+
}
|
|
8014
8058
|
}, backdrop && /*#__PURE__*/React__default["default"].createElement(View, {
|
|
8015
8059
|
style: backdropClasses
|
|
8016
8060
|
}, /*#__PURE__*/React__default["default"].createElement(BackdropHandler, {
|
|
@@ -8021,11 +8065,7 @@ var Offcanvas = /*#__PURE__*/React__default["default"].forwardRef(function (prop
|
|
|
8021
8065
|
ref: concatRefs(offcanvasRef, ref),
|
|
8022
8066
|
style: [classes, style],
|
|
8023
8067
|
textStyle: [textClasses, textStyle]
|
|
8024
|
-
}), /*#__PURE__*/React__default["default"].createElement(
|
|
8025
|
-
style: {
|
|
8026
|
-
flexShrink: 1
|
|
8027
|
-
}
|
|
8028
|
-
}, /*#__PURE__*/React__default["default"].createElement(View, {
|
|
8068
|
+
}), /*#__PURE__*/React__default["default"].createElement(View, {
|
|
8029
8069
|
style: [dialogClasses, dialogStyle],
|
|
8030
8070
|
textStyle: dialogTextStyle
|
|
8031
8071
|
}, /*#__PURE__*/React__default["default"].createElement(OffcanvasContext.Provider, {
|
package/dist/bootstrap-rn.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OverlayProvider, useOverlayPosition, OverlayContainer } from '@react-native-aria/overlays';
|
|
2
2
|
export { PortalProvider } from '@react-native-aria/overlays';
|
|
3
|
-
import { Platform, PixelRatio, StyleSheet as StyleSheet$1, I18nManager, Dimensions, View as View$1, Text as Text$1, Pressable as Pressable$1, SafeAreaView, unstable_createElement, findNodeHandle, TextInput as TextInput$1, Image as Image$1, ImageBackground as ImageBackground$1, ScrollView as ScrollView$1, Modal as Modal$1, Picker as Picker$1, Animated, Easing } from 'react-native';
|
|
3
|
+
import { Platform, PixelRatio, StyleSheet as StyleSheet$1, I18nManager, Dimensions, View as View$1, Text as Text$1, Pressable as Pressable$1, SafeAreaView, unstable_createElement, StatusBar, findNodeHandle, TextInput as TextInput$1, Image as Image$1, ImageBackground as ImageBackground$1, ScrollView as ScrollView$1, Modal as Modal$1, Picker as Picker$1, Animated, Easing } from 'react-native';
|
|
4
4
|
import { transformRawValue, getStylesForProperty, getPropertyName } from 'css-to-react-native';
|
|
5
5
|
import React, { useState, useEffect, useMemo, useRef, useContext, createContext } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -669,23 +669,10 @@ var UnitValue = /*#__PURE__*/function () {
|
|
|
669
669
|
}
|
|
670
670
|
|
|
671
671
|
_createClass(UnitValue, [{
|
|
672
|
-
key: "toPercentage",
|
|
673
|
-
value: function toPercentage() {
|
|
674
|
-
if (!['number', 'percent'].includes(this.unit)) {
|
|
675
|
-
throw new Error("Unexpected unit \"".concat(this.unit, "\"."));
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
if (this.unit === 'percent') {
|
|
679
|
-
return this.value / 100;
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
return this.value;
|
|
683
|
-
}
|
|
684
|
-
}, {
|
|
685
672
|
key: "toNumber",
|
|
686
673
|
value: function toNumber() {
|
|
687
|
-
if (
|
|
688
|
-
|
|
674
|
+
if (this.unit === 'percent') {
|
|
675
|
+
return this.value / 100;
|
|
689
676
|
}
|
|
690
677
|
|
|
691
678
|
if (this.unit === 'rem') {
|
|
@@ -697,7 +684,15 @@ var UnitValue = /*#__PURE__*/function () {
|
|
|
697
684
|
}, {
|
|
698
685
|
key: "toString",
|
|
699
686
|
value: function toString() {
|
|
700
|
-
|
|
687
|
+
if (this.unit === 'number') {
|
|
688
|
+
return this.value;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
if (this.unit === 'percent') {
|
|
692
|
+
return "".concat(this.value, "%");
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
return "".concat(this.value).concat(this.unit);
|
|
701
696
|
}
|
|
702
697
|
}], [{
|
|
703
698
|
key: "parse",
|
|
@@ -724,12 +719,28 @@ var UnitValue = /*#__PURE__*/function () {
|
|
|
724
719
|
}();
|
|
725
720
|
|
|
726
721
|
var POWER = Math.pow(10, 8);
|
|
722
|
+
var UNIT_ORDER = ['percent', 'number', 'px', 'rem'];
|
|
727
723
|
|
|
728
724
|
var fixRounding = function fixRounding(value) {
|
|
729
725
|
return Math.round(value * POWER) / POWER;
|
|
730
726
|
};
|
|
731
727
|
|
|
732
|
-
var
|
|
728
|
+
var normalizeValue$1 = function normalizeValue(number1, number2) {
|
|
729
|
+
if (number1.unit === 'px' && number2.unit === 'rem') {
|
|
730
|
+
return number1.value / (PixelRatio.getFontScale() * 16);
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
if (number1.unit === 'percent' && number2.unit !== 'percent') {
|
|
734
|
+
return number1.value / 100;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
return number1.value;
|
|
738
|
+
};
|
|
739
|
+
|
|
740
|
+
var calculateValue = function calculateValue(number1, operator, number2) {
|
|
741
|
+
var value1 = normalizeValue$1(number1, number2);
|
|
742
|
+
var value2 = normalizeValue$1(number2, number1);
|
|
743
|
+
|
|
733
744
|
switch (operator) {
|
|
734
745
|
case '+':
|
|
735
746
|
return value1 + value2;
|
|
@@ -751,24 +762,18 @@ var calculateValue = function calculateValue(value1, operator, value2) {
|
|
|
751
762
|
}
|
|
752
763
|
};
|
|
753
764
|
|
|
754
|
-
var
|
|
755
|
-
|
|
765
|
+
var determineUnit = function determineUnit(number1, number2) {
|
|
766
|
+
var index1 = UNIT_ORDER.indexOf(number1.unit);
|
|
767
|
+
var index2 = UNIT_ORDER.indexOf(number2.unit);
|
|
768
|
+
return index1 > index2 ? number1.unit : number2.unit;
|
|
756
769
|
};
|
|
757
770
|
|
|
758
771
|
function calculate(value1, operator, value2) {
|
|
759
772
|
var number1 = UnitValue.parse(value1);
|
|
760
773
|
var number2 = UnitValue.parse(value2);
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
if (number1.unit === 'rem' && number2.unit === 'px') {
|
|
767
|
-
return "".concat(calculateValue(number1.value, operator, pxToRem(number2.value)), "rem");
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
var unit = number1.unit === 'number' ? number2.unit : number1.unit;
|
|
771
|
-
return "".concat(calculateValue(number1.value, operator, number2.value)).concat(unit === 'number' ? '' : unit);
|
|
774
|
+
var value = calculateValue(number1, operator, number2);
|
|
775
|
+
var unit = determineUnit(number1, number2);
|
|
776
|
+
return new UnitValue(value, unit).toString();
|
|
772
777
|
}
|
|
773
778
|
function normalizeNumber(value) {
|
|
774
779
|
return UnitValue.parse(value).toNumber();
|
|
@@ -1074,7 +1079,7 @@ function mix(color1, color2) {
|
|
|
1074
1079
|
var weight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.5;
|
|
1075
1080
|
var rgb1 = RgbaValue.parse(color1).toRgb();
|
|
1076
1081
|
var rgb2 = RgbaValue.parse(color2).toRgb();
|
|
1077
|
-
var percentage = UnitValue.parse(weight).
|
|
1082
|
+
var percentage = UnitValue.parse(weight).toNumber();
|
|
1078
1083
|
|
|
1079
1084
|
var _rgb1$map = rgb1.map(function (value, key) {
|
|
1080
1085
|
return Math.round(rgb2[key] + (value - rgb2[key]) * percentage);
|
|
@@ -2533,7 +2538,7 @@ var shiftColor = fn(function (_ref9, t) {
|
|
|
2533
2538
|
color = _ref10[0],
|
|
2534
2539
|
weight = _ref10[1];
|
|
2535
2540
|
|
|
2536
|
-
var percentage = UnitValue.parse(weight).
|
|
2541
|
+
var percentage = UnitValue.parse(weight).toNumber();
|
|
2537
2542
|
var handle = percentage > 0 ? shadeColor(color, percentage) : tintColor(color, -percentage);
|
|
2538
2543
|
return handle(t);
|
|
2539
2544
|
});
|
|
@@ -3653,7 +3658,7 @@ function useModifier(name, props, ref) {
|
|
|
3653
3658
|
}
|
|
3654
3659
|
|
|
3655
3660
|
var _excluded$1p = ["toggle", "dismiss"],
|
|
3656
|
-
_excluded2$
|
|
3661
|
+
_excluded2$3 = ["ref"];
|
|
3657
3662
|
|
|
3658
3663
|
var getActionHook = function getActionHook(toggle, dismiss) {
|
|
3659
3664
|
if (toggle) {
|
|
@@ -3684,7 +3689,7 @@ function useAction(props, ref) {
|
|
|
3684
3689
|
|
|
3685
3690
|
var _useActionHook = useActionHook(restProps),
|
|
3686
3691
|
actionRef = _useActionHook.ref,
|
|
3687
|
-
actionProps = _objectWithoutProperties(_useActionHook, _excluded2$
|
|
3692
|
+
actionProps = _objectWithoutProperties(_useActionHook, _excluded2$3);
|
|
3688
3693
|
|
|
3689
3694
|
return [actionProps, concatRefs(actionRef, ref)];
|
|
3690
3695
|
}
|
|
@@ -5265,21 +5270,32 @@ var Overlay = function Overlay(props) {
|
|
|
5265
5270
|
overlayRef: overlayRef,
|
|
5266
5271
|
offset: offset,
|
|
5267
5272
|
isOpen: visible
|
|
5268
|
-
}); // Remove
|
|
5273
|
+
}); // Remove unnecessary arrow styles and adjust arrow offset.
|
|
5269
5274
|
|
|
5270
|
-
if (
|
|
5275
|
+
if (placement === 'top' || placement === 'bottom') {
|
|
5276
|
+
delete overlay.arrowProps.style.top;
|
|
5277
|
+
|
|
5278
|
+
if (typeof overlay.arrowProps.style.left === 'number') {
|
|
5279
|
+
overlay.arrowProps.style.left -= arrowOffset;
|
|
5280
|
+
}
|
|
5281
|
+
}
|
|
5282
|
+
|
|
5283
|
+
if (placement === 'left' || placement === 'right') {
|
|
5271
5284
|
delete overlay.arrowProps.style.left;
|
|
5272
5285
|
|
|
5273
|
-
if (overlay.arrowProps.style.top) {
|
|
5286
|
+
if (typeof overlay.arrowProps.style.top === 'number') {
|
|
5274
5287
|
overlay.arrowProps.style.top -= arrowOffset;
|
|
5275
5288
|
}
|
|
5276
|
-
}
|
|
5289
|
+
} // Adjust top value by status bar height on Android
|
|
5277
5290
|
|
|
5278
|
-
if (overlay.arrowProps.style.top === undefined) {
|
|
5279
|
-
delete overlay.arrowProps.style.top;
|
|
5280
5291
|
|
|
5281
|
-
|
|
5282
|
-
|
|
5292
|
+
if (Platform.OS === 'android' && StatusBar.currentHeight) {
|
|
5293
|
+
if (typeof overlay.overlayProps.style.top === 'number') {
|
|
5294
|
+
overlay.overlayProps.style.top -= StatusBar.currentHeight;
|
|
5295
|
+
}
|
|
5296
|
+
|
|
5297
|
+
if (typeof overlay.arrowProps.style.top === 'number') {
|
|
5298
|
+
overlay.arrowProps.style.top -= StatusBar.currentHeight;
|
|
5283
5299
|
}
|
|
5284
5300
|
}
|
|
5285
5301
|
|
|
@@ -6515,7 +6531,7 @@ Popover.Header = PopoverHeader;
|
|
|
6515
6531
|
Popover.Body = PopoverBody;
|
|
6516
6532
|
|
|
6517
6533
|
var _excluded$M = ["title", "content", "autoClose", "trigger", "placement"],
|
|
6518
|
-
_excluded2$
|
|
6534
|
+
_excluded2$2 = ["popover"];
|
|
6519
6535
|
var propTypes$O = {
|
|
6520
6536
|
popover: PropTypes.shape(_objectSpread2({
|
|
6521
6537
|
title: PropTypes.node,
|
|
@@ -6536,7 +6552,7 @@ function injectPopover(Target) {
|
|
|
6536
6552
|
_props$popover$placem = _props$popover.placement,
|
|
6537
6553
|
placement = _props$popover$placem === void 0 ? 'right' : _props$popover$placem,
|
|
6538
6554
|
tooltipProps = _objectWithoutProperties(_props$popover, _excluded$M),
|
|
6539
|
-
elementProps = _objectWithoutProperties(props, _excluded2$
|
|
6555
|
+
elementProps = _objectWithoutProperties(props, _excluded2$2);
|
|
6540
6556
|
/* eslint-enable */
|
|
6541
6557
|
|
|
6542
6558
|
|
|
@@ -6712,7 +6728,7 @@ Tooltip.Arrow = TooltipArrow;
|
|
|
6712
6728
|
Tooltip.Inner = TooltipInner;
|
|
6713
6729
|
|
|
6714
6730
|
var _excluded$I = ["title", "autoClose", "trigger", "placement"],
|
|
6715
|
-
_excluded2 = ["tooltip"];
|
|
6731
|
+
_excluded2$1 = ["tooltip"];
|
|
6716
6732
|
var propTypes$K = {
|
|
6717
6733
|
tooltip: PropTypes.shape(_objectSpread2({
|
|
6718
6734
|
title: PropTypes.node.isRequired,
|
|
@@ -6731,7 +6747,7 @@ function injectTooltip(Target) {
|
|
|
6731
6747
|
_props$tooltip$placem = _props$tooltip.placement,
|
|
6732
6748
|
placement = _props$tooltip$placem === void 0 ? 'top' : _props$tooltip$placem,
|
|
6733
6749
|
tooltipProps = _objectWithoutProperties(_props$tooltip, _excluded$I),
|
|
6734
|
-
elementProps = _objectWithoutProperties(props, _excluded2);
|
|
6750
|
+
elementProps = _objectWithoutProperties(props, _excluded2$1);
|
|
6735
6751
|
/* eslint-enable */
|
|
6736
6752
|
|
|
6737
6753
|
|
|
@@ -7024,11 +7040,14 @@ ListGroup.propTypes = propTypes$F;
|
|
|
7024
7040
|
ListGroup.Item = ListGroupItem;
|
|
7025
7041
|
ListGroup.ItemAction = ListGroupItemAction;
|
|
7026
7042
|
|
|
7027
|
-
var _excluded$C = ["children", "style"]
|
|
7043
|
+
var _excluded$C = ["children", "onHoverIn", "onHoverOut", "onMouseEnter", "onMouseLeave", "style"],
|
|
7044
|
+
_excluded2 = ["onHoverIn", "onHoverOut"];
|
|
7028
7045
|
|
|
7029
7046
|
var _templateObject$w;
|
|
7030
7047
|
var propTypes$E = {
|
|
7031
7048
|
children: PropTypes.node.isRequired,
|
|
7049
|
+
onMouseEnter: PropTypes.func,
|
|
7050
|
+
onMouseLeave: PropTypes.func,
|
|
7032
7051
|
// eslint-disable-next-line react/forbid-prop-types
|
|
7033
7052
|
style: PropTypes.any
|
|
7034
7053
|
};
|
|
@@ -7046,7 +7065,13 @@ var Link = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
7046
7065
|
actionProps = _useAction2[0],
|
|
7047
7066
|
actionRef = _useAction2[1];
|
|
7048
7067
|
|
|
7049
|
-
var children = actionProps.children
|
|
7068
|
+
var children = actionProps.children;
|
|
7069
|
+
actionProps.onHoverIn;
|
|
7070
|
+
actionProps.onHoverOut;
|
|
7071
|
+
var _actionProps$onMouseE = actionProps.onMouseEnter,
|
|
7072
|
+
handleMouseEnter = _actionProps$onMouseE === void 0 ? function () {} : _actionProps$onMouseE,
|
|
7073
|
+
_actionProps$onMouseL = actionProps.onMouseLeave,
|
|
7074
|
+
handleMouseLeave = _actionProps$onMouseL === void 0 ? function () {} : _actionProps$onMouseL,
|
|
7050
7075
|
style = actionProps.style,
|
|
7051
7076
|
elementProps = _objectWithoutProperties(actionProps, _excluded$C);
|
|
7052
7077
|
|
|
@@ -7056,9 +7081,20 @@ var Link = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
7056
7081
|
|
|
7057
7082
|
var _useInteractionState = useInteractionState(elementProps),
|
|
7058
7083
|
interaction = _useInteractionState.interaction,
|
|
7059
|
-
|
|
7084
|
+
_useInteractionState$ = _useInteractionState.interactionProps,
|
|
7085
|
+
handleMouseEnterInteraction = _useInteractionState$.onHoverIn,
|
|
7086
|
+
handleMouseLeaveInteraction = _useInteractionState$.onHoverOut,
|
|
7087
|
+
interactionProps = _objectWithoutProperties(_useInteractionState$, _excluded2);
|
|
7060
7088
|
|
|
7061
7089
|
return /*#__PURE__*/React.createElement(Text, _extends({}, elementProps, interactionProps, {
|
|
7090
|
+
onMouseEnter: function onMouseEnter(event) {
|
|
7091
|
+
handleMouseEnter(event);
|
|
7092
|
+
handleMouseEnterInteraction(event);
|
|
7093
|
+
},
|
|
7094
|
+
onMouseLeave: function onMouseLeave(event) {
|
|
7095
|
+
handleMouseLeave(event);
|
|
7096
|
+
handleMouseLeaveInteraction(event);
|
|
7097
|
+
},
|
|
7062
7098
|
ref: actionRef,
|
|
7063
7099
|
accessibilityRole: getRole$2(actionProps),
|
|
7064
7100
|
accessible: true,
|
|
@@ -8002,6 +8038,14 @@ var Offcanvas = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
8002
8038
|
transparent: true,
|
|
8003
8039
|
visible: navbar ? navbar.expanded : visible,
|
|
8004
8040
|
onRequestClose: handleToggle
|
|
8041
|
+
}, placement !== 'bottom' && /*#__PURE__*/React.createElement(SafeAreaView, {
|
|
8042
|
+
style: {
|
|
8043
|
+
flexGrow: 0
|
|
8044
|
+
}
|
|
8045
|
+
}), /*#__PURE__*/React.createElement(SafeAreaView, {
|
|
8046
|
+
style: {
|
|
8047
|
+
flexGrow: 1
|
|
8048
|
+
}
|
|
8005
8049
|
}, backdrop && /*#__PURE__*/React.createElement(View, {
|
|
8006
8050
|
style: backdropClasses
|
|
8007
8051
|
}, /*#__PURE__*/React.createElement(BackdropHandler, {
|
|
@@ -8012,11 +8056,7 @@ var Offcanvas = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
8012
8056
|
ref: concatRefs(offcanvasRef, ref),
|
|
8013
8057
|
style: [classes, style],
|
|
8014
8058
|
textStyle: [textClasses, textStyle]
|
|
8015
|
-
}), /*#__PURE__*/React.createElement(
|
|
8016
|
-
style: {
|
|
8017
|
-
flexShrink: 1
|
|
8018
|
-
}
|
|
8019
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
8059
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
8020
8060
|
style: [dialogClasses, dialogStyle],
|
|
8021
8061
|
textStyle: dialogTextStyle
|
|
8022
8062
|
}, /*#__PURE__*/React.createElement(OffcanvasContext.Provider, {
|