All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.prod.features.OpenUI5Enablement.js.map Maven / Gradle / Ivy

{
  "version": 3,
  "sources": ["../../../src/features/OpenUI5Enablement.ts"],
  "sourcesContent": ["import type { TemplateResult } from \"lit-html\";\nimport { registerFeature } from \"../FeaturesRegistry.js\";\nimport BusyIndicatorStyles from \"../generated/css/BusyIndicator.css.js\";\nimport merge from \"../thirdparty/merge.js\";\nimport {\n\tisTabPrevious,\n} from \"../Keys.js\";\n\nimport type UI5Element from \"../UI5Element.js\";\nimport type OpenUI5Element from \"./OpenUI5Element.js\";\n\nconst busyIndicatorMetadata = {\n\tproperties: {\n\t\t__isBusy: {\n\t\t\ttype: Boolean,\n\t\t},\n\t},\n};\n\nclass OpenUI5Enablement {\n\tstatic wrapTemplateResultInBusyMarkup(html: (strings: TemplateStringsArray, ...values: Array) => TemplateResult, host: OpenUI5Element, templateResult: TemplateResult) {\n\t\tif (host.isOpenUI5Component && host.__isBusy) {\n\t\t\ttemplateResult = html`\n\t\t\t
\n\t\t\t\t\n\t\t\t\t${templateResult}\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
`;\n\t\t}\n\n\t\treturn templateResult;\n\t}\n\n\tstatic enrichBusyIndicatorSettings(klass: typeof UI5Element) {\n\t\tOpenUI5Enablement.enrichBusyIndicatorMetadata(klass);\n\t\tOpenUI5Enablement.enrichBusyIndicatorMethods(klass.prototype);\n\t}\n\n\tstatic enrichBusyIndicatorMetadata(klass: typeof UI5Element) {\n\t\tklass.metadata = merge(klass.metadata, busyIndicatorMetadata);\n\t}\n\n\tstatic enrichBusyIndicatorMethods(UI5ElementPrototype: typeof OpenUI5Element.prototype) {\n\t\tObject.defineProperties(UI5ElementPrototype, {\n\t\t\t\"__redirectFocus\": { value: true, writable: true },\n\t\t\t\"__suppressFocusBack\": {\n\t\t\t\tget() {\n\t\t\t\t\treturn {\n\t\t\t\t\t\thandleEvent: (e: KeyboardEvent) => {\n\t\t\t\t\t\t\tif (isTabPrevious(e)) {\n\t\t\t\t\t\t\t\tconst beforeElem = this.shadowRoot.querySelector(\"[busy-indicator-before-span]\");\n\t\t\t\t\t\t\t\tthis.__redirectFocus = false;\n\t\t\t\t\t\t\t\tbeforeElem.focus();\n\t\t\t\t\t\t\t\tthis.__redirectFocus = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcapture: true,\n\t\t\t\t\t\tpassive: false,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t},\n\t\t\t\"isOpenUI5Component\": { get: () => { return true; } },\n\t\t});\n\n\t\tUI5ElementPrototype.__suppressFocusIn = function handleFocusIn() {\n\t\t\tconst busyIndicator = this.shadowRoot?.querySelector(\"[busy-indicator]\") as HTMLElement;\n\t\t\tif (busyIndicator && this.__redirectFocus) {\n\t\t\t\tbusyIndicator.focus();\n\t\t\t}\n\t\t};\n\n\t\tUI5ElementPrototype.getDomRef = function getDomRef() {\n\t\t\t// If a component set _getRealDomRef to its children, use the return value of this function\n\t\t\tif (typeof this._getRealDomRef === \"function\") {\n\t\t\t\treturn this._getRealDomRef();\n\t\t\t}\n\n\t\t\tif (!this.shadowRoot || this.shadowRoot.children.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst children = [...this.shadowRoot.children].filter(child => ![\"link\", \"style\"].includes(child.localName));\n\n\t\t\tif (children.length !== 1) {\n\t\t\t\tconsole.warn(`The shadow DOM for ${(this.constructor as typeof UI5Element).getMetadata().getTag()} does not have a top level element, the getDomRef() method might not work as expected`); // eslint-disable-line\n\t\t\t}\n\n\t\t\tif (this.__isBusy) {\n\t\t\t\treturn children[0].querySelector(\".busy-indicator-wrapper > :not([busy-indicator-before-span]):not(.busy-indicator-overlay):not(.busy-indicator-busy-area)\") as HTMLElement;\n\t\t\t}\n\n\t\t\treturn children[0] as HTMLElement;\n\t\t};\n\t}\n\n\tstatic getBusyIndicatorStyles() {\n\t\treturn BusyIndicatorStyles;\n\t}\n}\n\nregisterFeature(\"OpenUI5Enablement\", OpenUI5Enablement);\n\nexport default OpenUI5Enablement;\n"], "mappings": "aACA,OAAS,mBAAAA,MAAuB,yBAChC,OAAOC,MAAyB,wCAChC,OAAOC,MAAW,yBAClB,OACC,iBAAAC,MACM,aAKP,MAAMC,EAAwB,CAC7B,WAAY,CACX,SAAU,CACT,KAAM,OACP,CACD,CACD,EAEA,MAAMC,CAAkB,CACvB,OAAO,+BAA+BC,EAAoFC,EAAsBC,EAAgC,CAC/K,OAAID,EAAK,oBAAsBA,EAAK,WACnCC,EAAiBF;AAAA;AAAA,6DAEyCC,EAAK,iBAAiB;AAAA,MAC7EC,CAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAMJD,EAAK,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAa/BC,CACR,CAEA,OAAO,4BAA4BC,EAA0B,CAC5DJ,EAAkB,4BAA4BI,CAAK,EACnDJ,EAAkB,2BAA2BI,EAAM,SAAS,CAC7D,CAEA,OAAO,4BAA4BA,EAA0B,CAC5DA,EAAM,SAAWP,EAAMO,EAAM,SAAUL,CAAqB,CAC7D,CAEA,OAAO,2BAA2BM,EAAsD,CACvF,OAAO,iBAAiBA,EAAqB,CAC5C,gBAAmB,CAAE,MAAO,GAAM,SAAU,EAAK,EACjD,oBAAuB,CACtB,KAAM,CACL,MAAO,CACN,YAAcC,GAAqB,CAClC,GAAIR,EAAcQ,CAAC,EAAG,CACrB,MAAMC,EAAa,KAAK,WAAW,cAAc,8BAA8B,EAC/E,KAAK,gBAAkB,GACvBA,EAAW,MAAM,EACjB,KAAK,gBAAkB,EACxB,CACD,EACA,QAAS,GACT,QAAS,EACV,CACD,CACD,EACA,mBAAsB,CAAE,IAAK,IAAe,EAAQ,CACrD,CAAC,EAEDF,EAAoB,kBAAoB,UAAyB,CAChE,MAAMG,EAAgB,KAAK,YAAY,cAAc,kBAAkB,EACnEA,GAAiB,KAAK,iBACzBA,EAAc,MAAM,CAEtB,EAEAH,EAAoB,UAAY,UAAqB,CAEpD,GAAI,OAAO,KAAK,gBAAmB,WAClC,OAAO,KAAK,eAAe,EAG5B,GAAI,CAAC,KAAK,YAAc,KAAK,WAAW,SAAS,SAAW,EAC3D,OAGD,MAAMI,EAAW,CAAC,GAAG,KAAK,WAAW,QAAQ,EAAE,OAAOC,GAAS,CAAC,CAAC,OAAQ,OAAO,EAAE,SAASA,EAAM,SAAS,CAAC,EAM3G,OAJID,EAAS,SAAW,GACvB,QAAQ,KAAK,sBAAuB,KAAK,YAAkC,YAAY,EAAE,OAAO,CAAC,uFAAuF,EAGrL,KAAK,SACDA,EAAS,CAAC,EAAE,cAAc,0HAA0H,EAGrJA,EAAS,CAAC,CAClB,CACD,CAEA,OAAO,wBAAyB,CAC/B,OAAOb,CACR,CACD,CAEAD,EAAgB,oBAAqBK,CAAiB,EAEtD,eAAeA", "names": ["registerFeature", "BusyIndicatorStyles", "merge", "isTabPrevious", "busyIndicatorMetadata", "OpenUI5Enablement", "html", "host", "templateResult", "klass", "UI5ElementPrototype", "e", "beforeElem", "busyIndicator", "children", "child"] }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy