overview-components 1.1.42 → 1.1.43

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 (164) hide show
  1. package/dist/assets/illustration/delete-illustration.js +16 -16
  2. package/dist/components/components-settings/attachments-tab-settings.d.ts.map +1 -1
  3. package/dist/components/components-settings/attachments-tab-settings.js +5 -3
  4. package/dist/components/components-settings/attachments-tab-settings.js.map +1 -1
  5. package/dist/components/components-settings/data-grid-settings.d.ts +31 -2
  6. package/dist/components/components-settings/data-grid-settings.d.ts.map +1 -1
  7. package/dist/components/components-settings/data-grid-settings.js +279 -147
  8. package/dist/components/components-settings/data-grid-settings.js.map +1 -1
  9. package/dist/components/components-settings/section-tab-settings.d.ts +28 -1
  10. package/dist/components/components-settings/section-tab-settings.d.ts.map +1 -1
  11. package/dist/components/components-settings/section-tab-settings.js +439 -125
  12. package/dist/components/components-settings/section-tab-settings.js.map +1 -1
  13. package/dist/components/components-settings/tabs-overview-settings.d.ts.map +1 -1
  14. package/dist/components/components-settings/tabs-overview-settings.js +7 -15
  15. package/dist/components/components-settings/tabs-overview-settings.js.map +1 -1
  16. package/dist/components/index.d.ts +2 -0
  17. package/dist/components/index.d.ts.map +1 -1
  18. package/dist/components/index.js +2 -0
  19. package/dist/components/index.js.map +1 -1
  20. package/dist/components/lit-ai-filter-assistant.d.ts.map +1 -1
  21. package/dist/components/lit-ai-filter-assistant.js +3 -0
  22. package/dist/components/lit-ai-filter-assistant.js.map +1 -1
  23. package/dist/components/lit-attachments-tab.d.ts +1 -0
  24. package/dist/components/lit-attachments-tab.d.ts.map +1 -1
  25. package/dist/components/lit-attachments-tab.js +14 -2
  26. package/dist/components/lit-attachments-tab.js.map +1 -1
  27. package/dist/components/lit-case-variables-tab.d.ts +61 -3
  28. package/dist/components/lit-case-variables-tab.d.ts.map +1 -1
  29. package/dist/components/lit-case-variables-tab.js +1443 -87
  30. package/dist/components/lit-case-variables-tab.js.map +1 -1
  31. package/dist/components/lit-data-grid-tanstack.d.ts +3 -14
  32. package/dist/components/lit-data-grid-tanstack.d.ts.map +1 -1
  33. package/dist/components/lit-data-grid-tanstack.js +19 -7
  34. package/dist/components/lit-data-grid-tanstack.js.map +1 -1
  35. package/dist/components/lit-filter-builder.d.ts +67 -0
  36. package/dist/components/lit-filter-builder.d.ts.map +1 -0
  37. package/dist/components/lit-filter-builder.js +446 -0
  38. package/dist/components/lit-filter-builder.js.map +1 -0
  39. package/dist/components/lit-filter-modal.d.ts +1 -1
  40. package/dist/components/lit-filter-modal.d.ts.map +1 -1
  41. package/dist/components/lit-filter-modal.js +7 -1
  42. package/dist/components/lit-filter-modal.js.map +1 -1
  43. package/dist/components/lit-multiselect-item.d.ts.map +1 -1
  44. package/dist/components/lit-multiselect-item.js +4 -2
  45. package/dist/components/lit-multiselect-item.js.map +1 -1
  46. package/dist/components/lit-section-tab.d.ts +12 -0
  47. package/dist/components/lit-section-tab.d.ts.map +1 -1
  48. package/dist/components/lit-section-tab.js +89 -0
  49. package/dist/components/lit-section-tab.js.map +1 -1
  50. package/dist/components/lit-tabs-overview.d.ts.map +1 -1
  51. package/dist/components/lit-tabs-overview.js +10 -6
  52. package/dist/components/lit-tabs-overview.js.map +1 -1
  53. package/dist/components/modals/lit-confirm-modal.d.ts.map +1 -1
  54. package/dist/components/modals/lit-confirm-modal.js +4 -2
  55. package/dist/components/modals/lit-confirm-modal.js.map +1 -1
  56. package/dist/components/modals/lit-delete-modal.d.ts.map +1 -1
  57. package/dist/components/modals/lit-delete-modal.js +11 -7
  58. package/dist/components/modals/lit-delete-modal.js.map +1 -1
  59. package/dist/components/react-wrappers/filter-builder.d.ts +5 -0
  60. package/dist/components/react-wrappers/filter-builder.d.ts.map +1 -0
  61. package/dist/components/react-wrappers/filter-builder.js +12 -0
  62. package/dist/components/react-wrappers/filter-builder.js.map +1 -0
  63. package/dist/components/react-wrappers/index.d.ts +2 -0
  64. package/dist/components/react-wrappers/index.d.ts.map +1 -1
  65. package/dist/components/react-wrappers/index.js +2 -0
  66. package/dist/components/react-wrappers/index.js.map +1 -1
  67. package/dist/schemas/index.d.ts +2 -1
  68. package/dist/schemas/index.d.ts.map +1 -1
  69. package/dist/schemas/index.js +2 -1
  70. package/dist/schemas/index.js.map +1 -1
  71. package/dist/schemas/lit-attachments-tab-document.schema.d.ts +6 -0
  72. package/dist/schemas/lit-attachments-tab-document.schema.d.ts.map +1 -1
  73. package/dist/schemas/lit-attachments-tab-document.schema.js +6 -0
  74. package/dist/schemas/lit-attachments-tab-document.schema.js.map +1 -1
  75. package/dist/schemas/lit-attachments-tab.schema.d.ts +6 -0
  76. package/dist/schemas/lit-attachments-tab.schema.d.ts.map +1 -1
  77. package/dist/schemas/lit-case-variables-tab-cell.schema.d.ts +81 -0
  78. package/dist/schemas/lit-case-variables-tab-cell.schema.d.ts.map +1 -1
  79. package/dist/schemas/lit-case-variables-tab-cell.schema.js +60 -1
  80. package/dist/schemas/lit-case-variables-tab-cell.schema.js.map +1 -1
  81. package/dist/schemas/lit-case-variables-tab-rows.schema.d.ts +81 -0
  82. package/dist/schemas/lit-case-variables-tab-rows.schema.d.ts.map +1 -1
  83. package/dist/schemas/lit-case-variables-tab.schema.d.ts +81 -0
  84. package/dist/schemas/lit-case-variables-tab.schema.d.ts.map +1 -1
  85. package/dist/schemas/lit-data-grid-tanstack.schema.d.ts +39 -1
  86. package/dist/schemas/lit-data-grid-tanstack.schema.d.ts.map +1 -1
  87. package/dist/schemas/lit-data-grid-tanstack.schema.js +2 -1
  88. package/dist/schemas/lit-data-grid-tanstack.schema.js.map +1 -1
  89. package/dist/schemas/lit-filter-builder.schema.d.ts +67 -0
  90. package/dist/schemas/lit-filter-builder.schema.d.ts.map +1 -0
  91. package/dist/schemas/lit-filter-builder.schema.js +49 -0
  92. package/dist/schemas/lit-filter-builder.schema.js.map +1 -0
  93. package/dist/schemas/lit-section-tab-schema.d.ts +45 -0
  94. package/dist/schemas/lit-section-tab-schema.d.ts.map +1 -1
  95. package/dist/schemas/lit-section-tab-schema.js +7 -0
  96. package/dist/schemas/lit-section-tab-schema.js.map +1 -1
  97. package/dist/shared/lit-button.d.ts +3 -1
  98. package/dist/shared/lit-button.d.ts.map +1 -1
  99. package/dist/shared/lit-button.js +6 -2
  100. package/dist/shared/lit-button.js.map +1 -1
  101. package/dist/shared/lit-checkbox.d.ts +1 -0
  102. package/dist/shared/lit-checkbox.d.ts.map +1 -1
  103. package/dist/shared/lit-checkbox.js +5 -0
  104. package/dist/shared/lit-checkbox.js.map +1 -1
  105. package/dist/shared/lit-data-grid-action-buttons-popover.d.ts.map +1 -1
  106. package/dist/shared/lit-data-grid-action-buttons-popover.js +1 -0
  107. package/dist/shared/lit-data-grid-action-buttons-popover.js.map +1 -1
  108. package/dist/shared/lit-data-grid-density-popover.d.ts.map +1 -1
  109. package/dist/shared/lit-data-grid-density-popover.js +1 -0
  110. package/dist/shared/lit-data-grid-density-popover.js.map +1 -1
  111. package/dist/shared/lit-data-grid-export-popover.d.ts.map +1 -1
  112. package/dist/shared/lit-data-grid-export-popover.js +1 -0
  113. package/dist/shared/lit-data-grid-export-popover.js.map +1 -1
  114. package/dist/shared/lit-data-grid-operators-popover.d.ts +3 -3
  115. package/dist/shared/lit-data-grid-operators-popover.d.ts.map +1 -1
  116. package/dist/shared/lit-data-grid-operators-popover.js +1 -0
  117. package/dist/shared/lit-data-grid-operators-popover.js.map +1 -1
  118. package/dist/shared/lit-data-grid-row-actions.d.ts.map +1 -1
  119. package/dist/shared/lit-data-grid-row-actions.js +2 -0
  120. package/dist/shared/lit-data-grid-row-actions.js.map +1 -1
  121. package/dist/shared/lit-date-picker.d.ts +1 -1
  122. package/dist/shared/lit-date-picker.d.ts.map +1 -1
  123. package/dist/shared/lit-date-picker.js +2 -0
  124. package/dist/shared/lit-date-picker.js.map +1 -1
  125. package/dist/shared/lit-icon-button.d.ts +7 -3
  126. package/dist/shared/lit-icon-button.d.ts.map +1 -1
  127. package/dist/shared/lit-icon-button.js +6 -2
  128. package/dist/shared/lit-icon-button.js.map +1 -1
  129. package/dist/shared/lit-input.d.ts +3 -1
  130. package/dist/shared/lit-input.d.ts.map +1 -1
  131. package/dist/shared/lit-input.js +35 -28
  132. package/dist/shared/lit-input.js.map +1 -1
  133. package/dist/shared/lit-modal-body.js +1 -1
  134. package/dist/shared/lit-modal-footer.js +1 -1
  135. package/dist/shared/lit-modal-header.d.ts.map +1 -1
  136. package/dist/shared/lit-modal-header.js +1 -2
  137. package/dist/shared/lit-modal-header.js.map +1 -1
  138. package/dist/shared/lit-progress-bar.d.ts +2 -0
  139. package/dist/shared/lit-progress-bar.d.ts.map +1 -1
  140. package/dist/shared/lit-progress-bar.js +57 -7
  141. package/dist/shared/lit-progress-bar.js.map +1 -1
  142. package/dist/shared/lit-responsive-button.d.ts +17 -2
  143. package/dist/shared/lit-responsive-button.d.ts.map +1 -1
  144. package/dist/shared/lit-responsive-button.js +8 -0
  145. package/dist/shared/lit-responsive-button.js.map +1 -1
  146. package/dist/shared/lit-select-field.d.ts.map +1 -1
  147. package/dist/shared/lit-select-field.js +1 -2
  148. package/dist/shared/lit-select-field.js.map +1 -1
  149. package/dist/shared/lit-select.d.ts +5 -1
  150. package/dist/shared/lit-select.d.ts.map +1 -1
  151. package/dist/shared/lit-select.js +218 -6
  152. package/dist/shared/lit-select.js.map +1 -1
  153. package/dist/shared/lit-text-field.d.ts +2 -0
  154. package/dist/shared/lit-text-field.d.ts.map +1 -1
  155. package/dist/shared/lit-text-field.js +27 -10
  156. package/dist/shared/lit-text-field.js.map +1 -1
  157. package/dist/shared/styles/button-shared-styles.d.ts.map +1 -1
  158. package/dist/shared/styles/button-shared-styles.js +321 -28
  159. package/dist/shared/styles/button-shared-styles.js.map +1 -1
  160. package/dist/utils/getOperatorByType.d.ts +5 -5
  161. package/dist/utils/getOperatorByType.d.ts.map +1 -1
  162. package/dist/utils/getOperatorByType.js +5 -1
  163. package/dist/utils/getOperatorByType.js.map +1 -1
  164. package/package.json +5 -2
