@getflip/swirl-components 0.143.0 → 0.145.0

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 (46) hide show
  1. package/components.json +88 -5
  2. package/dist/cjs/index-1de6abbd.js +4 -8
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/swirl-components.cjs.js +1 -1
  5. package/dist/cjs/{swirl-tooltip.cjs.entry.js → swirl-icon-info_2.cjs.entry.js} +17 -1
  6. package/dist/cjs/swirl-lightbox.cjs.entry.js +6 -2
  7. package/dist/cjs/swirl-pdf-reader.cjs.entry.js +9 -3
  8. package/dist/cjs/swirl-table-row-group.cjs.entry.js +3 -2
  9. package/dist/collection/assets/pdfjs/pdf.worker.min.js +1 -1
  10. package/dist/collection/components/swirl-lightbox/swirl-lightbox.css +4 -0
  11. package/dist/collection/components/swirl-lightbox/swirl-lightbox.js +23 -1
  12. package/dist/collection/components/swirl-pdf-reader/swirl-pdf-reader.css +4 -0
  13. package/dist/collection/components/swirl-pdf-reader/swirl-pdf-reader.js +44 -2
  14. package/dist/collection/components/swirl-pdf-reader/swirl-pdf-reader.spec.js +1 -1
  15. package/dist/collection/components/swirl-table-row-group/swirl-table-row-group.css +10 -0
  16. package/dist/collection/components/swirl-table-row-group/swirl-table-row-group.js +19 -1
  17. package/dist/collection/components/swirl-table-row-group/swirl-table-row-group.spec.js +24 -0
  18. package/dist/components/assets/pdfjs/pdf.worker.min.js +1 -1
  19. package/dist/components/swirl-lightbox.js +7 -2
  20. package/dist/components/swirl-pdf-reader.js +11 -3
  21. package/dist/components/swirl-table-row-group.js +18 -4
  22. package/dist/esm/index-59244838.js +4 -8
  23. package/dist/esm/loader.js +1 -1
  24. package/dist/esm/swirl-components.js +1 -1
  25. package/dist/esm/{swirl-tooltip.entry.js → swirl-icon-info_2.entry.js} +18 -3
  26. package/dist/esm/swirl-lightbox.entry.js +6 -2
  27. package/dist/esm/swirl-pdf-reader.entry.js +9 -3
  28. package/dist/esm/swirl-table-row-group.entry.js +3 -2
  29. package/dist/swirl-components/p-0aa69243.entry.js +1 -0
  30. package/dist/swirl-components/p-48538311.entry.js +1 -0
  31. package/dist/swirl-components/p-553a3e99.entry.js +1 -0
  32. package/dist/swirl-components/p-e2970872.entry.js +1 -0
  33. package/dist/swirl-components/swirl-components.esm.js +1 -1
  34. package/dist/types/components/swirl-lightbox/swirl-lightbox.d.ts +1 -0
  35. package/dist/types/components/swirl-pdf-reader/swirl-pdf-reader.d.ts +2 -0
  36. package/dist/types/components/swirl-table-row-group/swirl-table-row-group.d.ts +1 -0
  37. package/dist/types/components.d.ts +8 -0
  38. package/package.json +1 -1
  39. package/vscode-data.json +16 -0
  40. package/dist/cjs/swirl-icon-info.cjs.entry.js +0 -23
  41. package/dist/esm/swirl-icon-info.entry.js +0 -19
  42. package/dist/swirl-components/p-36f03733.entry.js +0 -1
  43. package/dist/swirl-components/p-48d784ee.entry.js +0 -1
  44. package/dist/swirl-components/p-74ae3a81.entry.js +0 -1
  45. package/dist/swirl-components/p-74cef84e.entry.js +0 -1
  46. package/dist/swirl-components/p-95ee59a2.entry.js +0 -1
@@ -47,6 +47,10 @@
47
47
  }
48
48
  }
49
49
 
