@limetech/lime-crm-building-blocks 1.126.0 → 1.126.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/{index.esm-QC7n_5ug.js → index.esm-C1i_NocP.js} +274 -217
  3. package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
  4. package/dist/cjs/{lime-query-validation-Djq87Kvd.js → lime-query-validation-DOruuzFE.js} +7 -7
  5. package/dist/cjs/limebb-browser.cjs.entry.js +1 -1
  6. package/dist/cjs/limebb-chat-icon-list_3.cjs.entry.js +1 -1
  7. package/dist/cjs/limebb-chat-list.cjs.entry.js +1 -1
  8. package/dist/cjs/limebb-component-config.cjs.entry.js +1 -1
  9. package/dist/cjs/limebb-component-picker.cjs.entry.js +1 -1
  10. package/dist/cjs/limebb-composer-toolbar.cjs.entry.js +1 -1
  11. package/dist/cjs/limebb-currency-picker.cjs.entry.js +1 -1
  12. package/dist/cjs/limebb-data-cells.cjs.entry.js +1 -1
  13. package/dist/cjs/limebb-date-picker.cjs.entry.js +1 -1
  14. package/dist/cjs/limebb-feed-timeline-item.cjs.entry.js +1 -1
  15. package/dist/cjs/limebb-feed.cjs.entry.js +1 -1
  16. package/dist/cjs/limebb-info-tile.cjs.entry.js +8 -8
  17. package/dist/cjs/limebb-kanban-group.cjs.entry.js +2 -2
  18. package/dist/cjs/limebb-kanban-item.cjs.entry.js +1 -1
  19. package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +3 -3
  20. package/dist/cjs/limebb-lime-query-filter-builder_3.cjs.entry.js +6 -6
  21. package/dist/cjs/limebb-lime-query-filter-comparison_2.cjs.entry.js +17 -17
  22. package/dist/cjs/limebb-lime-query-filter-group_3.cjs.entry.js +11 -11
  23. package/dist/cjs/limebb-lime-query-response-format-builder.cjs.entry.js +3 -3
  24. package/dist/cjs/limebb-limeobject-file-viewer.cjs.entry.js +3 -3
  25. package/dist/cjs/limebb-loader.cjs.entry.js +1 -1
  26. package/dist/cjs/limebb-locale-picker.cjs.entry.js +1 -1
  27. package/dist/cjs/limebb-mention.cjs.entry.js +1 -1
  28. package/dist/cjs/limebb-notification-item.cjs.entry.js +1 -1
  29. package/dist/cjs/limebb-notification-list.cjs.entry.js +1 -1
  30. package/dist/cjs/limebb-object-chip.cjs.entry.js +3 -3
  31. package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +1 -1
  32. package/dist/cjs/limebb-property-selector.cjs.entry.js +3 -3
  33. package/dist/cjs/limebb-rule-chip-popover.cjs.entry.js +6 -4
  34. package/dist/cjs/limebb-rule-editor.cjs.entry.js +21 -18
  35. package/dist/cjs/limebb-rule-gate.cjs.entry.js +2 -2
  36. package/dist/cjs/limebb-text-editor.cjs.entry.js +5 -5
  37. package/dist/cjs/limebb-trend-indicator.cjs.entry.js +1 -1
  38. package/dist/cjs/{limetype-C1krEdDi.js → limetype-BlG0Apxb.js} +1 -1
  39. package/dist/cjs/loader.cjs.js +1 -1
  40. package/dist/collection/components/rule-editor/rule-chip-popover/rule-chip-popover.js +6 -4
  41. package/dist/collection/components/rule-editor/rule-editor.js +14 -14
  42. package/dist/collection/components/rule-editor/view-helpers.js +14 -11
  43. package/dist/collection/components/rule-gate/rule-gate.js +6 -6
  44. package/dist/components/chat-item.js +1 -1
  45. package/dist/components/currency-picker.js +1 -1
  46. package/dist/components/date-picker.js +1 -1
  47. package/dist/components/feed-timeline-item.js +1 -1
  48. package/dist/components/index.esm.js +1 -1
  49. package/dist/components/kanban-group.js +1 -1
  50. package/dist/components/kanban-item.js +1 -1
  51. package/dist/components/lime-query-filter-builder.js +1 -1
  52. package/dist/components/lime-query-filter-comparison.js +1 -1
  53. package/dist/components/lime-query-filter-expression.js +1 -1
  54. package/dist/components/lime-query-validation.js +1 -1
  55. package/dist/components/lime-query-value-input.js +1 -1
  56. package/dist/components/limebb-browser.js +1 -1
  57. package/dist/components/limebb-chat-list.js +1 -1
  58. package/dist/components/limebb-component-config.js +1 -1
  59. package/dist/components/limebb-component-picker.js +1 -1
  60. package/dist/components/limebb-composer-toolbar.js +1 -1
  61. package/dist/components/limebb-data-cells.js +1 -1
  62. package/dist/components/limebb-feed.js +1 -1
  63. package/dist/components/limebb-info-tile.js +1 -1
  64. package/dist/components/limebb-lime-query-builder.js +1 -1
  65. package/dist/components/limebb-lime-query-response-format-builder.js +1 -1
  66. package/dist/components/limebb-limeobject-file-viewer.js +1 -1
  67. package/dist/components/limebb-loader.js +1 -1
  68. package/dist/components/limebb-locale-picker.js +1 -1
  69. package/dist/components/limebb-mention.js +1 -1
  70. package/dist/components/limebb-notification-list.js +1 -1
  71. package/dist/components/limebb-object-chip.js +1 -1
  72. package/dist/components/limebb-rule-editor.js +1 -1
  73. package/dist/components/limebb-rule-gate.js +1 -1
  74. package/dist/components/limebb-text-editor.js +1 -1
  75. package/dist/components/limebb-trend-indicator.js +1 -1
  76. package/dist/components/limetype-field.js +1 -1
  77. package/dist/components/notification-item.js +1 -1
  78. package/dist/components/percentage-visualizer.js +1 -1
  79. package/dist/components/property-selector.js +1 -1
  80. package/dist/components/rule-chip-popover.js +1 -1
  81. package/dist/esm/{index.esm-EC5zE5lw.js → index.esm-CMeGYws2.js} +267 -210
  82. package/dist/esm/lime-crm-building-blocks.js +1 -1
  83. package/dist/esm/{lime-query-validation-Dav-tsNr.js → lime-query-validation-DvCLebd2.js} +7 -7
  84. package/dist/esm/limebb-browser.entry.js +1 -1
  85. package/dist/esm/limebb-chat-icon-list_3.entry.js +1 -1
  86. package/dist/esm/limebb-chat-list.entry.js +1 -1
  87. package/dist/esm/limebb-component-config.entry.js +1 -1
  88. package/dist/esm/limebb-component-picker.entry.js +1 -1
  89. package/dist/esm/limebb-composer-toolbar.entry.js +1 -1
  90. package/dist/esm/limebb-currency-picker.entry.js +1 -1
  91. package/dist/esm/limebb-data-cells.entry.js +1 -1
  92. package/dist/esm/limebb-date-picker.entry.js +1 -1
  93. package/dist/esm/limebb-feed-timeline-item.entry.js +1 -1
  94. package/dist/esm/limebb-feed.entry.js +1 -1
  95. package/dist/esm/limebb-info-tile.entry.js +8 -8
  96. package/dist/esm/limebb-kanban-group.entry.js +2 -2
  97. package/dist/esm/limebb-kanban-item.entry.js +1 -1
  98. package/dist/esm/limebb-lime-query-builder.entry.js +3 -3
  99. package/dist/esm/limebb-lime-query-filter-builder_3.entry.js +6 -6
  100. package/dist/esm/limebb-lime-query-filter-comparison_2.entry.js +17 -17
  101. package/dist/esm/limebb-lime-query-filter-group_3.entry.js +11 -11
  102. package/dist/esm/limebb-lime-query-response-format-builder.entry.js +3 -3
  103. package/dist/esm/limebb-limeobject-file-viewer.entry.js +3 -3
  104. package/dist/esm/limebb-loader.entry.js +1 -1
  105. package/dist/esm/limebb-locale-picker.entry.js +1 -1
  106. package/dist/esm/limebb-mention.entry.js +1 -1
  107. package/dist/esm/limebb-notification-item.entry.js +1 -1
  108. package/dist/esm/limebb-notification-list.entry.js +1 -1
  109. package/dist/esm/limebb-object-chip.entry.js +3 -3
  110. package/dist/esm/limebb-percentage-visualizer.entry.js +1 -1
  111. package/dist/esm/limebb-property-selector.entry.js +3 -3
  112. package/dist/esm/limebb-rule-chip-popover.entry.js +6 -4
  113. package/dist/esm/limebb-rule-editor.entry.js +21 -18
  114. package/dist/esm/limebb-rule-gate.entry.js +2 -2
  115. package/dist/esm/limebb-text-editor.entry.js +5 -5
  116. package/dist/esm/limebb-trend-indicator.entry.js +1 -1
  117. package/dist/esm/{limetype-COL4hyNy.js → limetype-DvPoeXt-.js} +1 -1
  118. package/dist/esm/loader.js +1 -1
  119. package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
  120. package/dist/lime-crm-building-blocks/{p-7d51a34c.entry.js → p-006b6449.entry.js} +1 -1
  121. package/dist/lime-crm-building-blocks/{p-c469db7e.entry.js → p-10ddd002.entry.js} +1 -1
  122. package/dist/lime-crm-building-blocks/{p-277b6ad4.entry.js → p-1955495c.entry.js} +1 -1
  123. package/dist/lime-crm-building-blocks/{p-11494f30.entry.js → p-25234f4b.entry.js} +1 -1
  124. package/dist/lime-crm-building-blocks/{p-abcb1e49.entry.js → p-2a05b949.entry.js} +1 -1
  125. package/dist/lime-crm-building-blocks/p-30778dac.entry.js +1 -0
  126. package/dist/lime-crm-building-blocks/{p-1797622d.entry.js → p-47799e80.entry.js} +1 -1
  127. package/dist/lime-crm-building-blocks/{p-fd6dcfe3.entry.js → p-49b8a9ca.entry.js} +1 -1
  128. package/dist/lime-crm-building-blocks/p-6093254e.entry.js +1 -0
  129. package/dist/lime-crm-building-blocks/{p-b8d9ff68.entry.js → p-610dae2e.entry.js} +1 -1
  130. package/dist/lime-crm-building-blocks/p-62b247c1.entry.js +1 -0
  131. package/dist/lime-crm-building-blocks/p-65ea94b4.entry.js +1 -0
  132. package/dist/lime-crm-building-blocks/{p-dd38e0ba.entry.js → p-7975c91f.entry.js} +1 -1
  133. package/dist/lime-crm-building-blocks/{p-c4f41ec4.entry.js → p-7ace2e41.entry.js} +1 -1
  134. package/dist/lime-crm-building-blocks/{p-8084e825.entry.js → p-89170cc9.entry.js} +1 -1
  135. package/dist/lime-crm-building-blocks/{p-3781a766.entry.js → p-92738a30.entry.js} +1 -1
  136. package/dist/lime-crm-building-blocks/{p-71a6f624.entry.js → p-99054b73.entry.js} +1 -1
  137. package/dist/lime-crm-building-blocks/{p-f09c7244.entry.js → p-993991af.entry.js} +1 -1
  138. package/dist/lime-crm-building-blocks/{p-f0a567f3.entry.js → p-99790629.entry.js} +1 -1
  139. package/dist/lime-crm-building-blocks/{p-74455a30.entry.js → p-9ccd9d7f.entry.js} +1 -1
  140. package/dist/lime-crm-building-blocks/{p-f5244a1a.entry.js → p-9f03e766.entry.js} +1 -1
  141. package/dist/lime-crm-building-blocks/{p-CAMipqwt.js → p-CI7dwT4T.js} +1 -1
  142. package/dist/lime-crm-building-blocks/{p-C25FPZQh.js → p-CYiNR7pQ.js} +1 -1
  143. package/dist/lime-crm-building-blocks/p-D5qhls4G.js +1 -0
  144. package/dist/lime-crm-building-blocks/{p-8d6cc027.entry.js → p-a3439b73.entry.js} +1 -1
  145. package/dist/lime-crm-building-blocks/{p-6ada2b2b.entry.js → p-a634c792.entry.js} +1 -1
  146. package/dist/lime-crm-building-blocks/{p-b1a8d1a0.entry.js → p-b978301b.entry.js} +1 -1
  147. package/dist/lime-crm-building-blocks/{p-43a7facd.entry.js → p-beae8aa1.entry.js} +1 -1
  148. package/dist/lime-crm-building-blocks/{p-e6ed33ff.entry.js → p-c3a72b03.entry.js} +1 -1
  149. package/dist/lime-crm-building-blocks/{p-6d3a9ed3.entry.js → p-c43dc121.entry.js} +1 -1
  150. package/dist/lime-crm-building-blocks/{p-7a125570.entry.js → p-d026068f.entry.js} +1 -1
  151. package/dist/lime-crm-building-blocks/p-d1c61830.entry.js +1 -0
  152. package/dist/lime-crm-building-blocks/{p-057e1638.entry.js → p-d33efebb.entry.js} +1 -1
  153. package/dist/lime-crm-building-blocks/{p-24fc049c.entry.js → p-e1e1e2d1.entry.js} +1 -1
  154. package/dist/lime-crm-building-blocks/{p-c139ab98.entry.js → p-e468e359.entry.js} +1 -1
  155. package/dist/lime-crm-building-blocks/{p-35c72752.entry.js → p-ea461bb7.entry.js} +1 -1
  156. package/dist/types/components/rule-editor/rule-editor.d.ts +5 -5
  157. package/dist/types/components/rule-editor/view-helpers.d.ts +7 -3
  158. package/dist/types/components/rule-gate/rule-gate.d.ts +2 -2
  159. package/dist/types/components.d.ts +12 -12
  160. package/package.json +4 -5
  161. package/dist/lime-crm-building-blocks/p-1831e571.entry.js +0 -1
  162. package/dist/lime-crm-building-blocks/p-3313e357.entry.js +0 -1
  163. package/dist/lime-crm-building-blocks/p-7922726c.entry.js +0 -1
  164. package/dist/lime-crm-building-blocks/p-BeLcuSg8.js +0 -1
  165. package/dist/lime-crm-building-blocks/p-cefb24bb.entry.js +0 -1
  166. package/dist/lime-crm-building-blocks/p-e717bdff.entry.js +0 -1
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as r,h as a,Host as l,transformTag as t}from"@stencil/core/internal/client";import{n as i}from"./index.esm.js";import{g as o,n as s}from"./normalize-value.js";const n=1e-4,c=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),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 a("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(i.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(),r=this.getZeroPointPosition();return a(l,{key:"c57fbde9785115a91c28db17ccebee42a335a80f",class:this.getContainerClassList(),style:{"--limebb-percentage-visualizer-zero-point-position":`${r}%`,"--limebb-percentage-visualizer-width":`${Math.abs(e)}%`,"--limebb-percentage-visualizer-rotate":e>=0?"0deg":"180deg"}},a("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},a("div",{key:"2afd6d0ff95eace6fac444fd3e2732d22ab97728",slot:"content"},this.renderVisualization())),this.renderHelperLine())}renderVisualization(){if(!this.reducePresence||0!==this.numValue&&this.hasValue())return this.hasValue()?[a("div",{class:"percentage-bar"},a("div",{class:"percentage-fill"}),this.renderZeroPoint()),a("span",{class:"percentage-text"},this.formatValue(this.numValue),a("span",{class:"percent-sign"},"%"))]:a("span",{class:"no-value"},"–")}renderZeroPoint(){if(!(this.rangeMin>=0||this.rangeMax<=0))return[a("div",{id:this.zeroPointId,class:"zero-point"}),a("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=o(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,n)*(100-a):e/Math.max(Math.abs(this.rangeMin),n)*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(s(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}]}}static get style(){return'@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))}'}},[1,"limebb-percentage-visualizer",{platform:[16],context:[16],value:[520],rangeMax:[514,"range-max"],rangeMin:[514,"range-min"],multiplier:[514],label:[513],invalid:[516],required:[516],helperText:[513,"helper-text"],reducePresence:[516,"reduce-presence"],displayPercentageColors:[516,"display-percentage-colors"]},void 0,{value:[{valueChanged:0}]}]);function p(){"undefined"!=typeof customElements&&["limebb-percentage-visualizer"].forEach((e=>{"limebb-percentage-visualizer"===e&&(customElements.get(t(e))||customElements.define(t(e),c))}))}export{c as P,p as d}
1
+ import{proxyCustomElement as e,HTMLElement as r,h as a,Host as l,transformTag as t}from"@stencil/core/internal/client";import{b as i}from"./index.esm.js";import{g as o,n as s}from"./normalize-value.js";const n=1e-4,c=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),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 a("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(i.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(),r=this.getZeroPointPosition();return a(l,{key:"c57fbde9785115a91c28db17ccebee42a335a80f",class:this.getContainerClassList(),style:{"--limebb-percentage-visualizer-zero-point-position":`${r}%`,"--limebb-percentage-visualizer-width":`${Math.abs(e)}%`,"--limebb-percentage-visualizer-rotate":e>=0?"0deg":"180deg"}},a("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},a("div",{key:"2afd6d0ff95eace6fac444fd3e2732d22ab97728",slot:"content"},this.renderVisualization())),this.renderHelperLine())}renderVisualization(){if(!this.reducePresence||0!==this.numValue&&this.hasValue())return this.hasValue()?[a("div",{class:"percentage-bar"},a("div",{class:"percentage-fill"}),this.renderZeroPoint()),a("span",{class:"percentage-text"},this.formatValue(this.numValue),a("span",{class:"percent-sign"},"%"))]:a("span",{class:"no-value"},"–")}renderZeroPoint(){if(!(this.rangeMin>=0||this.rangeMax<=0))return[a("div",{id:this.zeroPointId,class:"zero-point"}),a("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=o(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,n)*(100-a):e/Math.max(Math.abs(this.rangeMin),n)*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(s(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}]}}static get style(){return'@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))}'}},[1,"limebb-percentage-visualizer",{platform:[16],context:[16],value:[520],rangeMax:[514,"range-max"],rangeMin:[514,"range-min"],multiplier:[514],label:[513],invalid:[516],required:[516],helperText:[513,"helper-text"],reducePresence:[516,"reduce-presence"],displayPercentageColors:[516,"display-percentage-colors"]},void 0,{value:[{valueChanged:0}]}]);function p(){"undefined"!=typeof customElements&&["limebb-percentage-visualizer"].forEach((e=>{"limebb-percentage-visualizer"===e&&(customElements.get(t(e))||customElements.define(t(e),c))}))}export{c as P,p as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,createEvent as i,h as s,transformTag as r}from"@stencil/core/internal/client";import{j as o,n}from"./index.esm.js";import{g as l}from"./limetype.js";function h(t){if(!(null==t?void 0:t.properties))return{};const e=Object.assign({},t.properties),i={id:"_id",timestamp:"_timestamp",descriptive:"_descriptive",createduser:"_createduser",createdtime:"_createdtime",updateduser:"_updateduser"};for(const[t,s]of Object.entries(i)){const i=e[t];i&&(e[s]=i,delete e[t])}return e}function c(t,e,i){if(!i||!e||!t)return;const s=i.split(".");let r,o=t[e];for(const t of s){if(!o)return;if(r=h(o)[t],!r)return;r.relation&&(o=r.relation.getLimetype())}return r}function a(t,e,i){if(!i||!e||!t)return{property:void 0};const s=i.split(".");let r,o=t[e];for(let t=0;t<s.length;t++){const e=s[t];if(!o)return{property:void 0};if(r=h(o)[e],!r)return{property:void 0,error:`Property '${e}' does not exist on limetype '${o.name}'`};if("hasmany"===r.type||"hasandbelongstomany"===r.type)return{property:void 0,error:`Cannot filter on many-relation '${s.slice(0,t+1).join(".")}'. Use a related limetype's filter instead.`};r.relation&&(o=r.relation.getLimetype())}return{property:r}}const u=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.change=i(this,"change",7),this.label="Property",this.required=!1,this.isOpen=!1,this.navigationPath="",this.menuItems=[],this.handleChipSetWrapperClick=t=>{t.stopPropagation()},this.handleChipSetFocus=()=>{this.isOpen||(this.navigationPath=this.value||"",this.loadMenuItems(),this.isOpen=!0)},this.handleSelect=t=>{t.stopPropagation();const e=t.detail.value;if(!e)return;const i=c(this.limetypes,this.limetype,e);(null==i?void 0:i.relation)?this.navigationPath=e:(this.change.emit(e),this.isOpen=!1,this.navigationPath="")},this.handleNavigateMenu=t=>{var e;t.stopPropagation(),(null===(e=t.detail)||void 0===e?void 0:e.value)&&(this.navigationPath=t.detail.value)},this.handleCancel=()=>{this.isOpen=!1,this.navigationPath=""},this.handleChipSetChange=t=>{t.stopPropagation();const e=t.detail;if(!e)return this.change.emit(""),void(this.navigationPath="");const i=Array.isArray(e)?e:[e];if(0===i.length)this.change.emit(""),this.navigationPath="";else{const t=i.at(-1);t&&this.change.emit(t.value),this.navigationPath=""}}}componentWillLoad(){const t=this.platform.get(n.Application).getLanguage();this.collator=new Intl.Collator(t,{numeric:!0,sensitivity:"base"})}render(){if(!this.limetype||!this.limetypes)return null;const t=this.getChipsForPath(this.navigationPath||this.value||"");return s("limel-menu",{items:this.menuItems,open:this.isOpen,emptyResultMessage:"No available properties",surfaceWidth:"inherit-from-trigger",openDirection:"bottom-end",onSelect:this.handleSelect,onNavigateMenu:this.handleNavigateMenu,onCancel:this.handleCancel},s("div",{slot:"trigger"},s("div",{onClick:this.handleChipSetWrapperClick},s("limel-chip-set",{type:"input",label:this.label,value:t,required:this.required,helperText:this.helperText,delimiter:"›",maxItems:1,onChange:this.handleChipSetChange,onFocus:this.handleChipSetFocus}))))}loadMenuItems(){const t=this.getCurrentLimetype();this.menuItems=t?this.createMenuItems(t,""):[]}getCurrentLimetype(){if(!this.navigationPath)return this.limetypes[this.limetype];const t=c(this.limetypes,this.limetype,this.navigationPath);return(null==t?void 0:t.relation)?t.relation.getLimetype():this.limetypes[this.limetype]}createMenuItems(t,e){const i=[];if(!t)return i;const s=h(t);for(const[t,r]of Object.entries(s)){if("hasmany"===r.type||"hasandbelongstomany"===r.type)continue;const s=e?`${e}.${t}`:t;let o;if(r.relation&&r.relation){const t=r.relation.getLimetype();t&&(o=async()=>this.createMenuItems(t,s))}i.push({text:r.localname||t,secondaryText:this.getSecondaryText(r),icon:this.getIconForProperty(r),value:s,items:o})}return i.sort(((t,e)=>{var i,s;return this.collator.compare(null!==(i=t.text)&&void 0!==i?i:"",null!==(s=e.text)&&void 0!==s?s:"")})),0===i.length?[{text:"No available properties",value:"",disabled:!0}]:i}getSecondaryText(t){var e;if(t.relation){const i=t.relation.getLimetype();return(null===(e=null==i?void 0:i.localname)||void 0===e?void 0:e.singular)||"Object"}return t.type.charAt(0).toUpperCase()+t.type.slice(1)}getIconForProperty(t){return t.relation?l(t.relation.getLimetype()):{name:"dot_circle",color:"rgb(var(--color-gray-default))"}}getChipsForPath(t){if(!t)return[];const e=t.split("."),i=[];let s=this.limetypes[this.limetype],r="";for(const t of e){r=r?`${r}.${t}`:t;const e=h(s)[t];e&&(i.push({id:r,text:e.localname||t,icon:this.getIconForProperty(e),value:r}),e.relation&&(s=e.relation.getLimetype()))}return i}static get style(){return":host(limebb-property-selector){display:block}limel-menu{display:block;width:100%}"}},[1,"limebb-property-selector",{platform:[16],context:[16],limetype:[1],value:[1],label:[1],required:[4],helperText:[1,"helper-text"],limetypes:[32],isOpen:[32],navigationPath:[32]}]);function p(){"undefined"!=typeof customElements&&["limebb-property-selector"].forEach((t=>{"limebb-property-selector"===t&&(customElements.get(r(t))||customElements.define(r(t),u))}))}!function(t,e,i,s){var r,o=arguments.length,n=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(o<3?r(n):o>3?r(e,i,n):r(e,i))||n);o>3&&n&&Object.defineProperty(e,i,n)}([o()],u.prototype,"limetypes",void 0);export{u as P,h as a,p as d,c as g,a as v}
1
+ import{proxyCustomElement as t,HTMLElement as e,createEvent as i,h as s,transformTag as r}from"@stencil/core/internal/client";import{L as o,b as n}from"./index.esm.js";import{g as l}from"./limetype.js";function h(t){if(!(null==t?void 0:t.properties))return{};const e=Object.assign({},t.properties),i={id:"_id",timestamp:"_timestamp",descriptive:"_descriptive",createduser:"_createduser",createdtime:"_createdtime",updateduser:"_updateduser"};for(const[t,s]of Object.entries(i)){const i=e[t];i&&(e[s]=i,delete e[t])}return e}function c(t,e,i){if(!i||!e||!t)return;const s=i.split(".");let r,o=t[e];for(const t of s){if(!o)return;if(r=h(o)[t],!r)return;r.relation&&(o=r.relation.getLimetype())}return r}function a(t,e,i){if(!i||!e||!t)return{property:void 0};const s=i.split(".");let r,o=t[e];for(let t=0;t<s.length;t++){const e=s[t];if(!o)return{property:void 0};if(r=h(o)[e],!r)return{property:void 0,error:`Property '${e}' does not exist on limetype '${o.name}'`};if("hasmany"===r.type||"hasandbelongstomany"===r.type)return{property:void 0,error:`Cannot filter on many-relation '${s.slice(0,t+1).join(".")}'. Use a related limetype's filter instead.`};r.relation&&(o=r.relation.getLimetype())}return{property:r}}const u=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.change=i(this,"change",7),this.label="Property",this.required=!1,this.isOpen=!1,this.navigationPath="",this.menuItems=[],this.handleChipSetWrapperClick=t=>{t.stopPropagation()},this.handleChipSetFocus=()=>{this.isOpen||(this.navigationPath=this.value||"",this.loadMenuItems(),this.isOpen=!0)},this.handleSelect=t=>{t.stopPropagation();const e=t.detail.value;if(!e)return;const i=c(this.limetypes,this.limetype,e);(null==i?void 0:i.relation)?this.navigationPath=e:(this.change.emit(e),this.isOpen=!1,this.navigationPath="")},this.handleNavigateMenu=t=>{var e;t.stopPropagation(),(null===(e=t.detail)||void 0===e?void 0:e.value)&&(this.navigationPath=t.detail.value)},this.handleCancel=()=>{this.isOpen=!1,this.navigationPath=""},this.handleChipSetChange=t=>{t.stopPropagation();const e=t.detail;if(!e)return this.change.emit(""),void(this.navigationPath="");const i=Array.isArray(e)?e:[e];if(0===i.length)this.change.emit(""),this.navigationPath="";else{const t=i.at(-1);t&&this.change.emit(t.value),this.navigationPath=""}}}componentWillLoad(){const t=this.platform.get(n.Application).getLanguage();this.collator=new Intl.Collator(t,{numeric:!0,sensitivity:"base"})}render(){if(!this.limetype||!this.limetypes)return null;const t=this.getChipsForPath(this.navigationPath||this.value||"");return s("limel-menu",{items:this.menuItems,open:this.isOpen,emptyResultMessage:"No available properties",surfaceWidth:"inherit-from-trigger",openDirection:"bottom-end",onSelect:this.handleSelect,onNavigateMenu:this.handleNavigateMenu,onCancel:this.handleCancel},s("div",{slot:"trigger"},s("div",{onClick:this.handleChipSetWrapperClick},s("limel-chip-set",{type:"input",label:this.label,value:t,required:this.required,helperText:this.helperText,delimiter:"›",maxItems:1,onChange:this.handleChipSetChange,onFocus:this.handleChipSetFocus}))))}loadMenuItems(){const t=this.getCurrentLimetype();this.menuItems=t?this.createMenuItems(t,""):[]}getCurrentLimetype(){if(!this.navigationPath)return this.limetypes[this.limetype];const t=c(this.limetypes,this.limetype,this.navigationPath);return(null==t?void 0:t.relation)?t.relation.getLimetype():this.limetypes[this.limetype]}createMenuItems(t,e){const i=[];if(!t)return i;const s=h(t);for(const[t,r]of Object.entries(s)){if("hasmany"===r.type||"hasandbelongstomany"===r.type)continue;const s=e?`${e}.${t}`:t;let o;if(r.relation&&r.relation){const t=r.relation.getLimetype();t&&(o=async()=>this.createMenuItems(t,s))}i.push({text:r.localname||t,secondaryText:this.getSecondaryText(r),icon:this.getIconForProperty(r),value:s,items:o})}return i.sort(((t,e)=>{var i,s;return this.collator.compare(null!==(i=t.text)&&void 0!==i?i:"",null!==(s=e.text)&&void 0!==s?s:"")})),0===i.length?[{text:"No available properties",value:"",disabled:!0}]:i}getSecondaryText(t){var e;if(t.relation){const i=t.relation.getLimetype();return(null===(e=null==i?void 0:i.localname)||void 0===e?void 0:e.singular)||"Object"}return t.type.charAt(0).toUpperCase()+t.type.slice(1)}getIconForProperty(t){return t.relation?l(t.relation.getLimetype()):{name:"dot_circle",color:"rgb(var(--color-gray-default))"}}getChipsForPath(t){if(!t)return[];const e=t.split("."),i=[];let s=this.limetypes[this.limetype],r="";for(const t of e){r=r?`${r}.${t}`:t;const e=h(s)[t];e&&(i.push({id:r,text:e.localname||t,icon:this.getIconForProperty(e),value:r}),e.relation&&(s=e.relation.getLimetype()))}return i}static get style(){return":host(limebb-property-selector){display:block}limel-menu{display:block;width:100%}"}},[1,"limebb-property-selector",{platform:[16],context:[16],limetype:[1],value:[1],label:[1],required:[4],helperText:[1,"helper-text"],limetypes:[32],isOpen:[32],navigationPath:[32]}]);function p(){"undefined"!=typeof customElements&&["limebb-property-selector"].forEach((t=>{"limebb-property-selector"===t&&(customElements.get(r(t))||customElements.define(r(t),u))}))}!function(t,e,i,s){var r,o=arguments.length,n=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(o<3?r(n):o>3?r(e,i,n):r(e,i))||n);o>3&&n&&Object.defineProperty(e,i,n)}([o()],u.prototype,"limetypes",void 0);export{u as P,h as a,p as d,c as g,a as v}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,createEvent as o,h as i,transformTag as r}from"@stencil/core/internal/client";import{n as s}from"./index.esm.js";import{L as l}from"./web-component-template.js";const a=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.negate=o(this,"negate",7),this.updateArgs=o(this,"updateArgs",7),this.deleteChip=o(this,"deleteChip",7),this.isNegated=!1,this.readonly=!1,this.disabled=!1,this.isMutable=!0,this.handleNegateChange=e=>{e.stopPropagation(),this.negate.emit(e.detail)},this.handleArgsChange=e=>{e.stopPropagation(),this.updateArgs.emit(e.detail)},this.handleDelete=()=>{this.deleteChip.emit()}}render(){return i("div",{key:"6aae573b524737ee3d2a4b2d3df68ec9bf1f1a0f",class:"popover"},this.renderHeader(),this.renderBody())}renderHeader(){var e,t,o,r,s;const l=null!==(r=null!==(t=null===(e=this.metadata)||void 0===e?void 0:e.title)&&void 0!==t?t:null===(o=this.refNode)||void 0===o?void 0:o.id)&&void 0!==r?r:"";return i("limel-header",{class:"popover__header is-narrow",heading:l,icon:null===(s=this.metadata)||void 0===s?void 0:s.icon},this.renderHeaderActions())}renderHeaderActions(){return this.isMutable?i("div",{slot:"actions",class:"popover__header-actions"},i("limel-switch",{class:"popover__negate-switch",label:this.translator.get("webclient.rule-editor.negate"),value:this.isNegated,onChange:this.handleNegateChange}),i("limel-icon-button",{class:"popover__delete-button",icon:"trash",label:this.translator.get("webclient.rule-editor.delete"),onClick:this.handleDelete})):null}get translator(){return this.platform.get(s.Translate)}renderBody(){var e,t;const o=null===(e=this.metadata)||void 0===e?void 0:e.configComponent;return o?i("div",{class:"popover__body"},i(l,{platform:this.platform,context:this.context,name:o.name,props:Object.assign(Object.assign({},o.props),{value:null===(t=this.refNode)||void 0===t?void 0:t.args,readonly:this.readonly,disabled:this.disabled,onChange:this.handleArgsChange})})):null}static get style(){return":host{display:block}.popover{display:flex;flex-direction:column;min-width:24rem;background-color:rgb(var(--contrast-100));border:1px solid rgb(var(--contrast-700));border-radius:0.5rem;box-shadow:0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);overflow:hidden}.popover__header{--header-background-color:rgba(var(--contrast-300));padding-right:0.5rem;gap:1rem}.popover__header-actions{display:grid;grid-auto-flow:column;grid-gap:0.75rem;padding:0.25rem;align-items:center}.popover__delete-button{color:rgb(var(--contrast-1100))}.popover__body{padding:1rem}"}},[1,"limebb-rule-chip-popover",{platform:[16],context:[16],refNode:[16],isNegated:[4,"is-negated"],metadata:[16],readonly:[4],disabled:[4],isMutable:[4,"is-mutable"]}]);function n(){"undefined"!=typeof customElements&&["limebb-rule-chip-popover"].forEach((e=>{"limebb-rule-chip-popover"===e&&(customElements.get(r(e))||customElements.define(r(e),a))}))}export{a as R,n as d}
1
+ import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as o,transformTag as r}from"@stencil/core/internal/client";import{b as s}from"./index.esm.js";import{L as a}from"./web-component-template.js";const l=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.negate=i(this,"negate",7),this.updateArgs=i(this,"updateArgs",7),this.deleteChip=i(this,"deleteChip",7),this.isNegated=!1,this.readonly=!1,this.disabled=!1,this.isMutable=!0,this.handleNegateChange=e=>{e.stopPropagation(),this.negate.emit(e.detail)},this.handleArgsChange=e=>{e.stopPropagation(),this.updateArgs.emit(e.detail)},this.handleDelete=()=>{this.deleteChip.emit()}}render(){return o("div",{key:"6aae573b524737ee3d2a4b2d3df68ec9bf1f1a0f",class:"popover"},this.renderHeader(),this.renderBody())}renderHeader(){var e,t,i,r;const s=(null===(e=this.metadata)||void 0===e?void 0:e.title)?this.translator.get(this.metadata.title):null!==(i=null===(t=this.refNode)||void 0===t?void 0:t.id)&&void 0!==i?i:"";return o("limel-header",{class:"popover__header is-narrow",heading:s,icon:null===(r=this.metadata)||void 0===r?void 0:r.icon},this.renderHeaderActions())}renderHeaderActions(){return this.isMutable?o("div",{slot:"actions",class:"popover__header-actions"},o("limel-switch",{class:"popover__negate-switch",label:this.translator.get("webclient.rule-editor.negate"),value:this.isNegated,onChange:this.handleNegateChange}),o("limel-icon-button",{class:"popover__delete-button",icon:"trash",label:this.translator.get("webclient.rule-editor.delete"),onClick:this.handleDelete})):null}get translator(){return this.platform.get(s.Translate)}renderBody(){var e,t;const i=null===(e=this.metadata)||void 0===e?void 0:e.configComponent;return i?o("div",{class:"popover__body"},o(a,{platform:this.platform,context:this.context,name:i.name,props:Object.assign(Object.assign({},i.props),{value:null===(t=this.refNode)||void 0===t?void 0:t.args,readonly:this.readonly,disabled:this.disabled,onChange:this.handleArgsChange})})):null}static get style(){return":host{display:block}.popover{display:flex;flex-direction:column;min-width:24rem;background-color:rgb(var(--contrast-100));border:1px solid rgb(var(--contrast-700));border-radius:0.5rem;box-shadow:0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);overflow:hidden}.popover__header{--header-background-color:rgba(var(--contrast-300));padding-right:0.5rem;gap:1rem}.popover__header-actions{display:grid;grid-auto-flow:column;grid-gap:0.75rem;padding:0.25rem;align-items:center}.popover__delete-button{color:rgb(var(--contrast-1100))}.popover__body{padding:1rem}"}},[1,"limebb-rule-chip-popover",{platform:[16],context:[16],refNode:[16],isNegated:[4,"is-negated"],metadata:[16],readonly:[4],disabled:[4],isMutable:[4,"is-mutable"]}]);function n(){"undefined"!=typeof customElements&&["limebb-rule-chip-popover"].forEach((e=>{"limebb-rule-chip-popover"===e&&(customElements.get(r(e))||customElements.define(r(e),l))}))}export{l as R,n as d}