@ui5/webcomponents-base 2.0.0-rc.4 → 2.0.0-rc.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +1 -1
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/Boot.js.map +1 -1
  5. package/dist/CustomElementsRegistry.js.map +1 -1
  6. package/dist/InitialConfiguration.d.ts +1 -1
  7. package/dist/InitialConfiguration.js.map +1 -1
  8. package/dist/ManagedStyles.d.ts +1 -1
  9. package/dist/ManagedStyles.js.map +1 -1
  10. package/dist/Render.js.map +1 -1
  11. package/dist/UI5Element.d.ts +2 -1
  12. package/dist/UI5Element.js +4 -1
  13. package/dist/UI5Element.js.map +1 -1
  14. package/dist/UI5ElementMetadata.d.ts +1 -1
  15. package/dist/UI5ElementMetadata.js.map +1 -1
  16. package/dist/connectToComponent.js.map +1 -1
  17. package/dist/decorators/property.d.ts +1 -1
  18. package/dist/decorators/property.js.map +1 -1
  19. package/dist/decorators/slot.d.ts +1 -1
  20. package/dist/decorators/slot.js.map +1 -1
  21. package/dist/features/F6Navigation.js +1 -1
  22. package/dist/features/F6Navigation.js.map +1 -1
  23. package/dist/features/OpenUI5Enablement.d.ts +1 -1
  24. package/dist/features/OpenUI5Enablement.js.map +1 -1
  25. package/dist/features/OpenUI5Support.d.ts +1 -1
  26. package/dist/features/OpenUI5Support.js.map +1 -1
  27. package/dist/features/patchPopup.d.ts +1 -0
  28. package/dist/features/patchPopup.js +11 -0
  29. package/dist/features/patchPopup.js.map +1 -1
  30. package/dist/generated/VersionInfo.js +3 -3
  31. package/dist/generated/VersionInfo.js.map +1 -1
  32. package/dist/prod/Boot.js +1 -1
  33. package/dist/prod/Boot.js.map +1 -1
  34. package/dist/prod/CustomElementsRegistry.js +2 -2
  35. package/dist/prod/CustomElementsRegistry.js.map +1 -1
  36. package/dist/prod/InitialConfiguration.js.map +1 -1
  37. package/dist/prod/ManagedStyles.js +1 -1
  38. package/dist/prod/ManagedStyles.js.map +1 -1
  39. package/dist/prod/Render.js +1 -1
  40. package/dist/prod/Render.js.map +1 -1
  41. package/dist/prod/UI5Element.js +1 -1
  42. package/dist/prod/UI5Element.js.map +2 -2
  43. package/dist/prod/UI5ElementMetadata.js +1 -1
  44. package/dist/prod/UI5ElementMetadata.js.map +1 -1
  45. package/dist/prod/connectToComponent.js +1 -1
  46. package/dist/prod/connectToComponent.js.map +1 -1
  47. package/dist/prod/decorators/property.js +1 -1
  48. package/dist/prod/decorators/property.js.map +1 -1
  49. package/dist/prod/decorators/slot.js +1 -1
  50. package/dist/prod/decorators/slot.js.map +1 -1
  51. package/dist/prod/features/F6Navigation.js +1 -1
  52. package/dist/prod/features/F6Navigation.js.map +2 -2
  53. package/dist/prod/features/OpenUI5Enablement.js.map +1 -1
  54. package/dist/prod/features/OpenUI5Support.js.map +1 -1
  55. package/dist/prod/features/patchPopup.js +1 -1
  56. package/dist/prod/features/patchPopup.js.map +3 -3
  57. package/dist/prod/generated/VersionInfo.js +1 -1
  58. package/dist/prod/generated/VersionInfo.js.map +1 -1
  59. package/dist/prod/renderer/LitRenderer.js +1 -1
  60. package/dist/prod/renderer/LitRenderer.js.map +2 -2
  61. package/dist/prod/theming/getConstructableStyle.js +1 -1
  62. package/dist/prod/theming/getConstructableStyle.js.map +1 -1
  63. package/dist/prod/theming/getEffectiveStyle.js +1 -1
  64. package/dist/prod/theming/getEffectiveStyle.js.map +1 -1
  65. package/dist/prod/types/DataType.js +1 -1
  66. package/dist/prod/types/DataType.js.map +1 -1
  67. package/dist/prod/types/Float.js +1 -1
  68. package/dist/prod/types/Float.js.map +1 -1
  69. package/dist/prod/types/Integer.js +1 -1
  70. package/dist/prod/types/Integer.js.map +1 -1
  71. package/dist/prod/util/AriaLabelHelper.js +1 -1
  72. package/dist/prod/util/AriaLabelHelper.js.map +2 -2
  73. package/dist/prod/util/TabbableElements.js +1 -1
  74. package/dist/prod/util/TabbableElements.js.map +3 -3
  75. package/dist/prod/util/debounce.js +1 -1
  76. package/dist/prod/util/debounce.js.map +1 -1
  77. package/dist/prod/util/dragAndDrop/DragRegistry.js +1 -1
  78. package/dist/prod/util/dragAndDrop/DragRegistry.js.map +2 -2
  79. package/dist/prod/util/isElementTabbable.js +1 -1
  80. package/dist/prod/util/isElementTabbable.js.map +3 -3
  81. package/dist/renderer/LitRenderer.d.ts +1 -1
  82. package/dist/renderer/LitRenderer.js.map +1 -1
  83. package/dist/theming/getConstructableStyle.d.ts +1 -1
  84. package/dist/theming/getConstructableStyle.js.map +1 -1
  85. package/dist/theming/getEffectiveStyle.js.map +1 -1
  86. package/dist/types/DataType.d.ts +1 -1
  87. package/dist/types/DataType.js.map +1 -1
  88. package/dist/types/Float.d.ts +1 -1
  89. package/dist/types/Float.js.map +1 -1
  90. package/dist/types/Integer.d.ts +1 -1
  91. package/dist/types/Integer.js.map +1 -1
  92. package/dist/util/AriaLabelHelper.d.ts +1 -1
  93. package/dist/util/AriaLabelHelper.js.map +1 -1
  94. package/dist/util/TabbableElements.js +3 -10
  95. package/dist/util/TabbableElements.js.map +1 -1
  96. package/dist/util/debounce.js.map +1 -1
  97. package/dist/util/dragAndDrop/DragRegistry.js +0 -2
  98. package/dist/util/dragAndDrop/DragRegistry.js.map +1 -1
  99. package/dist/util/isElementTabbable.js +2 -2
  100. package/dist/util/isElementTabbable.js.map +1 -1
  101. package/package.json +3 -3
@@ -1,4 +1,4 @@
1
- import DataType from "./types/DataType.js";
1
+ import type DataType from "./types/DataType.js";
2
2
  type SlotInvalidation = {
3
3
  properties: boolean | Array<string>;
4
4
  slots: boolean | Array<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"UI5ElementMetadata.js","sourceRoot":"","sources":["../src/UI5ElementMetadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC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YAAY,KAAK,MAAM,EAAE;QAC5B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC;KACjE;IAED,uGAAuG;IACvG,OAAO,KAAe,IAAI,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC;AACxE,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,KAAW,EAAE,QAAc,EAAE,EAAE;IAC1D,KAAK,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;QAC5C,IAAI,CAAC,CAAC,EAAE,YAAY,QAAQ,CAAC,IAAI,CAAC,EAAE;YACnC,MAAM,IAAI,KAAK,CAAC,8BAA8B,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;SAC1E;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import DataType from \"./types/DataType.js\";\nimport { camelToKebabCase } from \"./util/StringHelper.js\";\nimport { getSlottedNodes } from \"./util/SlotsHelper.js\";\nimport { getEffectiveScopingSuffixForTag } from \"./CustomElementsScopeUtils.js\";\n\ntype SlotInvalidation = {\n\tproperties: boolean | Array<string>,\n\tslots: boolean | Array<string>,\n}\n\ntype Slot = {\n\ttype: typeof Node | typeof HTMLElement,\n\tdefault?: boolean,\n\tpropertyName?: string,\n\tindividualSlots?: boolean,\n\tinvalidateOnChildChange?: boolean | SlotInvalidation,\n\tcloned?: boolean,\n};\n\ntype SlotValue = Node;\n\ntype Property = {\n\ttype?: BooleanConstructor | StringConstructor | ObjectConstructor | DataType\n\tvalidator?: DataType,\n\tdefaultValue?: PropertyValue,\n\tnoAttribute?: boolean,\n\tmultiple?: boolean,\n\tcompareValues?: boolean,\n}\n\ntype PropertyValue = boolean | number | string | object | undefined | null | DataType;\n\ntype EventData = Record<string, object>;\n\ntype Metadata = {\n\ttag?: string,\n\tmanagedSlots?: boolean,\n\tproperties?: Record<string, Property>,\n\tslots?: Record<string, Slot>,\n\tevents?: EventData,\n\tfastNavigation?: boolean,\n\tthemeAware?: boolean,\n\tlanguageAware?: boolean,\n\tformAssociated?: boolean,\n\tshadowRootOptions?: Partial<ShadowRootInit>\n};\n\ntype State = Record<string, PropertyValue | Array<SlotValue>>;\n\n/**\n * @class\n * @public\n */\nclass UI5ElementMetadata {\n\tmetadata: Metadata;\n\t_initialState: State | undefined;\n\n\tconstructor(metadata: Metadata) {\n\t\tthis.metadata = metadata;\n\t}\n\n\tgetInitialState() {\n\t\tif (Object.prototype.hasOwnProperty.call(this, \"_initialState\")) {\n\t\t\treturn this._initialState!;\n\t\t}\n\t\tconst initialState: State = {};\n\t\tconst slotsAreManaged = this.slotsAreManaged();\n\n\t\t// Initialize properties\n\t\tconst props = this.getProperties();\n\t\tfor (const propName in props) { // eslint-disable-line\n\t\t\tconst propType = props[propName].type;\n\t\t\tconst propDefaultValue = props[propName].defaultValue;\n\n\t\t\tif (propType === Boolean) {\n\t\t\t\tinitialState[propName] = false;\n\n\t\t\t\tif (propDefaultValue !== undefined) {\n\t\t\t\t\tconsole.warn(\"The 'defaultValue' metadata key is ignored for all booleans properties, they would be initialized with 'false' by default\"); // eslint-disable-line\n\t\t\t\t}\n\t\t\t} else if (props[propName].multiple) {\n\t\t\t\tObject.defineProperty(initialState, propName, {\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tget() {\n\t\t\t\t\t return [];\n\t\t\t\t\t},\n\t\t\t\t });\n\t\t\t} else if (propType === Object) {\n\t\t\t\tObject.defineProperty(initialState, propName, {\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tget() {\n\t\t\t\t\t return \"defaultValue\" in props[propName] ? props[propName].defaultValue : {};\n\t\t\t\t\t},\n\t\t\t\t });\n\t\t\t} else if (propType === String) {\n\t\t\t\tinitialState[propName] = \"defaultValue\" in props[propName] ? props[propName].defaultValue : \"\";\n\t\t\t} else {\n\t\t\t\tinitialState[propName] = propDefaultValue;\n\t\t\t}\n\t\t}\n\n\t\t// Initialize slots\n\t\tif (slotsAreManaged) {\n\t\t\tconst slots = this.getSlots();\n\t\t\tfor (const [slotName, slotData] of Object.entries<Slot>(slots)) { // eslint-disable-line\n\t\t\t\tconst propertyName = slotData.propertyName || slotName;\n\t\t\t\tinitialState[propertyName] = [];\n\t\t\t}\n\t\t}\n\n\t\tthis._initialState = initialState;\n\t\treturn initialState;\n\t}\n\n\t/**\n\t * Validates the property's value and returns it if correct\n\t * or returns the default value if not.\n\t * **Note:** Only intended for use by UI5Element.js\n\t * @public\n\t */\n\tstatic validatePropertyValue(value: PropertyValue, propData: Property): PropertyValue {\n\t\tconst isMultiple = propData.multiple;\n\t\tif (isMultiple && value) {\n\t\t\treturn (value as Array<PropertyValue>).map((propValue: PropertyValue) => validateSingleProperty(propValue, propData));\n\t\t}\n\t\treturn validateSingleProperty(value, propData);\n\t}\n\n\t/**\n\t * Validates the slot's value and returns it if correct\n\t * or throws an exception if not.\n\t * **Note:** Only intended for use by UI5Element.js\n\t * @public\n\t */\n\tstatic validateSlotValue(value: Node, slotData: Slot): Node {\n\t\treturn validateSingleSlot(value, slotData);\n\t}\n\n\t/**\n\t * Returns the tag of the UI5 Element without the scope\n\t * @public\n\t */\n\tgetPureTag(): string {\n\t\treturn this.metadata.tag || \"\";\n\t}\n\n\t/**\n\t * Returns the tag of the UI5 Element\n\t * @public\n\t */\n\tgetTag(): string {\n\t\tconst pureTag = this.metadata.tag;\n\n\t\tif (!pureTag) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\tconst suffix = getEffectiveScopingSuffixForTag(pureTag);\n\t\tif (!suffix) {\n\t\t\treturn pureTag;\n\t\t}\n\n\t\treturn `${pureTag}-${suffix}`;\n\t}\n\n\t/**\n\t * Determines whether a property should have an attribute counterpart\n\t * @public\n\t * @param propName\n\t */\n\thasAttribute(propName: string): boolean {\n\t\tconst propData = this.getProperties()[propName];\n\t\treturn propData.type !== Object && !propData.noAttribute && !propData.multiple;\n\t}\n\n\t/**\n\t * Returns an array with the properties of the UI5 Element (in camelCase)\n\t * @public\n\t */\n\tgetPropertiesList(): Array<string> {\n\t\treturn Object.keys(this.getProperties());\n\t}\n\n\t/**\n\t * Returns an array with the attributes of the UI5 Element (in kebab-case)\n\t * @public\n\t */\n\tgetAttributesList(): Array<string> {\n\t\treturn this.getPropertiesList().filter(this.hasAttribute.bind(this)).map(camelToKebabCase);\n\t}\n\n\t/**\n\t * Determines whether this UI5 Element has a default slot of type Node, therefore can slot text\n\t */\n\tcanSlotText() {\n\t\treturn (this.getSlots().default)?.type === Node;\n\t}\n\n\t/**\n\t * Determines whether this UI5 Element supports any slots\n\t * @public\n\t */\n\thasSlots(): boolean {\n\t\treturn !!Object.entries(this.getSlots()).length;\n\t}\n\n\t/**\n\t * Determines whether this UI5 Element supports any slots with \"individualSlots: true\"\n\t * @public\n\t */\n\thasIndividualSlots(): boolean {\n\t\treturn this.slotsAreManaged() && Object.values(this.getSlots()).some(slotData => slotData.individualSlots);\n\t}\n\n\t/**\n\t * Determines whether this UI5 Element needs to invalidate if children are added/removed/changed\n\t * @public\n\t */\n\tslotsAreManaged(): boolean {\n\t\treturn !!this.metadata.managedSlots;\n\t}\n\n\t/**\n\t * Determines whether this control supports F6 fast navigation\n\t * @public\n\t */\n\tsupportsF6FastNavigation(): boolean {\n\t\treturn !!this.metadata.fastNavigation;\n\t}\n\n\t/**\n\t * Returns an object with key-value pairs of properties and their metadata definitions\n\t * @public\n\t */\n\tgetProperties(): Record<string, Property> {\n\t\tif (!this.metadata.properties) {\n\t\t\tthis.metadata.properties = {};\n\t\t}\n\t\treturn this.metadata.properties;\n\t}\n\n\t/**\n\t * Returns an object with key-value pairs of events and their metadata definitions\n\t * @public\n\t */\n\tgetEvents(): EventData {\n\t\tif (!this.metadata.events) {\n\t\t\tthis.metadata.events = {};\n\t\t}\n\t\treturn this.metadata.events;\n\t}\n\n\t/**\n\t * Returns an object with key-value pairs of slots and their metadata definitions\n\t * @public\n\t */\n\t getSlots(): Record<string, Slot> {\n\t\tif (!this.metadata.slots) {\n\t\t\tthis.metadata.slots = {};\n\t\t}\n\t\treturn this.metadata.slots;\n\t}\n\n\t/**\n\t * Determines whether this UI5 Element has any translatable texts (needs to be invalidated upon language change)\n\t */\n\tisLanguageAware(): boolean {\n\t\treturn !!this.metadata.languageAware;\n\t}\n\n\t/**\n\t * Determines whether this UI5 Element has any theme dependant carachteristics.\n\t */\n\t isThemeAware(): boolean {\n\t\treturn !!this.metadata.themeAware;\n\t}\n\n\tgetShadowRootOptions(): Partial<ShadowRootInit> {\n\t\treturn this.metadata.shadowRootOptions || {};\n\t}\n\n\t/**\n\t * Determines whether this UI5 Element has any theme dependant carachteristics.\n\t */\n\t isFormAssociated(): boolean {\n\t\treturn !!this.metadata.formAssociated;\n\t}\n\n\t/**\n\t * Matches a changed entity (property/slot) with the given name against the \"invalidateOnChildChange\" configuration\n\t * and determines whether this should cause and invalidation\n\t *\n\t * @param slotName the name of the slot in which a child was changed\n\t * @param type the type of change in the child: \"property\" or \"slot\"\n\t * @param name the name of the property/slot that changed\n\t */\n\tshouldInvalidateOnChildChange(slotName: string, type: \"property\" | \"slot\", name: string): boolean {\n\t\tconst config = this.getSlots()[slotName].invalidateOnChildChange;\n\n\t\t// invalidateOnChildChange was not set in the slot metadata - by default child changes do not affect the component\n\t\tif (config === undefined) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// The simple format was used: invalidateOnChildChange: true/false;\n\t\tif (typeof config === \"boolean\") {\n\t\t\treturn config;\n\t\t}\n\n\t\t// The complex format was used: invalidateOnChildChange: { properties, slots }\n\t\tif (typeof config === \"object\") {\n\t\t\t// A property was changed\n\t\t\tif (type === \"property\") {\n\t\t\t\t// The config object does not have a properties field\n\t\t\t\tif (config.properties === undefined) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// The config object has the short format: properties: true/false\n\t\t\t\tif (typeof config.properties === \"boolean\") {\n\t\t\t\t\treturn config.properties;\n\t\t\t\t}\n\n\t\t\t\t// The config object has the complex format: properties: [...]\n\t\t\t\tif (Array.isArray(config.properties)) {\n\t\t\t\t\treturn config.properties.includes(name);\n\t\t\t\t}\n\n\t\t\t\tthrow new Error(\"Wrong format for invalidateOnChildChange.properties: boolean or array is expected\");\n\t\t\t}\n\n\t\t\t// A slot was changed\n\t\t\tif (type === \"slot\") {\n\t\t\t\t// The config object does not have a slots field\n\t\t\t\tif (config.slots === undefined) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// The config object has the short format: slots: true/false\n\t\t\t\tif (typeof config.slots === \"boolean\") {\n\t\t\t\t\treturn config.slots;\n\t\t\t\t}\n\n\t\t\t\t// The config object has the complex format: slots: [...]\n\t\t\t\tif (Array.isArray(config.slots)) {\n\t\t\t\t\treturn config.slots.includes(name);\n\t\t\t\t}\n\n\t\t\t\tthrow new Error(\"Wrong format for invalidateOnChildChange.slots: boolean or array is expected\");\n\t\t\t}\n\t\t}\n\n\t\tthrow new Error(\"Wrong format for invalidateOnChildChange: boolean or object is expected\");\n\t}\n}\n\nconst validateSingleProperty = (value: PropertyValue, propData: Property) => {\n\tconst propertyType = propData.type;\n\tlet propertyValidator = propData.validator;\n\n\tif (propertyType && (propertyType as typeof DataType).isDataTypeClass) {\n\t\tpropertyValidator = propertyType as typeof DataType;\n\t}\n\n\tif (propertyValidator) {\n\t\treturn (propertyValidator as typeof DataType).isValid(value) ? value : propData.defaultValue;\n\t}\n\n\tif (!propertyType || propertyType === String) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string -- if an object is passed as a value to a string property, this was an error so displaying [object Object] will indicate the issue to the developer\n\t\treturn (typeof value === \"string\" || typeof value === \"undefined\" || value === null) ? value : value.toString();\n\t}\n\n\tif (propertyType === Boolean) {\n\t\treturn typeof value === \"boolean\" ? value : false;\n\t}\n\n\tif (propertyType === Object) {\n\t\treturn typeof value === \"object\" ? value : propData.defaultValue;\n\t}\n\n\t// Check if \"value\" is part of the enum (propertyType) values and return the defaultValue if not found.\n\treturn value as string in propertyType ? value : propData.defaultValue;\n};\n\nconst validateSingleSlot = (value: Node, slotData: Slot) => {\n\tvalue && getSlottedNodes(value).forEach(el => {\n\t\tif (!(el instanceof slotData.type)) {\n\t\t\tthrow new Error(`The element is not of type ${slotData.type.toString()}`);\n\t\t}\n\t});\n\n\treturn value;\n};\n\nexport default UI5ElementMetadata;\nexport type {\n\tProperty,\n\tPropertyValue,\n\tSlot,\n\tSlotValue,\n\tEventData,\n\tState,\n\tMetadata,\n};\n"]}