50
+ .lightbox--hide-menu .lightbox__menu {
51
+ display: none;
52
+ }
53
+
50
54
  .lightbox__body {
51
55
  position: relative;
52
56
  width: 100%;
@@ -82,6 +82,7 @@ export class SwirlLightbox {
82
82
  this.close();
83
83
  };
84
84
  this.closeButtonLabel = "Close modal";
85
+ this.downloadButtonEnabled = true;
85
86
  this.downloadButtonLabel = "Download";
86
87
  this.hideMenu = undefined;
87
88
  this.label = undefined;
@@ -223,10 +224,13 @@ export class SwirlLightbox {
223
224
  const currentFileName = this.getCurrentFileName();
224
225
  const currentFileType = this.getCurrentFileType();
225
226
  const currentThumbnailUrl = this.getCurrentThumbnailUrl();
227
+ const hasMenuItems = Boolean(this.el.querySelector("[slot='menu-items']")) ||
228
+ this.downloadButtonEnabled;
226
229
  const className = classnames("lightbox", {
227
230
  "lightbox--closing": this.closing,
231
+ "lightbox--hide-menu": !hasMenuItems,
228
232
  });
229
- return (h(Host, null, h("section", { "aria-hidden": "true", "aria-label": this.label, class: className, id: "lightbox", onMouseDown: this.onPointerDown, onMouseMove: this.onPointerMove, onMouseOut: this.onPointerUp, onMouseUp: this.onPointerUp, onTouchEnd: this.onPointerUp, onTouchMove: this.onPointerMove, onTouchStart: this.onPointerDown, ref: (el) => (this.modalEl = el) }, h("div", { class: "lightbox__body", role: "document" }, h("header", { class: "lightbox__header" }, h("button", { "aria-label": this.closeButtonLabel, class: "lightbox__close-button", onClick: this.onCloseButtonClick }, h("swirl-icon-close", null)), !this.hideMenu && (h("swirl-popover-trigger", { popover: this.menu }, h("button", { "aria-label": this.menuTriggerLabel, class: "lightbox__menu-button" }, h("swirl-icon-more-vertikal", null))))), h("div", { "aria-roledescription": "carousel", class: "lightbox__content", role: "group" }, h("div", { "aria-atomic": "false", "aria-live": "polite", class: "lightbox__slides", onClick: this.onBackdropClick, ref: (el) => (this.slidesContainer = el) }, h("slot", { onSlotchange: this.registerSlides }))), h("div", { class: "lightbox__controls" }, h("button", { "aria-label": this.previousSlideButtonLabel, class: "lightbox__previous-slide-button", disabled: this.activeSlideIndex === 0, onClick: this.onPreviousSlideClick }, h("swirl-icon-arrow-left", null)), h("button", { "aria-label": this.nextSlideButtonLabel, class: "lightbox__next-slide-button", disabled: this.activeSlideIndex === this.slides.length - 1, onClick: this.onNextSlideClick }, h("swirl-icon-arrow-right", null))), showPagination && (h("span", { class: "lightbox__pagination" }, h("span", { "aria-current": "page" }, this.activeSlideIndex + 1), " /", " ", this.slides.length))), !this.hideMenu && (h("swirl-popover", { animation: "scale-in-y", disableScrollLock: true, id: "slide-menu", label: this.menuLabel, placement: "bottom-end", ref: (el) => (this.menu = el) }, h("swirl-stack", null, h("div", { class: "lightbox__meta" }, currentThumbnailUrl && (h("div", { class: "lightbox__thumbnail" }, h("swirl-thumbnail", { alt: "", src: currentThumbnailUrl }))), h("div", { class: "lightbox__file-info" }, h("swirl-text", { truncate: true, weight: "semibold" }, currentFileName), h("swirl-text", { color: "subdued", size: "sm", truncate: true }, currentFileType))), h("swirl-separator", null), h("swirl-action-list", null, h("swirl-action-list-item", { icon: "<swirl-icon-download></swirl-icon-download>", label: this.downloadButtonLabel, onClick: this.onDownloadButtonClick }), h("slot", { name: "menu-items" }))))))));
233
+ return (h(Host, null, h("section", { "aria-hidden": "true", "aria-label": this.label, class: className, id: "lightbox", onMouseDown: this.onPointerDown, onMouseMove: this.onPointerMove, onMouseOut: this.onPointerUp, onMouseUp: this.onPointerUp, onTouchEnd: this.onPointerUp, onTouchMove: this.onPointerMove, onTouchStart: this.onPointerDown, ref: (el) => (this.modalEl = el) }, h("div", { class: "lightbox__body", role: "document" }, h("header", { class: "lightbox__header" }, h("button", { "aria-label": this.closeButtonLabel, class: "lightbox__close-button", onClick: this.onCloseButtonClick }, h("swirl-icon-close", null)), !this.hideMenu && (h("swirl-popover-trigger", { popover: this.menu }, h("button", { "aria-label": this.menuTriggerLabel, class: "lightbox__menu-button" }, h("swirl-icon-more-vertikal", null))))), h("div", { "aria-roledescription": "carousel", class: "lightbox__content", role: "group" }, h("div", { "aria-atomic": "false", "aria-live": "polite", class: "lightbox__slides", onClick: this.onBackdropClick, ref: (el) => (this.slidesContainer = el) }, h("slot", { onSlotchange: this.registerSlides }))), h("div", { class: "lightbox__controls" }, h("button", { "aria-label": this.previousSlideButtonLabel, class: "lightbox__previous-slide-button", disabled: this.activeSlideIndex === 0, onClick: this.onPreviousSlideClick }, h("swirl-icon-arrow-left", null)), h("button", { "aria-label": this.nextSlideButtonLabel, class: "lightbox__next-slide-button", disabled: this.activeSlideIndex === this.slides.length - 1, onClick: this.onNextSlideClick }, h("swirl-icon-arrow-right", null))), showPagination && (h("span", { class: "lightbox__pagination" }, h("span", { "aria-current": "page" }, this.activeSlideIndex + 1), " /", " ", this.slides.length))), !this.hideMenu && (h("swirl-popover", { animation: "scale-in-y", disableScrollLock: true, id: "slide-menu", label: this.menuLabel, placement: "bottom-end", ref: (el) => (this.menu = el) }, h("swirl-stack", null, h("div", { class: "lightbox__meta" }, currentThumbnailUrl && (h("div", { class: "lightbox__thumbnail" }, h("swirl-thumbnail", { alt: "", src: currentThumbnailUrl }))), h("div", { class: "lightbox__file-info" }, h("swirl-text", { truncate: true, weight: "semibold" }, currentFileName), h("swirl-text", { color: "subdued", size: "sm", truncate: true }, currentFileType))), hasMenuItems && h("swirl-separator", null), h("swirl-action-list", null, this.downloadButtonEnabled && (h("swirl-action-list-item", { icon: "<swirl-icon-download></swirl-icon-download>", label: this.downloadButtonLabel, onClick: this.onDownloadButtonClick })), h("slot", { name: "menu-items" }))))))));
230
234
  }
231
235
  static get is() { return "swirl-lightbox"; }
232
236
  static get encapsulation() { return "shadow"; }
@@ -260,6 +264,24 @@ export class SwirlLightbox {
260
264
  "reflect": false,
261
265
  "defaultValue": "\"Close modal\""
262
266
  },
267
+ "downloadButtonEnabled": {
268
+ "type": "boolean",
269
+ "mutable": false,
270
+ "complexType": {
271
+ "original": "boolean",
272
+ "resolved": "boolean",
273
+ "references": {}
274
+ },
275
+ "required": false,
276
+ "optional": true,
277
+ "docs": {
278
+ "tags": [],
279
+ "text": ""
280
+ },
281
+ "attribute": "download-button-enabled",
282
+ "reflect": false,
283
+ "defaultValue": "true"
284
+ },
263
285
  "downloadButtonLabel": {
264
286
  "type": "string",
265
287
  "mutable": false,
@@ -51,6 +51,10 @@
51
51
  left: calc(var(--s-space-16) + var(--thumbnails-width));
52
52
  }
53
53
 
54
+ .pdf-reader--hide-menu .pdf-reader__menu {
55
+ display: none;
56
+ }
57
+
54
58
  .pdf-reader__body {
55
59
  position: relative;
56
60
  width: 100%;
@@ -71,6 +71,7 @@ export class SwirlPdfReader {
71
71
  };
72
72
  this.autoZoomLabel = "Full width";
73
73
  this.closeButtonLabel = "Close PDF viewer";
74
+ this.downloadButtonEnabled = true;
74
75
  this.downloadButtonLabel = "Download PDF";
75
76
  this.file = undefined;
76
77
  this.fileTypeLabel = "PDF Document";
@@ -78,6 +79,7 @@ export class SwirlPdfReader {
78
79
  this.menuLabel = "File menu";
79
80
  this.menuTriggerLabel = "Open file menu";
80
81
  this.pdfWorkerSrc = undefined;
82
+ this.printButtonEnabled = true;
81
83
  this.printButtonLabel = "Print PDF";
82
84
  this.sideBySideButtonLabel = "Toggle side by side view";
83
85
  this.thumbnailButtonLabel = "Scroll to page";
@@ -159,8 +161,12 @@ export class SwirlPdfReader {
159
161
  : this.desktopZoomSteps;
160
162
  }
161
163
  render() {
164
+ const hasMenuItems = Boolean(this.el.querySelector("[slot='menu-items']")) ||
165
+ this.printButtonEnabled ||
166
+ this.downloadButtonEnabled;
162
167
  const className = classnames("pdf-reader", {
163
168
  "pdf-reader--closing": this.closing,
169
+ "pdf-reader--hide-menu": !hasMenuItems,
164
170
  "pdf-reader--show-thumbnails": this.showThumbnails,
165
171
  });
166
172
  return (h(Host, null, h("section", { "aria-hidden": "true", "aria-label": this.label, class: className, id: "pdf-reader", onKeyDown: this.onKeyDown, ref: (el) => (this.modalEl = el) }, h("div", { class: "pdf-reader__body", role: "document" }, h("header", { class: "pdf-reader__header" }, h("span", { class: "pdf-reader__header-left" }, h("swirl-button", { class: "pdf-reader__close-button", hideLabel: true, icon: "<swirl-icon-close></swirl-icon-close>", label: this.closeButtonLabel, onClick: this.onCloseButtonClick }), h("span", { class: "pdf-reader__label" }, this.label)), h("span", { class: "pdf-reader__header-center" }, h("span", { class: "pdf-reader__zoom-button-container" }, h("swirl-button", { class: "pdf-reader__zoom-button", disabled: this.zoom === this.zoomSteps[0], hideLabel: true, icon: "<swirl-icon-remove></swirl-icon-remove>", label: this.zoomOutButtonLabel, onClick: this.onZoomOutButtonClick }), h("swirl-button", { class: "pdf-reader__zoom-button", disabled: this.zoom === this.zoomSteps[this.zoomSteps.length - 1], hideLabel: true, icon: "<swirl-icon-add></swirl-icon-add>", label: this.zoomInButtonLabel, onClick: this.onZoomInButtonClick })), h("span", { class: "pdf-reader__zoom-select-container" }, h("select", { "aria-label": this.zoomSelectLabel, class: "pdf-reader__zoom-select", name: "zoom-select", id: "zoom-select", onChange: this.onZoomChange }, h("option", { selected: this.zoom === "auto", value: "auto" }, this.autoZoomLabel), this.zoomSteps.map((zoom) => (h("option", { key: zoom, selected: this.zoom === zoom, value: zoom }, zoom * 100, "%")))), h("swirl-icon-expand-more", { class: "pdf-reader__zoom-select-icon" }))), h("span", { class: "pdf-reader__header-right" }, h("swirl-popover-trigger", { popover: this.menu }, h("swirl-button", { class: "pdf-reader__menu-button", hideLabel: true, icon: "<swirl-icon-more-vertikal></swirl-icon-more-vertikal>", label: this.menuTriggerLabel }))), h("span", { class: "pdf-reader__floating-tools" }, h("button", { "aria-label": this.sideBySideButtonLabel, class: "pdf-reader__floating-tool-button", onClick: this.toggleViewMode, type: "button" }, h("swirl-icon-menu-book", null)), h("button", { "aria-controls": "thumbnails", "aria-expanded": String(Boolean(this.showThumbnails)), "aria-label": this.thumbnailsButtonLabel, class: "pdf-reader__floating-tool-button", onClick: this.toggleThumbnals, type: "button" }, h("swirl-icon-file-copy", null)))), h("div", { class: "pdf-reader__content" }, h("nav", { "aria-label": this.thumbnailsLabel, class: "pdf-reader__thumbnails", id: "thumbnails" }, this.thumbnails.map((thumbnail, index) => {
@@ -168,9 +174,9 @@ export class SwirlPdfReader {
168
174
  "pdf-reader__thumbnail--active": this.visiblePages[0] === index + 1,
169
175
  });
170
176
  return (h("button", { "aria-label": `${this.thumbnailButtonLabel} ${index + 1}`, class: thumbnailClassName, onClick: this.onThumbnailClick(index), type: "button" }, h("img", { src: thumbnail.toDataURL("image/png"), alt: "" })));
171
- })), h("swirl-file-viewer", { active: this.active, class: "pdf-reader__viewer", file: this.file, onActivate: this.onActivate, onVisiblePagesChange: this.onVisiblePagesChange, pdfWorkerSrc: this.pdfWorkerSrc, ref: (el) => (this.viewer = el), type: "application/pdf", viewMode: this.viewMode, zoom: this.zoom }), h("div", { class: "pdf-reader__mobile-zoom-controls" }, h("button", { "aria-label": this.autoZoomLabel, class: "pdf-reader__mobile-zoom-button", onClick: this.onZoomAutoButtonClick, type: "button" }, this.zoom === "auto" ? (h("swirl-icon-fullscreen-exit", null)) : (h("swirl-icon-fullscreen", null))), h("button", { "aria-label": this.zoomInButtonLabel, class: "pdf-reader__mobile-zoom-button", disabled: this.zoom === this.zoomSteps[this.zoomSteps.length - 1], onClick: this.onZoomInButtonClick, type: "button" }, h("swirl-icon-add", null)), h("button", { "aria-label": this.zoomOutButtonLabel, class: "pdf-reader__mobile-zoom-button", disabled: this.zoom === this.zoomSteps[0], onClick: this.onZoomOutButtonClick, type: "button" }, h("swirl-icon-remove", null))))), h("swirl-popover", { animation: "scale-in-y", disableScrollLock: true, id: "menu", label: this.menuLabel, placement: "bottom-end", ref: (el) => (this.menu = el) }, h("swirl-stack", null, h("div", { class: "pdf-reader__meta" }, h("div", { class: "pdf-reader__file-icon" }, h("svg", { fill: "none", height: "36", viewBox: "0 0 24 36", width: "24" }, h("path", { d: "M7.01755 21.6V15.192H8.39455C8.64655 15.192 8.86855 15.225 9.06055 15.291C9.25255 15.357 9.42655 15.474 9.58255 15.642C9.73855 15.81 9.84655 16.008 9.90655 16.236C9.96655 16.458 9.99655 16.761 9.99655 17.145C9.99655 17.433 9.97855 17.676 9.94255 17.874C9.91255 18.072 9.84355 18.258 9.73555 18.432C9.60955 18.642 9.44155 18.807 9.23155 18.927C9.02155 19.041 8.74555 19.098 8.40355 19.098H7.93555V21.6H7.01755ZM7.93555 16.056V18.234H8.37655C8.56255 18.234 8.70655 18.207 8.80855 18.153C8.91055 18.099 8.98555 18.024 9.03355 17.928C9.08155 17.838 9.10855 17.727 9.11455 17.595C9.12655 17.463 9.13255 17.316 9.13255 17.154C9.13255 17.004 9.12955 16.863 9.12355 16.731C9.11755 16.593 9.09055 16.473 9.04255 16.371C8.99455 16.269 8.92255 16.191 8.82655 16.137C8.73055 16.083 8.59255 16.056 8.41255 16.056H7.93555Z", fill: "white" }), h("path", { d: "M10.6826 21.6V15.192H12.0416C12.5696 15.192 12.9686 15.336 13.2386 15.624C13.5146 15.912 13.6526 16.32 13.6526 16.848V19.845C13.6526 20.445 13.5056 20.889 13.2116 21.177C12.9236 21.459 12.5066 21.6 11.9606 21.6H10.6826ZM11.6006 16.056V20.736H12.0236C12.2816 20.736 12.4646 20.673 12.5726 20.547C12.6806 20.415 12.7346 20.211 12.7346 19.935V16.848C12.7346 16.596 12.6836 16.401 12.5816 16.263C12.4796 16.125 12.2936 16.056 12.0236 16.056H11.6006Z", fill: "white" }), h("path", { d: "M14.5146 21.6V15.192H17.2506V16.056H15.4326V18H17.0166V18.864H15.4326V21.6H14.5146Z", fill: "white" }), h("path", { d: "M3.59961 9.00001C3.59961 8.0059 4.4055 7.20001 5.39961 7.20001H14.854C15.3314 7.20001 15.7893 7.38965 16.1268 7.72722L19.8724 11.4728C20.21 11.8104 20.3996 12.2682 20.3996 12.7456V27C20.3996 27.9941 19.5937 28.8 18.5996 28.8H5.39961C4.4055 28.8 3.59961 27.9941 3.59961 27V9.00001Z", fill: "#FF574D" }), h("path", { d: "M15.5996 7.36166V10.2C15.5996 11.1941 16.4055 12 17.3996 12H20.2379C20.3237 12.1884 20.3768 12.3913 20.3937 12.6H17.3996C16.0785 12.6 15.0067 11.5325 14.9996 10.213L14.9996 7.20587C15.2083 7.2228 15.4112 7.27593 15.5996 7.36166Z", fill: "white" }), h("path", { d: "M7.01755 21.6V15.192H8.39455C8.64655 15.192 8.86855 15.225 9.06055 15.291C9.25255 15.357 9.42655 15.474 9.58255 15.642C9.73855 15.81 9.84655 16.008 9.90655 16.236C9.96655 16.458 9.99655 16.761 9.99655 17.145C9.99655 17.433 9.97855 17.676 9.94255 17.874C9.91255 18.072 9.84355 18.258 9.73555 18.432C9.60955 18.642 9.44155 18.807 9.23155 18.927C9.02155 19.041 8.74555 19.098 8.40355 19.098H7.93555V21.6H7.01755ZM7.93555 16.056V18.234H8.37655C8.56255 18.234 8.70655 18.207 8.80855 18.153C8.91055 18.099 8.98555 18.024 9.03355 17.928C9.08155 17.838 9.10855 17.727 9.11455 17.595C9.12655 17.463 9.13255 17.316 9.13255 17.154C9.13255 17.004 9.12955 16.863 9.12355 16.731C9.11755 16.593 9.09055 16.473 9.04255 16.371C8.99455 16.269 8.92255 16.191 8.82655 16.137C8.73055 16.083 8.59255 16.056 8.41255 16.056H7.93555Z", fill: "white" }), h("path", { d: "M10.6826 21.6V15.192H12.0416C12.5696 15.192 12.9686 15.336 13.2386 15.624C13.5146 15.912 13.6526 16.32 13.6526 16.848V19.845C13.6526 20.445 13.5056 20.889 13.2116 21.177C12.9236 21.459 12.5066 21.6 11.9606 21.6H10.6826ZM11.6006 16.056V20.736H12.0236C12.2816 20.736 12.4646 20.673 12.5726 20.547C12.6806 20.415 12.7346 20.211 12.7346 19.935V16.848C12.7346 16.596 12.6836 16.401 12.5816 16.263C12.4796 16.125 12.2936 16.056 12.0236 16.056H11.6006Z", fill: "white" }), h("path", { d: "M14.5146 21.6V15.192H17.2506V16.056H15.4326V18H17.0166V18.864H15.4326V21.6H14.5146Z", fill: "white" }))), h("div", { class: "pdf-reader__file-info" }, h("swirl-text", { truncate: true, weight: "semibold" }, this.label), h("swirl-text", { color: "subdued", size: "sm", truncate: true }, this.fileTypeLabel))), h("swirl-separator", null), h("swirl-action-list", null, h("swirl-action-list-item", { class: "pdf-reader__print-button", icon: "<swirl-icon-print></swirl-icon-print>", label: this.printButtonLabel, onClick: this.onPrintButtonClick }), h("swirl-action-list-item", { class: "pdf-reader__download-button", disabled: this.downloading, icon: !this.downloading
177
+ })), h("swirl-file-viewer", { active: this.active, class: "pdf-reader__viewer", file: this.file, onActivate: this.onActivate, onVisiblePagesChange: this.onVisiblePagesChange, pdfWorkerSrc: this.pdfWorkerSrc, ref: (el) => (this.viewer = el), type: "application/pdf", viewMode: this.viewMode, zoom: this.zoom }), h("div", { class: "pdf-reader__mobile-zoom-controls" }, h("button", { "aria-label": this.autoZoomLabel, class: "pdf-reader__mobile-zoom-button", onClick: this.onZoomAutoButtonClick, type: "button" }, this.zoom === "auto" ? (h("swirl-icon-fullscreen-exit", null)) : (h("swirl-icon-fullscreen", null))), h("button", { "aria-label": this.zoomInButtonLabel, class: "pdf-reader__mobile-zoom-button", disabled: this.zoom === this.zoomSteps[this.zoomSteps.length - 1], onClick: this.onZoomInButtonClick, type: "button" }, h("swirl-icon-add", null)), h("button", { "aria-label": this.zoomOutButtonLabel, class: "pdf-reader__mobile-zoom-button", disabled: this.zoom === this.zoomSteps[0], onClick: this.onZoomOutButtonClick, type: "button" }, h("swirl-icon-remove", null))))), h("swirl-popover", { animation: "scale-in-y", disableScrollLock: true, id: "menu", label: this.menuLabel, placement: "bottom-end", ref: (el) => (this.menu = el) }, h("swirl-stack", null, h("div", { class: "pdf-reader__meta" }, h("div", { class: "pdf-reader__file-icon" }, h("svg", { fill: "none", height: "36", viewBox: "0 0 24 36", width: "24" }, h("path", { d: "M7.01755 21.6V15.192H8.39455C8.64655 15.192 8.86855 15.225 9.06055 15.291C9.25255 15.357 9.42655 15.474 9.58255 15.642C9.73855 15.81 9.84655 16.008 9.90655 16.236C9.96655 16.458 9.99655 16.761 9.99655 17.145C9.99655 17.433 9.97855 17.676 9.94255 17.874C9.91255 18.072 9.84355 18.258 9.73555 18.432C9.60955 18.642 9.44155 18.807 9.23155 18.927C9.02155 19.041 8.74555 19.098 8.40355 19.098H7.93555V21.6H7.01755ZM7.93555 16.056V18.234H8.37655C8.56255 18.234 8.70655 18.207 8.80855 18.153C8.91055 18.099 8.98555 18.024 9.03355 17.928C9.08155 17.838 9.10855 17.727 9.11455 17.595C9.12655 17.463 9.13255 17.316 9.13255 17.154C9.13255 17.004 9.12955 16.863 9.12355 16.731C9.11755 16.593 9.09055 16.473 9.04255 16.371C8.99455 16.269 8.92255 16.191 8.82655 16.137C8.73055 16.083 8.59255 16.056 8.41255 16.056H7.93555Z", fill: "white" }), h("path", { d: "M10.6826 21.6V15.192H12.0416C12.5696 15.192 12.9686 15.336 13.2386 15.624C13.5146 15.912 13.6526 16.32 13.6526 16.848V19.845C13.6526 20.445 13.5056 20.889 13.2116 21.177C12.9236 21.459 12.5066 21.6 11.9606 21.6H10.6826ZM11.6006 16.056V20.736H12.0236C12.2816 20.736 12.4646 20.673 12.5726 20.547C12.6806 20.415 12.7346 20.211 12.7346 19.935V16.848C12.7346 16.596 12.6836 16.401 12.5816 16.263C12.4796 16.125 12.2936 16.056 12.0236 16.056H11.6006Z", fill: "white" }), h("path", { d: "M14.5146 21.6V15.192H17.2506V16.056H15.4326V18H17.0166V18.864H15.4326V21.6H14.5146Z", fill: "white" }), h("path", { d: "M3.59961 9.00001C3.59961 8.0059 4.4055 7.20001 5.39961 7.20001H14.854C15.3314 7.20001 15.7893 7.38965 16.1268 7.72722L19.8724 11.4728C20.21 11.8104 20.3996 12.2682 20.3996 12.7456V27C20.3996 27.9941 19.5937 28.8 18.5996 28.8H5.39961C4.4055 28.8 3.59961 27.9941 3.59961 27V9.00001Z", fill: "#FF574D" }), h("path", { d: "M15.5996 7.36166V10.2C15.5996 11.1941 16.4055 12 17.3996 12H20.2379C20.3237 12.1884 20.3768 12.3913 20.3937 12.6H17.3996C16.0785 12.6 15.0067 11.5325 14.9996 10.213L14.9996 7.20587C15.2083 7.2228 15.4112 7.27593 15.5996 7.36166Z", fill: "white" }), h("path", { d: "M7.01755 21.6V15.192H8.39455C8.64655 15.192 8.86855 15.225 9.06055 15.291C9.25255 15.357 9.42655 15.474 9.58255 15.642C9.73855 15.81 9.84655 16.008 9.90655 16.236C9.96655 16.458 9.99655 16.761 9.99655 17.145C9.99655 17.433 9.97855 17.676 9.94255 17.874C9.91255 18.072 9.84355 18.258 9.73555 18.432C9.60955 18.642 9.44155 18.807 9.23155 18.927C9.02155 19.041 8.74555 19.098 8.40355 19.098H7.93555V21.6H7.01755ZM7.93555 16.056V18.234H8.37655C8.56255 18.234 8.70655 18.207 8.80855 18.153C8.91055 18.099 8.98555 18.024 9.03355 17.928C9.08155 17.838 9.10855 17.727 9.11455 17.595C9.12655 17.463 9.13255 17.316 9.13255 17.154C9.13255 17.004 9.12955 16.863 9.12355 16.731C9.11755 16.593 9.09055 16.473 9.04255 16.371C8.99455 16.269 8.92255 16.191 8.82655 16.137C8.73055 16.083 8.59255 16.056 8.41255 16.056H7.93555Z", fill: "white" }), h("path", { d: "M10.6826 21.6V15.192H12.0416C12.5696 15.192 12.9686 15.336 13.2386 15.624C13.5146 15.912 13.6526 16.32 13.6526 16.848V19.845C13.6526 20.445 13.5056 20.889 13.2116 21.177C12.9236 21.459 12.5066 21.6 11.9606 21.6H10.6826ZM11.6006 16.056V20.736H12.0236C12.2816 20.736 12.4646 20.673 12.5726 20.547C12.6806 20.415 12.7346 20.211 12.7346 19.935V16.848C12.7346 16.596 12.6836 16.401 12.5816 16.263C12.4796 16.125 12.2936 16.056 12.0236 16.056H11.6006Z", fill: "white" }), h("path", { d: "M14.5146 21.6V15.192H17.2506V16.056H15.4326V18H17.0166V18.864H15.4326V21.6H14.5146Z", fill: "white" }))), h("div", { class: "pdf-reader__file-info" }, h("swirl-text", { truncate: true, weight: "semibold" }, this.label), h("swirl-text", { color: "subdued", size: "sm", truncate: true }, this.fileTypeLabel))), hasMenuItems && h("swirl-separator", null), h("swirl-action-list", { class: "pdf-reader__menu" }, this.printButtonEnabled && (h("swirl-action-list-item", { class: "pdf-reader__print-button", icon: "<swirl-icon-print></swirl-icon-print>", label: this.printButtonLabel, onClick: this.onPrintButtonClick })), this.downloadButtonEnabled && (h("swirl-action-list-item", { class: "pdf-reader__download-button", disabled: this.downloading, icon: !this.downloading
172
178
  ? "<swirl-icon-download></swirl-icon-download>"
173
- : '<swirl-spinner size="xs"></swirl-spinner>', label: this.downloadButtonLabel, onClick: this.onDownloadButtonClick }), h("slot", { name: "menu-items" })))))));
179
+ : '<swirl-spinner size="xs"></swirl-spinner>', label: this.downloadButtonLabel, onClick: this.onDownloadButtonClick })), h("slot", { name: "menu-items" })))))));
174
180
  }
