@nstudio/nativescript-loading-indicator 3.0.4 → 4.1.2
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/LICENSE +0 -0
- package/README.md +18 -34
- package/common.d.ts +83 -0
- package/{loading-indicator.common.js → common.js} +3 -5
- package/common.js.map +1 -0
- package/{loading-indicator.android.d.ts → index.android.d.ts} +5 -2
- package/index.android.js +547 -0
- package/index.android.js.map +1 -0
- package/index.d.ts +103 -102
- package/{loading-indicator.ios.d.ts → index.ios.d.ts} +2 -2
- package/{loading-indicator.ios.js → index.ios.js} +32 -33
- package/index.ios.js.map +1 -0
- package/package.json +16 -62
- package/platforms/android/AndroidManifest.xml +2 -0
- package/platforms/android/nativescript_loading_indicator.aar +0 -0
- package/platforms/android/res/drawable/circle_shape.xml +6 -0
- package/platforms/android/res/drawable/circular_progress_bar.xml +18 -0
- package/platforms/android/res/drawable/circular_progress_bar_thick.xml +18 -0
- package/loading-indicator.android.js +0 -531
- package/loading-indicator.common.d.ts +0 -38
- package/references.d.ts +0 -3
- package/typings/objc!MBProgressHUD.d.ts +0 -240
package/LICENSE
CHANGED
File without changes
|
package/README.md
CHANGED
@@ -6,44 +6,28 @@ NativeScript-Loading-Indicator is a plugin for NativeScript which overlays a loa
|
|
6
6
|
</h4>
|
7
7
|
|
8
8
|
<p align="center">
|
9
|
-
<a href="https://www.npmjs.com/package/@nstudio/nativescript-loading-indicator">
|
10
|
-
<img src="https://github.com/nstudio/nativescript-loading-indicator/workflows/Build%20CI/badge.svg" alt="Action Build">
|
11
|
-
</a>
|
12
9
|
<a href="https://www.npmjs.com/package/@nstudio/nativescript-loading-indicator">
|
13
10
|
<img src="https://img.shields.io/npm/v/@nstudio/nativescript-loading-indicator.svg" alt="npm">
|
14
11
|
</a>
|
15
12
|
<a href="https://www.npmjs.com/package/@nstudio/nativescript-loading-indicator">
|
16
13
|
<img src="https://img.shields.io/npm/dt/@nstudio/nativescript-loading-indicator.svg?label=npm%20downloads" alt="npm">
|
17
14
|
</a>
|
18
|
-
<a href="https://github.com/nstudio/nativescript-loading-indicator/stargazers">
|
19
|
-
<img src="https://img.shields.io/github/stars/nstudio/nativescript-loading-indicator.svg" alt="stars">
|
20
|
-
</a>
|
21
|
-
<a href="https://github.com/nstudio/nativescript-loading-indicator/network">
|
22
|
-
<img src="https://img.shields.io/github/forks/nstudio/nativescript-loading-indicator.svg" alt="forks">
|
23
|
-
</a>
|
24
|
-
<a href="https://github.com/nstudio/nativescript-loading-indicator/blob/master/LICENSE">
|
25
|
-
<img src="https://img.shields.io/github/license/nstudio/nativescript-loading-indicator.svg" alt="license">
|
26
|
-
</a>
|
27
|
-
<a href="http://nstudio.io">
|
28
|
-
<img src="https://github.com/nstudio/media/blob/master/images/nstudio-banner.png?raw=true" alt="nStudio banner">
|
29
|
-
</a>
|
30
|
-
<h5 align="center">Do you need assistance on your project or plugin? Contact the nStudio team anytime at <a href="mailto:team@nstudio.io">team@nstudio.io</a> to get up to speed with the best practices in mobile and web app development.
|
31
|
-
</h5>
|
32
|
-
|
33
15
|
</p>
|
34
16
|
|
35
17
|
---
|
36
18
|
|
37
19
|
## Installation
|
38
20
|
|
39
|
-
## NativeScript
|
21
|
+
## NativeScript 7+:
|
22
|
+
|
40
23
|
```bash
|
41
|
-
|
24
|
+
npm install @nstudio/nativescript-loading-indicator
|
42
25
|
```
|
43
26
|
|
44
|
-
## NativeScript lower than
|
27
|
+
## NativeScript lower than 7:
|
28
|
+
|
45
29
|
```bash
|
46
|
-
|
30
|
+
npm install @nstudio/nativescript-loading-indicator@3.0.x
|
47
31
|
```
|
48
32
|
|
49
33
|
## Screenshots
|
@@ -54,7 +38,7 @@ tns plugin add @nstudio/nativescript-loading-indicator@2.0.5
|
|
54
38
|
|
55
39
|
| | | | |
|
56
40
|
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
|
57
|
-
| <img src="
|
41
|
+
| <img src="https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/master/screenshots/ios/1.png" style="max-width:200px" alt="iOS"> | <img src="https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/master/screenshots/ios/2.png" style="max-width:200px" alt="iOS"> | <img src="./screenshots/ios/3.png" style="max-width:200px" alt="iOS"> | <img src="./screenshots/ios/4.png" style="max-width:200px" alt="iOS"> |
|
58
42
|
|
59
43
|
<!-- <img src="./screenshots/ios/1.png" style="max-width:200px" alt="iOS Example 1">
|
60
44
|
<img src="./screenshots/ios/2.png" style="max-width:200px" alt="iOS Example 2">
|
@@ -69,7 +53,7 @@ tns plugin add @nstudio/nativescript-loading-indicator@2.0.5
|
|
69
53
|
|
70
54
|
| | | | |
|
71
55
|
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
|
72
|
-
| <img src="
|
56
|
+
| <img src="https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/master/screenshots/android/1.png" style="max-width:200px" alt="Android"> | <img src="https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/master/screenshots/android/2.png" style="max-width:200px" alt="Android"> | <img src="https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/master/screenshots/android/3.png" style="max-width:200px" alt="Android"> | <img src="https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/master/screenshots/android/4.png" style="max-width:200px" alt="Android"> |
|
73
57
|
|
74
58
|
</p>
|
75
59
|
|
@@ -81,7 +65,7 @@ tns plugin add @nstudio/nativescript-loading-indicator@2.0.5
|
|
81
65
|
import {
|
82
66
|
LoadingIndicator,
|
83
67
|
Mode,
|
84
|
-
OptionsCommon
|
68
|
+
OptionsCommon,
|
85
69
|
} from '@nstudio/nativescript-loading-indicator';
|
86
70
|
|
87
71
|
const indicator = new LoadingIndicator();
|
@@ -102,14 +86,14 @@ const options: OptionsCommon = {
|
|
102
86
|
android: {
|
103
87
|
view: someStackLayout.android, // Target view to show on top of (Defaults to entire window)
|
104
88
|
cancelable: true,
|
105
|
-
cancelListener: function(dialog) {
|
89
|
+
cancelListener: function (dialog) {
|
106
90
|
console.log('Loading cancelled');
|
107
|
-
}
|
91
|
+
},
|
108
92
|
},
|
109
93
|
ios: {
|
110
94
|
view: someButton.ios, // Target view to show on top of (Defaults to entire window)
|
111
|
-
square: false
|
112
|
-
}
|
95
|
+
square: false,
|
96
|
+
},
|
113
97
|
};
|
114
98
|
|
115
99
|
indicator.show(options);
|
@@ -145,13 +129,13 @@ const options = {
|
|
145
129
|
android: {
|
146
130
|
view: android.view.View, // Target view to show on top of (Defaults to entire window)
|
147
131
|
cancelable: true,
|
148
|
-
cancelListener: function(dialog) {
|
132
|
+
cancelListener: function (dialog) {
|
149
133
|
console.log('Loading cancelled');
|
150
|
-
}
|
134
|
+
},
|
151
135
|
},
|
152
136
|
ios: {
|
153
|
-
view: UIView // Target view to show on top of (Defaults to entire window)
|
154
|
-
}
|
137
|
+
view: UIView, // Target view to show on top of (Defaults to entire window)
|
138
|
+
},
|
155
139
|
};
|
156
140
|
|
157
141
|
loader.show(options); // options is optional
|
@@ -272,6 +256,6 @@ export enum Mode {
|
|
272
256
|
DeterminateHorizontalBar = 2,
|
273
257
|
AnnularDeterminate = 3,
|
274
258
|
CustomView = 4,
|
275
|
-
Text = 5
|
259
|
+
Text = 5,
|
276
260
|
}
|
277
261
|
```
|
package/common.d.ts
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
export interface OptionsCommon {
|
2
|
+
/**
|
3
|
+
* Message in the loading indicator.
|
4
|
+
*/
|
5
|
+
message?: string;
|
6
|
+
/**
|
7
|
+
* Details message in the loading indicator.
|
8
|
+
*/
|
9
|
+
details?: string;
|
10
|
+
/**
|
11
|
+
* Color of the message text.
|
12
|
+
*/
|
13
|
+
color?: string;
|
14
|
+
/**
|
15
|
+
* Background color of the loading indicator.
|
16
|
+
*/
|
17
|
+
backgroundColor?: string;
|
18
|
+
/**
|
19
|
+
* Progress of the indicator when not using CustomView or Text Mode.
|
20
|
+
*/
|
21
|
+
progress?: number;
|
22
|
+
/**
|
23
|
+
* Margin for the message/indicator to the edge of the bezel.
|
24
|
+
*/
|
25
|
+
margin?: number;
|
26
|
+
/**
|
27
|
+
* Set true to allow user interaction.
|
28
|
+
*/
|
29
|
+
userInteractionEnabled?: boolean;
|
30
|
+
/**
|
31
|
+
* Dim the background behind the indicator.
|
32
|
+
*/
|
33
|
+
dimBackground?: boolean;
|
34
|
+
/**
|
35
|
+
* Hide bezel around indicator
|
36
|
+
*/
|
37
|
+
hideBezel?: boolean;
|
38
|
+
/**
|
39
|
+
* The mode of the loading indicator.
|
40
|
+
*/
|
41
|
+
mode?: Mode;
|
42
|
+
/**
|
43
|
+
* If `mode` is set to CustomView, then you can pass an image or view to show in the loading indicator.
|
44
|
+
*/
|
45
|
+
customView?: any;
|
46
|
+
/**
|
47
|
+
* iOS specific configuration options.
|
48
|
+
*/
|
49
|
+
ios?: OptionsIOS;
|
50
|
+
/**
|
51
|
+
* Android specific configuration options.
|
52
|
+
*/
|
53
|
+
android?: OptionsAndroid;
|
54
|
+
}
|
55
|
+
export interface OptionsIOS {
|
56
|
+
/**
|
57
|
+
* Native View instance to anchor the loading indicator to.
|
58
|
+
*/
|
59
|
+
view?: UIView;
|
60
|
+
square?: boolean;
|
61
|
+
}
|
62
|
+
export interface OptionsAndroid {
|
63
|
+
/**
|
64
|
+
* Native View instance to anchor the loading indicator to.
|
65
|
+
*/
|
66
|
+
view?: android.view.View;
|
67
|
+
max?: number;
|
68
|
+
progressNumberFormat?: string;
|
69
|
+
progressPercentFormat?: number;
|
70
|
+
progressStyle?: number;
|
71
|
+
secondaryProgress?: number;
|
72
|
+
cancelable?: boolean;
|
73
|
+
cancelListener?: (dialog: any) => void;
|
74
|
+
elevation?: number;
|
75
|
+
}
|
76
|
+
export declare enum Mode {
|
77
|
+
Indeterminate = 0,
|
78
|
+
Determinate = 1,
|
79
|
+
DeterminateHorizontalBar = 2,
|
80
|
+
AnnularDeterminate = 3,
|
81
|
+
CustomView = 4,
|
82
|
+
Text = 5
|
83
|
+
}
|
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
var Mode;
|
1
|
+
export var Mode;
|
4
2
|
(function (Mode) {
|
5
3
|
Mode[Mode["Indeterminate"] = 0] = "Indeterminate";
|
6
4
|
Mode[Mode["Determinate"] = 1] = "Determinate";
|
@@ -8,5 +6,5 @@ var Mode;
|
|
8
6
|
Mode[Mode["AnnularDeterminate"] = 3] = "AnnularDeterminate";
|
9
7
|
Mode[Mode["CustomView"] = 4] = "CustomView";
|
10
8
|
Mode[Mode["Text"] = 5] = "Text";
|
11
|
-
})(Mode
|
12
|
-
//# sourceMappingURL=
|
9
|
+
})(Mode || (Mode = {}));
|
10
|
+
//# sourceMappingURL=common.js.map
|
package/common.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../packages/nativescript-loading-indicator/common.ts"],"names":[],"mappings":"AA0FE,MAAM,CAAN,IAAY,IAOX;AAPD,WAAY,IAAI;IACd,iDAAiB,CAAA;IACjB,6CAAe,CAAA;IACf,uEAA4B,CAAA;IAC5B,2DAAsB,CAAA;IACtB,2CAAc,CAAA;IACd,+BAAQ,CAAA;AACV,CAAC,EAPW,IAAI,KAAJ,IAAI,QAOf"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { OptionsCommon } from './
|
2
|
-
export * from './
|
1
|
+
import { OptionsCommon } from './common';
|
2
|
+
export * from './common';
|
3
3
|
export declare class LoadingIndicator {
|
4
4
|
private _popOver;
|
5
5
|
private _currentProgressColor;
|
@@ -10,6 +10,9 @@ export declare class LoadingIndicator {
|
|
10
10
|
private _customViewId;
|
11
11
|
private _loadersInstances;
|
12
12
|
private _isCreatingPopOver;
|
13
|
+
private _progressDrawable;
|
14
|
+
private _backgroundDrawable;
|
15
|
+
private _progressDrawableThick;
|
13
16
|
constructor();
|
14
17
|
show(options?: OptionsCommon): void;
|
15
18
|
hide(targetView?: any, attemptTimeout?: number): void;
|