@limetech/lime-crm-building-blocks 1.113.4 → 1.114.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 (177) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/extension-mapping-63bdafd3.js +57 -0
  3. package/dist/cjs/file-extension-7c2eae39.js +22 -0
  4. package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
  5. package/dist/cjs/limebb-document-chips.cjs.entry.js +407 -0
  6. package/dist/cjs/limebb-document-item.cjs.entry.js +2 -2
  7. package/dist/cjs/limebb-document-picker.cjs.entry.js +1 -1
  8. package/dist/cjs/limebb-feed-item-thumbnail-file-info.cjs.entry.js +1 -1
  9. package/dist/cjs/limebb-feed-timeline-item.cjs.entry.js +1 -1
  10. package/dist/cjs/limebb-feed.cjs.entry.js +1 -1
  11. package/dist/cjs/limebb-icon-picker.cjs.entry.js +1 -1
  12. package/dist/cjs/limebb-info-tile-format.cjs.entry.js +1 -1
  13. package/dist/cjs/limebb-info-tile.cjs.entry.js +1 -1
  14. package/dist/cjs/limebb-kanban-group.cjs.entry.js +1 -1
  15. package/dist/cjs/limebb-kanban-item.cjs.entry.js +1 -1
  16. package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +1 -1
  17. package/dist/cjs/limebb-lime-query-filter-builder_3.cjs.entry.js +2 -2
  18. package/dist/cjs/limebb-lime-query-filter-comparison_2.cjs.entry.js +1 -1
  19. package/dist/cjs/limebb-lime-query-filter-group_3.cjs.entry.js +3 -3
  20. package/dist/cjs/limebb-lime-query-order-by-item.cjs.entry.js +2 -2
  21. package/dist/cjs/limebb-lime-query-response-format-builder.cjs.entry.js +1 -1
  22. package/dist/cjs/limebb-lime-query-response-format-editor_2.cjs.entry.js +1 -1
  23. package/dist/cjs/limebb-limeobject-file-viewer.cjs.entry.js +2 -55
  24. package/dist/cjs/limebb-live-docs-info.cjs.entry.js +2 -2
  25. package/dist/cjs/limebb-locale-picker.cjs.entry.js +1 -1
  26. package/dist/cjs/limebb-mention-group-counter.cjs.entry.js +2 -2
  27. package/dist/cjs/limebb-navigation-button_2.cjs.entry.js +25 -3
  28. package/dist/cjs/limebb-notification-item.cjs.entry.js +1 -1
  29. package/dist/cjs/limebb-object-chip.cjs.entry.js +1 -1
  30. package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +2 -2
  31. package/dist/cjs/limebb-text-editor.cjs.entry.js +1 -1
  32. package/dist/cjs/limebb-trend-indicator.cjs.entry.js +1 -1
  33. package/dist/cjs/loader.cjs.js +1 -1
  34. package/dist/collection/collection-manifest.json +1 -0
  35. package/dist/collection/components/document-chips/document-chips.css +20 -0
  36. package/dist/collection/components/document-chips/document-chips.js +178 -0
  37. package/dist/collection/components/document-chips/document-chips.types.js +1 -0
  38. package/dist/collection/components/document-picker/document-item/document-item.js +2 -2
  39. package/dist/collection/components/document-picker/document-picker.js +1 -1
  40. package/dist/collection/components/feed/feed-item/feed-timeline-item.js +1 -1
  41. package/dist/collection/components/feed/feed-item-thumbnail-file-info/feed-item-thumbnail-file-info.js +1 -1
  42. package/dist/collection/components/feed/feed.js +1 -1
  43. package/dist/collection/components/icon-picker/icon-picker.js +1 -1
  44. package/dist/collection/components/info-tile/format/config/info-tile-format.js +1 -1
  45. package/dist/collection/components/info-tile/info-tile.js +1 -1
  46. package/dist/collection/components/kanban/kanban-group/kanban-group.js +1 -1
  47. package/dist/collection/components/kanban/kanban-item/kanban-item.js +1 -1
  48. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison.js +1 -1
  49. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.js +2 -2
  50. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.js +1 -1
  51. package/dist/collection/components/lime-query-builder/lime-query-builder.js +1 -1
  52. package/dist/collection/components/lime-query-builder/lime-query-response-format-builder.js +1 -1
  53. package/dist/collection/components/lime-query-builder/limetype-field/limetype-field.js +1 -1
  54. package/dist/collection/components/lime-query-builder/order-by/order-by-editor.js +1 -1
  55. package/dist/collection/components/lime-query-builder/order-by/order-by-item.js +2 -2
  56. package/dist/collection/components/lime-query-builder/response-format/response-format-item.js +1 -1
  57. package/dist/collection/components/limeobject/file-viewer/live-docs-info.js +2 -2
  58. package/dist/collection/components/locale-picker/locale-picker.js +1 -1
  59. package/dist/collection/components/notification-list/notification-item/notification-item.js +1 -1
  60. package/dist/collection/components/object-chip/object-chip.css +1 -0
  61. package/dist/collection/components/percentage-visualizer/percentage-visualizer.js +2 -2
  62. package/dist/collection/components/summary-popover/summary-popover.js +49 -3
  63. package/dist/collection/components/text-editor/mention-group-counter.js +2 -2
  64. package/dist/collection/components/text-editor/text-editor.js +1 -1
  65. package/dist/collection/components/trend-indicator/trend-indicator.js +1 -1
  66. package/dist/collection/util/file-extension.js +18 -0
  67. package/dist/collection/util/file-icon-background-colors.js +98 -0
  68. package/dist/collection/util/file-icon-fill-colors.js +98 -0
  69. package/dist/collection/util/file-icon.js +18 -0
  70. package/dist/collection/util/file-icons.js +99 -0
  71. package/dist/components/document-item.js +2 -2
  72. package/dist/components/extension-mapping.js +55 -0
  73. package/dist/components/feed-item-thumbnail-file-info.js +1 -1
  74. package/dist/components/feed-timeline-item.js +1 -1
  75. package/dist/components/kanban-group.js +1 -1
  76. package/dist/components/kanban-item.js +1 -1
  77. package/dist/components/lime-query-filter-comparison.js +1 -1
  78. package/dist/components/lime-query-filter-expression.js +3 -3
  79. package/dist/components/limebb-document-chips.d.ts +11 -0
  80. package/dist/components/limebb-document-chips.js +437 -0
  81. package/dist/components/limebb-document-picker.js +1 -1
  82. package/dist/components/limebb-feed.js +1 -1
  83. package/dist/components/limebb-icon-picker.js +1 -1
  84. package/dist/components/limebb-info-tile-format.js +1 -1
  85. package/dist/components/limebb-info-tile.js +1 -1
  86. package/dist/components/limebb-lime-query-builder.js +1 -1
  87. package/dist/components/limebb-lime-query-response-format-builder.js +1 -1
  88. package/dist/components/limebb-limeobject-file-viewer.js +1 -54
  89. package/dist/components/limebb-locale-picker.js +1 -1
  90. package/dist/components/limebb-mention-group-counter.js +2 -2
  91. package/dist/components/limebb-object-chip.js +1 -1
  92. package/dist/components/limebb-text-editor.js +1 -1
  93. package/dist/components/limebb-trend-indicator.js +1 -1
  94. package/dist/components/limetype-field.js +1 -1
  95. package/dist/components/live-docs-info.js +2 -2
  96. package/dist/components/notification-item.js +1 -1
  97. package/dist/components/order-by-editor.js +1 -1
  98. package/dist/components/order-by-item.js +2 -2
  99. package/dist/components/percentage-visualizer.js +2 -2
  100. package/dist/components/response-format-item.js +1 -1
  101. package/dist/components/summary-popover.js +45 -4
  102. package/dist/esm/extension-mapping-fcade195.js +55 -0
  103. package/dist/esm/file-extension-568475d1.js +20 -0
  104. package/dist/esm/lime-crm-building-blocks.js +1 -1
  105. package/dist/esm/limebb-document-chips.entry.js +403 -0
  106. package/dist/esm/limebb-document-item.entry.js +2 -2
  107. package/dist/esm/limebb-document-picker.entry.js +1 -1
  108. package/dist/esm/limebb-feed-item-thumbnail-file-info.entry.js +1 -1
  109. package/dist/esm/limebb-feed-timeline-item.entry.js +1 -1
  110. package/dist/esm/limebb-feed.entry.js +1 -1
  111. package/dist/esm/limebb-icon-picker.entry.js +1 -1
  112. package/dist/esm/limebb-info-tile-format.entry.js +1 -1
  113. package/dist/esm/limebb-info-tile.entry.js +1 -1
  114. package/dist/esm/limebb-kanban-group.entry.js +1 -1
  115. package/dist/esm/limebb-kanban-item.entry.js +1 -1
  116. package/dist/esm/limebb-lime-query-builder.entry.js +1 -1
  117. package/dist/esm/limebb-lime-query-filter-builder_3.entry.js +2 -2
  118. package/dist/esm/limebb-lime-query-filter-comparison_2.entry.js +1 -1
  119. package/dist/esm/limebb-lime-query-filter-group_3.entry.js +3 -3
  120. package/dist/esm/limebb-lime-query-order-by-item.entry.js +2 -2
  121. package/dist/esm/limebb-lime-query-response-format-builder.entry.js +1 -1
  122. package/dist/esm/limebb-lime-query-response-format-editor_2.entry.js +1 -1
  123. package/dist/esm/limebb-limeobject-file-viewer.entry.js +1 -54
  124. package/dist/esm/limebb-live-docs-info.entry.js +2 -2
  125. package/dist/esm/limebb-locale-picker.entry.js +1 -1
  126. package/dist/esm/limebb-mention-group-counter.entry.js +2 -2
  127. package/dist/esm/limebb-navigation-button_2.entry.js +25 -3
  128. package/dist/esm/limebb-notification-item.entry.js +1 -1
  129. package/dist/esm/limebb-object-chip.entry.js +1 -1
  130. package/dist/esm/limebb-percentage-visualizer.entry.js +2 -2
  131. package/dist/esm/limebb-text-editor.entry.js +1 -1
  132. package/dist/esm/limebb-trend-indicator.entry.js +1 -1
  133. package/dist/esm/loader.js +1 -1
  134. package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
  135. package/dist/lime-crm-building-blocks/{p-0c25d565.entry.js → p-0d0f4c0f.entry.js} +1 -1
  136. package/dist/lime-crm-building-blocks/{p-35b75e49.entry.js → p-18d1ab86.entry.js} +1 -1
  137. package/dist/lime-crm-building-blocks/{p-551ffa9f.entry.js → p-1e3e06be.entry.js} +1 -1
  138. package/dist/lime-crm-building-blocks/{p-ddf0dcbc.entry.js → p-20b5ff30.entry.js} +1 -1
  139. package/dist/lime-crm-building-blocks/{p-b2e705bc.entry.js → p-22fffe85.entry.js} +1 -1
  140. package/dist/lime-crm-building-blocks/{p-83ff2b4c.entry.js → p-2ed843e9.entry.js} +1 -1
  141. package/dist/lime-crm-building-blocks/{p-14cd62c1.entry.js → p-375f40d9.entry.js} +1 -1
  142. package/dist/lime-crm-building-blocks/{p-c09dcd4c.entry.js → p-3a7b37cc.entry.js} +1 -1
  143. package/dist/lime-crm-building-blocks/{p-3443a292.entry.js → p-3b3e7328.entry.js} +1 -1
  144. package/dist/lime-crm-building-blocks/{p-a4f367f8.entry.js → p-4dad4ce8.entry.js} +1 -1
  145. package/dist/lime-crm-building-blocks/p-50aad872.entry.js +1 -0
  146. package/dist/lime-crm-building-blocks/{p-9161869b.entry.js → p-53d54dc8.entry.js} +1 -1
  147. package/dist/lime-crm-building-blocks/{p-1d44c670.entry.js → p-6bd5c65f.entry.js} +1 -1
  148. package/dist/lime-crm-building-blocks/p-6bf1ab6d.entry.js +1 -0
  149. package/dist/lime-crm-building-blocks/{p-0536bf83.entry.js → p-7a6c1595.entry.js} +1 -1
  150. package/dist/lime-crm-building-blocks/{p-9aad6195.entry.js → p-7b5a1e83.entry.js} +1 -1
  151. package/dist/lime-crm-building-blocks/{p-df13ebba.entry.js → p-812bf26e.entry.js} +1 -1
  152. package/dist/lime-crm-building-blocks/{p-385020b4.entry.js → p-81f8e5df.entry.js} +1 -1
  153. package/dist/lime-crm-building-blocks/{p-4d9244e7.entry.js → p-94e6f0de.entry.js} +1 -1
  154. package/dist/lime-crm-building-blocks/{p-6c67ed0e.entry.js → p-9bc5caac.entry.js} +1 -1
  155. package/dist/lime-crm-building-blocks/{p-283a6f9e.entry.js → p-9c204549.entry.js} +1 -1
  156. package/dist/lime-crm-building-blocks/{p-00414464.entry.js → p-a7e55181.entry.js} +1 -1
  157. package/dist/lime-crm-building-blocks/p-ab2a95a6.js +1 -0
  158. package/dist/lime-crm-building-blocks/p-b42e9740.js +1 -0
  159. package/dist/lime-crm-building-blocks/{p-5d0874f6.entry.js → p-d5b835a6.entry.js} +1 -1
  160. package/dist/lime-crm-building-blocks/p-d7fc530f.entry.js +1 -0
  161. package/dist/lime-crm-building-blocks/{p-401ccdec.entry.js → p-d9f76810.entry.js} +1 -1
  162. package/dist/lime-crm-building-blocks/{p-2395476f.entry.js → p-dddd8a43.entry.js} +1 -1
  163. package/dist/lime-crm-building-blocks/{p-77ef7ad1.entry.js → p-ed14ca30.entry.js} +1 -1
  164. package/dist/lime-crm-building-blocks/{p-711df3e6.entry.js → p-f8520955.entry.js} +1 -1
  165. package/dist/types/components/document-chips/document-chips.d.ts +45 -0
  166. package/dist/types/components/document-chips/document-chips.types.d.ts +23 -0
  167. package/dist/types/components/summary-popover/summary-popover.d.ts +10 -1
  168. package/dist/types/components.d.ts +110 -0
  169. package/dist/types/interface.d.ts +1 -0
  170. package/dist/types/util/file-extension.d.ts +10 -0
  171. package/dist/types/util/file-icon-background-colors.d.ts +3 -0
  172. package/dist/types/util/file-icon-fill-colors.d.ts +3 -0
  173. package/dist/types/util/file-icon.d.ts +9 -0
  174. package/dist/types/util/file-icons.d.ts +3 -0
  175. package/package.json +2 -2
  176. package/dist/lime-crm-building-blocks/p-7b9981b9.entry.js +0 -1
  177. package/dist/lime-crm-building-blocks/p-d2bd2fc3.entry.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as e,h as o,c as t}from"./p-52cf8641.js";import{g as r}from"./p-ab2a95a6.js";import{g as i}from"./p-b42e9740.js";const a={expand:"expand",minimize:"minus_math",maximize:"minus_math",newTab:"up_right_arrow",back:"left_arrow",close:"multiply",shrink:"compress",float:"rectangle"},n=class{constructor(t){e(this,t),this.renderAsLink=()=>o("a",{class:this.getContainerClassList(),id:"tooltipId","aria-label":this.tooltipLabel&&this.tooltipHelperLabel,href:this.href,target:"newTab"===this.type?"_blank":void 0},this.renderType(),this.renderTooltip()),this.renderAsButton=()=>o("button",{class:this.getContainerClassList(),id:"tooltipId","aria-label":this.tooltipLabel&&this.tooltipHelperLabel},this.renderType(),this.renderTooltip()),this.getContainerClassList=()=>({"navigation-button":!0,[this.type]:!0})}render(){return this.href?this.renderAsLink():this.renderAsButton()}renderType(){return this.renderIcon(a[this.type])}renderTooltip(){if(this.tooltipLabel)return o("limel-tooltip",{label:this.tooltipLabel,helperLabel:this.tooltipHelperLabel,elementId:"tooltipId"})}renderIcon(e){return o("limel-icon",{name:e})}static get delegatesFocus(){return!0}};n.style='@charset "UTF-8";.navigation-button{all:unset;isolation:isolate;position:relative;display:flex;justify-content:center;align-items:center;height:1.875rem;width:1.875rem;border-radius:50%;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:var(--navigation-button-background-color, var(--lime-elevated-surface-background-color))}.navigation-button:hover,.navigation-button:focus,.navigation-button:focus-visible{will-change:color, background-color, box-shadow, transform}.navigation-button:hover,.navigation-button:focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}.navigation-button:hover{box-shadow:var(--button-shadow-hovered)}.navigation-button:active{--limel-clickable-transform-timing-function:cubic-bezier(\n 0.83,\n -0.15,\n 0.49,\n 1.16\n );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.navigation-button:hover,.navigation-button:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.navigation-button:focus{outline:none}.navigation-button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.navigation-button limel-icon{transition:color 0.2s ease, transform 0.2s cubic-bezier(0.84, 0.15, 0.52, 1.42);color:var(--header-menu-icon-color);width:1.25rem}.newTab limel-icon{transition:transform 0.2s ease;transform:scale(0.8);z-index:3}.newTab:before{z-index:2}.newTab::after{z-index:1}.newTab:before,.newTab:after{content:"";transition:transform 0.2s ease, border-color 0.2s ease;position:absolute;width:0.875rem;height:0.875rem;outline:1.5px solid rgb(var(--contrast-900));border-radius:1px;background-color:var(--navigation-button-background-color, rgb(var(--contrast-100)))}.newTab:hover limel-icon{color:var(--mdc-theme-primary);transform:translate3d(-0.1rem, 0.1rem, 0) scale(1)}.newTab:hover:before{transform:translate3d(0.125rem, -0.125rem, 0);border-color:rgb(var(--contrast-1000));box-shadow:var(--shadow-depth-8)}.newTab:hover:after{transform:translate3d(-0.15rem, 0.15rem, 0) scale(0.9);border-color:rgb(var(--contrast-700))}.expand:after{transition:transform 0.2s ease;content:"";position:absolute;z-index:1;background-color:var(--navigation-button-background-color, rgb(var(--contrast-100)));width:0.75rem;height:0.75rem}.expand:hover limel-icon{color:var(--mdc-theme-primary)}.expand:hover:after{transform:scale(0.5)}.expand:hover limel-icon{transform:scale(1.18)}.minimize:before,.minimize:after,.maximize:before,.maximize:after{content:"";transition:transform 0.3s ease-out 0.15s, background-color 0.1s ease}.minimize limel-icon,.maximize limel-icon{transition:transform 0.2s ease 0.1s}.minimize:before,.maximize:after,.maximize:hover:before{transform:scaleY(1) scaleX(1);z-index:-1;box-sizing:border-box;position:absolute;width:70%;height:60%;border-radius:0.25rem;transform-origin:bottom}.minimize:hover:before,.maximize:before{transition:transform 0.3s ease-out 0.15s, background-color 0.1s ease;transform:scaleY(0.3) scaleX(0.7);background-color:rgb(var(--contrast-500))}.minimize:hover limel-icon,.maximize limel-icon{transform:scaleX(0.8) translate3d(0, 0.4rem, 0)}.maximize limel-icon{color:rgb(var(--contrast-900))}.maximize:hover limel-icon{color:currentColor;transform:scaleX(1.1) translate3d(0, -0.1rem, 0)}.maximize:after{z-index:-2;border:1px dashed rgb(var(--contrast-800))}.close limel-icon{transition:transform 0.2s ease, color 0.2s ease}.close:before,.close:after{transition-delay:0.1s;content:"";position:absolute;inset:0;border-radius:50%;opacity:0}.close:before{transition:transform 0.3s ease, opacity 0.3s ease;background-color:rgb(var(--color-orange-dark))}.close:after{transition:transform 0.6s ease, opacity 0.6s ease;background-color:rgb(var(--color-orange-light))}.close:hover limel-icon{color:rgb(var(--color-white));transform:scale(0.7) rotate(90deg)}.close:hover:before{opacity:1;transform:scale(0.4)}.close:hover:after{opacity:0.4;transform:scale(0.6)}.float:after{transition:width 0.2s ease-out, opacity 0.2s ease;content:"";position:absolute;inset:0 0.5rem 0 auto;border-radius:1px;opacity:0.8;transform:translate3d(0, 0, 0);background-color:rgb(var(--contrast-800));width:0.125rem;height:0.6rem;margin:auto}.float:hover:after{width:0.4rem;opacity:1;transform:translate3d(0, 0, 0)}';const s=class{constructor(o){e(this,o),this.actionSelected=t(this,"actionSelected",7),this.triggerDelay=600,this.openDirection="top",this.popoverMaxWidth="20rem",this.popoverMaxHeight="min(35rem, calc(100vh - 2rem))",this.actions=[],this.isPopoverOpen=!1,this.openPopoverWithDelay=e=>{e.stopPropagation(),clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>{s.currentOpenPopover&&s.currentOpenPopover!==this&&(s.currentOpenPopover.isPopoverOpen=!1),s.currentOpenPopover=this,this.isPopoverOpen=!0}),this.triggerDelay)},this.resetTimeout=()=>{this.isPopoverOpen||clearTimeout(this.hoverTimeout)},this.onPopoverClose=e=>{e.stopPropagation(),this.isPopoverOpen=!1,s.currentOpenPopover===this&&(s.currentOpenPopover=null)},this.handleCloseClick=e=>{e.stopPropagation(),this.isPopoverOpen=!1},this.handleSelected=e=>{this.actionSelected.emit(e.detail)}}render(){return o("limel-popover",{key:"26159e81e1fd3547fe0f9b59f5edd9144778cc15",style:{"--limebb-summary-popover-timeout":`${this.triggerDelay}ms`},open:this.isPopoverOpen,onClose:this.onPopoverClose,openDirection:this.openDirection},o("div",{key:"5f6c72787f4dafebbce1428da6ba1515ecce451e",slot:"trigger",onMouseEnter:this.openPopoverWithDelay,onMouseLeave:this.resetTimeout,onFocusin:this.openPopoverWithDelay},o("slot",{key:"4a5d186f511a245d6d4c48df754add7eaf3380df",name:"trigger"}),o("div",{key:"64a9db4b3ff460b84345a60b9efccc80aa75a2cd",class:"opening-countdown-indicator"})),this.renderCard({"--navigation-button-background-color":"rgb(var(--contrast-100), 0.8)",position:"absolute",top:"0.125rem",right:"0.125rem"}))}renderCard(e){return o("limel-card",{style:{"max-width":this.popoverMaxWidth,"max-height":this.popoverMaxHeight,"min-width":"7rem","min-height":"3rem"},orientation:"landscape",heading:this.heading,subheading:this.subheading,icon:this.icon,value:this.value,image:this.image,actions:this.actions,onActionSelected:this.handleSelected},this.renderFileViewer(),o("limebb-navigation-button",{slot:"component",type:"close",style:e,tooltipLabel:"Close",tooltipHelperLabel:"Esc",onClick:this.handleCloseClick}))}renderFileViewer(){var e;if(!this.file)return;const t=i(null!==(e=this.file.filename)&&void 0!==e?e:""),a=r(t);return o("limel-file-viewer",{slot:"component",style:{flex:"1",overflow:"hidden",borderRadius:"0.5rem",minHeight:"pdf"===t?"20rem":void 0},url:this.file.href,filename:"sharepoint"===a||"unsupported"===a?void 0:this.file.filename})}};s.currentOpenPopover=null,s.style="limel-popover{--popover-border-radius:0.95rem;--popover-body-background-color:transparent;--popover-box-shadow:var(--shadow-depth-8)}div[slot=trigger]{position:relative;display:flex;align-items:center;justify-content:center}div[slot=trigger] *{min-width:0;min-height:0}.opening-countdown-indicator{position:absolute;inset:auto 0 -0.25rem 0;margin:0 auto;height:0.125rem;border-radius:1rem;transition:width ease-out, opacity ease;transition-duration:120ms;opacity:0;width:0%;background-color:var(--mdc-theme-primary)}div[slot=trigger]:not([aria-expanded=true]):hover .opening-countdown-indicator{transition-duration:var(--limebb-summary-popover-timeout);opacity:1;width:100%}";export{n as limebb_navigation_button,s as limebb_summary_popover}
