Socket
Socket
Sign inDemoInstall

@essent/nativescript-loading-indicator

Package Overview
Dependencies
Maintainers
34
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@essent/nativescript-loading-indicator - npm Package Compare versions

Comparing version 2.3.4-2 to 4.0.0

loading-indicator.common.d.ts

33

index.d.ts

@@ -1,32 +0,3 @@

export interface OptionsAndroid {
cancelable?: boolean;
indeterminate?: boolean;
max?: number;
progressNumberFormat?: string;
progressPercentFormat?: number;
progressStyle?: number;
secondaryProgress?: number;
}
export interface OptionsIOS {
details?: string;
square?: boolean;
margin?: number;
dimBackground?: boolean;
hideBezel?: boolean; // hide bezel around indicator
color?: string;
backgroundColor?: string;
view?: any; // UIView to target
mode?: any;
customView?: string;
}
export interface OptionsCommon {
message?: string;
progress?: number;
ios?: OptionsIOS;
android?: OptionsAndroid;
}
export * from './loading-indicator.common';
export class LoadingIndicator {
show(options?: OptionsCommon): any;
hide(): void;
}
export * from './loading-indicator.ios';

@@ -1,2 +0,7 @@

export * from './src/interfaces';
export * from './src/android/progress-dialog';
import * as common from './loading-indicator.common';
export declare class LoadingIndicator implements common.CommonLoadingIndicator {
private _progressDialog;
show(options?: common.OptionsCommon): any;
hide(): void;
private _getContext();
}
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
__export(require("./src/android/progress-dialog"));
Object.defineProperty(exports, "__esModule", { value: true });
var application = require("tns-core-modules/application");
var LoadingIndicator = (function () {
function LoadingIndicator() {
}
LoadingIndicator.prototype.show = function (options) {
var context = this._getContext();
if (context) {
if (typeof options === 'undefined')
options = {};
if (typeof this._progressDialog === 'undefined') {
var indeterminate = true;
var cancelable = false;
if (options.android) {
if (options.android.indeterminate !== undefined)
indeterminate = options.android.indeterminate;
if (options.android.cancelable !== undefined)
cancelable = options.android.cancelable;
}
this._progressDialog = android.app.ProgressDialog.show(context, "", options.message || "Loading", indeterminate, cancelable);
}
else if (this._progressDialog) {
if (options.message && this._progressDialog.setMesssage)
this._progressDialog.setMesssage(options.message);
if (options.progress)
this._progressDialog.setProgress(options.progress);
if (options.android) {
if (options.android.indeterminate)
this._progressDialog.setIndeterminate(true);
if (options.android.max)
this._progressDialog.setMax(options.android.max);
if (options.android.progressNumberFormat)
this._progressDialog.setProgressNumberFormat(options.android.progressNumberFormat);
if (options.android.progressPercentFormat)
this._progressDialog.setProgressPercentFormat(options.android.progressPercentFormat);
if (options.android.progressStyle)
this._progressDialog.setProgressStyle(options.android.progressStyle);
if (options.android.secondaryProgress)
this._progressDialog.setSecondaryProgress(options.android.secondaryProgress);
}
}
return this._progressDialog;
}
};
LoadingIndicator.prototype.hide = function () {
if (typeof this._progressDialog !== 'undefined') {
this._progressDialog.hide();
this._progressDialog.dismiss();
}
this._progressDialog = undefined;
};
LoadingIndicator.prototype._getContext = function () {
return application.android.foregroundActivity;
};
return LoadingIndicator;
}());
exports.LoadingIndicator = LoadingIndicator;
//# sourceMappingURL=loading-indicator.android.js.map

@@ -1,2 +0,8 @@

