New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nativescript-material-core

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nativescript-material-core - npm Package Compare versions

Comparing version 3.2.3 to 3.2.4

android/utils.mjs

29

android/utils.js

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

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -158,8 +157,2 @@ var application = require("@nativescript/core/application");

states[1] = Array.create('int', 0);
// states[1][0] = new java.lang.Integer(state.enabled);
// states[1][1] = new java.lang.Integer(-state.pressed);
// const states = [
// getSELECTED_PRESSED_STATE_SET(),
// []]
// ;
var colors = Array.create('int', 2);

@@ -173,12 +166,5 @@ colors[0] = color;

var states = Array.create('[I', 2);
// const SELECTED_PRESSED_STATE_SET = Array.create("int",1);
// SELECTED_PRESSED_STATE_SET[0] = state.enabled;
states[0] = Array.create('int', 1);
states[0][0] = -exports.state.enabled;
states[1] = android.util.StateSet.NOTHING;
// states[1][0] = new java.lang.Integer(-state.enabled);
// const states = [
// getSELECTED_PRESSED_STATE_SET(),
// []]
// ;
var colors = Array.create('int', 2);

@@ -197,4 +183,2 @@ colors[0] = variant === 'text' || variant === 'outline' ? 0 : new color_1.Color(30, 0, 0, 0).android;

states[1][1] = exports.state.focused;
// states[2] = Array.create('int', 1);
// states[2][0] = state.selected;
states[2] = android.util.StateSet.NOTHING;

@@ -209,5 +193,5 @@ var colors = Array.create('int', 4);

exports.getFocusedColorStateList = getFocusedColorStateList;
var shortAnimTime = 17694720; // android.R.integer.config_shortAnimTime
var statePressed = 16842919; // android.R.attr.state_pressed
var stateEnabled = 16842910; // android.R.attr.state_enabled
var shortAnimTime = 17694720;
var statePressed = 16842919;
var stateEnabled = 16842910;
function createStateListAnimator(view, nativeView) {

@@ -262,3 +246,2 @@ var ObjectAnimator = android.animation.ObjectAnimator;

if (isPostLollipopMR1()) {
//noinspection NewApi
rippleDrawable = new android.graphics.drawable.RippleDrawable(android.content.res.ColorStateList.valueOf(rippleColor), null, rippleShape);

@@ -268,9 +251,5 @@ }

rippleDrawable = new android.graphics.drawable.StateListDrawable();
// const foregroundShape = this.createForegroundShape(this._borderRadius);
rippleShape.getPaint().setColor(rippleColor);
rippleDrawable.addState([exports.state.pressed], rippleShape);
// this.rippleDrawable = this.createCompatRippleDrawable(this.getCardRippleColor());
// view.setForeground(this.createCompatRippleDrawable(this.getRippleColor(this.style['rippleColor'])));
}
// some classes might need this
rippleDrawable.rippleShape = rippleShape;

@@ -303,4 +282,2 @@ return rippleDrawable;

view.setFocusable(focusable);
// so dumb setFocusable to false set setFocusableInTouchMode
// but not when using true :s so we have to do it
view.setFocusableInTouchMode(focusable);

@@ -307,0 +284,0 @@ }

@@ -6,2 +6,13 @@ # Change Log