1
+ {"version":3,"file":"UI5ElementMetadata.js","sourceRoot":"","sources":["../src/UI5ElementMetadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AA8ChF;;;GAGG;AACH,MAAM,kBAAkB;IAIvB,YAAY,QAAkB;QAC7B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC1B,CAAC;IAED,eAAe;QACd,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,eAAe,CAAC,EAAE;YAChE,OAAO,IAAI,CAAC,aAAc,CAAC;SAC3B;QACD,MAAM,YAAY,GAAU,EAAE,CAAC;QAC/B,MAAM,eAAe,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QAE/C,wBAAwB;QACxB,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QACnC,KAAK,MAAM,QAAQ,IAAI,KAAK,EAAE,EAAE,sBAAsB;YACrD,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC;YACtC,MAAM,gBAAgB,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AAC;AACd,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import type DataType from \"./types/DataType.js\";\nimport { camelToKebabCase } from \"./util/StringHelper.js\";\nimport { getSlottedNodes } from \"./util/SlotsHelper.js\";\nimport { getEffectiveScopingSuffixForTag } from \"./CustomElementsScopeUtils.js\";\n\ntype SlotInvalidation = {\n\tproperties: boolean | Array<string>,\n\tslots: boolean | Array<string>,\n}\n\ntype Slot = {\n\ttype: typeof Node | typeof HTMLElement,\n\tdefault?: boolean,\n\tpropertyName?: string,\n\tindividualSlots?: boolean,\n\tinvalidateOnChildChange?: boolean | SlotInvalidation,\n\tcloned?: boolean,\n};\n\ntype SlotValue = Node;\n\ntype Property = {\n\ttype?: BooleanConstructor | StringConstructor | ObjectConstructor | DataType\n\tvalidator?: DataType,\n\tdefaultValue?: PropertyValue,\n\tnoAttribute?: boolean,\n\tmultiple?: boolean,\n\tcompareValues?: boolean,\n}\n\ntype PropertyValue = boolean | number | string | object | undefined | null | DataType;\n\ntype EventData = Record<string, object>;\n\ntype Metadata = {\n\ttag?: string,\n\tmanagedSlots?: boolean,\n\tproperties?: Record<string, Property>,\n\tslots?: Record<string, Slot>,\n\tevents?: EventData,\n\tfastNavigation?: boolean,\n\tthemeAware?: boolean,\n\tlanguageAware?: boolean,\n\tformAssociated?: boolean,\n\tshadowRootOptions?: Partial<ShadowRootInit>\n};\n\ntype State = Record<string, PropertyValue | Array<SlotValue>>;\n\n/**\n * @class\n * @public\n */\nclass UI5ElementMetadata {\n\tmetadata: Metadata;\n\t_initialState: State | undefined;\n\n\tconstructor(metadata: Metadata) {\n\t\tthis.metadata = metadata;\n\t}\n\n\tgetInitialState() {\n\t\tif (Object.prototype.hasOwnProperty.call(this, \"_initialState\")) {\n\t\t\treturn this._initialState!;\n\t\t}\n\t\tconst initialState: State = {};\n\t\tconst slotsAreManaged = this.slotsAreManaged();\n\n\t\t// Initialize properties\n\t\tconst props = this.getProperties();\n\t\tfor (const propName in props) { // eslint-disable-line\n\t\t\tconst propType = props[propName].type;\n\t\t\tconst propDefaultValue = props[propName].defaultValue;\n\n\t\t\tif (propType === Boolean) {\n\t\t\t\tinitialState[propName] = false;\n\n\t\t\t\tif (propDefaultValue !== undefined) {\n\t\t\t\t\tconsole.warn(\"The 'defaultValue' metadata key is ignored for all booleans properties, they would be initialized with 'false' by default\"); // eslint-disable-line\n\t\t\t\t}\n\t\t\t} else if (props[propName].multiple) {\n\t\t\t\tObject.defineProperty(initialState, propName, {\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tget() {\n\t\t\t\t\t return [];\n\t\t\t\t\t},\n\t\t\t\t });\n\t\t\t} else if (propType === Object) {\n\t\t\t\tObject.defineProperty(initialState, propName, {\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tget() {\n\t\t\t\t\t return \"defaultValue\" in props[propName] ? props[propName].defaultValue : {};\n\t\t\t\t\t},\n\t\t\t\t });\n\t\t\t} else if (propType === String) {\n\t\t\t\tinitialState[propName] = \"defaultValue\" in props[propName] ? props[propName].defaultValue : \"\";\n\t\t\t} else {\n\t\t\t\tinitialState[propName] = propDefaultValue;\n\t\t\t}\n\t\t}\n\n\t\t// Initialize slots\n\t\tif (slotsAreManaged) {\n\t\t\tconst slots = this.getSlots();\n\t\t\tfor (const [slotName, slotData] of Object.entries<Slot>(slots)) { // eslint-disable-line\n\t\t\t\tconst propertyName = slotData.propertyName || slotName;\n\t\t\t\tinitialState[propertyName] = [];\n\t\t\t}\n\t\t}\n\n\t\tthis._initialState = initialState;\n\t\treturn initialState;\n\t}\n\n\t/**\n\t * Validates the property's value and returns it if correct\n\t * or returns the default value if not.\n\t * **Note:** Only intended for use by UI5Element.js\n\t * @public\n\t */\n\tstatic validatePropertyValue(value: PropertyValue, propData: Property): PropertyValue {\n\t\tconst isMultiple = propData.multiple;\n\t\tif (isMultiple && value) {\n\t\t\treturn (value as Array<PropertyValue>).map((propValue: PropertyValue) => validateSingleProperty(propValue, propData));\n\t\t}\n\t\treturn validateSingleProperty(value, propData);\n\t}\n\n\t/**\n\t * Validates the slot's value and returns it if correct\n\t * or throws an exception if not.\n\t * **Note:** Only intended for use by UI5Element.js\n\t * @public\n\t */\n\tstatic validateSlotValue(value: Node, slotData: Slot): Node {\n\t\treturn validateSingleSlot(value, slotData);\n\t}\n\n\t/**\n\t * Returns the tag of the UI5 Element without the scope\n\t * @public\n\t */\n\tgetPureTag(): string {\n\t\treturn this.metadata.tag || \"\";\n\t}\n\n\t/**\n\t * Returns the tag of the UI5 Element\n\t * @public\n\t */\n\tgetTag(): string {\n\t\tconst pureTag = this.metadata.tag;\n\n\t\tif (!pureTag) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\tconst suffix = getEffectiveScopingSuffixForTag(pureTag);\n\t\tif (!suffix) {\n\t\t\treturn pureTag;\n\t\t}\n\n\t\treturn `${pureTag}-${suffix}`;\n\t}\n\n\t/**\n\t * Determines whether a property should have an attribute counterpart\n\t * @public\n\t * @param propName\n\t */\n\thasAttribute(propName: string): boolean {\n\t\tconst propData = this.getProperties()[propName];\n\t\treturn propData.type !== Object && !propData.noAttribute && !propData.multiple;\n\t}\n\n\t/**\n\t * Returns an array with the properties of the UI5 Element (in camelCase)\n\t * @public\n\t */\n\tgetPropertiesList(): Array<string> {\n\t\treturn Object.keys(this.getProperties());\n\t}\n\n\t/**\n\t * Returns an array with the attributes of the UI5 Element (in kebab-case)\n\t * @public\n\t */\n\tgetAttributesList(): Array<string> {\n\t\treturn this.getPropertiesList().filter(this.hasAttribute.bind(this)).map(camelToKebabCase);\n\t}\n\n\t/**\n\t * Determines whether this UI5 Element has a default slot of type Node, therefore can slot text\n\t */\n\tcanSlotText() {\n\t\treturn (this.getSlots().default)?.type === Node;\n\t}\n\n\t/**\n\t * Determines whether this UI5 Element supports any slots\n\t * @public\n\t */\n\thasSlots(): boolean {\n\t\treturn !!Object.entries(this.getSlots()).length;\n\t}\n\n\t/**\n\t * Determines whether this UI5 Element supports any slots with \"individualSlots: true\"\n\t * @public\n\t */\n\thasIndividualSlots(): boolean {\n\t\treturn this.slotsAreManaged() && Object.values(this.getSlots()).some(slotData => slotData.individualSlots);\n\t}\n\n\t/**\n\t * Determines whether this UI5 Element needs to invalidate if children are added/removed/changed\n\t * @public\n\t */\n\tslotsAreManaged(): boolean {\n\t\treturn !!this.metadata.managedSlots;\n\t}\n\n\t/**\n\t * Determines whether this control supports F6 fast navigation\n\t * @public\n\t */\n\tsupportsF6FastNavigation(): boolean {\n\t\treturn !!this.metadata.fastNavigation;\n\t}\n\n\t/**\n\t * Returns an object with key-value pairs of properties and their metadata definitions\n\t * @public\n\t */\n\tgetProperties(): Record<string, Property> {\n\t\tif (!this.metadata.properties) {\n\t\t\tthis.metadata.properties = {};\n\t\t}\n\t\treturn this.metadata.properties;\n\t}\n\n\t/**\n\t * Returns an object with key-value pairs of events and their metadata definitions\n\t * @public\n\t */\n\tgetEvents(): EventData {\n\t\tif (!this.metadata.events) {\n\t\t\tthis.metadata.events = {};\n\t\t}\n\t\treturn this.metadata.events;\n\t}\n\n\t/**\n\t * Returns an object with key-value pairs of slots and their metadata definitions\n\t * @public\n\t */\n\t getSlots(): Record<string, Slot> {\n\t\tif (!this.metadata.slots) {\n\t\t\tthis.metadata.slots = {};\n\t\t}\n\t\treturn this.metadata.slots;\n\t}\n\n\t/**\n\t * Determines whether this UI5 Element has any translatable texts (needs to be invalidated upon language change)\n\t */\n\tisLanguageAware(): boolean {\n\t\treturn !!this.metadata.languageAware;\n\t}\n\n\t/**\n\t * Determines whether this UI5 Element has any theme dependant carachteristics.\n\t */\n\t isThemeAware(): boolean {\n\t\treturn !!this.metadata.themeAware;\n\t}\n\n\tgetShadowRootOptions(): Partial<ShadowRootInit> {\n\t\treturn this.metadata.shadowRootOptions || {};\n\t}\n\n\t/**\n\t * Determines whether this UI5 Element has any theme dependant carachteristics.\n\t */\n\t isFormAssociated(): boolean {\n\t\treturn !!this.metadata.formAssociated;\n\t}\n\n\t/**\n\t * Matches a changed entity (property/slot) with the given name against the \"invalidateOnChildChange\" configuration\n\t * and determines whether this should cause and invalidation\n\t *\n\t * @param slotName the name of the slot in which a child was changed\n\t * @param type the type of change in the child: \"property\" or \"slot\"\n\t * @param name the name of the property/slot that changed\n\t */\n\tshouldInvalidateOnChildChange(slotName: string, type: \"property\" | \"slot\", name: string): boolean {\n\t\tconst config = this.getSlots()[slotName].invalidateOnChildChange;\n\n\t\t// invalidateOnChildChange was not set in the slot metadata - by default child changes do not affect the component\n\t\tif (config === undefined) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// The simple format was used: invalidateOnChildChange: true/false;\n\t\tif (typeof config === \"boolean\") {\n\t\t\treturn config;\n\t\t}\n\n\t\t// The complex format was used: invalidateOnChildChange: { properties, slots }\n\t\tif (typeof config === \"object\") {\n\t\t\t// A property was changed\n\t\t\tif (type === \"property\") {\n\t\t\t\t// The config object does not have a properties field\n\t\t\t\tif (config.properties === undefined) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// The config object has the short format: properties: true/false\n\t\t\t\tif (typeof config.properties === \"boolean\") {\n\t\t\t\t\treturn config.properties;\n\t\t\t\t}\n\n\t\t\t\t// The config object has the complex format: properties: [...]\n\t\t\t\tif (Array.isArray(config.properties)) {\n\t\t\t\t\treturn config.properties.includes(name);\n\t\t\t\t}\n\n\t\t\t\tthrow new Error(\"Wrong format for invalidateOnChildChange.properties: boolean or array is expected\");\n\t\t\t}\n\n\t\t\t// A slot was changed\n\t\t\tif (type === \"slot\") {\n\t\t\t\t// The config object does not have a slots field\n\t\t\t\tif (config.slots === undefined) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// The config object has the short format: slots: true/false\n\t\t\t\tif (typeof config.slots === \"boolean\") {\n\t\t\t\t\treturn config.slots;\n\t\t\t\t}\n\n\t\t\t\t// The config object has the complex format: slots: [...]\n\t\t\t\tif (Array.isArray(config.slots)) {\n\t\t\t\t\treturn config.slots.includes(name);\n\t\t\t\t}\n\n\t\t\t\tthrow new Error(\"Wrong format for invalidateOnChildChange.slots: boolean or array is expected\");\n\t\t\t}\n\t\t}\n\n\t\tthrow new Error(\"Wrong format for invalidateOnChildChange: boolean or object is expected\");\n\t}\n}\n\nconst validateSingleProperty = (value: PropertyValue, propData: Property) => {\n\tconst propertyType = propData.type;\n\tlet propertyValidator = propData.validator;\n\n\tif (propertyType && (propertyType as typeof DataType).isDataTypeClass) {\n\t\tpropertyValidator = propertyType as typeof DataType;\n\t}\n\n\tif (propertyValidator) {\n\t\treturn (propertyValidator as typeof DataType).isValid(value) ? value : propData.defaultValue;\n\t}\n\n\tif (!propertyType || propertyType === String) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string -- if an object is passed as a value to a string property, this was an error so displaying [object Object] will indicate the issue to the developer\n\t\treturn (typeof value === \"string\" || typeof value === \"undefined\" || value === null) ? value : value.toString();\n\t}\n\n\tif (propertyType === Boolean) {\n\t\treturn typeof value === \"boolean\" ? value : false;\n\t}\n\n\tif (propertyType === Object) {\n\t\treturn typeof value === \"object\" ? value : propData.defaultValue;\n\t}\n\n\t// Check if \"value\" is part of the enum (propertyType) values and return the defaultValue if not found.\n\treturn value as string in propertyType ? value : propData.defaultValue;\n};\n\nconst validateSingleSlot = (value: Node, slotData: Slot) => {\n\tvalue && getSlottedNodes(value).forEach(el => {\n\t\tif (!(el instanceof slotData.type)) {\n\t\t\tthrow new Error(`The element is not of type ${slotData.type.toString()}`);\n\t\t}\n\t});\n\n\treturn value;\n};\n\nexport default UI5ElementMetadata;\nexport type {\n\tProperty,\n\tPropertyValue,\n\tSlot,\n\tSlotValue,\n\tEventData,\n\tState,\n\tMetadata,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"connectToComponent.js","sourceRoot":"","sources":["../src/connectToComponent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,MAAM,4BAA4B,GAAG,GAAG,CAAC,CAAC,uDAAuD;AACj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AAG,IAAI,CAAC,WAAW,EAAc,CAAC;gBAChD,MAAM,KAAK,GAAG,CAAC,QAAQ,CAAC,cAAc,IAAI,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;gBAE3E,IAAI,KAAK,EAAE;oBACV,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;oBAClC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;oBACtB,cAAc,CAAC,IAAI,CAAC,CAAC;iBACrB;YACF,CAAC,EAAE,4BAA4B,CAAC,CAAC;YACjC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;SAC7B;QAED,OAAO;KACP;IAED,gDAAgD;IAChD,IAAI,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QACvB,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QAClC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;KACtB;IAED,8DAA8D;IAC9D,IAAI,eAAe,KAAK,WAAW,EAAE;QACpC,IAAI,eAAe,EAAE;YACpB,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;SAC9D;QACD,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QACpD,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;KAClC;IAED,OAAO,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import type UI5Element from \"./UI5Element.js\";\nimport { renderDeferred } from \"./Render.js\";\nimport { Interval } from \"./types.js\";\n\nconst MISSING_ELEMENT_POLL_TIMEOUT = 500; // how often to poll for not-yet-in-DOM friend elements\nconst connections = new Map<string, HTMLElement>();\nconst intervals = new Map<string, Interval>();\n\ntype ConnectOptions = {\n\thost: UI5Element;\n\tpropName: string;\n\tonConnect?: (friend: HTMLElement) => void;\n\tonDisconnect?: (friend: HTMLElement) => void;\n}\n\nconst connectToComponent = (options: ConnectOptions): HTMLElement | undefined => {\n\tconst host = options.host;\n\tconst propName = options.propName;\n\tconst friend = host[propName as keyof typeof host] as HTMLElement | string | undefined;\n\n\tlet connectedTo: HTMLElement | undefined;\n\tif (friend === undefined || friend === \"\") {\n\t\tconnectedTo = undefined; // do not return early even if a \"menu\" property is not set - it may have been set before and cleanup must run\n\t} else if (friend instanceof HTMLElement) {\n\t\tconnectedTo = friend;\n\t} else {\n\t\tconst rootNode = host.getRootNode() as Document;\n\t\tconnectedTo = (rootNode.getElementById && rootNode.getElementById(friend)) || undefined;\n\t}\n\n\tconst key = `${host._id}-${propName}`;\n\tconst prevConnectedTo = connections.get(key);\n\n\t// Not connected - return undefined\n\tif (!connectedTo) {\n\t\tif (prevConnectedTo) { // but first disconnect, if needed\n\t\t\toptions.onDisconnect && options.onDisconnect(prevConnectedTo);\n\t\t\tconnections.delete(key);\n\t\t}\n\n\t\t// if friend element not in DOM yet, start polling\n\t\tif (typeof friend === \"string\" && friend && !intervals.has(key)) {\n\t\t\tconst interval = setInterval(() => {\n\t\t\t\tconst rootNode = host.getRootNode() as Document;\n\t\t\t\tconst found = (rootNode.getElementById && rootNode.getElementById(friend));\n\n\t\t\t\tif (found) {\n\t\t\t\t\tclearInterval(intervals.get(key));\n\t\t\t\t\tintervals.delete(key);\n\t\t\t\t\trenderDeferred(host);\n\t\t\t\t}\n\t\t\t}, MISSING_ELEMENT_POLL_TIMEOUT);\n\t\t\tintervals.set(key, interval);\n\t\t}\n\n\t\treturn;\n\t}\n\n\t// If connected, but still polling, stop polling\n\tif (intervals.has(key)) {\n\t\tclearInterval(intervals.get(key));\n\t\tintervals.delete(key);\n\t}\n\n\t// Connected - either for the first time, or to something else\n\tif (prevConnectedTo !== connectedTo) {\n\t\tif (prevConnectedTo) {\n\t\t\toptions.onDisconnect && options.onDisconnect(prevConnectedTo);\n\t\t}\n\t\toptions.onConnect && options.onConnect(connectedTo);\n\t\tconnections.set(key, connectedTo);\n\t}\n\n\treturn connections.get(key);\n};\n\nexport default connectToComponent;\n"]}
1
+ {"version":3,"file":"connectToComponent.js","sourceRoot":"","sources":["../src/connectToComponent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,MAAM,4BAA4B,GAAG,GAAG,CAAC,CAAC,uDAAuD;AACjG,MAAM,WAAW,GAAG,IAAI,GAAG,EAAuB,CAAC;AACnD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAoB,CAAC;AAS9C,MAAM,kBAAkB,GAAG,CAAC,OAAuB,EAA2B,EAAE;IAC/E,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAC1B,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAClC,MAAM,MAAM,GAAG,IAAI,CAAC,QAA6B,CAAqC,CAAC;IAEvF,IAAI,WAAoC,CAAC;IACzC,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,EAAE,EAAE;QAC1C,WAAW,GAAG,SAAS,CAAC,CAAC,8GAA8G;KACvI;SAAM,IAAI,MAAM,YAAY,WAAW,EAAE;QACzC,WAAW,GAAG,MAAM,CAAC;KACrB;SAAM;QACN,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAc,CAAC;QAChD,WAAW,GAAG,CAAC,QAAQ,CAAC,cAAc,IAAI,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,IAAI,SAAS,CAAC;KACxF;IAED,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,QAAQ,EAAE,CAAC;IACtC,MAAM,eAAe,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAE7C,mCAAmC;IACnC,IAAI,CAAC,WAAW,EAAE;QACjB,IAAI,eAAe,EAAE,EAAE,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,CAAC,CAAC;KAClC;IAED,OAAO,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import type UI5Element from \"./UI5Element.js\";\nimport { renderDeferred } from \"./Render.js\";\nimport type { Interval } from \"./types.js\";\n\nconst MISSING_ELEMENT_POLL_TIMEOUT = 500; // how often to poll for not-yet-in-DOM friend elements\nconst connections = new Map<string, HTMLElement>();\nconst intervals = new Map<string, Interval>();\n\ntype ConnectOptions = {\n\thost: UI5Element;\n\tpropName: string;\n\tonConnect?: (friend: HTMLElement) => void;\n\tonDisconnect?: (friend: HTMLElement) => void;\n}\n\nconst connectToComponent = (options: ConnectOptions): HTMLElement | undefined => {\n\tconst host = options.host;\n\tconst propName = options.propName;\n\tconst friend = host[propName as keyof typeof host] as HTMLElement | string | undefined;\n\n\tlet connectedTo: HTMLElement | undefined;\n\tif (friend === undefined || friend === \"\") {\n\t\tconnectedTo = undefined; // do not return early even if a \"menu\" property is not set - it may have been set before and cleanup must run\n\t} else if (friend instanceof HTMLElement) {\n\t\tconnectedTo = friend;\n\t} else {\n\t\tconst rootNode = host.getRootNode() as Document;\n\t\tconnectedTo = (rootNode.getElementById && rootNode.getElementById(friend)) || undefined;\n\t}\n\n\tconst key = `${host._id}-${propName}`;\n\tconst prevConnectedTo = connections.get(key);\n\n\t// Not connected - return undefined\n\tif (!connectedTo) {\n\t\tif (prevConnectedTo) { // but first disconnect, if needed\n\t\t\toptions.onDisconnect && options.onDisconnect(prevConnectedTo);\n\t\t\tconnections.delete(key);\n\t\t}\n\n\t\t// if friend element not in DOM yet, start polling\n\t\tif (typeof friend === \"string\" && friend && !intervals.has(key)) {\n\t\t\tconst interval = setInterval(() => {\n\t\t\t\tconst rootNode = host.getRootNode() as Document;\n\t\t\t\tconst found = (rootNode.getElementById && rootNode.getElementById(friend));\n\n\t\t\t\tif (found) {\n\t\t\t\t\tclearInterval(intervals.get(key));\n\t\t\t\t\tintervals.delete(key);\n\t\t\t\t\trenderDeferred(host);\n\t\t\t\t}\n\t\t\t}, MISSING_ELEMENT_POLL_TIMEOUT);\n\t\t\tintervals.set(key, interval);\n\t\t}\n\n\t\treturn;\n\t}\n\n\t// If connected, but still polling, stop polling\n\tif (intervals.has(key)) {\n\t\tclearInterval(intervals.get(key));\n\t\tintervals.delete(key);\n\t}\n\n\t// Connected - either for the first time, or to something else\n\tif (prevConnectedTo !== connectedTo) {\n\t\tif (prevConnectedTo) {\n\t\t\toptions.onDisconnect && options.onDisconnect(prevConnectedTo);\n\t\t}\n\t\toptions.onConnect && options.onConnect(connectedTo);\n\t\tconnections.set(key, connectedTo);\n\t}\n\n\treturn connections.get(key);\n};\n\nexport default connectToComponent;\n"]}
@@ -1,4 +1,4 @@
1
- import { Property } from "../UI5ElementMetadata.js";
1
+ import type { Property } from "../UI5ElementMetadata.js";
2
2
  /**
3
3
  * Returns a property decorator.
4
4
  *
@@ -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,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","sourcesContent":["import type UI5Element from \"../UI5Element.js\";\nimport { Property } from \"../UI5ElementMetadata.js\";\n\n/**\n * Returns a property decorator.\n *\n * @param { Property } propData\n * @returns { PropertyDecorator }\n */\nconst property = (propData?: Property): PropertyDecorator => {\n\treturn (target: any, propertyKey: string | symbol) => {\n\t\tconst ctor = target.constructor as typeof UI5Element;\n\n\t\tif (!Object.prototype.hasOwnProperty.call(ctor, \"metadata\")) {\n\t\t\tctor.metadata = {};\n\t\t}\n\n\t\tconst metadata = ctor.metadata;\n\t\tif (!metadata.properties) {\n\t\t\tmetadata.properties = {};\n\t\t}\n\n\t\tconst propsMetadata = metadata.properties;\n\t\tif (!propsMetadata[propertyKey as string]) {\n\t\t\tpropsMetadata[propertyKey as string] = propData || { type: String };\n\t\t}\n\t};\n};\n\nexport default property;\n"]}
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","sourcesContent":["import type UI5Element from \"../UI5Element.js\";\nimport type { Property } from \"../UI5ElementMetadata.js\";\n\n/**\n * Returns a property decorator.\n *\n * @param { Property } propData\n * @returns { PropertyDecorator }\n */\nconst property = (propData?: Property): PropertyDecorator => {\n\treturn (target: any, propertyKey: string | symbol) => {\n\t\tconst ctor = target.constructor as typeof UI5Element;\n\n\t\tif (!Object.prototype.hasOwnProperty.call(ctor, \"metadata\")) {\n\t\t\tctor.metadata = {};\n\t\t}\n\n\t\tconst metadata = ctor.metadata;\n\t\tif (!metadata.properties) {\n\t\t\tmetadata.properties = {};\n\t\t}\n\n\t\tconst propsMetadata = metadata.properties;\n\t\tif (!propsMetadata[propertyKey as string]) {\n\t\t\tpropsMetadata[propertyKey as string] = propData || { type: String };\n\t\t}\n\t};\n};\n\nexport default property;\n"]}
@@ -1,4 +1,4 @@
1
- import { Slot } from "../UI5ElementMetadata.js";
1
+ import type { Slot } from "../UI5ElementMetadata.js";
2
2
  /**
3
3
  * Returns a slot decorator.
4
4
  *
@@ -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,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,IAAI,QAAQ,CAAC,OAAO,IAAI,YAAY,CAAC,OAAO,EAAE;YACzD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;SAC1D;QAED,MAAM,GAAG,GAAG,QAAQ,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAiB,CAAC;QACzE,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","sourcesContent":["import type UI5Element from \"../UI5Element.js\";\nimport { Slot } from \"../UI5ElementMetadata.js\";\n\n/**\n * Returns a slot decorator.\n *\n * @param { Slot } slotData\n * @returns { PropertyDecorator }\n */\nconst slot = (slotData?: Slot): PropertyDecorator => {\n\treturn (target: any, slotKey: string | symbol) => {\n\t\tconst ctor = target.constructor as typeof UI5Element;\n\n\t\tif (!Object.prototype.hasOwnProperty.call(ctor, \"metadata\")) {\n\t\t\tctor.metadata = {};\n\t\t}\n\n\t\tconst metadata = ctor.metadata;\n\t\tif (!metadata.slots) {\n\t\t\tmetadata.slots = {};\n\t\t}\n\n\t\tconst slotMetadata = metadata.slots;\n\n\t\tif (slotData && slotData.default && slotMetadata.default) {\n\t\t\tthrow new Error(\"Only one slot can be the default slot.\");\n\t\t}\n\n\t\tconst key = slotData && slotData.default ? \"default\" : slotKey as string;\n\t\tslotData = slotData || { type: HTMLElement };\n\n\t\tif (!slotData.type) {\n\t\t\tslotData.type = HTMLElement;\n\t\t}\n\n\t\tif (!slotMetadata[key]) {\n\t\t\tslotMetadata[key] = slotData;\n\t\t}\n\n\t\tif (slotData.default) {\n\t\t\tdelete slotMetadata.default.default;\n\t\t\tslotMetadata.default.propertyName = slotKey as string;\n\t\t}\n\n\t\tctor.metadata.managedSlots = true;\n\t};\n};\n\nexport default slot;\n"]}
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,IAAI,QAAQ,CAAC,OAAO,IAAI,YAAY,CAAC,OAAO,EAAE;YACzD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;SAC1D;QAED,MAAM,GAAG,GAAG,QAAQ,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAiB,CAAC;QACzE,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","sourcesContent":["import type UI5Element from \"../UI5Element.js\";\nimport type { Slot } from \"../UI5ElementMetadata.js\";\n\n/**\n * Returns a slot decorator.\n *\n * @param { Slot } slotData\n * @returns { PropertyDecorator }\n */\nconst slot = (slotData?: Slot): PropertyDecorator => {\n\treturn (target: any, slotKey: string | symbol) => {\n\t\tconst ctor = target.constructor as typeof UI5Element;\n\n\t\tif (!Object.prototype.hasOwnProperty.call(ctor, \"metadata\")) {\n\t\t\tctor.metadata = {};\n\t\t}\n\n\t\tconst metadata = ctor.metadata;\n\t\tif (!metadata.slots) {\n\t\t\tmetadata.slots = {};\n\t\t}\n\n\t\tconst slotMetadata = metadata.slots;\n\n\t\tif (slotData && slotData.default && slotMetadata.default) {\n\t\t\tthrow new Error(\"Only one slot can be the default slot.\");\n\t\t}\n\n\t\tconst key = slotData && slotData.default ? \"default\" : slotKey as string;\n\t\tslotData = slotData || { type: HTMLElement };\n\n\t\tif (!slotData.type) {\n\t\t\tslotData.type = HTMLElement;\n\t\t}\n\n\t\tif (!slotMetadata[key]) {\n\t\t\tslotMetadata[key] = slotData;\n\t\t}\n\n\t\tif (slotData.default) {\n\t\t\tdelete slotMetadata.default.default;\n\t\t\tslotMetadata.default.propertyName = slotKey as string;\n\t\t}\n\n\t\tctor.metadata.managedSlots = true;\n\t};\n};\n\nexport default slot;\n"]}
@@ -131,7 +131,7 @@ class F6Navigation {
131
131
  this.selectedGroup = element;
132
132
  }
