@ng-native/expo 0.13.0 → 0.15.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/android/build.gradle +4 -0
- package/android/src/main/java/dev/ngnative/expo/SearchFieldModule.kt +172 -0
- package/dist/app-info.d.ts +18 -15
- package/dist/app-info.js +17 -5
- package/dist/app-info.js.map +1 -1
- package/dist/apple-sign-in.js +5 -4
- package/dist/apple-sign-in.js.map +1 -1
- package/dist/assets.js +2 -2
- package/dist/assets.js.map +1 -1
- package/dist/async-storage.js +4 -1
- package/dist/async-storage.js.map +1 -1
- package/dist/audio.js +2 -2
- package/dist/audio.js.map +1 -1
- package/dist/battery.js +4 -1
- package/dist/battery.js.map +1 -1
- package/dist/biometrics.js +5 -4
- package/dist/biometrics.js.map +1 -1
- package/dist/brightness.js +7 -2
- package/dist/brightness.js.map +1 -1
- package/dist/camera.d.ts +28 -2
- package/dist/camera.js +30 -3
- package/dist/camera.js.map +1 -1
- package/dist/clipboard.js +5 -2
- package/dist/clipboard.js.map +1 -1
- package/dist/database.js +2 -2
- package/dist/database.js.map +1 -1
- package/dist/expo-ui-components.d.ts +127 -12
- package/dist/expo-ui-components.js +354 -48
- package/dist/expo-ui-components.js.map +1 -1
- package/dist/expo-ui.js +7 -1
- package/dist/expo-ui.js.map +1 -1
- package/dist/foldable.d.ts +2 -0
- package/dist/foldable.js +15 -5
- package/dist/foldable.js.map +1 -1
- package/dist/fonts.d.ts +2 -0
- package/dist/fonts.js +12 -14
- package/dist/fonts.js.map +1 -1
- package/dist/haptics.js +2 -2
- package/dist/haptics.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/language-model.js +7 -3
- package/dist/language-model.js.map +1 -1
- package/dist/native.d.ts +17 -2
- package/dist/native.js +61 -3
- package/dist/native.js.map +1 -1
- package/dist/network.js +4 -1
- package/dist/network.js.map +1 -1
- package/dist/notifications.js +35 -8
- package/dist/notifications.js.map +1 -1
- package/dist/observed.js +5 -1
- package/dist/observed.js.map +1 -1
- package/dist/orientation.js +4 -1
- package/dist/orientation.js.map +1 -1
- package/dist/player.d.ts +9 -2
- package/dist/player.js +3 -2
- package/dist/player.js.map +1 -1
- package/dist/register-expo-view.d.ts +25 -2
- package/dist/register-expo-view.js +28 -7
- package/dist/register-expo-view.js.map +1 -1
- package/dist/screen-capture.js +2 -2
- package/dist/screen-capture.js.map +1 -1
- package/dist/search-field.d.ts +85 -0
- package/dist/search-field.js +160 -0
- package/dist/search-field.js.map +1 -0
- package/dist/secure-store.js +4 -1
- package/dist/secure-store.js.map +1 -1
- package/dist/sensors.js +6 -3
- package/dist/sensors.js.map +1 -1
- package/dist/splash-screen.js +2 -2
- package/dist/splash-screen.js.map +1 -1
- package/dist/store.js +4 -0
- package/dist/store.js.map +1 -1
- package/dist/tracking.js +2 -2
- package/dist/tracking.js.map +1 -1
- package/dist/ui-bottom-sheet-view.d.ts +3 -1
- package/dist/ui-bottom-sheet-view.js +6 -2
- package/dist/ui-bottom-sheet-view.js.map +1 -1
- package/dist/ui-font-names.d.ts +16 -0
- package/dist/ui-font-names.js +71 -0
- package/dist/ui-font-names.js.map +1 -0
- package/dist/updates.js +4 -1
- package/dist/updates.js.map +1 -1
- package/dist/video.js +3 -3
- package/dist/video.js.map +1 -1
- package/dist/watch.js +6 -5
- package/dist/watch.js.map +1 -1
- package/expo-module.config.json +5 -2
- package/ios/ExpoUIModifiersModule.swift +25 -0
- package/ios/InlineNavigationTitle.swift +12 -0
- package/ios/NgNativeExpo.podspec +3 -0
- package/ios/SearchField.swift +200 -0
- package/ios/SegmentedFont.swift +113 -0
- package/package.json +6 -2
|
@@ -517,6 +517,10 @@ export class UiDatePicker {
|
|
|
517
517
|
...(ngDevMode ? [undefined, { debugName: "title" }] : /* istanbul ignore next */ []));
|
|
518
518
|
selection = input(/* @ts-ignore */
|
|
519
519
|
...(ngDevMode ? [undefined, { debugName: "selection" }] : /* istanbul ignore next */ []));
|
|
520
|
+
/**
|
|
521
|
+
* What the picker shows. An empty list shows nothing in SwiftUI; Compose has no such choice,
|
|
522
|
+
* so on Android it shows the date and the time.
|
|
523
|
+
*/
|
|
520
524
|
displayedComponents = input(/* @ts-ignore */
|
|
521
525
|
...(ngDevMode ? [undefined, { debugName: "displayedComponents" }] : /* istanbul ignore next */ []));
|
|
522
526
|
range = input(/* @ts-ignore */
|
|
@@ -535,6 +539,14 @@ export class UiDatePicker {
|
|
|
535
539
|
android = nativePlatform() === 'android';
|
|
536
540
|
resolvedSelection = computed(() => this.android ? undefined : (this.selection() ?? this.value()?.toISOString()), /* @ts-ignore */
|
|
537
541
|
...(ngDevMode ? [{ debugName: "resolvedSelection" }] : /* istanbul ignore next */ []));
|
|
542
|
+
/** SwiftUI takes a list of what to show, and Compose one word for it. */
|
|
543
|
+
resolvedComponents = computed(() => {
|
|
544
|
+
const shown = this.displayedComponents();
|
|
545
|
+
if (!this.android || !shown)
|
|
546
|
+
return shown;
|
|
547
|
+
return shown.length === 1 ? shown[0] : 'dateAndTime';
|
|
548
|
+
}, /* @ts-ignore */
|
|
549
|
+
...(ngDevMode ? [{ debugName: "resolvedComponents" }] : /* istanbul ignore next */ []));
|
|
538
550
|
initialDate = computed(() => this.android ? (this.value()?.getTime() ?? null) : undefined, /* @ts-ignore */
|
|
539
551
|
...(ngDevMode ? [{ debugName: "initialDate" }] : /* istanbul ignore next */ []));
|
|
540
552
|
resolvedModifiers = computed(() => this.android ? this.modifiers() : withDisabled(this.modifiers(), this.disabled()), /* @ts-ignore */
|
|
@@ -560,7 +572,7 @@ export class UiDatePicker {
|
|
|
560
572
|
});
|
|
561
573
|
}
|
|
562
574
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: UiDatePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
563
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.0", type: UiDatePicker, isStandalone: true, selector: "ui-date-picker", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, displayedComponents: { classPropertyName: "displayedComponents", publicName: "displayedComponents", isSignal: true, isRequired: false, transformFunction: null }, range: { classPropertyName: "range", publicName: "range", isSignal: true, isRequired: false, transformFunction: null }, accessibilityLabel: { classPropertyName: "accessibilityLabel", publicName: "accessibilityLabel", isSignal: true, isRequired: false, transformFunction: null }, modifiers: { classPropertyName: "modifiers", publicName: "modifiers", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touch: "touch", dateChange: "dateChange" }, host: { properties: { "title": "title()", "selection": "resolvedSelection()", "initialDate": "initialDate()", "displayedComponents": "
|
|
575
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.0", type: UiDatePicker, isStandalone: true, selector: "ui-date-picker", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, displayedComponents: { classPropertyName: "displayedComponents", publicName: "displayedComponents", isSignal: true, isRequired: false, transformFunction: null }, range: { classPropertyName: "range", publicName: "range", isSignal: true, isRequired: false, transformFunction: null }, accessibilityLabel: { classPropertyName: "accessibilityLabel", publicName: "accessibilityLabel", isSignal: true, isRequired: false, transformFunction: null }, modifiers: { classPropertyName: "modifiers", publicName: "modifiers", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touch: "touch", dateChange: "dateChange" }, host: { properties: { "title": "title()", "selection": "resolvedSelection()", "initialDate": "initialDate()", "displayedComponents": "resolvedComponents()", "range": "range()", "accessibilityLabel": "accessibilityLabel()", "modifiers": "resolvedModifiers()" } }, ngImport: i0, template: '', isInline: true });
|
|
564
576
|
}
|
|
565
577
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: UiDatePicker, decorators: [{
|
|
566
578
|
type: Component,
|
|
@@ -571,7 +583,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImpor
|
|
|
571
583
|
'[title]': 'title()',
|
|
572
584
|
'[selection]': 'resolvedSelection()',
|
|
573
585
|
'[initialDate]': 'initialDate()',
|
|
574
|
-
'[displayedComponents]': '
|
|
586
|
+
'[displayedComponents]': 'resolvedComponents()',
|
|
575
587
|
'[range]': 'range()',
|
|
576
588
|
'[accessibilityLabel]': 'accessibilityLabel()',
|
|
577
589
|
'[modifiers]': 'resolvedModifiers()',
|
|
@@ -580,11 +592,141 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImpor
|
|
|
580
592
|
}], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }], displayedComponents: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayedComponents", required: false }] }], range: [{ type: i0.Input, args: [{ isSignal: true, alias: "range", required: false }] }], accessibilityLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "accessibilityLabel", required: false }] }], modifiers: [{ type: i0.Input, args: [{ isSignal: true, alias: "modifiers", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], dateChange: [{ type: i0.Output, args: ["dateChange"] }] } });
|
|
581
593
|
/** How long after a date picker appears its first report is taken to be about itself. */
|
|
582
594
|
const APPEARING_MS = 1000;
|
|
595
|
+
/** Compose's `SingleChoiceSegmentedButtonRow`, Android only: a row of `ui-segmented-button`s. */
|
|
596
|
+
export class UiSingleChoiceSegmentedButtonRow {
|
|
597
|
+
nativeView = nativeView();
|
|
598
|
+
modifiers = input(/* @ts-ignore */
|
|
599
|
+
...(ngDevMode ? [undefined, { debugName: "modifiers" }] : /* istanbul ignore next */ []));
|
|
600
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: UiSingleChoiceSegmentedButtonRow, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
601
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.0", type: UiSingleChoiceSegmentedButtonRow, isStandalone: true, selector: "ui-single-choice-segmented-button-row", inputs: { modifiers: { classPropertyName: "modifiers", publicName: "modifiers", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "modifiers": "modifiers()" } }, ngImport: i0, template: '<ng-content />', isInline: true });
|
|
602
|
+
}
|
|
603
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: UiSingleChoiceSegmentedButtonRow, decorators: [{
|
|
604
|
+
type: Component,
|
|
605
|
+
args: [{
|
|
606
|
+
selector: 'ui-single-choice-segmented-button-row',
|
|
607
|
+
template: '<ng-content />',
|
|
608
|
+
host: { '[modifiers]': 'modifiers()' },
|
|
609
|
+
}]
|
|
610
|
+
}], propDecorators: { modifiers: [{ type: i0.Input, args: [{ isSignal: true, alias: "modifiers", required: false }] }] } });
|
|
611
|
+
/** Compose's `SegmentedButton`, Android only, its label in a `<ui-slot name="label">`. */
|
|
612
|
+
export class UiSegmentedButton {
|
|
613
|
+
nativeView = nativeView();
|
|
614
|
+
selected = input(false, { ...(ngDevMode ? { debugName: "selected" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
615
|
+
enabled = input(true, { ...(ngDevMode ? { debugName: "enabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
616
|
+
modifiers = input(/* @ts-ignore */
|
|
617
|
+
...(ngDevMode ? [undefined, { debugName: "modifiers" }] : /* istanbul ignore next */ []));
|
|
618
|
+
press = output();
|
|
619
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: UiSegmentedButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
620
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.0", type: UiSegmentedButton, isStandalone: true, selector: "ui-segmented-button", inputs: { selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, enabled: { classPropertyName: "enabled", publicName: "enabled", isSignal: true, isRequired: false, transformFunction: null }, modifiers: { classPropertyName: "modifiers", publicName: "modifiers", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { press: "press" }, host: { listeners: { "buttonPressed": "press.emit()" }, properties: { "selected": "selected()", "enabled": "enabled()", "modifiers": "modifiers()" } }, ngImport: i0, template: '<ng-content />', isInline: true });
|
|
621
|
+
}
|
|
622
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: UiSegmentedButton, decorators: [{
|
|
623
|
+
type: Component,
|
|
624
|
+
args: [{
|
|
625
|
+
selector: 'ui-segmented-button',
|
|
626
|
+
template: '<ng-content />',
|
|
627
|
+
host: {
|
|
628
|
+
'[selected]': 'selected()',
|
|
629
|
+
'[enabled]': 'enabled()',
|
|
630
|
+
'[modifiers]': 'modifiers()',
|
|
631
|
+
'(buttonPressed)': 'press.emit()',
|
|
632
|
+
},
|
|
633
|
+
}]
|
|
634
|
+
}], propDecorators: { selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], enabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "enabled", required: false }] }], modifiers: [{ type: i0.Input, args: [{ isSignal: true, alias: "modifiers", required: false }] }], press: [{ type: i0.Output, args: ["press"] }] } });
|
|
635
|
+
/**
|
|
636
|
+
* Compose's `ExposedDropdownMenuBox`, Android only: an anchor, a view with the `menuAnchor`
|
|
637
|
+
* modifier, and the `ui-exposed-dropdown-menu` it opens. A tap on the anchor asks to open or close
|
|
638
|
+
* it, through `toggled`; `expanded` says which it is.
|
|
639
|
+
*/
|
|
640
|
+
export class UiExposedDropdownMenuBox {
|
|
641
|
+
nativeView = nativeView();
|
|
642
|
+
expanded = input(false, { ...(ngDevMode ? { debugName: "expanded" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
643
|
+
toggled = output();
|
|
644
|
+
modifiers = input(/* @ts-ignore */
|
|
645
|
+
...(ngDevMode ? [undefined, { debugName: "modifiers" }] : /* istanbul ignore next */ []));
|
|
646
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: UiExposedDropdownMenuBox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
647
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.0", type: UiExposedDropdownMenuBox, isStandalone: true, selector: "ui-exposed-dropdown-menu-box", inputs: { expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, modifiers: { classPropertyName: "modifiers", publicName: "modifiers", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { toggled: "toggled" }, host: { listeners: { "expandedChange": "toggled.emit($event.nativeEvent.value)" }, properties: { "expanded": "expanded()", "modifiers": "modifiers()" } }, ngImport: i0, template: '<ng-content />', isInline: true });
|
|
648
|
+
}
|
|
649
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: UiExposedDropdownMenuBox, decorators: [{
|
|
650
|
+
type: Component,
|
|
651
|
+
args: [{
|
|
652
|
+
selector: 'ui-exposed-dropdown-menu-box',
|
|
653
|
+
template: '<ng-content />',
|
|
654
|
+
host: {
|
|
655
|
+
'[expanded]': 'expanded()',
|
|
656
|
+
'[modifiers]': 'modifiers()',
|
|
657
|
+
// Not a model: its output would be named for this event, and take it.
|
|
658
|
+
'(expandedChange)': 'toggled.emit($event.nativeEvent.value)',
|
|
659
|
+
},
|
|
660
|
+
}]
|
|
661
|
+
}], propDecorators: { expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }], toggled: [{ type: i0.Output, args: ["toggled"] }], modifiers: [{ type: i0.Input, args: [{ isSignal: true, alias: "modifiers", required: false }] }] } });
|
|
662
|
+
/** Compose's `ExposedDropdownMenu`, Android only: the `ui-dropdown-menu-item`s a box opens. */
|
|
663
|
+
export class UiExposedDropdownMenu {
|
|
664
|
+
nativeView = nativeView();
|
|
665
|
+
expanded = input(false, { ...(ngDevMode ? { debugName: "expanded" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
666
|
+
modifiers = input(/* @ts-ignore */
|
|
667
|
+
...(ngDevMode ? [undefined, { debugName: "modifiers" }] : /* istanbul ignore next */ []));
|
|
668
|
+
/** A tap outside the menu, or Back: the box should close it. */
|
|
669
|
+
dismiss = output();
|
|
670
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: UiExposedDropdownMenu, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
671
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.0", type: UiExposedDropdownMenu, isStandalone: true, selector: "ui-exposed-dropdown-menu", inputs: { expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, modifiers: { classPropertyName: "modifiers", publicName: "modifiers", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dismiss: "dismiss" }, host: { listeners: { "dismissRequest": "dismiss.emit()" }, properties: { "expanded": "expanded()", "modifiers": "modifiers()" } }, ngImport: i0, template: '<ng-content />', isInline: true });
|
|
672
|
+
}
|
|
673
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: UiExposedDropdownMenu, decorators: [{
|
|
674
|
+
type: Component,
|
|
675
|
+
args: [{
|
|
676
|
+
selector: 'ui-exposed-dropdown-menu',
|
|
677
|
+
template: '<ng-content />',
|
|
678
|
+
host: {
|
|
679
|
+
'[expanded]': 'expanded()',
|
|
680
|
+
'[modifiers]': 'modifiers()',
|
|
681
|
+
'(dismissRequest)': 'dismiss.emit()',
|
|
682
|
+
},
|
|
683
|
+
}]
|
|
684
|
+
}], propDecorators: { expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }], modifiers: [{ type: i0.Input, args: [{ isSignal: true, alias: "modifiers", required: false }] }], dismiss: [{ type: i0.Output, args: ["dismiss"] }] } });
|
|
685
|
+
/** Compose's `DropdownMenuItem`, Android only, its text in a `<ui-slot name="text">`. */
|
|
686
|
+
export class UiDropdownMenuItem {
|
|
687
|
+
nativeView = nativeView();
|
|
688
|
+
enabled = input(true, { ...(ngDevMode ? { debugName: "enabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
689
|
+
modifiers = input(/* @ts-ignore */
|
|
690
|
+
...(ngDevMode ? [undefined, { debugName: "modifiers" }] : /* istanbul ignore next */ []));
|
|
691
|
+
press = output();
|
|
692
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: UiDropdownMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
693
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.0", type: UiDropdownMenuItem, isStandalone: true, selector: "ui-dropdown-menu-item", inputs: { enabled: { classPropertyName: "enabled", publicName: "enabled", isSignal: true, isRequired: false, transformFunction: null }, modifiers: { classPropertyName: "modifiers", publicName: "modifiers", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { press: "press" }, host: { listeners: { "itemPressed": "press.emit()" }, properties: { "enabled": "enabled()", "modifiers": "modifiers()" } }, ngImport: i0, template: '<ng-content />', isInline: true });
|
|
694
|
+
}
|
|
695
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: UiDropdownMenuItem, decorators: [{
|
|
696
|
+
type: Component,
|
|
697
|
+
args: [{
|
|
698
|
+
selector: 'ui-dropdown-menu-item',
|
|
699
|
+
template: '<ng-content />',
|
|
700
|
+
host: {
|
|
701
|
+
'[enabled]': 'enabled()',
|
|
702
|
+
'[modifiers]': 'modifiers()',
|
|
703
|
+
'(itemPressed)': 'press.emit()',
|
|
704
|
+
},
|
|
705
|
+
}]
|
|
706
|
+
}], propDecorators: { enabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "enabled", required: false }] }], modifiers: [{ type: i0.Input, args: [{ isSignal: true, alias: "modifiers", required: false }] }], press: [{ type: i0.Output, args: ["press"] }] } });
|
|
583
707
|
/**
|
|
584
|
-
* A
|
|
585
|
-
*
|
|
586
|
-
*
|
|
587
|
-
|
|
708
|
+
* A segmented picker's `font` modifiers again, as `@ng-native/expo`'s own modifier: SwiftUI draws
|
|
709
|
+
* the segments as a `UISegmentedControl`, which `font` does not reach. In a build without that
|
|
710
|
+
* modifier, Expo Go's, the segments stay in the system font.
|
|
711
|
+
*/
|
|
712
|
+
function segmentFonts(modifiers) {
|
|
713
|
+
const segmented = modifiers.some((m) => m.$type === 'pickerStyle' && m['style'] === 'segmented');
|
|
714
|
+
if (!segmented)
|
|
715
|
+
return [];
|
|
716
|
+
return modifiers
|
|
717
|
+
.filter((m) => m.$type === 'font')
|
|
718
|
+
.map((m) => ({ ...m, $type: 'ngNativeSegmentedFont' }));
|
|
719
|
+
}
|
|
720
|
+
/**
|
|
721
|
+
* A SwiftUI `Picker` as a Signal Forms field: `<ui-picker [options]="rooms" [formField]="f.room"
|
|
722
|
+
* />`. `options` draws the choices, each tagged with its value, which is the content slot and `tag`
|
|
723
|
+
* modifiers `@expo/ui` otherwise wants written out by hand; children still work for anything
|
|
724
|
+
* richer on iOS. `pickerStyle` is SwiftUI's (`menu`, `segmented`, `wheel`, `inline`).
|
|
725
|
+
*
|
|
726
|
+
* Compose has no `Picker`, so on Android the options are drawn with its own controls: `segmented`
|
|
727
|
+
* as a row of segmented buttons, and any other style as an exposed dropdown menu under the chosen
|
|
728
|
+
* option. `label`, `systemImage`, children and `modifiers` are SwiftUI's alone. A `font` modifier
|
|
729
|
+
* reaches a segmented picker's segments in a development build, not in Expo Go.
|
|
588
730
|
*/
|
|
589
731
|
export class UiPicker {
|
|
590
732
|
nativeView = nativeView();
|
|
@@ -612,54 +754,146 @@ export class UiPicker {
|
|
|
612
754
|
[{ $type: 'tag', tag: option.value }],
|
|
613
755
|
])), /* @ts-ignore */
|
|
614
756
|
...(ngDevMode ? [{ debugName: "tags" }] : /* istanbul ignore next */ []));
|
|
757
|
+
android = nativePlatform() === 'android';
|
|
758
|
+
/** Whether Android's dropdown is open. */
|
|
759
|
+
open = signal(false, /* @ts-ignore */
|
|
760
|
+
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
761
|
+
/**
|
|
762
|
+
* What Android's dropdown shows closed: the chosen option, or the label before there is one,
|
|
763
|
+
* with the arrow that says a tap opens it, which plain text otherwise does not.
|
|
764
|
+
*/
|
|
765
|
+
chosenLabel = computed(() => {
|
|
766
|
+
const chosen = this.options()?.find((option) => option.value === this.value());
|
|
767
|
+
return `${chosen?.label ?? this.label() ?? ''} \u25BE`;
|
|
768
|
+
}, /* @ts-ignore */
|
|
769
|
+
...(ngDevMode ? [{ debugName: "chosenLabel" }] : /* istanbul ignore next */ []));
|
|
770
|
+
/** What anchors Android's dropdown to the option it shows. */
|
|
771
|
+
anchor = computed(() => [
|
|
772
|
+
{ $type: 'menuAnchor', type: 'primaryNotEditable', enabled: !this.disabled() },
|
|
773
|
+
], /* @ts-ignore */
|
|
774
|
+
...(ngDevMode ? [{ debugName: "anchor" }] : /* istanbul ignore next */ []));
|
|
615
775
|
resolvedModifiers = computed(() => {
|
|
616
776
|
const style = this.pickerStyle();
|
|
617
777
|
const own = style
|
|
618
778
|
? [{ $type: 'pickerStyle', style }, ...(this.modifiers() ?? [])]
|
|
619
779
|
: this.modifiers();
|
|
620
|
-
return withDisabled(own, this.disabled());
|
|
780
|
+
return withDisabled(own && [...own, ...segmentFonts(own)], this.disabled());
|
|
621
781
|
}, /* @ts-ignore */
|
|
622
782
|
...(ngDevMode ? [{ debugName: "resolvedModifiers" }] : /* istanbul ignore next */ []));
|
|
623
783
|
constructor() {
|
|
624
784
|
listen('topSelectionChange', ({ selection }) => {
|
|
625
785
|
if (typeof selection !== 'string' && typeof selection !== 'number')
|
|
626
786
|
return;
|
|
627
|
-
this.
|
|
628
|
-
this.touch.emit();
|
|
787
|
+
this.choose(selection);
|
|
629
788
|
});
|
|
630
789
|
}
|
|
790
|
+
choose(selection) {
|
|
791
|
+
this.open.set(false);
|
|
792
|
+
if (this.disabled())
|
|
793
|
+
return;
|
|
794
|
+
this.value.set(selection);
|
|
795
|
+
this.touch.emit();
|
|
796
|
+
}
|
|
631
797
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: UiPicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
632
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.0", type: UiPicker, isStandalone: true, selector: "ui-picker", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, systemImage: { classPropertyName: "systemImage", publicName: "systemImage", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, pickerStyle: { classPropertyName: "pickerStyle", publicName: "pickerStyle", isSignal: true, isRequired: false, transformFunction: null }, modifiers: { classPropertyName: "modifiers", publicName: "modifiers", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touch: "touch", selectionChange: "selectionChange" }, host: { properties: { "label": "label()", "systemImage": "systemImage()", "selection": "value()", "modifiers": "resolvedModifiers()" } }, ngImport: i0, template: `
|
|
633
|
-
@if (
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
798
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.0", type: UiPicker, isStandalone: true, selector: "ui-picker", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, systemImage: { classPropertyName: "systemImage", publicName: "systemImage", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, pickerStyle: { classPropertyName: "pickerStyle", publicName: "pickerStyle", isSignal: true, isRequired: false, transformFunction: null }, modifiers: { classPropertyName: "modifiers", publicName: "modifiers", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touch: "touch", selectionChange: "selectionChange" }, host: { properties: { "label": "android ? undefined : label()", "systemImage": "android ? undefined : systemImage()", "selection": "android ? undefined : value()", "modifiers": "android ? undefined : resolvedModifiers()" } }, ngImport: i0, template: `
|
|
799
|
+
@if (android) {
|
|
800
|
+
@if (pickerStyle() === 'segmented') {
|
|
801
|
+
<ui-single-choice-segmented-button-row>
|
|
802
|
+
@for (option of options() ?? []; track option.value) {
|
|
803
|
+
<ui-segmented-button
|
|
804
|
+
[selected]="option.value === value()"
|
|
805
|
+
[enabled]="!disabled()"
|
|
806
|
+
(press)="choose(option.value)"
|
|
807
|
+
>
|
|
808
|
+
<ui-slot name="label"><ui-text [text]="option.label" /></ui-slot>
|
|
809
|
+
</ui-segmented-button>
|
|
810
|
+
}
|
|
811
|
+
</ui-single-choice-segmented-button-row>
|
|
812
|
+
} @else {
|
|
813
|
+
<ui-exposed-dropdown-menu-box
|
|
814
|
+
[expanded]="open()"
|
|
815
|
+
(toggled)="open.set(!disabled() && $event)"
|
|
816
|
+
>
|
|
817
|
+
<ui-text [text]="chosenLabel()" [modifiers]="anchor()" />
|
|
818
|
+
<ui-exposed-dropdown-menu [expanded]="open()" (dismiss)="open.set(false)">
|
|
819
|
+
@for (option of options() ?? []; track option.value) {
|
|
820
|
+
<ui-dropdown-menu-item [enabled]="!disabled()" (press)="choose(option.value)">
|
|
821
|
+
<ui-slot name="text"><ui-text [text]="option.label" /></ui-slot>
|
|
822
|
+
</ui-dropdown-menu-item>
|
|
823
|
+
}
|
|
824
|
+
</ui-exposed-dropdown-menu>
|
|
825
|
+
</ui-exposed-dropdown-menu-box>
|
|
826
|
+
}
|
|
827
|
+
} @else {
|
|
828
|
+
@if (options(); as options) {
|
|
829
|
+
<ui-slot name="content">
|
|
830
|
+
@for (option of options; track option.value) {
|
|
831
|
+
<ui-text [text]="option.label" [modifiers]="tags().get(option.value)" />
|
|
832
|
+
}
|
|
833
|
+
</ui-slot>
|
|
834
|
+
}
|
|
835
|
+
<ng-content />
|
|
639
836
|
}
|
|
640
|
-
|
|
641
|
-
`, isInline: true, dependencies: [{ kind: "component", type: UiSlot, selector: "ui-slot", inputs: ["name", "extraProps"] }, { kind: "component", type: UiText, selector: "ui-text", inputs: ["text", "date", "dateStyle", "timerInterval", "countsDown", "modifiers"] }] });
|
|
837
|
+
`, isInline: true, dependencies: [{ kind: "component", type: UiDropdownMenuItem, selector: "ui-dropdown-menu-item", inputs: ["enabled", "modifiers"], outputs: ["press"] }, { kind: "component", type: UiExposedDropdownMenu, selector: "ui-exposed-dropdown-menu", inputs: ["expanded", "modifiers"], outputs: ["dismiss"] }, { kind: "component", type: UiExposedDropdownMenuBox, selector: "ui-exposed-dropdown-menu-box", inputs: ["expanded", "modifiers"], outputs: ["toggled"] }, { kind: "component", type: UiSegmentedButton, selector: "ui-segmented-button", inputs: ["selected", "enabled", "modifiers"], outputs: ["press"] }, { kind: "component", type: UiSingleChoiceSegmentedButtonRow, selector: "ui-single-choice-segmented-button-row", inputs: ["modifiers"] }, { kind: "component", type: UiSlot, selector: "ui-slot", inputs: ["name", "extraProps"] }, { kind: "component", type: UiText, selector: "ui-text", inputs: ["text", "date", "dateStyle", "timerInterval", "countsDown", "modifiers"] }] });
|
|
642
838
|
}
|
|
643
839
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: UiPicker, decorators: [{
|
|
644
840
|
type: Component,
|
|
645
841
|
args: [{
|
|
646
842
|
selector: 'ui-picker',
|
|
647
|
-
imports: [
|
|
843
|
+
imports: [
|
|
844
|
+
UiDropdownMenuItem,
|
|
845
|
+
UiExposedDropdownMenu,
|
|
846
|
+
UiExposedDropdownMenuBox,
|
|
847
|
+
UiSegmentedButton,
|
|
848
|
+
UiSingleChoiceSegmentedButtonRow,
|
|
849
|
+
UiSlot,
|
|
850
|
+
UiText,
|
|
851
|
+
],
|
|
648
852
|
template: `
|
|
649
|
-
@if (
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
853
|
+
@if (android) {
|
|
854
|
+
@if (pickerStyle() === 'segmented') {
|
|
855
|
+
<ui-single-choice-segmented-button-row>
|
|
856
|
+
@for (option of options() ?? []; track option.value) {
|
|
857
|
+
<ui-segmented-button
|
|
858
|
+
[selected]="option.value === value()"
|
|
859
|
+
[enabled]="!disabled()"
|
|
860
|
+
(press)="choose(option.value)"
|
|
861
|
+
>
|
|
862
|
+
<ui-slot name="label"><ui-text [text]="option.label" /></ui-slot>
|
|
863
|
+
</ui-segmented-button>
|
|
864
|
+
}
|
|
865
|
+
</ui-single-choice-segmented-button-row>
|
|
866
|
+
} @else {
|
|
867
|
+
<ui-exposed-dropdown-menu-box
|
|
868
|
+
[expanded]="open()"
|
|
869
|
+
(toggled)="open.set(!disabled() && $event)"
|
|
870
|
+
>
|
|
871
|
+
<ui-text [text]="chosenLabel()" [modifiers]="anchor()" />
|
|
872
|
+
<ui-exposed-dropdown-menu [expanded]="open()" (dismiss)="open.set(false)">
|
|
873
|
+
@for (option of options() ?? []; track option.value) {
|
|
874
|
+
<ui-dropdown-menu-item [enabled]="!disabled()" (press)="choose(option.value)">
|
|
875
|
+
<ui-slot name="text"><ui-text [text]="option.label" /></ui-slot>
|
|
876
|
+
</ui-dropdown-menu-item>
|
|
877
|
+
}
|
|
878
|
+
</ui-exposed-dropdown-menu>
|
|
879
|
+
</ui-exposed-dropdown-menu-box>
|
|
880
|
+
}
|
|
881
|
+
} @else {
|
|
882
|
+
@if (options(); as options) {
|
|
883
|
+
<ui-slot name="content">
|
|
884
|
+
@for (option of options; track option.value) {
|
|
885
|
+
<ui-text [text]="option.label" [modifiers]="tags().get(option.value)" />
|
|
886
|
+
}
|
|
887
|
+
</ui-slot>
|
|
888
|
+
}
|
|
889
|
+
<ng-content />
|
|
655
890
|
}
|
|
656
|
-
<ng-content />
|
|
657
891
|
`,
|
|
658
892
|
host: {
|
|
659
|
-
'[label]': 'label()',
|
|
660
|
-
'[systemImage]': 'systemImage()',
|
|
661
|
-
'[selection]': 'value()',
|
|
662
|
-
'[modifiers]': 'resolvedModifiers()',
|
|
893
|
+
'[label]': 'android ? undefined : label()',
|
|
894
|
+
'[systemImage]': 'android ? undefined : systemImage()',
|
|
895
|
+
'[selection]': 'android ? undefined : value()',
|
|
896
|
+
'[modifiers]': 'android ? undefined : resolvedModifiers()',
|
|
663
897
|
},
|
|
664
898
|
}]
|
|
665
899
|
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], systemImage: [{ type: i0.Input, args: [{ isSignal: true, alias: "systemImage", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], pickerStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "pickerStyle", required: false }] }], modifiers: [{ type: i0.Input, args: [{ isSignal: true, alias: "modifiers", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }] } });
|
|
@@ -1220,7 +1454,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImpor
|
|
|
1220
1454
|
host: { '[modifiers]': 'modifiers()' },
|
|
1221
1455
|
}]
|
|
1222
1456
|
}], propDecorators: { modifiers: [{ type: i0.Input, args: [{ isSignal: true, alias: "modifiers", required: false }] }] } });
|
|
1223
|
-
/**
|
|
1457
|
+
/**
|
|
1458
|
+
* A SwiftUI `Section` of a form or a list, under `title`, iOS only. A `<ui-slot name="header">`
|
|
1459
|
+
* is its header in place of a `title`, and a `<ui-slot name="footer">` is the note under its rows.
|
|
1460
|
+
* When both a non-empty `title` and a header slot are set, `@expo/ui`'s `SectionView` draws the
|
|
1461
|
+
* `title` and drops the slot; an empty `title` counts as unset. The slot's `name` is written as it is,
|
|
1462
|
+
* not bound, as that is what picks it out of the rows.
|
|
1463
|
+
*/
|
|
1224
1464
|
export class UiSection {
|
|
1225
1465
|
nativeView = nativeView();
|
|
1226
1466
|
title = input(/* @ts-ignore */
|
|
@@ -1228,14 +1468,18 @@ export class UiSection {
|
|
|
1228
1468
|
modifiers = input(/* @ts-ignore */
|
|
1229
1469
|
...(ngDevMode ? [undefined, { debugName: "modifiers" }] : /* istanbul ignore next */ []));
|
|
1230
1470
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: UiSection, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1231
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.0", type: UiSection, isStandalone: true, selector: "ui-section", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, modifiers: { classPropertyName: "modifiers", publicName: "modifiers", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "title": "title()", "modifiers": "modifiers()" } }, ngImport: i0, template:
|
|
1471
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.0", type: UiSection, isStandalone: true, selector: "ui-section", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, modifiers: { classPropertyName: "modifiers", publicName: "modifiers", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "title": "title()", "modifiers": "modifiers()" } }, ngImport: i0, template: `<ng-content select="ui-slot[name=header]" />
|
|
1472
|
+
<ui-slot name="content"><ng-content /></ui-slot>
|
|
1473
|
+
<ng-content select="ui-slot[name=footer]" />`, isInline: true, dependencies: [{ kind: "component", type: UiSlot, selector: "ui-slot", inputs: ["name", "extraProps"] }] });
|
|
1232
1474
|
}
|
|
1233
1475
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: UiSection, decorators: [{
|
|
1234
1476
|
type: Component,
|
|
1235
1477
|
args: [{
|
|
1236
1478
|
selector: 'ui-section',
|
|
1237
1479
|
imports: [UiSlot],
|
|
1238
|
-
template:
|
|
1480
|
+
template: `<ng-content select="ui-slot[name=header]" />
|
|
1481
|
+
<ui-slot name="content"><ng-content /></ui-slot>
|
|
1482
|
+
<ng-content select="ui-slot[name=footer]" />`,
|
|
1239
1483
|
host: { '[title]': 'title()', '[modifiers]': 'modifiers()' },
|
|
1240
1484
|
}]
|
|
1241
1485
|
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], modifiers: [{ type: i0.Input, args: [{ isSignal: true, alias: "modifiers", required: false }] }] } });
|
|
@@ -1382,8 +1626,9 @@ function windowWidth() {
|
|
|
1382
1626
|
* Unlike the other components here, the element this is mounted on is a plain view, which takes
|
|
1383
1627
|
* no room and needs no `ui-host` around it. The sheet is inside it, wrapped as `@expo/ui`'s own
|
|
1384
1628
|
* React component wraps one: a `ui-host`, the sheet, on iOS a `ui-group` that carries the
|
|
1385
|
-
* presentation modifiers, and a `ui-view-host` holding the one view the content goes in.
|
|
1386
|
-
* toolbar
|
|
1629
|
+
* presentation modifiers, and a `ui-view-host` holding the one view the content goes in. Where the
|
|
1630
|
+
* build has SwiftUI's toolbar and the sheet is not sized to its content, the view host is in a
|
|
1631
|
+
* `ui-navigation-stack` under the group, over a `ui-toolbar` that holds the items.
|
|
1387
1632
|
*/
|
|
1388
1633
|
export class UiBottomSheet {
|
|
1389
1634
|
/**
|
|
@@ -1432,6 +1677,14 @@ export class UiBottomSheet {
|
|
|
1432
1677
|
...(ngDevMode ? [undefined, { debugName: "detents" }] : /* istanbul ignore next */ []));
|
|
1433
1678
|
/** Whether the grabber shows at the top of the sheet. */
|
|
1434
1679
|
showDragIndicator = input(true, { ...(ngDevMode ? { debugName: "showDragIndicator" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1680
|
+
/**
|
|
1681
|
+
* The colour of the sheet behind its content: SwiftUI's `presentationBackground` on iOS, where
|
|
1682
|
+
* a sheet below its full height is otherwise drawn as glass, and Compose's `containerColor` on
|
|
1683
|
+
* Android. Over a `background-color` the element has from CSS, which colours the sheet the same
|
|
1684
|
+
* way. Neither is the sheet as the system draws it.
|
|
1685
|
+
*/
|
|
1686
|
+
backgroundColor = input(/* @ts-ignore */
|
|
1687
|
+
...(ngDevMode ? [undefined, { debugName: "backgroundColor" }] : /* istanbul ignore next */ []));
|
|
1435
1688
|
/**
|
|
1436
1689
|
* The sheet has finished closing, whether the user dismissed it or `open` was set false: the
|
|
1437
1690
|
* moment another sheet or a dialog can be presented.
|
|
@@ -1443,6 +1696,14 @@ export class UiBottomSheet {
|
|
|
1443
1696
|
/** Whether the sheet has a toolbar: it has items for one, and the build has the views. */
|
|
1444
1697
|
toolbar = computed(() => this.toolbarInBuild && this.toolbarItems().length > 0, /* @ts-ignore */
|
|
1445
1698
|
...(ngDevMode ? [{ debugName: "toolbar" }] : /* istanbul ignore next */ []));
|
|
1699
|
+
/**
|
|
1700
|
+
* A sheet's bar never shows a large title, but a navigation stack leaves room for one under its
|
|
1701
|
+
* bar. `@expo/ui` has no modifier for the title's display mode, so `@ng-native/expo` registers
|
|
1702
|
+
* one natively, in a build with `@expo/ui`. One without it, Expo Go's, ignores the modifier.
|
|
1703
|
+
*/
|
|
1704
|
+
inlineTitle = [
|
|
1705
|
+
{ $type: 'ngNativeInlineNavigationTitle' },
|
|
1706
|
+
];
|
|
1446
1707
|
/** SwiftUI's sheet stays in the tree; anywhere else it is there while it shows. */
|
|
1447
1708
|
swiftUI = nativePlatform() === 'ios';
|
|
1448
1709
|
width = windowWidth();
|
|
@@ -1456,8 +1717,8 @@ export class UiBottomSheet {
|
|
|
1456
1717
|
* Whether the sheet is sized to its content, as it opened: a view host takes its sizing once,
|
|
1457
1718
|
* as it mounts. SwiftUI's sheet is not where it has detents to rest at, nor where it has a
|
|
1458
1719
|
* toolbar: a navigation stack fills what it is given, and the bar is no part of the content.
|
|
1459
|
-
* A toolbar that comes or goes while
|
|
1460
|
-
* again around it.
|
|
1720
|
+
* A toolbar that comes or goes while such a sheet is open is followed, since the view host is
|
|
1721
|
+
* made again around it.
|
|
1461
1722
|
*/
|
|
1462
1723
|
fits = computed(() => {
|
|
1463
1724
|
this.mounted();
|
|
@@ -1465,6 +1726,17 @@ export class UiBottomSheet {
|
|
|
1465
1726
|
return untracked(() => this.fitToContents() && !(this.swiftUI && (this.detents()?.length || toolbar)));
|
|
1466
1727
|
}, /* @ts-ignore */
|
|
1467
1728
|
...(ngDevMode ? [{ debugName: "fits" }] : /* istanbul ignore next */ []));
|
|
1729
|
+
/**
|
|
1730
|
+
* Whether the content is in a navigation stack, beside a toolbar: wherever the build has one and
|
|
1731
|
+
* the sheet is not sized to its content, items or none, so that an item coming or going never
|
|
1732
|
+
* makes the view host again. `@expo/ui`'s view host takes its content's touches as it appears and
|
|
1733
|
+
* gives them up as it disappears, and one made again around the same content appears before the
|
|
1734
|
+
* old one has gone, leaving the content none. A stack with no item draws no bar. The toolbar is
|
|
1735
|
+
* beside the view host rather than around it, since SwiftUI makes the view a toolbar is on again
|
|
1736
|
+
* as its items change.
|
|
1737
|
+
*/
|
|
1738
|
+
stacked = computed(() => this.toolbarInBuild && !this.fits(), /* @ts-ignore */
|
|
1739
|
+
...(ngDevMode ? [{ debugName: "stacked" }] : /* istanbul ignore next */ []));
|
|
1468
1740
|
/**
|
|
1469
1741
|
* SwiftUI reads how a sheet is presented from modifiers on its content, not from props. The
|
|
1470
1742
|
* detents of a sheet not sized to its content are followed while it is open.
|
|
@@ -1480,8 +1752,28 @@ export class UiBottomSheet {
|
|
|
1480
1752
|
$type: 'presentationDragIndicator',
|
|
1481
1753
|
visibility: this.showDragIndicator() ? 'visible' : 'hidden',
|
|
1482
1754
|
},
|
|
1755
|
+
...this.background(),
|
|
1483
1756
|
], /* @ts-ignore */
|
|
1484
1757
|
...(ngDevMode ? [{ debugName: "presentation" }] : /* istanbul ignore next */ []));
|
|
1758
|
+
/** The `background-color` the element has from CSS, which the sheet draws rather than it. */
|
|
1759
|
+
painted = signal(undefined, /* @ts-ignore */
|
|
1760
|
+
...(ngDevMode ? [{ debugName: "painted" }] : /* istanbul ignore next */ []));
|
|
1761
|
+
/** The sheet's colour: the input's, or else the element's from CSS. */
|
|
1762
|
+
color = computed(() => this.backgroundColor() || this.painted() || undefined, /* @ts-ignore */
|
|
1763
|
+
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
1764
|
+
/**
|
|
1765
|
+
* The sheet's own background, a colour converted as any colour is, where one is given. As a
|
|
1766
|
+
* shape style for `@expo/ui` 57.0.17 and later, and as the plain colour the versions before it
|
|
1767
|
+
* read, Expo Go's among them. Each ignores the other's field.
|
|
1768
|
+
*/
|
|
1769
|
+
background = computed(() => {
|
|
1770
|
+
const given = this.color();
|
|
1771
|
+
if (given === undefined)
|
|
1772
|
+
return [];
|
|
1773
|
+
const color = this.engine?.color(given) ?? given;
|
|
1774
|
+
return [{ $type: 'presentationBackground', style: { type: 'color', color }, color }];
|
|
1775
|
+
}, /* @ts-ignore */
|
|
1776
|
+
...(ngDevMode ? [{ debugName: "background" }] : /* istanbul ignore next */ []));
|
|
1485
1777
|
/**
|
|
1486
1778
|
* The one view a view host holds. Sized to its content it needs a width of its own, the
|
|
1487
1779
|
* window's; otherwise it fills the height the sheet gives it.
|
|
@@ -1497,6 +1789,10 @@ export class UiBottomSheet {
|
|
|
1497
1789
|
if (!this.open())
|
|
1498
1790
|
untracked(() => this.close());
|
|
1499
1791
|
});
|
|
1792
|
+
const host = inject(ElementRef).nativeElement;
|
|
1793
|
+
const stop = this.engine?.takePaint?.(host, (color) => this.painted.set(color));
|
|
1794
|
+
if (stop)
|
|
1795
|
+
inject(DestroyRef).onDestroy(stop);
|
|
1500
1796
|
if (this.swiftUI && !this.toolbarInBuild) {
|
|
1501
1797
|
const warned = effect(() => {
|
|
1502
1798
|
if (!this.toolbarItems().length)
|
|
@@ -1588,7 +1884,7 @@ export class UiBottomSheet {
|
|
|
1588
1884
|
afterNextRender(() => this.mounted.set(this.open()), { injector: this.injector });
|
|
1589
1885
|
}
|
|
1590
1886
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: UiBottomSheet, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1591
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.0", type: UiBottomSheet, isStandalone: true, selector: "ui-bottom-sheet", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, fitToContents: { classPropertyName: "fitToContents", publicName: "fitToContents", isSignal: true, isRequired: false, transformFunction: null }, detents: { classPropertyName: "detents", publicName: "detents", isSignal: true, isRequired: false, transformFunction: null }, showDragIndicator: { classPropertyName: "showDragIndicator", publicName: "showDragIndicator", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", dismissed: "dismissed" }, host: { properties: { "style.position": "\"absolute\"" } }, queries: [{ propertyName: "toolbarItems", predicate: UiToolbarItem, isSignal: true }], viewQueries: [{ propertyName: "sheet", first: true, predicate: ["sheet"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: `
|
|
1887
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.0", type: UiBottomSheet, isStandalone: true, selector: "ui-bottom-sheet", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, fitToContents: { classPropertyName: "fitToContents", publicName: "fitToContents", isSignal: true, isRequired: false, transformFunction: null }, detents: { classPropertyName: "detents", publicName: "detents", isSignal: true, isRequired: false, transformFunction: null }, showDragIndicator: { classPropertyName: "showDragIndicator", publicName: "showDragIndicator", isSignal: true, isRequired: false, transformFunction: null }, backgroundColor: { classPropertyName: "backgroundColor", publicName: "backgroundColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", dismissed: "dismissed" }, host: { properties: { "style.position": "\"absolute\"" } }, queries: [{ propertyName: "toolbarItems", predicate: UiToolbarItem, isSignal: true }], viewQueries: [{ propertyName: "sheet", first: true, predicate: ["sheet"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: `
|
|
1592
1888
|
<ng-template #content><ng-content /></ng-template>
|
|
1593
1889
|
@if (swiftUI) {
|
|
1594
1890
|
<ui-host style="position: absolute" pointerEvents="none" [style.width.px]="width()">
|
|
@@ -1601,14 +1897,17 @@ export class UiBottomSheet {
|
|
|
1601
1897
|
>
|
|
1602
1898
|
@if (mounted()) {
|
|
1603
1899
|
<ui-group [modifiers]="presentation()">
|
|
1604
|
-
@if (
|
|
1900
|
+
@if (stacked()) {
|
|
1605
1901
|
<ui-navigation-stack>
|
|
1606
|
-
<ui-
|
|
1902
|
+
<ui-zstack>
|
|
1903
|
+
<ui-toolbar [modifiers]="inlineTitle">
|
|
1904
|
+
<ui-spacer />
|
|
1905
|
+
<ui-slot name="content"><ng-content select="ui-toolbar-item" /></ui-slot>
|
|
1906
|
+
</ui-toolbar>
|
|
1607
1907
|
<ui-view-host layoutRoot [matchContents]="fits() || undefined">
|
|
1608
1908
|
<ui-bottom-sheet-content [style]="body()" [content]="content" />
|
|
1609
1909
|
</ui-view-host>
|
|
1610
|
-
|
|
1611
|
-
</ui-toolbar>
|
|
1910
|
+
</ui-zstack>
|
|
1612
1911
|
</ui-navigation-stack>
|
|
1613
1912
|
} @else {
|
|
1614
1913
|
<ui-view-host layoutRoot [matchContents]="fits() || undefined">
|
|
@@ -1624,6 +1923,7 @@ export class UiBottomSheet {
|
|
|
1624
1923
|
<ui-bottom-sheet-view
|
|
1625
1924
|
#sheet
|
|
1626
1925
|
[showDragHandle]="showDragIndicator()"
|
|
1926
|
+
[containerColor]="color()"
|
|
1627
1927
|
[skipPartiallyExpanded]="fits()"
|
|
1628
1928
|
(dismissRequest)="dismissRequested($event)"
|
|
1629
1929
|
>
|
|
@@ -1633,7 +1933,7 @@ export class UiBottomSheet {
|
|
|
1633
1933
|
</ui-bottom-sheet-view>
|
|
1634
1934
|
</ui-host>
|
|
1635
1935
|
}
|
|
1636
|
-
`, isInline: true, dependencies: [{ kind: "component", type: UiBottomSheetContent, selector: "ui-bottom-sheet-content", inputs: ["content"] }, { kind: "component", type: UiBottomSheetView, selector: "ui-bottom-sheet-view", inputs: ["isPresented", "fitToContents", "showDragHandle", "skipPartiallyExpanded"], outputs: ["isPresentedChange", "dismiss", "dismissRequest"] }, { kind: "component", type: UiGroup, selector: "ui-group", inputs: ["modifiers"] }, { kind: "component", type: UiHost, selector: "ui-host", inputs: ["matchContents", "ignoreSafeArea", "useViewportSizeMeasurement"] }, { kind: "component", type: UiNavigationStack, selector: "ui-navigation-stack", inputs: ["modifiers"] }, { kind: "component", type: UiSlot, selector: "ui-slot", inputs: ["name", "extraProps"] }, { kind: "component", type: UiToolbar, selector: "ui-toolbar", inputs: ["modifiers"] }, { kind: "component", type: UiViewHost, selector: "ui-view-host", inputs: ["matchContents", "layoutRoot", "modifiers"] }] });
|
|
1936
|
+
`, isInline: true, dependencies: [{ kind: "component", type: UiBottomSheetContent, selector: "ui-bottom-sheet-content", inputs: ["content"] }, { kind: "component", type: UiBottomSheetView, selector: "ui-bottom-sheet-view", inputs: ["isPresented", "fitToContents", "showDragHandle", "containerColor", "skipPartiallyExpanded"], outputs: ["isPresentedChange", "dismiss", "dismissRequest"] }, { kind: "component", type: UiGroup, selector: "ui-group", inputs: ["modifiers"] }, { kind: "component", type: UiHost, selector: "ui-host", inputs: ["matchContents", "ignoreSafeArea", "useViewportSizeMeasurement"] }, { kind: "component", type: UiNavigationStack, selector: "ui-navigation-stack", inputs: ["modifiers"] }, { kind: "component", type: UiSlot, selector: "ui-slot", inputs: ["name", "extraProps"] }, { kind: "component", type: UiSpacer, selector: "ui-spacer", inputs: ["modifiers"] }, { kind: "component", type: UiToolbar, selector: "ui-toolbar", inputs: ["modifiers"] }, { kind: "component", type: UiViewHost, selector: "ui-view-host", inputs: ["matchContents", "layoutRoot", "modifiers"] }, { kind: "component", type: UiZStack, selector: "ui-zstack", inputs: ["alignment", "modifiers"] }] });
|
|
1637
1937
|
}
|
|
1638
1938
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: UiBottomSheet, decorators: [{
|
|
1639
1939
|
type: Component,
|
|
@@ -1646,8 +1946,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImpor
|
|
|
1646
1946
|
UiHost,
|
|
1647
1947
|
UiNavigationStack,
|
|
1648
1948
|
UiSlot,
|
|
1949
|
+
UiSpacer,
|
|
1649
1950
|
UiToolbar,
|
|
1650
1951
|
UiViewHost,
|
|
1952
|
+
UiZStack,
|
|
1651
1953
|
],
|
|
1652
1954
|
template: `
|
|
1653
1955
|
<ng-template #content><ng-content /></ng-template>
|
|
@@ -1662,14 +1964,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImpor
|
|
|
1662
1964
|
>
|
|
1663
1965
|
@if (mounted()) {
|
|
1664
1966
|
<ui-group [modifiers]="presentation()">
|
|
1665
|
-
@if (
|
|
1967
|
+
@if (stacked()) {
|
|
1666
1968
|
<ui-navigation-stack>
|
|
1667
|
-
<ui-
|
|
1969
|
+
<ui-zstack>
|
|
1970
|
+
<ui-toolbar [modifiers]="inlineTitle">
|
|
1971
|
+
<ui-spacer />
|
|
1972
|
+
<ui-slot name="content"><ng-content select="ui-toolbar-item" /></ui-slot>
|
|
1973
|
+
</ui-toolbar>
|
|
1668
1974
|
<ui-view-host layoutRoot [matchContents]="fits() || undefined">
|
|
1669
1975
|
<ui-bottom-sheet-content [style]="body()" [content]="content" />
|
|
1670
1976
|
</ui-view-host>
|
|
1671
|
-
|
|
1672
|
-
</ui-toolbar>
|
|
1977
|
+
</ui-zstack>
|
|
1673
1978
|
</ui-navigation-stack>
|
|
1674
1979
|
} @else {
|
|
1675
1980
|
<ui-view-host layoutRoot [matchContents]="fits() || undefined">
|
|
@@ -1685,6 +1990,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImpor
|
|
|
1685
1990
|
<ui-bottom-sheet-view
|
|
1686
1991
|
#sheet
|
|
1687
1992
|
[showDragHandle]="showDragIndicator()"
|
|
1993
|
+
[containerColor]="color()"
|
|
1688
1994
|
[skipPartiallyExpanded]="fits()"
|
|
1689
1995
|
(dismissRequest)="dismissRequested($event)"
|
|
1690
1996
|
>
|
|
@@ -1699,5 +2005,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImpor
|
|
|
1699
2005
|
}]
|
|
1700
2006
|
}], ctorParameters: () => [], propDecorators: { sheet: [{ type: i0.ViewChild, args: ['sheet', { ...{
|
|
1701
2007
|
read: ElementRef,
|
|
1702
|
-
}, isSignal: true }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], fitToContents: [{ type: i0.Input, args: [{ isSignal: true, alias: "fitToContents", required: false }] }], detents: [{ type: i0.Input, args: [{ isSignal: true, alias: "detents", required: false }] }], showDragIndicator: [{ type: i0.Input, args: [{ isSignal: true, alias: "showDragIndicator", required: false }] }], dismissed: [{ type: i0.Output, args: ["dismissed"] }], toolbarItems: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => UiToolbarItem), { isSignal: true }] }] } });
|
|
2008
|
+
}, isSignal: true }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], fitToContents: [{ type: i0.Input, args: [{ isSignal: true, alias: "fitToContents", required: false }] }], detents: [{ type: i0.Input, args: [{ isSignal: true, alias: "detents", required: false }] }], showDragIndicator: [{ type: i0.Input, args: [{ isSignal: true, alias: "showDragIndicator", required: false }] }], backgroundColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "backgroundColor", required: false }] }], dismissed: [{ type: i0.Output, args: ["dismissed"] }], toolbarItems: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => UiToolbarItem), { isSignal: true }] }] } });
|
|
1703
2009
|
//# sourceMappingURL=expo-ui-components.js.map
|