175
181
  static get is() { return "swirl-pdf-reader"; }
176
182
  static get encapsulation() { return "shadow"; }
@@ -222,6 +228,24 @@ export class SwirlPdfReader {
222
228
  "reflect": false,
223
229
  "defaultValue": "\"Close PDF viewer\""
224
230
  },
231
+ "downloadButtonEnabled": {
232
+ "type": "boolean",
233
+ "mutable": false,
234
+ "complexType": {
235
+ "original": "boolean",
236
+ "resolved": "boolean",
237
+ "references": {}
238
+ },
239
+ "required": false,
240
+ "optional": true,
241
+ "docs": {
242
+ "tags": [],
243
+ "text": ""
244
+ },
245
+ "attribute": "download-button-enabled",
246
+ "reflect": false,
247
+ "defaultValue": "true"
248
+ },
225
249
  "downloadButtonLabel": {
226
250
  "type": "string",
227
251
  "mutable": false,
@@ -345,6 +369,24 @@ export class SwirlPdfReader {
345
369
  "attribute": "pdf-worker-src",
346
370
  "reflect": false
347
371
  },
372
+ "printButtonEnabled": {
373
+ "type": "boolean",
374
+ "mutable": false,
375
+ "complexType": {
376
+ "original": "boolean",
377
+ "resolved": "boolean",
378
+ "references": {}
379
+ },
380
+ "required": false,
381
+ "optional": true,
382
+ "docs": {
383
+ "tags": [],
384
+ "text": ""
385
+ },
386
+ "attribute": "print-button-enabled",
387
+ "reflect": false,
388
+ "defaultValue": "true"
389
+ },
348
390
  "printButtonLabel": {
349
391
  "type": "string",
350
392
  "mutable": false,
@@ -102,7 +102,7 @@ describe("swirl-pdf-reader", () => {
102
102
  </div>
103
103
  </div>
104
104
  <swirl-separator></swirl-separator>
105
- <swirl-action-list>
105
+ <swirl-action-list class="pdf-reader__menu">
106
106
  <swirl-action-list-item class="pdf-reader__print-button" icon="<swirl-icon-print></swirl-icon-print>" label="Print PDF"></swirl-action-list-item>
107
107
  <swirl-action-list-item class="pdf-reader__download-button" icon="<swirl-icon-download></swirl-icon-download>" label="Download PDF"></swirl-action-list-item>
108
108
  <slot name="menu-items"></slot>
@@ -24,3 +24,13 @@
24
24
  left: var(--s-space-16)
25
25
  }
26
26
  }
27
+
28
+ .table-row-group__tooltip {
29
+ display: inline-flex;
30
+ vertical-align: middle;
31
+ margin-left: var(--s-space-4);
32
+ }
33
+
34
+ .table-row-group__tooltip-icon {
35
+ color: var(--s-icon-default);
36
+ }
@@ -5,10 +5,11 @@ import { h, Host } from "@stencil/core";
5
5
  export class SwirlTableRowGroup {
6
6
  constructor() {
7
7
  this.label = undefined;
8
+ this.tooltip = undefined;
8
9
  }
9
10
  render() {
10
11
  const rowspan = this.el.querySelectorAll("swirl-table-row").length;
11
- return (h(Host, { class: "table-row-group", role: "rowgroup" }, h("div", { class: "table-row-group__header-row", role: "row" }, h("span", { "aria-rowspan": rowspan, class: "table-row-group__label", role: "rowheader" }, this.label)), h("slot", null)));
12
+ return (h(Host, { class: "table-row-group", role: "rowgroup" }, h("div", { class: "table-row-group__header-row", role: "row" }, h("span", { "aria-rowspan": rowspan, class: "table-row-group__label", role: "rowheader" }, this.label, this.tooltip && (h("span", { class: "table-row-group__tooltip" }, h("swirl-tooltip", { content: this.tooltip, position: "top" }, h("swirl-icon-info", { size: 16, tabIndex: 0, class: "table-row-group__tooltip-icon" })))))), h("slot", null)));
12
13
  }
13
14
  static get is() { return "swirl-table-row-group"; }
14
15
  static get encapsulation() { return "shadow"; }
@@ -40,6 +41,23 @@ export class SwirlTableRowGroup {
40
41
  },
41
42
  "attribute": "label",
42
43
  "reflect": false
44
+ },
45
+ "tooltip": {
46
+ "type": "string",
47
+ "mutable": false,
48
+ "complexType": {
49
+ "original": "string",
50
+ "resolved": "string",
51
+ "references": {}
52
+ },
53
+ "required": false,
54
+ "optional": true,
55
+ "docs": {
56
+ "tags": [],
57
+ "text": ""
58
+ },
59
+ "attribute": "tooltip",
60
+ "reflect": false
43
61
  }
44
62
  };
45
63
  }
