@limetech/lime-crm-building-blocks 1.105.2 → 1.106.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/{index-ff255a0d.js → index-519b904a.js} +4 -1
- package/dist/cjs/{index.esm-d785eb6e.js → index.esm-b68bd570.js} +398 -268
- package/dist/cjs/lime-crm-building-blocks.cjs.js +2 -2
- package/dist/cjs/{lime-query-validation-6d419d03.js → lime-query-validation-5eb432fe.js} +7 -7
- package/dist/cjs/limebb-browser.cjs.entry.js +2 -2
- package/dist/cjs/limebb-chat-item_2.cjs.entry.js +2 -2
- package/dist/cjs/limebb-chat-list.cjs.entry.js +2 -2
- package/dist/cjs/limebb-component-config.cjs.entry.js +2 -2
- package/dist/cjs/limebb-component-picker.cjs.entry.js +2 -2
- package/dist/cjs/limebb-currency-picker.cjs.entry.js +2 -2
- package/dist/cjs/limebb-dashboard-widget.cjs.entry.js +1 -1
- package/dist/cjs/limebb-date-picker.cjs.entry.js +2 -2
- package/dist/cjs/limebb-date-range.cjs.entry.js +1 -1
- package/dist/cjs/limebb-document-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-document-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-empty-state.cjs.entry.js +1 -1
- package/dist/cjs/limebb-feed-item-thumbnail-file-info.cjs.entry.js +1 -1
- package/dist/cjs/limebb-feed-timeline-item.cjs.entry.js +2 -2
- package/dist/cjs/limebb-feed.cjs.entry.js +2 -2
- package/dist/cjs/limebb-icon-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-info-tile-currency-format.cjs.entry.js +1 -1
- package/dist/cjs/limebb-info-tile-date-format.cjs.entry.js +1 -1
- package/dist/cjs/limebb-info-tile-decimal-format.cjs.entry.js +1 -1
- package/dist/cjs/limebb-info-tile-format.cjs.entry.js +1 -1
- package/dist/cjs/limebb-info-tile-relative-date-format.cjs.entry.js +1 -1
- package/dist/cjs/limebb-info-tile-unit-format.cjs.entry.js +1 -1
- package/dist/cjs/limebb-info-tile.cjs.entry.js +126 -7
- package/dist/cjs/limebb-kanban-group.cjs.entry.js +3 -3
- package/dist/cjs/limebb-kanban-item.cjs.entry.js +2 -2
- package/dist/cjs/limebb-kanban.cjs.entry.js +1 -1
- package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +4 -4
- package/dist/cjs/limebb-lime-query-filter-builder_3.cjs.entry.js +7 -7
- package/dist/cjs/limebb-lime-query-filter-comparison_2.cjs.entry.js +18 -18
- package/dist/cjs/limebb-lime-query-filter-group_3.cjs.entry.js +12 -12
- package/dist/cjs/limebb-lime-query-order-by-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-lime-query-response-format-builder.cjs.entry.js +4 -4
- package/dist/cjs/limebb-lime-query-response-format-editor_2.cjs.entry.js +1 -1
- package/dist/cjs/limebb-limeobject-file-viewer.cjs.entry.js +4 -4
- package/dist/cjs/limebb-live-docs-info.cjs.entry.js +1 -1
- package/dist/cjs/limebb-loader.cjs.entry.js +3 -3
- package/dist/cjs/limebb-locale-picker.cjs.entry.js +2 -2
- package/dist/cjs/limebb-mention-group-counter.cjs.entry.js +1 -1
- package/dist/cjs/limebb-mention.cjs.entry.js +2 -2
- package/dist/cjs/limebb-navigation-button_2.cjs.entry.js +1 -1
- package/dist/cjs/limebb-notification-item.cjs.entry.js +2 -2
- package/dist/cjs/limebb-notification-list.cjs.entry.js +2 -2
- package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +1 -1
- package/dist/cjs/limebb-property-selector.cjs.entry.js +4 -4
- package/dist/cjs/limebb-text-editor-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-text-editor.cjs.entry.js +6 -6
- package/dist/cjs/limebb-trend-indicator.cjs.entry.js +1 -1
- package/dist/cjs/{limetype-f2e4376e.js → limetype-b91060e7.js} +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/chat-list/chat-item/chat-item.css +3 -0
- package/dist/collection/components/chat-list/chat-list.css +3 -0
- package/dist/collection/components/document-picker/document-picker.css +3 -0
- package/dist/collection/components/feed/feed-item/feed-timeline-item.css +3 -0
- package/dist/collection/components/feed/feed-item-thumbnail-file-info/feed-item-thumbnail-file-info.css +3 -0
- package/dist/collection/components/info-tile/info-tile-context-provider.js +46 -0
- package/dist/collection/components/info-tile/info-tile.js +78 -4
- package/dist/collection/components/kanban/kanban-group/kanban-group.css +3 -0
- package/dist/collection/components/kanban/kanban-item/kanban-item.css +3 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-expression.css +3 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.css +3 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.css +3 -0
- package/dist/collection/components/lime-query-builder/response-format/response-format-item.css +3 -0
- package/dist/collection/components/navigation-button/navigation-button.css +3 -0
- package/dist/collection/components/notification-list/notification-item/notification-item.css +3 -0
- package/dist/collection/components/notification-list/notification-list.css +3 -0
- package/dist/collection/components/percentage-visualizer/percentage-visualizer.css +3 -0
- package/dist/collection/components/trend-indicator/trend-indicator.css +3 -0
- package/dist/components/index.esm.js +389 -259
- package/dist/components/kanban-group.js +2 -2
- package/dist/components/lime-query-filter-builder.js +5 -5
- package/dist/components/lime-query-filter-comparison.js +14 -14
- package/dist/components/lime-query-filter-expression.js +12 -12
- package/dist/components/lime-query-validation.js +7 -7
- package/dist/components/lime-query-value-input.js +3 -3
- package/dist/components/limebb-info-tile.js +127 -7
- package/dist/components/limebb-lime-query-builder.js +2 -2
- package/dist/components/limebb-lime-query-response-format-builder.js +2 -2
- package/dist/components/limebb-limeobject-file-viewer.js +3 -3
- package/dist/components/limebb-loader.js +2 -2
- package/dist/components/limebb-text-editor.js +4 -4
- package/dist/components/limetype.js +2 -2
- package/dist/components/property-selector.js +2 -2
- package/dist/esm/{index-96dd111f.js → index-d86e55c0.js} +4 -2
- package/dist/esm/{index.esm-bb569663.js → index.esm-863d7783.js} +389 -259
- package/dist/esm/lime-crm-building-blocks.js +3 -3
- package/dist/esm/{lime-query-validation-237ee440.js → lime-query-validation-84253575.js} +7 -7
- package/dist/esm/limebb-browser.entry.js +2 -2
- package/dist/esm/limebb-chat-item_2.entry.js +2 -2
- package/dist/esm/limebb-chat-list.entry.js +2 -2
- package/dist/esm/limebb-component-config.entry.js +2 -2
- package/dist/esm/limebb-component-picker.entry.js +2 -2
- package/dist/esm/limebb-currency-picker.entry.js +2 -2
- package/dist/esm/limebb-dashboard-widget.entry.js +1 -1
- package/dist/esm/limebb-date-picker.entry.js +2 -2
- package/dist/esm/limebb-date-range.entry.js +1 -1
- package/dist/esm/limebb-document-item.entry.js +1 -1
- package/dist/esm/limebb-document-picker.entry.js +1 -1
- package/dist/esm/limebb-empty-state.entry.js +1 -1
- package/dist/esm/limebb-feed-item-thumbnail-file-info.entry.js +1 -1
- package/dist/esm/limebb-feed-timeline-item.entry.js +2 -2
- package/dist/esm/limebb-feed.entry.js +2 -2
- package/dist/esm/limebb-icon-picker.entry.js +1 -1
- package/dist/esm/limebb-info-tile-currency-format.entry.js +1 -1
- package/dist/esm/limebb-info-tile-date-format.entry.js +1 -1
- package/dist/esm/limebb-info-tile-decimal-format.entry.js +1 -1
- package/dist/esm/limebb-info-tile-format.entry.js +1 -1
- package/dist/esm/limebb-info-tile-relative-date-format.entry.js +1 -1
- package/dist/esm/limebb-info-tile-unit-format.entry.js +1 -1
- package/dist/esm/limebb-info-tile.entry.js +126 -7
- package/dist/esm/limebb-kanban-group.entry.js +3 -3
- package/dist/esm/limebb-kanban-item.entry.js +2 -2
- package/dist/esm/limebb-kanban.entry.js +1 -1
- package/dist/esm/limebb-lime-query-builder.entry.js +4 -4
- package/dist/esm/limebb-lime-query-filter-builder_3.entry.js +7 -7
- package/dist/esm/limebb-lime-query-filter-comparison_2.entry.js +18 -18
- package/dist/esm/limebb-lime-query-filter-group_3.entry.js +12 -12
- package/dist/esm/limebb-lime-query-order-by-item.entry.js +1 -1
- package/dist/esm/limebb-lime-query-response-format-builder.entry.js +4 -4
- package/dist/esm/limebb-lime-query-response-format-editor_2.entry.js +1 -1
- package/dist/esm/limebb-limeobject-file-viewer.entry.js +4 -4
- package/dist/esm/limebb-live-docs-info.entry.js +1 -1
- package/dist/esm/limebb-loader.entry.js +3 -3
- package/dist/esm/limebb-locale-picker.entry.js +2 -2
- package/dist/esm/limebb-mention-group-counter.entry.js +1 -1
- package/dist/esm/limebb-mention.entry.js +2 -2
- package/dist/esm/limebb-navigation-button_2.entry.js +1 -1
- package/dist/esm/limebb-notification-item.entry.js +2 -2
- package/dist/esm/limebb-notification-list.entry.js +2 -2
- package/dist/esm/limebb-percentage-visualizer.entry.js +1 -1
- package/dist/esm/limebb-property-selector.entry.js +4 -4
- package/dist/esm/limebb-text-editor-picker.entry.js +1 -1
- package/dist/esm/limebb-text-editor.entry.js +6 -6
- package/dist/esm/limebb-trend-indicator.entry.js +1 -1
- package/dist/esm/{limetype-c0e041f7.js → limetype-09477163.js} +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/{p-e9d23ef7.entry.js → p-0bab7df6.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-218b7f38.entry.js → p-0c290fd8.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-2fdcb868.entry.js → p-0da02112.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-3932077b.entry.js → p-17baea44.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-2673c79e.entry.js → p-228573ab.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-351de229.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-3b1fcd5b.js +1 -0
- package/dist/lime-crm-building-blocks/{p-6c56121c.entry.js → p-3da67f32.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-28346b49.entry.js → p-4653738d.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-568b7520.entry.js → p-4ca1caf4.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-3175883d.entry.js → p-4fa58e0e.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-52cf8641.js +2 -0
- package/dist/lime-crm-building-blocks/{p-7271f47a.entry.js → p-52fb8909.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-25e1a434.entry.js → p-579be797.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-eb81bceb.entry.js → p-5f12cdea.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-20bfca36.js → p-6aeb7b9b.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-1be0eec7.entry.js → p-77b97c9f.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-c0ec1ddf.entry.js → p-7c04361c.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-5464f0de.entry.js → p-7ce112a7.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-9031f136.entry.js → p-85cae2a1.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-61282e1a.entry.js → p-92062bd6.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-10ac8b3e.entry.js → p-937e9144.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-09ce8be4.entry.js → p-9624acfd.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-3a406a20.entry.js → p-973146f7.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-8491aaa1.entry.js → p-9b4617bd.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-ef042c82.entry.js → p-9d41c07e.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-9f2a9cf5.js +1 -0
- package/dist/lime-crm-building-blocks/{p-fdd5600b.entry.js → p-a9160103.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-03af0e66.entry.js → p-a9807878.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-80b9d946.entry.js → p-a9ef0153.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-7d2188aa.entry.js → p-aec5cbca.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-2faaacbc.entry.js → p-b4bd67e2.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-19ff678d.entry.js → p-bd6b5a42.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-098ee6c1.entry.js → p-bd92871a.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-9c2062bc.entry.js → p-c3c0c738.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-ff0b244b.entry.js → p-c678ba6d.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-ee1b00b9.entry.js → p-cbbcec09.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-cfa1a4ad.entry.js → p-d51d607b.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-00da9b24.entry.js → p-d880ba5e.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-761c7c7c.entry.js → p-da511a18.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-f7ea292d.entry.js → p-dd6861b1.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-ddfd5196.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-32534eb7.entry.js → p-e03755ed.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-292631ea.entry.js → p-e79f16ca.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-8c4eb49f.entry.js → p-eaf58ba4.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-01cff04f.entry.js → p-eb56d4eb.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-ee0e42dd.entry.js → p-f1eee3bb.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-5dc574a3.entry.js → p-f97ea913.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-4caa8bbe.entry.js → p-fb292b3f.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-bc18b0e7.entry.js → p-fc92dab6.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-f52125a0.entry.js → p-fcb3499b.entry.js} +1 -1
- package/dist/types/components/info-tile/info-tile-context-provider.d.ts +35 -0
- package/dist/types/components/info-tile/info-tile.d.ts +7 -0
- package/package.json +4 -4
- package/dist/lime-crm-building-blocks/p-11aa4103.js +0 -1
- package/dist/lime-crm-building-blocks/p-1556b545.js +0 -2
- package/dist/lime-crm-building-blocks/p-206575e4.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-4838284a.js +0 -1
- package/dist/lime-crm-building-blocks/p-a200954f.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as i,H as r}from"./p-1556b545.js";import{Z as s,T as l}from"./p-4838284a.js";import{g as o}from"./p-b02c99d5.js";function n(){return{key:"",op:s.EQUALS,exp:""}}function a(e,t){return{op:e.op,exp:[...e.exp,t]}}const h=class{constructor(r){e(this,r),this.expressionChange=t(this,"expressionChange",7),this.options=[{text:"All",secondaryText:"AND operator",value:"and"},{text:"Any",secondaryText:"OR operator",value:"or"}],this.renderChildExpression=(e,t)=>i("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?s.AND:s.OR)!==this.expression.op){const e={op:(i=this.expression).op===s.AND?s.OR:s.AND,exp:[...i.exp]};this.expressionChange.emit(e)}var i},this.handleAddChildExpression=()=>{const e=n(),t=a(this.expression,e);this.expressionChange.emit(t)},this.handleAddChildGroup=()=>{const e={op:this.expression.op===s.AND?s.OR:s.AND,exp:[n()]},t=a(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===s.AND?"and":"or")))||this.options[0]}render(){return i(r,{key:"324805229eab509d12b6d41a99a54c1a4d8560a1",style:{"--limebb-lime-query-filter-group-operator":`"${this.expression.op===s.AND?"AND":"OR"}"`}},i("div",{key:"948dda71aac51cbfd8b93bc657a79c00a6bd6f68",class:"expression"},this.renderHeader(),i("ul",{key:"b1dbce8f4f20f72e00567d431eed0fe5900f4fbf"},this.expression.exp.map(this.renderChildExpression),this.renderAddButton()),this.renderAddGroupButton()))}renderHeader(){const e=this.getSubheading();return e?i("limel-header",{subheading:e},this.renderOperators(),this.renderDeleteGroupButton()):null}renderOperators(){return i("limel-select",{class:"operator-select",slot:"actions",value:this.value,options:this.options,onChange:this.handleToggleOperator})}renderDeleteGroupButton(){return i("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===s.AND?"All of these conditions are met":"Any of these conditions are met"}renderAddButton(){return i("limel-button",{role:"listitem",label:"Condition",icon:{name:"plus_math",title:"Add"},onClick:this.handleAddChildExpression})}renderAddGroupButton(){return i("limel-button",{class:"add-group",label:"Group",icon:{name:"plus_math",title:"Add"},onClick:this.handleAddChildGroup})}};h.style='@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}';const c=class{constructor(i){e(this,i),this.expressionChange=t(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:s.NOT,exp:i}:void 0)}}render(){return i("div",{key:"8f234a17a56f899640f503dcc58e6ef7d8e6a998",class:"expression"},this.label&&i("limel-header",{key:"1e71be2c56690aa3c603c88028860093b54a2a84",heading:this.label}),i("limebb-lime-query-filter-expression",{key:"1fde4344ca12d9ced489ee8e4f1b9de806da1dc4",platform:this.platform,context:this.context,label:"Not",limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.expression.exp,onExpressionChange:this.handleExpressionChange}))}};c.style='@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))}';const d={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=class{constructor(i){e(this,i),this.change=t(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?i(r,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 i("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 i("div",{class:"placeholder-input"},i("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 i("div",{class:"placeholder-preview"},i("limel-icon",{name:"info",size:"small"}),i("span",null,"Placeholder: ",this.value))}renderValueInputByType(){if(this.operator===s.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 d[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 i("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 r="integer"===e?1:.01;return i("limel-input-field",{label:this.label,type:"number",value:(null===(t=this.value)||void 0===t?void 0:t.toString())||"",step:r,onChange:this.handleTextChange})}renderBooleanInput(){const e=[{text:"True",value:"true"},{text:"False",value:"false"}],t=!0===this.value||"true"===this.value?"true":"false",r=e.find((e=>e.value===t));return i("limel-select",{label:this.label,options:e,value:r,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}))),r=t.find((e=>e.value===this.value));return i("limel-select",{label:this.label,options:t,value:r,onChange:this.handleSelectChange})}renderDateTimeInput(e){const t="string"==typeof this.value?new Date(this.value):this.value;return i("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 i("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)}};(function(e,t,i,r){var s,l=arguments.length,o=l<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(o=(l<3?s(o):l>3?s(t,i,o):s(t,i))||o);l>3&&o&&Object.defineProperty(t,i,o)})([l()],p.prototype,"limetypes",void 0),p.style=":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}";export{h as limebb_lime_query_filter_group,c as limebb_lime_query_filter_not,p as limebb_lime_query_value_input}
|
|
1
|
+
import{r as e,c as t,h as i,H as r}from"./p-52cf8641.js";import{r as s,Z as l}from"./p-3b1fcd5b.js";import{g as o}from"./p-b02c99d5.js";function n(){return{key:"",op:s.EQUALS,exp:""}}function a(e,t){return{op:e.op,exp:[...e.exp,t]}}const h=class{constructor(r){e(this,r),this.expressionChange=t(this,"expressionChange",7),this.options=[{text:"All",secondaryText:"AND operator",value:"and"},{text:"Any",secondaryText:"OR operator",value:"or"}],this.renderChildExpression=(e,t)=>i("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?s.AND:s.OR)!==this.expression.op){const e={op:(i=this.expression).op===s.AND?s.OR:s.AND,exp:[...i.exp]};this.expressionChange.emit(e)}var i},this.handleAddChildExpression=()=>{const e=n(),t=a(this.expression,e);this.expressionChange.emit(t)},this.handleAddChildGroup=()=>{const e={op:this.expression.op===s.AND?s.OR:s.AND,exp:[n()]},t=a(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===s.AND?"and":"or")))||this.options[0]}render(){return i(r,{key:"324805229eab509d12b6d41a99a54c1a4d8560a1",style:{"--limebb-lime-query-filter-group-operator":`"${this.expression.op===s.AND?"AND":"OR"}"`}},i("div",{key:"948dda71aac51cbfd8b93bc657a79c00a6bd6f68",class:"expression"},this.renderHeader(),i("ul",{key:"b1dbce8f4f20f72e00567d431eed0fe5900f4fbf"},this.expression.exp.map(this.renderChildExpression),this.renderAddButton()),this.renderAddGroupButton()))}renderHeader(){const e=this.getSubheading();return e?i("limel-header",{subheading:e},this.renderOperators(),this.renderDeleteGroupButton()):null}renderOperators(){return i("limel-select",{class:"operator-select",slot:"actions",value:this.value,options:this.options,onChange:this.handleToggleOperator})}renderDeleteGroupButton(){return i("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===s.AND?"All of these conditions are met":"Any of these conditions are met"}renderAddButton(){return i("limel-button",{role:"listitem",label:"Condition",icon:{name:"plus_math",title:"Add"},onClick:this.handleAddChildExpression})}renderAddGroupButton(){return i("limel-button",{class:"add-group",label:"Group",icon:{name:"plus_math",title:"Add"},onClick:this.handleAddChildGroup})}};h.style='@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}';const c=class{constructor(i){e(this,i),this.expressionChange=t(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:s.NOT,exp:i}:void 0)}}render(){return i("div",{key:"8f234a17a56f899640f503dcc58e6ef7d8e6a998",class:"expression"},this.label&&i("limel-header",{key:"1e71be2c56690aa3c603c88028860093b54a2a84",heading:this.label}),i("limebb-lime-query-filter-expression",{key:"1fde4344ca12d9ced489ee8e4f1b9de806da1dc4",platform:this.platform,context:this.context,label:"Not",limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.expression.exp,onExpressionChange:this.handleExpressionChange}))}};c.style='@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))}';const d={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=class{constructor(i){e(this,i),this.change=t(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?i(r,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 i("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 i("div",{class:"placeholder-input"},i("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 i("div",{class:"placeholder-preview"},i("limel-icon",{name:"info",size:"small"}),i("span",null,"Placeholder: ",this.value))}renderValueInputByType(){if(this.operator===s.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 d[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 i("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 r="integer"===e?1:.01;return i("limel-input-field",{label:this.label,type:"number",value:(null===(t=this.value)||void 0===t?void 0:t.toString())||"",step:r,onChange:this.handleTextChange})}renderBooleanInput(){const e=[{text:"True",value:"true"},{text:"False",value:"false"}],t=!0===this.value||"true"===this.value?"true":"false",r=e.find((e=>e.value===t));return i("limel-select",{label:this.label,options:e,value:r,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}))),r=t.find((e=>e.value===this.value));return i("limel-select",{label:this.label,options:t,value:r,onChange:this.handleSelectChange})}renderDateTimeInput(e){const t="string"==typeof this.value?new Date(this.value):this.value;return i("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 i("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)}};(function(e,t,i,r){var s,l=arguments.length,o=l<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(o=(l<3?s(o):l>3?s(t,i,o):s(t,i))||o);l>3&&o&&Object.defineProperty(t,i,o)})([l()],p.prototype,"limetypes",void 0),p.style=":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}";export{h as limebb_lime_query_filter_group,c as limebb_lime_query_filter_not,p as limebb_lime_query_value_input}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as t,H as i}from"./p-1556b545.js";import{c as r}from"./p-4838284a.js";const a=class{constructor(t){e(this,t),this.hasError=!1,this.createActionBarItem=e=>{var t,i;if("separator"in e)return e;let r={value:e,text:null!==(t=e.label)&&void 0!==t?t:"",secondaryText:e.description,disabled:e.disabled};return!e.label&&e.icon?r=Object.assign(Object.assign({},r),{icon:e.icon,text:null!==(i=e.description)&&void 0!==i?i:r.text,iconOnly:!0}):e.icon&&(r=Object.assign(Object.assign({},r),{icon:e.icon})),r},this.handleActionBarItemSelect=e=>{var t;e.stopPropagation();const i=null===(t=e.detail.value)||void 0===t?void 0:t.command;i&&this.commandbus.handle(i)},this.createMenuItem=e=>{var t,i;return"separator"in e?e:{value:e,text:null!==(t=e.label)&&void 0!==t?t:"",secondaryText:e.description,disabled:e.disabled,icon:null!==(i=e.icon)&&void 0!==i?i:""}},this.handleMenuItemSelect=e=>{var t;e.stopPropagation();const i=null===(t=e.detail.value)||void 0===t?void 0:t.command;i&&this.commandbus.handle(i)}}render(){const e=`helper-text-${this.item.id}`;return t(i,{key:"194f72f603860f5426708190e5eaecaad7082bab",id:this.item.id,"aria-describedby":this.helperText?e:void 0,"aria-live":this.hasError?"assertive":"off",class:{[`${this.item.ui}`]:!0}},t("div",{key:"f8ebc3774ec707c9a755092b17c634f8dcc9b787",class:"bubble-content"},t("div",{key:"46ba28aec47cc1ecfd6752d9e03ee7471b47bb17",class:"icon-picture"},this.renderIcon(),this.renderAuthorPicture()),this.renderErrorSign(),t("div",{key:"eebe6ac230b4f4ba182229377984eb83a3e83570",class:"item"},this.renderHeader(),this.renderValue(),t("footer",{key:"f349fb88d701726af5793d35adce4d0880a1dbea"},this.renderHelperText(e),this.renderTimestamp()))),this.renderPromotedAction())}renderErrorSign(){if(this.hasError)return t("limel-icon",{class:"error-sign",name:"brake_warning"})}renderHeader(){var e;if(null===(e=this.item.author)||void 0===e?void 0:e.name)return t("header",null,this.renderAuthorName(),t("div",{class:"action-buttons"},this.renderUnpromotedActionsMenu()))}renderIcon(){var e,i,r,a;if(this.item.icon)return t("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===(r=this.item.icon)||void 0===r?void 0:r.color}`,"background-color":`${null===(a=this.item.icon)||void 0===a?void 0:a.backgroundColor}`}})}renderHelperText(e){if(this.helperText)return t("span",{class:"helper-text",id:e},this.helperText)}renderValue(){if(this.item.value)return t("limel-markdown",{class:"body-text reset-img-height",value:this.item.value})}renderAuthorName(){var e,i;if("string"==typeof(null===(e=this.item.author)||void 0===e?void 0:e.name))return t("span",{class:"author"},this.item.author.name);if("object"==typeof(null===(i=this.item.author)||void 0===i?void 0:i.name)){const{href:e,title:i,text:r}=this.item.author.name;return t("a",{class:"author",href:e,title:i},r)}}renderAuthorPicture(){var e;if(null===(e=this.item.author)||void 0===e?void 0:e.picture)return"limel-ai-avatar"===this.item.author.picture?t("limel-ai-avatar",{class:"author-avatar"}):t("img",{class:"author-avatar",loading:"lazy",src:this.item.author.picture})}renderUnpromotedActionsMenu(){var e,i;if(!(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length))return;const r=this.item.unpromotedActions.map(this.createMenuItem);return t("limel-menu",{class:"unpromoted-actions-menu",items:r,openDirection:"bottom-end",onSelect:this.handleMenuItemSelect},t("limel-icon-button",{icon:"menu_2",slot:"trigger",label:null===(i=this.translator)||void 0===i?void 0:i.get("webclient.more-actions")}))}renderPromotedAction(){if(!this.item.promotedActions)return;const e=this.item.promotedActions.map(this.createActionBarItem);return t("div",{class:"action-bar"},t("div",{class:"action-bar-hider"},t("limel-action-bar",{accessibleLabel:"Action bar",actions:e,layout:"fullWidth",onItemSelected:this.handleActionBarItemSelect})))}renderTimestamp(){const e=this.item.timestamp;if(e)return t("span",{class:"timestamp"},this.dateTimeFormatter.format(e,"timeofday"))}get dateTimeFormatter(){return this.platform.get(r.DateTimeFormatter)}get translator(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(r.Translate)}get commandbus(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(r.CommandBus)}};a.style='@charset "UTF-8";*{box-sizing:border-box}:host(limebb-chat-item){display:flex;flex-direction:column;gap:0.25rem;min-width:0;min-height:0;max-width:calc(100% - 2rem)}.bubble-content{display:flex;gap:0.25rem;min-width:0;min-height:0}:host(limebb-chat-item:hover) .helper-text,:host(limebb-chat-item:hover) .timestamp,:host(limebb-chat-item:focus-within) .helper-text,:host(limebb-chat-item:focus-within) .timestamp{opacity:1}:host(limebb-chat-item.mine){margin-left:auto}:host(limebb-chat-item.mine) .item{border-bottom-right-radius:0.125rem;background-color:rgb(var(--color-sky-default), 0.2)}:host(limebb-chat-item.mine) .bubble-content{justify-content:end}:host(limebb-chat-item.mine) .icon-picture{order:2}:host(limebb-chat-item.theirs){margin-right:auto}:host(limebb-chat-item.theirs) .item{border-bottom-left-radius:0.125rem;background-color:rgb(var(--contrast-300), 0.7)}.item{display:flex;flex-direction:column;border-radius:1.25rem;padding:0 0.25rem 0.25rem 0.25rem;backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem)}.icon-picture{display:flex;flex-direction:column;gap:0.5rem;align-items:center;justify-content:flex-end}.icon-picture:has(.author-avatar) limel-icon{width:1.25rem;padding:0.125rem}.icon{--icon-background-color:rgb(var(--contrast-500), 0.5);flex-shrink:0;padding:0.375rem;width:2.25rem;backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem)}limel-ai-avatar.author-avatar{background-color:rgb(var(--color-glaucous-darker))}header{display:flex;justify-content:space-between;align-items:center;min-height:2rem;padding-left:0.5rem}header:not(:has(.unpromoted-actions-menu)){padding-right:0.5rem}.body-text{padding:0.25rem 0.5rem}footer{display:flex;justify-content:space-between;align-items:end;gap:0.5rem;font-size:x-small}footer:not(:empty){padding:0 0.25rem 0.125rem 0.5rem}footer *{transition:opacity 0.2s ease;opacity:0.4}.timestamp{margin-left:auto}.author-avatar{border-radius:50%;width:2rem;height:2rem;object-fit:cover;box-shadow:0 0 0 1px rgb(var(--contrast-600))}.author{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:500;text-decoration:none}a.author{position:relative;cursor:pointer;transition:color 0.2s ease;color:var(--mdc-theme-primary)}a.author: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)}a.author:hover{color:rgb(var(--color-teal-light))}a.author:hover:before{opacity:0.3;transform:scale(1)}limel-action-bar{--action-bar-item-height:1.75rem;transition:opacity 0.2s ease;justify-content:flex-start;opacity:0.8}.action-bar{display:grid;transition:grid-template-rows var(--limebb-promoted-action-bar-grid-template-rows-transition-speed, 0.2s) cubic-bezier(1, 0.09, 0, 0.89) var(--limebb-promoted-action-bar-grid-template-rows-transition-delay, 0s);grid-template-rows:var(--limebb-promoted-action-bar-grid-template-rows, 1fr)}.action-bar-hider{overflow:hidden}limel-action-bar{transition:padding var(--limebb-promoted-action-bar-grid-template-rows-transition-speed) cubic-bezier(1, 0.09, 0, 0.89) var(--limebb-promoted-action-bar-grid-template-rows-transition-delay);padding-top:0;padding-bottom:0.75rem}:host(limebb-chat-item:hover) .action-bar,:host(limebb-chat-item:focus-within) .action-bar,:host(limebb-chat-item:focus-visible) .action-bar{--limebb-promoted-action-bar-grid-template-rows:1fr;will-change:grid-template-rows}:host(limebb-chat-item:hover) limel-action-bar,:host(limebb-chat-item:focus-within) limel-action-bar,:host(limebb-chat-item:focus-visible) limel-action-bar{will-change:opacity;opacity:1}:host(limebb-chat-item:hover),:host(limebb-chat-item:focus-within){--limebb-promoted-action-bar-grid-template-rows-transition-speed:0.46s;--limebb-promoted-action-bar-grid-template-rows-transition-delay:0.7s}.action-bar{min-width:0;width:calc(100% - calc(2rem + 0.25rem))}:host(limebb-chat-item.theirs) .action-bar{margin-left:calc(2rem + 0.25rem)}:host(limebb-chat-item[has-error]:not([has-error=false])) .bubble-content{cursor:help}:host(limebb-chat-item[has-error]:not([has-error=false])) .item{border:1px solid rgb(var(--color-red-default))}:host(limebb-chat-item[has-error]:not([has-error=false])) .error-sign{color:rgb(var(--color-red-default));flex-shrink:0;width:1.25rem;align-self:center}:host(limebb-chat-item.mine[has-error]:not([has-error=false])) .action-bar{padding-left:1.25rem}:host(limebb-chat-item.mine[has-error]:not([has-error=false])) .helper-text{opacity:1;color:rgb(var(--color-red-default))}';const o=class{constructor(t){e(this,t)}render(){return t("div",{key:"4acffbefa03eb7605db612242ebfcbba15522d42",class:"typing-ellipsis"},t("div",{key:"9911cf59740e060dc74e88d569083c0ecfa0a891",class:"circle"}),t("div",{key:"ebbe4137c147c84322c47c39b847c8f8bc00a7b0",class:"circle"}),t("div",{key:"9118c496ffe0eb308716f8c7fbea518bd607731a",class:"circle"}))}};o.style="*{box-sizing:border-box}.typing-ellipsis{position:relative;display:inline-flex;align-items:center;gap:0.25rem;height:1.5rem;padding:0 0.5rem;border-radius:10rem;border-bottom-left-radius:0.125rem;background-color:rgb(var(--contrast-600), 0.4);backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem)}.circle{position:relative;height:0.5rem;width:0.5rem;background:rgb(var(--contrast-800));border-radius:50%}.circle:first-of-type{animation:ellipsis-typing-indicator 1.2s infinite}.circle:nth-of-type(2){animation:ellipsis-typing-indicator 1.2s infinite 0.2s}.circle:nth-of-type(3){animation:ellipsis-typing-indicator 1.2s infinite 0.4s}@keyframes ellipsis-typing-indicator{0%{top:0}6.25%{top:-1px}12.5%{top:0;background:rgb(var(--contrast-1000))}18.75%{top:1px}25%{top:0}}";export{a as limebb_chat_item,o as limebb_typing_indicator}
|
|
1
|
+
import{r as e,h as t,H as i}from"./p-52cf8641.js";import{c as r}from"./p-3b1fcd5b.js";const a=class{constructor(t){e(this,t),this.hasError=!1,this.createActionBarItem=e=>{var t,i;if("separator"in e)return e;let r={value:e,text:null!==(t=e.label)&&void 0!==t?t:"",secondaryText:e.description,disabled:e.disabled};return!e.label&&e.icon?r=Object.assign(Object.assign({},r),{icon:e.icon,text:null!==(i=e.description)&&void 0!==i?i:r.text,iconOnly:!0}):e.icon&&(r=Object.assign(Object.assign({},r),{icon:e.icon})),r},this.handleActionBarItemSelect=e=>{var t;e.stopPropagation();const i=null===(t=e.detail.value)||void 0===t?void 0:t.command;i&&this.commandbus.handle(i)},this.createMenuItem=e=>{var t,i;return"separator"in e?e:{value:e,text:null!==(t=e.label)&&void 0!==t?t:"",secondaryText:e.description,disabled:e.disabled,icon:null!==(i=e.icon)&&void 0!==i?i:""}},this.handleMenuItemSelect=e=>{var t;e.stopPropagation();const i=null===(t=e.detail.value)||void 0===t?void 0:t.command;i&&this.commandbus.handle(i)}}render(){const e=`helper-text-${this.item.id}`;return t(i,{key:"194f72f603860f5426708190e5eaecaad7082bab",id:this.item.id,"aria-describedby":this.helperText?e:void 0,"aria-live":this.hasError?"assertive":"off",class:{[`${this.item.ui}`]:!0}},t("div",{key:"f8ebc3774ec707c9a755092b17c634f8dcc9b787",class:"bubble-content"},t("div",{key:"46ba28aec47cc1ecfd6752d9e03ee7471b47bb17",class:"icon-picture"},this.renderIcon(),this.renderAuthorPicture()),this.renderErrorSign(),t("div",{key:"eebe6ac230b4f4ba182229377984eb83a3e83570",class:"item"},this.renderHeader(),this.renderValue(),t("footer",{key:"f349fb88d701726af5793d35adce4d0880a1dbea"},this.renderHelperText(e),this.renderTimestamp()))),this.renderPromotedAction())}renderErrorSign(){if(this.hasError)return t("limel-icon",{class:"error-sign",name:"brake_warning"})}renderHeader(){var e;if(null===(e=this.item.author)||void 0===e?void 0:e.name)return t("header",null,this.renderAuthorName(),t("div",{class:"action-buttons"},this.renderUnpromotedActionsMenu()))}renderIcon(){var e,i,r,a;if(this.item.icon)return t("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===(r=this.item.icon)||void 0===r?void 0:r.color}`,"background-color":`${null===(a=this.item.icon)||void 0===a?void 0:a.backgroundColor}`}})}renderHelperText(e){if(this.helperText)return t("span",{class:"helper-text",id:e},this.helperText)}renderValue(){if(this.item.value)return t("limel-markdown",{class:"body-text reset-img-height",value:this.item.value})}renderAuthorName(){var e,i;if("string"==typeof(null===(e=this.item.author)||void 0===e?void 0:e.name))return t("span",{class:"author"},this.item.author.name);if("object"==typeof(null===(i=this.item.author)||void 0===i?void 0:i.name)){const{href:e,title:i,text:r}=this.item.author.name;return t("a",{class:"author",href:e,title:i},r)}}renderAuthorPicture(){var e;if(null===(e=this.item.author)||void 0===e?void 0:e.picture)return"limel-ai-avatar"===this.item.author.picture?t("limel-ai-avatar",{class:"author-avatar"}):t("img",{class:"author-avatar",loading:"lazy",src:this.item.author.picture})}renderUnpromotedActionsMenu(){var e,i;if(!(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length))return;const r=this.item.unpromotedActions.map(this.createMenuItem);return t("limel-menu",{class:"unpromoted-actions-menu",items:r,openDirection:"bottom-end",onSelect:this.handleMenuItemSelect},t("limel-icon-button",{icon:"menu_2",slot:"trigger",label:null===(i=this.translator)||void 0===i?void 0:i.get("webclient.more-actions")}))}renderPromotedAction(){if(!this.item.promotedActions)return;const e=this.item.promotedActions.map(this.createActionBarItem);return t("div",{class:"action-bar"},t("div",{class:"action-bar-hider"},t("limel-action-bar",{accessibleLabel:"Action bar",actions:e,layout:"fullWidth",onItemSelected:this.handleActionBarItemSelect})))}renderTimestamp(){const e=this.item.timestamp;if(e)return t("span",{class:"timestamp"},this.dateTimeFormatter.format(e,"timeofday"))}get dateTimeFormatter(){return this.platform.get(r.DateTimeFormatter)}get translator(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(r.Translate)}get commandbus(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(r.CommandBus)}};a.style='@charset "UTF-8";*{box-sizing:border-box}:host(limebb-chat-item){display:flex;flex-direction:column;gap:0.25rem;min-width:0;min-height:0;max-width:calc(100% - 2rem)}.bubble-content{display:flex;gap:0.25rem;min-width:0;min-height:0}:host(limebb-chat-item:hover) .helper-text,:host(limebb-chat-item:hover) .timestamp,:host(limebb-chat-item:focus-within) .helper-text,:host(limebb-chat-item:focus-within) .timestamp{opacity:1}:host(limebb-chat-item.mine){margin-left:auto}:host(limebb-chat-item.mine) .item{border-bottom-right-radius:0.125rem;background-color:rgb(var(--color-sky-default), 0.2)}:host(limebb-chat-item.mine) .bubble-content{justify-content:end}:host(limebb-chat-item.mine) .icon-picture{order:2}:host(limebb-chat-item.theirs){margin-right:auto}:host(limebb-chat-item.theirs) .item{border-bottom-left-radius:0.125rem;background-color:rgb(var(--contrast-300), 0.7)}.item{display:flex;flex-direction:column;border-radius:1.25rem;padding:0 0.25rem 0.25rem 0.25rem;backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem)}.icon-picture{display:flex;flex-direction:column;gap:0.5rem;align-items:center;justify-content:flex-end}.icon-picture:has(.author-avatar) limel-icon{width:1.25rem;padding:0.125rem}.icon{--icon-background-color:rgb(var(--contrast-500), 0.5);flex-shrink:0;padding:0.375rem;width:2.25rem;backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem)}limel-ai-avatar.author-avatar{background-color:rgb(var(--color-glaucous-darker))}header{display:flex;justify-content:space-between;align-items:center;min-height:2rem;padding-left:0.5rem}header:not(:has(.unpromoted-actions-menu)){padding-right:0.5rem}.body-text{padding:0.25rem 0.5rem}footer{display:flex;justify-content:space-between;align-items:end;gap:0.5rem;font-size:x-small}footer:not(:empty){padding:0 0.25rem 0.125rem 0.5rem}footer *{transition:opacity 0.2s ease;opacity:0.4}.timestamp{margin-left:auto}.author-avatar{border-radius:50%;width:2rem;height:2rem;object-fit:cover;box-shadow:0 0 0 1px rgb(var(--contrast-600))}.author{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:500;text-decoration:none}a.author{position:relative;cursor:pointer;transition:color 0.2s ease;color:var(--mdc-theme-primary)}a.author: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)}a.author:hover{color:rgb(var(--color-teal-light))}a.author:hover:before{opacity:0.3;transform:scale(1)}limel-action-bar{--action-bar-item-height:1.75rem;transition:opacity 0.2s ease;justify-content:flex-start;opacity:0.8}.action-bar{display:grid;transition:grid-template-rows var(--limebb-promoted-action-bar-grid-template-rows-transition-speed, 0.2s) cubic-bezier(1, 0.09, 0, 0.89) var(--limebb-promoted-action-bar-grid-template-rows-transition-delay, 0s);grid-template-rows:var(--limebb-promoted-action-bar-grid-template-rows, 1fr)}.action-bar-hider{overflow:hidden}limel-action-bar{transition:padding var(--limebb-promoted-action-bar-grid-template-rows-transition-speed) cubic-bezier(1, 0.09, 0, 0.89) var(--limebb-promoted-action-bar-grid-template-rows-transition-delay);padding-top:0;padding-bottom:0.75rem}:host(limebb-chat-item:hover) .action-bar,:host(limebb-chat-item:focus-within) .action-bar,:host(limebb-chat-item:focus-visible) .action-bar{--limebb-promoted-action-bar-grid-template-rows:1fr;will-change:grid-template-rows}:host(limebb-chat-item:hover) limel-action-bar,:host(limebb-chat-item:focus-within) limel-action-bar,:host(limebb-chat-item:focus-visible) limel-action-bar{will-change:opacity;opacity:1}:host(limebb-chat-item:hover),:host(limebb-chat-item:focus-within){--limebb-promoted-action-bar-grid-template-rows-transition-speed:0.46s;--limebb-promoted-action-bar-grid-template-rows-transition-delay:0.7s}.action-bar{min-width:0;width:calc(100% - calc(2rem + 0.25rem))}:host(limebb-chat-item.theirs) .action-bar{margin-left:calc(2rem + 0.25rem)}:host(limebb-chat-item[has-error]:not([has-error=false])) .bubble-content{cursor:help}:host(limebb-chat-item[has-error]:not([has-error=false])) .item{border:1px solid rgb(var(--color-red-default))}:host(limebb-chat-item[has-error]:not([has-error=false])) .error-sign{color:rgb(var(--color-red-default));flex-shrink:0;width:1.25rem;align-self:center}:host(limebb-chat-item.mine[has-error]:not([has-error=false])) .action-bar{padding-left:1.25rem}:host(limebb-chat-item.mine[has-error]:not([has-error=false])) .helper-text{opacity:1;color:rgb(var(--color-red-default))}';const o=class{constructor(t){e(this,t)}render(){return t("div",{key:"4acffbefa03eb7605db612242ebfcbba15522d42",class:"typing-ellipsis"},t("div",{key:"9911cf59740e060dc74e88d569083c0ecfa0a891",class:"circle"}),t("div",{key:"ebbe4137c147c84322c47c39b847c8f8bc00a7b0",class:"circle"}),t("div",{key:"9118c496ffe0eb308716f8c7fbea518bd607731a",class:"circle"}))}};o.style="*{box-sizing:border-box}.typing-ellipsis{position:relative;display:inline-flex;align-items:center;gap:0.25rem;height:1.5rem;padding:0 0.5rem;border-radius:10rem;border-bottom-left-radius:0.125rem;background-color:rgb(var(--contrast-600), 0.4);backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem)}.circle{position:relative;height:0.5rem;width:0.5rem;background:rgb(var(--contrast-800));border-radius:50%}.circle:first-of-type{animation:ellipsis-typing-indicator 1.2s infinite}.circle:nth-of-type(2){animation:ellipsis-typing-indicator 1.2s infinite 0.2s}.circle:nth-of-type(3){animation:ellipsis-typing-indicator 1.2s infinite 0.4s}@keyframes ellipsis-typing-indicator{0%{top:0}6.25%{top:-1px}12.5%{top:0;background:rgb(var(--contrast-1000))}18.75%{top:1px}25%{top:0}}";export{a as limebb_chat_item,o as limebb_typing_indicator}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,h as i}from"./p-
|
|
1
|
+
import{r as t,c as e,h as i}from"./p-52cf8641.js";const o=class{constructor(i){t(this,i),this.change=e(this,"change",7),this.getOptionValue=t=>t.value,this.getAffixValue=t=>{if(t.value)return[t.value]},this.handleChangeOptions=(t,e=(t=>t))=>i=>{i.stopPropagation(),this.change.emit(Object.assign(Object.assign({},this.value),{options:Object.assign(Object.assign({},this.value.options),{[t]:e(i.detail)||void 0})}))},this.handleChangeAffix=t=>e=>{e.stopPropagation(),this.change.emit(Object.assign(Object.assign({},this.value),{[t]:this.getAffixValue(e.detail)}))}}render(){return[this.renderNotation(),this.renderCompactDisplay(),this.renderAffix("prefix"),this.renderAffix("suffix")]}renderNotation(){const t=[{text:"Standard",value:"standard"},{text:"Compact",value:"compact"}],e=t.find((t=>{var e;return t.value===(null===(e=this.value.options)||void 0===e?void 0:e.notation)}));return i("limel-select",{label:"Notation",helperText:"The formatting that should be displayed for the number",options:t,value:e,onChange:this.handleChangeOptions("notation",this.getOptionValue)})}renderCompactDisplay(){const t=[{text:"Short",value:"short"},{text:"Long",value:"long"}],e=t.find((t=>{var e;return t.value===(null===(e=this.value.options)||void 0===e?void 0:e.compactDisplay)}));return i("limel-select",{label:"Compact display",options:t,value:e,onChange:this.handleChangeOptions("compactDisplay",this.getOptionValue)})}renderAffix(t){const e=[{text:"",value:""},{text:"Compact notation",value:"compact"}],o=e.find((e=>{var i;return e.value&&(null===(i=this.value[t])||void 0===i?void 0:i.includes(e.value))}));return i("limel-select",{label:t.charAt(0).toUpperCase()+t.slice(1),options:e,value:o,onChange:this.handleChangeAffix(t)})}};export{o as limebb_info_tile_decimal_format}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,c as n,h as t}from"./p-
|
|
1
|
+
import{r,c as n,h as t}from"./p-52cf8641.js";import{c as u}from"./p-3b1fcd5b.js";import{t as e,c as i,a as f,i as o,g as a,b as c,d as s}from"./p-d298b34e.js";import{i as l,a as v,S as d,k as p}from"./p-35897ec3.js";import{d as h,i as b,S as m}from"./p-b31772c8.js";import{i as j,c as g,f as y,h as x}from"./p-5322fd19.js";import{b as w}from"./p-a659d55a.js";import{i as O}from"./p-7e6fb4af.js";import{d as k}from"./p-123190c3.js";import{e as A}from"./p-fe2b91d9.js";function S(r){return r}var _,E,R,U=Date.now,q=k?function(r,n){return k(r,"toString",{configurable:!0,enumerable:!1,value:(t=n,function(){return t}),writable:!0});var t}:S;const C=(_=q,E=0,R=0,function(){var r=U(),n=16-(r-R);if(R=r,n>0){if(++E>=800)return arguments[0]}else E=0;return _.apply(void 0,arguments)});var D=Math.max;function I(r,n,t){if(!h(t))return!1;var u=typeof n;return!!("number"==u?j(t)&&l(n,t.length):"string"==u&&n in t)&&A(t[n],r)}var L=m?m.isConcatSpreadable:void 0;function M(r){return b(r)||g(r)||!!(L&&r&&r[L])}function T(r,n,t,u,e){var i=-1,f=r.length;for(t||(t=M),e||(e=[]);++i<f;){var o=r[i];n>0&&t(o)?n>1?T(o,n-1,t,u,e):v(e,o):u||(e[e.length]=o)}return e}var W=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function z(r){return W.test(r)}var B="\\ud800-\\udfff",F="["+B+"]",G="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",H="\\ud83c[\\udffb-\\udfff]",J="[^"+B+"]",K="(?:\\ud83c[\\udde6-\\uddff]){2}",N="[\\ud800-\\udbff][\\udc00-\\udfff]",P="(?:"+G+"|"+H+")?",Q="[\\ufe0e\\ufe0f]?",V=Q+P+"(?:\\u200d(?:"+[J,K,N].join("|")+")"+Q+P+")*",X="(?:"+[J+G+"?",G,K,N,F].join("|")+")",Y=RegExp(H+"(?="+H+")|"+X+V,"g");const Z=function(r){var n,t,u,i,f=z(r=e(r))?function(r){return z(r)?function(r){return r.match(Y)||[]}(r):function(r){return r.split("")}(r)}(r):void 0,o=f?f[0]:r.charAt(0),a=f?(n=f,t=1,i=n.length,u=void 0===u?i:u,!t&&u>=i?n:function(r,n,t){var u=-1,e=r.length;n<0&&(n=-n>e?0:e+n),(t=t>e?e:t)<0&&(t+=e),e=n>t?0:t-n>>>0,n>>>=0;for(var i=Array(e);++u<e;)i[u]=r[u+n];return i}(n,t,u)).join(""):r.slice(1);return o.toUpperCase()+a};var $=1,rr=2;function nr(r){return r==r&&!h(r)}function tr(r,n){return function(t){return null!=t&&t[r]===n&&(void 0!==n||r in Object(t))}}function ur(r,n){return null!=r&&n in Object(r)}var er=1,ir=2;function fr(r){return"function"==typeof r?r:null==r?S:"object"==typeof r?b(r)?(e=r[1],o(u=r[0])&&nr(e)?tr(f(u),e):function(r){var n=a(r,u);return void 0===n&&n===e?function(r,n){return null!=r&&function(r,n,t){for(var u=-1,e=(n=i(n,r)).length,o=!1;++u<e;){var a=f(n[u]);if(!(o=null!=r&&t(r,a)))break;r=r[a]}return o||++u!=e?o:!!(e=null==r?0:r.length)&&y(e)&&l(a,e)&&(b(r)||g(r))}(r,n,ur)}(r,u):w(e,n,er|ir)}):(t=function(r){for(var n=p(r),t=n.length;t--;){var u=n[t],e=r[u];n[t]=[u,e,nr(e)]}return n}(n=r),1==t.length&&t[0][2]?tr(t[0][0],t[0][1]):function(r){return r===n||function(r,n,t,u){var e=t.length,i=e;if(null==r)return!i;for(r=Object(r);e--;){var f=t[e];if(f[2]?f[1]!==r[f[0]]:!(f[0]in r))return!1}for(;++e<i;){var o=(f=t[e])[0],a=r[o],c=f[1];if(f[2]){if(void 0===a&&!(o in r))return!1}else{var s,l=new d;if(!(void 0===s?w(c,a,$|rr,u,l):s))return!1}}return!0}(r,0,t)}):function(r){return o(r)?(n=f(r),function(r){return null==r?void 0:r[n]}):function(r){return function(n){return c(n,r)}}(r);var n}(r);var n,t,u,e}const or=function(r,n,t){for(var u=-1,e=Object(r),i=t(r),f=i.length;f--;){var o=i[++u];if(!1===n(e[o],o,e))break}return r};const ar=function(r,n){if(null==r)return r;if(!j(r))return function(r,n){return r&&or(r,n,p)}(r,n);for(var t=r.length,u=-1,e=Object(r);++u<t&&!1!==n(e[u],u,e););return r};function cr(r,n){if(r!==n){var t=void 0!==r,u=null===r,e=r==r,i=O(r),f=void 0!==n,o=null===n,a=n==n,c=O(n);if(!o&&!c&&!i&&r>n||i&&f&&a&&!o&&!c||u&&f&&a||!t&&a||!e)return 1;if(!u&&!i&&!c&&r<n||c&&t&&e&&!u&&!i||o&&t&&e||!f&&e||!a)return-1}return 0}function sr(r,n,t){n=n.length?s(n,(function(r){return b(r)?function(n){return c(n,1===r.length?r[0]:r)}:r})):[S];var u=-1;n=s(n,x(fr));var e=function(r,n){var t=-1,u=j(r)?Array(r.length):[];return ar(r,(function(r){u[++t]=n(r)})),u}(r,(function(r){return{criteria:s(n,(function(n){return n(r)})),index:++u,value:r}}));return function(r){var n=r.length;for(r.sort((function(r,n){return function(r,n,t){for(var u=-1,e=r.criteria,i=n.criteria,f=e.length,o=t.length;++u<f;){var a=cr(e[u],i[u]);if(a)return u>=o?a:a*("desc"==t[u]?-1:1)}return r.index-n.index}(r,n,t)}));n--;)r[n]=r[n].value;return r}(e)}var lr=function(r){return C(function(r,n,t){return n=D(void 0===n?r.length-1:n,0),function(){for(var u=arguments,e=-1,i=D(u.length-n,0),f=Array(i);++e<i;)f[e]=u[n+e];e=-1;for(var o=Array(n+1);++e<n;)o[e]=u[e];return o[n]=t(f),function(r,n,t){switch(t.length){case 0:return r.call(n);case 1:return r.call(n,t[0]);case 2:return r.call(n,t[0],t[1]);case 3:return r.call(n,t[0],t[1],t[2])}return r.apply(n,t)}(r,this,o)}}(r,void 0,S),r+"")}((function(r,n){if(null==r)return[];var t=n.length;return t>1&&I(r,n[0],n[1])?n=[]:t>2&&I(n[0],n[1],n[2])&&(n=[n[0]]),sr(r,T(n,1),[])}));const vr=lr;function dr(r,n){if(0===r.length||0===n.length)return"";r="en_us"===r?"en-US":r,n="en_us"===n?"en-US":n;const t=(new Intl.DisplayNames(n,{type:"language"}).of(r)||"").split(" ");return t[0]=Z(e(t[0]).toLowerCase()),t.join(" ")}const pr=class{constructor(t){r(this,t),this.change=n(this,"change",7),this.context={limetype:null,id:null},this.handleChange=r=>{r.stopPropagation(),this.change.emit(this.multipleChoice?r.detail.map((r=>r.value)):r.detail.value)}}async componentWillLoad(){try{this.http=this.platform.get(u.Http),this.allLanguages=await async function(r){const n=await r.get("api/v1/admin/settings/languages"),t=[];return(null==n?void 0:n.active)&&t.push(...n.active),(null==n?void 0:n.inactive)&&t.push(...n.inactive),t}(this.http)}catch(r){console.error(r)}}getOptions(){return this.allLanguages.map((r=>({value:r,text:dr(r,r)})))}render(){const r=this.getOptions();let n;if(Array.isArray(this.value)){const t=this.value;n=r.filter((r=>t.includes(r.value)))}else{const t=this.value;n=r.find((r=>r.value===t))}return t("limel-select",{key:"4010306cc9bb60b5d1233165eeca5468fe011c33",value:n,options:vr(r,"text"),helperText:this.helperText,label:this.label,required:this.required,disabled:this.disabled,readonly:this.readonly,onChange:this.handleChange,multiple:this.multipleChoice})}};export{pr as limebb_locale_picker}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,h as r,H as t}from"./p-
|
|
1
|
+
import{r as o,h as r,H as t}from"./p-52cf8641.js";import{g as e}from"./p-10e16feb.js";const a=class{valueChanged(o){this.numValue=this.parseValue(o)}constructor(t){o(this,t),this.suffix="%",this.reducePresence=!0,this.labelId="a"+crypto.randomUUID(),this.tooltipId="a"+crypto.randomUUID(),this.helperTextId="a"+crypto.randomUUID(),this.renderHelperLine=()=>{if(this.hasHelperText())return r("limel-helper-line",{helperTextId:this.helperTextId,helperText:this.helperText,invalid:this.invalid})},this.hasHelperText=()=>null!=this.helperText,this.numValue=this.parseValue(this.value)}render(){return r(t,{key:"a0f458a114e5698f40899c44d532643f50bef249",class:this.getContainerClassList()},r("limel-notched-outline",{key:"fe9a66d44f3155d6594da5e7e16ce9a33907f800",id:this.tooltipId,label:this.label,labelId:this.labelId,invalid:this.invalid,required:this.required,hasValue:!0,hasFloatingLabel:!0,"aria-labelledby":this.labelId,"aria-describedby":this.helperTextId,"aria-controls":this.helperTextId},r("div",{key:"daff3b1e6ec7098e7353bca3664179fd9c2594c1",slot:"content",tabIndex:0},this.renderVisualization())),this.renderHelperLine(),this.renderTooltip())}renderVisualization(){if(!this.reducePresence||0!==this.numValue&&this.hasValue())return this.hasValue()?[this.getArrowIcon(),r("span",null,this.renderGrowthPercentage(),this.renderGrowthAmount())]:r("span",{class:"no-value"},"–")}renderTooltip(){if(void 0===this.formerValue)return;const o=`${this.value} - ${this.formerValue>0?this.formerValue:"("+this.formerValue+")"} = ${this.calculateGrowth()} ${this.suffix} `,t=this.calculatePercentage();return r("limel-tooltip",{openDirection:"top-start",elementId:this.tooltipId,label:t+"%",helperLabel:o})}renderGrowthPercentage(){if(void 0===this.formerValue)return this.formatValue(this.numValue,this.suffix);const o=this.calculatePercentage();return null!==o?this.formatValue(o,"%"):void 0}renderGrowthAmount(){if(void 0===this.formerValue)return;const o=this.calculateGrowth();return r("span",{class:"growth-unit"},"( ",this.formatValue(o,this.suffix)," )")}hasValue(){return null!=this.value&&""!==this.value}getContainerClassList(){if(!this.hasValue())return;const o=this.getPercentage(),r=e(o);return Object.assign({},r&&{[r]:!0})}getPercentage(){return void 0===this.formerValue?this.numValue:this.calculatePercentage()}calculateGrowth(){return this.numValue-this.formerValue}calculatePercentage(){if(0===this.formerValue)return null;const o=((this.numValue-this.formerValue)/Math.abs(this.formerValue)*100).toFixed(2);return Number.parseFloat(o)}unifyMinusSign(o){return o.replaceAll("−","-")}convertToUnicodeMinus(o){return o.replaceAll("-","−")}parseValue(o){return"string"==typeof o?Number.parseFloat(this.unifyMinusSign(o)):o}formatValue(o,r){const t=`${o} ${r}`;return o>0?"+"+t:this.convertToUnicodeMinus(t)}getArrowIcon(){return r("limel-icon",{class:"icon",name:"right","aria-hidden":"true",role:"presentation"})}static get watchers(){return{value:["valueChanged"]}}};a.style='@charset "UTF-8";*{box-sizing:border-box}:host(limebb-trend-indicator){position:relative;display:block;height:100%;width:100%}limel-notched-outline:not([invalid]:not([invalid=false])) .limel-notched-outline--outlines{--limel-notched-outline-border-color:transparent}div[slot=content]{display:flex;align-items:center;gap:0.5rem;border-radius:inherit;background-color:transparent !important}div[slot=content]:focus{outline:none}div[slot=content]:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}:host(limebb-trend-indicator):has(label) div[slot=content]{min-height:2.5rem;padding:0 0.375rem 0 1rem}:host(limebb-trend-indicator[former-value]) div[slot=content]{cursor:help}div[slot=content] span{flex-shrink:0}.icon{flex-shrink:0;display:flex;transition-property:color, background-color, transform;transition-duration:0.4s;transition-timing-function:ease;width:1.25rem;height:1.25rem;border-radius:50%;padding:0.12rem;color:rgb(var(--color-white));background-color:rgb(var(--color-gray-default), 0.5)}:host(.has-value-40to30-negative) .icon{color:rgb(var(--color-gray-darker))}:host(.has-value-30to20-negative) .icon{color:rgb(var(--color-gray-darker))}:host(.has-value-20to10-negative) .icon{color:rgb(var(--color-gray-darker))}:host(.has-value-10to0-negative) .icon{color:rgb(var(--color-gray-darker))}:host(.has-value-0to10-positive) .icon{color:rgb(var(--color-gray-dark))}:host(.has-value-10to20-positive) .icon{color:rgb(var(--color-gray-dark))}:host(.has-value-20to30-positive) .icon{color:rgb(var(--color-gray-dark))}:host(.has-value-30to40-positive) .icon{color:rgb(var(--color-gray-dark))}:host(.has-value-200or-larger-negative) .icon{background-color:rgb(var(--color-red-darker));transform:rotate(90deg)}:host(.has-value-200to100-negative) .icon{background-color:rgb(var(--color-red-dark));transform:rotate(90deg)}:host(.has-value-100to90-negative) .icon{background-color:rgb(var(--color-red-dark));transform:rotate(90deg)}:host(.has-value-90to80-negative) .icon{background-color:rgb(var(--color-red-dark));transform:rotate(81deg)}:host(.has-value-80to70-negative) .icon{background-color:rgb(var(--color-red-default));transform:rotate(72deg)}:host(.has-value-70to60-negative) .icon{background-color:rgb(var(--color-red-default));transform:rotate(63deg)}:host(.has-value-60to50-negative) .icon{background-color:rgb(var(--color-coral-default));transform:rotate(54deg)}:host(.has-value-50to40-negative) .icon{background-color:rgb(var(--color-coral-default));transform:rotate(45deg)}:host(.has-value-40to30-negative) .icon{background-color:rgb(var(--color-orange-default));transform:rotate(36deg)}:host(.has-value-30to20-negative) .icon{background-color:rgb(var(--color-orange-default));transform:rotate(27deg)}:host(.has-value-20to10-negative) .icon{background-color:rgb(var(--color-amber-default));transform:rotate(18deg)}:host(.has-value-10to0-negative) .icon{background-color:rgb(var(--color-amber-default));transform:rotate(9deg)}:host(.has-value-0) .icon{background-color:rgb(var(--color-gray-default));transform:rotate(0deg)}:host(.has-value-0to10-positive) .icon{background-color:rgb(var(--color-yellow-default));transform:rotate(-9deg)}:host(.has-value-10to20-positive) .icon{background-color:rgb(var(--color-yellow-default));transform:rotate(-18deg)}:host(.has-value-20to30-positive) .icon{background-color:rgb(var(--color-grass-default));transform:rotate(-27deg)}:host(.has-value-30to40-positive) .icon{background-color:rgb(var(--color-grass-default));transform:rotate(-36deg)}:host(.has-value-40to50-positive) .icon{background-color:rgb(var(--color-lime-default));transform:rotate(-45deg)}:host(.has-value-50to60-positive) .icon{background-color:rgb(var(--color-lime-default));transform:rotate(-54deg)}:host(.has-value-60to70-positive) .icon{background-color:rgb(var(--color-teal-default));transform:rotate(-63deg)}:host(.has-value-70to80-positive) .icon{background-color:rgb(var(--color-teal-default));transform:rotate(-72deg)}:host(.has-value-80to90-positive) .icon{background-color:rgb(var(--color-teal-dark));transform:rotate(-81deg)}:host(.has-value-90to100-positive) .icon{background-color:rgb(var(--color-teal-dark));transform:rotate(-90deg)}:host(.has-value-100to200-positive) .icon{background-color:rgb(var(--color-teal-dark));transform:rotate(-90deg)}:host(.has-value-200or-larger-positive) .icon{background-color:rgb(var(--color-teal-darker));transform:rotate(-90deg)}:host(.has-value-0) .icon{background-color:rgb(var(--color-gray-default), 0.5);transform:rotate(0deg)}:host(.has-value-0) .icon polyline{color:transparent}:host(.has-value-200or-larger-negative) .icon:after,:host(.has-value-200or-larger-negative) .icon:before,:host(.has-value-200to100-negative) .icon:after,:host(.has-value-200to100-negative) .icon:before,:host(.has-value-100to200-positive) .icon:after,:host(.has-value-100to200-positive) .icon:before,:host(.has-value-200or-larger-positive) .icon:after,:host(.has-value-200or-larger-positive) .icon:before{transition:border-color 0.6s ease;content:"";position:absolute;inset:0;margin:auto;border:1px solid transparent;border-radius:50%}:host(.has-value-200or-larger-negative) .icon:before,:host(.has-value-200to100-negative) .icon:before,:host(.has-value-100to200-positive) .icon:before,:host(.has-value-200or-larger-positive) .icon:before{transform:scale(1.2)}:host(.has-value-200or-larger-negative) .icon:after,:host(.has-value-200to100-negative) .icon:after,:host(.has-value-100to200-positive) .icon:after,:host(.has-value-200or-larger-positive) .icon:after{transform:scale(1.4);opacity:0.4}:host(.has-value-200to100-negative) .icon:before,:host(.has-value-200or-larger-negative) .icon:before{border-color:rgb(var(--color-red-dark))}:host(.has-value-200or-larger-negative) .icon:after{border-color:rgb(var(--color-red-darker))}:host(.has-value-100to200-positive) .icon:before,:host(.has-value-200or-larger-positive) .icon:before{border-color:rgb(var(--color-teal-dark))}:host(.has-value-200or-larger-positive) .icon:after{border-color:rgb(var(--color-teal-darker))}.no-value{transform:translateY(0.5rem)}.growth-unit{padding-left:0.5rem;opacity:0.5}:host(limebb-trend-indicator:focus),:host(limebb-trend-indicator:focus-visible),:host(limebb-trend-indicator:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limebb-trend-indicator){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limebb-trend-indicator:focus) limel-helper-line,:host(limebb-trend-indicator:focus-visible) limel-helper-line,:host(limebb-trend-indicator:focus-within) limel-helper-line,:host(limebb-trend-indicator:hover) limel-helper-line{will-change:grid-template-rows}';export{a as limebb_trend_indicator}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { AIContextProvider, AIContextContribution, AggregateOperator } from '@limetech/lime-web-components';
|
|
2
|
+
/**
|
|
3
|
+
* State needed by the InfoTileContextProvider to generate context.
|
|
4
|
+
*/
|
|
5
|
+
export interface InfoTileContextState {
|
|
6
|
+
limetype: string | undefined;
|
|
7
|
+
filterId: string | undefined;
|
|
8
|
+
filterName: string | undefined;
|
|
9
|
+
aggregateOperator: AggregateOperator;
|
|
10
|
+
propertyName: string | undefined;
|
|
11
|
+
value: string | number | undefined;
|
|
12
|
+
label: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Context provider for the info-tile component.
|
|
16
|
+
*
|
|
17
|
+
* This provider contributes contextual information about an info tile
|
|
18
|
+
* to the AI chat feature, including the limetype, filter, aggregation
|
|
19
|
+
* method, and current value.
|
|
20
|
+
*
|
|
21
|
+
* @alpha
|
|
22
|
+
*/
|
|
23
|
+
export declare class InfoTileContextProvider implements AIContextProvider {
|
|
24
|
+
private readonly getState;
|
|
25
|
+
readonly contextType = "info-tile";
|
|
26
|
+
readonly description = "Provides context about an info tile showing an aggregated value";
|
|
27
|
+
/**
|
|
28
|
+
* Create an InfoTileContextProvider.
|
|
29
|
+
*
|
|
30
|
+
* @param getState - Function that returns the current tile state
|
|
31
|
+
*/
|
|
32
|
+
constructor(getState: () => InfoTileContextState);
|
|
33
|
+
getContext(): AIContextContribution;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=info-tile-context-provider.d.ts.map
|
|
@@ -59,6 +59,10 @@ export declare class InfoTile implements LimeWebComponent {
|
|
|
59
59
|
private value;
|
|
60
60
|
private loading;
|
|
61
61
|
private error;
|
|
62
|
+
private limetypes;
|
|
63
|
+
private unregisterContextProvider?;
|
|
64
|
+
connectedCallback(): void;
|
|
65
|
+
disconnectedCallback(): void;
|
|
62
66
|
componentWillLoad(): void;
|
|
63
67
|
protected watchFilterId(): void;
|
|
64
68
|
protected watchPropertyName(): void;
|
|
@@ -70,10 +74,13 @@ export declare class InfoTile implements LimeWebComponent {
|
|
|
70
74
|
private getLabel;
|
|
71
75
|
private getLocalizedString;
|
|
72
76
|
private getLink;
|
|
77
|
+
private buildContextAwareFilter;
|
|
73
78
|
private getFilter;
|
|
74
79
|
private getFormatter;
|
|
80
|
+
private getRelationPropertyName;
|
|
75
81
|
private get translator();
|
|
76
82
|
private get language();
|
|
77
83
|
private get loader();
|
|
84
|
+
private registerContextProvider;
|
|
78
85
|
}
|
|
79
86
|
//# sourceMappingURL=info-tile.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@limetech/lime-crm-building-blocks",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.106.0",
|
|
4
4
|
"description": "A home for shared components meant for use with Lime CRM",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@limetech/eslint-config": "^3.0.1",
|
|
38
|
-
"@limetech/lime-elements": "^38.
|
|
39
|
-
"@limetech/lime-web-components": "^6.
|
|
38
|
+
"@limetech/lime-elements": "^38.34.0",
|
|
39
|
+
"@limetech/lime-web-components": "^6.9.0",
|
|
40
40
|
"@limetech/lime-web-components-testing": "^1.0.0",
|
|
41
41
|
"@lundalogik/lime-icons8": "^2.37.0",
|
|
42
|
-
"@lundalogik/limeclient.js": "^1.
|
|
42
|
+
"@lundalogik/limeclient.js": "^1.86.0",
|
|
43
43
|
"@stencil/core": "^4.27.2",
|
|
44
44
|
"@stencil/sass": "^3.1.9",
|
|
45
45
|
"@types/jest": "^29.5.14",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Z as r}from"./p-4838284a.js";import{g as t,a as o,v as e}from"./p-b02c99d5.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 c(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 c=e.relation.getLimetype();if(!c)throw new Error(`Could not determine related limetype for property '${r}'`);const f={};for(const r of s)f[r]=i[r];const p=l(f,o,c.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 l(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=c(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 c=a[0],l=function(r,t){return"ASC"!==r&&"DESC"!==r?`orderBy[${t}]: direction must be 'ASC' or 'DESC', got '${r}'`:null}(r[c],o);l&&i.push(l);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}'`}(c,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=l(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,2 +0,0 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=e=>{if(e.__stencil__getHostRef)return e.__stencil__getHostRef()},n=(e,t)=>{e.__stencil__getHostRef=()=>t,t.t=e},o=(e,t)=>t in e,l=(e,t)=>(0,console.error)(e,t),i=new Map,s=new Map,r="slot-fb{display:contents}slot-fb[hidden]{display:none}",c="http://www.w3.org/1999/xlink",u="undefined"!=typeof window?window:{},a={o:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,o)=>e.addEventListener(t,n,o),rel:(e,t,n,o)=>e.removeEventListener(t,n,o),ce:(e,t)=>new CustomEvent(e,t)},f=e=>Promise.resolve(e),d=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),h=!1,p=[],m=[],v=(e,t)=>n=>{e.push(n),h||(h=!0,t&&4&a.o?w(b):a.raf(b))},y=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){l(e)}e.length=0},b=()=>{y(p),y(m),(h=p.length>0)&&a.raf(b)},w=e=>f().then(e),$=v(m,!0),g=e=>"object"==(e=typeof e)||"function"===e;function S(e){var t,n,o;return null!=(o=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}((t,n)=>{for(var o in n)e(t,o,{get:n[o],enumerable:!0})})({},{err:()=>k,map:()=>O,ok:()=>j,unwrap:()=>C,unwrapErr:()=>M});var j=e=>({isOk:!0,isErr:!1,value:e}),k=e=>({isOk:!1,isErr:!0,value:e});function O(e,t){if(e.isOk){const n=t(e.value);return n instanceof Promise?n.then((e=>j(e))):j(n)}if(e.isErr)return k(e.value);throw"should never get here"}var E,C=e=>{if(e.isOk)return e.value;throw e.value},M=e=>{if(e.isErr)return e.value;throw e.value},x=(e,t,...n)=>{let o=null,l=null,i=!1,s=!1;const r=[],c=t=>{for(let n=0;n<t.length;n++)o=t[n],Array.isArray(o)?c(o):null!=o&&"boolean"!=typeof o&&((i="function"!=typeof e&&!g(o))&&(o+=""),i&&s?r[r.length-1].i+=o:r.push(i?P(null,o):o),s=i)};if(c(n),t){t.key&&(l=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,r,R);const u=P(e,null);return u.u=t,r.length>0&&(u.h=r),u.p=l,u},P=(e,t)=>({o:0,m:e,i:t,v:null,h:null,u:null,p:null}),D={},R={forEach:(e,t)=>e.map(U).forEach(t),map:(e,t)=>e.map(U).map(t).map(W)},U=e=>({vattrs:e.u,vchildren:e.h,vkey:e.p,vname:e.$,vtag:e.m,vtext:e.i}),W=e=>{if("function"==typeof e.vtag){const t={...e.vattrs};return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),x(e.vtag,t,...e.vchildren||[])}const t=P(e.vtag,e.vtext);return t.u=e.vattrs,t.h=e.vchildren,t.p=e.vkey,t.$=e.vname,t},A=(e,t)=>null==e||g(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e,N=e=>t(e).$hostElement$,F=(e,t,n)=>{const o=N(e);return{emit:e=>H(o,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},H=(e,t,n)=>{const o=a.ce(t,n);return e.dispatchEvent(o),o},L=new WeakMap,T=e=>"sc-"+e.S,z=(e,t,n,l,i,s)=>{if(n===l)return;let r=o(e,t),f=t.toLowerCase();if("class"===t){const t=e.classList,o=q(n);let i=q(l);t.remove(...o.filter((e=>e&&!i.includes(e)))),t.add(...i.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if("key"===t);else if("ref"===t)l&&l(e);else if(r||"o"!==t[0]||"n"!==t[1]){const o=g(l);if((r||o&&null!==l)&&!i)try{if(e.tagName.includes("-"))e[t]!==l&&(e[t]=l);else{const o=null==l?"":l;"list"===t?r=!1:null!=n&&e[t]==o||("function"==typeof e.__lookupSetter__(t)?e[t]=o:e.setAttribute(t,o))}}catch(e){}let u=!1;f!==(f=f.replace(/^xlink\:?/,""))&&(t=f,u=!0),null==l||!1===l?!1===l&&""!==e.getAttribute(t)||(u?e.removeAttributeNS(c,t):e.removeAttribute(t)):(!r||4&s||i)&&!o&&1===e.nodeType&&(l=!0===l?"":l,u?e.setAttributeNS(c,t,l):e.setAttribute(t,l))}else if(t="-"===t[2]?t.slice(3):o(u,f)?f.slice(2):f[2]+t.slice(3),n||l){const o=t.endsWith(G);t=t.replace(I,""),n&&a.rel(e,t,n,o),l&&a.ael(e,t,l,o)}},V=/\s/,q=e=>("object"==typeof e&&e&&"baseVal"in e&&(e=e.baseVal),e&&"string"==typeof e?e.split(V):[]),G="Capture",I=RegExp(G+"$"),Y=(e,t,n)=>{const o=11===t.v.nodeType&&t.v.host?t.v.host:t.v,l=e&&e.u||{},i=t.u||{};for(const e of _(Object.keys(l)))e in i||z(o,e,l[e],void 0,n,t.o);for(const e of _(Object.keys(i)))z(o,e,l[e],i[e],n,t.o)};function _(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var B=!1,J=(e,t,n)=>{const o=t.h[n];let l,i,s=0;if(null!==o.i)l=o.v=u.document.createTextNode(o.i);else{if(!u.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component.");if(l=o.v=u.document.createElement(o.m),Y(null,o,B),o.h)for(s=0;s<o.h.length;++s)i=J(e,o,s),i&&l.appendChild(i)}return l["s-hn"]=E,l},K=(e,t,n,o,l,i)=>{let s,r=e;for(r.shadowRoot&&r.tagName===E&&(r=r.shadowRoot);l<=i;++l)o[l]&&(s=J(null,n,l),s&&(o[l].v=s,te(r,s,t)))},Q=(e,t,n)=>{for(let o=t;o<=n;++o){const t=e[o];if(t){const e=t.v;ee(t),e&&e.remove()}}},X=(e,t,n=!1)=>e.m===t.m&&(n?(n&&!e.p&&t.p&&(e.p=t.p),!0):e.p===t.p),Z=(e,t,n=!1)=>{const o=t.v=e.v,l=e.h,i=t.h,s=t.i;null===s?(Y(e,t,B),null!==l&&null!==i?((e,t,n,o,l=!1)=>{let i,s,r=0,c=0,u=0,a=0,f=t.length-1,d=t[0],h=t[f],p=o.length-1,m=o[0],v=o[p];for(;r<=f&&c<=p;)if(null==d)d=t[++r];else if(null==h)h=t[--f];else if(null==m)m=o[++c];else if(null==v)v=o[--p];else if(X(d,m,l))Z(d,m,l),d=t[++r],m=o[++c];else if(X(h,v,l))Z(h,v,l),h=t[--f],v=o[--p];else if(X(d,v,l))Z(d,v,l),te(e,d.v,h.v.nextSibling),d=t[++r],v=o[--p];else if(X(h,m,l))Z(h,m,l),te(e,h.v,d.v),h=t[--f],m=o[++c];else{for(u=-1,a=r;a<=f;++a)if(t[a]&&null!==t[a].p&&t[a].p===m.p){u=a;break}u>=0?(s=t[u],s.m!==m.m?i=J(t&&t[c],n,u):(Z(s,m,l),t[u]=void 0,i=s.v),m=o[++c]):(i=J(t&&t[c],n,c),m=o[++c]),i&&te(d.v.parentNode,i,d.v)}r>f?K(e,null==o[p+1]?null:o[p+1].v,n,o,c,p):c>p&&Q(t,r,f)})(o,l,t,i,n):null!==i?(null!==e.i&&(o.textContent=""),K(o,null,t,i,0,i.length-1)):!n&&null!==l&&Q(l,0,l.length-1)):e.i!==s&&(o.data=s)},ee=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(ee)},te=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),ne=(e,t)=>{if(t&&!e.j&&t["s-p"]){const n=t["s-p"].push(new Promise((o=>e.j=()=>{t["s-p"].splice(n-1,1),o()})))}},oe=(e,t)=>{if(e.o|=16,!(4&e.o))return ne(e,e.k),$((()=>le(e,t)));e.o|=512},le=(e,t)=>{const n=e.$hostElement$,o=e.t;if(!o)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return l=fe(o,t?"componentWillLoad":"componentWillUpdate",void 0,n),l=ie(l,(()=>fe(o,"componentWillRender",void 0,n))),ie(l,(()=>re(e,o,t)))},ie=(e,t)=>se(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),se=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,re=async(e,t,n)=>{var o;const l=e.$hostElement$,i=l["s-rc"];n&&(e=>{const t=e.O,n=e.$hostElement$,o=t.o,l=((e,t)=>{var n;const o=T(t),l=s.get(o);if(!u.document)return o;if(e=11===e.nodeType?e:u.document,l)if("string"==typeof l){let i,s=L.get(e=e.head||e);if(s||L.set(e,s=new Set),!s.has(o)){{i=document.querySelector(`[sty-id="${o}"]`)||u.document.createElement("style"),i.innerHTML=l;const s=null!=(n=a.C)?n:S(u.document);if(null!=s&&i.setAttribute("nonce",s),!(1&t.o))if("HEAD"===e.nodeName){const t=e.querySelectorAll("link[rel=preconnect]"),n=t.length>0?t[t.length-1].nextSibling:e.querySelector("style");e.insertBefore(i,(null==n?void 0:n.parentNode)===e?n:null)}else if("host"in e)if(d){const t=new CSSStyleSheet;t.replaceSync(l),e.adoptedStyleSheets=[t,...e.adoptedStyleSheets]}else{const t=e.querySelector("style");t?t.innerHTML=l+t.innerHTML:e.prepend(i)}else e.append(i);1&t.o&&e.insertBefore(i,null)}4&t.o&&(i.innerHTML+=r),s&&s.add(o)}}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return o})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);(10&o&&2&o||128&o)&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(e);ce(e,t,l,n),i&&(i.map((e=>e())),l["s-rc"]=void 0);{const t=null!=(o=l["s-p"])?o:[],n=()=>ue(e);0===t.length?n():(Promise.all(t).then(n),e.o|=4,t.length=0)}},ce=(e,t,n,o)=>{try{t=t.render&&t.render(),e.o&=-17,e.o|=2,((e,t,n=!1)=>{const o=e.$hostElement$,l=e.O,i=e.M||P(null,null),s=(e=>e&&e.m===D)(t)?t:x(null,null,t);if(E=o.tagName,l.P&&(s.u=s.u||{},l.P.map((([e,t])=>s.u[t]=o[e]))),n&&s.u)for(const e of Object.keys(s.u))o.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(s.u[e]=o[e]);s.m=null,s.o|=4,e.M=s,s.v=i.v=o.shadowRoot||o,Z(i,s,n)})(e,t,o)}catch(t){l(t,e.$hostElement$)}return null},ue=e=>{const t=e.$hostElement$,n=e.t,o=e.k;fe(n,"componentDidRender",void 0,t),64&e.o?fe(n,"componentDidUpdate",void 0,t):(e.o|=64,de(t),fe(n,"componentDidLoad",void 0,t),e.D(t),o||ae()),e.j&&(e.j(),e.j=void 0),512&e.o&&w((()=>oe(e,!1))),e.o&=-517},ae=()=>{w((()=>H(u,"appload",{detail:{namespace:"lime-crm-building-blocks"}})))},fe=(e,t,n,o)=>{if(e&&e[t])try{return e[t](n)}catch(e){l(e,o)}},de=e=>e.classList.add("hydrated"),he=(e,n,o,i)=>{const s=t(e);if(!s)throw Error(`Couldn't find host element for "${i.S}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`);const r=s.$hostElement$,c=s.R.get(n),u=s.o,a=s.t;if(o=A(o,i.U[n][0]),(!(8&u)||void 0===c)&&o!==c&&(!Number.isNaN(c)||!Number.isNaN(o))&&(s.R.set(n,o),a)){if(i.W&&128&u){const e=i.W[n];e&&e.map((e=>{try{a[e](o,c,n)}catch(e){l(e,r)}}))}if(2==(18&u)){if(a.componentShouldUpdate&&!1===a.componentShouldUpdate(o,c,n))return;oe(s,!1)}}},pe=(e,n,o)=>{var l,i;const s=e.prototype;if(n.U||n.W||e.watchers){e.watchers&&!n.W&&(n.W=e.watchers);const r=Object.entries(null!=(l=n.U)?l:{});if(r.map((([e,[l]])=>{if(31&l||2&o&&32&l){const{get:i,set:r}=Object.getOwnPropertyDescriptor(s,e)||{};i&&(n.U[e][0]|=2048),r&&(n.U[e][0]|=4096),(1&o||!i)&&Object.defineProperty(s,e,{get(){{if(!(2048&n.U[e][0]))return((e,n)=>t(this).R.get(n))(0,e);const o=t(this),l=o?o.t:s;if(!l)return;return l[e]}},configurable:!0,enumerable:!0}),Object.defineProperty(s,e,{set(i){const s=t(this);if(r){const t=32&l?this[e]:s.$hostElement$[e];return void 0===t&&s.R.get(e)?i=s.R.get(e):!s.R.get(e)&&t&&s.R.set(e,t),r.call(this,A(i,l)),void he(this,e,i=32&l?this[e]:s.$hostElement$[e],n)}{if(!(1&o&&4096&n.U[e][0]))return he(this,e,i,n),void(1&o&&!s.t&&s.A.then((()=>{4096&n.U[e][0]&&s.t[e]!==s.R.get(e)&&(s.t[e]=i)})));const t=()=>{const t=s.t[e];!s.R.get(e)&&t&&s.R.set(e,t),s.t[e]=A(i,l),he(this,e,s.t[e],n)};s.t?t():s.A.then((()=>t()))}}})}})),1&o){const o=new Map;s.attributeChangedCallback=function(e,l,i){a.jmp((()=>{var r;const c=o.get(e);if(this.hasOwnProperty(c))i=this[c],delete this[c];else{if(s.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==i)return;if(null==c){const o=t(this),s=null==o?void 0:o.o;if(s&&!(8&s)&&128&s&&i!==l){const t=o.t,s=null==(r=n.W)?void 0:r[e];null==s||s.forEach((n=>{null!=t[n]&&t[n].call(t,i,l,e)}))}return}}const u=Object.getOwnPropertyDescriptor(s,c);(i=(null!==i||"boolean"!=typeof this[c])&&i)===this[c]||u.get&&!u.set||(this[c]=i)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(i=n.W)?i:{}),...r.filter((([e,t])=>15&t[0])).map((([e,t])=>{var l;const i=t[1]||e;return o.set(i,e),512&t[0]&&(null==(l=n.P)||l.push([e,i])),i}))]))}}return e},me=(e,t)=>{fe(e,"connectedCallback",void 0,t)},ve=(e,t)=>{fe(e,"disconnectedCallback",void 0,t||e)},ye=(e,n={})=>{var o;if(!u.document)return void console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");const c=[],f=n.exclude||[],h=u.customElements,p=u.document.head,m=p.querySelector("meta[charset]"),v=u.document.createElement("style"),y=[];let b,w=!0;Object.assign(a,n),a.l=new URL(n.resourcesUrl||"./",u.document.baseURI).href;let $=!1;if(e.map((e=>{e[1].map((n=>{var o;const r={o:n[0],S:n[1],U:n[2],N:n[3]};4&r.o&&($=!0),r.U=n[2],r.P=[],r.W=null!=(o=n[4])?o:{};const u=r.S,p=class extends HTMLElement{constructor(e){if(super(e),this.hasRegisteredEventListeners=!1,((e,t)=>{const n={o:0,$hostElement$:e,O:t,R:new Map};n.A=new Promise((e=>n.D=e)),e["s-p"]=[],e["s-rc"]=[];const o=n;e.__stencil__getHostRef=()=>o})(e=this,r),1&r.o)if(e.shadowRoot){if("open"!==e.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${r.S}! Mode is set to ${e.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else e.attachShadow({mode:"open",delegatesFocus:!!(16&r.o)})}connectedCallback(){this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),b&&(clearTimeout(b),b=null),w?y.push(this):a.jmp((()=>(e=>{if(!(1&a.o)){const n=t(e),o=n.O,r=()=>{};if(1&n.o)(null==n?void 0:n.t)?me(n.t,e):(null==n?void 0:n.A)&&n.A.then((()=>me(n.t,e)));else{n.o|=1;{let t=e;for(;t=t.parentNode||t.host;)if(t["s-p"]){ne(n,n.k=t);break}}o.U&&Object.entries(o.U).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n)=>{let o;if(!(32&t.o)){if(t.o|=32,n.F){const s=((e,t)=>{const n=e.S.replace(/-/g,"_"),o=e.F;if(!o)return;const s=i.get(o);return s?s[n]:import(`./${o}.entry.js`).then((e=>(i.set(o,e),e[n])),(e=>{l(e,t.$hostElement$)}))
|
|
2
|
-
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n,t);if(s&&"then"in s){const e=()=>{};o=await s,e()}else o=s;if(!o)throw Error(`Constructor for "${n.S}#${t.H}" was not found`);o.isProxied||(n.W=o.watchers,pe(o,n,2),o.isProxied=!0);const r=()=>{};t.o|=8;try{new o(t)}catch(t){l(t,e)}t.o&=-9,t.o|=128,r(),me(t.t,e)}else o=e.constructor,customElements.whenDefined(e.localName).then((()=>t.o|=128));if(o&&o.style){let e;"string"==typeof o.style&&(e=o.style);const t=T(n);if(!s.has(t)){const o=()=>{};((e,t,n)=>{let o=s.get(e);d&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=t:o.replaceSync(t)):o=t,s.set(e,o)})(t,e,!!(1&n.o)),o()}}}const r=t.k,c=()=>oe(t,!0);r&&r["s-rc"]?r["s-rc"].push(c):c()})(e,n,o)}r()}})(this)))}disconnectedCallback(){a.jmp((()=>(async e=>{if(!(1&a.o)){const n=t(e);(null==n?void 0:n.t)?ve(n.t,e):(null==n?void 0:n.A)&&n.A.then((()=>ve(n.t,e)))}L.has(e)&&L.delete(e),e.shadowRoot&&L.has(e.shadowRoot)&&L.delete(e.shadowRoot)})(this))),a.raf((()=>{var e;const n=t(this),o=y.findIndex((e=>e===this));o>-1&&y.splice(o,1),(null==(e=null==n?void 0:n.M)?void 0:e.v)instanceof Node&&!n.M.v.isConnected&&delete n.M.v}))}componentOnReady(){return t(this).A}};r.F=e[0],f.includes(u)||h.get(u)||(c.push(u),h.define(u,pe(p,r,1)))}))})),c.length>0&&($&&(v.textContent+=r),v.textContent+=c.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",v.innerHTML.length)){v.setAttribute("data-styles","");const e=null!=(o=a.C)?o:S(u.document);null!=e&&v.setAttribute("nonce",e),p.insertBefore(v,m?m.nextSibling:p.firstChild)}w=!1,y.length?y.map((e=>e.connectedCallback())):a.jmp((()=>b=setTimeout(ae,30)))},be=e=>a.C=e;export{D as H,ye as b,F as c,N as g,x as h,f as p,n as r,be as s}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e}from"./p-1556b545.js";import{h as o,c}from"./p-4838284a.js";import{H as s}from"./p-66352a1e.js";let i=class{constructor(t){this.itemId=t}};i=function(t,e,o,c){var s,i=arguments.length,l=i<3?e:null===c?c=Object.getOwnPropertyDescriptor(e,o):c;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,o,c);else for(var n=t.length-1;n>=0;n--)(s=t[n])&&(l=(i<3?s(l):i>3?s(e,o,l):s(e,o))||l);return i>3&&l&&Object.defineProperty(e,o,l),l}([o({id:"limebb-feed.highlight-item"})],i);const l=class{constructor(o){t(this,o),this.loaded=e(this,"loaded",7)}connectedCallback(){}async componentWillLoad(){const t=new s;this.platform.register(s.SERVICE_NAME,t),this.commandBus.register(i,t),this.loaded.emit()}componentWillUpdate(){}disconnectedCallback(){}get commandBus(){return this.platform.get(c.CommandBus)}};export{l as limebb_loader}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as t}from"./p-1556b545.js";const n={Route:"route"};function r(t){return t&&["belongsto","hasone","hasmany","hasandbelongstomany"].includes(t.type)}function i(t){return t&&["belongsto","hasone"].includes(t.type)}n.LimeTypeRepository="state.limetypes";var o=function(t,n){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])})(t,n)};function e(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}function u(t){var n="function"==typeof Symbol&&Symbol.iterator,r=n&&t[n],i=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(t,n){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,o,e=r.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(i=e.next()).done;)u.push(i.value)}catch(t){o={error:t}}finally{try{i&&!i.done&&(r=e.return)&&r.call(e)}finally{if(o)throw o.error}}return u}function s(t,n,r){if(r||2===arguments.length)for(var i,o=0,e=n.length;o<e;o++)(i||!(o in n))&&(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))}function f(t){return"function"==typeof t}function a(t){var n=t((function(t){Error.call(t),t.stack=(new Error).stack}));return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var h=a((function(t){return function(n){t(this),this.message=n?n.length+" errors occurred during unsubscription:\n"+n.map((function(t,n){return n+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=n}}));function l(t,n){if(t){var r=t.indexOf(n);0<=r&&t.splice(r,1)}}var v=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var t,n,r,i,o;if(!this.closed){this.closed=!0;var e=this._parentage;if(e)if(this._parentage=null,Array.isArray(e))try{for(var a=u(e),l=a.next();!l.done;l=a.next())l.value.remove(this)}catch(n){t={error:n}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}else e.remove(this);var v=this.initialTeardown;if(f(v))try{v()}catch(t){o=t instanceof h?t.errors:[t]}var y=this._finalizers;if(y){this._finalizers=null;try{for(var d=u(y),m=d.next();!m.done;m=d.next()){var w=m.value;try{b(w)}catch(t){o=o??[],t instanceof h?o=s(s([],c(o)),c(t.errors)):o.push(t)}}}catch(t){r={error:t}}finally{try{m&&!m.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}}if(o)throw new h(o)}},t.prototype.add=function(n){var r;if(n&&n!==this)if(this.closed)b(n);else{if(n instanceof t){if(n.closed||n._hasParent(this))return;n._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(n)}},t.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},t.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},t.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&l(n,t)},t.prototype.remove=function(n){var r=this._finalizers;r&&l(r,n),n instanceof t&&n._removeParent(this)},t.EMPTY=((n=new t).closed=!0,n),t;var n}(),y=v.EMPTY;function d(t){return t instanceof v||t&&"closed"in t&&f(t.remove)&&f(t.add)&&f(t.unsubscribe)}function b(t){f(t)?t():t.unsubscribe()}var m=function(t,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setTimeout.apply(void 0,s([t,n],c(r)))};function w(){}function p(t){t()}var g=function(t){function n(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,d(n)&&n.add(r)):r.destination=A,r}return e(n,t),n.create=function(t,n,r){return new O(t,n,r)},n.prototype.next=function(t){this.isStopped||this._next(t)},n.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},n.prototype._next=function(t){this.destination.next(t)},n.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},n.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},n}(v),j=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var n=this.partialObserver;if(n.next)try{n.next(t)}catch(t){S(t)}},t.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}catch(t){S(t)}else S(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){S(t)}},t}(),O=function(t){function n(n,r,i){var o,e=t.call(this)||this;return o=f(n)||!n?{next:n??void 0,error:r??void 0,complete:i??void 0}:n,e.destination=new j(o),e}return e(n,t),n}(g);function S(t){!function(t){m((function(){throw t}))}(t)}var A={closed:!0,next:w,error:function(t){throw t},complete:w},E="function"==typeof Symbol&&Symbol.observable||"@@observable";function x(t){return t}var P=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(n){var r=new t;return r.source=this,r.operator=n,r},t.prototype.subscribe=function(t,n,r){var i=this,o=function(t){return t&&t instanceof g||function(t){return t&&f(t.next)&&f(t.error)&&f(t.complete)}(t)&&d(t)}(t)?t:new O(t,n,r);return p((function(){var t=i.operator,n=i.source;o.add(t?t.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(n){t.error(n)}},t.prototype.forEach=function(t,n){var r=this;return new(n=T(n))((function(n,i){var o=new O({next:function(n){try{t(n)}catch(t){i(t),o.unsubscribe()}},error:i,complete:n});r.subscribe(o)}))},t.prototype._subscribe=function(t){var n;return null===(n=this.source)||void 0===n?void 0:n.subscribe(t)},t.prototype[E]=function(){return this},t.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(t){return 0===t.length?x:1===t.length?t[0]:function(n){return t.reduce((function(t,n){return n(t)}),n)}}(t)(this)},t.prototype.toPromise=function(t){var n=this;return new(t=T(t))((function(t,r){var i;n.subscribe((function(t){return i=t}),(function(t){return r(t)}),(function(){return t(i)}))}))},t.create=function(n){return new t(n)},t}();function T(t){var n;return null!==(n=t??undefined)&&void 0!==n?n:Promise}var M=a((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),R=function(t){function n(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e(n,t),n.prototype.lift=function(t){var n=new k(this,this);return n.operator=t,n},n.prototype._throwIfClosed=function(){if(this.closed)throw new M},n.prototype.next=function(t){var n=this;p((function(){var r,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=u(n.currentObservers),e=o.next();!e.done;e=o.next())e.value.next(t)}catch(t){r={error:t}}finally{try{e&&!e.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}}}))},n.prototype.error=function(t){var n=this;p((function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var r=n.observers;r.length;)r.shift().error(t)}}))},n.prototype.complete=function(){var t=this;p((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var n=t.observers;n.length;)n.shift().complete()}}))},n.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(n.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),n.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},n.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},n.prototype._innerSubscribe=function(t){var n=this,r=this,i=r.observers;return r.hasError||r.isStopped?y:(this.currentObservers=null,i.push(t),new v((function(){n.currentObservers=null,l(i,t)})))},n.prototype._checkFinalizedStatuses=function(t){var n=this,r=n.isStopped;n.hasError?t.error(n.thrownError):r&&t.complete()},n.prototype.asObservable=function(){var t=new P;return t.source=this,t},n.create=function(t,n){return new k(t,n)},n}(P),k=function(t){function n(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e(n,t),n.prototype.next=function(t){var n,r;null===(r=null===(n=this.destination)||void 0===n?void 0:n.next)||void 0===r||r.call(n,t)},n.prototype.error=function(t){var n,r;null===(r=null===(n=this.destination)||void 0===n?void 0:n.error)||void 0===r||r.call(n,t)},n.prototype.complete=function(){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===n||n.call(t)},n.prototype._subscribe=function(t){var n,r;return null!==(r=null===(n=this.source)||void 0===n?void 0:n.subscribe(t))&&void 0!==r?r:y},n}(R),C=function(t){function n(n){var r=t.call(this)||this;return r._value=n,r}return e(n,t),Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),n.prototype._subscribe=function(n){var r=t.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},n.prototype.getValue=function(){var t=this,n=t._value;if(t.hasError)throw t.thrownError;return this._throwIfClosed(),n},n.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},n}(R);function D(t){return t}function U(t,n){return(r,i)=>{const o=function(t,n,r,i){let o=G.get(t);return o||(o=[],G.set(t,o)),o.push({options:r,name:n,optionFactory:i.optionFactory||D,service:{name:i.name,method:i.method||"subscribe"}}),o}(r,i,t,n);1===o.length&&function(t,n){t.connectedCallback=_(t.connectedCallback,n),t.componentWillLoad=function(t,n){return async function(...r){return!0===W.get(this)?(await I(this),t?t.apply(this,r):void 0):_(t,n).apply(this,r)}}(t.componentWillLoad,n),t.componentDidUnload=F(t.componentDidUnload),t.disconnectedCallback=F(t.disconnectedCallback)}(r,o)}}const G=new WeakMap,N=new WeakMap,W=new WeakMap;function _(n,r){return async function(...i){W.set(this,!0),N.set(this,[]),await I(this);const o=new C(this.context);!function(n,r,i){const o=t(n),{get:e,set:u}=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(o),r);Object.defineProperty(o,r,{configurable:!0,get:e,set:function(t){u.call(this,t),i.next(t)}})}(this,"context",o);for(const t of r)t.options=t.optionFactory(t.options,this),H(t.options)&&(t.options.context=o),$(this,t);if(n)return n.apply(this,i)}}function F(t){return async function(...n){let r;return t&&(r=t.apply(this,n)),function(t){const n=N.get(t);for(const t of n)t();N.set(t,[])}(this),r}}function H(t){return"context"in t}function I(t){const n=[];return t.platform||n.push(L(t,"platform")),t.context||n.push(L(t,"context")),0===n.length?Promise.resolve():Promise.all(n)}function L(n,r){const i=t(n);return new Promise((t=>{Object.defineProperty(i,r,{configurable:!0,set:n=>{delete i[r],i[r]=n,t()}})}))}function $(t,n){const r=function(t,n){const r={...n.options};!function(t,n){t.filter&&(t.filter=t.filter.map((t=>t.bind(n)))),t.map&&(t.map=t.map.map((t=>t.bind(n))))}(r,t);const i=n.service.name,o=t.platform;if(!o.has(i))throw new Error(`Service ${i} does not exist`);return o.get(i)[n.service.method](function(t,n){return r=>{t[n]=r}}(t,n.name),r)}(t,n);"function"==typeof r&&N.get(t).push(r)}function q(t={}){return U(t,{name:n.LimeTypeRepository})}function B(t={}){const r={name:n.LimeTypeRepository};return t.map=[K,...t.map||[]],t.context=null,U(t,r)}function K(t){const{limetype:n}=this.context;return t[n]}function V(t={}){const r={name:n.LimeObjectRepository};return t.map=[X,...t.map||[]],t.context=null,U(t,r)}function X(t){const{limetype:n,id:r}=this.context;if(t[n])return t[n].find((t=>t.id===r))}function Y(t){return n=>{(function(t,n){t.commandId=n})(n,t.id),function(t,n){Object.defineProperty(t,Symbol.hasInstance,{value:t=>function(t){let n,r=[],i=t;for(;n=Z(i);)r=[...r,n],i=Object.getPrototypeOf(i);return[...new Set(r)]}(t).includes(n)})}(n,t.id)}}function Z(t){return"string"==typeof t?t:t&&t.constructor&&t.constructor.commandId?t.constructor.commandId:t&&t.commandId?t.commandId:null}n.LimeObjectRepository="state.limeobjects",n.CommandBus="commandBus";let z=class{};z=((t,n)=>{for(var r,i=n,o=t.length-1;o>=0;o--)(r=t[o])&&(i=r(i)||i);return i})([Y({id:"limeobject.bulk-create-dialog"})],z);let J=class{constructor(){this.route=!1}};J=((t,n)=>{for(var r,i=n,o=t.length-1;o>=0;o--)(r=t[o])&&(i=r(i)||i);return i})([Y({id:"limeobject.create-dialog"})],J);let Q=class{};Q=((t,n)=>{for(var r,i=n,o=t.length-1;o>=0;o--)(r=t[o])&&(i=r(i)||i);return i})([Y({id:"limeobject.delete-object"})],Q);let tt=class{};tt=((t,n)=>{for(var r,i=n,o=t.length-1;o>=0;o--)(r=t[o])&&(i=r(i)||i);return i})([Y({id:"limeobject.object-access"})],tt);let nt=class{constructor(){this.route=!1}};nt=((t,n)=>{for(var r,i=n,o=t.length-1;o>=0;o--)(r=t[o])&&(i=r(i)||i);return i})([Y({id:"limeobject.save-object"})],nt);var rt=(t=>(t.AND="AND",t.OR="OR",t.NOT="!",t.EQUALS="=",t.NOT_EQUALS="!=",t.GREATER=">",t.LESS="<",t.IN="IN",t.BEGINS="=?",t.LIKE="?",t.LESS_OR_EQUAL="<=",t.GREATER_OR_EQUAL=">=",t.ENDS="=$",t))(rt||{});const it={Count:"COUNT",Sum:"SUM",Average:"AVG",Maximum:"MAX",Minimum:"MIN"};n.Query="query";const ot={Get:"GET",Post:"POST",Put:"PUT",Delete:"DELETE",Patch:"PATCH"};n.Http="http",n.EventDispatcher="eventDispatcher",n.Translate="translate",n.Dialog="dialog",n.KeybindingRegistry="keybindingRegistry",n.Navigator="navigator";let et=class{};function ut(t){return U(t,{name:n.ConfigRepository})}function ct(t={}){return U(t,{name:n.FilterRepository})}et=((t,n)=>{for(var r,i=n,o=t.length-1;o>=0;o--)(r=t[o])&&(i=r(i)||i);return i})([Y({id:"navigator.navigate"})],et),n.Notification="notifications",n.RouteRegistry="routeRegistry",n.TaskRepository="state.tasks",n.ConfigRepository="state.configs",n.Device="state.device",n.FilterRepository="state.filters",n.UserDataRepository="state.user-data",n.Application="state.application",n.UserPreferencesRepository="userPreferences",n.DateTimeFormatter="datetimeformatter",n.ConditionRegistry="conditionRegistry",n.ViewFactoryRegistry="viewFactoryRegistry",n.WebComponentRegistry="webComponentRegistry",n.NotificationRepository="state.notifications",n.PollerFactory="pollerFactory";export{r as D,V as G,ot as H,ct as K,B as L,i as M,q as T,it as W,ut as Y,rt as Z,n as c,Y as h}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as e}from"./p-1556b545.js";import{c as r,Y as i,K as s,W as o}from"./p-4838284a.js";import{i as n,a,b as l,c as u,g as h,d as c,e as f}from"./p-5322fd19.js";import{i as d}from"./p-b31772c8.js";var v=Object.prototype.hasOwnProperty;class p{constructor(t,e=[]){this.platform=t,this.filters=e}async load(t,e){let r;return r=this.isObjectIdentifier(e)?await this.loadLimeObjectInfoTile(t,e):await this.loadBasicInfoTile(t),r}async loadBasicInfoTile(t){const e=this.getFilter(t.filter);if(!e)throw new Error(`Filter "${t.filter}" not found`);return(await this.query.execute({limetype:e.limetype,responseFormat:{aggregates:{infotiles:{value:{op:t.operator,key:t.name}}}},filter:e.filter})).aggregates.infotiles[0].value}async loadLimeObjectInfoTile(t,e){await this.objectRepository.loadObject(e.limetype,e.id,{properties:[t]});const r=this.objectRepository.getObject(e.limetype,e.id);return null==r?void 0:r.getValue([t.name,t.key].join("."))}isObjectIdentifier(t){return Boolean((null==t?void 0:t.limetype)&&(null==t?void 0:t.id))}getFilter(t){return this.filters.find((e=>e.id===t))}get query(){return this.platform.get(r.Query)}get objectRepository(){return this.platform.get(r.LimeObjectRepository)}}class b{constructor(t){this.locale=t}format(t){let e=String(t);return"number"==typeof t?e=new Intl.NumberFormat(this.locale).format(t):new Date(t).getTime()&&(e=new Intl.DateTimeFormat(this.locale).format(new Date(t))),{value:e}}}class g{constructor(t){this.locale=t}format(t,e){const r=new Date(t);return{prefix:this.formatAffix("prefix",r,e),value:this.formatValue(r,e),suffix:this.formatAffix("suffix",r,e)}}formatValue(t,e){const r=Object.assign({},e.options);if(e.prefix)for(const t of e.prefix)delete r[t];if(e.suffix)for(const t of e.suffix)delete r[t];return new Intl.DateTimeFormat(this.locale,r).format(t)}formatAffix(t,e,r){const i=Object.assign({},r.options);for(const e of Object.keys(i))"hour12"!==e&&((r[t]||[]).includes(e)||delete i[e]);if(0!==Object.values(i).filter(Boolean).length)return new Intl.DateTimeFormat(this.locale,i).format(e)}}class m{constructor(t){this.locale=t}format(t,e){var r,i;const s=new Intl.NumberFormat(this.locale,e.options),o=s.formatToParts(t);let n="",a="",l="";for(const t of o)(null===(r=e.prefix)||void 0===r?void 0:r.includes(t.type))?n+=t.value:(null===(i=e.suffix)||void 0===i?void 0:i.includes(t.type))?l+=t.value:a+=t.value;return a||(a=s.format(t),n="",l=""),{prefix:n,value:a,suffix:l}}}class w{constructor(t){this.locale=t}format(t,e){const r=new Intl.RelativeTimeFormat(this.locale,e.options),{value:i,unit:s}=this.getRelativeTime(t),o=r.formatToParts(i,s);let n="",a="",l="";for(const t of o)"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),r=new Date,i=e.getTime()-r.getTime(),s=[{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 s){const e=i/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 m(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 w(this.locale):new b(this.locale)}}var j=function(t,e,r,i){var s,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(o<3?s(n):o>3?s(e,r,n):s(e,r))||n);return o>3&&n&&Object.defineProperty(e,r,n),n};const O=class{constructor(e){t(this,e),this.aggregateOperator=o.Count,this.loading=!1,this.error=!1}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,r;const i=this.getFilter(),s=this.getFormattedValue(),o={disabled:this.disabled,icon:this.icon,prefix:(null===(t=null==s?void 0:s.prefix)||void 0===t?void 0:t.trim())||this.prefix,suffix:(null===(r=null==s?void 0:s.suffix)||void 0===r?void 0:r.trim())||this.suffix},n=Object.assign(Object.assign({},o),{icon:"error",prefix:"ERROR",loading:!0,label:this.getLabel(i)}),a=Object.assign(Object.assign({},o),{label:this.getLabel(i),link:this.getLink(i),loading:this.loading,value:null==s?void 0:s.value.trim()});return e("limel-info-tile",Object.assign({key:"bb8b9eede8bdd3fdd17934753e463d134c46f7df",class:{error:!i||this.error}},!i||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 b(this.language).format(this.value)}}getLabel(t){return t?"string"==typeof this.label?this.translator.get(this.label):this.getLocalizedString(this.label&&"object"==typeof this.label?this.label:t.name):"No filter set is selected"}getLocalizedString(t){if(function(t){if(null==t)return!0;if(n(t)&&(d(t)||"string"==typeof t||"function"==typeof t.splice||a(t)||l(t)||u(t)))return!t.length;var e=h(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(c(t))return!f(t).length;for(var r in t)if(v.call(t,r))return!1;return!0}(t))return"";let e=t[this.language];return e||(e=t.en||t.en_us||Object.values(null!=e?e:{}).find((t=>!!t))),null!=e?e:""}getLink(t){return t?{href:["explorer",t.limetype,t.id].join("/")}:{href:"#"}}getFilter(){var t;return null===(t=this.filters)||void 0===t?void 0:t.find((t=>t.id===this.filterId))}getFormatter(t){return new y(this.language).createFormatter(this.format,t)}get translator(){return this.platform.get(r.Translate)}get language(){return this.platform.get(r.Application).getLanguage()}get loader(){return new p(this.platform,this.filters)}static get watchers(){return{filterId:["watchFilterId"],propertyName:["watchPropertyName"],aggregateOperator:["watchAggregateOperator"]}}};j([i({})],O.prototype,"config",void 0),j([s()],O.prototype,"filters",void 0),O.style=":host(limebb-info-tile){display:block;overflow:visible !important;background-color:transparent !important}limel-info-tile.error{--info-tile-icon-color:rgb(var(--color-red-dark));border:1px dashed rgb(var(--contrast-500));border-radius:var(--info-tile-border-radius, 1rem)}";export{O as limebb_info_tile}
|