@ui5/webcomponents-base 2.1.0-rc.2 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/UI5ElementMetadata.ts"],
4
- "sourcesContent": ["import { camelToKebabCase, kebabToCamelCase } 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};\n\ntype SlotValue = Node;\n\ntype Property = {\n\ttype?: BooleanConstructor | StringConstructor | ObjectConstructor | NumberConstructor | ArrayConstructor,\n\tnoAttribute?: boolean,\n\tconverter?: {\n\t\tfromAttribute(value: string | null, type: unknown): string | number | boolean | null | undefined,\n\t\ttoAttribute(value: unknown, type: unknown): string | null,\n\t}\n}\n\ntype PropertyValue = boolean | number | string | object | undefined | null;\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 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\tinitialState[kebabToCamelCase(propertyName)] = initialState[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 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.type !== Array && !propData.noAttribute;\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 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"],
5
- "mappings": "aAAA,OAAS,oBAAAA,EAAkB,oBAAAC,MAAwB,yBACnD,OAAS,mBAAAC,MAAuB,wBAChC,OAAS,mCAAAC,MAAuC,gCAiDhD,MAAMC,CAAmB,CAIxB,YAAYC,EAAoB,CAC/B,KAAK,SAAWA,CACjB,CAEA,iBAAkB,CACjB,GAAI,OAAO,UAAU,eAAe,KAAK,KAAM,eAAe,EAC7D,OAAO,KAAK,cAEb,MAAMC,EAAsB,CAAC,EAI7B,GAHwB,KAAK,gBAAgB,EAGxB,CACpB,MAAMC,EAAQ,KAAK,SAAS,EAC5B,SAAW,CAACC,EAAUC,CAAQ,IAAK,OAAO,QAAcF,CAAK,EAAG,CAC/D,MAA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AcX,EAAS,MAC5B,MAAM,IAAI,MAAM,8BAA8BA,EAAS,KAAK,SAAS,CAAC,EAAE,CAE1E,CAAC,EAEME,GAGR,eAAeP",
4
+ "sourcesContent": ["import { camelToKebabCase, kebabToCamelCase } 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};\n\ntype SlotValue = Node;\n\ntype Property = {\n\ttype?: BooleanConstructor | StringConstructor | ObjectConstructor | NumberConstructor | ArrayConstructor,\n\tnoAttribute?: boolean,\n\tconverter?: {\n\t\tfromAttribute(value: string | null, type: unknown): string | number | boolean | null | undefined,\n\t\ttoAttribute(value: unknown, type: unknown): string | null,\n\t}\n}\n\ntype PropertyValue = boolean | number | string | object | undefined | null;\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\tfeatures?: Array<string>\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 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\tinitialState[kebabToCamelCase(propertyName)] = initialState[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 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 without the scope\n\t * @private\n\t */\n\tgetFeatures(): Array<string> {\n\t\treturn this.metadata.features || [];\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.type !== Array && !propData.noAttribute;\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 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"],
5
+ "mappings": "aAAA,OAAS,oBAAAA,EAAkB,oBAAAC,MAAwB,yBACnD,OAAS,mBAAAC,MAAuB,wBAChC,OAAS,mCAAAC,MAAuC,gCAkDhD,MAAMC,CAAmB,CAIxB,YAAYC,EAAoB,CAC/B,KAAK,SAAWA,CACjB,CAEA,iBAAkB,CACjB,GAAI,OAAO,UAAU,eAAe,KAAK,KAAM,eAAe,EAC7D,OAAO,KAAK,cAEb,MAAMC,EAAsB,CAAC,EAI7B,GAHwB,KAAK,gBAAgB,EAGxB,CACpB,MAAMC,EAAQ,KAAK,SAAS,EAC5B,SAAW,CAACC,EAAUC,CAAQ,IAAK,OAAO,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qB,CAACD,EAAaF,KACxCE,GAAST,EAAgBS,CAAK,EAAE,QAAQS,GAAM,CAC7C,GAAI,EAAEA,aAAcX,EAAS,MAC5B,MAAM,IAAI,MAAM,8BAA8BA,EAAS,KAAK,SAAS,CAAC,EAAE,CAE1E,CAAC,EAEME,GAGR,eAAeP",
6
6
  "names": ["camelToKebabCase", "kebabToCamelCase", "getSlottedNodes", "getEffectiveScopingSuffixForTag", "UI5ElementMetadata", "metadata", "initialState", "slots", "slotName", "slotData", "propertyName", "value", "validateSingleSlot", "pureTag", "suffix", "propName", "propData", "type", "name", "config", "el"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";const m=(a={})=>e=>{if(Object.prototype.hasOwnProperty.call(e,"metadata")||(e.metadata={}),typeof a=="string"){e.metadata.tag=a;return}const{tag:i,languageAware:o,themeAware:s,fastNavigation:r,formAssociated:n,shadowRootOptions:l}=a;e.metadata.tag=i,o&&(e.metadata.languageAware=o),s&&(e.metadata.themeAware=s),r&&(e.metadata.fastNavigation=r),n&&(e.metadata.formAssociated=n),l&&(e.metadata.shadowRootOptions=l),["renderer","template","styles","dependencies"].forEach(t=>{a[t]&&Object.defineProperty(e,t,{get:()=>a[t]})})};export default m;
1
+ "use strict";const m=(a={})=>e=>{if(Object.prototype.hasOwnProperty.call(e,"metadata")||(e.metadata={}),typeof a=="string"){e.metadata.tag=a;return}const{tag:l,languageAware:o,themeAware:s,fastNavigation:r,formAssociated:n,shadowRootOptions:i,features:f}=a;e.metadata.tag=l,o&&(e.metadata.languageAware=o),f&&(e.metadata.features=f),s&&(e.metadata.themeAware=s),r&&(e.metadata.fastNavigation=r),n&&(e.metadata.formAssociated=n),i&&(e.metadata.shadowRootOptions=i),["renderer","template","styles","dependencies"].forEach(t=>{a[t]&&Object.defineProperty(e,t,{get:()=>a[t]})})};export default m;
2
2
  //# sourceMappingURL=customElement.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/decorators/customElement.ts"],
4
- "sourcesContent": ["import type UI5Element from \"../UI5Element.js\";\nimport type { Renderer } from \"../UI5Element.js\";\nimport type { TemplateFunction as Template } from \"../renderer/executeTemplate.js\";\nimport type { ComponentStylesData as Styles } from \"../types.js\";\n\n/**\n * Returns a custom element class decorator.\n *\n * @param { string | object } tagNameOrComponentSettings\n * @returns { ClassDecorator }\n */\nconst customElement = (tagNameOrComponentSettings: string | {\n\ttag?: string,\n\trenderer?: Renderer,\n\tstyles?: Styles,\n\ttemplate?: Template,\n\tdependencies?: Array<typeof UI5Element>,\n\tlanguageAware?: boolean,\n\tthemeAware?: boolean,\n\tfastNavigation?: boolean,\n\tformAssociated?: boolean,\n\tshadowRootOptions?: Partial<ShadowRootInit>,\n} = {}): ClassDecorator => {\n\treturn (target: any) => {\n\t\tif (!Object.prototype.hasOwnProperty.call(target, \"metadata\")) {\n\t\t\ttarget.metadata = {};\n\t\t}\n\n\t\tif (typeof tagNameOrComponentSettings === \"string\") {\n\t\t\ttarget.metadata.tag = tagNameOrComponentSettings;\n\t\t\treturn;\n\t\t}\n\n\t\tconst {\n\t\t\ttag,\n\t\t\tlanguageAware,\n\t\t\tthemeAware,\n\t\t\tfastNavigation,\n\t\t\tformAssociated,\n\t\t\tshadowRootOptions,\n\t\t } = tagNameOrComponentSettings;\n\n\t\ttarget.metadata.tag = tag;\n\t\tif (languageAware) {\n\t\t\ttarget.metadata.languageAware = languageAware;\n\t\t}\n\t\tif (themeAware) {\n\t\t\ttarget.metadata.themeAware = themeAware;\n\t\t}\n\t\tif (fastNavigation) {\n\t\t\ttarget.metadata.fastNavigation = fastNavigation;\n\t\t}\n\t\tif (formAssociated) {\n\t\t\ttarget.metadata.formAssociated = formAssociated;\n\t\t}\n\n\t\tif (shadowRootOptions) {\n\t\t\ttarget.metadata.shadowRootOptions = shadowRootOptions;\n\t\t}\n\n\t\t[\"renderer\", \"template\", \"styles\", \"dependencies\"].forEach((customElementEntity: string) => {\n\t\t\tconst customElementEntityValue = tagNameOrComponentSettings[customElementEntity as keyof typeof tag];\n\n\t\t\tcustomElementEntityValue && Object.defineProperty(target, customElementEntity, {\n\t\t\t\tget: () => tagNameOrComponentSettings[customElementEntity as keyof typeof tag],\n\t\t\t});\n\t\t});\n\t};\n};\n\nexport default customElement;\n"],
5
- "mappings": "aAWA,MAAMA,EAAgB,CAACC,EAWnB,CAAC,IACIC,GAAgB,CAKvB,GAJK,OAAO,UAAU,eAAe,KAAKA,EAAQ,UAAU,IAC3DA,EAAO,SAAW,CAAC,GAGhB,OAAOD,GAA+B,SAAU,CACnDC,EAAO,SAAS,IAAMD,EACtB,MACD,CAEA,KAAM,CACL,IAAAE,EACA,cAAAC,EACA,WAAAC,EACA,eAAAC,EACA,eAAAC,EACA,kBAAAC,CACA,EAAIP,EAELC,EAAO,SAAS,IAAMC,EAClBC,IACHF,EAAO,SAAS,cAAgBE,GAE7BC,IACHH,EAAO,SAAS,WAAaG,GAE1BC,IACHJ,EAAO,SAAS,eAAiBI,GAE9BC,IACHL,EAAO,SAAS,eAAiBK,GAG9BC,IACHN,EAAO,SAAS,kBAAoBM,GAGrC,CAAC,WAAY,WAAY,SAAU,cAAc,EAAE,QAASC,GAAgC,CAC1DR,EAA2BQ,CAAuC,GAEvE,OAAO,eAAeP,EAAQO,EAAqB,CAC9E,IAAK,IAAMR,EAA2BQ,CAAuC,CAC9E,CAAC,CACF,CAAC,CACF,EAGD,eAAeT",
6
- "names": ["customElement", "tagNameOrComponentSettings", "target", "tag", "languageAware", "themeAware", "fastNavigation", "formAssociated", "shadowRootOptions", "customElementEntity"]
4
+ "sourcesContent": ["import type UI5Element from \"../UI5Element.js\";\nimport type { Renderer } from \"../UI5Element.js\";\nimport type { TemplateFunction as Template } from \"../renderer/executeTemplate.js\";\nimport type { ComponentStylesData as Styles } from \"../types.js\";\n\n/**\n * Returns a custom element class decorator.\n *\n * @param { string | object } tagNameOrComponentSettings\n * @returns { ClassDecorator }\n */\nconst customElement = (tagNameOrComponentSettings: string | {\n\ttag?: string,\n\trenderer?: Renderer,\n\tstyles?: Styles,\n\ttemplate?: Template,\n\tdependencies?: Array<typeof UI5Element>,\n\tlanguageAware?: boolean,\n\tthemeAware?: boolean,\n\tfastNavigation?: boolean,\n\tformAssociated?: boolean,\n\tshadowRootOptions?: Partial<ShadowRootInit>,\n\tfeatures?: Array<string>,\n} = {}): ClassDecorator => {\n\treturn (target: any) => {\n\t\tif (!Object.prototype.hasOwnProperty.call(target, \"metadata\")) {\n\t\t\ttarget.metadata = {};\n\t\t}\n\n\t\tif (typeof tagNameOrComponentSettings === \"string\") {\n\t\t\ttarget.metadata.tag = tagNameOrComponentSettings;\n\t\t\treturn;\n\t\t}\n\n\t\tconst {\n\t\t\ttag,\n\t\t\tlanguageAware,\n\t\t\tthemeAware,\n\t\t\tfastNavigation,\n\t\t\tformAssociated,\n\t\t\tshadowRootOptions,\n\t\t\tfeatures,\n\t\t } = tagNameOrComponentSettings;\n\n\t\ttarget.metadata.tag = tag;\n\t\tif (languageAware) {\n\t\t\ttarget.metadata.languageAware = languageAware;\n\t\t}\n\n\t\tif (features) {\n\t\t\ttarget.metadata.features = features;\n\t\t}\n\n\t\tif (themeAware) {\n\t\t\ttarget.metadata.themeAware = themeAware;\n\t\t}\n\t\tif (fastNavigation) {\n\t\t\ttarget.metadata.fastNavigation = fastNavigation;\n\t\t}\n\t\tif (formAssociated) {\n\t\t\ttarget.metadata.formAssociated = formAssociated;\n\t\t}\n\n\t\tif (shadowRootOptions) {\n\t\t\ttarget.metadata.shadowRootOptions = shadowRootOptions;\n\t\t}\n\n\t\t[\"renderer\", \"template\", \"styles\", \"dependencies\"].forEach((customElementEntity: string) => {\n\t\t\tconst customElementEntityValue = tagNameOrComponentSettings[customElementEntity as keyof typeof tag];\n\n\t\t\tcustomElementEntityValue && Object.defineProperty(target, customElementEntity, {\n\t\t\t\tget: () => tagNameOrComponentSettings[customElementEntity as keyof typeof tag],\n\t\t\t});\n\t\t});\n\t};\n};\n\nexport default customElement;\n"],
5
+ "mappings": "aAWA,MAAMA,EAAgB,CAACC,EAYnB,CAAC,IACIC,GAAgB,CAKvB,GAJK,OAAO,UAAU,eAAe,KAAKA,EAAQ,UAAU,IAC3DA,EAAO,SAAW,CAAC,GAGhB,OAAOD,GAA+B,SAAU,CACnDC,EAAO,SAAS,IAAMD,EACtB,MACD,CAEA,KAAM,CACL,IAAAE,EACA,cAAAC,EACA,WAAAC,EACA,eAAAC,EACA,eAAAC,EACA,kBAAAC,EACA,SAAAC,CACA,EAAIR,EAELC,EAAO,SAAS,IAAMC,EAClBC,IACHF,EAAO,SAAS,cAAgBE,GAG7BK,IACHP,EAAO,SAAS,SAAWO,GAGxBJ,IACHH,EAAO,SAAS,WAAaG,GAE1BC,IACHJ,EAAO,SAAS,eAAiBI,GAE9BC,IACHL,EAAO,SAAS,eAAiBK,GAG9BC,IACHN,EAAO,SAAS,kBAAoBM,GAGrC,CAAC,WAAY,WAAY,SAAU,cAAc,EAAE,QAASE,GAAgC,CAC1DT,EAA2BS,CAAuC,GAEvE,OAAO,eAAeR,EAAQQ,EAAqB,CAC9E,IAAK,IAAMT,EAA2BS,CAAuC,CAC9E,CAAC,CACF,CAAC,CACF,EAGD,eAAeV",
6
+ "names": ["customElement", "tagNameOrComponentSettings", "target", "tag", "languageAware", "themeAware", "fastNavigation", "formAssociated", "shadowRootOptions", "features", "customElementEntity"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";const e={version:"2.1.0-rc.2",major:2,minor:1,patch:0,suffix:"-rc.2",isNext:!1,buildTime:1721894897};export default e;
1
+ "use strict";const e={version:"2.1.0",major:2,minor:1,patch:0,suffix:"",isNext:!1,buildTime:1722589821};export default e;
2
2
  //# sourceMappingURL=VersionInfo.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/generated/VersionInfo.ts"],
4
- "sourcesContent": ["const VersionInfo = {\n\tversion: \"2.1.0-rc.2\",\n\tmajor: 2,\n\tminor: 1,\n\tpatch: 0,\n\tsuffix: \"-rc.2\",\n\tisNext: false,\n\tbuildTime: 1721894897,\n};\nexport default VersionInfo;"],
5
- "mappings": "aAAA,MAAMA,EAAc,CACnB,QAAS,aACT,MAAO,EACP,MAAO,EACP,MAAO,EACP,OAAQ,QACR,OAAQ,GACR,UAAW,UACZ,EACA,eAAeA",
4
+ "sourcesContent": ["const VersionInfo = {\n\tversion: \"2.1.0\",\n\tmajor: 2,\n\tminor: 1,\n\tpatch: 0,\n\tsuffix: \"\",\n\tisNext: false,\n\tbuildTime: 1722589821,\n};\nexport default VersionInfo;"],
5
+ "mappings": "aAAA,MAAMA,EAAc,CACnB,QAAS,QACT,MAAO,EACP,MAAO,EACP,MAAO,EACP,OAAQ,GACR,OAAQ,GACR,UAAW,UACZ,EACA,eAAeA",
6
6
  "names": ["VersionInfo"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";const t=new Map,o=new Map,r=e=>{if(!t.has(e)){const a=c(e.split("-"));t.set(e,a)}return t.get(e)},n=e=>{if(!o.has(e)){const a=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();o.set(e,a)}return o.get(e)},c=e=>e.map((a,s)=>s===0?a.toLowerCase():a.charAt(0).toUpperCase()+a.slice(1).toLowerCase()).join("");export{r as kebabToCamelCase,n as camelToKebabCase};
1
+ "use strict";const s=new Map,o=new Map,n=new Map,c=e=>{if(!s.has(e)){const a=p(e.split("-"));s.set(e,a)}return s.get(e)},l=e=>{if(!o.has(e)){const a=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();o.set(e,a)}return o.get(e)},p=e=>e.map((a,t)=>t===0?a.toLowerCase():a.charAt(0).toUpperCase()+a.slice(1).toLowerCase()).join(""),b=e=>{const a=n.get(e);if(a)return a;const t=c(e),r=t.charAt(0).toUpperCase()+t.slice(1);return n.set(e,r),r};export{c as kebabToCamelCase,l as camelToKebabCase,b as kebabToPascalCase};
2
2
  //# sourceMappingURL=StringHelper.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/util/StringHelper.ts"],
4
- "sourcesContent": ["const kebabToCamelMap = new Map<string, string>();\nconst camelToKebabMap = new Map<string, string>();\n\nconst kebabToCamelCase = (string: string) => {\n\tif (!kebabToCamelMap.has(string)) {\n\t\tconst result = toCamelCase(string.split(\"-\"));\n\t\tkebabToCamelMap.set(string, result);\n\t}\n\treturn kebabToCamelMap.get(string)!;\n};\n\nconst camelToKebabCase = (string: string) => {\n\tif (!camelToKebabMap.has(string)) {\n\t\tconst result = string.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\n\t\tcamelToKebabMap.set(string, result);\n\t}\n\treturn camelToKebabMap.get(string)!;\n};\n\nconst toCamelCase = (parts: Array<string>) => {\n\treturn parts.map((string, index) => {\n\t\treturn index === 0 ? string.toLowerCase() : string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();\n\t}).join(\"\");\n};\n\nexport { kebabToCamelCase, camelToKebabCase };\n"],
5
- "mappings": "aAAA,MAAMA,EAAkB,IAAI,IACtBC,EAAkB,IAAI,IAEtBC,EAAoBC,GAAmB,CAC5C,GAAI,CAACH,EAAgB,IAAIG,CAAM,EAAG,CACjC,MAAMC,EAASC,EAAYF,EAAO,MAAM,GAAG,CAAC,EAC5CH,EAAgB,IAAIG,EAAQC,CAAM,CACnC,CACA,OAAOJ,EAAgB,IAAIG,CAAM,CAClC,EAEMG,EAAoBH,GAAmB,CAC5C,GAAI,CAACF,EAAgB,IAAIE,CAAM,EAAG,CACjC,MAAMC,EAASD,EAAO,QAAQ,kBAAmB,OAAO,EAAE,YAAY,EACtEF,EAAgB,IAAIE,EAAQC,CAAM,CACnC,CACA,OAAOH,EAAgB,IAAIE,CAAM,CAClC,EAEME,EAAeE,GACbA,EAAM,IAAI,CAACJ,EAAQK,IAClBA,IAAU,EAAIL,EAAO,YAAY,EAAIA,EAAO,OAAO,CAAC,EAAE,YAAY,EAAIA,EAAO,MAAM,CAAC,EAAE,YAAY,CACzG,EAAE,KAAK,EAAE,EAGX,OAASD,KAAA,iBAAkBI,KAAA",
6
- "names": ["kebabToCamelMap", "camelToKebabMap", "kebabToCamelCase", "string", "result", "toCamelCase", "camelToKebabCase", "parts", "index"]
4
+ "sourcesContent": ["const kebabToCamelMap = new Map<string, string>();\nconst camelToKebabMap = new Map<string, string>();\nconst kebabToPascalMap = new Map<string, string>();\n\nconst kebabToCamelCase = (string: string) => {\n\tif (!kebabToCamelMap.has(string)) {\n\t\tconst result = toCamelCase(string.split(\"-\"));\n\t\tkebabToCamelMap.set(string, result);\n\t}\n\treturn kebabToCamelMap.get(string)!;\n};\n\nconst camelToKebabCase = (string: string) => {\n\tif (!camelToKebabMap.has(string)) {\n\t\tconst result = string.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\n\t\tcamelToKebabMap.set(string, result);\n\t}\n\treturn camelToKebabMap.get(string)!;\n};\n\nconst toCamelCase = (parts: Array<string>) => {\n\treturn parts.map((string, index) => {\n\t\treturn index === 0 ? string.toLowerCase() : string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();\n\t}).join(\"\");\n};\n\nconst kebabToPascalCase = (src: string) => {\n\tconst cachedName = kebabToPascalMap.get(src);\n\tif (cachedName) {\n\t\treturn cachedName;\n\t}\n\n\tconst camelStr = kebabToCamelCase(src);\n\tconst result = camelStr.charAt(0).toUpperCase() + camelStr.slice(1);\n\tkebabToPascalMap.set(src, result);\n\treturn result;\n};\n\nexport { kebabToCamelCase, camelToKebabCase, kebabToPascalCase };\n"],
5
+ "mappings": "aAAA,MAAMA,EAAkB,IAAI,IACtBC,EAAkB,IAAI,IACtBC,EAAmB,IAAI,IAEvBC,EAAoBC,GAAmB,CAC5C,GAAI,CAACJ,EAAgB,IAAII,CAAM,EAAG,CACjC,MAAMC,EAASC,EAAYF,EAAO,MAAM,GAAG,CAAC,EAC5CJ,EAAgB,IAAII,EAAQC,CAAM,CACnC,CACA,OAAOL,EAAgB,IAAII,CAAM,CAClC,EAEMG,EAAoBH,GAAmB,CAC5C,GAAI,CAACH,EAAgB,IAAIG,CAAM,EAAG,CACjC,MAAMC,EAASD,EAAO,QAAQ,kBAAmB,OAAO,EAAE,YAAY,EACtEH,EAAgB,IAAIG,EAAQC,CAAM,CACnC,CACA,OAAOJ,EAAgB,IAAIG,CAAM,CAClC,EAEME,EAAeE,GACbA,EAAM,IAAI,CAACJ,EAAQK,IAClBA,IAAU,EAAIL,EAAO,YAAY,EAAIA,EAAO,OAAO,CAAC,EAAE,YAAY,EAAIA,EAAO,MAAM,CAAC,EAAE,YAAY,CACzG,EAAE,KAAK,EAAE,EAGLM,EAAqBC,GAAgB,CAC1C,MAAMC,EAAaV,EAAiB,IAAIS,CAAG,EAC3C,GAAIC,EACH,OAAOA,EAGR,MAAMC,EAAWV,EAAiBQ,CAAG,EAC/BN,EAASQ,EAAS,OAAO,CAAC,EAAE,YAAY,EAAIA,EAAS,MAAM,CAAC,EAClE,OAAAX,EAAiB,IAAIS,EAAKN,CAAM,EACzBA,CACR,EAEA,OAASF,KAAA,iBAAkBI,KAAA,iBAAkBG,KAAA",
6
+ "names": ["kebabToCamelMap", "camelToKebabMap", "kebabToPascalMap", "kebabToCamelCase", "string", "result", "toCamelCase", "camelToKebabCase", "parts", "index", "kebabToPascalCase", "src", "cachedName", "camelStr"]
7
7
  }
@@ -1,3 +1,4 @@
1
1
  declare const kebabToCamelCase: (string: string) => string;
2
2
  declare const camelToKebabCase: (string: string) => string;
3
- export { kebabToCamelCase, camelToKebabCase };
3
+ declare const kebabToPascalCase: (src: string) => string;
4
+ export { kebabToCamelCase, camelToKebabCase, kebabToPascalCase };
@@ -1,5 +1,6 @@
1
1
  const kebabToCamelMap = new Map();
2
2
  const camelToKebabMap = new Map();
3
+ const kebabToPascalMap = new Map();
3
4
  const kebabToCamelCase = (string) => {
4
5
  if (!kebabToCamelMap.has(string)) {
5
6
  const result = toCamelCase(string.split("-"));
@@ -19,5 +20,15 @@ const toCamelCase = (parts) => {
19
20
  return index === 0 ? string.toLowerCase() : string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
20
21
  }).join("");
21
22
  };
22
- export { kebabToCamelCase, camelToKebabCase };
23
+ const kebabToPascalCase = (src) => {
24
+ const cachedName = kebabToPascalMap.get(src);
25
+ if (cachedName) {
26
+ return cachedName;
27
+ }
28
+ const camelStr = kebabToCamelCase(src);
29
+ const result = camelStr.charAt(0).toUpperCase() + camelStr.slice(1);
30
+ kebabToPascalMap.set(src, result);
31
+ return result;
32
+ };
33
+ export { kebabToCamelCase, camelToKebabCase, kebabToPascalCase };
23
34
  //# sourceMappingURL=StringHelper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StringHelper.js","sourceRoot":"","sources":["../../src/util/StringHelper.ts"],"names":[],"mappings":"AAAA,MAAM,eAAe,GAAG,IAAI,GAAG,EAAkB,CAAC;AAClD,MAAM,eAAe,GAAG,IAAI,GAAG,EAAkB,CAAC;AAElD,MAAM,gBAAgB,GAAG,CAAC,MAAc,EAAE,EAAE;IAC3C,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;QACjC,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAC9C,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACpC;IACD,OAAO,eAAe,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,MAAc,EAAE,EAAE;IAC3C,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;QACjC,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;QACxE,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACpC;IACD,OAAO,eAAe,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,KAAoB,EAAE,EAAE;IAC5C,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;QAClC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC5G,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACb,CAAC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC","sourcesContent":["const kebabToCamelMap = new Map<string, string>();\nconst camelToKebabMap = new Map<string, string>();\n\nconst kebabToCamelCase = (string: string) => {\n\tif (!kebabToCamelMap.has(string)) {\n\t\tconst result = toCamelCase(string.split(\"-\"));\n\t\tkebabToCamelMap.set(string, result);\n\t}\n\treturn kebabToCamelMap.get(string)!;\n};\n\nconst camelToKebabCase = (string: string) => {\n\tif (!camelToKebabMap.has(string)) {\n\t\tconst result = string.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\n\t\tcamelToKebabMap.set(string, result);\n\t}\n\treturn camelToKebabMap.get(string)!;\n};\n\nconst toCamelCase = (parts: Array<string>) => {\n\treturn parts.map((string, index) => {\n\t\treturn index === 0 ? string.toLowerCase() : string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();\n\t}).join(\"\");\n};\n\nexport { kebabToCamelCase, camelToKebabCase };\n"]}
1
+ {"version":3,"file":"StringHelper.js","sourceRoot":"","sources":["../../src/util/StringHelper.ts"],"names":[],"mappings":"AAAA,MAAM,eAAe,GAAG,IAAI,GAAG,EAAkB,CAAC;AAClD,MAAM,eAAe,GAAG,IAAI,GAAG,EAAkB,CAAC;AAClD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AAC,GAAG,CAAC,CAAC;IAC7C,IAAI,UAAU,EAAE;QACf,OAAO,UAAU,CAAC;KAClB;IAED,MAAM,QAAQ,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACpE,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAClC,OAAO,MAAM,CAAC;AACf,CAAC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAC","sourcesContent":["const kebabToCamelMap = new Map<string, string>();\nconst camelToKebabMap = new Map<string, string>();\nconst kebabToPascalMap = new Map<string, string>();\n\nconst kebabToCamelCase = (string: string) => {\n\tif (!kebabToCamelMap.has(string)) {\n\t\tconst result = toCamelCase(string.split(\"-\"));\n\t\tkebabToCamelMap.set(string, result);\n\t}\n\treturn kebabToCamelMap.get(string)!;\n};\n\nconst camelToKebabCase = (string: string) => {\n\tif (!camelToKebabMap.has(string)) {\n\t\tconst result = string.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\n\t\tcamelToKebabMap.set(string, result);\n\t}\n\treturn camelToKebabMap.get(string)!;\n};\n\nconst toCamelCase = (parts: Array<string>) => {\n\treturn parts.map((string, index) => {\n\t\treturn index === 0 ? string.toLowerCase() : string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();\n\t}).join(\"\");\n};\n\nconst kebabToPascalCase = (src: string) => {\n\tconst cachedName = kebabToPascalMap.get(src);\n\tif (cachedName) {\n\t\treturn cachedName;\n\t}\n\n\tconst camelStr = kebabToCamelCase(src);\n\tconst result = camelStr.charAt(0).toUpperCase() + camelStr.slice(1);\n\tkebabToPascalMap.set(src, result);\n\treturn result;\n};\n\nexport { kebabToCamelCase, camelToKebabCase, kebabToPascalCase };\n"]}
@@ -415,6 +415,7 @@ declare const getClassCopy: (klass: typeof UI5Element, constructorCallback: () =
415
415
  metadata: import("../UI5ElementMetadata.js").Metadata;
416
416
  styles: import("../types.js").ComponentStylesData;
417
417
  readonly dependencies: (typeof UI5Element)[];
418
+ cacheUniqueDependencies(this: typeof UI5Element): void;
418
419
  getUniqueDependencies(this: typeof UI5Element): (typeof UI5Element)[];
419
420
  whenDependenciesDefined(): Promise<(typeof UI5Element)[]>;
420
421
  onDefine(): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/webcomponents-base",
3
- "version": "2.1.0-rc.2",
3
+ "version": "2.1.0",
4
4
  "description": "UI5 Web Components: webcomponents.base",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -51,8 +51,8 @@
51
51
  },
52
52
  "devDependencies": {
53
53
  "@openui5/sap.ui.core": "1.120.17",
54
- "@ui5/webcomponents-tools": "2.1.0-rc.2",
55
- "chromedriver": "^125.0.0",
54
+ "@ui5/webcomponents-tools": "2.1.0",
55
+ "chromedriver": "^126.0.0",
56
56
  "clean-css": "^5.2.2",
57
57
  "copy-and-watch": "^0.1.5",
58
58
  "cross-env": "^7.0.3",
@@ -62,5 +62,5 @@
62
62
  "resolve": "^1.20.0",
63
63
  "touch": "^3.1.0"
64
64
  },
65
- "gitHead": "fdefc6672a5a050030bdfff133222d714886272b"
65
+ "gitHead": "3eecdf86ea2ce8b11a56e6a12adcf46fcb1f7600"
66
66
  }