@limetech/lime-crm-building-blocks 1.105.0 → 1.105.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
- package/dist/cjs/{lime-query-validation-82aa2855.js → lime-query-validation-6d419d03.js} +78 -16
- package/dist/cjs/limebb-document-item.cjs.entry.js +29 -8
- package/dist/cjs/limebb-document-picker.cjs.entry.js +3 -3
- package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +2 -2
- 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-property-selector.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{property-resolution-fb42a46b.js → property-resolution-5f798b03.js} +47 -0
- package/dist/collection/components/chat-list/chat-item/chat-item.js +2 -2
- package/dist/collection/components/chat-list/chat-list.js +2 -2
- package/dist/collection/components/component-command-picker/component-config/component-config.js +2 -2
- package/dist/collection/components/component-command-picker/component-picker/component-picker.js +2 -2
- package/dist/collection/components/date-picker/date-picker.js +2 -2
- package/dist/collection/components/date-range/date-range.js +2 -2
- package/dist/collection/components/document-picker/document-item/document-item.js +55 -10
- package/dist/collection/components/document-picker/document-picker.js +5 -5
- package/dist/collection/components/feed/feed-item/feed-timeline-item.js +2 -2
- package/dist/collection/components/feed/feed.js +2 -2
- package/dist/collection/components/info-tile/info-tile.js +2 -2
- package/dist/collection/components/kanban/kanban-group/kanban-group.js +2 -2
- package/dist/collection/components/kanban/kanban-item/kanban-item.js +2 -2
- package/dist/collection/components/kanban/kanban.js +2 -2
- package/dist/collection/components/lime-query-builder/lime-query-validation.js +78 -17
- package/dist/collection/components/lime-query-builder/limetype-field/limetype-field.js +2 -2
- package/dist/collection/components/lime-query-builder/property-resolution.js +46 -0
- package/dist/collection/components/limeobject/file-viewer/file-viewer.js +2 -2
- package/dist/collection/components/loader/loader.js +2 -2
- package/dist/collection/components/locale-picker/locale-picker.js +2 -2
- package/dist/collection/components/notification-list/notification-item/notification-item.js +2 -2
- package/dist/collection/components/notification-list/notification-list.js +2 -2
- package/dist/collection/components/percentage-visualizer/percentage-visualizer.js +2 -2
- package/dist/collection/components/trend-indicator/trend-indicator.js +2 -2
- package/dist/components/document-item.js +31 -9
- package/dist/components/lime-query-validation.js +78 -16
- package/dist/components/limebb-document-picker.js +3 -3
- package/dist/components/property-selector.js +47 -1
- package/dist/esm/lime-crm-building-blocks.js +1 -1
- package/dist/esm/{lime-query-validation-9e386da8.js → lime-query-validation-237ee440.js} +78 -16
- package/dist/esm/limebb-document-item.entry.js +29 -8
- package/dist/esm/limebb-document-picker.entry.js +3 -3
- package/dist/esm/limebb-lime-query-builder.entry.js +2 -2
- 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-property-selector.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{property-resolution-c21a1369.js → property-resolution-e4e8dcf7.js} +47 -1
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/{p-ac9e81c9.entry.js → p-09ce8be4.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-11aa4103.js +1 -0
- package/dist/lime-crm-building-blocks/p-2673c79e.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-80b9d946.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-d8696b23.entry.js → p-9c2062bc.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-b02c99d5.js +1 -0
- package/dist/lime-crm-building-blocks/{p-908dd7d5.entry.js → p-ee0e42dd.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-1421e1f8.entry.js → p-f7ea292d.entry.js} +1 -1
- package/dist/types/components/document-picker/document-item/document-item.d.ts +8 -1
- package/dist/types/components/document-picker/document-item/document-item.types.d.ts +3 -15
- package/dist/types/components/lime-query-builder/lime-query-validation.d.ts +14 -0
- package/dist/types/components/lime-query-builder/property-resolution.d.ts +12 -0
- package/dist/types/components.d.ts +96 -88
- package/package.json +4 -4
- package/dist/lime-crm-building-blocks/p-876701c6.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-9d25ed5a.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-b748c770.js +0 -1
- package/dist/lime-crm-building-blocks/p-efa5bcd4.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as s}from"./p-1556b545.js";import{T as e,c as o}from"./p-4838284a.js";import{g as r,a as n}from"./p-
|
|
1
|
+
import{r as t,c as i,h as s}from"./p-1556b545.js";import{T as e,c as o}from"./p-4838284a.js";import{g as r,a as n}from"./p-b02c99d5.js";import{b as h}from"./p-20bfca36.js";const l=class{constructor(s){t(this,s),this.change=i(this,"change",7),this.label="Property",this.required=!1,this.isOpen=!1,this.navigationPath="",this.menuItems=[],this.handleChipSetWrapperClick=t=>{t.stopPropagation()},this.handleChipSetFocus=()=>{this.isOpen||(this.navigationPath=this.value||"",this.loadMenuItems(),this.isOpen=!0)},this.handleSelect=t=>{t.stopPropagation();const i=t.detail.value;if(!i)return;const s=r(this.limetypes,this.limetype,i);(null==s?void 0:s.relation)?this.navigationPath=i:(this.change.emit(i),this.isOpen=!1,this.navigationPath="")},this.handleNavigateMenu=t=>{var i;t.stopPropagation(),(null===(i=t.detail)||void 0===i?void 0:i.value)&&(this.navigationPath=t.detail.value)},this.handleCancel=()=>{this.isOpen=!1,this.navigationPath=""},this.handleChipSetChange=t=>{t.stopPropagation();const i=t.detail;if(!i)return this.change.emit(""),void(this.navigationPath="");const s=Array.isArray(i)?i:[i];if(0===s.length)this.change.emit(""),this.navigationPath="";else{const t=s.at(-1);t&&this.change.emit(t.value),this.navigationPath=""}}}componentWillLoad(){const t=this.platform.get(o.Application).getLanguage();this.collator=new Intl.Collator(t,{numeric:!0,sensitivity:"base"})}render(){if(!this.limetype||!this.limetypes)return null;const t=this.getChipsForPath(this.navigationPath||this.value||"");return s("limel-menu",{items:this.menuItems,open:this.isOpen,emptyResultMessage:"No available properties",surfaceWidth:"inherit-from-trigger",openDirection:"bottom-end",onSelect:this.handleSelect,onNavigateMenu:this.handleNavigateMenu,onCancel:this.handleCancel},s("div",{slot:"trigger"},s("div",{onClick:this.handleChipSetWrapperClick},s("limel-chip-set",{type:"input",label:this.label,value:t,required:this.required,helperText:this.helperText,delimiter:"›",maxItems:1,onChange:this.handleChipSetChange,onFocus:this.handleChipSetFocus}))))}loadMenuItems(){const t=this.getCurrentLimetype();this.menuItems=t?this.createMenuItems(t,""):[]}getCurrentLimetype(){if(!this.navigationPath)return this.limetypes[this.limetype];const t=r(this.limetypes,this.limetype,this.navigationPath);return(null==t?void 0:t.relation)?t.relation.getLimetype():this.limetypes[this.limetype]}createMenuItems(t,i){const s=[];if(!t)return s;const e=n(t);for(const[t,o]of Object.entries(e)){if("hasmany"===o.type||"hasandbelongstomany"===o.type)continue;const e=i?`${i}.${t}`:t;let r;if(o.relation&&o.relation){const t=o.relation.getLimetype();t&&(r=async()=>this.createMenuItems(t,e))}s.push({text:o.localname||t,secondaryText:this.getSecondaryText(o),icon:this.getIconForProperty(o),value:e,items:r})}return s.sort(((t,i)=>{var s,e;return this.collator.compare(null!==(s=t.text)&&void 0!==s?s:"",null!==(e=i.text)&&void 0!==e?e:"")})),0===s.length?[{text:"No available properties",value:"",disabled:!0}]:s}getSecondaryText(t){var i;if(t.relation){const s=t.relation.getLimetype();return(null===(i=null==s?void 0:s.localname)||void 0===i?void 0:i.singular)||"Object"}return t.type.charAt(0).toUpperCase()+t.type.slice(1)}getIconForProperty(t){return t.relation?h(t.relation.getLimetype()):{name:"dot_circle",color:"rgb(var(--color-gray-default))"}}getChipsForPath(t){if(!t)return[];const i=t.split("."),s=[];let e=this.limetypes[this.limetype],o="";for(const t of i){o=o?`${o}.${t}`:t;const i=n(e)[t];i&&(s.push({id:o,text:i.localname||t,icon:this.getIconForProperty(i),value:o}),i.relation&&(e=i.relation.getLimetype()))}return s}};(function(t,i,s,e){var o,r=arguments.length,n=r<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,i,s,e);else for(var h=t.length-1;h>=0;h--)(o=t[h])&&(n=(r<3?o(n):r>3?o(i,s,n):o(i,s))||n);r>3&&n&&Object.defineProperty(i,s,n)})([e()],l.prototype,"limetypes",void 0),l.style=":host(limebb-property-selector){display:block}limel-menu{display:block;width:100%}";export{l as limebb_property_selector}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){if(!(null==e?void 0:e.properties))return{};const t=Object.assign({},e.properties),r={id:"_id",timestamp:"_timestamp",descriptive:"_descriptive",createduser:"_createduser",createdtime:"_createdtime",updateduser:"_updateduser"};for(const[e,n]of Object.entries(r)){const r=t[e];r&&(t[n]=r,delete t[e])}return t}function t(t,r,n){if(!n||!r||!t)return;const o=n.split(".");let i,s=t[r];for(const t of o){if(!s)return;if(i=e(s)[t],!i)return;i.relation&&(s=i.relation.getLimetype())}return i}function r(t,r,n){if(!n||!r||!t)return{property:void 0};const o=n.split(".");let i,s=t[r];for(let t=0;t<o.length;t++){const r=o[t];if(!s)return{property:void 0};if(i=e(s)[r],!i)return{property:void 0,error:`Property '${r}' does not exist on limetype '${s.name}'`};if("hasmany"===i.type||"hasandbelongstomany"===i.type)return{property:void 0,error:`Cannot filter on many-relation '${o.slice(0,t+1).join(".")}'. Use a related limetype's filter instead.`};i.relation&&(s=i.relation.getLimetype())}return{property:i}}export{e as a,t as g,r as v}
|
|
@@ -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-b748c770.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-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 +1 @@
|
|
|
1
|
-
import{r as i,c as e,h as t,H as r}from"./p-1556b545.js";import{T as s}from"./p-4838284a.js";import{i as o}from"./p-
|
|
1
|
+
import{r as i,c as e,h as t,H as r}from"./p-1556b545.js";import{T as s}from"./p-4838284a.js";import{i as o}from"./p-11aa4103.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,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
-
import { LimeWebComponent, LimeWebComponentContext, LimeWebComponentPlatform } from '@limetech/lime-web-components';
|
|
2
|
+
import { LimeFileUrlType, LimeWebComponent, LimeWebComponentContext, LimeWebComponentPlatform } from '@limetech/lime-web-components';
|
|
3
3
|
import { DocumentItem } from './document-item.types';
|
|
4
4
|
/**
|
|
5
5
|
* Document item
|
|
@@ -25,6 +25,11 @@ export declare class DocumentItemComponent implements LimeWebComponent {
|
|
|
25
25
|
* - 'checkbox': renders a checkbox for multiple selection.
|
|
26
26
|
*/
|
|
27
27
|
type: 'radio' | 'checkbox';
|
|
28
|
+
/**
|
|
29
|
+
* The preferred file URL types to use when displaying
|
|
30
|
+
* the document's image preview.
|
|
31
|
+
*/
|
|
32
|
+
fileTypes: LimeFileUrlType[];
|
|
28
33
|
/**
|
|
29
34
|
* Fired when clicking on the document item.
|
|
30
35
|
*/
|
|
@@ -42,5 +47,7 @@ export declare class DocumentItemComponent implements LimeWebComponent {
|
|
|
42
47
|
private getControlId;
|
|
43
48
|
private isUnavailable;
|
|
44
49
|
private forceInputUnchecked;
|
|
50
|
+
private getImage;
|
|
51
|
+
private hrefForFile;
|
|
45
52
|
}
|
|
46
53
|
//# sourceMappingURL=document-item.d.ts.map
|
|
@@ -1,21 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LimeFile } from '@limetech/lime-web-components';
|
|
2
2
|
export interface DocumentItem {
|
|
3
3
|
/**
|
|
4
|
-
* The
|
|
4
|
+
* The underlying file metadata for the document.
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* The file name of the document, which ends with the file extension.
|
|
9
|
-
*/
|
|
10
|
-
fileName: string;
|
|
11
|
-
/**
|
|
12
|
-
* The size of the document in bytes.
|
|
13
|
-
*/
|
|
14
|
-
fileSize?: number;
|
|
15
|
-
/**
|
|
16
|
-
* A thumbnail visualizing the document.
|
|
17
|
-
*/
|
|
18
|
-
thumbnail?: Image;
|
|
6
|
+
file: LimeFile;
|
|
19
7
|
/**
|
|
20
8
|
* Indicates the selected state of the document.
|
|
21
9
|
*/
|
|
@@ -24,6 +24,20 @@ export declare function validatePlaceholder(value: any, activeLimetype: string |
|
|
|
24
24
|
valid: boolean;
|
|
25
25
|
error?: string;
|
|
26
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* Validates a filter expression key (property path).
|
|
29
|
+
* Supports both regular property paths and placeholders.
|
|
30
|
+
*
|
|
31
|
+
* @param key - Property path to validate (e.g., "name", "company.name", "%activeObject%.name")
|
|
32
|
+
* @param limetypes - All limetype definitions
|
|
33
|
+
* @param limetype - The limetype being filtered
|
|
34
|
+
* @param activeLimetype - Active limetype for placeholder resolution
|
|
35
|
+
* @returns Validation result with error message if invalid
|
|
36
|
+
*/
|
|
37
|
+
export declare function validateFilterKey(key: string, limetypes: Record<string, LimeType>, limetype: string, activeLimetype?: string): {
|
|
38
|
+
valid: boolean;
|
|
39
|
+
error?: string;
|
|
40
|
+
};
|
|
27
41
|
/**
|
|
28
42
|
* Validate a response format against limetype schemas
|
|
29
43
|
* Throws errors for invalid property references
|
|
@@ -14,4 +14,16 @@ export declare function getNormalizedProperties(limetype: LimeType): Record<stri
|
|
|
14
14
|
* @param path
|
|
15
15
|
*/
|
|
16
16
|
export declare function getPropertyFromPath(limetypes: Record<string, LimeType>, limetype: string, path: string): LimeProperty | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Validates a property path to ensure no intermediate properties are hasMany or hasAndBelongsToMany relations.
|
|
19
|
+
* These relation types cannot be traversed in filter expressions.
|
|
20
|
+
* @param limetypes All limetype definitions
|
|
21
|
+
* @param limetype The starting limetype
|
|
22
|
+
* @param path The property path to validate (e.g., "company.name")
|
|
23
|
+
* @returns The property at the end of the path if valid, or undefined with error if invalid
|
|
24
|
+
*/
|
|
25
|
+
export declare function validatePropertyPath(limetypes: Record<string, LimeType>, limetype: string, path: string): {
|
|
26
|
+
property: LimeProperty | undefined;
|
|
27
|
+
error?: string;
|
|
28
|
+
};
|
|
17
29
|
//# sourceMappingURL=property-resolution.d.ts.map
|