@draftbit/core 46.4.4-c18fe1.2 → 46.4.4-c96c31.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/lib/commonjs/Provider.js +9 -0
- package/lib/commonjs/components/Accordion/AccordionGroup.js +14 -0
- package/lib/commonjs/components/Accordion/AccordionItem.js +13 -0
- package/lib/commonjs/components/Accordion/index.js +3 -0
- package/lib/commonjs/components/ActionSheet/ActionSheet.js +9 -0
- package/lib/commonjs/components/ActionSheet/ActionSheetCancel.js +5 -0
- package/lib/commonjs/components/ActionSheet/ActionSheetItem.js +7 -0
- package/lib/commonjs/components/ActionSheet/index.js +4 -0
- package/lib/commonjs/components/AnimatedCircularProgress.js +26 -1
- package/lib/commonjs/components/AspectRatio.js +10 -0
- package/lib/commonjs/components/AvatarEdit.js +12 -0
- package/lib/commonjs/components/Banner.js +23 -9
- package/lib/commonjs/components/Button.js +19 -2
- package/lib/commonjs/components/Card.js +14 -0
- package/lib/commonjs/components/CardBlock.js +15 -0
- package/lib/commonjs/components/CardContainer.js +32 -4
- package/lib/commonjs/components/CardContainerRating.js +34 -6
- package/lib/commonjs/components/CardContainerShortImage.js +28 -4
- package/lib/commonjs/components/CardInline.js +14 -1
- package/lib/commonjs/components/Carousel.js +23 -5
- package/lib/commonjs/components/Checkbox/Checkbox.js +18 -3
- package/lib/commonjs/components/Checkbox/CheckboxGroup.js +11 -0
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +43 -5
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +47 -8
- package/lib/commonjs/components/Checkbox/context.js +5 -0
- package/lib/commonjs/components/Checkbox/index.js +4 -0
- package/lib/commonjs/components/CircleImage.js +10 -15
- package/lib/commonjs/components/CircularProgress.js +26 -8
- package/lib/commonjs/components/Config.js +13 -5
- package/lib/commonjs/components/Container.js +11 -0
- package/lib/commonjs/components/DatePicker/DatePicker.js +65 -23
- package/lib/commonjs/components/DatePicker/DatePickerComponent.js +7 -0
- package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js +10 -0
- package/lib/commonjs/components/DeprecatedButton.js +23 -0
- package/lib/commonjs/components/DeprecatedCardWrapper.js +27 -1
- package/lib/commonjs/components/DeprecatedFAB.js +26 -0
- package/lib/commonjs/components/Divider.js +9 -0
- package/lib/commonjs/components/Elevation.js +25 -2
- package/lib/commonjs/components/FAB.js +10 -0
- package/lib/commonjs/components/FieldSearchBarFull.js +18 -0
- package/lib/commonjs/components/FormRow.js +10 -0
- package/lib/commonjs/components/Header.js +13 -0
- package/lib/commonjs/components/HeaderLarge.js +9 -0
- package/lib/commonjs/components/HeaderMedium.js +9 -0
- package/lib/commonjs/components/HeaderOverline.js +9 -0
- package/lib/commonjs/components/IconButton.js +10 -0
- package/lib/commonjs/components/Image.js +17 -0
- package/lib/commonjs/components/Layout.js +12 -2
- package/lib/commonjs/components/NumberInput.js +21 -8
- package/lib/commonjs/components/Picker/Picker.js +42 -9
- package/lib/commonjs/components/Picker/PickerComponent.android.js +43 -7
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +27 -8
- package/lib/commonjs/components/Picker/PickerComponent.web.js +43 -7
- package/lib/commonjs/components/Portal/Portal.js +14 -4
- package/lib/commonjs/components/Portal/PortalConsumer.js +15 -5
- package/lib/commonjs/components/Portal/PortalHost.js +31 -4
- package/lib/commonjs/components/Portal/PortalManager.js +19 -7
- package/lib/commonjs/components/ProgressBar.js +45 -9
- package/lib/commonjs/components/ProgressCircle.js +10 -0
- package/lib/commonjs/components/ProgressIndicator.js +9 -0
- package/lib/commonjs/components/RadioButton/RadioButton.js +14 -1
- package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +10 -0
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +14 -0
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +44 -6
- package/lib/commonjs/components/RadioButton/context.js +5 -0
- package/lib/commonjs/components/RadioButton/index.js +5 -0
- package/lib/commonjs/components/Row.js +11 -0
- package/lib/commonjs/components/RowBodyIcon.js +10 -0
- package/lib/commonjs/components/RowHeadlineImageCaption.js +11 -2
- package/lib/commonjs/components/RowHeadlineImageIcon.js +10 -0
- package/lib/commonjs/components/SVG.js +9 -0
- package/lib/commonjs/components/ScreenContainer.js +36 -4
- package/lib/commonjs/components/Slider.js +21 -0
- package/lib/commonjs/components/StarRating.js +10 -0
- package/lib/commonjs/components/StepIndicator.js +71 -19
- package/lib/commonjs/components/Stepper.js +28 -8
- package/lib/commonjs/components/Surface.js +14 -0
- package/lib/commonjs/components/Swiper/Swiper.js +8 -0
- package/lib/commonjs/components/Swiper/SwiperItem.js +6 -0
- package/lib/commonjs/components/Swiper/index.js +3 -0
- package/lib/commonjs/components/Switch.js +18 -5
- package/lib/commonjs/components/Text.js +53 -8
- package/lib/commonjs/components/TextField.js +118 -35
- package/lib/commonjs/components/ToggleButton.js +14 -0
- package/lib/commonjs/components/Touchable.js +5 -0
- package/lib/commonjs/components/Touchable.web.js +2 -0
- package/lib/commonjs/components/Typography.js +5 -0
- package/lib/commonjs/components/useAuthState.js +9 -0
- package/lib/commonjs/constants.js +5 -1
- package/lib/commonjs/hooks.js +7 -4
- package/lib/commonjs/index.js +52 -7
- package/lib/commonjs/interfaces/Icon.js +5 -3
- package/lib/commonjs/mappings/Accordion.js +2 -0
- package/lib/commonjs/mappings/AccordionItem.js +2 -0
- package/lib/commonjs/mappings/ActionSheet.js +2 -0
- package/lib/commonjs/mappings/ActionSheetCancel.js +2 -0
- package/lib/commonjs/mappings/ActionSheetItem.js +2 -0
- package/lib/commonjs/mappings/ActivityIndicator.js +2 -0
- package/lib/commonjs/mappings/AudioPlayer.js +2 -0
- package/lib/commonjs/mappings/AvatarEdit.js +2 -0
- package/lib/commonjs/mappings/Banner.js +2 -0
- package/lib/commonjs/mappings/BlurView.js +2 -0
- package/lib/commonjs/mappings/Button.js +5 -6
- package/lib/commonjs/mappings/Card.js +4 -3
- package/lib/commonjs/mappings/CardBlock.js +5 -6
- package/lib/commonjs/mappings/CardContainer.js +7 -5
- package/lib/commonjs/mappings/CardContainerRating.js +4 -4
- package/lib/commonjs/mappings/CardContainerShortImage.js +2 -0
- package/lib/commonjs/mappings/CardInline.js +2 -0
- package/lib/commonjs/mappings/Carousel.js +2 -0
- package/lib/commonjs/mappings/Checkbox.js +2 -0
- package/lib/commonjs/mappings/CheckboxGroup.js +2 -0
- package/lib/commonjs/mappings/CheckboxRow.js +2 -0
- package/lib/commonjs/mappings/CircleImage.js +2 -0
- package/lib/commonjs/mappings/Container.js +2 -0
- package/lib/commonjs/mappings/CustomCode.js +2 -0
- package/lib/commonjs/mappings/DatePicker.js +17 -4
- package/lib/commonjs/mappings/Divider.js +2 -0
- package/lib/commonjs/mappings/FAB.js +2 -0
- package/lib/commonjs/mappings/Fetch.js +2 -0
- package/lib/commonjs/mappings/FieldSearchBarFull.js +3 -2
- package/lib/commonjs/mappings/FlashList.js +2 -0
- package/lib/commonjs/mappings/FlatList.js +2 -0
- package/lib/commonjs/mappings/HeaderLarge.js +2 -0
- package/lib/commonjs/mappings/HeaderMedium.js +2 -0
- package/lib/commonjs/mappings/HeaderOverline.js +2 -0
- package/lib/commonjs/mappings/Icon.js +3 -2
- package/lib/commonjs/mappings/IconButton.js +2 -0
- package/lib/commonjs/mappings/Image.js +2 -0
- package/lib/commonjs/mappings/ImageBackground.js +2 -0
- package/lib/commonjs/mappings/KeyboardAvoidingView.js +2 -0
- package/lib/commonjs/mappings/KeyboardAwareScrollView.js +2 -0
- package/lib/commonjs/mappings/Layout.js +2 -0
- package/lib/commonjs/mappings/LinearGradient.js +2 -0
- package/lib/commonjs/mappings/MapCallout.js +2 -0
- package/lib/commonjs/mappings/MapMarker.js +2 -0
- package/lib/commonjs/mappings/MapView.js +2 -0
- package/lib/commonjs/mappings/Modal.js +2 -0
- package/lib/commonjs/mappings/NumberInput.js +4 -4
- package/lib/commonjs/mappings/Picker.js +4 -4
- package/lib/commonjs/mappings/ProgressBar.js +2 -0
- package/lib/commonjs/mappings/ProgressCircle.js +2 -0
- package/lib/commonjs/mappings/ProgressIndicator.js +2 -0
- package/lib/commonjs/mappings/RadioButton.js +2 -0
- package/lib/commonjs/mappings/RadioButtonGroup.js +2 -0
- package/lib/commonjs/mappings/RadioButtonRow.js +2 -0
- package/lib/commonjs/mappings/RowBodyIcon.js +2 -0
- package/lib/commonjs/mappings/RowHeadlineImageCaption.js +2 -0
- package/lib/commonjs/mappings/RowHeadlineImageIcon.js +8 -12
- package/lib/commonjs/mappings/SVG.js +2 -0
- package/lib/commonjs/mappings/SafeAreaView.js +2 -0
- package/lib/commonjs/mappings/ScrollView.js +2 -0
- package/lib/commonjs/mappings/Slider.js +2 -0
- package/lib/commonjs/mappings/StarRating.js +9 -3
- package/lib/commonjs/mappings/Stepper.js +3 -1
- package/lib/commonjs/mappings/Surface.js +2 -0
- package/lib/commonjs/mappings/Swiper.js +2 -0
- package/lib/commonjs/mappings/SwiperItem.js +2 -0
- package/lib/commonjs/mappings/Switch.js +2 -0
- package/lib/commonjs/mappings/Text.js +5 -5
- package/lib/commonjs/mappings/TextArea.js +3 -2
- package/lib/commonjs/mappings/TextField.js +8 -7
- package/lib/commonjs/mappings/TextInput.js +3 -2
- package/lib/commonjs/mappings/ToggleButton.js +2 -0
- package/lib/commonjs/mappings/Touchable.js +2 -0
- package/lib/commonjs/mappings/Video.js +2 -0
- package/lib/commonjs/mappings/View.js +2 -0
- package/lib/commonjs/mappings/WebView.js +2 -0
- package/lib/commonjs/styles/DarkTheme.js +6 -5
- package/lib/commonjs/styles/DefaultTheme.js +17 -26
- package/lib/commonjs/styles/fonts.js +5 -3
- package/lib/commonjs/styles/overlay.js +14 -5
- package/lib/commonjs/styles/shadow.js +9 -0
- package/lib/commonjs/theming.js +4 -0
- package/lib/commonjs/utilities.js +14 -2
- package/lib/module/Provider.js +1 -0
- package/lib/module/components/Accordion/AccordionGroup.js +4 -0
- package/lib/module/components/Accordion/AccordionItem.js +28 -4
- package/lib/module/components/ActionSheet/ActionSheet.js +2 -0
- package/lib/module/components/ActionSheet/ActionSheetCancel.js +2 -0
- package/lib/module/components/ActionSheet/ActionSheetItem.js +2 -0
- package/lib/module/components/AnimatedCircularProgress.js +6 -0
- package/lib/module/components/AspectRatio.js +6 -0
- package/lib/module/components/AvatarEdit.js +3 -0
- package/lib/module/components/Banner.js +33 -12
- package/lib/module/components/Button.js +41 -12
- package/lib/module/components/Card.js +2 -0
- package/lib/module/components/CardBlock.js +20 -4
- package/lib/module/components/CardContainer.js +7 -0
- package/lib/module/components/CardContainerRating.js +8 -2
- package/lib/module/components/CardContainerShortImage.js +3 -0
- package/lib/module/components/CardInline.js +2 -0
- package/lib/module/components/Carousel.js +41 -11
- package/lib/module/components/Checkbox/Checkbox.js +9 -3
- package/lib/module/components/Checkbox/CheckboxGroup.js +5 -0
- package/lib/module/components/Checkbox/CheckboxGroupRow.js +31 -5
- package/lib/module/components/Checkbox/CheckboxRow.js +34 -8
- package/lib/module/components/Checkbox/context.js +3 -1
- package/lib/module/components/CircleImage.js +3 -0
- package/lib/module/components/CircularProgress.js +22 -8
- package/lib/module/components/Config.js +11 -5
- package/lib/module/components/Container.js +3 -0
- package/lib/module/components/DatePicker/DatePicker.js +73 -30
- package/lib/module/components/DatePicker/DatePickerComponent.js +2 -0
- package/lib/module/components/DatePicker/DatePickerComponent.web.js +2 -0
- package/lib/module/components/DeprecatedButton.js +9 -0
- package/lib/module/components/DeprecatedCardWrapper.js +6 -0
- package/lib/module/components/DeprecatedFAB.js +34 -3
- package/lib/module/components/Divider.js +3 -0
- package/lib/module/components/Elevation.js +3 -0
- package/lib/module/components/FAB.js +3 -0
- package/lib/module/components/FieldSearchBarFull.js +9 -0
- package/lib/module/components/FormRow.js +1 -0
- package/lib/module/components/Header.js +2 -0
- package/lib/module/components/HeaderLarge.js +2 -0
- package/lib/module/components/HeaderMedium.js +2 -0
- package/lib/module/components/HeaderOverline.js +2 -0
- package/lib/module/components/IconButton.js +3 -0
- package/lib/module/components/Image.js +27 -2
- package/lib/module/components/Layout.js +42 -21
- package/lib/module/components/NumberInput.js +16 -8
- package/lib/module/components/Picker/Picker.js +34 -10
- package/lib/module/components/Picker/PickerComponent.android.js +10 -6
- package/lib/module/components/Picker/PickerComponent.ios.js +11 -8
- package/lib/module/components/Picker/PickerComponent.web.js +10 -6
- package/lib/module/components/Portal/Portal.js +6 -4
- package/lib/module/components/Portal/PortalConsumer.js +14 -9
- package/lib/module/components/Portal/PortalHost.js +44 -15
- package/lib/module/components/Portal/PortalManager.js +14 -7
- package/lib/module/components/ProgressBar.js +17 -5
- package/lib/module/components/ProgressCircle.js +2 -0
- package/lib/module/components/ProgressIndicator.js +2 -0
- package/lib/module/components/RadioButton/RadioButton.js +20 -2
- package/lib/module/components/RadioButton/RadioButtonFieldGroup.js +3 -0
- package/lib/module/components/RadioButton/RadioButtonGroup.js +23 -2
- package/lib/module/components/RadioButton/RadioButtonRow.js +32 -6
- package/lib/module/components/RadioButton/context.js +3 -1
- package/lib/module/components/Row.js +2 -0
- package/lib/module/components/RowBodyIcon.js +2 -0
- package/lib/module/components/RowHeadlineImageCaption.js +3 -2
- package/lib/module/components/RowHeadlineImageIcon.js +2 -0
- package/lib/module/components/SVG.js +2 -0
- package/lib/module/components/ScreenContainer.js +6 -0
- package/lib/module/components/Slider.js +10 -0
- package/lib/module/components/StarRating.js +3 -0
- package/lib/module/components/StepIndicator.js +29 -5
- package/lib/module/components/Stepper.js +18 -10
- package/lib/module/components/Surface.js +20 -1
- package/lib/module/components/Swiper/Swiper.js +4 -0
- package/lib/module/components/Swiper/SwiperItem.js +2 -0
- package/lib/module/components/Switch.js +27 -12
- package/lib/module/components/Text.js +10 -3
- package/lib/module/components/TextField.js +105 -35
- package/lib/module/components/ToggleButton.js +5 -0
- package/lib/module/components/Touchable.js +1 -0
- package/lib/module/components/useAuthState.js +4 -0
- package/lib/module/constants.js +1 -2
- package/lib/module/hooks.js +2 -4
- package/lib/module/index.js +2 -5
- package/lib/module/interfaces/Icon.js +1 -2
- package/lib/module/mappings/Button.js +3 -6
- package/lib/module/mappings/Card.js +2 -3
- package/lib/module/mappings/CardBlock.js +3 -6
- package/lib/module/mappings/CardContainer.js +5 -5
- package/lib/module/mappings/CardContainerRating.js +2 -4
- package/lib/module/mappings/DatePicker.js +16 -5
- package/lib/module/mappings/Fetch.js +1 -0
- package/lib/module/mappings/FieldSearchBarFull.js +5 -3
- package/lib/module/mappings/Icon.js +1 -2
- package/lib/module/mappings/NumberInput.js +2 -4
- package/lib/module/mappings/Picker.js +2 -4
- package/lib/module/mappings/RowHeadlineImageIcon.js +6 -12
- package/lib/module/mappings/StarRating.js +8 -3
- package/lib/module/mappings/Stepper.js +2 -2
- package/lib/module/mappings/Text.js +3 -5
- package/lib/module/mappings/TextArea.js +1 -2
- package/lib/module/mappings/TextField.js +6 -7
- package/lib/module/mappings/TextInput.js +1 -2
- package/lib/module/styles/DarkTheme.js +2 -4
- package/lib/module/styles/DefaultTheme.js +13 -26
- package/lib/module/styles/fonts.js +1 -2
- package/lib/module/styles/overlay.js +10 -4
- package/lib/module/styles/shadow.js +6 -0
- package/lib/module/utilities.js +5 -2
- package/lib/typescript/src/components/DatePicker/DatePicker.d.ts +4 -0
- package/lib/typescript/src/components/Stepper.d.ts +1 -2
- package/lib/typescript/src/index.d.ts +0 -1
- package/lib/typescript/src/mappings/DatePicker.d.ts +42 -0
- package/package.json +3 -5
- package/src/components/Carousel.js +2 -2
- package/src/components/Carousel.tsx +2 -2
- package/src/components/DatePicker/DatePicker.js +14 -8
- package/src/components/DatePicker/DatePicker.tsx +23 -7
- package/src/components/Picker/Picker.js +1 -1
- package/src/components/Picker/Picker.tsx +2 -2
- package/src/components/Stepper.js +6 -3
- package/src/components/Stepper.tsx +6 -6
- package/src/index.js +0 -1
- package/src/index.tsx +0 -1
- package/src/mappings/DatePicker.js +21 -1
- package/src/mappings/DatePicker.ts +23 -0
- package/src/mappings/Stepper.js +5 -2
- package/src/mappings/Stepper.ts +5 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.native.js +0 -58
- package/lib/commonjs/components/BottomSheet/BottomSheet.web.js +0 -83
- package/lib/commonjs/components/BottomSheet/index.js +0 -13
- package/lib/commonjs/components/BottomSheet/types.js +0 -5
- package/lib/commonjs/mappings/BottomSheet.js +0 -20
- package/lib/module/components/BottomSheet/BottomSheet.native.js +0 -49
- package/lib/module/components/BottomSheet/BottomSheet.web.js +0 -75
- package/lib/module/components/BottomSheet/index.js +0 -2
- package/lib/module/components/BottomSheet/types.js +0 -1
- package/lib/module/mappings/BottomSheet.js +0 -13
- package/lib/typescript/src/components/BottomSheet/BottomSheet.native.d.ts +0 -4
- package/lib/typescript/src/components/BottomSheet/BottomSheet.web.d.ts +0 -4
- package/lib/typescript/src/components/BottomSheet/index.d.ts +0 -1
- package/lib/typescript/src/components/BottomSheet/types.d.ts +0 -8
- package/lib/typescript/src/mappings/BottomSheet.d.ts +0 -19
- package/src/components/BottomSheet/BottomSheet.native.js +0 -37
- package/src/components/BottomSheet/BottomSheet.native.tsx +0 -60
- package/src/components/BottomSheet/BottomSheet.web.js +0 -56
- package/src/components/BottomSheet/BottomSheet.web.tsx +0 -90
- package/src/components/BottomSheet/index.js +0 -2
- package/src/components/BottomSheet/index.tsx +0 -2
- package/src/components/BottomSheet/types.js +0 -1
- package/src/components/BottomSheet/types.tsx +0 -8
- package/src/mappings/BottomSheet.js +0 -20
- package/src/mappings/BottomSheet.ts +0 -25
|
@@ -4,24 +4,37 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.Direction = void 0;
|
|
7
|
+
|
|
7
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
8
10
|
var _reactNative = require("react-native");
|
|
11
|
+
|
|
9
12
|
var _lodash = require("lodash");
|
|
13
|
+
|
|
10
14
|
var _utilities = require("../../utilities");
|
|
15
|
+
|
|
11
16
|
var _hooks = require("../../hooks");
|
|
17
|
+
|
|
12
18
|
var _Text = _interopRequireDefault(require("../Text"));
|
|
19
|
+
|
|
13
20
|
var _Touchable = _interopRequireDefault(require("../Touchable"));
|
|
21
|
+
|
|
14
22
|
var _Checkbox = _interopRequireDefault(require("./Checkbox"));
|
|
23
|
+
|
|
15
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
+
|
|
16
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
+
|
|
17
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
|
-
|
|
19
|
-
|
|
29
|
+
|
|
30
|
+
var Direction;
|
|
20
31
|
exports.Direction = Direction;
|
|
32
|
+
|
|
21
33
|
(function (Direction) {
|
|
22
34
|
Direction["Row"] = "row";
|
|
23
35
|
Direction["RowReverse"] = "row-reverse";
|
|
24
36
|
})(Direction || (exports.Direction = Direction = {}));
|
|
37
|
+
|
|
25
38
|
const renderLabel = (value, labelStyle, textStyle) => {
|
|
26
39
|
if ((0, _lodash.isString)(value)) {
|
|
27
40
|
return /*#__PURE__*/React.createElement(_Text.default, {
|
|
@@ -31,6 +44,7 @@ const renderLabel = (value, labelStyle, textStyle) => {
|
|
|
31
44
|
return /*#__PURE__*/React.createElement(React.Fragment, null, value);
|
|
32
45
|
}
|
|
33
46
|
};
|
|
47
|
+
|
|
34
48
|
const CheckboxRow = _ref => {
|
|
35
49
|
let {
|
|
36
50
|
label = "Label",
|
|
@@ -58,38 +72,42 @@ const CheckboxRow = _ref => {
|
|
|
58
72
|
if (status != null) {
|
|
59
73
|
setInternalValue(status);
|
|
60
74
|
}
|
|
61
|
-
}, [status]);
|
|
62
|
-
|
|
63
|
-
// This special logic is to handle weird APIs like Airtable that return
|
|
75
|
+
}, [status]); // This special logic is to handle weird APIs like Airtable that return
|
|
64
76
|
// true or undefined for a boolean
|
|
77
|
+
|
|
65
78
|
const previousDefaultValue = (0, _hooks.usePrevious)(defaultValue);
|
|
66
79
|
React.useEffect(() => {
|
|
67
80
|
if (defaultValue !== previousDefaultValue) {
|
|
68
81
|
setInternalValue(Boolean(defaultValue));
|
|
69
82
|
}
|
|
70
83
|
}, [defaultValue, previousDefaultValue]);
|
|
84
|
+
|
|
71
85
|
const handlePress = () => {
|
|
72
86
|
const newValue = !internalValue;
|
|
73
87
|
setInternalValue(newValue);
|
|
74
88
|
onPress === null || onPress === void 0 ? void 0 : onPress(newValue);
|
|
89
|
+
|
|
75
90
|
if (newValue) {
|
|
76
91
|
onCheck === null || onCheck === void 0 ? void 0 : onCheck();
|
|
77
92
|
}
|
|
93
|
+
|
|
78
94
|
if (!newValue) {
|
|
79
95
|
onUncheck === null || onUncheck === void 0 ? void 0 : onUncheck();
|
|
80
96
|
}
|
|
81
97
|
};
|
|
98
|
+
|
|
82
99
|
const {
|
|
83
100
|
textStyles,
|
|
84
101
|
viewStyles
|
|
85
102
|
} = (0, _utilities.extractStyles)(style);
|
|
86
|
-
return /*#__PURE__*/React.createElement(_Touchable.default,
|
|
103
|
+
return /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
87
104
|
onPress: handlePress,
|
|
88
105
|
style: [viewStyles, styles.mainParent, {
|
|
89
106
|
flexDirection: direction
|
|
90
107
|
}],
|
|
91
|
-
disabled: disabled
|
|
92
|
-
|
|
108
|
+
disabled: disabled,
|
|
109
|
+
...rest
|
|
110
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
93
111
|
style: [styles.label, {
|
|
94
112
|
alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
|
|
95
113
|
}, labelContainerStyle]
|
|
@@ -106,6 +124,7 @@ const CheckboxRow = _ref => {
|
|
|
106
124
|
size: size
|
|
107
125
|
}));
|
|
108
126
|
};
|
|
127
|
+
|
|
109
128
|
const styles = _reactNative.StyleSheet.create({
|
|
110
129
|
mainParent: {
|
|
111
130
|
alignItems: "center",
|
|
@@ -125,5 +144,25 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
125
144
|
flex: 3
|
|
126
145
|
}
|
|
127
146
|
});
|
|
147
|
+
|
|
148
|
+
var _default = CheckboxRow;
|
|
149
|
+
exports.default = _default;ms: "center",
|
|
150
|
+
justifyContent: "space-around",
|
|
151
|
+
paddingStart: 20,
|
|
152
|
+
minHeight: 50,
|
|
153
|
+
paddingEnd: 20,
|
|
154
|
+
display: "flex",
|
|
155
|
+
..._reactNative.Platform.select({
|
|
156
|
+
web: {
|
|
157
|
+
cursor: "pointer",
|
|
158
|
+
userSelect: "none"
|
|
159
|
+
}
|
|
160
|
+
})
|
|
161
|
+
},
|
|
162
|
+
label: {
|
|
163
|
+
flex: 3
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
|
|
128
167
|
var _default = CheckboxRow;
|
|
129
168
|
exports.default = _default;
|
|
@@ -5,19 +5,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.checkboxGroupContext = exports.Direction = void 0;
|
|
7
7
|
exports.useCheckboxGroupContext = useCheckboxGroupContext;
|
|
8
|
+
|
|
8
9
|
var _react = require("react");
|
|
10
|
+
|
|
9
11
|
let Direction;
|
|
10
12
|
exports.Direction = Direction;
|
|
13
|
+
|
|
11
14
|
(function (Direction) {
|
|
12
15
|
Direction["Horizontal"] = "horizontal";
|
|
13
16
|
Direction["Vertical"] = "vertical";
|
|
14
17
|
})(Direction || (exports.Direction = Direction = {}));
|
|
18
|
+
|
|
15
19
|
const checkboxGroupContext = /*#__PURE__*/(0, _react.createContext)({
|
|
16
20
|
onValueChange: () => {},
|
|
17
21
|
values: [],
|
|
18
22
|
direction: undefined
|
|
19
23
|
});
|
|
20
24
|
exports.checkboxGroupContext = checkboxGroupContext;
|
|
25
|
+
|
|
21
26
|
function useCheckboxGroupContext() {
|
|
22
27
|
return (0, _react.useContext)(checkboxGroupContext);
|
|
23
28
|
}
|
|
@@ -21,7 +21,11 @@ Object.defineProperty(exports, "CheckboxRow", {
|
|
|
21
21
|
return _CheckboxRow.default;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
+
|
|
24
25
|
var _Checkbox = _interopRequireDefault(require("./Checkbox"));
|
|
26
|
+
|
|
25
27
|
var _CheckboxGroup = _interopRequireDefault(require("./CheckboxGroup"));
|
|
28
|
+
|
|
26
29
|
var _CheckboxRow = _interopRequireDefault(require("./CheckboxRow"));
|
|
30
|
+
|
|
27
31
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -4,12 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
8
10
|
var _reactNative = require("react-native");
|
|
11
|
+
|
|
9
12
|
var _Config = _interopRequireDefault(require("./Config"));
|
|
13
|
+
|
|
10
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
11
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
+
|
|
12
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
+
|
|
20
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
+
|
|
13
22
|
const CircleImage = _ref => {
|
|
14
23
|
let {
|
|
15
24
|
source = _Config.default.placeholderImageURL,
|
|
@@ -18,21 +27,6 @@ const CircleImage = _ref => {
|
|
|
18
27
|
...props
|
|
19
28
|
} = _ref;
|
|
20
29
|
const borderRadius = size / 2;
|
|
21
|
-
return /*#__PURE__*/React.createElement(_reactNative.Image, {
|
|
22
|
-
style: [{
|
|
23
|
-
width: size,
|
|
24
|
-
height: size,
|
|
25
|
-
borderRadius
|
|
26
|
-
}, style],
|
|
27
|
-
source: typeof source === "string" ? {
|
|
28
|
-
uri: source
|
|
29
|
-
} : source,
|
|
30
|
-
resizeMode: "cover",
|
|
31
|
-
...props
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var _default = CircleImage;
|
|
35
|
-
exports.default = _default;size / 2;
|
|
36
30
|
return /*#__PURE__*/React.createElement(_reactNative.Image, _extends({
|
|
37
31
|
style: [{
|
|
38
32
|
width: size,
|
|
@@ -45,5 +39,6 @@ exports.default = _default;size / 2;
|
|
|
45
39
|
resizeMode: "cover"
|
|
46
40
|
}, props));
|
|
47
41
|
};
|
|
42
|
+
|
|
48
43
|
var _default = CircleImage;
|
|
49
44
|
exports.default = _default;
|
|
@@ -4,32 +4,38 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
8
10
|
var _reactNative = require("react-native");
|
|
11
|
+
|
|
9
12
|
var _reactNativeSvg = require("react-native-svg");
|
|
13
|
+
|
|
10
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
13
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
15
|
+
|
|
14
16
|
class CircularProgress extends _react.default.Component {
|
|
15
17
|
constructor() {
|
|
16
18
|
super(...arguments);
|
|
17
|
-
|
|
19
|
+
|
|
20
|
+
this.polarToCartesian = (centerX, centerY, radius, angleInDegrees) => {
|
|
18
21
|
var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;
|
|
19
22
|
return {
|
|
20
23
|
x: centerX + radius * Math.cos(angleInRadians),
|
|
21
24
|
y: centerY + radius * Math.sin(angleInRadians)
|
|
22
25
|
};
|
|
23
|
-
}
|
|
24
|
-
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
this.circlePath = (x, y, radius, startAngle, endAngle) => {
|
|
25
29
|
var start = this.polarToCartesian(x, y, radius, endAngle * 0.9999);
|
|
26
30
|
var end = this.polarToCartesian(x, y, radius, startAngle);
|
|
27
31
|
var largeArcFlag = endAngle - startAngle <= 180 ? "0" : "1";
|
|
28
32
|
var d = ["M", start.x, start.y, "A", radius, radius, 0, largeArcFlag, 0, end.x, end.y];
|
|
29
33
|
return d.join(" ");
|
|
30
|
-
}
|
|
31
|
-
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
this.clampFill = fill => Math.min(100, Math.max(0, fill));
|
|
32
37
|
}
|
|
38
|
+
|
|
33
39
|
render() {
|
|
34
40
|
const {
|
|
35
41
|
size,
|
|
@@ -107,6 +113,18 @@ class CircularProgress extends _react.default.Component {
|
|
|
107
113
|
style: localChildrenContainerStyle
|
|
108
114
|
}, children(fill)));
|
|
109
115
|
}
|
|
116
|
+
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
var _default = CircularProgress;
|
|
120
|
+
exports.default = _default;okeDasharrayTint,
|
|
121
|
+
fill: "transparent"
|
|
122
|
+
}), cap)), children && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
123
|
+
style: localChildrenContainerStyle
|
|
124
|
+
}, children(fill)));
|
|
125
|
+
}
|
|
126
|
+
|
|
110
127
|
}
|
|
128
|
+
|
|
111
129
|
var _default = CircularProgress;
|
|
112
130
|
exports.default = _default;
|
|
@@ -4,38 +4,46 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var _reactNative = require("react-native");
|
|
9
|
+
|
|
8
10
|
const getWindowDimensions = () => {
|
|
9
11
|
const {
|
|
10
12
|
width,
|
|
11
13
|
height
|
|
12
14
|
} = _reactNative.Dimensions.get("window");
|
|
15
|
+
|
|
13
16
|
return {
|
|
14
17
|
windowWidth: width,
|
|
15
18
|
windowHeight: height
|
|
16
19
|
};
|
|
17
20
|
};
|
|
21
|
+
|
|
18
22
|
const {
|
|
19
23
|
windowWidth,
|
|
20
24
|
windowHeight
|
|
21
25
|
} = getWindowDimensions();
|
|
26
|
+
|
|
22
27
|
const getFilters = options => {
|
|
23
28
|
const {
|
|
24
29
|
width,
|
|
25
30
|
height
|
|
26
31
|
} = options;
|
|
27
32
|
const filters = ["c_scale", "q_auto", "dpr_auto"];
|
|
28
|
-
if (width) filters.push(
|
|
29
|
-
if (height) filters.push(
|
|
33
|
+
if (width) filters.push("w_".concat(width));
|
|
34
|
+
if (height) filters.push("h_".concat(height));
|
|
30
35
|
return filters.join(",");
|
|
31
36
|
};
|
|
37
|
+
|
|
32
38
|
const buildImageUrl = (options, name) => {
|
|
33
39
|
const filters = getFilters(options);
|
|
34
|
-
return ["https://res.cloudinary.com/altos/image/upload", filters,
|
|
40
|
+
return ["https://res.cloudinary.com/altos/image/upload", filters, "".concat(name, ".png")].join("/");
|
|
35
41
|
};
|
|
42
|
+
|
|
36
43
|
const getExtension = () => {
|
|
37
44
|
return _reactNative.Platform.OS === "web" ? ".svg" : ".png";
|
|
38
45
|
};
|
|
46
|
+
|
|
39
47
|
var _default = {
|
|
40
48
|
windowWidth,
|
|
41
49
|
windowHeight,
|
|
@@ -74,7 +82,7 @@ var _default = {
|
|
|
74
82
|
fieldSearchBarFullIconSize: 24,
|
|
75
83
|
stepperButtonSize: 40,
|
|
76
84
|
radioButtonSize: 24,
|
|
77
|
-
topSafeAreaViewHeight: 0
|
|
78
|
-
|
|
85
|
+
topSafeAreaViewHeight: 0 // topSafeAreaViewHeight: Platform.OS === "android" ? Constants.statusBarHeight : 0
|
|
86
|
+
|
|
79
87
|
};
|
|
80
88
|
exports.default = _default;
|
|
@@ -4,14 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
8
10
|
var _reactNative = require("react-native");
|
|
11
|
+
|
|
9
12
|
var _theming = require("../theming");
|
|
13
|
+
|
|
10
14
|
var _Elevation = _interopRequireDefault(require("./Elevation"));
|
|
15
|
+
|
|
11
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
12
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
|
|
13
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
+
|
|
14
22
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
|
+
|
|
15
24
|
const Container = _ref => {
|
|
16
25
|
let {
|
|
17
26
|
useThemeGutterPadding,
|
|
@@ -89,5 +98,7 @@ const Container = _ref => {
|
|
|
89
98
|
style: innerStyle
|
|
90
99
|
}, children));
|
|
91
100
|
};
|
|
101
|
+
|
|
92
102
|
var _default = (0, _theming.withTheme)(Container);
|
|
103
|
+
|
|
93
104
|
exports.default = _default;
|
|
@@ -4,23 +4,40 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
8
10
|
var _reactNative = require("react-native");
|
|
11
|
+
|
|
9
12
|
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
|
|
13
|
+
|
|
10
14
|
var _dateformat = _interopRequireDefault(require("dateformat"));
|
|
15
|
+
|
|
11
16
|
var _theming = require("../../theming");
|
|
17
|
+
|
|
12
18
|
var _Portal = _interopRequireDefault(require("../Portal/Portal"));
|
|
19
|
+
|
|
13
20
|
var _Touchable = _interopRequireDefault(require("../Touchable"));
|
|
21
|
+
|
|
14
22
|
var _DatePickerComponent = _interopRequireDefault(require("./DatePickerComponent"));
|
|
23
|
+
|
|
24
|
+
var _utilities = require("../../utilities");
|
|
25
|
+
|
|
15
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
+
|
|
16
28
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
|
+
|
|
17
30
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
|
+
|
|
18
32
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
33
|
+
|
|
19
34
|
const AnimatedText = _reactNative.Animated.createAnimatedComponent(_reactNative.Text);
|
|
35
|
+
|
|
20
36
|
const FOCUS_ANIMATION_DURATION = 150;
|
|
21
37
|
const BLUR_ANIMATION_DURATION = 180;
|
|
22
38
|
const ICON_SIZE = 24;
|
|
23
39
|
const MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
40
|
+
|
|
24
41
|
const DatePicker = _ref => {
|
|
25
42
|
let {
|
|
26
43
|
Icon,
|
|
@@ -42,7 +59,11 @@ const DatePicker = _ref => {
|
|
|
42
59
|
rightIconName,
|
|
43
60
|
leftIconMode = "inset",
|
|
44
61
|
label,
|
|
62
|
+
labelSize,
|
|
63
|
+
labelColor,
|
|
45
64
|
placeholder,
|
|
65
|
+
borderColor: inputBorderColor,
|
|
66
|
+
borderColorActive: inputBorderColorActive,
|
|
46
67
|
...props
|
|
47
68
|
} = _ref;
|
|
48
69
|
const [value, setValue] = React.useState(date || defaultValue);
|
|
@@ -59,50 +80,58 @@ const DatePicker = _ref => {
|
|
|
59
80
|
measured: false,
|
|
60
81
|
width: 0
|
|
61
82
|
});
|
|
83
|
+
const {
|
|
84
|
+
textStyles
|
|
85
|
+
} = (0, _utilities.extractStyles)(style);
|
|
86
|
+
|
|
62
87
|
const getValidDate = () => {
|
|
63
88
|
if (!value) {
|
|
64
89
|
return new Date();
|
|
65
90
|
}
|
|
91
|
+
|
|
66
92
|
return typeof (value === null || value === void 0 ? void 0 : value.getMonth) === "function" ? value : new Date();
|
|
67
93
|
};
|
|
94
|
+
|
|
68
95
|
const formatDate = () => {
|
|
69
96
|
if (!value) return "";
|
|
70
97
|
let newDate = getValidDate();
|
|
71
98
|
if (format) return (0, _dateformat.default)(newDate, format);
|
|
99
|
+
|
|
72
100
|
if (mode === "time") {
|
|
73
|
-
return
|
|
101
|
+
return "".concat(newDate.toLocaleTimeString());
|
|
74
102
|
}
|
|
103
|
+
|
|
75
104
|
if (mode === "datetime") {
|
|
76
|
-
return
|
|
105
|
+
return "".concat(newDate.toLocaleString());
|
|
77
106
|
}
|
|
78
|
-
|
|
107
|
+
|
|
108
|
+
return "".concat(MONTHS[newDate.getMonth()], " ").concat(newDate.getDate(), ", ").concat(newDate.getFullYear());
|
|
79
109
|
};
|
|
110
|
+
|
|
80
111
|
const toggleVisibility = async () => {
|
|
81
112
|
setPickerVisible(!pickerVisible);
|
|
82
113
|
focused ? _handleBlur() : _handleFocus();
|
|
83
114
|
};
|
|
84
|
-
const insets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
|
|
85
115
|
|
|
86
|
-
// const _restoreLabel = () =>
|
|
116
|
+
const insets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)(); // const _restoreLabel = () =>
|
|
87
117
|
// Animated.timing(labeled, {
|
|
88
118
|
// toValue: 1,
|
|
89
119
|
// duration: FOCUS_ANIMATION_DURATION,
|
|
90
120
|
// useNativeDriver: true,
|
|
91
121
|
// }).start();
|
|
92
|
-
|
|
93
122
|
// const _minmizeLabel = () =>
|
|
94
123
|
// Animated.timing(labeled, {
|
|
95
124
|
// toValue: 0,
|
|
96
125
|
// duration: BLUR_ANIMATION_DURATION,
|
|
97
126
|
// useNativeDriver: true,
|
|
98
127
|
// }).start();
|
|
99
|
-
|
|
100
128
|
// const _showPlaceholder = () =>
|
|
101
129
|
// setTimeout(() => setPlaceholder1(placeholder || ""), 50);
|
|
102
130
|
|
|
103
131
|
const _hidePlaceholder = () => {
|
|
104
132
|
setPlaceholder1("");
|
|
105
133
|
};
|
|
134
|
+
|
|
106
135
|
React.useEffect(() => {
|
|
107
136
|
setValue(date);
|
|
108
137
|
}, [date]);
|
|
@@ -125,34 +154,42 @@ const DatePicker = _ref => {
|
|
|
125
154
|
}, [value, focused, placeholder1, labeled]);
|
|
126
155
|
React.useEffect(() => {
|
|
127
156
|
const _showPlaceholder = () => setTimeout(() => setPlaceholder1(placeholder || ""), 50);
|
|
157
|
+
|
|
128
158
|
if (focused || !label) {
|
|
129
159
|
_showPlaceholder();
|
|
130
160
|
} else {
|
|
131
161
|
_hidePlaceholder();
|
|
132
162
|
}
|
|
163
|
+
|
|
133
164
|
return () => {
|
|
134
165
|
clearTimeout(_showPlaceholder());
|
|
135
166
|
};
|
|
136
167
|
}, [focused, label, placeholder]);
|
|
168
|
+
|
|
137
169
|
const _handleFocus = () => {
|
|
138
170
|
if (disabled) {
|
|
139
171
|
return;
|
|
140
172
|
}
|
|
173
|
+
|
|
141
174
|
setFocused(true);
|
|
142
175
|
};
|
|
176
|
+
|
|
143
177
|
const _handleBlur = () => {
|
|
144
178
|
if (disabled) {
|
|
145
179
|
return;
|
|
146
180
|
}
|
|
181
|
+
|
|
147
182
|
setFocused(false);
|
|
148
183
|
};
|
|
184
|
+
|
|
149
185
|
const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
|
|
150
186
|
const OUTLINE_MINIMIZED_LABEL_Y_OFFSET = -(16 * 0.5 + 4);
|
|
151
|
-
const MAXIMIZED_LABEL_FONT_SIZE = typography.subtitle1.fontSize;
|
|
152
|
-
const MINIMIZED_LABEL_FONT_SIZE = typography.caption.fontSize;
|
|
187
|
+
const MAXIMIZED_LABEL_FONT_SIZE = (textStyles === null || textStyles === void 0 ? void 0 : textStyles.fontSize) || typography.subtitle1.fontSize;
|
|
188
|
+
const MINIMIZED_LABEL_FONT_SIZE = labelSize ? labelSize : typography.caption.fontSize;
|
|
153
189
|
const hasActiveOutline = focused;
|
|
154
190
|
let inputTextColor, activeColor, underlineColor, borderColor, placeholderColor, containerStyle, backgroundColor, inputStyle;
|
|
155
191
|
inputTextColor = colors.strong;
|
|
192
|
+
|
|
156
193
|
if (disabled) {
|
|
157
194
|
activeColor = colors.light;
|
|
158
195
|
placeholderColor = colors.light;
|
|
@@ -160,11 +197,12 @@ const DatePicker = _ref => {
|
|
|
160
197
|
underlineColor = "transparent";
|
|
161
198
|
backgroundColor = colors.divider;
|
|
162
199
|
} else {
|
|
163
|
-
activeColor = colors.primary;
|
|
164
|
-
placeholderColor = borderColor = colors.light;
|
|
165
|
-
underlineColor = colors.light;
|
|
200
|
+
activeColor = inputBorderColorActive || colors.primary;
|
|
201
|
+
placeholderColor = borderColor = inputBorderColor || colors.light;
|
|
202
|
+
underlineColor = inputBorderColor || colors.light;
|
|
166
203
|
backgroundColor = colors.background;
|
|
167
204
|
}
|
|
205
|
+
|
|
168
206
|
const {
|
|
169
207
|
lineHeight,
|
|
170
208
|
...subtitle1
|
|
@@ -177,6 +215,7 @@ const DatePicker = _ref => {
|
|
|
177
215
|
...subtitle1,
|
|
178
216
|
height: lineHeight
|
|
179
217
|
};
|
|
218
|
+
|
|
180
219
|
if (type === "underline") {
|
|
181
220
|
containerStyle = {
|
|
182
221
|
borderTopLeftRadius: roundness,
|
|
@@ -196,15 +235,19 @@ const DatePicker = _ref => {
|
|
|
196
235
|
};
|
|
197
236
|
inputStyle.paddingHorizontal = 12;
|
|
198
237
|
}
|
|
238
|
+
|
|
199
239
|
if (leftIconName && leftIconMode === "outset") {
|
|
200
240
|
containerStyle.marginLeft = ICON_SIZE + 8;
|
|
201
241
|
}
|
|
242
|
+
|
|
202
243
|
let leftIconColor;
|
|
244
|
+
|
|
203
245
|
if (focused) {
|
|
204
246
|
leftIconColor = colors.primary;
|
|
205
247
|
} else {
|
|
206
248
|
leftIconColor = colors.light;
|
|
207
249
|
}
|
|
250
|
+
|
|
208
251
|
const leftIconProps = {
|
|
209
252
|
size: 24,
|
|
210
253
|
color: leftIconColor,
|
|
@@ -214,9 +257,9 @@ const DatePicker = _ref => {
|
|
|
214
257
|
position: "absolute",
|
|
215
258
|
marginTop: type === "solid" ? leftIconMode === "inset" ? MINIMIZED_LABEL_FONT_SIZE + 4 : 16 : leftIconMode === "outset" ? 16 : 0
|
|
216
259
|
};
|
|
217
|
-
const labelStyle = {
|
|
218
|
-
...typography.subtitle1,
|
|
260
|
+
const labelStyle = { ...typography.subtitle1,
|
|
219
261
|
top: type === "solid" ? 16 : 0,
|
|
262
|
+
fontFamily: textStyles === null || textStyles === void 0 ? void 0 : textStyles.fontFamily,
|
|
220
263
|
left: leftIconName && leftIconMode === "inset" ? ICON_SIZE + (type === "solid" ? 16 : 12) : 0,
|
|
221
264
|
transform: [{
|
|
222
265
|
// Move label to top
|
|
@@ -240,9 +283,7 @@ const DatePicker = _ref => {
|
|
|
240
283
|
};
|
|
241
284
|
const inputStyles = [styles.input, inputStyle, type === "solid" ? {
|
|
242
285
|
marginHorizontal: 12
|
|
243
|
-
} : {}];
|
|
244
|
-
|
|
245
|
-
// const render = (props) => <NativeTextInput {...props} />;
|
|
286
|
+
} : {}, textStyles]; // const render = (props) => <NativeTextInput {...props} />;
|
|
246
287
|
|
|
247
288
|
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
248
289
|
style: [styles.container, style]
|
|
@@ -277,8 +318,7 @@ const DatePicker = _ref => {
|
|
|
277
318
|
React.createElement(_reactNative.View, {
|
|
278
319
|
pointerEvents: "none",
|
|
279
320
|
style: [_reactNative.StyleSheet.absoluteFill, {
|
|
280
|
-
opacity:
|
|
281
|
-
// Hide the label in minimized state until we measure its width
|
|
321
|
+
opacity: // Hide the label in minimized state until we measure its width
|
|
282
322
|
date || focused ? labelLayout.measured ? 1 : 0 : 1
|
|
283
323
|
}]
|
|
284
324
|
}, /*#__PURE__*/React.createElement(AnimatedText, {
|
|
@@ -289,7 +329,7 @@ const DatePicker = _ref => {
|
|
|
289
329
|
style: [styles.placeholder, type === "solid" ? {
|
|
290
330
|
paddingHorizontal: 12
|
|
291
331
|
} : {}, labelStyle, {
|
|
292
|
-
color: colors.light,
|
|
332
|
+
color: labelColor || colors.light,
|
|
293
333
|
opacity: labeled.interpolate({
|
|
294
334
|
inputRange: [0, 1],
|
|
295
335
|
outputRange: [hasActiveOutline ? 1 : 0, 0]
|
|
@@ -300,13 +340,12 @@ const DatePicker = _ref => {
|
|
|
300
340
|
style: [styles.placeholder, type === "solid" ? {
|
|
301
341
|
paddingHorizontal: 12
|
|
302
342
|
} : {}, labelStyle, {
|
|
303
|
-
color:
|
|
343
|
+
color: labelColor || placeholder,
|
|
304
344
|
opacity: hasActiveOutline ? labeled : 1
|
|
305
345
|
}],
|
|
306
346
|
numberOfLines: 1
|
|
307
347
|
}, label)) : null, leftIconName && leftIconMode === "inset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
|
|
308
|
-
style: {
|
|
309
|
-
...leftIconStyle,
|
|
348
|
+
style: { ...leftIconStyle,
|
|
310
349
|
marginLeft: type === "solid" ? 16 : 0
|
|
311
350
|
}
|
|
312
351
|
})) : null, /*#__PURE__*/React.createElement(_reactNative.TextInput, _extends({
|
|
@@ -351,6 +390,7 @@ const DatePicker = _ref => {
|
|
|
351
390
|
}
|
|
352
391
|
})))));
|
|
353
392
|
};
|
|
393
|
+
|
|
354
394
|
const styles = _reactNative.StyleSheet.create({
|
|
355
395
|
container: {
|
|
356
396
|
alignSelf: "stretch"
|
|
@@ -390,5 +430,7 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
390
430
|
alignSelf: "flex-end"
|
|
391
431
|
}
|
|
392
432
|
});
|
|
433
|
+
|
|
393
434
|
var _default = (0, _theming.withTheme)(DatePicker);
|
|
435
|
+
|
|
394
436
|
exports.default = _default;
|
|
@@ -4,11 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
8
10
|
var _reactNative = require("react-native");
|
|
11
|
+
|
|
9
12
|
var _datetimepicker = _interopRequireDefault(require("@react-native-community/datetimepicker"));
|
|
13
|
+
|
|
10
14
|
var _reactNativeModalDatetimePicker = _interopRequireDefault(require("react-native-modal-datetime-picker"));
|
|
15
|
+
|
|
11
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
12
18
|
const DatePickerComponent = _ref => {
|
|
13
19
|
let {
|
|
14
20
|
value,
|
|
@@ -35,5 +41,6 @@ const DatePickerComponent = _ref => {
|
|
|
35
41
|
display: "default"
|
|
36
42
|
});
|
|
37
43
|
};
|
|
44
|
+
|
|
38
45
|
var _default = DatePickerComponent;
|
|
39
46
|
exports.default = _default;
|