@@ -1 +1 @@
1
- import{r as t,h as e,g as i}from"./p-52cf8641.js";import{c as r,a as o,f as s,Z as n,s as l,r as a}from"./p-199799ff.js";import{i as h,a as u,b as c,c as f,g as d,d as v,e as p}from"./p-5322fd19.js";import{i as g}from"./p-b31772c8.js";var b=Object.prototype.hasOwnProperty;class m{constructor(t){this.getState=t,this.contextType="info-tile"}getContext(){const{limetype:t,filterId:e,filterName:i,aggregateOperator:r,propertyName:o,value:s,label:n}=this.getState();if(!t||!e)return console.debug("InfoTileContextProvider: No limetype or filterId available"),null;const l={widgetType:"info-tile",limetype:t,filterId:e};return i&&(l.filterName=i),l.aggregateOperator=r,o&&(l.propertyName=o),void 0!==s&&(l.value=s),n&&(l.label=n),{data:l,purpose:"Shows an aggregated value from a filter. Clicking navigates to the explorer with that filter applied."}}}class w{constructor(t,e=[]){this.platform=t,this.filters=e}async load(t,e){let i;return i=this.isObjectIdentifier(e)?await this.loadLimeObjectInfoTile(t,e):await this.loadBasicInfoTile(t),i}async loadBasicInfoTile(t){const e=this.getFilter(t.filter);if(!e)throw new Error(`Filter "${t.filter}" not found`);return(await this.query.execute({limetype:e.limetype,responseFormat:{aggregates:{infotiles:{value:{op:t.operator,key:t.name}}}},filter:e.filter})).aggregates.infotiles[0].value}async loadLimeObjectInfoTile(t,e){await this.objectRepository.loadObject(e.limetype,e.id,{properties:[t]});const i=this.objectRepository.getObject(e.limetype,e.id);return null==i?void 0:i.getValue([t.name,t.key].join("."))}isObjectIdentifier(t){return Boolean((null==t?void 0:t.limetype)&&(null==t?void 0:t.id))}getFilter(t){return this.filters.find((e=>e.id===t))}get query(){return this.platform.get(r.Query)}get objectRepository(){return this.platform.get(r.LimeObjectRepository)}}class y{constructor(t){this.locale=t}format(t){let e=String(t);return"number"==typeof t?e=new Intl.NumberFormat(this.locale).format(t):new Date(t).getTime()&&(e=new Intl.DateTimeFormat(this.locale).format(new Date(t))),{value:e}}}class j{constructor(t){this.locale=t}format(t,e){const i=new Date(t);return{prefix:this.formatAffix("prefix",i,e),value:this.formatValue(i,e),suffix:this.formatAffix("suffix",i,e)}}formatValue(t,e){const i=Object.assign({},e.options);if(e.prefix)for(const t of e.prefix)delete i[t];if(e.suffix)for(const t of e.suffix)delete i[t];return new Intl.DateTimeFormat(this.locale,i).format(t)}formatAffix(t,e,i){const r=Object.assign({},i.options);for(const e of Object.keys(r))"hour12"!==e&&((i[t]||[]).includes(e)||delete r[e]);if(0!==Object.values(r).filter(Boolean).length)return new Intl.DateTimeFormat(this.locale,r).format(e)}}class O{constructor(t){this.locale=t}format(t,e){var i,r;const o=new Intl.NumberFormat(this.locale,e.options),s=o.formatToParts(t);let n="",l="",a="";for(const t of s)(null===(i=e.prefix)||void 0===i?void 0:i.includes(t.type))?n+=t.value:(null===(r=e.suffix)||void 0===r?void 0:r.includes(t.type))?a+=t.value:l+=t.value;return l||(l=o.format(t),n="",a=""),{prefix:n,value:l,suffix:a}}}class x{constructor(t){this.locale=t}format(t,e){const i=new Intl.RelativeTimeFormat(this.locale,e.options),{value:r,unit:o}=this.getRelativeTime(t),s=i.formatToParts(r,o);let n="",l="",a="";for(const t of s)"literal"!==t.type||l?"literal"===t.type&&l?a+=t.value:l+=t.value:n+=t.value;return l||(l=n||a,n="",a=""),{prefix:n,value:l,suffix:a}}getRelativeTime(t){const e=new Date(t),i=new Date,r=e.getTime()-i.getTime(),o=[{unit:"year",value:31536e6},{unit:"month",value:2592e6},{unit:"week",value:6048e5},{unit:"day",value:864e5},{unit:"hour",value:36e5},{unit:"minute",value:6e4},{unit:"second",value:1e3}];for(const t of o){const e=r/t.value;if(Math.abs(e)>=1)return{value:Math.round(e),unit:t.unit}}return{value:0,unit:"second"}}}class I{constructor(t){this.locale=t}createFormatter(t,e){return"number"===(null==t?void 0:t.type)&&"number"==typeof e?new O(this.locale):"date"===(null==t?void 0:t.type)&&"string"==typeof e?new j(this.locale):"relative-date"===(null==t?void 0:t.type)&&"string"==typeof e?new x(this.locale):new y(this.locale)}}var k=function(t,e,i,r){var o,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(n=(s<3?o(n):s>3?o(e,i,n):o(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const F=class{constructor(e){t(this,e),this.aggregateOperator=l.Count,this.loading=!1,this.error=!1}connectedCallback(){this.registerContextProvider()}disconnectedCallback(){var t;null===(t=this.unregisterContextProvider)||void 0===t||t.call(this)}componentWillLoad(){this.loadInfoTileValue()}watchFilterId(){this.loadInfoTileValue()}watchPropertyName(){this.loadInfoTileValue()}watchAggregateOperator(){this.loadInfoTileValue()}async loadInfoTileValue(){if(this.loading=!0,this.error=!1,this.getFilter()){try{const t={key:this.getKey(),name:this.propertyName,operator:this.aggregateOperator,filter:this.filterId};this.value=await this.loader.load(t,this.context)}catch(t){console.error(t),this.error=!0}this.loading=!1}else this.error=!0}getKey(){return Math.random().toString(36).slice(2)}render(){var t,i;const r=this.getFilter(),o=this.getFormattedValue(),s={disabled:this.disabled,icon:this.icon,prefix:(null===(t=null==o?void 0:o.prefix)||void 0===t?void 0:t.trim())||this.prefix,suffix:(null===(i=null==o?void 0:o.suffix)||void 0===i?void 0:i.trim())||this.suffix},n=Object.assign(Object.assign({},s),{icon:"error",prefix:"ERROR",loading:!0,label:this.getLabel(r)}),l=Object.assign(Object.assign({},s),{label:this.getLabel(r),link:this.getLink(r),loading:this.loading,value:null==o?void 0:o.value.trim()});return e("limel-info-tile",Object.assign({key:"9634fc3d797fa0382b9e0eca1eabf67c19ffa4a6",class:{error:!r||this.error}},!r||this.error?n:l))}getFormattedValue(){if(!this.value&&0!==this.value)return{value:""};try{return this.getFormatter(this.value).format(this.value,this.format)}catch(t){return new y(this.language).format(this.value)}}getLabel(t){return t?"string"==typeof this.label?this.translator.get(this.label):this.getLocalizedString(this.label&&"object"==typeof this.label?this.label:t.name):"No filter set is selected"}getLocalizedString(t){if(function(t){if(null==t)return!0;if(h(t)&&(g(t)||"string"==typeof t||"function"==typeof t.splice||u(t)||c(t)||f(t)))return!t.length;var e=d(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(v(t))return!p(t).length;for(var i in t)if(b.call(t,i))return!1;return!0}(t))return"";let e=t[this.language];return e||(e=t.en||t.en_us||Object.values(null!=e?e:{}).find((t=>!!t))),null!=e?e:""}getLink(t){if(!t)return{href:"#"};const e=["explorer",t.limetype,t.id].join("/"),i=this.getRelationPropertyName(this.limetypes[t.limetype]),r=this.buildContextAwareFilter(t.filter,i);return r?{href:`${e}?filter=${encodeURIComponent(JSON.stringify(r))}`}:{href:e}}buildContextAwareFilter(t,e){if(!e)return t;const i={key:e,op:a.EQUALS,exp:this.context.id};return t?{op:a.AND,exp:[i,t]}:{relationFilter:i}}getFilter(){var t;return null===(t=this.filters)||void 0===t?void 0:t.find((t=>t.id===this.filterId))}getFormatter(t){return new I(this.language).createFormatter(this.format,t)}getRelationPropertyName(t){var e,i,r;if(t&&this.context.limetype&&this.context.id){if(this.propertyName){const t=this.limetypes[this.context.limetype],r=null===(i=null===(e=null==t?void 0:t.getProperty(this.propertyName))||void 0===e?void 0:e.relation)||void 0===i?void 0:i.getBackreference();if(r)return r.name}return null===(r=Object.values(t.properties).find((t=>{var e;return(null===(e=t.relation)||void 0===e?void 0:e.getLimetype().name)===this.context.limetype})))||void 0===r?void 0:r.name}}get translator(){return this.platform.get(r.Translate)}get language(){return this.platform.get(r.Application).getLanguage()}get loader(){return new w(this.platform,this.filters)}registerContextProvider(){const t=this.platform.get(r.AIContextRegistry);if(!(null==t?void 0:t.register))return;const e=new m((()=>{const t=this.getFilter();return{limetype:null==t?void 0:t.limetype,filterId:this.filterId,filterName:t?this.getLocalizedString(t.name):void 0,aggregateOperator:this.aggregateOperator,propertyName:this.propertyName,value:this.value,label:this.getLabel(t)}}));this.unregisterContextProvider=t.register(e,this.host)}get host(){return i(this)}static get watchers(){return{filterId:["watchFilterId"],propertyName:["watchPropertyName"],aggregateOperator:["watchAggregateOperator"]}}};k([o({})],F.prototype,"config",void 0),k([s()],F.prototype,"filters",void 0),k([n()],F.prototype,"limetypes",void 0),F.style=":host(limebb-info-tile){display:block;overflow:visible !important;background-color:transparent !important}limel-info-tile.error{--info-tile-icon-color:rgb(var(--color-red-dark));border:1px dashed rgb(var(--contrast-500));border-radius:var(--info-tile-border-radius, 1rem)}";export{F as limebb_info_tile}
1
+ import{r as t,h as e,g as i}from"./p-52cf8641.js";import{c as r,a as o,f as s,Z as n,s as l,r as a}from"./p-199799ff.js";import{i as h,a as u,b as c,c as f,g as d,d as v,e as p}from"./p-5322fd19.js";import{i as g}from"./p-b31772c8.js";var b=Object.prototype.hasOwnProperty;class m{constructor(t){this.getState=t,this.contextType="info-tile"}getContext(){const{limetype:t,filterId:e,filterName:i,aggregateOperator:r,propertyName:o,value:s,label:n}=this.getState();if(!t||!e)return console.debug("InfoTileContextProvider: No limetype or filterId available"),null;const l={widgetType:"info-tile",limetype:t,filterId:e};return i&&(l.filterName=i),l.aggregateOperator=r,o&&(l.propertyName=o),void 0!==s&&(l.value=s),n&&(l.label=n),{data:l,purpose:"Shows an aggregated value from a filter. Clicking navigates to the explorer with that filter applied."}}}class w{constructor(t,e=[]){this.platform=t,this.filters=e}async load(t,e){let i;return i=this.isObjectIdentifier(e)?await this.loadLimeObjectInfoTile(t,e):await this.loadBasicInfoTile(t),i}async loadBasicInfoTile(t){const e=this.getFilter(t.filter);if(!e)throw new Error(`Filter "${t.filter}" not found`);return(await this.query.execute({limetype:e.limetype,responseFormat:{aggregates:{infotiles:{value:{op:t.operator,key:t.name}}}},filter:e.filter})).aggregates.infotiles[0].value}async loadLimeObjectInfoTile(t,e){await this.objectRepository.loadObject(e.limetype,e.id,{properties:[t]});const i=this.objectRepository.getObject(e.limetype,e.id);return null==i?void 0:i.getValue([t.name,t.key].join("."))}isObjectIdentifier(t){return Boolean((null==t?void 0:t.limetype)&&(null==t?void 0:t.id))}getFilter(t){return this.filters.find((e=>e.id===t))}get query(){return this.platform.get(r.Query)}get objectRepository(){return this.platform.get(r.LimeObjectRepository)}}class y{constructor(t){this.locale=t}format(t){let e=String(t);return"number"==typeof t?e=new Intl.NumberFormat(this.locale).format(t):new Date(t).getTime()&&(e=new Intl.DateTimeFormat(this.locale).format(new Date(t))),{value:e}}}class j{constructor(t){this.locale=t}format(t,e){const i=new Date(t);return{prefix:this.formatAffix("prefix",i,e),value:this.formatValue(i,e),suffix:this.formatAffix("suffix",i,e)}}formatValue(t,e){const i=Object.assign({},e.options);if(e.prefix)for(const t of e.prefix)delete i[t];if(e.suffix)for(const t of e.suffix)delete i[t];return new Intl.DateTimeFormat(this.locale,i).format(t)}formatAffix(t,e,i){const r=Object.assign({},i.options);for(const e of Object.keys(r))"hour12"!==e&&((i[t]||[]).includes(e)||delete r[e]);if(0!==Object.values(r).filter(Boolean).length)return new Intl.DateTimeFormat(this.locale,r).format(e)}}class O{constructor(t){this.locale=t}format(t,e){var i,r;const o=new Intl.NumberFormat(this.locale,e.options),s=o.formatToParts(t);let n="",l="",a="";for(const t of s)(null===(i=e.prefix)||void 0===i?void 0:i.includes(t.type))?n+=t.value:(null===(r=e.suffix)||void 0===r?void 0:r.includes(t.type))?a+=t.value:l+=t.value;return l||(l=o.format(t),n="",a=""),{prefix:n,value:l,suffix:a}}}class x{constructor(t){this.locale=t}format(t,e){const i=new Intl.RelativeTimeFormat(this.locale,e.options),{value:r,unit:o}=this.getRelativeTime(t),s=i.formatToParts(r,o);let n="",l="",a="";for(const t of s)"literal"!==t.type||l?"literal"===t.type&&l?a+=t.value:l+=t.value:n+=t.value;return l||(l=n||a,n="",a=""),{prefix:n,value:l,suffix:a}}getRelativeTime(t){const e=new Date(t),i=new Date,r=e.getTime()-i.getTime(),o=[{unit:"year",value:31536e6},{unit:"month",value:2592e6},{unit:"week",value:6048e5},{unit:"day",value:864e5},{unit:"hour",value:36e5},{unit:"minute",value:6e4},{unit:"second",value:1e3}];for(const t of o){const e=r/t.value;if(Math.abs(e)>=1)return{value:Math.round(e),unit:t.unit}}return{value:0,unit:"second"}}}class I{constructor(t){this.locale=t}createFormatter(t,e){return"number"===(null==t?void 0:t.type)&&"number"==typeof e?new O(this.locale):"date"===(null==t?void 0:t.type)&&"string"==typeof e?new j(this.locale):"relative-date"===(null==t?void 0:t.type)&&"string"==typeof e?new x(this.locale):new y(this.locale)}}var k=function(t,e,i,r){var o,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(n=(s<3?o(n):s>3?o(e,i,n):o(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const F=class{constructor(e){t(this,e),this.aggregateOperator=l.Count,this.loading=!1,this.error=!1}connectedCallback(){this.registerContextProvider()}disconnectedCallback(){var t;null===(t=this.unregisterContextProvider)||void 0===t||t.call(this)}componentWillLoad(){this.loadInfoTileValue()}watchFilterId(){this.loadInfoTileValue()}watchPropertyName(){this.loadInfoTileValue()}watchAggregateOperator(){this.loadInfoTileValue()}async loadInfoTileValue(){if(this.loading=!0,this.error=!1,this.getFilter()){try{const t={key:this.getKey(),name:this.propertyName,operator:this.aggregateOperator,filter:this.filterId};this.value=await this.loader.load(t,this.context)}catch(t){console.error(t),this.error=!0}this.loading=!1}else this.error=!0}getKey(){return Math.random().toString(36).slice(2)}render(){var t,i;const r=this.getFilter(),o=this.getFormattedValue(),s={disabled:this.disabled,icon:this.icon,prefix:(null===(t=null==o?void 0:o.prefix)||void 0===t?void 0:t.trim())||this.prefix,suffix:(null===(i=null==o?void 0:o.suffix)||void 0===i?void 0:i.trim())||this.suffix},n=Object.assign(Object.assign({},s),{icon:"error",prefix:"ERROR",loading:!0,label:this.getLabel(r)}),l=Object.assign(Object.assign({},s),{label:this.getLabel(r),link:this.getLink(r),loading:this.loading,value:null==o?void 0:o.value.trim()});return e("limel-info-tile",Object.assign({key:"1211ee931d2cf7a5a3c13896515812ddbcab29f2",class:{error:!r||this.error}},!r||this.error?n:l))}getFormattedValue(){if(!this.value&&0!==this.value)return{value:""};try{return this.getFormatter(this.value).format(this.value,this.format)}catch(t){return new y(this.language).format(this.value)}}getLabel(t){return t?"string"==typeof this.label?this.translator.get(this.label):this.getLocalizedString(this.label&&"object"==typeof this.label?this.label:t.name):"No filter set is selected"}getLocalizedString(t){if(function(t){if(null==t)return!0;if(h(t)&&(g(t)||"string"==typeof t||"function"==typeof t.splice||u(t)||c(t)||f(t)))return!t.length;var e=d(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(v(t))return!p(t).length;for(var i in t)if(b.call(t,i))return!1;return!0}(t))return"";let e=t[this.language];return e||(e=t.en||t.en_us||Object.values(null!=e?e:{}).find((t=>!!t))),null!=e?e:""}getLink(t){if(!t)return{href:"#"};const e=["explorer",t.limetype,t.id].join("/"),i=this.getRelationPropertyName(this.limetypes[t.limetype]),r=this.buildContextAwareFilter(t.filter,i);return r?{href:`${e}?filter=${encodeURIComponent(JSON.stringify(r))}`}:{href:e}}buildContextAwareFilter(t,e){if(!e)return t;const i={key:e,op:a.EQUALS,exp:this.context.id};return t?{op:a.AND,exp:[i,t]}:{relationFilter:i}}getFilter(){var t;return null===(t=this.filters)||void 0===t?void 0:t.find((t=>t.id===this.filterId))}getFormatter(t){return new I(this.language).createFormatter(this.format,t)}getRelationPropertyName(t){var e,i,r;if(t&&this.context.limetype&&this.context.id){if(this.propertyName){const t=this.limetypes[this.context.limetype],r=null===(i=null===(e=null==t?void 0:t.getProperty(this.propertyName))||void 0===e?void 0:e.relation)||void 0===i?void 0:i.getBackreference();if(r)return r.name}return null===(r=Object.values(t.properties).find((t=>{var e;return(null===(e=t.relation)||void 0===e?void 0:e.getLimetype().name)===this.context.limetype})))||void 0===r?void 0:r.name}}get translator(){return this.platform.get(r.Translate)}get language(){return this.platform.get(r.Application).getLanguage()}get loader(){return new w(this.platform,this.filters)}registerContextProvider(){const t=this.platform.get(r.AIContextRegistry);if(!(null==t?void 0:t.register))return;const e=new m((()=>{const t=this.getFilter();return{limetype:null==t?void 0:t.limetype,filterId:this.filterId,filterName:t?this.getLocalizedString(t.name):void 0,aggregateOperator:this.aggregateOperator,propertyName:this.propertyName,value:this.value,label:this.getLabel(t)}}));this.unregisterContextProvider=t.register(e,this.host)}get host(){return i(this)}static get watchers(){return{filterId:["watchFilterId"],propertyName:["watchPropertyName"],aggregateOperator:["watchAggregateOperator"]}}};k([o({})],F.prototype,"config",void 0),k([s()],F.prototype,"filters",void 0),k([n()],F.prototype,"limetypes",void 0),F.style=":host(limebb-info-tile){display:block;overflow:visible !important;background-color:transparent !important}limel-info-tile.error{--info-tile-icon-color:rgb(var(--color-red-dark));border:1px dashed rgb(var(--contrast-500));border-radius:var(--info-tile-border-radius, 1rem)}";export{F as limebb_info_tile}
@@ -1 +1 @@
1
- import{r as e,c as t,h as i}from"./p-52cf8641.js";import{Z as o}from"./p-199799ff.js";import{v as r}from"./p-d47b6c3c.js";import"./p-b02c99d5.js";function s(e){let t;try{t=JSON.parse(e)}catch(e){throw new Error(`Invalid JSON: ${e.message}`)}if(null===t||"object"!=typeof t)throw new Error("Response format must be an object");const i=new Set(["object","aggregates"]),o=Object.keys(t),r=o.filter((e=>!i.has(e)));if(r.length>0)throw new Error(`Unexpected properties in response format: ${r.join(", ")}. Only 'object' and 'aggregates' are allowed.`);if(o.length>0&&!t.object&&!t.aggregates)throw new Error("Response format must contain at least one of: object, aggregates");return t}const l=class{constructor(i){e(this,i),this.change=t(this,"change",7),this.label="Response Format",this.helperText="",this.mode="visual",this.codeValue="",this.handleModeChange=e=>{e.stopPropagation();const t=e.detail.id;"visual"===t?this.switchToVisualMode():"code"===t&&this.switchToCode()},this.switchToVisualMode=()=>{try{const e=s(this.codeValue);if(!r(e,this.limetypes,this.limetype,this.visualModeEnabled).visualModeSupported)return;this.internalValue=e,this.mode="visual",this.change.emit(e)}catch(e){}},this.switchToCode=()=>{this.updateCodeValue(),this.mode="code"},this.handleCodeChange=e=>{e.stopPropagation(),this.codeValue=e.detail;try{const e=s(this.codeValue);this.internalValue=e,this.change.emit(e)}catch(e){}},this.handleVisualModeChange=e=>{e.stopPropagation(),this.internalValue=e.detail,this.updateCodeValue(),this.change.emit(e.detail)}}get visualModeEnabled(){var e,t,i;return null!==(i=null===(t=null===(e=this.platform)||void 0===e?void 0:e.isFeatureEnabled)||void 0===t?void 0:t.call(e,"useLimeQueryBuilderGuiMode"))&&void 0!==i&&i}componentWillLoad(){this.internalValue=this.value||{object:{_id:null}},this.updateCodeValue(),this.visualModeEnabled&&this.checkVisualModeSupport().visualModeSupported||(this.mode="code")}componentWillUpdate(){this.value&&"visual"===this.mode&&(this.internalValue=this.value)}render(){const e=this.checkVisualModeSupport();return i("div",{key:"56166271cfd95e3164f6002605de9b4a73d5b850",class:"response-format-builder"},this.label&&i("h1",{key:"cccc53913dc0ced44b736328a16c85b3db2a61d4",class:"builder-label"},this.label),this.helperText&&i("p",{key:"765ea2f4a052f78beba9c60157f07711f432293e",class:"builder-helper-text"},this.helperText),this.visualModeEnabled&&i("div",{key:"15a7159322713ab288ef70e8f98aaa11d5064d1f",class:"mode-controls"},this.renderModeSwitch(e)),this.visualModeEnabled&&"code"!==this.mode?i("div",{class:"visual-mode"},this.renderVisualMode()):i("div",{class:"code-mode"},this.renderCodeEditor(e)))}renderModeSwitch(e){const t=!e.visualModeSupported,o=[{id:"visual",title:"Visual"},{id:"code",title:"Code"}].map((e=>Object.assign(Object.assign({},e),{selected:e.id===this.mode})));return i("limel-button-group",{value:o,disabled:t,onChange:this.handleModeChange})}renderCodeEditor(e){return i("div",{class:"code-editor-container"},i("limel-code-editor",{value:this.codeValue,language:"json",lineNumbers:!0,fold:!0,lint:!0,onChange:this.handleCodeChange}),!e.valid&&e.validationErrors.length>0&&i("div",{class:"validation-errors"},i("strong",null,"Invalid Response Format:"),i("ul",null,e.validationErrors.map((e=>i("li",null,e))))),this.visualModeEnabled&&e.valid&&!e.visualModeSupported&&e.visualModeLimitations.length>0&&i("div",{class:"visual-mode-limitations"},i("strong",null,"Cannot switch to visual mode:"),i("ul",null,e.visualModeLimitations.map((e=>i("li",null,e))))))}renderVisualMode(){return i("limebb-lime-query-response-format-editor",{platform:this.platform,context:this.context,limetype:this.limetype,value:this.internalValue,onChange:this.handleVisualModeChange})}checkVisualModeSupport(){if(!this.limetypes)return{valid:!1,visualModeSupported:!1,validationErrors:["Limetypes not loaded"],visualModeLimitations:[]};let e;if("code"===this.mode)try{e=s(this.codeValue)}catch(e){return{valid:!1,visualModeSupported:!1,validationErrors:[e.message],visualModeLimitations:[]}}else e=this.internalValue;return r(e,this.limetypes,this.limetype,this.visualModeEnabled)}updateCodeValue(){this.codeValue=JSON.stringify(this.internalValue,null,2)}};(function(e,t,i,o){var r,s=arguments.length,l=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(l=(s<3?r(l):s>3?r(t,i,l):r(t,i))||l);s>3&&l&&Object.defineProperty(t,i,l)})([o()],l.prototype,"limetypes",void 0),l.style=":host(limebb-lime-query-response-format-builder){display:block;width:100%}.response-format-builder{display:flex;flex-direction:column}.builder-label{color:rgb(var(--contrast-1100));font-size:1.625rem;line-height:1.25rem;font-weight:300;margin-top:1rem;margin-bottom:0.25rem}.builder-helper-text{margin-top:0px;margin-bottom:0.5rem;font-size:var(--limel-theme-default-font-size);color:rgb(var(--contrast-1100))}.mode-controls{display:flex;justify-content:flex-end;padding:0.5rem}.visual-mode,.code-mode{display:block}.code-editor-container{--code-editor-max-height:70vh;display:flex;flex-direction:column;gap:1rem}.code-editor-container .validation-errors{padding:0.75rem 1rem;color:rgb(var(--color-red-default));background-color:rgb(var(--color-red-lighter));border-left:0.25rem solid rgb(var(--color-red-default));border-radius:0.25rem;font-size:0.875rem}.code-editor-container .validation-errors strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-editor-container .validation-errors ul{margin:0;padding-left:1.5rem}.code-editor-container .validation-errors li{margin:0.25rem 0}.code-editor-container .visual-mode-limitations{padding:0.75rem 1rem;color:rgb(var(--color-blue-dark));background-color:rgb(var(--color-blue-lighter));border-left:0.25rem solid rgb(var(--color-blue-default));border-radius:0.25rem;font-size:0.875rem}.code-editor-container .visual-mode-limitations strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-editor-container .visual-mode-limitations ul{margin:0;padding-left:1.5rem}.code-editor-container .visual-mode-limitations li{margin:0.25rem 0}";export{l as limebb_lime_query_response_format_builder}
1
+ import{r as e,c as t,h as i}from"./p-52cf8641.js";import{Z as o}from"./p-199799ff.js";import{v as r}from"./p-d47b6c3c.js";import"./p-b02c99d5.js";function s(e){let t;try{t=JSON.parse(e)}catch(e){throw new Error(`Invalid JSON: ${e.message}`)}if(null===t||"object"!=typeof t)throw new Error("Response format must be an object");const i=new Set(["object","aggregates"]),o=Object.keys(t),r=o.filter((e=>!i.has(e)));if(r.length>0)throw new Error(`Unexpected properties in response format: ${r.join(", ")}. Only 'object' and 'aggregates' are allowed.`);if(o.length>0&&!t.object&&!t.aggregates)throw new Error("Response format must contain at least one of: object, aggregates");return t}const l=class{constructor(i){e(this,i),this.change=t(this,"change",7),this.label="Response Format",this.helperText="",this.mode="visual",this.codeValue="",this.handleModeChange=e=>{e.stopPropagation();const t=e.detail.id;"visual"===t?this.switchToVisualMode():"code"===t&&this.switchToCode()},this.switchToVisualMode=()=>{try{const e=s(this.codeValue);if(!r(e,this.limetypes,this.limetype,this.visualModeEnabled).visualModeSupported)return;this.internalValue=e,this.mode="visual",this.change.emit(e)}catch(e){}},this.switchToCode=()=>{this.updateCodeValue(),this.mode="code"},this.handleCodeChange=e=>{e.stopPropagation(),this.codeValue=e.detail;try{const e=s(this.codeValue);this.internalValue=e,this.change.emit(e)}catch(e){}},this.handleVisualModeChange=e=>{e.stopPropagation(),this.internalValue=e.detail,this.updateCodeValue(),this.change.emit(e.detail)}}get visualModeEnabled(){var e,t,i;return null!==(i=null===(t=null===(e=this.platform)||void 0===e?void 0:e.isFeatureEnabled)||void 0===t?void 0:t.call(e,"useLimeQueryBuilderGuiMode"))&&void 0!==i&&i}componentWillLoad(){this.internalValue=this.value||{object:{_id:null}},this.updateCodeValue(),this.visualModeEnabled&&this.checkVisualModeSupport().visualModeSupported||(this.mode="code")}componentWillUpdate(){this.value&&"visual"===this.mode&&(this.internalValue=this.value)}render(){const e=this.checkVisualModeSupport();return i("div",{key:"7f4adae0e3f4d14194fc558600db983f45fe760a",class:"response-format-builder"},this.label&&i("h1",{key:"eeb78bdccf2f8e344de742618b72a7bb341e5bf5",class:"builder-label"},this.label),this.helperText&&i("p",{key:"03ff96e0645d03377b28c048f02d868046f17903",class:"builder-helper-text"},this.helperText),this.visualModeEnabled&&i("div",{key:"65ca3551326e0ec4deff00aff4a19aec2fee9702",class:"mode-controls"},this.renderModeSwitch(e)),this.visualModeEnabled&&"code"!==this.mode?i("div",{class:"visual-mode"},this.renderVisualMode()):i("div",{class:"code-mode"},this.renderCodeEditor(e)))}renderModeSwitch(e){const t=!e.visualModeSupported,o=[{id:"visual",title:"Visual"},{id:"code",title:"Code"}].map((e=>Object.assign(Object.assign({},e),{selected:e.id===this.mode})));return i("limel-button-group",{value:o,disabled:t,onChange:this.handleModeChange})}renderCodeEditor(e){return i("div",{class:"code-editor-container"},i("limel-code-editor",{value:this.codeValue,language:"json",lineNumbers:!0,fold:!0,lint:!0,onChange:this.handleCodeChange}),!e.valid&&e.validationErrors.length>0&&i("div",{class:"validation-errors"},i("strong",null,"Invalid Response Format:"),i("ul",null,e.validationErrors.map((e=>i("li",null,e))))),this.visualModeEnabled&&e.valid&&!e.visualModeSupported&&e.visualModeLimitations.length>0&&i("div",{class:"visual-mode-limitations"},i("strong",null,"Cannot switch to visual mode:"),i("ul",null,e.visualModeLimitations.map((e=>i("li",null,e))))))}renderVisualMode(){return i("limebb-lime-query-response-format-editor",{platform:this.platform,context:this.context,limetype:this.limetype,value:this.internalValue,onChange:this.handleVisualModeChange})}checkVisualModeSupport(){if(!this.limetypes)return{valid:!1,visualModeSupported:!1,validationErrors:["Limetypes not loaded"],visualModeLimitations:[]};let e;if("code"===this.mode)try{e=s(this.codeValue)}catch(e){return{valid:!1,visualModeSupported:!1,validationErrors:[e.message],visualModeLimitations:[]}}else e=this.internalValue;return r(e,this.limetypes,this.limetype,this.visualModeEnabled)}updateCodeValue(){this.codeValue=JSON.stringify(this.internalValue,null,2)}};(function(e,t,i,o){var r,s=arguments.length,l=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(l=(s<3?r(l):s>3?r(t,i,l):r(t,i))||l);s>3&&l&&Object.defineProperty(t,i,l)})([o()],l.prototype,"limetypes",void 0),l.style=":host(limebb-lime-query-response-format-builder){display:block;width:100%}.response-format-builder{display:flex;flex-direction:column}.builder-label{color:rgb(var(--contrast-1100));font-size:1.625rem;line-height:1.25rem;font-weight:300;margin-top:1rem;margin-bottom:0.25rem}.builder-helper-text{margin-top:0px;margin-bottom:0.5rem;font-size:var(--limel-theme-default-font-size);color:rgb(var(--contrast-1100))}.mode-controls{display:flex;justify-content:flex-end;padding:0.5rem}.visual-mode,.code-mode{display:block}.code-editor-container{--code-editor-max-height:70vh;display:flex;flex-direction:column;gap:1rem}.code-editor-container .validation-errors{padding:0.75rem 1rem;color:rgb(var(--color-red-default));background-color:rgb(var(--color-red-lighter));border-left:0.25rem solid rgb(var(--color-red-default));border-radius:0.25rem;font-size:0.875rem}.code-editor-container .validation-errors strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-editor-container .validation-errors ul{margin:0;padding-left:1.5rem}.code-editor-container .validation-errors li{margin:0.25rem 0}.code-editor-container .visual-mode-limitations{padding:0.75rem 1rem;color:rgb(var(--color-blue-dark));background-color:rgb(var(--color-blue-lighter));border-left:0.25rem solid rgb(var(--color-blue-default));border-radius:0.25rem;font-size:0.875rem}.code-editor-container .visual-mode-limitations strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-editor-container .visual-mode-limitations ul{margin:0;padding-left:1.5rem}.code-editor-container .visual-mode-limitations li{margin:0.25rem 0}";export{l as limebb_lime_query_response_format_builder}
@@ -1 +1 @@
1
- import{r as t,g as i,h as s}from"./p-52cf8641.js";import{g as e}from"./p-0a266c26.js";import{f as h}from"./p-4a85590d.js";import{D as o,c as a}from"./p-199799ff.js";const r=o("object-resolver");class l{constructor(t){this.onStateChange=t,this.state={loadFailed:!1},this.hasPendingLoad=!1,this.isDisconnected=!1}get resolvedPlatform(){return this._platform}connect(t,i,s,e){this.limetype=t,this.objectid=i,this.isDisconnected=!1,this.hasPendingLoad=!1,this._platform=e||this.findPlatform(s),this._platform?(this.resolveLimeType(),this.loadLimeObject()):r.error(`No platform found. Pass "platform" prop or place the component inside a parent that exposes "platform". limetype=${t}, objectid=${i}`)}update(t,i){this.limetype=t,this.objectid=i,this.updateState({limeobject:void 0,limetypeData:void 0,loadFailed:!1}),this.hasPendingLoad||(this.hasPendingLoad=!0,queueMicrotask((()=>{if(this.hasPendingLoad=!1,!this.isDisconnected){if(!this._platform)return this.updateState({loadFailed:!0}),void r.warn(`Cannot update: no platform available. limetype=${this.limetype}, objectid=${this.objectid}`);this.resolveLimeType(),this.loadLimeObject()}})))}disconnect(){this.isDisconnected=!0}findPlatform(t){const i=h(t,this.hasPlatformProp);return null==i?void 0:i.platform}hasPlatformProp(t){return"platform"in t&&!!t.platform&&"object"==typeof t.platform}resolveLimeType(){const t=this._platform.get(a.LimeTypeRepository);this.updateState({limetypeData:t.getLimeType(this.limetype)})}async loadLimeObject(){const t=this.limetype,i=this.objectid,s=this._platform.get(a.LimeObjectRepository),e=s.getObject(t,i);if(e)this.updateState({limeobject:e});else{try{await s.loadObject(t,i)}catch(s){if(this.isStale(t,i))return;return this.updateState({loadFailed:!0}),void r.error(`Failed to load ${t}/${i}`,s)}this.isStale(t,i)||this.updateState({limeobject:s.getObject(t,i)})}}isStale(t,i){return this.isDisconnected||this.limetype!==t||this.objectid!==i}updateState(t){this.state=Object.assign(Object.assign({},this.state),t),this.isDisconnected||this.onStateChange(this.state)}}const n=class{constructor(i){t(this,i),this.data={loadFailed:!1},this.resolver=new l((t=>{this.data=t}))}connectedCallback(){this.resolver.connect(this.limetype,this.objectid,i(this),this.platform)}disconnectedCallback(){this.resolver.disconnect()}handlePropChange(){this.resolver.update(this.limetype,this.objectid)}render(){if(!this.resolver.resolvedPlatform)return;const t=e(this.data.limetypeData);return s("limel-chip",{text:this.getChipText(),icon:t,link:{href:(i=this.limetype,h=this.objectid,`object/${i}/${h}`)},loading:!this.data.limeobject&&!this.data.loadFailed});var i,h}getChipText(){var t;return(null===(t=this.data.limeobject)||void 0===t?void 0:t.descriptive)?this.data.limeobject.descriptive:this.data.loadFailed?this.getErrorText():""}getErrorText(){if(!this.resolver.resolvedPlatform)return"loading failed";try{return this.resolver.resolvedPlatform.get(a.Translate).get("webclient.limeobject.errors.load-failed")}catch(t){return"loading failed"}}static get watchers(){return{limetype:["handlePropChange"],objectid:["handlePropChange"]}}};n.style=":host{display:inline-block}";export{n as limebb_object_chip}
1
+ import{r as t,g as i,h as s}from"./p-52cf8641.js";import{g as e}from"./p-0a266c26.js";import{f as h}from"./p-4a85590d.js";import{D as o,c as a}from"./p-199799ff.js";const r=o("object-resolver");class l{constructor(t){this.onStateChange=t,this.state={loadFailed:!1},this.hasPendingLoad=!1,this.isDisconnected=!1}get resolvedPlatform(){return this._platform}connect(t,i,s,e){this.limetype=t,this.objectid=i,this.isDisconnected=!1,this.hasPendingLoad=!1,this._platform=e||this.findPlatform(s),this._platform?(this.resolveLimeType(),this.loadLimeObject()):r.error(`No platform found. Pass "platform" prop or place the component inside a parent that exposes "platform". limetype=${t}, objectid=${i}`)}update(t,i){this.limetype=t,this.objectid=i,this.updateState({limeobject:void 0,limetypeData:void 0,loadFailed:!1}),this.hasPendingLoad||(this.hasPendingLoad=!0,queueMicrotask((()=>{if(this.hasPendingLoad=!1,!this.isDisconnected){if(!this._platform)return this.updateState({loadFailed:!0}),void r.warn(`Cannot update: no platform available. limetype=${this.limetype}, objectid=${this.objectid}`);this.resolveLimeType(),this.loadLimeObject()}})))}disconnect(){this.isDisconnected=!0}findPlatform(t){const i=h(t,this.hasPlatformProp);return null==i?void 0:i.platform}hasPlatformProp(t){return"platform"in t&&!!t.platform&&"object"==typeof t.platform}resolveLimeType(){const t=this._platform.get(a.LimeTypeRepository);this.updateState({limetypeData:t.getLimeType(this.limetype)})}async loadLimeObject(){const t=this.limetype,i=this.objectid,s=this._platform.get(a.LimeObjectRepository),e=s.getObject(t,i);if(e)this.updateState({limeobject:e});else{try{await s.loadObject(t,i)}catch(s){if(this.isStale(t,i))return;return this.updateState({loadFailed:!0}),void r.error(`Failed to load ${t}/${i}`,s)}this.isStale(t,i)||this.updateState({limeobject:s.getObject(t,i)})}}isStale(t,i){return this.isDisconnected||this.limetype!==t||this.objectid!==i}updateState(t){this.state=Object.assign(Object.assign({},this.state),t),this.isDisconnected||this.onStateChange(this.state)}}const n=class{constructor(i){t(this,i),this.data={loadFailed:!1},this.resolver=new l((t=>{this.data=t}))}connectedCallback(){this.resolver.connect(this.limetype,this.objectid,i(this),this.platform)}disconnectedCallback(){this.resolver.disconnect()}handlePropChange(){this.resolver.update(this.limetype,this.objectid)}render(){if(!this.resolver.resolvedPlatform)return;const t=e(this.data.limetypeData);return s("limel-chip",{text:this.getChipText(),icon:t,link:{href:(i=this.limetype,h=this.objectid,`object/${i}/${h}`)},loading:!this.data.limeobject&&!this.data.loadFailed});var i,h}getChipText(){var t;return(null===(t=this.data.limeobject)||void 0===t?void 0:t.descriptive)?this.data.limeobject.descriptive:this.data.loadFailed?this.getErrorText():""}getErrorText(){if(!this.resolver.resolvedPlatform)return"loading failed";try{return this.resolver.resolvedPlatform.get(a.Translate).get("webclient.limeobject.errors.load-failed")}catch(t){return"loading failed"}}static get watchers(){return{limetype:["handlePropChange"],objectid:["handlePropChange"]}}};n.style=":host{display:inline-block;vertical-align:baseline}";export{n as limebb_object_chip}
@@ -1 +1 @@
1
- import{r,c as n,h as t}from"./p-52cf8641.js";import{c as u}from"./p-199799ff.js";import{t as e,c as i,a as f,i as o,g as a,b as c,d as s}from"./p-d298b34e.js";import{i as l,a as v,S as d,k as p}from"./p-35897ec3.js";import{d as h,i as m,S as b}from"./p-b31772c8.js";import{i as j,c as g,f as y,h as x}from"./p-5322fd19.js";import{b as w}from"./p-a659d55a.js";import{i as O}from"./p-7e6fb4af.js";import{d as k}from"./p-123190c3.js";import{e as A}from"./p-fe2b91d9.js";function S(r){return r}var _,E,R,U=Date.now,q=k?function(r,n){return k(r,"toString",{configurable:!0,enumerable:!1,value:(t=n,function(){return t}),writable:!0});var t}:S;const C=(_=q,E=0,R=0,function(){var r=U(),n=16-(r-R);if(R=r,n>0){if(++E>=800)return arguments[0]}else E=0;return _.apply(void 0,arguments)});var D=Math.max;function I(r,n,t){if(!h(t))return!1;var u=typeof n;return!!("number"==u?j(t)&&l(n,t.length):"string"==u&&n in t)&&A(t[n],r)}var L=b?b.isConcatSpreadable:void 0;function M(r){return m(r)||g(r)||!!(L&&r&&r[L])}function T(r,n,t,u,e){var i=-1,f=r.length;for(t||(t=M),e||(e=[]);++i<f;){var o=r[i];n>0&&t(o)?n>1?T(o,n-1,t,u,e):v(e,o):u||(e[e.length]=o)}return e}var W=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function z(r){return W.test(r)}var B="\\ud800-\\udfff",F="["+B+"]",G="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",H="\\ud83c[\\udffb-\\udfff]",J="[^"+B+"]",K="(?:\\ud83c[\\udde6-\\uddff]){2}",N="[\\ud800-\\udbff][\\udc00-\\udfff]",P="(?:"+G+"|"+H+")?",Q="[\\ufe0e\\ufe0f]?",V=Q+P+"(?:\\u200d(?:"+[J,K,N].join("|")+")"+Q+P+")*",X="(?:"+[J+G+"?",G,K,N,F].join("|")+")",Y=RegExp(H+"(?="+H+")|"+X+V,"g");const Z=function(r){var n,t,u,i,f=z(r=e(r))?function(r){return z(r)?function(r){return r.match(Y)||[]}(r):function(r){return r.split("")}(r)}(r):void 0,o=f?f[0]:r.charAt(0),a=f?(n=f,t=1,i=n.length,u=void 0===u?i:u,!t&&u>=i?n:function(r,n,t){var u=-1,e=r.length;n<0&&(n=-n>e?0:e+n),(t=t>e?e:t)<0&&(t+=e),e=n>t?0:t-n>>>0,n>>>=0;for(var i=Array(e);++u<e;)i[u]=r[u+n];return i}(n,t,u)).join(""):r.slice(1);return o.toUpperCase()+a};var $=1,rr=2;function nr(r){return r==r&&!h(r)}function tr(r,n){return function(t){return null!=t&&t[r]===n&&(void 0!==n||r in Object(t))}}function ur(r,n){return null!=r&&n in Object(r)}var er=1,ir=2;function fr(r){return"function"==typeof r?r:null==r?S:"object"==typeof r?m(r)?(e=r[1],o(u=r[0])&&nr(e)?tr(f(u),e):function(r){var n=a(r,u);return void 0===n&&n===e?function(r,n){return null!=r&&function(r,n,t){for(var u=-1,e=(n=i(n,r)).length,o=!1;++u<e;){var a=f(n[u]);if(!(o=null!=r&&t(r,a)))break;r=r[a]}return o||++u!=e?o:!!(e=null==r?0:r.length)&&y(e)&&l(a,e)&&(m(r)||g(r))}(r,n,ur)}(r,u):w(e,n,er|ir)}):(t=function(r){for(var n=p(r),t=n.length;t--;){var u=n[t],e=r[u];n[t]=[u,e,nr(e)]}return n}(n=r),1==t.length&&t[0][2]?tr(t[0][0],t[0][1]):function(r){return r===n||function(r,n,t,u){var e=t.length,i=e;if(null==r)return!i;for(r=Object(r);e--;){var f=t[e];if(f[2]?f[1]!==r[f[0]]:!(f[0]in r))return!1}for(;++e<i;){var o=(f=t[e])[0],a=r[o],c=f[1];if(f[2]){if(void 0===a&&!(o in r))return!1}else{var s,l=new d;if(!(void 0===s?w(c,a,$|rr,u,l):s))return!1}}return!0}(r,0,t)}):function(r){return o(r)?(n=f(r),function(r){return null==r?void 0:r[n]}):function(r){return function(n){return c(n,r)}}(r);var n}(r);var n,t,u,e}const or=function(r,n,t){for(var u=-1,e=Object(r),i=t(r),f=i.length;f--;){var o=i[++u];if(!1===n(e[o],o,e))break}return r};const ar=function(r,n){if(null==r)return r;if(!j(r))return function(r,n){return r&&or(r,n,p)}(r,n);for(var t=r.length,u=-1,e=Object(r);++u<t&&!1!==n(e[u],u,e););return r};function cr(r,n){if(r!==n){var t=void 0!==r,u=null===r,e=r==r,i=O(r),f=void 0!==n,o=null===n,a=n==n,c=O(n);if(!o&&!c&&!i&&r>n||i&&f&&a&&!o&&!c||u&&f&&a||!t&&a||!e)return 1;if(!u&&!i&&!c&&r<n||c&&t&&e&&!u&&!i||o&&t&&e||!f&&e||!a)return-1}return 0}function sr(r,n,t){n=n.length?s(n,(function(r){return m(r)?function(n){return c(n,1===r.length?r[0]:r)}:r})):[S];var u=-1;n=s(n,x(fr));var e=function(r,n){var t=-1,u=j(r)?Array(r.length):[];return ar(r,(function(r){u[++t]=n(r)})),u}(r,(function(r){return{criteria:s(n,(function(n){return n(r)})),index:++u,value:r}}));return function(r){var n=r.length;for(r.sort((function(r,n){return function(r,n,t){for(var u=-1,e=r.criteria,i=n.criteria,f=e.length,o=t.length;++u<f;){var a=cr(e[u],i[u]);if(a)return u>=o?a:a*("desc"==t[u]?-1:1)}return r.index-n.index}(r,n,t)}));n--;)r[n]=r[n].value;return r}(e)}var lr=function(r){return C(function(r,n,t){return n=D(void 0===n?r.length-1:n,0),function(){for(var u=arguments,e=-1,i=D(u.length-n,0),f=Array(i);++e<i;)f[e]=u[n+e];e=-1;for(var o=Array(n+1);++e<n;)o[e]=u[e];return o[n]=t(f),function(r,n,t){switch(t.length){case 0:return r.call(n);case 1:return r.call(n,t[0]);case 2:return r.call(n,t[0],t[1]);case 3:return r.call(n,t[0],t[1],t[2])}return r.apply(n,t)}(r,this,o)}}(r,void 0,S),r+"")}((function(r,n){if(null==r)return[];var t=n.length;return t>1&&I(r,n[0],n[1])?n=[]:t>2&&I(n[0],n[1],n[2])&&(n=[n[0]]),sr(r,T(n,1),[])}));const vr=lr;function dr(r,n){if(0===r.length||0===n.length)return"";r="en_us"===r?"en-US":r,n="en_us"===n?"en-US":n;const t=(new Intl.DisplayNames(n,{type:"language"}).of(r)||"").split(" ");return t[0]=Z(e(t[0]).toLowerCase()),t.join(" ")}const pr=class{constructor(t){r(this,t),this.change=n(this,"change",7),this.context={limetype:null,id:null},this.handleChange=r=>{r.stopPropagation(),this.change.emit(this.multipleChoice?r.detail.map((r=>r.value)):r.detail.value)}}async componentWillLoad(){try{this.http=this.platform.get(u.Http),this.allLanguages=await async function(r){const n=await r.get("api/v1/admin/settings/languages"),t=[];return(null==n?void 0:n.active)&&t.push(...n.active),(null==n?void 0:n.inactive)&&t.push(...n.inactive),t}(this.http)}catch(r){console.error(r)}}getOptions(){return this.allLanguages.map((r=>({value:r,text:dr(r,r)})))}render(){const r=this.getOptions();let n;if(Array.isArray(this.value)){const t=this.value;n=r.filter((r=>t.includes(r.value)))}else{const t=this.value;n=r.find((r=>r.value===t))}return t("limel-select",{key:"39da3645bcfe74e4bf4f0c9e80c4361a55a3d553",value:n,options:vr(r,"text"),helperText:this.helperText,label:this.label,required:this.required,disabled:this.disabled,readonly:this.readonly,onChange:this.handleChange,multiple:this.multipleChoice})}};export{pr as limebb_locale_picker}
1
+ import{r,c as n,h as t}from"./p-52cf8641.js";import{c as u}from"./p-199799ff.js";import{t as e,c as i,a as f,i as o,g as a,b as c,d as s}from"./p-d298b34e.js";import{i as l,a as v,S as d,k as p}from"./p-35897ec3.js";import{d as h,i as m,S as b}from"./p-b31772c8.js";import{i as j,c as g,f as y,h as x}from"./p-5322fd19.js";import{b as w}from"./p-a659d55a.js";import{i as O}from"./p-7e6fb4af.js";import{d as k}from"./p-123190c3.js";import{e as A}from"./p-fe2b91d9.js";function S(r){return r}var _,E,R,U=Date.now,q=k?function(r,n){return k(r,"toString",{configurable:!0,enumerable:!1,value:(t=n,function(){return t}),writable:!0});var t}:S;const C=(_=q,E=0,R=0,function(){var r=U(),n=16-(r-R);if(R=r,n>0){if(++E>=800)return arguments[0]}else E=0;return _.apply(void 0,arguments)});var D=Math.max;function I(r,n,t){if(!h(t))return!1;var u=typeof n;return!!("number"==u?j(t)&&l(n,t.length):"string"==u&&n in t)&&A(t[n],r)}var L=b?b.isConcatSpreadable:void 0;function M(r){return m(r)||g(r)||!!(L&&r&&r[L])}function T(r,n,t,u,e){var i=-1,f=r.length;for(t||(t=M),e||(e=[]);++i<f;){var o=r[i];n>0&&t(o)?n>1?T(o,n-1,t,u,e):v(e,o):u||(e[e.length]=o)}return e}var W=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function z(r){return W.test(r)}var B="\\ud800-\\udfff",F="["+B+"]",G="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",H="\\ud83c[\\udffb-\\udfff]",J="[^"+B+"]",K="(?:\\ud83c[\\udde6-\\uddff]){2}",N="[\\ud800-\\udbff][\\udc00-\\udfff]",P="(?:"+G+"|"+H+")?",Q="[\\ufe0e\\ufe0f]?",V=Q+P+"(?:\\u200d(?:"+[J,K,N].join("|")+")"+Q+P+")*",X="(?:"+[J+G+"?",G,K,N,F].join("|")+")",Y=RegExp(H+"(?="+H+")|"+X+V,"g");const Z=function(r){var n,t,u,i,f=z(r=e(r))?function(r){return z(r)?function(r){return r.match(Y)||[]}(r):function(r){return r.split("")}(r)}(r):void 0,o=f?f[0]:r.charAt(0),a=f?(n=f,t=1,i=n.length,u=void 0===u?i:u,!t&&u>=i?n:function(r,n,t){var u=-1,e=r.length;n<0&&(n=-n>e?0:e+n),(t=t>e?e:t)<0&&(t+=e),e=n>t?0:t-n>>>0,n>>>=0;for(var i=Array(e);++u<e;)i[u]=r[u+n];return i}(n,t,u)).join(""):r.slice(1);return o.toUpperCase()+a};var $=1,rr=2;function nr(r){return r==r&&!h(r)}function tr(r,n){return function(t){return null!=t&&t[r]===n&&(void 0!==n||r in Object(t))}}function ur(r,n){return null!=r&&n in Object(r)}var er=1,ir=2;function fr(r){return"function"==typeof r?r:null==r?S:"object"==typeof r?m(r)?(e=r[1],o(u=r[0])&&nr(e)?tr(f(u),e):function(r){var n=a(r,u);return void 0===n&&n===e?function(r,n){return null!=r&&function(r,n,t){for(var u=-1,e=(n=i(n,r)).length,o=!1;++u<e;){var a=f(n[u]);if(!(o=null!=r&&t(r,a)))break;r=r[a]}return o||++u!=e?o:!!(e=null==r?0:r.length)&&y(e)&&l(a,e)&&(m(r)||g(r))}(r,n,ur)}(r,u):w(e,n,er|ir)}):(t=function(r){for(var n=p(r),t=n.length;t--;){var u=n[t],e=r[u];n[t]=[u,e,nr(e)]}return n}(n=r),1==t.length&&t[0][2]?tr(t[0][0],t[0][1]):function(r){return r===n||function(r,n,t,u){var e=t.length,i=e;if(null==r)return!i;for(r=Object(r);e--;){var f=t[e];if(f[2]?f[1]!==r[f[0]]:!(f[0]in r))return!1}for(;++e<i;){var o=(f=t[e])[0],a=r[o],c=f[1];if(f[2]){if(void 0===a&&!(o in r))return!1}else{var s,l=new d;if(!(void 0===s?w(c,a,$|rr,u,l):s))return!1}}return!0}(r,0,t)}):function(r){return o(r)?(n=f(r),function(r){return null==r?void 0:r[n]}):function(r){return function(n){return c(n,r)}}(r);var n}(r);var n,t,u,e}const or=function(r,n,t){for(var u=-1,e=Object(r),i=t(r),f=i.length;f--;){var o=i[++u];if(!1===n(e[o],o,e))break}return r};const ar=function(r,n){if(null==r)return r;if(!j(r))return function(r,n){return r&&or(r,n,p)}(r,n);for(var t=r.length,u=-1,e=Object(r);++u<t&&!1!==n(e[u],u,e););return r};function cr(r,n){if(r!==n){var t=void 0!==r,u=null===r,e=r==r,i=O(r),f=void 0!==n,o=null===n,a=n==n,c=O(n);if(!o&&!c&&!i&&r>n||i&&f&&a&&!o&&!c||u&&f&&a||!t&&a||!e)return 1;if(!u&&!i&&!c&&r<n||c&&t&&e&&!u&&!i||o&&t&&e||!f&&e||!a)return-1}return 0}function sr(r,n,t){n=n.length?s(n,(function(r){return m(r)?function(n){return c(n,1===r.length?r[0]:r)}:r})):[S];var u=-1;n=s(n,x(fr));var e=function(r,n){var t=-1,u=j(r)?Array(r.length):[];return ar(r,(function(r){u[++t]=n(r)})),u}(r,(function(r){return{criteria:s(n,(function(n){return n(r)})),index:++u,value:r}}));return function(r){var n=r.length;for(r.sort((function(r,n){return function(r,n,t){for(var u=-1,e=r.criteria,i=n.criteria,f=e.length,o=t.length;++u<f;){var a=cr(e[u],i[u]);if(a)return u>=o?a:a*("desc"==t[u]?-1:1)}return r.index-n.index}(r,n,t)}));n--;)r[n]=r[n].value;return r}(e)}var lr=function(r){return C(function(r,n,t){return n=D(void 0===n?r.length-1:n,0),function(){for(var u=arguments,e=-1,i=D(u.length-n,0),f=Array(i);++e<i;)f[e]=u[n+e];e=-1;for(var o=Array(n+1);++e<n;)o[e]=u[e];return o[n]=t(f),function(r,n,t){switch(t.length){case 0:return r.call(n);case 1:return r.call(n,t[0]);case 2:return r.call(n,t[0],t[1]);case 3:return r.call(n,t[0],t[1],t[2])}return r.apply(n,t)}(r,this,o)}}(r,void 0,S),r+"")}((function(r,n){if(null==r)return[];var t=n.length;return t>1&&I(r,n[0],n[1])?n=[]:t>2&&I(n[0],n[1],n[2])&&(n=[n[0]]),sr(r,T(n,1),[])}));const vr=lr;function dr(r,n){if(0===r.length||0===n.length)return"";r="en_us"===r?"en-US":r,n="en_us"===n?"en-US":n;const t=(new Intl.DisplayNames(n,{type:"language"}).of(r)||"").split(" ");return t[0]=Z(e(t[0]).toLowerCase()),t.join(" ")}const pr=class{constructor(t){r(this,t),this.change=n(this,"change",7),this.context={limetype:null,id:null},this.handleChange=r=>{r.stopPropagation(),this.change.emit(this.multipleChoice?r.detail.map((r=>r.value)):r.detail.value)}}async componentWillLoad(){try{this.http=this.platform.get(u.Http),this.allLanguages=await async function(r){const n=await r.get("api/v1/admin/settings/languages"),t=[];return(null==n?void 0:n.active)&&t.push(...n.active),(null==n?void 0:n.inactive)&&t.push(...n.inactive),t}(this.http)}catch(r){console.error(r)}}getOptions(){return this.allLanguages.map((r=>({value:r,text:dr(r,r)})))}render(){const r=this.getOptions();let n;if(Array.isArray(this.value)){const t=this.value;n=r.filter((r=>t.includes(r.value)))}else{const t=this.value;n=r.find((r=>r.value===t))}return t("limel-select",{key:"146ecba3fc26664d49336cb4576887caee2b7f9f",value:n,options:vr(r,"text"),helperText:this.helperText,label:this.label,required:this.required,disabled:this.disabled,readonly:this.readonly,onChange:this.handleChange,multiple:this.multipleChoice})}};export{pr as limebb_locale_picker}
@@ -0,0 +1,45 @@
1
+ import { EventEmitter } from '../../stencil-public-runtime';
2
+ import { DocumentChipFile } from './document-chips.types';
3
+ /**
4
+ * Renders a list of document chips, each wrapped in a
5
+ * `limebb-summary-popover` that shows a file preview on hover or
6
+ * keyboard focus.
7
+ *
8
+ * Supports browser-previewable files (images, PDFs, video, audio, text).
9
+ * Office file types show a fallback message instead of an unsupported preview.
10
+ *
11
+ * The component manages blob URL creation for local files internally
12
+ * and cleans them up when files are removed or the component is destroyed.
13
+ *
14
+ * @exampleComponent limebb-example-document-chips-basic
15
+ * @exampleComponent limebb-example-document-chips-upload-states
16
+ *
17
+ * @beta
18
+ */
19
+ export declare class DocumentChips {
20
+ /**
21
+ * A label used to describe the purpose of the list to users
22
+ * of assistive technologies, like screen readers.
23
+ */
24
+ accessibleLabel?: string;
25
+ /**
26
+ * The list of files to display as document chips.
27
+ */
28
+ files: DocumentChipFile[];
29
+ /**
30
+ * Fired when a document chip's remove button is clicked.
31
+ * The event detail contains the file's `id`.
32
+ */
33
+ removeFile: EventEmitter<string | number>;
34
+ private blobUrls;
35
+ protected onFilesChanged(newFiles: DocumentChipFile[], oldFiles: DocumentChipFile[]): void;
36
+ disconnectedCallback(): void;
37
+ render(): any;
38
+ private renderFile;
39
+ private getIcon;
40
+ private getPreviewUrl;
41
+ private handleRemove;
42
+ private revokeBlobUrl;
43
+ private revokeAllBlobUrls;
44
+ }
45
+ //# sourceMappingURL=document-chips.d.ts.map
@@ -0,0 +1,23 @@
1
+ import { FileInfo } from '@limetech/lime-elements';
2
+ /**
3
+ * Represents a document in a document chips list, extending the base
4
+ * `FileInfo` with upload state tracking.
5
+ *
6
+ * @public
7
+ */
8
+ export interface DocumentChipFile extends FileInfo {
9
+ /**
10
+ * Upload progress as a percentage (0–100).
11
+ */
12
+ uploadProgress?: number;
13
+ /**
14
+ * Current state of the file in the upload lifecycle.
15
+ *
16
+ * - `added`: file selected, upload not yet started
17
+ * - `uploading`: upload in progress, `uploadProgress` is active
18
+ * - `finalizing`: server-side processing after upload
19
+ * - `done`: upload complete
20
+ */
21
+ uploadState?: 'added' | 'uploading' | 'finalizing' | 'done' | 'failed';
22
+ }
23
+ //# sourceMappingURL=document-chips.types.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
- import { Image, Icon, OpenDirection, ListSeparator, ActionBarItem } from '@limetech/lime-elements';
2
+ import { Image, Icon, FileInfo, OpenDirection, ListSeparator, ActionBarItem } from '@limetech/lime-elements';
3
3
  /**
4
4
  * This component uses
5
5
  * [limel-popover](https://lundalogik.github.io/lime-elements/versions/latest/#/component/limel-popover/)
@@ -57,6 +57,7 @@ import { Image, Icon, OpenDirection, ListSeparator, ActionBarItem } from '@limet
57
57
  *
58
58
  * @exampleComponent limebb-example-summary-popover-basic
59
59
  * @exampleComponent limebb-example-summary-popover-image
60
+ * @exampleComponent limebb-example-summary-popover-file-preview
60
61
  * @exampleComponent limebb-example-summary-popover-actions
61
62
  * @exampleComponent limebb-example-summary-popover-trigger-delay
62
63
  *
@@ -81,6 +82,12 @@ export declare class SummaryPopover {
81
82
  * to enrich the content with visual information.
82
83
  */
83
84
  image?: Image;
85
+ /**
86
+ * A file to preview in the popover.
87
+ * When provided, a `limel-file-viewer` is rendered
88
+ * inside the card alongside any other card content.
89
+ */
90
+ file?: FileInfo;
84
91
  /**
85
92
  * An icon, to display along with the heading and subheading.
86
93
  */
@@ -115,6 +122,8 @@ export declare class SummaryPopover {
115
122
  private hoverTimeout;
116
123
  private static currentOpenPopover;
117
124
  render(): any;
125
+ private renderCard;
126
+ private renderFileViewer;
118
127
  private openPopoverWithDelay;
119
128
  private resetTimeout;
120
129
  private onPopoverClose;
@@ -13,6 +13,7 @@ import { ChatItem } from "./components/chat-list/chat-item/chat-item.types";
13
13
  import { ComponentPickerType } from "./components/component-command-picker/types";
14
14
  import { ComposerTrigger, FileInputConfig } from "./components/composer-toolbar/composer-toolbar.types";
15
15
  import { DataCell } from "./components/data-cells/data-cells.types";
16
+ import { DocumentChipFile } from "./components/document-chips/document-chips.types";
16
17
  import { DocumentItem } from "./components/document-picker/document-item/document-item.types";
17
18
  import { DocumentType } from "./components/document-picker/document.types";
18
19
  import { FeedItem } from "./components/feed/feed-item/feed-item.types";
@@ -35,6 +36,7 @@ export { ChatItem } from "./components/chat-list/chat-item/chat-item.types";
35
36
  export { ComponentPickerType } from "./components/component-command-picker/types";
36
37
  export { ComposerTrigger, FileInputConfig } from "./components/composer-toolbar/composer-toolbar.types";
37
38
  export { DataCell } from "./components/data-cells/data-cells.types";
39
+ export { DocumentChipFile } from "./components/document-chips/document-chips.types";
38
40
  export { DocumentItem } from "./components/document-picker/document-item/document-item.types";
39
41
  export { DocumentType } from "./components/document-picker/document.types";
40
42
  export { FeedItem } from "./components/feed/feed-item/feed-item.types";
@@ -597,6 +599,28 @@ export namespace Components {
597
599
  */
598
600
  "type": DateType;
599
601
  }
602
+ /**
603
+ * Renders a list of document chips, each wrapped in a
604
+ * `limebb-summary-popover` that shows a file preview on hover or
605
+ * keyboard focus.
606
+ * Supports browser-previewable files (images, PDFs, video, audio, text).
607
+ * Office file types show a fallback message instead of an unsupported preview.
608
+ * The component manages blob URL creation for local files internally
609
+ * and cleans them up when files are removed or the component is destroyed.
610
+ * @exampleComponent limebb-example-document-chips-basic
611
+ * @exampleComponent limebb-example-document-chips-upload-states
612
+ * @beta
613
+ */
614
+ interface LimebbDocumentChips {
615
+ /**
616
+ * A label used to describe the purpose of the list to users of assistive technologies, like screen readers.
617
+ */
618
+ "accessibleLabel"?: string;
619
+ /**
620
+ * The list of files to display as document chips.
621
+ */
622
+ "files": DocumentChipFile[];
623
+ }
600
624
  /**
601
625
  * Document item
602
626
  * Renders individual items of the document picker component.
@@ -2043,6 +2067,7 @@ export namespace Components {
2043
2067
  * :::
2044
2068
  * @exampleComponent limebb-example-summary-popover-basic
2045
2069
  * @exampleComponent limebb-example-summary-popover-image
2070
+ * @exampleComponent limebb-example-summary-popover-file-preview
2046
2071
  * @exampleComponent limebb-example-summary-popover-actions
2047
2072
  * @exampleComponent limebb-example-summary-popover-trigger-delay
2048
2073
  * @beta
@@ -2052,6 +2077,10 @@ export namespace Components {
2052
2077
  * Actions to display in the card, to provide the user with options to interact with the content.
2053
2078
  */
2054
2079
  "actions"?: Array<ActionBarItem | ListSeparator>;
2080
+ /**
2081
+ * A file to preview in the popover. When provided, a `limel-file-viewer` is rendered inside the card alongside any other card content.
2082
+ */
2083
+ "file"?: FileInfo;
2055
2084
  /**
2056
2085
  * Text to display a header inside the card.
2057
2086
  */
@@ -2313,6 +2342,10 @@ export interface LimebbDateRangeCustomEvent<T> extends CustomEvent<T> {
2313
2342
  detail: T;
2314
2343
  target: HTMLLimebbDateRangeElement;
2315
2344
  }
2345
+ export interface LimebbDocumentChipsCustomEvent<T> extends CustomEvent<T> {
2346
+ detail: T;
2347
+ target: HTMLLimebbDocumentChipsElement;
2348
+ }
2316
2349
  export interface LimebbDocumentItemCustomEvent<T> extends CustomEvent<T> {
2317
2350
  detail: T;
2318
2351
  target: HTMLLimebbDocumentItemElement;
@@ -2782,6 +2815,35 @@ declare global {
2782
2815
  prototype: HTMLLimebbDateRangeElement;
2783
2816
  new (): HTMLLimebbDateRangeElement;
2784
2817
  };
2818
+ interface HTMLLimebbDocumentChipsElementEventMap {
2819
+ "removeFile": string | number;
2820
+ }
2821
+ /**
2822
+ * Renders a list of document chips, each wrapped in a
2823
+ * `limebb-summary-popover` that shows a file preview on hover or
2824
+ * keyboard focus.
2825
+ * Supports browser-previewable files (images, PDFs, video, audio, text).
2826
+ * Office file types show a fallback message instead of an unsupported preview.
2827
+ * The component manages blob URL creation for local files internally
2828
+ * and cleans them up when files are removed or the component is destroyed.
2829
+ * @exampleComponent limebb-example-document-chips-basic
2830
+ * @exampleComponent limebb-example-document-chips-upload-states
2831
+ * @beta
2832
+ */
2833
+ interface HTMLLimebbDocumentChipsElement extends Components.LimebbDocumentChips, HTMLStencilElement {
2834
+ addEventListener<K extends keyof HTMLLimebbDocumentChipsElementEventMap>(type: K, listener: (this: HTMLLimebbDocumentChipsElement, ev: LimebbDocumentChipsCustomEvent<HTMLLimebbDocumentChipsElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
2835
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2836
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2837
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
2838
+ removeEventListener<K extends keyof HTMLLimebbDocumentChipsElementEventMap>(type: K, listener: (this: HTMLLimebbDocumentChipsElement, ev: LimebbDocumentChipsCustomEvent<HTMLLimebbDocumentChipsElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
2839
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2840
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2841
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
2842
+ }
2843
+ var HTMLLimebbDocumentChipsElement: {
2844
+ prototype: HTMLLimebbDocumentChipsElement;
2845
+ new (): HTMLLimebbDocumentChipsElement;
2846
+ };
2785
2847
  interface HTMLLimebbDocumentItemElementEventMap {
2786
2848
  "interact": DocumentItem;
2787
2849
  }
@@ -3871,6 +3933,7 @@ declare global {
3871
3933
  * :::
3872
3934
  * @exampleComponent limebb-example-summary-popover-basic
3873
3935
  * @exampleComponent limebb-example-summary-popover-image
3936
+ * @exampleComponent limebb-example-summary-popover-file-preview
3874
3937
  * @exampleComponent limebb-example-summary-popover-actions
3875
3938
  * @exampleComponent limebb-example-summary-popover-trigger-delay
3876
3939
  * @beta
@@ -4003,6 +4066,7 @@ declare global {
4003
4066
  "limebb-data-cells": HTMLLimebbDataCellsElement;
4004
4067
  "limebb-date-picker": HTMLLimebbDatePickerElement;
4005
4068
  "limebb-date-range": HTMLLimebbDateRangeElement;
4069
+ "limebb-document-chips": HTMLLimebbDocumentChipsElement;
4006
4070
  "limebb-document-item": HTMLLimebbDocumentItemElement;
4007
4071
  "limebb-document-picker": HTMLLimebbDocumentPickerElement;
4008
4072
  "limebb-empty-state": HTMLLimebbEmptyStateElement;
@@ -4644,6 +4708,32 @@ declare namespace LocalJSX {
4644
4708
  */
4645
4709
  "type"?: DateType;
4646
4710
  }
4711
+ /**
4712
+ * Renders a list of document chips, each wrapped in a
4713
+ * `limebb-summary-popover` that shows a file preview on hover or
4714
+ * keyboard focus.
4715
+ * Supports browser-previewable files (images, PDFs, video, audio, text).
4716
+ * Office file types show a fallback message instead of an unsupported preview.
4717
+ * The component manages blob URL creation for local files internally
4718
+ * and cleans them up when files are removed or the component is destroyed.
4719
+ * @exampleComponent limebb-example-document-chips-basic
4720
+ * @exampleComponent limebb-example-document-chips-upload-states
4721
+ * @beta
4722
+ */
4723
+ interface LimebbDocumentChips {
4724
+ /**
4725
+ * A label used to describe the purpose of the list to users of assistive technologies, like screen readers.
4726
+ */
4727
+ "accessibleLabel"?: string;
4728
+ /**
4729
+ * The list of files to display as document chips.
4730
+ */
4731
+ "files"?: DocumentChipFile[];
4732
+ /**
4733
+ * Fired when a document chip's remove button is clicked. The event detail contains the file's `id`.
4734
+ */
4735
+ "onRemoveFile"?: (event: LimebbDocumentChipsCustomEvent<string | number>) => void;
4736
+ }
4647
4737
  /**
4648
4738
  * Document item
4649
4739
  * Renders individual items of the document picker component.
@@ -6224,6 +6314,7 @@ declare namespace LocalJSX {
6224
6314
  * :::
6225
6315
  * @exampleComponent limebb-example-summary-popover-basic
6226
6316
  * @exampleComponent limebb-example-summary-popover-image
6317
+ * @exampleComponent limebb-example-summary-popover-file-preview
6227
6318
  * @exampleComponent limebb-example-summary-popover-actions
6228
6319
  * @exampleComponent limebb-example-summary-popover-trigger-delay
6229
6320
  * @beta
@@ -6233,6 +6324,10 @@ declare namespace LocalJSX {
6233
6324
  * Actions to display in the card, to provide the user with options to interact with the content.
6234
6325
  */
6235
6326
  "actions"?: Array<ActionBarItem | ListSeparator>;
6327
+ /**
6328
+ * A file to preview in the popover. When provided, a `limel-file-viewer` is rendered inside the card alongside any other card content.
6329
+ */
6330
+ "file"?: FileInfo;
6236
6331
  /**
6237
6332
  * Text to display a header inside the card.
6238
6333
  */
@@ -6491,6 +6586,7 @@ declare namespace LocalJSX {
6491
6586
  "limebb-data-cells": LimebbDataCells;
6492
6587
  "limebb-date-picker": LimebbDatePicker;
6493
6588
  "limebb-date-range": LimebbDateRange;
6589
+ "limebb-document-chips": LimebbDocumentChips;
6494
6590
  "limebb-document-item": LimebbDocumentItem;
6495
6591
  "limebb-document-picker": LimebbDocumentPicker;
6496
6592
  "limebb-empty-state": LimebbEmptyState;
@@ -6725,6 +6821,19 @@ declare module "@stencil/core" {
6725
6821
  * @exampleComponent limebb-example-date-range
6726
6822
  */
6727
6823
  "limebb-date-range": LocalJSX.LimebbDateRange & JSXBase.HTMLAttributes<HTMLLimebbDateRangeElement>;
6824
+ /**
6825
+ * Renders a list of document chips, each wrapped in a
6826
+ * `limebb-summary-popover` that shows a file preview on hover or
6827
+ * keyboard focus.
6828
+ * Supports browser-previewable files (images, PDFs, video, audio, text).
6829
+ * Office file types show a fallback message instead of an unsupported preview.
6830
+ * The component manages blob URL creation for local files internally
6831
+ * and cleans them up when files are removed or the component is destroyed.
6832
+ * @exampleComponent limebb-example-document-chips-basic
6833
+ * @exampleComponent limebb-example-document-chips-upload-states
6834
+ * @beta
6835
+ */
6836
+ "limebb-document-chips": LocalJSX.LimebbDocumentChips & JSXBase.HTMLAttributes<HTMLLimebbDocumentChipsElement>;
6728
6837
  /**
6729
6838
  * Document item
6730
6839
  * Renders individual items of the document picker component.
@@ -7258,6 +7367,7 @@ declare module "@stencil/core" {
7258
7367
  * :::
7259
7368
  * @exampleComponent limebb-example-summary-popover-basic
7260
7369
  * @exampleComponent limebb-example-summary-popover-image
7370
+ * @exampleComponent limebb-example-summary-popover-file-preview
7261
7371
  * @exampleComponent limebb-example-summary-popover-actions
7262
7372
  * @exampleComponent limebb-example-summary-popover-trigger-delay
7263
7373
  * @beta
@@ -17,3 +17,4 @@ export {
17
17
  FileStatus,
18
18
  FileWrapper,
19
19
  } from './components/text-editor/uploader/building-blocks-uploader';
20
+ export * from './components/document-chips/document-chips.types';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Extracts the file extension from a filename.
3
+ *
4
+ * Returns the lowercased extension without the dot,
5
+ * or an empty string if the filename has no extension.
6
+ *
7
+ * @param filename - the filename to extract the extension from
8
+ */
9
+ export declare function getFileExtension(filename: string): string;
10
+ //# sourceMappingURL=file-extension.d.ts.map
@@ -0,0 +1,3 @@
1
+ export declare const DEFAULT_ICON_BACKGROUND = "rgba(var(--color-gray-lighter), 0.4)";
2
+ export declare const filetypeBackgroundColorTable: Record<string, string>;
3
+ //# sourceMappingURL=file-icon-background-colors.d.ts.map
@@ -0,0 +1,3 @@
1
+ export declare const DEFAULT_ICON_FILL = "rgb(var(--color-gray-dark))";
2
+ export declare const filetypeFillColorTable: Record<string, string>;
3
+ //# sourceMappingURL=file-icon-fill-colors.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { Icon } from '@limetech/lime-elements';
2
+ /**
3
+ * Returns an icon with name, fill color, and background color
4
+ * based on the file extension of the given filename.
5
+ *
6
+ * @param filename - the filename to get the icon for
7
+ */
8
+ export declare function getFileIcon(filename: string): Icon;
9
+ //# sourceMappingURL=file-icon.d.ts.map
@@ -0,0 +1,3 @@
1
+ export declare const DEFAULT_FILE_ICON = "file";
2
+ export declare const filetypeIconTable: Record<string, string>;
3
+ //# sourceMappingURL=file-icons.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-crm-building-blocks",
3
- "version": "1.113.4",
3
+ "version": "1.114.0",
4
4
  "description": "A home for shared components meant for use with Lime CRM",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@limetech/eslint-config": "^3.0.1",
38
- "@limetech/lime-elements": "^39.12.5",
38
+ "@limetech/lime-elements": "^39.13.1",
39
39
  "@limetech/lime-web-components": "^6.13.1",
40
40
  "@limetech/lime-web-components-testing": "^1.0.0",
41
41
  "@lundalogik/lime-icons8": "^2.38.2",
@@ -1 +0,0 @@
1
- import{r as e,h as o,c as t}from"./p-52cf8641.js";const r={expand:"expand",minimize:"minus_math",maximize:"minus_math",newTab:"up_right_arrow",back:"left_arrow",close:"multiply",shrink:"compress",float:"rectangle"},i=class{constructor(t){e(this,t),this.renderAsLink=()=>o("a",{class:this.getContainerClassList(),id:"tooltipId","aria-label":this.tooltipLabel&&this.tooltipHelperLabel,href:this.href,target:"newTab"===this.type?"_blank":void 0},this.renderType(),this.renderTooltip()),this.renderAsButton=()=>o("button",{class:this.getContainerClassList(),id:"tooltipId","aria-label":this.tooltipLabel&&this.tooltipHelperLabel},this.renderType(),this.renderTooltip()),this.getContainerClassList=()=>({"navigation-button":!0,[this.type]:!0})}render(){return this.href?this.renderAsLink():this.renderAsButton()}renderType(){return this.renderIcon(r[this.type])}renderTooltip(){if(this.tooltipLabel)return o("limel-tooltip",{label:this.tooltipLabel,helperLabel:this.tooltipHelperLabel,elementId:"tooltipId"})}renderIcon(e){return o("limel-icon",{name:e})}static get delegatesFocus(){return!0}};i.style='@charset "UTF-8";.navigation-button{all:unset;isolation:isolate;position:relative;display:flex;justify-content:center;align-items:center;height:1.875rem;width:1.875rem;border-radius:50%;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:var(--navigation-button-background-color, var(--lime-elevated-surface-background-color))}.navigation-button:hover,.navigation-button:focus,.navigation-button:focus-visible{will-change:color, background-color, box-shadow, transform}.navigation-button:hover,.navigation-button:focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}.navigation-button:hover{box-shadow:var(--button-shadow-hovered)}.navigation-button:active{--limel-clickable-transform-timing-function:cubic-bezier(\n 0.83,\n -0.15,\n 0.49,\n 1.16\n );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.navigation-button:hover,.navigation-button:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.navigation-button:focus{outline:none}.navigation-button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.navigation-button limel-icon{transition:color 0.2s ease, transform 0.2s cubic-bezier(0.84, 0.15, 0.52, 1.42);color:var(--header-menu-icon-color);width:1.25rem}.newTab limel-icon{transition:transform 0.2s ease;transform:scale(0.8);z-index:3}.newTab:before{z-index:2}.newTab::after{z-index:1}.newTab:before,.newTab:after{content:"";transition:transform 0.2s ease, border-color 0.2s ease;position:absolute;width:0.875rem;height:0.875rem;outline:1.5px solid rgb(var(--contrast-900));border-radius:1px;background-color:var(--navigation-button-background-color, rgb(var(--contrast-100)))}.newTab:hover limel-icon{color:var(--mdc-theme-primary);transform:translate3d(-0.1rem, 0.1rem, 0) scale(1)}.newTab:hover:before{transform:translate3d(0.125rem, -0.125rem, 0);border-color:rgb(var(--contrast-1000));box-shadow:var(--shadow-depth-8)}.newTab:hover:after{transform:translate3d(-0.15rem, 0.15rem, 0) scale(0.9);border-color:rgb(var(--contrast-700))}.expand:after{transition:transform 0.2s ease;content:"";position:absolute;z-index:1;background-color:var(--navigation-button-background-color, rgb(var(--contrast-100)));width:0.75rem;height:0.75rem}.expand:hover limel-icon{color:var(--mdc-theme-primary)}.expand:hover:after{transform:scale(0.5)}.expand:hover limel-icon{transform:scale(1.18)}.minimize:before,.minimize:after,.maximize:before,.maximize:after{content:"";transition:transform 0.3s ease-out 0.15s, background-color 0.1s ease}.minimize limel-icon,.maximize limel-icon{transition:transform 0.2s ease 0.1s}.minimize:before,.maximize:after,.maximize:hover:before{transform:scaleY(1) scaleX(1);z-index:-1;box-sizing:border-box;position:absolute;width:70%;height:60%;border-radius:0.25rem;transform-origin:bottom}.minimize:hover:before,.maximize:before{transition:transform 0.3s ease-out 0.15s, background-color 0.1s ease;transform:scaleY(0.3) scaleX(0.7);background-color:rgb(var(--contrast-500))}.minimize:hover limel-icon,.maximize limel-icon{transform:scaleX(0.8) translate3d(0, 0.4rem, 0)}.maximize limel-icon{color:rgb(var(--contrast-900))}.maximize:hover limel-icon{color:currentColor;transform:scaleX(1.1) translate3d(0, -0.1rem, 0)}.maximize:after{z-index:-2;border:1px dashed rgb(var(--contrast-800))}.close limel-icon{transition:transform 0.2s ease, color 0.2s ease}.close:before,.close:after{transition-delay:0.1s;content:"";position:absolute;inset:0;border-radius:50%;opacity:0}.close:before{transition:transform 0.3s ease, opacity 0.3s ease;background-color:rgb(var(--color-orange-dark))}.close:after{transition:transform 0.6s ease, opacity 0.6s ease;background-color:rgb(var(--color-orange-light))}.close:hover limel-icon{color:rgb(var(--color-white));transform:scale(0.7) rotate(90deg)}.close:hover:before{opacity:1;transform:scale(0.4)}.close:hover:after{opacity:0.4;transform:scale(0.6)}.float:after{transition:width 0.2s ease-out, opacity 0.2s ease;content:"";position:absolute;inset:0 0.5rem 0 auto;border-radius:1px;opacity:0.8;transform:translate3d(0, 0, 0);background-color:rgb(var(--contrast-800));width:0.125rem;height:0.6rem;margin:auto}.float:hover:after{width:0.4rem;opacity:1;transform:translate3d(0, 0, 0)}';const a=class{constructor(o){e(this,o),this.actionSelected=t(this,"actionSelected",7),this.triggerDelay=600,this.openDirection="top",this.popoverMaxWidth="20rem",this.popoverMaxHeight="min(35rem, calc(100vh - 2rem))",this.actions=[],this.isPopoverOpen=!1,this.openPopoverWithDelay=e=>{e.stopPropagation(),clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>{a.currentOpenPopover&&a.currentOpenPopover!==this&&(a.currentOpenPopover.isPopoverOpen=!1),a.currentOpenPopover=this,this.isPopoverOpen=!0}),this.triggerDelay)},this.resetTimeout=()=>{this.isPopoverOpen||clearTimeout(this.hoverTimeout)},this.onPopoverClose=e=>{e.stopPropagation(),this.isPopoverOpen=!1,a.currentOpenPopover===this&&(a.currentOpenPopover=null)},this.handleCloseClick=e=>{e.stopPropagation(),this.isPopoverOpen=!1},this.handleSelected=e=>{this.actionSelected.emit(e.detail)}}render(){return o("limel-popover",{key:"fb257457f12e1b4711a40a8507bcbe4317edace2",style:{"--limebb-summary-popover-timeout":`${this.triggerDelay}ms`},open:this.isPopoverOpen,onClose:this.onPopoverClose,openDirection:this.openDirection},o("div",{key:"10ecbea67152f6e3c6102d01c28c3aceb13427a0",slot:"trigger",onMouseEnter:this.openPopoverWithDelay,onMouseLeave:this.resetTimeout,onFocusin:this.openPopoverWithDelay},o("slot",{key:"bd545c3365ed44a60a7427bb8767c7373ce6a177",name:"trigger"}),o("div",{key:"0a537eca8171d183b693549158acfb29f099ee7f",class:"opening-countdown-indicator"})),o("limel-card",{key:"8befb62c7d075284e9fd0af373ae00e2c54ac058",style:{"max-width":this.popoverMaxWidth,"max-height":this.popoverMaxHeight,"min-width":"7rem","min-height":"3rem"},orientation:"landscape",heading:this.heading,subheading:this.subheading,icon:this.icon,value:this.value,image:this.image,actions:this.actions,onActionSelected:this.handleSelected},o("limebb-navigation-button",{key:"699c17c2d51575f4c82fa9bbc4dcc9a96a495eee",slot:"component",type:"close",style:{"--navigation-button-background-color":"rgb(var(--contrast-100), 0.8)",position:"absolute",top:"0.125rem",right:"0.125rem"},tooltipLabel:"Close",tooltipHelperLabel:"Esc",onClick:this.handleCloseClick})))}};a.currentOpenPopover=null,a.style="limel-popover{--popover-border-radius:0.95rem;--popover-body-background-color:transparent;--popover-box-shadow:var(--shadow-depth-8)}div[slot=trigger]{position:relative;display:flex;align-items:center;justify-content:center}div[slot=trigger] *{min-width:0;min-height:0}.opening-countdown-indicator{position:absolute;inset:auto 0 -0.25rem 0;margin:0 auto;height:0.125rem;border-radius:1rem;transition:width ease-out, opacity ease;transition-duration:120ms;opacity:0;width:0%;background-color:var(--mdc-theme-primary)}div[slot=trigger]:not([aria-expanded=true]):hover .opening-countdown-indicator{transition-duration:var(--limebb-summary-popover-timeout);opacity:1;width:100%}";export{i as limebb_navigation_button,a as limebb_summary_popover}
@@ -1 +0,0 @@
1
- import{r as e,h as r}from"./p-52cf8641.js";import{i as t,z as i,c as o}from"./p-199799ff.js";import{n as s}from"./p-7c9484b1.js";const n=["pdf","edit","view"],l={avi:"browser",bmp:"browser",csv:"browser",gif:"browser",heic:"browser",html:"browser",jpeg:"browser",jpg:"browser",json:"browser",mp3:"browser",mp4:"browser",mov:"browser",ogg:"browser",pdf:"browser",png:"browser",svg:"browser",svgz:"browser",txt:"browser",wav:"browser",wmv:"browser",xml:"browser",eml:"fileViewer",doc:"sharepoint",docx:"sharepoint",dot:"sharepoint",dotx:"sharepoint",odp:"sharepoint",ods:"sharepoint",pot:"sharepoint",ppt:"sharepoint",pptx:"sharepoint",pps:"sharepoint",ppsx:"sharepoint",xls:"sharepoint",xlsb:"sharepoint",xlsm:"sharepoint",xlsx:"sharepoint",odt:"sharepoint"};var a=function(e,r,t,i){var o,s=arguments.length,n=s<3?r:null===i?i=Object.getOwnPropertyDescriptor(r,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,r,t,i);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(s<3?o(n):s>3?o(r,t,n):o(r,t))||n);return s>3&&n&&Object.defineProperty(r,t,n),n};const h=class{constructor(t){e(this,t),this.fileTypes=["view","contents","download"],this.renderLiveDocs=e=>{if(!this.isLiveDocsAvailable(e))return r("limebb-live-docs-info",null);if(!this.platform.isFeatureEnabled("useOfficeFilePreview"))return r("limebb-empty-state",{value:"Preview of this file type will be available soon",icon:{name:"attention",color:"rgb(var(--color-blue-light))"}});const t=this.getLiveDocsUrl(e);return r("iframe",{src:t,frameBorder:0,marginHeight:0,marginWidth:0})},this.renderFileViewer=e=>{const t=e.filename,i=this.getFileUrl(e);return i?r("limel-file-viewer",{filename:t,url:i,allowFullscreen:!0,allowOpenInNewTab:!0}):this.renderNotFound()},this.renderUnsupported=e=>r("limel-file-viewer",{filename:e.filename,url:void 0,allowFullscreen:!0,allowOpenInNewTab:!0}),this.renderNotFound=()=>[r("section",{class:"not-found"},r("limel-icon",{name:"error",size:"large"}),r("h2",null,this.translator.get("webclient.not-found")),r("p",null,this.translator.get("webclient.no-files-attached",{object:this.getDescriptive(this.limeobject)})))]}render(){const e=this.getFile();if(!e)return this.renderNotFound();const r=l[e.extension.toLowerCase()]||"unsupported";return(0,{fileViewer:this.renderFileViewer,browser:this.renderFileViewer,sharepoint:this.renderLiveDocs,unsupported:this.renderUnsupported}[r])(e)}getLiveDocsUrl(e){let r=[...this.fileTypes];return this.platform.isFeatureEnabled("useOfficeFilePreview")&&(r=["pdf",...r]),r.filter(this.isLiveDocsType).map((r=>e.getUrl(r))).find(Boolean)}getFileUrl(e){return this.fileTypes.filter(s(this.isLiveDocsType)).map((r=>e.getUrl(r))).find(Boolean)}getFile(){const e=this.fileProperty;if(e)return this.limeobject.getFile(e.name)}isLiveDocsAvailable(e){return n.some((r=>e.getUrl(r)))}isLiveDocsType(e){return n.includes(e)}getDescriptive(e){var r;return(null==e?void 0:e.descriptive)||(null===(r=this.limetype)||void 0===r?void 0:r.localname.singular)||this.translator.get("object")}get fileProperty(){if(this.limeobject){if(this.property){const e=this.limeobject.getLimetype().getProperty(this.property);if("file"===e.type)return e}return Object.values(this.limeobject.getLimetype().properties).find((e=>"file"===e.type))}}get translator(){return this.platform.get(o.Translate)}};a([t()],h.prototype,"limeobject",void 0),a([i()],h.prototype,"limetype",void 0),h.style=".not-found{display:flex;flex-direction:column;height:100%;align-items:center;justify-content:center;line-height:1rem;color:rgb(var(--contrast-1100))}.not-found limel-icon{color:rgb(var(--color-red-default))}iframe{height:100%;width:100%}";export{h as limebb_limeobject_file_viewer}