diff --git a/React/Fabric/Mounting/ComponentViews/Picker/RCTPickerComponentView.h b/React/Fabric/Mounting/ComponentViews/Picker/RCTPickerComponentView.h deleted file mode 100644 index 62f6d1e61a6..00000000000 --- a/React/Fabric/Mounting/ComponentViews/Picker/RCTPickerComponentView.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * UIView class for root component. - */ -@interface RCTPickerComponentView : RCTViewComponentView - -@end - -NS_ASSUME_NONNULL_END diff --git a/React/Fabric/Mounting/ComponentViews/Picker/RCTPickerComponentView.mm b/React/Fabric/Mounting/ComponentViews/Picker/RCTPickerComponentView.mm deleted file mode 100644 index c77fdfc21ef..00000000000 --- a/React/Fabric/Mounting/ComponentViews/Picker/RCTPickerComponentView.mm +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#import "RCTPickerComponentView.h" - -#import -#import -#import -#import -#import -#import -#import - -#import "RCTConversions.h" -#import "RCTFabricComponentsPlugins.h" - -using namespace facebook::react; - -@interface RCTPickerComponentView () - -@end - -@implementation RCTPickerComponentView { - UIPickerView *_pickerView; - std::vector _items; - NSInteger _selectedIndex; - NSString *_accessibilityLabel; - NSDictionary *_textAttributes; -} - -- (instancetype)initWithFrame:(CGRect)frame -{ - if (self = [super initWithFrame:frame]) { - _pickerView = [[UIPickerView alloc] initWithFrame:self.bounds]; - self.contentView = _pickerView; - [self setPropsToDefault]; - } - - return self; -} - -- (void)setPropsToDefault -{ - static const auto defaultProps = std::make_shared(); - _props = defaultProps; - _pickerView.delegate = self; - _pickerView.dataSource = self; - _selectedIndex = NSNotFound; - NSMutableParagraphStyle *const paragraphStyle = [NSMutableParagraphStyle new]; - paragraphStyle.alignment = NSTextAlignmentCenter; - _textAttributes = @{ - NSForegroundColorAttributeName : [UIColor blackColor], - NSFontAttributeName : [UIFont systemFontOfSize:21], - NSParagraphStyleAttributeName : paragraphStyle - }; -} - -- (void)prepareForRecycle -{ - [super prepareForRecycle]; - _selectedIndex = NSNotFound; -} - -#pragma mark - RCTComponentViewProtocol - -+ (ComponentDescriptorProvider)componentDescriptorProvider -{ - return concreteComponentDescriptorProvider(); -} - -- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps -{ - const auto &oldPickerProps = *std::static_pointer_cast(_props); - const auto &newPickerProps = *std::static_pointer_cast(props); - bool needsToReload = false; - - if (oldPickerProps.items != newPickerProps.items) { - _items = newPickerProps.items; - needsToReload = true; - } - - if (oldPickerProps.selectedIndex != newPickerProps.selectedIndex) { - _selectedIndex = newPickerProps.selectedIndex; - [self setSelectedIndex]; - } - - if (oldPickerProps.textAttributes != newPickerProps.textAttributes) { - _textAttributes = RCTNSTextAttributesFromTextAttributes(newPickerProps.getEffectiveTextAttributes()); - needsToReload = true; - } - - // TODO (T75217510) - Figure out testID. - if (oldPickerProps.testID != newPickerProps.testID) { - } - - if (oldPickerProps.accessibilityLabel != newPickerProps.accessibilityLabel) { - _accessibilityLabel = [NSString stringWithUTF8String:newPickerProps.accessibilityLabel.c_str()]; - } - - if (needsToReload) { - [_pickerView reloadAllComponents]; - } - - [super updateProps:props oldProps:oldProps]; -} - -#pragma mark - Native Commands - -- (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args -{ - if ([commandName isEqualToString:@"setNativeSelectedIndex"] && [args objectAtIndex:0]) { - NSNumber *selectedIndex = [args objectAtIndex:0]; - if (_selectedIndex != selectedIndex.integerValue) { - [self setSelectedIndex]; - } - } else { - RCTLogWarn(@"Attempting to send unknown command to Picker component: %@", commandName); - } -} - -- (void)setSelectedIndex -{ - BOOL animated = _selectedIndex != NSNotFound; // Don't animate the initial value. - [_pickerView selectRow:_selectedIndex inComponent:0 animated:animated]; -} - -#pragma mark - UIPickerViewDataSource protocol - -- (NSInteger)numberOfComponentsInPickerView:(__unused UIPickerView *)pickerView -{ - return 1; -} - -- (NSInteger)pickerView:(__unused UIPickerView *)pickerView numberOfRowsInComponent:(__unused NSInteger)component -{ - return _items.size(); -} - -#pragma mark - UIPickerViewDelegate methods - -- (NSString *)pickerView:(__unused UIPickerView *)pickerView - titleForRow:(NSInteger)row - forComponent:(__unused NSInteger)component -{ - return [NSString stringWithUTF8String:_items[row].label.c_str()]; -} - -- (CGFloat)pickerView:(__unused UIPickerView *)pickerView rowHeightForComponent:(NSInteger)__unused component -{ - return ((UIFont *)_textAttributes[NSFontAttributeName]).pointSize + 19; -} - -- (UIView *)pickerView:(UIPickerView *)pickerView - viewForRow:(NSInteger)row - forComponent:(NSInteger)component - reusingView:(UILabel *)label -{ - if (!label) { - label = [[UILabel alloc] initWithFrame:(CGRect){ - CGPointZero, - { - [pickerView rowSizeForComponent:component].width, - [pickerView rowSizeForComponent:component].height, - }}]; - } - NSMutableDictionary *attributes = [_textAttributes mutableCopy]; - // Color can be passed in from or from - // If Picker.Item color is set, use that. Else fall back to Picker style (with black as default). - if (RCTUIColorFromSharedColor(_items[row].textColor)) { - attributes[NSForegroundColorAttributeName] = RCTUIColorFromSharedColor(_items[row].textColor); - } - label.attributedText = [[NSAttributedString alloc] initWithString:[self pickerView:pickerView - titleForRow:row - forComponent:component] - attributes:attributes]; - return label; -} - -- (void)pickerView:(__unused UIPickerView *)pickerView - didSelectRow:(NSInteger)row - inComponent:(__unused NSInteger)component -{ - _selectedIndex = row; - PickerEventEmitter::PickerIOSChangeEvent event = {.newValue = _items[row].value, .newIndex = (int)row}; - if (_eventEmitter) { - std::static_pointer_cast(_eventEmitter)->onChange(event); - } -} - -#pragma mark - UIPickerViewAccessibilityDelegate protocol - -- (NSString *)pickerView:(UIPickerView *)pickerView accessibilityLabelForComponent:(NSInteger)component -{ - return _accessibilityLabel; -} - -@end - -Class RCTPickerCls(void) -{ - return RCTPickerComponentView.class; -} diff --git a/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.h b/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.h index b0b82ba221b..78e52b5e3f5 100644 --- a/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.h +++ b/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.h @@ -35,7 +35,6 @@ Class RCTPullToRefreshViewCls(void) __attribute__((use Class RCTActivityIndicatorViewCls(void) __attribute__((used)); Class RCTSliderCls(void) __attribute__((used)); Class RCTSwitchCls(void) __attribute__((used)); -Class RCTPickerCls(void) __attribute__((used)); Class RCTUnimplementedNativeViewCls(void) __attribute__((used)); Class RCTParagraphCls(void) __attribute__((used)); Class RCTTextInputCls(void) __attribute__((used)); diff --git a/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.mm b/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.mm index bad4843193a..2d11085a92a 100644 --- a/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.mm +++ b/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.mm @@ -24,7 +24,6 @@ Class RCTFabricComponentsProvider(const char *name) { {"ActivityIndicatorView", RCTActivityIndicatorViewCls}, {"Slider", RCTSliderCls}, {"Switch", RCTSwitchCls}, - {"Picker", RCTPickerCls}, {"UnimplementedNativeView", RCTUnimplementedNativeViewCls}, {"Paragraph", RCTParagraphCls}, {"TextInput", RCTTextInputCls}, diff --git a/React/Views/RCTPicker.h b/React/Views/RCTPicker.h deleted file mode 100644 index 1db659e1435..00000000000 --- a/React/Views/RCTPicker.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#import - -#import - -@interface RCTPicker : UIPickerView - -@property (nonatomic, copy) NSArray *items; -@property (nonatomic, assign) NSInteger selectedIndex; - -@property (nonatomic, strong) UIColor *color; -@property (nonatomic, strong) UIFont *font; -@property (nonatomic, assign) NSTextAlignment textAlign; - -@property (nonatomic, copy) RCTBubblingEventBlock onChange; - -@end diff --git a/React/Views/RCTPicker.m b/React/Views/RCTPicker.m deleted file mode 100644 index dfcdbb24d05..00000000000 --- a/React/Views/RCTPicker.m +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#import "RCTPicker.h" - -#import "RCTConvert.h" -#import "RCTUtils.h" - -@interface RCTPicker () -@end - -@implementation RCTPicker - -- (instancetype)initWithFrame:(CGRect)frame -{ - if ((self = [super initWithFrame:frame])) { - _color = [UIColor blackColor]; - _font = [UIFont systemFontOfSize:21]; // TODO: selected title default should be 23.5 - _selectedIndex = NSNotFound; - _textAlign = NSTextAlignmentCenter; - self.delegate = self; - [self selectRow:0 inComponent:0 - animated: - YES]; // Workaround for missing selection indicator lines (see - // https://stackoverflow.com/questions/39564660/uipickerview-selection-indicator-not-visible-in-ios10) - } - return self; -} - -RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder) - -- (void)setItems:(NSArray *)items -{ - _items = [items copy]; - [self setNeedsLayout]; -} - -- (void)setSelectedIndex:(NSInteger)selectedIndex -{ - if (_selectedIndex != selectedIndex) { - BOOL animated = _selectedIndex != NSNotFound; // Don't animate the initial value - _selectedIndex = selectedIndex; - dispatch_async(dispatch_get_main_queue(), ^{ - [self selectRow:selectedIndex inComponent:0 animated:animated]; - }); - } -} - -#pragma mark - UIPickerViewDataSource protocol - -- (NSInteger)numberOfComponentsInPickerView:(__unused UIPickerView *)pickerView -{ - return 1; -} - -- (NSInteger)pickerView:(__unused UIPickerView *)pickerView numberOfRowsInComponent:(__unused NSInteger)component -{ - return _items.count; -} - -#pragma mark - UIPickerViewDelegate methods - -- (NSString *)pickerView:(__unused UIPickerView *)pickerView - titleForRow:(NSInteger)row - forComponent:(__unused NSInteger)component -{ - return [RCTConvert NSString:_items[row][@"label"]]; -} - -- (CGFloat)pickerView:(__unused UIPickerView *)pickerView rowHeightForComponent:(NSInteger)__unused component -{ - return _font.pointSize + 19; -} - -- (UIView *)pickerView:(UIPickerView *)pickerView - viewForRow:(NSInteger)row - forComponent:(NSInteger)component - reusingView:(UILabel *)label -{ - if (!label) { - label = [[UILabel alloc] initWithFrame:(CGRect){ - CGPointZero, - { - [pickerView rowSizeForComponent:component].width, - [pickerView rowSizeForComponent:component].height, - }}]; - } - - label.font = _font; - - label.textColor = [RCTConvert UIColor:_items[row][@"textColor"]] ?: _color; - - label.textAlignment = _textAlign; - label.text = [self pickerView:pickerView titleForRow:row forComponent:component]; - return label; -} - -- (void)pickerView:(__unused UIPickerView *)pickerView - didSelectRow:(NSInteger)row - inComponent:(__unused NSInteger)component -{ - _selectedIndex = row; - if (_onChange && _items.count > (NSUInteger)row) { - _onChange(@{ - @"newIndex" : @(row), - @"newValue" : RCTNullIfNil(_items[row][@"value"]), - }); - } -} - -#pragma mark - UIPickerViewAccessibilityDelegate protocol - -- (NSString *)pickerView:(UIPickerView *)pickerView accessibilityLabelForComponent:(NSInteger)component -{ - return super.accessibilityLabel; -} - -@end diff --git a/React/Views/RCTPickerManager.h b/React/Views/RCTPickerManager.h deleted file mode 100644 index f3ea77f9993..00000000000 --- a/React/Views/RCTPickerManager.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#import - -@interface RCTPickerManager : RCTViewManager - -@end diff --git a/React/Views/RCTPickerManager.m b/React/Views/RCTPickerManager.m deleted file mode 100644 index 1f7a5211570..00000000000 --- a/React/Views/RCTPickerManager.m +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#import "RCTPickerManager.h" - -#import -#import "RCTBridge.h" -#import "RCTFont.h" -#import "RCTPicker.h" - -@implementation RCTPickerManager - -RCT_EXPORT_MODULE() - -- (UIView *)view -{ - return [RCTPicker new]; -} - -RCT_EXPORT_VIEW_PROPERTY(items, NSArray) -RCT_EXPORT_VIEW_PROPERTY(selectedIndex, NSInteger) -RCT_REMAP_VIEW_PROPERTY(accessibilityLabel, reactAccessibilityElement.accessibilityLabel, NSString) -RCT_EXPORT_VIEW_PROPERTY(onChange, RCTBubblingEventBlock) -RCT_EXPORT_VIEW_PROPERTY(color, UIColor) -RCT_EXPORT_VIEW_PROPERTY(textAlign, NSTextAlignment) -RCT_CUSTOM_VIEW_PROPERTY(fontSize, NSNumber, RCTPicker) -{ - view.font = [RCTFont updateFont:view.font withSize:json ?: @(defaultView.font.pointSize)]; -} -RCT_CUSTOM_VIEW_PROPERTY(fontWeight, NSString, __unused RCTPicker) -{ - view.font = [RCTFont updateFont:view.font withWeight:json]; // defaults to normal -} -RCT_CUSTOM_VIEW_PROPERTY(fontStyle, NSString, __unused RCTPicker) -{ - view.font = [RCTFont updateFont:view.font withStyle:json]; // defaults to normal -} -RCT_CUSTOM_VIEW_PROPERTY(fontFamily, NSString, RCTPicker) -{ - view.font = [RCTFont updateFont:view.font withFamily:json ?: defaultView.font.familyName]; -} - -RCT_EXPORT_METHOD(setNativeSelectedIndex : (nonnull NSNumber *)viewTag toIndex : (nonnull NSNumber *)index) -{ - [self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary *viewRegistry) { - UIView *view = viewRegistry[viewTag]; - if ([view isKindOfClass:[RCTPicker class]]) { - [(RCTPicker *)view setSelectedIndex:index.integerValue]; - } else { - RCTLogError(@"View type must be RCTPicker!"); - } - }]; -} - -@end diff --git a/ReactCommon/React-Fabric.podspec b/ReactCommon/React-Fabric.podspec index 47a61860276..9b17fe20e2d 100644 --- a/ReactCommon/React-Fabric.podspec +++ b/ReactCommon/React-Fabric.podspec @@ -147,15 +147,6 @@ Pod::Spec.new do |s| sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } end - ss.subspec "picker" do |sss| - sss.dependency folly_dep_name, folly_version - sss.compiler_flags = folly_compiler_flags - sss.source_files = "react/renderer/components/picker/iospicker/**/*.{m,mm,cpp,h}" - sss.exclude_files = "react/renderer/components/picker/iospicker/tests" - sss.header_dir = "react/renderer/components/iospicker" - sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } - end - ss.subspec "rncore" do |sss| sss.dependency folly_dep_name, folly_version sss.compiler_flags = folly_compiler_flags diff --git a/ReactCommon/react/renderer/components/picker/iospicker/BUCK b/ReactCommon/react/renderer/components/picker/iospicker/BUCK deleted file mode 100644 index d57c3ff699f..00000000000 --- a/ReactCommon/react/renderer/components/picker/iospicker/BUCK +++ /dev/null @@ -1,59 +0,0 @@ -load( - "//tools/build_defs/oss:rn_defs.bzl", - "ANDROID", - "APPLE", - "CXX", - "YOGA_CXX_TARGET", - "get_apple_compiler_flags", - "get_apple_inspector_flags", - "get_preprocessor_flags_for_build_mode", - "react_native_xplat_target", - "rn_xplat_cxx_library", - "subdir_glob", -) - -APPLE_COMPILER_FLAGS = get_apple_compiler_flags() - -rn_xplat_cxx_library( - name = "iospicker", - srcs = glob( - ["**/*.cpp"], - ), - headers = glob( - ["**/*.h"], - ), - header_namespace = "", - exported_headers = subdir_glob( - [ - ("", "*.h"), - ], - prefix = "react/renderer/components/iospicker", - ), - compiler_flags = [ - "-fexceptions", - "-frtti", - "-std=c++17", - "-Wall", - ], - fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, - fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), - force_static = True, - labels = ["supermodule:xplat/default/public.react_native.infra"], - platforms = (ANDROID, APPLE, CXX), - preprocessor_flags = [ - "-DLOG_TAG=\"ReactNative\"", - "-DWITH_FBSYSTRACE=1", - ], - visibility = ["PUBLIC"], - deps = [ - "//xplat/folly:headers_only", - YOGA_CXX_TARGET, - react_native_xplat_target("react/debug:debug"), - react_native_xplat_target("react/utils:utils"), - react_native_xplat_target("react/renderer/attributedstring:attributedstring"), - react_native_xplat_target("react/renderer/core:core"), - react_native_xplat_target("react/renderer/graphics:graphics"), - react_native_xplat_target("react/renderer/components/text:text"), - react_native_xplat_target("react/renderer/components/view:view"), - ], -) diff --git a/ReactCommon/react/renderer/components/picker/iospicker/PickerComponentDescriptor.h b/ReactCommon/react/renderer/components/picker/iospicker/PickerComponentDescriptor.h deleted file mode 100644 index d134689e784..00000000000 --- a/ReactCommon/react/renderer/components/picker/iospicker/PickerComponentDescriptor.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#pragma once - -#include -#include - -/* - * Descriptor for component. - */ -namespace facebook { -namespace react { - -class PickerComponentDescriptor final - : public ConcreteComponentDescriptor { - public: - using ConcreteComponentDescriptor::ConcreteComponentDescriptor; -}; - -} // namespace react -} // namespace facebook diff --git a/ReactCommon/react/renderer/components/picker/iospicker/PickerEventEmitter.cpp b/ReactCommon/react/renderer/components/picker/iospicker/PickerEventEmitter.cpp deleted file mode 100644 index 9e608966063..00000000000 --- a/ReactCommon/react/renderer/components/picker/iospicker/PickerEventEmitter.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#include "PickerEventEmitter.h" - -namespace facebook { -namespace react { - -void PickerEventEmitter::onChange(PickerIOSChangeEvent event) const { - dispatchEvent("change", [event = std::move(event)](jsi::Runtime &runtime) { - auto payload = jsi::Object(runtime); - payload.setProperty(runtime, "newValue", event.newValue); - payload.setProperty(runtime, "newIndex", event.newIndex); - return payload; - }); -} - -} // namespace react -} // namespace facebook diff --git a/ReactCommon/react/renderer/components/picker/iospicker/PickerEventEmitter.h b/ReactCommon/react/renderer/components/picker/iospicker/PickerEventEmitter.h deleted file mode 100644 index fea36adf3f6..00000000000 --- a/ReactCommon/react/renderer/components/picker/iospicker/PickerEventEmitter.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#pragma once - -#include - -namespace facebook { -namespace react { - -class PickerEventEmitter : public ViewEventEmitter { - public: - using ViewEventEmitter::ViewEventEmitter; - - struct PickerIOSChangeEvent { - std::string newValue; - int newIndex; - }; - - void onChange(PickerIOSChangeEvent event) const; -}; - -} // namespace react -} // namespace facebook diff --git a/ReactCommon/react/renderer/components/picker/iospicker/PickerProps.cpp b/ReactCommon/react/renderer/components/picker/iospicker/PickerProps.cpp deleted file mode 100644 index b3a06ad0029..00000000000 --- a/ReactCommon/react/renderer/components/picker/iospicker/PickerProps.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#include "PickerProps.h" - -#include -#include -#include - -namespace facebook { -namespace react { - -PickerProps::PickerProps( - PickerProps const &sourceProps, - RawProps const &rawProps) - : ViewProps(sourceProps, rawProps), - BaseTextProps(sourceProps, rawProps), - items(convertRawProp(rawProps, "items", sourceProps.items, {})), - selectedIndex(convertRawProp( - rawProps, - "selectedIndex", - sourceProps.selectedIndex, - {0})), - testID(convertRawProp(rawProps, "testID", sourceProps.testID, {})), - accessibilityLabel(convertRawProp( - rawProps, - "accessibilityLabel", - sourceProps.accessibilityLabel, - {})){ - - }; - -TextAttributes PickerProps::getEffectiveTextAttributes() const { - auto result = TextAttributes::defaultTextAttributes(); - // Default is left aligned, but Picker wants default to be center aligned. - result.alignment = TextAlignment::Center; - result.apply(textAttributes); - return result; -} - -} // namespace react -} // namespace facebook diff --git a/ReactCommon/react/renderer/components/picker/iospicker/PickerProps.h b/ReactCommon/react/renderer/components/picker/iospicker/PickerProps.h deleted file mode 100644 index c87ca2fe496..00000000000 --- a/ReactCommon/react/renderer/components/picker/iospicker/PickerProps.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#pragma once - -#include -#include -#include - -#include - -namespace facebook { -namespace react { - -class PickerProps final : public ViewProps, public BaseTextProps { - public: - PickerProps() = default; - PickerProps(PickerProps const &sourceProps, RawProps const &rawProps); - -#pragma mark - Props - - std::vector items{}; - int selectedIndex{0}; - std::string const testID{}; - std::string const accessibilityLabel{}; - -#pragma mark - Accessors - TextAttributes getEffectiveTextAttributes() const; -}; - -} // namespace react -} // namespace facebook diff --git a/ReactCommon/react/renderer/components/picker/iospicker/PickerShadowNode.cpp b/ReactCommon/react/renderer/components/picker/iospicker/PickerShadowNode.cpp deleted file mode 100644 index 2d39cdb106b..00000000000 --- a/ReactCommon/react/renderer/components/picker/iospicker/PickerShadowNode.cpp +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#include "PickerShadowNode.h" - -namespace facebook { -namespace react { - -extern const char PickerComponentName[] = "Picker"; - -} // namespace react -} // namespace facebook diff --git a/ReactCommon/react/renderer/components/picker/iospicker/PickerShadowNode.h b/ReactCommon/react/renderer/components/picker/iospicker/PickerShadowNode.h deleted file mode 100644 index c2c80bc6ae2..00000000000 --- a/ReactCommon/react/renderer/components/picker/iospicker/PickerShadowNode.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#pragma once - -#include -#include -#include -#include - -namespace facebook { -namespace react { - -extern const char PickerComponentName[]; - -/* - * `ShadowNode` for component. - */ -class PickerShadowNode final : public ConcreteViewShadowNode< - PickerComponentName, - PickerProps, - PickerEventEmitter, - PickerState> { - public: - using ConcreteViewShadowNode::ConcreteViewShadowNode; -}; - -} // namespace react -} // namespace facebook diff --git a/ReactCommon/react/renderer/components/picker/iospicker/PickerState.h b/ReactCommon/react/renderer/components/picker/iospicker/PickerState.h deleted file mode 100644 index fa50b38dfdb..00000000000 --- a/ReactCommon/react/renderer/components/picker/iospicker/PickerState.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#pragma once - -namespace facebook { -namespace react { - -/* - * State for component. - */ -class PickerState final {}; - -} // namespace react -} // namespace facebook diff --git a/ReactCommon/react/renderer/components/picker/iospicker/conversions.h b/ReactCommon/react/renderer/components/picker/iospicker/conversions.h deleted file mode 100644 index c2577779cde..00000000000 --- a/ReactCommon/react/renderer/components/picker/iospicker/conversions.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#pragma once - -#include -#include - -#include - -namespace facebook { -namespace react { - -inline void fromRawValue( - const RawValue &value, - std::vector &items) { - react_native_assert(value.hasType>()); - auto array = (std::vector)value; - items.reserve(array.size()); - - for (auto const &val : array) { - bool check = val.hasType>(); - react_native_assert(check); - auto map = (better::map)val; - PickerItemsStruct item; - - if (map.find("label") != map.end()) { - react_native_assert(map.at("label").hasType()); - item.label = (std::string)map.at("label"); - } - if (map.find("value") != map.end()) { - react_native_assert(map.at("value").hasType()); - item.value = (std::string)map.at("value"); - } - if (map.find("textColor") != map.end()) { - react_native_assert(map.at("textColor").hasType()); - item.textColor = (int)map.at("textColor"); - } - items.push_back(item); - } -} - -} // namespace react -} // namespace facebook diff --git a/ReactCommon/react/renderer/components/picker/iospicker/primitives.h b/ReactCommon/react/renderer/components/picker/iospicker/primitives.h deleted file mode 100644 index d9804aa9886..00000000000 --- a/ReactCommon/react/renderer/components/picker/iospicker/primitives.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#pragma once - -#include - -#include - -namespace facebook { -namespace react { - -struct PickerItemsStruct { - std::string label; - std::string value; - SharedColor textColor; - - bool operator==(const PickerItemsStruct &rhs) const { - return ( - label == rhs.label && value == rhs.value && textColor == rhs.textColor); - } -}; - -} // namespace react -} // namespace facebook diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index dc2d4ed1abb..5d578067efb 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -341,7 +341,6 @@ PODS: - React-Fabric/components/inputaccessory (= 1000.0.0) - React-Fabric/components/legacyviewmanagerinterop (= 1000.0.0) - React-Fabric/components/modal (= 1000.0.0) - - React-Fabric/components/picker (= 1000.0.0) - React-Fabric/components/rncore (= 1000.0.0) - React-Fabric/components/root (= 1000.0.0) - React-Fabric/components/safeareaview (= 1000.0.0) @@ -395,14 +394,6 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - ReactCommon/turbomodule/core (= 1000.0.0) - - React-Fabric/components/picker (1000.0.0): - - RCT-Folly/Fabric (= 2021.04.26.00) - - RCTRequired (= 1000.0.0) - - RCTTypeSafety (= 1000.0.0) - - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) - - React-jsiexecutor (= 1000.0.0) - - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/rncore (1000.0.0): - RCT-Folly/Fabric (= 2021.04.26.00) - RCTRequired (= 1000.0.0) @@ -885,7 +876,7 @@ SPEC CHECKSUMS: React-Core: f5b65410a2ecdbb4560f23dc4525588390b0b3b1 React-CoreModules: 818e75a3eb8f431be8fc3d8c8eb15206b3f52e81 React-cxxreact: fa0884110d142f7e1600a86ae769d5fd43ec8a69 - React-Fabric: ee21f85af985320ca427353e95821a5b4d6f4f46 + React-Fabric: f31c68913f46481d01e09a6f44a5a6bc8664cfdd React-graphics: 57cb7ea16c092a9953c96549a29b49d5e207c25c React-jsi: 93fc7d193c0499a9b10157655e6f1e755f67b3d0 React-jsiexecutor: 1e995bed2de8965703917c562fe35ec023a68ae5