overview-components 1.0.76 → 1.0.77
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/assets/icons/iconGlyphs.js +680 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -32
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +277 -193
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +82 -78
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +22 -21
- package/dist/node_modules/lit-html/directives/class-map.js +34 -0
- package/dist/shared/lit-checkbox.js +155 -0
- package/dist/shared/lit-icon.js +282 -0
- package/dist/shared/lit-input.js +211 -0
- package/dist/shared/lit-menu.js +40 -0
- package/dist/shared/lit-modal.js +128 -0
- package/dist/shared/lit-pill.js +86 -0
- package/dist/shared/lit-select.js +339 -0
- package/dist/shared/lit-tooltip.js +137 -0
- package/dist/styles.js +174 -0
- package/package.json +1 -1
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import "../node_modules/@lit/reactive-element/reactive-element.js";
|
|
2
|
+
import { html as c } from "../node_modules/lit-html/lit-html.js";
|
|
3
|
+
import { LitElement as p } from "../node_modules/lit-element/lit-element.js";
|
|
4
|
+
import { customElement as m } from "../node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
5
|
+
import { property as d } from "../node_modules/@lit/reactive-element/decorators/property.js";
|
|
6
|
+
import h from "../styles.js";
|
|
7
|
+
import u from "../assets/icons/iconGlyphs.js";
|
|
8
|
+
import { css as v } from "../node_modules/@lit/reactive-element/css-tag.js";
|
|
9
|
+
var g = Object.defineProperty, F = Object.getOwnPropertyDescriptor, o = (l, t, s, r) => {
|
|
10
|
+
for (var e = r > 1 ? void 0 : r ? F(t, s) : t, a = l.length - 1, n; a >= 0; a--)
|
|
11
|
+
(n = l[a]) && (e = (r ? n(t, s, e) : n(e)) || e);
|
|
12
|
+
return r && e && g(t, s, e), e;
|
|
13
|
+
};
|
|
14
|
+
const _ = [
|
|
15
|
+
"archive",
|
|
16
|
+
"requiredFilled",
|
|
17
|
+
"account",
|
|
18
|
+
"add",
|
|
19
|
+
"administration",
|
|
20
|
+
"arrowLeft",
|
|
21
|
+
"arrowRight",
|
|
22
|
+
"bell",
|
|
23
|
+
"bellNotify",
|
|
24
|
+
"cases",
|
|
25
|
+
"darkMode",
|
|
26
|
+
"documents",
|
|
27
|
+
"events",
|
|
28
|
+
"favorite",
|
|
29
|
+
"help",
|
|
30
|
+
"home",
|
|
31
|
+
"leave",
|
|
32
|
+
"lightMode",
|
|
33
|
+
"manuals",
|
|
34
|
+
"overviews",
|
|
35
|
+
"planning",
|
|
36
|
+
"reports",
|
|
37
|
+
"roles",
|
|
38
|
+
"search",
|
|
39
|
+
"settings",
|
|
40
|
+
"structure",
|
|
41
|
+
"tasks",
|
|
42
|
+
"templates",
|
|
43
|
+
"users",
|
|
44
|
+
"close",
|
|
45
|
+
"curveArrow",
|
|
46
|
+
"administrator",
|
|
47
|
+
"delegate",
|
|
48
|
+
"download",
|
|
49
|
+
"assume",
|
|
50
|
+
"calculator",
|
|
51
|
+
"check",
|
|
52
|
+
"chevronDown",
|
|
53
|
+
"handover",
|
|
54
|
+
"flag",
|
|
55
|
+
"filter",
|
|
56
|
+
"favoriteAdd",
|
|
57
|
+
"note",
|
|
58
|
+
"more",
|
|
59
|
+
"minus",
|
|
60
|
+
"success",
|
|
61
|
+
"time",
|
|
62
|
+
"trash",
|
|
63
|
+
"pen",
|
|
64
|
+
"unlike",
|
|
65
|
+
"user",
|
|
66
|
+
"puzzle",
|
|
67
|
+
"informative",
|
|
68
|
+
"save",
|
|
69
|
+
"warning",
|
|
70
|
+
"help2",
|
|
71
|
+
"accomplish",
|
|
72
|
+
"addDocument",
|
|
73
|
+
"addNote",
|
|
74
|
+
"checkboxEmpty",
|
|
75
|
+
"expand",
|
|
76
|
+
"duplicate",
|
|
77
|
+
"history",
|
|
78
|
+
"instruction",
|
|
79
|
+
"radioEmpty",
|
|
80
|
+
"print",
|
|
81
|
+
"zoomIn",
|
|
82
|
+
"view",
|
|
83
|
+
"reading",
|
|
84
|
+
"reload",
|
|
85
|
+
"logs",
|
|
86
|
+
"flow",
|
|
87
|
+
"csv",
|
|
88
|
+
"contact",
|
|
89
|
+
"columns",
|
|
90
|
+
"hamburger",
|
|
91
|
+
"beginning",
|
|
92
|
+
"signal",
|
|
93
|
+
"variable",
|
|
94
|
+
"up",
|
|
95
|
+
"upload",
|
|
96
|
+
"revision",
|
|
97
|
+
"typing",
|
|
98
|
+
"tasksFilled",
|
|
99
|
+
"overviewsFilled",
|
|
100
|
+
"homeFilled",
|
|
101
|
+
"favoriteFilled",
|
|
102
|
+
"flagFilled",
|
|
103
|
+
"darkModeFilled",
|
|
104
|
+
"bellFilled",
|
|
105
|
+
"administrationFilled",
|
|
106
|
+
"administratorFilled",
|
|
107
|
+
"casesFilled",
|
|
108
|
+
"manualsFilled",
|
|
109
|
+
"reportsFilled",
|
|
110
|
+
"structureFilled",
|
|
111
|
+
"usersFilled",
|
|
112
|
+
"userFilled",
|
|
113
|
+
"settingsFilled",
|
|
114
|
+
"lightModeFilled",
|
|
115
|
+
"leaveFilled",
|
|
116
|
+
"searchFilled",
|
|
117
|
+
"checkboxFilled",
|
|
118
|
+
"checkFilled",
|
|
119
|
+
"chevronDownFilled",
|
|
120
|
+
"chevronUpFilled",
|
|
121
|
+
"chevronRightFilled",
|
|
122
|
+
"chevronLeftFilled",
|
|
123
|
+
"logsFilled",
|
|
124
|
+
"radioFilled",
|
|
125
|
+
"historyFilled",
|
|
126
|
+
"sortFilled",
|
|
127
|
+
"variableFilled",
|
|
128
|
+
"dangerFilled",
|
|
129
|
+
"eventsFilled",
|
|
130
|
+
"helpFilled",
|
|
131
|
+
"rolesFilled",
|
|
132
|
+
"clean",
|
|
133
|
+
"dms",
|
|
134
|
+
"cog",
|
|
135
|
+
"email",
|
|
136
|
+
"files",
|
|
137
|
+
"chevron",
|
|
138
|
+
"hand",
|
|
139
|
+
"hide",
|
|
140
|
+
"hierarchy",
|
|
141
|
+
"import",
|
|
142
|
+
"index",
|
|
143
|
+
"infinity",
|
|
144
|
+
"infinity2",
|
|
145
|
+
"reset",
|
|
146
|
+
"rest",
|
|
147
|
+
"sleep",
|
|
148
|
+
"sorting",
|
|
149
|
+
"totake",
|
|
150
|
+
"totakedelegate",
|
|
151
|
+
"shredding",
|
|
152
|
+
"show",
|
|
153
|
+
"share",
|
|
154
|
+
"table",
|
|
155
|
+
"url",
|
|
156
|
+
"schema",
|
|
157
|
+
"stats",
|
|
158
|
+
"zoomout",
|
|
159
|
+
"book",
|
|
160
|
+
"authentication",
|
|
161
|
+
"apphealth",
|
|
162
|
+
"certificate",
|
|
163
|
+
"console",
|
|
164
|
+
"folder",
|
|
165
|
+
"hragenda",
|
|
166
|
+
"script",
|
|
167
|
+
"sequence",
|
|
168
|
+
"serviceoperation",
|
|
169
|
+
"archiveFilled",
|
|
170
|
+
"planningFilled",
|
|
171
|
+
"approval",
|
|
172
|
+
"certificate2",
|
|
173
|
+
"change",
|
|
174
|
+
"chevrondown",
|
|
175
|
+
"cursor",
|
|
176
|
+
"copylink",
|
|
177
|
+
"column",
|
|
178
|
+
"documentsFilled",
|
|
179
|
+
"filterFilled",
|
|
180
|
+
"filteroff",
|
|
181
|
+
"hr",
|
|
182
|
+
"image",
|
|
183
|
+
"outoftime",
|
|
184
|
+
"news",
|
|
185
|
+
"newsFilled",
|
|
186
|
+
"morevertical",
|
|
187
|
+
"spinner",
|
|
188
|
+
"userFilled2",
|
|
189
|
+
"tasksii",
|
|
190
|
+
"rowlarge",
|
|
191
|
+
"rowmedium",
|
|
192
|
+
"rowmall",
|
|
193
|
+
"touchid",
|
|
194
|
+
"acces",
|
|
195
|
+
"agenda",
|
|
196
|
+
"annoncement",
|
|
197
|
+
"email2",
|
|
198
|
+
"export",
|
|
199
|
+
"faceid",
|
|
200
|
+
"deviceregister",
|
|
201
|
+
"lock",
|
|
202
|
+
"outoftime2",
|
|
203
|
+
"qr",
|
|
204
|
+
"unlock",
|
|
205
|
+
"zastupovany",
|
|
206
|
+
"csvFilled",
|
|
207
|
+
"qrFilled",
|
|
208
|
+
"knowledgeFilled",
|
|
209
|
+
"hragendaFilled",
|
|
210
|
+
"deviceregisterFilled",
|
|
211
|
+
"agregation",
|
|
212
|
+
"code",
|
|
213
|
+
"flowii",
|
|
214
|
+
"cursor2",
|
|
215
|
+
"drag",
|
|
216
|
+
"link",
|
|
217
|
+
"lang",
|
|
218
|
+
"pinFilled",
|
|
219
|
+
"pin",
|
|
220
|
+
"play",
|
|
221
|
+
"return",
|
|
222
|
+
"sorting2",
|
|
223
|
+
"switch",
|
|
224
|
+
"test",
|
|
225
|
+
"stop",
|
|
226
|
+
"zoom",
|
|
227
|
+
"wrapitup",
|
|
228
|
+
"web"
|
|
229
|
+
];
|
|
230
|
+
let i = class extends p {
|
|
231
|
+
constructor() {
|
|
232
|
+
super(...arguments), this.icon = "add", this.size = "1.375rem", this.isActive = !1, this.notRotateIcon = ["arrowLeft", "arrowRight"];
|
|
233
|
+
}
|
|
234
|
+
render() {
|
|
235
|
+
const l = this.icon ? u[this.icon] : void 0;
|
|
236
|
+
return l ? c`
|
|
237
|
+
<svg
|
|
238
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
239
|
+
viewBox="0 0 512 512"
|
|
240
|
+
style="width: ${this.size || " 1.5rem"} ; height: ${this.size || " 1.5rem"};"
|
|
241
|
+
class="rotated"
|
|
242
|
+
fill="${this.isActive ? "var(--color-primary-main, #76b703)" : "currentColor"}"
|
|
243
|
+
>
|
|
244
|
+
<g transform="translate(0,20)">
|
|
245
|
+
<path d="${l.d}" />
|
|
246
|
+
</g>
|
|
247
|
+
</svg>
|
|
248
|
+
` : c`<span>Icon not found</span>`;
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
i.styles = [
|
|
252
|
+
h,
|
|
253
|
+
v`
|
|
254
|
+
:host {
|
|
255
|
+
position: relative;
|
|
256
|
+
display: inline-block;
|
|
257
|
+
}
|
|
258
|
+
svg {
|
|
259
|
+
position: relative;
|
|
260
|
+
top: 0.0625rem;
|
|
261
|
+
}
|
|
262
|
+
svg.rotated {
|
|
263
|
+
transform: scaleY(-1);
|
|
264
|
+
}
|
|
265
|
+
`
|
|
266
|
+
];
|
|
267
|
+
o([
|
|
268
|
+
d({ type: String })
|
|
269
|
+
], i.prototype, "icon", 2);
|
|
270
|
+
o([
|
|
271
|
+
d({ type: String })
|
|
272
|
+
], i.prototype, "size", 2);
|
|
273
|
+
o([
|
|
274
|
+
d({ type: Boolean, reflect: !0 })
|
|
275
|
+
], i.prototype, "isActive", 2);
|
|
276
|
+
i = o([
|
|
277
|
+
m("lit-icon")
|
|
278
|
+
], i);
|
|
279
|
+
export {
|
|
280
|
+
_ as IconArray,
|
|
281
|
+
i as LitIcon
|
|
282
|
+
};
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { customElement as c } from "../node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
2
|
+
import { property as o } from "../node_modules/@lit/reactive-element/decorators/property.js";
|
|
3
|
+
import "../node_modules/@lit/reactive-element/reactive-element.js";
|
|
4
|
+
import { html as u } from "../node_modules/lit-html/lit-html.js";
|
|
5
|
+
import { LitElement as d } from "../node_modules/lit-element/lit-element.js";
|
|
6
|
+
import { classMap as h } from "../node_modules/lit-html/directives/class-map.js";
|
|
7
|
+
import { css as m } from "../node_modules/@lit/reactive-element/css-tag.js";
|
|
8
|
+
var y = Object.defineProperty, v = Object.getOwnPropertyDescriptor, e = (r, p, i, a) => {
|
|
9
|
+
for (var s = a > 1 ? void 0 : a ? v(p, i) : p, n = r.length - 1, l; n >= 0; n--)
|
|
10
|
+
(l = r[n]) && (s = (a ? l(p, i, s) : l(s)) || s);
|
|
11
|
+
return a && s && y(p, i, s), s;
|
|
12
|
+
};
|
|
13
|
+
let t = class extends d {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments), this.type = "text", this.placeholder = "", this.value = null, this.disableClearButton = !1, this.required = !1, this.server = !1, this.disabled = !1, this.filterOperators = [], this.size = "small", this.setOperator = (r) => {
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
connectedCallback() {
|
|
19
|
+
super.connectedCallback(), this.addEventListener("focus", () => this.focus());
|
|
20
|
+
}
|
|
21
|
+
disconnectedCallback() {
|
|
22
|
+
super.disconnectedCallback(), this.removeEventListener("focus", () => this.focus());
|
|
23
|
+
}
|
|
24
|
+
reportValidity() {
|
|
25
|
+
const r = this.shadowRoot.querySelector("input");
|
|
26
|
+
return r ? r.reportValidity() : !1;
|
|
27
|
+
}
|
|
28
|
+
focus() {
|
|
29
|
+
var p;
|
|
30
|
+
const r = (p = this.shadowRoot) == null ? void 0 : p.querySelector("input");
|
|
31
|
+
r == null || r.focus();
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
var p;
|
|
35
|
+
const r = `${this.size}-size`;
|
|
36
|
+
return u`
|
|
37
|
+
<div class="custom-icon-wrapper">
|
|
38
|
+
<input
|
|
39
|
+
class=${r}
|
|
40
|
+
type="${this.type}"
|
|
41
|
+
placeholder="${this.placeholder}"
|
|
42
|
+
step="any"
|
|
43
|
+
@input=${(i) => {
|
|
44
|
+
const s = i.target.value;
|
|
45
|
+
this.onInput && this.onInput(s);
|
|
46
|
+
}}
|
|
47
|
+
@blur=${(i) => {
|
|
48
|
+
const s = i.target.value;
|
|
49
|
+
this.onBlur && this.onBlur(s);
|
|
50
|
+
}}
|
|
51
|
+
.value="${typeof this.value == "object" ? ((p = this.value) == null ? void 0 : p.value) || "" : this.value || ""}"
|
|
52
|
+
?required="${this.required}"
|
|
53
|
+
.disabled="${this.disabled}"
|
|
54
|
+
/>
|
|
55
|
+
${(this.value || this.operator === "isEmpty" || this.operator === "isNotEmpty") && !this.disableClearButton ? u`<div
|
|
56
|
+
class=${h({
|
|
57
|
+
"custom-icon": !0,
|
|
58
|
+
"custom-icon--no-filter": !this.server
|
|
59
|
+
// Trieda ak filter nie je
|
|
60
|
+
})}
|
|
61
|
+
@click=${() => {
|
|
62
|
+
this.value = "", this.onClear && this.onClear();
|
|
63
|
+
}}
|
|
64
|
+
style="cursor: pointer; pointer-events: auto"
|
|
65
|
+
>
|
|
66
|
+
<lit-icon-button
|
|
67
|
+
icon="close"
|
|
68
|
+
size="small"
|
|
69
|
+
variant="text"
|
|
70
|
+
></lit-icon-button>
|
|
71
|
+
</div>` : ""}
|
|
72
|
+
${this.server ? u`<lit-data-grid-operators-popover
|
|
73
|
+
class="filter-icon"
|
|
74
|
+
b
|
|
75
|
+
.type="${this.type === "text" ? "string" : "number"}"
|
|
76
|
+
.setOperator="${(i) => {
|
|
77
|
+
this.setOperator(i);
|
|
78
|
+
}}"
|
|
79
|
+
.operator="${this.operator}"
|
|
80
|
+
@mousedown=${(i) => {
|
|
81
|
+
i.preventDefault(), i.stopPropagation();
|
|
82
|
+
}}
|
|
83
|
+
.disabled="${this.disabled}"
|
|
84
|
+
.filterOperators="${this.filterOperators}"
|
|
85
|
+
></lit-data-grid-operators-popover>` : null}
|
|
86
|
+
</div>
|
|
87
|
+
`;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
t.styles = [
|
|
91
|
+
m`
|
|
92
|
+
input {
|
|
93
|
+
padding: 0.5rem;
|
|
94
|
+
border: 0.0625rem solid var(--color-divider, #d0d3db);
|
|
95
|
+
border-radius: 0.25rem;
|
|
96
|
+
min-width: unset;
|
|
97
|
+
width: -webkit-fill-available;
|
|
98
|
+
width: -moz-available;
|
|
99
|
+
width: fill-available;
|
|
100
|
+
background-color: var(--background-paper, #fff);
|
|
101
|
+
color: var(--text-primary, #111827);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
input[type='number']::-webkit-inner-spin-button,
|
|
105
|
+
input[type='number']::-webkit-outer-spin-button {
|
|
106
|
+
-webkit-appearance: none;
|
|
107
|
+
margin: 0;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
input:hover:not(:disabled) {
|
|
111
|
+
border: 0.0625rem solid var(--color-secondary-main, #111827);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
input:focus {
|
|
115
|
+
outline: none;
|
|
116
|
+
border: 0.0625rem solid var(--color-secondary-dark, #010204);
|
|
117
|
+
}
|
|
118
|
+
input:disabled {
|
|
119
|
+
background-color: var(--background-paper, #fff);
|
|
120
|
+
cursor: not-allowed;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.custom-icon-wrapper {
|
|
124
|
+
position: relative;
|
|
125
|
+
width: 100%;
|
|
126
|
+
display: inline-block;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.custom-icon-wrapper .custom-icon {
|
|
130
|
+
display: none;
|
|
131
|
+
position: absolute;
|
|
132
|
+
right: 34px;
|
|
133
|
+
top: 50%;
|
|
134
|
+
transform: translateY(-50%);
|
|
135
|
+
cursor: pointer;
|
|
136
|
+
pointer-events: auto;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.custom-icon-wrapper .custom-icon--no-filter {
|
|
140
|
+
right: 10px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.custom-icon-wrapper:hover .custom-icon {
|
|
144
|
+
display: block;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.custom-icon-wrapper .filter-icon {
|
|
148
|
+
display: block;
|
|
149
|
+
position: absolute;
|
|
150
|
+
right: 10px;
|
|
151
|
+
top: 50%;
|
|
152
|
+
transform: translateY(-50%);
|
|
153
|
+
cursor: pointer;
|
|
154
|
+
pointer-events: auto;
|
|
155
|
+
}
|
|
156
|
+
.medium-size {
|
|
157
|
+
height: 1.43rem;
|
|
158
|
+
}
|
|
159
|
+
.small-size {
|
|
160
|
+
height: 0.94rem;
|
|
161
|
+
}
|
|
162
|
+
`
|
|
163
|
+
];
|
|
164
|
+
e([
|
|
165
|
+
o({ type: String })
|
|
166
|
+
], t.prototype, "type", 2);
|
|
167
|
+
e([
|
|
168
|
+
o({ type: String })
|
|
169
|
+
], t.prototype, "placeholder", 2);
|
|
170
|
+
e([
|
|
171
|
+
o({ type: String })
|
|
172
|
+
], t.prototype, "value", 2);
|
|
173
|
+
e([
|
|
174
|
+
o({ type: Function })
|
|
175
|
+
], t.prototype, "onInput", 2);
|
|
176
|
+
e([
|
|
177
|
+
o({ type: Function })
|
|
178
|
+
], t.prototype, "onBlur", 2);
|
|
179
|
+
e([
|
|
180
|
+
o({ type: Function })
|
|
181
|
+
], t.prototype, "onClear", 2);
|
|
182
|
+
e([
|
|
183
|
+
o({ type: Boolean })
|
|
184
|
+
], t.prototype, "disableClearButton", 2);
|
|
185
|
+
e([
|
|
186
|
+
o({ type: Boolean })
|
|
187
|
+
], t.prototype, "required", 2);
|
|
188
|
+
e([
|
|
189
|
+
o({ type: Boolean })
|
|
190
|
+
], t.prototype, "server", 2);
|
|
191
|
+
e([
|
|
192
|
+
o({ type: String })
|
|
193
|
+
], t.prototype, "operator", 2);
|
|
194
|
+
e([
|
|
195
|
+
o({ type: Boolean })
|
|
196
|
+
], t.prototype, "disabled", 2);
|
|
197
|
+
e([
|
|
198
|
+
o({ type: Array })
|
|
199
|
+
], t.prototype, "filterOperators", 2);
|
|
200
|
+
e([
|
|
201
|
+
o({ type: String })
|
|
202
|
+
], t.prototype, "size", 2);
|
|
203
|
+
e([
|
|
204
|
+
o({ type: Function })
|
|
205
|
+
], t.prototype, "setOperator", 2);
|
|
206
|
+
t = e([
|
|
207
|
+
c("lit-input")
|
|
208
|
+
], t);
|
|
209
|
+
export {
|
|
210
|
+
t as LitInput
|
|
211
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import "../node_modules/@lit/reactive-element/reactive-element.js";
|
|
2
|
+
import { html as m } from "../node_modules/lit-html/lit-html.js";
|
|
3
|
+
import { LitElement as p } from "../node_modules/lit-element/lit-element.js";
|
|
4
|
+
import { customElement as a } from "../node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
5
|
+
import { css as u } from "../node_modules/@lit/reactive-element/css-tag.js";
|
|
6
|
+
var f = Object.getOwnPropertyDescriptor, c = (l, s, n, o) => {
|
|
7
|
+
for (var t = o > 1 ? void 0 : o ? f(s, n) : s, e = l.length - 1, i; e >= 0; e--)
|
|
8
|
+
(i = l[e]) && (t = i(t) || t);
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
let r = class extends p {
|
|
12
|
+
render() {
|
|
13
|
+
return m`
|
|
14
|
+
<ul>
|
|
15
|
+
<slot></slot>
|
|
16
|
+
</ul>
|
|
17
|
+
`;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
r.styles = u`
|
|
21
|
+
:host {
|
|
22
|
+
outline: none;
|
|
23
|
+
}
|
|
24
|
+
ul {
|
|
25
|
+
display: flex;
|
|
26
|
+
list-style-type: none;
|
|
27
|
+
padding: 0;
|
|
28
|
+
gap: 0.25rem;
|
|
29
|
+
width: 100%;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
margin: 0;
|
|
32
|
+
height: 100%;
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
r = c([
|
|
36
|
+
a("lit-menu")
|
|
37
|
+
], r);
|
|
38
|
+
export {
|
|
39
|
+
r as LitMenu
|
|
40
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import "../node_modules/@lit/reactive-element/reactive-element.js";
|
|
2
|
+
import { html as m } from "../node_modules/lit-html/lit-html.js";
|
|
3
|
+
import { LitElement as h } from "../node_modules/lit-element/lit-element.js";
|
|
4
|
+
import { customElement as c } from "../node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
5
|
+
import { property as s } from "../node_modules/@lit/reactive-element/decorators/property.js";
|
|
6
|
+
import { css as p } from "../node_modules/@lit/reactive-element/css-tag.js";
|
|
7
|
+
var u = Object.defineProperty, y = Object.getOwnPropertyDescriptor, n = (e, i, a, l) => {
|
|
8
|
+
for (var t = l > 1 ? void 0 : l ? y(i, a) : i, d = e.length - 1, r; d >= 0; d--)
|
|
9
|
+
(r = e[d]) && (t = (l ? r(i, a, t) : r(t)) || t);
|
|
10
|
+
return l && t && u(i, a, t), t;
|
|
11
|
+
};
|
|
12
|
+
let o = class extends h {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments), this.open = !1, this.closeOnOutsideClick = !0, this.fullScreen = !1, this._modalContainer = null, this._modalContent = null;
|
|
15
|
+
}
|
|
16
|
+
connectedCallback() {
|
|
17
|
+
super.connectedCallback(), document.addEventListener("keydown", this._handleKeyDown.bind(this));
|
|
18
|
+
}
|
|
19
|
+
disconnectedCallback() {
|
|
20
|
+
super.disconnectedCallback(), document.removeEventListener("keydown", this._handleKeyDown.bind(this));
|
|
21
|
+
}
|
|
22
|
+
updated(e) {
|
|
23
|
+
e.has("open") && (this.open ? this._showModal() : this._hideModal());
|
|
24
|
+
}
|
|
25
|
+
_handleBackdropClick() {
|
|
26
|
+
this.closeOnOutsideClick && (this.open = !1);
|
|
27
|
+
}
|
|
28
|
+
_showModal() {
|
|
29
|
+
if (!this._modalContainer) {
|
|
30
|
+
this._modalContainer = document.createElement("div"), this._modalContainer.classList.add("my-modal-root"), this._modalContainer.innerHTML = `
|
|
31
|
+
<div class="my-modal-backdrop"></div>
|
|
32
|
+
<div class="my-modal-content"></div>
|
|
33
|
+
`, document.body.appendChild(this._modalContainer);
|
|
34
|
+
const e = this._modalContainer.querySelector(".my-modal-backdrop");
|
|
35
|
+
e && e.addEventListener("click", this._handleBackdropClick.bind(this)), this._modalContent = this._modalContainer.querySelector(".my-modal-content");
|
|
36
|
+
}
|
|
37
|
+
this._modalContent && (this._updateContentClass(), this._modalContent.appendChild(this)), document.addEventListener("keydown", this._handleKeyDown), this._applyGlobalStyles();
|
|
38
|
+
}
|
|
39
|
+
_hideModal() {
|
|
40
|
+
this._modalContainer && (document.removeEventListener("keydown", this._handleKeyDown), this._modalContainer.remove(), this._modalContainer = null), typeof this.onClose == "function" && this.onClose(), this.dispatchEvent(new CustomEvent("modal-close", { bubbles: !0, composed: !0 }));
|
|
41
|
+
}
|
|
42
|
+
_handleKeyDown(e) {
|
|
43
|
+
e.key === "Escape" && (this.open = !1);
|
|
44
|
+
}
|
|
45
|
+
_updateContentClass() {
|
|
46
|
+
this._modalContent && (this.fullScreen ? this._modalContent.classList.add("fullscreen") : this._modalContent.classList.remove("fullscreen"));
|
|
47
|
+
}
|
|
48
|
+
_applyGlobalStyles() {
|
|
49
|
+
if (!document.getElementById("my-modal-global-styles")) {
|
|
50
|
+
const e = document.createElement("style");
|
|
51
|
+
e.id = "my-modal-global-styles", e.textContent = `
|
|
52
|
+
.my-modal-root {
|
|
53
|
+
position: fixed;
|
|
54
|
+
top: 0; left: 0; right: 0; bottom: 0;
|
|
55
|
+
z-index: 10000;
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
justify-content: center;
|
|
59
|
+
}
|
|
60
|
+
.my-modal-backdrop {
|
|
61
|
+
position: absolute;
|
|
62
|
+
top: 0; left: 0; right: 0; bottom: 0;
|
|
63
|
+
background: rgba(0,0,0,0.5);
|
|
64
|
+
}
|
|
65
|
+
.my-modal-content {
|
|
66
|
+
position: relative;
|
|
67
|
+
background: var(--background-paper, #fff);
|
|
68
|
+
border-radius: 12px;
|
|
69
|
+
min-width: 40vw;
|
|
70
|
+
max-width: 90vw;
|
|
71
|
+
max-height: 90vh;
|
|
72
|
+
z-index: 1;
|
|
73
|
+
box-shadow: 0 8px 32px rgba(0,0,0,0.2);
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
align-items: center;
|
|
78
|
+
overflow: hidden;
|
|
79
|
+
gap: 0.5rem;
|
|
80
|
+
|
|
81
|
+
}
|
|
82
|
+
.my-modal-content.fullscreen {
|
|
83
|
+
border-radius: 0;
|
|
84
|
+
width: 100vw;
|
|
85
|
+
height: 100vh;
|
|
86
|
+
max-width: 100vw;
|
|
87
|
+
max-height: 100vh;
|
|
88
|
+
padding: 0;
|
|
89
|
+
display: flex;
|
|
90
|
+
}
|
|
91
|
+
`, document.head.appendChild(e);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
render() {
|
|
95
|
+
return m`<slot></slot>`;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
o.styles = p`
|
|
99
|
+
:host {
|
|
100
|
+
display: none;
|
|
101
|
+
width: 100%;
|
|
102
|
+
height: 100vh;
|
|
103
|
+
@media (min-width: 768px) {
|
|
104
|
+
height: 100%;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
:host([open]) {
|
|
108
|
+
display: block;
|
|
109
|
+
}
|
|
110
|
+
`;
|
|
111
|
+
n([
|
|
112
|
+
s({ type: Boolean, reflect: !0 })
|
|
113
|
+
], o.prototype, "open", 2);
|
|
114
|
+
n([
|
|
115
|
+
s({ type: Boolean })
|
|
116
|
+
], o.prototype, "closeOnOutsideClick", 2);
|
|
117
|
+
n([
|
|
118
|
+
s({ type: Function })
|
|
119
|
+
], o.prototype, "onClose", 2);
|
|
120
|
+
n([
|
|
121
|
+
s({ type: Boolean })
|
|
122
|
+
], o.prototype, "fullScreen", 2);
|
|
123
|
+
o = n([
|
|
124
|
+
c("lit-modal")
|
|
125
|
+
], o);
|
|
126
|
+
export {
|
|
127
|
+
o as LitModal
|
|
128
|
+
};
|