overview-components 1.0.92 → 1.0.93
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 +71 -0
- package/dist/assets/generated/locales/de.js.map +1 -0
- package/dist/assets/generated/locales/en.js +71 -0
- package/dist/assets/generated/locales/en.js.map +1 -0
- package/dist/assets/generated/locales/fr.js +71 -0
- package/dist/assets/generated/locales/fr.js.map +1 -0
- package/dist/assets/generated/locales/hr.js +71 -0
- package/dist/assets/generated/locales/hr.js.map +1 -0
- package/dist/assets/generated/locales/it.js +71 -0
- package/dist/assets/generated/locales/it.js.map +1 -0
- package/dist/assets/generated/locales/pl.js +71 -0
- package/dist/assets/generated/locales/pl.js.map +1 -0
- package/dist/assets/generated/locales/ro.js +71 -0
- package/dist/assets/generated/locales/ro.js.map +1 -0
- package/dist/assets/generated/locales/sk.js +71 -0
- package/dist/assets/generated/locales/sk.js.map +1 -0
- package/dist/assets/generated/locales/sr.js +71 -0
- package/dist/assets/generated/locales/sr.js.map +1 -0
- package/dist/assets/icons/iconGlyphs.js +679 -0
- package/dist/assets/icons/iconGlyphs.js.map +1 -0
- package/dist/assets/illustration/delete-illustration.js +96 -0
- package/dist/assets/illustration/delete-illustration.js.map +1 -0
- package/dist/assets/illustration/no-content.js +167 -0
- package/dist/assets/illustration/no-content.js.map +1 -0
- package/dist/assets/illustration/no-preview.js +133 -0
- package/dist/assets/illustration/no-preview.js.map +1 -0
- package/dist/assets/illustration/not-found.js +106 -0
- package/dist/assets/illustration/not-found.js.map +1 -0
- package/dist/assets/illustration/settings-illustration.js +176 -0
- package/dist/assets/illustration/settings-illustration.js.map +1 -0
- package/dist/components/components-settings/attachments-tab-settings.js +226 -0
- package/dist/components/components-settings/attachments-tab-settings.js.map +1 -0
- package/dist/components/components-settings/data-grid-settings.js +318 -0
- package/dist/components/components-settings/data-grid-settings.js.map +1 -0
- package/dist/components/components-settings/section-tab-settings.js +269 -0
- package/dist/components/components-settings/section-tab-settings.js.map +1 -0
- package/dist/components/components-settings/tabs-overview-settings.js +439 -0
- package/dist/components/components-settings/tabs-overview-settings.js.map +1 -0
- package/dist/components/lit-attachments-tab.js +680 -0
- package/dist/components/lit-attachments-tab.js.map +1 -0
- package/dist/components/lit-badge.js +100 -0
- package/dist/components/lit-badge.js.map +1 -0
- package/dist/components/lit-case-variables-tab.js +842 -0
- package/dist/components/lit-case-variables-tab.js.map +1 -0
- package/dist/components/lit-chart.js +423 -0
- package/dist/components/lit-chart.js.map +1 -0
- package/dist/components/lit-data-grid-tanstack.js +2246 -0
- package/dist/components/lit-data-grid-tanstack.js.map +1 -0
- package/dist/components/lit-filter-modal.js +344 -0
- package/dist/components/lit-filter-modal.js.map +1 -0
- package/dist/components/lit-multiselect-item.js +706 -0
- package/dist/components/lit-multiselect-item.js.map +1 -0
- package/dist/components/lit-section-tab.js +145 -0
- package/dist/components/lit-section-tab.js.map +1 -0
- package/dist/components/lit-tabs-overview.js +345 -0
- package/dist/components/lit-tabs-overview.js.map +1 -0
- package/dist/components/modals/lit-confirm-modal.js +120 -0
- package/dist/components/modals/lit-confirm-modal.js.map +1 -0
- package/dist/components/modals/lit-delete-modal.js +128 -0
- package/dist/components/modals/lit-delete-modal.js.map +1 -0
- package/dist/components/react-wrappers/attachments-tab.js +9 -0
- package/dist/components/react-wrappers/attachments-tab.js.map +1 -0
- package/dist/components/react-wrappers/badge.js +9 -0
- package/dist/components/react-wrappers/badge.js.map +1 -0
- package/dist/components/react-wrappers/button.js +9 -0
- package/dist/components/react-wrappers/button.js.map +1 -0
- package/dist/components/react-wrappers/case-variables-tab.js +9 -0
- package/dist/components/react-wrappers/case-variables-tab.js.map +1 -0
- package/dist/components/react-wrappers/chart.js +9 -0
- package/dist/components/react-wrappers/chart.js.map +1 -0
- package/dist/components/react-wrappers/data-grid-tanstack.js +9 -0
- package/dist/components/react-wrappers/data-grid-tanstack.js.map +1 -0
- package/dist/components/react-wrappers/filter-modal.js +9 -0
- package/dist/components/react-wrappers/filter-modal.js.map +1 -0
- package/dist/components/react-wrappers/progress-bar.js +9 -0
- package/dist/components/react-wrappers/progress-bar.js.map +1 -0
- package/dist/components/react-wrappers/section-tab.js +9 -0
- package/dist/components/react-wrappers/section-tab.js.map +1 -0
- package/dist/components/react-wrappers/tabs-overview.js +9 -0
- package/dist/components/react-wrappers/tabs-overview.js.map +1 -0
- package/dist/data/translations.js +2763 -0
- package/dist/data/translations.js.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/index.js +17 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/lit-attachments-tab-document.schema.js +20 -0
- package/dist/schemas/lit-attachments-tab-document.schema.js.map +1 -0
- package/dist/schemas/lit-attachments-tab-settings-value.schema.js +15 -0
- package/dist/schemas/lit-attachments-tab-settings-value.schema.js.map +1 -0
- package/dist/schemas/lit-attachments-tab.schema.js +32 -0
- package/dist/schemas/lit-attachments-tab.schema.js.map +1 -0
- package/dist/schemas/lit-case-variables-tab-cell.schema.js +43 -0
- package/dist/schemas/lit-case-variables-tab-cell.schema.js.map +1 -0
- package/dist/schemas/lit-case-variables-tab-rows.schema.js +6 -0
- package/dist/schemas/lit-case-variables-tab-rows.schema.js.map +1 -0
- package/dist/schemas/lit-case-variables-tab.schema.js +24 -0
- package/dist/schemas/lit-case-variables-tab.schema.js.map +1 -0
- package/dist/schemas/lit-data-grid-tanstack-column-array.schema.js +6 -0
- package/dist/schemas/lit-data-grid-tanstack-column-array.schema.js.map +1 -0
- package/dist/schemas/lit-data-grid-tanstack-column-custom-filter-array.schema.js +6 -0
- package/dist/schemas/lit-data-grid-tanstack-column-custom-filter-array.schema.js.map +1 -0
- package/dist/schemas/lit-data-grid-tanstack-column-custom-filter.schema.js +11 -0
- package/dist/schemas/lit-data-grid-tanstack-column-custom-filter.schema.js.map +1 -0
- package/dist/schemas/lit-data-grid-tanstack-column.schema.js +55 -0
- package/dist/schemas/lit-data-grid-tanstack-column.schema.js.map +1 -0
- package/dist/schemas/lit-data-grid-tanstack.schema.js +99 -0
- package/dist/schemas/lit-data-grid-tanstack.schema.js.map +1 -0
- package/dist/schemas/lit-section-tab-schema.js +24 -0
- package/dist/schemas/lit-section-tab-schema.js.map +1 -0
- package/dist/schemas/lit-tabs-overview-tab-array.schema.js +6 -0
- package/dist/schemas/lit-tabs-overview-tab-array.schema.js.map +1 -0
- package/dist/schemas/lit-tabs-overview-tab.schema.js +32 -0
- package/dist/schemas/lit-tabs-overview-tab.schema.js.map +1 -0
- package/dist/schemas/lit-tabs-overview.schema.js +29 -0
- package/dist/schemas/lit-tabs-overview.schema.js.map +1 -0
- package/dist/scripts/translate-locales.js +69 -0
- package/dist/scripts/translate-locales.js.map +1 -0
- package/dist/shared/filter-inputs.js +427 -0
- package/dist/shared/filter-inputs.js.map +1 -0
- package/dist/shared/lit-button.js +156 -0
- package/dist/shared/lit-button.js.map +1 -0
- package/dist/shared/lit-case-variables-tab-cell.js +226 -0
- package/dist/shared/lit-case-variables-tab-cell.js.map +1 -0
- package/dist/shared/lit-checkbox.js +171 -0
- package/dist/shared/lit-checkbox.js.map +1 -0
- package/dist/shared/lit-custom-popper.js +117 -0
- package/dist/shared/lit-custom-popper.js.map +1 -0
- package/dist/shared/lit-data-grid-action-buttons-popover.js +295 -0
- package/dist/shared/lit-data-grid-action-buttons-popover.js.map +1 -0
- package/dist/shared/lit-data-grid-density-popover.js +84 -0
- package/dist/shared/lit-data-grid-density-popover.js.map +1 -0
- package/dist/shared/lit-data-grid-export-popover.js +68 -0
- package/dist/shared/lit-data-grid-export-popover.js.map +1 -0
- package/dist/shared/lit-data-grid-operators-popover.js +114 -0
- package/dist/shared/lit-data-grid-operators-popover.js.map +1 -0
- package/dist/shared/lit-data-grid-row-actions.js +76 -0
- package/dist/shared/lit-data-grid-row-actions.js.map +1 -0
- package/dist/shared/lit-date-picker.js +606 -0
- package/dist/shared/lit-date-picker.js.map +1 -0
- package/dist/shared/lit-icon-button.js +105 -0
- package/dist/shared/lit-icon-button.js.map +1 -0
- package/dist/shared/lit-icon.js +284 -0
- package/dist/shared/lit-icon.js.map +1 -0
- package/dist/shared/lit-input.js +239 -0
- package/dist/shared/lit-input.js.map +1 -0
- package/dist/shared/lit-label.js +104 -0
- package/dist/shared/lit-label.js.map +1 -0
- package/dist/shared/lit-loader.js +69 -0
- package/dist/shared/lit-loader.js.map +1 -0
- package/dist/shared/lit-loading-bar.js +127 -0
- package/dist/shared/lit-loading-bar.js.map +1 -0
- package/dist/shared/lit-menu-item.js +99 -0
- package/dist/shared/lit-menu-item.js.map +1 -0
- package/dist/shared/lit-menu.js +42 -0
- package/dist/shared/lit-menu.js.map +1 -0
- package/dist/shared/lit-modal-body.js +22 -0
- package/dist/shared/lit-modal-body.js.map +1 -0
- package/dist/shared/lit-modal-footer.js +29 -0
- package/dist/shared/lit-modal-footer.js.map +1 -0
- package/dist/shared/lit-modal-header.js +36 -0
- package/dist/shared/lit-modal-header.js.map +1 -0
- package/dist/shared/lit-modal.js +169 -0
- package/dist/shared/lit-modal.js.map +1 -0
- package/dist/shared/lit-overflow-tooltip.js +103 -0
- package/dist/shared/lit-overflow-tooltip.js.map +1 -0
- package/dist/shared/lit-pill.js +88 -0
- package/dist/shared/lit-pill.js.map +1 -0
- package/dist/shared/lit-progress-bar.js +81 -0
- package/dist/shared/lit-progress-bar.js.map +1 -0
- package/dist/shared/lit-responsive-button.js +94 -0
- package/dist/shared/lit-responsive-button.js.map +1 -0
- package/dist/shared/lit-select-field.js +459 -0
- package/dist/shared/lit-select-field.js.map +1 -0
- package/dist/shared/lit-select.js +413 -0
- package/dist/shared/lit-select.js.map +1 -0
- package/dist/shared/lit-settings.js +77 -0
- package/dist/shared/lit-settings.js.map +1 -0
- package/dist/shared/lit-text-field.js +222 -0
- package/dist/shared/lit-text-field.js.map +1 -0
- package/dist/shared/lit-toggle.js +222 -0
- package/dist/shared/lit-toggle.js.map +1 -0
- package/dist/shared/lit-tooltip.js +166 -0
- package/dist/shared/lit-tooltip.js.map +1 -0
- package/dist/shared/simple-popper.js +266 -0
- package/dist/shared/simple-popper.js.map +1 -0
- package/dist/shared/simple-tooltip.js +248 -0
- package/dist/shared/simple-tooltip.js.map +1 -0
- package/dist/shared/styles/button-shared-styles.js +201 -0
- package/dist/shared/styles/button-shared-styles.js.map +1 -0
- package/dist/styles.js +169 -0
- package/dist/styles.js.map +1 -0
- package/dist/utils/currency.js +16 -0
- package/dist/utils/currency.js.map +1 -0
- package/dist/utils/custom-filters.js +84 -0
- package/dist/utils/custom-filters.js.map +1 -0
- package/dist/utils/date.js +22 -0
- package/dist/utils/date.js.map +1 -0
- package/dist/utils/getOperatorByType.js +66 -0
- package/dist/utils/getOperatorByType.js.map +1 -0
- package/dist/utils/getOverviewValue.js +177 -0
- package/dist/utils/getOverviewValue.js.map +1 -0
- package/dist/utils/localization.js +432 -0
- package/dist/utils/localization.js.map +1 -0
- package/dist/utils/utils.js +13 -0
- package/dist/utils/utils.js.map +1 -0
- package/dist/utils/validate-json-schema.js +8 -0
- package/dist/utils/validate-json-schema.js.map +1 -0
- package/dist/validators/validator.js +7 -0
- package/dist/validators/validator.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, html, css } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
// styles
|
|
10
|
+
import buttonStyles from './styles/button-shared-styles.js';
|
|
11
|
+
// elements
|
|
12
|
+
import './lit-icon.js';
|
|
13
|
+
import './lit-pill.js';
|
|
14
|
+
import './lit-loader.js';
|
|
15
|
+
let LitButton = class LitButton extends LitElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.variant = 'contained';
|
|
19
|
+
this.size = 'medium';
|
|
20
|
+
this.label = 'Button';
|
|
21
|
+
this.fullWidth = false;
|
|
22
|
+
this.disabled = false;
|
|
23
|
+
this.count = undefined;
|
|
24
|
+
this.active = false;
|
|
25
|
+
this.isLoading = false;
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
const classes = `button--${this.size} button--${this.variant} ${this.fullWidth ? 'button--fullWidth' : ''} ${this.active ? 'active' : ''}`;
|
|
29
|
+
const hasCount = this.count !== undefined && this.count !== null && this.count >= 0;
|
|
30
|
+
return html `
|
|
31
|
+
<button ?disabled=${this.disabled} @click=${this.onClick} class=${classes}>
|
|
32
|
+
<div class="button--content">
|
|
33
|
+
${this.isLoading
|
|
34
|
+
? html ` <lit-loader size="small" class="button--loader"></lit-loader> `
|
|
35
|
+
: null}
|
|
36
|
+
|
|
37
|
+
<div
|
|
38
|
+
class="button-inner"
|
|
39
|
+
style="visibility: ${this.isLoading ? 'hidden' : 'visible'};
|
|
40
|
+
"
|
|
41
|
+
>
|
|
42
|
+
<slot name="start-icon">
|
|
43
|
+
${this.icon
|
|
44
|
+
? html `<lit-icon
|
|
45
|
+
class="start-icon"
|
|
46
|
+
size="1.25rem"
|
|
47
|
+
icon="${this.icon}"
|
|
48
|
+
></lit-icon>`
|
|
49
|
+
: ''}
|
|
50
|
+
</slot>
|
|
51
|
+
${this.label}
|
|
52
|
+
${hasCount ? html `<lit-pill count=${this.count}></lit-pill>` : ''}
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</button>
|
|
56
|
+
`;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
LitButton.styles = [
|
|
60
|
+
// styles,
|
|
61
|
+
buttonStyles,
|
|
62
|
+
css `
|
|
63
|
+
/* Basic button styles */
|
|
64
|
+
button {
|
|
65
|
+
line-height: 1.5rem;
|
|
66
|
+
flex-direction: row;
|
|
67
|
+
justify-content: center;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* Size Variants */
|
|
71
|
+
.button--small {
|
|
72
|
+
-webkit-padding: 0.375rem 1rem;
|
|
73
|
+
padding: 0.1875rem 0.375rem;
|
|
74
|
+
font-size: 11px;
|
|
75
|
+
}
|
|
76
|
+
.button--medium {
|
|
77
|
+
font-size: 0.75rem;
|
|
78
|
+
font-weight: 500;
|
|
79
|
+
-webkit-padding: 0.375rem 0.75rem;
|
|
80
|
+
padding: 0.375rem 0.75rem;
|
|
81
|
+
}
|
|
82
|
+
.button--large {
|
|
83
|
+
font-weight: 700;
|
|
84
|
+
-webkit-padding: 0.75rem 1.5rem;
|
|
85
|
+
padding: 0.75rem 1.5rem;
|
|
86
|
+
font-size: 0.875rem;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* FullWidth style */
|
|
90
|
+
.button--fullWidth {
|
|
91
|
+
width: 100%;
|
|
92
|
+
display: block;
|
|
93
|
+
}
|
|
94
|
+
::slotted([slot='start-icon']),
|
|
95
|
+
.start-icon {
|
|
96
|
+
//margin-right: 8px;
|
|
97
|
+
font-size: 1.25rem !important;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.button--content {
|
|
101
|
+
position: relative;
|
|
102
|
+
display: inline-flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
justify-content: center;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.button--loader {
|
|
108
|
+
position: absolute;
|
|
109
|
+
left: 50%;
|
|
110
|
+
top: 50%;
|
|
111
|
+
transform: translate(-50%, -50%);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.button-inner {
|
|
115
|
+
display: inline-flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
gap: 0.5rem;
|
|
118
|
+
visibility: visible;
|
|
119
|
+
}
|
|
120
|
+
`,
|
|
121
|
+
];
|
|
122
|
+
__decorate([
|
|
123
|
+
property({ type: String })
|
|
124
|
+
], LitButton.prototype, "variant", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
property({ type: String })
|
|
127
|
+
], LitButton.prototype, "size", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
property({ type: String })
|
|
130
|
+
], LitButton.prototype, "label", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
property({ type: String })
|
|
133
|
+
], LitButton.prototype, "icon", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
property({ type: Boolean })
|
|
136
|
+
], LitButton.prototype, "fullWidth", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
property({ type: Boolean })
|
|
139
|
+
], LitButton.prototype, "disabled", void 0);
|
|
140
|
+
__decorate([
|
|
141
|
+
property({ type: Number })
|
|
142
|
+
], LitButton.prototype, "count", void 0);
|
|
143
|
+
__decorate([
|
|
144
|
+
property({ type: Function })
|
|
145
|
+
], LitButton.prototype, "onClick", void 0);
|
|
146
|
+
__decorate([
|
|
147
|
+
property({ type: Boolean })
|
|
148
|
+
], LitButton.prototype, "active", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
property({ type: Boolean })
|
|
151
|
+
], LitButton.prototype, "isLoading", void 0);
|
|
152
|
+
LitButton = __decorate([
|
|
153
|
+
customElement('lit-button')
|
|
154
|
+
], LitButton);
|
|
155
|
+
export { LitButton };
|
|
156
|
+
//# sourceMappingURL=lit-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lit-button.js","sourceRoot":"","sources":["../../src/shared/lit-button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkC,MAAM,KAAK,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,Q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Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, html, css } from 'lit';
|
|
8
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
9
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
10
|
+
// components
|
|
11
|
+
import '../shared/lit-icon.js';
|
|
12
|
+
import '../shared/lit-icon.js';
|
|
13
|
+
import '../shared/lit-button.js';
|
|
14
|
+
import '../shared/simple-tooltip.js';
|
|
15
|
+
// utils
|
|
16
|
+
import { formatDate } from '../utils/date.js';
|
|
17
|
+
let LitCaseVariablesTabCell = class LitCaseVariablesTabCell extends LitElement {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
this.type = 'string';
|
|
21
|
+
this.buttonVariant = 'contained';
|
|
22
|
+
this.buttonFullWidth = true;
|
|
23
|
+
this.userLang = 'cs';
|
|
24
|
+
this.BREAKPOINTS = ['xs', 'sm', 'md', 'lg', 'xl'];
|
|
25
|
+
}
|
|
26
|
+
getHeader() {
|
|
27
|
+
return html `
|
|
28
|
+
<div
|
|
29
|
+
style="${this.headerStyle ? styleMap(this.headerStyle) : ''}"
|
|
30
|
+
class="process-data-heading"
|
|
31
|
+
>
|
|
32
|
+
${this.headerName ? this.headerName : ''}
|
|
33
|
+
${this.tooltip
|
|
34
|
+
? html `
|
|
35
|
+
<lit-icon size="12px" icon="informative"></lit-icon>
|
|
36
|
+
<simple-tooltip placement="right"
|
|
37
|
+
>${this.tooltip ? this.tooltip : ''}</simple-tooltip
|
|
38
|
+
>
|
|
39
|
+
`
|
|
40
|
+
: ''}
|
|
41
|
+
</div>
|
|
42
|
+
`;
|
|
43
|
+
}
|
|
44
|
+
getCellButton() {
|
|
45
|
+
return html `
|
|
46
|
+
<lit-button
|
|
47
|
+
.fullWidth="${this.buttonFullWidth}"
|
|
48
|
+
variant="${this.buttonVariant}"
|
|
49
|
+
label="${this.headerName ? this.headerName : ''}"
|
|
50
|
+
@click=${this.buttonFn}
|
|
51
|
+
></lit-button>
|
|
52
|
+
`;
|
|
53
|
+
}
|
|
54
|
+
getCellLink() {
|
|
55
|
+
return html `
|
|
56
|
+
<div>${this.getHeader()}</div>
|
|
57
|
+
<a class="link" href=${this.value ? this.value : ''} target="_blank">
|
|
58
|
+
${this.value ? this.value : ''}
|
|
59
|
+
</a>
|
|
60
|
+
`;
|
|
61
|
+
}
|
|
62
|
+
getCellValue() {
|
|
63
|
+
return html `
|
|
64
|
+
<div>${this.getHeader()}</div>
|
|
65
|
+
<div
|
|
66
|
+
style="${this.valueStyle ? styleMap(this.valueStyle) : ''}"
|
|
67
|
+
class="process-data-value"
|
|
68
|
+
>
|
|
69
|
+
${this.value ? this.value : ''}
|
|
70
|
+
</div>
|
|
71
|
+
`;
|
|
72
|
+
}
|
|
73
|
+
getCellDate() {
|
|
74
|
+
return html `
|
|
75
|
+
<div>${this.getHeader()}</div>
|
|
76
|
+
<div
|
|
77
|
+
style="${this.valueStyle ? styleMap(this.valueStyle) : ''}"
|
|
78
|
+
class="process-data-value"
|
|
79
|
+
>
|
|
80
|
+
${this.value
|
|
81
|
+
? formatDate(this.value, this.userLang || 'cs', !!this.dateFormat)
|
|
82
|
+
: ''}
|
|
83
|
+
</div>
|
|
84
|
+
`;
|
|
85
|
+
}
|
|
86
|
+
render() {
|
|
87
|
+
const breakpointIndex = this.BREAKPOINTS.indexOf(this.currentBreakpoint);
|
|
88
|
+
const spanSize = this.BREAKPOINTS.slice(0, breakpointIndex + 1)
|
|
89
|
+
.reverse()
|
|
90
|
+
.map((bp) => this.size?.[bp])
|
|
91
|
+
.find((size) => size !== undefined) ?? 2;
|
|
92
|
+
const classes = `cell--span${spanSize} cell`;
|
|
93
|
+
return html `
|
|
94
|
+
<div
|
|
95
|
+
class="${classes}"
|
|
96
|
+
style="${styleMap((this.cellStyle || {}))}"
|
|
97
|
+
>
|
|
98
|
+
${this.type === 'button'
|
|
99
|
+
? this.getCellButton()
|
|
100
|
+
: this.type === 'link'
|
|
101
|
+
? this.getCellLink()
|
|
102
|
+
: this.type === 'date'
|
|
103
|
+
? this.getCellDate()
|
|
104
|
+
: this.getCellValue()}
|
|
105
|
+
</div>
|
|
106
|
+
`;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
LitCaseVariablesTabCell.styles = css `
|
|
110
|
+
:host {
|
|
111
|
+
font-family: 'Inter', sans-serif;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.grid-container {
|
|
115
|
+
display: grid;
|
|
116
|
+
justify-content: start;
|
|
117
|
+
align-items: start;
|
|
118
|
+
gap: 0.5rem;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.process-data-heading {
|
|
122
|
+
font-size: 0.75rem;
|
|
123
|
+
color: var(--text-secondary, #5d6371);
|
|
124
|
+
font-weight: 400 !important;
|
|
125
|
+
display: flex;
|
|
126
|
+
gap: 5px;
|
|
127
|
+
align-items: center;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.process-data-value {
|
|
131
|
+
font-size: 0.8125rem;
|
|
132
|
+
color: var(--text-primary, #111827);
|
|
133
|
+
margin: 0;
|
|
134
|
+
padding-top: 0.3125rem;
|
|
135
|
+
font-weight: 500 !important;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.status {
|
|
139
|
+
color: var(--color-primary-main, #76b703);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.link {
|
|
143
|
+
font-size: 0.8125rem;
|
|
144
|
+
text-decoration: none;
|
|
145
|
+
color: inherit;
|
|
146
|
+
border-bottom: 0.0625rem solid var(--color-primary-main, #76b703);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.cell {
|
|
150
|
+
padding: 5px;
|
|
151
|
+
border-radius: 8px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.link:hover {
|
|
155
|
+
color: var(--color-primary-main, #76b703);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.cell--span1 {
|
|
159
|
+
grid-column: span 1 / span 1;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.cell--span2 {
|
|
163
|
+
grid-column: span 2 / span 2;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.cell--span3 {
|
|
167
|
+
grid-column: span 3 / span 3;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.cell--span4 {
|
|
171
|
+
grid-column: span 4 / span 4;
|
|
172
|
+
}
|
|
173
|
+
`;
|
|
174
|
+
__decorate([
|
|
175
|
+
property({ type: String })
|
|
176
|
+
], LitCaseVariablesTabCell.prototype, "field", void 0);
|
|
177
|
+
__decorate([
|
|
178
|
+
property({ type: String })
|
|
179
|
+
], LitCaseVariablesTabCell.prototype, "type", void 0);
|
|
180
|
+
__decorate([
|
|
181
|
+
property({ type: Function })
|
|
182
|
+
], LitCaseVariablesTabCell.prototype, "headerName", void 0);
|
|
183
|
+
__decorate([
|
|
184
|
+
property({ type: Function })
|
|
185
|
+
], LitCaseVariablesTabCell.prototype, "value", void 0);
|
|
186
|
+
__decorate([
|
|
187
|
+
property({ type: Object })
|
|
188
|
+
], LitCaseVariablesTabCell.prototype, "size", void 0);
|
|
189
|
+
__decorate([
|
|
190
|
+
property({ type: String })
|
|
191
|
+
], LitCaseVariablesTabCell.prototype, "buttonVariant", void 0);
|
|
192
|
+
__decorate([
|
|
193
|
+
property({ type: Boolean })
|
|
194
|
+
], LitCaseVariablesTabCell.prototype, "buttonFullWidth", void 0);
|
|
195
|
+
__decorate([
|
|
196
|
+
property({ type: Function })
|
|
197
|
+
], LitCaseVariablesTabCell.prototype, "buttonFn", void 0);
|
|
198
|
+
__decorate([
|
|
199
|
+
property({ type: String })
|
|
200
|
+
], LitCaseVariablesTabCell.prototype, "href", void 0);
|
|
201
|
+
__decorate([
|
|
202
|
+
property({ type: Object })
|
|
203
|
+
], LitCaseVariablesTabCell.prototype, "headerStyle", void 0);
|
|
204
|
+
__decorate([
|
|
205
|
+
property({ type: Object })
|
|
206
|
+
], LitCaseVariablesTabCell.prototype, "valueStyle", void 0);
|
|
207
|
+
__decorate([
|
|
208
|
+
property({ type: Object })
|
|
209
|
+
], LitCaseVariablesTabCell.prototype, "cellStyle", void 0);
|
|
210
|
+
__decorate([
|
|
211
|
+
property({ type: Function })
|
|
212
|
+
], LitCaseVariablesTabCell.prototype, "tooltip", void 0);
|
|
213
|
+
__decorate([
|
|
214
|
+
property({ type: String })
|
|
215
|
+
], LitCaseVariablesTabCell.prototype, "dateFormat", void 0);
|
|
216
|
+
__decorate([
|
|
217
|
+
property({ type: String })
|
|
218
|
+
], LitCaseVariablesTabCell.prototype, "userLang", void 0);
|
|
219
|
+
__decorate([
|
|
220
|
+
property({ type: String })
|
|
221
|
+
], LitCaseVariablesTabCell.prototype, "currentBreakpoint", void 0);
|
|
222
|
+
LitCaseVariablesTabCell = __decorate([
|
|
223
|
+
customElement('lit-case-variables-tab-cell')
|
|
224
|
+
], LitCaseVariablesTabCell);
|
|
225
|
+
export { LitCaseVariablesTabCell };
|
|
226
|
+
//# sourceMappingURL=lit-case-variables-tab-cell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lit-case-variables-tab-cell.js","sourceRoot":"","sources":["../../src/shared/lit-case-variables-tab-cell.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAa,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAS,MAAM,mBAAmB,CAAC;AACnE,aAAa;AAC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MAAM,EAAE,CAAC;qDAAe;AACd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4DAAsB;AACrB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2DAAqB;AACpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0DAAoB;AACjB;IAA7B,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;wDAAkB;AACnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2DAAqB;AACpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yDAA0B;AACzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kEAAsD;AAhBxE,uBAAuB;IADnC,aAAa,CAAC,6BAA6B,CAAC;GAChC,uBAAuB,CA+KnC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, html, css } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
10
|
+
import './lit-label.js';
|
|
11
|
+
let LitCheckbox = class LitCheckbox extends LitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.disabled = false;
|
|
15
|
+
this.checked = false;
|
|
16
|
+
this.indeterminate = false;
|
|
17
|
+
this.onChange = () => { };
|
|
18
|
+
this.value = '';
|
|
19
|
+
this.label = '';
|
|
20
|
+
}
|
|
21
|
+
// 1) Manually sync the indeterminate property on the <input>
|
|
22
|
+
updated(changed) {
|
|
23
|
+
super.updated(changed);
|
|
24
|
+
const input = this.renderRoot.querySelector('input[type="checkbox"]');
|
|
25
|
+
if (input) {
|
|
26
|
+
input.indeterminate = this.indeterminate;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
// 2) Intercept clicks when we're indeterminate
|
|
30
|
+
_onClick(e) {
|
|
31
|
+
if (this.indeterminate) {
|
|
32
|
+
// prevent the browser from toggling .checked for us
|
|
33
|
+
e.preventDefault();
|
|
34
|
+
// clear the “?” state
|
|
35
|
+
this.indeterminate = false;
|
|
36
|
+
// and leave this.checked as it was (false)
|
|
37
|
+
// now fire your change callback
|
|
38
|
+
this._notifyChange(e);
|
|
39
|
+
}
|
|
40
|
+
// otherwise let the native click toggle .checked, and @change will fire
|
|
41
|
+
}
|
|
42
|
+
// 3) Handle the native change event when not indeterminate
|
|
43
|
+
_onChange(e) {
|
|
44
|
+
// update our controlled prop
|
|
45
|
+
this.checked = e.target.checked;
|
|
46
|
+
this._notifyChange(e);
|
|
47
|
+
}
|
|
48
|
+
_notifyChange(e) {
|
|
49
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
50
|
+
bubbles: true,
|
|
51
|
+
composed: true,
|
|
52
|
+
detail: e.target.checked,
|
|
53
|
+
}));
|
|
54
|
+
if (typeof this.onChange === 'function') {
|
|
55
|
+
this.onChange(e);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
render() {
|
|
59
|
+
return html `
|
|
60
|
+
<div class="container">
|
|
61
|
+
${this.label
|
|
62
|
+
? html `
|
|
63
|
+
<lit-label label="${this.label}" ?disabled=${this.disabled}> </lit-label>
|
|
64
|
+
`
|
|
65
|
+
: ''}
|
|
66
|
+
<input
|
|
67
|
+
class=${classMap({
|
|
68
|
+
indeterminate: this.indeterminate,
|
|
69
|
+
marginLeft: this.label !== '',
|
|
70
|
+
})}
|
|
71
|
+
type="checkbox"
|
|
72
|
+
.checked=${this.checked}
|
|
73
|
+
?disabled=${this.disabled}
|
|
74
|
+
@click=${this._onClick}
|
|
75
|
+
@change=${this._onChange}
|
|
76
|
+
.value=${this.value}
|
|
77
|
+
aria-label="${this.label || 'checkbox'}"
|
|
78
|
+
aria-checked="${this.indeterminate ? 'mixed' : this.checked ? 'true' : 'false'}"
|
|
79
|
+
aria-disabled="${this.disabled ? 'true' : 'false'}"
|
|
80
|
+
/>
|
|
81
|
+
</div>
|
|
82
|
+
`;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
LitCheckbox.styles = css `
|
|
86
|
+
:host {
|
|
87
|
+
display: inline-block;
|
|
88
|
+
font-family: Inter, sans-serif;
|
|
89
|
+
}
|
|
90
|
+
.container {
|
|
91
|
+
display: flex;
|
|
92
|
+
flex-direction: column;
|
|
93
|
+
}
|
|
94
|
+
/* Hide the default checkbox */
|
|
95
|
+
.marginLeft {
|
|
96
|
+
margin-left: 0.75rem;
|
|
97
|
+
}
|
|
98
|
+
input[type='checkbox'] {
|
|
99
|
+
position: relative;
|
|
100
|
+
appearance: none;
|
|
101
|
+
width: 20px;
|
|
102
|
+
height: 20px;
|
|
103
|
+
border: 1px solid var(--text-primary, #111827);
|
|
104
|
+
border-radius: 6px;
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
justify-content: center;
|
|
108
|
+
background-color: var(--background-paper, #fff);
|
|
109
|
+
transition: all 0.1s ease-in-out;
|
|
110
|
+
cursor: pointer;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
input[type='checkbox'].indeterminate {
|
|
114
|
+
background-color: var(--color-primary-main, #76b703);
|
|
115
|
+
border-color: var(--color-primary-main, #76b703);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
input[type='checkbox'].indeterminate::after {
|
|
119
|
+
content: '−';
|
|
120
|
+
color: var(--background-default, #111827);
|
|
121
|
+
font-size: 16px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* Custom checkmark */
|
|
125
|
+
input[type='checkbox']::after {
|
|
126
|
+
content: '✓';
|
|
127
|
+
color: var(--background-paper, #111827);
|
|
128
|
+
font-size: 16px;
|
|
129
|
+
visible: none;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* Checked state */
|
|
133
|
+
input[type='checkbox']:checked {
|
|
134
|
+
background-color: var(--color-primary-main, #76b703);
|
|
135
|
+
border-color: var(--color-primary-main, #76b703);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
input[type='checkbox']:checked::after {
|
|
139
|
+
visible: visibility;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* Disabled state */
|
|
143
|
+
input[type='checkbox']:disabled {
|
|
144
|
+
background-color: var(--background-paper, #fff);
|
|
145
|
+
border-color: var(--color-primary-disabled, #d0d3db);
|
|
146
|
+
cursor: not-allowed;
|
|
147
|
+
}
|
|
148
|
+
`;
|
|
149
|
+
__decorate([
|
|
150
|
+
property({ type: Boolean })
|
|
151
|
+
], LitCheckbox.prototype, "disabled", void 0);
|
|
152
|
+
__decorate([
|
|
153
|
+
property({ type: Boolean })
|
|
154
|
+
], LitCheckbox.prototype, "checked", void 0);
|
|
155
|
+
__decorate([
|
|
156
|
+
property({ type: Boolean })
|
|
157
|
+
], LitCheckbox.prototype, "indeterminate", void 0);
|
|
158
|
+
__decorate([
|
|
159
|
+
property({ type: Function })
|
|
160
|
+
], LitCheckbox.prototype, "onChange", void 0);
|
|
161
|
+
__decorate([
|
|
162
|
+
property({ type: String })
|
|
163
|
+
], LitCheckbox.prototype, "value", void 0);
|
|
164
|
+
__decorate([
|
|
165
|
+
property({ type: String })
|
|
166
|
+
], LitCheckbox.prototype, "label", void 0);
|
|
167
|
+
LitCheckbox = __decorate([
|
|
168
|
+
customElement('lit-checkbox')
|
|
169
|
+
], LitCheckbox);
|
|
170
|
+
export { LitCheckbox };
|
|
171
|
+
//# sourceMappingURL=lit-checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lit-checkbox.js","sourceRoot":"","sources":["../../src/shared/lit-checkbox.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,OAAO,gBAAgB,CAAC;AAEjB,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAiE0B,aAAQ,GAAG,KAAK,CAAC;QACjB,YAAO,GAAG,KAAK,CAAC;QAChB,kBAAa,GAAG,KAAK,CAAC;QACrB,aAAQ,GAAuB,GAAG,EAAE,GAAE,CAAC,CAAC;QAC1C,UAAK,GAAG,EAAE,CAAC;QACX,UAAK,GAAG,EAAE,CAAC;IAyE3C,CAAC;IAvEG,6DAA6D;IACnD,OAAO,CAAC,OAAuB;QACrC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACvB,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CACvC,wBAAwB,CACA,CAAC;QAC7B,IAAI,KAAK,EAAE,CAAC;YACR,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;QAC7C,CAAC;IACL,CAAC;IAED,+CAA+C;IACvC,QAAQ,CAAC,CAAa;QAC1B,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACrB,oDAAoD;YACpD,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,sBAAsB;YACtB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;YAC3B,2CAA2C;YAC3C,gCAAgC;YAChC,IA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