@limetech/lime-elements 40.0.3 → 40.1.1

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 (31) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/lime-elements.cjs.js +1 -1
  3. package/dist/cjs/limel-chart.cjs.entry.js +60 -10
  4. package/dist/cjs/limel-chip-set.cjs.entry.js +5 -5
  5. package/dist/cjs/limel-form.cjs.entry.js +1590 -335
  6. package/dist/cjs/limel-picker.cjs.entry.js +36 -16
  7. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +6 -5
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/collection/components/chart/chart.js +83 -12
  10. package/dist/collection/components/chip-set/chip-set.js +6 -6
  11. package/dist/collection/components/picker/picker.js +36 -16
  12. package/dist/esm/lime-elements.js +1 -1
  13. package/dist/esm/limel-chart.entry.js +60 -10
  14. package/dist/esm/limel-chip-set.entry.js +5 -5
  15. package/dist/esm/limel-form.entry.js +1590 -335
  16. package/dist/esm/limel-picker.entry.js +36 -16
  17. package/dist/esm/limel-prosemirror-adapter.entry.js +6 -5
  18. package/dist/esm/loader.js +1 -1
  19. package/dist/lime-elements/lime-elements.esm.js +1 -1
  20. package/dist/lime-elements/{p-dd116bb1.entry.js → p-056ba5c5.entry.js} +1 -1
  21. package/dist/lime-elements/p-1b25f158.entry.js +13 -0
  22. package/dist/lime-elements/p-73d9f0f6.entry.js +1 -0
  23. package/dist/lime-elements/{p-72a1d432.entry.js → p-d3d71a68.entry.js} +1 -1
  24. package/dist/lime-elements/{p-fa4edcf5.entry.js → p-f2294e26.entry.js} +1 -1
  25. package/dist/types/components/chart/chart.d.ts +28 -4
  26. package/dist/types/components/chip-set/chip-set.d.ts +4 -4
  27. package/dist/types/components/picker/picker.d.ts +14 -0
  28. package/dist/types/components.d.ts +21 -6
  29. package/package.json +3 -3
  30. package/dist/lime-elements/p-21b54196.entry.js +0 -13
  31. package/dist/lime-elements/p-9ed9d0de.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as t,c as i,h as s,a as e}from"./p-BGxJfR2f.js";import{t as h}from"./p-DgqE77nk.js";import{i as n}from"./p-B9Ofc5RB.js";import{E as r,T as o,a,A as l,b as c}from"./p-C4_9qUMP.js";import{c as d}from"./p-JbKhhoXs.js";import{a as u,g as p}from"./p-CgNJbSP4.js";import{d as m}from"./p-BviYUVSD.js";import"./p-BJQylLSL.js";import"./p-D6dCQvwl.js";import"./p-BOEi1C7r.js";import"./p-oiMYqRQ0.js";const g=class{constructor(s){t(this,s),this.change=i(this,"change"),this.interact=i(this,"interact"),this.action=i(this,"action"),this.disabled=!1,this.readonly=!1,this.language="en",this.required=!1,this.invalid=!1,this.allItems=[],this.multiple=!1,this.delimiter=null,this.actions=[],this.actionPosition="bottom",this.actionScrollBehavior="sticky",this.badgeIcons=!1,this.textValue="",this.loading=!1,this.chips=[],this.chipSetEditMode=!1,this.getValueId=t=>{const i=t.value;return i&&"object"==typeof i?i.id:i},this.createChips=t=>t?this.multiple?t.map(this.createChip):[this.createChip(t)]:[],this.createChip=t=>{const i=p(t.icon),s=u(t.icon,t.iconColor);return{id:`${this.getValueId(t)}`,text:t.text,removable:!1!==t.removable,icon:i?{name:i,color:s}:void 0,image:t.image,value:t,menuItems:t.actions,badge:t.badge}},this.search=async t=>{const i=setTimeout((()=>{this.loading=!0})),s=this.searcher||this.defaultSearcher,e=await s(this.textValue);clearTimeout(i),this.handleSearchResult(t,e)},this.defaultSearcher=async t=>""===t?this.allItems.slice(0,20):this.allItems.filter((i=>{let s=i.text.toLowerCase();return i.secondaryText&&(s=s+" "+i.secondaryText.toLowerCase()),s.includes(t.toLowerCase())})).slice(0,20),this.handleTextInput=this.handleTextInput.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputFieldFocus=this.handleInputFieldFocus.bind(this),this.handleChange=this.handleChange.bind(this),this.handleInteract=this.handleInteract.bind(this),this.handleListChange=this.handleListChange.bind(this),this.handleActionListChange=this.handleActionListChange.bind(this),this.handleStopEditAndBlur=this.handleStopEditAndBlur.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.onListKeyDown=this.onListKeyDown.bind(this),this.portalId=d(),this.debouncedSearch=m(this.search,300)}componentWillLoad(){this.chips=this.createChips(this.value)}componentDidLoad(){this.chipSet=this.host.shadowRoot.querySelector("limel-chip-set"),this.updateTabIndex()}disconnectedCallback(){this.debouncedSearch.cancel()}onDisabledChange(){this.updateTabIndex()}updateTabIndex(){this.host.setAttribute("tabindex",this.disabled||this.readonly?"-1":"0")}async componentWillUpdate(){this.chipSetEditMode=!1,this.chipSet&&(this.chipSetEditMode=await this.chipSet.getEditMode())}render(){const t={};return this.multiple||(t.maxItems=1),[s("limel-chip-set",Object.assign({key:"281a5f2451505c012b72c04610d897cf22717420",type:"input",inputType:"search",label:this.label,helperText:this.helperText,leadingIcon:this.leadingIcon,value:this.chips,disabled:this.disabled,invalid:this.invalid,delimiter:this.renderDelimiter(),readonly:this.readonly,required:this.required,searchLabel:this.searchLabel,language:this.language,onInput:this.handleTextInput,onKeyDown:this.handleInputKeyDown,onChange:this.handleChange,onInteract:this.handleInteract,onStartEdit:this.handleInputFieldFocus,onStopEdit:this.handleStopEditAndBlur,emptyInputOnBlur:!1,emptyInputOnChange:!1,clearAllButton:this.multiple&&!this.chipSetEditMode},t)),this.renderDropdown()]}onChangeValue(){this.chips=this.createChips(this.value)}renderDelimiter(){return this.multiple?this.delimiter:null}renderDropdown(){const t=this.getDropdownContent(),i=[];if(this.shouldShowDropDownContent()){const s=this.getActionContent();"top"===this.actionPosition&&i.push(s),t&&i.push(t),"bottom"===this.actionPosition&&i.push(s)}return this.renderPortal(i)}getActionContent(){var t,i;return 0===(null!==(i=null===(t=this.actions)||void 0===t?void 0:t.length)&&void 0!==i?i:0)?null:[s("limel-list",{class:{"static-actions-list":!0,"is-on-top":"top"===this.actionPosition,"is-at-bottom":"bottom"===this.actionPosition,"has-position-sticky":"sticky"===this.actionScrollBehavior},badgeIcons:!0,type:"selectable",onChange:this.handleActionListChange,items:this.actions.map(this.removeUnusedPropertiesOnAction)})]}removeUnusedPropertiesOnAction(t){return Object.assign(Object.assign({},t),{actions:[]})}shouldShowDropDownContent(){return!this.isFull()&&!!this.chipSetEditMode}getDropdownContent(){var t;if(this.shouldShowDropDownContent())return this.loading?this.renderSpinner():(null===(t=this.items)||void 0===t?void 0:t.length)?this.renderListResult():""!==this.textValue?this.renderEmptyMessage():void 0}isFull(){return!this.multiple&&!!this.value}renderSpinner(){return s("div",{style:{width:"100%",display:"flex","align-items":"center","justify-content":"center",padding:"1rem 0"}},s("limel-spinner",{limeBranded:!1}))}renderEmptyMessage(){const t=this.emptyResultMessage||h.get("picker.no-matching-results",this.language,{query:this.textValue});return s("p",{style:{color:"rgb(var(--contrast-1100))",textAlign:"center",fontSize:"var(--limel-theme-default-font-size)",margin:"0.5rem 1rem"}},t)}renderListResult(){return s("limel-list",{badgeIcons:this.badgeIcons,onChange:this.handleListChange,onKeyDown:this.onListKeyDown,type:"selectable",items:this.items})}onListKeyDown(t){if(t.key===r)return t.preventDefault(),t.stopPropagation(),this.handleEscape(),void this.chipSet.setFocus();[o,a].includes(t.key)&&this.chipSet.setFocus()}renderPortal(t=[]){const i=getComputedStyle(this.host).getPropertyValue("--dropdown-z-index");return s("limel-portal",{visible:t.length>0,containerId:this.portalId,inheritParentWidth:!0,containerStyle:{"z-index":i}},s("limel-menu-surface",{open:t.length>0,allowClicksElement:this.host,style:{"--menu-surface-width":"100%","max-height":"inherit",display:"flex"},onDismiss:this.handleCloseMenu},t))}handleStopEditAndBlur(){const t=this.host.shadowRoot.activeElement||document.activeElement,i=document.querySelector(`#${this.portalId}`);n(t,this.host)||n(t,i)||this.clearInputField()}async handleTextInput(t){t.stopPropagation();const i=t.detail;this.textValue=i,this.debouncedSearch(i),""===i&&this.debouncedSearch.flush()}handleListChange(t){var i,s,e;if(t.stopPropagation(),!this.value||this.value!==t.detail){let e=t.detail;if(this.multiple&&(e=[...null!==(i=this.value)&&void 0!==i?i:[],t.detail]),this.change.emit(e),this.multiple){const i=this.items.filter((i=>i!==t.detail));this.items=this.hasPickableItems(i)?i:[]}else this.items=[],this.textValue="",null===(s=this.chipSet)||void 0===s||s.emptyInput()}this.multiple&&(null===(e=this.chipSet)||void 0===e||e.setFocus())}handleActionListChange(t){t.stopPropagation(),t.detail&&(this.action.emit(t.detail.value),this.items=[])}handleInputFieldFocus(){this.debouncedSearch(this.textValue)}handleChange(t){t.stopPropagation(),this.textValue="";let i=null;this.multiple&&(i=t.detail.map((t=>this.value.find((i=>`${this.getValueId(i)}`===t.id))))),this.change.emit(i)}handleInteract(t){t.stopPropagation(),this.interact.emit(t.detail?t.detail.value:t.detail)}handleInputKeyDown(t){const i=t.key===o&&!t.altKey&&!t.metaKey&&!t.shiftKey,s=t.key===l,e=t.key===c;if(t.key===r)return t.preventDefault(),t.stopPropagation(),void this.handleEscape();if(!i&&!s&&!e)return;const h=document.querySelector(` #${this.portalId} limel-list`);if(h){if(i||e){const i=h.shadowRoot.querySelector(".mdc-deprecated-list-item");if(!i)return;return t.preventDefault(),void i.focus()}if(s){const i=[...h.shadowRoot.querySelectorAll(".mdc-deprecated-list-item")].at(-1);if(!i)return;t.preventDefault(),i.focus()}}}handleSearchResult(t,i){var s;if(t===this.textValue){let e=i;if(this.multiple){const t=null!==(s=this.value)&&void 0!==s?s:[];e=i.filter((i=>"separator"in i||!t.includes(i)))}this.items=this.prependSearchHeader(t,e),this.loading=!1}}hasPickableItems(t){return t.some((t=>!("separator"in t)))}prependSearchHeader(t,i){return""===t?i:this.hasPickableItems(i)?[{separator:!0,text:h.get("picker.results-matching",this.language,{query:t})},...i]:i}handleCloseMenu(){this.clearInputField()}clearTextValue(){this.chipSet.emptyInput(),this.textValue="",this.debouncedSearch.cancel()}clearInputField(){this.clearTextValue(),this.handleSearchResult("",[])}resetSearchToDefault(){this.clearTextValue(),this.search("")}handleEscape(){""===this.textValue?this.clearInputField():this.resetSearchToDefault()}static get delegatesFocus(){return!0}get host(){return e(this)}static get watchers(){return{disabled:[{onDisabledChange:0}],value:[{onChangeValue:0}]}}};g.style=":host{position:relative;display:block}:host([hidden]){display:none}";export{g as limel_picker}
