@ui5/webcomponents-base 2.19.0-rc.2 → 2.19.0-rc.3
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.
- package/AGENTS.md +193 -0
- package/CHANGELOG.md +12 -0
- package/CLAUDE.md +1 -0
- package/dist/.tsbuildinfobuild +1 -1
- package/dist/UI5Element.d.ts +2 -1
- package/dist/UI5Element.js +34 -19
- package/dist/UI5Element.js.map +1 -1
- package/dist/asset-registries/Themes.d.ts +5 -2
- package/dist/asset-registries/Themes.js +3 -3
- package/dist/asset-registries/Themes.js.map +1 -1
- package/dist/css/SystemCSSVars.css +28 -3
- package/dist/custom-elements-internal.json +21 -0
- package/dist/custom-elements.json +21 -0
- package/dist/features/InputElementsFormSupport.d.ts +1 -1
- package/dist/features/InputElementsFormSupport.js +6 -2
- package/dist/features/InputElementsFormSupport.js.map +1 -1
- package/dist/generated/VersionInfo.js +3 -3
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/generated/css/SystemCSSVars.css.d.ts +1 -1
- package/dist/generated/css/SystemCSSVars.css.js +1 -1
- package/dist/generated/css/SystemCSSVars.css.js.map +1 -1
- package/dist/prod/UI5Element.js +1 -1
- package/dist/prod/UI5Element.js.map +3 -3
- package/dist/prod/asset-registries/Themes.js +1 -1
- package/dist/prod/asset-registries/Themes.js.map +3 -3
- package/dist/prod/features/InputElementsFormSupport.js +1 -1
- package/dist/prod/features/InputElementsFormSupport.js.map +3 -3
- package/dist/prod/generated/VersionInfo.js +1 -1
- package/dist/prod/generated/VersionInfo.js.map +1 -1
- package/dist/prod/generated/css/SystemCSSVars.css.js +1 -1
- package/dist/prod/generated/css/SystemCSSVars.css.js.map +1 -1
- package/dist/prod/theming/applyTheme.js +1 -1
- package/dist/prod/theming/applyTheme.js.map +3 -3
- package/dist/prod/theming/componentStyles.js +3 -0
- package/dist/prod/theming/componentStyles.js.map +7 -0
- package/dist/prod/updateShadowRoot.js +1 -1
- package/dist/prod/updateShadowRoot.js.map +3 -3
- package/dist/prod/util/createInstanceChecker.js +2 -0
- package/dist/prod/util/createInstanceChecker.js.map +7 -0
- package/dist/theming/applyTheme.js +8 -2
- package/dist/theming/applyTheme.js.map +1 -1
- package/dist/theming/componentStyles.d.ts +3 -0
- package/dist/theming/componentStyles.js +15 -0
- package/dist/theming/componentStyles.js.map +1 -0
- package/dist/updateShadowRoot.js +2 -1
- package/dist/updateShadowRoot.js.map +1 -1
- package/dist/util/createInstanceChecker.d.ts +2 -0
- package/dist/util/createInstanceChecker.js +7 -0
- package/dist/util/createInstanceChecker.js.map +1 -0
- package/dist/util/getClassCopy.d.ts +2 -1
- package/package.json +3 -3
- package/src/css/SystemCSSVars.css +28 -3
package/AGENTS.md
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# CLAUDE.md - UI5 Web Components Development Guide
|
|
2
|
+
|
|
3
|
+
This file provides guidance for AI coding assistants when developing web components built on `@ui5/webcomponents-base`.
|
|
4
|
+
|
|
5
|
+
## Component Architecture
|
|
6
|
+
|
|
7
|
+
Components use decorator-based definitions with Preact JSX templates:
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
11
|
+
import { customElement, property, slot } from "@ui5/webcomponents-base/dist/decorators.js";
|
|
12
|
+
import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
|
|
13
|
+
|
|
14
|
+
@customElement({
|
|
15
|
+
tag: "my-button",
|
|
16
|
+
renderer: jsxRenderer,
|
|
17
|
+
template: MyButtonTemplate,
|
|
18
|
+
styles: myButtonCss,
|
|
19
|
+
languageAware: true, // Re-render on language change
|
|
20
|
+
themeAware: true, // Re-render on theme change
|
|
21
|
+
})
|
|
22
|
+
class MyButton extends UI5Element {
|
|
23
|
+
@property() design: `${ButtonDesign}` = "Default";
|
|
24
|
+
@property({ type: Boolean }) disabled = false;
|
|
25
|
+
@slot({ type: HTMLElement, "default": true }) content!: Array<HTMLElement>;
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Recommended file structure for a component:**
|
|
30
|
+
- `src/ComponentName.ts` - Component class with decorators
|
|
31
|
+
- `src/ComponentNameTemplate.tsx` - JSX template
|
|
32
|
+
- `src/themes/ComponentName.css` - Styles (use CSS variables for theming)
|
|
33
|
+
- `src/i18n/messagebundle*.properties` - Translations (if language-aware)
|
|
34
|
+
|
|
35
|
+
## Critical Development Rules
|
|
36
|
+
|
|
37
|
+
### DOM Manipulation Anti-Pattern
|
|
38
|
+
|
|
39
|
+
Accessing DOM elements via `@query` or `querySelector` is allowed only for calling methods like `.focus()`:
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
@query("[ui5-input]")
|
|
43
|
+
_input!: Input;
|
|
44
|
+
|
|
45
|
+
// GOOD - calling methods
|
|
46
|
+
this._input?.focus();
|
|
47
|
+
|
|
48
|
+
// BAD - modifying properties directly
|
|
49
|
+
this._input.value = "don't do this";
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Always modify child component state through the template:
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
// GOOD - use the template for state
|
|
56
|
+
<Input value={this.inputValue} />
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Always Use Template Literal Types for Enums
|
|
60
|
+
|
|
61
|
+
This pattern eliminates runtime overhead from enum objects:
|
|
62
|
+
|
|
63
|
+
**Imports:**
|
|
64
|
+
```typescript
|
|
65
|
+
// BAD - imports the enum object (runtime overhead)
|
|
66
|
+
import ButtonDesign from "./types/ButtonDesign.js";
|
|
67
|
+
|
|
68
|
+
// GOOD - import type only (no runtime overhead)
|
|
69
|
+
import type ButtonDesign from "./types/ButtonDesign.js";
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Property types:**
|
|
73
|
+
```typescript
|
|
74
|
+
// BAD - uses enum object at runtime
|
|
75
|
+
design: ButtonDesign = ButtonDesign.Default;
|
|
76
|
+
|
|
77
|
+
// GOOD - template literal type with string value
|
|
78
|
+
design: `${ButtonDesign}` = "Default";
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Value comparisons:**
|
|
82
|
+
```typescript
|
|
83
|
+
// BAD - runtime enum access
|
|
84
|
+
if (this.design !== ButtonDesign.Transparent) { }
|
|
85
|
+
|
|
86
|
+
// GOOD - string comparison (IDE autocomplete + TS type safety)
|
|
87
|
+
if (this.design !== "Transparent") { }
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Scoping-Safe Code (Required for Micro-Frontend Support)
|
|
91
|
+
|
|
92
|
+
UI5 Web Components support tag name scoping for micro-frontend scenarios where multiple versions may coexist. Always use attribute selectors:
|
|
93
|
+
|
|
94
|
+
**In TypeScript:**
|
|
95
|
+
```typescript
|
|
96
|
+
// BAD - hard-coded tag names break when scoped
|
|
97
|
+
this.shadowRoot.querySelector("ui5-popover")
|
|
98
|
+
element.tagName === "UI5-BUTTON"
|
|
99
|
+
|
|
100
|
+
// GOOD - attribute selectors work with any scoping
|
|
101
|
+
this.shadowRoot.querySelector("[ui5-popover]")
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**In CSS:**
|
|
105
|
+
```css
|
|
106
|
+
/* BAD - tag selector breaks with scoping */
|
|
107
|
+
ui5-button.accept-btn { color: green; }
|
|
108
|
+
|
|
109
|
+
/* GOOD - attribute selector works with scoping */
|
|
110
|
+
[ui5-button].accept-btn { color: green; }
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### No `instanceof` Checks
|
|
114
|
+
|
|
115
|
+
`instanceof` fails when multiple versions of the framework are loaded. Use duck-typing instead:
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
// BAD - fails with multiple framework versions
|
|
119
|
+
if (element instanceof Button) { }
|
|
120
|
+
|
|
121
|
+
// BAD - tag name could be scoped (e.g., "UI5-BUTTON-F5331039")
|
|
122
|
+
if (element.tagName === "UI5-BUTTON") { }
|
|
123
|
+
|
|
124
|
+
// GOOD - use createInstanceChecker helper
|
|
125
|
+
import createInstanceChecker from "@ui5/webcomponents-base/dist/util/createInstanceChecker.js";
|
|
126
|
+
|
|
127
|
+
// In your component class:
|
|
128
|
+
class MyItem extends UI5Element {
|
|
129
|
+
readonly isMyItem = true; // Duck-typing marker
|
|
130
|
+
}
|
|
131
|
+
export const isInstanceOfMyItem = createInstanceChecker<MyItem>("isMyItem");
|
|
132
|
+
|
|
133
|
+
// Usage:
|
|
134
|
+
if (isInstanceOfMyItem(element)) {
|
|
135
|
+
// element is typed as MyItem
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Property and Event Conventions
|
|
140
|
+
|
|
141
|
+
- **Never change public properties programmatically** - only in response to user interaction
|
|
142
|
+
- **Use `noAttribute: true`** for private/internal properties not used in CSS selectors
|
|
143
|
+
- **Fire events for all user interactions** - applications rely on events for state management
|
|
144
|
+
- **Import icons explicitly** - don't rely on bundled icon imports
|
|
145
|
+
|
|
146
|
+
```typescript
|
|
147
|
+
@property({ noAttribute: true })
|
|
148
|
+
_internalState = false; // Won't create HTML attribute
|
|
149
|
+
|
|
150
|
+
// Fire events for user interactions
|
|
151
|
+
this.fireDecoratorEvent("change", { value: this.value });
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Testing with Cypress
|
|
155
|
+
|
|
156
|
+
Tests use Cypress component testing with JSX mounting:
|
|
157
|
+
|
|
158
|
+
```typescript
|
|
159
|
+
import MyButton from "../../src/MyButton.js";
|
|
160
|
+
|
|
161
|
+
describe("MyButton", () => {
|
|
162
|
+
it("fires click event", () => {
|
|
163
|
+
cy.mount(<MyButton>Click me</MyButton>);
|
|
164
|
+
|
|
165
|
+
// Use attribute selector for scoping safety
|
|
166
|
+
cy.get("[my-button]").then(($btn) => {
|
|
167
|
+
$btn[0].addEventListener("click", cy.stub().as("clicked"));
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// Use cypress-real-events for realistic interaction
|
|
171
|
+
cy.get("[my-button]").realClick();
|
|
172
|
+
cy.get("@clicked").should("have.been.called");
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**Key testing patterns:**
|
|
178
|
+
- Use `cypress-real-events`: `realClick()`, `realPress()`, `realType()` instead of Cypress simulated events
|
|
179
|
+
- Always use attribute selectors `[my-component]` not tag selectors `my-component`
|
|
180
|
+
- Use `.only` to run a single test case when debugging, remove before committing
|
|
181
|
+
|
|
182
|
+
## Summary of Rules
|
|
183
|
+
|
|
184
|
+
| Rule | Bad | Good |
|
|
185
|
+
|------|-----|------|
|
|
186
|
+
| Enum imports | `import Enum from "..."` | `import type Enum from "..."` |
|
|
187
|
+
| Enum types | `prop: Enum` | `prop: \`${Enum}\`` |
|
|
188
|
+
| Enum values | `Enum.Value` | `"Value"` |
|
|
189
|
+
| DOM queries | `querySelector("ui5-tag")` | `querySelector("[ui5-tag]")` |
|
|
190
|
+
| CSS selectors | `ui5-tag { }` | `[ui5-tag] { }` |
|
|
191
|
+
| Type checks | `instanceof Component` | `isInstanceOfComponent(el)` |
|
|
192
|
+
| Tag comparison | `el.tagName === "UI5-TAG"` | Use instance checker |
|
|
193
|
+
| DOM mutation | `this._ref.value = x` | `<Comp value={x} />` in template |
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.19.0-rc.3](https://github.com/UI5/webcomponents/compare/v2.19.0-rc.2...v2.19.0-rc.3) (2026-02-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **framework:** prevent redundant invalidations ([#12994](https://github.com/UI5/webcomponents/issues/12994)) ([b6c582c](https://github.com/UI5/webcomponents/commit/b6c582c93e5a260044fefc1612c8f037744aca97))
|
|
12
|
+
* **input like:** correct form submission behaviour ([#12959](https://github.com/UI5/webcomponents/issues/12959)) ([cd02ead](https://github.com/UI5/webcomponents/commit/cd02ead56026bb69acc4661442d30b24ed81ff6c))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
# [2.19.0-rc.2](https://github.com/UI5/webcomponents/compare/v2.19.0-rc.1...v2.19.0-rc.2) (2026-01-22)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @ui5/webcomponents-base
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@AGENTS.md
|