overview-components 1.0.92 → 1.0.95
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/FileSaver.min.js +4 -0
- package/dist/_virtual/___vite-browser-external.js +6 -0
- package/dist/_virtual/__vite-browser-external.js +4 -0
- package/dist/_virtual/_commonjs-dynamic-modules.js +6 -0
- package/dist/_virtual/_commonjsHelpers.js +28 -0
- package/dist/_virtual/index.js +4 -0
- package/dist/_virtual/lodash.js +4 -0
- package/dist/_virtual/pdf.js +4 -0
- package/dist/_virtual/react.production.js +4 -0
- package/dist/assets/generated/locales/de.js +73 -0
- package/dist/assets/generated/locales/en.js +73 -0
- package/dist/assets/generated/locales/fr.js +73 -0
- package/dist/assets/generated/locales/hr.js +73 -0
- package/dist/assets/generated/locales/it.js +73 -0
- package/dist/assets/generated/locales/pl.js +73 -0
- package/dist/assets/generated/locales/ro.js +73 -0
- package/dist/assets/generated/locales/sk.js +73 -0
- package/dist/assets/generated/locales/sr.js +73 -0
- package/dist/components/lit-attachments-tab.js +519 -0
- package/dist/components/lit-badge.js +100 -0
- package/dist/components/lit-case-variables-tab.js +727 -0
- package/dist/components/lit-chart.js +395 -0
- package/dist/components/lit-data-grid-tanstack.js +1733 -0
- package/dist/components/lit-filter-modal.js +312 -0
- package/dist/components/lit-multiselect-item.js +530 -0
- package/dist/components/lit-section-tab.js +133 -0
- package/dist/components/lit-tabs-overview.js +304 -0
- package/dist/components/react-wrappers/attachments-tab.js +14 -0
- package/dist/components/react-wrappers/badge.js +14 -0
- package/dist/components/react-wrappers/button.js +14 -0
- package/dist/components/react-wrappers/case-variables-tab.js +14 -0
- package/dist/components/react-wrappers/chart.js +14 -0
- package/dist/components/react-wrappers/data-grid-tanstack.js +14 -0
- package/dist/components/react-wrappers/filter-modal.js +14 -0
- package/dist/components/react-wrappers/progress-bar.js +14 -0
- package/dist/components/react-wrappers/section-tab.js +14 -0
- package/dist/components/react-wrappers/tabs-overview.js +14 -0
- package/dist/index.js +42 -0
- package/dist/libs/xlsx.mini.min.js +10 -0
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +432 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +306 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +127 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +127 -0
- package/dist/node_modules/@kurkle/color/dist/color.esm.js +448 -0
- package/dist/node_modules/@lit/localize/init/install.js +11 -0
- package/dist/node_modules/@lit/localize/init/runtime.js +42 -0
- package/dist/node_modules/@lit/localize/internal/default-msg.js +10 -0
- package/dist/node_modules/@lit/localize/internal/deferred.js +21 -0
- package/dist/node_modules/@lit/localize/internal/fnv1a64.js +17 -0
- package/dist/node_modules/@lit/localize/internal/id-generation.js +14 -0
- package/dist/node_modules/@lit/localize/internal/locale-status-event.js +9 -0
- package/dist/node_modules/@lit/localize/internal/runtime-msg.js +42 -0
- package/dist/node_modules/@lit/localize/internal/str-tag.js +15 -0
- package/dist/node_modules/@lit/react/create-component.js +35 -0
- package/dist/node_modules/@lit/reactive-element/css-tag.js +50 -0
- package/dist/node_modules/@lit/reactive-element/decorators/base.js +9 -0
- package/dist/node_modules/@lit/reactive-element/decorators/custom-element.js +13 -0
- package/dist/node_modules/@lit/reactive-element/decorators/property.js +37 -0
- package/dist/node_modules/@lit/reactive-element/decorators/query.js +20 -0
- package/dist/node_modules/@lit/reactive-element/decorators/state.js +12 -0
- package/dist/node_modules/@lit/reactive-element/reactive-element.js +250 -0
- package/dist/node_modules/@tanstack/lit-table/build/lib/index.js +104 -0
- package/dist/node_modules/@tanstack/lit-virtual/dist/esm/index.js +40 -0
- package/dist/node_modules/@tanstack/table-core/build/lib/index.js +1956 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +490 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +52 -0
- package/dist/node_modules/chart.js/dist/chart.js +7122 -0
- package/dist/node_modules/chart.js/dist/chunks/helpers.segment.js +1691 -0
- package/dist/node_modules/file-saver/dist/FileSaver.min.js +74 -0
- package/dist/node_modules/lit-element/lit-element.js +51 -0
- package/dist/node_modules/lit-html/async-directive.js +69 -0
- package/dist/node_modules/lit-html/directive-helpers.js +45 -0
- package/dist/node_modules/lit-html/directive.js +27 -0
- package/dist/node_modules/lit-html/directives/ref.js +42 -0
- package/dist/node_modules/lit-html/directives/repeat.js +61 -0
- package/dist/node_modules/lit-html/directives/style-map.js +36 -0
- package/dist/node_modules/lit-html/directives/unsafe-html.js +27 -0
- package/dist/node_modules/lit-html/lit-html.js +243 -0
- package/dist/node_modules/lodash/lodash.js +3678 -0
- package/dist/node_modules/luxon/src/datetime.js +1793 -0
- package/dist/node_modules/luxon/src/duration.js +723 -0
- package/dist/node_modules/luxon/src/errors.js +40 -0
- package/dist/node_modules/luxon/src/impl/conversions.js +92 -0
- package/dist/node_modules/luxon/src/impl/diff.js +36 -0
- package/dist/node_modules/luxon/src/impl/digits.js +74 -0
- package/dist/node_modules/luxon/src/impl/english.js +138 -0
- package/dist/node_modules/luxon/src/impl/formats.js +150 -0
- package/dist/node_modules/luxon/src/impl/formatter.js +245 -0
- package/dist/node_modules/luxon/src/impl/invalid.js +11 -0
- package/dist/node_modules/luxon/src/impl/locale.js +282 -0
- package/dist/node_modules/luxon/src/impl/regexParser.js +202 -0
- package/dist/node_modules/luxon/src/impl/tokenParser.js +329 -0
- package/dist/node_modules/luxon/src/impl/util.js +206 -0
- package/dist/node_modules/luxon/src/impl/zoneUtil.js +19 -0
- package/dist/node_modules/luxon/src/info.js +180 -0
- package/dist/node_modules/luxon/src/interval.js +466 -0
- package/dist/node_modules/luxon/src/settings.js +150 -0
- package/dist/node_modules/luxon/src/zone.js +88 -0
- package/dist/node_modules/luxon/src/zones/IANAZone.js +178 -0
- package/dist/node_modules/luxon/src/zones/fixedOffsetZone.js +125 -0
- package/dist/node_modules/luxon/src/zones/invalidZone.js +41 -0
- package/dist/node_modules/luxon/src/zones/systemZone.js +47 -0
- package/dist/node_modules/pdfjs-dist/build/pdf.js +10310 -0
- package/dist/node_modules/react/cjs/react.production.js +417 -0
- package/dist/node_modules/react/index.js +10 -0
- package/dist/node_modules/sortablejs/modular/sortable.esm.js +1261 -0
- package/dist/shared/lit-button.js +142 -0
- package/dist/shared/lit-progress-bar.js +83 -0
- package/dist/shared/simple-tooltip.js +174 -0
- package/dist/shared/styles/button-shared-styles.js +205 -0
- package/dist/utils/currency.js +13 -0
- package/dist/utils/custom-filters.js +50 -0
- package/dist/utils/date.js +15 -0
- package/dist/utils/getOperatorByType.js +52 -0
- package/dist/utils/localization.js +30 -0
- package/dist/vite.svg +1 -0
- package/package.json +76 -74
|
@@ -0,0 +1,727 @@
|
|
|
1
|
+
import "../node_modules/@lit/reactive-element/reactive-element.js";
|
|
2
|
+
import { html as o } from "../node_modules/lit-html/lit-html.js";
|
|
3
|
+
import { LitElement as x } from "../node_modules/lit-element/lit-element.js";
|
|
4
|
+
import { unsafeHTML as f } from "../node_modules/lit-html/directives/unsafe-html.js";
|
|
5
|
+
import { styleMap as u } from "../node_modules/lit-html/directives/style-map.js";
|
|
6
|
+
import { customElement as $ } from "../node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
7
|
+
import { property as g } from "../node_modules/@lit/reactive-element/decorators/property.js";
|
|
8
|
+
import { state as b } from "../node_modules/@lit/reactive-element/decorators/state.js";
|
|
9
|
+
import w from "../node_modules/sortablejs/modular/sortable.esm.js";
|
|
10
|
+
import { repeat as C } from "../node_modules/lit-html/directives/repeat.js";
|
|
11
|
+
import { tooltip as S } from "../shared/simple-tooltip.js";
|
|
12
|
+
import { formatDate as k } from "../utils/date.js";
|
|
13
|
+
import { formatCurrency as L } from "../utils/currency.js";
|
|
14
|
+
import { setLocale as z } from "../utils/localization.js";
|
|
15
|
+
import { msg as v } from "../node_modules/@lit/localize/init/install.js";
|
|
16
|
+
import "../node_modules/@lit/localize/init/runtime.js";
|
|
17
|
+
import { l as _ } from "../node_modules/lodash/lodash.js";
|
|
18
|
+
import { css as I } from "../node_modules/@lit/reactive-element/css-tag.js";
|
|
19
|
+
var B = Object.defineProperty, O = Object.getOwnPropertyDescriptor, d = (t, r, e, i) => {
|
|
20
|
+
for (var s = i > 1 ? void 0 : i ? O(r, e) : r, a = t.length - 1, p; a >= 0; a--)
|
|
21
|
+
(p = t[a]) && (s = (i ? p(r, e, s) : p(s)) || s);
|
|
22
|
+
return i && s && B(r, e, s), s;
|
|
23
|
+
};
|
|
24
|
+
let n = class extends x {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments), this.rows = [], this.data = {}, this.hideTabWhen = !1, this.userLang = "cs", this.dateFormat = null, this.isLoading = !1, this.enableSettings = !1, this.gridVariables = !1, this.onSettingsChanged = (t) => {
|
|
27
|
+
}, this.currentBreakpoint = this.getBreakpoint(), this.isOpen = !1, this.filterText = "", this.isMobile = window.innerWidth <= 600, this._resizeListener = this.handleResize.bind(this), this.sortableInstances = [], this.sortableGroupId = `group-${Math.random().toString(36).substring(2, 9)}`, this.backgroundColorOptions = [
|
|
28
|
+
{
|
|
29
|
+
backgroundColor: "transparent",
|
|
30
|
+
border: "1px solid white"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
backgroundColor: "var(--color-success-light)",
|
|
34
|
+
border: "1px solid var(--color-success-dark)"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
backgroundColor: "var(--color-error-light)",
|
|
38
|
+
border: "1px solid var(--color-error-dark)"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
backgroundColor: "var(--color-warning-light)",
|
|
42
|
+
border: "1px solid var(--color-warning-dark)"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
backgroundColor: "var(--color-info-light)",
|
|
46
|
+
border: "1px solid var(--color-info-dark)"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
backgroundColor: "var(--color-primary-light)",
|
|
50
|
+
border: "1px solid var(--color-primary-dark)"
|
|
51
|
+
}
|
|
52
|
+
], this.language = "cs", this.BREAKPOINTS = ["xs", "sm", "md", "lg", "xl"], this.handleSettingsChanged = (t) => {
|
|
53
|
+
var r;
|
|
54
|
+
(r = this.onSettingsChanged) == null || r.call(this, t);
|
|
55
|
+
}, this.getHeaderActions = (t) => {
|
|
56
|
+
var e, i;
|
|
57
|
+
const r = ((e = t.size) == null ? void 0 : e.lg) ?? 1;
|
|
58
|
+
return o`<div class="header-buttons">
|
|
59
|
+
${this.enableSettings ? o`
|
|
60
|
+
<perf-tooltip placement="top">
|
|
61
|
+
<lit-icon slot="trigger" icon="cog" size="1rem"></lit-icon>
|
|
62
|
+
<div slot="tooltip">
|
|
63
|
+
<div class="settings-buttons" style="justify-content: space-between">
|
|
64
|
+
${this.gridVariables ? o`<div></div>` : o`
|
|
65
|
+
<div>
|
|
66
|
+
${[1, 2, 3, 4].map(
|
|
67
|
+
(s) => o`
|
|
68
|
+
<span
|
|
69
|
+
@click=${() => this.setCellSize(
|
|
70
|
+
s,
|
|
71
|
+
t
|
|
72
|
+
)}
|
|
73
|
+
class="size-button ${r === s ? "size-button--active" : ""}"
|
|
74
|
+
>
|
|
75
|
+
${s}
|
|
76
|
+
</span>
|
|
77
|
+
`
|
|
78
|
+
)}
|
|
79
|
+
</div>
|
|
80
|
+
`}
|
|
81
|
+
|
|
82
|
+
<lit-icon
|
|
83
|
+
icon="trash"
|
|
84
|
+
size="1rem"
|
|
85
|
+
style="cursor: pointer"
|
|
86
|
+
@click=${() => this.removeCellFromRows(t.field)}
|
|
87
|
+
></lit-icon>
|
|
88
|
+
</div>
|
|
89
|
+
<div class="color-label">${v("Barva pozadí")}:</div>
|
|
90
|
+
<div class="settings-buttons">
|
|
91
|
+
${this.backgroundColorOptions.map(
|
|
92
|
+
(s) => o`
|
|
93
|
+
<div>
|
|
94
|
+
<div
|
|
95
|
+
@click=${() => this.setCellStyle(
|
|
96
|
+
{
|
|
97
|
+
backgroundColor: s.backgroundColor,
|
|
98
|
+
borderRadius: "8px",
|
|
99
|
+
border: s.border
|
|
100
|
+
},
|
|
101
|
+
t
|
|
102
|
+
)}
|
|
103
|
+
class="cell-background"
|
|
104
|
+
style="background-color: ${s.backgroundColor}; border: ${s.border}"
|
|
105
|
+
></div>
|
|
106
|
+
<div
|
|
107
|
+
class="${this.isActiveBackground(
|
|
108
|
+
t,
|
|
109
|
+
s.backgroundColor
|
|
110
|
+
) ? "cell-background--active" : ""}"
|
|
111
|
+
></div>
|
|
112
|
+
</div>
|
|
113
|
+
`
|
|
114
|
+
)}
|
|
115
|
+
</div>
|
|
116
|
+
<div class="color-label">${v("Tučné písmo")}:</div>
|
|
117
|
+
<div class="settings-buttons">
|
|
118
|
+
<span
|
|
119
|
+
class="bold-toggle ${((i = t == null ? void 0 : t.valueStyle) == null ? void 0 : i.fontWeight) === "bold" ? "bold-toggle--active" : ""}"
|
|
120
|
+
@click=${() => this.setFontWeight(t)}
|
|
121
|
+
>
|
|
122
|
+
B
|
|
123
|
+
</span>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
</perf-tooltip>
|
|
127
|
+
|
|
128
|
+
<div class="drag-handle">
|
|
129
|
+
<lit-icon icon="hamburger" size="1rem"></lit-icon>
|
|
130
|
+
</div>
|
|
131
|
+
` : null}
|
|
132
|
+
</div>`;
|
|
133
|
+
}, this.getHeaderLabel = (t) => o` <div
|
|
134
|
+
style="${t != null && t.headerStyle ? u(t == null ? void 0 : t.headerStyle) : ""}"
|
|
135
|
+
class="process-data-heading"
|
|
136
|
+
>
|
|
137
|
+
${(t == null ? void 0 : t[`headerName_${this.userLang}`]) || (t == null ? void 0 : t.headerName) || ""}
|
|
138
|
+
${t.tooltip ? o`
|
|
139
|
+
<lit-icon
|
|
140
|
+
${S(
|
|
141
|
+
(t == null ? void 0 : t[`tooltip_${this.userLang}`]) ?? (t == null ? void 0 : t.tooltip),
|
|
142
|
+
"right",
|
|
143
|
+
100
|
|
144
|
+
)}
|
|
145
|
+
size="12px"
|
|
146
|
+
icon="informative"
|
|
147
|
+
></lit-icon>
|
|
148
|
+
` : ""}
|
|
149
|
+
</div>`, this.getHeader = (t) => o` <div class="header-cell">
|
|
150
|
+
${this.getHeaderLabel(t)} ${this.getHeaderActions(t)}
|
|
151
|
+
</div>`, this.getCellButton = (t) => o`
|
|
152
|
+
<div style="display: flex; justify-content: space-between">
|
|
153
|
+
<lit-button
|
|
154
|
+
style="flex-grow: 1; margin-right: 0.5rem"
|
|
155
|
+
.fullWidth="${t.buttonFullWidth}"
|
|
156
|
+
variant="${t.buttonVariant || "contained"}"
|
|
157
|
+
label="${t == null ? void 0 : t.headerName}"
|
|
158
|
+
@click=${t == null ? void 0 : t.buttonFn}
|
|
159
|
+
></lit-button>
|
|
160
|
+
${this.getHeaderActions(t)}
|
|
161
|
+
</div>
|
|
162
|
+
`, this.getCellLink = (t) => o`<div>${this.getHeader(t)}</div>
|
|
163
|
+
<a class="link" href=${t != null && t.value ? t.value : ""} target="_blank"
|
|
164
|
+
>${t != null && t.value ? t.value : ""}
|
|
165
|
+
</a> `, this.getCellValue = (t) => {
|
|
166
|
+
const r = (t == null ? void 0 : t[`value_${this.userLang}`]) || (t == null ? void 0 : t.value) || "", e = typeof r == "string" ? r : String(r ?? "");
|
|
167
|
+
return o`<div>${this.getHeader(t)}</div>
|
|
168
|
+
<div
|
|
169
|
+
style="${t != null && t.valueStyle ? u(t == null ? void 0 : t.valueStyle) : ""}"
|
|
170
|
+
class="process-data-value"
|
|
171
|
+
>
|
|
172
|
+
${f(e)}
|
|
173
|
+
</div> `;
|
|
174
|
+
}, this.getCellDate = (t) => o`<div>${this.getHeader(t)}</div>
|
|
175
|
+
<div
|
|
176
|
+
style="${t != null && t.valueStyle ? u(t == null ? void 0 : t.valueStyle) : ""}"
|
|
177
|
+
class="process-data-value"
|
|
178
|
+
>
|
|
179
|
+
${t != null && t.value ? k(
|
|
180
|
+
t.value,
|
|
181
|
+
this.userLang || "cs",
|
|
182
|
+
!!this.dateFormat,
|
|
183
|
+
this.dateFormat
|
|
184
|
+
) : ""}
|
|
185
|
+
</div> `, this.getCellCurrency = (t) => o`<div>${this.getHeader(t)}</div>
|
|
186
|
+
<div
|
|
187
|
+
style="${t != null && t.valueStyle ? u(t == null ? void 0 : t.valueStyle) : ""}"
|
|
188
|
+
class="process-data-value"
|
|
189
|
+
>
|
|
190
|
+
${t != null && t.value ? L(t.value, this.userLang || "cs") : ""}
|
|
191
|
+
</div> `, this.getCellProgress = (t) => o`<div>${this.getHeader(t)}</div>
|
|
192
|
+
<div
|
|
193
|
+
style="${t != null && t.valueStyle ? u(t == null ? void 0 : t.valueStyle) : ""}"
|
|
194
|
+
class="process-data-value"
|
|
195
|
+
>
|
|
196
|
+
<lit-progress-bar .progress="${t == null ? void 0 : t.value}"></lit-progress-bar>
|
|
197
|
+
</div> `, this.getInlineCellValue = (t) => {
|
|
198
|
+
const r = (t == null ? void 0 : t[`value_${this.userLang}`]) || (t == null ? void 0 : t.value) || "", e = typeof r == "string" ? r : String(r ?? "");
|
|
199
|
+
return o`
|
|
200
|
+
<div style="display: flex;align-items: center; justify-content: end; gap: 0.5rem">
|
|
201
|
+
<div>${this.getHeaderLabel(t)}</div>
|
|
202
|
+
<div
|
|
203
|
+
style="${t != null && t.valueStyle ? u(t == null ? void 0 : t.valueStyle) : ""}"
|
|
204
|
+
class="process-data-value"
|
|
205
|
+
>
|
|
206
|
+
${f(e)}
|
|
207
|
+
</div>
|
|
208
|
+
<div>${this.getHeaderActions(t)}</div>
|
|
209
|
+
</div>
|
|
210
|
+
`;
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
getBreakpoint() {
|
|
214
|
+
const t = window.innerWidth;
|
|
215
|
+
return t >= 1920 ? "xl" : t >= 1280 ? "lg" : t >= 960 ? "md" : t >= 600 ? "sm" : "xs";
|
|
216
|
+
}
|
|
217
|
+
// Function to handle resize events
|
|
218
|
+
handleResize() {
|
|
219
|
+
const t = this.getBreakpoint();
|
|
220
|
+
t !== this.currentBreakpoint && (this.currentBreakpoint = t), this.isMobile = window.innerWidth <= 600;
|
|
221
|
+
}
|
|
222
|
+
connectedCallback() {
|
|
223
|
+
var t, r;
|
|
224
|
+
if (super.connectedCallback(), this.setLanguage(), window.addEventListener("resize", this._resizeListener), this.isMobile = window.innerWidth <= 600, !this.dateFormat) {
|
|
225
|
+
const e = localStorage.getItem("userSettings"), i = e ? (r = (t = JSON.parse(e)) == null ? void 0 : t.state) == null ? void 0 : r.dateFormat : void 0;
|
|
226
|
+
this.dateFormat = i;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
disconnectedCallback() {
|
|
230
|
+
this.destroySortables(), window.removeEventListener("resize", this._resizeListener), super.disconnectedCallback();
|
|
231
|
+
}
|
|
232
|
+
firstUpdated() {
|
|
233
|
+
this.enableSettings && this.initSortable();
|
|
234
|
+
}
|
|
235
|
+
setFontWeight(t) {
|
|
236
|
+
var e;
|
|
237
|
+
const r = ((e = t.valueStyle) == null ? void 0 : e.fontWeight) === "bold";
|
|
238
|
+
t.valueStyle = {
|
|
239
|
+
...t.valueStyle || {},
|
|
240
|
+
fontWeight: r ? "500" : "bold"
|
|
241
|
+
}, this.rows = [...this.rows], this.handleSettingsChanged(this.rows);
|
|
242
|
+
}
|
|
243
|
+
setCellStyle(t, r) {
|
|
244
|
+
r.cellStyle = t, this.rows = [...this.rows], this.handleSettingsChanged(this.rows);
|
|
245
|
+
}
|
|
246
|
+
destroySortables() {
|
|
247
|
+
this.sortableInstances.forEach((t) => {
|
|
248
|
+
t.destroy();
|
|
249
|
+
}), this.sortableInstances = [];
|
|
250
|
+
}
|
|
251
|
+
initSortable() {
|
|
252
|
+
this.updateComplete.then(() => {
|
|
253
|
+
var r;
|
|
254
|
+
const t = (r = this.shadowRoot) == null ? void 0 : r.querySelectorAll(".grid-container");
|
|
255
|
+
t != null && t.length && t.forEach((e) => {
|
|
256
|
+
let i = [];
|
|
257
|
+
const s = w.create(e, {
|
|
258
|
+
group: this.tabId || this.sortableGroupId,
|
|
259
|
+
animation: 150,
|
|
260
|
+
handle: ".drag-handle",
|
|
261
|
+
ghostClass: "sortable-ghost",
|
|
262
|
+
chosenClass: "sortable-chosen",
|
|
263
|
+
dragClass: "sortable-drag",
|
|
264
|
+
sort: !0,
|
|
265
|
+
onStart: (a) => {
|
|
266
|
+
i = Array.from(a.from.childNodes);
|
|
267
|
+
},
|
|
268
|
+
onEnd: (a) => {
|
|
269
|
+
var c;
|
|
270
|
+
a.from.innerHTML = "", i.forEach((y) => a.from.appendChild(y));
|
|
271
|
+
const { oldIndex: p, newIndex: h } = a;
|
|
272
|
+
if (p == null || h == null || p === h) return;
|
|
273
|
+
const m = [...this.rows], [l] = m.splice(p, 1);
|
|
274
|
+
m.splice(h, 0, l), this.rows = m, (c = this.handleSettingsChanged) == null || c.call(this, m);
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
this.sortableInstances.push(s);
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
setLanguage() {
|
|
282
|
+
const t = this.userLang || localStorage.getItem("userLang");
|
|
283
|
+
t && z(t);
|
|
284
|
+
}
|
|
285
|
+
isActiveBackground(t, r) {
|
|
286
|
+
var i;
|
|
287
|
+
const e = (i = t == null ? void 0 : t.cellStyle) == null ? void 0 : i.backgroundColor;
|
|
288
|
+
return !e && r === "transparent" ? !0 : e === r;
|
|
289
|
+
}
|
|
290
|
+
setCellSize(t, r) {
|
|
291
|
+
r.size || (r.size = {}), r.size.lg = t, this.rows = [...this.rows], this.handleSettingsChanged(this.rows);
|
|
292
|
+
}
|
|
293
|
+
removeCellFromRows(t) {
|
|
294
|
+
this.destroySortables();
|
|
295
|
+
const r = this.rows.filter((e) => e.field !== t);
|
|
296
|
+
this.rows = [], this.updateComplete.then(() => {
|
|
297
|
+
this.rows = [...r], this.initSortable(), this.handleSettingsChanged(this.rows);
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
closePopover() {
|
|
301
|
+
this.isOpen = !1;
|
|
302
|
+
}
|
|
303
|
+
toggleCustomPopover() {
|
|
304
|
+
this.isOpen = !this.isOpen;
|
|
305
|
+
}
|
|
306
|
+
get existingFields() {
|
|
307
|
+
return this.rows.flat().map((t) => t.field);
|
|
308
|
+
}
|
|
309
|
+
toggleRowCell(t) {
|
|
310
|
+
var e;
|
|
311
|
+
if (this.rows.some((i) => i.field === t))
|
|
312
|
+
this.removeCellFromRows(t);
|
|
313
|
+
else {
|
|
314
|
+
const i = (e = this.data) == null ? void 0 : e[t];
|
|
315
|
+
if (!i) return;
|
|
316
|
+
const s = this.userLang || "cs", a = i[`tvar_name_${s}`] || i.tvar_name_cs || i.tvar_name, p = i[`tvar_tooltip_${s}`] || i.tvar_tooltip_cs || i.tvar_tooltip;
|
|
317
|
+
let h;
|
|
318
|
+
switch (i.ivar_type) {
|
|
319
|
+
case "D":
|
|
320
|
+
h = "date";
|
|
321
|
+
break;
|
|
322
|
+
case "progress":
|
|
323
|
+
h = "progress";
|
|
324
|
+
break;
|
|
325
|
+
default:
|
|
326
|
+
h = "string";
|
|
327
|
+
}
|
|
328
|
+
const m = {
|
|
329
|
+
field: t,
|
|
330
|
+
type: h,
|
|
331
|
+
headerName: a,
|
|
332
|
+
value: i.ivar_value,
|
|
333
|
+
size: { xs: 4, sm: 2, md: 1, lg: 1, xl: 1 },
|
|
334
|
+
tooltip: p
|
|
335
|
+
}, l = [...this.rows];
|
|
336
|
+
l.push(m), this.rows = l, this.handleSettingsChanged(l);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
render() {
|
|
340
|
+
if (this.hideTabWhen) return null;
|
|
341
|
+
const t = this.userLang || "cs", r = Object.keys(this.data || {}).filter((e) => {
|
|
342
|
+
const i = this.data[e], s = (i == null ? void 0 : i[`tvar_name_${t}`]) || e;
|
|
343
|
+
return e.toLowerCase().includes(this.filterText) || s.toLowerCase().includes(this.filterText);
|
|
344
|
+
});
|
|
345
|
+
return o`
|
|
346
|
+
${this.isLoading ? o`<lit-loader></lit-loader>` : o`
|
|
347
|
+
<div class="grid-container ${this.gridVariables ? "one-column" : ""}">
|
|
348
|
+
${C(
|
|
349
|
+
this.rows,
|
|
350
|
+
(e, i) => e.field,
|
|
351
|
+
(e) => {
|
|
352
|
+
const i = this.BREAKPOINTS.indexOf(this.currentBreakpoint), a = `cell--span${this.BREAKPOINTS.slice(0, i + 1).reverse().map((p) => {
|
|
353
|
+
var h;
|
|
354
|
+
return (h = e.size) == null ? void 0 : h[p];
|
|
355
|
+
}).find((p) => p !== void 0) ?? 2} cell ${this.gridVariables ? "one-column" : ""}`;
|
|
356
|
+
return o`
|
|
357
|
+
<div
|
|
358
|
+
class="${a}"
|
|
359
|
+
style="${u(
|
|
360
|
+
e.cellStyle || {}
|
|
361
|
+
)}"
|
|
362
|
+
data-field="${e.field}"
|
|
363
|
+
>
|
|
364
|
+
${this.gridVariables ? this.getInlineCellValue(e) : (e == null ? void 0 : e.type) === "button" ? this.getCellButton(e) : e.type === "link" ? this.getCellLink(e) : e.type === "progress" ? this.getCellProgress(e) : e.type === "currency" ? this.getCellCurrency(e) : e.type === "date" ? this.getCellDate(e) : this.getCellValue(e)}
|
|
365
|
+
</div>
|
|
366
|
+
`;
|
|
367
|
+
}
|
|
368
|
+
)}
|
|
369
|
+
</div>
|
|
370
|
+
${this.enableSettings ? o`
|
|
371
|
+
<div style="text-align: right; margin-top: 1rem;">
|
|
372
|
+
<lit-button
|
|
373
|
+
variant="${"dashed"}"
|
|
374
|
+
label="${v("Přiřadit proměnnou")}"
|
|
375
|
+
icon="add"
|
|
376
|
+
.fullWidth=${this.isMobile}
|
|
377
|
+
@click="${this.toggleCustomPopover}"
|
|
378
|
+
class="add-variable-button"
|
|
379
|
+
></lit-button>
|
|
380
|
+
|
|
381
|
+
<simple-popper
|
|
382
|
+
.showing=${this.isOpen}
|
|
383
|
+
.placement=${"top-end"}
|
|
384
|
+
.manualOpening=${!0}
|
|
385
|
+
.maxWidthAsTarget=${!1}
|
|
386
|
+
.onClose=${() => this.closePopover()}
|
|
387
|
+
>
|
|
388
|
+
<div
|
|
389
|
+
class="popper-input"
|
|
390
|
+
style="position: sticky; top: 0; z-index: 1;"
|
|
391
|
+
>
|
|
392
|
+
<lit-input
|
|
393
|
+
.value=${this.filterText}
|
|
394
|
+
.onInput=${(e) => {
|
|
395
|
+
var i;
|
|
396
|
+
this.filterText = ((i = e == null ? void 0 : e.toLowerCase) == null ? void 0 : i.call(e)) || "";
|
|
397
|
+
}}
|
|
398
|
+
.onClear=${() => {
|
|
399
|
+
this.filterText = "";
|
|
400
|
+
}}
|
|
401
|
+
placeholder="${v("Zadejte název proměnné")}"
|
|
402
|
+
.size=${"small"}
|
|
403
|
+
></lit-input>
|
|
404
|
+
</div>
|
|
405
|
+
<lit-menu tabindex="0">
|
|
406
|
+
${Object.keys(this.data || {}).filter((e) => {
|
|
407
|
+
const i = this.data[e], s = this.userLang || "cs", a = (i == null ? void 0 : i[`tvar_name_${s}`]) || e;
|
|
408
|
+
return e.toLowerCase().includes(this.filterText) || a.toLowerCase().includes(this.filterText);
|
|
409
|
+
}).sort((e, i) => {
|
|
410
|
+
const s = e.startsWith("_"), a = i.startsWith("_");
|
|
411
|
+
return s && !a ? 1 : !s && a ? -1 : e.localeCompare(i);
|
|
412
|
+
}).map(
|
|
413
|
+
(e) => {
|
|
414
|
+
var i, s;
|
|
415
|
+
return o`
|
|
416
|
+
<lit-menu-item
|
|
417
|
+
.onClick=${() => this.toggleRowCell(e)}
|
|
418
|
+
.isActive=${this.existingFields.includes(
|
|
419
|
+
e
|
|
420
|
+
)}
|
|
421
|
+
>
|
|
422
|
+
<span class="menu-item--multiple">
|
|
423
|
+
<lit-checkbox
|
|
424
|
+
class="cursor"
|
|
425
|
+
.checked=${this.existingFields.includes(
|
|
426
|
+
e
|
|
427
|
+
)}
|
|
428
|
+
></lit-checkbox>
|
|
429
|
+
${((s = (i = this.data) == null ? void 0 : i[e]) == null ? void 0 : s[`tvar_name_${this.userLang}`]) || e}
|
|
430
|
+
</span>
|
|
431
|
+
</lit-menu-item>
|
|
432
|
+
`;
|
|
433
|
+
}
|
|
434
|
+
)}
|
|
435
|
+
</lit-menu>
|
|
436
|
+
|
|
437
|
+
${_.isEqual(r.length, 0) ? o`
|
|
438
|
+
<div
|
|
439
|
+
style="display: flex;flex-direction: column; align-items: center"
|
|
440
|
+
>
|
|
441
|
+
<div
|
|
442
|
+
style="max-height: 7.125rem; max-width: 7.125rem"
|
|
443
|
+
>
|
|
444
|
+
<not-found></not-found>
|
|
445
|
+
</div>
|
|
446
|
+
${v("Nenalezeno")}
|
|
447
|
+
</div>
|
|
448
|
+
` : null}
|
|
449
|
+
</simple-popper>
|
|
450
|
+
</div>
|
|
451
|
+
` : ""}
|
|
452
|
+
`}
|
|
453
|
+
`;
|
|
454
|
+
}
|
|
455
|
+
};
|
|
456
|
+
n.styles = [
|
|
457
|
+
// styles,
|
|
458
|
+
I`
|
|
459
|
+
:host {
|
|
460
|
+
font-family: 'Inter', sans-serif;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.header-cell {
|
|
464
|
+
min-height: 1.25rem;
|
|
465
|
+
display: flex;
|
|
466
|
+
justify-content: space-between;
|
|
467
|
+
align-items: center;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
.drag-handle {
|
|
471
|
+
cursor: grab;
|
|
472
|
+
opacity: 0.6;
|
|
473
|
+
transition: opacity 0.2s;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.drag-handle:hover {
|
|
477
|
+
opacity: 1;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.grid-container {
|
|
481
|
+
display: grid;
|
|
482
|
+
justify-content: start;
|
|
483
|
+
align-items: start;
|
|
484
|
+
gap: 0.5rem;
|
|
485
|
+
border: 1px dashed transparent;
|
|
486
|
+
border-radius: var(--border-radius-small, 8px);
|
|
487
|
+
transition: border-color 0.2s;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.grid-container.sortable-drag-over {
|
|
491
|
+
border-color: var(--color-primary-main, #76b703);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
.process-data-heading {
|
|
495
|
+
font-size: 0.75rem;
|
|
496
|
+
color: var(--text-secondary, #5d6371);
|
|
497
|
+
font-weight: 400 !important;
|
|
498
|
+
display: flex;
|
|
499
|
+
gap: 5px;
|
|
500
|
+
align-items: center;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
.process-data-value {
|
|
504
|
+
min-height: 1.25rem;
|
|
505
|
+
font-size: 0.8125rem;
|
|
506
|
+
color: var(--text-primary, #111827);
|
|
507
|
+
margin: 0;
|
|
508
|
+
padding-top: 0.3125rem;
|
|
509
|
+
font-weight: 500;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
.status {
|
|
513
|
+
color: var(--color-primary-main, #76b703);
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
.link {
|
|
517
|
+
font-size: 0.8125rem;
|
|
518
|
+
text-decoration: none;
|
|
519
|
+
color: var(--text-primary, #111827);
|
|
520
|
+
border-bottom: 0.0625rem solid var(--color-primary-main, #76b703);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
.cell {
|
|
524
|
+
padding: 0.375rem;
|
|
525
|
+
border-radius: var(--border-radius-small, 8px);
|
|
526
|
+
border: 1px solid transparent;
|
|
527
|
+
transition: all 0.2s;
|
|
528
|
+
min-height: 2.625rem;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
.cell.one-column {
|
|
532
|
+
min-height: 0 !important;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
.cell.sortable-ghost {
|
|
536
|
+
opacity: 0.5;
|
|
537
|
+
border-color: var(--color-primary-main, #76b703);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
.cell.sortable-chosen {
|
|
541
|
+
transform: scale(1.02);
|
|
542
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
.link:hover {
|
|
546
|
+
color: var(--color-primary-main, #76b703);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
.settings-buttons {
|
|
550
|
+
display: flex;
|
|
551
|
+
align-items: center;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
.header-buttons {
|
|
555
|
+
display: flex;
|
|
556
|
+
gap: 0.5rem;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
.size-button {
|
|
560
|
+
margin-right: 0.5rem;
|
|
561
|
+
cursor: pointer;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
.size-button--active {
|
|
565
|
+
text-decoration: underline;
|
|
566
|
+
font-weight: bold;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
.popper-input {
|
|
570
|
+
margin-bottom: 0.5rem;
|
|
571
|
+
background-color: var(--background-paper, #fff);
|
|
572
|
+
z-index: 1;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
.cell-background {
|
|
576
|
+
width: 14px;
|
|
577
|
+
height: 14px;
|
|
578
|
+
border-radius: 4px;
|
|
579
|
+
border: 1px solid #ccc;
|
|
580
|
+
cursor: pointer;
|
|
581
|
+
margin-right: 0.5rem;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
.bold-toggle {
|
|
585
|
+
cursor: pointer;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
.bold-toggle--active {
|
|
589
|
+
text-decoration: underline;
|
|
590
|
+
font-weight: bold;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
.color-label {
|
|
594
|
+
margin: 0.5rem 0 0.25rem 0;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
.cell-background--active {
|
|
598
|
+
border-bottom: 1px solid white;
|
|
599
|
+
margin-top: 1px;
|
|
600
|
+
margin-right: 0.5rem;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
.grid-container.one-column {
|
|
604
|
+
grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
|
|
605
|
+
justify-content: end;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
.grid-container.one-column .cell {
|
|
609
|
+
grid-column: 4 / 5;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
@media (max-width: 960px) {
|
|
613
|
+
.grid-container.one-column .cell {
|
|
614
|
+
grid-column: 3 / 5;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
@media (max-width: 600px) {
|
|
619
|
+
.grid-container.one-column .cell {
|
|
620
|
+
grid-column: 1 / -1;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
.add-variable-button {
|
|
625
|
+
display: inline-block;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
@media (max-width: 600px) {
|
|
629
|
+
.add-variable-button {
|
|
630
|
+
display: block;
|
|
631
|
+
width: 100%;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
.cell--span1 {
|
|
636
|
+
grid-column: span 1 / span 1;
|
|
637
|
+
}
|
|
638
|
+
.cell--span2 {
|
|
639
|
+
grid-column: span 2 / span 2;
|
|
640
|
+
}
|
|
641
|
+
.cell--span3 {
|
|
642
|
+
grid-column: span 3 / span 3;
|
|
643
|
+
}
|
|
644
|
+
.cell--span4 {
|
|
645
|
+
grid-column: span 4 / span 4;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
/* Responzívne nastavenie počtu stĺpcov */
|
|
649
|
+
@media (min-width: 0px) {
|
|
650
|
+
.grid-container {
|
|
651
|
+
grid-template-columns: repeat(4, minmax(0, 1fr)); /* xs */
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
@media (min-width: var(--breakpoint-sm, 600px)) {
|
|
656
|
+
.grid-container {
|
|
657
|
+
grid-template-columns: repeat(4, minmax(0, 1fr)); /* sm */
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
@media (min-width: var(--breakpoint-md, 960px)) {
|
|
662
|
+
.grid-container {
|
|
663
|
+
grid-template-columns: repeat(4, minmax(0, 1fr)); /* md */
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
@media (min-width: var(--breakpoint-lg, 1280px)) {
|
|
668
|
+
.grid-container {
|
|
669
|
+
grid-template-columns: repeat(4, minmax(0, 1fr)); /* lg */
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
@media (min-width: var(--breakpoint-xl, 1536px)) {
|
|
674
|
+
.grid-container {
|
|
675
|
+
grid-template-columns: repeat(auto-fill, minmax(0, 1fr));
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
`
|
|
679
|
+
];
|
|
680
|
+
d([
|
|
681
|
+
g({ type: Array })
|
|
682
|
+
], n.prototype, "rows", 2);
|
|
683
|
+
d([
|
|
684
|
+
g({ type: Object })
|
|
685
|
+
], n.prototype, "data", 2);
|
|
686
|
+
d([
|
|
687
|
+
g({ type: Boolean })
|
|
688
|
+
], n.prototype, "hideTabWhen", 2);
|
|
689
|
+
d([
|
|
690
|
+
g({ type: String })
|
|
691
|
+
], n.prototype, "userLang", 2);
|
|
692
|
+
d([
|
|
693
|
+
g({ type: String })
|
|
694
|
+
], n.prototype, "dateFormat", 2);
|
|
695
|
+
d([
|
|
696
|
+
g({ type: Boolean })
|
|
697
|
+
], n.prototype, "isLoading", 2);
|
|
698
|
+
d([
|
|
699
|
+
g({ type: Boolean })
|
|
700
|
+
], n.prototype, "enableSettings", 2);
|
|
701
|
+
d([
|
|
702
|
+
g({ type: String })
|
|
703
|
+
], n.prototype, "tabId", 2);
|
|
704
|
+
d([
|
|
705
|
+
g({ type: Boolean })
|
|
706
|
+
], n.prototype, "gridVariables", 2);
|
|
707
|
+
d([
|
|
708
|
+
g({ type: Function })
|
|
709
|
+
], n.prototype, "onSettingsChanged", 2);
|
|
710
|
+
d([
|
|
711
|
+
b()
|
|
712
|
+
], n.prototype, "currentBreakpoint", 2);
|
|
713
|
+
d([
|
|
714
|
+
b()
|
|
715
|
+
], n.prototype, "isOpen", 2);
|
|
716
|
+
d([
|
|
717
|
+
b()
|
|
718
|
+
], n.prototype, "filterText", 2);
|
|
719
|
+
d([
|
|
720
|
+
b()
|
|
721
|
+
], n.prototype, "isMobile", 2);
|
|
722
|
+
n = d([
|
|
723
|
+
$("lit-case-variables-tab")
|
|
724
|
+
], n);
|
|
725
|
+
export {
|
|
726
|
+
n as LitCaseVariablesTab
|
|
727
|
+
};
|