diff --git a/packages/ui5-tooling-modules/lib/rollup-plugin-webcomponents.js b/packages/ui5-tooling-modules/lib/rollup-plugin-webcomponents.js index c78e30861..fa82b4276 100644 --- a/packages/ui5-tooling-modules/lib/rollup-plugin-webcomponents.js +++ b/packages/ui5-tooling-modules/lib/rollup-plugin-webcomponents.js @@ -1,5 +1,5 @@ const { join, dirname } = require("path"); -const { readFileSync } = require("fs"); +const { readFileSync, existsSync } = require("fs"); const WebComponentRegistry = require("./utils/WebComponentRegistry"); const { compile } = require("handlebars"); @@ -13,69 +13,89 @@ module.exports = function ({ log, resolveModule, framework, skip } = {}) { log.warn("Skipping Web Components transformation as UI5 version is < 1.120.0"); } + // helper function to extract the npm package name from a module name const getNpmPackageName = (source) => { const npmPackageScopeRegEx = /^((?:(@[^/]+)\/)?([^/]+))(?:\/(.*))?$/; return npmPackageScopeRegEx.exec(source)?.[1]; }; + // helper function to load and compile a handlebars template const loadAndCompileTemplate = (templatePath) => { const templateFile = readFileSync(join(__dirname, templatePath), { encoding: "utf-8" }); return compile(templateFile); }; - const libTemplateFn = loadAndCompileTemplate("templates/Library.hbs"); - const webccTemplateFn = loadAndCompileTemplate("templates/WebComponentControl.hbs"); - const webcmpTemplateFn = loadAndCompileTemplate("templates/WebComponentMonkeyPatches.hbs"); + // handlebars templates for the Web Components transformation + const webcTmplFnPackage = loadAndCompileTemplate("templates/Package.hbs"); + const webcTmplFnControl = loadAndCompileTemplate("templates/WrapperControl.hbs"); + const webcTmplFnPatches = loadAndCompileTemplate("templates/MonkeyPatches.hbs"); + // helper function to load a NPM package and its custom elements metadata const loadNpmPackage = (npmPackage, emitFile) => { let registryEntry = WebComponentRegistry.getPackage(npmPackage); if (!registryEntry) { const packageJsonPath = resolveModule(`${npmPackage}/package.json`); if (packageJsonPath) { const packageJson = require(packageJsonPath); - // for all UI5 Web Components packages we use the internal custom elements metadata - if (/^@ui5\/webcomponents/.test(packageJson.name)) { - packageJson.customElements = /* packageJson.customElements || */ "dist/custom-elements-internal.json"; + const npmPackagePath = dirname(packageJsonPath); + // check if the custom elements metadata file exists (fallback to custom-elements-internal.json for @ui5/webcomponents) + let metadataPath; + if (packageJson.customElements) { + const customElementsInternalPath = join(npmPackagePath, packageJson.customElements.replace("custom-elements.json", "custom-elements-internal.json")); + const customElementsPath = join(npmPackagePath, packageJson.customElements); + if (existsSync(customElementsInternalPath)) { + metadataPath = customElementsInternalPath; + } else if (existsSync(customElementsPath)) { + metadataPath = customElementsPath; + } + } else { + const customElementsInternalPath = join(npmPackagePath, "dist/custom-elements-internal.json"); + const customElementsPath = join(npmPackagePath, "dist/custom-elements.json"); + if (existsSync(customElementsInternalPath)) { + metadataPath = customElementsInternalPath; + log.warn(`The package.json of ${npmPackage} does not contain a "customElements" field. Using found "dist/custom-elements-internal.json"`); + } else if (existsSync(customElementsPath)) { + metadataPath = customElementsPath; + log.warn(`The package.json of ${npmPackage} does not contain a "customElements" field. Using found "dist/custom-elements.json"`); + } } - if (!registryEntry && packageJson.customElements) { - // load the dependent Web Component packages - const libraryDependencies = []; - Object.keys(packageJson.dependencies || {}).forEach((dep) => { - const package = loadNpmPackage(dep, emitFile); - if (package) { - libraryDependencies.push(package.namespace); - } + // load the dependent Web Component packages + const libraryDependencies = []; + Object.keys(packageJson.dependencies || {}).forEach((dep) => { + const package = loadNpmPackage(dep, emitFile); + if (package) { + libraryDependencies.push(package.namespace); + } + }); + + // load custom elements metadata + if (metadataPath) { + const customElementsMetadata = JSON.parse(readFileSync(metadataPath, { encoding: "utf-8" })); + + // first time registering a new Web Component package + registryEntry = WebComponentRegistry.register({ + customElementsMetadata, + namespace: npmPackage, + npmPackagePath, + version: packageJson.version, }); - // load custom elements metadata - const metadataPath = resolveModule(join(npmPackage, packageJson.customElements)); - if (metadataPath) { - const customElementsMetadata = require(metadataPath); - - // first time registering a new Web Component package - const npmPackagePath = dirname(packageJsonPath); - registryEntry = WebComponentRegistry.register({ - customElementsMetadata, - namespace: npmPackage, - npmPackagePath, - }); - - // assign the dependencies - registryEntry.dependencies = libraryDependencies; - - // each library has a library module (with a concrete name) that needs to be emitted - emitFile({ - type: "chunk", - id: `${npmPackage}/library`, - name: `${npmPackage}/library`, - }); - } + // assign the dependencies + registryEntry.dependencies = libraryDependencies; + + // each NPM package has a package module (with a concrete name) that needs to be emitted + emitFile({ + type: "chunk", + id: `${npmPackage}`, + name: `${npmPackage}`, + }); } } } return registryEntry; }; + // helper function to lookup a Web Component class by its module name const lookupWebComponentsClass = (source, emitFile) => { let clazz; if ((clazz = WebComponentRegistry.getClassDefinition(source))) { @@ -101,6 +121,9 @@ module.exports = function ({ log, resolveModule, framework, skip } = {}) { } }; + // list of external dependencies that are needed for the Web Components transformation + const externalDeps = ["sap/ui/core/webc/WebComponent", "sap/ui/core/webc/WebComponentRenderer", "sap/ui/base/DataType", "sap/base/strings/hyphenate"]; + return { name: "webcomponents", async resolveId(source, importer /*, options*/) { @@ -112,7 +135,7 @@ module.exports = function ({ log, resolveModule, framework, skip } = {}) { if (!importer || isImporterUI5Module) { // resolve UI5 modules (hypenate is needed for WebComponentsMonkeyPatches and could be removed again) - if (["sap/ui/core/webc/WebComponent", "sap/ui/core/Lib", "sap/ui/base/DataType", "sap/base/strings/hyphenate"].includes(source)) { + if (externalDeps.includes(source)) { // mark Ui5 runtime dependencies as external // to avoid warnings about missing dependencies return { @@ -121,6 +144,7 @@ module.exports = function ({ log, resolveModule, framework, skip } = {}) { }; } + const npmPackage = getNpmPackageName(source); let clazz; if ((clazz = lookupWebComponentsClass(source, this.emitFile))) { const modulePath = `${clazz.package}/${clazz.module}`; @@ -136,16 +160,15 @@ module.exports = function ({ log, resolveModule, framework, skip } = {}) { clazz, }, }; - } else if (source.endsWith("/library.js") || source.endsWith("/library")) { - const npmPackage = getNpmPackageName(source); + } else if (new RegExp(`^${npmPackage}(.js)?$`).test(source)) { let package; if ((package = WebComponentRegistry.getPackage(npmPackage))) { - const modulePath = `${npmPackage}/library.js`; - const absModulePath = `${package.npmPackagePath}/library.js`; + const modulePath = `${npmPackage}.js`; + const absModulePath = `${package.npmPackagePath}.js`; return { id: absModulePath, attributes: { - ui5Type: "library", + ui5Type: "package", modulePath, absModulePath, package, @@ -161,46 +184,35 @@ module.exports = function ({ log, resolveModule, framework, skip } = {}) { return null; } const moduleInfo = this.getModuleInfo(id); - if (moduleInfo.attributes.ui5Type === "library") { + if (moduleInfo.attributes.ui5Type === "package") { let lib = moduleInfo.attributes.package; - const { namespace } = lib; + const { namespace, version } = lib; // compile the library metadata const metadataObject = { - apiVersion: 2, name: namespace, - dependencies: ["sap.ui.core", ...lib.dependencies], + version, + dependencies: ["sap.ui.core"], types: Object.keys(lib.enums).map((enumName) => `${namespace}.${enumName}`), + interfaces: Object.keys(lib.interfaces).map((interfaceName) => `${namespace}.${interfaceName}`), + controls: Object.keys(lib.customElements).map((elementName) => `${namespace}.${elementName}`), elements: [ /* do we have any? */ ], - controls: Object.keys(lib.customElements).map((elementName) => `${namespace}.${elementName}`), - interfaces: Object.keys(lib.interfaces).map((interfaceName) => `${namespace}.${interfaceName}`), - designtime: `${namespace}/designtime/library.designtime`, - extensions: { - flChangeHandlers: { - "@ui5/webcomponents.Avatar": { - hideControl: "default", - unhideControl: "default", - }, - "@ui5/webcomponents.Button": "@ui5/webcomponents-flexibility.Button", - }, - }, - noLibraryCSS: true, }; const metadata = JSON.stringify(metadataObject, undefined, 2); // generate the library code - const code = libTemplateFn({ + const code = webcTmplFnPackage({ metadata, namespace, enums: lib.enums, - dependencies: lib.dependencies.map((dep) => `${dep}/library`), + dependencies: lib.dependencies, }); // include the monkey patches for the Web Components base library // only for UI5 versions < 1.128.0 (otherwise the monkey patches are not needed anymore) if (namespace === "@ui5/webcomponents-base" && lt(framework?.version || "0.0.0", "1.128.0")) { - const monkeyPatches = webcmpTemplateFn(); + const monkeyPatches = webcTmplFnPatches(); return `${monkeyPatches}\n${code}`; } return code; @@ -212,6 +224,7 @@ module.exports = function ({ log, resolveModule, framework, skip } = {}) { const namespace = ui5Metadata.namespace; const metadataObject = Object.assign({}, ui5Metadata, { library: `${ui5Metadata.namespace}.library`, + designtime: `${ui5Metadata.namespace}/designtime/${clazz.name}.designtime`, }); const metadata = JSON.stringify(metadataObject, undefined, 2); const webcClass = moduleInfo.attributes.absModulePath; // is the absolute path of the original Web Component class @@ -225,7 +238,7 @@ module.exports = function ({ log, resolveModule, framework, skip } = {}) { } // generate the WebComponentControl code - const code = webccTemplateFn({ + const code = webcTmplFnControl({ ui5Class, namespace, metadata, diff --git a/packages/ui5-tooling-modules/lib/templates/Library.hbs b/packages/ui5-tooling-modules/lib/templates/Library.hbs deleted file mode 100644 index b64b20229..000000000 --- a/packages/ui5-tooling-modules/lib/templates/Library.hbs +++ /dev/null @@ -1,18 +0,0 @@ -import Library from "sap/ui/core/Lib"; -import { registerEnum } from "sap/ui/base/DataType"; -{{#each dependencies}} -import "{{this}}"; -{{/each}} - -const theLibrary = Library.init({{{metadata}}}); - -{{#each enums}} -theLibrary["{{name}}"] = { -{{#each members}} - "{{name}}": "{{name}}", -{{/each}} -}; -registerEnum("{{../namespace}}.{{name}}", theLibrary["{{name}}"]); -{{/each}} - -export default theLibrary; diff --git a/packages/ui5-tooling-modules/lib/templates/WebComponentMonkeyPatches.hbs b/packages/ui5-tooling-modules/lib/templates/MonkeyPatches.hbs similarity index 100% rename from packages/ui5-tooling-modules/lib/templates/WebComponentMonkeyPatches.hbs rename to packages/ui5-tooling-modules/lib/templates/MonkeyPatches.hbs diff --git a/packages/ui5-tooling-modules/lib/templates/Package.hbs b/packages/ui5-tooling-modules/lib/templates/Package.hbs new file mode 100644 index 000000000..65e18e8d3 --- /dev/null +++ b/packages/ui5-tooling-modules/lib/templates/Package.hbs @@ -0,0 +1,19 @@ +import { registerEnum } from "sap/ui/base/DataType"; +{{#each dependencies}} +import "{{this}}"; +{{/each}} + +const pkg = { + "_ui5metadata": {{{metadata}}} +}; + +{{#each enums}} +pkg["{{name}}"] = { +{{#each members}} + "{{name}}": "{{name}}", +{{/each}} +}; +registerEnum("{{../namespace}}.{{name}}", pkg["{{name}}"]); +{{/each}} + +export default pkg; diff --git a/packages/ui5-tooling-modules/lib/templates/WebComponentControl.hbs b/packages/ui5-tooling-modules/lib/templates/WrapperControl.hbs similarity index 95% rename from packages/ui5-tooling-modules/lib/templates/WebComponentControl.hbs rename to packages/ui5-tooling-modules/lib/templates/WrapperControl.hbs index f6345522f..5f823b815 100644 --- a/packages/ui5-tooling-modules/lib/templates/WebComponentControl.hbs +++ b/packages/ui5-tooling-modules/lib/templates/WrapperControl.hbs @@ -1,5 +1,5 @@ import WebComponentClass from "{{webcClass}}"; -import "{{namespace}}/library"; +import "{{namespace}}"; import WebComponentBaseClass from "{{webcBaseClass}}"; export default WebComponentBaseClass.extend("{{ui5Class}}", { diff --git a/packages/ui5-tooling-modules/lib/utils/WebComponentRegistry.js b/packages/ui5-tooling-modules/lib/utils/WebComponentRegistry.js index 417696d08..354b273ff 100644 --- a/packages/ui5-tooling-modules/lib/utils/WebComponentRegistry.js +++ b/packages/ui5-tooling-modules/lib/utils/WebComponentRegistry.js @@ -15,10 +15,11 @@ const _classAliases = {}; class RegistryEntry { #customElementsMetadata = {}; - constructor({ customElementsMetadata, namespace, npmPackagePath }) { + constructor({ customElementsMetadata, namespace, npmPackagePath, version }) { this.#customElementsMetadata = customElementsMetadata; this.namespace = namespace; this.npmPackagePath = npmPackagePath; + this.version = version; this.customElements = {}; this.classes = {}; @@ -390,10 +391,10 @@ class RegistryEntry { } const WebComponentRegistry = { - register({ customElementsMetadata, namespace, npmPackagePath }) { + register({ customElementsMetadata, namespace, npmPackagePath, version }) { let entry = _registry[namespace]; if (!entry) { - entry = _registry[namespace] = new RegistryEntry({ customElementsMetadata, namespace, npmPackagePath }); + entry = _registry[namespace] = new RegistryEntry({ customElementsMetadata, namespace, npmPackagePath, version }); // track all classes also via their module name, // so we can access them faster during resource resolution later on diff --git a/packages/ui5-tooling-modules/test/__snap__/4370bd2f/@ui5/webcomponents/dist/CheckBox.js b/packages/ui5-tooling-modules/test/__snap__/4370bd2f/@ui5/webcomponents/dist/CheckBox.js index 4b1727588..e5dafcbe2 100644 --- a/packages/ui5-tooling-modules/test/__snap__/4370bd2f/@ui5/webcomponents/dist/CheckBox.js +++ b/packages/ui5-tooling-modules/test/__snap__/4370bd2f/@ui5/webcomponents/dist/CheckBox.js @@ -1,4 +1,4 @@ -sap.ui.define(['sap/ui/core/Lib', 'sap/ui/base/DataType', 'sap/base/strings/hyphenate', 'sap/ui/core/webc/WebComponentRenderer', 'sap/ui/core/webc/WebComponent'], (function (Library, DataType, hyphenate, WebComponentRenderer, WebComponentBaseClass) { 'use strict'; +sap.ui.define(['sap/ui/base/DataType', 'sap/base/strings/hyphenate', 'sap/ui/core/webc/WebComponentRenderer', 'sap/ui/core/webc/WebComponent'], (function (DataType, hyphenate, WebComponentRenderer, WebComponentBaseClass) { 'use strict'; const isSSR$2 = typeof document === "undefined"; const internals = { @@ -4406,9 +4406,10 @@ sap.ui.define(['sap/ui/core/Lib', 'sap/ui/base/DataType', 'sap/base/strings/hyph } }; - const theLibrary$1 = Library.init({ - "apiVersion": 2, + const pkg$1 = { + "_ui5metadata": { "name": "@ui5/webcomponents-base", + "version": "2.1.2", "dependencies": [ "sap.ui.core" ], @@ -4422,85 +4423,75 @@ sap.ui.define(['sap/ui/core/Lib', 'sap/ui/base/DataType', 'sap/base/strings/hyph "@ui5/webcomponents-base.NavigationMode", "@ui5/webcomponents-base.ValueState" ], - "elements": [], - "controls": [], "interfaces": [], - "designtime": "@ui5/webcomponents-base/designtime/library.designtime", - "extensions": { - "flChangeHandlers": { - "@ui5/webcomponents.Avatar": { - "hideControl": "default", - "unhideControl": "default" - }, - "@ui5/webcomponents.Button": "@ui5/webcomponents-flexibility.Button" - } - }, - "noLibraryCSS": true - }); + "controls": [], + "elements": [] + } + }; - theLibrary$1["AnimationMode"] = { + pkg$1["AnimationMode"] = { "Full": "Full", "Basic": "Basic", "Minimal": "Minimal", "None": "None", }; - DataType.registerEnum("@ui5/webcomponents-base.AnimationMode", theLibrary$1["AnimationMode"]); - theLibrary$1["AriaHasPopup"] = { + DataType.registerEnum("@ui5/webcomponents-base.AnimationMode", pkg$1["AnimationMode"]); + pkg$1["AriaHasPopup"] = { "Dialog": "Dialog", "Grid": "Grid", "ListBox": "ListBox", "Menu": "Menu", "Tree": "Tree", }; - DataType.registerEnum("@ui5/webcomponents-base.AriaHasPopup", theLibrary$1["AriaHasPopup"]); - theLibrary$1["AriaRole"] = { + DataType.registerEnum("@ui5/webcomponents-base.AriaHasPopup", pkg$1["AriaHasPopup"]); + pkg$1["AriaRole"] = { "AlertDialog": "AlertDialog", "Button": "Button", "Dialog": "Dialog", "Link": "Link", }; - DataType.registerEnum("@ui5/webcomponents-base.AriaRole", theLibrary$1["AriaRole"]); - theLibrary$1["CalendarType"] = { + DataType.registerEnum("@ui5/webcomponents-base.AriaRole", pkg$1["AriaRole"]); + pkg$1["CalendarType"] = { "Gregorian": "Gregorian", "Islamic": "Islamic", "Japanese": "Japanese", "Buddhist": "Buddhist", "Persian": "Persian", }; - DataType.registerEnum("@ui5/webcomponents-base.CalendarType", theLibrary$1["CalendarType"]); - theLibrary$1["ItemNavigationBehavior"] = { + DataType.registerEnum("@ui5/webcomponents-base.CalendarType", pkg$1["CalendarType"]); + pkg$1["ItemNavigationBehavior"] = { "Static": "Static", "Cyclic": "Cyclic", }; - DataType.registerEnum("@ui5/webcomponents-base.ItemNavigationBehavior", theLibrary$1["ItemNavigationBehavior"]); - theLibrary$1["MovePlacement"] = { + DataType.registerEnum("@ui5/webcomponents-base.ItemNavigationBehavior", pkg$1["ItemNavigationBehavior"]); + pkg$1["MovePlacement"] = { "On": "On", "Before": "Before", "After": "After", }; - DataType.registerEnum("@ui5/webcomponents-base.MovePlacement", theLibrary$1["MovePlacement"]); - theLibrary$1["NavigationMode"] = { + DataType.registerEnum("@ui5/webcomponents-base.MovePlacement", pkg$1["MovePlacement"]); + pkg$1["NavigationMode"] = { "Auto": "Auto", "Vertical": "Vertical", "Horizontal": "Horizontal", "Paging": "Paging", }; - DataType.registerEnum("@ui5/webcomponents-base.NavigationMode", theLibrary$1["NavigationMode"]); - theLibrary$1["ValueState"] = { + DataType.registerEnum("@ui5/webcomponents-base.NavigationMode", pkg$1["NavigationMode"]); + pkg$1["ValueState"] = { "None": "None", "Positive": "Positive", "Critical": "Critical", "Negative": "Negative", "Information": "Information", }; - DataType.registerEnum("@ui5/webcomponents-base.ValueState", theLibrary$1["ValueState"]); + DataType.registerEnum("@ui5/webcomponents-base.ValueState", pkg$1["ValueState"]); - const theLibrary = Library.init({ - "apiVersion": 2, + const pkg = { + "_ui5metadata": { "name": "@ui5/webcomponents", + "version": "2.1.2", "dependencies": [ - "sap.ui.core", - "@ui5/webcomponents-base" + "sap.ui.core" ], "types": [ "@ui5/webcomponents.AvatarColorScheme", @@ -4559,7 +4550,7 @@ sap.ui.define(['sap/ui/core/Lib', 'sap/ui/base/DataType', 'sap/base/strings/hyph "@ui5/webcomponents.ToolbarItemOverflowBehavior", "@ui5/webcomponents.WrappingType" ], - "elements": [], + "interfaces": [], "controls": [ "@ui5/webcomponents.Avatar", "@ui5/webcomponents.AvatarGroup", @@ -4657,21 +4648,11 @@ sap.ui.define(['sap/ui/core/Lib', 'sap/ui/base/DataType', 'sap/base/strings/hyph "@ui5/webcomponents.TreeItem", "@ui5/webcomponents.TreeItemCustom" ], - "interfaces": [], - "designtime": "@ui5/webcomponents/designtime/library.designtime", - "extensions": { - "flChangeHandlers": { - "@ui5/webcomponents.Avatar": { - "hideControl": "default", - "unhideControl": "default" - }, - "@ui5/webcomponents.Button": "@ui5/webcomponents-flexibility.Button" - } - }, - "noLibraryCSS": true - }); + "elements": [] + } + }; - theLibrary["AvatarColorScheme"] = { + pkg["AvatarColorScheme"] = { "Accent1": "Accent1", "Accent2": "Accent2", "Accent3": "Accent3", @@ -4684,49 +4665,49 @@ sap.ui.define(['sap/ui/core/Lib', 'sap/ui/base/DataType', 'sap/base/strings/hyph "Accent10": "Accent10", "Placeholder": "Placeholder", }; - DataType.registerEnum("@ui5/webcomponents.AvatarColorScheme", theLibrary["AvatarColorScheme"]); - theLibrary["AvatarGroupType"] = { + DataType.registerEnum("@ui5/webcomponents.AvatarColorScheme", pkg["AvatarColorScheme"]); + pkg["AvatarGroupType"] = { "Group": "Group", "Individual": "Individual", }; - DataType.registerEnum("@ui5/webcomponents.AvatarGroupType", theLibrary["AvatarGroupType"]); - theLibrary["AvatarShape"] = { + DataType.registerEnum("@ui5/webcomponents.AvatarGroupType", pkg["AvatarGroupType"]); + pkg["AvatarShape"] = { "Circle": "Circle", "Square": "Square", }; - DataType.registerEnum("@ui5/webcomponents.AvatarShape", theLibrary["AvatarShape"]); - theLibrary["AvatarSize"] = { + DataType.registerEnum("@ui5/webcomponents.AvatarShape", pkg["AvatarShape"]); + pkg["AvatarSize"] = { "XS": "XS", "S": "S", "M": "M", "L": "L", "XL": "XL", }; - DataType.registerEnum("@ui5/webcomponents.AvatarSize", theLibrary["AvatarSize"]); - theLibrary["BackgroundDesign"] = { + DataType.registerEnum("@ui5/webcomponents.AvatarSize", pkg["AvatarSize"]); + pkg["BackgroundDesign"] = { "Solid": "Solid", "Transparent": "Transparent", "Translucent": "Translucent", }; - DataType.registerEnum("@ui5/webcomponents.BackgroundDesign", theLibrary["BackgroundDesign"]); - theLibrary["BarDesign"] = { + DataType.registerEnum("@ui5/webcomponents.BackgroundDesign", pkg["BackgroundDesign"]); + pkg["BarDesign"] = { "Header": "Header", "Subheader": "Subheader", "Footer": "Footer", "FloatingFooter": "FloatingFooter", }; - DataType.registerEnum("@ui5/webcomponents.BarDesign", theLibrary["BarDesign"]); - theLibrary["BorderDesign"] = { + DataType.registerEnum("@ui5/webcomponents.BarDesign", pkg["BarDesign"]); + pkg["BorderDesign"] = { "Solid": "Solid", "None": "None", }; - DataType.registerEnum("@ui5/webcomponents.BorderDesign", theLibrary["BorderDesign"]); - theLibrary["BreadcrumbsDesign"] = { + DataType.registerEnum("@ui5/webcomponents.BorderDesign", pkg["BorderDesign"]); + pkg["BreadcrumbsDesign"] = { "Standard": "Standard", "NoCurrentPage": "NoCurrentPage", }; - DataType.registerEnum("@ui5/webcomponents.BreadcrumbsDesign", theLibrary["BreadcrumbsDesign"]); - theLibrary["BreadcrumbsSeparator"] = { + DataType.registerEnum("@ui5/webcomponents.BreadcrumbsDesign", pkg["BreadcrumbsDesign"]); + pkg["BreadcrumbsSeparator"] = { "Slash": "Slash", "BackSlash": "BackSlash", "DoubleBackSlash": "DoubleBackSlash", @@ -4734,24 +4715,24 @@ sap.ui.define(['sap/ui/core/Lib', 'sap/ui/base/DataType', 'sap/base/strings/hyph "DoubleSlash": "DoubleSlash", "GreaterThan": "GreaterThan", }; - DataType.registerEnum("@ui5/webcomponents.BreadcrumbsSeparator", theLibrary["BreadcrumbsSeparator"]); - theLibrary["BusyIndicatorSize"] = { + DataType.registerEnum("@ui5/webcomponents.BreadcrumbsSeparator", pkg["BreadcrumbsSeparator"]); + pkg["BusyIndicatorSize"] = { "S": "S", "M": "M", "L": "L", }; - DataType.registerEnum("@ui5/webcomponents.BusyIndicatorSize", theLibrary["BusyIndicatorSize"]); - theLibrary["BusyIndicatorTextPlacement"] = { + DataType.registerEnum("@ui5/webcomponents.BusyIndicatorSize", pkg["BusyIndicatorSize"]); + pkg["BusyIndicatorTextPlacement"] = { "Top": "Top", "Bottom": "Bottom", }; - DataType.registerEnum("@ui5/webcomponents.BusyIndicatorTextPlacement", theLibrary["BusyIndicatorTextPlacement"]); - theLibrary["ButtonAccessibleRole"] = { + DataType.registerEnum("@ui5/webcomponents.BusyIndicatorTextPlacement", pkg["BusyIndicatorTextPlacement"]); + pkg["ButtonAccessibleRole"] = { "Button": "Button", "Link": "Link", }; - DataType.registerEnum("@ui5/webcomponents.ButtonAccessibleRole", theLibrary["ButtonAccessibleRole"]); - theLibrary["ButtonDesign"] = { + DataType.registerEnum("@ui5/webcomponents.ButtonAccessibleRole", pkg["ButtonAccessibleRole"]); + pkg["ButtonDesign"] = { "Default": "Default", "Positive": "Positive", "Negative": "Negative", @@ -4759,14 +4740,14 @@ sap.ui.define(['sap/ui/core/Lib', 'sap/ui/base/DataType', 'sap/base/strings/hyph "Emphasized": "Emphasized", "Attention": "Attention", }; - DataType.registerEnum("@ui5/webcomponents.ButtonDesign", theLibrary["ButtonDesign"]); - theLibrary["ButtonType"] = { + DataType.registerEnum("@ui5/webcomponents.ButtonDesign", pkg["ButtonDesign"]); + pkg["ButtonType"] = { "Button": "Button", "Submit": "Submit", "Reset": "Reset", }; - DataType.registerEnum("@ui5/webcomponents.ButtonType", theLibrary["ButtonType"]); - theLibrary["CalendarLegendItemType"] = { + DataType.registerEnum("@ui5/webcomponents.ButtonType", pkg["ButtonType"]); + pkg["CalendarLegendItemType"] = { "None": "None", "Working": "Working", "NonWorking": "NonWorking", @@ -4791,44 +4772,44 @@ sap.ui.define(['sap/ui/core/Lib', 'sap/ui/base/DataType', 'sap/base/strings/hyph "Type19": "Type19", "Type20": "Type20", }; - DataType.registerEnum("@ui5/webcomponents.CalendarLegendItemType", theLibrary["CalendarLegendItemType"]); - theLibrary["CalendarSelectionMode"] = { + DataType.registerEnum("@ui5/webcomponents.CalendarLegendItemType", pkg["CalendarLegendItemType"]); + pkg["CalendarSelectionMode"] = { "Single": "Single", "Multiple": "Multiple", "Range": "Range", }; - DataType.registerEnum("@ui5/webcomponents.CalendarSelectionMode", theLibrary["CalendarSelectionMode"]); - theLibrary["CarouselArrowsPlacement"] = { + DataType.registerEnum("@ui5/webcomponents.CalendarSelectionMode", pkg["CalendarSelectionMode"]); + pkg["CarouselArrowsPlacement"] = { "Content": "Content", "Navigation": "Navigation", }; - DataType.registerEnum("@ui5/webcomponents.CarouselArrowsPlacement", theLibrary["CarouselArrowsPlacement"]); - theLibrary["CarouselPageIndicatorType"] = { + DataType.registerEnum("@ui5/webcomponents.CarouselArrowsPlacement", pkg["CarouselArrowsPlacement"]); + pkg["CarouselPageIndicatorType"] = { "Default": "Default", "Numeric": "Numeric", }; - DataType.registerEnum("@ui5/webcomponents.CarouselPageIndicatorType", theLibrary["CarouselPageIndicatorType"]); - theLibrary["ComboBoxFilter"] = { + DataType.registerEnum("@ui5/webcomponents.CarouselPageIndicatorType", pkg["CarouselPageIndicatorType"]); + pkg["ComboBoxFilter"] = { "StartsWithPerTerm": "StartsWithPerTerm", "StartsWith": "StartsWith", "Contains": "Contains", "None": "None", }; - DataType.registerEnum("@ui5/webcomponents.ComboBoxFilter", theLibrary["ComboBoxFilter"]); - theLibrary["FormItemSpacing"] = { + DataType.registerEnum("@ui5/webcomponents.ComboBoxFilter", pkg["ComboBoxFilter"]); + pkg["FormItemSpacing"] = { "Normal": "Normal", "Large": "Large", }; - DataType.registerEnum("@ui5/webcomponents.FormItemSpacing", theLibrary["FormItemSpacing"]); - theLibrary["Highlight"] = { + DataType.registerEnum("@ui5/webcomponents.FormItemSpacing", pkg["FormItemSpacing"]); + pkg["Highlight"] = { "None": "None", "Positive": "Positive", "Critical": "Critical", "Negative": "Negative", "Information": "Information", }; - DataType.registerEnum("@ui5/webcomponents.Highlight", theLibrary["Highlight"]); - theLibrary["IconDesign"] = { + DataType.registerEnum("@ui5/webcomponents.Highlight", pkg["Highlight"]); + pkg["IconDesign"] = { "Contrast": "Contrast", "Critical": "Critical", "Default": "Default", @@ -4838,14 +4819,14 @@ sap.ui.define(['sap/ui/core/Lib', 'sap/ui/base/DataType', 'sap/base/strings/hyph "NonInteractive": "NonInteractive", "Positive": "Positive", }; - DataType.registerEnum("@ui5/webcomponents.IconDesign", theLibrary["IconDesign"]); - theLibrary["IconMode"] = { + DataType.registerEnum("@ui5/webcomponents.IconDesign", pkg["IconDesign"]); + pkg["IconMode"] = { "Image": "Image", "Decorative": "Decorative", "Interactive": "Interactive", }; - DataType.registerEnum("@ui5/webcomponents.IconMode", theLibrary["IconMode"]); - theLibrary["InputType"] = { + DataType.registerEnum("@ui5/webcomponents.IconMode", pkg["IconMode"]); + pkg["InputType"] = { "Text": "Text", "Email": "Email", "Number": "Number", @@ -4854,47 +4835,47 @@ sap.ui.define(['sap/ui/core/Lib', 'sap/ui/base/DataType', 'sap/base/strings/hyph "URL": "URL", "Search": "Search", }; - DataType.registerEnum("@ui5/webcomponents.InputType", theLibrary["InputType"]); - theLibrary["LinkAccessibleRole"] = { + DataType.registerEnum("@ui5/webcomponents.InputType", pkg["InputType"]); + pkg["LinkAccessibleRole"] = { "Link": "Link", "Button": "Button", }; - DataType.registerEnum("@ui5/webcomponents.LinkAccessibleRole", theLibrary["LinkAccessibleRole"]); - theLibrary["LinkDesign"] = { + DataType.registerEnum("@ui5/webcomponents.LinkAccessibleRole", pkg["LinkAccessibleRole"]); + pkg["LinkDesign"] = { "Default": "Default", "Subtle": "Subtle", "Emphasized": "Emphasized", }; - DataType.registerEnum("@ui5/webcomponents.LinkDesign", theLibrary["LinkDesign"]); - theLibrary["ListAccessibleRole"] = { + DataType.registerEnum("@ui5/webcomponents.LinkDesign", pkg["LinkDesign"]); + pkg["ListAccessibleRole"] = { "List": "List", "Menu": "Menu", "Tree": "Tree", "ListBox": "ListBox", }; - DataType.registerEnum("@ui5/webcomponents.ListAccessibleRole", theLibrary["ListAccessibleRole"]); - theLibrary["ListGrowingMode"] = { + DataType.registerEnum("@ui5/webcomponents.ListAccessibleRole", pkg["ListAccessibleRole"]); + pkg["ListGrowingMode"] = { "Button": "Button", "Scroll": "Scroll", "None": "None", }; - DataType.registerEnum("@ui5/webcomponents.ListGrowingMode", theLibrary["ListGrowingMode"]); - theLibrary["ListItemAccessibleRole"] = { + DataType.registerEnum("@ui5/webcomponents.ListGrowingMode", pkg["ListGrowingMode"]); + pkg["ListItemAccessibleRole"] = { "ListItem": "ListItem", "MenuItem": "MenuItem", "TreeItem": "TreeItem", "Option": "Option", "None": "None", }; - DataType.registerEnum("@ui5/webcomponents.ListItemAccessibleRole", theLibrary["ListItemAccessibleRole"]); - theLibrary["ListItemType"] = { + DataType.registerEnum("@ui5/webcomponents.ListItemAccessibleRole", pkg["ListItemAccessibleRole"]); + pkg["ListItemType"] = { "Inactive": "Inactive", "Active": "Active", "Detail": "Detail", "Navigation": "Navigation", }; - DataType.registerEnum("@ui5/webcomponents.ListItemType", theLibrary["ListItemType"]); - theLibrary["ListSelectionMode"] = { + DataType.registerEnum("@ui5/webcomponents.ListItemType", pkg["ListItemType"]); + pkg["ListSelectionMode"] = { "None": "None", "Single": "Single", "SingleStart": "SingleStart", @@ -4903,14 +4884,14 @@ sap.ui.define(['sap/ui/core/Lib', 'sap/ui/base/DataType', 'sap/base/strings/hyph "Multiple": "Multiple", "Delete": "Delete", }; - DataType.registerEnum("@ui5/webcomponents.ListSelectionMode", theLibrary["ListSelectionMode"]); - theLibrary["ListSeparator"] = { + DataType.registerEnum("@ui5/webcomponents.ListSelectionMode", pkg["ListSelectionMode"]); + pkg["ListSeparator"] = { "All": "All", "Inner": "Inner", "None": "None", }; - DataType.registerEnum("@ui5/webcomponents.ListSeparator", theLibrary["ListSeparator"]); - theLibrary["MessageStripDesign"] = { + DataType.registerEnum("@ui5/webcomponents.ListSeparator", pkg["ListSeparator"]); + pkg["MessageStripDesign"] = { "Information": "Information", "Positive": "Positive", "Negative": "Negative", @@ -4918,92 +4899,92 @@ sap.ui.define(['sap/ui/core/Lib', 'sap/ui/base/DataType', 'sap/base/strings/hyph "ColorSet1": "ColorSet1", "ColorSet2": "ColorSet2", }; - DataType.registerEnum("@ui5/webcomponents.MessageStripDesign", theLibrary["MessageStripDesign"]); - theLibrary["OverflowMode"] = { + DataType.registerEnum("@ui5/webcomponents.MessageStripDesign", pkg["MessageStripDesign"]); + pkg["OverflowMode"] = { "End": "End", "StartAndEnd": "StartAndEnd", }; - DataType.registerEnum("@ui5/webcomponents.OverflowMode", theLibrary["OverflowMode"]); - theLibrary["PanelAccessibleRole"] = { + DataType.registerEnum("@ui5/webcomponents.OverflowMode", pkg["OverflowMode"]); + pkg["PanelAccessibleRole"] = { "Complementary": "Complementary", "Form": "Form", "Region": "Region", }; - DataType.registerEnum("@ui5/webcomponents.PanelAccessibleRole", theLibrary["PanelAccessibleRole"]); - theLibrary["PopoverHorizontalAlign"] = { + DataType.registerEnum("@ui5/webcomponents.PanelAccessibleRole", pkg["PanelAccessibleRole"]); + pkg["PopoverHorizontalAlign"] = { "Center": "Center", "Start": "Start", "End": "End", "Stretch": "Stretch", }; - DataType.registerEnum("@ui5/webcomponents.PopoverHorizontalAlign", theLibrary["PopoverHorizontalAlign"]); - theLibrary["PopoverPlacement"] = { + DataType.registerEnum("@ui5/webcomponents.PopoverHorizontalAlign", pkg["PopoverHorizontalAlign"]); + pkg["PopoverPlacement"] = { "Start": "Start", "End": "End", "Top": "Top", "Bottom": "Bottom", }; - DataType.registerEnum("@ui5/webcomponents.PopoverPlacement", theLibrary["PopoverPlacement"]); - theLibrary["PopoverVerticalAlign"] = { + DataType.registerEnum("@ui5/webcomponents.PopoverPlacement", pkg["PopoverPlacement"]); + pkg["PopoverVerticalAlign"] = { "Center": "Center", "Top": "Top", "Bottom": "Bottom", "Stretch": "Stretch", }; - DataType.registerEnum("@ui5/webcomponents.PopoverVerticalAlign", theLibrary["PopoverVerticalAlign"]); - theLibrary["PopupAccessibleRole"] = { + DataType.registerEnum("@ui5/webcomponents.PopoverVerticalAlign", pkg["PopoverVerticalAlign"]); + pkg["PopupAccessibleRole"] = { "None": "None", "Dialog": "Dialog", "AlertDialog": "AlertDialog", }; - DataType.registerEnum("@ui5/webcomponents.PopupAccessibleRole", theLibrary["PopupAccessibleRole"]); - theLibrary["Priority"] = { + DataType.registerEnum("@ui5/webcomponents.PopupAccessibleRole", pkg["PopupAccessibleRole"]); + pkg["Priority"] = { "High": "High", "Medium": "Medium", "Low": "Low", "None": "None", }; - DataType.registerEnum("@ui5/webcomponents.Priority", theLibrary["Priority"]); - theLibrary["SegmentedButtonSelectionMode"] = { + DataType.registerEnum("@ui5/webcomponents.Priority", pkg["Priority"]); + pkg["SegmentedButtonSelectionMode"] = { "Single": "Single", "Multiple": "Multiple", }; - DataType.registerEnum("@ui5/webcomponents.SegmentedButtonSelectionMode", theLibrary["SegmentedButtonSelectionMode"]); - theLibrary["SemanticColor"] = { + DataType.registerEnum("@ui5/webcomponents.SegmentedButtonSelectionMode", pkg["SegmentedButtonSelectionMode"]); + pkg["SemanticColor"] = { "Default": "Default", "Positive": "Positive", "Negative": "Negative", "Critical": "Critical", "Neutral": "Neutral", }; - DataType.registerEnum("@ui5/webcomponents.SemanticColor", theLibrary["SemanticColor"]); - theLibrary["SwitchDesign"] = { + DataType.registerEnum("@ui5/webcomponents.SemanticColor", pkg["SemanticColor"]); + pkg["SwitchDesign"] = { "Textual": "Textual", "Graphical": "Graphical", }; - DataType.registerEnum("@ui5/webcomponents.SwitchDesign", theLibrary["SwitchDesign"]); - theLibrary["TabLayout"] = { + DataType.registerEnum("@ui5/webcomponents.SwitchDesign", pkg["SwitchDesign"]); + pkg["TabLayout"] = { "Inline": "Inline", "Standard": "Standard", }; - DataType.registerEnum("@ui5/webcomponents.TabLayout", theLibrary["TabLayout"]); - theLibrary["TableGrowingMode"] = { + DataType.registerEnum("@ui5/webcomponents.TabLayout", pkg["TabLayout"]); + pkg["TableGrowingMode"] = { "Button": "Button", "Scroll": "Scroll", }; - DataType.registerEnum("@ui5/webcomponents.TableGrowingMode", theLibrary["TableGrowingMode"]); - theLibrary["TableOverflowMode"] = { + DataType.registerEnum("@ui5/webcomponents.TableGrowingMode", pkg["TableGrowingMode"]); + pkg["TableOverflowMode"] = { "Scroll": "Scroll", "Popin": "Popin", }; - DataType.registerEnum("@ui5/webcomponents.TableOverflowMode", theLibrary["TableOverflowMode"]); - theLibrary["TableSelectionMode"] = { + DataType.registerEnum("@ui5/webcomponents.TableOverflowMode", pkg["TableOverflowMode"]); + pkg["TableSelectionMode"] = { "None": "None", "Single": "Single", "Multiple": "Multiple", }; - DataType.registerEnum("@ui5/webcomponents.TableSelectionMode", theLibrary["TableSelectionMode"]); - theLibrary["TagDesign"] = { + DataType.registerEnum("@ui5/webcomponents.TableSelectionMode", pkg["TableSelectionMode"]); + pkg["TagDesign"] = { "Set1": "Set1", "Set2": "Set2", "Neutral": "Neutral", @@ -5012,13 +4993,13 @@ sap.ui.define(['sap/ui/core/Lib', 'sap/ui/base/DataType', 'sap/base/strings/hyph "Negative": "Negative", "Critical": "Critical", }; - DataType.registerEnum("@ui5/webcomponents.TagDesign", theLibrary["TagDesign"]); - theLibrary["TagSize"] = { + DataType.registerEnum("@ui5/webcomponents.TagDesign", pkg["TagDesign"]); + pkg["TagSize"] = { "S": "S", "L": "L", }; - DataType.registerEnum("@ui5/webcomponents.TagSize", theLibrary["TagSize"]); - theLibrary["TitleLevel"] = { + DataType.registerEnum("@ui5/webcomponents.TagSize", pkg["TagSize"]); + pkg["TitleLevel"] = { "H1": "H1", "H2": "H2", "H3": "H3", @@ -5026,8 +5007,8 @@ sap.ui.define(['sap/ui/core/Lib', 'sap/ui/base/DataType', 'sap/base/strings/hyph "H5": "H5", "H6": "H6", }; - DataType.registerEnum("@ui5/webcomponents.TitleLevel", theLibrary["TitleLevel"]); - theLibrary["ToastPlacement"] = { + DataType.registerEnum("@ui5/webcomponents.TitleLevel", pkg["TitleLevel"]); + pkg["ToastPlacement"] = { "TopStart": "TopStart", "TopCenter": "TopCenter", "TopEnd": "TopEnd", @@ -5038,28 +5019,28 @@ sap.ui.define(['sap/ui/core/Lib', 'sap/ui/base/DataType', 'sap/base/strings/hyph "BottomCenter": "BottomCenter", "BottomEnd": "BottomEnd", }; - DataType.registerEnum("@ui5/webcomponents.ToastPlacement", theLibrary["ToastPlacement"]); - theLibrary["ToolbarAlign"] = { + DataType.registerEnum("@ui5/webcomponents.ToastPlacement", pkg["ToastPlacement"]); + pkg["ToolbarAlign"] = { "Start": "Start", "End": "End", }; - DataType.registerEnum("@ui5/webcomponents.ToolbarAlign", theLibrary["ToolbarAlign"]); - theLibrary["ToolbarDesign"] = { + DataType.registerEnum("@ui5/webcomponents.ToolbarAlign", pkg["ToolbarAlign"]); + pkg["ToolbarDesign"] = { "Solid": "Solid", "Transparent": "Transparent", }; - DataType.registerEnum("@ui5/webcomponents.ToolbarDesign", theLibrary["ToolbarDesign"]); - theLibrary["ToolbarItemOverflowBehavior"] = { + DataType.registerEnum("@ui5/webcomponents.ToolbarDesign", pkg["ToolbarDesign"]); + pkg["ToolbarItemOverflowBehavior"] = { "Default": "Default", "NeverOverflow": "NeverOverflow", "AlwaysOverflow": "AlwaysOverflow", }; - DataType.registerEnum("@ui5/webcomponents.ToolbarItemOverflowBehavior", theLibrary["ToolbarItemOverflowBehavior"]); - theLibrary["WrappingType"] = { + DataType.registerEnum("@ui5/webcomponents.ToolbarItemOverflowBehavior", pkg["ToolbarItemOverflowBehavior"]); + pkg["WrappingType"] = { "None": "None", "Normal": "Normal", }; - DataType.registerEnum("@ui5/webcomponents.WrappingType", theLibrary["WrappingType"]); + DataType.registerEnum("@ui5/webcomponents.WrappingType", pkg["WrappingType"]); var CheckBox = WebComponentBaseClass.extend("@ui5/webcomponents.CheckBox", { metadata: { @@ -5145,7 +5126,8 @@ sap.ui.define(['sap/ui/core/Lib', 'sap/ui/base/DataType', 'sap/base/strings/hyph "getters": [], "methods": [], "defaultAggregation": "default", - "library": "@ui5/webcomponents.library" + "library": "@ui5/webcomponents.library", + "designtime": "@ui5/webcomponents/designtime/CheckBox.designtime" }, // TODO: Quick solution to fix a conversion between "number" and "core.CSSSize". // WebC attribute is a number and is written back to the Control wrapper via core.WebComponent base class. diff --git a/packages/ui5-tooling-modules/test/__snap__/d726ec84/@ui5/webcomponents-base/library.js b/packages/ui5-tooling-modules/test/__snap__/d726ec84/@ui5/webcomponents-base/library.js deleted file mode 100644 index d61b5f360..000000000 --- a/packages/ui5-tooling-modules/test/__snap__/d726ec84/@ui5/webcomponents-base/library.js +++ /dev/null @@ -1,134 +0,0 @@ -sap.ui.define(['sap/base/strings/hyphenate', 'sap/ui/core/webc/WebComponentRenderer', 'sap/ui/core/Lib', 'sap/ui/base/DataType'], (function (hyphenate, WebComponentRenderer, Library, DataType) { 'use strict'; - - // Fixed with https://github.com/SAP/openui5/commit/7a4615e3fe55221ae9de9d876d3eed209f71a5b1 in UI5 1.128.0 - - - WebComponentRenderer.renderAttributeProperties = function (oRm, oWebComponent) { - var oAttrProperties = oWebComponent.getMetadata().getPropertiesByMapping("property"); - // ##### MODIFICATION START ##### - var aPropsToAlwaysSet = ["enabled"].concat( - Object.entries(oWebComponent.getMetadata().getPropertyDefaults()).map(([key, value]) => { - return value !== undefined && value !== false ? key : null; - }) - ); // some properties can be initial and still have a non-default value due to side effects (e.g. EnabledPropagator) - // ##### MODIFICATION END ##### - for (var sPropName in oAttrProperties) { - if (oWebComponent.isPropertyInitial(sPropName) && !aPropsToAlwaysSet.includes(sPropName)) { - continue; // do not set attributes for properties that were not explicitly set or bound - } - - var oPropData = oAttrProperties[sPropName]; - var vPropValue = oPropData.get(oWebComponent); - if (oPropData.type === "object" || typeof vPropValue === "object") { - continue; // Properties of type "object" and custom-type properties with object values are set during onAfterRendering - } - - var sAttrName = oPropData._sMapTo ? oPropData._sMapTo : hyphenate(sPropName); - if (oPropData._fnMappingFormatter) { - vPropValue = oWebComponent[oPropData._fnMappingFormatter].call(oWebComponent, vPropValue); - } - - if (oPropData.type === "boolean") { - if (vPropValue) { - oRm.attr(sAttrName, ""); - } - } else { - if (vPropValue != null) { - oRm.attr(sAttrName, vPropValue); - } - } - } - }; - - const theLibrary = Library.init({ - "apiVersion": 2, - "name": "@ui5/webcomponents-base", - "dependencies": [ - "sap.ui.core" - ], - "types": [ - "@ui5/webcomponents-base.AnimationMode", - "@ui5/webcomponents-base.AriaHasPopup", - "@ui5/webcomponents-base.AriaRole", - "@ui5/webcomponents-base.CalendarType", - "@ui5/webcomponents-base.ItemNavigationBehavior", - "@ui5/webcomponents-base.MovePlacement", - "@ui5/webcomponents-base.NavigationMode", - "@ui5/webcomponents-base.ValueState" - ], - "elements": [], - "controls": [], - "interfaces": [], - "designtime": "@ui5/webcomponents-base/designtime/library.designtime", - "extensions": { - "flChangeHandlers": { - "@ui5/webcomponents.Avatar": { - "hideControl": "default", - "unhideControl": "default" - }, - "@ui5/webcomponents.Button": "@ui5/webcomponents-flexibility.Button" - } - }, - "noLibraryCSS": true - }); - - theLibrary["AnimationMode"] = { - "Full": "Full", - "Basic": "Basic", - "Minimal": "Minimal", - "None": "None", - }; - DataType.registerEnum("@ui5/webcomponents-base.AnimationMode", theLibrary["AnimationMode"]); - theLibrary["AriaHasPopup"] = { - "Dialog": "Dialog", - "Grid": "Grid", - "ListBox": "ListBox", - "Menu": "Menu", - "Tree": "Tree", - }; - DataType.registerEnum("@ui5/webcomponents-base.AriaHasPopup", theLibrary["AriaHasPopup"]); - theLibrary["AriaRole"] = { - "AlertDialog": "AlertDialog", - "Button": "Button", - "Dialog": "Dialog", - "Link": "Link", - }; - DataType.registerEnum("@ui5/webcomponents-base.AriaRole", theLibrary["AriaRole"]); - theLibrary["CalendarType"] = { - "Gregorian": "Gregorian", - "Islamic": "Islamic", - "Japanese": "Japanese", - "Buddhist": "Buddhist", - "Persian": "Persian", - }; - DataType.registerEnum("@ui5/webcomponents-base.CalendarType", theLibrary["CalendarType"]); - theLibrary["ItemNavigationBehavior"] = { - "Static": "Static", - "Cyclic": "Cyclic", - }; - DataType.registerEnum("@ui5/webcomponents-base.ItemNavigationBehavior", theLibrary["ItemNavigationBehavior"]); - theLibrary["MovePlacement"] = { - "On": "On", - "Before": "Before", - "After": "After", - }; - DataType.registerEnum("@ui5/webcomponents-base.MovePlacement", theLibrary["MovePlacement"]); - theLibrary["NavigationMode"] = { - "Auto": "Auto", - "Vertical": "Vertical", - "Horizontal": "Horizontal", - "Paging": "Paging", - }; - DataType.registerEnum("@ui5/webcomponents-base.NavigationMode", theLibrary["NavigationMode"]); - theLibrary["ValueState"] = { - "None": "None", - "Positive": "Positive", - "Critical": "Critical", - "Negative": "Negative", - "Information": "Information", - }; - DataType.registerEnum("@ui5/webcomponents-base.ValueState", theLibrary["ValueState"]); - - return theLibrary; - -})); diff --git a/packages/ui5-tooling-modules/test/__snap__/d726ec84/@ui5/webcomponents/dist/Panel.js b/packages/ui5-tooling-modules/test/__snap__/d726ec84/@ui5/webcomponents/dist/Panel.js index b2be290f2..7da031fc9 100644 --- a/packages/ui5-tooling-modules/test/__snap__/d726ec84/@ui5/webcomponents/dist/Panel.js +++ b/packages/ui5-tooling-modules/test/__snap__/d726ec84/@ui5/webcomponents/dist/Panel.js @@ -1,4 +1,4 @@ -sap.ui.define(['ui5/ecosystem/demo/app/resources/@ui5/webcomponents/library', 'sap/ui/core/webc/WebComponent', 'sap/ui/core/Lib', 'sap/ui/base/DataType', 'ui5/ecosystem/demo/app/resources/@ui5/webcomponents-base/library', 'sap/base/strings/hyphenate', 'sap/ui/core/webc/WebComponentRenderer'], (function (_ui5_webcomponents_library, WebComponentBaseClass, Library, DataType, _ui5_webcomponentsBase_library, hyphenate, WebComponentRenderer) { 'use strict'; +sap.ui.define(['sap/ui/base/DataType', 'sap/base/strings/hyphenate', 'sap/ui/core/webc/WebComponentRenderer', 'sap/ui/core/webc/WebComponent'], (function (DataType, hyphenate, WebComponentRenderer, WebComponentBaseClass) { 'use strict'; /** * @license @@ -4925,6 +4925,682 @@ sap.ui.define(['ui5/ecosystem/demo/app/resources/@ui5/webcomponents/library', 's }), event("toggle")], Panel$1); Panel$1.define(); + // Fixed with https://github.com/SAP/openui5/commit/7a4615e3fe55221ae9de9d876d3eed209f71a5b1 in UI5 1.128.0 + + + WebComponentRenderer.renderAttributeProperties = function (oRm, oWebComponent) { + var oAttrProperties = oWebComponent.getMetadata().getPropertiesByMapping("property"); + // ##### MODIFICATION START ##### + var aPropsToAlwaysSet = ["enabled"].concat( + Object.entries(oWebComponent.getMetadata().getPropertyDefaults()).map(([key, value]) => { + return value !== undefined && value !== false ? key : null; + }) + ); // some properties can be initial and still have a non-default value due to side effects (e.g. EnabledPropagator) + // ##### MODIFICATION END ##### + for (var sPropName in oAttrProperties) { + if (oWebComponent.isPropertyInitial(sPropName) && !aPropsToAlwaysSet.includes(sPropName)) { + continue; // do not set attributes for properties that were not explicitly set or bound + } + + var oPropData = oAttrProperties[sPropName]; + var vPropValue = oPropData.get(oWebComponent); + if (oPropData.type === "object" || typeof vPropValue === "object") { + continue; // Properties of type "object" and custom-type properties with object values are set during onAfterRendering + } + + var sAttrName = oPropData._sMapTo ? oPropData._sMapTo : hyphenate(sPropName); + if (oPropData._fnMappingFormatter) { + vPropValue = oWebComponent[oPropData._fnMappingFormatter].call(oWebComponent, vPropValue); + } + + if (oPropData.type === "boolean") { + if (vPropValue) { + oRm.attr(sAttrName, ""); + } + } else { + if (vPropValue != null) { + oRm.attr(sAttrName, vPropValue); + } + } + } + }; + + const pkg$1 = { + "_ui5metadata": { + "name": "@ui5/webcomponents-base", + "version": "2.1.2", + "dependencies": [ + "sap.ui.core" + ], + "types": [ + "@ui5/webcomponents-base.AnimationMode", + "@ui5/webcomponents-base.AriaHasPopup", + "@ui5/webcomponents-base.AriaRole", + "@ui5/webcomponents-base.CalendarType", + "@ui5/webcomponents-base.ItemNavigationBehavior", + "@ui5/webcomponents-base.MovePlacement", + "@ui5/webcomponents-base.NavigationMode", + "@ui5/webcomponents-base.ValueState" + ], + "interfaces": [], + "controls": [], + "elements": [] + } + }; + + pkg$1["AnimationMode"] = { + "Full": "Full", + "Basic": "Basic", + "Minimal": "Minimal", + "None": "None", + }; + DataType.registerEnum("@ui5/webcomponents-base.AnimationMode", pkg$1["AnimationMode"]); + pkg$1["AriaHasPopup"] = { + "Dialog": "Dialog", + "Grid": "Grid", + "ListBox": "ListBox", + "Menu": "Menu", + "Tree": "Tree", + }; + DataType.registerEnum("@ui5/webcomponents-base.AriaHasPopup", pkg$1["AriaHasPopup"]); + pkg$1["AriaRole"] = { + "AlertDialog": "AlertDialog", + "Button": "Button", + "Dialog": "Dialog", + "Link": "Link", + }; + DataType.registerEnum("@ui5/webcomponents-base.AriaRole", pkg$1["AriaRole"]); + pkg$1["CalendarType"] = { + "Gregorian": "Gregorian", + "Islamic": "Islamic", + "Japanese": "Japanese", + "Buddhist": "Buddhist", + "Persian": "Persian", + }; + DataType.registerEnum("@ui5/webcomponents-base.CalendarType", pkg$1["CalendarType"]); + pkg$1["ItemNavigationBehavior"] = { + "Static": "Static", + "Cyclic": "Cyclic", + }; + DataType.registerEnum("@ui5/webcomponents-base.ItemNavigationBehavior", pkg$1["ItemNavigationBehavior"]); + pkg$1["MovePlacement"] = { + "On": "On", + "Before": "Before", + "After": "After", + }; + DataType.registerEnum("@ui5/webcomponents-base.MovePlacement", pkg$1["MovePlacement"]); + pkg$1["NavigationMode"] = { + "Auto": "Auto", + "Vertical": "Vertical", + "Horizontal": "Horizontal", + "Paging": "Paging", + }; + DataType.registerEnum("@ui5/webcomponents-base.NavigationMode", pkg$1["NavigationMode"]); + pkg$1["ValueState"] = { + "None": "None", + "Positive": "Positive", + "Critical": "Critical", + "Negative": "Negative", + "Information": "Information", + }; + DataType.registerEnum("@ui5/webcomponents-base.ValueState", pkg$1["ValueState"]); + + const pkg = { + "_ui5metadata": { + "name": "@ui5/webcomponents", + "version": "2.1.2", + "dependencies": [ + "sap.ui.core" + ], + "types": [ + "@ui5/webcomponents.AvatarColorScheme", + "@ui5/webcomponents.AvatarGroupType", + "@ui5/webcomponents.AvatarShape", + "@ui5/webcomponents.AvatarSize", + "@ui5/webcomponents.BackgroundDesign", + "@ui5/webcomponents.BarDesign", + "@ui5/webcomponents.BorderDesign", + "@ui5/webcomponents.BreadcrumbsDesign", + "@ui5/webcomponents.BreadcrumbsSeparator", + "@ui5/webcomponents.BusyIndicatorSize", + "@ui5/webcomponents.BusyIndicatorTextPlacement", + "@ui5/webcomponents.ButtonAccessibleRole", + "@ui5/webcomponents.ButtonDesign", + "@ui5/webcomponents.ButtonType", + "@ui5/webcomponents.CalendarLegendItemType", + "@ui5/webcomponents.CalendarSelectionMode", + "@ui5/webcomponents.CarouselArrowsPlacement", + "@ui5/webcomponents.CarouselPageIndicatorType", + "@ui5/webcomponents.ComboBoxFilter", + "@ui5/webcomponents.FormItemSpacing", + "@ui5/webcomponents.Highlight", + "@ui5/webcomponents.IconDesign", + "@ui5/webcomponents.IconMode", + "@ui5/webcomponents.InputType", + "@ui5/webcomponents.LinkAccessibleRole", + "@ui5/webcomponents.LinkDesign", + "@ui5/webcomponents.ListAccessibleRole", + "@ui5/webcomponents.ListGrowingMode", + "@ui5/webcomponents.ListItemAccessibleRole", + "@ui5/webcomponents.ListItemType", + "@ui5/webcomponents.ListSelectionMode", + "@ui5/webcomponents.ListSeparator", + "@ui5/webcomponents.MessageStripDesign", + "@ui5/webcomponents.OverflowMode", + "@ui5/webcomponents.PanelAccessibleRole", + "@ui5/webcomponents.PopoverHorizontalAlign", + "@ui5/webcomponents.PopoverPlacement", + "@ui5/webcomponents.PopoverVerticalAlign", + "@ui5/webcomponents.PopupAccessibleRole", + "@ui5/webcomponents.Priority", + "@ui5/webcomponents.SegmentedButtonSelectionMode", + "@ui5/webcomponents.SemanticColor", + "@ui5/webcomponents.SwitchDesign", + "@ui5/webcomponents.TabLayout", + "@ui5/webcomponents.TableGrowingMode", + "@ui5/webcomponents.TableOverflowMode", + "@ui5/webcomponents.TableSelectionMode", + "@ui5/webcomponents.TagDesign", + "@ui5/webcomponents.TagSize", + "@ui5/webcomponents.TitleLevel", + "@ui5/webcomponents.ToastPlacement", + "@ui5/webcomponents.ToolbarAlign", + "@ui5/webcomponents.ToolbarDesign", + "@ui5/webcomponents.ToolbarItemOverflowBehavior", + "@ui5/webcomponents.WrappingType" + ], + "interfaces": [], + "controls": [ + "@ui5/webcomponents.Avatar", + "@ui5/webcomponents.AvatarGroup", + "@ui5/webcomponents.Bar", + "@ui5/webcomponents.Breadcrumbs", + "@ui5/webcomponents.BreadcrumbsItem", + "@ui5/webcomponents.BusyIndicator", + "@ui5/webcomponents.Button", + "@ui5/webcomponents.Calendar", + "@ui5/webcomponents.CalendarDate", + "@ui5/webcomponents.CalendarDateRange", + "@ui5/webcomponents.CalendarLegend", + "@ui5/webcomponents.CalendarLegendItem", + "@ui5/webcomponents.Card", + "@ui5/webcomponents.CardHeader", + "@ui5/webcomponents.Carousel", + "@ui5/webcomponents.CheckBox", + "@ui5/webcomponents.ColorPalette", + "@ui5/webcomponents.ColorPaletteItem", + "@ui5/webcomponents.ColorPalettePopover", + "@ui5/webcomponents.ColorPicker", + "@ui5/webcomponents.ComboBox", + "@ui5/webcomponents.ComboBoxItem", + "@ui5/webcomponents.ComboBoxItemGroup", + "@ui5/webcomponents.DatePicker", + "@ui5/webcomponents.DateRangePicker", + "@ui5/webcomponents.DateTimePicker", + "@ui5/webcomponents.Dialog", + "@ui5/webcomponents.FileUploader", + "@ui5/webcomponents.Form", + "@ui5/webcomponents.FormGroup", + "@ui5/webcomponents.FormItem", + "@ui5/webcomponents.Icon", + "@ui5/webcomponents.Input", + "@ui5/webcomponents.Label", + "@ui5/webcomponents.Link", + "@ui5/webcomponents.List", + "@ui5/webcomponents.ListItemCustom", + "@ui5/webcomponents.ListItemGroup", + "@ui5/webcomponents.ListItemStandard", + "@ui5/webcomponents.Menu", + "@ui5/webcomponents.MenuItem", + "@ui5/webcomponents.MenuSeparator", + "@ui5/webcomponents.MessageStrip", + "@ui5/webcomponents.MultiComboBox", + "@ui5/webcomponents.MultiComboBoxItem", + "@ui5/webcomponents.MultiComboBoxItemGroup", + "@ui5/webcomponents.MultiInput", + "@ui5/webcomponents.Option", + "@ui5/webcomponents.OptionCustom", + "@ui5/webcomponents.Panel", + "@ui5/webcomponents.Popover", + "@ui5/webcomponents.ProgressIndicator", + "@ui5/webcomponents.RadioButton", + "@ui5/webcomponents.RangeSlider", + "@ui5/webcomponents.RatingIndicator", + "@ui5/webcomponents.ResponsivePopover", + "@ui5/webcomponents.SegmentedButton", + "@ui5/webcomponents.SegmentedButtonItem", + "@ui5/webcomponents.Select", + "@ui5/webcomponents.Slider", + "@ui5/webcomponents.SpecialCalendarDate", + "@ui5/webcomponents.SplitButton", + "@ui5/webcomponents.StepInput", + "@ui5/webcomponents.SuggestionItem", + "@ui5/webcomponents.SuggestionItemCustom", + "@ui5/webcomponents.SuggestionItemGroup", + "@ui5/webcomponents.Switch", + "@ui5/webcomponents.Tab", + "@ui5/webcomponents.TabContainer", + "@ui5/webcomponents.TabSeparator", + "@ui5/webcomponents.Table", + "@ui5/webcomponents.TableCell", + "@ui5/webcomponents.TableGrowing", + "@ui5/webcomponents.TableHeaderCell", + "@ui5/webcomponents.TableHeaderRow", + "@ui5/webcomponents.TableRow", + "@ui5/webcomponents.TableSelection", + "@ui5/webcomponents.Tag", + "@ui5/webcomponents.Text", + "@ui5/webcomponents.TextArea", + "@ui5/webcomponents.TimePicker", + "@ui5/webcomponents.Title", + "@ui5/webcomponents.Toast", + "@ui5/webcomponents.ToggleButton", + "@ui5/webcomponents.Token", + "@ui5/webcomponents.Tokenizer", + "@ui5/webcomponents.Toolbar", + "@ui5/webcomponents.ToolbarButton", + "@ui5/webcomponents.ToolbarSelect", + "@ui5/webcomponents.ToolbarSelectOption", + "@ui5/webcomponents.ToolbarSeparator", + "@ui5/webcomponents.ToolbarSpacer", + "@ui5/webcomponents.Tree", + "@ui5/webcomponents.TreeItem", + "@ui5/webcomponents.TreeItemCustom" + ], + "elements": [] + } + }; + + pkg["AvatarColorScheme"] = { + "Accent1": "Accent1", + "Accent2": "Accent2", + "Accent3": "Accent3", + "Accent4": "Accent4", + "Accent5": "Accent5", + "Accent6": "Accent6", + "Accent7": "Accent7", + "Accent8": "Accent8", + "Accent9": "Accent9", + "Accent10": "Accent10", + "Placeholder": "Placeholder", + }; + DataType.registerEnum("@ui5/webcomponents.AvatarColorScheme", pkg["AvatarColorScheme"]); + pkg["AvatarGroupType"] = { + "Group": "Group", + "Individual": "Individual", + }; + DataType.registerEnum("@ui5/webcomponents.AvatarGroupType", pkg["AvatarGroupType"]); + pkg["AvatarShape"] = { + "Circle": "Circle", + "Square": "Square", + }; + DataType.registerEnum("@ui5/webcomponents.AvatarShape", pkg["AvatarShape"]); + pkg["AvatarSize"] = { + "XS": "XS", + "S": "S", + "M": "M", + "L": "L", + "XL": "XL", + }; + DataType.registerEnum("@ui5/webcomponents.AvatarSize", pkg["AvatarSize"]); + pkg["BackgroundDesign"] = { + "Solid": "Solid", + "Transparent": "Transparent", + "Translucent": "Translucent", + }; + DataType.registerEnum("@ui5/webcomponents.BackgroundDesign", pkg["BackgroundDesign"]); + pkg["BarDesign"] = { + "Header": "Header", + "Subheader": "Subheader", + "Footer": "Footer", + "FloatingFooter": "FloatingFooter", + }; + DataType.registerEnum("@ui5/webcomponents.BarDesign", pkg["BarDesign"]); + pkg["BorderDesign"] = { + "Solid": "Solid", + "None": "None", + }; + DataType.registerEnum("@ui5/webcomponents.BorderDesign", pkg["BorderDesign"]); + pkg["BreadcrumbsDesign"] = { + "Standard": "Standard", + "NoCurrentPage": "NoCurrentPage", + }; + DataType.registerEnum("@ui5/webcomponents.BreadcrumbsDesign", pkg["BreadcrumbsDesign"]); + pkg["BreadcrumbsSeparator"] = { + "Slash": "Slash", + "BackSlash": "BackSlash", + "DoubleBackSlash": "DoubleBackSlash", + "DoubleGreaterThan": "DoubleGreaterThan", + "DoubleSlash": "DoubleSlash", + "GreaterThan": "GreaterThan", + }; + DataType.registerEnum("@ui5/webcomponents.BreadcrumbsSeparator", pkg["BreadcrumbsSeparator"]); + pkg["BusyIndicatorSize"] = { + "S": "S", + "M": "M", + "L": "L", + }; + DataType.registerEnum("@ui5/webcomponents.BusyIndicatorSize", pkg["BusyIndicatorSize"]); + pkg["BusyIndicatorTextPlacement"] = { + "Top": "Top", + "Bottom": "Bottom", + }; + DataType.registerEnum("@ui5/webcomponents.BusyIndicatorTextPlacement", pkg["BusyIndicatorTextPlacement"]); + pkg["ButtonAccessibleRole"] = { + "Button": "Button", + "Link": "Link", + }; + DataType.registerEnum("@ui5/webcomponents.ButtonAccessibleRole", pkg["ButtonAccessibleRole"]); + pkg["ButtonDesign"] = { + "Default": "Default", + "Positive": "Positive", + "Negative": "Negative", + "Transparent": "Transparent", + "Emphasized": "Emphasized", + "Attention": "Attention", + }; + DataType.registerEnum("@ui5/webcomponents.ButtonDesign", pkg["ButtonDesign"]); + pkg["ButtonType"] = { + "Button": "Button", + "Submit": "Submit", + "Reset": "Reset", + }; + DataType.registerEnum("@ui5/webcomponents.ButtonType", pkg["ButtonType"]); + pkg["CalendarLegendItemType"] = { + "None": "None", + "Working": "Working", + "NonWorking": "NonWorking", + "Type01": "Type01", + "Type02": "Type02", + "Type03": "Type03", + "Type04": "Type04", + "Type05": "Type05", + "Type06": "Type06", + "Type07": "Type07", + "Type08": "Type08", + "Type09": "Type09", + "Type10": "Type10", + "Type11": "Type11", + "Type12": "Type12", + "Type13": "Type13", + "Type14": "Type14", + "Type15": "Type15", + "Type16": "Type16", + "Type17": "Type17", + "Type18": "Type18", + "Type19": "Type19", + "Type20": "Type20", + }; + DataType.registerEnum("@ui5/webcomponents.CalendarLegendItemType", pkg["CalendarLegendItemType"]); + pkg["CalendarSelectionMode"] = { + "Single": "Single", + "Multiple": "Multiple", + "Range": "Range", + }; + DataType.registerEnum("@ui5/webcomponents.CalendarSelectionMode", pkg["CalendarSelectionMode"]); + pkg["CarouselArrowsPlacement"] = { + "Content": "Content", + "Navigation": "Navigation", + }; + DataType.registerEnum("@ui5/webcomponents.CarouselArrowsPlacement", pkg["CarouselArrowsPlacement"]); + pkg["CarouselPageIndicatorType"] = { + "Default": "Default", + "Numeric": "Numeric", + }; + DataType.registerEnum("@ui5/webcomponents.CarouselPageIndicatorType", pkg["CarouselPageIndicatorType"]); + pkg["ComboBoxFilter"] = { + "StartsWithPerTerm": "StartsWithPerTerm", + "StartsWith": "StartsWith", + "Contains": "Contains", + "None": "None", + }; + DataType.registerEnum("@ui5/webcomponents.ComboBoxFilter", pkg["ComboBoxFilter"]); + pkg["FormItemSpacing"] = { + "Normal": "Normal", + "Large": "Large", + }; + DataType.registerEnum("@ui5/webcomponents.FormItemSpacing", pkg["FormItemSpacing"]); + pkg["Highlight"] = { + "None": "None", + "Positive": "Positive", + "Critical": "Critical", + "Negative": "Negative", + "Information": "Information", + }; + DataType.registerEnum("@ui5/webcomponents.Highlight", pkg["Highlight"]); + pkg["IconDesign"] = { + "Contrast": "Contrast", + "Critical": "Critical", + "Default": "Default", + "Information": "Information", + "Negative": "Negative", + "Neutral": "Neutral", + "NonInteractive": "NonInteractive", + "Positive": "Positive", + }; + DataType.registerEnum("@ui5/webcomponents.IconDesign", pkg["IconDesign"]); + pkg["IconMode"] = { + "Image": "Image", + "Decorative": "Decorative", + "Interactive": "Interactive", + }; + DataType.registerEnum("@ui5/webcomponents.IconMode", pkg["IconMode"]); + pkg["InputType"] = { + "Text": "Text", + "Email": "Email", + "Number": "Number", + "Password": "Password", + "Tel": "Tel", + "URL": "URL", + "Search": "Search", + }; + DataType.registerEnum("@ui5/webcomponents.InputType", pkg["InputType"]); + pkg["LinkAccessibleRole"] = { + "Link": "Link", + "Button": "Button", + }; + DataType.registerEnum("@ui5/webcomponents.LinkAccessibleRole", pkg["LinkAccessibleRole"]); + pkg["LinkDesign"] = { + "Default": "Default", + "Subtle": "Subtle", + "Emphasized": "Emphasized", + }; + DataType.registerEnum("@ui5/webcomponents.LinkDesign", pkg["LinkDesign"]); + pkg["ListAccessibleRole"] = { + "List": "List", + "Menu": "Menu", + "Tree": "Tree", + "ListBox": "ListBox", + }; + DataType.registerEnum("@ui5/webcomponents.ListAccessibleRole", pkg["ListAccessibleRole"]); + pkg["ListGrowingMode"] = { + "Button": "Button", + "Scroll": "Scroll", + "None": "None", + }; + DataType.registerEnum("@ui5/webcomponents.ListGrowingMode", pkg["ListGrowingMode"]); + pkg["ListItemAccessibleRole"] = { + "ListItem": "ListItem", + "MenuItem": "MenuItem", + "TreeItem": "TreeItem", + "Option": "Option", + "None": "None", + }; + DataType.registerEnum("@ui5/webcomponents.ListItemAccessibleRole", pkg["ListItemAccessibleRole"]); + pkg["ListItemType"] = { + "Inactive": "Inactive", + "Active": "Active", + "Detail": "Detail", + "Navigation": "Navigation", + }; + DataType.registerEnum("@ui5/webcomponents.ListItemType", pkg["ListItemType"]); + pkg["ListSelectionMode"] = { + "None": "None", + "Single": "Single", + "SingleStart": "SingleStart", + "SingleEnd": "SingleEnd", + "SingleAuto": "SingleAuto", + "Multiple": "Multiple", + "Delete": "Delete", + }; + DataType.registerEnum("@ui5/webcomponents.ListSelectionMode", pkg["ListSelectionMode"]); + pkg["ListSeparator"] = { + "All": "All", + "Inner": "Inner", + "None": "None", + }; + DataType.registerEnum("@ui5/webcomponents.ListSeparator", pkg["ListSeparator"]); + pkg["MessageStripDesign"] = { + "Information": "Information", + "Positive": "Positive", + "Negative": "Negative", + "Critical": "Critical", + "ColorSet1": "ColorSet1", + "ColorSet2": "ColorSet2", + }; + DataType.registerEnum("@ui5/webcomponents.MessageStripDesign", pkg["MessageStripDesign"]); + pkg["OverflowMode"] = { + "End": "End", + "StartAndEnd": "StartAndEnd", + }; + DataType.registerEnum("@ui5/webcomponents.OverflowMode", pkg["OverflowMode"]); + pkg["PanelAccessibleRole"] = { + "Complementary": "Complementary", + "Form": "Form", + "Region": "Region", + }; + DataType.registerEnum("@ui5/webcomponents.PanelAccessibleRole", pkg["PanelAccessibleRole"]); + pkg["PopoverHorizontalAlign"] = { + "Center": "Center", + "Start": "Start", + "End": "End", + "Stretch": "Stretch", + }; + DataType.registerEnum("@ui5/webcomponents.PopoverHorizontalAlign", pkg["PopoverHorizontalAlign"]); + pkg["PopoverPlacement"] = { + "Start": "Start", + "End": "End", + "Top": "Top", + "Bottom": "Bottom", + }; + DataType.registerEnum("@ui5/webcomponents.PopoverPlacement", pkg["PopoverPlacement"]); + pkg["PopoverVerticalAlign"] = { + "Center": "Center", + "Top": "Top", + "Bottom": "Bottom", + "Stretch": "Stretch", + }; + DataType.registerEnum("@ui5/webcomponents.PopoverVerticalAlign", pkg["PopoverVerticalAlign"]); + pkg["PopupAccessibleRole"] = { + "None": "None", + "Dialog": "Dialog", + "AlertDialog": "AlertDialog", + }; + DataType.registerEnum("@ui5/webcomponents.PopupAccessibleRole", pkg["PopupAccessibleRole"]); + pkg["Priority"] = { + "High": "High", + "Medium": "Medium", + "Low": "Low", + "None": "None", + }; + DataType.registerEnum("@ui5/webcomponents.Priority", pkg["Priority"]); + pkg["SegmentedButtonSelectionMode"] = { + "Single": "Single", + "Multiple": "Multiple", + }; + DataType.registerEnum("@ui5/webcomponents.SegmentedButtonSelectionMode", pkg["SegmentedButtonSelectionMode"]); + pkg["SemanticColor"] = { + "Default": "Default", + "Positive": "Positive", + "Negative": "Negative", + "Critical": "Critical", + "Neutral": "Neutral", + }; + DataType.registerEnum("@ui5/webcomponents.SemanticColor", pkg["SemanticColor"]); + pkg["SwitchDesign"] = { + "Textual": "Textual", + "Graphical": "Graphical", + }; + DataType.registerEnum("@ui5/webcomponents.SwitchDesign", pkg["SwitchDesign"]); + pkg["TabLayout"] = { + "Inline": "Inline", + "Standard": "Standard", + }; + DataType.registerEnum("@ui5/webcomponents.TabLayout", pkg["TabLayout"]); + pkg["TableGrowingMode"] = { + "Button": "Button", + "Scroll": "Scroll", + }; + DataType.registerEnum("@ui5/webcomponents.TableGrowingMode", pkg["TableGrowingMode"]); + pkg["TableOverflowMode"] = { + "Scroll": "Scroll", + "Popin": "Popin", + }; + DataType.registerEnum("@ui5/webcomponents.TableOverflowMode", pkg["TableOverflowMode"]); + pkg["TableSelectionMode"] = { + "None": "None", + "Single": "Single", + "Multiple": "Multiple", + }; + DataType.registerEnum("@ui5/webcomponents.TableSelectionMode", pkg["TableSelectionMode"]); + pkg["TagDesign"] = { + "Set1": "Set1", + "Set2": "Set2", + "Neutral": "Neutral", + "Information": "Information", + "Positive": "Positive", + "Negative": "Negative", + "Critical": "Critical", + }; + DataType.registerEnum("@ui5/webcomponents.TagDesign", pkg["TagDesign"]); + pkg["TagSize"] = { + "S": "S", + "L": "L", + }; + DataType.registerEnum("@ui5/webcomponents.TagSize", pkg["TagSize"]); + pkg["TitleLevel"] = { + "H1": "H1", + "H2": "H2", + "H3": "H3", + "H4": "H4", + "H5": "H5", + "H6": "H6", + }; + DataType.registerEnum("@ui5/webcomponents.TitleLevel", pkg["TitleLevel"]); + pkg["ToastPlacement"] = { + "TopStart": "TopStart", + "TopCenter": "TopCenter", + "TopEnd": "TopEnd", + "MiddleStart": "MiddleStart", + "MiddleCenter": "MiddleCenter", + "MiddleEnd": "MiddleEnd", + "BottomStart": "BottomStart", + "BottomCenter": "BottomCenter", + "BottomEnd": "BottomEnd", + }; + DataType.registerEnum("@ui5/webcomponents.ToastPlacement", pkg["ToastPlacement"]); + pkg["ToolbarAlign"] = { + "Start": "Start", + "End": "End", + }; + DataType.registerEnum("@ui5/webcomponents.ToolbarAlign", pkg["ToolbarAlign"]); + pkg["ToolbarDesign"] = { + "Solid": "Solid", + "Transparent": "Transparent", + }; + DataType.registerEnum("@ui5/webcomponents.ToolbarDesign", pkg["ToolbarDesign"]); + pkg["ToolbarItemOverflowBehavior"] = { + "Default": "Default", + "NeverOverflow": "NeverOverflow", + "AlwaysOverflow": "AlwaysOverflow", + }; + DataType.registerEnum("@ui5/webcomponents.ToolbarItemOverflowBehavior", pkg["ToolbarItemOverflowBehavior"]); + pkg["WrappingType"] = { + "None": "None", + "Normal": "Normal", + }; + DataType.registerEnum("@ui5/webcomponents.WrappingType", pkg["WrappingType"]); + var Panel = WebComponentBaseClass.extend("@ui5/webcomponents.Panel", { metadata: { "namespace": "@ui5/webcomponents", @@ -5000,7 +5676,8 @@ sap.ui.define(['ui5/ecosystem/demo/app/resources/@ui5/webcomponents/library', 's "getters": [], "methods": [], "defaultAggregation": "content", - "library": "@ui5/webcomponents.library" + "library": "@ui5/webcomponents.library", + "designtime": "@ui5/webcomponents/designtime/Panel.designtime" }, // TODO: Quick solution to fix a conversion between "number" and "core.CSSSize". // WebC attribute is a number and is written back to the Control wrapper via core.WebComponent base class. diff --git a/packages/ui5-tooling-modules/test/__snap__/d726ec84/@ui5/webcomponents/library.js b/packages/ui5-tooling-modules/test/__snap__/d726ec84/@ui5/webcomponents/library.js deleted file mode 100644 index f9a4f3f96..000000000 --- a/packages/ui5-tooling-modules/test/__snap__/d726ec84/@ui5/webcomponents/library.js +++ /dev/null @@ -1,571 +0,0 @@ -sap.ui.define(['sap/ui/core/Lib', 'sap/ui/base/DataType', '../webcomponents-base/library', 'sap/base/strings/hyphenate', 'sap/ui/core/webc/WebComponentRenderer'], (function (Library, DataType, _ui5_webcomponentsBase_library, hyphenate, WebComponentRenderer) { 'use strict'; - - const theLibrary = Library.init({ - "apiVersion": 2, - "name": "@ui5/webcomponents", - "dependencies": [ - "sap.ui.core", - "@ui5/webcomponents-base" - ], - "types": [ - "@ui5/webcomponents.AvatarColorScheme", - "@ui5/webcomponents.AvatarGroupType", - "@ui5/webcomponents.AvatarShape", - "@ui5/webcomponents.AvatarSize", - "@ui5/webcomponents.BackgroundDesign", - "@ui5/webcomponents.BarDesign", - "@ui5/webcomponents.BorderDesign", - "@ui5/webcomponents.BreadcrumbsDesign", - "@ui5/webcomponents.BreadcrumbsSeparator", - "@ui5/webcomponents.BusyIndicatorSize", - "@ui5/webcomponents.BusyIndicatorTextPlacement", - "@ui5/webcomponents.ButtonAccessibleRole", - "@ui5/webcomponents.ButtonDesign", - "@ui5/webcomponents.ButtonType", - "@ui5/webcomponents.CalendarLegendItemType", - "@ui5/webcomponents.CalendarSelectionMode", - "@ui5/webcomponents.CarouselArrowsPlacement", - "@ui5/webcomponents.CarouselPageIndicatorType", - "@ui5/webcomponents.ComboBoxFilter", - "@ui5/webcomponents.FormItemSpacing", - "@ui5/webcomponents.Highlight", - "@ui5/webcomponents.IconDesign", - "@ui5/webcomponents.IconMode", - "@ui5/webcomponents.InputType", - "@ui5/webcomponents.LinkAccessibleRole", - "@ui5/webcomponents.LinkDesign", - "@ui5/webcomponents.ListAccessibleRole", - "@ui5/webcomponents.ListGrowingMode", - "@ui5/webcomponents.ListItemAccessibleRole", - "@ui5/webcomponents.ListItemType", - "@ui5/webcomponents.ListSelectionMode", - "@ui5/webcomponents.ListSeparator", - "@ui5/webcomponents.MessageStripDesign", - "@ui5/webcomponents.OverflowMode", - "@ui5/webcomponents.PanelAccessibleRole", - "@ui5/webcomponents.PopoverHorizontalAlign", - "@ui5/webcomponents.PopoverPlacement", - "@ui5/webcomponents.PopoverVerticalAlign", - "@ui5/webcomponents.PopupAccessibleRole", - "@ui5/webcomponents.Priority", - "@ui5/webcomponents.SegmentedButtonSelectionMode", - "@ui5/webcomponents.SemanticColor", - "@ui5/webcomponents.SwitchDesign", - "@ui5/webcomponents.TabLayout", - "@ui5/webcomponents.TableGrowingMode", - "@ui5/webcomponents.TableOverflowMode", - "@ui5/webcomponents.TableSelectionMode", - "@ui5/webcomponents.TagDesign", - "@ui5/webcomponents.TagSize", - "@ui5/webcomponents.TitleLevel", - "@ui5/webcomponents.ToastPlacement", - "@ui5/webcomponents.ToolbarAlign", - "@ui5/webcomponents.ToolbarDesign", - "@ui5/webcomponents.ToolbarItemOverflowBehavior", - "@ui5/webcomponents.WrappingType" - ], - "elements": [], - "controls": [ - "@ui5/webcomponents.Avatar", - "@ui5/webcomponents.AvatarGroup", - "@ui5/webcomponents.Bar", - "@ui5/webcomponents.Breadcrumbs", - "@ui5/webcomponents.BreadcrumbsItem", - "@ui5/webcomponents.BusyIndicator", - "@ui5/webcomponents.Button", - "@ui5/webcomponents.Calendar", - "@ui5/webcomponents.CalendarDate", - "@ui5/webcomponents.CalendarDateRange", - "@ui5/webcomponents.CalendarLegend", - "@ui5/webcomponents.CalendarLegendItem", - "@ui5/webcomponents.Card", - "@ui5/webcomponents.CardHeader", - "@ui5/webcomponents.Carousel", - "@ui5/webcomponents.CheckBox", - "@ui5/webcomponents.ColorPalette", - "@ui5/webcomponents.ColorPaletteItem", - "@ui5/webcomponents.ColorPalettePopover", - "@ui5/webcomponents.ColorPicker", - "@ui5/webcomponents.ComboBox", - "@ui5/webcomponents.ComboBoxItem", - "@ui5/webcomponents.ComboBoxItemGroup", - "@ui5/webcomponents.DatePicker", - "@ui5/webcomponents.DateRangePicker", - "@ui5/webcomponents.DateTimePicker", - "@ui5/webcomponents.Dialog", - "@ui5/webcomponents.FileUploader", - "@ui5/webcomponents.Form", - "@ui5/webcomponents.FormGroup", - "@ui5/webcomponents.FormItem", - "@ui5/webcomponents.Icon", - "@ui5/webcomponents.Input", - "@ui5/webcomponents.Label", - "@ui5/webcomponents.Link", - "@ui5/webcomponents.List", - "@ui5/webcomponents.ListItemCustom", - "@ui5/webcomponents.ListItemGroup", - "@ui5/webcomponents.ListItemStandard", - "@ui5/webcomponents.Menu", - "@ui5/webcomponents.MenuItem", - "@ui5/webcomponents.MenuSeparator", - "@ui5/webcomponents.MessageStrip", - "@ui5/webcomponents.MultiComboBox", - "@ui5/webcomponents.MultiComboBoxItem", - "@ui5/webcomponents.MultiComboBoxItemGroup", - "@ui5/webcomponents.MultiInput", - "@ui5/webcomponents.Option", - "@ui5/webcomponents.OptionCustom", - "@ui5/webcomponents.Panel", - "@ui5/webcomponents.Popover", - "@ui5/webcomponents.ProgressIndicator", - "@ui5/webcomponents.RadioButton", - "@ui5/webcomponents.RangeSlider", - "@ui5/webcomponents.RatingIndicator", - "@ui5/webcomponents.ResponsivePopover", - "@ui5/webcomponents.SegmentedButton", - "@ui5/webcomponents.SegmentedButtonItem", - "@ui5/webcomponents.Select", - "@ui5/webcomponents.Slider", - "@ui5/webcomponents.SpecialCalendarDate", - "@ui5/webcomponents.SplitButton", - "@ui5/webcomponents.StepInput", - "@ui5/webcomponents.SuggestionItem", - "@ui5/webcomponents.SuggestionItemCustom", - "@ui5/webcomponents.SuggestionItemGroup", - "@ui5/webcomponents.Switch", - "@ui5/webcomponents.Tab", - "@ui5/webcomponents.TabContainer", - "@ui5/webcomponents.TabSeparator", - "@ui5/webcomponents.Table", - "@ui5/webcomponents.TableCell", - "@ui5/webcomponents.TableGrowing", - "@ui5/webcomponents.TableHeaderCell", - "@ui5/webcomponents.TableHeaderRow", - "@ui5/webcomponents.TableRow", - "@ui5/webcomponents.TableSelection", - "@ui5/webcomponents.Tag", - "@ui5/webcomponents.Text", - "@ui5/webcomponents.TextArea", - "@ui5/webcomponents.TimePicker", - "@ui5/webcomponents.Title", - "@ui5/webcomponents.Toast", - "@ui5/webcomponents.ToggleButton", - "@ui5/webcomponents.Token", - "@ui5/webcomponents.Tokenizer", - "@ui5/webcomponents.Toolbar", - "@ui5/webcomponents.ToolbarButton", - "@ui5/webcomponents.ToolbarSelect", - "@ui5/webcomponents.ToolbarSelectOption", - "@ui5/webcomponents.ToolbarSeparator", - "@ui5/webcomponents.ToolbarSpacer", - "@ui5/webcomponents.Tree", - "@ui5/webcomponents.TreeItem", - "@ui5/webcomponents.TreeItemCustom" - ], - "interfaces": [], - "designtime": "@ui5/webcomponents/designtime/library.designtime", - "extensions": { - "flChangeHandlers": { - "@ui5/webcomponents.Avatar": { - "hideControl": "default", - "unhideControl": "default" - }, - "@ui5/webcomponents.Button": "@ui5/webcomponents-flexibility.Button" - } - }, - "noLibraryCSS": true - }); - - theLibrary["AvatarColorScheme"] = { - "Accent1": "Accent1", - "Accent2": "Accent2", - "Accent3": "Accent3", - "Accent4": "Accent4", - "Accent5": "Accent5", - "Accent6": "Accent6", - "Accent7": "Accent7", - "Accent8": "Accent8", - "Accent9": "Accent9", - "Accent10": "Accent10", - "Placeholder": "Placeholder", - }; - DataType.registerEnum("@ui5/webcomponents.AvatarColorScheme", theLibrary["AvatarColorScheme"]); - theLibrary["AvatarGroupType"] = { - "Group": "Group", - "Individual": "Individual", - }; - DataType.registerEnum("@ui5/webcomponents.AvatarGroupType", theLibrary["AvatarGroupType"]); - theLibrary["AvatarShape"] = { - "Circle": "Circle", - "Square": "Square", - }; - DataType.registerEnum("@ui5/webcomponents.AvatarShape", theLibrary["AvatarShape"]); - theLibrary["AvatarSize"] = { - "XS": "XS", - "S": "S", - "M": "M", - "L": "L", - "XL": "XL", - }; - DataType.registerEnum("@ui5/webcomponents.AvatarSize", theLibrary["AvatarSize"]); - theLibrary["BackgroundDesign"] = { - "Solid": "Solid", - "Transparent": "Transparent", - "Translucent": "Translucent", - }; - DataType.registerEnum("@ui5/webcomponents.BackgroundDesign", theLibrary["BackgroundDesign"]); - theLibrary["BarDesign"] = { - "Header": "Header", - "Subheader": "Subheader", - "Footer": "Footer", - "FloatingFooter": "FloatingFooter", - }; - DataType.registerEnum("@ui5/webcomponents.BarDesign", theLibrary["BarDesign"]); - theLibrary["BorderDesign"] = { - "Solid": "Solid", - "None": "None", - }; - DataType.registerEnum("@ui5/webcomponents.BorderDesign", theLibrary["BorderDesign"]); - theLibrary["BreadcrumbsDesign"] = { - "Standard": "Standard", - "NoCurrentPage": "NoCurrentPage", - }; - DataType.registerEnum("@ui5/webcomponents.BreadcrumbsDesign", theLibrary["BreadcrumbsDesign"]); - theLibrary["BreadcrumbsSeparator"] = { - "Slash": "Slash", - "BackSlash": "BackSlash", - "DoubleBackSlash": "DoubleBackSlash", - "DoubleGreaterThan": "DoubleGreaterThan", - "DoubleSlash": "DoubleSlash", - "GreaterThan": "GreaterThan", - }; - DataType.registerEnum("@ui5/webcomponents.BreadcrumbsSeparator", theLibrary["BreadcrumbsSeparator"]); - theLibrary["BusyIndicatorSize"] = { - "S": "S", - "M": "M", - "L": "L", - }; - DataType.registerEnum("@ui5/webcomponents.BusyIndicatorSize", theLibrary["BusyIndicatorSize"]); - theLibrary["BusyIndicatorTextPlacement"] = { - "Top": "Top", - "Bottom": "Bottom", - }; - DataType.registerEnum("@ui5/webcomponents.BusyIndicatorTextPlacement", theLibrary["BusyIndicatorTextPlacement"]); - theLibrary["ButtonAccessibleRole"] = { - "Button": "Button", - "Link": "Link", - }; - DataType.registerEnum("@ui5/webcomponents.ButtonAccessibleRole", theLibrary["ButtonAccessibleRole"]); - theLibrary["ButtonDesign"] = { - "Default": "Default", - "Positive": "Positive", - "Negative": "Negative", - "Transparent": "Transparent", - "Emphasized": "Emphasized", - "Attention": "Attention", - }; - DataType.registerEnum("@ui5/webcomponents.ButtonDesign", theLibrary["ButtonDesign"]); - theLibrary["ButtonType"] = { - "Button": "Button", - "Submit": "Submit", - "Reset": "Reset", - }; - DataType.registerEnum("@ui5/webcomponents.ButtonType", theLibrary["ButtonType"]); - theLibrary["CalendarLegendItemType"] = { - "None": "None", - "Working": "Working", - "NonWorking": "NonWorking", - "Type01": "Type01", - "Type02": "Type02", - "Type03": "Type03", - "Type04": "Type04", - "Type05": "Type05", - "Type06": "Type06", - "Type07": "Type07", - "Type08": "Type08", - "Type09": "Type09", - "Type10": "Type10", - "Type11": "Type11", - "Type12": "Type12", - "Type13": "Type13", - "Type14": "Type14", - "Type15": "Type15", - "Type16": "Type16", - "Type17": "Type17", - "Type18": "Type18", - "Type19": "Type19", - "Type20": "Type20", - }; - DataType.registerEnum("@ui5/webcomponents.CalendarLegendItemType", theLibrary["CalendarLegendItemType"]); - theLibrary["CalendarSelectionMode"] = { - "Single": "Single", - "Multiple": "Multiple", - "Range": "Range", - }; - DataType.registerEnum("@ui5/webcomponents.CalendarSelectionMode", theLibrary["CalendarSelectionMode"]); - theLibrary["CarouselArrowsPlacement"] = { - "Content": "Content", - "Navigation": "Navigation", - }; - DataType.registerEnum("@ui5/webcomponents.CarouselArrowsPlacement", theLibrary["CarouselArrowsPlacement"]); - theLibrary["CarouselPageIndicatorType"] = { - "Default": "Default", - "Numeric": "Numeric", - }; - DataType.registerEnum("@ui5/webcomponents.CarouselPageIndicatorType", theLibrary["CarouselPageIndicatorType"]); - theLibrary["ComboBoxFilter"] = { - "StartsWithPerTerm": "StartsWithPerTerm", - "StartsWith": "StartsWith", - "Contains": "Contains", - "None": "None", - }; - DataType.registerEnum("@ui5/webcomponents.ComboBoxFilter", theLibrary["ComboBoxFilter"]); - theLibrary["FormItemSpacing"] = { - "Normal": "Normal", - "Large": "Large", - }; - DataType.registerEnum("@ui5/webcomponents.FormItemSpacing", theLibrary["FormItemSpacing"]); - theLibrary["Highlight"] = { - "None": "None", - "Positive": "Positive", - "Critical": "Critical", - "Negative": "Negative", - "Information": "Information", - }; - DataType.registerEnum("@ui5/webcomponents.Highlight", theLibrary["Highlight"]); - theLibrary["IconDesign"] = { - "Contrast": "Contrast", - "Critical": "Critical", - "Default": "Default", - "Information": "Information", - "Negative": "Negative", - "Neutral": "Neutral", - "NonInteractive": "NonInteractive", - "Positive": "Positive", - }; - DataType.registerEnum("@ui5/webcomponents.IconDesign", theLibrary["IconDesign"]); - theLibrary["IconMode"] = { - "Image": "Image", - "Decorative": "Decorative", - "Interactive": "Interactive", - }; - DataType.registerEnum("@ui5/webcomponents.IconMode", theLibrary["IconMode"]); - theLibrary["InputType"] = { - "Text": "Text", - "Email": "Email", - "Number": "Number", - "Password": "Password", - "Tel": "Tel", - "URL": "URL", - "Search": "Search", - }; - DataType.registerEnum("@ui5/webcomponents.InputType", theLibrary["InputType"]); - theLibrary["LinkAccessibleRole"] = { - "Link": "Link", - "Button": "Button", - }; - DataType.registerEnum("@ui5/webcomponents.LinkAccessibleRole", theLibrary["LinkAccessibleRole"]); - theLibrary["LinkDesign"] = { - "Default": "Default", - "Subtle": "Subtle", - "Emphasized": "Emphasized", - }; - DataType.registerEnum("@ui5/webcomponents.LinkDesign", theLibrary["LinkDesign"]); - theLibrary["ListAccessibleRole"] = { - "List": "List", - "Menu": "Menu", - "Tree": "Tree", - "ListBox": "ListBox", - }; - DataType.registerEnum("@ui5/webcomponents.ListAccessibleRole", theLibrary["ListAccessibleRole"]); - theLibrary["ListGrowingMode"] = { - "Button": "Button", - "Scroll": "Scroll", - "None": "None", - }; - DataType.registerEnum("@ui5/webcomponents.ListGrowingMode", theLibrary["ListGrowingMode"]); - theLibrary["ListItemAccessibleRole"] = { - "ListItem": "ListItem", - "MenuItem": "MenuItem", - "TreeItem": "TreeItem", - "Option": "Option", - "None": "None", - }; - DataType.registerEnum("@ui5/webcomponents.ListItemAccessibleRole", theLibrary["ListItemAccessibleRole"]); - theLibrary["ListItemType"] = { - "Inactive": "Inactive", - "Active": "Active", - "Detail": "Detail", - "Navigation": "Navigation", - }; - DataType.registerEnum("@ui5/webcomponents.ListItemType", theLibrary["ListItemType"]); - theLibrary["ListSelectionMode"] = { - "None": "None", - "Single": "Single", - "SingleStart": "SingleStart", - "SingleEnd": "SingleEnd", - "SingleAuto": "SingleAuto", - "Multiple": "Multiple", - "Delete": "Delete", - }; - DataType.registerEnum("@ui5/webcomponents.ListSelectionMode", theLibrary["ListSelectionMode"]); - theLibrary["ListSeparator"] = { - "All": "All", - "Inner": "Inner", - "None": "None", - }; - DataType.registerEnum("@ui5/webcomponents.ListSeparator", theLibrary["ListSeparator"]); - theLibrary["MessageStripDesign"] = { - "Information": "Information", - "Positive": "Positive", - "Negative": "Negative", - "Critical": "Critical", - "ColorSet1": "ColorSet1", - "ColorSet2": "ColorSet2", - }; - DataType.registerEnum("@ui5/webcomponents.MessageStripDesign", theLibrary["MessageStripDesign"]); - theLibrary["OverflowMode"] = { - "End": "End", - "StartAndEnd": "StartAndEnd", - }; - DataType.registerEnum("@ui5/webcomponents.OverflowMode", theLibrary["OverflowMode"]); - theLibrary["PanelAccessibleRole"] = { - "Complementary": "Complementary", - "Form": "Form", - "Region": "Region", - }; - DataType.registerEnum("@ui5/webcomponents.PanelAccessibleRole", theLibrary["PanelAccessibleRole"]); - theLibrary["PopoverHorizontalAlign"] = { - "Center": "Center", - "Start": "Start", - "End": "End", - "Stretch": "Stretch", - }; - DataType.registerEnum("@ui5/webcomponents.PopoverHorizontalAlign", theLibrary["PopoverHorizontalAlign"]); - theLibrary["PopoverPlacement"] = { - "Start": "Start", - "End": "End", - "Top": "Top", - "Bottom": "Bottom", - }; - DataType.registerEnum("@ui5/webcomponents.PopoverPlacement", theLibrary["PopoverPlacement"]); - theLibrary["PopoverVerticalAlign"] = { - "Center": "Center", - "Top": "Top", - "Bottom": "Bottom", - "Stretch": "Stretch", - }; - DataType.registerEnum("@ui5/webcomponents.PopoverVerticalAlign", theLibrary["PopoverVerticalAlign"]); - theLibrary["PopupAccessibleRole"] = { - "None": "None", - "Dialog": "Dialog", - "AlertDialog": "AlertDialog", - }; - DataType.registerEnum("@ui5/webcomponents.PopupAccessibleRole", theLibrary["PopupAccessibleRole"]); - theLibrary["Priority"] = { - "High": "High", - "Medium": "Medium", - "Low": "Low", - "None": "None", - }; - DataType.registerEnum("@ui5/webcomponents.Priority", theLibrary["Priority"]); - theLibrary["SegmentedButtonSelectionMode"] = { - "Single": "Single", - "Multiple": "Multiple", - }; - DataType.registerEnum("@ui5/webcomponents.SegmentedButtonSelectionMode", theLibrary["SegmentedButtonSelectionMode"]); - theLibrary["SemanticColor"] = { - "Default": "Default", - "Positive": "Positive", - "Negative": "Negative", - "Critical": "Critical", - "Neutral": "Neutral", - }; - DataType.registerEnum("@ui5/webcomponents.SemanticColor", theLibrary["SemanticColor"]); - theLibrary["SwitchDesign"] = { - "Textual": "Textual", - "Graphical": "Graphical", - }; - DataType.registerEnum("@ui5/webcomponents.SwitchDesign", theLibrary["SwitchDesign"]); - theLibrary["TabLayout"] = { - "Inline": "Inline", - "Standard": "Standard", - }; - DataType.registerEnum("@ui5/webcomponents.TabLayout", theLibrary["TabLayout"]); - theLibrary["TableGrowingMode"] = { - "Button": "Button", - "Scroll": "Scroll", - }; - DataType.registerEnum("@ui5/webcomponents.TableGrowingMode", theLibrary["TableGrowingMode"]); - theLibrary["TableOverflowMode"] = { - "Scroll": "Scroll", - "Popin": "Popin", - }; - DataType.registerEnum("@ui5/webcomponents.TableOverflowMode", theLibrary["TableOverflowMode"]); - theLibrary["TableSelectionMode"] = { - "None": "None", - "Single": "Single", - "Multiple": "Multiple", - }; - DataType.registerEnum("@ui5/webcomponents.TableSelectionMode", theLibrary["TableSelectionMode"]); - theLibrary["TagDesign"] = { - "Set1": "Set1", - "Set2": "Set2", - "Neutral": "Neutral", - "Information": "Information", - "Positive": "Positive", - "Negative": "Negative", - "Critical": "Critical", - }; - DataType.registerEnum("@ui5/webcomponents.TagDesign", theLibrary["TagDesign"]); - theLibrary["TagSize"] = { - "S": "S", - "L": "L", - }; - DataType.registerEnum("@ui5/webcomponents.TagSize", theLibrary["TagSize"]); - theLibrary["TitleLevel"] = { - "H1": "H1", - "H2": "H2", - "H3": "H3", - "H4": "H4", - "H5": "H5", - "H6": "H6", - }; - DataType.registerEnum("@ui5/webcomponents.TitleLevel", theLibrary["TitleLevel"]); - theLibrary["ToastPlacement"] = { - "TopStart": "TopStart", - "TopCenter": "TopCenter", - "TopEnd": "TopEnd", - "MiddleStart": "MiddleStart", - "MiddleCenter": "MiddleCenter", - "MiddleEnd": "MiddleEnd", - "BottomStart": "BottomStart", - "BottomCenter": "BottomCenter", - "BottomEnd": "BottomEnd", - }; - DataType.registerEnum("@ui5/webcomponents.ToastPlacement", theLibrary["ToastPlacement"]); - theLibrary["ToolbarAlign"] = { - "Start": "Start", - "End": "End", - }; - DataType.registerEnum("@ui5/webcomponents.ToolbarAlign", theLibrary["ToolbarAlign"]); - theLibrary["ToolbarDesign"] = { - "Solid": "Solid", - "Transparent": "Transparent", - }; - DataType.registerEnum("@ui5/webcomponents.ToolbarDesign", theLibrary["ToolbarDesign"]); - theLibrary["ToolbarItemOverflowBehavior"] = { - "Default": "Default", - "NeverOverflow": "NeverOverflow", - "AlwaysOverflow": "AlwaysOverflow", - }; - DataType.registerEnum("@ui5/webcomponents.ToolbarItemOverflowBehavior", theLibrary["ToolbarItemOverflowBehavior"]); - theLibrary["WrappingType"] = { - "None": "None", - "Normal": "Normal", - }; - DataType.registerEnum("@ui5/webcomponents.WrappingType", theLibrary["WrappingType"]); - - return theLibrary; - -}));