overview-components 1.1.159 → 1.1.161

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.
Files changed (242) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +82 -0
  3. package/dist/icons.js +692 -0
  4. package/dist/index.js +19890 -7
  5. package/dist/shared/lit-icon.d.ts.map +1 -1
  6. package/package.json +58 -21
  7. package/dist/assets/generated/locales/de.js +0 -269
  8. package/dist/assets/generated/locales/de.js.map +0 -1
  9. package/dist/assets/generated/locales/en.js +0 -269
  10. package/dist/assets/generated/locales/en.js.map +0 -1
  11. package/dist/assets/generated/locales/fr.js +0 -269
  12. package/dist/assets/generated/locales/fr.js.map +0 -1
  13. package/dist/assets/generated/locales/hr.js +0 -269
  14. package/dist/assets/generated/locales/hr.js.map +0 -1
  15. package/dist/assets/generated/locales/it.js +0 -269
  16. package/dist/assets/generated/locales/it.js.map +0 -1
  17. package/dist/assets/generated/locales/pl.js +0 -269
  18. package/dist/assets/generated/locales/pl.js.map +0 -1
  19. package/dist/assets/generated/locales/ro.js +0 -269
  20. package/dist/assets/generated/locales/ro.js.map +0 -1
  21. package/dist/assets/generated/locales/sk.js +0 -269
  22. package/dist/assets/generated/locales/sk.js.map +0 -1
  23. package/dist/assets/generated/locales/sr.js +0 -269
  24. package/dist/assets/generated/locales/sr.js.map +0 -1
  25. package/dist/assets/icons/iconGlyphs.js +0 -691
  26. package/dist/assets/icons/iconGlyphs.js.map +0 -1
  27. package/dist/assets/illustration/aichatbot-illustration.js +0 -144
  28. package/dist/assets/illustration/aichatbot-illustration.js.map +0 -1
  29. package/dist/assets/illustration/delete-illustration.js +0 -88
  30. package/dist/assets/illustration/delete-illustration.js.map +0 -1
  31. package/dist/assets/illustration/no-content.js +0 -159
  32. package/dist/assets/illustration/no-content.js.map +0 -1
  33. package/dist/assets/illustration/no-preview.js +0 -125
  34. package/dist/assets/illustration/no-preview.js.map +0 -1
  35. package/dist/assets/illustration/not-found.js +0 -98
  36. package/dist/assets/illustration/not-found.js.map +0 -1
  37. package/dist/assets/illustration/settings-illustration.js +0 -168
  38. package/dist/assets/illustration/settings-illustration.js.map +0 -1
  39. package/dist/components/components-settings/attachments-tab-settings.js +0 -318
  40. package/dist/components/components-settings/attachments-tab-settings.js.map +0 -1
  41. package/dist/components/components-settings/data-grid-settings.js +0 -553
  42. package/dist/components/components-settings/data-grid-settings.js.map +0 -1
  43. package/dist/components/components-settings/section-tab-settings.js +0 -719
  44. package/dist/components/components-settings/section-tab-settings.js.map +0 -1
  45. package/dist/components/components-settings/tabs-overview-settings.js +0 -421
  46. package/dist/components/components-settings/tabs-overview-settings.js.map +0 -1
  47. package/dist/components/index.js +0 -30
  48. package/dist/components/index.js.map +0 -1
  49. package/dist/components/lit-ai-filter-assistant.js +0 -443
  50. package/dist/components/lit-ai-filter-assistant.js.map +0 -1
  51. package/dist/components/lit-attachments-tab.js +0 -2044
  52. package/dist/components/lit-attachments-tab.js.map +0 -1
  53. package/dist/components/lit-badge.js +0 -124
  54. package/dist/components/lit-badge.js.map +0 -1
  55. package/dist/components/lit-case-variables-tab.js +0 -3718
  56. package/dist/components/lit-case-variables-tab.js.map +0 -1
  57. package/dist/components/lit-chart.js +0 -727
  58. package/dist/components/lit-chart.js.map +0 -1
  59. package/dist/components/lit-data-grid-tanstack.js +0 -2550
  60. package/dist/components/lit-data-grid-tanstack.js.map +0 -1
  61. package/dist/components/lit-filter-builder.js +0 -701
  62. package/dist/components/lit-filter-builder.js.map +0 -1
  63. package/dist/components/lit-filter-modal.js +0 -349
  64. package/dist/components/lit-filter-modal.js.map +0 -1
  65. package/dist/components/lit-multiselect-item.js +0 -707
  66. package/dist/components/lit-multiselect-item.js.map +0 -1
  67. package/dist/components/lit-section-tab.js +0 -268
  68. package/dist/components/lit-section-tab.js.map +0 -1
  69. package/dist/components/lit-tabs-overview.js +0 -356
  70. package/dist/components/lit-tabs-overview.js.map +0 -1
  71. package/dist/components/modals/lit-confirm-modal.js +0 -121
  72. package/dist/components/modals/lit-confirm-modal.js.map +0 -1
  73. package/dist/components/modals/lit-delete-modal.js +0 -131
  74. package/dist/components/modals/lit-delete-modal.js.map +0 -1
  75. package/dist/components/react-wrappers/ai-filter-assistant.js +0 -9
  76. package/dist/components/react-wrappers/ai-filter-assistant.js.map +0 -1
  77. package/dist/components/react-wrappers/attachments-tab.js +0 -9
  78. package/dist/components/react-wrappers/attachments-tab.js.map +0 -1
  79. package/dist/components/react-wrappers/badge.js +0 -9
  80. package/dist/components/react-wrappers/badge.js.map +0 -1
  81. package/dist/components/react-wrappers/button.js +0 -9
  82. package/dist/components/react-wrappers/button.js.map +0 -1
  83. package/dist/components/react-wrappers/calendar.js +0 -9
  84. package/dist/components/react-wrappers/calendar.js.map +0 -1
  85. package/dist/components/react-wrappers/case-variables-tab.js +0 -9
  86. package/dist/components/react-wrappers/case-variables-tab.js.map +0 -1
  87. package/dist/components/react-wrappers/chart.js +0 -9
  88. package/dist/components/react-wrappers/chart.js.map +0 -1
  89. package/dist/components/react-wrappers/data-grid-tanstack.js +0 -9
  90. package/dist/components/react-wrappers/data-grid-tanstack.js.map +0 -1
  91. package/dist/components/react-wrappers/filter-builder.js +0 -12
  92. package/dist/components/react-wrappers/filter-builder.js.map +0 -1
  93. package/dist/components/react-wrappers/filter-modal.js +0 -9
  94. package/dist/components/react-wrappers/filter-modal.js.map +0 -1
  95. package/dist/components/react-wrappers/index.js +0 -27
  96. package/dist/components/react-wrappers/index.js.map +0 -1
  97. package/dist/components/react-wrappers/progress-bar.js +0 -9
  98. package/dist/components/react-wrappers/progress-bar.js.map +0 -1
  99. package/dist/components/react-wrappers/section-tab.js +0 -9
  100. package/dist/components/react-wrappers/section-tab.js.map +0 -1
  101. package/dist/components/react-wrappers/tabs-overview.js +0 -9
  102. package/dist/components/react-wrappers/tabs-overview.js.map +0 -1
  103. package/dist/data/translations.js +0 -2768
  104. package/dist/data/translations.js.map +0 -1
  105. package/dist/index.js.map +0 -1
  106. package/dist/schemas/index.js +0 -18
  107. package/dist/schemas/index.js.map +0 -1
  108. package/dist/schemas/lit-attachments-tab-document.schema.js +0 -39
  109. package/dist/schemas/lit-attachments-tab-document.schema.js.map +0 -1
  110. package/dist/schemas/lit-attachments-tab-settings-value.schema.js +0 -30
  111. package/dist/schemas/lit-attachments-tab-settings-value.schema.js.map +0 -1
  112. package/dist/schemas/lit-attachments-tab.schema.js +0 -68
  113. package/dist/schemas/lit-attachments-tab.schema.js.map +0 -1
  114. package/dist/schemas/lit-case-variables-tab-cell.schema.js +0 -225
  115. package/dist/schemas/lit-case-variables-tab-cell.schema.js.map +0 -1
  116. package/dist/schemas/lit-case-variables-tab-rows.schema.js +0 -6
  117. package/dist/schemas/lit-case-variables-tab-rows.schema.js.map +0 -1
  118. package/dist/schemas/lit-case-variables-tab.schema.js +0 -27
  119. package/dist/schemas/lit-case-variables-tab.schema.js.map +0 -1
  120. package/dist/schemas/lit-data-grid-tanstack-column-array.schema.js +0 -6
  121. package/dist/schemas/lit-data-grid-tanstack-column-array.schema.js.map +0 -1
  122. package/dist/schemas/lit-data-grid-tanstack-column-custom-filter-array.schema.js +0 -6
  123. package/dist/schemas/lit-data-grid-tanstack-column-custom-filter-array.schema.js.map +0 -1
  124. package/dist/schemas/lit-data-grid-tanstack-column-custom-filter.schema.js +0 -11
  125. package/dist/schemas/lit-data-grid-tanstack-column-custom-filter.schema.js.map +0 -1
  126. package/dist/schemas/lit-data-grid-tanstack-column.schema.js +0 -79
  127. package/dist/schemas/lit-data-grid-tanstack-column.schema.js.map +0 -1
  128. package/dist/schemas/lit-data-grid-tanstack.schema.js +0 -108
  129. package/dist/schemas/lit-data-grid-tanstack.schema.js.map +0 -1
  130. package/dist/schemas/lit-filter-builder.schema.js +0 -61
  131. package/dist/schemas/lit-filter-builder.schema.js.map +0 -1
  132. package/dist/schemas/lit-section-tab-schema.js +0 -37
  133. package/dist/schemas/lit-section-tab-schema.js.map +0 -1
  134. package/dist/schemas/lit-tabs-overview-tab-array.schema.js +0 -6
  135. package/dist/schemas/lit-tabs-overview-tab-array.schema.js.map +0 -1
  136. package/dist/schemas/lit-tabs-overview-tab.schema.js +0 -32
  137. package/dist/schemas/lit-tabs-overview-tab.schema.js.map +0 -1
  138. package/dist/schemas/lit-tabs-overview.schema.js +0 -29
  139. package/dist/schemas/lit-tabs-overview.schema.js.map +0 -1
  140. package/dist/scripts/translate-locales.js +0 -241
  141. package/dist/scripts/translate-locales.js.map +0 -1
  142. package/dist/shared/filter-inputs.js +0 -429
  143. package/dist/shared/filter-inputs.js.map +0 -1
  144. package/dist/shared/index.js +0 -40
  145. package/dist/shared/index.js.map +0 -1
  146. package/dist/shared/lit-button.js +0 -159
  147. package/dist/shared/lit-button.js.map +0 -1
  148. package/dist/shared/lit-calendar.js +0 -485
  149. package/dist/shared/lit-calendar.js.map +0 -1
  150. package/dist/shared/lit-case-variables-tab-cell.js +0 -226
  151. package/dist/shared/lit-case-variables-tab-cell.js.map +0 -1
  152. package/dist/shared/lit-checkbox.js +0 -184
  153. package/dist/shared/lit-checkbox.js.map +0 -1
  154. package/dist/shared/lit-custom-popper.js +0 -116
  155. package/dist/shared/lit-custom-popper.js.map +0 -1
  156. package/dist/shared/lit-data-grid-action-buttons-popover.js +0 -295
  157. package/dist/shared/lit-data-grid-action-buttons-popover.js.map +0 -1
  158. package/dist/shared/lit-data-grid-density-popover.js +0 -84
  159. package/dist/shared/lit-data-grid-density-popover.js.map +0 -1
  160. package/dist/shared/lit-data-grid-export-popover.js +0 -68
  161. package/dist/shared/lit-data-grid-export-popover.js.map +0 -1
  162. package/dist/shared/lit-data-grid-operators-popover.js +0 -114
  163. package/dist/shared/lit-data-grid-operators-popover.js.map +0 -1
  164. package/dist/shared/lit-data-grid-row-actions.js +0 -87
  165. package/dist/shared/lit-data-grid-row-actions.js.map +0 -1
  166. package/dist/shared/lit-date-picker.js +0 -608
  167. package/dist/shared/lit-date-picker.js.map +0 -1
  168. package/dist/shared/lit-document-thumbnail.js +0 -383
  169. package/dist/shared/lit-document-thumbnail.js.map +0 -1
  170. package/dist/shared/lit-filter-input.js +0 -115
  171. package/dist/shared/lit-filter-input.js.map +0 -1
  172. package/dist/shared/lit-icon-button.js +0 -165
  173. package/dist/shared/lit-icon-button.js.map +0 -1
  174. package/dist/shared/lit-icon.js +0 -338
  175. package/dist/shared/lit-icon.js.map +0 -1
  176. package/dist/shared/lit-input.js +0 -282
  177. package/dist/shared/lit-input.js.map +0 -1
  178. package/dist/shared/lit-label.js +0 -103
  179. package/dist/shared/lit-label.js.map +0 -1
  180. package/dist/shared/lit-loader.js +0 -68
  181. package/dist/shared/lit-loader.js.map +0 -1
  182. package/dist/shared/lit-loading-bar.js +0 -91
  183. package/dist/shared/lit-loading-bar.js.map +0 -1
  184. package/dist/shared/lit-menu-item.js +0 -98
  185. package/dist/shared/lit-menu-item.js.map +0 -1
  186. package/dist/shared/lit-menu.js +0 -29
  187. package/dist/shared/lit-menu.js.map +0 -1
  188. package/dist/shared/lit-modal-body.js +0 -24
  189. package/dist/shared/lit-modal-body.js.map +0 -1
  190. package/dist/shared/lit-modal-footer.js +0 -21
  191. package/dist/shared/lit-modal-footer.js.map +0 -1
  192. package/dist/shared/lit-modal-header.js +0 -34
  193. package/dist/shared/lit-modal-header.js.map +0 -1
  194. package/dist/shared/lit-modal.js +0 -168
  195. package/dist/shared/lit-modal.js.map +0 -1
  196. package/dist/shared/lit-overflow-tooltip.js +0 -114
  197. package/dist/shared/lit-overflow-tooltip.js.map +0 -1
  198. package/dist/shared/lit-pill.js +0 -87
  199. package/dist/shared/lit-pill.js.map +0 -1
  200. package/dist/shared/lit-progress-bar.js +0 -130
  201. package/dist/shared/lit-progress-bar.js.map +0 -1
  202. package/dist/shared/lit-responsive-button.js +0 -106
  203. package/dist/shared/lit-responsive-button.js.map +0 -1
  204. package/dist/shared/lit-select-field.js +0 -457
  205. package/dist/shared/lit-select-field.js.map +0 -1
  206. package/dist/shared/lit-select.js +0 -668
  207. package/dist/shared/lit-select.js.map +0 -1
  208. package/dist/shared/lit-settings.js +0 -76
  209. package/dist/shared/lit-settings.js.map +0 -1
  210. package/dist/shared/lit-text-field.js +0 -252
  211. package/dist/shared/lit-text-field.js.map +0 -1
  212. package/dist/shared/lit-toggle.js +0 -240
  213. package/dist/shared/lit-toggle.js.map +0 -1
  214. package/dist/shared/lit-tooltip.js +0 -165
  215. package/dist/shared/lit-tooltip.js.map +0 -1
  216. package/dist/shared/simple-popper.js +0 -285
  217. package/dist/shared/simple-popper.js.map +0 -1
  218. package/dist/shared/simple-tooltip.js +0 -249
  219. package/dist/shared/simple-tooltip.js.map +0 -1
  220. package/dist/shared/styles/button-shared-styles.js +0 -494
  221. package/dist/shared/styles/button-shared-styles.js.map +0 -1
  222. package/dist/styles.js +0 -169
  223. package/dist/styles.js.map +0 -1
  224. package/dist/utils/custom-filters.js +0 -42
  225. package/dist/utils/custom-filters.js.map +0 -1
  226. package/dist/utils/date.js +0 -21
  227. package/dist/utils/date.js.map +0 -1
  228. package/dist/utils/file-type-utils.js +0 -55
  229. package/dist/utils/file-type-utils.js.map +0 -1
  230. package/dist/utils/formatNumber.js +0 -62
  231. package/dist/utils/formatNumber.js.map +0 -1
  232. package/dist/utils/getOperatorByType.js +0 -70
  233. package/dist/utils/getOperatorByType.js.map +0 -1
  234. package/dist/utils/getOverviewValue.js +0 -175
  235. package/dist/utils/getOverviewValue.js.map +0 -1
  236. package/dist/utils/localization.js +0 -433
  237. package/dist/utils/localization.js.map +0 -1
  238. package/dist/utils/pdf-thumbnail-generator.js +0 -91
  239. package/dist/utils/pdf-thumbnail-generator.js.map +0 -1
  240. package/dist/utils/utils.js +0 -94
  241. package/dist/utils/utils.js.map +0 -1
  242. package/dist/vite.svg +0 -1
