pv-panel-sample 0.1.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/dist/pv-panel-sample.d.ts +15 -0
- package/dist/pv-panel-sample.js +82 -0
- package/dist/pv-panel-sample.umd.cjs +39 -0
- package/package.json +33 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from 'lit';
|
|
2
|
+
export declare class PvPanelSample extends LitElement {
|
|
3
|
+
opened: boolean;
|
|
4
|
+
name?: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
_openedToggle(): void;
|
|
7
|
+
_iconClick(e: MouseEvent): void;
|
|
8
|
+
render(): TemplateResult;
|
|
9
|
+
static styles: import('lit').CSSResult;
|
|
10
|
+
}
|
|
11
|
+
declare global {
|
|
12
|
+
interface HTMLElementTagNameMap {
|
|
13
|
+
'pv-panel-sample': PvPanelSample;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { css as v, LitElement as h, html as p } from "lit";
|
|
2
|
+
import { property as a, customElement as m } from "lit/decorators.js";
|
|
3
|
+
import { when as c } from "lit/directives/when.js";
|
|
4
|
+
var b = Object.defineProperty, g = Object.getOwnPropertyDescriptor, n = (i, t, s, r) => {
|
|
5
|
+
for (var e = r > 1 ? void 0 : r ? g(t, s) : t, l = i.length - 1, d; l >= 0; l--)
|
|
6
|
+
(d = i[l]) && (e = (r ? d(t, s, e) : d(e)) || e);
|
|
7
|
+
return r && e && b(t, s, e), e;
|
|
8
|
+
};
|
|
9
|
+
let o = class extends h {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments), this.opened = !1, this.name = "pv-panel-sample", this.icon = "👍";
|
|
12
|
+
}
|
|
13
|
+
_openedToggle() {
|
|
14
|
+
this.opened = !this.opened;
|
|
15
|
+
}
|
|
16
|
+
_iconClick(i) {
|
|
17
|
+
i.stopPropagation(), this.dispatchEvent(new CustomEvent(
|
|
18
|
+
"icon-click",
|
|
19
|
+
{
|
|
20
|
+
bubbles: !0,
|
|
21
|
+
detail: { icon: this.icon, opened: this.opened }
|
|
22
|
+
}
|
|
23
|
+
));
|
|
24
|
+
}
|
|
25
|
+
render() {
|
|
26
|
+
return p`
|
|
27
|
+
<div>
|
|
28
|
+
<div class="title" @click=${() => this.opened = !this.opened}>
|
|
29
|
+
Title for [${this.name}] - ${this.opened}
|
|
30
|
+
<div @click=${this._iconClick}>${this.icon}</div>
|
|
31
|
+
</div>
|
|
32
|
+
<!-- ${c(this.opened, () => p`<div>is opened</div>`, () => p`<div>is closed</div>`)} -->
|
|
33
|
+
${c(this.opened, () => p`
|
|
34
|
+
<div class="body" @click=${this._openedToggle} >
|
|
35
|
+
<slot></slot>
|
|
36
|
+
</div>
|
|
37
|
+
`)}
|
|
38
|
+
</div>
|
|
39
|
+
`;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
o.styles = v`
|
|
43
|
+
* {
|
|
44
|
+
color: inherit;
|
|
45
|
+
background: inherit;
|
|
46
|
+
}
|
|
47
|
+
/* :host {} */
|
|
48
|
+
.title {
|
|
49
|
+
padding: 0.8rem;
|
|
50
|
+
border-top-left-radius: 1rem;
|
|
51
|
+
border-top-right-radius: 1rem;
|
|
52
|
+
|
|
53
|
+
color: var(--pv-panel-primary-color, white);
|
|
54
|
+
background: var(--pv-panel-primary-bg, #000);
|
|
55
|
+
|
|
56
|
+
display: flex;
|
|
57
|
+
justify-content: space-between;
|
|
58
|
+
align-items: center;
|
|
59
|
+
}
|
|
60
|
+
.body {
|
|
61
|
+
padding: 1rem;
|
|
62
|
+
|
|
63
|
+
color: var(--pv-panel-secondary-color, #000);
|
|
64
|
+
background: var(--pv-panel-secondary-bg, white);
|
|
65
|
+
border: 1px solid var(--pv-panel-primary-bg, #000);
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
n([
|
|
69
|
+
a({ type: Boolean })
|
|
70
|
+
], o.prototype, "opened", 2);
|
|
71
|
+
n([
|
|
72
|
+
a()
|
|
73
|
+
], o.prototype, "name", 2);
|
|
74
|
+
n([
|
|
75
|
+
a()
|
|
76
|
+
], o.prototype, "icon", 2);
|
|
77
|
+
o = n([
|
|
78
|
+
m("pv-panel-sample")
|
|
79
|
+
], o);
|
|
80
|
+
export {
|
|
81
|
+
o as PvPanelSample
|
|
82
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
(function(e,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("lit"),require("lit/decorators.js"),require("lit/directives/when.js")):typeof define=="function"&&define.amd?define(["exports","lit","lit/decorators.js","lit/directives/when.js"],i):(e=typeof globalThis<"u"?globalThis:e||self,i(e.PvPanelSample={},e.Lit,e.LitDecorators,e.LitDirectivesWhen))})(this,(function(e,i,o,c){"use strict";var v=Object.defineProperty,h=Object.getOwnPropertyDescriptor,r=(l,n,s,p)=>{for(var t=p>1?void 0:p?h(n,s):n,a=l.length-1,d;a>=0;a--)(d=l[a])&&(t=(p?d(n,s,t):d(t))||t);return p&&t&&v(n,s,t),t};e.PvPanelSample=class extends i.LitElement{constructor(){super(...arguments),this.opened=!1,this.name="pv-panel-sample",this.icon="👍"}_openedToggle(){this.opened=!this.opened}_iconClick(n){n.stopPropagation(),this.dispatchEvent(new CustomEvent("icon-click",{bubbles:!0,detail:{icon:this.icon,opened:this.opened}}))}render(){return i.html`
|
|
2
|
+
<div>
|
|
3
|
+
<div class="title" @click=${()=>this.opened=!this.opened}>
|
|
4
|
+
Title for [${this.name}] - ${this.opened}
|
|
5
|
+
<div @click=${this._iconClick}>${this.icon}</div>
|
|
6
|
+
</div>
|
|
7
|
+
<!-- ${c.when(this.opened,()=>i.html`<div>is opened</div>`,()=>i.html`<div>is closed</div>`)} -->
|
|
8
|
+
${c.when(this.opened,()=>i.html`
|
|
9
|
+
<div class="body" @click=${this._openedToggle} >
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</div>
|
|
12
|
+
`)}
|
|
13
|
+
</div>
|
|
14
|
+
`}},e.PvPanelSample.styles=i.css`
|
|
15
|
+
* {
|
|
16
|
+
color: inherit;
|
|
17
|
+
background: inherit;
|
|
18
|
+
}
|
|
19
|
+
/* :host {} */
|
|
20
|
+
.title {
|
|
21
|
+
padding: 0.8rem;
|
|
22
|
+
border-top-left-radius: 1rem;
|
|
23
|
+
border-top-right-radius: 1rem;
|
|
24
|
+
|
|
25
|
+
color: var(--pv-panel-primary-color, white);
|
|
26
|
+
background: var(--pv-panel-primary-bg, #000);
|
|
27
|
+
|
|
28
|
+
display: flex;
|
|
29
|
+
justify-content: space-between;
|
|
30
|
+
align-items: center;
|
|
31
|
+
}
|
|
32
|
+
.body {
|
|
33
|
+
padding: 1rem;
|
|
34
|
+
|
|
35
|
+
color: var(--pv-panel-secondary-color, #000);
|
|
36
|
+
background: var(--pv-panel-secondary-bg, white);
|
|
37
|
+
border: 1px solid var(--pv-panel-primary-bg, #000);
|
|
38
|
+
}
|
|
39
|
+
`,r([o.property({type:Boolean})],e.PvPanelSample.prototype,"opened",2),r([o.property()],e.PvPanelSample.prototype,"name",2),r([o.property()],e.PvPanelSample.prototype,"icon",2),e.PvPanelSample=r([o.customElement("pv-panel-sample")],e.PvPanelSample),Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pv-panel-sample",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"main": "./dist/pv-panel-sample.umd.cjs",
|
|
10
|
+
"module": "./dist/pv-panel-sample.js",
|
|
11
|
+
"types": "./dist/pv-panel-sample.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/pv-panel-sample.d.ts",
|
|
15
|
+
"import": "./dist/pv-panel-sample.js",
|
|
16
|
+
"require": "./dist/pv-panel-sample.umd.cjs"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"dev": "vite",
|
|
21
|
+
"build": "tsc && vite build",
|
|
22
|
+
"preview": "vite preview"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"lit": "^3.0.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"lit": "^3.3.1",
|
|
29
|
+
"typescript": "~5.9.3",
|
|
30
|
+
"vite": "^7.2.4",
|
|
31
|
+
"vite-plugin-dts": "^4.5.0"
|
|
32
|
+
}
|
|
33
|
+
}
|