@proximus/lavender-fieldset 2.0.0-alpha.227 → 2.0.0-alpha.229
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 +30 -0
- package/dist/custom-elements.json +129 -0
- package/dist/index.es.js +23 -10
- package/dist/vscode.html-custom-data.json +16 -1
- package/dist/web-types.json +38 -3
- package/package.json +1 -1
package/dist/Fieldset.d.ts
CHANGED
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
import { PxElement } from '@proximus/lavender-common';
|
|
2
|
+
/**
|
|
3
|
+
* @attr {string} form - The ID of the associated form; the form property is the native form reference.
|
|
4
|
+
*/
|
|
2
5
|
export declare class Fieldset extends PxElement<HTMLFieldSetElement> {
|
|
3
6
|
protected static readonly template: HTMLTemplateElement;
|
|
4
7
|
static nativeName: string;
|
|
8
|
+
static nativeProperties: {
|
|
9
|
+
form: "readonly";
|
|
10
|
+
elements: "readonly";
|
|
11
|
+
type: "readonly";
|
|
12
|
+
validity: "readonly";
|
|
13
|
+
validationMessage: "readonly";
|
|
14
|
+
willValidate: "readonly";
|
|
15
|
+
};
|
|
16
|
+
static nativeMethods: ("checkValidity" | "reportValidity" | "setCustomValidity")[];
|
|
17
|
+
static nativeAttributes: {
|
|
18
|
+
disabled: "disabled"[];
|
|
19
|
+
name: "name"[];
|
|
20
|
+
form: never[];
|
|
21
|
+
};
|
|
5
22
|
constructor();
|
|
6
23
|
static get observedAttributes(): string[];
|
|
7
24
|
connectedCallback(): void;
|
|
@@ -20,4 +37,17 @@ export declare class Fieldset extends PxElement<HTMLFieldSetElement> {
|
|
|
20
37
|
set ariaDisabled(value: string | null);
|
|
21
38
|
get state(): string | null;
|
|
22
39
|
set state(value: string | null);
|
|
40
|
+
/** @attr {boolean} disabled - Whether the native control is disabled. */
|
|
41
|
+
disabled: boolean;
|
|
42
|
+
/** @attr {string} name - The native element name. */
|
|
43
|
+
name: string;
|
|
44
|
+
readonly form: HTMLFormElement | null;
|
|
45
|
+
readonly elements: HTMLCollection;
|
|
46
|
+
readonly type: string;
|
|
47
|
+
readonly validity: ValidityState;
|
|
48
|
+
readonly validationMessage: string;
|
|
49
|
+
readonly willValidate: boolean;
|
|
50
|
+
readonly checkValidity: HTMLFieldSetElement['checkValidity'];
|
|
51
|
+
readonly reportValidity: HTMLFieldSetElement['reportValidity'];
|
|
52
|
+
readonly setCustomValidity: HTMLFieldSetElement['setCustomValidity'];
|
|
23
53
|
}
|
|
@@ -27,6 +27,24 @@
|
|
|
27
27
|
"static": true,
|
|
28
28
|
"default": "'fieldset'"
|
|
29
29
|
},
|
|
30
|
+
{
|
|
31
|
+
"kind": "field",
|
|
32
|
+
"name": "nativeProperties",
|
|
33
|
+
"static": true,
|
|
34
|
+
"default": "nativeFieldsetProperties"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"kind": "field",
|
|
38
|
+
"name": "nativeMethods",
|
|
39
|
+
"static": true,
|
|
40
|
+
"default": "nativeFieldsetMethods"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"kind": "field",
|
|
44
|
+
"name": "nativeAttributes",
|
|
45
|
+
"static": true,
|
|
46
|
+
"default": "{ disabled: ['disabled'], name: ['name'], form: [], } satisfies NativeAttributeMap<HTMLFieldSetElement>"
|
|
47
|
+
},
|
|
30
48
|
{
|
|
31
49
|
"kind": "method",
|
|
32
50
|
"name": "setupErrorState"
|
|
@@ -65,6 +83,94 @@
|
|
|
65
83
|
{
|
|
66
84
|
"kind": "field",
|
|
67
85
|
"name": "state"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"kind": "field",
|
|
89
|
+
"name": "disabled",
|
|
90
|
+
"type": {
|
|
91
|
+
"text": "boolean"
|
|
92
|
+
},
|
|
93
|
+
"attribute": "disabled"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"kind": "field",
|
|
97
|
+
"name": "name",
|
|
98
|
+
"type": {
|
|
99
|
+
"text": "string"
|
|
100
|
+
},
|
|
101
|
+
"attribute": "name"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"kind": "field",
|
|
105
|
+
"name": "form",
|
|
106
|
+
"type": {
|
|
107
|
+
"text": "HTMLFormElement | null"
|
|
108
|
+
},
|
|
109
|
+
"readonly": true
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"kind": "field",
|
|
113
|
+
"name": "elements",
|
|
114
|
+
"type": {
|
|
115
|
+
"text": "HTMLCollection"
|
|
116
|
+
},
|
|
117
|
+
"readonly": true
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"kind": "field",
|
|
121
|
+
"name": "type",
|
|
122
|
+
"type": {
|
|
123
|
+
"text": "string"
|
|
124
|
+
},
|
|
125
|
+
"readonly": true
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"kind": "field",
|
|
129
|
+
"name": "validity",
|
|
130
|
+
"type": {
|
|
131
|
+
"text": "ValidityState"
|
|
132
|
+
},
|
|
133
|
+
"readonly": true
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"kind": "field",
|
|
137
|
+
"name": "validationMessage",
|
|
138
|
+
"type": {
|
|
139
|
+
"text": "string"
|
|
140
|
+
},
|
|
141
|
+
"readonly": true
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"kind": "field",
|
|
145
|
+
"name": "willValidate",
|
|
146
|
+
"type": {
|
|
147
|
+
"text": "boolean"
|
|
148
|
+
},
|
|
149
|
+
"readonly": true
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"kind": "field",
|
|
153
|
+
"name": "checkValidity",
|
|
154
|
+
"type": {
|
|
155
|
+
"text": "HTMLFieldSetElement['checkValidity']"
|
|
156
|
+
},
|
|
157
|
+
"readonly": true
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"kind": "field",
|
|
161
|
+
"name": "reportValidity",
|
|
162
|
+
"type": {
|
|
163
|
+
"text": "HTMLFieldSetElement['reportValidity']"
|
|
164
|
+
},
|
|
165
|
+
"readonly": true
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"kind": "field",
|
|
169
|
+
"name": "setCustomValidity",
|
|
170
|
+
"type": {
|
|
171
|
+
"text": "HTMLFieldSetElement['setCustomValidity']"
|
|
172
|
+
},
|
|
173
|
+
"readonly": true
|
|
68
174
|
}
|
|
69
175
|
],
|
|
70
176
|
"attributes": [
|
|
@@ -82,6 +188,29 @@
|
|
|
82
188
|
},
|
|
83
189
|
{
|
|
84
190
|
"name": "state"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"name": "disabled",
|
|
194
|
+
"type": {
|
|
195
|
+
"text": "boolean"
|
|
196
|
+
},
|
|
197
|
+
"fieldName": "disabled",
|
|
198
|
+
"description": "Whether the native control is disabled."
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"name": "name",
|
|
202
|
+
"type": {
|
|
203
|
+
"text": "string"
|
|
204
|
+
},
|
|
205
|
+
"fieldName": "name",
|
|
206
|
+
"description": "The native element name."
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"type": {
|
|
210
|
+
"text": "string"
|
|
211
|
+
},
|
|
212
|
+
"description": "The ID of the associated form; the form property is the native form reference.",
|
|
213
|
+
"name": "form"
|
|
85
214
|
}
|
|
86
215
|
],
|
|
87
216
|
"superclass": {
|
package/dist/index.es.js
CHANGED
|
@@ -1,16 +1,29 @@
|
|
|
1
|
-
import { PxElement as e, createTemplate as t, log as n,
|
|
1
|
+
import { PxElement as e, createTemplate as t, log as n, nativeFieldsetMethods as r, nativeFieldsetProperties as i, renderTemplate as a, transferAccessibilityAttributes as o } from "@proximus/lavender-common";
|
|
2
2
|
//#region src/fieldset.css?inline
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
var
|
|
3
|
+
var s = ":host{display:block}:host *{box-sizing:border-box}fieldset{font-family:var(--px-font-family);border:0;flex-direction:column;margin:0;padding:0;display:flex}fieldset legend{padding:0}fieldset ::slotted([slot=legend]:not([shown--sr])){margin-bottom:var(--px-spacing-2xs-mobile);display:block}fieldset ::slotted([slot=error-text]),fieldset ::slotted([slot=state-text]){display:none}slot[name=helper]{color:#0000008f;font-size:var(--px-text-size-label-s-mobile)}slot[name=error-text]{font-size:var(--px-text-size-body-m-mobile);line-height:var(--px-line-height-ratio-l);color:var(--px-color-text-purpose-error-default)}:host([state=error]) ::slotted([slot=error-text]),:host([state=error]) ::slotted([slot=state-text]){display:block}@media screen and (width>=48rem){fieldset ::slotted([slot=legend]:not([shown--sr])){margin-bottom:var(--px-spacing-2xs-tablet)}slot[name=helper]{font-size:var(--px-text-size-label-s-tablet)}slot[name=error-text]{font-size:var(--px-text-size-body-m-tablet)}}@media screen and (width>=64.0625rem){fieldset ::slotted([slot=legend]:not([shown--sr])){margin-bottom:var(--px-spacing-2xs-laptop)}slot[name=helper]{font-size:var(--px-text-size-label-s-laptop)}slot[name=error-text]{font-size:var(--px-text-size-body-m-laptop)}}@media screen and (width>=90.0625rem){fieldset ::slotted([slot=legend]:not([shown--sr])){margin-bottom:var(--px-spacing-2xs-desktop)}slot[name=helper]{font-size:var(--px-text-size-label-s-desktop)}slot[name=error-text]{font-size:var(--px-text-size-body-m-desktop)}}:host([inverted]) fieldset [name=error-text]{color:var(--px-color-text-purpose-error-inverted)}", c = new CSSStyleSheet();
|
|
4
|
+
c.replaceSync(s);
|
|
5
|
+
var l = class s extends e {
|
|
6
6
|
static {
|
|
7
7
|
this.template = t("<fieldset><legend><slot name=\"legend\"></slot></legend><px-vstack gap=\"2xs\"><slot name=\"helper\"></slot><slot name=\"error-text\"></slot><slot></slot></px-vstack></fieldset>");
|
|
8
8
|
}
|
|
9
9
|
static {
|
|
10
10
|
this.nativeName = "fieldset";
|
|
11
11
|
}
|
|
12
|
+
static {
|
|
13
|
+
this.nativeProperties = i;
|
|
14
|
+
}
|
|
15
|
+
static {
|
|
16
|
+
this.nativeMethods = r;
|
|
17
|
+
}
|
|
18
|
+
static {
|
|
19
|
+
this.nativeAttributes = {
|
|
20
|
+
disabled: ["disabled"],
|
|
21
|
+
name: ["name"],
|
|
22
|
+
form: []
|
|
23
|
+
};
|
|
24
|
+
}
|
|
12
25
|
constructor() {
|
|
13
|
-
super(
|
|
26
|
+
super(c), a(this.shadowRoot, s.template);
|
|
14
27
|
}
|
|
15
28
|
static get observedAttributes() {
|
|
16
29
|
return [
|
|
@@ -23,13 +36,13 @@ var s = class a extends e {
|
|
|
23
36
|
];
|
|
24
37
|
}
|
|
25
38
|
connectedCallback() {
|
|
26
|
-
this.setupErrorState(),
|
|
39
|
+
this.setupErrorState(), o(this, this.$el, !1);
|
|
27
40
|
}
|
|
28
41
|
attributeChangedCallback(e, t, n) {
|
|
29
42
|
if (t !== n) switch (e) {
|
|
30
43
|
case "disabled":
|
|
31
|
-
this.querySelectorAll("px-radio-group, px-radio, px-checkbox, px-fileupload, px-input, px-textarea, px-select, px-switch").forEach((t) => {
|
|
32
|
-
t.setAttribute(e, "true");
|
|
44
|
+
super.attributeChangedCallback(e, t, n), this.querySelectorAll("px-radio-group, px-radio, px-checkbox, px-fileupload, px-input, px-textarea, px-select, px-switch").forEach((t) => {
|
|
45
|
+
n === null ? t.removeAttribute(e) : t.setAttribute(e, "true");
|
|
33
46
|
});
|
|
34
47
|
break;
|
|
35
48
|
case "role":
|
|
@@ -90,6 +103,6 @@ var s = class a extends e {
|
|
|
90
103
|
this._updateAttribute("state", e);
|
|
91
104
|
}
|
|
92
105
|
};
|
|
93
|
-
customElements.get("px-fieldset") || customElements.define("px-fieldset",
|
|
106
|
+
customElements.get("px-fieldset") || customElements.define("px-fieldset", l);
|
|
94
107
|
//#endregion
|
|
95
|
-
export {
|
|
108
|
+
export { l as Fieldset };
|
|
@@ -10,7 +10,22 @@
|
|
|
10
10
|
{ "name": "role", "values": [] },
|
|
11
11
|
{ "name": "aria-required", "values": [] },
|
|
12
12
|
{ "name": "aria-disabled", "values": [] },
|
|
13
|
-
{ "name": "state", "values": [] }
|
|
13
|
+
{ "name": "state", "values": [] },
|
|
14
|
+
{
|
|
15
|
+
"name": "disabled",
|
|
16
|
+
"description": "Whether the native control is disabled.",
|
|
17
|
+
"values": []
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "name",
|
|
21
|
+
"description": "The native element name.",
|
|
22
|
+
"values": []
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "form",
|
|
26
|
+
"description": "The ID of the associated form; the form property is the native form reference.",
|
|
27
|
+
"values": []
|
|
28
|
+
}
|
|
14
29
|
],
|
|
15
30
|
"references": []
|
|
16
31
|
}
|
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": "2.0.0-alpha.
|
|
4
|
+
"version": "2.0.0-alpha.229",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -15,7 +15,22 @@
|
|
|
15
15
|
{ "name": "role", "value": { "type": "string" } },
|
|
16
16
|
{ "name": "aria-required", "value": { "type": "string" } },
|
|
17
17
|
{ "name": "aria-disabled", "value": { "type": "string" } },
|
|
18
|
-
{ "name": "state", "value": { "type": "string" } }
|
|
18
|
+
{ "name": "state", "value": { "type": "string" } },
|
|
19
|
+
{
|
|
20
|
+
"name": "disabled",
|
|
21
|
+
"description": "Whether the native control is disabled.",
|
|
22
|
+
"value": { "type": "boolean" }
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "name",
|
|
26
|
+
"description": "The native element name.",
|
|
27
|
+
"value": { "type": "string" }
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "form",
|
|
31
|
+
"description": "The ID of the associated form; the form property is the native form reference.",
|
|
32
|
+
"value": { "type": "string" }
|
|
33
|
+
}
|
|
19
34
|
],
|
|
20
35
|
"events": [],
|
|
21
36
|
"js": {
|
|
@@ -27,7 +42,27 @@
|
|
|
27
42
|
{ "name": "role" },
|
|
28
43
|
{ "name": "ariaRequired" },
|
|
29
44
|
{ "name": "ariaDisabled" },
|
|
30
|
-
{ "name": "state" }
|
|
45
|
+
{ "name": "state" },
|
|
46
|
+
{ "name": "disabled", "type": "boolean" },
|
|
47
|
+
{ "name": "name", "type": "string" },
|
|
48
|
+
{ "name": "form", "type": "HTMLFormElement | null" },
|
|
49
|
+
{ "name": "elements", "type": "HTMLCollection" },
|
|
50
|
+
{ "name": "type", "type": "string" },
|
|
51
|
+
{ "name": "validity", "type": "ValidityState" },
|
|
52
|
+
{ "name": "validationMessage", "type": "string" },
|
|
53
|
+
{ "name": "willValidate", "type": "boolean" },
|
|
54
|
+
{
|
|
55
|
+
"name": "checkValidity",
|
|
56
|
+
"type": "HTMLFieldSetElement['checkValidity']"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "reportValidity",
|
|
60
|
+
"type": "HTMLFieldSetElement['reportValidity']"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "setCustomValidity",
|
|
64
|
+
"type": "HTMLFieldSetElement['setCustomValidity']"
|
|
65
|
+
}
|
|
31
66
|
],
|
|
32
67
|
"events": []
|
|
33
68
|
}
|