@@ -5,13 +5,19 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { customElement, property, state } from 'lit/decorators.js';
8
- import { html, LitElement } from 'lit';
8
+ import { css, html, LitElement } from 'lit';
9
9
  import { IconArray } from '../../shared/lit-icon.js';
10
10
  import { msg } from '@lit/localize';
11
11
  //components
12
12
  import '../../shared/lit-icon.js';
13
13
  import '../../shared/lit-input.js';
14
+ import '../../shared/lit-select.js';
15
+ import '../../shared/lit-toggle.js';
16
+ import '../../shared/lit-select-field.js';
17
+ import '../../shared/lit-text-field.js';
18
+ import '../lit-filter-builder.js';
14
19
  import '../../shared/simple-popper.js';
20
+ import '../lit-tabs-overview.js';
15
21
  import '../../assets/illustration/not-found.js';
16
22
  import '../../assets/illustration/settings-illustration.js';
17
23
  import '../../shared/lit-menu.js';
@@ -26,19 +32,80 @@ import '../../shared/lit-modal-header.js';
26
32
  import '../../shared/lit-modal-footer.js';
27
33
  import '../../shared/lit-modal-body.js';
28
34
  import '../../shared/lit-label.js';
35
+ function generateShortId() {
36
+ return Math.random().toString(36).substring(2, 8);
37
+ }
29
38
  let SectionTabSettings = class SectionTabSettings extends LitElement {
30
39
  constructor() {
31
40
  super(...arguments);
32
41
  this.onSettingsChangedModal = (settingsValue) => { };
33
42
  this.showAutomaticHeightOptionInSettings = true;
34
43
  this.allowedLang = ['cs'];
44
+ this.variables = [];
45
+ this.userLang = 'cs';
35
46
  this.isOpen = false;
47
+ this.showHideCondition = false;
36
48
  this.filterText = '';
37
49
  this.isOpenModal = false;
50
+ this.filterData = {
51
+ id: generateShortId(),
52
+ logicOperator: 'AND',
53
+ conditions: [{ id: generateShortId(), field: '', operator: '=', value: '' }],
54
+ };
55
+ this.activeTab = 'general';
56
+ this._onFilterChange = (event) => {
57
+ const { filterGroup } = event.detail;
58
+ // Convert LitFilterBuilderData back to GridFilterDataType format for compatibility
59
+ const gridFilterData = {
60
+ id: this.filterData.id || generateShortId(),
61
+ logicOperator: filterGroup.logicOperator,
62
+ conditions: filterGroup.conditions.map((condition) => ({
63
+ id: condition.id || generateShortId(),
64
+ field: condition.field,
65
+ operator: condition.operator,
66
+ value: condition.value,
67
+ })),
68
+ };
69
+ this.filterData = gridFilterData;
70
+ // Store the full GridFilterDataType structure for advanced filtering support
71
+ if (gridFilterData.conditions.length && gridFilterData.conditions[0].field) {
72
+ this.updateLocalSettings({ hideTabWhen: gridFilterData });
73
+ }
74
+ else {
75
+ this.updateLocalSettings({ hideTabWhen: undefined });
76
+ }
77
+ };
38
78
  }
39
79
  updated(changedProperties) {
40
80
  if (changedProperties.has('settingsValue')) {
41
81
  this.localSettingsValue = this.settingsValue ? { ...this.settingsValue } : {};
82
+ // Initialize filter data from existing condition
83
+ const hideTabWhen = this.localSettingsValue?.hideTabWhen;
84
+ if (hideTabWhen && typeof hideTabWhen === 'object') {
85
+ // Check if it's already in GridFilterDataType format
86
+ if ('logicOperator' in hideTabWhen && 'conditions' in hideTabWhen) {
87
+ this.filterData = hideTabWhen;
88
+ this.showHideCondition = true;
89
+ }
90
+ else if ('logicOperator' in hideTabWhen && 'items' in hideTabWhen) {
91
+ // Handle legacy format if it exists
92
+ this.filterData = hideTabWhen;
93
+ this.showHideCondition = true;
94
+ }
95
+ }
96
+ else if (typeof hideTabWhen === 'boolean' && hideTabWhen) {
97
+ this.showHideCondition = true;
98
+ // Initialize with default filter data when boolean is true
99
+ const defaultField = this.variables.length > 0 ? this.variables[0].tvar_name : '';
100
+ this.filterData = {
101
+ id: generateShortId(),
102
+ logicOperator: 'AND',
103
+ conditions: [{ id: generateShortId(), field: defaultField, operator: '=', value: '' }],
104
+ };
105
+ }
106
+ else {
107
+ this.showHideCondition = false;
108
+ }
42
109
  this.requestUpdate();
43
110
  }
44
111
  }
@@ -48,6 +115,35 @@ let SectionTabSettings = class SectionTabSettings extends LitElement {
48
115
  this.onClose();
49
116
  }
50
117
  }
