Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@spectrum-web-components/menu-item

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spectrum-web-components/menu-item - npm Package Compare versions

Comparing version 0.1.4 to 0.2.0

6

CHANGELOG.md

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

# [0.2.0](https://github.com/adobe/spectrum-web-components/compare/@spectrum-web-components/menu-item@0.1.4...@spectrum-web-components/menu-item@0.2.0) (2019-10-16)
### Features
- **menu-item:** added 'value' and 'itemText' properties ([2c187b5](https://github.com/adobe/spectrum-web-components/commit/2c187b5))
## [0.1.4](https://github.com/adobe/spectrum-web-components/compare/@spectrum-web-components/menu-item@0.1.3...@spectrum-web-components/menu-item@0.1.4) (2019-10-14)

@@ -8,0 +14,0 @@

3

lib/menu-item.d.ts

@@ -15,2 +15,5 @@ import { CSSResultArray, TemplateResult } from 'lit-element';

tabIndex: number;
private _value;
value: string;
readonly itemText: string;
protected readonly buttonContent: TemplateResult[];

@@ -17,0 +20,0 @@ connectedCallback(): void;

@@ -28,2 +28,3 @@ /*

this.tabIndex = -1;
this._value = '';
}

@@ -33,2 +34,20 @@ static get styles() {

}
get value() {
return this._value || this.itemText;
}
set value(value) {
if (value === this.value) {
return;
}
this._value = value || '';
if (this.value) {
this.setAttribute('value', this.value);
}
else {
this.removeAttribute('value');
}
}
get itemText() {
return (this.textContent || /* istanbul ignore next */ '').trim();
}
get buttonContent() {

@@ -68,2 +87,5 @@ const content = super.buttonContent;

], MenuItem.prototype, "tabIndex", void 0);
__decorate([
property({ type: String })
], MenuItem.prototype, "value", null);
//# sourceMappingURL=menu-item.js.map

6

package.json

@@ -21,3 +21,3 @@ {

],
"version": "0.1.4",
"version": "0.2.0",
"description": "",

@@ -40,3 +40,3 @@ "main": "lib/index.js",

"dependencies": {
"@spectrum-web-components/button": "^0.2.0",
"@spectrum-web-components/button": "^0.2.1",
"@spectrum-web-components/icon": "^0.2.0",

@@ -47,3 +47,3 @@ "@spectrum-web-components/icons": "^0.1.4",

},
"gitHead": "7c3e131bc2bc3b1195e736ff65d3c4e044590ace"
"gitHead": "75a470cca6e8e415c5e9868bc0b37314d61d1be5"
}

@@ -39,2 +39,24 @@ /*

private _value = '';
@property({ type: String })
public get value(): string {
return this._value || this.itemText;
}
public set value(value) {
if (value === this.value) {
return;
}
this._value = value || '';
if (this.value) {
this.setAttribute('value', this.value);
} else {
this.removeAttribute('value');
}
}
public get itemText(): string {
return (this.textContent || /* istanbul ignore next */ '').trim();
}
protected get buttonContent(): TemplateResult[] {

@@ -41,0 +63,0 @@ const content = super.buttonContent;

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