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

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

{"version":3,"file":"OpenUI5Enablement.js","sourceRoot":"","sources":["../../src/features/OpenUI5Enablement.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,mBAAmB,MAAM,uCAAuC,CAAC;AACxE,OAAO,KAAK,MAAM,wBAAwB,CAAC;AAC3C,OAAO,EACN,aAAa,GACb,MAAM,YAAY,CAAC;AAKpB,MAAM,qBAAqB,GAAG;IAC7B,UAAU,EAAE;QACX,QAAQ,EAAE;YACT,IAAI,EAAE,OAAO;SACb;KACD;CACD,CAAC;AAEF,MAAM,iBAAiB;IACtB,MAAM,CAAC,8BAA8B,CAAC,IAAkF,EAAE,IAAoB,EAAE,cAA8B;QAC7K,IAAI,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,QAAQ,EAAE;YAC7C,cAAc,GAAG,IAAI,CAAA;;6DAEqC,IAAI,CAAC,iBAAiB;MAC7E,cAAc;;;;;;gBAMJ,IAAI,CAAC,mBAAmB;;;;;;;;;;UAU9B,CAAC;SACR;QAED,OAAO,cAAc,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,2BAA2B,CAAC,KAAwB;QAC1D,iBAAiB,CAAC,2BAA2B,CAAC,KAAK,CAAC,CAAC;QACrD,iBAAiB,CAAC,0BAA0B,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC/D,CAAC;IAED,MAAM,CAAC,2BAA2B,CAAC,KAAwB;QAC1D,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,qBAAqB,CAAC,CAAC;IAC/D,CAAC;IAED,MAAM,CAAC,0BAA0B,CAAC,mBAAoD;QACrF,MAAM,CAAC,gBAAgB,CAAC,mBAAmB,EAAE;YAC5C,iBAAiB,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,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AAC,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;YAE7G,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC1B,OAAO,CAAC,IAAI,CAAC,sBAAuB,IAAI,CAAC,WAAiC,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,uFAAuF,CAAC,CAAC,CAAC,sBAAsB;aACjN;YAED,IAAI,IAAI,CAAC,QAAQ,EAAE;gBAClB,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,0HAA0H,CAAgB,CAAC;aAC5K;YAED,OAAO,QAAQ,CAAC,CAAC,CAAgB,CAAC;QACnC,CAAC,CAAC;IACH,CAAC;IAED,MAAM,CAAC,sBAAsB;QAC5B,OAAO,mBAAmB,CAAC;IAC5B,CAAC;CACD;AAED,eAAe,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAC;AAExD,eAAe,iBAAiB,CAAC","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"]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy