@spectrum-web-components/base
Advanced tools
Comparing version 0.42.2 to 0.42.3
{ | ||
"name": "@spectrum-web-components/base", | ||
"version": "0.42.2", | ||
"version": "0.42.3", | ||
"publishConfig": { | ||
@@ -112,3 +112,3 @@ "access": "public" | ||
"dependencies": { | ||
"lit": "^2.5.0" | ||
"lit": "^2.5.0 || ^3.1.3" | ||
}, | ||
@@ -120,3 +120,3 @@ "types": "./src/index.d.ts", | ||
], | ||
"gitHead": "e19af30387032608baaa88c6a17c2ee50103a7c5" | ||
"gitHead": "a03edce4f21f232f1705d8eb222e6e5436cad4c3" | ||
} |
import { LitElement, ReactiveElement } from 'lit'; | ||
declare type Constructor<T = Record<string, unknown>> = { | ||
type Constructor<T = Record<string, unknown>> = { | ||
new (...args: any[]): T; | ||
@@ -4,0 +4,0 @@ prototype: T; |
@@ -1,2 +0,2 @@ | ||
"use strict";import{LitElement as u}from"lit";import{version as g}from"@spectrum-web-components/base/src/version.js";const c=new Set,w=()=>{const s=document.documentElement.dir==="rtl"?document.documentElement.dir:"ltr";c.forEach(o=>{o.setAttribute("dir",s)})},p=new MutationObserver(w);p.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});const h=s=>typeof s.startManagingContentDirection!="undefined"||s.tagName==="SP-THEME";export function SpectrumMixin(s){class o extends s{get isLTR(){return this.dir==="ltr"}hasVisibleFocusInTree(){const n=((r=document)=>{var l;let t=r.activeElement;for(;t!=null&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;const a=t?[t]:[];for(;t;){const i=t.assignedSlot||t.parentElement||((l=t.getRootNode())==null?void 0:l.host);i&&a.push(i),t=i}return a})(this.getRootNode())[0];if(!n)return!1;try{return n.matches(":focus-visible")||n.matches(".focus-visible")}catch(r){return n.matches(".focus-visible")}}connectedCallback(){if(!this.hasAttribute("dir")){let e=this.assignedSlot||this.parentNode;for(;e!==document.documentElement&&!h(e);)e=e.assignedSlot||e.parentNode||e.host;if(this.dir=e.dir==="rtl"?e.dir:this.dir||"ltr",e===document.documentElement)c.add(this);else{const{localName:n}=e;n.search("-")>-1&&!customElements.get(n)?customElements.whenDefined(n).then(()=>{e.startManagingContentDirection(this)}):e.startManagingContentDirection(this)}this._dirParent=e}super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._dirParent&&(this._dirParent===document.documentElement?c.delete(this):this._dirParent.stopManagingContentDirection(this),this.removeAttribute("dir"))}}return o}export class SpectrumElement extends SpectrumMixin(u){}SpectrumElement.VERSION=g; | ||
"use strict";import{LitElement as m}from"lit";import{version as u}from"@spectrum-web-components/base/src/version.js";const c=new Set,g=()=>{const s=document.documentElement.dir==="rtl"?document.documentElement.dir:"ltr";c.forEach(o=>{o.setAttribute("dir",s)})},w=new MutationObserver(g);w.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});const p=s=>typeof s.startManagingContentDirection!="undefined"||s.tagName==="SP-THEME";export function SpectrumMixin(s){class o extends s{get isLTR(){return this.dir==="ltr"}hasVisibleFocusInTree(){const n=((r=document)=>{var l;let t=r.activeElement;for(;t!=null&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;const a=t?[t]:[];for(;t;){const i=t.assignedSlot||t.parentElement||((l=t.getRootNode())==null?void 0:l.host);i&&a.push(i),t=i}return a})(this.getRootNode())[0];if(!n)return!1;try{return n.matches(":focus-visible")||n.matches(".focus-visible")}catch(r){return n.matches(".focus-visible")}}connectedCallback(){if(!this.hasAttribute("dir")){let e=this.assignedSlot||this.parentNode;for(;e!==document.documentElement&&!p(e);)e=e.assignedSlot||e.parentNode||e.host;if(this.dir=e.dir==="rtl"?e.dir:this.dir||"ltr",e===document.documentElement)c.add(this);else{const{localName:n}=e;n.search("-")>-1&&!customElements.get(n)?customElements.whenDefined(n).then(()=>{e.startManagingContentDirection(this)}):e.startManagingContentDirection(this)}this._dirParent=e}super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._dirParent&&(this._dirParent===document.documentElement?c.delete(this):this._dirParent.stopManagingContentDirection(this),this.removeAttribute("dir"))}}return o}export class SpectrumElement extends SpectrumMixin(m){}SpectrumElement.VERSION=u; | ||
//# sourceMappingURL=Base.js.map |
import { ReactiveElement } from 'lit'; | ||
declare type Constructor<T = Record<string, unknown>> = { | ||
type Constructor<T = Record<string, unknown>> = { | ||
new (...args: any[]): T; | ||
prototype: T; | ||
}; | ||
export declare type ElementSize = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl'; | ||
export type ElementSize = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl'; | ||
export declare const ElementSizes: Record<string, ElementSize>; | ||
export declare type DefaultElementSize = Exclude<ElementSize, 'xxs' | 'xs' | 'xxl'>; | ||
export type DefaultElementSize = Exclude<ElementSize, 'xxs' | 'xs' | 'xxl'>; | ||
export interface SizedElementInterface { | ||
@@ -10,0 +10,0 @@ size: ElementSize; |
import { nothing, Part } from 'lit'; | ||
import { AsyncDirective } from 'lit/async-directive.js'; | ||
import type { DirectiveResult } from 'lit/directive.js'; | ||
declare type ListenerConfig = [string | string[], (event?: any) => void]; | ||
declare type ListenerConfigGroup = { | ||
type ListenerConfig = [string | string[], (event?: any) => void]; | ||
type ListenerConfigGroup = { | ||
start: ListenerConfig; | ||
@@ -7,0 +7,0 @@ end: ListenerConfig; |
// Generated by genversion. | ||
export const version = '0.42.2'; | ||
export const version = '0.42.3'; |
"use strict"; | ||
import { expect } from "@open-wc/testing"; | ||
import { stub } from "sinon"; | ||
describe("Base", () => { | ||
it("warns in Dev Mode when no attributes", async () => { | ||
const consoleWarnStub = stub(console, "warn"); | ||
describe("Dev Mode", () => { | ||
let consoleWarnStub; | ||
before(() => { | ||
window.__swc = { | ||
...window.__swc, | ||
verbose: true | ||
}; | ||
consoleWarnStub = stub(console, "warn"); | ||
}); | ||
afterEach(() => { | ||
consoleWarnStub.resetHistory(); | ||
}); | ||
after(() => { | ||
consoleWarnStub.restore(); | ||
}); | ||
it("announces that Dev Mode is on", async function() { | ||
const { SpectrumElement } = await import("@spectrum-web-components/base"); | ||
@@ -22,5 +35,4 @@ expect(SpectrumElement).to.not.be.undefined; | ||
}); | ||
consoleWarnStub.restore(); | ||
}); | ||
}); | ||
//# sourceMappingURL=base-devmode.test.js.map |
Sorry, the diff of this file is not supported yet
141946
790
+ Added@lit/reactive-element@2.0.4(transitive)
+ Addedlit@3.1.3(transitive)
+ Addedlit-element@4.0.5(transitive)
+ Addedlit-html@3.1.3(transitive)
- Removed@lit/reactive-element@1.6.3(transitive)
- Removedlit@2.8.0(transitive)
- Removedlit-element@3.3.3(transitive)
- Removedlit-html@2.8.0(transitive)
Updatedlit@^2.5.0 || ^3.1.3