@draftbit/core 49.5.1-99e063.2 → 49.5.1-eb936e.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 +1 -1
- package/lib/commonjs/components/AccordionGroup.js +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +1 -1
- package/lib/commonjs/components/Button.js +1 -1
- package/lib/commonjs/components/Checkbox/Checkbox.js +1 -1
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +1 -1
- package/lib/commonjs/components/DatePicker/DatePicker.js +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js +1 -1
- package/lib/commonjs/components/DeckSwiper/DeckSwiperCard.js +1 -1
- package/lib/commonjs/components/Divider.js +1 -1
- package/lib/commonjs/components/Elevation.js +1 -1
- package/lib/commonjs/components/IconButton.js +1 -1
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js +1 -1
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +1 -1
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/index.js +1 -1
- package/lib/commonjs/components/MediaPlayer/MediaPlayerCommon.js +1 -1
- package/lib/commonjs/components/MediaPlayer/VideoPlayer/VideoPlayer.js +1 -1
- package/lib/commonjs/components/Picker/NativePicker.js +1 -1
- package/lib/commonjs/components/Picker/PickerCommon.js +1 -1
- package/lib/commonjs/components/Picker/dropdown/DropDownModalPicker.js +1 -0
- package/lib/commonjs/components/Picker/dropdown/DropDownPicker.js +1 -1
- package/lib/commonjs/components/Picker/dropdown/MultiSelectPicker.js +1 -1
- package/lib/commonjs/components/Picker/index.js +1 -1
- package/lib/commonjs/components/PinInput/PinInput.js +1 -1
- package/lib/commonjs/components/PinInput/PinInputText.js +1 -1
- package/lib/commonjs/components/Portal/Portal.js +1 -1
- package/lib/commonjs/components/Progress/CircularProgress/CircularProgress.js +1 -1
- package/lib/commonjs/components/Progress/CircularProgress/index.js +1 -1
- package/lib/commonjs/components/Progress/LinearProgress/LinearProgress.js +1 -1
- package/lib/commonjs/components/Progress/LinearProgress/index.js +1 -1
- package/lib/commonjs/components/ProgressIndicator.js +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +1 -1
- package/lib/commonjs/components/Row.js +1 -1
- package/lib/commonjs/components/ScreenContainer.js +1 -1
- package/lib/commonjs/components/SectionList/SectionHeader.js +1 -1
- package/lib/commonjs/components/Slider.js +1 -1
- package/lib/commonjs/components/StarRating.js +1 -1
- package/lib/commonjs/components/Stepper.js +1 -1
- package/lib/commonjs/components/Surface.js +1 -1
- package/lib/commonjs/components/SwipeableItem/SwipeableItem.js +1 -1
- package/lib/commonjs/components/Swiper/Swiper.js +1 -1
- package/lib/commonjs/components/Switch.js +1 -1
- package/lib/commonjs/components/TabView/TabView.js +1 -1
- package/lib/commonjs/components/Table/Table.js +1 -1
- package/lib/commonjs/components/Table/TableRow.js +1 -1
- package/lib/commonjs/components/Text.js +1 -1
- package/lib/commonjs/components/TextField.js +1 -1
- package/lib/commonjs/components/TextInput.js +1 -1
- package/lib/commonjs/components/Typography.js +1 -1
- package/lib/commonjs/deprecated-components/AccordionItem.js +1 -1
- package/lib/commonjs/deprecated-components/AvatarEdit.js +1 -1
- package/lib/commonjs/deprecated-components/Banner.js +1 -1
- package/lib/commonjs/deprecated-components/Card.js +1 -1
- package/lib/commonjs/deprecated-components/Container.js +1 -1
- package/lib/commonjs/deprecated-components/DeprecatedButton.js +1 -1
- package/lib/commonjs/deprecated-components/DeprecatedCardWrapper.js +1 -1
- package/lib/commonjs/deprecated-components/DeprecatedFAB.js +1 -1
- package/lib/commonjs/deprecated-components/FAB.js +1 -1
- package/lib/commonjs/deprecated-components/FieldSearchBarFull.js +1 -1
- package/lib/commonjs/deprecated-components/ProgressCircle.js +1 -1
- package/lib/commonjs/deprecated-components/RadioButtonFieldGroup.js +1 -1
- package/lib/commonjs/deprecated-components/RowBodyIcon.js +1 -1
- package/lib/commonjs/deprecated-components/RowHeadlineImageCaption.js +1 -1
- package/lib/commonjs/deprecated-components/RowHeadlineImageIcon.js +1 -1
- package/lib/commonjs/deprecated-components/ToggleButton.js +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/styles/DarkTheme.js +1 -0
- package/lib/commonjs/styles/DefaultTheme.js +1 -0
- package/lib/commonjs/styles/fonts.js +1 -0
- package/lib/commonjs/styles/overlay.js +1 -0
- package/lib/commonjs/styles/shadow.js +1 -0
- package/lib/commonjs/theming.js +1 -0
- package/lib/typescript/src/Provider.d.ts +5 -7
- package/lib/typescript/src/Provider.js +4 -4
- package/lib/typescript/src/Provider.js.map +1 -1
- package/lib/typescript/src/components/AccordionGroup.d.ts +5 -3
- package/lib/typescript/src/components/AccordionGroup.js +3 -3
- package/lib/typescript/src/components/AccordionGroup.js.map +1 -1
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +5 -3
- package/lib/typescript/src/components/BottomSheet/BottomSheet.js +4 -4
- package/lib/typescript/src/components/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/typescript/src/components/Button.js +10 -11
- package/lib/typescript/src/components/Button.js.map +1 -1
- package/lib/typescript/src/components/Checkbox/Checkbox.js +3 -3
- package/lib/typescript/src/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/typescript/src/components/Checkbox/CheckboxRow.d.ts +2 -4
- package/lib/typescript/src/components/Checkbox/CheckboxRow.js +3 -4
- package/lib/typescript/src/components/Checkbox/CheckboxRow.js.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePicker.d.ts +5 -3
- package/lib/typescript/src/components/DatePicker/DatePicker.js +23 -24
- package/lib/typescript/src/components/DatePicker/DatePicker.js.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePickerComponent.web.d.ts +5010 -4
- package/lib/typescript/src/components/DatePicker/DatePickerComponent.web.js +6 -8
- package/lib/typescript/src/components/DatePicker/DatePickerComponent.web.js.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePickerComponentType.d.ts +2 -2
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.d.ts +5 -3
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.js +3 -3
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.js.map +1 -1
- package/lib/typescript/src/components/Divider.d.ts +5 -3
- package/lib/typescript/src/components/Divider.js +2 -2
- package/lib/typescript/src/components/Divider.js.map +1 -1
- package/lib/typescript/src/components/Elevation.d.ts +5 -3
- package/lib/typescript/src/components/Elevation.js +4 -3
- package/lib/typescript/src/components/Elevation.js.map +1 -1
- package/lib/typescript/src/components/FormRow.d.ts +2 -1
- package/lib/typescript/src/components/FormRow.js.map +1 -1
- package/lib/typescript/src/components/IconButton.d.ts +5 -3
- package/lib/typescript/src/components/IconButton.js +2 -2
- package/lib/typescript/src/components/IconButton.js.map +1 -1
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerCommon.d.ts +2 -0
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.d.ts +4 -5
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js +13 -10
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js.map +1 -1
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +3 -25
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js.map +1 -1
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/index.d.ts +4 -2
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/index.js +3 -1
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/index.js.map +1 -1
- package/lib/typescript/src/components/MediaPlayer/MediaPlayerCommon.d.ts +6 -0
- package/lib/typescript/src/components/MediaPlayer/MediaPlayerCommon.js +43 -0
- package/lib/typescript/src/components/MediaPlayer/MediaPlayerCommon.js.map +1 -1
- package/lib/typescript/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js +11 -3
- package/lib/typescript/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js.map +1 -1
- package/lib/typescript/src/components/Picker/NativePicker.d.ts +3 -1
- package/lib/typescript/src/components/Picker/NativePicker.js +2 -5
- package/lib/typescript/src/components/Picker/NativePicker.js.map +1 -1
- package/lib/typescript/src/components/Picker/PickerCommon.d.ts +8 -2
- package/lib/typescript/src/components/Picker/PickerCommon.js +11 -0
- package/lib/typescript/src/components/Picker/PickerCommon.js.map +1 -1
- package/lib/typescript/src/components/Picker/dropdown/DropDownModalPicker.d.ts +6 -0
- package/lib/typescript/src/components/Picker/dropdown/DropDownModalPicker.js +70 -0
- package/lib/typescript/src/components/Picker/dropdown/DropDownModalPicker.js.map +1 -0
- package/lib/typescript/src/components/Picker/dropdown/DropDownPicker.d.ts +3 -1
- package/lib/typescript/src/components/Picker/dropdown/DropDownPicker.js +5 -11
- package/lib/typescript/src/components/Picker/dropdown/DropDownPicker.js.map +1 -1
- package/lib/typescript/src/components/Picker/dropdown/MultiSelectPicker.d.ts +3 -1
- package/lib/typescript/src/components/Picker/dropdown/MultiSelectPicker.js +1 -1
- package/lib/typescript/src/components/Picker/dropdown/MultiSelectPicker.js.map +1 -1
- package/lib/typescript/src/components/Picker/index.d.ts +6 -4
- package/lib/typescript/src/components/Picker/index.js +5 -1
- package/lib/typescript/src/components/Picker/index.js.map +1 -1
- package/lib/typescript/src/components/PinInput/PinInput.d.ts +5 -3
- package/lib/typescript/src/components/PinInput/PinInput.js +4 -4
- package/lib/typescript/src/components/PinInput/PinInput.js.map +1 -1
- package/lib/typescript/src/components/PinInput/PinInputText.d.ts +5 -3
- package/lib/typescript/src/components/PinInput/PinInputText.js +2 -2
- package/lib/typescript/src/components/PinInput/PinInputText.js.map +1 -1
- package/lib/typescript/src/components/Portal/Portal.d.ts +9 -1
- package/lib/typescript/src/components/Portal/Portal.js +5 -3
- package/lib/typescript/src/components/Portal/Portal.js.map +1 -1
- package/lib/typescript/src/components/Progress/CircularProgress/CircularProgress.js +1 -1
- package/lib/typescript/src/components/Progress/CircularProgress/CircularProgress.js.map +1 -1
- package/lib/typescript/src/components/Progress/CircularProgress/index.d.ts +3 -1
- package/lib/typescript/src/components/Progress/CircularProgress/index.js +1 -1
- package/lib/typescript/src/components/Progress/CircularProgress/index.js.map +1 -1
- package/lib/typescript/src/components/Progress/LinearProgress/LinearProgress.js +1 -1
- package/lib/typescript/src/components/Progress/LinearProgress/LinearProgress.js.map +1 -1
- package/lib/typescript/src/components/Progress/LinearProgress/index.d.ts +3 -1
- package/lib/typescript/src/components/Progress/LinearProgress/index.js +1 -1
- package/lib/typescript/src/components/Progress/LinearProgress/index.js.map +1 -1
- package/lib/typescript/src/components/Progress/ProgressCommon.d.ts +2 -2
- package/lib/typescript/src/components/ProgressIndicator.d.ts +13 -10
- package/lib/typescript/src/components/ProgressIndicator.js +1 -1
- package/lib/typescript/src/components/ProgressIndicator.js.map +1 -1
- package/lib/typescript/src/components/RadioButton/RadioButtonGroup.d.ts +2 -2
- package/lib/typescript/src/components/RadioButton/RadioButtonRow.d.ts +2 -4
- package/lib/typescript/src/components/RadioButton/RadioButtonRow.js +3 -4
- package/lib/typescript/src/components/RadioButton/RadioButtonRow.js.map +1 -1
- package/lib/typescript/src/components/Row.d.ts +5 -3
- package/lib/typescript/src/components/Row.js +1 -1
- package/lib/typescript/src/components/Row.js.map +1 -1
- package/lib/typescript/src/components/ScreenContainer.d.ts +6 -3
- package/lib/typescript/src/components/ScreenContainer.js +2 -3
- package/lib/typescript/src/components/ScreenContainer.js.map +1 -1
- package/lib/typescript/src/components/SectionList/SectionHeader.d.ts +5 -3
- package/lib/typescript/src/components/SectionList/SectionHeader.js +3 -3
- package/lib/typescript/src/components/SectionList/SectionHeader.js.map +1 -1
- package/lib/typescript/src/components/Slider.d.ts +6 -3
- package/lib/typescript/src/components/Slider.js +6 -6
- package/lib/typescript/src/components/Slider.js.map +1 -1
- package/lib/typescript/src/components/StarRating.d.ts +5 -3
- package/lib/typescript/src/components/StarRating.js +1 -1
- package/lib/typescript/src/components/StarRating.js.map +1 -1
- package/lib/typescript/src/components/Stepper.d.ts +5 -3
- package/lib/typescript/src/components/Stepper.js +2 -3
- package/lib/typescript/src/components/Stepper.js.map +1 -1
- package/lib/typescript/src/components/Surface.d.ts +5 -3
- package/lib/typescript/src/components/Surface.js +10 -3
- package/lib/typescript/src/components/Surface.js.map +1 -1
- package/lib/typescript/src/components/SwipeableItem/SwipeableItem.d.ts +5 -3
- package/lib/typescript/src/components/SwipeableItem/SwipeableItem.js +5 -10
- package/lib/typescript/src/components/SwipeableItem/SwipeableItem.js.map +1 -1
- package/lib/typescript/src/components/Swiper/Swiper.d.ts +2 -4
- package/lib/typescript/src/components/Swiper/Swiper.js +2 -3
- package/lib/typescript/src/components/Swiper/Swiper.js.map +1 -1
- package/lib/typescript/src/components/Switch.d.ts +24 -7
- package/lib/typescript/src/components/Switch.js +4 -3
- package/lib/typescript/src/components/Switch.js.map +1 -1
- package/lib/typescript/src/components/TabView/TabView.d.ts +5 -3
- package/lib/typescript/src/components/TabView/TabView.js +4 -4
- package/lib/typescript/src/components/TabView/TabView.js.map +1 -1
- package/lib/typescript/src/components/Table/Table.d.ts +5 -3
- package/lib/typescript/src/components/Table/Table.js +2 -2
- package/lib/typescript/src/components/Table/Table.js.map +1 -1
- package/lib/typescript/src/components/Table/TableRow.d.ts +5 -3
- package/lib/typescript/src/components/Table/TableRow.js +2 -4
- package/lib/typescript/src/components/Table/TableRow.js.map +1 -1
- package/lib/typescript/src/components/Text.d.ts +9 -3
- package/lib/typescript/src/components/Text.js +2 -2
- package/lib/typescript/src/components/Text.js.map +1 -1
- package/lib/typescript/src/components/TextField.d.ts +41 -4
- package/lib/typescript/src/components/TextField.js +20 -22
- package/lib/typescript/src/components/TextField.js.map +1 -1
- package/lib/typescript/src/components/TextInput.js +0 -3
- package/lib/typescript/src/components/TextInput.js.map +1 -1
- package/lib/typescript/src/components/Typography.d.ts +11 -5
- package/lib/typescript/src/components/Typography.js +4 -4
- package/lib/typescript/src/components/Typography.js.map +1 -1
- package/lib/typescript/src/deprecated-components/AccordionItem.d.ts +5 -3
- package/lib/typescript/src/deprecated-components/AccordionItem.js +2 -2
- package/lib/typescript/src/deprecated-components/AccordionItem.js.map +1 -1
- package/lib/typescript/src/deprecated-components/AvatarEdit.d.ts +5 -3
- package/lib/typescript/src/deprecated-components/AvatarEdit.js +4 -4
- package/lib/typescript/src/deprecated-components/AvatarEdit.js.map +1 -1
- package/lib/typescript/src/deprecated-components/Banner.d.ts +5 -3
- package/lib/typescript/src/deprecated-components/Banner.js +5 -4
- package/lib/typescript/src/deprecated-components/Banner.js.map +1 -1
- package/lib/typescript/src/deprecated-components/Card.d.ts +18 -6
- package/lib/typescript/src/deprecated-components/Card.js +3 -3
- package/lib/typescript/src/deprecated-components/Card.js.map +1 -1
- package/lib/typescript/src/deprecated-components/CheckboxGroup.d.ts +2 -2
- package/lib/typescript/src/deprecated-components/Container.d.ts +5 -3
- package/lib/typescript/src/deprecated-components/Container.js +1 -1
- package/lib/typescript/src/deprecated-components/Container.js.map +1 -1
- package/lib/typescript/src/deprecated-components/DeprecatedButton.d.ts +5 -3
- package/lib/typescript/src/deprecated-components/DeprecatedButton.js +8 -8
- package/lib/typescript/src/deprecated-components/DeprecatedButton.js.map +1 -1
- package/lib/typescript/src/deprecated-components/DeprecatedCardWrapper.d.ts +5 -3
- package/lib/typescript/src/deprecated-components/DeprecatedCardWrapper.js +1 -1
- package/lib/typescript/src/deprecated-components/DeprecatedCardWrapper.js.map +1 -1
- package/lib/typescript/src/deprecated-components/DeprecatedFAB.d.ts +5 -3
- package/lib/typescript/src/deprecated-components/DeprecatedFAB.js +8 -8
- package/lib/typescript/src/deprecated-components/DeprecatedFAB.js.map +1 -1
- package/lib/typescript/src/deprecated-components/FAB.d.ts +8 -3
- package/lib/typescript/src/deprecated-components/FAB.js +2 -2
- package/lib/typescript/src/deprecated-components/FAB.js.map +1 -1
- package/lib/typescript/src/deprecated-components/FieldSearchBarFull.d.ts +5 -3
- package/lib/typescript/src/deprecated-components/FieldSearchBarFull.js +4 -4
- package/lib/typescript/src/deprecated-components/FieldSearchBarFull.js.map +1 -1
- package/lib/typescript/src/deprecated-components/ProgressCircle.d.ts +8 -5
- package/lib/typescript/src/deprecated-components/ProgressCircle.js +3 -3
- package/lib/typescript/src/deprecated-components/ProgressCircle.js.map +1 -1
- package/lib/typescript/src/deprecated-components/RadioButtonFieldGroup.d.ts +3 -1
- package/lib/typescript/src/deprecated-components/RadioButtonFieldGroup.js +1 -1
- package/lib/typescript/src/deprecated-components/RadioButtonFieldGroup.js.map +1 -1
- package/lib/typescript/src/deprecated-components/RowBodyIcon.d.ts +5 -3
- package/lib/typescript/src/deprecated-components/RowBodyIcon.js +2 -2
- package/lib/typescript/src/deprecated-components/RowBodyIcon.js.map +1 -1
- package/lib/typescript/src/deprecated-components/RowHeadlineImageCaption.d.ts +5 -3
- package/lib/typescript/src/deprecated-components/RowHeadlineImageCaption.js +3 -3
- package/lib/typescript/src/deprecated-components/RowHeadlineImageCaption.js.map +1 -1
- package/lib/typescript/src/deprecated-components/RowHeadlineImageIcon.d.ts +5 -3
- package/lib/typescript/src/deprecated-components/RowHeadlineImageIcon.js +3 -3
- package/lib/typescript/src/deprecated-components/RowHeadlineImageIcon.js.map +1 -1
- package/lib/typescript/src/deprecated-components/ToggleButton.d.ts +9 -6
- package/lib/typescript/src/deprecated-components/ToggleButton.js +5 -5
- package/lib/typescript/src/deprecated-components/ToggleButton.js.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.js +2 -0
- package/lib/typescript/src/index.js.map +1 -1
- package/lib/typescript/src/styles/DarkTheme.d.ts +3 -0
- package/lib/typescript/src/styles/DarkTheme.js +27 -0
- package/lib/typescript/src/styles/DarkTheme.js.map +1 -0
- package/lib/typescript/src/styles/DefaultTheme.d.ts +1670 -0
- package/lib/typescript/src/styles/DefaultTheme.js +112 -0
- package/lib/typescript/src/styles/DefaultTheme.js.map +1 -0
- package/lib/typescript/src/styles/fonts.d.ts +5 -0
- package/lib/typescript/src/styles/fonts.js +63 -0
- package/lib/typescript/src/styles/fonts.js.map +1 -0
- package/lib/typescript/src/styles/overlay.d.ts +2 -0
- package/lib/typescript/src/styles/overlay.js +61 -0
- package/lib/typescript/src/styles/overlay.js.map +1 -0
- package/lib/typescript/src/styles/shadow.d.ts +23 -0
- package/lib/typescript/src/styles/shadow.js +52 -0
- package/lib/typescript/src/styles/shadow.js.map +1 -0
- package/lib/typescript/src/theming.d.ts +8 -0
- package/lib/typescript/src/theming.js +4 -0
- package/lib/typescript/src/theming.js.map +1 -0
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -5
- package/src/Provider.js +4 -4
- package/src/Provider.js.map +1 -1
- package/src/Provider.tsx +12 -15
- package/src/components/AccordionGroup.js +3 -3
- package/src/components/AccordionGroup.js.map +1 -1
- package/src/components/AccordionGroup.tsx +5 -5
- package/src/components/BottomSheet/BottomSheet.js +4 -4
- package/src/components/BottomSheet/BottomSheet.js.map +1 -1
- package/src/components/BottomSheet/BottomSheet.tsx +7 -7
- package/src/components/Button.js +10 -11
- package/src/components/Button.js.map +1 -1
- package/src/components/Button.tsx +24 -12
- package/src/components/Checkbox/Checkbox.js +3 -3
- package/src/components/Checkbox/Checkbox.js.map +1 -1
- package/src/components/Checkbox/Checkbox.tsx +3 -3
- package/src/components/Checkbox/CheckboxRow.js +3 -4
- package/src/components/Checkbox/CheckboxRow.js.map +1 -1
- package/src/components/Checkbox/CheckboxRow.tsx +2 -9
- package/src/components/DatePicker/DatePicker.js +23 -24
- package/src/components/DatePicker/DatePicker.js.map +1 -1
- package/src/components/DatePicker/DatePicker.tsx +24 -25
- package/src/components/DatePicker/DatePickerComponent.web.js +6 -8
- package/src/components/DatePicker/DatePickerComponent.web.js.map +1 -1
- package/src/components/DatePicker/DatePickerComponent.web.tsx +8 -15
- package/src/components/DatePicker/DatePickerComponentType.ts +3 -2
- package/src/components/DeckSwiper/DeckSwiperCard.js +3 -3
- package/src/components/DeckSwiper/DeckSwiperCard.js.map +1 -1
- package/src/components/DeckSwiper/DeckSwiperCard.tsx +5 -5
- package/src/components/Divider.js +2 -2
- package/src/components/Divider.js.map +1 -1
- package/src/components/Divider.tsx +4 -4
- package/src/components/Elevation.js +4 -3
- package/src/components/Elevation.js.map +1 -1
- package/src/components/Elevation.tsx +6 -5
- package/src/components/FormRow.js.map +1 -1
- package/src/components/FormRow.tsx +2 -1
- package/src/components/IconButton.js +2 -2
- package/src/components/IconButton.js.map +1 -1
- package/src/components/IconButton.tsx +4 -4
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerCommon.ts +2 -0
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js +13 -10
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js.map +1 -1
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.tsx +19 -19
- package/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +3 -25
- package/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js.map +1 -1
- package/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.tsx +8 -31
- package/src/components/MediaPlayer/AudioPlayer/index.js +3 -1
- package/src/components/MediaPlayer/AudioPlayer/index.js.map +1 -1
- package/src/components/MediaPlayer/AudioPlayer/index.tsx +3 -1
- package/src/components/MediaPlayer/MediaPlayerCommon.js +43 -0
- package/src/components/MediaPlayer/MediaPlayerCommon.js.map +1 -1
- package/src/components/MediaPlayer/MediaPlayerCommon.ts +56 -0
- package/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js +11 -3
- package/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js.map +1 -1
- package/src/components/MediaPlayer/VideoPlayer/VideoPlayer.tsx +18 -1
- package/src/components/Picker/NativePicker.js +2 -5
- package/src/components/Picker/NativePicker.js.map +1 -1
- package/src/components/Picker/NativePicker.tsx +2 -5
- package/src/components/Picker/PickerCommon.js +11 -0
- package/src/components/Picker/PickerCommon.js.map +1 -1
- package/src/components/Picker/PickerCommon.ts +24 -2
- package/src/components/Picker/dropdown/DropDownModalPicker.js +70 -0
- package/src/components/Picker/dropdown/DropDownModalPicker.js.map +1 -0
- package/src/components/Picker/dropdown/DropDownModalPicker.tsx +155 -0
- package/src/components/Picker/dropdown/DropDownPicker.js +5 -11
- package/src/components/Picker/dropdown/DropDownPicker.js.map +1 -1
- package/src/components/Picker/dropdown/DropDownPicker.tsx +8 -21
- package/src/components/Picker/dropdown/MultiSelectPicker.js +1 -1
- package/src/components/Picker/dropdown/MultiSelectPicker.js.map +1 -1
- package/src/components/Picker/dropdown/MultiSelectPicker.tsx +1 -1
- package/src/components/Picker/index.js +5 -1
- package/src/components/Picker/index.js.map +1 -1
- package/src/components/Picker/index.tsx +15 -4
- package/src/components/PinInput/PinInput.js +4 -4
- package/src/components/PinInput/PinInput.js.map +1 -1
- package/src/components/PinInput/PinInput.tsx +6 -6
- package/src/components/PinInput/PinInputText.js +2 -2
- package/src/components/PinInput/PinInputText.js.map +1 -1
- package/src/components/PinInput/PinInputText.tsx +4 -4
- package/src/components/Portal/Portal.js +5 -3
- package/src/components/Portal/Portal.js.map +1 -1
- package/src/components/Portal/Portal.tsx +10 -3
- package/src/components/Progress/CircularProgress/CircularProgress.js +1 -1
- package/src/components/Progress/CircularProgress/CircularProgress.js.map +1 -1
- package/src/components/Progress/CircularProgress/CircularProgress.tsx +2 -2
- package/src/components/Progress/CircularProgress/index.js +1 -1
- package/src/components/Progress/CircularProgress/index.js.map +1 -1
- package/src/components/Progress/CircularProgress/index.tsx +1 -1
- package/src/components/Progress/LinearProgress/LinearProgress.js +1 -1
- package/src/components/Progress/LinearProgress/LinearProgress.js.map +1 -1
- package/src/components/Progress/LinearProgress/LinearProgress.tsx +2 -2
- package/src/components/Progress/LinearProgress/index.js +1 -1
- package/src/components/Progress/LinearProgress/index.js.map +1 -1
- package/src/components/Progress/LinearProgress/index.tsx +1 -1
- package/src/components/Progress/ProgressCommon.ts +2 -2
- package/src/components/ProgressIndicator.js +1 -1
- package/src/components/ProgressIndicator.js.map +1 -1
- package/src/components/ProgressIndicator.tsx +11 -10
- package/src/components/RadioButton/RadioButtonGroup.tsx +2 -2
- package/src/components/RadioButton/RadioButtonRow.js +3 -4
- package/src/components/RadioButton/RadioButtonRow.js.map +1 -1
- package/src/components/RadioButton/RadioButtonRow.tsx +2 -9
- package/src/components/Row.js +1 -1
- package/src/components/Row.js.map +1 -1
- package/src/components/Row.tsx +3 -3
- package/src/components/ScreenContainer.js +2 -3
- package/src/components/ScreenContainer.js.map +1 -1
- package/src/components/ScreenContainer.tsx +4 -5
- package/src/components/SectionList/SectionHeader.js +3 -3
- package/src/components/SectionList/SectionHeader.js.map +1 -1
- package/src/components/SectionList/SectionHeader.tsx +5 -5
- package/src/components/Slider.js +6 -6
- package/src/components/Slider.js.map +1 -1
- package/src/components/Slider.tsx +8 -8
- package/src/components/StarRating.js +1 -1
- package/src/components/StarRating.js.map +1 -1
- package/src/components/StarRating.tsx +3 -3
- package/src/components/Stepper.js +2 -3
- package/src/components/Stepper.js.map +1 -1
- package/src/components/Stepper.tsx +4 -5
- package/src/components/Surface.js +10 -3
- package/src/components/Surface.js.map +1 -1
- package/src/components/Surface.tsx +12 -5
- package/src/components/SwipeableItem/SwipeableItem.js +5 -10
- package/src/components/SwipeableItem/SwipeableItem.js.map +1 -1
- package/src/components/SwipeableItem/SwipeableItem.tsx +7 -13
- package/src/components/Swiper/Swiper.js +2 -3
- package/src/components/Swiper/Swiper.js.map +1 -1
- package/src/components/Swiper/Swiper.tsx +3 -6
- package/src/components/Switch.js +4 -3
- package/src/components/Switch.js.map +1 -1
- package/src/components/Switch.tsx +7 -7
- package/src/components/TabView/TabView.js +4 -4
- package/src/components/TabView/TabView.js.map +1 -1
- package/src/components/TabView/TabView.tsx +7 -7
- package/src/components/Table/Table.js +2 -2
- package/src/components/Table/Table.js.map +1 -1
- package/src/components/Table/Table.tsx +4 -4
- package/src/components/Table/TableRow.js +2 -4
- package/src/components/Table/TableRow.js.map +1 -1
- package/src/components/Table/TableRow.tsx +4 -6
- package/src/components/Text.js +2 -2
- package/src/components/Text.js.map +1 -1
- package/src/components/Text.tsx +4 -4
- package/src/components/TextField.js +20 -22
- package/src/components/TextField.js.map +1 -1
- package/src/components/TextField.tsx +23 -26
- package/src/components/TextInput.js +0 -3
- package/src/components/TextInput.js.map +1 -1
- package/src/components/TextInput.tsx +0 -3
- package/src/components/Typography.js +4 -4
- package/src/components/Typography.js.map +1 -1
- package/src/components/Typography.tsx +6 -6
- package/src/deprecated-components/AccordionItem.js +2 -2
- package/src/deprecated-components/AccordionItem.js.map +1 -1
- package/src/deprecated-components/AccordionItem.tsx +4 -4
- package/src/deprecated-components/AvatarEdit.js +4 -4
- package/src/deprecated-components/AvatarEdit.js.map +1 -1
- package/src/deprecated-components/AvatarEdit.tsx +6 -6
- package/src/deprecated-components/Banner.js +5 -4
- package/src/deprecated-components/Banner.js.map +1 -1
- package/src/deprecated-components/Banner.tsx +10 -6
- package/src/deprecated-components/Card.js +3 -3
- package/src/deprecated-components/Card.js.map +1 -1
- package/src/deprecated-components/Card.tsx +6 -10
- package/src/deprecated-components/CheckboxGroup.tsx +2 -2
- package/src/deprecated-components/Container.js +1 -1
- package/src/deprecated-components/Container.js.map +1 -1
- package/src/deprecated-components/Container.tsx +3 -3
- package/src/deprecated-components/DeprecatedButton.js +8 -8
- package/src/deprecated-components/DeprecatedButton.js.map +1 -1
- package/src/deprecated-components/DeprecatedButton.tsx +10 -10
- package/src/deprecated-components/DeprecatedCardWrapper.js +1 -1
- package/src/deprecated-components/DeprecatedCardWrapper.js.map +1 -1
- package/src/deprecated-components/DeprecatedCardWrapper.tsx +3 -3
- package/src/deprecated-components/DeprecatedFAB.js +8 -8
- package/src/deprecated-components/DeprecatedFAB.js.map +1 -1
- package/src/deprecated-components/DeprecatedFAB.tsx +10 -10
- package/src/deprecated-components/FAB.js +2 -2
- package/src/deprecated-components/FAB.js.map +1 -1
- package/src/deprecated-components/FAB.tsx +4 -4
- package/src/deprecated-components/FieldSearchBarFull.js +4 -4
- package/src/deprecated-components/FieldSearchBarFull.js.map +1 -1
- package/src/deprecated-components/FieldSearchBarFull.tsx +6 -6
- package/src/deprecated-components/ProgressCircle.js +3 -3
- package/src/deprecated-components/ProgressCircle.js.map +1 -1
- package/src/deprecated-components/ProgressCircle.tsx +8 -7
- package/src/deprecated-components/RadioButtonFieldGroup.js +1 -1
- package/src/deprecated-components/RadioButtonFieldGroup.js.map +1 -1
- package/src/deprecated-components/RadioButtonFieldGroup.tsx +1 -1
- package/src/deprecated-components/RowBodyIcon.js +2 -2
- package/src/deprecated-components/RowBodyIcon.js.map +1 -1
- package/src/deprecated-components/RowBodyIcon.tsx +6 -6
- package/src/deprecated-components/RowHeadlineImageCaption.js +3 -3
- package/src/deprecated-components/RowHeadlineImageCaption.js.map +1 -1
- package/src/deprecated-components/RowHeadlineImageCaption.tsx +6 -6
- package/src/deprecated-components/RowHeadlineImageIcon.js +3 -3
- package/src/deprecated-components/RowHeadlineImageIcon.js.map +1 -1
- package/src/deprecated-components/RowHeadlineImageIcon.tsx +6 -6
- package/src/deprecated-components/ToggleButton.js +5 -5
- package/src/deprecated-components/ToggleButton.js.map +1 -1
- package/src/deprecated-components/ToggleButton.tsx +11 -12
- package/src/index.js +2 -0
- package/src/index.js.map +1 -1
- package/src/index.tsx +2 -0
- package/src/styles/DarkTheme.js +27 -0
- package/src/styles/DarkTheme.js.map +1 -0
- package/src/styles/DarkTheme.tsx +30 -0
- package/src/styles/DefaultTheme.js +112 -0
- package/src/styles/DefaultTheme.js.map +1 -0
- package/src/styles/DefaultTheme.tsx +114 -0
- package/src/styles/fonts.js +63 -0
- package/src/styles/fonts.js.map +1 -0
- package/src/styles/fonts.tsx +67 -0
- package/src/styles/overlay.js +61 -0
- package/src/styles/overlay.js.map +1 -0
- package/src/styles/overlay.tsx +69 -0
- package/src/styles/shadow.js +52 -0
- package/src/styles/shadow.js.map +1 -0
- package/src/styles/shadow.tsx +55 -0
- package/src/theming.js +4 -0
- package/src/theming.js.map +1 -0
- package/src/theming.tsx +6 -0
|
@@ -6,11 +6,16 @@ import {
|
|
|
6
6
|
ResizeMode as ExpoResizeMode,
|
|
7
7
|
AVPlaybackStatus,
|
|
8
8
|
VideoFullscreenUpdate,
|
|
9
|
+
AVPlaybackSource,
|
|
9
10
|
} from "expo-av";
|
|
10
11
|
import { extractSizeStyles } from "../../../utilities";
|
|
11
12
|
import MediaPlaybackWrapper from "../MediaPlaybackWrapper";
|
|
12
13
|
import type { Playback } from "expo-av/src/AV";
|
|
13
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
mapToMediaPlayerStatus,
|
|
16
|
+
normalizeBase64Source,
|
|
17
|
+
useSourceDeepCompareEffect,
|
|
18
|
+
} from "../MediaPlayerCommon";
|
|
14
19
|
import type { MediaPlayerRef, MediaPlayerProps } from "../MediaPlayerCommon";
|
|
15
20
|
|
|
16
21
|
type ResizeMode = "contain" | "cover" | "stretch";
|
|
@@ -36,6 +41,7 @@ const VideoPlayer = React.forwardRef<VideoPlayerRef, VideoPlayerProps>(
|
|
|
36
41
|
posterResizeMode = "cover",
|
|
37
42
|
onPlaybackStatusUpdate: onPlaybackStatusUpdateProp,
|
|
38
43
|
onPlaybackFinish,
|
|
44
|
+
source,
|
|
39
45
|
...rest
|
|
40
46
|
},
|
|
41
47
|
ref
|
|
@@ -44,6 +50,8 @@ const VideoPlayer = React.forwardRef<VideoPlayerRef, VideoPlayerProps>(
|
|
|
44
50
|
React.useState<VideoPlayerComponent | null>();
|
|
45
51
|
const [isPlaying, setIsPlaying] = React.useState(false);
|
|
46
52
|
const [isFullscreen, setIsFullscreen] = React.useState(false);
|
|
53
|
+
const [currentSource, setCurrentSource] =
|
|
54
|
+
React.useState<AVPlaybackSource>();
|
|
47
55
|
const mediaPlaybackWrapperRef = React.useRef<MediaPlayerRef>(null);
|
|
48
56
|
|
|
49
57
|
const sizeStyles = extractSizeStyles(style);
|
|
@@ -110,6 +118,14 @@ const VideoPlayer = React.forwardRef<VideoPlayerRef, VideoPlayerProps>(
|
|
|
110
118
|
[toggleFullscreen, isPlaying]
|
|
111
119
|
);
|
|
112
120
|
|
|
121
|
+
useSourceDeepCompareEffect(() => {
|
|
122
|
+
const updateSource = async () => {
|
|
123
|
+
const finalSource = await normalizeBase64Source(source);
|
|
124
|
+
setCurrentSource(finalSource);
|
|
125
|
+
};
|
|
126
|
+
updateSource();
|
|
127
|
+
}, [source]);
|
|
128
|
+
|
|
113
129
|
return (
|
|
114
130
|
<MediaPlaybackWrapper
|
|
115
131
|
media={videoMediaObject as Playback | undefined}
|
|
@@ -125,6 +141,7 @@ const VideoPlayer = React.forwardRef<VideoPlayerRef, VideoPlayerProps>(
|
|
|
125
141
|
posterStyle={[sizeStyles, { resizeMode: posterResizeMode }]}
|
|
126
142
|
onPlaybackStatusUpdate={onPlaybackStatusUpdate}
|
|
127
143
|
onFullscreenUpdate={(e) => onFullscreenUpdate(e.fullscreenUpdate)}
|
|
144
|
+
source={currentSource}
|
|
128
145
|
{...rest}
|
|
129
146
|
/>
|
|
130
147
|
</MediaPlaybackWrapper>
|
|
@@ -7,7 +7,7 @@ import { Button } from "../Button";
|
|
|
7
7
|
import { useDeepCompareMemo } from "../../utilities";
|
|
8
8
|
import { normalizeToPickerOptions, } from "./PickerCommon";
|
|
9
9
|
import PickerInputContainer from "./PickerInputContainer";
|
|
10
|
-
import { withTheme } from "
|
|
10
|
+
import { withTheme } from "../../theming";
|
|
11
11
|
const isIos = Platform.OS === "ios";
|
|
12
12
|
const isWeb = Platform.OS === "web";
|
|
13
13
|
const NativePicker = ({ options: optionsProp = [], onValueChange, Icon, placeholder, value, autoDismissKeyboard = true, theme, disabled, ...rest }) => {
|
|
@@ -40,10 +40,7 @@ const NativePicker = ({ options: optionsProp = [], onValueChange, Icon, placehol
|
|
|
40
40
|
if (isIos) {
|
|
41
41
|
return (React.createElement(Portal, null,
|
|
42
42
|
React.createElement(SafeAreaView, { style: styles.iosPickerContent },
|
|
43
|
-
React.createElement(Button, { Icon: Icon, onPress: () => setPickerVisible(!pickerVisible), style: [
|
|
44
|
-
styles.iosButton,
|
|
45
|
-
{ color: theme.colors.branding.primary },
|
|
46
|
-
], title: "Close" }),
|
|
43
|
+
React.createElement(Button, { Icon: Icon, onPress: () => setPickerVisible(!pickerVisible), style: [styles.iosButton, { color: theme.colors.primary }], title: "Close" }),
|
|
47
44
|
renderNativePicker())));
|
|
48
45
|
}
|
|
49
46
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativePicker.js","sourceRoot":"","sources":["NativePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,MAAM,IAAI,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAGL,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"NativePicker.js","sourceRoot":"","sources":["NativePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MA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,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,QAAQ;QACxB,KAAK,EAAE,MAAM;QACb,eAAe,EAAE,OAAO;QACxB,OAAO,EAAE,CAAC;QACV,GAAG,QAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,MAAM,EAAE,MAAM,EAAE,+CAA+C;aAChE;SACF,CAAC;KACH;IACD,eAAe,EAAE;QACf,eAAe,EAAE,OAAO;KACzB;IACD,gBAAgB,EAAE;QAChB,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,CAAC;QACT,eAAe,EAAE,OAAO;KACzB;IACD,SAAS,EAAE;QACT,eAAe,EAAE,aAAa;QAC9B,WAAW,EAAE,CAAC;KACf;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC,YAAY,CAAC,CAAC"}
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
normalizeToPickerOptions,
|
|
12
12
|
} from "./PickerCommon";
|
|
13
13
|
import PickerInputContainer from "./PickerInputContainer";
|
|
14
|
-
import { withTheme } from "
|
|
14
|
+
import { withTheme } from "../../theming";
|
|
15
15
|
|
|
16
16
|
const isIos = Platform.OS === "ios";
|
|
17
17
|
const isWeb = Platform.OS === "web";
|
|
@@ -82,10 +82,7 @@ const NativePicker: React.FC<CommonPickerProps & SinglePickerProps> = ({
|
|
|
82
82
|
<Button
|
|
83
83
|
Icon={Icon}
|
|
84
84
|
onPress={() => setPickerVisible(!pickerVisible)}
|
|
85
|
-
style={[
|
|
86
|
-
styles.iosButton,
|
|
87
|
-
{ color: theme.colors.branding.primary },
|
|
88
|
-
]}
|
|
85
|
+
style={[styles.iosButton, { color: theme.colors.primary }]}
|
|
89
86
|
title="Close"
|
|
90
87
|
/>
|
|
91
88
|
{renderNativePicker()}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { isObject } from "lodash";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { flattenReactFragments } from "../../utilities";
|
|
4
|
+
import PickerItem from "./dropdown/PickerItem";
|
|
2
5
|
export function normalizeToPickerOptions(options) {
|
|
3
6
|
if (options.length === 0) {
|
|
4
7
|
return [];
|
|
@@ -22,4 +25,12 @@ export function normalizeToPickerOptions(options) {
|
|
|
22
25
|
}
|
|
23
26
|
throw new Error('Picker options must be either an array of strings, numbers, or an array of { "label": string | number; "value": string | number; } objects.');
|
|
24
27
|
}
|
|
28
|
+
export function usePickerItemProps(childrenProp) {
|
|
29
|
+
return React.useMemo(() => {
|
|
30
|
+
const children = flattenReactFragments(React.Children.toArray(childrenProp));
|
|
31
|
+
// Only the props of the first PickerItem are used, any others are ignored
|
|
32
|
+
const firstPickerItem = children.find((child) => child.type === PickerItem);
|
|
33
|
+
return (firstPickerItem === null || firstPickerItem === void 0 ? void 0 : firstPickerItem.props) || {};
|
|
34
|
+
}, [childrenProp]);
|
|
35
|
+
}
|
|
25
36
|
//# sourceMappingURL=PickerCommon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PickerCommon.js","sourceRoot":"","sources":["PickerCommon.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"PickerCommon.js","sourceRoot":"","sources":["PickerCommon.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,UAA+B,MAAM,uBAAuB,CAAC;AAsDpE,MAAM,UAAU,wBAAwB,CACtC,OAA6C;IAE7C,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;QACxB,OAAO,EAAE,CAAC;KACX;IAED,MAAM,WAAW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} from "lodash";
|
|
4
|
-
import
|
|
4
|
+
import { Theme } from "../../styles/DefaultTheme";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { flattenReactFragments } from "../../utilities";
|
|
7
|
+
import PickerItem, { PickerItemProps } from "./dropdown/PickerItem";
|
|
5
8
|
|
|
6
9
|
export interface PickerOption {
|
|
7
10
|
value: string | number;
|
|
@@ -27,7 +30,7 @@ export interface PickerInputContainerProps extends IconSlot {
|
|
|
27
30
|
export interface CommonPickerProps extends PickerInputContainerProps {
|
|
28
31
|
options: PickerOption[] | string[] | number[];
|
|
29
32
|
autoDismissKeyboard?: boolean;
|
|
30
|
-
theme:
|
|
33
|
+
theme: Theme;
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
export interface SinglePickerProps {
|
|
@@ -40,6 +43,10 @@ export interface MultiSelectPickerProps {
|
|
|
40
43
|
onValueChange: (value: (string | number)[]) => void;
|
|
41
44
|
}
|
|
42
45
|
|
|
46
|
+
export interface DropDownModalPickerProps {
|
|
47
|
+
dropdownOverlayColor?: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
43
50
|
export interface CommonDropDownPickerProps extends CommonPickerProps {
|
|
44
51
|
selectedIconName?: string;
|
|
45
52
|
selectedIconColor?: string;
|
|
@@ -84,3 +91,18 @@ export function normalizeToPickerOptions(
|
|
|
84
91
|
'Picker options must be either an array of strings, numbers, or an array of { "label": string | number; "value": string | number; } objects.'
|
|
85
92
|
);
|
|
86
93
|
}
|
|
94
|
+
|
|
95
|
+
export function usePickerItemProps(
|
|
96
|
+
childrenProp: React.ReactNode
|
|
97
|
+
): PickerItemProps {
|
|
98
|
+
return React.useMemo(() => {
|
|
99
|
+
const children = flattenReactFragments(
|
|
100
|
+
React.Children.toArray(childrenProp) as React.ReactElement[]
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
// Only the props of the first PickerItem are used, any others are ignored
|
|
104
|
+
const firstPickerItem = children.find((child) => child.type === PickerItem);
|
|
105
|
+
|
|
106
|
+
return firstPickerItem?.props || {};
|
|
107
|
+
}, [childrenProp]);
|
|
108
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View, Text, Keyboard } from "react-native";
|
|
3
|
+
import { extractStyles, useDeepCompareMemo } from "../../../utilities";
|
|
4
|
+
import { normalizeToPickerOptions, usePickerItemProps, } from "../PickerCommon";
|
|
5
|
+
import PickerInputContainer from "../PickerInputContainer";
|
|
6
|
+
import ModalPickerComponent from "react-native-select-dropdown";
|
|
7
|
+
import { withTheme } from "../../../theming";
|
|
8
|
+
import { useOnUpdate } from "../../../hooks";
|
|
9
|
+
const ModalPicker = ({ theme, options: optionsProp = [], onValueChange, Icon, placeholder, value, autoDismissKeyboard = true, selectedIconName = "Feather/check", selectedIconColor = theme.colors.strong, selectedIconSize = 20, dropDownBackgroundColor = theme.colors.background, dropDownBorderColor = theme.colors.divider, dropDownTextColor = theme.colors.strong, dropDownBorderWidth = 1, dropDownBorderRadius = 8, children: childrenProp, disabled, dropdownOverlayColor, ...rest }) => {
|
|
10
|
+
const dropdownRef = React.useRef();
|
|
11
|
+
const [internalValue, setInternalValue] = React.useState(value);
|
|
12
|
+
const pickerItemProps = usePickerItemProps(childrenProp);
|
|
13
|
+
const { viewStyles: pickerItemViewStyles, textStyles: pickerItemTextStyles } = extractStyles(pickerItemProps.style);
|
|
14
|
+
const options = useDeepCompareMemo(() => normalizeToPickerOptions(optionsProp).map((option) => ({
|
|
15
|
+
label: option.label.toString(),
|
|
16
|
+
value: option.value,
|
|
17
|
+
})), [optionsProp]);
|
|
18
|
+
useOnUpdate(() => {
|
|
19
|
+
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(internalValue !== null && internalValue !== void 0 ? internalValue : "");
|
|
20
|
+
// onValueChange excluded to prevent running on every re-render when using an anoymous function, which is the common case
|
|
21
|
+
}, [internalValue]);
|
|
22
|
+
return (React.createElement(PickerInputContainer, { testID: "dropdown-modal-picker", Icon: Icon, placeholder: placeholder, selectedValue: value, options: options, onPress: () => {
|
|
23
|
+
var _a;
|
|
24
|
+
(_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.openDropdown();
|
|
25
|
+
if (autoDismissKeyboard) {
|
|
26
|
+
Keyboard.dismiss();
|
|
27
|
+
}
|
|
28
|
+
}, disabled: disabled, ...rest },
|
|
29
|
+
React.createElement(ModalPickerComponent, { ref: dropdownRef, data: options, defaultValue: internalValue, onSelect: (selectedItem) => {
|
|
30
|
+
setInternalValue(selectedItem.value);
|
|
31
|
+
}, renderButton: () => {
|
|
32
|
+
return React.createElement(React.Fragment, null);
|
|
33
|
+
}, renderItem: (item, _, isSelected) => {
|
|
34
|
+
var _a, _b, _c;
|
|
35
|
+
const backgroundColor = isSelected
|
|
36
|
+
? (_a = pickerItemProps.selectedBackgroundColor) !== null && _a !== void 0 ? _a : pickerItemViewStyles.backgroundColor
|
|
37
|
+
: pickerItemViewStyles.backgroundColor;
|
|
38
|
+
const textColor = isSelected
|
|
39
|
+
? (_b = pickerItemProps.selectedTextColor) !== null && _b !== void 0 ? _b : dropDownTextColor
|
|
40
|
+
: dropDownTextColor;
|
|
41
|
+
const textSize = isSelected
|
|
42
|
+
? (_c = pickerItemProps.selectedTextSize) !== null && _c !== void 0 ? _c : 14
|
|
43
|
+
: 14;
|
|
44
|
+
return (React.createElement(View, { style: [
|
|
45
|
+
{
|
|
46
|
+
padding: 10,
|
|
47
|
+
flexDirection: "row",
|
|
48
|
+
alignItems: "center",
|
|
49
|
+
backgroundColor: backgroundColor,
|
|
50
|
+
},
|
|
51
|
+
pickerItemViewStyles,
|
|
52
|
+
] },
|
|
53
|
+
React.createElement(Text, { style: [
|
|
54
|
+
{
|
|
55
|
+
color: textColor,
|
|
56
|
+
fontSize: textSize,
|
|
57
|
+
flex: 1,
|
|
58
|
+
},
|
|
59
|
+
pickerItemTextStyles,
|
|
60
|
+
] }, item.label),
|
|
61
|
+
isSelected ? (React.createElement(Icon, { name: selectedIconName, size: selectedIconSize, color: selectedIconColor })) : null));
|
|
62
|
+
}, showsVerticalScrollIndicator: false, dropdownOverlayColor: dropdownOverlayColor, dropdownStyle: {
|
|
63
|
+
borderColor: dropDownBorderColor,
|
|
64
|
+
borderWidth: dropDownBorderWidth,
|
|
65
|
+
borderRadius: dropDownBorderRadius,
|
|
66
|
+
backgroundColor: dropDownBackgroundColor,
|
|
67
|
+
}, disableAutoScroll: true, statusBarTranslucent: true })));
|
|
68
|
+
};
|
|
69
|
+
export default withTheme(ModalPicker);
|
|
70
|
+
//# sourceMappingURL=DropDownModalPicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropDownModalPicker.js","sourceRoot":"","sources":["DropDownModalPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAIL,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAC3D,OAAO,oBAAoB,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,WAAW,GAIb,CAAC,EACH,KAAK,EACL,OAAO,EAAE,WAAW,GAAG,EAAE,EACzB,aAAa,EACb,IAAI,EACJ,WAAW,EACX,KAAK,EACL,mBAAmB,GAAG,IAAI,EAC1B,gBAAgB,GAAG,eAAe,EAClC,iBAAiB,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,EACvC,gBAAgB,GAAG,EAAE,EACrB,uBAAuB,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,EACjD,mBAAmB,GAAG,K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KAAK,CACN;oBACN,UAAU,CAAC,CAAC,CAAC,CACZ,oBAAC,IAAI,IACH,IAAI,EAAE,gBAAgB,EACtB,IAAI,EAAE,gBAAgB,EACtB,KAAK,EAAE,iBAAiB,GACxB,CACH,CAAC,CAAC,CAAC,IAAI,CACH,CACR,CAAC;YACJ,CAAC,EACD,4BAA4B,EAAE,KAAK,EACnC,oBAAoB,EAAE,oBAAoB,EAC1C,aAAa,EAAE;gBACb,WAAW,EAAE,mBAAmB;gBAChC,WAAW,EAAE,mBAAmB;gBAChC,YAAY,EAAE,oBAAoB;gBAClC,eAAe,EAAE,uBAAuB;aACzC,EACD,iBAAiB,QACjB,oBAAoB,SACpB,CACmB,CACxB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View, Text, Keyboard } from "react-native";
|
|
3
|
+
import { extractStyles, useDeepCompareMemo } from "../../../utilities";
|
|
4
|
+
import {
|
|
5
|
+
CommonDropDownPickerProps,
|
|
6
|
+
DropDownModalPickerProps,
|
|
7
|
+
SinglePickerProps,
|
|
8
|
+
normalizeToPickerOptions,
|
|
9
|
+
usePickerItemProps,
|
|
10
|
+
} from "../PickerCommon";
|
|
11
|
+
import PickerInputContainer from "../PickerInputContainer";
|
|
12
|
+
import ModalPickerComponent from "react-native-select-dropdown";
|
|
13
|
+
import { withTheme } from "../../../theming";
|
|
14
|
+
import { useOnUpdate } from "../../../hooks";
|
|
15
|
+
|
|
16
|
+
const ModalPicker: React.FC<
|
|
17
|
+
React.PropsWithChildren<
|
|
18
|
+
CommonDropDownPickerProps & SinglePickerProps & DropDownModalPickerProps
|
|
19
|
+
>
|
|
20
|
+
> = ({
|
|
21
|
+
theme,
|
|
22
|
+
options: optionsProp = [],
|
|
23
|
+
onValueChange,
|
|
24
|
+
Icon,
|
|
25
|
+
placeholder,
|
|
26
|
+
value,
|
|
27
|
+
autoDismissKeyboard = true,
|
|
28
|
+
selectedIconName = "Feather/check",
|
|
29
|
+
selectedIconColor = theme.colors.strong,
|
|
30
|
+
selectedIconSize = 20,
|
|
31
|
+
dropDownBackgroundColor = theme.colors.background,
|
|
32
|
+
dropDownBorderColor = theme.colors.divider,
|
|
33
|
+
dropDownTextColor = theme.colors.strong,
|
|
34
|
+
dropDownBorderWidth = 1,
|
|
35
|
+
dropDownBorderRadius = 8,
|
|
36
|
+
children: childrenProp,
|
|
37
|
+
disabled,
|
|
38
|
+
dropdownOverlayColor,
|
|
39
|
+
...rest
|
|
40
|
+
}) => {
|
|
41
|
+
const dropdownRef = React.useRef<ModalPickerComponent>();
|
|
42
|
+
|
|
43
|
+
const [internalValue, setInternalValue] = React.useState<
|
|
44
|
+
string | number | undefined
|
|
45
|
+
>(value);
|
|
46
|
+
|
|
47
|
+
const pickerItemProps = usePickerItemProps(childrenProp);
|
|
48
|
+
|
|
49
|
+
const { viewStyles: pickerItemViewStyles, textStyles: pickerItemTextStyles } =
|
|
50
|
+
extractStyles(pickerItemProps.style);
|
|
51
|
+
|
|
52
|
+
const options = useDeepCompareMemo(
|
|
53
|
+
() =>
|
|
54
|
+
normalizeToPickerOptions(optionsProp).map((option) => ({
|
|
55
|
+
label: option.label.toString(),
|
|
56
|
+
value: option.value,
|
|
57
|
+
})),
|
|
58
|
+
[optionsProp]
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
useOnUpdate(() => {
|
|
62
|
+
onValueChange?.(internalValue ?? "");
|
|
63
|
+
// onValueChange excluded to prevent running on every re-render when using an anoymous function, which is the common case
|
|
64
|
+
}, [internalValue]);
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<PickerInputContainer
|
|
68
|
+
testID="dropdown-modal-picker"
|
|
69
|
+
Icon={Icon}
|
|
70
|
+
placeholder={placeholder}
|
|
71
|
+
selectedValue={value}
|
|
72
|
+
options={options}
|
|
73
|
+
onPress={() => {
|
|
74
|
+
dropdownRef.current?.openDropdown();
|
|
75
|
+
if (autoDismissKeyboard) {
|
|
76
|
+
Keyboard.dismiss();
|
|
77
|
+
}
|
|
78
|
+
}}
|
|
79
|
+
disabled={disabled}
|
|
80
|
+
{...rest}
|
|
81
|
+
>
|
|
82
|
+
<ModalPickerComponent
|
|
83
|
+
ref={dropdownRef as React.LegacyRef<ModalPickerComponent>}
|
|
84
|
+
data={options}
|
|
85
|
+
defaultValue={internalValue}
|
|
86
|
+
onSelect={(selectedItem) => {
|
|
87
|
+
setInternalValue(selectedItem.value);
|
|
88
|
+
}}
|
|
89
|
+
renderButton={() => {
|
|
90
|
+
return <></>;
|
|
91
|
+
}}
|
|
92
|
+
renderItem={(item, _, isSelected) => {
|
|
93
|
+
const backgroundColor = isSelected
|
|
94
|
+
? pickerItemProps.selectedBackgroundColor ??
|
|
95
|
+
pickerItemViewStyles.backgroundColor
|
|
96
|
+
: pickerItemViewStyles.backgroundColor;
|
|
97
|
+
|
|
98
|
+
const textColor = isSelected
|
|
99
|
+
? pickerItemProps.selectedTextColor ?? dropDownTextColor
|
|
100
|
+
: dropDownTextColor;
|
|
101
|
+
|
|
102
|
+
const textSize = isSelected
|
|
103
|
+
? pickerItemProps.selectedTextSize ?? 14
|
|
104
|
+
: 14;
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<View
|
|
108
|
+
style={[
|
|
109
|
+
{
|
|
110
|
+
padding: 10,
|
|
111
|
+
flexDirection: "row",
|
|
112
|
+
alignItems: "center",
|
|
113
|
+
backgroundColor: backgroundColor,
|
|
114
|
+
},
|
|
115
|
+
pickerItemViewStyles,
|
|
116
|
+
]}
|
|
117
|
+
>
|
|
118
|
+
<Text
|
|
119
|
+
style={[
|
|
120
|
+
{
|
|
121
|
+
color: textColor,
|
|
122
|
+
fontSize: textSize,
|
|
123
|
+
flex: 1,
|
|
124
|
+
},
|
|
125
|
+
pickerItemTextStyles,
|
|
126
|
+
]}
|
|
127
|
+
>
|
|
128
|
+
{item.label}
|
|
129
|
+
</Text>
|
|
130
|
+
{isSelected ? (
|
|
131
|
+
<Icon
|
|
132
|
+
name={selectedIconName}
|
|
133
|
+
size={selectedIconSize}
|
|
134
|
+
color={selectedIconColor}
|
|
135
|
+
/>
|
|
136
|
+
) : null}
|
|
137
|
+
</View>
|
|
138
|
+
);
|
|
139
|
+
}}
|
|
140
|
+
showsVerticalScrollIndicator={false}
|
|
141
|
+
dropdownOverlayColor={dropdownOverlayColor}
|
|
142
|
+
dropdownStyle={{
|
|
143
|
+
borderColor: dropDownBorderColor,
|
|
144
|
+
borderWidth: dropDownBorderWidth,
|
|
145
|
+
borderRadius: dropDownBorderRadius,
|
|
146
|
+
backgroundColor: dropDownBackgroundColor,
|
|
147
|
+
}}
|
|
148
|
+
disableAutoScroll
|
|
149
|
+
statusBarTranslucent
|
|
150
|
+
/>
|
|
151
|
+
</PickerInputContainer>
|
|
152
|
+
);
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export default withTheme(ModalPicker);
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Keyboard } from "react-native";
|
|
3
|
-
import { extractStyles,
|
|
4
|
-
import { normalizeToPickerOptions, } from "../PickerCommon";
|
|
3
|
+
import { extractStyles, useDeepCompareMemo } from "../../../utilities";
|
|
4
|
+
import { normalizeToPickerOptions, usePickerItemProps, } from "../PickerCommon";
|
|
5
5
|
import PickerInputContainer from "../PickerInputContainer";
|
|
6
6
|
import DropDownPickerComponent from "react-native-dropdown-picker";
|
|
7
|
-
import { withTheme } from "
|
|
8
|
-
import PickerItem from "./PickerItem";
|
|
7
|
+
import { withTheme } from "../../../theming";
|
|
9
8
|
import { useOnUpdate } from "../../../hooks";
|
|
10
|
-
const DropDownPicker = ({ theme, options: optionsProp = [], onValueChange, Icon, placeholder, value, autoDismissKeyboard = true, selectedIconName = "Feather/check", selectedIconColor = theme.colors.
|
|
9
|
+
const DropDownPicker = ({ theme, options: optionsProp = [], onValueChange, Icon, placeholder, value, autoDismissKeyboard = true, selectedIconName = "Feather/check", selectedIconColor = theme.colors.strong, selectedIconSize = 20, dropDownBackgroundColor = theme.colors.background, dropDownBorderColor = theme.colors.divider, dropDownTextColor = theme.colors.strong, dropDownBorderWidth = 1, dropDownBorderRadius = 8, children: childrenProp, disabled, ...rest }) => {
|
|
11
10
|
const [pickerVisible, setPickerVisible] = React.useState(false);
|
|
12
11
|
const [internalValue, setInternalValue] = React.useState(value);
|
|
13
12
|
const isMultiSelect = Array.isArray(value);
|
|
14
|
-
const pickerItemProps =
|
|
15
|
-
const children = flattenReactFragments(React.Children.toArray(childrenProp));
|
|
16
|
-
// Only the props of the first PickerItem are used, any others are ignored
|
|
17
|
-
const firstPickerItem = children.find((child) => child.type === PickerItem);
|
|
18
|
-
return (firstPickerItem === null || firstPickerItem === void 0 ? void 0 : firstPickerItem.props) || {};
|
|
19
|
-
}, [childrenProp]);
|
|
13
|
+
const pickerItemProps = usePickerItemProps(childrenProp);
|
|
20
14
|
const { viewStyles: pickerItemViewStyles, textStyles: pickerItemTextStyles } = extractStyles(pickerItemProps.style);
|
|
21
15
|
const options = useDeepCompareMemo(() => normalizeToPickerOptions(optionsProp).map((option) => ({
|
|
22
16
|
label: option.label.toString(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropDownPicker.js","sourceRoot":"","sources":["DropDownPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"DropDownPicker.js","sourceRoot":"","sources":["DropDownPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EA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import * as React from "react";
|
|
2
2
|
import { Keyboard } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
extractStyles,
|
|
5
|
-
flattenReactFragments,
|
|
6
|
-
useDeepCompareMemo,
|
|
7
|
-
} from "../../../utilities";
|
|
3
|
+
import { extractStyles, useDeepCompareMemo } from "../../../utilities";
|
|
8
4
|
import {
|
|
9
5
|
CommonDropDownPickerProps,
|
|
10
6
|
MultiSelectPickerProps,
|
|
11
7
|
SinglePickerProps,
|
|
12
8
|
normalizeToPickerOptions,
|
|
9
|
+
usePickerItemProps,
|
|
13
10
|
} from "../PickerCommon";
|
|
14
11
|
import PickerInputContainer from "../PickerInputContainer";
|
|
15
12
|
import DropDownPickerComponent from "react-native-dropdown-picker";
|
|
16
|
-
import { withTheme } from "
|
|
17
|
-
import PickerItem, { PickerItemProps } from "./PickerItem";
|
|
13
|
+
import { withTheme } from "../../../theming";
|
|
18
14
|
import { useOnUpdate } from "../../../hooks";
|
|
19
15
|
|
|
20
16
|
const DropDownPicker: React.FC<
|
|
@@ -30,11 +26,11 @@ const DropDownPicker: React.FC<
|
|
|
30
26
|
value,
|
|
31
27
|
autoDismissKeyboard = true,
|
|
32
28
|
selectedIconName = "Feather/check",
|
|
33
|
-
selectedIconColor = theme.colors.
|
|
29
|
+
selectedIconColor = theme.colors.strong,
|
|
34
30
|
selectedIconSize = 20,
|
|
35
|
-
dropDownBackgroundColor = theme.colors.background
|
|
36
|
-
dropDownBorderColor = theme.colors.
|
|
37
|
-
dropDownTextColor = theme.colors.
|
|
31
|
+
dropDownBackgroundColor = theme.colors.background,
|
|
32
|
+
dropDownBorderColor = theme.colors.divider,
|
|
33
|
+
dropDownTextColor = theme.colors.strong,
|
|
38
34
|
dropDownBorderWidth = 1,
|
|
39
35
|
dropDownBorderRadius = 8,
|
|
40
36
|
children: childrenProp,
|
|
@@ -48,16 +44,7 @@ const DropDownPicker: React.FC<
|
|
|
48
44
|
|
|
49
45
|
const isMultiSelect = Array.isArray(value);
|
|
50
46
|
|
|
51
|
-
const pickerItemProps
|
|
52
|
-
const children = flattenReactFragments(
|
|
53
|
-
React.Children.toArray(childrenProp) as React.ReactElement[]
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
// Only the props of the first PickerItem are used, any others are ignored
|
|
57
|
-
const firstPickerItem = children.find((child) => child.type === PickerItem);
|
|
58
|
-
|
|
59
|
-
return firstPickerItem?.props || {};
|
|
60
|
-
}, [childrenProp]);
|
|
47
|
+
const pickerItemProps = usePickerItemProps(childrenProp);
|
|
61
48
|
|
|
62
49
|
const { viewStyles: pickerItemViewStyles, textStyles: pickerItemTextStyles } =
|
|
63
50
|
extractStyles(pickerItemProps.style);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import DropDownPicker from "./DropDownPicker";
|
|
3
|
-
import { withTheme } from "
|
|
3
|
+
import { withTheme } from "../../../theming";
|
|
4
4
|
const MultiSelectPicker = ({ value, ...rest }) => {
|
|
5
5
|
//@ts-ignore Ignore theme type issues
|
|
6
6
|
return React.createElement(DropDownPicker, { value: value || [], ...rest });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelectPicker.js","sourceRoot":"","sources":["MultiSelectPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"MultiSelectPicker.js","sourceRoot":"","sources":["MultiSelectPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,MAAM,iBAAiB,GAEnB,CAAC,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACzB,qCAAqC;IACrC,OAAO,oBAAC,cAAc,IAAC,KAAK,EAAE,KAAK,IAAI,EAAE,KAAM,IAAI,GAAI,CAAC;AAC1D,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC,iBAAiB,CAAC,CAAC"}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
MultiSelectPickerProps,
|
|
5
5
|
} from "../PickerCommon";
|
|
6
6
|
import DropDownPicker from "./DropDownPicker";
|
|
7
|
-
import { withTheme } from "
|
|
7
|
+
import { withTheme } from "../../../theming";
|
|
8
8
|
|
|
9
9
|
const MultiSelectPicker: React.FC<
|
|
10
10
|
React.PropsWithChildren<CommonDropDownPickerProps & MultiSelectPickerProps>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import NativePicker from "./NativePicker";
|
|
3
3
|
import DropDownPicker from "./dropdown/DropDownPicker";
|
|
4
|
-
import
|
|
4
|
+
import DropDownModalPicker from "./dropdown/DropDownModalPicker";
|
|
5
|
+
import { withTheme } from "../../theming";
|
|
5
6
|
const SinglePicker = ({ mode = "native", ...rest }) => {
|
|
6
7
|
switch (mode) {
|
|
7
8
|
case "native":
|
|
@@ -10,6 +11,9 @@ const SinglePicker = ({ mode = "native", ...rest }) => {
|
|
|
10
11
|
case "dropdown":
|
|
11
12
|
//@ts-ignore
|
|
12
13
|
return React.createElement(DropDownPicker, { ...rest });
|
|
14
|
+
case "dropdown-modal":
|
|
15
|
+
//@ts-ignore
|
|
16
|
+
return React.createElement(DropDownModalPicker, { ...rest });
|
|
13
17
|
}
|
|
14
18
|
};
|
|
15
19
|
export const Picker = withTheme(SinglePicker);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,cAAc,MAAM,2BAA2B,CAAC;AACvD,OAAO,mBAAmB,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAS1C,MAAM,YAAY,GAAmD,CAAC,EACpE,IAAI,GAAG,QAAQ,EACf,GAAG,IAAI,EACR,EAAE,EAAE;IACH,QAAQ,IAAI,EAAE;QACZ,KAAK,QAAQ;YACX,qCAAqC;YACrC,OAAO,oBAAC,YAAY,OAAK,IAAI,GAAI,CAAC;QACpC,KAAK,UAAU;YACb,YAAY;YACZ,OAAO,oBAAC,cAAc,OAAK,IAAI,GAAI,CAAC;QACtC,KAAK,gBAAgB;YACnB,YAAY;YACZ,OAAO,oBAAC,mBAAmB,OAAK,IAAI,GAAI,CAAC;KAC5C;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
CommonDropDownPickerProps,
|
|
4
|
+
DropDownModalPickerProps,
|
|
5
|
+
SinglePickerProps,
|
|
6
|
+
} from "./PickerCommon";
|
|
3
7
|
import NativePicker from "./NativePicker";
|
|
4
8
|
import DropDownPicker from "./dropdown/DropDownPicker";
|
|
5
|
-
import
|
|
9
|
+
import DropDownModalPicker from "./dropdown/DropDownModalPicker";
|
|
10
|
+
import { withTheme } from "../../theming";
|
|
6
11
|
|
|
7
|
-
interface PickerProps
|
|
8
|
-
|
|
12
|
+
interface PickerProps
|
|
13
|
+
extends CommonDropDownPickerProps,
|
|
14
|
+
SinglePickerProps,
|
|
15
|
+
DropDownModalPickerProps {
|
|
16
|
+
mode?: "native" | "dropdown" | "dropdown-modal";
|
|
9
17
|
}
|
|
10
18
|
|
|
11
19
|
const SinglePicker: React.FC<React.PropsWithChildren<PickerProps>> = ({
|
|
@@ -19,6 +27,9 @@ const SinglePicker: React.FC<React.PropsWithChildren<PickerProps>> = ({
|
|
|
19
27
|
case "dropdown":
|
|
20
28
|
//@ts-ignore
|
|
21
29
|
return <DropDownPicker {...rest} />;
|
|
30
|
+
case "dropdown-modal":
|
|
31
|
+
//@ts-ignore
|
|
32
|
+
return <DropDownModalPicker {...rest} />;
|
|
22
33
|
}
|
|
23
34
|
};
|
|
24
35
|
|