@proximus/lavender-fieldset 1.4.20-beta.4 → 1.4.20-beta.5
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/dist/Fieldset.d.ts +1 -0
- package/dist/custom-elements.json +19 -0
- package/dist/index.es.js +5 -1
- package/dist/web-types.json +1 -1
- package/package.json +1 -1
package/dist/Fieldset.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export declare class Fieldset extends PxElement<HTMLFieldSetElement> {
|
|
|
23
23
|
static get observedAttributes(): string[];
|
|
24
24
|
connectedCallback(): void;
|
|
25
25
|
attributeChangedCallback(attrName: string, oldValue: string, newValue: string): void;
|
|
26
|
+
protected _forwardPrefixedAccessibilityAttribute(name: string, value: string | null): void;
|
|
26
27
|
setupErrorState(): void;
|
|
27
28
|
get $slotLegend(): HTMLSlotElement;
|
|
28
29
|
get $slotHelper(): HTMLSlotElement;
|
|
@@ -45,6 +45,25 @@
|
|
|
45
45
|
"static": true,
|
|
46
46
|
"default": "{ disabled: ['disabled'], name: ['name'], form: [], } satisfies NativeAttributeMap<HTMLFieldSetElement>"
|
|
47
47
|
},
|
|
48
|
+
{
|
|
49
|
+
"kind": "method",
|
|
50
|
+
"name": "_forwardPrefixedAccessibilityAttribute",
|
|
51
|
+
"privacy": "protected",
|
|
52
|
+
"parameters": [
|
|
53
|
+
{
|
|
54
|
+
"name": "name",
|
|
55
|
+
"type": {
|
|
56
|
+
"text": "string"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "value",
|
|
61
|
+
"type": {
|
|
62
|
+
"text": "string | null"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
},
|
|
48
67
|
{
|
|
49
68
|
"kind": "method",
|
|
50
69
|
"name": "setupErrorState"
|
package/dist/index.es.js
CHANGED
|
@@ -36,7 +36,7 @@ var l = class s extends e {
|
|
|
36
36
|
];
|
|
37
37
|
}
|
|
38
38
|
connectedCallback() {
|
|
39
|
-
this.setupErrorState(), o(this, this.$el, !1);
|
|
39
|
+
this.setupErrorState(), o(this, this.$el, !1), this._syncPrefixedAccessibilityAttributes();
|
|
40
40
|
}
|
|
41
41
|
attributeChangedCallback(e, t, n) {
|
|
42
42
|
if (t !== n) switch (e) {
|
|
@@ -56,12 +56,16 @@ var l = class s extends e {
|
|
|
56
56
|
default: super.attributeChangedCallback(e, t, n);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
+
_forwardPrefixedAccessibilityAttribute(e, t) {
|
|
60
|
+
e === "aria-describedby" && this.state === "error" && this.$slotError.id && (t = [this.$slotError.id, t].filter(Boolean).join(" ")), super._forwardPrefixedAccessibilityAttribute(e, t);
|
|
61
|
+
}
|
|
59
62
|
setupErrorState() {
|
|
60
63
|
let e = this.$slotError?.assignedNodes().length > 0;
|
|
61
64
|
if (this.state === "error" && !e && n("<px-fieldset> with state=\"error\" requires a slot=\"error-text\" containing the error description."), this.state === "error" && e) {
|
|
62
65
|
let e = Math.random().toString(36).substr(2, 9);
|
|
63
66
|
this.$el.setAttribute("id", e), this.$el.setAttribute("aria-describedby", `${e}-error-text`), this.$el.getAttribute("role") && this.$el.setAttribute("aria-invalid", "true"), this.$slotError.setAttribute("id", `${e}-error-text`);
|
|
64
67
|
} else this.$el.removeAttribute("id"), this.$el.removeAttribute("aria-describedby"), this.$el.removeAttribute("aria-invalid"), this.$slotError.removeAttribute("id");
|
|
68
|
+
this._syncPrefixedAccessibilityAttributes();
|
|
65
69
|
}
|
|
66
70
|
get $slotLegend() {
|
|
67
71
|
return this.shadowRoot.querySelector("slot[name=\"legend\"]");
|
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@proximus/lavender-fieldset",
|
|
4
|
-
"version": "1.4.20-beta.
|
|
4
|
+
"version": "1.4.20-beta.5",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|