@@ -20,4 +20,28 @@ describe("swirl-table-row-group", () => {
20
20
  </swirl-table-row-group>
21
21
  `);
22
22
  });
23
+ it("renders its label and content with tooltip", async () => {
24
+ const page = await newSpecPage({
25
+ components: [SwirlTableRowGroup],
26
+ html: `<swirl-table-row-group label="Label" tooltip="Test">Content</swirl-table-row-group>`,
27
+ });
28
+ expect(page.root).toEqualHtml(`
29
+ <swirl-table-row-group class="table-row-group" label="Label" role="rowgroup" tooltip="Test">
30
+ <mock:shadow-root>
31
+ <div class="table-row-group__header-row" role="row">
32
+ <span aria-rowspan="0" class="table-row-group__label" role="rowheader">
33
+ Label
34
+ <span class="table-row-group__tooltip">
35
+ <swirl-tooltip content="Test" position="top">
36
+ <swirl-icon-info class="table-row-group__tooltip-icon" size="16" tabindex="0"></swirl-icon-info>
37
+ </swirl-tooltip>
38
+ </span>
39
+ </span>
40
+ </div>
41
+ <slot></slot>
42
+ </mock:shadow-root>
43
+ Content
44
+ </swirl-table-row-group>
45
+ `);
46
+ });
23
47
  });