@skdx/web-components 0.34.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/custom-elements.json +29126 -29126
- package/dist/menu/MenuRoot.cjs +2 -2
- package/dist/menu/MenuRoot.d.cts +3 -3
- package/dist/menu/MenuRoot.d.ts +3 -3
- package/dist/menu/MenuRoot.js +2 -2
- package/package.json +2 -2
package/dist/menu/MenuRoot.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var I=(
|
|
1
|
+
"use strict";var a=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var I=(i,n)=>{for(var e in n)a(i,e,{get:n[e],enumerable:!0})},P=(i,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of _(n))!k.call(i,o)&&o!==e&&a(i,o,{get:()=>n[o],enumerable:!(t=g(n,o))||t.enumerable});return i};var T=i=>P(a({},"__esModule",{value:!0}),i),s=(i,n,e,t)=>{for(var o=t>1?void 0:t?g(n,e):n,d=i.length-1,c;d>=0;d--)(c=i[d])&&(o=(t?c(n,e,o):c(o))||o);return t&&o&&a(n,e,o),o};var L={};I(L,{ITEM_SELECTOR:()=>x.ITEM_SELECTOR,LONG_PRESS_MOVE_TOLERANCE:()=>S,LONG_PRESS_MS:()=>w,SkdxMenuRoot:()=>r});module.exports=T(L);var l=require("lit"),p=require("lit/decorators.js"),O=require("../internal/controlled-value.cjs"),v=require("../internal/define.cjs"),b=require("../internal/dismiss.cjs"),m=require("../internal/ids.cjs"),E=require("../internal/open-change-complete.cjs"),y=require("../internal/outsideInert.cjs"),u=require("../internal/positioning.cjs"),C=require("../internal/styles.cjs"),U=require("./MenuArrow.cjs"),q=require("./MenuPortal.cjs"),h=require("../internal/events.cjs"),f=require("./family.cjs"),x=require("../internal/menu-sub.cjs");var w=500,S=10,r=class extends l.LitElement{constructor(){super(...arguments);this._open=new O.ControlledValue(!1);this.defaultOpen=!1;this.openOn="click";this.closeOnSelect=!0;this.contentId=(0,m.nextId)("skdx-menu-content");this.triggerId=(0,m.nextId)("skdx-menu-trigger");this.openIntent="first";this.triggerEl=null;this.pointerPoint={x:0,y:0};this.hasUpdatedOnce=!1;this.contentEl=null}get open(){return this._open.value??!1}set open(e){let t=this.open;this._open.fromConsumer(e)&&this.requestUpdate("open",t)}get modal(){return this._modal??this.openOn!=="contextmenu"}set modal(e){let t=this.modal;this._modal=e,this.requestUpdate("modal",t)}setPoint(e){this.pointerPoint=e,f.MENU_FAMILY.notify(this)}getPoint(){return this.point??this.pointerPoint}connectedCallback(){super.connectedCallback();let e=this.querySelector("skdx-menu-content")?.id;e&&(this.contentId=e);let t=this.querySelector("skdx-menu-trigger")?.id;t&&(this.triggerId=t),this.defaultOpen&&!this.hasAttribute("open")&&this.writeOpen(!0)}disconnectedCallback(){this.teardownOpenChangeComplete?.(),super.disconnectedCallback()}updated(e){let t=!this.hasUpdatedOnce;this.hasUpdatedOnce=!0,e.size>0&&f.MENU_FAMILY.notify(this),e.has("open")&&!t&&(this.teardownOpenChangeComplete?.(),this.teardownOpenChangeComplete=(0,E.notifyOpenChangeComplete)(()=>this.querySelector("skdx-menu-content"),this.open,o=>(0,h.emit)(this,"open-change-complete",o)))}writeOpen(e){let t=this.open,o=this._open.propose(e);return o&&this.requestUpdate("open",t),o}setOpen(e){this.writeOpen(e)&&(0,h.emit)(this,"open-change",e)}focusTrigger(){this.modal&&(0,y.releaseOutsideInert)(),!(this.contentEl&&!(0,b.dispatchAutoFocus)(this.contentEl,"close-auto-focus"))&&this.triggerEl?.focus()}render(){return l.html`<slot></slot>`}};r.styles=[C.hiddenHostStyles,l.css`
|
|
2
2
|
:host {
|
|
3
3
|
display: contents;
|
|
4
4
|
}
|
|
5
|
-
`],s([(0,p.property)({type:Boolean,reflect:!0,noAccessor:!0})],
|
|
5
|
+
`],s([(0,p.property)({type:Boolean,reflect:!0,noAccessor:!0})],r.prototype,"open",1),s([(0,p.property)({type:Boolean,attribute:"default-open"})],r.prototype,"defaultOpen",2),s([(0,p.property)({type:String,attribute:"open-on"})],r.prototype,"openOn",2),s([(0,p.property)({attribute:!1})],r.prototype,"point",2),s([(0,p.property)({converter:u.optOutBoolean,noAccessor:!0})],r.prototype,"modal",1),s([(0,p.property)({attribute:"close-on-select",converter:u.optOutBoolean})],r.prototype,"closeOnSelect",2),r=s([(0,v.customElement)("skdx-menu-root")],r);0&&(module.exports={ITEM_SELECTOR,LONG_PRESS_MOVE_TOLERANCE,LONG_PRESS_MS,SkdxMenuRoot});
|
package/dist/menu/MenuRoot.d.cts
CHANGED
|
@@ -111,11 +111,11 @@ export declare class SkdxMenuRoot extends LitElement {
|
|
|
111
111
|
protected updated(changed: Map<string, unknown>): void;
|
|
112
112
|
/**
|
|
113
113
|
* The one place the menu's own state moves: writes `open` only while
|
|
114
|
-
* uncontrolled, and
|
|
115
|
-
*
|
|
114
|
+
* uncontrolled, and reports whether `open-change` is owed — a controlled
|
|
115
|
+
* menu still announces the move it wants, it just does not make it.
|
|
116
116
|
*/
|
|
117
117
|
private writeOpen;
|
|
118
|
-
/** @internal */
|
|
118
|
+
/** @internal Moves the menu and announces `open-change`, whether or not the move landed. */
|
|
119
119
|
setOpen(next: boolean): void;
|
|
120
120
|
/** @internal The connected Content element that `close-auto-focus` dispatches from. */
|
|
121
121
|
contentEl: HTMLElement | null;
|
package/dist/menu/MenuRoot.d.ts
CHANGED
|
@@ -111,11 +111,11 @@ export declare class SkdxMenuRoot extends LitElement {
|
|
|
111
111
|
protected updated(changed: Map<string, unknown>): void;
|
|
112
112
|
/**
|
|
113
113
|
* The one place the menu's own state moves: writes `open` only while
|
|
114
|
-
* uncontrolled, and
|
|
115
|
-
*
|
|
114
|
+
* uncontrolled, and reports whether `open-change` is owed — a controlled
|
|
115
|
+
* menu still announces the move it wants, it just does not make it.
|
|
116
116
|
*/
|
|
117
117
|
private writeOpen;
|
|
118
|
-
/** @internal */
|
|
118
|
+
/** @internal Moves the menu and announces `open-change`, whether or not the move landed. */
|
|
119
119
|
setOpen(next: boolean): void;
|
|
120
120
|
/** @internal The connected Content element that `close-auto-focus` dispatches from. */
|
|
121
121
|
contentEl: HTMLElement | null;
|
package/dist/menu/MenuRoot.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var h=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var
|
|
1
|
+
var h=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var r=(p,s,e,t)=>{for(var o=t>1?void 0:t?f(s,e):s,l=p.length-1,a;l>=0;l--)(a=p[l])&&(o=(t?a(s,e,o):a(o))||o);return t&&o&&h(s,e,o),o};import{css as g,html as O,LitElement as v}from"lit";import{property as i}from"lit/decorators.js";import{ControlledValue as b}from"../internal/controlled-value.js";import{customElement as E}from"../internal/define.js";import{dispatchAutoFocus as y}from"../internal/dismiss.js";import{nextId as d}from"../internal/ids.js";import{notifyOpenChangeComplete as C}from"../internal/open-change-complete.js";import{releaseOutsideInert as x}from"../internal/outsideInert.js";import{optOutBoolean as c}from"../internal/positioning.js";import{hiddenHostStyles as _}from"../internal/styles.js";import"./MenuArrow.js";import"./MenuPortal.js";import{emit as m}from"../internal/events.js";import{MENU_FAMILY as u}from"./family.js";import{ITEM_SELECTOR as j}from"../internal/menu-sub.js";var G=500,V=10,n=class extends v{constructor(){super(...arguments);this._open=new b(!1);this.defaultOpen=!1;this.openOn="click";this.closeOnSelect=!0;this.contentId=d("skdx-menu-content");this.triggerId=d("skdx-menu-trigger");this.openIntent="first";this.triggerEl=null;this.pointerPoint={x:0,y:0};this.hasUpdatedOnce=!1;this.contentEl=null}get open(){return this._open.value??!1}set open(e){let t=this.open;this._open.fromConsumer(e)&&this.requestUpdate("open",t)}get modal(){return this._modal??this.openOn!=="contextmenu"}set modal(e){let t=this.modal;this._modal=e,this.requestUpdate("modal",t)}setPoint(e){this.pointerPoint=e,u.notify(this)}getPoint(){return this.point??this.pointerPoint}connectedCallback(){super.connectedCallback();let e=this.querySelector("skdx-menu-content")?.id;e&&(this.contentId=e);let t=this.querySelector("skdx-menu-trigger")?.id;t&&(this.triggerId=t),this.defaultOpen&&!this.hasAttribute("open")&&this.writeOpen(!0)}disconnectedCallback(){this.teardownOpenChangeComplete?.(),super.disconnectedCallback()}updated(e){let t=!this.hasUpdatedOnce;this.hasUpdatedOnce=!0,e.size>0&&u.notify(this),e.has("open")&&!t&&(this.teardownOpenChangeComplete?.(),this.teardownOpenChangeComplete=C(()=>this.querySelector("skdx-menu-content"),this.open,o=>m(this,"open-change-complete",o)))}writeOpen(e){let t=this.open,o=this._open.propose(e);return o&&this.requestUpdate("open",t),o}setOpen(e){this.writeOpen(e)&&m(this,"open-change",e)}focusTrigger(){this.modal&&x(),!(this.contentEl&&!y(this.contentEl,"close-auto-focus"))&&this.triggerEl?.focus()}render(){return O`<slot></slot>`}};n.styles=[_,g`
|
|
2
2
|
:host {
|
|
3
3
|
display: contents;
|
|
4
4
|
}
|
|
5
|
-
`],
|
|
5
|
+
`],r([i({type:Boolean,reflect:!0,noAccessor:!0})],n.prototype,"open",1),r([i({type:Boolean,attribute:"default-open"})],n.prototype,"defaultOpen",2),r([i({type:String,attribute:"open-on"})],n.prototype,"openOn",2),r([i({attribute:!1})],n.prototype,"point",2),r([i({converter:c,noAccessor:!0})],n.prototype,"modal",1),r([i({attribute:"close-on-select",converter:c})],n.prototype,"closeOnSelect",2),n=r([E("skdx-menu-root")],n);export{j as ITEM_SELECTOR,V as LONG_PRESS_MOVE_TOLERANCE,G as LONG_PRESS_MS,n as SkdxMenuRoot};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skdx/web-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"description": "Standards-based custom elements for the SkandaDX design system — no React (or any framework) required",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -2871,7 +2871,7 @@
|
|
|
2871
2871
|
"tsup": "^8.5.1",
|
|
2872
2872
|
"typescript": "^6.0.3",
|
|
2873
2873
|
"vitest": "^4.1.10",
|
|
2874
|
-
"@skdx/shared": "0.
|
|
2874
|
+
"@skdx/shared": "0.35.0"
|
|
2875
2875
|
},
|
|
2876
2876
|
"scripts": {
|
|
2877
2877
|
"lint": "eslint . --cache --cache-location node_modules/.cache/eslint/",
|