Huge News!Announcing our $40M Series B led by Abstract Ventures.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.9.9 to 1.10.0

src/filter_tag.js

76

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

@@ -166,2 +166,7 @@ 'use strict';

console.error("[filter-box] failed to parse rawOptions:", rawOptions);
if (rawOptions.contains("object")) {
console.error('It seems that you might have put in an object. Make sure to convert your object to a JSON string with JSON.stringify');
}
throw error;

@@ -278,2 +283,73 @@ }

})();
"use strict";
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
function isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
function _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
/* global HTMLElement */
var FilterTag =
/*#__PURE__*/
function (_HTMLElement) {
_inherits(FilterTag, _HTMLElement);
function FilterTag() {
_classCallCheck(this, FilterTag);
return _possibleConstructorReturn(this, _getPrototypeOf(FilterTag).call(this));
}
_createClass(FilterTag, [{
key: "connectedCallback",
// fires after the element has been attached to the DOM
value: function connectedCallback() {
this.update();
}
}, {
key: "attributeChangedCallback",
value: function attributeChangedCallback(attrName, oldVal, newVal) {
if (attrName === 'title') {
this.update();
}
}
}, {
key: "update",
value: function update() {
this.innerHTML = "\n <div class=\"filter-tag\">\n <div class=\"filter-tag-title\">".concat(this.getAttribute('title'), "</div>\n </div>\n ");
}
}], [{
key: "observedAttributes",
get: function get() {
return ['title'];
}
}]);
return FilterTag;
}(_wrapNativeSuper(HTMLElement));
/* global customElements */
customElements.define('filter-tag', FilterTag);

@@ -40,2 +40,8 @@ ---

</div>
```
# Filter Tag Web Component
<filter-tag title="JavaScript" />
```
<filter-tag title="JavaScript" />
```

@@ -166,2 +166,7 @@ 'use strict';

console.error("[filter-box] failed to parse rawOptions:", rawOptions);
if (rawOptions.contains("object")) {
console.error('It seems that you might have put in an object. Make sure to convert your object to a JSON string with JSON.stringify');
}
throw error;

@@ -278,2 +283,73 @@ }

})();
"use strict";
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
function isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
function _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
/* global HTMLElement */
var FilterTag =
/*#__PURE__*/
function (_HTMLElement) {
_inherits(FilterTag, _HTMLElement);
function FilterTag() {
_classCallCheck(this, FilterTag);
return _possibleConstructorReturn(this, _getPrototypeOf(FilterTag).call(this));
}
_createClass(FilterTag, [{
key: "connectedCallback",
// fires after the element has been attached to the DOM
value: function connectedCallback() {
this.update();
}
}, {
key: "attributeChangedCallback",
value: function attributeChangedCallback(attrName, oldVal, newVal) {
if (attrName === 'title') {
this.update();
}
}
}, {
key: "update",
value: function update() {
this.innerHTML = "\n <div class=\"filter-tag\">\n <div class=\"filter-tag-title\">".concat(this.getAttribute('title'), "</div>\n </div>\n ");
}
}], [{
key: "observedAttributes",
get: function get() {
return ['title'];
}
}]);
return FilterTag;
}(_wrapNativeSuper(HTMLElement));
/* global customElements */
customElements.define('filter-tag', FilterTag);

2

package.json
{
"name": "@code.gov/code-gov-style",
"version": "1.9.9",
"version": "1.10.0",
"description": "Style for code.gov including buttons, banners, and cards. Inspired by and somewhat based on USWDS.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -21,7 +21,7 @@ 'use strict';

}
get showAll() {
return this.className.indexOf("showAll") > -1;
}
setClassName(className, newValue) {

@@ -32,3 +32,3 @@ if (newValue) {

this.className = this.className.replace(className, "").trim();
}
}
}

@@ -39,3 +39,3 @@

}
set showAll(newValue) {

@@ -83,2 +83,5 @@ this.setClassName("showAll", newValue);

console.error("[filter-box] failed to parse rawOptions:", rawOptions);
if (rawOptions.contains("object")) {
console.error('It seems that you might have put in an object. Make sure to convert your object to a JSON string with JSON.stringify');
}
throw error;

@@ -145,3 +148,3 @@ }

});
/*

@@ -148,0 +151,0 @@ addElementButton.addEventListener('click', this.addListItem, false);

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