react-native-platform-components 0.8.10 → 1.0.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/README.md +68 -891
- package/android/src/main/java/com/platformcomponents/PCDatePickerView.kt +17 -3
- package/android/src/main/java/com/platformcomponents/PCImageLoader.kt +88 -0
- package/android/src/main/java/com/platformcomponents/PCSegmentedControlView.kt +292 -31
- package/android/src/main/java/com/platformcomponents/PCSegmentedControlViewManager.kt +74 -8
- package/android/src/main/java/com/platformcomponents/PCSelectionMenuView.kt +2 -1
- package/android/src/main/java/com/platformcomponents/PCThemeSupport.kt +94 -0
- package/android/src/main/res/values/styles.xml +40 -0
- package/ios/PCImageLoader.swift +58 -0
- package/ios/PCSegmentedControl.mm +85 -25
- package/ios/PCSegmentedControl.swift +231 -308
- package/lib/commonjs/DatePickerNativeComponent.ts +4 -2
- package/lib/commonjs/SegmentedControl.js +138 -6
- package/lib/commonjs/SegmentedControl.js.map +1 -1
- package/lib/commonjs/SegmentedControlNativeComponent.ts +62 -8
- package/lib/commonjs/SelectionMenuNativeComponent.ts +4 -2
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/module/DatePickerNativeComponent.ts +4 -2
- package/lib/module/SegmentedControl.js +138 -7
- package/lib/module/SegmentedControl.js.map +1 -1
- package/lib/module/SegmentedControlNativeComponent.ts +62 -8
- package/lib/module/SelectionMenuNativeComponent.ts +4 -2
- package/lib/module/index.web.js.map +1 -1
- package/lib/typescript/commonjs/docs/docusaurus.config.d.ts +4 -0
- package/lib/typescript/commonjs/docs/docusaurus.config.d.ts.map +1 -0
- package/lib/typescript/commonjs/docs/sidebars.d.ts +4 -0
- package/lib/typescript/commonjs/docs/sidebars.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/DatePickerNativeComponent.d.ts +2 -2
- package/lib/typescript/commonjs/src/DatePickerNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/SegmentedControl.d.ts +111 -6
- package/lib/typescript/commonjs/src/SegmentedControl.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/SegmentedControlNativeComponent.d.ts +46 -7
- package/lib/typescript/commonjs/src/SegmentedControlNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/SelectionMenuNativeComponent.d.ts +2 -2
- package/lib/typescript/commonjs/src/SelectionMenuNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.web.d.ts +36 -1
- package/lib/typescript/commonjs/src/index.web.d.ts.map +1 -1
- package/lib/typescript/module/docs/docusaurus.config.d.ts +4 -0
- package/lib/typescript/module/docs/docusaurus.config.d.ts.map +1 -0
- package/lib/typescript/module/docs/sidebars.d.ts +4 -0
- package/lib/typescript/module/docs/sidebars.d.ts.map +1 -0
- package/lib/typescript/module/src/DatePicker.d.ts +1 -1
- package/lib/typescript/module/src/DatePicker.d.ts.map +1 -1
- package/lib/typescript/module/src/DatePickerNativeComponent.d.ts +2 -2
- package/lib/typescript/module/src/DatePickerNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/SegmentedControl.d.ts +111 -6
- package/lib/typescript/module/src/SegmentedControl.d.ts.map +1 -1
- package/lib/typescript/module/src/SegmentedControlNativeComponent.d.ts +46 -7
- package/lib/typescript/module/src/SegmentedControlNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/SelectionMenu.d.ts +1 -1
- package/lib/typescript/module/src/SelectionMenu.d.ts.map +1 -1
- package/lib/typescript/module/src/SelectionMenuNativeComponent.d.ts +2 -2
- package/lib/typescript/module/src/SelectionMenuNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +6 -6
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/index.web.d.ts +36 -1
- package/lib/typescript/module/src/index.web.d.ts.map +1 -1
- package/package.json +62 -37
- package/plugin/build/index.cjs +58 -17
- package/plugin/build/index.d.ts +32 -15
- package/plugin/build/index.d.ts.map +1 -1
- package/plugin/tsconfig.json +9 -4
- package/src/DatePickerNativeComponent.ts +4 -2
- package/src/SegmentedControl.tsx +238 -11
- package/src/SegmentedControlNativeComponent.ts +62 -8
- package/src/SelectionMenuNativeComponent.ts +4 -2
- package/src/index.web.tsx +34 -1
package/src/index.web.tsx
CHANGED
|
@@ -111,18 +111,51 @@ export const ContextMenu = ({
|
|
|
111
111
|
// SegmentedControl
|
|
112
112
|
// ============================================================================
|
|
113
113
|
|
|
114
|
+
export type SegmentedControlIconSource =
|
|
115
|
+
| string
|
|
116
|
+
| { type: 'sfSymbol'; name: string }
|
|
117
|
+
| { type: 'drawable'; name: string }
|
|
118
|
+
| { type: 'image'; source: unknown; tinted?: boolean };
|
|
119
|
+
|
|
120
|
+
export type SegmentedControlIcon =
|
|
121
|
+
| SegmentedControlIconSource
|
|
122
|
+
| { ios?: SegmentedControlIconSource; android?: SegmentedControlIconSource };
|
|
123
|
+
|
|
124
|
+
export type SegmentedControlLabelVisibility = 'auto' | 'labeled' | 'unlabeled';
|
|
125
|
+
|
|
114
126
|
export interface SegmentedControlSegmentProps {
|
|
115
127
|
label: string;
|
|
116
128
|
value: string;
|
|
117
129
|
disabled?: boolean;
|
|
118
|
-
icon?:
|
|
130
|
+
icon?: SegmentedControlIcon;
|
|
131
|
+
badge?: string | number;
|
|
132
|
+
accessibilityLabel?: string;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface SegmentedControlBadgeStyle {
|
|
136
|
+
backgroundColor?: string;
|
|
137
|
+
color?: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface SegmentedControlLabelStyle {
|
|
141
|
+
fontFamily?: string;
|
|
142
|
+
fontSize?: number;
|
|
143
|
+
fontWeight?: string | number;
|
|
144
|
+
fontStyle?: 'normal' | 'italic';
|
|
119
145
|
}
|
|
120
146
|
|
|
121
147
|
export interface SegmentedControlProps extends ViewProps {
|
|
122
148
|
segments: readonly SegmentedControlSegmentProps[];
|
|
123
149
|
selectedValue: string | null;
|
|
124
150
|
disabled?: boolean;
|
|
151
|
+
labelVisibility?: SegmentedControlLabelVisibility;
|
|
152
|
+
selectedSegmentColor?: string;
|
|
153
|
+
activeTintColor?: string;
|
|
154
|
+
inactiveTintColor?: string;
|
|
155
|
+
labelStyle?: SegmentedControlLabelStyle;
|
|
156
|
+
badgeStyle?: SegmentedControlBadgeStyle;
|
|
125
157
|
onSelect?: (value: string, index: number) => void;
|
|
158
|
+
onDeselect?: () => void;
|
|
126
159
|
ios?: Record<string, unknown>;
|
|
127
160
|
android?: Record<string, unknown>;
|
|
128
161
|
}
|