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

@spectrum-web-components/base

Package Overview
Dependencies
Maintainers
7
Versions
235
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spectrum-web-components/base - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1

4

package.json
{
"name": "@spectrum-web-components/base",
"version": "0.5.0",
"version": "0.5.1",
"publishConfig": {

@@ -59,3 +59,3 @@ "access": "public"

"sideEffects": false,
"gitHead": "7ce77352f6894043bceac9ef92b21e5f85420969"
"gitHead": "df3f333ee26a45f9fc247716b6e8ef051dca630b"
}

@@ -6,10 +6,12 @@ import { ReactiveElement } from 'lit';

};
export declare type ElementSize = 's' | 'm' | 'l' | 'xl' | 'xxl';
export declare type ElementSize = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
export declare type DefaultElementSize = Exclude<ElementSize, 'xxs' | 'xs' | 'xxl'>;
export interface SizedElementInterface {
size: ElementSize;
}
export declare function SizedMixin<T extends Constructor<ReactiveElement>>(constructor: T, { validSizes, noDefaultSize, }?: {
export declare function SizedMixin<T extends Constructor<ReactiveElement>>(constructor: T, { validSizes, noDefaultSize, defaultSize, }?: {
validSizes?: ElementSize[];
noDefaultSize?: boolean;
defaultSize?: ElementSize;
}): T & Constructor<SizedElementInterface>;
export {};
import { __decorate } from "tslib";
import { property } from 'lit/decorators.js';
export function SizedMixin(constructor, { validSizes = ['s', 'm', 'l', 'xl'], noDefaultSize, } = {}) {
export function SizedMixin(constructor, { validSizes = ['s', 'm', 'l', 'xl'], noDefaultSize, defaultSize = 'm', } = {}) {
class SizedElement extends constructor {
constructor() {
super(...arguments);
this._size = 'm';
this._size = defaultSize;
}
get size() {
return this._size || 'm';
return this._size || defaultSize;
}
set size(value) {
const defaultSize = noDefaultSize ? null : 'm';
const fallbackSize = noDefaultSize ? null : defaultSize;
const size = (value ? value.toLocaleLowerCase() : value);
const validSize = (validSizes.includes(size) ? size : defaultSize);
const validSize = (validSizes.includes(size) ? size : fallbackSize);
if (validSize) {

@@ -17,0 +17,0 @@ this.setAttribute('size', validSize);

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