@limetech/lime-crm-building-blocks 1.126.0 → 1.126.2
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.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/{index.esm-QC7n_5ug.js → index.esm-C1i_NocP.js} +274 -217
- package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
- package/dist/cjs/{lime-query-validation-Djq87Kvd.js → lime-query-validation-DOruuzFE.js} +7 -7
- package/dist/cjs/limebb-browser.cjs.entry.js +1 -1
- package/dist/cjs/limebb-chat-icon-list_3.cjs.entry.js +1 -1
- package/dist/cjs/limebb-chat-list.cjs.entry.js +1 -1
- package/dist/cjs/limebb-component-config.cjs.entry.js +1 -1
- package/dist/cjs/limebb-component-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-composer-toolbar.cjs.entry.js +1 -1
- package/dist/cjs/limebb-currency-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-data-cells.cjs.entry.js +1 -1
- package/dist/cjs/limebb-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-feed-timeline-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-feed.cjs.entry.js +1 -1
- package/dist/cjs/limebb-info-tile.cjs.entry.js +8 -8
- package/dist/cjs/limebb-kanban-group.cjs.entry.js +2 -2
- package/dist/cjs/limebb-kanban-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +3 -3
- package/dist/cjs/limebb-lime-query-filter-builder_3.cjs.entry.js +6 -6
- package/dist/cjs/limebb-lime-query-filter-comparison_2.cjs.entry.js +17 -17
- package/dist/cjs/limebb-lime-query-filter-group_3.cjs.entry.js +11 -11
- package/dist/cjs/limebb-lime-query-response-format-builder.cjs.entry.js +3 -3
- package/dist/cjs/limebb-limeobject-file-viewer.cjs.entry.js +3 -3
- package/dist/cjs/limebb-loader.cjs.entry.js +1 -1
- package/dist/cjs/limebb-locale-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-mention.cjs.entry.js +1 -1
- package/dist/cjs/limebb-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-notification-list.cjs.entry.js +1 -1
- package/dist/cjs/limebb-object-chip.cjs.entry.js +3 -3
- package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +1 -1
- package/dist/cjs/limebb-property-selector.cjs.entry.js +3 -3
- package/dist/cjs/limebb-rule-chip-popover.cjs.entry.js +6 -4
- package/dist/cjs/limebb-rule-editor.cjs.entry.js +21 -18
- package/dist/cjs/limebb-rule-gate.cjs.entry.js +2 -2
- package/dist/cjs/limebb-text-editor.cjs.entry.js +5 -5
- package/dist/cjs/limebb-trend-indicator.cjs.entry.js +1 -1
- package/dist/cjs/{limetype-C1krEdDi.js → limetype-BlG0Apxb.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/rule-editor/rule-chip-popover/rule-chip-popover.js +6 -4
- package/dist/collection/components/rule-editor/rule-editor.js +14 -14
- package/dist/collection/components/rule-editor/view-helpers.js +14 -11
- package/dist/collection/components/rule-gate/rule-gate.js +6 -6
- package/dist/components/chat-item.js +1 -1
- package/dist/components/currency-picker.js +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/feed-timeline-item.js +1 -1
- package/dist/components/index.esm.js +1 -1
- package/dist/components/kanban-group.js +1 -1
- package/dist/components/kanban-item.js +1 -1
- package/dist/components/lime-query-filter-builder.js +1 -1
- package/dist/components/lime-query-filter-comparison.js +1 -1
- package/dist/components/lime-query-filter-expression.js +1 -1
- package/dist/components/lime-query-validation.js +1 -1
- package/dist/components/lime-query-value-input.js +1 -1
- package/dist/components/limebb-browser.js +1 -1
- package/dist/components/limebb-chat-list.js +1 -1
- package/dist/components/limebb-component-config.js +1 -1
- package/dist/components/limebb-component-picker.js +1 -1
- package/dist/components/limebb-composer-toolbar.js +1 -1
- package/dist/components/limebb-data-cells.js +1 -1
- package/dist/components/limebb-feed.js +1 -1
- package/dist/components/limebb-info-tile.js +1 -1
- package/dist/components/limebb-lime-query-builder.js +1 -1
- package/dist/components/limebb-lime-query-response-format-builder.js +1 -1
- package/dist/components/limebb-limeobject-file-viewer.js +1 -1
- package/dist/components/limebb-loader.js +1 -1
- package/dist/components/limebb-locale-picker.js +1 -1
- package/dist/components/limebb-mention.js +1 -1
- package/dist/components/limebb-notification-list.js +1 -1
- package/dist/components/limebb-object-chip.js +1 -1
- package/dist/components/limebb-rule-editor.js +1 -1
- package/dist/components/limebb-rule-gate.js +1 -1
- package/dist/components/limebb-text-editor.js +1 -1
- package/dist/components/limebb-trend-indicator.js +1 -1
- package/dist/components/limetype-field.js +1 -1
- package/dist/components/notification-item.js +1 -1
- package/dist/components/percentage-visualizer.js +1 -1
- package/dist/components/property-selector.js +1 -1
- package/dist/components/rule-chip-popover.js +1 -1
- package/dist/esm/{index.esm-EC5zE5lw.js → index.esm-CMeGYws2.js} +267 -210
- package/dist/esm/lime-crm-building-blocks.js +1 -1
- package/dist/esm/{lime-query-validation-Dav-tsNr.js → lime-query-validation-DvCLebd2.js} +7 -7
- package/dist/esm/limebb-browser.entry.js +1 -1
- package/dist/esm/limebb-chat-icon-list_3.entry.js +1 -1
- package/dist/esm/limebb-chat-list.entry.js +1 -1
- package/dist/esm/limebb-component-config.entry.js +1 -1
- package/dist/esm/limebb-component-picker.entry.js +1 -1
- package/dist/esm/limebb-composer-toolbar.entry.js +1 -1
- package/dist/esm/limebb-currency-picker.entry.js +1 -1
- package/dist/esm/limebb-data-cells.entry.js +1 -1
- package/dist/esm/limebb-date-picker.entry.js +1 -1
- package/dist/esm/limebb-feed-timeline-item.entry.js +1 -1
- package/dist/esm/limebb-feed.entry.js +1 -1
- package/dist/esm/limebb-info-tile.entry.js +8 -8
- package/dist/esm/limebb-kanban-group.entry.js +2 -2
- package/dist/esm/limebb-kanban-item.entry.js +1 -1
- package/dist/esm/limebb-lime-query-builder.entry.js +3 -3
- package/dist/esm/limebb-lime-query-filter-builder_3.entry.js +6 -6
- package/dist/esm/limebb-lime-query-filter-comparison_2.entry.js +17 -17
- package/dist/esm/limebb-lime-query-filter-group_3.entry.js +11 -11
- package/dist/esm/limebb-lime-query-response-format-builder.entry.js +3 -3
- package/dist/esm/limebb-limeobject-file-viewer.entry.js +3 -3
- package/dist/esm/limebb-loader.entry.js +1 -1
- package/dist/esm/limebb-locale-picker.entry.js +1 -1
- package/dist/esm/limebb-mention.entry.js +1 -1
- package/dist/esm/limebb-notification-item.entry.js +1 -1
- package/dist/esm/limebb-notification-list.entry.js +1 -1
- package/dist/esm/limebb-object-chip.entry.js +3 -3
- package/dist/esm/limebb-percentage-visualizer.entry.js +1 -1
- package/dist/esm/limebb-property-selector.entry.js +3 -3
- package/dist/esm/limebb-rule-chip-popover.entry.js +6 -4
- package/dist/esm/limebb-rule-editor.entry.js +21 -18
- package/dist/esm/limebb-rule-gate.entry.js +2 -2
- package/dist/esm/limebb-text-editor.entry.js +5 -5
- package/dist/esm/limebb-trend-indicator.entry.js +1 -1
- package/dist/esm/{limetype-COL4hyNy.js → limetype-DvPoeXt-.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/{p-7d51a34c.entry.js → p-006b6449.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-c469db7e.entry.js → p-10ddd002.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-277b6ad4.entry.js → p-1955495c.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-11494f30.entry.js → p-25234f4b.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-abcb1e49.entry.js → p-2a05b949.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-30778dac.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-1797622d.entry.js → p-47799e80.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-fd6dcfe3.entry.js → p-49b8a9ca.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-6093254e.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-b8d9ff68.entry.js → p-610dae2e.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-62b247c1.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-65ea94b4.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-dd38e0ba.entry.js → p-7975c91f.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-c4f41ec4.entry.js → p-7ace2e41.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-8084e825.entry.js → p-89170cc9.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-3781a766.entry.js → p-92738a30.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-71a6f624.entry.js → p-99054b73.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-f09c7244.entry.js → p-993991af.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-f0a567f3.entry.js → p-99790629.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-74455a30.entry.js → p-9ccd9d7f.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-f5244a1a.entry.js → p-9f03e766.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-CAMipqwt.js → p-CI7dwT4T.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-C25FPZQh.js → p-CYiNR7pQ.js} +1 -1
- package/dist/lime-crm-building-blocks/p-D5qhls4G.js +1 -0
- package/dist/lime-crm-building-blocks/{p-8d6cc027.entry.js → p-a3439b73.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-6ada2b2b.entry.js → p-a634c792.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-b1a8d1a0.entry.js → p-b978301b.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-43a7facd.entry.js → p-beae8aa1.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-e6ed33ff.entry.js → p-c3a72b03.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-6d3a9ed3.entry.js → p-c43dc121.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-7a125570.entry.js → p-d026068f.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-d1c61830.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-057e1638.entry.js → p-d33efebb.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-24fc049c.entry.js → p-e1e1e2d1.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-c139ab98.entry.js → p-e468e359.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-35c72752.entry.js → p-ea461bb7.entry.js} +1 -1
- package/dist/types/components/rule-editor/rule-editor.d.ts +5 -5
- package/dist/types/components/rule-editor/view-helpers.d.ts +7 -3
- package/dist/types/components/rule-gate/rule-gate.d.ts +2 -2
- package/dist/types/components.d.ts +12 -12
- package/package.json +4 -5
- package/dist/lime-crm-building-blocks/p-1831e571.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-3313e357.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-7922726c.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-BeLcuSg8.js +0 -1
- package/dist/lime-crm-building-blocks/p-cefb24bb.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-e717bdff.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as o,createEvent as t,h as r,Host as i,transformTag as a}from"@stencil/core/internal/client";import{M as n,n as l}from"./index.esm.js";import{d as s}from"./kanban-item.js";import{d as m}from"./navigation-button.js";import{d as b}from"./summary-popover.js";const c=e(class extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.loadMore=t(this,"loadMore",7),this.items=[],this.handleLoadMore=e=>{e.stopPropagation(),this.loadMore.emit(this.identifier)}}render(){return r(i,{key:"7c08e70a3e4ea0641b3e556098ccaff818bf11c3"},this.renderHelp(),this.renderGroupHeading(),this.renderGroupSummary(),this.renderItems())}renderGroupSummary(){if(this.summary&&this.totalCount)return r("limel-markdown",{class:"group-summary",value:this.summary})}renderGroupHeading(){return r("limel-header",{heading:this.heading},this.renderCounterBadge())}renderHelp(){if(this.help)return r("limel-help",{value:this.help})}renderSpinner(){if(this.loading)return r("limel-spinner",{size:"small"})}renderCounterBadge(){if(this.totalCount)return[r("limel-badge",{slot:"actions",id:"badge-tooltip",label:this.totalCount}),this.renderTooltip()]}renderTooltip(){const e=this.translator.get("webclient.kanban.item-in-group",{count:this.totalCount}),o=this.limetype?this.labelWithLimetype():e;return r("limel-tooltip",{elementId:"badge-tooltip",label:o||"",openDirection:"top"})}labelWithLimetype(){return this.translator.get("webclient.kanban.limetype-item-in-group",{limetype:this.totalCount>1?this.limetype.localname.plural:this.limetype.localname.singular,count:this.totalCount})}renderItems(){if(this.loading||0!==this.items.length)return r("div",{class:"items"},this.renderKanbanItems(),this.renderSpinner(),this.renderLoadMore())}renderKanbanItems(){return this.items.map((e=>{var o,t;const i=null===(o=e.bodyComponent)||void 0===o?void 0:o.name;return r("limebb-kanban-item",{tabindex:0,platform:this.platform,context:this.context,item:e,key:e.id},i&&r(i,Object.assign({slot:"body",platform:this.platform,context:this.context},null===(t=e.bodyComponent)||void 0===t?void 0:t.props)))}))}renderLoadMore(){if(!(this.loading||this.items.length>=this.totalCount))return r("limel-icon-button",{class:"load-more-button",icon:"more",onClick:this.handleLoadMore,elevated:!0,label:this.translator.get("webclient.load-more")})}get translator(){return this.platform.get(l.Translate)}static get style(){return'@charset "UTF-8";:host(limebb-feed-timeline-item.is-tall) .markdown-container{margin-bottom:0.5rem}:host(limebb-feed-timeline-item.is-tall) .body-text{--body-text-min-height-set-by-code:10rem;min-height:calc(var(--body-text-min-height-set-by-code) + 0.25rem)}:host(limebb-feed-timeline-item.is-tall) .body-text:after{transition:opacity 0.6s ease;content:"";opacity:0.26;pointer-events:none;position:absolute;bottom:-0.125rem;right:-0.125rem;left:-0.125rem;height:2.5rem;background:radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)) 0 100%, linear-gradient(to bottom, rgb(var(--limebb-feed-item-background-color), 0) 0%, rgb(var(--limebb-feed-item-background-color), 90%) 100%);background-repeat:no-repeat;background-size:100% 0.5rem, 100% 100%}:host(limebb-feed-timeline-item.is-tall.shows-less) .markdown-container{grid-template-rows:0fr}:host(limebb-feed-timeline-item.is-tall.shows-less) .body-text:after{opacity:1}:host(limebb-feed-timeline-item.is-tall.shows-more) .markdown-container{grid-template-rows:1fr}:host(limebb-feed-timeline-item.is-tall.shows-more) #show-more-button limel-icon{rotate:180deg}.markdown-container{position:relative;display:grid}.markdown-container:not(.opened){transition:grid-template-rows min(var(--body-text-height) * 1.2ms, 500ms) cubic-bezier(1, 0.09, 0, 0.89)}.body-text{display:block;overflow:hidden}button#show-more-button{appearance:none;background:none;border:none;padding:0;margin:0;font:inherit;color:inherit;text-align:inherit;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(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal);z-index:1;position:absolute;right:0;bottom:-0.6rem;left:0;margin:0 auto;display:flex;align-items:center;justify-content:center;border-radius:3rem;width:2rem;height:1rem}button#show-more-button:hover,button#show-more-button:focus,button#show-more-button:focus-visible{will-change:color, background-color, box-shadow, transform}button#show-more-button:hover,button#show-more-button:focus-visible{transform:translate3d(0, -0.04rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}button#show-more-button:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}button#show-more-button:hover,button#show-more-button:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}button#show-more-button:focus{outline:none}button#show-more-button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}button#show-more-button limel-icon{transition:rotate 0.2s ease 0.5s;color:var(--mdc-theme-primary);width:0.75rem}*{box-sizing:border-box}:host(limebb-kanban-group){position:relative;background-color:rgb(var(--limebb-kanban-group-primary-background));--header-top-right-left-border-radius:0.5rem;--limebb-kanban-group-secondary-background:var(--contrast-300);--limebb-kanban-group-primary-background:var(--contrast-600);scroll-snap-align:start;box-sizing:border-box;display:flex;flex-direction:column;border-radius:0.5rem;min-width:var(--limebb-kanban-group-width, 22rem);max-width:100%}:host(limebb-kanban-group[total-count="0"]){min-width:var(--limebb-kanban-group-width, 8rem)}:host(limebb-kanban-group.secondary){border:1px dashed rgb(var(--contrast-700));background-color:rgb(var(--limebb-kanban-group-secondary-background))}:host(limebb-kanban-group.secondary) limebb-kanban-item{border:1px dashed rgb(var(--contrast-700))}:host(limebb-kanban-group.secondary) limel-header{background-color:rgb(var(--limebb-kanban-group-secondary-background))}limel-header{padding-right:0.5rem;background-color:rgb(var(--limebb-kanban-group-primary-background));width:100%}limel-badge{--badge-background-color:rgb(var(--contrast-200))}limel-help{position:absolute;z-index:1;left:-0.25rem;top:-0.25rem}.group-summary{flex-shrink:0;padding:0 0.75rem 0.5rem 0.75rem;opacity:0.6;max-height:7rem;max-width:100%;overflow-y:auto}.load-more-button,limel-spinner{align-self:center}.load-more-button{--icon-background-color:var(--lime-elevated-surface-background-color)}.items{--limel-overflow-mask-vertical:linear-gradient( to bottom, transparent 0%, black calc(0% + var(--limel-top-edge-fade-height, 1rem)), black calc(100% - var(--limel-bottom-edge-fade-height, 1rem)), transparent 100% );-webkit-mask-image:var(--limel-overflow-mask-vertical);mask-image:var(--limel-overflow-mask-vertical);padding-top:var(--limel-top-edge-fade-height, 1rem);padding-bottom:var(--limel-bottom-edge-fade-height, 1rem);--limel-top-edge-fade-height:0.5rem;--limel-bottom-edge-fade-height:2rem;flex-grow:1;display:flex;flex-direction:column;gap:0.75rem;padding:var(--limel-top-edge-fade-height) 0.5rem var(--limel-bottom-edge-fade-height) 0.5rem;overflow-y:auto;-webkit-overflow-scrolling:touch}limebb-kanban-item{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(--lime-elevated-surface-background-color)}limebb-kanban-item:hover,limebb-kanban-item:focus,limebb-kanban-item:focus-visible{will-change:color, background-color, box-shadow, transform}limebb-kanban-item:hover,limebb-kanban-item:focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}limebb-kanban-item:hover{box-shadow:var(--button-shadow-hovered)}limebb-kanban-item:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}limebb-kanban-item:hover,limebb-kanban-item:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}limebb-kanban-item:focus{outline:none}limebb-kanban-item:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}limebb-kanban-item.is-selected{box-shadow:var(--shadow-focused-state)}limebb-kanban-item.is-selected:hover{box-shadow:var(--shadow-focused-state), var(--button-shadow-hovered)}'}},[1,"limebb-kanban-group",{platform:[16],context:[16],identifier:[1],heading:[513],help:[1],items:[16],summary:[1],loading:[516],totalCount:[514,"total-count"]}]);function d(){"undefined"!=typeof customElements&&["limebb-kanban-group","limebb-kanban-item","limebb-navigation-button","limebb-summary-popover"].forEach((e=>{switch(e){case"limebb-kanban-group":customElements.get(a(e))||customElements.define(a(e),c);break;case"limebb-kanban-item":customElements.get(a(e))||s();break;case"limebb-navigation-button":customElements.get(a(e))||m();break;case"limebb-summary-popover":customElements.get(a(e))||b()}}))}!function(e,o,t,r){var i,a=arguments.length,n=a<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,o,t,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(n=(a<3?i(n):a>3?i(o,t,n):i(o,t))||n);a>3&&n&&Object.defineProperty(o,t,n)}([n()],c.prototype,"limetype",void 0);export{c as K,d}
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as o,createEvent as t,h as r,Host as i,transformTag as a}from"@stencil/core/internal/client";import{R as n,b as l}from"./index.esm.js";import{d as s}from"./kanban-item.js";import{d as m}from"./navigation-button.js";import{d as b}from"./summary-popover.js";const c=e(class extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.loadMore=t(this,"loadMore",7),this.items=[],this.handleLoadMore=e=>{e.stopPropagation(),this.loadMore.emit(this.identifier)}}render(){return r(i,{key:"7c08e70a3e4ea0641b3e556098ccaff818bf11c3"},this.renderHelp(),this.renderGroupHeading(),this.renderGroupSummary(),this.renderItems())}renderGroupSummary(){if(this.summary&&this.totalCount)return r("limel-markdown",{class:"group-summary",value:this.summary})}renderGroupHeading(){return r("limel-header",{heading:this.heading},this.renderCounterBadge())}renderHelp(){if(this.help)return r("limel-help",{value:this.help})}renderSpinner(){if(this.loading)return r("limel-spinner",{size:"small"})}renderCounterBadge(){if(this.totalCount)return[r("limel-badge",{slot:"actions",id:"badge-tooltip",label:this.totalCount}),this.renderTooltip()]}renderTooltip(){const e=this.translator.get("webclient.kanban.item-in-group",{count:this.totalCount}),o=this.limetype?this.labelWithLimetype():e;return r("limel-tooltip",{elementId:"badge-tooltip",label:o||"",openDirection:"top"})}labelWithLimetype(){return this.translator.get("webclient.kanban.limetype-item-in-group",{limetype:this.totalCount>1?this.limetype.localname.plural:this.limetype.localname.singular,count:this.totalCount})}renderItems(){if(this.loading||0!==this.items.length)return r("div",{class:"items"},this.renderKanbanItems(),this.renderSpinner(),this.renderLoadMore())}renderKanbanItems(){return this.items.map((e=>{var o,t;const i=null===(o=e.bodyComponent)||void 0===o?void 0:o.name;return r("limebb-kanban-item",{tabindex:0,platform:this.platform,context:this.context,item:e,key:e.id},i&&r(i,Object.assign({slot:"body",platform:this.platform,context:this.context},null===(t=e.bodyComponent)||void 0===t?void 0:t.props)))}))}renderLoadMore(){if(!(this.loading||this.items.length>=this.totalCount))return r("limel-icon-button",{class:"load-more-button",icon:"more",onClick:this.handleLoadMore,elevated:!0,label:this.translator.get("webclient.load-more")})}get translator(){return this.platform.get(l.Translate)}static get style(){return'@charset "UTF-8";:host(limebb-feed-timeline-item.is-tall) .markdown-container{margin-bottom:0.5rem}:host(limebb-feed-timeline-item.is-tall) .body-text{--body-text-min-height-set-by-code:10rem;min-height:calc(var(--body-text-min-height-set-by-code) + 0.25rem)}:host(limebb-feed-timeline-item.is-tall) .body-text:after{transition:opacity 0.6s ease;content:"";opacity:0.26;pointer-events:none;position:absolute;bottom:-0.125rem;right:-0.125rem;left:-0.125rem;height:2.5rem;background:radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)) 0 100%, linear-gradient(to bottom, rgb(var(--limebb-feed-item-background-color), 0) 0%, rgb(var(--limebb-feed-item-background-color), 90%) 100%);background-repeat:no-repeat;background-size:100% 0.5rem, 100% 100%}:host(limebb-feed-timeline-item.is-tall.shows-less) .markdown-container{grid-template-rows:0fr}:host(limebb-feed-timeline-item.is-tall.shows-less) .body-text:after{opacity:1}:host(limebb-feed-timeline-item.is-tall.shows-more) .markdown-container{grid-template-rows:1fr}:host(limebb-feed-timeline-item.is-tall.shows-more) #show-more-button limel-icon{rotate:180deg}.markdown-container{position:relative;display:grid}.markdown-container:not(.opened){transition:grid-template-rows min(var(--body-text-height) * 1.2ms, 500ms) cubic-bezier(1, 0.09, 0, 0.89)}.body-text{display:block;overflow:hidden}button#show-more-button{appearance:none;background:none;border:none;padding:0;margin:0;font:inherit;color:inherit;text-align:inherit;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(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal);z-index:1;position:absolute;right:0;bottom:-0.6rem;left:0;margin:0 auto;display:flex;align-items:center;justify-content:center;border-radius:3rem;width:2rem;height:1rem}button#show-more-button:hover,button#show-more-button:focus,button#show-more-button:focus-visible{will-change:color, background-color, box-shadow, transform}button#show-more-button:hover,button#show-more-button:focus-visible{transform:translate3d(0, -0.04rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}button#show-more-button:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}button#show-more-button:hover,button#show-more-button:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}button#show-more-button:focus{outline:none}button#show-more-button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}button#show-more-button limel-icon{transition:rotate 0.2s ease 0.5s;color:var(--mdc-theme-primary);width:0.75rem}*{box-sizing:border-box}:host(limebb-kanban-group){position:relative;background-color:rgb(var(--limebb-kanban-group-primary-background));--header-top-right-left-border-radius:0.5rem;--limebb-kanban-group-secondary-background:var(--contrast-300);--limebb-kanban-group-primary-background:var(--contrast-600);scroll-snap-align:start;box-sizing:border-box;display:flex;flex-direction:column;border-radius:0.5rem;min-width:var(--limebb-kanban-group-width, 22rem);max-width:100%}:host(limebb-kanban-group[total-count="0"]){min-width:var(--limebb-kanban-group-width, 8rem)}:host(limebb-kanban-group.secondary){border:1px dashed rgb(var(--contrast-700));background-color:rgb(var(--limebb-kanban-group-secondary-background))}:host(limebb-kanban-group.secondary) limebb-kanban-item{border:1px dashed rgb(var(--contrast-700))}:host(limebb-kanban-group.secondary) limel-header{background-color:rgb(var(--limebb-kanban-group-secondary-background))}limel-header{padding-right:0.5rem;background-color:rgb(var(--limebb-kanban-group-primary-background));width:100%}limel-badge{--badge-background-color:rgb(var(--contrast-200))}limel-help{position:absolute;z-index:1;left:-0.25rem;top:-0.25rem}.group-summary{flex-shrink:0;padding:0 0.75rem 0.5rem 0.75rem;opacity:0.6;max-height:7rem;max-width:100%;overflow-y:auto}.load-more-button,limel-spinner{align-self:center}.load-more-button{--icon-background-color:var(--lime-elevated-surface-background-color)}.items{--limel-overflow-mask-vertical:linear-gradient( to bottom, transparent 0%, black calc(0% + var(--limel-top-edge-fade-height, 1rem)), black calc(100% - var(--limel-bottom-edge-fade-height, 1rem)), transparent 100% );-webkit-mask-image:var(--limel-overflow-mask-vertical);mask-image:var(--limel-overflow-mask-vertical);padding-top:var(--limel-top-edge-fade-height, 1rem);padding-bottom:var(--limel-bottom-edge-fade-height, 1rem);--limel-top-edge-fade-height:0.5rem;--limel-bottom-edge-fade-height:2rem;flex-grow:1;display:flex;flex-direction:column;gap:0.75rem;padding:var(--limel-top-edge-fade-height) 0.5rem var(--limel-bottom-edge-fade-height) 0.5rem;overflow-y:auto;-webkit-overflow-scrolling:touch}limebb-kanban-item{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(--lime-elevated-surface-background-color)}limebb-kanban-item:hover,limebb-kanban-item:focus,limebb-kanban-item:focus-visible{will-change:color, background-color, box-shadow, transform}limebb-kanban-item:hover,limebb-kanban-item:focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}limebb-kanban-item:hover{box-shadow:var(--button-shadow-hovered)}limebb-kanban-item:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}limebb-kanban-item:hover,limebb-kanban-item:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}limebb-kanban-item:focus{outline:none}limebb-kanban-item:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}limebb-kanban-item.is-selected{box-shadow:var(--shadow-focused-state)}limebb-kanban-item.is-selected:hover{box-shadow:var(--shadow-focused-state), var(--button-shadow-hovered)}'}},[1,"limebb-kanban-group",{platform:[16],context:[16],identifier:[1],heading:[513],help:[1],items:[16],summary:[1],loading:[516],totalCount:[514,"total-count"]}]);function d(){"undefined"!=typeof customElements&&["limebb-kanban-group","limebb-kanban-item","limebb-navigation-button","limebb-summary-popover"].forEach((e=>{switch(e){case"limebb-kanban-group":customElements.get(a(e))||customElements.define(a(e),c);break;case"limebb-kanban-item":customElements.get(a(e))||s();break;case"limebb-navigation-button":customElements.get(a(e))||m();break;case"limebb-summary-popover":customElements.get(a(e))||b()}}))}!function(e,o,t,r){var i,a=arguments.length,n=a<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,o,t,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(n=(a<3?i(n):a>3?i(o,t,n):i(o,t))||n);a>3&&n&&Object.defineProperty(o,t,n)}([n()],c.prototype,"limetype",void 0);export{c as K,d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as i,createEvent as o,h as r,Host as a,transformTag as s}from"@stencil/core/internal/client";import{n as t}from"./index.esm.js";import{d as n}from"./navigation-button.js";import{d as l}from"./summary-popover.js";const c=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.interact=o(this,"interact",7),this.renderRelations=()=>{var e,i,o;if(null===(i=null===(e=this.item)||void 0===e?void 0:e.relations)||void 0===i?void 0:i.length)return r("limel-chip-set",{value:null===(o=this.item)||void 0===o?void 0:o.relations})},this.renderAssigneesAvatar=e=>e.picture?r("img",{loading:"lazy",src:e.picture,alt:e.name.text}):r("limel-icon",{name:e.icon.name,style:{color:`${e.icon.color}`,"background-color":`${e.icon.backgroundColor}`}}),this.createMenuItem=e=>{var i,o;return"separator"in e?e:{value:e,text:null!==(i=e.label)&&void 0!==i?i:"",secondaryText:e.description,disabled:e.disabled,icon:null!==(o=e.icon)&&void 0!==o?o:""}},this.handleMenuItemSelect=e=>{var i;e.stopPropagation();const o=null===(i=e.detail.value)||void 0===i?void 0:i.command;o&&this.commandbus.handle(o)},this.handleKeyDown=e=>{"Enter"===e.key&&this.handleKanbanItemClick()},this.handleKanbanItemClick=()=>{this.interact.emit(this.item)}}render(){var e,i;return r(a,{key:"0d3c75642c2ea8ec42e475ef7a5e206f408eb446",id:this.item.id.toString(),class:{"has-unpromoted-actions":!!(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length),"is-selected":!!(null===(i=this.item)||void 0===i?void 0:i.selected)},style:{"--limebb-kanban-item-color-code":`${this.item.color}`},onClick:this.handleKanbanItemClick,onKeyDown:this.handleKeyDown},this.renderHeader(),this.renderContent(),this.renderSlot(),this.renderRelations(),this.renderFooter())}renderHeader(){return r("div",{class:"header"},this.renderIcon(),this.renderHeading(),this.renderUnpromotedActionsMenu())}renderIcon(){var e,i,o,a;if(this.item.icon)return r("limel-icon",{class:"icon",badge:!0,name:null!==(i=null===(e=this.item.icon)||void 0===e?void 0:e.name)&&void 0!==i?i:"dot_circle",style:{color:`${null===(o=this.item.icon)||void 0===o?void 0:o.color}`,"background-color":`${null===(a=this.item.icon)||void 0===a?void 0:a.backgroundColor}`}})}renderContent(){if(this.item.value)return r("div",{class:"content"},this.renderValue())}renderHeading(){if(this.item.heading)return r("limel-markdown",{class:"heading",value:this.item.heading})}renderValue(){if(this.item.value)return r("limel-markdown",{class:"body reset-img-height",value:this.item.value})}renderUnpromotedActionsMenu(){var e,i;if(!(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length))return;const o=this.item.unpromotedActions.map(this.createMenuItem);return r("limel-menu",{class:"unpromoted-actions-menu",items:o,openDirection:"bottom-end",onSelect:this.handleMenuItemSelect},r("limel-icon",{class:"actions",name:"menu_2",slot:"trigger",size:"small",id:"item-actions-tooltip"}),r("limel-tooltip",{elementId:"item-actions-tooltip",label:null===(i=this.translator)||void 0===i?void 0:i.get("webclient.more-actions"),openDirection:"top-end"}))}renderSlot(){var e;if(null===(e=this.item)||void 0===e?void 0:e.bodyComponent)return r("slot",{name:"body"})}renderFooter(){var e;if(null===(e=this.item.assignees)||void 0===e?void 0:e.length)return r("div",{class:"footer"},this.renderAssignees())}renderAssignees(){var e;if(null===(e=this.item.assignees)||void 0===e?void 0:e.length)return r("div",{class:"assignees"},this.item.assignees.map((e=>{var i;return r("limebb-summary-popover",Object.assign({icon:null===(i=e.icon)||void 0===i?void 0:i.name},e.picture&&{image:{src:e.picture,alt:e.name.text||""}},{heading:e.name.text,value:this.createLinkToAssignee(e)}),r("a",{slot:"trigger",class:"assignee",href:e.name.href,title:e.name.text},this.renderAssigneesAvatar(e),r("span",null,e.name.text)))})))}createLinkToAssignee(e){const i=this.translator.get("webclient.actions.goto-object",{limetype:": <br><b>"+e.name.text+"</b>"});return`<a class="author" href="${e.name.href}" title="${e.name.text}">${i}</a>`}get translator(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(t.Translate)}get commandbus(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(t.CommandBus)}static get style(){return'@charset "UTF-8";*,*:before,*:after{box-sizing:border-box}:host(limebb-kanban-item){position:relative;box-sizing:border-box;display:flex;flex-direction:column;border-radius:0.5rem}:host(limebb-kanban-item):before{content:"";display:block;position:absolute;top:1rem;bottom:1rem;right:0;transform:translateX(50%);width:0.25rem;border-radius:1rem;background-color:var(--limebb-kanban-item-color-code)}.content{padding-top:0.25rem}.header{display:flex;align-items:flex-start;gap:0.5rem;min-height:1.75rem;padding:0.25rem 0.5rem;border-radius:0.5rem 0.5rem 0 0;background-color:rgb(var(--contrast-300))}.header a{position:relative;cursor:pointer;transition:color 0.2s ease;color:var(--mdc-theme-primary);text-decoration:none}.header a:before{transition:opacity 0.2s ease, transform 0.3s ease-out;content:"";position:absolute;inset:auto 0 0 0;width:calc(100% - 0.5rem);margin:auto;height:0.125rem;border-radius:1rem;background-color:currentColor;opacity:0;transform:scale(0.6)}.header a:hover{color:rgb(var(--color-teal-light))}.header a:hover:before{opacity:0.3;transform:scale(1)}.heading{--markdown-hyperlink-color:var(--mdc-theme-primary);--markdown-hyperlink-color--hovered:rgb(var(--color-teal-light))}.unpromoted-actions-menu{margin:-0.5rem -0.5rem -0.25rem auto}.body{--limel-top-edge-fade-height:0.5rem;--limel-bottom-edge-fade-height:0.5rem;display:block;padding-left:0.5rem;padding-right:0.5rem;margin-top:-0.5rem;color:rgb(var(--contrast-1100));max-height:12rem;--limel-overflow-mask-vertical:linear-gradient( to bottom, transparent 0%, black calc(0% + var(--limel-top-edge-fade-height, 1rem)), black calc(100% - var(--limel-bottom-edge-fade-height, 1rem)), transparent 100% );-webkit-mask-image:var(--limel-overflow-mask-vertical);mask-image:var(--limel-overflow-mask-vertical);padding-top:var(--limel-top-edge-fade-height, 1rem);padding-bottom:var(--limel-bottom-edge-fade-height, 1rem)}limel-chip-set{--limel-chip-size:1.5rem;display:block;margin-left:-0.5rem;margin-right:0.5rem;padding-bottom:0.5rem}.footer{position:relative;display:flex;align-items:center;gap:0.5rem;padding:0.25rem 0.25rem 0.125rem;margin:0 0.25rem;border-top:1px dashed rgb(var(--contrast-300))}.header limel-icon,.footer limel-icon{flex-shrink:0;width:1.25rem;height:1.25rem}.header .actions{margin:0.5rem 0.25rem 0}.header .actions:hover{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(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal)}.header .actions:hover:hover,.header .actions:hover:focus,.header .actions:hover:focus-visible{will-change:color, background-color, box-shadow, transform}.header .actions:hover:hover,.header .actions:hover:focus-visible{transform:translate3d(0, -0.04rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.header .actions:hover:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.header .actions:hover:hover,.header .actions:hover:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.footer img{border-radius:50%;object-fit:cover;box-shadow:0 0 0 1px rgb(var(--contrast-800), 0.4);flex-shrink:0;width:1.25rem;height:1.25rem}.assignees{display:flex;align-items:center;gap:0.25rem}.assignees:has(>:nth-child(2)) span{display:none}.assignees:has(>:nth-child(2)) img,.assignees:has(>:nth-child(2)) limel-icon{margin-right:-0.5rem}.assignees:hover img,.assignees:hover limel-icon,.assignees:focus-within img,.assignees:focus-within limel-icon{margin-right:0rem}.assignees:hover .assignee:not(:hover):not(:focus-visible) img,.assignees:hover .assignee:not(:hover):not(:focus-visible) limel-icon,.assignees:focus-within .assignee:not(:hover):not(:focus-visible) img,.assignees:focus-within .assignee:not(:hover):not(:focus-visible) limel-icon{filter:grayscale(1);opacity:0.6}.assignee{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:transparent;display:flex;align-items:center;text-decoration:none;gap:0.25rem;margin-left:0;border-radius:1rem}.assignee:hover,.assignee:focus,.assignee:focus-visible{will-change:color, background-color, box-shadow, transform}.assignee:hover,.assignee:focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}.assignee:hover{box-shadow:var(--button-shadow-hovered)}.assignee:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.assignee:hover,.assignee:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.assignee:focus{outline:none}.assignee:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.assignee limel-icon,.assignee img{transition:margin 0.2s ease, opacity 0.2s ease, filter 0.2s ease}.assignee limel-icon{padding:0.125rem;box-shadow:0 0 0 1px rgb(var(--contrast-800), 0.4);background-color:rgb(var(--contrast-100))}.assignee span{font-size:0.75rem;color:rgb(var(--contrast-900));padding-right:0.5rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}slot[name=body]{display:block;padding:0.5rem}'}},[257,"limebb-kanban-item",{platform:[16],context:[16],item:[16]}]);function m(){"undefined"!=typeof customElements&&["limebb-kanban-item","limebb-navigation-button","limebb-summary-popover"].forEach((e=>{switch(e){case"limebb-kanban-item":customElements.get(s(e))||customElements.define(s(e),c);break;case"limebb-navigation-button":customElements.get(s(e))||n();break;case"limebb-summary-popover":customElements.get(s(e))||l()}}))}export{c as K,m as d}
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as i,createEvent as o,h as r,Host as a,transformTag as s}from"@stencil/core/internal/client";import{b as t}from"./index.esm.js";import{d as n}from"./navigation-button.js";import{d as l}from"./summary-popover.js";const c=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.interact=o(this,"interact",7),this.renderRelations=()=>{var e,i,o;if(null===(i=null===(e=this.item)||void 0===e?void 0:e.relations)||void 0===i?void 0:i.length)return r("limel-chip-set",{value:null===(o=this.item)||void 0===o?void 0:o.relations})},this.renderAssigneesAvatar=e=>e.picture?r("img",{loading:"lazy",src:e.picture,alt:e.name.text}):r("limel-icon",{name:e.icon.name,style:{color:`${e.icon.color}`,"background-color":`${e.icon.backgroundColor}`}}),this.createMenuItem=e=>{var i,o;return"separator"in e?e:{value:e,text:null!==(i=e.label)&&void 0!==i?i:"",secondaryText:e.description,disabled:e.disabled,icon:null!==(o=e.icon)&&void 0!==o?o:""}},this.handleMenuItemSelect=e=>{var i;e.stopPropagation();const o=null===(i=e.detail.value)||void 0===i?void 0:i.command;o&&this.commandbus.handle(o)},this.handleKeyDown=e=>{"Enter"===e.key&&this.handleKanbanItemClick()},this.handleKanbanItemClick=()=>{this.interact.emit(this.item)}}render(){var e,i;return r(a,{key:"0d3c75642c2ea8ec42e475ef7a5e206f408eb446",id:this.item.id.toString(),class:{"has-unpromoted-actions":!!(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length),"is-selected":!!(null===(i=this.item)||void 0===i?void 0:i.selected)},style:{"--limebb-kanban-item-color-code":`${this.item.color}`},onClick:this.handleKanbanItemClick,onKeyDown:this.handleKeyDown},this.renderHeader(),this.renderContent(),this.renderSlot(),this.renderRelations(),this.renderFooter())}renderHeader(){return r("div",{class:"header"},this.renderIcon(),this.renderHeading(),this.renderUnpromotedActionsMenu())}renderIcon(){var e,i,o,a;if(this.item.icon)return r("limel-icon",{class:"icon",badge:!0,name:null!==(i=null===(e=this.item.icon)||void 0===e?void 0:e.name)&&void 0!==i?i:"dot_circle",style:{color:`${null===(o=this.item.icon)||void 0===o?void 0:o.color}`,"background-color":`${null===(a=this.item.icon)||void 0===a?void 0:a.backgroundColor}`}})}renderContent(){if(this.item.value)return r("div",{class:"content"},this.renderValue())}renderHeading(){if(this.item.heading)return r("limel-markdown",{class:"heading",value:this.item.heading})}renderValue(){if(this.item.value)return r("limel-markdown",{class:"body reset-img-height",value:this.item.value})}renderUnpromotedActionsMenu(){var e,i;if(!(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length))return;const o=this.item.unpromotedActions.map(this.createMenuItem);return r("limel-menu",{class:"unpromoted-actions-menu",items:o,openDirection:"bottom-end",onSelect:this.handleMenuItemSelect},r("limel-icon",{class:"actions",name:"menu_2",slot:"trigger",size:"small",id:"item-actions-tooltip"}),r("limel-tooltip",{elementId:"item-actions-tooltip",label:null===(i=this.translator)||void 0===i?void 0:i.get("webclient.more-actions"),openDirection:"top-end"}))}renderSlot(){var e;if(null===(e=this.item)||void 0===e?void 0:e.bodyComponent)return r("slot",{name:"body"})}renderFooter(){var e;if(null===(e=this.item.assignees)||void 0===e?void 0:e.length)return r("div",{class:"footer"},this.renderAssignees())}renderAssignees(){var e;if(null===(e=this.item.assignees)||void 0===e?void 0:e.length)return r("div",{class:"assignees"},this.item.assignees.map((e=>{var i;return r("limebb-summary-popover",Object.assign({icon:null===(i=e.icon)||void 0===i?void 0:i.name},e.picture&&{image:{src:e.picture,alt:e.name.text||""}},{heading:e.name.text,value:this.createLinkToAssignee(e)}),r("a",{slot:"trigger",class:"assignee",href:e.name.href,title:e.name.text},this.renderAssigneesAvatar(e),r("span",null,e.name.text)))})))}createLinkToAssignee(e){const i=this.translator.get("webclient.actions.goto-object",{limetype:": <br><b>"+e.name.text+"</b>"});return`<a class="author" href="${e.name.href}" title="${e.name.text}">${i}</a>`}get translator(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(t.Translate)}get commandbus(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(t.CommandBus)}static get style(){return'@charset "UTF-8";*,*:before,*:after{box-sizing:border-box}:host(limebb-kanban-item){position:relative;box-sizing:border-box;display:flex;flex-direction:column;border-radius:0.5rem}:host(limebb-kanban-item):before{content:"";display:block;position:absolute;top:1rem;bottom:1rem;right:0;transform:translateX(50%);width:0.25rem;border-radius:1rem;background-color:var(--limebb-kanban-item-color-code)}.content{padding-top:0.25rem}.header{display:flex;align-items:flex-start;gap:0.5rem;min-height:1.75rem;padding:0.25rem 0.5rem;border-radius:0.5rem 0.5rem 0 0;background-color:rgb(var(--contrast-300))}.header a{position:relative;cursor:pointer;transition:color 0.2s ease;color:var(--mdc-theme-primary);text-decoration:none}.header a:before{transition:opacity 0.2s ease, transform 0.3s ease-out;content:"";position:absolute;inset:auto 0 0 0;width:calc(100% - 0.5rem);margin:auto;height:0.125rem;border-radius:1rem;background-color:currentColor;opacity:0;transform:scale(0.6)}.header a:hover{color:rgb(var(--color-teal-light))}.header a:hover:before{opacity:0.3;transform:scale(1)}.heading{--markdown-hyperlink-color:var(--mdc-theme-primary);--markdown-hyperlink-color--hovered:rgb(var(--color-teal-light))}.unpromoted-actions-menu{margin:-0.5rem -0.5rem -0.25rem auto}.body{--limel-top-edge-fade-height:0.5rem;--limel-bottom-edge-fade-height:0.5rem;display:block;padding-left:0.5rem;padding-right:0.5rem;margin-top:-0.5rem;color:rgb(var(--contrast-1100));max-height:12rem;--limel-overflow-mask-vertical:linear-gradient( to bottom, transparent 0%, black calc(0% + var(--limel-top-edge-fade-height, 1rem)), black calc(100% - var(--limel-bottom-edge-fade-height, 1rem)), transparent 100% );-webkit-mask-image:var(--limel-overflow-mask-vertical);mask-image:var(--limel-overflow-mask-vertical);padding-top:var(--limel-top-edge-fade-height, 1rem);padding-bottom:var(--limel-bottom-edge-fade-height, 1rem)}limel-chip-set{--limel-chip-size:1.5rem;display:block;margin-left:-0.5rem;margin-right:0.5rem;padding-bottom:0.5rem}.footer{position:relative;display:flex;align-items:center;gap:0.5rem;padding:0.25rem 0.25rem 0.125rem;margin:0 0.25rem;border-top:1px dashed rgb(var(--contrast-300))}.header limel-icon,.footer limel-icon{flex-shrink:0;width:1.25rem;height:1.25rem}.header .actions{margin:0.5rem 0.25rem 0}.header .actions:hover{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(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal)}.header .actions:hover:hover,.header .actions:hover:focus,.header .actions:hover:focus-visible{will-change:color, background-color, box-shadow, transform}.header .actions:hover:hover,.header .actions:hover:focus-visible{transform:translate3d(0, -0.04rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.header .actions:hover:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.header .actions:hover:hover,.header .actions:hover:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.footer img{border-radius:50%;object-fit:cover;box-shadow:0 0 0 1px rgb(var(--contrast-800), 0.4);flex-shrink:0;width:1.25rem;height:1.25rem}.assignees{display:flex;align-items:center;gap:0.25rem}.assignees:has(>:nth-child(2)) span{display:none}.assignees:has(>:nth-child(2)) img,.assignees:has(>:nth-child(2)) limel-icon{margin-right:-0.5rem}.assignees:hover img,.assignees:hover limel-icon,.assignees:focus-within img,.assignees:focus-within limel-icon{margin-right:0rem}.assignees:hover .assignee:not(:hover):not(:focus-visible) img,.assignees:hover .assignee:not(:hover):not(:focus-visible) limel-icon,.assignees:focus-within .assignee:not(:hover):not(:focus-visible) img,.assignees:focus-within .assignee:not(:hover):not(:focus-visible) limel-icon{filter:grayscale(1);opacity:0.6}.assignee{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:transparent;display:flex;align-items:center;text-decoration:none;gap:0.25rem;margin-left:0;border-radius:1rem}.assignee:hover,.assignee:focus,.assignee:focus-visible{will-change:color, background-color, box-shadow, transform}.assignee:hover,.assignee:focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}.assignee:hover{box-shadow:var(--button-shadow-hovered)}.assignee:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.assignee:hover,.assignee:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.assignee:focus{outline:none}.assignee:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.assignee limel-icon,.assignee img{transition:margin 0.2s ease, opacity 0.2s ease, filter 0.2s ease}.assignee limel-icon{padding:0.125rem;box-shadow:0 0 0 1px rgb(var(--contrast-800), 0.4);background-color:rgb(var(--contrast-100))}.assignee span{font-size:0.75rem;color:rgb(var(--contrast-900));padding-right:0.5rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}slot[name=body]{display:block;padding:0.5rem}'}},[257,"limebb-kanban-item",{platform:[16],context:[16],item:[16]}]);function m(){"undefined"!=typeof customElements&&["limebb-kanban-item","limebb-navigation-button","limebb-summary-popover"].forEach((e=>{switch(e){case"limebb-kanban-item":customElements.get(s(e))||customElements.define(s(e),c);break;case"limebb-navigation-button":customElements.get(s(e))||n();break;case"limebb-summary-popover":customElements.get(s(e))||l()}}))}export{c as K,m as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as i,createEvent as t,h as s,transformTag as r}from"@stencil/core/internal/client";import{
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as i,createEvent as t,h as s,transformTag as r}from"@stencil/core/internal/client";import{n as l}from"./index.esm.js";import{d as o}from"./lime-query-filter-comparison.js";import{e as m,b as n,d as p}from"./lime-query-filter-expression.js";import{d as u}from"./lime-query-value-input.js";import{d as a}from"./property-selector.js";const b=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.expressionChange=t(this,"expressionChange",7),this.handleAddFirstCondition=()=>{this.expressionChange.emit({key:"",op:l.EQUALS,exp:""})},this.handlePromoteAndAdd=()=>{this.expression&&this.expressionChange.emit({op:l.AND,exp:[this.expression,{key:"",op:l.EQUALS,exp:""}]})},this.handleExpressionChange=e=>{var i;e.stopPropagation(),this.expressionChange.emit(null!==(i=e.detail)&&void 0!==i?i:void 0)}}render(){return this.expression?this.needsPromotion()?this.renderWithPromotionButton():s("limebb-lime-query-filter-expression",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.expression,onExpressionChange:this.handleExpressionChange}):this.renderEmptyState()}needsPromotion(){return!!this.expression&&("key"in this.expression||this.expression.op===l.NOT)}renderEmptyState(){return s("limel-button",{label:"Condition",icon:{name:"plus_math",title:"Add"},onClick:this.handleAddFirstCondition})}renderWithPromotionButton(){return s("div",{class:"expression-with-promotion"},s("limebb-lime-query-filter-expression",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.expression,onExpressionChange:this.handleExpressionChange}),s("limel-button",{label:"Add another condition",icon:"plus_math",onClick:this.handlePromoteAndAdd}))}static get style(){return".expression-with-promotion{display:flex;flex-direction:column;gap:1rem}limel-button{width:100%}.query-options-section{margin-top:1rem}"}},[1,"limebb-lime-query-filter-builder",{platform:[16],context:[16],limetype:[1],activeLimetype:[1,"active-limetype"],expression:[16]}]);function c(){"undefined"!=typeof customElements&&["limebb-lime-query-filter-builder","limebb-lime-query-filter-comparison","limebb-lime-query-filter-expression","limebb-lime-query-filter-group","limebb-lime-query-filter-not","limebb-lime-query-value-input","limebb-property-selector"].forEach((e=>{switch(e){case"limebb-lime-query-filter-builder":customElements.get(r(e))||customElements.define(r(e),b);break;case"limebb-lime-query-filter-comparison":customElements.get(r(e))||o();break;case"limebb-lime-query-filter-expression":customElements.get(r(e))||p();break;case"limebb-lime-query-filter-group":customElements.get(r(e))||n();break;case"limebb-lime-query-filter-not":customElements.get(r(e))||m();break;case"limebb-lime-query-value-input":customElements.get(r(e))||u();break;case"limebb-property-selector":customElements.get(r(e))||a()}}))}export{b as L,c as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as l,Host as r,transformTag as a}from"@stencil/core/internal/client";import{
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as l,Host as r,transformTag as a}from"@stencil/core/internal/client";import{n as s,b as o}from"./index.esm.js";import{d as n}from"./lime-query-value-input.js";import{d as c}from"./property-selector.js";const p=[{value:s.EQUALS,label:"webclient.operator.equals",icon:"-lime-filter-equal"},{value:s.NOT_EQUALS,label:"webclient.operator.not-equals",icon:"-lime-filter-equal-not"},{value:s.GREATER,label:"webclient.operator.greater-than",icon:"-lime-filter-greater",applicableTypes:["integer","decimal","date","time"]},{value:s.GREATER_OR_EQUAL,label:"webclient.operator.greater-than-or-equal-to",icon:"-lime-filter-greater-equal",applicableTypes:["integer","decimal","date","time"]},{value:s.LESS,label:"webclient.operator.less-than",icon:"-lime-filter-less",applicableTypes:["integer","decimal","date","time"]},{value:s.LESS_OR_EQUAL,label:"webclient.operator.less-than-or-equal-to",icon:"-lime-filter-less-equal",applicableTypes:["integer","decimal","date","time"]},{value:s.IN,label:"webclient.operator.in-filter",icon:"-lime-filter-set-included"},{value:s.LIKE,label:"webclient.operator.contains",icon:"-lime-filter-contain",applicableTypes:["string","text"]},{value:s.BEGINS,label:"webclient.operator.begins-with",icon:"-lime-filter-starts-with",applicableTypes:["string","text"]},{value:s.ENDS,label:"webclient.operator.ends-with",icon:"-lime-filter-ends-with",applicableTypes:["string","text"]}],m=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.expressionChange=i(this,"expressionChange",7),this.handlePropertyChange=e=>{e.stopPropagation(),this.expressionChange.emit(Object.assign(Object.assign({},this.expression),{key:e.detail}))},this.handleOperatorChange=e=>{e.stopPropagation();const t=e.detail.value,i=this.expression.op;let l=this.expression.exp;t!==s.IN||Array.isArray(l)?i===s.IN&&t!==s.IN&&Array.isArray(l)&&(l=l.length>0?l[0]:""):l=void 0!==l&&""!==l?[l]:[],this.expressionChange.emit({key:this.expression.key,op:t,exp:l})},this.handleValueChange=e=>{e.stopPropagation(),this.expressionChange.emit(Object.assign(Object.assign({},this.expression),{exp:e.detail}))},this.removeExpression=()=>{this.expressionChange.emit(void 0)}}render(){return l(r,{key:"29ddf92b2e83eafe695faeb9a4ce6b8d29aa973e"},this.renderHeader(),l("div",{key:"258f8aeee98a2435d324a1e5b816f111188cf3cc",class:"expression-container"},this.renderPropertySelector(),this.renderOperator(),this.renderValueInput(),l("limel-icon-button",{key:"c9e4cf456908fb82507e2599af631691e96ab8e4",class:"remove",icon:"trash",label:"Remove condition",onClick:this.removeExpression})))}renderHeader(){if(this.label)return l("limel-header",{subheading:this.label})}renderPropertySelector(){return l("limebb-property-selector",{platform:this.platform,context:this.context,label:"Property",limetype:this.limetype,value:this.expression.key,required:!0,onChange:this.handlePropertyChange})}renderOperator(){const e=!!this.expression.op,t=p.map((e=>{var t,i;return{text:null!==(i=null===(t=this.translator)||void 0===t?void 0:t.get(e.label))&&void 0!==i?i:e.label,value:e.value,icon:e.icon?{name:e.icon}:void 0}})),i=t.find((e=>e.value===this.expression.op));return l("limel-select",{class:"operator",label:"Operator",value:i,options:t,disabled:!e&&!this.expression.key,onChange:this.handleOperatorChange})}renderValueInput(){return this.expression.op?l("limebb-lime-query-value-input",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,propertyPath:this.expression.key,operator:this.expression.op,value:this.expression.exp,onChange:this.handleValueChange}):null}get translator(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(o.Translate)}static get style(){return":host(limebb-lime-query-filter-comparison){display:flex;flex-direction:column;gap:0.5rem}.expression-container{position:relative;display:grid;grid-template-columns:repeat(auto-fit, minmax(10rem, 1fr));grid-gap:0.5rem;padding-right:2.75rem}.remove{position:absolute;right:0;top:0.125rem}"}},[1,"limebb-lime-query-filter-comparison",{platform:[16],context:[16],label:[513],limetype:[1],activeLimetype:[1,"active-limetype"],expression:[16]}]);function b(){"undefined"!=typeof customElements&&["limebb-lime-query-filter-comparison","limebb-lime-query-value-input","limebb-property-selector"].forEach((e=>{switch(e){case"limebb-lime-query-filter-comparison":customElements.get(a(e))||customElements.define(a(e),m);break;case"limebb-lime-query-value-input":customElements.get(a(e))||n();break;case"limebb-property-selector":customElements.get(a(e))||c()}}))}export{m as L,b as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as r,transformTag as s,Host as l}from"@stencil/core/internal/client";import{
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as r,transformTag as s,Host as l}from"@stencil/core/internal/client";import{n as o}from"./index.esm.js";import{d as n}from"./lime-query-filter-comparison.js";import{d as m}from"./lime-query-value-input.js";import{d as a}from"./property-selector.js";function u(){return{key:"",op:o.EQUALS,exp:""}}function c(e,t){return{op:e.op,exp:[...e.exp,t]}}const b=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.expressionChange=i(this,"expressionChange",7),this.handleExpressionChange=e=>{var t;e.stopPropagation();const i=null!==(t=e.detail)&&void 0!==t?t:void 0;this.expressionChange.emit(void 0!==i?{op:o.NOT,exp:i}:void 0)}}render(){return r("div",{key:"16246e10be820ad18713cb097146040d30e242bf",class:"expression"},this.label&&r("limel-header",{key:"539d60a4567727282463dec2a90e06a3630501aa",heading:this.label}),r("limebb-lime-query-filter-expression",{key:"67f892704ea3e5a061acdcb8f3ffe22271971569",platform:this.platform,context:this.context,label:"Not",limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.expression.exp,onExpressionChange:this.handleExpressionChange}))}static get style(){return'@charset "UTF-8";.expression{display:flex;flex-direction:column;margin-bottom:1rem;gap:1rem;padding:1rem;border-left:0.25rem solid rgb(var(--contrast-400));background-color:rgb(var(--contrast-100))}'}},[1,"limebb-lime-query-filter-not",{platform:[16],context:[16],label:[1],limetype:[1],activeLimetype:[1,"active-limetype"],expression:[16]}]);function p(){"undefined"!=typeof customElements&&["limebb-lime-query-filter-not","limebb-lime-query-filter-comparison","limebb-lime-query-filter-expression","limebb-lime-query-filter-group","limebb-lime-query-filter-not"].forEach((e=>{switch(e){case"limebb-lime-query-filter-not":customElements.get(s(e))||customElements.define(s(e),b);break;case"limebb-lime-query-filter-comparison":customElements.get(s(e))||n();break;case"limebb-lime-query-filter-expression":customElements.get(s(e))||y();break;case"limebb-lime-query-filter-group":customElements.get(s(e))||h();break;case"limebb-lime-query-filter-not":customElements.get(s(e))||p()}}))}const d=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.expressionChange=i(this,"expressionChange",7),this.options=[{text:"All",secondaryText:"AND operator",value:"and"},{text:"Any",secondaryText:"OR operator",value:"or"}],this.renderChildExpression=(e,t)=>r("limebb-lime-query-filter-expression",{role:"listitem",platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:e,onExpressionChange:this.handleExpressionChange(t)}),this.handleDeleteGroup=()=>{this.expressionChange.emit()},this.handleToggleOperator=e=>{const t=Array.isArray(e.detail)?e.detail[0]:e.detail;if(this.value=t,("and"===t.value?o.AND:o.OR)!==this.expression.op){const e={op:(i=this.expression).op===o.AND?o.OR:o.AND,exp:[...i.exp]};this.expressionChange.emit(e)}var i},this.handleAddChildExpression=()=>{const e=u(),t=c(this.expression,e);this.expressionChange.emit(t)},this.handleAddChildGroup=()=>{const e={op:this.expression.op===o.AND?o.OR:o.AND,exp:[u()]},t=c(this.expression,e);this.expressionChange.emit(t)},this.handleExpressionChange=e=>t=>{t.stopPropagation();const i=function(e,t,i){const r=[...e.exp];return i?(r[t]=i,{type:"updated",expression:{op:e.op,exp:r}}):(r.splice(t,1),0===r.length?{type:"removed",expression:void 0}:1===r.length?{type:"unwrapped",expression:r[0]}:{type:"updated",expression:{op:e.op,exp:r}})}(this.expression,e,t.detail);this.expressionChange.emit(i.expression)}}componentWillLoad(){this.value=this.options.find((e=>e.value===(this.expression.op===o.AND?"and":"or")))||this.options[0]}render(){return r(l,{key:"4b1647c741b78253b4ce4ed1bd347800da394563",style:{"--limebb-lime-query-filter-group-operator":`"${this.expression.op===o.AND?"AND":"OR"}"`}},r("div",{key:"47fd3000275e17ef70d86af5e6abcb492806ffba",class:"expression"},this.renderHeader(),r("ul",{key:"224249a4b305eb2b20c1aedad98d2c3191d47e83"},this.expression.exp.map(this.renderChildExpression),this.renderAddButton()),this.renderAddGroupButton()))}renderHeader(){const e=this.getSubheading();return e?r("limel-header",{subheading:e},this.renderOperators(),this.renderDeleteGroupButton()):null}renderOperators(){return r("limel-select",{class:"operator-select",slot:"actions",value:this.value,options:this.options,onChange:this.handleToggleOperator})}renderDeleteGroupButton(){return r("limel-icon-button",{class:"delete-group",slot:"actions",icon:"trash",label:"Delete This Group",onClick:this.handleDeleteGroup})}getSubheading(){return this.expression.exp.length<=1?"":this.expression.op===o.AND?"All of these conditions are met":"Any of these conditions are met"}renderAddButton(){return r("limel-button",{role:"listitem",label:"Condition",icon:{name:"plus_math",title:"Add"},onClick:this.handleAddChildExpression})}renderAddGroupButton(){return r("limel-button",{class:"add-group",label:"Group",icon:{name:"plus_math",title:"Add"},onClick:this.handleAddChildGroup})}static get style(){return'@charset "UTF-8";*,*::before,*::after{box-sizing:border-box}limebb-lime-query-filter-expression{position:relative;isolation:isolate}limebb-lime-query-filter-expression:not(:first-of-type):after{content:"";position:absolute;top:-0.5rem;left:0.75rem;display:block;border-radius:1rem;height:2rem;width:0.125rem;background-color:var(--limebb-lime-query-builder-group-color)}limebb-lime-query-filter-expression:not(:first-of-type):before{position:relative;z-index:1;display:flex;justify-content:center;align-items:center;height:1rem;content:var(--limebb-lime-query-filter-group-operator);display:inline-block;margin:0 auto 0.5rem auto;transform:translateY(-50%);font-size:0.625rem;padding:0 0.5rem;color:rgb(var(--color-blue-dark));background-color:var(--limebb-lime-query-builder-group-color);border-radius:2rem}.expression{display:flex;flex-direction:column;margin-bottom:1rem;gap:0;background-color:rgb(var(--contrast-100));border-radius:0.75rem;border:1px solid var(--limebb-lime-query-builder-group-color)}.expression ul{list-style:none;margin:0;padding:0.5rem;display:flex;flex-direction:column;align-items:center;gap:1rem}.expression ul [role=listitem]{list-style:none;width:100%}limel-button.add-group{width:fit-content;margin:0.5rem}limel-icon-button.delete-group{margin-left:0.5rem}limel-select.operator-select{min-width:8rem}'}},[1,"limebb-lime-query-filter-group",{platform:[16],context:[16],limetype:[1],activeLimetype:[1,"active-limetype"],expression:[16],value:[32]}]);function h(){"undefined"!=typeof customElements&&["limebb-lime-query-filter-group","limebb-lime-query-filter-comparison","limebb-lime-query-filter-expression","limebb-lime-query-filter-group","limebb-lime-query-filter-not"].forEach((e=>{switch(e){case"limebb-lime-query-filter-group":customElements.get(s(e))||customElements.define(s(e),d);break;case"limebb-lime-query-filter-comparison":customElements.get(s(e))||n();break;case"limebb-lime-query-filter-expression":customElements.get(s(e))||y();break;case"limebb-lime-query-filter-group":customElements.get(s(e))||h();break;case"limebb-lime-query-filter-not":customElements.get(s(e))||p()}}))}const f=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.expressionChange=i(this,"expressionChange",7),this.handleExpressionChange=e=>{e.stopPropagation(),this.expressionChange.emit(e.detail)}}render(){if(!this.expression)return;const e={platform:this.platform,context:this.context,label:this.label,limetype:this.limetype,activeLimetype:this.activeLimetype};return"key"in this.expression?r("limebb-lime-query-filter-comparison",Object.assign({},e,{expression:this.expression,onExpressionChange:this.handleExpressionChange})):this.expression.op===o.AND||this.expression.op===o.OR?r("limebb-lime-query-filter-group",Object.assign({},e,{expression:this.expression,onExpressionChange:this.handleExpressionChange})):this.expression.op===o.NOT?r("limebb-lime-query-filter-not",Object.assign({},e,{expression:this.expression,onExpressionChange:this.handleExpressionChange})):void 0}static get style(){return'@charset "UTF-8";.expression{display:flex;flex-direction:column;margin-bottom:1rem;gap:1rem}'}},[1,"limebb-lime-query-filter-expression",{platform:[16],context:[16],label:[1],limetype:[1],activeLimetype:[1,"active-limetype"],expression:[16]}]);function y(){"undefined"!=typeof customElements&&["limebb-lime-query-filter-expression","limebb-lime-query-filter-comparison","limebb-lime-query-filter-expression","limebb-lime-query-filter-group","limebb-lime-query-filter-not","limebb-lime-query-value-input","limebb-property-selector"].forEach((e=>{switch(e){case"limebb-lime-query-filter-expression":customElements.get(s(e))||customElements.define(s(e),f);break;case"limebb-lime-query-filter-comparison":customElements.get(s(e))||n();break;case"limebb-lime-query-filter-expression":customElements.get(s(e))||y();break;case"limebb-lime-query-filter-group":customElements.get(s(e))||h();break;case"limebb-lime-query-filter-not":customElements.get(s(e))||p();break;case"limebb-lime-query-value-input":customElements.get(s(e))||m();break;case"limebb-property-selector":customElements.get(s(e))||a()}}))}export{f as L,d as a,h as b,b as c,y as d,p as e}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{n as r}from"./index.esm.js";import{g as t,a as o,v as e}from"./property-selector.js";const n=new Set(["$yesterday","$now","$today","$tomorrow","$this_week","$this_month","$this_quarter","$this_year"]),i=/^\$(previous|next)_(day|week|month|quarter|year)\(\d+\)$/,s=/^\$me(\.\w+)*$/;function a(r,o,e){if(function(r){return"string"==typeof r&&(n.has(r)||i.test(r)||s.test(r))}(r))return{valid:!0};if("string"!=typeof r||!r.startsWith("%activeObject%"))return{valid:!0};if(!o)return{valid:!0};const a=r.replace(/^%activeObject%\.?/,"");if(!a)return{valid:!0};try{return t(e,o,a)?{valid:!0}:{valid:!1,error:`Property path '${a}' does not exist on limetype '${o}'`}}catch(r){return{valid:!1,error:`Invalid placeholder path: ${r.message}`}}}function u(r,t,o=!0){const e=Object.keys(r),n=[];if(o){const r=e.filter((r=>r.startsWith("#")&&"#description"!==r));r.length>0&&n.push(`Property '${t}' contains # properties not supported in visual mode: ${r.join(", ")}`)}return{keys:e.filter((r=>"_alias"!==r&&!r.startsWith("#"))),visualModeLimitations:n}}function l(r,t,o,e,n,i=!0){if(""===r){if(i&&null!==t)throw new Error("Empty property name must have null value");return[]}const s=o[r];if(!s)throw new Error(`Property '${r}' does not exist on limetype '${n}'`);return s.relation?function(r,t,o,e,n=!0){if(null===t)return[];if("object"!=typeof t)throw new TypeError(`Relation property '${r}' must be null or an object`);const i=t,{keys:s,visualModeLimitations:a}=u(i,r,n);if(0===s.length)return a;const l=e.relation.getLimetype();if(!l)throw new Error(`Could not determine related limetype for property '${r}'`);const f={};for(const r of s)f[r]=i[r];const p=c(f,o,l.name,n);return[...a,...p]}(r,t,e,s,i):function(r,t,o=!0){if(null===t)return[];if("object"==typeof t){const{keys:e,visualModeLimitations:n}=u(t,r,o);if(0===e.length)return n;throw new Error(`Non-relation property '${r}' cannot have nested properties other than _alias or # properties (got: ${e.join(", ")})`)}throw new Error(`Non-relation property '${r}' must be null or an object (got ${typeof t})`)}(r,t,i)}function c(r,t,e,n=!0){const i=t[e];if(!i)throw new Error(`Unknown limetype: ${e}`);const s=o(i),a=[];for(const[o,i]of Object.entries(r)){if(o.startsWith("#"))continue;const r=l(o,i,s,t,e,n);a.push(...r)}return a}function f(t,o,n,i,s=!0){t&&("key"in t?function(t,o,n,i){if(!Object.values(r).includes(t.op))throw new Error(`Unsupported filter operator: ${t.op}`);const s=function(r,t,o,n){if(!r)return{valid:!1,error:"Filter key cannot be empty"};if(r.startsWith("%activeObject%")){const o=a(r,n,t);if(!o.valid)return o;const i=r.replace(/^%activeObject%\.?/,"");if(i&&n){const{error:r}=e(t,n,i);if(r)return{valid:!1,error:r}}return o}const{error:i}=e(t,o,r);return i?{valid:!1,error:i}:{valid:!0}}(t.key,n,i,o);if(!s.valid)throw new Error(`Invalid filter key '${t.key}': ${s.error}`);const u=a(t.exp,o,n);if(!u.valid)throw new Error(`Invalid placeholder in filter '${t.key}': ${u.error}`)}(t,o,n,i):"exp"in t&&function(t,o,e,n,i){if(t.op!==r.AND&&t.op!==r.OR&&t.op!==r.NOT)throw new Error(`Unsupported group operator: ${t.op}`);if(t.op===r.NOT)f(t.exp,o,e,n,i);else if(t.op===r.AND||t.op===r.OR){const r=t.exp;for(const t of r)f(t,o,e,n,i)}}(t,o,n,i,s))}function p(r,o,e,n){const i=[],s=function(r,t){return"object"!=typeof r||null===r?`orderBy[${t}] must be an object`:null}(r,o);if(s)return[s];const a=Object.keys(r),u=function(r,t){return 0===r.length?`orderBy[${t}] must have a property path`:r.length>1?`orderBy[${t}] must have exactly one property, got ${r.length}`:null}(a,o);if(u)return[u];const l=a[0],c=function(r,t){return"ASC"!==r&&"DESC"!==r?`orderBy[${t}]: direction must be 'ASC' or 'DESC', got '${r}'`:null}(r[l],o);c&&i.push(c);const f=function(r,o,e,n){if(!r||""===r)return null;return t(o,e,r)?null:`orderBy[${n}]: property path '${r}' does not exist on limetype '${e}'`}(l,e,n,o);return f&&i.push(f),i}function d(r,t,o,e){const n=[],i=[];try{const n=function(r,t,o,e=!0){const n=[];if(e&&r.aggregates&&n.push("responseFormat.aggregates is not yet supported in visual mode"),r.object){const i=c(r.object,t,o,e);n.push(...i)}return n}(r,t,o,e);i.push(...n)}catch(r){n.push(`Invalid responseFormat: ${r.message}`)}return{errors:n,limitations:i}}function y(r,t,o,e=!0){if(!r)return{valid:!0,visualModeSupported:!0,validationErrors:[],visualModeLimitations:[]};const n=[],i=[];if(r.limetype&&!t[r.limetype]&&n.push(`Unknown limetype: ${r.limetype}`),void 0===r.offset||r.orderBy||n.push("offset requires orderBy to be specified"),r.orderBy){const o=function(r,t,o){const e=[];if(!Array.isArray(r))return e.push("orderBy must be an array"),e;if(!o||!t[o])return e;for(const[n,i]of r.entries()){const r=p(i,n,t,o);e.push(...r)}return e}(r.orderBy,t,r.limetype);n.push(...o)}if(e&&void 0!==r.offset&&i.push("offset is not yet supported in visual mode"),r.filter){const{errors:s,limitations:a}=function(r,t,o,e,n){const i=[],s=[];try{f(r,t,o,e,n)}catch(r){const t=r.message;t.includes("Invalid filter key")||t.includes("Cannot filter on many-relation")?(i.push(`Invalid filter: ${t}`),s.push(t)):i.push(`Invalid filter: ${t}`)}return{errors:i,limitations:s}}(r.filter,o,t,r.limetype,e);n.push(...s),i.push(...a)}if(r.responseFormat){const{errors:o,limitations:s}=d(r.responseFormat,t,r.limetype,e);n.push(...o),i.push(...s)}return{valid:0===n.length,visualModeSupported:0===i.length,validationErrors:n,visualModeLimitations:i}}function v(r,t,o,e=!0){const n=[],i=[];if(!t[o])return n.push(`Unknown limetype: ${o}`),{valid:!1,visualModeSupported:!1,validationErrors:n,visualModeLimitations:i};const{errors:s,limitations:a}=d(r,t,o,e);return n.push(...s),i.push(...a),{valid:0===n.length,visualModeSupported:0===i.length,validationErrors:n,visualModeLimitations:i}}export{y as i,v}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as r,Host as l,transformTag as s}from"@stencil/core/internal/client";import{
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as r,Host as l,transformTag as s}from"@stencil/core/internal/client";import{L as n,n as a}from"./index.esm.js";import{g as o,d as h}from"./property-selector.js";const c={timestamp:"time",createdtime:"time",updatedtime:"time",id:"integer",createduser:"integer",updateduser:"integer",descriptive:"string"},u={date:"date",time:"datetime",timeofday:"time",month:"month",quarter:"quarter",year:"year"};const p=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.change=i(this,"change",7),this.label="Value",this.inputMode="value",this.handleTextChange=e=>{e.stopPropagation();const t=e.detail,i=Number(t);Number.isNaN(i)||""===t?this.change.emit(t):this.change.emit(i)},this.handleSelectChange=e=>{e.stopPropagation();const t=e.detail;Array.isArray(t)?this.change.emit(t.map((e=>e.value))):this.change.emit(null==t?void 0:t.value)},this.handleBooleanChange=e=>{e.stopPropagation();const t=e.detail;Array.isArray(t)||this.change.emit("true"===(null==t?void 0:t.value))},this.handleDateChange=e=>{e.stopPropagation();const t=e.detail;this.change.emit(t?t.toISOString():null)},this.handleMultiValueChange=e=>{e.stopPropagation();const t=e.detail.split(",").map((e=>e.trim())).filter((e=>e.length>0));this.change.emit(t)},this.handleModeToggle=()=>{"value"===this.inputMode?(this.inputMode="placeholder",this.change.emit("%activeObject%")):(this.inputMode="value",this.change.emit(""))},this.handlePlaceholderPropertyChange=e=>{e.stopPropagation();const t=this.buildPlaceholderValue(e.detail);this.change.emit(t)}}componentWillLoad(){this.isPlaceholder(this.value)&&(this.inputMode="placeholder")}componentWillUpdate(){this.isPlaceholder(this.value)&&"placeholder"!==this.inputMode?this.inputMode="placeholder":this.isPlaceholder(this.value)||"placeholder"!==this.inputMode||(this.inputMode="value")}isPlaceholder(e){return"string"==typeof e&&e.startsWith("%activeObject%")}parsePlaceholderPath(e){return this.isPlaceholder(e)?e.replace(/^%activeObject%\.?/,""):""}buildPlaceholderValue(e){return e?`%activeObject%.${e}`:"%activeObject%"}render(){return this.operator?r(l,null,this.renderModeToggle(),this.renderInputByMode()):null}renderInputByMode(){return"placeholder"===this.inputMode?this.renderPlaceholderInput():this.renderValueInputByType()}renderModeToggle(){if(!this.activeLimetype)return null;const e="placeholder"===this.inputMode;return r("limel-icon-button",{class:"mode-toggle",icon:e?"text":"link",label:e?"Use Value":"Use Placeholder",onClick:this.handleModeToggle})}renderPlaceholderInput(){const e=this.parsePlaceholderPath(this.value);return r("div",{class:"placeholder-input"},r("limebb-property-selector",{platform:this.platform,context:this.context,limetype:this.activeLimetype,label:"Active Object Property",value:e,required:!1,helperText:"Select property from the active object",onChange:this.handlePlaceholderPropertyChange}),this.renderPlaceholderPreview())}renderPlaceholderPreview(){if(this.isPlaceholder(this.value))return r("div",{class:"placeholder-preview"},r("limel-icon",{name:"info",size:"small"}),r("span",null,"Placeholder: ",this.value))}renderValueInputByType(){if(this.operator===a.IN)return this.renderMultiValueInput();const e=this.getProperty();if(!e)return this.renderTextInput();const t=function(e){return"system"===e.type?function(e){const t=e.replace(/^_/,"");return c[t]||"string"}(e.name):e.type}(e);switch(t){case"integer":case"decimal":return this.renderNumberInput(t);case"yesno":return this.renderBooleanInput();case"option":return this.renderOptionInput(e);case"date":case"time":case"timeofday":case"year":case"month":case"quarter":return this.renderDateTimeInput(t);default:return this.renderTextInput()}}renderTextInput(){var e;return r("limel-input-field",{label:this.label,value:(null===(e=this.value)||void 0===e?void 0:e.toString())||"",placeholder:"Enter value",onChange:this.handleTextChange})}renderNumberInput(e){var t;const i="integer"===e?1:.01;return r("limel-input-field",{label:this.label,type:"number",value:(null===(t=this.value)||void 0===t?void 0:t.toString())||"",step:i,onChange:this.handleTextChange})}renderBooleanInput(){const e=[{text:"True",value:"true"},{text:"False",value:"false"}],t=!0===this.value||"true"===this.value?"true":"false",i=e.find((e=>e.value===t));return r("limel-select",{label:this.label,options:e,value:i,onChange:this.handleBooleanChange})}renderOptionInput(e){if(!e.options||0===e.options.length)return this.renderTextInput();const t=e.options.map((e=>({text:e.text||e.key,value:e.key}))),i=t.find((e=>e.value===this.value));return r("limel-select",{label:this.label,options:t,value:i,onChange:this.handleSelectChange})}renderDateTimeInput(e){const t="string"==typeof this.value?new Date(this.value):this.value;return r("limel-date-picker",{label:this.label,value:t,type:u[e]||"date",onChange:this.handleDateChange})}renderMultiValueInput(){const e=Array.isArray(this.value)?this.value.join(", "):this.value||"";return r("limel-input-field",{label:this.label+" (comma-separated)",value:e,placeholder:"e.g., won, lost, tender",onChange:this.handleMultiValueChange})}getProperty(){if(this.limetypes&&this.limetype&&this.propertyPath)return o(this.limetypes,this.limetype,this.propertyPath)}static get style(){return":host{display:flex;gap:0.5rem}:host>*{flex-grow:1}*{box-sizing:border-box}.value-input-container{display:flex;flex-direction:row;align-items:flex-start;gap:0.5rem;width:100%}.mode-toggle{flex-shrink:0;flex-grow:0}.placeholder-input{flex-grow:1;display:flex;flex-direction:column;gap:0.5rem}.placeholder-preview{display:flex;align-items:center;gap:0.5rem;padding:0.5rem;background-color:rgba(var(--color-blue-light), 0.1);border-radius:var(--border-radius-small);font-size:0.875rem;color:rgb(var(--color-blue-default));border-left:3px solid rgb(var(--color-blue-default))}.placeholder-preview limel-icon{flex-shrink:0;color:rgb(var(--color-blue-default))}.placeholder-preview span{font-family:var(--font-monospace);word-break:break-all}"}},[1,"limebb-lime-query-value-input",{platform:[16],context:[16],limetype:[1],activeLimetype:[1,"active-limetype"],propertyPath:[1,"property-path"],operator:[1],value:[8],label:[1],limetypes:[32],inputMode:[32]}]);function d(){"undefined"!=typeof customElements&&["limebb-lime-query-value-input","limebb-property-selector"].forEach((e=>{switch(e){case"limebb-lime-query-value-input":customElements.get(s(e))||customElements.define(s(e),p);break;case"limebb-property-selector":customElements.get(s(e))||h()}}))}!function(e,t,i,r){var l,s=arguments.length,n=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(l=e[a])&&(n=(s<3?l(n):s>3?l(t,i,n):l(t,i))||n);s>3&&n&&Object.defineProperty(t,i,n)}([n()],p.prototype,"limetypes",void 0);export{p as L,d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as e,createEvent as i,h as s,transformTag as r}from"@stencil/core/internal/client";import{
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as e,createEvent as i,h as s,transformTag as r}from"@stencil/core/internal/client";import{b as o}from"./index.esm.js";import{a as n}from"./keycodes.js";import{n as a}from"./negate.js";const l=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.change=i(this,"change",7),this.layout="grid",this.handleChangeFilter=t=>{t.stopPropagation(),this.filter=t.detail},this.isIncluded=(t,e)=>this.isSeparator(t)?!(0===e&&!t.text):!this.filter||t.text.toLocaleLowerCase().includes(this.filter.toLocaleLowerCase()),this.isEmptyGroup=(t,e,i)=>{if(!this.isSeparator(t))return!1;const s=i[e+1];return!s||this.isSeparator(s)},this.handleChange=t=>{t.preventDefault(),this.handleItemChange(t.detail)},this.handleKeyDown=t=>{var e;if(t.key!==n)return;const i=null===(e=this.host.shadowRoot)||void 0===e?void 0:e.querySelector("limel-list"),s=this.getItems().filter(a(this.isSeparator));i&&s.length>0&&(i.focus(),this.handleItemChange(s[0]))}}render(){return[s("limel-input-field",{key:"314fbd746ab8a22f16ac001e02056e1e5325cdb6",tabIndex:0,value:this.filter,type:"search","leading-icon":"search",placeholder:this.translator.get("webclient.global-search-route"),onChange:this.handleChangeFilter,onKeyDown:this.handleKeyDown}),s("limel-list",{key:"8be5b8bb377375d362ff441349d9131d0eec24f9",items:this.getItems(),type:"selectable",class:{"has-interactive-items":!0,"has-grid-layout":"grid"===this.layout},onChange:this.handleChange})]}isSeparator(t){return!!t&&"object"==typeof t&&"separator"in t}get navigator(){return this.platform.get(o.Navigator)}get translator(){var t;return null===(t=this.platform)||void 0===t?void 0:t.get(o.Translate)}handleItemChange(t){this.change.emit(t),this.filter=void 0,this.navigator.navigate(t.path)}getItems(){return this.items.filter(this.isIncluded).filter(a(this.isEmptyGroup))}static get delegatesFocus(){return!0}get host(){return this}static get style(){return":host(limebb-browser){isolation:isolate;display:flex;flex-direction:column;background-color:rgba(var(--contrast-100))}limel-input-field{position:sticky;top:0;z-index:1;padding:0.5rem 0.75rem;background-color:rgba(var(--contrast-100), 0.75);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem)}"}},[17,"limebb-browser",{platform:[16],context:[16],items:[16],layout:[1],filter:[32]}]),h=l,c=function(){"undefined"!=typeof customElements&&["limebb-browser"].forEach((t=>{"limebb-browser"===t&&(customElements.get(r(t))||customElements.define(r(t),l))}))};export{h as LimebbBrowser,c as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as e,h as i,Host as r,transformTag as n}from"@stencil/core/internal/client";import{n as o}from"./index.esm.js";import{d as s}from"./chat-icon-list.js";import{d as a}from"./chat-item.js";import{d as l}from"./typing-indicator.js";function c(t){return"type"in t&&"iconList"===t.type}function d(t){if("chat"===t.type||"iconList"===t.type)return t.item.timestamp}function h(t){for(const e of t.items)c(e)?t.processedItems.push({type:"iconList",item:e}):t.processedItems.push({type:"chat",item:e});return t}function m(t){if(!t.lastVisitedTimestamp)return t;const e=t.processedItems,i=t.lastVisitedTimestamp;for(let r=e.length-1;r>=0;r--){const n=e[r];if("group"!==n.type)continue;const o=p(n.items,i);if(-1!==o)return b(t,e,r,n,o)}return t}function p(t,e){for(let i=t.length-1;i>=0;i--){const r=d(t[i]);if(void 0!==r&&new Date(r)<=e)return i}return-1}function b(t,e,i,r,n){const o=n===r.items.length-1;if(o&&i===e.length-1)return t;if(o)return Object.assign(Object.assign({},t),{processedItems:[...e.slice(0,i+1),{type:"newItemIndicator"},...e.slice(i+1)]});const s=[...r.items.slice(0,n+1),{type:"newItemIndicator"},...r.items.slice(n+1)];return Object.assign(Object.assign({},t),{processedItems:[...e.slice(0,i),Object.assign(Object.assign({},r),{items:s}),...e.slice(i+1)]})}function g(t){const e=[];let i=null,r=null;for(const n of t.processedItems){if("chat"!==n.type&&"iconList"!==n.type)continue;const o=t.dateTimeFormatter.format(new Date(n.item.timestamp),"date");o===r?null==i||i.items.push(n):(i&&e.push(i),i={type:"group",groupType:"dateGroup",heading:o,items:[n]},r=o)}return i&&e.push(i),Object.assign(Object.assign({},t),{processedItems:e})}class u{constructor(t,e,i){this.scrollContainer=t,this.getOrder=e,this.isSticky=!0,this.paintedOrder=i}beforeRender(){this.scrollContainer.isConnected&&(this.isSticky=this.distanceFromNewestEdge(this.paintedOrder)<50)}afterRender(){this.scrollContainer.isConnected&&(this.paintedOrder=this.getOrder(),this.isSticky&&this.scrollToNewest())}repinIfSticky(){this.scrollContainer.isConnected&&this.isSticky&&this.scrollToNewest()}scrollToNewest(){const t="oldest-on-top"===this.getOrder()?this.scrollContainer.scrollHeight:0;this.scrollContainer.scrollTop!==t&&(this.scrollContainer.scrollTop=t)}distanceFromNewestEdge(t){return"oldest-on-top"===t?this.scrollContainer.scrollHeight-this.scrollContainer.scrollTop-this.scrollContainer.clientHeight:this.scrollContainer.scrollTop}}const f="grid-template-rows",y=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.items=[],this.order="oldest-on-top",this.processedItems=[],this.handleHeightTransitionEnd=function(t){return e=>{e.propertyName===f&&t()}}((()=>{var t;return null===(t=this.scrollAnchor)||void 0===t?void 0:t.repinIfSticky()}))}handleItemsChange(){let t=null;this.lastVisitedTimestamp&&(t=function(t){return new Date("string"==typeof t?Date.parse(t):t)}(this.lastVisitedTimestamp));const e=function(t,e,i){return function(t){return[h,g,m].reduce(((t,e)=>e(t)),t)}({items:t,processedItems:[],lastVisitedTimestamp:i,dateTimeFormatter:e}).processedItems}(this.items,this.dateTimeFormatter,t);this.processedItems="newest-on-top"===this.order?function(t){return t.toReversed().map((t=>"group"!==t.type?t:Object.assign(Object.assign({},t),{items:t.items.toReversed()})))}(e):e}componentWillLoad(){this.handleItemsChange(),this.scrollAnchor=new u(this.host,(()=>this.order),this.order)}componentDidLoad(){var t;!function(t){if(!t)return;const e=globalThis.getComputedStyle(t).transitionProperty;if(!e)return;const i=new Set(e.split(",").map((t=>t.trim())));i.has("all")||i.has(f)||console.warn(`[limebb-chat-list] Typing indicator is transitioning \`${e}\` instead of \`${f}\`. The auto-scroll on indicator appearance will not fire. Update the CSS or the handler so they match.`)}(null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector(".typing-indicator-height-animation"))}componentWillRender(){0!==this.items.length&&this.scrollAnchor.beforeRender()}componentDidRender(){0!==this.items.length&&this.scrollAnchor.afterRender()}render(){return i(r,{key:"1684ed7ba9da966e3c8b8c1c9615738b825b28fa",class:{"is-empty":0===this.items.length&&!this.isTypingIndicatorVisible},"aria-busy":this.isBusy(),role:"log"},this.renderSpinner(),"newest-on-top"===this.order&&this.renderTypingIndicatorBlock(),this.renderChatItems(),"oldest-on-top"===this.order&&this.renderTypingIndicatorBlock())}renderSpinner(){if(this.loading)return i("limel-spinner",null)}renderTypingIndicatorBlock(){return i("div",{class:"typing-indicator-height-animation",onTransitionEnd:this.handleHeightTransitionEnd},i("div",null,this.renderTypingIndicator()))}renderTypingIndicator(){if(this.isTypingIndicatorVisible)return i("limebb-typing-indicator",null)}renderChatItems(){return this.processedItems.map((t=>{switch(t.type){case"group":return this.renderGroup(t);case"newItemIndicator":return this.renderIndicator();case"chat":case"iconList":return null;default:return w(t)}}))}renderGroup(t){const e=t.items.map((t=>{switch(t.type){case"chat":return this.renderChatItem(t.item);case"iconList":return this.renderIconList(t.item);case"newItemIndicator":return this.renderIndicator();case"group":return null;default:return w(t)}})),r="date-group-"+t.heading,n=("heading-"+r).replaceAll(/[^a-zA-Z0-9_-]/g,"_"),o=i("a",{id:n,class:"date-heading",role:"heading","aria-level":2},t.heading);return i("section",{class:"date-group",key:r,"aria-labelledby":n},o,e)}renderChatItem(t){return i("limebb-chat-item",{platform:this.platform,context:this.context,item:t,helperText:t.helperText,hasError:t.hasError,key:t.id})}renderIconList(t){return i("limebb-chat-icon-list",{item:t,key:t.id})}renderIndicator(){return i("div",{class:"new-items-indicator",role:"separator"},i("hr",null),i("h3",null,this.translator.get("webclient.new")))}isBusy(){return this.loading||this.isTypingIndicatorVisible?"true":"false"}get dateTimeFormatter(){return this.platform.get(o.DateTimeFormatter)}get translator(){return this.platform.get(o.Translate)}get host(){return this}static get watchers(){return{items:[{handleItemsChange:0}],order:[{handleItemsChange:0}]}}static get style(){return'@charset "UTF-8";:host(limebb-chat-list){--limel-top-edge-fade-height:0.75rem;isolation:isolate;--limel-overflow-mask-vertical:linear-gradient( to bottom, transparent 0%, black calc(0% + var(--limel-top-edge-fade-height, 1rem)), black calc(100% - var(--limel-bottom-edge-fade-height, 1rem)), transparent 100% );-webkit-mask-image:var(--limel-overflow-mask-vertical);mask-image:var(--limel-overflow-mask-vertical);padding-top:var(--limel-top-edge-fade-height, 1rem);padding-bottom:var(--limel-bottom-edge-fade-height, 1rem);box-sizing:border-box;display:flex;flex-direction:column;gap:0.5rem;height:100%;width:100%;min-width:0;min-height:0;padding:var(--limel-top-edge-fade-height) 0.5rem;overflow:hidden auto}:host(limebb-chat-list.is-empty){padding:0}*{box-sizing:border-box}limel-spinner{align-self:center;justify-self:center;margin:auto}.date-group{isolation:isolate;display:flex;flex-direction:inherit;gap:0.5rem}.date-heading{position:sticky;z-index:1;top:0.25rem;display:flex;border-radius:9rem;padding:0.25rem 0.5rem;margin:0 auto;width:fit-content;font-size:0.75rem;line-height:1;color:rgb(var(--contrast-900));backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem);transition:color 0.2s ease, border-color 0.4s ease}.date-heading:hover{color:rgb(var(--contrast-1000));border-color:rgb(var(--contrast-500))}.date-heading:hover:before{opacity:1}.date-heading:before{transition:opacity 0.2s ease;content:"";position:absolute;z-index:-1;inset:0;opacity:0.6;border-radius:inherit;background-color:rgb(var(--contrast-100))}.new-items-indicator{position:relative;isolation:isolate;display:flex;align-items:center;justify-content:flex-end;margin:0.25rem 0}.new-items-indicator hr{border:none;position:absolute;width:100%;height:1px;background-color:rgb(var(--color-red-lighter))}.new-items-indicator h3{z-index:1;padding:0 0.5rem;border-radius:1rem;margin:0 1rem;font-size:small;line-height:0.75rem;text-transform:lowercase;color:rgb(var(--color-red-default));background-color:rgb(var(--contrast-100))}.typing-indicator-height-animation{--limebb-chat-typing-opacity-transition-speed:0.1s;--limebb-chat-typing-opacity-transition-delay:0s;--limebb-chat-typing-grid-template-rows-transition-speed:0.3s;position:sticky;z-index:1;transition:grid-template-rows var(--limebb-chat-typing-grid-template-rows-transition-speed) ease;display:grid;grid-template-rows:0}.typing-indicator-height-animation div{transition:opacity var(--limebb-chat-typing-opacity-transition-speed) ease var(--limebb-chat-typing-opacity-transition-delay);overflow:hidden;opacity:0}:host(limebb-chat-list[order=oldest-on-top]) .typing-indicator-height-animation{bottom:0}:host(limebb-chat-list[order=newest-on-top]) .typing-indicator-height-animation{top:0}:host(limebb-chat-list[is-typing-indicator-visible]) .typing-indicator-height-animation{--limebb-chat-typing-opacity-transition-speed:0.4s;--limebb-chat-typing-opacity-transition-delay:0.3s;--limebb-chat-typing-grid-template-rows-transition-speed:0.46s;grid-template-rows:1.5rem}:host(limebb-chat-list[is-typing-indicator-visible]) .typing-indicator-height-animation div{opacity:1}.date-group limebb-chat-item{--limebb-promoted-action-bar-grid-template-rows:0fr}:host(limebb-chat-list[order=oldest-on-top]) .date-group:last-of-type limebb-chat-item:last-of-type{--limebb-promoted-action-bar-grid-template-rows:1fr}:host(limebb-chat-list[order=newest-on-top]) .date-group:first-of-type limebb-chat-item:first-of-type{--limebb-promoted-action-bar-grid-template-rows:1fr}'}},[1,"limebb-chat-list",{platform:[16],context:[16],items:[16],loading:[516],isTypingIndicatorVisible:[516,"is-typing-indicator-visible"],lastVisitedTimestamp:[513,"last-visited-timestamp"],order:[513]},void 0,{items:[{handleItemsChange:0}],order:[{handleItemsChange:0}]}]);function w(t){throw Error("Unexpected value in exhaustive switch: "+JSON.stringify(t))}const v=y,k=function(){"undefined"!=typeof customElements&&["limebb-chat-list","limebb-chat-icon-list","limebb-chat-item","limebb-typing-indicator"].forEach((t=>{switch(t){case"limebb-chat-list":customElements.get(n(t))||customElements.define(n(t),y);break;case"limebb-chat-icon-list":customElements.get(n(t))||s();break;case"limebb-chat-item":customElements.get(n(t))||a();break;case"limebb-typing-indicator":customElements.get(n(t))||l()}}))};export{v as LimebbChatList,k as defineCustomElement}
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as e,h as i,Host as r,transformTag as n}from"@stencil/core/internal/client";import{b as o}from"./index.esm.js";import{d as s}from"./chat-icon-list.js";import{d as a}from"./chat-item.js";import{d as l}from"./typing-indicator.js";function c(t){return"type"in t&&"iconList"===t.type}function d(t){if("chat"===t.type||"iconList"===t.type)return t.item.timestamp}function h(t){for(const e of t.items)c(e)?t.processedItems.push({type:"iconList",item:e}):t.processedItems.push({type:"chat",item:e});return t}function m(t){if(!t.lastVisitedTimestamp)return t;const e=t.processedItems,i=t.lastVisitedTimestamp;for(let r=e.length-1;r>=0;r--){const n=e[r];if("group"!==n.type)continue;const o=p(n.items,i);if(-1!==o)return b(t,e,r,n,o)}return t}function p(t,e){for(let i=t.length-1;i>=0;i--){const r=d(t[i]);if(void 0!==r&&new Date(r)<=e)return i}return-1}function b(t,e,i,r,n){const o=n===r.items.length-1;if(o&&i===e.length-1)return t;if(o)return Object.assign(Object.assign({},t),{processedItems:[...e.slice(0,i+1),{type:"newItemIndicator"},...e.slice(i+1)]});const s=[...r.items.slice(0,n+1),{type:"newItemIndicator"},...r.items.slice(n+1)];return Object.assign(Object.assign({},t),{processedItems:[...e.slice(0,i),Object.assign(Object.assign({},r),{items:s}),...e.slice(i+1)]})}function g(t){const e=[];let i=null,r=null;for(const n of t.processedItems){if("chat"!==n.type&&"iconList"!==n.type)continue;const o=t.dateTimeFormatter.format(new Date(n.item.timestamp),"date");o===r?null==i||i.items.push(n):(i&&e.push(i),i={type:"group",groupType:"dateGroup",heading:o,items:[n]},r=o)}return i&&e.push(i),Object.assign(Object.assign({},t),{processedItems:e})}class u{constructor(t,e,i){this.scrollContainer=t,this.getOrder=e,this.isSticky=!0,this.paintedOrder=i}beforeRender(){this.scrollContainer.isConnected&&(this.isSticky=this.distanceFromNewestEdge(this.paintedOrder)<50)}afterRender(){this.scrollContainer.isConnected&&(this.paintedOrder=this.getOrder(),this.isSticky&&this.scrollToNewest())}repinIfSticky(){this.scrollContainer.isConnected&&this.isSticky&&this.scrollToNewest()}scrollToNewest(){const t="oldest-on-top"===this.getOrder()?this.scrollContainer.scrollHeight:0;this.scrollContainer.scrollTop!==t&&(this.scrollContainer.scrollTop=t)}distanceFromNewestEdge(t){return"oldest-on-top"===t?this.scrollContainer.scrollHeight-this.scrollContainer.scrollTop-this.scrollContainer.clientHeight:this.scrollContainer.scrollTop}}const f="grid-template-rows",y=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.items=[],this.order="oldest-on-top",this.processedItems=[],this.handleHeightTransitionEnd=function(t){return e=>{e.propertyName===f&&t()}}((()=>{var t;return null===(t=this.scrollAnchor)||void 0===t?void 0:t.repinIfSticky()}))}handleItemsChange(){let t=null;this.lastVisitedTimestamp&&(t=function(t){return new Date("string"==typeof t?Date.parse(t):t)}(this.lastVisitedTimestamp));const e=function(t,e,i){return function(t){return[h,g,m].reduce(((t,e)=>e(t)),t)}({items:t,processedItems:[],lastVisitedTimestamp:i,dateTimeFormatter:e}).processedItems}(this.items,this.dateTimeFormatter,t);this.processedItems="newest-on-top"===this.order?function(t){return t.toReversed().map((t=>"group"!==t.type?t:Object.assign(Object.assign({},t),{items:t.items.toReversed()})))}(e):e}componentWillLoad(){this.handleItemsChange(),this.scrollAnchor=new u(this.host,(()=>this.order),this.order)}componentDidLoad(){var t;!function(t){if(!t)return;const e=globalThis.getComputedStyle(t).transitionProperty;if(!e)return;const i=new Set(e.split(",").map((t=>t.trim())));i.has("all")||i.has(f)||console.warn(`[limebb-chat-list] Typing indicator is transitioning \`${e}\` instead of \`${f}\`. The auto-scroll on indicator appearance will not fire. Update the CSS or the handler so they match.`)}(null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector(".typing-indicator-height-animation"))}componentWillRender(){0!==this.items.length&&this.scrollAnchor.beforeRender()}componentDidRender(){0!==this.items.length&&this.scrollAnchor.afterRender()}render(){return i(r,{key:"1684ed7ba9da966e3c8b8c1c9615738b825b28fa",class:{"is-empty":0===this.items.length&&!this.isTypingIndicatorVisible},"aria-busy":this.isBusy(),role:"log"},this.renderSpinner(),"newest-on-top"===this.order&&this.renderTypingIndicatorBlock(),this.renderChatItems(),"oldest-on-top"===this.order&&this.renderTypingIndicatorBlock())}renderSpinner(){if(this.loading)return i("limel-spinner",null)}renderTypingIndicatorBlock(){return i("div",{class:"typing-indicator-height-animation",onTransitionEnd:this.handleHeightTransitionEnd},i("div",null,this.renderTypingIndicator()))}renderTypingIndicator(){if(this.isTypingIndicatorVisible)return i("limebb-typing-indicator",null)}renderChatItems(){return this.processedItems.map((t=>{switch(t.type){case"group":return this.renderGroup(t);case"newItemIndicator":return this.renderIndicator();case"chat":case"iconList":return null;default:return w(t)}}))}renderGroup(t){const e=t.items.map((t=>{switch(t.type){case"chat":return this.renderChatItem(t.item);case"iconList":return this.renderIconList(t.item);case"newItemIndicator":return this.renderIndicator();case"group":return null;default:return w(t)}})),r="date-group-"+t.heading,n=("heading-"+r).replaceAll(/[^a-zA-Z0-9_-]/g,"_"),o=i("a",{id:n,class:"date-heading",role:"heading","aria-level":2},t.heading);return i("section",{class:"date-group",key:r,"aria-labelledby":n},o,e)}renderChatItem(t){return i("limebb-chat-item",{platform:this.platform,context:this.context,item:t,helperText:t.helperText,hasError:t.hasError,key:t.id})}renderIconList(t){return i("limebb-chat-icon-list",{item:t,key:t.id})}renderIndicator(){return i("div",{class:"new-items-indicator",role:"separator"},i("hr",null),i("h3",null,this.translator.get("webclient.new")))}isBusy(){return this.loading||this.isTypingIndicatorVisible?"true":"false"}get dateTimeFormatter(){return this.platform.get(o.DateTimeFormatter)}get translator(){return this.platform.get(o.Translate)}get host(){return this}static get watchers(){return{items:[{handleItemsChange:0}],order:[{handleItemsChange:0}]}}static get style(){return'@charset "UTF-8";:host(limebb-chat-list){--limel-top-edge-fade-height:0.75rem;isolation:isolate;--limel-overflow-mask-vertical:linear-gradient( to bottom, transparent 0%, black calc(0% + var(--limel-top-edge-fade-height, 1rem)), black calc(100% - var(--limel-bottom-edge-fade-height, 1rem)), transparent 100% );-webkit-mask-image:var(--limel-overflow-mask-vertical);mask-image:var(--limel-overflow-mask-vertical);padding-top:var(--limel-top-edge-fade-height, 1rem);padding-bottom:var(--limel-bottom-edge-fade-height, 1rem);box-sizing:border-box;display:flex;flex-direction:column;gap:0.5rem;height:100%;width:100%;min-width:0;min-height:0;padding:var(--limel-top-edge-fade-height) 0.5rem;overflow:hidden auto}:host(limebb-chat-list.is-empty){padding:0}*{box-sizing:border-box}limel-spinner{align-self:center;justify-self:center;margin:auto}.date-group{isolation:isolate;display:flex;flex-direction:inherit;gap:0.5rem}.date-heading{position:sticky;z-index:1;top:0.25rem;display:flex;border-radius:9rem;padding:0.25rem 0.5rem;margin:0 auto;width:fit-content;font-size:0.75rem;line-height:1;color:rgb(var(--contrast-900));backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem);transition:color 0.2s ease, border-color 0.4s ease}.date-heading:hover{color:rgb(var(--contrast-1000));border-color:rgb(var(--contrast-500))}.date-heading:hover:before{opacity:1}.date-heading:before{transition:opacity 0.2s ease;content:"";position:absolute;z-index:-1;inset:0;opacity:0.6;border-radius:inherit;background-color:rgb(var(--contrast-100))}.new-items-indicator{position:relative;isolation:isolate;display:flex;align-items:center;justify-content:flex-end;margin:0.25rem 0}.new-items-indicator hr{border:none;position:absolute;width:100%;height:1px;background-color:rgb(var(--color-red-lighter))}.new-items-indicator h3{z-index:1;padding:0 0.5rem;border-radius:1rem;margin:0 1rem;font-size:small;line-height:0.75rem;text-transform:lowercase;color:rgb(var(--color-red-default));background-color:rgb(var(--contrast-100))}.typing-indicator-height-animation{--limebb-chat-typing-opacity-transition-speed:0.1s;--limebb-chat-typing-opacity-transition-delay:0s;--limebb-chat-typing-grid-template-rows-transition-speed:0.3s;position:sticky;z-index:1;transition:grid-template-rows var(--limebb-chat-typing-grid-template-rows-transition-speed) ease;display:grid;grid-template-rows:0}.typing-indicator-height-animation div{transition:opacity var(--limebb-chat-typing-opacity-transition-speed) ease var(--limebb-chat-typing-opacity-transition-delay);overflow:hidden;opacity:0}:host(limebb-chat-list[order=oldest-on-top]) .typing-indicator-height-animation{bottom:0}:host(limebb-chat-list[order=newest-on-top]) .typing-indicator-height-animation{top:0}:host(limebb-chat-list[is-typing-indicator-visible]) .typing-indicator-height-animation{--limebb-chat-typing-opacity-transition-speed:0.4s;--limebb-chat-typing-opacity-transition-delay:0.3s;--limebb-chat-typing-grid-template-rows-transition-speed:0.46s;grid-template-rows:1.5rem}:host(limebb-chat-list[is-typing-indicator-visible]) .typing-indicator-height-animation div{opacity:1}.date-group limebb-chat-item{--limebb-promoted-action-bar-grid-template-rows:0fr}:host(limebb-chat-list[order=oldest-on-top]) .date-group:last-of-type limebb-chat-item:last-of-type{--limebb-promoted-action-bar-grid-template-rows:1fr}:host(limebb-chat-list[order=newest-on-top]) .date-group:first-of-type limebb-chat-item:first-of-type{--limebb-promoted-action-bar-grid-template-rows:1fr}'}},[1,"limebb-chat-list",{platform:[16],context:[16],items:[16],loading:[516],isTypingIndicatorVisible:[516,"is-typing-indicator-visible"],lastVisitedTimestamp:[513,"last-visited-timestamp"],order:[513]},void 0,{items:[{handleItemsChange:0}],order:[{handleItemsChange:0}]}]);function w(t){throw Error("Unexpected value in exhaustive switch: "+JSON.stringify(t))}const v=y,k=function(){"undefined"!=typeof customElements&&["limebb-chat-list","limebb-chat-icon-list","limebb-chat-item","limebb-typing-indicator"].forEach((t=>{switch(t){case"limebb-chat-list":customElements.get(n(t))||customElements.define(n(t),y);break;case"limebb-chat-icon-list":customElements.get(n(t))||s();break;case"limebb-chat-item":customElements.get(n(t))||a();break;case"limebb-typing-indicator":customElements.get(n(t))||l()}}))};export{v as LimebbChatList,k as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as e,createEvent as o,h as n,transformTag as i}from"@stencil/core/internal/client";import{L as r}from"./web-component-template.js";import{
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as e,createEvent as o,h as n,transformTag as i}from"@stencil/core/internal/client";import{L as r}from"./web-component-template.js";import{b as s}from"./index.esm.js";import{g as l}from"./get.js";const c=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.change=o(this,"change",7),this.value={},this.type="component",this.configViewType="code",this.findConfigComponent=t=>{var e,o;return"component"===this.type?null===(e=this.registry.getAll().find((e=>e.name===t)))||void 0===e?void 0:e.configComponent:"command"===this.type?null===(o=this.commandbus.getAll().find((e=>e.id===t)))||void 0===o?void 0:o.configComponent:void 0},this.handleChangeMode=t=>{t.stopPropagation(),this.configViewType=t.detail.id},this.handleCodeEditorChange=t=>{t.stopPropagation();try{const e=JSON.parse(t.detail);this.change.emit(e)}catch(t){}}}componentWillLoad(){this.configComponent=this.getComponentName()}componentShouldUpdate(t,e,o){return"formInfo"!==o}watchFormInfo(){this.configComponent=this.getComponentName()}watchconfigComponent(t,e){t&&!e&&(this.configViewType="config"),t||(this.configViewType="code")}getComponentName(){var t,e,o;const n=[...null!==(e=null===(t=this.formInfo)||void 0===t?void 0:t.schemaPath.slice(0,-1))&&void 0!==e?e:[],this.getNameField()],i=l(null===(o=this.formInfo)||void 0===o?void 0:o.rootValue,n),r=this.findConfigComponent(i);if(r&&customElements.get(r.name))return r}render(){return[this.renderHeader(),this.renderContent()]}renderHeader(){let t=[];return this.configComponent&&(t=[{id:"config",title:"Config",selected:"config"===this.configViewType},{id:"code",title:"Code",selected:"code"===this.configViewType}]),n("limel-header",{icon:"edit_property",heading:this.label,subheading:this.helperText},n("limel-button-group",{slot:"actions",value:t,onChange:this.handleChangeMode}))}renderContent(){return"config"===this.configViewType?this.renderConfigComponent():this.renderCodeEditor()}renderCodeEditor(){return n("limel-code-editor",{value:JSON.stringify(this.value,null,"\t"),language:"json",readonly:this.readonly,lineNumbers:!0,fold:!0,lint:!0,onChange:this.handleCodeEditorChange})}renderConfigComponent(){var t,e;return n(r,{class:"config-component",platform:this.platform,context:this.context,name:null===(t=this.configComponent)||void 0===t?void 0:t.name,props:Object.assign(Object.assign({},null===(e=this.configComponent)||void 0===e?void 0:e.props),{value:this.value,required:this.required,readonly:this.readonly,disabled:this.disabled,label:this.label,helperText:this.helperText,formInfo:this.formInfo})})}getNameField(){return this.nameField?this.nameField:{component:"name",command:"id"}[this.type]}get registry(){return this.platform.get(s.WebComponentRegistry)}get commandbus(){return this.platform.get(s.CommandBus)}static get watchers(){return{formInfo:[{watchFormInfo:0}],configComponent:[{watchconfigComponent:0}]}}static get style(){return":host(*){--header-background-color:rgb(var(--contrast-600));display:flex;flex-direction:column;border:1px dashed rgb(var(--contrast-700));overflow:clip;border-radius:0.75rem;background-color:rgb(var(--contrast-500))}*{box-sizing:border-box}.label{margin-top:1rem;margin-bottom:1rem}.config-component{display:grid;column-gap:1rem;row-gap:1rem;margin:1rem;grid-template-columns:repeat(3, minmax(0, 1fr))}"}},[1,"limebb-component-config",{platform:[16],context:[16],value:[16],required:[4],readonly:[4],disabled:[4],label:[1],helperText:[1,"helper-text"],formInfo:[16],type:[1],nameField:[1,"name-field"],configComponent:[32],configViewType:[32]},void 0,{formInfo:[{watchFormInfo:0}],configComponent:[{watchconfigComponent:0}]}]),m=c,h=function(){"undefined"!=typeof customElements&&["limebb-component-config"].forEach((t=>{"limebb-component-config"===t&&(customElements.get(i(t))||customElements.define(i(t),c))}))};export{m as LimebbComponentConfig,h as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as i,createEvent as e,h as s,transformTag as o}from"@stencil/core/internal/client";import{n}from"./index.esm.js";const l=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.change=e(this,"change",7),this.copy=e(this,"copy",7),this.type="component",this.copyLabel="Copy value",this.hideCopyButton=!1,this.allItems=[],this.getConfigs=()=>({component:()=>this.webComponentRegistry.getAll(),command:()=>this.commandbus.getAll()}[this.type]()),this.getConfigValue=t=>"name"in t&&"string"==typeof t.name?t.name:"id"in t&&"string"==typeof t.id?t.id:"",this.hasTag=t=>!this.tags||this.tags.some((i=>{var e;return null===(e=t.tags)||void 0===e?void 0:e.includes(i)})),this.handleBlur=()=>{this.emitIfValidValue(this.currentInput)},this.handleChange=t=>{var i;t.stopPropagation(),this.change.emit(null===(i=t.detail)||void 0===i?void 0:i.value)},this.handleCopyButton=()=>{navigator.clipboard.writeText(this.value),this.copy.emit(this.value)},this.handleKeyUp=t=>{"Enter"===t.key&&this.emitIfValidValue(this.currentInput)},this.emitIfValidValue=t=>{this.isValidIdentifier(t)&&this.change.emit(t)},this.isValidIdentifier=t=>!!t&&("component"===this.type?!!customElements.get(t):this.allItems.some((i=>i.value===t))),this.renderPicker=()=>{let t=this.allItems.find((t=>this.value===t.value));return!t&&this.value&&(t={text:this.value,value:this.value,icon:{name:"question",color:"rgb(var(--color-glaucous-light))"}}),s("limel-picker",{disabled:this.disabled,helperText:this.helperText,label:this.label,readonly:this.readonly,required:this.required,searcher:this.search,value:t,title:null==t?void 0:t.text,onBlur:this.handleBlur,onChange:this.handleChange,onKeyUp:this.handleKeyUp})},this.renderCopyButton=()=>{if(!this.hideCopyButton)return s("limel-icon-button",{icon:"copy",disabled:!this.value,label:this.copyLabel,onClick:this.handleCopyButton})},this.search=async t=>t?this.allItems.filter(this.isItemMatching(t.toLocaleLowerCase())):this.allItems,this.isItemMatching=t=>i=>t.split(/\s+/).every((t=>{var e,s;return i.text.toLocaleLowerCase().includes(t)||(null===(e=i.secondaryText)||void 0===e?void 0:e.toLocaleLowerCase().includes(t))||(null===(s=i.value)||void 0===s?void 0:s.toLocaleLowerCase().includes(t))}))}componentWillLoad(){this.allItems=this.getConfigs().filter(this.hasTag).map((t=>{var i,e;return{value:this.getConfigValue(t),text:this.translator.get(null!==(i=t.title)&&void 0!==i?i:this.getConfigValue(t)),secondaryText:this.translator.get(null!==(e=t.description)&&void 0!==e?e:""),icon:t.icon}})).sort(((t,i)=>t.text.localeCompare(i.text)))}render(){return[this.renderPicker(),this.renderCopyButton()]}get currentInput(){var t,i,e,s,o,n,l;return null!==(l=null===(n=null===(o=null===(s=null===(e=null===(i=null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector("limel-picker"))||void 0===i?void 0:i.shadowRoot)||void 0===e?void 0:e.querySelector("limel-chip-set"))||void 0===s?void 0:s.shadowRoot)||void 0===o?void 0:o.querySelector("input"))||void 0===n?void 0:n.value)&&void 0!==l?l:""}get webComponentRegistry(){return this.platform.get(n.WebComponentRegistry)}get commandbus(){return this.platform.get(n.CommandBus)}get translator(){return this.platform.get(n.Translate)}get host(){return this}static get style(){return":host(limebb-component-picker){position:relative;display:flex;align-items:center}:host(limebb-component-picker) limel-picker{flex-grow:1;min-width:0}:host(limebb-component-picker) limel-icon-button{position:absolute;right:0.25rem}"}},[1,"limebb-component-picker",{platform:[16],context:[16],type:[1],tags:[16],value:[1],copyLabel:[1,"copy-label"],hideCopyButton:[4,"hide-copy-button"],required:[4],readonly:[4],disabled:[4],label:[1],helperText:[1,"helper-text"]}]),h=l,r=function(){"undefined"!=typeof customElements&&["limebb-component-picker"].forEach((t=>{"limebb-component-picker"===t&&(customElements.get(o(t))||customElements.define(o(t),l))}))};export{h as LimebbComponentPicker,r as defineCustomElement}
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as i,createEvent as e,h as s,transformTag as o}from"@stencil/core/internal/client";import{b as n}from"./index.esm.js";const l=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.change=e(this,"change",7),this.copy=e(this,"copy",7),this.type="component",this.copyLabel="Copy value",this.hideCopyButton=!1,this.allItems=[],this.getConfigs=()=>({component:()=>this.webComponentRegistry.getAll(),command:()=>this.commandbus.getAll()}[this.type]()),this.getConfigValue=t=>"name"in t&&"string"==typeof t.name?t.name:"id"in t&&"string"==typeof t.id?t.id:"",this.hasTag=t=>!this.tags||this.tags.some((i=>{var e;return null===(e=t.tags)||void 0===e?void 0:e.includes(i)})),this.handleBlur=()=>{this.emitIfValidValue(this.currentInput)},this.handleChange=t=>{var i;t.stopPropagation(),this.change.emit(null===(i=t.detail)||void 0===i?void 0:i.value)},this.handleCopyButton=()=>{navigator.clipboard.writeText(this.value),this.copy.emit(this.value)},this.handleKeyUp=t=>{"Enter"===t.key&&this.emitIfValidValue(this.currentInput)},this.emitIfValidValue=t=>{this.isValidIdentifier(t)&&this.change.emit(t)},this.isValidIdentifier=t=>!!t&&("component"===this.type?!!customElements.get(t):this.allItems.some((i=>i.value===t))),this.renderPicker=()=>{let t=this.allItems.find((t=>this.value===t.value));return!t&&this.value&&(t={text:this.value,value:this.value,icon:{name:"question",color:"rgb(var(--color-glaucous-light))"}}),s("limel-picker",{disabled:this.disabled,helperText:this.helperText,label:this.label,readonly:this.readonly,required:this.required,searcher:this.search,value:t,title:null==t?void 0:t.text,onBlur:this.handleBlur,onChange:this.handleChange,onKeyUp:this.handleKeyUp})},this.renderCopyButton=()=>{if(!this.hideCopyButton)return s("limel-icon-button",{icon:"copy",disabled:!this.value,label:this.copyLabel,onClick:this.handleCopyButton})},this.search=async t=>t?this.allItems.filter(this.isItemMatching(t.toLocaleLowerCase())):this.allItems,this.isItemMatching=t=>i=>t.split(/\s+/).every((t=>{var e,s;return i.text.toLocaleLowerCase().includes(t)||(null===(e=i.secondaryText)||void 0===e?void 0:e.toLocaleLowerCase().includes(t))||(null===(s=i.value)||void 0===s?void 0:s.toLocaleLowerCase().includes(t))}))}componentWillLoad(){this.allItems=this.getConfigs().filter(this.hasTag).map((t=>{var i,e;return{value:this.getConfigValue(t),text:this.translator.get(null!==(i=t.title)&&void 0!==i?i:this.getConfigValue(t)),secondaryText:this.translator.get(null!==(e=t.description)&&void 0!==e?e:""),icon:t.icon}})).sort(((t,i)=>t.text.localeCompare(i.text)))}render(){return[this.renderPicker(),this.renderCopyButton()]}get currentInput(){var t,i,e,s,o,n,l;return null!==(l=null===(n=null===(o=null===(s=null===(e=null===(i=null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector("limel-picker"))||void 0===i?void 0:i.shadowRoot)||void 0===e?void 0:e.querySelector("limel-chip-set"))||void 0===s?void 0:s.shadowRoot)||void 0===o?void 0:o.querySelector("input"))||void 0===n?void 0:n.value)&&void 0!==l?l:""}get webComponentRegistry(){return this.platform.get(n.WebComponentRegistry)}get commandbus(){return this.platform.get(n.CommandBus)}get translator(){return this.platform.get(n.Translate)}get host(){return this}static get style(){return":host(limebb-component-picker){position:relative;display:flex;align-items:center}:host(limebb-component-picker) limel-picker{flex-grow:1;min-width:0}:host(limebb-component-picker) limel-icon-button{position:absolute;right:0.25rem}"}},[1,"limebb-component-picker",{platform:[16],context:[16],type:[1],tags:[16],value:[1],copyLabel:[1,"copy-label"],hideCopyButton:[4,"hide-copy-button"],required:[4],readonly:[4],disabled:[4],label:[1],helperText:[1,"helper-text"]}]),h=l,r=function(){"undefined"!=typeof customElements&&["limebb-component-picker"].forEach((t=>{"limebb-component-picker"===t&&(customElements.get(o(t))||customElements.define(o(t),l))}))};export{h as LimebbComponentPicker,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as n,transformTag as l}from"@stencil/core/internal/client";import{
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as n,transformTag as l}from"@stencil/core/internal/client";import{b as o}from"./index.esm.js";const s=[{trigger:"rich-text",icon:"font_style_formatting",translationKey:"webclient.composer-toolbar.rich-text"},{trigger:"mention",icon:"email_sign_92447",translationKey:"webclient.composer-toolbar.mention",helperLabel:"@"},{trigger:"text-snippet",icon:"add_text",translationKey:"webclient.composer-toolbar.text-snippet",helperLabel:"!"},{trigger:"internal-link",icon:"hashtag_large",translationKey:"webclient.composer-toolbar.internal-link",helperLabel:"#"}],r=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.triggerInsert=i(this,"triggerInsert",7),this.filesSelected=i(this,"filesSelected",7),this.mentions=!1,this.textSnippets=!1,this.internalLinks=!1,this.richText=!1,this.handleTriggerSelected=e=>{e.stopPropagation(),this.triggerInsert.emit(e.detail.value)},this.handleFilesSelected=e=>{e.stopPropagation(),this.filesSelected.emit(e.detail)}}render(){return[n("div",{key:"34b441a01bfcca09b934ffc5aa5f6852efd359fd",class:"actions"},n("slot",{key:"7b4ebdd76e9b58a7a9aa376aeffedf146f000973",name:"leading"}),this.renderFileInput(),this.renderTriggerActions(),n("slot",{key:"0b3fdc53e1dde0963f131684e7994ffc49e737fa",name:"trailing"})),n("slot",{key:"82ca56d3d8a9e227f343f4bedaaadca5c075f02e",name:"primary-action"})]}get translator(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(o.Translate)}get triggerActions(){const e={mention:this.mentions,"text-snippet":this.textSnippets,"internal-link":this.internalLinks,"rich-text":this.richText};return s.filter((t=>e[t.trigger])).map((e=>{var t,i;return{text:null!==(i=null===(t=this.translator)||void 0===t?void 0:t.get(e.translationKey))&&void 0!==i?i:e.trigger,commandText:e.helperLabel,icon:e.icon,iconOnly:!0,value:e.trigger}}))}renderTriggerActions(){const e=this.triggerActions;if(0!==e.length)return n("limel-action-bar",{actions:e,onItemSelected:this.handleTriggerSelected})}renderFileInput(){var e,t,i,l,o,s;if(this.fileInput)return n("limel-file-input",{accept:null!==(e=this.fileInput.accept)&&void 0!==e?e:"*",multiple:null!==(t=this.fileInput.multiple)&&void 0!==t&&t,disabled:null!==(i=this.fileInput.disabled)&&void 0!==i&&i,onFilesSelected:this.handleFilesSelected},n("limel-icon-button",{icon:"attach",disabled:null!==(l=this.fileInput.disabled)&&void 0!==l&&l,label:null===(o=this.translator)||void 0===o?void 0:o.get("webclient.attach-files"),helperLabel:null===(s=this.translator)||void 0===s?void 0:s.get("webclient.attach-files-helper")}))}static get style(){return"*{box-sizing:border-box;min-width:0}:host(limebb-composer-toolbar){box-sizing:border-box;display:flex;align-items:center;width:100%;max-width:100%;gap:0.5rem}.actions{display:flex;align-items:center;flex-wrap:nowrap;flex-grow:1}limel-icon-button,::slotted(limel-icon-button){display:inline-block;scale:0.86}limel-file-input{flex-shrink:0}"}},[257,"limebb-composer-toolbar",{platform:[16],mentions:[516],textSnippets:[516,"text-snippets"],internalLinks:[516,"internal-links"],richText:[516,"rich-text"],fileInput:[16]}]),a=r,c=function(){"undefined"!=typeof customElements&&["limebb-composer-toolbar"].forEach((e=>{"limebb-composer-toolbar"===e&&(customElements.get(l(e))||customElements.define(l(e),r))}))};export{a as LimebbComposerToolbar,c as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,h as r,transformTag as o}from"@stencil/core/internal/client";import{
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,h as r,transformTag as o}from"@stencil/core/internal/client";import{b as i}from"./index.esm.js";import{c as s}from"./random-string.js";import{d as n}from"./percentage-visualizer.js";const a=36e5,l=24*a,d=[{unit:"year",ms:365*l},{unit:"month",ms:30*l},{unit:"week",ms:7*l},{unit:"day",ms:l},{unit:"hour",ms:a},{unit:"minute",ms:6e4},{unit:"second",ms:1e3}];function c(e,t){var r;const o=e.getTime()-Date.now(),{unit:i,ms:s}=null!==(r=d.find((e=>Math.abs(o)>=e.ms)))&&void 0!==r?r:d.at(-1);return new Intl.RelativeTimeFormat(t,{style:"long"}).format(Math.round(o/s),i)}const m=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.items=[],this.relativeDates=!0,this.renderCell=e=>r("div",null,r("dt",null,r("span",null,e.label)),r("dd",null,r("span",null,this.renderValue(e))))}render(){const e=this.items.some((e=>!e.secondary));return[this.renderPrimary(e),this.renderSecondary(e)]}renderPrimary(e){if(!e)return;const t=this.items.filter((e=>!e.secondary));return r("dl",{class:"primary"},this.renderImageCell(),t.map(this.renderCell))}renderSecondary(e){const t=this.items.filter((e=>e.secondary));if(0!==t.length)return r("dl",{class:"secondary"},!e&&this.renderImageCell(),t.map(this.renderCell))}renderImageCell(){var e;if(this.image)return r("div",{class:"image-cell"},r("img",{src:this.image.src,alt:this.image.alt,loading:null!==(e=this.image.loading)&&void 0!==e?e:"lazy"}))}renderValue(e){if(null==e.value||""===e.value)return"–";if("belongsto"===e.type){const t=this.getBelongsToHref(e.field);return t?r("a",{class:"belongs-to",href:t},e.value):e.value}if("phone"===e.type)return r("a",{href:this.toTelUri(e.value)},e.value);if("email"===e.type)return r("a",{href:"mailto:"+e.value},e.value);if("link"===e.type)return r("a",{href:this.ensureUrlProtocol(e.value),target:"_blank",rel:"noopener"},this.stripUrlPrefix(e.value));if("time"===e.type||"date"===e.type){const t=new Date(e.value);if(Number.isNaN(t.getTime()))return e.value;if(!this.relativeDates)return this.formatAbsoluteDate(t,e.type);const o=s();return[r("span",{id:o},c(t,this.language)),r("limel-tooltip",{elementId:o,label:this.formatAbsoluteDate(t,e.type)})]}return"percent"===e.type?r("limebb-percentage-visualizer",{value:Number(e.value),multiplier:100,displayPercentageColors:!0,reducePresence:!1}):e.value}toTelUri(e){return"tel:"+e.replaceAll(" ","")}ensureUrlProtocol(e){return/^https?:\/\//i.test(e)?e:"https://"+e}stripUrlPrefix(e){return e.replace(/^https?:\/\//,"").replace(/^www\./,"")}getBelongsToHref(e){var t;if(this.limeobject&&e)try{const r=this.limeobject.getValue(e);if(!r||"object"!=typeof r)return;const o=null===(t=r.getLimetype)||void 0===t?void 0:t.call(r);if(!(null==o?void 0:o.name)||!r.id)return;return`object/${o.name}/${r.id}`}catch(e){return}}get language(){var e;try{return null===(e=this.platform)||void 0===e?void 0:e.get(i.Application).getLanguage()}catch(e){return navigator.language}}formatAbsoluteDate(e,t){var r;try{const o=null===(r=this.platform)||void 0===r?void 0:r.get(i.DateTimeFormatter);if(o)return o.format(e,t)}catch(e){}return e.toLocaleString(this.language,{dateStyle:"long",timeStyle:"time"===t?"short":void 0})}static get style(){return'@charset "UTF-8";*,*:before,*:after{box-sizing:border-box;min-width:0;min-height:0}:host(limebb-data-cells){box-sizing:border-box;display:flex;flex-direction:column;gap:0.5rem;padding:var(--limebb-data-cells-padding)}div{display:flex;flex-direction:column}dl{display:flex;flex-wrap:wrap;gap:0.75rem 1rem;margin:0;padding:0;list-style:none}dd,dt{display:flex;align-items:center}dd span,dt span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}dd{margin:0;font-size:var(--limel-theme-default-font-size);line-height:1.25rem;height:1.25rem;font-weight:500;color:rgb(var(--contrast-1100))}dd a{text-decoration:none;border-radius:1.25rem}dd a:focus{outline:none}dd a:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}dd a:not(.belongs-to){position:relative;cursor:pointer;transition:color 0.2s ease;color:rgb(var(--color-blue-default))}dd a:not(.belongs-to):before{transition:opacity 0.2s ease, transform 0.3s ease-out;content:"";position:absolute;inset:auto 0 0 0;width:calc(100% - 0.5rem);margin:auto;height:0.125rem;border-radius:1rem;background-color:currentColor;opacity:0;transform:scale(0.6)}dd a:not(.belongs-to):hover{color:rgb(var(--color-blue-default))}dd a:not(.belongs-to):hover:before{opacity:0.3;transform:scale(1)}dd a.belongs-to{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);color:inherit;background-color:rgb(var(--contrast-400));padding:1px 0.375rem}dd a.belongs-to:hover,dd a.belongs-to:focus-visible{color:rgb(var(--color-white));background-color:rgb(var(--color-sky-default))}dd:has(.belongs-to){transform:translateX(-0.375rem)}dt{order:1;transition:color 0.2s ease;font-size:0.65rem;color:rgb(var(--contrast-800))}:host(:hover) dt,:host(:focus-within) dt{color:rgb(var(--contrast-900))}.primary+.secondary{padding-top:0.5rem;border-top:1px dashed rgb(var(--contrast-500))}.secondary dd{font-size:0.75rem;font-weight:400;line-height:1rem;height:1rem}div.image-cell{flex-shrink:0}div.image-cell img{display:block;width:2.5rem;height:2.5rem;border-radius:var(--data-cells-image-border-radius, 50%);object-fit:var(--data-cells-image-object-fit, cover);background-color:rgb(var(--color-white));box-shadow:0 0 0 1px rgb(var(--contrast-800), 0.25)}'}},[1,"limebb-data-cells",{platform:[16],context:[16],limeobject:[8],items:[16],image:[16],relativeDates:[4,"relative-dates"]}]),u=m,h=function(){"undefined"!=typeof customElements&&["limebb-data-cells","limebb-percentage-visualizer"].forEach((e=>{switch(e){case"limebb-data-cells":customElements.get(o(e))||customElements.define(o(e),m);break;case"limebb-percentage-visualizer":customElements.get(o(e))||n()}}))};export{u as LimebbDataCells,h as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as r,Host as n,transformTag as o}from"@stencil/core/internal/client";import{
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as r,Host as n,transformTag as o}from"@stencil/core/internal/client";import{b as s}from"./index.esm.js";import{H as a}from"./highlight-item.handler.js";import{d as l}from"./empty-state.js";import{d as m}from"./feed-item-thumbnail-file-info.js";import{d}from"./feed-timeline-item.js";import{d as h}from"./navigation-button.js";import{d as u}from"./summary-popover.js";var c,b={},f={};function g(){return c||(c=1,f.getRoundingMethod=function(e){return t=>{const i=(e?Math[e]:Math.trunc)(t);return 0===i?0:i}}),f}var p,v={};function y(){if(p)return v;p=1,v.secondsInYear=v.secondsInWeek=v.secondsInQuarter=v.secondsInMonth=v.secondsInMinute=v.secondsInHour=v.secondsInDay=v.quartersInYear=v.monthsInYear=v.monthsInQuarter=v.minutesInYear=v.minutesInMonth=v.minutesInHour=v.minutesInDay=v.minTime=v.millisecondsInWeek=v.millisecondsInSecond=v.millisecondsInMinute=v.millisecondsInHour=v.millisecondsInDay=v.maxTime=v.daysInYear=v.daysInWeek=void 0,v.daysInWeek=7;const e=v.daysInYear=365.2425,t=v.maxTime=864e13;v.minTime=-t,v.millisecondsInWeek=6048e5,v.millisecondsInDay=864e5,v.millisecondsInMinute=6e4,v.millisecondsInHour=36e5,v.millisecondsInSecond=1e3,v.minutesInYear=525600,v.minutesInMonth=43200,v.minutesInDay=1440,v.minutesInHour=60,v.monthsInQuarter=3,v.monthsInYear=12,v.quartersInYear=4;const i=v.secondsInHour=3600;v.secondsInMinute=60;const r=v.secondsInDay=24*i;v.secondsInWeek=7*r;const n=v.secondsInYear=r*e,o=v.secondsInMonth=n/12;return v.secondsInQuarter=3*o,v}var k,w,x,I={},j={};function E(){return k||(k=1,j.toDate=function(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):new Date("number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?e:NaN)}),j}function D(){if(w)return I;w=1,I.differenceInMilliseconds=function(t,i){return+(0,e.toDate)(t)-+(0,e.toDate)(i)};var e=E();return I}function C(){if(x)return b;x=1,b.differenceInMinutes=function(r,n,o){const s=(0,i.differenceInMilliseconds)(r,n)/t.millisecondsInMinute;return(0,e.getRoundingMethod)(o?.roundingMethod)(s)};var e=g(),t=y(),i=D();return b}var M=C();const N=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.loadMore=i(this,"loadMore",7),this.highlightedItemIdNotFound=i(this,"highlightedItemIdNotFound",7),this.items=[],this.minutesOfProximity=5,this.totalCount=0,this.direction="ASC",this.isBundled=(e,t)=>{var i,r,n,o,s,a;if(0===t)return!1;if((null===(r=null===(i=this.items[t-1])||void 0===i?void 0:i.author)||void 0===r?void 0:r.id)!==(null===(n=null==e?void 0:e.author)||void 0===n?void 0:n.id))return!1;if((null===(s=null===(o=this.items[t-1])||void 0===o?void 0:o.icon)||void 0===s?void 0:s.name)!==(null===(a=null==e?void 0:e.icon)||void 0===a?void 0:a.name))return!1;const l=new Date(e.timestamp),m=new Date(new Date(this.items[t-1].timestamp)),d=new Date(l);return"DESC"===this.direction?M.differenceInMinutes(m,d)<=this.minutesOfProximity:M.differenceInMinutes(d,m)<=this.minutesOfProximity},this.handleLoadMore=e=>{e.stopPropagation(),this.loadMore.emit()}}connectedCallback(){this.highlighter.registerFeed(this.feedItemElement)}disconnectedCallback(){this.highlighter.unregisterFeed(this.feedItemElement)}render(){return r(n,{key:"5d1c5d6ff9949229a0bafbdb060a0bc386a8eb03",role:"log","aria-busy":this.loading?"true":"false",style:{"--limebb-feed-highlight-duration":"3000ms"}},this.renderLoadMore(),this.renderEmptyFeedMessage(),this.renderSpinner(),this.renderFeedItems())}renderSpinner(){if(this.loading)return r("limel-spinner",{size:"small"})}renderEmptyFeedMessage(){if(!this.loading)return 0===this.items.length?r("limebb-empty-state",{heading:this.heading,value:this.emptyStateMessage,icon:{name:"typewriter_with_paper",color:"rgb(var(--contrast-800))"}}):void 0}renderFeedItems(){return this.groupedItems.map((e=>r("section",{class:"date-group",key:"date-group-"+e.date},r("a",{class:"date-heading"},e.date),e.items.map((({item:e,index:t})=>r("limebb-feed-timeline-item",{platform:this.platform,context:this.context,item:e,key:e.id,ui:null==e?void 0:e.ui,helperText:null==e?void 0:e.helperText,hasError:null==e?void 0:e.hasError,isBundled:this.isBundled(e,t),class:this.isNewItem(e)?"is-new":void 0}))))))}isNewItem(e){if(!this.lastVisitedTimestamp)return!1;const t=new Date(this.lastVisitedTimestamp);return new Date(e.timestamp)>t}renderLoadMore(){if(!(0===this.items.length||this.totalCount<=this.items.length))return r("limel-icon-button",{class:"load-more-button",icon:"more",onClick:this.handleLoadMore,elevated:!0,label:this.loadMoreLabel})}get dateTimeFormatter(){return this.platform.get(s.DateTimeFormatter)}get loadMoreLabel(){return this.translator.get("webclient.load-more")}get translator(){return this.platform.get(s.Translate)}get groupedItems(){const e=[];for(let t=0;t<this.items.length;t++){const i=this.items[t],r=this.dateTimeFormatter.format(i.timestamp,"date"),n=e.at(-1);n&&n.date===r?n.items.push({item:i,index:t}):e.push({date:r,items:[{item:i,index:t}]})}return e}highlightedItemIdChanged(e){void 0!==e&&this.highlightItem(e)}highlightItem(e){var t;const i=null===(t=this.feedItemElement.shadowRoot)||void 0===t?void 0:t.querySelector(`limebb-feed-timeline-item[id="${e}"]`);return i?(i.setAttribute("aria-current","true"),i.scrollIntoView({behavior:"smooth",block:"center"}),i.focus(),setTimeout((()=>{i.removeAttribute("aria-current")}),3e3),!0):(this.highlightedItemIdNotFound.emit({id:e}),!1)}get highlighter(){return this.platform.get(a.SERVICE_NAME)}get feedItemElement(){return this}static get watchers(){return{highlightedItemId:[{highlightedItemIdChanged:0}]}}static get style(){return':host(limebb-feed){--limebb-feed-background-color:var( --feed-background-color, rgb(var(--contrast-100)) );--limebb-feed-item-background-color:var(--contrast-300);display:flex;flex-direction:column;gap:0.25rem;max-width:45rem;background-color:var(--limebb-feed-background-color)}limel-spinner{align-self:center;justify-self:center;margin:auto}.date-group{isolation:isolate;display:flex;flex-direction:column;gap:0.375rem}.date-heading{position:sticky;z-index:1;top:0.25rem;display:flex;border-radius:9rem;padding:0.25rem 0.5rem;margin:0 auto 0 -0.5rem;width:fit-content;font-size:0.75rem;line-height:1;color:rgb(var(--contrast-900));backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem);transition:color 0.2s ease, border-color 0.4s ease}.date-heading:hover{color:rgb(var(--contrast-1000));border-color:rgb(var(--contrast-500))}.date-heading:hover:before{opacity:1}.date-heading:before{transition:opacity 0.2s ease;content:"";position:absolute;z-index:-1;inset:0;opacity:0.6;border-radius:inherit;background-color:rgb(var(--contrast-100))}limebb-feed-timeline-item:has(+limebb-feed-timeline-item[is-bundled]){--limebb-promoted-action-bar-grid-template-rows:0fr}.load-more-button{margin-top:0.5rem}limebb-feed-timeline-item:focus{outline:none}limebb-feed-timeline-item[aria-current=true]:focus{animation:highlight-animation ease-in-out;animation-duration:var(--limebb-feed-highlight-duration)}@keyframes highlight-animation{0%,20%,100%{box-shadow:none}10%,50%,60%{box-shadow:var(--shadow-focused-state)}}'}},[1,"limebb-feed",{platform:[16],context:[16],items:[16],emptyStateMessage:[1,"empty-state-message"],heading:[1],loading:[4],minutesOfProximity:[2,"minutes-of-proximity"],totalCount:[2,"total-count"],direction:[513],lastVisitedTimestamp:[1,"last-visited-timestamp"],highlightedItemId:[8,"highlighted-item-id"]},void 0,{highlightedItemId:[{highlightedItemIdChanged:0}]}]),S=N,z=function(){"undefined"!=typeof customElements&&["limebb-feed","limebb-empty-state","limebb-feed-item-thumbnail-file-info","limebb-feed-timeline-item","limebb-navigation-button","limebb-summary-popover"].forEach((e=>{switch(e){case"limebb-feed":customElements.get(o(e))||customElements.define(o(e),N);break;case"limebb-empty-state":customElements.get(o(e))||l();break;case"limebb-feed-item-thumbnail-file-info":customElements.get(o(e))||m();break;case"limebb-feed-timeline-item":customElements.get(o(e))||d();break;case"limebb-navigation-button":customElements.get(o(e))||h();break;case"limebb-summary-popover":customElements.get(o(e))||u()}}))};export{S as LimebbFeed,z as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as e,h as i,transformTag as r}from"@stencil/core/internal/client";import{
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as e,h as i,transformTag as r}from"@stencil/core/internal/client";import{b as o,n as s,l as n,d as a,L as l,r as h}from"./index.esm.js";import{a as c}from"./limetype.js";class u{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 a={widgetType:"info-tile",limetype:t,filterId:e};return i&&(a.filterName=i),a.aggregateOperator=r,o&&(a.propertyName=o),void 0!==s&&(a.value=s),n&&(a.label=n),{data:a,purpose:"Shows an aggregated value from a filter. Clicking navigates to the explorer with that filter applied."}}}class f{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 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!(!(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(o.Query)}get objectRepository(){return this.platform.get(o.LimeObjectRepository)}}function d(t,e){return t&&(t[e]||t.en||t.en_us)||""}function p(t,e=[]){const{path:i,query:r}=function(t,e=[]){if(!t)return{path:"#"};const i=["explorer",t.limetype,t.id].join("/"),r=function(t,e){const i=[...e,t].filter((t=>void 0!==t));if(0!==i.length)return 1===i.length?i[0]:{op:s.AND,exp:i}}(t.filter,e);return r?{path:i,query:{filter:r}}:{path:i}}(t,e);return r?`${i}?${Object.entries(r).map((([t,e])=>`${t}=${encodeURIComponent(JSON.stringify(e))}`)).join("&")}`:i}class m{constructor(t){this.locale=t}format(t){let e=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 g{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 v{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="",a="",l="";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))?l+=t.value:a+=t.value;return a||(a=o.format(t),n="",l=""),{prefix:n,value:a,suffix:l}}}class b{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="",a="",l="";for(const t of s)"literal"!==t.type||a?"literal"===t.type&&a?l+=t.value:a+=t.value:n+=t.value;return a||(a=n||l,n="",l=""),{prefix:n,value:a,suffix:l}}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 y{constructor(t){this.locale=t}createFormatter(t,e){return"number"===(null==t?void 0:t.type)&&"number"==typeof e?new v(this.locale):"date"===(null==t?void 0:t.type)&&"string"==typeof e?new g(this.locale):"relative-date"===(null==t?void 0:t.type)&&"string"==typeof e?new b(this.locale):new m(this.locale)}}var w=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 a=t.length-1;a>=0;a--)(o=t[a])&&(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 x=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.aggregateOperator=h.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,e;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===(e=null==o?void 0:o.suffix)||void 0===e?void 0:e.trim())||this.suffix},n=Object.assign(Object.assign({},s),{icon:"error",prefix:"ERROR",loading:!0,label:this.getLabel(r)}),a=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 i("limel-info-tile",Object.assign({key:"d96335bf647a10a786c7294da2ede4b6bd4ee38f",class:{error:!r||this.error}},!r||this.error?n:a))}getFormattedValue(){if(!this.value&&0!==this.value)return{value:""};try{return this.getFormatter(this.value).format(this.value,this.format)}catch(t){return new m(this.language).format(this.value)}}getLabel(t){return t?"string"==typeof this.label?this.translator.get(this.label):d(this.label&&"object"==typeof this.label?this.label:t.name,this.language):"No filter set is selected"}getLink(t){const e=c({targetLimetype:t?this.limetypes[t.limetype]:void 0,currentLimetype:this.context.limetype?this.limetypes[this.context.limetype]:void 0,contextLimetypeName:this.context.limetype,contextId:this.context.id,propertyName:this.propertyName});return{href:p(t,e&&this.context.id?[{key:e,op:s.EQUALS,exp:this.context.id}]:[])}}getFilter(){return function(t,e){if(t&&e)return t.find((t=>t.id===e))}(this.filters,this.filterId)}getFormatter(t){return new y(this.language).createFormatter(this.format,t)}get translator(){return this.platform.get(o.Translate)}get language(){return this.platform.get(o.Application).getLanguage()}get loader(){return new f(this.platform,this.filters)}registerContextProvider(){const t=this.platform.get(o.AIContextRegistry);if(!(null==t?void 0:t.register))return;const e=new u((()=>{const t=this.getFilter();return{limetype:null==t?void 0:t.limetype,filterId:this.filterId,filterName:t?d(t.name,this.language):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 this}static get watchers(){return{filterId:[{watchFilterId:0}],propertyName:[{watchPropertyName:0}],aggregateOperator:[{watchAggregateOperator:0}]}}static get style(){return":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)}"}},[1,"limebb-info-tile",{platform:[16],context:[16],filterId:[513,"filter-id"],disabled:[4],icon:[513],label:[1],prefix:[1],suffix:[1],propertyName:[1,"property-name"],aggregateOperator:[1,"aggregate-operator"],format:[16],config:[32],filters:[32],value:[32],loading:[32],error:[32],limetypes:[32]},void 0,{filterId:[{watchFilterId:0}],propertyName:[{watchPropertyName:0}],aggregateOperator:[{watchAggregateOperator:0}]}]);w([n({})],x.prototype,"config",void 0),w([a()],x.prototype,"filters",void 0),w([l()],x.prototype,"limetypes",void 0);const O=x,I=function(){"undefined"!=typeof customElements&&["limebb-info-tile"].forEach((t=>{"limebb-info-tile"===t&&(customElements.get(r(t))||customElements.define(r(t),x))}))};export{O as LimebbInfoTile,I as defineCustomElement}
|