1
+ import{r as t,c as i,h as s,a as e}from"./p-BGxJfR2f.js";import{t as h}from"./p-DgqE77nk.js";import{i as n}from"./p-B9Ofc5RB.js";import{E as r,T as o,a,A as l,b as c}from"./p-C4_9qUMP.js";import{c as d}from"./p-JbKhhoXs.js";import{a as u,g as p}from"./p-CgNJbSP4.js";import{d as m}from"./p-BviYUVSD.js";import"./p-BJQylLSL.js";import"./p-D6dCQvwl.js";import"./p-BOEi1C7r.js";import"./p-oiMYqRQ0.js";const g=class{constructor(s){t(this,s),this.change=i(this,"change"),this.interact=i(this,"interact"),this.action=i(this,"action"),this.disabled=!1,this.readonly=!1,this.language="en",this.required=!1,this.invalid=!1,this.allItems=[],this.multiple=!1,this.delimiter=null,this.actions=[],this.actionPosition="bottom",this.actionScrollBehavior="sticky",this.badgeIcons=!1,this.textValue="",this.loading=!1,this.chips=[],this.chipSetEditMode=!1,this.getValueId=t=>{const i=t.value;return i&&"object"==typeof i?i.id:i},this.createChips=t=>t?this.multiple?t.map(this.createChip):[this.createChip(t)]:[],this.createChip=t=>{const i=p(t.icon),s=u(t.icon,t.iconColor);return{id:`${this.getValueId(t)}`,text:t.text,removable:!1!==t.removable,icon:i?{name:i,color:s}:void 0,image:t.image,value:t,menuItems:t.actions,badge:t.badge}},this.search=async t=>{const i=setTimeout((()=>{this.loading=!0})),s=this.searcher||this.defaultSearcher,e=await s(this.textValue);clearTimeout(i),this.handleSearchResult(t,e)},this.defaultSearcher=async t=>""===t?this.allItems.slice(0,20):this.allItems.filter((i=>{let s=i.text.toLowerCase();return i.secondaryText&&(s=s+" "+i.secondaryText.toLowerCase()),s.includes(t.toLowerCase())})).slice(0,20),this.handleTextInput=this.handleTextInput.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputFieldFocus=this.handleInputFieldFocus.bind(this),this.handleChange=this.handleChange.bind(this),this.handleInteract=this.handleInteract.bind(this),this.handleListChange=this.handleListChange.bind(this),this.handleActionListChange=this.handleActionListChange.bind(this),this.handleStopEditAndBlur=this.handleStopEditAndBlur.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.onListKeyDown=this.onListKeyDown.bind(this),this.portalId=d(),this.debouncedSearch=m(this.search,300)}componentWillLoad(){this.chips=this.createChips(this.value)}componentDidLoad(){this.chipSet=this.host.shadowRoot.querySelector("limel-chip-set"),this.updateTabIndex()}disconnectedCallback(){this.debouncedSearch.cancel()}onDisabledChange(){this.updateTabIndex()}updateTabIndex(){this.host.setAttribute("tabindex",this.disabled||this.readonly?"-1":"0")}async componentWillUpdate(){this.chipSetEditMode=!1,this.chipSet&&(this.chipSetEditMode=await this.chipSet.getEditMode())}render(){const t={};return this.multiple||(t.maxItems=1),[s("limel-chip-set",Object.assign({key:"281a5f2451505c012b72c04610d897cf22717420",type:"input",inputType:"search",label:this.label,helperText:this.helperText,leadingIcon:this.leadingIcon,value:this.chips,disabled:this.disabled,invalid:this.invalid,delimiter:this.renderDelimiter(),readonly:this.readonly,required:this.required,searchLabel:this.searchLabel,language:this.language,onInput:this.handleTextInput,onKeyDown:this.handleInputKeyDown,onChange:this.handleChange,onInteract:this.handleInteract,onStartEdit:this.handleInputFieldFocus,onStopEdit:this.handleStopEditAndBlur,emptyInputOnBlur:!1,emptyInputOnChange:!1,clearAllButton:this.multiple&&!this.chipSetEditMode},t)),this.renderDropdown()]}onChangeValue(){this.chips=this.createChips(this.value)}renderDelimiter(){return this.multiple?this.delimiter:null}renderDropdown(){const t=this.getDropdownContent(),i=[];if(this.shouldShowDropDownContent()){const s=this.getActionContent();"top"===this.actionPosition&&i.push(s),t&&i.push(t),"bottom"===this.actionPosition&&i.push(s)}return this.renderPortal(i)}getActionContent(){var t,i;return 0===(null!==(i=null===(t=this.actions)||void 0===t?void 0:t.length)&&void 0!==i?i:0)?null:[s("limel-list",{class:{"static-actions-list":!0,"is-on-top":"top"===this.actionPosition,"is-at-bottom":"bottom"===this.actionPosition,"has-position-sticky":"sticky"===this.actionScrollBehavior},badgeIcons:!0,type:"selectable",onChange:this.handleActionListChange,items:this.actions.map(this.removeUnusedPropertiesOnAction)})]}removeUnusedPropertiesOnAction(t){return Object.assign(Object.assign({},t),{actions:[]})}shouldShowDropDownContent(){return!this.isFull()&&!!this.chipSetEditMode}getDropdownContent(){var t;if(this.shouldShowDropDownContent())return this.loading?this.renderSpinner():(null===(t=this.items)||void 0===t?void 0:t.length)?this.renderListResult():""!==this.textValue?this.renderEmptyMessage():void 0}isFull(){return!this.multiple&&!!this.value}renderSpinner(){return s("div",{style:{width:"100%",display:"flex","align-items":"center","justify-content":"center",padding:"1rem 0"}},s("limel-spinner",{limeBranded:!1}))}renderEmptyMessage(){const t=this.emptyResultMessage||h.get("picker.no-matching-results",this.language,{query:this.textValue});return s("p",{style:{color:"rgb(var(--contrast-1100))",textAlign:"center",fontSize:"var(--limel-theme-default-font-size)",margin:"0.5rem 1rem"}},t)}renderListResult(){return s("limel-list",{badgeIcons:this.badgeIcons,onChange:this.handleListChange,onKeyDown:this.onListKeyDown,type:"selectable",items:this.items})}onListKeyDown(t){if(t.key===r)return t.preventDefault(),t.stopPropagation(),this.handleEscape(),void this.chipSet.setFocus();[o,a].includes(t.key)&&this.chipSet.setFocus()}renderPortal(t=[]){const i=getComputedStyle(this.host).getPropertyValue("--dropdown-z-index");return s("limel-portal",{visible:t.length>0,containerId:this.portalId,inheritParentWidth:!0,containerStyle:{"z-index":i}},s("limel-menu-surface",{open:t.length>0,allowClicksElement:this.host,style:{"--menu-surface-width":"100%","max-height":"inherit",display:"flex"},onDismiss:this.handleCloseMenu},t))}handleStopEditAndBlur(){const t=this.host.shadowRoot.activeElement||document.activeElement,i=document.querySelector(`#${this.portalId}`);n(t,this.host)||n(t,i)||this.clearInputField()}async handleTextInput(t){t.stopPropagation();const i=t.detail;this.textValue=i,this.debouncedSearch(i),""===i&&this.debouncedSearch.flush()}handleListChange(t){var i,s;if(t.stopPropagation(),!this.value||this.value!==t.detail){let s=t.detail;this.multiple&&(s=[...null!==(i=this.value)&&void 0!==i?i:[],t.detail]),this.change.emit(s),this.updateSearchAfterPick()}this.multiple&&(null===(s=this.chipSet)||void 0===s||s.setFocus())}updateSearchAfterPick(){this.multiple?this.resetSearchAfterValueChange():this.clearInputField()}handleActionListChange(t){t.stopPropagation(),t.detail&&(this.action.emit(t.detail.value),this.items=[])}handleInputFieldFocus(){this.debouncedSearch(this.textValue)}async handleChange(t){var i,s;t.stopPropagation();let e=null;this.multiple&&(e=t.detail.map((t=>this.value.find((i=>`${this.getValueId(i)}`===t.id))))),this.change.emit(e);const h=await(null===(i=this.chipSet)||void 0===i?void 0:i.getEditMode()),n=(null===(s=this.items)||void 0===s?void 0:s.length)>0||""!==this.textValue;this.multiple&&h&&n?this.resetSearchAfterValueChange():this.clearInputField()}handleInteract(t){t.stopPropagation(),this.interact.emit(t.detail?t.detail.value:t.detail)}handleInputKeyDown(t){const i=t.key===o&&!t.altKey&&!t.metaKey&&!t.shiftKey,s=t.key===l,e=t.key===c;if(t.key===r)return t.preventDefault(),t.stopPropagation(),void this.handleEscape();if(!i&&!s&&!e)return;const h=document.querySelector(` #${this.portalId} limel-list`);if(h){if(i||e){const i=h.shadowRoot.querySelector(".mdc-deprecated-list-item");if(!i)return;return t.preventDefault(),void i.focus()}if(s){const i=[...h.shadowRoot.querySelectorAll(".mdc-deprecated-list-item")].at(-1);if(!i)return;t.preventDefault(),i.focus()}}}handleSearchResult(t,i){var s;if(t===this.textValue){let e=i;if(this.multiple){const t=null!==(s=this.value)&&void 0!==s?s:[];e=i.filter((i=>"separator"in i||!t.includes(i)))}this.items=this.prependSearchHeader(t,e),this.loading=!1}}hasPickableItems(t){return t.some((t=>!("separator"in t)))}prependSearchHeader(t,i){return""===t?i:this.hasPickableItems(i)?[{separator:!0,text:h.get("picker.results-matching",this.language,{query:t})},...i]:i}handleCloseMenu(){this.clearInputField()}clearTextValue(){this.chipSet.emptyInput(),this.textValue="",this.debouncedSearch.cancel()}clearInputField(){this.clearTextValue(),this.handleSearchResult("",[])}resetSearchToDefault(){this.clearTextValue(),this.search("")}resetSearchAfterValueChange(){this.clearTextValue(),this.debouncedSearch("")}handleEscape(){""===this.textValue?this.clearInputField():this.resetSearchToDefault()}static get delegatesFocus(){return!0}get host(){return e(this)}static get watchers(){return{disabled:[{onDisabledChange:0}],value:[{onChangeValue:0}]}}};g.style=":host{position:relative;display:block}:host([hidden]){display:none}";export{g as limel_picker}
@@ -9,6 +9,7 @@ import { ChartItem } from './chart.types';
9
9
  * @exampleComponent limel-example-chart-stacked-bar
