@expo/ui 58.0.14 → 58.0.15
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/CHANGELOG.md +10 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/DatePickerView.kt +35 -2
- package/android/src/main/java/expo/modules/ui/DateRangePickerView.kt +35 -2
- package/android/src/main/java/expo/modules/ui/HostView.kt +21 -0
- package/android/src/main/java/expo/modules/ui/RNHostView.kt +22 -1
- package/build/State/useWorkletCallback.d.ts +1 -1
- package/build/community/datetime-picker/DateTimePicker.android.js +4 -0
- package/build/community/datetime-picker/DateTimePicker.android.js.map +1 -1
- package/build/jetpack-compose/DatePicker/index.d.ts +38 -0
- package/build/jetpack-compose/DatePicker/index.js.map +1 -1
- package/build/swift-ui/Toolbar/index.d.ts +2 -0
- package/build/swift-ui/Toolbar/index.js +2 -0
- package/build/swift-ui/Toolbar/index.js.map +1 -1
- package/build/swift-ui/modifiers/hingeObservation.d.ts +1 -1
- package/build/swift-ui/modifiers/hingeObservation.js +1 -1
- package/build/swift-ui/modifiers/index.d.ts +1 -0
- package/build/swift-ui/modifiers/index.js +1 -0
- package/build/swift-ui/modifiers/index.js.map +1 -1
- package/build/swift-ui/modifiers/searchable.d.ts +83 -0
- package/build/swift-ui/modifiers/searchable.js +74 -0
- package/build/swift-ui/modifiers/searchable.js.map +1 -0
- package/ios/ChartView.swift +8 -6
- package/ios/Modifiers/SearchToolbarBehaviorModifier.swift +35 -0
- package/ios/Modifiers/SearchableModifier.swift +94 -0
- package/ios/Modifiers/ViewModifierRegistry.swift +8 -0
- package/ios/Picker/PickerView.swift +9 -7
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.14/expo.modules.ui-58.0.14-sources.jar → 58.0.15/expo.modules.ui-58.0.15-sources.jar} +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.14/expo.modules.ui-58.0.14.module → 58.0.15/expo.modules.ui-58.0.15.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.14/expo.modules.ui-58.0.14.pom → 58.0.15/expo.modules.ui-58.0.15.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.pom.sha512 +1 -0
- package/package.json +2 -2
- package/prebuilds/output/debug/xcframeworks/ExpoUI.tar.gz +0 -0
- package/prebuilds/output/release/xcframeworks/ExpoUI.tar.gz +0 -0
- package/src/State/useWorkletCallback.ts +1 -1
- package/src/community/datetime-picker/DateTimePicker.android.tsx +4 -0
- package/src/jetpack-compose/DatePicker/index.tsx +38 -0
- package/src/swift-ui/Toolbar/index.tsx +2 -0
- package/src/swift-ui/modifiers/hingeObservation.ts +1 -1
- package/src/swift-ui/modifiers/index.ts +1 -0
- package/src/swift-ui/modifiers/searchable.ts +107 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.pom.sha512 +0 -1
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { type ObservableState } from '../../State';
|
|
2
|
+
/**
|
|
3
|
+
* The placement of a search field in a view hierarchy.
|
|
4
|
+
*
|
|
5
|
+
* - `automatic`: SwiftUI places the search field automatically.
|
|
6
|
+
* - `toolbar`: The search field appears in the toolbar. Falls back to `automatic` on tvOS.
|
|
7
|
+
* - `sidebar`: The search field appears in the sidebar of a navigation view. Falls back to
|
|
8
|
+
* `automatic` on tvOS.
|
|
9
|
+
* - `navigationBarDrawer`: The search field appears in the navigation bar. Falls back to
|
|
10
|
+
* `automatic` on macOS and tvOS.
|
|
11
|
+
*/
|
|
12
|
+
export type SearchFieldPlacement = 'automatic' | 'toolbar' | 'sidebar' | 'navigationBarDrawer';
|
|
13
|
+
/**
|
|
14
|
+
* Marks this view as searchable, which configures the display of a search field.
|
|
15
|
+
*
|
|
16
|
+
* @param text - The text to display and edit in the search field. An `ObservableState<string>`
|
|
17
|
+
* created with `useNativeState`.
|
|
18
|
+
* @param options.placement - The preferred placement of the search field within the containing
|
|
19
|
+
* view hierarchy. Defaults to `automatic`.
|
|
20
|
+
* @param options.prompt - The prompt of the search field, which provides users with guidance on
|
|
21
|
+
* what to search for.
|
|
22
|
+
* @param options.onChange - Fires on the JS thread when the user edits or clears the search field.
|
|
23
|
+
* It does not fire for values written from JavaScript.
|
|
24
|
+
*
|
|
25
|
+
* @platform ios
|
|
26
|
+
* @platform tvos
|
|
27
|
+
* @platform macos
|
|
28
|
+
*
|
|
29
|
+
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/searchable(text:placement:prompt:)-18a8f).
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* const query = useNativeState('');
|
|
34
|
+
*
|
|
35
|
+
* <Host>
|
|
36
|
+
* <NavigationStack>
|
|
37
|
+
* <List
|
|
38
|
+
* modifiers={[
|
|
39
|
+
* searchable(query, {
|
|
40
|
+
* prompt: 'Search agents',
|
|
41
|
+
* onChange: (text) => setFilter(text),
|
|
42
|
+
* }),
|
|
43
|
+
* ]}>
|
|
44
|
+
* {rows.map((row) => (
|
|
45
|
+
* <Text key={row.id}>{row.name}</Text>
|
|
46
|
+
* ))}
|
|
47
|
+
* </List>
|
|
48
|
+
* </NavigationStack>
|
|
49
|
+
* </Host>
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare const searchable: (text: ObservableState<string>, options?: {
|
|
53
|
+
placement?: SearchFieldPlacement;
|
|
54
|
+
prompt?: string;
|
|
55
|
+
onChange?: (text: string) => void;
|
|
56
|
+
}) => import("./createModifier").ModifierConfig;
|
|
57
|
+
/**
|
|
58
|
+
* The behavior of a search field in a toolbar.
|
|
59
|
+
*
|
|
60
|
+
* - `automatic`: The automatic behavior.
|
|
61
|
+
* - `minimize`: A search toolbar behavior that prefers rendering a search field as a button-like
|
|
62
|
+
* control. Falls back to `automatic` on macOS and tvOS.
|
|
63
|
+
*/
|
|
64
|
+
export type SearchToolbarBehavior = 'automatic' | 'minimize';
|
|
65
|
+
/**
|
|
66
|
+
* Configures the behavior for search in the toolbar.
|
|
67
|
+
*
|
|
68
|
+
* On iOS below 26.0, the modifier is a no-op.
|
|
69
|
+
*
|
|
70
|
+
* @param behavior - The search field behavior.
|
|
71
|
+
*
|
|
72
|
+
* @platform ios 26.0+
|
|
73
|
+
* @platform tvos 26.0+
|
|
74
|
+
* @platform macos 26.0+
|
|
75
|
+
*
|
|
76
|
+
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/searchtoolbarbehavior(_:)).
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```tsx
|
|
80
|
+
* <List modifiers={[searchable(query), searchToolbarBehavior('minimize')]}>
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
export declare const searchToolbarBehavior: (behavior: SearchToolbarBehavior) => import("./createModifier").ModifierConfig;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { getStateId } from '../../State';
|
|
2
|
+
import { createModifier, createModifierWithEventListener } from './createModifier';
|
|
3
|
+
/**
|
|
4
|
+
* Marks this view as searchable, which configures the display of a search field.
|
|
5
|
+
*
|
|
6
|
+
* @param text - The text to display and edit in the search field. An `ObservableState<string>`
|
|
7
|
+
* created with `useNativeState`.
|
|
8
|
+
* @param options.placement - The preferred placement of the search field within the containing
|
|
9
|
+
* view hierarchy. Defaults to `automatic`.
|
|
10
|
+
* @param options.prompt - The prompt of the search field, which provides users with guidance on
|
|
11
|
+
* what to search for.
|
|
12
|
+
* @param options.onChange - Fires on the JS thread when the user edits or clears the search field.
|
|
13
|
+
* It does not fire for values written from JavaScript.
|
|
14
|
+
*
|
|
15
|
+
* @platform ios
|
|
16
|
+
* @platform tvos
|
|
17
|
+
* @platform macos
|
|
18
|
+
*
|
|
19
|
+
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/searchable(text:placement:prompt:)-18a8f).
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* const query = useNativeState('');
|
|
24
|
+
*
|
|
25
|
+
* <Host>
|
|
26
|
+
* <NavigationStack>
|
|
27
|
+
* <List
|
|
28
|
+
* modifiers={[
|
|
29
|
+
* searchable(query, {
|
|
30
|
+
* prompt: 'Search agents',
|
|
31
|
+
* onChange: (text) => setFilter(text),
|
|
32
|
+
* }),
|
|
33
|
+
* ]}>
|
|
34
|
+
* {rows.map((row) => (
|
|
35
|
+
* <Text key={row.id}>{row.name}</Text>
|
|
36
|
+
* ))}
|
|
37
|
+
* </List>
|
|
38
|
+
* </NavigationStack>
|
|
39
|
+
* </Host>
|
|
40
|
+
* ```
|
|
41
|
+
*/ export const searchable = (text, options)=>{
|
|
42
|
+
const params = {
|
|
43
|
+
text: getStateId(text),
|
|
44
|
+
placement: options?.placement,
|
|
45
|
+
prompt: options?.prompt
|
|
46
|
+
};
|
|
47
|
+
const onChange = options?.onChange;
|
|
48
|
+
if (onChange) {
|
|
49
|
+
return createModifierWithEventListener('searchable', (event)=>onChange(event?.text ?? ''), params);
|
|
50
|
+
}
|
|
51
|
+
return createModifier('searchable', params);
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Configures the behavior for search in the toolbar.
|
|
55
|
+
*
|
|
56
|
+
* On iOS below 26.0, the modifier is a no-op.
|
|
57
|
+
*
|
|
58
|
+
* @param behavior - The search field behavior.
|
|
59
|
+
*
|
|
60
|
+
* @platform ios 26.0+
|
|
61
|
+
* @platform tvos 26.0+
|
|
62
|
+
* @platform macos 26.0+
|
|
63
|
+
*
|
|
64
|
+
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/searchtoolbarbehavior(_:)).
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```tsx
|
|
68
|
+
* <List modifiers={[searchable(query), searchToolbarBehavior('minimize')]}>
|
|
69
|
+
* ```
|
|
70
|
+
*/ export const searchToolbarBehavior = (behavior)=>createModifier('searchToolbarBehavior', {
|
|
71
|
+
behavior
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=searchable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["swift-ui/modifiers/searchable.ts"],"sourcesContent":[null],"names":["getStateId","createModifier","createModifierWithEventListener","searchable","text","options","params","placement","prompt","onChange","event","searchToolbarBehavior","behavior"],"mappings":"AAAA,SAASA,UAAU,QAA8B,cAAc;AAC/D,SAASC,cAAc,EAAEC,+BAA+B,QAAQ,mBAAmB;AAcnF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCC,GACD,OAAO,MAAMC,aAAa,CACxBC,MACAC;IAMA,MAAMC,SAAS;QACbF,MAAMJ,WAAWI;QACjBG,WAAWF,SAASE;QACpBC,QAAQH,SAASG;IACnB;IACA,MAAMC,WAAWJ,SAASI;IAC1B,IAAIA,UAAU;QACZ,OAAOP,gCACL,cACA,CAACQ,QAA6BD,SAASC,OAAON,QAAQ,KACtDE;IAEJ;IACA,OAAOL,eAAe,cAAcK;AACtC,EAAE;AAWF;;;;;;;;;;;;;;;;;CAiBC,GACD,OAAO,MAAMK,wBAAwB,CAACC,WACpCX,eAAe,yBAAyB;QAAEW;IAAS,GAAG"}
|
package/ios/ChartView.swift
CHANGED
|
@@ -137,15 +137,13 @@ public struct ChartView: ExpoSwiftUI.View {
|
|
|
137
137
|
.foregroundStyle(props.lineStyle?.color ?? .blue)
|
|
138
138
|
.symbol(getSymbol(props.lineStyle?.pointStyle ?? .circle))
|
|
139
139
|
.symbolSize(CGFloat(props.lineStyle?.pointSize ?? 6.0))
|
|
140
|
-
.lineStyle(getLineStyle(props.lineStyle
|
|
141
|
-
.lineStyle(.init(lineWidth: CGFloat(props.lineStyle?.width ?? 2.0)))
|
|
140
|
+
.lineStyle(getLineStyle(props.lineStyle))
|
|
142
141
|
} else {
|
|
143
142
|
LineMark(x: .value("X", dataPoint.xValue), y: .value("Y", dataPoint.y))
|
|
144
143
|
.foregroundStyle(props.lineStyle?.color ?? .blue)
|
|
145
144
|
.symbol(getSymbol(props.lineStyle?.pointStyle ?? .circle))
|
|
146
145
|
.symbolSize(CGFloat(props.lineStyle?.pointSize ?? 6.0))
|
|
147
|
-
.lineStyle(getLineStyle(props.lineStyle
|
|
148
|
-
.lineStyle(.init(lineWidth: CGFloat(props.lineStyle?.width ?? 2.0)))
|
|
146
|
+
.lineStyle(getLineStyle(props.lineStyle))
|
|
149
147
|
}
|
|
150
148
|
}
|
|
151
149
|
|
|
@@ -254,7 +252,11 @@ public struct ChartView: ExpoSwiftUI.View {
|
|
|
254
252
|
}
|
|
255
253
|
}
|
|
256
254
|
|
|
257
|
-
|
|
258
|
-
|
|
255
|
+
// A single stroke style: chained `.lineStyle` modifiers don't merge, the first one wins.
|
|
256
|
+
private func getLineStyle(_ style: LineChartStyle?) -> StrokeStyle {
|
|
257
|
+
StrokeStyle(
|
|
258
|
+
lineWidth: CGFloat(style?.width ?? 2.0),
|
|
259
|
+
dash: (style?.dashArray ?? []).map { CGFloat($0) }
|
|
260
|
+
)
|
|
259
261
|
}
|
|
260
262
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Copyright 2026-present 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
import ExpoModulesCore
|
|
4
|
+
import SwiftUI
|
|
5
|
+
|
|
6
|
+
internal enum SearchToolbarBehaviorType: String, Enumerable {
|
|
7
|
+
case automatic
|
|
8
|
+
case minimize
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
internal struct SearchToolbarBehaviorModifier: ViewModifier, Record {
|
|
12
|
+
@Field var behavior: SearchToolbarBehaviorType = .automatic
|
|
13
|
+
|
|
14
|
+
@ViewBuilder
|
|
15
|
+
func body(content: Content) -> some View {
|
|
16
|
+
if #available(iOS 26.0, macOS 26.0, tvOS 26.0, *) {
|
|
17
|
+
#if compiler(>=6.2) // Xcode 26
|
|
18
|
+
switch behavior {
|
|
19
|
+
case .automatic:
|
|
20
|
+
content.searchToolbarBehavior(.automatic)
|
|
21
|
+
case .minimize:
|
|
22
|
+
#if os(macOS) || os(tvOS)
|
|
23
|
+
content.searchToolbarBehavior(.automatic)
|
|
24
|
+
#else
|
|
25
|
+
content.searchToolbarBehavior(.minimize)
|
|
26
|
+
#endif
|
|
27
|
+
}
|
|
28
|
+
#else
|
|
29
|
+
content
|
|
30
|
+
#endif
|
|
31
|
+
} else {
|
|
32
|
+
content
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// Copyright 2026-present 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
import ExpoModulesCore
|
|
4
|
+
import SwiftUI
|
|
5
|
+
|
|
6
|
+
internal enum SearchFieldPlacementType: String, Enumerable {
|
|
7
|
+
case automatic
|
|
8
|
+
case toolbar
|
|
9
|
+
case sidebar
|
|
10
|
+
case navigationBarDrawer
|
|
11
|
+
|
|
12
|
+
var toSearchFieldPlacement: SearchFieldPlacement {
|
|
13
|
+
switch self {
|
|
14
|
+
case .automatic:
|
|
15
|
+
return .automatic
|
|
16
|
+
case .toolbar:
|
|
17
|
+
#if os(tvOS)
|
|
18
|
+
return .automatic
|
|
19
|
+
#else
|
|
20
|
+
return .toolbar
|
|
21
|
+
#endif
|
|
22
|
+
case .sidebar:
|
|
23
|
+
#if os(tvOS)
|
|
24
|
+
return .automatic
|
|
25
|
+
#else
|
|
26
|
+
return .sidebar
|
|
27
|
+
#endif
|
|
28
|
+
case .navigationBarDrawer:
|
|
29
|
+
#if os(iOS)
|
|
30
|
+
return .navigationBarDrawer
|
|
31
|
+
#else
|
|
32
|
+
return .automatic
|
|
33
|
+
#endif
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
internal struct SearchableModifier: ViewModifier, Record {
|
|
39
|
+
@Field var text: ObservableState?
|
|
40
|
+
@Field var placement: SearchFieldPlacementType = .automatic
|
|
41
|
+
@Field var prompt: String?
|
|
42
|
+
var eventDispatcher: EventDispatcher?
|
|
43
|
+
|
|
44
|
+
init() {}
|
|
45
|
+
|
|
46
|
+
init(from params: Dict, appContext: AppContext, eventDispatcher: EventDispatcher) throws {
|
|
47
|
+
try self = .init(from: params, appContext: appContext)
|
|
48
|
+
self.eventDispatcher = eventDispatcher
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@ViewBuilder
|
|
52
|
+
func body(content: Content) -> some View {
|
|
53
|
+
if let text {
|
|
54
|
+
SearchableWrapper(
|
|
55
|
+
state: text,
|
|
56
|
+
placement: placement,
|
|
57
|
+
prompt: prompt,
|
|
58
|
+
eventDispatcher: eventDispatcher
|
|
59
|
+
) {
|
|
60
|
+
content
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
content
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
private struct SearchableWrapper<C: View>: View {
|
|
69
|
+
@ObservedObject var state: ObservableState
|
|
70
|
+
let placement: SearchFieldPlacementType
|
|
71
|
+
let prompt: String?
|
|
72
|
+
let eventDispatcher: EventDispatcher?
|
|
73
|
+
@ViewBuilder let content: () -> C
|
|
74
|
+
|
|
75
|
+
var body: some View {
|
|
76
|
+
// The search field writes through the binding. Only report edits that come from the field,
|
|
77
|
+
// so a value written from JavaScript does not bounce back as an event.
|
|
78
|
+
let query = Binding<String>(
|
|
79
|
+
get: { state.value as? String ?? "" },
|
|
80
|
+
set: { newValue in
|
|
81
|
+
guard newValue != state.value as? String else {
|
|
82
|
+
return
|
|
83
|
+
}
|
|
84
|
+
state.value = newValue
|
|
85
|
+
eventDispatcher?(["searchable": ["text": newValue]])
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
if let prompt {
|
|
89
|
+
content().searchable(text: query, placement: placement.toSearchFieldPlacement, prompt: prompt)
|
|
90
|
+
} else {
|
|
91
|
+
content().searchable(text: query, placement: placement.toSearchFieldPlacement)
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -2380,6 +2380,14 @@ extension ViewModifierRegistry {
|
|
|
2380
2380
|
return try ScrollPositionModifier(from: params, appContext: appContext, eventDispatcher: eventDispatcher)
|
|
2381
2381
|
}
|
|
2382
2382
|
|
|
2383
|
+
register("searchable") { params, appContext, eventDispatcher in
|
|
2384
|
+
return try SearchableModifier(from: params, appContext: appContext, eventDispatcher: eventDispatcher)
|
|
2385
|
+
}
|
|
2386
|
+
|
|
2387
|
+
register("searchToolbarBehavior") { params, appContext, _ in
|
|
2388
|
+
return try SearchToolbarBehaviorModifier(from: params, appContext: appContext)
|
|
2389
|
+
}
|
|
2390
|
+
|
|
2383
2391
|
register("pickerStyle") { params, appContext, _ in
|
|
2384
2392
|
return try PickerStyleModifier(from: params, appContext: appContext)
|
|
2385
2393
|
}
|
|
@@ -12,6 +12,7 @@ internal final class PickerProps: UIBaseViewProps {
|
|
|
12
12
|
|
|
13
13
|
internal struct PickerView: ExpoSwiftUI.View {
|
|
14
14
|
@State var selection: AnyHashable?
|
|
15
|
+
@State private var previousSelection: AnyHashable?
|
|
15
16
|
@ObservedObject var props: PickerProps
|
|
16
17
|
|
|
17
18
|
init(props: PickerProps) {
|
|
@@ -38,11 +39,8 @@ internal struct PickerView: ExpoSwiftUI.View {
|
|
|
38
39
|
|
|
39
40
|
picker
|
|
40
41
|
.onChange(of: selection) { newValue in
|
|
41
|
-
guard let newValue else { return }
|
|
42
|
-
|
|
43
|
-
if currentSelection == newValue {
|
|
44
|
-
return
|
|
45
|
-
}
|
|
42
|
+
guard let newValue, newValue != previousSelection else { return }
|
|
43
|
+
previousSelection = newValue
|
|
46
44
|
let payload: [String: Any]
|
|
47
45
|
if let stringValue = newValue as? String {
|
|
48
46
|
payload = ["selection": stringValue]
|
|
@@ -54,10 +52,14 @@ internal struct PickerView: ExpoSwiftUI.View {
|
|
|
54
52
|
props.onSelectionChange(payload)
|
|
55
53
|
}
|
|
56
54
|
.onChange(of: props.selection) { newValue in
|
|
57
|
-
|
|
55
|
+
let newSelection = Self.getHashableFromEither(newValue)
|
|
56
|
+
previousSelection = newSelection
|
|
57
|
+
selection = newSelection
|
|
58
58
|
}
|
|
59
59
|
.onAppear {
|
|
60
|
-
|
|
60
|
+
let initialSelection = Self.getHashableFromEither(props.selection)
|
|
61
|
+
previousSelection = initialSelection
|
|
62
|
+
selection = initialSelection
|
|
61
63
|
}
|
|
62
64
|
}
|
|
63
65
|
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2ea3d659cdac9ba8f6d43d9679a48905
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
584c7a2ab4d40b05b4658c93c1a689ce0587dc06
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
651218fb79e50f51035a06d7e88ef8cd9cd391f8b66edcf46abdc431f0a41cfc
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5569d8f73d7b0d41af8d77ca8cb4e8685384113a45e151b9c6cdad1b660844183067026b2fc16c150ac409a0a097fb4ac78c4f5c31afe56862f306f8daf7c538
|
|
Binary file
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.aar.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
620eb66ce22bd9cd4c1e0a0c6c0812f1
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.aar.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
019221c48e7c0648984cb5603c4927d391a241cd
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.aar.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
85ad13c4695409acef3dad5a8fd8cb6cbd472bcf2ac7d6514b3f0e9fd3b3d590
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.aar.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a96d874afa65f7edf884a6b9ea0d01b7d2eb2f1aeb86db4afaaeefa6073f153f29cafe8a1ce8ae9c8c6069cfe8534197add3dba900e350e381598cf3e76e8c79
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "expo.modules.ui",
|
|
5
5
|
"module": "expo.modules.ui",
|
|
6
|
-
"version": "58.0.
|
|
6
|
+
"version": "58.0.15",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
{
|
|
27
|
-
"name": "expo.modules.ui-58.0.
|
|
28
|
-
"url": "expo.modules.ui-58.0.
|
|
29
|
-
"size":
|
|
30
|
-
"sha512": "
|
|
31
|
-
"sha256": "
|
|
32
|
-
"sha1": "
|
|
33
|
-
"md5": "
|
|
27
|
+
"name": "expo.modules.ui-58.0.15.aar",
|
|
28
|
+
"url": "expo.modules.ui-58.0.15.aar",
|
|
29
|
+
"size": 1847287,
|
|
30
|
+
"sha512": "a96d874afa65f7edf884a6b9ea0d01b7d2eb2f1aeb86db4afaaeefa6073f153f29cafe8a1ce8ae9c8c6069cfe8534197add3dba900e350e381598cf3e76e8c79",
|
|
31
|
+
"sha256": "85ad13c4695409acef3dad5a8fd8cb6cbd472bcf2ac7d6514b3f0e9fd3b3d590",
|
|
32
|
+
"sha1": "019221c48e7c0648984cb5603c4927d391a241cd",
|
|
33
|
+
"md5": "620eb66ce22bd9cd4c1e0a0c6c0812f1"
|
|
34
34
|
}
|
|
35
35
|
]
|
|
36
36
|
},
|
|
@@ -141,13 +141,13 @@
|
|
|
141
141
|
],
|
|
142
142
|
"files": [
|
|
143
143
|
{
|
|
144
|
-
"name": "expo.modules.ui-58.0.
|
|
145
|
-
"url": "expo.modules.ui-58.0.
|
|
146
|
-
"size":
|
|
147
|
-
"sha512": "
|
|
148
|
-
"sha256": "
|
|
149
|
-
"sha1": "
|
|
150
|
-
"md5": "
|
|
144
|
+
"name": "expo.modules.ui-58.0.15.aar",
|
|
145
|
+
"url": "expo.modules.ui-58.0.15.aar",
|
|
146
|
+
"size": 1847287,
|
|
147
|
+
"sha512": "a96d874afa65f7edf884a6b9ea0d01b7d2eb2f1aeb86db4afaaeefa6073f153f29cafe8a1ce8ae9c8c6069cfe8534197add3dba900e350e381598cf3e76e8c79",
|
|
148
|
+
"sha256": "85ad13c4695409acef3dad5a8fd8cb6cbd472bcf2ac7d6514b3f0e9fd3b3d590",
|
|
149
|
+
"sha1": "019221c48e7c0648984cb5603c4927d391a241cd",
|
|
150
|
+
"md5": "620eb66ce22bd9cd4c1e0a0c6c0812f1"
|
|
151
151
|
}
|
|
152
152
|
]
|
|
153
153
|
},
|
|
@@ -161,13 +161,13 @@
|
|
|
161
161
|
},
|
|
162
162
|
"files": [
|
|
163
163
|
{
|
|
164
|
-
"name": "expo.modules.ui-58.0.
|
|
165
|
-
"url": "expo.modules.ui-58.0.
|
|
166
|
-
"size":
|
|
167
|
-
"sha512": "
|
|
168
|
-
"sha256": "
|
|
169
|
-
"sha1": "
|
|
170
|
-
"md5": "
|
|
164
|
+
"name": "expo.modules.ui-58.0.15-sources.jar",
|
|
165
|
+
"url": "expo.modules.ui-58.0.15-sources.jar",
|
|
166
|
+
"size": 111654,
|
|
167
|
+
"sha512": "5569d8f73d7b0d41af8d77ca8cb4e8685384113a45e151b9c6cdad1b660844183067026b2fc16c150ac409a0a097fb4ac78c4f5c31afe56862f306f8daf7c538",
|
|
168
|
+
"sha256": "651218fb79e50f51035a06d7e88ef8cd9cd391f8b66edcf46abdc431f0a41cfc",
|
|
169
|
+
"sha1": "584c7a2ab4d40b05b4658c93c1a689ce0587dc06",
|
|
170
|
+
"md5": "2ea3d659cdac9ba8f6d43d9679a48905"
|
|
171
171
|
}
|
|
172
172
|
]
|
|
173
173
|
}
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.module.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fc251634bb3745225f5169f231131343
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.module.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1f0478b4c8bf3bc52458f429fc59e10278b2ac2c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
baecdb10cef2e99a106a69d8d1755408faeb3f7f7442966d5e3dbcbfe6e26674
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
85d71daab274f7e80382dda25bb4fb673bb5d058b58b2f8c6e28cf39f4ff349c9809182bfce05a5395311f2ddf0dd31a830372c49445aaca933908c1327c91ca
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>expo.modules.ui</groupId>
|
|
11
11
|
<artifactId>expo.modules.ui</artifactId>
|
|
12
|
-
<version>58.0.
|
|
12
|
+
<version>58.0.15</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.ui</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.pom.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
223bfc33e7ee51c3db838076f94cfb1f
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.pom.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a9a1e9a3be5d9cd7679f76f857b875155c2bb756
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.pom.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
64dbcdae5d503a5245fae1cd35a5a4821daa772a7010e1b76b2fc5bc7fbc5b16
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.pom.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
074cbafb601c2b44e22ddc7b09f878b4b98ea71a877ff50c93eab6f7d9c8c18d7629b7fb5e044f9f4d61ef7599e06e9ffdb9d312bae0c4e6d8031eefbfaee45f
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/ui",
|
|
3
|
-
"version": "58.0.
|
|
3
|
+
"version": "58.0.15",
|
|
4
4
|
"description": "A collection of UI components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Jetpack Compose",
|
|
@@ -141,6 +141,7 @@
|
|
|
141
141
|
},
|
|
142
142
|
"devDependencies": {
|
|
143
143
|
"@babel/core": "^7.26.0",
|
|
144
|
+
"@expo/internal-scripts": "58.0.1",
|
|
144
145
|
"@playwright/test": "^1.59.0",
|
|
145
146
|
"@testing-library/react": "^16.3.0",
|
|
146
147
|
"@testing-library/react-native": "^14.0.1",
|
|
@@ -148,7 +149,6 @@
|
|
|
148
149
|
"@types/jest": "^30.0.0",
|
|
149
150
|
"@types/node": "^22.14.0",
|
|
150
151
|
"@types/react": "~19.3.0",
|
|
151
|
-
"expo-module-scripts": "56.0.8",
|
|
152
152
|
"react-native-reanimated": "4.7.0",
|
|
153
153
|
"react-native-worklets": "0.13.0"
|
|
154
154
|
},
|
|
Binary file
|
|
Binary file
|
|
@@ -4,7 +4,7 @@ import { worklets } from './optionalWorklets';
|
|
|
4
4
|
import { useWorkletProp } from './useWorkletProp';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* A worklet function wrapped for native code, returned by [`useWorkletCallback`](#
|
|
7
|
+
* A worklet function wrapped for native code, returned by [`useWorkletCallback`](#useworkletcallbackcallback).
|
|
8
8
|
* Pass it to a modifier or prop that accepts worklet callbacks, which then runs it synchronously on
|
|
9
9
|
* the UI thread.
|
|
10
10
|
*/
|
|
@@ -129,6 +129,10 @@ export function DateTimePicker(props: DateTimePickerProps) {
|
|
|
129
129
|
color={accentColor}
|
|
130
130
|
onDateSelected={onDateSelected}
|
|
131
131
|
showVariantToggle={false}
|
|
132
|
+
// Match iOS, where the inline picker has no label: hide Material 3's "Select date" title
|
|
133
|
+
// and its selected-date headline.
|
|
134
|
+
showTitle={false}
|
|
135
|
+
showHeadline={false}
|
|
132
136
|
{...(testID ? { testID } : undefined)}
|
|
133
137
|
/>
|
|
134
138
|
</Host>
|
|
@@ -131,6 +131,20 @@ export interface DateTimePickerProps {
|
|
|
131
131
|
* @default true
|
|
132
132
|
*/
|
|
133
133
|
showVariantToggle?: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Whether the picker shows its title, such as "Select date". When `false`, the picker passes
|
|
136
|
+
* `null` to Material 3's `title` slot. This prop has no effect when `displayedComponents` is
|
|
137
|
+
* `'hourAndMinute'`.
|
|
138
|
+
* @default true
|
|
139
|
+
*/
|
|
140
|
+
showTitle?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Whether the picker shows its headline, which displays the current selection. When `false`,
|
|
143
|
+
* the picker passes `null` to Material 3's `headline` slot. This prop has no effect when
|
|
144
|
+
* `displayedComponents` is `'hourAndMinute'`.
|
|
145
|
+
* @default true
|
|
146
|
+
*/
|
|
147
|
+
showHeadline?: boolean;
|
|
134
148
|
/**
|
|
135
149
|
* The components that the picker should display.
|
|
136
150
|
* On Android, you can have a picker that selects just the date or just the time.
|
|
@@ -252,6 +266,18 @@ export interface DateRangePickerProps {
|
|
|
252
266
|
* @default true
|
|
253
267
|
*/
|
|
254
268
|
showVariantToggle?: boolean;
|
|
269
|
+
/**
|
|
270
|
+
* Whether the picker shows its title, such as "Select date". When `false`, the picker passes
|
|
271
|
+
* `null` to Material 3's `title` slot.
|
|
272
|
+
* @default true
|
|
273
|
+
*/
|
|
274
|
+
showTitle?: boolean;
|
|
275
|
+
/**
|
|
276
|
+
* Whether the picker shows its headline, which displays the current selection. When `false`,
|
|
277
|
+
* the picker passes `null` to Material 3's `headline` slot.
|
|
278
|
+
* @default true
|
|
279
|
+
*/
|
|
280
|
+
showHeadline?: boolean;
|
|
255
281
|
/**
|
|
256
282
|
* The tint color to use on the picker elements.
|
|
257
283
|
*/
|
|
@@ -332,6 +358,18 @@ export interface DatePickerDialogProps {
|
|
|
332
358
|
initialDate?: string | null;
|
|
333
359
|
variant?: AndroidVariant;
|
|
334
360
|
showVariantToggle?: boolean;
|
|
361
|
+
/**
|
|
362
|
+
* Whether the picker shows its title, such as "Select date". When `false`, the picker passes
|
|
363
|
+
* `null` to Material 3's `title` slot.
|
|
364
|
+
* @default true
|
|
365
|
+
*/
|
|
366
|
+
showTitle?: boolean;
|
|
367
|
+
/**
|
|
368
|
+
* Whether the picker shows its headline, which displays the current selection. When `false`,
|
|
369
|
+
* the picker passes `null` to Material 3's `headline` slot.
|
|
370
|
+
* @default true
|
|
371
|
+
*/
|
|
372
|
+
showHeadline?: boolean;
|
|
335
373
|
confirmButtonLabel?: string;
|
|
336
374
|
dismissButtonLabel?: string;
|
|
337
375
|
color?: ColorValue;
|
|
@@ -96,6 +96,7 @@ function ToolbarContent(props: ToolbarContentProps) {
|
|
|
96
96
|
* ```
|
|
97
97
|
*
|
|
98
98
|
* @platform ios
|
|
99
|
+
* @platform tvos
|
|
99
100
|
*/
|
|
100
101
|
export function ToolbarItem({
|
|
101
102
|
placement = 'automatic',
|
|
@@ -125,6 +126,7 @@ export function ToolbarItem({
|
|
|
125
126
|
* ```
|
|
126
127
|
*
|
|
127
128
|
* @platform ios
|
|
129
|
+
* @platform tvos
|
|
128
130
|
*/
|
|
129
131
|
function ToolbarComponent(props: ToolbarProps) {
|
|
130
132
|
const { modifiers, children, ...restProps } = props;
|
|
@@ -49,7 +49,7 @@ export type HingeChangeHandler = (oldContext: HingeContext, newContext: HingeCon
|
|
|
49
49
|
* state for interactions and effects, not for layout.
|
|
50
50
|
*
|
|
51
51
|
* Pass a plain function to run it on the JS thread, or a callback from
|
|
52
|
-
* [`useWorkletCallback`](
|
|
52
|
+
* [`useWorkletCallback`](./usenativestate/#useworkletcallbackcallback) to run it synchronously on the UI
|
|
53
53
|
* thread, which suits driving a native state value from the continuous `angle`.
|
|
54
54
|
*
|
|
55
55
|
* The first call happens when the view appears, and its old context has a `null` hinge. On devices
|