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

@code.gov/code-gov-style

Package Overview
Dependencies
Maintainers
3
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@code.gov/code-gov-style - npm Package Compare versions

Comparing version 1.10.19 to 1.10.20

96

dist/js/code-gov-web-components.js

@@ -456,2 +456,3 @@ 'use strict';

'use strict';
/*global HTMLElement*/

@@ -484,62 +485,59 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

(function () {
/*global HTMLElement*/
var QualityTag =
/*#__PURE__*/
function (_HTMLElement) {
_inherits(QualityTag, _HTMLElement);
var QualityTag =
/*#__PURE__*/
function (_HTMLElement) {
_inherits(QualityTag, _HTMLElement);
function QualityTag() {
_classCallCheck(this, QualityTag);
function QualityTag() {
_classCallCheck(this, QualityTag);
// establish prototype chain
return _possibleConstructorReturn(this, _getPrototypeOf(QualityTag).call(this));
// establish prototype chain
return _possibleConstructorReturn(this, _getPrototypeOf(QualityTag).call(this));
}
_createClass(QualityTag, [{
key: "connectedCallback",
// fires after the element has been attached to the DOM
value: function connectedCallback() {
this.update();
}
_createClass(QualityTag, [{
key: "connectedCallback",
// fires after the element has been attached to the DOM
value: function connectedCallback() {
}, {
key: "attributeChangedCallback",
value: function attributeChangedCallback(attrName, oldVal, newVal) {
if (attrName === 'score') {
this.update();
}
}, {
key: "attributeChangedCallback",
value: function attributeChangedCallback(attrName, oldVal, newVal) {
if (attrName === 'score') {
this.update();
}
}
}, {
key: "update",
value: function update() {
var rounded = Math.round(Number(this.getAttribute('score')) * 10) / 10;
var category = '';
if (rounded > 0 && rounded < 4) {
category = 'low';
} else if (rounded >= 4 && rounded < 7) {
category = 'medium';
} else if (rounded >= 7) {
category = 'high';
} else {
category = '';
}
}, {
key: "update",
value: function update() {
var rounded = Math.round(Number(this.getAttribute('score')) * 10) / 10;
var category = '';
if (rounded > 0 && rounded < 4) {
category = 'low';
} else if (rounded >= 4 && rounded < 7) {
category = 'medium';
} else if (rounded >= 7) {
category = 'high';
} else {
category = '';
}
this.innerHTML = "<div class=\"corner-tag ".concat(category, "\"><div class=\"corner-tag-value\">").concat(rounded, "</div></div>");
}
}], [{
key: "observedAttributes",
get: function get() {
return ['score'];
}
}]);
this.innerHTML = "<div class=\"corner-tag ".concat(category, "\"><div class=\"corner-tag-value\">").concat(rounded, "</div></div>");
}
}], [{
key: "observedAttributes",
get: function get() {
return ['score'];
}
}]);
return QualityTag;
}(_wrapNativeSuper(HTMLElement)); // let the browser know about the custom element
return QualityTag;
}(_wrapNativeSuper(HTMLElement)); // let the browser know about the custom element
/*global customElements*/
/*global customElements*/
customElements.define('quality-tag', QualityTag);
customElements.define('quality-tag', QualityTag);
})();
{
"name": "@code.gov/code-gov-style",
"version": "1.10.19",
"version": "1.10.20",
"description": "Style for code.gov including buttons, banners, and cards. Inspired by and somewhat based on USWDS.",

@@ -35,3 +35,3 @@ "main": "index.js",

"@babel/polyfill": "^7.0.0",
"@code.gov/code-gov-font": "0.7.0",
"@code.gov/code-gov-font": "0.7.1",
"@webcomponents/custom-elements": "^1.2.1",

@@ -38,0 +38,0 @@ "custom-event-polyfill": "^1.0.6",

'use strict';
(function() {
/*global HTMLElement*/
class QualityTag extends HTMLElement {
constructor() {
// establish prototype chain
super();
}
/*global HTMLElement*/
class QualityTag extends HTMLElement {
constructor() {
// establish prototype chain
super();
}
static get observedAttributes() {
return ['score'];
}
static get observedAttributes() {
return ['score'];
}
// fires after the element has been attached to the DOM
connectedCallback() {
// fires after the element has been attached to the DOM
connectedCallback() {
this.update();
}
attributeChangedCallback(attrName, oldVal, newVal) {
if (attrName === 'score') {
this.update();
}
}
attributeChangedCallback(attrName, oldVal, newVal) {
if (attrName === 'score') {
this.update();
}
update() {
const rounded = Math.round(Number(this.getAttribute('score')) * 10) / 10;
let category = '';
if (rounded > 0 && rounded < 4) {
category = 'low';
} else if (rounded >= 4 && rounded < 7) {
category = 'medium'
} else if (rounded >= 7) {
category = 'high';
} else {
category = '';
}
this.innerHTML = `<div class="corner-tag ${category}"><div class="corner-tag-value">${rounded}</div></div>`;
}
update() {
const rounded = Math.round(Number(this.getAttribute('score')) * 10) / 10;
let category = '';
if (rounded > 0 && rounded < 4) {
category = 'low';
} else if (rounded >= 4 && rounded < 7) {
category = 'medium'
} else if (rounded >= 7) {
category = 'high';
} else {
category = '';
}
this.innerHTML = `<div class="corner-tag ${category}"><div class="corner-tag-value">${rounded}</div></div>`;
}
}
}
// let the browser know about the custom element
/*global customElements*/
customElements.define('quality-tag', QualityTag);
})();
// let the browser know about the custom element
/*global customElements*/
customElements.define('quality-tag', QualityTag);

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

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