@vandeurenglenn/lite-elements 0.3.22 → 0.3.24
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/exports/bundle/dialog.js +1 -1
- package/exports/bundle/summary-mirror.js +20 -0
- package/exports/bundle/summary.js +25 -0
- package/exports/dialog.js +2 -2
- package/exports/summary/summary-mirror.d.ts +8 -0
- package/exports/summary/summary.d.ts +5 -0
- package/exports/summary-mirror.js +67 -0
- package/exports/summary.js +55 -0
- package/package.json +17 -1
package/exports/bundle/dialog.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as e,a as t,e as s}from"./custom-element-BMhVvZjf.js";import{t as o,j as a,v as n,D as r}from"./property-Do5-bKhz.js";import"./elevation.js";import"./icon.js";import"./index-B3uz3f8C.js";let i=(()=>{let i,l,c,h,d,m,p,u=[s("custom-dialog")],g=[],f=r,y=[],v=[],x=[],_=[],b=[],w=[],H=[],k=[],A=[],j=[];return class extends f{static{l=this}static{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;c=[o({type:Boolean,reflect:!0})],h=[o({type:Boolean,reflect:!0})],d=[o({type:Boolean,reflect:!0,attribute:"has-actions"})],m=[o({type:Boolean,reflect:!0,attribute:"has-header"})],p=[o({type:Boolean,reflect:!0,attribute:"has-hero"})],e(this,null,c,{kind:"accessor",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:t},y,v),e(this,null,h,{kind:"accessor",name:"fullscreen",static:!1,private:!1,access:{has:e=>"fullscreen"in e,get:e=>e.fullscreen,set:(e,t)=>{e.fullscreen=t}},metadata:t},x,_),e(this,null,d,{kind:"accessor",name:"hasActions",static:!1,private:!1,access:{has:e=>"hasActions"in e,get:e=>e.hasActions,set:(e,t)=>{e.hasActions=t}},metadata:t},b,w),e(this,null,m,{kind:"accessor",name:"hasHeader",static:!1,private:!1,access:{has:e=>"hasHeader"in e,get:e=>e.hasHeader,set:(e,t)=>{e.hasHeader=t}},metadata:t},H,k),e(this,null,p,{kind:"accessor",name:"hasHero",static:!1,private:!1,access:{has:e=>"hasHero"in e,get:e=>e.hasHero,set:(e,t)=>{e.hasHero=t}},metadata:t},A,j),e(null,i={value:l},u,{kind:"class",name:l.name,metadata:t},null,g),l=i.value,t&&Object.defineProperty(l,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}#e=t(this,y,void 0);get open(){return this.#e}set open(e){this.#e=e}#t=(t(this,v),t(this,x,void 0));get fullscreen(){return this.#t}set fullscreen(e){this.#t=e}#s=(t(this,_),t(this,b,void 0));get hasActions(){return this.#s}set hasActions(e){this.#s=e}#o=(t(this,w),t(this,H,void 0));get hasHeader(){return this.#o}set hasHeader(e){this.#o=e}#a=(t(this,k),t(this,A,void 0));get hasHero(){return this.#a}set hasHero(e){this.#a=e}connectedCallback(){const e=this.shadowRoot.querySelector('slot[name="actions"]');this.hasActions=0!==Array.from(e?.assignedNodes()||[]).length;let t=this.shadowRoot.querySelector('slot[name="header"]');const s=["title","header-start","header-end"];let o=0;for(;0===Array.from(t.assignedElements()).length&&o<s.length;)t=this.shadowRoot.querySelector(`slot[name="${s[o]}"]`),o+=1;this.hasHeader=0!==t.assignedElements().length;const a=this.shadowRoot.querySelector('slot[name="hero-icon"]');this.hashero=0!==Array.from(a?.assignedNodes()||[]).length}onChange(e,t){"open"===e&&(this.open?this.querySelector('[slot="actions"]')
|
|
1
|
+
import{_ as e,a as t,e as s}from"./custom-element-BMhVvZjf.js";import{t as o,j as a,v as n,D as r}from"./property-Do5-bKhz.js";import"./elevation.js";import"./icon.js";import"./index-B3uz3f8C.js";let i=(()=>{let i,l,c,h,d,m,p,u=[s("custom-dialog")],g=[],f=r,y=[],v=[],x=[],_=[],b=[],w=[],H=[],k=[],A=[],j=[];return class extends f{static{l=this}static{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;c=[o({type:Boolean,reflect:!0})],h=[o({type:Boolean,reflect:!0})],d=[o({type:Boolean,reflect:!0,attribute:"has-actions"})],m=[o({type:Boolean,reflect:!0,attribute:"has-header"})],p=[o({type:Boolean,reflect:!0,attribute:"has-hero"})],e(this,null,c,{kind:"accessor",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:t},y,v),e(this,null,h,{kind:"accessor",name:"fullscreen",static:!1,private:!1,access:{has:e=>"fullscreen"in e,get:e=>e.fullscreen,set:(e,t)=>{e.fullscreen=t}},metadata:t},x,_),e(this,null,d,{kind:"accessor",name:"hasActions",static:!1,private:!1,access:{has:e=>"hasActions"in e,get:e=>e.hasActions,set:(e,t)=>{e.hasActions=t}},metadata:t},b,w),e(this,null,m,{kind:"accessor",name:"hasHeader",static:!1,private:!1,access:{has:e=>"hasHeader"in e,get:e=>e.hasHeader,set:(e,t)=>{e.hasHeader=t}},metadata:t},H,k),e(this,null,p,{kind:"accessor",name:"hasHero",static:!1,private:!1,access:{has:e=>"hasHero"in e,get:e=>e.hasHero,set:(e,t)=>{e.hasHero=t}},metadata:t},A,j),e(null,i={value:l},u,{kind:"class",name:l.name,metadata:t},null,g),l=i.value,t&&Object.defineProperty(l,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}#e=t(this,y,void 0);get open(){return this.#e}set open(e){this.#e=e}#t=(t(this,v),t(this,x,void 0));get fullscreen(){return this.#t}set fullscreen(e){this.#t=e}#s=(t(this,_),t(this,b,void 0));get hasActions(){return this.#s}set hasActions(e){this.#s=e}#o=(t(this,w),t(this,H,void 0));get hasHeader(){return this.#o}set hasHeader(e){this.#o=e}#a=(t(this,k),t(this,A,void 0));get hasHero(){return this.#a}set hasHero(e){this.#a=e}connectedCallback(){const e=this.shadowRoot.querySelector('slot[name="actions"]');this.hasActions=0!==Array.from(e?.assignedNodes()||[]).length;let t=this.shadowRoot.querySelector('slot[name="header"]');const s=["title","header-start","header-end"];let o=0;for(;0===Array.from(t.assignedElements()).length&&o<s.length;)t=this.shadowRoot.querySelector(`slot[name="${s[o]}"]`),o+=1;this.hasHeader=0!==t.assignedElements().length;const a=this.shadowRoot.querySelector('slot[name="hero-icon"]');this.hashero=0!==Array.from(a?.assignedNodes()||[]).length}onChange(e,t){"open"===e&&(this.open?this.querySelector('[slot="actions"]')?.addEventListener("click",this._close):this.querySelector('[slot="actions"]')?.removeEventListener("click",this._close))}_close=(t(this,j),e=>{const t=e.composedPath()[0];this.dispatchEvent(new CustomEvent("close",{detail:t.getAttribute("action")||"close"})),this.open=!1});static styles=[a`
|
|
2
2
|
:host {
|
|
3
3
|
position: fixed;
|
|
4
4
|
inset: 0;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{_ as t,a as e,e as s}from"./custom-element-BMhVvZjf.js";import{v as i,D as a}from"./property-Do5-bKhz.js";let l=(()=>{let l,o,r=[s("custom-summary-mirror")],m=[],h=a;return class extends h{static{o=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(h[Symbol.metadata]??null):void 0;t(null,l={value:o},r,{kind:"class",name:o.name,metadata:s},null,m),o=l.value,s&&Object.defineProperty(o,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),e(o,m)}connectedCallback(){const t=window.matchMedia("(min-width: 1200px)");this._matches(t),this._matches=this._matches.bind(this),t.onchange=this._matches}_matches({matches:t}){const e=this.querySelector('[slot="left"]'),s=this.querySelector('[slot="right"]');t?s.hasAttribute("switched")&&(e.removeAttribute("switched"),e.setAttribute("slot","right"),s.setAttribute("slot","left")):(e.setAttribute("switched",""),e.setAttribute("slot","right"),s.setAttribute("slot","left"))}get template(){return i`
|
|
2
|
+
<style>
|
|
3
|
+
:host {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
height: 100%;
|
|
7
|
+
min-height: 400px;
|
|
8
|
+
max-width: 1200px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@media (min-width: 1200px) {
|
|
12
|
+
:host {
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
width: 80%;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
</style>
|
|
18
|
+
<slot name="left"></slot>
|
|
19
|
+
<slot name="right"></slot>
|
|
20
|
+
`}},o})();export{l as CustomSummaryMirror};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import{_ as t,a as e,e as a}from"./custom-element-BMhVvZjf.js";import{j as l,v as o,D as i}from"./property-Do5-bKhz.js";let s=(()=>{let s,m,n=[a("custom-summary")],r=[],d=i;return class extends d{static{m=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;t(null,s={value:m},n,{kind:"class",name:m.name,metadata:e},null,r),m=s.value,e&&Object.defineProperty(m,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static styles=[l`
|
|
2
|
+
:host {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
height: 100%;
|
|
6
|
+
min-height: 400px;
|
|
7
|
+
max-width: 1200px;
|
|
8
|
+
}
|
|
9
|
+
::slotted([slot='left']) {
|
|
10
|
+
padding-bottom: 24px;
|
|
11
|
+
}
|
|
12
|
+
@media (min-width: 1200px) {
|
|
13
|
+
:host {
|
|
14
|
+
flex-direction: row;
|
|
15
|
+
width: 80%;
|
|
16
|
+
}
|
|
17
|
+
::slotted([slot='left']) {
|
|
18
|
+
padding-right: 24px;
|
|
19
|
+
padding-bottom: 0;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
`];render(){return o`
|
|
23
|
+
<slot name="left"></slot>
|
|
24
|
+
<slot name="right"></slot>
|
|
25
|
+
`}static{e(m,r)}},m})();export{s as CustomSummary};
|
package/exports/dialog.js
CHANGED
|
@@ -79,8 +79,8 @@ let CustomDialog = (() => {
|
|
|
79
79
|
onChange(propertyKey, value) {
|
|
80
80
|
if (propertyKey === 'open') {
|
|
81
81
|
this.open
|
|
82
|
-
? this.querySelector('[slot="actions"]')
|
|
83
|
-
: this.querySelector('[slot="actions"]')
|
|
82
|
+
? this.querySelector('[slot="actions"]')?.addEventListener('click', this._close)
|
|
83
|
+
: this.querySelector('[slot="actions"]')?.removeEventListener('click', this._close);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
_close = (__runInitializers(this, _hasHero_extraInitializers), (event) => {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-CFl_-KPR.js';
|
|
2
|
+
import { customElement, html, LiteElement } from '@vandeurenglenn/lite';
|
|
3
|
+
|
|
4
|
+
let CustomSummaryMirror = (() => {
|
|
5
|
+
let _classDecorators = [customElement('custom-summary-mirror')];
|
|
6
|
+
let _classDescriptor;
|
|
7
|
+
let _classExtraInitializers = [];
|
|
8
|
+
let _classThis;
|
|
9
|
+
let _classSuper = LiteElement;
|
|
10
|
+
(class extends _classSuper {
|
|
11
|
+
static { _classThis = this; }
|
|
12
|
+
static {
|
|
13
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
14
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
15
|
+
_classThis = _classDescriptor.value;
|
|
16
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
17
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
18
|
+
}
|
|
19
|
+
connectedCallback() {
|
|
20
|
+
const match = window.matchMedia('(min-width: 1200px)');
|
|
21
|
+
this._matches(match);
|
|
22
|
+
this._matches = this._matches.bind(this);
|
|
23
|
+
match.onchange = this._matches;
|
|
24
|
+
}
|
|
25
|
+
_matches({ matches }) {
|
|
26
|
+
const left = this.querySelector('[slot="left"]');
|
|
27
|
+
const right = this.querySelector('[slot="right"]');
|
|
28
|
+
if (matches) {
|
|
29
|
+
if (right.hasAttribute('switched')) {
|
|
30
|
+
left.removeAttribute('switched');
|
|
31
|
+
left.setAttribute('slot', 'right');
|
|
32
|
+
right.setAttribute('slot', 'left');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
left.setAttribute('switched', '');
|
|
37
|
+
left.setAttribute('slot', 'right');
|
|
38
|
+
right.setAttribute('slot', 'left');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
get template() {
|
|
42
|
+
return html `
|
|
43
|
+
<style>
|
|
44
|
+
:host {
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
height: 100%;
|
|
48
|
+
min-height: 400px;
|
|
49
|
+
max-width: 1200px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@media (min-width: 1200px) {
|
|
53
|
+
:host {
|
|
54
|
+
flex-direction: row;
|
|
55
|
+
width: 80%;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
</style>
|
|
59
|
+
<slot name="left"></slot>
|
|
60
|
+
<slot name="right"></slot>
|
|
61
|
+
`;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
return _classThis;
|
|
65
|
+
})();
|
|
66
|
+
|
|
67
|
+
export { CustomSummaryMirror };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-CFl_-KPR.js';
|
|
2
|
+
import { customElement, css, html, LiteElement } from '@vandeurenglenn/lite';
|
|
3
|
+
|
|
4
|
+
let CustomSummary = (() => {
|
|
5
|
+
let _classDecorators = [customElement('custom-summary')];
|
|
6
|
+
let _classDescriptor;
|
|
7
|
+
let _classExtraInitializers = [];
|
|
8
|
+
let _classThis;
|
|
9
|
+
let _classSuper = LiteElement;
|
|
10
|
+
(class extends _classSuper {
|
|
11
|
+
static { _classThis = this; }
|
|
12
|
+
static {
|
|
13
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
14
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
15
|
+
_classThis = _classDescriptor.value;
|
|
16
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
17
|
+
}
|
|
18
|
+
static styles = [
|
|
19
|
+
css `
|
|
20
|
+
:host {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
height: 100%;
|
|
24
|
+
min-height: 400px;
|
|
25
|
+
max-width: 1200px;
|
|
26
|
+
}
|
|
27
|
+
::slotted([slot='left']) {
|
|
28
|
+
padding-bottom: 24px;
|
|
29
|
+
}
|
|
30
|
+
@media (min-width: 1200px) {
|
|
31
|
+
:host {
|
|
32
|
+
flex-direction: row;
|
|
33
|
+
width: 80%;
|
|
34
|
+
}
|
|
35
|
+
::slotted([slot='left']) {
|
|
36
|
+
padding-right: 24px;
|
|
37
|
+
padding-bottom: 0;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
`
|
|
41
|
+
];
|
|
42
|
+
render() {
|
|
43
|
+
return html `
|
|
44
|
+
<slot name="left"></slot>
|
|
45
|
+
<slot name="right"></slot>
|
|
46
|
+
`;
|
|
47
|
+
}
|
|
48
|
+
static {
|
|
49
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
return _classThis;
|
|
53
|
+
})();
|
|
54
|
+
|
|
55
|
+
export { CustomSummary };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vandeurenglenn/lite-elements",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.24",
|
|
4
4
|
"description": "set of lite elements following Material Design 3 spec",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -345,6 +345,22 @@
|
|
|
345
345
|
"import": "./exports/selector.js",
|
|
346
346
|
"types": "./exports/selector/selector.d.ts"
|
|
347
347
|
},
|
|
348
|
+
"./summary-mirror": {
|
|
349
|
+
"import": "./exports/summary-mirror.js",
|
|
350
|
+
"types": "./exports/summary/summary-mirror.d.ts"
|
|
351
|
+
},
|
|
352
|
+
"./summary-mirror.js": {
|
|
353
|
+
"import": "./exports/summary-mirror.js",
|
|
354
|
+
"types": "./exports/summary/summary-mirror.d.ts"
|
|
355
|
+
},
|
|
356
|
+
"./summary": {
|
|
357
|
+
"import": "./exports/summary.js",
|
|
358
|
+
"types": "./exports/summary/summary.d.ts"
|
|
359
|
+
},
|
|
360
|
+
"./summary.js": {
|
|
361
|
+
"import": "./exports/summary.js",
|
|
362
|
+
"types": "./exports/summary/summary.d.ts"
|
|
363
|
+
},
|
|
348
364
|
"./supporting-pane": {
|
|
349
365
|
"import": "./exports/supporting-pane.js",
|
|
350
366
|
"types": "./exports/supporting-pane/supporting-pane.d.ts"
|