@ng-native/expo 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/expo-ui-components.d.ts +177 -9
- package/dist/expo-ui-components.js +311 -2
- package/dist/expo-ui-components.js.map +1 -1
- package/dist/expo-ui.js +5 -0
- package/dist/expo-ui.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/ui-bottom-sheet-content.d.ts +18 -0
- package/dist/ui-bottom-sheet-content.js +29 -0
- package/dist/ui-bottom-sheet-content.js.map +1 -0
- package/dist/ui-bottom-sheet-view.d.ts +25 -0
- package/dist/ui-bottom-sheet-view.js +55 -0
- package/dist/ui-bottom-sheet-view.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<ui-bottom-sheet-view>`: `@expo/ui`'s sheet itself, with each platform's props typed.
|
|
3
|
+
*
|
|
4
|
+
* `UiBottomSheet` in `expo-ui-components.ts` is the component an app uses, and this is the native
|
|
5
|
+
* view inside it: SwiftUI's `BottomSheetView` on iOS, Compose's `ModalBottomSheetView` on Android.
|
|
6
|
+
* It has an element name of its own because `ui-bottom-sheet` is that component's, and a
|
|
7
|
+
* component's template takes its own selector to be the component again.
|
|
8
|
+
*
|
|
9
|
+
* The two views share no prop. An input left unset never reaches native, so the component sets
|
|
10
|
+
* the ones the platform reads. The events are outputs for their type only, as with the other
|
|
11
|
+
* `@expo/ui` components: the element's own event is what arrives.
|
|
12
|
+
*/
|
|
13
|
+
import { Component, ElementRef, inject, input, output } from '@angular/core';
|
|
14
|
+
import { keepNativeView } from '@ng-native/fabric';
|
|
15
|
+
import * as i0 from "@angular/core";
|
|
16
|
+
export class UiBottomSheetView {
|
|
17
|
+
/** SwiftUI: whether the sheet is presented. The view stays in the tree either way. */
|
|
18
|
+
isPresented = input(/* @ts-ignore */
|
|
19
|
+
...(ngDevMode ? [undefined, { debugName: "isPresented" }] : /* istanbul ignore next */ []));
|
|
20
|
+
/** SwiftUI: the sheet's one detent is the height of its content. */
|
|
21
|
+
fitToContents = input(/* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [undefined, { debugName: "fitToContents" }] : /* istanbul ignore next */ []));
|
|
23
|
+
/** Compose: whether the drag handle is drawn. */
|
|
24
|
+
showDragHandle = input(/* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [undefined, { debugName: "showDragHandle" }] : /* istanbul ignore next */ []));
|
|
26
|
+
/** Compose: the sheet opens at its full height rather than resting at half the screen's. */
|
|
27
|
+
skipPartiallyExpanded = input(/* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [undefined, { debugName: "skipPartiallyExpanded" }] : /* istanbul ignore next */ []));
|
|
29
|
+
/** SwiftUI: the user dismissed the sheet, or it was presented by something other than the prop. */
|
|
30
|
+
isPresentedChange = output();
|
|
31
|
+
/** SwiftUI: the sheet has finished dismissing, whoever dismissed it. */
|
|
32
|
+
dismiss = output();
|
|
33
|
+
/** Compose: the user dismissed the sheet, which stays until it leaves the tree. */
|
|
34
|
+
dismissRequest = output();
|
|
35
|
+
constructor() {
|
|
36
|
+
// The host is the registered native view, not a plain one: see `keepNativeView`.
|
|
37
|
+
keepNativeView(inject(ElementRef).nativeElement);
|
|
38
|
+
}
|
|
39
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: UiBottomSheetView, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
40
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.0", type: UiBottomSheetView, isStandalone: true, selector: "ui-bottom-sheet-view", inputs: { isPresented: { classPropertyName: "isPresented", publicName: "isPresented", isSignal: true, isRequired: false, transformFunction: null }, fitToContents: { classPropertyName: "fitToContents", publicName: "fitToContents", isSignal: true, isRequired: false, transformFunction: null }, showDragHandle: { classPropertyName: "showDragHandle", publicName: "showDragHandle", isSignal: true, isRequired: false, transformFunction: null }, skipPartiallyExpanded: { classPropertyName: "skipPartiallyExpanded", publicName: "skipPartiallyExpanded", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isPresentedChange: "isPresentedChange", dismiss: "dismiss", dismissRequest: "dismissRequest" }, host: { properties: { "isPresented": "isPresented()", "fitToContents": "fitToContents()", "showDragHandle": "showDragHandle()", "skipPartiallyExpanded": "skipPartiallyExpanded()" } }, ngImport: i0, template: '<ng-content />', isInline: true });
|
|
41
|
+
}
|
|
42
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: UiBottomSheetView, decorators: [{
|
|
43
|
+
type: Component,
|
|
44
|
+
args: [{
|
|
45
|
+
selector: 'ui-bottom-sheet-view',
|
|
46
|
+
template: '<ng-content />',
|
|
47
|
+
host: {
|
|
48
|
+
'[isPresented]': 'isPresented()',
|
|
49
|
+
'[fitToContents]': 'fitToContents()',
|
|
50
|
+
'[showDragHandle]': 'showDragHandle()',
|
|
51
|
+
'[skipPartiallyExpanded]': 'skipPartiallyExpanded()',
|
|
52
|
+
},
|
|
53
|
+
}]
|
|
54
|
+
}], ctorParameters: () => [], propDecorators: { isPresented: [{ type: i0.Input, args: [{ isSignal: true, alias: "isPresented", required: false }] }], fitToContents: [{ type: i0.Input, args: [{ isSignal: true, alias: "fitToContents", required: false }] }], showDragHandle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showDragHandle", required: false }] }], skipPartiallyExpanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "skipPartiallyExpanded", required: false }] }], isPresentedChange: [{ type: i0.Output, args: ["isPresentedChange"] }], dismiss: [{ type: i0.Output, args: ["dismiss"] }], dismissRequest: [{ type: i0.Output, args: ["dismissRequest"] }] } });
|
|
55
|
+
//# sourceMappingURL=ui-bottom-sheet-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-bottom-sheet-view.js","sourceRoot":"","sources":["../src/ui-bottom-sheet-view.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAA6B,cAAc,EAAE,MAAM,mBAAmB,CAAC;;AAe9E,MAAM,OAAO,iBAAiB;IAC5B,sFAAsF;IAC7E,WAAW,GAAG,KAAK;+FAAW,CAAC;IACxC,oEAAoE;IAC3D,aAAa,GAAG,KAAK;iGAAW,CAAC;IAC1C,iDAAiD;IACxC,cAAc,GAAG,KAAK;kGAAW,CAAC;IAC3C,4FAA4F;IACnF,qBAAqB,GAAG,KAAK;yGAAW,CAAC;IAClD,mGAAmG;IAC1F,iBAAiB,GAAG,MAAM,EAA+B,CAAC;IACnE,wEAAwE;IAC/D,OAAO,GAAG,MAAM,EAA+C,CAAC;IACzE,mFAAmF;IAC1E,cAAc,GAAG,MAAM,EAA+C,CAAC;IAEhF;QACE,iFAAiF;QACjF,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,aAAa,CAAC,CAAC;IACnD,CAAC;uGAnBU,iBAAiB;2FAAjB,iBAAiB,o9BARlB,gBAAgB;;2FAQf,iBAAiB;kBAV7B,SAAS;mBAAC;oBACT,QAAQ,EAAE,sBAAsB;oBAChC,QAAQ,EAAE,gBAAgB;oBAC1B,IAAI,EAAE;wBACJ,eAAe,EAAE,eAAe;wBAChC,iBAAiB,EAAE,iBAAiB;wBACpC,kBAAkB,EAAE,kBAAkB;wBACtC,yBAAyB,EAAE,yBAAyB;qBACrD;iBACF","sourcesContent":["/**\n * `<ui-bottom-sheet-view>`: `@expo/ui`'s sheet itself, with each platform's props typed.\n *\n * `UiBottomSheet` in `expo-ui-components.ts` is the component an app uses, and this is the native\n * view inside it: SwiftUI's `BottomSheetView` on iOS, Compose's `ModalBottomSheetView` on Android.\n * It has an element name of its own because `ui-bottom-sheet` is that component's, and a\n * component's template takes its own selector to be the component again.\n *\n * The two views share no prop. An input left unset never reaches native, so the component sets\n * the ones the platform reads. The events are outputs for their type only, as with the other\n * `@expo/ui` components: the element's own event is what arrives.\n */\nimport { Component, ElementRef, inject, input, output } from '@angular/core';\nimport { type NativeSyntheticEvent, keepNativeView } from '@ng-native/fabric';\n\n/** What SwiftUI's sheet sends when the user dismisses it: that it is no longer presented. */\nexport type UiBottomSheetPresentedEvent = NativeSyntheticEvent<{ readonly isPresented: boolean }>;\n\n@Component({\n selector: 'ui-bottom-sheet-view',\n template: '<ng-content />',\n host: {\n '[isPresented]': 'isPresented()',\n '[fitToContents]': 'fitToContents()',\n '[showDragHandle]': 'showDragHandle()',\n '[skipPartiallyExpanded]': 'skipPartiallyExpanded()',\n },\n})\nexport class UiBottomSheetView {\n /** SwiftUI: whether the sheet is presented. The view stays in the tree either way. */\n readonly isPresented = input<boolean>();\n /** SwiftUI: the sheet's one detent is the height of its content. */\n readonly fitToContents = input<boolean>();\n /** Compose: whether the drag handle is drawn. */\n readonly showDragHandle = input<boolean>();\n /** Compose: the sheet opens at its full height rather than resting at half the screen's. */\n readonly skipPartiallyExpanded = input<boolean>();\n /** SwiftUI: the user dismissed the sheet, or it was presented by something other than the prop. */\n readonly isPresentedChange = output<UiBottomSheetPresentedEvent>();\n /** SwiftUI: the sheet has finished dismissing, whoever dismissed it. */\n readonly dismiss = output<NativeSyntheticEvent<Record<string, never>>>();\n /** Compose: the user dismissed the sheet, which stays until it leaves the tree. */\n readonly dismissRequest = output<NativeSyntheticEvent<Record<string, never>>>();\n\n constructor() {\n // The host is the registered native view, not a plain one: see `keepNativeView`.\n keepNativeView(inject(ElementRef).nativeElement);\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-native/expo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Expo modules as Angular services for Angular Native, plus registerExpoView for a module's native view.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
"access": "public"
|
|
207
207
|
},
|
|
208
208
|
"dependencies": {
|
|
209
|
-
"@ng-native/fabric": "0.
|
|
209
|
+
"@ng-native/fabric": "0.6.0"
|
|
210
210
|
},
|
|
211
211
|
"nx": {
|
|
212
212
|
"tags": [
|