react-native-platform-components 1.4.0 → 1.6.0
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/PlatformComponents.podspec +1 -1
- package/README.md +33 -31
- package/android/src/main/java/com/platformcomponents/PCButtonGroupView.kt +175 -9
- package/android/src/main/java/com/platformcomponents/PCButtonGroupViewManager.kt +52 -2
- package/android/src/main/java/com/platformcomponents/PCButtonSupport.kt +44 -12
- package/android/src/main/java/com/platformcomponents/PCButtonView.kt +187 -5
- package/android/src/main/java/com/platformcomponents/PCButtonViewManager.kt +85 -7
- package/android/src/main/java/com/platformcomponents/PCContextMenuView.kt +41 -151
- package/android/src/main/java/com/platformcomponents/PCContextMenuViewManager.kt +7 -63
- package/android/src/main/java/com/platformcomponents/PCDatePickerView.kt +310 -115
- package/android/src/main/java/com/platformcomponents/PCDatePickerViewManager.kt +23 -3
- package/android/src/main/java/com/platformcomponents/PCExpressive.kt +6 -1
- package/android/src/main/java/com/platformcomponents/PCFloatingActionButtonView.kt +485 -0
- package/android/src/main/java/com/platformcomponents/PCFloatingActionButtonViewManager.kt +109 -0
- package/android/src/main/java/com/platformcomponents/PCFloatingToolbarView.kt +132 -0
- package/android/src/main/java/com/platformcomponents/PCFloatingToolbarViewManager.kt +8 -0
- package/android/src/main/java/com/platformcomponents/PCHaptics.kt +46 -0
- package/android/src/main/java/com/platformcomponents/PCImageLoader.kt +42 -7
- package/android/src/main/java/com/platformcomponents/PCLiquidGlassContainerView.kt +32 -0
- package/android/src/main/java/com/platformcomponents/PCLiquidGlassContainerViewManager.kt +31 -0
- package/android/src/main/java/com/platformcomponents/PCLiquidGlassView.kt +32 -6
- package/android/src/main/java/com/platformcomponents/PCLiquidGlassViewManager.kt +4 -0
- package/android/src/main/java/com/platformcomponents/PCMenuSupport.kt +280 -0
- package/android/src/main/java/com/platformcomponents/PCNavigationBarSupport.kt +332 -0
- package/android/src/main/java/com/platformcomponents/PCNavigationRailView.kt +448 -0
- package/android/src/main/java/com/platformcomponents/PCNavigationRailViewManager.kt +176 -0
- package/android/src/main/java/com/platformcomponents/PCSegmentedControlView.kt +24 -14
- package/android/src/main/java/com/platformcomponents/PCSegmentedControlViewManager.kt +14 -2
- package/android/src/main/java/com/platformcomponents/PCSelectionMenuView.kt +371 -39
- package/android/src/main/java/com/platformcomponents/PCSelectionMenuViewManager.kt +18 -4
- package/android/src/main/java/com/platformcomponents/PCTabBarView.kt +397 -0
- package/android/src/main/java/com/platformcomponents/PCTabBarViewManager.kt +182 -0
- package/android/src/main/java/com/platformcomponents/PCTextFieldView.kt +415 -40
- package/android/src/main/java/com/platformcomponents/PCTextFieldViewManager.kt +109 -3
- package/android/src/main/java/com/platformcomponents/PCThemeSupport.kt +37 -0
- package/android/src/main/java/com/platformcomponents/PlatformComponentsPackage.kt +4 -0
- package/android/src/main/res/drawable/pc_ic_search.xml +12 -0
- package/android/src/main/res/values/ids.xml +5 -0
- package/android/src/main/res/values/styles.xml +24 -0
- package/ios/PCButton.mm +122 -7
- package/ios/PCButtonGroup.mm +68 -1
- package/ios/PCButtonGroupView.swift +225 -6
- package/ios/PCButtonSupport.swift +181 -10
- package/ios/PCButtonView.swift +297 -14
- package/ios/PCConstants.swift +23 -2
- package/ios/PCContextMenu.mm +28 -110
- package/ios/PCContextMenu.swift +106 -167
- package/ios/PCDatePicker.mm +21 -9
- package/ios/PCDatePickerView.swift +94 -20
- package/ios/PCFloatingActionButton.h +10 -0
- package/ios/PCFloatingActionButton.mm +177 -0
- package/ios/PCFloatingActionButtonView.swift +426 -0
- package/ios/PCFloatingToolbar.mm +27 -0
- package/ios/PCFloatingToolbarView.swift +241 -0
- package/ios/PCHaptics.swift +91 -0
- package/ios/PCImageLoader.swift +76 -12
- package/ios/PCLiquidGlass.mm +36 -0
- package/ios/PCLiquidGlass.swift +221 -114
- package/ios/PCLiquidGlassContainer.h +10 -0
- package/ios/PCLiquidGlassContainer.mm +84 -0
- package/ios/PCLiquidGlassContainer.swift +69 -0
- package/ios/PCMenuItems.h +76 -0
- package/ios/PCMenuSupport.swift +350 -0
- package/ios/PCNavigationRail.h +10 -0
- package/ios/PCNavigationRail.mm +270 -0
- package/ios/PCNavigationRailView.swift +415 -0
- package/ios/PCSegmentedControl.mm +17 -2
- package/ios/PCSegmentedControl.swift +57 -7
- package/ios/PCSelectionMenu.mm +36 -8
- package/ios/PCSelectionMenu.swift +224 -48
- package/ios/PCTabBar.h +10 -0
- package/ios/PCTabBar.mm +285 -0
- package/ios/PCTabBarAccessory.h +10 -0
- package/ios/PCTabBarAccessory.mm +93 -0
- package/ios/PCTabBarAccessoryView.swift +96 -0
- package/ios/PCTabBarView.swift +671 -0
- package/ios/PCTextField.mm +159 -4
- package/ios/PCTextFieldView.swift +603 -57
- package/lib/commonjs/Button.js +73 -1
- package/lib/commonjs/Button.js.map +1 -1
- package/lib/commonjs/ButtonGroup.js +13 -3
- package/lib/commonjs/ButtonGroup.js.map +1 -1
- package/lib/commonjs/ButtonGroupNativeComponent.ts +74 -4
- package/lib/commonjs/ButtonNativeComponent.ts +119 -3
- package/lib/commonjs/ContextMenu.js +9 -48
- package/lib/commonjs/ContextMenu.js.map +1 -1
- package/lib/commonjs/ContextMenuNativeComponent.ts +47 -49
- package/lib/commonjs/DatePicker.js +98 -2
- package/lib/commonjs/DatePicker.js.map +1 -1
- package/lib/commonjs/DatePickerNativeComponent.ts +19 -2
- package/lib/commonjs/FloatingActionButton.js +60 -0
- package/lib/commonjs/FloatingActionButton.js.map +1 -0
- package/lib/commonjs/FloatingActionButtonNativeComponent.ts +58 -0
- package/lib/commonjs/FloatingToolbar.js +9 -1
- package/lib/commonjs/FloatingToolbar.js.map +1 -1
- package/lib/commonjs/FloatingToolbarNativeComponent.ts +16 -0
- package/lib/commonjs/LiquidGlass.js +7 -1
- package/lib/commonjs/LiquidGlass.js.map +1 -1
- package/lib/commonjs/LiquidGlassContainer.js +32 -0
- package/lib/commonjs/LiquidGlassContainer.js.map +1 -0
- package/lib/commonjs/LiquidGlassContainerNativeComponent.ts +17 -0
- package/lib/commonjs/LiquidGlassNativeComponent.ts +8 -0
- package/lib/commonjs/NavigationRail.js +104 -0
- package/lib/commonjs/NavigationRail.js.map +1 -0
- package/lib/commonjs/NavigationRailNativeComponent.ts +107 -0
- package/lib/commonjs/PlatformComponentsProvider.js +18 -0
- package/lib/commonjs/PlatformComponentsProvider.js.map +1 -0
- package/lib/commonjs/SegmentedControl.js +7 -0
- package/lib/commonjs/SegmentedControl.js.map +1 -1
- package/lib/commonjs/SegmentedControlNativeComponent.ts +11 -0
- package/lib/commonjs/SelectionMenu.js +27 -3
- package/lib/commonjs/SelectionMenu.js.map +1 -1
- package/lib/commonjs/SelectionMenuNativeComponent.ts +26 -4
- package/lib/commonjs/SplitButton.js +98 -0
- package/lib/commonjs/SplitButton.js.map +1 -0
- package/lib/commonjs/TabBar.js +203 -0
- package/lib/commonjs/TabBar.js.map +1 -0
- package/lib/commonjs/TabBarAccessoryNativeComponent.ts +19 -0
- package/lib/commonjs/TabBarNativeComponent.ts +145 -0
- package/lib/commonjs/TextField.js +171 -8
- package/lib/commonjs/TextField.js.map +1 -1
- package/lib/commonjs/TextFieldNativeComponent.ts +110 -4
- package/lib/commonjs/focusRegistry.js +2 -1
- package/lib/commonjs/focusRegistry.js.map +1 -1
- package/lib/commonjs/haptics.js +2 -0
- package/lib/commonjs/haptics.js.map +1 -0
- package/lib/commonjs/icons.js +15 -1
- package/lib/commonjs/icons.js.map +1 -1
- package/lib/commonjs/index.js +77 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +156 -92
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/jest.js +910 -0
- package/lib/commonjs/jest.js.map +1 -0
- package/lib/commonjs/menuItems.js +68 -0
- package/lib/commonjs/menuItems.js.map +1 -0
- package/lib/commonjs/selectionIdentifiers.js +18 -0
- package/lib/commonjs/selectionIdentifiers.js.map +1 -0
- package/lib/commonjs/submitBehavior.js +19 -0
- package/lib/commonjs/submitBehavior.js.map +1 -0
- package/lib/commonjs/tabItems.js +49 -0
- package/lib/commonjs/tabItems.js.map +1 -0
- package/lib/commonjs/web/Button.js +170 -0
- package/lib/commonjs/web/Button.js.map +1 -0
- package/lib/commonjs/web/ButtonGroup.js +119 -0
- package/lib/commonjs/web/ButtonGroup.js.map +1 -0
- package/lib/commonjs/web/DatePicker.js +168 -0
- package/lib/commonjs/web/DatePicker.js.map +1 -0
- package/lib/commonjs/web/DateRangePicker.js +137 -0
- package/lib/commonjs/web/DateRangePicker.js.map +1 -0
- package/lib/commonjs/web/Dialog.js +54 -0
- package/lib/commonjs/web/Dialog.js.map +1 -0
- package/lib/commonjs/web/FloatingActionButton.js +98 -0
- package/lib/commonjs/web/FloatingActionButton.js.map +1 -0
- package/lib/commonjs/web/Icon.js +34 -0
- package/lib/commonjs/web/Icon.js.map +1 -0
- package/lib/commonjs/web/NativeTheme.js +28 -0
- package/lib/commonjs/web/NativeTheme.js.map +1 -0
- package/lib/commonjs/web/NavigationRail.js +139 -0
- package/lib/commonjs/web/NavigationRail.js.map +1 -0
- package/lib/commonjs/web/PlatformComponentsProvider.js +51 -0
- package/lib/commonjs/web/PlatformComponentsProvider.js.map +1 -0
- package/lib/commonjs/web/SegmentedControl.js +117 -0
- package/lib/commonjs/web/SegmentedControl.js.map +1 -0
- package/lib/commonjs/web/SelectionMenu.js +142 -0
- package/lib/commonjs/web/SelectionMenu.js.map +1 -0
- package/lib/commonjs/web/SplitButton.js +35 -0
- package/lib/commonjs/web/SplitButton.js.map +1 -0
- package/lib/commonjs/web/TabBar.js +131 -0
- package/lib/commonjs/web/TabBar.js.map +1 -0
- package/lib/commonjs/web/TextField.js +322 -0
- package/lib/commonjs/web/TextField.js.map +1 -0
- package/lib/commonjs/web/components.js +36 -0
- package/lib/commonjs/web/components.js.map +1 -0
- package/lib/commonjs/web/containers.js +121 -0
- package/lib/commonjs/web/containers.js.map +1 -0
- package/lib/commonjs/web/dateInput.js +116 -0
- package/lib/commonjs/web/dateInput.js.map +1 -0
- package/lib/commonjs/web/shared.js +192 -0
- package/lib/commonjs/web/shared.js.map +1 -0
- package/lib/commonjs/webComponents.js +6 -0
- package/lib/commonjs/webComponents.js.map +1 -0
- package/lib/module/Button.js +74 -2
- package/lib/module/Button.js.map +1 -1
- package/lib/module/ButtonGroup.js +13 -3
- package/lib/module/ButtonGroup.js.map +1 -1
- package/lib/module/ButtonGroupNativeComponent.ts +74 -4
- package/lib/module/ButtonNativeComponent.ts +119 -3
- package/lib/module/ContextMenu.js +9 -48
- package/lib/module/ContextMenu.js.map +1 -1
- package/lib/module/ContextMenuNativeComponent.ts +47 -49
- package/lib/module/DatePicker.js +98 -4
- package/lib/module/DatePicker.js.map +1 -1
- package/lib/module/DatePickerNativeComponent.ts +19 -2
- package/lib/module/FloatingActionButton.js +53 -0
- package/lib/module/FloatingActionButton.js.map +1 -0
- package/lib/module/FloatingActionButtonNativeComponent.ts +58 -0
- package/lib/module/FloatingToolbar.js +9 -1
- package/lib/module/FloatingToolbar.js.map +1 -1
- package/lib/module/FloatingToolbarNativeComponent.ts +16 -0
- package/lib/module/LiquidGlass.js +7 -1
- package/lib/module/LiquidGlass.js.map +1 -1
- package/lib/module/LiquidGlassContainer.js +26 -0
- package/lib/module/LiquidGlassContainer.js.map +1 -0
- package/lib/module/LiquidGlassContainerNativeComponent.ts +17 -0
- package/lib/module/LiquidGlassNativeComponent.ts +8 -0
- package/lib/module/NavigationRail.js +99 -0
- package/lib/module/NavigationRail.js.map +1 -0
- package/lib/module/NavigationRailNativeComponent.ts +107 -0
- package/lib/module/PlatformComponentsProvider.js +13 -0
- package/lib/module/PlatformComponentsProvider.js.map +1 -0
- package/lib/module/SegmentedControl.js +9 -1
- package/lib/module/SegmentedControl.js.map +1 -1
- package/lib/module/SegmentedControlNativeComponent.ts +11 -0
- package/lib/module/SelectionMenu.js +27 -3
- package/lib/module/SelectionMenu.js.map +1 -1
- package/lib/module/SelectionMenuNativeComponent.ts +26 -4
- package/lib/module/SplitButton.js +91 -0
- package/lib/module/SplitButton.js.map +1 -0
- package/lib/module/TabBar.js +196 -0
- package/lib/module/TabBar.js.map +1 -0
- package/lib/module/TabBarAccessoryNativeComponent.ts +19 -0
- package/lib/module/TabBarNativeComponent.ts +145 -0
- package/lib/module/TextField.js +172 -9
- package/lib/module/TextField.js.map +1 -1
- package/lib/module/TextFieldNativeComponent.ts +110 -4
- package/lib/module/focusRegistry.js +1 -0
- package/lib/module/focusRegistry.js.map +1 -1
- package/lib/module/haptics.js +2 -0
- package/lib/module/haptics.js.map +1 -0
- package/lib/module/icons.js +15 -1
- package/lib/module/icons.js.map +1 -1
- package/lib/module/index.js +7 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +12 -87
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/jest.js +840 -0
- package/lib/module/jest.js.map +1 -0
- package/lib/module/menuItems.js +65 -0
- package/lib/module/menuItems.js.map +1 -0
- package/lib/module/selectionIdentifiers.js +14 -0
- package/lib/module/selectionIdentifiers.js.map +1 -0
- package/lib/module/submitBehavior.js +15 -0
- package/lib/module/submitBehavior.js.map +1 -0
- package/lib/module/tabItems.js +45 -0
- package/lib/module/tabItems.js.map +1 -0
- package/lib/module/web/Button.js +164 -0
- package/lib/module/web/Button.js.map +1 -0
- package/lib/module/web/ButtonGroup.js +113 -0
- package/lib/module/web/ButtonGroup.js.map +1 -0
- package/lib/module/web/DatePicker.js +162 -0
- package/lib/module/web/DatePicker.js.map +1 -0
- package/lib/module/web/DateRangePicker.js +131 -0
- package/lib/module/web/DateRangePicker.js.map +1 -0
- package/lib/module/web/Dialog.js +48 -0
- package/lib/module/web/Dialog.js.map +1 -0
- package/lib/module/web/FloatingActionButton.js +94 -0
- package/lib/module/web/FloatingActionButton.js.map +1 -0
- package/lib/module/web/Icon.js +29 -0
- package/lib/module/web/Icon.js.map +1 -0
- package/lib/module/web/NativeTheme.js +23 -0
- package/lib/module/web/NativeTheme.js.map +1 -0
- package/lib/module/web/NavigationRail.js +133 -0
- package/lib/module/web/NavigationRail.js.map +1 -0
- package/lib/module/web/PlatformComponentsProvider.js +44 -0
- package/lib/module/web/PlatformComponentsProvider.js.map +1 -0
- package/lib/module/web/SegmentedControl.js +112 -0
- package/lib/module/web/SegmentedControl.js.map +1 -0
- package/lib/module/web/SelectionMenu.js +137 -0
- package/lib/module/web/SelectionMenu.js.map +1 -0
- package/lib/module/web/SplitButton.js +30 -0
- package/lib/module/web/SplitButton.js.map +1 -0
- package/lib/module/web/TabBar.js +126 -0
- package/lib/module/web/TabBar.js.map +1 -0
- package/lib/module/web/TextField.js +316 -0
- package/lib/module/web/TextField.js.map +1 -0
- package/lib/module/web/components.js +33 -0
- package/lib/module/web/components.js.map +1 -0
- package/lib/module/web/containers.js +112 -0
- package/lib/module/web/containers.js.map +1 -0
- package/lib/module/web/dateInput.js +109 -0
- package/lib/module/web/dateInput.js.map +1 -0
- package/lib/module/web/shared.js +179 -0
- package/lib/module/web/shared.js.map +1 -0
- package/lib/module/webComponents.js +4 -0
- package/lib/module/webComponents.js.map +1 -0
- package/lib/typescript/commonjs/docs/sidebars.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/Button.d.ts +111 -3
- package/lib/typescript/commonjs/src/Button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ButtonGroup.d.ts +21 -6
- package/lib/typescript/commonjs/src/ButtonGroup.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ButtonGroupNativeComponent.d.ts +64 -3
- package/lib/typescript/commonjs/src/ButtonGroupNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ButtonNativeComponent.d.ts +94 -3
- package/lib/typescript/commonjs/src/ButtonNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ContextMenu.d.ts +20 -33
- package/lib/typescript/commonjs/src/ContextMenu.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ContextMenuNativeComponent.d.ts +45 -47
- package/lib/typescript/commonjs/src/ContextMenuNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/DatePicker.d.ts +74 -1
- package/lib/typescript/commonjs/src/DatePicker.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/DatePickerNativeComponent.d.ts +16 -1
- package/lib/typescript/commonjs/src/DatePickerNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/FloatingActionButton.d.ts +67 -0
- package/lib/typescript/commonjs/src/FloatingActionButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/FloatingActionButtonNativeComponent.d.ts +43 -0
- package/lib/typescript/commonjs/src/FloatingActionButtonNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/FloatingToolbar.d.ts +30 -0
- package/lib/typescript/commonjs/src/FloatingToolbar.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/FloatingToolbarNativeComponent.d.ts +12 -0
- package/lib/typescript/commonjs/src/FloatingToolbarNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/LiquidGlass.d.ts +17 -0
- package/lib/typescript/commonjs/src/LiquidGlass.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/LiquidGlassContainer.d.ts +27 -0
- package/lib/typescript/commonjs/src/LiquidGlassContainer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/LiquidGlassContainerNativeComponent.d.ts +13 -0
- package/lib/typescript/commonjs/src/LiquidGlassContainerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/LiquidGlassNativeComponent.d.ts +7 -0
- package/lib/typescript/commonjs/src/LiquidGlassNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/NavigationRail.d.ts +86 -0
- package/lib/typescript/commonjs/src/NavigationRail.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/NavigationRailNativeComponent.d.ts +81 -0
- package/lib/typescript/commonjs/src/NavigationRailNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/PlatformComponentsProvider.d.ts +6 -0
- package/lib/typescript/commonjs/src/PlatformComponentsProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/SegmentedControl.d.ts +18 -1
- package/lib/typescript/commonjs/src/SegmentedControl.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/SegmentedControlNativeComponent.d.ts +9 -0
- package/lib/typescript/commonjs/src/SegmentedControlNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/SelectionMenu.d.ts +44 -2
- package/lib/typescript/commonjs/src/SelectionMenu.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/SelectionMenuNativeComponent.d.ts +20 -4
- package/lib/typescript/commonjs/src/SelectionMenuNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/SplitButton.d.ts +83 -0
- package/lib/typescript/commonjs/src/SplitButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/TabBar.d.ts +144 -0
- package/lib/typescript/commonjs/src/TabBar.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/TabBarAccessoryNativeComponent.d.ts +13 -0
- package/lib/typescript/commonjs/src/TabBarAccessoryNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/TabBarNativeComponent.d.ts +110 -0
- package/lib/typescript/commonjs/src/TabBarNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/TextField.d.ts +166 -8
- package/lib/typescript/commonjs/src/TextField.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/TextFieldNativeComponent.d.ts +81 -3
- package/lib/typescript/commonjs/src/TextFieldNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/focusRegistry.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/haptics.d.ts +20 -0
- package/lib/typescript/commonjs/src/haptics.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/icons.d.ts +7 -1
- package/lib/typescript/commonjs/src/icons.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +7 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.web.d.ts +25 -254
- package/lib/typescript/commonjs/src/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/jest.d.ts +139 -0
- package/lib/typescript/commonjs/src/jest.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/menuItems.d.ts +100 -0
- package/lib/typescript/commonjs/src/menuItems.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/selectionIdentifiers.d.ts +3 -0
- package/lib/typescript/commonjs/src/selectionIdentifiers.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/submitBehavior.d.ts +9 -0
- package/lib/typescript/commonjs/src/submitBehavior.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/tabItems.d.ts +55 -0
- package/lib/typescript/commonjs/src/tabItems.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/Button.d.ts +9 -0
- package/lib/typescript/commonjs/src/web/Button.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/ButtonGroup.d.ts +11 -0
- package/lib/typescript/commonjs/src/web/ButtonGroup.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/DatePicker.d.ts +14 -0
- package/lib/typescript/commonjs/src/web/DatePicker.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/DateRangePicker.d.ts +11 -0
- package/lib/typescript/commonjs/src/web/DateRangePicker.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/Dialog.d.ts +12 -0
- package/lib/typescript/commonjs/src/web/Dialog.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/FloatingActionButton.d.ts +8 -0
- package/lib/typescript/commonjs/src/web/FloatingActionButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/Icon.d.ts +12 -0
- package/lib/typescript/commonjs/src/web/Icon.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/NativeTheme.d.ts +10 -0
- package/lib/typescript/commonjs/src/web/NativeTheme.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/NavigationRail.d.ts +8 -0
- package/lib/typescript/commonjs/src/web/NavigationRail.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/PlatformComponentsProvider.d.ts +10 -0
- package/lib/typescript/commonjs/src/web/PlatformComponentsProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/SegmentedControl.d.ts +8 -0
- package/lib/typescript/commonjs/src/web/SegmentedControl.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/SelectionMenu.d.ts +10 -0
- package/lib/typescript/commonjs/src/web/SelectionMenu.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/SplitButton.d.ts +9 -0
- package/lib/typescript/commonjs/src/web/SplitButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/TabBar.d.ts +9 -0
- package/lib/typescript/commonjs/src/web/TabBar.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/TextField.d.ts +9 -0
- package/lib/typescript/commonjs/src/web/TextField.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/components.d.ts +17 -0
- package/lib/typescript/commonjs/src/web/components.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/containers.d.ts +24 -0
- package/lib/typescript/commonjs/src/web/containers.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/dateInput.d.ts +20 -0
- package/lib/typescript/commonjs/src/web/dateInput.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/shared.d.ts +43 -0
- package/lib/typescript/commonjs/src/web/shared.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/webComponents.d.ts +43 -0
- package/lib/typescript/commonjs/src/webComponents.d.ts.map +1 -0
- package/lib/typescript/module/docs/sidebars.d.ts.map +1 -1
- package/lib/typescript/module/src/Button.d.ts +111 -3
- package/lib/typescript/module/src/Button.d.ts.map +1 -1
- package/lib/typescript/module/src/ButtonGroup.d.ts +21 -6
- package/lib/typescript/module/src/ButtonGroup.d.ts.map +1 -1
- package/lib/typescript/module/src/ButtonGroupNativeComponent.d.ts +64 -3
- package/lib/typescript/module/src/ButtonGroupNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/ButtonNativeComponent.d.ts +94 -3
- package/lib/typescript/module/src/ButtonNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/ContextMenu.d.ts +20 -33
- package/lib/typescript/module/src/ContextMenu.d.ts.map +1 -1
- package/lib/typescript/module/src/ContextMenuNativeComponent.d.ts +45 -47
- package/lib/typescript/module/src/ContextMenuNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/DatePicker.d.ts +74 -1
- package/lib/typescript/module/src/DatePicker.d.ts.map +1 -1
- package/lib/typescript/module/src/DatePickerNativeComponent.d.ts +16 -1
- package/lib/typescript/module/src/DatePickerNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/FloatingActionButton.d.ts +67 -0
- package/lib/typescript/module/src/FloatingActionButton.d.ts.map +1 -0
- package/lib/typescript/module/src/FloatingActionButtonNativeComponent.d.ts +43 -0
- package/lib/typescript/module/src/FloatingActionButtonNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/FloatingToolbar.d.ts +30 -0
- package/lib/typescript/module/src/FloatingToolbar.d.ts.map +1 -1
- package/lib/typescript/module/src/FloatingToolbarNativeComponent.d.ts +12 -0
- package/lib/typescript/module/src/FloatingToolbarNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/LiquidGlass.d.ts +17 -0
- package/lib/typescript/module/src/LiquidGlass.d.ts.map +1 -1
- package/lib/typescript/module/src/LiquidGlassContainer.d.ts +27 -0
- package/lib/typescript/module/src/LiquidGlassContainer.d.ts.map +1 -0
- package/lib/typescript/module/src/LiquidGlassContainerNativeComponent.d.ts +13 -0
- package/lib/typescript/module/src/LiquidGlassContainerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/LiquidGlassNativeComponent.d.ts +7 -0
- package/lib/typescript/module/src/LiquidGlassNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/NavigationRail.d.ts +86 -0
- package/lib/typescript/module/src/NavigationRail.d.ts.map +1 -0
- package/lib/typescript/module/src/NavigationRailNativeComponent.d.ts +81 -0
- package/lib/typescript/module/src/NavigationRailNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/PlatformComponentsProvider.d.ts +6 -0
- package/lib/typescript/module/src/PlatformComponentsProvider.d.ts.map +1 -0
- package/lib/typescript/module/src/SegmentedControl.d.ts +18 -1
- package/lib/typescript/module/src/SegmentedControl.d.ts.map +1 -1
- package/lib/typescript/module/src/SegmentedControlNativeComponent.d.ts +9 -0
- package/lib/typescript/module/src/SegmentedControlNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/SelectionMenu.d.ts +44 -2
- package/lib/typescript/module/src/SelectionMenu.d.ts.map +1 -1
- package/lib/typescript/module/src/SelectionMenuNativeComponent.d.ts +20 -4
- package/lib/typescript/module/src/SelectionMenuNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/SplitButton.d.ts +83 -0
- package/lib/typescript/module/src/SplitButton.d.ts.map +1 -0
- package/lib/typescript/module/src/TabBar.d.ts +144 -0
- package/lib/typescript/module/src/TabBar.d.ts.map +1 -0
- package/lib/typescript/module/src/TabBarAccessoryNativeComponent.d.ts +13 -0
- package/lib/typescript/module/src/TabBarAccessoryNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/TabBarNativeComponent.d.ts +110 -0
- package/lib/typescript/module/src/TabBarNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/TextField.d.ts +166 -8
- package/lib/typescript/module/src/TextField.d.ts.map +1 -1
- package/lib/typescript/module/src/TextFieldNativeComponent.d.ts +81 -3
- package/lib/typescript/module/src/TextFieldNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/focusRegistry.d.ts.map +1 -1
- package/lib/typescript/module/src/haptics.d.ts +20 -0
- package/lib/typescript/module/src/haptics.d.ts.map +1 -0
- package/lib/typescript/module/src/icons.d.ts +7 -1
- package/lib/typescript/module/src/icons.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +7 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/index.web.d.ts +25 -254
- package/lib/typescript/module/src/index.web.d.ts.map +1 -1
- package/lib/typescript/module/src/jest.d.ts +139 -0
- package/lib/typescript/module/src/jest.d.ts.map +1 -0
- package/lib/typescript/module/src/menuItems.d.ts +100 -0
- package/lib/typescript/module/src/menuItems.d.ts.map +1 -0
- package/lib/typescript/module/src/selectionIdentifiers.d.ts +3 -0
- package/lib/typescript/module/src/selectionIdentifiers.d.ts.map +1 -0
- package/lib/typescript/module/src/submitBehavior.d.ts +9 -0
- package/lib/typescript/module/src/submitBehavior.d.ts.map +1 -0
- package/lib/typescript/module/src/tabItems.d.ts +55 -0
- package/lib/typescript/module/src/tabItems.d.ts.map +1 -0
- package/lib/typescript/module/src/web/Button.d.ts +9 -0
- package/lib/typescript/module/src/web/Button.d.ts.map +1 -0
- package/lib/typescript/module/src/web/ButtonGroup.d.ts +11 -0
- package/lib/typescript/module/src/web/ButtonGroup.d.ts.map +1 -0
- package/lib/typescript/module/src/web/DatePicker.d.ts +14 -0
- package/lib/typescript/module/src/web/DatePicker.d.ts.map +1 -0
- package/lib/typescript/module/src/web/DateRangePicker.d.ts +11 -0
- package/lib/typescript/module/src/web/DateRangePicker.d.ts.map +1 -0
- package/lib/typescript/module/src/web/Dialog.d.ts +12 -0
- package/lib/typescript/module/src/web/Dialog.d.ts.map +1 -0
- package/lib/typescript/module/src/web/FloatingActionButton.d.ts +8 -0
- package/lib/typescript/module/src/web/FloatingActionButton.d.ts.map +1 -0
- package/lib/typescript/module/src/web/Icon.d.ts +12 -0
- package/lib/typescript/module/src/web/Icon.d.ts.map +1 -0
- package/lib/typescript/module/src/web/NativeTheme.d.ts +10 -0
- package/lib/typescript/module/src/web/NativeTheme.d.ts.map +1 -0
- package/lib/typescript/module/src/web/NavigationRail.d.ts +8 -0
- package/lib/typescript/module/src/web/NavigationRail.d.ts.map +1 -0
- package/lib/typescript/module/src/web/PlatformComponentsProvider.d.ts +10 -0
- package/lib/typescript/module/src/web/PlatformComponentsProvider.d.ts.map +1 -0
- package/lib/typescript/module/src/web/SegmentedControl.d.ts +8 -0
- package/lib/typescript/module/src/web/SegmentedControl.d.ts.map +1 -0
- package/lib/typescript/module/src/web/SelectionMenu.d.ts +10 -0
- package/lib/typescript/module/src/web/SelectionMenu.d.ts.map +1 -0
- package/lib/typescript/module/src/web/SplitButton.d.ts +9 -0
- package/lib/typescript/module/src/web/SplitButton.d.ts.map +1 -0
- package/lib/typescript/module/src/web/TabBar.d.ts +9 -0
- package/lib/typescript/module/src/web/TabBar.d.ts.map +1 -0
- package/lib/typescript/module/src/web/TextField.d.ts +9 -0
- package/lib/typescript/module/src/web/TextField.d.ts.map +1 -0
- package/lib/typescript/module/src/web/components.d.ts +17 -0
- package/lib/typescript/module/src/web/components.d.ts.map +1 -0
- package/lib/typescript/module/src/web/containers.d.ts +24 -0
- package/lib/typescript/module/src/web/containers.d.ts.map +1 -0
- package/lib/typescript/module/src/web/dateInput.d.ts +20 -0
- package/lib/typescript/module/src/web/dateInput.d.ts.map +1 -0
- package/lib/typescript/module/src/web/shared.d.ts +43 -0
- package/lib/typescript/module/src/web/shared.d.ts.map +1 -0
- package/lib/typescript/module/src/webComponents.d.ts +43 -0
- package/lib/typescript/module/src/webComponents.d.ts.map +1 -0
- package/package.json +32 -2
- package/plugin/build/index.cjs +79 -6
- package/plugin/build/index.d.ts +27 -2
- package/plugin/build/index.d.ts.map +1 -1
- package/plugin/tsconfig.json +2 -1
- package/react-native.config.js +3 -0
- package/shared/PCFloatingActionButtonComponentDescriptors-custom.h +22 -0
- package/shared/PCFloatingActionButtonShadowNode-custom.cpp +48 -0
- package/shared/PCFloatingActionButtonShadowNode-custom.h +54 -0
- package/shared/PCFloatingActionButtonState-custom.h +61 -0
- package/shared/PCNavigationRailComponentDescriptors-custom.h +47 -0
- package/shared/PCNavigationRailShadowNode-custom.h +42 -0
- package/shared/PCNavigationRailState-custom.h +62 -0
- package/shared/PCTabBarComponentDescriptors-custom.h +22 -0
- package/shared/PCTabBarShadowNode-custom.cpp +54 -0
- package/shared/PCTabBarShadowNode-custom.h +54 -0
- package/shared/PCTabBarState-custom.h +62 -0
- package/shared/react/renderer/components/PlatformComponentsViewSpec/ComponentDescriptors.h +3 -0
- package/src/Button.tsx +222 -7
- package/src/ButtonGroup.tsx +29 -11
- package/src/ButtonGroupNativeComponent.ts +74 -4
- package/src/ButtonNativeComponent.ts +119 -3
- package/src/ContextMenu.tsx +34 -81
- package/src/ContextMenuNativeComponent.ts +47 -49
- package/src/DatePicker.tsx +182 -4
- package/src/DatePickerNativeComponent.ts +19 -2
- package/src/FloatingActionButton.tsx +121 -0
- package/src/FloatingActionButtonNativeComponent.ts +58 -0
- package/src/FloatingToolbar.tsx +54 -3
- package/src/FloatingToolbarNativeComponent.ts +16 -0
- package/src/LiquidGlass.tsx +24 -1
- package/src/LiquidGlassContainer.tsx +42 -0
- package/src/LiquidGlassContainerNativeComponent.ts +17 -0
- package/src/LiquidGlassNativeComponent.ts +8 -0
- package/src/NavigationRail.tsx +203 -0
- package/src/NavigationRailNativeComponent.ts +107 -0
- package/src/PlatformComponentsProvider.tsx +15 -0
- package/src/SegmentedControl.tsx +31 -1
- package/src/SegmentedControlNativeComponent.ts +11 -0
- package/src/SelectionMenu.tsx +81 -6
- package/src/SelectionMenuNativeComponent.ts +26 -4
- package/src/SplitButton.tsx +198 -0
- package/src/TabBar.tsx +373 -0
- package/src/TabBarAccessoryNativeComponent.ts +19 -0
- package/src/TabBarNativeComponent.ts +145 -0
- package/src/TextField.tsx +428 -14
- package/src/TextFieldNativeComponent.ts +110 -4
- package/src/focusRegistry.ts +1 -0
- package/src/haptics.ts +31 -0
- package/src/icons.ts +28 -1
- package/src/index.tsx +7 -0
- package/src/index.web.tsx +51 -391
- package/src/jest.tsx +958 -0
- package/src/menuItems.ts +152 -0
- package/src/selectionIdentifiers.ts +17 -0
- package/src/submitBehavior.ts +16 -0
- package/src/tabItems.ts +113 -0
- package/src/web/Button.tsx +201 -0
- package/src/web/ButtonGroup.tsx +154 -0
- package/src/web/DatePicker.tsx +204 -0
- package/src/web/DateRangePicker.tsx +135 -0
- package/src/web/Dialog.tsx +54 -0
- package/src/web/FloatingActionButton.tsx +76 -0
- package/src/web/Icon.tsx +33 -0
- package/src/web/NativeTheme.ts +23 -0
- package/src/web/NavigationRail.tsx +148 -0
- package/src/web/PlatformComponentsProvider.tsx +48 -0
- package/src/web/SegmentedControl.tsx +127 -0
- package/src/web/SelectionMenu.tsx +149 -0
- package/src/web/SplitButton.tsx +32 -0
- package/src/web/TabBar.tsx +150 -0
- package/src/web/TextField.tsx +361 -0
- package/src/web/components.tsx +71 -0
- package/src/web/containers.tsx +130 -0
- package/src/web/dateInput.ts +137 -0
- package/src/web/shared.ts +176 -0
- package/src/webComponents.ts +45 -0
- package/android/src/main/java/com/platformcomponents/DateConstraints.kt +0 -83
|
@@ -12,6 +12,7 @@ public final class PCDatePickerView: UIControl,
|
|
|
12
12
|
private let picker = UIDatePicker()
|
|
13
13
|
private var modalVC: UIViewController?
|
|
14
14
|
private var inlineConstraints: [NSLayoutConstraint] = []
|
|
15
|
+
private var updatingPresentation = false
|
|
15
16
|
|
|
16
17
|
private var modalToolbarHeight: CGFloat {
|
|
17
18
|
// iOS 26 renders bar button items as oversized Liquid Glass pills;
|
|
@@ -31,12 +32,14 @@ public final class PCDatePickerView: UIControl,
|
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
// MARK: - Events (wired from ObjC++)
|
|
34
|
-
|
|
35
|
+
/// (timestampMs, confirmed, durationSeconds). `durationSeconds` is the
|
|
36
|
+
/// selected countdown duration in countDownTimer mode, 0 otherwise.
|
|
37
|
+
public var onChangeHandler: ((NSNumber, Bool, NSNumber) -> Void)?
|
|
35
38
|
public var onCancelHandler: (() -> Void)?
|
|
36
39
|
|
|
37
40
|
// MARK: - Props
|
|
38
41
|
|
|
39
|
-
/// "date" | "time" | "dateAndTime" | "countDownTimer"
|
|
42
|
+
/// "date" | "time" | "dateAndTime" | "countDownTimer" | "yearAndMonth"
|
|
40
43
|
public var mode: String = "date" {
|
|
41
44
|
didSet {
|
|
42
45
|
if oldValue != mode {
|
|
@@ -49,7 +52,7 @@ public final class PCDatePickerView: UIControl,
|
|
|
49
52
|
/// "modal" | "inline"
|
|
50
53
|
public var presentation: String = "modal" {
|
|
51
54
|
didSet {
|
|
52
|
-
if oldValue != presentation {
|
|
55
|
+
if oldValue != presentation && !updatingPresentation {
|
|
53
56
|
applyPresentation()
|
|
54
57
|
invalidateSize()
|
|
55
58
|
}
|
|
@@ -59,7 +62,7 @@ public final class PCDatePickerView: UIControl,
|
|
|
59
62
|
/// modal only: NSNumber(0/1)
|
|
60
63
|
public var open: NSNumber? {
|
|
61
64
|
didSet {
|
|
62
|
-
guard oldValue != open else { return }
|
|
65
|
+
guard oldValue != open, !updatingPresentation else { return }
|
|
63
66
|
applyOpen()
|
|
64
67
|
}
|
|
65
68
|
}
|
|
@@ -74,6 +77,16 @@ public final class PCDatePickerView: UIControl,
|
|
|
74
77
|
public var localeIdentifier: String? { didSet { applyLocale() } }
|
|
75
78
|
public var timeZoneName: String? { didSet { applyTimeZone() } }
|
|
76
79
|
|
|
80
|
+
/// "" (the locale's own clock) | "12" | "24"
|
|
81
|
+
public var hourFormat: String = "" {
|
|
82
|
+
didSet {
|
|
83
|
+
if oldValue != hourFormat {
|
|
84
|
+
applyLocale()
|
|
85
|
+
invalidateSize()
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
77
90
|
/// "wheels" | "compact" | "inline" | "automatic"
|
|
78
91
|
public var preferredStyle: String? {
|
|
79
92
|
didSet {
|
|
@@ -221,6 +234,28 @@ public final class PCDatePickerView: UIControl,
|
|
|
221
234
|
|
|
222
235
|
// MARK: - Presentation
|
|
223
236
|
|
|
237
|
+
/// Apply presentation and visibility together after the other props, so
|
|
238
|
+
/// opening never uses the previous mode, style or toolbar configuration.
|
|
239
|
+
@objc(configurePresentation:open:)
|
|
240
|
+
public func configurePresentation(_ value: String, open shouldOpen: Bool) {
|
|
241
|
+
guard presentation != value || open?.boolValue != shouldOpen else { return }
|
|
242
|
+
updatingPresentation = true
|
|
243
|
+
presentation = value
|
|
244
|
+
open = NSNumber(value: shouldOpen)
|
|
245
|
+
updatingPresentation = false
|
|
246
|
+
applyPresentation()
|
|
247
|
+
invalidateSize()
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
public override func didMoveToWindow() {
|
|
251
|
+
super.didMoveToWindow()
|
|
252
|
+
if window == nil {
|
|
253
|
+
dismissIfNeeded(emitCancel: false, animated: false)
|
|
254
|
+
} else {
|
|
255
|
+
applyOpen()
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
224
259
|
private func applyPresentation() {
|
|
225
260
|
if presentation == "embedded" {
|
|
226
261
|
dismissIfNeeded(emitCancel: false)
|
|
@@ -280,7 +315,7 @@ public final class PCDatePickerView: UIControl,
|
|
|
280
315
|
// MARK: - Modal Popover
|
|
281
316
|
|
|
282
317
|
private func presentIfNeeded() {
|
|
283
|
-
guard modalVC == nil else { return }
|
|
318
|
+
guard modalVC == nil, window != nil else { return }
|
|
284
319
|
guard let top = topViewController() else {
|
|
285
320
|
logger.warning("presentIfNeeded: no view controller found")
|
|
286
321
|
return
|
|
@@ -393,11 +428,11 @@ public final class PCDatePickerView: UIControl,
|
|
|
393
428
|
top.present(vc, animated: true)
|
|
394
429
|
}
|
|
395
430
|
|
|
396
|
-
private func dismissIfNeeded(emitCancel: Bool) {
|
|
431
|
+
private func dismissIfNeeded(emitCancel: Bool, animated: Bool = true) {
|
|
397
432
|
guard let vc = modalVC else { return }
|
|
398
433
|
logger.debug("dismissIfNeeded: dismissing modal, emitCancel=\(emitCancel)")
|
|
399
434
|
modalVC = nil
|
|
400
|
-
vc.dismiss(animated:
|
|
435
|
+
vc.dismiss(animated: animated) { [weak self] in
|
|
401
436
|
guard let self else { return }
|
|
402
437
|
if emitCancel { self.onCancelHandler?() }
|
|
403
438
|
}
|
|
@@ -430,21 +465,28 @@ public final class PCDatePickerView: UIControl,
|
|
|
430
465
|
// Skip "programmatic/settle" changes
|
|
431
466
|
if suppressChangeEvents { return }
|
|
432
467
|
|
|
433
|
-
let ms = picker.date.timeIntervalSince1970 * 1000.0
|
|
434
468
|
// In modal mode, valueChanged is "user is still adjusting" —
|
|
435
469
|
// confirmation only happens when the user taps Done. Embedded
|
|
436
470
|
// presentation always confirms (there's no Done button to gate on).
|
|
437
471
|
let isModal = presentation == "modal" && modalVC != nil
|
|
438
|
-
|
|
472
|
+
emitChange(confirmed: !isModal)
|
|
439
473
|
}
|
|
440
474
|
|
|
441
475
|
@objc private func handleDoneTap() {
|
|
442
476
|
guard presentation == "modal", modalVC != nil else { return }
|
|
443
|
-
|
|
444
|
-
onChangeHandler?(NSNumber(value: ms), true)
|
|
477
|
+
emitChange(confirmed: true)
|
|
445
478
|
dismissIfNeeded(emitCancel: false)
|
|
446
479
|
}
|
|
447
480
|
|
|
481
|
+
/// In countDownTimer mode `picker.date` is meaningless for the caller;
|
|
482
|
+
/// the selection is `countDownDuration`, reported as `durationSeconds`.
|
|
483
|
+
private func emitChange(confirmed: Bool) {
|
|
484
|
+
let ms = picker.date.timeIntervalSince1970 * 1000.0
|
|
485
|
+
let duration =
|
|
486
|
+
picker.datePickerMode == .countDownTimer ? picker.countDownDuration : 0
|
|
487
|
+
onChangeHandler?(NSNumber(value: ms), confirmed, NSNumber(value: duration))
|
|
488
|
+
}
|
|
489
|
+
|
|
448
490
|
@objc private func handleCancelTap() {
|
|
449
491
|
dismissIfNeeded(emitCancel: true)
|
|
450
492
|
}
|
|
@@ -480,11 +522,29 @@ public final class PCDatePickerView: UIControl,
|
|
|
480
522
|
|
|
481
523
|
private func applyLocale() {
|
|
482
524
|
suppressNextChangesBriefly()
|
|
525
|
+
var locale: Locale?
|
|
483
526
|
if let id = localeIdentifier, !id.isEmpty {
|
|
484
|
-
|
|
485
|
-
}
|
|
486
|
-
|
|
527
|
+
locale = Locale(identifier: id)
|
|
528
|
+
}
|
|
529
|
+
// UIDatePicker draws its clock in its locale's hour cycle, so a
|
|
530
|
+
// forced 12/24-hour clock is the locale with that cycle
|
|
531
|
+
if hourFormat == "12" || hourFormat == "24" {
|
|
532
|
+
locale = PCDatePickerView.locale(locale ?? .current, is24Hour: hourFormat == "24")
|
|
487
533
|
}
|
|
534
|
+
picker.locale = locale
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/// [base] with its hour cycle forced to 0–23 or 1–12.
|
|
538
|
+
private static func locale(_ base: Locale, is24Hour: Bool) -> Locale {
|
|
539
|
+
if #available(iOS 16.0, *) {
|
|
540
|
+
var components = Locale.Components(locale: base)
|
|
541
|
+
components.hourCycle = is24Hour ? .zeroToTwentyThree : .oneToTwelve
|
|
542
|
+
return Locale(components: components)
|
|
543
|
+
}
|
|
544
|
+
// The ICU keyword that Locale.Components writes on iOS 16+
|
|
545
|
+
let keyword = "hours=\(is24Hour ? "h23" : "h12")"
|
|
546
|
+
let id = base.identifier
|
|
547
|
+
return Locale(identifier: id.contains("@") ? "\(id);\(keyword)" : "\(id)@\(keyword)")
|
|
488
548
|
}
|
|
489
549
|
|
|
490
550
|
private func applyTimeZone() {
|
|
@@ -496,21 +556,39 @@ public final class PCDatePickerView: UIControl,
|
|
|
496
556
|
}
|
|
497
557
|
}
|
|
498
558
|
|
|
559
|
+
/// The countdown timer and the month-and-year picker only exist as wheels
|
|
560
|
+
private var wheelsOnlyMode: Bool { mode == "countDownTimer" || mode == "yearAndMonth" }
|
|
561
|
+
|
|
499
562
|
private func applyMode() {
|
|
500
563
|
suppressNextChangesBriefly()
|
|
564
|
+
// UIKit throws when a wheels-only mode meets the compact or inline
|
|
565
|
+
// style; set the style it supports first
|
|
566
|
+
if wheelsOnlyMode { applyPreferredStyle() }
|
|
501
567
|
switch mode {
|
|
502
568
|
case "date": picker.datePickerMode = .date
|
|
503
569
|
case "time": picker.datePickerMode = .time
|
|
504
570
|
case "dateAndTime": picker.datePickerMode = .dateAndTime
|
|
505
571
|
case "countDownTimer": picker.datePickerMode = .countDownTimer
|
|
572
|
+
case "yearAndMonth":
|
|
573
|
+
// iOS 17.4; the date wheels before
|
|
574
|
+
if #available(iOS 17.4, *) {
|
|
575
|
+
picker.datePickerMode = .yearAndMonth
|
|
576
|
+
} else {
|
|
577
|
+
picker.datePickerMode = .date
|
|
578
|
+
}
|
|
506
579
|
default: picker.datePickerMode = .date
|
|
507
580
|
}
|
|
581
|
+
// Leaving a wheels-only mode, the preferred style can apply again
|
|
582
|
+
if !wheelsOnlyMode { applyPreferredStyle() }
|
|
583
|
+
// countDownDuration is ignored outside countDownTimer mode, so apply it
|
|
584
|
+
// again in case the prop arrived before the mode did.
|
|
585
|
+
applyCountDownDuration()
|
|
508
586
|
}
|
|
509
587
|
|
|
510
588
|
private func applyPreferredStyle() {
|
|
511
589
|
guard #available(iOS 13.4, *) else { return }
|
|
512
590
|
suppressNextChangesBriefly()
|
|
513
|
-
let s = preferredStyle ?? "automatic"
|
|
591
|
+
let s = wheelsOnlyMode ? "wheels" : (preferredStyle ?? "automatic")
|
|
514
592
|
switch s {
|
|
515
593
|
case "wheels": picker.preferredDatePickerStyle = .wheels
|
|
516
594
|
case "compact": picker.preferredDatePickerStyle = .compact
|
|
@@ -546,11 +624,7 @@ public final class PCDatePickerView: UIControl,
|
|
|
546
624
|
// MARK: - Top VC (same approach you were using)
|
|
547
625
|
|
|
548
626
|
private func topViewController() -> UIViewController? {
|
|
549
|
-
guard
|
|
550
|
-
let scene = UIApplication.shared.connectedScenes.compactMap({ $0 as? UIWindowScene })
|
|
551
|
-
.first,
|
|
552
|
-
let root = scene.windows.first(where: { $0.isKeyWindow })?.rootViewController
|
|
553
|
-
else { return nil }
|
|
627
|
+
guard let root = window?.rootViewController else { return nil }
|
|
554
628
|
|
|
555
629
|
var top = root
|
|
556
630
|
while true {
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// PCFloatingActionButton.mm
|
|
2
|
+
|
|
3
|
+
#import "PCFloatingActionButton.h"
|
|
4
|
+
|
|
5
|
+
#import <React/RCTComponentViewFactory.h>
|
|
6
|
+
#import <React/RCTConversions.h>
|
|
7
|
+
#import <React/RCTFabricComponentsPlugins.h>
|
|
8
|
+
|
|
9
|
+
#import <react/renderer/components/PlatformComponentsViewSpec/ComponentDescriptors.h>
|
|
10
|
+
#import <react/renderer/components/PlatformComponentsViewSpec/EventEmitters.h>
|
|
11
|
+
#import <react/renderer/components/PlatformComponentsViewSpec/Props.h>
|
|
12
|
+
#import <react/renderer/core/LayoutPrimitives.h>
|
|
13
|
+
|
|
14
|
+
#if __has_include(<PlatformComponents/PlatformComponents-Swift.h>)
|
|
15
|
+
#import <PlatformComponents/PlatformComponents-Swift.h>
|
|
16
|
+
#else
|
|
17
|
+
#import "PlatformComponents-Swift.h"
|
|
18
|
+
#endif
|
|
19
|
+
|
|
20
|
+
#import "PCFloatingActionButtonComponentDescriptors-custom.h"
|
|
21
|
+
#import "PCFloatingActionButtonShadowNode-custom.h"
|
|
22
|
+
#import "PCFloatingActionButtonState-custom.h"
|
|
23
|
+
|
|
24
|
+
using namespace facebook::react;
|
|
25
|
+
|
|
26
|
+
namespace {
|
|
27
|
+
static inline NSString *NSStringFromStd(const std::string &s, NSString *fallback) {
|
|
28
|
+
return s.empty() ? fallback : [NSString stringWithUTF8String:s.c_str()];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static inline bool IconEqual(
|
|
32
|
+
const PCFloatingActionButtonIconStruct &a,
|
|
33
|
+
const PCFloatingActionButtonIconStruct &b) {
|
|
34
|
+
return a.iconType == b.iconType && a.iconName == b.iconName && a.iconRequest == b.iconRequest && a.iconUri == b.iconUri &&
|
|
35
|
+
a.iconScale == b.iconScale && a.iconTinted == b.iconTinted;
|
|
36
|
+
}
|
|
37
|
+
} // namespace
|
|
38
|
+
|
|
39
|
+
@interface PCFloatingActionButton ()
|
|
40
|
+
|
|
41
|
+
- (void)updateMeasurements;
|
|
42
|
+
|
|
43
|
+
@end
|
|
44
|
+
|
|
45
|
+
@implementation PCFloatingActionButton {
|
|
46
|
+
PCFloatingActionButtonView *_view;
|
|
47
|
+
MeasuringPCFloatingActionButtonShadowNode::ConcreteState::Shared _state;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider {
|
|
51
|
+
return concreteComponentDescriptorProvider<MeasuringPCFloatingActionButtonComponentDescriptor>();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
- (instancetype)initWithFrame:(CGRect)frame {
|
|
55
|
+
if (self = [super initWithFrame:frame]) {
|
|
56
|
+
// Fabric views seed _props with their own defaults: RCTViewComponentView
|
|
57
|
+
// asserts on it in debug builds of React Native core, and the first
|
|
58
|
+
// updateProps would otherwise read the base ViewProps as the component's.
|
|
59
|
+
static const auto defaultProps = std::make_shared<const PCFloatingActionButtonProps>();
|
|
60
|
+
_props = defaultProps;
|
|
61
|
+
|
|
62
|
+
_view = [PCFloatingActionButtonView new];
|
|
63
|
+
self.contentView = _view;
|
|
64
|
+
|
|
65
|
+
__weak __typeof(self) weakSelf = self;
|
|
66
|
+
|
|
67
|
+
_view.onPress = ^{
|
|
68
|
+
__typeof(self) strongSelf = weakSelf;
|
|
69
|
+
if (!strongSelf) return;
|
|
70
|
+
|
|
71
|
+
[strongSelf->_view.haptics performIn:strongSelf->_view];
|
|
72
|
+
|
|
73
|
+
auto eventEmitter = std::static_pointer_cast<const PCFloatingActionButtonEventEmitter>(
|
|
74
|
+
strongSelf->_eventEmitter);
|
|
75
|
+
if (!eventEmitter) return;
|
|
76
|
+
|
|
77
|
+
eventEmitter->onFabPress({});
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
_view.onNeedsRemeasure = ^{
|
|
81
|
+
__typeof(self) strongSelf = weakSelf;
|
|
82
|
+
if (!strongSelf) return;
|
|
83
|
+
[strongSelf updateMeasurements];
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return self;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
- (void)updateProps:(Props::Shared const &)props
|
|
90
|
+
oldProps:(Props::Shared const &)oldProps {
|
|
91
|
+
const auto &newProps = *std::static_pointer_cast<const PCFloatingActionButtonProps>(props);
|
|
92
|
+
const auto prevProps = std::static_pointer_cast<const PCFloatingActionButtonProps>(oldProps);
|
|
93
|
+
|
|
94
|
+
// icon: {iconType, iconName, iconUri, iconScale, iconTinted}
|
|
95
|
+
if (!prevProps || !IconEqual(newProps.icon, prevProps->icon)) {
|
|
96
|
+
const auto &icon = newProps.icon;
|
|
97
|
+
[_view setIconWithType:NSStringFromStd(icon.iconType, @"")
|
|
98
|
+
name:NSStringFromStd(icon.iconName, @"")
|
|
99
|
+
request:NSStringFromStd(icon.iconRequest, @"")
|
|
100
|
+
uri:NSStringFromStd(icon.iconUri, @"")
|
|
101
|
+
scale:icon.iconScale
|
|
102
|
+
tinted:(icon.iconTinted != "false")];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (!prevProps || newProps.size != prevProps->size) {
|
|
106
|
+
_view.size = NSStringFromStd(newProps.size, @"regular");
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// extended before the label, which shows in the state it gives
|
|
110
|
+
if (!prevProps || newProps.extended != prevProps->extended) {
|
|
111
|
+
_view.extended = newProps.extended != "false";
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (!prevProps || newProps.label != prevProps->label) {
|
|
115
|
+
_view.label = NSStringFromStd(newProps.label, @"");
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Colors arrive as SharedColor (already processed by React Native)
|
|
119
|
+
if (!prevProps || newProps.color != prevProps->color) {
|
|
120
|
+
_view.containerColor = RCTUIColorFromSharedColor(newProps.color);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (!prevProps || newProps.foregroundColor != prevProps->foregroundColor) {
|
|
124
|
+
_view.foregroundColor = RCTUIColorFromSharedColor(newProps.foregroundColor);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (!prevProps || newProps.interactivity != prevProps->interactivity) {
|
|
128
|
+
_view.interactivity = NSStringFromStd(newProps.interactivity, @"enabled");
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (!prevProps || newProps.spokenLabel != prevProps->spokenLabel) {
|
|
132
|
+
_view.spokenLabel = NSStringFromStd(newProps.spokenLabel, @"");
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (!prevProps || newProps.scrollViewNativeID != prevProps->scrollViewNativeID) {
|
|
136
|
+
_view.scrollViewNativeID = NSStringFromStd(newProps.scrollViewNativeID, @"");
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (!prevProps || newProps.haptics != prevProps->haptics) {
|
|
140
|
+
_view.haptics.kind = NSStringFromStd(newProps.haptics, @"");
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
[super updateProps:props oldProps:oldProps];
|
|
144
|
+
|
|
145
|
+
[self updateMeasurements];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
#pragma mark - State (Measuring)
|
|
149
|
+
|
|
150
|
+
- (void)updateState:(const State::Shared &)state
|
|
151
|
+
oldState:(const State::Shared &)oldState {
|
|
152
|
+
_state = std::static_pointer_cast<const MeasuringPCFloatingActionButtonShadowNode::ConcreteState>(state);
|
|
153
|
+
|
|
154
|
+
if (oldState == nullptr) {
|
|
155
|
+
[self updateMeasurements];
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
[super updateState:state oldState:oldState];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
- (void)updateMeasurements {
|
|
162
|
+
if (_state == nullptr) return;
|
|
163
|
+
|
|
164
|
+
CGSize size = [_view sizeForLayoutWithConstrainedTo:CGSizeZero];
|
|
165
|
+
|
|
166
|
+
PCFloatingActionButtonStateFrameSize next;
|
|
167
|
+
next.frameSize = {(Float)size.width, (Float)size.height};
|
|
168
|
+
if (_state->getData() != next) {
|
|
169
|
+
_state->updateState(std::move(next));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
@end
|
|
174
|
+
|
|
175
|
+
Class<RCTComponentViewProtocol> PCFloatingActionButtonCls(void) {
|
|
176
|
+
return PCFloatingActionButton.class;
|
|
177
|
+
}
|