@nativescript-community/ui-material-bottomsheet 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +1569 -0
  2. package/LICENSE +201 -0
  3. package/README.md +192 -0
  4. package/angular/bottomsheet.module.d.ts +10 -0
  5. package/angular/bottomsheet.service.d.ts +28 -0
  6. package/angular/bundles/nativescript-community-ui-material-bottomsheet-angular.umd.js +179 -0
  7. package/angular/bundles/nativescript-community-ui-material-bottomsheet-angular.umd.js.map +1 -0
  8. package/angular/bundles/nativescript-community-ui-material-bottomsheet-angular.umd.min.js +2 -0
  9. package/angular/bundles/nativescript-community-ui-material-bottomsheet-angular.umd.min.js.map +1 -0
  10. package/angular/esm2015/bottomsheet.module.js +26 -0
  11. package/angular/esm2015/bottomsheet.service.js +109 -0
  12. package/angular/esm2015/index.js +3 -0
  13. package/angular/esm2015/nativescript-community-ui-material-bottomsheet-angular.js +2 -0
  14. package/angular/fesm2015/nativescript-community-ui-material-bottomsheet-angular.js +135 -0
  15. package/angular/fesm2015/nativescript-community-ui-material-bottomsheet-angular.js.map +1 -0
  16. package/angular/index.d.ts +2 -0
  17. package/angular/nativescript-community-ui-material-bottomsheet-angular.d.ts +2 -0
  18. package/angular/package.json +16 -0
  19. package/bottomsheet-common.d.ts +35 -0
  20. package/bottomsheet-common.js +94 -0
  21. package/bottomsheet-common.js.map +1 -0
  22. package/bottomsheet.android.d.ts +10 -0
  23. package/bottomsheet.android.js +143 -0
  24. package/bottomsheet.android.js.map +1 -0
  25. package/bottomsheet.d.ts +89 -0
  26. package/bottomsheet.ios.d.ts +17 -0
  27. package/bottomsheet.ios.js +360 -0
  28. package/bottomsheet.ios.js.map +1 -0
  29. package/package.json +51 -0
  30. package/platforms/android/include.gradle +8 -0
  31. package/platforms/android/java/com/nativescript/material/bottomsheet/BottomSheetDialog.java +38 -0
  32. package/platforms/android/java/com/nativescript/material/bottomsheet/BottomSheetDialogFragment.java +73 -0
  33. package/platforms/android/ui_material_bottomsheet.aar +0 -0
  34. package/platforms/ios/Podfile +1 -0
  35. package/pnpm-lock.yaml +90 -0
  36. package/vue/index.d.ts +16 -0
  37. package/vue/index.js +51 -0
  38. package/vue/index.js.map +1 -0
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@nativescript-community/ui-material-bottomsheet",
3
+ "version": "6.0.0",
4
+ "description": "Material Design Bottom Sheets slide up from the bottom of the screen to reveal more content. Bottom sheets integrate with the app to display supporting content or present deep-linked content from other apps.",
5
+ "main": "./bottomsheet",
6
+ "sideEffects": false,
7
+ "typings": "./bottomsheet.d.ts",
8
+ "scripts": {
9
+ "tsc": "../../node_modules/.bin/cpy ../../src/bottomsheet/bottomsheet.d.ts ./ && ../../node_modules/.bin/tsc --skipLibCheck -d",
10
+ "tsc-win": "..\\..\\node_modules\\.bin\\cpy ..\\..\\src\\bottomsheet\\bottomsheet.d.ts .\\ && ..\\..\\node_modules\\.bin\\tsc --skipLibCheck -d",
11
+ "build": "npm run tsc",
12
+ "build.win": "npm run tsc-win",
13
+ "build.all": "npm run build && npm run build.angular",
14
+ "build.all.win": "npm run build.win && npm run build.angular.win",
15
+ "build.angular": "../../node_modules/.bin/ng-packagr -p ../../src/bottomsheet/angular/package.json -c ../../src/bottomsheet/angular/tsconfig.json",
16
+ "build.angular.win": "..\\..\\node_modules\\.bin\\ng-packagr -p ..\\..\\src\\bottomsheet\\angular\\package.json -c ..\\..\\src\\bottomsheet\\angular\\tsconfig.json",
17
+ "clean": "../../node_modules/.bin/rimraf ./*.d.ts ./*.js ./*.js.map"
18
+ },
19
+ "nativescript": {
20
+ "platforms": {
21
+ "android": "6.2.0",
22
+ "ios": "6.2.0"
23
+ }
24
+ },
25
+ "keywords": [
26
+ "NativeScript",
27
+ "JavaScript",
28
+ "Android",
29
+ "iOS",
30
+ "Vue",
31
+ "Angular",
32
+ "preview|https://raw.githubusercontent.com/nativescript-community/ui-material-components/master/images/demo-bottom-sheet.png"
33
+ ],
34
+ "author": {
35
+ "name": "Martin Guillon",
36
+ "email": "martin@akylas.fr"
37
+ },
38
+ "bugs": {
39
+ "url": "https://github.com/nativescript-community/ui-material-components/issues"
40
+ },
41
+ "license": "Apache-2.0",
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "https://github.com/nativescript-community/ui-material-components/tree/master/packages/bottomsheet"
45
+ },
46
+ "readmeFilename": "README.md",
47
+ "dependencies": {
48
+ "@nativescript-community/ui-material-core": "^6.0.0"
49
+ },
50
+ "gitHead": "f4a17600487dd826a4a581f2ebde8cf6457710ca"
51
+ }
@@ -0,0 +1,8 @@
1
+
2
+ dependencies {
3
+ def androidXAppCompatVersion = project.hasProperty("androidXAppCompatVersion") ? project.androidXAppCompatVersion : "1.2.0"
4
+ def androidXMaterial = project.hasProperty("androidXMaterial") ? project.androidXMaterial : "1.2.1"
5
+
6
+ compile "androidx.appcompat:appcompat:$androidXAppCompatVersion"
7
+ compile "com.google.android.material:material:$androidXMaterial"
8
+ }
@@ -0,0 +1,38 @@
1
+ package com.nativescript.material.bottomsheet;
2
+
3
+ import android.content.Context;
4
+ import android.view.ViewGroup;
5
+ import android.view.View;
6
+
7
+ public class BottomSheetDialog extends com.google.android.material.bottomsheet.BottomSheetDialog {
8
+ public interface BottomSheetDialogListener {
9
+ boolean onBackPressed(BottomSheetDialog dialog);
10
+
11
+ void onDetachedFromWindow(BottomSheetDialog dialog);
12
+ }
13
+
14
+ BottomSheetDialogListener listener;
15
+
16
+ public BottomSheetDialog(Context context, int themeResId) {
17
+ super(context, themeResId);
18
+ }
19
+
20
+ public void setListener(BottomSheetDialogListener listener) {
21
+ this.listener = listener;
22
+ }
23
+
24
+ @Override
25
+ public void onBackPressed() {
26
+ if (listener == null || !listener.onBackPressed(this)) {
27
+ super.onBackPressed();
28
+ }
29
+ }
30
+
31
+ public void onDetachedFromWindow() {
32
+ super.onDetachedFromWindow();
33
+ if (listener != null) {
34
+ listener.onDetachedFromWindow(this);
35
+ }
36
+ }
37
+
38
+ }
@@ -0,0 +1,73 @@
1
+ package com.nativescript.material.bottomsheet;
2
+
3
+ import android.content.Context;
4
+ import android.view.ViewGroup;
5
+ import android.view.View;
6
+
7
+ public class BottomSheetDialogFragment extends com.google.android.material.bottomsheet.BottomSheetDialogFragment {
8
+ public interface BottomSheetDialogFragmentListener {
9
+ android.app.Dialog onCreateDialog(BottomSheetDialogFragment fragment, android.os.Bundle savedInstanceState);
10
+
11
+ android.view.View onCreateView(BottomSheetDialogFragment fragment, android.view.LayoutInflater inflater, android.view.ViewGroup container,
12
+ android.os.Bundle savedInstanceState);
13
+
14
+ void onStart(BottomSheetDialogFragment fragment);
15
+
16
+ void onDismiss(BottomSheetDialogFragment fragment, android.content.DialogInterface dialog);
17
+
18
+ void onDestroy(BottomSheetDialogFragment fragment);
19
+ }
20
+
21
+ BottomSheetDialogFragmentListener listener;
22
+
23
+ public BottomSheetDialogFragment() {
24
+ super();
25
+ }
26
+
27
+ public void setListener(BottomSheetDialogFragmentListener listener) {
28
+ this.listener = listener;
29
+ }
30
+
31
+ @Override
32
+ public android.app.Dialog onCreateDialog(android.os.Bundle savedInstanceState) {
33
+ if (listener != null) {
34
+ return listener.onCreateDialog(this, savedInstanceState);
35
+ }
36
+ return super.onCreateDialog(savedInstanceState);
37
+ }
38
+
39
+ @Override
40
+ public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container,
41
+ android.os.Bundle savedInstanceState) {
42
+ if (listener != null) {
43
+ return listener.onCreateView(this, inflater, container, savedInstanceState);
44
+ }
45
+
46
+ return super.onCreateView(inflater, container, savedInstanceState);
47
+ }
48
+
49
+ @Override
50
+ public void onStart() {
51
+ super.onStart();
52
+ if (listener != null) {
53
+ listener.onStart(this);
54
+ }
55
+ }
56
+
57
+ @Override
58
+ public void onDismiss(android.content.DialogInterface dialog) {
59
+ super.onDismiss(dialog);
60
+ if (listener != null) {
61
+ listener.onDismiss(this, dialog);
62
+ }
63
+ }
64
+
65
+ @Override
66
+ public void onDestroy() {
67
+ super.onDestroy();
68
+ if (listener != null) {
69
+ listener.onDestroy(this);
70
+ }
71
+ }
72
+
73
+ }
@@ -0,0 +1 @@
1
+ pod 'MaterialComponents/BottomSheet+ShapeThemer'
package/pnpm-lock.yaml ADDED
@@ -0,0 +1,90 @@
1
+ dependencies:
2
+ '@nativescript-community/ui-material-core': 5.2.3
3
+ lockfileVersion: 5.2
4
+ packages:
5
+ /@nativescript-community/ui-material-core/5.2.3:
6
+ dependencies:
7
+ '@nativescript/hook': 2.0.0
8
+ dev: false
9
+ requiresBuild: true
10
+ resolution:
11
+ integrity: sha512-Wy/MFuYhhIV6ec4Nm+Yb5/rly7au2Fo1uU0bGCHiMTk/xPfhpTORTyX42El/5VaDluhqRIG1I75KshBUMhv36A==
12
+ /@nativescript/hook/2.0.0:
13
+ dependencies:
14
+ glob: 7.1.6
15
+ mkdirp: 1.0.4
16
+ dev: false
17
+ resolution:
18
+ integrity: sha512-v3Hj3Zpd69sQJfFpDNXonV0EjO1a2OL4l48wlo1Ycsqk4r7RY822d/irFTjt0LllRG0OcdEGgfG6wKb0YgPyHw==
19
+ /balanced-match/1.0.0:
20
+ dev: false
21
+ resolution:
22
+ integrity: sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
23
+ /brace-expansion/1.1.11:
24
+ dependencies:
25
+ balanced-match: 1.0.0
26
+ concat-map: 0.0.1
27
+ dev: false
28
+ resolution:
29
+ integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
30
+ /concat-map/0.0.1:
31
+ dev: false
32
+ resolution:
33
+ integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
34
+ /fs.realpath/1.0.0:
35
+ dev: false
36
+ resolution:
37
+ integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
38
+ /glob/7.1.6:
39
+ dependencies:
40
+ fs.realpath: 1.0.0
41
+ inflight: 1.0.6
42
+ inherits: 2.0.4
43
+ minimatch: 3.0.4
44
+ once: 1.4.0
45
+ path-is-absolute: 1.0.1
46
+ dev: false
47
+ resolution:
48
+ integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==
49
+ /inflight/1.0.6:
50
+ dependencies:
51
+ once: 1.4.0
52
+ wrappy: 1.0.2
53
+ dev: false
54
+ resolution:
55
+ integrity: sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=
56
+ /inherits/2.0.4:
57
+ dev: false
58
+ resolution:
59
+ integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
60
+ /minimatch/3.0.4:
61
+ dependencies:
62
+ brace-expansion: 1.1.11
63
+ dev: false
64
+ resolution:
65
+ integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
66
+ /mkdirp/1.0.4:
67
+ dev: false
68
+ engines:
69
+ node: '>=10'
70
+ hasBin: true
71
+ resolution:
72
+ integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
73
+ /once/1.4.0:
74
+ dependencies:
75
+ wrappy: 1.0.2
76
+ dev: false
77
+ resolution:
78
+ integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
79
+ /path-is-absolute/1.0.1:
80
+ dev: false
81
+ engines:
82
+ node: '>=0.10.0'
83
+ resolution:
84
+ integrity: sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
85
+ /wrappy/1.0.2:
86
+ dev: false
87
+ resolution:
88
+ integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
89
+ specifiers:
90
+ '@nativescript-community/ui-material-core': ^5.2.3
package/vue/index.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ import { BottomSheetOptions } from '../bottomsheet';
2
+ import { Vue } from 'vue/types/vue';
3
+ import { View } from '@nativescript/core';
4
+ export interface VueBottomSheetOptions extends Omit<BottomSheetOptions, 'view'> {
5
+ props?: any;
6
+ }
7
+ declare module 'nativescript-vue' {
8
+ interface NativeScriptVue<V = View> extends Vue {
9
+ $showBottomSheet(component: typeof Vue, options?: VueBottomSheetOptions): Promise<any>;
10
+ $closeBottomSheet(...args: any[]): any;
11
+ }
12
+ }
13
+ declare const BottomSheetPlugin: {
14
+ install(Vue: any): void;
15
+ };
16
+ export default BottomSheetPlugin;
package/vue/index.js ADDED
@@ -0,0 +1,51 @@
1
+ let sequentialCounter = 0;
2
+ function serializeModalOptions(options) {
3
+ if (process.env.NODE_ENV === 'production') {
4
+ return null;
5
+ }
6
+ const allowed = ['fullscreen'];
7
+ return Object.keys(options)
8
+ .filter(key => allowed.includes(key))
9
+ .map(key => `${key}: ${options[key]}`)
10
+ .concat(`uid: ${++sequentialCounter}`)
11
+ .join(', ') + '_bottomsheet';
12
+ }
13
+ const BottomSheetPlugin = {
14
+ install(Vue) {
15
+ Vue.prototype.$showBottomSheet = function (component, options) {
16
+ return new Promise((resolve) => {
17
+ let resolved = false;
18
+ let navEntryInstance = new Vue({
19
+ name: 'BottomSheetEntry',
20
+ parent: this.$root,
21
+ render: h => h(component, {
22
+ props: options.props,
23
+ key: serializeModalOptions(options)
24
+ })
25
+ });
26
+ navEntryInstance.$mount();
27
+ this.nativeView.showBottomSheet(Object.assign({}, options, {
28
+ view: navEntryInstance.nativeView,
29
+ closeCallback: (...args) => {
30
+ if (resolved) {
31
+ return;
32
+ }
33
+ resolved = true;
34
+ if (navEntryInstance && navEntryInstance.nativeView) {
35
+ options.closeCallback && options.closeCallback.apply(undefined, args);
36
+ resolve(...args);
37
+ navEntryInstance.$emit('bottomsheet:close');
38
+ navEntryInstance.$destroy();
39
+ navEntryInstance = null;
40
+ }
41
+ }
42
+ }));
43
+ });
44
+ };
45
+ Vue.prototype.$closeBottomSheet = function (...args) {
46
+ (this.nativeView).closeBottomSheet.apply(this.nativeView, args);
47
+ };
48
+ }
49
+ };
50
+ export default BottomSheetPlugin;
51
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["vue/index.ts"],"names":[],"mappings":"AAgBA,IAAI,iBAAiB,GAAG,CAAC,CAAC;AAE1B,SAAS,qBAAqB,CAAC,OAAO;IAClC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;QACvC,OAAO,IAAI,CAAC;KACf;IAED,MAAM,OAAO,GAAG,CAAC,YAAY,CAAC,CAAC;IAE/B,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;SACtB,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;SACpC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;SACrC,MAAM,CAAC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;SACrC,IAAI,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC;AACrC,CAAC;AAED,MAAM,iBAAiB,GAAG;IACtB,OAAO,CAAC,GAAG;QACP,GAAG,CAAC,SAAS,CAAC,gBAAgB,GAAG,UAAS,SAAS,EAAE,OAA8B;YAC/E,OAAO,IAAI,OAAO,CAAC,CAAC,OAA0B,EAAE,EAAE;gBAC9C,IAAI,QAAQ,GAAG,KAAK,CAAC;gBACrB,IAAI,gBAAgB,GAAG,IAAI,GAAG,CAAC;oBAC3B,IAAI,EAAE,kBAAkB;oBACxB,MAAM,EAAE,IAAI,CAAC,KAAK;oBAClB,MAAM,EAAE,CAA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