overview-components 0.2.3 → 0.2.5

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.
@@ -5,15 +5,21 @@ import '../shared/lit-tooltip.js';
5
5
  import '../shared/lit-select.js';
6
6
  import '../shared/lit-overflow-tooltip.js';
7
7
  import '../assets/ilustration/no-preview.js';
8
- import '../shared/lit-loader.js';
8
+ import '../shared/lit-loading-bar.js';
9
9
  import '../components/lit-section-tab.js';
10
10
  import * as pdfjsLib from 'pdfjs-dist';
11
+ type Document = {
12
+ id: string;
13
+ name: string;
14
+ dmsf_src: string;
15
+ file_type: string;
16
+ };
11
17
  export type AttachmentsTabProps = {
12
18
  hideTabWhen?: boolean;
13
19
  additionalLabels?: any[];
14
20
  type?: 'compact' | 'select';
15
21
  initialSelection?: string;
16
- documents?: any[];
22
+ documents?: Document[];
17
23
  selectedDocument?: {};
18
24
  selectedId?: string;
19
25
  pageNumber?: string;
@@ -28,7 +34,7 @@ export type AttachmentsTabProps = {
28
34
  export declare class LitAttachmentsTab extends LitElement {
29
35
  hideTabWhen?: boolean;
30
36
  initialSelection?: string;
31
- documents?: any[];
37
+ documents?: Document[];
32
38
  type?: 'compact' | 'select';
33
39
  scale?: number;
34
40
  onClick?: (documentId: string) => Promise<any>;
@@ -41,6 +47,7 @@ export declare class LitAttachmentsTab extends LitElement {
41
47
  isEllipsisActive?: {};
42
48
  isHoveredLabel?: string;
43
49
  private preview;
50
+ private documentData;
44
51
  private canvas;
45
52
  private ctx;
46
53
  private outerContainer;
@@ -50,7 +57,6 @@ export declare class LitAttachmentsTab extends LitElement {
50
57
  private prevScrollLeft;
51
58
  private prevScrollTop;
52
59
  private abortController;
53
- private documentData;
54
60
  connectedCallback(): Promise<void>;
55
61
  disconnectedCallback(): void;
56
62
  firstUpdated(): Promise<void>;
@@ -74,4 +80,5 @@ declare global {
74
80
  'lit-attachments-tab': LitAttachmentsTab;
75
81
  }
76
82
  }
83
+ export {};
77
84
  //# sourceMappingURL=lit-attachments-tab.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lit-attachments-tab.d.ts","sourceRoot":"","sources":["../../src/components/lit-attachments-tab.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAK5E,OAAO,uBAAuB,CAAC;AAC/B,OAAO,8BAA8B,CAAC;AACtC,OAAO,0BAA0B,CAAC;AAClC,OAAO,yBAAyB,CAAC;AACjC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,yBAAyB,CAAC;AACjC,OAAO,kCAAkC,CAAC;AAE1C,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AAQvC,MAAM,MAAM,mBAAmB,GAAG;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB,CAAC,EAAE,GAAG,EAAE,CAAC;IACzB,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC;IAClB,gBAAgB,CAAC,EAAE,EAAE,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,EAAE,CAAC;IACf,gBAAgB,CAAC,EAAE,EAAE,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/C,iBAAiB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,qBACa,iBAAkB,SAAQ,UAAU;IAChB,WAAW,CAAC,EAAE,OAAO,CAAS;IAC/B,gBAAgB,CAAC,EAA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OAAO,CAAC,eAAe,CAAyB;IAE1C,iBAAiB;IASvB,oBAAoB;IASd,YAAY;IAOlB,SAAS,CAAC,OAAO,CAAC,kBAAkB,EAAE,cAAc,GAAG,IAAI;IAe3D,cAAc,WAAY,GAAG,sBAMtB;YAEO,gBAAgB;YA6ChB,mBAAmB;YAyBnB,UAAU;IAyCxB,OAAO,CAAC,uBAAuB;IAK/B,OAAO,CAAC,gBAAgB;YAQV,cAAc;IAuB5B,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,aAAa;IAIrB,MAAM,CAAC,MAAM,4BAwHX;IAEF,MAAM,IAAI,cAAc,GAAG,IAAI;CA4HlC;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,qBAAqB,EAAE,iBAAiB,CAAC;KAC5C;CACJ"}
@@ -16,7 +16,7 @@ import '../shared/lit-tooltip.js';
16
16
  import '../shared/lit-select.js';
17
17
  import '../shared/lit-overflow-tooltip.js';
18
18
  import '../assets/ilustration/no-preview.js';
19
- import '../shared/lit-loader.js';
19
+ import '../shared/lit-loading-bar.js';
20
20
  import '../components/lit-section-tab.js';
21
21
  // pdf.js
22
22
  import * as pdfjsLib from 'pdfjs-dist';
@@ -35,6 +35,7 @@ let LitAttachmentsTab = class LitAttachmentsTab extends LitElement {
35
35
  this.pageCount = 1;
36
36
  this.isChecked = {};
37
37
  this.preview = true;
38
+ this.documentData = null;
38
39
  this.canvas = null;
39
40
  this.ctx = null;
40
41
  this.outerContainer = null;
@@ -44,7 +45,6 @@ let LitAttachmentsTab = class LitAttachmentsTab extends LitElement {
44
45
  this.prevScrollLeft = 0;
45
46
  this.prevScrollTop = 0;
46
47
  this.abortController = new AbortController();
47
- this.documentData = null;
48
48
  this.handleReadFile = (buffer) => new Promise((resolve, reject) => {
49
49
  const reader = new FileReader();
50
50
  reader.onload = () => resolve(reader);
@@ -56,7 +56,7 @@ let LitAttachmentsTab = class LitAttachmentsTab extends LitElement {
56
56
  async connectedCallback() {
57
57
  super.connectedCallback();
58
58
  this.type = this.type || 'compact';
59
- this.selectedId = this.initialSelection || (this.documents?.[0]?.id ?? null);
59
+ this.selectedId = this.initialSelection || (this.documents?.[0]?.id ?? '');
60
60
  if (!this.hideTabWhen && this.documents) {
61
61
  this.handleDocumentClick(this.selectedId);
62
62
  }
@@ -66,6 +66,7 @@ let LitAttachmentsTab = class LitAttachmentsTab extends LitElement {
66
66
  this.abortController.abort();
67
67
  if (this.documentData && this.documentData.cancel) {
68
68
  this.documentData.cancel();
69
+ this.documentData = null;
69
70
  }
70
71
  }
71
72
  async firstUpdated() {
@@ -77,7 +78,7 @@ let LitAttachmentsTab = class LitAttachmentsTab extends LitElement {
77
78
  updated(_changedProperties) {
78
79
  super.updated(_changedProperties);
79
80
  if (_changedProperties.has('documents')) {
80
- this.selectedId = this.initialSelection || (this.documents?.[0]?.id ?? null);
81
+ this.selectedId = this.initialSelection || (this.documents?.[0]?.id ?? '');
81
82
  if (!this.hideTabWhen && typeof this.documents !== 'undefined') {
82
83
  this.handleDocumentClick(this.selectedId);
83
84
  }
@@ -85,6 +86,7 @@ let LitAttachmentsTab = class LitAttachmentsTab extends LitElement {
85
86
  if (_changedProperties.has('selectedId')) {
86
87
  if (this.documentData && this.documentData.cancel) {
87
88
  this.documentData.cancel();
89
+ this.documentData = null;
88
90
  }
89
91
  }
90
92
  }
@@ -202,7 +204,7 @@ let LitAttachmentsTab = class LitAttachmentsTab extends LitElement {
202
204
  try {
203
205
  const documentData = await this.onClick(this.selectedId);
204
206
  const selectedDoc = this.documents?.find((doc) => doc.id === this.selectedId);
205
- const blob = new Blob([documentData.data], { type: selectedDoc.file_type });
207
+ const blob = new Blob([documentData.data], { type: selectedDoc?.file_type });
206
208
  const url = URL.createObjectURL(blob);
207
209
  const link = document.createElement('a');
208
210
  link.href = url;
@@ -247,248 +249,245 @@ let LitAttachmentsTab = class LitAttachmentsTab extends LitElement {
247
249
  render() {
248
250
  if (this.hideTabWhen)
249
251
  return null;
250
- return html `
252
+ return html `
251
253
  ${this.type === 'compact'
252
- ? html ` ${this.documents?.map((doc, index) => html `
253
- <div
254
+ ? html ` ${this.documents?.map((doc, index) => html `
255
+ <div
254
256
  class="document-label ${this.selectedId == doc.id
255
257
  ? 'selected'
256
- : null}"
257
- @click=${() => this.handleDocumentClick(doc.id)}
258
- >
259
- <div class="document-item" id="${doc.id}">
260
- <lit-overflow-tooltip
261
- label="${doc.name || `Document ${index + 1}`}"
262
- >
263
- ${doc.name || `Document ${index + 1}`}
264
- </lit-overflow-tooltip>
265
- </div>
266
-
258
+ : null}"
259
+ @click=${() => this.handleDocumentClick(doc.id)}
260
+ >
261
+ <div class="document-item" id="${doc.id}">
262
+ <lit-overflow-tooltip
263
+ label="${doc.name || `Document ${index + 1}`}"
264
+ >
265
+ ${doc.name || `Document ${index + 1}`}
266
+ </lit-overflow-tooltip>
267
+ </div>
268
+
267
269
  ${this.selectedId == doc.id
268
- ? html `
269
- <div class="document-checked">
270
- <span>${msg('Zobrazen náhled')}</span>
271
- </div>
270
+ ? html `
271
+ <div class="document-checked">
272
+ <span>${msg('Zobrazen náhled')}</span>
273
+ </div>
272
274
  `
273
- : html `
274
- <div class="document-unchecked">
275
- <lit-icon icon="reading" size="1rem"></lit-icon>
276
- <span>${msg('Zobrazit náhled')}</span>
277
- </div>
278
- `}
279
- </div>
275
+ : html `
276
+ <div class="document-unchecked">
277
+ <lit-icon icon="reading" size="1rem"></lit-icon>
278
+ <span>${msg('Zobrazit náhled')}</span>
279
+ </div>
280
+ `}
281
+ </div>
280
282
  `)}`
281
- : html `
282
- <lit-select
283
- .value="${this.selectedId}"
283
+ : html `
284
+ <lit-select
285
+ .value="${this.selectedId}"
284
286
  .options="${this.documents?.map((doc) => ({
285
287
  value: doc.id,
286
288
  label: doc.name,
287
- }))}"
289
+ }))}"
288
290
  .onChange="${(selectedValue) => {
289
291
  this.handleDocumentClick(selectedValue);
290
- }}"
291
- .disableClearButton="${true}"
292
- ></lit-select>
293
- `}
294
-
295
- <div class="document">
296
- <div class="document-box">
297
- <div class="document-selected">
298
- <lit-overflow-tooltip label="${this.getSelectedDocumentName()}">
299
- ${this.getSelectedDocumentName()}
300
- </lit-overflow-tooltip>
301
- </div>
302
- <div class="action-buttons">
292
+ }}"
293
+ .disableClearButton="${true}"
294
+ ></lit-select>
295
+ `}
296
+ ${this.isDocumentLoading ? html ` <lit-loading-bar></lit-loading-bar> ` : null}
297
+ <div class="document">
298
+ <div class="document-box">
299
+ <div class="document-selected">
300
+ <lit-overflow-tooltip label="${this.getSelectedDocumentName()}">
301
+ ${this.getSelectedDocumentName()}
302
+ </lit-overflow-tooltip>
303
+ </div>
304
+ <div class="action-buttons">
303
305
  ${this.preview
304
- ? html `
305
- <lit-icon
306
- style="cursor: pointer"
307
- icon="chevronLeftFilled"
308
- size="1rem"
309
- @click=${() => this.handlePageChange(false)}
310
- ></lit-icon>
311
- <span>page ${this.pageNumber} / ${this.pageCount}</span>
312
- <lit-icon
313
- style="cursor: pointer"
314
- icon="chevronRightFilled"
315
- size="1rem"
316
- @click=${() => this.handlePageChange(true)}
317
- ></lit-icon>
318
- <lit-icon-button
319
- icon="zoomout"
320
- variant="text"
321
- size="small"
322
- @click=${() => this.handleZoom(false)}
323
- ></lit-icon-button>
324
- <lit-icon-button
325
- icon="zoomIn"
326
- variant="text"
327
- size="small"
328
- @click=${() => this.handleZoom(true)}
329
- ></lit-icon-button>
306
+ ? html `
307
+ <lit-icon
308
+ style="cursor: pointer"
309
+ icon="chevronLeftFilled"
310
+ size="1rem"
311
+ @click=${() => this.handlePageChange(false)}
312
+ ></lit-icon>
313
+ <span>page ${this.pageNumber} / ${this.pageCount}</span>
314
+ <lit-icon
315
+ style="cursor: pointer"
316
+ icon="chevronRightFilled"
317
+ size="1rem"
318
+ @click=${() => this.handlePageChange(true)}
319
+ ></lit-icon>
320
+ <lit-icon-button
321
+ icon="zoomout"
322
+ variant="text"
323
+ size="small"
324
+ @click=${() => this.handleZoom(false)}
325
+ ></lit-icon-button>
326
+ <lit-icon-button
327
+ icon="zoomIn"
328
+ variant="text"
329
+ size="small"
330
+ @click=${() => this.handleZoom(true)}
331
+ ></lit-icon-button>
330
332
  `
331
- : null}
332
-
333
- <lit-icon-button
334
- icon="download"
335
- variant="text"
336
- size="small"
337
- @click=${this.handleDownload}
338
- ></lit-icon-button>
339
- </div>
340
- </div>
341
- <div
342
- class="document-container"
343
- @mousemove=${this.handleMouseMove}
344
- @mouseup=${this.handleMouseUp}
345
- @mouseleave=${this.handleMouseUp}
346
- >
347
- ${this.isDocumentLoading
348
- ? html `<lit-section-tab .sx="${{ height: '40vh' }}">
349
- <lit-loader></lit-loader>
350
- </lit-section-tab> `
351
- : html ` <canvas
352
- style=${styleMap({
353
- cursor: (this.scale ?? 1) > 1 ? 'grab' : 'default',
354
- transform: `scale(${this.scale})`,
355
- })}
356
- @mousedown=${this.handleMouseDown}
357
- >
358
- </canvas>`}
333
+ : null}
334
+
335
+ <lit-icon-button
336
+ icon="download"
337
+ variant="text"
338
+ size="small"
339
+ @click=${this.handleDownload}
340
+ ></lit-icon-button>
341
+ </div>
342
+ </div>
343
+ <div
344
+ class="document-container"
345
+ @mousemove=${this.handleMouseMove}
346
+ @mouseup=${this.handleMouseUp}
347
+ @mouseleave=${this.handleMouseUp}
348
+ >
349
+ <canvas
350
+ style=${styleMap({
351
+ cursor: (this.scale ?? 1) > 1 ? 'grab' : 'default',
352
+ transform: `scale(${this.scale})`,
353
+ })}
354
+ @mousedown=${this.handleMouseDown}
355
+ >
356
+ </canvas>
359
357
  ${!this.preview
360
- ? html `
361
- <div class="not-supported__format">
362
- <div style="max-height: 7.125rem; max-width: 7.125rem">
363
- <no-preview></no-preview>
364
- </div>
365
- ${msg('Náhled dokumentu není možný vzhledem k typu dokumentu.')}
366
- </div>
358
+ ? html `
359
+ <div class="not-supported__format">
360
+ <div style="max-height: 7.125rem; max-width: 7.125rem">
361
+ <no-preview></no-preview>
362
+ </div>
363
+ ${msg('Náhled dokumentu není možný vzhledem k typu dokumentu.')}
364
+ </div>
367
365
  `
368
- : null}
369
- </div>
370
- </div>
366
+ : null}
367
+ </div>
368
+ </div>
371
369
  `;
372
370
  }
373
371
  };
374
372
  LitAttachmentsTab.styles = [
375
- css `
376
- .document-label {
377
- line-height: 2.125rem;
378
- gap: 0.25rem;
379
- display: flex;
380
- justify-content: space-between;
381
- flex-direction: row;
382
- align-items: center;
383
- position: relative;
384
- font-weight: 500;
385
- font-size: 0.8125rem;
386
- padding: 0.125rem 0 0.125rem 1rem;
387
- background: var(--background-paper, #ffffff);
388
- color: var(--color-secondary-main, #111827);
389
- border-radius: 0.5rem;
390
- cursor: pointer;
391
- }
392
-
393
- .document-item {
394
- font-weight: 500;
395
- font-size: 0.8125rem;
396
- color: var(--color-secondary-main, #111827);
397
- display: flex;
398
-
399
- overflow: hidden;
400
- white-space: nowrap;
401
- text-overflow: ellipsis;
402
- }
403
-
404
- .document-label:hover {
405
- background: var(--color-primary-light, #f0fadf);
406
- }
407
-
408
- .selected {
409
- background: var(--color-primary-light, #f0fadf);
410
- }
411
-
412
- .document-checked {
413
- padding: 0 1rem 0 1rem;
414
- font-size: 0.75rem;
415
- color: var(--color-primary-dark, #5f9402);
416
- white-space: nowrap;
417
- }
418
- .document-unchecked {
419
- display: none;
420
- padding: 0 1rem 0 1rem;
421
- font-size: 0.75rem;
422
- align-items: center;
423
- gap: 0.5rem;
424
- white-space: nowrap;
425
- }
426
-
427
- .document-label:hover .document-unchecked {
428
- display: flex;
429
- }
430
-
431
- .document {
432
- height: 100%;
433
- background: var(--background-default, #eff3f4);
434
- border-radius: 0.25rem;
435
- padding: 0.75rem 0.5rem 0.5rem 0.5rem;
436
- }
437
-
438
- .document-box {
439
- display: flex;
440
- align-items: center;
441
- max-height: 2rem;
442
- justify-content: space-between;
443
- padding: 0 0.75rem 0.75rem 0.75rem;
444
- }
445
-
446
- .action-buttons {
447
- display: flex;
448
- align-items: center;
449
- font-size: 0.8125rem;
450
- gap: 0.75rem;
451
- white-space: nowrap;
452
- }
453
-
454
- .document-selected {
455
- color: var(--color-secondary-main, #111827);
456
- font-size: 0.8125rem;
457
- font-weight: 500;
458
- max-width: 100%;
459
- overflow: hidden;
460
- white-space: nowrap;
461
- text-overflow: ellipsis;
462
- }
463
-
464
- .document-container {
465
- position: relative;
466
- width: 100%;
467
- height: 100%;
468
-
469
- overflow: auto;
470
- justify-content: center;
471
- align-items: center;
472
- }
473
-
474
- canvas {
475
- display: block;
476
- margin: 0 auto;
477
- transform-origin: 0 0;
478
- width: 100%;
479
- height: 100%;
480
- }
481
-
482
- .not-supported__format {
483
- min-height: 40vh;
484
- font-size: 0.875rem;
485
- text-align: center;
486
- display: flex;
487
- align-items: center;
488
- justify-content: center;
489
- flex-direction: column;
490
- margin: 1rem 0 1rem 0;
491
- }
373
+ css `
374
+ .document-label {
375
+ line-height: 2.125rem;
376
+ gap: 0.25rem;
377
+ display: flex;
378
+ justify-content: space-between;
379
+ flex-direction: row;
380
+ align-items: center;
381
+ position: relative;
382
+ font-weight: 500;
383
+ font-size: 0.8125rem;
384
+ padding: 0.125rem 0 0.125rem 1rem;
385
+ background: var(--background-paper, #ffffff);
386
+ color: var(--color-secondary-main, #111827);
387
+ border-radius: 0.5rem;
388
+ cursor: pointer;
389
+ }
390
+
391
+ .document-item {
392
+ font-weight: 500;
393
+ font-size: 0.8125rem;
394
+ color: var(--color-secondary-main, #111827);
395
+ display: flex;
396
+
397
+ overflow: hidden;
398
+ white-space: nowrap;
399
+ text-overflow: ellipsis;
400
+ }
401
+
402
+ .document-label:hover {
403
+ background: var(--color-primary-light, #f0fadf);
404
+ }
405
+
406
+ .selected {
407
+ background: var(--color-primary-light, #f0fadf);
408
+ }
409
+
410
+ .document-checked {
411
+ padding: 0 1rem 0 1rem;
412
+ font-size: 0.75rem;
413
+ color: var(--color-primary-dark, #5f9402);
414
+ white-space: nowrap;
415
+ }
416
+ .document-unchecked {
417
+ display: none;
418
+ padding: 0 1rem 0 1rem;
419
+ font-size: 0.75rem;
420
+ align-items: center;
421
+ gap: 0.5rem;
422
+ white-space: nowrap;
423
+ }
424
+
425
+ .document-label:hover .document-unchecked {
426
+ display: flex;
427
+ }
428
+
429
+ .document {
430
+ height: 100%;
431
+ background: var(--background-default, #eff3f4);
432
+ border-radius: 0.25rem;
433
+ padding: 0.75rem 0.5rem 0.5rem 0.5rem;
434
+ }
435
+
436
+ .document-box {
437
+ display: flex;
438
+ align-items: center;
439
+ max-height: 2rem;
440
+ justify-content: space-between;
441
+ padding: 0 0.75rem 0.75rem 0.75rem;
442
+ }
443
+
444
+ .action-buttons {
445
+ display: flex;
446
+ align-items: center;
447
+ font-size: 0.8125rem;
448
+ gap: 0.75rem;
449
+ white-space: nowrap;
450
+ }
451
+
452
+ .document-selected {
453
+ color: var(--color-secondary-main, #111827);
454
+ font-size: 0.8125rem;
455
+ font-weight: 500;
456
+ max-width: 100%;
457
+ overflow: hidden;
458
+ white-space: nowrap;
459
+ text-overflow: ellipsis;
460
+ display: flex;
461
+ }
462
+
463
+ .document-container {
464
+ position: relative;
465
+ width: 100%;
466
+ height: 100%;
467
+
468
+ overflow: auto;
469
+ justify-content: center;
470
+ align-items: center;
471
+ }
472
+
473
+ canvas {
474
+ display: block;
475
+ margin: 0 auto;
476
+ transform-origin: 0 0;
477
+ width: 100%;
478
+ height: 100%;
479
+ }
480
+
481
+ .not-supported__format {
482
+ min-height: 40vh;
483
+ font-size: 0.875rem;
484
+ text-align: center;
485
+ display: flex;
486
+ align-items: center;
487
+ justify-content: center;
488
+ flex-direction: column;
489
+ margin: 1rem 0 1rem 0;
490
+ }
492
491
  `,
493
492
  ];
494
493
  __decorate([
@@ -536,6 +535,9 @@ __decorate([
536
535
  __decorate([
537
536
  state()
538
537
  ], LitAttachmentsTab.prototype, "preview", void 0);
538
+ __decorate([
539
+ state()
540
+ ], LitAttachmentsTab.prototype, "documentData", void 0);
539
541
  LitAttachmentsTab = __decorate([
540
542
  customElement('lit-attachments-tab')
541
543
  ], LitAttachmentsTab);