@@ -1,719 +0,0 @@
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 { property, state } from 'lit/decorators.js';
8
- import { css, html, LitElement } from 'lit';
9
- import { IconArray } from '../../shared/lit-icon.js';
10
- import { msg } from '@lit/localize';
11
- import { setLocale, getLocale, LOCALE_LANGS } from '../../utils/localization.js';
12
- //components
13
- import '../../shared/lit-icon.js';
14
- import '../../shared/lit-input.js';
15
- import '../../shared/lit-select.js';
16
- import '../../shared/lit-toggle.js';
17
- import '../../shared/lit-select-field.js';
18
- import '../../shared/lit-text-field.js';
19
- import '../lit-filter-builder.js';
20
- import '../../shared/simple-popper.js';
21
- import '../lit-tabs-overview.js';
22
- import '../../assets/illustration/not-found.js';
23
- import '../../assets/illustration/settings-illustration.js';
24
- import '../../shared/lit-menu.js';
25
- import '../../shared/lit-menu-item.js';
26
- import '../../shared/lit-button.js';
27
- import '../../shared/lit-icon-button.js';
28
- import '../../shared/lit-text-field.js';
29
- import '../../shared/lit-modal.js';
30
- import '../../shared/lit-checkbox.js';
31
- import '../../shared/lit-modal-header.js';
32
- import '../../shared/lit-modal-footer.js';
33
- import '../../shared/lit-modal-body.js';
34
- import '../../shared/lit-label.js';
35
- function generateShortId() {
36
- return Math.random().toString(36).substring(2, 8);
37
- }
38
- export class SectionTabSettings extends LitElement {
39
- constructor() {
40
- super(...arguments);
41
- this.onSettingsChangedModal = (settingsValue) => { };
42
- this.showAutomaticHeightOptionInSettings = true;
43
- this.aiLoading = false;
44
- this.allowedLang = ['cs'];
45
- this.variables = [];
46
- this.userLang = 'cs';
47
- this.isOpen = false;
48
- this.showHideCondition = false;
49
- this.filterText = '';
50
- this.isOpenModal = false;
51
- this.filterData = {
52
- fields: [],
53
- operators: [],
54
- filterGroups: [
55
- {
56
- id: generateShortId(),
57
- logicOperator: 'AND',
58
- conditions: [{ id: generateShortId(), field: '', operator: '=', value: '' }],
59
- },
60
- ],
61
- groupLogicOperator: 'AND',
62
- };
63
- this.activeTab = 'general';
64
- this._onFilterChange = (event) => {
65
- const { filterGroups, groupLogicOperator } = event.detail;
66
- // Update filter data with multi-group structure (fields removed)
67
- this.filterData = {
68
- filterGroups: filterGroups || [],
69
- groupLogicOperator: groupLogicOperator || 'AND',
70
- };
71
- // Update cached data
72
- this.cachedFilterBuilderData = this.filterData;
73
- // Store the full multi-group structure
74
- if (this.filterData.filterGroups.length &&
75
- this.filterData.filterGroups.some((group) => group.conditions.length && group.conditions[0].field)) {
76
- this.updateLocalSettings({ hideTabWhen: this.filterData });
77
- }
78
- else {
79
- this.updateLocalSettings({ hideTabWhen: undefined });
80
- }
81
- };
82
- }
83
- getLocaleLang() {
84
- if (this.userLang && LOCALE_LANGS.has(this.userLang)) {
85
- return this.userLang;
86
- }
87
- return 'cs';
88
- }
89
- connectedCallback() {
90
- super.connectedCallback();
91
- this._updateCachedFilterBuilderData();
92
- }
93
- willUpdate(changedProperties) {
94
- if (changedProperties.has('userLang')) {
95
- const localeLang = this.getLocaleLang();
96
- if (getLocale() !== localeLang) {
97
- setLocale(localeLang).then(() => this.requestUpdate());
98
- }
99
- }
100
- if (changedProperties.has('settingsValue')) {
101
- this.localSettingsValue = this.settingsValue ? { ...this.settingsValue } : {};
102
- // Initialize filter data from existing condition
103
- const hideTabWhen = this.localSettingsValue?.hideTabWhen;
104
- if (hideTabWhen && typeof hideTabWhen === 'object') {
105
- // Check if it's already in multi-group format
106
- if ('filterGroups' in hideTabWhen && 'groupLogicOperator' in hideTabWhen) {
107
- this.filterData = hideTabWhen;
108
- this.showHideCondition = true;
109
- }
110
- else if ('logicOperator' in hideTabWhen && 'conditions' in hideTabWhen) {
111
- // Convert from legacy single-group format
112
- this.filterData = {
113
- fields: [],
114
- operators: [],
115
- filterGroups: [hideTabWhen],
116
- groupLogicOperator: 'AND',
117
- };
118
- this.showHideCondition = true;
119
- }
120
- }
121
- else if (typeof hideTabWhen === 'boolean' && hideTabWhen) {
122
- this.showHideCondition = true;
123
- // Initialize with default filter data when boolean is true
124
- const defaultField = this.variables.length > 0 ? this.variables[0].field : '';
125
- this.filterData = {
126
- fields: [],
127
- operators: [],
128
- filterGroups: [
129
- {
130
- id: generateShortId(),
131
- logicOperator: 'AND',
132
- conditions: [
133
- {
134
- id: generateShortId(),
135
- field: defaultField,
136
- operator: '=',
137
- value: '',
138
- },
139
- ],
140
- },
141
- ],
142
- groupLogicOperator: 'AND',
143
- };
144
- }
145
- else {
146
- this.showHideCondition = false;
147
- }
148
- }
149
- // Update cached data if variables or filterData changed
150
- if (changedProperties.has('variables') || changedProperties.has('filterData')) {
151
- this._updateCachedFilterBuilderData();
152
- }
153
- }
154
- trySendSettingsUpdate() {
155
- this.onSettingsChangedModal?.(this.localSettingsValue);
156
- if (this.onClose) {
157
- this.onClose();
158
- }
159
- }
160
- _getFilterFieldsFromVariables() {
161
- return this.variables.map((variable) => {
162
- const variableType = variable.type;
163
- // Get localized header name or fall back to default headerName or field
164
- const headerNameKey = `headerName_${this.userLang}`;
165
- const displayName = variable[headerNameKey] || variable.headerName || variable.field;
166
- return {
167
- value: variable.field,
168
- label: `${displayName} (${variable.field})`,
169
- type: variableType === 'string'
170
- ? 'string'
171
- : variableType === 'number' || variableType === 'currency'
172
- ? 'number'
173
- : variableType === 'date'
174
- ? 'date'
175
- : variableType === 'select'
176
- ? 'select'
177
- : 'string',
178
- valueOptions: variableType === 'select' && variable.valueOptions
179
- ? variable.valueOptions.map((opt) => ({
180
- value: String(opt.value ?? ''),
181
- label: opt.label,
182
- }))
183
- : undefined,
184
- };
185
- });
186
- }
187
- _getTabDefinitions() {
188
- return [
189
- {
190
- id: 'general',
191
- label: {
192
- default: msg('Obecná nastavení'),
193
- },
194
- icon: 'administration',
195
- },
196
- {
197
- id: 'hideWhen',
198
- label: {
199
- default: msg('Skrýt sekci když'),
200
- },
201
- icon: 'hide',
202
- },
203
- ];
204
- }
205
- updateLocalSettings(updates) {
206
- this.localSettingsValue = {
207
- ...this.localSettingsValue,
208
- ...updates,
209
- };
210
- }
211
- closePopover() {
212
- this.isOpen = false;
213
- }
214
- toggleCustomPopover() {
215
- this.isOpen = !this.isOpen;
216
- }
217
- discardChanges() {
218
- this.localSettingsValue = this.settingsValue ? { ...this.settingsValue } : {};
219
- // Reset the condition builder state to match the original settingsValue
220
- this._resetConditionBuilderState();
221
- if (this.onClose) {
222
- this.onClose();
223
- }
224
- }
225
- _resetConditionBuilderState() {
226
- const hideTabWhen = this.settingsValue?.hideTabWhen;
227
- if (hideTabWhen && typeof hideTabWhen === 'object') {
228
- // Check if it's already in multi-group format
229
- if ('filterGroups' in hideTabWhen && 'groupLogicOperator' in hideTabWhen) {
230
- this.filterData = hideTabWhen;
231
- this.showHideCondition = true;
232
- }
233
- else if ('logicOperator' in hideTabWhen && 'conditions' in hideTabWhen) {
234
- // Convert from legacy single-group format
235
- this.filterData = {
236
- filterGroups: [hideTabWhen],
237
- groupLogicOperator: 'AND',
238
- };
239
- this.showHideCondition = true;
240
- }
241
- else {
242
- // Initialize with default filter data from first variable if available
243
- const defaultField = this.variables.length > 0 ? this.variables[0].field : '';
244
- this.filterData = {
245
- filterGroups: [
246
- {
247
- id: generateShortId(),
248
- logicOperator: 'AND',
249
- conditions: [
250
- {
251
- id: generateShortId(),
252
- field: defaultField,
253
- operator: '=',
254
- value: '',
255
- },
256
- ],
257
- },
258
- ],
259
- groupLogicOperator: 'AND',
260
- };
261
- this.showHideCondition = true;
262
- }
263
- }
264
- else if (typeof hideTabWhen === 'boolean' && hideTabWhen) {
265
- this.showHideCondition = true;
266
- // Reset to default filter data for boolean conditions
267
- const defaultField = this.variables.length > 0 ? this.variables[0].field : '';
268
- this.filterData = {
269
- filterGroups: [
270
- {
271
- id: generateShortId(),
272
- logicOperator: 'AND',
273
- conditions: [
274
- {
275
- id: generateShortId(),
276
- field: defaultField,
277
- operator: '=',
278
- value: '',
279
- },
280
- ],
281
- },
282
- ],
283
- groupLogicOperator: 'AND',
284
- };
285
- }
286
- else {
287
- this.showHideCondition = false;
288
- // Reset to default filter data
289
- const defaultField = this.variables.length > 0 ? this.variables[0].field : '';
290
- this.filterData = {
291
- filterGroups: [
292
- {
293
- id: generateShortId(),
294
- logicOperator: 'AND',
295
- conditions: [
296
- {
297
- id: generateShortId(),
298
- field: defaultField,
299
- operator: '=',
300
- value: '',
301
- },
302
- ],
303
- },
304
- ],
305
- groupLogicOperator: 'AND',
306
- };
307
- }
308
- }
309
- _renderHideWhenControl() {
310
- const hideTabWhen = this.localSettingsValue?.hideTabWhen;
311
- const hasCondition = hideTabWhen &&
312
- typeof hideTabWhen === 'object' &&
313
- (('variable' in hideTabWhen && hideTabWhen.variable) ||
314
- ('filterGroups' in hideTabWhen &&
315
- hideTabWhen.filterGroups &&
316
- hideTabWhen.filterGroups.length > 0));
317
- return html `
318
- <div class="hide-when-control">
319
- <div class="hide-when-header">
320
- <lit-toggle
321
- .label="${msg('Skrýt sekci při splnění podmínky')}"
322
- .checked="${hasCondition || this.showHideCondition}"
323
- @change="${(e) => this._toggleCondition(e.detail)}"
324
- ></lit-toggle>
325
- </div>
326
-
327
- ${this.showHideCondition
328
- ? (() => {
329
- const filterData = this._convertToFilterBuilderData();
330
- const fields = this._getFilterFieldsFromVariables();
331
- return html `
332
- <lit-filter-builder
333
- id="section-filter-builder"
334
- .data="${filterData}"
335
- .fields="${fields}"
336
- .disabled="${false}"
337
- .locale="${this.userLang}"
338
- @filter-change="${this._onFilterChange}"
339
- ></lit-filter-builder>
340
- `;
341
- })()
342
- : ''}
343
- </div>
344
- `;
345
- }
346
- _toggleCondition(enabled) {
347
- if (enabled) {
348
- this.showHideCondition = true;
349
- // Only initialize new filter data if no existing data is present
350
- if (!this.filterData.filterGroups?.length ||
351
- !this.filterData.filterGroups[0]?.conditions?.length ||
352
- !this.filterData.filterGroups[0]?.conditions[0]?.field) {
353
- // Initialize filter data with first variable if available
354
- if (this.variables.length > 0) {
355
- const defaultItem = {
356
- id: generateShortId(),
357
- field: this.variables[0].field,
358
- operator: '=',
359
- value: '',
360
- };
361
- this.filterData = {
362
- filterGroups: [
363
- {
364
- id: generateShortId(),
365
- logicOperator: 'AND',
366
- conditions: [defaultItem],
367
- },
368
- ],
369
- groupLogicOperator: 'AND',
370
- };
371
- }
372
- }
373
- // Save the existing or newly created filter data
374
- this.updateLocalSettings({ hideTabWhen: this.filterData });
375
- }
376
- else {
377
- this.showHideCondition = false;
378
- this._clearCondition();
379
- }
380
- }
381
- _clearCondition() {
382
- this.updateLocalSettings({ hideTabWhen: undefined });
383
- }
384
- _updateCachedFilterBuilderData() {
385
- // Use the current filterData structure directly (fields are now separate)
386
- this.cachedFilterBuilderData = {
387
- filterGroups: this.filterData.filterGroups || [
388
- {
389
- id: 'section-filter-group',
390
- logicOperator: 'AND',
391
- conditions: [],
392
- },
393
- ],
394
- groupLogicOperator: this.filterData.groupLogicOperator || 'AND',
395
- };
396
- }
397
- _convertToFilterBuilderData() {
398
- if (!this.cachedFilterBuilderData) {
399
- this._updateCachedFilterBuilderData();
400
- }
401
- return this.cachedFilterBuilderData;
402
- }
403
- _renderGeneralSettings() {
404
- const filteredKeys = (IconArray || []).filter((key) => key.toLowerCase().includes(this.filterText));
405
- return html `
406
- <div class="tab-content">
407
- ${this.showAutomaticHeightOptionInSettings
408
- ? html `
409
- <lit-toggle
410
- .label="${msg('Automatická výška sekce')}"
411
- .tooltip="${msg('Sekce se automaticky přizpůsobí výšce obsahu')}"
412
- .checked=${this.localSettingsValue?.[`autoHeight`] ?? false}
413
- @change=${(e) => {
414
- this.updateLocalSettings({ autoHeight: e.detail });
415
- }}
416
- ></lit-toggle>
417
- `
418
- : ''}
419
- <lit-toggle
420
- .label="${msg('Zobrazit ikonu v názvu sekce')}"
421
- .checked=${this.localSettingsValue?.showTitleIcon !== false}
422
- @change=${(e) => {
423
- this.updateLocalSettings({ showTitleIcon: e.detail });
424
- }}
425
- ></lit-toggle>
426
-
427
- ${this.localSettingsValue?.showTitleIcon !== false
428
- ? html `
429
- <div style="display: flex; align-items: center; gap: 1rem;">
430
- <lit-label label=${msg('Icona Sekce')}></lit-label>
431
- <lit-icon-button
432
- color="secondary"
433
- variant="dashed"
434
- size="medium"
435
- .icon="${this.localSettingsValue?.titleIcon || 'documents'}"
436
- @click="${this.toggleCustomPopover}"
437
- ></lit-icon-button>
438
- </div>
439
-
440
- <simple-popper
441
- .showing=${this.isOpen}
442
- .placement=${'bottom-start'}
443
- .onClose=${this.closePopover.bind(this)}
444
- .manualOpening=${true}
445
- >
446
- <style>
447
- .icon-menu {
448
- display: flex;
449
- flex-wrap: wrap;
450
- gap: 0.5rem;
451
- padding: 0.5rem;
452
- }
453
- .icon-select-item {
454
- cursor: pointer;
455
- width: 2.5rem;
456
- height: 2.5rem;
457
- display: flex;
458
- align-items: center;
459
- justify-content: center;
460
- border-radius: var(--border-radius-small, 4px);
461
- transition: background 0.15s;
462
- }
463
- .icon-select-item:hover {
464
- background-color: var(--color-primary-light, #e0e7ff);
465
- }
466
- </style>
467
- <div
468
- style="max-height: 12.5rem; height: 12.5rem; overflow-y: auto; width: 500px; max-width: 100%;"
469
- >
470
- <div class="popper-input">
471
- <lit-input
472
- .value=${this.filterText}
473
- .onInput=${(value) => {
474
- this.filterText = value?.toLowerCase?.() || '';
475
- }}
476
- .onClear=${() => {
477
- this.filterText = '';
478
- }}
479
- placeholder="${msg('Zadejte název ikony')}"
480
- ></lit-input>
481
- </div>
482
-
483
- <div class="icon-menu">
484
- ${filteredKeys.map((key) => html `
485
- <div
486
- class="icon-select-item"
487
- @click=${() => {
488
- this.updateLocalSettings({
489
- titleIcon: key,
490
- });
491
- this.closePopover();
492
- }}
493
- .isActive=${this.localSettingsValue?.titleIcon === key}
494
- >
495
- <lit-icon size="1rem" icon="${key}"></lit-icon>
496
- </div>
497
- `)}
498
- </div>
499
- </div>
500
- </simple-popper>
501
- `
502
- : ''}
503
- <div style="margin-top: 1rem; display: flex; flex-direction: column; gap: 1rem;">
504
- <lit-text-field
505
- .aiEnabled=${typeof this.onAiFunction === 'function'}
506
- .label="${msg('Název sekce')}"
507
- .value=${this.localSettingsValue?.titleLabel || ''}
508
- .placeholder="${msg('Zadejte název sekce')}"
509
- @onChange="${(e) => {
510
- this.updateLocalSettings({ titleLabel: e.detail });
511
- }}"
512
- .onClickAiIcon="${(currentValue) => {
513
- if (typeof this.onAiFunction === 'function') {
514
- this.onAiFunction(currentValue);
515
- }
516
- }}"
517
- .aiLoading=${this.aiLoading}
518
- ></lit-text-field>
519
-
520
- ${(this.allowedLang || []).map((lang) => html `
521
- <lit-text-field
522
- .label=${`${msg('Název sekce')} ${lang.toUpperCase()}`}
523
- .placeholder=${`${msg('Zadejte název')} ${lang.toUpperCase()}`}
524
- .value=${this.localSettingsValue?.[`titleLabel_${lang}`] || ''}
525
- @onChange=${(e) => {
526
- this.updateLocalSettings({
527
- [`titleLabel_${lang}`]: e.detail,
528
- });
529
- }}
530
- ></lit-text-field>
531
- `)}
532
- </div>
533
- </div>
534
- `;
535
- }
536
- render() {
537
- return html `
538
- <lit-modal
539
- .open=${this.isOpenModal}
540
- .onClose=${() => {
541
- this.discardChanges();
542
- }}
543
- .closeOnOutsideClick=${false}
544
- .fullScreen=${window.innerWidth <=
545
- (parseInt(getComputedStyle(document.documentElement).getPropertyValue('--breakpoint-sm')) || 600)}
546
- style="min-width: 60vw;"
547
- >
548
- <lit-modal-header
549
- style="display: flex; align-items: center; justify-content: space-between; color: var(--text-secondary, #777);"
550
- >
551
- ${msg('Konfigurace') + ' - ' + (this.localSettingsValue?.[`titleLabel_${this.userLang}`] || this.localSettingsValue?.titleLabel || msg('SectionTab'))}
552
- <lit-icon-button
553
- .icon="${'close'}"
554
- variant="text"
555
- color="secondary"
556
- size="${'small'}"
557
- @click=${() => this.discardChanges()}
558
- ></lit-icon-button>
559
- </lit-modal-header>
560
- <lit-modal-body>
561
- <div style="display: flex; flex-direction: column; gap: 0.5rem">
562
- <div class="settings-tabs">
563
- <lit-tabs-overview
564
- .tabs="${this._getTabDefinitions()}"
565
- .initialSelectedTabId="${this.activeTab}"
566
- .userLang="${this.userLang}"
567
- .allowedLang="${this.allowedLang}"
568
- >
569
- <div slot="general">${this._renderGeneralSettings()}</div>
570
- <div slot="hideWhen">${this._renderHideWhenControl()}</div>
571
- </lit-tabs-overview>
572
- </div>
573
- </div>
574
- </lit-modal-body>
575
- <lit-modal-footer
576
- style=" display: flex;
577
- flex-direction: row;
578
- gap: 0.5rem;
579
- justify-content: center;"
580
- >
581
- <lit-button
582
- .label="${msg('Uložit')}"
583
- .icon="check"
584
- .size="medium"
585
- @click=${() => this.trySendSettingsUpdate()}
586
- ></lit-button>
587
- <lit-button
588
- color="secondary"
589
- .label="${msg('Zrušit')}"
590
- variant="text"
591
- .icon="close"
592
- .size="medium"
593
- @click=${() => this.discardChanges()}
594
- ></lit-button>
595
- </lit-modal-footer>
596
- </lit-modal>
597
- `;
598
- }
599
- }
600
- SectionTabSettings.styles = [
601
- css `
602
- .hide-when-control {
603
- padding: 12px;
604
- border: 1px solid var(--color-divider, #d0d3db);
605
- border-radius: 4px;
606
- background: var(--background-paper, #fff);
607
- margin-top: 8px;
608
- }
609
-
610
- .hide-when-header {
611
- display: flex;
612
- align-items: center;
613
- gap: 8px;
614
- margin-bottom: 8px;
615
- }
616
-
617
- .condition-builder {
618
- display: flex !important;
619
- flex-direction: row !important;
620
- gap: 8px;
621
- align-items: flex-end !important;
622
- margin-top: 8px;
623
- width: 100%;
624
- }
625
-
626
- .condition-builder.hidden {
627
- display: none;
628
- }
629
-
630
- .condition-preview {
631
- width: 100%;
632
- font-size: 12px;
633
- color: var(--text-secondary, #777);
634
- padding: 4px 8px;
635
- background: var(--color-primary-light, #f0f0f0);
636
- border-radius: 4px;
637
- margin-top: 8px;
638
- }
639
-
640
- .clear-condition-button {
641
- color: var(--color-warning, #ff9500);
642
- }
643
-
644
- .popper-input {
645
- margin-bottom: 0.5rem;
646
- position: sticky;
647
- top: 0;
648
- background-color: var(--background-paper, #fff);
649
- z-index: 1;
650
- }
651
-
652
- /* Tab content styles */
653
- .tab-content {
654
- padding: 1rem;
655
- height: calc(100% - 3rem);
656
- overflow-y: auto;
657
- background-color: var(--background-paper, #fff);
658
- }
659
-
660
- .settings-tabs {
661
- height: 400px;
662
- }
663
- `,
664
- ];
665
- __decorate([
666
- property({ type: Object })
667
- ], SectionTabSettings.prototype, "settingsValue", void 0);
668
- __decorate([
669
- property({ type: Function })
670
- ], SectionTabSettings.prototype, "onSettingsChangedModal", void 0);
671
- __decorate([
672
- property({ type: Boolean })
673
- ], SectionTabSettings.prototype, "showAutomaticHeightOptionInSettings", void 0);
674
- __decorate([
675
- property({ type: Boolean })
676
- ], SectionTabSettings.prototype, "aiLoading", void 0);
677
- __decorate([
678
- property({ type: Array })
679
- ], SectionTabSettings.prototype, "allowedLang", void 0);
680
- __decorate([
681
- property({ type: Array })
682
- ], SectionTabSettings.prototype, "variables", void 0);
683
- __decorate([
684
- property({ type: Function })
685
- ], SectionTabSettings.prototype, "onClose", void 0);
686
- __decorate([
687
- property({ type: String })
688
- ], SectionTabSettings.prototype, "userLang", void 0);
689
- __decorate([
690
- property({ type: Function })
691
- ], SectionTabSettings.prototype, "onAiFunction", void 0);
692
- __decorate([
693
- state()
694
- ], SectionTabSettings.prototype, "isOpen", void 0);
695
- __decorate([
696
- state()
697
- ], SectionTabSettings.prototype, "showHideCondition", void 0);
698
- __decorate([
699
- state()
700
- ], SectionTabSettings.prototype, "filterText", void 0);
701
- __decorate([
702
- state()
703
- ], SectionTabSettings.prototype, "localSettingsValue", void 0);
704
- __decorate([
705
- state()
706
- ], SectionTabSettings.prototype, "isOpenModal", void 0);
707
- __decorate([
708
- state()
709
- ], SectionTabSettings.prototype, "filterData", void 0);
710
- __decorate([
711
- state()
712
- ], SectionTabSettings.prototype, "activeTab", void 0);
713
- __decorate([
714
- state()
715
- ], SectionTabSettings.prototype, "cachedFilterBuilderData", void 0);
716
- if (!window.customElements.get('section-tab-settings')) {
717
- window.customElements.define('section-tab-settings', SectionTabSettings);
718
- }
719
- //# sourceMappingURL=section-tab-settings.js.map