@ui5/webcomponents-base 1.11.0-rc.4 → 1.11.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/CHANGELOG.md +11 -0
- package/dist/Boot.d.ts +4 -3
- package/dist/Boot.js +13 -4
- package/dist/Boot.js.map +1 -1
- package/dist/UI5Element.d.ts +1 -7
- package/dist/UI5Element.js +7 -20
- package/dist/UI5Element.js.map +1 -1
- package/dist/api.json +1 -1
- package/dist/assets/Boot.102b63b1.js +9 -0
- package/dist/assets/Boot.6335ce08.css +1 -0
- package/dist/assets/bundle.esm.2e297622.js +52 -0
- package/dist/assets/test/pages/Boot.html.b9409297.js +1 -0
- package/dist/assets/test/pages/i18n.html.2e75e108.js +1 -0
- package/dist/assets/test/pages/i18n_texts.html.7dbd4f97.js +1 -0
- package/dist/decorators/customElement.js +7 -7
- package/dist/decorators/customElement.js.map +1 -1
- package/dist/decorators/event.js +6 -6
- package/dist/decorators/event.js.map +1 -1
- package/dist/decorators/fastNavigation.js +3 -3
- package/dist/decorators/fastNavigation.js.map +1 -1
- package/dist/decorators/languageAware.js +3 -3
- package/dist/decorators/languageAware.js.map +1 -1
- package/dist/decorators/property.js +6 -6
- package/dist/decorators/property.js.map +1 -1
- package/dist/decorators/slot.js +7 -7
- package/dist/decorators/slot.js.map +1 -1
- package/dist/decorators/themeAware.js +3 -3
- package/dist/decorators/themeAware.js.map +1 -1
- package/dist/generated/VersionInfo.js +3 -3
- package/dist/test/pages/AllTestElements.html +2 -1
- package/dist/test/pages/Boot.html +17 -0
- package/dist/test/pages/Configuration.html +2 -1
- package/dist/test/pages/ConfigurationScript.html +2 -1
- package/dist/test/pages/WithComplexTemplate.html +2 -1
- package/dist/test/pages/i18n.html +3 -2
- package/dist/test/pages/i18n_texts.html +3 -2
- package/dist/util/getClassCopy.d.ts +0 -1
- package/package.json +3 -3
- package/src/Boot.ts +16 -5
- package/src/UI5Element.ts +3 -19
- package/src/decorators/customElement.ts +7 -7
- package/src/decorators/event.ts +6 -6
- package/src/decorators/fastNavigation.ts +3 -3
- package/src/decorators/languageAware.ts +3 -3
- package/src/decorators/property.ts +6 -6
- package/src/decorators/slot.ts +7 -7
- package/src/decorators/themeAware.ts +3 -3
- package/dist/assets/bundle.esm.a2e827bf.js +0 -60
- package/dist/assets/test/pages/i18n.html.de9935e9.js +0 -1
- package/dist/assets/test/pages/i18n_texts.html.b70b7c6f.js +0 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import{g as pt,r as Ht,s as kt,a as Bt,E as K,b as J,c as he,d as Vt,e as pe,f as Ut,h as fe,i as ge,j as me,m as ye,k as _e,l as ve,n as Ae,o as $e,p as we,q as Ce,t as Se,u as C,v as be,w as Ee,x as Me,y as Te,z as Ft,A as xe,B as De,_ as Ie,C as Le}from"./Boot.102b63b1.js";const Pe=pt("PopupUtilsData",{currentZIndex:100}),_t=()=>Pe.currentZIndex,A=()=>{var s,t,e;return(e=(t=(s=window.sap)==null?void 0:s.ui)==null?void 0:t.getCore)==null?void 0:e.call(t)};class ft{static isLoaded(){return!!A()}static init(){const t=A();return t?new Promise(e=>{t.attachInit(()=>{window.sap.ui.require(["sap/ui/core/LocaleData","sap/ui/core/Popup"],(n,i)=>{i.setInitialZIndex(_t()),e()})})}):Promise.resolve()}static getConfigurationSettingsObject(){const t=A();if(!t)return;const e=t.getConfiguration(),n=window.sap.ui.require("sap/ui/core/LocaleData");return{animationMode:e.getAnimationMode(),language:e.getLanguage(),theme:e.getTheme(),themeRoot:e.getThemeRoot(),rtl:e.getRTL(),calendarType:e.getCalendarType(),formatSettings:{firstDayOfWeek:n?n.getInstance(e.getLocale()).getFirstDayOfWeek():void 0,legacyDateCalendarCustomizing:e.getFormatSettings().getLegacyDateCalendarCustomizing()}}}static getLocaleDataObject(){const t=A();if(!t)return;const e=t.getConfiguration();return window.sap.ui.require("sap/ui/core/LocaleData").getInstance(e.getLocale())._get()}static _listenForThemeChange(){const t=A(),e=t.getConfiguration();t.attachThemeChanged(async()=>{await kt(e.getTheme())})}static attachListeners(){!A()||ft._listenForThemeChange()}static cssVariablesLoaded(){if(!A())return;const e=[...document.head.children].find(n=>n.id==="sap-ui-theme-sap.ui.core");if(!!e)return!!e.href.match(/\/css(-|_)variables\.css/)}static getNextZIndex(){return A()?window.sap.ui.require("sap/ui/core/Popup").getNextZIndex():void 0}static setInitialZIndex(){if(!A())return;window.sap.ui.require("sap/ui/core/Popup").setInitialZIndex(_t())}}Ht("OpenUI5Support",ft);const Y=new Map,Q=new Map,vt=s=>{if(!Y.has(s)){const t=Ne(s.split("-"));Y.set(s,t)}return Y.get(s)},jt=s=>{if(!Q.has(s)){const t=s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();Q.set(s,t)}return Q.get(s)},Ne=s=>s.map((t,e)=>e===0?t.toLowerCase():t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(""),Oe=s=>{if(!(s instanceof HTMLElement))return"default";const t=s.getAttribute("slot");if(t){const e=t.match(/^(.+?)-\d+$/);return e?e[1]:t}return"default"},zt=s=>s instanceof HTMLSlotElement?s.assignedNodes({flatten:!0}).filter(t=>t instanceof HTMLElement):[s],Re=s=>s.reduce((t,e)=>t.concat(zt(e)),[]);let He,At={include:[/^ui5-/],exclude:[]};const tt=new Map,Wt=()=>He,ct=s=>{if(!tt.has(s)){const t=At.include.some(e=>s.match(e))&&!At.exclude.some(e=>s.match(e));tt.set(s,t)}return tt.get(s)},qt=s=>{if(ct(s))return Wt()};class ke{constructor(t){this.metadata=t}getInitialState(){if(Object.prototype.hasOwnProperty.call(this,"_initialState"))return this._initialState;const t={},e=this.slotsAreManaged(),n=this.getProperties();for(const i in n){const r=n[i].type,o=n[i].defaultValue;r===Boolean?(t[i]=!1,o!==void 0&&console.warn("The 'defaultValue' metadata key is ignored for all booleans properties, they would be initialized with 'false' by default")):n[i].multiple?t[i]=[]:r===Object?t[i]="defaultValue"in n[i]?n[i].defaultValue:{}:r===String?t[i]="defaultValue"in n[i]?n[i].defaultValue:"":t[i]=o}if(e){const i=this.getSlots();for(const[r,o]of Object.entries(i)){const c=o.propertyName||r;t[c]=[]}}return this._initialState=t,t}static validatePropertyValue(t,e){return e.multiple&&t?t.map(i=>$t(i,e)):$t(t,e)}static validateSlotValue(t,e){return Be(t,e)}getPureTag(){return this.metadata.tag||""}getTag(){const t=this.metadata.tag;if(!t)return"";const e=qt(t);return e?`${t}-${e}`:t}hasAttribute(t){const e=this.getProperties()[t];return e.type!==Object&&!e.noAttribute&&!e.multiple}getPropertiesList(){return Object.keys(this.getProperties())}getAttributesList(){return this.getPropertiesList().filter(this.hasAttribute.bind(this)).map(jt)}canSlotText(){const t=this.getSlots().default;return t&&t.type===Node}hasSlots(){return!!Object.entries(this.getSlots()).length}hasIndividualSlots(){return this.slotsAreManaged()&&Object.values(this.getSlots()).some(t=>t.individualSlots)}slotsAreManaged(){return!!this.metadata.managedSlots}supportsF6FastNavigation(){return!!this.metadata.fastNavigation}getProperties(){return this.metadata.properties||(this.metadata.properties={}),this.metadata.properties}getEvents(){return this.metadata.events||(this.metadata.events={}),this.metadata.events}getSlots(){return this.metadata.slots||(this.metadata.slots={}),this.metadata.slots}isLanguageAware(){return!!this.metadata.languageAware}isThemeAware(){return!!this.metadata.themeAware}shouldInvalidateOnChildChange(t,e,n){const i=this.getSlots()[t].invalidateOnChildChange;if(i===void 0)return!1;if(typeof i=="boolean")return i;if(typeof i=="object"){if(e==="property"){if(i.properties===void 0)return!1;if(typeof i.properties=="boolean")return i.properties;if(Array.isArray(i.properties))return i.properties.includes(n);throw new Error("Wrong format for invalidateOnChildChange.properties: boolean or array is expected")}if(e==="slot"){if(i.slots===void 0)return!1;if(typeof i.slots=="boolean")return i.slots;if(Array.isArray(i.slots))return i.slots.includes(n);throw new Error("Wrong format for invalidateOnChildChange.slots: boolean or array is expected")}}throw new Error("Wrong format for invalidateOnChildChange: boolean or object is expected")}}const $t=(s,t)=>{const e=t.type;let n=t.validator;return e&&e.isDataTypeClass&&(n=e),n?n.isValid(s)?s:t.defaultValue:!e||e===String?typeof s=="string"||typeof s>"u"||s===null?s:s.toString():e===Boolean?typeof s=="boolean"?s:!1:e===Object?typeof s=="object"?s:t.defaultValue:s in e?s:t.defaultValue},Be=(s,t)=>(s&&zt(s).forEach(e=>{if(!(e instanceof t.type))throw new Error(`The element is not of type ${t.type.toString()}`)}),s);customElements.get("ui5-static-area")||customElements.define("ui5-static-area",class extends HTMLElement{});const Ve=(s,t)=>{const e=Ue(t),n=Wt();return s(t,e,n)},Ue=s=>{const t=s.constructor,e=t.getMetadata().getPureTag(),n=t.getUniqueDependencies().map(i=>i.getMetadata().getPureTag()).filter(ct);return ct(e)&&n.push(e),n},Fe=()=>pt("CustomStyle.eventProvider",new K),je="CustomCSSChange",gt=s=>{Fe().attachEvent(je,s)},ze=()=>pt("CustomStyle.customCSSFor",{});gt(s=>{Bt({tag:s})});const We=s=>{const t=ze();return t[s]?t[s].join(""):""},qe=10,et=s=>Array.isArray(s)?s.filter(t=>!!t).flat(qe).map(t=>typeof t=="string"?t:t.content).join(" "):typeof s=="string"?s:s.content,W=new Map;gt(s=>{W.delete(`${s}_normal`)});const Zt=(s,t=!1)=>{const e=s.getMetadata().getTag(),n=`${e}_${t?"static":"normal"}`,i=J("OpenUI5Enablement");if(!W.has(n)){let r,o="";if(i&&(o=et(i.getBusyIndicatorStyles())),t)r=et(s.staticAreaStyles);else{const c=We(e)||"";r=`${et(s.styles)} ${c}`}r=`${r} ${o}`,W.set(n,r)}return W.get(n)},q=new Map;gt(s=>{q.delete(`${s}_normal`)});const Ze=(s,t=!1)=>{const n=`${s.getMetadata().getTag()}_${t?"static":"normal"}`;if(!q.has(n)){const i=Zt(s,t),r=new CSSStyleSheet;r.replaceSync(i),q.set(n,[r])}return q.get(n)},dt=(s,t=!1)=>{let e;const n=s.constructor,r=n[t?"staticAreaTemplate":"template"],o=t?s.staticAreaItem.shadowRoot:s.shadowRoot,c=Ve(r,s);if(!o){console.warn("There is no shadow root to update");return}if(document.adoptedStyleSheets?o.adoptedStyleSheets=Ze(n,t):e=Zt(n,t),n.renderer){n.renderer(c,o,e,t,{host:s});return}n.render(c,o,e,t,{host:s})},Ge="--_ui5_content_density",Ke=s=>getComputedStyle(s).getPropertyValue(Ge),Je=s=>{const t=/\$([-a-z0-9A-Z._]+)(?::([^$]*))?\$/.exec(s);return t&&t[2]?t[2].split(/,/):null},Xe={iw:"he",ji:"yi",in:"id",sh:"sr"},Ye=Je("$cldr-rtl-locales:ar,fa,he$")||[],Qe=s=>(s=s&&Xe[s]||s,Ye.indexOf(s)>=0),Gt=()=>{if(typeof document>"u")return!1;const s=he();return s!==void 0?!!s:Qe(Vt()||pe())},ts="--_ui5_dir",Kt=s=>{const t=window.document,e=["ltr","rtl"],n=getComputedStyle(s).getPropertyValue(ts);return e.includes(n)?n:e.includes(s.dir)?s.dir:e.includes(t.documentElement.dir)?t.documentElement.dir:e.includes(t.body.dir)?t.body.dir:Gt()?"rtl":void 0},z="ui5-static-area-item",es="data-sap-ui-integration-popup-content";class R extends HTMLElement{constructor(){super(),this._rendered=!1,this.attachShadow({mode:"open"})}setOwnerElement(t){this.ownerElement=t,this.classList.add(this.ownerElement._id),this.ownerElement.hasAttribute("data-ui5-static-stable")&&this.setAttribute("data-ui5-stable",this.ownerElement.getAttribute("data-ui5-static-stable"))}update(){this._rendered&&(this._updateAdditionalAttrs(),this._updateContentDensity(),this._updateDirection(),dt(this.ownerElement,!0))}_updateContentDensity(){Ke(this.ownerElement)==="compact"?(this.classList.add("sapUiSizeCompact"),this.classList.add("ui5-content-density-compact")):(this.classList.remove("sapUiSizeCompact"),this.classList.remove("ui5-content-density-compact"))}_updateDirection(){if(this.ownerElement){const t=Kt(this.ownerElement);t?this.setAttribute("dir",t):this.removeAttribute("dir")}}_updateAdditionalAttrs(){this.setAttribute(z,""),this.setAttribute(es,"")}async getDomRef(){return this._updateContentDensity(),this._rendered||(this._rendered=!0,dt(this.ownerElement,!0)),await Ut(),this.shadowRoot}static getTag(){const t=qt(z);return t?`${z}-${t}`:z}static createInstance(){return customElements.get(R.getTag())||customElements.define(R.getTag(),R),document.createElement(this.getTag())}}const ut=new WeakMap,ss=(s,t,e)=>{const n=new MutationObserver(t);ut.set(s,n),n.observe(s,e)},ns=s=>{const t=ut.get(s);t&&(t.disconnect(),ut.delete(s))},is=["value-changed"];let Z;const rs=s=>is.includes(s),os=s=>{const t=mt();return!(typeof t!="boolean"&&t.events&&t.events.includes&&t.events.includes(s))},mt=()=>(Z===void 0&&(Z=fe()),Z),as=s=>{Z=s},ls=s=>{const t=mt();return rs(s)?!1:t===!0?!0:!os(s)},cs=["disabled","title","hidden","role","draggable"],wt=s=>cs.includes(s)||s.startsWith("aria")?!0:![HTMLElement,Element,Node].some(e=>e.prototype.hasOwnProperty(s)),Ct=(s,t)=>{if(s.length!==t.length)return!1;for(let e=0;e<s.length;e++)if(s[e]!==t[e])return!1;return!0};let ds=0;const St=new Map,st=new Map;function L(s){this._suppressInvalidation||(this.onInvalidation(s),this._changedState.push(s),Se(this),this._eventProvider.fireEvent("invalidate",{...s,target:this}))}class w extends HTMLElement{constructor(){super();const t=this.constructor;this._changedState=[],this._suppressInvalidation=!0,this._inDOM=!1,this._fullyConnected=!1,this._childChangeListeners=new Map,this._slotChangeListeners=new Map,this._eventProvider=new K;let e;this._domRefReadyPromise=new Promise(n=>{e=n}),this._domRefReadyPromise._deferredResolve=e,this._doNotSyncAttributes=new Set,this._state={...t.getMetadata().getInitialState()},this._upgradeAllProperties(),t._needsShadowDOM()&&this.attachShadow({mode:"open"})}get _id(){return this.__id||(this.__id=`ui5wc_${++ds}`),this.__id}async connectedCallback(){const t=this.constructor;this.setAttribute(t.getMetadata().getPureTag(),""),t.getMetadata().supportsF6FastNavigation()&&this.setAttribute("data-sap-ui-fastnavgroup","true");const e=t.getMetadata().slotsAreManaged();this._inDOM=!0,e&&(this._startObservingDOMChildren(),await this._processChildren()),this._inDOM&&(ge(this),this._domRefReadyPromise._deferredResolve(),this._fullyConnected=!0,this.onEnterDOM())}disconnectedCallback(){const e=this.constructor.getMetadata().slotsAreManaged();this._inDOM=!1,e&&this._stopObservingDOMChildren(),this._fullyConnected&&(this.onExitDOM(),this._fullyConnected=!1),this.staticAreaItem&&this.staticAreaItem.parentElement&&this.staticAreaItem.parentElement.removeChild(this.staticAreaItem),me(this)}onBeforeRendering(){}onAfterRendering(){}onEnterDOM(){}onExitDOM(){}_startObservingDOMChildren(){const t=this.constructor;if(!t.getMetadata().hasSlots())return;const n=t.getMetadata().canSlotText(),i={childList:!0,subtree:n,characterData:n};ss(this,this._processChildren.bind(this),i)}_stopObservingDOMChildren(){ns(this)}async _processChildren(){this.constructor.getMetadata().hasSlots()&&await this._updateSlots()}async _updateSlots(){const t=this.constructor,e=t.getMetadata().getSlots(),n=t.getMetadata().canSlotText(),i=Array.from(n?this.childNodes:this.children),r=new Map,o=new Map;for(const[d,u]of Object.entries(e)){const h=u.propertyName||d;o.set(h,d),r.set(h,[...this._state[h]]),this._clearSlot(d,u)}const c=new Map,a=new Map,l=i.map(async(d,u)=>{const h=Oe(d),f=e[h];if(f===void 0){if(h!=="default"){const g=Object.keys(e).join(", ");console.warn(`Unknown slotName: ${h}, ignoring`,d,`Valid values are: ${g}`)}return}if(f.individualSlots){const g=(c.get(h)||0)+1;c.set(h,g),d._individualSlot=`${h}-${g}`}if(d instanceof HTMLElement){const g=d.localName;if(g.includes("-")){if(!window.customElements.get(g)){const de=window.customElements.whenDefined(g);let j=St.get(g);j||(j=new Promise(ue=>setTimeout(ue,1e3)),St.set(g,j)),await Promise.race([de,j])}window.customElements.upgrade(d)}}if(d=t.getMetadata().constructor.validateSlotValue(d,f),bt(d)&&f.invalidateOnChildChange){const g=this._getChildChangeListener(h);g&&d.attachInvalidate.call(d,g)}d instanceof HTMLSlotElement&&this._attachSlotChange(d,h);const m=f.propertyName||h;a.has(m)?a.get(m).push({child:d,idx:u}):a.set(m,[{child:d,idx:u}])});await Promise.all(l),a.forEach((d,u)=>{this._state[u]=d.sort((h,f)=>h.idx-f.idx).map(h=>h.child)});let p=!1;for(const[d,u]of Object.entries(e)){const h=u.propertyName||d;Ct(r.get(h),this._state[h])||(L.call(this,{type:"slot",name:o.get(h),reason:"children"}),p=!0)}p||L.call(this,{type:"slot",name:"default",reason:"textcontent"})}_clearSlot(t,e){const n=e.propertyName||t;this._state[n].forEach(r=>{if(bt(r)){const o=this._getChildChangeListener(t);o&&r.detachInvalidate.call(r,o)}r instanceof HTMLSlotElement&&this._detachSlotChange(r,t)}),this._state[n]=[]}attachInvalidate(t){this._eventProvider.attachEvent("invalidate",t)}detachInvalidate(t){this._eventProvider.detachEvent("invalidate",t)}_onChildChange(t,e){!this.constructor.getMetadata().shouldInvalidateOnChildChange(t,e.type,e.name)||L.call(this,{type:"slot",name:t,reason:"childchange",child:e.target})}attributeChangedCallback(t,e,n){let i;if(this._doNotSyncAttributes.has(t))return;const r=this.constructor.getMetadata().getProperties(),o=t.replace(/^ui5-/,""),c=vt(o);if(r.hasOwnProperty(c)){const a=r[c],l=a.type;let p=a.validator;l&&l.isDataTypeClass&&(p=l),p?i=p.attributeToProperty(n):l===Boolean?i=n!==null:i=n,this[c]=i}}_updateAttribute(t,e){const n=this.constructor;if(!n.getMetadata().hasAttribute(t))return;const r=n.getMetadata().getProperties()[t],o=r.type;let c=r.validator;const a=jt(t),l=this.getAttribute(a);if(o&&o.isDataTypeClass&&(c=o),c){const p=c.propertyToAttribute(e);p===null?(this._doNotSyncAttributes.add(a),this.removeAttribute(a),this._doNotSyncAttributes.delete(a)):this.setAttribute(a,p)}else o===Boolean?e===!0&&l===null?this.setAttribute(a,""):e===!1&&l!==null&&this.removeAttribute(a):typeof e!="object"&&l!==e&&this.setAttribute(a,e)}_upgradeProperty(t){if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this[t]=e}}_upgradeAllProperties(){this.constructor.getMetadata().getPropertiesList().forEach(this._upgradeProperty.bind(this))}_getChildChangeListener(t){return this._childChangeListeners.has(t)||this._childChangeListeners.set(t,this._onChildChange.bind(this,t)),this._childChangeListeners.get(t)}_getSlotChangeListener(t){return this._slotChangeListeners.has(t)||this._slotChangeListeners.set(t,this._onSlotChange.bind(this,t)),this._slotChangeListeners.get(t)}_attachSlotChange(t,e){const n=this._getSlotChangeListener(e);n&&t.addEventListener("slotchange",n)}_detachSlotChange(t,e){t.removeEventListener("slotchange",this._getSlotChangeListener(e))}_onSlotChange(t){L.call(this,{type:"slot",name:t,reason:"slotchange"})}onInvalidation(t){}_render(){const t=this.constructor,e=t.getMetadata().hasIndividualSlots();this._suppressInvalidation=!0,this.onBeforeRendering(),this._onComponentStateFinalized&&this._onComponentStateFinalized(),this._suppressInvalidation=!1,this._changedState=[],t._needsShadowDOM()&&dt(this),this.staticAreaItem&&this.staticAreaItem.update(),e&&this._assignIndividualSlotsToChildren(),this.onAfterRendering()}_assignIndividualSlotsToChildren(){Array.from(this.children).forEach(e=>{e._individualSlot&&e.setAttribute("slot",e._individualSlot)})}_waitForDomRef(){return this._domRefReadyPromise}getDomRef(){if(typeof this._getRealDomRef=="function")return this._getRealDomRef();if(!this.shadowRoot||this.shadowRoot.children.length===0)return;const t=[...this.shadowRoot.children].filter(e=>!["link","style"].includes(e.localName));return t.length!==1&&console.warn(`The shadow DOM for ${this.constructor.getMetadata().getTag()} does not have a top level element, the getDomRef() method might not work as expected`),t[0]}getFocusDomRef(){const t=this.getDomRef();if(t)return t.querySelector("[data-sap-focus-ref]")||t}async getFocusDomRefAsync(){return await this._waitForDomRef(),this.getFocusDomRef()}async focus(t){await this._waitForDomRef();const e=this.getFocusDomRef();e&&typeof e.focus=="function"&&e.focus(t)}fireEvent(t,e,n=!1,i=!0){const r=this._fireEvent(t,e,n,i),o=vt(t);return o!==t?r&&this._fireEvent(o,e,n):r}_fireEvent(t,e,n=!1,i=!0){const r=new CustomEvent(`ui5-${t}`,{detail:e,composed:!1,bubbles:i,cancelable:n}),o=this.dispatchEvent(r);if(ls(t))return o;const c=new CustomEvent(t,{detail:e,composed:!1,bubbles:i,cancelable:n});return this.dispatchEvent(c)&&o}getSlottedNodes(t){return Re(this[t])}get effectiveDir(){return ye(this.constructor),Kt(this)}get isUI5Element(){return!0}get classes(){return{}}static get observedAttributes(){return this.getMetadata().getAttributesList()}static _needsShadowDOM(){return!!this.template}static _needsStaticArea(){return!!this.staticAreaTemplate}getStaticAreaItemDomRef(){if(!this.constructor._needsStaticArea())throw new Error("This component does not use the static area");return this.staticAreaItem||(this.staticAreaItem=R.createInstance(),this.staticAreaItem.setOwnerElement(this)),this.staticAreaItem.parentElement||_e("ui5-static-area").appendChild(this.staticAreaItem),this.staticAreaItem.getDomRef()}static _generateAccessors(){const t=this.prototype,e=this.getMetadata().slotsAreManaged(),n=this.getMetadata().getProperties();for(const[i,r]of Object.entries(n)){if(wt(i)||console.warn(`"${i}" is not a valid property name. Use a name that does not collide with DOM APIs`),r.type===Boolean&&r.defaultValue)throw new Error(`Cannot set a default value for property "${i}". All booleans are false by default.`);if(r.type===Array)throw new Error(`Wrong type for property "${i}". Properties cannot be of type Array - use "multiple: true" and set "type" to the single value type, such as "String", "Object", etc...`);if(r.type===Object&&r.defaultValue)throw new Error(`Cannot set a default value for property "${i}". All properties of type "Object" are empty objects by default.`);if(r.multiple&&r.defaultValue)throw new Error(`Cannot set a default value for property "${i}". All multiple properties are empty arrays by default.`);Object.defineProperty(t,i,{get(){if(this._state[i]!==void 0)return this._state[i];const o=r.defaultValue;return r.type===Boolean?!1:r.type===String?o:r.multiple?[]:o},set(o){let c;o=this.constructor.getMetadata().constructor.validatePropertyValue(o,r);const p=r.type;let d=r.validator;const u=this._state[i];p&&p.isDataTypeClass&&(d=p),d?c=!d.valuesAreEqual(u,o):Array.isArray(u)&&Array.isArray(o)&&r.multiple&&r.compareValues?c=!Ct(u,o):c=u!==o,c&&(this._state[i]=o,L.call(this,{type:"property",name:i,newValue:o,oldValue:u}),this._updateAttribute(i,o))}})}if(e){const i=this.getMetadata().getSlots();for(const[r,o]of Object.entries(i)){wt(r)||console.warn(`"${r}" is not a valid property name. Use a name that does not collide with DOM APIs`);const c=o.propertyName||r;Object.defineProperty(t,c,{get(){return this._state[c]!==void 0?this._state[c]:[]},set(){throw new Error("Cannot set slot content directly, use the DOM APIs (appendChild, removeChild, etc...)")}})}}}static get styles(){return""}static get staticAreaStyles(){return""}static get dependencies(){return[]}static getUniqueDependencies(){if(!st.has(this)){const t=this.dependencies.filter((e,n,i)=>i.indexOf(e)===n);st.set(this,t)}return st.get(this)||[]}static whenDependenciesDefined(){return Promise.all(this.getUniqueDependencies().map(t=>t.define()))}static async onDefine(){return Promise.resolve()}static async define(){await ve(),await Promise.all([this.whenDependenciesDefined(),this.onDefine()]);const t=this.getMetadata().getTag(),e=Ae(t),n=customElements.get(t);return n&&!e?$e(t):n||(this._generateAccessors(),we(t),window.customElements.define(t,this)),this}static getMetadata(){if(this.hasOwnProperty("_metadata"))return this._metadata;const t=[this.metadata];let e=this;for(;e!==w;)e=Object.getPrototypeOf(e),t.unshift(e.metadata);const n=Ce({},...t);return this._metadata=new ke(n),this._metadata}}w.metadata={};const bt=s=>"isUI5Element"in s;/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/var nt;const G=window,x=G.trustedTypes,Et=x?x.createPolicy("lit-html",{createHTML:s=>s}):void 0,$=`lit$${(Math.random()+"").slice(9)}$`,yt="?"+$,us=`<${yt}>`,D=document,H=(s="")=>D.createComment(s),k=s=>s===null||typeof s!="object"&&typeof s!="function",Jt=Array.isArray,Xt=s=>Jt(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Mt=/-->/g,Tt=/>/g,S=RegExp(`>|[
|
|
6
|
+
\f\r](?:([^\\s"'>=/]+)([
|
|
7
|
+
\f\r]*=[
|
|
8
|
+
\f\r]*(?:[^
|
|
9
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),xt=/'/g,Dt=/"/g,Yt=/^(?:script|style|textarea|title)$/i,hs=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),ps=hs(1),E=Symbol.for("lit-noChange"),y=Symbol.for("lit-nothing"),It=new WeakMap,T=D.createTreeWalker(D,129,null,!1),Qt=(s,t)=>{const e=s.length-1,n=[];let i,r=t===2?"<svg>":"",o=P;for(let a=0;a<e;a++){const l=s[a];let p,d,u=-1,h=0;for(;h<l.length&&(o.lastIndex=h,d=o.exec(l),d!==null);)h=o.lastIndex,o===P?d[1]==="!--"?o=Mt:d[1]!==void 0?o=Tt:d[2]!==void 0?(Yt.test(d[2])&&(i=RegExp("</"+d[2],"g")),o=S):d[3]!==void 0&&(o=S):o===S?d[0]===">"?(o=i!=null?i:P,u=-1):d[1]===void 0?u=-2:(u=o.lastIndex-d[2].length,p=d[1],o=d[3]===void 0?S:d[3]==='"'?Dt:xt):o===Dt||o===xt?o=S:o===Mt||o===Tt?o=P:(o=S,i=void 0);const f=o===S&&s[a+1].startsWith("/>")?" ":"";r+=o===P?l+us:u>=0?(n.push(p),l.slice(0,u)+"$lit$"+l.slice(u)+$+f):l+$+(u===-2?(n.push(void 0),a):f)}const c=r+(s[e]||"<?>")+(t===2?"</svg>":"");if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return[Et!==void 0?Et.createHTML(c):c,n]};class B{constructor({strings:t,_$litType$:e},n){let i;this.parts=[];let r=0,o=0;const c=t.length-1,a=this.parts,[l,p]=Qt(t,e);if(this.el=B.createElement(l,n),T.currentNode=this.el.content,e===2){const d=this.el.content,u=d.firstChild;u.remove(),d.append(...u.childNodes)}for(;(i=T.nextNode())!==null&&a.length<c;){if(i.nodeType===1){if(i.hasAttributes()){const d=[];for(const u of i.getAttributeNames())if(u.endsWith("$lit$")||u.startsWith($)){const h=p[o++];if(d.push(u),h!==void 0){const f=i.getAttribute(h.toLowerCase()+"$lit$").split($),m=/([.?@])?(.*)/.exec(h);a.push({type:1,index:r,name:m[2],strings:f,ctor:m[1]==="."?ee:m[1]==="?"?se:m[1]==="@"?ne:V})}else a.push({type:6,index:r})}for(const u of d)i.removeAttribute(u)}if(Yt.test(i.tagName)){const d=i.textContent.split($),u=d.length-1;if(u>0){i.textContent=x?x.emptyScript:"";for(let h=0;h<u;h++)i.append(d[h],H()),T.nextNode(),a.push({type:2,index:++r});i.append(d[u],H())}}}else if(i.nodeType===8)if(i.data===yt)a.push({type:2,index:r});else{let d=-1;for(;(d=i.data.indexOf($,d+1))!==-1;)a.push({type:7,index:r}),d+=$.length-1}r++}}static createElement(t,e){const n=D.createElement("template");return n.innerHTML=t,n}}function M(s,t,e=s,n){var i,r,o,c;if(t===E)return t;let a=n!==void 0?(i=e._$Co)===null||i===void 0?void 0:i[n]:e._$Cl;const l=k(t)?void 0:t._$litDirective$;return(a==null?void 0:a.constructor)!==l&&((r=a==null?void 0:a._$AO)===null||r===void 0||r.call(a,!1),l===void 0?a=void 0:(a=new l(s),a._$AT(s,e,n)),n!==void 0?((o=(c=e)._$Co)!==null&&o!==void 0?o:c._$Co=[])[n]=a:e._$Cl=a),a!==void 0&&(t=M(s,a._$AS(s,t.values),a,n)),t}class te{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:n},parts:i}=this._$AD,r=((e=t==null?void 0:t.creationScope)!==null&&e!==void 0?e:D).importNode(n,!0);T.currentNode=r;let o=T.nextNode(),c=0,a=0,l=i[0];for(;l!==void 0;){if(c===l.index){let p;l.type===2?p=new I(o,o.nextSibling,this,t):l.type===1?p=new l.ctor(o,l.name,l.strings,this,t):l.type===6&&(p=new ie(o,this,t)),this.u.push(p),l=i[++a]}c!==(l==null?void 0:l.index)&&(o=T.nextNode(),c++)}return r}p(t){let e=0;for(const n of this.u)n!==void 0&&(n.strings!==void 0?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}}class I{constructor(t,e,n,i){var r;this.type=2,this._$AH=y,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=i,this._$Cm=(r=i==null?void 0:i.isConnected)===null||r===void 0||r}get _$AU(){var t,e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&t.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=M(this,t,e),k(t)?t===y||t==null||t===""?(this._$AH!==y&&this._$AR(),this._$AH=y):t!==this._$AH&&t!==E&&this.g(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Xt(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==y&&k(this._$AH)?this._$AA.nextSibling.data=t:this.T(D.createTextNode(t)),this._$AH=t}$(t){var e;const{values:n,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=B.createElement(i.h,this.options)),i);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===r)this._$AH.p(n);else{const o=new te(r,this),c=o.v(this.options);o.p(n),this.T(c),this._$AH=o}}_$AC(t){let e=It.get(t.strings);return e===void 0&&It.set(t.strings,e=new B(t)),e}k(t){Jt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,i=0;for(const r of t)i===e.length?e.push(n=new I(this.O(H()),this.O(H()),this,this.options)):n=e[i],n._$AI(r),i++;i<e.length&&(this._$AR(n&&n._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,e);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cm=t,(e=this._$AP)===null||e===void 0||e.call(this,t))}}class V{constructor(t,e,n,i,r){this.type=1,this._$AH=y,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=r,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=y}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,n,i){const r=this.strings;let o=!1;if(r===void 0)t=M(this,t,e,0),o=!k(t)||t!==this._$AH&&t!==E,o&&(this._$AH=t);else{const c=t;let a,l;for(t=r[0],a=0;a<r.length-1;a++)l=M(this,c[n+a],e,a),l===E&&(l=this._$AH[a]),o||(o=!k(l)||l!==this._$AH[a]),l===y?t=y:t!==y&&(t+=(l!=null?l:"")+r[a+1]),this._$AH[a]=l}o&&!i&&this.j(t)}j(t){t===y?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}}class ee extends V{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===y?void 0:t}}const fs=x?x.emptyScript:"";class se extends V{constructor(){super(...arguments),this.type=4}j(t){t&&t!==y?this.element.setAttribute(this.name,fs):this.element.removeAttribute(this.name)}}class ne extends V{constructor(t,e,n,i,r){super(t,e,n,i,r),this.type=5}_$AI(t,e=this){var n;if((t=(n=M(this,t,e,0))!==null&&n!==void 0?n:y)===E)return;const i=this._$AH,r=t===y&&i!==y||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==y&&(i===y||r);r&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,n;typeof this._$AH=="function"?this._$AH.call((n=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&n!==void 0?n:this.element,t):this._$AH.handleEvent(t)}}class ie{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){M(this,t)}}const gs={P:"$lit$",A:$,M:yt,C:1,L:Qt,R:te,D:Xt,V:M,I,H:V,N:se,U:ne,B:ee,F:ie},Lt=G.litHtmlPolyfillSupport;Lt==null||Lt(B,I),((nt=G.litHtmlVersions)!==null&&nt!==void 0?nt:G.litHtmlVersions=[]).push("2.6.0");const ms=(s,t,e)=>{var n,i;const r=(n=e==null?void 0:e.renderBefore)!==null&&n!==void 0?n:t;let o=r._$litPart$;if(o===void 0){const c=(i=e==null?void 0:e.renderBefore)!==null&&i!==void 0?i:null;r._$litPart$=o=new I(t.insertBefore(H(),c),c,void 0,e!=null?e:{})}return o._$AI(s),o};/**
|
|
10
|
+
* @license
|
|
11
|
+
* Copyright 2017 Google LLC
|
|
12
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
+
*/const re={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ys=s=>(...t)=>({_$litDirective$:s,values:t});class oe{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,n){this._$Ct=t,this._$AM=e,this._$Ci=n}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/**
|
|
14
|
+
* @license
|
|
15
|
+
* Copyright 2020 Google LLC
|
|
16
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
+
*/const{I:_s}=gs,Pt=()=>document.createComment(""),N=(s,t,e)=>{var n;const i=s._$AA.parentNode,r=t===void 0?s._$AB:t._$AA;if(e===void 0){const o=i.insertBefore(Pt(),r),c=i.insertBefore(Pt(),r);e=new _s(o,c,s,s.options)}else{const o=e._$AB.nextSibling,c=e._$AM,a=c!==s;if(a){let l;(n=e._$AQ)===null||n===void 0||n.call(e,s),e._$AM=s,e._$AP!==void 0&&(l=s._$AU)!==c._$AU&&e._$AP(l)}if(o!==r||a){let l=e._$AA;for(;l!==o;){const p=l.nextSibling;i.insertBefore(l,r),l=p}}}return e},b=(s,t,e=s)=>(s._$AI(t,e),s),vs={},As=(s,t=vs)=>s._$AH=t,$s=s=>s._$AH,it=s=>{var t;(t=s._$AP)===null||t===void 0||t.call(s,!1,!0);let e=s._$AA;const n=s._$AB.nextSibling;for(;e!==n;){const i=e.nextSibling;e.remove(),e=i}};/**
|
|
18
|
+
* @license
|
|
19
|
+
* Copyright 2017 Google LLC
|
|
20
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
21
|
+
*/const Nt=(s,t,e)=>{const n=new Map;for(let i=t;i<=e;i++)n.set(s[i],i);return n},ae=ys(class extends oe{constructor(s){if(super(s),s.type!==re.CHILD)throw Error("repeat() can only be used in text expressions")}ht(s,t,e){let n;e===void 0?e=t:t!==void 0&&(n=t);const i=[],r=[];let o=0;for(const c of s)i[o]=n?n(c,o):o,r[o]=e(c,o),o++;return{values:r,keys:i}}render(s,t,e){return this.ht(s,t,e).values}update(s,[t,e,n]){var i;const r=$s(s),{values:o,keys:c}=this.ht(t,e,n);if(!Array.isArray(r))return this.ut=c,o;const a=(i=this.ut)!==null&&i!==void 0?i:this.ut=[],l=[];let p,d,u=0,h=r.length-1,f=0,m=o.length-1;for(;u<=h&&f<=m;)if(r[u]===null)u++;else if(r[h]===null)h--;else if(a[u]===c[f])l[f]=b(r[u],o[f]),u++,f++;else if(a[h]===c[m])l[m]=b(r[h],o[m]),h--,m--;else if(a[u]===c[m])l[m]=b(r[u],o[m]),N(s,l[m+1],r[u]),u++,m--;else if(a[h]===c[f])l[f]=b(r[h],o[f]),N(s,r[u],r[h]),h--,f++;else if(p===void 0&&(p=Nt(c,f,m),d=Nt(a,u,h)),p.has(a[u]))if(p.has(a[h])){const g=d.get(c[f]),F=g!==void 0?r[g]:null;if(F===null){const X=N(s,r[u]);b(X,o[f]),l[f]=X}else l[f]=b(F,o[f]),N(s,r[u],F),r[g]=null;f++}else it(r[h]),h--;else it(r[u]),u++;for(;f<=m;){const g=N(s,l[m+1]);b(g,o[f]),l[f++]=g}for(;u<=h;){const g=r[u++];g!==null&&it(g)}return this.ut=c,As(s,l),E}});/**
|
|
22
|
+
* @license
|
|
23
|
+
* Copyright 2018 Google LLC
|
|
24
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
+
*/const v=s=>s!=null?s:y;/**
|
|
26
|
+
* @license
|
|
27
|
+
* Copyright 2017 Google LLC
|
|
28
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
29
|
+
*/class Ot extends oe{constructor(t){if(super(t),this.it=y,t.type!==re.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===y||t==null)return this._t=void 0,this.it=t;if(t===E)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}Ot.directiveName="unsafeHTML",Ot.resultType=1;const _=(s,...t)=>{const e=J("LitStatic");return(e?e.html:ps)(s,...t)},U=(s,t,e,n,i)=>{const r=J("OpenUI5Enablement");r&&!n&&(s=r.wrapTemplateResultInBusyMarkup(_,i.host,s)),typeof e=="string"?s=_`<style>${e}</style>${s}`:Array.isArray(e)&&e.length&&(s=_`${e.map(o=>_`<link type="text/css" rel="stylesheet" href="${o}">`)}${s}`),ms(s,t,i)},ws={tag:"ui5-test-generic",properties:{strProp:{type:String},boolProp:{type:Boolean},objectProp:{type:Object},noAttributeProp:{type:String,noAttribute:!0},multiProp:{type:String,multiple:!0},defaultValueProp:{type:String,defaultValue:"Hello"}},managedSlots:!0,slots:{default:{type:Node},other:{type:HTMLElement},individual:{type:HTMLElement,individualSlots:!0},named:{type:HTMLElement,propertyName:"items"}}};class le extends w{static get metadata(){return ws}static get render(){return U}static get template(){return t=>_`<div><p>
|
|
30
|
+
<slot></slot>
|
|
31
|
+
<slot name="other"></slot>
|
|
32
|
+
<slot name="individual-1"></slot>
|
|
33
|
+
<slot name="individual-2"></slot>
|
|
34
|
+
</p></div>`}static get styles(){return`:host {
|
|
35
|
+
display: inline-block;
|
|
36
|
+
border: 1px solid black;
|
|
37
|
+
color: var(--var1);
|
|
38
|
+
}`}onBeforeRendering(){}onAfterRendering(){}onEnterDOM(){}onExitDOM(){}}le.define();const Cs={tag:"ui5-test-no-shadow"};class Ss extends w{static get metadata(){return Cs}}Ss.define();const bs={tag:"ui5-test-parent",managedSlots:!0,slots:{default:{type:Node,invalidateOnChildChange:{properties:["prop1"]}},items:{type:HTMLElement,invalidateOnChildChange:{properties:!0}}}};class Es extends w{static get metadata(){return bs}static get render(){return U}static get template(){return t=>_`<div>
|
|
39
|
+
<slot></slot>
|
|
40
|
+
</div>`}}Es.define();const Ms={tag:"ui5-test-child",properties:{prop1:{type:String},prop2:{type:String},prop3:{type:String}}};class Ts extends w{static get metadata(){return Ms}static get render(){return U}static get template(){return t=>_`<div></div>`}}Ts.define();const xs={tag:"ui5-with-static-area",properties:{staticContent:{type:Boolean}},slots:{}};class Ds extends w{static get metadata(){return xs}static get render(){return U}static get template(){return t=>_`
|
|
41
|
+
<div dir=${t.effectiveDir}>
|
|
42
|
+
WithStaticArea works!
|
|
43
|
+
</div>`}static get staticAreaTemplate(){return t=>_`
|
|
44
|
+
<div class="ui5-with-static-area-content">
|
|
45
|
+
Static area content.
|
|
46
|
+
</div>`}static get styles(){return`
|
|
47
|
+
:host {
|
|
48
|
+
display: inline-block;
|
|
49
|
+
border: 1px solid black;
|
|
50
|
+
color: red;
|
|
51
|
+
}`}async addStaticArea(){if(!this.staticContent)return;const t=await this.getStaticAreaItemDomRef();return this.responsivePopover=t.querySelector(".ui5-with-static-area-content"),this.responsivePopover}onBeforeRendering(){this.addStaticArea()}onAfterRendering(){}onEnterDOM(){}onExitDOM(){}}Ds.define();const Is=(s,t,e)=>_`<div>Root text: ${v(s.text)}${ae(s.items,(n,i)=>n._id||i,(n,i)=>Ls(n,i,s))} Root text: ${v(s.text)}</div>`,Ls=(s,t,e,n,i)=>_`<h3>Item-${t}</h3>${s.text?Ps(s,t,e):void 0}<ul>${ae(s.words,(r,o)=>r._id||o,(r,o)=>Ns(r,o,e))}</ul>${s.text?Os(s,t,e):void 0}`,Ps=(s,t,e,n,i)=>_`<div class="before-each-content--start--${t}">Root text: ${v(e.text)}, Item text: ${v(s.text)}</div>`,Ns=(s,t,e,n,i)=>_`<li><h3>Word-${t}</h3><div class="nested-each-content--${t}--0">Root Text: ${v(e.text)}, Word text: ${v(s.text)}</div><div class="nested-each-content--${t}--1">Root Text: ${v(e.text)}, Word text: ${v(s.text)}</div></li>`,Os=(s,t,e,n,i)=>_`<div class="after-each-content--end--${t}">Root text: ${v(e.text)}, Item text: ${v(s.text)}</div>`;class Rs extends w{static get metadata(){return{tag:"ui5-test-complex-template"}}static get render(){return U}static get template(){return Is}get text(){return"root"}get items(){return[{text:"positives",words:[{text:"word1_good"},{text:"word2_nice"},{text:"word3_kind"}]},{text:"negatives",words:[{text:"word4_bad"},{text:"word5_rude"},{text:"word6_unpolite"}]}]}}Rs.define();const Hs={tag:"ui5-test-generic-ext",properties:{extProp:{type:String},strProp:{defaultValue:"Ext"}},slots:{extSlot:{type:HTMLElement}}};class ks extends le{static get metadata(){return Hs}}ks.define();const Bs={content:":root{ --var1: red; }",packageName:"",fileName:""},Vs={content:":root{ --var1: green; }",packageName:"",fileName:""},Us={content:":root{ --var1: blue; }",packageName:"",fileName:""},Fs={content:":root{ --var1: orange; }",packageName:"",fileName:""},js={content:":root{ --var1: orange; }",packageName:"",fileName:""},zs={content:":root{ --var1: yellow; }",packageName:"",fileName:""},Ws={content:":root{ --var1: yellow; }",packageName:"",fileName:""};C("@ui5/webcomponents-base-test","sap_fiori_3",()=>Bs);C("@ui5/webcomponents-base-test","sap_fiori_3_dark",()=>Vs);C("@ui5/webcomponents-base-test","sap_belize",()=>Us);C("@ui5/webcomponents-base-test","sap_belize_hcb",()=>Fs);C("@ui5/webcomponents-base-test","sap_belize_hcw",()=>js);C("@ui5/webcomponents-base-test","sap_fiori_3_hcb",()=>zs);C("@ui5/webcomponents-base-test","sap_fiori_3_hcw",()=>Ws);const qs=/('')|'([^']+(?:''[^']*)*)(?:'|$)|\{([0-9]+(?:\s*,[^{}]*)?)\}|[{}]/g,Zs=(s,t)=>(t=t||[],s.replace(qs,(e,n,i,r,o)=>{if(n)return"'";if(i)return i.replace(/''/g,"'");if(r){const c=typeof r=="string"?parseInt(r):r;return String(t[c])}throw new Error(`[i18n]: pattern syntax error at pos ${o}`)})),rt=new Map;class Gs{constructor(t){this.packageName=t}getText(t,...e){if(typeof t=="string"&&(t={key:t,defaultText:t}),!t||!t.key)return"";const n=Ee(this.packageName);n&&!n[t.key]&&console.warn(`Key ${t.key} not found in the i18n bundle, the default text will be used`);const i=n&&n[t.key]?n[t.key]:t.defaultText||t.key;return Zs(i,e)}}const Ks=s=>{if(rt.has(s))return rt.get(s);const t=new Gs(s);return rt.set(s,t),t},Js=async s=>(await be(s),Ks(s)),Xs=typeof window.chrome=="object"||typeof window.v8=="object"?(s,t)=>(t>2&&40*t>s.length,s):s=>s,Ys=/(?:\r\n|\r|\n|^)[ \t\f]*/,Qs=/(\\u[0-9a-fA-F]{0,4})|(\\.)|(\\$)|([ \t\f]*[ \t\f:=][ \t\f]*)/g,tn=/(\\u[0-9a-fA-F]{0,4})|(\\.)|(\\$)/g,en={"\\f":"\f","\\n":`
|
|
52
|
+
`,"\\r":"\r","\\t":" "},sn=s=>{const t={},e=s.split(Ys);let n,i,r,o,c,a,l,p;const d=u=>{o?(o=`${o}${u}`,p++):(o=u,p=0)};for(c=0;c<e.length;c++)if(n=e[c],!(n===""||n.charAt(0)==="#"||n.charAt(0)==="!")){for(i=Qs,l=0,i.lastIndex=l,r=null,o="",a=i.exec(n);a!==null;){if(l<a.index&&d(n.slice(l,a.index)),l=i.lastIndex,a[1]){if(a[1].length!==6)throw new Error(`Incomplete Unicode Escape '${a[1]}'`);d(String.fromCharCode(parseInt(a[1].slice(2),16)))}else a[2]?d(en[a[2]]||a[2].slice(1)):a[3]?(n=e[++c],l=0,i.lastIndex=l):a[4]&&(r=o,o="",i=tn,i.lastIndex=l);a=i.exec(n)}l<n.length&&d(n.slice(l)),r==null&&(r=o,o=""),t[r]=Xs(o,o?p:0)}return t};let ot;const nn=()=>(ot===void 0&&(ot=Me()),ot);var ht;(function(s){s.Gregorian="Gregorian",s.Islamic="Islamic",s.Japanese="Japanese",s.Buddhist="Buddhist",s.Persian="Persian"})(ht||(ht={}));const Rt=ht;let O;const rn=()=>(O===void 0&&(O=Te()),O&&O in Rt?O:Rt.Gregorian);let at;class ce{static getLegacyDateCalendarCustomizing(){return at===void 0&&(at=Ft()),at.legacyDateCalendarCustomizing||[]}}Ht("LegacyDateFormats",ce);let lt;const on=()=>(lt===void 0&&(lt=Ft()),lt.firstDayOfWeek),an=J("LegacyDateFormats"),ln=an?ce.getLegacyDateCalendarCustomizing:()=>[],cn=new K,dn="directionChange",un=()=>cn.fireEvent(dn,void 0),hn=async()=>{const s=un();await Promise.all(s),await Bt({rtlAware:!0})};window.registerThemePropertiesLoader=C;window["sap-ui-webcomponents-bundle"]={configuration:{getAnimationMode:nn,getLanguage:Vt,setLanguage:xe,getTheme:De,setTheme:kt,getNoConflict:mt,setNoConflict:as,getCalendarType:rn,getRTL:Gt,getFirstDayOfWeek:on,getLegacyDateCalendarCustomizing:ln},getIconNames:Ie,parseProperties:sn,registerI18nLoader:Le,getI18nBundle:Js,renderFinished:Ut,applyDirection:hn,EventProvider:K};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as e,u as t,l as o}from"../../Boot.102b63b1.js";e(()=>{console.log("Listener1: after framework booted!")});e(()=>{console.log("Listener2: after framework booted!")});e(()=>{console.log("Listener3: after framework booted!")});const r={registerThemePropsAndBoot:()=>{t("@ui5/webcomponents-theming","sap_fiori_3",()=>({content:":root{ --var1: red; }",packageName:"",fileName:""})),console.log("Booting..."),o(),o(),o(),o(),o(),o()}};window["sap-ui-webcomponents-bundle"]=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../Boot.102b63b1.js";import"../../bundle.esm.2e297622.js";const s=async()=>{["de","es","fr","en"].forEach(e=>window["sap-ui-webcomponents-bundle"].registerI18nLoader("myApp",e,()=>`./assets/messagebundle_${e}.properties`));const n=(await window["sap-ui-webcomponents-bundle"].getI18nBundle("myApp")).getText("PLEASE_WAIT");console.log("Please wait in the current language is: ",n)};s();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../Boot.102b63b1.js";import"../../bundle.esm.2e297622.js";const a=async()=>{window["sap-ui-webcomponents-bundle"].configuration.setLanguage("fr");const s=["test_1","test_2","test_3","test_4","test_5","test_6","test_7","test_8","test_9"];window["sap-ui-webcomponents-bundle"].registerI18nLoader("myApp","fr",async e=>{const t=await(await fetch(`./assets/messagebundle_${e}.properties`)).text();return window["sap-ui-webcomponents-bundle"].parseProperties(t)});const r=await window["sap-ui-webcomponents-bundle"].getI18nBundle("myApp");s.forEach(e=>{const t=r.getText(e.toUpperCase(),"test"),n=document.getElementById(`${e}_text`);n.innerText=t}),s.forEach(e=>{const t=document.getElementById(`${e}_text`),n=document.getElementById(`${e}_result`);if(t.innerText!==n.innerText){const o=n.parentElement;o.style.textDecoration="underline",o.style.color="red"}})};a();
|
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
*/
|
|
7
7
|
const customElement = (tagNameOrComponentSettings) => {
|
|
8
8
|
return (target) => {
|
|
9
|
-
if (!Object.prototype.hasOwnProperty.call(target, "
|
|
10
|
-
target.
|
|
9
|
+
if (!Object.prototype.hasOwnProperty.call(target, "metadata")) {
|
|
10
|
+
target.metadata = {};
|
|
11
11
|
}
|
|
12
12
|
if (typeof tagNameOrComponentSettings === "string") {
|
|
13
|
-
target.
|
|
13
|
+
target.metadata.tag = tagNameOrComponentSettings;
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
16
|
const { tag, languageAware = false, themeAware = false, fastNavigation = false, } = tagNameOrComponentSettings;
|
|
17
|
-
target.
|
|
18
|
-
target.
|
|
19
|
-
target.
|
|
20
|
-
target.
|
|
17
|
+
target.metadata.tag = tag;
|
|
18
|
+
target.metadata.languageAware = languageAware;
|
|
19
|
+
target.metadata.themeAware = themeAware;
|
|
20
|
+
target.metadata.fastNavigation = fastNavigation;
|
|
21
21
|
["render", "renderer", "template", "staticAreaTemplate", "styles", "staticAreaStyles", "dependencies"].forEach((customElementEntity) => {
|
|
22
22
|
const _customElementEntity = customElementEntity === "render" ? "renderer" : customElementEntity;
|
|
23
23
|
const customElementEntityValue = tagNameOrComponentSettings[_customElementEntity];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customElement.js","sourceRoot":"","sources":["../../src/decorators/customElement.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,MAAM,aAAa,GAAG,CAAC,0BAWtB,EAAkB,EAAE;IACpB,OAAO,CAAC,MAAW,EAAE,EAAE;QACtB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"customElement.js","sourceRoot":"","sources":["../../src/decorators/customElement.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,MAAM,aAAa,GAAG,CAAC,0BAWtB,EAAkB,EAAE;IACpB,OAAO,CAAC,MAAW,EAAE,EAAE;QACtB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE;YAC9D,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC;SACrB;QAED,IAAI,OAAO,0BAA0B,KAAK,QAAQ,EAAE;YACnD,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,0BAA0B,CAAC;YACjD,OAAO;SACP;QAED,MAAM,EACL,GAAG,EACH,aAAa,GAAG,KAAK,EACrB,UAAU,GAAG,KAAK,EAClB,cAAc,GAAG,KAAK,GACrB,GAAG,0BAA0B,CAAC;QAEhC,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,GAAG,CAAC;QAC1B,MAAM,CAAC,QAAQ,CAAC,aAAa,GAAG,aAAa,CAAC;QAC9C,MAAM,CAAC,QAAQ,CAAC,UAAU,GAAG,UAAU,CAAC;QACxC,MAAM,CAAC,QAAQ,CAAC,cAAc,GAAG,cAAc,CAAC;QAEhD,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,oBAAoB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,mBAA2B,EAAE,EAAE;YAC9I,MAAM,oBAAoB,GAAG,mBAAmB,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,mBAAmB,CAAC;YACjG,MAAM,wBAAwB,GAAG,0BAA0B,CAAC,oBAAwC,CAAC,CAAC;YAEtG,wBAAwB,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,mBAAmB,EAAE;gBAC9E,GAAG,EAAE,GAAG,EAAE,CAAC,wBAAwB;aACnC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
package/dist/decorators/event.js
CHANGED
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
*/
|
|
8
8
|
const event = (name, data = {}) => {
|
|
9
9
|
return (target) => {
|
|
10
|
-
if (!Object.prototype.hasOwnProperty.call(target, "
|
|
11
|
-
target.
|
|
10
|
+
if (!Object.prototype.hasOwnProperty.call(target, "metadata")) {
|
|
11
|
+
target.metadata = {};
|
|
12
12
|
}
|
|
13
|
-
const
|
|
14
|
-
if (!
|
|
15
|
-
|
|
13
|
+
const metadata = target.metadata;
|
|
14
|
+
if (!metadata.events) {
|
|
15
|
+
metadata.events = {};
|
|
16
16
|
}
|
|
17
|
-
const eventsMetadata =
|
|
17
|
+
const eventsMetadata = metadata.events;
|
|
18
18
|
if (!eventsMetadata[name]) {
|
|
19
19
|
eventsMetadata[name] = data;
|
|
20
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.js","sourceRoot":"","sources":["../../src/decorators/event.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,OAAkB,EAAE,EAAkB,EAAE;IACpE,OAAO,CAAC,MAAW,EAAE,EAAE;QACtB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"event.js","sourceRoot":"","sources":["../../src/decorators/event.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,OAAkB,EAAE,EAAkB,EAAE;IACpE,OAAO,CAAC,MAAW,EAAE,EAAE;QACtB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE;YAC9D,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC;SACrB;QAED,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YACrB,QAAQ,CAAC,MAAM,GAAG,EAAE,CAAC;SACrB;QAED,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC;QACvC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE;YAC1B,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;SAC5B;IACF,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* @returns { void }
|
|
5
5
|
*/
|
|
6
6
|
const fastNavigation = (target) => {
|
|
7
|
-
if (!Object.prototype.hasOwnProperty.call(target, "
|
|
8
|
-
target.
|
|
7
|
+
if (!Object.prototype.hasOwnProperty.call(target, "metadata")) {
|
|
8
|
+
target.metadata = {};
|
|
9
9
|
}
|
|
10
|
-
target.
|
|
10
|
+
target.metadata.fastNavigation = true;
|
|
11
11
|
};
|
|
12
12
|
export default fastNavigation;
|
|
13
13
|
//# sourceMappingURL=fastNavigation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fastNavigation.js","sourceRoot":"","sources":["../../src/decorators/fastNavigation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,cAAc,GAAG,CAAC,MAAW,EAAQ,EAAE;IAC5C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"fastNavigation.js","sourceRoot":"","sources":["../../src/decorators/fastNavigation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,cAAc,GAAG,CAAC,MAAW,EAAQ,EAAE;IAC5C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE;QAC9D,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC;KACrB;IAED,MAAM,CAAC,QAAQ,CAAC,cAAc,GAAG,IAAI,CAAC;AACvC,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* @returns { void }
|
|
5
5
|
*/
|
|
6
6
|
const languageAware = (target) => {
|
|
7
|
-
if (!Object.prototype.hasOwnProperty.call(target, "
|
|
8
|
-
target.
|
|
7
|
+
if (!Object.prototype.hasOwnProperty.call(target, "metadata")) {
|
|
8
|
+
target.metadata = {};
|
|
9
9
|
}
|
|
10
|
-
target.
|
|
10
|
+
target.metadata.languageAware = true;
|
|
11
11
|
};
|
|
12
12
|
export default languageAware;
|
|
13
13
|
//# sourceMappingURL=languageAware.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"languageAware.js","sourceRoot":"","sources":["../../src/decorators/languageAware.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,aAAa,GAAG,CAAC,MAAW,EAAQ,EAAE;IAC3C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"languageAware.js","sourceRoot":"","sources":["../../src/decorators/languageAware.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,aAAa,GAAG,CAAC,MAAW,EAAQ,EAAE;IAC3C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE;QAC9D,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC;KACrB;IAED,MAAM,CAAC,QAAQ,CAAC,aAAa,GAAG,IAAI,CAAC;AACtC,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
const property = (propData) => {
|
|
8
8
|
return (target, propertyKey) => {
|
|
9
9
|
const ctor = target.constructor;
|
|
10
|
-
if (!Object.prototype.hasOwnProperty.call(ctor, "
|
|
11
|
-
ctor.
|
|
10
|
+
if (!Object.prototype.hasOwnProperty.call(ctor, "metadata")) {
|
|
11
|
+
ctor.metadata = {};
|
|
12
12
|
}
|
|
13
|
-
const
|
|
14
|
-
if (!
|
|
15
|
-
|
|
13
|
+
const metadata = ctor.metadata;
|
|
14
|
+
if (!metadata.properties) {
|
|
15
|
+
metadata.properties = {};
|
|
16
16
|
}
|
|
17
|
-
const propsMetadata =
|
|
17
|
+
const propsMetadata = metadata.properties;
|
|
18
18
|
if (!propsMetadata[propertyKey]) {
|
|
19
19
|
propsMetadata[propertyKey] = propData || { type: String };
|
|
20
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property.js","sourceRoot":"","sources":["../../src/decorators/property.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,QAAQ,GAAG,CAAC,QAAmB,EAAqB,EAAE;IAC3D,OAAO,CAAC,MAAW,EAAE,WAA4B,EAAE,EAAE;QACpD,MAAM,IAAI,GAAG,MAAM,CAAC,WAAgC,CAAC;QAErD,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"property.js","sourceRoot":"","sources":["../../src/decorators/property.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,QAAQ,GAAG,CAAC,QAAmB,EAAqB,EAAE;IAC3D,OAAO,CAAC,MAAW,EAAE,WAA4B,EAAE,EAAE;QACpD,MAAM,IAAI,GAAG,MAAM,CAAC,WAAgC,CAAC;QAErD,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE;YAC5D,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;SACnB;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;YACzB,QAAQ,CAAC,UAAU,GAAG,EAAE,CAAC;SACzB;QAED,MAAM,aAAa,GAAG,QAAQ,CAAC,UAAU,CAAC;QAC1C,IAAI,CAAC,aAAa,CAAC,WAAqB,CAAC,EAAE;YAC1C,aAAa,CAAC,WAAqB,CAAC,GAAG,QAAQ,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;SACpE;IACF,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
package/dist/decorators/slot.js
CHANGED
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
const slot = (slotData) => {
|
|
8
8
|
return (target, slotKey) => {
|
|
9
9
|
const ctor = target.constructor;
|
|
10
|
-
if (!Object.prototype.hasOwnProperty.call(ctor, "
|
|
11
|
-
ctor.
|
|
10
|
+
if (!Object.prototype.hasOwnProperty.call(ctor, "metadata")) {
|
|
11
|
+
ctor.metadata = {};
|
|
12
12
|
}
|
|
13
|
-
const
|
|
14
|
-
if (!
|
|
15
|
-
|
|
13
|
+
const metadata = ctor.metadata;
|
|
14
|
+
if (!metadata.slots) {
|
|
15
|
+
metadata.slots = {};
|
|
16
16
|
}
|
|
17
|
-
const slotMetadata =
|
|
17
|
+
const slotMetadata = metadata.slots;
|
|
18
18
|
if (slotData?.default && slotMetadata.default) {
|
|
19
19
|
throw new Error("Only one slot can be the default slot.");
|
|
20
20
|
}
|
|
@@ -30,7 +30,7 @@ const slot = (slotData) => {
|
|
|
30
30
|
delete slotMetadata.default.default;
|
|
31
31
|
slotMetadata.default.propertyName = slotKey;
|
|
32
32
|
}
|
|
33
|
-
ctor.
|
|
33
|
+
ctor.metadata.managedSlots = true;
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
36
|
export default slot;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slot.js","sourceRoot":"","sources":["../../src/decorators/slot.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,IAAI,GAAG,CAAC,QAAe,EAAqB,EAAE;IACnD,OAAO,CAAC,MAAW,EAAE,OAAwB,EAAE,EAAE;QAChD,MAAM,IAAI,GAAG,MAAM,CAAC,WAAgC,CAAC;QAErD,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"slot.js","sourceRoot":"","sources":["../../src/decorators/slot.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,IAAI,GAAG,CAAC,QAAe,EAAqB,EAAE;IACnD,OAAO,CAAC,MAAW,EAAE,OAAwB,EAAE,EAAE;QAChD,MAAM,IAAI,GAAG,MAAM,CAAC,WAAgC,CAAC;QAErD,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE;YAC5D,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;SACnB;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE;YACpB,QAAQ,CAAC,KAAK,GAAG,EAAE,CAAC;SACpB;QAED,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC;QAEpC,IAAI,QAAQ,EAAE,OAAO,IAAI,YAAY,CAAC,OAAO,EAAE;YAC9C,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;SAC1D;QAED,MAAM,GAAG,GAAG,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAiB,CAAC;QAC9D,QAAQ,GAAG,QAAQ,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;QAE7C,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;YACnB,QAAQ,CAAC,IAAI,GAAG,WAAW,CAAC;SAC5B;QAED,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE;YACvB,YAAY,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;SAC7B;QAED,IAAI,QAAQ,CAAC,OAAO,EAAE;YACrB,OAAO,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC;YACpC,YAAY,CAAC,OAAO,CAAC,YAAY,GAAG,OAAiB,CAAC;SACtD;QAED,IAAI,CAAC,QAAQ,CAAC,YAAY,GAAG,IAAI,CAAC;IACnC,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* @returns { void }
|
|
5
5
|
*/
|
|
6
6
|
const themeAware = (target) => {
|
|
7
|
-
if (!Object.prototype.hasOwnProperty.call(target, "
|
|
8
|
-
target.
|
|
7
|
+
if (!Object.prototype.hasOwnProperty.call(target, "metadata")) {
|
|
8
|
+
target.metadata = {};
|
|
9
9
|
}
|
|
10
|
-
target.
|
|
10
|
+
target.metadata.themeAware = true;
|
|
11
11
|
};
|
|
12
12
|
export default themeAware;
|
|
13
13
|
//# sourceMappingURL=themeAware.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themeAware.js","sourceRoot":"","sources":["../../src/decorators/themeAware.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,GAAG,CAAC,MAAW,EAAQ,EAAE;IACxC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"themeAware.js","sourceRoot":"","sources":["../../src/decorators/themeAware.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,GAAG,CAAC,MAAW,EAAQ,EAAE;IACxC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE;QAC9D,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC;KACrB;IAED,MAAM,CAAC,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC;AACnC,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
<title>Base package default test page</title>
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
<script type="module" crossorigin src="/assets/
|
|
9
|
+
<script type="module" crossorigin src="/assets/Boot.102b63b1.js"></script>
|
|
10
|
+
<script type="module" crossorigin src="/assets/bundle.esm.2e297622.js"></script>
|
|
10
11
|
</head>
|
|
11
12
|
|
|
12
13
|
<body>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>Test theme loading and attachBoot</title>
|
|
6
|
+
<script>delete Document.prototype.adoptedStyleSheets</script>
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<script type="module" crossorigin src="/assets/test/pages/Boot.html.b9409297.js"></script>
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/Boot.102b63b1.js">
|
|
11
|
+
<link rel="stylesheet" href="/assets/Boot.6335ce08.css">
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
|
|
15
|
+
<div class="content">When styles are applied, this text shoul be red.</div>
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
<script type="module" crossorigin src="/assets/
|
|
10
|
+
<script type="module" crossorigin src="/assets/Boot.102b63b1.js"></script>
|
|
11
|
+
<script type="module" crossorigin src="/assets/bundle.esm.2e297622.js"></script>
|
|
11
12
|
</head>
|
|
12
13
|
|
|
13
14
|
<body>
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
<script type="module" crossorigin src="/assets/
|
|
43
|
+
<script type="module" crossorigin src="/assets/Boot.102b63b1.js"></script>
|
|
44
|
+
<script type="module" crossorigin src="/assets/bundle.esm.2e297622.js"></script>
|
|
44
45
|
</head>
|
|
45
46
|
|
|
46
47
|
<body>
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<title>Compex Template Test Page</title>
|
|
6
6
|
|
|
7
|
-
<script type="module" crossorigin src="/assets/
|
|
7
|
+
<script type="module" crossorigin src="/assets/Boot.102b63b1.js"></script>
|
|
8
|
+
<script type="module" crossorigin src="/assets/bundle.esm.2e297622.js"></script>
|
|
8
9
|
</head>
|
|
9
10
|
|
|
10
11
|
<body>
|
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
<script type="module" crossorigin src="/assets/test/pages/i18n.html.
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
10
|
+
<script type="module" crossorigin src="/assets/test/pages/i18n.html.2e75e108.js"></script>
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/Boot.102b63b1.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/bundle.esm.2e297622.js">
|
|
12
13
|
</head>
|
|
13
14
|
|
|
14
15
|
<body>
|
|
@@ -8,8 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
<script type="module" crossorigin src="/assets/test/pages/i18n_texts.html.
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
11
|
+
<script type="module" crossorigin src="/assets/test/pages/i18n_texts.html.7dbd4f97.js"></script>
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/Boot.102b63b1.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/bundle.esm.2e297622.js">
|
|
13
14
|
</head>
|
|
14
15
|
|
|
15
16
|
<body>
|
|
@@ -394,6 +394,5 @@ declare const getClassCopy: (klass: typeof UI5Element, constructorCallback: () =
|
|
|
394
394
|
onDefine(): Promise<void>;
|
|
395
395
|
define(): Promise<typeof UI5Element>;
|
|
396
396
|
getMetadata(): import("../UI5ElementMetadata.js").default;
|
|
397
|
-
decoratorMetadata: import("../UI5ElementMetadata.js").Metadata;
|
|
398
397
|
};
|
|
399
398
|
export default getClassCopy;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/webcomponents-base",
|
|
3
|
-
"version": "1.11.0
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "UI5 Web Components: webcomponents.base",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@buxlabs/amd-to-es6": "0.16.1",
|
|
38
38
|
"@openui5/sap.ui.core": "1.109.0",
|
|
39
|
-
"@ui5/webcomponents-tools": "1.11.0
|
|
39
|
+
"@ui5/webcomponents-tools": "1.11.0",
|
|
40
40
|
"chromedriver": "109.0.0",
|
|
41
41
|
"clean-css": "^5.2.2",
|
|
42
42
|
"copy-and-watch": "^0.1.5",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"replace-in-file": "^6.3.5",
|
|
47
47
|
"resolve": "^1.20.0"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "816b5b6293ca3b56e461126eb77a3a1f238efdc0"
|
|
50
50
|
}
|
package/src/Boot.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import whenDOMReady from "./util/whenDOMReady.js";
|
|
2
|
+
import EventProvider from "./EventProvider.js";
|
|
2
3
|
import insertFontFace from "./FontFace.js";
|
|
3
4
|
import insertSystemCSSVars from "./SystemCSSVars.js";
|
|
4
5
|
import { getTheme } from "./config/Theme.js";
|
|
@@ -9,15 +10,22 @@ import type OpenUI5Support from "./features/OpenUI5Support.js";
|
|
|
9
10
|
import type F6Navigation from "./features/F6Navigation.js";
|
|
10
11
|
import { PromiseResolve } from "./types.js";
|
|
11
12
|
|
|
13
|
+
let booted = false;
|
|
12
14
|
let bootPromise: Promise<void>;
|
|
15
|
+
const eventProvider = new EventProvider<void, void>();
|
|
13
16
|
|
|
14
17
|
/**
|
|
15
|
-
*
|
|
18
|
+
* Attaches a callback that will be executed after boot finishes.
|
|
19
|
+
* <b>Note:</b> If the framework already booted, the callback will be immediately executed.
|
|
16
20
|
* @public
|
|
17
|
-
* @param listener
|
|
21
|
+
* @param { Function } listener
|
|
18
22
|
*/
|
|
19
|
-
const attachBoot =
|
|
20
|
-
|
|
23
|
+
const attachBoot = (listener: () => void) => {
|
|
24
|
+
if (!booted) {
|
|
25
|
+
eventProvider.attachEvent("boot", listener);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
21
29
|
listener();
|
|
22
30
|
};
|
|
23
31
|
|
|
@@ -31,6 +39,7 @@ const boot = async (): Promise<void> => {
|
|
|
31
39
|
resolve();
|
|
32
40
|
return;
|
|
33
41
|
}
|
|
42
|
+
|
|
34
43
|
registerCurrentRuntime();
|
|
35
44
|
|
|
36
45
|
const openUI5Support = getFeature<typeof OpenUI5Support>("OpenUI5Support");
|
|
@@ -52,10 +61,12 @@ const boot = async (): Promise<void> => {
|
|
|
52
61
|
insertSystemCSSVars();
|
|
53
62
|
|
|
54
63
|
resolve();
|
|
64
|
+
|
|
65
|
+
booted = true;
|
|
66
|
+
await eventProvider.fireEventAsync("boot");
|
|
55
67
|
};
|
|
56
68
|
|
|
57
69
|
bootPromise = new Promise(bootExecutor as (resolve: PromiseResolve) => void);
|
|
58
|
-
|
|
59
70
|
return bootPromise;
|
|
60
71
|
};
|
|
61
72
|
|
package/src/UI5Element.ts
CHANGED
|
@@ -77,8 +77,6 @@ function _invalidate(this: UI5Element, changeInfo: ChangeInfo) {
|
|
|
77
77
|
this._eventProvider.fireEvent("invalidate", { ...changeInfo, target: this });
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
let metadata = {} as Metadata;
|
|
81
|
-
|
|
82
80
|
/**
|
|
83
81
|
* Base class for all UI5 Web Components
|
|
84
82
|
*
|
|
@@ -1029,17 +1027,7 @@ abstract class UI5Element extends HTMLElement {
|
|
|
1029
1027
|
* Returns the metadata object for this UI5 Web Component Class
|
|
1030
1028
|
* @protected
|
|
1031
1029
|
*/
|
|
1032
|
-
static
|
|
1033
|
-
return metadata;
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
|
-
/**
|
|
1037
|
-
* Sets a new metadata object for this UI5 Web Component Class
|
|
1038
|
-
* @protected
|
|
1039
|
-
*/
|
|
1040
|
-
static set metadata(newMetadata) {
|
|
1041
|
-
metadata = newMetadata;
|
|
1042
|
-
}
|
|
1030
|
+
static metadata: Metadata = {};
|
|
1043
1031
|
|
|
1044
1032
|
/**
|
|
1045
1033
|
* Returns the CSS for this UI5 Web Component Class
|
|
@@ -1141,21 +1129,17 @@ abstract class UI5Element extends HTMLElement {
|
|
|
1141
1129
|
return this._metadata;
|
|
1142
1130
|
}
|
|
1143
1131
|
|
|
1144
|
-
const
|
|
1145
|
-
const metadataObjects = [effectiveMetadata];
|
|
1132
|
+
const metadataObjects = [this.metadata];
|
|
1146
1133
|
let klass = this; // eslint-disable-line
|
|
1147
1134
|
while (klass !== UI5Element) {
|
|
1148
1135
|
klass = Object.getPrototypeOf(klass);
|
|
1149
|
-
|
|
1150
|
-
metadataObjects.unshift(effectiveKlassMetadata);
|
|
1136
|
+
metadataObjects.unshift(klass.metadata);
|
|
1151
1137
|
}
|
|
1152
1138
|
const mergedMetadata = merge({}, ...metadataObjects) as Metadata;
|
|
1153
1139
|
|
|
1154
1140
|
this._metadata = new UI5ElementMetadata(mergedMetadata);
|
|
1155
1141
|
return this._metadata;
|
|
1156
1142
|
}
|
|
1157
|
-
|
|
1158
|
-
static decoratorMetadata: Metadata = {};
|
|
1159
1143
|
}
|
|
1160
1144
|
|
|
1161
1145
|
/**
|