overview-components 1.0.77 → 1.0.79
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/_virtual/_commonjsHelpers.js +6 -2
- package/dist/_virtual/air-datepicker.js +4 -0
- package/dist/index.d.ts +56 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +105 -53
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +285 -231
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +48 -47
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +39 -38
- package/dist/node_modules/air-datepicker/air-datepicker.js +1147 -0
- package/dist/node_modules/air-datepicker/index.es.js +4 -0
- package/dist/shared/filter-inputs.js +326 -0
- package/dist/shared/lit-case-variables-tab-cell.js +207 -0
- package/dist/shared/lit-custom-popper.js +99 -0
- package/dist/shared/lit-data-grid-action-buttons-popover.js +258 -0
- package/dist/shared/lit-data-grid-density-popover.js +79 -0
- package/dist/shared/lit-data-grid-export-popover.js +66 -0
- package/dist/shared/lit-data-grid-operators-popover.js +94 -0
- package/dist/shared/lit-data-grid-row-actions.js +73 -0
- package/dist/shared/lit-date-picker.js +525 -0
- package/dist/shared/lit-icon-button.d.ts +1 -1
- package/dist/shared/lit-icon-button.d.ts.map +1 -1
- package/dist/shared/lit-icon-button.js +91 -0
- package/dist/shared/lit-label.js +96 -0
- package/dist/shared/lit-loader.d.ts +1 -1
- package/dist/shared/lit-loader.d.ts.map +1 -1
- package/dist/shared/lit-loader.js +70 -0
- package/dist/shared/lit-loading-bar.d.ts +1 -1
- package/dist/shared/lit-loading-bar.d.ts.map +1 -1
- package/dist/shared/lit-loading-bar.js +94 -0
- package/dist/shared/lit-menu-item.d.ts +1 -1
- package/dist/shared/lit-menu-item.d.ts.map +1 -1
- package/dist/shared/lit-menu-item.js +94 -0
- package/dist/shared/lit-modal-body.js +28 -0
- package/dist/shared/lit-modal-footer.js +32 -0
- package/dist/shared/lit-modal-header.js +39 -0
- package/dist/shared/lit-overflow-tooltip.js +85 -0
- package/dist/shared/lit-responsive-button.js +84 -0
- package/dist/shared/lit-select-field.js +376 -0
- package/dist/shared/lit-settings.js +60 -0
- package/dist/shared/lit-text-field.d.ts +1 -1
- package/dist/shared/lit-text-field.d.ts.map +1 -1
- package/dist/shared/lit-text-field.js +205 -0
- package/dist/shared/lit-toggle.js +213 -0
- package/dist/shared/simple-popper.js +186 -0
- package/dist/shared/simple-tooltip.js +1 -1
- package/dist/style.css +1 -0
- package/dist/utils/localization.js +410 -25
- package/dist/utils/utils.js +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,525 @@
|
|
|
1
|
+
import "../node_modules/@lit/reactive-element/reactive-element.js";
|
|
2
|
+
import { html as h } from "../node_modules/lit-html/lit-html.js";
|
|
3
|
+
import { LitElement as v } from "../node_modules/lit-element/lit-element.js";
|
|
4
|
+
import { customElement as b } from "../node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
5
|
+
import { property as n } from "../node_modules/@lit/reactive-element/decorators/property.js";
|
|
6
|
+
import { state as f } from "../node_modules/@lit/reactive-element/decorators/state.js";
|
|
7
|
+
import { query as g } from "../node_modules/@lit/reactive-element/decorators/query.js";
|
|
8
|
+
import { isEqual as k, isEmpty as D } from "lodash";
|
|
9
|
+
import l from "../node_modules/luxon/src/datetime.js";
|
|
10
|
+
import "../node_modules/luxon/src/duration.js";
|
|
11
|
+
import { msg as d } from "../node_modules/@lit/localize/init/install.js";
|
|
12
|
+
import "../node_modules/@lit/localize/init/runtime.js";
|
|
13
|
+
/* empty css */
|
|
14
|
+
import $ from "../node_modules/air-datepicker/air-datepicker.js";
|
|
15
|
+
import { localizedDatePicker as S } from "../utils/localization.js";
|
|
16
|
+
import { classMap as y } from "../node_modules/lit-html/directives/class-map.js";
|
|
17
|
+
import { debounce as O } from "../utils/utils.js";
|
|
18
|
+
import { autoUpdate as P, computePosition as w, offset as C, flip as M, hide as x, shift as E } from "../node_modules/@floating-ui/dom/dist/floating-ui.dom.js";
|
|
19
|
+
import { css as T } from "../node_modules/@lit/reactive-element/css-tag.js";
|
|
20
|
+
var L = Object.defineProperty, I = Object.getOwnPropertyDescriptor, o = (e, t, a, i) => {
|
|
21
|
+
for (var s = i > 1 ? void 0 : i ? I(t, a) : t, p = e.length - 1, c; p >= 0; p--)
|
|
22
|
+
(c = e[p]) && (s = (i ? c(t, a, s) : c(s)) || s);
|
|
23
|
+
return i && s && L(t, a, s), s;
|
|
24
|
+
};
|
|
25
|
+
let r = class extends v {
|
|
26
|
+
constructor() {
|
|
27
|
+
super(), this.pickerVariant = "date", this.userLang = "cs", this.placeholder = "", this.disableClearButton = !1, this.range = !1, this.server = !1, this.disabled = !1, this.setOperator = (e, t) => {
|
|
28
|
+
}, this.filterOperators = [], this.displayValue = "", this.isSubmenuOpen = !1, this.submenuTriggerEl = null, this.handleOutsideClick = (e) => {
|
|
29
|
+
const t = e.composedPath(), a = t.some(
|
|
30
|
+
(i) => i instanceof HTMLElement && i.classList.contains("air-datepicker")
|
|
31
|
+
);
|
|
32
|
+
!t.includes(this) && !a && this.datePicker.visible && (this.datePicker.clear(), this.datePicker.hide());
|
|
33
|
+
}, this.debouncedHandleInput = O(this.handleDateInput, 500);
|
|
34
|
+
}
|
|
35
|
+
connectedCallback() {
|
|
36
|
+
super.connectedCallback(), this.addEventListener("focus", () => this.focus());
|
|
37
|
+
}
|
|
38
|
+
disconnectedCallback() {
|
|
39
|
+
super.disconnectedCallback(), document.removeEventListener("click", this.handleOutsideClick, { capture: !0 }), this.removeEventListener("focus", () => this.focus());
|
|
40
|
+
}
|
|
41
|
+
updated(e) {
|
|
42
|
+
if (e.has("operator")) {
|
|
43
|
+
const t = e.get("operator");
|
|
44
|
+
(this.operator === "fromTo" || t === "fromTo") && this.datePicker.update(
|
|
45
|
+
{
|
|
46
|
+
range: this.operator === "fromTo"
|
|
47
|
+
},
|
|
48
|
+
{ silent: !0 }
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
if (e.has("range") && this.datePicker.update(
|
|
52
|
+
{
|
|
53
|
+
range: this.range
|
|
54
|
+
},
|
|
55
|
+
{ silent: !0 }
|
|
56
|
+
), e.has("value") && !k(this.value, e.get("value"))) {
|
|
57
|
+
if (typeof this.value > "u" || this.value === "") {
|
|
58
|
+
this.datePicker.clear({ silent: !0 });
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
this.value && this.datePicker.selectDate(this.value, { silent: !0 });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
reinitializeDatePicker() {
|
|
65
|
+
this.datePicker && this.datePicker.destroy(), this.datePicker = new $(this.dateInputEl, {
|
|
66
|
+
timepicker: this.pickerVariant === "dateTime",
|
|
67
|
+
multipleDatesSeparator: " - ",
|
|
68
|
+
// isMobile: window.matchMedia('(max-width: 600px)').matches,
|
|
69
|
+
dateFormat: this.dateFormat || void 0,
|
|
70
|
+
locale: this.getLocale(),
|
|
71
|
+
autoClose: !0,
|
|
72
|
+
range: this.operator === "fromTo",
|
|
73
|
+
onRenderCell: ({
|
|
74
|
+
date: e,
|
|
75
|
+
cellType: t
|
|
76
|
+
}) => {
|
|
77
|
+
e.getDate();
|
|
78
|
+
},
|
|
79
|
+
onShow: () => {
|
|
80
|
+
var i, s, p;
|
|
81
|
+
const e = this.datePicker.$datepicker;
|
|
82
|
+
this.submenuTriggerEl = e == null ? void 0 : e.querySelector(".submenu-trigger"), this.submenuTriggerEl && (this.submenuTriggerEl.addEventListener("mouseenter", () => {
|
|
83
|
+
this.openSubmenu(!0);
|
|
84
|
+
}), (i = this.submenuTriggerEl) == null || i.addEventListener("mouseleave", (c) => {
|
|
85
|
+
const u = c.relatedTarget;
|
|
86
|
+
(u == null ? void 0 : u.closest("simple-popper")) || this.openSubmenu(!1);
|
|
87
|
+
}));
|
|
88
|
+
const t = (s = this.datePicker) == null ? void 0 : s.$datepicker, a = this.dateInputEl;
|
|
89
|
+
!t || !a || ((p = this.cleanupAutoUpdate) == null || p.call(this), this.cleanupAutoUpdate = P(a, t, () => {
|
|
90
|
+
w(a, t, {
|
|
91
|
+
placement: "bottom-start",
|
|
92
|
+
middleware: [C(4), M(), x(), E({ padding: 8 })]
|
|
93
|
+
}).then(({ x: c, y: u, middlewareData: m }) => {
|
|
94
|
+
m.hide && Object.assign(t.style, {
|
|
95
|
+
display: m.hide.referenceHidden ? "none" : "block"
|
|
96
|
+
}), Object.assign(t.style, {
|
|
97
|
+
position: "absolute",
|
|
98
|
+
left: `${c}px`,
|
|
99
|
+
top: `${u}px`,
|
|
100
|
+
overflow: "visible"
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
}));
|
|
104
|
+
},
|
|
105
|
+
onHide: () => {
|
|
106
|
+
var e;
|
|
107
|
+
(e = this.cleanupAutoUpdate) == null || e.call(this), this.openSubmenu(!1);
|
|
108
|
+
},
|
|
109
|
+
buttons: [
|
|
110
|
+
{
|
|
111
|
+
content: d("Dnes"),
|
|
112
|
+
// Button text
|
|
113
|
+
className: "custom-today-btn",
|
|
114
|
+
// Custom class (optional)
|
|
115
|
+
onClick: (e) => {
|
|
116
|
+
this.handleSetOperator("="), e.update({
|
|
117
|
+
range: !1,
|
|
118
|
+
selectedDates: [/* @__PURE__ */ new Date()]
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
...this.server ? [
|
|
123
|
+
{
|
|
124
|
+
content: '<lit-icon icon="arrowLeft" size="1rem" style="margin-right: 0.5rem"></lit-icon> ' + d("Rychlé volby"),
|
|
125
|
+
className: "custom-today-btn submenu-trigger",
|
|
126
|
+
onClick: () => {
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
] : []
|
|
130
|
+
],
|
|
131
|
+
onSelect: ({
|
|
132
|
+
date: e,
|
|
133
|
+
formattedDate: t,
|
|
134
|
+
datepicker: a
|
|
135
|
+
}) => {
|
|
136
|
+
if (Array.isArray(e) && e.length === 2) {
|
|
137
|
+
const i = e[0].toISOString(), s = e[1].toISOString();
|
|
138
|
+
this.value = [i, s];
|
|
139
|
+
} else e instanceof Date ? this.value = e.toISOString() : (Array.isArray(e) && e.length === 0 || !e) && (this.value = void 0);
|
|
140
|
+
this.onChange && this.onChange(this.value), this.displayValue = t;
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
firstUpdated() {
|
|
145
|
+
this.reinitializeDatePicker(), document.addEventListener("click", this.handleOutsideClick, { capture: !0 });
|
|
146
|
+
}
|
|
147
|
+
openSubmenu(e) {
|
|
148
|
+
this.isSubmenuOpen = e;
|
|
149
|
+
}
|
|
150
|
+
getLocale() {
|
|
151
|
+
const e = this.userLang || localStorage.getItem("userLang") || "cs";
|
|
152
|
+
return S.get(e);
|
|
153
|
+
}
|
|
154
|
+
handleDateInput(e) {
|
|
155
|
+
const t = this._parseDate(e);
|
|
156
|
+
t && this.datePicker.selectDate(t), e === "" && this.datePicker.clear();
|
|
157
|
+
}
|
|
158
|
+
_parseDate(e) {
|
|
159
|
+
const t = [
|
|
160
|
+
{ regex: /^(\d{1,2})\.(\d{1,2})\.(\d{4})$/, format: "d.M.yyyy" },
|
|
161
|
+
// d.M.yyyy
|
|
162
|
+
{ regex: /^(\d{2})\.(\d{2})\.(\d{4})$/, format: "dd.MM.yyyy" },
|
|
163
|
+
// dd.MM.yyyy
|
|
164
|
+
{ regex: /^(\d{2})\/(\d{2})\/(\d{4})$/, format: "MM/dd/yyyy" },
|
|
165
|
+
// MM/dd/yyyy
|
|
166
|
+
{ regex: /^(\d{2})\/(\d{2})\/(\d{4})$/, format: "dd/MM/yyyy" },
|
|
167
|
+
// dd/MM/yyyy
|
|
168
|
+
{ regex: /^(\d{4})-(\d{2})-(\d{2})$/, format: "yyyy-MM-dd" },
|
|
169
|
+
// yyyy-MM-dd
|
|
170
|
+
// Ranges
|
|
171
|
+
{
|
|
172
|
+
regex: /^(\d{2})\.(\d{2})\.(\d{4})\s*-\s*(\d{2})\.(\d{2})\.(\d{4})$/,
|
|
173
|
+
format: "dd.MM.yyyy - dd.MM.yyyy"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
regex: /^(\d{1,2})\.(\d{1,2})\.(\d{4})\s*-\s*(\d{1,2})\.(\d{1,2})\.(\d{4})$/,
|
|
177
|
+
format: "d.M.yyyy - d.M.yyyy"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
regex: /^(\d{2})\/(\d{2})\/(\d{4})\s*-\s*(\d{2})\/(\d{2})\/(\d{4})$/,
|
|
181
|
+
format: "MM/dd/yyyy - MM/dd/yyyy"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
regex: /^(\d{2})\/(\d{2})\/(\d{4})\s*-\s*(\d{2})\/(\d{2})\/(\d{4})$/,
|
|
185
|
+
format: "dd/MM/yyyy - dd/MM/yyyy"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
regex: /^(\d{4})-(\d{2})-(\d{2})\s*-\s*(\d{4})-(\d{2})-(\d{2})$/,
|
|
189
|
+
format: "yyyy-MM-dd - yyyy-MM-dd"
|
|
190
|
+
}
|
|
191
|
+
];
|
|
192
|
+
for (const { regex: a, format: i } of t) {
|
|
193
|
+
const s = e.match(a);
|
|
194
|
+
if (s)
|
|
195
|
+
if (i.includes(" - ")) {
|
|
196
|
+
const p = s[0].split(" - ")[0], c = s[0].split(" - ")[1], u = l.fromFormat(p, this.dateFormat || i.split(" - ")[0]).toJSDate();
|
|
197
|
+
console.log("startDateStr", p), console.log(i.split(" - ")[0]), console.log("startDate", u);
|
|
198
|
+
const m = l.fromFormat(c, this.dateFormat || i.split(" - ")[1]).toJSDate();
|
|
199
|
+
return [u, m];
|
|
200
|
+
} else
|
|
201
|
+
return l.fromFormat(e, this.dateFormat || i).toJSDate();
|
|
202
|
+
}
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
handleSetOperator(e) {
|
|
206
|
+
this.datePicker.update(
|
|
207
|
+
{
|
|
208
|
+
range: e === "fromTo",
|
|
209
|
+
selectedDates: []
|
|
210
|
+
},
|
|
211
|
+
{ silent: !0 }
|
|
212
|
+
), ["isEmpty", "isNotEmpty"].includes(e) || this.datePicker.show(), this.setOperator(e, { silent: !0 });
|
|
213
|
+
}
|
|
214
|
+
focus() {
|
|
215
|
+
var t;
|
|
216
|
+
const e = (t = this.shadowRoot) == null ? void 0 : t.querySelector("input");
|
|
217
|
+
e == null || e.focus();
|
|
218
|
+
}
|
|
219
|
+
_handleClearButtonClick() {
|
|
220
|
+
this.datePicker.clear();
|
|
221
|
+
}
|
|
222
|
+
render() {
|
|
223
|
+
return h`
|
|
224
|
+
<div class="custom-icon-wrapper">
|
|
225
|
+
<input
|
|
226
|
+
id="dateInput"
|
|
227
|
+
class="inputs customCell"
|
|
228
|
+
type="text"
|
|
229
|
+
placeholder="${d(this.placeholder)}"
|
|
230
|
+
value="${this.displayValue || ""}"
|
|
231
|
+
@input=${(e) => this.debouncedHandleInput(e.target.value)}
|
|
232
|
+
.disabled="${this.disabled}"
|
|
233
|
+
/>
|
|
234
|
+
<div
|
|
235
|
+
class=${y({
|
|
236
|
+
"events-icon": !0,
|
|
237
|
+
"events-icon--no-filter": !this.server
|
|
238
|
+
})}
|
|
239
|
+
@click=${() => {
|
|
240
|
+
this.datePicker.show();
|
|
241
|
+
}}
|
|
242
|
+
>
|
|
243
|
+
<lit-icon-button
|
|
244
|
+
icon="events"
|
|
245
|
+
size="small"
|
|
246
|
+
variant="text"
|
|
247
|
+
.disabled="${this.disabled}"
|
|
248
|
+
></lit-icon-button>
|
|
249
|
+
</div>
|
|
250
|
+
${(!D(this.value) || this.operator === "isEmpty" || this.operator === "isNotEmpty") && !this.disableClearButton ? h`
|
|
251
|
+
<div
|
|
252
|
+
class=${y({
|
|
253
|
+
"clear-icon": !0,
|
|
254
|
+
"clear-icon--no-filter": !this.server
|
|
255
|
+
})}
|
|
256
|
+
@click=${() => {
|
|
257
|
+
this._handleClearButtonClick();
|
|
258
|
+
}}
|
|
259
|
+
>
|
|
260
|
+
<lit-icon-button
|
|
261
|
+
icon="close"
|
|
262
|
+
size="small"
|
|
263
|
+
variant="text"
|
|
264
|
+
></lit-icon-button>
|
|
265
|
+
</div>
|
|
266
|
+
` : ""}
|
|
267
|
+
${this.server ? h`<lit-data-grid-operators-popover
|
|
268
|
+
class="filter-icon"
|
|
269
|
+
.type="${"date"}"
|
|
270
|
+
.setOperator="${(e) => {
|
|
271
|
+
this.handleSetOperator(e);
|
|
272
|
+
}}"
|
|
273
|
+
.operator="${this.operator}"
|
|
274
|
+
@mousedown=${(e) => {
|
|
275
|
+
e.preventDefault(), e.stopPropagation();
|
|
276
|
+
}}
|
|
277
|
+
.disabled="${this.disabled}"
|
|
278
|
+
.filterOperators="${this.filterOperators}"
|
|
279
|
+
></lit-data-grid-operators-popover>` : null}
|
|
280
|
+
</div>
|
|
281
|
+
${this.server ? h`<simple-popper
|
|
282
|
+
placement="left-end"
|
|
283
|
+
manualOpening
|
|
284
|
+
.offset="${0}"
|
|
285
|
+
.target=${this.submenuTriggerEl}
|
|
286
|
+
.showing=${this.isSubmenuOpen}
|
|
287
|
+
>
|
|
288
|
+
<lit-menu>
|
|
289
|
+
<lit-menu-item
|
|
290
|
+
icon="events"
|
|
291
|
+
.onClick="${() => {
|
|
292
|
+
this.handleSetOperator("fromTo"), this.datePicker.update({
|
|
293
|
+
range: !0,
|
|
294
|
+
selectedDates: [
|
|
295
|
+
l.now().minus({ days: 7 }).toJSDate(),
|
|
296
|
+
/* @__PURE__ */ new Date()
|
|
297
|
+
]
|
|
298
|
+
}), this.isSubmenuOpen = !1;
|
|
299
|
+
}}"
|
|
300
|
+
>
|
|
301
|
+
${d("Posledních 7 dní")}
|
|
302
|
+
</lit-menu-item>
|
|
303
|
+
<lit-menu-item
|
|
304
|
+
icon="events"
|
|
305
|
+
.onClick="${() => {
|
|
306
|
+
this.handleSetOperator("fromTo"), this.datePicker.update({
|
|
307
|
+
range: !0,
|
|
308
|
+
selectedDates: [
|
|
309
|
+
l.now().minus({ days: 14 }).toJSDate(),
|
|
310
|
+
/* @__PURE__ */ new Date()
|
|
311
|
+
]
|
|
312
|
+
}), this.isSubmenuOpen = !1;
|
|
313
|
+
}}"
|
|
314
|
+
>
|
|
315
|
+
${d("Posledních 14 dní")}
|
|
316
|
+
</lit-menu-item>
|
|
317
|
+
<lit-menu-item
|
|
318
|
+
icon="events"
|
|
319
|
+
.onClick="${() => {
|
|
320
|
+
this.handleSetOperator("fromTo"), this.datePicker.update({
|
|
321
|
+
range: !0,
|
|
322
|
+
selectedDates: [
|
|
323
|
+
l.now().minus({ days: 30 }).toJSDate(),
|
|
324
|
+
/* @__PURE__ */ new Date()
|
|
325
|
+
]
|
|
326
|
+
}), this.isSubmenuOpen = !1;
|
|
327
|
+
}}"
|
|
328
|
+
>
|
|
329
|
+
${d("Posledních 30 dní")}
|
|
330
|
+
</lit-menu-item>
|
|
331
|
+
<lit-menu-item
|
|
332
|
+
icon="events"
|
|
333
|
+
.onClick="${() => {
|
|
334
|
+
this.handleSetOperator("fromTo"), this.datePicker.update({
|
|
335
|
+
range: !0,
|
|
336
|
+
selectedDates: [
|
|
337
|
+
l.now().minus({ months: 1 }).startOf("month").toJSDate(),
|
|
338
|
+
/* @__PURE__ */ new Date()
|
|
339
|
+
]
|
|
340
|
+
});
|
|
341
|
+
}}"
|
|
342
|
+
>
|
|
343
|
+
${d("Poslední kalendářní měsíc")}
|
|
344
|
+
</lit-menu-item>
|
|
345
|
+
<lit-menu-item
|
|
346
|
+
icon="events"
|
|
347
|
+
.onClick="${() => {
|
|
348
|
+
this.handleSetOperator("fromTo");
|
|
349
|
+
const e = l.now();
|
|
350
|
+
e.quarter;
|
|
351
|
+
const t = e.minus({ quarters: 1 }), a = t.startOf("quarter"), i = t.endOf("quarter");
|
|
352
|
+
this.datePicker.update({
|
|
353
|
+
range: !0,
|
|
354
|
+
selectedDates: [
|
|
355
|
+
a.toJSDate(),
|
|
356
|
+
i.toJSDate()
|
|
357
|
+
]
|
|
358
|
+
});
|
|
359
|
+
}}"
|
|
360
|
+
>
|
|
361
|
+
${d("Poslední kvartál")}
|
|
362
|
+
</lit-menu-item>
|
|
363
|
+
<lit-menu-item
|
|
364
|
+
icon="events"
|
|
365
|
+
.onClick="${() => {
|
|
366
|
+
this.handleSetOperator("fromTo"), this.datePicker.update({
|
|
367
|
+
range: !0,
|
|
368
|
+
selectedDates: [
|
|
369
|
+
l.now().minus({ months: 12 }).toJSDate(),
|
|
370
|
+
/* @__PURE__ */ new Date()
|
|
371
|
+
]
|
|
372
|
+
});
|
|
373
|
+
}}"
|
|
374
|
+
>
|
|
375
|
+
${d("Poslední 12 měsíců")}
|
|
376
|
+
</lit-menu-item>
|
|
377
|
+
<lit-menu-item
|
|
378
|
+
icon="events"
|
|
379
|
+
.onClick="${() => {
|
|
380
|
+
this.handleSetOperator("fromTo"), this.datePicker.update({
|
|
381
|
+
range: !0,
|
|
382
|
+
selectedDates: [
|
|
383
|
+
l.now().startOf("year").toJSDate(),
|
|
384
|
+
l.now().endOf("year").toJSDate()
|
|
385
|
+
]
|
|
386
|
+
});
|
|
387
|
+
}}"
|
|
388
|
+
>
|
|
389
|
+
${d("Poslední kalendářní rok")}
|
|
390
|
+
</lit-menu-item>
|
|
391
|
+
</lit-menu>
|
|
392
|
+
</simple-popper>` : ""}
|
|
393
|
+
`;
|
|
394
|
+
}
|
|
395
|
+
};
|
|
396
|
+
r.styles = T`
|
|
397
|
+
.custom-icon-wrapper {
|
|
398
|
+
position: relative;
|
|
399
|
+
width: 100%;
|
|
400
|
+
display: inline-block;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
input {
|
|
404
|
+
padding: 0.5rem;
|
|
405
|
+
border: 0.0625rem solid var(--color-divider, #d0d3db);
|
|
406
|
+
border-radius: 0.25rem;
|
|
407
|
+
min-width: 0;
|
|
408
|
+
width: -webkit-fill-available;
|
|
409
|
+
width: -moz-available;
|
|
410
|
+
width: fill-available;
|
|
411
|
+
background-color: var(--background-paper, #fff);
|
|
412
|
+
color: var(--text-primary, #111827);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
input:hover:not(:disabled) {
|
|
416
|
+
border: 0.0625rem solid var(--color-secondary-main, #111827);
|
|
417
|
+
}
|
|
418
|
+
input:disabled {
|
|
419
|
+
background-color: var(--background-paper, #fff);
|
|
420
|
+
cursor: not-allowed;
|
|
421
|
+
}
|
|
422
|
+
input:focus {
|
|
423
|
+
outline: none;
|
|
424
|
+
border: 0.0625rem solid var(--color-secondary-dark, #010204);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.custom-icon-wrapper .clear-icon {
|
|
428
|
+
display: none;
|
|
429
|
+
position: absolute;
|
|
430
|
+
right: 56px;
|
|
431
|
+
top: 50%;
|
|
432
|
+
transform: translateY(-50%);
|
|
433
|
+
cursor: pointer;
|
|
434
|
+
pointer-events: auto;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.custom-icon-wrapper .clear-icon--no-filter {
|
|
438
|
+
right: 33px;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.custom-icon-wrapper:hover .clear-icon {
|
|
442
|
+
display: inline-block;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
.custom-icon-wrapper .events-icon {
|
|
446
|
+
position: absolute;
|
|
447
|
+
right: 33px;
|
|
448
|
+
top: 50%;
|
|
449
|
+
transform: translateY(-50%);
|
|
450
|
+
z-index: 0;
|
|
451
|
+
cursor: pointer;
|
|
452
|
+
pointer-events: auto;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.custom-icon-wrapper .events-icon--no-filter {
|
|
456
|
+
right: 10px;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.custom-icon-wrapper .filter-icon {
|
|
460
|
+
display: block;
|
|
461
|
+
position: absolute;
|
|
462
|
+
right: 10px;
|
|
463
|
+
top: 50%;
|
|
464
|
+
transform: translateY(-50%);
|
|
465
|
+
cursor: pointer;
|
|
466
|
+
pointer-events: auto;
|
|
467
|
+
}
|
|
468
|
+
`;
|
|
469
|
+
o([
|
|
470
|
+
n({ type: String })
|
|
471
|
+
], r.prototype, "dateFormat", 2);
|
|
472
|
+
o([
|
|
473
|
+
n({ type: String })
|
|
474
|
+
], r.prototype, "pickerVariant", 2);
|
|
475
|
+
o([
|
|
476
|
+
n({ type: String })
|
|
477
|
+
], r.prototype, "value", 2);
|
|
478
|
+
o([
|
|
479
|
+
n({ type: String })
|
|
480
|
+
], r.prototype, "userLang", 2);
|
|
481
|
+
o([
|
|
482
|
+
n({ type: String })
|
|
483
|
+
], r.prototype, "placeholder", 2);
|
|
484
|
+
o([
|
|
485
|
+
n({ type: Function })
|
|
486
|
+
], r.prototype, "onChange", 2);
|
|
487
|
+
o([
|
|
488
|
+
n({ type: Boolean })
|
|
489
|
+
], r.prototype, "disableClearButton", 2);
|
|
490
|
+
o([
|
|
491
|
+
n({ type: Boolean })
|
|
492
|
+
], r.prototype, "range", 2);
|
|
493
|
+
o([
|
|
494
|
+
n({ type: Boolean })
|
|
495
|
+
], r.prototype, "server", 2);
|
|
496
|
+
o([
|
|
497
|
+
n({ type: String })
|
|
498
|
+
], r.prototype, "operator", 2);
|
|
499
|
+
o([
|
|
500
|
+
n({ type: Boolean })
|
|
501
|
+
], r.prototype, "disabled", 2);
|
|
502
|
+
o([
|
|
503
|
+
n({ type: Function })
|
|
504
|
+
], r.prototype, "setOperator", 2);
|
|
505
|
+
o([
|
|
506
|
+
n({ type: Array })
|
|
507
|
+
], r.prototype, "filterOperators", 2);
|
|
508
|
+
o([
|
|
509
|
+
f()
|
|
510
|
+
], r.prototype, "displayValue", 2);
|
|
511
|
+
o([
|
|
512
|
+
g("#dateInput")
|
|
513
|
+
], r.prototype, "dateInputEl", 2);
|
|
514
|
+
o([
|
|
515
|
+
f()
|
|
516
|
+
], r.prototype, "isSubmenuOpen", 2);
|
|
517
|
+
o([
|
|
518
|
+
g("simple-popper")
|
|
519
|
+
], r.prototype, "simplePopperEl", 2);
|
|
520
|
+
r = o([
|
|
521
|
+
b("lit-date-picker")
|
|
522
|
+
], r);
|
|
523
|
+
export {
|
|
524
|
+
r as LitDatePicker
|
|
525
|
+
};
|
|
@@ -9,7 +9,7 @@ type LitIconButtonProps = {
|
|
|
9
9
|
icon?: Icon;
|
|
10
10
|
marked?: boolean;
|
|
11
11
|
};
|
|
12
|
-
export declare class
|
|
12
|
+
export declare class LitIconButton extends LitElement {
|
|
13
13
|
variant?: 'text' | 'contained' | 'outlined' | 'dashed' | 'error' | 'ai' | 'outlined-ai';
|
|
14
14
|
size?: 'small' | 'medium' | 'large';
|
|
15
15
|
disabled?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lit-icon-button.d.ts","sourceRoot":"","sources":["../../src/shared/lit-icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAK1C,KAAK,kBAAkB,GAAG;IACtB,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,IAAI,GAAG,aAAa,CAAC;IACxF,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AACF,qBACa,
|
|
1
|
+
{"version":3,"file":"lit-icon-button.d.ts","sourceRoot":"","sources":["../../src/shared/lit-icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAK1C,KAAK,kBAAkB,GAAG;IACtB,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,IAAI,GAAG,aAAa,CAAC;IACxF,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AACF,qBACa,aAAc,SAAQ,UAAU;IAEb,OAAO,CAAC,EAC9B,MAAM,GACN,WAAW,GACX,UAAU,GACV,QAAQ,GACR,OAAO,GACP,IAAI,GACJ,aAAa,CAAe;IACN,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAY;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAS;IACZ,MAAM,CAAC,EAAE,OAAO,CAAS;IACzC,IAAI,CAAC,EAAE,IAAI,CAAS;IACnB,MAAM,CAAC,EAAE,OAAO,CAAS;IAGtD,MAAM,CAAC,MAAM,4BAiCX;IAGF,MAAM;CAwBT;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,iBAAiB,EAAE,kBAAkB,CAAC;KACzC;CACJ"}
|
|
@@ -0,0 +1,91 @@
|
|
|
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 c } from "../node_modules/lit-element/lit-element.js";
|
|
4
|
+
import { customElement as h } 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 u from "./styles/button-shared-styles.js";
|
|
7
|
+
import { css as d } from "../node_modules/@lit/reactive-element/css-tag.js";
|
|
8
|
+
var b = Object.defineProperty, f = Object.getOwnPropertyDescriptor, i = (r, o, a, n) => {
|
|
9
|
+
for (var e = n > 1 ? void 0 : n ? f(o, a) : o, p = r.length - 1, l; p >= 0; p--)
|
|
10
|
+
(l = r[p]) && (e = (n ? l(o, a, e) : l(e)) || e);
|
|
11
|
+
return n && e && b(o, a, e), e;
|
|
12
|
+
};
|
|
13
|
+
let t = class extends c {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments), this.variant = "contained", this.size = "medium", this.disabled = !1, this.active = !1, this.icon = "add", this.marked = !1;
|
|
16
|
+
}
|
|
17
|
+
// Render method to define the component's template
|
|
18
|
+
render() {
|
|
19
|
+
const r = `button--${this.size} button--${this.variant} ${this.active ? "active" : ""}`, o = this.size === "large" ? "1.5rem" : this.size === "medium" || this.marked ? "1.25rem" : this.size === "small" ? "1rem" : "0.75rem";
|
|
20
|
+
return m`
|
|
21
|
+
<button ?disabled=${this.disabled} class=${r}>
|
|
22
|
+
<slot name="icon"
|
|
23
|
+
>${this.icon && m`<lit-icon
|
|
24
|
+
class="out-ai"
|
|
25
|
+
.isActive="${this.marked}"
|
|
26
|
+
size="${o}"
|
|
27
|
+
icon=${this.icon}
|
|
28
|
+
></lit-icon>`}</slot
|
|
29
|
+
>
|
|
30
|
+
</button>
|
|
31
|
+
`;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
t.styles = [
|
|
35
|
+
// styles,
|
|
36
|
+
u,
|
|
37
|
+
d`
|
|
38
|
+
/* Base styles for icon button */
|
|
39
|
+
|
|
40
|
+
button {
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
font-size: inherit;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* Size variations */
|
|
46
|
+
|
|
47
|
+
.button--mini {
|
|
48
|
+
width: 12px;
|
|
49
|
+
height: 12px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.button--small {
|
|
53
|
+
width: 20px;
|
|
54
|
+
height: 20px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.button--medium {
|
|
58
|
+
width: 48px;
|
|
59
|
+
height: 36px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.button--large {
|
|
63
|
+
width: 48px;
|
|
64
|
+
height: 48px;
|
|
65
|
+
}
|
|
66
|
+
`
|
|
67
|
+
];
|
|
68
|
+
i([
|
|
69
|
+
s({ type: String })
|
|
70
|
+
], t.prototype, "variant", 2);
|
|
71
|
+
i([
|
|
72
|
+
s({ type: String })
|
|
73
|
+
], t.prototype, "size", 2);
|
|
74
|
+
i([
|
|
75
|
+
s({ type: Boolean })
|
|
76
|
+
], t.prototype, "disabled", 2);
|
|
77
|
+
i([
|
|
78
|
+
s({ type: Boolean, reflect: !0 })
|
|
79
|
+
], t.prototype, "active", 2);
|
|
80
|
+
i([
|
|
81
|
+
s({ type: String })
|
|
82
|
+
], t.prototype, "icon", 2);
|
|
83
|
+
i([
|
|
84
|
+
s({ type: Boolean })
|
|
85
|
+
], t.prototype, "marked", 2);
|
|
86
|
+
t = i([
|
|
87
|
+
h("lit-icon-button")
|
|
88
|
+
], t);
|
|
89
|
+
export {
|
|
90
|
+
t as LitIconButton
|
|
91
|
+
};
|