@logosphere-ui/core 0.0.0-alpha.8 → 0.0.0-alpha.9
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/badge-CHWTCGQG.js +72 -0
- package/dist/badge-DVvdodRb.cjs +13 -0
- package/dist/badge.cjs +1 -0
- package/dist/badge.js +4 -0
- package/dist/breadcrumb-BB61Xt0s.js +41 -0
- package/dist/breadcrumb-Cop-B1J7.cjs +12 -0
- package/dist/breadcrumb.cjs +1 -0
- package/dist/breadcrumb.js +4 -0
- package/dist/button-BqOMevro.js +58 -0
- package/dist/button-CDRccsk9.cjs +10 -0
- package/dist/button.cjs +1 -0
- package/dist/button.js +4 -0
- package/dist/card-CNoTUaJC.js +98 -0
- package/dist/card-KiNHfEi2.cjs +43 -0
- package/dist/card.cjs +1 -0
- package/dist/card.js +4 -0
- package/dist/chatbot-BNGCxSf9.js +485 -0
- package/dist/chatbot-P32-Xv7e.cjs +160 -0
- package/dist/chatbot.cjs +1 -0
- package/dist/chatbot.js +4 -0
- package/dist/checkbox-CdDTRdKV.cjs +37 -0
- package/dist/checkbox-g6kl2jGR.js +119 -0
- package/dist/checkbox.cjs +1 -0
- package/dist/checkbox.js +4 -0
- package/dist/combobox-CeK7yW2F.cjs +99 -0
- package/dist/combobox-DTUSFw9V.js +270 -0
- package/dist/combobox.cjs +1 -0
- package/dist/combobox.js +4 -0
- package/dist/datepicker-BQOVo1Pr.cjs +115 -0
- package/dist/datepicker-ChdQsc_l.js +751 -0
- package/dist/datepicker.cjs +1 -0
- package/dist/datepicker.js +4 -0
- package/dist/download-manager-BSIMTGaK.cjs +97 -0
- package/dist/download-manager-a541AYhr.js +381 -0
- package/dist/download-manager.cjs +1 -0
- package/dist/download-manager.js +4 -0
- package/dist/formfield-BOgRugzm.js +118 -0
- package/dist/formfield-D_7NFFoe.cjs +27 -0
- package/dist/formfield.cjs +1 -0
- package/dist/formfield.js +4 -0
- package/dist/index.cjs +1 -0
- package/dist/index.js +32 -3207
- package/dist/index.umd.js +106 -85
- package/dist/input-CoY1ZcPF.cjs +46 -0
- package/dist/input-CxBP0i-3.js +194 -0
- package/dist/input.cjs +1 -0
- package/dist/input.js +4 -0
- package/dist/modal-CnwRIdd8.js +110 -0
- package/dist/modal-DQ8VFL-P.cjs +39 -0
- package/dist/modal.cjs +1 -0
- package/dist/modal.js +4 -0
- package/dist/popover-C2p5Pmts.cjs +30 -0
- package/dist/popover-CaVOXo_k.js +140 -0
- package/dist/popover.cjs +1 -0
- package/dist/popover.js +4 -0
- package/dist/switch-CG4SSjTg.js +64 -0
- package/dist/switch-Rnnn10bn.cjs +17 -0
- package/dist/switch.cjs +1 -0
- package/dist/switch.js +4 -0
- package/dist/tab-BYU_XEhp.js +176 -0
- package/dist/tab-DcjAlXzU.cjs +40 -0
- package/dist/tab.cjs +1 -0
- package/dist/tab.js +4 -0
- package/dist/text-area-Dw4CUBcz.js +206 -0
- package/dist/text-area-eT-oCnqZ.cjs +44 -0
- package/dist/textarea.cjs +1 -0
- package/dist/textarea.js +4 -0
- package/dist/ui-icon-CVEyvL5D.cjs +22 -0
- package/dist/ui-icon-ltkJROhR.js +51 -0
- package/package.json +31 -20
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";const o=require("lit"),t=require("lit/decorators.js"),h=require("lit/directives/live.js");require("./formfield-D_7NFFoe.cjs");require("./ui-icon-CVEyvL5D.cjs");const u=".input__field{width:100%;background:transparent;border:none;outline:none;font-size:var(--font-size-sm);font-family:var(--font-family-base);color:var(--color-body-text);box-sizing:border-box;line-height:1.5}.input__field::placeholder{color:var(--color-tertiary)}.input__field:disabled{cursor:not-allowed}.input__field--default{height:16px}.input__field--large{height:24px}.input__clear-btn{border:none;background:transparent;color:var(--color-gray-400);cursor:pointer;padding:0;display:inline-flex;align-items:center;outline:none;flex-shrink:0;transition:color var(--transition-speed-fast) var(--transition-timing)}.input__clear-btn:hover{color:var(--color-gray-600)}";var y=Object.defineProperty,d=Object.getOwnPropertyDescriptor,r=(s,e,i,n)=>{for(var p=n>1?void 0:n?d(e,i):e,l=s.length-1,a;l>=0;l--)(a=s[l])&&(p=(n?a(e,i,p):a(p))||p);return n&&p&&y(e,i,p),p};exports.LogosphereInput=class extends o.LitElement{constructor(){super(...arguments),this.value="",this.type="text",this.placeholder="",this.name="",this.autocomplete="",this.pattern="",this.size="default",this.variant="default",this.showClear=!1,this.label="",this.helper="",this.error="",this.required=!1,this.disabled=!1,this.readonly=!1,this._internalError="",this.handleInput=e=>{const i=e.target;this.value=i.value,this._internalError&&(this._internalError="",this._inputElement.setCustomValidity("")),this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0,detail:{value:this.value,originalEvent:e}}))},this.handleChange=e=>{const i=e.target;this.value=i.value,i.checkValidity()||(this._internalError=i.validationMessage),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{value:this.value,originalEvent:e}}))},this.handleKeyDown=e=>{this.dispatchEvent(new CustomEvent("keydown",{bubbles:!0,composed:!0,detail:{key:e.key,originalEvent:e}}))},this.handleKeyUp=e=>{this.dispatchEvent(new CustomEvent("keyup",{bubbles:!0,composed:!0,detail:{key:e.key,originalEvent:e}}))},this.handleClear=()=>{this.value="",this._inputElement&&(this._inputElement.value=""),this.dispatchEvent(new CustomEvent("clear",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0,detail:{value:"",originalEvent:null}}))}}get inputElement(){return this._inputElement}focus(){this._inputElement?.focus()}blur(){this._inputElement?.blur()}select(){this._inputElement?.select()}setSelectionRange(e,i,n){this._inputElement?.setSelectionRange(e,i,n)}checkValidity(){return this._inputElement?.checkValidity()??!0}reportValidity(){return this._inputElement?.reportValidity()??!0}setCustomValidity(e){this._inputElement?.setCustomValidity(e),this._internalError=e,this.requestUpdate()}render(){const e=this.error||this._internalError,i=this.showClear&&this.value&&!this.disabled&&!this.readonly,n=`input__field input__field--${this.size}`;return o.html`
|
|
2
|
+
<logosphere-formfield
|
|
3
|
+
.label=${this.label}
|
|
4
|
+
.helper=${this.helper}
|
|
5
|
+
.error=${e}
|
|
6
|
+
.required=${this.required}
|
|
7
|
+
.disabled=${this.disabled}
|
|
8
|
+
.readonly=${this.readonly}
|
|
9
|
+
.placeholder=${this.placeholder}
|
|
10
|
+
.size=${this.size}
|
|
11
|
+
.variant=${this.variant}
|
|
12
|
+
>
|
|
13
|
+
<input
|
|
14
|
+
class="${n}"
|
|
15
|
+
type=${this.type}
|
|
16
|
+
.value=${h.live(this.value)}
|
|
17
|
+
placeholder=${this.placeholder||o.nothing}
|
|
18
|
+
name=${this.name||o.nothing}
|
|
19
|
+
autocomplete=${this.autocomplete||o.nothing}
|
|
20
|
+
?required=${this.required}
|
|
21
|
+
?disabled=${this.disabled}
|
|
22
|
+
?readonly=${this.readonly}
|
|
23
|
+
minlength=${this.minlength??o.nothing}
|
|
24
|
+
maxlength=${this.maxlength??o.nothing}
|
|
25
|
+
pattern=${this.pattern||o.nothing}
|
|
26
|
+
min=${this.min??o.nothing}
|
|
27
|
+
max=${this.max??o.nothing}
|
|
28
|
+
step=${this.step??o.nothing}
|
|
29
|
+
@input=${this.handleInput}
|
|
30
|
+
@change=${this.handleChange}
|
|
31
|
+
@keydown=${this.handleKeyDown}
|
|
32
|
+
@keyup=${this.handleKeyUp}
|
|
33
|
+
/>
|
|
34
|
+
${i?o.html`
|
|
35
|
+
<button
|
|
36
|
+
type="button"
|
|
37
|
+
slot="suffix"
|
|
38
|
+
class="input__clear-btn"
|
|
39
|
+
@click=${this.handleClear}
|
|
40
|
+
tabindex="-1"
|
|
41
|
+
>
|
|
42
|
+
<ui-icon name="uil-times" size="14"></ui-icon>
|
|
43
|
+
</button>
|
|
44
|
+
`:o.nothing}
|
|
45
|
+
</logosphere-formfield>
|
|
46
|
+
`}};exports.LogosphereInput.styles=[o.css`${o.unsafeCSS(u)}`];r([t.query("input")],exports.LogosphereInput.prototype,"_inputElement",2);r([t.property({type:String})],exports.LogosphereInput.prototype,"value",2);r([t.property({type:String})],exports.LogosphereInput.prototype,"type",2);r([t.property({type:String})],exports.LogosphereInput.prototype,"placeholder",2);r([t.property({type:String})],exports.LogosphereInput.prototype,"name",2);r([t.property({type:String})],exports.LogosphereInput.prototype,"autocomplete",2);r([t.property({type:Number})],exports.LogosphereInput.prototype,"minlength",2);r([t.property({type:Number})],exports.LogosphereInput.prototype,"maxlength",2);r([t.property({type:String})],exports.LogosphereInput.prototype,"pattern",2);r([t.property({type:Number})],exports.LogosphereInput.prototype,"min",2);r([t.property({type:Number})],exports.LogosphereInput.prototype,"max",2);r([t.property({type:Number})],exports.LogosphereInput.prototype,"step",2);r([t.property({type:String})],exports.LogosphereInput.prototype,"size",2);r([t.property({type:String})],exports.LogosphereInput.prototype,"variant",2);r([t.property({type:Boolean})],exports.LogosphereInput.prototype,"showClear",2);r([t.property({type:String})],exports.LogosphereInput.prototype,"label",2);r([t.property({type:String})],exports.LogosphereInput.prototype,"helper",2);r([t.property({type:String})],exports.LogosphereInput.prototype,"error",2);r([t.property({type:Boolean})],exports.LogosphereInput.prototype,"required",2);r([t.property({type:Boolean})],exports.LogosphereInput.prototype,"disabled",2);r([t.property({type:Boolean})],exports.LogosphereInput.prototype,"readonly",2);r([t.state()],exports.LogosphereInput.prototype,"_internalError",2);exports.LogosphereInput=r([t.customElement("logosphere-input")],exports.LogosphereInput);
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { unsafeCSS as d, css as y, LitElement as c, nothing as o, html as u } from "lit";
|
|
2
|
+
import { query as m, property as r, state as b, customElement as v } from "lit/decorators.js";
|
|
3
|
+
import { live as g } from "lit/directives/live.js";
|
|
4
|
+
import "./formfield-BOgRugzm.js";
|
|
5
|
+
import "./ui-icon-ltkJROhR.js";
|
|
6
|
+
const _ = ".input__field{width:100%;background:transparent;border:none;outline:none;font-size:var(--font-size-sm);font-family:var(--font-family-base);color:var(--color-body-text);box-sizing:border-box;line-height:1.5}.input__field::placeholder{color:var(--color-tertiary)}.input__field:disabled{cursor:not-allowed}.input__field--default{height:16px}.input__field--large{height:24px}.input__clear-btn{border:none;background:transparent;color:var(--color-gray-400);cursor:pointer;padding:0;display:inline-flex;align-items:center;outline:none;flex-shrink:0;transition:color var(--transition-speed-fast) var(--transition-timing)}.input__clear-btn:hover{color:var(--color-gray-600)}";
|
|
7
|
+
var f = Object.defineProperty, E = Object.getOwnPropertyDescriptor, e = (i, n, l, a) => {
|
|
8
|
+
for (var s = a > 1 ? void 0 : a ? E(n, l) : n, p = i.length - 1, h; p >= 0; p--)
|
|
9
|
+
(h = i[p]) && (s = (a ? h(n, l, s) : h(s)) || s);
|
|
10
|
+
return a && s && f(n, l, s), s;
|
|
11
|
+
};
|
|
12
|
+
let t = class extends c {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments), this.value = "", this.type = "text", this.placeholder = "", this.name = "", this.autocomplete = "", this.pattern = "", this.size = "default", this.variant = "default", this.showClear = !1, this.label = "", this.helper = "", this.error = "", this.required = !1, this.disabled = !1, this.readonly = !1, this._internalError = "", this.handleInput = (i) => {
|
|
15
|
+
const n = i.target;
|
|
16
|
+
this.value = n.value, this._internalError && (this._internalError = "", this._inputElement.setCustomValidity("")), this.dispatchEvent(new CustomEvent("input", {
|
|
17
|
+
bubbles: !0,
|
|
18
|
+
composed: !0,
|
|
19
|
+
detail: { value: this.value, originalEvent: i }
|
|
20
|
+
}));
|
|
21
|
+
}, this.handleChange = (i) => {
|
|
22
|
+
const n = i.target;
|
|
23
|
+
this.value = n.value, n.checkValidity() || (this._internalError = n.validationMessage), this.dispatchEvent(new CustomEvent("change", {
|
|
24
|
+
bubbles: !0,
|
|
25
|
+
composed: !0,
|
|
26
|
+
detail: { value: this.value, originalEvent: i }
|
|
27
|
+
}));
|
|
28
|
+
}, this.handleKeyDown = (i) => {
|
|
29
|
+
this.dispatchEvent(new CustomEvent("keydown", {
|
|
30
|
+
bubbles: !0,
|
|
31
|
+
composed: !0,
|
|
32
|
+
detail: { key: i.key, originalEvent: i }
|
|
33
|
+
}));
|
|
34
|
+
}, this.handleKeyUp = (i) => {
|
|
35
|
+
this.dispatchEvent(new CustomEvent("keyup", {
|
|
36
|
+
bubbles: !0,
|
|
37
|
+
composed: !0,
|
|
38
|
+
detail: { key: i.key, originalEvent: i }
|
|
39
|
+
}));
|
|
40
|
+
}, this.handleClear = () => {
|
|
41
|
+
this.value = "", this._inputElement && (this._inputElement.value = ""), this.dispatchEvent(new CustomEvent("clear", { bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("input", {
|
|
42
|
+
bubbles: !0,
|
|
43
|
+
composed: !0,
|
|
44
|
+
detail: { value: "", originalEvent: null }
|
|
45
|
+
}));
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
get inputElement() {
|
|
49
|
+
return this._inputElement;
|
|
50
|
+
}
|
|
51
|
+
focus() {
|
|
52
|
+
this._inputElement?.focus();
|
|
53
|
+
}
|
|
54
|
+
blur() {
|
|
55
|
+
this._inputElement?.blur();
|
|
56
|
+
}
|
|
57
|
+
select() {
|
|
58
|
+
this._inputElement?.select();
|
|
59
|
+
}
|
|
60
|
+
setSelectionRange(i, n, l) {
|
|
61
|
+
this._inputElement?.setSelectionRange(i, n, l);
|
|
62
|
+
}
|
|
63
|
+
checkValidity() {
|
|
64
|
+
return this._inputElement?.checkValidity() ?? !0;
|
|
65
|
+
}
|
|
66
|
+
reportValidity() {
|
|
67
|
+
return this._inputElement?.reportValidity() ?? !0;
|
|
68
|
+
}
|
|
69
|
+
setCustomValidity(i) {
|
|
70
|
+
this._inputElement?.setCustomValidity(i), this._internalError = i, this.requestUpdate();
|
|
71
|
+
}
|
|
72
|
+
render() {
|
|
73
|
+
const i = this.error || this._internalError, n = this.showClear && this.value && !this.disabled && !this.readonly, l = `input__field input__field--${this.size}`;
|
|
74
|
+
return u`
|
|
75
|
+
<logosphere-formfield
|
|
76
|
+
.label=${this.label}
|
|
77
|
+
.helper=${this.helper}
|
|
78
|
+
.error=${i}
|
|
79
|
+
.required=${this.required}
|
|
80
|
+
.disabled=${this.disabled}
|
|
81
|
+
.readonly=${this.readonly}
|
|
82
|
+
.placeholder=${this.placeholder}
|
|
83
|
+
.size=${this.size}
|
|
84
|
+
.variant=${this.variant}
|
|
85
|
+
>
|
|
86
|
+
<input
|
|
87
|
+
class="${l}"
|
|
88
|
+
type=${this.type}
|
|
89
|
+
.value=${g(this.value)}
|
|
90
|
+
placeholder=${this.placeholder || o}
|
|
91
|
+
name=${this.name || o}
|
|
92
|
+
autocomplete=${this.autocomplete || o}
|
|
93
|
+
?required=${this.required}
|
|
94
|
+
?disabled=${this.disabled}
|
|
95
|
+
?readonly=${this.readonly}
|
|
96
|
+
minlength=${this.minlength ?? o}
|
|
97
|
+
maxlength=${this.maxlength ?? o}
|
|
98
|
+
pattern=${this.pattern || o}
|
|
99
|
+
min=${this.min ?? o}
|
|
100
|
+
max=${this.max ?? o}
|
|
101
|
+
step=${this.step ?? o}
|
|
102
|
+
@input=${this.handleInput}
|
|
103
|
+
@change=${this.handleChange}
|
|
104
|
+
@keydown=${this.handleKeyDown}
|
|
105
|
+
@keyup=${this.handleKeyUp}
|
|
106
|
+
/>
|
|
107
|
+
${n ? u`
|
|
108
|
+
<button
|
|
109
|
+
type="button"
|
|
110
|
+
slot="suffix"
|
|
111
|
+
class="input__clear-btn"
|
|
112
|
+
@click=${this.handleClear}
|
|
113
|
+
tabindex="-1"
|
|
114
|
+
>
|
|
115
|
+
<ui-icon name="uil-times" size="14"></ui-icon>
|
|
116
|
+
</button>
|
|
117
|
+
` : o}
|
|
118
|
+
</logosphere-formfield>
|
|
119
|
+
`;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
t.styles = [y`${d(_)}`];
|
|
123
|
+
e([
|
|
124
|
+
m("input")
|
|
125
|
+
], t.prototype, "_inputElement", 2);
|
|
126
|
+
e([
|
|
127
|
+
r({ type: String })
|
|
128
|
+
], t.prototype, "value", 2);
|
|
129
|
+
e([
|
|
130
|
+
r({ type: String })
|
|
131
|
+
], t.prototype, "type", 2);
|
|
132
|
+
e([
|
|
133
|
+
r({ type: String })
|
|
134
|
+
], t.prototype, "placeholder", 2);
|
|
135
|
+
e([
|
|
136
|
+
r({ type: String })
|
|
137
|
+
], t.prototype, "name", 2);
|
|
138
|
+
e([
|
|
139
|
+
r({ type: String })
|
|
140
|
+
], t.prototype, "autocomplete", 2);
|
|
141
|
+
e([
|
|
142
|
+
r({ type: Number })
|
|
143
|
+
], t.prototype, "minlength", 2);
|
|
144
|
+
e([
|
|
145
|
+
r({ type: Number })
|
|
146
|
+
], t.prototype, "maxlength", 2);
|
|
147
|
+
e([
|
|
148
|
+
r({ type: String })
|
|
149
|
+
], t.prototype, "pattern", 2);
|
|
150
|
+
e([
|
|
151
|
+
r({ type: Number })
|
|
152
|
+
], t.prototype, "min", 2);
|
|
153
|
+
e([
|
|
154
|
+
r({ type: Number })
|
|
155
|
+
], t.prototype, "max", 2);
|
|
156
|
+
e([
|
|
157
|
+
r({ type: Number })
|
|
158
|
+
], t.prototype, "step", 2);
|
|
159
|
+
e([
|
|
160
|
+
r({ type: String })
|
|
161
|
+
], t.prototype, "size", 2);
|
|
162
|
+
e([
|
|
163
|
+
r({ type: String })
|
|
164
|
+
], t.prototype, "variant", 2);
|
|
165
|
+
e([
|
|
166
|
+
r({ type: Boolean })
|
|
167
|
+
], t.prototype, "showClear", 2);
|
|
168
|
+
e([
|
|
169
|
+
r({ type: String })
|
|
170
|
+
], t.prototype, "label", 2);
|
|
171
|
+
e([
|
|
172
|
+
r({ type: String })
|
|
173
|
+
], t.prototype, "helper", 2);
|
|
174
|
+
e([
|
|
175
|
+
r({ type: String })
|
|
176
|
+
], t.prototype, "error", 2);
|
|
177
|
+
e([
|
|
178
|
+
r({ type: Boolean })
|
|
179
|
+
], t.prototype, "required", 2);
|
|
180
|
+
e([
|
|
181
|
+
r({ type: Boolean })
|
|
182
|
+
], t.prototype, "disabled", 2);
|
|
183
|
+
e([
|
|
184
|
+
r({ type: Boolean })
|
|
185
|
+
], t.prototype, "readonly", 2);
|
|
186
|
+
e([
|
|
187
|
+
b()
|
|
188
|
+
], t.prototype, "_internalError", 2);
|
|
189
|
+
t = e([
|
|
190
|
+
v("logosphere-input")
|
|
191
|
+
], t);
|
|
192
|
+
export {
|
|
193
|
+
t as L
|
|
194
|
+
};
|
package/dist/input.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./input-CoY1ZcPF.cjs");Object.defineProperty(exports,"LogosphereInput",{enumerable:!0,get:()=>e.LogosphereInput});
|
package/dist/input.js
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { unsafeCSS as p, css as h, LitElement as m, html as r } from "lit";
|
|
2
|
+
import { property as n, customElement as f } from "lit/decorators.js";
|
|
3
|
+
const u = ".modal__backdrop{position:fixed;inset:0;z-index:var(--z-index-modal-backdrop);display:flex;align-items:center;justify-content:center;background-color:#00000080;padding:var(--spacing-4);font-family:var(--font-family-base)}.modal__dialog{width:100%;max-width:720px;border-radius:var(--radius-lg);border:1px solid var(--color-border);overflow:hidden;box-shadow:var(--shadow-xl);background-color:var(--color-body-bg);display:grid;grid-template-rows:auto 1fr auto}.modal__header{padding:var(--spacing-4) var(--spacing-4) var(--spacing-2);border-bottom:1px solid var(--color-border);display:flex;align-items:center;gap:var(--spacing-2)}.modal__header-content{flex:1;min-width:0}.modal__title{font-size:var(--font-size-lg);font-weight:var(--font-weight-semibold);color:var(--color-body-text);margin:0}.modal__body{padding:var(--spacing-4)}.modal__footer{padding:var(--spacing-4);display:flex;flex-wrap:wrap;gap:var(--spacing-3);justify-content:flex-end;border-top:1px solid var(--color-border)}";
|
|
4
|
+
var v = Object.defineProperty, g = Object.getOwnPropertyDescriptor, t = (e, s, i, l) => {
|
|
5
|
+
for (var a = l > 1 ? void 0 : l ? g(s, i) : s, d = e.length - 1, c; d >= 0; d--)
|
|
6
|
+
(c = e[d]) && (a = (l ? c(s, i, a) : c(a)) || a);
|
|
7
|
+
return l && a && v(s, i, a), a;
|
|
8
|
+
};
|
|
9
|
+
let o = class extends m {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments), this.open = !1, this.title = "", this.closeOnEsc = !0, this.closeOnBackdrop = !0, this.showBack = !1, this.showClose = !1, this.hasFooterContent = !1, this.onKeyDown = (e) => {
|
|
12
|
+
this.open && this.closeOnEsc && e.key === "Escape" && this.setOpen(!1);
|
|
13
|
+
}, this.onBackdropClick = (e) => {
|
|
14
|
+
if (!this.closeOnBackdrop) return;
|
|
15
|
+
const s = this.shadowRoot?.querySelector(".__modal-content");
|
|
16
|
+
s && !s.contains(e.target) && this.setOpen(!1);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
connectedCallback() {
|
|
20
|
+
super.connectedCallback(), document.addEventListener("keydown", this.onKeyDown);
|
|
21
|
+
}
|
|
22
|
+
disconnectedCallback() {
|
|
23
|
+
super.disconnectedCallback(), document.removeEventListener("keydown", this.onKeyDown);
|
|
24
|
+
}
|
|
25
|
+
openModal() {
|
|
26
|
+
this.setOpen(!0);
|
|
27
|
+
}
|
|
28
|
+
closeModal() {
|
|
29
|
+
this.setOpen(!1);
|
|
30
|
+
}
|
|
31
|
+
setOpen(e) {
|
|
32
|
+
this.open !== e && (this.open = e, this.dispatchEvent(new CustomEvent(e ? "modal-open" : "modal-close", { bubbles: !0 })));
|
|
33
|
+
}
|
|
34
|
+
checkFooterContent() {
|
|
35
|
+
const e = this.shadowRoot?.querySelector('slot[name="footer"]');
|
|
36
|
+
e && (this.hasFooterContent = e.assignedNodes().length > 0);
|
|
37
|
+
}
|
|
38
|
+
updated(e) {
|
|
39
|
+
super.updated(e), this.checkFooterContent();
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
return this.open ? r`
|
|
43
|
+
<div
|
|
44
|
+
class="modal__backdrop"
|
|
45
|
+
role="presentation"
|
|
46
|
+
aria-hidden="false"
|
|
47
|
+
@mousedown=${this.onBackdropClick}
|
|
48
|
+
>
|
|
49
|
+
<div
|
|
50
|
+
class="__modal-content modal__dialog"
|
|
51
|
+
role="dialog"
|
|
52
|
+
aria-modal="true"
|
|
53
|
+
>
|
|
54
|
+
${this.showBack || this.showClose ? r`
|
|
55
|
+
<div class="modal__header">
|
|
56
|
+
${this.showBack ? r`
|
|
57
|
+
<logosphere-button variant="text" size="sm" @click=${() => this.setOpen(!1)}>←</logosphere-button>
|
|
58
|
+
` : ""}
|
|
59
|
+
<div class="modal__header-content">
|
|
60
|
+
${this.title ? r`<h2 class="modal__title">${this.title}</h2>` : ""}
|
|
61
|
+
<slot name="header"></slot>
|
|
62
|
+
</div>
|
|
63
|
+
${this.showClose ? r`
|
|
64
|
+
<logosphere-button variant="text" size="sm" @click=${() => this.setOpen(!1)}>×</logosphere-button>
|
|
65
|
+
` : ""}
|
|
66
|
+
</div>
|
|
67
|
+
` : ""}
|
|
68
|
+
|
|
69
|
+
<div class="modal__body">
|
|
70
|
+
<slot></slot>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
${this.hasFooterContent ? r`
|
|
74
|
+
<div class="modal__footer">
|
|
75
|
+
<slot name="footer"></slot>
|
|
76
|
+
</div>
|
|
77
|
+
` : ""}
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
` : r``;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
o.styles = [h`${p(u)}`];
|
|
84
|
+
t([
|
|
85
|
+
n({ type: Boolean, reflect: !0 })
|
|
86
|
+
], o.prototype, "open", 2);
|
|
87
|
+
t([
|
|
88
|
+
n({ type: String })
|
|
89
|
+
], o.prototype, "title", 2);
|
|
90
|
+
t([
|
|
91
|
+
n({ type: Boolean })
|
|
92
|
+
], o.prototype, "closeOnEsc", 2);
|
|
93
|
+
t([
|
|
94
|
+
n({ type: Boolean })
|
|
95
|
+
], o.prototype, "closeOnBackdrop", 2);
|
|
96
|
+
t([
|
|
97
|
+
n({ type: Boolean })
|
|
98
|
+
], o.prototype, "showBack", 2);
|
|
99
|
+
t([
|
|
100
|
+
n({ type: Boolean })
|
|
101
|
+
], o.prototype, "showClose", 2);
|
|
102
|
+
t([
|
|
103
|
+
n({ type: Boolean, state: !0 })
|
|
104
|
+
], o.prototype, "hasFooterContent", 2);
|
|
105
|
+
o = t([
|
|
106
|
+
f("logosphere-modal")
|
|
107
|
+
], o);
|
|
108
|
+
export {
|
|
109
|
+
o as M
|
|
110
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";const e=require("lit"),t=require("lit/decorators.js"),p=".modal__backdrop{position:fixed;inset:0;z-index:var(--z-index-modal-backdrop);display:flex;align-items:center;justify-content:center;background-color:#00000080;padding:var(--spacing-4);font-family:var(--font-family-base)}.modal__dialog{width:100%;max-width:720px;border-radius:var(--radius-lg);border:1px solid var(--color-border);overflow:hidden;box-shadow:var(--shadow-xl);background-color:var(--color-body-bg);display:grid;grid-template-rows:auto 1fr auto}.modal__header{padding:var(--spacing-4) var(--spacing-4) var(--spacing-2);border-bottom:1px solid var(--color-border);display:flex;align-items:center;gap:var(--spacing-2)}.modal__header-content{flex:1;min-width:0}.modal__title{font-size:var(--font-size-lg);font-weight:var(--font-weight-semibold);color:var(--color-body-text);margin:0}.modal__body{padding:var(--spacing-4)}.modal__footer{padding:var(--spacing-4);display:flex;flex-wrap:wrap;gap:var(--spacing-3);justify-content:flex-end;border-top:1px solid var(--color-border)}";var c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,s=(n,o,r,l)=>{for(var a=l>1?void 0:l?h(o,r):o,i=n.length-1,d;i>=0;i--)(d=n[i])&&(a=(l?d(o,r,a):d(a))||a);return l&&a&&c(o,r,a),a};exports.Modal=class extends e.LitElement{constructor(){super(...arguments),this.open=!1,this.title="",this.closeOnEsc=!0,this.closeOnBackdrop=!0,this.showBack=!1,this.showClose=!1,this.hasFooterContent=!1,this.onKeyDown=o=>{this.open&&this.closeOnEsc&&o.key==="Escape"&&this.setOpen(!1)},this.onBackdropClick=o=>{if(!this.closeOnBackdrop)return;const r=this.shadowRoot?.querySelector(".__modal-content");r&&!r.contains(o.target)&&this.setOpen(!1)}}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.onKeyDown)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.onKeyDown)}openModal(){this.setOpen(!0)}closeModal(){this.setOpen(!1)}setOpen(o){this.open!==o&&(this.open=o,this.dispatchEvent(new CustomEvent(o?"modal-open":"modal-close",{bubbles:!0})))}checkFooterContent(){const o=this.shadowRoot?.querySelector('slot[name="footer"]');o&&(this.hasFooterContent=o.assignedNodes().length>0)}updated(o){super.updated(o),this.checkFooterContent()}render(){return this.open?e.html`
|
|
2
|
+
<div
|
|
3
|
+
class="modal__backdrop"
|
|
4
|
+
role="presentation"
|
|
5
|
+
aria-hidden="false"
|
|
6
|
+
@mousedown=${this.onBackdropClick}
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
class="__modal-content modal__dialog"
|
|
10
|
+
role="dialog"
|
|
11
|
+
aria-modal="true"
|
|
12
|
+
>
|
|
13
|
+
${this.showBack||this.showClose?e.html`
|
|
14
|
+
<div class="modal__header">
|
|
15
|
+
${this.showBack?e.html`
|
|
16
|
+
<logosphere-button variant="text" size="sm" @click=${()=>this.setOpen(!1)}>←</logosphere-button>
|
|
17
|
+
`:""}
|
|
18
|
+
<div class="modal__header-content">
|
|
19
|
+
${this.title?e.html`<h2 class="modal__title">${this.title}</h2>`:""}
|
|
20
|
+
<slot name="header"></slot>
|
|
21
|
+
</div>
|
|
22
|
+
${this.showClose?e.html`
|
|
23
|
+
<logosphere-button variant="text" size="sm" @click=${()=>this.setOpen(!1)}>×</logosphere-button>
|
|
24
|
+
`:""}
|
|
25
|
+
</div>
|
|
26
|
+
`:""}
|
|
27
|
+
|
|
28
|
+
<div class="modal__body">
|
|
29
|
+
<slot></slot>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
${this.hasFooterContent?e.html`
|
|
33
|
+
<div class="modal__footer">
|
|
34
|
+
<slot name="footer"></slot>
|
|
35
|
+
</div>
|
|
36
|
+
`:""}
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
`:e.html``}};exports.Modal.styles=[e.css`${e.unsafeCSS(p)}`];s([t.property({type:Boolean,reflect:!0})],exports.Modal.prototype,"open",2);s([t.property({type:String})],exports.Modal.prototype,"title",2);s([t.property({type:Boolean})],exports.Modal.prototype,"closeOnEsc",2);s([t.property({type:Boolean})],exports.Modal.prototype,"closeOnBackdrop",2);s([t.property({type:Boolean})],exports.Modal.prototype,"showBack",2);s([t.property({type:Boolean})],exports.Modal.prototype,"showClose",2);s([t.property({type:Boolean,state:!0})],exports.Modal.prototype,"hasFooterContent",2);exports.Modal=s([t.customElement("logosphere-modal")],exports.Modal);
|
package/dist/modal.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./modal-DQ8VFL-P.cjs");Object.defineProperty(exports,"Modal",{enumerable:!0,get:()=>e.Modal});
|
package/dist/modal.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";const s=require("lit"),o=require("lit/decorators.js"),d=require("@popperjs/core"),c='.popover__wrapper{position:relative;display:inline-block;font-family:var(--font-family-base)}.popover__trigger{display:inline-flex}.popover__panel{position:relative;overflow:visible;z-index:var(--z-index-popover);min-width:240px;border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-body-bg);box-shadow:var(--shadow-md)}.popover__content{position:relative;z-index:1;background-color:var(--color-body-bg);border-radius:var(--radius-md);overflow:hidden}.popover__content:before{content:"";position:absolute;top:0;left:0;right:0;height:8px;background-color:var(--color-body-bg);border-radius:var(--radius-md) var(--radius-md) 0 0;z-index:1;pointer-events:none}.popover__content>*{position:relative;z-index:2}.popover__title{padding:10px var(--spacing-3);font-size:var(--font-size-sm);font-weight:var(--font-weight-semibold);color:var(--color-body-text)}.popover__body{padding:var(--spacing-3);font-size:var(--font-size-sm);color:var(--color-secondary)}.popover__body--with-border{border-top:1px solid var(--color-border)}.popper-arrow{position:absolute;width:12px;height:12px;pointer-events:none;z-index:0}.popper-arrow:before{content:"";position:absolute;inset:0;background:var(--color-border);transform:rotate(45deg)}.popper-arrow:after{content:"";position:absolute;inset:1px;background:var(--color-body-bg);transform:rotate(45deg)}[data-popper]{position:relative;overflow:visible}[data-popper-placement^=bottom]>.popper-arrow{top:-6px;left:50%;transform:translate(-50%,-50%)}[data-popper-placement^=top]>.popper-arrow{bottom:-6px;left:50%;transform:translate(-50%,50%)}[data-popper-placement^=left]>.popper-arrow{right:-6px;top:50%;transform:translate(50%,-50%)}[data-popper-placement^=right]>.popper-arrow{left:-6px;top:50%;transform:translate(-50%,-50%)}';var v=Object.defineProperty,h=Object.getOwnPropertyDescriptor,t=(n,e,r,i)=>{for(var p=i>1?void 0:i?h(e,r):e,a=n.length-1,l;a>=0;a--)(l=n[a])&&(p=(i?l(e,r,p):l(p))||p);return i&&p&&v(e,r,p),p};exports.Popover=class extends s.LitElement{constructor(){super(...arguments),this.title="",this.trigger="click",this.placement="bottom",this.offset=8,this.open=!1,this.closeOnOutsideClick=!0,this.handleDocumentClick=e=>{!this.open||!this.closeOnOutsideClick||e.composedPath().includes(this)||this.setOpen(!1)},this.toggle=e=>{(this.trigger==="click"||this.trigger==="both")&&(e?.stopPropagation(),this.setOpen(!this.open))},this.handleMouseEnter=()=>{(this.trigger==="hover"||this.trigger==="both")&&this.setOpen(!0)},this.handleMouseLeave=()=>{(this.trigger==="hover"||this.trigger==="both")&&this.setOpen(!1)}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.handleDocumentClick,{capture:!0})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleDocumentClick,{capture:!0}),this.destroyPopper()}updated(e){super.updated(e);const r=e.has("placement"),i=e.has("open")&&this.open;if(e.has("open")&&!this.open){this.destroyPopper();return}(i||r)&&this.open&&this.updatePopper()}setOpen(e){this.open!==e&&(this.open=e,this.dispatchEvent(new CustomEvent(e?"popover-open":"popover-close",{bubbles:!0,composed:!0})))}updatePopper(){if(!this.isConnected||!this.open)return;const e=this.triggerElement,r=this.popperElement;if(!(!e||!r)){if(this.popperInstance){this.popperInstance.setOptions({placement:this.placement,modifiers:this.getPopperModifiers(),strategy:"fixed"}),this.popperInstance.update();return}this.popperInstance=d.createPopper(e,r,{placement:this.placement,strategy:"fixed",modifiers:this.getPopperModifiers()})}}getPopperModifiers(){return[{name:"offset",options:{offset:[0,this.offset]}},{name:"arrow",options:{element:this.popperArrowElement,padding:8}},{name:"preventOverflow",options:{padding:8}},{name:"flip",options:{padding:8}}]}destroyPopper(){this.popperInstance&&(this.popperInstance.destroy(),this.popperInstance=void 0)}render(){const e=!!this.title;return s.html`
|
|
2
|
+
<div
|
|
3
|
+
class="popover__wrapper"
|
|
4
|
+
@mouseenter=${this.handleMouseEnter}
|
|
5
|
+
@mouseleave=${this.handleMouseLeave}
|
|
6
|
+
>
|
|
7
|
+
<div class="popover__trigger" part="trigger" @click=${this.toggle}>
|
|
8
|
+
<slot name="trigger"></slot>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
${this.open?s.html`
|
|
12
|
+
<div
|
|
13
|
+
data-popper
|
|
14
|
+
class="popover__panel"
|
|
15
|
+
role="dialog"
|
|
16
|
+
aria-hidden=${this.open?"false":"true"}
|
|
17
|
+
>
|
|
18
|
+
<div data-popper-arrow class="popper-arrow"></div>
|
|
19
|
+
<div class="popover__content">
|
|
20
|
+
${this.title?s.html`
|
|
21
|
+
<div class="popover__title">${this.title}</div>
|
|
22
|
+
`:null}
|
|
23
|
+
<div class="popover__body ${e?"popover__body--with-border":""}">
|
|
24
|
+
<slot></slot>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
`:null}
|
|
29
|
+
</div>
|
|
30
|
+
`}};exports.Popover.styles=[s.css`${s.unsafeCSS(c)}`];t([o.property({type:String})],exports.Popover.prototype,"title",2);t([o.property({type:String})],exports.Popover.prototype,"trigger",2);t([o.property({type:String})],exports.Popover.prototype,"placement",2);t([o.property({type:Number})],exports.Popover.prototype,"offset",2);t([o.property({type:Boolean,reflect:!0})],exports.Popover.prototype,"open",2);t([o.property({type:Boolean})],exports.Popover.prototype,"closeOnOutsideClick",2);t([o.query('[part="trigger"]')],exports.Popover.prototype,"triggerElement",2);t([o.query("[data-popper]")],exports.Popover.prototype,"popperElement",2);t([o.query("[data-popper-arrow]")],exports.Popover.prototype,"popperArrowElement",2);exports.Popover=t([o.customElement("logosphere-popover")],exports.Popover);
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { unsafeCSS as h, css as v, LitElement as f, html as d } from "lit";
|
|
2
|
+
import { property as i, query as c, customElement as g } from "lit/decorators.js";
|
|
3
|
+
import { createPopper as m } from "@popperjs/core";
|
|
4
|
+
const u = '.popover__wrapper{position:relative;display:inline-block;font-family:var(--font-family-base)}.popover__trigger{display:inline-flex}.popover__panel{position:relative;overflow:visible;z-index:var(--z-index-popover);min-width:240px;border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-body-bg);box-shadow:var(--shadow-md)}.popover__content{position:relative;z-index:1;background-color:var(--color-body-bg);border-radius:var(--radius-md);overflow:hidden}.popover__content:before{content:"";position:absolute;top:0;left:0;right:0;height:8px;background-color:var(--color-body-bg);border-radius:var(--radius-md) var(--radius-md) 0 0;z-index:1;pointer-events:none}.popover__content>*{position:relative;z-index:2}.popover__title{padding:10px var(--spacing-3);font-size:var(--font-size-sm);font-weight:var(--font-weight-semibold);color:var(--color-body-text)}.popover__body{padding:var(--spacing-3);font-size:var(--font-size-sm);color:var(--color-secondary)}.popover__body--with-border{border-top:1px solid var(--color-border)}.popper-arrow{position:absolute;width:12px;height:12px;pointer-events:none;z-index:0}.popper-arrow:before{content:"";position:absolute;inset:0;background:var(--color-border);transform:rotate(45deg)}.popper-arrow:after{content:"";position:absolute;inset:1px;background:var(--color-body-bg);transform:rotate(45deg)}[data-popper]{position:relative;overflow:visible}[data-popper-placement^=bottom]>.popper-arrow{top:-6px;left:50%;transform:translate(-50%,-50%)}[data-popper-placement^=top]>.popper-arrow{bottom:-6px;left:50%;transform:translate(-50%,50%)}[data-popper-placement^=left]>.popper-arrow{right:-6px;top:50%;transform:translate(50%,-50%)}[data-popper-placement^=right]>.popper-arrow{left:-6px;top:50%;transform:translate(-50%,-50%)}';
|
|
5
|
+
var b = Object.defineProperty, y = Object.getOwnPropertyDescriptor, o = (e, r, s, n) => {
|
|
6
|
+
for (var p = n > 1 ? void 0 : n ? y(r, s) : r, a = e.length - 1, l; a >= 0; a--)
|
|
7
|
+
(l = e[a]) && (p = (n ? l(r, s, p) : l(p)) || p);
|
|
8
|
+
return n && p && b(r, s, p), p;
|
|
9
|
+
};
|
|
10
|
+
let t = class extends f {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments), this.title = "", this.trigger = "click", this.placement = "bottom", this.offset = 8, this.open = !1, this.closeOnOutsideClick = !0, this.handleDocumentClick = (e) => {
|
|
13
|
+
!this.open || !this.closeOnOutsideClick || e.composedPath().includes(this) || this.setOpen(!1);
|
|
14
|
+
}, this.toggle = (e) => {
|
|
15
|
+
(this.trigger === "click" || this.trigger === "both") && (e?.stopPropagation(), this.setOpen(!this.open));
|
|
16
|
+
}, this.handleMouseEnter = () => {
|
|
17
|
+
(this.trigger === "hover" || this.trigger === "both") && this.setOpen(!0);
|
|
18
|
+
}, this.handleMouseLeave = () => {
|
|
19
|
+
(this.trigger === "hover" || this.trigger === "both") && this.setOpen(!1);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
super.connectedCallback(), document.addEventListener("click", this.handleDocumentClick, { capture: !0 });
|
|
24
|
+
}
|
|
25
|
+
disconnectedCallback() {
|
|
26
|
+
super.disconnectedCallback(), document.removeEventListener("click", this.handleDocumentClick, { capture: !0 }), this.destroyPopper();
|
|
27
|
+
}
|
|
28
|
+
updated(e) {
|
|
29
|
+
super.updated(e);
|
|
30
|
+
const r = e.has("placement"), s = e.has("open") && this.open;
|
|
31
|
+
if (e.has("open") && !this.open) {
|
|
32
|
+
this.destroyPopper();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
(s || r) && this.open && this.updatePopper();
|
|
36
|
+
}
|
|
37
|
+
setOpen(e) {
|
|
38
|
+
this.open !== e && (this.open = e, this.dispatchEvent(new CustomEvent(e ? "popover-open" : "popover-close", {
|
|
39
|
+
bubbles: !0,
|
|
40
|
+
composed: !0
|
|
41
|
+
})));
|
|
42
|
+
}
|
|
43
|
+
updatePopper() {
|
|
44
|
+
if (!this.isConnected || !this.open) return;
|
|
45
|
+
const e = this.triggerElement, r = this.popperElement;
|
|
46
|
+
if (!(!e || !r)) {
|
|
47
|
+
if (this.popperInstance) {
|
|
48
|
+
this.popperInstance.setOptions({
|
|
49
|
+
placement: this.placement,
|
|
50
|
+
modifiers: this.getPopperModifiers(),
|
|
51
|
+
strategy: "fixed"
|
|
52
|
+
}), this.popperInstance.update();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
this.popperInstance = m(e, r, {
|
|
56
|
+
placement: this.placement,
|
|
57
|
+
strategy: "fixed",
|
|
58
|
+
modifiers: this.getPopperModifiers()
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
getPopperModifiers() {
|
|
63
|
+
return [
|
|
64
|
+
{ name: "offset", options: { offset: [0, this.offset] } },
|
|
65
|
+
{ name: "arrow", options: { element: this.popperArrowElement, padding: 8 } },
|
|
66
|
+
{ name: "preventOverflow", options: { padding: 8 } },
|
|
67
|
+
{ name: "flip", options: { padding: 8 } }
|
|
68
|
+
];
|
|
69
|
+
}
|
|
70
|
+
destroyPopper() {
|
|
71
|
+
this.popperInstance && (this.popperInstance.destroy(), this.popperInstance = void 0);
|
|
72
|
+
}
|
|
73
|
+
render() {
|
|
74
|
+
const e = !!this.title;
|
|
75
|
+
return d`
|
|
76
|
+
<div
|
|
77
|
+
class="popover__wrapper"
|
|
78
|
+
@mouseenter=${this.handleMouseEnter}
|
|
79
|
+
@mouseleave=${this.handleMouseLeave}
|
|
80
|
+
>
|
|
81
|
+
<div class="popover__trigger" part="trigger" @click=${this.toggle}>
|
|
82
|
+
<slot name="trigger"></slot>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
${this.open ? d`
|
|
86
|
+
<div
|
|
87
|
+
data-popper
|
|
88
|
+
class="popover__panel"
|
|
89
|
+
role="dialog"
|
|
90
|
+
aria-hidden=${this.open ? "false" : "true"}
|
|
91
|
+
>
|
|
92
|
+
<div data-popper-arrow class="popper-arrow"></div>
|
|
93
|
+
<div class="popover__content">
|
|
94
|
+
${this.title ? d`
|
|
95
|
+
<div class="popover__title">${this.title}</div>
|
|
96
|
+
` : null}
|
|
97
|
+
<div class="popover__body ${e ? "popover__body--with-border" : ""}">
|
|
98
|
+
<slot></slot>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
` : null}
|
|
103
|
+
</div>
|
|
104
|
+
`;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
t.styles = [v`${h(u)}`];
|
|
108
|
+
o([
|
|
109
|
+
i({ type: String })
|
|
110
|
+
], t.prototype, "title", 2);
|
|
111
|
+
o([
|
|
112
|
+
i({ type: String })
|
|
113
|
+
], t.prototype, "trigger", 2);
|
|
114
|
+
o([
|
|
115
|
+
i({ type: String })
|
|
116
|
+
], t.prototype, "placement", 2);
|
|
117
|
+
o([
|
|
118
|
+
i({ type: Number })
|
|
119
|
+
], t.prototype, "offset", 2);
|
|
120
|
+
o([
|
|
121
|
+
i({ type: Boolean, reflect: !0 })
|
|
122
|
+
], t.prototype, "open", 2);
|
|
123
|
+
o([
|
|
124
|
+
i({ type: Boolean })
|
|
125
|
+
], t.prototype, "closeOnOutsideClick", 2);
|
|
126
|
+
o([
|
|
127
|
+
c('[part="trigger"]')
|
|
128
|
+
], t.prototype, "triggerElement", 2);
|
|
129
|
+
o([
|
|
130
|
+
c("[data-popper]")
|
|
131
|
+
], t.prototype, "popperElement", 2);
|
|
132
|
+
o([
|
|
133
|
+
c("[data-popper-arrow]")
|
|
134
|
+
], t.prototype, "popperArrowElement", 2);
|
|
135
|
+
t = o([
|
|
136
|
+
g("logosphere-popover")
|
|
137
|
+
], t);
|
|
138
|
+
export {
|
|
139
|
+
t as P
|
|
140
|
+
};
|
package/dist/popover.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./popover-C2p5Pmts.cjs");Object.defineProperty(exports,"Popover",{enumerable:!0,get:()=>e.Popover});
|
package/dist/popover.js
ADDED