118
+ _getFilterFieldsFromVariables() {
119
+ return this.variables.map((variable) => ({
120
+ value: variable.tvar_name,
121
+ label: `${variable[`tvar_name_${this.userLang}`] || variable.tvar_name} (${variable.tvar_name})`,
122
+ type: variable.ivar_type === 'T'
123
+ ? 'string'
124
+ : variable.ivar_type === 'N'
125
+ ? 'number'
126
+ : 'string',
127
+ }));
128
+ }
129
+ _getTabDefinitions() {
130
+ return [
131
+ {
132
+ id: 'general',
133
+ label: {
134
+ default: 'General Settings',
135
+ },
136
+ icon: 'administration',
137
+ },
138
+ {
139
+ id: 'hideWhen',
140
+ label: {
141
+ default: 'Hide When',
142
+ },
143
+ icon: 'filter',
144
+ },
145
+ ];
146
+ }
51
147
  updateLocalSettings(updates) {
52
148
  this.localSettingsValue = {
53
149
  ...this.localSettingsValue,
@@ -62,153 +158,290 @@ let SectionTabSettings = class SectionTabSettings extends LitElement {
62
158
  }
63
159
  discardChanges() {
64
160
  this.localSettingsValue = this.settingsValue ? { ...this.settingsValue } : {};
161
+ // Reset the condition builder state to match the original settingsValue
162
+ this._resetConditionBuilderState();
65
163
  if (this.onClose) {
66
164
  this.onClose();
67
165
  }
68
166
  }
69
- render() {
167
+ _resetConditionBuilderState() {
168
+ const hideTabWhen = this.settingsValue?.hideTabWhen;
169
+ if (hideTabWhen && typeof hideTabWhen === 'object') {
170
+ // Check if it's already in GridFilterDataType format
171
+ if ('logicOperator' in hideTabWhen && 'conditions' in hideTabWhen) {
172
+ this.filterData = hideTabWhen;
173
+ this.showHideCondition = true;
174
+ }
175
+ else if ('logicOperator' in hideTabWhen && 'items' in hideTabWhen) {
176
+ // Handle legacy format if it exists
177
+ this.filterData = hideTabWhen;
178
+ this.showHideCondition = true;
179
+ }
180
+ else {
181
+ // Initialize with default filter data from first variable if available
182
+ const defaultField = this.variables.length > 0 ? this.variables[0].tvar_name : '';
183
+ this.filterData = {
184
+ id: generateShortId(),
185
+ logicOperator: 'AND',
186
+ conditions: [{ id: generateShortId(), field: defaultField, operator: '=', value: '' }],
187
+ };
188
+ this.showHideCondition = true;
189
+ }
190
+ }
191
+ else if (typeof hideTabWhen === 'boolean' && hideTabWhen) {
192
+ this.showHideCondition = true;
193
+ // Reset to default filter data for boolean conditions
194
+ const defaultField = this.variables.length > 0 ? this.variables[0].tvar_name : '';
195
+ this.filterData = {
196
+ id: generateShortId(),
197
+ logicOperator: 'AND',
198
+ conditions: [{ id: generateShortId(), field: defaultField, operator: '=', value: '' }],
199
+ };
200
+ }
201
+ else {
202
+ this.showHideCondition = false;
203
+ // Reset to default filter data
204
+ const defaultField = this.variables.length > 0 ? this.variables[0].tvar_name : '';
205
+ this.filterData = {
206
+ id: generateShortId(),
207
+ logicOperator: 'AND',
208
+ conditions: [{ id: generateShortId(), field: defaultField, operator: '=', value: '' }],
209
+ };
210
+ }
211
+ }
212
+ _renderHideWhenControl() {
213
+ const hideTabWhen = this.localSettingsValue?.hideTabWhen;
214
+ const hasCondition = hideTabWhen &&
215
+ typeof hideTabWhen === 'object' &&
216
+ (('variable' in hideTabWhen && hideTabWhen.variable) ||
217
+ ('conditions' in hideTabWhen && hideTabWhen.conditions && hideTabWhen.conditions.length > 0));
218
+ return html `
219
+ <div class="hide-when-control">
220
+ <div class="hide-when-header">
221
+ <lit-toggle
222
+ .label="${msg('Skrýt sekci při splnění podmínky')}"
223
+ .checked="${hasCondition || this.showHideCondition}"
224
+ @change="${(e) => this._toggleCondition(e.detail)}"
225
+ ></lit-toggle>
226
+ </div>
227
+
228
+ ${this.showHideCondition
229
+ ? html `
230
+ <lit-filter-builder
231
+ .data="${this._convertToFilterBuilderData()}"
232
+ .disabled="${false}"
233
+ .locale="${this.userLang}"
234
+ @filter-change="${this._onFilterChange}"
235
+ ></lit-filter-builder>
236
+ `
237
+ : ''}
238
+ </div>
239
+ `;
240
+ }
241
+ _toggleCondition(enabled) {
242
+ if (enabled) {
243
+ this.showHideCondition = true;
244
+ // Only initialize new filter data if no existing data is present
245
+ if (!this.filterData.conditions?.length || !this.filterData.conditions[0]?.field) {
246
+ // Initialize filter data with first variable if available
247
+ if (this.variables.length > 0) {
248
+ const defaultItem = {
249
+ id: generateShortId(),
250
+ field: this.variables[0].tvar_name,
251
+ operator: '=',
252
+ value: '',
253
+ };
254
+ this.filterData = {
255
+ id: this.filterData.id || generateShortId(),
256
+ logicOperator: 'AND',
257
+ conditions: [defaultItem],
258
+ };
259
+ }
260
+ }
261
+ // Save the existing or newly created filter data
262
+ this.updateLocalSettings({ hideTabWhen: this.filterData });
263
+ }
264
+ else {
265
+ this.showHideCondition = false;
266
+ this._clearCondition();
267
+ }
268
+ }
269
+ _clearCondition() {
270
+ this.updateLocalSettings({ hideTabWhen: undefined });
271
+ }
272
+ _convertToFilterBuilderData() {
273
+ const fields = this._getFilterFieldsFromVariables();
274
+ // Convert GridFilterDataType to LitFilterBuilderData format
275
+ const filterGroup = {
276
+ id: 'section-filter-group',
277
+ logicOperator: (this.filterData.logicOperator || 'AND'),
278
+ conditions: this.filterData.conditions?.map((item, index) => ({
279
+ id: item.id || `condition-${index}`,
280
+ field: item.field || '',
281
+ operator: (item.operator || ''),
282
+ value: item.value || '',
283
+ })) || [],
284
+ };
285
+ return {
286
+ fields,
287
+ operators: [], // Will be populated by utility functions
288
+ filterGroup,
289
+ };
290
+ }
291
+ _renderGeneralSettings() {
70
292
  const filteredKeys = (IconArray || []).filter((key) => key.toLowerCase().includes(this.filterText));
71
293
  return html `
72
- <lit-modal
73
- .open=${this.isOpenModal}
74
- .onClose=${() => {
75
- this.onClose?.();
76
- }}
77
- .closeOnOutsideClick=${false}
78
- .fullScreen=${window.innerWidth <=
79
- (parseInt(getComputedStyle(document.documentElement).getPropertyValue('--breakpoint-sm')) || 600)}
80
- >
81
- <lit-modal-header
82
- style="display: flex; align-items: center; justify-content: flex-end;"
83
- >
84
- <lit-icon-button
85
- .icon="${'close'}"
86
- variant="${'text'}"
87
- size="${'small'}"
88
- @click=${() => this.onClose?.()}
89
- ></lit-icon-button>
90
- </lit-modal-header>
91
- <lit-modal-body>
92
- <div style="display: flex; flex-direction: column; gap: 0.5rem">
93
- <div
94
- style="display: flex; flex-direction: column; align-items: center; font-size: 1rem; font-weight: 500;"
95
- >
96
- <div style="max-height: 5rem; max-width: 5rem">
97
- <settings-illustration></settings-illustration>
98
- </div>
99
- <span
100
- style="font-size: 0.875rem; font-weight: 500 ; color: var(--text-secondary, #777);"
101
- >
102
- ${msg('Konfigurace') + '- SectionTab'}
103
- </span>
104
- </div>
105
- ${this.showAutomaticHeightOptionInSettings
294
+ <div class="tab-content">
295
+ ${this.showAutomaticHeightOptionInSettings
106
296
  ? html `
107
- <lit-checkbox
108
- .label="${msg('Automatická výška sekce')}"
109
- .checked=${this.localSettingsValue?.[`autoHeight`] ??
110
- false}
111
- @change=${(e) => {
297
+ <lit-checkbox
298
+ .label="${msg('Automatická výška sekce')}"
299
+ .checked=${this.localSettingsValue?.[`autoHeight`] ?? false}
300
+ @change=${(e) => {
112
301
  this.updateLocalSettings({ autoHeight: e.detail });
113
302
  }}
114
- ></lit-checkbox>
115
- `
303
+ ></lit-checkbox>
304
+ `
116
305
  : ''}
117
- <div style="display: flex; align-items: center; gap: 1rem;">
118
- <lit-label label=${msg('Icona Sekce')}></lit-label>
119
- <lit-icon-button
120
- variant="dashed"
121
- size="medium"
122
- .icon="${this.localSettingsValue?.titleIcon || 'documents'}"
123
- @click="${this.toggleCustomPopover}"
124
- ></lit-icon-button>
125
- </div>
306
+ <div style="display: flex; align-items: center; gap: 1rem;">
307
+ <lit-label label=${msg('Icona Sekce')}></lit-label>
308
+ <lit-icon-button
309
+ color="secondary"
310
+ variant="dashed"
311
+ size="medium"
312
+ .icon="${this.localSettingsValue?.titleIcon || 'documents'}"
313
+ @click="${this.toggleCustomPopover}"
314
+ ></lit-icon-button>
315
+ </div>
126
316
 
127
- <simple-popper
128
- .showing=${this.isOpen}
129
- .placement=${'bottom-start'}
130
- .onClose=${this.closePopover.bind(this)}
131
- .manualOpening=${true}
132
- >
133
- <style>
134
- .icon-menu {
135
- display: flex;
136
- flex-wrap: wrap;
137
- gap: 0.5rem;
138
- padding: 0.5rem;
139
- }
140
- .icon-select-item {
141
- cursor: pointer;
142
- width: 2.5rem;
143
- height: 2.5rem;
144
- display: flex;
145
- align-items: center;
146
- justify-content: center;
147
- border-radius: var(--border-radius-small, 4px);
148
- transition: background 0.15s;
149
- }
150
- .icon-select-item:hover {
151
- background-color: var(--color-primary-light, #e0e7ff);
152
- }
153
- </style>
154
- <div
155
- style="max-height: 12.5rem; height: 12.5rem; overflow-y: auto; width: 500px; max-width: 100%;"
156
- >
157
- <div class="popper-input">
158
- <lit-input
159
- .value=${this.filterText}
160
- .onInput=${(value) => {
317
+ <simple-popper
318
+ .showing=${this.isOpen}
319
+ .placement=${'bottom-start'}
320
+ .onClose=${this.closePopover.bind(this)}
321
+ .manualOpening=${true}
322
+ >
323
+ <style>
324
+ .icon-menu {
325
+ display: flex;
326
+ flex-wrap: wrap;
327
+ gap: 0.5rem;
328
+ padding: 0.5rem;
329
+ }
330
+ .icon-select-item {
331
+ cursor: pointer;
332
+ width: 2.5rem;
333
+ height: 2.5rem;
334
+ display: flex;
335
+ align-items: center;
336
+ justify-content: center;
337
+ border-radius: var(--border-radius-small, 4px);
338
+ transition: background 0.15s;
339
+ }
340
+ .icon-select-item:hover {
341
+ background-color: var(--color-primary-light, #e0e7ff);
342
+ }
343
+ </style>
344
+ <div
345
+ style="max-height: 12.5rem; height: 12.5rem; overflow-y: auto; width: 500px; max-width: 100%;"
346
+ >
347
+ <div class="popper-input">
348
+ <lit-input
349
+ .value=${this.filterText}
350
+ .onInput=${(value) => {
161
351
  this.filterText = value?.toLowerCase?.() || '';
162
352
  }}
163
- .onClear=${() => {
353
+ .onClear=${() => {
164
354
  this.filterText = '';
165
355
  }}
166
- placeholder="${msg('Zadejte název ikony')}"
167
- ></lit-input>
168
- </div>
356
+ placeholder="${msg('Zadejte název ikony')}"
357
+ ></lit-input>
358
+ </div>
169
359
 
170
- <div class="icon-menu">
171
- ${filteredKeys.map((key) => html `
172
- <div
173
- class="icon-select-item"
174
- @click=${() => {
360
+ <div class="icon-menu">
361
+ ${filteredKeys.map((key) => html `
362
+ <div
363
+ class="icon-select-item"
364
+ @click=${() => {
175
365
  this.updateLocalSettings({
176
366
  titleIcon: key,
177
367
  });
178
368
  this.closePopover();
179
369
  }}
180
- .isActive=${this.localSettingsValue?.titleIcon ===
181
- key}
182
- >
183
- <lit-icon size="1rem" icon="${key}"></lit-icon>
184
- </div>
185
- `)}
186
- </div>
187
- </div>
188
- </simple-popper>
189
- <div>
190
- <lit-text-field
191
- .label="${msg('Název sekce')}"
192
- .value=${this.localSettingsValue?.titleLabel || ''}
193
- .placeholder="${msg('Zadejte název sekce')}"
194
- @onChange="${(e) => {
370
+ .isActive=${this.localSettingsValue?.titleIcon === key}
371
+ >
372
+ <lit-icon size="1rem" icon="${key}"></lit-icon>
373
+ </div>
374
+ `)}
375
+ </div>
376
+ </div>
377
+ </simple-popper>
378
+ <div style="margin-top: 1rem; display: flex; flex-direction: column; gap: 1rem;">
379
+ <lit-text-field
380
+ aiIcon=${true}
381
+ .label="${msg('Název sekce')}"
382
+ .value=${this.localSettingsValue?.titleLabel || ''}
383
+ .placeholder="${msg('Zadejte název sekce')}"
384
+ @onChange="${(e) => {
195
385
  this.updateLocalSettings({ titleLabel: e.detail });
196
386
  }}"
197
- ></lit-text-field>
387
+ @onClickAiIcon="${() => {
388
+ // Handle AI icon click for the main title
389
+ }}"
390
+ ></lit-text-field>
198
391
 
199
- ${(this.allowedLang || []).map((lang) => html `
200
- <lit-text-field
201
- .label=${`${msg('Název sekce')} ${lang.toUpperCase()}`}
202
- .placeholder=${`${msg('Zadejte název')} ${lang.toUpperCase()}`}
203
- .value=${this.localSettingsValue?.[`titleLabel_${lang}`] ||
204
- ''}
205
- @onChange=${(e) => {
392
+ ${(this.allowedLang || []).map((lang) => html `
393
+ <lit-text-field
394
+ .label=${`${msg('Název sekce')} ${lang.toUpperCase()}`}
395
+ .placeholder=${`${msg('Zadejte název')} ${lang.toUpperCase()}`}
396
+ .value=${this.localSettingsValue?.[`titleLabel_${lang}`] || ''}
397
+ @onChange=${(e) => {
206
398
  this.updateLocalSettings({
207
399
  [`titleLabel_${lang}`]: e.detail,
208
400
  });
209
401
  }}
210
- ></lit-text-field>
211
- `)}
402
+ ></lit-text-field>
403
+ `)}
404
+ </div>
405
+ </div>
406
+ `;
407
+ }
408
+ render() {
409
+ console.log(this.variables);
410
+ return html `
411
+ <lit-modal
412
+ .open=${this.isOpenModal}
413
+ .onClose=${() => {
414
+ this.discardChanges();
415
+ }}
416
+ .closeOnOutsideClick=${false}
417
+ .fullScreen=${window.innerWidth <=
418
+ (parseInt(getComputedStyle(document.documentElement).getPropertyValue('--breakpoint-sm')) || 600)}
419
+ style="min-width: 60vw;"
420
+ >
421
+ <lit-modal-header
422
+ style="display: flex; align-items: center; justify-content: space-between; color: var(--text-secondary, #777);"
423
+ >
424
+ ${msg('Konfigurace') + ' - SectionTab'}
425
+ <lit-icon-button
426
+ .icon="${'close'}"
427
+ variant="text"
428
+ color="secondary"
429
+ size="${'small'}"
430
+ @click=${() => this.discardChanges()}
431
+ ></lit-icon-button>
432
+ </lit-modal-header>
433
+ <lit-modal-body>
434
+ <div style="display: flex; flex-direction: column; gap: 0.5rem">
435
+ <div class="settings-tabs">
436
+ <lit-tabs-overview
437
+ .tabs="${this._getTabDefinitions()}"
438
+ .initialSelectedTabId="${this.activeTab}"
439
+ .userLang="${'cs'}"
440
+ .allowedLang="${this.allowedLang}"
441
+ >
442
+ <div slot="general">${this._renderGeneralSettings()}</div>
443
+ <div slot="hideWhen">${this._renderHideWhenControl()}</div>
444
+ </lit-tabs-overview>
212
445
  </div>
213
446
  </div>
214
447
  </lit-modal-body>
@@ -220,15 +453,16 @@ let SectionTabSettings = class SectionTabSettings extends LitElement {
220
453
  >
221
454
  <lit-button
222
455
  .label="${msg('Uložit')}"
223
- .icon="${'check'}"
224
- .size="${'medium'}"
456
+ .icon="check"
457
+ .size="medium"
225
458
  @click=${() => this.trySendSettingsUpdate()}
226
459
  ></lit-button>
227
460
  <lit-button
461
+ color="secondary"
228
462
  .label="${msg('Zrušit')}"
229
- variant="${'text'}"
230
- .icon="${'close'}"
231
- .size="${'medium'}"
463
+ variant="text"
464
+ .icon="close"
465
+ .size="medium"
232
466
  @click=${() => this.discardChanges()}
233
467
  ></lit-button>
234
468
  </lit-modal-footer>
@@ -236,6 +470,71 @@ let SectionTabSettings = class SectionTabSettings extends LitElement {
236
470
  `;
237
471
  }
238
472
  };
473
+ SectionTabSettings.styles = [
474
+ css `
475
+ .hide-when-control {
476
+ padding: 12px;
477
+ border: 1px solid var(--color-divider, #d0d3db);
478
+ border-radius: 4px;
479
+ background: var(--background-paper, #fff);
480
+ margin-top: 8px;
481
+ }
482
+
483
+ .hide-when-header {
484
+ display: flex;
485
+ align-items: center;
486
+ gap: 8px;
487
+ margin-bottom: 8px;
488
+ }
489
+
490
+ .condition-builder {
491
+ display: flex !important;
492
+ flex-direction: row !important;
493
+ gap: 8px;
494
+ align-items: flex-end !important;
495
+ margin-top: 8px;
496
+ width: 100%;
497
+ }
498
+
499
+ .condition-builder.hidden {
500
+ display: none;
501
+ }
502
+
503
+ .condition-preview {
504
+ width: 100%;
505
+ font-size: 12px;
506
+ color: var(--text-secondary, #777);
507
+ padding: 4px 8px;
508
+ background: var(--color-primary-light, #f0f0f0);
509
+ border-radius: 4px;
510
+ margin-top: 8px;
511
+ }
512
+
513
+ .clear-condition-button {
514
+ color: var(--color-warning, #ff9500);
515
+ }
516
+
517
+ .popper-input {
518
+ margin-bottom: 0.5rem;
519
+ position: sticky;
520
+ top: 0;
521
+ background-color: var(--background-paper, #fff);
522
+ z-index: 1;
523
+ }
524
+
525
+ /* Tab content styles */
526
+ .tab-content {
527
+ padding: 1rem;
528
+ height: calc(100% - 3rem);
529
+ overflow-y: auto;
530
+ background-color: var(--background-paper, #fff);
531
+ }
532
+
533
+ .settings-tabs {
534
+ height: 400px;
535
+ }
536
+ `,
537
+ ];
239
538
  __decorate([
240
539
  property({ type: Object })
241
540
  ], SectionTabSettings.prototype, "settingsValue", void 0);
@@ -248,12 +547,21 @@ __decorate([
248
547
  __decorate([
249
548
  property({ type: Array })
250
549
  ], SectionTabSettings.prototype, "allowedLang", void 0);
550
+ __decorate([
551
+ property({ type: Array })
552
+ ], SectionTabSettings.prototype, "variables", void 0);
251
553
  __decorate([
252
554
  property({ type: Function })
253
555
  ], SectionTabSettings.prototype, "onClose", void 0);
556
+ __decorate([
557
+ property({ type: String })
558
+ ], SectionTabSettings.prototype, "userLang", void 0);
254
559
  __decorate([
255
560
  state()
256
561
  ], SectionTabSettings.prototype, "isOpen", void 0);
562
+ __decorate([
563
+ state()
564
+ ], SectionTabSettings.prototype, "showHideCondition", void 0);
257
565
  __decorate([
258
566
  state()
259
567
  ], SectionTabSettings.prototype, "filterText", void 0);
@@ -263,6 +571,12 @@ __decorate([
263
571
  __decorate([
264
572
  state()
265
573
  ], SectionTabSettings.prototype, "isOpenModal", void 0);
574
+ __decorate([
575
+ state()
576
+ ], SectionTabSettings.prototype, "filterData", void 0);
577
+ __decorate([
578
+ state()
579
+ ], SectionTabSettings.prototype, "activeTab", void 0);
266
580
  SectionTabSettings = __decorate([
267
581
  customElement('section-tab-settings')
268
582
  ], SectionTabSettings);