133
133
  deepActive(root) {
134
- if (root.activeElement && root.activeElement.shadowRoot) {
134
+ if (root?.activeElement?.shadowRoot?.activeElement) {
135
135
  return this.deepActive(root.activeElement.shadowRoot);
136
136
  }
137
137
  return root.activeElement;
@@ -1 +1 @@
1
- {"version":3,"file":"F6Navigation.js","sourceRoot":"","sources":["../../src/features/F6Navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,uBAAuB,MAAM,oCAAoC,CAAC;AACzE,OAAO,kBAAkB,MAAM,+BAA+B,CAAC;AAE/D,MAAM,YAAY;IAMjB;QAHA,kBAAa,GAAuB,IAAI,CAAC;QACzC,WAAM,GAAuB,EAAE,CAAC;QAG/B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAmC,CAAC;QACxF,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC7B,CAAC;IAED,oBAAoB;QACnB,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAC3D,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,WAAwB;QACjD,MA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W,GAAG,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAC1D,IAAI,OAAO,GAAgC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAEjE,OAAO,OAAO,IAAK,OAAmB,CAAC,YAAY,CAAC,0BAA0B,CAAC,KAAK,MAAM,IAAI,OAAO,KAAK,WAAW,EAAE;YACtH,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAE,OAAO,CAAC,UAAyB,CAAC,IAAI,CAAC;SAC/F;QAED,IAAI,CAAC,aAAa,GAAG,OAAsB,CAAC;IAC7C,CAAC;IAED,UAAU,CAAC,IAA0B;QACpC,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE;YACxD,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;SACtD;QAED,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;IAED,OAAO;QACN,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC7B,CAAC;IAED,MAAM,CAAC,IAAI;QACV,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACpB,IAAI,CAAC,SAAS,GAAG,IAAI,YAAY,EAAE,CAAC;SACpC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACvB,CAAC;CACD;AAED,eAAe,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;AAE9C,eAAe,YAAY,CAAC","sourcesContent":["import { registerFeature } from \"../FeaturesRegistry.js\";\nimport { isF6Next, isF6Previous } from \"../Keys.js\";\nimport { instanceOfUI5Element } from \"../UI5Element.js\";\nimport { getFirstFocusableElement } from \"../util/FocusableElements.js\";\nimport getFastNavigationGroups from \"../util/getFastNavigationGroups.js\";\nimport isElementClickable from \"../util/isElementClickable.js\";\n\nclass F6Navigation {\n\tstatic _instance: F6Navigation;\n\tkeydownHandler: (event: KeyboardEvent) => void;\n\tselectedGroup: HTMLElement | null = null;\n\tgroups: Array<HTMLElement> = [];\n\n\tconstructor() {\n\t\tthis.keydownHandler = this._keydownHandler.bind(this) as (event: KeyboardEvent) => void;\n\t\tthis.attachEventListeners();\n\t}\n\n\tattachEventListeners() {\n\t\tdocument.addEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tasync groupElementToFocus(nextElement: HTMLElement) {\n\t\tconst nextElementDomRef = instanceOfUI5Element(nextElement) ? nextElement.getDomRef() : nextElement;\n\n\t\tif (nextElementDomRef) {\n\t\t\tif (isElementClickable(nextElementDomRef)) {\n\t\t\t\treturn nextElementDomRef;\n\t\t\t}\n\n\t\t\tconst elementToFocus = await getFirstFocusableElement(nextElementDomRef);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\treturn elementToFocus;\n\t\t\t}\n\t\t}\n\t}\n\n\tasync findNextFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > -1) {\n\t\t\t\tif (currentIndex + 1 >= this.groups.length) {\n\t\t\t\t\tcurrentIndex = 0;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t} else {\n\t\t\t\t\tcurrentIndex += 1;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcurrentIndex = 0;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync findPreviousFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > 0) {\n\t\t\t\t// Handle the situation where the first focusable element of two neighbor groups is the same\n\t\t\t\t// For example:\n\t\t\t\t// <ui5-flexible-column-layout>\n\t\t\t\t// <ui5-list>\n\t\t\t\t// <ui5-li>List Item</ui5-li>\n\t\t\t\t// </ui5-list>\n\t\t\t\t// </ui5-flexible-column-layout>\n\t\t\t\t// Here for both FCL & List the firstFoccusableElement is the same (the ui5-li)\n\t\t\t\tconst firstFocusable = await this.groupElementToFocus(this.groups[currentIndex - 1]);\n\t\t\t\tconst shouldSkipParent = firstFocusable === await this.groupElementToFocus(this.groups[currentIndex]);\n\n\t\t\t\tcurrentIndex = shouldSkipParent ? currentIndex - 2 : currentIndex - 1;\n\n\t\t\t\tif (currentIndex < 0) {\n\t\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\t}\n\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t} else {\n\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync _keydownHandler(event: KeyboardEvent) {\n\t\tconst forward = isF6Next(event);\n\t\tconst backward = isF6Previous(event);\n\t\tif (!(forward || backward)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.updateGroups();\n\n\t\tif (this.groups.length < 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\n\t\tlet elementToFocus;\n\n\t\tif (this.groups.length === 0) {\n\t\t\telementToFocus = await this.groupElementToFocus(this.groups[0]);\n\n\t\t\treturn elementToFocus?.focus();\n\t\t}\n\n\t\tlet currentIndex = -1;\n\n\t\tif (this.selectedGroup) {\n\t\t\tcurrentIndex = this.groups.indexOf(this.selectedGroup);\n\t\t}\n\n\t\tif (forward) {\n\t\t\telementToFocus = await this.findNextFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\tif (backward) {\n\t\t\telementToFocus = await this.findPreviousFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\telementToFocus?.focus();\n\t}\n\n\tremoveEventListeners() {\n\t\tdocument.removeEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tupdateGroups() {\n\t\tthis.setSelectedGroup();\n\t\tthis.groups = getFastNavigationGroups(document.body);\n\t}\n\n\tsetSelectedGroup(root: DocumentOrShadowRoot = window.document) {\n\t\tconst htmlElement = window.document.querySelector(\"html\");\n\t\tlet element: Element | null | ParentNode = this.deepActive(root);\n\n\t\twhile (element && (element as Element).getAttribute(\"data-sap-ui-fastnavgroup\") !== \"true\" && element !== htmlElement) {\n\t\t\telement = element.parentElement ? element.parentNode : (element.parentNode as ShadowRoot).host;\n\t\t}\n\n\t\tthis.selectedGroup = element as HTMLElement;\n\t}\n\n\tdeepActive(root: DocumentOrShadowRoot): Element | null {\n\t\tif (root.activeElement && root.activeElement.shadowRoot) {\n\t\t\treturn this.deepActive(root.activeElement.shadowRoot);\n\t\t}\n\n\t\treturn root.activeElement;\n\t}\n\n\tdestroy() {\n\t\tthis.removeEventListeners();\n\t}\n\n\tstatic init() {\n\t\tif (!this._instance) {\n\t\t\tthis._instance = new F6Navigation();\n\t\t}\n\n\t\treturn this._instance;\n\t}\n}\n\nregisterFeature(\"F6Navigation\", F6Navigation);\n\nexport default F6Navigation;\n"]}
1
+ {"version":3,"file":"F6Navigation.js","sourceRoot":"","sources":["../../src/features/F6Navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAA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;QACV,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACpB,IAAI,CAAC,SAAS,GAAG,IAAI,YAAY,EAAE,CAAC;SACpC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACvB,CAAC;CACD;AAED,eAAe,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;AAE9C,eAAe,YAAY,CAAC","sourcesContent":["import { registerFeature } from \"../FeaturesRegistry.js\";\nimport { isF6Next, isF6Previous } from \"../Keys.js\";\nimport { instanceOfUI5Element } from \"../UI5Element.js\";\nimport { getFirstFocusableElement } from \"../util/FocusableElements.js\";\nimport getFastNavigationGroups from \"../util/getFastNavigationGroups.js\";\nimport isElementClickable from \"../util/isElementClickable.js\";\n\nclass F6Navigation {\n\tstatic _instance: F6Navigation;\n\tkeydownHandler: (event: KeyboardEvent) => void;\n\tselectedGroup: HTMLElement | null = null;\n\tgroups: Array<HTMLElement> = [];\n\n\tconstructor() {\n\t\tthis.keydownHandler = this._keydownHandler.bind(this) as (event: KeyboardEvent) => void;\n\t\tthis.attachEventListeners();\n\t}\n\n\tattachEventListeners() {\n\t\tdocument.addEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tasync groupElementToFocus(nextElement: HTMLElement) {\n\t\tconst nextElementDomRef = instanceOfUI5Element(nextElement) ? nextElement.getDomRef() : nextElement;\n\n\t\tif (nextElementDomRef) {\n\t\t\tif (isElementClickable(nextElementDomRef)) {\n\t\t\t\treturn nextElementDomRef;\n\t\t\t}\n\n\t\t\tconst elementToFocus = await getFirstFocusableElement(nextElementDomRef);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\treturn elementToFocus;\n\t\t\t}\n\t\t}\n\t}\n\n\tasync findNextFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > -1) {\n\t\t\t\tif (currentIndex + 1 >= this.groups.length) {\n\t\t\t\t\tcurrentIndex = 0;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t} else {\n\t\t\t\t\tcurrentIndex += 1;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcurrentIndex = 0;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync findPreviousFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > 0) {\n\t\t\t\t// Handle the situation where the first focusable element of two neighbor groups is the same\n\t\t\t\t// For example:\n\t\t\t\t// <ui5-flexible-column-layout>\n\t\t\t\t// <ui5-list>\n\t\t\t\t// <ui5-li>List Item</ui5-li>\n\t\t\t\t// </ui5-list>\n\t\t\t\t// </ui5-flexible-column-layout>\n\t\t\t\t// Here for both FCL & List the firstFoccusableElement is the same (the ui5-li)\n\t\t\t\tconst firstFocusable = await this.groupElementToFocus(this.groups[currentIndex - 1]);\n\t\t\t\tconst shouldSkipParent = firstFocusable === await this.groupElementToFocus(this.groups[currentIndex]);\n\n\t\t\t\tcurrentIndex = shouldSkipParent ? currentIndex - 2 : currentIndex - 1;\n\n\t\t\t\tif (currentIndex < 0) {\n\t\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\t}\n\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t} else {\n\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync _keydownHandler(event: KeyboardEvent) {\n\t\tconst forward = isF6Next(event);\n\t\tconst backward = isF6Previous(event);\n\t\tif (!(forward || backward)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.updateGroups();\n\n\t\tif (this.groups.length < 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\n\t\tlet elementToFocus;\n\n\t\tif (this.groups.length === 0) {\n\t\t\telementToFocus = await this.groupElementToFocus(this.groups[0]);\n\n\t\t\treturn elementToFocus?.focus();\n\t\t}\n\n\t\tlet currentIndex = -1;\n\n\t\tif (this.selectedGroup) {\n\t\t\tcurrentIndex = this.groups.indexOf(this.selectedGroup);\n\t\t}\n\n\t\tif (forward) {\n\t\t\telementToFocus = await this.findNextFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\tif (backward) {\n\t\t\telementToFocus = await this.findPreviousFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\telementToFocus?.focus();\n\t}\n\n\tremoveEventListeners() {\n\t\tdocument.removeEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tupdateGroups() {\n\t\tthis.setSelectedGroup();\n\t\tthis.groups = getFastNavigationGroups(document.body);\n\t}\n\n\tsetSelectedGroup(root: DocumentOrShadowRoot = window.document) {\n\t\tconst htmlElement = window.document.querySelector(\"html\");\n\t\tlet element: Element | null | ParentNode = this.deepActive(root);\n\n\t\twhile (element && (element as Element).getAttribute(\"data-sap-ui-fastnavgroup\") !== \"true\" && element !== htmlElement) {\n\t\t\telement = element.parentElement ? element.parentNode : (element.parentNode as ShadowRoot).host;\n\t\t}\n\n\t\tthis.selectedGroup = element as HTMLElement;\n\t}\n\n\tdeepActive(root: DocumentOrShadowRoot): Element | null {\n\t\tif (root?.activeElement?.shadowRoot?.activeElement) {\n\t\t\treturn this.deepActive(root.activeElement.shadowRoot);\n\t\t}\n\n\t\treturn root.activeElement;\n\t}\n\n\tdestroy() {\n\t\tthis.removeEventListeners();\n\t}\n\n\tstatic init() {\n\t\tif (!this._instance) {\n\t\t\tthis._instance = new F6Navigation();\n\t\t}\n\n\t\treturn this._instance;\n\t}\n}\n\nregisterFeature(\"F6Navigation\", F6Navigation);\n\nexport default F6Navigation;\n"]}
@@ -1,4 +1,4 @@
1
- import { TemplateResult } from "lit-html";
1
+ import type { TemplateResult } from "lit-html";
2
2
  import type UI5Element from "../UI5Element.js";
3
3
  import type OpenUI5Element from "./OpenUI5Element.js";
4
4
  declare class OpenUI5Enablement {
@@ -1 +1 @@
1
- {"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,CA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c,KAAK,UAAU,EAAE;gBAC9C,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC;aAC7B;YAED,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC9D,OAAO;aACP;YAED,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,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 { 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<unknown>) => TemplateResult, host: OpenUI5Element, templateResult: TemplateResult) {\n\t\tif (host.isOpenUI5Component && host.__isBusy) {\n\t\t\ttemplateResult = html`\n\t\t\t<div class=\"busy-indicator-wrapper\">\n\t\t\t\t<span tabindex=\"0\" busy-indicator-before-span @focusin=${host.__suppressFocusIn}></span>\n\t\t\t\t${templateResult}\n\t\t\t\t<div class=\"busy-indicator-overlay\"></div>\n\t\t\t\t<div busy-indicator\n\t\t\t\t\tclass=\"busy-indicator-busy-area\"\n\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\trole=\"progressbar\"\n\t\t\t\t\t@keydown=${host.__suppressFocusBack}\n\t\t\t\t\taria-valuemin=\"0\"\n\t\t\t\t\taria-valuemax=\"100\"\n\t\t\t\t\taria-valuetext=\"Busy\">\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"busy-indicator-circle circle-animation-0\"></div>\n\t\t\t\t\t\t<div class=\"busy-indicator-circle circle-animation-1\"></div>\n\t\t\t\t\t\t<div class=\"busy-indicator-circle circle-animation-2\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>`;\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"]}
1
+ {"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,gBA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AC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,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<unknown>) => TemplateResult, host: OpenUI5Element, templateResult: TemplateResult) {\n\t\tif (host.isOpenUI5Component && host.__isBusy) {\n\t\t\ttemplateResult = html`\n\t\t\t<div class=\"busy-indicator-wrapper\">\n\t\t\t\t<span tabindex=\"0\" busy-indicator-before-span @focusin=${host.__suppressFocusIn}></span>\n\t\t\t\t${templateResult}\n\t\t\t\t<div class=\"busy-indicator-overlay\"></div>\n\t\t\t\t<div busy-indicator\n\t\t\t\t\tclass=\"busy-indicator-busy-area\"\n\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\trole=\"progressbar\"\n\t\t\t\t\t@keydown=${host.__suppressFocusBack}\n\t\t\t\t\taria-valuemin=\"0\"\n\t\t\t\t\taria-valuemax=\"100\"\n\t\t\t\t\taria-valuetext=\"Busy\">\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"busy-indicator-circle circle-animation-0\"></div>\n\t\t\t\t\t\t<div class=\"busy-indicator-circle circle-animation-1\"></div>\n\t\t\t\t\t\t<div class=\"busy-indicator-circle circle-animation-2\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>`;\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"]}
@@ -1,4 +1,4 @@
1
- import { CLDRData } from "../asset-registries/LocaleData.js";
1
+ import type { CLDRData } from "../asset-registries/LocaleData.js";
2
2
  import type { LegacyDateCalendarCustomizing } from "../features/LegacyDateFormats.js";
3
3
  declare class OpenUI5Support {
4
4
  static isAtLeastVersion116(): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"OpenUI5Support.js","sourceRoot":"","sources":["../../src/features/OpenUI5Support.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C,OAAO,UAAU,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AA+D9C,MAAM,cAAc;IACnB,MAAM,CAAC,mBAAmB;QACzB,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,EAAG,CAAC,OAAiB,CAAC;QACjD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;YAC/B,OAAO,KAAK,CAAC;SACb;QACD,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;IAC5D,CAAC;IAED,MAAM,CAAC,iBAAiB;QACvB,OAAO,OAAO,MAAM,CAAC,GAAG,EAAE,EAAE,EAAE,OAAO,KAAK,UAAU,CAAC;IACtD,CAAC;IAED,MAAM,CAAC,IAAI;QACV,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,EAAE;YACxC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;SACzB;QAED,OAAO,IAAI,OAAO,CAAO,OAAO,CAAC,EAAE;YAClC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,kBAAkB,CAAC,EAAE,KAAK,EAAE,IAAiB,EAAE,EAAE;gBACvE,MAAM,QAAQ,GAAG,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aAAM;YACN,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,kBAAkB,CAAgB,CAAC;YACtE,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACvC,IAAI,CAAC,kBAAkB,CAAC,GAAG,EAAE;gBAC5B,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC7B,CAAC,CAAC,CAAC;SACH;IACF,CAAC;IAED,MAAM,CAAC,eAAe;QACrB,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,EAAE;YACxC,OAAO;SACP;QAED,cAAc,CAAC,qBAAqB,EAAE,CAAC;IACxC,CAAC;IAED,MAAM,CAAC,kBAAkB;QACxB,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,EAAE;YACxC,OAAO;SACP;QAED,MAAM,IAAI,GAAG,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,0BAA0B,CAAoB,CAAC,CAAC,yCAAyC;QACvJ,IAAI,CAAC,IAAI,EAAE;YACV,OAAO,KAAK,CAAC;SACb;QAED,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;IACtD,CAAC;CACD;AAED,eAAe,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;AAElD,eAAe,cAAc,CAAC","sourcesContent":["import patchPatcher from \"./patchPatcher.js\";\nimport type { OpenUI5Patcher } from \"./patchPatcher.js\";\nimport patchPopup from \"./patchPopup.js\";\nimport type { OpenUI5Popup } from \"./patchPopup.js\";\nimport { registerFeature } from \"../FeaturesRegistry.js\";\nimport { setTheme } from \"../config/Theme.js\";\nimport { CLDRData } from \"../asset-registries/LocaleData.js\";\nimport type { LegacyDateCalendarCustomizing } from \"../features/LegacyDateFormats.js\";\n\ntype OpenUI5Core = {\n\tattachInit: (callback: () => void) => void,\n\tready: () => Promise<void>,\n\tattachThemeChanged: (callback: () => void) => void,\n\tgetConfiguration: () => OpenUI5CoreConfiguration,\n};\n\ntype OpenUI5CoreConfiguration = {\n\tgetAnimationMode: () => string,\n\tgetLanguage: () => string,\n\tgetTheme: () => string,\n\tgetThemeRoot: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n\tgetCalendarType: () => string,\n\tgetLocale: () => string,\n\tgetFormatSettings: () => {\n\t\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing;\n\t}\n};\n\ntype ControlBehavior = {\n\tgetAnimationMode: () => string,\n}\n\ntype Localization = {\n\tgetLanguage: () => string,\n\tgetLanguageTag: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n}\n\ntype LocaleData = {\n\tgetInstance: (locale: string) => Locale,\n}\n\ntype Theming = {\n\tgetThemeRoot: () => string,\n\tgetTheme: () => string,\n\tattachApplied: (callback: () => void) => void,\n}\n\ntype Formatting = {\n\tgetCalendarType: () => string,\n\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing,\n\tgetCustomIslamicCalendarData?: () => LegacyDateCalendarCustomizing,\n}\n\ntype CalendarUtils = {\n\tgetWeekConfigurationValues: () => {\n\t\tfirstDayOfWeek: number | undefined,\n\t},\n}\n\ntype Locale = {\n\tgetFirstDayOfWeek: () => number,\n\t_get: () => CLDRData,\n};\n\nclass OpenUI5Support {\n\tstatic isAtLeastVersion116() {\n\t\tconst version = window.sap.ui!.version as string;\n\t\tconst parts = version.split(\".\");\n\t\tif (!parts || parts.length < 2) {\n\t\t\treturn false;\n\t\t}\n\t\treturn parseInt(parts[0]) > 1 || parseInt(parts[1]) >= 116;\n\t}\n\n\tstatic isOpenUI5Detected() {\n\t\treturn typeof window.sap?.ui?.require === \"function\";\n\t}\n\n\tstatic init() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\treturn new Promise<void>(resolve => {\n\t\t\twindow.sap.ui.require([\"sap/ui/core/Core\"], async (Core: OpenUI5Core) => {\n\t\t\t\tconst callback = () => {\n\t\t\t\t\tlet deps: Array<string> = [\"sap/ui/core/Popup\", \"sap/ui/core/Patcher\", \"sap/ui/core/LocaleData\"];\n\t\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) { // for versions since 1.116.0 and onward, use the modular core\n\t\t\t\t\t\tdeps = [\n\t\t\t\t\t\t\t...deps,\n\t\t\t\t\t\t\t\"sap/base/i18n/Formatting\",\n\t\t\t\t\t\t\t\"sap/base/i18n/Localization\",\n\t\t\t\t\t\t\t\"sap/ui/core/ControlBehavior\",\n\t\t\t\t\t\t\t\"sap/ui/core/Theming\",\n\t\t\t\t\t\t\t\"sap/ui/core/date/CalendarUtils\",\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\twindow.sap.ui.require(deps, (Popup: OpenUI5Popup, Patcher: OpenUI5Patcher) => {\n\t\t\t\t\t\tpatchPatcher(Patcher);\n\t\t\t\t\t\tpatchPopup(Popup);\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\t\t\tawait Core.ready();\n\t\t\t\t\tcallback();\n\t\t\t\t} else {\n\t\t\t\t\tCore.attachInit(callback);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tstatic getConfigurationSettingsObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst ControlBehavior = window.sap.ui.require(\"sap/ui/core/ControlBehavior\") as ControlBehavior;\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\tconst Theming = window.sap.ui.require(\"sap/ui/core/Theming\") as Theming;\n\t\t\tconst Formatting = window.sap.ui.require(\"sap/base/i18n/Formatting\") as Formatting;\n\t\t\tconst CalendarUtils = window.sap.ui.require(\"sap/ui/core/date/CalendarUtils\") as CalendarUtils;\n\n\t\t\treturn {\n\t\t\t\tanimationMode: ControlBehavior.getAnimationMode(),\n\t\t\t\tlanguage: Localization.getLanguage(),\n\t\t\t\ttheme: Theming.getTheme(),\n\t\t\t\tthemeRoot: Theming.getThemeRoot(),\n\t\t\t\trtl: Localization.getRTL(),\n\t\t\t\ttimezone: Localization.getTimezone(),\n\t\t\t\tcalendarType: Formatting.getCalendarType(),\n\t\t\t\tformatSettings: {\n\t\t\t\t\tfirstDayOfWeek: CalendarUtils.getWeekConfigurationValues().firstDayOfWeek,\n\t\t\t\t\tlegacyDateCalendarCustomizing: Formatting.getCustomIslamicCalendarData?.()\n\t\t\t\t\t\t\t\t\t\t\t\t?? Formatting.getLegacyDateCalendarCustomizing?.(),\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\treturn {\n\t\t\tanimationMode: config.getAnimationMode(),\n\t\t\tlanguage: config.getLanguage(),\n\t\t\ttheme: config.getTheme(),\n\t\t\tthemeRoot: config.getThemeRoot(),\n\t\t\trtl: config.getRTL(),\n\t\t\ttimezone: config.getTimezone(),\n\t\t\tcalendarType: config.getCalendarType(),\n\t\t\tformatSettings: {\n\t\t\t\tfirstDayOfWeek: LocaleData ? LocaleData.getInstance(config.getLocale()).getFirstDayOfWeek() : undefined,\n\t\t\t\tlegacyDateCalendarCustomizing: config.getFormatSettings().getLegacyDateCalendarCustomizing(),\n\t\t\t},\n\t\t};\n\t}\n\n\tstatic getLocaleDataObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\treturn LocaleData.getInstance(Localization.getLanguageTag())._get();\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\treturn LocaleData.getInstance(config.getLocale())._get();\n\t}\n\n\tstatic _listenForThemeChange() {\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Theming: Theming = window.sap.ui.require(\"sap/ui/core/Theming\");\n\t\t\tTheming.attachApplied(() => {\n\t\t\t\tsetTheme(Theming.getTheme());\n\t\t\t});\n\t\t} else {\n\t\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\t\tconst config = Core.getConfiguration();\n\t\t\tCore.attachThemeChanged(() => {\n\t\t\t\tsetTheme(config.getTheme());\n\t\t\t});\n\t\t}\n\t}\n\n\tstatic attachListeners() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tOpenUI5Support._listenForThemeChange();\n\t}\n\n\tstatic cssVariablesLoaded() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst link = [...document.head.children].find(el => el.id === \"sap-ui-theme-sap.ui.core\") as HTMLLinkElement; // more reliable than querySelector early\n\t\tif (!link) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn !!link.href.match(/\\/css(-|_)variables\\.css/);\n\t}\n}\n\nregisterFeature(\"OpenUI5Support\", OpenUI5Support);\n\nexport default OpenUI5Support;\n"]}
1
+ {"version":3,"file":"OpenUI5Support.js","sourceRoot":"","sources":["../../src/features/OpenUI5Support.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C,OAAO,UAAU,MAAM,iBAAiB,C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AAC,CAAC;SACH;IACF,CAAC;IAED,MAAM,CAAC,eAAe;QACrB,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,EAAE;YACxC,OAAO;SACP;QAED,cAAc,CAAC,qBAAqB,EAAE,CAAC;IACxC,CAAC;IAED,MAAM,CAAC,kBAAkB;QACxB,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,EAAE;YACxC,OAAO;SACP;QAED,MAAM,IAAI,GAAG,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,0BAA0B,CAAoB,CAAC,CAAC,yCAAyC;QACvJ,IAAI,CAAC,IAAI,EAAE;YACV,OAAO,KAAK,CAAC;SACb;QAED,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;IACtD,CAAC;CACD;AAED,eAAe,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;AAElD,eAAe,cAAc,CAAC","sourcesContent":["import patchPatcher from \"./patchPatcher.js\";\nimport type { OpenUI5Patcher } from \"./patchPatcher.js\";\nimport patchPopup from \"./patchPopup.js\";\nimport type { OpenUI5Popup } from \"./patchPopup.js\";\nimport { registerFeature } from \"../FeaturesRegistry.js\";\nimport { setTheme } from \"../config/Theme.js\";\nimport type { CLDRData } from \"../asset-registries/LocaleData.js\";\nimport type { LegacyDateCalendarCustomizing } from \"../features/LegacyDateFormats.js\";\n\ntype OpenUI5Core = {\n\tattachInit: (callback: () => void) => void,\n\tready: () => Promise<void>,\n\tattachThemeChanged: (callback: () => void) => void,\n\tgetConfiguration: () => OpenUI5CoreConfiguration,\n};\n\ntype OpenUI5CoreConfiguration = {\n\tgetAnimationMode: () => string,\n\tgetLanguage: () => string,\n\tgetTheme: () => string,\n\tgetThemeRoot: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n\tgetCalendarType: () => string,\n\tgetLocale: () => string,\n\tgetFormatSettings: () => {\n\t\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing;\n\t}\n};\n\ntype ControlBehavior = {\n\tgetAnimationMode: () => string,\n}\n\ntype Localization = {\n\tgetLanguage: () => string,\n\tgetLanguageTag: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n}\n\ntype LocaleData = {\n\tgetInstance: (locale: string) => Locale,\n}\n\ntype Theming = {\n\tgetThemeRoot: () => string,\n\tgetTheme: () => string,\n\tattachApplied: (callback: () => void) => void,\n}\n\ntype Formatting = {\n\tgetCalendarType: () => string,\n\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing,\n\tgetCustomIslamicCalendarData?: () => LegacyDateCalendarCustomizing,\n}\n\ntype CalendarUtils = {\n\tgetWeekConfigurationValues: () => {\n\t\tfirstDayOfWeek: number | undefined,\n\t},\n}\n\ntype Locale = {\n\tgetFirstDayOfWeek: () => number,\n\t_get: () => CLDRData,\n};\n\nclass OpenUI5Support {\n\tstatic isAtLeastVersion116() {\n\t\tconst version = window.sap.ui!.version as string;\n\t\tconst parts = version.split(\".\");\n\t\tif (!parts || parts.length < 2) {\n\t\t\treturn false;\n\t\t}\n\t\treturn parseInt(parts[0]) > 1 || parseInt(parts[1]) >= 116;\n\t}\n\n\tstatic isOpenUI5Detected() {\n\t\treturn typeof window.sap?.ui?.require === \"function\";\n\t}\n\n\tstatic init() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\treturn new Promise<void>(resolve => {\n\t\t\twindow.sap.ui.require([\"sap/ui/core/Core\"], async (Core: OpenUI5Core) => {\n\t\t\t\tconst callback = () => {\n\t\t\t\t\tlet deps: Array<string> = [\"sap/ui/core/Popup\", \"sap/ui/core/Patcher\", \"sap/ui/core/LocaleData\"];\n\t\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) { // for versions since 1.116.0 and onward, use the modular core\n\t\t\t\t\t\tdeps = [\n\t\t\t\t\t\t\t...deps,\n\t\t\t\t\t\t\t\"sap/base/i18n/Formatting\",\n\t\t\t\t\t\t\t\"sap/base/i18n/Localization\",\n\t\t\t\t\t\t\t\"sap/ui/core/ControlBehavior\",\n\t\t\t\t\t\t\t\"sap/ui/core/Theming\",\n\t\t\t\t\t\t\t\"sap/ui/core/date/CalendarUtils\",\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\twindow.sap.ui.require(deps, (Popup: OpenUI5Popup, Patcher: OpenUI5Patcher) => {\n\t\t\t\t\t\tpatchPatcher(Patcher);\n\t\t\t\t\t\tpatchPopup(Popup);\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\t\t\tawait Core.ready();\n\t\t\t\t\tcallback();\n\t\t\t\t} else {\n\t\t\t\t\tCore.attachInit(callback);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tstatic getConfigurationSettingsObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst ControlBehavior = window.sap.ui.require(\"sap/ui/core/ControlBehavior\") as ControlBehavior;\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\tconst Theming = window.sap.ui.require(\"sap/ui/core/Theming\") as Theming;\n\t\t\tconst Formatting = window.sap.ui.require(\"sap/base/i18n/Formatting\") as Formatting;\n\t\t\tconst CalendarUtils = window.sap.ui.require(\"sap/ui/core/date/CalendarUtils\") as CalendarUtils;\n\n\t\t\treturn {\n\t\t\t\tanimationMode: ControlBehavior.getAnimationMode(),\n\t\t\t\tlanguage: Localization.getLanguage(),\n\t\t\t\ttheme: Theming.getTheme(),\n\t\t\t\tthemeRoot: Theming.getThemeRoot(),\n\t\t\t\trtl: Localization.getRTL(),\n\t\t\t\ttimezone: Localization.getTimezone(),\n\t\t\t\tcalendarType: Formatting.getCalendarType(),\n\t\t\t\tformatSettings: {\n\t\t\t\t\tfirstDayOfWeek: CalendarUtils.getWeekConfigurationValues().firstDayOfWeek,\n\t\t\t\t\tlegacyDateCalendarCustomizing: Formatting.getCustomIslamicCalendarData?.()\n\t\t\t\t\t\t\t\t\t\t\t\t?? Formatting.getLegacyDateCalendarCustomizing?.(),\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\treturn {\n\t\t\tanimationMode: config.getAnimationMode(),\n\t\t\tlanguage: config.getLanguage(),\n\t\t\ttheme: config.getTheme(),\n\t\t\tthemeRoot: config.getThemeRoot(),\n\t\t\trtl: config.getRTL(),\n\t\t\ttimezone: config.getTimezone(),\n\t\t\tcalendarType: config.getCalendarType(),\n\t\t\tformatSettings: {\n\t\t\t\tfirstDayOfWeek: LocaleData ? LocaleData.getInstance(config.getLocale()).getFirstDayOfWeek() : undefined,\n\t\t\t\tlegacyDateCalendarCustomizing: config.getFormatSettings().getLegacyDateCalendarCustomizing(),\n\t\t\t},\n\t\t};\n\t}\n\n\tstatic getLocaleDataObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\treturn LocaleData.getInstance(Localization.getLanguageTag())._get();\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\treturn LocaleData.getInstance(config.getLocale())._get();\n\t}\n\n\tstatic _listenForThemeChange() {\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Theming: Theming = window.sap.ui.require(\"sap/ui/core/Theming\");\n\t\t\tTheming.attachApplied(() => {\n\t\t\t\tsetTheme(Theming.getTheme());\n\t\t\t});\n\t\t} else {\n\t\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\t\tconst config = Core.getConfiguration();\n\t\t\tCore.attachThemeChanged(() => {\n\t\t\t\tsetTheme(config.getTheme());\n\t\t\t});\n\t\t}\n\t}\n\n\tstatic attachListeners() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tOpenUI5Support._listenForThemeChange();\n\t}\n\n\tstatic cssVariablesLoaded() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst link = [...document.head.children].find(el => el.id === \"sap-ui-theme-sap.ui.core\") as HTMLLinkElement; // more reliable than querySelector early\n\t\tif (!link) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn !!link.href.match(/\\/css(-|_)variables\\.css/);\n\t}\n}\n\nregisterFeature(\"OpenUI5Support\", OpenUI5Support);\n\nexport default OpenUI5Support;\n"]}
@@ -7,6 +7,7 @@ type OpenUI5Popup = {
7
7
  _closed: (...args: any[]) => void;
8
8
  getOpenState: () => "CLOSED" | "CLOSING" | "OPEN" | "OPENING";
9
9
  getContent: () => Element;
10
+ onFocusEvent: (e: FocusEvent) => void;
10
11
  };
11
12
  };
12
13
  declare const patchPopup: (Popup: OpenUI5Popup) => void;
@@ -36,6 +36,16 @@ const patchClosed = (Popup) => {
36
36
  }
37
37
  };
38
38
  };
39
+ const patchFocusEvent = (Popup) => {
40
+ const origFocusEvent = Popup.prototype.onFocusEvent;
41
+ Popup.prototype.onFocusEvent = function onFocusEvent(e) {
42
+ const isTypeFocus = e.type === "focus" || e.type === "activate";
43
+ const target = e.target;
44
+ if (!isTypeFocus || !target.closest("[ui5-popover],[ui5-responsive-popover],[ui5-dialog]")) {
45
+ origFocusEvent.call(this, e);
46
+ }
47
+ };
48
+ };
39
49
  const createGlobalStyles = () => {
40
50
  const stylesheet = new CSSStyleSheet();
41
51
  stylesheet.replaceSync(`.sapMPopup-CTX:popover-open { inset: unset; }`);
@@ -45,6 +55,7 @@ const patchPopup = (Popup) => {
45
55
  patchOpen(Popup); // Popup.prototype.open
46
56
  patchClosed(Popup); // Popup.prototype._closed
47
57
  createGlobalStyles(); // Ensures correct popover positioning by OpenUI5 (otherwise 0,0 is the center of the screen)
58
+ patchFocusEvent(Popup); // Popup.prototype.onFocusEvent
48
59
  };
49
60
  export default patchPopup;
50
61
  //# sourceMappingURL=patchPopup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"patchPopup.js","sourceRoot":"","sources":["../../src/features/patchPopup.ts"],"names":[],"mappings":"AAeA,MAAM,iBAAiB,GAAG,CAAC,MAAmB,EAAE,EAAE;IACjD,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACzC,MAAM,CAAC,WAAW,EAAE,CAAC;AACtB,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,MAAmB,EAAE,EAAE;IAClD,IAAI,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE;QACnC,MAAM,CAAC,WAAW,EAAE,CAAC;QACrB,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;KAClC;AACF,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,KAAmB,EAAE,EAAE;IACzC,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC;IACtC,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,SAAS,IAAI,CAAC,GAAG,IAAW;QAClD,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,sCAAsC;QAClE,MAAM,oBAAoB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AAM,UAAU,GAAG,CAAC,KAAmB,EAAE,EAAE;IAC1C,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,uBAAuB;IACzC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,0BAA0B;IAC9C,kBAAkB,EAAE,CAAC,CAAC,6FAA6F;AACpH,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["// OpenUI5's Element.js subset\ntype Element = {\n\tgetDomRef: () => HTMLElement | null,\n}\n\n// The lifecycle of Popup.js is open -> _opened -> close -> _closed, we're interested in the first (open) and last (_closed)\ntype OpenUI5Popup = {\n\tprototype: {\n\t\topen: (...args: any[]) => void,\n\t\t_closed: (...args: any[]) => void,\n\t\tgetOpenState: () => \"CLOSED\" | \"CLOSING\" | \"OPEN\" | \"OPENING\",\n\t\tgetContent: () => Element, // this is the OpenUI5 Element/Control instance that opens the Popup (usually sap.m.Popover/sap.m.Dialog)\n\t}\n};\n\nconst openNativePopover = (domRef: HTMLElement) => {\n\tdomRef.setAttribute(\"popover\", \"manual\");\n\tdomRef.showPopover();\n};\n\nconst closeNativePopover = (domRef: HTMLElement) => {\n\tif (domRef.hasAttribute(\"popover\")) {\n\t\tdomRef.hidePopover();\n\t\tdomRef.removeAttribute(\"popover\");\n\t}\n};\n\nconst patchOpen = (Popup: OpenUI5Popup) => {\n\tconst origOpen = Popup.prototype.open;\n\tPopup.prototype.open = function open(...args: any[]) {\n\t\torigOpen.apply(this, args); // call open first to initiate opening\n\t\tconst topLayerAlreadyInUse = !!document.body.querySelector(\":popover-open\"); // check if there is already something in the top layer\n\t\tconst openingInitiated = [\"OPENING\", \"OPEN\"].includes(this.getOpenState());\n\t\tif (openingInitiated && topLayerAlreadyInUse) {\n\t\t\tconst element = this.getContent();\n\t\t\tif (element) {\n\t\t\t\tconst domRef = element.getDomRef();\n\t\t\t\tif (domRef) {\n\t\t\t\t\topenNativePopover(domRef);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n};\n\nconst patchClosed = (Popup: OpenUI5Popup) => {\n\tconst _origClosed = Popup.prototype._closed;\n\tPopup.prototype._closed = function _closed(...args: any[]) {\n\t\tconst element = this.getContent();\n\t\tconst domRef = element.getDomRef();\n\t\t_origClosed.apply(this, args); // only then call _close\n\t\tif (domRef) {\n\t\t\tcloseNativePopover(domRef); // unset the popover attribute and close the native popover, but only if still in DOM\n\t\t}\n\t};\n};\n\nconst createGlobalStyles = () => {\n\tconst stylesheet = new CSSStyleSheet();\n\tstylesheet.replaceSync(`.sapMPopup-CTX:popover-open { inset: unset; }`);\n\tdocument.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];\n};\n\nconst patchPopup = (Popup: OpenUI5Popup) => {\n\tpatchOpen(Popup); // Popup.prototype.open\n\tpatchClosed(Popup); // Popup.prototype._closed\n\tcreateGlobalStyles(); // Ensures correct popover positioning by OpenUI5 (otherwise 0,0 is the center of the screen)\n};\n\nexport default patchPopup;\nexport type { OpenUI5Popup };\n"]}
1
+ {"version":3,"file":"patchPopup.js","sourceRoot":"","sources":["../../src/features/patchPopup.ts"],"names":[],"mappings":"AAgBA,MAAM,iBAAiB,GAAG,CAAC,MAAmB,EAAE,EAAE;IACjD,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACzC,MAAM,CAAC,WAAW,EAAE,CAAC;AACtB,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,MAAmB,EAAE,EAAE;IAClD,IAAI,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE;QACnC,MAAM,CAAC,WAAW,EAAE,CAAC;QACrB,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;KAClC;AACF,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,KAAmB,EAAE,EAAE;IACzC,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC;IACtC,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,SAAS,IAAI,CAAC,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AG,SAAS,YAAY,CAAC,CAAa;QACjE,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,KAAK,OAAO,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC;QAChE,MAAM,MAAM,GAAG,CAAC,CAAC,MAAqB,CAAC;QACvC,IAAI,CAAC,WAAW,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,qDAAqD,CAAC,EAAE;YAC3F,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;SAC7B;IACF,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC/B,MAAM,UAAU,GAAG,IAAI,aAAa,EAAE,CAAC;IACvC,UAAU,CAAC,WAAW,CAAC,+CAA+C,CAAC,CAAC;IACxE,QAAQ,CAAC,kBAAkB,GAAG,CAAC,GAAG,QAAQ,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;AAC5E,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,KAAmB,EAAE,EAAE;IAC1C,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,uBAAuB;IACzC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,0BAA0B;IAC9C,kBAAkB,EAAE,CAAC,CAAC,6FAA6F;IACnH,eAAe,CAAC,KAAK,CAAC,CAAC,CAAA,+BAA+B;AACvD,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["// OpenUI5's Element.js subset\ntype Element = {\n\tgetDomRef: () => HTMLElement | null,\n}\n\n// The lifecycle of Popup.js is open -> _opened -> close -> _closed, we're interested in the first (open) and last (_closed)\ntype OpenUI5Popup = {\n\tprototype: {\n\t\topen: (...args: any[]) => void,\n\t\t_closed: (...args: any[]) => void,\n\t\tgetOpenState: () => \"CLOSED\" | \"CLOSING\" | \"OPEN\" | \"OPENING\",\n\t\tgetContent: () => Element, // this is the OpenUI5 Element/Control instance that opens the Popup (usually sap.m.Popover/sap.m.Dialog)\n\t\tonFocusEvent: (e: FocusEvent) => void,\n\t}\n};\n\nconst openNativePopover = (domRef: HTMLElement) => {\n\tdomRef.setAttribute(\"popover\", \"manual\");\n\tdomRef.showPopover();\n};\n\nconst closeNativePopover = (domRef: HTMLElement) => {\n\tif (domRef.hasAttribute(\"popover\")) {\n\t\tdomRef.hidePopover();\n\t\tdomRef.removeAttribute(\"popover\");\n\t}\n};\n\nconst patchOpen = (Popup: OpenUI5Popup) => {\n\tconst origOpen = Popup.prototype.open;\n\tPopup.prototype.open = function open(...args: any[]) {\n\t\torigOpen.apply(this, args); // call open first to initiate opening\n\t\tconst topLayerAlreadyInUse = !!document.body.querySelector(\":popover-open\"); // check if there is already something in the top layer\n\t\tconst openingInitiated = [\"OPENING\", \"OPEN\"].includes(this.getOpenState());\n\t\tif (openingInitiated && topLayerAlreadyInUse) {\n\t\t\tconst element = this.getContent();\n\t\t\tif (element) {\n\t\t\t\tconst domRef = element.getDomRef();\n\t\t\t\tif (domRef) {\n\t\t\t\t\topenNativePopover(domRef);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n};\n\nconst patchClosed = (Popup: OpenUI5Popup) => {\n\tconst _origClosed = Popup.prototype._closed;\n\tPopup.prototype._closed = function _closed(...args: any[]) {\n\t\tconst element = this.getContent();\n\t\tconst domRef = element.getDomRef();\n\t\t_origClosed.apply(this, args); // only then call _close\n\t\tif (domRef) {\n\t\t\tcloseNativePopover(domRef); // unset the popover attribute and close the native popover, but only if still in DOM\n\t\t}\n\t};\n};\n\nconst patchFocusEvent = (Popup: OpenUI5Popup) => {\n\tconst origFocusEvent = Popup.prototype.onFocusEvent;\n\tPopup.prototype.onFocusEvent = function onFocusEvent(e: FocusEvent) {\n\t\tconst isTypeFocus = e.type === \"focus\" || e.type === \"activate\";\n\t\tconst target = e.target as HTMLElement;\n\t\tif (!isTypeFocus || !target.closest(\"[ui5-popover],[ui5-responsive-popover],[ui5-dialog]\")) {\n\t\t\torigFocusEvent.call(this, e);\n\t\t}\n\t};\n};\n\nconst createGlobalStyles = () => {\n\tconst stylesheet = new CSSStyleSheet();\n\tstylesheet.replaceSync(`.sapMPopup-CTX:popover-open { inset: unset; }`);\n\tdocument.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];\n};\n\nconst patchPopup = (Popup: OpenUI5Popup) => {\n\tpatchOpen(Popup); // Popup.prototype.open\n\tpatchClosed(Popup); // Popup.prototype._closed\n\tcreateGlobalStyles(); // Ensures correct popover positioning by OpenUI5 (otherwise 0,0 is the center of the screen)\n\tpatchFocusEvent(Popup);// Popup.prototype.onFocusEvent\n};\n\nexport default patchPopup;\nexport type { OpenUI5Popup };\n"]}
@@ -1,11 +1,11 @@
1
1
  const VersionInfo = {
2
- version: "2.0.0-rc.4",
2
+ version: "2.0.0-rc.6",
3
3
  major: 2,
4
4
  minor: 0,
5
5
  patch: 0,
6
- suffix: "-rc.4",
6
+ suffix: "-rc.6",
7
7
  isNext: false,
8
- buildTime: 1716998972,
8
+ buildTime: 1718638412,
9
9
  };
10
10
  export default VersionInfo;
11
11
  //# sourceMappingURL=VersionInfo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"VersionInfo.js","sourceRoot":"","sources":["../../src/generated/VersionInfo.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IACnB,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,UAAU;CACrB,CAAC;AACF,eAAe,WAAW,CAAC","sourcesContent":["const VersionInfo = {\n\tversion: \"2.0.0-rc.4\",\n\tmajor: 2,\n\tminor: 0,\n\tpatch: 0,\n\tsuffix: \"-rc.4\",\n\tisNext: false,\n\tbuildTime: 1716998972,\n};\nexport default VersionInfo;"]}
1
+ {"version":3,"file":"VersionInfo.js","sourceRoot":"","sources":["../../src/generated/VersionInfo.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IACnB,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,UAAU;CACrB,CAAC;AACF,eAAe,WAAW,CAAC","sourcesContent":["const VersionInfo = {\n\tversion: \"2.0.0-rc.6\",\n\tmajor: 2,\n\tminor: 0,\n\tpatch: 0,\n\tsuffix: \"-rc.6\",\n\tisNext: false,\n\tbuildTime: 1718638412,\n};\nexport default VersionInfo;"]}
package/dist/prod/Boot.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";import d from"./util/whenDOMReady.js";import c from"./EventProvider.js";import u from"./FontFace.js";import v from"./SystemCSSVars.js";import{getTheme as i}from"./config/Theme.js";import a from"./theming/applyTheme.js";import{registerCurrentRuntime as g}from"./Runtimes.js";import{getFeature as m}from"./FeaturesRegistry.js";import{attachThemeRegistered as y}from"./theming/ThemeRegistered.js";let o=!1,r;const p=new c,h=()=>o,P=e=>{if(!o){p.attachEvent("boot",e);return}e()},l=async()=>{if(r!==void 0)return r;const e=async n=>{if(g(),typeof document>"u"){n();return}y(S);const t=m("OpenUI5Support"),f=t?t.isOpenUI5Detected():!1,s=m("F6Navigation");t&&await t.init(),s&&!f&&s.init(),await d(),await a(i()),t&&t.attachListeners(),u(),v(),n(),o=!0,await p.fireEventAsync("boot")};return r=new Promise(e),r},S=e=>{o&&e===i()&&a(i())};export{l as boot,P as attachBoot,h as isBooted};
1
+ "use strict";import d from"./util/whenDOMReady.js";import c from"./EventProvider.js";import u from"./FontFace.js";import v from"./SystemCSSVars.js";import{getTheme as i}from"./config/Theme.js";import a from"./theming/applyTheme.js";import{registerCurrentRuntime as y}from"./Runtimes.js";import{getFeature as p}from"./FeaturesRegistry.js";import{attachThemeRegistered as g}from"./theming/ThemeRegistered.js";let o=!1,r;const m=new c,h=()=>o,P=e=>{if(!o){m.attachEvent("boot",e);return}e()},l=async()=>{if(r!==void 0)return r;const e=async n=>{if(y(),typeof document>"u"){n();return}g(S);const t=p("OpenUI5Support"),f=t?t.isOpenUI5Detected():!1,s=p("F6Navigation");t&&await t.init(),s&&!f&&s.init(),await d(),await a(i()),t&&t.attachListeners(),u(),v(),n(),o=!0,await m.fireEventAsync("boot")};return r=new Promise(e),r},S=e=>{o&&e===i()&&a(i())};export{l as boot,P as attachBoot,h as isBooted};
2
2
  //# sourceMappingURL=Boot.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Boot.ts"],
4
- "sourcesContent": ["import whenDOMReady from \"./util/whenDOMReady.js\";\nimport EventProvider from \"./EventProvider.js\";\nimport insertFontFace from \"./FontFace.js\";\nimport insertSystemCSSVars from \"./SystemCSSVars.js\";\nimport { getTheme } from \"./config/Theme.js\";\nimport applyTheme from \"./theming/applyTheme.js\";\nimport { registerCurrentRuntime } from \"./Runtimes.js\";\nimport { getFeature } from \"./FeaturesRegistry.js\";\nimport type OpenUI5Support from \"./features/OpenUI5Support.js\";\nimport type F6Navigation from \"./features/F6Navigation.js\";\nimport { PromiseResolve } from \"./types.js\";\nimport { attachThemeRegistered } from \"./theming/ThemeRegistered.js\";\n\nlet booted = false;\nlet bootPromise: Promise<void>;\nconst eventProvider = new EventProvider<void, void>();\n\nconst isBooted = (): boolean => {\n\treturn booted;\n};\n\n/**\n * Attaches a callback that will be executed after boot finishes.\n * **Note:** If the framework already booted, the callback will be immediately executed.\n * @public\n * @param { Function } listener\n */\nconst attachBoot = (listener: () => void) => {\n\tif (!booted) {\n\t\teventProvider.attachEvent(\"boot\", listener);\n\t\treturn;\n\t}\n\n\tlistener();\n};\n\nconst boot = async (): Promise<void> => {\n\tif (bootPromise !== undefined) {\n\t\treturn bootPromise;\n\t}\n\n\tconst bootExecutor = async (resolve: PromiseResolve) => {\n\t\tregisterCurrentRuntime();\n\n\t\tif (typeof document === \"undefined\") {\n\t\t\tresolve();\n\t\t\treturn;\n\t\t}\n\n\t\tattachThemeRegistered(onThemeRegistered);\n\n\t\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\t\tconst isOpenUI5Loaded = openUI5Support ? openUI5Support.isOpenUI5Detected() : false;\n\t\tconst f6Navigation = getFeature<typeof F6Navigation>(\"F6Navigation\");\n\n\t\tif (openUI5Support) {\n\t\t\tawait openUI5Support.init();\n\t\t}\n\n\t\tif (f6Navigation && !isOpenUI5Loaded) {\n\t\t\tf6Navigation.init();\n\t\t}\n\n\t\tawait whenDOMReady();\n\t\tawait applyTheme(getTheme());\n\t\topenUI5Support && openUI5Support.attachListeners();\n\t\tinsertFontFace();\n\t\tinsertSystemCSSVars();\n\n\t\tresolve();\n\n\t\tbooted = true;\n\t\tawait eventProvider.fireEventAsync(\"boot\");\n\t};\n\n\tbootPromise = new Promise(bootExecutor as (resolve: PromiseResolve) => void);\n\treturn bootPromise;\n};\n\n/**\n * Callback, executed after theme properties registration\n * to apply the newly registered theme.\n * @private\n * @param { string } theme\n */\nconst onThemeRegistered = (theme: string) => {\n\tif (booted && theme === getTheme()) { // getTheme should only be called if \"booted\" is true\n\t\tapplyTheme(getTheme());\n\t}\n};\n\nexport {\n\tboot,\n\tattachBoot,\n\tisBooted,\n};\n"],
4
+ "sourcesContent": ["import whenDOMReady from \"./util/whenDOMReady.js\";\nimport EventProvider from \"./EventProvider.js\";\nimport insertFontFace from \"./FontFace.js\";\nimport insertSystemCSSVars from \"./SystemCSSVars.js\";\nimport { getTheme } from \"./config/Theme.js\";\nimport applyTheme from \"./theming/applyTheme.js\";\nimport { registerCurrentRuntime } from \"./Runtimes.js\";\nimport { getFeature } from \"./FeaturesRegistry.js\";\nimport type OpenUI5Support from \"./features/OpenUI5Support.js\";\nimport type F6Navigation from \"./features/F6Navigation.js\";\nimport type { PromiseResolve } from \"./types.js\";\nimport { attachThemeRegistered } from \"./theming/ThemeRegistered.js\";\n\nlet booted = false;\nlet bootPromise: Promise<void>;\nconst eventProvider = new EventProvider<void, void>();\n\nconst isBooted = (): boolean => {\n\treturn booted;\n};\n\n/**\n * Attaches a callback that will be executed after boot finishes.\n * **Note:** If the framework already booted, the callback will be immediately executed.\n * @public\n * @param { Function } listener\n */\nconst attachBoot = (listener: () => void) => {\n\tif (!booted) {\n\t\teventProvider.attachEvent(\"boot\", listener);\n\t\treturn;\n\t}\n\n\tlistener();\n};\n\nconst boot = async (): Promise<void> => {\n\tif (bootPromise !== undefined) {\n\t\treturn bootPromise;\n\t}\n\n\tconst bootExecutor = async (resolve: PromiseResolve) => {\n\t\tregisterCurrentRuntime();\n\n\t\tif (typeof document === \"undefined\") {\n\t\t\tresolve();\n\t\t\treturn;\n\t\t}\n\n\t\tattachThemeRegistered(onThemeRegistered);\n\n\t\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\t\tconst isOpenUI5Loaded = openUI5Support ? openUI5Support.isOpenUI5Detected() : false;\n\t\tconst f6Navigation = getFeature<typeof F6Navigation>(\"F6Navigation\");\n\n\t\tif (openUI5Support) {\n\t\t\tawait openUI5Support.init();\n\t\t}\n\n\t\tif (f6Navigation && !isOpenUI5Loaded) {\n\t\t\tf6Navigation.init();\n\t\t}\n\n\t\tawait whenDOMReady();\n\t\tawait applyTheme(getTheme());\n\t\topenUI5Support && openUI5Support.attachListeners();\n\t\tinsertFontFace();\n\t\tinsertSystemCSSVars();\n\n\t\tresolve();\n\n\t\tbooted = true;\n\t\tawait eventProvider.fireEventAsync(\"boot\");\n\t};\n\n\tbootPromise = new Promise(bootExecutor as (resolve: PromiseResolve) => void);\n\treturn bootPromise;\n};\n\n/**\n * Callback, executed after theme properties registration\n * to apply the newly registered theme.\n * @private\n * @param { string } theme\n */\nconst onThemeRegistered = (theme: string) => {\n\tif (booted && theme === getTheme()) { // getTheme should only be called if \"booted\" is true\n\t\tapplyTheme(getTheme());\n\t}\n};\n\nexport {\n\tboot,\n\tattachBoot,\n\t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"registerCurrentRuntime", "getFeature", "attachThemeRegistered", "booted", "bootPromise", "eventProvider", "isBooted", "attachBoot", "listener", "boot", "bootExecutor", "resolve", "onThemeRegistered", "openUI5Support", "isOpenUI5Loaded", "f6Navigation", "theme"]
7
7
  }
@@ -1,4 +1,4 @@
1
- "use strict";import p from"./getSharedResource.js";import{getCurrentRuntimeIndex as u,compareRuntimes as f,getAllRuntimes as b}from"./Runtimes.js";const m=p("Tags",new Map),d=new Set;let s=new Map,c;const g=-1,h=e=>{d.add(e),m.set(e,u())},w=e=>d.has(e),$=()=>[...d.values()],R=e=>{let n=m.get(e);n===void 0&&(n=g),s.has(n)||s.set(n,new Set),s.get(n).add(e),c||(c=setTimeout(()=>{T(),s=new Map,c=void 0},1e3))},T=()=>{const e=b(),n=u(),l=e[n];let t="Multiple UI5 Web Components instances detected.";e.length>1&&(t=`${t}
1
+ "use strict";import p from"./getSharedResource.js";import{getCurrentRuntimeIndex as u,compareRuntimes as f,getAllRuntimes as b}from"./Runtimes.js";const m=p("Tags",new Map),d=new Set;let s=new Map,c;const g=-1,h=e=>{d.add(e),m.set(e,u())},w=e=>d.has(e),$=()=>[...d.values()],y=e=>{let n=m.get(e);n===void 0&&(n=g),s.has(n)||s.set(n,new Set),s.get(n).add(e),c||(c=setTimeout(()=>{R(),s=new Map,c=void 0},1e3))},R=()=>{const e=b(),n=u(),l=e[n];let t="Multiple UI5 Web Components instances detected.";e.length>1&&(t=`${t}
2
2
  Loading order (versions before 1.1.0 not listed): ${e.map(i=>`
3
3
  ${i.description}`).join("")}`),[...s.keys()].forEach(i=>{let o,r;i===g?(o=1,r={description:"Older unknown runtime"}):(o=f(n,i),r=e[i]);let a;o>0?a="an older":o<0?a="a newer":a="the same",t=`${t}
4
4
 
@@ -6,5 +6,5 @@ ${i.description}`).join("")}`),[...s.keys()].forEach(i=>{let o,r;i===g?(o=1,r={d
6
6
  WARNING! If your code uses features of the above web components, unavailable in ${r.description}, it might not work as expected!`:t=`${t}
7
7
  Since the above web components were defined by the same or newer version runtime, they should be compatible with your code.`}),t=`${t}
8
8
 
9
- To prevent other runtimes from defining tags that you use, consider using scoping or have third-party libraries use scoping: https://github.com/SAP/ui5-webcomponents/blob/main/docs/2-advanced/03-scoping.md.`,console.warn(t)};export{h as registerTag,w as isTagRegistered,$ as getAllRegisteredTags,R as recordTagRegistrationFailure};
9
+ To prevent other runtimes from defining tags that you use, consider using scoping or have third-party libraries use scoping: https://github.com/SAP/ui5-webcomponents/blob/main/docs/2-advanced/03-scoping.md.`,console.warn(t)};export{h as registerTag,w as isTagRegistered,$ as getAllRegisteredTags,y as recordTagRegistrationFailure};
10
10
  //# sourceMappingURL=CustomElementsRegistry.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/CustomElementsRegistry.ts"],
4
- "sourcesContent": ["import getSharedResource from \"./getSharedResource.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes, getAllRuntimes } from \"./Runtimes.js\";\nimport { Timeout } from \"./types.js\";\n\nconst Tags = getSharedResource<Map<string, number>>(\"Tags\", new Map());\nconst Definitions = new Set<string>();\n\nlet Failures = new Map<number, Set<string>>();\nlet failureTimeout: Timeout | undefined;\n\nconst UNKNOWN_RUNTIME = -1;\n\nconst registerTag = (tag: string) => {\n\tDefinitions.add(tag);\n\tTags.set(tag, getCurrentRuntimeIndex());\n};\n\nconst isTagRegistered = (tag: string) => {\n\treturn Definitions.has(tag);\n};\n\nconst getAllRegisteredTags = () => {\n\treturn [...Definitions.values()];\n};\n\nconst recordTagRegistrationFailure = (tag: string) => {\n\tlet tagRegRuntimeIndex = Tags.get(tag);\n\tif (tagRegRuntimeIndex === undefined) {\n\t\ttagRegRuntimeIndex = UNKNOWN_RUNTIME; // If the tag is taken, but not registered in Tags, then a version before 1.1.0 defined it => use the \"unknown\" key\n\t}\n\n\tif (!Failures.has(tagRegRuntimeIndex)) {\n\t\tFailures.set(tagRegRuntimeIndex, new Set());\n\t}\n\tFailures.get(tagRegRuntimeIndex)!.add(tag);\n\n\tif (!failureTimeout) {\n\t\tfailureTimeout = setTimeout(() => {\n\t\t\tdisplayFailedRegistrations();\n\t\t\tFailures = new Map();\n\t\t\tfailureTimeout = undefined;\n\t\t}, 1000);\n\t}\n};\n\nconst displayFailedRegistrations = () => {\n\tconst allRuntimes = getAllRuntimes();\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\tconst currentRuntime = allRuntimes[currentRuntimeIndex];\n\n\tlet message = `Multiple UI5 Web Components instances detected.`;\n\n\tif (allRuntimes.length > 1) {\n\t\tmessage = `${message}\\nLoading order (versions before 1.1.0 not listed): ${allRuntimes.map(runtime => `\\n${runtime.description}`).join(\"\")}`;\n\t}\n\n\t[...Failures.keys()].forEach(otherRuntimeIndex => {\n\t\tlet comparison: number;\n\t\tlet otherRuntime;\n\n\t\tif (otherRuntimeIndex === UNKNOWN_RUNTIME) { // version < 1.1.0 defined the tag\n\t\t\tcomparison = 1; // the current runtime is considered newer\n\t\t\totherRuntime = {\n\t\t\t\tdescription: `Older unknown runtime`,\n\t\t\t};\n\t\t} else {\n\t\t\tcomparison = compareRuntimes(currentRuntimeIndex, otherRuntimeIndex);\n\t\t\totherRuntime = allRuntimes[otherRuntimeIndex];\n\t\t}\n\n\t\tlet compareWord;\n\t\tif (comparison > 0) {\n\t\t\tcompareWord = \"an older\";\n\t\t} else if (comparison < 0) {\n\t\t\tcompareWord = \"a newer\";\n\t\t} else {\n\t\t\tcompareWord = \"the same\";\n\t\t}\n\t\tmessage = `${message}\\n\\n\"${currentRuntime.description}\" failed to define ${Failures.get(otherRuntimeIndex)!.size} tag(s) as they were defined by a runtime of ${compareWord} version \"${otherRuntime.description}\": ${([...Failures.get(otherRuntimeIndex)!]).sort().join(\", \")}.`;\n\n\t\tif (comparison > 0) {\n\t\t\tmessage = `${message}\\nWARNING! If your code uses features of the above web components, unavailable in ${otherRuntime.description}, it might not work as expected!`;\n\t\t} else {\n\t\t\tmessage = `${message}\\nSince the above web components were defined by the same or newer version runtime, they should be compatible with your code.`;\n\t\t}\n\t});\n\n\tmessage = `${message}\\n\\nTo prevent other runtimes from defining tags that you use, consider using scoping or have third-party libraries use scoping: https://github.com/SAP/ui5-webcomponents/blob/main/docs/2-advanced/03-scoping.md.`;\n\n\tconsole.warn(message); // eslint-disable-line\n};\n\nexport {\n\tregisterTag,\n\tisTagRegistered,\n\tgetAllRegisteredTags,\n\trecordTagRegistrationFailure,\n};\n"],
4
+ "sourcesContent": ["import getSharedResource from \"./getSharedResource.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes, getAllRuntimes } from \"./Runtimes.js\";\nimport type { Timeout } from \"./types.js\";\n\nconst Tags = getSharedResource<Map<string, number>>(\"Tags\", new Map());\nconst Definitions = new Set<string>();\n\nlet Failures = new Map<number, Set<string>>();\nlet failureTimeout: Timeout | undefined;\n\nconst UNKNOWN_RUNTIME = -1;\n\nconst registerTag = (tag: string) => {\n\tDefinitions.add(tag);\n\tTags.set(tag, getCurrentRuntimeIndex());\n};\n\nconst isTagRegistered = (tag: string) => {\n\treturn Definitions.has(tag);\n};\n\nconst getAllRegisteredTags = () => {\n\treturn [...Definitions.values()];\n};\n\nconst recordTagRegistrationFailure = (tag: string) => {\n\tlet tagRegRuntimeIndex = Tags.get(tag);\n\tif (tagRegRuntimeIndex === undefined) {\n\t\ttagRegRuntimeIndex = UNKNOWN_RUNTIME; // If the tag is taken, but not registered in Tags, then a version before 1.1.0 defined it => use the \"unknown\" key\n\t}\n\n\tif (!Failures.has(tagRegRuntimeIndex)) {\n\t\tFailures.set(tagRegRuntimeIndex, new Set());\n\t}\n\tFailures.get(tagRegRuntimeIndex)!.add(tag);\n\n\tif (!failureTimeout) {\n\t\tfailureTimeout = setTimeout(() => {\n\t\t\tdisplayFailedRegistrations();\n\t\t\tFailures = new Map();\n\t\t\tfailureTimeout = undefined;\n\t\t}, 1000);\n\t}\n};\n\nconst displayFailedRegistrations = () => {\n\tconst allRuntimes = getAllRuntimes();\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\tconst currentRuntime = allRuntimes[currentRuntimeIndex];\n\n\tlet message = `Multiple UI5 Web Components instances detected.`;\n\n\tif (allRuntimes.length > 1) {\n\t\tmessage = `${message}\\nLoading order (versions before 1.1.0 not listed): ${allRuntimes.map(runtime => `\\n${runtime.description}`).join(\"\")}`;\n\t}\n\n\t[...Failures.keys()].forEach(otherRuntimeIndex => {\n\t\tlet comparison: number;\n\t\tlet otherRuntime;\n\n\t\tif (otherRuntimeIndex === UNKNOWN_RUNTIME) { // version < 1.1.0 defined the tag\n\t\t\tcomparison = 1; // the current runtime is considered newer\n\t\t\totherRuntime = {\n\t\t\t\tdescription: `Older unknown runtime`,\n\t\t\t};\n\t\t} else {\n\t\t\tcomparison = compareRuntimes(currentRuntimeIndex, otherRuntimeIndex);\n\t\t\totherRuntime = allRuntimes[otherRuntimeIndex];\n\t\t}\n\n\t\tlet compareWord;\n\t\tif (comparison > 0) {\n\t\t\tcompareWord = \"an older\";\n\t\t} else if (comparison < 0) {\n\t\t\tcompareWord = \"a newer\";\n\t\t} else {\n\t\t\tcompareWord = \"the same\";\n\t\t}\n\t\tmessage = `${message}\\n\\n\"${currentRuntime.description}\" failed to define ${Failures.get(otherRuntimeIndex)!.size} tag(s) as they were defined by a runtime of ${compareWord} version \"${otherRuntime.description}\": ${([...Failures.get(otherRuntimeIndex)!]).sort().join(\", \")}.`;\n\n\t\tif (comparison > 0) {\n\t\t\tmessage = `${message}\\nWARNING! If your code uses features of the above web components, unavailable in ${otherRuntime.description}, it might not work as expected!`;\n\t\t} else {\n\t\t\tmessage = `${message}\\nSince the above web components were defined by the same or newer version runtime, they should be compatible with your code.`;\n\t\t}\n\t});\n\n\tmessage = `${message}\\n\\nTo prevent other runtimes from defining tags that you use, consider using scoping or have third-party libraries use scoping: https://github.com/SAP/ui5-webcomponents/blob/main/docs/2-advanced/03-scoping.md.`;\n\n\tconsole.warn(message); // eslint-disable-line\n};\n\nexport {\n\treg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I,CAAiB,EACnEE,EAAeP,EAAYK,CAAiB,GAG7C,IAAIG,EACAF,EAAa,EAChBE,EAAc,WACJF,EAAa,EACvBE,EAAc,UAEdA,EAAc,WAEfL,EAAU,GAAGA,CAAO;AAAA;AAAA,GAAQD,EAAe,WAAW,sBAAsBZ,EAAS,IAAIe,CAAiB,EAAG,IAAI,gDAAgDG,CAAW,aAAaD,EAAa,WAAW,MAAO,CAAC,GAAGjB,EAAS,IAAIe,CAAiB,CAAE,EAAG,KAAK,EAAE,KAAK,IAAI,CAAC,IAE5QC,EAAa,EAChBH,EAAU,GAAGA,CAAO;AAAA,kFAAqFI,EAAa,WAAW,mCAEjIJ,EAAU,GAAGA,CAAO;AAAA,4HAEtB,CAAC,EAEDA,EAAU,GAAGA,CAAO;AAAA;AAAA,gNAEpB,QAAQ,KAAKA,CAAO,CACrB,EAEA,OACCV,KAAA,YACAE,KAAA,gBACAC,KAAA,qBACAC,KAAA",
6
6
  "names": ["getSharedResource", "getCurrentRuntimeIndex", "compareRuntimes", "getAllRuntimes", "Tags", "Definitions", "Failures", "failureTimeout", "UNKNOWN_RUNTIME", "registerTag", "tag", "isTagRegistered", "getAllRegisteredTags", "recordTagRegistrationFailure", "tagRegRuntimeIndex", "displayFailedRegistrations", "allRuntimes", "currentRuntimeIndex", "currentRuntime", "message", "runtime", "otherRuntimeIndex", "comparison", "otherRuntime", "compareWord"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/InitialConfiguration.ts"],
4
- "sourcesContent": ["import merge from \"./thirdparty/merge.js\";\nimport { getFeature } from \"./FeaturesRegistry.js\";\nimport { DEFAULT_THEME } from \"./generated/AssetParameters.js\";\nimport validateThemeRoot from \"./validateThemeRoot.js\";\nimport type OpenUI5Support from \"./features/OpenUI5Support.js\";\nimport type { FormatSettings } from \"./config/FormatSettings.js\";\nimport AnimationMode from \"./types/AnimationMode.js\";\nimport CalendarType from \"./types/CalendarType.js\";\n\nlet initialized = false;\n\ntype InitialConfig = {\n\t[key: string]: any,\n\tanimationMode: AnimationMode,\n\ttheme: string,\n\tthemeRoot: string | undefined,\n\tlanguage: string | undefined,\n\tcalendarType: CalendarType | undefined,\n\tsecondaryCalendarType: CalendarType | undefined,\n\ttimezone: string | undefined,\n\tnoConflict: boolean,\n\tformatSettings: FormatSettings,\n\tfetchDefaultLanguage: boolean,\n};\n\nlet initialConfig: InitialConfig = {\n\tanimationMode: AnimationMode.Full,\n\ttheme: DEFAULT_THEME,\n\tthemeRoot: undefined,\n\trtl: undefined,\n\tlanguage: undefined,\n\ttimezone: undefined,\n\tcalendarType: undefined,\n\tsecondaryCalendarType: undefined,\n\tnoConflict: false, // no URL\n\tformatSettings: {},\n\tfetchDefaultLanguage: false,\n};\n\n/* General settings */\nconst getAnimationMode = () => {\n\tinitConfiguration();\n\treturn initialConfig.animationMode;\n};\n\nconst getTheme = () => {\n\tinitConfiguration();\n\treturn initialConfig.theme;\n};\n\nconst getThemeRoot = () => {\n\tinitConfiguration();\n\treturn initialConfig.themeRoot;\n};\n\nconst getLanguage = () => {\n\tinitConfiguration();\n\treturn initialConfig.language;\n};\n\n/**\n * Returns if the default language, that is inlined at build time,\n * should be fetched over the network instead.\n * @returns {Boolean}\n */\nconst getFetchDefaultLanguage = () => {\n\tinitConfiguration();\n\treturn initialConfig.fetchDefaultLanguage;\n};\n\nconst getNoConflict = () => {\n\tinitConfiguration();\n\treturn initialConfig.noConflict;\n};\n\n/**\n * Get the configured calendar type\n * @returns { String } the name of the configured calendar type\n */\nconst getCalendarType = () => {\n\tinitConfiguration();\n\treturn initialConfig.calendarType;\n};\n\nconst getSecondaryCalendarType = () => {\n\tinitConfiguration();\n\treturn initialConfig.secondaryCalendarType;\n};\n\n/**\n * Returns the configured IANA timezone ID.\n * @returns { String } the configured IANA timezone ID, e.g. \"America/New_York\"\n */\nconst getTimezone = () => {\n\tinitConfiguration();\n\treturn initialConfig.timezone;\n};\n\nconst getFormatSettings = () => {\n\tinitConfiguration();\n\treturn initialConfig.formatSettings;\n};\n\nconst booleanMapping = new Map();\nbooleanMapping.set(\"true\", true);\nbooleanMapping.set(\"false\", false);\n\nconst parseConfigurationScript = () => {\n\tconst configScript = document.querySelector(\"[data-ui5-config]\") || document.querySelector(\"[data-id='sap-ui-config']\"); // for backward compatibility\n\n\tlet configJSON;\n\n\tif (configScript) {\n\t\ttry {\n\t\t\tconfigJSON = JSON.parse(configScript.innerHTML);\n\t\t} catch (err) {\n\t\t\tconsole.warn(\"Incorrect data-sap-ui-config format. Please use JSON\"); /* eslint-disable-line */\n\t\t}\n\n\t\tif (configJSON) {\n\t\t\tinitialConfig = merge(initialConfig, configJSON);\n\t\t}\n\t}\n};\n\nconst parseURLParameters = () => {\n\tconst params = new URLSearchParams(window.location.search);\n\n\t// Process \"sap-*\" params first\n\tparams.forEach((value, key) => {\n\t\tconst parts = key.split(\"sap-\").length;\n\t\tif (parts === 0 || parts === key.split(\"sap-ui-\").length) {\n\t\t\treturn;\n\t\t}\n\n\t\tapplyURLParam(key, value, \"sap\");\n\t});\n\n\t// Process \"sap-ui-*\" params\n\tparams.forEach((value, key) => {\n\t\tif (!key.startsWith(\"sap-ui\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tapplyURLParam(key, value, \"sap-ui\");\n\t});\n};\n\nconst normalizeThemeRootParamValue = (value: string) => {\n\tconst themeRoot = value.split(\"@\")[1];\n\n\treturn validateThemeRoot(themeRoot);\n};\n\nconst normalizeThemeParamValue = (param: string, value: string) => {\n\tif (param === \"theme\" && value.includes(\"@\")) { // the theme parameter might have @<URL-TO-THEME> in the value - strip this\n\t\treturn value.split(\"@\")[0];\n\t}\n\n\treturn value;\n};\n\nconst applyURLParam = (key: string, value: string, paramType: string) => {\n\tconst lowerCaseValue = value.toLowerCase();\n\tconst param = key.split(`${paramType}-`)[1];\n\n\tif (booleanMapping.has(value)) {\n\t\tvalue = booleanMapping.get(lowerCaseValue);\n\t}\n\n\tif (param === \"theme\") {\n\t\tinitialConfig.theme = normalizeThemeParamValue(param, value);\n\n\t\tif (value && value.includes(\"@\")) {\n\t\t\tinitialConfig.themeRoot = normalizeThemeRootParamValue(value);\n\t\t}\n\t} else {\n\t\tinitialConfig[param] = value;\n\t}\n};\n\nconst applyOpenUI5Configuration = () => {\n\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\tif (!openUI5Support || !openUI5Support.isOpenUI5Detected()) {\n\t\treturn;\n\t}\n\n\tconst OpenUI5Config = openUI5Support.getConfigurationSettingsObject();\n\tinitialConfig = merge(initialConfig, OpenUI5Config);\n};\n\nconst initConfiguration = () => {\n\tif (typeof document === \"undefined\" || initialized) {\n\t\treturn;\n\t}\n\n\t// 1. Lowest priority - configuration script\n\tparseConfigurationScript();\n\n\t// 2. URL parameters overwrite configuration script parameters\n\tparseURLParameters();\n\n\t// 3. If OpenUI5 is detected, it has the highest priority\n\tapplyOpenUI5Configuration();\n\n\tinitialized = true;\n};\n\nexport {\n\tgetAnimationMode,\n\tgetTheme,\n\tgetThemeRoot,\n\tgetLanguage,\n\tgetFetchDefaultLanguage,\n\tgetNoConflict,\n\tgetCalendarType,\n\tgetSecondaryCalendarType,\n\tgetTimezone,\n\tgetFormatSettings,\n};\n"],
4
+ "sourcesContent": ["import merge from \"./thirdparty/merge.js\";\nimport { getFeature } from \"./FeaturesRegistry.js\";\nimport { DEFAULT_THEME } from \"./generated/AssetParameters.js\";\nimport validateThemeRoot from \"./validateThemeRoot.js\";\nimport type OpenUI5Support from \"./features/OpenUI5Support.js\";\nimport type { FormatSettings } from \"./config/FormatSettings.js\";\nimport AnimationMode from \"./types/AnimationMode.js\";\nimport type CalendarType from \"./types/CalendarType.js\";\n\nlet initialized = false;\n\ntype InitialConfig = {\n\t[key: string]: any,\n\tanimationMode: AnimationMode,\n\ttheme: string,\n\tthemeRoot: string | undefined,\n\tlanguage: string | undefined,\n\tcalendarType: CalendarType | undefined,\n\tsecondaryCalendarType: CalendarType | undefined,\n\ttimezone: string | undefined,\n\tnoConflict: boolean,\n\tformatSettings: FormatSettings,\n\tfetchDefaultLanguage: boolean,\n};\n\nlet initialConfig: InitialConfig = {\n\tanimationMode: AnimationMode.Full,\n\ttheme: DEFAULT_THEME,\n\tthemeRoot: undefined,\n\trtl: undefined,\n\tlanguage: undefined,\n\ttimezone: undefined,\n\tcalendarType: undefined,\n\tsecondaryCalendarType: undefined,\n\tnoConflict: false, // no URL\n\tformatSettings: {},\n\tfetchDefaultLanguage: false,\n};\n\n/* General settings */\nconst getAnimationMode = () => {\n\tinitConfiguration();\n\treturn initialConfig.animationMode;\n};\n\nconst getTheme = () => {\n\tinitConfiguration();\n\treturn initialConfig.theme;\n};\n\nconst getThemeRoot = () => {\n\tinitConfiguration();\n\treturn initialConfig.themeRoot;\n};\n\nconst getLanguage = () => {\n\tinitConfiguration();\n\treturn initialConfig.language;\n};\n\n/**\n * Returns if the default language, that is inlined at build time,\n * should be fetched over the network instead.\n * @returns {Boolean}\n */\nconst getFetchDefaultLanguage = () => {\n\tinitConfiguration();\n\treturn initialConfig.fetchDefaultLanguage;\n};\n\nconst getNoConflict = () => {\n\tinitConfiguration();\n\treturn initialConfig.noConflict;\n};\n\n/**\n * Get the configured calendar type\n * @returns { String } the name of the configured calendar type\n */\nconst getCalendarType = () => {\n\tinitConfiguration();\n\treturn initialConfig.calendarType;\n};\n\nconst getSecondaryCalendarType = () => {\n\tinitConfiguration();\n\treturn initialConfig.secondaryCalendarType;\n};\n\n/**\n * Returns the configured IANA timezone ID.\n * @returns { String } the configured IANA timezone ID, e.g. \"America/New_York\"\n */\nconst getTimezone = () => {\n\tinitConfiguration();\n\treturn initialConfig.timezone;\n};\n\nconst getFormatSettings = () => {\n\tinitConfiguration();\n\treturn initialConfig.formatSettings;\n};\n\nconst booleanMapping = new Map();\nbooleanMapping.set(\"true\", true);\nbooleanMapping.set(\"false\", false);\n\nconst parseConfigurationScript = () => {\n\tconst configScript = document.querySelector(\"[data-ui5-config]\") || document.querySelector(\"[data-id='sap-ui-config']\"); // for backward compatibility\n\n\tlet configJSON;\n\n\tif (configScript) {\n\t\ttry {\n\t\t\tconfigJSON = JSON.parse(configScript.innerHTML);\n\t\t} catch (err) {\n\t\t\tconsole.warn(\"Incorrect data-sap-ui-config format. Please use JSON\"); /* eslint-disable-line */\n\t\t}\n\n\t\tif (configJSON) {\n\t\t\tinitialConfig = merge(initialConfig, configJSON);\n\t\t}\n\t}\n};\n\nconst parseURLParameters = () => {\n\tconst params = new URLSearchParams(window.location.search);\n\n\t// Process \"sap-*\" params first\n\tparams.forEach((value, key) => {\n\t\tconst parts = key.split(\"sap-\").length;\n\t\tif (parts === 0 || parts === key.split(\"sap-ui-\").length) {\n\t\t\treturn;\n\t\t}\n\n\t\tapplyURLParam(key, value, \"sap\");\n\t});\n\n\t// Process \"sap-ui-*\" params\n\tparams.forEach((value, key) => {\n\t\tif (!key.startsWith(\"sap-ui\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tapplyURLParam(key, value, \"sap-ui\");\n\t});\n};\n\nconst normalizeThemeRootParamValue = (value: string) => {\n\tconst themeRoot = value.split(\"@\")[1];\n\n\treturn validateThemeRoot(themeRoot);\n};\n\nconst normalizeThemeParamValue = (param: string, value: string) => {\n\tif (param === \"theme\" && value.includes(\"@\")) { // the theme parameter might have @<URL-TO-THEME> in the value - strip this\n\t\treturn value.split(\"@\")[0];\n\t}\n\n\treturn value;\n};\n\nconst applyURLParam = (key: string, value: string, paramType: string) => {\n\tconst lowerCaseValue = value.toLowerCase();\n\tconst param = key.split(`${paramType}-`)[1];\n\n\tif (booleanMapping.has(value)) {\n\t\tvalue = booleanMapping.get(lowerCaseValue);\n\t}\n\n\tif (param === \"theme\") {\n\t\tinitialConfig.theme = normalizeThemeParamValue(param, value);\n\n\t\tif (value && value.includes(\"@\")) {\n\t\t\tinitialConfig.themeRoot = normalizeThemeRootParamValue(value);\n\t\t}\n\t} else {\n\t\tinitialConfig[param] = value;\n\t}\n};\n\nconst applyOpenUI5Configuration = () => {\n\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\tif (!openUI5Support || !openUI5Support.isOpenUI5Detected()) {\n\t\treturn;\n\t}\n\n\tconst OpenUI5Config = openUI5Support.getConfigurationSettingsObject();\n\tinitialConfig = merge(initialConfig, OpenUI5Config);\n};\n\nconst initConfiguration = () => {\n\tif (typeof document === \"undefined\" || initialized) {\n\t\treturn;\n\t}\n\n\t// 1. Lowest priority - configuration script\n\tparseConfigurationScript();\n\n\t// 2. URL parameters overwrite configuration script parameters\n\tparseURLParameters();\n\n\t// 3. If OpenUI5 is detected, it has the highest priority\n\tapplyOpenUI5Configuration();\n\n\tinitialized = true;\n};\n\nexport {\n\tgetAnimationMode,\n\tgetTheme,\n\tgetThemeRoot,\n\tgetLanguage,\n\tgetFetchDefaultLanguage,\n\tgetNoConflict,\n\tgetCalendarType,\n\tgetSecondaryCalendarType,\n\tgetTimezone,\n\tgetFormatSettings,\n};\n"],
5
5
  "mappings": "aAAA,OAAOA,MAAW,wBAClB,OAAS,cAAAC,MAAkB,wBAC3B,OAAS,iBAAAC,MAAqB,iCAC9B,OAAOC,MAAuB,yBAG9B,OAAOC,MAAmB,2BAG1B,IAAIC,EAAc,GAgBdC,EAA+B,CAClC,cAAeF,EAAc,KAC7B,MAAOF,EACP,UAAW,OACX,IAAK,OACL,SAAU,OACV,SAAU,OACV,aAAc,OACd,sBAAuB,OACvB,WAAY,GACZ,eAAgB,CAAC,EACjB,qBAAsB,EACvB,EAGA,MAAMK,EAAmB,KACxBC,EAAkB,EACXF,EAAc,eAGhBG,EAAW,KAChBD,EAAkB,EACXF,EAAc,OAGhBI,EAAe,KACpBF,EAAkB,EACXF,EAAc,WAGhBK,EAAc,KACnBH,EAAkB,EACXF,EAAc,UAQhBM,EAA0B,KAC/BJ,EAAkB,EACXF,EAAc,sBAGhBO,EAAgB,KACrBL,EAAkB,EACXF,EAAc,YAOhBQ,EAAkB,KACvBN,EAAkB,EACXF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CAAC,EAEtCd,EAAe,IAAIM,CAAK,IAC3BA,EAAQN,EAAe,IAAIe,CAAc,GAGtCF,IAAU,SACbzB,EAAc,MAAQwB,EAAyBC,EAAOP,CAAK,EAEvDA,GAASA,EAAM,SAAS,GAAG,IAC9BlB,EAAc,UAAYsB,EAA6BJ,CAAK,IAG7DlB,EAAcyB,CAAK,EAAIP,CAEzB,EAEMU,EAA4B,IAAM,CACvC,MAAMC,EAAiBlC,EAAkC,gBAAgB,EACzE,GAAI,CAACkC,GAAkB,CAACA,EAAe,kBAAkB,EACxD,OAGD,MAAMC,EAAgBD,EAAe,+BAA+B,EACpE7B,EAAgBN,EAAMM,EAAe8B,CAAa,CACnD,EAEM5B,EAAoB,IAAM,CAC3B,OAAO,SAAa,KAAeH,IAKvCc,EAAyB,EAGzBG,EAAmB,EAGnBY,EAA0B,EAE1B7B,EAAc,GACf,EAEA,OACCE,KAAA,iBACAE,KAAA,SACAC,KAAA,aACAC,KAAA,YACAC,KAAA,wBACAC,KAAA,cACAC,KAAA,gBACAC,KAAA,yBACAC,KAAA,YACAC,KAAA",
6
6
  "names": ["merge", "getFeature", "DEFAULT_THEME", "validateThemeRoot", "AnimationMode", "initialized", "initialConfig", "getAnimationMode", "initConfiguration", "getTheme", "getThemeRoot", "getLanguage", "getFetchDefaultLanguage", "getNoConflict", "getCalendarType", "getSecondaryCalendarType", "getTimezone", "getFormatSettings", "booleanMapping", "parseConfigurationScript", "configScript", "configJSON", "parseURLParameters", "params", "value", "key", "parts", "applyURLParam", "normalizeThemeRootParamValue", "themeRoot", "normalizeThemeParamValue", "param", "paramType", "lowerCaseValue", "applyOpenUI5Configuration", "openUI5Support", "OpenUI5Config"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";import{getCurrentRuntimeIndex as a,compareRuntimes as g}from"./Runtimes.js";const l=typeof document>"u",o=(e,t)=>t?`${e}|${t}`:e,f=e=>e===void 0?!0:g(a(),parseInt(e))===1,u=(e,t,n="",i)=>{const s=typeof e=="string"?e:e.content,c=a(),r=new CSSStyleSheet;r.replaceSync(s),r._ui5StyleId=o(t,n),i&&(r._ui5RuntimeIndex=c,r._ui5Theme=i),document.adoptedStyleSheets=[...document.adoptedStyleSheets,r]},S=(e,t,n="",i)=>{const s=typeof e=="string"?e:e.content,c=a(),r=document.adoptedStyleSheets.find(d=>d._ui5StyleId===o(t,n));if(r)if(!i)r.replaceSync(s||"");else{const d=r._ui5RuntimeIndex;(r._ui5Theme!==i||f(d))&&(r.replaceSync(s||""),r._ui5RuntimeIndex=String(c),r._ui5Theme=i)}},y=(e,t="")=>l?!0:!!document.adoptedStyleSheets.find(n=>n._ui5StyleId===o(e,t)),p=(e,t="")=>{document.adoptedStyleSheets=document.adoptedStyleSheets.filter(n=>n._ui5StyleId!==o(e,t))},m=(e,t,n="",i)=>{y(t,n)?S(e,t,n,i):u(e,t,n,i)},R=(e,t)=>{if(e===void 0)return t;if(t===void 0)return e;const n=typeof t=="string"?t:t.content;return typeof e=="string"?`${e} ${n}`:{content:`${e.content} ${n}`,packageName:e.packageName,fileName:e.fileName}};export{u as createStyle,y as hasStyle,S as updateStyle,p as removeStyle,m as createOrUpdateStyle,R as mergeStyles};
1
+ "use strict";import{getCurrentRuntimeIndex as a,compareRuntimes as g}from"./Runtimes.js";const l=typeof document>"u",o=(e,t)=>t?`${e}|${t}`:e,f=e=>e===void 0?!0:g(a(),parseInt(e))===1,u=(e,t,n="",s)=>{const i=typeof e=="string"?e:e.content,c=a(),r=new CSSStyleSheet;r.replaceSync(i),r._ui5StyleId=o(t,n),s&&(r._ui5RuntimeIndex=c,r._ui5Theme=s),document.adoptedStyleSheets=[...document.adoptedStyleSheets,r]},y=(e,t,n="",s)=>{const i=typeof e=="string"?e:e.content,c=a(),r=document.adoptedStyleSheets.find(d=>d._ui5StyleId===o(t,n));if(r)if(!s)r.replaceSync(i||"");else{const d=r._ui5RuntimeIndex;(r._ui5Theme!==s||f(d))&&(r.replaceSync(i||""),r._ui5RuntimeIndex=String(c),r._ui5Theme=s)}},S=(e,t="")=>l?!0:!!document.adoptedStyleSheets.find(n=>n._ui5StyleId===o(e,t)),p=(e,t="")=>{document.adoptedStyleSheets=document.adoptedStyleSheets.filter(n=>n._ui5StyleId!==o(e,t))},m=(e,t,n="",s)=>{S(t,n)?y(e,t,n,s):u(e,t,n,s)},R=(e,t)=>{if(e===void 0)return t;if(t===void 0)return e;const n=typeof t=="string"?t:t.content;return typeof e=="string"?`${e} ${n}`:{content:`${e.content} ${n}`,packageName:e.packageName,fileName:e.fileName}};export{u as createStyle,S as hasStyle,y as updateStyle,p as removeStyle,m as createOrUpdateStyle,R as mergeStyles};
2
2
  //# sourceMappingURL=ManagedStyles.js.map