@limetech/lime-crm-building-blocks 1.110.4 → 1.111.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 +7 -0
- package/dist/cjs/dom-2ea30350.js +28 -0
- package/dist/cjs/{index.esm-b68bd570.js → index.esm-e01e9bd4.js} +2 -1
- package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
- package/dist/cjs/{lime-query-validation-5eb432fe.js → lime-query-validation-c118b96d.js} +1 -1
- package/dist/cjs/limebb-browser.cjs.entry.js +1 -1
- package/dist/cjs/limebb-chat-item_2.cjs.entry.js +1 -1
- package/dist/cjs/limebb-chat-list.cjs.entry.js +1 -1
- package/dist/cjs/limebb-component-config.cjs.entry.js +1 -1
- package/dist/cjs/limebb-component-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-currency-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-data-cells.cjs.entry.js +1 -1
- package/dist/cjs/limebb-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-feed-timeline-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-feed.cjs.entry.js +1 -1
- package/dist/cjs/limebb-info-tile.cjs.entry.js +1 -1
- package/dist/cjs/limebb-kanban-group.cjs.entry.js +1 -1
- package/dist/cjs/limebb-kanban-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +2 -2
- package/dist/cjs/limebb-lime-query-filter-builder_3.cjs.entry.js +2 -2
- package/dist/cjs/limebb-lime-query-filter-comparison_2.cjs.entry.js +1 -1
- package/dist/cjs/limebb-lime-query-filter-group_3.cjs.entry.js +1 -1
- package/dist/cjs/limebb-lime-query-response-format-builder.cjs.entry.js +2 -2
- package/dist/cjs/limebb-limeobject-file-viewer.cjs.entry.js +1 -1
- package/dist/cjs/limebb-loader.cjs.entry.js +1 -1
- package/dist/cjs/limebb-locale-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-mention.cjs.entry.js +3 -27
- package/dist/cjs/limebb-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-notification-list.cjs.entry.js +1 -1
- package/dist/cjs/limebb-object-chip.cjs.entry.js +216 -0
- package/dist/cjs/limebb-property-selector.cjs.entry.js +2 -2
- package/dist/cjs/limebb-text-editor.cjs.entry.js +2 -2
- package/dist/cjs/{limetype-b91060e7.js → limetype-3c1c53b6.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/object-chip/object-chip.css +3 -0
- package/dist/collection/components/object-chip/object-chip.js +157 -0
- package/dist/collection/util/object-resolver.js +151 -0
- package/dist/components/dom.js +26 -0
- package/dist/components/index.esm.js +1 -1
- package/dist/components/limebb-mention.js +1 -25
- package/dist/components/limebb-object-chip.d.ts +11 -0
- package/dist/components/limebb-object-chip.js +238 -0
- package/dist/esm/dom-9cc051d7.js +26 -0
- package/dist/esm/{index.esm-863d7783.js → index.esm-11a8b9e2.js} +1 -1
- package/dist/esm/lime-crm-building-blocks.js +1 -1
- package/dist/esm/{lime-query-validation-84253575.js → lime-query-validation-01797a51.js} +1 -1
- package/dist/esm/limebb-browser.entry.js +1 -1
- package/dist/esm/limebb-chat-item_2.entry.js +1 -1
- package/dist/esm/limebb-chat-list.entry.js +1 -1
- package/dist/esm/limebb-component-config.entry.js +1 -1
- package/dist/esm/limebb-component-picker.entry.js +1 -1
- package/dist/esm/limebb-currency-picker.entry.js +1 -1
- package/dist/esm/limebb-data-cells.entry.js +1 -1
- package/dist/esm/limebb-date-picker.entry.js +1 -1
- package/dist/esm/limebb-feed-timeline-item.entry.js +1 -1
- package/dist/esm/limebb-feed.entry.js +1 -1
- package/dist/esm/limebb-info-tile.entry.js +1 -1
- package/dist/esm/limebb-kanban-group.entry.js +1 -1
- package/dist/esm/limebb-kanban-item.entry.js +1 -1
- package/dist/esm/limebb-lime-query-builder.entry.js +2 -2
- package/dist/esm/limebb-lime-query-filter-builder_3.entry.js +2 -2
- package/dist/esm/limebb-lime-query-filter-comparison_2.entry.js +1 -1
- package/dist/esm/limebb-lime-query-filter-group_3.entry.js +1 -1
- package/dist/esm/limebb-lime-query-response-format-builder.entry.js +2 -2
- package/dist/esm/limebb-limeobject-file-viewer.entry.js +1 -1
- package/dist/esm/limebb-loader.entry.js +1 -1
- package/dist/esm/limebb-locale-picker.entry.js +1 -1
- package/dist/esm/limebb-mention.entry.js +2 -26
- package/dist/esm/limebb-notification-item.entry.js +1 -1
- package/dist/esm/limebb-notification-list.entry.js +1 -1
- package/dist/esm/limebb-object-chip.entry.js +212 -0
- package/dist/esm/limebb-property-selector.entry.js +2 -2
- package/dist/esm/limebb-text-editor.entry.js +2 -2
- package/dist/esm/{limetype-09477163.js → limetype-12fbba0f.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/{p-bd92871a.entry.js → p-01375d63.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-6aeb7b9b.js → p-0a266c26.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-3b1fcd5b.js → p-199799ff.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-da511a18.entry.js → p-199f0a47.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-27e84266.entry.js → p-1b2ed672.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-14685f34.entry.js → p-3d4c4df2.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-4a85590d.js +1 -0
- package/dist/lime-crm-building-blocks/{p-0da02112.entry.js → p-4b494de7.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-37982f06.entry.js → p-517fd960.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-fc92dab6.entry.js → p-59b4af72.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-f35e4543.entry.js → p-5f5cd2b2.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-f1eee3bb.entry.js → p-6bd3f952.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-c9460ae0.entry.js → p-77e7d7da.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-77ef7ad1.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-c3c0c738.entry.js → p-81583fc8.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-85cae2a1.entry.js → p-85c04627.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-3f0e4017.entry.js → p-87e5d049.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-4fa58e0e.entry.js → p-95b6eaf5.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-77b97c9f.entry.js → p-a954d06e.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-7c04361c.entry.js → p-ac833ff7.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-d4273468.entry.js → p-acf77715.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-cbbcec09.entry.js → p-af1e3cac.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-b7959ddb.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-f97ea913.entry.js → p-c38f0931.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-0ed58846.entry.js → p-d2bd2fc3.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-9f2a9cf5.js → p-d47b6c3c.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-4584e9c8.entry.js → p-e8069516.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-eb4aa158.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-9624acfd.entry.js → p-ef08b09f.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-dd6861b1.entry.js → p-f965d2a6.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-aec5cbca.entry.js → p-f9daa703.entry.js} +1 -1
- package/dist/types/components/object-chip/object-chip.d.ts +47 -0
- package/dist/types/components.d.ts +89 -0
- package/dist/types/util/object-resolver.d.ts +66 -0
- package/package.json +1 -1
- package/dist/lime-crm-building-blocks/p-351de229.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-d51d607b.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,c as e,h as t,H as r}from"./p-52cf8641.js";import{Z as s}from"./p-
|
|
1
|
+
import{r as i,c as e,h as t,H as r}from"./p-52cf8641.js";import{Z as s}from"./p-199799ff.js";import{i as o}from"./p-d47b6c3c.js";import"./p-b02c99d5.js";const l=class{constructor(t){i(this,t),this.change=e(this,"change",7),this.mode="visual",this.codeValue="",this.limetype="",this.handleLimetypeChange=i=>{i.stopPropagation(),this.limetype=i.detail,this.filter=void 0,this.internalResponseFormat={object:{}},this.emitChange()},this.handleFilterChange=i=>{var e;i.stopPropagation(),this.filter=null!==(e=i.detail)&&void 0!==e?e:void 0,this.emitChange()},this.handleResponseFormatChange=i=>{i.stopPropagation(),this.internalResponseFormat=i.detail,this.emitChange()},this.handleLimitChange=i=>{i.stopPropagation();const e=i.detail;this.limit=e?Number.parseInt(e,10):void 0,this.emitChange()},this.handleOrderByChange=i=>{i.stopPropagation(),this.orderBy=i.detail,this.emitChange()},this.handleDescriptionChange=i=>{i.stopPropagation(),this.description=i.detail||void 0,this.emitChange()},this.handleDescriptionBlur=()=>{if(this.description){const i=this.description.trim();i!==this.description&&(this.description=i||void 0,this.emitChange())}},this.handleChange=i=>{i.stopPropagation();const e=i.detail.id;if("visual"===e)try{const i=JSON.parse(this.codeValue);if(!this.checkVisualModeSupport().visualModeSupported)return;this.limetype=i.limetype||"",this.filter=i.filter,this.internalResponseFormat=i.responseFormat,this.limit=i.limit,this.orderBy=i.orderBy,this.description=i["#description"],this.mode="visual",this.change.emit(i)}catch(i){}else"code"===e&&(this.updateCodeValue(),this.mode="code")},this.handleCodeChange=i=>{i.stopPropagation(),this.codeValue=i.detail;try{const i=JSON.parse(this.codeValue);this.change.emit(i)}catch(i){}}}getButtons(){return[{id:"visual",title:"Visual"},{id:"code",title:"Code"}]}get visualModeEnabled(){var i,e,t;return null!==(t=null===(e=null===(i=this.platform)||void 0===i?void 0:i.isFeatureEnabled)||void 0===e?void 0:e.call(i,"useLimeQueryBuilderGuiMode"))&&void 0!==t&&t}componentWillLoad(){if(!this.visualModeEnabled)return this.mode="code",void this.updateCodeValue();this.value&&(this.limetype=this.value.limetype||"",this.filter=this.value.filter,this.internalResponseFormat=this.value.responseFormat,this.limit=this.value.limit,this.orderBy=this.value.orderBy,this.description=this.value["#description"]),this.updateCodeValue(),this.checkVisualModeSupport().visualModeSupported||(this.mode="code")}render(){return t(r,{key:"72ad0a52788c07a8369ee28535d9a05be92f5144"},this.renderHeader(),this.renderContent())}renderContent(){const i=this.checkVisualModeSupport();return this.visualModeEnabled&&"code"!==this.mode?this.renderVisualMode():this.renderCodeMode(i)}emitChange(){"code"!==this.mode&&this.limetype&&this.change.emit(this.buildLimeQuery())}updateCodeValue(){this.codeValue=this.limetype?JSON.stringify(this.buildLimeQuery(),null,2):JSON.stringify(this.value||{},null,2)}buildLimeQuery(){const i={limetype:this.limetype,responseFormat:this.internalResponseFormat||{object:{_id:null}},filter:this.filter};return this.description&&(i["#description"]=this.description),void 0!==this.limit&&this.limit>0&&(i.limit=this.limit),this.orderBy&&this.orderBy.length>0&&(i.orderBy=this.orderBy),i}checkVisualModeSupport(){if(!this.limetypes)return{valid:!0,visualModeSupported:!0,validationErrors:[],visualModeLimitations:[]};let i;if("code"===this.mode&&this.codeValue)try{i=JSON.parse(this.codeValue)}catch(i){return{valid:!1,visualModeSupported:!1,validationErrors:["Invalid JSON"],visualModeLimitations:[]}}else{if(!this.limetype)return{valid:!0,visualModeSupported:!0,validationErrors:[],visualModeLimitations:[]};i={limetype:this.limetype,responseFormat:this.internalResponseFormat||{object:{_id:null}},filter:this.filter},void 0!==this.limit&&this.limit>0&&(i.limit=this.limit)}return o(i,this.limetypes,this.activeLimetype,this.visualModeEnabled)}renderModeSwitch(i){const e=!i.visualModeSupported,r=this.getButtons().map((i=>Object.assign(Object.assign({},i),{selected:i.id===this.mode})));return t("limel-button-group",{slot:"actions",onChange:this.handleChange,value:r,disabled:e})}renderCodeEditor(i){return[t("limel-code-editor",{value:this.codeValue,language:"json",lineNumbers:!0,fold:!0,lint:!0,onChange:this.handleCodeChange}),!i.valid&&i.validationErrors.length>0&&t("div",{class:"validation-errors"},t("strong",null,"Invalid Lime Query:"),t("ul",null,i.validationErrors.map((i=>t("li",null,i))))),this.visualModeEnabled&&i.valid&&!i.visualModeSupported&&i.visualModeLimitations.length>0&&t("div",{class:"visual-mode-limitations"},t("strong",null,"Cannot switch to visual mode:"),t("ul",null,i.visualModeLimitations.map((i=>t("li",null,i)))))]}renderLimetypeSection(){return t("limebb-limetype-field",{platform:this.platform,context:this.context,label:"Limetype",value:this.limetype,required:!0,fieldName:"limetype",onChange:this.handleLimetypeChange})}renderDescriptionSection(){if(this.limetype)return t("section",{class:"description"},t("limel-input-field",{label:"Description",type:"textarea",value:this.description||"",placeholder:"Describe what data this query retrieves...",helperText:"Optional: Help AI agents and humans understand the query purpose",onChange:this.handleDescriptionChange,onBlur:this.handleDescriptionBlur}))}renderResponseFormatSection(){if(this.limetype)return t("section",{class:"response-format"},t("limebb-lime-query-response-format-editor",{platform:this.platform,context:this.context,limetype:this.limetype,value:this.internalResponseFormat,onChange:this.handleResponseFormatChange}))}renderFilterSection(){if(this.limetype)return t("section",{class:"filter"},t("limel-header",{class:"is-narrow",heading:"Filter Conditions",icon:"-lime-filter"}),t("limebb-lime-query-filter-builder",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.filter,onExpressionChange:this.handleFilterChange}))}renderQueryOptionsSection(){var i;if(this.limetype)return t("section",{class:"query-options"},t("limel-header",{class:"is-narrow",heading:"Query Options",icon:"ask_question"}),t("div",{class:"query-options-controls"},t("limel-input-field",{label:"Limit",type:"number",value:(null===(i=this.limit)||void 0===i?void 0:i.toString())||"",placeholder:"No limit",helperText:"Maximum number of results",onChange:this.handleLimitChange}),t("limebb-lime-query-order-by-editor",{platform:this.platform,context:this.context,limetype:this.limetype,value:this.orderBy,onChange:this.handleOrderByChange})))}renderVisualMode(){return t("div",{class:"visual-mode"},this.renderLimetypeSection(),this.renderDescriptionSection(),this.renderResponseFormatSection(),this.renderFilterSection(),this.renderQueryOptionsSection())}renderHeader(){const i=this.checkVisualModeSupport();return t("limel-header",{heading:this.label},this.renderModeControls(i))}renderModeControls(i){if(this.visualModeEnabled)return this.renderModeSwitch(i)}renderCodeMode(i){return t("div",{class:"code-mode"},this.renderCodeEditor(i))}};(function(i,e,t,r){var s,o=arguments.length,l=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(i,e,t,r);else for(var d=i.length-1;d>=0;d--)(s=i[d])&&(l=(o<3?s(l):o>3?s(e,t,l):s(e,t))||l);o>3&&l&&Object.defineProperty(e,t,l)})([s()],l.prototype,"limetypes",void 0),l.style="*,*:before,*:after{box-sizing:border-box}:host(limebb-lime-query-builder){--header-background-color:rgb(var(--contrast-500));--limebb-lime-query-builder-background-color:rgb(var(--contrast-100));--limebb-lime-query-builder-border-radius:0.75rem;--limebb-lime-query-builder-visual-mode-padding:1rem;--limebb-lime-query-builder-group-color:rgb(var(--color-sky-lighter));box-sizing:border-box;width:calc(100% - 1.5rem);margin:0.75rem auto;display:flex;flex-direction:column;border-radius:var(--limebb-lime-query-builder-border-radius);background-color:var(--limebb-lime-query-builder-background-color);box-shadow:var(--shadow-inflated-16)}.visual-mode{display:flex;flex-direction:column;gap:1rem;padding:var(--limebb-lime-query-builder-visual-mode-padding);border:1px solid var(--header-background-color);border-radius:0 0 var(--limebb-lime-query-builder-border-radius) var(--limebb-lime-query-builder-border-radius)}.code-mode{--code-editor-max-height:70vh;display:flex;flex-direction:column;gap:1rem}.code-mode .validation-errors{padding:0.75rem 1rem;color:rgb(var(--color-red-default));background-color:rgb(var(--color-red-lighter));border-left:0.25rem solid rgb(var(--color-red-default));border-radius:0.25rem;font-size:0.875rem}.code-mode .validation-errors strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-mode .validation-errors ul{margin:0;padding-left:1.5rem}.code-mode .validation-errors li{margin:0.25rem 0}.code-mode .visual-mode-limitations{padding:0.75rem 1rem;color:rgb(var(--color-blue-dark));background-color:rgb(var(--color-blue-lighter));border-left:0.25rem solid rgb(var(--color-blue-default));border-radius:0.25rem;font-size:0.875rem}.code-mode .visual-mode-limitations strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-mode .visual-mode-limitations ul{margin:0;padding-left:1.5rem}.code-mode .visual-mode-limitations li{margin:0.25rem 0}section.description,section.filter,section.query-options{display:flex;flex-direction:column;gap:1rem}section h4{margin:0;font-size:1.125rem;font-weight:600;color:rgb(var(--contrast-1000))}limel-header.is-narrow{--header-top-right-left-border-radius:0;width:calc(100% + var(--limebb-lime-query-builder-visual-mode-padding) * 2);margin-left:calc(var(--limebb-lime-query-builder-visual-mode-padding) * -1)}.query-options-controls{display:flex;flex-direction:column;gap:1rem}";export{l as limebb_lime_query_builder}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as r}from"./p-52cf8641.js";import{r as s,c as o}from"./p-
|
|
1
|
+
import{r as t,c as e,h as i,H as r}from"./p-52cf8641.js";import{r as s,c as o}from"./p-199799ff.js";import{g as n}from"./p-0a266c26.js";import{i as l}from"./p-1484e300.js";import{b as a}from"./p-a659d55a.js";import{i as h,a as d,b as m}from"./p-b31772c8.js";import"./p-35897ec3.js";import"./p-fe2b91d9.js";import"./p-5322fd19.js";function c(t){return"string"==typeof t||!h(t)&&d(t)&&"[object String]"==m(t)}const p=class{constructor(i){t(this,i),this.expressionChange=e(this,"expressionChange",7),this.handleAddFirstCondition=()=>{this.expressionChange.emit({key:"",op:s.EQUALS,exp:""})},this.handlePromoteAndAdd=()=>{this.expression&&this.expressionChange.emit({op:s.AND,exp:[this.expression,{key:"",op:s.EQUALS,exp:""}]})},this.handleExpressionChange=t=>{var e;t.stopPropagation(),this.expressionChange.emit(null!==(e=t.detail)&&void 0!==e?e:void 0)}}render(){return this.expression?this.needsPromotion()?this.renderWithPromotionButton():i("limebb-lime-query-filter-expression",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.expression,onExpressionChange:this.handleExpressionChange}):this.renderEmptyState()}needsPromotion(){return!!this.expression&&("key"in this.expression||this.expression.op===s.NOT)}renderEmptyState(){return i("limel-button",{label:"Condition",icon:{name:"plus_math",title:"Add"},onClick:this.handleAddFirstCondition})}renderWithPromotionButton(){return i("div",{class:"expression-with-promotion"},i("limebb-lime-query-filter-expression",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.expression,onExpressionChange:this.handleExpressionChange}),i("limel-button",{label:"Add another condition",icon:"plus_math",onClick:this.handlePromoteAndAdd}))}};p.style=".expression-with-promotion{display:flex;flex-direction:column;gap:1rem}limel-button{width:100%}.query-options-section{margin-top:1rem}";const u=class{constructor(i){t(this,i),this.change=e(this,"change",7),this.label="Sort Order",this.items=[],this.handleItemChange=t=>e=>{e.stopPropagation();const i=[...this.items];null===e.detail?i.splice(t,1):i[t]=e.detail,this.items=i,this.emitChange()},this.handleAddSortField=()=>{this.items=[...this.items,{"":"ASC"}],this.emitChange()}}componentWillLoad(){this.value&&this.value.length>0&&(this.items=[...this.value])}handleValueChange(t){t&&(t.length!==this.items.length||!t.every(((t,e)=>{const i=this.items[e];if(!i)return!1;const r=Object.keys(t)[0],s=Object.keys(i)[0];return r===s&&t[r]===i[s]})))&&(this.items=t.length>0?[...t]:[])}render(){return i(r,{key:"601436a1a47be391bf4768d25ef7f8da911fc80d"},this.renderEmptyState(),this.renderOrderByEditor())}renderEmptyState(){return this.limetype?null:i("div",{class:"empty-state"},i("p",null,"Select a limetype to configure sorting"))}renderOrderByEditor(){return this.limetype?[this.renderHeader(),this.renderOrderByList(),this.renderActions()]:null}renderHeader(){return i("limel-header",{class:"is-narrow",heading:this.label,icon:"sorting_arrows"})}renderOrderByList(){return 0===this.items.length?null:i("div",{class:"order-by-list"},this.items.map(((t,e)=>this.renderItem(t,e))))}renderActions(){return i("limel-button",{label:"Add Sort Field",icon:"plus_math",onClick:this.handleAddSortField})}renderItem(t,e){const r=Object.keys(t)[0]||"";return i("limebb-lime-query-order-by-item",{key:`${r}-${e}`,class:"order-by-item",platform:this.platform,context:this.context,limetype:this.limetype,item:t,onItemChange:this.handleItemChange(e)})}emitChange(){this.change.emit(this.items)}static get watchers(){return{value:["handleValueChange"]}}};u.style=":host(limebb-lime-query-order-by-editor){display:flex;flex-direction:column;gap:1rem;padding:1rem 0}.header{display:flex;justify-content:space-between;align-items:center;gap:1rem}.header h4{margin:0;font-size:1rem;font-weight:600;color:rgb(var(--contrast-1000))}.order-by-list{display:flex;flex-direction:column;gap:1rem;border:1px solid rgb(var(--contrast-300));border-radius:0.25rem;background-color:rgb(var(--contrast-50));min-height:4rem}.order-by-item{padding:0.5rem;border-radius:0.25rem;transition:background-color 0.2s}.order-by-item:hover{background-color:rgb(var(--contrast-100))}.actions{display:flex;width:100%}.summary{display:flex;justify-content:space-between;align-items:center;padding-top:0.5rem;border-top:1px solid rgb(var(--contrast-300))}.summary .count{font-size:0.875rem;font-weight:500;color:rgb(var(--contrast-900))}limel-header.is-narrow{--header-top-right-left-border-radius:0;width:calc(100% + var(--limebb-lime-query-builder-visual-mode-padding) * 2);margin-left:calc(var(--limebb-lime-query-builder-visual-mode-padding) * -1)}.empty-state{padding:0 2rem;text-align:center;color:rgb(var(--contrast-700))}";const b=["string","text","phone","integer","decimal","percent","time","date","year","quarter","month","yesno","link","user","xml","option","set","file","system"],y=b.filter((t=>"system"!==t));y.push("belongsto","hasone","hasmany","hasandbelongstomany");const g=class{constructor(i){t(this,i),this.change=e(this,"change",7),this.propertyFields=[],this.fieldName="limetype",this.handleChange=t=>{t.stopPropagation();let e="";t.detail&&"value"in t.detail&&(e=t.detail.value),this.change.emit(e||void 0)}}componentWillLoad(){const t=this.platform.get(o.Application).getLanguage();this.collator=new Intl.Collator(t,{numeric:!0,sensitivity:"base"})}componentShouldUpdate(t,e,i){var r,s,o,n;return"formInfo"!==i||(o=null===(r=null==t?void 0:t.schema)||void 0===r?void 0:r.oneOf,n=null===(s=null==e?void 0:e.schema)||void 0===s?void 0:s.oneOf,!a(o,n))}render(){var t;const e=this.getLimeTypes().map(f);e.sort(((t,e)=>this.collator.compare(t.text,e.text)));let r=e.find((t=>t.value===this.value)),s=this.invalid;return this.value&&!r&&(s=!0,e.unshift({text:(null===(t=this.limeTypeRepository.getLimeType(this.value))||void 0===t?void 0:t.localname.singular)||this.value,value:this.value}),r=e[0]),e.unshift({text:"",value:""}),i("limel-select",{key:"a6df4090bd93b2fb9d3745b69fcd32a51ff3755b",label:this.label,options:e,value:r,required:this.required,helperText:this.helperText,invalid:s,disabled:this.disabled||this.readonly,onChange:this.handleChange})}componentWillRender(){this.updatePropertyFields(this.value||"")}getLimeTypes(){var t,e;let i=this.limetypes;return(null===(e=null===(t=this.formInfo)||void 0===t?void 0:t.schema)||void 0===e?void 0:e.oneOf)&&(i=this.formInfo.schema.oneOf.map((t=>t.const)).filter(c)),i?i.map((t=>this.limeTypeRepository.getLimeType(t))).filter(l):this.limeTypeRepository.getLimeTypes()}updatePropertyFields(t){for(const e of this.propertyFields)e.limetype=t,e.allowedPropertyTypes===b&&(e.allowedPropertyTypes=y)}get limeTypeRepository(){return this.platform.get(o.LimeTypeRepository)}},f=t=>({text:t.localname.singular,value:t.name,icon:n(t)});export{p as limebb_lime_query_filter_builder,u as limebb_lime_query_order_by_editor,g as limebb_limetype_field}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { LimeWebComponentPlatform } from '@limetech/lime-web-components';
|
|
2
|
+
/**
|
|
3
|
+
* Object chip
|
|
4
|
+
*
|
|
5
|
+
* Renders a `limel-chip` representing a Lime CRM object.
|
|
6
|
+
* The consumer provides `limetype` and `objectid`, and the component
|
|
7
|
+
* takes care of resolving the descriptive text, limetype icon and color,
|
|
8
|
+
* and generating a navigation URL.
|
|
9
|
+
*
|
|
10
|
+
* :::note
|
|
11
|
+
* If `platform` is not supplied as a prop, it will be fetched from the DOM.
|
|
12
|
+
* :::
|
|
13
|
+
*
|
|
14
|
+
* @exampleComponent limebb-example-object-chip
|
|
15
|
+
* @exampleComponent limebb-example-object-chip-icon-and-color-fallbacks
|
|
16
|
+
* @beta
|
|
17
|
+
*/
|
|
18
|
+
export declare class ObjectChip {
|
|
19
|
+
/**
|
|
20
|
+
* Name of the limetype of the object.
|
|
21
|
+
*/
|
|
22
|
+
limetype: string;
|
|
23
|
+
/**
|
|
24
|
+
* Id of the object.
|
|
25
|
+
*/
|
|
26
|
+
objectid: number;
|
|
27
|
+
/**
|
|
28
|
+
* Platform instance. If not provided, the component will
|
|
29
|
+
* walk the DOM to find a parent with a platform.
|
|
30
|
+
*
|
|
31
|
+
* :::note
|
|
32
|
+
* The platform must be available when the component connects to
|
|
33
|
+
* the DOM, either as a prop or via a parent element. Changing
|
|
34
|
+
* the platform after the component has connected is not supported.
|
|
35
|
+
* :::
|
|
36
|
+
*/
|
|
37
|
+
platform?: LimeWebComponentPlatform;
|
|
38
|
+
private data;
|
|
39
|
+
private resolver;
|
|
40
|
+
connectedCallback(): void;
|
|
41
|
+
disconnectedCallback(): void;
|
|
42
|
+
protected handlePropChange(): void;
|
|
43
|
+
render(): any;
|
|
44
|
+
private getChipText;
|
|
45
|
+
private getErrorText;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=object-chip.d.ts.map
|
|
@@ -1753,6 +1753,33 @@ export namespace Components {
|
|
|
1753
1753
|
*/
|
|
1754
1754
|
"platform": LimeWebComponentPlatform;
|
|
1755
1755
|
}
|
|
1756
|
+
/**
|
|
1757
|
+
* Object chip
|
|
1758
|
+
* Renders a `limel-chip` representing a Lime CRM object.
|
|
1759
|
+
* The consumer provides `limetype` and `objectid`, and the component
|
|
1760
|
+
* takes care of resolving the descriptive text, limetype icon and color,
|
|
1761
|
+
* and generating a navigation URL.
|
|
1762
|
+
* :::note
|
|
1763
|
+
* If `platform` is not supplied as a prop, it will be fetched from the DOM.
|
|
1764
|
+
* :::
|
|
1765
|
+
* @exampleComponent limebb-example-object-chip
|
|
1766
|
+
* @exampleComponent limebb-example-object-chip-icon-and-color-fallbacks
|
|
1767
|
+
* @beta
|
|
1768
|
+
*/
|
|
1769
|
+
interface LimebbObjectChip {
|
|
1770
|
+
/**
|
|
1771
|
+
* Name of the limetype of the object.
|
|
1772
|
+
*/
|
|
1773
|
+
"limetype": string;
|
|
1774
|
+
/**
|
|
1775
|
+
* Id of the object.
|
|
1776
|
+
*/
|
|
1777
|
+
"objectid": number;
|
|
1778
|
+
/**
|
|
1779
|
+
* Platform instance. If not provided, the component will walk the DOM to find a parent with a platform. :::note The platform must be available when the component connects to the DOM, either as a prop or via a parent element. Changing the platform after the component has connected is not supported. :::
|
|
1780
|
+
*/
|
|
1781
|
+
"platform"?: LimeWebComponentPlatform;
|
|
1782
|
+
}
|
|
1756
1783
|
/**
|
|
1757
1784
|
* This component generates a visualization that displays a percentage value
|
|
1758
1785
|
* alongside a horizontal bar showing the percentage visually.
|
|
@@ -3516,6 +3543,25 @@ declare global {
|
|
|
3516
3543
|
prototype: HTMLLimebbNotificationListElement;
|
|
3517
3544
|
new (): HTMLLimebbNotificationListElement;
|
|
3518
3545
|
};
|
|
3546
|
+
/**
|
|
3547
|
+
* Object chip
|
|
3548
|
+
* Renders a `limel-chip` representing a Lime CRM object.
|
|
3549
|
+
* The consumer provides `limetype` and `objectid`, and the component
|
|
3550
|
+
* takes care of resolving the descriptive text, limetype icon and color,
|
|
3551
|
+
* and generating a navigation URL.
|
|
3552
|
+
* :::note
|
|
3553
|
+
* If `platform` is not supplied as a prop, it will be fetched from the DOM.
|
|
3554
|
+
* :::
|
|
3555
|
+
* @exampleComponent limebb-example-object-chip
|
|
3556
|
+
* @exampleComponent limebb-example-object-chip-icon-and-color-fallbacks
|
|
3557
|
+
* @beta
|
|
3558
|
+
*/
|
|
3559
|
+
interface HTMLLimebbObjectChipElement extends Components.LimebbObjectChip, HTMLStencilElement {
|
|
3560
|
+
}
|
|
3561
|
+
var HTMLLimebbObjectChipElement: {
|
|
3562
|
+
prototype: HTMLLimebbObjectChipElement;
|
|
3563
|
+
new (): HTMLLimebbObjectChipElement;
|
|
3564
|
+
};
|
|
3519
3565
|
/**
|
|
3520
3566
|
* This component generates a visualization that displays a percentage value
|
|
3521
3567
|
* alongside a horizontal bar showing the percentage visually.
|
|
@@ -3781,6 +3827,7 @@ declare global {
|
|
|
3781
3827
|
"limebb-navigation-button": HTMLLimebbNavigationButtonElement;
|
|
3782
3828
|
"limebb-notification-item": HTMLLimebbNotificationItemElement;
|
|
3783
3829
|
"limebb-notification-list": HTMLLimebbNotificationListElement;
|
|
3830
|
+
"limebb-object-chip": HTMLLimebbObjectChipElement;
|
|
3784
3831
|
"limebb-percentage-visualizer": HTMLLimebbPercentageVisualizerElement;
|
|
3785
3832
|
"limebb-property-selector": HTMLLimebbPropertySelectorElement;
|
|
3786
3833
|
"limebb-summary-popover": HTMLLimebbSummaryPopoverElement;
|
|
@@ -5660,6 +5707,33 @@ declare namespace LocalJSX {
|
|
|
5660
5707
|
*/
|
|
5661
5708
|
"platform": LimeWebComponentPlatform;
|
|
5662
5709
|
}
|
|
5710
|
+
/**
|
|
5711
|
+
* Object chip
|
|
5712
|
+
* Renders a `limel-chip` representing a Lime CRM object.
|
|
5713
|
+
* The consumer provides `limetype` and `objectid`, and the component
|
|
5714
|
+
* takes care of resolving the descriptive text, limetype icon and color,
|
|
5715
|
+
* and generating a navigation URL.
|
|
5716
|
+
* :::note
|
|
5717
|
+
* If `platform` is not supplied as a prop, it will be fetched from the DOM.
|
|
5718
|
+
* :::
|
|
5719
|
+
* @exampleComponent limebb-example-object-chip
|
|
5720
|
+
* @exampleComponent limebb-example-object-chip-icon-and-color-fallbacks
|
|
5721
|
+
* @beta
|
|
5722
|
+
*/
|
|
5723
|
+
interface LimebbObjectChip {
|
|
5724
|
+
/**
|
|
5725
|
+
* Name of the limetype of the object.
|
|
5726
|
+
*/
|
|
5727
|
+
"limetype"?: string;
|
|
5728
|
+
/**
|
|
5729
|
+
* Id of the object.
|
|
5730
|
+
*/
|
|
5731
|
+
"objectid"?: number;
|
|
5732
|
+
/**
|
|
5733
|
+
* Platform instance. If not provided, the component will walk the DOM to find a parent with a platform. :::note The platform must be available when the component connects to the DOM, either as a prop or via a parent element. Changing the platform after the component has connected is not supported. :::
|
|
5734
|
+
*/
|
|
5735
|
+
"platform"?: LimeWebComponentPlatform;
|
|
5736
|
+
}
|
|
5663
5737
|
/**
|
|
5664
5738
|
* This component generates a visualization that displays a percentage value
|
|
5665
5739
|
* alongside a horizontal bar showing the percentage visually.
|
|
@@ -6120,6 +6194,7 @@ declare namespace LocalJSX {
|
|
|
6120
6194
|
"limebb-navigation-button": LimebbNavigationButton;
|
|
6121
6195
|
"limebb-notification-item": LimebbNotificationItem;
|
|
6122
6196
|
"limebb-notification-list": LimebbNotificationList;
|
|
6197
|
+
"limebb-object-chip": LimebbObjectChip;
|
|
6123
6198
|
"limebb-percentage-visualizer": LimebbPercentageVisualizer;
|
|
6124
6199
|
"limebb-property-selector": LimebbPropertySelector;
|
|
6125
6200
|
"limebb-summary-popover": LimebbSummaryPopover;
|
|
@@ -6700,6 +6775,20 @@ declare module "@stencil/core" {
|
|
|
6700
6775
|
* @private
|
|
6701
6776
|
*/
|
|
6702
6777
|
"limebb-notification-list": LocalJSX.LimebbNotificationList & JSXBase.HTMLAttributes<HTMLLimebbNotificationListElement>;
|
|
6778
|
+
/**
|
|
6779
|
+
* Object chip
|
|
6780
|
+
* Renders a `limel-chip` representing a Lime CRM object.
|
|
6781
|
+
* The consumer provides `limetype` and `objectid`, and the component
|
|
6782
|
+
* takes care of resolving the descriptive text, limetype icon and color,
|
|
6783
|
+
* and generating a navigation URL.
|
|
6784
|
+
* :::note
|
|
6785
|
+
* If `platform` is not supplied as a prop, it will be fetched from the DOM.
|
|
6786
|
+
* :::
|
|
6787
|
+
* @exampleComponent limebb-example-object-chip
|
|
6788
|
+
* @exampleComponent limebb-example-object-chip-icon-and-color-fallbacks
|
|
6789
|
+
* @beta
|
|
6790
|
+
*/
|
|
6791
|
+
"limebb-object-chip": LocalJSX.LimebbObjectChip & JSXBase.HTMLAttributes<HTMLLimebbObjectChipElement>;
|
|
6703
6792
|
/**
|
|
6704
6793
|
* This component generates a visualization that displays a percentage value
|
|
6705
6794
|
* alongside a horizontal bar showing the percentage visually.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { LimeObject, LimeType, LimeWebComponentPlatform } from '@limetech/lime-web-components';
|
|
2
|
+
/**
|
|
3
|
+
* State emitted by ObjectResolver whenever resolved data changes.
|
|
4
|
+
*/
|
|
5
|
+
export interface ObjectResolverState {
|
|
6
|
+
limeobject?: LimeObject;
|
|
7
|
+
limetypeData?: LimeType;
|
|
8
|
+
loadFailed: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Build the navigation URL for a Lime CRM object.
|
|
12
|
+
* @param limetype
|
|
13
|
+
* @param objectid
|
|
14
|
+
*/
|
|
15
|
+
export declare function getObjectUrl(limetype: string, objectid: number): string;
|
|
16
|
+
/**
|
|
17
|
+
* Resolves platform, limetype metadata, and object data for a given
|
|
18
|
+
* limetype + objectid pair.
|
|
19
|
+
*
|
|
20
|
+
* Designed to be used by Stencil components: pass an `onStateChange`
|
|
21
|
+
* callback that updates a `@State()` property to trigger re-renders.
|
|
22
|
+
*/
|
|
23
|
+
export declare class ObjectResolver {
|
|
24
|
+
private onStateChange;
|
|
25
|
+
private state;
|
|
26
|
+
private _platform?;
|
|
27
|
+
private limetype;
|
|
28
|
+
private objectid;
|
|
29
|
+
private hasPendingLoad;
|
|
30
|
+
private isDisconnected;
|
|
31
|
+
constructor(onStateChange: (state: ObjectResolverState) => void);
|
|
32
|
+
/**
|
|
33
|
+
* The resolved platform instance, if any.
|
|
34
|
+
*/
|
|
35
|
+
get resolvedPlatform(): LimeWebComponentPlatform | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Initialize the resolver. Call from `connectedCallback()`.
|
|
38
|
+
*
|
|
39
|
+
* @param limetype - name of the limetype
|
|
40
|
+
* @param objectid - id of the object
|
|
41
|
+
* @param hostElement - the component's host element (for DOM-walking fallback)
|
|
42
|
+
* @param platform - optional platform prop (skips DOM walk if provided)
|
|
43
|
+
*/
|
|
44
|
+
connect(limetype: string, objectid: number, hostElement: HTMLElement, platform?: LimeWebComponentPlatform): void;
|
|
45
|
+
/**
|
|
46
|
+
* Handle prop changes. Call from `@Watch` handlers.
|
|
47
|
+
*
|
|
48
|
+
* Debounces via `queueMicrotask` so that simultaneous changes to
|
|
49
|
+
* both `limetype` and `objectid` result in a single load.
|
|
50
|
+
* @param limetype
|
|
51
|
+
* @param objectid
|
|
52
|
+
*/
|
|
53
|
+
update(limetype: string, objectid: number): void;
|
|
54
|
+
/**
|
|
55
|
+
* Prevent stale updates after the component disconnects.
|
|
56
|
+
* Call from `disconnectedCallback()`.
|
|
57
|
+
*/
|
|
58
|
+
disconnect(): void;
|
|
59
|
+
private findPlatform;
|
|
60
|
+
private hasPlatformProp;
|
|
61
|
+
private resolveLimeType;
|
|
62
|
+
private loadLimeObject;
|
|
63
|
+
private isStale;
|
|
64
|
+
private updateState;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=object-resolver.d.ts.map
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e}from"./p-52cf8641.js";import{d as c,c as o}from"./p-3b1fcd5b.js";import{H as s}from"./p-66352a1e.js";let i=class{constructor(t){this.itemId=t}};i=function(t,e,c,o){var s,i=arguments.length,l=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,c):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,c,o);else for(var n=t.length-1;n>=0;n--)(s=t[n])&&(l=(i<3?s(l):i>3?s(e,c,l):s(e,c))||l);return i>3&&l&&Object.defineProperty(e,c,l),l}([c({id:"limebb-feed.highlight-item"})],i);const l=class{constructor(c){t(this,c),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(o.CommandBus)}};export{l as limebb_loader}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,g as o,h as r}from"./p-52cf8641.js";import{c as e}from"./p-3b1fcd5b.js";function i(t,o){if(o(t))return t;let r=t.parentElement||t.parentNode;var e;return(null==(e=r)?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&(r=r.host),r?i(r,o):void 0}const n=class{constructor(o){t(this,o)}connectedCallback(){const t=i(o(this),this.hasPlatform);t&&this.loadLimeObject(t.platform)}hasPlatform(t){return"platform"in t&&!!t.platform&&"object"==typeof t.platform}async loadLimeObject(t){const o=t.get(e.LimeObjectRepository);if(this.limeobject=o.getObject(this.limetype,this.objectid),!this.limeobject){try{await o.loadObject(this.limetype,this.objectid)}catch(t){console.error("Could not load mentioned object")}this.limeobject=o.getObject(this.limetype,this.objectid)}}render(){return this.limeobject?this.renderLimeObject(this.limeobject):this.renderSlot()}renderLimeObject(t){return r("a",{href:`object/${this.limetype}/${this.objectid}`},t.descriptive,this.renderSlot({hidden:!0}))}renderSlot(t={}){return r("span",Object.assign({},t),r("slot",null))}};n.style=':host(limebb-mention){display:inline}a{transition:background-color 0.2s ease;white-space:normal;overflow-wrap:break-word;word-break:break-word;padding:0 0.125rem;border-radius:0.25rem;text-decoration:none;color:rgb(var(--color-blue-default));background-color:rgb(var(--color-blue-default), 0.06)}a:hover{background-color:rgb(var(--color-blue-default), 0.16)}a:before,span:before{content:"@";opacity:0.7}';export{n as limebb_mention}
|