@nstudio/nativescript-loading-indicator 3.0.3 → 4.1.1

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 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 6.3+
21
+ ## NativeScript 7+:
22
+
40
23
  ```bash
41
- tns plugin add @nstudio/nativescript-loading-indicator
24
+ npm install @nstudio/nativescript-loading-indicator
42
25
  ```
43
26
 
44
- ## NativeScript lower than 6.3
27
+ ## NativeScript lower than 7:
28
+
45
29
  ```bash
46
- tns plugin add @nstudio/nativescript-loading-indicator@2.0.5
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="./screenshots/ios/1.png" style="max-width:200px" alt="iOS"> | <img src="./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"> |
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="./screenshots/android/1.png" style="max-width:200px" alt="Android"> | <img src="./screenshots/android/2.png" style="max-width:200px" alt="Android"> | <img src="./screenshots/android/3.png" style="max-width:200px" alt="Android"> | <img src="./screenshots/android/4.png" style="max-width:200px" alt="Android"> |
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
- "use strict";
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 = exports.Mode || (exports.Mode = {}));
12
- //# sourceMappingURL=loading-indicator.common.js.map
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 './loading-indicator.common';
2
- export * from './loading-indicator.common';
1
+ import { OptionsCommon } from './common';
2
+ export * from './common';
3
3
  export declare class LoadingIndicator {
4
4
  private _popOver;
5
5
  private _currentProgressColor;