overview-components 1.0.83 → 1.0.89
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/generated/locales/de.js +72 -70
- package/dist/assets/generated/locales/en.js +72 -70
- package/dist/assets/generated/locales/fr.js +72 -70
- package/dist/assets/generated/locales/hr.js +72 -70
- package/dist/assets/generated/locales/it.js +72 -70
- package/dist/assets/generated/locales/pl.js +72 -70
- package/dist/assets/generated/locales/ro.js +72 -70
- package/dist/assets/generated/locales/sk.js +72 -70
- package/dist/assets/generated/locales/sr.js +72 -70
- package/dist/components/lit-attachments-tab.js +267 -432
- package/dist/components/lit-badge.js +37 -40
- package/dist/components/lit-case-variables-tab.js +378 -497
- package/dist/components/lit-chart.js +375 -406
- package/dist/components/lit-data-grid-tanstack.js +1145 -1663
- package/dist/components/lit-filter-modal.js +194 -230
- package/dist/components/lit-multiselect-item.js +297 -477
- package/dist/components/lit-section-tab.js +69 -85
- package/dist/components/lit-tabs-overview.js +187 -232
- package/dist/components/react-wrappers/attachments-tab.js +13 -8
- package/dist/components/react-wrappers/badge.js +13 -8
- package/dist/components/react-wrappers/button.js +13 -8
- package/dist/components/react-wrappers/case-variables-tab.js +13 -8
- package/dist/components/react-wrappers/chart.js +13 -8
- package/dist/components/react-wrappers/data-grid-tanstack.js +13 -8
- package/dist/components/react-wrappers/filter-modal.js +13 -8
- package/dist/components/react-wrappers/progress-bar.js +13 -8
- package/dist/components/react-wrappers/section-tab.js +13 -8
- package/dist/components/react-wrappers/tabs-overview.js +13 -8
- package/dist/index.d.ts +1 -64
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -4819
- package/dist/node_modules/@lit/reactive-element/css-tag.js +42 -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 +249 -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 +242 -0
- package/dist/shared/lit-button.js +63 -80
- 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-loader.d.ts +1 -1
- package/dist/shared/lit-loader.d.ts.map +1 -1
- 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-menu-item.d.ts +1 -1
- package/dist/shared/lit-menu-item.d.ts.map +1 -1
- package/dist/shared/lit-progress-bar.js +32 -33
- package/dist/shared/lit-text-field.d.ts +1 -1
- package/dist/shared/lit-text-field.d.ts.map +1 -1
- package/dist/shared/simple-tooltip.js +122 -198
- package/dist/shared/styles/button-shared-styles.js +5 -4
- package/dist/utils/currency.js +12 -15
- package/dist/utils/custom-filters.js +45 -80
- package/dist/utils/date.js +13 -21
- package/dist/utils/getOperatorByType.js +50 -65
- package/dist/utils/localization.js +29 -431
- package/package.json +74 -87
- package/dist/assets/generated/locales/de.js.map +0 -1
- package/dist/assets/generated/locales/en.js.map +0 -1
- package/dist/assets/generated/locales/fr.js.map +0 -1
- package/dist/assets/generated/locales/hr.js.map +0 -1
- package/dist/assets/generated/locales/it.js.map +0 -1
- package/dist/assets/generated/locales/pl.js.map +0 -1
- package/dist/assets/generated/locales/ro.js.map +0 -1
- package/dist/assets/generated/locales/sk.js.map +0 -1
- package/dist/assets/generated/locales/sr.js.map +0 -1
- package/dist/assets/icons/iconGlyphs.js +0 -679
- package/dist/assets/icons/iconGlyphs.js.map +0 -1
- package/dist/assets/illustration/delete-illustration.js +0 -96
- package/dist/assets/illustration/delete-illustration.js.map +0 -1
- package/dist/assets/illustration/no-content.js +0 -167
- package/dist/assets/illustration/no-content.js.map +0 -1
- package/dist/assets/illustration/no-preview.js +0 -133
- package/dist/assets/illustration/no-preview.js.map +0 -1
- package/dist/assets/illustration/not-found.js +0 -106
- package/dist/assets/illustration/not-found.js.map +0 -1
- package/dist/assets/illustration/settings-illustration.js +0 -176
- package/dist/assets/illustration/settings-illustration.js.map +0 -1
- package/dist/components/components-settings/attachments-tab-settings.js +0 -226
- package/dist/components/components-settings/attachments-tab-settings.js.map +0 -1
- package/dist/components/components-settings/data-grid-settings.js +0 -318
- package/dist/components/components-settings/data-grid-settings.js.map +0 -1
- package/dist/components/components-settings/section-tab-settings.js +0 -269
- package/dist/components/components-settings/section-tab-settings.js.map +0 -1
- package/dist/components/components-settings/tabs-overview-settings.js +0 -439
- package/dist/components/components-settings/tabs-overview-settings.js.map +0 -1
- package/dist/components/lit-attachments-tab.js.map +0 -1
- package/dist/components/lit-badge.js.map +0 -1
- package/dist/components/lit-case-variables-tab.js.map +0 -1
- package/dist/components/lit-chart.js.map +0 -1
- package/dist/components/lit-data-grid-tanstack.js.map +0 -1
- package/dist/components/lit-filter-modal.js.map +0 -1
- package/dist/components/lit-multiselect-item.js.map +0 -1
- package/dist/components/lit-section-tab.js.map +0 -1
- package/dist/components/lit-tabs-overview.js.map +0 -1
- package/dist/components/modals/lit-confirm-modal.js +0 -120
- package/dist/components/modals/lit-confirm-modal.js.map +0 -1
- package/dist/components/modals/lit-delete-modal.js +0 -128
- package/dist/components/modals/lit-delete-modal.js.map +0 -1
- package/dist/components/react-wrappers/attachments-tab.js.map +0 -1
- package/dist/components/react-wrappers/badge.js.map +0 -1
- package/dist/components/react-wrappers/button.js.map +0 -1
- package/dist/components/react-wrappers/case-variables-tab.js.map +0 -1
- package/dist/components/react-wrappers/chart.js.map +0 -1
- package/dist/components/react-wrappers/data-grid-tanstack.js.map +0 -1
- package/dist/components/react-wrappers/filter-modal.js.map +0 -1
- package/dist/components/react-wrappers/progress-bar.js.map +0 -1
- package/dist/components/react-wrappers/section-tab.js.map +0 -1
- package/dist/components/react-wrappers/tabs-overview.js.map +0 -1
- package/dist/data/translations.js +0 -2763
- package/dist/data/translations.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/schemas/index.js +0 -17
- package/dist/schemas/index.js.map +0 -1
- package/dist/schemas/lit-attachments-tab-document.schema.js +0 -20
- package/dist/schemas/lit-attachments-tab-document.schema.js.map +0 -1
- package/dist/schemas/lit-attachments-tab-settings-value.schema.js +0 -15
- package/dist/schemas/lit-attachments-tab-settings-value.schema.js.map +0 -1
- package/dist/schemas/lit-attachments-tab.schema.js +0 -32
- package/dist/schemas/lit-attachments-tab.schema.js.map +0 -1
- package/dist/schemas/lit-case-variables-tab-cell.schema.js +0 -43
- package/dist/schemas/lit-case-variables-tab-cell.schema.js.map +0 -1
- package/dist/schemas/lit-case-variables-tab-rows.schema.js +0 -6
- package/dist/schemas/lit-case-variables-tab-rows.schema.js.map +0 -1
- package/dist/schemas/lit-case-variables-tab.schema.js +0 -24
- package/dist/schemas/lit-case-variables-tab.schema.js.map +0 -1
- package/dist/schemas/lit-data-grid-tanstack-column-array.schema.js +0 -6
- package/dist/schemas/lit-data-grid-tanstack-column-array.schema.js.map +0 -1
- package/dist/schemas/lit-data-grid-tanstack-column-custom-filter-array.schema.js +0 -6
- package/dist/schemas/lit-data-grid-tanstack-column-custom-filter-array.schema.js.map +0 -1
- package/dist/schemas/lit-data-grid-tanstack-column-custom-filter.schema.js +0 -11
- package/dist/schemas/lit-data-grid-tanstack-column-custom-filter.schema.js.map +0 -1
- package/dist/schemas/lit-data-grid-tanstack-column.schema.js +0 -55
- package/dist/schemas/lit-data-grid-tanstack-column.schema.js.map +0 -1
- package/dist/schemas/lit-data-grid-tanstack.schema.js +0 -99
- package/dist/schemas/lit-data-grid-tanstack.schema.js.map +0 -1
- package/dist/schemas/lit-section-tab-schema.js +0 -24
- package/dist/schemas/lit-section-tab-schema.js.map +0 -1
- package/dist/schemas/lit-tabs-overview-tab-array.schema.js +0 -6
- package/dist/schemas/lit-tabs-overview-tab-array.schema.js.map +0 -1
- package/dist/schemas/lit-tabs-overview-tab.schema.js +0 -32
- package/dist/schemas/lit-tabs-overview-tab.schema.js.map +0 -1
- package/dist/schemas/lit-tabs-overview.schema.js +0 -29
- package/dist/schemas/lit-tabs-overview.schema.js.map +0 -1
- package/dist/scripts/translate-locales.js +0 -69
- package/dist/scripts/translate-locales.js.map +0 -1
- package/dist/shared/filter-inputs.js +0 -427
- package/dist/shared/filter-inputs.js.map +0 -1
- package/dist/shared/lit-button.js.map +0 -1
- package/dist/shared/lit-case-variables-tab-cell.js +0 -226
- package/dist/shared/lit-case-variables-tab-cell.js.map +0 -1
- package/dist/shared/lit-checkbox.js +0 -171
- package/dist/shared/lit-checkbox.js.map +0 -1
- package/dist/shared/lit-custom-popper.js +0 -117
- package/dist/shared/lit-custom-popper.js.map +0 -1
- package/dist/shared/lit-data-grid-action-buttons-popover.js +0 -295
- package/dist/shared/lit-data-grid-action-buttons-popover.js.map +0 -1
- package/dist/shared/lit-data-grid-density-popover.js +0 -84
- package/dist/shared/lit-data-grid-density-popover.js.map +0 -1
- package/dist/shared/lit-data-grid-export-popover.js +0 -68
- package/dist/shared/lit-data-grid-export-popover.js.map +0 -1
- package/dist/shared/lit-data-grid-operators-popover.js +0 -114
- package/dist/shared/lit-data-grid-operators-popover.js.map +0 -1
- package/dist/shared/lit-data-grid-row-actions.js +0 -76
- package/dist/shared/lit-data-grid-row-actions.js.map +0 -1
- package/dist/shared/lit-date-picker.js +0 -606
- package/dist/shared/lit-date-picker.js.map +0 -1
- package/dist/shared/lit-icon-button.js +0 -105
- package/dist/shared/lit-icon-button.js.map +0 -1
- package/dist/shared/lit-icon.js +0 -284
- package/dist/shared/lit-icon.js.map +0 -1
- package/dist/shared/lit-input.js +0 -239
- package/dist/shared/lit-input.js.map +0 -1
- package/dist/shared/lit-label.js +0 -104
- package/dist/shared/lit-label.js.map +0 -1
- package/dist/shared/lit-loader.js +0 -69
- package/dist/shared/lit-loader.js.map +0 -1
- package/dist/shared/lit-loading-bar.js +0 -127
- package/dist/shared/lit-loading-bar.js.map +0 -1
- package/dist/shared/lit-menu-item.js +0 -99
- package/dist/shared/lit-menu-item.js.map +0 -1
- package/dist/shared/lit-menu.js +0 -42
- package/dist/shared/lit-menu.js.map +0 -1
- package/dist/shared/lit-modal-body.js +0 -22
- package/dist/shared/lit-modal-body.js.map +0 -1
- package/dist/shared/lit-modal-footer.js +0 -29
- package/dist/shared/lit-modal-footer.js.map +0 -1
- package/dist/shared/lit-modal-header.js +0 -36
- package/dist/shared/lit-modal-header.js.map +0 -1
- package/dist/shared/lit-modal.js +0 -169
- package/dist/shared/lit-modal.js.map +0 -1
- package/dist/shared/lit-overflow-tooltip.js +0 -103
- package/dist/shared/lit-overflow-tooltip.js.map +0 -1
- package/dist/shared/lit-pill.js +0 -88
- package/dist/shared/lit-pill.js.map +0 -1
- package/dist/shared/lit-progress-bar.js.map +0 -1
- package/dist/shared/lit-responsive-button.js +0 -94
- package/dist/shared/lit-responsive-button.js.map +0 -1
- package/dist/shared/lit-select-field.js +0 -459
- package/dist/shared/lit-select-field.js.map +0 -1
- package/dist/shared/lit-select.js +0 -413
- package/dist/shared/lit-select.js.map +0 -1
- package/dist/shared/lit-settings.js +0 -77
- package/dist/shared/lit-settings.js.map +0 -1
- package/dist/shared/lit-text-field.js +0 -222
- package/dist/shared/lit-text-field.js.map +0 -1
- package/dist/shared/lit-toggle.js +0 -222
- package/dist/shared/lit-toggle.js.map +0 -1
- package/dist/shared/lit-tooltip.js +0 -166
- package/dist/shared/lit-tooltip.js.map +0 -1
- package/dist/shared/simple-popper.js +0 -266
- package/dist/shared/simple-popper.js.map +0 -1
- package/dist/shared/simple-tooltip.js.map +0 -1
- package/dist/shared/styles/button-shared-styles.js.map +0 -1
- package/dist/style.css +0 -1
- package/dist/styles.js +0 -169
- package/dist/styles.js.map +0 -1
- package/dist/utils/currency.js.map +0 -1
- package/dist/utils/custom-filters.js.map +0 -1
- package/dist/utils/date.js.map +0 -1
- package/dist/utils/getOperatorByType.js.map +0 -1
- package/dist/utils/getOverviewValue.js +0 -177
- package/dist/utils/getOverviewValue.js.map +0 -1
- package/dist/utils/localization.js.map +0 -1
- package/dist/utils/utils.js +0 -13
- package/dist/utils/utils.js.map +0 -1
- package/dist/utils/validate-json-schema.js +0 -8
- package/dist/utils/validate-json-schema.js.map +0 -1
- package/dist/validators/validator.js +0 -7
- package/dist/validators/validator.js.map +0 -1
|
@@ -1,106 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { LitElement as x, html as o, css as $ } from "lit";
|
|
2
|
+
import { unsafeHTML as f } from "../node_modules/lit-html/directives/unsafe-html.js";
|
|
3
|
+
import { styleMap as u } from "../node_modules/lit-html/directives/style-map.js";
|
|
4
|
+
import { customElement as w } from "../node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
5
|
+
import { property as g } from "../node_modules/@lit/reactive-element/decorators/property.js";
|
|
6
|
+
import { state as b } from "../node_modules/@lit/reactive-element/decorators/state.js";
|
|
7
|
+
import C from "sortablejs";
|
|
8
|
+
import { repeat as S } from "../node_modules/lit-html/directives/repeat.js";
|
|
9
|
+
import { tooltip as k } from "../shared/simple-tooltip.js";
|
|
10
|
+
import { formatDate as L } from "../utils/date.js";
|
|
11
|
+
import { formatCurrency as z } from "../utils/currency.js";
|
|
12
|
+
import { setLocale as _ } from "../utils/localization.js";
|
|
13
|
+
import { msg as v } from "@lit/localize";
|
|
14
|
+
import { isEqual as I } from "lodash";
|
|
15
|
+
var B = Object.defineProperty, O = Object.getOwnPropertyDescriptor, d = (t, r, e, i) => {
|
|
16
|
+
for (var s = i > 1 ? void 0 : i ? O(r, e) : r, a = t.length - 1, p; a >= 0; a--)
|
|
17
|
+
(p = t[a]) && (s = (i ? p(r, e, s) : p(s)) || s);
|
|
18
|
+
return i && s && B(r, e, s), s;
|
|
6
19
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
this.currentBreakpoint = this.getBreakpoint();
|
|
44
|
-
this.isOpen = false;
|
|
45
|
-
this.filterText = '';
|
|
46
|
-
this.isMobile = window.innerWidth <= 600;
|
|
47
|
-
this._resizeListener = this.handleResize.bind(this);
|
|
48
|
-
this.sortableInstances = [];
|
|
49
|
-
this.sortableGroupId = `group-${Math.random().toString(36).substring(2, 9)}`;
|
|
50
|
-
this.backgroundColorOptions = [
|
|
51
|
-
{
|
|
52
|
-
backgroundColor: 'transparent',
|
|
53
|
-
border: '1px solid white',
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
backgroundColor: 'var(--color-success-light)',
|
|
57
|
-
border: '1px solid var(--color-success-dark)',
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
backgroundColor: 'var(--color-error-light)',
|
|
61
|
-
border: '1px solid var(--color-error-dark)',
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
backgroundColor: 'var(--color-warning-light)',
|
|
65
|
-
border: '1px solid var(--color-warning-dark)',
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
backgroundColor: 'var(--color-info-light)',
|
|
69
|
-
border: '1px solid var(--color-info-dark)',
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
backgroundColor: 'var(--color-primary-light)',
|
|
73
|
-
border: '1px solid var(--color-primary-dark)',
|
|
74
|
-
},
|
|
75
|
-
];
|
|
76
|
-
this.language = 'cs';
|
|
77
|
-
this.BREAKPOINTS = ['xs', 'sm', 'md', 'lg', 'xl'];
|
|
78
|
-
this.handleSettingsChanged = (newRows) => {
|
|
79
|
-
this.onSettingsChanged?.(newRows);
|
|
80
|
-
};
|
|
81
|
-
this.getHeaderActions = (cell) => {
|
|
82
|
-
const activeSize = cell.size?.lg ?? 1;
|
|
83
|
-
return html `<div class="header-buttons">
|
|
84
|
-
${this.enableSettings
|
|
85
|
-
? html `
|
|
20
|
+
let n = class extends x {
|
|
21
|
+
constructor() {
|
|
22
|
+
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) => {
|
|
23
|
+
}, 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 = [
|
|
24
|
+
{
|
|
25
|
+
backgroundColor: "transparent",
|
|
26
|
+
border: "1px solid white"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
backgroundColor: "var(--color-success-light)",
|
|
30
|
+
border: "1px solid var(--color-success-dark)"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
backgroundColor: "var(--color-error-light)",
|
|
34
|
+
border: "1px solid var(--color-error-dark)"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
backgroundColor: "var(--color-warning-light)",
|
|
38
|
+
border: "1px solid var(--color-warning-dark)"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
backgroundColor: "var(--color-info-light)",
|
|
42
|
+
border: "1px solid var(--color-info-dark)"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
backgroundColor: "var(--color-primary-light)",
|
|
46
|
+
border: "1px solid var(--color-primary-dark)"
|
|
47
|
+
}
|
|
48
|
+
], this.language = "cs", this.BREAKPOINTS = ["xs", "sm", "md", "lg", "xl"], this.handleSettingsChanged = (t) => {
|
|
49
|
+
var r;
|
|
50
|
+
(r = this.onSettingsChanged) == null || r.call(this, t);
|
|
51
|
+
}, this.getHeaderActions = (t) => {
|
|
52
|
+
var e, i;
|
|
53
|
+
const r = ((e = t.size) == null ? void 0 : e.lg) ?? 1;
|
|
54
|
+
return o`<div class="header-buttons">
|
|
55
|
+
${this.enableSettings ? o`
|
|
86
56
|
<perf-tooltip placement="top">
|
|
87
57
|
<lit-icon slot="trigger" icon="cog" size="1rem"></lit-icon>
|
|
88
58
|
<div slot="tooltip">
|
|
89
59
|
<div class="settings-buttons" style="justify-content: space-between">
|
|
90
|
-
${this.gridVariables
|
|
91
|
-
? html `<div></div>`
|
|
92
|
-
: html `
|
|
60
|
+
${this.gridVariables ? o`<div></div>` : o`
|
|
93
61
|
<div>
|
|
94
|
-
${[1, 2, 3, 4].map(
|
|
62
|
+
${[1, 2, 3, 4].map(
|
|
63
|
+
(s) => o`
|
|
95
64
|
<span
|
|
96
|
-
@click=${() => this.setCellSize(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
65
|
+
@click=${() => this.setCellSize(
|
|
66
|
+
s,
|
|
67
|
+
t
|
|
68
|
+
)}
|
|
69
|
+
class="size-button ${r === s ? "size-button--active" : ""}"
|
|
100
70
|
>
|
|
101
|
-
${
|
|
71
|
+
${s}
|
|
102
72
|
</span>
|
|
103
|
-
`
|
|
73
|
+
`
|
|
74
|
+
)}
|
|
104
75
|
</div>
|
|
105
76
|
`}
|
|
106
77
|
|
|
@@ -108,37 +79,41 @@ let LitCaseVariablesTab = class LitCaseVariablesTab extends LitElement {
|
|
|
108
79
|
icon="trash"
|
|
109
80
|
size="1rem"
|
|
110
81
|
style="cursor: pointer"
|
|
111
|
-
@click=${() => this.removeCellFromRows(
|
|
82
|
+
@click=${() => this.removeCellFromRows(t.field)}
|
|
112
83
|
></lit-icon>
|
|
113
84
|
</div>
|
|
114
|
-
<div class="color-label">${
|
|
85
|
+
<div class="color-label">${v("Barva pozadí")}:</div>
|
|
115
86
|
<div class="settings-buttons">
|
|
116
|
-
${this.backgroundColorOptions.map(
|
|
87
|
+
${this.backgroundColorOptions.map(
|
|
88
|
+
(s) => o`
|
|
117
89
|
<div>
|
|
118
90
|
<div
|
|
119
|
-
@click=${() => this.setCellStyle(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
91
|
+
@click=${() => this.setCellStyle(
|
|
92
|
+
{
|
|
93
|
+
backgroundColor: s.backgroundColor,
|
|
94
|
+
borderRadius: "8px",
|
|
95
|
+
border: s.border
|
|
96
|
+
},
|
|
97
|
+
t
|
|
98
|
+
)}
|
|
124
99
|
class="cell-background"
|
|
125
|
-
style="background-color: ${
|
|
100
|
+
style="background-color: ${s.backgroundColor}; border: ${s.border}"
|
|
126
101
|
></div>
|
|
127
102
|
<div
|
|
128
|
-
class="${this.isActiveBackground(
|
|
129
|
-
|
|
130
|
-
|
|
103
|
+
class="${this.isActiveBackground(
|
|
104
|
+
t,
|
|
105
|
+
s.backgroundColor
|
|
106
|
+
) ? "cell-background--active" : ""}"
|
|
131
107
|
></div>
|
|
132
108
|
</div>
|
|
133
|
-
`
|
|
109
|
+
`
|
|
110
|
+
)}
|
|
134
111
|
</div>
|
|
135
|
-
<div class="color-label">${
|
|
112
|
+
<div class="color-label">${v("Tučné písmo")}:</div>
|
|
136
113
|
<div class="settings-buttons">
|
|
137
114
|
<span
|
|
138
|
-
class="bold-toggle ${
|
|
139
|
-
|
|
140
|
-
: ''}"
|
|
141
|
-
@click=${() => this.setFontWeight(cell)}
|
|
115
|
+
class="bold-toggle ${((i = t == null ? void 0 : t.valueStyle) == null ? void 0 : i.fontWeight) === "bold" ? "bold-toggle--active" : ""}"
|
|
116
|
+
@click=${() => this.setFontWeight(t)}
|
|
142
117
|
>
|
|
143
118
|
B
|
|
144
119
|
</span>
|
|
@@ -149,339 +124,250 @@ let LitCaseVariablesTab = class LitCaseVariablesTab extends LitElement {
|
|
|
149
124
|
<div class="drag-handle">
|
|
150
125
|
<lit-icon icon="hamburger" size="1rem"></lit-icon>
|
|
151
126
|
</div>
|
|
152
|
-
`
|
|
153
|
-
: null}
|
|
127
|
+
` : null}
|
|
154
128
|
</div>`;
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
return html ` <div
|
|
158
|
-
style="${cell?.headerStyle ? styleMap(cell?.headerStyle) : ''}"
|
|
129
|
+
}, this.getHeaderLabel = (t) => o` <div
|
|
130
|
+
style="${t != null && t.headerStyle ? u(t == null ? void 0 : t.headerStyle) : ""}"
|
|
159
131
|
class="process-data-heading"
|
|
160
132
|
>
|
|
161
|
-
${
|
|
162
|
-
|
|
163
|
-
''}
|
|
164
|
-
${cell.tooltip
|
|
165
|
-
? html `
|
|
133
|
+
${(t == null ? void 0 : t[`headerName_${this.userLang}`]) || (t == null ? void 0 : t.headerName) || ""}
|
|
134
|
+
${t.tooltip ? o`
|
|
166
135
|
<lit-icon
|
|
167
|
-
${
|
|
168
|
-
|
|
136
|
+
${k(
|
|
137
|
+
(t == null ? void 0 : t[`tooltip_${this.userLang}`]) ?? (t == null ? void 0 : t.tooltip),
|
|
138
|
+
"right",
|
|
139
|
+
100
|
|
140
|
+
)}
|
|
169
141
|
size="12px"
|
|
170
142
|
icon="informative"
|
|
171
143
|
></lit-icon>
|
|
172
|
-
`
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
this.getHeader = (cell) => {
|
|
177
|
-
return html ` <div class="header-cell">
|
|
178
|
-
${this.getHeaderLabel(cell)} ${this.getHeaderActions(cell)}
|
|
179
|
-
</div>`;
|
|
180
|
-
};
|
|
181
|
-
this.getCellButton = (cell) => {
|
|
182
|
-
return html `
|
|
144
|
+
` : ""}
|
|
145
|
+
</div>`, this.getHeader = (t) => o` <div class="header-cell">
|
|
146
|
+
${this.getHeaderLabel(t)} ${this.getHeaderActions(t)}
|
|
147
|
+
</div>`, this.getCellButton = (t) => o`
|
|
183
148
|
<div style="display: flex; justify-content: space-between">
|
|
184
149
|
<lit-button
|
|
185
150
|
style="flex-grow: 1; margin-right: 0.5rem"
|
|
186
|
-
.fullWidth="${
|
|
187
|
-
variant="${
|
|
188
|
-
label="${
|
|
189
|
-
@click=${
|
|
151
|
+
.fullWidth="${t.buttonFullWidth}"
|
|
152
|
+
variant="${t.buttonVariant || "contained"}"
|
|
153
|
+
label="${t == null ? void 0 : t.headerName}"
|
|
154
|
+
@click=${t == null ? void 0 : t.buttonFn}
|
|
190
155
|
></lit-button>
|
|
191
|
-
${this.getHeaderActions(
|
|
156
|
+
${this.getHeaderActions(t)}
|
|
192
157
|
</div>
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
</a> `;
|
|
200
|
-
};
|
|
201
|
-
this.getCellValue = (cell) => {
|
|
202
|
-
const rawValue = cell?.[`value_${this.userLang}`] || cell?.value || '';
|
|
203
|
-
const value = typeof rawValue === 'string' ? rawValue : String(rawValue ?? '');
|
|
204
|
-
return html `<div>${this.getHeader(cell)}</div>
|
|
158
|
+
`, this.getCellLink = (t) => o`<div>${this.getHeader(t)}</div>
|
|
159
|
+
<a class="link" href=${t != null && t.value ? t.value : ""} target="_blank"
|
|
160
|
+
>${t != null && t.value ? t.value : ""}
|
|
161
|
+
</a> `, this.getCellValue = (t) => {
|
|
162
|
+
const r = (t == null ? void 0 : t[`value_${this.userLang}`]) || (t == null ? void 0 : t.value) || "", e = typeof r == "string" ? r : String(r ?? "");
|
|
163
|
+
return o`<div>${this.getHeader(t)}</div>
|
|
205
164
|
<div
|
|
206
|
-
style="${
|
|
165
|
+
style="${t != null && t.valueStyle ? u(t == null ? void 0 : t.valueStyle) : ""}"
|
|
207
166
|
class="process-data-value"
|
|
208
167
|
>
|
|
209
|
-
${
|
|
168
|
+
${f(e)}
|
|
210
169
|
</div> `;
|
|
211
|
-
|
|
212
|
-
this.getCellDate = (cell) => {
|
|
213
|
-
return html `<div>${this.getHeader(cell)}</div>
|
|
170
|
+
}, this.getCellDate = (t) => o`<div>${this.getHeader(t)}</div>
|
|
214
171
|
<div
|
|
215
|
-
style="${
|
|
172
|
+
style="${t != null && t.valueStyle ? u(t == null ? void 0 : t.valueStyle) : ""}"
|
|
216
173
|
class="process-data-value"
|
|
217
174
|
>
|
|
218
|
-
${
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
175
|
+
${t != null && t.value ? L(
|
|
176
|
+
t.value,
|
|
177
|
+
this.userLang || "cs",
|
|
178
|
+
!!this.dateFormat,
|
|
179
|
+
this.dateFormat
|
|
180
|
+
) : ""}
|
|
181
|
+
</div> `, this.getCellCurrency = (t) => o`<div>${this.getHeader(t)}</div>
|
|
225
182
|
<div
|
|
226
|
-
style="${
|
|
183
|
+
style="${t != null && t.valueStyle ? u(t == null ? void 0 : t.valueStyle) : ""}"
|
|
227
184
|
class="process-data-value"
|
|
228
185
|
>
|
|
229
|
-
${
|
|
230
|
-
</div>
|
|
231
|
-
};
|
|
232
|
-
this.getCellProgress = (cell) => {
|
|
233
|
-
return html `<div>${this.getHeader(cell)}</div>
|
|
186
|
+
${t != null && t.value ? z(t.value, this.userLang || "cs") : ""}
|
|
187
|
+
</div> `, this.getCellProgress = (t) => o`<div>${this.getHeader(t)}</div>
|
|
234
188
|
<div
|
|
235
|
-
style="${
|
|
189
|
+
style="${t != null && t.valueStyle ? u(t == null ? void 0 : t.valueStyle) : ""}"
|
|
236
190
|
class="process-data-value"
|
|
237
191
|
>
|
|
238
|
-
<lit-progress-bar .progress="${
|
|
239
|
-
</div>
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
const rawValue = cell?.[`value_${this.userLang}`] || cell?.value || '';
|
|
243
|
-
const value = typeof rawValue === 'string' ? rawValue : String(rawValue ?? '');
|
|
244
|
-
return html `
|
|
192
|
+
<lit-progress-bar .progress="${t == null ? void 0 : t.value}"></lit-progress-bar>
|
|
193
|
+
</div> `, this.getInlineCellValue = (t) => {
|
|
194
|
+
const r = (t == null ? void 0 : t[`value_${this.userLang}`]) || (t == null ? void 0 : t.value) || "", e = typeof r == "string" ? r : String(r ?? "");
|
|
195
|
+
return o`
|
|
245
196
|
<div style="display: flex;align-items: center; justify-content: end; gap: 0.5rem">
|
|
246
|
-
<div>${this.getHeaderLabel(
|
|
197
|
+
<div>${this.getHeaderLabel(t)}</div>
|
|
247
198
|
<div
|
|
248
|
-
style="${
|
|
249
|
-
? styleMap(cell?.valueStyle)
|
|
250
|
-
: ''}"
|
|
199
|
+
style="${t != null && t.valueStyle ? u(t == null ? void 0 : t.valueStyle) : ""}"
|
|
251
200
|
class="process-data-value"
|
|
252
201
|
>
|
|
253
|
-
${
|
|
202
|
+
${f(e)}
|
|
254
203
|
</div>
|
|
255
|
-
<div>${this.getHeaderActions(
|
|
204
|
+
<div>${this.getHeaderActions(t)}</div>
|
|
256
205
|
</div>
|
|
257
206
|
`;
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
getBreakpoint() {
|
|
210
|
+
const t = window.innerWidth;
|
|
211
|
+
return t >= 1920 ? "xl" : t >= 1280 ? "lg" : t >= 960 ? "md" : t >= 600 ? "sm" : "xs";
|
|
212
|
+
}
|
|
213
|
+
// Function to handle resize events
|
|
214
|
+
handleResize() {
|
|
215
|
+
const t = this.getBreakpoint();
|
|
216
|
+
t !== this.currentBreakpoint && (this.currentBreakpoint = t), this.isMobile = window.innerWidth <= 600;
|
|
217
|
+
}
|
|
218
|
+
connectedCallback() {
|
|
219
|
+
var t, r;
|
|
220
|
+
if (super.connectedCallback(), this.setLanguage(), window.addEventListener("resize", this._resizeListener), this.isMobile = window.innerWidth <= 600, !this.dateFormat) {
|
|
221
|
+
const e = localStorage.getItem("userSettings"), i = e ? (r = (t = JSON.parse(e)) == null ? void 0 : t.state) == null ? void 0 : r.dateFormat : void 0;
|
|
222
|
+
this.dateFormat = i;
|
|
271
223
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
224
|
+
}
|
|
225
|
+
disconnectedCallback() {
|
|
226
|
+
this.destroySortables(), window.removeEventListener("resize", this._resizeListener), super.disconnectedCallback();
|
|
227
|
+
}
|
|
228
|
+
firstUpdated() {
|
|
229
|
+
this.enableSettings && this.initSortable();
|
|
230
|
+
}
|
|
231
|
+
setFontWeight(t) {
|
|
232
|
+
var e;
|
|
233
|
+
const r = ((e = t.valueStyle) == null ? void 0 : e.fontWeight) === "bold";
|
|
234
|
+
t.valueStyle = {
|
|
235
|
+
...t.valueStyle || {},
|
|
236
|
+
fontWeight: r ? "500" : "bold"
|
|
237
|
+
}, this.rows = [...this.rows], this.handleSettingsChanged(this.rows);
|
|
238
|
+
}
|
|
239
|
+
setCellStyle(t, r) {
|
|
240
|
+
r.cellStyle = t, this.rows = [...this.rows], this.handleSettingsChanged(this.rows);
|
|
241
|
+
}
|
|
242
|
+
destroySortables() {
|
|
243
|
+
this.sortableInstances.forEach((t) => {
|
|
244
|
+
t.destroy();
|
|
245
|
+
}), this.sortableInstances = [];
|
|
246
|
+
}
|
|
247
|
+
initSortable() {
|
|
248
|
+
this.updateComplete.then(() => {
|
|
249
|
+
var r;
|
|
250
|
+
const t = (r = this.shadowRoot) == null ? void 0 : r.querySelectorAll(".grid-container");
|
|
251
|
+
t != null && t.length && t.forEach((e) => {
|
|
252
|
+
let i = [];
|
|
253
|
+
const s = C.create(e, {
|
|
254
|
+
group: this.tabId || this.sortableGroupId,
|
|
255
|
+
animation: 150,
|
|
256
|
+
handle: ".drag-handle",
|
|
257
|
+
ghostClass: "sortable-ghost",
|
|
258
|
+
chosenClass: "sortable-chosen",
|
|
259
|
+
dragClass: "sortable-drag",
|
|
260
|
+
sort: !0,
|
|
261
|
+
onStart: (a) => {
|
|
262
|
+
i = Array.from(a.from.childNodes);
|
|
263
|
+
},
|
|
264
|
+
onEnd: (a) => {
|
|
265
|
+
var c;
|
|
266
|
+
a.from.innerHTML = "", i.forEach((y) => a.from.appendChild(y));
|
|
267
|
+
const { oldIndex: p, newIndex: h } = a;
|
|
268
|
+
if (p == null || h == null || p === h) return;
|
|
269
|
+
const m = [...this.rows], [l] = m.splice(p, 1);
|
|
270
|
+
m.splice(h, 0, l), this.rows = m, (c = this.handleSettingsChanged) == null || c.call(this, m);
|
|
271
|
+
}
|
|
320
272
|
});
|
|
321
|
-
this.sortableInstances
|
|
273
|
+
this.sortableInstances.push(s);
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
setLanguage() {
|
|
278
|
+
const t = this.userLang || localStorage.getItem("userLang");
|
|
279
|
+
t && _(t);
|
|
280
|
+
}
|
|
281
|
+
isActiveBackground(t, r) {
|
|
282
|
+
var i;
|
|
283
|
+
const e = (i = t == null ? void 0 : t.cellStyle) == null ? void 0 : i.backgroundColor;
|
|
284
|
+
return !e && r === "transparent" ? !0 : e === r;
|
|
285
|
+
}
|
|
286
|
+
setCellSize(t, r) {
|
|
287
|
+
r.size || (r.size = {}), r.size.lg = t, this.rows = [...this.rows], this.handleSettingsChanged(this.rows);
|
|
288
|
+
}
|
|
289
|
+
removeCellFromRows(t) {
|
|
290
|
+
this.destroySortables();
|
|
291
|
+
const r = this.rows.filter((e) => e.field !== t);
|
|
292
|
+
this.rows = [], this.updateComplete.then(() => {
|
|
293
|
+
this.rows = [...r], this.initSortable(), this.handleSettingsChanged(this.rows);
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
closePopover() {
|
|
297
|
+
this.isOpen = !1;
|
|
298
|
+
}
|
|
299
|
+
toggleCustomPopover() {
|
|
300
|
+
this.isOpen = !this.isOpen;
|
|
301
|
+
}
|
|
302
|
+
get existingFields() {
|
|
303
|
+
return this.rows.flat().map((t) => t.field);
|
|
304
|
+
}
|
|
305
|
+
toggleRowCell(t) {
|
|
306
|
+
var e;
|
|
307
|
+
if (this.rows.some((i) => i.field === t))
|
|
308
|
+
this.removeCellFromRows(t);
|
|
309
|
+
else {
|
|
310
|
+
const i = (e = this.data) == null ? void 0 : e[t];
|
|
311
|
+
if (!i) return;
|
|
312
|
+
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;
|
|
313
|
+
let h;
|
|
314
|
+
switch (i.ivar_type) {
|
|
315
|
+
case "D":
|
|
316
|
+
h = "date";
|
|
317
|
+
break;
|
|
318
|
+
case "progress":
|
|
319
|
+
h = "progress";
|
|
320
|
+
break;
|
|
321
|
+
default:
|
|
322
|
+
h = "string";
|
|
323
|
+
}
|
|
324
|
+
const m = {
|
|
325
|
+
field: t,
|
|
326
|
+
type: h,
|
|
327
|
+
headerName: a,
|
|
328
|
+
value: i.ivar_value,
|
|
329
|
+
size: { xs: 4, sm: 2, md: 1, lg: 1, xl: 1 },
|
|
330
|
+
tooltip: p
|
|
331
|
+
}, l = [...this.rows];
|
|
332
|
+
l.push(m), this.rows = l, this.handleSettingsChanged(l);
|
|
322
333
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
evt.from.innerHTML = '';
|
|
343
|
-
originalNodes.forEach((node) => evt.from.appendChild(node));
|
|
344
|
-
const { oldIndex, newIndex } = evt;
|
|
345
|
-
if (oldIndex == null || newIndex == null || oldIndex === newIndex)
|
|
346
|
-
return;
|
|
347
|
-
const updated = [...this.rows];
|
|
348
|
-
const [movedItem] = updated.splice(oldIndex, 1);
|
|
349
|
-
updated.splice(newIndex, 0, movedItem);
|
|
350
|
-
this.rows = updated;
|
|
351
|
-
this.handleSettingsChanged?.(updated);
|
|
352
|
-
},
|
|
353
|
-
});
|
|
354
|
-
this.sortableInstances.push(sortableInstance);
|
|
355
|
-
});
|
|
356
|
-
});
|
|
357
|
-
}
|
|
358
|
-
setLanguage() {
|
|
359
|
-
const lang = this.userLang || localStorage.getItem('userLang');
|
|
360
|
-
if (lang) {
|
|
361
|
-
setLocale(lang);
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
isActiveBackground(cell, color) {
|
|
365
|
-
const bg = cell?.cellStyle?.backgroundColor;
|
|
366
|
-
if (!bg && color === 'transparent')
|
|
367
|
-
return true; // If nothing is set → consider transparent as active
|
|
368
|
-
return bg === color;
|
|
369
|
-
}
|
|
370
|
-
setCellSize(size, cell) {
|
|
371
|
-
if (!cell.size) {
|
|
372
|
-
cell.size = {};
|
|
373
|
-
}
|
|
374
|
-
cell.size.lg = size;
|
|
375
|
-
this.rows = [...this.rows];
|
|
376
|
-
this.handleSettingsChanged(this.rows);
|
|
377
|
-
}
|
|
378
|
-
removeCellFromRows(field) {
|
|
379
|
-
this.destroySortables();
|
|
380
|
-
const updatedRows = this.rows.filter((c) => c.field !== field);
|
|
381
|
-
this.rows = [];
|
|
382
|
-
this.updateComplete.then(() => {
|
|
383
|
-
this.rows = [...updatedRows];
|
|
384
|
-
this.initSortable();
|
|
385
|
-
this.handleSettingsChanged(this.rows);
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
closePopover() {
|
|
389
|
-
this.isOpen = false;
|
|
390
|
-
}
|
|
391
|
-
toggleCustomPopover() {
|
|
392
|
-
this.isOpen = !this.isOpen;
|
|
393
|
-
}
|
|
394
|
-
get existingFields() {
|
|
395
|
-
return this.rows.flat().map((cell) => cell.field);
|
|
396
|
-
}
|
|
397
|
-
toggleRowCell(key) {
|
|
398
|
-
const exists = this.rows.some((cell) => cell.field === key);
|
|
399
|
-
if (exists) {
|
|
400
|
-
this.removeCellFromRows(key);
|
|
401
|
-
}
|
|
402
|
-
else {
|
|
403
|
-
const raw = this.data?.[key];
|
|
404
|
-
if (!raw)
|
|
405
|
-
return;
|
|
406
|
-
const lang = this.userLang || 'cs';
|
|
407
|
-
const headerName = raw[`tvar_name_${lang}`] || raw.tvar_name_cs || raw.tvar_name;
|
|
408
|
-
const tooltip = raw[`tvar_tooltip_${lang}`] || raw.tvar_tooltip_cs || raw.tvar_tooltip;
|
|
409
|
-
let type;
|
|
410
|
-
switch (raw.ivar_type) {
|
|
411
|
-
case 'D':
|
|
412
|
-
type = 'date';
|
|
413
|
-
break;
|
|
414
|
-
case 'progress':
|
|
415
|
-
type = 'progress';
|
|
416
|
-
break;
|
|
417
|
-
default:
|
|
418
|
-
type = 'string';
|
|
419
|
-
}
|
|
420
|
-
const newCell = {
|
|
421
|
-
field: key,
|
|
422
|
-
type,
|
|
423
|
-
headerName,
|
|
424
|
-
value: raw.ivar_value,
|
|
425
|
-
size: { xs: 4, sm: 2, md: 1, lg: 1, xl: 1 },
|
|
426
|
-
tooltip,
|
|
427
|
-
};
|
|
428
|
-
const newRows = [...this.rows];
|
|
429
|
-
newRows.push(newCell);
|
|
430
|
-
this.rows = newRows;
|
|
431
|
-
this.handleSettingsChanged(newRows);
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
render() {
|
|
435
|
-
if (this.hideTabWhen)
|
|
436
|
-
return null;
|
|
437
|
-
const lang = this.userLang || 'cs';
|
|
438
|
-
const filteredKeys = Object.keys(this.data || {}).filter((key) => {
|
|
439
|
-
const item = this.data[key];
|
|
440
|
-
const name = item?.[`tvar_name_${lang}`] || key;
|
|
441
|
-
return (key.toLowerCase().includes(this.filterText) ||
|
|
442
|
-
name.toLowerCase().includes(this.filterText));
|
|
443
|
-
});
|
|
444
|
-
return html `
|
|
445
|
-
${this.isLoading
|
|
446
|
-
? html `<lit-loader></lit-loader>`
|
|
447
|
-
: html `
|
|
448
|
-
<div class="grid-container ${this.gridVariables ? 'one-column' : ''}">
|
|
449
|
-
${repeat(this.rows, (cell, index) => cell.field, (cell) => {
|
|
450
|
-
const bpIndex = this.BREAKPOINTS.indexOf(this.currentBreakpoint);
|
|
451
|
-
const spanSize = this.BREAKPOINTS.slice(0, bpIndex + 1)
|
|
452
|
-
.reverse()
|
|
453
|
-
.map((bp) => cell.size?.[bp])
|
|
454
|
-
.find((s) => s !== undefined) ?? 2;
|
|
455
|
-
const classes = `cell--span${spanSize} cell ${this.gridVariables ? 'one-column' : ''}`;
|
|
456
|
-
return html `
|
|
334
|
+
}
|
|
335
|
+
render() {
|
|
336
|
+
if (this.hideTabWhen) return null;
|
|
337
|
+
const t = this.userLang || "cs", r = Object.keys(this.data || {}).filter((e) => {
|
|
338
|
+
const i = this.data[e], s = (i == null ? void 0 : i[`tvar_name_${t}`]) || e;
|
|
339
|
+
return e.toLowerCase().includes(this.filterText) || s.toLowerCase().includes(this.filterText);
|
|
340
|
+
});
|
|
341
|
+
return o`
|
|
342
|
+
${this.isLoading ? o`<lit-loader></lit-loader>` : o`
|
|
343
|
+
<div class="grid-container ${this.gridVariables ? "one-column" : ""}">
|
|
344
|
+
${S(
|
|
345
|
+
this.rows,
|
|
346
|
+
(e, i) => e.field,
|
|
347
|
+
(e) => {
|
|
348
|
+
const i = this.BREAKPOINTS.indexOf(this.currentBreakpoint), a = `cell--span${this.BREAKPOINTS.slice(0, i + 1).reverse().map((p) => {
|
|
349
|
+
var h;
|
|
350
|
+
return (h = e.size) == null ? void 0 : h[p];
|
|
351
|
+
}).find((p) => p !== void 0) ?? 2} cell ${this.gridVariables ? "one-column" : ""}`;
|
|
352
|
+
return o`
|
|
457
353
|
<div
|
|
458
|
-
class="${
|
|
459
|
-
style="${
|
|
460
|
-
|
|
354
|
+
class="${a}"
|
|
355
|
+
style="${u(
|
|
356
|
+
e.cellStyle || {}
|
|
357
|
+
)}"
|
|
358
|
+
data-field="${e.field}"
|
|
461
359
|
>
|
|
462
|
-
${this.gridVariables
|
|
463
|
-
? this.getInlineCellValue(cell)
|
|
464
|
-
: cell?.type === 'button'
|
|
465
|
-
? this.getCellButton(cell)
|
|
466
|
-
: cell.type === 'link'
|
|
467
|
-
? this.getCellLink(cell)
|
|
468
|
-
: cell.type === 'progress'
|
|
469
|
-
? this.getCellProgress(cell)
|
|
470
|
-
: cell.type === 'currency'
|
|
471
|
-
? this.getCellCurrency(cell)
|
|
472
|
-
: cell.type === 'date'
|
|
473
|
-
? this.getCellDate(cell)
|
|
474
|
-
: this.getCellValue(cell)}
|
|
360
|
+
${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)}
|
|
475
361
|
</div>
|
|
476
362
|
`;
|
|
477
|
-
|
|
363
|
+
}
|
|
364
|
+
)}
|
|
478
365
|
</div>
|
|
479
|
-
${this.enableSettings
|
|
480
|
-
? html `
|
|
366
|
+
${this.enableSettings ? o`
|
|
481
367
|
<div style="text-align: right; margin-top: 1rem;">
|
|
482
368
|
<lit-button
|
|
483
|
-
variant="${
|
|
484
|
-
label="${
|
|
369
|
+
variant="${"dashed"}"
|
|
370
|
+
label="${v("Přiřadit proměnnou")}"
|
|
485
371
|
icon="add"
|
|
486
372
|
.fullWidth=${this.isMobile}
|
|
487
373
|
@click="${this.toggleCustomPopover}"
|
|
@@ -490,9 +376,9 @@ let LitCaseVariablesTab = class LitCaseVariablesTab extends LitElement {
|
|
|
490
376
|
|
|
491
377
|
<simple-popper
|
|
492
378
|
.showing=${this.isOpen}
|
|
493
|
-
.placement=${
|
|
494
|
-
.manualOpening=${
|
|
495
|
-
.maxWidthAsTarget=${
|
|
379
|
+
.placement=${"top-end"}
|
|
380
|
+
.manualOpening=${!0}
|
|
381
|
+
.maxWidthAsTarget=${!1}
|
|
496
382
|
.onClose=${() => this.closePopover()}
|
|
497
383
|
>
|
|
498
384
|
<div
|
|
@@ -501,54 +387,50 @@ let LitCaseVariablesTab = class LitCaseVariablesTab extends LitElement {
|
|
|
501
387
|
>
|
|
502
388
|
<lit-input
|
|
503
389
|
.value=${this.filterText}
|
|
504
|
-
.onInput=${(
|
|
505
|
-
|
|
506
|
-
|
|
390
|
+
.onInput=${(e) => {
|
|
391
|
+
var i;
|
|
392
|
+
this.filterText = ((i = e == null ? void 0 : e.toLowerCase) == null ? void 0 : i.call(e)) || "";
|
|
393
|
+
}}
|
|
507
394
|
.onClear=${() => {
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
placeholder="${
|
|
511
|
-
.size=${
|
|
395
|
+
this.filterText = "";
|
|
396
|
+
}}
|
|
397
|
+
placeholder="${v("Zadejte název proměnné")}"
|
|
398
|
+
.size=${"small"}
|
|
512
399
|
></lit-input>
|
|
513
400
|
</div>
|
|
514
401
|
<lit-menu tabindex="0">
|
|
515
|
-
${Object.keys(this.data || {})
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
.sort((a, b) => {
|
|
526
|
-
const aIsUnderscore = a.startsWith('_');
|
|
527
|
-
const bIsUnderscore = b.startsWith('_');
|
|
528
|
-
if (aIsUnderscore && !bIsUnderscore)
|
|
529
|
-
return 1;
|
|
530
|
-
if (!aIsUnderscore && bIsUnderscore)
|
|
531
|
-
return -1;
|
|
532
|
-
return a.localeCompare(b);
|
|
533
|
-
})
|
|
534
|
-
.map((key) => html `
|
|
402
|
+
${Object.keys(this.data || {}).filter((e) => {
|
|
403
|
+
const i = this.data[e], s = this.userLang || "cs", a = (i == null ? void 0 : i[`tvar_name_${s}`]) || e;
|
|
404
|
+
return e.toLowerCase().includes(this.filterText) || a.toLowerCase().includes(this.filterText);
|
|
405
|
+
}).sort((e, i) => {
|
|
406
|
+
const s = e.startsWith("_"), a = i.startsWith("_");
|
|
407
|
+
return s && !a ? 1 : !s && a ? -1 : e.localeCompare(i);
|
|
408
|
+
}).map(
|
|
409
|
+
(e) => {
|
|
410
|
+
var i, s;
|
|
411
|
+
return o`
|
|
535
412
|
<lit-menu-item
|
|
536
|
-
.onClick=${() => this.toggleRowCell(
|
|
537
|
-
.isActive=${this.existingFields.includes(
|
|
413
|
+
.onClick=${() => this.toggleRowCell(e)}
|
|
414
|
+
.isActive=${this.existingFields.includes(
|
|
415
|
+
e
|
|
416
|
+
)}
|
|
538
417
|
>
|
|
539
418
|
<span class="menu-item--multiple">
|
|
540
419
|
<lit-checkbox
|
|
541
420
|
class="cursor"
|
|
542
|
-
.checked=${this.existingFields.includes(
|
|
421
|
+
.checked=${this.existingFields.includes(
|
|
422
|
+
e
|
|
423
|
+
)}
|
|
543
424
|
></lit-checkbox>
|
|
544
|
-
${this.data
|
|
425
|
+
${((s = (i = this.data) == null ? void 0 : i[e]) == null ? void 0 : s[`tvar_name_${this.userLang}`]) || e}
|
|
545
426
|
</span>
|
|
546
427
|
</lit-menu-item>
|
|
547
|
-
|
|
428
|
+
`;
|
|
429
|
+
}
|
|
430
|
+
)}
|
|
548
431
|
</lit-menu>
|
|
549
432
|
|
|
550
|
-
${
|
|
551
|
-
? html `
|
|
433
|
+
${I(r.length, 0) ? o`
|
|
552
434
|
<div
|
|
553
435
|
style="display: flex;flex-direction: column; align-items: center"
|
|
554
436
|
>
|
|
@@ -557,21 +439,19 @@ let LitCaseVariablesTab = class LitCaseVariablesTab extends LitElement {
|
|
|
557
439
|
>
|
|
558
440
|
<not-found></not-found>
|
|
559
441
|
</div>
|
|
560
|
-
${
|
|
442
|
+
${v("Nenalezeno")}
|
|
561
443
|
</div>
|
|
562
|
-
`
|
|
563
|
-
: null}
|
|
444
|
+
` : null}
|
|
564
445
|
</simple-popper>
|
|
565
446
|
</div>
|
|
566
|
-
`
|
|
567
|
-
: ''}
|
|
447
|
+
` : ""}
|
|
568
448
|
`}
|
|
569
449
|
`;
|
|
570
|
-
|
|
450
|
+
}
|
|
571
451
|
};
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
452
|
+
n.styles = [
|
|
453
|
+
// styles,
|
|
454
|
+
$`
|
|
575
455
|
:host {
|
|
576
456
|
font-family: 'Inter', sans-serif;
|
|
577
457
|
}
|
|
@@ -791,52 +671,53 @@ LitCaseVariablesTab.styles = [
|
|
|
791
671
|
grid-template-columns: repeat(auto-fill, minmax(0, 1fr));
|
|
792
672
|
}
|
|
793
673
|
}
|
|
794
|
-
|
|
674
|
+
`
|
|
795
675
|
];
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
],
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
],
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
],
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
],
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
],
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
],
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
],
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
],
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
],
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
],
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
],
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
],
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
],
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
],
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
],
|
|
841
|
-
export {
|
|
842
|
-
|
|
676
|
+
d([
|
|
677
|
+
g({ type: Array })
|
|
678
|
+
], n.prototype, "rows", 2);
|
|
679
|
+
d([
|
|
680
|
+
g({ type: Object })
|
|
681
|
+
], n.prototype, "data", 2);
|
|
682
|
+
d([
|
|
683
|
+
g({ type: Boolean })
|
|
684
|
+
], n.prototype, "hideTabWhen", 2);
|
|
685
|
+
d([
|
|
686
|
+
g({ type: String })
|
|
687
|
+
], n.prototype, "userLang", 2);
|
|
688
|
+
d([
|
|
689
|
+
g({ type: String })
|
|
690
|
+
], n.prototype, "dateFormat", 2);
|
|
691
|
+
d([
|
|
692
|
+
g({ type: Boolean })
|
|
693
|
+
], n.prototype, "isLoading", 2);
|
|
694
|
+
d([
|
|
695
|
+
g({ type: Boolean })
|
|
696
|
+
], n.prototype, "enableSettings", 2);
|
|
697
|
+
d([
|
|
698
|
+
g({ type: String })
|
|
699
|
+
], n.prototype, "tabId", 2);
|
|
700
|
+
d([
|
|
701
|
+
g({ type: Boolean })
|
|
702
|
+
], n.prototype, "gridVariables", 2);
|
|
703
|
+
d([
|
|
704
|
+
g({ type: Function })
|
|
705
|
+
], n.prototype, "onSettingsChanged", 2);
|
|
706
|
+
d([
|
|
707
|
+
b()
|
|
708
|
+
], n.prototype, "currentBreakpoint", 2);
|
|
709
|
+
d([
|
|
710
|
+
b()
|
|
711
|
+
], n.prototype, "isOpen", 2);
|
|
712
|
+
d([
|
|
713
|
+
b()
|
|
714
|
+
], n.prototype, "filterText", 2);
|
|
715
|
+
d([
|
|
716
|
+
b()
|
|
717
|
+
], n.prototype, "isMobile", 2);
|
|
718
|
+
n = d([
|
|
719
|
+
w("lit-case-variables-tab")
|
|
720
|
+
], n);
|
|
721
|
+
export {
|
|
722
|
+
n as LitCaseVariablesTab
|
|
723
|
+
};
|