## [3.2.4](https://github.com/Akylas/nativescript-material-components/compare/v3.2.3...v3.2.4) (2020-05-21)
### Bug Fixes
* full esm support! ([7e910f3](https://github.com/Akylas/nativescript-material-components/commit/7e910f3950659ee4165bfea5cf3cf7379617bf1e))
## [3.2.3](https://github.com/Akylas/nativescript-material-components/compare/v3.2.2...v3.2.3) (2020-05-12)

@@ -8,0 +19,0 @@

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

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -12,15 +11,8 @@ var utils_1 = require("./android/utils");

var cssproperties_1 = require("./cssproperties");
// stub class as we don't use this on android
var Themer = /** @class */ (function () {
var Themer = (function () {
function Themer() {
}
// appColorScheme: MDCSemanticColorScheme;
Themer.prototype.getOrcreateAppColorScheme = function () {
// if (!this.appColorScheme) {
// this.appColorScheme = MDCSemanticColorScheme.alloc().init();
// }
// return this.appColorScheme;
};
Themer.prototype.getAppColorScheme = function () {
// return this.appColorScheme;
};

@@ -77,7 +69,2 @@ Themer.prototype.setPrimaryColor = function (value) {

function install() {
// try {
// require('nativescript-material-bottomsheet').install();
// } catch (e) {
// console.log('error installing bottomsheet', e);
// }
}

@@ -88,4 +75,3 @@ exports.install = install;

var temp = typeof color === 'string' ? new color_1.Color(color) : color;
// return android.graphics.Color.argb(temp.a !== 255 ? temp.a / 255 : 0.14, temp.r / 255, temp.g / 255, temp.b); // default alpha is 0.14
return new color_1.Color(temp.a !== 255 ? temp.a : 61.5, temp.r, temp.g, temp.b).android; // default alpha is 0.24
return new color_1.Color(temp.a !== 255 ? temp.a : 61.5, temp.r, temp.g, temp.b).android;
}

@@ -95,3 +81,3 @@ return null;

exports.getRippleColor = getRippleColor;
var ViewWithElevationAndRipple = /** @class */ (function (_super) {
var ViewWithElevationAndRipple = (function (_super) {
__extends(ViewWithElevationAndRipple, _super);

@@ -141,3 +127,2 @@ function ViewWithElevationAndRipple() {

}
// }
};

@@ -149,4 +134,2 @@ ViewWithElevationAndRipple.prototype[view_1.backgroundInternalProperty.setNative] = function (value) {

else {
// we recreate the ripple drawable if necessary.
// native button have on the background. Setting color will remove the ripple!
if (this.rippleDrawable || (value.color && this instanceof button_1.Button && this.rippleColor)) {

@@ -159,8 +142,2 @@ this.rippleDrawable = null;

};
// [elevationProperty.setNative](value: number) {
// this.style.androidElevation = value;
// }
// [dynamicElevationOffsetProperty.setNative](value: number) {
// this.style.androidDynamicElevationOffset = value;
// }
ViewWithElevationAndRipple.prototype.getDefaultElevation = function () {

@@ -174,5 +151,2 @@ var result = this instanceof button_1.Button ? 2 : 0;

};
// [elevationProperty.getDefault](): number {
// return this.getDefaultElevation();
// }
ViewWithElevationAndRipple.prototype[cssproperties_1.elevationProperty.setNative] = function (value) {

@@ -187,5 +161,2 @@ if (utils_1.isPostLollipop()) {

};
// [dynamicElevationOffsetProperty.getDefault](): number {
// return this.getDefaultDynamicElevationOffset();
// }
ViewWithElevationAndRipple.prototype[cssproperties_1.dynamicElevationOffsetProperty.setNative] = function (value) {

@@ -202,18 +173,13 @@ this.nativeViewProtected.setClickable(this.isUserInteractionEnabled);

ViewWithElevationAndRipple.prototype[style_properties_1.androidElevationProperty.setNative] = function (value) {
// override to prevent override of elevation
};
ViewWithElevationAndRipple.prototype[style_properties_1.androidDynamicElevationOffsetProperty.setNative] = function (value) {
// override to prevent override of dynamicElevationOffset
};
__decorate([
cssproperties_1.cssProperty,
__metadata("design:type", Number)
cssproperties_1.cssProperty
], ViewWithElevationAndRipple.prototype, "elevation", void 0);
__decorate([
cssproperties_1.cssProperty,
__metadata("design:type", Number)
cssproperties_1.cssProperty
], ViewWithElevationAndRipple.prototype, "dynamicElevationOffset", void 0);
__decorate([
cssproperties_1.cssProperty,
__metadata("design:type", color_1.Color)
cssproperties_1.cssProperty
], ViewWithElevationAndRipple.prototype, "rippleColor", void 0);

@@ -220,0 +186,0 @@ return ViewWithElevationAndRipple;

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

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -3,0 +2,0 @@ function applyMixins(derivedCtor, baseCtors, options) {

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

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -13,5 +12,4 @@ var color_1 = require("@nativescript/core/color");

var cssproperties_1 = require("./cssproperties");
var Themer = /** @class */ (function () {
var Themer = (function () {
function Themer() {
// create a default one to prevent multiple creations on widget side
this.appColorScheme = MDCSemanticColorScheme.new();

@@ -34,3 +32,3 @@ this.appColorScheme.primaryColorVariant = this.appColorScheme.primaryColor.colorWithAlphaComponent(0.24);

colorTheme.primaryColor = color.ios;
colorTheme.primaryColorVariant = new color_1.Color(61.2, color.r, color.g, color.b).ios; // default alpha is 0.24
colorTheme.primaryColorVariant = new color_1.Color(61.2, color.r, color.g, color.b).ios;
};

@@ -92,7 +90,2 @@ Themer.prototype.getPrimaryColor = function () {

Themer.prototype.setButtonTypography = function (args) {
// const typoTheme = this.getOrcreateAppTypographyScheme();
// let currentFont = typoTheme.button;
// if (args.fontFamily) {
// currentFont = currentFont.withFontFamily(args.fontFamily);
// }
};

@@ -104,7 +97,2 @@ return Themer;

function install() {
// try {
// require('nativescript-material-bottomsheet').install();
// } catch (e) {
// console.log('error installing bottom-sheet', e);
// }
}

@@ -115,4 +103,3 @@ exports.install = install;

var temp = typeof color === 'string' ? new color_1.Color(color) : color;
// return UIColor.colorWithRedGreenBlueAlpha(temp.r / 255, temp.g / 255, temp.b, temp.a !== 255 ? temp.a / 255 : 0.14);
return new color_1.Color(temp.a !== 255 ? temp.a : 61.5, temp.r, temp.g, temp.b).ios; // default alpha is 0.24
return new color_1.Color(temp.a !== 255 ? temp.a : 61.5, temp.r, temp.g, temp.b).ios;
}

@@ -122,3 +109,3 @@ return null;

exports.getRippleColor = getRippleColor;
var ViewWithElevationAndRipple = /** @class */ (function (_super) {
var ViewWithElevationAndRipple = (function (_super) {
__extends(ViewWithElevationAndRipple, _super);

@@ -132,3 +119,2 @@ function ViewWithElevationAndRipple() {

if (!this.inkTouchController) {
// create the shadow Layer
this.inkTouchController = MDCInkTouchController.alloc().initWithView(this.nativeViewProtected);

@@ -147,3 +133,2 @@ this.inkTouchController.addInkView();

this._shadowElevations = this._shadowElevations || {};
// create the shadow Layer
var layer = (this.shadowLayer = MDCShadowLayer.alloc().init());

@@ -154,3 +139,2 @@ layer.shouldRasterize = true;

this.nativeViewProtected.layer.addSublayer(this.shadowLayer);
// we need to set clipToBounds to false. For now it overrides user choice.
this['clipToBounds'] = false;

@@ -261,6 +245,2 @@ this.nativeViewProtected.clipsToBounds = false;

ViewWithElevationAndRipple.prototype[style_properties_1.backgroundInternalProperty.setNative] = function (value) {
// base impl will be called before
// if (this.shadowLayer) {
// this.shadowLayer.cornerRadius = layout.toDeviceIndependentPixels(value.borderTopLeftRadius);
// }
if (this.inkTouchController) {

@@ -271,12 +251,9 @@ this.inkTouchController.defaultInkView.layer.cornerRadius = utils_1.layout.toDeviceIndependentPixels(value.borderTopLeftRadius);

__decorate([
cssproperties_1.cssProperty,
__metadata("design:type", Number)
cssproperties_1.cssProperty
], ViewWithElevationAndRipple.prototype, "elevation", void 0);
__decorate([
cssproperties_1.cssProperty,
__metadata("design:type", Number)
cssproperties_1.cssProperty
], ViewWithElevationAndRipple.prototype, "dynamicElevationOffset", void 0);
__decorate([
cssproperties_1.cssProperty,
__metadata("design:type", color_1.Color)
cssproperties_1.cssProperty
], ViewWithElevationAndRipple.prototype, "rippleColor", void 0);

@@ -287,4 +264,2 @@ return ViewWithElevationAndRipple;

var NSView = require('@nativescript/core/ui/core/view').View;
// we need mixins to be applied after (run default implementation first) because of _setNativeClipToBounds.
// it needs to be applied after for shadows to be drawn correctly
core_common_1.applyMixins(NSView, [ViewWithElevationAndRipple], {

@@ -291,0 +266,0 @@ after: true

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

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -3,0 +2,0 @@ var color_1 = require("@nativescript/core/color");

{
"name": "nativescript-material-core",
"version": "3.2.3",
"version": "3.2.4",
"description": "Material Core component",
"main": "./core",
"main": "./core.js",
"module": "./core.mjs",
"typings": "./core.d.ts",
"scripts": {
"tsc-win": "..\\..\\node_modules\\.bin\\tsc && copy ..\\..\\src\\core\\core.d.ts .\\",
"tsc": "cp ../../src/core/core.d.ts ./ && ../../node_modules/.bin/tsc --skipLibCheck",
"tsc": "cp ../../src/core/core.d.ts ./ && ../../node_modules/.bin/tsc --skipLibCheck -d",
"tsc-win": "copy ..\\..\\src\\core\\core.d.ts .\\ && ..\\..\\node_modules\\.bin\\tsc --skipLibCheck -d",
"build": "npm run tsc && npm run build.esm && node ../../build.esm.js && ../../node_modules/.bin/rimraf ./build/esm",
"build.esm": "tsc -skipLibCheck --target es2015 --module esnext --module esnext --removeComments --outDir ./build/esm",
"clean": "../../node_modules/.bin/rimraf ./*.d.ts ./*.js ./*.js.map android"

@@ -34,3 +37,3 @@ },

"readmeFilename": "README.md",
"gitHead": "2c111dcd91b4039944a606fae4aee0e36afe070c"
"gitHead": "056895c5b87c9c332ad67cc47a3d3e76cd18e667"
}

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

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -3,0 +2,0 @@ var properties_1 = require("@nativescript/core/ui/core/properties");

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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