react-native-platform-components 1.4.0 → 1.5.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.d.ts +3 -2
- package/plugin/build/index.d.ts.map +1 -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
package/ios/PCSelectionMenu.mm
CHANGED
|
@@ -31,9 +31,20 @@ static inline bool OptionsEqual(
|
|
|
31
31
|
for (size_t i = 0; i < a.size(); i++) {
|
|
32
32
|
if (a[i].label != b[i].label) return false;
|
|
33
33
|
if (a[i].data != b[i].data) return false;
|
|
34
|
+
if (a[i].disabled != b[i].disabled) return false;
|
|
35
|
+
if (a[i].subtitle != b[i].subtitle) return false;
|
|
36
|
+
if (a[i].iconType != b[i].iconType) return false;
|
|
37
|
+
if (a[i].iconName != b[i].iconName) return false;
|
|
38
|
+
if (a[i].iconRequest != b[i].iconRequest || a[i].iconUri != b[i].iconUri) return false;
|
|
39
|
+
if (a[i].iconScale != b[i].iconScale) return false;
|
|
40
|
+
if (a[i].iconTinted != b[i].iconTinted) return false;
|
|
34
41
|
}
|
|
35
42
|
return true;
|
|
36
43
|
}
|
|
44
|
+
|
|
45
|
+
static inline NSString *ToNSString(const std::string &value) {
|
|
46
|
+
return value.empty() ? @"" : [NSString stringWithUTF8String:value.c_str()];
|
|
47
|
+
}
|
|
37
48
|
} // namespace
|
|
38
49
|
|
|
39
50
|
@interface PCSelectionMenu ()
|
|
@@ -54,6 +65,12 @@ static inline bool OptionsEqual(
|
|
|
54
65
|
|
|
55
66
|
- (instancetype)initWithFrame:(CGRect)frame {
|
|
56
67
|
if (self = [super initWithFrame:frame]) {
|
|
68
|
+
// Fabric views seed _props with their own defaults: RCTViewComponentView
|
|
69
|
+
// asserts on it in debug builds of React Native core, and the first
|
|
70
|
+
// updateProps would otherwise read the base ViewProps as PCSelectionMenuProps.
|
|
71
|
+
static const auto defaultProps = std::make_shared<const PCSelectionMenuProps>();
|
|
72
|
+
_props = defaultProps;
|
|
73
|
+
|
|
57
74
|
_view = [PCSelectionMenuView new];
|
|
58
75
|
self.contentView = _view;
|
|
59
76
|
|
|
@@ -63,6 +80,8 @@ static inline bool OptionsEqual(
|
|
|
63
80
|
__typeof(self) strongSelf = weakSelf;
|
|
64
81
|
if (!strongSelf) return;
|
|
65
82
|
|
|
83
|
+
[strongSelf->_view.haptics performIn:strongSelf->_view];
|
|
84
|
+
|
|
66
85
|
// The Swift view has already updated its content (selectedData + sync()).
|
|
67
86
|
// Trigger measurement now so Yoga gets the new size before the React
|
|
68
87
|
// round-trip, preventing a frame of clipped text.
|
|
@@ -104,17 +123,22 @@ static inline bool OptionsEqual(
|
|
|
104
123
|
const auto prevProps =
|
|
105
124
|
std::static_pointer_cast<const PCSelectionMenuProps>(oldProps);
|
|
106
125
|
|
|
107
|
-
// options: [{label,data}]
|
|
126
|
+
// options: [{label, data, subtitle, icon fields}]
|
|
108
127
|
if (!prevProps || !OptionsEqual(newProps.options, prevProps->options)) {
|
|
109
128
|
NSMutableArray *arr = [NSMutableArray new];
|
|
110
129
|
for (const auto &opt : newProps.options) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
130
|
+
[arr addObject:@{
|
|
131
|
+
@"label" : ToNSString(opt.label),
|
|
132
|
+
@"data" : ToNSString(opt.data),
|
|
133
|
+
@"disabled" : ToNSString(opt.disabled),
|
|
134
|
+
@"subtitle" : ToNSString(opt.subtitle),
|
|
135
|
+
@"iconType" : ToNSString(opt.iconType),
|
|
136
|
+
@"iconName" : ToNSString(opt.iconName),
|
|
137
|
+
@"iconRequest" : ToNSString(opt.iconRequest),
|
|
138
|
+
@"iconUri" : ToNSString(opt.iconUri),
|
|
139
|
+
@"iconScale" : @(opt.iconScale),
|
|
140
|
+
@"iconTinted" : ToNSString(opt.iconTinted),
|
|
141
|
+
}];
|
|
118
142
|
}
|
|
119
143
|
_view.options = arr;
|
|
120
144
|
}
|
|
@@ -168,6 +192,10 @@ static inline bool OptionsEqual(
|
|
|
168
192
|
}
|
|
169
193
|
}
|
|
170
194
|
|
|
195
|
+
if (!prevProps || newProps.haptics != prevProps->haptics) {
|
|
196
|
+
_view.haptics.kind = [NSString stringWithUTF8String:newProps.haptics.c_str()];
|
|
197
|
+
}
|
|
198
|
+
|
|
171
199
|
// android.material (plumbed through; iOS can ignore)
|
|
172
200
|
const auto &newAndroid = newProps.android;
|
|
173
201
|
const auto &oldAndroid =
|
|
@@ -8,14 +8,33 @@ private let logger = Logger(subsystem: "com.platformcomponents", category: "Sele
|
|
|
8
8
|
struct PCSelectionMenuOption {
|
|
9
9
|
let label: String
|
|
10
10
|
let data: String
|
|
11
|
+
let disabled: Bool
|
|
12
|
+
let subtitle: String
|
|
13
|
+
let icon: PCButtonSupport.Icon
|
|
11
14
|
}
|
|
12
15
|
|
|
13
16
|
@objcMembers
|
|
14
17
|
public final class PCSelectionMenuView: UIControl {
|
|
15
18
|
// MARK: - Props (set from ObjC++)
|
|
16
19
|
|
|
17
|
-
/// ObjC++ sets this as an array of dictionaries:
|
|
18
|
-
|
|
20
|
+
/// ObjC++ sets this as an array of dictionaries:
|
|
21
|
+
/// [{label, data, subtitle, iconType, iconName, iconUri, iconScale, iconTinted}]
|
|
22
|
+
public var options: [Any] = [] {
|
|
23
|
+
didSet {
|
|
24
|
+
parsedOptions = options.compactMap { any in
|
|
25
|
+
guard let dict = any as? [String: Any] else { return nil }
|
|
26
|
+
return PCSelectionMenuOption(
|
|
27
|
+
label: (dict["label"] as? String) ?? "",
|
|
28
|
+
data: (dict["data"] as? String) ?? "",
|
|
29
|
+
disabled: (dict["disabled"] as? String) == "true",
|
|
30
|
+
subtitle: (dict["subtitle"] as? String) ?? "",
|
|
31
|
+
icon: PCButtonSupport.Icon(dictionary: dict)
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
menuImages.retain(icons: parsedOptions.map(\.icon))
|
|
35
|
+
sync()
|
|
36
|
+
}
|
|
37
|
+
}
|
|
19
38
|
|
|
20
39
|
/// Controlled selection by data. "" = no selection.
|
|
21
40
|
public var selectedData: String = "" { didSet { sync() } }
|
|
@@ -39,6 +58,9 @@ public final class PCSelectionMenuView: UIControl {
|
|
|
39
58
|
/// Android material preference (ignored on iOS; retained for debugging/log parity)
|
|
40
59
|
public var androidMaterial: String? = nil
|
|
41
60
|
|
|
61
|
+
/// The `haptics` prop; PCSelectionMenu.mm plays it on a pick
|
|
62
|
+
public let haptics = PCHaptics()
|
|
63
|
+
|
|
42
64
|
// MARK: - Events back to ObjC++
|
|
43
65
|
|
|
44
66
|
public var onSelect: ((Int, String, String) -> Void)? // (index,label,data)
|
|
@@ -50,18 +72,17 @@ public final class PCSelectionMenuView: UIControl {
|
|
|
50
72
|
|
|
51
73
|
// MARK: - Internal (headless)
|
|
52
74
|
|
|
53
|
-
|
|
75
|
+
/// Invisible anchor of the headless menu. On iOS 17.4+ it presents the
|
|
76
|
+
/// system menu (`performPrimaryAction()`); before that it only marks the
|
|
77
|
+
/// spot for the popover fallback.
|
|
78
|
+
private var headlessMenuButton: PCMenuButton?
|
|
54
79
|
private var headlessMenuVC: UIViewController?
|
|
55
80
|
private var headlessPresentationToken: Int = 0
|
|
81
|
+
/// An option was picked while the headless system menu was open.
|
|
82
|
+
private var headlessSelectedWhileOpen = false
|
|
56
83
|
|
|
57
|
-
private var parsedOptions: [PCSelectionMenuOption]
|
|
58
|
-
|
|
59
|
-
guard let dict = any as? [String: Any] else { return nil }
|
|
60
|
-
let label = (dict["label"] as? String) ?? ""
|
|
61
|
-
let data = (dict["data"] as? String) ?? ""
|
|
62
|
-
return PCSelectionMenuOption(label: label, data: data)
|
|
63
|
-
}
|
|
64
|
-
}
|
|
84
|
+
private var parsedOptions: [PCSelectionMenuOption] = []
|
|
85
|
+
private let menuImages = PCMenuImageState()
|
|
65
86
|
|
|
66
87
|
private var displayTitle: String {
|
|
67
88
|
let opts = parsedOptions
|
|
@@ -86,7 +107,9 @@ public final class PCSelectionMenuView: UIControl {
|
|
|
86
107
|
private func setup() {
|
|
87
108
|
backgroundColor = .clear
|
|
88
109
|
updateEnabled()
|
|
89
|
-
|
|
110
|
+
// The anchor (inline button or headless menu button) is installed when
|
|
111
|
+
// the anchorMode prop arrives, so an embedded menu never creates the
|
|
112
|
+
// headless button.
|
|
90
113
|
sync()
|
|
91
114
|
}
|
|
92
115
|
|
|
@@ -119,10 +142,8 @@ public final class PCSelectionMenuView: UIControl {
|
|
|
119
142
|
// Update the button title
|
|
120
143
|
menuButton?.setTitle(displayTitle, for: .normal)
|
|
121
144
|
|
|
122
|
-
// Rebuild the UIMenu with current options
|
|
123
|
-
|
|
124
|
-
rebuildMenu()
|
|
125
|
-
}
|
|
145
|
+
// Rebuild the UIMenu with current options (and update it if it's open)
|
|
146
|
+
rebuildMenu()
|
|
126
147
|
|
|
127
148
|
invalidateIntrinsicContentSize()
|
|
128
149
|
setNeedsLayout()
|
|
@@ -159,16 +180,51 @@ public final class PCSelectionMenuView: UIControl {
|
|
|
159
180
|
}
|
|
160
181
|
|
|
161
182
|
private func rebuildMenu() {
|
|
183
|
+
guard menuButton != nil || headlessMenuButton != nil else { return }
|
|
184
|
+
let menu = (interactivity == "disabled" || parsedOptions.isEmpty) ? nil : buildMenu()
|
|
185
|
+
menuButton?.menu = menu
|
|
186
|
+
// The headless menu shows the options as they were when it opened. A
|
|
187
|
+
// pick rebuilds it (selectedData) while it is closing, and a closing
|
|
188
|
+
// menu is left alone.
|
|
189
|
+
headlessMenuButton?.setMenu(menu, updatingVisibleMenu: false)
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/// A single-selection system menu of the options, with their subtitles and
|
|
193
|
+
/// icons. The system draws its checkmark on the selected option. Selection
|
|
194
|
+
/// stays controlled by the `selected` prop: the menu is rebuilt when it
|
|
195
|
+
/// changes, so the button's changesSelectionAsPrimaryAction stays off.
|
|
196
|
+
private func buildMenu() -> UIMenu {
|
|
162
197
|
let opts = parsedOptions
|
|
163
|
-
let
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
198
|
+
let items = opts.enumerated().map { idx, opt in
|
|
199
|
+
PCMenuItem(
|
|
200
|
+
index: idx,
|
|
201
|
+
id: String(idx),
|
|
202
|
+
title: opt.label,
|
|
203
|
+
subtitle: opt.subtitle,
|
|
204
|
+
icon: opt.icon,
|
|
205
|
+
disabled: opt.disabled,
|
|
206
|
+
state: (!selectedData.isEmpty && opt.data == selectedData) ? "on" : "off"
|
|
207
|
+
)
|
|
170
208
|
}
|
|
171
|
-
|
|
209
|
+
return PCMenuSupport.menu(
|
|
210
|
+
title: "",
|
|
211
|
+
options: .singleSelection,
|
|
212
|
+
items: items,
|
|
213
|
+
imageState: menuImages,
|
|
214
|
+
onImageLoaded: { [weak self] in self?.rebuildMenu() },
|
|
215
|
+
handler: { [weak self] item in
|
|
216
|
+
guard let self, item.index < opts.count else { return }
|
|
217
|
+
let opt = opts[item.index]
|
|
218
|
+
guard self.interactivity != "disabled",
|
|
219
|
+
self.parsedOptions.contains(where: { $0.data == opt.data && !$0.disabled }) else { return }
|
|
220
|
+
// A pick from the headless system menu isn't a dismissal to report
|
|
221
|
+
if self.anchorMode != "inline" { self.headlessSelectedWhileOpen = true }
|
|
222
|
+
self.onSelect?(item.index, opt.label, opt.data)
|
|
223
|
+
// UIKit may check the picked action itself. Rebuild from
|
|
224
|
+
// the controlled value once the action has finished.
|
|
225
|
+
DispatchQueue.main.async { [weak self] in self?.sync() }
|
|
226
|
+
}
|
|
227
|
+
)
|
|
172
228
|
}
|
|
173
229
|
|
|
174
230
|
override public func layoutSubviews() {
|
|
@@ -186,29 +242,59 @@ public final class PCSelectionMenuView: UIControl {
|
|
|
186
242
|
// MARK: - Headless
|
|
187
243
|
|
|
188
244
|
private func installHeadlessIfNeeded() {
|
|
189
|
-
guard
|
|
190
|
-
|
|
191
|
-
//
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
245
|
+
guard headlessMenuButton == nil else { return }
|
|
246
|
+
|
|
247
|
+
// An invisible button over the view's bounds anchors the system menu.
|
|
248
|
+
// Touches pass through the headless view (see hitTest), so only the
|
|
249
|
+
// `visible` prop opens it.
|
|
250
|
+
let button = PCMenuButton(type: .custom)
|
|
251
|
+
button.translatesAutoresizingMaskIntoConstraints = false
|
|
252
|
+
button.backgroundColor = .clear
|
|
253
|
+
button.isAccessibilityElement = false
|
|
254
|
+
button.onMenuOpen = { [weak self] in
|
|
255
|
+
self?.headlessSelectedWhileOpen = false
|
|
256
|
+
}
|
|
257
|
+
button.onMenuClose = { [weak self] in
|
|
258
|
+
guard let self else { return }
|
|
259
|
+
let selected = self.headlessSelectedWhileOpen
|
|
260
|
+
self.headlessSelectedWhileOpen = false
|
|
261
|
+
// Dismissed without a pick while still meant to be open: ask to close.
|
|
262
|
+
// A close requested through `visible` isn't reported back.
|
|
263
|
+
if !selected && self.visible == "open" {
|
|
264
|
+
logger.debug("headless system menu dismissed -> requestClose")
|
|
265
|
+
self.onRequestClose?()
|
|
266
|
+
}
|
|
267
|
+
}
|
|
196
268
|
|
|
197
|
-
addSubview(
|
|
269
|
+
addSubview(button)
|
|
198
270
|
NSLayoutConstraint.activate([
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
271
|
+
button.topAnchor.constraint(equalTo: topAnchor),
|
|
272
|
+
button.bottomAnchor.constraint(equalTo: bottomAnchor),
|
|
273
|
+
button.leadingAnchor.constraint(equalTo: leadingAnchor),
|
|
274
|
+
button.trailingAnchor.constraint(equalTo: trailingAnchor),
|
|
203
275
|
])
|
|
204
276
|
|
|
205
|
-
|
|
277
|
+
headlessMenuButton = button
|
|
278
|
+
rebuildMenu()
|
|
206
279
|
}
|
|
207
280
|
|
|
208
281
|
private func uninstallHeadlessIfNeeded() {
|
|
209
|
-
guard let
|
|
210
|
-
|
|
211
|
-
|
|
282
|
+
guard let button = headlessMenuButton else { return }
|
|
283
|
+
headlessMenuButton = nil
|
|
284
|
+
button.dismissMenu()
|
|
285
|
+
button.removeFromSuperview()
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
public override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
|
|
289
|
+
// Headless: the view is only an anchor, never a touch target.
|
|
290
|
+
guard anchorMode == "inline" else { return nil }
|
|
291
|
+
return super.hitTest(point, with: event)
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
public override func didMoveToWindow() {
|
|
295
|
+
super.didMoveToWindow()
|
|
296
|
+
// A menu asked for before the view was on screen opens now.
|
|
297
|
+
if window != nil, visible == "open" { updatePresentation() }
|
|
212
298
|
}
|
|
213
299
|
|
|
214
300
|
private func nearestViewController() -> UIViewController? {
|
|
@@ -227,20 +313,49 @@ public final class PCSelectionMenuView: UIControl {
|
|
|
227
313
|
headlessPresentationToken += 1
|
|
228
314
|
|
|
229
315
|
if visible == "open" && interactivity != "disabled" {
|
|
230
|
-
|
|
316
|
+
if PCMenuButton.canPresentMenuProgrammatically {
|
|
317
|
+
presentSystemMenuIfNeeded(token: headlessPresentationToken)
|
|
318
|
+
} else {
|
|
319
|
+
presentHeadlessMenuIfNeeded(token: headlessPresentationToken)
|
|
320
|
+
}
|
|
231
321
|
} else {
|
|
232
322
|
dismissHeadlessIfNeeded()
|
|
233
323
|
}
|
|
234
324
|
}
|
|
235
325
|
|
|
236
326
|
private func dismissHeadlessIfNeeded() {
|
|
327
|
+
if let button = headlessMenuButton, button.isMenuVisible {
|
|
328
|
+
button.dismissMenu()
|
|
329
|
+
}
|
|
237
330
|
guard let vc = headlessMenuVC else { return }
|
|
238
331
|
headlessMenuVC = nil
|
|
239
332
|
vc.dismiss(animated: true)
|
|
240
333
|
}
|
|
241
334
|
|
|
335
|
+
/// iOS 17.4+: the system menu, opened from the invisible anchor button with
|
|
336
|
+
/// `UIControl.performPrimaryAction()`.
|
|
337
|
+
private func presentSystemMenuIfNeeded(token: Int) {
|
|
338
|
+
guard let button = headlessMenuButton, !parsedOptions.isEmpty else { return }
|
|
339
|
+
|
|
340
|
+
// Next run loop turn, so the anchor has its final frame.
|
|
341
|
+
DispatchQueue.main.async { [weak self] in
|
|
342
|
+
guard let self else { return }
|
|
343
|
+
guard self.headlessPresentationToken == token else { return }
|
|
344
|
+
guard self.visible == "open", self.anchorMode != "inline" else { return }
|
|
345
|
+
guard self.interactivity != "disabled" else { return }
|
|
346
|
+
guard self.window != nil, !button.isMenuVisible else { return }
|
|
347
|
+
|
|
348
|
+
logger.debug("presentSystemMenuIfNeeded: presenting \(self.parsedOptions.count) options")
|
|
349
|
+
self.layoutIfNeeded()
|
|
350
|
+
self.rebuildMenu()
|
|
351
|
+
button.presentMenu()
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/// Before iOS 17.4 UIKit has no public way to open a menu without a touch,
|
|
356
|
+
/// so modal mode shows a popover styled like a system menu.
|
|
242
357
|
private func presentHeadlessMenuIfNeeded(token: Int) {
|
|
243
|
-
guard
|
|
358
|
+
guard headlessMenuButton != nil else { return }
|
|
244
359
|
guard let vc = nearestViewController() else { return }
|
|
245
360
|
|
|
246
361
|
let opts = parsedOptions
|
|
@@ -256,13 +371,21 @@ public final class PCSelectionMenuView: UIControl {
|
|
|
256
371
|
guard self.headlessMenuVC == nil else { return }
|
|
257
372
|
guard self.window != nil else { return }
|
|
258
373
|
|
|
374
|
+
let selectedIndex = self.selectedData.isEmpty
|
|
375
|
+
? nil
|
|
376
|
+
: opts.firstIndex(where: { $0.data == self.selectedData })
|
|
377
|
+
// Like a system menu, every row reserves the checkmark column when one is shown.
|
|
378
|
+
let reservesCheckmark = selectedIndex != nil
|
|
379
|
+
|
|
259
380
|
let menuVC = PCMenuViewController(
|
|
260
381
|
options: opts,
|
|
382
|
+
selectedIndex: selectedIndex,
|
|
261
383
|
onSelect: { [weak self] idx in
|
|
262
384
|
guard let self else { return }
|
|
263
385
|
let opt = opts[idx]
|
|
264
|
-
|
|
265
|
-
|
|
386
|
+
guard self.interactivity != "disabled",
|
|
387
|
+
self.parsedOptions.contains(where: { $0.data == opt.data && !$0.disabled }) else { return }
|
|
388
|
+
logger.debug("headless menu selected: index=\(idx)")
|
|
266
389
|
self.onSelect?(idx, opt.label, opt.data)
|
|
267
390
|
},
|
|
268
391
|
onCancel: { [weak self] in
|
|
@@ -289,7 +412,11 @@ public final class PCSelectionMenuView: UIControl {
|
|
|
289
412
|
// Measure the real (possibly multi-line) content height so the
|
|
290
413
|
// container fits its rows instead of clipping or leaving gaps.
|
|
291
414
|
let contentHeight = opts.reduce(PCConstants.popoverVerticalPadding) { partial, opt in
|
|
292
|
-
partial + PCConstants.popoverRowHeight(
|
|
415
|
+
partial + PCConstants.popoverRowHeight(
|
|
416
|
+
forLabel: opt.label,
|
|
417
|
+
width: menuWidth,
|
|
418
|
+
reservesCheckmark: reservesCheckmark
|
|
419
|
+
)
|
|
293
420
|
}
|
|
294
421
|
// Allow taller menus at accessibility sizes; otherwise keep them compact.
|
|
295
422
|
let maxHeight = category.isAccessibilityCategory
|
|
@@ -298,7 +425,11 @@ public final class PCSelectionMenuView: UIControl {
|
|
|
298
425
|
let popoverHeight = min(contentHeight, maxHeight)
|
|
299
426
|
|
|
300
427
|
// Check if menu fits below the source view
|
|
301
|
-
let firstRowHeight = PCConstants.popoverRowHeight(
|
|
428
|
+
let firstRowHeight = PCConstants.popoverRowHeight(
|
|
429
|
+
forLabel: opts[0].label,
|
|
430
|
+
width: menuWidth,
|
|
431
|
+
reservesCheckmark: reservesCheckmark
|
|
432
|
+
)
|
|
302
433
|
let wouldExtendBeyondBottom = sourceFrame.maxY + spacing + popoverHeight > screenBounds.maxY - 20
|
|
303
434
|
|
|
304
435
|
var menuY: CGFloat
|
|
@@ -333,6 +464,7 @@ public final class PCSelectionMenuView: UIControl {
|
|
|
333
464
|
|
|
334
465
|
self.headlessMenuVC = menuVC
|
|
335
466
|
vc.present(menuVC, animated: true)
|
|
467
|
+
self.haptics.prepare(in: self)
|
|
336
468
|
}
|
|
337
469
|
}
|
|
338
470
|
|
|
@@ -390,6 +522,11 @@ private class PCGlassMenuCell: UITableViewCell {
|
|
|
390
522
|
/// caused rows to overlap at large Dynamic Type sizes.
|
|
391
523
|
let menuLabel = UILabel()
|
|
392
524
|
|
|
525
|
+
/// Leading checkmark on the selected row, as in a system single-selection menu.
|
|
526
|
+
private let checkmarkView = UIImageView()
|
|
527
|
+
private var labelLeadingToContent: NSLayoutConstraint!
|
|
528
|
+
private var labelLeadingToCheckmark: NSLayoutConstraint!
|
|
529
|
+
|
|
393
530
|
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
|
394
531
|
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
|
395
532
|
setupCell()
|
|
@@ -411,8 +548,23 @@ private class PCGlassMenuCell: UITableViewCell {
|
|
|
411
548
|
menuLabel.translatesAutoresizingMaskIntoConstraints = false
|
|
412
549
|
contentView.addSubview(menuLabel)
|
|
413
550
|
|
|
551
|
+
checkmarkView.image = UIImage(
|
|
552
|
+
systemName: "checkmark",
|
|
553
|
+
withConfiguration: PCConstants.popoverCheckmarkConfiguration
|
|
554
|
+
)
|
|
555
|
+
checkmarkView.tintColor = .label
|
|
556
|
+
checkmarkView.contentMode = .center
|
|
557
|
+
checkmarkView.translatesAutoresizingMaskIntoConstraints = false
|
|
558
|
+
checkmarkView.setContentHuggingPriority(.required, for: .horizontal)
|
|
559
|
+
checkmarkView.setContentCompressionResistancePriority(.required, for: .horizontal)
|
|
560
|
+
contentView.addSubview(checkmarkView)
|
|
561
|
+
|
|
414
562
|
let v = PCConstants.popoverRowVerticalPadding / 2
|
|
415
563
|
let h = PCConstants.popoverRowHorizontalInset
|
|
564
|
+
labelLeadingToContent = menuLabel.leadingAnchor.constraint(
|
|
565
|
+
equalTo: contentView.leadingAnchor, constant: h)
|
|
566
|
+
labelLeadingToCheckmark = menuLabel.leadingAnchor.constraint(
|
|
567
|
+
equalTo: checkmarkView.trailingAnchor, constant: PCConstants.popoverCheckmarkSpacing)
|
|
416
568
|
// Center the label and let it grow the row vertically. The min-height
|
|
417
569
|
// constraint guarantees the 44pt touch target for short labels, while
|
|
418
570
|
// the >= top / <= bottom pair lets tall (wrapped) labels expand the row.
|
|
@@ -420,17 +572,33 @@ private class PCGlassMenuCell: UITableViewCell {
|
|
|
420
572
|
menuLabel.topAnchor.constraint(greaterThanOrEqualTo: contentView.topAnchor, constant: v),
|
|
421
573
|
menuLabel.bottomAnchor.constraint(lessThanOrEqualTo: contentView.bottomAnchor, constant: -v),
|
|
422
574
|
menuLabel.centerYAnchor.constraint(equalTo: contentView.centerYAnchor),
|
|
423
|
-
|
|
575
|
+
labelLeadingToContent,
|
|
576
|
+
checkmarkView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: h),
|
|
577
|
+
checkmarkView.firstBaselineAnchor.constraint(equalTo: menuLabel.firstBaselineAnchor),
|
|
424
578
|
menuLabel.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -h),
|
|
425
579
|
contentView.heightAnchor.constraint(greaterThanOrEqualToConstant: PCConstants.popoverRowHeightMin),
|
|
426
580
|
])
|
|
427
581
|
}
|
|
582
|
+
|
|
583
|
+
/// `reservesCheckmark` indents every row when the menu has a selection, so labels
|
|
584
|
+
/// stay aligned; only the selected row shows the checkmark.
|
|
585
|
+
func configure(label: String, selected: Bool, disabled: Bool, reservesCheckmark: Bool) {
|
|
586
|
+
menuLabel.text = label
|
|
587
|
+
checkmarkView.isHidden = !selected
|
|
588
|
+
labelLeadingToContent.isActive = !reservesCheckmark
|
|
589
|
+
labelLeadingToCheckmark.isActive = reservesCheckmark
|
|
590
|
+
accessibilityTraits = selected ? [.button, .selected] : [.button]
|
|
591
|
+
if disabled { accessibilityTraits.insert(.notEnabled) }
|
|
592
|
+
isUserInteractionEnabled = !disabled
|
|
593
|
+
contentView.alpha = disabled ? 0.5 : 1
|
|
594
|
+
}
|
|
428
595
|
}
|
|
429
596
|
|
|
430
597
|
// MARK: - Custom Menu View Controller (matches SwiftUI Menu appearance)
|
|
431
598
|
|
|
432
599
|
private class PCMenuViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
|
|
433
600
|
private let options: [PCSelectionMenuOption]
|
|
601
|
+
private let selectedIndex: Int?
|
|
434
602
|
private let onSelect: (Int) -> Void
|
|
435
603
|
private let onCancel: () -> Void
|
|
436
604
|
private let onDismiss: () -> Void
|
|
@@ -441,11 +609,13 @@ private class PCMenuViewController: UIViewController, UITableViewDelegate, UITab
|
|
|
441
609
|
|
|
442
610
|
init(
|
|
443
611
|
options: [PCSelectionMenuOption],
|
|
612
|
+
selectedIndex: Int?,
|
|
444
613
|
onSelect: @escaping (Int) -> Void,
|
|
445
614
|
onCancel: @escaping () -> Void,
|
|
446
615
|
onDismiss: @escaping () -> Void
|
|
447
616
|
) {
|
|
448
617
|
self.options = options
|
|
618
|
+
self.selectedIndex = selectedIndex
|
|
449
619
|
self.onSelect = onSelect
|
|
450
620
|
self.onCancel = onCancel
|
|
451
621
|
self.onDismiss = onDismiss
|
|
@@ -533,11 +703,17 @@ private class PCMenuViewController: UIViewController, UITableViewDelegate, UITab
|
|
|
533
703
|
|
|
534
704
|
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
|
535
705
|
let cell = tableView.dequeueReusableCell(withIdentifier: PCGlassMenuCell.reuseIdentifier, for: indexPath)
|
|
536
|
-
(cell as? PCGlassMenuCell)?.
|
|
706
|
+
(cell as? PCGlassMenuCell)?.configure(
|
|
707
|
+
label: options[indexPath.row].label,
|
|
708
|
+
selected: indexPath.row == selectedIndex,
|
|
709
|
+
disabled: options[indexPath.row].disabled,
|
|
710
|
+
reservesCheckmark: selectedIndex != nil
|
|
711
|
+
)
|
|
537
712
|
return cell
|
|
538
713
|
}
|
|
539
714
|
|
|
540
715
|
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
|
716
|
+
guard !options[indexPath.row].disabled else { return }
|
|
541
717
|
tableView.deselectRow(at: indexPath, animated: true)
|
|
542
718
|
dismiss(animated: true) { [weak self] in
|
|
543
719
|
self?.onSelect(indexPath.row)
|