@limetech/lime-crm-building-blocks 1.126.2 → 1.126.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/{index.esm-C1i_NocP.js → index.esm-BSgM4tyh.js} +17 -17
- package/dist/cjs/{lime-query-validation-DOruuzFE.js → lime-query-validation-DhL0xwur.js} +1 -1
- package/dist/cjs/limebb-browser.cjs.entry.js +1 -1
- package/dist/cjs/limebb-chat-icon-list_3.cjs.entry.js +1 -1
- package/dist/cjs/limebb-chat-list.cjs.entry.js +1 -1
- package/dist/cjs/limebb-component-config.cjs.entry.js +1 -1
- package/dist/cjs/limebb-component-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-composer-toolbar.cjs.entry.js +1 -1
- package/dist/cjs/limebb-currency-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-data-cells.cjs.entry.js +1 -1
- package/dist/cjs/limebb-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-feed-timeline-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-feed.cjs.entry.js +1 -1
- package/dist/cjs/limebb-icon-picker.cjs.entry.js +5 -0
- package/dist/cjs/limebb-info-tile.cjs.entry.js +2 -2
- 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 +1 -1
- package/dist/cjs/limebb-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-notification-list.cjs.entry.js +1 -1
- package/dist/cjs/limebb-object-chip.cjs.entry.js +3 -3
- package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +1 -1
- package/dist/cjs/limebb-property-selector.cjs.entry.js +2 -2
- package/dist/cjs/limebb-rule-chip-popover.cjs.entry.js +1 -1
- package/dist/cjs/limebb-rule-editor.cjs.entry.js +1 -1
- package/dist/cjs/limebb-rule-gate.cjs.entry.js +13 -4
- package/dist/cjs/limebb-text-editor.cjs.entry.js +11 -6
- package/dist/cjs/limebb-trend-indicator.cjs.entry.js +1 -1
- package/dist/cjs/{limetype-BlG0Apxb.js → limetype-DQeJRVNw.js} +1 -1
- package/dist/collection/components/dashboard-widget/dashboard-widget.js +1 -1
- package/dist/collection/components/info-tile/info-tile.js +1 -1
- package/dist/collection/components/rule-gate/rule-gate.js +12 -3
- package/dist/collection/components/summary-popover/summary-popover.js +1 -1
- package/dist/collection/components/text-editor/mentions.js +7 -2
- package/dist/collection/components/text-editor/text-editor.js +2 -2
- package/dist/components/index.esm.js +1 -1
- package/dist/components/limebb-icon-picker.js +1 -1
- package/dist/components/limebb-object-chip.js +1 -1
- package/dist/components/limebb-rule-gate.js +1 -1
- package/dist/components/limebb-text-editor.js +1 -1
- package/dist/esm/{index.esm-CMeGYws2.js → index.esm-oW1YVf33.js} +17 -17
- package/dist/esm/{lime-query-validation-DvCLebd2.js → lime-query-validation-C3jEHfxk.js} +1 -1
- package/dist/esm/limebb-browser.entry.js +1 -1
- package/dist/esm/limebb-chat-icon-list_3.entry.js +1 -1
- package/dist/esm/limebb-chat-list.entry.js +1 -1
- package/dist/esm/limebb-component-config.entry.js +1 -1
- package/dist/esm/limebb-component-picker.entry.js +1 -1
- package/dist/esm/limebb-composer-toolbar.entry.js +1 -1
- package/dist/esm/limebb-currency-picker.entry.js +1 -1
- package/dist/esm/limebb-data-cells.entry.js +1 -1
- package/dist/esm/limebb-date-picker.entry.js +1 -1
- package/dist/esm/limebb-feed-timeline-item.entry.js +1 -1
- package/dist/esm/limebb-feed.entry.js +1 -1
- package/dist/esm/limebb-icon-picker.entry.js +5 -0
- package/dist/esm/limebb-info-tile.entry.js +2 -2
- 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 +1 -1
- package/dist/esm/limebb-notification-item.entry.js +1 -1
- package/dist/esm/limebb-notification-list.entry.js +1 -1
- package/dist/esm/limebb-object-chip.entry.js +3 -3
- package/dist/esm/limebb-percentage-visualizer.entry.js +1 -1
- package/dist/esm/limebb-property-selector.entry.js +2 -2
- package/dist/esm/limebb-rule-chip-popover.entry.js +1 -1
- package/dist/esm/limebb-rule-editor.entry.js +1 -1
- package/dist/esm/limebb-rule-gate.entry.js +13 -4
- package/dist/esm/limebb-text-editor.entry.js +11 -6
- package/dist/esm/limebb-trend-indicator.entry.js +1 -1
- package/dist/esm/{limetype-DvPoeXt-.js → limetype-CBSX93Mo.js} +1 -1
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/{p-b978301b.entry.js → p-01ecd249.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-610dae2e.entry.js → p-0ee533c9.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-9f03e766.entry.js → p-148fe32c.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-10ddd002.entry.js → p-16d36b76.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-ef62c7d8.entry.js → p-25d8a718.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-ea461bb7.entry.js → p-38c2fe60.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-25234f4b.entry.js → p-3e4cc2a1.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-e468e359.entry.js → p-3fd4e0a1.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-30778dac.entry.js → p-4e5f55aa.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-7975c91f.entry.js → p-4f1eca0d.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-d026068f.entry.js → p-50e5c571.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-993991af.entry.js → p-5496f907.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-beae8aa1.entry.js → p-56a65792.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-89170cc9.entry.js → p-5b830c09.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-2a05b949.entry.js → p-5c5788de.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-6226829d.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-d1c61830.entry.js → p-625623b7.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-99054b73.entry.js → p-6af7d0d2.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-99790629.entry.js → p-7759fc0c.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-7ace2e41.entry.js → p-7cc615c8.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-92738a30.entry.js → p-82af1ade.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-49b8a9ca.entry.js → p-885592cc.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-8c8bbbd4.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-c43dc121.entry.js → p-931ef83d.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-1955495c.entry.js → p-9bc6a1b7.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-CI7dwT4T.js → p-GT4hqR5i.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-CYiNR7pQ.js → p-VjTMZY3E.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-9ccd9d7f.entry.js → p-a06a01fc.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-a3439b73.entry.js → p-a9ffe56f.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-d33efebb.entry.js → p-b328389c.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-a634c792.entry.js → p-bb3f1fa5.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-47799e80.entry.js → p-cf76665c.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-65ea94b4.entry.js → p-e6374017.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-c3a72b03.entry.js → p-e79208ba.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-62b247c1.entry.js → p-faa89d77.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-e1e1e2d1.entry.js → p-fe4811a1.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-D5qhls4G.js → p-ndni-0im.js} +1 -1
- package/dist/types/components/text-editor/mentions.d.ts +3 -1
- package/package.json +5 -5
- package/dist/lime-crm-building-blocks/p-006b6449.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-6093254e.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,g as i,h as s}from"./p-BIwHMk6j.js";import{g as e}from"./p-
|
|
1
|
+
import{r as t,g as i,h as s}from"./p-BIwHMk6j.js";import{g as e}from"./p-GT4hqR5i.js";import{f as h}from"./p-B95D7tDb.js";import{M as o,b as a}from"./p-ndni-0im.js";const r=o("object-resolver");class l{constructor(t){this.onStateChange=t,this.state={loadFailed:!1},this.hasPendingLoad=!1,this.isDisconnected=!1}get resolvedPlatform(){return this._platform}connect(t,i,s,e){this.limetype=t,this.objectid=i,this.isDisconnected=!1,this.hasPendingLoad=!1,this._platform=e||this.findPlatform(s),this._platform?(this.resolveLimeType(),this.loadLimeObject()):r.error(`No platform found. Pass "platform" prop or place the component inside a parent that exposes "platform". limetype=${t}, objectid=${i}`)}update(t,i){this.limetype=t,this.objectid=i,this.updateState({limeobject:void 0,limetypeData:void 0,loadFailed:!1}),this.hasPendingLoad||(this.hasPendingLoad=!0,queueMicrotask((()=>{if(this.hasPendingLoad=!1,!this.isDisconnected){if(!this._platform)return this.updateState({loadFailed:!0}),void r.warn(`Cannot update: no platform available. limetype=${this.limetype}, objectid=${this.objectid}`);this.resolveLimeType(),this.loadLimeObject()}})))}disconnect(){this.isDisconnected=!0}findPlatform(t){const i=h(t,this.hasPlatformProp);return null==i?void 0:i.platform}hasPlatformProp(t){return"platform"in t&&!!t.platform&&"object"==typeof t.platform}resolveLimeType(){const t=this._platform.get(a.LimeTypeRepository);this.updateState({limetypeData:t.getLimeType(this.limetype)})}async loadLimeObject(){const t=this.limetype,i=this.objectid,s=this._platform.get(a.LimeObjectRepository),e=s.getObject(t,i);if(e)this.updateState({limeobject:e});else{try{await s.loadObject(t,i)}catch(s){if(this.isStale(t,i))return;return this.updateState({loadFailed:!0}),void r.error(`Failed to load ${t}/${i}`,s)}this.isStale(t,i)||this.updateState({limeobject:s.getObject(t,i)})}}isStale(t,i){return this.isDisconnected||this.limetype!==t||this.objectid!==i}updateState(t){this.state=Object.assign(Object.assign({},this.state),t),this.isDisconnected||this.onStateChange(this.state)}}const n=class{constructor(i){t(this,i),this.size="default",this.data={loadFailed:!1},this.resolver=new l((t=>{this.data=t}))}connectedCallback(){this.resolver.connect(this.limetype,this.objectid,i(this),this.platform)}disconnectedCallback(){this.resolver.disconnect()}handlePropChange(){this.resolver.update(this.limetype,this.objectid)}render(){if(!this.resolver.resolvedPlatform)return;const t=e(this.data.limetypeData);return s("limel-chip",{text:this.getChipText(),icon:t,size:this.size,link:{href:(i=this.limetype,h=this.objectid,`object/${i}/${h}`)},loading:!this.data.limeobject&&!this.data.loadFailed});var i,h}getChipText(){var t;return(null===(t=this.data.limeobject)||void 0===t?void 0:t.descriptive)?this.data.limeobject.descriptive:this.data.loadFailed?this.getErrorText():""}getErrorText(){if(!this.resolver.resolvedPlatform)return"loading failed";try{return this.resolver.resolvedPlatform.get(a.Translate).get("webclient.limeobject.errors.load-failed")}catch(t){return"loading failed"}}static get watchers(){return{limetype:[{handlePropChange:0}],objectid:[{handlePropChange:0}]}}};n.style=":host{display:inline-block;vertical-align:baseline}";export{n as limebb_object_chip}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as r}from"./p-BIwHMk6j.js";import{n as s,b as o}from"./p-
|
|
1
|
+
import{r as t,c as e,h as i,H as r}from"./p-BIwHMk6j.js";import{n as s,b as o}from"./p-ndni-0im.js";import{g as n}from"./p-GT4hqR5i.js";import{i as l}from"./p-CkTg5UPD.js";import{b as a}from"./p-CKEnwX6j.js";import{i as h,a as d,b as m}from"./p-BgAfMcRA.js";import"./p-CtcTT7BK.js";function c(t){return"string"==typeof t||!d(t)&&h(t)&&"[object String]"==m(t)}const p=class{constructor(i){t(this,i),this.expressionChange=e(this,"expressionChange"),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"),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:"6ef5ee3cf7b67cc0f821272f9d552eab48b60065"},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:0}]}}};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"),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:"20a7d5eb86c746d11ad805083be5ef9f5fd2397d",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}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as r,h as i,H as o}from"./p-BIwHMk6j.js";import{b as a}from"./p-D5qhls4G.js";const s=class{constructor(o){e(this,o),this.interact=r(this,"interact"),this.renderRelations=()=>{var e,r,o;if(null===(r=null===(e=this.item)||void 0===e?void 0:e.relations)||void 0===r?void 0:r.length)return i("limel-chip-set",{value:null===(o=this.item)||void 0===o?void 0:o.relations})},this.renderAssigneesAvatar=e=>e.picture?i("img",{loading:"lazy",src:e.picture,alt:e.name.text}):i("limel-icon",{name:e.icon.name,style:{color:`${e.icon.color}`,"background-color":`${e.icon.backgroundColor}`}}),this.createMenuItem=e=>{var r,i;return"separator"in e?e:{value:e,text:null!==(r=e.label)&&void 0!==r?r:"",secondaryText:e.description,disabled:e.disabled,icon:null!==(i=e.icon)&&void 0!==i?i:""}},this.handleMenuItemSelect=e=>{var r;e.stopPropagation();const i=null===(r=e.detail.value)||void 0===r?void 0:r.command;i&&this.commandbus.handle(i)},this.handleKeyDown=e=>{"Enter"===e.key&&this.handleKanbanItemClick()},this.handleKanbanItemClick=()=>{this.interact.emit(this.item)}}render(){var e,r;return i(o,{key:"0d3c75642c2ea8ec42e475ef7a5e206f408eb446",id:this.item.id.toString(),class:{"has-unpromoted-actions":!!(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length),"is-selected":!!(null===(r=this.item)||void 0===r?void 0:r.selected)},style:{"--limebb-kanban-item-color-code":`${this.item.color}`},onClick:this.handleKanbanItemClick,onKeyDown:this.handleKeyDown},this.renderHeader(),this.renderContent(),this.renderSlot(),this.renderRelations(),this.renderFooter())}renderHeader(){return i("div",{class:"header"},this.renderIcon(),this.renderHeading(),this.renderUnpromotedActionsMenu())}renderIcon(){var e,r,o,a;if(this.item.icon)return i("limel-icon",{class:"icon",badge:!0,name:null!==(r=null===(e=this.item.icon)||void 0===e?void 0:e.name)&&void 0!==r?r:"dot_circle",style:{color:`${null===(o=this.item.icon)||void 0===o?void 0:o.color}`,"background-color":`${null===(a=this.item.icon)||void 0===a?void 0:a.backgroundColor}`}})}renderContent(){if(this.item.value)return i("div",{class:"content"},this.renderValue())}renderHeading(){if(this.item.heading)return i("limel-markdown",{class:"heading",value:this.item.heading})}renderValue(){if(this.item.value)return i("limel-markdown",{class:"body reset-img-height",value:this.item.value})}renderUnpromotedActionsMenu(){var e,r;if(!(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length))return;const o=this.item.unpromotedActions.map(this.createMenuItem);return i("limel-menu",{class:"unpromoted-actions-menu",items:o,openDirection:"bottom-end",onSelect:this.handleMenuItemSelect},i("limel-icon",{class:"actions",name:"menu_2",slot:"trigger",size:"small",id:"item-actions-tooltip"}),i("limel-tooltip",{elementId:"item-actions-tooltip",label:null===(r=this.translator)||void 0===r?void 0:r.get("webclient.more-actions"),openDirection:"top-end"}))}renderSlot(){var e;if(null===(e=this.item)||void 0===e?void 0:e.bodyComponent)return i("slot",{name:"body"})}renderFooter(){var e;if(null===(e=this.item.assignees)||void 0===e?void 0:e.length)return i("div",{class:"footer"},this.renderAssignees())}renderAssignees(){var e;if(null===(e=this.item.assignees)||void 0===e?void 0:e.length)return i("div",{class:"assignees"},this.item.assignees.map((e=>{var r;return i("limebb-summary-popover",Object.assign({icon:null===(r=e.icon)||void 0===r?void 0:r.name},e.picture&&{image:{src:e.picture,alt:e.name.text||""}},{heading:e.name.text,value:this.createLinkToAssignee(e)}),i("a",{slot:"trigger",class:"assignee",href:e.name.href,title:e.name.text},this.renderAssigneesAvatar(e),i("span",null,e.name.text)))})))}createLinkToAssignee(e){const r=this.translator.get("webclient.actions.goto-object",{limetype:": <br><b>"+e.name.text+"</b>"});return`<a class="author" href="${e.name.href}" title="${e.name.text}">${r}</a>`}get translator(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(a.Translate)}get commandbus(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(a.CommandBus)}};s.style='@charset "UTF-8";*,*:before,*:after{box-sizing:border-box}:host(limebb-kanban-item){position:relative;box-sizing:border-box;display:flex;flex-direction:column;border-radius:0.5rem}:host(limebb-kanban-item):before{content:"";display:block;position:absolute;top:1rem;bottom:1rem;right:0;transform:translateX(50%);width:0.25rem;border-radius:1rem;background-color:var(--limebb-kanban-item-color-code)}.content{padding-top:0.25rem}.header{display:flex;align-items:flex-start;gap:0.5rem;min-height:1.75rem;padding:0.25rem 0.5rem;border-radius:0.5rem 0.5rem 0 0;background-color:rgb(var(--contrast-300))}.header a{position:relative;cursor:pointer;transition:color 0.2s ease;color:var(--mdc-theme-primary);text-decoration:none}.header a:before{transition:opacity 0.2s ease, transform 0.3s ease-out;content:"";position:absolute;inset:auto 0 0 0;width:calc(100% - 0.5rem);margin:auto;height:0.125rem;border-radius:1rem;background-color:currentColor;opacity:0;transform:scale(0.6)}.header a:hover{color:rgb(var(--color-teal-light))}.header a:hover:before{opacity:0.3;transform:scale(1)}.heading{--markdown-hyperlink-color:var(--mdc-theme-primary);--markdown-hyperlink-color--hovered:rgb(var(--color-teal-light))}.unpromoted-actions-menu{margin:-0.5rem -0.5rem -0.25rem auto}.body{--limel-top-edge-fade-height:0.5rem;--limel-bottom-edge-fade-height:0.5rem;display:block;padding-left:0.5rem;padding-right:0.5rem;margin-top:-0.5rem;color:rgb(var(--contrast-1100));max-height:12rem;--limel-overflow-mask-vertical:linear-gradient( to bottom, transparent 0%, black calc(0% + var(--limel-top-edge-fade-height, 1rem)), black calc(100% - var(--limel-bottom-edge-fade-height, 1rem)), transparent 100% );-webkit-mask-image:var(--limel-overflow-mask-vertical);mask-image:var(--limel-overflow-mask-vertical);padding-top:var(--limel-top-edge-fade-height, 1rem);padding-bottom:var(--limel-bottom-edge-fade-height, 1rem)}limel-chip-set{--limel-chip-size:1.5rem;display:block;margin-left:-0.5rem;margin-right:0.5rem;padding-bottom:0.5rem}.footer{position:relative;display:flex;align-items:center;gap:0.5rem;padding:0.25rem 0.25rem 0.125rem;margin:0 0.25rem;border-top:1px dashed rgb(var(--contrast-300))}.header limel-icon,.footer limel-icon{flex-shrink:0;width:1.25rem;height:1.25rem}.header .actions{margin:0.5rem 0.25rem 0}.header .actions:hover{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal)}.header .actions:hover:hover,.header .actions:hover:focus,.header .actions:hover:focus-visible{will-change:color, background-color, box-shadow, transform}.header .actions:hover:hover,.header .actions:hover:focus-visible{transform:translate3d(0, -0.04rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.header .actions:hover:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.header .actions:hover:hover,.header .actions:hover:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.footer img{border-radius:50%;object-fit:cover;box-shadow:0 0 0 1px rgb(var(--contrast-800), 0.4);flex-shrink:0;width:1.25rem;height:1.25rem}.assignees{display:flex;align-items:center;gap:0.25rem}.assignees:has(>:nth-child(2)) span{display:none}.assignees:has(>:nth-child(2)) img,.assignees:has(>:nth-child(2)) limel-icon{margin-right:-0.5rem}.assignees:hover img,.assignees:hover limel-icon,.assignees:focus-within img,.assignees:focus-within limel-icon{margin-right:0rem}.assignees:hover .assignee:not(:hover):not(:focus-visible) img,.assignees:hover .assignee:not(:hover):not(:focus-visible) limel-icon,.assignees:focus-within .assignee:not(:hover):not(:focus-visible) img,.assignees:focus-within .assignee:not(:hover):not(:focus-visible) limel-icon{filter:grayscale(1);opacity:0.6}.assignee{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:transparent;display:flex;align-items:center;text-decoration:none;gap:0.25rem;margin-left:0;border-radius:1rem}.assignee:hover,.assignee:focus,.assignee:focus-visible{will-change:color, background-color, box-shadow, transform}.assignee:hover,.assignee:focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}.assignee:hover{box-shadow:var(--button-shadow-hovered)}.assignee:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.assignee:hover,.assignee:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.assignee:focus{outline:none}.assignee:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.assignee limel-icon,.assignee img{transition:margin 0.2s ease, opacity 0.2s ease, filter 0.2s ease}.assignee limel-icon{padding:0.125rem;box-shadow:0 0 0 1px rgb(var(--contrast-800), 0.4);background-color:rgb(var(--contrast-100))}.assignee span{font-size:0.75rem;color:rgb(var(--contrast-900));padding-right:0.5rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}slot[name=body]{display:block;padding:0.5rem}';export{s as limebb_kanban_item}
|
|
1
|
+
import{r as e,c as r,h as i,H as o}from"./p-BIwHMk6j.js";import{b as a}from"./p-ndni-0im.js";const s=class{constructor(o){e(this,o),this.interact=r(this,"interact"),this.renderRelations=()=>{var e,r,o;if(null===(r=null===(e=this.item)||void 0===e?void 0:e.relations)||void 0===r?void 0:r.length)return i("limel-chip-set",{value:null===(o=this.item)||void 0===o?void 0:o.relations})},this.renderAssigneesAvatar=e=>e.picture?i("img",{loading:"lazy",src:e.picture,alt:e.name.text}):i("limel-icon",{name:e.icon.name,style:{color:`${e.icon.color}`,"background-color":`${e.icon.backgroundColor}`}}),this.createMenuItem=e=>{var r,i;return"separator"in e?e:{value:e,text:null!==(r=e.label)&&void 0!==r?r:"",secondaryText:e.description,disabled:e.disabled,icon:null!==(i=e.icon)&&void 0!==i?i:""}},this.handleMenuItemSelect=e=>{var r;e.stopPropagation();const i=null===(r=e.detail.value)||void 0===r?void 0:r.command;i&&this.commandbus.handle(i)},this.handleKeyDown=e=>{"Enter"===e.key&&this.handleKanbanItemClick()},this.handleKanbanItemClick=()=>{this.interact.emit(this.item)}}render(){var e,r;return i(o,{key:"0d3c75642c2ea8ec42e475ef7a5e206f408eb446",id:this.item.id.toString(),class:{"has-unpromoted-actions":!!(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length),"is-selected":!!(null===(r=this.item)||void 0===r?void 0:r.selected)},style:{"--limebb-kanban-item-color-code":`${this.item.color}`},onClick:this.handleKanbanItemClick,onKeyDown:this.handleKeyDown},this.renderHeader(),this.renderContent(),this.renderSlot(),this.renderRelations(),this.renderFooter())}renderHeader(){return i("div",{class:"header"},this.renderIcon(),this.renderHeading(),this.renderUnpromotedActionsMenu())}renderIcon(){var e,r,o,a;if(this.item.icon)return i("limel-icon",{class:"icon",badge:!0,name:null!==(r=null===(e=this.item.icon)||void 0===e?void 0:e.name)&&void 0!==r?r:"dot_circle",style:{color:`${null===(o=this.item.icon)||void 0===o?void 0:o.color}`,"background-color":`${null===(a=this.item.icon)||void 0===a?void 0:a.backgroundColor}`}})}renderContent(){if(this.item.value)return i("div",{class:"content"},this.renderValue())}renderHeading(){if(this.item.heading)return i("limel-markdown",{class:"heading",value:this.item.heading})}renderValue(){if(this.item.value)return i("limel-markdown",{class:"body reset-img-height",value:this.item.value})}renderUnpromotedActionsMenu(){var e,r;if(!(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length))return;const o=this.item.unpromotedActions.map(this.createMenuItem);return i("limel-menu",{class:"unpromoted-actions-menu",items:o,openDirection:"bottom-end",onSelect:this.handleMenuItemSelect},i("limel-icon",{class:"actions",name:"menu_2",slot:"trigger",size:"small",id:"item-actions-tooltip"}),i("limel-tooltip",{elementId:"item-actions-tooltip",label:null===(r=this.translator)||void 0===r?void 0:r.get("webclient.more-actions"),openDirection:"top-end"}))}renderSlot(){var e;if(null===(e=this.item)||void 0===e?void 0:e.bodyComponent)return i("slot",{name:"body"})}renderFooter(){var e;if(null===(e=this.item.assignees)||void 0===e?void 0:e.length)return i("div",{class:"footer"},this.renderAssignees())}renderAssignees(){var e;if(null===(e=this.item.assignees)||void 0===e?void 0:e.length)return i("div",{class:"assignees"},this.item.assignees.map((e=>{var r;return i("limebb-summary-popover",Object.assign({icon:null===(r=e.icon)||void 0===r?void 0:r.name},e.picture&&{image:{src:e.picture,alt:e.name.text||""}},{heading:e.name.text,value:this.createLinkToAssignee(e)}),i("a",{slot:"trigger",class:"assignee",href:e.name.href,title:e.name.text},this.renderAssigneesAvatar(e),i("span",null,e.name.text)))})))}createLinkToAssignee(e){const r=this.translator.get("webclient.actions.goto-object",{limetype:": <br><b>"+e.name.text+"</b>"});return`<a class="author" href="${e.name.href}" title="${e.name.text}">${r}</a>`}get translator(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(a.Translate)}get commandbus(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(a.CommandBus)}};s.style='@charset "UTF-8";*,*:before,*:after{box-sizing:border-box}:host(limebb-kanban-item){position:relative;box-sizing:border-box;display:flex;flex-direction:column;border-radius:0.5rem}:host(limebb-kanban-item):before{content:"";display:block;position:absolute;top:1rem;bottom:1rem;right:0;transform:translateX(50%);width:0.25rem;border-radius:1rem;background-color:var(--limebb-kanban-item-color-code)}.content{padding-top:0.25rem}.header{display:flex;align-items:flex-start;gap:0.5rem;min-height:1.75rem;padding:0.25rem 0.5rem;border-radius:0.5rem 0.5rem 0 0;background-color:rgb(var(--contrast-300))}.header a{position:relative;cursor:pointer;transition:color 0.2s ease;color:var(--mdc-theme-primary);text-decoration:none}.header a:before{transition:opacity 0.2s ease, transform 0.3s ease-out;content:"";position:absolute;inset:auto 0 0 0;width:calc(100% - 0.5rem);margin:auto;height:0.125rem;border-radius:1rem;background-color:currentColor;opacity:0;transform:scale(0.6)}.header a:hover{color:rgb(var(--color-teal-light))}.header a:hover:before{opacity:0.3;transform:scale(1)}.heading{--markdown-hyperlink-color:var(--mdc-theme-primary);--markdown-hyperlink-color--hovered:rgb(var(--color-teal-light))}.unpromoted-actions-menu{margin:-0.5rem -0.5rem -0.25rem auto}.body{--limel-top-edge-fade-height:0.5rem;--limel-bottom-edge-fade-height:0.5rem;display:block;padding-left:0.5rem;padding-right:0.5rem;margin-top:-0.5rem;color:rgb(var(--contrast-1100));max-height:12rem;--limel-overflow-mask-vertical:linear-gradient( to bottom, transparent 0%, black calc(0% + var(--limel-top-edge-fade-height, 1rem)), black calc(100% - var(--limel-bottom-edge-fade-height, 1rem)), transparent 100% );-webkit-mask-image:var(--limel-overflow-mask-vertical);mask-image:var(--limel-overflow-mask-vertical);padding-top:var(--limel-top-edge-fade-height, 1rem);padding-bottom:var(--limel-bottom-edge-fade-height, 1rem)}limel-chip-set{--limel-chip-size:1.5rem;display:block;margin-left:-0.5rem;margin-right:0.5rem;padding-bottom:0.5rem}.footer{position:relative;display:flex;align-items:center;gap:0.5rem;padding:0.25rem 0.25rem 0.125rem;margin:0 0.25rem;border-top:1px dashed rgb(var(--contrast-300))}.header limel-icon,.footer limel-icon{flex-shrink:0;width:1.25rem;height:1.25rem}.header .actions{margin:0.5rem 0.25rem 0}.header .actions:hover{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal)}.header .actions:hover:hover,.header .actions:hover:focus,.header .actions:hover:focus-visible{will-change:color, background-color, box-shadow, transform}.header .actions:hover:hover,.header .actions:hover:focus-visible{transform:translate3d(0, -0.04rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.header .actions:hover:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.header .actions:hover:hover,.header .actions:hover:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.footer img{border-radius:50%;object-fit:cover;box-shadow:0 0 0 1px rgb(var(--contrast-800), 0.4);flex-shrink:0;width:1.25rem;height:1.25rem}.assignees{display:flex;align-items:center;gap:0.25rem}.assignees:has(>:nth-child(2)) span{display:none}.assignees:has(>:nth-child(2)) img,.assignees:has(>:nth-child(2)) limel-icon{margin-right:-0.5rem}.assignees:hover img,.assignees:hover limel-icon,.assignees:focus-within img,.assignees:focus-within limel-icon{margin-right:0rem}.assignees:hover .assignee:not(:hover):not(:focus-visible) img,.assignees:hover .assignee:not(:hover):not(:focus-visible) limel-icon,.assignees:focus-within .assignee:not(:hover):not(:focus-visible) img,.assignees:focus-within .assignee:not(:hover):not(:focus-visible) limel-icon{filter:grayscale(1);opacity:0.6}.assignee{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:transparent;display:flex;align-items:center;text-decoration:none;gap:0.25rem;margin-left:0;border-radius:1rem}.assignee:hover,.assignee:focus,.assignee:focus-visible{will-change:color, background-color, box-shadow, transform}.assignee:hover,.assignee:focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}.assignee:hover{box-shadow:var(--button-shadow-hovered)}.assignee:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.assignee:hover,.assignee:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.assignee:focus{outline:none}.assignee:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.assignee limel-icon,.assignee img{transition:margin 0.2s ease, opacity 0.2s ease, filter 0.2s ease}.assignee limel-icon{padding:0.125rem;box-shadow:0 0 0 1px rgb(var(--contrast-800), 0.4);background-color:rgb(var(--contrast-100))}.assignee span{font-size:0.75rem;color:rgb(var(--contrast-900));padding-right:0.5rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}slot[name=body]{display:block;padding:0.5rem}';export{s as limebb_kanban_item}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,r as t,c as r}from"./p-BIwHMk6j.js";import{b as n}from"./p-D5qhls4G.js";function l(e,t){return t?{type:"not",rule:e}:e}function o(e,t){return e.length===t.length&&e.every(((e,r)=>e===t[r]))}function i(e,t){return e.filter((e=>o(e.path,t)))}function s(e,t){let r=e;for(const e of t)r=a(r,e);return r}function u(e,t,r){if(0===t.length)return r;const[n,...l]=t;if("not"===e.type&&"rule"===n)return Object.assign(Object.assign({},e),{rule:u(e.rule,l,r)});if(("all"===e.type||"any"===e.type)&&"rules"===n){if(0===l.length)return r;const[t,...n]=l;if("number"!=typeof t)return e;const o=[...e.rules];return o[t]=u(o[t],n,r),Object.assign(Object.assign({},e),{rules:o})}return e}function a(e,t){return"not"===e.type&&"rule"===t?e.rule:"all"!==e.type&&"any"!==e.type||"rules"!==t?"all"!==e.type&&"any"!==e.type||"number"!=typeof t?e:e.rules[t]:e}const c={name:"question",color:"rgb(var(--color-glaucous-light))"};function d(e){return`__chip__:${e}`}function h(e){return"ref"===e.type?{ref:e,isNegated:!1}:"not"===e.type&&"ref"===e.rule.type?{ref:e.rule,isNegated:!0}:null}const p=({groupNode:t,groupPath:r,chipChildren:n,ctx:l})=>{const o=new Map,i=n.map((e=>{const t=d(e.index);o.set(t,e);const r=(n=e.ref.id,null!==(i=l.primitiveOptions.find((e=>e.value===n)))&&void 0!==i?i:{value:n,text:n,icon:c});var n,i;return Object.assign(Object.assign({},r),{text:e.isNegated?`¬ ${r.text}`:r.text,value:t})})),s=(u=l.primitiveOptions,e=>Promise.resolve(function(e,t){if(!t)return e;const r=t.toLocaleLowerCase().split(/\s+/);return e.filter((e=>r.every((t=>{var r,n;return e.text.toLocaleLowerCase().includes(t)||(null===(r=e.secondaryText)||void 0===r?void 0:r.toLocaleLowerCase().includes(t))||(null===(n=e.value)||void 0===n?void 0:n.toLocaleLowerCase().includes(t))}))))}(u,e)));var u;const a=function(e,t,r){var n;const l=_(t,r);return null===l?null:null!==(n=e.find((e=>e.index===l)))&&void 0!==n?n:null}(n,r,l.openChipPath),h="all"===t.type?"&":"|";return e("limel-popover",{class:"rule-node__chips-popover",open:null!==a,openDirection:"bottom-start",onClose:l.onPopoverClose},e("div",{slot:"trigger",class:"rule-node__chips"},e("limel-picker",{multiple:!0,label:l.translator.get("webclient.rule-editor.rules-label"),value:i,searcher:s,delimiter:h,readonly:l.readonly,disabled:l.disabled,onChange:f(t,r,o,l),onInteract:b(r,o,l)})),e("div",null,function(t,r,n){if(!t)return null;const l=function(e,t){return[...e,"rules",t]}(r,t.index);return e("limebb-rule-chip-popover",{platform:n.platform,context:n.context,refNode:t.ref,isNegated:t.isNegated,metadata:n.metadataById.get(t.ref.id),readonly:n.readonly,disabled:n.disabled,isMutable:n.isMutable,onNegate:v(t,l,n),onUpdateArgs:g(t,l,n),onDeleteChip:m(l,n)})}(a,r,l)))},f=(e,t,r,n)=>l=>{l.stopPropagation();const o=Array.isArray(l.detail)?l.detail:[],i=_(t,n.openChipPath);if(null!==i){const e=d(i);o.every((t=>t.value!==e))&&n.onPopoverClose()}const s=o.flatMap((e=>{if("string"!=typeof e.value)return[];const t=r.get(e.value);return t?[t.isNegated?{type:"not",rule:t.ref}:t.ref]:[{type:"ref",id:e.value}]})),u=e.rules.filter((e=>null===h(e)));n.onReplaceNode(t,Object.assign(Object.assign({},e),{rules:[...s,...u]}))},b=(e,t,r)=>n=>{n.stopPropagation();const l=function(e){if("string"==typeof e)return e;if(e&&"object"==typeof e&&"value"in e){const t=e.value;return"string"==typeof t?t:void 0}}(n.detail),o=l?t.get(l):void 0;o&&r.onChipInteract([...e,"rules",o.index])},v=(e,t,r)=>n=>{n.stopPropagation(),r.onReplaceNode(t,n.detail?{type:"not",rule:e.ref}:e.ref)},g=(e,t,r)=>n=>{n.stopPropagation();const l=e.isNegated?[...t,"rule"]:t;r.onUpdateArgs(l,n.detail)},m=(e,t)=>()=>{t.onDelete(e)};function _(e,t){if(!t||t.length<2)return null;if(!o((r=t,r.slice(0,-2)),e))return null;var r;const n=t.at(-1);return"number"==typeof n?n:null}const y=({node:t,path:r,isNegated:n,ctx:l})=>{const o=n?[...r,"rule"]:r,s=n?[...i(l.issues,r),...i(l.issues,o)]:i(l.issues,r),u=[],a=[];for(const[e,r]of t.rules.entries()){const t=h(r);t?u.push(Object.assign(Object.assign({},t),{index:e})):a.push({child:r,index:e})}const c=function(e){return[{value:"all",text:e.translator.get("webclient.rule-editor.combinator.all")},{value:"any",text:e.translator.get("webclient.rule-editor.combinator.any")}]}(l),d=c.find((e=>e.value===t.type));return e("div",{class:(f=t.type,b=s,{"rule-node":!0,[`rule-node--${f}`]:!0,"rule-node--invalid":b.length>0}),key:x(r)},e("div",{class:"rule-node__header"},e("limel-select",{class:"rule-node__combinator-select",value:d,options:c,disabled:!l.isMutable,onChange:C(t,r,n,l)}),function(t,r,n,l){return l.isMutable?e("div",{class:"rule-node__header-actions"},e("limel-switch",{class:"rule-node__negate-switch",label:l.translator.get("webclient.rule-editor.negate"),value:n,onChange:O(t,r,l)}),e("limel-icon-button",{icon:"trash",label:l.translator.get("webclient.rule-editor.delete"),onClick:()=>l.onDelete(r)})):null}(t,r,n,l)),e("div",{class:"rule-node__body"},e(z,{issues:s}),e(p,{groupNode:t,groupPath:o,chipChildren:u,ctx:l}),function(t,r,n){return 0===t.length?null:e("div",{class:"rule-node__children"},t.map((t=>e(N,{node:t.child,path:[...r,"rules",t.index],ctx:n}))))}(a,o,l),function(t,r,n,l){return l.isMutable?e("div",{class:"rule-node__footer"},e("limel-button",{icon:"add",label:l.translator.get("webclient.rule-editor.add-nested-group"),onClick:w(t,r,n,l)})):null}(t,r,n,l)));var f,b};function x(e){return 0===e.length?"root":e.join("/")}function j(e,t,r,n){n.onReplaceNode(t,l(e,r))}const C=(e,t,r,n)=>l=>{l.stopPropagation();const o=l.detail.value;o!==e.type&&j(Object.assign(Object.assign({},e),{type:o}),t,r,n)},w=(e,t,r,n)=>()=>{var l,o;j((l=e,o={type:"all",rules:[]},Object.assign(Object.assign({},l),{rules:[...l.rules,o]})),t,r,n)},O=(e,t,r)=>n=>{n.stopPropagation(),r.onReplaceNode(t,l(e,n.detail))},N=t=>{const{node:r,path:n,ctx:l}=t,o=M(r);return o?e(y,{node:o.node,path:n,isNegated:o.isNegated,ctx:l}):null},k=e=>"not"===e.type&&("all"===e.rule.type||"any"===e.rule.type);function M(e){if("all"===e.type||"any"===e.type)return{node:e,isNegated:!1};if(k(e))return{node:e.rule,isNegated:!0};if("not"===e.type){const t=M(e.rule);if(t)return{node:t.node,isNegated:!t.isNegated}}return null}const z=({issues:t})=>0===t.length?null:t.map((t=>e("div",{class:"rule-node__issue"},t.message))),A=class{constructor(e){t(this,e),this.change=r(this,"change"),this.issues=[],this.openChipPath=null,this.metadataById=new Map,this.primitiveOptions=[],this.normalizedCache=null,this.handleDelete=e=>{this.openChipPath=null,this.emitIfChanged(function(e,t){if(0===t.length)return{type:"all",rules:[]};const r=t.slice(0,-1),n=t.at(-1),l=s(e,r);if(("all"===l.type||"any"===l.type)&&"number"==typeof n){const t=[...l.rules];return t.splice(n,1),u(e,r,Object.assign(Object.assign({},l),{rules:t}))}return"not"===l.type&&"rule"===n?u(e,r,{type:"all",rules:[]}):e}(this.normalizedValue,e))},this.handleUpdateArgs=(e,t)=>{this.emitIfChanged(function(e,t,r){const n=s(e,t);return"ref"!==n.type?e:u(e,t,Object.assign(Object.assign({},n),{args:r}))}(this.normalizedValue,e,t))},this.handleReplaceNode=(e,t)=>{this.emitIfChanged(function(e,t,r){return u(e,t,r)}(this.normalizedValue,e,t))},this.handleChipInteract=e=>{this.openChipPath=e},this.handlePopoverClose=()=>{this.openChipPath=null}}componentWillLoad(){this.indexMetadata(),this.runValidation()}componentDidLoad(){this.emitNormalization()}onValueChange(){this.emitNormalization()||this.runValidation()}onAvailableContextsChange(){this.runValidation()}render(){return e("div",{key:"8e0da39f6544c86de0143e91a6c48c9f2654315f",class:{"rule-editor":!0,"rule-editor--disabled":this.disabled}},this.renderLabel(),e(N,{key:"cd093f5dc5a9b747036f581e6230f1205cf834e6",node:this.normalizedValue,path:[],ctx:this.createRenderContext()}),this.renderHelperText())}renderLabel(){return this.label?e("div",{class:"rule-editor__label"},this.label):null}renderHelperText(){return this.helperText?e("div",{class:"rule-editor__helper-text"},this.helperText):null}createRenderContext(){return{issues:this.issues,metadataById:this.metadataById,primitiveOptions:this.primitiveOptions,isMutable:!this.readonly&&!this.disabled,readonly:this.readonly,disabled:this.disabled,platform:this.platform,context:this.context,translator:this.platform.get(n.Translate),openChipPath:this.openChipPath,onDelete:this.handleDelete,onUpdateArgs:this.handleUpdateArgs,onReplaceNode:this.handleReplaceNode,onChipInteract:this.handleChipInteract,onPopoverClose:this.handlePopoverClose}}indexMetadata(){var e,t,r;const l=null!==(r=null===(t=(e=this.ruleRegistry).listMetadata)||void 0===t?void 0:t.call(e))&&void 0!==r?r:[];var o,i;this.metadataById=new Map(l.map((e=>[e.id,e]))),this.primitiveOptions=(o=this.metadataById,i=this.platform.get(n.Translate),[...o.values()].map((e=>({value:e.id,text:e.title?i.get(e.title):e.id,secondaryText:e.description?i.get(e.description):"",icon:e.icon}))).sort(((e,t)=>e.text.localeCompare(t.text))))}runValidation(){if(!this.value)return void(this.issues=[]);const e=this.ruleRegistry.validate(this.normalizedValue,this.availableContexts);this.issues=e.ok?[]:e.issues}emitIfChanged(e){var t;e!==this.normalizedValue&&this.change.emit("all"!==(t=e).type&&"any"!==t.type?t:0===t.rules.length?void 0:t)}get normalizedValue(){if(null!==this.normalizedCache&&this.normalizedCache.source===this.value)return this.normalizedCache.normalized;const e=(t=this.value)?M(t)?t:{type:"all",rules:[t]}:{type:"all",rules:[]};var t;return this.normalizedCache={source:this.value,normalized:e},e}emitNormalization(){if(!this.value)return!1;const e=this.normalizedValue;return e!==this.value&&(this.change.emit(e),!0)}get ruleRegistry(){return this.platform.get(n.RuleRegistry)}static get watchers(){return{value:[{onValueChange:0}],availableContexts:[{onAvailableContextsChange:0}]}}};A.style=":host{display:block}.rule-editor--disabled{opacity:0.6;pointer-events:none}.rule-editor__label{font-size:0.75rem;font-weight:600;color:rgb(var(--contrast-1500));margin-bottom:0.25rem}.rule-editor__helper-text{font-size:0.75rem;color:rgb(var(--contrast-1300));margin-top:0.25rem}.rule-node{border:1px solid rgb(var(--contrast-500));border-radius:0.5rem;margin:0.25rem 0;overflow:hidden;background-color:rgb(var(--contrast-100))}.rule-node--invalid{border-color:rgb(var(--color-red-default))}.rule-node--all>.rule-node__header,.rule-node--any>.rule-node__header{background-color:rgb(var(--contrast-300));padding:0.375rem 0.75rem;border-bottom:1px solid rgb(var(--contrast-500))}.rule-node__header{display:flex;align-items:center;gap:0.5rem}.rule-node__header-actions{margin-left:auto;display:grid;grid-auto-flow:column;grid-gap:0.5rem;padding:0.125rem;align-items:center}.rule-node__combinator-select{min-width:6rem}.rule-node__body{padding:0.75rem;display:flex;flex-direction:column;gap:0.75rem}limel-popover.rule-node__chips-popover{display:contents}.rule-node__chips{display:block;width:100%}.rule-node__chips limel-picker{display:block;width:100%}.rule-node__children{display:flex;flex-direction:column;gap:0.5rem}.rule-node__footer{display:flex;justify-content:center}.rule-node__issue{color:rgb(var(--color-red-default));font-size:0.875rem}";export{A as limebb_rule_editor}
|
|
1
|
+
import{h as e,r as t,c as r}from"./p-BIwHMk6j.js";import{b as n}from"./p-ndni-0im.js";function l(e,t){return t?{type:"not",rule:e}:e}function o(e,t){return e.length===t.length&&e.every(((e,r)=>e===t[r]))}function i(e,t){return e.filter((e=>o(e.path,t)))}function s(e,t){let r=e;for(const e of t)r=a(r,e);return r}function u(e,t,r){if(0===t.length)return r;const[n,...l]=t;if("not"===e.type&&"rule"===n)return Object.assign(Object.assign({},e),{rule:u(e.rule,l,r)});if(("all"===e.type||"any"===e.type)&&"rules"===n){if(0===l.length)return r;const[t,...n]=l;if("number"!=typeof t)return e;const o=[...e.rules];return o[t]=u(o[t],n,r),Object.assign(Object.assign({},e),{rules:o})}return e}function a(e,t){return"not"===e.type&&"rule"===t?e.rule:"all"!==e.type&&"any"!==e.type||"rules"!==t?"all"!==e.type&&"any"!==e.type||"number"!=typeof t?e:e.rules[t]:e}const c={name:"question",color:"rgb(var(--color-glaucous-light))"};function d(e){return`__chip__:${e}`}function h(e){return"ref"===e.type?{ref:e,isNegated:!1}:"not"===e.type&&"ref"===e.rule.type?{ref:e.rule,isNegated:!0}:null}const p=({groupNode:t,groupPath:r,chipChildren:n,ctx:l})=>{const o=new Map,i=n.map((e=>{const t=d(e.index);o.set(t,e);const r=(n=e.ref.id,null!==(i=l.primitiveOptions.find((e=>e.value===n)))&&void 0!==i?i:{value:n,text:n,icon:c});var n,i;return Object.assign(Object.assign({},r),{text:e.isNegated?`¬ ${r.text}`:r.text,value:t})})),s=(u=l.primitiveOptions,e=>Promise.resolve(function(e,t){if(!t)return e;const r=t.toLocaleLowerCase().split(/\s+/);return e.filter((e=>r.every((t=>{var r,n;return e.text.toLocaleLowerCase().includes(t)||(null===(r=e.secondaryText)||void 0===r?void 0:r.toLocaleLowerCase().includes(t))||(null===(n=e.value)||void 0===n?void 0:n.toLocaleLowerCase().includes(t))}))))}(u,e)));var u;const a=function(e,t,r){var n;const l=_(t,r);return null===l?null:null!==(n=e.find((e=>e.index===l)))&&void 0!==n?n:null}(n,r,l.openChipPath),h="all"===t.type?"&":"|";return e("limel-popover",{class:"rule-node__chips-popover",open:null!==a,openDirection:"bottom-start",onClose:l.onPopoverClose},e("div",{slot:"trigger",class:"rule-node__chips"},e("limel-picker",{multiple:!0,label:l.translator.get("webclient.rule-editor.rules-label"),value:i,searcher:s,delimiter:h,readonly:l.readonly,disabled:l.disabled,onChange:f(t,r,o,l),onInteract:b(r,o,l)})),e("div",null,function(t,r,n){if(!t)return null;const l=function(e,t){return[...e,"rules",t]}(r,t.index);return e("limebb-rule-chip-popover",{platform:n.platform,context:n.context,refNode:t.ref,isNegated:t.isNegated,metadata:n.metadataById.get(t.ref.id),readonly:n.readonly,disabled:n.disabled,isMutable:n.isMutable,onNegate:v(t,l,n),onUpdateArgs:m(t,l,n),onDeleteChip:g(l,n)})}(a,r,l)))},f=(e,t,r,n)=>l=>{l.stopPropagation();const o=Array.isArray(l.detail)?l.detail:[],i=_(t,n.openChipPath);if(null!==i){const e=d(i);o.every((t=>t.value!==e))&&n.onPopoverClose()}const s=o.flatMap((e=>{if("string"!=typeof e.value)return[];const t=r.get(e.value);return t?[t.isNegated?{type:"not",rule:t.ref}:t.ref]:[{type:"ref",id:e.value}]})),u=e.rules.filter((e=>null===h(e)));n.onReplaceNode(t,Object.assign(Object.assign({},e),{rules:[...s,...u]}))},b=(e,t,r)=>n=>{n.stopPropagation();const l=function(e){if("string"==typeof e)return e;if(e&&"object"==typeof e&&"value"in e){const t=e.value;return"string"==typeof t?t:void 0}}(n.detail),o=l?t.get(l):void 0;o&&r.onChipInteract([...e,"rules",o.index])},v=(e,t,r)=>n=>{n.stopPropagation(),r.onReplaceNode(t,n.detail?{type:"not",rule:e.ref}:e.ref)},m=(e,t,r)=>n=>{n.stopPropagation();const l=e.isNegated?[...t,"rule"]:t;r.onUpdateArgs(l,n.detail)},g=(e,t)=>()=>{t.onDelete(e)};function _(e,t){if(!t||t.length<2)return null;if(!o((r=t,r.slice(0,-2)),e))return null;var r;const n=t.at(-1);return"number"==typeof n?n:null}const y=({node:t,path:r,isNegated:n,ctx:l})=>{const o=n?[...r,"rule"]:r,s=n?[...i(l.issues,r),...i(l.issues,o)]:i(l.issues,r),u=[],a=[];for(const[e,r]of t.rules.entries()){const t=h(r);t?u.push(Object.assign(Object.assign({},t),{index:e})):a.push({child:r,index:e})}const c=function(e){return[{value:"all",text:e.translator.get("webclient.rule-editor.combinator.all")},{value:"any",text:e.translator.get("webclient.rule-editor.combinator.any")}]}(l),d=c.find((e=>e.value===t.type));return e("div",{class:(f=t.type,b=s,{"rule-node":!0,[`rule-node--${f}`]:!0,"rule-node--invalid":b.length>0}),key:x(r)},e("div",{class:"rule-node__header"},e("limel-select",{class:"rule-node__combinator-select",value:d,options:c,disabled:!l.isMutable,onChange:C(t,r,n,l)}),function(t,r,n,l){return l.isMutable?e("div",{class:"rule-node__header-actions"},e("limel-switch",{class:"rule-node__negate-switch",label:l.translator.get("webclient.rule-editor.negate"),value:n,onChange:O(t,r,l)}),e("limel-icon-button",{icon:"trash",label:l.translator.get("webclient.rule-editor.delete"),onClick:()=>l.onDelete(r)})):null}(t,r,n,l)),e("div",{class:"rule-node__body"},e(z,{issues:s}),e(p,{groupNode:t,groupPath:o,chipChildren:u,ctx:l}),function(t,r,n){return 0===t.length?null:e("div",{class:"rule-node__children"},t.map((t=>e(N,{node:t.child,path:[...r,"rules",t.index],ctx:n}))))}(a,o,l),function(t,r,n,l){return l.isMutable?e("div",{class:"rule-node__footer"},e("limel-button",{icon:"add",label:l.translator.get("webclient.rule-editor.add-nested-group"),onClick:w(t,r,n,l)})):null}(t,r,n,l)));var f,b};function x(e){return 0===e.length?"root":e.join("/")}function j(e,t,r,n){n.onReplaceNode(t,l(e,r))}const C=(e,t,r,n)=>l=>{l.stopPropagation();const o=l.detail.value;o!==e.type&&j(Object.assign(Object.assign({},e),{type:o}),t,r,n)},w=(e,t,r,n)=>()=>{var l,o;j((l=e,o={type:"all",rules:[]},Object.assign(Object.assign({},l),{rules:[...l.rules,o]})),t,r,n)},O=(e,t,r)=>n=>{n.stopPropagation(),r.onReplaceNode(t,l(e,n.detail))},N=t=>{const{node:r,path:n,ctx:l}=t,o=M(r);return o?e(y,{node:o.node,path:n,isNegated:o.isNegated,ctx:l}):null},k=e=>"not"===e.type&&("all"===e.rule.type||"any"===e.rule.type);function M(e){if("all"===e.type||"any"===e.type)return{node:e,isNegated:!1};if(k(e))return{node:e.rule,isNegated:!0};if("not"===e.type){const t=M(e.rule);if(t)return{node:t.node,isNegated:!t.isNegated}}return null}const z=({issues:t})=>0===t.length?null:t.map((t=>e("div",{class:"rule-node__issue"},t.message))),A=class{constructor(e){t(this,e),this.change=r(this,"change"),this.issues=[],this.openChipPath=null,this.metadataById=new Map,this.primitiveOptions=[],this.normalizedCache=null,this.handleDelete=e=>{this.openChipPath=null,this.emitIfChanged(function(e,t){if(0===t.length)return{type:"all",rules:[]};const r=t.slice(0,-1),n=t.at(-1),l=s(e,r);if(("all"===l.type||"any"===l.type)&&"number"==typeof n){const t=[...l.rules];return t.splice(n,1),u(e,r,Object.assign(Object.assign({},l),{rules:t}))}return"not"===l.type&&"rule"===n?u(e,r,{type:"all",rules:[]}):e}(this.normalizedValue,e))},this.handleUpdateArgs=(e,t)=>{this.emitIfChanged(function(e,t,r){const n=s(e,t);return"ref"!==n.type?e:u(e,t,Object.assign(Object.assign({},n),{args:r}))}(this.normalizedValue,e,t))},this.handleReplaceNode=(e,t)=>{this.emitIfChanged(function(e,t,r){return u(e,t,r)}(this.normalizedValue,e,t))},this.handleChipInteract=e=>{this.openChipPath=e},this.handlePopoverClose=()=>{this.openChipPath=null}}componentWillLoad(){this.indexMetadata(),this.runValidation()}componentDidLoad(){this.emitNormalization()}onValueChange(){this.emitNormalization()||this.runValidation()}onAvailableContextsChange(){this.runValidation()}render(){return e("div",{key:"8e0da39f6544c86de0143e91a6c48c9f2654315f",class:{"rule-editor":!0,"rule-editor--disabled":this.disabled}},this.renderLabel(),e(N,{key:"cd093f5dc5a9b747036f581e6230f1205cf834e6",node:this.normalizedValue,path:[],ctx:this.createRenderContext()}),this.renderHelperText())}renderLabel(){return this.label?e("div",{class:"rule-editor__label"},this.label):null}renderHelperText(){return this.helperText?e("div",{class:"rule-editor__helper-text"},this.helperText):null}createRenderContext(){return{issues:this.issues,metadataById:this.metadataById,primitiveOptions:this.primitiveOptions,isMutable:!this.readonly&&!this.disabled,readonly:this.readonly,disabled:this.disabled,platform:this.platform,context:this.context,translator:this.platform.get(n.Translate),openChipPath:this.openChipPath,onDelete:this.handleDelete,onUpdateArgs:this.handleUpdateArgs,onReplaceNode:this.handleReplaceNode,onChipInteract:this.handleChipInteract,onPopoverClose:this.handlePopoverClose}}indexMetadata(){var e,t,r;const l=null!==(r=null===(t=(e=this.ruleRegistry).listMetadata)||void 0===t?void 0:t.call(e))&&void 0!==r?r:[];var o,i;this.metadataById=new Map(l.map((e=>[e.id,e]))),this.primitiveOptions=(o=this.metadataById,i=this.platform.get(n.Translate),[...o.values()].map((e=>({value:e.id,text:e.title?i.get(e.title):e.id,secondaryText:e.description?i.get(e.description):"",icon:e.icon}))).sort(((e,t)=>e.text.localeCompare(t.text))))}runValidation(){if(!this.value)return void(this.issues=[]);const e=this.ruleRegistry.validate(this.normalizedValue,this.availableContexts);this.issues=e.ok?[]:e.issues}emitIfChanged(e){var t;e!==this.normalizedValue&&this.change.emit("all"!==(t=e).type&&"any"!==t.type?t:0===t.rules.length?void 0:t)}get normalizedValue(){if(null!==this.normalizedCache&&this.normalizedCache.source===this.value)return this.normalizedCache.normalized;const e=(t=this.value)?M(t)?t:{type:"all",rules:[t]}:{type:"all",rules:[]};var t;return this.normalizedCache={source:this.value,normalized:e},e}emitNormalization(){if(!this.value)return!1;const e=this.normalizedValue;return e!==this.value&&(this.change.emit(e),!0)}get ruleRegistry(){return this.platform.get(n.RuleRegistry)}static get watchers(){return{value:[{onValueChange:0}],availableContexts:[{onAvailableContextsChange:0}]}}};A.style=":host{display:block}.rule-editor--disabled{opacity:0.6;pointer-events:none}.rule-editor__label{font-size:0.75rem;font-weight:600;color:rgb(var(--contrast-1500));margin-bottom:0.25rem}.rule-editor__helper-text{font-size:0.75rem;color:rgb(var(--contrast-1300));margin-top:0.25rem}.rule-node{border:1px solid rgb(var(--contrast-500));border-radius:0.5rem;margin:0.25rem 0;overflow:hidden;background-color:rgb(var(--contrast-100))}.rule-node--invalid{border-color:rgb(var(--color-red-default))}.rule-node--all>.rule-node__header,.rule-node--any>.rule-node__header{background-color:rgb(var(--contrast-300));padding:0.375rem 0.75rem;border-bottom:1px solid rgb(var(--contrast-500))}.rule-node__header{display:flex;align-items:center;gap:0.5rem}.rule-node__header-actions{margin-left:auto;display:grid;grid-auto-flow:column;grid-gap:0.5rem;padding:0.125rem;align-items:center}.rule-node__combinator-select{min-width:6rem}.rule-node__body{padding:0.75rem;display:flex;flex-direction:column;gap:0.75rem}limel-popover.rule-node__chips-popover{display:contents}.rule-node__chips{display:block;width:100%}.rule-node__chips limel-picker{display:block;width:100%}.rule-node__children{display:flex;flex-direction:column;gap:0.5rem}.rule-node__footer{display:flex;justify-content:center}.rule-node__issue{color:rgb(var(--color-red-default));font-size:0.875rem}";export{A as limebb_rule_editor}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as e}from"./p-BIwHMk6j.js";import{b as s}from"./p-
|
|
1
|
+
import{r as t,c as i,h as e}from"./p-BIwHMk6j.js";import{b as s}from"./p-ndni-0im.js";const h=class{constructor(e){t(this,e),this.change=i(this,"change"),this.disabled=!1,this.readonly=!1,this.invalid=!1,this.required=!1,this.type="datetime",this.shouldEmitValueAsString=!0,this.handleChange=t=>{if(!t.detail)return;t.stopPropagation();const i=(e=t.detail,"datetime"===(s=this.type)||"time"===s?e:new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())));var e,s;this.change.emit(this.shouldEmitValueAsString?i.toISOString():i)},this.formatter=t=>this.dateTimeFormatter.format(t,a[this.type]||this.type)}render(){return this.language||(this.language=this.getAppLanguage()),this.value&&(this.shouldEmitValueAsString="string"==typeof this.value),e("limel-date-picker",{key:"9a27ee751c1928a442651e8473b0c588778dbdc0",disabled:this.disabled,readonly:this.readonly,invalid:this.invalid,label:this.label,placeholder:this.placeholder,helperText:this.helperText,required:this.required,value:this.parseDateValue(),type:this.type,language:this.language,formatter:this.formatter,onChange:this.handleChange})}parseDateValue(){const t=this.value;if(t)return this.dateTimeFormatter.parse(t,a[this.type]||this.type)}get dateTimeFormatter(){return this.platform.get(s.DateTimeFormatter)}getAppLanguage(){const t=this.platform.get(s.Translate),i=this.platform.get(s.Application);let e;var h;return e="function"==typeof(null==(h=t)?void 0:h.getLanguage)?t.getLanguage():i.getLanguage(),n(e)?e:"en"}},a={datetime:"time",time:"timeofday"},r=new Set(["da","de","en","fi","fr","nb","no","nl","sv"]),n=t=>r.has(t);export{h as limebb_date_picker}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as
|
|
1
|
+
import{r as e,c as i,h as t,H as r}from"./p-BIwHMk6j.js";import{n as l,b as s}from"./p-ndni-0im.js";const a=[{value:l.EQUALS,label:"webclient.operator.equals",icon:"-lime-filter-equal"},{value:l.NOT_EQUALS,label:"webclient.operator.not-equals",icon:"-lime-filter-equal-not"},{value:l.GREATER,label:"webclient.operator.greater-than",icon:"-lime-filter-greater",applicableTypes:["integer","decimal","date","time"]},{value:l.GREATER_OR_EQUAL,label:"webclient.operator.greater-than-or-equal-to",icon:"-lime-filter-greater-equal",applicableTypes:["integer","decimal","date","time"]},{value:l.LESS,label:"webclient.operator.less-than",icon:"-lime-filter-less",applicableTypes:["integer","decimal","date","time"]},{value:l.LESS_OR_EQUAL,label:"webclient.operator.less-than-or-equal-to",icon:"-lime-filter-less-equal",applicableTypes:["integer","decimal","date","time"]},{value:l.IN,label:"webclient.operator.in-filter",icon:"-lime-filter-set-included"},{value:l.LIKE,label:"webclient.operator.contains",icon:"-lime-filter-contain",applicableTypes:["string","text"]},{value:l.BEGINS,label:"webclient.operator.begins-with",icon:"-lime-filter-starts-with",applicableTypes:["string","text"]},{value:l.ENDS,label:"webclient.operator.ends-with",icon:"-lime-filter-ends-with",applicableTypes:["string","text"]}],o=class{constructor(t){e(this,t),this.expressionChange=i(this,"expressionChange"),this.handlePropertyChange=e=>{e.stopPropagation(),this.expressionChange.emit(Object.assign(Object.assign({},this.expression),{key:e.detail}))},this.handleOperatorChange=e=>{e.stopPropagation();const i=e.detail.value,t=this.expression.op;let r=this.expression.exp;i!==l.IN||Array.isArray(r)?t===l.IN&&i!==l.IN&&Array.isArray(r)&&(r=r.length>0?r[0]:""):r=void 0!==r&&""!==r?[r]:[],this.expressionChange.emit({key:this.expression.key,op:i,exp:r})},this.handleValueChange=e=>{e.stopPropagation(),this.expressionChange.emit(Object.assign(Object.assign({},this.expression),{exp:e.detail}))},this.removeExpression=()=>{this.expressionChange.emit(void 0)}}render(){return t(r,{key:"29ddf92b2e83eafe695faeb9a4ce6b8d29aa973e"},this.renderHeader(),t("div",{key:"258f8aeee98a2435d324a1e5b816f111188cf3cc",class:"expression-container"},this.renderPropertySelector(),this.renderOperator(),this.renderValueInput(),t("limel-icon-button",{key:"c9e4cf456908fb82507e2599af631691e96ab8e4",class:"remove",icon:"trash",label:"Remove condition",onClick:this.removeExpression})))}renderHeader(){if(this.label)return t("limel-header",{subheading:this.label})}renderPropertySelector(){return t("limebb-property-selector",{platform:this.platform,context:this.context,label:"Property",limetype:this.limetype,value:this.expression.key,required:!0,onChange:this.handlePropertyChange})}renderOperator(){const e=!!this.expression.op,i=a.map((e=>{var i,t;return{text:null!==(t=null===(i=this.translator)||void 0===i?void 0:i.get(e.label))&&void 0!==t?t:e.label,value:e.value,icon:e.icon?{name:e.icon}:void 0}})),r=i.find((e=>e.value===this.expression.op));return t("limel-select",{class:"operator",label:"Operator",value:r,options:i,disabled:!e&&!this.expression.key,onChange:this.handleOperatorChange})}renderValueInput(){return this.expression.op?t("limebb-lime-query-value-input",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,propertyPath:this.expression.key,operator:this.expression.op,value:this.expression.exp,onChange:this.handleValueChange}):null}get translator(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(s.Translate)}};o.style=":host(limebb-lime-query-filter-comparison){display:flex;flex-direction:column;gap:0.5rem}.expression-container{position:relative;display:grid;grid-template-columns:repeat(auto-fit, minmax(10rem, 1fr));grid-gap:0.5rem;padding-right:2.75rem}.remove{position:absolute;right:0;top:0.125rem}";const n=class{constructor(t){e(this,t),this.expressionChange=i(this,"expressionChange"),this.handleExpressionChange=e=>{e.stopPropagation(),this.expressionChange.emit(e.detail)}}render(){if(!this.expression)return;const e={platform:this.platform,context:this.context,label:this.label,limetype:this.limetype,activeLimetype:this.activeLimetype};return"key"in this.expression?t("limebb-lime-query-filter-comparison",Object.assign({},e,{expression:this.expression,onExpressionChange:this.handleExpressionChange})):this.expression.op===l.AND||this.expression.op===l.OR?t("limebb-lime-query-filter-group",Object.assign({},e,{expression:this.expression,onExpressionChange:this.handleExpressionChange})):this.expression.op===l.NOT?t("limebb-lime-query-filter-not",Object.assign({},e,{expression:this.expression,onExpressionChange:this.handleExpressionChange})):void 0}};n.style='@charset "UTF-8";.expression{display:flex;flex-direction:column;margin-bottom:1rem;gap:1rem}';export{o as limebb_lime_query_filter_comparison,n as limebb_lime_query_filter_expression}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,c as t,h as s,g as e}from"./p-BIwHMk6j.js";import{b as o}from"./p-
|
|
1
|
+
import{r as i,c as t,h as s,g as e}from"./p-BIwHMk6j.js";import{b as o}from"./p-ndni-0im.js";const h=class{constructor(e){i(this,e),this.change=t(this,"change"),this.copy=t(this,"copy"),this.type="component",this.copyLabel="Copy value",this.hideCopyButton=!1,this.allItems=[],this.getConfigs=()=>({component:()=>this.webComponentRegistry.getAll(),command:()=>this.commandbus.getAll()}[this.type]()),this.getConfigValue=i=>"name"in i&&"string"==typeof i.name?i.name:"id"in i&&"string"==typeof i.id?i.id:"",this.hasTag=i=>!this.tags||this.tags.some((t=>{var s;return null===(s=i.tags)||void 0===s?void 0:s.includes(t)})),this.handleBlur=()=>{this.emitIfValidValue(this.currentInput)},this.handleChange=i=>{var t;i.stopPropagation(),this.change.emit(null===(t=i.detail)||void 0===t?void 0:t.value)},this.handleCopyButton=()=>{navigator.clipboard.writeText(this.value),this.copy.emit(this.value)},this.handleKeyUp=i=>{"Enter"===i.key&&this.emitIfValidValue(this.currentInput)},this.emitIfValidValue=i=>{this.isValidIdentifier(i)&&this.change.emit(i)},this.isValidIdentifier=i=>!!i&&("component"===this.type?Boolean(customElements.get(i)):this.allItems.some((t=>t.value===i))),this.renderPicker=()=>{let i=this.allItems.find((i=>this.value===i.value));return!i&&this.value&&(i={text:this.value,value:this.value,icon:{name:"question",color:"rgb(var(--color-glaucous-light))"}}),s("limel-picker",{disabled:this.disabled,helperText:this.helperText,label:this.label,readonly:this.readonly,required:this.required,searcher:this.search,value:i,title:null==i?void 0:i.text,onBlur:this.handleBlur,onChange:this.handleChange,onKeyUp:this.handleKeyUp})},this.renderCopyButton=()=>{if(!this.hideCopyButton)return s("limel-icon-button",{icon:"copy",disabled:!this.value,label:this.copyLabel,onClick:this.handleCopyButton})},this.search=async i=>i?this.allItems.filter(this.isItemMatching(i.toLocaleLowerCase())):this.allItems,this.isItemMatching=i=>t=>i.split(/\s+/).every((i=>{var s,e;return t.text.toLocaleLowerCase().includes(i)||(null===(s=t.secondaryText)||void 0===s?void 0:s.toLocaleLowerCase().includes(i))||(null===(e=t.value)||void 0===e?void 0:e.toLocaleLowerCase().includes(i))}))}componentWillLoad(){this.allItems=this.getConfigs().filter(this.hasTag).map((i=>{var t,s;return{value:this.getConfigValue(i),text:this.translator.get(null!==(t=i.title)&&void 0!==t?t:this.getConfigValue(i)),secondaryText:this.translator.get(null!==(s=i.description)&&void 0!==s?s:""),icon:i.icon}})).sort(((i,t)=>i.text.localeCompare(t.text)))}render(){return[this.renderPicker(),this.renderCopyButton()]}get currentInput(){var i,t,s,e,o,h,n;return null!==(n=null===(h=null===(o=null===(e=null===(s=null===(t=null===(i=this.host.shadowRoot)||void 0===i?void 0:i.querySelector("limel-picker"))||void 0===t?void 0:t.shadowRoot)||void 0===s?void 0:s.querySelector("limel-chip-set"))||void 0===e?void 0:e.shadowRoot)||void 0===o?void 0:o.querySelector("input"))||void 0===h?void 0:h.value)&&void 0!==n?n:""}get webComponentRegistry(){return this.platform.get(o.WebComponentRegistry)}get commandbus(){return this.platform.get(o.CommandBus)}get translator(){return this.platform.get(o.Translate)}get host(){return e(this)}};h.style=":host(limebb-component-picker){position:relative;display:flex;align-items:center}:host(limebb-component-picker) limel-picker{flex-grow:1;min-width:0}:host(limebb-component-picker) limel-icon-button{position:absolute;right:0.25rem}";export{h as limebb_component_picker}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as i,H as r,g as n}from"./p-BIwHMk6j.js";import{b as o}from"./p-
|
|
1
|
+
import{r as e,c as t,h as i,H as r,g as n}from"./p-BIwHMk6j.js";import{b as o}from"./p-ndni-0im.js";import{H as a}from"./p-BWMpG2bS.js";var s,d={},l={};function h(){return s||(s=1,l.getRoundingMethod=function(e){return t=>{const i=(e?Math[e]:Math.trunc)(t);return 0===i?0:i}}),l}var c,u={};function m(){if(c)return u;c=1,u.secondsInYear=u.secondsInWeek=u.secondsInQuarter=u.secondsInMonth=u.secondsInMinute=u.secondsInHour=u.secondsInDay=u.quartersInYear=u.monthsInYear=u.monthsInQuarter=u.minutesInYear=u.minutesInMonth=u.minutesInHour=u.minutesInDay=u.minTime=u.millisecondsInWeek=u.millisecondsInSecond=u.millisecondsInMinute=u.millisecondsInHour=u.millisecondsInDay=u.maxTime=u.daysInYear=u.daysInWeek=void 0,u.daysInWeek=7;const e=u.daysInYear=365.2425,t=u.maxTime=24*Math.pow(10,8)*60*60*1e3;u.minTime=-t,u.millisecondsInWeek=6048e5,u.millisecondsInDay=864e5,u.millisecondsInMinute=6e4,u.millisecondsInHour=36e5,u.millisecondsInSecond=1e3,u.minutesInYear=525600,u.minutesInMonth=43200,u.minutesInDay=1440,u.minutesInHour=60,u.monthsInQuarter=3,u.monthsInYear=12,u.quartersInYear=4;const i=u.secondsInHour=3600;u.secondsInMinute=60;const r=u.secondsInDay=24*i;u.secondsInWeek=7*r;const n=u.secondsInYear=r*e,o=u.secondsInMonth=n/12;return u.secondsInQuarter=3*o,u}var b,f,g,v={},p={};function w(){return b||(b=1,p.toDate=function(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}),p}function y(){if(f)return v;f=1,v.differenceInMilliseconds=function(t,i){return+(0,e.toDate)(t)-+(0,e.toDate)(i)};var e=w();return v}function k(){if(g)return d;g=1,d.differenceInMinutes=function(r,n,o){const a=(0,i.differenceInMilliseconds)(r,n)/t.millisecondsInMinute;return(0,e.getRoundingMethod)(o?.roundingMethod)(a)};var e=h(),t=m(),i=y();return d}var x=k();const I=class{constructor(i){e(this,i),this.loadMore=t(this,"loadMore"),this.highlightedItemIdNotFound=t(this,"highlightedItemIdNotFound"),this.items=[],this.minutesOfProximity=5,this.totalCount=0,this.direction="ASC",this.isBundled=(e,t)=>{var i,r,n,o,a,s;if(0===t)return!1;if((null===(r=null===(i=this.items[t-1])||void 0===i?void 0:i.author)||void 0===r?void 0:r.id)!==(null===(n=null==e?void 0:e.author)||void 0===n?void 0:n.id))return!1;if((null===(a=null===(o=this.items[t-1])||void 0===o?void 0:o.icon)||void 0===a?void 0:a.name)!==(null===(s=null==e?void 0:e.icon)||void 0===s?void 0:s.name))return!1;const d=new Date(e.timestamp),l=new Date(this.items[t-1].timestamp),h=new Date(l),c=new Date(d);return"DESC"===this.direction?x.differenceInMinutes(h,c)<=this.minutesOfProximity:x.differenceInMinutes(c,h)<=this.minutesOfProximity},this.handleLoadMore=e=>{e.stopPropagation(),this.loadMore.emit()}}connectedCallback(){this.highlighter.registerFeed(this.feedItemElement)}disconnectedCallback(){this.highlighter.unregisterFeed(this.feedItemElement)}render(){return i(r,{key:"5d1c5d6ff9949229a0bafbdb060a0bc386a8eb03",role:"log","aria-busy":this.loading?"true":"false",style:{"--limebb-feed-highlight-duration":"3000ms"}},this.renderLoadMore(),this.renderEmptyFeedMessage(),this.renderSpinner(),this.renderFeedItems())}renderSpinner(){if(this.loading)return i("limel-spinner",{size:"small"})}renderEmptyFeedMessage(){if(!this.loading)return 0===this.items.length?i("limebb-empty-state",{heading:this.heading,value:this.emptyStateMessage,icon:{name:"typewriter_with_paper",color:"rgb(var(--contrast-800))"}}):void 0}renderFeedItems(){return this.groupedItems.map((e=>i("section",{class:"date-group",key:`date-group-${e.date}`},i("a",{class:"date-heading"},e.date),e.items.map((({item:e,index:t})=>i("limebb-feed-timeline-item",{platform:this.platform,context:this.context,item:e,key:e.id,ui:null==e?void 0:e.ui,helperText:null==e?void 0:e.helperText,hasError:null==e?void 0:e.hasError,isBundled:this.isBundled(e,t),class:this.isNewItem(e)?"is-new":void 0}))))))}isNewItem(e){if(!this.lastVisitedTimestamp)return!1;const t=new Date(this.lastVisitedTimestamp);return new Date(e.timestamp)>t}renderLoadMore(){if(!(0===this.items.length||this.totalCount<=this.items.length))return i("limel-icon-button",{class:"load-more-button",icon:"more",onClick:this.handleLoadMore,elevated:!0,label:this.loadMoreLabel})}get dateTimeFormatter(){return this.platform.get(o.DateTimeFormatter)}get loadMoreLabel(){return this.translator.get("webclient.load-more")}get translator(){return this.platform.get(o.Translate)}get groupedItems(){const e=[];for(let t=0;t<this.items.length;t++){const i=this.items[t],r=this.dateTimeFormatter.format(i.timestamp,"date"),n=e.at(-1);n&&n.date===r?n.items.push({item:i,index:t}):e.push({date:r,items:[{item:i,index:t}]})}return e}highlightedItemIdChanged(e){void 0!==e&&this.highlightItem(e)}highlightItem(e){var t;const i=null===(t=this.feedItemElement.shadowRoot)||void 0===t?void 0:t.querySelector(`limebb-feed-timeline-item[id="${e}"]`);return i?(i.setAttribute("aria-current","true"),i.scrollIntoView({behavior:"smooth",block:"center"}),i.focus(),setTimeout((()=>{i.removeAttribute("aria-current")}),3e3),!0):(this.highlightedItemIdNotFound.emit({id:e}),!1)}get highlighter(){return this.platform.get(a.SERVICE_NAME)}get feedItemElement(){return n(this)}static get watchers(){return{highlightedItemId:[{highlightedItemIdChanged:0}]}}};I.style=':host(limebb-feed){--limebb-feed-background-color:var( --feed-background-color, rgb(var(--contrast-100)) );--limebb-feed-item-background-color:var(--contrast-300);display:flex;flex-direction:column;gap:0.25rem;max-width:45rem;background-color:var(--limebb-feed-background-color)}limel-spinner{align-self:center;justify-self:center;margin:auto}.date-group{isolation:isolate;display:flex;flex-direction:column;gap:0.375rem}.date-heading{position:sticky;z-index:1;top:0.25rem;display:flex;border-radius:9rem;padding:0.25rem 0.5rem;margin:0 auto 0 -0.5rem;width:fit-content;font-size:0.75rem;line-height:1;color:rgb(var(--contrast-900));backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem);transition:color 0.2s ease, border-color 0.4s ease}.date-heading:hover{color:rgb(var(--contrast-1000));border-color:rgb(var(--contrast-500))}.date-heading:hover:before{opacity:1}.date-heading:before{transition:opacity 0.2s ease;content:"";position:absolute;z-index:-1;inset:0;opacity:0.6;border-radius:inherit;background-color:rgb(var(--contrast-100))}limebb-feed-timeline-item:has(+limebb-feed-timeline-item[is-bundled]){--limebb-promoted-action-bar-grid-template-rows:0fr}.load-more-button{margin-top:0.5rem}limebb-feed-timeline-item:focus{outline:none}limebb-feed-timeline-item[aria-current=true]:focus{animation:highlight-animation ease-in-out;animation-duration:var(--limebb-feed-highlight-duration)}@keyframes highlight-animation{0%,20%,100%{box-shadow:none}10%,50%,60%{box-shadow:var(--shadow-focused-state)}}';export{I as limebb_feed}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,c as n,h as t}from"./p-BIwHMk6j.js";import{b as u}from"./p-
|
|
1
|
+
import{r,c as n,h as t}from"./p-BIwHMk6j.js";import{b as u}from"./p-ndni-0im.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-BsH0YW6Z.js";import{e as l,f as v,h as d,j as h,S as p,k as b,l as m,d as g}from"./p-CtcTT7BK.js";import{c as j,e as y,a as w,S as k}from"./p-BgAfMcRA.js";import{b as x}from"./p-CKEnwX6j.js";import{i as A}from"./p-6PYziigk.js";import{d as O}from"./p-Ceen0vzd.js";function S(r){return r}var B,C,_,E=Date.now,M=O?function(r,n){return O(r,"toString",{configurable:!0,enumerable:!1,value:(t=n,function(){return t}),writable:!0});var t}:S,R=(B=M,C=0,_=0,function(){var r=E(),n=16-(r-_);if(_=r,n>0){if(++C>=800)return arguments[0]}else C=0;return B.apply(void 0,arguments)}),T=Math.max;function z(r,n,t){if(!j(t))return!1;var u=typeof n;return!!("number"==u?l(t)&&v(n,t.length):"string"==u&&n in t)&&y(t[n],r)}var H=k?k.isConcatSpreadable:void 0;function I(r){return w(r)||d(r)||!!(H&&r&&r[H])}var K=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function U(r){return K.test(r)}var W="\\ud800-\\udfff",Y="["+W+"]",q="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",D="\\ud83c[\\udffb-\\udfff]",L="[^"+W+"]",P="(?:\\ud83c[\\udde6-\\uddff]){2}",X="[\\ud800-\\udbff][\\udc00-\\udfff]",Z="(?:"+q+"|"+D+")?",F="[\\ufe0e\\ufe0f]?",G=F+Z+"(?:\\u200d(?:"+[L,P,X].join("|")+")"+F+Z+")*",J="(?:"+[L+q+"?",q,P,X,Y].join("|")+")",N=RegExp(D+"(?="+D+")|"+J+G,"g");var Q=function(r){var n,t,u,i,f=U(r=e(r))?function(r){return U(r)?function(r){return r.match(N)||[]}(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};function V(r){return r==r&&!j(r)}function $(r,n){return function(t){return null!=t&&t[r]===n&&(void 0!==n||r in Object(t))}}function rr(r,n){return null!=r&&n in Object(r)}function nr(r){return"function"==typeof r?r:null==r?S:"object"==typeof r?w(r)?(e=r[1],o(u=r[0])&&V(e)?$(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)&&m(e)&&v(a,e)&&(w(r)||d(r))}(r,n,rr)}(r,u):x(e,n,3)}):(t=function(r){for(var n=b(r),t=n.length;t--;){var u=n[t],e=r[u];n[t]=[u,e,V(e)]}return n}(n=r),1==t.length&&t[0][2]?$(t[0][0],t[0][1]):function(r){return r===n||function(r,n,t){var u=t.length,e=u;if(null==r)return!e;for(r=Object(r);u--;){var i=t[u];if(i[2]?i[1]!==r[i[0]]:!(i[0]in r))return!1}for(;++u<e;){var f=(i=t[u])[0],o=r[f],a=i[1];if(i[2]){if(void 0===o&&!(f in r))return!1}else{var c=new p;if(!x(a,o,3,void 0,c))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}var tr,ur=(tr=function(r,n){return r&&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}(r,n,b)},function(r,n){if(null==r)return r;if(!l(r))return tr(r,n);for(var t=r.length,u=-1,e=Object(r);++u<t&&!1!==n(e[u],u,e););return r});function er(r,n){if(r!==n){var t=void 0!==r,u=null===r,e=r==r,i=A(r),f=void 0!==n,o=null===n,a=n==n,c=A(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 ir(r,n,t){n=n.length?s(n,(function(r){return w(r)?function(n){return c(n,1===r.length?r[0]:r)}:r})):[S];var u=-1;n=s(n,g(nr));var e=function(r,n){var t=-1,u=l(r)?Array(r.length):[];return ur(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=er(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 fr=function(r){return R(function(r,n,t){return n=T(void 0===n?r.length-1:n,0),function(){for(var u=arguments,e=-1,i=T(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&&z(r,n[0],n[1])?n=[]:t>2&&z(n[0],n[1],n[2])&&(n=[n[0]]),ir(r,function(r,n,t,u,e){var i=-1,f=r.length;for(t||(t=I),e||(e=[]);++i<f;){var o=r[i];t(o)?h(e,o):e[e.length]=o}return e}(n),[])}));function or(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]=Q(e(t[0]).toLowerCase()),t.join(" ")}const ar=class{constructor(t){r(this,t),this.change=n(this,"change"),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:or(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:"b5aad60b10237826f58f096a343beb7fcbfe2b9b",value:n,options:fr(r,"text"),helperText:this.helperText,label:this.label,required:this.required,disabled:this.disabled,readonly:this.readonly,onChange:this.handleChange,multiple:this.multipleChoice})}};export{ar as limebb_locale_picker}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as i}from"./p-BIwHMk6j.js";import{L as o}from"./p-
|
|
1
|
+
import{r as e,c as t,h as i}from"./p-BIwHMk6j.js";import{L as o}from"./p-ndni-0im.js";import{v as r}from"./p-VjTMZY3E.js";import"./p-CQUZjrU4.js";function s(e){let t;try{t=JSON.parse(e)}catch(e){throw new Error(`Invalid JSON: ${e.message}`)}if(null===t||"object"!=typeof t)throw new Error("Response format must be an object");const i=new Set(["object","aggregates"]),o=Object.keys(t),r=o.filter((e=>!i.has(e)));if(r.length>0)throw new Error(`Unexpected properties in response format: ${r.join(", ")}. Only 'object' and 'aggregates' are allowed.`);if(o.length>0&&!t.object&&!t.aggregates)throw new Error("Response format must contain at least one of: object, aggregates");return t}const l=class{constructor(i){e(this,i),this.change=t(this,"change"),this.label="Response Format",this.helperText="",this.mode="visual",this.codeValue="",this.handleModeChange=e=>{e.stopPropagation();const t=e.detail.id;"visual"===t?this.switchToVisualMode():"code"===t&&this.switchToCode()},this.switchToVisualMode=()=>{try{const e=s(this.codeValue);if(!r(e,this.limetypes,this.limetype,this.visualModeEnabled).visualModeSupported)return;this.internalValue=e,this.mode="visual",this.change.emit(e)}catch(e){}},this.switchToCode=()=>{this.updateCodeValue(),this.mode="code"},this.handleCodeChange=e=>{e.stopPropagation(),this.codeValue=e.detail;try{const e=s(this.codeValue);this.internalValue=e,this.change.emit(e)}catch(e){}},this.handleVisualModeChange=e=>{e.stopPropagation(),this.internalValue=e.detail,this.updateCodeValue(),this.change.emit(e.detail)}}get visualModeEnabled(){var e,t,i;return null!==(i=null===(t=null===(e=this.platform)||void 0===e?void 0:e.isFeatureEnabled)||void 0===t?void 0:t.call(e,"useLimeQueryBuilderGuiMode"))&&void 0!==i&&i}componentWillLoad(){this.internalValue=this.value||{object:{_id:null}},this.updateCodeValue(),this.visualModeEnabled&&this.checkVisualModeSupport().visualModeSupported||(this.mode="code")}componentWillUpdate(){this.value&&"visual"===this.mode&&(this.internalValue=this.value)}render(){const e=this.checkVisualModeSupport();return i("div",{key:"65a41f46fe1088f0d52be0337c427177a1aa1a44",class:"response-format-builder"},this.label&&i("h1",{key:"5a75e321aee3ff6753baccbd72d17c5377f28d28",class:"builder-label"},this.label),this.helperText&&i("p",{key:"e13518253b52ff8f847575b4465dc2295c7452f0",class:"builder-helper-text"},this.helperText),this.visualModeEnabled&&i("div",{key:"2122357f51fd2185d1b544381eb2199de5b1f56c",class:"mode-controls"},this.renderModeSwitch(e)),this.visualModeEnabled&&"code"!==this.mode?i("div",{class:"visual-mode"},this.renderVisualMode()):i("div",{class:"code-mode"},this.renderCodeEditor(e)))}renderModeSwitch(e){const t=!e.visualModeSupported,o=[{id:"visual",title:"Visual"},{id:"code",title:"Code"}].map((e=>Object.assign(Object.assign({},e),{selected:e.id===this.mode})));return i("limel-button-group",{value:o,disabled:t,onChange:this.handleModeChange})}renderCodeEditor(e){return i("div",{class:"code-editor-container"},i("limel-code-editor",{value:this.codeValue,language:"json",lineNumbers:!0,fold:!0,lint:!0,onChange:this.handleCodeChange}),!e.valid&&e.validationErrors.length>0&&i("div",{class:"validation-errors"},i("strong",null,"Invalid Response Format:"),i("ul",null,e.validationErrors.map((e=>i("li",null,e))))),this.visualModeEnabled&&e.valid&&!e.visualModeSupported&&e.visualModeLimitations.length>0&&i("div",{class:"visual-mode-limitations"},i("strong",null,"Cannot switch to visual mode:"),i("ul",null,e.visualModeLimitations.map((e=>i("li",null,e))))))}renderVisualMode(){return i("limebb-lime-query-response-format-editor",{platform:this.platform,context:this.context,limetype:this.limetype,value:this.internalValue,onChange:this.handleVisualModeChange})}checkVisualModeSupport(){if(!this.limetypes)return{valid:!1,visualModeSupported:!1,validationErrors:["Limetypes not loaded"],visualModeLimitations:[]};let e;if("code"===this.mode)try{e=s(this.codeValue)}catch(e){return{valid:!1,visualModeSupported:!1,validationErrors:[e.message],visualModeLimitations:[]}}else e=this.internalValue;return r(e,this.limetypes,this.limetype,this.visualModeEnabled)}updateCodeValue(){this.codeValue=JSON.stringify(this.internalValue,null,2)}};(function(e,t,i,o){var r,s=arguments.length,l=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(l=(s<3?r(l):s>3?r(t,i,l):r(t,i))||l);s>3&&l&&Object.defineProperty(t,i,l)})([o()],l.prototype,"limetypes",void 0),l.style=":host(limebb-lime-query-response-format-builder){display:block;width:100%}.response-format-builder{display:flex;flex-direction:column}.builder-label{color:rgb(var(--contrast-1100));font-size:1.625rem;line-height:1.25rem;font-weight:300;margin-top:1rem;margin-bottom:0.25rem}.builder-helper-text{margin-top:0px;margin-bottom:0.5rem;font-size:var(--limel-theme-default-font-size);color:rgb(var(--contrast-1100))}.mode-controls{display:flex;justify-content:flex-end;padding:0.5rem}.visual-mode,.code-mode{display:block}.code-editor-container{--code-editor-max-height:70vh;display:flex;flex-direction:column;gap:1rem}.code-editor-container .validation-errors{padding:0.75rem 1rem;color:rgb(var(--color-red-default));background-color:rgb(var(--color-red-lighter));border-left:0.25rem solid rgb(var(--color-red-default));border-radius:0.25rem;font-size:0.875rem}.code-editor-container .validation-errors strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-editor-container .validation-errors ul{margin:0;padding-left:1.5rem}.code-editor-container .validation-errors li{margin:0.25rem 0}.code-editor-container .visual-mode-limitations{padding:0.75rem 1rem;color:rgb(var(--color-blue-dark));background-color:rgb(var(--color-blue-lighter));border-left:0.25rem solid rgb(var(--color-blue-default));border-radius:0.25rem;font-size:0.875rem}.code-editor-container .visual-mode-limitations strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-editor-container .visual-mode-limitations ul{margin:0;padding-left:1.5rem}.code-editor-container .visual-mode-limitations li{margin:0.25rem 0}";export{l as limebb_lime_query_response_format_builder}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as e,H as s,g as i}from"./p-BIwHMk6j.js";import{b as o}from"./p-ndni-0im.js";const h=class{constructor(e){t(this,e),this.shouldRender=!1}componentWillLoad(){this.compileAndEvaluate()}onRuleChange(){this.compileAndEvaluate()}onScopeChange(){this.compileAndEvaluate()}render(){return e(s,{key:"365df6908301371b8b964671382ad936971b6624",hidden:!this.shouldRender},e("slot",{key:"ca7c2a9febf0189dfae882a2ae894d1d0262a213"}))}get ruleRegistry(){return this.platform.get(o.RuleRegistry)}compileAndEvaluate(){var t;if(this.rule)try{const e=this.ruleRegistry.compile(this.rule),s=null!==(t=this.scope)&&void 0!==t?t:this.ruleRegistry.scope({host:this.host});this.shouldRender=e(s)}catch(t){console.warn("rule-gate failed to compile rule; hiding slot",{rule:this.rule,error:t}),this.shouldRender=!1}else this.shouldRender=!0}get host(){return i(this)}static get watchers(){return{rule:[{onRuleChange:0}],scope:[{onScopeChange:0}]}}};h.style=":host{display:contents}:host([hidden]){display:none}";export{h as limebb_rule_gate}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e}from"./p-BIwHMk6j.js";import{H as o,b as s}from"./p-
|
|
1
|
+
import{r as t,c as e}from"./p-BIwHMk6j.js";import{H as o,b as s}from"./p-ndni-0im.js";import{H as c}from"./p-BWMpG2bS.js";let i=class{constructor(t){this.itemId=t}};i=function(t,e,o,s){var c,i=arguments.length,n=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,o):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,o,s);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(n=(i<3?c(n):i>3?c(e,o,n):c(e,o))||n);return i>3&&n&&Object.defineProperty(e,o,n),n}([o({id:"limebb-feed.highlight-item"})],i);const n=class{constructor(o){t(this,o),this.loaded=e(this,"loaded")}connectedCallback(){}async componentWillLoad(){const t=new c;this.platform.register(c.SERVICE_NAME,t),this.commandBus.register(i,t),this.loaded.emit()}componentWillUpdate(){}disconnectedCallback(){}get commandBus(){return this.platform.get(s.CommandBus)}};export{n as limebb_loader}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as i,H as t}from"./p-BIwHMk6j.js";import{b as r}from"./p-D5qhls4G.js";const o=class{constructor(i){e(this,i)}render(){return i(t,{key:"efe87c0a35ebc87ae04a61422d3b7410189c8f7e",id:this.item.id},this.renderLabel(),i("div",{key:"d0bdaf7023492f926f96449a0d5bc49aa800ecac",class:"icons"},this.item.icons.map(((e,i)=>this.renderIcon(e,i)))))}renderLabel(){if(this.item.label)return i("span",{class:"label"},this.item.label)}renderIcon(e,t){const r=`icon-${this.item.id}-${t}`;return[i("limel-icon",{tabIndex:0,key:t,id:r,badge:!0,name:e.name,class:{"is-pending":!!e.pending},style:{color:e.color,"background-color":e.backgroundColor}}),this.renderTooltip(e,r)]}renderTooltip(e,t){if(e.title)return i("limel-tooltip",{label:e.title,elementId:t})}};o.style='@charset "UTF-8";*,*:before,*:after{box-sizing:border-box}:host(limebb-chat-icon-list){display:flex;align-items:center;gap:0.5rem;margin-right:auto;max-width:calc(100% - 2rem);padding:0 0.25rem}.label{font-size:0.75rem;color:rgb(var(--contrast-900))}.icons{display:flex;align-items:center;gap:0.25rem}.icons:hover limel-icon,.icons:focus-within limel-icon{margin-left:0 !important}limel-icon{--icon-background-color:rgb(var(--contrast-500), 0.5);transition:margin-left 0.2s cubic-bezier(0.075, 0.82, 0.165, 1), opacity 0.2s ease, box-shadow 0.2s ease;position:relative;width:1.75rem;padding:0.375rem;flex-shrink:0}limel-icon:focus{outline:none}limel-icon:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}limel-icon:not(.is-pending):not(:first-child){margin-left:-0.75rem}limel-icon.is-pending{animation:pending 3s linear infinite;padding:0.5rem}limel-icon.is-pending:after{content:"";position:absolute;inset:0;width:1.75rem;height:1.75rem;border-radius:50%;pointer-events:none;border-radius:50%;border:0.125rem solid rgb(var(--color-white), 0.5);border-top-color:rgb(var(--color-black), 0.8);mix-blend-mode:color-dodge;animation:spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite}@keyframes pending{0%,20%,80%,100%{filter:grayscale(0%)}45%,55%{filter:grayscale(100%)}}@keyframes spin{to{transform:rotate(360deg)}}';const a=class{constructor(i){e(this,i),this.hasError=!1,this.createActionBarItem=e=>{var i,t;if("separator"in e)return e;let r={value:e,text:null!==(i=e.label)&&void 0!==i?i:"",secondaryText:e.description,disabled:e.disabled};return!e.label&&e.icon?r=Object.assign(Object.assign({},r),{icon:e.icon,text:null!==(t=e.description)&&void 0!==t?t:r.text,iconOnly:!0}):e.icon&&(r=Object.assign(Object.assign({},r),{icon:e.icon})),r},this.handleActionBarItemSelect=e=>{var i;e.stopPropagation();const t=null===(i=e.detail.value)||void 0===i?void 0:i.command;t&&this.commandbus.handle(t)},this.createMenuItem=e=>{var i,t;return"separator"in e?e:{value:e,text:null!==(i=e.label)&&void 0!==i?i:"",secondaryText:e.description,disabled:e.disabled,icon:null!==(t=e.icon)&&void 0!==t?t:""}},this.handleMenuItemSelect=e=>{var i;e.stopPropagation();const t=null===(i=e.detail.value)||void 0===i?void 0:i.command;t&&this.commandbus.handle(t)}}render(){const e=`helper-text-${this.item.id}`;return i(t,{key:"971b486298a8f88790178592c174561bdc3b7b13",id:this.item.id,"aria-describedby":this.helperText?e:void 0,"aria-live":this.hasError?"assertive":"off",class:{[`${this.item.ui}`]:!0}},i("div",{key:"b5cde4080a9c6e4d30d89b8d9a323e41d913d00b",class:"bubble-content"},i("div",{key:"1d674bfb86bd0356bbbb1244848f7f9fe2f04916",class:"icon-picture"},this.renderIcon(),this.renderAuthorPicture()),this.renderErrorSign(),i("div",{key:"b4c34568322082230de44312c42b98d86b5a28fc",class:"item"},this.renderHeader(),this.renderValue(),i("footer",{key:"b9a5026726ac13dfe01e02263ace3817c3d71ad4"},this.renderHelperText(e),this.renderTimestamp()))),this.renderPromotedAction())}renderErrorSign(){if(this.hasError)return i("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 i("header",null,this.renderAuthorName(),i("div",{class:"action-buttons"},this.renderUnpromotedActionsMenu()))}renderIcon(){var e,t,r,o;if(this.item.icon)return i("limel-icon",{class:"icon",badge:!0,name:null!==(t=null===(e=this.item.icon)||void 0===e?void 0:e.name)&&void 0!==t?t:"dot_circle",style:{color:`${null===(r=this.item.icon)||void 0===r?void 0:r.color}`,"background-color":`${null===(o=this.item.icon)||void 0===o?void 0:o.backgroundColor}`}})}renderHelperText(e){if(this.helperText)return i("span",{class:"helper-text",id:e},this.helperText)}renderValue(){if(this.item.value)return i("limel-markdown",{class:"body-text reset-img-height",value:this.item.value})}renderAuthorName(){var e,t;if("string"==typeof(null===(e=this.item.author)||void 0===e?void 0:e.name))return i("span",{class:"author"},this.item.author.name);if("object"==typeof(null===(t=this.item.author)||void 0===t?void 0:t.name)){const{href:e,title:t,text:r}=this.item.author.name;return i("a",{class:"author",href:e,title:t},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?i("limel-ai-avatar",{class:"author-avatar"}):i("img",{class:"author-avatar",loading:"lazy",src:this.item.author.picture})}renderUnpromotedActionsMenu(){var e,t;if(!(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length))return;const r=this.item.unpromotedActions.map(this.createMenuItem);return i("limel-menu",{class:"unpromoted-actions-menu",items:r,openDirection:"bottom-end",onSelect:this.handleMenuItemSelect},i("limel-icon-button",{icon:"menu_2",slot:"trigger",label:null===(t=this.translator)||void 0===t?void 0:t.get("webclient.more-actions")}))}renderPromotedAction(){if(!this.item.promotedActions)return;const e=this.item.promotedActions.map(this.createActionBarItem);return i("div",{class:"action-bar"},i("div",{class:"action-bar-hider"},i("limel-action-bar",{accessibleLabel:"Action bar",actions:e,layout:"fullWidth",onItemSelected:this.handleActionBarItemSelect})))}renderTimestamp(){const e=this.item.timestamp;if(e)return i("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;min-width:0;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 n=class{constructor(i){e(this,i)}render(){return i("div",{key:"23c76c03d08f495a885b7bfef11ef133d1da53a9",class:"typing-ellipsis"},i("div",{key:"93ec029e09591839a45f41a49d42e4eea3d5127f",class:"circle"}),i("div",{key:"2ed2c1c943556f0f6e315d97cbdf7818773901c8",class:"circle"}),i("div",{key:"3fa7646cef9c5e3eecea9d9e8ed8bc9868505878",class:"circle"}))}};n.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{o as limebb_chat_icon_list,a as limebb_chat_item,n as limebb_typing_indicator}
|
|
1
|
+
import{r as e,h as i,H as t}from"./p-BIwHMk6j.js";import{b as r}from"./p-ndni-0im.js";const o=class{constructor(i){e(this,i)}render(){return i(t,{key:"efe87c0a35ebc87ae04a61422d3b7410189c8f7e",id:this.item.id},this.renderLabel(),i("div",{key:"d0bdaf7023492f926f96449a0d5bc49aa800ecac",class:"icons"},this.item.icons.map(((e,i)=>this.renderIcon(e,i)))))}renderLabel(){if(this.item.label)return i("span",{class:"label"},this.item.label)}renderIcon(e,t){const r=`icon-${this.item.id}-${t}`;return[i("limel-icon",{tabIndex:0,key:t,id:r,badge:!0,name:e.name,class:{"is-pending":!!e.pending},style:{color:e.color,"background-color":e.backgroundColor}}),this.renderTooltip(e,r)]}renderTooltip(e,t){if(e.title)return i("limel-tooltip",{label:e.title,elementId:t})}};o.style='@charset "UTF-8";*,*:before,*:after{box-sizing:border-box}:host(limebb-chat-icon-list){display:flex;align-items:center;gap:0.5rem;margin-right:auto;max-width:calc(100% - 2rem);padding:0 0.25rem}.label{font-size:0.75rem;color:rgb(var(--contrast-900))}.icons{display:flex;align-items:center;gap:0.25rem}.icons:hover limel-icon,.icons:focus-within limel-icon{margin-left:0 !important}limel-icon{--icon-background-color:rgb(var(--contrast-500), 0.5);transition:margin-left 0.2s cubic-bezier(0.075, 0.82, 0.165, 1), opacity 0.2s ease, box-shadow 0.2s ease;position:relative;width:1.75rem;padding:0.375rem;flex-shrink:0}limel-icon:focus{outline:none}limel-icon:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}limel-icon:not(.is-pending):not(:first-child){margin-left:-0.75rem}limel-icon.is-pending{animation:pending 3s linear infinite;padding:0.5rem}limel-icon.is-pending:after{content:"";position:absolute;inset:0;width:1.75rem;height:1.75rem;border-radius:50%;pointer-events:none;border-radius:50%;border:0.125rem solid rgb(var(--color-white), 0.5);border-top-color:rgb(var(--color-black), 0.8);mix-blend-mode:color-dodge;animation:spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite}@keyframes pending{0%,20%,80%,100%{filter:grayscale(0%)}45%,55%{filter:grayscale(100%)}}@keyframes spin{to{transform:rotate(360deg)}}';const a=class{constructor(i){e(this,i),this.hasError=!1,this.createActionBarItem=e=>{var i,t;if("separator"in e)return e;let r={value:e,text:null!==(i=e.label)&&void 0!==i?i:"",secondaryText:e.description,disabled:e.disabled};return!e.label&&e.icon?r=Object.assign(Object.assign({},r),{icon:e.icon,text:null!==(t=e.description)&&void 0!==t?t:r.text,iconOnly:!0}):e.icon&&(r=Object.assign(Object.assign({},r),{icon:e.icon})),r},this.handleActionBarItemSelect=e=>{var i;e.stopPropagation();const t=null===(i=e.detail.value)||void 0===i?void 0:i.command;t&&this.commandbus.handle(t)},this.createMenuItem=e=>{var i,t;return"separator"in e?e:{value:e,text:null!==(i=e.label)&&void 0!==i?i:"",secondaryText:e.description,disabled:e.disabled,icon:null!==(t=e.icon)&&void 0!==t?t:""}},this.handleMenuItemSelect=e=>{var i;e.stopPropagation();const t=null===(i=e.detail.value)||void 0===i?void 0:i.command;t&&this.commandbus.handle(t)}}render(){const e=`helper-text-${this.item.id}`;return i(t,{key:"971b486298a8f88790178592c174561bdc3b7b13",id:this.item.id,"aria-describedby":this.helperText?e:void 0,"aria-live":this.hasError?"assertive":"off",class:{[`${this.item.ui}`]:!0}},i("div",{key:"b5cde4080a9c6e4d30d89b8d9a323e41d913d00b",class:"bubble-content"},i("div",{key:"1d674bfb86bd0356bbbb1244848f7f9fe2f04916",class:"icon-picture"},this.renderIcon(),this.renderAuthorPicture()),this.renderErrorSign(),i("div",{key:"b4c34568322082230de44312c42b98d86b5a28fc",class:"item"},this.renderHeader(),this.renderValue(),i("footer",{key:"b9a5026726ac13dfe01e02263ace3817c3d71ad4"},this.renderHelperText(e),this.renderTimestamp()))),this.renderPromotedAction())}renderErrorSign(){if(this.hasError)return i("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 i("header",null,this.renderAuthorName(),i("div",{class:"action-buttons"},this.renderUnpromotedActionsMenu()))}renderIcon(){var e,t,r,o;if(this.item.icon)return i("limel-icon",{class:"icon",badge:!0,name:null!==(t=null===(e=this.item.icon)||void 0===e?void 0:e.name)&&void 0!==t?t:"dot_circle",style:{color:`${null===(r=this.item.icon)||void 0===r?void 0:r.color}`,"background-color":`${null===(o=this.item.icon)||void 0===o?void 0:o.backgroundColor}`}})}renderHelperText(e){if(this.helperText)return i("span",{class:"helper-text",id:e},this.helperText)}renderValue(){if(this.item.value)return i("limel-markdown",{class:"body-text reset-img-height",value:this.item.value})}renderAuthorName(){var e,t;if("string"==typeof(null===(e=this.item.author)||void 0===e?void 0:e.name))return i("span",{class:"author"},this.item.author.name);if("object"==typeof(null===(t=this.item.author)||void 0===t?void 0:t.name)){const{href:e,title:t,text:r}=this.item.author.name;return i("a",{class:"author",href:e,title:t},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?i("limel-ai-avatar",{class:"author-avatar"}):i("img",{class:"author-avatar",loading:"lazy",src:this.item.author.picture})}renderUnpromotedActionsMenu(){var e,t;if(!(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length))return;const r=this.item.unpromotedActions.map(this.createMenuItem);return i("limel-menu",{class:"unpromoted-actions-menu",items:r,openDirection:"bottom-end",onSelect:this.handleMenuItemSelect},i("limel-icon-button",{icon:"menu_2",slot:"trigger",label:null===(t=this.translator)||void 0===t?void 0:t.get("webclient.more-actions")}))}renderPromotedAction(){if(!this.item.promotedActions)return;const e=this.item.promotedActions.map(this.createActionBarItem);return i("div",{class:"action-bar"},i("div",{class:"action-bar-hider"},i("limel-action-bar",{accessibleLabel:"Action bar",actions:e,layout:"fullWidth",onItemSelected:this.handleActionBarItemSelect})))}renderTimestamp(){const e=this.item.timestamp;if(e)return i("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;min-width:0;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 n=class{constructor(i){e(this,i)}render(){return i("div",{key:"23c76c03d08f495a885b7bfef11ef133d1da53a9",class:"typing-ellipsis"},i("div",{key:"93ec029e09591839a45f41a49d42e4eea3d5127f",class:"circle"}),i("div",{key:"2ed2c1c943556f0f6e315d97cbdf7818773901c8",class:"circle"}),i("div",{key:"3fa7646cef9c5e3eecea9d9e8ed8bc9868505878",class:"circle"}))}};n.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{o as limebb_chat_icon_list,a as limebb_chat_item,n as limebb_typing_indicator}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as i,H as r}from"./p-BIwHMk6j.js";import{n as s,L as l}from"./p-D5qhls4G.js";import{g as o}from"./p-CQUZjrU4.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"),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:"4b1647c741b78253b4ce4ed1bd347800da394563",style:{"--limebb-lime-query-filter-group-operator":`"${this.expression.op===s.AND?"AND":"OR"}"`}},i("div",{key:"47fd3000275e17ef70d86af5e6abcb492806ffba",class:"expression"},this.renderHeader(),i("ul",{key:"224249a4b305eb2b20c1aedad98d2c3191d47e83"},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"),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:"16246e10be820ad18713cb097146040d30e242bf",class:"expression"},this.label&&i("limel-header",{key:"539d60a4567727282463dec2a90e06a3630501aa",heading:this.label}),i("limebb-lime-query-filter-expression",{key:"67f892704ea3e5a061acdcb8f3ffe22271971569",platform:this.platform,context:this.context,label:"Not",limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.expression.exp,onExpressionChange:this.handleExpressionChange}))}};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"),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-BIwHMk6j.js";import{n as s,L as l}from"./p-ndni-0im.js";import{g as o}from"./p-CQUZjrU4.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"),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:"4b1647c741b78253b4ce4ed1bd347800da394563",style:{"--limebb-lime-query-filter-group-operator":`"${this.expression.op===s.AND?"AND":"OR"}"`}},i("div",{key:"47fd3000275e17ef70d86af5e6abcb492806ffba",class:"expression"},this.renderHeader(),i("ul",{key:"224249a4b305eb2b20c1aedad98d2c3191d47e83"},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"),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:"16246e10be820ad18713cb097146040d30e242bf",class:"expression"},this.label&&i("limel-header",{key:"539d60a4567727282463dec2a90e06a3630501aa",heading:this.label}),i("limebb-lime-query-filter-expression",{key:"67f892704ea3e5a061acdcb8f3ffe22271971569",platform:this.platform,context:this.context,label:"Not",limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.expression.exp,onExpressionChange:this.handleExpressionChange}))}};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"),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 r,H as a}from"./p-BIwHMk6j.js";import{b as l}from"./p-D5qhls4G.js";import{g as t,n as o}from"./p-Cg1DC15C.js";const i=1e-4,s=class{constructor(a){e(this,a),this.rangeMax=100,this.rangeMin=0,this.multiplier=1,this.reducePresence=!0,this.displayPercentageColors=!1,this.locale="en",this.labelId="label-"+crypto.randomUUID(),this.helperTextId="helper-text-"+crypto.randomUUID(),this.zeroPointId="zero-point-"+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}valueChanged(e){this.numValue=this.parseValue(e)}componentWillLoad(){try{this.locale=this.platform.get(l.UserPreferencesRepository).get("locale"),this.numberFormat=new Intl.NumberFormat(this.locale)}catch(e){console.warn(`Could not get user's locale (${this.locale}), falling back to 'en'.`),this.locale="en",this.numberFormat=new Intl.NumberFormat("en")}this.numValue=this.parseValue(this.value)}componentDidLoad(){this.triggerRangeWarning()}componentWillUpdate(){this.triggerRangeWarning()}triggerRangeWarning(){this.rangeMin>=this.rangeMax&&console.warn(`[limebb-percentage-visualizer] Invalid range: rangeMin (${this.rangeMin}) must be less than rangeMax (${this.rangeMax}). Visualization may not appear as expected.`)}render(){const e=this.getNormalizedValue(),l=this.getZeroPointPosition();return r(a,{key:"c57fbde9785115a91c28db17ccebee42a335a80f",class:this.getContainerClassList(),style:{"--limebb-percentage-visualizer-zero-point-position":`${l}%`,"--limebb-percentage-visualizer-width":`${Math.abs(e)}%`,"--limebb-percentage-visualizer-rotate":e>=0?"0deg":"180deg"}},r("limel-notched-outline",{key:"27d6dada52041ce9ebec9d987bae303afacfff89",tabIndex:0,role:"meter","aria-valuemin":this.rangeMin,"aria-valuemax":this.rangeMax,"aria-valuenow":this.numValue,"aria-labelledby":this.labelId,"aria-describedby":this.helperTextId,label:this.label,labelId:this.labelId,invalid:this.invalid,required:this.required,hasValue:!0,hasFloatingLabel:!0,"aria-controls":this.helperTextId},r("div",{key:"2afd6d0ff95eace6fac444fd3e2732d22ab97728",slot:"content"},this.renderVisualization())),this.renderHelperLine())}renderVisualization(){if(!this.reducePresence||0!==this.numValue&&this.hasValue())return this.hasValue()?[r("div",{class:"percentage-bar"},r("div",{class:"percentage-fill"}),this.renderZeroPoint()),r("span",{class:"percentage-text"},this.formatValue(this.numValue),r("span",{class:"percent-sign"},"%"))]:r("span",{class:"no-value"},"–")}renderZeroPoint(){if(!(this.rangeMin>=0||this.rangeMax<=0))return[r("div",{id:this.zeroPointId,class:"zero-point"}),r("limel-tooltip",{elementId:this.zeroPointId,openDirection:"top",label:"0"})]}hasValue(){return null!=this.value&&""!==this.value}getContainerClassList(){if(!this.hasValue())return;const e=this.roundValue(this.multiplyByMultiplier(this.numValue)),r=t(e);return Object.assign({},r&&{[r]:!0})}getZeroPointPosition(){const e=this.rangeMax-this.rangeMin;return e<=0?0:(0-this.rangeMin)/e*100}getNormalizedValue(){const e=this.roundValue(this.multiplyByMultiplier(this.numValue)),r=this.rangeMax-this.rangeMin;if(r<=0)return 0;const a=(0-this.rangeMin)/r*100;return e>=0?e/Math.max(this.rangeMax,i)*(100-a):e/Math.max(Math.abs(this.rangeMin),i)*a}multiplyByMultiplier(e){return e*this.multiplier}roundValue(e){return Math.round(10*e)/10}unifyMinusSign(e){return e.replaceAll("−","-")}convertToUnicodeMinus(e){return e.replaceAll("-","−")}parseValue(e){return"string"==typeof e?Number.parseFloat(o(this.unifyMinusSign(e),this.locale)):e}formatValue(e){const r=this.roundValue(this.multiplyByMultiplier(e)),a=this.numberFormat.format(r);return r<0?this.convertToUnicodeMinus(a):a}static get watchers(){return{value:[{valueChanged:0}]}}};s.style='@charset "UTF-8";*,::before,::after{box-sizing:border-box}:host(limebb-percentage-visualizer){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-percentage-visualizer[invalid]:not([invalid=false])) div[slot=content]{border-color:rgb(var(--color-red-default))}:host(limebb-percentage-visualizer):has(label) div[slot=content]{min-height:2.5rem;padding:0 0.375rem 0 1rem}.percentage-text{flex-shrink:0;min-width:2.5rem}:host([range-min^="-"]) .percentage-text{min-width:3.75rem}.percent-sign{opacity:0.4}.zero-point{content:"";position:absolute;transform:translateX(-50%);left:var(--limebb-percentage-visualizer-zero-point-position);height:0.25rem;width:0.25rem;border-radius:50%;box-shadow:0 0 0 0.125rem var(--limebb-percentage-visualizer-zero-point-color, rgb(var(--contrast-1200), 0.3));background-color:var(--limebb-percentage-visualizer-zero-point-color, rgb(var(--contrast-200), 0.9))}.percentage-bar{overflow:hidden;flex-grow:1;position:relative;display:flex;align-items:center;height:0.5rem;min-width:2rem;border-radius:0.5rem;background-color:rgb(var(--contrast-800), 0.6)}.percentage-fill{transition:width 0.2s ease;position:absolute;margin:auto;left:var(--limebb-percentage-visualizer-zero-point-position, 0);rotate:var(--limebb-percentage-visualizer-rotate, 0deg);transform-origin:left center;width:var(--limebb-percentage-visualizer-width);height:100%;border-radius:0.5rem}:host(limebb-percentage-visualizer:focus),:host(limebb-percentage-visualizer:focus-visible),:host(limebb-percentage-visualizer:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limebb-percentage-visualizer){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limebb-percentage-visualizer:focus) limel-helper-line,:host(limebb-percentage-visualizer:focus-visible) limel-helper-line,:host(limebb-percentage-visualizer:focus-within) limel-helper-line,:host(limebb-percentage-visualizer:hover) limel-helper-line{will-change:grid-template-rows}.percentage-fill{background-color:var(--percentage-visualizer-color, var(--limebb-percentage-visualizer-color, var(--mdc-theme-primary)))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-200or-larger-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-darker))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-200to100-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-100to90-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-90to80-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-80to70-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-70to60-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-60to50-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-coral-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-50to40-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-coral-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-40to30-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-orange-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-30to20-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-orange-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-20to10-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-amber-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-10to0-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-amber-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-0) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--contrast-800))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-0to10-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-yellow-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-10to20-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-yellow-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-20to30-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-grass-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-30to40-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-grass-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-40to50-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-lime-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-50to60-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-lime-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-60to70-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-70to80-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-80to90-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-90to100-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-100to200-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-200or-larger-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-darker))}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-0) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--contrast-800))}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-0to10-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--0to10)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-10to20-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--10to20)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-20to30-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--20to30)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-30to40-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--30to40)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-40to50-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--40to50)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-50to60-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--50to60)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-60to70-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--60to70)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-70to80-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--70to80)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-80to90-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--80to90)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-90to100-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--90to100)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-100to200-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-dark))}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-200or-larger-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-darker))}';export{s as limebb_percentage_visualizer}
|
|
1
|
+
import{r as e,h as r,H as a}from"./p-BIwHMk6j.js";import{b as l}from"./p-ndni-0im.js";import{g as t,n as o}from"./p-Cg1DC15C.js";const i=1e-4,s=class{constructor(a){e(this,a),this.rangeMax=100,this.rangeMin=0,this.multiplier=1,this.reducePresence=!0,this.displayPercentageColors=!1,this.locale="en",this.labelId="label-"+crypto.randomUUID(),this.helperTextId="helper-text-"+crypto.randomUUID(),this.zeroPointId="zero-point-"+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}valueChanged(e){this.numValue=this.parseValue(e)}componentWillLoad(){try{this.locale=this.platform.get(l.UserPreferencesRepository).get("locale"),this.numberFormat=new Intl.NumberFormat(this.locale)}catch(e){console.warn(`Could not get user's locale (${this.locale}), falling back to 'en'.`),this.locale="en",this.numberFormat=new Intl.NumberFormat("en")}this.numValue=this.parseValue(this.value)}componentDidLoad(){this.triggerRangeWarning()}componentWillUpdate(){this.triggerRangeWarning()}triggerRangeWarning(){this.rangeMin>=this.rangeMax&&console.warn(`[limebb-percentage-visualizer] Invalid range: rangeMin (${this.rangeMin}) must be less than rangeMax (${this.rangeMax}). Visualization may not appear as expected.`)}render(){const e=this.getNormalizedValue(),l=this.getZeroPointPosition();return r(a,{key:"c57fbde9785115a91c28db17ccebee42a335a80f",class:this.getContainerClassList(),style:{"--limebb-percentage-visualizer-zero-point-position":`${l}%`,"--limebb-percentage-visualizer-width":`${Math.abs(e)}%`,"--limebb-percentage-visualizer-rotate":e>=0?"0deg":"180deg"}},r("limel-notched-outline",{key:"27d6dada52041ce9ebec9d987bae303afacfff89",tabIndex:0,role:"meter","aria-valuemin":this.rangeMin,"aria-valuemax":this.rangeMax,"aria-valuenow":this.numValue,"aria-labelledby":this.labelId,"aria-describedby":this.helperTextId,label:this.label,labelId:this.labelId,invalid:this.invalid,required:this.required,hasValue:!0,hasFloatingLabel:!0,"aria-controls":this.helperTextId},r("div",{key:"2afd6d0ff95eace6fac444fd3e2732d22ab97728",slot:"content"},this.renderVisualization())),this.renderHelperLine())}renderVisualization(){if(!this.reducePresence||0!==this.numValue&&this.hasValue())return this.hasValue()?[r("div",{class:"percentage-bar"},r("div",{class:"percentage-fill"}),this.renderZeroPoint()),r("span",{class:"percentage-text"},this.formatValue(this.numValue),r("span",{class:"percent-sign"},"%"))]:r("span",{class:"no-value"},"–")}renderZeroPoint(){if(!(this.rangeMin>=0||this.rangeMax<=0))return[r("div",{id:this.zeroPointId,class:"zero-point"}),r("limel-tooltip",{elementId:this.zeroPointId,openDirection:"top",label:"0"})]}hasValue(){return null!=this.value&&""!==this.value}getContainerClassList(){if(!this.hasValue())return;const e=this.roundValue(this.multiplyByMultiplier(this.numValue)),r=t(e);return Object.assign({},r&&{[r]:!0})}getZeroPointPosition(){const e=this.rangeMax-this.rangeMin;return e<=0?0:(0-this.rangeMin)/e*100}getNormalizedValue(){const e=this.roundValue(this.multiplyByMultiplier(this.numValue)),r=this.rangeMax-this.rangeMin;if(r<=0)return 0;const a=(0-this.rangeMin)/r*100;return e>=0?e/Math.max(this.rangeMax,i)*(100-a):e/Math.max(Math.abs(this.rangeMin),i)*a}multiplyByMultiplier(e){return e*this.multiplier}roundValue(e){return Math.round(10*e)/10}unifyMinusSign(e){return e.replaceAll("−","-")}convertToUnicodeMinus(e){return e.replaceAll("-","−")}parseValue(e){return"string"==typeof e?Number.parseFloat(o(this.unifyMinusSign(e),this.locale)):e}formatValue(e){const r=this.roundValue(this.multiplyByMultiplier(e)),a=this.numberFormat.format(r);return r<0?this.convertToUnicodeMinus(a):a}static get watchers(){return{value:[{valueChanged:0}]}}};s.style='@charset "UTF-8";*,::before,::after{box-sizing:border-box}:host(limebb-percentage-visualizer){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-percentage-visualizer[invalid]:not([invalid=false])) div[slot=content]{border-color:rgb(var(--color-red-default))}:host(limebb-percentage-visualizer):has(label) div[slot=content]{min-height:2.5rem;padding:0 0.375rem 0 1rem}.percentage-text{flex-shrink:0;min-width:2.5rem}:host([range-min^="-"]) .percentage-text{min-width:3.75rem}.percent-sign{opacity:0.4}.zero-point{content:"";position:absolute;transform:translateX(-50%);left:var(--limebb-percentage-visualizer-zero-point-position);height:0.25rem;width:0.25rem;border-radius:50%;box-shadow:0 0 0 0.125rem var(--limebb-percentage-visualizer-zero-point-color, rgb(var(--contrast-1200), 0.3));background-color:var(--limebb-percentage-visualizer-zero-point-color, rgb(var(--contrast-200), 0.9))}.percentage-bar{overflow:hidden;flex-grow:1;position:relative;display:flex;align-items:center;height:0.5rem;min-width:2rem;border-radius:0.5rem;background-color:rgb(var(--contrast-800), 0.6)}.percentage-fill{transition:width 0.2s ease;position:absolute;margin:auto;left:var(--limebb-percentage-visualizer-zero-point-position, 0);rotate:var(--limebb-percentage-visualizer-rotate, 0deg);transform-origin:left center;width:var(--limebb-percentage-visualizer-width);height:100%;border-radius:0.5rem}:host(limebb-percentage-visualizer:focus),:host(limebb-percentage-visualizer:focus-visible),:host(limebb-percentage-visualizer:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limebb-percentage-visualizer){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limebb-percentage-visualizer:focus) limel-helper-line,:host(limebb-percentage-visualizer:focus-visible) limel-helper-line,:host(limebb-percentage-visualizer:focus-within) limel-helper-line,:host(limebb-percentage-visualizer:hover) limel-helper-line{will-change:grid-template-rows}.percentage-fill{background-color:var(--percentage-visualizer-color, var(--limebb-percentage-visualizer-color, var(--mdc-theme-primary)))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-200or-larger-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-darker))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-200to100-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-100to90-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-90to80-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-80to70-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-70to60-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-60to50-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-coral-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-50to40-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-coral-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-40to30-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-orange-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-30to20-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-orange-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-20to10-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-amber-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-10to0-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-amber-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-0) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--contrast-800))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-0to10-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-yellow-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-10to20-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-yellow-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-20to30-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-grass-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-30to40-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-grass-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-40to50-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-lime-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-50to60-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-lime-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-60to70-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-70to80-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-80to90-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-90to100-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-100to200-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-200or-larger-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-darker))}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-0) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--contrast-800))}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-0to10-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--0to10)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-10to20-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--10to20)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-20to30-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--20to30)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-30to40-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--30to40)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-40to50-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--40to50)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-50to60-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--50to60)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-60to70-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--60to70)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-70to80-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--70to80)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-80to90-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--80to90)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-90to100-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--90to100)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-100to200-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-dark))}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-200or-larger-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-darker))}';export{s as limebb_percentage_visualizer}
|