@sapudex/web-components 2.45.0 → 2.46.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.
- package/dist/assets/{InputSuggestions-_syMxKYw.js → InputSuggestions-BwpJ8Exf.js} +1 -1
- package/dist/assets/{ListItemStandardExpandableTextTemplate-CKRbK6UW.js → ListItemStandardExpandableTextTemplate-7iRPZq6L.js} +1 -1
- package/dist/assets/{bundle.esm-DMmyJHkn.js → bundle.esm-BbkM4Bz9.js} +247 -245
- package/dist/web-types.json +1 -1
- package/package.json +8 -8
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as w,j as l,a as c,f as v,d as y,b as P,s as g,m as x,q as S,r as O,u as R,D as L,c as D,v as A,T as G,I as b,w as I,F as H,B as f,R as V,x as E,z as $,A as N,C as B}from"./bundle.esm-
|
|
1
|
+
import{p as w,j as l,a as c,f as v,d as y,b as P,s as g,m as x,q as S,r as O,u as R,D as L,c as D,v as A,T as G,I as b,w as I,F as H,B as f,R as V,x as E,z as $,A as N,C as B}from"./bundle.esm-BbkM4Bz9.js";const F=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function _(n,e,t,s){return n.replaceAll(new RegExp(F(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 z(n,e){const t=(n==null?void 0:n.listItemContent)||q;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 q(){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 U(){return[z.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})]})})}v("@ui5/webcomponents-theming","sap_horizon",async()=>y);v("@ui5/webcomponents","sap_horizon",async()=>P,"host");const K=`:host([ui5-suggestion-item]){height:auto;min-height:var(--_ui5_list_item_base_height)}:host([ui5-suggestion-item]) .ui5-li-root{min-height:var(--_ui5_list_item_base_height)}:host([ui5-suggestion-item]) .ui5-li-content{padding-bottom:.5rem;padding-top:.5rem;box-sizing:border-box}
|
|
2
2
|
`;var p=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(){O()&&this.setAttribute("desktop","")}get _effectiveTabIndex(){return-1}};p([g()],h.prototype,"text",void 0);p([g()],h.prototype,"additionalText",void 0);p([g()],h.prototype,"markupText",void 0);h=p([x({tag:"ui5-suggestion-item",template:U,styles:[S.styles,K]})],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(R,{focused:this.focused,part:"header",accessibleRole:"Group",wrappingType:this.getGroupHeaderWrapping(),children:this.hasFormattedHeader?l("slot",{name:"header"}):this.headerText}),e.call(this),l(L,{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 A{};T([D({default:!0,invalidateOnChildChange:!0,type:HTMLElement})],m.prototype,"items",void 0);m=T([x({tag:"ui5-suggestion-item-group",template:X})],m);m.define();function J(n){const e=(n==null?void 0:n.suggestionsList)||Q,t=n==null?void 0:n.mobileHeader,s=n==null?void 0:n.valueStateMessage,i=n==null?void 0:n.valueStateMessageInputIcon;return c(V,{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&&l(H,{children:c("div",{slot:"header",class:"ui5-responsive-popover-header",children:[l("div",{class:"row",children:l(G,{level:"H1",wrappingType:"None",class:"ui5-responsive-popover-header-text",children:this._headerTitleText})}),l("div",{class:"row",children:c("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}),t==null?void 0:t.call(this)]})}),this.hasValueStateMessage&&c("div",{class:this.classes.popoverValueState,style:this.styles.suggestionPopoverHeader,children:[l(I,{class:"ui5-input-value-state-message-icon",name:i==null?void 0:i.call(this)}),this.open&&(s==null?void 0:s.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(I,{class:"ui5-input-value-state-message-icon",name:i==null?void 0:i.call(this)}),this.open&&(s==null?void 0:s.call(this))]}),this.showSuggestions&&e.call(this),this._isPhone&&c("div",{slot:"footer",class:"ui5-responsive-popover-footer",children:[l(f,{design:"Emphasized",onClick:this._confirmMobileValue,children:this._suggestionsOkButtonText}),l(f,{class:"ui5-responsive-popover-close-btn",design:"Transparent",onClick:this._cancelMobileValue,children:this._suggestionsCancelButtonText})]})]})}function Q(){return l($,{accessibleRole:E.ListBox,separators:this.suggestionSeparators,selectionMode:"Single",onMouseDown:this.onItemMouseDown,onItemClick:this._handleSuggestionItemPress,onSelectionChange:this._handleSelectionChange,children:l("slot",{})})}class u{get template(){return J}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.visibleItems;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.visibleItems,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.component.value=this.component.typedInValue,this.selectedItemIndex-=1;return}this._moveItemSelection(t,--this.selectedItemIndex)}}get visibleItems(){return this._getItems().filter(e=>!e.hidden)}_moveItemSelection(e,t){const s=this.visibleItems,i=s[t],o=s[e],r=this._getNonGroupItems(),a=i==null?void 0:i.hasAttribute("ui5-suggestion-item-group");if(!i)return;this.component.focused=!1;const d=this.visibleItems[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.hasAttribute("ui5-suggestion-item-custom"))&&(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(N)} ${this.accInfo.itemText}`;const e=u.i18nBundle.getText(B,this.accInfo.currentPos||0,this.accInfo.listSize||0);return`${this.accInfo.additionalText} ${e}`.trim()}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 s,a as _,F as T,f as m,d as b,b as E,s as x,c as C,i as P,m as O,y as w,S as B,t as I,E as A,e as S,L as R,R as L,B as M,g as N,h as F,k as z,l as D,n as X,o as j}from"./bundle.esm-
|
|
1
|
+
import{j as s,a as _,F as T,f as m,d as b,b as E,s as x,c as C,i as P,m as O,y as w,S as B,t as I,E as A,e as S,L as R,R as L,B as M,g as N,h as F,k as z,l as D,n as X,o as j}from"./bundle.esm-BbkM4Bz9.js";var g;(function(o){o.InPlace="InPlace",o.Popover="Popover"})(g||(g={}));const k=g;var y;(function(o){o.Off="Off",o.On="On"})(y||(y={}));const $=y;function H(){return s(T,{children:s("span",{children:this._renderEmptyIndicator?_(T,{children:[s("span",{className:"empty-indicator","aria-hidden":"true",children:this._emptyIndicatorSymbol}),s("span",{className:"empty-indicator-aria-label",children:this._emptyIndicatorAriaLabel})]}):s("slot",{})})})}m("@ui5/webcomponents-theming","sap_horizon",async()=>b);m("@ui5/webcomponents","sap_horizon",async()=>E,"host");const W=`:host{max-width:100%;font-size:var(--sapFontSize);font-family:var(--sapFontFamily);color:var(--sapTextColor);line-height:normal;cursor:text;overflow:hidden;display:-webkit-inline-box;-webkit-line-clamp:var(--_ui5_text_max_lines);line-clamp:var(--_ui5_text_max_lines);-webkit-box-orient:vertical;white-space:normal;word-wrap:break-word}:host([max-lines="1"]){word-break:break-all}.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(o,e,t,i){var r=arguments.length,n=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(o,e,t,i);else for(var d=o.length-1;d>=0;d--)(l=o[d])&&(n=(r<3?l(n):r>3?l(e,t,n):l(e,t))||n);return r>3&&n&&Object.defineProperty(e,t,n),n},f;let p=f=class extends B{constructor(){super(...arguments),this.maxLines=1/0,this.emptyIndicatorMode="Off"}onBeforeRendering(){this.style.setProperty("--_ui5_text_max_lines",`${this.maxLines}`)}get hasText(){return I(this.text)}get _renderEmptyIndicator(){return!this.hasText&&this.emptyIndicatorMode===$.On}get _emptyIndicatorAriaLabel(){return f.i18nBundle.getText(A)}get _emptyIndicatorSymbol(){return f.i18nBundle.getText(S)}};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:w,template:H,styles:W})],p);p.define();const v=p;function q(){return _("div",{children:[s(v,{class:"ui5-exp-text-text",emptyIndicatorMode:this.emptyIndicatorMode,children:this._displayedText}),this._maxCharactersExceeded&&_(T,{children:[s("span",{class:"ui5-exp-text-ellipsis",children:this._ellipsisText}),s(R,{id:"toggle",class:"ui5-exp-text-toggle",accessibleRole:"Button",accessibleName:this._accessibleNameForToggle,accessibilityAttributes:this._accessibilityAttributesForToggle,onClick:this._handleToggleClick,children:this._textForToggle}),this._usePopover&&_(L,{open:this._expanded,opener:"toggle",accessibleNameRef:"popover-text",contentOnlyOnDesktop:!0,_hideHeader:!0,class:"ui5-exp-text-popover",onClose:this._handlePopoverClose,children:[s(v,{class:"ui5-exp-text-popover-text",id:"popover-text",children:this.text}),s("div",{slot:"footer",class:"ui5-exp-text-footer",children:s(M,{design:"Transparent",onClick:this._handleCloseButtonClick,children:this._closeButtonText})})]})]})]})}m("@ui5/webcomponents-theming","sap_horizon",async()=>b);m("@ui5/webcomponents","sap_horizon",async()=>E,"host");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;white-space:inherit}.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,.ui5-exp-text-popover-text{white-space:inherit;font-family:inherit;font-size: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(o,e,t,i){var r=arguments.length,n=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(o,e,t,i);else for(var d=o.length-1;d>=0;d--)(l=o[d])&&(n=(r<3?l(n):r>3?l(e,t,n):l(e,t))||n);return r>3&&n&&Object.defineProperty(e,t,n),n},c;let a=c=class extends B{constructor(){super(...arguments),this.maxCharacters=100,this.overflowMode="InPlace",this.emptyIndicatorMode="Off",this._expanded=!1,this._shouldScrollToToggle=!1}getFocusDomRef(){var e,t;return this._usePopover?(e=this.shadowRoot)==null?void 0:e.querySelector("[ui5-responsive-popover]"):(t=this.shadowRoot)==null?void 0:t.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===k.Popover}get _ellipsisText(){return this._expanded&&!this._usePopover?" ":"... "}get _textForToggle(){return this._expanded?c.i18nBundle.getText(N):c.i18nBundle.getText(F)}get _closeButtonText(){return c.i18nBundle.getText(z)}get _accessibilityAttributesForToggle(){return this._usePopover?{expanded:this._expanded,hasPopup:"dialog"}:{expanded:this._expanded}}get _accessibleNameForToggle(){if(this._usePopover)return this._expanded?c.i18nBundle.getText(D):c.i18nBundle.getText(X)}_handlePopoverClose(){j()||(this._expanded=!1)}onAfterRendering(){var e,t;if(this._shouldScrollToToggle){this._shouldScrollToToggle=!1;const i=(e=this.shadowRoot)==null?void 0:e.querySelector("#toggle");(t=i==null?void 0:i.scrollIntoView)==null||t.call(i,{block:"nearest"})}}_handleToggleClick(){this._expanded=!this._expanded,this._expanded&&!this._usePopover&&(this._shouldScrollToToggle=!0)}_handleCloseButtonClick(e){this._expanded=!1,e.stopPropagation()}};h([x()],a.prototype,"text",void 0);h([x({type:Number})],a.prototype,"maxCharacters",void 0);h([x()],a.prototype,"overflowMode",void 0);h([x()],a.prototype,"emptyIndicatorMode",void 0);h([x({type:Boolean})],a.prototype,"_expanded",void 0);h([P("@ui5/webcomponents")],a,"i18nBundle",void 0);a=c=h([O({tag:"ui5-expandable-text",renderer:w,styles:V,template:q})],a);a.define();function K(o){const{className:e,text:t,maxCharacters:i,part:r}=o;return s(a,{part:r,class:e,text:t,maxCharacters:i})}export{K as default};
|