10
10
  * @exampleComponent limel-example-chart-orientation
11
11
  * @exampleComponent limel-example-chart-max-value
12
+ * @exampleComponent limel-example-chart-display-item-percentage
12
13
  * @exampleComponent limel-example-chart-type-bar
13
14
  * @exampleComponent limel-example-chart-type-dot
14
15
  * @exampleComponent limel-example-chart-type-area
@@ -73,6 +74,13 @@ export declare class Chart {
73
74
  * Only affects chart types with X and Y axes, such as area, bar, and line charts.
74
75
  */
75
76
  displayItemValue: boolean;
77
+ /**
78
+ * Set to `false` to hide the percentage in item tooltips.
79
+ * The percentage is an item's value or range extent as a share of the
80
+ * whole. The whole is `maxValue` when set and the combined items otherwise.
81
+ * Applies to `stacked-bar`, `pie`, `doughnut`, and `ring` charts.
82
+ */
83
+ displayItemPercentage: boolean;
76
84
  /**
77
85
  * List of items in the chart,
78
86
  * each representing a data point.
@@ -88,13 +96,19 @@ export declare class Chart {
88
96
  */
89
97
  orientation?: 'landscape' | 'portrait';
90
98
  /**
91
- * Specifies the range that items' values could be in.
92
- * This is used in calculation of the size of the items in the chart.
93
- * When not provided, the sum of all values in the items will be considered as the range.
99
+ * Sets the value used to scale item values.
100
+ * For `stacked-bar`, `pie`, `doughnut`, and `ring`, it is the denominator
101
+ * used as the whole. It defaults to the combined item values or range
102
+ * extents. The combined size can exceed `maxValue` and produce a total
103
+ * above 100%.
104
+ * For `bar`, `dot`, `area`, and `line`, it is the requested upper bound.
105
+ * The chart can round that bound up to the next `axisIncrement`.
106
+ * Has no effect on `nps` or `scatter`.
94
107
  */
95
108
  maxValue?: number;
96
109
  /**
97
- * Specifies the increment for the axis lines.
110
+ * Sets the axis increment for `bar`, `dot`, `area`, and `line` charts.
111
+ * Has no effect on other chart types.
98
112
  */
99
113
  axisIncrement?: number;
100
114
  /**
@@ -136,6 +150,15 @@ export declare class Chart {
136
150
  private getItemText;
137
151
  private renderTooltip;
138
152
  private calculateRange;
153
+ /**
154
+ * The range of a chart whose items are parts of one whole: `maxValue`
155
+ * when set, otherwise the combined item values or range extents. The value
156
+ * is a scale, not a cap, so the combined size can exceed it. The whole is
157
+ * not rounded to an axis step, since these types draw no axis and an item's
158
+ * size has to be its exact share.
159
+ */
160
+ private calculateWholeRange;
161
+ private isPartOfWhole;
139
162
  private calculateAxisIncrement;
140
163
  private calculateNiceStep;
141
164
  private axisSpan;
@@ -145,6 +168,7 @@ export declare class Chart {
145
168
  private getYValue;
146
169
  private getMinimumValue;
147
170
  private getMaximumValue;
171
+ private getValueSpan;
148
172
  private isRangeItem;
149
173
  handleChange(): void;
150
174
  private recalculateRangeData;
@@ -123,10 +123,10 @@ export declare class ChipSet {
123
123
  * <kbd>Enter</kbd>. The input is then cleared to make room for the
124
124
  * next chip, and help user type a new keyword from scratch.
125
125
  *
126
- * Set to `false` when the input represents a search query over an
127
- * external suggestion list (as in `limel-picker`), so the typed keyword
128
- * survives while chips are added or removed (when user selects items from
129
- * the search results list, while it is open).
126
+ * Set to `false` when the input is a search query over an external
127
+ * suggestion list and the consumer decides when the keyword has served
128
+ * its purpose, clearing it itself via `emptyInput()`, as
129
+ * `limel-picker` does.
130
130
  */
131
131
  emptyInputOnChange: boolean;
132
132
  /**
@@ -201,6 +201,12 @@ export declare class Picker {
201
201
  * @param event - event
202
202
  */
203
203
  private handleListChange;
204
+ /**
205
+ * Ends the search session a pick concludes. A single-pick picker is
206
+ * full, so its dropdown has nothing left to show; a multi-pick one
207
+ * starts over from the default suggestions.
208
+ */
209
+ private updateSearchAfterPick;
204
210
  /**
205
211
  * Change handler for the list
206
212
  *
@@ -237,6 +243,14 @@ export declare class Picker {
237
243
  private clearTextValue;
238
244
  private clearInputField;
239
245
  private resetSearchToDefault;
246
+ /**
247
+ * Ends the search session and shows the default suggestions once the
248
+ * consumer has had a chance to answer the `change` event this follows.
249
+ * Consumers commonly drop the picked item from `allItems`, and that
250
+ * arrives as a prop on their next render, so searching at once would
251
+ * read the list from before.
252
+ */
253
+ private resetSearchAfterValueChange;
240
254
  /**
241
255
  * Two-stage Esc: first press clears the typed query but keeps the
242
256
  * dropdown open showing the default suggestions; a second press
@@ -518,6 +518,7 @@ export namespace Components {
518
518
  * @exampleComponent limel-example-chart-stacked-bar
519
519
  * @exampleComponent limel-example-chart-orientation
520
520
  * @exampleComponent limel-example-chart-max-value
521
+ * @exampleComponent limel-example-chart-display-item-percentage
521
522
  * @exampleComponent limel-example-chart-type-bar
522
523
  * @exampleComponent limel-example-chart-type-dot
523
524
  * @exampleComponent limel-example-chart-type-area
@@ -554,7 +555,7 @@ export namespace Components {
554
555
  */
555
556
  "accessibleValuesLabel"?: string;
556
557
  /**
557
- * Specifies the increment for the axis lines.
558
+ * Sets the axis increment for `bar`, `dot`, `area`, and `line` charts. Has no effect on other chart types.
558
559
  */
559
560
  "axisIncrement"?: number;
560
561
  /**
@@ -562,6 +563,11 @@ export namespace Components {
562
563
  * @default false
563
564
  */
564
565
  "displayAxisLabels": boolean;
566
+ /**
567
+ * Set to `false` to hide the percentage in item tooltips. The percentage is an item's value or range extent as a share of the whole. The whole is `maxValue` when set and the combined items otherwise. Applies to `stacked-bar`, `pie`, `doughnut`, and `ring` charts.
568
+ * @default true
569
+ */
570
+ "displayItemPercentage": boolean;
565
571
  /**
566
572
  * Makes the `text` of chart items constantly visible, By default, item texts are displayed in a tooltip, when the item is hovered or focused. Only affects chart types with X and Y axes, such as area, bar, and line charts.
567
573
  * @default false
@@ -587,7 +593,7 @@ export namespace Components {
587
593
  */
588
594
  "loading": boolean;
589
595
  /**
590
- * Specifies the range that items' values could be in. This is used in calculation of the size of the items in the chart. When not provided, the sum of all values in the items will be considered as the range.
596
+ * Sets the value used to scale item values. For `stacked-bar`, `pie`, `doughnut`, and `ring`, it is the denominator used as the whole. It defaults to the combined item values or range extents. The combined size can exceed `maxValue` and produce a total above 100%. For `bar`, `dot`, `area`, and `line`, it is the requested upper bound. The chart can round that bound up to the next `axisIncrement`. Has no effect on `nps` or `scatter`.
591
597
  */
592
598
  "maxValue"?: number;
593
599
  /**
@@ -869,7 +875,7 @@ export namespace Components {
869
875
  */
870
876
  "emptyInputOnBlur": boolean;
871
877
  /**
872
- * Whether the input field should be emptied when the set of chips changes (i.e. when the `value` prop is updated — a chip is added, removed, or the array is replaced). Defaults to `true`, which is the right behavior for a standalone input chip-set where the typed text *becomes* the next chip on <kbd>Enter</kbd>. The input is then cleared to make room for the next chip, and help user type a new keyword from scratch. Set to `false` when the input represents a search query over an external suggestion list (as in `limel-picker`), so the typed keyword survives while chips are added or removed (when user selects items from the search results list, while it is open).
878
+ * Whether the input field should be emptied when the set of chips changes (i.e. when the `value` prop is updated — a chip is added, removed, or the array is replaced). Defaults to `true`, which is the right behavior for a standalone input chip-set where the typed text *becomes* the next chip on <kbd>Enter</kbd>. The input is then cleared to make room for the next chip, and help user type a new keyword from scratch. Set to `false` when the input is a search query over an external suggestion list and the consumer decides when the keyword has served its purpose, clearing it itself via `emptyInput()`, as `limel-picker` does.
873
879
  * @default true
874
880
  */
875
881
  "emptyInputOnChange": boolean;
@@ -4563,6 +4569,7 @@ declare global {
4563
4569
  * @exampleComponent limel-example-chart-stacked-bar
4564
4570
  * @exampleComponent limel-example-chart-orientation
4565
4571
  * @exampleComponent limel-example-chart-max-value
4572
+ * @exampleComponent limel-example-chart-display-item-percentage
4566
4573
  * @exampleComponent limel-example-chart-type-bar
4567
4574
  * @exampleComponent limel-example-chart-type-dot
4568
4575
  * @exampleComponent limel-example-chart-type-area
@@ -7097,6 +7104,7 @@ declare namespace LocalJSX {
7097
7104
  * @exampleComponent limel-example-chart-stacked-bar
7098
7105
  * @exampleComponent limel-example-chart-orientation
7099
7106
  * @exampleComponent limel-example-chart-max-value
7107
+ * @exampleComponent limel-example-chart-display-item-percentage
7100
7108
  * @exampleComponent limel-example-chart-type-bar
7101
7109
  * @exampleComponent limel-example-chart-type-dot
7102
7110
  * @exampleComponent limel-example-chart-type-area
@@ -7133,7 +7141,7 @@ declare namespace LocalJSX {
7133
7141
  */
7134
7142
  "accessibleValuesLabel"?: string;
7135
7143
  /**
7136
- * Specifies the increment for the axis lines.
7144
+ * Sets the axis increment for `bar`, `dot`, `area`, and `line` charts. Has no effect on other chart types.
7137
7145
  */
7138
7146
  "axisIncrement"?: number;
7139
7147
  /**
@@ -7141,6 +7149,11 @@ declare namespace LocalJSX {
7141
7149
  * @default false
7142
7150
  */
7143
7151
  "displayAxisLabels"?: boolean;
7152
+ /**
7153
+ * Set to `false` to hide the percentage in item tooltips. The percentage is an item's value or range extent as a share of the whole. The whole is `maxValue` when set and the combined items otherwise. Applies to `stacked-bar`, `pie`, `doughnut`, and `ring` charts.
7154
+ * @default true
7155
+ */
7156
+ "displayItemPercentage"?: boolean;
7144
7157
  /**
7145
7158
  * Makes the `text` of chart items constantly visible, By default, item texts are displayed in a tooltip, when the item is hovered or focused. Only affects chart types with X and Y axes, such as area, bar, and line charts.
7146
7159
  * @default false
@@ -7166,7 +7179,7 @@ declare namespace LocalJSX {
7166
7179
  */
7167
7180
  "loading"?: boolean;
7168
7181
  /**
7169
- * Specifies the range that items' values could be in. This is used in calculation of the size of the items in the chart. When not provided, the sum of all values in the items will be considered as the range.
7182
+ * Sets the value used to scale item values. For `stacked-bar`, `pie`, `doughnut`, and `ring`, it is the denominator used as the whole. It defaults to the combined item values or range extents. The combined size can exceed `maxValue` and produce a total above 100%. For `bar`, `dot`, `area`, and `line`, it is the requested upper bound. The chart can round that bound up to the next `axisIncrement`. Has no effect on `nps` or `scatter`.
7170
7183
  */
7171
7184
  "maxValue"?: number;
7172
7185
  /**
@@ -7459,7 +7472,7 @@ declare namespace LocalJSX {
7459
7472
  */
7460
7473
  "emptyInputOnBlur"?: boolean;
7461
7474
  /**
7462
- * Whether the input field should be emptied when the set of chips changes (i.e. when the `value` prop is updated — a chip is added, removed, or the array is replaced). Defaults to `true`, which is the right behavior for a standalone input chip-set where the typed text *becomes* the next chip on <kbd>Enter</kbd>. The input is then cleared to make room for the next chip, and help user type a new keyword from scratch. Set to `false` when the input represents a search query over an external suggestion list (as in `limel-picker`), so the typed keyword survives while chips are added or removed (when user selects items from the search results list, while it is open).
7475
+ * Whether the input field should be emptied when the set of chips changes (i.e. when the `value` prop is updated — a chip is added, removed, or the array is replaced). Defaults to `true`, which is the right behavior for a standalone input chip-set where the typed text *becomes* the next chip on <kbd>Enter</kbd>. The input is then cleared to make room for the next chip, and help user type a new keyword from scratch. Set to `false` when the input is a search query over an external suggestion list and the consumer decides when the keyword has served its purpose, clearing it itself via `emptyInput()`, as `limel-picker` does.
7463
7476
  * @default true
7464
7477
  */
7465
7478
  "emptyInputOnChange"?: boolean;
@@ -10991,6 +11004,7 @@ declare namespace LocalJSX {
10991
11004
  "displayAxisLabels": boolean;
10992
11005
  "displayItemText": boolean;
10993
11006
  "displayItemValue": boolean;
11007
+ "displayItemPercentage": boolean;
10994
11008
  "type": | 'area'
10995
11009
  | 'bar'
10996
11010
  | 'doughnut'
@@ -11813,6 +11827,7 @@ declare module "@stencil/core" {
11813
11827
  * @exampleComponent limel-example-chart-stacked-bar
11814
11828
  * @exampleComponent limel-example-chart-orientation
11815
11829
  * @exampleComponent limel-example-chart-max-value
11830
+ * @exampleComponent limel-example-chart-display-item-percentage
11816
11831
  * @exampleComponent limel-example-chart-type-bar
11817
11832
  * @exampleComponent limel-example-chart-type-dot
11818
11833
  * @exampleComponent limel-example-chart-type-area
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-elements",
3
- "version": "40.0.3",
3
+ "version": "40.1.1",
4
4
  "description": "Lime Elements",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",
@@ -79,7 +79,7 @@
79
79
  "eslint": "^9.39.4",
80
80
  "flatpickr": "^4.6.13",
81
81
  "glob": "^13.0.6",
82
- "globals": "^17.11.0",
82
+ "globals": "^17.12.0",
83
83
  "html-escaper": "^3.0.3",
84
84
  "jsonlint-mod": "^1.7.6",
85
85
  "jsx-dom": "^8.1.6",
@@ -93,7 +93,7 @@
93
93
  "postal-mime": "^3.0.0",
94
94
  "prettier": "^3.8.3",
95
95
  "prosemirror-example-setup": "^1.2.3",
96
- "prosemirror-markdown": "^1.13.6",
96
+ "prosemirror-markdown": "^1.13.7",
97
97
  "prosemirror-model": ">=1.25.11",
98
98
  "prosemirror-schema-basic": "^1.2.4",
99
99
  "prosemirror-tables": "^1.8.5",