@sapudex/web-components 2.16.1 → 2.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/cypress/specs/AccordionItem.cy.tsx +18 -1
  2. package/cypress/specs/Quote.cy.tsx +2 -2
  3. package/cypress/specs/SecondaryNavigationDesktop.cy.tsx +2 -2
  4. package/dist/AccordionItem.d.ts +4 -0
  5. package/dist/AccordionItem.js +16 -1
  6. package/dist/AccordionItem.js.map +1 -1
  7. package/dist/MastheadShell.js +2 -1
  8. package/dist/MastheadShell.js.map +1 -1
  9. package/dist/Quote.js +3 -4
  10. package/dist/Quote.js.map +1 -1
  11. package/dist/QuoteTemplate.d.ts +2 -0
  12. package/dist/QuoteTemplate.js +6 -0
  13. package/dist/QuoteTemplate.js.map +1 -0
  14. package/dist/Search.d.ts +0 -1
  15. package/dist/Search.js +0 -13
  16. package/dist/Search.js.map +1 -1
  17. package/dist/Tag.js +3 -3
  18. package/dist/Tag.js.map +1 -1
  19. package/dist/TagGroup.d.ts +0 -2
  20. package/dist/TagGroup.js +3 -9
  21. package/dist/TagGroup.js.map +1 -1
  22. package/dist/TagGroupTemplate.d.ts +2 -0
  23. package/dist/TagGroupTemplate.js +12 -0
  24. package/dist/TagGroupTemplate.js.map +1 -0
  25. package/dist/TagTemplate.d.ts +2 -0
  26. package/dist/TagTemplate.js +18 -0
  27. package/dist/TagTemplate.js.map +1 -0
  28. package/dist/assets/{InputSuggestions-C-OeoyHk.js → InputSuggestions-EyZxsb7i.js} +1 -1
  29. package/dist/assets/{ListItemStandardExpandableTextTemplate-D05JXl_S.js → ListItemStandardExpandableTextTemplate-DgdZLN5V.js} +1 -1
  30. package/dist/assets/{bundle.esm-jB2aQPid.js → bundle.esm-ChjL9w9f.js} +205 -205
  31. package/dist/css/themes/Quote.css +1 -1
  32. package/dist/css/themes/RatingIndicator.css +1 -1
  33. package/dist/css/themes/Slider.css +1 -1
  34. package/dist/generated/templates/SearchTemplate.lit.js +1 -1
  35. package/dist/generated/templates/SearchTemplate.lit.js.map +1 -1
  36. package/dist/generated/themes/Quote.css.d.ts +1 -1
  37. package/dist/generated/themes/Quote.css.js +1 -1
  38. package/dist/generated/themes/Quote.css.js.map +1 -1
  39. package/dist/generated/themes/RatingIndicator.css.d.ts +1 -1
  40. package/dist/generated/themes/RatingIndicator.css.js +1 -1
  41. package/dist/generated/themes/RatingIndicator.css.js.map +1 -1
  42. package/dist/generated/themes/Slider.css.d.ts +1 -1
  43. package/dist/generated/themes/Slider.css.js +1 -1
  44. package/dist/generated/themes/Slider.css.js.map +1 -1
  45. package/dist/web-types.json +1 -1
  46. package/package.json +1 -1
  47. package/src/AccordionItem.ts +21 -1
  48. package/src/MastheadShell.ts +2 -1
  49. package/src/Quote.ts +3 -5
  50. package/src/QuoteTemplate.tsx +28 -0
  51. package/src/Search.hbs +1 -1
  52. package/src/Search.ts +0 -14
  53. package/src/Tag.ts +3 -3
  54. package/src/TagGroup.ts +3 -11
  55. package/src/TagGroupTemplate.tsx +75 -0
  56. package/src/TagTemplate.tsx +79 -0
  57. package/src/generated/templates/SearchTemplate.lit.ts +1 -1
  58. package/src/generated/themes/Quote.css.ts +1 -1
  59. package/src/generated/themes/RatingIndicator.css.ts +1 -1
  60. package/src/generated/themes/Slider.css.ts +1 -1
  61. package/src/themes/Quote.css +38 -29
  62. package/dist/generated/templates/QuoteTemplate.lit.d.ts +0 -3
  63. package/dist/generated/templates/QuoteTemplate.lit.js +0 -10
  64. package/dist/generated/templates/QuoteTemplate.lit.js.map +0 -1
  65. package/dist/generated/templates/TagGroupTemplate.lit.d.ts +0 -3
  66. package/dist/generated/templates/TagGroupTemplate.lit.js +0 -10
  67. package/dist/generated/templates/TagGroupTemplate.lit.js.map +0 -1
  68. package/dist/generated/templates/TagTemplate.lit.d.ts +0 -3
  69. package/dist/generated/templates/TagTemplate.lit.js +0 -19
  70. package/dist/generated/templates/TagTemplate.lit.js.map +0 -1
  71. package/src/Quote.hbs +0 -20
  72. package/src/Tag.hbs +0 -76
  73. package/src/TagGroup.hbs +0 -57
  74. package/src/generated/templates/QuoteTemplate.lit.ts +0 -14
  75. package/src/generated/templates/TagGroupTemplate.lit.ts +0 -14
  76. package/src/generated/templates/TagTemplate.lit.ts +0 -23
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TagTemplate.js","sourceRoot":"","sources":["../src/TagTemplate.tsx"],"names":[],"mappings":"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","sourcesContent":["import type UDExTag from \"./Tag.js\";\nimport UI5Icon from \"@ui5/webcomponents/dist/Icon.js\";\nimport type { AriaRole } from \"@ui5/webcomponents-base/dist/types.js\";\n\nexport default function TagTemplate(this: UDExTag) {\n const rootClass = \"udex-tag\";\n\n return (\n this.readOnly ? (\n <div class={this.tagClasses}>\n <span class={`${rootClass}__text`}>{this.text}</span>\n </div>\n ) : this.href ? (\n <a class={this.tagClasses}\n role={this.accessibleRole as AriaRole}\n href={this.href}\n onClick={this.tagLinkClickHandler}>\n {tagContent.call(this, rootClass)}\n </a>\n ) : this.nonSelectable ? (\n <div class={this.tagClasses}>\n {tagContent.call(this, rootClass, false, true)}\n </div>\n ) : (\n <div\n tabindex={this._tabIndex}\n class={this.tagClasses}\n onClick={this.tagClickHandler}\n onFocusIn={this._focusin}\n onFocusOut={this._focusout}\n onKeyDown={this.tagKeyDown}\n role={this.accessibleRole as AriaRole}\n aria-label={this.accessibleName}\n aria-pressed={this.selected}>\n {tagContent.call(this, rootClass, true)}\n </div>\n )\n );\n}\n\nfunction tagContent(this: UDExTag, rootClass: string, isIconClickable: boolean = false, isIconBtn: boolean = false) {\n return (\n <>\n {this.startIcon && (\n isIconBtn ? tagBtnIcon.call(this, rootClass, \"start\")\n : tagIcon.call(this, rootClass, \"start\", isIconClickable))}\n <span class={`${rootClass}__text`}>{this.text}</span>\n {this.endIcon && (\n isIconBtn ? tagBtnIcon.call(this, rootClass, \"end\")\n : tagIcon.call(this, rootClass, \"end\", isIconClickable))}\n </>\n );\n}\n\nfunction tagBtnIcon(this: UDExTag, rootClass: string, iconType: string) {\n return (\n <>\n <button\n class={`${rootClass}__btn-icon`}\n onClick={this.iconClickHandler}\n role={this.accessibleRole as AriaRole}\n aria-label={this.iconAccessibleName}>\n {tagIcon.call(this, rootClass, iconType)}\n </button>\n </>\n );\n}\n\nfunction tagIcon(this: UDExTag, rootClass: string, iconType: string, isIconClickable: boolean = false) {\n return (\n <>\n <UI5Icon\n class={`${rootClass}__icon ${rootClass}__icon--${iconType}`}\n name={this.icon}\n {...(isIconClickable ? { onClick: this.iconClickHandler } : {})}>\n </UI5Icon>\n </>\n );\n}\n"]}
@@ -1,2 +1,2 @@
1
- import{r as w,j as l,a as c,p as x,d as P,b as R,s as p,m as v,u as S,v as y,w as O,x as L,D,c as A,z as G,F as H,B as I,I as b,A as f,R as E,C as V,G as $,H as N,J as B,K as F}from"./bundle.esm-jB2aQPid.js";const z=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function _(n,e,t,s){return n.replaceAll(new RegExp(z(e),`${s?"i":""}g`),t)}function M(n,e){if(!n||!e)return n;const t=r=>{const[a,d]=r.split("");for(;n.indexOf(r)>=0||e.indexOf(r)>=0;)r=`${a}${r}${d}`;return r},s=t("12"),i=t("34");let o=w(_(n,e,r=>`${s}${r}${i}`,!0));return[[s,"<b>"],[i,"</b>"]].forEach(([r,a])=>{o=_(o,r,a,!1)}),o}function q(n,e){const t=(n==null?void 0:n.listItemContent)||U;return l("li",{part:"native-li","data-sap-focus-ref":!0,tabindex:this._effectiveTabIndex,class:this.classes.main,draggable:this.movable,role:e==null?void 0:e.role,title:e==null?void 0:e.title,onFocusIn:this._onfocusin,onKeyUp:this._onkeyup,onKeyDown:this._onkeydown,onClick:this._onclick,children:t.call(this)})}function U(){return l("div",{part:"content",id:`${this._id}-content`,class:"ui5-li-content",children:l("div",{class:"ui5-li-text-wrapper",children:l("span",{part:"title",class:"ui5-li-title",children:l("slot",{})})})})}function K(){return[q.call(this,{listItemContent:W},{role:"option"})]}function W(){return l("div",{part:"content",id:"content",class:"ui5-li-content",children:c("div",{class:"ui5-li-text-wrapper",children:[l("span",{part:"title",className:"ui5-li-title",dangerouslySetInnerHTML:{__html:this.markupText}}),this.additionalText&&l("span",{part:"additional-text",class:"ui5-li-additional-text",children:this.additionalText})]})})}x("@ui5/webcomponents-theming","sap_horizon",async()=>P);x("@ui5/webcomponents","sap_horizon",async()=>R);const J=`:host([ui5-suggestion-item]){height:auto;min-height:var(--_ui5-v2-14-0_list_item_base_height)}:host([ui5-suggestion-item]) .ui5-li-root{min-height:var(--_ui5-v2-14-0_list_item_base_height)}:host([ui5-suggestion-item]) .ui5-li-content{padding-bottom:.5rem;padding-top:.5rem;box-sizing:border-box}
1
+ import{r as w,j as l,a as c,p as x,d as P,b as R,s as p,m as v,u as S,v as y,w as O,x as L,D,c as A,z as G,F as H,B as I,I as b,A as f,R as E,C as V,G as $,H as N,J as B,K as F}from"./bundle.esm-ChjL9w9f.js";const z=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function _(n,e,t,s){return n.replaceAll(new RegExp(z(e),`${s?"i":""}g`),t)}function M(n,e){if(!n||!e)return n;const t=r=>{const[a,d]=r.split("");for(;n.indexOf(r)>=0||e.indexOf(r)>=0;)r=`${a}${r}${d}`;return r},s=t("12"),i=t("34");let o=w(_(n,e,r=>`${s}${r}${i}`,!0));return[[s,"<b>"],[i,"</b>"]].forEach(([r,a])=>{o=_(o,r,a,!1)}),o}function q(n,e){const t=(n==null?void 0:n.listItemContent)||U;return l("li",{part:"native-li","data-sap-focus-ref":!0,tabindex:this._effectiveTabIndex,class:this.classes.main,draggable:this.movable,role:e==null?void 0:e.role,title:e==null?void 0:e.title,onFocusIn:this._onfocusin,onKeyUp:this._onkeyup,onKeyDown:this._onkeydown,onClick:this._onclick,children:t.call(this)})}function U(){return l("div",{part:"content",id:`${this._id}-content`,class:"ui5-li-content",children:l("div",{class:"ui5-li-text-wrapper",children:l("span",{part:"title",class:"ui5-li-title",children:l("slot",{})})})})}function K(){return[q.call(this,{listItemContent:W},{role:"option"})]}function W(){return l("div",{part:"content",id:"content",class:"ui5-li-content",children:c("div",{class:"ui5-li-text-wrapper",children:[l("span",{part:"title",className:"ui5-li-title",dangerouslySetInnerHTML:{__html:this.markupText}}),this.additionalText&&l("span",{part:"additional-text",class:"ui5-li-additional-text",children:this.additionalText})]})})}x("@ui5/webcomponents-theming","sap_horizon",async()=>P);x("@ui5/webcomponents","sap_horizon",async()=>R);const J=`:host([ui5-suggestion-item]){height:auto;min-height:var(--_ui5-v2-14-0_list_item_base_height)}:host([ui5-suggestion-item]) .ui5-li-root{min-height:var(--_ui5-v2-14-0_list_item_base_height)}:host([ui5-suggestion-item]) .ui5-li-content{padding-bottom:.5rem;padding-top:.5rem;box-sizing:border-box}
2
2
  `;var g=function(n,e,t,s){var i=arguments.length,o=i<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(i<3?r(o):i>3?r(e,t,o):r(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};let h=class extends S{constructor(){super(...arguments),this.markupText=""}onEnterDOM(){y()&&this.setAttribute("desktop","")}get _effectiveTabIndex(){return-1}};g([p()],h.prototype,"text",void 0);g([p()],h.prototype,"additionalText",void 0);g([p()],h.prototype,"markupText",void 0);h=g([v({tag:"ui5-suggestion-item",template:K,styles:[S.styles,J]})],h);h.define();function X(n){const e=(n==null?void 0:n.items)||j;return c("ul",{role:"group",class:"ui5-group-li-root",onDragEnter:this._ondragenter,onDragOver:this._ondragover,onDrop:this._ondrop,onDragLeave:this._ondragleave,children:[this.hasHeader&&l(L,{focused:this.focused,part:"header",accessibleRole:O.Group,children:this.hasFormattedHeader?l("slot",{name:"header"}):this.headerText}),e.call(this),l(D,{orientation:"Horizontal",ownerReference:this})]})}function j(){return l("slot",{})}var T=function(n,e,t,s){var i=arguments.length,o=i<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(i<3?r(o):i>3?r(e,t,o):r(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};let m=class extends G{};T([A({default:!0,invalidateOnChildChange:!0,type:HTMLElement})],m.prototype,"items",void 0);m=T([v({tag:"ui5-suggestion-item-group",template:X})],m);m.define();function Q(n){const e=(n==null?void 0:n.suggestionsList)||Y,t=n==null?void 0:n.valueStateMessage,s=n==null?void 0:n.valueStateMessageInputIcon;return c(E,{class:this.classes.popover,hideArrow:!0,preventFocusRestore:!0,preventInitialFocus:!0,placement:"Bottom",horizontalAlign:"Start",tabindex:-1,style:this.styles.suggestionsPopover,onOpen:this._afterOpenPicker,onClose:this._afterClosePicker,onScroll:this._scroll,open:this.open,opener:this,accessibleName:this._popupLabel,children:[this._isPhone&&c(H,{children:[c("div",{slot:"header",class:"ui5-responsive-popover-header",children:[c("div",{class:"row",children:[l("span",{children:this._headerTitleText}),l(I,{class:"ui5-responsive-popover-close-btn",icon:N,design:"Transparent",onClick:this._closePicker})]}),l("div",{class:"row",children:l("div",{class:"input-root-phone native-input-wrapper",children:l(b,{class:"ui5-input-inner-phone",type:this.inputType,value:this.value,showClearIcon:this.showClearIcon,placeholder:this.placeholder,onInput:this._handleInput,onChange:this._handleChange})})})]}),this.hasValueStateMessage&&c("div",{class:this.classes.popoverValueState,style:this.styles.suggestionPopoverHeader,children:[l(f,{class:"ui5-input-value-state-message-icon",name:s==null?void 0:s.call(this)}),this.open&&(t==null?void 0:t.call(this))]})]}),!this._isPhone&&this.hasValueStateMessage&&c("div",{slot:"header",class:{"ui5-responsive-popover-header":!0,...this.classes.popoverValueState},style:this.styles.suggestionPopoverHeader,children:[l(f,{class:"ui5-input-value-state-message-icon",name:s==null?void 0:s.call(this)}),this.open&&(t==null?void 0:t.call(this))]}),e.call(this),this._isPhone&&l("div",{slot:"footer",class:"ui5-responsive-popover-footer",children:l(I,{design:"Transparent",onClick:this._closePicker,children:this._suggestionsOkButtonText})})]})}function Y(){return l($,{accessibleRole:V.ListBox,separators:this.suggestionSeparators,selectionMode:"Single",onMouseDown:this.onItemMouseDown,onItemClick:this._handleSuggestionItemPress,onSelectionChange:this._handleSelectionChange,children:l("slot",{})})}class u{get template(){return Q}constructor(e,t,s,i){this.component=e,this.slotName=t,this.handleFocus=i,this.highlight=s,this.selectedItemIndex=-1}onUp(e,t){e.preventDefault();const s=!this.isOpened&&this._hasValueState&&t===-1?0:t;return this._handleItemNavigation(!1,s),!0}onDown(e,t){e.preventDefault();const s=!this.isOpened&&this._hasValueState&&t===-1?0:t;return this._handleItemNavigation(!0,s),!0}onSpace(e){return this._isItemOnTarget()?(e.preventDefault(),this.onItemSelected(this._selectedItem,!0),!0):!1}onEnter(e){return this._isGroupItem?(e.preventDefault(),!1):this._isItemOnTarget()?(this.onItemSelected(this._selectedItem,!0),!0):!1}onPageUp(e){e.preventDefault();const t=this.selectedItemIndex-10>-1;return this._moveItemSelection(this.selectedItemIndex,t?this.selectedItemIndex-=10:this.selectedItemIndex=0),!0}onPageDown(e){e.preventDefault();const t=this._getItems();if(!t)return!0;const s=t.length-1,i=this.selectedItemIndex+10<=s;return this._moveItemSelection(this.selectedItemIndex,i?this.selectedItemIndex+=10:this.selectedItemIndex=s),!0}onHome(e){return e.preventDefault(),this._moveItemSelection(this.selectedItemIndex,this.selectedItemIndex=0),!0}onEnd(e){e.preventDefault();const t=this._getItems().length-1;return t&&this._moveItemSelection(this.selectedItemIndex,this.selectedItemIndex=t),!0}onTab(){return this._isItemOnTarget()?(this.onItemSelected(this._selectedItem,!0),!0):!1}toggle(e,t){(e!==void 0?e:!this.isOpened())?this._getComponent().open=!0:this.close(t.preventFocusRestore)}get _selectedItem(){return this._getNonGroupItems().find(e=>e.selected)}_isScrollable(){const e=this._getScrollContainer();return e.offsetHeight<e.scrollHeight}close(e=!1){const t=this._getItems()&&this._getItems()[this.selectedItemIndex];this._getComponent().open=!1;const s=this._getPicker();s.preventFocusRestore=e,s.open=!1,t&&t.focused&&(t.focused=!1)}updateSelectedItemPosition(e){this.selectedItemIndex=e}onItemSelected(e,t){const s=e,i=this._getNonGroupItems();s&&(this.accInfo={isGroup:s.hasAttribute("ui5-suggestion-item-group"),currentPos:i.indexOf(s)+1,listSize:i.length,itemText:s.text||"",additionalText:s.additionalText},this._getComponent().onItemSelected(s,t),this._getComponent().open=!1)}onItemSelect(e){this._getComponent().onItemSelect(e)}onItemPress(e){let t;const s=e.type==="ui5-item-click";s&&!e.detail.item.selected||this._handledPress&&!s||(s&&e.detail.item.selected?(t=e.detail.item,this._handledPress=!0):t=e.detail.selectedItems[0],this.onItemSelected(t,!1))}_onClose(){this._handledPress=!1}_isItemOnTarget(){return this.isOpened()&&this.selectedItemIndex!==null&&this.selectedItemIndex!==-1&&!this._isGroupItem}get _isGroupItem(){const e=this._getItems();return!e||!e[this.selectedItemIndex]?!1:e[this.selectedItemIndex].hasAttribute("ui5-suggestion-item-group")}isOpened(){var e;return!!((e=this._getPicker())!=null&&e.open)}_handleItemNavigation(e,t){this.selectedItemIndex=t,this._getItems().length&&(e?this._selectNextItem():this._selectPreviousItem())}_selectNextItem(){const e=this._getItems().length,t=this.selectedItemIndex;t!==-1&&t+1>e-1||this._moveItemSelection(t,++this.selectedItemIndex)}_selectPreviousItem(){const e=this._getItems(),t=this.selectedItemIndex;if(!(t===-1||t===null)){if(t-1<0){(e[t].hasAttribute("ui5-suggestion-item")||e[t].hasAttribute("ui5-suggestion-item-custom"))&&(e[t].selected=!1),e[t].focused=!1,this.component.focused=!0,this.component.hasSuggestionItemSelected=!1,this.selectedItemIndex-=1;return}this._moveItemSelection(t,--this.selectedItemIndex)}}_moveItemSelection(e,t){const s=this._getItems(),i=s[t],o=s[e],r=this._getNonGroupItems(),a=i.hasAttribute("ui5-suggestion-item-group");if(!i)return;this.component.focused=!1;const d=this._getItems()[this.selectedItemIndex];if(this.accInfo={isGroup:a,currentPos:s.indexOf(i)+1,itemText:(a?d.headerText:d.text)||""},(i.hasAttribute("ui5-suggestion-item")||i.hasAttribute("ui5-suggestion-item-custom"))&&(this.accInfo.additionalText=i.additionalText||"",this.accInfo.currentPos=r.indexOf(i)+1,this.accInfo.listSize=r.length),o&&(o.focused=!1),(o!=null&&o.hasAttribute("ui5-suggestion-item")||o!=null&&o.hasAttribute("ui5-suggestion-item-custom"))&&(o.selected=!1),i&&(i.focused=!0,a||(i.selected=!0),this.handleFocus&&i.focus()),this.component.hasSuggestionItemSelected=!0,this.onItemSelect(i),!this._isItemIntoView(i)){const C=this._isGroupItem?i.shadowRoot.querySelector("[ui5-li-group-header]"):i;this._scrollItemIntoView(C)}}_deselectItems(){this._getItems().forEach(t=>{t.hasAttribute("ui5-suggestion-item")&&(t.selected=!1),t.focused=!1})}_clearItemFocus(){const e=this._getItems().find(t=>t.focused);e&&(e.focused=!1)}_isItemIntoView(e){const t=e.getDomRef().getBoundingClientRect(),s=this._getComponent().getDomRef().getBoundingClientRect(),i=window.innerHeight||document.documentElement.clientHeight;let o=0;return this._hasValueState&&(o=this._getPicker().querySelector("[slot=header]").getBoundingClientRect().height),t.top+u.SCROLL_STEP<=i&&t.top>=s.top+o}_scrollItemIntoView(e){e.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"})}_getScrollContainer(){return this._scrollContainer||(this._scrollContainer=this._getPicker().shadowRoot.querySelector(".ui5-popup-content")),this._scrollContainer}_getItems(){return this._getComponent().getSlottedNodes("suggestionItems").flatMap(t=>t.hasAttribute("ui5-suggestion-item-group")?[t,...t.items]:[t])}_getNonGroupItems(){return this._getItems().filter(e=>!e.hasAttribute("ui5-suggestion-item-group"))}_getComponent(){return this.component}_getList(){return this._getPicker().querySelector("[ui5-list]")}_getListWidth(){var e;return(e=this._getList())==null?void 0:e.offsetWidth}_getPicker(){return this._getComponent().shadowRoot.querySelector("[ui5-responsive-popover]")}get itemSelectionAnnounce(){if(!this.accInfo)return"";if(this.accInfo.isGroup)return`${u.i18nBundle.getText(B)} ${this.accInfo.itemText}`;const e=u.i18nBundle.getText(F,this.accInfo.currentPos||0,this.accInfo.listSize||0);return`${this.accInfo.additionalText} ${e}`}hightlightInput(e,t){return M(e,t)}get _hasValueState(){return this.component.hasValueStateMessage}_clearSelectedSuggestionAndaccInfo(){this.accInfo=void 0,this.selectedItemIndex=0}}u.SCROLL_STEP=60;b.SuggestionsClass=u;export{u as default};
@@ -1,3 +1,3 @@
1
- import{j as o,a as _,F as y,p as m,d as b,b as E,s as x,c as C,i as P,m as O,y as B,e as w,f as I,t as A,E as L,g as R,L as S,R as M,B as N,h as F,k as D,l as X,n as j,o as z,q as k}from"./bundle.esm-jB2aQPid.js";var T;(function(t){t.InPlace="InPlace",t.Popover="Popover"})(T||(T={}));const $=T;var g;(function(t){t.Off="Off",t.On="On"})(g||(g={}));const H=g;function W(){return o(y,{children:o("span",{children:this._renderEmptyIndicator?_(y,{children:[o("span",{className:"empty-indicator","aria-hidden":"true",children:this._emptyIndicatorSymbol}),o("span",{className:"empty-indicator-aria-label",children:this._emptyIndicatorAriaLabel})]}):o("slot",{})})})}m("@ui5/webcomponents-theming","sap_horizon",async()=>b);m("@ui5/webcomponents","sap_horizon",async()=>E);const q=`:host{max-width:100%;font-size:var(--sapFontSize);font-family:var(--sapFontFamily);color:var(--sapTextColor);line-height:normal;cursor:text;overflow:hidden}:host([max-lines="1"]){display:inline-block;text-overflow:ellipsis;white-space:nowrap}:host(:not([max-lines="1"])){display:-webkit-box;-webkit-line-clamp:var(--_ui5-v2-14-0_text_max_lines);line-clamp:var(--_ui5-v2-14-0_text_max_lines);-webkit-box-orient:vertical;white-space:normal;word-wrap:break-word}.empty-indicator-aria-label{position:absolute!important;clip:rect(1px,1px,1px,1px);user-select:none;left:0;top:0;font-size:0}
1
+ import{j as o,a as _,F as y,p as m,d as b,b as E,s as x,c as C,i as P,m as O,y as B,e as w,f as I,t as A,E as L,g as R,L as S,R as M,B as N,h as F,k as D,l as X,n as j,o as z,q as k}from"./bundle.esm-ChjL9w9f.js";var T;(function(t){t.InPlace="InPlace",t.Popover="Popover"})(T||(T={}));const $=T;var g;(function(t){t.Off="Off",t.On="On"})(g||(g={}));const H=g;function W(){return o(y,{children:o("span",{children:this._renderEmptyIndicator?_(y,{children:[o("span",{className:"empty-indicator","aria-hidden":"true",children:this._emptyIndicatorSymbol}),o("span",{className:"empty-indicator-aria-label",children:this._emptyIndicatorAriaLabel})]}):o("slot",{})})})}m("@ui5/webcomponents-theming","sap_horizon",async()=>b);m("@ui5/webcomponents","sap_horizon",async()=>E);const q=`:host{max-width:100%;font-size:var(--sapFontSize);font-family:var(--sapFontFamily);color:var(--sapTextColor);line-height:normal;cursor:text;overflow:hidden}:host([max-lines="1"]){display:inline-block;text-overflow:ellipsis;white-space:nowrap}:host(:not([max-lines="1"])){display:-webkit-box;-webkit-line-clamp:var(--_ui5-v2-14-0_text_max_lines);line-clamp:var(--_ui5-v2-14-0_text_max_lines);-webkit-box-orient:vertical;white-space:normal;word-wrap:break-word}.empty-indicator-aria-label{position:absolute!important;clip:rect(1px,1px,1px,1px);user-select:none;left:0;top:0;font-size:0}
2
2
  `;var u=function(t,e,n,s){var a=arguments.length,i=a<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,n):s,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,s);else for(var d=t.length-1;d>=0;d--)(l=t[d])&&(i=(a<3?l(i):a>3?l(e,n,i):l(e,n))||i);return a>3&&i&&Object.defineProperty(e,n,i),i},f;let p=f=class extends w{constructor(){super(...arguments),this.maxLines=1/0,this.emptyIndicatorMode="Off"}onBeforeRendering(){this.style.setProperty(I("--_ui5_text_max_lines"),`${this.maxLines}`)}get hasText(){return A(this.text)}get _renderEmptyIndicator(){return!this.hasText&&this.emptyIndicatorMode===H.On}get _emptyIndicatorAriaLabel(){return f.i18nBundle.getText(L)}get _emptyIndicatorSymbol(){return f.i18nBundle.getText(R)}};u([x({type:Number})],p.prototype,"maxLines",void 0);u([x()],p.prototype,"emptyIndicatorMode",void 0);u([C({type:Node,default:!0})],p.prototype,"text",void 0);u([P("@ui5/webcomponents")],p,"i18nBundle",void 0);p=f=u([O({tag:"ui5-text",renderer:B,template:W,styles:q})],p);p.define();const v=p;function Y(){return _("div",{children:[o(v,{class:"ui5-exp-text-text",emptyIndicatorMode:this.emptyIndicatorMode,children:this._displayedText}),this._maxCharactersExceeded&&_(y,{children:[o("span",{class:"ui5-exp-text-ellipsis",children:this._ellipsisText}),o(S,{id:"toggle",class:"ui5-exp-text-toggle",accessibleRole:"Button",accessibleName:this._accessibleNameForToggle,accessibilityAttributes:this._accessibilityAttributesForToggle,onClick:this._handleToggleClick,children:this._textForToggle}),this._usePopover&&_(M,{open:this._expanded,opener:"toggle",accessibleNameRef:"popover-text",contentOnlyOnDesktop:!0,_hideHeader:!0,class:"ui5-exp-text-popover",onClose:this._handlePopoverClose,children:[o(v,{id:"popover-text",children:this.text}),o("div",{slot:"footer",class:"ui5-exp-text-footer",children:o(N,{design:"Transparent",onClick:this._handleCloseButtonClick,children:this._closeButtonText})})]})]})]})}m("@ui5/webcomponents-theming","sap_horizon",async()=>b);m("@ui5/webcomponents","sap_horizon",async()=>E);const V=`:host{display:inline-block;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);color:var(--sapTextColor)}:host([hidden]){display:none}.ui5-exp-text-text{display:inline}.ui5-exp-text-text,.ui5-exp-text-toggle{font-family:inherit;font-size:inherit}.ui5-exp-text-text,.ui5-exp-text-ellipsis{color:inherit}.ui5-exp-text-popover::part(content){padding-inline:1rem}.ui5-exp-text-footer{width:100%;display:flex;align-items:center;justify-content:flex-end}
3
3
  `;var h=function(t,e,n,s){var a=arguments.length,i=a<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,n):s,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,s);else for(var d=t.length-1;d>=0;d--)(l=t[d])&&(i=(a<3?l(i):a>3?l(e,n,i):l(e,n))||i);return a>3&&i&&Object.defineProperty(e,n,i),i},c;let r=c=class extends w{constructor(){super(...arguments),this.maxCharacters=100,this.overflowMode="InPlace",this.emptyIndicatorMode="Off",this._expanded=!1}getFocusDomRef(){var e,n;return this._usePopover?(e=this.shadowRoot)==null?void 0:e.querySelector("[ui5-responsive-popover]"):(n=this.shadowRoot)==null?void 0:n.querySelector("[ui5-link]")}get _displayedText(){var e;return this._expanded&&!this._usePopover?this.text:(e=this.text)==null?void 0:e.substring(0,this.maxCharacters)}get _maxCharactersExceeded(){var e;return(((e=this.text)==null?void 0:e.length)||0)>this.maxCharacters}get _usePopover(){return this.overflowMode===$.Popover}get _ellipsisText(){return this._expanded&&!this._usePopover?" ":"... "}get _textForToggle(){return this._expanded?c.i18nBundle.getText(F):c.i18nBundle.getText(D)}get _closeButtonText(){return c.i18nBundle.getText(X)}get _accessibilityAttributesForToggle(){return this._usePopover?{expanded:this._expanded,hasPopup:"dialog"}:{expanded:this._expanded}}get _accessibleNameForToggle(){if(this._usePopover)return this._expanded?c.i18nBundle.getText(j):c.i18nBundle.getText(z)}_handlePopoverClose(){k()||(this._expanded=!1)}_handleToggleClick(){this._expanded=!this._expanded}_handleCloseButtonClick(e){this._expanded=!1,e.stopPropagation()}};h([x()],r.prototype,"text",void 0);h([x({type:Number})],r.prototype,"maxCharacters",void 0);h([x()],r.prototype,"overflowMode",void 0);h([x()],r.prototype,"emptyIndicatorMode",void 0);h([x({type:Boolean})],r.prototype,"_expanded",void 0);h([P("@ui5/webcomponents")],r,"i18nBundle",void 0);r=c=h([O({tag:"ui5-expandable-text",renderer:B,styles:V,template:Y})],r);r.define();function Q(t){const{className:e,text:n,maxCharacters:s,part:a}=t;return o(r,{part:a,class:e,text:n,maxCharacters:s})}export{Q as default};