@vandeurenglenn/lite-elements 0.3.24 → 0.3.26
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/banner.js +2 -2
- package/exports/bundle/button.js +2 -2
- package/exports/bundle/card.js +2 -2
- package/exports/bundle/code.js +3 -3
- package/exports/bundle/column-D2XB0lDz.js +1 -0
- package/exports/bundle/custom-element-DIOmDbQp.js +1 -0
- package/exports/bundle/demo-elements.js +1 -1
- package/exports/bundle/demo-icons.js +3 -3
- package/exports/bundle/demo-shell.js +3 -3
- package/exports/bundle/demo.js +2 -2
- package/exports/bundle/dialog.js +6 -6
- package/exports/bundle/divider.js +2 -2
- package/exports/bundle/drawer-button.js +2 -2
- package/exports/bundle/drawer-item.js +3 -3
- package/exports/bundle/drawer-layout.js +2 -2
- package/exports/bundle/drawer.js +1 -1
- package/exports/bundle/dropdown-menu.js +2 -2
- package/exports/bundle/dropdown.js +2 -2
- package/exports/bundle/elements.js +1 -1
- package/exports/bundle/elevation.js +2 -2
- package/exports/bundle/icon-button.js +3 -3
- package/exports/bundle/icon-set.js +1 -1
- package/exports/bundle/icon.js +2 -2
- package/exports/bundle/input.js +2 -2
- package/exports/bundle/list-item.js +2 -2
- package/exports/bundle/menu.js +2 -2
- package/exports/bundle/minute-field.js +2 -2
- package/exports/bundle/notification.js +76 -0
- package/exports/bundle/notifications.js +66 -0
- package/exports/bundle/pane.js +1 -1
- package/exports/bundle/rail.js +1 -1
- package/exports/bundle/root.js +1 -1
- package/exports/bundle/row-DNgwBcX5.js +33 -0
- package/exports/bundle/section.js +3 -3
- package/exports/bundle/section2.js +2 -2
- package/exports/bundle/selector.js +2 -2
- package/exports/bundle/summary-mirror.js +2 -2
- package/exports/bundle/summary.js +3 -3
- package/exports/bundle/supporting-pane.js +1 -1
- package/exports/bundle/tab.js +2 -2
- package/exports/bundle/tabs.js +2 -2
- package/exports/bundle/text-field.js +2 -2
- package/exports/bundle/theme.js +1 -1
- package/exports/bundle/time-picker.js +2 -2
- package/exports/bundle/toggle-button.js +1 -1
- package/exports/bundle/toggle.js +2 -2
- package/exports/bundle/top-app-bar.js +82 -1
- package/exports/bundle/{custom-element-BMhVvZjf.js → tslib.es6-B0cSixZg.js} +1 -1
- package/exports/bundle/typography.js +2 -2
- package/exports/bundle/upload-file.js +2 -2
- package/exports/bundle/upload.js +1 -1
- package/exports/demo-shell.js +6 -0
- package/exports/elements.d.ts +5 -1
- package/exports/elements.js +6 -0
- package/exports/notification/notification.d.ts +13 -0
- package/exports/notification/notifications.d.ts +17 -0
- package/exports/notification.js +100 -0
- package/exports/notifications.js +146 -0
- package/package.json +17 -33
- package/exports/bundle/top-app-bar-DZJ8jFM2.js +0 -114
- package/exports/button/button.d.ts +0 -13
- package/exports/elevation/elevation.d.ts +0 -11
- package/exports/icon/icon.d.ts +0 -12
- package/exports/pane/pane.d.ts +0 -14
|
@@ -1 +1,82 @@
|
|
|
1
|
-
import"./
|
|
1
|
+
import{_ as t,a as e}from"./tslib.es6-B0cSixZg.js";import{t as s,j as o,v as l,D as a}from"./property-Do5-bKhz.js";import{e as r}from"./custom-element-DIOmDbQp.js";import"./it-Dft_Rjy-.js";import"./row-DNgwBcX5.js";let i=(()=>{let i,n,c,p,m=[r("custom-top-app-bar")],d=[],g=a,y=[],h=[],u=[],x=[];return class extends g{static{n=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(g[Symbol.metadata]??null):void 0;c=[s({type:String,reflect:!0})],p=[s({type:Boolean,reflect:!0})],t(this,null,c,{kind:"accessor",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:e},y,h),t(this,null,p,{kind:"accessor",name:"scrolling",static:!1,private:!1,access:{has:t=>"scrolling"in t,get:t=>t.scrolling,set:(t,e)=>{t.scrolling=e}},metadata:e},u,x),t(null,i={value:n},m,{kind:"class",name:n.name,metadata:e},null,d),n=i.value,e&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}#t=e(this,y,"center-aligned");get type(){return this.#t}set type(t){this.#t=t}#e=(e(this,h),e(this,u,void 0));get scrolling(){return this.#e}set scrolling(t){this.#e=t}static styles=[o`
|
|
2
|
+
:host {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
width: calc(100% - 2px);
|
|
6
|
+
background-color: var(--md-sys-color-surface);
|
|
7
|
+
color: var(--md-sys-color-on-surface);
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.container {
|
|
12
|
+
padding: 20px 12px 24px 12px;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
position: relative;
|
|
15
|
+
height: 64px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:host([type='center-aligned']) .container,
|
|
19
|
+
:host([type='small']) .container {
|
|
20
|
+
justify-content: center;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:host(:not([type='center-aligned'])) ::slotted([name='title']) {
|
|
24
|
+
padding-left: 16px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:host(:not([type='large'])) ::slotted([name='title']) {
|
|
28
|
+
padding-bottom: 28px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:host([type='medium']) .container {
|
|
32
|
+
height: 112px;
|
|
33
|
+
}
|
|
34
|
+
:host([type='large']) .container {
|
|
35
|
+
height: 152px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:host([type='center-aligned']) slot[name='title']::slotted(*) {
|
|
39
|
+
position: absolute;
|
|
40
|
+
left: 50%;
|
|
41
|
+
top: 50%;
|
|
42
|
+
transform: translate(-50%, -50%);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:host(:not([type='center-aligned'])) slot[name='title']::slotted(*) {
|
|
46
|
+
padding-left: 6px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:host([scrolling]) {
|
|
50
|
+
--md-elevation-level: 2;
|
|
51
|
+
padding: 0 16px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
flex-row {
|
|
55
|
+
width: 100%;
|
|
56
|
+
align-items: center;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
custom-elevation {
|
|
60
|
+
border-radius: var(--md-sys-shape-corner-large);
|
|
61
|
+
}
|
|
62
|
+
`];connectedCallback(){document.addEventListener("custom-scroll",(({detail:t})=>{this.scrolling=t.scrolling}))}render(){return l`
|
|
63
|
+
<flex-column class="container">
|
|
64
|
+
<custom-elevation></custom-elevation>
|
|
65
|
+
<flex-row>
|
|
66
|
+
<slot name="start"></slot>
|
|
67
|
+
${"center-aligned"===this.type||"small"===this.type?l`
|
|
68
|
+
<custom-typography>
|
|
69
|
+
<slot name="title"></slot>
|
|
70
|
+
</custom-typography>
|
|
71
|
+
`:""}
|
|
72
|
+
<flex-it></flex-it>
|
|
73
|
+
<slot name="end"></slot>
|
|
74
|
+
</flex-row>
|
|
75
|
+
${"medium"===this.type||"large"===this.type?l`
|
|
76
|
+
<flex-it></flex-it>
|
|
77
|
+
<custom-typography type="headline" size="small">
|
|
78
|
+
<slot name="title"></slot>
|
|
79
|
+
</custom-typography>
|
|
80
|
+
`:""}
|
|
81
|
+
</flex-column>
|
|
82
|
+
`}constructor(){super(...arguments),e(this,x)}static{e(n,d)}},n})();export{i as CustomTopAppBar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,t,r,n,o,i){function c(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,a=n.kind,f="getter"===a?"get":"setter"===a?"set":"value",
|
|
1
|
+
function e(e,t,r,n,o,i){function c(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,a=n.kind,f="getter"===a?"get":"setter"===a?"set":"value",p=!t&&e?n.static?e:e.prototype:null,l=t||(p?Object.getOwnPropertyDescriptor(p,n.name):{}),u=!1,d=r.length-1;d>=0;d--){var g={};for(var h in n)g[h]="access"===h?{}:n[h];for(var h in n.access)g.access[h]=n.access[h];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");i.push(c(e||null))};var v=(0,r[d])("accessor"===a?{get:l.get,set:l.set}:l[f],g);if("accessor"===a){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(s=c(v.get))&&(l.get=s),(s=c(v.set))&&(l.set=s),(s=c(v.init))&&o.unshift(s)}else(s=c(v))&&("field"===a?o.unshift(s):l[f]=s)}p&&Object.defineProperty(p,n.name,l),u=!0}function t(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0}"function"==typeof SuppressedError&&SuppressedError;export{e as _,t as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as e,a as t
|
|
1
|
+
import{_ as e,a as t}from"./tslib.es6-B0cSixZg.js";import{t as s,j as a,v as l,D as y}from"./property-Do5-bKhz.js";import{e as i}from"./custom-element-DIOmDbQp.js";let m=(()=>{let m,r,o,n,d=[i("custom-typography")],c=[],f=y,p=[],g=[],h=[],v=[];return class extends f{static{r=this}static{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;o=[s({type:String,reflect:!0})],n=[s({type:String,reflect:!0})],e(this,null,o,{kind:"accessor",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:t},p,g),e(this,null,n,{kind:"accessor",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:t},h,v),e(null,m={value:r},d,{kind:"class",name:r.name,metadata:t},null,c),r=m.value,t&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}#e=t(this,p,"title");get type(){return this.#e}set type(e){this.#e=e}#t=(t(this,g),t(this,h,"large"));get size(){return this.#t}set size(e){this.#t=e}static styles=[a`
|
|
2
2
|
:host {
|
|
3
3
|
display: contents;
|
|
4
4
|
}
|
|
@@ -153,4 +153,4 @@ import{_ as e,a as t,e as s}from"./custom-element-BMhVvZjf.js";import{t as a,j a
|
|
|
153
153
|
text-transform: var(--md-sys-typescale-title-small-text-transform);
|
|
154
154
|
text-decoration: var(--md-sys-typescale-title-small-text-decoration);
|
|
155
155
|
}
|
|
156
|
-
`];render(){return
|
|
156
|
+
`];render(){return l` <slot></slot> `}constructor(){super(...arguments),t(this,v)}static{t(r,c)}},r})();export{m as CustomTypography};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as t,a as e
|
|
1
|
+
import{_ as t,a as e}from"./tslib.es6-B0cSixZg.js";import{t as l,j as s,v as a,D as i}from"./property-Do5-bKhz.js";import{e as r}from"./custom-element-DIOmDbQp.js";let o=(()=>{let o,m,u,n=[r("custom-upload-file")],p=[],c=i,d=[],y=[];return class extends c{static{m=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(c[Symbol.metadata]??null):void 0;u=[l({type:Boolean})],t(this,null,u,{kind:"accessor",name:"multiple",static:!1,private:!1,access:{has:t=>"multiple"in t,get:t=>t.multiple,set:(t,e)=>{t.multiple=e}},metadata:s},d,y),t(null,o={value:m},n,{kind:"class",name:m.name,metadata:s},null,p),m=o.value,s&&Object.defineProperty(m,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),e(m,p)}#t=e(this,d,void 0);get multiple(){return this.#t}set multiple(t){this.#t=t}static get styles(){return[s`
|
|
2
2
|
:host {
|
|
3
3
|
display: flex;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ import{_ as t,a as e,e as l}from"./custom-element-BMhVvZjf.js";import{t as a,j a
|
|
|
6
6
|
input {
|
|
7
7
|
display: hidden;
|
|
8
8
|
}
|
|
9
|
-
`]}render(){return
|
|
9
|
+
`]}render(){return a`<input type="file" ?multiple=${this.multiple} />`}constructor(){super(...arguments),e(this,y)}},m})();export{o as CustomUploadFile};
|
package/exports/bundle/upload.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,a
|
|
1
|
+
import{_ as t,a}from"./tslib.es6-B0cSixZg.js";import{t as e,v as s,D as r}from"./property-Do5-bKhz.js";import{e as i}from"./custom-element-DIOmDbQp.js";let m=(()=>{let m,o,c,l=[i("custom-upload")],n=[],u=r,h=[],d=[];return class extends u{static{o=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(u[Symbol.metadata]??null):void 0;c=[e({attribute:"with-camera"})],t(this,null,c,{kind:"accessor",name:"withCamera",static:!1,private:!1,access:{has:t=>"withCamera"in t,get:t=>t.withCamera,set:(t,a)=>{t.withCamera=a}},metadata:s},h,d),t(null,m={value:o},l,{kind:"class",name:o.name,metadata:s},null,n),o=m.value,s&&Object.defineProperty(o,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),a(o,n)}#t=a(this,h,void 0);get withCamera(){return this.#t}set withCamera(t){this.#t=t}render(){return s` <custom-pages> </custom-pages> `}constructor(){super(...arguments),a(this,d)}},o})();export{m as CustomUpload};
|
package/exports/demo-shell.js
CHANGED
|
@@ -31,6 +31,8 @@ import './dropdown.js';
|
|
|
31
31
|
import './toggle.js';
|
|
32
32
|
import './toggle-button.js';
|
|
33
33
|
import './time-picker.js';
|
|
34
|
+
import './notification.js';
|
|
35
|
+
import './notifications.js';
|
|
34
36
|
import './code.js';
|
|
35
37
|
import './elevation.js';
|
|
36
38
|
import '@vandeurenglenn/flex-elements/it.js';
|
|
@@ -42,6 +44,10 @@ import '@vandeurenglenn/flex-elements/row.js';
|
|
|
42
44
|
import '@vandeurenglenn/little-pubsub';
|
|
43
45
|
import './tab.js';
|
|
44
46
|
import './input.js';
|
|
47
|
+
import 'lit';
|
|
48
|
+
import 'lit/decorators.js';
|
|
49
|
+
import '@vandeurenglenn/lite-elements/icon.js';
|
|
50
|
+
import '@vandeurenglenn/lite-elements/pane.js';
|
|
45
51
|
|
|
46
52
|
let DemoShell = (() => {
|
|
47
53
|
let _classDecorators = [customElement('demo-shell')];
|
package/exports/elements.d.ts
CHANGED
|
@@ -27,7 +27,9 @@ import { CustomDropdown } from './dropdown/dropdown.js';
|
|
|
27
27
|
import { CustomToggle } from './toggle/toggle.js';
|
|
28
28
|
import { CustomToggleButton } from './toggle/toggle-button.js';
|
|
29
29
|
import { CustomTimePicker } from './time-picker/time-picker.js';
|
|
30
|
-
|
|
30
|
+
import { CustomNotification } from './notification/notification.js';
|
|
31
|
+
import { CustomNotifications } from './notification/notifications.js';
|
|
32
|
+
export { CustomTheme, CustomDivider, CustomButton, CustomCard, CustomDialog, CustomDrawer, CustomDrawerButton, CustomDrawerItem, CustomDrawerLayout, CustomBanner, CustomPane, CustomSupportingPane, CustomSection, CustomSelector, CustomPages, CustomRoot, CustomTabs, CustomTopAppBar, CustomIcon, CustomIconSet, CustomTypography, CustomListItem, CustomMenu, CustomIconButton, CustomDropdownMenu, CustomDropdown, CustomToggle, CustomToggleButton, CustomTimePicker, CustomNotification, CustomNotifications };
|
|
31
33
|
declare global {
|
|
32
34
|
interface HTMLElementTagNameMap {
|
|
33
35
|
'custom-theme': CustomTheme;
|
|
@@ -59,5 +61,7 @@ declare global {
|
|
|
59
61
|
'custom-toggle': CustomToggle;
|
|
60
62
|
'custom-time-picker': CustomTimePicker;
|
|
61
63
|
'custom-toggle-button': CustomToggleButton;
|
|
64
|
+
'custom-notification': CustomNotification;
|
|
65
|
+
'custom-notifications': CustomNotifications;
|
|
62
66
|
}
|
|
63
67
|
}
|
package/exports/elements.js
CHANGED
|
@@ -27,6 +27,8 @@ export { CustomDropdown } from './dropdown.js';
|
|
|
27
27
|
export { CustomToggle } from './toggle.js';
|
|
28
28
|
export { CustomToggleButton } from './toggle-button.js';
|
|
29
29
|
export { CustomTimePicker } from './time-picker.js';
|
|
30
|
+
export { CustomNotification } from './notification.js';
|
|
31
|
+
export { CustomNotifications } from './notifications.js';
|
|
30
32
|
import './tslib.es6-CFl_-KPR.js';
|
|
31
33
|
import '@vandeurenglenn/lite';
|
|
32
34
|
import './elevation.js';
|
|
@@ -39,3 +41,7 @@ import '@vandeurenglenn/flex-elements/row.js';
|
|
|
39
41
|
import '@vandeurenglenn/little-pubsub';
|
|
40
42
|
import './tab.js';
|
|
41
43
|
import './input.js';
|
|
44
|
+
import 'lit';
|
|
45
|
+
import 'lit/decorators.js';
|
|
46
|
+
import '@vandeurenglenn/lite-elements/icon.js';
|
|
47
|
+
import '@vandeurenglenn/lite-elements/pane.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import '@vandeurenglenn/lite-elements/icon.js';
|
|
3
|
+
import '@vandeurenglenn/flex-elements/column.js';
|
|
4
|
+
import '@vandeurenglenn/flex-elements/row.js';
|
|
5
|
+
export declare class CustomNotification extends LitElement {
|
|
6
|
+
#private;
|
|
7
|
+
accessor title: string;
|
|
8
|
+
accessor message: string;
|
|
9
|
+
accessor image: string;
|
|
10
|
+
accessor type: 'error' | 'info' | 'warning';
|
|
11
|
+
static styles: import("lit").CSSResult;
|
|
12
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LiteElement } from '@vandeurenglenn/lite';
|
|
2
|
+
import './notification.js';
|
|
3
|
+
import '@vandeurenglenn/lite-elements/icon.js';
|
|
4
|
+
import '@vandeurenglenn/lite-elements/pane.js';
|
|
5
|
+
import '@vandeurenglenn/flex-elements/row.js';
|
|
6
|
+
export declare class CustomNotifications extends LiteElement {
|
|
7
|
+
accessor open: boolean;
|
|
8
|
+
get _list(): Element;
|
|
9
|
+
createNotification({ title, message, image }: {
|
|
10
|
+
title: string;
|
|
11
|
+
message: string;
|
|
12
|
+
image?: string;
|
|
13
|
+
}, timeout?: EpochTimeStamp): void;
|
|
14
|
+
_onclick(): void;
|
|
15
|
+
static styles: import("@lit/reactive-element/css-tag.js").CSSResult[];
|
|
16
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-CFl_-KPR.js';
|
|
2
|
+
import { css, html, LitElement } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import '@vandeurenglenn/lite-elements/icon.js';
|
|
5
|
+
import '@vandeurenglenn/flex-elements/column.js';
|
|
6
|
+
import '@vandeurenglenn/flex-elements/row.js';
|
|
7
|
+
|
|
8
|
+
let CustomNotification = (() => {
|
|
9
|
+
let _classDecorators = [customElement('custom-notification')];
|
|
10
|
+
let _classDescriptor;
|
|
11
|
+
let _classExtraInitializers = [];
|
|
12
|
+
let _classThis;
|
|
13
|
+
let _classSuper = LitElement;
|
|
14
|
+
let _title_decorators;
|
|
15
|
+
let _title_initializers = [];
|
|
16
|
+
let _title_extraInitializers = [];
|
|
17
|
+
let _message_decorators;
|
|
18
|
+
let _message_initializers = [];
|
|
19
|
+
let _message_extraInitializers = [];
|
|
20
|
+
let _image_decorators;
|
|
21
|
+
let _image_initializers = [];
|
|
22
|
+
let _image_extraInitializers = [];
|
|
23
|
+
let _type_decorators;
|
|
24
|
+
let _type_initializers = [];
|
|
25
|
+
let _type_extraInitializers = [];
|
|
26
|
+
(class extends _classSuper {
|
|
27
|
+
static { _classThis = this; }
|
|
28
|
+
static {
|
|
29
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
30
|
+
_title_decorators = [property()];
|
|
31
|
+
_message_decorators = [property()];
|
|
32
|
+
_image_decorators = [property()];
|
|
33
|
+
_type_decorators = [property()];
|
|
34
|
+
__esDecorate(this, null, _title_decorators, { kind: "accessor", name: "title", static: false, private: false, access: { has: obj => "title" in obj, get: obj => obj.title, set: (obj, value) => { obj.title = value; } }, metadata: _metadata }, _title_initializers, _title_extraInitializers);
|
|
35
|
+
__esDecorate(this, null, _message_decorators, { kind: "accessor", name: "message", static: false, private: false, access: { has: obj => "message" in obj, get: obj => obj.message, set: (obj, value) => { obj.message = value; } }, metadata: _metadata }, _message_initializers, _message_extraInitializers);
|
|
36
|
+
__esDecorate(this, null, _image_decorators, { kind: "accessor", name: "image", static: false, private: false, access: { has: obj => "image" in obj, get: obj => obj.image, set: (obj, value) => { obj.image = value; } }, metadata: _metadata }, _image_initializers, _image_extraInitializers);
|
|
37
|
+
__esDecorate(this, null, _type_decorators, { kind: "accessor", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _type_extraInitializers);
|
|
38
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
39
|
+
_classThis = _classDescriptor.value;
|
|
40
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
41
|
+
}
|
|
42
|
+
#title_accessor_storage = __runInitializers(this, _title_initializers, void 0);
|
|
43
|
+
get title() { return this.#title_accessor_storage; }
|
|
44
|
+
set title(value) { this.#title_accessor_storage = value; }
|
|
45
|
+
#message_accessor_storage = (__runInitializers(this, _title_extraInitializers), __runInitializers(this, _message_initializers, void 0));
|
|
46
|
+
get message() { return this.#message_accessor_storage; }
|
|
47
|
+
set message(value) { this.#message_accessor_storage = value; }
|
|
48
|
+
#image_accessor_storage = (__runInitializers(this, _message_extraInitializers), __runInitializers(this, _image_initializers, void 0));
|
|
49
|
+
get image() { return this.#image_accessor_storage; }
|
|
50
|
+
set image(value) { this.#image_accessor_storage = value; }
|
|
51
|
+
#type_accessor_storage = (__runInitializers(this, _image_extraInitializers), __runInitializers(this, _type_initializers, void 0));
|
|
52
|
+
get type() { return this.#type_accessor_storage; }
|
|
53
|
+
set type(value) { this.#type_accessor_storage = value; }
|
|
54
|
+
#onclick = (__runInitializers(this, _type_extraInitializers), () => {
|
|
55
|
+
this.parentElement.removeChild(this);
|
|
56
|
+
});
|
|
57
|
+
static styles = css `
|
|
58
|
+
:host {
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: flex-start;
|
|
61
|
+
font-size: 13px;
|
|
62
|
+
border: 1px solid;
|
|
63
|
+
border-radius: 12px;
|
|
64
|
+
padding: 6px 12px;
|
|
65
|
+
box-sizing: border-box;
|
|
66
|
+
margin-bottom: 12px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
flex-row {
|
|
70
|
+
height: 24px;
|
|
71
|
+
box-sizing: border-box;
|
|
72
|
+
align-items: center;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
strong {
|
|
76
|
+
font-size: 14px;
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
render() {
|
|
80
|
+
return html `
|
|
81
|
+
${this.image ? html `<img src=${this.image} />` : ''}
|
|
82
|
+
<flex-column>
|
|
83
|
+
<flex-row>
|
|
84
|
+
<strong>${this.title}</strong>
|
|
85
|
+
<flex-it></flex-it>
|
|
86
|
+
<custom-icon icon="close" @click=${this.#onclick}></custom-icon>
|
|
87
|
+
</flex-row>
|
|
88
|
+
|
|
89
|
+
<p>${this.message}</p>
|
|
90
|
+
</flex-column>
|
|
91
|
+
`;
|
|
92
|
+
}
|
|
93
|
+
static {
|
|
94
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
return _classThis;
|
|
98
|
+
})();
|
|
99
|
+
|
|
100
|
+
export { CustomNotification };
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-CFl_-KPR.js';
|
|
2
|
+
import { customElement, property, css, html, LiteElement } from '@vandeurenglenn/lite';
|
|
3
|
+
import './notification.js';
|
|
4
|
+
import '@vandeurenglenn/lite-elements/icon.js';
|
|
5
|
+
import '@vandeurenglenn/lite-elements/pane.js';
|
|
6
|
+
import '@vandeurenglenn/flex-elements/row.js';
|
|
7
|
+
import 'lit';
|
|
8
|
+
import 'lit/decorators.js';
|
|
9
|
+
import '@vandeurenglenn/flex-elements/column.js';
|
|
10
|
+
|
|
11
|
+
let CustomNotifications = (() => {
|
|
12
|
+
let _classDecorators = [customElement('custom-notifications')];
|
|
13
|
+
let _classDescriptor;
|
|
14
|
+
let _classExtraInitializers = [];
|
|
15
|
+
let _classThis;
|
|
16
|
+
let _classSuper = LiteElement;
|
|
17
|
+
let _open_decorators;
|
|
18
|
+
let _open_initializers = [];
|
|
19
|
+
let _open_extraInitializers = [];
|
|
20
|
+
(class extends _classSuper {
|
|
21
|
+
static { _classThis = this; }
|
|
22
|
+
static {
|
|
23
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
24
|
+
_open_decorators = [property({ type: Boolean, reflect: true })];
|
|
25
|
+
__esDecorate(this, null, _open_decorators, { kind: "accessor", name: "open", static: false, private: false, access: { has: obj => "open" in obj, get: obj => obj.open, set: (obj, value) => { obj.open = value; } }, metadata: _metadata }, _open_initializers, _open_extraInitializers);
|
|
26
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
27
|
+
_classThis = _classDescriptor.value;
|
|
28
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
29
|
+
}
|
|
30
|
+
#open_accessor_storage = __runInitializers(this, _open_initializers, void 0);
|
|
31
|
+
get open() { return this.#open_accessor_storage; }
|
|
32
|
+
set open(value) { this.#open_accessor_storage = value; }
|
|
33
|
+
get _list() {
|
|
34
|
+
return this.shadowRoot.querySelector('.list');
|
|
35
|
+
}
|
|
36
|
+
createNotification({ title, message, image }, timeout = 3000) {
|
|
37
|
+
const notification = document.createElement('custom-notification');
|
|
38
|
+
notification.title = title;
|
|
39
|
+
notification.message = message;
|
|
40
|
+
notification.image = image;
|
|
41
|
+
if (timeout) {
|
|
42
|
+
setTimeout(() => {
|
|
43
|
+
this.removeChild(notification);
|
|
44
|
+
const _notification = document.createElement('custom-notification');
|
|
45
|
+
_notification.image = image;
|
|
46
|
+
_notification.title = title;
|
|
47
|
+
_notification.message = message;
|
|
48
|
+
this._list.appendChild(_notification);
|
|
49
|
+
}, timeout);
|
|
50
|
+
}
|
|
51
|
+
this.appendChild(notification);
|
|
52
|
+
}
|
|
53
|
+
_onclick() {
|
|
54
|
+
const children = Array.from(this._list.querySelectorAll('custom-notification'));
|
|
55
|
+
for (const child of children) {
|
|
56
|
+
this._list.removeChild(child);
|
|
57
|
+
}
|
|
58
|
+
this.open = false;
|
|
59
|
+
}
|
|
60
|
+
static styles = [
|
|
61
|
+
css `
|
|
62
|
+
:host {
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
pointer-events: auto;
|
|
66
|
+
z-index: 10001;
|
|
67
|
+
position: absolute;
|
|
68
|
+
right: 0;
|
|
69
|
+
top: 0;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
width: 100%;
|
|
72
|
+
max-width: 320px;
|
|
73
|
+
height: auto;
|
|
74
|
+
box-sizing: border-box;
|
|
75
|
+
color: #eee;
|
|
76
|
+
pointer-events: none;
|
|
77
|
+
height: 100%;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
:host([open]) {
|
|
81
|
+
background: rgb(51, 55, 80);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.recents {
|
|
85
|
+
display: block;
|
|
86
|
+
position: relative;
|
|
87
|
+
top: 12px;
|
|
88
|
+
right: 12px;
|
|
89
|
+
width: 100%;
|
|
90
|
+
pointer-events: none;
|
|
91
|
+
|
|
92
|
+
box-sizing: border-box;
|
|
93
|
+
padding: 12px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.list {
|
|
97
|
+
padding: 24px;
|
|
98
|
+
height: 100%;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
custom-icon {
|
|
102
|
+
pointer-events: auto;
|
|
103
|
+
}
|
|
104
|
+
`
|
|
105
|
+
];
|
|
106
|
+
render() {
|
|
107
|
+
return html `
|
|
108
|
+
<flex-row style="margin-top: 12px;margin-right: 12px;">
|
|
109
|
+
<flex-it></flex-it>
|
|
110
|
+
<custom-icon
|
|
111
|
+
icon="notifications"
|
|
112
|
+
@click=${() => {
|
|
113
|
+
if (this._list.childElementCount === 0)
|
|
114
|
+
return;
|
|
115
|
+
this.open = !this.open;
|
|
116
|
+
}}
|
|
117
|
+
></custom-icon>
|
|
118
|
+
</flex-row>
|
|
119
|
+
|
|
120
|
+
<span class="recents">
|
|
121
|
+
<slot></slot>
|
|
122
|
+
</span>
|
|
123
|
+
|
|
124
|
+
<custom-pane ?open=${this.open} right top>
|
|
125
|
+
<span slot="header"></span>
|
|
126
|
+
<flex-column class="list" slot="content"> </flex-column>
|
|
127
|
+
|
|
128
|
+
<flex-row slot="footer" width="100%">
|
|
129
|
+
<flex-it></flex-it>
|
|
130
|
+
<custom-icon style="margin-right: 24px;" icon="clear-all" @click="${this._onclick}"></custom-icon>
|
|
131
|
+
</flex-row>
|
|
132
|
+
</custom-pane>
|
|
133
|
+
`;
|
|
134
|
+
}
|
|
135
|
+
constructor() {
|
|
136
|
+
super(...arguments);
|
|
137
|
+
__runInitializers(this, _open_extraInitializers);
|
|
138
|
+
}
|
|
139
|
+
static {
|
|
140
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
return _classThis;
|
|
144
|
+
})();
|
|
145
|
+
|
|
146
|
+
export { CustomNotifications };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vandeurenglenn/lite-elements",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.26",
|
|
4
4
|
"description": "set of lite elements following Material Design 3 spec",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -57,14 +57,6 @@
|
|
|
57
57
|
"import": "./exports/banner.js",
|
|
58
58
|
"types": "./exports/banner/banner.d.ts"
|
|
59
59
|
},
|
|
60
|
-
"./button": {
|
|
61
|
-
"import": "./exports/button.js",
|
|
62
|
-
"types": "./exports/button/button.d.ts"
|
|
63
|
-
},
|
|
64
|
-
"./button.js": {
|
|
65
|
-
"import": "./exports/button.js",
|
|
66
|
-
"types": "./exports/button/button.d.ts"
|
|
67
|
-
},
|
|
68
60
|
"./card": {
|
|
69
61
|
"import": "./exports/card.js",
|
|
70
62
|
"types": "./exports/card/card.d.ts"
|
|
@@ -193,14 +185,6 @@
|
|
|
193
185
|
"import": "./exports/elements.js",
|
|
194
186
|
"types": "./exports/elements.d.ts"
|
|
195
187
|
},
|
|
196
|
-
"./elevation": {
|
|
197
|
-
"import": "./exports/elevation.js",
|
|
198
|
-
"types": "./exports/elevation/elevation.d.ts"
|
|
199
|
-
},
|
|
200
|
-
"./elevation.js": {
|
|
201
|
-
"import": "./exports/elevation.js",
|
|
202
|
-
"types": "./exports/elevation/elevation.d.ts"
|
|
203
|
-
},
|
|
204
188
|
"./hour-field": {
|
|
205
189
|
"import": "./exports/hour-field.js",
|
|
206
190
|
"types": "./exports/time-picker/hour-field.d.ts"
|
|
@@ -225,14 +209,6 @@
|
|
|
225
209
|
"import": "./exports/icon-set.js",
|
|
226
210
|
"types": "./exports/icon/icon-set.d.ts"
|
|
227
211
|
},
|
|
228
|
-
"./icon": {
|
|
229
|
-
"import": "./exports/icon.js",
|
|
230
|
-
"types": "./exports/icon/icon.d.ts"
|
|
231
|
-
},
|
|
232
|
-
"./icon.js": {
|
|
233
|
-
"import": "./exports/icon.js",
|
|
234
|
-
"types": "./exports/icon/icon.d.ts"
|
|
235
|
-
},
|
|
236
212
|
"./input": {
|
|
237
213
|
"import": "./exports/input.js",
|
|
238
214
|
"types": "./exports/time-picker/input.d.ts"
|
|
@@ -273,6 +249,22 @@
|
|
|
273
249
|
"import": "./exports/minute-field.js",
|
|
274
250
|
"types": "./exports/time-picker/minute-field.d.ts"
|
|
275
251
|
},
|
|
252
|
+
"./notification": {
|
|
253
|
+
"import": "./exports/notification.js",
|
|
254
|
+
"types": "./exports/notification/notification.d.ts"
|
|
255
|
+
},
|
|
256
|
+
"./notification.js": {
|
|
257
|
+
"import": "./exports/notification.js",
|
|
258
|
+
"types": "./exports/notification/notification.d.ts"
|
|
259
|
+
},
|
|
260
|
+
"./notifications": {
|
|
261
|
+
"import": "./exports/notifications.js",
|
|
262
|
+
"types": "./exports/notification/notifications.d.ts"
|
|
263
|
+
},
|
|
264
|
+
"./notifications.js": {
|
|
265
|
+
"import": "./exports/notifications.js",
|
|
266
|
+
"types": "./exports/notification/notifications.d.ts"
|
|
267
|
+
},
|
|
276
268
|
"./pages": {
|
|
277
269
|
"import": "./exports/pages.js",
|
|
278
270
|
"types": "./exports/pages/pages.d.ts"
|
|
@@ -281,14 +273,6 @@
|
|
|
281
273
|
"import": "./exports/pages.js",
|
|
282
274
|
"types": "./exports/pages/pages.d.ts"
|
|
283
275
|
},
|
|
284
|
-
"./pane": {
|
|
285
|
-
"import": "./exports/pane.js",
|
|
286
|
-
"types": "./exports/pane/pane.d.ts"
|
|
287
|
-
},
|
|
288
|
-
"./pane.js": {
|
|
289
|
-
"import": "./exports/pane.js",
|
|
290
|
-
"types": "./exports/pane/pane.d.ts"
|
|
291
|
-
},
|
|
292
276
|
"./rail": {
|
|
293
277
|
"import": "./exports/rail.js",
|
|
294
278
|
"types": "./exports/rail/rail.d.ts"
|