export * from './src/interfaces';
export * from './src/ios/mbprogress-hud';
import * as common from './loading-indicator.common';
export declare class LoadingIndicator implements common.CommonLoadingIndicator {
private _hud;
private _targetView;
show(options?: common.OptionsCommon): any;
hide(targetView?: any): void;
private _getRootWindow();
}
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
__export(require("./src/ios/mbprogress-hud"));
Object.defineProperty(exports, "__esModule", { value: true });
var color_1 = require("tns-core-modules/color");
var utils = require("tns-core-modules/utils/utils");
var LoadingIndicator = (function () {
function LoadingIndicator() {
}
LoadingIndicator.prototype.show = function (options) {
if (typeof options === 'undefined')
options = {};
var ios = options.ios;
if (typeof this._hud === 'undefined') {
this._targetView = ios && ios.view ? ios.view : this._getRootWindow();
this._hud = MBProgressHUD.showHUDAddedToAnimated(this._targetView, true);
}
if (options.message)
this._hud.labelText = options.message;
if (options.progress)
this._hud.progress = options.progress;
if (ios) {
if (ios.details)
this._hud.detailsLabelText = ios.details;
if (ios.square)
this._hud.square = true;
if (ios.margin)
this._hud.margin = ios.margin;
if (ios.dimBackground)
this._hud.dimBackground = ios.dimBackground;
if (ios.color) {
this._hud.activityIndicatorColor = new color_1.Color(ios.color).ios;
this._hud.labelColor = new color_1.Color(ios.color).ios;
if (ios.details) {
this._hud.detailsLabelColor = new color_1.Color(ios.color).ios;
this._hud.detailsLabel.opacity = .8;
}
}
if (ios.backgroundColor) {
this._hud.color = new color_1.Color(ios.backgroundColor).ios;
}
if (ios.hideBezel) {
this._hud.backgroundColor = UIColor.clearColor;
this._hud.bezelView.style = MBProgressHUDBackgroundStyle.SolidColor;
this._hud.bezelView.backgroundColor = UIColor.clearColor;
}
if (ios.mode) {
this._hud.mode = ios.mode;
if (ios.mode === MBProgressHUDModeCustomView && ios.customView) {
this._hud.customView = UIImageView.alloc().initWithImage(UIImage.imageNamed(ios.customView));
}
}
}
return this._hud;
};
LoadingIndicator.prototype.hide = function (targetView) {
targetView = targetView || this._targetView || this._getRootWindow();
MBProgressHUD.hideHUDForViewAnimated(targetView, true);
this._hud = undefined;
};
LoadingIndicator.prototype._getRootWindow = function () {
return utils.ios.getter(UIApplication, UIApplication.sharedApplication).windows[0];
};
return LoadingIndicator;
}());
exports.LoadingIndicator = LoadingIndicator;
//# sourceMappingURL=loading-indicator.ios.js.map
{
"name": "@essent/nativescript-loading-indicator",
"version": "2.3.4-2",
"description": "A NativeScript plugin for showing an overlayed loading indicator for ios and android.",
"repository": {
"type": "git",
"url": "https://github.com/Essent/nativescript-loading-indicator.git"
},
"version": "4.0.0",
"description": "A NativeScript plugin for showing an overlayed loading indicator.",
"main": "loading-indicator",
"typings": "index.d.ts",
"author": "Nathan Walker <walkerrunpdx@gmail.com>",
"contributors": [
{
"name": "Pocketsmith"
}
],
"keywords": [
"NativeScript",
"loading-indicator",
"Loading",
"Progress",
"MBProgressHUD",
"ProgressDialog"
],
"nativescript": {

@@ -31,15 +13,33 @@ "platforms": {

},
"homepage": "https://github.com/Essent/nativescript-loading-indicator",
"license": "MIT",
"scripts": {
"build": "tsc",
"android.demo": "npm run build; cd demo; tns plugin remove @essent/nativescript-loading-indicator; tns plugin add ..; tns run android",
"ios.demo": "npm run build; cd demo; tns plugin remove @essent/nativescript-loading-indicator; tns plugin add ..; tns run ios",
"setup": "npm i; cd demo; npm install; cd ..; npm run build; cd demo; tns plugin add ..; cd .."
"tsc": "tsc",
"build": "npm run tsc && npm run build.native",
"build.native": "node scripts/build-native.js",
"postclone": "npm i && node scripts/postclone.js && cd ../demo && npm i && npx rimraf -- package-lock.json && cd ../src",
"test.android": "npm run tsc && npm run tslint && cd ../demo && tns build android && tns test android --justlaunch",
"test.ios": "npm run tsc && npm run tslint && cd ../demo && tns build ios && tns test ios --justlaunch",
"tslint": "cd .. && tslint \"**/*.ts\" --config tslint.json --exclude \"**/node_modules/**\"",
"plugin.tscwatch": "npm run tsc -- -w",
"demo.ios": "npm run tsc && cd ../demo && tns run ios --syncAllFiles --emulator",
"demo.android": "npm run tsc && cd ../demo && tns run android --syncAllFiles --emulator",
"demo.reset": "cd ../demo && npx rimraf -- hooks node_modules platforms package-lock.json",
"plugin.prepare": "npm run build && cd ../demo && tns plugin remove @essent/nativescript-loading-indicator && tns plugin add ../src",
"clean": "npm run demo.reset && npx rimraf -- node_modules package-lock.json && npm i",
"ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**'",
"prepack": "npm run build.native"
},
"bugs": {
"url": "https://github.com/NathanWalker/nativescript-loading-indicator/issues"
},
"homepage": "https://github.com/NathanWalker/nativescript-loading-indicator",
"license": "MIT",
"devDependencies": {
"tns-core-modules": "~2.5.2",
"tns-platform-declarations": "^2.5.2",
"typescript": "~2.1.0"
"tns-core-modules": "^5.1.0",
"tns-platform-declarations": "^5.1.0",
"typescript": "~2.8.2",
"prompt": "^1.0.0",
"rimraf": "^2.6.2",
"tslint": "^5.11.0",
"semver": "^5.6.0"
}
}

@@ -1,1 +0,2 @@

/// <reference path="./node_modules/tns-core-modules/tns-core-modules.es2016.d.ts" />
/// <reference path="./node_modules/tns-platform-declarations/ios.d.ts" />
/// <reference path="./node_modules/tns-platform-declarations/android.d.ts" />

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc